Website : phonehp.ir
backdoor
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Home
Console
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Warning
: Undefined variable $backdoor in
/home/nehpir/public_html/goods.php
on line
326
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
nehpir
/
www
/
wp-content
/
plugins
/
woocommersa
/
assets
/
dist
/
Filename :
index.iife.js
back
Warning
: Undefined variable $file in
/home/nehpir/public_html/goods.php
on line
545
Copy
(function(){"use strict";var tae=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function w1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function nae(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var $D={exports:{}},C1={},FD={exports:{}},Vr={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var vU;function rae(){if(vU)return Vr;vU=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.iterator;function x(Q){return Q===null||typeof Q!="object"?null:(Q=y&&Q[y]||Q["@@iterator"],typeof Q=="function"?Q:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,M={};function j(Q,fe,Ve){this.props=Q,this.context=fe,this.refs=M,this.updater=Ve||C}j.prototype.isReactComponent={},j.prototype.setState=function(Q,fe){if(typeof Q!="object"&&typeof Q!="function"&&Q!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Q,fe,"setState")},j.prototype.forceUpdate=function(Q){this.updater.enqueueForceUpdate(this,Q,"forceUpdate")};function L(){}L.prototype=j.prototype;function D(Q,fe,Ve){this.props=Q,this.context=fe,this.refs=M,this.updater=Ve||C}var z=D.prototype=new L;z.constructor=D,E(z,j.prototype),z.isPureReactComponent=!0;var H=Array.isArray,V=Object.prototype.hasOwnProperty,F={current:null},B={key:!0,ref:!0,__self:!0,__source:!0};function te(Q,fe,Ve){var ne,xe={},Ke=null,qe=null;if(fe!=null)for(ne in fe.ref!==void 0&&(qe=fe.ref),fe.key!==void 0&&(Ke=""+fe.key),fe)V.call(fe,ne)&&!B.hasOwnProperty(ne)&&(xe[ne]=fe[ne]);var we=arguments.length-2;if(we===1)xe.children=Ve;else if(1<we){for(var k=Array(we),_=0;_<we;_++)k[_]=arguments[_+2];xe.children=k}if(Q&&Q.defaultProps)for(ne in we=Q.defaultProps,we)xe[ne]===void 0&&(xe[ne]=we[ne]);return{$$typeof:t,type:Q,key:Ke,ref:qe,props:xe,_owner:F.current}}function ve(Q,fe){return{$$typeof:t,type:Q.type,key:fe,ref:Q.ref,props:Q.props,_owner:Q._owner}}function ce(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===t}function _e(Q){var fe={"=":"=0",":":"=2"};return"$"+Q.replace(/[=:]/g,function(Ve){return fe[Ve]})}var pe=/\/+/g;function Le(Q,fe){return typeof Q=="object"&&Q!==null&&Q.key!=null?_e(""+Q.key):fe.toString(36)}function Fe(Q,fe,Ve,ne,xe){var Ke=typeof Q;(Ke==="undefined"||Ke==="boolean")&&(Q=null);var qe=!1;if(Q===null)qe=!0;else switch(Ke){case"string":case"number":qe=!0;break;case"object":switch(Q.$$typeof){case t:case e:qe=!0}}if(qe)return qe=Q,xe=xe(qe),Q=ne===""?"."+Le(qe,0):ne,H(xe)?(Ve="",Q!=null&&(Ve=Q.replace(pe,"$&/")+"/"),Fe(xe,fe,Ve,"",function(_){return _})):xe!=null&&(ce(xe)&&(xe=ve(xe,Ve+(!xe.key||qe&&qe.key===xe.key?"":(""+xe.key).replace(pe,"$&/")+"/")+Q)),fe.push(xe)),1;if(qe=0,ne=ne===""?".":ne+":",H(Q))for(var we=0;we<Q.length;we++){Ke=Q[we];var k=ne+Le(Ke,we);qe+=Fe(Ke,fe,Ve,k,xe)}else if(k=x(Q),typeof k=="function")for(Q=k.call(Q),we=0;!(Ke=Q.next()).done;)Ke=Ke.value,k=ne+Le(Ke,we++),qe+=Fe(Ke,fe,Ve,k,xe);else if(Ke==="object")throw fe=String(Q),Error("Objects are not valid as a React child (found: "+(fe==="[object Object]"?"object with keys {"+Object.keys(Q).join(", ")+"}":fe)+"). If you meant to render a collection of children, use an array instead.");return qe}function nt(Q,fe,Ve){if(Q==null)return Q;var ne=[],xe=0;return Fe(Q,ne,"","",function(Ke){return fe.call(Ve,Ke,xe++)}),ne}function dt(Q){if(Q._status===-1){var fe=Q._result;fe=fe(),fe.then(function(Ve){(Q._status===0||Q._status===-1)&&(Q._status=1,Q._result=Ve)},function(Ve){(Q._status===0||Q._status===-1)&&(Q._status=2,Q._result=Ve)}),Q._status===-1&&(Q._status=0,Q._result=fe)}if(Q._status===1)return Q._result.default;throw Q._result}var $e={current:null},Re={transition:null},Ze={ReactCurrentDispatcher:$e,ReactCurrentBatchConfig:Re,ReactCurrentOwner:F};function Ee(){throw Error("act(...) is not supported in production builds of React.")}return Vr.Children={map:nt,forEach:function(Q,fe,Ve){nt(Q,function(){fe.apply(this,arguments)},Ve)},count:function(Q){var fe=0;return nt(Q,function(){fe++}),fe},toArray:function(Q){return nt(Q,function(fe){return fe})||[]},only:function(Q){if(!ce(Q))throw Error("React.Children.only expected to receive a single React element child.");return Q}},Vr.Component=j,Vr.Fragment=n,Vr.Profiler=i,Vr.PureComponent=D,Vr.StrictMode=r,Vr.Suspense=h,Vr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ze,Vr.act=Ee,Vr.cloneElement=function(Q,fe,Ve){if(Q==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+Q+".");var ne=E({},Q.props),xe=Q.key,Ke=Q.ref,qe=Q._owner;if(fe!=null){if(fe.ref!==void 0&&(Ke=fe.ref,qe=F.current),fe.key!==void 0&&(xe=""+fe.key),Q.type&&Q.type.defaultProps)var we=Q.type.defaultProps;for(k in fe)V.call(fe,k)&&!B.hasOwnProperty(k)&&(ne[k]=fe[k]===void 0&&we!==void 0?we[k]:fe[k])}var k=arguments.length-2;if(k===1)ne.children=Ve;else if(1<k){we=Array(k);for(var _=0;_<k;_++)we[_]=arguments[_+2];ne.children=we}return{$$typeof:t,type:Q.type,key:xe,ref:Ke,props:ne,_owner:qe}},Vr.createContext=function(Q){return Q={$$typeof:a,_currentValue:Q,_currentValue2:Q,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},Q.Provider={$$typeof:s,_context:Q},Q.Consumer=Q},Vr.createElement=te,Vr.createFactory=function(Q){var fe=te.bind(null,Q);return fe.type=Q,fe},Vr.createRef=function(){return{current:null}},Vr.forwardRef=function(Q){return{$$typeof:u,render:Q}},Vr.isValidElement=ce,Vr.lazy=function(Q){return{$$typeof:g,_payload:{_status:-1,_result:Q},_init:dt}},Vr.memo=function(Q,fe){return{$$typeof:m,type:Q,compare:fe===void 0?null:fe}},Vr.startTransition=function(Q){var fe=Re.transition;Re.transition={};try{Q()}finally{Re.transition=fe}},Vr.unstable_act=Ee,Vr.useCallback=function(Q,fe){return $e.current.useCallback(Q,fe)},Vr.useContext=function(Q){return $e.current.useContext(Q)},Vr.useDebugValue=function(){},Vr.useDeferredValue=function(Q){return $e.current.useDeferredValue(Q)},Vr.useEffect=function(Q,fe){return $e.current.useEffect(Q,fe)},Vr.useId=function(){return $e.current.useId()},Vr.useImperativeHandle=function(Q,fe,Ve){return $e.current.useImperativeHandle(Q,fe,Ve)},Vr.useInsertionEffect=function(Q,fe){return $e.current.useInsertionEffect(Q,fe)},Vr.useLayoutEffect=function(Q,fe){return $e.current.useLayoutEffect(Q,fe)},Vr.useMemo=function(Q,fe){return $e.current.useMemo(Q,fe)},Vr.useReducer=function(Q,fe,Ve){return $e.current.useReducer(Q,fe,Ve)},Vr.useRef=function(Q){return $e.current.useRef(Q)},Vr.useState=function(Q){return $e.current.useState(Q)},Vr.useSyncExternalStore=function(Q,fe,Ve){return $e.current.useSyncExternalStore(Q,fe,Ve)},Vr.useTransition=function(){return $e.current.useTransition()},Vr.version="18.3.1",Vr}var S1={exports:{}};S1.exports;var bU;function iae(){return bU||(bU=1,function(t,e){var n={};/** * @license React * react.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */n.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var r="18.3.1",i=Symbol.for("react.element"),s=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),g=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),j=Symbol.for("react.offscreen"),L=Symbol.iterator,D="@@iterator";function z(K){if(K===null||typeof K!="object")return null;var be=L&&K[L]||K[D];return typeof be=="function"?be:null}var H={current:null},V={transition:null},F={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},B={current:null},te={},ve=null;function ce(K){ve=K}te.setExtraStackFrame=function(K){ve=K},te.getCurrentStack=null,te.getStackAddendum=function(){var K="";ve&&(K+=ve);var be=te.getCurrentStack;return be&&(K+=be()||""),K};var _e=!1,pe=!1,Le=!1,Fe=!1,nt=!1,dt={ReactCurrentDispatcher:H,ReactCurrentBatchConfig:V,ReactCurrentOwner:B};dt.ReactDebugCurrentFrame=te,dt.ReactCurrentActQueue=F;function $e(K){{for(var be=arguments.length,Be=new Array(be>1?be-1:0),at=1;at<be;at++)Be[at-1]=arguments[at];Ze("warn",K,Be)}}function Re(K){{for(var be=arguments.length,Be=new Array(be>1?be-1:0),at=1;at<be;at++)Be[at-1]=arguments[at];Ze("error",K,Be)}}function Ze(K,be,Be){{var at=dt.ReactDebugCurrentFrame,Ot=at.getStackAddendum();Ot!==""&&(be+="%s",Be=Be.concat([Ot]));var It=Be.map(function(qt){return String(qt)});It.unshift("Warning: "+be),Function.prototype.apply.call(console[K],console,It)}}var Ee={};function Q(K,be){{var Be=K.constructor,at=Be&&(Be.displayName||Be.name)||"ReactClass",Ot=at+"."+be;if(Ee[Ot])return;Re("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",be,at),Ee[Ot]=!0}}var fe={isMounted:function(K){return!1},enqueueForceUpdate:function(K,be,Be){Q(K,"forceUpdate")},enqueueReplaceState:function(K,be,Be,at){Q(K,"replaceState")},enqueueSetState:function(K,be,Be,at){Q(K,"setState")}},Ve=Object.assign,ne={};Object.freeze(ne);function xe(K,be,Be){this.props=K,this.context=be,this.refs=ne,this.updater=Be||fe}xe.prototype.isReactComponent={},xe.prototype.setState=function(K,be){if(typeof K!="object"&&typeof K!="function"&&K!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,K,be,"setState")},xe.prototype.forceUpdate=function(K){this.updater.enqueueForceUpdate(this,K,"forceUpdate")};{var Ke={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},qe=function(K,be){Object.defineProperty(xe.prototype,K,{get:function(){$e("%s(...) is deprecated in plain JavaScript React classes. %s",be[0],be[1])}})};for(var we in Ke)Ke.hasOwnProperty(we)&&qe(we,Ke[we])}function k(){}k.prototype=xe.prototype;function _(K,be,Be){this.props=K,this.context=be,this.refs=ne,this.updater=Be||fe}var N=_.prototype=new k;N.constructor=_,Ve(N,xe.prototype),N.isPureReactComponent=!0;function O(){var K={current:null};return Object.seal(K),K}var G=Array.isArray;function q(K){return G(K)}function I(K){{var be=typeof Symbol=="function"&&Symbol.toStringTag,Be=be&&K[Symbol.toStringTag]||K.constructor.name||"Object";return Be}}function Z(K){try{return U(K),!1}catch{return!0}}function U(K){return""+K}function re(K){if(Z(K))return Re("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",I(K)),U(K)}function ae(K,be,Be){var at=K.displayName;if(at)return at;var Ot=be.displayName||be.name||"";return Ot!==""?Be+"("+Ot+")":Be}function he(K){return K.displayName||"Context"}function Me(K){if(K==null)return null;if(typeof K.tag=="number"&&Re("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof K=="function")return K.displayName||K.name||null;if(typeof K=="string")return K;switch(K){case a:return"Fragment";case s:return"Portal";case h:return"Profiler";case u:return"StrictMode";case x:return"Suspense";case C:return"SuspenseList"}if(typeof K=="object")switch(K.$$typeof){case g:var be=K;return he(be)+".Consumer";case m:var Be=K;return he(Be._context)+".Provider";case y:return ae(K,K.render,"ForwardRef");case E:var at=K.displayName||null;return at!==null?at:Me(K.type)||"Memo";case M:{var Ot=K,It=Ot._payload,qt=Ot._init;try{return Me(qt(It))}catch{return null}}}return null}var tt=Object.prototype.hasOwnProperty,ot={key:!0,ref:!0,__self:!0,__source:!0},lt,X,de;de={};function Ce(K){if(tt.call(K,"ref")){var be=Object.getOwnPropertyDescriptor(K,"ref").get;if(be&&be.isReactWarning)return!1}return K.ref!==void 0}function Oe(K){if(tt.call(K,"key")){var be=Object.getOwnPropertyDescriptor(K,"key").get;if(be&&be.isReactWarning)return!1}return K.key!==void 0}function Ge(K,be){var Be=function(){lt||(lt=!0,Re("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",be))};Be.isReactWarning=!0,Object.defineProperty(K,"key",{get:Be,configurable:!0})}function Qe(K,be){var Be=function(){X||(X=!0,Re("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",be))};Be.isReactWarning=!0,Object.defineProperty(K,"ref",{get:Be,configurable:!0})}function se(K){if(typeof K.ref=="string"&&B.current&&K.__self&&B.current.stateNode!==K.__self){var be=Me(B.current.type);de[be]||(Re('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',be,K.ref),de[be]=!0)}}var ie=function(K,be,Be,at,Ot,It,qt){var Vn={$$typeof:i,type:K,key:be,ref:Be,props:qt,_owner:It};return Vn._store={},Object.defineProperty(Vn._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Vn,"_self",{configurable:!1,enumerable:!1,writable:!1,value:at}),Object.defineProperty(Vn,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ot}),Object.freeze&&(Object.freeze(Vn.props),Object.freeze(Vn)),Vn};function J(K,be,Be){var at,Ot={},It=null,qt=null,Vn=null,gr=null;if(be!=null){Ce(be)&&(qt=be.ref,se(be)),Oe(be)&&(re(be.key),It=""+be.key),Vn=be.__self===void 0?null:be.__self,gr=be.__source===void 0?null:be.__source;for(at in be)tt.call(be,at)&&!ot.hasOwnProperty(at)&&(Ot[at]=be[at])}var si=arguments.length-2;if(si===1)Ot.children=Be;else if(si>1){for(var Pi=Array(si),Ai=0;Ai<si;Ai++)Pi[Ai]=arguments[Ai+2];Object.freeze&&Object.freeze(Pi),Ot.children=Pi}if(K&&K.defaultProps){var vr=K.defaultProps;for(at in vr)Ot[at]===void 0&&(Ot[at]=vr[at])}if(It||qt){var Yi=typeof K=="function"?K.displayName||K.name||"Unknown":K;It&&Ge(Ot,Yi),qt&&Qe(Ot,Yi)}return ie(K,It,qt,Vn,gr,B.current,Ot)}function me(K,be){var Be=ie(K.type,be,K.ref,K._self,K._source,K._owner,K.props);return Be}function Se(K,be,Be){if(K==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+K+".");var at,Ot=Ve({},K.props),It=K.key,qt=K.ref,Vn=K._self,gr=K._source,si=K._owner;if(be!=null){Ce(be)&&(qt=be.ref,si=B.current),Oe(be)&&(re(be.key),It=""+be.key);var Pi;K.type&&K.type.defaultProps&&(Pi=K.type.defaultProps);for(at in be)tt.call(be,at)&&!ot.hasOwnProperty(at)&&(be[at]===void 0&&Pi!==void 0?Ot[at]=Pi[at]:Ot[at]=be[at])}var Ai=arguments.length-2;if(Ai===1)Ot.children=Be;else if(Ai>1){for(var vr=Array(Ai),Yi=0;Yi<Ai;Yi++)vr[Yi]=arguments[Yi+2];Ot.children=vr}return ie(K.type,It,qt,Vn,gr,si,Ot)}function je(K){return typeof K=="object"&&K!==null&&K.$$typeof===i}var Pe=".",ut=":";function wt(K){var be=/[=:]/g,Be={"=":"=0",":":"=2"},at=K.replace(be,function(Ot){return Be[Ot]});return"$"+at}var kt=!1,Rt=/\/+/g;function sn(K){return K.replace(Rt,"$&/")}function jn(K,be){return typeof K=="object"&&K!==null&&K.key!=null?(re(K.key),wt(""+K.key)):be.toString(36)}function An(K,be,Be,at,Ot){var It=typeof K;(It==="undefined"||It==="boolean")&&(K=null);var qt=!1;if(K===null)qt=!0;else switch(It){case"string":case"number":qt=!0;break;case"object":switch(K.$$typeof){case i:case s:qt=!0}}if(qt){var Vn=K,gr=Ot(Vn),si=at===""?Pe+jn(Vn,0):at;if(q(gr)){var Pi="";si!=null&&(Pi=sn(si)+"/"),An(gr,be,Pi,"",function(TE){return TE})}else gr!=null&&(je(gr)&&(gr.key&&(!Vn||Vn.key!==gr.key)&&re(gr.key),gr=me(gr,Be+(gr.key&&(!Vn||Vn.key!==gr.key)?sn(""+gr.key)+"/":"")+si)),be.push(gr));return 1}var Ai,vr,Yi=0,Bs=at===""?Pe:at+ut;if(q(K))for(var dp=0;dp<K.length;dp++)Ai=K[dp],vr=Bs+jn(Ai,dp),Yi+=An(Ai,be,Be,vr,Ot);else{var dy=z(K);if(typeof dy=="function"){var hh=K;dy===hh.entries&&(kt||$e("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),kt=!0);for(var hp=dy.call(hh),hy,kE=0;!(hy=hp.next()).done;)Ai=hy.value,vr=Bs+jn(Ai,kE++),Yi+=An(Ai,be,Be,vr,Ot)}else if(It==="object"){var DC=String(K);throw new Error("Objects are not valid as a React child (found: "+(DC==="[object Object]"?"object with keys {"+Object.keys(K).join(", ")+"}":DC)+"). If you meant to render a collection of children, use an array instead.")}}return Yi}function Jn(K,be,Be){if(K==null)return K;var at=[],Ot=0;return An(K,at,"","",function(It){return be.call(Be,It,Ot++)}),at}function Qt(K){var be=0;return Jn(K,function(){be++}),be}function Gt(K,be,Be){Jn(K,function(){be.apply(this,arguments)},Be)}function ir(K){return Jn(K,function(be){return be})||[]}function kn(K){if(!je(K))throw new Error("React.Children.only expected to receive a single React element child.");return K}function Kt(K){var be={$$typeof:g,_currentValue:K,_currentValue2:K,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};be.Provider={$$typeof:m,_context:be};var Be=!1,at=!1,Ot=!1;{var It={$$typeof:g,_context:be};Object.defineProperties(It,{Provider:{get:function(){return at||(at=!0,Re("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),be.Provider},set:function(qt){be.Provider=qt}},_currentValue:{get:function(){return be._currentValue},set:function(qt){be._currentValue=qt}},_currentValue2:{get:function(){return be._currentValue2},set:function(qt){be._currentValue2=qt}},_threadCount:{get:function(){return be._threadCount},set:function(qt){be._threadCount=qt}},Consumer:{get:function(){return Be||(Be=!0,Re("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),be.Consumer}},displayName:{get:function(){return be.displayName},set:function(qt){Ot||($e("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",qt),Ot=!0)}}}),be.Consumer=It}return be._currentRenderer=null,be._currentRenderer2=null,be}var zt=-1,Wt=0,en=1,tn=2;function mn(K){if(K._status===zt){var be=K._result,Be=be();if(Be.then(function(It){if(K._status===Wt||K._status===zt){var qt=K;qt._status=en,qt._result=It}},function(It){if(K._status===Wt||K._status===zt){var qt=K;qt._status=tn,qt._result=It}}),K._status===zt){var at=K;at._status=Wt,at._result=Be}}if(K._status===en){var Ot=K._result;return Ot===void 0&&Re(`lazy: Expected the result of a dynamic import() call. Instead received: %s Your code should look like: const MyComponent = lazy(() => import('./MyComponent')) Did you accidentally put curly braces around the import?`,Ot),"default"in Ot||Re(`lazy: Expected the result of a dynamic import() call. Instead received: %s Your code should look like: const MyComponent = lazy(() => import('./MyComponent'))`,Ot),Ot.default}else throw K._result}function dn(K){var be={_status:zt,_result:K},Be={$$typeof:M,_payload:be,_init:mn};{var at,Ot;Object.defineProperties(Be,{defaultProps:{configurable:!0,get:function(){return at},set:function(It){Re("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),at=It,Object.defineProperty(Be,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return Ot},set:function(It){Re("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),Ot=It,Object.defineProperty(Be,"propTypes",{enumerable:!0})}}})}return Be}function Ne(K){K!=null&&K.$$typeof===E?Re("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof K!="function"?Re("forwardRef requires a render function but was given %s.",K===null?"null":typeof K):K.length!==0&&K.length!==2&&Re("forwardRef render functions accept exactly two parameters: props and ref. %s",K.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),K!=null&&(K.defaultProps!=null||K.propTypes!=null)&&Re("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");var be={$$typeof:y,render:K};{var Be;Object.defineProperty(be,"displayName",{enumerable:!1,configurable:!0,get:function(){return Be},set:function(at){Be=at,!K.name&&!K.displayName&&(K.displayName=at)}})}return be}var oe;oe=Symbol.for("react.module.reference");function Ae(K){return!!(typeof K=="string"||typeof K=="function"||K===a||K===h||nt||K===u||K===x||K===C||Fe||K===j||_e||pe||Le||typeof K=="object"&&K!==null&&(K.$$typeof===M||K.$$typeof===E||K.$$typeof===m||K.$$typeof===g||K.$$typeof===y||K.$$typeof===oe||K.getModuleId!==void 0))}function Je(K,be){Ae(K)||Re("memo: The first argument must be a component. Instead received: %s",K===null?"null":typeof K);var Be={$$typeof:E,type:K,compare:be===void 0?null:be};{var at;Object.defineProperty(Be,"displayName",{enumerable:!1,configurable:!0,get:function(){return at},set:function(Ot){at=Ot,!K.name&&!K.displayName&&(K.displayName=Ot)}})}return Be}function vt(){var K=H.current;return K===null&&Re(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as React DOM) 2. You might be breaking the Rules of Hooks 3. You might have more than one copy of React in the same app See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),K}function Vt(K){var be=vt();if(K._context!==void 0){var Be=K._context;Be.Consumer===K?Re("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):Be.Provider===K&&Re("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return be.useContext(K)}function $t(K){var be=vt();return be.useState(K)}function jt(K,be,Be){var at=vt();return at.useReducer(K,be,Be)}function Ft(K){var be=vt();return be.useRef(K)}function Ct(K,be){var Be=vt();return Be.useEffect(K,be)}function ge(K,be){var Be=vt();return Be.useInsertionEffect(K,be)}function ct(K,be){var Be=vt();return Be.useLayoutEffect(K,be)}function xt(K,be){var Be=vt();return Be.useCallback(K,be)}function Bn(K,be){var Be=vt();return Be.useMemo(K,be)}function vn(K,be,Be){var at=vt();return at.useImperativeHandle(K,be,Be)}function Sn(K,be){{var Be=vt();return Be.useDebugValue(K,be)}}function Bt(){var K=vt();return K.useTransition()}function Tr(K){var be=vt();return be.useDeferredValue(K)}function dr(){var K=vt();return K.useId()}function Sr(K,be,Be){var at=vt();return at.useSyncExternalStore(K,be,Be)}var In=0,ni,Fr,Vi,Bi,Lo,aa,$o;function Fo(){}Fo.__reactDisabledLog=!0;function ps(){{if(In===0){ni=console.log,Fr=console.info,Vi=console.warn,Bi=console.error,Lo=console.group,aa=console.groupCollapsed,$o=console.groupEnd;var K={configurable:!0,enumerable:!0,value:Fo,writable:!0};Object.defineProperties(console,{info:K,log:K,warn:K,error:K,group:K,groupCollapsed:K,groupEnd:K})}In++}}function gs(){{if(In--,In===0){var K={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ve({},K,{value:ni}),info:Ve({},K,{value:Fr}),warn:Ve({},K,{value:Vi}),error:Ve({},K,{value:Bi}),group:Ve({},K,{value:Lo}),groupCollapsed:Ve({},K,{value:aa}),groupEnd:Ve({},K,{value:$o})})}In<0&&Re("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var zo=dt.ReactCurrentDispatcher,xl;function wl(K,be,Be){{if(xl===void 0)try{throw Error()}catch(Ot){var at=Ot.stack.trim().match(/\n( *(at )?)/);xl=at&&at[1]||""}return` `+xl+K}}var Vo=!1,nc;{var Eu=typeof WeakMap=="function"?WeakMap:Map;nc=new Eu}function Cl(K,be){if(!K||Vo)return"";{var Be=nc.get(K);if(Be!==void 0)return Be}var at;Vo=!0;var Ot=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var It;It=zo.current,zo.current=null,ps();try{if(be){var qt=function(){throw Error()};if(Object.defineProperty(qt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(qt,[])}catch(Bs){at=Bs}Reflect.construct(K,[],qt)}else{try{qt.call()}catch(Bs){at=Bs}K.call(qt.prototype)}}else{try{throw Error()}catch(Bs){at=Bs}K()}}catch(Bs){if(Bs&&at&&typeof Bs.stack=="string"){for(var Vn=Bs.stack.split(` `),gr=at.stack.split(` `),si=Vn.length-1,Pi=gr.length-1;si>=1&&Pi>=0&&Vn[si]!==gr[Pi];)Pi--;for(;si>=1&&Pi>=0;si--,Pi--)if(Vn[si]!==gr[Pi]){if(si!==1||Pi!==1)do if(si--,Pi--,Pi<0||Vn[si]!==gr[Pi]){var Ai=` `+Vn[si].replace(" at new "," at ");return K.displayName&&Ai.includes("<anonymous>")&&(Ai=Ai.replace("<anonymous>",K.displayName)),typeof K=="function"&&nc.set(K,Ai),Ai}while(si>=1&&Pi>=0);break}}}finally{Vo=!1,zo.current=It,gs(),Error.prepareStackTrace=Ot}var vr=K?K.displayName||K.name:"",Yi=vr?wl(vr):"";return typeof K=="function"&&nc.set(K,Yi),Yi}function Nu(K,be,Be){return Cl(K,!1)}function rc(K){var be=K.prototype;return!!(be&&be.isReactComponent)}function Cr(K,be,Be){if(K==null)return"";if(typeof K=="function")return Cl(K,rc(K));if(typeof K=="string")return wl(K);switch(K){case x:return wl("Suspense");case C:return wl("SuspenseList")}if(typeof K=="object")switch(K.$$typeof){case y:return Nu(K.render);case E:return Cr(K.type,be,Be);case M:{var at=K,Ot=at._payload,It=at._init;try{return Cr(It(Ot),be,Be)}catch{}}}return""}var no={},Bo=dt.ReactDebugCurrentFrame;function sr(K){if(K){var be=K._owner,Be=Cr(K.type,K._source,be?be.type:null);Bo.setExtraStackFrame(Be)}else Bo.setExtraStackFrame(null)}function ro(K,be,Be,at,Ot){{var It=Function.call.bind(tt);for(var qt in K)if(It(K,qt)){var Vn=void 0;try{if(typeof K[qt]!="function"){var gr=Error((at||"React class")+": "+Be+" type `"+qt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof K[qt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw gr.name="Invariant Violation",gr}Vn=K[qt](be,qt,at,Be,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(si){Vn=si}Vn&&!(Vn instanceof Error)&&(sr(Ot),Re("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",at||"React class",Be,qt,typeof Vn),sr(null)),Vn instanceof Error&&!(Vn.message in no)&&(no[Vn.message]=!0,sr(Ot),Re("Failed %s type: %s",Be,Vn.message),sr(null))}}}function io(K){if(K){var be=K._owner,Be=Cr(K.type,K._source,be?be.type:null);ce(Be)}else ce(null)}var _n;_n=!1;function ic(){if(B.current){var K=Me(B.current.type);if(K)return` Check the render method of \``+K+"`."}return""}function pi(K){if(K!==void 0){var be=K.fileName.replace(/^.*[\\\/]/,""),Be=K.lineNumber;return` Check your code at `+be+":"+Be+"."}return""}function Fs(K){return K!=null?pi(K.__source):""}var zs={};function la(K){var be=ic();if(!be){var Be=typeof K=="string"?K:K.displayName||K.name;Be&&(be=` Check the top-level render call using <`+Be+">.")}return be}function ji(K,be){if(!(!K._store||K._store.validated||K.key!=null)){K._store.validated=!0;var Be=la(be);if(!zs[Be]){zs[Be]=!0;var at="";K&&K._owner&&K._owner!==B.current&&(at=" It was passed a child from "+Me(K._owner.type)+"."),io(K),Re('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Be,at),io(null)}}}function Or(K,be){if(typeof K=="object"){if(q(K))for(var Be=0;Be<K.length;Be++){var at=K[Be];je(at)&&ji(at,be)}else if(je(K))K._store&&(K._store.validated=!0);else if(K){var Ot=z(K);if(typeof Ot=="function"&&Ot!==K.entries)for(var It=Ot.call(K),qt;!(qt=It.next()).done;)je(qt.value)&&ji(qt.value,be)}}}function Ss(K){{var be=K.type;if(be==null||typeof be=="string")return;var Be;if(typeof be=="function")Be=be.propTypes;else if(typeof be=="object"&&(be.$$typeof===y||be.$$typeof===E))Be=be.propTypes;else return;if(Be){var at=Me(be);ro(Be,K.props,"prop",at,K)}else if(be.PropTypes!==void 0&&!_n){_n=!0;var Ot=Me(be);Re("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ot||"Unknown")}typeof be.getDefaultProps=="function"&&!be.getDefaultProps.isReactClassApproved&&Re("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Rs(K){{for(var be=Object.keys(K.props),Be=0;Be<be.length;Be++){var at=be[Be];if(at!=="children"&&at!=="key"){io(K),Re("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",at),io(null);break}}K.ref!==null&&(io(K),Re("Invalid attribute `ref` supplied to `React.Fragment`."),io(null))}}function Wn(K,be,Be){var at=Ae(K);if(!at){var Ot="";(K===void 0||typeof K=="object"&&K!==null&&Object.keys(K).length===0)&&(Ot+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var It=Fs(be);It?Ot+=It:Ot+=ic();var qt;K===null?qt="null":q(K)?qt="array":K!==void 0&&K.$$typeof===i?(qt="<"+(Me(K.type)||"Unknown")+" />",Ot=" Did you accidentally export a JSX literal instead of a component?"):qt=typeof K,Re("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",qt,Ot)}var Vn=J.apply(this,arguments);if(Vn==null)return Vn;if(at)for(var gr=2;gr<arguments.length;gr++)Or(arguments[gr],K);return K===a?Rs(Vn):Ss(Vn),Vn}var Wi=!1;function dh(K){var be=Wn.bind(null,K);return be.type=K,Wi||(Wi=!0,$e("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(be,"type",{enumerable:!1,get:function(){return $e("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:K}),K}}),be}function Ut(K,be,Be){for(var at=Se.apply(this,arguments),Ot=2;Ot<arguments.length;Ot++)Or(arguments[Ot],at.type);return Ss(at),at}function lr(K,be){var Be=V.transition;V.transition={};var at=V.transition;V.transition._updatedFibers=new Set;try{K()}finally{if(V.transition=Be,Be===null&&at._updatedFibers){var Ot=at._updatedFibers.size;Ot>10&&$e("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),at._updatedFibers.clear()}}}var Zn=!1,Gn=null;function Mi(K){if(Gn===null)try{var be=("require"+Math.random()).slice(0,7),Be=t&&t[be];Gn=Be.call(t,"timers").setImmediate}catch{Gn=function(Ot){Zn===!1&&(Zn=!0,typeof MessageChannel>"u"&&Re("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var It=new MessageChannel;It.port1.onmessage=Ot,It.port2.postMessage(void 0)}}return Gn(K)}var Kr=0,Rr=!1;function Ui(K){{var be=Kr;Kr++,F.current===null&&(F.current=[]);var Be=F.isBatchingLegacy,at;try{if(F.isBatchingLegacy=!0,at=K(),!Be&&F.didScheduleLegacyUpdate){var Ot=F.current;Ot!==null&&(F.didScheduleLegacyUpdate=!1,Vs(Ot))}}catch(vr){throw Ji(be),vr}finally{F.isBatchingLegacy=Be}if(at!==null&&typeof at=="object"&&typeof at.then=="function"){var It=at,qt=!1,Vn={then:function(vr,Yi){qt=!0,It.then(function(Bs){Ji(be),Kr===0?Wo(Bs,vr,Yi):vr(Bs)},function(Bs){Ji(be),Yi(Bs)})}};return!Rr&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){qt||(Rr=!0,Re("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),Vn}else{var gr=at;if(Ji(be),Kr===0){var si=F.current;si!==null&&(Vs(si),F.current=null);var Pi={then:function(vr,Yi){F.current===null?(F.current=[],Wo(gr,vr,Yi)):vr(gr)}};return Pi}else{var Ai={then:function(vr,Yi){vr(gr)}};return Ai}}}}function Ji(K){K!==Kr-1&&Re("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Kr=K}function Wo(K,be,Be){{var at=F.current;if(at!==null)try{Vs(at),Mi(function(){at.length===0?(F.current=null,be(K)):Wo(K,be,Be)})}catch(Ot){Be(Ot)}else be(K)}}var Ro=!1;function Vs(K){if(!Ro){Ro=!0;var be=0;try{for(;be<K.length;be++){var Be=K[be];do Be=Be(!0);while(Be!==null)}K.length=0}catch(at){throw K=K.slice(be+1),at}finally{Ro=!1}}}var St=Wn,Ln=Ut,pr=dh,vs={map:Jn,forEach:Gt,count:Qt,toArray:ir,only:kn};e.Children=vs,e.Component=xe,e.Fragment=a,e.Profiler=h,e.PureComponent=_,e.StrictMode=u,e.Suspense=x,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dt,e.act=Ui,e.cloneElement=Ln,e.createContext=Kt,e.createElement=St,e.createFactory=pr,e.createRef=O,e.forwardRef=Ne,e.isValidElement=je,e.lazy=dn,e.memo=Je,e.startTransition=lr,e.unstable_act=Ui,e.useCallback=xt,e.useContext=Vt,e.useDebugValue=Sn,e.useDeferredValue=Tr,e.useEffect=Ct,e.useId=dr,e.useImperativeHandle=vn,e.useInsertionEffect=ge,e.useLayoutEffect=ct,e.useMemo=Bn,e.useReducer=jt,e.useRef=Ft,e.useState=$t,e.useSyncExternalStore=Sr,e.useTransition=Bt,e.version=r,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()}(S1,S1.exports)),S1.exports}var sae={};sae.NODE_ENV==="production"?FD.exports=rae():FD.exports=iae();var W=FD.exports;const bi=w1(W);/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var yU;function oae(){if(yU)return C1;yU=1;var t=W,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(u,h,m){var g,y={},x=null,C=null;m!==void 0&&(x=""+m),h.key!==void 0&&(x=""+h.key),h.ref!==void 0&&(C=h.ref);for(g in h)r.call(h,g)&&!s.hasOwnProperty(g)&&(y[g]=h[g]);if(u&&u.defaultProps)for(g in h=u.defaultProps,h)y[g]===void 0&&(y[g]=h[g]);return{$$typeof:e,type:u,key:x,ref:C,props:y,_owner:i.current}}return C1.Fragment=n,C1.jsx=a,C1.jsxs=a,C1}var R1={},xU;function aae(){if(xU)return R1;xU=1;var t={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */return t.NODE_ENV!=="production"&&function(){var e=W,n=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),M=Symbol.iterator,j="@@iterator";function L(oe){if(oe===null||typeof oe!="object")return null;var Ae=M&&oe[M]||oe[j];return typeof Ae=="function"?Ae:null}var D=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function z(oe){{for(var Ae=arguments.length,Je=new Array(Ae>1?Ae-1:0),vt=1;vt<Ae;vt++)Je[vt-1]=arguments[vt];H("error",oe,Je)}}function H(oe,Ae,Je){{var vt=D.ReactDebugCurrentFrame,Vt=vt.getStackAddendum();Vt!==""&&(Ae+="%s",Je=Je.concat([Vt]));var $t=Je.map(function(jt){return String(jt)});$t.unshift("Warning: "+Ae),Function.prototype.apply.call(console[oe],console,$t)}}var V=!1,F=!1,B=!1,te=!1,ve=!1,ce;ce=Symbol.for("react.module.reference");function _e(oe){return!!(typeof oe=="string"||typeof oe=="function"||oe===i||oe===a||ve||oe===s||oe===g||oe===y||te||oe===E||V||F||B||typeof oe=="object"&&oe!==null&&(oe.$$typeof===C||oe.$$typeof===x||oe.$$typeof===u||oe.$$typeof===h||oe.$$typeof===m||oe.$$typeof===ce||oe.getModuleId!==void 0))}function pe(oe,Ae,Je){var vt=oe.displayName;if(vt)return vt;var Vt=Ae.displayName||Ae.name||"";return Vt!==""?Je+"("+Vt+")":Je}function Le(oe){return oe.displayName||"Context"}function Fe(oe){if(oe==null)return null;if(typeof oe.tag=="number"&&z("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof oe=="function")return oe.displayName||oe.name||null;if(typeof oe=="string")return oe;switch(oe){case i:return"Fragment";case r:return"Portal";case a:return"Profiler";case s:return"StrictMode";case g:return"Suspense";case y:return"SuspenseList"}if(typeof oe=="object")switch(oe.$$typeof){case h:var Ae=oe;return Le(Ae)+".Consumer";case u:var Je=oe;return Le(Je._context)+".Provider";case m:return pe(oe,oe.render,"ForwardRef");case x:var vt=oe.displayName||null;return vt!==null?vt:Fe(oe.type)||"Memo";case C:{var Vt=oe,$t=Vt._payload,jt=Vt._init;try{return Fe(jt($t))}catch{return null}}}return null}var nt=Object.assign,dt=0,$e,Re,Ze,Ee,Q,fe,Ve;function ne(){}ne.__reactDisabledLog=!0;function xe(){{if(dt===0){$e=console.log,Re=console.info,Ze=console.warn,Ee=console.error,Q=console.group,fe=console.groupCollapsed,Ve=console.groupEnd;var oe={configurable:!0,enumerable:!0,value:ne,writable:!0};Object.defineProperties(console,{info:oe,log:oe,warn:oe,error:oe,group:oe,groupCollapsed:oe,groupEnd:oe})}dt++}}function Ke(){{if(dt--,dt===0){var oe={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:nt({},oe,{value:$e}),info:nt({},oe,{value:Re}),warn:nt({},oe,{value:Ze}),error:nt({},oe,{value:Ee}),group:nt({},oe,{value:Q}),groupCollapsed:nt({},oe,{value:fe}),groupEnd:nt({},oe,{value:Ve})})}dt<0&&z("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var qe=D.ReactCurrentDispatcher,we;function k(oe,Ae,Je){{if(we===void 0)try{throw Error()}catch(Vt){var vt=Vt.stack.trim().match(/\n( *(at )?)/);we=vt&&vt[1]||""}return` `+we+oe}}var _=!1,N;{var O=typeof WeakMap=="function"?WeakMap:Map;N=new O}function G(oe,Ae){if(!oe||_)return"";{var Je=N.get(oe);if(Je!==void 0)return Je}var vt;_=!0;var Vt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var $t;$t=qe.current,qe.current=null,xe();try{if(Ae){var jt=function(){throw Error()};if(Object.defineProperty(jt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(jt,[])}catch(Sn){vt=Sn}Reflect.construct(oe,[],jt)}else{try{jt.call()}catch(Sn){vt=Sn}oe.call(jt.prototype)}}else{try{throw Error()}catch(Sn){vt=Sn}oe()}}catch(Sn){if(Sn&&vt&&typeof Sn.stack=="string"){for(var Ft=Sn.stack.split(` `),Ct=vt.stack.split(` `),ge=Ft.length-1,ct=Ct.length-1;ge>=1&&ct>=0&&Ft[ge]!==Ct[ct];)ct--;for(;ge>=1&&ct>=0;ge--,ct--)if(Ft[ge]!==Ct[ct]){if(ge!==1||ct!==1)do if(ge--,ct--,ct<0||Ft[ge]!==Ct[ct]){var xt=` `+Ft[ge].replace(" at new "," at ");return oe.displayName&&xt.includes("<anonymous>")&&(xt=xt.replace("<anonymous>",oe.displayName)),typeof oe=="function"&&N.set(oe,xt),xt}while(ge>=1&&ct>=0);break}}}finally{_=!1,qe.current=$t,Ke(),Error.prepareStackTrace=Vt}var Bn=oe?oe.displayName||oe.name:"",vn=Bn?k(Bn):"";return typeof oe=="function"&&N.set(oe,vn),vn}function q(oe,Ae,Je){return G(oe,!1)}function I(oe){var Ae=oe.prototype;return!!(Ae&&Ae.isReactComponent)}function Z(oe,Ae,Je){if(oe==null)return"";if(typeof oe=="function")return G(oe,I(oe));if(typeof oe=="string")return k(oe);switch(oe){case g:return k("Suspense");case y:return k("SuspenseList")}if(typeof oe=="object")switch(oe.$$typeof){case m:return q(oe.render);case x:return Z(oe.type,Ae,Je);case C:{var vt=oe,Vt=vt._payload,$t=vt._init;try{return Z($t(Vt),Ae,Je)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,re={},ae=D.ReactDebugCurrentFrame;function he(oe){if(oe){var Ae=oe._owner,Je=Z(oe.type,oe._source,Ae?Ae.type:null);ae.setExtraStackFrame(Je)}else ae.setExtraStackFrame(null)}function Me(oe,Ae,Je,vt,Vt){{var $t=Function.call.bind(U);for(var jt in oe)if($t(oe,jt)){var Ft=void 0;try{if(typeof oe[jt]!="function"){var Ct=Error((vt||"React class")+": "+Je+" type `"+jt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof oe[jt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ct.name="Invariant Violation",Ct}Ft=oe[jt](Ae,jt,vt,Je,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ge){Ft=ge}Ft&&!(Ft instanceof Error)&&(he(Vt),z("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",vt||"React class",Je,jt,typeof Ft),he(null)),Ft instanceof Error&&!(Ft.message in re)&&(re[Ft.message]=!0,he(Vt),z("Failed %s type: %s",Je,Ft.message),he(null))}}}var tt=Array.isArray;function ot(oe){return tt(oe)}function lt(oe){{var Ae=typeof Symbol=="function"&&Symbol.toStringTag,Je=Ae&&oe[Symbol.toStringTag]||oe.constructor.name||"Object";return Je}}function X(oe){try{return de(oe),!1}catch{return!0}}function de(oe){return""+oe}function Ce(oe){if(X(oe))return z("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",lt(oe)),de(oe)}var Oe=D.ReactCurrentOwner,Ge={key:!0,ref:!0,__self:!0,__source:!0},Qe,se;function ie(oe){if(U.call(oe,"ref")){var Ae=Object.getOwnPropertyDescriptor(oe,"ref").get;if(Ae&&Ae.isReactWarning)return!1}return oe.ref!==void 0}function J(oe){if(U.call(oe,"key")){var Ae=Object.getOwnPropertyDescriptor(oe,"key").get;if(Ae&&Ae.isReactWarning)return!1}return oe.key!==void 0}function me(oe,Ae){typeof oe.ref=="string"&&Oe.current}function Se(oe,Ae){{var Je=function(){Qe||(Qe=!0,z("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ae))};Je.isReactWarning=!0,Object.defineProperty(oe,"key",{get:Je,configurable:!0})}}function je(oe,Ae){{var Je=function(){se||(se=!0,z("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ae))};Je.isReactWarning=!0,Object.defineProperty(oe,"ref",{get:Je,configurable:!0})}}var Pe=function(oe,Ae,Je,vt,Vt,$t,jt){var Ft={$$typeof:n,type:oe,key:Ae,ref:Je,props:jt,_owner:$t};return Ft._store={},Object.defineProperty(Ft._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Ft,"_self",{configurable:!1,enumerable:!1,writable:!1,value:vt}),Object.defineProperty(Ft,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Vt}),Object.freeze&&(Object.freeze(Ft.props),Object.freeze(Ft)),Ft};function ut(oe,Ae,Je,vt,Vt){{var $t,jt={},Ft=null,Ct=null;Je!==void 0&&(Ce(Je),Ft=""+Je),J(Ae)&&(Ce(Ae.key),Ft=""+Ae.key),ie(Ae)&&(Ct=Ae.ref,me(Ae,Vt));for($t in Ae)U.call(Ae,$t)&&!Ge.hasOwnProperty($t)&&(jt[$t]=Ae[$t]);if(oe&&oe.defaultProps){var ge=oe.defaultProps;for($t in ge)jt[$t]===void 0&&(jt[$t]=ge[$t])}if(Ft||Ct){var ct=typeof oe=="function"?oe.displayName||oe.name||"Unknown":oe;Ft&&Se(jt,ct),Ct&&je(jt,ct)}return Pe(oe,Ft,Ct,Vt,vt,Oe.current,jt)}}var wt=D.ReactCurrentOwner,kt=D.ReactDebugCurrentFrame;function Rt(oe){if(oe){var Ae=oe._owner,Je=Z(oe.type,oe._source,Ae?Ae.type:null);kt.setExtraStackFrame(Je)}else kt.setExtraStackFrame(null)}var sn;sn=!1;function jn(oe){return typeof oe=="object"&&oe!==null&&oe.$$typeof===n}function An(){{if(wt.current){var oe=Fe(wt.current.type);if(oe)return` Check the render method of \``+oe+"`."}return""}}function Jn(oe){return""}var Qt={};function Gt(oe){{var Ae=An();if(!Ae){var Je=typeof oe=="string"?oe:oe.displayName||oe.name;Je&&(Ae=` Check the top-level render call using <`+Je+">.")}return Ae}}function ir(oe,Ae){{if(!oe._store||oe._store.validated||oe.key!=null)return;oe._store.validated=!0;var Je=Gt(Ae);if(Qt[Je])return;Qt[Je]=!0;var vt="";oe&&oe._owner&&oe._owner!==wt.current&&(vt=" It was passed a child from "+Fe(oe._owner.type)+"."),Rt(oe),z('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Je,vt),Rt(null)}}function kn(oe,Ae){{if(typeof oe!="object")return;if(ot(oe))for(var Je=0;Je<oe.length;Je++){var vt=oe[Je];jn(vt)&&ir(vt,Ae)}else if(jn(oe))oe._store&&(oe._store.validated=!0);else if(oe){var Vt=L(oe);if(typeof Vt=="function"&&Vt!==oe.entries)for(var $t=Vt.call(oe),jt;!(jt=$t.next()).done;)jn(jt.value)&&ir(jt.value,Ae)}}}function Kt(oe){{var Ae=oe.type;if(Ae==null||typeof Ae=="string")return;var Je;if(typeof Ae=="function")Je=Ae.propTypes;else if(typeof Ae=="object"&&(Ae.$$typeof===m||Ae.$$typeof===x))Je=Ae.propTypes;else return;if(Je){var vt=Fe(Ae);Me(Je,oe.props,"prop",vt,oe)}else if(Ae.PropTypes!==void 0&&!sn){sn=!0;var Vt=Fe(Ae);z("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Vt||"Unknown")}typeof Ae.getDefaultProps=="function"&&!Ae.getDefaultProps.isReactClassApproved&&z("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function zt(oe){{for(var Ae=Object.keys(oe.props),Je=0;Je<Ae.length;Je++){var vt=Ae[Je];if(vt!=="children"&&vt!=="key"){Rt(oe),z("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",vt),Rt(null);break}}oe.ref!==null&&(Rt(oe),z("Invalid attribute `ref` supplied to `React.Fragment`."),Rt(null))}}var Wt={};function en(oe,Ae,Je,vt,Vt,$t){{var jt=_e(oe);if(!jt){var Ft="";(oe===void 0||typeof oe=="object"&&oe!==null&&Object.keys(oe).length===0)&&(Ft+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ct=Jn();Ct?Ft+=Ct:Ft+=An();var ge;oe===null?ge="null":ot(oe)?ge="array":oe!==void 0&&oe.$$typeof===n?(ge="<"+(Fe(oe.type)||"Unknown")+" />",Ft=" Did you accidentally export a JSX literal instead of a component?"):ge=typeof oe,z("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ge,Ft)}var ct=ut(oe,Ae,Je,Vt,$t);if(ct==null)return ct;if(jt){var xt=Ae.children;if(xt!==void 0)if(vt)if(ot(xt)){for(var Bn=0;Bn<xt.length;Bn++)kn(xt[Bn],oe);Object.freeze&&Object.freeze(xt)}else z("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else kn(xt,oe)}if(U.call(Ae,"key")){var vn=Fe(oe),Sn=Object.keys(Ae).filter(function(dr){return dr!=="key"}),Bt=Sn.length>0?"{key: someKey, "+Sn.join(": ..., ")+": ...}":"{key: someKey}";if(!Wt[vn+Bt]){var Tr=Sn.length>0?"{"+Sn.join(": ..., ")+": ...}":"{}";z(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,Bt,vn,Tr,vn),Wt[vn+Bt]=!0}}return oe===i?zt(ct):Kt(ct),ct}}function tn(oe,Ae,Je){return en(oe,Ae,Je,!0)}function mn(oe,Ae,Je){return en(oe,Ae,Je,!1)}var dn=mn,Ne=tn;R1.Fragment=i,R1.jsx=dn,R1.jsxs=Ne}(),R1}var lae={};lae.NODE_ENV==="production"?$D.exports=oae():$D.exports=aae();var o=$D.exports,_1={},zD={exports:{}},gc={},kk={exports:{}},VD={};/** * @license React * scheduler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var wU;function cae(){return wU||(wU=1,function(t){function e(Re,Ze){var Ee=Re.length;Re.push(Ze);e:for(;0<Ee;){var Q=Ee-1>>>1,fe=Re[Q];if(0<i(fe,Ze))Re[Q]=Ze,Re[Ee]=fe,Ee=Q;else break e}}function n(Re){return Re.length===0?null:Re[0]}function r(Re){if(Re.length===0)return null;var Ze=Re[0],Ee=Re.pop();if(Ee!==Ze){Re[0]=Ee;e:for(var Q=0,fe=Re.length,Ve=fe>>>1;Q<Ve;){var ne=2*(Q+1)-1,xe=Re[ne],Ke=ne+1,qe=Re[Ke];if(0>i(xe,Ee))Ke<fe&&0>i(qe,xe)?(Re[Q]=qe,Re[Ke]=Ee,Q=Ke):(Re[Q]=xe,Re[ne]=Ee,Q=ne);else if(Ke<fe&&0>i(qe,Ee))Re[Q]=qe,Re[Ke]=Ee,Q=Ke;else break e}}return Ze}function i(Re,Ze){var Ee=Re.sortIndex-Ze.sortIndex;return Ee!==0?Ee:Re.id-Ze.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}var h=[],m=[],g=1,y=null,x=3,C=!1,E=!1,M=!1,j=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function z(Re){for(var Ze=n(m);Ze!==null;){if(Ze.callback===null)r(m);else if(Ze.startTime<=Re)r(m),Ze.sortIndex=Ze.expirationTime,e(h,Ze);else break;Ze=n(m)}}function H(Re){if(M=!1,z(Re),!E)if(n(h)!==null)E=!0,dt(V);else{var Ze=n(m);Ze!==null&&$e(H,Ze.startTime-Re)}}function V(Re,Ze){E=!1,M&&(M=!1,L(te),te=-1),C=!0;var Ee=x;try{for(z(Ze),y=n(h);y!==null&&(!(y.expirationTime>Ze)||Re&&!_e());){var Q=y.callback;if(typeof Q=="function"){y.callback=null,x=y.priorityLevel;var fe=Q(y.expirationTime<=Ze);Ze=t.unstable_now(),typeof fe=="function"?y.callback=fe:y===n(h)&&r(h),z(Ze)}else r(h);y=n(h)}if(y!==null)var Ve=!0;else{var ne=n(m);ne!==null&&$e(H,ne.startTime-Ze),Ve=!1}return Ve}finally{y=null,x=Ee,C=!1}}var F=!1,B=null,te=-1,ve=5,ce=-1;function _e(){return!(t.unstable_now()-ce<ve)}function pe(){if(B!==null){var Re=t.unstable_now();ce=Re;var Ze=!0;try{Ze=B(!0,Re)}finally{Ze?Le():(F=!1,B=null)}}else F=!1}var Le;if(typeof D=="function")Le=function(){D(pe)};else if(typeof MessageChannel<"u"){var Fe=new MessageChannel,nt=Fe.port2;Fe.port1.onmessage=pe,Le=function(){nt.postMessage(null)}}else Le=function(){j(pe,0)};function dt(Re){B=Re,F||(F=!0,Le())}function $e(Re,Ze){te=j(function(){Re(t.unstable_now())},Ze)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(Re){Re.callback=null},t.unstable_continueExecution=function(){E||C||(E=!0,dt(V))},t.unstable_forceFrameRate=function(Re){0>Re||125<Re?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ve=0<Re?Math.floor(1e3/Re):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_getFirstCallbackNode=function(){return n(h)},t.unstable_next=function(Re){switch(x){case 1:case 2:case 3:var Ze=3;break;default:Ze=x}var Ee=x;x=Ze;try{return Re()}finally{x=Ee}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(Re,Ze){switch(Re){case 1:case 2:case 3:case 4:case 5:break;default:Re=3}var Ee=x;x=Re;try{return Ze()}finally{x=Ee}},t.unstable_scheduleCallback=function(Re,Ze,Ee){var Q=t.unstable_now();switch(typeof Ee=="object"&&Ee!==null?(Ee=Ee.delay,Ee=typeof Ee=="number"&&0<Ee?Q+Ee:Q):Ee=Q,Re){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=Ee+fe,Re={id:g++,callback:Ze,priorityLevel:Re,startTime:Ee,expirationTime:fe,sortIndex:-1},Ee>Q?(Re.sortIndex=Ee,e(m,Re),n(h)===null&&Re===n(m)&&(M?(L(te),te=-1):M=!0,$e(H,Ee-Q))):(Re.sortIndex=fe,e(h,Re),E||C||(E=!0,dt(V))),Re},t.unstable_shouldYield=_e,t.unstable_wrapCallback=function(Re){var Ze=x;return function(){var Ee=x;x=Ze;try{return Re.apply(this,arguments)}finally{x=Ee}}}}(VD)),VD}var BD={},CU;function uae(){return CU||(CU=1,function(t){var e={};/** * @license React * scheduler.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */e.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n=!1,r=5;function i(se,ie){var J=se.length;se.push(ie),u(se,ie,J)}function s(se){return se.length===0?null:se[0]}function a(se){if(se.length===0)return null;var ie=se[0],J=se.pop();return J!==ie&&(se[0]=J,h(se,J,0)),ie}function u(se,ie,J){for(var me=J;me>0;){var Se=me-1>>>1,je=se[Se];if(m(je,ie)>0)se[Se]=ie,se[me]=je,me=Se;else return}}function h(se,ie,J){for(var me=J,Se=se.length,je=Se>>>1;me<je;){var Pe=(me+1)*2-1,ut=se[Pe],wt=Pe+1,kt=se[wt];if(m(ut,ie)<0)wt<Se&&m(kt,ut)<0?(se[me]=kt,se[wt]=ie,me=wt):(se[me]=ut,se[Pe]=ie,me=Pe);else if(wt<Se&&m(kt,ie)<0)se[me]=kt,se[wt]=ie,me=wt;else return}}function m(se,ie){var J=se.sortIndex-ie.sortIndex;return J!==0?J:se.id-ie.id}var g=1,y=2,x=3,C=4,E=5;function M(se,ie){}var j=typeof performance=="object"&&typeof performance.now=="function";if(j){var L=performance;t.unstable_now=function(){return L.now()}}else{var D=Date,z=D.now();t.unstable_now=function(){return D.now()-z}}var H=1073741823,V=-1,F=250,B=5e3,te=1e4,ve=H,ce=[],_e=[],pe=1,Le=null,Fe=x,nt=!1,dt=!1,$e=!1,Re=typeof setTimeout=="function"?setTimeout:null,Ze=typeof clearTimeout=="function"?clearTimeout:null,Ee=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Q(se){for(var ie=s(_e);ie!==null;){if(ie.callback===null)a(_e);else if(ie.startTime<=se)a(_e),ie.sortIndex=ie.expirationTime,i(ce,ie);else return;ie=s(_e)}}function fe(se){if($e=!1,Q(se),!dt)if(s(ce)!==null)dt=!0,de(Ve);else{var ie=s(_e);ie!==null&&Ce(fe,ie.startTime-se)}}function Ve(se,ie){dt=!1,$e&&($e=!1,Oe()),nt=!0;var J=Fe;try{var me;if(!n)return ne(se,ie)}finally{Le=null,Fe=J,nt=!1}}function ne(se,ie){var J=ie;for(Q(J),Le=s(ce);Le!==null&&!(Le.expirationTime>J&&(!se||ae()));){var me=Le.callback;if(typeof me=="function"){Le.callback=null,Fe=Le.priorityLevel;var Se=Le.expirationTime<=J,je=me(Se);J=t.unstable_now(),typeof je=="function"?Le.callback=je:Le===s(ce)&&a(ce),Q(J)}else a(ce);Le=s(ce)}if(Le!==null)return!0;var Pe=s(_e);return Pe!==null&&Ce(fe,Pe.startTime-J),!1}function xe(se,ie){switch(se){case g:case y:case x:case C:case E:break;default:se=x}var J=Fe;Fe=se;try{return ie()}finally{Fe=J}}function Ke(se){var ie;switch(Fe){case g:case y:case x:ie=x;break;default:ie=Fe;break}var J=Fe;Fe=ie;try{return se()}finally{Fe=J}}function qe(se){var ie=Fe;return function(){var J=Fe;Fe=ie;try{return se.apply(this,arguments)}finally{Fe=J}}}function we(se,ie,J){var me=t.unstable_now(),Se;if(typeof J=="object"&&J!==null){var je=J.delay;typeof je=="number"&&je>0?Se=me+je:Se=me}else Se=me;var Pe;switch(se){case g:Pe=V;break;case y:Pe=F;break;case E:Pe=ve;break;case C:Pe=te;break;case x:default:Pe=B;break}var ut=Se+Pe,wt={id:pe++,callback:ie,priorityLevel:se,startTime:Se,expirationTime:ut,sortIndex:-1};return Se>me?(wt.sortIndex=Se,i(_e,wt),s(ce)===null&&wt===s(_e)&&($e?Oe():$e=!0,Ce(fe,Se-me))):(wt.sortIndex=ut,i(ce,wt),!dt&&!nt&&(dt=!0,de(Ve))),wt}function k(){}function _(){!dt&&!nt&&(dt=!0,de(Ve))}function N(){return s(ce)}function O(se){se.callback=null}function G(){return Fe}var q=!1,I=null,Z=-1,U=r,re=-1;function ae(){var se=t.unstable_now()-re;return!(se<U)}function he(){}function Me(se){if(se<0||se>125){console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported");return}se>0?U=Math.floor(1e3/se):U=r}var tt=function(){if(I!==null){var se=t.unstable_now();re=se;var ie=!0,J=!0;try{J=I(ie,se)}finally{J?ot():(q=!1,I=null)}}else q=!1},ot;if(typeof Ee=="function")ot=function(){Ee(tt)};else if(typeof MessageChannel<"u"){var lt=new MessageChannel,X=lt.port2;lt.port1.onmessage=tt,ot=function(){X.postMessage(null)}}else ot=function(){Re(tt,0)};function de(se){I=se,q||(q=!0,ot())}function Ce(se,ie){Z=Re(function(){se(t.unstable_now())},ie)}function Oe(){Ze(Z),Z=-1}var Ge=he,Qe=null;t.unstable_IdlePriority=E,t.unstable_ImmediatePriority=g,t.unstable_LowPriority=C,t.unstable_NormalPriority=x,t.unstable_Profiling=Qe,t.unstable_UserBlockingPriority=y,t.unstable_cancelCallback=O,t.unstable_continueExecution=_,t.unstable_forceFrameRate=Me,t.unstable_getCurrentPriorityLevel=G,t.unstable_getFirstCallbackNode=N,t.unstable_next=Ke,t.unstable_pauseExecution=k,t.unstable_requestPaint=Ge,t.unstable_runWithPriority=xe,t.unstable_scheduleCallback=we,t.unstable_shouldYield=ae,t.unstable_wrapCallback=qe,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()}(BD)),BD}var SU;function RU(){if(SU)return kk.exports;SU=1;var t={};return t.NODE_ENV==="production"?kk.exports=cae():kk.exports=uae(),kk.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its 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 dae(){if(_U)return gc;_U=1;var t=W,e=RU();function n(d){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+d,b=1;b<arguments.length;b++)f+="&args[]="+encodeURIComponent(arguments[b]);return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function s(d,f){a(d,f),a(d+"Capture",f)}function a(d,f){for(i[d]=f,d=0;d<f.length;d++)r.add(f[d])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,m=/^[: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]*$/,g={},y={};function x(d){return h.call(y,d)?!0:h.call(g,d)?!1:m.test(d)?y[d]=!0:(g[d]=!0,!1)}function C(d,f,b,S){if(b!==null&&b.type===0)return!1;switch(typeof f){case"function":case"symbol":return!0;case"boolean":return S?!1:b!==null?!b.acceptsBooleans:(d=d.toLowerCase().slice(0,5),d!=="data-"&&d!=="aria-");default:return!1}}function E(d,f,b,S){if(f===null||typeof f>"u"||C(d,f,b,S))return!0;if(S)return!1;if(b!==null)switch(b.type){case 3:return!f;case 4:return f===!1;case 5:return isNaN(f);case 6:return isNaN(f)||1>f}return!1}function M(d,f,b,S,T,A,ee){this.acceptsBooleans=f===2||f===3||f===4,this.attributeName=S,this.attributeNamespace=T,this.mustUseProperty=b,this.propertyName=d,this.type=f,this.sanitizeURL=A,this.removeEmptyString=ee}var j={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(d){j[d]=new M(d,0,!1,d,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(d){var f=d[0];j[f]=new M(f,1,!1,d[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(d){j[d]=new M(d,2,!1,d.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(d){j[d]=new M(d,2,!1,d,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(d){j[d]=new M(d,3,!1,d.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(d){j[d]=new M(d,3,!0,d,null,!1,!1)}),["capture","download"].forEach(function(d){j[d]=new M(d,4,!1,d,null,!1,!1)}),["cols","rows","size","span"].forEach(function(d){j[d]=new M(d,6,!1,d,null,!1,!1)}),["rowSpan","start"].forEach(function(d){j[d]=new M(d,5,!1,d.toLowerCase(),null,!1,!1)});var L=/[\-:]([a-z])/g;function D(d){return d[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(d){var f=d.replace(L,D);j[f]=new M(f,1,!1,d,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(d){var f=d.replace(L,D);j[f]=new M(f,1,!1,d,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(d){var f=d.replace(L,D);j[f]=new M(f,1,!1,d,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(d){j[d]=new M(d,1,!1,d.toLowerCase(),null,!1,!1)}),j.xlinkHref=new M("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(d){j[d]=new M(d,1,!1,d.toLowerCase(),null,!0,!0)});function z(d,f,b,S){var T=j.hasOwnProperty(f)?j[f]:null;(T!==null?T.type!==0:S||!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(E(f,b,T,S)&&(b=null),S||T===null?x(f)&&(b===null?d.removeAttribute(f):d.setAttribute(f,""+b)):T.mustUseProperty?d[T.propertyName]=b===null?T.type===3?!1:"":b:(f=T.attributeName,S=T.attributeNamespace,b===null?d.removeAttribute(f):(T=T.type,b=T===3||T===4&&b===!0?"":""+b,S?d.setAttributeNS(S,f,b):d.setAttribute(f,b))))}var H=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,V=Symbol.for("react.element"),F=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),te=Symbol.for("react.strict_mode"),ve=Symbol.for("react.profiler"),ce=Symbol.for("react.provider"),_e=Symbol.for("react.context"),pe=Symbol.for("react.forward_ref"),Le=Symbol.for("react.suspense"),Fe=Symbol.for("react.suspense_list"),nt=Symbol.for("react.memo"),dt=Symbol.for("react.lazy"),$e=Symbol.for("react.offscreen"),Re=Symbol.iterator;function Ze(d){return d===null||typeof d!="object"?null:(d=Re&&d[Re]||d["@@iterator"],typeof d=="function"?d:null)}var Ee=Object.assign,Q;function fe(d){if(Q===void 0)try{throw Error()}catch(b){var f=b.stack.trim().match(/\n( *(at )?)/);Q=f&&f[1]||""}return` `+Q+d}var Ve=!1;function ne(d,f){if(!d||Ve)return"";Ve=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(f)if(f=function(){throw Error()},Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(rt){var S=rt}Reflect.construct(d,[],f)}else{try{f.call()}catch(rt){S=rt}d.call(f.prototype)}else{try{throw Error()}catch(rt){S=rt}d()}}catch(rt){if(rt&&S&&typeof rt.stack=="string"){for(var T=rt.stack.split(` `),A=S.stack.split(` `),ee=T.length-1,ye=A.length-1;1<=ee&&0<=ye&&T[ee]!==A[ye];)ye--;for(;1<=ee&&0<=ye;ee--,ye--)if(T[ee]!==A[ye]){if(ee!==1||ye!==1)do if(ee--,ye--,0>ye||T[ee]!==A[ye]){var ke=` `+T[ee].replace(" at new "," at ");return d.displayName&&ke.includes("<anonymous>")&&(ke=ke.replace("<anonymous>",d.displayName)),ke}while(1<=ee&&0<=ye);break}}}finally{Ve=!1,Error.prepareStackTrace=b}return(d=d?d.displayName||d.name:"")?fe(d):""}function xe(d){switch(d.tag){case 5:return fe(d.type);case 16:return fe("Lazy");case 13:return fe("Suspense");case 19:return fe("SuspenseList");case 0:case 2:case 15:return d=ne(d.type,!1),d;case 11:return d=ne(d.type.render,!1),d;case 1:return d=ne(d.type,!0),d;default:return""}}function Ke(d){if(d==null)return null;if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case B:return"Fragment";case F:return"Portal";case ve:return"Profiler";case te:return"StrictMode";case Le:return"Suspense";case Fe:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case _e:return(d.displayName||"Context")+".Consumer";case ce:return(d._context.displayName||"Context")+".Provider";case pe:var f=d.render;return d=d.displayName,d||(d=f.displayName||f.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case nt:return f=d.displayName||null,f!==null?f:Ke(d.type)||"Memo";case dt:f=d._payload,d=d._init;try{return Ke(d(f))}catch{}}return null}function qe(d){var f=d.type;switch(d.tag){case 24:return"Cache";case 9:return(f.displayName||"Context")+".Consumer";case 10:return(f._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return d=f.render,d=d.displayName||d.name||"",f.displayName||(d!==""?"ForwardRef("+d+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ke(f);case 8:return f===te?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f}return null}function we(d){switch(typeof d){case"boolean":case"number":case"string":case"undefined":return d;case"object":return d;default:return""}}function k(d){var f=d.type;return(d=d.nodeName)&&d.toLowerCase()==="input"&&(f==="checkbox"||f==="radio")}function _(d){var f=k(d)?"checked":"value",b=Object.getOwnPropertyDescriptor(d.constructor.prototype,f),S=""+d[f];if(!d.hasOwnProperty(f)&&typeof b<"u"&&typeof b.get=="function"&&typeof b.set=="function"){var T=b.get,A=b.set;return Object.defineProperty(d,f,{configurable:!0,get:function(){return T.call(this)},set:function(ee){S=""+ee,A.call(this,ee)}}),Object.defineProperty(d,f,{enumerable:b.enumerable}),{getValue:function(){return S},setValue:function(ee){S=""+ee},stopTracking:function(){d._valueTracker=null,delete d[f]}}}}function N(d){d._valueTracker||(d._valueTracker=_(d))}function O(d){if(!d)return!1;var f=d._valueTracker;if(!f)return!0;var b=f.getValue(),S="";return d&&(S=k(d)?d.checked?"true":"false":d.value),d=S,d!==b?(f.setValue(d),!0):!1}function G(d){if(d=d||(typeof document<"u"?document:void 0),typeof d>"u")return null;try{return d.activeElement||d.body}catch{return d.body}}function q(d,f){var b=f.checked;return Ee({},f,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:b??d._wrapperState.initialChecked})}function I(d,f){var b=f.defaultValue==null?"":f.defaultValue,S=f.checked!=null?f.checked:f.defaultChecked;b=we(f.value!=null?f.value:b),d._wrapperState={initialChecked:S,initialValue:b,controlled:f.type==="checkbox"||f.type==="radio"?f.checked!=null:f.value!=null}}function Z(d,f){f=f.checked,f!=null&&z(d,"checked",f,!1)}function U(d,f){Z(d,f);var b=we(f.value),S=f.type;if(b!=null)S==="number"?(b===0&&d.value===""||d.value!=b)&&(d.value=""+b):d.value!==""+b&&(d.value=""+b);else if(S==="submit"||S==="reset"){d.removeAttribute("value");return}f.hasOwnProperty("value")?ae(d,f.type,b):f.hasOwnProperty("defaultValue")&&ae(d,f.type,we(f.defaultValue)),f.checked==null&&f.defaultChecked!=null&&(d.defaultChecked=!!f.defaultChecked)}function re(d,f,b){if(f.hasOwnProperty("value")||f.hasOwnProperty("defaultValue")){var S=f.type;if(!(S!=="submit"&&S!=="reset"||f.value!==void 0&&f.value!==null))return;f=""+d._wrapperState.initialValue,b||f===d.value||(d.value=f),d.defaultValue=f}b=d.name,b!==""&&(d.name=""),d.defaultChecked=!!d._wrapperState.initialChecked,b!==""&&(d.name=b)}function ae(d,f,b){(f!=="number"||G(d.ownerDocument)!==d)&&(b==null?d.defaultValue=""+d._wrapperState.initialValue:d.defaultValue!==""+b&&(d.defaultValue=""+b))}var he=Array.isArray;function Me(d,f,b,S){if(d=d.options,f){f={};for(var T=0;T<b.length;T++)f["$"+b[T]]=!0;for(b=0;b<d.length;b++)T=f.hasOwnProperty("$"+d[b].value),d[b].selected!==T&&(d[b].selected=T),T&&S&&(d[b].defaultSelected=!0)}else{for(b=""+we(b),f=null,T=0;T<d.length;T++){if(d[T].value===b){d[T].selected=!0,S&&(d[T].defaultSelected=!0);return}f!==null||d[T].disabled||(f=d[T])}f!==null&&(f.selected=!0)}}function tt(d,f){if(f.dangerouslySetInnerHTML!=null)throw Error(n(91));return Ee({},f,{value:void 0,defaultValue:void 0,children:""+d._wrapperState.initialValue})}function ot(d,f){var b=f.value;if(b==null){if(b=f.children,f=f.defaultValue,b!=null){if(f!=null)throw Error(n(92));if(he(b)){if(1<b.length)throw Error(n(93));b=b[0]}f=b}f==null&&(f=""),b=f}d._wrapperState={initialValue:we(b)}}function lt(d,f){var b=we(f.value),S=we(f.defaultValue);b!=null&&(b=""+b,b!==d.value&&(d.value=b),f.defaultValue==null&&d.defaultValue!==b&&(d.defaultValue=b)),S!=null&&(d.defaultValue=""+S)}function X(d){var f=d.textContent;f===d._wrapperState.initialValue&&f!==""&&f!==null&&(d.value=f)}function de(d){switch(d){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ce(d,f){return d==null||d==="http://www.w3.org/1999/xhtml"?de(f):d==="http://www.w3.org/2000/svg"&&f==="foreignObject"?"http://www.w3.org/1999/xhtml":d}var Oe,Ge=function(d){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(f,b,S,T){MSApp.execUnsafeLocalFunction(function(){return d(f,b,S,T)})}:d}(function(d,f){if(d.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in d)d.innerHTML=f;else{for(Oe=Oe||document.createElement("div"),Oe.innerHTML="<svg>"+f.valueOf().toString()+"</svg>",f=Oe.firstChild;d.firstChild;)d.removeChild(d.firstChild);for(;f.firstChild;)d.appendChild(f.firstChild)}});function Qe(d,f){if(f){var b=d.firstChild;if(b&&b===d.lastChild&&b.nodeType===3){b.nodeValue=f;return}}d.textContent=f}var se={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ie=["Webkit","ms","Moz","O"];Object.keys(se).forEach(function(d){ie.forEach(function(f){f=f+d.charAt(0).toUpperCase()+d.substring(1),se[f]=se[d]})});function J(d,f,b){return f==null||typeof f=="boolean"||f===""?"":b||typeof f!="number"||f===0||se.hasOwnProperty(d)&&se[d]?(""+f).trim():f+"px"}function me(d,f){d=d.style;for(var b in f)if(f.hasOwnProperty(b)){var S=b.indexOf("--")===0,T=J(b,f[b],S);b==="float"&&(b="cssFloat"),S?d.setProperty(b,T):d[b]=T}}var Se=Ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function je(d,f){if(f){if(Se[d]&&(f.children!=null||f.dangerouslySetInnerHTML!=null))throw Error(n(137,d));if(f.dangerouslySetInnerHTML!=null){if(f.children!=null)throw Error(n(60));if(typeof f.dangerouslySetInnerHTML!="object"||!("__html"in f.dangerouslySetInnerHTML))throw Error(n(61))}if(f.style!=null&&typeof f.style!="object")throw Error(n(62))}}function Pe(d,f){if(d.indexOf("-")===-1)return typeof f.is=="string";switch(d){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 ut=null;function wt(d){return d=d.target||d.srcElement||window,d.correspondingUseElement&&(d=d.correspondingUseElement),d.nodeType===3?d.parentNode:d}var kt=null,Rt=null,sn=null;function jn(d){if(d=Ey(d)){if(typeof kt!="function")throw Error(n(280));var f=d.stateNode;f&&(f=gh(f),kt(d.stateNode,d.type,f))}}function An(d){Rt?sn?sn.push(d):sn=[d]:Rt=d}function Jn(){if(Rt){var d=Rt,f=sn;if(sn=Rt=null,jn(d),f)for(d=0;d<f.length;d++)jn(f[d])}}function Qt(d,f){return d(f)}function Gt(){}var ir=!1;function kn(d,f,b){if(ir)return d(f,b);ir=!0;try{return Qt(d,f,b)}finally{ir=!1,(Rt!==null||sn!==null)&&(Gt(),Jn())}}function Kt(d,f){var b=d.stateNode;if(b===null)return null;var S=gh(b);if(S===null)return null;b=S[f];e:switch(f){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(S=!S.disabled)||(d=d.type,S=!(d==="button"||d==="input"||d==="select"||d==="textarea")),d=!S;break e;default:d=!1}if(d)return null;if(b&&typeof b!="function")throw Error(n(231,f,typeof b));return b}var zt=!1;if(u)try{var Wt={};Object.defineProperty(Wt,"passive",{get:function(){zt=!0}}),window.addEventListener("test",Wt,Wt),window.removeEventListener("test",Wt,Wt)}catch{zt=!1}function en(d,f,b,S,T,A,ee,ye,ke){var rt=Array.prototype.slice.call(arguments,3);try{f.apply(b,rt)}catch(Nt){this.onError(Nt)}}var tn=!1,mn=null,dn=!1,Ne=null,oe={onError:function(d){tn=!0,mn=d}};function Ae(d,f,b,S,T,A,ee,ye,ke){tn=!1,mn=null,en.apply(oe,arguments)}function Je(d,f,b,S,T,A,ee,ye,ke){if(Ae.apply(this,arguments),tn){if(tn){var rt=mn;tn=!1,mn=null}else throw Error(n(198));dn||(dn=!0,Ne=rt)}}function vt(d){var f=d,b=d;if(d.alternate)for(;f.return;)f=f.return;else{d=f;do f=d,f.flags&4098&&(b=f.return),d=f.return;while(d)}return f.tag===3?b:null}function Vt(d){if(d.tag===13){var f=d.memoizedState;if(f===null&&(d=d.alternate,d!==null&&(f=d.memoizedState)),f!==null)return f.dehydrated}return null}function $t(d){if(vt(d)!==d)throw Error(n(188))}function jt(d){var f=d.alternate;if(!f){if(f=vt(d),f===null)throw Error(n(188));return f!==d?null:d}for(var b=d,S=f;;){var T=b.return;if(T===null)break;var A=T.alternate;if(A===null){if(S=T.return,S!==null){b=S;continue}break}if(T.child===A.child){for(A=T.child;A;){if(A===b)return $t(T),d;if(A===S)return $t(T),f;A=A.sibling}throw Error(n(188))}if(b.return!==S.return)b=T,S=A;else{for(var ee=!1,ye=T.child;ye;){if(ye===b){ee=!0,b=T,S=A;break}if(ye===S){ee=!0,S=T,b=A;break}ye=ye.sibling}if(!ee){for(ye=A.child;ye;){if(ye===b){ee=!0,b=A,S=T;break}if(ye===S){ee=!0,S=A,b=T;break}ye=ye.sibling}if(!ee)throw Error(n(189))}}if(b.alternate!==S)throw Error(n(190))}if(b.tag!==3)throw Error(n(188));return b.stateNode.current===b?d:f}function Ft(d){return d=jt(d),d!==null?Ct(d):null}function Ct(d){if(d.tag===5||d.tag===6)return d;for(d=d.child;d!==null;){var f=Ct(d);if(f!==null)return f;d=d.sibling}return null}var ge=e.unstable_scheduleCallback,ct=e.unstable_cancelCallback,xt=e.unstable_shouldYield,Bn=e.unstable_requestPaint,vn=e.unstable_now,Sn=e.unstable_getCurrentPriorityLevel,Bt=e.unstable_ImmediatePriority,Tr=e.unstable_UserBlockingPriority,dr=e.unstable_NormalPriority,Sr=e.unstable_LowPriority,In=e.unstable_IdlePriority,ni=null,Fr=null;function Vi(d){if(Fr&&typeof Fr.onCommitFiberRoot=="function")try{Fr.onCommitFiberRoot(ni,d,void 0,(d.current.flags&128)===128)}catch{}}var Bi=Math.clz32?Math.clz32:$o,Lo=Math.log,aa=Math.LN2;function $o(d){return d>>>=0,d===0?32:31-(Lo(d)/aa|0)|0}var Fo=64,ps=4194304;function gs(d){switch(d&-d){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return d&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return d&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return d}}function zo(d,f){var b=d.pendingLanes;if(b===0)return 0;var S=0,T=d.suspendedLanes,A=d.pingedLanes,ee=b&268435455;if(ee!==0){var ye=ee&~T;ye!==0?S=gs(ye):(A&=ee,A!==0&&(S=gs(A)))}else ee=b&~T,ee!==0?S=gs(ee):A!==0&&(S=gs(A));if(S===0)return 0;if(f!==0&&f!==S&&!(f&T)&&(T=S&-S,A=f&-f,T>=A||T===16&&(A&4194240)!==0))return f;if(S&4&&(S|=b&16),f=d.entangledLanes,f!==0)for(d=d.entanglements,f&=S;0<f;)b=31-Bi(f),T=1<<b,S|=d[b],f&=~T;return S}function xl(d,f){switch(d){case 1:case 2:case 4:return f+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wl(d,f){for(var b=d.suspendedLanes,S=d.pingedLanes,T=d.expirationTimes,A=d.pendingLanes;0<A;){var ee=31-Bi(A),ye=1<<ee,ke=T[ee];ke===-1?(!(ye&b)||ye&S)&&(T[ee]=xl(ye,f)):ke<=f&&(d.expiredLanes|=ye),A&=~ye}}function Vo(d){return d=d.pendingLanes&-1073741825,d!==0?d:d&1073741824?1073741824:0}function nc(){var d=Fo;return Fo<<=1,!(Fo&4194240)&&(Fo=64),d}function Eu(d){for(var f=[],b=0;31>b;b++)f.push(d);return f}function Cl(d,f,b){d.pendingLanes|=f,f!==536870912&&(d.suspendedLanes=0,d.pingedLanes=0),d=d.eventTimes,f=31-Bi(f),d[f]=b}function Nu(d,f){var b=d.pendingLanes&~f;d.pendingLanes=f,d.suspendedLanes=0,d.pingedLanes=0,d.expiredLanes&=f,d.mutableReadLanes&=f,d.entangledLanes&=f,f=d.entanglements;var S=d.eventTimes;for(d=d.expirationTimes;0<b;){var T=31-Bi(b),A=1<<T;f[T]=0,S[T]=-1,d[T]=-1,b&=~A}}function rc(d,f){var b=d.entangledLanes|=f;for(d=d.entanglements;b;){var S=31-Bi(b),T=1<<S;T&f|d[S]&f&&(d[S]|=f),b&=~T}}var Cr=0;function no(d){return d&=-d,1<d?4<d?d&268435455?16:536870912:4:1}var Bo,sr,ro,io,_n,ic=!1,pi=[],Fs=null,zs=null,la=null,ji=new Map,Or=new Map,Ss=[],Rs="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Wn(d,f){switch(d){case"focusin":case"focusout":Fs=null;break;case"dragenter":case"dragleave":zs=null;break;case"mouseover":case"mouseout":la=null;break;case"pointerover":case"pointerout":ji.delete(f.pointerId);break;case"gotpointercapture":case"lostpointercapture":Or.delete(f.pointerId)}}function Wi(d,f,b,S,T,A){return d===null||d.nativeEvent!==A?(d={blockedOn:f,domEventName:b,eventSystemFlags:S,nativeEvent:A,targetContainers:[T]},f!==null&&(f=Ey(f),f!==null&&sr(f)),d):(d.eventSystemFlags|=S,f=d.targetContainers,T!==null&&f.indexOf(T)===-1&&f.push(T),d)}function dh(d,f,b,S,T){switch(f){case"focusin":return Fs=Wi(Fs,d,f,b,S,T),!0;case"dragenter":return zs=Wi(zs,d,f,b,S,T),!0;case"mouseover":return la=Wi(la,d,f,b,S,T),!0;case"pointerover":var A=T.pointerId;return ji.set(A,Wi(ji.get(A)||null,d,f,b,S,T)),!0;case"gotpointercapture":return A=T.pointerId,Or.set(A,Wi(Or.get(A)||null,d,f,b,S,T)),!0}return!1}function Ut(d){var f=vp(d.target);if(f!==null){var b=vt(f);if(b!==null){if(f=b.tag,f===13){if(f=Vt(b),f!==null){d.blockedOn=f,_n(d.priority,function(){ro(b)});return}}else if(f===3&&b.stateNode.current.memoizedState.isDehydrated){d.blockedOn=b.tag===3?b.stateNode.containerInfo:null;return}}}d.blockedOn=null}function lr(d){if(d.blockedOn!==null)return!1;for(var f=d.targetContainers;0<f.length;){var b=St(d.domEventName,d.eventSystemFlags,f[0],d.nativeEvent);if(b===null){b=d.nativeEvent;var S=new b.constructor(b.type,b);ut=S,b.target.dispatchEvent(S),ut=null}else return f=Ey(b),f!==null&&sr(f),d.blockedOn=b,!1;f.shift()}return!0}function Zn(d,f,b){lr(d)&&b.delete(f)}function Gn(){ic=!1,Fs!==null&&lr(Fs)&&(Fs=null),zs!==null&&lr(zs)&&(zs=null),la!==null&&lr(la)&&(la=null),ji.forEach(Zn),Or.forEach(Zn)}function Mi(d,f){d.blockedOn===f&&(d.blockedOn=null,ic||(ic=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Gn)))}function Kr(d){function f(T){return Mi(T,d)}if(0<pi.length){Mi(pi[0],d);for(var b=1;b<pi.length;b++){var S=pi[b];S.blockedOn===d&&(S.blockedOn=null)}}for(Fs!==null&&Mi(Fs,d),zs!==null&&Mi(zs,d),la!==null&&Mi(la,d),ji.forEach(f),Or.forEach(f),b=0;b<Ss.length;b++)S=Ss[b],S.blockedOn===d&&(S.blockedOn=null);for(;0<Ss.length&&(b=Ss[0],b.blockedOn===null);)Ut(b),b.blockedOn===null&&Ss.shift()}var Rr=H.ReactCurrentBatchConfig,Ui=!0;function Ji(d,f,b,S){var T=Cr,A=Rr.transition;Rr.transition=null;try{Cr=1,Ro(d,f,b,S)}finally{Cr=T,Rr.transition=A}}function Wo(d,f,b,S){var T=Cr,A=Rr.transition;Rr.transition=null;try{Cr=4,Ro(d,f,b,S)}finally{Cr=T,Rr.transition=A}}function Ro(d,f,b,S){if(Ui){var T=St(d,f,b,S);if(T===null)FE(d,f,S,Vs,b),Wn(d,S);else if(dh(T,d,f,b,S))S.stopPropagation();else if(Wn(d,S),f&4&&-1<Rs.indexOf(d)){for(;T!==null;){var A=Ey(T);if(A!==null&&Bo(A),A=St(d,f,b,S),A===null&&FE(d,f,S,Vs,b),A===T)break;T=A}T!==null&&S.stopPropagation()}else FE(d,f,S,null,b)}}var Vs=null;function St(d,f,b,S){if(Vs=null,d=wt(S),d=vp(d),d!==null)if(f=vt(d),f===null)d=null;else if(b=f.tag,b===13){if(d=Vt(f),d!==null)return d;d=null}else if(b===3){if(f.stateNode.current.memoizedState.isDehydrated)return f.tag===3?f.stateNode.containerInfo:null;d=null}else f!==d&&(d=null);return Vs=d,null}function Ln(d){switch(d){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Sn()){case Bt:return 1;case Tr:return 4;case dr:case Sr:return 16;case In:return 536870912;default:return 16}default:return 16}}var pr=null,vs=null,K=null;function be(){if(K)return K;var d,f=vs,b=f.length,S,T="value"in pr?pr.value:pr.textContent,A=T.length;for(d=0;d<b&&f[d]===T[d];d++);var ee=b-d;for(S=1;S<=ee&&f[b-S]===T[A-S];S++);return K=T.slice(d,1<S?1-S:void 0)}function Be(d){var f=d.keyCode;return"charCode"in d?(d=d.charCode,d===0&&f===13&&(d=13)):d=f,d===10&&(d=13),32<=d||d===13?d:0}function at(){return!0}function Ot(){return!1}function It(d){function f(b,S,T,A,ee){this._reactName=b,this._targetInst=T,this.type=S,this.nativeEvent=A,this.target=ee,this.currentTarget=null;for(var ye in d)d.hasOwnProperty(ye)&&(b=d[ye],this[ye]=b?b(A):A[ye]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?at:Ot,this.isPropagationStopped=Ot,this}return Ee(f.prototype,{preventDefault:function(){this.defaultPrevented=!0;var b=this.nativeEvent;b&&(b.preventDefault?b.preventDefault():typeof b.returnValue!="unknown"&&(b.returnValue=!1),this.isDefaultPrevented=at)},stopPropagation:function(){var b=this.nativeEvent;b&&(b.stopPropagation?b.stopPropagation():typeof b.cancelBubble!="unknown"&&(b.cancelBubble=!0),this.isPropagationStopped=at)},persist:function(){},isPersistent:at}),f}var qt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(d){return d.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vn=It(qt),gr=Ee({},qt,{view:0,detail:0}),si=It(gr),Pi,Ai,vr,Yi=Ee({},gr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ku,button:0,buttons:0,relatedTarget:function(d){return d.relatedTarget===void 0?d.fromElement===d.srcElement?d.toElement:d.fromElement:d.relatedTarget},movementX:function(d){return"movementX"in d?d.movementX:(d!==vr&&(vr&&d.type==="mousemove"?(Pi=d.screenX-vr.screenX,Ai=d.screenY-vr.screenY):Ai=Pi=0,vr=d),Pi)},movementY:function(d){return"movementY"in d?d.movementY:Ai}}),Bs=It(Yi),dp=Ee({},Yi,{dataTransfer:0}),dy=It(dp),hh=Ee({},gr,{relatedTarget:0}),hp=It(hh),hy=Ee({},qt,{animationName:0,elapsedTime:0,pseudoElement:0}),kE=It(hy),DC=Ee({},qt,{clipboardData:function(d){return"clipboardData"in d?d.clipboardData:window.clipboardData}}),TE=It(DC),KA=Ee({},qt,{data:0}),HC=It(KA),qA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},XA={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"},QA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function e6(d){var f=this.nativeEvent;return f.getModifierState?f.getModifierState(d):(d=QA[d])?!!f[d]:!1}function ku(){return e6}var t6=Ee({},gr,{key:function(d){if(d.key){var f=qA[d.key]||d.key;if(f!=="Unidentified")return f}return d.type==="keypress"?(d=Be(d),d===13?"Enter":String.fromCharCode(d)):d.type==="keydown"||d.type==="keyup"?XA[d.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ku,charCode:function(d){return d.type==="keypress"?Be(d):0},keyCode:function(d){return d.type==="keydown"||d.type==="keyup"?d.keyCode:0},which:function(d){return d.type==="keypress"?Be(d):d.type==="keydown"||d.type==="keyup"?d.keyCode:0}}),jE=It(t6),ME=Ee({},Yi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),LC=It(ME),n6=Ee({},gr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ku}),$C=It(n6),ZA=Ee({},qt,{propertyName:0,elapsedTime:0,pseudoElement:0}),Sl=It(ZA),fh=Ee({},Yi,{deltaX:function(d){return"deltaX"in d?d.deltaX:"wheelDeltaX"in d?-d.wheelDeltaX:0},deltaY:function(d){return"deltaY"in d?d.deltaY:"wheelDeltaY"in d?-d.wheelDeltaY:"wheelDelta"in d?-d.wheelDelta:0},deltaZ:0,deltaMode:0}),so=It(fh),mh=[9,13,27,32],fy=u&&"CompositionEvent"in window,kf=null;u&&"documentMode"in document&&(kf=document.documentMode);var r6=u&&"TextEvent"in window&&!kf,vv=u&&(!fy||kf&&8<kf&&11>=kf),JA=" ",eO=!1;function FC(d,f){switch(d){case"keyup":return mh.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tO(d){return d=d.detail,typeof d=="object"&&"data"in d?d.data:null}var bv=!1;function i6(d,f){switch(d){case"compositionend":return tO(f);case"keypress":return f.which!==32?null:(eO=!0,JA);case"textInput":return d=f.data,d===JA&&eO?null:d;default:return null}}function nO(d,f){if(bv)return d==="compositionend"||!fy&&FC(d,f)?(d=be(),K=vs=pr=null,bv=!1,d):null;switch(d){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1<f.char.length)return f.char;if(f.which)return String.fromCharCode(f.which)}return null;case"compositionend":return vv&&f.locale!=="ko"?null:f.data;default:return null}}var s6={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 rO(d){var f=d&&d.nodeName&&d.nodeName.toLowerCase();return f==="input"?!!s6[d.type]:f==="textarea"}function iO(d,f,b,S){An(S),f=Sy(f,"onChange"),0<f.length&&(b=new Vn("onChange","change",null,b,S),d.push({event:b,listeners:f}))}var yv=null,yd=null;function PE(d){WC(d,0)}function my(d){var f=Mn(d);if(O(f))return d}function sO(d,f){if(d==="change")return f}var oO=!1;if(u){var AE;if(u){var OE="oninput"in document;if(!OE){var aO=document.createElement("div");aO.setAttribute("oninput","return;"),OE=typeof aO.oninput=="function"}AE=OE}else AE=!1;oO=AE&&(!document.documentMode||9<document.documentMode)}function lO(){yv&&(yv.detachEvent("onpropertychange",cO),yd=yv=null)}function cO(d){if(d.propertyName==="value"&&my(yd)){var f=[];iO(f,yd,d,wt(d)),kn(PE,f)}}function o6(d,f,b){d==="focusin"?(lO(),yv=f,yd=b,yv.attachEvent("onpropertychange",cO)):d==="focusout"&&lO()}function a6(d){if(d==="selectionchange"||d==="keyup"||d==="keydown")return my(yd)}function uO(d,f){if(d==="click")return my(f)}function l6(d,f){if(d==="input"||d==="change")return my(f)}function dO(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var Tu=typeof Object.is=="function"?Object.is:dO;function py(d,f){if(Tu(d,f))return!0;if(typeof d!="object"||d===null||typeof f!="object"||f===null)return!1;var b=Object.keys(d),S=Object.keys(f);if(b.length!==S.length)return!1;for(S=0;S<b.length;S++){var T=b[S];if(!h.call(f,T)||!Tu(d[T],f[T]))return!1}return!0}function hO(d){for(;d&&d.firstChild;)d=d.firstChild;return d}function fO(d,f){var b=hO(d);d=0;for(var S;b;){if(b.nodeType===3){if(S=d+b.textContent.length,d<=f&&S>=f)return{node:b,offset:f-d};d=S}e:{for(;b;){if(b.nextSibling){b=b.nextSibling;break e}b=b.parentNode}b=void 0}b=hO(b)}}function zC(d,f){return d&&f?d===f?!0:d&&d.nodeType===3?!1:f&&f.nodeType===3?zC(d,f.parentNode):"contains"in d?d.contains(f):d.compareDocumentPosition?!!(d.compareDocumentPosition(f)&16):!1:!1}function Tf(){for(var d=window,f=G();f instanceof d.HTMLIFrameElement;){try{var b=typeof f.contentWindow.location.href=="string"}catch{b=!1}if(b)d=f.contentWindow;else break;f=G(d.document)}return f}function xv(d){var f=d&&d.nodeName&&d.nodeName.toLowerCase();return f&&(f==="input"&&(d.type==="text"||d.type==="search"||d.type==="tel"||d.type==="url"||d.type==="password")||f==="textarea"||d.contentEditable==="true")}function mO(d){var f=Tf(),b=d.focusedElem,S=d.selectionRange;if(f!==b&&b&&b.ownerDocument&&zC(b.ownerDocument.documentElement,b)){if(S!==null&&xv(b)){if(f=S.start,d=S.end,d===void 0&&(d=f),"selectionStart"in b)b.selectionStart=f,b.selectionEnd=Math.min(d,b.value.length);else if(d=(f=b.ownerDocument||document)&&f.defaultView||window,d.getSelection){d=d.getSelection();var T=b.textContent.length,A=Math.min(S.start,T);S=S.end===void 0?A:Math.min(S.end,T),!d.extend&&A>S&&(T=S,S=A,A=T),T=fO(b,A);var ee=fO(b,S);T&&ee&&(d.rangeCount!==1||d.anchorNode!==T.node||d.anchorOffset!==T.offset||d.focusNode!==ee.node||d.focusOffset!==ee.offset)&&(f=f.createRange(),f.setStart(T.node,T.offset),d.removeAllRanges(),A>S?(d.addRange(f),d.extend(ee.node,ee.offset)):(f.setEnd(ee.node,ee.offset),d.addRange(f)))}}for(f=[],d=b;d=d.parentNode;)d.nodeType===1&&f.push({element:d,left:d.scrollLeft,top:d.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<f.length;b++)d=f[b],d.element.scrollLeft=d.left,d.element.scrollTop=d.top}}var wv=u&&"documentMode"in document&&11>=document.documentMode,Cv=null,IE=null,gy=null,DE=!1;function pO(d,f,b){var S=b.window===b?b.document:b.nodeType===9?b:b.ownerDocument;DE||Cv==null||Cv!==G(S)||(S=Cv,"selectionStart"in S&&xv(S)?S={start:S.selectionStart,end:S.selectionEnd}:(S=(S.ownerDocument&&S.ownerDocument.defaultView||window).getSelection(),S={anchorNode:S.anchorNode,anchorOffset:S.anchorOffset,focusNode:S.focusNode,focusOffset:S.focusOffset}),gy&&py(gy,S)||(gy=S,S=Sy(IE,"onSelect"),0<S.length&&(f=new Vn("onSelect","select",null,f,b),d.push({event:f,listeners:S}),f.target=Cv)))}function vy(d,f){var b={};return b[d.toLowerCase()]=f.toLowerCase(),b["Webkit"+d]="webkit"+f,b["Moz"+d]="moz"+f,b}var Sv={animationend:vy("Animation","AnimationEnd"),animationiteration:vy("Animation","AnimationIteration"),animationstart:vy("Animation","AnimationStart"),transitionend:vy("Transition","TransitionEnd")},VC={},ja={};u&&(ja=document.createElement("div").style,"AnimationEvent"in window||(delete Sv.animationend.animation,delete Sv.animationiteration.animation,delete Sv.animationstart.animation),"TransitionEvent"in window||delete Sv.transitionend.transition);function by(d){if(VC[d])return VC[d];if(!Sv[d])return d;var f=Sv[d],b;for(b in f)if(f.hasOwnProperty(b)&&b in ja)return VC[d]=f[b];return d}var gO=by("animationend"),vO=by("animationiteration"),bO=by("animationstart"),yO=by("transitionend"),xO=new Map,HE="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function xd(d,f){xO.set(d,f),s(f,[d])}for(var fp=0;fp<HE.length;fp++){var LE=HE[fp],yy=LE.toLowerCase(),c6=LE[0].toUpperCase()+LE.slice(1);xd(yy,"on"+c6)}xd(gO,"onAnimationEnd"),xd(vO,"onAnimationIteration"),xd(bO,"onAnimationStart"),xd("dblclick","onDoubleClick"),xd("focusin","onFocus"),xd("focusout","onBlur"),xd(yO,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xy="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(" "),u6=new Set("cancel close invalid load scroll toggle".split(" ").concat(xy));function BC(d,f,b){var S=d.type||"unknown-event";d.currentTarget=b,Je(S,f,void 0,d),d.currentTarget=null}function WC(d,f){f=(f&4)!==0;for(var b=0;b<d.length;b++){var S=d[b],T=S.event;S=S.listeners;e:{var A=void 0;if(f)for(var ee=S.length-1;0<=ee;ee--){var ye=S[ee],ke=ye.instance,rt=ye.currentTarget;if(ye=ye.listener,ke!==A&&T.isPropagationStopped())break e;BC(T,ye,rt),A=ke}else for(ee=0;ee<S.length;ee++){if(ye=S[ee],ke=ye.instance,rt=ye.currentTarget,ye=ye.listener,ke!==A&&T.isPropagationStopped())break e;BC(T,ye,rt),A=ke}}}if(dn)throw d=Ne,dn=!1,Ne=null,d}function gi(d,f){var b=f[zE];b===void 0&&(b=f[zE]=new Set);var S=d+"__bubble";b.has(S)||($E(f,d,2,!1),b.add(S))}function jf(d,f,b){var S=0;f&&(S|=4),$E(b,d,S,f)}var wy="_reactListening"+Math.random().toString(36).slice(2);function Cy(d){if(!d[wy]){d[wy]=!0,r.forEach(function(b){b!=="selectionchange"&&(u6.has(b)||jf(b,!1,d),jf(b,!0,d))});var f=d.nodeType===9?d:d.ownerDocument;f===null||f[wy]||(f[wy]=!0,jf("selectionchange",!1,f))}}function $E(d,f,b,S){switch(Ln(f)){case 1:var T=Ji;break;case 4:T=Wo;break;default:T=Ro}b=T.bind(null,f,b,d),T=void 0,!zt||f!=="touchstart"&&f!=="touchmove"&&f!=="wheel"||(T=!0),S?T!==void 0?d.addEventListener(f,b,{capture:!0,passive:T}):d.addEventListener(f,b,!0):T!==void 0?d.addEventListener(f,b,{passive:T}):d.addEventListener(f,b,!1)}function FE(d,f,b,S,T){var A=S;if(!(f&1)&&!(f&2)&&S!==null)e:for(;;){if(S===null)return;var ee=S.tag;if(ee===3||ee===4){var ye=S.stateNode.containerInfo;if(ye===T||ye.nodeType===8&&ye.parentNode===T)break;if(ee===4)for(ee=S.return;ee!==null;){var ke=ee.tag;if((ke===3||ke===4)&&(ke=ee.stateNode.containerInfo,ke===T||ke.nodeType===8&&ke.parentNode===T))return;ee=ee.return}for(;ye!==null;){if(ee=vp(ye),ee===null)return;if(ke=ee.tag,ke===5||ke===6){S=A=ee;continue e}ye=ye.parentNode}}S=S.return}kn(function(){var rt=A,Nt=wt(b),Pt=[];e:{var Et=xO.get(d);if(Et!==void 0){var hn=Vn,xn=d;switch(d){case"keypress":if(Be(b)===0)break e;case"keydown":case"keyup":hn=jE;break;case"focusin":xn="focus",hn=hp;break;case"focusout":xn="blur",hn=hp;break;case"beforeblur":case"afterblur":hn=hp;break;case"click":if(b.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":hn=Bs;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":hn=dy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":hn=$C;break;case gO:case vO:case bO:hn=kE;break;case yO:hn=Sl;break;case"scroll":hn=si;break;case"wheel":hn=so;break;case"copy":case"cut":case"paste":hn=TE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":hn=LC}var Rn=(f&4)!==0,Gs=!Rn&&d==="scroll",We=Rn?Et!==null?Et+"Capture":null:Et;Rn=[];for(var De=rt,Xe;De!==null;){Xe=De;var Ht=Xe.stateNode;if(Xe.tag===5&&Ht!==null&&(Xe=Ht,We!==null&&(Ht=Kt(De,We),Ht!=null&&Rn.push(Rv(De,Ht,Xe)))),Gs)break;De=De.return}0<Rn.length&&(Et=new hn(Et,xn,null,b,Nt),Pt.push({event:Et,listeners:Rn}))}}if(!(f&7)){e:{if(Et=d==="mouseover"||d==="pointerover",hn=d==="mouseout"||d==="pointerout",Et&&b!==ut&&(xn=b.relatedTarget||b.fromElement)&&(vp(xn)||xn[ph]))break e;if((hn||Et)&&(Et=Nt.window===Nt?Nt:(Et=Nt.ownerDocument)?Et.defaultView||Et.parentWindow:window,hn?(xn=b.relatedTarget||b.toElement,hn=rt,xn=xn?vp(xn):null,xn!==null&&(Gs=vt(xn),xn!==Gs||xn.tag!==5&&xn.tag!==6)&&(xn=null)):(hn=null,xn=rt),hn!==xn)){if(Rn=Bs,Ht="onMouseLeave",We="onMouseEnter",De="mouse",(d==="pointerout"||d==="pointerover")&&(Rn=LC,Ht="onPointerLeave",We="onPointerEnter",De="pointer"),Gs=hn==null?Et:Mn(hn),Xe=xn==null?Et:Mn(xn),Et=new Rn(Ht,De+"leave",hn,b,Nt),Et.target=Gs,Et.relatedTarget=Xe,Ht=null,vp(Nt)===rt&&(Rn=new Rn(We,De+"enter",xn,b,Nt),Rn.target=Xe,Rn.relatedTarget=Gs,Ht=Rn),Gs=Ht,hn&&xn)t:{for(Rn=hn,We=xn,De=0,Xe=Rn;Xe;Xe=mp(Xe))De++;for(Xe=0,Ht=We;Ht;Ht=mp(Ht))Xe++;for(;0<De-Xe;)Rn=mp(Rn),De--;for(;0<Xe-De;)We=mp(We),Xe--;for(;De--;){if(Rn===We||We!==null&&Rn===We.alternate)break t;Rn=mp(Rn),We=mp(We)}Rn=null}else Rn=null;hn!==null&&UC(Pt,Et,hn,Rn,!1),xn!==null&&Gs!==null&&UC(Pt,Gs,xn,Rn,!0)}}e:{if(Et=rt?Mn(rt):window,hn=Et.nodeName&&Et.nodeName.toLowerCase(),hn==="select"||hn==="input"&&Et.type==="file")var on=sO;else if(rO(Et))if(oO)on=l6;else{on=a6;var On=o6}else(hn=Et.nodeName)&&hn.toLowerCase()==="input"&&(Et.type==="checkbox"||Et.type==="radio")&&(on=uO);if(on&&(on=on(d,rt))){iO(Pt,on,b,Nt);break e}On&&On(d,Et,rt),d==="focusout"&&(On=Et._wrapperState)&&On.controlled&&Et.type==="number"&&ae(Et,"number",Et.value)}switch(On=rt?Mn(rt):window,d){case"focusin":(rO(On)||On.contentEditable==="true")&&(Cv=On,IE=rt,gy=null);break;case"focusout":gy=IE=Cv=null;break;case"mousedown":DE=!0;break;case"contextmenu":case"mouseup":case"dragend":DE=!1,pO(Pt,b,Nt);break;case"selectionchange":if(wv)break;case"keydown":case"keyup":pO(Pt,b,Nt)}var zn;if(fy)e:{switch(d){case"compositionstart":var er="onCompositionStart";break e;case"compositionend":er="onCompositionEnd";break e;case"compositionupdate":er="onCompositionUpdate";break e}er=void 0}else bv?FC(d,b)&&(er="onCompositionEnd"):d==="keydown"&&b.keyCode===229&&(er="onCompositionStart");er&&(vv&&b.locale!=="ko"&&(bv||er!=="onCompositionStart"?er==="onCompositionEnd"&&bv&&(zn=be()):(pr=Nt,vs="value"in pr?pr.value:pr.textContent,bv=!0)),On=Sy(rt,er),0<On.length&&(er=new HC(er,d,null,b,Nt),Pt.push({event:er,listeners:On}),zn?er.data=zn:(zn=tO(b),zn!==null&&(er.data=zn)))),(zn=r6?i6(d,b):nO(d,b))&&(rt=Sy(rt,"onBeforeInput"),0<rt.length&&(Nt=new HC("onBeforeInput","beforeinput",null,b,Nt),Pt.push({event:Nt,listeners:rt}),Nt.data=zn))}WC(Pt,f)})}function Rv(d,f,b){return{instance:d,listener:f,currentTarget:b}}function Sy(d,f){for(var b=f+"Capture",S=[];d!==null;){var T=d,A=T.stateNode;T.tag===5&&A!==null&&(T=A,A=Kt(d,b),A!=null&&S.unshift(Rv(d,A,T)),A=Kt(d,f),A!=null&&S.push(Rv(d,A,T))),d=d.return}return S}function mp(d){if(d===null)return null;do d=d.return;while(d&&d.tag!==5);return d||null}function UC(d,f,b,S,T){for(var A=f._reactName,ee=[];b!==null&&b!==S;){var ye=b,ke=ye.alternate,rt=ye.stateNode;if(ke!==null&&ke===S)break;ye.tag===5&&rt!==null&&(ye=rt,T?(ke=Kt(b,A),ke!=null&&ee.unshift(Rv(b,ke,ye))):T||(ke=Kt(b,A),ke!=null&&ee.push(Rv(b,ke,ye)))),b=b.return}ee.length!==0&&d.push({event:f,listeners:ee})}var d6=/\r\n?/g,wO=/\u0000|\uFFFD/g;function CO(d){return(typeof d=="string"?d:""+d).replace(d6,` `).replace(wO,"")}function YC(d,f,b){if(f=CO(f),CO(d)!==f&&b)throw Error(n(425))}function GC(){}var pp=null,Ry=null;function gp(d,f){return d==="textarea"||d==="noscript"||typeof f.children=="string"||typeof f.children=="number"||typeof f.dangerouslySetInnerHTML=="object"&&f.dangerouslySetInnerHTML!==null&&f.dangerouslySetInnerHTML.__html!=null}var KC=typeof setTimeout=="function"?setTimeout:void 0,SO=typeof clearTimeout=="function"?clearTimeout:void 0,qC=typeof Promise=="function"?Promise:void 0,h6=typeof queueMicrotask=="function"?queueMicrotask:typeof qC<"u"?function(d){return qC.resolve(null).then(d).catch(_v)}:KC;function _v(d){setTimeout(function(){throw d})}function Ev(d,f){var b=f,S=0;do{var T=b.nextSibling;if(d.removeChild(b),T&&T.nodeType===8)if(b=T.data,b==="/$"){if(S===0){d.removeChild(T),Kr(f);return}S--}else b!=="$"&&b!=="$?"&&b!=="$!"||S++;b=T}while(b);Kr(f)}function ju(d){for(;d!=null;d=d.nextSibling){var f=d.nodeType;if(f===1||f===3)break;if(f===8){if(f=d.data,f==="$"||f==="$!"||f==="$?")break;if(f==="/$")return null}}return d}function XC(d){d=d.previousSibling;for(var f=0;d;){if(d.nodeType===8){var b=d.data;if(b==="$"||b==="$!"||b==="$?"){if(f===0)return d;f--}else b==="/$"&&f++}d=d.previousSibling}return null}var Nv=Math.random().toString(36).slice(2),Fc="__reactFiber$"+Nv,_y="__reactProps$"+Nv,ph="__reactContainer$"+Nv,zE="__reactEvents$"+Nv,VE="__reactListeners$"+Nv,kv="__reactHandles$"+Nv;function vp(d){var f=d[Fc];if(f)return f;for(var b=d.parentNode;b;){if(f=b[ph]||b[Fc]){if(b=f.alternate,f.child!==null||b!==null&&b.child!==null)for(d=XC(d);d!==null;){if(b=d[Fc])return b;d=XC(d)}return f}d=b,b=d.parentNode}return null}function Ey(d){return d=d[Fc]||d[ph],!d||d.tag!==5&&d.tag!==6&&d.tag!==13&&d.tag!==3?null:d}function Mn(d){if(d.tag===5||d.tag===6)return d.stateNode;throw Error(n(33))}function gh(d){return d[_y]||null}var _s=[],Ir=-1;function Rl(d){return{current:d}}function wi(d){0>Ir||(d.current=_s[Ir],_s[Ir]=null,Ir--)}function Gi(d,f){Ir++,_s[Ir]=d.current,d.current=f}var _r={},is=Rl(_r),oo=Rl(!1),zc=_r;function sc(d,f){var b=d.type.contextTypes;if(!b)return _r;var S=d.stateNode;if(S&&S.__reactInternalMemoizedUnmaskedChildContext===f)return S.__reactInternalMemoizedMaskedChildContext;var T={},A;for(A in b)T[A]=f[A];return S&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=f,d.__reactInternalMemoizedMaskedChildContext=T),T}function Es(d){return d=d.childContextTypes,d!=null}function wd(){wi(oo),wi(is)}function QC(d,f,b){if(is.current!==_r)throw Error(n(168));Gi(is,f),Gi(oo,b)}function RO(d,f,b){var S=d.stateNode;if(f=f.childContextTypes,typeof S.getChildContext!="function")return b;S=S.getChildContext();for(var T in S)if(!(T in f))throw Error(n(108,qe(d)||"Unknown",T));return Ee({},b,S)}function bp(d){return d=(d=d.stateNode)&&d.__reactInternalMemoizedMergedChildContext||_r,zc=is.current,Gi(is,d),Gi(oo,oo.current),!0}function Ma(d,f,b){var S=d.stateNode;if(!S)throw Error(n(169));b?(d=RO(d,f,zc),S.__reactInternalMemoizedMergedChildContext=d,wi(oo),wi(is),Gi(is,d)):wi(oo),Gi(oo,b)}var Mu=null,Ny=!1,ky=!1;function Mf(d){Mu===null?Mu=[d]:Mu.push(d)}function BE(d){Ny=!0,Mf(d)}function Wa(){if(!ky&&Mu!==null){ky=!0;var d=0,f=Cr;try{var b=Mu;for(Cr=1;d<b.length;d++){var S=b[d];do S=S(!0);while(S!==null)}Mu=null,Ny=!1}catch(T){throw Mu!==null&&(Mu=Mu.slice(d+1)),ge(Bt,Wa),T}finally{Cr=f,ky=!1}}return null}var Pf=[],Af=0,Tv=null,Of=0,ca=[],ao=0,yp=null,Ua=1,Cd="";function If(d,f){Pf[Af++]=Of,Pf[Af++]=Tv,Tv=d,Of=f}function _O(d,f,b){ca[ao++]=Ua,ca[ao++]=Cd,ca[ao++]=yp,yp=d;var S=Ua;d=Cd;var T=32-Bi(S)-1;S&=~(1<<T),b+=1;var A=32-Bi(f)+T;if(30<A){var ee=T-T%5;A=(S&(1<<ee)-1).toString(32),S>>=ee,T-=ee,Ua=1<<32-Bi(f)+T|b<<T|S,Cd=A+d}else Ua=1<<A|b<<T|S,Cd=d}function WE(d){d.return!==null&&(If(d,1),_O(d,1,0))}function ZC(d){for(;d===Tv;)Tv=Pf[--Af],Pf[Af]=null,Of=Pf[--Af],Pf[Af]=null;for(;d===yp;)yp=ca[--ao],ca[ao]=null,Cd=ca[--ao],ca[ao]=null,Ua=ca[--ao],ca[ao]=null}var _l=null,El=null,es=!1,Pu=null;function UE(d,f){var b=Yc(5,null,null,0);b.elementType="DELETED",b.stateNode=f,b.return=d,f=d.deletions,f===null?(d.deletions=[b],d.flags|=16):f.push(b)}function YE(d,f){switch(d.tag){case 5:var b=d.type;return f=f.nodeType!==1||b.toLowerCase()!==f.nodeName.toLowerCase()?null:f,f!==null?(d.stateNode=f,_l=d,El=ju(f.firstChild),!0):!1;case 6:return f=d.pendingProps===""||f.nodeType!==3?null:f,f!==null?(d.stateNode=f,_l=d,El=null,!0):!1;case 13:return f=f.nodeType!==8?null:f,f!==null?(b=yp!==null?{id:Ua,overflow:Cd}:null,d.memoizedState={dehydrated:f,treeContext:b,retryLane:1073741824},b=Yc(18,null,null,0),b.stateNode=f,b.return=d,d.child=b,_l=d,El=null,!0):!1;default:return!1}}function GE(d){return(d.mode&1)!==0&&(d.flags&128)===0}function KE(d){if(es){var f=El;if(f){var b=f;if(!YE(d,f)){if(GE(d))throw Error(n(418));f=ju(b.nextSibling);var S=_l;f&&YE(d,f)?UE(S,b):(d.flags=d.flags&-4097|2,es=!1,_l=d)}}else{if(GE(d))throw Error(n(418));d.flags=d.flags&-4097|2,es=!1,_l=d}}}function EO(d){for(d=d.return;d!==null&&d.tag!==5&&d.tag!==3&&d.tag!==13;)d=d.return;_l=d}function Ws(d){if(d!==_l)return!1;if(!es)return EO(d),es=!0,!1;var f;if((f=d.tag!==3)&&!(f=d.tag!==5)&&(f=d.type,f=f!=="head"&&f!=="body"&&!gp(d.type,d.memoizedProps)),f&&(f=El)){if(GE(d))throw NO(),Error(n(418));for(;f;)UE(d,f),f=ju(f.nextSibling)}if(EO(d),d.tag===13){if(d=d.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(n(317));e:{for(d=d.nextSibling,f=0;d;){if(d.nodeType===8){var b=d.data;if(b==="/$"){if(f===0){El=ju(d.nextSibling);break e}f--}else b!=="$"&&b!=="$!"&&b!=="$?"||f++}d=d.nextSibling}El=null}}else El=_l?ju(d.stateNode.nextSibling):null;return!0}function NO(){for(var d=El;d;)d=ju(d.nextSibling)}function vh(){El=_l=null,es=!1}function Ty(d){Pu===null?Pu=[d]:Pu.push(d)}var xp=H.ReactCurrentBatchConfig;function jy(d,f,b){if(d=b.ref,d!==null&&typeof d!="function"&&typeof d!="object"){if(b._owner){if(b=b._owner,b){if(b.tag!==1)throw Error(n(309));var S=b.stateNode}if(!S)throw Error(n(147,d));var T=S,A=""+d;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===A?f.ref:(f=function(ee){var ye=T.refs;ee===null?delete ye[A]:ye[A]=ee},f._stringRef=A,f)}if(typeof d!="string")throw Error(n(284));if(!b._owner)throw Error(n(290,d))}return d}function jv(d,f){throw d=Object.prototype.toString.call(f),Error(n(31,d==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":d))}function kO(d){var f=d._init;return f(d._payload)}function TO(d){function f(We,De){if(d){var Xe=We.deletions;Xe===null?(We.deletions=[De],We.flags|=16):Xe.push(De)}}function b(We,De){if(!d)return null;for(;De!==null;)f(We,De),De=De.sibling;return null}function S(We,De){for(We=new Map;De!==null;)De.key!==null?We.set(De.key,De):We.set(De.index,De),De=De.sibling;return We}function T(We,De){return We=Yf(We,De),We.index=0,We.sibling=null,We}function A(We,De,Xe){return We.index=Xe,d?(Xe=We.alternate,Xe!==null?(Xe=Xe.index,Xe<De?(We.flags|=2,De):Xe):(We.flags|=2,De)):(We.flags|=1048576,De)}function ee(We){return d&&We.alternate===null&&(We.flags|=2),We}function ye(We,De,Xe,Ht){return De===null||De.tag!==6?(De=Hp(Xe,We.mode,Ht),De.return=We,De):(De=T(De,Xe),De.return=We,De)}function ke(We,De,Xe,Ht){var on=Xe.type;return on===B?Nt(We,De,Xe.props.children,Ht,Xe.key):De!==null&&(De.elementType===on||typeof on=="object"&&on!==null&&on.$$typeof===dt&&kO(on)===De.type)?(Ht=T(De,Xe.props),Ht.ref=jy(We,De,Xe),Ht.return=We,Ht):(Ht=HS(Xe.type,Xe.key,Xe.props,null,We.mode,Ht),Ht.ref=jy(We,De,Xe),Ht.return=We,Ht)}function rt(We,De,Xe,Ht){return De===null||De.tag!==4||De.stateNode.containerInfo!==Xe.containerInfo||De.stateNode.implementation!==Xe.implementation?(De=_N(Xe,We.mode,Ht),De.return=We,De):(De=T(De,Xe.children||[]),De.return=We,De)}function Nt(We,De,Xe,Ht,on){return De===null||De.tag!==7?(De=Gf(Xe,We.mode,Ht,on),De.return=We,De):(De=T(De,Xe),De.return=We,De)}function Pt(We,De,Xe){if(typeof De=="string"&&De!==""||typeof De=="number")return De=Hp(""+De,We.mode,Xe),De.return=We,De;if(typeof De=="object"&&De!==null){switch(De.$$typeof){case V:return Xe=HS(De.type,De.key,De.props,null,We.mode,Xe),Xe.ref=jy(We,null,De),Xe.return=We,Xe;case F:return De=_N(De,We.mode,Xe),De.return=We,De;case dt:var Ht=De._init;return Pt(We,Ht(De._payload),Xe)}if(he(De)||Ze(De))return De=Gf(De,We.mode,Xe,null),De.return=We,De;jv(We,De)}return null}function Et(We,De,Xe,Ht){var on=De!==null?De.key:null;if(typeof Xe=="string"&&Xe!==""||typeof Xe=="number")return on!==null?null:ye(We,De,""+Xe,Ht);if(typeof Xe=="object"&&Xe!==null){switch(Xe.$$typeof){case V:return Xe.key===on?ke(We,De,Xe,Ht):null;case F:return Xe.key===on?rt(We,De,Xe,Ht):null;case dt:return on=Xe._init,Et(We,De,on(Xe._payload),Ht)}if(he(Xe)||Ze(Xe))return on!==null?null:Nt(We,De,Xe,Ht,null);jv(We,Xe)}return null}function hn(We,De,Xe,Ht,on){if(typeof Ht=="string"&&Ht!==""||typeof Ht=="number")return We=We.get(Xe)||null,ye(De,We,""+Ht,on);if(typeof Ht=="object"&&Ht!==null){switch(Ht.$$typeof){case V:return We=We.get(Ht.key===null?Xe:Ht.key)||null,ke(De,We,Ht,on);case F:return We=We.get(Ht.key===null?Xe:Ht.key)||null,rt(De,We,Ht,on);case dt:var On=Ht._init;return hn(We,De,Xe,On(Ht._payload),on)}if(he(Ht)||Ze(Ht))return We=We.get(Xe)||null,Nt(De,We,Ht,on,null);jv(De,Ht)}return null}function xn(We,De,Xe,Ht){for(var on=null,On=null,zn=De,er=De=0,ko=null;zn!==null&&er<Xe.length;er++){zn.index>er?(ko=zn,zn=null):ko=zn.sibling;var oi=Et(We,zn,Xe[er],Ht);if(oi===null){zn===null&&(zn=ko);break}d&&zn&&oi.alternate===null&&f(We,zn),De=A(oi,De,er),On===null?on=oi:On.sibling=oi,On=oi,zn=ko}if(er===Xe.length)return b(We,zn),es&&If(We,er),on;if(zn===null){for(;er<Xe.length;er++)zn=Pt(We,Xe[er],Ht),zn!==null&&(De=A(zn,De,er),On===null?on=zn:On.sibling=zn,On=zn);return es&&If(We,er),on}for(zn=S(We,zn);er<Xe.length;er++)ko=hn(zn,We,er,Xe[er],Ht),ko!==null&&(d&&ko.alternate!==null&&zn.delete(ko.key===null?er:ko.key),De=A(ko,De,er),On===null?on=ko:On.sibling=ko,On=ko);return d&&zn.forEach(function(qf){return f(We,qf)}),es&&If(We,er),on}function Rn(We,De,Xe,Ht){var on=Ze(Xe);if(typeof on!="function")throw Error(n(150));if(Xe=on.call(Xe),Xe==null)throw Error(n(151));for(var On=on=null,zn=De,er=De=0,ko=null,oi=Xe.next();zn!==null&&!oi.done;er++,oi=Xe.next()){zn.index>er?(ko=zn,zn=null):ko=zn.sibling;var qf=Et(We,zn,oi.value,Ht);if(qf===null){zn===null&&(zn=ko);break}d&&zn&&qf.alternate===null&&f(We,zn),De=A(qf,De,er),On===null?on=qf:On.sibling=qf,On=qf,zn=ko}if(oi.done)return b(We,zn),es&&If(We,er),on;if(zn===null){for(;!oi.done;er++,oi=Xe.next())oi=Pt(We,oi.value,Ht),oi!==null&&(De=A(oi,De,er),On===null?on=oi:On.sibling=oi,On=oi);return es&&If(We,er),on}for(zn=S(We,zn);!oi.done;er++,oi=Xe.next())oi=hn(zn,We,er,oi.value,Ht),oi!==null&&(d&&oi.alternate!==null&&zn.delete(oi.key===null?er:oi.key),De=A(oi,De,er),On===null?on=oi:On.sibling=oi,On=oi);return d&&zn.forEach(function(E6){return f(We,E6)}),es&&If(We,er),on}function Gs(We,De,Xe,Ht){if(typeof Xe=="object"&&Xe!==null&&Xe.type===B&&Xe.key===null&&(Xe=Xe.props.children),typeof Xe=="object"&&Xe!==null){switch(Xe.$$typeof){case V:e:{for(var on=Xe.key,On=De;On!==null;){if(On.key===on){if(on=Xe.type,on===B){if(On.tag===7){b(We,On.sibling),De=T(On,Xe.props.children),De.return=We,We=De;break e}}else if(On.elementType===on||typeof on=="object"&&on!==null&&on.$$typeof===dt&&kO(on)===On.type){b(We,On.sibling),De=T(On,Xe.props),De.ref=jy(We,On,Xe),De.return=We,We=De;break e}b(We,On);break}else f(We,On);On=On.sibling}Xe.type===B?(De=Gf(Xe.props.children,We.mode,Ht,Xe.key),De.return=We,We=De):(Ht=HS(Xe.type,Xe.key,Xe.props,null,We.mode,Ht),Ht.ref=jy(We,De,Xe),Ht.return=We,We=Ht)}return ee(We);case F:e:{for(On=Xe.key;De!==null;){if(De.key===On)if(De.tag===4&&De.stateNode.containerInfo===Xe.containerInfo&&De.stateNode.implementation===Xe.implementation){b(We,De.sibling),De=T(De,Xe.children||[]),De.return=We,We=De;break e}else{b(We,De);break}else f(We,De);De=De.sibling}De=_N(Xe,We.mode,Ht),De.return=We,We=De}return ee(We);case dt:return On=Xe._init,Gs(We,De,On(Xe._payload),Ht)}if(he(Xe))return xn(We,De,Xe,Ht);if(Ze(Xe))return Rn(We,De,Xe,Ht);jv(We,Xe)}return typeof Xe=="string"&&Xe!==""||typeof Xe=="number"?(Xe=""+Xe,De!==null&&De.tag===6?(b(We,De.sibling),De=T(De,Xe),De.return=We,We=De):(b(We,De),De=Hp(Xe,We.mode,Ht),De.return=We,We=De),ee(We)):b(We,De)}return Gs}var Au=TO(!0),ua=TO(!1),Xt=Rl(null),oc=null,Pa=null,qE=null;function XE(){qE=Pa=oc=null}function QE(d){var f=Xt.current;wi(Xt),d._currentValue=f}function ZE(d,f,b){for(;d!==null;){var S=d.alternate;if((d.childLanes&f)!==f?(d.childLanes|=f,S!==null&&(S.childLanes|=f)):S!==null&&(S.childLanes&f)!==f&&(S.childLanes|=f),d===b)break;d=d.return}}function Mv(d,f){oc=d,qE=Pa=null,d=d.dependencies,d!==null&&d.firstContext!==null&&(d.lanes&f&&(Go=!0),d.firstContext=null)}function Ci(d){var f=d._currentValue;if(qE!==d)if(d={context:d,memoizedValue:f,next:null},Pa===null){if(oc===null)throw Error(n(308));Pa=d,oc.dependencies={lanes:0,firstContext:d}}else Pa=Pa.next=d;return f}var wp=null;function JE(d){wp===null?wp=[d]:wp.push(d)}function jO(d,f,b,S){var T=f.interleaved;return T===null?(b.next=b,JE(f)):(b.next=T.next,T.next=b),f.interleaved=b,Sd(d,S)}function Sd(d,f){d.lanes|=f;var b=d.alternate;for(b!==null&&(b.lanes|=f),b=d,d=d.return;d!==null;)d.childLanes|=f,b=d.alternate,b!==null&&(b.childLanes|=f),b=d,d=d.return;return b.tag===3?b.stateNode:null}var Vc=!1;function Df(d){d.updateQueue={baseState:d.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function MO(d,f){d=d.updateQueue,f.updateQueue===d&&(f.updateQueue={baseState:d.baseState,firstBaseUpdate:d.firstBaseUpdate,lastBaseUpdate:d.lastBaseUpdate,shared:d.shared,effects:d.effects})}function bh(d,f){return{eventTime:d,lane:f,tag:0,payload:null,callback:null,next:null}}function Hf(d,f,b){var S=d.updateQueue;if(S===null)return null;if(S=S.shared,Dr&2){var T=S.pending;return T===null?f.next=f:(f.next=T.next,T.next=f),S.pending=f,Sd(d,b)}return T=S.interleaved,T===null?(f.next=f,JE(S)):(f.next=T.next,T.next=f),S.interleaved=f,Sd(d,b)}function JC(d,f,b){if(f=f.updateQueue,f!==null&&(f=f.shared,(b&4194240)!==0)){var S=f.lanes;S&=d.pendingLanes,b|=S,f.lanes=b,rc(d,b)}}function PO(d,f){var b=d.updateQueue,S=d.alternate;if(S!==null&&(S=S.updateQueue,b===S)){var T=null,A=null;if(b=b.firstBaseUpdate,b!==null){do{var ee={eventTime:b.eventTime,lane:b.lane,tag:b.tag,payload:b.payload,callback:b.callback,next:null};A===null?T=A=ee:A=A.next=ee,b=b.next}while(b!==null);A===null?T=A=f:A=A.next=f}else T=A=f;b={baseState:S.baseState,firstBaseUpdate:T,lastBaseUpdate:A,shared:S.shared,effects:S.effects},d.updateQueue=b;return}d=b.lastBaseUpdate,d===null?b.firstBaseUpdate=f:d.next=f,b.lastBaseUpdate=f}function eS(d,f,b,S){var T=d.updateQueue;Vc=!1;var A=T.firstBaseUpdate,ee=T.lastBaseUpdate,ye=T.shared.pending;if(ye!==null){T.shared.pending=null;var ke=ye,rt=ke.next;ke.next=null,ee===null?A=rt:ee.next=rt,ee=ke;var Nt=d.alternate;Nt!==null&&(Nt=Nt.updateQueue,ye=Nt.lastBaseUpdate,ye!==ee&&(ye===null?Nt.firstBaseUpdate=rt:ye.next=rt,Nt.lastBaseUpdate=ke))}if(A!==null){var Pt=T.baseState;ee=0,Nt=rt=ke=null,ye=A;do{var Et=ye.lane,hn=ye.eventTime;if((S&Et)===Et){Nt!==null&&(Nt=Nt.next={eventTime:hn,lane:0,tag:ye.tag,payload:ye.payload,callback:ye.callback,next:null});e:{var xn=d,Rn=ye;switch(Et=f,hn=b,Rn.tag){case 1:if(xn=Rn.payload,typeof xn=="function"){Pt=xn.call(hn,Pt,Et);break e}Pt=xn;break e;case 3:xn.flags=xn.flags&-65537|128;case 0:if(xn=Rn.payload,Et=typeof xn=="function"?xn.call(hn,Pt,Et):xn,Et==null)break e;Pt=Ee({},Pt,Et);break e;case 2:Vc=!0}}ye.callback!==null&&ye.lane!==0&&(d.flags|=64,Et=T.effects,Et===null?T.effects=[ye]:Et.push(ye))}else hn={eventTime:hn,lane:Et,tag:ye.tag,payload:ye.payload,callback:ye.callback,next:null},Nt===null?(rt=Nt=hn,ke=Pt):Nt=Nt.next=hn,ee|=Et;if(ye=ye.next,ye===null){if(ye=T.shared.pending,ye===null)break;Et=ye,ye=Et.next,Et.next=null,T.lastBaseUpdate=Et,T.shared.pending=null}}while(!0);if(Nt===null&&(ke=Pt),T.baseState=ke,T.firstBaseUpdate=rt,T.lastBaseUpdate=Nt,f=T.shared.interleaved,f!==null){T=f;do ee|=T.lane,T=T.next;while(T!==f)}else A===null&&(T.shared.lanes=0);Mp|=ee,d.lanes=ee,d.memoizedState=Pt}}function eN(d,f,b){if(d=f.effects,f.effects=null,d!==null)for(f=0;f<d.length;f++){var S=d[f],T=S.callback;if(T!==null){if(S.callback=null,S=b,typeof T!="function")throw Error(n(191,T));T.call(S)}}}var Pv={},Rd=Rl(Pv),My=Rl(Pv),Py=Rl(Pv);function Cp(d){if(d===Pv)throw Error(n(174));return d}function tN(d,f){switch(Gi(Py,f),Gi(My,d),Gi(Rd,Pv),d=f.nodeType,d){case 9:case 11:f=(f=f.documentElement)?f.namespaceURI:Ce(null,"");break;default:d=d===8?f.parentNode:f,f=d.namespaceURI||null,d=d.tagName,f=Ce(f,d)}wi(Rd),Gi(Rd,f)}function Av(){wi(Rd),wi(My),wi(Py)}function nN(d){Cp(Py.current);var f=Cp(Rd.current),b=Ce(f,d.type);f!==b&&(Gi(My,d),Gi(Rd,b))}function rN(d){My.current===d&&(wi(Rd),wi(My))}var ss=Rl(0);function tS(d){for(var f=d;f!==null;){if(f.tag===13){var b=f.memoizedState;if(b!==null&&(b=b.dehydrated,b===null||b.data==="$?"||b.data==="$!"))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if(f.flags&128)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===d)break;for(;f.sibling===null;){if(f.return===null||f.return===d)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var iN=[];function Ay(){for(var d=0;d<iN.length;d++)iN[d]._workInProgressVersionPrimary=null;iN.length=0}var Pn=H.ReactCurrentDispatcher,jr=H.ReactCurrentBatchConfig,Ur=0,hr=null,Oi=null,_o=null,nS=!1,Oy=!1,Iy=0,sN=0;function bt(){throw Error(n(321))}function lo(d,f){if(f===null)return!1;for(var b=0;b<f.length&&b<d.length;b++)if(!Tu(d[b],f[b]))return!1;return!0}function Un(d,f,b,S,T,A){if(Ur=A,hr=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,Pn.current=d===null||d.memoizedState===null?vS:bS,d=b(S,T),Oy){A=0;do{if(Oy=!1,Iy=0,25<=A)throw Error(n(301));A+=1,_o=Oi=null,f.updateQueue=null,Pn.current=Fy,d=b(S,T)}while(Oy)}if(Pn.current=Si,f=Oi!==null&&Oi.next!==null,Ur=0,_o=Oi=hr=null,nS=!1,f)throw Error(n(300));return d}function Lf(){var d=Iy!==0;return Iy=0,d}function Uo(){var d={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _o===null?hr.memoizedState=_o=d:_o=_o.next=d,_o}function Yo(){if(Oi===null){var d=hr.alternate;d=d!==null?d.memoizedState:null}else d=Oi.next;var f=_o===null?hr.memoizedState:_o.next;if(f!==null)_o=f,Oi=d;else{if(d===null)throw Error(n(310));Oi=d,d={memoizedState:Oi.memoizedState,baseState:Oi.baseState,baseQueue:Oi.baseQueue,queue:Oi.queue,next:null},_o===null?hr.memoizedState=_o=d:_o=_o.next=d}return _o}function Nl(d,f){return typeof f=="function"?f(d):f}function Sp(d){var f=Yo(),b=f.queue;if(b===null)throw Error(n(311));b.lastRenderedReducer=d;var S=Oi,T=S.baseQueue,A=b.pending;if(A!==null){if(T!==null){var ee=T.next;T.next=A.next,A.next=ee}S.baseQueue=T=A,b.pending=null}if(T!==null){A=T.next,S=S.baseState;var ye=ee=null,ke=null,rt=A;do{var Nt=rt.lane;if((Ur&Nt)===Nt)ke!==null&&(ke=ke.next={lane:0,action:rt.action,hasEagerState:rt.hasEagerState,eagerState:rt.eagerState,next:null}),S=rt.hasEagerState?rt.eagerState:d(S,rt.action);else{var Pt={lane:Nt,action:rt.action,hasEagerState:rt.hasEagerState,eagerState:rt.eagerState,next:null};ke===null?(ye=ke=Pt,ee=S):ke=ke.next=Pt,hr.lanes|=Nt,Mp|=Nt}rt=rt.next}while(rt!==null&&rt!==A);ke===null?ee=S:ke.next=ye,Tu(S,f.memoizedState)||(Go=!0),f.memoizedState=S,f.baseState=ee,f.baseQueue=ke,b.lastRenderedState=S}if(d=b.interleaved,d!==null){T=d;do A=T.lane,hr.lanes|=A,Mp|=A,T=T.next;while(T!==d)}else T===null&&(b.lanes=0);return[f.memoizedState,b.dispatch]}function $f(d){var f=Yo(),b=f.queue;if(b===null)throw Error(n(311));b.lastRenderedReducer=d;var S=b.dispatch,T=b.pending,A=f.memoizedState;if(T!==null){b.pending=null;var ee=T=T.next;do A=d(A,ee.action),ee=ee.next;while(ee!==T);Tu(A,f.memoizedState)||(Go=!0),f.memoizedState=A,f.baseQueue===null&&(f.baseState=A),b.lastRenderedState=A}return[A,S]}function Ov(){}function rS(d,f){var b=hr,S=Yo(),T=f(),A=!Tu(S.memoizedState,T);if(A&&(S.memoizedState=T,Go=!0),S=S.queue,Dy(oS.bind(null,b,S,d),[d]),S.getSnapshot!==f||A||_o!==null&&_o.memoizedState.tag&1){if(b.flags|=2048,Rp(9,sS.bind(null,b,S,T,f),void 0,null),co===null)throw Error(n(349));Ur&30||iS(b,f,T)}return T}function iS(d,f,b){d.flags|=16384,d={getSnapshot:f,value:b},f=hr.updateQueue,f===null?(f={lastEffect:null,stores:null},hr.updateQueue=f,f.stores=[d]):(b=f.stores,b===null?f.stores=[d]:b.push(d))}function sS(d,f,b,S){f.value=b,f.getSnapshot=S,aS(f)&&lS(d)}function oS(d,f,b){return b(function(){aS(f)&&lS(d)})}function aS(d){var f=d.getSnapshot;d=d.value;try{var b=f();return!Tu(d,b)}catch{return!0}}function lS(d){var f=Sd(d,1);f!==null&&uc(f,d,1,-1)}function cS(d){var f=Uo();return typeof d=="function"&&(d=d()),f.memoizedState=f.baseState=d,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Nl,lastRenderedState:d},f.queue=d,d=d.dispatch=$y.bind(null,hr,d),[f.memoizedState,d]}function Rp(d,f,b,S){return d={tag:d,create:f,destroy:b,deps:S,next:null},f=hr.updateQueue,f===null?(f={lastEffect:null,stores:null},hr.updateQueue=f,f.lastEffect=d.next=d):(b=f.lastEffect,b===null?f.lastEffect=d.next=d:(S=b.next,b.next=d,d.next=S,f.lastEffect=d)),d}function uS(){return Yo().memoizedState}function Iv(d,f,b,S){var T=Uo();hr.flags|=d,T.memoizedState=Rp(1|f,b,void 0,S===void 0?null:S)}function Dv(d,f,b,S){var T=Yo();S=S===void 0?null:S;var A=void 0;if(Oi!==null){var ee=Oi.memoizedState;if(A=ee.destroy,S!==null&&lo(S,ee.deps)){T.memoizedState=Rp(f,b,A,S);return}}hr.flags|=d,T.memoizedState=Rp(1|f,b,A,S)}function dS(d,f){return Iv(8390656,8,d,f)}function Dy(d,f){return Dv(2048,8,d,f)}function hS(d,f){return Dv(4,2,d,f)}function fS(d,f){return Dv(4,4,d,f)}function Hy(d,f){if(typeof f=="function")return d=d(),f(d),function(){f(null)};if(f!=null)return d=d(),f.current=d,function(){f.current=null}}function _p(d,f,b){return b=b!=null?b.concat([d]):null,Dv(4,4,Hy.bind(null,f,d),b)}function Ly(){}function mS(d,f){var b=Yo();f=f===void 0?null:f;var S=b.memoizedState;return S!==null&&f!==null&&lo(f,S[1])?S[0]:(b.memoizedState=[d,f],d)}function pS(d,f){var b=Yo();f=f===void 0?null:f;var S=b.memoizedState;return S!==null&&f!==null&&lo(f,S[1])?S[0]:(d=d(),b.memoizedState=[d,f],d)}function gS(d,f,b){return Ur&21?(Tu(b,f)||(b=nc(),hr.lanes|=b,Mp|=b,d.baseState=!0),f):(d.baseState&&(d.baseState=!1,Go=!0),d.memoizedState=b)}function AO(d,f){var b=Cr;Cr=b!==0&&4>b?b:4,d(!0);var S=jr.transition;jr.transition={};try{d(!1),f()}finally{Cr=b,jr.transition=S}}function Hv(){return Yo().memoizedState}function OO(d,f,b){var S=cc(d);if(b={lane:S,action:b,hasEagerState:!1,eagerState:null,next:null},Ff(d))kl(f,b);else if(b=jO(d,f,b,S),b!==null){var T=Ki();uc(b,d,S,T),IO(b,f,S)}}function $y(d,f,b){var S=cc(d),T={lane:S,action:b,hasEagerState:!1,eagerState:null,next:null};if(Ff(d))kl(f,T);else{var A=d.alternate;if(d.lanes===0&&(A===null||A.lanes===0)&&(A=f.lastRenderedReducer,A!==null))try{var ee=f.lastRenderedState,ye=A(ee,b);if(T.hasEagerState=!0,T.eagerState=ye,Tu(ye,ee)){var ke=f.interleaved;ke===null?(T.next=T,JE(f)):(T.next=ke.next,ke.next=T),f.interleaved=T;return}}catch{}finally{}b=jO(d,f,T,S),b!==null&&(T=Ki(),uc(b,d,S,T),IO(b,f,S))}}function Ff(d){var f=d.alternate;return d===hr||f!==null&&f===hr}function kl(d,f){Oy=nS=!0;var b=d.pending;b===null?f.next=f:(f.next=b.next,b.next=f),d.pending=f}function IO(d,f,b){if(b&4194240){var S=f.lanes;S&=d.pendingLanes,b|=S,f.lanes=b,rc(d,b)}}var Si={readContext:Ci,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useInsertionEffect:bt,useLayoutEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useMutableSource:bt,useSyncExternalStore:bt,useId:bt,unstable_isNewReconciler:!1},vS={readContext:Ci,useCallback:function(d,f){return Uo().memoizedState=[d,f===void 0?null:f],d},useContext:Ci,useEffect:dS,useImperativeHandle:function(d,f,b){return b=b!=null?b.concat([d]):null,Iv(4194308,4,Hy.bind(null,f,d),b)},useLayoutEffect:function(d,f){return Iv(4194308,4,d,f)},useInsertionEffect:function(d,f){return Iv(4,2,d,f)},useMemo:function(d,f){var b=Uo();return f=f===void 0?null:f,d=d(),b.memoizedState=[d,f],d},useReducer:function(d,f,b){var S=Uo();return f=b!==void 0?b(f):f,S.memoizedState=S.baseState=f,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:f},S.queue=d,d=d.dispatch=OO.bind(null,hr,d),[S.memoizedState,d]},useRef:function(d){var f=Uo();return d={current:d},f.memoizedState=d},useState:cS,useDebugValue:Ly,useDeferredValue:function(d){return Uo().memoizedState=d},useTransition:function(){var d=cS(!1),f=d[0];return d=AO.bind(null,d[1]),Uo().memoizedState=d,[f,d]},useMutableSource:function(){},useSyncExternalStore:function(d,f,b){var S=hr,T=Uo();if(es){if(b===void 0)throw Error(n(407));b=b()}else{if(b=f(),co===null)throw Error(n(349));Ur&30||iS(S,f,b)}T.memoizedState=b;var A={value:b,getSnapshot:f};return T.queue=A,dS(oS.bind(null,S,A,d),[d]),S.flags|=2048,Rp(9,sS.bind(null,S,A,b,f),void 0,null),b},useId:function(){var d=Uo(),f=co.identifierPrefix;if(es){var b=Cd,S=Ua;b=(S&~(1<<32-Bi(S)-1)).toString(32)+b,f=":"+f+"R"+b,b=Iy++,0<b&&(f+="H"+b.toString(32)),f+=":"}else b=sN++,f=":"+f+"r"+b.toString(32)+":";return d.memoizedState=f},unstable_isNewReconciler:!1},bS={readContext:Ci,useCallback:mS,useContext:Ci,useEffect:Dy,useImperativeHandle:_p,useInsertionEffect:hS,useLayoutEffect:fS,useMemo:pS,useReducer:Sp,useRef:uS,useState:function(){return Sp(Nl)},useDebugValue:Ly,useDeferredValue:function(d){var f=Yo();return gS(f,Oi.memoizedState,d)},useTransition:function(){var d=Sp(Nl)[0],f=Yo().memoizedState;return[d,f]},useMutableSource:Ov,useSyncExternalStore:rS,useId:Hv,unstable_isNewReconciler:!1},Fy={readContext:Ci,useCallback:mS,useContext:Ci,useEffect:Dy,useImperativeHandle:_p,useInsertionEffect:hS,useLayoutEffect:fS,useMemo:pS,useReducer:$f,useRef:uS,useState:function(){return $f(Nl)},useDebugValue:Ly,useDeferredValue:function(d){var f=Yo();return Oi===null?f.memoizedState=d:gS(f,Oi.memoizedState,d)},useTransition:function(){var d=$f(Nl)[0],f=Yo().memoizedState;return[d,f]},useMutableSource:Ov,useSyncExternalStore:rS,useId:Hv,unstable_isNewReconciler:!1};function Tl(d,f){if(d&&d.defaultProps){f=Ee({},f),d=d.defaultProps;for(var b in d)f[b]===void 0&&(f[b]=d[b]);return f}return f}function oN(d,f,b,S){f=d.memoizedState,b=b(S,f),b=b==null?f:Ee({},f,b),d.memoizedState=b,d.lanes===0&&(d.updateQueue.baseState=b)}var yS={isMounted:function(d){return(d=d._reactInternals)?vt(d)===d:!1},enqueueSetState:function(d,f,b){d=d._reactInternals;var S=Ki(),T=cc(d),A=bh(S,T);A.payload=f,b!=null&&(A.callback=b),f=Hf(d,A,T),f!==null&&(uc(f,d,T,S),JC(f,d,T))},enqueueReplaceState:function(d,f,b){d=d._reactInternals;var S=Ki(),T=cc(d),A=bh(S,T);A.tag=1,A.payload=f,b!=null&&(A.callback=b),f=Hf(d,A,T),f!==null&&(uc(f,d,T,S),JC(f,d,T))},enqueueForceUpdate:function(d,f){d=d._reactInternals;var b=Ki(),S=cc(d),T=bh(b,S);T.tag=2,f!=null&&(T.callback=f),f=Hf(d,T,S),f!==null&&(uc(f,d,S,b),JC(f,d,S))}};function DO(d,f,b,S,T,A,ee){return d=d.stateNode,typeof d.shouldComponentUpdate=="function"?d.shouldComponentUpdate(S,A,ee):f.prototype&&f.prototype.isPureReactComponent?!py(b,S)||!py(T,A):!0}function HO(d,f,b){var S=!1,T=_r,A=f.contextType;return typeof A=="object"&&A!==null?A=Ci(A):(T=Es(f)?zc:is.current,S=f.contextTypes,A=(S=S!=null)?sc(d,T):_r),f=new f(b,A),d.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=yS,d.stateNode=f,f._reactInternals=d,S&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=T,d.__reactInternalMemoizedMaskedChildContext=A),f}function xS(d,f,b,S){d=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(b,S),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(b,S),f.state!==d&&yS.enqueueReplaceState(f,f.state,null)}function aN(d,f,b,S){var T=d.stateNode;T.props=b,T.state=d.memoizedState,T.refs={},Df(d);var A=f.contextType;typeof A=="object"&&A!==null?T.context=Ci(A):(A=Es(f)?zc:is.current,T.context=sc(d,A)),T.state=d.memoizedState,A=f.getDerivedStateFromProps,typeof A=="function"&&(oN(d,f,A,b),T.state=d.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(f=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),f!==T.state&&yS.enqueueReplaceState(T,T.state,null),eS(d,b,T,S),T.state=d.memoizedState),typeof T.componentDidMount=="function"&&(d.flags|=4194308)}function zf(d,f){try{var b="",S=f;do b+=xe(S),S=S.return;while(S);var T=b}catch(A){T=` Error generating stack: `+A.message+` `+A.stack}return{value:d,source:f,stack:T,digest:null}}function wS(d,f,b){return{value:d,source:null,stack:b??null,digest:f??null}}function lN(d,f){try{console.error(f.value)}catch(b){setTimeout(function(){throw b})}}var f6=typeof WeakMap=="function"?WeakMap:Map;function zy(d,f,b){b=bh(-1,b),b.tag=3,b.payload={element:null};var S=f.value;return b.callback=function(){Bf||(Bf=!0,qy=S),lN(d,f)},b}function LO(d,f,b){b=bh(-1,b),b.tag=3;var S=d.type.getDerivedStateFromError;if(typeof S=="function"){var T=f.value;b.payload=function(){return S(T)},b.callback=function(){lN(d,f)}}var A=d.stateNode;return A!==null&&typeof A.componentDidCatch=="function"&&(b.callback=function(){lN(d,f),typeof S!="function"&&(Uc===null?Uc=new Set([this]):Uc.add(this));var ee=f.stack;this.componentDidCatch(f.value,{componentStack:ee!==null?ee:""})}),b}function cN(d,f,b){var S=d.pingCache;if(S===null){S=d.pingCache=new f6;var T=new Set;S.set(f,T)}else T=S.get(f),T===void 0&&(T=new Set,S.set(f,T));T.has(b)||(T.add(b),d=CN.bind(null,d,f,b),f.then(d,d))}function uN(d){do{var f;if((f=d.tag===13)&&(f=d.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return d;d=d.return}while(d!==null);return null}function $O(d,f,b,S,T){return d.mode&1?(d.flags|=65536,d.lanes=T,d):(d===f?d.flags|=65536:(d.flags|=128,b.flags|=131072,b.flags&=-52805,b.tag===1&&(b.alternate===null?b.tag=17:(f=bh(-1,1),f.tag=2,Hf(b,f,1))),b.lanes|=1),d)}var Ep=H.ReactCurrentOwner,Go=!1;function Us(d,f,b,S){f.child=d===null?ua(f,null,b,S):Au(f,d.child,b,S)}function CS(d,f,b,S,T){b=b.render;var A=f.ref;return Mv(f,T),S=Un(d,f,b,S,A,T),b=Lf(),d!==null&&!Go?(f.updateQueue=d.updateQueue,f.flags&=-2053,d.lanes&=~T,da(d,f,T)):(es&&b&&WE(f),f.flags|=1,Us(d,f,S,T),f.child)}function jl(d,f,b,S,T){if(d===null){var A=b.type;return typeof A=="function"&&!RN(A)&&A.defaultProps===void 0&&b.compare===null&&b.defaultProps===void 0?(f.tag=15,f.type=A,Np(d,f,A,S,T)):(d=HS(b.type,null,S,f,f.mode,T),d.ref=f.ref,d.return=f,f.child=d)}if(A=d.child,!(d.lanes&T)){var ee=A.memoizedProps;if(b=b.compare,b=b!==null?b:py,b(ee,S)&&d.ref===f.ref)return da(d,f,T)}return f.flags|=1,d=Yf(A,S),d.ref=f.ref,d.return=f,f.child=d}function Np(d,f,b,S,T){if(d!==null){var A=d.memoizedProps;if(py(A,S)&&d.ref===f.ref)if(Go=!1,f.pendingProps=S=A,(d.lanes&T)!==0)d.flags&131072&&(Go=!0);else return f.lanes=d.lanes,da(d,f,T)}return SS(d,f,b,S,T)}function br(d,f,b){var S=f.pendingProps,T=S.children,A=d!==null?d.memoizedState:null;if(S.mode==="hidden")if(!(f.mode&1))f.memoizedState={baseLanes:0,cachePool:null,transitions:null},Gi(zv,lc),lc|=b;else{if(!(b&1073741824))return d=A!==null?A.baseLanes|b:b,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:d,cachePool:null,transitions:null},f.updateQueue=null,Gi(zv,lc),lc|=d,null;f.memoizedState={baseLanes:0,cachePool:null,transitions:null},S=A!==null?A.baseLanes:b,Gi(zv,lc),lc|=S}else A!==null?(S=A.baseLanes|b,f.memoizedState=null):S=b,Gi(zv,lc),lc|=S;return Us(d,f,T,b),f.child}function Vy(d,f){var b=f.ref;(d===null&&b!==null||d!==null&&d.ref!==b)&&(f.flags|=512,f.flags|=2097152)}function SS(d,f,b,S,T){var A=Es(b)?zc:is.current;return A=sc(f,A),Mv(f,T),b=Un(d,f,b,S,A,T),S=Lf(),d!==null&&!Go?(f.updateQueue=d.updateQueue,f.flags&=-2053,d.lanes&=~T,da(d,f,T)):(es&&S&&WE(f),f.flags|=1,Us(d,f,b,T),f.child)}function m6(d,f,b,S,T){if(Es(b)){var A=!0;bp(f)}else A=!1;if(Mv(f,T),f.stateNode===null)Bc(d,f),HO(f,b,S),aN(f,b,S,T),S=!0;else if(d===null){var ee=f.stateNode,ye=f.memoizedProps;ee.props=ye;var ke=ee.context,rt=b.contextType;typeof rt=="object"&&rt!==null?rt=Ci(rt):(rt=Es(b)?zc:is.current,rt=sc(f,rt));var Nt=b.getDerivedStateFromProps,Pt=typeof Nt=="function"||typeof ee.getSnapshotBeforeUpdate=="function";Pt||typeof ee.UNSAFE_componentWillReceiveProps!="function"&&typeof ee.componentWillReceiveProps!="function"||(ye!==S||ke!==rt)&&xS(f,ee,S,rt),Vc=!1;var Et=f.memoizedState;ee.state=Et,eS(f,S,ee,T),ke=f.memoizedState,ye!==S||Et!==ke||oo.current||Vc?(typeof Nt=="function"&&(oN(f,b,Nt,S),ke=f.memoizedState),(ye=Vc||DO(f,b,ye,S,Et,ke,rt))?(Pt||typeof ee.UNSAFE_componentWillMount!="function"&&typeof ee.componentWillMount!="function"||(typeof ee.componentWillMount=="function"&&ee.componentWillMount(),typeof ee.UNSAFE_componentWillMount=="function"&&ee.UNSAFE_componentWillMount()),typeof ee.componentDidMount=="function"&&(f.flags|=4194308)):(typeof ee.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=S,f.memoizedState=ke),ee.props=S,ee.state=ke,ee.context=rt,S=ye):(typeof ee.componentDidMount=="function"&&(f.flags|=4194308),S=!1)}else{ee=f.stateNode,MO(d,f),ye=f.memoizedProps,rt=f.type===f.elementType?ye:Tl(f.type,ye),ee.props=rt,Pt=f.pendingProps,Et=ee.context,ke=b.contextType,typeof ke=="object"&&ke!==null?ke=Ci(ke):(ke=Es(b)?zc:is.current,ke=sc(f,ke));var hn=b.getDerivedStateFromProps;(Nt=typeof hn=="function"||typeof ee.getSnapshotBeforeUpdate=="function")||typeof ee.UNSAFE_componentWillReceiveProps!="function"&&typeof ee.componentWillReceiveProps!="function"||(ye!==Pt||Et!==ke)&&xS(f,ee,S,ke),Vc=!1,Et=f.memoizedState,ee.state=Et,eS(f,S,ee,T);var xn=f.memoizedState;ye!==Pt||Et!==xn||oo.current||Vc?(typeof hn=="function"&&(oN(f,b,hn,S),xn=f.memoizedState),(rt=Vc||DO(f,b,rt,S,Et,xn,ke)||!1)?(Nt||typeof ee.UNSAFE_componentWillUpdate!="function"&&typeof ee.componentWillUpdate!="function"||(typeof ee.componentWillUpdate=="function"&&ee.componentWillUpdate(S,xn,ke),typeof ee.UNSAFE_componentWillUpdate=="function"&&ee.UNSAFE_componentWillUpdate(S,xn,ke)),typeof ee.componentDidUpdate=="function"&&(f.flags|=4),typeof ee.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof ee.componentDidUpdate!="function"||ye===d.memoizedProps&&Et===d.memoizedState||(f.flags|=4),typeof ee.getSnapshotBeforeUpdate!="function"||ye===d.memoizedProps&&Et===d.memoizedState||(f.flags|=1024),f.memoizedProps=S,f.memoizedState=xn),ee.props=S,ee.state=xn,ee.context=ke,S=rt):(typeof ee.componentDidUpdate!="function"||ye===d.memoizedProps&&Et===d.memoizedState||(f.flags|=4),typeof ee.getSnapshotBeforeUpdate!="function"||ye===d.memoizedProps&&Et===d.memoizedState||(f.flags|=1024),S=!1)}return dN(d,f,b,S,A,T)}function dN(d,f,b,S,T,A){Vy(d,f);var ee=(f.flags&128)!==0;if(!S&&!ee)return T&&Ma(f,b,!1),da(d,f,A);S=f.stateNode,Ep.current=f;var ye=ee&&typeof b.getDerivedStateFromError!="function"?null:S.render();return f.flags|=1,d!==null&&ee?(f.child=Au(f,d.child,null,A),f.child=Au(f,null,ye,A)):Us(d,f,ye,A),f.memoizedState=S.state,T&&Ma(f,b,!0),f.child}function RS(d){var f=d.stateNode;f.pendingContext?QC(d,f.pendingContext,f.pendingContext!==f.context):f.context&&QC(d,f.context,!1),tN(d,f.containerInfo)}function Lv(d,f,b,S,T){return vh(),Ty(T),f.flags|=256,Us(d,f,b,S),f.child}var hN={dehydrated:null,treeContext:null,retryLane:0};function _S(d){return{baseLanes:d,cachePool:null,transitions:null}}function FO(d,f,b){var S=f.pendingProps,T=ss.current,A=!1,ee=(f.flags&128)!==0,ye;if((ye=ee)||(ye=d!==null&&d.memoizedState===null?!1:(T&2)!==0),ye?(A=!0,f.flags&=-129):(d===null||d.memoizedState!==null)&&(T|=1),Gi(ss,T&1),d===null)return KE(f),d=f.memoizedState,d!==null&&(d=d.dehydrated,d!==null)?(f.mode&1?d.data==="$!"?f.lanes=8:f.lanes=1073741824:f.lanes=1,null):(ee=S.children,d=S.fallback,A?(S=f.mode,A=f.child,ee={mode:"hidden",children:ee},!(S&1)&&A!==null?(A.childLanes=0,A.pendingProps=ee):A=Gv(ee,S,0,null),d=Gf(d,S,b,null),A.return=f,d.return=f,A.sibling=d,f.child=A,f.child.memoizedState=_S(b),f.memoizedState=hN,d):By(f,ee));if(T=d.memoizedState,T!==null&&(ye=T.dehydrated,ye!==null))return zO(d,f,ee,S,ye,T,b);if(A){A=S.fallback,ee=f.mode,T=d.child,ye=T.sibling;var ke={mode:"hidden",children:S.children};return!(ee&1)&&f.child!==T?(S=f.child,S.childLanes=0,S.pendingProps=ke,f.deletions=null):(S=Yf(T,ke),S.subtreeFlags=T.subtreeFlags&14680064),ye!==null?A=Yf(ye,A):(A=Gf(A,ee,b,null),A.flags|=2),A.return=f,S.return=f,S.sibling=A,f.child=S,S=A,A=f.child,ee=d.child.memoizedState,ee=ee===null?_S(b):{baseLanes:ee.baseLanes|b,cachePool:null,transitions:ee.transitions},A.memoizedState=ee,A.childLanes=d.childLanes&~b,f.memoizedState=hN,S}return A=d.child,d=A.sibling,S=Yf(A,{mode:"visible",children:S.children}),!(f.mode&1)&&(S.lanes=b),S.return=f,S.sibling=null,d!==null&&(b=f.deletions,b===null?(f.deletions=[d],f.flags|=16):b.push(d)),f.child=S,f.memoizedState=null,S}function By(d,f){return f=Gv({mode:"visible",children:f},d.mode,0,null),f.return=d,d.child=f}function ES(d,f,b,S){return S!==null&&Ty(S),Au(f,d.child,null,b),d=By(f,f.pendingProps.children),d.flags|=2,f.memoizedState=null,d}function zO(d,f,b,S,T,A,ee){if(b)return f.flags&256?(f.flags&=-257,S=wS(Error(n(422))),ES(d,f,ee,S)):f.memoizedState!==null?(f.child=d.child,f.flags|=128,null):(A=S.fallback,T=f.mode,S=Gv({mode:"visible",children:S.children},T,0,null),A=Gf(A,T,ee,null),A.flags|=2,S.return=f,A.return=f,S.sibling=A,f.child=S,f.mode&1&&Au(f,d.child,null,ee),f.child.memoizedState=_S(ee),f.memoizedState=hN,A);if(!(f.mode&1))return ES(d,f,ee,null);if(T.data==="$!"){if(S=T.nextSibling&&T.nextSibling.dataset,S)var ye=S.dgst;return S=ye,A=Error(n(419)),S=wS(A,S,void 0),ES(d,f,ee,S)}if(ye=(ee&d.childLanes)!==0,Go||ye){if(S=co,S!==null){switch(ee&-ee){case 4:T=2;break;case 16:T=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:T=32;break;case 536870912:T=268435456;break;default:T=0}T=T&(S.suspendedLanes|ee)?0:T,T!==0&&T!==A.retryLane&&(A.retryLane=T,Sd(d,T),uc(S,d,T,-1))}return xN(),S=wS(Error(n(421))),ES(d,f,ee,S)}return T.data==="$?"?(f.flags|=128,f.child=d.child,f=x6.bind(null,d),T._reactRetry=f,null):(d=A.treeContext,El=ju(T.nextSibling),_l=f,es=!0,Pu=null,d!==null&&(ca[ao++]=Ua,ca[ao++]=Cd,ca[ao++]=yp,Ua=d.id,Cd=d.overflow,yp=f),f=By(f,S.children),f.flags|=4096,f)}function fN(d,f,b){d.lanes|=f;var S=d.alternate;S!==null&&(S.lanes|=f),ZE(d.return,f,b)}function NS(d,f,b,S,T){var A=d.memoizedState;A===null?d.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:S,tail:b,tailMode:T}:(A.isBackwards=f,A.rendering=null,A.renderingStartTime=0,A.last=S,A.tail=b,A.tailMode=T)}function Ml(d,f,b){var S=f.pendingProps,T=S.revealOrder,A=S.tail;if(Us(d,f,S.children,b),S=ss.current,S&2)S=S&1|2,f.flags|=128;else{if(d!==null&&d.flags&128)e:for(d=f.child;d!==null;){if(d.tag===13)d.memoizedState!==null&&fN(d,b,f);else if(d.tag===19)fN(d,b,f);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===f)break e;for(;d.sibling===null;){if(d.return===null||d.return===f)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}S&=1}if(Gi(ss,S),!(f.mode&1))f.memoizedState=null;else switch(T){case"forwards":for(b=f.child,T=null;b!==null;)d=b.alternate,d!==null&&tS(d)===null&&(T=b),b=b.sibling;b=T,b===null?(T=f.child,f.child=null):(T=b.sibling,b.sibling=null),NS(f,!1,T,b,A);break;case"backwards":for(b=null,T=f.child,f.child=null;T!==null;){if(d=T.alternate,d!==null&&tS(d)===null){f.child=T;break}d=T.sibling,T.sibling=b,b=T,T=d}NS(f,!0,b,null,A);break;case"together":NS(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function Bc(d,f){!(f.mode&1)&&d!==null&&(d.alternate=null,f.alternate=null,f.flags|=2)}function da(d,f,b){if(d!==null&&(f.dependencies=d.dependencies),Mp|=f.lanes,!(b&f.childLanes))return null;if(d!==null&&f.child!==d.child)throw Error(n(153));if(f.child!==null){for(d=f.child,b=Yf(d,d.pendingProps),f.child=b,b.return=f;d.sibling!==null;)d=d.sibling,b=b.sibling=Yf(d,d.pendingProps),b.return=f;b.sibling=null}return f.child}function kS(d,f,b){switch(f.tag){case 3:RS(f),vh();break;case 5:nN(f);break;case 1:Es(f.type)&&bp(f);break;case 4:tN(f,f.stateNode.containerInfo);break;case 10:var S=f.type._context,T=f.memoizedProps.value;Gi(Xt,S._currentValue),S._currentValue=T;break;case 13:if(S=f.memoizedState,S!==null)return S.dehydrated!==null?(Gi(ss,ss.current&1),f.flags|=128,null):b&f.child.childLanes?FO(d,f,b):(Gi(ss,ss.current&1),d=da(d,f,b),d!==null?d.sibling:null);Gi(ss,ss.current&1);break;case 19:if(S=(b&f.childLanes)!==0,d.flags&128){if(S)return Ml(d,f,b);f.flags|=128}if(T=f.memoizedState,T!==null&&(T.rendering=null,T.tail=null,T.lastEffect=null),Gi(ss,ss.current),S)break;return null;case 22:case 23:return f.lanes=0,br(d,f,b)}return da(d,f,b)}var $v,ac,Eo,VO;$v=function(d,f){for(var b=f.child;b!==null;){if(b.tag===5||b.tag===6)d.appendChild(b.stateNode);else if(b.tag!==4&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===f)break;for(;b.sibling===null;){if(b.return===null||b.return===f)return;b=b.return}b.sibling.return=b.return,b=b.sibling}},ac=function(){},Eo=function(d,f,b,S){var T=d.memoizedProps;if(T!==S){d=f.stateNode,Cp(Rd.current);var A=null;switch(b){case"input":T=q(d,T),S=q(d,S),A=[];break;case"select":T=Ee({},T,{value:void 0}),S=Ee({},S,{value:void 0}),A=[];break;case"textarea":T=tt(d,T),S=tt(d,S),A=[];break;default:typeof T.onClick!="function"&&typeof S.onClick=="function"&&(d.onclick=GC)}je(b,S);var ee;b=null;for(rt in T)if(!S.hasOwnProperty(rt)&&T.hasOwnProperty(rt)&&T[rt]!=null)if(rt==="style"){var ye=T[rt];for(ee in ye)ye.hasOwnProperty(ee)&&(b||(b={}),b[ee]="")}else rt!=="dangerouslySetInnerHTML"&&rt!=="children"&&rt!=="suppressContentEditableWarning"&&rt!=="suppressHydrationWarning"&&rt!=="autoFocus"&&(i.hasOwnProperty(rt)?A||(A=[]):(A=A||[]).push(rt,null));for(rt in S){var ke=S[rt];if(ye=T!=null?T[rt]:void 0,S.hasOwnProperty(rt)&&ke!==ye&&(ke!=null||ye!=null))if(rt==="style")if(ye){for(ee in ye)!ye.hasOwnProperty(ee)||ke&&ke.hasOwnProperty(ee)||(b||(b={}),b[ee]="");for(ee in ke)ke.hasOwnProperty(ee)&&ye[ee]!==ke[ee]&&(b||(b={}),b[ee]=ke[ee])}else b||(A||(A=[]),A.push(rt,b)),b=ke;else rt==="dangerouslySetInnerHTML"?(ke=ke?ke.__html:void 0,ye=ye?ye.__html:void 0,ke!=null&&ye!==ke&&(A=A||[]).push(rt,ke)):rt==="children"?typeof ke!="string"&&typeof ke!="number"||(A=A||[]).push(rt,""+ke):rt!=="suppressContentEditableWarning"&&rt!=="suppressHydrationWarning"&&(i.hasOwnProperty(rt)?(ke!=null&&rt==="onScroll"&&gi("scroll",d),A||ye===ke||(A=[])):(A=A||[]).push(rt,ke))}b&&(A=A||[]).push("style",b);var rt=A;(f.updateQueue=rt)&&(f.flags|=4)}},VO=function(d,f,b,S){b!==S&&(f.flags|=4)};function Wy(d,f){if(!es)switch(d.tailMode){case"hidden":f=d.tail;for(var b=null;f!==null;)f.alternate!==null&&(b=f),f=f.sibling;b===null?d.tail=null:b.sibling=null;break;case"collapsed":b=d.tail;for(var S=null;b!==null;)b.alternate!==null&&(S=b),b=b.sibling;S===null?f||d.tail===null?d.tail=null:d.tail.sibling=null:S.sibling=null}}function Aa(d){var f=d.alternate!==null&&d.alternate.child===d.child,b=0,S=0;if(f)for(var T=d.child;T!==null;)b|=T.lanes|T.childLanes,S|=T.subtreeFlags&14680064,S|=T.flags&14680064,T.return=d,T=T.sibling;else for(T=d.child;T!==null;)b|=T.lanes|T.childLanes,S|=T.subtreeFlags,S|=T.flags,T.return=d,T=T.sibling;return d.subtreeFlags|=S,d.childLanes=b,f}function mN(d,f,b){var S=f.pendingProps;switch(ZC(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Aa(f),null;case 1:return Es(f.type)&&wd(),Aa(f),null;case 3:return S=f.stateNode,Av(),wi(oo),wi(is),Ay(),S.pendingContext&&(S.context=S.pendingContext,S.pendingContext=null),(d===null||d.child===null)&&(Ws(f)?f.flags|=4:d===null||d.memoizedState.isDehydrated&&!(f.flags&256)||(f.flags|=1024,Pu!==null&&(Jy(Pu),Pu=null))),ac(d,f),Aa(f),null;case 5:rN(f);var T=Cp(Py.current);if(b=f.type,d!==null&&f.stateNode!=null)Eo(d,f,b,S,T),d.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!S){if(f.stateNode===null)throw Error(n(166));return Aa(f),null}if(d=Cp(Rd.current),Ws(f)){S=f.stateNode,b=f.type;var A=f.memoizedProps;switch(S[Fc]=f,S[_y]=A,d=(f.mode&1)!==0,b){case"dialog":gi("cancel",S),gi("close",S);break;case"iframe":case"object":case"embed":gi("load",S);break;case"video":case"audio":for(T=0;T<xy.length;T++)gi(xy[T],S);break;case"source":gi("error",S);break;case"img":case"image":case"link":gi("error",S),gi("load",S);break;case"details":gi("toggle",S);break;case"input":I(S,A),gi("invalid",S);break;case"select":S._wrapperState={wasMultiple:!!A.multiple},gi("invalid",S);break;case"textarea":ot(S,A),gi("invalid",S)}je(b,A),T=null;for(var ee in A)if(A.hasOwnProperty(ee)){var ye=A[ee];ee==="children"?typeof ye=="string"?S.textContent!==ye&&(A.suppressHydrationWarning!==!0&&YC(S.textContent,ye,d),T=["children",ye]):typeof ye=="number"&&S.textContent!==""+ye&&(A.suppressHydrationWarning!==!0&&YC(S.textContent,ye,d),T=["children",""+ye]):i.hasOwnProperty(ee)&&ye!=null&&ee==="onScroll"&&gi("scroll",S)}switch(b){case"input":N(S),re(S,A,!0);break;case"textarea":N(S),X(S);break;case"select":case"option":break;default:typeof A.onClick=="function"&&(S.onclick=GC)}S=T,f.updateQueue=S,S!==null&&(f.flags|=4)}else{ee=T.nodeType===9?T:T.ownerDocument,d==="http://www.w3.org/1999/xhtml"&&(d=de(b)),d==="http://www.w3.org/1999/xhtml"?b==="script"?(d=ee.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild)):typeof S.is=="string"?d=ee.createElement(b,{is:S.is}):(d=ee.createElement(b),b==="select"&&(ee=d,S.multiple?ee.multiple=!0:S.size&&(ee.size=S.size))):d=ee.createElementNS(d,b),d[Fc]=f,d[_y]=S,$v(d,f,!1,!1),f.stateNode=d;e:{switch(ee=Pe(b,S),b){case"dialog":gi("cancel",d),gi("close",d),T=S;break;case"iframe":case"object":case"embed":gi("load",d),T=S;break;case"video":case"audio":for(T=0;T<xy.length;T++)gi(xy[T],d);T=S;break;case"source":gi("error",d),T=S;break;case"img":case"image":case"link":gi("error",d),gi("load",d),T=S;break;case"details":gi("toggle",d),T=S;break;case"input":I(d,S),T=q(d,S),gi("invalid",d);break;case"option":T=S;break;case"select":d._wrapperState={wasMultiple:!!S.multiple},T=Ee({},S,{value:void 0}),gi("invalid",d);break;case"textarea":ot(d,S),T=tt(d,S),gi("invalid",d);break;default:T=S}je(b,T),ye=T;for(A in ye)if(ye.hasOwnProperty(A)){var ke=ye[A];A==="style"?me(d,ke):A==="dangerouslySetInnerHTML"?(ke=ke?ke.__html:void 0,ke!=null&&Ge(d,ke)):A==="children"?typeof ke=="string"?(b!=="textarea"||ke!=="")&&Qe(d,ke):typeof ke=="number"&&Qe(d,""+ke):A!=="suppressContentEditableWarning"&&A!=="suppressHydrationWarning"&&A!=="autoFocus"&&(i.hasOwnProperty(A)?ke!=null&&A==="onScroll"&&gi("scroll",d):ke!=null&&z(d,A,ke,ee))}switch(b){case"input":N(d),re(d,S,!1);break;case"textarea":N(d),X(d);break;case"option":S.value!=null&&d.setAttribute("value",""+we(S.value));break;case"select":d.multiple=!!S.multiple,A=S.value,A!=null?Me(d,!!S.multiple,A,!1):S.defaultValue!=null&&Me(d,!!S.multiple,S.defaultValue,!0);break;default:typeof T.onClick=="function"&&(d.onclick=GC)}switch(b){case"button":case"input":case"select":case"textarea":S=!!S.autoFocus;break e;case"img":S=!0;break e;default:S=!1}}S&&(f.flags|=4)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return Aa(f),null;case 6:if(d&&f.stateNode!=null)VO(d,f,d.memoizedProps,S);else{if(typeof S!="string"&&f.stateNode===null)throw Error(n(166));if(b=Cp(Py.current),Cp(Rd.current),Ws(f)){if(S=f.stateNode,b=f.memoizedProps,S[Fc]=f,(A=S.nodeValue!==b)&&(d=_l,d!==null))switch(d.tag){case 3:YC(S.nodeValue,b,(d.mode&1)!==0);break;case 5:d.memoizedProps.suppressHydrationWarning!==!0&&YC(S.nodeValue,b,(d.mode&1)!==0)}A&&(f.flags|=4)}else S=(b.nodeType===9?b:b.ownerDocument).createTextNode(S),S[Fc]=f,f.stateNode=S}return Aa(f),null;case 13:if(wi(ss),S=f.memoizedState,d===null||d.memoizedState!==null&&d.memoizedState.dehydrated!==null){if(es&&El!==null&&f.mode&1&&!(f.flags&128))NO(),vh(),f.flags|=98560,A=!1;else if(A=Ws(f),S!==null&&S.dehydrated!==null){if(d===null){if(!A)throw Error(n(318));if(A=f.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(n(317));A[Fc]=f}else vh(),!(f.flags&128)&&(f.memoizedState=null),f.flags|=4;Aa(f),A=!1}else Pu!==null&&(Jy(Pu),Pu=null),A=!0;if(!A)return f.flags&65536?f:null}return f.flags&128?(f.lanes=b,f):(S=S!==null,S!==(d!==null&&d.memoizedState!==null)&&S&&(f.child.flags|=8192,f.mode&1&&(d===null||ss.current&1?No===0&&(No=3):xN())),f.updateQueue!==null&&(f.flags|=4),Aa(f),null);case 4:return Av(),ac(d,f),d===null&&Cy(f.stateNode.containerInfo),Aa(f),null;case 10:return QE(f.type._context),Aa(f),null;case 17:return Es(f.type)&&wd(),Aa(f),null;case 19:if(wi(ss),A=f.memoizedState,A===null)return Aa(f),null;if(S=(f.flags&128)!==0,ee=A.rendering,ee===null)if(S)Wy(A,!1);else{if(No!==0||d!==null&&d.flags&128)for(d=f.child;d!==null;){if(ee=tS(d),ee!==null){for(f.flags|=128,Wy(A,!1),S=ee.updateQueue,S!==null&&(f.updateQueue=S,f.flags|=4),f.subtreeFlags=0,S=b,b=f.child;b!==null;)A=b,d=S,A.flags&=14680066,ee=A.alternate,ee===null?(A.childLanes=0,A.lanes=d,A.child=null,A.subtreeFlags=0,A.memoizedProps=null,A.memoizedState=null,A.updateQueue=null,A.dependencies=null,A.stateNode=null):(A.childLanes=ee.childLanes,A.lanes=ee.lanes,A.child=ee.child,A.subtreeFlags=0,A.deletions=null,A.memoizedProps=ee.memoizedProps,A.memoizedState=ee.memoizedState,A.updateQueue=ee.updateQueue,A.type=ee.type,d=ee.dependencies,A.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),b=b.sibling;return Gi(ss,ss.current&1|2),f.child}d=d.sibling}A.tail!==null&&vn()>Bv&&(f.flags|=128,S=!0,Wy(A,!1),f.lanes=4194304)}else{if(!S)if(d=tS(ee),d!==null){if(f.flags|=128,S=!0,b=d.updateQueue,b!==null&&(f.updateQueue=b,f.flags|=4),Wy(A,!0),A.tail===null&&A.tailMode==="hidden"&&!ee.alternate&&!es)return Aa(f),null}else 2*vn()-A.renderingStartTime>Bv&&b!==1073741824&&(f.flags|=128,S=!0,Wy(A,!1),f.lanes=4194304);A.isBackwards?(ee.sibling=f.child,f.child=ee):(b=A.last,b!==null?b.sibling=ee:f.child=ee,A.last=ee)}return A.tail!==null?(f=A.tail,A.rendering=f,A.tail=f.sibling,A.renderingStartTime=vn(),f.sibling=null,b=ss.current,Gi(ss,S?b&1|2:b&1),f):(Aa(f),null);case 22:case 23:return yN(),S=f.memoizedState!==null,d!==null&&d.memoizedState!==null!==S&&(f.flags|=8192),S&&f.mode&1?lc&1073741824&&(Aa(f),f.subtreeFlags&6&&(f.flags|=8192)):Aa(f),null;case 24:return null;case 25:return null}throw Error(n(156,f.tag))}function BO(d,f){switch(ZC(f),f.tag){case 1:return Es(f.type)&&wd(),d=f.flags,d&65536?(f.flags=d&-65537|128,f):null;case 3:return Av(),wi(oo),wi(is),Ay(),d=f.flags,d&65536&&!(d&128)?(f.flags=d&-65537|128,f):null;case 5:return rN(f),null;case 13:if(wi(ss),d=f.memoizedState,d!==null&&d.dehydrated!==null){if(f.alternate===null)throw Error(n(340));vh()}return d=f.flags,d&65536?(f.flags=d&-65537|128,f):null;case 19:return wi(ss),null;case 4:return Av(),null;case 10:return QE(f.type._context),null;case 22:case 23:return yN(),null;case 24:return null;default:return null}}var kp=!1,ha=!1,p6=typeof WeakSet=="function"?WeakSet:Set,bn=null;function Vf(d,f){var b=d.ref;if(b!==null)if(typeof b=="function")try{b(null)}catch(S){Ns(d,f,S)}else b.current=null}function pN(d,f,b){try{b()}catch(S){Ns(d,f,S)}}var gN=!1;function g6(d,f){if(pp=Ui,d=Tf(),xv(d)){if("selectionStart"in d)var b={start:d.selectionStart,end:d.selectionEnd};else e:{b=(b=d.ownerDocument)&&b.defaultView||window;var S=b.getSelection&&b.getSelection();if(S&&S.rangeCount!==0){b=S.anchorNode;var T=S.anchorOffset,A=S.focusNode;S=S.focusOffset;try{b.nodeType,A.nodeType}catch{b=null;break e}var ee=0,ye=-1,ke=-1,rt=0,Nt=0,Pt=d,Et=null;t:for(;;){for(var hn;Pt!==b||T!==0&&Pt.nodeType!==3||(ye=ee+T),Pt!==A||S!==0&&Pt.nodeType!==3||(ke=ee+S),Pt.nodeType===3&&(ee+=Pt.nodeValue.length),(hn=Pt.firstChild)!==null;)Et=Pt,Pt=hn;for(;;){if(Pt===d)break t;if(Et===b&&++rt===T&&(ye=ee),Et===A&&++Nt===S&&(ke=ee),(hn=Pt.nextSibling)!==null)break;Pt=Et,Et=Pt.parentNode}Pt=hn}b=ye===-1||ke===-1?null:{start:ye,end:ke}}else b=null}b=b||{start:0,end:0}}else b=null;for(Ry={focusedElem:d,selectionRange:b},Ui=!1,bn=f;bn!==null;)if(f=bn,d=f.child,(f.subtreeFlags&1028)!==0&&d!==null)d.return=f,bn=d;else for(;bn!==null;){f=bn;try{var xn=f.alternate;if(f.flags&1024)switch(f.tag){case 0:case 11:case 15:break;case 1:if(xn!==null){var Rn=xn.memoizedProps,Gs=xn.memoizedState,We=f.stateNode,De=We.getSnapshotBeforeUpdate(f.elementType===f.type?Rn:Tl(f.type,Rn),Gs);We.__reactInternalSnapshotBeforeUpdate=De}break;case 3:var Xe=f.stateNode.containerInfo;Xe.nodeType===1?Xe.textContent="":Xe.nodeType===9&&Xe.documentElement&&Xe.removeChild(Xe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ht){Ns(f,f.return,Ht)}if(d=f.sibling,d!==null){d.return=f.return,bn=d;break}bn=f.return}return xn=gN,gN=!1,xn}function Fv(d,f,b){var S=f.updateQueue;if(S=S!==null?S.lastEffect:null,S!==null){var T=S=S.next;do{if((T.tag&d)===d){var A=T.destroy;T.destroy=void 0,A!==void 0&&pN(f,b,A)}T=T.next}while(T!==S)}}function TS(d,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var b=f=f.next;do{if((b.tag&d)===d){var S=b.create;b.destroy=S()}b=b.next}while(b!==f)}}function jS(d){var f=d.ref;if(f!==null){var b=d.stateNode;switch(d.tag){case 5:d=b;break;default:d=b}typeof f=="function"?f(d):f.current=d}}function WO(d){var f=d.alternate;f!==null&&(d.alternate=null,WO(f)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(f=d.stateNode,f!==null&&(delete f[Fc],delete f[_y],delete f[zE],delete f[VE],delete f[kv])),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}function MS(d){return d.tag===5||d.tag===3||d.tag===4}function Uy(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||MS(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function _d(d,f,b){var S=d.tag;if(S===5||S===6)d=d.stateNode,f?b.nodeType===8?b.parentNode.insertBefore(d,f):b.insertBefore(d,f):(b.nodeType===8?(f=b.parentNode,f.insertBefore(d,b)):(f=b,f.appendChild(d)),b=b._reactRootContainer,b!=null||f.onclick!==null||(f.onclick=GC));else if(S!==4&&(d=d.child,d!==null))for(_d(d,f,b),d=d.sibling;d!==null;)_d(d,f,b),d=d.sibling}function Ed(d,f,b){var S=d.tag;if(S===5||S===6)d=d.stateNode,f?b.insertBefore(d,f):b.appendChild(d);else if(S!==4&&(d=d.child,d!==null))for(Ed(d,f,b),d=d.sibling;d!==null;)Ed(d,f,b),d=d.sibling}var os=null,Ya=!1;function Wc(d,f,b){for(b=b.child;b!==null;)yh(d,f,b),b=b.sibling}function yh(d,f,b){if(Fr&&typeof Fr.onCommitFiberUnmount=="function")try{Fr.onCommitFiberUnmount(ni,b)}catch{}switch(b.tag){case 5:ha||Vf(b,f);case 6:var S=os,T=Ya;os=null,Wc(d,f,b),os=S,Ya=T,os!==null&&(Ya?(d=os,b=b.stateNode,d.nodeType===8?d.parentNode.removeChild(b):d.removeChild(b)):os.removeChild(b.stateNode));break;case 18:os!==null&&(Ya?(d=os,b=b.stateNode,d.nodeType===8?Ev(d.parentNode,b):d.nodeType===1&&Ev(d,b),Kr(d)):Ev(os,b.stateNode));break;case 4:S=os,T=Ya,os=b.stateNode.containerInfo,Ya=!0,Wc(d,f,b),os=S,Ya=T;break;case 0:case 11:case 14:case 15:if(!ha&&(S=b.updateQueue,S!==null&&(S=S.lastEffect,S!==null))){T=S=S.next;do{var A=T,ee=A.destroy;A=A.tag,ee!==void 0&&(A&2||A&4)&&pN(b,f,ee),T=T.next}while(T!==S)}Wc(d,f,b);break;case 1:if(!ha&&(Vf(b,f),S=b.stateNode,typeof S.componentWillUnmount=="function"))try{S.props=b.memoizedProps,S.state=b.memoizedState,S.componentWillUnmount()}catch(ye){Ns(b,f,ye)}Wc(d,f,b);break;case 21:Wc(d,f,b);break;case 22:b.mode&1?(ha=(S=ha)||b.memoizedState!==null,Wc(d,f,b),ha=S):Wc(d,f,b);break;default:Wc(d,f,b)}}function UO(d){var f=d.updateQueue;if(f!==null){d.updateQueue=null;var b=d.stateNode;b===null&&(b=d.stateNode=new p6),f.forEach(function(S){var T=w6.bind(null,d,S);b.has(S)||(b.add(S),S.then(T,T))})}}function Ou(d,f){var b=f.deletions;if(b!==null)for(var S=0;S<b.length;S++){var T=b[S];try{var A=d,ee=f,ye=ee;e:for(;ye!==null;){switch(ye.tag){case 5:os=ye.stateNode,Ya=!1;break e;case 3:os=ye.stateNode.containerInfo,Ya=!0;break e;case 4:os=ye.stateNode.containerInfo,Ya=!0;break e}ye=ye.return}if(os===null)throw Error(n(160));yh(A,ee,T),os=null,Ya=!1;var ke=T.alternate;ke!==null&&(ke.return=null),T.return=null}catch(rt){Ns(T,f,rt)}}if(f.subtreeFlags&12854)for(f=f.child;f!==null;)YO(f,d),f=f.sibling}function YO(d,f){var b=d.alternate,S=d.flags;switch(d.tag){case 0:case 11:case 14:case 15:if(Ou(f,d),Iu(d),S&4){try{Fv(3,d,d.return),TS(3,d)}catch(Rn){Ns(d,d.return,Rn)}try{Fv(5,d,d.return)}catch(Rn){Ns(d,d.return,Rn)}}break;case 1:Ou(f,d),Iu(d),S&512&&b!==null&&Vf(b,b.return);break;case 5:if(Ou(f,d),Iu(d),S&512&&b!==null&&Vf(b,b.return),d.flags&32){var T=d.stateNode;try{Qe(T,"")}catch(Rn){Ns(d,d.return,Rn)}}if(S&4&&(T=d.stateNode,T!=null)){var A=d.memoizedProps,ee=b!==null?b.memoizedProps:A,ye=d.type,ke=d.updateQueue;if(d.updateQueue=null,ke!==null)try{ye==="input"&&A.type==="radio"&&A.name!=null&&Z(T,A),Pe(ye,ee);var rt=Pe(ye,A);for(ee=0;ee<ke.length;ee+=2){var Nt=ke[ee],Pt=ke[ee+1];Nt==="style"?me(T,Pt):Nt==="dangerouslySetInnerHTML"?Ge(T,Pt):Nt==="children"?Qe(T,Pt):z(T,Nt,Pt,rt)}switch(ye){case"input":U(T,A);break;case"textarea":lt(T,A);break;case"select":var Et=T._wrapperState.wasMultiple;T._wrapperState.wasMultiple=!!A.multiple;var hn=A.value;hn!=null?Me(T,!!A.multiple,hn,!1):Et!==!!A.multiple&&(A.defaultValue!=null?Me(T,!!A.multiple,A.defaultValue,!0):Me(T,!!A.multiple,A.multiple?[]:"",!1))}T[_y]=A}catch(Rn){Ns(d,d.return,Rn)}}break;case 6:if(Ou(f,d),Iu(d),S&4){if(d.stateNode===null)throw Error(n(162));T=d.stateNode,A=d.memoizedProps;try{T.nodeValue=A}catch(Rn){Ns(d,d.return,Rn)}}break;case 3:if(Ou(f,d),Iu(d),S&4&&b!==null&&b.memoizedState.isDehydrated)try{Kr(f.containerInfo)}catch(Rn){Ns(d,d.return,Rn)}break;case 4:Ou(f,d),Iu(d);break;case 13:Ou(f,d),Iu(d),T=d.child,T.flags&8192&&(A=T.memoizedState!==null,T.stateNode.isHidden=A,!A||T.alternate!==null&&T.alternate.memoizedState!==null||(bN=vn())),S&4&&UO(d);break;case 22:if(Nt=b!==null&&b.memoizedState!==null,d.mode&1?(ha=(rt=ha)||Nt,Ou(f,d),ha=rt):Ou(f,d),Iu(d),S&8192){if(rt=d.memoizedState!==null,(d.stateNode.isHidden=rt)&&!Nt&&d.mode&1)for(bn=d,Nt=d.child;Nt!==null;){for(Pt=bn=Nt;bn!==null;){switch(Et=bn,hn=Et.child,Et.tag){case 0:case 11:case 14:case 15:Fv(4,Et,Et.return);break;case 1:Vf(Et,Et.return);var xn=Et.stateNode;if(typeof xn.componentWillUnmount=="function"){S=Et,b=Et.return;try{f=S,xn.props=f.memoizedProps,xn.state=f.memoizedState,xn.componentWillUnmount()}catch(Rn){Ns(S,b,Rn)}}break;case 5:Vf(Et,Et.return);break;case 22:if(Et.memoizedState!==null){KO(Pt);continue}}hn!==null?(hn.return=Et,bn=hn):KO(Pt)}Nt=Nt.sibling}e:for(Nt=null,Pt=d;;){if(Pt.tag===5){if(Nt===null){Nt=Pt;try{T=Pt.stateNode,rt?(A=T.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none"):(ye=Pt.stateNode,ke=Pt.memoizedProps.style,ee=ke!=null&&ke.hasOwnProperty("display")?ke.display:null,ye.style.display=J("display",ee))}catch(Rn){Ns(d,d.return,Rn)}}}else if(Pt.tag===6){if(Nt===null)try{Pt.stateNode.nodeValue=rt?"":Pt.memoizedProps}catch(Rn){Ns(d,d.return,Rn)}}else if((Pt.tag!==22&&Pt.tag!==23||Pt.memoizedState===null||Pt===d)&&Pt.child!==null){Pt.child.return=Pt,Pt=Pt.child;continue}if(Pt===d)break e;for(;Pt.sibling===null;){if(Pt.return===null||Pt.return===d)break e;Nt===Pt&&(Nt=null),Pt=Pt.return}Nt===Pt&&(Nt=null),Pt.sibling.return=Pt.return,Pt=Pt.sibling}}break;case 19:Ou(f,d),Iu(d),S&4&&UO(d);break;case 21:break;default:Ou(f,d),Iu(d)}}function Iu(d){var f=d.flags;if(f&2){try{e:{for(var b=d.return;b!==null;){if(MS(b)){var S=b;break e}b=b.return}throw Error(n(160))}switch(S.tag){case 5:var T=S.stateNode;S.flags&32&&(Qe(T,""),S.flags&=-33);var A=Uy(d);Ed(d,A,T);break;case 3:case 4:var ee=S.stateNode.containerInfo,ye=Uy(d);_d(d,ye,ee);break;default:throw Error(n(161))}}catch(ke){Ns(d,d.return,ke)}d.flags&=-3}f&4096&&(d.flags&=-4097)}function Yy(d,f,b){bn=d,GO(d)}function GO(d,f,b){for(var S=(d.mode&1)!==0;bn!==null;){var T=bn,A=T.child;if(T.tag===22&&S){var ee=T.memoizedState!==null||kp;if(!ee){var ye=T.alternate,ke=ye!==null&&ye.memoizedState!==null||ha;ye=kp;var rt=ha;if(kp=ee,(ha=ke)&&!rt)for(bn=T;bn!==null;)ee=bn,ke=ee.child,ee.tag===22&&ee.memoizedState!==null?Gy(T):ke!==null?(ke.return=ee,bn=ke):Gy(T);for(;A!==null;)bn=A,GO(A),A=A.sibling;bn=T,kp=ye,ha=rt}vN(d)}else T.subtreeFlags&8772&&A!==null?(A.return=T,bn=A):vN(d)}}function vN(d){for(;bn!==null;){var f=bn;if(f.flags&8772){var b=f.alternate;try{if(f.flags&8772)switch(f.tag){case 0:case 11:case 15:ha||TS(5,f);break;case 1:var S=f.stateNode;if(f.flags&4&&!ha)if(b===null)S.componentDidMount();else{var T=f.elementType===f.type?b.memoizedProps:Tl(f.type,b.memoizedProps);S.componentDidUpdate(T,b.memoizedState,S.__reactInternalSnapshotBeforeUpdate)}var A=f.updateQueue;A!==null&&eN(f,A,S);break;case 3:var ee=f.updateQueue;if(ee!==null){if(b=null,f.child!==null)switch(f.child.tag){case 5:b=f.child.stateNode;break;case 1:b=f.child.stateNode}eN(f,ee,b)}break;case 5:var ye=f.stateNode;if(b===null&&f.flags&4){b=ye;var ke=f.memoizedProps;switch(f.type){case"button":case"input":case"select":case"textarea":ke.autoFocus&&b.focus();break;case"img":ke.src&&(b.src=ke.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(f.memoizedState===null){var rt=f.alternate;if(rt!==null){var Nt=rt.memoizedState;if(Nt!==null){var Pt=Nt.dehydrated;Pt!==null&&Kr(Pt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}ha||f.flags&512&&jS(f)}catch(Et){Ns(f,f.return,Et)}}if(f===d){bn=null;break}if(b=f.sibling,b!==null){b.return=f.return,bn=b;break}bn=f.return}}function KO(d){for(;bn!==null;){var f=bn;if(f===d){bn=null;break}var b=f.sibling;if(b!==null){b.return=f.return,bn=b;break}bn=f.return}}function Gy(d){for(;bn!==null;){var f=bn;try{switch(f.tag){case 0:case 11:case 15:var b=f.return;try{TS(4,f)}catch(ke){Ns(f,b,ke)}break;case 1:var S=f.stateNode;if(typeof S.componentDidMount=="function"){var T=f.return;try{S.componentDidMount()}catch(ke){Ns(f,T,ke)}}var A=f.return;try{jS(f)}catch(ke){Ns(f,A,ke)}break;case 5:var ee=f.return;try{jS(f)}catch(ke){Ns(f,ee,ke)}}}catch(ke){Ns(f,f.return,ke)}if(f===d){bn=null;break}var ye=f.sibling;if(ye!==null){ye.return=f.return,bn=ye;break}bn=f.return}}var qO=Math.ceil,PS=H.ReactCurrentDispatcher,Tp=H.ReactCurrentOwner,Oa=H.ReactCurrentBatchConfig,Dr=0,co=null,Ys=null,fa=0,lc=0,zv=Rl(0),No=0,jp=null,Mp=0,Pp=0,Ky=0,Vv=null,Pl=null,bN=0,Bv=1/0,xh=null,Bf=!1,qy=null,Uc=null,AS=!1,Wf=null,Xy=0,Wv=0,Uv=null,Ap=-1,Qy=0;function Ki(){return Dr&6?vn():Ap!==-1?Ap:Ap=vn()}function cc(d){return d.mode&1?Dr&2&&fa!==0?fa&-fa:xp.transition!==null?(Qy===0&&(Qy=nc()),Qy):(d=Cr,d!==0||(d=window.event,d=d===void 0?16:Ln(d.type)),d):1}function uc(d,f,b,S){if(50<Wv)throw Wv=0,Uv=null,Error(n(185));Cl(d,b,S),(!(Dr&2)||d!==co)&&(d===co&&(!(Dr&2)&&(Pp|=b),No===4&&Uf(d,fa)),Ko(d,S),b===1&&Dr===0&&!(f.mode&1)&&(Bv=vn()+500,Ny&&Wa()))}function Ko(d,f){var b=d.callbackNode;wl(d,f);var S=zo(d,d===co?fa:0);if(S===0)b!==null&&ct(b),d.callbackNode=null,d.callbackPriority=0;else if(f=S&-S,d.callbackPriority!==f){if(b!=null&&ct(b),f===1)d.tag===0?BE(tx.bind(null,d)):Mf(tx.bind(null,d)),h6(function(){!(Dr&6)&&Wa()}),b=null;else{switch(no(S)){case 1:b=Bt;break;case 4:b=Tr;break;case 16:b=dr;break;case 536870912:b=In;break;default:b=dr}b=tI(b,XO.bind(null,d))}d.callbackPriority=f,d.callbackNode=b}}function XO(d,f){if(Ap=-1,Qy=0,Dr&6)throw Error(n(327));var b=d.callbackNode;if(Yv()&&d.callbackNode!==b)return null;var S=zo(d,d===co?fa:0);if(S===0)return null;if(S&30||S&d.expiredLanes||f)f=DS(d,S);else{f=S;var T=Dr;Dr|=2;var A=QO();(co!==d||fa!==f)&&(xh=null,Bv=vn()+500,Ip(d,f));do try{b6();break}catch(ye){IS(d,ye)}while(!0);XE(),PS.current=A,Dr=T,Ys!==null?f=0:(co=null,fa=0,f=No)}if(f!==0){if(f===2&&(T=Vo(d),T!==0&&(S=T,f=Zy(d,T))),f===1)throw b=jp,Ip(d,0),Uf(d,S),Ko(d,vn()),b;if(f===6)Uf(d,S);else{if(T=d.current.alternate,!(S&30)&&!ex(T)&&(f=DS(d,S),f===2&&(A=Vo(d),A!==0&&(S=A,f=Zy(d,A))),f===1))throw b=jp,Ip(d,0),Uf(d,S),Ko(d,vn()),b;switch(d.finishedWork=T,d.finishedLanes=S,f){case 0:case 1:throw Error(n(345));case 2:Dp(d,Pl,xh);break;case 3:if(Uf(d,S),(S&130023424)===S&&(f=bN+500-vn(),10<f)){if(zo(d,0)!==0)break;if(T=d.suspendedLanes,(T&S)!==S){Ki(),d.pingedLanes|=d.suspendedLanes&T;break}d.timeoutHandle=KC(Dp.bind(null,d,Pl,xh),f);break}Dp(d,Pl,xh);break;case 4:if(Uf(d,S),(S&4194240)===S)break;for(f=d.eventTimes,T=-1;0<S;){var ee=31-Bi(S);A=1<<ee,ee=f[ee],ee>T&&(T=ee),S&=~A}if(S=T,S=vn()-S,S=(120>S?120:480>S?480:1080>S?1080:1920>S?1920:3e3>S?3e3:4320>S?4320:1960*qO(S/1960))-S,10<S){d.timeoutHandle=KC(Dp.bind(null,d,Pl,xh),S);break}Dp(d,Pl,xh);break;case 5:Dp(d,Pl,xh);break;default:throw Error(n(329))}}}return Ko(d,vn()),d.callbackNode===b?XO.bind(null,d):null}function Zy(d,f){var b=Vv;return d.current.memoizedState.isDehydrated&&(Ip(d,f).flags|=256),d=DS(d,f),d!==2&&(f=Pl,Pl=b,f!==null&&Jy(f)),d}function Jy(d){Pl===null?Pl=d:Pl.push.apply(Pl,d)}function ex(d){for(var f=d;;){if(f.flags&16384){var b=f.updateQueue;if(b!==null&&(b=b.stores,b!==null))for(var S=0;S<b.length;S++){var T=b[S],A=T.getSnapshot;T=T.value;try{if(!Tu(A(),T))return!1}catch{return!1}}}if(b=f.child,f.subtreeFlags&16384&&b!==null)b.return=f,f=b;else{if(f===d)break;for(;f.sibling===null;){if(f.return===null||f.return===d)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function Uf(d,f){for(f&=~Ky,f&=~Pp,d.suspendedLanes|=f,d.pingedLanes&=~f,d=d.expirationTimes;0<f;){var b=31-Bi(f),S=1<<b;d[b]=-1,f&=~S}}function tx(d){if(Dr&6)throw Error(n(327));Yv();var f=zo(d,0);if(!(f&1))return Ko(d,vn()),null;var b=DS(d,f);if(d.tag!==0&&b===2){var S=Vo(d);S!==0&&(f=S,b=Zy(d,S))}if(b===1)throw b=jp,Ip(d,0),Uf(d,f),Ko(d,vn()),b;if(b===6)throw Error(n(345));return d.finishedWork=d.current.alternate,d.finishedLanes=f,Dp(d,Pl,xh),Ko(d,vn()),null}function OS(d,f){var b=Dr;Dr|=1;try{return d(f)}finally{Dr=b,Dr===0&&(Bv=vn()+500,Ny&&Wa())}}function Op(d){Wf!==null&&Wf.tag===0&&!(Dr&6)&&Yv();var f=Dr;Dr|=1;var b=Oa.transition,S=Cr;try{if(Oa.transition=null,Cr=1,d)return d()}finally{Cr=S,Oa.transition=b,Dr=f,!(Dr&6)&&Wa()}}function yN(){lc=zv.current,wi(zv)}function Ip(d,f){d.finishedWork=null,d.finishedLanes=0;var b=d.timeoutHandle;if(b!==-1&&(d.timeoutHandle=-1,SO(b)),Ys!==null)for(b=Ys.return;b!==null;){var S=b;switch(ZC(S),S.tag){case 1:S=S.type.childContextTypes,S!=null&&wd();break;case 3:Av(),wi(oo),wi(is),Ay();break;case 5:rN(S);break;case 4:Av();break;case 13:wi(ss);break;case 19:wi(ss);break;case 10:QE(S.type._context);break;case 22:case 23:yN()}b=b.return}if(co=d,Ys=d=Yf(d.current,null),fa=lc=f,No=0,jp=null,Ky=Pp=Mp=0,Pl=Vv=null,wp!==null){for(f=0;f<wp.length;f++)if(b=wp[f],S=b.interleaved,S!==null){b.interleaved=null;var T=S.next,A=b.pending;if(A!==null){var ee=A.next;A.next=T,S.next=ee}b.pending=S}wp=null}return d}function IS(d,f){do{var b=Ys;try{if(XE(),Pn.current=Si,nS){for(var S=hr.memoizedState;S!==null;){var T=S.queue;T!==null&&(T.pending=null),S=S.next}nS=!1}if(Ur=0,_o=Oi=hr=null,Oy=!1,Iy=0,Tp.current=null,b===null||b.return===null){No=1,jp=f,Ys=null;break}e:{var A=d,ee=b.return,ye=b,ke=f;if(f=fa,ye.flags|=32768,ke!==null&&typeof ke=="object"&&typeof ke.then=="function"){var rt=ke,Nt=ye,Pt=Nt.tag;if(!(Nt.mode&1)&&(Pt===0||Pt===11||Pt===15)){var Et=Nt.alternate;Et?(Nt.updateQueue=Et.updateQueue,Nt.memoizedState=Et.memoizedState,Nt.lanes=Et.lanes):(Nt.updateQueue=null,Nt.memoizedState=null)}var hn=uN(ee);if(hn!==null){hn.flags&=-257,$O(hn,ee,ye,A,f),hn.mode&1&&cN(A,rt,f),f=hn,ke=rt;var xn=f.updateQueue;if(xn===null){var Rn=new Set;Rn.add(ke),f.updateQueue=Rn}else xn.add(ke);break e}else{if(!(f&1)){cN(A,rt,f),xN();break e}ke=Error(n(426))}}else if(es&&ye.mode&1){var Gs=uN(ee);if(Gs!==null){!(Gs.flags&65536)&&(Gs.flags|=256),$O(Gs,ee,ye,A,f),Ty(zf(ke,ye));break e}}A=ke=zf(ke,ye),No!==4&&(No=2),Vv===null?Vv=[A]:Vv.push(A),A=ee;do{switch(A.tag){case 3:A.flags|=65536,f&=-f,A.lanes|=f;var We=zy(A,ke,f);PO(A,We);break e;case 1:ye=ke;var De=A.type,Xe=A.stateNode;if(!(A.flags&128)&&(typeof De.getDerivedStateFromError=="function"||Xe!==null&&typeof Xe.componentDidCatch=="function"&&(Uc===null||!Uc.has(Xe)))){A.flags|=65536,f&=-f,A.lanes|=f;var Ht=LO(A,ye,f);PO(A,Ht);break e}}A=A.return}while(A!==null)}ZO(b)}catch(on){f=on,Ys===b&&b!==null&&(Ys=b=b.return);continue}break}while(!0)}function QO(){var d=PS.current;return PS.current=Si,d===null?Si:d}function xN(){(No===0||No===3||No===2)&&(No=4),co===null||!(Mp&268435455)&&!(Pp&268435455)||Uf(co,fa)}function DS(d,f){var b=Dr;Dr|=2;var S=QO();(co!==d||fa!==f)&&(xh=null,Ip(d,f));do try{v6();break}catch(T){IS(d,T)}while(!0);if(XE(),Dr=b,PS.current=S,Ys!==null)throw Error(n(261));return co=null,fa=0,No}function v6(){for(;Ys!==null;)wN(Ys)}function b6(){for(;Ys!==null&&!xt();)wN(Ys)}function wN(d){var f=SN(d.alternate,d,lc);d.memoizedProps=d.pendingProps,f===null?ZO(d):Ys=f,Tp.current=null}function ZO(d){var f=d;do{var b=f.alternate;if(d=f.return,f.flags&32768){if(b=BO(b,f),b!==null){b.flags&=32767,Ys=b;return}if(d!==null)d.flags|=32768,d.subtreeFlags=0,d.deletions=null;else{No=6,Ys=null;return}}else if(b=mN(b,f,lc),b!==null){Ys=b;return}if(f=f.sibling,f!==null){Ys=f;return}Ys=f=d}while(f!==null);No===0&&(No=5)}function Dp(d,f,b){var S=Cr,T=Oa.transition;try{Oa.transition=null,Cr=1,y6(d,f,b,S)}finally{Oa.transition=T,Cr=S}return null}function y6(d,f,b,S){do Yv();while(Wf!==null);if(Dr&6)throw Error(n(327));b=d.finishedWork;var T=d.finishedLanes;if(b===null)return null;if(d.finishedWork=null,d.finishedLanes=0,b===d.current)throw Error(n(177));d.callbackNode=null,d.callbackPriority=0;var A=b.lanes|b.childLanes;if(Nu(d,A),d===co&&(Ys=co=null,fa=0),!(b.subtreeFlags&2064)&&!(b.flags&2064)||AS||(AS=!0,tI(dr,function(){return Yv(),null})),A=(b.flags&15990)!==0,b.subtreeFlags&15990||A){A=Oa.transition,Oa.transition=null;var ee=Cr;Cr=1;var ye=Dr;Dr|=4,Tp.current=null,g6(d,b),YO(b,d),mO(Ry),Ui=!!pp,Ry=pp=null,d.current=b,Yy(b),Bn(),Dr=ye,Cr=ee,Oa.transition=A}else d.current=b;if(AS&&(AS=!1,Wf=d,Xy=T),A=d.pendingLanes,A===0&&(Uc=null),Vi(b.stateNode),Ko(d,vn()),f!==null)for(S=d.onRecoverableError,b=0;b<f.length;b++)T=f[b],S(T.value,{componentStack:T.stack,digest:T.digest});if(Bf)throw Bf=!1,d=qy,qy=null,d;return Xy&1&&d.tag!==0&&Yv(),A=d.pendingLanes,A&1?d===Uv?Wv++:(Wv=0,Uv=d):Wv=0,Wa(),null}function Yv(){if(Wf!==null){var d=no(Xy),f=Oa.transition,b=Cr;try{if(Oa.transition=null,Cr=16>d?16:d,Wf===null)var S=!1;else{if(d=Wf,Wf=null,Xy=0,Dr&6)throw Error(n(331));var T=Dr;for(Dr|=4,bn=d.current;bn!==null;){var A=bn,ee=A.child;if(bn.flags&16){var ye=A.deletions;if(ye!==null){for(var ke=0;ke<ye.length;ke++){var rt=ye[ke];for(bn=rt;bn!==null;){var Nt=bn;switch(Nt.tag){case 0:case 11:case 15:Fv(8,Nt,A)}var Pt=Nt.child;if(Pt!==null)Pt.return=Nt,bn=Pt;else for(;bn!==null;){Nt=bn;var Et=Nt.sibling,hn=Nt.return;if(WO(Nt),Nt===rt){bn=null;break}if(Et!==null){Et.return=hn,bn=Et;break}bn=hn}}}var xn=A.alternate;if(xn!==null){var Rn=xn.child;if(Rn!==null){xn.child=null;do{var Gs=Rn.sibling;Rn.sibling=null,Rn=Gs}while(Rn!==null)}}bn=A}}if(A.subtreeFlags&2064&&ee!==null)ee.return=A,bn=ee;else e:for(;bn!==null;){if(A=bn,A.flags&2048)switch(A.tag){case 0:case 11:case 15:Fv(9,A,A.return)}var We=A.sibling;if(We!==null){We.return=A.return,bn=We;break e}bn=A.return}}var De=d.current;for(bn=De;bn!==null;){ee=bn;var Xe=ee.child;if(ee.subtreeFlags&2064&&Xe!==null)Xe.return=ee,bn=Xe;else e:for(ee=De;bn!==null;){if(ye=bn,ye.flags&2048)try{switch(ye.tag){case 0:case 11:case 15:TS(9,ye)}}catch(on){Ns(ye,ye.return,on)}if(ye===ee){bn=null;break e}var Ht=ye.sibling;if(Ht!==null){Ht.return=ye.return,bn=Ht;break e}bn=ye.return}}if(Dr=T,Wa(),Fr&&typeof Fr.onPostCommitFiberRoot=="function")try{Fr.onPostCommitFiberRoot(ni,d)}catch{}S=!0}return S}finally{Cr=b,Oa.transition=f}}return!1}function JO(d,f,b){f=zf(b,f),f=zy(d,f,1),d=Hf(d,f,1),f=Ki(),d!==null&&(Cl(d,1,f),Ko(d,f))}function Ns(d,f,b){if(d.tag===3)JO(d,d,b);else for(;f!==null;){if(f.tag===3){JO(f,d,b);break}else if(f.tag===1){var S=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof S.componentDidCatch=="function"&&(Uc===null||!Uc.has(S))){d=zf(b,d),d=LO(f,d,1),f=Hf(f,d,1),d=Ki(),f!==null&&(Cl(f,1,d),Ko(f,d));break}}f=f.return}}function CN(d,f,b){var S=d.pingCache;S!==null&&S.delete(f),f=Ki(),d.pingedLanes|=d.suspendedLanes&b,co===d&&(fa&b)===b&&(No===4||No===3&&(fa&130023424)===fa&&500>vn()-bN?Ip(d,0):Ky|=b),Ko(d,f)}function eI(d,f){f===0&&(d.mode&1?(f=ps,ps<<=1,!(ps&130023424)&&(ps=4194304)):f=1);var b=Ki();d=Sd(d,f),d!==null&&(Cl(d,f,b),Ko(d,b))}function x6(d){var f=d.memoizedState,b=0;f!==null&&(b=f.retryLane),eI(d,b)}function w6(d,f){var b=0;switch(d.tag){case 13:var S=d.stateNode,T=d.memoizedState;T!==null&&(b=T.retryLane);break;case 19:S=d.stateNode;break;default:throw Error(n(314))}S!==null&&S.delete(f),eI(d,b)}var SN;SN=function(d,f,b){if(d!==null)if(d.memoizedProps!==f.pendingProps||oo.current)Go=!0;else{if(!(d.lanes&b)&&!(f.flags&128))return Go=!1,kS(d,f,b);Go=!!(d.flags&131072)}else Go=!1,es&&f.flags&1048576&&_O(f,Of,f.index);switch(f.lanes=0,f.tag){case 2:var S=f.type;Bc(d,f),d=f.pendingProps;var T=sc(f,is.current);Mv(f,b),T=Un(null,f,S,d,T,b);var A=Lf();return f.flags|=1,typeof T=="object"&&T!==null&&typeof T.render=="function"&&T.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,Es(S)?(A=!0,bp(f)):A=!1,f.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,Df(f),T.updater=yS,f.stateNode=T,T._reactInternals=f,aN(f,S,d,b),f=dN(null,f,S,!0,A,b)):(f.tag=0,es&&A&&WE(f),Us(null,f,T,b),f=f.child),f;case 16:S=f.elementType;e:{switch(Bc(d,f),d=f.pendingProps,T=S._init,S=T(S._payload),f.type=S,T=f.tag=S6(S),d=Tl(S,d),T){case 0:f=SS(null,f,S,d,b);break e;case 1:f=m6(null,f,S,d,b);break e;case 11:f=CS(null,f,S,d,b);break e;case 14:f=jl(null,f,S,Tl(S.type,d),b);break e}throw Error(n(306,S,""))}return f;case 0:return S=f.type,T=f.pendingProps,T=f.elementType===S?T:Tl(S,T),SS(d,f,S,T,b);case 1:return S=f.type,T=f.pendingProps,T=f.elementType===S?T:Tl(S,T),m6(d,f,S,T,b);case 3:e:{if(RS(f),d===null)throw Error(n(387));S=f.pendingProps,A=f.memoizedState,T=A.element,MO(d,f),eS(f,S,null,b);var ee=f.memoizedState;if(S=ee.element,A.isDehydrated)if(A={element:S,isDehydrated:!1,cache:ee.cache,pendingSuspenseBoundaries:ee.pendingSuspenseBoundaries,transitions:ee.transitions},f.updateQueue.baseState=A,f.memoizedState=A,f.flags&256){T=zf(Error(n(423)),f),f=Lv(d,f,S,b,T);break e}else if(S!==T){T=zf(Error(n(424)),f),f=Lv(d,f,S,b,T);break e}else for(El=ju(f.stateNode.containerInfo.firstChild),_l=f,es=!0,Pu=null,b=ua(f,null,S,b),f.child=b;b;)b.flags=b.flags&-3|4096,b=b.sibling;else{if(vh(),S===T){f=da(d,f,b);break e}Us(d,f,S,b)}f=f.child}return f;case 5:return nN(f),d===null&&KE(f),S=f.type,T=f.pendingProps,A=d!==null?d.memoizedProps:null,ee=T.children,gp(S,T)?ee=null:A!==null&&gp(S,A)&&(f.flags|=32),Vy(d,f),Us(d,f,ee,b),f.child;case 6:return d===null&&KE(f),null;case 13:return FO(d,f,b);case 4:return tN(f,f.stateNode.containerInfo),S=f.pendingProps,d===null?f.child=Au(f,null,S,b):Us(d,f,S,b),f.child;case 11:return S=f.type,T=f.pendingProps,T=f.elementType===S?T:Tl(S,T),CS(d,f,S,T,b);case 7:return Us(d,f,f.pendingProps,b),f.child;case 8:return Us(d,f,f.pendingProps.children,b),f.child;case 12:return Us(d,f,f.pendingProps.children,b),f.child;case 10:e:{if(S=f.type._context,T=f.pendingProps,A=f.memoizedProps,ee=T.value,Gi(Xt,S._currentValue),S._currentValue=ee,A!==null)if(Tu(A.value,ee)){if(A.children===T.children&&!oo.current){f=da(d,f,b);break e}}else for(A=f.child,A!==null&&(A.return=f);A!==null;){var ye=A.dependencies;if(ye!==null){ee=A.child;for(var ke=ye.firstContext;ke!==null;){if(ke.context===S){if(A.tag===1){ke=bh(-1,b&-b),ke.tag=2;var rt=A.updateQueue;if(rt!==null){rt=rt.shared;var Nt=rt.pending;Nt===null?ke.next=ke:(ke.next=Nt.next,Nt.next=ke),rt.pending=ke}}A.lanes|=b,ke=A.alternate,ke!==null&&(ke.lanes|=b),ZE(A.return,b,f),ye.lanes|=b;break}ke=ke.next}}else if(A.tag===10)ee=A.type===f.type?null:A.child;else if(A.tag===18){if(ee=A.return,ee===null)throw Error(n(341));ee.lanes|=b,ye=ee.alternate,ye!==null&&(ye.lanes|=b),ZE(ee,b,f),ee=A.sibling}else ee=A.child;if(ee!==null)ee.return=A;else for(ee=A;ee!==null;){if(ee===f){ee=null;break}if(A=ee.sibling,A!==null){A.return=ee.return,ee=A;break}ee=ee.return}A=ee}Us(d,f,T.children,b),f=f.child}return f;case 9:return T=f.type,S=f.pendingProps.children,Mv(f,b),T=Ci(T),S=S(T),f.flags|=1,Us(d,f,S,b),f.child;case 14:return S=f.type,T=Tl(S,f.pendingProps),T=Tl(S.type,T),jl(d,f,S,T,b);case 15:return Np(d,f,f.type,f.pendingProps,b);case 17:return S=f.type,T=f.pendingProps,T=f.elementType===S?T:Tl(S,T),Bc(d,f),f.tag=1,Es(S)?(d=!0,bp(f)):d=!1,Mv(f,b),HO(f,S,T),aN(f,S,T,b),dN(null,f,S,!0,d,b);case 19:return Ml(d,f,b);case 22:return br(d,f,b)}throw Error(n(156,f.tag))};function tI(d,f){return ge(d,f)}function C6(d,f,b,S){this.tag=d,this.key=b,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=S,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yc(d,f,b,S){return new C6(d,f,b,S)}function RN(d){return d=d.prototype,!(!d||!d.isReactComponent)}function S6(d){if(typeof d=="function")return RN(d)?1:0;if(d!=null){if(d=d.$$typeof,d===pe)return 11;if(d===nt)return 14}return 2}function Yf(d,f){var b=d.alternate;return b===null?(b=Yc(d.tag,f,d.key,d.mode),b.elementType=d.elementType,b.type=d.type,b.stateNode=d.stateNode,b.alternate=d,d.alternate=b):(b.pendingProps=f,b.type=d.type,b.flags=0,b.subtreeFlags=0,b.deletions=null),b.flags=d.flags&14680064,b.childLanes=d.childLanes,b.lanes=d.lanes,b.child=d.child,b.memoizedProps=d.memoizedProps,b.memoizedState=d.memoizedState,b.updateQueue=d.updateQueue,f=d.dependencies,b.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},b.sibling=d.sibling,b.index=d.index,b.ref=d.ref,b}function HS(d,f,b,S,T,A){var ee=2;if(S=d,typeof d=="function")RN(d)&&(ee=1);else if(typeof d=="string")ee=5;else e:switch(d){case B:return Gf(b.children,T,A,f);case te:ee=8,T|=8;break;case ve:return d=Yc(12,b,f,T|2),d.elementType=ve,d.lanes=A,d;case Le:return d=Yc(13,b,f,T),d.elementType=Le,d.lanes=A,d;case Fe:return d=Yc(19,b,f,T),d.elementType=Fe,d.lanes=A,d;case $e:return Gv(b,T,A,f);default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case ce:ee=10;break e;case _e:ee=9;break e;case pe:ee=11;break e;case nt:ee=14;break e;case dt:ee=16,S=null;break e}throw Error(n(130,d==null?d:typeof d,""))}return f=Yc(ee,b,f,T),f.elementType=d,f.type=S,f.lanes=A,f}function Gf(d,f,b,S){return d=Yc(7,d,S,f),d.lanes=b,d}function Gv(d,f,b,S){return d=Yc(22,d,S,f),d.elementType=$e,d.lanes=b,d.stateNode={isHidden:!1},d}function Hp(d,f,b){return d=Yc(6,d,null,f),d.lanes=b,d}function _N(d,f,b){return f=Yc(4,d.children!==null?d.children:[],d.key,f),f.lanes=b,f.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},f}function nI(d,f,b,S,T){this.tag=f,this.containerInfo=d,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Eu(0),this.expirationTimes=Eu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Eu(0),this.identifierPrefix=S,this.onRecoverableError=T,this.mutableSourceEagerHydrationData=null}function LS(d,f,b,S,T,A,ee,ye,ke){return d=new nI(d,f,b,ye,ke),f===1?(f=1,A===!0&&(f|=8)):f=0,A=Yc(3,null,null,f),d.current=A,A.stateNode=d,A.memoizedState={element:S,isDehydrated:b,cache:null,transitions:null,pendingSuspenseBoundaries:null},Df(A),d}function rI(d,f,b){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:F,key:S==null?null:""+S,children:d,containerInfo:f,implementation:b}}function iI(d){if(!d)return _r;d=d._reactInternals;e:{if(vt(d)!==d||d.tag!==1)throw Error(n(170));var f=d;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(Es(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(n(171))}if(d.tag===1){var b=d.type;if(Es(b))return RO(d,b,f)}return f}function EN(d,f,b,S,T,A,ee,ye,ke){return d=LS(b,S,!0,d,T,A,ee,ye,ke),d.context=iI(null),b=d.current,S=Ki(),T=cc(b),A=bh(S,T),A.callback=f??null,Hf(b,A,T),d.current.lanes=T,Cl(d,T,S),Ko(d,S),d}function $S(d,f,b,S){var T=f.current,A=Ki(),ee=cc(T);return b=iI(b),f.context===null?f.context=b:f.pendingContext=b,f=bh(A,ee),f.payload={element:d},S=S===void 0?null:S,S!==null&&(f.callback=S),d=Hf(T,f,ee),d!==null&&(uc(d,T,ee,A),JC(d,T,ee)),ee}function FS(d){if(d=d.current,!d.child)return null;switch(d.child.tag){case 5:return d.child.stateNode;default:return d.child.stateNode}}function sI(d,f){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var b=d.retryLane;d.retryLane=b!==0&&b<f?b:f}}function zS(d,f){sI(d,f),(d=d.alternate)&&sI(d,f)}function oI(){return null}var NN=typeof reportError=="function"?reportError:function(d){console.error(d)};function Kf(d){this._internalRoot=d}VS.prototype.render=Kf.prototype.render=function(d){var f=this._internalRoot;if(f===null)throw Error(n(409));$S(d,f,null,null)},VS.prototype.unmount=Kf.prototype.unmount=function(){var d=this._internalRoot;if(d!==null){this._internalRoot=null;var f=d.containerInfo;Op(function(){$S(null,d,null,null)}),f[ph]=null}};function VS(d){this._internalRoot=d}VS.prototype.unstable_scheduleHydration=function(d){if(d){var f=io();d={blockedOn:null,target:d,priority:f};for(var b=0;b<Ss.length&&f!==0&&f<Ss[b].priority;b++);Ss.splice(b,0,d),b===0&&Ut(d)}};function kN(d){return!(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)}function BS(d){return!(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11&&(d.nodeType!==8||d.nodeValue!==" react-mount-point-unstable "))}function aI(){}function R6(d,f,b,S,T){if(T){if(typeof S=="function"){var A=S;S=function(){var rt=FS(ee);A.call(rt)}}var ee=EN(f,S,d,0,null,!1,!1,"",aI);return d._reactRootContainer=ee,d[ph]=ee.current,Cy(d.nodeType===8?d.parentNode:d),Op(),ee}for(;T=d.lastChild;)d.removeChild(T);if(typeof S=="function"){var ye=S;S=function(){var rt=FS(ke);ye.call(rt)}}var ke=LS(d,0,!1,null,null,!1,!1,"",aI);return d._reactRootContainer=ke,d[ph]=ke.current,Cy(d.nodeType===8?d.parentNode:d),Op(function(){$S(f,ke,b,S)}),ke}function WS(d,f,b,S,T){var A=b._reactRootContainer;if(A){var ee=A;if(typeof T=="function"){var ye=T;T=function(){var ke=FS(ee);ye.call(ke)}}$S(f,ee,d,T)}else ee=R6(b,f,d,T,S);return FS(ee)}Bo=function(d){switch(d.tag){case 3:var f=d.stateNode;if(f.current.memoizedState.isDehydrated){var b=gs(f.pendingLanes);b!==0&&(rc(f,b|1),Ko(f,vn()),!(Dr&6)&&(Bv=vn()+500,Wa()))}break;case 13:Op(function(){var S=Sd(d,1);if(S!==null){var T=Ki();uc(S,d,1,T)}}),zS(d,1)}},sr=function(d){if(d.tag===13){var f=Sd(d,134217728);if(f!==null){var b=Ki();uc(f,d,134217728,b)}zS(d,134217728)}},ro=function(d){if(d.tag===13){var f=cc(d),b=Sd(d,f);if(b!==null){var S=Ki();uc(b,d,f,S)}zS(d,f)}},io=function(){return Cr},_n=function(d,f){var b=Cr;try{return Cr=d,f()}finally{Cr=b}},kt=function(d,f,b){switch(f){case"input":if(U(d,b),f=b.name,b.type==="radio"&&f!=null){for(b=d;b.parentNode;)b=b.parentNode;for(b=b.querySelectorAll("input[name="+JSON.stringify(""+f)+'][type="radio"]'),f=0;f<b.length;f++){var S=b[f];if(S!==d&&S.form===d.form){var T=gh(S);if(!T)throw Error(n(90));O(S),U(S,T)}}}break;case"textarea":lt(d,b);break;case"select":f=b.value,f!=null&&Me(d,!!b.multiple,f,!1)}},Qt=OS,Gt=Op;var lI={usingClientEntryPoint:!1,Events:[Ey,Mn,gh,An,Jn,OS]},nx={findFiberByHostInstance:vp,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},_6={bundleType:nx.bundleType,version:nx.version,rendererPackageName:nx.rendererPackageName,rendererConfig:nx.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:H.ReactCurrentDispatcher,findHostInstanceByFiber:function(d){return d=Ft(d),d===null?null:d.stateNode},findFiberByHostInstance:nx.findFiberByHostInstance||oI,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rx=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rx.isDisabled&&rx.supportsFiber)try{ni=rx.inject(_6),Fr=rx}catch{}}return gc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lI,gc.createPortal=function(d,f){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!kN(f))throw Error(n(200));return rI(d,f,null,b)},gc.createRoot=function(d,f){if(!kN(d))throw Error(n(299));var b=!1,S="",T=NN;return f!=null&&(f.unstable_strictMode===!0&&(b=!0),f.identifierPrefix!==void 0&&(S=f.identifierPrefix),f.onRecoverableError!==void 0&&(T=f.onRecoverableError)),f=LS(d,1,!1,null,null,b,!1,S,T),d[ph]=f.current,Cy(d.nodeType===8?d.parentNode:d),new Kf(f)},gc.findDOMNode=function(d){if(d==null)return null;if(d.nodeType===1)return d;var f=d._reactInternals;if(f===void 0)throw typeof d.render=="function"?Error(n(188)):(d=Object.keys(d).join(","),Error(n(268,d)));return d=Ft(f),d=d===null?null:d.stateNode,d},gc.flushSync=function(d){return Op(d)},gc.hydrate=function(d,f,b){if(!BS(f))throw Error(n(200));return WS(null,d,f,!0,b)},gc.hydrateRoot=function(d,f,b){if(!kN(d))throw Error(n(405));var S=b!=null&&b.hydratedSources||null,T=!1,A="",ee=NN;if(b!=null&&(b.unstable_strictMode===!0&&(T=!0),b.identifierPrefix!==void 0&&(A=b.identifierPrefix),b.onRecoverableError!==void 0&&(ee=b.onRecoverableError)),f=EN(f,null,d,1,b??null,T,!1,A,ee),d[ph]=f.current,Cy(d),S)for(d=0;d<S.length;d++)b=S[d],T=b._getVersion,T=T(b._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[b,T]:f.mutableSourceEagerHydrationData.push(b,T);return new VS(f)},gc.render=function(d,f,b){if(!BS(f))throw Error(n(200));return WS(null,d,f,!1,b)},gc.unmountComponentAtNode=function(d){if(!BS(d))throw Error(n(40));return d._reactRootContainer?(Op(function(){WS(null,null,d,!1,function(){d._reactRootContainer=null,d[ph]=null})}),!0):!1},gc.unstable_batchedUpdates=OS,gc.unstable_renderSubtreeIntoContainer=function(d,f,b,S){if(!BS(b))throw Error(n(200));if(d==null||d._reactInternals===void 0)throw Error(n(38));return WS(d,f,b,!1,S)},gc.version="18.3.1-next-f1338f8080-20240426",gc}var vc={},EU;function hae(){if(EU)return vc;EU=1;var t={};/** * @license React * react-dom.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */return t.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=W,n=RU(),r=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,i=!1;function s(l){i=l}function a(l){if(!i){for(var c=arguments.length,p=new Array(c>1?c-1:0),v=1;v<c;v++)p[v-1]=arguments[v];h("warn",l,p)}}function u(l){if(!i){for(var c=arguments.length,p=new Array(c>1?c-1:0),v=1;v<c;v++)p[v-1]=arguments[v];h("error",l,p)}}function h(l,c,p){{var v=r.ReactDebugCurrentFrame,w=v.getStackAddendum();w!==""&&(c+="%s",p=p.concat([w]));var R=p.map(function(P){return String(P)});R.unshift("Warning: "+c),Function.prototype.apply.call(console[l],console,R)}}var m=0,g=1,y=2,x=3,C=4,E=5,M=6,j=7,L=8,D=9,z=10,H=11,V=12,F=13,B=14,te=15,ve=16,ce=17,_e=18,pe=19,Le=21,Fe=22,nt=23,dt=24,$e=25,Re=!0,Ze=!1,Ee=!1,Q=!1,fe=!1,Ve=!0,ne=!0,xe=!0,Ke=!0,qe=new Set,we={},k={};function _(l,c){N(l,c),N(l+"Capture",c)}function N(l,c){we[l]&&u("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",l),we[l]=c;{var p=l.toLowerCase();k[p]=l,l==="onDoubleClick"&&(k.ondblclick=l)}for(var v=0;v<c.length;v++)qe.add(c[v])}var O=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",G=Object.prototype.hasOwnProperty;function q(l){{var c=typeof Symbol=="function"&&Symbol.toStringTag,p=c&&l[Symbol.toStringTag]||l.constructor.name||"Object";return p}}function I(l){try{return Z(l),!1}catch{return!0}}function Z(l){return""+l}function U(l,c){if(I(l))return u("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.",c,q(l)),Z(l)}function re(l){if(I(l))return u("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",q(l)),Z(l)}function ae(l,c){if(I(l))return u("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.",c,q(l)),Z(l)}function he(l,c){if(I(l))return u("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.",c,q(l)),Z(l)}function Me(l){if(I(l))return u("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.",q(l)),Z(l)}function tt(l){if(I(l))return u("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.",q(l)),Z(l)}var ot=0,lt=1,X=2,de=3,Ce=4,Oe=5,Ge=6,Qe=":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",se=Qe+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",ie=new RegExp("^["+Qe+"]["+se+"]*$"),J={},me={};function Se(l){return G.call(me,l)?!0:G.call(J,l)?!1:ie.test(l)?(me[l]=!0,!0):(J[l]=!0,u("Invalid attribute name: `%s`",l),!1)}function je(l,c,p){return c!==null?c.type===ot:p?!1:l.length>2&&(l[0]==="o"||l[0]==="O")&&(l[1]==="n"||l[1]==="N")}function Pe(l,c,p,v){if(p!==null&&p.type===ot)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":{if(v)return!1;if(p!==null)return!p.acceptsBooleans;var w=l.toLowerCase().slice(0,5);return w!=="data-"&&w!=="aria-"}default:return!1}}function ut(l,c,p,v){if(c===null||typeof c>"u"||Pe(l,c,p,v))return!0;if(v)return!1;if(p!==null)switch(p.type){case de:return!c;case Ce:return c===!1;case Oe:return isNaN(c);case Ge:return isNaN(c)||c<1}return!1}function wt(l){return Rt.hasOwnProperty(l)?Rt[l]:null}function kt(l,c,p,v,w,R,P){this.acceptsBooleans=c===X||c===de||c===Ce,this.attributeName=v,this.attributeNamespace=w,this.mustUseProperty=p,this.propertyName=l,this.type=c,this.sanitizeURL=R,this.removeEmptyString=P}var Rt={},sn=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];sn.forEach(function(l){Rt[l]=new kt(l,ot,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var c=l[0],p=l[1];Rt[c]=new kt(c,lt,!1,p,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){Rt[l]=new kt(l,X,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){Rt[l]=new kt(l,X,!1,l,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(l){Rt[l]=new kt(l,de,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){Rt[l]=new kt(l,de,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){Rt[l]=new kt(l,Ce,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){Rt[l]=new kt(l,Ge,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){Rt[l]=new kt(l,Oe,!1,l.toLowerCase(),null,!1,!1)});var jn=/[\-\:]([a-z])/g,An=function(l){return l[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(l){var c=l.replace(jn,An);Rt[c]=new kt(c,lt,!1,l,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(l){var c=l.replace(jn,An);Rt[c]=new kt(c,lt,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var c=l.replace(jn,An);Rt[c]=new kt(c,lt,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){Rt[l]=new kt(l,lt,!1,l.toLowerCase(),null,!1,!1)});var Jn="xlinkHref";Rt[Jn]=new kt("xlinkHref",lt,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){Rt[l]=new kt(l,lt,!1,l.toLowerCase(),null,!0,!0)});var Qt=/^[\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,Gt=!1;function ir(l){!Gt&&Qt.test(l)&&(Gt=!0,u("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.",JSON.stringify(l)))}function kn(l,c,p,v){if(v.mustUseProperty){var w=v.propertyName;return l[w]}else{U(p,c),v.sanitizeURL&&ir(""+p);var R=v.attributeName,P=null;if(v.type===Ce){if(l.hasAttribute(R)){var $=l.getAttribute(R);return $===""?!0:ut(c,p,v,!1)?$:$===""+p?p:$}}else if(l.hasAttribute(R)){if(ut(c,p,v,!1))return l.getAttribute(R);if(v.type===de)return p;P=l.getAttribute(R)}return ut(c,p,v,!1)?P===null?p:P:P===""+p?p:P}}function Kt(l,c,p,v){{if(!Se(c))return;if(!l.hasAttribute(c))return p===void 0?void 0:null;var w=l.getAttribute(c);return U(p,c),w===""+p?p:w}}function zt(l,c,p,v){var w=wt(c);if(!je(c,w,v)){if(ut(c,p,w,v)&&(p=null),v||w===null){if(Se(c)){var R=c;p===null?l.removeAttribute(R):(U(p,c),l.setAttribute(R,""+p))}return}var P=w.mustUseProperty;if(P){var $=w.propertyName;if(p===null){var Y=w.type;l[$]=Y===de?!1:""}else l[$]=p;return}var le=w.attributeName,ue=w.attributeNamespace;if(p===null)l.removeAttribute(le);else{var He=w.type,Ie;He===de||He===Ce&&p===!0?Ie="":(U(p,le),Ie=""+p,w.sanitizeURL&&ir(Ie.toString())),ue?l.setAttributeNS(ue,le,Ie):l.setAttribute(le,Ie)}}}var Wt=Symbol.for("react.element"),en=Symbol.for("react.portal"),tn=Symbol.for("react.fragment"),mn=Symbol.for("react.strict_mode"),dn=Symbol.for("react.profiler"),Ne=Symbol.for("react.provider"),oe=Symbol.for("react.context"),Ae=Symbol.for("react.forward_ref"),Je=Symbol.for("react.suspense"),vt=Symbol.for("react.suspense_list"),Vt=Symbol.for("react.memo"),$t=Symbol.for("react.lazy"),jt=Symbol.for("react.scope"),Ft=Symbol.for("react.debug_trace_mode"),Ct=Symbol.for("react.offscreen"),ge=Symbol.for("react.legacy_hidden"),ct=Symbol.for("react.cache"),xt=Symbol.for("react.tracing_marker"),Bn=Symbol.iterator,vn="@@iterator";function Sn(l){if(l===null||typeof l!="object")return null;var c=Bn&&l[Bn]||l[vn];return typeof c=="function"?c:null}var Bt=Object.assign,Tr=0,dr,Sr,In,ni,Fr,Vi,Bi;function Lo(){}Lo.__reactDisabledLog=!0;function aa(){{if(Tr===0){dr=console.log,Sr=console.info,In=console.warn,ni=console.error,Fr=console.group,Vi=console.groupCollapsed,Bi=console.groupEnd;var l={configurable:!0,enumerable:!0,value:Lo,writable:!0};Object.defineProperties(console,{info:l,log:l,warn:l,error:l,group:l,groupCollapsed:l,groupEnd:l})}Tr++}}function $o(){{if(Tr--,Tr===0){var l={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Bt({},l,{value:dr}),info:Bt({},l,{value:Sr}),warn:Bt({},l,{value:In}),error:Bt({},l,{value:ni}),group:Bt({},l,{value:Fr}),groupCollapsed:Bt({},l,{value:Vi}),groupEnd:Bt({},l,{value:Bi})})}Tr<0&&u("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Fo=r.ReactCurrentDispatcher,ps;function gs(l,c,p){{if(ps===void 0)try{throw Error()}catch(w){var v=w.stack.trim().match(/\n( *(at )?)/);ps=v&&v[1]||""}return` `+ps+l}}var zo=!1,xl;{var wl=typeof WeakMap=="function"?WeakMap:Map;xl=new wl}function Vo(l,c){if(!l||zo)return"";{var p=xl.get(l);if(p!==void 0)return p}var v;zo=!0;var w=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var R;R=Fo.current,Fo.current=null,aa();try{if(c){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(it){v=it}Reflect.construct(l,[],P)}else{try{P.call()}catch(it){v=it}l.call(P.prototype)}}else{try{throw Error()}catch(it){v=it}l()}}catch(it){if(it&&v&&typeof it.stack=="string"){for(var $=it.stack.split(` `),Y=v.stack.split(` `),le=$.length-1,ue=Y.length-1;le>=1&&ue>=0&&$[le]!==Y[ue];)ue--;for(;le>=1&&ue>=0;le--,ue--)if($[le]!==Y[ue]){if(le!==1||ue!==1)do if(le--,ue--,ue<0||$[le]!==Y[ue]){var He=` `+$[le].replace(" at new "," at ");return l.displayName&&He.includes("<anonymous>")&&(He=He.replace("<anonymous>",l.displayName)),typeof l=="function"&&xl.set(l,He),He}while(le>=1&&ue>=0);break}}}finally{zo=!1,Fo.current=R,$o(),Error.prepareStackTrace=w}var Ie=l?l.displayName||l.name:"",et=Ie?gs(Ie):"";return typeof l=="function"&&xl.set(l,et),et}function nc(l,c,p){return Vo(l,!0)}function Eu(l,c,p){return Vo(l,!1)}function Cl(l){var c=l.prototype;return!!(c&&c.isReactComponent)}function Nu(l,c,p){if(l==null)return"";if(typeof l=="function")return Vo(l,Cl(l));if(typeof l=="string")return gs(l);switch(l){case Je:return gs("Suspense");case vt:return gs("SuspenseList")}if(typeof l=="object")switch(l.$$typeof){case Ae:return Eu(l.render);case Vt:return Nu(l.type,c,p);case $t:{var v=l,w=v._payload,R=v._init;try{return Nu(R(w),c,p)}catch{}}}return""}function rc(l){switch(l._debugOwner&&l._debugOwner.type,l._debugSource,l.tag){case E:return gs(l.type);case ve:return gs("Lazy");case F:return gs("Suspense");case pe:return gs("SuspenseList");case m:case y:case te:return Eu(l.type);case H:return Eu(l.type.render);case g:return nc(l.type);default:return""}}function Cr(l){try{var c="",p=l;do c+=rc(p),p=p.return;while(p);return c}catch(v){return` Error generating stack: `+v.message+` `+v.stack}}function no(l,c,p){var v=l.displayName;if(v)return v;var w=c.displayName||c.name||"";return w!==""?p+"("+w+")":p}function Bo(l){return l.displayName||"Context"}function sr(l){if(l==null)return null;if(typeof l.tag=="number"&&u("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case tn:return"Fragment";case en:return"Portal";case dn:return"Profiler";case mn:return"StrictMode";case Je:return"Suspense";case vt:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case oe:var c=l;return Bo(c)+".Consumer";case Ne:var p=l;return Bo(p._context)+".Provider";case Ae:return no(l,l.render,"ForwardRef");case Vt:var v=l.displayName||null;return v!==null?v:sr(l.type)||"Memo";case $t:{var w=l,R=w._payload,P=w._init;try{return sr(P(R))}catch{return null}}}return null}function ro(l,c,p){var v=c.displayName||c.name||"";return l.displayName||(v!==""?p+"("+v+")":p)}function io(l){return l.displayName||"Context"}function _n(l){var c=l.tag,p=l.type;switch(c){case dt:return"Cache";case D:var v=p;return io(v)+".Consumer";case z:var w=p;return io(w._context)+".Provider";case _e:return"DehydratedFragment";case H:return ro(p,p.render,"ForwardRef");case j:return"Fragment";case E:return p;case C:return"Portal";case x:return"Root";case M:return"Text";case ve:return sr(p);case L:return p===mn?"StrictMode":"Mode";case Fe:return"Offscreen";case V:return"Profiler";case Le:return"Scope";case F:return"Suspense";case pe:return"SuspenseList";case $e:return"TracingMarker";case g:case m:case ce:case y:case B:case te:if(typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p;break}return null}var ic=r.ReactDebugCurrentFrame,pi=null,Fs=!1;function zs(){{if(pi===null)return null;var l=pi._debugOwner;if(l!==null&&typeof l<"u")return _n(l)}return null}function la(){return pi===null?"":Cr(pi)}function ji(){ic.getCurrentStack=null,pi=null,Fs=!1}function Or(l){ic.getCurrentStack=l===null?null:la,pi=l,Fs=!1}function Ss(){return pi}function Rs(l){Fs=l}function Wn(l){return""+l}function Wi(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return tt(l),l;default:return""}}var dh={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0};function Ut(l,c){dh[c.type]||c.onChange||c.onInput||c.readOnly||c.disabled||c.value==null||u("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."),c.onChange||c.readOnly||c.disabled||c.checked==null||u("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}function lr(l){var c=l.type,p=l.nodeName;return p&&p.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Zn(l){return l._valueTracker}function Gn(l){l._valueTracker=null}function Mi(l){var c="";return l&&(lr(l)?c=l.checked?"true":"false":c=l.value),c}function Kr(l){var c=lr(l)?"checked":"value",p=Object.getOwnPropertyDescriptor(l.constructor.prototype,c);tt(l[c]);var v=""+l[c];if(!(l.hasOwnProperty(c)||typeof p>"u"||typeof p.get!="function"||typeof p.set!="function")){var w=p.get,R=p.set;Object.defineProperty(l,c,{configurable:!0,get:function(){return w.call(this)},set:function($){tt($),v=""+$,R.call(this,$)}}),Object.defineProperty(l,c,{enumerable:p.enumerable});var P={getValue:function(){return v},setValue:function($){tt($),v=""+$},stopTracking:function(){Gn(l),delete l[c]}};return P}}function Rr(l){Zn(l)||(l._valueTracker=Kr(l))}function Ui(l){if(!l)return!1;var c=Zn(l);if(!c)return!0;var p=c.getValue(),v=Mi(l);return v!==p?(c.setValue(v),!0):!1}function Ji(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var Wo=!1,Ro=!1,Vs=!1,St=!1;function Ln(l){var c=l.type==="checkbox"||l.type==="radio";return c?l.checked!=null:l.value!=null}function pr(l,c){var p=l,v=c.checked,w=Bt({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:v??p._wrapperState.initialChecked});return w}function vs(l,c){Ut("input",c),c.checked!==void 0&&c.defaultChecked!==void 0&&!Ro&&(u("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components",zs()||"A component",c.type),Ro=!0),c.value!==void 0&&c.defaultValue!==void 0&&!Wo&&(u("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components",zs()||"A component",c.type),Wo=!0);var p=l,v=c.defaultValue==null?"":c.defaultValue;p._wrapperState={initialChecked:c.checked!=null?c.checked:c.defaultChecked,initialValue:Wi(c.value!=null?c.value:v),controlled:Ln(c)}}function K(l,c){var p=l,v=c.checked;v!=null&&zt(p,"checked",v,!1)}function be(l,c){var p=l;{var v=Ln(c);!p._wrapperState.controlled&&v&&!St&&(u("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"),St=!0),p._wrapperState.controlled&&!v&&!Vs&&(u("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"),Vs=!0)}K(l,c);var w=Wi(c.value),R=c.type;if(w!=null)R==="number"?(w===0&&p.value===""||p.value!=w)&&(p.value=Wn(w)):p.value!==Wn(w)&&(p.value=Wn(w));else if(R==="submit"||R==="reset"){p.removeAttribute("value");return}c.hasOwnProperty("value")?It(p,c.type,w):c.hasOwnProperty("defaultValue")&&It(p,c.type,Wi(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(p.defaultChecked=!!c.defaultChecked)}function Be(l,c,p){var v=l;if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var w=c.type,R=w==="submit"||w==="reset";if(R&&(c.value===void 0||c.value===null))return;var P=Wn(v._wrapperState.initialValue);p||P!==v.value&&(v.value=P),v.defaultValue=P}var $=v.name;$!==""&&(v.name=""),v.defaultChecked=!v.defaultChecked,v.defaultChecked=!!v._wrapperState.initialChecked,$!==""&&(v.name=$)}function at(l,c){var p=l;be(p,c),Ot(p,c)}function Ot(l,c){var p=c.name;if(c.type==="radio"&&p!=null){for(var v=l;v.parentNode;)v=v.parentNode;U(p,"name");for(var w=v.querySelectorAll("input[name="+JSON.stringify(""+p)+'][type="radio"]'),R=0;R<w.length;R++){var P=w[R];if(!(P===l||P.form!==l.form)){var $=_I(P);if(!$)throw new Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");Ui(P),be(P,$)}}}}function It(l,c,p){(c!=="number"||Ji(l.ownerDocument)!==l)&&(p==null?l.defaultValue=Wn(l._wrapperState.initialValue):l.defaultValue!==Wn(p)&&(l.defaultValue=Wn(p)))}var qt=!1,Vn=!1,gr=!1;function si(l,c){c.value==null&&(typeof c.children=="object"&&c.children!==null?e.Children.forEach(c.children,function(p){p!=null&&(typeof p=="string"||typeof p=="number"||Vn||(Vn=!0,u("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.")))}):c.dangerouslySetInnerHTML!=null&&(gr||(gr=!0,u("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.")))),c.selected!=null&&!qt&&(u("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."),qt=!0)}function Pi(l,c){c.value!=null&&l.setAttribute("value",Wn(Wi(c.value)))}var Ai=Array.isArray;function vr(l){return Ai(l)}var Yi;Yi=!1;function Bs(){var l=zs();return l?` Check the render method of \``+l+"`.":""}var dp=["value","defaultValue"];function dy(l){{Ut("select",l);for(var c=0;c<dp.length;c++){var p=dp[c];if(l[p]!=null){var v=vr(l[p]);l.multiple&&!v?u("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s",p,Bs()):!l.multiple&&v&&u("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s",p,Bs())}}}}function hh(l,c,p,v){var w=l.options;if(c){for(var R=p,P={},$=0;$<R.length;$++)P["$"+R[$]]=!0;for(var Y=0;Y<w.length;Y++){var le=P.hasOwnProperty("$"+w[Y].value);w[Y].selected!==le&&(w[Y].selected=le),le&&v&&(w[Y].defaultSelected=!0)}}else{for(var ue=Wn(Wi(p)),He=null,Ie=0;Ie<w.length;Ie++){if(w[Ie].value===ue){w[Ie].selected=!0,v&&(w[Ie].defaultSelected=!0);return}He===null&&!w[Ie].disabled&&(He=w[Ie])}He!==null&&(He.selected=!0)}}function hp(l,c){return Bt({},c,{value:void 0})}function hy(l,c){var p=l;dy(c),p._wrapperState={wasMultiple:!!c.multiple},c.value!==void 0&&c.defaultValue!==void 0&&!Yi&&(u("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components"),Yi=!0)}function kE(l,c){var p=l;p.multiple=!!c.multiple;var v=c.value;v!=null?hh(p,!!c.multiple,v,!1):c.defaultValue!=null&&hh(p,!!c.multiple,c.defaultValue,!0)}function DC(l,c){var p=l,v=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!c.multiple;var w=c.value;w!=null?hh(p,!!c.multiple,w,!1):v!==!!c.multiple&&(c.defaultValue!=null?hh(p,!!c.multiple,c.defaultValue,!0):hh(p,!!c.multiple,c.multiple?[]:"",!1))}function TE(l,c){var p=l,v=c.value;v!=null&&hh(p,!!c.multiple,v,!1)}var KA=!1;function HC(l,c){var p=l;if(c.dangerouslySetInnerHTML!=null)throw new Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");var v=Bt({},c,{value:void 0,defaultValue:void 0,children:Wn(p._wrapperState.initialValue)});return v}function qA(l,c){var p=l;Ut("textarea",c),c.value!==void 0&&c.defaultValue!==void 0&&!KA&&(u("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components",zs()||"A component"),KA=!0);var v=c.value;if(v==null){var w=c.children,R=c.defaultValue;if(w!=null){u("Use the `defaultValue` or `value` props instead of setting children on <textarea>.");{if(R!=null)throw new Error("If you supply `defaultValue` on a <textarea>, do not pass children.");if(vr(w)){if(w.length>1)throw new Error("<textarea> can only have at most one child.");w=w[0]}R=w}}R==null&&(R=""),v=R}p._wrapperState={initialValue:Wi(v)}}function XA(l,c){var p=l,v=Wi(c.value),w=Wi(c.defaultValue);if(v!=null){var R=Wn(v);R!==p.value&&(p.value=R),c.defaultValue==null&&p.defaultValue!==R&&(p.defaultValue=R)}w!=null&&(p.defaultValue=Wn(w))}function QA(l,c){var p=l,v=p.textContent;v===p._wrapperState.initialValue&&v!==""&&v!==null&&(p.value=v)}function e6(l,c){XA(l,c)}var ku="http://www.w3.org/1999/xhtml",t6="http://www.w3.org/1998/Math/MathML",jE="http://www.w3.org/2000/svg";function ME(l){switch(l){case"svg":return jE;case"math":return t6;default:return ku}}function LC(l,c){return l==null||l===ku?ME(c):l===jE&&c==="foreignObject"?ku:l}var n6=function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,p,v,w){MSApp.execUnsafeLocalFunction(function(){return l(c,p,v,w)})}:l},$C,ZA=n6(function(l,c){if(l.namespaceURI===jE&&!("innerHTML"in l)){$C=$C||document.createElement("div"),$C.innerHTML="<svg>"+c.valueOf().toString()+"</svg>";for(var p=$C.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;p.firstChild;)l.appendChild(p.firstChild);return}l.innerHTML=c}),Sl=1,fh=3,so=8,mh=9,fy=11,kf=function(l,c){if(c){var p=l.firstChild;if(p&&p===l.lastChild&&p.nodeType===fh){p.nodeValue=c;return}}l.textContent=c},r6={animation:["animationDelay","animationDirection","animationDuration","animationFillMode","animationIterationCount","animationName","animationPlayState","animationTimingFunction"],background:["backgroundAttachment","backgroundClip","backgroundColor","backgroundImage","backgroundOrigin","backgroundPositionX","backgroundPositionY","backgroundRepeat","backgroundSize"],backgroundPosition:["backgroundPositionX","backgroundPositionY"],border:["borderBottomColor","borderBottomStyle","borderBottomWidth","borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRightColor","borderRightStyle","borderRightWidth","borderTopColor","borderTopStyle","borderTopWidth"],borderBlockEnd:["borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth"],borderBlockStart:["borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth"],borderBottom:["borderBottomColor","borderBottomStyle","borderBottomWidth"],borderColor:["borderBottomColor","borderLeftColor","borderRightColor","borderTopColor"],borderImage:["borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth"],borderInlineEnd:["borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth"],borderInlineStart:["borderInlineStartColor","borderInlineStartStyle","borderInlineStartWidth"],borderLeft:["borderLeftColor","borderLeftStyle","borderLeftWidth"],borderRadius:["borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius"],borderRight:["borderRightColor","borderRightStyle","borderRightWidth"],borderStyle:["borderBottomStyle","borderLeftStyle","borderRightStyle","borderTopStyle"],borderTop:["borderTopColor","borderTopStyle","borderTopWidth"],borderWidth:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"],columnRule:["columnRuleColor","columnRuleStyle","columnRuleWidth"],columns:["columnCount","columnWidth"],flex:["flexBasis","flexGrow","flexShrink"],flexFlow:["flexDirection","flexWrap"],font:["fontFamily","fontFeatureSettings","fontKerning","fontLanguageOverride","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition","fontWeight","lineHeight"],fontVariant:["fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition"],gap:["columnGap","rowGap"],grid:["gridAutoColumns","gridAutoFlow","gridAutoRows","gridTemplateAreas","gridTemplateColumns","gridTemplateRows"],gridArea:["gridColumnEnd","gridColumnStart","gridRowEnd","gridRowStart"],gridColumn:["gridColumnEnd","gridColumnStart"],gridColumnGap:["columnGap"],gridGap:["columnGap","rowGap"],gridRow:["gridRowEnd","gridRowStart"],gridRowGap:["rowGap"],gridTemplate:["gridTemplateAreas","gridTemplateColumns","gridTemplateRows"],listStyle:["listStyleImage","listStylePosition","listStyleType"],margin:["marginBottom","marginLeft","marginRight","marginTop"],marker:["markerEnd","markerMid","markerStart"],mask:["maskClip","maskComposite","maskImage","maskMode","maskOrigin","maskPositionX","maskPositionY","maskRepeat","maskSize"],maskPosition:["maskPositionX","maskPositionY"],outline:["outlineColor","outlineStyle","outlineWidth"],overflow:["overflowX","overflowY"],padding:["paddingBottom","paddingLeft","paddingRight","paddingTop"],placeContent:["alignContent","justifyContent"],placeItems:["alignItems","justifyItems"],placeSelf:["alignSelf","justifySelf"],textDecoration:["textDecorationColor","textDecorationLine","textDecorationStyle"],textEmphasis:["textEmphasisColor","textEmphasisStyle"],transition:["transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction"],wordWrap:["overflowWrap"]},vv={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function JA(l,c){return l+c.charAt(0).toUpperCase()+c.substring(1)}var eO=["Webkit","ms","Moz","O"];Object.keys(vv).forEach(function(l){eO.forEach(function(c){vv[JA(c,l)]=vv[l]})});function FC(l,c,p){var v=c==null||typeof c=="boolean"||c==="";return v?"":!p&&typeof c=="number"&&c!==0&&!(vv.hasOwnProperty(l)&&vv[l])?c+"px":(he(c,l),(""+c).trim())}var tO=/([A-Z])/g,bv=/^ms-/;function i6(l){return l.replace(tO,"-$1").toLowerCase().replace(bv,"-ms-")}var nO=function(){};{var s6=/^(?:webkit|moz|o)[A-Z]/,rO=/^-ms-/,iO=/-(.)/g,yv=/;\s*$/,yd={},PE={},my=!1,sO=!1,oO=function(l){return l.replace(iO,function(c,p){return p.toUpperCase()})},AE=function(l){yd.hasOwnProperty(l)&&yd[l]||(yd[l]=!0,u("Unsupported style property %s. Did you mean %s?",l,oO(l.replace(rO,"ms-"))))},OE=function(l){yd.hasOwnProperty(l)&&yd[l]||(yd[l]=!0,u("Unsupported vendor-prefixed style property %s. Did you mean %s?",l,l.charAt(0).toUpperCase()+l.slice(1)))},aO=function(l,c){PE.hasOwnProperty(c)&&PE[c]||(PE[c]=!0,u(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`,l,c.replace(yv,"")))},lO=function(l,c){my||(my=!0,u("`NaN` is an invalid value for the `%s` css style property.",l))},cO=function(l,c){sO||(sO=!0,u("`Infinity` is an invalid value for the `%s` css style property.",l))};nO=function(l,c){l.indexOf("-")>-1?AE(l):s6.test(l)?OE(l):yv.test(c)&&aO(l,c),typeof c=="number"&&(isNaN(c)?lO(l,c):isFinite(c)||cO(l,c))}}var o6=nO;function a6(l){{var c="",p="";for(var v in l)if(l.hasOwnProperty(v)){var w=l[v];if(w!=null){var R=v.indexOf("--")===0;c+=p+(R?v:i6(v))+":",c+=FC(v,w,R),p=";"}}return c||null}}function uO(l,c){var p=l.style;for(var v in c)if(c.hasOwnProperty(v)){var w=v.indexOf("--")===0;w||o6(v,c[v]);var R=FC(v,c[v],w);v==="float"&&(v="cssFloat"),w?p.setProperty(v,R):p[v]=R}}function l6(l){return l==null||typeof l=="boolean"||l===""}function dO(l){var c={};for(var p in l)for(var v=r6[p]||[p],w=0;w<v.length;w++)c[v[w]]=p;return c}function Tu(l,c){{if(!c)return;var p=dO(l),v=dO(c),w={};for(var R in p){var P=p[R],$=v[R];if($&&P!==$){var Y=P+","+$;if(w[Y])continue;w[Y]=!0,u("%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.",l6(l[P])?"Removing":"Updating",P,$)}}}}var py={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},hO=Bt({menuitem:!0},py),fO="__html";function zC(l,c){if(c){if(hO[l]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw new Error(l+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");if(typeof c.dangerouslySetInnerHTML!="object"||!(fO in c.dangerouslySetInnerHTML))throw new Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.")}if(!c.suppressContentEditableWarning&&c.contentEditable&&c.children!=null&&u("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional."),c.style!=null&&typeof c.style!="object")throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.")}}function Tf(l,c){if(l.indexOf("-")===-1)return typeof c.is=="string";switch(l){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 xv={accept:"accept",acceptcharset:"acceptCharset","accept-charset":"acceptCharset",accesskey:"accessKey",action:"action",allowfullscreen:"allowFullScreen",alt:"alt",as:"as",async:"async",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autocorrect:"autoCorrect",autofocus:"autoFocus",autoplay:"autoPlay",autosave:"autoSave",capture:"capture",cellpadding:"cellPadding",cellspacing:"cellSpacing",challenge:"challenge",charset:"charSet",checked:"checked",children:"children",cite:"cite",class:"className",classid:"classID",classname:"className",cols:"cols",colspan:"colSpan",content:"content",contenteditable:"contentEditable",contextmenu:"contextMenu",controls:"controls",controlslist:"controlsList",coords:"coords",crossorigin:"crossOrigin",dangerouslysetinnerhtml:"dangerouslySetInnerHTML",data:"data",datetime:"dateTime",default:"default",defaultchecked:"defaultChecked",defaultvalue:"defaultValue",defer:"defer",dir:"dir",disabled:"disabled",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback",download:"download",draggable:"draggable",enctype:"encType",enterkeyhint:"enterKeyHint",for:"htmlFor",form:"form",formmethod:"formMethod",formaction:"formAction",formenctype:"formEncType",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",headers:"headers",height:"height",hidden:"hidden",high:"high",href:"href",hreflang:"hrefLang",htmlfor:"htmlFor",httpequiv:"httpEquiv","http-equiv":"httpEquiv",icon:"icon",id:"id",imagesizes:"imageSizes",imagesrcset:"imageSrcSet",innerhtml:"innerHTML",inputmode:"inputMode",integrity:"integrity",is:"is",itemid:"itemID",itemprop:"itemProp",itemref:"itemRef",itemscope:"itemScope",itemtype:"itemType",keyparams:"keyParams",keytype:"keyType",kind:"kind",label:"label",lang:"lang",list:"list",loop:"loop",low:"low",manifest:"manifest",marginwidth:"marginWidth",marginheight:"marginHeight",max:"max",maxlength:"maxLength",media:"media",mediagroup:"mediaGroup",method:"method",min:"min",minlength:"minLength",multiple:"multiple",muted:"muted",name:"name",nomodule:"noModule",nonce:"nonce",novalidate:"noValidate",open:"open",optimum:"optimum",pattern:"pattern",placeholder:"placeholder",playsinline:"playsInline",poster:"poster",preload:"preload",profile:"profile",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rel:"rel",required:"required",reversed:"reversed",role:"role",rows:"rows",rowspan:"rowSpan",sandbox:"sandbox",scope:"scope",scoped:"scoped",scrolling:"scrolling",seamless:"seamless",selected:"selected",shape:"shape",size:"size",sizes:"sizes",span:"span",spellcheck:"spellCheck",src:"src",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",start:"start",step:"step",style:"style",summary:"summary",tabindex:"tabIndex",target:"target",title:"title",type:"type",usemap:"useMap",value:"value",width:"width",wmode:"wmode",wrap:"wrap",about:"about",accentheight:"accentHeight","accent-height":"accentHeight",accumulate:"accumulate",additive:"additive",alignmentbaseline:"alignmentBaseline","alignment-baseline":"alignmentBaseline",allowreorder:"allowReorder",alphabetic:"alphabetic",amplitude:"amplitude",arabicform:"arabicForm","arabic-form":"arabicForm",ascent:"ascent",attributename:"attributeName",attributetype:"attributeType",autoreverse:"autoReverse",azimuth:"azimuth",basefrequency:"baseFrequency",baselineshift:"baselineShift","baseline-shift":"baselineShift",baseprofile:"baseProfile",bbox:"bbox",begin:"begin",bias:"bias",by:"by",calcmode:"calcMode",capheight:"capHeight","cap-height":"capHeight",clip:"clip",clippath:"clipPath","clip-path":"clipPath",clippathunits:"clipPathUnits",cliprule:"clipRule","clip-rule":"clipRule",color:"color",colorinterpolation:"colorInterpolation","color-interpolation":"colorInterpolation",colorinterpolationfilters:"colorInterpolationFilters","color-interpolation-filters":"colorInterpolationFilters",colorprofile:"colorProfile","color-profile":"colorProfile",colorrendering:"colorRendering","color-rendering":"colorRendering",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",cursor:"cursor",cx:"cx",cy:"cy",d:"d",datatype:"datatype",decelerate:"decelerate",descent:"descent",diffuseconstant:"diffuseConstant",direction:"direction",display:"display",divisor:"divisor",dominantbaseline:"dominantBaseline","dominant-baseline":"dominantBaseline",dur:"dur",dx:"dx",dy:"dy",edgemode:"edgeMode",elevation:"elevation",enablebackground:"enableBackground","enable-background":"enableBackground",end:"end",exponent:"exponent",externalresourcesrequired:"externalResourcesRequired",fill:"fill",fillopacity:"fillOpacity","fill-opacity":"fillOpacity",fillrule:"fillRule","fill-rule":"fillRule",filter:"filter",filterres:"filterRes",filterunits:"filterUnits",floodopacity:"floodOpacity","flood-opacity":"floodOpacity",floodcolor:"floodColor","flood-color":"floodColor",focusable:"focusable",fontfamily:"fontFamily","font-family":"fontFamily",fontsize:"fontSize","font-size":"fontSize",fontsizeadjust:"fontSizeAdjust","font-size-adjust":"fontSizeAdjust",fontstretch:"fontStretch","font-stretch":"fontStretch",fontstyle:"fontStyle","font-style":"fontStyle",fontvariant:"fontVariant","font-variant":"fontVariant",fontweight:"fontWeight","font-weight":"fontWeight",format:"format",from:"from",fx:"fx",fy:"fy",g1:"g1",g2:"g2",glyphname:"glyphName","glyph-name":"glyphName",glyphorientationhorizontal:"glyphOrientationHorizontal","glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphorientationvertical:"glyphOrientationVertical","glyph-orientation-vertical":"glyphOrientationVertical",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",hanging:"hanging",horizadvx:"horizAdvX","horiz-adv-x":"horizAdvX",horizoriginx:"horizOriginX","horiz-origin-x":"horizOriginX",ideographic:"ideographic",imagerendering:"imageRendering","image-rendering":"imageRendering",in2:"in2",in:"in",inlist:"inlist",intercept:"intercept",k1:"k1",k2:"k2",k3:"k3",k4:"k4",k:"k",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",kerning:"kerning",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",letterspacing:"letterSpacing","letter-spacing":"letterSpacing",lightingcolor:"lightingColor","lighting-color":"lightingColor",limitingconeangle:"limitingConeAngle",local:"local",markerend:"markerEnd","marker-end":"markerEnd",markerheight:"markerHeight",markermid:"markerMid","marker-mid":"markerMid",markerstart:"markerStart","marker-start":"markerStart",markerunits:"markerUnits",markerwidth:"markerWidth",mask:"mask",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",mathematical:"mathematical",mode:"mode",numoctaves:"numOctaves",offset:"offset",opacity:"opacity",operator:"operator",order:"order",orient:"orient",orientation:"orientation",origin:"origin",overflow:"overflow",overlineposition:"overlinePosition","overline-position":"overlinePosition",overlinethickness:"overlineThickness","overline-thickness":"overlineThickness",paintorder:"paintOrder","paint-order":"paintOrder",panose1:"panose1","panose-1":"panose1",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointerevents:"pointerEvents","pointer-events":"pointerEvents",points:"points",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",prefix:"prefix",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",property:"property",r:"r",radius:"radius",refx:"refX",refy:"refY",renderingintent:"renderingIntent","rendering-intent":"renderingIntent",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",resource:"resource",restart:"restart",result:"result",results:"results",rotate:"rotate",rx:"rx",ry:"ry",scale:"scale",security:"security",seed:"seed",shaperendering:"shapeRendering","shape-rendering":"shapeRendering",slope:"slope",spacing:"spacing",specularconstant:"specularConstant",specularexponent:"specularExponent",speed:"speed",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stemh:"stemh",stemv:"stemv",stitchtiles:"stitchTiles",stopcolor:"stopColor","stop-color":"stopColor",stopopacity:"stopOpacity","stop-opacity":"stopOpacity",strikethroughposition:"strikethroughPosition","strikethrough-position":"strikethroughPosition",strikethroughthickness:"strikethroughThickness","strikethrough-thickness":"strikethroughThickness",string:"string",stroke:"stroke",strokedasharray:"strokeDasharray","stroke-dasharray":"strokeDasharray",strokedashoffset:"strokeDashoffset","stroke-dashoffset":"strokeDashoffset",strokelinecap:"strokeLinecap","stroke-linecap":"strokeLinecap",strokelinejoin:"strokeLinejoin","stroke-linejoin":"strokeLinejoin",strokemiterlimit:"strokeMiterlimit","stroke-miterlimit":"strokeMiterlimit",strokewidth:"strokeWidth","stroke-width":"strokeWidth",strokeopacity:"strokeOpacity","stroke-opacity":"strokeOpacity",suppresscontenteditablewarning:"suppressContentEditableWarning",suppresshydrationwarning:"suppressHydrationWarning",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textanchor:"textAnchor","text-anchor":"textAnchor",textdecoration:"textDecoration","text-decoration":"textDecoration",textlength:"textLength",textrendering:"textRendering","text-rendering":"textRendering",to:"to",transform:"transform",typeof:"typeof",u1:"u1",u2:"u2",underlineposition:"underlinePosition","underline-position":"underlinePosition",underlinethickness:"underlineThickness","underline-thickness":"underlineThickness",unicode:"unicode",unicodebidi:"unicodeBidi","unicode-bidi":"unicodeBidi",unicoderange:"unicodeRange","unicode-range":"unicodeRange",unitsperem:"unitsPerEm","units-per-em":"unitsPerEm",unselectable:"unselectable",valphabetic:"vAlphabetic","v-alphabetic":"vAlphabetic",values:"values",vectoreffect:"vectorEffect","vector-effect":"vectorEffect",version:"version",vertadvy:"vertAdvY","vert-adv-y":"vertAdvY",vertoriginx:"vertOriginX","vert-origin-x":"vertOriginX",vertoriginy:"vertOriginY","vert-origin-y":"vertOriginY",vhanging:"vHanging","v-hanging":"vHanging",videographic:"vIdeographic","v-ideographic":"vIdeographic",viewbox:"viewBox",viewtarget:"viewTarget",visibility:"visibility",vmathematical:"vMathematical","v-mathematical":"vMathematical",vocab:"vocab",widths:"widths",wordspacing:"wordSpacing","word-spacing":"wordSpacing",writingmode:"writingMode","writing-mode":"writingMode",x1:"x1",x2:"x2",x:"x",xchannelselector:"xChannelSelector",xheight:"xHeight","x-height":"xHeight",xlinkactuate:"xlinkActuate","xlink:actuate":"xlinkActuate",xlinkarcrole:"xlinkArcrole","xlink:arcrole":"xlinkArcrole",xlinkhref:"xlinkHref","xlink:href":"xlinkHref",xlinkrole:"xlinkRole","xlink:role":"xlinkRole",xlinkshow:"xlinkShow","xlink:show":"xlinkShow",xlinktitle:"xlinkTitle","xlink:title":"xlinkTitle",xlinktype:"xlinkType","xlink:type":"xlinkType",xmlbase:"xmlBase","xml:base":"xmlBase",xmllang:"xmlLang","xml:lang":"xmlLang",xmlns:"xmlns","xml:space":"xmlSpace",xmlnsxlink:"xmlnsXlink","xmlns:xlink":"xmlnsXlink",xmlspace:"xmlSpace",y1:"y1",y2:"y2",y:"y",ychannelselector:"yChannelSelector",z:"z",zoomandpan:"zoomAndPan"},mO={"aria-current":0,"aria-description":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},wv={},Cv=new RegExp("^(aria)-["+se+"]*$"),IE=new RegExp("^(aria)[A-Z]["+se+"]*$");function gy(l,c){{if(G.call(wv,c)&&wv[c])return!0;if(IE.test(c)){var p="aria-"+c.slice(4).toLowerCase(),v=mO.hasOwnProperty(p)?p:null;if(v==null)return u("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.",c),wv[c]=!0,!0;if(c!==v)return u("Invalid ARIA attribute `%s`. Did you mean `%s`?",c,v),wv[c]=!0,!0}if(Cv.test(c)){var w=c.toLowerCase(),R=mO.hasOwnProperty(w)?w:null;if(R==null)return wv[c]=!0,!1;if(c!==R)return u("Unknown ARIA attribute `%s`. Did you mean `%s`?",c,R),wv[c]=!0,!0}}return!0}function DE(l,c){{var p=[];for(var v in c){var w=gy(l,v);w||p.push(v)}var R=p.map(function(P){return"`"+P+"`"}).join(", ");p.length===1?u("Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props",R,l):p.length>1&&u("Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props",R,l)}}function pO(l,c){Tf(l,c)||DE(l,c)}var vy=!1;function Sv(l,c){{if(l!=="input"&&l!=="textarea"&&l!=="select")return;c!=null&&c.value===null&&!vy&&(vy=!0,l==="select"&&c.multiple?u("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",l):u("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",l))}}var VC=function(){};{var ja={},by=/^on./,gO=/^on[^A-Z]/,vO=new RegExp("^(aria)-["+se+"]*$"),bO=new RegExp("^(aria)[A-Z]["+se+"]*$");VC=function(l,c,p,v){if(G.call(ja,c)&&ja[c])return!0;var w=c.toLowerCase();if(w==="onfocusin"||w==="onfocusout")return u("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."),ja[c]=!0,!0;if(v!=null){var R=v.registrationNameDependencies,P=v.possibleRegistrationNames;if(R.hasOwnProperty(c))return!0;var $=P.hasOwnProperty(w)?P[w]:null;if($!=null)return u("Invalid event handler property `%s`. Did you mean `%s`?",c,$),ja[c]=!0,!0;if(by.test(c))return u("Unknown event handler property `%s`. It will be ignored.",c),ja[c]=!0,!0}else if(by.test(c))return gO.test(c)&&u("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.",c),ja[c]=!0,!0;if(vO.test(c)||bO.test(c))return!0;if(w==="innerhtml")return u("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."),ja[c]=!0,!0;if(w==="aria")return u("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."),ja[c]=!0,!0;if(w==="is"&&p!==null&&p!==void 0&&typeof p!="string")return u("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.",typeof p),ja[c]=!0,!0;if(typeof p=="number"&&isNaN(p))return u("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.",c),ja[c]=!0,!0;var Y=wt(c),le=Y!==null&&Y.type===ot;if(xv.hasOwnProperty(w)){var ue=xv[w];if(ue!==c)return u("Invalid DOM property `%s`. Did you mean `%s`?",c,ue),ja[c]=!0,!0}else if(!le&&c!==w)return u("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.",c,w),ja[c]=!0,!0;return typeof p=="boolean"&&Pe(c,p,Y,!1)?(p?u('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.',p,c,c,p,c):u('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.',p,c,c,p,c,c,c),ja[c]=!0,!0):le?!0:Pe(c,p,Y,!1)?(ja[c]=!0,!1):((p==="false"||p==="true")&&Y!==null&&Y.type===de&&(u("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?",p,c,p==="false"?"The browser will interpret it as a truthy value.":'Although this works, it will not work as expected if you pass the string "false".',c,p),ja[c]=!0),!0)}}var yO=function(l,c,p){{var v=[];for(var w in c){var R=VC(l,w,c[w],p);R||v.push(w)}var P=v.map(function($){return"`"+$+"`"}).join(", ");v.length===1?u("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ",P,l):v.length>1&&u("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ",P,l)}};function xO(l,c,p){Tf(l,c)||yO(l,c,p)}var HE=1,xd=2,fp=4,LE=HE|xd|fp,yy=null;function c6(l){yy!==null&&u("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue."),yy=l}function xy(){yy===null&&u("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue."),yy=null}function u6(l){return l===yy}function BC(l){var c=l.target||l.srcElement||window;return c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===fh?c.parentNode:c}var WC=null,gi=null,jf=null;function wy(l){var c=Xv(l);if(c){if(typeof WC!="function")throw new Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");var p=c.stateNode;if(p){var v=_I(p);WC(c.stateNode,c.type,v)}}}function Cy(l){WC=l}function $E(l){gi?jf?jf.push(l):jf=[l]:gi=l}function FE(){return gi!==null||jf!==null}function Rv(){if(gi){var l=gi,c=jf;if(gi=null,jf=null,wy(l),c)for(var p=0;p<c.length;p++)wy(c[p])}}var Sy=function(l,c){return l(c)},mp=function(){},UC=!1;function d6(){var l=FE();l&&(mp(),Rv())}function wO(l,c,p){if(UC)return l(c,p);UC=!0;try{return Sy(l,c,p)}finally{UC=!1,d6()}}function CO(l,c,p){Sy=l,mp=p}function YC(l){return l==="button"||l==="input"||l==="select"||l==="textarea"}function GC(l,c,p){switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":return!!(p.disabled&&YC(c));default:return!1}}function pp(l,c){var p=l.stateNode;if(p===null)return null;var v=_I(p);if(v===null)return null;var w=v[c];if(GC(c,l.type,v))return null;if(w&&typeof w!="function")throw new Error("Expected `"+c+"` listener to be a function, instead got a value of `"+typeof w+"` type.");return w}var Ry=!1;if(O)try{var gp={};Object.defineProperty(gp,"passive",{get:function(){Ry=!0}}),window.addEventListener("test",gp,gp),window.removeEventListener("test",gp,gp)}catch{Ry=!1}function KC(l,c,p,v,w,R,P,$,Y){var le=Array.prototype.slice.call(arguments,3);try{c.apply(p,le)}catch(ue){this.onError(ue)}}var SO=KC;if(typeof window<"u"&&typeof window.dispatchEvent=="function"&&typeof document<"u"&&typeof document.createEvent=="function"){var qC=document.createElement("react");SO=function(c,p,v,w,R,P,$,Y,le){if(typeof document>"u"||document===null)throw new Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");var ue=document.createEvent("Event"),He=!1,Ie=!0,et=window.event,it=Object.getOwnPropertyDescriptor(window,"event");function mt(){qC.removeEventListener(pt,$n,!1),typeof window.event<"u"&&window.hasOwnProperty("event")&&(window.event=et)}var Zt=Array.prototype.slice.call(arguments,3);function $n(){He=!0,mt(),p.apply(v,Zt),Ie=!1}var Tn,Xr=!1,zr=!1;function Ue(Ye){if(Tn=Ye.error,Xr=!0,Tn===null&&Ye.colno===0&&Ye.lineno===0&&(zr=!0),Ye.defaultPrevented&&Tn!=null&&typeof Tn=="object")try{Tn._suppressLogging=!0}catch{}}var pt="react-"+(c||"invokeguardedcallback");if(window.addEventListener("error",Ue),qC.addEventListener(pt,$n,!1),ue.initEvent(pt,!1,!1),qC.dispatchEvent(ue),it&&Object.defineProperty(window,"event",it),He&&Ie&&(Xr?zr&&(Tn=new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.")):Tn=new Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`),this.onError(Tn)),window.removeEventListener("error",Ue),!He)return mt(),KC.apply(this,arguments)}}var h6=SO,_v=!1,Ev=null,ju=!1,XC=null,Nv={onError:function(l){_v=!0,Ev=l}};function Fc(l,c,p,v,w,R,P,$,Y){_v=!1,Ev=null,h6.apply(Nv,arguments)}function _y(l,c,p,v,w,R,P,$,Y){if(Fc.apply(this,arguments),_v){var le=VE();ju||(ju=!0,XC=le)}}function ph(){if(ju){var l=XC;throw ju=!1,XC=null,l}}function zE(){return _v}function VE(){if(_v){var l=Ev;return _v=!1,Ev=null,l}else throw new Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.")}function kv(l){return l._reactInternals}function vp(l){return l._reactInternals!==void 0}function Ey(l,c){l._reactInternals=c}var Mn=0,gh=1,_s=2,Ir=4,Rl=16,wi=32,Gi=64,_r=128,is=256,oo=512,zc=1024,sc=2048,Es=4096,wd=8192,QC=16384,RO=32767,bp=32768,Ma=65536,Mu=131072,Ny=1048576,ky=2097152,Mf=4194304,BE=8388608,Wa=16777216,Pf=33554432,Af=Ir|zc|0,Tv=_s|Ir|Rl|wi|oo|Es|wd,Of=Ir|Gi|oo|wd,ca=sc|Rl,ao=Mf|BE|ky,yp=r.ReactCurrentOwner;function Ua(l){var c=l,p=l;if(l.alternate)for(;c.return;)c=c.return;else{var v=c;do c=v,(c.flags&(_s|Es))!==Mn&&(p=c.return),v=c.return;while(v)}return c.tag===x?p:null}function Cd(l){if(l.tag===F){var c=l.memoizedState;if(c===null){var p=l.alternate;p!==null&&(c=p.memoizedState)}if(c!==null)return c.dehydrated}return null}function If(l){return l.tag===x?l.stateNode.containerInfo:null}function _O(l){return Ua(l)===l}function WE(l){{var c=yp.current;if(c!==null&&c.tag===g){var p=c,v=p.stateNode;v._warnedAboutRefsInRender||u("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",_n(p)||"A component"),v._warnedAboutRefsInRender=!0}}var w=kv(l);return w?Ua(w)===w:!1}function ZC(l){if(Ua(l)!==l)throw new Error("Unable to find node on an unmounted component.")}function _l(l){var c=l.alternate;if(!c){var p=Ua(l);if(p===null)throw new Error("Unable to find node on an unmounted component.");return p!==l?null:l}for(var v=l,w=c;;){var R=v.return;if(R===null)break;var P=R.alternate;if(P===null){var $=R.return;if($!==null){v=w=$;continue}break}if(R.child===P.child){for(var Y=R.child;Y;){if(Y===v)return ZC(R),l;if(Y===w)return ZC(R),c;Y=Y.sibling}throw new Error("Unable to find node on an unmounted component.")}if(v.return!==w.return)v=R,w=P;else{for(var le=!1,ue=R.child;ue;){if(ue===v){le=!0,v=R,w=P;break}if(ue===w){le=!0,w=R,v=P;break}ue=ue.sibling}if(!le){for(ue=P.child;ue;){if(ue===v){le=!0,v=P,w=R;break}if(ue===w){le=!0,w=P,v=R;break}ue=ue.sibling}if(!le)throw new Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(v.alternate!==w)throw new Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(v.tag!==x)throw new Error("Unable to find node on an unmounted component.");return v.stateNode.current===v?l:c}function El(l){var c=_l(l);return c!==null?es(c):null}function es(l){if(l.tag===E||l.tag===M)return l;for(var c=l.child;c!==null;){var p=es(c);if(p!==null)return p;c=c.sibling}return null}function Pu(l){var c=_l(l);return c!==null?UE(c):null}function UE(l){if(l.tag===E||l.tag===M)return l;for(var c=l.child;c!==null;){if(c.tag!==C){var p=UE(c);if(p!==null)return p}c=c.sibling}return null}var YE=n.unstable_scheduleCallback,GE=n.unstable_cancelCallback,KE=n.unstable_shouldYield,EO=n.unstable_requestPaint,Ws=n.unstable_now,NO=n.unstable_getCurrentPriorityLevel,vh=n.unstable_ImmediatePriority,Ty=n.unstable_UserBlockingPriority,xp=n.unstable_NormalPriority,jy=n.unstable_LowPriority,jv=n.unstable_IdlePriority,kO=n.unstable_yieldValue,TO=n.unstable_setDisableYieldValue,Au=null,ua=null,Xt=null,oc=!1,Pa=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u";function qE(l){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled)return!0;if(!c.supportsFiber)return u("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools"),!0;try{ne&&(l=Bt({},l,{getLaneLabelMap:JE,injectProfilingHooks:wp})),Au=c.inject(l),ua=c}catch(p){u("React instrumentation encountered an error: %s.",p)}return!!c.checkDCE}function XE(l,c){if(ua&&typeof ua.onScheduleFiberRoot=="function")try{ua.onScheduleFiberRoot(Au,l,c)}catch(p){oc||(oc=!0,u("React instrumentation encountered an error: %s",p))}}function QE(l,c){if(ua&&typeof ua.onCommitFiberRoot=="function")try{var p=(l.current.flags&_r)===_r;if(xe){var v;switch(c){case Ml:v=vh;break;case Bc:v=Ty;break;case da:v=xp;break;case kS:v=jv;break;default:v=xp;break}ua.onCommitFiberRoot(Au,l,v,p)}}catch(w){oc||(oc=!0,u("React instrumentation encountered an error: %s",w))}}function ZE(l){if(ua&&typeof ua.onPostCommitFiberRoot=="function")try{ua.onPostCommitFiberRoot(Au,l)}catch(c){oc||(oc=!0,u("React instrumentation encountered an error: %s",c))}}function Mv(l){if(ua&&typeof ua.onCommitFiberUnmount=="function")try{ua.onCommitFiberUnmount(Au,l)}catch(c){oc||(oc=!0,u("React instrumentation encountered an error: %s",c))}}function Ci(l){if(typeof kO=="function"&&(TO(l),s(l)),ua&&typeof ua.setStrictMode=="function")try{ua.setStrictMode(Au,l)}catch(c){oc||(oc=!0,u("React instrumentation encountered an error: %s",c))}}function wp(l){Xt=l}function JE(){{for(var l=new Map,c=1,p=0;p<sN;p++){var v=IO(c);l.set(c,v),c*=2}return l}}function jO(l){Xt!==null&&typeof Xt.markCommitStarted=="function"&&Xt.markCommitStarted(l)}function Sd(){Xt!==null&&typeof Xt.markCommitStopped=="function"&&Xt.markCommitStopped()}function Vc(l){Xt!==null&&typeof Xt.markComponentRenderStarted=="function"&&Xt.markComponentRenderStarted(l)}function Df(){Xt!==null&&typeof Xt.markComponentRenderStopped=="function"&&Xt.markComponentRenderStopped()}function MO(l){Xt!==null&&typeof Xt.markComponentPassiveEffectMountStarted=="function"&&Xt.markComponentPassiveEffectMountStarted(l)}function bh(){Xt!==null&&typeof Xt.markComponentPassiveEffectMountStopped=="function"&&Xt.markComponentPassiveEffectMountStopped()}function Hf(l){Xt!==null&&typeof Xt.markComponentPassiveEffectUnmountStarted=="function"&&Xt.markComponentPassiveEffectUnmountStarted(l)}function JC(){Xt!==null&&typeof Xt.markComponentPassiveEffectUnmountStopped=="function"&&Xt.markComponentPassiveEffectUnmountStopped()}function PO(l){Xt!==null&&typeof Xt.markComponentLayoutEffectMountStarted=="function"&&Xt.markComponentLayoutEffectMountStarted(l)}function eS(){Xt!==null&&typeof Xt.markComponentLayoutEffectMountStopped=="function"&&Xt.markComponentLayoutEffectMountStopped()}function eN(l){Xt!==null&&typeof Xt.markComponentLayoutEffectUnmountStarted=="function"&&Xt.markComponentLayoutEffectUnmountStarted(l)}function Pv(){Xt!==null&&typeof Xt.markComponentLayoutEffectUnmountStopped=="function"&&Xt.markComponentLayoutEffectUnmountStopped()}function Rd(l,c,p){Xt!==null&&typeof Xt.markComponentErrored=="function"&&Xt.markComponentErrored(l,c,p)}function My(l,c,p){Xt!==null&&typeof Xt.markComponentSuspended=="function"&&Xt.markComponentSuspended(l,c,p)}function Py(l){Xt!==null&&typeof Xt.markLayoutEffectsStarted=="function"&&Xt.markLayoutEffectsStarted(l)}function Cp(){Xt!==null&&typeof Xt.markLayoutEffectsStopped=="function"&&Xt.markLayoutEffectsStopped()}function tN(l){Xt!==null&&typeof Xt.markPassiveEffectsStarted=="function"&&Xt.markPassiveEffectsStarted(l)}function Av(){Xt!==null&&typeof Xt.markPassiveEffectsStopped=="function"&&Xt.markPassiveEffectsStopped()}function nN(l){Xt!==null&&typeof Xt.markRenderStarted=="function"&&Xt.markRenderStarted(l)}function rN(){Xt!==null&&typeof Xt.markRenderYielded=="function"&&Xt.markRenderYielded()}function ss(){Xt!==null&&typeof Xt.markRenderStopped=="function"&&Xt.markRenderStopped()}function tS(l){Xt!==null&&typeof Xt.markRenderScheduled=="function"&&Xt.markRenderScheduled(l)}function iN(l,c){Xt!==null&&typeof Xt.markForceUpdateScheduled=="function"&&Xt.markForceUpdateScheduled(l,c)}function Ay(l,c){Xt!==null&&typeof Xt.markStateUpdateScheduled=="function"&&Xt.markStateUpdateScheduled(l,c)}var Pn=0,jr=1,Ur=2,hr=8,Oi=16,_o=Math.clz32?Math.clz32:Iy,nS=Math.log,Oy=Math.LN2;function Iy(l){var c=l>>>0;return c===0?32:31-(nS(c)/Oy|0)|0}var sN=31,bt=0,lo=0,Un=1,Lf=2,Uo=4,Yo=8,Nl=16,Sp=32,$f=4194240,Ov=64,rS=128,iS=256,sS=512,oS=1024,aS=2048,lS=4096,cS=8192,Rp=16384,uS=32768,Iv=65536,Dv=131072,dS=262144,Dy=524288,hS=1048576,fS=2097152,Hy=130023424,_p=4194304,Ly=8388608,mS=16777216,pS=33554432,gS=67108864,AO=_p,Hv=134217728,OO=268435455,$y=268435456,Ff=536870912,kl=1073741824;function IO(l){{if(l&Un)return"Sync";if(l&Lf)return"InputContinuousHydration";if(l&Uo)return"InputContinuous";if(l&Yo)return"DefaultHydration";if(l&Nl)return"Default";if(l&Sp)return"TransitionHydration";if(l&$f)return"Transition";if(l&Hy)return"Retry";if(l&Hv)return"SelectiveHydration";if(l&$y)return"IdleHydration";if(l&Ff)return"Idle";if(l&kl)return"Offscreen"}}var Si=-1,vS=Ov,bS=_p;function Fy(l){switch(Ep(l)){case Un:return Un;case Lf:return Lf;case Uo:return Uo;case Yo:return Yo;case Nl:return Nl;case Sp:return Sp;case Ov:case rS:case iS:case sS:case oS:case aS:case lS:case cS:case Rp:case uS:case Iv:case Dv:case dS:case Dy:case hS:case fS:return l&$f;case _p:case Ly:case mS:case pS:case gS:return l&Hy;case Hv:return Hv;case $y:return $y;case Ff:return Ff;case kl:return kl;default:return u("Should have found matching lanes. This is a bug in React."),l}}function Tl(l,c){var p=l.pendingLanes;if(p===bt)return bt;var v=bt,w=l.suspendedLanes,R=l.pingedLanes,P=p&OO;if(P!==bt){var $=P&~w;if($!==bt)v=Fy($);else{var Y=P&R;Y!==bt&&(v=Fy(Y))}}else{var le=p&~w;le!==bt?v=Fy(le):R!==bt&&(v=Fy(R))}if(v===bt)return bt;if(c!==bt&&c!==v&&(c&w)===bt){var ue=Ep(v),He=Ep(c);if(ue>=He||ue===Nl&&(He&$f)!==bt)return c}(v&Uo)!==bt&&(v|=p&Nl);var Ie=l.entangledLanes;if(Ie!==bt)for(var et=l.entanglements,it=v&Ie;it>0;){var mt=Us(it),Zt=1<<mt;v|=et[mt],it&=~Zt}return v}function oN(l,c){for(var p=l.eventTimes,v=Si;c>0;){var w=Us(c),R=1<<w,P=p[w];P>v&&(v=P),c&=~R}return v}function yS(l,c){switch(l){case Un:case Lf:case Uo:return c+250;case Yo:case Nl:case Sp:case Ov:case rS:case iS:case sS:case oS:case aS:case lS:case cS:case Rp:case uS:case Iv:case Dv:case dS:case Dy:case hS:case fS:return c+5e3;case _p:case Ly:case mS:case pS:case gS:return Si;case Hv:case $y:case Ff:case kl:return Si;default:return u("Should have found matching lanes. This is a bug in React."),Si}}function DO(l,c){for(var p=l.pendingLanes,v=l.suspendedLanes,w=l.pingedLanes,R=l.expirationTimes,P=p;P>0;){var $=Us(P),Y=1<<$,le=R[$];le===Si?((Y&v)===bt||(Y&w)!==bt)&&(R[$]=yS(Y,c)):le<=c&&(l.expiredLanes|=Y),P&=~Y}}function HO(l){return Fy(l.pendingLanes)}function xS(l){var c=l.pendingLanes&~kl;return c!==bt?c:c&kl?kl:bt}function aN(l){return(l&Un)!==bt}function zf(l){return(l&OO)!==bt}function wS(l){return(l&Hy)===l}function lN(l){var c=Un|Uo|Nl;return(l&c)===bt}function f6(l){return(l&$f)===l}function zy(l,c){var p=Lf|Uo|Yo|Nl;return(c&p)!==bt}function LO(l,c){return(c&l.expiredLanes)!==bt}function cN(l){return(l&$f)!==bt}function uN(){var l=vS;return vS<<=1,(vS&$f)===bt&&(vS=Ov),l}function $O(){var l=bS;return bS<<=1,(bS&Hy)===bt&&(bS=_p),l}function Ep(l){return l&-l}function Go(l){return Ep(l)}function Us(l){return 31-_o(l)}function CS(l){return Us(l)}function jl(l,c){return(l&c)!==bt}function Np(l,c){return(l&c)===c}function br(l,c){return l|c}function Vy(l,c){return l&~c}function SS(l,c){return l&c}function m6(l){return l}function dN(l,c){return l!==lo&&l<c?l:c}function RS(l){for(var c=[],p=0;p<sN;p++)c.push(l);return c}function Lv(l,c,p){l.pendingLanes|=c,c!==Ff&&(l.suspendedLanes=bt,l.pingedLanes=bt);var v=l.eventTimes,w=CS(c);v[w]=p}function hN(l,c){l.suspendedLanes|=c,l.pingedLanes&=~c;for(var p=l.expirationTimes,v=c;v>0;){var w=Us(v),R=1<<w;p[w]=Si,v&=~R}}function _S(l,c,p){l.pingedLanes|=l.suspendedLanes&c}function FO(l,c){var p=l.pendingLanes&~c;l.pendingLanes=c,l.suspendedLanes=bt,l.pingedLanes=bt,l.expiredLanes&=c,l.mutableReadLanes&=c,l.entangledLanes&=c;for(var v=l.entanglements,w=l.eventTimes,R=l.expirationTimes,P=p;P>0;){var $=Us(P),Y=1<<$;v[$]=bt,w[$]=Si,R[$]=Si,P&=~Y}}function By(l,c){for(var p=l.entangledLanes|=c,v=l.entanglements,w=p;w;){var R=Us(w),P=1<<R;P&c|v[R]&c&&(v[R]|=c),w&=~P}}function ES(l,c){var p=Ep(c),v;switch(p){case Uo:v=Lf;break;case Nl:v=Yo;break;case Ov:case rS:case iS:case sS:case oS:case aS:case lS:case cS:case Rp:case uS:case Iv:case Dv:case dS:case Dy:case hS:case fS:case _p:case Ly:case mS:case pS:case gS:v=Sp;break;case Ff:v=$y;break;default:v=lo;break}return(v&(l.suspendedLanes|c))!==lo?lo:v}function zO(l,c,p){if(Pa)for(var v=l.pendingUpdatersLaneMap;p>0;){var w=CS(p),R=1<<w,P=v[w];P.add(c),p&=~R}}function fN(l,c){if(Pa)for(var p=l.pendingUpdatersLaneMap,v=l.memoizedUpdaters;c>0;){var w=CS(c),R=1<<w,P=p[w];P.size>0&&(P.forEach(function($){var Y=$.alternate;(Y===null||!v.has(Y))&&v.add($)}),P.clear()),c&=~R}}function NS(l,c){return null}var Ml=Un,Bc=Uo,da=Nl,kS=Ff,$v=lo;function ac(){return $v}function Eo(l){$v=l}function VO(l,c){var p=$v;try{return $v=l,c()}finally{$v=p}}function Wy(l,c){return l!==0&&l<c?l:c}function Aa(l,c){return l>c?l:c}function mN(l,c){return l!==0&&l<c}function BO(l){var c=Ep(l);return mN(Ml,c)?mN(Bc,c)?zf(c)?da:kS:Bc:Ml}function kp(l){var c=l.current.memoizedState;return c.isDehydrated}var ha;function p6(l){ha=l}function bn(l){ha(l)}var Vf;function pN(l){Vf=l}var gN;function g6(l){gN=l}var Fv;function TS(l){Fv=l}var jS;function WO(l){jS=l}var MS=!1,Uy=[],_d=null,Ed=null,os=null,Ya=new Map,Wc=new Map,yh=[],UO=["mousedown","mouseup","touchcancel","touchend","touchstart","auxclick","dblclick","pointercancel","pointerdown","pointerup","dragend","dragstart","drop","compositionend","compositionstart","keydown","keypress","keyup","input","textInput","copy","cut","paste","click","change","contextmenu","reset","submit"];function Ou(l){return UO.indexOf(l)>-1}function YO(l,c,p,v,w){return{blockedOn:l,domEventName:c,eventSystemFlags:p,nativeEvent:w,targetContainers:[v]}}function Iu(l,c){switch(l){case"focusin":case"focusout":_d=null;break;case"dragenter":case"dragleave":Ed=null;break;case"mouseover":case"mouseout":os=null;break;case"pointerover":case"pointerout":{var p=c.pointerId;Ya.delete(p);break}case"gotpointercapture":case"lostpointercapture":{var v=c.pointerId;Wc.delete(v);break}}}function Yy(l,c,p,v,w,R){if(l===null||l.nativeEvent!==R){var P=YO(c,p,v,w,R);if(c!==null){var $=Xv(c);$!==null&&Vf($)}return P}l.eventSystemFlags|=v;var Y=l.targetContainers;return w!==null&&Y.indexOf(w)===-1&&Y.push(w),l}function GO(l,c,p,v,w){switch(c){case"focusin":{var R=w;return _d=Yy(_d,l,c,p,v,R),!0}case"dragenter":{var P=w;return Ed=Yy(Ed,l,c,p,v,P),!0}case"mouseover":{var $=w;return os=Yy(os,l,c,p,v,$),!0}case"pointerover":{var Y=w,le=Y.pointerId;return Ya.set(le,Yy(Ya.get(le)||null,l,c,p,v,Y)),!0}case"gotpointercapture":{var ue=w,He=ue.pointerId;return Wc.set(He,Yy(Wc.get(He)||null,l,c,p,v,ue)),!0}}return!1}function vN(l){var c=ox(l.target);if(c!==null){var p=Ua(c);if(p!==null){var v=p.tag;if(v===F){var w=Cd(p);if(w!==null){l.blockedOn=w,jS(l.priority,function(){gN(p)});return}}else if(v===x){var R=p.stateNode;if(kp(R)){l.blockedOn=If(p);return}}}}l.blockedOn=null}function KO(l){for(var c=Fv(),p={blockedOn:null,target:l,priority:c},v=0;v<yh.length&&mN(c,yh[v].priority);v++);yh.splice(v,0,p),v===0&&vN(p)}function Gy(l){if(l.blockedOn!==null)return!1;for(var c=l.targetContainers;c.length>0;){var p=c[0],v=Ky(l.domEventName,l.eventSystemFlags,p,l.nativeEvent);if(v===null){var w=l.nativeEvent,R=new w.constructor(w.type,w);c6(R),w.target.dispatchEvent(R),xy()}else{var P=Xv(v);return P!==null&&Vf(P),l.blockedOn=v,!1}c.shift()}return!0}function qO(l,c,p){Gy(l)&&p.delete(c)}function PS(){MS=!1,_d!==null&&Gy(_d)&&(_d=null),Ed!==null&&Gy(Ed)&&(Ed=null),os!==null&&Gy(os)&&(os=null),Ya.forEach(qO),Wc.forEach(qO)}function Tp(l,c){l.blockedOn===c&&(l.blockedOn=null,MS||(MS=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,PS)))}function Oa(l){if(Uy.length>0){Tp(Uy[0],l);for(var c=1;c<Uy.length;c++){var p=Uy[c];p.blockedOn===l&&(p.blockedOn=null)}}_d!==null&&Tp(_d,l),Ed!==null&&Tp(Ed,l),os!==null&&Tp(os,l);var v=function($){return Tp($,l)};Ya.forEach(v),Wc.forEach(v);for(var w=0;w<yh.length;w++){var R=yh[w];R.blockedOn===l&&(R.blockedOn=null)}for(;yh.length>0;){var P=yh[0];if(P.blockedOn!==null)break;vN(P),P.blockedOn===null&&yh.shift()}}var Dr=r.ReactCurrentBatchConfig,co=!0;function Ys(l){co=!!l}function fa(){return co}function lc(l,c,p){var v=Vv(c),w;switch(v){case Ml:w=zv;break;case Bc:w=No;break;case da:default:w=jp;break}return w.bind(null,c,p,l)}function zv(l,c,p,v){var w=ac(),R=Dr.transition;Dr.transition=null;try{Eo(Ml),jp(l,c,p,v)}finally{Eo(w),Dr.transition=R}}function No(l,c,p,v){var w=ac(),R=Dr.transition;Dr.transition=null;try{Eo(Bc),jp(l,c,p,v)}finally{Eo(w),Dr.transition=R}}function jp(l,c,p,v){co&&Mp(l,c,p,v)}function Mp(l,c,p,v){var w=Ky(l,c,p,v);if(w===null){A6(l,c,v,Pp,p),Iu(l,v);return}if(GO(w,l,c,p,v)){v.stopPropagation();return}if(Iu(l,v),c&fp&&Ou(l)){for(;w!==null;){var R=Xv(w);R!==null&&bn(R);var P=Ky(l,c,p,v);if(P===null&&A6(l,c,v,Pp,p),P===w)break;w=P}w!==null&&v.stopPropagation();return}A6(l,c,v,null,p)}var Pp=null;function Ky(l,c,p,v){Pp=null;var w=BC(v),R=ox(w);if(R!==null){var P=Ua(R);if(P===null)R=null;else{var $=P.tag;if($===F){var Y=Cd(P);if(Y!==null)return Y;R=null}else if($===x){var le=P.stateNode;if(kp(le))return If(P);R=null}else P!==R&&(R=null)}}return Pp=R,null}function Vv(l){switch(l){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return Ml;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return Bc;case"message":{var c=NO();switch(c){case vh:return Ml;case Ty:return Bc;case xp:case jy:return da;case jv:return kS;default:return da}}default:return da}}function Pl(l,c,p){return l.addEventListener(c,p,!1),p}function bN(l,c,p){return l.addEventListener(c,p,!0),p}function Bv(l,c,p,v){return l.addEventListener(c,p,{capture:!0,passive:v}),p}function xh(l,c,p,v){return l.addEventListener(c,p,{passive:v}),p}var Bf=null,qy=null,Uc=null;function AS(l){return Bf=l,qy=Wv(),!0}function Wf(){Bf=null,qy=null,Uc=null}function Xy(){if(Uc)return Uc;var l,c=qy,p=c.length,v,w=Wv(),R=w.length;for(l=0;l<p&&c[l]===w[l];l++);var P=p-l;for(v=1;v<=P&&c[p-v]===w[R-v];v++);var $=v>1?1-v:void 0;return Uc=w.slice(l,$),Uc}function Wv(){return"value"in Bf?Bf.value:Bf.textContent}function Uv(l){var c,p=l.keyCode;return"charCode"in l?(c=l.charCode,c===0&&p===13&&(c=13)):c=p,c===10&&(c=13),c>=32||c===13?c:0}function Ap(){return!0}function Qy(){return!1}function Ki(l){function c(p,v,w,R,P){this._reactName=p,this._targetInst=w,this.type=v,this.nativeEvent=R,this.target=P,this.currentTarget=null;for(var $ in l)if(l.hasOwnProperty($)){var Y=l[$];Y?this[$]=Y(R):this[$]=R[$]}var le=R.defaultPrevented!=null?R.defaultPrevented:R.returnValue===!1;return le?this.isDefaultPrevented=Ap:this.isDefaultPrevented=Qy,this.isPropagationStopped=Qy,this}return Bt(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=Ap)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Ap)},persist:function(){},isPersistent:Ap}),c}var cc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},uc=Ki(cc),Ko=Bt({},cc,{view:0,detail:0}),XO=Ki(Ko),Zy,Jy,ex;function Uf(l){l!==ex&&(ex&&l.type==="mousemove"?(Zy=l.screenX-ex.screenX,Jy=l.screenY-ex.screenY):(Zy=0,Jy=0),ex=l)}var tx=Bt({},Ko,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:CN,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(Uf(l),Zy)},movementY:function(l){return"movementY"in l?l.movementY:Jy}}),OS=Ki(tx),Op=Bt({},tx,{dataTransfer:0}),yN=Ki(Op),Ip=Bt({},Ko,{relatedTarget:0}),IS=Ki(Ip),QO=Bt({},cc,{animationName:0,elapsedTime:0,pseudoElement:0}),xN=Ki(QO),DS=Bt({},cc,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),v6=Ki(DS),b6=Bt({},cc,{data:0}),wN=Ki(b6),ZO=wN,Dp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},y6={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"};function Yv(l){if(l.key){var c=Dp[l.key]||l.key;if(c!=="Unidentified")return c}if(l.type==="keypress"){var p=Uv(l);return p===13?"Enter":String.fromCharCode(p)}return l.type==="keydown"||l.type==="keyup"?y6[l.keyCode]||"Unidentified":""}var JO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ns(l){var c=this,p=c.nativeEvent;if(p.getModifierState)return p.getModifierState(l);var v=JO[l];return v?!!p[v]:!1}function CN(l){return Ns}var eI=Bt({},Ko,{key:Yv,code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:CN,charCode:function(l){return l.type==="keypress"?Uv(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Uv(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),x6=Ki(eI),w6=Bt({},tx,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),SN=Ki(w6),tI=Bt({},Ko,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:CN}),C6=Ki(tI),Yc=Bt({},cc,{propertyName:0,elapsedTime:0,pseudoElement:0}),RN=Ki(Yc),S6=Bt({},tx,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),Yf=Ki(S6),HS=[9,13,27,32],Gf=229,Gv=O&&"CompositionEvent"in window,Hp=null;O&&"documentMode"in document&&(Hp=document.documentMode);var _N=O&&"TextEvent"in window&&!Hp,nI=O&&(!Gv||Hp&&Hp>8&&Hp<=11),LS=32,rI=String.fromCharCode(LS);function iI(){_("onBeforeInput",["compositionend","keypress","textInput","paste"]),_("onCompositionEnd",["compositionend","focusout","keydown","keypress","keyup","mousedown"]),_("onCompositionStart",["compositionstart","focusout","keydown","keypress","keyup","mousedown"]),_("onCompositionUpdate",["compositionupdate","focusout","keydown","keypress","keyup","mousedown"])}var EN=!1;function $S(l){return(l.ctrlKey||l.altKey||l.metaKey)&&!(l.ctrlKey&&l.altKey)}function FS(l){switch(l){case"compositionstart":return"onCompositionStart";case"compositionend":return"onCompositionEnd";case"compositionupdate":return"onCompositionUpdate"}}function sI(l,c){return l==="keydown"&&c.keyCode===Gf}function zS(l,c){switch(l){case"keyup":return HS.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==Gf;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oI(l){var c=l.detail;return typeof c=="object"&&"data"in c?c.data:null}function NN(l){return l.locale==="ko"}var Kf=!1;function VS(l,c,p,v,w){var R,P;if(Gv?R=FS(c):Kf?zS(c,v)&&(R="onCompositionEnd"):sI(c,v)&&(R="onCompositionStart"),!R)return null;nI&&!NN(v)&&(!Kf&&R==="onCompositionStart"?Kf=AS(w):R==="onCompositionEnd"&&Kf&&(P=Xy()));var $=hI(p,R);if($.length>0){var Y=new wN(R,c,null,v,w);if(l.push({event:Y,listeners:$}),P)Y.data=P;else{var le=oI(v);le!==null&&(Y.data=le)}}}function kN(l,c){switch(l){case"compositionend":return oI(c);case"keypress":var p=c.which;return p!==LS?null:(EN=!0,rI);case"textInput":var v=c.data;return v===rI&&EN?null:v;default:return null}}function BS(l,c){if(Kf){if(l==="compositionend"||!Gv&&zS(l,c)){var p=Xy();return Wf(),Kf=!1,p}return null}switch(l){case"paste":return null;case"keypress":if(!$S(c)){if(c.char&&c.char.length>1)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return nI&&!NN(c)?null:c.data;default:return null}}function aI(l,c,p,v,w){var R;if(_N?R=kN(c,v):R=BS(c,v),!R)return null;var P=hI(p,"onBeforeInput");if(P.length>0){var $=new ZO("onBeforeInput","beforeinput",null,v,w);l.push({event:$,listeners:P}),$.data=R}}function R6(l,c,p,v,w,R,P){VS(l,c,p,v,w),aI(l,c,p,v,w)}var WS={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 lI(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c==="input"?!!WS[l.type]:c==="textarea"}/** * Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, * `reset`, `load`, `error`, and `select`. * * Borrows from Modernizr. * * @param {string} eventNameSuffix Event name, e.g. "click". * @return {boolean} True if the event is supported. * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT */function nx(l){if(!O)return!1;var c="on"+l,p=c in document;if(!p){var v=document.createElement("div");v.setAttribute(c,"return;"),p=typeof v[c]=="function"}return p}function _6(){_("onChange",["change","click","focusin","focusout","input","keydown","keyup","selectionchange"])}function rx(l,c,p,v){$E(v);var w=hI(c,"onChange");if(w.length>0){var R=new uc("onChange","change",null,p,v);l.push({event:R,listeners:w})}}var d=null,f=null;function b(l){var c=l.nodeName&&l.nodeName.toLowerCase();return c==="select"||c==="input"&&l.type==="file"}function S(l){var c=[];rx(c,f,l,BC(l)),wO(T,c)}function T(l){Mre(l,0)}function A(l){var c=XS(l);if(Ui(c))return l}function ee(l,c){if(l==="change")return c}var ye=!1;O&&(ye=nx("input")&&(!document.documentMode||document.documentMode>9));function ke(l,c){d=l,f=c,d.attachEvent("onpropertychange",Nt)}function rt(){d&&(d.detachEvent("onpropertychange",Nt),d=null,f=null)}function Nt(l){l.propertyName==="value"&&A(f)&&S(l)}function Pt(l,c,p){l==="focusin"?(rt(),ke(c,p)):l==="focusout"&&rt()}function Et(l,c){if(l==="selectionchange"||l==="keyup"||l==="keydown")return A(f)}function hn(l){var c=l.nodeName;return c&&c.toLowerCase()==="input"&&(l.type==="checkbox"||l.type==="radio")}function xn(l,c){if(l==="click")return A(c)}function Rn(l,c){if(l==="input"||l==="change")return A(c)}function Gs(l){var c=l._wrapperState;!c||!c.controlled||l.type!=="number"||It(l,"number",l.value)}function We(l,c,p,v,w,R,P){var $=p?XS(p):window,Y,le;if(b($)?Y=ee:lI($)?ye?Y=Rn:(Y=Et,le=Pt):hn($)&&(Y=xn),Y){var ue=Y(c,p);if(ue){rx(l,ue,v,w);return}}le&&le(c,$,p),c==="focusout"&&Gs($)}function De(){N("onMouseEnter",["mouseout","mouseover"]),N("onMouseLeave",["mouseout","mouseover"]),N("onPointerEnter",["pointerout","pointerover"]),N("onPointerLeave",["pointerout","pointerover"])}function Xe(l,c,p,v,w,R,P){var $=c==="mouseover"||c==="pointerover",Y=c==="mouseout"||c==="pointerout";if($&&!u6(v)){var le=v.relatedTarget||v.fromElement;if(le&&(ox(le)||VN(le)))return}if(!(!Y&&!$)){var ue;if(w.window===w)ue=w;else{var He=w.ownerDocument;He?ue=He.defaultView||He.parentWindow:ue=window}var Ie,et;if(Y){var it=v.relatedTarget||v.toElement;if(Ie=p,et=it?ox(it):null,et!==null){var mt=Ua(et);(et!==mt||et.tag!==E&&et.tag!==M)&&(et=null)}}else Ie=null,et=p;if(Ie!==et){var Zt=OS,$n="onMouseLeave",Tn="onMouseEnter",Xr="mouse";(c==="pointerout"||c==="pointerover")&&(Zt=SN,$n="onPointerLeave",Tn="onPointerEnter",Xr="pointer");var zr=Ie==null?ue:XS(Ie),Ue=et==null?ue:XS(et),pt=new Zt($n,Xr+"leave",Ie,v,w);pt.target=zr,pt.relatedTarget=Ue;var Ye=null,At=ox(w);if(At===p){var pn=new Zt(Tn,Xr+"enter",et,v,w);pn.target=Ue,pn.relatedTarget=zr,Ye=pn}r6e(l,pt,Ye,Ie,et)}}}function Ht(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var on=typeof Object.is=="function"?Object.is:Ht;function On(l,c){if(on(l,c))return!0;if(typeof l!="object"||l===null||typeof c!="object"||c===null)return!1;var p=Object.keys(l),v=Object.keys(c);if(p.length!==v.length)return!1;for(var w=0;w<p.length;w++){var R=p[w];if(!G.call(c,R)||!on(l[R],c[R]))return!1}return!0}function zn(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function er(l){for(;l;){if(l.nextSibling)return l.nextSibling;l=l.parentNode}}function ko(l,c){for(var p=zn(l),v=0,w=0;p;){if(p.nodeType===fh){if(w=v+p.textContent.length,v<=c&&w>=c)return{node:p,offset:c-v};v=w}p=zn(er(p))}}function oi(l){var c=l.ownerDocument,p=c&&c.defaultView||window,v=p.getSelection&&p.getSelection();if(!v||v.rangeCount===0)return null;var w=v.anchorNode,R=v.anchorOffset,P=v.focusNode,$=v.focusOffset;try{w.nodeType,P.nodeType}catch{return null}return qf(l,w,R,P,$)}function qf(l,c,p,v,w){var R=0,P=-1,$=-1,Y=0,le=0,ue=l,He=null;e:for(;;){for(var Ie=null;ue===c&&(p===0||ue.nodeType===fh)&&(P=R+p),ue===v&&(w===0||ue.nodeType===fh)&&($=R+w),ue.nodeType===fh&&(R+=ue.nodeValue.length),(Ie=ue.firstChild)!==null;)He=ue,ue=Ie;for(;;){if(ue===l)break e;if(He===c&&++Y===p&&(P=R),He===v&&++le===w&&($=R),(Ie=ue.nextSibling)!==null)break;ue=He,He=ue.parentNode}ue=Ie}return P===-1||$===-1?null:{start:P,end:$}}function E6(l,c){var p=l.ownerDocument||document,v=p&&p.defaultView||window;if(v.getSelection){var w=v.getSelection(),R=l.textContent.length,P=Math.min(c.start,R),$=c.end===void 0?P:Math.min(c.end,R);if(!w.extend&&P>$){var Y=$;$=P,P=Y}var le=ko(l,P),ue=ko(l,$);if(le&&ue){if(w.rangeCount===1&&w.anchorNode===le.node&&w.anchorOffset===le.offset&&w.focusNode===ue.node&&w.focusOffset===ue.offset)return;var He=p.createRange();He.setStart(le.node,le.offset),w.removeAllRanges(),P>$?(w.addRange(He),w.extend(ue.node,ue.offset)):(He.setEnd(ue.node,ue.offset),w.addRange(He))}}}function yre(l){return l&&l.nodeType===fh}function xre(l,c){return!l||!c?!1:l===c?!0:yre(l)?!1:yre(c)?xre(l,c.parentNode):"contains"in l?l.contains(c):l.compareDocumentPosition?!!(l.compareDocumentPosition(c)&16):!1}function $3e(l){return l&&l.ownerDocument&&xre(l.ownerDocument.documentElement,l)}function F3e(l){try{return typeof l.contentWindow.location.href=="string"}catch{return!1}}function wre(){for(var l=window,c=Ji();c instanceof l.HTMLIFrameElement;){if(F3e(c))l=c.contentWindow;else return c;c=Ji(l.document)}return c}function N6(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c&&(c==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||c==="textarea"||l.contentEditable==="true")}function z3e(){var l=wre();return{focusedElem:l,selectionRange:N6(l)?B3e(l):null}}function V3e(l){var c=wre(),p=l.focusedElem,v=l.selectionRange;if(c!==p&&$3e(p)){v!==null&&N6(p)&&W3e(p,v);for(var w=[],R=p;R=R.parentNode;)R.nodeType===Sl&&w.push({element:R,left:R.scrollLeft,top:R.scrollTop});typeof p.focus=="function"&&p.focus();for(var P=0;P<w.length;P++){var $=w[P];$.element.scrollLeft=$.left,$.element.scrollTop=$.top}}}function B3e(l){var c;return"selectionStart"in l?c={start:l.selectionStart,end:l.selectionEnd}:c=oi(l),c||{start:0,end:0}}function W3e(l,c){var p=c.start,v=c.end;v===void 0&&(v=p),"selectionStart"in l?(l.selectionStart=p,l.selectionEnd=Math.min(v,l.value.length)):E6(l,c)}var U3e=O&&"documentMode"in document&&document.documentMode<=11;function Y3e(){_("onSelect",["focusout","contextmenu","dragend","focusin","keydown","keyup","mousedown","mouseup","selectionchange"])}var US=null,k6=null,TN=null,T6=!1;function G3e(l){if("selectionStart"in l&&N6(l))return{start:l.selectionStart,end:l.selectionEnd};var c=l.ownerDocument&&l.ownerDocument.defaultView||window,p=c.getSelection();return{anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}}function K3e(l){return l.window===l?l.document:l.nodeType===mh?l:l.ownerDocument}function Cre(l,c,p){var v=K3e(p);if(!(T6||US==null||US!==Ji(v))){var w=G3e(US);if(!TN||!On(TN,w)){TN=w;var R=hI(k6,"onSelect");if(R.length>0){var P=new uc("onSelect","select",null,c,p);l.push({event:P,listeners:R}),P.target=US}}}}function q3e(l,c,p,v,w,R,P){var $=p?XS(p):window;switch(c){case"focusin":(lI($)||$.contentEditable==="true")&&(US=$,k6=p,TN=null);break;case"focusout":US=null,k6=null,TN=null;break;case"mousedown":T6=!0;break;case"contextmenu":case"mouseup":case"dragend":T6=!1,Cre(l,v,w);break;case"selectionchange":if(U3e)break;case"keydown":case"keyup":Cre(l,v,w)}}function cI(l,c){var p={};return p[l.toLowerCase()]=c.toLowerCase(),p["Webkit"+l]="webkit"+c,p["Moz"+l]="moz"+c,p}var YS={animationend:cI("Animation","AnimationEnd"),animationiteration:cI("Animation","AnimationIteration"),animationstart:cI("Animation","AnimationStart"),transitionend:cI("Transition","TransitionEnd")},j6={},Sre={};O&&(Sre=document.createElement("div").style,"AnimationEvent"in window||(delete YS.animationend.animation,delete YS.animationiteration.animation,delete YS.animationstart.animation),"TransitionEvent"in window||delete YS.transitionend.transition);function uI(l){if(j6[l])return j6[l];if(!YS[l])return l;var c=YS[l];for(var p in c)if(c.hasOwnProperty(p)&&p in Sre)return j6[l]=c[p];return l}var Rre=uI("animationend"),_re=uI("animationiteration"),Ere=uI("animationstart"),Nre=uI("transitionend"),kre=new Map,Tre=["abort","auxClick","cancel","canPlay","canPlayThrough","click","close","contextMenu","copy","cut","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","durationChange","emptied","encrypted","ended","error","gotPointerCapture","input","invalid","keyDown","keyPress","keyUp","load","loadedData","loadedMetadata","loadStart","lostPointerCapture","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","paste","pause","play","playing","pointerCancel","pointerDown","pointerMove","pointerOut","pointerOver","pointerUp","progress","rateChange","reset","resize","seeked","seeking","stalled","submit","suspend","timeUpdate","touchCancel","touchEnd","touchStart","volumeChange","scroll","toggle","touchMove","waiting","wheel"];function Kv(l,c){kre.set(l,c),_(c,[l])}function X3e(){for(var l=0;l<Tre.length;l++){var c=Tre[l],p=c.toLowerCase(),v=c[0].toUpperCase()+c.slice(1);Kv(p,"on"+v)}Kv(Rre,"onAnimationEnd"),Kv(_re,"onAnimationIteration"),Kv(Ere,"onAnimationStart"),Kv("dblclick","onDoubleClick"),Kv("focusin","onFocus"),Kv("focusout","onBlur"),Kv(Nre,"onTransitionEnd")}function Q3e(l,c,p,v,w,R,P){var $=kre.get(c);if($!==void 0){var Y=uc,le=c;switch(c){case"keypress":if(Uv(v)===0)return;case"keydown":case"keyup":Y=x6;break;case"focusin":le="focus",Y=IS;break;case"focusout":le="blur",Y=IS;break;case"beforeblur":case"afterblur":Y=IS;break;case"click":if(v.button===2)return;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=OS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=yN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=C6;break;case Rre:case _re:case Ere:Y=xN;break;case Nre:Y=RN;break;case"scroll":Y=XO;break;case"wheel":Y=Yf;break;case"copy":case"cut":case"paste":Y=v6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=SN;break}var ue=(R&fp)!==0;{var He=!ue&&c==="scroll",Ie=t6e(p,$,v.type,ue,He);if(Ie.length>0){var et=new Y($,le,null,v,w);l.push({event:et,listeners:Ie})}}}}X3e(),De(),_6(),Y3e(),iI();function Z3e(l,c,p,v,w,R,P){Q3e(l,c,p,v,w,R);var $=(R&LE)===0;$&&(Xe(l,c,p,v,w),We(l,c,p,v,w),q3e(l,c,p,v,w),R6(l,c,p,v,w))}var jN=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","resize","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],M6=new Set(["cancel","close","invalid","load","scroll","toggle"].concat(jN));function jre(l,c,p){var v=l.type||"unknown-event";l.currentTarget=p,_y(v,c,void 0,l),l.currentTarget=null}function J3e(l,c,p){var v;if(p)for(var w=c.length-1;w>=0;w--){var R=c[w],P=R.instance,$=R.currentTarget,Y=R.listener;if(P!==v&&l.isPropagationStopped())return;jre(l,Y,$),v=P}else for(var le=0;le<c.length;le++){var ue=c[le],He=ue.instance,Ie=ue.currentTarget,et=ue.listener;if(He!==v&&l.isPropagationStopped())return;jre(l,et,Ie),v=He}}function Mre(l,c){for(var p=(c&fp)!==0,v=0;v<l.length;v++){var w=l[v],R=w.event,P=w.listeners;J3e(R,P,p)}ph()}function e6e(l,c,p,v,w){var R=BC(p),P=[];Z3e(P,l,v,p,R,c),Mre(P,c)}function bs(l,c){M6.has(l)||u('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.',l);var p=!1,v=jBe(c),w=i6e(l);v.has(w)||(Pre(c,l,xd,p),v.add(w))}function P6(l,c,p){M6.has(l)&&!c&&u('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.',l);var v=0;c&&(v|=fp),Pre(p,l,v,c)}var dI="_reactListening"+Math.random().toString(36).slice(2);function MN(l){if(!l[dI]){l[dI]=!0,qe.forEach(function(p){p!=="selectionchange"&&(M6.has(p)||P6(p,!1,l),P6(p,!0,l))});var c=l.nodeType===mh?l:l.ownerDocument;c!==null&&(c[dI]||(c[dI]=!0,P6("selectionchange",!1,c)))}}function Pre(l,c,p,v,w){var R=lc(l,c,p),P=void 0;Ry&&(c==="touchstart"||c==="touchmove"||c==="wheel")&&(P=!0),l=l,v?P!==void 0?Bv(l,c,R,P):bN(l,c,R):P!==void 0?xh(l,c,R,P):Pl(l,c,R)}function Are(l,c){return l===c||l.nodeType===so&&l.parentNode===c}function A6(l,c,p,v,w){var R=v;if(!(c&HE)&&!(c&xd)){var P=w;if(v!==null){var $=v;e:for(;;){if($===null)return;var Y=$.tag;if(Y===x||Y===C){var le=$.stateNode.containerInfo;if(Are(le,P))break;if(Y===C)for(var ue=$.return;ue!==null;){var He=ue.tag;if(He===x||He===C){var Ie=ue.stateNode.containerInfo;if(Are(Ie,P))return}ue=ue.return}for(;le!==null;){var et=ox(le);if(et===null)return;var it=et.tag;if(it===E||it===M){$=R=et;continue e}le=le.parentNode}}$=$.return}}}wO(function(){return e6e(l,c,p,R)})}function PN(l,c,p){return{instance:l,listener:c,currentTarget:p}}function t6e(l,c,p,v,w,R){for(var P=c!==null?c+"Capture":null,$=v?P:c,Y=[],le=l,ue=null;le!==null;){var He=le,Ie=He.stateNode,et=He.tag;if(et===E&&Ie!==null&&(ue=Ie,$!==null)){var it=pp(le,$);it!=null&&Y.push(PN(le,it,ue))}if(w)break;le=le.return}return Y}function hI(l,c){for(var p=c+"Capture",v=[],w=l;w!==null;){var R=w,P=R.stateNode,$=R.tag;if($===E&&P!==null){var Y=P,le=pp(w,p);le!=null&&v.unshift(PN(w,le,Y));var ue=pp(w,c);ue!=null&&v.push(PN(w,ue,Y))}w=w.return}return v}function GS(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==E);return l||null}function n6e(l,c){for(var p=l,v=c,w=0,R=p;R;R=GS(R))w++;for(var P=0,$=v;$;$=GS($))P++;for(;w-P>0;)p=GS(p),w--;for(;P-w>0;)v=GS(v),P--;for(var Y=w;Y--;){if(p===v||v!==null&&p===v.alternate)return p;p=GS(p),v=GS(v)}return null}function Ore(l,c,p,v,w){for(var R=c._reactName,P=[],$=p;$!==null&&$!==v;){var Y=$,le=Y.alternate,ue=Y.stateNode,He=Y.tag;if(le!==null&&le===v)break;if(He===E&&ue!==null){var Ie=ue;if(w){var et=pp($,R);et!=null&&P.unshift(PN($,et,Ie))}else if(!w){var it=pp($,R);it!=null&&P.push(PN($,it,Ie))}}$=$.return}P.length!==0&&l.push({event:c,listeners:P})}function r6e(l,c,p,v,w){var R=v&&w?n6e(v,w):null;v!==null&&Ore(l,c,v,R,!1),w!==null&&p!==null&&Ore(l,p,w,R,!0)}function i6e(l,c){return l+"__bubble"}var Gc=!1,AN="dangerouslySetInnerHTML",fI="suppressContentEditableWarning",qv="suppressHydrationWarning",Ire="autoFocus",ix="children",sx="style",mI="__html",O6,pI,ON,Dre,gI,Hre,Lre;O6={dialog:!0,webview:!0},pI=function(l,c){pO(l,c),Sv(l,c),xO(l,c,{registrationNameDependencies:we,possibleRegistrationNames:k})},Hre=O&&!document.documentMode,ON=function(l,c,p){if(!Gc){var v=vI(p),w=vI(c);w!==v&&(Gc=!0,u("Prop `%s` did not match. Server: %s Client: %s",l,JSON.stringify(w),JSON.stringify(v)))}},Dre=function(l){if(!Gc){Gc=!0;var c=[];l.forEach(function(p){c.push(p)}),u("Extra attributes from the server: %s",c)}},gI=function(l,c){c===!1?u("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.",l,l,l):u("Expected `%s` listener to be a function, instead got a value of `%s` type.",l,typeof c)},Lre=function(l,c){var p=l.namespaceURI===ku?l.ownerDocument.createElement(l.tagName):l.ownerDocument.createElementNS(l.namespaceURI,l.tagName);return p.innerHTML=c,p.innerHTML};var s6e=/\r\n?/g,o6e=/\u0000|\uFFFD/g;function vI(l){Me(l);var c=typeof l=="string"?l:""+l;return c.replace(s6e,` `).replace(o6e,"")}function bI(l,c,p,v){var w=vI(c),R=vI(l);if(R!==w&&(v&&(Gc||(Gc=!0,u('Text content did not match. Server: "%s" Client: "%s"',R,w))),p&&Re))throw new Error("Text content does not match server-rendered HTML.")}function $re(l){return l.nodeType===mh?l:l.ownerDocument}function a6e(){}function yI(l){l.onclick=a6e}function l6e(l,c,p,v,w){for(var R in v)if(v.hasOwnProperty(R)){var P=v[R];if(R===sx)P&&Object.freeze(P),uO(c,P);else if(R===AN){var $=P?P[mI]:void 0;$!=null&&ZA(c,$)}else if(R===ix)if(typeof P=="string"){var Y=l!=="textarea"||P!=="";Y&&kf(c,P)}else typeof P=="number"&&kf(c,""+P);else R===fI||R===qv||R===Ire||(we.hasOwnProperty(R)?P!=null&&(typeof P!="function"&&gI(R,P),R==="onScroll"&&bs("scroll",c)):P!=null&&zt(c,R,P,w))}}function c6e(l,c,p,v){for(var w=0;w<c.length;w+=2){var R=c[w],P=c[w+1];R===sx?uO(l,P):R===AN?ZA(l,P):R===ix?kf(l,P):zt(l,R,P,v)}}function u6e(l,c,p,v){var w,R=$re(p),P,$=v;if($===ku&&($=ME(l)),$===ku){if(w=Tf(l,c),!w&&l!==l.toLowerCase()&&u("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.",l),l==="script"){var Y=R.createElement("div");Y.innerHTML="<script><\/script>";var le=Y.firstChild;P=Y.removeChild(le)}else if(typeof c.is=="string")P=R.createElement(l,{is:c.is});else if(P=R.createElement(l),l==="select"){var ue=P;c.multiple?ue.multiple=!0:c.size&&(ue.size=c.size)}}else P=R.createElementNS($,l);return $===ku&&!w&&Object.prototype.toString.call(P)==="[object HTMLUnknownElement]"&&!G.call(O6,l)&&(O6[l]=!0,u("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.",l)),P}function d6e(l,c){return $re(c).createTextNode(l)}function h6e(l,c,p,v){var w=Tf(c,p);pI(c,p);var R;switch(c){case"dialog":bs("cancel",l),bs("close",l),R=p;break;case"iframe":case"object":case"embed":bs("load",l),R=p;break;case"video":case"audio":for(var P=0;P<jN.length;P++)bs(jN[P],l);R=p;break;case"source":bs("error",l),R=p;break;case"img":case"image":case"link":bs("error",l),bs("load",l),R=p;break;case"details":bs("toggle",l),R=p;break;case"input":vs(l,p),R=pr(l,p),bs("invalid",l);break;case"option":si(l,p),R=p;break;case"select":hy(l,p),R=hp(l,p),bs("invalid",l);break;case"textarea":qA(l,p),R=HC(l,p),bs("invalid",l);break;default:R=p}switch(zC(c,R),l6e(c,l,v,R,w),c){case"input":Rr(l),Be(l,p,!1);break;case"textarea":Rr(l),QA(l);break;case"option":Pi(l,p);break;case"select":kE(l,p);break;default:typeof R.onClick=="function"&&yI(l);break}}function f6e(l,c,p,v,w){pI(c,v);var R=null,P,$;switch(c){case"input":P=pr(l,p),$=pr(l,v),R=[];break;case"select":P=hp(l,p),$=hp(l,v),R=[];break;case"textarea":P=HC(l,p),$=HC(l,v),R=[];break;default:P=p,$=v,typeof P.onClick!="function"&&typeof $.onClick=="function"&&yI(l);break}zC(c,$);var Y,le,ue=null;for(Y in P)if(!($.hasOwnProperty(Y)||!P.hasOwnProperty(Y)||P[Y]==null))if(Y===sx){var He=P[Y];for(le in He)He.hasOwnProperty(le)&&(ue||(ue={}),ue[le]="")}else Y===AN||Y===ix||Y===fI||Y===qv||Y===Ire||(we.hasOwnProperty(Y)?R||(R=[]):(R=R||[]).push(Y,null));for(Y in $){var Ie=$[Y],et=P!=null?P[Y]:void 0;if(!(!$.hasOwnProperty(Y)||Ie===et||Ie==null&&et==null))if(Y===sx)if(Ie&&Object.freeze(Ie),et){for(le in et)et.hasOwnProperty(le)&&(!Ie||!Ie.hasOwnProperty(le))&&(ue||(ue={}),ue[le]="");for(le in Ie)Ie.hasOwnProperty(le)&&et[le]!==Ie[le]&&(ue||(ue={}),ue[le]=Ie[le])}else ue||(R||(R=[]),R.push(Y,ue)),ue=Ie;else if(Y===AN){var it=Ie?Ie[mI]:void 0,mt=et?et[mI]:void 0;it!=null&&mt!==it&&(R=R||[]).push(Y,it)}else Y===ix?(typeof Ie=="string"||typeof Ie=="number")&&(R=R||[]).push(Y,""+Ie):Y===fI||Y===qv||(we.hasOwnProperty(Y)?(Ie!=null&&(typeof Ie!="function"&&gI(Y,Ie),Y==="onScroll"&&bs("scroll",l)),!R&&et!==Ie&&(R=[])):(R=R||[]).push(Y,Ie))}return ue&&(Tu(ue,$[sx]),(R=R||[]).push(sx,ue)),R}function m6e(l,c,p,v,w){p==="input"&&w.type==="radio"&&w.name!=null&&K(l,w);var R=Tf(p,v),P=Tf(p,w);switch(c6e(l,c,R,P),p){case"input":be(l,w);break;case"textarea":XA(l,w);break;case"select":DC(l,w);break}}function p6e(l){{var c=l.toLowerCase();return xv.hasOwnProperty(c)&&xv[c]||null}}function g6e(l,c,p,v,w,R,P){var $,Y;switch($=Tf(c,p),pI(c,p),c){case"dialog":bs("cancel",l),bs("close",l);break;case"iframe":case"object":case"embed":bs("load",l);break;case"video":case"audio":for(var le=0;le<jN.length;le++)bs(jN[le],l);break;case"source":bs("error",l);break;case"img":case"image":case"link":bs("error",l),bs("load",l);break;case"details":bs("toggle",l);break;case"input":vs(l,p),bs("invalid",l);break;case"option":si(l,p);break;case"select":hy(l,p),bs("invalid",l);break;case"textarea":qA(l,p),bs("invalid",l);break}zC(c,p);{Y=new Set;for(var ue=l.attributes,He=0;He<ue.length;He++){var Ie=ue[He].name.toLowerCase();switch(Ie){case"value":break;case"checked":break;case"selected":break;default:Y.add(ue[He].name)}}}var et=null;for(var it in p)if(p.hasOwnProperty(it)){var mt=p[it];if(it===ix)typeof mt=="string"?l.textContent!==mt&&(p[qv]!==!0&&bI(l.textContent,mt,R,P),et=[ix,mt]):typeof mt=="number"&&l.textContent!==""+mt&&(p[qv]!==!0&&bI(l.textContent,mt,R,P),et=[ix,""+mt]);else if(we.hasOwnProperty(it))mt!=null&&(typeof mt!="function"&&gI(it,mt),it==="onScroll"&&bs("scroll",l));else if(P&&typeof $=="boolean"){var Zt=void 0,$n=wt(it);if(p[qv]!==!0){if(!(it===fI||it===qv||it==="value"||it==="checked"||it==="selected")){if(it===AN){var Tn=l.innerHTML,Xr=mt?mt[mI]:void 0;if(Xr!=null){var zr=Lre(l,Xr);zr!==Tn&&ON(it,Tn,zr)}}else if(it===sx){if(Y.delete(it),Hre){var Ue=a6(mt);Zt=l.getAttribute("style"),Ue!==Zt&&ON(it,Zt,Ue)}}else if($&&!fe)Y.delete(it.toLowerCase()),Zt=Kt(l,it,mt),mt!==Zt&&ON(it,Zt,mt);else if(!je(it,$n,$)&&!ut(it,mt,$n,$)){var pt=!1;if($n!==null)Y.delete($n.attributeName),Zt=kn(l,it,mt,$n);else{var Ye=v;if(Ye===ku&&(Ye=ME(c)),Ye===ku)Y.delete(it.toLowerCase());else{var At=p6e(it);At!==null&&At!==it&&(pt=!0,Y.delete(At)),Y.delete(it)}Zt=Kt(l,it,mt)}var pn=fe;!pn&&mt!==Zt&&!pt&&ON(it,Zt,mt)}}}}}switch(P&&Y.size>0&&p[qv]!==!0&&Dre(Y),c){case"input":Rr(l),Be(l,p,!0);break;case"textarea":Rr(l),QA(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&yI(l);break}return et}function v6e(l,c,p){var v=l.nodeValue!==c;return v}function I6(l,c){{if(Gc)return;Gc=!0,u("Did not expect server HTML to contain a <%s> in <%s>.",c.nodeName.toLowerCase(),l.nodeName.toLowerCase())}}function D6(l,c){{if(Gc)return;Gc=!0,u('Did not expect server HTML to contain the text node "%s" in <%s>.',c.nodeValue,l.nodeName.toLowerCase())}}function H6(l,c,p){{if(Gc)return;Gc=!0,u("Expected server HTML to contain a matching <%s> in <%s>.",c,l.nodeName.toLowerCase())}}function L6(l,c){{if(c===""||Gc)return;Gc=!0,u('Expected server HTML to contain a matching text node for "%s" in <%s>.',c,l.nodeName.toLowerCase())}}function b6e(l,c,p){switch(c){case"input":at(l,p);return;case"textarea":e6(l,p);return;case"select":TE(l,p);return}}var IN=function(){},DN=function(){};{var y6e=["address","applet","area","article","aside","base","basefont","bgsound","blockquote","body","br","button","caption","center","col","colgroup","dd","details","dir","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","iframe","img","input","isindex","li","link","listing","main","marquee","menu","menuitem","meta","nav","noembed","noframes","noscript","object","ol","p","param","plaintext","pre","script","section","select","source","style","summary","table","tbody","td","template","textarea","tfoot","th","thead","title","tr","track","ul","wbr","xmp"],Fre=["applet","caption","html","table","td","th","marquee","object","template","foreignObject","desc","title"],x6e=Fre.concat(["button"]),w6e=["dd","dt","li","option","optgroup","p","rp","rt"],zre={current:null,formTag:null,aTagInScope:null,buttonTagInScope:null,nobrTagInScope:null,pTagInButtonScope:null,listItemTagAutoclosing:null,dlItemTagAutoclosing:null};DN=function(l,c){var p=Bt({},l||zre),v={tag:c};return Fre.indexOf(c)!==-1&&(p.aTagInScope=null,p.buttonTagInScope=null,p.nobrTagInScope=null),x6e.indexOf(c)!==-1&&(p.pTagInButtonScope=null),y6e.indexOf(c)!==-1&&c!=="address"&&c!=="div"&&c!=="p"&&(p.listItemTagAutoclosing=null,p.dlItemTagAutoclosing=null),p.current=v,c==="form"&&(p.formTag=v),c==="a"&&(p.aTagInScope=v),c==="button"&&(p.buttonTagInScope=v),c==="nobr"&&(p.nobrTagInScope=v),c==="p"&&(p.pTagInButtonScope=v),c==="li"&&(p.listItemTagAutoclosing=v),(c==="dd"||c==="dt")&&(p.dlItemTagAutoclosing=v),p};var C6e=function(l,c){switch(c){case"select":return l==="option"||l==="optgroup"||l==="#text";case"optgroup":return l==="option"||l==="#text";case"option":return l==="#text";case"tr":return l==="th"||l==="td"||l==="style"||l==="script"||l==="template";case"tbody":case"thead":case"tfoot":return l==="tr"||l==="style"||l==="script"||l==="template";case"colgroup":return l==="col"||l==="template";case"table":return l==="caption"||l==="colgroup"||l==="tbody"||l==="tfoot"||l==="thead"||l==="style"||l==="script"||l==="template";case"head":return l==="base"||l==="basefont"||l==="bgsound"||l==="link"||l==="meta"||l==="title"||l==="noscript"||l==="noframes"||l==="style"||l==="script"||l==="template";case"html":return l==="head"||l==="body"||l==="frameset";case"frameset":return l==="frame";case"#document":return l==="html"}switch(l){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return c!=="h1"&&c!=="h2"&&c!=="h3"&&c!=="h4"&&c!=="h5"&&c!=="h6";case"rp":case"rt":return w6e.indexOf(c)===-1;case"body":case"caption":case"col":case"colgroup":case"frameset":case"frame":case"head":case"html":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return c==null}return!0},S6e=function(l,c){switch(l){case"address":case"article":case"aside":case"blockquote":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"main":case"menu":case"nav":case"ol":case"p":case"section":case"summary":case"ul":case"pre":case"listing":case"table":case"hr":case"xmp":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return c.pTagInButtonScope;case"form":return c.formTag||c.pTagInButtonScope;case"li":return c.listItemTagAutoclosing;case"dd":case"dt":return c.dlItemTagAutoclosing;case"button":return c.buttonTagInScope;case"a":return c.aTagInScope;case"nobr":return c.nobrTagInScope}return null},Vre={};IN=function(l,c,p){p=p||zre;var v=p.current,w=v&&v.tag;c!=null&&(l!=null&&u("validateDOMNesting: when childText is passed, childTag should be null"),l="#text");var R=C6e(l,w)?null:v,P=R?null:S6e(l,p),$=R||P;if($){var Y=$.tag,le=!!R+"|"+l+"|"+Y;if(!Vre[le]){Vre[le]=!0;var ue=l,He="";if(l==="#text"?/\S/.test(c)?ue="Text nodes":(ue="Whitespace text nodes",He=" Make sure you don't have any extra whitespace between tags on each line of your source code."):ue="<"+l+">",R){var Ie="";Y==="table"&&l==="tr"&&(Ie+=" Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser."),u("validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s",ue,Y,He,Ie)}else u("validateDOMNesting(...): %s cannot appear as a descendant of <%s>.",ue,Y)}}}}var xI="suppressHydrationWarning",wI="$",CI="/$",HN="$?",LN="$!",R6e="style",$6=null,F6=null;function _6e(l){var c,p,v=l.nodeType;switch(v){case mh:case fy:{c=v===mh?"#document":"#fragment";var w=l.documentElement;p=w?w.namespaceURI:LC(null,"");break}default:{var R=v===so?l.parentNode:l,P=R.namespaceURI||null;c=R.tagName,p=LC(P,c);break}}{var $=c.toLowerCase(),Y=DN(null,$);return{namespace:p,ancestorInfo:Y}}}function E6e(l,c,p){{var v=l,w=LC(v.namespace,c),R=DN(v.ancestorInfo,c);return{namespace:w,ancestorInfo:R}}}function h7e(l){return l}function N6e(l){$6=fa(),F6=z3e();var c=null;return Ys(!1),c}function k6e(l){V3e(F6),Ys($6),$6=null,F6=null}function T6e(l,c,p,v,w){var R;{var P=v;if(IN(l,null,P.ancestorInfo),typeof c.children=="string"||typeof c.children=="number"){var $=""+c.children,Y=DN(P.ancestorInfo,l);IN(null,$,Y)}R=P.namespace}var le=u6e(l,c,p,R);return zN(w,le),K6(le,c),le}function j6e(l,c){l.appendChild(c)}function M6e(l,c,p,v,w){switch(h6e(l,c,p,v),c){case"button":case"input":case"select":case"textarea":return!!p.autoFocus;case"img":return!0;default:return!1}}function P6e(l,c,p,v,w,R){{var P=R;if(typeof v.children!=typeof p.children&&(typeof v.children=="string"||typeof v.children=="number")){var $=""+v.children,Y=DN(P.ancestorInfo,c);IN(null,$,Y)}}return f6e(l,c,p,v)}function z6(l,c){return l==="textarea"||l==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}function A6e(l,c,p,v){{var w=p;IN(null,l,w.ancestorInfo)}var R=d6e(l,c);return zN(v,R),R}function O6e(){var l=window.event;return l===void 0?da:Vv(l.type)}var V6=typeof setTimeout=="function"?setTimeout:void 0,I6e=typeof clearTimeout=="function"?clearTimeout:void 0,B6=-1,Bre=typeof Promise=="function"?Promise:void 0,D6e=typeof queueMicrotask=="function"?queueMicrotask:typeof Bre<"u"?function(l){return Bre.resolve(null).then(l).catch(H6e)}:V6;function H6e(l){setTimeout(function(){throw l})}function L6e(l,c,p,v){switch(c){case"button":case"input":case"select":case"textarea":p.autoFocus&&l.focus();return;case"img":{p.src&&(l.src=p.src);return}}}function $6e(l,c,p,v,w,R){m6e(l,c,p,v,w),K6(l,w)}function Wre(l){kf(l,"")}function F6e(l,c,p){l.nodeValue=p}function z6e(l,c){l.appendChild(c)}function V6e(l,c){var p;l.nodeType===so?(p=l.parentNode,p.insertBefore(c,l)):(p=l,p.appendChild(c));var v=l._reactRootContainer;v==null&&p.onclick===null&&yI(p)}function B6e(l,c,p){l.insertBefore(c,p)}function W6e(l,c,p){l.nodeType===so?l.parentNode.insertBefore(c,p):l.insertBefore(c,p)}function U6e(l,c){l.removeChild(c)}function Y6e(l,c){l.nodeType===so?l.parentNode.removeChild(c):l.removeChild(c)}function W6(l,c){var p=c,v=0;do{var w=p.nextSibling;if(l.removeChild(p),w&&w.nodeType===so){var R=w.data;if(R===CI)if(v===0){l.removeChild(w),Oa(c);return}else v--;else(R===wI||R===HN||R===LN)&&v++}p=w}while(p);Oa(c)}function G6e(l,c){l.nodeType===so?W6(l.parentNode,c):l.nodeType===Sl&&W6(l,c),Oa(l)}function K6e(l){l=l;var c=l.style;typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"}function q6e(l){l.nodeValue=""}function X6e(l,c){l=l;var p=c[R6e],v=p!=null&&p.hasOwnProperty("display")?p.display:null;l.style.display=FC("display",v)}function Q6e(l,c){l.nodeValue=c}function Z6e(l){l.nodeType===Sl?l.textContent="":l.nodeType===mh&&l.documentElement&&l.removeChild(l.documentElement)}function J6e(l,c,p){return l.nodeType!==Sl||c.toLowerCase()!==l.nodeName.toLowerCase()?null:l}function eBe(l,c){return c===""||l.nodeType!==fh?null:l}function tBe(l){return l.nodeType!==so?null:l}function Ure(l){return l.data===HN}function U6(l){return l.data===LN}function nBe(l){var c=l.nextSibling&&l.nextSibling.dataset,p,v,w;return c&&(p=c.dgst,v=c.msg,w=c.stck),{message:v,digest:p,stack:w}}function rBe(l,c){l._reactRetry=c}function SI(l){for(;l!=null;l=l.nextSibling){var c=l.nodeType;if(c===Sl||c===fh)break;if(c===so){var p=l.data;if(p===wI||p===LN||p===HN)break;if(p===CI)return null}}return l}function $N(l){return SI(l.nextSibling)}function iBe(l){return SI(l.firstChild)}function sBe(l){return SI(l.firstChild)}function oBe(l){return SI(l.nextSibling)}function aBe(l,c,p,v,w,R,P){zN(R,l),K6(l,p);var $;{var Y=w;$=Y.namespace}var le=(R.mode&jr)!==Pn;return g6e(l,c,p,$,v,le,P)}function lBe(l,c,p,v){return zN(p,l),p.mode&jr,v6e(l,c)}function cBe(l,c){zN(c,l)}function uBe(l){for(var c=l.nextSibling,p=0;c;){if(c.nodeType===so){var v=c.data;if(v===CI){if(p===0)return $N(c);p--}else(v===wI||v===LN||v===HN)&&p++}c=c.nextSibling}return null}function Yre(l){for(var c=l.previousSibling,p=0;c;){if(c.nodeType===so){var v=c.data;if(v===wI||v===LN||v===HN){if(p===0)return c;p--}else v===CI&&p++}c=c.previousSibling}return null}function dBe(l){Oa(l)}function hBe(l){Oa(l)}function fBe(l){return l!=="head"&&l!=="body"}function mBe(l,c,p,v){var w=!0;bI(c.nodeValue,p,v,w)}function pBe(l,c,p,v,w,R){if(c[xI]!==!0){var P=!0;bI(v.nodeValue,w,R,P)}}function gBe(l,c){c.nodeType===Sl?I6(l,c):c.nodeType===so||D6(l,c)}function vBe(l,c){{var p=l.parentNode;p!==null&&(c.nodeType===Sl?I6(p,c):c.nodeType===so||D6(p,c))}}function bBe(l,c,p,v,w){(w||c[xI]!==!0)&&(v.nodeType===Sl?I6(p,v):v.nodeType===so||D6(p,v))}function yBe(l,c,p){H6(l,c)}function xBe(l,c){L6(l,c)}function wBe(l,c,p){{var v=l.parentNode;v!==null&&H6(v,c)}}function CBe(l,c){{var p=l.parentNode;p!==null&&L6(p,c)}}function SBe(l,c,p,v,w,R){(R||c[xI]!==!0)&&H6(p,v)}function RBe(l,c,p,v,w){(w||c[xI]!==!0)&&L6(p,v)}function _Be(l){u("An error occurred during hydration. The server HTML was replaced with client content in <%s>.",l.nodeName.toLowerCase())}function EBe(l){MN(l)}var KS=Math.random().toString(36).slice(2),qS="__reactFiber$"+KS,Y6="__reactProps$"+KS,FN="__reactContainer$"+KS,G6="__reactEvents$"+KS,NBe="__reactListeners$"+KS,kBe="__reactHandles$"+KS;function TBe(l){delete l[qS],delete l[Y6],delete l[G6],delete l[NBe],delete l[kBe]}function zN(l,c){c[qS]=l}function RI(l,c){c[FN]=l}function Gre(l){l[FN]=null}function VN(l){return!!l[FN]}function ox(l){var c=l[qS];if(c)return c;for(var p=l.parentNode;p;){if(c=p[FN]||p[qS],c){var v=c.alternate;if(c.child!==null||v!==null&&v.child!==null)for(var w=Yre(l);w!==null;){var R=w[qS];if(R)return R;w=Yre(w)}return c}l=p,p=l.parentNode}return null}function Xv(l){var c=l[qS]||l[FN];return c&&(c.tag===E||c.tag===M||c.tag===F||c.tag===x)?c:null}function XS(l){if(l.tag===E||l.tag===M)return l.stateNode;throw new Error("getNodeFromInstance: Invalid argument.")}function _I(l){return l[Y6]||null}function K6(l,c){l[Y6]=c}function jBe(l){var c=l[G6];return c===void 0&&(c=l[G6]=new Set),c}var Kre={},qre=r.ReactDebugCurrentFrame;function EI(l){if(l){var c=l._owner,p=Nu(l.type,l._source,c?c.type:null);qre.setExtraStackFrame(p)}else qre.setExtraStackFrame(null)}function wh(l,c,p,v,w){{var R=Function.call.bind(G);for(var P in l)if(R(l,P)){var $=void 0;try{if(typeof l[P]!="function"){var Y=Error((v||"React class")+": "+p+" type `"+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof l[P]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Y.name="Invariant Violation",Y}$=l[P](c,P,v,p,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(le){$=le}$&&!($ instanceof Error)&&(EI(w),u("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",v||"React class",p,P,typeof $),EI(null)),$ instanceof Error&&!($.message in Kre)&&(Kre[$.message]=!0,EI(w),u("Failed %s type: %s",p,$.message),EI(null))}}}var q6=[],NI;NI=[];var Lp=-1;function Qv(l){return{current:l}}function Al(l,c){if(Lp<0){u("Unexpected pop.");return}c!==NI[Lp]&&u("Unexpected Fiber popped."),l.current=q6[Lp],q6[Lp]=null,NI[Lp]=null,Lp--}function Ol(l,c,p){Lp++,q6[Lp]=l.current,NI[Lp]=p,l.current=c}var X6;X6={};var Du={};Object.freeze(Du);var $p=Qv(Du),Xf=Qv(!1),Q6=Du;function QS(l,c,p){return p&&Qf(c)?Q6:$p.current}function Xre(l,c,p){{var v=l.stateNode;v.__reactInternalMemoizedUnmaskedChildContext=c,v.__reactInternalMemoizedMaskedChildContext=p}}function ZS(l,c){{var p=l.type,v=p.contextTypes;if(!v)return Du;var w=l.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===c)return w.__reactInternalMemoizedMaskedChildContext;var R={};for(var P in v)R[P]=c[P];{var $=_n(l)||"Unknown";wh(v,R,"context",$)}return w&&Xre(l,c,R),R}}function kI(){return Xf.current}function Qf(l){{var c=l.childContextTypes;return c!=null}}function TI(l){Al(Xf,l),Al($p,l)}function Z6(l){Al(Xf,l),Al($p,l)}function Qre(l,c,p){{if($p.current!==Du)throw new Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");Ol($p,c,l),Ol(Xf,p,l)}}function Zre(l,c,p){{var v=l.stateNode,w=c.childContextTypes;if(typeof v.getChildContext!="function"){{var R=_n(l)||"Unknown";X6[R]||(X6[R]=!0,u("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.",R,R))}return p}var P=v.getChildContext();for(var $ in P)if(!($ in w))throw new Error((_n(l)||"Unknown")+'.getChildContext(): key "'+$+'" is not defined in childContextTypes.');{var Y=_n(l)||"Unknown";wh(w,P,"child context",Y)}return Bt({},p,P)}}function jI(l){{var c=l.stateNode,p=c&&c.__reactInternalMemoizedMergedChildContext||Du;return Q6=$p.current,Ol($p,p,l),Ol(Xf,Xf.current,l),!0}}function Jre(l,c,p){{var v=l.stateNode;if(!v)throw new Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");if(p){var w=Zre(l,c,Q6);v.__reactInternalMemoizedMergedChildContext=w,Al(Xf,l),Al($p,l),Ol($p,w,l),Ol(Xf,p,l)}else Al(Xf,l),Ol(Xf,p,l)}}function MBe(l){{if(!_O(l)||l.tag!==g)throw new Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");var c=l;do{switch(c.tag){case x:return c.stateNode.context;case g:{var p=c.type;if(Qf(p))return c.stateNode.__reactInternalMemoizedMergedChildContext;break}}c=c.return}while(c!==null);throw new Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.")}}var Zv=0,MI=1,Fp=null,J6=!1,eB=!1;function eie(l){Fp===null?Fp=[l]:Fp.push(l)}function PBe(l){J6=!0,eie(l)}function tie(){J6&&Jv()}function Jv(){if(!eB&&Fp!==null){eB=!0;var l=0,c=ac();try{var p=!0,v=Fp;for(Eo(Ml);l<v.length;l++){var w=v[l];do w=w(p);while(w!==null)}Fp=null,J6=!1}catch(R){throw Fp!==null&&(Fp=Fp.slice(l+1)),YE(vh,Jv),R}finally{Eo(c),eB=!1}}return null}var JS=[],e1=0,PI=null,AI=0,Nd=[],kd=0,ax=null,zp=1,Vp="";function ABe(l){return cx(),(l.flags&Ny)!==Mn}function OBe(l){return cx(),AI}function IBe(){var l=Vp,c=zp,p=c&~DBe(c);return p.toString(32)+l}function lx(l,c){cx(),JS[e1++]=AI,JS[e1++]=PI,PI=l,AI=c}function nie(l,c,p){cx(),Nd[kd++]=zp,Nd[kd++]=Vp,Nd[kd++]=ax,ax=l;var v=zp,w=Vp,R=OI(v)-1,P=v&~(1<<R),$=p+1,Y=OI(c)+R;if(Y>30){var le=R-R%5,ue=(1<<le)-1,He=(P&ue).toString(32),Ie=P>>le,et=R-le,it=OI(c)+et,mt=$<<et,Zt=mt|Ie,$n=He+w;zp=1<<it|Zt,Vp=$n}else{var Tn=$<<R,Xr=Tn|P,zr=w;zp=1<<Y|Xr,Vp=zr}}function tB(l){cx();var c=l.return;if(c!==null){var p=1,v=0;lx(l,p),nie(l,p,v)}}function OI(l){return 32-_o(l)}function DBe(l){return 1<<OI(l)-1}function nB(l){for(;l===PI;)PI=JS[--e1],JS[e1]=null,AI=JS[--e1],JS[e1]=null;for(;l===ax;)ax=Nd[--kd],Nd[kd]=null,Vp=Nd[--kd],Nd[kd]=null,zp=Nd[--kd],Nd[kd]=null}function HBe(){return cx(),ax!==null?{id:zp,overflow:Vp}:null}function LBe(l,c){cx(),Nd[kd++]=zp,Nd[kd++]=Vp,Nd[kd++]=ax,zp=c.id,Vp=c.overflow,ax=l}function cx(){Ka()||u("Expected to be hydrating. This is a bug in React. Please file an issue.")}var Ga=null,Td=null,Ch=!1,ux=!1,e0=null;function $Be(){Ch&&u("We should not be hydrating here. This is a bug in React. Please file a bug.")}function rie(){ux=!0}function FBe(){return ux}function zBe(l){var c=l.stateNode.containerInfo;return Td=sBe(c),Ga=l,Ch=!0,e0=null,ux=!1,!0}function VBe(l,c,p){return Td=oBe(c),Ga=l,Ch=!0,e0=null,ux=!1,p!==null&&LBe(l,p),!0}function iie(l,c){switch(l.tag){case x:{gBe(l.stateNode.containerInfo,c);break}case E:{var p=(l.mode&jr)!==Pn;bBe(l.type,l.memoizedProps,l.stateNode,c,p);break}case F:{var v=l.memoizedState;v.dehydrated!==null&&vBe(v.dehydrated,c);break}}}function sie(l,c){iie(l,c);var p=Y8e();p.stateNode=c,p.return=l;var v=l.deletions;v===null?(l.deletions=[p],l.flags|=Rl):v.push(p)}function rB(l,c){{if(ux)return;switch(l.tag){case x:{var p=l.stateNode.containerInfo;switch(c.tag){case E:var v=c.type;c.pendingProps,yBe(p,v);break;case M:var w=c.pendingProps;xBe(p,w);break}break}case E:{var R=l.type,P=l.memoizedProps,$=l.stateNode;switch(c.tag){case E:{var Y=c.type,le=c.pendingProps,ue=(l.mode&jr)!==Pn;SBe(R,P,$,Y,le,ue);break}case M:{var He=c.pendingProps,Ie=(l.mode&jr)!==Pn;RBe(R,P,$,He,Ie);break}}break}case F:{var et=l.memoizedState,it=et.dehydrated;if(it!==null)switch(c.tag){case E:var mt=c.type;c.pendingProps,wBe(it,mt);break;case M:var Zt=c.pendingProps;CBe(it,Zt);break}break}default:return}}}function oie(l,c){c.flags=c.flags&~Es|_s,rB(l,c)}function aie(l,c){switch(l.tag){case E:{var p=l.type;l.pendingProps;var v=J6e(c,p);return v!==null?(l.stateNode=v,Ga=l,Td=iBe(v),!0):!1}case M:{var w=l.pendingProps,R=eBe(c,w);return R!==null?(l.stateNode=R,Ga=l,Td=null,!0):!1}case F:{var P=tBe(c);if(P!==null){var $={dehydrated:P,treeContext:HBe(),retryLane:kl};l.memoizedState=$;var Y=G8e(P);return Y.return=l,l.child=Y,Ga=l,Td=null,!0}return!1}default:return!1}}function iB(l){return(l.mode&jr)!==Pn&&(l.flags&_r)===Mn}function sB(l){throw new Error("Hydration failed because the initial UI does not match what was rendered on the server.")}function oB(l){if(Ch){var c=Td;if(!c){iB(l)&&(rB(Ga,l),sB()),oie(Ga,l),Ch=!1,Ga=l;return}var p=c;if(!aie(l,c)){iB(l)&&(rB(Ga,l),sB()),c=$N(p);var v=Ga;if(!c||!aie(l,c)){oie(Ga,l),Ch=!1,Ga=l;return}sie(v,p)}}}function BBe(l,c,p){var v=l.stateNode,w=!ux,R=aBe(v,l.type,l.memoizedProps,c,p,l,w);return l.updateQueue=R,R!==null}function WBe(l){var c=l.stateNode,p=l.memoizedProps,v=lBe(c,p,l);if(v){var w=Ga;if(w!==null)switch(w.tag){case x:{var R=w.stateNode.containerInfo,P=(w.mode&jr)!==Pn;mBe(R,c,p,P);break}case E:{var $=w.type,Y=w.memoizedProps,le=w.stateNode,ue=(w.mode&jr)!==Pn;pBe($,Y,le,c,p,ue);break}}}return v}function UBe(l){var c=l.memoizedState,p=c!==null?c.dehydrated:null;if(!p)throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");cBe(p,l)}function YBe(l){var c=l.memoizedState,p=c!==null?c.dehydrated:null;if(!p)throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");return uBe(p)}function lie(l){for(var c=l.return;c!==null&&c.tag!==E&&c.tag!==x&&c.tag!==F;)c=c.return;Ga=c}function II(l){if(l!==Ga)return!1;if(!Ch)return lie(l),Ch=!0,!1;if(l.tag!==x&&(l.tag!==E||fBe(l.type)&&!z6(l.type,l.memoizedProps))){var c=Td;if(c)if(iB(l))cie(l),sB();else for(;c;)sie(l,c),c=$N(c)}return lie(l),l.tag===F?Td=YBe(l):Td=Ga?$N(l.stateNode):null,!0}function GBe(){return Ch&&Td!==null}function cie(l){for(var c=Td;c;)iie(l,c),c=$N(c)}function t1(){Ga=null,Td=null,Ch=!1,ux=!1}function uie(){e0!==null&&(roe(e0),e0=null)}function Ka(){return Ch}function aB(l){e0===null?e0=[l]:e0.push(l)}var KBe=r.ReactCurrentBatchConfig,qBe=null;function XBe(){return KBe.transition}var Sh={recordUnsafeLifecycleWarnings:function(l,c){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(l,c){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}};{var QBe=function(l){for(var c=null,p=l;p!==null;)p.mode&hr&&(c=p),p=p.return;return c},dx=function(l){var c=[];return l.forEach(function(p){c.push(p)}),c.sort().join(", ")},BN=[],WN=[],UN=[],YN=[],GN=[],KN=[],hx=new Set;Sh.recordUnsafeLifecycleWarnings=function(l,c){hx.has(l.type)||(typeof c.componentWillMount=="function"&&c.componentWillMount.__suppressDeprecationWarning!==!0&&BN.push(l),l.mode&hr&&typeof c.UNSAFE_componentWillMount=="function"&&WN.push(l),typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&UN.push(l),l.mode&hr&&typeof c.UNSAFE_componentWillReceiveProps=="function"&&YN.push(l),typeof c.componentWillUpdate=="function"&&c.componentWillUpdate.__suppressDeprecationWarning!==!0&&GN.push(l),l.mode&hr&&typeof c.UNSAFE_componentWillUpdate=="function"&&KN.push(l))},Sh.flushPendingUnsafeLifecycleWarnings=function(){var l=new Set;BN.length>0&&(BN.forEach(function(Ie){l.add(_n(Ie)||"Component"),hx.add(Ie.type)}),BN=[]);var c=new Set;WN.length>0&&(WN.forEach(function(Ie){c.add(_n(Ie)||"Component"),hx.add(Ie.type)}),WN=[]);var p=new Set;UN.length>0&&(UN.forEach(function(Ie){p.add(_n(Ie)||"Component"),hx.add(Ie.type)}),UN=[]);var v=new Set;YN.length>0&&(YN.forEach(function(Ie){v.add(_n(Ie)||"Component"),hx.add(Ie.type)}),YN=[]);var w=new Set;GN.length>0&&(GN.forEach(function(Ie){w.add(_n(Ie)||"Component"),hx.add(Ie.type)}),GN=[]);var R=new Set;if(KN.length>0&&(KN.forEach(function(Ie){R.add(_n(Ie)||"Component"),hx.add(Ie.type)}),KN=[]),c.size>0){var P=dx(c);u(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details. * Move code with side effects to componentDidMount, and set initial state in the constructor. Please update the following components: %s`,P)}if(v.size>0){var $=dx(v);u(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details. * Move data fetching code or side effects to componentDidUpdate. * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state Please update the following components: %s`,$)}if(R.size>0){var Y=dx(R);u(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details. * Move data fetching code or side effects to componentDidUpdate. Please update the following components: %s`,Y)}if(l.size>0){var le=dx(l);a(`componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details. * Move code with side effects to componentDidMount, and set initial state in the constructor. * Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder. Please update the following components: %s`,le)}if(p.size>0){var ue=dx(p);a(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details. * Move data fetching code or side effects to componentDidUpdate. * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state * Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder. Please update the following components: %s`,ue)}if(w.size>0){var He=dx(w);a(`componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details. * Move data fetching code or side effects to componentDidUpdate. * Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder. Please update the following components: %s`,He)}};var DI=new Map,die=new Set;Sh.recordLegacyContextWarning=function(l,c){var p=QBe(l);if(p===null){u("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.");return}if(!die.has(l.type)){var v=DI.get(p);(l.type.contextTypes!=null||l.type.childContextTypes!=null||c!==null&&typeof c.getChildContext=="function")&&(v===void 0&&(v=[],DI.set(p,v)),v.push(l))}},Sh.flushLegacyContextWarning=function(){DI.forEach(function(l,c){if(l.length!==0){var p=l[0],v=new Set;l.forEach(function(R){v.add(_n(R)||"Component"),die.add(R.type)});var w=dx(v);try{Or(p),u(`Legacy context API has been detected within a strict-mode tree. The old API will be supported in all 16.x releases, but applications using it should migrate to the new version. Please update the following components: %s Learn more about this warning here: https://reactjs.org/link/legacy-context`,w)}finally{ji()}}})},Sh.discardPendingWarnings=function(){BN=[],WN=[],UN=[],YN=[],GN=[],KN=[],DI=new Map}}var lB,cB,uB,dB,hB,hie=function(l,c){};lB=!1,cB=!1,uB={},dB={},hB={},hie=function(l,c){if(!(l===null||typeof l!="object")&&!(!l._store||l._store.validated||l.key!=null)){if(typeof l._store!="object")throw new Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");l._store.validated=!0;var p=_n(c)||"Component";dB[p]||(dB[p]=!0,u('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.'))}};function ZBe(l){return l.prototype&&l.prototype.isReactComponent}function qN(l,c,p){var v=p.ref;if(v!==null&&typeof v!="function"&&typeof v!="object"){if((l.mode&hr||Ve)&&!(p._owner&&p._self&&p._owner.stateNode!==p._self)&&!(p._owner&&p._owner.tag!==g)&&!(typeof p.type=="function"&&!ZBe(p.type))&&p._owner){var w=_n(l)||"Component";uB[w]||(u('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',w,v),uB[w]=!0)}if(p._owner){var R=p._owner,P;if(R){var $=R;if($.tag!==g)throw new Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref");P=$.stateNode}if(!P)throw new Error("Missing owner for string ref "+v+". This error is likely caused by a bug in React. Please file an issue.");var Y=P;ae(v,"ref");var le=""+v;if(c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===le)return c.ref;var ue=function(He){var Ie=Y.refs;He===null?delete Ie[le]:Ie[le]=He};return ue._stringRef=le,ue}else{if(typeof v!="string")throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");if(!p._owner)throw new Error("Element ref was specified as a string ("+v+`) but no owner was set. This could happen for one of the following reasons: 1. You may be adding a ref to a function component 2. You may be adding a ref to a component that was not created inside a component's render method 3. You have multiple copies of React loaded See https://reactjs.org/link/refs-must-have-owner for more information.`)}}return v}function HI(l,c){var p=Object.prototype.toString.call(c);throw new Error("Objects are not valid as a React child (found: "+(p==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":p)+"). If you meant to render a collection of children, use an array instead.")}function LI(l){{var c=_n(l)||"Component";if(hB[c])return;hB[c]=!0,u("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.")}}function fie(l){var c=l._payload,p=l._init;return p(c)}function mie(l){function c(Ue,pt){if(l){var Ye=Ue.deletions;Ye===null?(Ue.deletions=[pt],Ue.flags|=Rl):Ye.push(pt)}}function p(Ue,pt){if(!l)return null;for(var Ye=pt;Ye!==null;)c(Ue,Ye),Ye=Ye.sibling;return null}function v(Ue,pt){for(var Ye=new Map,At=pt;At!==null;)At.key!==null?Ye.set(At.key,At):Ye.set(At.index,At),At=At.sibling;return Ye}function w(Ue,pt){var Ye=wx(Ue,pt);return Ye.index=0,Ye.sibling=null,Ye}function R(Ue,pt,Ye){if(Ue.index=Ye,!l)return Ue.flags|=Ny,pt;var At=Ue.alternate;if(At!==null){var pn=At.index;return pn<pt?(Ue.flags|=_s,pt):pn}else return Ue.flags|=_s,pt}function P(Ue){return l&&Ue.alternate===null&&(Ue.flags|=_s),Ue}function $(Ue,pt,Ye,At){if(pt===null||pt.tag!==M){var pn=aU(Ye,Ue.mode,At);return pn.return=Ue,pn}else{var an=w(pt,Ye);return an.return=Ue,an}}function Y(Ue,pt,Ye,At){var pn=Ye.type;if(pn===tn)return ue(Ue,pt,Ye.props.children,At,Ye.key);if(pt!==null&&(pt.elementType===pn||yoe(pt,Ye)||typeof pn=="object"&&pn!==null&&pn.$$typeof===$t&&fie(pn)===pt.type)){var an=w(pt,Ye.props);return an.ref=qN(Ue,pt,Ye),an.return=Ue,an._debugSource=Ye._source,an._debugOwner=Ye._owner,an}var Kn=oU(Ye,Ue.mode,At);return Kn.ref=qN(Ue,pt,Ye),Kn.return=Ue,Kn}function le(Ue,pt,Ye,At){if(pt===null||pt.tag!==C||pt.stateNode.containerInfo!==Ye.containerInfo||pt.stateNode.implementation!==Ye.implementation){var pn=lU(Ye,Ue.mode,At);return pn.return=Ue,pn}else{var an=w(pt,Ye.children||[]);return an.return=Ue,an}}function ue(Ue,pt,Ye,At,pn){if(pt===null||pt.tag!==j){var an=d0(Ye,Ue.mode,At,pn);return an.return=Ue,an}else{var Kn=w(pt,Ye);return Kn.return=Ue,Kn}}function He(Ue,pt,Ye){if(typeof pt=="string"&&pt!==""||typeof pt=="number"){var At=aU(""+pt,Ue.mode,Ye);return At.return=Ue,At}if(typeof pt=="object"&&pt!==null){switch(pt.$$typeof){case Wt:{var pn=oU(pt,Ue.mode,Ye);return pn.ref=qN(Ue,null,pt),pn.return=Ue,pn}case en:{var an=lU(pt,Ue.mode,Ye);return an.return=Ue,an}case $t:{var Kn=pt._payload,cr=pt._init;return He(Ue,cr(Kn),Ye)}}if(vr(pt)||Sn(pt)){var Di=d0(pt,Ue.mode,Ye,null);return Di.return=Ue,Di}HI(Ue,pt)}return typeof pt=="function"&&LI(Ue),null}function Ie(Ue,pt,Ye,At){var pn=pt!==null?pt.key:null;if(typeof Ye=="string"&&Ye!==""||typeof Ye=="number")return pn!==null?null:$(Ue,pt,""+Ye,At);if(typeof Ye=="object"&&Ye!==null){switch(Ye.$$typeof){case Wt:return Ye.key===pn?Y(Ue,pt,Ye,At):null;case en:return Ye.key===pn?le(Ue,pt,Ye,At):null;case $t:{var an=Ye._payload,Kn=Ye._init;return Ie(Ue,pt,Kn(an),At)}}if(vr(Ye)||Sn(Ye))return pn!==null?null:ue(Ue,pt,Ye,At,null);HI(Ue,Ye)}return typeof Ye=="function"&&LI(Ue),null}function et(Ue,pt,Ye,At,pn){if(typeof At=="string"&&At!==""||typeof At=="number"){var an=Ue.get(Ye)||null;return $(pt,an,""+At,pn)}if(typeof At=="object"&&At!==null){switch(At.$$typeof){case Wt:{var Kn=Ue.get(At.key===null?Ye:At.key)||null;return Y(pt,Kn,At,pn)}case en:{var cr=Ue.get(At.key===null?Ye:At.key)||null;return le(pt,cr,At,pn)}case $t:var Di=At._payload,ai=At._init;return et(Ue,pt,Ye,ai(Di),pn)}if(vr(At)||Sn(At)){var To=Ue.get(Ye)||null;return ue(pt,To,At,pn,null)}HI(pt,At)}return typeof At=="function"&&LI(pt),null}function it(Ue,pt,Ye){{if(typeof Ue!="object"||Ue===null)return pt;switch(Ue.$$typeof){case Wt:case en:hie(Ue,Ye);var At=Ue.key;if(typeof At!="string")break;if(pt===null){pt=new Set,pt.add(At);break}if(!pt.has(At)){pt.add(At);break}u("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",At);break;case $t:var pn=Ue._payload,an=Ue._init;it(an(pn),pt,Ye);break}}return pt}function mt(Ue,pt,Ye,At){for(var pn=null,an=0;an<Ye.length;an++){var Kn=Ye[an];pn=it(Kn,pn,Ue)}for(var cr=null,Di=null,ai=pt,To=0,li=0,uo=null;ai!==null&&li<Ye.length;li++){ai.index>li?(uo=ai,ai=null):uo=ai.sibling;var Dl=Ie(Ue,ai,Ye[li],At);if(Dl===null){ai===null&&(ai=uo);break}l&&ai&&Dl.alternate===null&&c(Ue,ai),To=R(Dl,To,li),Di===null?cr=Dl:Di.sibling=Dl,Di=Dl,ai=uo}if(li===Ye.length){if(p(Ue,ai),Ka()){var tl=li;lx(Ue,tl)}return cr}if(ai===null){for(;li<Ye.length;li++){var Lu=He(Ue,Ye[li],At);Lu!==null&&(To=R(Lu,To,li),Di===null?cr=Lu:Di.sibling=Lu,Di=Lu)}if(Ka()){var mc=li;lx(Ue,mc)}return cr}for(var pc=v(Ue,ai);li<Ye.length;li++){var Hl=et(pc,Ue,li,Ye[li],At);Hl!==null&&(l&&Hl.alternate!==null&&pc.delete(Hl.key===null?li:Hl.key),To=R(Hl,To,li),Di===null?cr=Hl:Di.sibling=Hl,Di=Hl)}if(l&&pc.forEach(function(x1){return c(Ue,x1)}),Ka()){var qp=li;lx(Ue,qp)}return cr}function Zt(Ue,pt,Ye,At){var pn=Sn(Ye);if(typeof pn!="function")throw new Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");{typeof Symbol=="function"&&Ye[Symbol.toStringTag]==="Generator"&&(cB||u("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."),cB=!0),Ye.entries===pn&&(lB||u("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),lB=!0);var an=pn.call(Ye);if(an)for(var Kn=null,cr=an.next();!cr.done;cr=an.next()){var Di=cr.value;Kn=it(Di,Kn,Ue)}}var ai=pn.call(Ye);if(ai==null)throw new Error("An iterable object provided no iterator.");for(var To=null,li=null,uo=pt,Dl=0,tl=0,Lu=null,mc=ai.next();uo!==null&&!mc.done;tl++,mc=ai.next()){uo.index>tl?(Lu=uo,uo=null):Lu=uo.sibling;var pc=Ie(Ue,uo,mc.value,At);if(pc===null){uo===null&&(uo=Lu);break}l&&uo&&pc.alternate===null&&c(Ue,uo),Dl=R(pc,Dl,tl),li===null?To=pc:li.sibling=pc,li=pc,uo=Lu}if(mc.done){if(p(Ue,uo),Ka()){var Hl=tl;lx(Ue,Hl)}return To}if(uo===null){for(;!mc.done;tl++,mc=ai.next()){var qp=He(Ue,mc.value,At);qp!==null&&(Dl=R(qp,Dl,tl),li===null?To=qp:li.sibling=qp,li=qp)}if(Ka()){var x1=tl;lx(Ue,x1)}return To}for(var Nk=v(Ue,uo);!mc.done;tl++,mc=ai.next()){var sm=et(Nk,Ue,tl,mc.value,At);sm!==null&&(l&&sm.alternate!==null&&Nk.delete(sm.key===null?tl:sm.key),Dl=R(sm,Dl,tl),li===null?To=sm:li.sibling=sm,li=sm)}if(l&&Nk.forEach(function(R9e){return c(Ue,R9e)}),Ka()){var S9e=tl;lx(Ue,S9e)}return To}function $n(Ue,pt,Ye,At){if(pt!==null&&pt.tag===M){p(Ue,pt.sibling);var pn=w(pt,Ye);return pn.return=Ue,pn}p(Ue,pt);var an=aU(Ye,Ue.mode,At);return an.return=Ue,an}function Tn(Ue,pt,Ye,At){for(var pn=Ye.key,an=pt;an!==null;){if(an.key===pn){var Kn=Ye.type;if(Kn===tn){if(an.tag===j){p(Ue,an.sibling);var cr=w(an,Ye.props.children);return cr.return=Ue,cr._debugSource=Ye._source,cr._debugOwner=Ye._owner,cr}}else if(an.elementType===Kn||yoe(an,Ye)||typeof Kn=="object"&&Kn!==null&&Kn.$$typeof===$t&&fie(Kn)===an.type){p(Ue,an.sibling);var Di=w(an,Ye.props);return Di.ref=qN(Ue,an,Ye),Di.return=Ue,Di._debugSource=Ye._source,Di._debugOwner=Ye._owner,Di}p(Ue,an);break}else c(Ue,an);an=an.sibling}if(Ye.type===tn){var ai=d0(Ye.props.children,Ue.mode,At,Ye.key);return ai.return=Ue,ai}else{var To=oU(Ye,Ue.mode,At);return To.ref=qN(Ue,pt,Ye),To.return=Ue,To}}function Xr(Ue,pt,Ye,At){for(var pn=Ye.key,an=pt;an!==null;){if(an.key===pn)if(an.tag===C&&an.stateNode.containerInfo===Ye.containerInfo&&an.stateNode.implementation===Ye.implementation){p(Ue,an.sibling);var Kn=w(an,Ye.children||[]);return Kn.return=Ue,Kn}else{p(Ue,an);break}else c(Ue,an);an=an.sibling}var cr=lU(Ye,Ue.mode,At);return cr.return=Ue,cr}function zr(Ue,pt,Ye,At){var pn=typeof Ye=="object"&&Ye!==null&&Ye.type===tn&&Ye.key===null;if(pn&&(Ye=Ye.props.children),typeof Ye=="object"&&Ye!==null){switch(Ye.$$typeof){case Wt:return P(Tn(Ue,pt,Ye,At));case en:return P(Xr(Ue,pt,Ye,At));case $t:var an=Ye._payload,Kn=Ye._init;return zr(Ue,pt,Kn(an),At)}if(vr(Ye))return mt(Ue,pt,Ye,At);if(Sn(Ye))return Zt(Ue,pt,Ye,At);HI(Ue,Ye)}return typeof Ye=="string"&&Ye!==""||typeof Ye=="number"?P($n(Ue,pt,""+Ye,At)):(typeof Ye=="function"&&LI(Ue),p(Ue,pt))}return zr}var n1=mie(!0),pie=mie(!1);function JBe(l,c){if(l!==null&&c.child!==l.child)throw new Error("Resuming work not yet implemented.");if(c.child!==null){var p=c.child,v=wx(p,p.pendingProps);for(c.child=v,v.return=c;p.sibling!==null;)p=p.sibling,v=v.sibling=wx(p,p.pendingProps),v.return=c;v.sibling=null}}function eWe(l,c){for(var p=l.child;p!==null;)z8e(p,c),p=p.sibling}var fB=Qv(null),mB;mB={};var $I=null,r1=null,pB=null,FI=!1;function zI(){$I=null,r1=null,pB=null,FI=!1}function gie(){FI=!0}function vie(){FI=!1}function bie(l,c,p){Ol(fB,c._currentValue,l),c._currentValue=p,c._currentRenderer!==void 0&&c._currentRenderer!==null&&c._currentRenderer!==mB&&u("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),c._currentRenderer=mB}function gB(l,c){var p=fB.current;Al(fB,c),l._currentValue=p}function vB(l,c,p){for(var v=l;v!==null;){var w=v.alternate;if(Np(v.childLanes,c)?w!==null&&!Np(w.childLanes,c)&&(w.childLanes=br(w.childLanes,c)):(v.childLanes=br(v.childLanes,c),w!==null&&(w.childLanes=br(w.childLanes,c))),v===p)break;v=v.return}v!==p&&u("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.")}function tWe(l,c,p){nWe(l,c,p)}function nWe(l,c,p){var v=l.child;for(v!==null&&(v.return=l);v!==null;){var w=void 0,R=v.dependencies;if(R!==null){w=v.child;for(var P=R.firstContext;P!==null;){if(P.context===c){if(v.tag===g){var $=Go(p),Y=Bp(Si,$);Y.tag=BI;var le=v.updateQueue;if(le!==null){var ue=le.shared,He=ue.pending;He===null?Y.next=Y:(Y.next=He.next,He.next=Y),ue.pending=Y}}v.lanes=br(v.lanes,p);var Ie=v.alternate;Ie!==null&&(Ie.lanes=br(Ie.lanes,p)),vB(v.return,p,l),R.lanes=br(R.lanes,p);break}P=P.next}}else if(v.tag===z)w=v.type===l.type?null:v.child;else if(v.tag===_e){var et=v.return;if(et===null)throw new Error("We just came from a parent so we must have had a parent. This is a bug in React.");et.lanes=br(et.lanes,p);var it=et.alternate;it!==null&&(it.lanes=br(it.lanes,p)),vB(et,p,l),w=v.sibling}else w=v.child;if(w!==null)w.return=v;else for(w=v;w!==null;){if(w===l){w=null;break}var mt=w.sibling;if(mt!==null){mt.return=w.return,w=mt;break}w=w.return}v=w}}function i1(l,c){$I=l,r1=null,pB=null;var p=l.dependencies;if(p!==null){var v=p.firstContext;v!==null&&(jl(p.lanes,c)&&uk(),p.firstContext=null)}}function qo(l){FI&&u("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");var c=l._currentValue;if(pB!==l){var p={context:l,memoizedValue:c,next:null};if(r1===null){if($I===null)throw new Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");r1=p,$I.dependencies={lanes:bt,firstContext:p}}else r1=r1.next=p}return c}var fx=null;function bB(l){fx===null?fx=[l]:fx.push(l)}function rWe(){if(fx!==null){for(var l=0;l<fx.length;l++){var c=fx[l],p=c.interleaved;if(p!==null){c.interleaved=null;var v=p.next,w=c.pending;if(w!==null){var R=w.next;w.next=v,p.next=R}c.pending=p}}fx=null}}function yie(l,c,p,v){var w=c.interleaved;return w===null?(p.next=p,bB(c)):(p.next=w.next,w.next=p),c.interleaved=p,VI(l,v)}function iWe(l,c,p,v){var w=c.interleaved;w===null?(p.next=p,bB(c)):(p.next=w.next,w.next=p),c.interleaved=p}function sWe(l,c,p,v){var w=c.interleaved;return w===null?(p.next=p,bB(c)):(p.next=w.next,w.next=p),c.interleaved=p,VI(l,v)}function Kc(l,c){return VI(l,c)}var oWe=VI;function VI(l,c){l.lanes=br(l.lanes,c);var p=l.alternate;p!==null&&(p.lanes=br(p.lanes,c)),p===null&&(l.flags&(_s|Es))!==Mn&&poe(l);for(var v=l,w=l.return;w!==null;)w.childLanes=br(w.childLanes,c),p=w.alternate,p!==null?p.childLanes=br(p.childLanes,c):(w.flags&(_s|Es))!==Mn&&poe(l),v=w,w=w.return;if(v.tag===x){var R=v.stateNode;return R}else return null}var xie=0,wie=1,BI=2,yB=3,WI=!1,xB,UI;xB=!1,UI=null;function wB(l){var c={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:bt},effects:null};l.updateQueue=c}function Cie(l,c){var p=c.updateQueue,v=l.updateQueue;if(p===v){var w={baseState:v.baseState,firstBaseUpdate:v.firstBaseUpdate,lastBaseUpdate:v.lastBaseUpdate,shared:v.shared,effects:v.effects};c.updateQueue=w}}function Bp(l,c){var p={eventTime:l,lane:c,tag:xie,payload:null,callback:null,next:null};return p}function t0(l,c,p){var v=l.updateQueue;if(v===null)return null;var w=v.shared;if(UI===w&&!xB&&(u("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback."),xB=!0),i8e()){var R=w.pending;return R===null?c.next=c:(c.next=R.next,R.next=c),w.pending=c,oWe(l,p)}else return sWe(l,w,c,p)}function YI(l,c,p){var v=c.updateQueue;if(v!==null){var w=v.shared;if(cN(p)){var R=w.lanes;R=SS(R,l.pendingLanes);var P=br(R,p);w.lanes=P,By(l,P)}}}function CB(l,c){var p=l.updateQueue,v=l.alternate;if(v!==null){var w=v.updateQueue;if(p===w){var R=null,P=null,$=p.firstBaseUpdate;if($!==null){var Y=$;do{var le={eventTime:Y.eventTime,lane:Y.lane,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null};P===null?R=P=le:(P.next=le,P=le),Y=Y.next}while(Y!==null);P===null?R=P=c:(P.next=c,P=c)}else R=P=c;p={baseState:w.baseState,firstBaseUpdate:R,lastBaseUpdate:P,shared:w.shared,effects:w.effects},l.updateQueue=p;return}}var ue=p.lastBaseUpdate;ue===null?p.firstBaseUpdate=c:ue.next=c,p.lastBaseUpdate=c}function aWe(l,c,p,v,w,R){switch(p.tag){case wie:{var P=p.payload;if(typeof P=="function"){gie();var $=P.call(R,v,w);{if(l.mode&hr){Ci(!0);try{P.call(R,v,w)}finally{Ci(!1)}}vie()}return $}return P}case yB:l.flags=l.flags&~Ma|_r;case xie:{var Y=p.payload,le;if(typeof Y=="function"){gie(),le=Y.call(R,v,w);{if(l.mode&hr){Ci(!0);try{Y.call(R,v,w)}finally{Ci(!1)}}vie()}}else le=Y;return le==null?v:Bt({},v,le)}case BI:return WI=!0,v}return v}function GI(l,c,p,v){var w=l.updateQueue;WI=!1,UI=w.shared;var R=w.firstBaseUpdate,P=w.lastBaseUpdate,$=w.shared.pending;if($!==null){w.shared.pending=null;var Y=$,le=Y.next;Y.next=null,P===null?R=le:P.next=le,P=Y;var ue=l.alternate;if(ue!==null){var He=ue.updateQueue,Ie=He.lastBaseUpdate;Ie!==P&&(Ie===null?He.firstBaseUpdate=le:Ie.next=le,He.lastBaseUpdate=Y)}}if(R!==null){var et=w.baseState,it=bt,mt=null,Zt=null,$n=null,Tn=R;do{var Xr=Tn.lane,zr=Tn.eventTime;if(Np(v,Xr)){if($n!==null){var pt={eventTime:zr,lane:lo,tag:Tn.tag,payload:Tn.payload,callback:Tn.callback,next:null};$n=$n.next=pt}et=aWe(l,w,Tn,et,c,p);var Ye=Tn.callback;if(Ye!==null&&Tn.lane!==lo){l.flags|=Gi;var At=w.effects;At===null?w.effects=[Tn]:At.push(Tn)}}else{var Ue={eventTime:zr,lane:Xr,tag:Tn.tag,payload:Tn.payload,callback:Tn.callback,next:null};$n===null?(Zt=$n=Ue,mt=et):$n=$n.next=Ue,it=br(it,Xr)}if(Tn=Tn.next,Tn===null){if($=w.shared.pending,$===null)break;var pn=$,an=pn.next;pn.next=null,Tn=an,w.lastBaseUpdate=pn,w.shared.pending=null}}while(!0);$n===null&&(mt=et),w.baseState=mt,w.firstBaseUpdate=Zt,w.lastBaseUpdate=$n;var Kn=w.shared.interleaved;if(Kn!==null){var cr=Kn;do it=br(it,cr.lane),cr=cr.next;while(cr!==Kn)}else R===null&&(w.shared.lanes=bt);Ck(it),l.lanes=it,l.memoizedState=et}UI=null}function lWe(l,c){if(typeof l!="function")throw new Error("Invalid argument passed as callback. Expected a function. Instead "+("received: "+l));l.call(c)}function Sie(){WI=!1}function KI(){return WI}function Rie(l,c,p){var v=c.effects;if(c.effects=null,v!==null)for(var w=0;w<v.length;w++){var R=v[w],P=R.callback;P!==null&&(R.callback=null,lWe(P,p))}}var XN={},n0=Qv(XN),QN=Qv(XN),qI=Qv(XN);function XI(l){if(l===XN)throw new Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");return l}function _ie(){var l=XI(qI.current);return l}function SB(l,c){Ol(qI,c,l),Ol(QN,l,l),Ol(n0,XN,l);var p=_6e(c);Al(n0,l),Ol(n0,p,l)}function s1(l){Al(n0,l),Al(QN,l),Al(qI,l)}function RB(){var l=XI(n0.current);return l}function Eie(l){XI(qI.current);var c=XI(n0.current),p=E6e(c,l.type);c!==p&&(Ol(QN,l,l),Ol(n0,p,l))}function _B(l){QN.current===l&&(Al(n0,l),Al(QN,l))}var cWe=0,Nie=1,kie=1,ZN=2,Rh=Qv(cWe);function EB(l,c){return(l&c)!==0}function o1(l){return l&Nie}function NB(l,c){return l&Nie|c}function uWe(l,c){return l|c}function r0(l,c){Ol(Rh,c,l)}function a1(l){Al(Rh,l)}function dWe(l,c){var p=l.memoizedState;return p!==null?p.dehydrated!==null:(l.memoizedProps,!0)}function QI(l){for(var c=l;c!==null;){if(c.tag===F){var p=c.memoizedState;if(p!==null){var v=p.dehydrated;if(v===null||Ure(v)||U6(v))return c}}else if(c.tag===pe&&c.memoizedProps.revealOrder!==void 0){var w=(c.flags&_r)!==Mn;if(w)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)return null;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var qc=0,ma=1,Zf=2,pa=4,qa=8,kB=[];function TB(){for(var l=0;l<kB.length;l++){var c=kB[l];c._workInProgressVersionPrimary=null}kB.length=0}function hWe(l,c){var p=c._getVersion,v=p(c._source);l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[c,v]:l.mutableSourceEagerHydrationData.push(c,v)}var fn=r.ReactCurrentDispatcher,JN=r.ReactCurrentBatchConfig,jB,l1;jB=new Set;var mx=bt,Ii=null,ga=null,va=null,ZI=!1,ek=!1,tk=0,fWe=0,mWe=25,yt=null,jd=null,i0=-1,MB=!1;function vi(){{var l=yt;jd===null?jd=[l]:jd.push(l)}}function Yt(){{var l=yt;jd!==null&&(i0++,jd[i0]!==l&&pWe(l))}}function c1(l){l!=null&&!vr(l)&&u("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",yt,typeof l)}function pWe(l){{var c=_n(Ii);if(!jB.has(c)&&(jB.add(c),jd!==null)){for(var p="",v=30,w=0;w<=i0;w++){for(var R=jd[w],P=w===i0?l:R,$=w+1+". "+R;$.length<v;)$+=" ";$+=P+` `,p+=$}u(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks Previous render Next render ------------------------------------------------------ %s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `,c,p)}}}function Il(){throw new Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as React DOM) 2. You might be breaking the Rules of Hooks 3. You might have more than one copy of React in the same app See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function PB(l,c){if(MB)return!1;if(c===null)return u("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",yt),!1;l.length!==c.length&&u(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant. Previous: %s Incoming: %s`,yt,"["+c.join(", ")+"]","["+l.join(", ")+"]");for(var p=0;p<c.length&&p<l.length;p++)if(!on(l[p],c[p]))return!1;return!0}function u1(l,c,p,v,w,R){mx=R,Ii=c,jd=l!==null?l._debugHookTypes:null,i0=-1,MB=l!==null&&l.type!==c.type,c.memoizedState=null,c.updateQueue=null,c.lanes=bt,l!==null&&l.memoizedState!==null?fn.current=Xie:jd!==null?fn.current=qie:fn.current=Kie;var P=p(v,w);if(ek){var $=0;do{if(ek=!1,tk=0,$>=mWe)throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");$+=1,MB=!1,ga=null,va=null,c.updateQueue=null,i0=-1,fn.current=Qie,P=p(v,w)}while(ek)}fn.current=dD,c._debugHookTypes=jd;var Y=ga!==null&&ga.next!==null;if(mx=bt,Ii=null,ga=null,va=null,yt=null,jd=null,i0=-1,l!==null&&(l.flags&ao)!==(c.flags&ao)&&(l.mode&jr)!==Pn&&u("Internal React error: Expected static flag was missing. Please notify the React team."),ZI=!1,Y)throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");return P}function d1(){var l=tk!==0;return tk=0,l}function Tie(l,c,p){c.updateQueue=l.updateQueue,(c.mode&Oi)!==Pn?c.flags&=-50333701:c.flags&=-2053,l.lanes=Vy(l.lanes,p)}function jie(){if(fn.current=dD,ZI){for(var l=Ii.memoizedState;l!==null;){var c=l.queue;c!==null&&(c.pending=null),l=l.next}ZI=!1}mx=bt,Ii=null,ga=null,va=null,jd=null,i0=-1,yt=null,Bie=!1,ek=!1,tk=0}function Jf(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return va===null?Ii.memoizedState=va=l:va=va.next=l,va}function Md(){var l;if(ga===null){var c=Ii.alternate;c!==null?l=c.memoizedState:l=null}else l=ga.next;var p;if(va===null?p=Ii.memoizedState:p=va.next,p!==null)va=p,p=va.next,ga=l;else{if(l===null)throw new Error("Rendered more hooks than during the previous render.");ga=l;var v={memoizedState:ga.memoizedState,baseState:ga.baseState,baseQueue:ga.baseQueue,queue:ga.queue,next:null};va===null?Ii.memoizedState=va=v:va=va.next=v}return va}function Mie(){return{lastEffect:null,stores:null}}function AB(l,c){return typeof c=="function"?c(l):c}function OB(l,c,p){var v=Jf(),w;p!==void 0?w=p(c):w=c,v.memoizedState=v.baseState=w;var R={pending:null,interleaved:null,lanes:bt,dispatch:null,lastRenderedReducer:l,lastRenderedState:w};v.queue=R;var P=R.dispatch=yWe.bind(null,Ii,R);return[v.memoizedState,P]}function IB(l,c,p){var v=Md(),w=v.queue;if(w===null)throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");w.lastRenderedReducer=l;var R=ga,P=R.baseQueue,$=w.pending;if($!==null){if(P!==null){var Y=P.next,le=$.next;P.next=le,$.next=Y}R.baseQueue!==P&&u("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),R.baseQueue=P=$,w.pending=null}if(P!==null){var ue=P.next,He=R.baseState,Ie=null,et=null,it=null,mt=ue;do{var Zt=mt.lane;if(Np(mx,Zt)){if(it!==null){var Tn={lane:lo,action:mt.action,hasEagerState:mt.hasEagerState,eagerState:mt.eagerState,next:null};it=it.next=Tn}if(mt.hasEagerState)He=mt.eagerState;else{var Xr=mt.action;He=l(He,Xr)}}else{var $n={lane:Zt,action:mt.action,hasEagerState:mt.hasEagerState,eagerState:mt.eagerState,next:null};it===null?(et=it=$n,Ie=He):it=it.next=$n,Ii.lanes=br(Ii.lanes,Zt),Ck(Zt)}mt=mt.next}while(mt!==null&&mt!==ue);it===null?Ie=He:it.next=et,on(He,v.memoizedState)||uk(),v.memoizedState=He,v.baseState=Ie,v.baseQueue=it,w.lastRenderedState=He}var zr=w.interleaved;if(zr!==null){var Ue=zr;do{var pt=Ue.lane;Ii.lanes=br(Ii.lanes,pt),Ck(pt),Ue=Ue.next}while(Ue!==zr)}else P===null&&(w.lanes=bt);var Ye=w.dispatch;return[v.memoizedState,Ye]}function DB(l,c,p){var v=Md(),w=v.queue;if(w===null)throw new Error("Should have a queue. This is likely a bug in React. Please file an issue.");w.lastRenderedReducer=l;var R=w.dispatch,P=w.pending,$=v.memoizedState;if(P!==null){w.pending=null;var Y=P.next,le=Y;do{var ue=le.action;$=l($,ue),le=le.next}while(le!==Y);on($,v.memoizedState)||uk(),v.memoizedState=$,v.baseQueue===null&&(v.baseState=$),w.lastRenderedState=$}return[$,R]}function f7e(l,c,p){}function m7e(l,c,p){}function HB(l,c,p){var v=Ii,w=Jf(),R,P=Ka();if(P){if(p===void 0)throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");R=p(),l1||R!==p()&&(u("The result of getServerSnapshot should be cached to avoid an infinite loop"),l1=!0)}else{if(R=c(),!l1){var $=c();on(R,$)||(u("The result of getSnapshot should be cached to avoid an infinite loop"),l1=!0)}var Y=jD();if(Y===null)throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");zy(Y,mx)||Pie(v,c,R)}w.memoizedState=R;var le={value:R,getSnapshot:c};return w.queue=le,rD(Oie.bind(null,v,le,l),[l]),v.flags|=sc,nk(ma|qa,Aie.bind(null,v,le,R,c),void 0,null),R}function JI(l,c,p){var v=Ii,w=Md(),R=c();if(!l1){var P=c();on(R,P)||(u("The result of getSnapshot should be cached to avoid an infinite loop"),l1=!0)}var $=w.memoizedState,Y=!on($,R);Y&&(w.memoizedState=R,uk());var le=w.queue;if(ik(Oie.bind(null,v,le,l),[l]),le.getSnapshot!==c||Y||va!==null&&va.memoizedState.tag&ma){v.flags|=sc,nk(ma|qa,Aie.bind(null,v,le,R,c),void 0,null);var ue=jD();if(ue===null)throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");zy(ue,mx)||Pie(v,c,R)}return R}function Pie(l,c,p){l.flags|=QC;var v={getSnapshot:c,value:p},w=Ii.updateQueue;if(w===null)w=Mie(),Ii.updateQueue=w,w.stores=[v];else{var R=w.stores;R===null?w.stores=[v]:R.push(v)}}function Aie(l,c,p,v){c.value=p,c.getSnapshot=v,Iie(c)&&Die(l)}function Oie(l,c,p){var v=function(){Iie(c)&&Die(l)};return p(v)}function Iie(l){var c=l.getSnapshot,p=l.value;try{var v=c();return!on(p,v)}catch{return!0}}function Die(l){var c=Kc(l,Un);c!==null&&wa(c,l,Un,Si)}function eD(l){var c=Jf();typeof l=="function"&&(l=l()),c.memoizedState=c.baseState=l;var p={pending:null,interleaved:null,lanes:bt,dispatch:null,lastRenderedReducer:AB,lastRenderedState:l};c.queue=p;var v=p.dispatch=xWe.bind(null,Ii,p);return[c.memoizedState,v]}function LB(l){return IB(AB)}function $B(l){return DB(AB)}function nk(l,c,p,v){var w={tag:l,create:c,destroy:p,deps:v,next:null},R=Ii.updateQueue;if(R===null)R=Mie(),Ii.updateQueue=R,R.lastEffect=w.next=w;else{var P=R.lastEffect;if(P===null)R.lastEffect=w.next=w;else{var $=P.next;P.next=w,w.next=$,R.lastEffect=w}}return w}function FB(l){var c=Jf();{var p={current:l};return c.memoizedState=p,p}}function tD(l){var c=Md();return c.memoizedState}function rk(l,c,p,v){var w=Jf(),R=v===void 0?null:v;Ii.flags|=l,w.memoizedState=nk(ma|c,p,void 0,R)}function nD(l,c,p,v){var w=Md(),R=v===void 0?null:v,P=void 0;if(ga!==null){var $=ga.memoizedState;if(P=$.destroy,R!==null){var Y=$.deps;if(PB(R,Y)){w.memoizedState=nk(c,p,P,R);return}}}Ii.flags|=l,w.memoizedState=nk(ma|c,p,P,R)}function rD(l,c){return(Ii.mode&Oi)!==Pn?rk(Pf|sc|BE,qa,l,c):rk(sc|BE,qa,l,c)}function ik(l,c){return nD(sc,qa,l,c)}function zB(l,c){return rk(Ir,Zf,l,c)}function iD(l,c){return nD(Ir,Zf,l,c)}function VB(l,c){var p=Ir;return p|=Mf,(Ii.mode&Oi)!==Pn&&(p|=Wa),rk(p,pa,l,c)}function sD(l,c){return nD(Ir,pa,l,c)}function Hie(l,c){if(typeof c=="function"){var p=c,v=l();return p(v),function(){p(null)}}else if(c!=null){var w=c;w.hasOwnProperty("current")||u("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(w).join(", ")+"}");var R=l();return w.current=R,function(){w.current=null}}}function BB(l,c,p){typeof c!="function"&&u("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",c!==null?typeof c:"null");var v=p!=null?p.concat([l]):null,w=Ir;return w|=Mf,(Ii.mode&Oi)!==Pn&&(w|=Wa),rk(w,pa,Hie.bind(null,c,l),v)}function oD(l,c,p){typeof c!="function"&&u("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",c!==null?typeof c:"null");var v=p!=null?p.concat([l]):null;return nD(Ir,pa,Hie.bind(null,c,l),v)}function gWe(l,c){}var aD=gWe;function WB(l,c){var p=Jf(),v=c===void 0?null:c;return p.memoizedState=[l,v],l}function lD(l,c){var p=Md(),v=c===void 0?null:c,w=p.memoizedState;if(w!==null&&v!==null){var R=w[1];if(PB(v,R))return w[0]}return p.memoizedState=[l,v],l}function UB(l,c){var p=Jf(),v=c===void 0?null:c,w=l();return p.memoizedState=[w,v],w}function cD(l,c){var p=Md(),v=c===void 0?null:c,w=p.memoizedState;if(w!==null&&v!==null){var R=w[1];if(PB(v,R))return w[0]}var P=l();return p.memoizedState=[P,v],P}function YB(l){var c=Jf();return c.memoizedState=l,l}function Lie(l){var c=Md(),p=ga,v=p.memoizedState;return Fie(c,v,l)}function $ie(l){var c=Md();if(ga===null)return c.memoizedState=l,l;var p=ga.memoizedState;return Fie(c,p,l)}function Fie(l,c,p){var v=!lN(mx);if(v){if(!on(p,c)){var w=uN();Ii.lanes=br(Ii.lanes,w),Ck(w),l.baseState=!0}return c}else return l.baseState&&(l.baseState=!1,uk()),l.memoizedState=p,p}function vWe(l,c,p){var v=ac();Eo(Wy(v,Bc)),l(!0);var w=JN.transition;JN.transition={};var R=JN.transition;JN.transition._updatedFibers=new Set;try{l(!1),c()}finally{if(Eo(v),JN.transition=w,w===null&&R._updatedFibers){var P=R._updatedFibers.size;P>10&&a("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),R._updatedFibers.clear()}}}function GB(){var l=eD(!1),c=l[0],p=l[1],v=vWe.bind(null,p),w=Jf();return w.memoizedState=v,[c,v]}function zie(){var l=LB(),c=l[0],p=Md(),v=p.memoizedState;return[c,v]}function Vie(){var l=$B(),c=l[0],p=Md(),v=p.memoizedState;return[c,v]}var Bie=!1;function bWe(){return Bie}function KB(){var l=Jf(),c=jD(),p=c.identifierPrefix,v;if(Ka()){var w=IBe();v=":"+p+"R"+w;var R=tk++;R>0&&(v+="H"+R.toString(32)),v+=":"}else{var P=fWe++;v=":"+p+"r"+P.toString(32)+":"}return l.memoizedState=v,v}function uD(){var l=Md(),c=l.memoizedState;return c}function yWe(l,c,p){typeof arguments[3]=="function"&&u("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");var v=c0(l),w={lane:v,action:p,hasEagerState:!1,eagerState:null,next:null};if(Wie(l))Uie(c,w);else{var R=yie(l,c,w,v);if(R!==null){var P=fc();wa(R,l,v,P),Yie(R,c,v)}}Gie(l,v)}function xWe(l,c,p){typeof arguments[3]=="function"&&u("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect().");var v=c0(l),w={lane:v,action:p,hasEagerState:!1,eagerState:null,next:null};if(Wie(l))Uie(c,w);else{var R=l.alternate;if(l.lanes===bt&&(R===null||R.lanes===bt)){var P=c.lastRenderedReducer;if(P!==null){var $;$=fn.current,fn.current=_h;try{var Y=c.lastRenderedState,le=P(Y,p);if(w.hasEagerState=!0,w.eagerState=le,on(le,Y)){iWe(l,c,w,v);return}}catch{}finally{fn.current=$}}}var ue=yie(l,c,w,v);if(ue!==null){var He=fc();wa(ue,l,v,He),Yie(ue,c,v)}}Gie(l,v)}function Wie(l){var c=l.alternate;return l===Ii||c!==null&&c===Ii}function Uie(l,c){ek=ZI=!0;var p=l.pending;p===null?c.next=c:(c.next=p.next,p.next=c),l.pending=c}function Yie(l,c,p){if(cN(p)){var v=c.lanes;v=SS(v,l.pendingLanes);var w=br(v,p);c.lanes=w,By(l,w)}}function Gie(l,c,p){Ay(l,c)}var dD={readContext:qo,useCallback:Il,useContext:Il,useEffect:Il,useImperativeHandle:Il,useInsertionEffect:Il,useLayoutEffect:Il,useMemo:Il,useReducer:Il,useRef:Il,useState:Il,useDebugValue:Il,useDeferredValue:Il,useTransition:Il,useMutableSource:Il,useSyncExternalStore:Il,useId:Il,unstable_isNewReconciler:Ze},Kie=null,qie=null,Xie=null,Qie=null,em=null,_h=null,hD=null;{var qB=function(){u("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")},or=function(){u("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks")};Kie={readContext:function(l){return qo(l)},useCallback:function(l,c){return yt="useCallback",vi(),c1(c),WB(l,c)},useContext:function(l){return yt="useContext",vi(),qo(l)},useEffect:function(l,c){return yt="useEffect",vi(),c1(c),rD(l,c)},useImperativeHandle:function(l,c,p){return yt="useImperativeHandle",vi(),c1(p),BB(l,c,p)},useInsertionEffect:function(l,c){return yt="useInsertionEffect",vi(),c1(c),zB(l,c)},useLayoutEffect:function(l,c){return yt="useLayoutEffect",vi(),c1(c),VB(l,c)},useMemo:function(l,c){yt="useMemo",vi(),c1(c);var p=fn.current;fn.current=em;try{return UB(l,c)}finally{fn.current=p}},useReducer:function(l,c,p){yt="useReducer",vi();var v=fn.current;fn.current=em;try{return OB(l,c,p)}finally{fn.current=v}},useRef:function(l){return yt="useRef",vi(),FB(l)},useState:function(l){yt="useState",vi();var c=fn.current;fn.current=em;try{return eD(l)}finally{fn.current=c}},useDebugValue:function(l,c){return yt="useDebugValue",vi(),void 0},useDeferredValue:function(l){return yt="useDeferredValue",vi(),YB(l)},useTransition:function(){return yt="useTransition",vi(),GB()},useMutableSource:function(l,c,p){return yt="useMutableSource",vi(),void 0},useSyncExternalStore:function(l,c,p){return yt="useSyncExternalStore",vi(),HB(l,c,p)},useId:function(){return yt="useId",vi(),KB()},unstable_isNewReconciler:Ze},qie={readContext:function(l){return qo(l)},useCallback:function(l,c){return yt="useCallback",Yt(),WB(l,c)},useContext:function(l){return yt="useContext",Yt(),qo(l)},useEffect:function(l,c){return yt="useEffect",Yt(),rD(l,c)},useImperativeHandle:function(l,c,p){return yt="useImperativeHandle",Yt(),BB(l,c,p)},useInsertionEffect:function(l,c){return yt="useInsertionEffect",Yt(),zB(l,c)},useLayoutEffect:function(l,c){return yt="useLayoutEffect",Yt(),VB(l,c)},useMemo:function(l,c){yt="useMemo",Yt();var p=fn.current;fn.current=em;try{return UB(l,c)}finally{fn.current=p}},useReducer:function(l,c,p){yt="useReducer",Yt();var v=fn.current;fn.current=em;try{return OB(l,c,p)}finally{fn.current=v}},useRef:function(l){return yt="useRef",Yt(),FB(l)},useState:function(l){yt="useState",Yt();var c=fn.current;fn.current=em;try{return eD(l)}finally{fn.current=c}},useDebugValue:function(l,c){return yt="useDebugValue",Yt(),void 0},useDeferredValue:function(l){return yt="useDeferredValue",Yt(),YB(l)},useTransition:function(){return yt="useTransition",Yt(),GB()},useMutableSource:function(l,c,p){return yt="useMutableSource",Yt(),void 0},useSyncExternalStore:function(l,c,p){return yt="useSyncExternalStore",Yt(),HB(l,c,p)},useId:function(){return yt="useId",Yt(),KB()},unstable_isNewReconciler:Ze},Xie={readContext:function(l){return qo(l)},useCallback:function(l,c){return yt="useCallback",Yt(),lD(l,c)},useContext:function(l){return yt="useContext",Yt(),qo(l)},useEffect:function(l,c){return yt="useEffect",Yt(),ik(l,c)},useImperativeHandle:function(l,c,p){return yt="useImperativeHandle",Yt(),oD(l,c,p)},useInsertionEffect:function(l,c){return yt="useInsertionEffect",Yt(),iD(l,c)},useLayoutEffect:function(l,c){return yt="useLayoutEffect",Yt(),sD(l,c)},useMemo:function(l,c){yt="useMemo",Yt();var p=fn.current;fn.current=_h;try{return cD(l,c)}finally{fn.current=p}},useReducer:function(l,c,p){yt="useReducer",Yt();var v=fn.current;fn.current=_h;try{return IB(l,c,p)}finally{fn.current=v}},useRef:function(l){return yt="useRef",Yt(),tD()},useState:function(l){yt="useState",Yt();var c=fn.current;fn.current=_h;try{return LB(l)}finally{fn.current=c}},useDebugValue:function(l,c){return yt="useDebugValue",Yt(),aD()},useDeferredValue:function(l){return yt="useDeferredValue",Yt(),Lie(l)},useTransition:function(){return yt="useTransition",Yt(),zie()},useMutableSource:function(l,c,p){return yt="useMutableSource",Yt(),void 0},useSyncExternalStore:function(l,c,p){return yt="useSyncExternalStore",Yt(),JI(l,c)},useId:function(){return yt="useId",Yt(),uD()},unstable_isNewReconciler:Ze},Qie={readContext:function(l){return qo(l)},useCallback:function(l,c){return yt="useCallback",Yt(),lD(l,c)},useContext:function(l){return yt="useContext",Yt(),qo(l)},useEffect:function(l,c){return yt="useEffect",Yt(),ik(l,c)},useImperativeHandle:function(l,c,p){return yt="useImperativeHandle",Yt(),oD(l,c,p)},useInsertionEffect:function(l,c){return yt="useInsertionEffect",Yt(),iD(l,c)},useLayoutEffect:function(l,c){return yt="useLayoutEffect",Yt(),sD(l,c)},useMemo:function(l,c){yt="useMemo",Yt();var p=fn.current;fn.current=hD;try{return cD(l,c)}finally{fn.current=p}},useReducer:function(l,c,p){yt="useReducer",Yt();var v=fn.current;fn.current=hD;try{return DB(l,c,p)}finally{fn.current=v}},useRef:function(l){return yt="useRef",Yt(),tD()},useState:function(l){yt="useState",Yt();var c=fn.current;fn.current=hD;try{return $B(l)}finally{fn.current=c}},useDebugValue:function(l,c){return yt="useDebugValue",Yt(),aD()},useDeferredValue:function(l){return yt="useDeferredValue",Yt(),$ie(l)},useTransition:function(){return yt="useTransition",Yt(),Vie()},useMutableSource:function(l,c,p){return yt="useMutableSource",Yt(),void 0},useSyncExternalStore:function(l,c,p){return yt="useSyncExternalStore",Yt(),JI(l,c)},useId:function(){return yt="useId",Yt(),uD()},unstable_isNewReconciler:Ze},em={readContext:function(l){return qB(),qo(l)},useCallback:function(l,c){return yt="useCallback",or(),vi(),WB(l,c)},useContext:function(l){return yt="useContext",or(),vi(),qo(l)},useEffect:function(l,c){return yt="useEffect",or(),vi(),rD(l,c)},useImperativeHandle:function(l,c,p){return yt="useImperativeHandle",or(),vi(),BB(l,c,p)},useInsertionEffect:function(l,c){return yt="useInsertionEffect",or(),vi(),zB(l,c)},useLayoutEffect:function(l,c){return yt="useLayoutEffect",or(),vi(),VB(l,c)},useMemo:function(l,c){yt="useMemo",or(),vi();var p=fn.current;fn.current=em;try{return UB(l,c)}finally{fn.current=p}},useReducer:function(l,c,p){yt="useReducer",or(),vi();var v=fn.current;fn.current=em;try{return OB(l,c,p)}finally{fn.current=v}},useRef:function(l){return yt="useRef",or(),vi(),FB(l)},useState:function(l){yt="useState",or(),vi();var c=fn.current;fn.current=em;try{return eD(l)}finally{fn.current=c}},useDebugValue:function(l,c){return yt="useDebugValue",or(),vi(),void 0},useDeferredValue:function(l){return yt="useDeferredValue",or(),vi(),YB(l)},useTransition:function(){return yt="useTransition",or(),vi(),GB()},useMutableSource:function(l,c,p){return yt="useMutableSource",or(),vi(),void 0},useSyncExternalStore:function(l,c,p){return yt="useSyncExternalStore",or(),vi(),HB(l,c,p)},useId:function(){return yt="useId",or(),vi(),KB()},unstable_isNewReconciler:Ze},_h={readContext:function(l){return qB(),qo(l)},useCallback:function(l,c){return yt="useCallback",or(),Yt(),lD(l,c)},useContext:function(l){return yt="useContext",or(),Yt(),qo(l)},useEffect:function(l,c){return yt="useEffect",or(),Yt(),ik(l,c)},useImperativeHandle:function(l,c,p){return yt="useImperativeHandle",or(),Yt(),oD(l,c,p)},useInsertionEffect:function(l,c){return yt="useInsertionEffect",or(),Yt(),iD(l,c)},useLayoutEffect:function(l,c){return yt="useLayoutEffect",or(),Yt(),sD(l,c)},useMemo:function(l,c){yt="useMemo",or(),Yt();var p=fn.current;fn.current=_h;try{return cD(l,c)}finally{fn.current=p}},useReducer:function(l,c,p){yt="useReducer",or(),Yt();var v=fn.current;fn.current=_h;try{return IB(l,c,p)}finally{fn.current=v}},useRef:function(l){return yt="useRef",or(),Yt(),tD()},useState:function(l){yt="useState",or(),Yt();var c=fn.current;fn.current=_h;try{return LB(l)}finally{fn.current=c}},useDebugValue:function(l,c){return yt="useDebugValue",or(),Yt(),aD()},useDeferredValue:function(l){return yt="useDeferredValue",or(),Yt(),Lie(l)},useTransition:function(){return yt="useTransition",or(),Yt(),zie()},useMutableSource:function(l,c,p){return yt="useMutableSource",or(),Yt(),void 0},useSyncExternalStore:function(l,c,p){return yt="useSyncExternalStore",or(),Yt(),JI(l,c)},useId:function(){return yt="useId",or(),Yt(),uD()},unstable_isNewReconciler:Ze},hD={readContext:function(l){return qB(),qo(l)},useCallback:function(l,c){return yt="useCallback",or(),Yt(),lD(l,c)},useContext:function(l){return yt="useContext",or(),Yt(),qo(l)},useEffect:function(l,c){return yt="useEffect",or(),Yt(),ik(l,c)},useImperativeHandle:function(l,c,p){return yt="useImperativeHandle",or(),Yt(),oD(l,c,p)},useInsertionEffect:function(l,c){return yt="useInsertionEffect",or(),Yt(),iD(l,c)},useLayoutEffect:function(l,c){return yt="useLayoutEffect",or(),Yt(),sD(l,c)},useMemo:function(l,c){yt="useMemo",or(),Yt();var p=fn.current;fn.current=_h;try{return cD(l,c)}finally{fn.current=p}},useReducer:function(l,c,p){yt="useReducer",or(),Yt();var v=fn.current;fn.current=_h;try{return DB(l,c,p)}finally{fn.current=v}},useRef:function(l){return yt="useRef",or(),Yt(),tD()},useState:function(l){yt="useState",or(),Yt();var c=fn.current;fn.current=_h;try{return $B(l)}finally{fn.current=c}},useDebugValue:function(l,c){return yt="useDebugValue",or(),Yt(),aD()},useDeferredValue:function(l){return yt="useDeferredValue",or(),Yt(),$ie(l)},useTransition:function(){return yt="useTransition",or(),Yt(),Vie()},useMutableSource:function(l,c,p){return yt="useMutableSource",or(),Yt(),void 0},useSyncExternalStore:function(l,c,p){return yt="useSyncExternalStore",or(),Yt(),JI(l,c)},useId:function(){return yt="useId",or(),Yt(),uD()},unstable_isNewReconciler:Ze}}var s0=n.unstable_now,Zie=0,fD=-1,sk=-1,mD=-1,XB=!1,pD=!1;function Jie(){return XB}function wWe(){pD=!0}function CWe(){XB=!1,pD=!1}function SWe(){XB=pD,pD=!1}function ese(){return Zie}function tse(){Zie=s0()}function QB(l){sk=s0(),l.actualStartTime<0&&(l.actualStartTime=s0())}function nse(l){sk=-1}function gD(l,c){if(sk>=0){var p=s0()-sk;l.actualDuration+=p,c&&(l.selfBaseDuration=p),sk=-1}}function tm(l){if(fD>=0){var c=s0()-fD;fD=-1;for(var p=l.return;p!==null;){switch(p.tag){case x:var v=p.stateNode;v.effectDuration+=c;return;case V:var w=p.stateNode;w.effectDuration+=c;return}p=p.return}}}function ZB(l){if(mD>=0){var c=s0()-mD;mD=-1;for(var p=l.return;p!==null;){switch(p.tag){case x:var v=p.stateNode;v!==null&&(v.passiveEffectDuration+=c);return;case V:var w=p.stateNode;w!==null&&(w.passiveEffectDuration+=c);return}p=p.return}}}function nm(){fD=s0()}function JB(){mD=s0()}function eW(l){for(var c=l.child;c;)l.actualDuration+=c.actualDuration,c=c.sibling}function Eh(l,c){if(l&&l.defaultProps){var p=Bt({},c),v=l.defaultProps;for(var w in v)p[w]===void 0&&(p[w]=v[w]);return p}return c}var tW={},nW,rW,iW,sW,oW,rse,vD,aW,lW,cW,ok;{nW=new Set,rW=new Set,iW=new Set,sW=new Set,aW=new Set,oW=new Set,lW=new Set,cW=new Set,ok=new Set;var ise=new Set;vD=function(l,c){if(!(l===null||typeof l=="function")){var p=c+"_"+l;ise.has(p)||(ise.add(p),u("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",c,l))}},rse=function(l,c){if(c===void 0){var p=sr(l)||"Component";oW.has(p)||(oW.add(p),u("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",p))}},Object.defineProperty(tW,"_processChildContext",{enumerable:!1,value:function(){throw new Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).")}}),Object.freeze(tW)}function uW(l,c,p,v){var w=l.memoizedState,R=p(v,w);{if(l.mode&hr){Ci(!0);try{R=p(v,w)}finally{Ci(!1)}}rse(c,R)}var P=R==null?w:Bt({},w,R);if(l.memoizedState=P,l.lanes===bt){var $=l.updateQueue;$.baseState=P}}var dW={isMounted:WE,enqueueSetState:function(l,c,p){var v=kv(l),w=fc(),R=c0(v),P=Bp(w,R);P.payload=c,p!=null&&(vD(p,"setState"),P.callback=p);var $=t0(v,P,R);$!==null&&(wa($,v,R,w),YI($,v,R)),Ay(v,R)},enqueueReplaceState:function(l,c,p){var v=kv(l),w=fc(),R=c0(v),P=Bp(w,R);P.tag=wie,P.payload=c,p!=null&&(vD(p,"replaceState"),P.callback=p);var $=t0(v,P,R);$!==null&&(wa($,v,R,w),YI($,v,R)),Ay(v,R)},enqueueForceUpdate:function(l,c){var p=kv(l),v=fc(),w=c0(p),R=Bp(v,w);R.tag=BI,c!=null&&(vD(c,"forceUpdate"),R.callback=c);var P=t0(p,R,w);P!==null&&(wa(P,p,w,v),YI(P,p,w)),iN(p,w)}};function sse(l,c,p,v,w,R,P){var $=l.stateNode;if(typeof $.shouldComponentUpdate=="function"){var Y=$.shouldComponentUpdate(v,R,P);{if(l.mode&hr){Ci(!0);try{Y=$.shouldComponentUpdate(v,R,P)}finally{Ci(!1)}}Y===void 0&&u("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",sr(c)||"Component")}return Y}return c.prototype&&c.prototype.isPureReactComponent?!On(p,v)||!On(w,R):!0}function RWe(l,c,p){var v=l.stateNode;{var w=sr(c)||"Component",R=v.render;R||(c.prototype&&typeof c.prototype.render=="function"?u("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?",w):u("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.",w)),v.getInitialState&&!v.getInitialState.isReactClassApproved&&!v.state&&u("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",w),v.getDefaultProps&&!v.getDefaultProps.isReactClassApproved&&u("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",w),v.propTypes&&u("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.",w),v.contextType&&u("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",w),c.childContextTypes&&!ok.has(c)&&(l.mode&hr)===Pn&&(ok.add(c),u(`%s uses the legacy childContextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() instead .Learn more about this warning here: https://reactjs.org/link/legacy-context`,w)),c.contextTypes&&!ok.has(c)&&(l.mode&hr)===Pn&&(ok.add(c),u(`%s uses the legacy contextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext() with static contextType instead. Learn more about this warning here: https://reactjs.org/link/legacy-context`,w)),v.contextTypes&&u("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.",w),c.contextType&&c.contextTypes&&!lW.has(c)&&(lW.add(c),u("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.",w)),typeof v.componentShouldUpdate=="function"&&u("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",w),c.prototype&&c.prototype.isPureReactComponent&&typeof v.shouldComponentUpdate<"u"&&u("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",sr(c)||"A pure component"),typeof v.componentDidUnmount=="function"&&u("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",w),typeof v.componentDidReceiveProps=="function"&&u("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",w),typeof v.componentWillRecieveProps=="function"&&u("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",w),typeof v.UNSAFE_componentWillRecieveProps=="function"&&u("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",w);var P=v.props!==p;v.props!==void 0&&P&&u("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",w,w),v.defaultProps&&u("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",w,w),typeof v.getSnapshotBeforeUpdate=="function"&&typeof v.componentDidUpdate!="function"&&!iW.has(c)&&(iW.add(c),u("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",sr(c))),typeof v.getDerivedStateFromProps=="function"&&u("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",w),typeof v.getDerivedStateFromError=="function"&&u("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",w),typeof c.getSnapshotBeforeUpdate=="function"&&u("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",w);var $=v.state;$&&(typeof $!="object"||vr($))&&u("%s.state: must be set to an object or null",w),typeof v.getChildContext=="function"&&typeof c.childContextTypes!="object"&&u("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",w)}}function ose(l,c){c.updater=dW,l.stateNode=c,Ey(c,l),c._reactInternalInstance=tW}function ase(l,c,p){var v=!1,w=Du,R=Du,P=c.contextType;if("contextType"in c){var $=P===null||P!==void 0&&P.$$typeof===oe&&P._context===void 0;if(!$&&!cW.has(c)){cW.add(c);var Y="";P===void 0?Y=" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":typeof P!="object"?Y=" However, it is set to a "+typeof P+".":P.$$typeof===Ne?Y=" Did you accidentally pass the Context.Provider instead?":P._context!==void 0?Y=" Did you accidentally pass the Context.Consumer instead?":Y=" However, it is set to an object with keys {"+Object.keys(P).join(", ")+"}.",u("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",sr(c)||"Component",Y)}}if(typeof P=="object"&&P!==null)R=qo(P);else{w=QS(l,c,!0);var le=c.contextTypes;v=le!=null,R=v?ZS(l,w):Du}var ue=new c(p,R);if(l.mode&hr){Ci(!0);try{ue=new c(p,R)}finally{Ci(!1)}}var He=l.memoizedState=ue.state!==null&&ue.state!==void 0?ue.state:null;ose(l,ue);{if(typeof c.getDerivedStateFromProps=="function"&&He===null){var Ie=sr(c)||"Component";rW.has(Ie)||(rW.add(Ie),u("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",Ie,ue.state===null?"null":"undefined",Ie))}if(typeof c.getDerivedStateFromProps=="function"||typeof ue.getSnapshotBeforeUpdate=="function"){var et=null,it=null,mt=null;if(typeof ue.componentWillMount=="function"&&ue.componentWillMount.__suppressDeprecationWarning!==!0?et="componentWillMount":typeof ue.UNSAFE_componentWillMount=="function"&&(et="UNSAFE_componentWillMount"),typeof ue.componentWillReceiveProps=="function"&&ue.componentWillReceiveProps.__suppressDeprecationWarning!==!0?it="componentWillReceiveProps":typeof ue.UNSAFE_componentWillReceiveProps=="function"&&(it="UNSAFE_componentWillReceiveProps"),typeof ue.componentWillUpdate=="function"&&ue.componentWillUpdate.__suppressDeprecationWarning!==!0?mt="componentWillUpdate":typeof ue.UNSAFE_componentWillUpdate=="function"&&(mt="UNSAFE_componentWillUpdate"),et!==null||it!==null||mt!==null){var Zt=sr(c)||"Component",$n=typeof c.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";sW.has(Zt)||(sW.add(Zt),u(`Unsafe legacy lifecycles will not be called for components using new component APIs. %s uses %s but also contains the following legacy lifecycles:%s%s%s The above lifecycles should be removed. Learn more about this warning here: https://reactjs.org/link/unsafe-component-lifecycles`,Zt,$n,et!==null?` `+et:"",it!==null?` `+it:"",mt!==null?` `+mt:""))}}}return v&&Xre(l,w,R),ue}function _We(l,c){var p=c.state;typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),p!==c.state&&(u("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",_n(l)||"Component"),dW.enqueueReplaceState(c,c.state,null))}function lse(l,c,p,v){var w=c.state;if(typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(p,v),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(p,v),c.state!==w){{var R=_n(l)||"Component";nW.has(R)||(nW.add(R),u("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",R))}dW.enqueueReplaceState(c,c.state,null)}}function hW(l,c,p,v){RWe(l,c,p);var w=l.stateNode;w.props=p,w.state=l.memoizedState,w.refs={},wB(l);var R=c.contextType;if(typeof R=="object"&&R!==null)w.context=qo(R);else{var P=QS(l,c,!0);w.context=ZS(l,P)}{if(w.state===p){var $=sr(c)||"Component";aW.has($)||(aW.add($),u("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",$))}l.mode&hr&&Sh.recordLegacyContextWarning(l,w),Sh.recordUnsafeLifecycleWarnings(l,w)}w.state=l.memoizedState;var Y=c.getDerivedStateFromProps;if(typeof Y=="function"&&(uW(l,c,Y,p),w.state=l.memoizedState),typeof c.getDerivedStateFromProps!="function"&&typeof w.getSnapshotBeforeUpdate!="function"&&(typeof w.UNSAFE_componentWillMount=="function"||typeof w.componentWillMount=="function")&&(_We(l,w),GI(l,p,w,v),w.state=l.memoizedState),typeof w.componentDidMount=="function"){var le=Ir;le|=Mf,(l.mode&Oi)!==Pn&&(le|=Wa),l.flags|=le}}function EWe(l,c,p,v){var w=l.stateNode,R=l.memoizedProps;w.props=R;var P=w.context,$=c.contextType,Y=Du;if(typeof $=="object"&&$!==null)Y=qo($);else{var le=QS(l,c,!0);Y=ZS(l,le)}var ue=c.getDerivedStateFromProps,He=typeof ue=="function"||typeof w.getSnapshotBeforeUpdate=="function";!He&&(typeof w.UNSAFE_componentWillReceiveProps=="function"||typeof w.componentWillReceiveProps=="function")&&(R!==p||P!==Y)&&lse(l,w,p,Y),Sie();var Ie=l.memoizedState,et=w.state=Ie;if(GI(l,p,w,v),et=l.memoizedState,R===p&&Ie===et&&!kI()&&!KI()){if(typeof w.componentDidMount=="function"){var it=Ir;it|=Mf,(l.mode&Oi)!==Pn&&(it|=Wa),l.flags|=it}return!1}typeof ue=="function"&&(uW(l,c,ue,p),et=l.memoizedState);var mt=KI()||sse(l,c,R,p,Ie,et,Y);if(mt){if(!He&&(typeof w.UNSAFE_componentWillMount=="function"||typeof w.componentWillMount=="function")&&(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"){var Zt=Ir;Zt|=Mf,(l.mode&Oi)!==Pn&&(Zt|=Wa),l.flags|=Zt}}else{if(typeof w.componentDidMount=="function"){var $n=Ir;$n|=Mf,(l.mode&Oi)!==Pn&&($n|=Wa),l.flags|=$n}l.memoizedProps=p,l.memoizedState=et}return w.props=p,w.state=et,w.context=Y,mt}function NWe(l,c,p,v,w){var R=c.stateNode;Cie(l,c);var P=c.memoizedProps,$=c.type===c.elementType?P:Eh(c.type,P);R.props=$;var Y=c.pendingProps,le=R.context,ue=p.contextType,He=Du;if(typeof ue=="object"&&ue!==null)He=qo(ue);else{var Ie=QS(c,p,!0);He=ZS(c,Ie)}var et=p.getDerivedStateFromProps,it=typeof et=="function"||typeof R.getSnapshotBeforeUpdate=="function";!it&&(typeof R.UNSAFE_componentWillReceiveProps=="function"||typeof R.componentWillReceiveProps=="function")&&(P!==Y||le!==He)&&lse(c,R,v,He),Sie();var mt=c.memoizedState,Zt=R.state=mt;if(GI(c,v,R,w),Zt=c.memoizedState,P===Y&&mt===Zt&&!kI()&&!KI()&&!Ee)return typeof R.componentDidUpdate=="function"&&(P!==l.memoizedProps||mt!==l.memoizedState)&&(c.flags|=Ir),typeof R.getSnapshotBeforeUpdate=="function"&&(P!==l.memoizedProps||mt!==l.memoizedState)&&(c.flags|=zc),!1;typeof et=="function"&&(uW(c,p,et,v),Zt=c.memoizedState);var $n=KI()||sse(c,p,$,v,mt,Zt,He)||Ee;return $n?(!it&&(typeof R.UNSAFE_componentWillUpdate=="function"||typeof R.componentWillUpdate=="function")&&(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(v,Zt,He),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(v,Zt,He)),typeof R.componentDidUpdate=="function"&&(c.flags|=Ir),typeof R.getSnapshotBeforeUpdate=="function"&&(c.flags|=zc)):(typeof R.componentDidUpdate=="function"&&(P!==l.memoizedProps||mt!==l.memoizedState)&&(c.flags|=Ir),typeof R.getSnapshotBeforeUpdate=="function"&&(P!==l.memoizedProps||mt!==l.memoizedState)&&(c.flags|=zc),c.memoizedProps=v,c.memoizedState=Zt),R.props=v,R.state=Zt,R.context=He,$n}function px(l,c){return{value:l,source:c,stack:Cr(c),digest:null}}function fW(l,c,p){return{value:l,source:null,stack:p??null,digest:c??null}}function kWe(l,c){return!0}function mW(l,c){try{var p=kWe(l,c);if(p===!1)return;var v=c.value,w=c.source,R=c.stack,P=R!==null?R:"";if(v!=null&&v._suppressLogging){if(l.tag===g)return;console.error(v)}var $=w?_n(w):null,Y=$?"The above error occurred in the <"+$+"> component:":"The above error occurred in one of your React components:",le;if(l.tag===x)le=`Consider adding an error boundary to your tree to customize error handling behavior. Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.`;else{var ue=_n(l)||"Anonymous";le="React will try to recreate this component tree from scratch "+("using the error boundary you provided, "+ue+".")}var He=Y+` `+P+` `+(""+le);console.error(He)}catch(Ie){setTimeout(function(){throw Ie})}}var TWe=typeof WeakMap=="function"?WeakMap:Map;function cse(l,c,p){var v=Bp(Si,p);v.tag=yB,v.payload={element:null};var w=c.value;return v.callback=function(){w8e(w),mW(l,c)},v}function pW(l,c,p){var v=Bp(Si,p);v.tag=yB;var w=l.type.getDerivedStateFromError;if(typeof w=="function"){var R=c.value;v.payload=function(){return w(R)},v.callback=function(){xoe(l),mW(l,c)}}var P=l.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(v.callback=function(){xoe(l),mW(l,c),typeof w!="function"&&y8e(this);var Y=c.value,le=c.stack;this.componentDidCatch(Y,{componentStack:le!==null?le:""}),typeof w!="function"&&(jl(l.lanes,Un)||u("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",_n(l)||"Unknown"))}),v}function use(l,c,p){var v=l.pingCache,w;if(v===null?(v=l.pingCache=new TWe,w=new Set,v.set(c,w)):(w=v.get(c),w===void 0&&(w=new Set,v.set(c,w))),!w.has(p)){w.add(p);var R=C8e.bind(null,l,c,p);Pa&&Sk(l,p),c.then(R,R)}}function jWe(l,c,p,v){var w=l.updateQueue;if(w===null){var R=new Set;R.add(p),l.updateQueue=R}else w.add(p)}function MWe(l,c){var p=l.tag;if((l.mode&jr)===Pn&&(p===m||p===H||p===te)){var v=l.alternate;v?(l.updateQueue=v.updateQueue,l.memoizedState=v.memoizedState,l.lanes=v.lanes):(l.updateQueue=null,l.memoizedState=null)}}function dse(l){var c=l;do{if(c.tag===F&&dWe(c))return c;c=c.return}while(c!==null);return null}function hse(l,c,p,v,w){if((l.mode&jr)===Pn){if(l===c)l.flags|=Ma;else{if(l.flags|=_r,p.flags|=Mu,p.flags&=-52805,p.tag===g){var R=p.alternate;if(R===null)p.tag=ce;else{var P=Bp(Si,Un);P.tag=BI,t0(p,P,Un)}}p.lanes=br(p.lanes,Un)}return l}return l.flags|=Ma,l.lanes=w,l}function PWe(l,c,p,v,w){if(p.flags|=bp,Pa&&Sk(l,w),v!==null&&typeof v=="object"&&typeof v.then=="function"){var R=v;MWe(p),Ka()&&p.mode&jr&&rie();var P=dse(c);if(P!==null){P.flags&=~is,hse(P,c,p,l,w),P.mode&jr&&use(l,R,w),jWe(P,l,R);return}else{if(!aN(w)){use(l,R,w),KW();return}var $=new Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.");v=$}}else if(Ka()&&p.mode&jr){rie();var Y=dse(c);if(Y!==null){(Y.flags&Ma)===Mn&&(Y.flags|=is),hse(Y,c,p,l,w),aB(px(v,p));return}}v=px(v,p),d8e(v);var le=c;do{switch(le.tag){case x:{var ue=v;le.flags|=Ma;var He=Go(w);le.lanes=br(le.lanes,He);var Ie=cse(le,ue,He);CB(le,Ie);return}case g:var et=v,it=le.type,mt=le.stateNode;if((le.flags&_r)===Mn&&(typeof it.getDerivedStateFromError=="function"||mt!==null&&typeof mt.componentDidCatch=="function"&&!doe(mt))){le.flags|=Ma;var Zt=Go(w);le.lanes=br(le.lanes,Zt);var $n=pW(le,et,Zt);CB(le,$n);return}break}le=le.return}while(le!==null)}function AWe(){return null}var ak=r.ReactCurrentOwner,Nh=!1,gW,lk,vW,bW,yW,gx,xW,bD,ck;gW={},lk={},vW={},bW={},yW={},gx=!1,xW={},bD={},ck={};function dc(l,c,p,v){l===null?c.child=pie(c,null,p,v):c.child=n1(c,l.child,p,v)}function OWe(l,c,p,v){c.child=n1(c,l.child,null,v),c.child=n1(c,null,p,v)}function fse(l,c,p,v,w){if(c.type!==c.elementType){var R=p.propTypes;R&&wh(R,v,"prop",sr(p))}var P=p.render,$=c.ref,Y,le;i1(c,w),Vc(c);{if(ak.current=c,Rs(!0),Y=u1(l,c,P,v,$,w),le=d1(),c.mode&hr){Ci(!0);try{Y=u1(l,c,P,v,$,w),le=d1()}finally{Ci(!1)}}Rs(!1)}return Df(),l!==null&&!Nh?(Tie(l,c,w),Wp(l,c,w)):(Ka()&&le&&tB(c),c.flags|=gh,dc(l,c,Y,w),c.child)}function mse(l,c,p,v,w){if(l===null){var R=p.type;if($8e(R)&&p.compare===null&&p.defaultProps===void 0){var P=R;return P=y1(R),c.tag=te,c.type=P,SW(c,R),pse(l,c,P,v,w)}{var $=R.propTypes;if($&&wh($,v,"prop",sr(R)),p.defaultProps!==void 0){var Y=sr(R)||"Unknown";ck[Y]||(u("%s: Support for defaultProps will be removed from memo components in a future major release. Use JavaScript default parameters instead.",Y),ck[Y]=!0)}}var le=sU(p.type,null,v,c,c.mode,w);return le.ref=c.ref,le.return=c,c.child=le,le}{var ue=p.type,He=ue.propTypes;He&&wh(He,v,"prop",sr(ue))}var Ie=l.child,et=TW(l,w);if(!et){var it=Ie.memoizedProps,mt=p.compare;if(mt=mt!==null?mt:On,mt(it,v)&&l.ref===c.ref)return Wp(l,c,w)}c.flags|=gh;var Zt=wx(Ie,v);return Zt.ref=c.ref,Zt.return=c,c.child=Zt,Zt}function pse(l,c,p,v,w){if(c.type!==c.elementType){var R=c.elementType;if(R.$$typeof===$t){var P=R,$=P._payload,Y=P._init;try{R=Y($)}catch{R=null}var le=R&&R.propTypes;le&&wh(le,v,"prop",sr(R))}}if(l!==null){var ue=l.memoizedProps;if(On(ue,v)&&l.ref===c.ref&&c.type===l.type)if(Nh=!1,c.pendingProps=v=ue,TW(l,w))(l.flags&Mu)!==Mn&&(Nh=!0);else return c.lanes=l.lanes,Wp(l,c,w)}return wW(l,c,p,v,w)}function gse(l,c,p){var v=c.pendingProps,w=v.children,R=l!==null?l.memoizedState:null;if(v.mode==="hidden"||Q)if((c.mode&jr)===Pn){var P={baseLanes:bt,cachePool:null,transitions:null};c.memoizedState=P,MD(c,p)}else if(jl(p,kl)){var He={baseLanes:bt,cachePool:null,transitions:null};c.memoizedState=He;var Ie=R!==null?R.baseLanes:p;MD(c,Ie)}else{var $=null,Y;if(R!==null){var le=R.baseLanes;Y=br(le,p)}else Y=p;c.lanes=c.childLanes=kl;var ue={baseLanes:Y,cachePool:$,transitions:null};return c.memoizedState=ue,c.updateQueue=null,MD(c,Y),null}else{var et;R!==null?(et=br(R.baseLanes,p),c.memoizedState=null):et=p,MD(c,et)}return dc(l,c,w,p),c.child}function IWe(l,c,p){var v=c.pendingProps;return dc(l,c,v,p),c.child}function DWe(l,c,p){var v=c.pendingProps.children;return dc(l,c,v,p),c.child}function HWe(l,c,p){{c.flags|=Ir;{var v=c.stateNode;v.effectDuration=0,v.passiveEffectDuration=0}}var w=c.pendingProps,R=w.children;return dc(l,c,R,p),c.child}function vse(l,c){var p=c.ref;(l===null&&p!==null||l!==null&&l.ref!==p)&&(c.flags|=oo,c.flags|=ky)}function wW(l,c,p,v,w){if(c.type!==c.elementType){var R=p.propTypes;R&&wh(R,v,"prop",sr(p))}var P;{var $=QS(c,p,!0);P=ZS(c,$)}var Y,le;i1(c,w),Vc(c);{if(ak.current=c,Rs(!0),Y=u1(l,c,p,v,P,w),le=d1(),c.mode&hr){Ci(!0);try{Y=u1(l,c,p,v,P,w),le=d1()}finally{Ci(!1)}}Rs(!1)}return Df(),l!==null&&!Nh?(Tie(l,c,w),Wp(l,c,w)):(Ka()&&le&&tB(c),c.flags|=gh,dc(l,c,Y,w),c.child)}function bse(l,c,p,v,w){{switch(e9e(c)){case!1:{var R=c.stateNode,P=c.type,$=new P(c.memoizedProps,R.context),Y=$.state;R.updater.enqueueSetState(R,Y,null);break}case!0:{c.flags|=_r,c.flags|=Ma;var le=new Error("Simulated error coming from DevTools"),ue=Go(w);c.lanes=br(c.lanes,ue);var He=pW(c,px(le,c),ue);CB(c,He);break}}if(c.type!==c.elementType){var Ie=p.propTypes;Ie&&wh(Ie,v,"prop",sr(p))}}var et;Qf(p)?(et=!0,jI(c)):et=!1,i1(c,w);var it=c.stateNode,mt;it===null?(xD(l,c),ase(c,p,v),hW(c,p,v,w),mt=!0):l===null?mt=EWe(c,p,v,w):mt=NWe(l,c,p,v,w);var Zt=CW(l,c,p,mt,et,w);{var $n=c.stateNode;mt&&$n.props!==v&&(gx||u("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",_n(c)||"a component"),gx=!0)}return Zt}function CW(l,c,p,v,w,R){vse(l,c);var P=(c.flags&_r)!==Mn;if(!v&&!P)return w&&Jre(c,p,!1),Wp(l,c,R);var $=c.stateNode;ak.current=c;var Y;if(P&&typeof p.getDerivedStateFromError!="function")Y=null,nse();else{Vc(c);{if(Rs(!0),Y=$.render(),c.mode&hr){Ci(!0);try{$.render()}finally{Ci(!1)}}Rs(!1)}Df()}return c.flags|=gh,l!==null&&P?OWe(l,c,Y,R):dc(l,c,Y,R),c.memoizedState=$.state,w&&Jre(c,p,!0),c.child}function yse(l){var c=l.stateNode;c.pendingContext?Qre(l,c.pendingContext,c.pendingContext!==c.context):c.context&&Qre(l,c.context,!1),SB(l,c.containerInfo)}function LWe(l,c,p){if(yse(c),l===null)throw new Error("Should have a current fiber. This is a bug in React.");var v=c.pendingProps,w=c.memoizedState,R=w.element;Cie(l,c),GI(c,v,null,p);var P=c.memoizedState;c.stateNode;var $=P.element;if(w.isDehydrated){var Y={element:$,isDehydrated:!1,cache:P.cache,pendingSuspenseBoundaries:P.pendingSuspenseBoundaries,transitions:P.transitions},le=c.updateQueue;if(le.baseState=Y,c.memoizedState=Y,c.flags&is){var ue=px(new Error("There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering."),c);return xse(l,c,$,p,ue)}else if($!==R){var He=px(new Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),c);return xse(l,c,$,p,He)}else{zBe(c);var Ie=pie(c,null,$,p);c.child=Ie;for(var et=Ie;et;)et.flags=et.flags&~_s|Es,et=et.sibling}}else{if(t1(),$===R)return Wp(l,c,p);dc(l,c,$,p)}return c.child}function xse(l,c,p,v,w){return t1(),aB(w),c.flags|=is,dc(l,c,p,v),c.child}function $We(l,c,p){Eie(c),l===null&&oB(c);var v=c.type,w=c.pendingProps,R=l!==null?l.memoizedProps:null,P=w.children,$=z6(v,w);return $?P=null:R!==null&&z6(v,R)&&(c.flags|=wi),vse(l,c),dc(l,c,P,p),c.child}function FWe(l,c){return l===null&&oB(c),null}function zWe(l,c,p,v){xD(l,c);var w=c.pendingProps,R=p,P=R._payload,$=R._init,Y=$(P);c.type=Y;var le=c.tag=F8e(Y),ue=Eh(Y,w),He;switch(le){case m:return SW(c,Y),c.type=Y=y1(Y),He=wW(null,c,Y,ue,v),He;case g:return c.type=Y=JW(Y),He=bse(null,c,Y,ue,v),He;case H:return c.type=Y=eU(Y),He=fse(null,c,Y,ue,v),He;case B:{if(c.type!==c.elementType){var Ie=Y.propTypes;Ie&&wh(Ie,ue,"prop",sr(Y))}return He=mse(null,c,Y,Eh(Y.type,ue),v),He}}var et="";throw Y!==null&&typeof Y=="object"&&Y.$$typeof===$t&&(et=" Did you wrap a component in React.lazy() more than once?"),new Error("Element type is invalid. Received a promise that resolves to: "+Y+". "+("Lazy element type must resolve to a class or function."+et))}function VWe(l,c,p,v,w){xD(l,c),c.tag=g;var R;return Qf(p)?(R=!0,jI(c)):R=!1,i1(c,w),ase(c,p,v),hW(c,p,v,w),CW(null,c,p,!0,R,w)}function BWe(l,c,p,v){xD(l,c);var w=c.pendingProps,R;{var P=QS(c,p,!1);R=ZS(c,P)}i1(c,v);var $,Y;Vc(c);{if(p.prototype&&typeof p.prototype.render=="function"){var le=sr(p)||"Unknown";gW[le]||(u("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",le,le),gW[le]=!0)}c.mode&hr&&Sh.recordLegacyContextWarning(c,null),Rs(!0),ak.current=c,$=u1(null,c,p,w,R,v),Y=d1(),Rs(!1)}if(Df(),c.flags|=gh,typeof $=="object"&&$!==null&&typeof $.render=="function"&&$.$$typeof===void 0){var ue=sr(p)||"Unknown";lk[ue]||(u("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",ue,ue,ue),lk[ue]=!0)}if(typeof $=="object"&&$!==null&&typeof $.render=="function"&&$.$$typeof===void 0){{var He=sr(p)||"Unknown";lk[He]||(u("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",He,He,He),lk[He]=!0)}c.tag=g,c.memoizedState=null,c.updateQueue=null;var Ie=!1;return Qf(p)?(Ie=!0,jI(c)):Ie=!1,c.memoizedState=$.state!==null&&$.state!==void 0?$.state:null,wB(c),ose(c,$),hW(c,p,w,v),CW(null,c,p,!0,Ie,v)}else{if(c.tag=m,c.mode&hr){Ci(!0);try{$=u1(null,c,p,w,R,v),Y=d1()}finally{Ci(!1)}}return Ka()&&Y&&tB(c),dc(null,c,$,v),SW(c,p),c.child}}function SW(l,c){{if(c&&c.childContextTypes&&u("%s(...): childContextTypes cannot be defined on a function component.",c.displayName||c.name||"Component"),l.ref!==null){var p="",v=zs();v&&(p+=` Check the render method of \``+v+"`.");var w=v||"",R=l._debugSource;R&&(w=R.fileName+":"+R.lineNumber),yW[w]||(yW[w]=!0,u("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s",p))}if(c.defaultProps!==void 0){var P=sr(c)||"Unknown";ck[P]||(u("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.",P),ck[P]=!0)}if(typeof c.getDerivedStateFromProps=="function"){var $=sr(c)||"Unknown";bW[$]||(u("%s: Function components do not support getDerivedStateFromProps.",$),bW[$]=!0)}if(typeof c.contextType=="object"&&c.contextType!==null){var Y=sr(c)||"Unknown";vW[Y]||(u("%s: Function components do not support contextType.",Y),vW[Y]=!0)}}}var RW={dehydrated:null,treeContext:null,retryLane:lo};function _W(l){return{baseLanes:l,cachePool:AWe(),transitions:null}}function WWe(l,c){var p=null;return{baseLanes:br(l.baseLanes,c),cachePool:p,transitions:l.transitions}}function UWe(l,c,p,v){if(c!==null){var w=c.memoizedState;if(w===null)return!1}return EB(l,ZN)}function YWe(l,c){return Vy(l.childLanes,c)}function wse(l,c,p){var v=c.pendingProps;t9e(c)&&(c.flags|=_r);var w=Rh.current,R=!1,P=(c.flags&_r)!==Mn;if(P||UWe(w,l)?(R=!0,c.flags&=~_r):(l===null||l.memoizedState!==null)&&(w=uWe(w,kie)),w=o1(w),r0(c,w),l===null){oB(c);var $=c.memoizedState;if($!==null){var Y=$.dehydrated;if(Y!==null)return QWe(c,Y)}var le=v.children,ue=v.fallback;if(R){var He=GWe(c,le,ue,p),Ie=c.child;return Ie.memoizedState=_W(p),c.memoizedState=RW,He}else return EW(c,le)}else{var et=l.memoizedState;if(et!==null){var it=et.dehydrated;if(it!==null)return ZWe(l,c,P,v,it,et,p)}if(R){var mt=v.fallback,Zt=v.children,$n=qWe(l,c,Zt,mt,p),Tn=c.child,Xr=l.child.memoizedState;return Tn.memoizedState=Xr===null?_W(p):WWe(Xr,p),Tn.childLanes=YWe(l,p),c.memoizedState=RW,$n}else{var zr=v.children,Ue=KWe(l,c,zr,p);return c.memoizedState=null,Ue}}}function EW(l,c,p){var v=l.mode,w={mode:"visible",children:c},R=NW(w,v);return R.return=l,l.child=R,R}function GWe(l,c,p,v){var w=l.mode,R=l.child,P={mode:"hidden",children:c},$,Y;return(w&jr)===Pn&&R!==null?($=R,$.childLanes=bt,$.pendingProps=P,l.mode&Ur&&($.actualDuration=0,$.actualStartTime=-1,$.selfBaseDuration=0,$.treeBaseDuration=0),Y=d0(p,w,v,null)):($=NW(P,w),Y=d0(p,w,v,null)),$.return=l,Y.return=l,$.sibling=Y,l.child=$,Y}function NW(l,c,p){return Coe(l,c,bt,null)}function Cse(l,c){return wx(l,c)}function KWe(l,c,p,v){var w=l.child,R=w.sibling,P=Cse(w,{mode:"visible",children:p});if((c.mode&jr)===Pn&&(P.lanes=v),P.return=c,P.sibling=null,R!==null){var $=c.deletions;$===null?(c.deletions=[R],c.flags|=Rl):$.push(R)}return c.child=P,P}function qWe(l,c,p,v,w){var R=c.mode,P=l.child,$=P.sibling,Y={mode:"hidden",children:p},le;if((R&jr)===Pn&&c.child!==P){var ue=c.child;le=ue,le.childLanes=bt,le.pendingProps=Y,c.mode&Ur&&(le.actualDuration=0,le.actualStartTime=-1,le.selfBaseDuration=P.selfBaseDuration,le.treeBaseDuration=P.treeBaseDuration),c.deletions=null}else le=Cse(P,Y),le.subtreeFlags=P.subtreeFlags&ao;var He;return $!==null?He=wx($,v):(He=d0(v,R,w,null),He.flags|=_s),He.return=c,le.return=c,le.sibling=He,c.child=le,He}function yD(l,c,p,v){v!==null&&aB(v),n1(c,l.child,null,p);var w=c.pendingProps,R=w.children,P=EW(c,R);return P.flags|=_s,c.memoizedState=null,P}function XWe(l,c,p,v,w){var R=c.mode,P={mode:"visible",children:p},$=NW(P,R),Y=d0(v,R,w,null);return Y.flags|=_s,$.return=c,Y.return=c,$.sibling=Y,c.child=$,(c.mode&jr)!==Pn&&n1(c,l.child,null,w),Y}function QWe(l,c,p){return(l.mode&jr)===Pn?(u("Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components."),l.lanes=Un):U6(c)?l.lanes=Yo:l.lanes=kl,null}function ZWe(l,c,p,v,w,R,P){if(p)if(c.flags&is){c.flags&=~is;var Ue=fW(new Error("There was an error while hydrating this Suspense boundary. Switched to client rendering."));return yD(l,c,P,Ue)}else{if(c.memoizedState!==null)return c.child=l.child,c.flags|=_r,null;var pt=v.children,Ye=v.fallback,At=XWe(l,c,pt,Ye,P),pn=c.child;return pn.memoizedState=_W(P),c.memoizedState=RW,At}else{if($Be(),(c.mode&jr)===Pn)return yD(l,c,P,null);if(U6(w)){var $,Y,le;{var ue=nBe(w);$=ue.digest,Y=ue.message,le=ue.stack}var He;Y?He=new Error(Y):He=new Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.");var Ie=fW(He,$,le);return yD(l,c,P,Ie)}var et=jl(P,l.childLanes);if(Nh||et){var it=jD();if(it!==null){var mt=ES(it,P);if(mt!==lo&&mt!==R.retryLane){R.retryLane=mt;var Zt=Si;Kc(l,mt),wa(it,l,mt,Zt)}}KW();var $n=fW(new Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition."));return yD(l,c,P,$n)}else if(Ure(w)){c.flags|=_r,c.child=l.child;var Tn=S8e.bind(null,l);return rBe(w,Tn),null}else{VBe(c,w,R.treeContext);var Xr=v.children,zr=EW(c,Xr);return zr.flags|=Es,zr}}}function Sse(l,c,p){l.lanes=br(l.lanes,c);var v=l.alternate;v!==null&&(v.lanes=br(v.lanes,c)),vB(l.return,c,p)}function JWe(l,c,p){for(var v=c;v!==null;){if(v.tag===F){var w=v.memoizedState;w!==null&&Sse(v,p,l)}else if(v.tag===pe)Sse(v,p,l);else if(v.child!==null){v.child.return=v,v=v.child;continue}if(v===l)return;for(;v.sibling===null;){if(v.return===null||v.return===l)return;v=v.return}v.sibling.return=v.return,v=v.sibling}}function eUe(l){for(var c=l,p=null;c!==null;){var v=c.alternate;v!==null&&QI(v)===null&&(p=c),c=c.sibling}return p}function tUe(l){if(l!==void 0&&l!=="forwards"&&l!=="backwards"&&l!=="together"&&!xW[l])if(xW[l]=!0,typeof l=="string")switch(l.toLowerCase()){case"together":case"forwards":case"backwards":{u('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',l,l.toLowerCase());break}case"forward":case"backward":{u('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',l,l.toLowerCase());break}default:u('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',l);break}else u('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',l)}function nUe(l,c){l!==void 0&&!bD[l]&&(l!=="collapsed"&&l!=="hidden"?(bD[l]=!0,u('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',l)):c!=="forwards"&&c!=="backwards"&&(bD[l]=!0,u('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',l)))}function Rse(l,c){{var p=vr(l),v=!p&&typeof Sn(l)=="function";if(p||v){var w=p?"array":"iterable";return u("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",w,c,w),!1}}return!0}function rUe(l,c){if((c==="forwards"||c==="backwards")&&l!==void 0&&l!==null&&l!==!1)if(vr(l)){for(var p=0;p<l.length;p++)if(!Rse(l[p],p))return}else{var v=Sn(l);if(typeof v=="function"){var w=v.call(l);if(w)for(var R=w.next(),P=0;!R.done;R=w.next()){if(!Rse(R.value,P))return;P++}}else u('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',c)}}function kW(l,c,p,v,w){var R=l.memoizedState;R===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:v,tail:p,tailMode:w}:(R.isBackwards=c,R.rendering=null,R.renderingStartTime=0,R.last=v,R.tail=p,R.tailMode=w)}function _se(l,c,p){var v=c.pendingProps,w=v.revealOrder,R=v.tail,P=v.children;tUe(w),nUe(R,w),rUe(P,w),dc(l,c,P,p);var $=Rh.current,Y=EB($,ZN);if(Y)$=NB($,ZN),c.flags|=_r;else{var le=l!==null&&(l.flags&_r)!==Mn;le&&JWe(c,c.child,p),$=o1($)}if(r0(c,$),(c.mode&jr)===Pn)c.memoizedState=null;else switch(w){case"forwards":{var ue=eUe(c.child),He;ue===null?(He=c.child,c.child=null):(He=ue.sibling,ue.sibling=null),kW(c,!1,He,ue,R);break}case"backwards":{var Ie=null,et=c.child;for(c.child=null;et!==null;){var it=et.alternate;if(it!==null&&QI(it)===null){c.child=et;break}var mt=et.sibling;et.sibling=Ie,Ie=et,et=mt}kW(c,!0,Ie,null,R);break}case"together":{kW(c,!1,null,null,void 0);break}default:c.memoizedState=null}return c.child}function iUe(l,c,p){SB(c,c.stateNode.containerInfo);var v=c.pendingProps;return l===null?c.child=n1(c,null,v,p):dc(l,c,v,p),c.child}var Ese=!1;function sUe(l,c,p){var v=c.type,w=v._context,R=c.pendingProps,P=c.memoizedProps,$=R.value;{"value"in R||Ese||(Ese=!0,u("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?"));var Y=c.type.propTypes;Y&&wh(Y,R,"prop","Context.Provider")}if(bie(c,w,$),P!==null){var le=P.value;if(on(le,$)){if(P.children===R.children&&!kI())return Wp(l,c,p)}else tWe(c,w,p)}var ue=R.children;return dc(l,c,ue,p),c.child}var Nse=!1;function oUe(l,c,p){var v=c.type;v._context===void 0?v!==v.Consumer&&(Nse||(Nse=!0,u("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))):v=v._context;var w=c.pendingProps,R=w.children;typeof R!="function"&&u("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."),i1(c,p);var P=qo(v);Vc(c);var $;return ak.current=c,Rs(!0),$=R(P),Rs(!1),Df(),c.flags|=gh,dc(l,c,$,p),c.child}function uk(){Nh=!0}function xD(l,c){(c.mode&jr)===Pn&&l!==null&&(l.alternate=null,c.alternate=null,c.flags|=_s)}function Wp(l,c,p){return l!==null&&(c.dependencies=l.dependencies),nse(),Ck(c.lanes),jl(p,c.childLanes)?(JBe(l,c),c.child):null}function aUe(l,c,p){{var v=c.return;if(v===null)throw new Error("Cannot swap the root fiber.");if(l.alternate=null,c.alternate=null,p.index=c.index,p.sibling=c.sibling,p.return=c.return,p.ref=c.ref,c===v.child)v.child=p;else{var w=v.child;if(w===null)throw new Error("Expected parent to have a child.");for(;w.sibling!==c;)if(w=w.sibling,w===null)throw new Error("Expected to find the previous sibling.");w.sibling=p}var R=v.deletions;return R===null?(v.deletions=[l],v.flags|=Rl):R.push(l),p.flags|=_s,p}}function TW(l,c){var p=l.lanes;return!!jl(p,c)}function lUe(l,c,p){switch(c.tag){case x:yse(c),c.stateNode,t1();break;case E:Eie(c);break;case g:{var v=c.type;Qf(v)&&jI(c);break}case C:SB(c,c.stateNode.containerInfo);break;case z:{var w=c.memoizedProps.value,R=c.type._context;bie(c,R,w);break}case V:{var P=jl(p,c.childLanes);P&&(c.flags|=Ir);{var $=c.stateNode;$.effectDuration=0,$.passiveEffectDuration=0}}break;case F:{var Y=c.memoizedState;if(Y!==null){if(Y.dehydrated!==null)return r0(c,o1(Rh.current)),c.flags|=_r,null;var le=c.child,ue=le.childLanes;if(jl(p,ue))return wse(l,c,p);r0(c,o1(Rh.current));var He=Wp(l,c,p);return He!==null?He.sibling:null}else r0(c,o1(Rh.current));break}case pe:{var Ie=(l.flags&_r)!==Mn,et=jl(p,c.childLanes);if(Ie){if(et)return _se(l,c,p);c.flags|=_r}var it=c.memoizedState;if(it!==null&&(it.rendering=null,it.tail=null,it.lastEffect=null),r0(c,Rh.current),et)break;return null}case Fe:case nt:return c.lanes=bt,gse(l,c,p)}return Wp(l,c,p)}function kse(l,c,p){if(c._debugNeedsRemount&&l!==null)return aUe(l,c,sU(c.type,c.key,c.pendingProps,c._debugOwner||null,c.mode,c.lanes));if(l!==null){var v=l.memoizedProps,w=c.pendingProps;if(v!==w||kI()||c.type!==l.type)Nh=!0;else{var R=TW(l,p);if(!R&&(c.flags&_r)===Mn)return Nh=!1,lUe(l,c,p);(l.flags&Mu)!==Mn?Nh=!0:Nh=!1}}else if(Nh=!1,Ka()&&ABe(c)){var P=c.index,$=OBe();nie(c,$,P)}switch(c.lanes=bt,c.tag){case y:return BWe(l,c,c.type,p);case ve:{var Y=c.elementType;return zWe(l,c,Y,p)}case m:{var le=c.type,ue=c.pendingProps,He=c.elementType===le?ue:Eh(le,ue);return wW(l,c,le,He,p)}case g:{var Ie=c.type,et=c.pendingProps,it=c.elementType===Ie?et:Eh(Ie,et);return bse(l,c,Ie,it,p)}case x:return LWe(l,c,p);case E:return $We(l,c,p);case M:return FWe(l,c);case F:return wse(l,c,p);case C:return iUe(l,c,p);case H:{var mt=c.type,Zt=c.pendingProps,$n=c.elementType===mt?Zt:Eh(mt,Zt);return fse(l,c,mt,$n,p)}case j:return IWe(l,c,p);case L:return DWe(l,c,p);case V:return HWe(l,c,p);case z:return sUe(l,c,p);case D:return oUe(l,c,p);case B:{var Tn=c.type,Xr=c.pendingProps,zr=Eh(Tn,Xr);if(c.type!==c.elementType){var Ue=Tn.propTypes;Ue&&wh(Ue,zr,"prop",sr(Tn))}return zr=Eh(Tn.type,zr),mse(l,c,Tn,zr,p)}case te:return pse(l,c,c.type,c.pendingProps,p);case ce:{var pt=c.type,Ye=c.pendingProps,At=c.elementType===pt?Ye:Eh(pt,Ye);return VWe(l,c,pt,At,p)}case pe:return _se(l,c,p);case Le:break;case Fe:return gse(l,c,p)}throw new Error("Unknown unit of work tag ("+c.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function h1(l){l.flags|=Ir}function Tse(l){l.flags|=oo,l.flags|=ky}var jse,jW,Mse,Pse;jse=function(l,c,p,v){for(var w=c.child;w!==null;){if(w.tag===E||w.tag===M)j6e(l,w.stateNode);else if(w.tag!==C){if(w.child!==null){w.child.return=w,w=w.child;continue}}if(w===c)return;for(;w.sibling===null;){if(w.return===null||w.return===c)return;w=w.return}w.sibling.return=w.return,w=w.sibling}},jW=function(l,c){},Mse=function(l,c,p,v,w){var R=l.memoizedProps;if(R!==v){var P=c.stateNode,$=RB(),Y=P6e(P,p,R,v,w,$);c.updateQueue=Y,Y&&h1(c)}},Pse=function(l,c,p,v){p!==v&&h1(c)};function dk(l,c){if(!Ka())switch(l.tailMode){case"hidden":{for(var p=l.tail,v=null;p!==null;)p.alternate!==null&&(v=p),p=p.sibling;v===null?l.tail=null:v.sibling=null;break}case"collapsed":{for(var w=l.tail,R=null;w!==null;)w.alternate!==null&&(R=w),w=w.sibling;R===null?!c&&l.tail!==null?l.tail.sibling=null:l.tail=null:R.sibling=null;break}}}function Xa(l){var c=l.alternate!==null&&l.alternate.child===l.child,p=bt,v=Mn;if(c){if((l.mode&Ur)!==Pn){for(var Y=l.selfBaseDuration,le=l.child;le!==null;)p=br(p,br(le.lanes,le.childLanes)),v|=le.subtreeFlags&ao,v|=le.flags&ao,Y+=le.treeBaseDuration,le=le.sibling;l.treeBaseDuration=Y}else for(var ue=l.child;ue!==null;)p=br(p,br(ue.lanes,ue.childLanes)),v|=ue.subtreeFlags&ao,v|=ue.flags&ao,ue.return=l,ue=ue.sibling;l.subtreeFlags|=v}else{if((l.mode&Ur)!==Pn){for(var w=l.actualDuration,R=l.selfBaseDuration,P=l.child;P!==null;)p=br(p,br(P.lanes,P.childLanes)),v|=P.subtreeFlags,v|=P.flags,w+=P.actualDuration,R+=P.treeBaseDuration,P=P.sibling;l.actualDuration=w,l.treeBaseDuration=R}else for(var $=l.child;$!==null;)p=br(p,br($.lanes,$.childLanes)),v|=$.subtreeFlags,v|=$.flags,$.return=l,$=$.sibling;l.subtreeFlags|=v}return l.childLanes=p,c}function cUe(l,c,p){if(GBe()&&(c.mode&jr)!==Pn&&(c.flags&_r)===Mn)return cie(c),t1(),c.flags|=is|bp|Ma,!1;var v=II(c);if(p!==null&&p.dehydrated!==null)if(l===null){if(!v)throw new Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(UBe(c),Xa(c),(c.mode&Ur)!==Pn){var w=p!==null;if(w){var R=c.child;R!==null&&(c.treeBaseDuration-=R.treeBaseDuration)}}return!1}else{if(t1(),(c.flags&_r)===Mn&&(c.memoizedState=null),c.flags|=Ir,Xa(c),(c.mode&Ur)!==Pn){var P=p!==null;if(P){var $=c.child;$!==null&&(c.treeBaseDuration-=$.treeBaseDuration)}}return!1}else return uie(),!0}function Ase(l,c,p){var v=c.pendingProps;switch(nB(c),c.tag){case y:case ve:case te:case m:case H:case j:case L:case V:case D:case B:return Xa(c),null;case g:{var w=c.type;return Qf(w)&&TI(c),Xa(c),null}case x:{var R=c.stateNode;if(s1(c),Z6(c),TB(),R.pendingContext&&(R.context=R.pendingContext,R.pendingContext=null),l===null||l.child===null){var P=II(c);if(P)h1(c);else if(l!==null){var $=l.memoizedState;(!$.isDehydrated||(c.flags&is)!==Mn)&&(c.flags|=zc,uie())}}return jW(l,c),Xa(c),null}case E:{_B(c);var Y=_ie(),le=c.type;if(l!==null&&c.stateNode!=null)Mse(l,c,le,v,Y),l.ref!==c.ref&&Tse(c);else{if(!v){if(c.stateNode===null)throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return Xa(c),null}var ue=RB(),He=II(c);if(He)BBe(c,Y,ue)&&h1(c);else{var Ie=T6e(le,v,Y,ue,c);jse(Ie,c,!1,!1),c.stateNode=Ie,M6e(Ie,le,v,Y)&&h1(c)}c.ref!==null&&Tse(c)}return Xa(c),null}case M:{var et=v;if(l&&c.stateNode!=null){var it=l.memoizedProps;Pse(l,c,it,et)}else{if(typeof et!="string"&&c.stateNode===null)throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");var mt=_ie(),Zt=RB(),$n=II(c);$n?WBe(c)&&h1(c):c.stateNode=A6e(et,mt,Zt,c)}return Xa(c),null}case F:{a1(c);var Tn=c.memoizedState;if(l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){var Xr=cUe(l,c,Tn);if(!Xr)return c.flags&Ma?c:null}if((c.flags&_r)!==Mn)return c.lanes=p,(c.mode&Ur)!==Pn&&eW(c),c;var zr=Tn!==null,Ue=l!==null&&l.memoizedState!==null;if(zr!==Ue&&zr){var pt=c.child;if(pt.flags|=wd,(c.mode&jr)!==Pn){var Ye=l===null&&(c.memoizedProps.unstable_avoidThisFallback!==!0||!0);Ye||EB(Rh.current,kie)?u8e():KW()}}var At=c.updateQueue;if(At!==null&&(c.flags|=Ir),Xa(c),(c.mode&Ur)!==Pn&&zr){var pn=c.child;pn!==null&&(c.treeBaseDuration-=pn.treeBaseDuration)}return null}case C:return s1(c),jW(l,c),l===null&&EBe(c.stateNode.containerInfo),Xa(c),null;case z:var an=c.type._context;return gB(an,c),Xa(c),null;case ce:{var Kn=c.type;return Qf(Kn)&&TI(c),Xa(c),null}case pe:{a1(c);var cr=c.memoizedState;if(cr===null)return Xa(c),null;var Di=(c.flags&_r)!==Mn,ai=cr.rendering;if(ai===null)if(Di)dk(cr,!1);else{var To=h8e()&&(l===null||(l.flags&_r)===Mn);if(!To)for(var li=c.child;li!==null;){var uo=QI(li);if(uo!==null){Di=!0,c.flags|=_r,dk(cr,!1);var Dl=uo.updateQueue;return Dl!==null&&(c.updateQueue=Dl,c.flags|=Ir),c.subtreeFlags=Mn,eWe(c,p),r0(c,NB(Rh.current,ZN)),c.child}li=li.sibling}cr.tail!==null&&Ws()>eoe()&&(c.flags|=_r,Di=!0,dk(cr,!1),c.lanes=AO)}else{if(!Di){var tl=QI(ai);if(tl!==null){c.flags|=_r,Di=!0;var Lu=tl.updateQueue;if(Lu!==null&&(c.updateQueue=Lu,c.flags|=Ir),dk(cr,!0),cr.tail===null&&cr.tailMode==="hidden"&&!ai.alternate&&!Ka())return Xa(c),null}else Ws()*2-cr.renderingStartTime>eoe()&&p!==kl&&(c.flags|=_r,Di=!0,dk(cr,!1),c.lanes=AO)}if(cr.isBackwards)ai.sibling=c.child,c.child=ai;else{var mc=cr.last;mc!==null?mc.sibling=ai:c.child=ai,cr.last=ai}}if(cr.tail!==null){var pc=cr.tail;cr.rendering=pc,cr.tail=pc.sibling,cr.renderingStartTime=Ws(),pc.sibling=null;var Hl=Rh.current;return Di?Hl=NB(Hl,ZN):Hl=o1(Hl),r0(c,Hl),pc}return Xa(c),null}case Le:break;case Fe:case nt:{GW(c);var qp=c.memoizedState,x1=qp!==null;if(l!==null){var Nk=l.memoizedState,sm=Nk!==null;sm!==x1&&!Q&&(c.flags|=wd)}return!x1||(c.mode&jr)===Pn?Xa(c):jl(im,kl)&&(Xa(c),c.subtreeFlags&(_s|Ir)&&(c.flags|=wd)),null}case dt:return null;case $e:return null}throw new Error("Unknown unit of work tag ("+c.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function uUe(l,c,p){switch(nB(c),c.tag){case g:{var v=c.type;Qf(v)&&TI(c);var w=c.flags;return w&Ma?(c.flags=w&~Ma|_r,(c.mode&Ur)!==Pn&&eW(c),c):null}case x:{c.stateNode,s1(c),Z6(c),TB();var R=c.flags;return(R&Ma)!==Mn&&(R&_r)===Mn?(c.flags=R&~Ma|_r,c):null}case E:return _B(c),null;case F:{a1(c);var P=c.memoizedState;if(P!==null&&P.dehydrated!==null){if(c.alternate===null)throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");t1()}var $=c.flags;return $&Ma?(c.flags=$&~Ma|_r,(c.mode&Ur)!==Pn&&eW(c),c):null}case pe:return a1(c),null;case C:return s1(c),null;case z:var Y=c.type._context;return gB(Y,c),null;case Fe:case nt:return GW(c),null;case dt:return null;default:return null}}function Ose(l,c,p){switch(nB(c),c.tag){case g:{var v=c.type.childContextTypes;v!=null&&TI(c);break}case x:{c.stateNode,s1(c),Z6(c),TB();break}case E:{_B(c);break}case C:s1(c);break;case F:a1(c);break;case pe:a1(c);break;case z:var w=c.type._context;gB(w,c);break;case Fe:case nt:GW(c);break}}var Ise=null;Ise=new Set;var wD=!1,Qa=!1,dUe=typeof WeakSet=="function"?WeakSet:Set,wn=null,f1=null,m1=null;function hUe(l){Fc(null,function(){throw l}),VE()}var fUe=function(l,c){if(c.props=l.memoizedProps,c.state=l.memoizedState,l.mode&Ur)try{nm(),c.componentWillUnmount()}finally{tm(l)}else c.componentWillUnmount()};function Dse(l,c){try{o0(pa,l)}catch(p){ts(l,c,p)}}function MW(l,c,p){try{fUe(l,p)}catch(v){ts(l,c,v)}}function mUe(l,c,p){try{p.componentDidMount()}catch(v){ts(l,c,v)}}function Hse(l,c){try{$se(l)}catch(p){ts(l,c,p)}}function p1(l,c){var p=l.ref;if(p!==null)if(typeof p=="function"){var v;try{if(xe&&Ke&&l.mode&Ur)try{nm(),v=p(null)}finally{tm(l)}else v=p(null)}catch(w){ts(l,c,w)}typeof v=="function"&&u("Unexpected return value from a callback ref in %s. A callback ref should not return a function.",_n(l))}else p.current=null}function CD(l,c,p){try{p()}catch(v){ts(l,c,v)}}var Lse=!1;function pUe(l,c){N6e(l.containerInfo),wn=c,gUe();var p=Lse;return Lse=!1,p}function gUe(){for(;wn!==null;){var l=wn,c=l.child;(l.subtreeFlags&Af)!==Mn&&c!==null?(c.return=l,wn=c):vUe()}}function vUe(){for(;wn!==null;){var l=wn;Or(l);try{bUe(l)}catch(p){ts(l,l.return,p)}ji();var c=l.sibling;if(c!==null){c.return=l.return,wn=c;return}wn=l.return}}function bUe(l){var c=l.alternate,p=l.flags;if((p&zc)!==Mn){switch(Or(l),l.tag){case m:case H:case te:break;case g:{if(c!==null){var v=c.memoizedProps,w=c.memoizedState,R=l.stateNode;l.type===l.elementType&&!gx&&(R.props!==l.memoizedProps&&u("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",_n(l)||"instance"),R.state!==l.memoizedState&&u("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",_n(l)||"instance"));var P=R.getSnapshotBeforeUpdate(l.elementType===l.type?v:Eh(l.type,v),w);{var $=Ise;P===void 0&&!$.has(l.type)&&($.add(l.type),u("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",_n(l)))}R.__reactInternalSnapshotBeforeUpdate=P}break}case x:{{var Y=l.stateNode;Z6e(Y.containerInfo)}break}case E:case M:case C:case ce:break;default:throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}ji()}}function kh(l,c,p){var v=c.updateQueue,w=v!==null?v.lastEffect:null;if(w!==null){var R=w.next,P=R;do{if((P.tag&l)===l){var $=P.destroy;P.destroy=void 0,$!==void 0&&((l&qa)!==qc?Hf(c):(l&pa)!==qc&&eN(c),(l&Zf)!==qc&&Rk(!0),CD(c,p,$),(l&Zf)!==qc&&Rk(!1),(l&qa)!==qc?JC():(l&pa)!==qc&&Pv())}P=P.next}while(P!==R)}}function o0(l,c){var p=c.updateQueue,v=p!==null?p.lastEffect:null;if(v!==null){var w=v.next,R=w;do{if((R.tag&l)===l){(l&qa)!==qc?MO(c):(l&pa)!==qc&&PO(c);var P=R.create;(l&Zf)!==qc&&Rk(!0),R.destroy=P(),(l&Zf)!==qc&&Rk(!1),(l&qa)!==qc?bh():(l&pa)!==qc&&eS();{var $=R.destroy;if($!==void 0&&typeof $!="function"){var Y=void 0;(R.tag&pa)!==Mn?Y="useLayoutEffect":(R.tag&Zf)!==Mn?Y="useInsertionEffect":Y="useEffect";var le=void 0;$===null?le=" You returned null. If your effect does not require clean up, return undefined (or nothing).":typeof $.then=="function"?le=` It looks like you wrote `+Y+`(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately: `+Y+`(() => { async function fetchData() { // You can await here const response = await MyAPI.getData(someId); // ... } fetchData(); }, [someId]); // Or [] if effect doesn't need props or state Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching`:le=" You returned: "+$,u("%s must not return anything besides a function, which is used for clean-up.%s",Y,le)}}}R=R.next}while(R!==w)}}function yUe(l,c){if((c.flags&Ir)!==Mn)switch(c.tag){case V:{var p=c.stateNode.passiveEffectDuration,v=c.memoizedProps,w=v.id,R=v.onPostCommit,P=ese(),$=c.alternate===null?"mount":"update";Jie()&&($="nested-update"),typeof R=="function"&&R(w,$,p,P);var Y=c.return;e:for(;Y!==null;){switch(Y.tag){case x:var le=Y.stateNode;le.passiveEffectDuration+=p;break e;case V:var ue=Y.stateNode;ue.passiveEffectDuration+=p;break e}Y=Y.return}break}}}function xUe(l,c,p,v){if((p.flags&Of)!==Mn)switch(p.tag){case m:case H:case te:{if(!Qa)if(p.mode&Ur)try{nm(),o0(pa|ma,p)}finally{tm(p)}else o0(pa|ma,p);break}case g:{var w=p.stateNode;if(p.flags&Ir&&!Qa)if(c===null)if(p.type===p.elementType&&!gx&&(w.props!==p.memoizedProps&&u("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",_n(p)||"instance"),w.state!==p.memoizedState&&u("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",_n(p)||"instance")),p.mode&Ur)try{nm(),w.componentDidMount()}finally{tm(p)}else w.componentDidMount();else{var R=p.elementType===p.type?c.memoizedProps:Eh(p.type,c.memoizedProps),P=c.memoizedState;if(p.type===p.elementType&&!gx&&(w.props!==p.memoizedProps&&u("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",_n(p)||"instance"),w.state!==p.memoizedState&&u("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",_n(p)||"instance")),p.mode&Ur)try{nm(),w.componentDidUpdate(R,P,w.__reactInternalSnapshotBeforeUpdate)}finally{tm(p)}else w.componentDidUpdate(R,P,w.__reactInternalSnapshotBeforeUpdate)}var $=p.updateQueue;$!==null&&(p.type===p.elementType&&!gx&&(w.props!==p.memoizedProps&&u("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",_n(p)||"instance"),w.state!==p.memoizedState&&u("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",_n(p)||"instance")),Rie(p,$,w));break}case x:{var Y=p.updateQueue;if(Y!==null){var le=null;if(p.child!==null)switch(p.child.tag){case E:le=p.child.stateNode;break;case g:le=p.child.stateNode;break}Rie(p,Y,le)}break}case E:{var ue=p.stateNode;if(c===null&&p.flags&Ir){var He=p.type,Ie=p.memoizedProps;L6e(ue,He,Ie)}break}case M:break;case C:break;case V:{{var et=p.memoizedProps,it=et.onCommit,mt=et.onRender,Zt=p.stateNode.effectDuration,$n=ese(),Tn=c===null?"mount":"update";Jie()&&(Tn="nested-update"),typeof mt=="function"&&mt(p.memoizedProps.id,Tn,p.actualDuration,p.treeBaseDuration,p.actualStartTime,$n);{typeof it=="function"&&it(p.memoizedProps.id,Tn,Zt,$n),v8e(p);var Xr=p.return;e:for(;Xr!==null;){switch(Xr.tag){case x:var zr=Xr.stateNode;zr.effectDuration+=Zt;break e;case V:var Ue=Xr.stateNode;Ue.effectDuration+=Zt;break e}Xr=Xr.return}}}break}case F:{kUe(l,p);break}case pe:case ce:case Le:case Fe:case nt:case $e:break;default:throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}Qa||p.flags&oo&&$se(p)}function wUe(l){switch(l.tag){case m:case H:case te:{if(l.mode&Ur)try{nm(),Dse(l,l.return)}finally{tm(l)}else Dse(l,l.return);break}case g:{var c=l.stateNode;typeof c.componentDidMount=="function"&&mUe(l,l.return,c),Hse(l,l.return);break}case E:{Hse(l,l.return);break}}}function CUe(l,c){for(var p=null,v=l;;){if(v.tag===E){if(p===null){p=v;try{var w=v.stateNode;c?K6e(w):X6e(v.stateNode,v.memoizedProps)}catch(P){ts(l,l.return,P)}}}else if(v.tag===M){if(p===null)try{var R=v.stateNode;c?q6e(R):Q6e(R,v.memoizedProps)}catch(P){ts(l,l.return,P)}}else if(!((v.tag===Fe||v.tag===nt)&&v.memoizedState!==null&&v!==l)){if(v.child!==null){v.child.return=v,v=v.child;continue}}if(v===l)return;for(;v.sibling===null;){if(v.return===null||v.return===l)return;p===v&&(p=null),v=v.return}p===v&&(p=null),v.sibling.return=v.return,v=v.sibling}}function $se(l){var c=l.ref;if(c!==null){var p=l.stateNode,v;switch(l.tag){case E:v=p;break;default:v=p}if(typeof c=="function"){var w;if(l.mode&Ur)try{nm(),w=c(v)}finally{tm(l)}else w=c(v);typeof w=="function"&&u("Unexpected return value from a callback ref in %s. A callback ref should not return a function.",_n(l))}else c.hasOwnProperty("current")||u("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",_n(l)),c.current=v}}function SUe(l){var c=l.alternate;c!==null&&(c.return=null),l.return=null}function Fse(l){var c=l.alternate;c!==null&&(l.alternate=null,Fse(c));{if(l.child=null,l.deletions=null,l.sibling=null,l.tag===E){var p=l.stateNode;p!==null&&TBe(p)}l.stateNode=null,l._debugOwner=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}}function RUe(l){for(var c=l.return;c!==null;){if(zse(c))return c;c=c.return}throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.")}function zse(l){return l.tag===E||l.tag===x||l.tag===C}function Vse(l){var c=l;e:for(;;){for(;c.sibling===null;){if(c.return===null||zse(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==E&&c.tag!==M&&c.tag!==_e;){if(c.flags&_s||c.child===null||c.tag===C)continue e;c.child.return=c,c=c.child}if(!(c.flags&_s))return c.stateNode}}function _Ue(l){var c=RUe(l);switch(c.tag){case E:{var p=c.stateNode;c.flags&wi&&(Wre(p),c.flags&=~wi);var v=Vse(l);AW(l,v,p);break}case x:case C:{var w=c.stateNode.containerInfo,R=Vse(l);PW(l,R,w);break}default:throw new Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}function PW(l,c,p){var v=l.tag,w=v===E||v===M;if(w){var R=l.stateNode;c?W6e(p,R,c):V6e(p,R)}else if(v!==C){var P=l.child;if(P!==null){PW(P,c,p);for(var $=P.sibling;$!==null;)PW($,c,p),$=$.sibling}}}function AW(l,c,p){var v=l.tag,w=v===E||v===M;if(w){var R=l.stateNode;c?B6e(p,R,c):z6e(p,R)}else if(v!==C){var P=l.child;if(P!==null){AW(P,c,p);for(var $=P.sibling;$!==null;)AW($,c,p),$=$.sibling}}}var Za=null,Th=!1;function EUe(l,c,p){{var v=c;e:for(;v!==null;){switch(v.tag){case E:{Za=v.stateNode,Th=!1;break e}case x:{Za=v.stateNode.containerInfo,Th=!0;break e}case C:{Za=v.stateNode.containerInfo,Th=!0;break e}}v=v.return}if(Za===null)throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");Bse(l,c,p),Za=null,Th=!1}SUe(p)}function a0(l,c,p){for(var v=p.child;v!==null;)Bse(l,c,v),v=v.sibling}function Bse(l,c,p){switch(Mv(p),p.tag){case E:Qa||p1(p,c);case M:{{var v=Za,w=Th;Za=null,a0(l,c,p),Za=v,Th=w,Za!==null&&(Th?Y6e(Za,p.stateNode):U6e(Za,p.stateNode))}return}case _e:{Za!==null&&(Th?G6e(Za,p.stateNode):W6(Za,p.stateNode));return}case C:{{var R=Za,P=Th;Za=p.stateNode.containerInfo,Th=!0,a0(l,c,p),Za=R,Th=P}return}case m:case H:case B:case te:{if(!Qa){var $=p.updateQueue;if($!==null){var Y=$.lastEffect;if(Y!==null){var le=Y.next,ue=le;do{var He=ue,Ie=He.destroy,et=He.tag;Ie!==void 0&&((et&Zf)!==qc?CD(p,c,Ie):(et&pa)!==qc&&(eN(p),p.mode&Ur?(nm(),CD(p,c,Ie),tm(p)):CD(p,c,Ie),Pv())),ue=ue.next}while(ue!==le)}}}a0(l,c,p);return}case g:{if(!Qa){p1(p,c);var it=p.stateNode;typeof it.componentWillUnmount=="function"&&MW(p,c,it)}a0(l,c,p);return}case Le:{a0(l,c,p);return}case Fe:{if(p.mode&jr){var mt=Qa;Qa=mt||p.memoizedState!==null,a0(l,c,p),Qa=mt}else a0(l,c,p);break}default:{a0(l,c,p);return}}}function NUe(l){l.memoizedState}function kUe(l,c){var p=c.memoizedState;if(p===null){var v=c.alternate;if(v!==null){var w=v.memoizedState;if(w!==null){var R=w.dehydrated;R!==null&&hBe(R)}}}}function Wse(l){var c=l.updateQueue;if(c!==null){l.updateQueue=null;var p=l.stateNode;p===null&&(p=l.stateNode=new dUe),c.forEach(function(v){var w=R8e.bind(null,l,v);if(!p.has(v)){if(p.add(v),Pa)if(f1!==null&&m1!==null)Sk(m1,f1);else throw Error("Expected finished root and lanes to be set. This is a bug in React.");v.then(w,w)}})}}function TUe(l,c,p){f1=p,m1=l,Or(c),Use(c,l),Or(c),f1=null,m1=null}function jh(l,c,p){var v=c.deletions;if(v!==null)for(var w=0;w<v.length;w++){var R=v[w];try{EUe(l,c,R)}catch(Y){ts(R,c,Y)}}var P=Ss();if(c.subtreeFlags&Tv)for(var $=c.child;$!==null;)Or($),Use($,l),$=$.sibling;Or(P)}function Use(l,c,p){var v=l.alternate,w=l.flags;switch(l.tag){case m:case H:case B:case te:{if(jh(c,l),rm(l),w&Ir){try{kh(Zf|ma,l,l.return),o0(Zf|ma,l)}catch(Kn){ts(l,l.return,Kn)}if(l.mode&Ur){try{nm(),kh(pa|ma,l,l.return)}catch(Kn){ts(l,l.return,Kn)}tm(l)}else try{kh(pa|ma,l,l.return)}catch(Kn){ts(l,l.return,Kn)}}return}case g:{jh(c,l),rm(l),w&oo&&v!==null&&p1(v,v.return);return}case E:{jh(c,l),rm(l),w&oo&&v!==null&&p1(v,v.return);{if(l.flags&wi){var R=l.stateNode;try{Wre(R)}catch(Kn){ts(l,l.return,Kn)}}if(w&Ir){var P=l.stateNode;if(P!=null){var $=l.memoizedProps,Y=v!==null?v.memoizedProps:$,le=l.type,ue=l.updateQueue;if(l.updateQueue=null,ue!==null)try{$6e(P,ue,le,Y,$,l)}catch(Kn){ts(l,l.return,Kn)}}}}return}case M:{if(jh(c,l),rm(l),w&Ir){if(l.stateNode===null)throw new Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");var He=l.stateNode,Ie=l.memoizedProps,et=v!==null?v.memoizedProps:Ie;try{F6e(He,et,Ie)}catch(Kn){ts(l,l.return,Kn)}}return}case x:{if(jh(c,l),rm(l),w&Ir&&v!==null){var it=v.memoizedState;if(it.isDehydrated)try{dBe(c.containerInfo)}catch(Kn){ts(l,l.return,Kn)}}return}case C:{jh(c,l),rm(l);return}case F:{jh(c,l),rm(l);var mt=l.child;if(mt.flags&wd){var Zt=mt.stateNode,$n=mt.memoizedState,Tn=$n!==null;if(Zt.isHidden=Tn,Tn){var Xr=mt.alternate!==null&&mt.alternate.memoizedState!==null;Xr||c8e()}}if(w&Ir){try{NUe(l)}catch(Kn){ts(l,l.return,Kn)}Wse(l)}return}case Fe:{var zr=v!==null&&v.memoizedState!==null;if(l.mode&jr){var Ue=Qa;Qa=Ue||zr,jh(c,l),Qa=Ue}else jh(c,l);if(rm(l),w&wd){var pt=l.stateNode,Ye=l.memoizedState,At=Ye!==null,pn=l;if(pt.isHidden=At,At&&!zr&&(pn.mode&jr)!==Pn){wn=pn;for(var an=pn.child;an!==null;)wn=an,MUe(an),an=an.sibling}CUe(pn,At)}return}case pe:{jh(c,l),rm(l),w&Ir&&Wse(l);return}case Le:return;default:{jh(c,l),rm(l);return}}}function rm(l){var c=l.flags;if(c&_s){try{_Ue(l)}catch(p){ts(l,l.return,p)}l.flags&=~_s}c&Es&&(l.flags&=~Es)}function jUe(l,c,p){f1=p,m1=c,wn=l,Yse(l,c,p),f1=null,m1=null}function Yse(l,c,p){for(var v=(l.mode&jr)!==Pn;wn!==null;){var w=wn,R=w.child;if(w.tag===Fe&&v){var P=w.memoizedState!==null,$=P||wD;if($){OW(l,c,p);continue}else{var Y=w.alternate,le=Y!==null&&Y.memoizedState!==null,ue=le||Qa,He=wD,Ie=Qa;wD=$,Qa=ue,Qa&&!Ie&&(wn=w,PUe(w));for(var et=R;et!==null;)wn=et,Yse(et,c,p),et=et.sibling;wn=w,wD=He,Qa=Ie,OW(l,c,p);continue}}(w.subtreeFlags&Of)!==Mn&&R!==null?(R.return=w,wn=R):OW(l,c,p)}}function OW(l,c,p){for(;wn!==null;){var v=wn;if((v.flags&Of)!==Mn){var w=v.alternate;Or(v);try{xUe(c,w,v,p)}catch(P){ts(v,v.return,P)}ji()}if(v===l){wn=null;return}var R=v.sibling;if(R!==null){R.return=v.return,wn=R;return}wn=v.return}}function MUe(l){for(;wn!==null;){var c=wn,p=c.child;switch(c.tag){case m:case H:case B:case te:{if(c.mode&Ur)try{nm(),kh(pa,c,c.return)}finally{tm(c)}else kh(pa,c,c.return);break}case g:{p1(c,c.return);var v=c.stateNode;typeof v.componentWillUnmount=="function"&&MW(c,c.return,v);break}case E:{p1(c,c.return);break}case Fe:{var w=c.memoizedState!==null;if(w){Gse(l);continue}break}}p!==null?(p.return=c,wn=p):Gse(l)}}function Gse(l){for(;wn!==null;){var c=wn;if(c===l){wn=null;return}var p=c.sibling;if(p!==null){p.return=c.return,wn=p;return}wn=c.return}}function PUe(l){for(;wn!==null;){var c=wn,p=c.child;if(c.tag===Fe){var v=c.memoizedState!==null;if(v){Kse(l);continue}}p!==null?(p.return=c,wn=p):Kse(l)}}function Kse(l){for(;wn!==null;){var c=wn;Or(c);try{wUe(c)}catch(v){ts(c,c.return,v)}if(ji(),c===l){wn=null;return}var p=c.sibling;if(p!==null){p.return=c.return,wn=p;return}wn=c.return}}function AUe(l,c,p,v){wn=c,OUe(c,l,p,v)}function OUe(l,c,p,v){for(;wn!==null;){var w=wn,R=w.child;(w.subtreeFlags&ca)!==Mn&&R!==null?(R.return=w,wn=R):IUe(l,c,p,v)}}function IUe(l,c,p,v){for(;wn!==null;){var w=wn;if((w.flags&sc)!==Mn){Or(w);try{DUe(c,w,p,v)}catch(P){ts(w,w.return,P)}ji()}if(w===l){wn=null;return}var R=w.sibling;if(R!==null){R.return=w.return,wn=R;return}wn=w.return}}function DUe(l,c,p,v){switch(c.tag){case m:case H:case te:{if(c.mode&Ur){JB();try{o0(qa|ma,c)}finally{ZB(c)}}else o0(qa|ma,c);break}}}function HUe(l){wn=l,LUe()}function LUe(){for(;wn!==null;){var l=wn,c=l.child;if((wn.flags&Rl)!==Mn){var p=l.deletions;if(p!==null){for(var v=0;v<p.length;v++){var w=p[v];wn=w,zUe(w,l)}{var R=l.alternate;if(R!==null){var P=R.child;if(P!==null){R.child=null;do{var $=P.sibling;P.sibling=null,P=$}while(P!==null)}}}wn=l}}(l.subtreeFlags&ca)!==Mn&&c!==null?(c.return=l,wn=c):$Ue()}}function $Ue(){for(;wn!==null;){var l=wn;(l.flags&sc)!==Mn&&(Or(l),FUe(l),ji());var c=l.sibling;if(c!==null){c.return=l.return,wn=c;return}wn=l.return}}function FUe(l){switch(l.tag){case m:case H:case te:{l.mode&Ur?(JB(),kh(qa|ma,l,l.return),ZB(l)):kh(qa|ma,l,l.return);break}}}function zUe(l,c){for(;wn!==null;){var p=wn;Or(p),BUe(p,c),ji();var v=p.child;v!==null?(v.return=p,wn=v):VUe(l)}}function VUe(l){for(;wn!==null;){var c=wn,p=c.sibling,v=c.return;if(Fse(c),c===l){wn=null;return}if(p!==null){p.return=v,wn=p;return}wn=v}}function BUe(l,c){switch(l.tag){case m:case H:case te:{l.mode&Ur?(JB(),kh(qa,l,c),ZB(l)):kh(qa,l,c);break}}}function WUe(l){switch(l.tag){case m:case H:case te:{try{o0(pa|ma,l)}catch(p){ts(l,l.return,p)}break}case g:{var c=l.stateNode;try{c.componentDidMount()}catch(p){ts(l,l.return,p)}break}}}function UUe(l){switch(l.tag){case m:case H:case te:{try{o0(qa|ma,l)}catch(c){ts(l,l.return,c)}break}}}function YUe(l){switch(l.tag){case m:case H:case te:{try{kh(pa|ma,l,l.return)}catch(p){ts(l,l.return,p)}break}case g:{var c=l.stateNode;typeof c.componentWillUnmount=="function"&&MW(l,l.return,c);break}}}function GUe(l){switch(l.tag){case m:case H:case te:try{kh(qa|ma,l,l.return)}catch(c){ts(l,l.return,c)}}}if(typeof Symbol=="function"&&Symbol.for){var hk=Symbol.for;hk("selector.component"),hk("selector.has_pseudo_class"),hk("selector.role"),hk("selector.test_id"),hk("selector.text")}var KUe=[];function qUe(){KUe.forEach(function(l){return l()})}var XUe=r.ReactCurrentActQueue;function QUe(l){{var c=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0,p=typeof jest<"u";return p&&c!==!1}}function qse(){{var l=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0;return!l&&XUe.current!==null&&u("The current testing environment is not configured to support act(...)"),l}}var ZUe=Math.ceil,IW=r.ReactCurrentDispatcher,DW=r.ReactCurrentOwner,Ja=r.ReactCurrentBatchConfig,Mh=r.ReactCurrentActQueue,ba=0,Xse=1,el=2,Pd=4,Up=0,fk=1,vx=2,SD=3,mk=4,Qse=5,HW=6,qr=ba,hc=null,Ks=null,ya=bt,im=bt,LW=Qv(bt),xa=Up,pk=null,RD=bt,gk=bt,_D=bt,vk=null,Xc=null,$W=0,Zse=500,Jse=1/0,JUe=500,Yp=null;function bk(){Jse=Ws()+JUe}function eoe(){return Jse}var ED=!1,FW=null,g1=null,bx=!1,l0=null,yk=bt,zW=[],VW=null,e8e=50,xk=0,BW=null,WW=!1,ND=!1,t8e=50,v1=0,kD=null,wk=Si,TD=bt,toe=!1;function jD(){return hc}function fc(){return(qr&(el|Pd))!==ba?Ws():(wk!==Si||(wk=Ws()),wk)}function c0(l){var c=l.mode;if((c&jr)===Pn)return Un;if((qr&el)!==ba&&ya!==bt)return Go(ya);var p=XBe()!==qBe;if(p){if(Ja.transition!==null){var v=Ja.transition;v._updatedFibers||(v._updatedFibers=new Set),v._updatedFibers.add(l)}return TD===lo&&(TD=uN()),TD}var w=ac();if(w!==lo)return w;var R=O6e();return R}function n8e(l){var c=l.mode;return(c&jr)===Pn?Un:$O()}function wa(l,c,p,v){E8e(),toe&&u("useInsertionEffect must not schedule updates."),WW&&(ND=!0),Lv(l,p,v),(qr&el)!==bt&&l===hc?T8e(c):(Pa&&zO(l,c,p),j8e(c),l===hc&&((qr&el)===ba&&(gk=br(gk,p)),xa===mk&&u0(l,ya)),Qc(l,v),p===Un&&qr===ba&&(c.mode&jr)===Pn&&!Mh.isBatchingLegacy&&(bk(),tie()))}function r8e(l,c,p){var v=l.current;v.lanes=c,Lv(l,c,p),Qc(l,p)}function i8e(l){return(qr&el)!==ba}function Qc(l,c){var p=l.callbackNode;DO(l,c);var v=Tl(l,l===hc?ya:bt);if(v===bt){p!==null&&voe(p),l.callbackNode=null,l.callbackPriority=lo;return}var w=Ep(v),R=l.callbackPriority;if(R===w&&!(Mh.current!==null&&p!==QW)){p==null&&R!==Un&&u("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.");return}p!=null&&voe(p);var P;if(w===Un)l.tag===Zv?(Mh.isBatchingLegacy!==null&&(Mh.didScheduleLegacyUpdate=!0),PBe(ioe.bind(null,l))):eie(ioe.bind(null,l)),Mh.current!==null?Mh.current.push(Jv):D6e(function(){(qr&(el|Pd))===ba&&Jv()}),P=null;else{var $;switch(BO(v)){case Ml:$=vh;break;case Bc:$=Ty;break;case da:$=xp;break;case kS:$=jv;break;default:$=xp;break}P=ZW($,noe.bind(null,l))}l.callbackPriority=w,l.callbackNode=P}function noe(l,c){if(CWe(),wk=Si,TD=bt,(qr&(el|Pd))!==ba)throw new Error("Should not already be working.");var p=l.callbackNode,v=Kp();if(v&&l.callbackNode!==p)return null;var w=Tl(l,l===hc?ya:bt);if(w===bt)return null;var R=!zy(l,w)&&!LO(l,w)&&!c,P=R?m8e(l,w):PD(l,w);if(P!==Up){if(P===vx){var $=xS(l);$!==bt&&(w=$,P=UW(l,$))}if(P===fk){var Y=pk;throw yx(l,bt),u0(l,w),Qc(l,Ws()),Y}if(P===HW)u0(l,w);else{var le=!zy(l,w),ue=l.current.alternate;if(le&&!o8e(ue)){if(P=PD(l,w),P===vx){var He=xS(l);He!==bt&&(w=He,P=UW(l,He))}if(P===fk){var Ie=pk;throw yx(l,bt),u0(l,w),Qc(l,Ws()),Ie}}l.finishedWork=ue,l.finishedLanes=w,s8e(l,P,w)}}return Qc(l,Ws()),l.callbackNode===p?noe.bind(null,l):null}function UW(l,c){var p=vk;if(kp(l)){var v=yx(l,c);v.flags|=is,_Be(l.containerInfo)}var w=PD(l,c);if(w!==vx){var R=Xc;Xc=p,R!==null&&roe(R)}return w}function roe(l){Xc===null?Xc=l:Xc.push.apply(Xc,l)}function s8e(l,c,p){switch(c){case Up:case fk:throw new Error("Root did not complete. This is a bug in React.");case vx:{xx(l,Xc,Yp);break}case SD:{if(u0(l,p),wS(p)&&!boe()){var v=$W+Zse-Ws();if(v>10){var w=Tl(l,bt);if(w!==bt)break;var R=l.suspendedLanes;if(!Np(R,p)){fc(),_S(l,R);break}l.timeoutHandle=V6(xx.bind(null,l,Xc,Yp),v);break}}xx(l,Xc,Yp);break}case mk:{if(u0(l,p),f6(p))break;if(!boe()){var P=oN(l,p),$=P,Y=Ws()-$,le=_8e(Y)-Y;if(le>10){l.timeoutHandle=V6(xx.bind(null,l,Xc,Yp),le);break}}xx(l,Xc,Yp);break}case Qse:{xx(l,Xc,Yp);break}default:throw new Error("Unknown root exit status.")}}function o8e(l){for(var c=l;;){if(c.flags&QC){var p=c.updateQueue;if(p!==null){var v=p.stores;if(v!==null)for(var w=0;w<v.length;w++){var R=v[w],P=R.getSnapshot,$=R.value;try{if(!on(P(),$))return!1}catch{return!1}}}}var Y=c.child;if(c.subtreeFlags&QC&&Y!==null){Y.return=c,c=Y;continue}if(c===l)return!0;for(;c.sibling===null;){if(c.return===null||c.return===l)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}return!0}function u0(l,c){c=Vy(c,_D),c=Vy(c,gk),hN(l,c)}function ioe(l){if(SWe(),(qr&(el|Pd))!==ba)throw new Error("Should not already be working.");Kp();var c=Tl(l,bt);if(!jl(c,Un))return Qc(l,Ws()),null;var p=PD(l,c);if(l.tag!==Zv&&p===vx){var v=xS(l);v!==bt&&(c=v,p=UW(l,v))}if(p===fk){var w=pk;throw yx(l,bt),u0(l,c),Qc(l,Ws()),w}if(p===HW)throw new Error("Root did not complete. This is a bug in React.");var R=l.current.alternate;return l.finishedWork=R,l.finishedLanes=c,xx(l,Xc,Yp),Qc(l,Ws()),null}function a8e(l,c){c!==bt&&(By(l,br(c,Un)),Qc(l,Ws()),(qr&(el|Pd))===ba&&(bk(),Jv()))}function YW(l,c){var p=qr;qr|=Xse;try{return l(c)}finally{qr=p,qr===ba&&!Mh.isBatchingLegacy&&(bk(),tie())}}function l8e(l,c,p,v,w){var R=ac(),P=Ja.transition;try{return Ja.transition=null,Eo(Ml),l(c,p,v,w)}finally{Eo(R),Ja.transition=P,qr===ba&&bk()}}function Gp(l){l0!==null&&l0.tag===Zv&&(qr&(el|Pd))===ba&&Kp();var c=qr;qr|=Xse;var p=Ja.transition,v=ac();try{return Ja.transition=null,Eo(Ml),l?l():void 0}finally{Eo(v),Ja.transition=p,qr=c,(qr&(el|Pd))===ba&&Jv()}}function soe(){return(qr&(el|Pd))!==ba}function MD(l,c){Ol(LW,im,l),im=br(im,c)}function GW(l){im=LW.current,Al(LW,l)}function yx(l,c){l.finishedWork=null,l.finishedLanes=bt;var p=l.timeoutHandle;if(p!==B6&&(l.timeoutHandle=B6,I6e(p)),Ks!==null)for(var v=Ks.return;v!==null;){var w=v.alternate;Ose(w,v),v=v.return}hc=l;var R=wx(l.current,null);return Ks=R,ya=im=c,xa=Up,pk=null,RD=bt,gk=bt,_D=bt,vk=null,Xc=null,rWe(),Sh.discardPendingWarnings(),R}function ooe(l,c){do{var p=Ks;try{if(zI(),jie(),ji(),DW.current=null,p===null||p.return===null){xa=fk,pk=c,Ks=null;return}if(xe&&p.mode&Ur&&gD(p,!0),ne)if(Df(),c!==null&&typeof c=="object"&&typeof c.then=="function"){var v=c;My(p,v,ya)}else Rd(p,c,ya);PWe(l,p.return,p,c,ya),uoe(p)}catch(w){c=w,Ks===p&&p!==null?(p=p.return,Ks=p):p=Ks;continue}return}while(!0)}function aoe(){var l=IW.current;return IW.current=dD,l===null?dD:l}function loe(l){IW.current=l}function c8e(){$W=Ws()}function Ck(l){RD=br(l,RD)}function u8e(){xa===Up&&(xa=SD)}function KW(){(xa===Up||xa===SD||xa===vx)&&(xa=mk),hc!==null&&(zf(RD)||zf(gk))&&u0(hc,ya)}function d8e(l){xa!==mk&&(xa=vx),vk===null?vk=[l]:vk.push(l)}function h8e(){return xa===Up}function PD(l,c){var p=qr;qr|=el;var v=aoe();if(hc!==l||ya!==c){if(Pa){var w=l.memoizedUpdaters;w.size>0&&(Sk(l,ya),w.clear()),fN(l,c)}Yp=NS(),yx(l,c)}nN(c);do try{f8e();break}catch(R){ooe(l,R)}while(!0);if(zI(),qr=p,loe(v),Ks!==null)throw new Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");return ss(),hc=null,ya=bt,xa}function f8e(){for(;Ks!==null;)coe(Ks)}function m8e(l,c){var p=qr;qr|=el;var v=aoe();if(hc!==l||ya!==c){if(Pa){var w=l.memoizedUpdaters;w.size>0&&(Sk(l,ya),w.clear()),fN(l,c)}Yp=NS(),bk(),yx(l,c)}nN(c);do try{p8e();break}catch(R){ooe(l,R)}while(!0);return zI(),loe(v),qr=p,Ks!==null?(rN(),Up):(ss(),hc=null,ya=bt,xa)}function p8e(){for(;Ks!==null&&!KE();)coe(Ks)}function coe(l){var c=l.alternate;Or(l);var p;(l.mode&Ur)!==Pn?(QB(l),p=qW(c,l,im),gD(l,!0)):p=qW(c,l,im),ji(),l.memoizedProps=l.pendingProps,p===null?uoe(l):Ks=p,DW.current=null}function uoe(l){var c=l;do{var p=c.alternate,v=c.return;if((c.flags&bp)===Mn){Or(c);var w=void 0;if((c.mode&Ur)===Pn?w=Ase(p,c,im):(QB(c),w=Ase(p,c,im),gD(c,!1)),ji(),w!==null){Ks=w;return}}else{var R=uUe(p,c);if(R!==null){R.flags&=RO,Ks=R;return}if((c.mode&Ur)!==Pn){gD(c,!1);for(var P=c.actualDuration,$=c.child;$!==null;)P+=$.actualDuration,$=$.sibling;c.actualDuration=P}if(v!==null)v.flags|=bp,v.subtreeFlags=Mn,v.deletions=null;else{xa=HW,Ks=null;return}}var Y=c.sibling;if(Y!==null){Ks=Y;return}c=v,Ks=c}while(c!==null);xa===Up&&(xa=Qse)}function xx(l,c,p){var v=ac(),w=Ja.transition;try{Ja.transition=null,Eo(Ml),g8e(l,c,p,v)}finally{Ja.transition=w,Eo(v)}return null}function g8e(l,c,p,v){do Kp();while(l0!==null);if(N8e(),(qr&(el|Pd))!==ba)throw new Error("Should not already be working.");var w=l.finishedWork,R=l.finishedLanes;if(jO(R),w===null)return Sd(),null;if(R===bt&&u("root.finishedLanes should not be empty during a commit. This is a bug in React."),l.finishedWork=null,l.finishedLanes=bt,w===l.current)throw new Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");l.callbackNode=null,l.callbackPriority=lo;var P=br(w.lanes,w.childLanes);FO(l,P),l===hc&&(hc=null,Ks=null,ya=bt),((w.subtreeFlags&ca)!==Mn||(w.flags&ca)!==Mn)&&(bx||(bx=!0,VW=p,ZW(xp,function(){return Kp(),null})));var $=(w.subtreeFlags&(Af|Tv|Of|ca))!==Mn,Y=(w.flags&(Af|Tv|Of|ca))!==Mn;if($||Y){var le=Ja.transition;Ja.transition=null;var ue=ac();Eo(Ml);var He=qr;qr|=Pd,DW.current=null,pUe(l,w),tse(),TUe(l,w,R),k6e(l.containerInfo),l.current=w,Py(R),jUe(w,l,R),Cp(),EO(),qr=He,Eo(ue),Ja.transition=le}else l.current=w,tse();var Ie=bx;if(bx?(bx=!1,l0=l,yk=R):(v1=0,kD=null),P=l.pendingLanes,P===bt&&(g1=null),Ie||moe(l.current,!1),QE(w.stateNode,v),Pa&&l.memoizedUpdaters.clear(),qUe(),Qc(l,Ws()),c!==null)for(var et=l.onRecoverableError,it=0;it<c.length;it++){var mt=c[it],Zt=mt.stack,$n=mt.digest;et(mt.value,{componentStack:Zt,digest:$n})}if(ED){ED=!1;var Tn=FW;throw FW=null,Tn}return jl(yk,Un)&&l.tag!==Zv&&Kp(),P=l.pendingLanes,jl(P,Un)?(wWe(),l===BW?xk++:(xk=0,BW=l)):xk=0,Jv(),Sd(),null}function Kp(){if(l0!==null){var l=BO(yk),c=Aa(da,l),p=Ja.transition,v=ac();try{return Ja.transition=null,Eo(c),b8e()}finally{Eo(v),Ja.transition=p}}return!1}function v8e(l){zW.push(l),bx||(bx=!0,ZW(xp,function(){return Kp(),null}))}function b8e(){if(l0===null)return!1;var l=VW;VW=null;var c=l0,p=yk;if(l0=null,yk=bt,(qr&(el|Pd))!==ba)throw new Error("Cannot flush passive effects while already rendering.");WW=!0,ND=!1,tN(p);var v=qr;qr|=Pd,HUe(c.current),AUe(c,c.current,p,l);{var w=zW;zW=[];for(var R=0;R<w.length;R++){var P=w[R];yUe(c,P)}}Av(),moe(c.current,!0),qr=v,Jv(),ND?c===kD?v1++:(v1=0,kD=c):v1=0,WW=!1,ND=!1,ZE(c);{var $=c.current.stateNode;$.effectDuration=0,$.passiveEffectDuration=0}return!0}function doe(l){return g1!==null&&g1.has(l)}function y8e(l){g1===null?g1=new Set([l]):g1.add(l)}function x8e(l){ED||(ED=!0,FW=l)}var w8e=x8e;function hoe(l,c,p){var v=px(p,c),w=cse(l,v,Un),R=t0(l,w,Un),P=fc();R!==null&&(Lv(R,Un,P),Qc(R,P))}function ts(l,c,p){if(hUe(p),Rk(!1),l.tag===x){hoe(l,l,p);return}var v=null;for(v=c;v!==null;){if(v.tag===x){hoe(v,l,p);return}else if(v.tag===g){var w=v.type,R=v.stateNode;if(typeof w.getDerivedStateFromError=="function"||typeof R.componentDidCatch=="function"&&!doe(R)){var P=px(p,l),$=pW(v,P,Un),Y=t0(v,$,Un),le=fc();Y!==null&&(Lv(Y,Un,le),Qc(Y,le));return}}v=v.return}u(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer. Error message: %s`,p)}function C8e(l,c,p){var v=l.pingCache;v!==null&&v.delete(c);var w=fc();_S(l,p),M8e(l),hc===l&&Np(ya,p)&&(xa===mk||xa===SD&&wS(ya)&&Ws()-$W<Zse?yx(l,bt):_D=br(_D,p)),Qc(l,w)}function foe(l,c){c===lo&&(c=n8e(l));var p=fc(),v=Kc(l,c);v!==null&&(Lv(v,c,p),Qc(v,p))}function S8e(l){var c=l.memoizedState,p=lo;c!==null&&(p=c.retryLane),foe(l,p)}function R8e(l,c){var p=lo,v;switch(l.tag){case F:v=l.stateNode;var w=l.memoizedState;w!==null&&(p=w.retryLane);break;case pe:v=l.stateNode;break;default:throw new Error("Pinged unknown suspense boundary type. This is probably a bug in React.")}v!==null&&v.delete(c),foe(l,p)}function _8e(l){return l<120?120:l<480?480:l<1080?1080:l<1920?1920:l<3e3?3e3:l<4320?4320:ZUe(l/1960)*1960}function E8e(){if(xk>e8e)throw xk=0,BW=null,new Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");v1>t8e&&(v1=0,kD=null,u("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render."))}function N8e(){Sh.flushLegacyContextWarning(),Sh.flushPendingUnsafeLifecycleWarnings()}function moe(l,c){Or(l),AD(l,Wa,YUe),c&&AD(l,Pf,GUe),AD(l,Wa,WUe),c&&AD(l,Pf,UUe),ji()}function AD(l,c,p){for(var v=l,w=null;v!==null;){var R=v.subtreeFlags&c;v!==w&&v.child!==null&&R!==Mn?v=v.child:((v.flags&c)!==Mn&&p(v),v.sibling!==null?v=v.sibling:v=w=v.return)}}var OD=null;function poe(l){{if((qr&el)!==ba||!(l.mode&jr))return;var c=l.tag;if(c!==y&&c!==x&&c!==g&&c!==m&&c!==H&&c!==B&&c!==te)return;var p=_n(l)||"ReactComponent";if(OD!==null){if(OD.has(p))return;OD.add(p)}else OD=new Set([p]);var v=pi;try{Or(l),u("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.")}finally{v?Or(l):ji()}}}var qW;{var k8e=null;qW=function(l,c,p){var v=Soe(k8e,c);try{return kse(l,c,p)}catch(R){if(FBe()||R!==null&&typeof R=="object"&&typeof R.then=="function")throw R;if(zI(),jie(),Ose(l,c),Soe(c,v),c.mode&Ur&&QB(c),Fc(null,kse,null,l,c,p),zE()){var w=VE();typeof w=="object"&&w!==null&&w._suppressLogging&&typeof R=="object"&&R!==null&&!R._suppressLogging&&(R._suppressLogging=!0)}throw R}}}var goe=!1,XW;XW=new Set;function T8e(l){if(Fs&&!bWe())switch(l.tag){case m:case H:case te:{var c=Ks&&_n(Ks)||"Unknown",p=c;if(!XW.has(p)){XW.add(p);var v=_n(l)||"Unknown";u("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render",v,c,c)}break}case g:{goe||(u("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),goe=!0);break}}}function Sk(l,c){if(Pa){var p=l.memoizedUpdaters;p.forEach(function(v){zO(l,v,c)})}}var QW={};function ZW(l,c){{var p=Mh.current;return p!==null?(p.push(c),QW):YE(l,c)}}function voe(l){if(l!==QW)return GE(l)}function boe(){return Mh.current!==null}function j8e(l){{if(l.mode&jr){if(!qse())return}else if(!QUe()||qr!==ba||l.tag!==m&&l.tag!==H&&l.tag!==te)return;if(Mh.current===null){var c=pi;try{Or(l),u(`An update to %s inside a test was not wrapped in act(...). When testing, code that causes React state updates should be wrapped into act(...): act(() => { /* fire events that update state */ }); /* assert on the output */ This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`,_n(l))}finally{c?Or(l):ji()}}}}function M8e(l){l.tag!==Zv&&qse()&&Mh.current===null&&u(`A suspended resource finished loading inside a test, but the event was not wrapped in act(...). When testing, code that resolves suspended data should be wrapped into act(...): act(() => { /* finish loading suspended data */ }); /* assert on the output */ This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`)}function Rk(l){toe=l}var Ad=null,b1=null,P8e=function(l){Ad=l};function y1(l){{if(Ad===null)return l;var c=Ad(l);return c===void 0?l:c.current}}function JW(l){return y1(l)}function eU(l){{if(Ad===null)return l;var c=Ad(l);if(c===void 0){if(l!=null&&typeof l.render=="function"){var p=y1(l.render);if(l.render!==p){var v={$$typeof:Ae,render:p};return l.displayName!==void 0&&(v.displayName=l.displayName),v}}return l}return c.current}}function yoe(l,c){{if(Ad===null)return!1;var p=l.elementType,v=c.type,w=!1,R=typeof v=="object"&&v!==null?v.$$typeof:null;switch(l.tag){case g:{typeof v=="function"&&(w=!0);break}case m:{(typeof v=="function"||R===$t)&&(w=!0);break}case H:{(R===Ae||R===$t)&&(w=!0);break}case B:case te:{(R===Vt||R===$t)&&(w=!0);break}default:return!1}if(w){var P=Ad(p);if(P!==void 0&&P===Ad(v))return!0}return!1}}function xoe(l){{if(Ad===null||typeof WeakSet!="function")return;b1===null&&(b1=new WeakSet),b1.add(l)}}var A8e=function(l,c){{if(Ad===null)return;var p=c.staleFamilies,v=c.updatedFamilies;Kp(),Gp(function(){tU(l.current,v,p)})}},O8e=function(l,c){{if(l.context!==Du)return;Kp(),Gp(function(){_k(c,l,null,null)})}};function tU(l,c,p){{var v=l.alternate,w=l.child,R=l.sibling,P=l.tag,$=l.type,Y=null;switch(P){case m:case te:case g:Y=$;break;case H:Y=$.render;break}if(Ad===null)throw new Error("Expected resolveFamily to be set during hot reload.");var le=!1,ue=!1;if(Y!==null){var He=Ad(Y);He!==void 0&&(p.has(He)?ue=!0:c.has(He)&&(P===g?ue=!0:le=!0))}if(b1!==null&&(b1.has(l)||v!==null&&b1.has(v))&&(ue=!0),ue&&(l._debugNeedsRemount=!0),ue||le){var Ie=Kc(l,Un);Ie!==null&&wa(Ie,l,Un,Si)}w!==null&&!ue&&tU(w,c,p),R!==null&&tU(R,c,p)}}var I8e=function(l,c){{var p=new Set,v=new Set(c.map(function(w){return w.current}));return nU(l.current,v,p),p}};function nU(l,c,p){{var v=l.child,w=l.sibling,R=l.tag,P=l.type,$=null;switch(R){case m:case te:case g:$=P;break;case H:$=P.render;break}var Y=!1;$!==null&&c.has($)&&(Y=!0),Y?D8e(l,p):v!==null&&nU(v,c,p),w!==null&&nU(w,c,p)}}function D8e(l,c){{var p=H8e(l,c);if(p)return;for(var v=l;;){switch(v.tag){case E:c.add(v.stateNode);return;case C:c.add(v.stateNode.containerInfo);return;case x:c.add(v.stateNode.containerInfo);return}if(v.return===null)throw new Error("Expected to reach root first.");v=v.return}}}function H8e(l,c){for(var p=l,v=!1;;){if(p.tag===E)v=!0,c.add(p.stateNode);else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===l)return v;for(;p.sibling===null;){if(p.return===null||p.return===l)return v;p=p.return}p.sibling.return=p.return,p=p.sibling}return!1}var rU;{rU=!1;try{var woe=Object.preventExtensions({})}catch{rU=!0}}function L8e(l,c,p,v){this.tag=l,this.key=p,this.elementType=null,this.type=null,this.stateNode=null,this.return=null,this.child=null,this.sibling=null,this.index=0,this.ref=null,this.pendingProps=c,this.memoizedProps=null,this.updateQueue=null,this.memoizedState=null,this.dependencies=null,this.mode=v,this.flags=Mn,this.subtreeFlags=Mn,this.deletions=null,this.lanes=bt,this.childLanes=bt,this.alternate=null,this.actualDuration=Number.NaN,this.actualStartTime=Number.NaN,this.selfBaseDuration=Number.NaN,this.treeBaseDuration=Number.NaN,this.actualDuration=0,this.actualStartTime=-1,this.selfBaseDuration=0,this.treeBaseDuration=0,this._debugSource=null,this._debugOwner=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,!rU&&typeof Object.preventExtensions=="function"&&Object.preventExtensions(this)}var Hu=function(l,c,p,v){return new L8e(l,c,p,v)};function iU(l){var c=l.prototype;return!!(c&&c.isReactComponent)}function $8e(l){return typeof l=="function"&&!iU(l)&&l.defaultProps===void 0}function F8e(l){if(typeof l=="function")return iU(l)?g:m;if(l!=null){var c=l.$$typeof;if(c===Ae)return H;if(c===Vt)return B}return y}function wx(l,c){var p=l.alternate;p===null?(p=Hu(l.tag,c,l.key,l.mode),p.elementType=l.elementType,p.type=l.type,p.stateNode=l.stateNode,p._debugSource=l._debugSource,p._debugOwner=l._debugOwner,p._debugHookTypes=l._debugHookTypes,p.alternate=l,l.alternate=p):(p.pendingProps=c,p.type=l.type,p.flags=Mn,p.subtreeFlags=Mn,p.deletions=null,p.actualDuration=0,p.actualStartTime=-1),p.flags=l.flags&ao,p.childLanes=l.childLanes,p.lanes=l.lanes,p.child=l.child,p.memoizedProps=l.memoizedProps,p.memoizedState=l.memoizedState,p.updateQueue=l.updateQueue;var v=l.dependencies;switch(p.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext},p.sibling=l.sibling,p.index=l.index,p.ref=l.ref,p.selfBaseDuration=l.selfBaseDuration,p.treeBaseDuration=l.treeBaseDuration,p._debugNeedsRemount=l._debugNeedsRemount,p.tag){case y:case m:case te:p.type=y1(l.type);break;case g:p.type=JW(l.type);break;case H:p.type=eU(l.type);break}return p}function z8e(l,c){l.flags&=ao|_s;var p=l.alternate;if(p===null)l.childLanes=bt,l.lanes=c,l.child=null,l.subtreeFlags=Mn,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null,l.selfBaseDuration=0,l.treeBaseDuration=0;else{l.childLanes=p.childLanes,l.lanes=p.lanes,l.child=p.child,l.subtreeFlags=Mn,l.deletions=null,l.memoizedProps=p.memoizedProps,l.memoizedState=p.memoizedState,l.updateQueue=p.updateQueue,l.type=p.type;var v=p.dependencies;l.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext},l.selfBaseDuration=p.selfBaseDuration,l.treeBaseDuration=p.treeBaseDuration}return l}function V8e(l,c,p){var v;return l===MI?(v=jr,c===!0&&(v|=hr,v|=Oi)):v=Pn,Pa&&(v|=Ur),Hu(x,null,null,v)}function sU(l,c,p,v,w,R){var P=y,$=l;if(typeof l=="function")iU(l)?(P=g,$=JW($)):$=y1($);else if(typeof l=="string")P=E;else e:switch(l){case tn:return d0(p.children,w,R,c);case mn:P=L,w|=hr,(w&jr)!==Pn&&(w|=Oi);break;case dn:return B8e(p,w,R,c);case Je:return W8e(p,w,R,c);case vt:return U8e(p,w,R,c);case Ct:return Coe(p,w,R,c);case ge:case jt:case ct:case xt:case Ft:default:{if(typeof l=="object"&&l!==null)switch(l.$$typeof){case Ne:P=z;break e;case oe:P=D;break e;case Ae:P=H,$=eU($);break e;case Vt:P=B;break e;case $t:P=ve,$=null;break e}var Y="";{(l===void 0||typeof l=="object"&&l!==null&&Object.keys(l).length===0)&&(Y+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var le=v?_n(v):null;le&&(Y+=` Check the render method of \``+le+"`.")}throw new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) "+("but got: "+(l==null?l:typeof l)+"."+Y))}}var ue=Hu(P,p,c,w);return ue.elementType=l,ue.type=$,ue.lanes=R,ue._debugOwner=v,ue}function oU(l,c,p){var v=null;v=l._owner;var w=l.type,R=l.key,P=l.props,$=sU(w,R,P,v,c,p);return $._debugSource=l._source,$._debugOwner=l._owner,$}function d0(l,c,p,v){var w=Hu(j,l,v,c);return w.lanes=p,w}function B8e(l,c,p,v){typeof l.id!="string"&&u('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof l.id);var w=Hu(V,l,v,c|Ur);return w.elementType=dn,w.lanes=p,w.stateNode={effectDuration:0,passiveEffectDuration:0},w}function W8e(l,c,p,v){var w=Hu(F,l,v,c);return w.elementType=Je,w.lanes=p,w}function U8e(l,c,p,v){var w=Hu(pe,l,v,c);return w.elementType=vt,w.lanes=p,w}function Coe(l,c,p,v){var w=Hu(Fe,l,v,c);w.elementType=Ct,w.lanes=p;var R={isHidden:!1};return w.stateNode=R,w}function aU(l,c,p){var v=Hu(M,l,null,c);return v.lanes=p,v}function Y8e(){var l=Hu(E,null,null,Pn);return l.elementType="DELETED",l}function G8e(l){var c=Hu(_e,null,null,Pn);return c.stateNode=l,c}function lU(l,c,p){var v=l.children!==null?l.children:[],w=Hu(C,v,l.key,c);return w.lanes=p,w.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},w}function Soe(l,c){return l===null&&(l=Hu(y,null,null,Pn)),l.tag=c.tag,l.key=c.key,l.elementType=c.elementType,l.type=c.type,l.stateNode=c.stateNode,l.return=c.return,l.child=c.child,l.sibling=c.sibling,l.index=c.index,l.ref=c.ref,l.pendingProps=c.pendingProps,l.memoizedProps=c.memoizedProps,l.updateQueue=c.updateQueue,l.memoizedState=c.memoizedState,l.dependencies=c.dependencies,l.mode=c.mode,l.flags=c.flags,l.subtreeFlags=c.subtreeFlags,l.deletions=c.deletions,l.lanes=c.lanes,l.childLanes=c.childLanes,l.alternate=c.alternate,l.actualDuration=c.actualDuration,l.actualStartTime=c.actualStartTime,l.selfBaseDuration=c.selfBaseDuration,l.treeBaseDuration=c.treeBaseDuration,l._debugSource=c._debugSource,l._debugOwner=c._debugOwner,l._debugNeedsRemount=c._debugNeedsRemount,l._debugHookTypes=c._debugHookTypes,l}function K8e(l,c,p,v,w){this.tag=c,this.containerInfo=l,this.pendingChildren=null,this.current=null,this.pingCache=null,this.finishedWork=null,this.timeoutHandle=B6,this.context=null,this.pendingContext=null,this.callbackNode=null,this.callbackPriority=lo,this.eventTimes=RS(bt),this.expirationTimes=RS(Si),this.pendingLanes=bt,this.suspendedLanes=bt,this.pingedLanes=bt,this.expiredLanes=bt,this.mutableReadLanes=bt,this.finishedLanes=bt,this.entangledLanes=bt,this.entanglements=RS(bt),this.identifierPrefix=v,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null,this.effectDuration=0,this.passiveEffectDuration=0;{this.memoizedUpdaters=new Set;for(var R=this.pendingUpdatersLaneMap=[],P=0;P<sN;P++)R.push(new Set)}switch(c){case MI:this._debugRootType=p?"hydrateRoot()":"createRoot()";break;case Zv:this._debugRootType=p?"hydrate()":"render()";break}}function Roe(l,c,p,v,w,R,P,$,Y,le){var ue=new K8e(l,c,p,$,Y),He=V8e(c,R);ue.current=He,He.stateNode=ue;{var Ie={element:v,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null};He.memoizedState=Ie}return wB(He),ue}var cU="18.3.1";function q8e(l,c,p){var v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;return re(v),{$$typeof:en,key:v==null?null:""+v,children:l,containerInfo:c,implementation:p}}var uU,dU;uU=!1,dU={};function _oe(l){if(!l)return Du;var c=kv(l),p=MBe(c);if(c.tag===g){var v=c.type;if(Qf(v))return Zre(c,v,p)}return p}function X8e(l,c){{var p=kv(l);if(p===void 0){if(typeof l.render=="function")throw new Error("Unable to find node on an unmounted component.");var v=Object.keys(l).join(",");throw new Error("Argument appears to not be a ReactComponent. Keys: "+v)}var w=El(p);if(w===null)return null;if(w.mode&hr){var R=_n(p)||"Component";if(!dU[R]){dU[R]=!0;var P=pi;try{Or(w),p.mode&hr?u("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",c,c,R):u("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node",c,c,R)}finally{P?Or(P):ji()}}}return w.stateNode}}function Eoe(l,c,p,v,w,R,P,$){var Y=!1,le=null;return Roe(l,c,Y,le,p,v,w,R,P)}function Noe(l,c,p,v,w,R,P,$,Y,le){var ue=!0,He=Roe(p,v,ue,l,w,R,P,$,Y);He.context=_oe(null);var Ie=He.current,et=fc(),it=c0(Ie),mt=Bp(et,it);return mt.callback=c??null,t0(Ie,mt,it),r8e(He,it,et),He}function _k(l,c,p,v){XE(c,l);var w=c.current,R=fc(),P=c0(w);tS(P);var $=_oe(p);c.context===null?c.context=$:c.pendingContext=$,Fs&&pi!==null&&!uU&&(uU=!0,u(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate. Check the render method of %s.`,_n(pi)||"Unknown"));var Y=Bp(R,P);Y.payload={element:l},v=v===void 0?null:v,v!==null&&(typeof v!="function"&&u("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",v),Y.callback=v);var le=t0(w,Y,P);return le!==null&&(wa(le,w,P,R),YI(le,w,P)),P}function ID(l){var c=l.current;if(!c.child)return null;switch(c.child.tag){case E:return c.child.stateNode;default:return c.child.stateNode}}function Q8e(l){switch(l.tag){case x:{var c=l.stateNode;if(kp(c)){var p=HO(c);a8e(c,p)}break}case F:{Gp(function(){var w=Kc(l,Un);if(w!==null){var R=fc();wa(w,l,Un,R)}});var v=Un;hU(l,v);break}}}function koe(l,c){var p=l.memoizedState;p!==null&&p.dehydrated!==null&&(p.retryLane=dN(p.retryLane,c))}function hU(l,c){koe(l,c);var p=l.alternate;p&&koe(p,c)}function Z8e(l){if(l.tag===F){var c=Hv,p=Kc(l,c);if(p!==null){var v=fc();wa(p,l,c,v)}hU(l,c)}}function J8e(l){if(l.tag===F){var c=c0(l),p=Kc(l,c);if(p!==null){var v=fc();wa(p,l,c,v)}hU(l,c)}}function Toe(l){var c=Pu(l);return c===null?null:c.stateNode}var joe=function(l){return null};function e9e(l){return joe(l)}var Moe=function(l){return!1};function t9e(l){return Moe(l)}var Poe=null,Aoe=null,Ooe=null,Ioe=null,Doe=null,Hoe=null,Loe=null,$oe=null,Foe=null;{var zoe=function(l,c,p){var v=c[p],w=vr(l)?l.slice():Bt({},l);return p+1===c.length?(vr(w)?w.splice(v,1):delete w[v],w):(w[v]=zoe(l[v],c,p+1),w)},Voe=function(l,c){return zoe(l,c,0)},Boe=function(l,c,p,v){var w=c[v],R=vr(l)?l.slice():Bt({},l);if(v+1===c.length){var P=p[v];R[P]=R[w],vr(R)?R.splice(w,1):delete R[w]}else R[w]=Boe(l[w],c,p,v+1);return R},Woe=function(l,c,p){if(c.length!==p.length){a("copyWithRename() expects paths of the same length");return}else for(var v=0;v<p.length-1;v++)if(c[v]!==p[v]){a("copyWithRename() expects paths to be the same except for the deepest key");return}return Boe(l,c,p,0)},Uoe=function(l,c,p,v){if(p>=c.length)return v;var w=c[p],R=vr(l)?l.slice():Bt({},l);return R[w]=Uoe(l[w],c,p+1,v),R},Yoe=function(l,c,p){return Uoe(l,c,0,p)},fU=function(l,c){for(var p=l.memoizedState;p!==null&&c>0;)p=p.next,c--;return p};Poe=function(l,c,p,v){var w=fU(l,c);if(w!==null){var R=Yoe(w.memoizedState,p,v);w.memoizedState=R,w.baseState=R,l.memoizedProps=Bt({},l.memoizedProps);var P=Kc(l,Un);P!==null&&wa(P,l,Un,Si)}},Aoe=function(l,c,p){var v=fU(l,c);if(v!==null){var w=Voe(v.memoizedState,p);v.memoizedState=w,v.baseState=w,l.memoizedProps=Bt({},l.memoizedProps);var R=Kc(l,Un);R!==null&&wa(R,l,Un,Si)}},Ooe=function(l,c,p,v){var w=fU(l,c);if(w!==null){var R=Woe(w.memoizedState,p,v);w.memoizedState=R,w.baseState=R,l.memoizedProps=Bt({},l.memoizedProps);var P=Kc(l,Un);P!==null&&wa(P,l,Un,Si)}},Ioe=function(l,c,p){l.pendingProps=Yoe(l.memoizedProps,c,p),l.alternate&&(l.alternate.pendingProps=l.pendingProps);var v=Kc(l,Un);v!==null&&wa(v,l,Un,Si)},Doe=function(l,c){l.pendingProps=Voe(l.memoizedProps,c),l.alternate&&(l.alternate.pendingProps=l.pendingProps);var p=Kc(l,Un);p!==null&&wa(p,l,Un,Si)},Hoe=function(l,c,p){l.pendingProps=Woe(l.memoizedProps,c,p),l.alternate&&(l.alternate.pendingProps=l.pendingProps);var v=Kc(l,Un);v!==null&&wa(v,l,Un,Si)},Loe=function(l){var c=Kc(l,Un);c!==null&&wa(c,l,Un,Si)},$oe=function(l){joe=l},Foe=function(l){Moe=l}}function n9e(l){var c=El(l);return c===null?null:c.stateNode}function r9e(l){return null}function i9e(){return pi}function s9e(l){var c=l.findFiberByHostInstance,p=r.ReactCurrentDispatcher;return qE({bundleType:l.bundleType,version:l.version,rendererPackageName:l.rendererPackageName,rendererConfig:l.rendererConfig,overrideHookState:Poe,overrideHookStateDeletePath:Aoe,overrideHookStateRenamePath:Ooe,overrideProps:Ioe,overridePropsDeletePath:Doe,overridePropsRenamePath:Hoe,setErrorHandler:$oe,setSuspenseHandler:Foe,scheduleUpdate:Loe,currentDispatcherRef:p,findHostInstanceByFiber:n9e,findFiberByHostInstance:c||r9e,findHostInstancesForRefresh:I8e,scheduleRefresh:A8e,scheduleRoot:O8e,setRefreshHandler:P8e,getCurrentFiber:i9e,reconcilerVersion:cU})}var Goe=typeof reportError=="function"?reportError:function(l){console.error(l)};function mU(l){this._internalRoot=l}DD.prototype.render=mU.prototype.render=function(l){var c=this._internalRoot;if(c===null)throw new Error("Cannot update an unmounted root.");{typeof arguments[1]=="function"?u("render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."):HD(arguments[1])?u("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root."):typeof arguments[1]<"u"&&u("You passed a second argument to root.render(...) but it only accepts one argument.");var p=c.containerInfo;if(p.nodeType!==so){var v=Toe(c.current);v&&v.parentNode!==p&&u("render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container.")}}_k(l,c,null,null)},DD.prototype.unmount=mU.prototype.unmount=function(){typeof arguments[0]=="function"&&u("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");var l=this._internalRoot;if(l!==null){this._internalRoot=null;var c=l.containerInfo;soe()&&u("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."),Gp(function(){_k(null,l,null,null)}),Gre(c)}};function o9e(l,c){if(!HD(l))throw new Error("createRoot(...): Target container is not a DOM element.");Koe(l);var p=!1,v=!1,w="",R=Goe;c!=null&&(c.hydrate?a("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead."):typeof c=="object"&&c!==null&&c.$$typeof===Wt&&u(`You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage: let root = createRoot(domContainer); root.render(<App />);`),c.unstable_strictMode===!0&&(p=!0),c.identifierPrefix!==void 0&&(w=c.identifierPrefix),c.onRecoverableError!==void 0&&(R=c.onRecoverableError),c.transitionCallbacks!==void 0&&c.transitionCallbacks);var P=Eoe(l,MI,null,p,v,w,R);RI(P.current,l);var $=l.nodeType===so?l.parentNode:l;return MN($),new mU(P)}function DD(l){this._internalRoot=l}function a9e(l){l&&KO(l)}DD.prototype.unstable_scheduleHydration=a9e;function l9e(l,c,p){if(!HD(l))throw new Error("hydrateRoot(...): Target container is not a DOM element.");Koe(l),c===void 0&&u("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var v=p??null,w=p!=null&&p.hydratedSources||null,R=!1,P=!1,$="",Y=Goe;p!=null&&(p.unstable_strictMode===!0&&(R=!0),p.identifierPrefix!==void 0&&($=p.identifierPrefix),p.onRecoverableError!==void 0&&(Y=p.onRecoverableError));var le=Noe(c,null,l,MI,v,R,P,$,Y);if(RI(le.current,l),MN(l),w)for(var ue=0;ue<w.length;ue++){var He=w[ue];hWe(le,He)}return new DD(le)}function HD(l){return!!(l&&(l.nodeType===Sl||l.nodeType===mh||l.nodeType===fy))}function Ek(l){return!!(l&&(l.nodeType===Sl||l.nodeType===mh||l.nodeType===fy||l.nodeType===so&&l.nodeValue===" react-mount-point-unstable "))}function Koe(l){l.nodeType===Sl&&l.tagName&&l.tagName.toUpperCase()==="BODY"&&u("createRoot(): Creating roots directly with document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try using a container element created for your app."),VN(l)&&(l._reactRootContainer?u("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported."):u("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it."))}var c9e=r.ReactCurrentOwner,qoe;qoe=function(l){if(l._reactRootContainer&&l.nodeType!==so){var c=Toe(l._reactRootContainer.current);c&&c.parentNode!==l&&u("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.")}var p=!!l._reactRootContainer,v=pU(l),w=!!(v&&Xv(v));w&&!p&&u("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render."),l.nodeType===Sl&&l.tagName&&l.tagName.toUpperCase()==="BODY"&&u("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.")};function pU(l){return l?l.nodeType===mh?l.documentElement:l.firstChild:null}function Xoe(){}function u9e(l,c,p,v,w){if(w){if(typeof v=="function"){var R=v;v=function(){var Ie=ID(P);R.call(Ie)}}var P=Noe(c,v,l,Zv,null,!1,!1,"",Xoe);l._reactRootContainer=P,RI(P.current,l);var $=l.nodeType===so?l.parentNode:l;return MN($),Gp(),P}else{for(var Y;Y=l.lastChild;)l.removeChild(Y);if(typeof v=="function"){var le=v;v=function(){var Ie=ID(ue);le.call(Ie)}}var ue=Eoe(l,Zv,null,!1,!1,"",Xoe);l._reactRootContainer=ue,RI(ue.current,l);var He=l.nodeType===so?l.parentNode:l;return MN(He),Gp(function(){_k(c,ue,p,v)}),ue}}function d9e(l,c){l!==null&&typeof l!="function"&&u("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",c,l)}function LD(l,c,p,v,w){qoe(p),d9e(w===void 0?null:w,"render");var R=p._reactRootContainer,P;if(!R)P=u9e(p,c,l,w,v);else{if(P=R,typeof w=="function"){var $=w;w=function(){var Y=ID(P);$.call(Y)}}_k(c,P,l,w)}return ID(P)}var Qoe=!1;function h9e(l){{Qoe||(Qoe=!0,u("findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node"));var c=c9e.current;if(c!==null&&c.stateNode!==null){var p=c.stateNode._warnedAboutRefsInRender;p||u("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",sr(c.type)||"A component"),c.stateNode._warnedAboutRefsInRender=!0}}return l==null?null:l.nodeType===Sl?l:X8e(l,"findDOMNode")}function f9e(l,c,p){if(u("ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Ek(c))throw new Error("Target container is not a DOM element.");{var v=VN(c)&&c._reactRootContainer===void 0;v&&u("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?")}return LD(null,l,c,!0,p)}function m9e(l,c,p){if(u("ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Ek(c))throw new Error("Target container is not a DOM element.");{var v=VN(c)&&c._reactRootContainer===void 0;v&&u("You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?")}return LD(null,l,c,!1,p)}function p9e(l,c,p,v){if(u("ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Ek(p))throw new Error("Target container is not a DOM element.");if(l==null||!vp(l))throw new Error("parentComponent must be a valid React Component");return LD(l,c,p,!1,v)}var Zoe=!1;function g9e(l){if(Zoe||(Zoe=!0,u("unmountComponentAtNode is deprecated and will be removed in the next major release. Switch to the createRoot API. Learn more: https://reactjs.org/link/switch-to-createroot")),!Ek(l))throw new Error("unmountComponentAtNode(...): Target container is not a DOM element.");{var c=VN(l)&&l._reactRootContainer===void 0;c&&u("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?")}if(l._reactRootContainer){{var p=pU(l),v=p&&!Xv(p);v&&u("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.")}return Gp(function(){LD(null,null,l,!1,function(){l._reactRootContainer=null,Gre(l)})}),!0}else{{var w=pU(l),R=!!(w&&Xv(w)),P=l.nodeType===Sl&&Ek(l.parentNode)&&!!l.parentNode._reactRootContainer;R&&u("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s",P?"You may have accidentally passed in a React root node instead of its container.":"Instead, have the parent component update its state and rerender in order to remove this component.")}return!1}}p6(Q8e),pN(Z8e),g6(J8e),TS(ac),WO(VO),(typeof Map!="function"||Map.prototype==null||typeof Map.prototype.forEach!="function"||typeof Set!="function"||Set.prototype==null||typeof Set.prototype.clear!="function"||typeof Set.prototype.forEach!="function")&&u("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),Cy(b6e),CO(YW,l8e,Gp);function v9e(l,c){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!HD(c))throw new Error("Target container is not a DOM element.");return q8e(l,c,null,p)}function b9e(l,c,p,v){return p9e(l,c,p,v)}var gU={usingClientEntryPoint:!1,Events:[Xv,XS,_I,$E,Rv,YW]};function y9e(l,c){return gU.usingClientEntryPoint||u('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'),o9e(l,c)}function x9e(l,c,p){return gU.usingClientEntryPoint||u('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'),l9e(l,c,p)}function w9e(l){return soe()&&u("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."),Gp(l)}var C9e=s9e({findFiberByHostInstance:ox,bundleType:1,version:cU,rendererPackageName:"react-dom"});if(!C9e&&O&&window.top===window.self&&(navigator.userAgent.indexOf("Chrome")>-1&&navigator.userAgent.indexOf("Edge")===-1||navigator.userAgent.indexOf("Firefox")>-1)){var Joe=window.location.protocol;/^(https?|file):$/.test(Joe)&&console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools"+(Joe==="file:"?` You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq`:""),"font-weight:bold")}vc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gU,vc.createPortal=v9e,vc.createRoot=y9e,vc.findDOMNode=h9e,vc.flushSync=w9e,vc.hydrate=f9e,vc.hydrateRoot=x9e,vc.render=m9e,vc.unmountComponentAtNode=g9e,vc.unstable_batchedUpdates=YW,vc.unstable_renderSubtreeIntoContainer=b9e,vc.version=cU,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}(),vc}var NU={};function kU(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(NU.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kU)}catch(t){console.error(t)}}}NU.NODE_ENV==="production"?(kU(),zD.exports=dae()):zD.exports=hae();var WD=zD.exports;const TU=w1(WD);var fae={},E1=WD;if(fae.NODE_ENV==="production")_1.createRoot=E1.createRoot,_1.hydrateRoot=E1.hydrateRoot;else{var Tk=E1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;_1.createRoot=function(t,e){Tk.usingClientEntryPoint=!0;try{return E1.createRoot(t,e)}finally{Tk.usingClientEntryPoint=!1}},_1.hydrateRoot=function(t,e,n){Tk.usingClientEntryPoint=!0;try{return E1.hydrateRoot(t,e,n)}finally{Tk.usingClientEntryPoint=!1}}}/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var mae={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.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pae=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Mt=(t,e)=>{const n=W.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:u="",children:h,...m},g)=>W.createElement("svg",{ref:g,...mae,width:i,height:i,stroke:r,strokeWidth:a?Number(s)*24/Number(i):s,className:["lucide",`lucide-${pae(t)}`,u].join(" "),...m},[...e.map(([y,x])=>W.createElement(y,x)),...Array.isArray(h)?h:[h]]));return n.displayName=`${t}`,n};/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qs=Mt("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const UD=Mt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const h0=Mt("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jU=Mt("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const MU=Mt("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const YD=Mt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const PU=Mt("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const AU=Mt("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gae=Mt("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const OU=Mt("Calculator",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ll=Mt("Calendar",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const IU=Mt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xp=Mt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const N1=Mt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const f0=Mt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vae=Mt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ph=Mt("CircleAlert",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const DU=Mt("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ho=Mt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Cx=Mt("CircleHelp",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const HU=Mt("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const GD=Mt("CircleX",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Qp=Mt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const LU=Mt("CodeXml",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const KD=Mt("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $U=Mt("Copy",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zp=Mt("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** * @license lucide-react v0.363.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=Mt("Database",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bae=Mt("DollarSign",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const om=Mt("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yae=Mt("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $u=Mt("ExternalLink",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jp=Mt("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xae=Mt("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wae=Mt("FileSearch",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const FU=Mt("FileSpreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sx=Mt("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Rx=Mt("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qD=Mt("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const XD=Mt("Globe",[["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"}]]);/** * @license lucide-react v0.363.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=Mt("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const k1=Mt("History",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zU=Mt("ImageOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);/** * @license lucide-react v0.363.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=Mt("Image",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const VU=Mt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zc=Mt("Layers",[["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:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** * @license lucide-react v0.363.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=Mt("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["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"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Cae=Mt("LayoutList",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["path",{d:"M14 4h7",key:"3xa0d5"}],["path",{d:"M14 9h7",key:"1icrd9"}],["path",{d:"M14 15h7",key:"1mj8o2"}],["path",{d:"M14 20h7",key:"11slyb"}]]);/** * @license lucide-react v0.363.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=Mt("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const BU=Mt("Link",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sae=Mt("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Rae=Mt("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _ae=Mt("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Eae=Mt("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** * @license lucide-react v0.363.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=Mt("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Nae=Mt("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kae=Mt("MousePointerClick",[["path",{d:"m9 9 5 12 1.8-5.2L21 14Z",key:"1b76lo"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bc=Mt("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Tae=Mt("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z",key:"ymcmye"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const QD=Mt("Percent",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ZD=Mt("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const JD=Mt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const m0=Mt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jae=Mt("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/** * @license lucide-react v0.363.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=Mt("Printer",[["polyline",{points:"6 9 6 2 18 2 18 9",key:"1306q4"}],["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"}],["rect",{width:"12",height:"8",x:"6",y:"14",key:"5ipwut"}]]);/** * @license lucide-react v0.363.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=Mt("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ur=Mt("RefreshCw",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const am=Mt("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const T1=Mt("RotateCcw",[["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"}]]);/** * @license lucide-react v0.363.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=Mt("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const j1=Mt("SearchCheck",[["path",{d:"m8 11 2 2 4-4",key:"1sed1v"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ia=Mt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const WU=Mt("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const UU=Mt("Server",[["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"}]]);/** * @license lucide-react v0.363.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=Mt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const YU=Mt("ShieldAlert",[["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"}]]);/** * @license lucide-react v0.363.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=Mt("ShieldCheck",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const e2=Mt("Shield",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Da=Mt("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const t2=Mt("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/** * @license lucide-react v0.363.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=Mt("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jc=Mt("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Mae=Mt("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const n2=Mt("Table",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Od=Mt("Tag",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Fu=Mt("Target",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zu=Mt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pae=Mt("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const eu=Mt("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const r2=Mt("TriangleAlert",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Aae=Mt("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const i2=Mt("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const GU=Mt("UserPlus",[["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"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const p0=Mt("User",[["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"}]]);/** * @license lucide-react v0.363.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=Mt("Users",[["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"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Oae=Mt("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qi=Mt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** * @license lucide-react v0.363.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Hr=Mt("Zap",[["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"}]]),s2=W.createContext({});function o2(t){const e=W.useRef(null);return e.current===null&&(e.current=t()),e.current}const Dk=W.createContext(null),a2=W.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class Iae extends W.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Dae({children:t,isPresent:e}){const n=W.useId(),r=W.useRef(null),i=W.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=W.useContext(a2);return W.useInsertionEffect(()=>{const{width:a,height:u,top:h,left:m}=i.current;if(e||!r.current||!a||!u)return;r.current.dataset.motionPopId=n;const g=document.createElement("style");return s&&(g.nonce=s),document.head.appendChild(g),g.sheet&&g.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${a}px !important; height: ${u}px !important; top: ${h}px !important; left: ${m}px !important; } `),()=>{document.head.removeChild(g)}},[e]),o.jsx(Iae,{isPresent:e,childRef:r,sizeRef:i,children:W.cloneElement(t,{ref:r})})}const Hae=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a})=>{const u=o2(Lae),h=W.useId(),m=W.useCallback(y=>{u.set(y,!0);for(const x of u.values())if(!x)return;r&&r()},[u,r]),g=W.useMemo(()=>({id:h,initial:e,isPresent:n,custom:i,onExitComplete:m,register:y=>(u.set(y,!1),()=>u.delete(y))}),s?[Math.random(),m]:[n,m]);return W.useMemo(()=>{u.forEach((y,x)=>u.set(x,!1))},[n]),W.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),a==="popLayout"&&(t=o.jsx(Dae,{isPresent:n,children:t})),o.jsx(Dk.Provider,{value:g,children:t})};function Lae(){return new Map}function KU(t=!0){const e=W.useContext(Dk);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=e,s=W.useId();W.useEffect(()=>{t&&i(s)},[t]);const a=W.useCallback(()=>t&&r&&r(s),[s,r,t]);return!n&&r?[!1,a]:[!0]}const Hk=t=>t.key||"";function qU(t){const e=[];return W.Children.forEach(t,n=>{W.isValidElement(n)&&e.push(n)}),e}const l2=typeof window<"u",XU=l2?W.useLayoutEffect:W.useEffect;var $ae={};const tr=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:a=!1})=>{const[u,h]=KU(a),m=W.useMemo(()=>qU(t),[t]),g=a&&!u?[]:m.map(Hk),y=W.useRef(!0),x=W.useRef(m),C=o2(()=>new Map),[E,M]=W.useState(m),[j,L]=W.useState(m);XU(()=>{y.current=!1,x.current=m;for(let H=0;H<j.length;H++){const V=Hk(j[H]);g.includes(V)?C.delete(V):C.get(V)!==!0&&C.set(V,!1)}},[j,g.length,g.join("-")]);const D=[];if(m!==E){let H=[...m];for(let V=0;V<j.length;V++){const F=j[V],B=Hk(F);g.includes(B)||(H.splice(V,0,F),D.push(F))}s==="wait"&&D.length&&(H=D),L(qU(H)),M(m);return}$ae.NODE_ENV!=="production"&&s==="wait"&&j.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:z}=W.useContext(s2);return o.jsx(o.Fragment,{children:j.map(H=>{const V=Hk(H),F=a&&!u?!1:m===j||g.includes(V),B=()=>{if(C.has(V))C.set(V,!0);else return;let te=!0;C.forEach(ve=>{ve||(te=!1)}),te&&(z==null||z(),L(x.current),a&&(h==null||h()),r&&r())};return o.jsx(Hae,{isPresent:F,initial:!y.current||n?void 0:!1,custom:F?void 0:e,presenceAffectsLayout:i,mode:s,onExitComplete:F?void 0:B,children:H},V)})})},yc=t=>t;var Fae={};let _x=yc,ag=yc;Fae.NODE_ENV!=="production"&&(_x=(t,e)=>{!t&&typeof console<"u"&&console.warn(e)},ag=(t,e)=>{if(!t)throw new Error(e)});function c2(t){let e;return()=>(e===void 0&&(e=t()),e)}const Ex=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r},Ah=t=>t*1e3,lm=t=>t/1e3,zae={useManualTiming:!1};function Vae(t){let e=new Set,n=new Set,r=!1,i=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(m){s.has(m)&&(h.schedule(m),t()),m(a)}const h={schedule:(m,g=!1,y=!1)=>{const C=y&&r?e:n;return g&&s.add(m),C.has(m)||C.add(m),m},cancel:m=>{n.delete(m),s.delete(m)},process:m=>{if(a=m,r){i=!0;return}r=!0,[e,n]=[n,e],e.forEach(u),e.clear(),r=!1,i&&(i=!1,h.process(m))}};return h}const Lk=["read","resolveKeyframes","update","preRender","render","postRender"],Bae=40;function QU(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=Lk.reduce((L,D)=>(L[D]=Vae(s),L),{}),{read:u,resolveKeyframes:h,update:m,preRender:g,render:y,postRender:x}=a,C=()=>{const L=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(L-i.timestamp,Bae),1),i.timestamp=L,i.isProcessing=!0,u.process(i),h.process(i),m.process(i),g.process(i),y.process(i),x.process(i),i.isProcessing=!1,n&&e&&(r=!1,t(C))},E=()=>{n=!0,r=!0,i.isProcessing||t(C)};return{schedule:Lk.reduce((L,D)=>{const z=a[D];return L[D]=(H,V=!1,F=!1)=>(n||E(),z.schedule(H,V,F)),L},{}),cancel:L=>{for(let D=0;D<Lk.length;D++)a[Lk[D]].cancel(L)},state:i,steps:a}}const{schedule:as,cancel:lg,state:Ha,steps:u2}=QU(typeof requestAnimationFrame<"u"?requestAnimationFrame:yc,!0),ZU=W.createContext({strict:!1}),JU={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Nx={};for(const t in JU)Nx[t]={isEnabled:e=>JU[t].some(n=>!!e[n])};function Wae(t){for(const e in t)Nx[e]={...Nx[e],...t[e]}}const Uae=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function $k(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Uae.has(t)}let e8=t=>!$k(t);function Yae(t){t&&(e8=e=>e.startsWith("on")?!$k(e):t(e))}try{Yae(require("@emotion/is-prop-valid").default)}catch{}function Gae(t,e,n){const r={};for(const i in t)i==="values"&&typeof t.values=="object"||(e8(i)||n===!0&&$k(i)||!e&&!$k(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}const t8=new Set;function Fk(t,e,n){t||t8.has(e)||(console.warn(e),t8.add(e))}var Kae={};function qae(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...r)=>(Kae.NODE_ENV!=="production"&&Fk(!1,"motion() is deprecated. Use motion.create() instead."),t(...r));return new Proxy(n,{get:(r,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const zk=W.createContext({});function M1(t){return typeof t=="string"||Array.isArray(t)}function Vk(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const d2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],h2=["initial",...d2];function Bk(t){return Vk(t.animate)||h2.some(e=>M1(t[e]))}function n8(t){return!!(Bk(t)||t.variants)}function Xae(t,e){if(Bk(t)){const{initial:n,animate:r}=t;return{initial:n===!1||M1(n)?n:void 0,animate:M1(r)?r:void 0}}return t.inherit!==!1?e:{}}function Qae(t){const{initial:e,animate:n}=Xae(t,W.useContext(zk));return W.useMemo(()=>({initial:e,animate:n}),[r8(e),r8(n)])}function r8(t){return Array.isArray(t)?t.join(" "):t}const Zae=Symbol.for("motionComponentSymbol");function kx(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Jae(t,e,n){return W.useCallback(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):kx(n)&&(n.current=r))},[e])}const f2=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),i8="data-"+f2("framerAppearId"),{schedule:m2}=QU(queueMicrotask,!1),s8=W.createContext({});function ele(t,e,n,r,i){var s,a;const{visualElement:u}=W.useContext(zk),h=W.useContext(ZU),m=W.useContext(Dk),g=W.useContext(a2).reducedMotion,y=W.useRef(null);r=r||h.renderer,!y.current&&r&&(y.current=r(t,{visualState:e,parent:u,props:n,presenceContext:m,blockInitialAnimation:m?m.initial===!1:!1,reducedMotionConfig:g}));const x=y.current,C=W.useContext(s8);x&&!x.projection&&i&&(x.type==="html"||x.type==="svg")&&tle(y.current,n,i,C);const E=W.useRef(!1);W.useInsertionEffect(()=>{x&&E.current&&x.update(n,m)});const M=n[i8],j=W.useRef(!!M&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,M))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,M)));return XU(()=>{x&&(E.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),m2.render(x.render),j.current&&x.animationState&&x.animationState.animateChanges())}),W.useEffect(()=>{x&&(!j.current&&x.animationState&&x.animationState.animateChanges(),j.current&&(queueMicrotask(()=>{var L;(L=window.MotionHandoffMarkAsComplete)===null||L===void 0||L.call(window,M)}),j.current=!1))}),x}function tle(t,e,n,r){const{layoutId:i,layout:s,drag:a,dragConstraints:u,layoutScroll:h,layoutRoot:m}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:o8(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||u&&kx(u),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:h,layoutRoot:m})}function o8(t){if(t)return t.options.allowProjection!==!1?t.projection:o8(t.parent)}var nle={};function rle({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:i}){var s,a;t&&Wae(t);function u(m,g){let y;const x={...W.useContext(a2),...m,layoutId:ile(m)},{isStatic:C}=x,E=Qae(m),M=r(m,C);if(!C&&l2){sle(x,t);const j=ole(x);y=j.MeasureLayout,E.visualElement=ele(i,M,x,e,j.ProjectionNode)}return o.jsxs(zk.Provider,{value:E,children:[y&&E.visualElement?o.jsx(y,{visualElement:E.visualElement,...x}):null,n(i,m,Jae(M,E.visualElement,g),M,C,E.visualElement)]})}u.displayName=`motion.${typeof i=="string"?i:`create(${(a=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&a!==void 0?a:""})`}`;const h=W.forwardRef(u);return h[Zae]=i,h}function ile({layoutId:t}){const e=W.useContext(s2).id;return e&&t!==void 0?e+"-"+t:t}function sle(t,e){const n=W.useContext(ZU).strict;if(nle.NODE_ENV!=="production"&&e&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?_x(!1,r):ag(!1,r)}}function ole(t){const{drag:e,layout:n}=Nx;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const ale=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function p2(t){return typeof t!="string"||t.includes("-")?!1:!!(ale.indexOf(t)>-1||/[A-Z]/u.test(t))}function a8(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function g2(t,e,n,r){if(typeof e=="function"){const[i,s]=a8(r);e=e(n!==void 0?n:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=a8(r);e=e(n!==void 0?n:t.custom,i,s)}return e}const v2=t=>Array.isArray(t),lle=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),cle=t=>v2(t)?t[t.length-1]||0:t,nl=t=>!!(t&&t.getVelocity);function Wk(t){const e=nl(t)?t.get():t;return lle(e)?e.toValue():e}function ule({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},r,i,s){const a={latestValues:dle(r,i,s,t),renderState:e()};return n&&(a.onMount=u=>n({props:r,current:u,...a}),a.onUpdate=u=>n(u)),a}const l8=t=>(e,n)=>{const r=W.useContext(zk),i=W.useContext(Dk),s=()=>ule(t,e,r,i);return n?s():o2(s)};function dle(t,e,n,r){const i={},s=r(t,{});for(const x in s)i[x]=Wk(s[x]);let{initial:a,animate:u}=t;const h=Bk(t),m=n8(t);e&&m&&!h&&t.inherit!==!1&&(a===void 0&&(a=e.initial),u===void 0&&(u=e.animate));let g=n?n.initial===!1:!1;g=g||a===!1;const y=g?u:a;if(y&&typeof y!="boolean"&&!Vk(y)){const x=Array.isArray(y)?y:[y];for(let C=0;C<x.length;C++){const E=g2(t,x[C]);if(E){const{transitionEnd:M,transition:j,...L}=E;for(const D in L){let z=L[D];if(Array.isArray(z)){const H=g?z.length-1:0;z=z[H]}z!==null&&(i[D]=z)}for(const D in M)i[D]=M[D]}}}return i}const Tx=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],g0=new Set(Tx),c8=t=>e=>typeof e=="string"&&e.startsWith(t),u8=c8("--"),hle=c8("var(--"),b2=t=>hle(t)?fle.test(t.split("/*")[0].trim()):!1,fle=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,d8=(t,e)=>e&&typeof t=="number"?e.transform(t):t,cm=(t,e,n)=>n>e?e:n<t?t:n,jx={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},P1={...jx,transform:t=>cm(0,1,t)},Uk={...jx,default:1},A1=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),cg=A1("deg"),Oh=A1("%"),qn=A1("px"),mle=A1("vh"),ple=A1("vw"),h8={...Oh,parse:t=>Oh.parse(t)/100,transform:t=>Oh.transform(t*100)},gle={borderWidth:qn,borderTopWidth:qn,borderRightWidth:qn,borderBottomWidth:qn,borderLeftWidth:qn,borderRadius:qn,radius:qn,borderTopLeftRadius:qn,borderTopRightRadius:qn,borderBottomRightRadius:qn,borderBottomLeftRadius:qn,width:qn,maxWidth:qn,height:qn,maxHeight:qn,top:qn,right:qn,bottom:qn,left:qn,padding:qn,paddingTop:qn,paddingRight:qn,paddingBottom:qn,paddingLeft:qn,margin:qn,marginTop:qn,marginRight:qn,marginBottom:qn,marginLeft:qn,backgroundPositionX:qn,backgroundPositionY:qn},vle={rotate:cg,rotateX:cg,rotateY:cg,rotateZ:cg,scale:Uk,scaleX:Uk,scaleY:Uk,scaleZ:Uk,skew:cg,skewX:cg,skewY:cg,distance:qn,translateX:qn,translateY:qn,translateZ:qn,x:qn,y:qn,z:qn,perspective:qn,transformPerspective:qn,opacity:P1,originX:h8,originY:h8,originZ:qn},f8={...jx,transform:Math.round},y2={...gle,...vle,zIndex:f8,size:qn,fillOpacity:P1,strokeOpacity:P1,numOctaves:f8},ble={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},yle=Tx.length;function xle(t,e,n){let r="",i=!0;for(let s=0;s<yle;s++){const a=Tx[s],u=t[a];if(u===void 0)continue;let h=!0;if(typeof u=="number"?h=u===(a.startsWith("scale")?1:0):h=parseFloat(u)===0,!h||n){const m=d8(u,y2[a]);if(!h){i=!1;const g=ble[a]||a;r+=`${g}(${m}) `}n&&(e[a]=m)}}return r=r.trim(),n?r=n(e,i?"":r):i&&(r="none"),r}function x2(t,e,n){const{style:r,vars:i,transformOrigin:s}=t;let a=!1,u=!1;for(const h in e){const m=e[h];if(g0.has(h)){a=!0;continue}else if(u8(h)){i[h]=m;continue}else{const g=d8(m,y2[h]);h.startsWith("origin")?(u=!0,s[h]=g):r[h]=g}}if(e.transform||(a||n?r.transform=xle(e,t.transform,n):r.transform&&(r.transform="none")),u){const{originX:h="50%",originY:m="50%",originZ:g=0}=s;r.transformOrigin=`${h} ${m} ${g}`}}const wle={offset:"stroke-dashoffset",array:"stroke-dasharray"},Cle={offset:"strokeDashoffset",array:"strokeDasharray"};function Sle(t,e,n=1,r=0,i=!0){t.pathLength=1;const s=i?wle:Cle;t[s.offset]=qn.transform(-r);const a=qn.transform(e),u=qn.transform(n);t[s.array]=`${a} ${u}`}function m8(t,e,n){return typeof t=="string"?t:qn.transform(e+n*t)}function Rle(t,e,n){const r=m8(e,t.x,t.width),i=m8(n,t.y,t.height);return`${r} ${i}`}function w2(t,{attrX:e,attrY:n,attrScale:r,originX:i,originY:s,pathLength:a,pathSpacing:u=1,pathOffset:h=0,...m},g,y){if(x2(t,m,y),g){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:x,style:C,dimensions:E}=t;x.transform&&(E&&(C.transform=x.transform),delete x.transform),E&&(i!==void 0||s!==void 0||C.transform)&&(C.transformOrigin=Rle(E,i!==void 0?i:.5,s!==void 0?s:.5)),e!==void 0&&(x.x=e),n!==void 0&&(x.y=n),r!==void 0&&(x.scale=r),a!==void 0&&Sle(x,a,u,h,!1)}const C2=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),p8=()=>({...C2(),attrs:{}}),S2=t=>typeof t=="string"&&t.toLowerCase()==="svg";function g8(t,{style:e,vars:n},r,i){Object.assign(t.style,e,i&&i.getProjectionStyles(r));for(const s in n)t.style.setProperty(s,n[s])}const v8=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function b8(t,e,n,r){g8(t,e,void 0,r);for(const i in e.attrs)t.setAttribute(v8.has(i)?i:f2(i),e.attrs[i])}const Yk={};function _le(t){Object.assign(Yk,t)}function y8(t,{layout:e,layoutId:n}){return g0.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Yk[t]||t==="opacity")}function R2(t,e,n){var r;const{style:i}=t,s={};for(const a in i)(nl(i[a])||e.style&&nl(e.style[a])||y8(a,t)||((r=n==null?void 0:n.getValue(a))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[a]=i[a]);return s}function x8(t,e,n){const r=R2(t,e,n);for(const i in t)if(nl(t[i])||nl(e[i])){const s=Tx.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=t[i]}return r}function Ele(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}const w8=["x","y","width","height","cx","cy","r"],Nle={useVisualState:l8({scrapeMotionValuesFromProps:x8,createRenderState:p8,onUpdate:({props:t,prevProps:e,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!t.drag;if(!s){for(const u in i)if(g0.has(u)){s=!0;break}}if(!s)return;let a=!e;if(e)for(let u=0;u<w8.length;u++){const h=w8[u];t[h]!==e[h]&&(a=!0)}a&&as.read(()=>{Ele(n,r),as.render(()=>{w2(r,i,S2(n.tagName),t.transformTemplate),b8(n,r)})})}})},kle={useVisualState:l8({scrapeMotionValuesFromProps:R2,createRenderState:C2})};function C8(t,e,n){for(const r in e)!nl(e[r])&&!y8(r,n)&&(t[r]=e[r])}function Tle({transformTemplate:t},e){return W.useMemo(()=>{const n=C2();return x2(n,e,t),Object.assign({},n.vars,n.style)},[e])}function jle(t,e){const n=t.style||{},r={};return C8(r,n,t),Object.assign(r,Tle(t,e)),r}function Mle(t,e){const n={},r=jle(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}function Ple(t,e,n,r){const i=W.useMemo(()=>{const s=p8();return w2(s,e,S2(r),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};C8(s,t.style,t),i.style={...s,...i.style}}return i}function Ale(t=!1){return(n,r,i,{latestValues:s},a)=>{const h=(p2(n)?Ple:Mle)(r,s,a,n),m=Gae(r,typeof n=="string",t),g=n!==W.Fragment?{...m,...h,ref:i}:{},{children:y}=r,x=W.useMemo(()=>nl(y)?y.get():y,[y]);return W.createElement(n,{...g,children:x})}}function Ole(t,e){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const a={...p2(r)?Nle:kle,preloadedFeatures:t,useRender:Ale(i),createVisualElement:e,Component:r};return rle(a)}}function S8(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function Gk(t,e,n){const r=t.getProps();return g2(r,e,n!==void 0?n:r.custom,t)}const Ile=c2(()=>window.ScrollTimeline!==void 0);class Dle{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=n}attachTimeline(e,n){const r=this.animations.map(i=>{if(Ile()&&i.attachTimeline)return i.attachTimeline(e);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Hle extends Dle{then(e,n){return Promise.all(this.animations).then(e).catch(n)}}function _2(t,e){return t?t[e]||t.default||t:void 0}const E2=2e4;function R8(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<E2;)e+=n,r=t.next(e);return e>=E2?1/0:e}function N2(t){return typeof t=="function"}function _8(t,e){t.timeline=e,t.onfinish=null}const k2=t=>Array.isArray(t)&&typeof t[0]=="number",Lle={linearEasing:void 0};function $le(t,e){const n=c2(t);return()=>{var r;return(r=Lle[e])!==null&&r!==void 0?r:n()}}const Kk=$le(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),E8=(t,e,n=10)=>{let r="";const i=Math.max(Math.round(e/n),2);for(let s=0;s<i;s++)r+=t(Ex(0,i-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function N8(t){return!!(typeof t=="function"&&Kk()||!t||typeof t=="string"&&(t in T2||Kk())||k2(t)||Array.isArray(t)&&t.every(N8))}const O1=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,T2={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:O1([0,.65,.55,1]),circOut:O1([.55,0,1,.45]),backIn:O1([.31,.01,.66,-.59]),backOut:O1([.33,1.53,.69,.99])};function k8(t,e){if(t)return typeof t=="function"&&Kk()?E8(t,e):k2(t)?O1(t):Array.isArray(t)?t.map(n=>k8(n,e)||T2.easeOut):T2[t]}const Id={x:!1,y:!1};function T8(){return Id.x||Id.y}function Fle(t,e,n){var r;if(t instanceof Element)return[t];if(typeof t=="string"){let i=document;const s=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function j8(t,e){const n=Fle(t),r=new AbortController,i={passive:!0,...e,signal:r.signal};return[n,i,()=>r.abort()]}function M8(t){return e=>{e.pointerType==="touch"||T8()||t(e)}}function zle(t,e,n={}){const[r,i,s]=j8(t,n),a=M8(u=>{const{target:h}=u,m=e(u);if(typeof m!="function"||!h)return;const g=M8(y=>{m(y),h.removeEventListener("pointerleave",g)});h.addEventListener("pointerleave",g,i)});return r.forEach(u=>{u.addEventListener("pointerenter",a,i)}),s}const P8=(t,e)=>e?t===e?!0:P8(t,e.parentElement):!1,j2=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Vle=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ble(t){return Vle.has(t.tagName)||t.tabIndex!==-1}const I1=new WeakSet;function A8(t){return e=>{e.key==="Enter"&&t(e)}}function M2(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Wle=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=A8(()=>{if(I1.has(n))return;M2(n,"down");const i=A8(()=>{M2(n,"up")}),s=()=>M2(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function O8(t){return j2(t)&&!T8()}function Ule(t,e,n={}){const[r,i,s]=j8(t,n),a=u=>{const h=u.currentTarget;if(!O8(u)||I1.has(h))return;I1.add(h);const m=e(u),g=(C,E)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",x),!(!O8(C)||!I1.has(h))&&(I1.delete(h),typeof m=="function"&&m(C,{success:E}))},y=C=>{g(C,n.useGlobalTarget||P8(h,C.target))},x=C=>{g(C,!1)};window.addEventListener("pointerup",y,i),window.addEventListener("pointercancel",x,i)};return r.forEach(u=>{!Ble(u)&&u.getAttribute("tabindex")===null&&(u.tabIndex=0),(n.useGlobalTarget?window:u).addEventListener("pointerdown",a,i),u.addEventListener("focus",m=>Wle(m,i),i)}),s}function Yle(t){return t==="x"||t==="y"?Id[t]?null:(Id[t]=!0,()=>{Id[t]=!1}):Id.x||Id.y?null:(Id.x=Id.y=!0,()=>{Id.x=Id.y=!1})}const I8=new Set(["width","height","top","left","right","bottom",...Tx]);let qk;function Gle(){qk=void 0}const Ih={now:()=>(qk===void 0&&Ih.set(Ha.isProcessing||zae.useManualTiming?Ha.timestamp:performance.now()),qk),set:t=>{qk=t,queueMicrotask(Gle)}};function P2(t,e){t.indexOf(e)===-1&&t.push(e)}function A2(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class O2{constructor(){this.subscriptions=[]}add(e){return P2(this.subscriptions,e),()=>A2(this.subscriptions,e)}notify(e,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,r);else for(let s=0;s<i;s++){const a=this.subscriptions[s];a&&a(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function D8(t,e){return e?t*(1e3/e):0}var Kle={};const H8=30,qle=t=>!isNaN(parseFloat(t));class Xle{constructor(e,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=Ih.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Ih.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=qle(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return Kle.NODE_ENV!=="production"&&Fk(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new O2);const r=this.events[e].add(n);return e==="change"?()=>{r(),as.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Ih.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>H8)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,H8);return D8(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function D1(t,e){return new Xle(t,e)}function Qle(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,D1(n))}function Zle(t,e){const n=Gk(t,e);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const a in s){const u=cle(s[a]);Qle(t,a,u)}}function Jle(t){return!!(nl(t)&&t.add)}function I2(t,e){const n=t.getValue("willChange");if(Jle(n))return n.add(e)}function L8(t){return t.props[i8]}const $8=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,ece=1e-7,tce=12;function nce(t,e,n,r,i){let s,a,u=0;do a=e+(n-e)/2,s=$8(a,r,i)-t,s>0?n=a:e=a;while(Math.abs(s)>ece&&++u<tce);return a}function H1(t,e,n,r){if(t===e&&n===r)return yc;const i=s=>nce(s,0,1,t,n);return s=>s===0||s===1?s:$8(i(s),e,r)}const F8=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,z8=t=>e=>1-t(1-e),V8=H1(.33,1.53,.69,.99),D2=z8(V8),B8=F8(D2),W8=t=>(t*=2)<1?.5*D2(t):.5*(2-Math.pow(2,-10*(t-1))),H2=t=>1-Math.sin(Math.acos(t)),U8=z8(H2),Y8=F8(H2),G8=t=>/^0[^.\s]+$/u.test(t);function rce(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||G8(t):!0}const L1=t=>Math.round(t*1e5)/1e5,L2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ice(t){return t==null}const sce=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,$2=(t,e)=>n=>!!(typeof n=="string"&&sce.test(n)&&n.startsWith(t)||e&&!ice(n)&&Object.prototype.hasOwnProperty.call(n,e)),K8=(t,e,n)=>r=>{if(typeof r!="string")return r;const[i,s,a,u]=r.match(L2);return{[t]:parseFloat(i),[e]:parseFloat(s),[n]:parseFloat(a),alpha:u!==void 0?parseFloat(u):1}},oce=t=>cm(0,255,t),F2={...jx,transform:t=>Math.round(oce(t))},v0={test:$2("rgb","red"),parse:K8("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+F2.transform(t)+", "+F2.transform(e)+", "+F2.transform(n)+", "+L1(P1.transform(r))+")"};function ace(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const z2={test:$2("#"),parse:ace,transform:v0.transform},Mx={test:$2("hsl","hue"),parse:K8("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Oh.transform(L1(e))+", "+Oh.transform(L1(n))+", "+L1(P1.transform(r))+")"},rl={test:t=>v0.test(t)||z2.test(t)||Mx.test(t),parse:t=>v0.test(t)?v0.parse(t):Mx.test(t)?Mx.parse(t):z2.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?v0.transform(t):Mx.transform(t)},lce=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function cce(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(L2))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(lce))===null||n===void 0?void 0:n.length)||0)>0}const q8="number",X8="color",uce="var",dce="var(",Q8="${}",hce=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function $1(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const u=e.replace(hce,h=>(rl.test(h)?(r.color.push(s),i.push(X8),n.push(rl.parse(h))):h.startsWith(dce)?(r.var.push(s),i.push(uce),n.push(h)):(r.number.push(s),i.push(q8),n.push(parseFloat(h))),++s,Q8)).split(Q8);return{values:n,split:u,indexes:r,types:i}}function Z8(t){return $1(t).values}function J8(t){const{split:e,types:n}=$1(t),r=e.length;return i=>{let s="";for(let a=0;a<r;a++)if(s+=e[a],i[a]!==void 0){const u=n[a];u===q8?s+=L1(i[a]):u===X8?s+=rl.transform(i[a]):s+=i[a]}return s}}const fce=t=>typeof t=="number"?0:t;function mce(t){const e=Z8(t);return J8(t)(e.map(fce))}const ug={test:cce,parse:Z8,createTransformer:J8,getAnimatableNone:mce},pce=new Set(["brightness","contrast","saturate","opacity"]);function gce(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(L2)||[];if(!r)return t;const i=n.replace(r,"");let s=pce.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+i+")"}const vce=/\b([a-z-]*)\(.*?\)/gu,V2={...ug,getAnimatableNone:t=>{const e=t.match(vce);return e?e.map(gce).join(" "):t}},bce={...y2,color:rl,backgroundColor:rl,outlineColor:rl,fill:rl,stroke:rl,borderColor:rl,borderTopColor:rl,borderRightColor:rl,borderBottomColor:rl,borderLeftColor:rl,filter:V2,WebkitFilter:V2},B2=t=>bce[t];function e9(t,e){let n=B2(t);return n!==V2&&(n=ug),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const yce=new Set(["auto","none","0"]);function xce(t,e,n){let r=0,i;for(;r<t.length&&!i;){const s=t[r];typeof s=="string"&&!yce.has(s)&&$1(s).values.length&&(i=t[r]),r++}if(i&&n)for(const s of e)t[s]=e9(n,i)}const t9=t=>t===jx||t===qn,n9=(t,e)=>parseFloat(t.split(", ")[e]),r9=(t,e)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return n9(i[1],e);{const s=r.match(/^matrix\((.+)\)$/u);return s?n9(s[1],t):0}},wce=new Set(["x","y","z"]),Cce=Tx.filter(t=>!wce.has(t));function Sce(t){const e=[];return Cce.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Px={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:r9(4,13),y:r9(5,14)};Px.translateX=Px.x,Px.translateY=Px.y;const b0=new Set;let W2=!1,U2=!1;function i9(){if(U2){const t=Array.from(b0).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const i=Sce(r);i.length&&(n.set(r,i),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,a])=>{var u;(u=r.getValue(s))===null||u===void 0||u.set(a)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}U2=!1,W2=!1,b0.forEach(t=>t.complete()),b0.clear()}function s9(){b0.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(U2=!0)})}function Rce(){s9(),i9()}class Y2{constructor(e,n,r,i,s,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(b0.add(this),W2||(W2=!0,as.read(s9),as.resolveKeyframes(i9))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:i}=this;for(let s=0;s<e.length;s++)if(e[s]===null)if(s===0){const a=i==null?void 0:i.get(),u=e[e.length-1];if(a!==void 0)e[0]=a;else if(r&&n){const h=r.readValue(n,u);h!=null&&(e[0]=h)}e[0]===void 0&&(e[0]=u),i&&a===void 0&&i.set(e[0])}else e[s]=e[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),b0.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,b0.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const o9=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),_ce=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ece(t){const e=_ce.exec(t);if(!e)return[,];const[,n,r,i]=e;return[`--${n??r}`,i]}const Nce=4;function a9(t,e,n=1){ag(n<=Nce,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[r,i]=Ece(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const a=s.trim();return o9(a)?parseFloat(a):a}return b2(i)?a9(i,e,n+1):i}const l9=t=>e=>e.test(t),c9=[jx,qn,Oh,cg,ple,mle,{test:t=>t==="auto",parse:t=>t}],u9=t=>c9.find(l9(t));class d9 extends Y2{constructor(e,n,r,i,s){super(e,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let m=e[h];if(typeof m=="string"&&(m=m.trim(),b2(m))){const g=a9(m,n.current);g!==void 0&&(e[h]=g),h===e.length-1&&(this.finalKeyframe=m)}}if(this.resolveNoneKeyframes(),!I8.has(r)||e.length!==2)return;const[i,s]=e,a=u9(i),u=u9(s);if(a!==u)if(t9(a)&&t9(u))for(let h=0;h<e.length;h++){const m=e[h];typeof m=="string"&&(e[h]=parseFloat(m))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let i=0;i<e.length;i++)rce(e[i])&&r.push(i);r.length&&xce(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Px[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(r,i).jump(i,!1)}measureEndState(){var e;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const s=n.getValue(r);s&&s.jump(this.measuredOrigin,!1);const a=i.length-1,u=i[a];i[a]=Px[r](n.measureViewportBox(),window.getComputedStyle(n.current)),u!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=u),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([h,m])=>{n.getValue(h).set(m)}),this.resolveNoneKeyframes()}}const h9=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(ug.test(t)||t==="0")&&!t.startsWith("url("));function kce(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Tce(t,e,n,r){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],a=h9(i,e),u=h9(s,e);return _x(a===u,`You are trying to animate ${e} from "${i}" to "${s}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${s} via the \`style\` property.`),!a||!u?!1:kce(t)||(n==="spring"||N2(n))&&r}const jce=t=>t!==null;function Xk(t,{repeat:e,repeatType:n="loop"},r){const i=t.filter(jce),s=e&&n!=="loop"&&e%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const Mce=40;class f9{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",...u}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ih.now(),this.options={autoplay:e,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:a,...u},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Mce?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Rce(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=Ih.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:a,onComplete:u,onUpdate:h,isGenerator:m}=this.options;if(!m&&!Tce(e,r,i,s))if(a)this.options.duration=0;else{h&&h(Xk(e,this.options,n)),u&&u(),this.resolveFinishedPromise();return}const g=this.initPlayback(e,n);g!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...g},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const ks=(t,e,n)=>t+(e-t)*n;function G2(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Pce({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let i=0,s=0,a=0;if(!e)i=s=a=n;else{const u=n<.5?n*(1+e):n+e-n*e,h=2*n-u;i=G2(h,u,t+1/3),s=G2(h,u,t),a=G2(h,u,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:r}}function Qk(t,e){return n=>n>0?e:t}const K2=(t,e,n)=>{const r=t*t,i=n*(e*e-r)+r;return i<0?0:Math.sqrt(i)},Ace=[z2,v0,Mx],Oce=t=>Ace.find(e=>e.test(t));function m9(t){const e=Oce(t);if(_x(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let n=e.parse(t);return e===Mx&&(n=Pce(n)),n}const p9=(t,e)=>{const n=m9(t),r=m9(e);if(!n||!r)return Qk(t,e);const i={...n};return s=>(i.red=K2(n.red,r.red,s),i.green=K2(n.green,r.green,s),i.blue=K2(n.blue,r.blue,s),i.alpha=ks(n.alpha,r.alpha,s),v0.transform(i))},Ice=(t,e)=>n=>e(t(n)),F1=(...t)=>t.reduce(Ice),q2=new Set(["none","hidden"]);function Dce(t,e){return q2.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Hce(t,e){return n=>ks(t,e,n)}function X2(t){return typeof t=="number"?Hce:typeof t=="string"?b2(t)?Qk:rl.test(t)?p9:Fce:Array.isArray(t)?g9:typeof t=="object"?rl.test(t)?p9:Lce:Qk}function g9(t,e){const n=[...t],r=n.length,i=t.map((s,a)=>X2(s)(s,e[a]));return s=>{for(let a=0;a<r;a++)n[a]=i[a](s);return n}}function Lce(t,e){const n={...t,...e},r={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(r[i]=X2(t[i])(t[i],e[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function $ce(t,e){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const a=e.types[s],u=t.indexes[a][i[a]],h=(n=t.values[u])!==null&&n!==void 0?n:0;r[s]=h,i[a]++}return r}const Fce=(t,e)=>{const n=ug.createTransformer(e),r=$1(t),i=$1(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?q2.has(t)&&!i.values.length||q2.has(e)&&!r.values.length?Dce(t,e):F1(g9($ce(r,i),i.values),n):(_x(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Qk(t,e))};function v9(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?ks(t,e,n):X2(t)(t,e)}const zce=5;function b9(t,e,n){const r=Math.max(e-zce,0);return D8(n-t(r),e-r)}const Ts={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Q2=.001;function Vce({duration:t=Ts.duration,bounce:e=Ts.bounce,velocity:n=Ts.velocity,mass:r=Ts.mass}){let i,s;_x(t<=Ah(Ts.maxDuration),"Spring duration must be 10 seconds or less");let a=1-e;a=cm(Ts.minDamping,Ts.maxDamping,a),t=cm(Ts.minDuration,Ts.maxDuration,lm(t)),a<1?(i=m=>{const g=m*a,y=g*t,x=g-n,C=Z2(m,a),E=Math.exp(-y);return Q2-x/C*E},s=m=>{const y=m*a*t,x=y*n+n,C=Math.pow(a,2)*Math.pow(m,2)*t,E=Math.exp(-y),M=Z2(Math.pow(m,2),a);return(-i(m)+Q2>0?-1:1)*((x-C)*E)/M}):(i=m=>{const g=Math.exp(-m*t),y=(m-n)*t+1;return-Q2+g*y},s=m=>{const g=Math.exp(-m*t),y=(n-m)*(t*t);return g*y});const u=5/t,h=Wce(i,s,u);if(t=Ah(t),isNaN(h))return{stiffness:Ts.stiffness,damping:Ts.damping,duration:t};{const m=Math.pow(h,2)*r;return{stiffness:m,damping:a*2*Math.sqrt(r*m),duration:t}}}const Bce=12;function Wce(t,e,n){let r=n;for(let i=1;i<Bce;i++)r=r-t(r)/e(r);return r}function Z2(t,e){return t*Math.sqrt(1-e*e)}const Uce=["duration","bounce"],Yce=["stiffness","damping","mass"];function y9(t,e){return e.some(n=>t[n]!==void 0)}function Gce(t){let e={velocity:Ts.velocity,stiffness:Ts.stiffness,damping:Ts.damping,mass:Ts.mass,isResolvedFromDuration:!1,...t};if(!y9(t,Yce)&&y9(t,Uce))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*cm(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:Ts.mass,stiffness:i,damping:s}}else{const n=Vce(t);e={...e,...n,mass:Ts.mass},e.isResolvedFromDuration=!0}return e}function x9(t=Ts.visualDuration,e=Ts.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],u={done:!1,value:s},{stiffness:h,damping:m,mass:g,duration:y,velocity:x,isResolvedFromDuration:C}=Gce({...n,velocity:-lm(n.velocity||0)}),E=x||0,M=m/(2*Math.sqrt(h*g)),j=a-s,L=lm(Math.sqrt(h/g)),D=Math.abs(j)<5;r||(r=D?Ts.restSpeed.granular:Ts.restSpeed.default),i||(i=D?Ts.restDelta.granular:Ts.restDelta.default);let z;if(M<1){const V=Z2(L,M);z=F=>{const B=Math.exp(-M*L*F);return a-B*((E+M*L*j)/V*Math.sin(V*F)+j*Math.cos(V*F))}}else if(M===1)z=V=>a-Math.exp(-L*V)*(j+(E+L*j)*V);else{const V=L*Math.sqrt(M*M-1);z=F=>{const B=Math.exp(-M*L*F),te=Math.min(V*F,300);return a-B*((E+M*L*j)*Math.sinh(te)+V*j*Math.cosh(te))/V}}const H={calculatedDuration:C&&y||null,next:V=>{const F=z(V);if(C)u.done=V>=y;else{let B=0;M<1&&(B=V===0?Ah(E):b9(z,V,F));const te=Math.abs(B)<=r,ve=Math.abs(a-F)<=i;u.done=te&&ve}return u.value=u.done?a:F,u},toString:()=>{const V=Math.min(R8(H),E2),F=E8(B=>H.next(V*B).value,V,30);return V+"ms "+F}};return H}function w9({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:a,min:u,max:h,restDelta:m=.5,restSpeed:g}){const y=t[0],x={done:!1,value:y},C=te=>u!==void 0&&te<u||h!==void 0&&te>h,E=te=>u===void 0?h:h===void 0||Math.abs(u-te)<Math.abs(h-te)?u:h;let M=n*e;const j=y+M,L=a===void 0?j:a(j);L!==j&&(M=L-y);const D=te=>-M*Math.exp(-te/r),z=te=>L+D(te),H=te=>{const ve=D(te),ce=z(te);x.done=Math.abs(ve)<=m,x.value=x.done?L:ce};let V,F;const B=te=>{C(x.value)&&(V=te,F=x9({keyframes:[x.value,E(x.value)],velocity:b9(z,te,x.value),damping:i,stiffness:s,restDelta:m,restSpeed:g}))};return B(0),{calculatedDuration:null,next:te=>{let ve=!1;return!F&&V===void 0&&(ve=!0,H(te),B(te)),V!==void 0&&te>=V?F.next(te-V):(!ve&&H(te),x)}}}const Kce=H1(.42,0,1,1),qce=H1(0,0,.58,1),C9=H1(.42,0,.58,1),Xce=t=>Array.isArray(t)&&typeof t[0]!="number",S9={linear:yc,easeIn:Kce,easeInOut:C9,easeOut:qce,circIn:H2,circInOut:Y8,circOut:U8,backIn:D2,backInOut:B8,backOut:V8,anticipate:W8},R9=t=>{if(k2(t)){ag(t.length===4,"Cubic bezier arrays must contain four numerical values.");const[e,n,r,i]=t;return H1(e,n,r,i)}else if(typeof t=="string")return ag(S9[t]!==void 0,`Invalid easing type '${t}'`),S9[t];return t};function Qce(t,e,n){const r=[],i=n||v9,s=t.length-1;for(let a=0;a<s;a++){let u=i(t[a],t[a+1]);if(e){const h=Array.isArray(e)?e[a]||yc:e;u=F1(h,u)}r.push(u)}return r}function Zce(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const s=t.length;if(ag(s===e.length,"Both input and output ranges must be the same length"),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const u=Qce(e,r,i),h=u.length,m=g=>{if(a&&g<t[0])return e[0];let y=0;if(h>1)for(;y<t.length-2&&!(g<t[y+1]);y++);const x=Ex(t[y],t[y+1],g);return u[y](x)};return n?g=>m(cm(t[0],t[s-1],g)):m}function Jce(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=Ex(0,e,r);t.push(ks(n,1,i))}}function eue(t){const e=[0];return Jce(e,t.length-1),e}function tue(t,e){return t.map(n=>n*e)}function nue(t,e){return t.map(()=>e||C9).splice(0,t.length-1)}function Zk({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=Xce(r)?r.map(R9):R9(r),s={done:!1,value:e[0]},a=tue(n&&n.length===e.length?n:eue(e),t),u=Zce(a,e,{ease:Array.isArray(i)?i:nue(e,i)});return{calculatedDuration:t,next:h=>(s.value=u(h),s.done=h>=t,s)}}const rue=t=>{const e=({timestamp:n})=>t(n);return{start:()=>as.update(e,!0),stop:()=>lg(e),now:()=>Ha.isProcessing?Ha.timestamp:Ih.now()}};var iue={};const sue={decay:w9,inertia:w9,tween:Zk,keyframes:Zk,spring:x9},oue=t=>t/100;class J2 extends f9{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:h}=this.options;h&&h()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,a=(i==null?void 0:i.KeyframeResolver)||Y2,u=(h,m)=>this.onKeyframesResolved(h,m);this.resolver=new a(s,u,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:a=0}=this.options,u=N2(n)?n:sue[n]||Zk;let h,m;u!==Zk&&typeof e[0]!="number"&&(iue.NODE_ENV!=="production"&&ag(e.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),h=F1(oue,v9(e[0],e[1])),e=[0,100]);const g=u({...this.options,keyframes:e});s==="mirror"&&(m=u({...this.options,keyframes:[...e].reverse(),velocity:-a})),g.calculatedDuration===null&&(g.calculatedDuration=R8(g));const{calculatedDuration:y}=g,x=y+i,C=x*(r+1)-i;return{generator:g,mirroredGenerator:m,mapPercentToKeyframes:h,calculatedDuration:y,resolvedDuration:x,totalDuration:C}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:r}=this;if(!r){const{keyframes:te}=this.options;return{done:!0,value:te[te.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:a,mapPercentToKeyframes:u,keyframes:h,calculatedDuration:m,totalDuration:g,resolvedDuration:y}=r;if(this.startTime===null)return s.next(0);const{delay:x,repeat:C,repeatType:E,repeatDelay:M,onUpdate:j}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-g/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const L=this.currentTime-x*(this.speed>=0?1:-1),D=this.speed>=0?L<0:L>g;this.currentTime=Math.max(L,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=g);let z=this.currentTime,H=s;if(C){const te=Math.min(this.currentTime,g)/y;let ve=Math.floor(te),ce=te%1;!ce&&te>=1&&(ce=1),ce===1&&ve--,ve=Math.min(ve,C+1),!!(ve%2)&&(E==="reverse"?(ce=1-ce,M&&(ce-=M/y)):E==="mirror"&&(H=a)),z=cm(0,1,ce)*y}const V=D?{done:!1,value:h[0]}:H.next(z);u&&(V.value=u(V.value));let{done:F}=V;!D&&m!==null&&(F=this.speed>=0?this.currentTime>=g:this.currentTime<=0);const B=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&F);return B&&i!==void 0&&(V.value=Xk(h,this.options,i)),j&&j(V.value),B&&this.finish(),V}get duration(){const{resolved:e}=this;return e?lm(e.calculatedDuration):0}get time(){return lm(this.currentTime)}set time(e){e=Ah(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=lm(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=rue,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const aue=new Set(["opacity","clipPath","filter","transform"]);function lue(t,e,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:a="loop",ease:u="easeInOut",times:h}={}){const m={[e]:n};h&&(m.offset=h);const g=k8(u,i);return Array.isArray(g)&&(m.easing=g),t.animate(m,{delay:r,duration:i,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"})}const cue=c2(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Jk=10,uue=2e4;function due(t){return N2(t.type)||t.type==="spring"||!N8(t.ease)}function hue(t,e){const n=new J2({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const i=[];let s=0;for(;!r.done&&s<uue;)r=n.sample(s),i.push(r.value),s+=Jk;return{times:void 0,keyframes:i,duration:s-Jk,ease:"linear"}}const _9={anticipate:W8,backInOut:B8,circInOut:Y8};function fue(t){return t in _9}class E9 extends f9{constructor(e){super(e);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new d9(s,(a,u)=>this.onKeyframesResolved(a,u),n,r,i),this.resolver.scheduleResolve()}initPlayback(e,n){let{duration:r=300,times:i,ease:s,type:a,motionValue:u,name:h,startTime:m}=this.options;if(!u.owner||!u.owner.current)return!1;if(typeof s=="string"&&Kk()&&fue(s)&&(s=_9[s]),due(this.options)){const{onComplete:y,onUpdate:x,motionValue:C,element:E,...M}=this.options,j=hue(e,M);e=j.keyframes,e.length===1&&(e[1]=e[0]),r=j.duration,i=j.times,s=j.ease,a="keyframes"}const g=lue(u.owner.current,h,e,{...this.options,duration:r,times:i,ease:s});return g.startTime=m??this.calcStartTime(),this.pendingTimeline?(_8(g,this.pendingTimeline),this.pendingTimeline=void 0):g.onfinish=()=>{const{onComplete:y}=this.options;u.set(Xk(e,this.options,n)),y&&y(),this.cancel(),this.resolveFinishedPromise()},{animation:g,duration:r,times:i,type:a,ease:s,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return lm(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return lm(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Ah(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return yc;const{animation:r}=n;_8(r,e)}return yc}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:r,duration:i,type:s,ease:a,times:u}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:m,onUpdate:g,onComplete:y,element:x,...C}=this.options,E=new J2({...C,keyframes:r,duration:i,type:s,ease:a,times:u,isGenerator:!0}),M=Ah(this.time);m.setWithVelocity(E.sample(M-Jk).value,E.sample(M).value,Jk)}const{onStop:h}=this.options;h&&h(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:a,type:u}=e;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:m}=n.owner.getProps();return cue()&&r&&aue.has(r)&&!h&&!m&&!i&&s!=="mirror"&&a!==0&&u!=="inertia"}}const mue={type:"spring",stiffness:500,damping:25,restSpeed:10},pue=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),gue={type:"keyframes",duration:.8},vue={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bue=(t,{keyframes:e})=>e.length>2?gue:g0.has(t)?t.startsWith("scale")?pue(e[1]):mue:vue;function yue({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:a,repeatDelay:u,from:h,elapsed:m,...g}){return!!Object.keys(g).length}const eH=(t,e,n,r={},i,s)=>a=>{const u=_2(r,t)||{},h=u.delay||r.delay||0;let{elapsed:m=0}=r;m=m-Ah(h);let g={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...u,delay:-m,onUpdate:x=>{e.set(x),u.onUpdate&&u.onUpdate(x)},onComplete:()=>{a(),u.onComplete&&u.onComplete()},name:t,motionValue:e,element:s?void 0:i};yue(u)||(g={...g,...bue(t,g)}),g.duration&&(g.duration=Ah(g.duration)),g.repeatDelay&&(g.repeatDelay=Ah(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let y=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(g.duration=0,g.delay===0&&(y=!0)),y&&!s&&e.get()!==void 0){const x=Xk(g.keyframes,u);if(x!==void 0)return as.update(()=>{g.onUpdate(x),g.onComplete()}),new Hle([])}return!s&&E9.supports(g)?new E9(g):new J2(g)};function xue({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function N9(t,e,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:a=t.getDefaultTransition(),transitionEnd:u,...h}=e;r&&(a=r);const m=[],g=i&&t.animationState&&t.animationState.getState()[i];for(const y in h){const x=t.getValue(y,(s=t.latestValues[y])!==null&&s!==void 0?s:null),C=h[y];if(C===void 0||g&&xue(g,y))continue;const E={delay:n,..._2(a||{},y)};let M=!1;if(window.MotionHandoffAnimation){const L=L8(t);if(L){const D=window.MotionHandoffAnimation(L,y,as);D!==null&&(E.startTime=D,M=!0)}}I2(t,y),x.start(eH(y,x,C,t.shouldReduceMotion&&I8.has(y)?{type:!1}:E,t,M));const j=x.animation;j&&m.push(j)}return u&&Promise.all(m).then(()=>{as.update(()=>{u&&Zle(t,u)})}),m}function tH(t,e,n={}){var r;const i=Gk(t,e,n.type==="exit"?(r=t.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const a=i?()=>Promise.all(N9(t,i,n)):()=>Promise.resolve(),u=t.variantChildren&&t.variantChildren.size?(m=0)=>{const{delayChildren:g=0,staggerChildren:y,staggerDirection:x}=s;return wue(t,e,g+m,y,x,n)}:()=>Promise.resolve(),{when:h}=s;if(h){const[m,g]=h==="beforeChildren"?[a,u]:[u,a];return m().then(()=>g())}else return Promise.all([a(),u(n.delay)])}function wue(t,e,n=0,r=0,i=1,s){const a=[],u=(t.variantChildren.size-1)*r,h=i===1?(m=0)=>m*r:(m=0)=>u-m*r;return Array.from(t.variantChildren).sort(Cue).forEach((m,g)=>{m.notify("AnimationStart",e),a.push(tH(m,e,{...s,delay:n+h(g)}).then(()=>m.notify("AnimationComplete",e)))}),Promise.all(a)}function Cue(t,e){return t.sortNodePosition(e)}function Sue(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const i=e.map(s=>tH(t,s,n));r=Promise.all(i)}else if(typeof e=="string")r=tH(t,e,n);else{const i=typeof e=="function"?Gk(t,e,n.custom):e;r=Promise.all(N9(t,i,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const Rue=h2.length;function k9(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?k9(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Rue;n++){const r=h2[n],i=t.props[r];(M1(i)||i===!1)&&(e[r]=i)}return e}const _ue=[...d2].reverse(),Eue=d2.length;function Nue(t){return e=>Promise.all(e.map(({animation:n,options:r})=>Sue(t,n,r)))}function kue(t){let e=Nue(t),n=T9(),r=!0;const i=h=>(m,g)=>{var y;const x=Gk(t,g,h==="exit"?(y=t.presenceContext)===null||y===void 0?void 0:y.custom:void 0);if(x){const{transition:C,transitionEnd:E,...M}=x;m={...m,...M,...E}}return m};function s(h){e=h(t)}function a(h){const{props:m}=t,g=k9(t.parent)||{},y=[],x=new Set;let C={},E=1/0;for(let j=0;j<Eue;j++){const L=_ue[j],D=n[L],z=m[L]!==void 0?m[L]:g[L],H=M1(z),V=L===h?D.isActive:null;V===!1&&(E=j);let F=z===g[L]&&z!==m[L]&&H;if(F&&r&&t.manuallyAnimateOnMount&&(F=!1),D.protectedKeys={...C},!D.isActive&&V===null||!z&&!D.prevProp||Vk(z)||typeof z=="boolean")continue;const B=Tue(D.prevProp,z);let te=B||L===h&&D.isActive&&!F&&H||j>E&&H,ve=!1;const ce=Array.isArray(z)?z:[z];let _e=ce.reduce(i(L),{});V===!1&&(_e={});const{prevResolvedValues:pe={}}=D,Le={...pe,..._e},Fe=$e=>{te=!0,x.has($e)&&(ve=!0,x.delete($e)),D.needsAnimating[$e]=!0;const Re=t.getValue($e);Re&&(Re.liveStyle=!1)};for(const $e in Le){const Re=_e[$e],Ze=pe[$e];if(C.hasOwnProperty($e))continue;let Ee=!1;v2(Re)&&v2(Ze)?Ee=!S8(Re,Ze):Ee=Re!==Ze,Ee?Re!=null?Fe($e):x.add($e):Re!==void 0&&x.has($e)?Fe($e):D.protectedKeys[$e]=!0}D.prevProp=z,D.prevResolvedValues=_e,D.isActive&&(C={...C,..._e}),r&&t.blockInitialAnimation&&(te=!1),te&&(!(F&&B)||ve)&&y.push(...ce.map($e=>({animation:$e,options:{type:L}})))}if(x.size){const j={};x.forEach(L=>{const D=t.getBaseTarget(L),z=t.getValue(L);z&&(z.liveStyle=!0),j[L]=D??null}),y.push({animation:j})}let M=!!y.length;return r&&(m.initial===!1||m.initial===m.animate)&&!t.manuallyAnimateOnMount&&(M=!1),r=!1,M?e(y):Promise.resolve()}function u(h,m){var g;if(n[h].isActive===m)return Promise.resolve();(g=t.variantChildren)===null||g===void 0||g.forEach(x=>{var C;return(C=x.animationState)===null||C===void 0?void 0:C.setActive(h,m)}),n[h].isActive=m;const y=a(h);for(const x in n)n[x].protectedKeys={};return y}return{animateChanges:a,setActive:u,setAnimateFunction:s,getState:()=>n,reset:()=>{n=T9(),r=!0}}}function Tue(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!S8(e,t):!1}function y0(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function T9(){return{animate:y0(!0),whileInView:y0(),whileHover:y0(),whileTap:y0(),whileDrag:y0(),whileFocus:y0(),exit:y0()}}class dg{constructor(e){this.isMounted=!1,this.node=e}update(){}}class jue extends dg{constructor(e){super(e),e.animationState||(e.animationState=kue(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Vk(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let Mue=0;class Pue extends dg{constructor(){super(...arguments),this.id=Mue++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const Aue={animation:{Feature:jue},exit:{Feature:Pue}};function z1(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function V1(t){return{point:{x:t.pageX,y:t.pageY}}}const Oue=t=>e=>j2(e)&&t(e,V1(e));function B1(t,e,n,r){return z1(t,e,Oue(n),r)}const j9=(t,e)=>Math.abs(t-e);function Iue(t,e){const n=j9(t.x,e.x),r=j9(t.y,e.y);return Math.sqrt(n**2+r**2)}class M9{constructor(e,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=rH(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,C=Iue(y.offset,{x:0,y:0})>=3;if(!x&&!C)return;const{point:E}=y,{timestamp:M}=Ha;this.history.push({...E,timestamp:M});const{onStart:j,onMove:L}=this.handlers;x||(j&&j(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),L&&L(this.lastMoveEvent,y)},this.handlePointerMove=(y,x)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=nH(x,this.transformPagePoint),as.update(this.updatePoint,!0)},this.handlePointerUp=(y,x)=>{this.end();const{onEnd:C,onSessionEnd:E,resumeAnimation:M}=this.handlers;if(this.dragSnapToOrigin&&M&&M(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const j=rH(y.type==="pointercancel"?this.lastMoveEventInfo:nH(x,this.transformPagePoint),this.history);this.startEvent&&C&&C(y,j),E&&E(y,j)},!j2(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const a=V1(e),u=nH(a,this.transformPagePoint),{point:h}=u,{timestamp:m}=Ha;this.history=[{...h,timestamp:m}];const{onSessionStart:g}=n;g&&g(e,rH(u,this.history)),this.removeListeners=F1(B1(this.contextWindow,"pointermove",this.handlePointerMove),B1(this.contextWindow,"pointerup",this.handlePointerUp),B1(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),lg(this.updatePoint)}}function nH(t,e){return e?{point:e(t.point)}:t}function P9(t,e){return{x:t.x-e.x,y:t.y-e.y}}function rH({point:t},e){return{point:t,delta:P9(t,A9(e)),offset:P9(t,Due(e)),velocity:Hue(e,.1)}}function Due(t){return t[0]}function A9(t){return t[t.length-1]}function Hue(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=A9(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>Ah(e)));)n--;if(!r)return{x:0,y:0};const s=lm(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const a={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}const O9=1e-4,Lue=1-O9,$ue=1+O9,I9=.01,Fue=0-I9,zue=0+I9;function tu(t){return t.max-t.min}function Vue(t,e,n){return Math.abs(t-e)<=n}function D9(t,e,n,r=.5){t.origin=r,t.originPoint=ks(e.min,e.max,t.origin),t.scale=tu(n)/tu(e),t.translate=ks(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Lue&&t.scale<=$ue||isNaN(t.scale))&&(t.scale=1),(t.translate>=Fue&&t.translate<=zue||isNaN(t.translate))&&(t.translate=0)}function W1(t,e,n,r){D9(t.x,e.x,n.x,r?r.originX:void 0),D9(t.y,e.y,n.y,r?r.originY:void 0)}function H9(t,e,n){t.min=n.min+e.min,t.max=t.min+tu(e)}function Bue(t,e,n){H9(t.x,e.x,n.x),H9(t.y,e.y,n.y)}function L9(t,e,n){t.min=e.min-n.min,t.max=t.min+tu(e)}function U1(t,e,n){L9(t.x,e.x,n.x),L9(t.y,e.y,n.y)}function Wue(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?ks(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?ks(n,t,r.max):Math.min(t,n)),t}function $9(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Uue(t,{top:e,left:n,bottom:r,right:i}){return{x:$9(t.x,n,i),y:$9(t.y,e,r)}}function F9(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function Yue(t,e){return{x:F9(t.x,e.x),y:F9(t.y,e.y)}}function Gue(t,e){let n=.5;const r=tu(t),i=tu(e);return i>r?n=Ex(e.min,e.max-r,t.min):r>i&&(n=Ex(t.min,t.max-i,e.min)),cm(0,1,n)}function Kue(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const iH=.35;function que(t=iH){return t===!1?t=0:t===!0&&(t=iH),{x:z9(t,"left","right"),y:z9(t,"top","bottom")}}function z9(t,e,n){return{min:V9(t,e),max:V9(t,n)}}function V9(t,e){return typeof t=="number"?t:t[e]||0}const B9=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ax=()=>({x:B9(),y:B9()}),W9=()=>({min:0,max:0}),fo=()=>({x:W9(),y:W9()});function Vu(t){return[t("x"),t("y")]}function U9({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function Xue({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Que(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function sH(t){return t===void 0||t===1}function oH({scale:t,scaleX:e,scaleY:n}){return!sH(t)||!sH(e)||!sH(n)}function x0(t){return oH(t)||Y9(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Y9(t){return G9(t.x)||G9(t.y)}function G9(t){return t&&t!=="0%"}function eT(t,e,n){const r=t-n,i=e*r;return n+i}function K9(t,e,n,r,i){return i!==void 0&&(t=eT(t,i,r)),eT(t,n,r)+e}function aH(t,e=0,n=1,r,i){t.min=K9(t.min,e,n,r,i),t.max=K9(t.max,e,n,r,i)}function q9(t,{x:e,y:n}){aH(t.x,e.translate,e.scale,e.originPoint),aH(t.y,n.translate,n.scale,n.originPoint)}const X9=.999999999999,Q9=1.0000000000001;function Zue(t,e,n,r=!1){const i=n.length;if(!i)return;e.x=e.y=1;let s,a;for(let u=0;u<i;u++){s=n[u],a=s.projectionDelta;const{visualElement:h}=s.options;h&&h.props.style&&h.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Ix(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),a&&(e.x*=a.x.scale,e.y*=a.y.scale,q9(t,a)),r&&x0(s.latestValues)&&Ix(t,s.latestValues))}e.x<Q9&&e.x>X9&&(e.x=1),e.y<Q9&&e.y>X9&&(e.y=1)}function Ox(t,e){t.min=t.min+e,t.max=t.max+e}function Z9(t,e,n,r,i=.5){const s=ks(t.min,t.max,i);aH(t,e,n,s,r)}function Ix(t,e){Z9(t.x,e.x,e.scaleX,e.scale,e.originX),Z9(t.y,e.y,e.scaleY,e.scale,e.originY)}function J9(t,e){return U9(Que(t.getBoundingClientRect(),e))}function Jue(t,e,n){const r=J9(t,n),{scroll:i}=e;return i&&(Ox(r.x,i.offset.x),Ox(r.y,i.offset.y)),r}const e7=({current:t})=>t?t.ownerDocument.defaultView:null,ede=new WeakMap;class tde{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fo(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=g=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(V1(g).point)},s=(g,y)=>{const{drag:x,dragPropagation:C,onDragStart:E}=this.getProps();if(x&&!C&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Yle(x),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Vu(j=>{let L=this.getAxisMotionValue(j).get()||0;if(Oh.test(L)){const{projection:D}=this.visualElement;if(D&&D.layout){const z=D.layout.layoutBox[j];z&&(L=tu(z)*(parseFloat(L)/100))}}this.originPoint[j]=L}),E&&as.postRender(()=>E(g,y)),I2(this.visualElement,"transform");const{animationState:M}=this.visualElement;M&&M.setActive("whileDrag",!0)},a=(g,y)=>{const{dragPropagation:x,dragDirectionLock:C,onDirectionLock:E,onDrag:M}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:j}=y;if(C&&this.currentDirection===null){this.currentDirection=nde(j),this.currentDirection!==null&&E&&E(this.currentDirection);return}this.updateAxis("x",y.point,j),this.updateAxis("y",y.point,j),this.visualElement.render(),M&&M(g,y)},u=(g,y)=>this.stop(g,y),h=()=>Vu(g=>{var y;return this.getAnimationState(g)==="paused"&&((y=this.getAxisMotionValue(g).animation)===null||y===void 0?void 0:y.play())}),{dragSnapToOrigin:m}=this.getProps();this.panSession=new M9(e,{onSessionStart:i,onStart:s,onMove:a,onSessionEnd:u,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:m,contextWindow:e7(this.visualElement)})}stop(e,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&as.postRender(()=>s(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:i}=this.getProps();if(!r||!tT(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=Wue(a,this.constraints[e],this.elastic[e])),s.set(a)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;n&&kx(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=Uue(i.layoutBox,n):this.constraints=!1,this.elastic=que(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Vu(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=Kue(i.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!kx(e))return!1;const r=e.current;ag(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=Jue(r,i.root,this.visualElement.getTransformPagePoint());let a=Yue(i.layout.layoutBox,s);if(n){const u=n(Xue(a));this.hasMutatedConstraints=!!u,u&&(a=U9(u))}return a}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:u}=this.getProps(),h=this.constraints||{},m=Vu(g=>{if(!tT(g,n,this.currentDirection))return;let y=h&&h[g]||{};a&&(y={min:0,max:0});const x=i?200:1e6,C=i?40:1e7,E={type:"inertia",velocity:r?e[g]:0,bounceStiffness:x,bounceDamping:C,timeConstant:750,restDelta:1,restSpeed:10,...s,...y};return this.startAxisValueAnimation(g,E)});return Promise.all(m).then(u)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return I2(this.visualElement,e),r.start(eH(e,r,0,n,this.visualElement,!1))}stopAnimation(){Vu(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Vu(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Vu(n=>{const{drag:r}=this.getProps();if(!tT(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:u}=i.layout.layoutBox[n];s.set(e[n]-ks(a,u,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!kx(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Vu(a=>{const u=this.getAxisMotionValue(a);if(u&&this.constraints!==!1){const h=u.get();i[a]=Gue({min:h,max:h},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Vu(a=>{if(!tT(a,e,null))return;const u=this.getAxisMotionValue(a),{min:h,max:m}=this.constraints[a];u.set(ks(h,m,i[a]))})}addListeners(){if(!this.visualElement.current)return;ede.set(this.visualElement,this);const e=this.visualElement.current,n=B1(e,"pointerdown",h=>{const{drag:m,dragListener:g=!0}=this.getProps();m&&g&&this.start(h)}),r=()=>{const{dragConstraints:h}=this.getProps();kx(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),as.read(r);const a=z1(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(Vu(g=>{const y=this.getAxisMotionValue(g);y&&(this.originPoint[g]+=h[g].translate,y.set(y.get()+h[g].translate))}),this.visualElement.render())});return()=>{a(),n(),s(),u&&u()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:a=iH,dragMomentum:u=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:u}}}function tT(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function nde(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class rde extends dg{constructor(e){super(e),this.removeGroupControls=yc,this.removeListeners=yc,this.controls=new tde(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||yc}unmount(){this.removeGroupControls(),this.removeListeners()}}const t7=t=>(e,n)=>{t&&as.postRender(()=>t(e,n))};class ide extends dg{constructor(){super(...arguments),this.removePointerDownListener=yc}onPointerDown(e){this.session=new M9(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:e7(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:t7(e),onStart:t7(n),onMove:r,onEnd:(s,a)=>{delete this.session,i&&as.postRender(()=>i(s,a))}}}mount(){this.removePointerDownListener=B1(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const nT={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function n7(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Y1={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(qn.test(t))t=parseFloat(t);else return t;const n=n7(t,e.target.x),r=n7(t,e.target.y);return`${n}% ${r}%`}},sde={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=ug.parse(t);if(i.length>5)return r;const s=ug.createTransformer(t),a=typeof i[0]!="number"?1:0,u=n.x.scale*e.x,h=n.y.scale*e.y;i[0+a]/=u,i[1+a]/=h;const m=ks(u,h,.5);return typeof i[2+a]=="number"&&(i[2+a]/=m),typeof i[3+a]=="number"&&(i[3+a]/=m),s(i)}};class ode extends W.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=e;_le(ade),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),nT.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,a=r.projection;return a&&(a.isPresent=s,i||e.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?a.promote():a.relegate()||as.postRender(()=>{const u=a.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),m2.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function r7(t){const[e,n]=KU(),r=W.useContext(s2);return o.jsx(ode,{...t,layoutGroup:r,switchLayoutGroup:W.useContext(s8),isPresent:e,safeToRemove:n})}const ade={borderRadius:{...Y1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Y1,borderTopRightRadius:Y1,borderBottomLeftRadius:Y1,borderBottomRightRadius:Y1,boxShadow:sde};function lde(t,e,n){const r=nl(t)?t:D1(t);return r.start(eH("",r,e,n)),r.animation}function cde(t){return t instanceof SVGElement&&t.tagName!=="svg"}const ude=(t,e)=>t.depth-e.depth;class dde{constructor(){this.children=[],this.isDirty=!1}add(e){P2(this.children,e),this.isDirty=!0}remove(e){A2(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ude),this.isDirty=!1,this.children.forEach(e)}}function hde(t,e){const n=Ih.now(),r=({timestamp:i})=>{const s=i-n;s>=e&&(lg(r),t(s-e))};return as.read(r,!0),()=>lg(r)}const i7=["TopLeft","TopRight","BottomLeft","BottomRight"],fde=i7.length,s7=t=>typeof t=="string"?parseFloat(t):t,o7=t=>typeof t=="number"||qn.test(t);function mde(t,e,n,r,i,s){i?(t.opacity=ks(0,n.opacity!==void 0?n.opacity:1,pde(r)),t.opacityExit=ks(e.opacity!==void 0?e.opacity:1,0,gde(r))):s&&(t.opacity=ks(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;a<fde;a++){const u=`border${i7[a]}Radius`;let h=a7(e,u),m=a7(n,u);if(h===void 0&&m===void 0)continue;h||(h=0),m||(m=0),h===0||m===0||o7(h)===o7(m)?(t[u]=Math.max(ks(s7(h),s7(m),r),0),(Oh.test(m)||Oh.test(h))&&(t[u]+="%")):t[u]=m}(e.rotate||n.rotate)&&(t.rotate=ks(e.rotate||0,n.rotate||0,r))}function a7(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const pde=l7(0,.5,U8),gde=l7(.5,.95,yc);function l7(t,e,n){return r=>r<t?0:r>e?1:n(Ex(t,e,r))}function c7(t,e){t.min=e.min,t.max=e.max}function Bu(t,e){c7(t.x,e.x),c7(t.y,e.y)}function u7(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function d7(t,e,n,r,i){return t-=e,t=eT(t,1/n,r),i!==void 0&&(t=eT(t,1/i,r)),t}function vde(t,e=0,n=1,r=.5,i,s=t,a=t){if(Oh.test(e)&&(e=parseFloat(e),e=ks(a.min,a.max,e/100)-a.min),typeof e!="number")return;let u=ks(s.min,s.max,r);t===s&&(u-=e),t.min=d7(t.min,e,n,u,i),t.max=d7(t.max,e,n,u,i)}function h7(t,e,[n,r,i],s,a){vde(t,e[n],e[r],e[i],e.scale,s,a)}const bde=["x","scaleX","originX"],yde=["y","scaleY","originY"];function f7(t,e,n,r){h7(t.x,e,bde,n?n.x:void 0,r?r.x:void 0),h7(t.y,e,yde,n?n.y:void 0,r?r.y:void 0)}function m7(t){return t.translate===0&&t.scale===1}function p7(t){return m7(t.x)&&m7(t.y)}function g7(t,e){return t.min===e.min&&t.max===e.max}function xde(t,e){return g7(t.x,e.x)&&g7(t.y,e.y)}function v7(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function b7(t,e){return v7(t.x,e.x)&&v7(t.y,e.y)}function y7(t){return tu(t.x)/tu(t.y)}function x7(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class wde{constructor(){this.members=[]}add(e){P2(this.members,e),e.scheduleRender()}remove(e){if(A2(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Cde(t,e,n){let r="";const i=t.x.translate/e.x,s=t.y.translate/e.y,a=(n==null?void 0:n.z)||0;if((i||s||a)&&(r=`translate3d(${i}px, ${s}px, ${a}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:m,rotate:g,rotateX:y,rotateY:x,skewX:C,skewY:E}=n;m&&(r=`perspective(${m}px) ${r}`),g&&(r+=`rotate(${g}deg) `),y&&(r+=`rotateX(${y}deg) `),x&&(r+=`rotateY(${x}deg) `),C&&(r+=`skewX(${C}deg) `),E&&(r+=`skewY(${E}deg) `)}const u=t.x.scale*e.x,h=t.y.scale*e.y;return(u!==1||h!==1)&&(r+=`scale(${u}, ${h})`),r||"none"}const w0={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},G1=typeof window<"u"&&window.MotionDebug!==void 0,lH=["","X","Y","Z"],Sde={visibility:"hidden"},w7=1e3;let Rde=0;function cH(t,e,n,r){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),r&&(r[t]=0))}function C7(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=L8(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",as,!(i||s))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&C7(r)}function S7({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a={},u=e==null?void 0:e()){this.id=Rde++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,G1&&(w0.totalNodes=w0.resolvedTargetDeltas=w0.recalculatedProjection=0),this.nodes.forEach(Nde),this.nodes.forEach(Pde),this.nodes.forEach(Ade),this.nodes.forEach(kde),G1&&window.MotionDebug.record(w0)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new dde)}addEventListener(a,u){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new O2),this.eventHandlers.get(a).add(u)}notifyListeners(a,...u){const h=this.eventHandlers.get(a);h&&h.notify(...u)}hasListeners(a){return this.eventHandlers.has(a)}mount(a,u=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=cde(a),this.instance=a;const{layoutId:h,layout:m,visualElement:g}=this.options;if(g&&!g.current&&g.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),u&&(m||h)&&(this.isLayoutDirty=!0),t){let y;const x=()=>this.root.updateBlockedByResize=!1;t(a,()=>{this.root.updateBlockedByResize=!0,y&&y(),y=hde(x,250),nT.hasAnimatedSinceResize&&(nT.hasAnimatedSinceResize=!1,this.nodes.forEach(_7))})}h&&this.root.registerSharedNode(h,this),this.options.animate!==!1&&g&&(h||m)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:x,hasRelativeTargetChanged:C,layout:E})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const M=this.options.transition||g.getDefaultTransition()||Lde,{onLayoutAnimationStart:j,onLayoutAnimationComplete:L}=g.getProps(),D=!this.targetLayout||!b7(this.targetLayout,E)||C,z=!x&&C;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||z||x&&(D||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(y,z);const H={..._2(M,"layout"),onPlay:j,onComplete:L};(g.shouldReduceMotion||this.options.layoutRoot)&&(H.delay=0,H.type=!1),this.startAnimation(H)}else x||_7(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=E})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,lg(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ode),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&C7(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const y=this.path[g];y.shouldResetTransform=!0,y.updateScroll("snapshot"),y.options.layoutRoot&&y.willUpdate(!1)}const{layoutId:u,layout:h}=this.options;if(u===void 0&&!h)return;const m=this.getTransformTemplate();this.prevTransformTemplateValue=m?m(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(R7);return}this.isUpdating||this.nodes.forEach(jde),this.isUpdating=!1,this.nodes.forEach(Mde),this.nodes.forEach(_de),this.nodes.forEach(Ede),this.clearAllSnapshots();const u=Ih.now();Ha.delta=cm(0,1e3/60,u-Ha.timestamp),Ha.timestamp=u,Ha.isProcessing=!0,u2.update.process(Ha),u2.preRender.process(Ha),u2.render.process(Ha),Ha.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,m2.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Tde),this.sharedNodes.forEach(Ide)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,as.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){as.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutCorrected=fo(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(u=!1),u){const h=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!i)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!p7(this.projectionDelta),h=this.getTransformTemplate(),m=h?h(this.latestValues,""):void 0,g=m!==this.prevTransformTemplateValue;a&&(u||x0(this.latestValues)||g)&&(i(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const u=this.measurePageBox();let h=this.removeElementScroll(u);return a&&(h=this.removeTransform(h)),$de(h),{animationId:this.root.animationId,measuredBox:u,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){var a;const{visualElement:u}=this.options;if(!u)return fo();const h=u.measureViewportBox();if(!(((a=this.scroll)===null||a===void 0?void 0:a.wasRoot)||this.path.some(Fde))){const{scroll:g}=this.root;g&&(Ox(h.x,g.offset.x),Ox(h.y,g.offset.y))}return h}removeElementScroll(a){var u;const h=fo();if(Bu(h,a),!((u=this.scroll)===null||u===void 0)&&u.wasRoot)return h;for(let m=0;m<this.path.length;m++){const g=this.path[m],{scroll:y,options:x}=g;g!==this.root&&y&&x.layoutScroll&&(y.wasRoot&&Bu(h,a),Ox(h.x,y.offset.x),Ox(h.y,y.offset.y))}return h}applyTransform(a,u=!1){const h=fo();Bu(h,a);for(let m=0;m<this.path.length;m++){const g=this.path[m];!u&&g.options.layoutScroll&&g.scroll&&g!==g.root&&Ix(h,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),x0(g.latestValues)&&Ix(h,g.latestValues)}return x0(this.latestValues)&&Ix(h,this.latestValues),h}removeTransform(a){const u=fo();Bu(u,a);for(let h=0;h<this.path.length;h++){const m=this.path[h];if(!m.instance||!x0(m.latestValues))continue;oH(m.latestValues)&&m.updateSnapshot();const g=fo(),y=m.measurePageBox();Bu(g,y),f7(u,m.latestValues,m.snapshot?m.snapshot.layoutBox:void 0,g)}return x0(this.latestValues)&&f7(u,this.latestValues),u}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ha.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var u;const h=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=h.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=h.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=h.isSharedProjectionDirty);const m=!!this.resumingFrom||this!==h;if(!(a||m&&this.isSharedProjectionDirty||this.isProjectionDirty||!((u=this.parent)===null||u===void 0)&&u.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:x}=this.options;if(!(!this.layout||!(y||x))){if(this.resolvedRelativeTargetAt=Ha.timestamp,!this.targetDelta&&!this.relativeTarget){const C=this.getClosestProjectingParent();C&&C.layout&&this.animationProgress!==1?(this.relativeParent=C,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fo(),this.relativeTargetOrigin=fo(),U1(this.relativeTargetOrigin,this.layout.layoutBox,C.layout.layoutBox),Bu(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=fo(),this.targetWithTransforms=fo()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Bue(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Bu(this.target,this.layout.layoutBox),q9(this.target,this.targetDelta)):Bu(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const C=this.getClosestProjectingParent();C&&!!C.resumingFrom==!!this.resumingFrom&&!C.options.layoutScroll&&C.target&&this.animationProgress!==1?(this.relativeParent=C,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fo(),this.relativeTargetOrigin=fo(),U1(this.relativeTargetOrigin,this.target,C.target),Bu(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}G1&&w0.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||oH(this.parent.latestValues)||Y9(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var a;const u=this.getLead(),h=!!this.resumingFrom||this!==u;let m=!0;if((this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty)&&(m=!1),h&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(m=!1),this.resolvedRelativeTargetAt===Ha.timestamp&&(m=!1),m)return;const{layout:g,layoutId:y}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(g||y))return;Bu(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,C=this.treeScale.y;Zue(this.layoutCorrected,this.treeScale,this.path,h),u.layout&&!u.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(u.target=u.layout.layoutBox,u.targetWithTransforms=fo());const{target:E}=u;if(!E){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(u7(this.prevProjectionDelta.x,this.projectionDelta.x),u7(this.prevProjectionDelta.y,this.projectionDelta.y)),W1(this.projectionDelta,this.layoutCorrected,E,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==C||!x7(this.projectionDelta.x,this.prevProjectionDelta.x)||!x7(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",E)),G1&&w0.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var u;if((u=this.options.visualElement)===null||u===void 0||u.scheduleRender(),a){const h=this.getStack();h&&h.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ax(),this.projectionDelta=Ax(),this.projectionDeltaWithTransform=Ax()}setAnimationOrigin(a,u=!1){const h=this.snapshot,m=h?h.latestValues:{},g={...this.latestValues},y=Ax();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const x=fo(),C=h?h.source:void 0,E=this.layout?this.layout.source:void 0,M=C!==E,j=this.getStack(),L=!j||j.members.length<=1,D=!!(M&&!L&&this.options.crossfade===!0&&!this.path.some(Hde));this.animationProgress=0;let z;this.mixTargetDelta=H=>{const V=H/1e3;E7(y.x,a.x,V),E7(y.y,a.y,V),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(U1(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Dde(this.relativeTarget,this.relativeTargetOrigin,x,V),z&&xde(this.relativeTarget,z)&&(this.isProjectionDirty=!1),z||(z=fo()),Bu(z,this.relativeTarget)),M&&(this.animationValues=g,mde(g,m,this.latestValues,V,D,L)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=V},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(lg(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=as.update(()=>{nT.hasAnimatedSinceResize=!0,this.currentAnimation=lde(0,w7,{...a,onUpdate:u=>{this.mixTargetDelta(u),a.onUpdate&&a.onUpdate(u)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(w7),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:u,target:h,layout:m,latestValues:g}=a;if(!(!u||!h||!m)){if(this!==a&&this.layout&&m&&M7(this.options.animationType,this.layout.layoutBox,m.layoutBox)){h=this.target||fo();const y=tu(this.layout.layoutBox.x);h.x.min=a.target.x.min,h.x.max=h.x.min+y;const x=tu(this.layout.layoutBox.y);h.y.min=a.target.y.min,h.y.max=h.y.min+x}Bu(u,h),Ix(u,g),W1(this.projectionDeltaWithTransform,this.layoutCorrected,u,g)}}registerSharedNode(a,u){this.sharedNodes.has(a)||this.sharedNodes.set(a,new wde),this.sharedNodes.get(a).add(u);const m=u.options.initialPromotionConfig;u.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(u):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:u}=this.options;return u?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:u}=this.options;return u?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:u,preserveFollowOpacity:h}={}){const m=this.getStack();m&&m.promote(this,h),a&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let u=!1;const{latestValues:h}=a;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(u=!0),!u)return;const m={};h.z&&cH("z",a,m,this.animationValues);for(let g=0;g<lH.length;g++)cH(`rotate${lH[g]}`,a,m,this.animationValues),cH(`skew${lH[g]}`,a,m,this.animationValues);a.render();for(const g in m)a.setStaticValue(g,m[g]),this.animationValues&&(this.animationValues[g]=m[g]);a.scheduleRender()}getProjectionStyles(a){var u,h;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Sde;const m={visibility:""},g=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,m.opacity="",m.pointerEvents=Wk(a==null?void 0:a.pointerEvents)||"",m.transform=g?g(this.latestValues,""):"none",m;const y=this.getLead();if(!this.projectionDelta||!this.layout||!y.target){const M={};return this.options.layoutId&&(M.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,M.pointerEvents=Wk(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!x0(this.latestValues)&&(M.transform=g?g({},""):"none",this.hasProjected=!1),M}const x=y.animationValues||y.latestValues;this.applyTransformsToTarget(),m.transform=Cde(this.projectionDeltaWithTransform,this.treeScale,x),g&&(m.transform=g(x,m.transform));const{x:C,y:E}=this.projectionDelta;m.transformOrigin=`${C.origin*100}% ${E.origin*100}% 0`,y.animationValues?m.opacity=y===this?(h=(u=x.opacity)!==null&&u!==void 0?u:this.latestValues.opacity)!==null&&h!==void 0?h:1:this.preserveOpacity?this.latestValues.opacity:x.opacityExit:m.opacity=y===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const M in Yk){if(x[M]===void 0)continue;const{correct:j,applyTo:L}=Yk[M],D=m.transform==="none"?x[M]:j(x[M],y);if(L){const z=L.length;for(let H=0;H<z;H++)m[L[H]]=D}else m[M]=D}return this.options.layoutId&&(m.pointerEvents=y===this?Wk(a==null?void 0:a.pointerEvents)||"":"none"),m}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var u;return(u=a.currentAnimation)===null||u===void 0?void 0:u.stop()}),this.root.nodes.forEach(R7),this.root.sharedNodes.clear()}}}function _de(t){t.updateLayout()}function Ede(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=t.layout,{animationType:s}=t.options,a=n.source!==t.layout.source;s==="size"?Vu(y=>{const x=a?n.measuredBox[y]:n.layoutBox[y],C=tu(x);x.min=r[y].min,x.max=x.min+C}):M7(s,n.layoutBox,r)&&Vu(y=>{const x=a?n.measuredBox[y]:n.layoutBox[y],C=tu(r[y]);x.max=x.min+C,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[y].max=t.relativeTarget[y].min+C)});const u=Ax();W1(u,r,n.layoutBox);const h=Ax();a?W1(h,t.applyTransform(i,!0),n.measuredBox):W1(h,r,n.layoutBox);const m=!p7(u);let g=!1;if(!t.resumeFrom){const y=t.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:x,layout:C}=y;if(x&&C){const E=fo();U1(E,n.layoutBox,x.layoutBox);const M=fo();U1(M,r,C.layoutBox),b7(E,M)||(g=!0),y.options.layoutRoot&&(t.relativeTarget=M,t.relativeTargetOrigin=E,t.relativeParent=y)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:h,layoutDelta:u,hasLayoutChanged:m,hasRelativeTargetChanged:g})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function Nde(t){G1&&w0.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function kde(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Tde(t){t.clearSnapshot()}function R7(t){t.clearMeasurements()}function jde(t){t.isLayoutDirty=!1}function Mde(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function _7(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Pde(t){t.resolveTargetDelta()}function Ade(t){t.calcProjection()}function Ode(t){t.resetSkewAndRotation()}function Ide(t){t.removeLeadSnapshot()}function E7(t,e,n){t.translate=ks(e.translate,0,n),t.scale=ks(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function N7(t,e,n,r){t.min=ks(e.min,n.min,r),t.max=ks(e.max,n.max,r)}function Dde(t,e,n,r){N7(t.x,e.x,n.x,r),N7(t.y,e.y,n.y,r)}function Hde(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Lde={duration:.45,ease:[.4,0,.1,1]},k7=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),T7=k7("applewebkit/")&&!k7("chrome/")?Math.round:yc;function j7(t){t.min=T7(t.min),t.max=T7(t.max)}function $de(t){j7(t.x),j7(t.y)}function M7(t,e,n){return t==="position"||t==="preserve-aspect"&&!Vue(y7(e),y7(n),.2)}function Fde(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const zde=S7({attachResizeListener:(t,e)=>z1(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),uH={current:void 0},P7=S7({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!uH.current){const t=new zde({});t.mount(window),t.setOptions({layoutScroll:!0}),uH.current=t}return uH.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Vde={pan:{Feature:ide},drag:{Feature:rde,ProjectionNode:P7,MeasureLayout:r7}};function A7(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&as.postRender(()=>s(e,V1(e)))}class Bde extends dg{mount(){const{current:e}=this.node;e&&(this.unmount=zle(e,n=>(A7(this.node,n,"Start"),r=>A7(this.node,r,"End"))))}unmount(){}}class Wde extends dg{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=F1(z1(this.node.current,"focus",()=>this.onFocus()),z1(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function O7(t,e,n){const{props:r}=t;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&as.postRender(()=>s(e,V1(e)))}class Ude extends dg{mount(){const{current:e}=this.node;e&&(this.unmount=Ule(e,n=>(O7(this.node,n,"Start"),(r,{success:i})=>O7(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const dH=new WeakMap,hH=new WeakMap,Yde=t=>{const e=dH.get(t.target);e&&e(t)},Gde=t=>{t.forEach(Yde)};function Kde({root:t,...e}){const n=t||document;hH.has(n)||hH.set(n,{});const r=hH.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(Gde,{root:t,...e})),r[i]}function qde(t,e,n){const r=Kde(e);return dH.set(t,n),r.observe(t),()=>{dH.delete(t),r.unobserve(t)}}const Xde={some:0,all:1};class Qde extends dg{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=e,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Xde[i]},u=h=>{const{isIntersecting:m}=h;if(this.isInView===m||(this.isInView=m,s&&!m&&this.hasEnteredView))return;m&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",m);const{onViewportEnter:g,onViewportLeave:y}=this.node.getProps(),x=m?g:y;x&&x(h)};return qde(this.node.current,a,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Zde(e,n))&&this.startObserver()}unmount(){}}function Zde({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Jde={inView:{Feature:Qde},tap:{Feature:Ude},focus:{Feature:Wde},hover:{Feature:Bde}},ehe={layout:{ProjectionNode:P7,MeasureLayout:r7}},fH={current:null},I7={current:!1};function the(){if(I7.current=!0,!!l2)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>fH.current=t.matches;t.addListener(e),e()}else fH.current=!1}const nhe=[...c9,rl,ug],rhe=t=>nhe.find(l9(t)),D7=new WeakMap;var ihe={};function she(t,e,n){for(const r in e){const i=e[r],s=n[r];if(nl(i))t.addValue(r,i),ihe.NODE_ENV==="development"&&Fk(i.version==="11.18.2",`Attempting to mix Motion versions ${i.version} with 11.18.2 may not work as expected.`);else if(nl(s))t.addValue(r,D1(i,{owner:t}));else if(s!==i)if(t.hasValue(r)){const a=t.getValue(r);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=t.getStaticValue(r);t.addValue(r,D1(a!==void 0?a:i,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}var ohe={};const H7=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ahe{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:a},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Y2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const C=Ih.now();this.renderScheduledAt<C&&(this.renderScheduledAt=C,as.render(this.render,!1,!0))};const{latestValues:h,renderState:m,onUpdate:g}=a;this.onUpdate=g,this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=m,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=u,this.blockInitialAnimation=!!s,this.isControllingVariants=Bk(n),this.isVariantNode=n8(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:y,...x}=this.scrapeMotionValuesFromProps(n,{},this);for(const C in x){const E=x[C];h[C]!==void 0&&nl(E)&&E.set(h[C],!1)}}mount(e){this.current=e,D7.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),I7.current||the(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:fH.current,ohe.NODE_ENV!=="production"&&Fk(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){D7.delete(this.current),this.projection&&this.projection.unmount(),lg(this.notifyUpdate),lg(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=g0.has(e),i=n.on("change",u=>{this.latestValues[e]=u,this.props.onUpdate&&as.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),s(),a&&a(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Nx){const n=Nx[e];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fo()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<H7.length;r++){const i=H7[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,a=e[s];a&&(this.propEventSubscriptions[i]=this.on(i,a))}this.prevMotionValues=she(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=D1(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){var r;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(r=this.getBaseTargetFromProps(this.props,e))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(o9(i)||G8(i))?i=parseFloat(i):!rhe(i)&&ug.test(n)&&(i=e9(e,n)),this.setBaseTarget(e,nl(i)?i.get():i)),nl(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const a=g2(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);a&&(i=a[e])}if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!nl(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new O2),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class L7 extends ahe{constructor(){super(...arguments),this.KeyframeResolver=d9}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;nl(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function lhe(t){return window.getComputedStyle(t)}class che extends L7{constructor(){super(...arguments),this.type="html",this.renderInstance=g8}readValueFromInstance(e,n){if(g0.has(n)){const r=B2(n);return r&&r.default||0}else{const r=lhe(e),i=(u8(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return J9(e,n)}build(e,n,r){x2(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return R2(e,n,r)}}class uhe extends L7{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=fo}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(g0.has(n)){const r=B2(n);return r&&r.default||0}return n=v8.has(n)?n:f2(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return x8(e,n,r)}build(e,n,r){w2(e,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,n,r,i){b8(e,n,r,i)}mount(e){this.isSVGTag=S2(e.tagName),super.mount(e)}}const dhe=(t,e)=>p2(t)?new uhe(e):new che(e,{allowProjection:t!==W.Fragment}),hhe=Ole({...Aue,...Jde,...Vde,...ehe},dhe),ht=qae(hhe);var Dx={};/** * table-core * * Copyright (c) TanStack * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function rT(){return{accessor:(t,e)=>typeof t=="function"?{...e,accessorFn:t}:{...e,accessorKey:t},display:t=>t,group:t=>t}}function hg(t,e){return typeof t=="function"?t(e):t}function nu(t,e){return n=>{e.setState(r=>({...r,[t]:hg(n,r[t])}))}}function iT(t){return t instanceof Function}function fhe(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function mhe(t,e){const n=[],r=i=>{i.forEach(s=>{n.push(s);const a=e(s);a!=null&&a.length&&r(a)})};return r(t),n}function nr(t,e,n){let r=[],i;return s=>{let a;n.key&&n.debug&&(a=Date.now());const u=t(s);if(!(u.length!==r.length||u.some((g,y)=>r[y]!==g)))return i;r=u;let m;if(n.key&&n.debug&&(m=Date.now()),i=e(...u),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const g=Math.round((Date.now()-a)*100)/100,y=Math.round((Date.now()-m)*100)/100,x=y/16,C=(E,M)=>{for(E=String(E);E.length<M;)E=" "+E;return E};console.info(`%c⏱ ${C(y,5)} /${C(g,5)} ms`,` font-size: .6rem; font-weight: bold; color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,n==null?void 0:n.key)}return i}}function rr(t,e,n,r){return{debug:()=>{var i;return(i=t==null?void 0:t.debugAll)!=null?i:t[e]},key:Dx.NODE_ENV==="development"&&n,onChange:r}}function phe(t,e,n,r){const i=()=>{var a;return(a=s.getValue())!=null?a:t.options.renderFallbackValue},s={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(r),renderValue:i,getContext:nr(()=>[t,n,e,s],(a,u,h,m)=>({table:a,column:u,row:h,cell:m,getValue:m.getValue,renderValue:m.renderValue}),rr(t.options,"debugCells","cell.getContext"))};return t._features.forEach(a=>{a.createCell==null||a.createCell(s,n,e,t)},{}),s}function ghe(t,e,n,r){var i,s;const u={...t._getDefaultColumnDef(),...e},h=u.accessorKey;let m=(i=(s=u.id)!=null?s:h?typeof String.prototype.replaceAll=="function"?h.replaceAll(".","_"):h.replace(/\./g,"_"):void 0)!=null?i:typeof u.header=="string"?u.header:void 0,g;if(u.accessorFn?g=u.accessorFn:h&&(h.includes(".")?g=x=>{let C=x;for(const M of h.split(".")){var E;C=(E=C)==null?void 0:E[M],Dx.NODE_ENV!=="production"&&C===void 0&&console.warn(`"${M}" in deeply nested key "${h}" returned undefined.`)}return C}:g=x=>x[u.accessorKey]),!m)throw Dx.NODE_ENV!=="production"?new Error(u.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let y={id:`${String(m)}`,accessorFn:g,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:nr(()=>[!0],()=>{var x;return[y,...(x=y.columns)==null?void 0:x.flatMap(C=>C.getFlatColumns())]},rr(t.options,"debugColumns","column.getFlatColumns")),getLeafColumns:nr(()=>[t._getOrderColumnsFn()],x=>{var C;if((C=y.columns)!=null&&C.length){let E=y.columns.flatMap(M=>M.getLeafColumns());return x(E)}return[y]},rr(t.options,"debugColumns","column.getLeafColumns"))};for(const x of t._features)x.createColumn==null||x.createColumn(y,t);return y}const il="debugHeaders";function $7(t,e,n){var r;let s={id:(r=n.id)!=null?r:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],u=h=>{h.subHeaders&&h.subHeaders.length&&h.subHeaders.map(u),a.push(h)};return u(s),a},getContext:()=>({table:t,header:s,column:e})};return t._features.forEach(a=>{a.createHeader==null||a.createHeader(s,t)}),s}const vhe={createTable:t=>{t.getHeaderGroups=nr(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,i)=>{var s,a;const u=(s=r==null?void 0:r.map(y=>n.find(x=>x.id===y)).filter(Boolean))!=null?s:[],h=(a=i==null?void 0:i.map(y=>n.find(x=>x.id===y)).filter(Boolean))!=null?a:[],m=n.filter(y=>!(r!=null&&r.includes(y.id))&&!(i!=null&&i.includes(y.id)));return sT(e,[...u,...m,...h],t)},rr(t.options,il,"getHeaderGroups")),t.getCenterHeaderGroups=nr(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,i)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(i!=null&&i.includes(s.id))),sT(e,n,t,"center")),rr(t.options,il,"getCenterHeaderGroups")),t.getLeftHeaderGroups=nr(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,r)=>{var i;const s=(i=r==null?void 0:r.map(a=>n.find(u=>u.id===a)).filter(Boolean))!=null?i:[];return sT(e,s,t,"left")},rr(t.options,il,"getLeftHeaderGroups")),t.getRightHeaderGroups=nr(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,r)=>{var i;const s=(i=r==null?void 0:r.map(a=>n.find(u=>u.id===a)).filter(Boolean))!=null?i:[];return sT(e,s,t,"right")},rr(t.options,il,"getRightHeaderGroups")),t.getFooterGroups=nr(()=>[t.getHeaderGroups()],e=>[...e].reverse(),rr(t.options,il,"getFooterGroups")),t.getLeftFooterGroups=nr(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),rr(t.options,il,"getLeftFooterGroups")),t.getCenterFooterGroups=nr(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),rr(t.options,il,"getCenterFooterGroups")),t.getRightFooterGroups=nr(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),rr(t.options,il,"getRightFooterGroups")),t.getFlatHeaders=nr(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),rr(t.options,il,"getFlatHeaders")),t.getLeftFlatHeaders=nr(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),rr(t.options,il,"getLeftFlatHeaders")),t.getCenterFlatHeaders=nr(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),rr(t.options,il,"getCenterFlatHeaders")),t.getRightFlatHeaders=nr(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),rr(t.options,il,"getRightFlatHeaders")),t.getCenterLeafHeaders=nr(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),rr(t.options,il,"getCenterLeafHeaders")),t.getLeftLeafHeaders=nr(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),rr(t.options,il,"getLeftLeafHeaders")),t.getRightLeafHeaders=nr(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),rr(t.options,il,"getRightLeafHeaders")),t.getLeafHeaders=nr(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,r)=>{var i,s,a,u,h,m;return[...(i=(s=e[0])==null?void 0:s.headers)!=null?i:[],...(a=(u=n[0])==null?void 0:u.headers)!=null?a:[],...(h=(m=r[0])==null?void 0:m.headers)!=null?h:[]].map(g=>g.getLeafHeaders()).flat()},rr(t.options,il,"getLeafHeaders"))}};function sT(t,e,n,r){var i,s;let a=0;const u=function(x,C){C===void 0&&(C=1),a=Math.max(a,C),x.filter(E=>E.getIsVisible()).forEach(E=>{var M;(M=E.columns)!=null&&M.length&&u(E.columns,C+1)},0)};u(t);let h=[];const m=(x,C)=>{const E={depth:C,id:[r,`${C}`].filter(Boolean).join("_"),headers:[]},M=[];x.forEach(j=>{const L=[...M].reverse()[0],D=j.column.depth===E.depth;let z,H=!1;if(D&&j.column.parent?z=j.column.parent:(z=j.column,H=!0),L&&(L==null?void 0:L.column)===z)L.subHeaders.push(j);else{const V=$7(n,z,{id:[r,C,z.id,j==null?void 0:j.id].filter(Boolean).join("_"),isPlaceholder:H,placeholderId:H?`${M.filter(F=>F.column===z).length}`:void 0,depth:C,index:M.length});V.subHeaders.push(j),M.push(V)}E.headers.push(j),j.headerGroup=E}),h.push(E),C>0&&m(M,C-1)},g=e.map((x,C)=>$7(n,x,{depth:a,index:C}));m(g,a-1),h.reverse();const y=x=>x.filter(E=>E.column.getIsVisible()).map(E=>{let M=0,j=0,L=[0];E.subHeaders&&E.subHeaders.length?(L=[],y(E.subHeaders).forEach(z=>{let{colSpan:H,rowSpan:V}=z;M+=H,L.push(V)})):M=1;const D=Math.min(...L);return j=j+D,E.colSpan=M,E.rowSpan=j,{colSpan:M,rowSpan:j}});return y((i=(s=h[0])==null?void 0:s.headers)!=null?i:[]),h}const bhe=(t,e,n,r,i,s,a)=>{let u={id:e,index:r,original:n,depth:i,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:h=>{if(u._valuesCache.hasOwnProperty(h))return u._valuesCache[h];const m=t.getColumn(h);if(m!=null&&m.accessorFn)return u._valuesCache[h]=m.accessorFn(u.original,r),u._valuesCache[h]},getUniqueValues:h=>{if(u._uniqueValuesCache.hasOwnProperty(h))return u._uniqueValuesCache[h];const m=t.getColumn(h);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(u._uniqueValuesCache[h]=m.columnDef.getUniqueValues(u.original,r),u._uniqueValuesCache[h]):(u._uniqueValuesCache[h]=[u.getValue(h)],u._uniqueValuesCache[h])},renderValue:h=>{var m;return(m=u.getValue(h))!=null?m:t.options.renderFallbackValue},subRows:[],getLeafRows:()=>mhe(u.subRows,h=>h.subRows),getParentRow:()=>u.parentId?t.getRow(u.parentId,!0):void 0,getParentRows:()=>{let h=[],m=u;for(;;){const g=m.getParentRow();if(!g)break;h.push(g),m=g}return h.reverse()},getAllCells:nr(()=>[t.getAllLeafColumns()],h=>h.map(m=>phe(t,u,m,m.id)),rr(t.options,"debugRows","getAllCells")),_getAllCellsByColumnId:nr(()=>[u.getAllCells()],h=>h.reduce((m,g)=>(m[g.column.id]=g,m),{}),rr(t.options,"debugRows","getAllCellsByColumnId"))};for(let h=0;h<t._features.length;h++){const m=t._features[h];m==null||m.createRow==null||m.createRow(u,t)}return u},yhe={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},F7=(t,e,n)=>{var r,i;const s=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=t.getValue(e))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(s))};F7.autoRemove=t=>Dd(t);const z7=(t,e,n)=>{var r;return!!(!((r=t.getValue(e))==null||(r=r.toString())==null)&&r.includes(n))};z7.autoRemove=t=>Dd(t);const V7=(t,e,n)=>{var r;return((r=t.getValue(e))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};V7.autoRemove=t=>Dd(t);const B7=(t,e,n)=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(n)};B7.autoRemove=t=>Dd(t);const W7=(t,e,n)=>!n.some(r=>{var i;return!((i=t.getValue(e))!=null&&i.includes(r))});W7.autoRemove=t=>Dd(t)||!(t!=null&&t.length);const U7=(t,e,n)=>n.some(r=>{var i;return(i=t.getValue(e))==null?void 0:i.includes(r)});U7.autoRemove=t=>Dd(t)||!(t!=null&&t.length);const Y7=(t,e,n)=>t.getValue(e)===n;Y7.autoRemove=t=>Dd(t);const G7=(t,e,n)=>t.getValue(e)==n;G7.autoRemove=t=>Dd(t);const mH=(t,e,n)=>{let[r,i]=n;const s=t.getValue(e);return s>=r&&s<=i};mH.resolveFilterValue=t=>{let[e,n]=t,r=typeof e!="number"?parseFloat(e):e,i=typeof n!="number"?parseFloat(n):n,s=e===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(i)?1/0:i;if(s>a){const u=s;s=a,a=u}return[s,a]},mH.autoRemove=t=>Dd(t)||Dd(t[0])&&Dd(t[1]);const um={includesString:F7,includesStringSensitive:z7,equalsString:V7,arrIncludes:B7,arrIncludesAll:W7,arrIncludesSome:U7,equals:Y7,weakEquals:G7,inNumberRange:mH};function Dd(t){return t==null||t===""}const xhe={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:nu("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(t.id);return typeof r=="string"?um.includesString:typeof r=="number"?um.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?um.equals:Array.isArray(r)?um.arrIncludes:um.weakEquals},t.getFilterFn=()=>{var n,r;return iT(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[t.columnDef.filterFn])!=null?n:um[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,r,i;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((r=e.options.enableColumnFilters)!=null?r:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(r=>r.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,r;return(n=(r=e.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(r=>{const i=t.getFilterFn(),s=r==null?void 0:r.find(g=>g.id===t.id),a=hg(n,s?s.value:void 0);if(K7(i,a,t)){var u;return(u=r==null?void 0:r.filter(g=>g.id!==t.id))!=null?u:[]}const h={id:t.id,value:a};if(s){var m;return(m=r==null?void 0:r.map(g=>g.id===t.id?h:g))!=null?m:[]}return r!=null&&r.length?[...r,h]:[h]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),r=i=>{var s;return(s=hg(e,i))==null?void 0:s.filter(a=>{const u=n.find(h=>h.id===a.id);if(u){const h=u.getFilterFn();if(K7(h,a.value,u))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(r)},t.resetColumnFilters=e=>{var n,r;t.setColumnFilters(e?[]:(n=(r=t.initialState)==null?void 0:r.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function K7(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const pH={sum:(t,e,n)=>n.reduce((r,i)=>{const s=i.getValue(t);return r+(typeof s=="number"?s:0)},0),min:(t,e,n)=>{let r;return n.forEach(i=>{const s=i.getValue(t);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},max:(t,e,n)=>{let r;return n.forEach(i=>{const s=i.getValue(t);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},extent:(t,e,n)=>{let r,i;return n.forEach(s=>{const a=s.getValue(t);a!=null&&(r===void 0?a>=a&&(r=i=a):(r>a&&(r=a),i<a&&(i=a)))}),[r,i]},mean:(t,e)=>{let n=0,r=0;if(e.forEach(i=>{let s=i.getValue(t);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},median:(t,e)=>{if(!e.length)return;const n=e.map(s=>s.getValue(t));if(!fhe(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((s,a)=>s-a);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},unique:(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),uniqueCount:(t,e)=>new Set(e.map(n=>n.getValue(t))).size,count:(t,e)=>e.length},whe={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:nu("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(r=>r!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,r;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((r=e.options.enableGrouping)!=null?r:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(t.id);if(typeof r=="number")return pH.sum;if(Object.prototype.toString.call(r)==="[object Date]")return pH.extent},t.getAggregationFn=()=>{var n,r;if(!t)throw new Error;return iT(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(r=e.options.aggregationFns)==null?void 0:r[t.columnDef.aggregationFn])!=null?n:pH[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,r;t.setGrouping(e?[]:(n=(r=t.initialState)==null?void 0:r.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const r=e.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(t._groupingValuesCache[n]=r.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,r)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var i;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function Che(t,e,n){if(!(e!=null&&e.length)||!n)return t;const r=t.filter(s=>!e.includes(s.id));return n==="remove"?r:[...e.map(s=>t.find(a=>a.id===s)).filter(Boolean),...r]}const She={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:nu("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=nr(n=>[K1(e,n)],n=>n.findIndex(r=>r.id===t.id),rr(e.options,"debugColumns","getIndex")),t.getIsFirstColumn=n=>{var r;return((r=K1(e,n)[0])==null?void 0:r.id)===t.id},t.getIsLastColumn=n=>{var r;const i=K1(e,n);return((r=i[i.length-1])==null?void 0:r.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=nr(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,r)=>i=>{let s=[];if(!(e!=null&&e.length))s=i;else{const a=[...e],u=[...i];for(;u.length&&a.length;){const h=a.shift(),m=u.findIndex(g=>g.id===h);m>-1&&s.push(u.splice(m,1)[0])}s=[...s,...u]}return Che(s,n,r)},rr(t.options,"debugTable","_getOrderColumnsFn"))}},gH=()=>({left:[],right:[]}),Rhe={getInitialState:t=>({columnPinning:gH(),...t}),getDefaultOptions:t=>({onColumnPinningChange:nu("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const r=t.getLeafColumns().map(i=>i.id).filter(Boolean);e.setColumnPinning(i=>{var s,a;if(n==="right"){var u,h;return{left:((u=i==null?void 0:i.left)!=null?u:[]).filter(y=>!(r!=null&&r.includes(y))),right:[...((h=i==null?void 0:i.right)!=null?h:[]).filter(y=>!(r!=null&&r.includes(y))),...r]}}if(n==="left"){var m,g;return{left:[...((m=i==null?void 0:i.left)!=null?m:[]).filter(y=>!(r!=null&&r.includes(y))),...r],right:((g=i==null?void 0:i.right)!=null?g:[]).filter(y=>!(r!=null&&r.includes(y)))}}return{left:((s=i==null?void 0:i.left)!=null?s:[]).filter(y=>!(r!=null&&r.includes(y))),right:((a=i==null?void 0:i.right)!=null?a:[]).filter(y=>!(r!=null&&r.includes(y)))}})},t.getCanPin=()=>t.getLeafColumns().some(r=>{var i,s,a;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((s=(a=e.options.enableColumnPinning)!=null?a:e.options.enablePinning)!=null?s:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(u=>u.id),{left:r,right:i}=e.getState().columnPinning,s=n.some(u=>r==null?void 0:r.includes(u)),a=n.some(u=>i==null?void 0:i.includes(u));return s?"left":a?"right":!1},t.getPinnedIndex=()=>{var n,r;const i=t.getIsPinned();return i?(n=(r=e.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=nr(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,i)=>{const s=[...r??[],...i??[]];return n.filter(a=>!s.includes(a.column.id))},rr(e.options,"debugRows","getCenterVisibleCells")),t.getLeftVisibleCells=nr(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(a=>a.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),rr(e.options,"debugRows","getLeftVisibleCells")),t.getRightVisibleCells=nr(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(a=>a.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),rr(e.options,"debugRows","getRightVisibleCells"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,r;return t.setColumnPinning(e?gH():(n=(r=t.initialState)==null?void 0:r.columnPinning)!=null?n:gH())},t.getIsSomeColumnsPinned=e=>{var n;const r=t.getState().columnPinning;if(!e){var i,s;return!!((i=r.left)!=null&&i.length||(s=r.right)!=null&&s.length)}return!!((n=r[e])!=null&&n.length)},t.getLeftLeafColumns=nr(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(r=>e.find(i=>i.id===r)).filter(Boolean),rr(t.options,"debugColumns","getLeftLeafColumns")),t.getRightLeafColumns=nr(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(r=>e.find(i=>i.id===r)).filter(Boolean),rr(t.options,"debugColumns","getRightLeafColumns")),t.getCenterLeafColumns=nr(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r)=>{const i=[...n??[],...r??[]];return e.filter(s=>!i.includes(s.id))},rr(t.options,"debugColumns","getCenterLeafColumns"))}};function _he(t){return t||(typeof document<"u"?document:null)}const oT={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},vH=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Ehe={getDefaultColumnDef:()=>oT,getInitialState:t=>({columnSizing:{},columnSizingInfo:vH(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:nu("columnSizing",t),onColumnSizingInfoChange:nu("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,r,i;const s=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:oT.minSize,(r=s??t.columnDef.size)!=null?r:oT.size),(i=t.columnDef.maxSize)!=null?i:oT.maxSize)},t.getStart=nr(n=>[n,K1(e,n),e.getState().columnSizing],(n,r)=>r.slice(0,t.getIndex(n)).reduce((i,s)=>i+s.getSize(),0),rr(e.options,"debugColumns","getStart")),t.getAfter=nr(n=>[n,K1(e,n),e.getState().columnSizing],(n,r)=>r.slice(t.getIndex(n)+1).reduce((i,s)=>i+s.getSize(),0),rr(e.options,"debugColumns","getAfter")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:r,...i}=n;return i})},t.getCanResize=()=>{var n,r;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((r=e.options.enableColumnResizing)!=null?r:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var s;n+=(s=i.column.getSize())!=null?s:0}};return r(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const r=e.getColumn(t.column.id),i=r==null?void 0:r.getCanResize();return s=>{if(!r||!i||(s.persist==null||s.persist(),bH(s)&&s.touches&&s.touches.length>1))return;const a=t.getSize(),u=t?t.getLeafHeaders().map(L=>[L.column.id,L.column.getSize()]):[[r.id,r.getSize()]],h=bH(s)?Math.round(s.touches[0].clientX):s.clientX,m={},g=(L,D)=>{typeof D=="number"&&(e.setColumnSizingInfo(z=>{var H,V;const F=e.options.columnResizeDirection==="rtl"?-1:1,B=(D-((H=z==null?void 0:z.startOffset)!=null?H:0))*F,te=Math.max(B/((V=z==null?void 0:z.startSize)!=null?V:0),-.999999);return z.columnSizingStart.forEach(ve=>{let[ce,_e]=ve;m[ce]=Math.round(Math.max(_e+_e*te,0)*100)/100}),{...z,deltaOffset:B,deltaPercentage:te}}),(e.options.columnResizeMode==="onChange"||L==="end")&&e.setColumnSizing(z=>({...z,...m})))},y=L=>g("move",L),x=L=>{g("end",L),e.setColumnSizingInfo(D=>({...D,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},C=_he(n),E={moveHandler:L=>y(L.clientX),upHandler:L=>{C==null||C.removeEventListener("mousemove",E.moveHandler),C==null||C.removeEventListener("mouseup",E.upHandler),x(L.clientX)}},M={moveHandler:L=>(L.cancelable&&(L.preventDefault(),L.stopPropagation()),y(L.touches[0].clientX),!1),upHandler:L=>{var D;C==null||C.removeEventListener("touchmove",M.moveHandler),C==null||C.removeEventListener("touchend",M.upHandler),L.cancelable&&(L.preventDefault(),L.stopPropagation()),x((D=L.touches[0])==null?void 0:D.clientX)}},j=Nhe()?{passive:!1}:!1;bH(s)?(C==null||C.addEventListener("touchmove",M.moveHandler,j),C==null||C.addEventListener("touchend",M.upHandler,j)):(C==null||C.addEventListener("mousemove",E.moveHandler,j),C==null||C.addEventListener("mouseup",E.upHandler,j)),e.setColumnSizingInfo(L=>({...L,startOffset:h,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:r.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?vH():(n=t.initialState.columnSizingInfo)!=null?n:vH())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0}}};let aT=null;function Nhe(){if(typeof aT=="boolean")return aT;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return aT=t,aT}function bH(t){return t.type==="touchstart"}const khe={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:nu("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(r=>({...r,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,r;const i=t.columns;return(n=i.length?i.some(s=>s.getIsVisible()):(r=e.getState().columnVisibility)==null?void 0:r[t.id])!=null?n:!0},t.getCanHide=()=>{var n,r;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((r=e.options.enableHiding)!=null?r:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=nr(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),rr(e.options,"debugRows","_getAllVisibleCells")),t.getVisibleCells=nr(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],rr(e.options,"debugRows","getVisibleCells"))},createTable:t=>{const e=(n,r)=>nr(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),rr(t.options,"debugColumns",n));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var r;t.setColumnVisibility(n?{}:(r=t.initialState.columnVisibility)!=null?r:{})},t.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((i,s)=>({...i,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;t.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function K1(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const The={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},jhe={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:nu("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const r=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,r,i,s;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=e.options.enableGlobalFilter)!=null?r:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&((s=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?s:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>um.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:r}=t.options;return iT(r)?r:r==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[r])!=null?e:um[r]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},Mhe={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:nu("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var r,i;if(!e){t._queue(()=>{e=!0});return}if((r=(i=t.options.autoResetAll)!=null?i:t.options.autoResetExpanded)!=null?r:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=r=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(r),t.toggleAllRowsExpanded=r=>{r??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=r=>{var i,s;t.setExpanded(r?{}:(i=(s=t.initialState)==null?void 0:s.expanded)!=null?i:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const r=t.getState().expanded;return r===!0||Object.values(r).some(Boolean)},t.getIsAllRowsExpanded=()=>{const r=t.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||t.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},t.getExpandedDepth=()=>{let r=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(s=>{const a=s.split(".");r=Math.max(r,a.length)}),r},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(r=>{var i;const s=r===!0?!0:!!(r!=null&&r[t.id]);let a={};if(r===!0?Object.keys(e.getRowModel().rowsById).forEach(u=>{a[u]=!0}):a=r,n=(i=n)!=null?i:!s,!s&&n)return{...a,[t.id]:!0};if(s&&!n){const{[t.id]:u,...h}=a;return h}return r})},t.getIsExpanded=()=>{var n;const r=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:r===!0||r!=null&&r[t.id])},t.getCanExpand=()=>{var n,r,i;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((r=e.options.enableExpanding)!=null?r:!0)&&!!((i=t.subRows)!=null&&i.length)},t.getIsAllParentsExpanded=()=>{let n=!0,r=t;for(;n&&r.parentId;)r=e.getRow(r.parentId,!0),n=r.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},yH=0,xH=10,wH=()=>({pageIndex:yH,pageSize:xH}),Phe={getInitialState:t=>({...t,pagination:{...wH(),...t==null?void 0:t.pagination}}),getDefaultOptions:t=>({onPaginationChange:nu("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var r,i;if(!e){t._queue(()=>{e=!0});return}if((r=(i=t.options.autoResetAll)!=null?i:t.options.autoResetPageIndex)!=null?r:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=r=>{const i=s=>hg(r,s);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(i)},t.resetPagination=r=>{var i;t.setPagination(r?wH():(i=t.initialState.pagination)!=null?i:wH())},t.setPageIndex=r=>{t.setPagination(i=>{let s=hg(r,i.pageIndex);const a=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return s=Math.max(0,Math.min(s,a)),{...i,pageIndex:s}})},t.resetPageIndex=r=>{var i,s;t.setPageIndex(r?yH:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?i:yH)},t.resetPageSize=r=>{var i,s;t.setPageSize(r?xH:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?i:xH)},t.setPageSize=r=>{t.setPagination(i=>{const s=Math.max(1,hg(r,i.pageSize)),a=i.pageSize*i.pageIndex,u=Math.floor(a/s);return{...i,pageIndex:u,pageSize:s}})},t.setPageCount=r=>t.setPagination(i=>{var s;let a=hg(r,(s=t.options.pageCount)!=null?s:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...i,pageCount:a}}),t.getPageOptions=nr(()=>[t.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((s,a)=>a)),i},rr(t.options,"debugTable","getPageOptions")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:r}=t.getState().pagination,i=t.getPageCount();return i===-1?!0:i===0?!1:r<i-1},t.previousPage=()=>t.setPageIndex(r=>r-1),t.nextPage=()=>t.setPageIndex(r=>r+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var r;return(r=t.options.pageCount)!=null?r:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var r;return(r=t.options.rowCount)!=null?r:t.getPrePaginationRowModel().rows.length}}},CH=()=>({top:[],bottom:[]}),Ahe={getInitialState:t=>({rowPinning:CH(),...t}),getDefaultOptions:t=>({onRowPinningChange:nu("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,r,i)=>{const s=r?t.getLeafRows().map(h=>{let{id:m}=h;return m}):[],a=i?t.getParentRows().map(h=>{let{id:m}=h;return m}):[],u=new Set([...a,t.id,...s]);e.setRowPinning(h=>{var m,g;if(n==="bottom"){var y,x;return{top:((y=h==null?void 0:h.top)!=null?y:[]).filter(M=>!(u!=null&&u.has(M))),bottom:[...((x=h==null?void 0:h.bottom)!=null?x:[]).filter(M=>!(u!=null&&u.has(M))),...Array.from(u)]}}if(n==="top"){var C,E;return{top:[...((C=h==null?void 0:h.top)!=null?C:[]).filter(M=>!(u!=null&&u.has(M))),...Array.from(u)],bottom:((E=h==null?void 0:h.bottom)!=null?E:[]).filter(M=>!(u!=null&&u.has(M)))}}return{top:((m=h==null?void 0:h.top)!=null?m:[]).filter(M=>!(u!=null&&u.has(M))),bottom:((g=h==null?void 0:h.bottom)!=null?g:[]).filter(M=>!(u!=null&&u.has(M)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=e.options;return typeof r=="function"?r(t):(n=r??i)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:r,bottom:i}=e.getState().rowPinning,s=n.some(u=>r==null?void 0:r.includes(u)),a=n.some(u=>i==null?void 0:i.includes(u));return s?"top":a?"bottom":!1},t.getPinnedIndex=()=>{var n,r;const i=t.getIsPinned();if(!i)return-1;const s=(n=i==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(a=>{let{id:u}=a;return u});return(r=s==null?void 0:s.indexOf(t.id))!=null?r:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,r;return t.setRowPinning(e?CH():(n=(r=t.initialState)==null?void 0:r.rowPinning)!=null?n:CH())},t.getIsSomeRowsPinned=e=>{var n;const r=t.getState().rowPinning;if(!e){var i,s;return!!((i=r.top)!=null&&i.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[e])!=null&&n.length)},t._getPinnedRows=(e,n,r)=>{var i;return((i=t.options.keepPinnedRows)==null||i?(n??[]).map(a=>{const u=t.getRow(a,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(a=>e.find(u=>u.id===a))).filter(Boolean).map(a=>({...a,position:r}))},t.getTopRows=nr(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),rr(t.options,"debugRows","getTopRows")),t.getBottomRows=nr(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),rr(t.options,"debugRows","getBottomRows")),t.getCenterRows=nr(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,r)=>{const i=new Set([...n??[],...r??[]]);return e.filter(s=>!i.has(s.id))},rr(t.options,"debugRows","getCenterRows"))}},Ohe={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:nu("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const r={...n},i=t.getPreGroupedRowModel().flatRows;return e?i.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):i.forEach(s=>{delete r[s.id]}),r})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const r=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),i={...n};return t.getRowModel().rows.forEach(s=>{SH(i,s.id,r,!0,t)}),i}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=nr(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?RH(t,n):{rows:[],flatRows:[],rowsById:{}},rr(t.options,"debugTable","getSelectedRowModel")),t.getFilteredSelectedRowModel=nr(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?RH(t,n):{rows:[],flatRows:[],rowsById:{}},rr(t.options,"debugTable","getFilteredSelectedRowModel")),t.getGroupedSelectedRowModel=nr(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?RH(t,n):{rows:[],flatRows:[],rowsById:{}},rr(t.options,"debugTable","getGroupedSelectedRowModel")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let r=!!(e.length&&Object.keys(n).length);return r&&e.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=t.getState();let r=!!e.length;return r&&e.some(i=>!n[i.id])&&(r=!1),r},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,r)=>{const i=t.getIsSelected();e.setRowSelection(s=>{var a;if(n=typeof n<"u"?n:!i,t.getCanSelect()&&i===n)return s;const u={...s};return SH(u,t.id,n,(a=r==null?void 0:r.selectChildren)!=null?a:!0,e),u})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return _H(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return EH(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return EH(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return r=>{var i;n&&t.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},SH=(t,e,n,r,i)=>{var s;const a=i.getRow(e,!0);n?(a.getCanMultiSelect()||Object.keys(t).forEach(u=>delete t[u]),a.getCanSelect()&&(t[e]=!0)):delete t[e],r&&(s=a.subRows)!=null&&s.length&&a.getCanSelectSubRows()&&a.subRows.forEach(u=>SH(t,u.id,n,r,i))};function RH(t,e){const n=t.getState().rowSelection,r=[],i={},s=function(a,u){return a.map(h=>{var m;const g=_H(h,n);if(g&&(r.push(h),i[h.id]=h),(m=h.subRows)!=null&&m.length&&(h={...h,subRows:s(h.subRows)}),g)return h}).filter(Boolean)};return{rows:s(e.rows),flatRows:r,rowsById:i}}function _H(t,e){var n;return(n=e[t.id])!=null?n:!1}function EH(t,e,n){var r;if(!((r=t.subRows)!=null&&r.length))return!1;let i=!0,s=!1;return t.subRows.forEach(a=>{if(!(s&&!i)&&(a.getCanSelect()&&(_H(a,e)?s=!0:i=!1),a.subRows&&a.subRows.length)){const u=EH(a,e);u==="all"?s=!0:(u==="some"&&(s=!0),i=!1)}}),i?"all":s?"some":!1}const NH=/([0-9]+)/gm,Ihe=(t,e,n)=>q7(fg(t.getValue(n)).toLowerCase(),fg(e.getValue(n)).toLowerCase()),Dhe=(t,e,n)=>q7(fg(t.getValue(n)),fg(e.getValue(n))),Hhe=(t,e,n)=>kH(fg(t.getValue(n)).toLowerCase(),fg(e.getValue(n)).toLowerCase()),Lhe=(t,e,n)=>kH(fg(t.getValue(n)),fg(e.getValue(n))),$he=(t,e,n)=>{const r=t.getValue(n),i=e.getValue(n);return r>i?1:r<i?-1:0},Fhe=(t,e,n)=>kH(t.getValue(n),e.getValue(n));function kH(t,e){return t===e?0:t>e?1:-1}function fg(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function q7(t,e){const n=t.split(NH).filter(Boolean),r=e.split(NH).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),s=r.shift(),a=parseInt(i,10),u=parseInt(s,10),h=[a,u].sort();if(isNaN(h[0])){if(i>s)return 1;if(s>i)return-1;continue}if(isNaN(h[1]))return isNaN(a)?-1:1;if(a>u)return 1;if(u>a)return-1}return n.length-r.length}const q1={alphanumeric:Ihe,alphanumericCaseSensitive:Dhe,text:Hhe,textCaseSensitive:Lhe,datetime:$he,basic:Fhe},zhe=[vhe,khe,She,Rhe,yhe,xhe,The,jhe,{getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:nu("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const s=i==null?void 0:i.getValue(t.id);if(Object.prototype.toString.call(s)==="[object Date]")return q1.datetime;if(typeof s=="string"&&(r=!0,s.split(NH).length>1))return q1.alphanumeric}return r?q1.text:q1.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(t.id))=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,r;if(!t)throw new Error;return iT(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(r=e.options.sortingFns)==null?void 0:r[t.columnDef.sortingFn])!=null?n:q1[t.columnDef.sortingFn]},t.toggleSorting=(n,r)=>{const i=t.getNextSortingOrder(),s=typeof n<"u"&&n!==null;e.setSorting(a=>{const u=a==null?void 0:a.find(C=>C.id===t.id),h=a==null?void 0:a.findIndex(C=>C.id===t.id);let m=[],g,y=s?n:i==="desc";if(a!=null&&a.length&&t.getCanMultiSort()&&r?u?g="toggle":g="add":a!=null&&a.length&&h!==a.length-1?g="replace":u?g="toggle":g="replace",g==="toggle"&&(s||i||(g="remove")),g==="add"){var x;m=[...a,{id:t.id,desc:y}],m.splice(0,m.length-((x=e.options.maxMultiSortColCount)!=null?x:Number.MAX_SAFE_INTEGER))}else g==="toggle"?m=a.map(C=>C.id===t.id?{...C,desc:y}:C):g==="remove"?m=a.filter(C=>C.id!==t.id):m=[{id:t.id,desc:y}];return m})},t.getFirstSortDir=()=>{var n,r;return((n=(r=t.columnDef.sortDescFirst)!=null?r:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var r,i;const s=t.getFirstSortDir(),a=t.getIsSorted();return a?a!==s&&((r=e.options.enableSortingRemoval)==null||r)&&(!(n&&(i=e.options.enableMultiRemove)!=null)||i)?!1:a==="desc"?"asc":"desc":s},t.getCanSort=()=>{var n,r;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((r=e.options.enableSorting)!=null?r:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,r;return(n=(r=t.columnDef.enableMultiSort)!=null?r:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const r=(n=e.getState().sorting)==null?void 0:n.find(i=>i.id===t.id);return r?r.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,r;return(n=(r=e.getState().sorting)==null?void 0:r.findIndex(i=>i.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return r=>{n&&(r.persist==null||r.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(r):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,r;t.setSorting(e?[]:(n=(r=t.initialState)==null?void 0:r.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},whe,Mhe,Phe,Ahe,Ohe,Ehe];function Vhe(t){var e,n;Dx.NODE_ENV!=="production"&&(t.debugAll||t.debugTable)&&console.info("Creating Table Instance...");const r=[...zhe,...(e=t._features)!=null?e:[]];let i={_features:r};const s=i._features.reduce((x,C)=>Object.assign(x,C.getDefaultOptions==null?void 0:C.getDefaultOptions(i)),{}),a=x=>i.options.mergeOptions?i.options.mergeOptions(s,x):{...s,...x};let h={...{},...(n=t.initialState)!=null?n:{}};i._features.forEach(x=>{var C;h=(C=x.getInitialState==null?void 0:x.getInitialState(h))!=null?C:h});const m=[];let g=!1;const y={_features:r,options:{...s,...t},initialState:h,_queue:x=>{m.push(x),g||(g=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();g=!1}).catch(C=>setTimeout(()=>{throw C})))},reset:()=>{i.setState(i.initialState)},setOptions:x=>{const C=hg(x,i.options);i.options=a(C)},getState:()=>i.options.state,setState:x=>{i.options.onStateChange==null||i.options.onStateChange(x)},_getRowId:(x,C,E)=>{var M;return(M=i.options.getRowId==null?void 0:i.options.getRowId(x,C,E))!=null?M:`${E?[E.id,C].join("."):C}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(x,C)=>{let E=(C?i.getPrePaginationRowModel():i.getRowModel()).rowsById[x];if(!E&&(E=i.getCoreRowModel().rowsById[x],!E))throw Dx.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${x}`):new Error;return E},_getDefaultColumnDef:nr(()=>[i.options.defaultColumn],x=>{var C;return x=(C=x)!=null?C:{},{header:E=>{const M=E.header.column.columnDef;return M.accessorKey?M.accessorKey:M.accessorFn?M.id:null},cell:E=>{var M,j;return(M=(j=E.renderValue())==null||j.toString==null?void 0:j.toString())!=null?M:null},...i._features.reduce((E,M)=>Object.assign(E,M.getDefaultColumnDef==null?void 0:M.getDefaultColumnDef()),{}),...x}},rr(t,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>i.options.columns,getAllColumns:nr(()=>[i._getColumnDefs()],x=>{const C=function(E,M,j){return j===void 0&&(j=0),E.map(L=>{const D=ghe(i,L,j,M),z=L;return D.columns=z.columns?C(z.columns,D,j+1):[],D})};return C(x)},rr(t,"debugColumns","getAllColumns")),getAllFlatColumns:nr(()=>[i.getAllColumns()],x=>x.flatMap(C=>C.getFlatColumns()),rr(t,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:nr(()=>[i.getAllFlatColumns()],x=>x.reduce((C,E)=>(C[E.id]=E,C),{}),rr(t,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:nr(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(x,C)=>{let E=x.flatMap(M=>M.getLeafColumns());return C(E)},rr(t,"debugColumns","getAllLeafColumns")),getColumn:x=>{const C=i._getAllFlatColumnsById()[x];return Dx.NODE_ENV!=="production"&&!C&&console.error(`[Table] Column with id '${x}' does not exist.`),C}};Object.assign(i,y);for(let x=0;x<i._features.length;x++){const C=i._features[x];C==null||C.createTable==null||C.createTable(i)}return i}function lT(){return t=>nr(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,s,a){s===void 0&&(s=0);const u=[];for(let m=0;m<i.length;m++){const g=bhe(t,t._getRowId(i[m],m,a),i[m],m,s,void 0,a==null?void 0:a.id);if(n.flatRows.push(g),n.rowsById[g.id]=g,u.push(g),t.options.getSubRows){var h;g.originalSubRows=t.options.getSubRows(i[m],m),(h=g.originalSubRows)!=null&&h.length&&(g.subRows=r(g.originalSubRows,s+1,g))}}return u};return n.rows=r(e),n},rr(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function TH(){return t=>nr(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const r=t.getState().sorting,i=[],s=r.filter(h=>{var m;return(m=t.getColumn(h.id))==null?void 0:m.getCanSort()}),a={};s.forEach(h=>{const m=t.getColumn(h.id);m&&(a[h.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const u=h=>{const m=h.map(g=>({...g}));return m.sort((g,y)=>{for(let C=0;C<s.length;C+=1){var x;const E=s[C],M=a[E.id],j=M.sortUndefined,L=(x=E==null?void 0:E.desc)!=null?x:!1;let D=0;if(j){const z=g.getValue(E.id),H=y.getValue(E.id),V=z===void 0,F=H===void 0;if(V||F){if(j==="first")return V?-1:1;if(j==="last")return V?1:-1;D=V&&F?0:V?j:-j}}if(D===0&&(D=M.sortingFn(g,y,E.id)),D!==0)return L&&(D*=-1),M.invertSorting&&(D*=-1),D}return g.index-y.index}),m.forEach(g=>{var y;i.push(g),(y=g.subRows)!=null&&y.length&&(g.subRows=u(g.subRows))}),m};return{rows:u(n.rows),flatRows:i,rowsById:n.rowsById}},rr(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}/** * react-table * * Copyright (c) TanStack * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function mg(t,e){return t?Bhe(t)?W.createElement(t,e):t:null}function Bhe(t){return Whe(t)||typeof t=="function"||Uhe(t)}function Whe(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function Uhe(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function cT(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=W.useState(()=>({current:Vhe(e)})),[r,i]=W.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...t,state:{...r,...t.state},onStateChange:a=>{i(a),t.onStateChange==null||t.onStateChange(a)}})),n.current}const Yhe=t=>{if(!t||t==="0000-00-00 00:00:00"||t==="0000-00-00")return"";try{const e=new Date(t);return isNaN(e.getTime())?t:new Intl.DateTimeFormat("fa-IR-u-ca-persian",{year:"numeric",month:"long",day:"numeric"}).format(e)}catch{return t}},X7=t=>{if(typeof t!="string")return t;const e=[/(۰|٠)/g,/(۱|١)/g,/(۲|٢)/g,/(۳|٣)/g,/(۴|٤)/g,/(۵|٥)/g,/(۶|٦)/g,/(۷|٧)/g,/(۸|٨)/g,/(۹|٩)/g];let n=t;for(let r=0;r<10;r++)n=n.replace(e[r],r.toString());return n},jH=t=>["regular_price","sale_price","cost_price","stock","weight","sku","price","profit","margin"].includes(t)||t.includes("price")||t.includes("profit"),Xo=t=>{if(t==null||t==="")return"";const e=typeof t=="string"?parseFloat(t):t;return isNaN(e)?t.toString():new Intl.NumberFormat("fa-IR").format(e)+" تومان"},Ghe=t=>{const e={pending:"در انتظار پرداخت",processing:"در حال انجام","on-hold":"در انتظار بررسی",completed:"تکمیل شده",cancelled:"لغو شده",refunded:"مرجوع شده",failed:"ناموفق","checkout-draft":"پیشنویس پرداخت",abandoned:"رها شده (مجازی)"},n=t.replace("wc-","");return e[n]||t},Khe=t=>{switch(t.replace("wc-","")){case"completed":return"bg-emerald-100 text-emerald-700 border-emerald-200";case"processing":return"bg-blue-100 text-blue-700 border-blue-200";case"pending":return"bg-amber-100 text-amber-700 border-amber-200";case"cancelled":return"bg-rose-100 text-rose-700 border-rose-200";case"on-hold":return"bg-orange-100 text-orange-700 border-orange-200";case"failed":return"bg-red-100 text-red-700 border-red-200";case"abandoned":return"bg-rose-50 text-rose-500 border-rose-100 shadow-sm shadow-rose-100/50 font-black";default:return"bg-slate-100 text-slate-700 border-slate-200"}},MH=()=>{var e;const t=((e=window.woocommersa_data)==null?void 0:e.gridColumns)||{};return Object.values(t)};var Q7={},Z7={exports:{}};(function(t,e){(function(n,r){t.exports=r(WD,W)})(tae,function(n,r){function i(j){return j&&typeof j=="object"&&"default"in j?j:{default:j}}var s=i(r);function a(j,L){var D=Object.keys(j);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(j);L&&(z=z.filter(function(H){return Object.getOwnPropertyDescriptor(j,H).enumerable})),D.push.apply(D,z)}return D}function u(j){for(var L=1;L<arguments.length;L++){var D=arguments[L]!=null?arguments[L]:{};L%2?a(Object(D),!0).forEach(function(z){h(j,z,D[z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(D)):a(Object(D)).forEach(function(z){Object.defineProperty(j,z,Object.getOwnPropertyDescriptor(D,z))})}return j}function h(j,L,D){return L in j?Object.defineProperty(j,L,{value:D,enumerable:!0,configurable:!0,writable:!0}):j[L]=D,j}function m(j,L){return function(D){if(Array.isArray(D))return D}(j)||function(D,z){var H=D==null?null:typeof Symbol<"u"&&D[Symbol.iterator]||D["@@iterator"];if(H!=null){var V,F,B=[],te=!0,ve=!1;try{for(H=H.call(D);!(te=(V=H.next()).done)&&(B.push(V.value),!z||B.length!==z);te=!0);}catch(ce){ve=!0,F=ce}finally{try{te||H.return==null||H.return()}finally{if(ve)throw F}}return B}}(j,L)||function(D,z){if(D){if(typeof D=="string")return g(D,z);var H=Object.prototype.toString.call(D).slice(8,-1);if(H==="Object"&&D.constructor&&(H=D.constructor.name),H==="Map"||H==="Set")return Array.from(D);if(H==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(H))return g(D,z)}}(j,L)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function g(j,L){(L==null||L>j.length)&&(L=j.length);for(var D=0,z=new Array(L);D<L;D++)z[D]=j[D];return z}function y(j,L){var D=j.element,z=j.popper,H=j.position,V=H===void 0?"bottom-center":H,F=j.containerStyle,B=j.containerClassName,te=B===void 0?"":B,ve=j.arrow,ce=j.arrowStyle,_e=ce===void 0?{}:ce,pe=j.arrowClassName,Le=pe===void 0?"":pe,Fe=j.fixMainPosition,nt=j.fixRelativePosition,dt=j.offsetY,$e=j.offsetX,Re=j.animations,Ze=j.zIndex,Ee=Ze===void 0?0:Ze,Q=j.popperShadow,fe=j.onChange,Ve=j.active,ne=Ve===void 0||Ve,xe=j.portal,Ke=j.portalTarget,qe=typeof window<"u",we=qe&&Ke instanceof HTMLElement,k=ve===!0,_=z&&ne===!0,N=r.useRef(),O=r.useRef(),G=r.useRef(),q=r.useRef(),I=r.useMemo(function(){return{position:V,fixMainPosition:Fe,fixRelativePosition:nt,offsetY:dt,offsetX:$e,defaultArrow:k,animations:Re,zIndex:Ee,onChange:fe}},[V,Fe,nt,dt,$e,k,Re,fe,Ee]),Z=r.useCallback(function(){G.current&&(G.current.style.transition=""),O.current&&(O.current.parentNode.style.transition="")},[]),U={element:u({display:"inline-block",height:"max-content"},F),arrow:u({visibility:"hidden",left:"0",top:"0",position:"absolute"},_e),popper:{position:"absolute",left:"0",top:"0",willChange:"transform",visibility:"hidden",zIndex:Ee}};qe&&!q.current&&(q.current=document.createElement("div"),q.current.data={portal:xe,isValidPortalTarget:we}),r.useEffect(function(){if(xe&&!we){var ae=q.current;return document.body.appendChild(ae),function(){document.body.contains(ae)&&document.body.removeChild(ae)}}},[xe,we]),r.useEffect(function(){if(!_)return Z(),O.current.parentNode.style.visibility="hidden",void(G.current&&(G.current.style.visibility="hidden"));function ae(he){he&&he.type!=="resize"&&!he.target.contains(N.current)||(he&&Z(),x(N,O,G,I,he))}return ae(),document.addEventListener("scroll",ae,!0),window.addEventListener("resize",ae),function(){document.removeEventListener("scroll",ae,!0),window.removeEventListener("resize",ae)}},[_,I,Z]),r.useEffect(function(){var ae={portal:xe,isValidPortalTarget:we},he=q.current.data;JSON.stringify(ae)!==JSON.stringify(he)&&(q.current.data=ae,N.current.refreshPosition())},[xe,we]);var re=s.default.createElement(s.default.Fragment,null,function(){if(!ve||!_)return null;var ae=s.default.createElement("div",{ref:G,style:U.arrow}),he=r.isValidElement(ve)?{children:ve}:{className:"ep-arrow ".concat(Q?"ep-shadow":""," ").concat(Le)};return r.cloneElement(ae,he)}(),s.default.createElement("div",{className:Q?"ep-popper-shadow":"",style:U.popper},s.default.createElement("div",{ref:O},z)));return s.default.createElement("div",{ref:function(ae){if(ae&&(ae.removeTransition=Z,ae.refreshPosition=function(){return setTimeout(function(){return x(N,O,G,I,{})},10)}),N.current=ae,L instanceof Function)return L(ae);L&&(L.current=ae)},className:te,style:U.element},D,xe&&qe?n.createPortal(re,we?Ke:q.current):re)}function x(j,L,D,z,H){var V=z.position,F=z.fixMainPosition,B=z.fixRelativePosition,te=z.offsetY,ve=te===void 0?0:te,ce=z.offsetX,_e=ce===void 0?0:ce,pe=z.defaultArrow,Le=z.animations,Fe=Le===void 0?[]:Le,nt=z.zIndex,dt=z.onChange;if(j.current&&L.current){var $e,Re,Ze,Ee,Q=(Re=window.pageXOffset!==void 0,Ze=(document.compatMode||"")==="CSS1Compat",{scrollLeft:Re?window.pageXOffset:Ze?document.documentElement.scrollLeft:document.body.scrollLeft,scrollTop:Re?window.pageYOffset:Ze?document.documentElement.scrollTop:document.body.scrollTop}),fe=Q.scrollLeft,Ve=Q.scrollTop,ne=C(j.current,fe,Ve),xe=ne.top,Ke=ne.left,qe=ne.height,we=ne.width,k=ne.right,_=ne.bottom,N=C(L.current,fe,Ve),O=N.top,G=N.left,q=N.height,I=N.width,Z=document.documentElement,U=Z.clientHeight,re=Z.clientWidth,ae=L.current.parentNode,he=function(mn){if(!mn)return[0,0];var dn=m((mn.style.transform.match(/translate\((.*?)px,\s(.*?)px\)/)||[]).map(function(Je){return Number(Je)}),3),Ne=dn[1],oe=Ne===void 0?0:Ne,Ae=dn[2];return[oe,Ae===void 0?0:Ae]}(ae),Me=m(he,2),tt=Me[0],ot=Me[1],lt=function(mn){var dn=m(mn.split("-"),2),Ne=dn[0],oe=Ne===void 0?"bottom":Ne,Ae=dn[1],Je=Ae===void 0?"center":Ae;oe==="auto"&&(oe="bottom"),Je==="auto"&&(Je="center");var vt=oe==="top"||oe==="bottom",Vt=oe==="left"||oe==="right";return Vt&&(Je==="start"&&(Je="top"),Je==="end"&&(Je="bottom")),vt&&(Je==="start"&&(Je="left"),Je==="end"&&(Je="right")),[oe,Je,vt,Vt]}(V),X=m(lt,4),de=X[0],Ce=X[1],Oe=X[2],Ge=X[3],Qe=de,se=function(mn,dn){return"translate(".concat(mn,"px, ").concat(dn,"px)")},ie=we-I,J=qe-q,me=Ce==="left"?0:Ce==="right"?ie:ie/2,Se=ie-me,je=Ce==="top"?0:Ce==="bottom"?J:J/2,Pe=J-je,ut=Ke-G+tt,wt=xe-O+ot,kt=0,Rt=0,sn=E(j.current),jn=[],An=D.current,Jn=C(An,fe,Ve)||{},Qt=Jn.height,Gt=Qt===void 0?0:Qt,ir=Jn.width,kn=ir===void 0?0:ir,Kt=ut,zt=wt,Wt={top:"bottom",bottom:"top",left:"right",right:"left"};for(Oe&&(ut+=me,wt+=de==="top"?-q:qe,pe&&(Gt=11,kn=20)),Ge&&(ut+=de==="left"?-I:we,wt+=je,pe&&(Gt=20,kn=11));sn;)jn.push(sn),tn(C(sn,fe,Ve)),sn=E(sn.parentNode);tn({top:Ve,bottom:Ve+U,left:fe,right:fe+re,height:U,width:re}),Oe&&(wt+=Qe==="bottom"?ve:-ve),Ge&&(ut+=Qe==="right"?_e:-_e),ut-=kt,wt-=Rt,$e=Wt[Qe],An&&(Oe&&((Ee=we<I)?Kt+=we/2:Kt=ut+I/2,Kt-=kn/2,Qe==="bottom"&&(zt=wt,wt+=Gt),Qe==="top"&&(zt=(wt-=Gt)+q),kt<0&&kt-me<0&&(Ee?Kt+=(me-kt)/2:we-me+kt<I&&(Kt+=(we-me+kt-I)/2)),kt>0&&kt+Se>0&&(Ee?Kt-=(kt+Se)/2:we-kt-Se<I&&(Kt-=(we-kt-Se-I)/2))),Ge&&((Ee=qe<q)?zt+=qe/2:zt=wt+q/2,zt-=Gt/2,Qe==="left"&&(Kt=(ut-=kn)+I),Qe==="right"&&(Kt=ut,ut+=kn),Rt<0&&Rt-je<0&&(Ee?zt+=(je-Rt)/2:qe-je+Rt<q&&(zt+=(qe-je+Rt-q)/2)),Rt>0&&Rt+Pe>0&&(Ee?zt-=(Rt+Pe)/2:qe-Rt-Pe<q&&(zt-=(qe-Rt-Pe-q)/2))),An.setAttribute("direction",$e),An.style.height=Gt+"px",An.style.width=kn+"px",An.style.transform=se(Kt,zt),An.style.visibility="visible",An.style.zIndex=nt+1),ae.style.transform=se(ut,wt);var en={popper:{top:wt,bottom:wt+q,left:ut,right:ut+I,height:q,width:I},element:{top:xe,bottom:_,left:Ke,right:k,height:qe,width:we},arrow:{top:zt,bottom:zt+Gt,left:Kt,right:Kt+kn,height:Gt,width:kn,direction:$e},position:Qe+"-"+(kt!==0?"auto":Ce),scroll:{scrollLeft:fe,scrollTop:Ve},scrollableParents:jn,event:H};H||Fe.forEach(function(mn){mn({popper:ae,arrow:An,data:u(u({},en),{},{getTransform:se,mirror:Wt})})}),ae.style.visibility="visible",typeof dt=="function"&&dt(en)}function tn(mn){var dn=mn.top,Ne=mn.bottom,oe=mn.left,Ae=mn.right,Je=mn.height,vt=mn.width;if(Oe){var Vt=Math.round(xe-dn+qe/2),$t=Math.round(Je/2);F||(xe-(q+ve+Gt)<dn&&Vt<=$t&&Qe==="top"?(wt+=q+qe,Qe="bottom"):_+q+ve+Gt>Je+dn&&Vt>=$t&&Qe==="bottom"&&(wt-=q+qe,Qe="top")),B||(Ke+me<oe&&(kt=M(k-kn>oe?Ke+me-oe:-we+me+kn,kt)),k-Se>Ae&&(kt=M(Ke+kn<Ae?k-Se-Ae:we-Se-kn,kt)))}if(Ge){var jt=Math.round(Ke-oe+we/2),Ft=Math.round(vt/2);F||(Ke-(I+_e+kn)<oe&&jt<Ft&&Qe==="left"?(ut+=we+I,Qe="right"):k+I+_e+kn>Ae&&jt>Ft&&Qe==="right"&&(ut-=we+I,Qe="left")),B||(xe+je<dn&&(Rt=M(_-Gt>dn?xe+je-dn:-qe+je+Gt,Rt)),_-Pe>Ne&&(Rt=M(xe+Gt<Ne?_-Pe-Ne:qe-Pe-Gt,Rt)))}}}function C(j,L,D){if(j){var z=j.getBoundingClientRect(),H=z.top,V=z.left,F=z.width,B=z.height,te=H+D,ve=V+L;return{top:te,bottom:te+B,left:ve,right:ve+F,width:F,height:B}}}function E(j){if(j&&j.tagName!=="HTML"){var L=window.getComputedStyle(j),D=function(z){return["auto","scroll"].includes(z)};return j.clientHeight<j.scrollHeight&&D(L.overflowX)||j.clientWidth<j.scrollWidth&&D(L.overflowY)?j:E(j.parentNode)}}function M(j,L){return Math.round(Math.abs(j))>Math.round(Math.abs(L))?j:L}return r.forwardRef(y)})})(Z7);var qhe=Z7.exports;function Hx(t){return Hx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hx(t)}function Xhe(t){return function(e){if(Array.isArray(e))return PH(e)}(t)||J7(t)||uT(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function J7(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function eY(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=uT(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(h){throw h},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var h=n.next();return a=h.done,h},e:function(h){u=!0,s=h},f:function(){try{a||n.return==null||n.return()}finally{if(u)throw s}}}}function tY(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function nY(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?tY(Object(n),!0).forEach(function(r){Qhe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tY(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Qhe(t,e,n){return(e=sY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function C0(t,e){return iY(t)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var s,a,u,h,m=[],g=!0,y=!1;try{if(u=(i=i.call(n)).next,r===0){if(Object(i)!==i)return;g=!1}else for(;!(g=(s=u.call(i)).done)&&(m.push(s.value),m.length!==r);g=!0);}catch(x){y=!0,a=x}finally{try{if(!g&&i.return!=null&&(h=i.return(),Object(h)!==h))return}finally{if(y)throw a}}return m}}(t,e)||uT(t,e)||rY()}function rY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uT(t,e){if(t){if(typeof t=="string")return PH(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?PH(t,e):void 0}}function PH(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function iY(t){if(Array.isArray(t))return t}function Zhe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,sY(r.key),r)}}function sY(t){var e=function(n,r){if(Hx(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var s=i.call(n,r);if(Hx(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(t,"string");return Hx(e)==="symbol"?e:String(e)}function Qo(t,e,n){(function(r,i){if(i.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function ft(t,e){return function(n,r){return r.get?r.get.call(n):r.value}(t,oY(t,e,"get"))}function ln(t,e,n){return function(r,i,s){if(i.set)i.set.call(r,s);else{if(!i.writable)throw new TypeError("attempted to set read only private field");i.value=s}}(t,oY(t,e,"set"),n),n}function oY(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Jhe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function efe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var aY={name:"gregorian_en",months:[["January","Jan"],["February","Feb"],["March","Mar"],["April","Apr"],["May","May"],["June","Jun"],["July","Jul"],["August","Aug"],["September","Sep"],["October","Oct"],["November","Nov"],["December","Dec"]],weekDays:[["Saturday","Sat"],["Sunday","Sun"],["Monday","Mon"],["Tuesday","Tue"],["Wednesday","Wed"],["Thursday","Thu"],["Friday","Fri"]],digits:["0","1","2","3","4","5","6","7","8","9"],meridiems:[["AM","am"],["PM","pm"]]},dT={name:"gregorian",startYear:1,yearLength:365,epoch:1721424,century:20,weekStartDayIndex:1,getMonthLengths:function(t){return[31,t?29:28,31,30,31,30,31,31,30,31,30,31]},isLeap:function(t){return t%4==0&&t%100!=0||t%400==0},getLeaps:function(t){if(t!==0){for(var e=t>0?1:-1,n=[];t>0?e<=t:t<=e;)this.isLeap(e)&&n.push(e),t>0?e++:e--;return n}},getDayOfYear:function(t){for(var e=t.year,n=t.month,r=t.day,i=this.getMonthLengths(this.isLeap(e)),s=0;s<n.index;s++)r+=i[s];return r},getAllDays:function(t){var e=t.year;return this.yearLength*(e-1)+this.leapsLength(e)+this.getDayOfYear(t)},leapsLength:function(t){return((t-1)/4|0)+(-(t-1)/100|0)+((t-1)/400|0)},guessYear:function(t,e){return~~(t/365.24)+(e>0?1:-1)}};function pg(t){return t&&t.constructor===Object}function Wu(t){if(!isNaN(t))return parseInt(t)}function S0(t){return Array.isArray(t)}function Lx(t,e,n){return t===void 0||t<e||t>n}var Zo=new WeakMap,js=new WeakMap,ns=new WeakMap,Uu=new WeakMap,dm=new WeakMap,hm=new WeakMap,mo=new WeakMap,fm=new WeakMap,La=new WeakMap,Ms=new WeakMap,$x=new WeakMap,Yu=new WeakMap,lY=new WeakMap,Fx=new WeakMap,zx=new WeakMap,cY=new WeakMap,AH=new WeakMap,Gu=new WeakMap,OH=new WeakMap,tfe=function(){function t(r){var i=this;(function(h,m){if(!(h instanceof m))throw new TypeError("Cannot call a class as a function")})(this,t),Qo(this,Zo,{writable:!0,value:void 0}),Qo(this,js,{writable:!0,value:void 0}),Qo(this,ns,{writable:!0,value:void 0}),Qo(this,Uu,{writable:!0,value:void 0}),Qo(this,dm,{writable:!0,value:void 0}),Qo(this,hm,{writable:!0,value:void 0}),Qo(this,mo,{writable:!0,value:void 0}),Qo(this,fm,{writable:!0,value:void 0}),Qo(this,La,{writable:!0,value:aY}),Qo(this,Ms,{writable:!0,value:dT}),Qo(this,$x,{writable:!0,value:!1}),Qo(this,Yu,{writable:!0,value:{}}),Qo(this,lY,{writable:!0,value:/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\dZ$/}),Qo(this,Fx,{writable:!0,value:[]}),Qo(this,zx,{writable:!0,value:!0}),Qo(this,cY,{writable:!0,value:function(h,m){switch(h){case"YYYY":return["year",m];case"YY":return["year","".concat(ft(i,Ms).century).concat(m)];case"MMMM":case"MMM":return["month",i.months.findIndex(function(y){var x=y.name,C=y.shortName;return new RegExp(m,"i").test(x+C)})+1];case"MM":case"M":return["month",m];case"DD":case"D":return["day",m];case"HH":case"H":return["hour",m];case"hh":case"h":var g=Wu(m);return["hour",g>12?g-12:g];case"mm":case"m":return["minute",m];case"ss":case"s":return["second",m];case"SSS":case"SS":case"S":return["millisecond",m];default:return[]}}}),Qo(this,AH,{writable:!0,value:function(){return ft(i,Zo)===0&&ft(i,Ms).startYear!==0}}),Qo(this,Gu,{writable:!0,value:function(){if(ft(i,zx)&&i.isValid){var h=Math.floor,m=function(M,j){return[(z=M,(z<0?-1:1)*Math.abs(h(M/j))),(L=M,D=j,(L<0&&h(L%D)!==-0?D:0)+h(M%j))];var L,D,z},g=function(){if(ft(i,js)<0||ft(i,js)>11){var M=ft(i,js)<0?-1:1,j=C0(m(ft(i,js),12),2),L=j[0],D=j[1];ln(i,Zo,ft(i,Zo)+L),ln(i,js,D),ft(i,AH).call(i)&&ln(i,Zo,M)}};for(ln(i,zx,!1),[["millisecond","second",1e3],["second","minute",60],["minute","hour",60],["hour","day",24]].forEach(function(M){var j=C0(M,3),L=j[0],D=j[1],z=j[2];if(function(B,te){return B>=te||B<0}(i[L],z)){var H=C0(m(i[L],z),2),V=H[0],F=H[1];i[D]+=V,i[L]=F}}),ln(i,zx,!0),g();ft(i,ns)<-ft(i,Ms).yearLength||ft(i,ns)>ft(i,Ms).yearLength;){if(ft(i,js)>0){for(var y=ft(i,Ms).getMonthLengths(i.isLeap),x=0;x<ft(i,js);x++)ln(i,ns,ft(i,ns)+y[x]);ln(i,js,0)}var C=i.isLeap?i.calendar.yearLength+1:i.calendar.yearLength;ln(i,ns,ft(i,ns)+C*(ft(i,ns)<0?1:-1)),ln(i,Zo,ft(i,Zo)+(ft(i,ns)<0?-1:1))}for(;;){var E;for(g();ft(i,ns)<1;)ln(i,js,ft(i,js)-1),g(),ln(i,ns,i.month.length+ft(i,ns));if(ft(i,ns)<=i.month.length||isNaN(ft(i,ns)))break;ln(i,ns,ft(i,ns)-i.month.length),ln(i,js,(E=ft(i,js),E++,E))}ft(i,Uu)||ln(i,Uu,0),ft(i,dm)||ln(i,dm,0),ft(i,hm)||ln(i,hm,0),ft(i,mo)||ln(i,mo,0)}}}),Qo(this,OH,{writable:!0,value:function(){return(ft(i,Yu).weekDays||ft(i,La).weekDays).map(function(h,m){var g=C0(h,2),y=g[0],x=g[1],C=m-i.weekStartDayIndex;return C<0&&(C+=7),{name:y,shortName:x,index:C,number:C+1,toString:function(){return this.number.toString()},valueOf:function(){return this.number}}})}});var s=pg(r)?nY({},r):r,a=!0;if(s&&typeof s!="boolean"||(s={date:new Date}),pg(s)||(s={date:s}),Object.keys(s).length!==0){for(var u in pg(s.calendar)&&ln(this,Ms,s.calendar),pg(s.locale)&&ln(this,La,s.locale),isNaN(s.year)&&isNaN(s.month)&&isNaN(s.day)&&!s.date&&(s.date=new Date),s.date&&(typeof s.date=="string"&&s.format&&ln(this,fm,s.format),this.setDate(s.date),s.calendar&&this.convert(s.calendar),a=!1),delete s.calendar,delete s.locale,delete s.date,s)this.set(u,s[u]);ft(this,AH).call(this)&&ln(this,Zo,-1),a&&ft(this,Gu).call(this)}}var e,n;return e=t,n=[{key:"parse",value:function(r){if(!r)return this;var i,s,a=ft(this,fm),u=ft(this,La).digits,h=eY(u);try{for(h.s();!(i=h.n()).done;){var m=i.value;r=r.replace(new RegExp(m,"g"),u.indexOf(m))}}catch(_e){h.e(_e)}finally{h.f()}if(a)for(var g=a.split(/[^\w\u0600-\u06FF]/),y=r.split(/[^\w\u0600-\u06FF]/),x=0;x<g.length;x++)this.set.apply(this,Xhe(ft(this,cY).call(this,g[x],y[x])));else{var C=r.match(/(-?\d{2,4})?\W?([A-z]{3,9}|\d{1,2})?\W?(\d{1,2})?\W?(\d{1,2})?\W?(\d{1,2})?\W?(\d{1,2})?\W?(\d{1,3})?\W?(am|pm)?/),E=(iY(s=C)||J7(s)||uT(s)||rY()).slice(1),M=E[1];M&&(M=/\d+/.test(M)?Wu(M)-1:this.months.findIndex(function(_e){return new RegExp(M,"i").test(_e.name)})),E[1]=M;var j=C0(E.map(Wu),7),L=j[0],D=j[1],z=j[2],H=j[3],V=j[4],F=j[5],B=j[6];ln(this,Zo,L),ln(this,js,D),ln(this,ns,z),ln(this,Uu,H),ln(this,dm,V),ln(this,hm,F),ln(this,mo,B)}var te=C0(ft(this,La).meridiems[1],2),ve=te[0],ce=te[1];return ft(this,Uu)<12&&(r.includes(ve)||r.includes(ce))&&ln(this,Uu,ft(this,Uu)+12),ft(this,Gu).call(this),this}},{key:"convert",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dT,i=arguments.length>1?arguments[1]:void 0;if(pg(i)&&ln(this,La,i),!pg(r)||r.name===ft(this,Ms).name)return this;var s=this.toJulianDay()-r.epoch,a=new t({calendar:r,year:r.guessYear(s,ft(this,Zo)),month:1,day:1});return a.day+=s-a.toDays(),ln(this,Zo,a.year),ln(this,js,a.month.index),ln(this,ns,a.day),ln(this,Ms,r),this}},{key:"format",value:function(r,i){if(!this.isValid||r&&typeof r!="string")return"";r||(r=ft(this,fm)||"YYYY/MM/DD"),S0(i)||(i=[]),i=(i=i.concat(ft(this,Fx))).filter(function(x){return typeof x=="string"||(console.warn("type of all items in the ignore list must be string, found",Hx(x)),!1)}).map(function(x){return x.replace(/[*/+\-()[\]{}\s$^]/g,function(C){return"\\"+C})});var s,a=new RegExp("".concat(i.join("|")).concat(i.length>0?"|":"","YYYY|YY|MMMM|MMM|MM|M|WW|W|DDDD|DDD|DD|D|dddd|ddd|dd|d|HH|H|hh|h|mm|m|ss|s|SSS|SS|S|A|a|."),"g"),u="",h=eY(r.match(a)||[]);try{for(h.s();!(s=h.n()).done;){var m=s.value,g=this.getValue(m);u+=i.includes(m)?m:g===0?g:g||m}}catch(x){h.e(x)}finally{h.f()}var y=this.digits;return u.replace(/[0-9]/g,function(x){return y[x]})}},{key:"getProperty",value:function(r){return this.getValue(r)}},{key:"getValue",value:function(r){var i=function(s){return s<10?"0"+s:s};switch(r){case"YYYY":return this.year;case"YY":return this.year.toString().substring(2,4);case"MMMM":return this.month.name;case"MMM":return this.month.shortName;case"MM":return i(this.month.number);case"M":return this.month.number;case"WW":return i(this.weekOfYear);case"W":return this.weekOfYear;case"DDDD":case"DDD":return this.dayOfYear;case"DD":return i(this.day);case"D":return this.day;case"HH":return i(this.hour);case"H":return this.hour;case"dddd":return this.weekDay.name;case"ddd":return this.weekDay.shortName;case"dd":return i(this.weekDay.number);case"d":return this.weekDay.number;case"hh":return i(this.hour>12?this.hour-12:this.hour||12);case"h":return this.hour>12?this.hour-12:this.hour||12;case"mm":return i(this.minute);case"m":return this.minute;case"ss":return i(this.second);case"s":return this.second;case"SSS":return ft(this,mo)<10?"00".concat(ft(this,mo)):ft(this,mo)<100?"0".concat(ft(this,mo)):ft(this,mo);case"SS":return ft(this,mo)<10?"00":ft(this,mo)<100?("0"+ft(this,mo)).substring(2,0):ft(this,mo).toString().substring(0,2);case"S":return ft(this,mo)<10||ft(this,mo)<100?"0":ft(this,mo).toString().substring(0,1);case"a":return this.hour>=12?ft(this,La).meridiems[1][1]:ft(this,La).meridiems[0][1];case"A":return this.hour>=12?ft(this,La).meridiems[1][0]:ft(this,La).meridiems[0][0];default:return""}}},{key:"setYear",value:function(r){return this.year=r,this}},{key:"setMonths",value:function(r){return this.months=r,this}},{key:"setMonth",value:function(r){return this.month=r,this}},{key:"setWeekDays",value:function(r){return this.weekDays=r,this}},{key:"setDigits",value:function(r){return this.digits=r,this}},{key:"setDay",value:function(r){return this.day=r,this}},{key:"setHour",value:function(r){return this.hour=r,this}},{key:"setMinute",value:function(r){return this.minute=r,this}},{key:"setSecond",value:function(r){return this.second=r,this}},{key:"setMillisecond",value:function(r){return this.millisecond=r,this}},{key:"setFormat",value:function(r){return ln(this,fm,r),this}},{key:"setLocale",value:function(r){return this.locale=r,this}},{key:"setCalendar",value:function(r){return this.calendar=r,this}},{key:"setDate",value:function(r){if(typeof r=="string"){if(!ft(this,lY).test(r))return this.parse(r);r=new Date(r)}return typeof r=="number"&&(r=new Date(r)),r instanceof Date&&(ln(this,Ms,dT),ln(this,Zo,r.getFullYear()),ln(this,js,r.getMonth()),ln(this,ns,r.getDate()),ln(this,Uu,r.getHours()),ln(this,dm,r.getMinutes()),ln(this,hm,r.getSeconds()),ln(this,mo,r.getMilliseconds()),ln(this,$x,!1)),r instanceof t&&(ln(this,Zo,r.year),ln(this,js,r.month.index),ln(this,ns,r.day),ln(this,Uu,r.hour),ln(this,dm,r.minute),ln(this,hm,r.second),ln(this,mo,r.millisecond),ln(this,La,r.locale),ln(this,fm,r._format),ln(this,Ms,r.calendar),ln(this,$x,r.isUTC),ln(this,Fx,r.ignoreList),ln(this,Yu,r.custom)),this}},{key:"setIgnoreList",value:function(r){return this.ignoreList=r,this}},{key:"set",value:function(r,i){if(r==null)return this;if(pg(r)){var s=nY({},r);for(var a in s.date&&(this.setDate(s.date),delete s.date),s.calendar&&(this.convert(s.calendar),delete s.calendar),s.locale&&(this.setLocale(s.locale),delete s.locale),ln(this,zx,!1),s)this.set(a,s[a]);return ln(this,zx,!0),ft(this,Gu).call(this),this}r==="format"&&(r="_format");try{this[r]=i}catch{}return this}},{key:"add",value:function(r,i){if(!(r=Wu(r))||!i)return this;switch(i){case"years":case"y":i="year";break;case"months":case"M":i="month";break;case"days":case"d":i="day";break;case"hours":case"h":i="hour";break;case"minutes":case"m":i="minute";break;case"seconds":case"s":i="second";break;case"milliseconds":case"ms":i="millisecond"}return this[i]+=r,this}},{key:"subtract",value:function(r,i){return this.add(-r,i)}},{key:"toFirstOfYear",value:function(){return this.month=1,this.day=1,this}},{key:"toLastOfYear",value:function(){return this.day>=29&&(this.day=29),this.month=12,this.toLastOfMonth(),this}},{key:"toFirstOfMonth",value:function(){return ln(this,ns,1),this}},{key:"toLastOfMonth",value:function(){return ln(this,ns,0),ln(this,js,ft(this,js)+1),ft(this,Gu).call(this),this}},{key:"toFirstOfWeek",value:function(){return this.day-=this.weekDay.index,this}},{key:"toLastOfWeek",value:function(){return this.day+=6-this.weekDay.index,this}},{key:"toFirstWeekOfYear",value:function(){return this.toFirstOfYear(),this.weekDay.index===0?this:this.toLastOfWeek().setDay(this.day+1)}},{key:"toLastWeekOfYear",value:function(){return this.toLastOfYear().toFirstOfWeek()}},{key:"toString",value:function(){return this.format()}},{key:"toDate",value:function(){var r=new t(this);return ft(this,Ms).name!=="gregorian"&&r.convert(dT),new Date(r.year,r.month.index,r.day,r.hour,r.minute,r.second,r.millisecond)}},{key:"toUTC",value:function(){return ft(this,$x)||(this.minute+=this.toDate().getTimezoneOffset(),ln(this,$x,!0)),this}},{key:"toUnix",value:function(){return this.unix}},{key:"toJulianDay",value:function(){return this.toDays()+ft(this,Ms).epoch}},{key:"toObject",value:function(){return{year:ft(this,Zo),month:this.month,day:ft(this,ns),weekDay:this.weekDay,hour:ft(this,Uu),minute:ft(this,dm),second:ft(this,hm),millisecond:ft(this,mo),weekOfYear:this.weekOfYear,dayOfYear:this.dayOfYear,daysLeft:this.daysLeft,calendar:ft(this,Ms),locale:ft(this,La),format:ft(this,fm)||"YYYY/MM/DD",ignoreList:ft(this,Fx)}}},{key:"toJSON",value:function(){return this.valueOf()}},{key:"valueOf",value:function(){return this.toDate().valueOf()}},{key:"toDays",value:function(){if(this.isValid)return ft(this,Ms).getAllDays(this)}},{key:"dayOfBeginning",get:function(){return this.toDays()}},{key:"dayOfYear",get:function(){if(this.isValid)return ft(this,Ms).getDayOfYear(this)}},{key:"weekOfYear",get:function(){if(this.isValid)return 1+~~(this.dayOfYear/7)}},{key:"daysLeft",get:function(){if(this.isValid){var r=ft(this,Ms).yearLength;return(this.isLeap?r+1:r)-this.dayOfYear}}},{key:"year",get:function(){return ft(this,Zo)},set:function(r){ln(this,Zo,Wu(r)),ft(this,Gu).call(this)}},{key:"month",get:function(){return this.months[ft(this,js)]||{}},set:function(r){var i;r=(i=Wu(r.valueOf())-1)!==null&&i!==void 0?i:void 0,ln(this,js,r),Lx(r,0,11)&&ft(this,Gu).call(this)}},{key:"monthIndex",get:function(){return ft(this,js)}},{key:"day",get:function(){return ft(this,ns)},set:function(r){r=Wu(r),ln(this,ns,r),Lx(r,1,28)&&ft(this,Gu).call(this)}},{key:"weekDay",get:function(){if(!this.isValid)return{};var r=(this.toJulianDay()+3)%7;return ft(this,OH).call(this)[r]}},{key:"hour",get:function(){return ft(this,Uu)},set:function(r){r=Wu(r),ln(this,Uu,r),Lx(r,0,23)&&ft(this,Gu).call(this)}},{key:"minute",get:function(){return ft(this,dm)},set:function(r){r=Wu(r),ln(this,dm,r),Lx(r,0,59)&&ft(this,Gu).call(this)}},{key:"second",get:function(){return ft(this,hm)},set:function(r){r=Wu(r),ln(this,hm,r),Lx(r,0,59)&&ft(this,Gu).call(this)}},{key:"millisecond",get:function(){return ft(this,mo)},set:function(r){r=Wu(r),ln(this,mo,r),Lx(r,0,999)&&ft(this,Gu).call(this)}},{key:"months",get:function(){var r=ft(this,Ms).getMonthLengths(this.isLeap),i=(ft(this,Yu).months||ft(this,La).months).map(function(s,a){var u=C0(s,2);return{name:u[0],shortName:u[1],length:r[a],index:a,number:a+1,toString:function(){return this.number.toString()},valueOf:function(){return this.number}}});return i},set:function(r){if(!r)return delete ft(this,Yu).months;S0(r)&&r.length===12&&r.every(function(i){return S0(i)&&i.length===2&&i.every(function(s){return typeof s=="string"})})&&(ft(this,Yu).months=r)}},{key:"weekDays",get:function(){return ft(this,OH).call(this).sort(function(r,i){return r.index-i.index})},set:function(r){if(!r)return delete ft(this,Yu).weekDays;S0(r)&&r.length===7&&r.every(function(i){return S0(i)&&i.length===2&&i.every(function(s){return typeof s=="string"})})&&(ft(this,Yu).weekDays=r)}},{key:"leaps",get:function(){return ft(this,Ms).getLeaps(ft(this,Zo))}},{key:"calendar",get:function(){return ft(this,Ms)},set:function(r){this.convert(r)}},{key:"locale",get:function(){return ft(this,La)},set:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:aY;pg(r)&&ln(this,La,r)}},{key:"custom",get:function(){return ft(this,Yu)}},{key:"meridiems",get:function(){return ft(this,La).meridiems}},{key:"digits",get:function(){return ft(this,Yu).digits||ft(this,La).digits},set:function(r){if(!r)return delete ft(this,Yu).digits;S0(r)&&r.length===10&&(ft(this,Yu).digits=r)}},{key:"_format",get:function(){return ft(this,fm)},set:function(r){typeof r=="string"&&ln(this,fm,r)}},{key:"isLeap",get:function(){return ft(this,Ms).isLeap(ft(this,Zo))}},{key:"isValid",get:function(){return!isNaN(ft(this,Zo))&&!isNaN(ft(this,js))&&!isNaN(ft(this,ns))}},{key:"isUTC",get:function(){return ft(this,$x)}},{key:"unix",get:function(){return(this.valueOf()-this.millisecond)/1e3}},{key:"ignoreList",get:function(){return ft(this,Fx)},set:function(r){S0(r)&&ln(this,Fx,r)}},{key:"weekStartDayIndex",get:function(){return ft(this,Ms).weekStartDayIndex},set:function(r){(r=Wu(r))!==void 0&&(ft(this,Ms).weekStartDayIndex=Math.abs(r)%7)}},{key:"date",set:function(r){this.setDate(r)}}],n&&Zhe(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),nfe=Jhe(efe(tfe));const rfe=nae(Object.freeze(Object.defineProperty({__proto__:null,default:nfe},Symbol.toStringTag,{value:"Module"})));(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=W,n=qhe,r=rfe;function i(X){return X&&typeof X=="object"&&"default"in X?X:{default:X}}var s=i(e),a=i(n),u=i(r);function h(X,de){var Ce=Object.keys(X);if(Object.getOwnPropertySymbols){var Oe=Object.getOwnPropertySymbols(X);de&&(Oe=Oe.filter(function(Ge){return Object.getOwnPropertyDescriptor(X,Ge).enumerable})),Ce.push.apply(Ce,Oe)}return Ce}function m(X){for(var de=1;de<arguments.length;de++){var Ce=arguments[de]!=null?arguments[de]:{};de%2?h(Object(Ce),!0).forEach(function(Oe){g(X,Oe,Ce[Oe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(X,Object.getOwnPropertyDescriptors(Ce)):h(Object(Ce)).forEach(function(Oe){Object.defineProperty(X,Oe,Object.getOwnPropertyDescriptor(Ce,Oe))})}return X}function g(X,de,Ce){return(de=function(Oe){var Ge=function(Qe,se){if(typeof Qe!="object"||Qe===null)return Qe;var ie=Qe[Symbol.toPrimitive];if(ie!==void 0){var J=ie.call(Qe,se);if(typeof J!="object")return J;throw new TypeError("@@toPrimitive must return a primitive value.")}return(se==="string"?String:Number)(Qe)}(Oe,"string");return typeof Ge=="symbol"?Ge:String(Ge)}(de))in X?Object.defineProperty(X,de,{value:Ce,enumerable:!0,configurable:!0,writable:!0}):X[de]=Ce,X}function y(){return y=Object.assign?Object.assign.bind():function(X){for(var de=1;de<arguments.length;de++){var Ce=arguments[de];for(var Oe in Ce)Object.prototype.hasOwnProperty.call(Ce,Oe)&&(X[Oe]=Ce[Oe])}return X},y.apply(this,arguments)}function x(X,de){if(X==null)return{};var Ce,Oe,Ge=function(se,ie){if(se==null)return{};var J,me,Se={},je=Object.keys(se);for(me=0;me<je.length;me++)J=je[me],ie.indexOf(J)>=0||(Se[J]=se[J]);return Se}(X,de);if(Object.getOwnPropertySymbols){var Qe=Object.getOwnPropertySymbols(X);for(Oe=0;Oe<Qe.length;Oe++)Ce=Qe[Oe],de.indexOf(Ce)>=0||Object.prototype.propertyIsEnumerable.call(X,Ce)&&(Ge[Ce]=X[Ce])}return Ge}function C(X,de){return function(Ce){if(Array.isArray(Ce))return Ce}(X)||function(Ce,Oe){var Ge=Ce==null?null:typeof Symbol<"u"&&Ce[Symbol.iterator]||Ce["@@iterator"];if(Ge!=null){var Qe,se,ie,J,me=[],Se=!0,je=!1;try{if(ie=(Ge=Ge.call(Ce)).next,Oe===0){if(Object(Ge)!==Ge)return;Se=!1}else for(;!(Se=(Qe=ie.call(Ge)).done)&&(me.push(Qe.value),me.length!==Oe);Se=!0);}catch(Pe){je=!0,se=Pe}finally{try{if(!Se&&Ge.return!=null&&(J=Ge.return(),Object(J)!==J))return}finally{if(je)throw se}}return me}}(X,de)||M(X,de)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function E(X){return function(de){if(Array.isArray(de))return j(de)}(X)||function(de){if(typeof Symbol<"u"&&de[Symbol.iterator]!=null||de["@@iterator"]!=null)return Array.from(de)}(X)||M(X)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function M(X,de){if(X){if(typeof X=="string")return j(X,de);var Ce=Object.prototype.toString.call(X).slice(8,-1);return Ce==="Object"&&X.constructor&&(Ce=X.constructor.name),Ce==="Map"||Ce==="Set"?Array.from(X):Ce==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ce)?j(X,de):void 0}}function j(X,de){(de==null||de>X.length)&&(de=X.length);for(var Ce=0,Oe=new Array(de);Ce<de;Ce++)Oe[Ce]=X[Ce];return Oe}function L(X,de){var Ce=typeof Symbol<"u"&&X[Symbol.iterator]||X["@@iterator"];if(!Ce){if(Array.isArray(X)||(Ce=M(X))||de){Ce&&(X=Ce);var Oe=0,Ge=function(){};return{s:Ge,n:function(){return Oe>=X.length?{done:!0}:{done:!1,value:X[Oe++]}},e:function(J){throw J},f:Ge}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Qe,se=!0,ie=!1;return{s:function(){Ce=Ce.call(X)},n:function(){var J=Ce.next();return se=J.done,J},e:function(J){ie=!0,Qe=J},f:function(){try{se||Ce.return==null||Ce.return()}finally{if(ie)throw Qe}}}}function D(X){return Array.isArray(X)}function z(X){var de=X.state.date,Ce=de.calendar,Oe=de.locale,Ge=X.customWeekDays,Qe=X.weekStartDayIndex,se=X.displayWeekNumbers,ie=X.weekNumber,J=e.useMemo(function(){var me=Ge;return D(me)&&me.length>=7?(me.length=7,me=me.map(function(Se){return D(Se)&Se.length>1?Se=Se[1]:D(Se)&&(Se=Se[0]),Se})):me=new u.default({year:1,calendar:Ce,locale:Oe}).weekDays.map(function(Se){return Se.shortName}),me},[Ce,Oe,Ge]);return J=E(J).slice(Qe).concat(E(J).splice(0,Qe)),s.default.createElement("div",{className:"rmdp-week"},se&&s.default.createElement("div",{className:"rmdp-week-day"},ie),J.map(function(me,Se){return s.default.createElement("div",{key:Se,className:"rmdp-week-day"},me)}))}function H(X,de){var Ce=arguments.length>2&&arguments[2]!==void 0&&arguments[2],Oe=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!X||!de)return!1;if(X.year===de.year){if(Oe)return!0;if(X.monthIndex===de.monthIndex)return!!Ce||X.day===de.day}}function V(X){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"YYYY/MM/DD";return X.format(de)}function F(X,de,Ce){var Oe=Ce.multiple,Ge=Ce.range,Qe=Ce.selectedDate,se=Ce.onlyMonthPicker,ie=Ce.onlyYearPicker,J=Ce.format,me=Ce.focused,Se=Ce.weekPicker;X.setFormat(J);var je=new u.default(X);return Qe=Oe&&Ge?function(){var Pe=!0;D(Qe)||(Qe=[[Qe]]);var ut=Qe.find(function(sn){return sn.length===1}),wt=se?"YYYY/MM":"YYYY/MM/DD",kt=Qe;if(ut){var Rt=ut[0];kt=kt.filter(function(sn){if(sn.length===1)return!0;var jn=C(sn,2),An=jn[0],Jn=jn[1],Qt=C([Rt,je].sort(function(en,tn){return en-tn}),2),Gt=[An,Jn,Qt[0],Qt[1]].map(function(en){return V(en,wt)}),ir=C(Gt,4),kn=ir[0],Kt=ir[1],zt=ir[2],Wt=ir[3];return!(zt<=kn&&Wt>=Kt||zt>=kn&&Wt>=Kt&&zt<=Kt||zt<=kn&&Wt<=Kt&&Wt>=kn)})}else kt=kt.filter(function(sn){if(!D(sn))return!0;if(sn.length===0)return!1;var jn=C(sn,2),An=[jn[0],jn[1],je].map(function(kn){return V(kn,wt)}),Jn=C(An,3),Qt=Jn[0],Gt=Jn[1],ir=Jn[2];return!(ir>=Qt&&ir<=Gt)});return kt=kt.map(function(sn){var jn;return D(sn)?sn.length===1?(Pe=!1,jn=sn.concat(je)):jn=sn:(Pe=!1,jn=[sn,je]),jn.sort(function(An,Jn){return An-Jn})}),Pe&&(kt=[].concat(E(kt),[[je]])),kt}():Oe?function(){var Pe=Qe.filter(function(ut){return!H(X,ut,se,ie)});return Pe.length===Qe.length?Pe.push(je):je=Pe.find(function(ut){return H(ut,me)}),de&&Pe.sort(function(ut,wt){return ut-wt}),Pe}():Ge?function(){if(Se)return[new u.default(je).toFirstOfWeek(),new u.default(je).toLastOfWeek()];if(Qe.length===2||Qe.length===0)return[je];if(Qe.length===1)return[Qe[0],je].sort(function(Pe,ut){return Pe-ut})}():je,[Qe,je]}function B(X,de,Ce,Oe){var Ge=[],Qe=Ce?"YYYY/MM":"YYYY/MM/DD",se=V(X,Qe);function ie(J){var me=J[0],Se=J[1];if(J.length===1)H(X,me,Ce)&&Ge.push("rmdp-range");else if(J.length===2){var je=[me,Se].map(function(kt){return V(kt,Qe)}),Pe=C(je,2),ut=Pe[0],wt=Pe[1];se>=ut&&se<=wt&&Ge.push("rmdp-range"),se===ut&&Ge.push("start"),se===wt&&Ge.push("end")}}return Oe?(D(de)?de:[[de]]).forEach(ie):ie(de),Ge.join(" ")}function te(X,de,Ce,Oe){var Ge=arguments.length>5?arguments[5]:void 0,Qe=[];if(Oe&&Ce){var se,ie=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:"day")==="day"?"YYYY/MM/DD":"YYYY/MM",J=Ce.format(ie),me=X.format(ie);if(Ge||(de==null?void 0:de.length)!==1){if(Ge&&D(de)){var Se,je=L(de);try{for(je.s();!(Se=je.n()).done;){var Pe=Se.value;if(D(Pe)&&Pe.length===1){se=Pe[0].format(ie);break}}}catch(ut){je.e(ut)}finally{je.f()}}}else se=de[0].format(ie);(me>se&&me<=J||me<se&&me>=J)&&(Qe.push("rmdp-range-hover"),me===J&&Qe.push(J>se?"end":"start"),D(de)&&de.flat().some(function(ut){return ut.format(ie)===me})&&Qe.push("force"))}return Qe}function ve(X,de,Ce){if(X){var Oe=ce(X);return Ce?Array.from(Oe.querySelectorAll(de)):Oe.querySelector(de)}}function ce(X){return X.closest(".rmdp-calendar")}var _e=["selected","today","day:not(.rmdp-day-hidden):not(.rmdp-disabled)"];function pe(X,de,Ce){var Oe=Ce.type,Ge=Oe===void 0?"day":Oe,Qe=Ce.format;X.preventDefault();var se=X.currentTarget,ie=X.key,J=X.code,me=Ge==="day"?7:3,Se=ce(se),je=Se&&Se.classList.contains("rmdp-rtl"),Pe={ArrowRight:je?-1:1,ArrowLeft:je?1:-1,ArrowUp:-me,ArrowDown:me};if(J==="Space"||ie===" ")se.click();else if(Object.keys(Pe).includes(ie)){var ut=function(){if(Ge==="month")return Le(Se,[_e[2]]);var sn=ve(se,wt<0?".rmdp-left":".rmdp-right");sn&&(sn.click(),Le(Se))},wt=Pe[ie],kt=new u.default(de.date).add(wt,Ge);(function(sn){if(!sn)return ut();var jn=sn.getAttribute("class");jn.includes("hidden")||jn.includes("disabled")?pe(X,m(m({},de),{},{date:kt}),{type:Ge,format:Qe}):sn.focus()})(ve(se,'[aria-label*="'.concat(de.year?"year ".concat(de.year+wt):kt.format(Qe),'"]')))}else{var Rt=ve(se,".rmdp-arrow-container");Rt&&Rt.focus()}}function Le(X){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_e,Ce=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],Oe="[data-active='true']";X.querySelectorAll("".concat(Oe," [tabindex='0']")).forEach(function(Ge){return Ge.setAttribute("tabindex","-1")}),setTimeout(function(){var Ge,Qe=L(de);try{for(Qe.s();!(Ge=Qe.n()).done;){var se=Ge.value,ie=X.querySelector("".concat(Oe," .rmdp-").concat(se));if(ie){ie.setAttribute("tabindex","0"),Ce&&ie.focus();break}}}catch(J){Qe.e(J)}finally{Qe.f()}},10)}var Fe="dddd MMMM DD of YYYY";function nt(X){var de=X.state,Ce=X.onChange,Oe=X.showOtherDays,Ge=Oe!==void 0&&Oe,Qe=X.mapDays,se=X.onlyShowInRangeDates,ie=X.customWeekDays,J=X.sort,me=X.numberOfMonths,Se=X.isRTL,je=X.weekStartDayIndex,Pe=X.handleFocusedDate,ut=X.hideWeekDays,wt=X.fullYear,kt=C(X.monthAndYears,1)[0],Rt=X.displayWeekNumbers,sn=X.weekNumber,jn=sn===void 0?"":sn,An=X.rangeHover,Jn=X.highlightToday,Qt=e.useRef({}),Gt=e.useRef(),ir=de.today,kn=de.minDate,Kt=de.maxDate,zt=de.range,Wt=de.multiple,en=de.date,tn=de.selectedDate,mn=de.onlyMonthPicker,dn=de.onlyYearPicker,Ne=de.mustShowMonthPicker,oe=de.mustShowYearPicker,Ae=!mn&&!dn,Je=C(e.useState(),2),vt=Je[0],Vt=Je[1];Qt.current.date=en;var $t=e.useMemo(function(){return Ae?function(Ft,Ct,ge,ct){if(!Ft)return[];for(var xt=[],Bn=0;Bn<ge;Bn++){var vn=(Ft=new u.default(Ft).toFirstOfMonth()).monthIndex,Sn=[];Ft.toFirstOfWeek().add(ct,"day"),Ft.monthIndex===vn&&Ft.day>1&&Ft.subtract(7,"days");for(var Bt=0;Bt<6;Bt++){for(var Tr=[],dr=0;dr<7;dr++)Tr.push({date:new u.default(Ft),day:Ft.format("D"),current:Ft.monthIndex===vn}),Ft.day+=1;if(Sn.push(Tr),Bt>2&&Ft.monthIndex!==vn)break}xt.push(Sn)}return xt}(Qt.current.date,0,me,je):[]},[en.monthIndex,en.year,en.calendar,en.locale,Ae,Ge,me,je]);return Ae&&s.default.createElement("div",{ref:Gt,className:"rmdp-day-picker ".concat(wt?"rmdp-full-year":""),style:{display:wt?"grid":"flex"},onMouseLeave:function(){return An&&Vt()},"data-active":Ae&&!Ne&&!oe},$t.map(function(Ft,Ct){return s.default.createElement("div",{key:Ct,style:g({},Se?"marginLeft":"marginRight",Ct+(wt?0:1)<me?"10px":"")},wt&&s.default.createElement("div",{className:"rmdp-month-name"},kt[Ct]),!ut&&s.default.createElement(z,{state:de,customWeekDays:ie,weekStartDayIndex:je,displayWeekNumbers:Rt,weekNumber:jn}),Ft.map(function(ge,ct){return s.default.createElement("div",{key:ct,className:"rmdp-week"},Rt&&s.default.createElement("div",{className:"rmdp-day rmdp-disabled"},s.default.createElement("span",null,ge[0].date.format("WW"))),ge.map(function(xt,Bn){var vn=function(Sr){if(!Sr.current&&!Ge)return{};var In={};return Qe.forEach(function(ni){var Fr,Vi=ni({date:Sr.date,today:ir,currentMonth:de.date.month,selectedDate:de.selectedDate,isSameDate:H});((Fr=Vi)===null||Fr===void 0?void 0:Fr.constructor)!==Object&&(Vi={}),(Vi.disabled||Vi.hidden)&&(Sr.disabled=!0),Vi.hidden&&(Sr.hidden=!0),In=m(m({},In),Vi)}),delete In.disabled,delete In.hidden,In}(xt={date:xt.date,day:xt.day,current:xt.current}),Sn=jt(xt)&&!xt.disabled,Bt="".concat(Sn?"sd":""),Tr=vn.children;Sn&&(Bt="".concat(Bt," ").concat(vn.className||"")),delete vn.className,delete vn.children;var dr=function(Sr,In){var ni=["rmdp-day"],Fr=Sr.date,Vi=Sr.hidden,Bi=Sr.current;if(!jt(Sr)||Vi)ni.push("rmdp-day-hidden");else{(kn&&Fr<kn||Kt&&Fr>Kt||Sr.disabled)&&(ni.push("rmdp-disabled"),Sr.disabled||(Sr.disabled=!0)),Bi||ni.push("rmdp-deactive");var Lo=In>1&&Bi||In===1;Sr.disabled&&se||(H(Fr,ir)&&Jn&&ni.push("rmdp-today"),aa=Fr,[].concat(tn).some(function($o){return H($o,aa)})&&Lo&&!zt&&ni.push("rmdp-selected")),zt&&!Sr.disabled&&Lo&&(ni.push(B(Fr,tn,void 0,Wt)),ni=ni.concat(te(Fr,tn,vt,An,void 0,Wt)))}var aa;return ni.join(" ")}(xt,me);return(xt.hidden||xt.disabled)&&(Bt=Bt.replace("sd","")),s.default.createElement("div",{key:Bn,tabIndex:-1,"aria-label":"Choose ".concat(xt.date.format(Fe)),className:dr,onMouseEnter:function(){return An&&Vt(xt.date)},onKeyDown:function(Sr){return pe(Sr,xt,{format:Fe})},onClick:function(){jt(xt)&&!xt.disabled&&function(Sr,In,ni){var Fr,Vi,Bi,Lo=Sr.date,aa=Sr.current,$o=de.selectedDate,Fo=de.focused,ps=de.date,gs=ps,zo=gs.hour,xl=gs.minute,wl=gs.second;Lo.set({hour:((Fr=$o)===null||Fr===void 0?void 0:Fr.hour)||zo,minute:((Vi=$o)===null||Vi===void 0?void 0:Vi.minute)||xl,second:((Bi=$o)===null||Bi===void 0?void 0:Bi.second)||wl}),ni!==1||aa?ni>1&&!aa&&(In===0&&Lo<ps&&(ps=new u.default(ps).toFirstOfMonth()),In>0&&Lo.monthIndex>ps.monthIndex+In&&In+1===ni&&(ps=new u.default(ps).toFirstOfMonth().add(1,"month"))):ps=new u.default(ps).toFirstOfMonth();var Vo=C(F(Lo,J,de),2);$o=Vo[0],Fo=Vo[1],Ce($o,m(m({},de),{},{date:ps,focused:Fo,selectedDate:$o})),Pe(Fo,Lo)}(xt,Ct,me)}},s.default.createElement("span",y({className:Bt},vn),jt(xt)&&!xt.hidden?Tr??xt.day:""))}))}))}));function jt(Ft){return!!Ft.current||Ge}}function dt(X){var de=X.direction,Ce=X.onClick,Oe=X.disabled,Ge=X.onKeyDown;return s.default.createElement("button",{type:"button",className:"rmdp-arrow-container ".concat(de," ").concat(Oe?"disabled":""),onClick:Ce,onKeyDown:Ge,"aria-roledescription":"button to navigate ".concat(de.replace("rmdp-",""))},s.default.createElement("i",{className:"rmdp-arrow"}))}function $e(X){var de=X.state,Ce=X.setState,Oe=X.disableYearPicker,Ge=X.disableMonthPicker,Qe=X.buttons,se=X.renderButton,ie=X.handleMonthChange,J=X.disabled,me=X.hideMonth,Se=X.hideYear,je=X.isRTL,Pe=X.fullYear,ut=C(X.monthAndYears,2),wt=ut[0],kt=ut[1],Rt=X.monthYearSeparator,sn=X.formatMonth,jn=X.formatYear,An=X.headerOrder,Jn=X.onYearChange,Qt={},Gt=de.date,ir=de.onlyMonthPicker,kn=de.onlyYearPicker,Kt=de.mustShowYearPicker,zt=de.minDate,Wt=de.maxDate,en=de.year,tn=de.today,mn=zt&&Gt.year<=zt.year&&zt.monthIndex>Gt.monthIndex-1,dn=Wt&&Gt.year>=Wt.year&&Wt.monthIndex<Gt.monthIndex+1,Ne=tn.year+7;if(Ne-=12*Math.floor((Ne-en)/12),(me||Pe)&&Se&&!Qe)return null;if((ir||Pe)&&(zt&&zt.year>=Gt.year&&(mn=!0),Wt&&Wt.year<=Gt.year&&(dn=!0)),Kt||kn){var oe=Ne-11;mn=zt&&zt.year>oe,dn=Wt&&Wt.year<Ne}return J&&(mn=!0,dn=!0),s.default.createElement("div",{className:"rmdp-header"},s.default.createElement("div",{style:{position:"relative",display:"flex",alignItems:"center"}},Array.from(new Set(An)).map(function(jt,Ft){return s.default.createElement(e.Fragment,{key:Ft},function(Ct){switch(Ct){case"LEFT_BUTTON":return Qe&&vt("left");case"RIGHT_BUTTON":return Qe&&vt("right");case"MONTH_YEAR":case"YEAR_MONTH":if(Pe)return s.default.createElement("div",{className:"rmdp-header-values",style:Qt},!Se&&Gt.format("YYYY"));var ge=Ct.split("_").filter(function(ct){return ct==="MONTH"&&!me||ct==="YEAR"&&!Se});return ge.length>1&&(ge=[ge[0],Je(),ge[1]]),wt.map(function(ct,xt){return s.default.createElement("div",{key:xt,className:"rmdp-header-values",style:Qt},ge.map(function(Bn,vn){return s.default.createElement(e.Fragment,{key:vn},function(Sn,Bt,Tr){switch(Sn){case"MONTH":return s.default.createElement("span",{tabIndex:0,onKeyDown:Ae,style:{cursor:J||Ge||ir?"default":"pointer"},onClick:function(dr){return!Ge&&$t("mustShowMonthPicker",dr)}},function(dr,Sr){return typeof sn=="function"?sn(dr,Sr):dr}(Bt,kt[Tr]));case"YEAR":return s.default.createElement("span",{tabIndex:0,onKeyDown:Ae,style:{cursor:J||Oe||kn?"default":"pointer"},onClick:function(dr){return!Oe&&$t("mustShowYearPicker",dr)}},function(dr,Sr){return typeof sn=="function"?jn(dr,Sr):dr}(kt[Tr],Bt));default:return Sn}}(Bn,ct,xt))}))});default:return}}(jt))})));function Ae(jt){var Ft=jt.currentTarget,Ct=jt.key,ge=jt.code;ge==="Space"||Ct===" "?(jt.preventDefault(),Ft.click()):ge==="ArrowDown"&&(jt.preventDefault(),Le(ce(jt.target)))}function Je(){return Rt?s.default.createElement("span",null,Rt):je?"،":","}function vt(jt){var Ft=function(ge){ge.preventDefault(),Vt(jt==="right"?1:-1,ge)},Ct=jt==="left"&&mn||jt==="right"&&dn;return se instanceof Function?se(jt,Ft,Ct,Ae):e.isValidElement(se)?e.cloneElement(se,{direction:jt,handleClick:Ft,disabled:Ct,onKeyDown:Ae}):s.default.createElement(dt,{direction:"rmdp-".concat(jt),onClick:Ft,onKeyDown:Ae,disabled:Ct})}function Vt(jt,Ft){J||jt<0&&mn||jt>0&&dn||(Pe?(Gt.year+=jt,Jn==null||Jn(new u.default(Gt))):Kt||kn?(en+=12*jt,jt<0&&zt&&en<zt.year&&(en=zt.year),jt>0&&Wt&&en>Wt.year&&(en=Wt.year)):(Gt.toFirstOfMonth(),ir?Gt.year+=jt:(Gt.month+=jt,ie(Gt))),Ce(m(m({},de),{},{date:Gt,year:en})),Le(ce(Ft.target),void 0,!1))}function $t(jt,Ft){if(!J){var Ct={mustShowMonthPicker:!1,mustShowYearPicker:!1};Ct[jt]=!de[jt],Ce(m(m({},de),Ct)),Le(ce(Ft.target),void 0,!1)}}}function Re(X){return D(X)||(X=[]),JSON.stringify(X)}var Ze="MMMM of YYYY";function Ee(X){var de=X.state,Ce=X.onChange,Oe=X.customMonths,Ge=X.sort,Qe=X.handleMonthChange,se=X.handleFocusedDate,ie=X.rangeHover,J=X.highlightToday,me=X.numberOfMonths,Se=de.date,je=de.today,Pe=de.minDate,ut=de.maxDate,wt=de.calendar,kt=de.locale,Rt=de.onlyMonthPicker,sn=de.onlyYearPicker,jn=de.range,An=de.onlyShowInRangeDates,Jn=(de.mustShowMonthPicker||Rt)&&!sn,Qt=C(e.useState(),2),Gt=Qt[0],ir=Qt[1];Oe=Oe&&Re(Oe);var kn=e.useMemo(function(){var Wt=[],en=Rt?me:1,tn=Oe&&JSON.parse(Oe),mn=new u.default({calendar:wt,locale:kt,format:de.date._format,year:de.date.year,month:1,day:1});D(tn)&&tn.length>=12?(tn.length=12,tn=tn.map(function(Vt){return D(Vt)?Vt[0]:Vt})):tn=mn.locale.months.map(function(Vt){return C(Vt,1)[0]});for(var dn=0;dn<en;dn++){for(var Ne=[],oe=0,Ae=0;Ae<4;Ae++){for(var Je=[],vt=0;vt<3;vt++)Je.push({date:new u.default(mn),name:tn[oe]}),oe++,mn.add(1,"month");Ne.push(Je)}Wt.push(Ne)}return Wt},[wt,kt,Oe,de.date.year,de.date._format,me,Rt]);return s.default.createElement("div",{className:"".concat(Rt?"only ":"","rmdp-month-picker"),style:{display:Jn?"flex":"none"},"data-active":Jn,onMouseLeave:function(){return ie&&ir()}},kn.map(function(Wt,en){return s.default.createElement("div",{key:en,style:{margin:"0 5px",flex:1}},Wt.map(function(tn,mn){return s.default.createElement("div",{key:mn,className:"rmdp-ym"},tn.map(function(dn,Ne){var oe=dn.date,Ae=dn.name;return s.default.createElement("div",{key:Ne,"aria-label":"Select ".concat(oe.format(Ze)),tabIndex:-1,onKeyDown:function(Je){return pe(Je,{date:oe},{format:Ze,type:"month"})},className:zt(oe),onClick:function(Je){return Kt(oe,Je)},onMouseEnter:function(){return ie&&ir(oe)}},s.default.createElement("span",{className:Rt?"sd":""},Ae))}))}))}));function Kt(Wt,en){var tn=de.selectedDate,mn=de.focused,dn=Wt.year,Ne=Wt.monthIndex;if(!(Pe&&dn<=Pe.year&&Ne<Pe.monthIndex||ut&&dn>=ut.year&&Ne>ut.monthIndex)){if(Se.setMonth(Ne+1),Rt){var oe=C(F(Wt,Ge,de),2);tn=oe[0],mn=oe[1]}else Qe(Se),Le(ce(en.target));Ce(Rt?tn:void 0,m(m({},de),{},{date:Se,focused:mn,selectedDate:tn,mustShowMonthPicker:!1})),Rt&&se(mn,Wt)}}function zt(Wt){var en=["rmdp-day"],tn=Wt.year,mn=Wt.monthIndex,dn=de.selectedDate,Ne=de.multiple;if((Pe&&(tn<Pe.year||tn===Pe.year&&mn<Pe.monthIndex)||ut&&(tn>ut.year||tn===ut.year&&mn>ut.monthIndex))&&en.push("rmdp-disabled"),!en.includes("rmdp-disabled")||!An)return H(je,Wt,!0)&&J&&en.push("rmdp-today"),Rt?jn?(en.push(B(Wt,dn,!0,Ne)),en=en.concat(te(Wt,dn,Gt,ie,"month",Ne))):[].concat(dn).some(function(oe){return H(oe,Wt,!0)})&&en.push("rmdp-selected"):Se.monthIndex===mn&&en.push("rmdp-selected"),en.join(" ")}}function Q(X,de){return X.replace(/[0-9]/g,function(Ce){return de[Ce]})}var fe="YYYY";function Ve(X){var de=X.state,Ce=X.onChange,Oe=X.sort,Ge=X.handleFocusedDate,Qe=X.onYearChange,se=X.rangeHover,ie=X.highlightToday,J=de.date,me=de.today,Se=de.minDate,je=de.maxDate,Pe=de.onlyYearPicker,ut=de.range,wt=de.onlyShowInRangeDates,kt=de.year,Rt=de.mustShowYearPicker||Pe,sn=J.digits,jn=C(e.useState(),2),An=jn[0],Jn=jn[1],Qt=me.year-4;Qt-=12*Math.ceil((Qt-kt)/12);var Gt=e.useMemo(function(){for(var Kt=[],zt=Qt,Wt=0;Wt<4;Wt++){for(var en=[],tn=0;tn<3;tn++)en.push(zt),zt++;Kt.push(en)}return Kt},[Qt]);return s.default.createElement("div",{className:"".concat(Pe?"only ":"","rmdp-year-picker"),style:{display:Rt?"block":"none"},"data-active":Rt},Gt.map(function(Kt,zt){return s.default.createElement("div",{key:zt,className:"rmdp-ym",onMouseLeave:function(){return se&&Jn()}},Kt.map(function(Wt,en){return s.default.createElement("div",{key:en,"aria-label":"Select year ".concat(Wt),tabIndex:-1,onKeyDown:function(tn){return pe(tn,{year:Wt,date:J},{format:fe,type:"year"})},className:ir(Wt),onClick:function(tn){return function(mn,dn){if(!kn(mn)){var Ne=new u.default(de.date).setYear(mn),oe=de.selectedDate,Ae=de.focused;if(Pe){var Je=C(F(Ne,Oe,de),2);oe=Je[0],Ae=Je[1]}else Se&&Ne.monthIndex<Se.monthIndex?Ne=Ne.setMonth(Se.monthIndex+1):je&&Ne.monthIndex>je.monthIndex&&(Ne=Ne.setMonth(je.monthIndex+1)),Qe==null||Qe(Ne),Le(ce(dn.target));Ce(Pe?oe:void 0,m(m({},de),{},{date:Ne,focused:Ae,selectedDate:oe,mustShowYearPicker:!1})),Pe&&Ge(Ae,Ne)}}(Wt,tn)},onMouseEnter:function(){return se&&Jn(Wt)}},s.default.createElement("span",{className:Pe?"sd":""},Q(Wt.toString(),sn)))}))}));function ir(Kt){var zt=["rmdp-day"],Wt=de.date,en=de.selectedDate,tn=de.multiple;if(kn(Kt)&&zt.push("rmdp-disabled"),!zt.includes("rmdp-disabled")||!wt){if(me.year===Kt&&ie&&zt.push("rmdp-today"),Pe)if(ut){var mn=function(dn){var Ne=dn[0],oe=dn[1];if(dn.length===1){if(Kt===Ne.year&&zt.push("rmdp-range"),se){var Ae=dn[0].year;(Kt>Ae&&Kt<=An||Kt<Ae&&Kt>=An)&&(zt.push("rmdp-range-hover"),Kt===An&&zt.push(An>Ae?"end":"start"))}}else dn.length===2&&(Kt>=Ne.year&&Kt<=oe.year&&zt.push("rmdp-range"),Kt===Ne.year&&zt.push("start"),Kt===oe.year&&zt.push("end"))};tn?(D(en)?en:[[en]]).forEach(function(dn){return mn(dn)}):mn(en)}else[].concat(en).some(function(dn){return dn&&dn.year===Kt})&&zt.push("rmdp-selected");else Kt===Wt.year&&zt.push("rmdp-selected");return zt.join(" ")}}function kn(Kt){return Se&&Kt<Se.year||je&&Kt>je.year}}function ne(X,de,Ce){return Ce||(X?"MM/YYYY":de?"YYYY":"YYYY/MM/DD")}function xe(X,de){var Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"YYYY/MM/DD";return X instanceof u.default?X.set({calendar:de,format:Ce}):X=new u.default({date:X,calendar:de,format:Ce}),X}function Ke(X){"_self"in s.default.createElement("div")&&console.warn(X.join(` `))}var qe=new u.default,we=qe.calendar,k=qe.locale;function _(X,de){return X&&X.constructor!==Object&&(Ke(N("calendar")),X=void 0),de&&de.constructor!==Object&&(Ke(N("locale")),de=void 0),[X||we,de||k]}function N(X){return["".concat(X," must be an object"),"https://shahabyazdi.github.io/react-multi-date-picker/calendars/"]}function O(X){return X&&X.name?X.name.split("_")[1]:""}function G(X){return["fa","ar"].includes(O(X))}function q(X,de){de===void 0&&(de={});var Ce=de.insertAt;if(X&&typeof document<"u"){var Oe=document.head||document.getElementsByTagName("head")[0],Ge=document.createElement("style");Ge.type="text/css",Ce==="top"&&Oe.firstChild?Oe.insertBefore(Ge,Oe.firstChild):Oe.appendChild(Ge),Ge.styleSheet?Ge.styleSheet.cssText=X:Ge.appendChild(document.createTextNode(X))}}q(".rmdp-wrapper{background-color:#fff;border-radius:5px;direction:ltr;text-align:center;width:max-content}.rmdp-shadow{box-shadow:0 0 5px #8798ad}.rmdp-border{border:1px solid #cfd8e2}.rmdp-calendar{height:max-content;padding:4px}.rmdp-border-top{border-top:1px solid #cfd8e2}.rmdp-border-bottom{border-bottom:1px solid #cfd8e2}.rmdp-border-left{border-left:1px solid #cfd8e2}.rmdp-border-right{border-right:1px solid #cfd8e2}.rmdp-week,.rmdp-ym{display:flex;justify-content:space-between}.rmdp-ym{height:25%}.rmdp-day,.rmdp-week-day{color:#000;cursor:pointer;height:34px;position:relative;width:34px}.rmdp-calendar :focus{outline-color:#00539c}.rmdp-day:not(.rmdp-range):focus{border-radius:50%}.rmdp-ym .rmdp-day:not(.rmdp-range):focus{border-radius:15px}.rmdp-week-day{color:#0074d9;cursor:default;font-size:13px;font-weight:500}.rmdp-day span,.rmdp-week-day{display:flex;flex-direction:column;justify-content:center}.rmdp-day span{border-radius:50%;bottom:3px;font-size:14px;left:3px;position:absolute;right:3px;top:3px}.rmdp-day.rmdp-today span{background-color:#7fdbff;color:#fff}.rmdp-day.rmdp-selected span:not(.highlight){background-color:#0074d9;box-shadow:0 0 3px #8798ad;color:#fff}.rmdp-day.rmdp-deactive,.rmdp-day.rmdp-disabled{color:#8798ad}.rmdp-day.rmdp-deactive.rmdp-selected span{background-color:#4ca6f5;box-shadow:0 0 3px #bac5d3}.rmdp-ym .rmdp-day{flex:1;margin:auto}.rmdp-ym .rmdp-day span{border-radius:12px;padding:2px 0}.rmdp-range{background-color:#0074d9;box-shadow:0 0 3px #8798ad;color:#fff}.rmdp-range-hover{background-color:#7ea6f0;color:#fff}.rmdp-range-hover.start:not(.force),.rmdp-range.start:not(.force){border-bottom-left-radius:50%;border-top-left-radius:50%}.rmdp-range-hover.end:not(.force),.rmdp-range.end:not(.force){border-bottom-right-radius:50%;border-top-right-radius:50%}.rmdp-ym .rmdp-range-hover.start:not(.force),.rmdp-ym .rmdp-range.start:not(.force){border-bottom-left-radius:15px;border-top-left-radius:15px}.rmdp-ym .rmdp-range-hover.end:not(.force),.rmdp-ym .rmdp-range.end:not(.force){border-bottom-right-radius:15px;border-top-right-radius:15px}@media (hover:hover){.rmdp-day:not(.rmdp-disabled,.rmdp-day-hidden) span:hover{background-color:#7ea6f0;color:#fff}}.rmdp-day-picker{padding:5px}.rmdp-header{font-size:14px;margin-top:5px;padding:9px 0}.rmdp-month-picker,.rmdp-year-picker{background-color:#fff;border-radius:0 0 5px 5px;bottom:2px;left:2px;position:absolute;right:2px;top:2px}.only.rmdp-month-picker,.only.rmdp-year-picker{height:240px;position:static;width:240px}.rmdp-header-values{color:#000;margin:auto}.rmdp-header-values span{padding:0 0 0 5px}.rmdp-arrow{border:solid #0074d9;border-width:0 2px 2px 0;display:inline-block;height:3px;margin-top:5px;padding:2px;width:3px}.rmdp-right i{margin-right:3px;transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}.rmdp-left i{margin-left:3px;transform:rotate(135deg);-webkit-transform:rotate(135deg)}.rmdp-left{left:0}.rmdp-right{right:0}.rmdp-arrow-container{background:transparent;border:none;border-radius:50%;cursor:pointer;display:flex;height:20px;justify-content:center;margin:0 5px;padding:0;width:20px}.rmdp-arrow-container:hover{background-color:#0074d9;box-shadow:0 0 3px #8798ad}.rmdp-arrow-container:hover .rmdp-arrow{border:solid #fff;border-width:0 2px 2px 0}.rmdp-arrow-container.disabled{cursor:default}.rmdp-arrow-container.disabled:hover{background-color:inherit;box-shadow:inherit}.rmdp-arrow-container.disabled .rmdp-arrow,.rmdp-arrow-container.disabled:hover .rmdp-arrow{border:solid gray;border-width:0 2px 2px 0}.rmdp-rtl{direction:rtl}.rmdp-rtl .rmdp-left i{margin-left:0;margin-right:3px;transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}.rmdp-rtl .rmdp-right i{margin-left:3px;margin-right:0;transform:rotate(135deg);-webkit-transform:rotate(135deg)}.rmdp-rtl .rmdp-right{left:0;right:auto}.rmdp-rtl .rmdp-left{left:auto;right:0}.rmdp-rtl .rmdp-range-hover.start:not(.force),.rmdp-rtl .rmdp-range.start:not(.force){border-bottom-left-radius:unset;border-bottom-right-radius:50%;border-top-left-radius:unset;border-top-right-radius:50%}.rmdp-rtl .rmdp-range-hover.end:not(.force),.rmdp-rtl .rmdp-range.end:not(.force){border-bottom-left-radius:50%;border-bottom-right-radius:unset;border-top-left-radius:50%;border-top-right-radius:unset}.rmdp-rtl .rmdp-range.start.end:not(.force){border-radius:50%}.rmdp-rtl .rmdp-ym .rmdp-range-hover.start:not(.force),.rmdp-rtl .rmdp-ym .rmdp-range.start:not(.force){border-bottom-right-radius:15px;border-top-right-radius:15px}.rmdp-rtl .rmdp-ym .rmdp-range-hover.end:not(.force),.rmdp-rtl .rmdp-ym .rmdp-range.end:not(.force){border-bottom-left-radius:15px;border-top-left-radius:15px}.rmdp-day-hidden,.rmdp-day.rmdp-disabled{cursor:default}.rmdp-selected .highlight{box-shadow:0 0 3px #8798ad}.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) .highlight-red:hover{background-color:#ff6687}.rmdp-day:not(.rmdp-deactive) .highlight-red{color:#cc0303}.rmdp-day.rmdp-deactive .highlight-red{color:#e08e8e}.rmdp-day.rmdp-selected .highlight-red{background-color:#ea0034;color:#fff}.rmdp-day.rmdp-deactive.rmdp-selected .highlight-red{background-color:#e4b0ba;color:#fff}.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) .highlight-green:hover{background-color:#4db6ac}.rmdp-day:not(.rmdp-deactive) .highlight-green{color:#00796b}.rmdp-day.rmdp-deactive .highlight-green{color:#7ab3ac}.rmdp-day.rmdp-selected .highlight-green{background-color:#009688;color:#fff}.rmdp-day.rmdp-deactive.rmdp-selected .highlight-green{background-color:#749c98;color:#fff}.rmdp-day-hidden,.rmdp-day-hidden:hover span{background-color:unset;color:transparent}.rmdp-month-name{cursor:default;font-size:14px;margin:3px 0}.rmdp-full-year{grid-template-columns:1fr 1fr 1fr}@media (max-height:450px),(max-width:450px){.rmdp-day,.rmdp-week-day{height:28px;width:28px}.rmdp-day span{font-size:12px;padding-left:.5px}.only.rmdp-month-picker,.only.rmdp-year-picker{height:200px;width:230px}.rmdp-header{padding:3px 0 0}.rmdp-header,.rmdp-month-name{font-size:12px}.rmdp-full-year{grid-template-columns:1fr 1fr}}");var I=["datePickerProps","DatePicker"];function Z(X,de){var Ce,Oe=X.value,Ge=X.calendar,Qe=X.locale,se=X.format,ie=X.onlyMonthPicker,J=X.onlyYearPicker,me=X.range,Se=me!==void 0&&me,je=X.multiple,Pe=je!==void 0&&je,ut=X.className,wt=X.role,kt=X.weekDays,Rt=X.months,sn=X.children,jn=X.onChange,An=X.showOtherDays,Jn=X.minDate,Qt=X.maxDate,Gt=X.mapDays,ir=X.disableMonthPicker,kn=X.disableYearPicker,Kt=X.formattingIgnoreList,zt=X.onReady,Wt=X.onlyShowInRangeDates,en=Wt===void 0||Wt,tn=X.zIndex,mn=tn===void 0?100:tn,dn=X.plugins,Ne=dn===void 0?[]:dn,oe=X.sort,Ae=X.numberOfMonths,Je=Ae===void 0?1:Ae,vt=X.currentDate,Vt=X.digits,$t=X.buttons,jt=$t===void 0||$t,Ft=X.renderButton,Ct=X.weekStartDayIndex,ge=Ct===void 0?0:Ct,ct=X.disableDayPicker,xt=X.onPropsChange,Bn=X.onMonthChange,vn=X.onYearChange,Sn=X.onFocusedDateChange,Bt=X.readOnly,Tr=X.disabled,dr=X.hideMonth,Sr=X.hideYear,In=X.hideWeekDays,ni=X.shadow,Fr=ni===void 0||ni,Vi=X.fullYear,Bi=X.displayWeekNumbers,Lo=X.weekNumber,aa=X.weekPicker,$o=X.rangeHover,Fo=X.monthYearSeparator,ps=X.formatMonth,gs=X.formatYear,zo=X.highlightToday,xl=zo===void 0||zo,wl=X.headerOrder,Vo=wl===void 0?["LEFT_BUTTON","MONTH_YEAR","RIGHT_BUTTON"]:wl,nc=X.style,Eu=nc===void 0?{}:nc,Cl=X.autoFocus,Nu=Cl!==void 0&&Cl;!vt||vt instanceof u.default||(console.warn("currentDate must be instance of DateObject"),vt=void 0),(typeof ge!="number"||ge<0||ge>6)&&(ge=0),(typeof Je!="number"||Je<1||J)&&(Je=1),!(Pe||Se||D(Oe))||Se||Pe||(Pe=!0),aa&&(Se=!0,Pe=!1),Vi&&(Je=12,ie=!1,J=!1),J&&!dr&&(dr=!0);var rc=C(_(Ge,Qe),2);Ge=rc[0],Qe=rc[1],se=ne(ie,J,se),Kt=Re(Kt),Gt=[].concat(Gt).filter(Boolean),Ne=[].concat.apply([],Ne);var Cr=C(e.useState({}),2),no=Cr[0],Bo=Cr[1],sr={},ro=e.useRef({mustCallOnReady:!0,currentDate:vt});e.useEffect(function(){Bo(function(Ut){var lr=ro.current.currentDate,Zn=Ut.date,Gn=Ut.selectedDate,Mi=Ut.initialValue,Kr=Ut.focused,Rr=Ut.mustSortDates;function Ui(St){if(St)return St.calendar.name!==Ge.name&&St.setCalendar(Ge),St.locale.name!==Qe.name&&St.setLocale(Qe),St._format!==se&&St.setFormat(se),St.digits=Vt,St.ignoreList=JSON.parse(Kt),St}function Ji(St){return new u.default(lr||St)}if(Oe)if(D(Gn=re(Oe,Ge,Qe,se)))Zn||(Zn=Ji(Gn.flat()[0]));else if(Zn&&Je!==1){var Wo=new u.default(Zn).toFirstOfMonth(),Ro=new u.default(Zn).add(Je-1,ie?"years":"months").toLastOfMonth();(Gn<Wo||Gn>Ro)&&(Zn=new u.default(Gn))}else Zn=Ji(Gn);else Zn||(Zn=Ji({calendar:Ge,locale:Qe,format:se})),Mi&&(Gn=void 0);if([].concat(Gn).flat().forEach(Ui),Ui(Zn),Pe||Se||D(Oe)){if(Gn||(Gn=[]),D(Gn)||(Gn=Pe&&Se?[[Gn]]:[Gn]),Se&&!Pe&&Gn.length>2){var Vs=Gn[Gn.length-1];Gn=[Gn[0],Vs],Kr=Vs}Pe&&!Se&&oe&&!Rr?(Rr=!0,Gn.sort(function(St,Ln){return St-Ln})):Se&&!Pe&&Gn.sort(function(St,Ln){return St-Ln})}else D(Gn)&&(Gn=Gn.flat()[Gn.length-1]);return Vi&&Zn.toFirstOfYear(),delete ro.current.currentDate,m(m({},Ut),{},{date:Zn,selectedDate:Gn,multiple:Pe,range:Se,onlyMonthPicker:ie,onlyYearPicker:J,initialValue:Ut.initialValue||Oe,value:Oe,focused:Kr,calendar:Ge,locale:Qe,format:se,mustSortDates:Rr,year:Zn.year,today:Ui(Ut.today)||new u.default({calendar:Ge}),weekPicker:aa})})},[Oe,Ge,Qe,se,ie,J,Se,Pe,oe,Je,Vt,Kt,Vi,aa]),e.useEffect(function(){(Jn||Qt)&&Bo(function(Ut){var lr=Ut.calendar,Zn=Ut.locale,Gn=Ut.format,Mi=function(Wo,Ro,Vs,St,Ln){return Ro&&(Ro=xe(Ro,St,Ln).set({hour:0,minute:0,second:0,millisecond:0})),Vs&&(Vs=xe(Vs,St,Ln).set({hour:23,minute:59,second:59,millisecond:999})),D(Wo)&&(Wo=Wo.filter(function(pr){return!(Ro&&pr<Ro)&&!(Vs&&pr>Vs)})),[Wo,Ro,Vs]}(re(Oe,lr,Zn,Gn),Jn,Qt,lr,Gn),Kr=C(Mi,3),Rr=Kr[0],Ui=Kr[1],Ji=Kr[2];return m(m({},Ut),{},{inRangeDates:en?Rr:Ut.selectedDate,minDate:Ui,maxDate:Ji})})},[Jn,Qt,en,Oe]),no.today&&!ro.current.isReady&&(ro.current.isReady=!0),e.useEffect(function(){ro.current.isReady&&ro.current.mustCallOnReady&&zt instanceof Function&&(ro.current.mustCallOnReady=!1,zt())},[ro.current.isReady,zt]);var io="rmdp-top-class "+Wi(["top","bottom"]),_n={top:[],bottom:[],left:[],right:[]},ic=G((Ce=no.date)===null||Ce===void 0?void 0:Ce.locale),pi={state:no,setState:Bo,onChange:Or,sort:oe,handleFocusedDate:Rs,isRTL:ic,fullYear:Vi,monthAndYears:function(){var Ut=no.date;if(!Ut)return[];for(var lr=[],Zn=[],Gn=Ut.digits,Mi=0;Mi<Je;Mi++){var Kr=void 0,Rr=Ut.year,Ui=Ut.monthIndex+Mi;if(ie&&(Rr+=Mi),Ui>11&&(Ui-=12,ie||Rr++),D(Rt)&&Rt.length>=12){var Ji=Rt[Ui];Kr=D(Ji)?Ji[0]:Ji}else Kr=Ut.months[Ui].name;Rr=Q(Rr.toString(),Gn),lr.push(Kr),Zn.push(Rr)}return[lr,Zn]}(),rangeHover:$o,highlightToday:xl,numberOfMonths:Je},Fs=arguments[0],zs=Fs.datePickerProps,la=Fs.DatePicker,ji=x(Fs,I);return e.useEffect(function(){var Ut=ro.current.Calendar;Ut&&Le(Ut,void 0,Nu&&!la)},[Nu,no.today,la]),function(){if(!(!ro.current.isReady||!D(Ne))){var Ut={state:no,setState:Bo,registerListener:dh,calendarProps:ji,datePickerProps:zs,handleChange:Or,Calendar:ro.current.Calendar,DatePicker:la,handlePropsChange:Ss,handleFocusedDate:function(Zn){return Rs(Zn)},minDate:Jn,maxDate:Qt},lr=function(Zn){return ct?"bottom":Zn.props.position||"right"};Ne.forEach(function(Zn,Gn){if(typeof Zn.type!="string"){var Mi={},Kr=lr(Zn);if(_n[Kr]&&!Zn.props.disabled){for(var Rr=0;Rr<Ne.length;Rr++)if(typeof Ne[Rr].type!="string"&&!Ne[Rr].props.disabled){if(Object.keys(Mi).length===4)break;var Ui=lr(Ne[Rr]);["top","bottom"].includes(Kr)?(Ui===Kr&&Rr>Gn&&(Mi.bottom=!0),Ui===Kr&&Rr<Gn&&(Mi.top=!0)):(io.includes("border-top")&&(Mi.top=!0),io.includes("border-bottom")&&(Mi.bottom=!0),Ui===Kr&&Rr>Gn&&(Mi.right=!0),Ui===Kr&&Rr<Gn&&(Mi.left=!0))}_n[Kr].push(e.cloneElement(Zn,m({key:Gn,position:Kr,nodes:Mi},Ut)))}}else Zn.type==="mapDays"&&Gt.push(Zn.fn(Ut))})}}(),no.today?s.default.createElement("div",{ref:function(Ut){if(Ut&&(Ut.date=no.date,Ut.set=function(lr,Zn){Tr||Bo(m(m({},no),{},{date:new u.default(no.date.set(lr,Zn))}))}),ro.current.Calendar=Ut,de instanceof Function)return de(Ut);de&&(de.current=Ut)},role:wt||"dialog",className:"rmdp-wrapper rmdp-".concat(Fr?"shadow":"border"," ").concat(ut||""),style:m({zIndex:mn},Eu)},_n.top,s.default.createElement("div",{style:{display:"flex"},className:io},_n.left,!ct&&s.default.createElement("div",{className:"rmdp-calendar ".concat(ic?"rmdp-rtl":""," ").concat(Wi(["left","right"]))},s.default.createElement($e,m(m({},pi),{},{disableYearPicker:kn,disableMonthPicker:ir,buttons:jt,renderButton:Ft,handleMonthChange:Wn,disabled:Tr,hideMonth:dr,hideYear:Sr,monthYearSeparator:Fo,formatMonth:ps,formatYear:gs,headerOrder:Vo,onYearChange:vn})),s.default.createElement("div",{style:{position:"relative"}},s.default.createElement(nt,m(m({},pi),{},{showOtherDays:An,mapDays:Gt,onlyShowInRangeDates:en,customWeekDays:kt,weekStartDayIndex:ge,hideWeekDays:In,displayWeekNumbers:Bi,weekNumber:Lo})),!Vi&&s.default.createElement(s.default.Fragment,null,!ir&&s.default.createElement(Ee,y({},pi,{customMonths:Rt,handleMonthChange:Wn})),!kn&&s.default.createElement(Ve,y({},pi,{onYearChange:vn}))))),_n.right),_n.bottom,sn):null;function Or(Ut,lr){if(Ut instanceof u.default&&(Ut=new u.default(Ut)),!Tr){if(Ut||Ut===null){if(Bt)return;sr.change&&sr.change.forEach(function(Gn){return Gn(Ut)})}if(Ut||Ut===null){var Zn=jn==null?void 0:jn(Ut);lr&&Zn!==!1&&Bo(lr)}else lr&&Bo(lr);Ss({value:Ut})}}function Ss(){var Ut,lr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!Bt&&!Tr){var Zn=m(m(m(m({},ji),zs),lr),{},{value:(Ut=lr.value)!==null&&Ut!==void 0?Ut:no.selectedDate});delete Zn.onPropsChange,xt==null||xt(Zn)}}function Rs(Ut,lr){Bt||Tr||Sn==null||Sn(Ut,lr)}function Wn(Ut){Bn==null||Bn(Ut)}function Wi(Ut){return ct||!D(Ne)?"":Array.from(new Set(Ne.map(function(lr){if(!lr.props)return"";var Zn=lr.props.position||"right";return Ut.includes(Zn)&&!lr.props.disabled?"rmdp-border-"+Zn:""}))).join(" ")}function dh(Ut,lr){sr[Ut]||(sr[Ut]=[]),sr[Ut].push(lr)}}var U=e.forwardRef(Z);function re(X,de,Ce,Oe){var Ge=[].concat(X).map(function(ie){return D(ie)?ie.map(Qe).filter(se):Qe(ie)}).filter(se);return D(X)?Ge:Ge.flat()[0];function Qe(ie){return ie?ie instanceof u.default?ie:new u.default({date:ie,calendar:de,locale:Ce,format:Oe}):{}}function se(ie){return D(ie)||ie.isValid}}q('.rmdp-visible{visibility:visible}.rmdp-invisible{visibility:hidden}.rmdp-input{border:1px solid #c0c4d6;border-radius:5px;height:22px;margin:1px 0;padding:2px 5px}.rmdp-input:focus{border:1px solid #a4b3c5;box-shadow:0 0 2px #a4b3c5;outline:none!important}.rmdp-button{background-color:#0074d9;border:none;border-radius:5px;color:#fff;cursor:pointer;display:inline-block;padding:7px 16px;text-align:center;text-decoration:none;transition:.3s}.rmdp-button:hover{background-color:#143ac5;transition:.4s}.rmdp-button:disabled{background-color:#8798ad}.rmdp-action-button{border-radius:unset;color:#2682d3;float:right;font-weight:700;margin:15px 10px 15px 0}.rmdp-action-button,.rmdp-action-button:hover{background-color:transparent}.rmdp-ep-arrow{overflow:hidden;will-change:transform}.rmdp-ep-arrow:after{background-color:#fff;content:"";height:12px;position:absolute;transform:rotate(45deg);width:12px}.rmdp-ep-shadow:after{box-shadow:0 0 6px #8798ad}.rmdp-ep-border:after{border:1px solid #cfd8e2}.rmdp-ep-arrow[direction=top]{border-bottom:1px solid #fff}.rmdp-ep-arrow[direction=left]{border-right:1px solid #fff}.rmdp-ep-arrow[direction=right]{border-left:1px solid #fff;margin-left:-1px}.rmdp-ep-arrow[direction=bottom]{border-top:1px solid #fff;margin-top:-1.5px}.rmdp-ep-arrow[direction=top]:after{left:4px;top:5px}.rmdp-ep-arrow[direction=bottom]:after{left:4px;top:-6px}.rmdp-ep-arrow[direction=left]:after{left:5px;top:3px}.rmdp-ep-arrow[direction=right]:after{left:-6px;top:3px}');var ae=["value","calendar","locale","format","onlyMonthPicker","onlyYearPicker","onChange","range","multiple","name","id","title","placeholder","required","style","className","inputClass","disabled","render","weekDays","months","children","inputMode","scrollSensitive","hideOnScroll","minDate","maxDate","formattingIgnoreList","containerClassName","calendarPosition","editable","onOpen","onClose","arrowClassName","zIndex","arrow","fixMainPosition","onPositionChange","onPropsChange","digits","readOnly","shadow","onFocusedDateChange","type","weekPicker","mobileLabels","onOpenPickNewDate","mobileButtons","dateSeparator","multipleRangeSeparator","typingTimeout"],he=["label"];function Me(X,de){var Ce=X.value,Oe=X.calendar,Ge=X.locale,Qe=X.format,se=X.onlyMonthPicker,ie=X.onlyYearPicker,J=X.onChange,me=X.range,Se=me!==void 0&&me,je=X.multiple,Pe=je!==void 0&&je,ut=X.name,wt=X.id,kt=X.title,Rt=X.placeholder,sn=X.required,jn=X.style,An=jn===void 0?{}:jn,Jn=X.className,Qt=Jn===void 0?"":Jn,Gt=X.inputClass,ir=X.disabled,kn=X.render,Kt=X.weekDays,zt=X.months,Wt=X.children,en=X.inputMode,tn=X.scrollSensitive,mn=tn===void 0||tn,dn=X.hideOnScroll,Ne=X.minDate,oe=X.maxDate,Ae=X.formattingIgnoreList,Je=X.containerClassName,vt=Je===void 0?"":Je,Vt=X.calendarPosition,$t=Vt===void 0?"bottom-left":Vt,jt=X.editable,Ft=jt===void 0||jt,Ct=X.onOpen,ge=X.onClose,ct=X.arrowClassName,xt=ct===void 0?"":ct,Bn=X.zIndex,vn=Bn===void 0?100:Bn,Sn=X.arrow,Bt=Sn===void 0||Sn,Tr=X.fixMainPosition,dr=X.onPositionChange,Sr=X.onPropsChange,In=X.digits,ni=X.readOnly,Fr=X.shadow,Vi=Fr===void 0||Fr,Bi=X.onFocusedDateChange,Lo=X.type,aa=X.weekPicker,$o=X.mobileLabels,Fo=X.onOpenPickNewDate,ps=Fo===void 0||Fo,gs=X.mobileButtons,zo=gs===void 0?[]:gs,xl=X.dateSeparator,wl=X.multipleRangeSeparator,Vo=wl===void 0?",":wl,nc=X.typingTimeout,Eu=nc===void 0?700:nc,Cl=x(X,ae),Nu=C(e.useState(),2),rc=Nu[0],Cr=Nu[1],no=C(e.useState(),2),Bo=no[0],sr=no[1],ro=C(e.useState(""),2),io=ro[0],_n=ro[1],ic=C(e.useState(!1),2),pi=ic[0],Fs=ic[1],zs=C(e.useState(!1),2),la=zs[0],ji=zs[1],Or=e.useRef(),Ss=e.useRef(),Rs=e.useRef(),Wn=e.useRef({isTyping:!1}),Wi=xl||(Se||aa?" ~ ":", "),dh=arguments[0],Ut=typeof Qt=="string"&&Qt.includes("rmdp-mobile"),lr=e.useCallback(function(){if((ge==null?void 0:ge())!==!1){var St=lt(Ss);if(St&&St.forEach(function(pr){return pr.blur()}),Wn.current.mobile){var Ln=Rs.current.parentNode.parentNode;Ln.classList.remove("rmdp-calendar-container-mobile"),Ln.style.position="absolute",Ln.style.visibility="hidden"}Wn.current.validInputValue!==void 0&&(_n(Wn.current.validInputValue),Wn.current.validInputValue=void 0),Fs(!1),ji(!1)}},[ge]),Zn=[{type:"button",className:"rmdp-button rmdp-action-button",onClick:function(){sr(void 0),lr()},label:Kr("CANCEL")},{type:"button",className:"rmdp-button rmdp-action-button",onClick:function(){Bo&&(Ji(Bo,!0),sr(void 0)),lr()},label:Kr("OK")}];Ut&&!Wn.current.mobile&&(Wn.current=m(m({},Wn.current),{},{mobile:!0})),!Ut&&Wn.current.mobile&&(Wn.current=m(m({},Wn.current),{},{mobile:!1})),Ae=Re(Ae),Qe=ne(se,ie,Qe);var Gn,Mi=C(_(Oe,Ge),2);return Oe=Mi[0],Ge=Mi[1],e.useEffect(function(){function St(pr){if(pi&&!Wn.current.mobile){var vs=[];if([Ss.current,Rs.current].forEach(function(K){var be,Be;!K||K.contains(pr.target)||pr.target.classList.contains("b-deselect")||(be=pr.target.parentNode)!==null&&be!==void 0&&(be=be.classList)!==null&&be!==void 0&&(Be=be.contains)!==null&&Be!==void 0&&Be.call(be,"b-deselect")||vs.push(K)}),vs.length===2)return lr();Rs.current&&Rs.current.contains(pr.target)&&(Or.current.removeTransition(),Or.current.refreshPosition())}}function Ln(){dn&&pi&&lr()}return document.addEventListener("click",St,!1),document.addEventListener("scroll",Ln,!0),function(){document.removeEventListener("click",St,!1),document.removeEventListener("scroll",Ln,!0)}},[lr,de,pi,dn]),e.useEffect(function(){var St=Ce,Ln=Wn.current,pr=Ln.date,vs=Ln.initialValue,K=function(){return St[St.length-1]};function be(It){if(It)return It instanceof u.default||(It=new u.default({date:It,calendar:Oe,locale:Ge,format:Qe})),It.calendar!==Oe&&It.setCalendar(Oe),It.set({weekDays:Kt,months:zt,digits:In,locale:Ge,format:Qe,ignoreList:JSON.parse(Ae)}),It}Ce||vs||!pr?vs&&!Ce&&(vs=void 0):St=pr;var Be="";if(Se||Pe||D(St)){var at=function(It){return It=It.map(be).filter(function(qt){return qt!==void 0}),Se&&It.length>2&&(It=[It[0],K()]),[It,ot(It,Wi)]};if(D(St)||(St=Se&&Pe?St?[[St]]:[]:[St]),Pe&&Se)St=St.map(function(It,qt){var Vn=C(at(D(It)?It:[It]),2),gr=Vn[0],si=Vn[1];return Be+=si+(qt<St.length-1?" ".concat(Vo," "):""),gr});else{var Ot=C(at(St),2);St=Ot[0],Be=Ot[1]}Be=Be.toString().replace(/\s,\s$/,"")}else D(St)&&(St=K()),(St=be(St))&&(Be=St.format());Wn.current.isTyping||_n(Be),Wn.current=m(m({},Wn.current),{},{date:St,separator:Wi,initialValue:vs||Ce}),Wn.current.mobile&&Or.current.isOpen?sr(St):(Wn.current.validInputValue=void 0,Cr(St))},[Ce,Oe,Ge,Qe,Se,Pe,Wi,se,ie,Kt,zt,In,Ae]),e.useEffect(function(){var St=Wn.current.selection;if(St){var Ln=lt(Ss);Ln.length!==0&&(Ln.forEach(function(pr){document.activeElement===pr&&(pr.setSelectionRange(St,St),Wn.current.selection=void 0)}),Or.current.refreshPosition())}},[io]),(Pe||Se||D(rc)||!Ft)&&(en="none"),s.default.createElement(a.default,y({ref:function(St){if(St&&(St.openCalendar=function(){return setTimeout(function(){return Rr()},10)},St.closeCalendar=lr,St.isOpen=pi&&la),Or.current=St,de instanceof Function)return de(St);de&&(de.current=St)},element:kn?s.default.createElement("div",{ref:Ss},e.isValidElement(kn)?e.cloneElement(kn,{value:io,openCalendar:Rr,onFocus:Rr,handleValueChange:Wo,onChange:Wo,locale:Ge,separator:Wi}):kn instanceof Function?kn(io,Rr,Wo,Ge,Wi):null):s.default.createElement("input",{ref:Ss,type:Lo||"text",name:ut,id:wt,title:kt,required:sn,onFocus:Rr,className:Gt||"rmdp-input",placeholder:Rt,value:io,onChange:Wo,style:An,autoComplete:"off",disabled:!!ir,inputMode:en||(Ut?"none":void 0),readOnly:ni}),popper:pi&&s.default.createElement(U,y({ref:Rs,value:Bo||rc,onChange:Ji,range:Se,multiple:Pe,calendar:Oe,locale:Ge,format:Qe,onlyMonthPicker:se,onlyYearPicker:ie,className:Qt+(Ut?" rmdp-mobile":""),weekDays:Kt,months:zt,digits:In,minDate:Ne,maxDate:oe,formattingIgnoreList:JSON.parse(Ae),onPropsChange:Sr,shadow:Vi,onReady:Ro,DatePicker:Or.current,datePickerProps:dh,onFocusedDateChange:Vs,weekPicker:aa},Cl),Wt,Ut&&(Gn=[].concat.apply([],dh.plugins||[]).some(function(St){var Ln=St.props;return!(Ln===void 0?{}:Ln).disabled}),D(zo)&&s.default.createElement("div",{className:"rmdp-action-buttons ".concat(G(Ge)?"rmdp-rtl":""," ").concat(Gn?"rmdp-border-top":"")},zo.concat(Zn).map(function(St,Ln){var pr=St.label,vs=x(St,he);return s.default.createElement("button",y({key:Ln},vs),pr)})))),active:!Ut&&la,position:$t,arrow:!Ut&&Bt,fixMainPosition:!mn||Tr,zIndex:vn,onChange:!Ut&&dr,containerClassName:"rmdp-container ".concat(vt),arrowClassName:["rmdp-ep-arrow","rmdp-ep-".concat(Vi?"shadow":"border"),Qt,xt].join(" ")},Cl));function Kr(St){var Ln,pr=Ge||new u.default().locale;return typeof pr.name!="string"?St:($o==null?void 0:$o[St])||((Ln={en:{OK:"OK",CANCEL:"CANCEL"},fa:{OK:"تأیید",CANCEL:"لغو"},ar:{OK:"تأكيد",CANCEL:"الغاء"},hi:{OK:"पुष्टि",CANCEL:"रद्द करें"}}[O(pr)])===null||Ln===void 0?void 0:Ln[St])||St}function Rr(){if(!ir&&!ni&&(Ct==null?void 0:Ct())!==!1){if(ps&&!Ce&&!Wn.current.date&&!Se&&!Pe&&!Ut){var St=new u.default({calendar:Oe,locale:Ge,format:Qe,months:zt,weekDays:Kt,digits:In,ignoreList:JSON.parse(Ae)});(!Ne||St>xe(Ne,Oe,Qe))&&(!oe||St<xe(oe,Oe,Qe))&&(Ji(St),Sr==null||Sr(m(m({},dh),{},{value:St})),Wn.current.date=St)}var Ln=lt(Ss);Ut&&Ln.length>0&&Ln.forEach(function(pr){return pr.blur()}),Ln.length>0||!pi?Fs(!0):lr()}}function Ui(St){var Ln="";return St&&(Ln=Pe&&Se&&D(St)?St.map(function(pr){return ot(pr,Wi)}).join(" ".concat(Vo," ")):ot(St,Wi)),Ln}function Ji(St,Ln,pr){if(Ut&&!Ln)return sr(St);var vs=Ui(St),K=pr||vs.toString().replace(/\s,\s$/,"");return St&&[].concat(St).flat().some(function(be){return Ne&&be<xe(Ne,Oe,Qe)||oe&&be>xe(oe,Oe,Qe)})?(Wn.current.validInputValue=Ui(Ce||Wn.current.date),_n(K)):(Wn.current.validInputValue=vs,(J==null?void 0:J(St,{validatedValue:vs,input:Ss.current,isTyping:!!pr}))===!1?(_n(io),!1):(Cr(St),_n(K),void(Wn.current=m(m({},Wn.current),{},{date:St}))))}function Wo(St){if(Ft){Wn.current.isTyping=!0,setTimeout(function(){Wn.current.isTyping=!1},Eu),Wn.current.selection=St.target.selectionStart;var Ln=St.target.value,pr={calendar:Oe,locale:Ge,format:Qe,ignoreList:JSON.parse(Ae)};if(In=D(In)?In:Ge.digits,!Ln)return _n(""),Ji(null);if(In){var vs,K,be=L(In);try{for(be.s();!(vs=be.n()).done;){var Be=vs.value;Ln=Ln.replace(new RegExp(Be,"g"),In.indexOf(Be))}}catch(It){be.e(It)}finally{be.f()}K=D(rc)?Pe&&Se?(Ln||"").split(Vo).filter(Boolean).map(Ot):Ot(Ln):at(Ln),Ji(D(rc)||K.isValid?K:null,void 0,Q(Ln,In))}}function at(It){return/(?=.*Y)(?=.*M)(?=.*D)/.test(Qe)?new u.default(m(m({},pr),{},{date:It})):new u.default(pr).parse(It)}function Ot(It){return(It||"").split(Wi).filter(Boolean).map(function(qt){return at(qt.trim())})}}function Ro(){if(ji(!0),Ut){var St=Rs.current.parentNode.parentNode;St.className="rmdp-calendar-container-mobile",St.style.position="fixed",St.style.transform="",setTimeout(function(){St.style.visibility="visible"},50)}}function Vs(St,Ln){D(Wn.current.date)||!Ln||Ut||lr(),Bi==null||Bi(St,Ln)}}var tt=e.forwardRef(Me);function ot(X,de){var Ce=[].concat(X).map(function(Oe){return Oe!=null&&Oe.isValid?Oe.format():""});return Ce.toString=function(){return this.filter(Boolean).join(de)},Ce}function lt(X){return X.current?X.current.tagName==="INPUT"?[X.current]:Array.from(X.current.querySelectorAll("input")):[]}Object.defineProperty(t,"DateObject",{enumerable:!0,get:function(){return u.default}}),t.Calendar=U,t.default=tt,t.getAllDatesInRange=function(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],de=arguments.length>1?arguments[1]:void 0;if(!Array.isArray(X))return[];var Ce=X[0],Oe=X[X.length-1],Ge=[];if(!(Ce instanceof u.default&&Oe instanceof u.default&&Ce.isValid&&Oe.isValid&&!(Ce>Oe)))return[];for(Ce=new u.default(Ce),Oe=new u.default(Oe);Ce<=Oe;Ce.day++)Ge.push(de?Ce.toDate():new u.default(Ce));return Ge},t.toDateObject=xe})(Q7);const Dh=w1(Q7);function ife(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var sfe=ife({name:"persian",startYear:1,yearLength:365,epoch:1948319,century:14,weekStartDayIndex:0,getMonthLengths:t=>[31,31,31,31,31,31,30,30,30,30,30,t?30:29],isLeap(t){return this.getLeaps(t).includes(t)},getLeaps(t){if(t===0)return;let e=t>0?1:-1,n=[],r=.242362,i=t>0?.2684:.7316,s={5:4,38:37,199:198,232:231,265:264,298:297,557:558,590:591,623:624,982:983,1015:1016,1048:1049,1081:1082,1114:1115,1242:1243,1374:1375,1407:1408,1440:1441,1506:1507,1539:1540,1572:1573,1605:1606,1931:1932,1964:1965,2063:2064,2096:2097,2687:2686,2720:2719,2753:2752,2819:2818,2852:2851,2885:2884,3017:3016,3112:3111,3145:3144,3178:3177,3211:3210,3244:3243,3277:3276,3310:3309,3343:3342,3376:3375,3409:3408,3442:3441,3508:3507,3541:3540,3574:3573,3603:3602,3607:3606,3636:3635,3669:3668,3702:3701,3706:3705,3735:3734,3768:3767,3801:3800,3834:3833,3867:3866,3900:3899,3933:3932,3966:3965,3999:3998,4065:4064,4094:4093,4098:4097,4127:4126,4131:4130,4160:4159,4193:4192,4226:4225,4259:4258,4292:4291,4325:4324,4358:4357,4391:4390,4585:4584,4618:4617,4651:4650,4750:4749,4943:4944,4976:4977,5009:5010,5170:5171,5203:5204,5236:5237,5265:5266,5269:5270,5298:5299,5302:5303,5331:5332,5335:5336,5364:5365,5368:5369,5393:5394,5397:5398,5401:5402,5426:5427,5430:5431,5434:5435,5459:5460,5463:5464,5467:5468,5492:5493,5496:5497,5500:5501,5521:5522,5525:5526,5529:5530,5554:5555,5558:5559,5562:5563,5587:5588,5591:5592,5595:5596,5616:5617,5620:5621,5624:5625,5628:5629,5649:5650,5653:5654,5657:5658,5661:5662,5682:5683,5686:5687,5690:5691,5694:5695,5715:5716,5719:5720,5723:5724,5727:5728,5744:5745,5748:5749,5752:5753,5756:5757,5760:5761,5777:5778,5781:5782,5785:5786,5789:5790,5793:5794,5810:5811,5814:5815,5818:5819,5822:5823,5826:5827,5839:5840,5843:5844,5847:5848,5851:5852,5855:5856,5859:5860,5872:5873,5876:5877,5880:5881,5884:5885,5888:5889,5892:5893,5901:5902,5905:5906,5909:5910,5913:5914,5917:5918,5921:5922,5925:5926,5934:5935,5938:5939,5942:5943,5946:5947,5950:5951,5954:5955,5958:5959,5967:5968,5971:5972,5975:5976,5979:5980,5983:5984,5987:5988,5991:5992,5996:5997,6e3:6001,6004:6005,6008:6009,6012:6013,6016:6017,6020:6021,6029:6030,6033:6034,6037:6038,6041:6042,6045:6046,6049:6050,6053:6054,6058:6059,6062:6063,6066:6067,6070:6071,6074:6075,6078:6079,6082:6083,6086:6087,6091:6092,6095:6096,6099:6100,6103:6104,6107:6108,6111:6112,6115:6116,6119:6120,6124:6125,6128:6129,6132:6133,6136:6137,6140:6141,6144:6145,6148:6149,6152:6154,6157:6158,6161:6162,6165:6166,6169:6170,6173:6174,6177:6178,6181:6182,6185:6187,6190:6191,6194:6195,6198:6199,6202:6203,6206:6207,6210:6211,6214:6215,6218:6220,6223:6224,6227:6228,6231:6232,6235:6236,6239:6240,6243:6244,6247:6249,6251:6253,6256:6257,6260:6261,6264:6265,6268:6269,6272:6273,6276:6277,6280:6282,6284:6286,6289:6290,6293:6294,6297:6298,6301:6302,6305:6306,6309:6310,6313:6315,6317:6319,6322:6323,6326:6327,6330:6331,6334:6335,6338:6339,6342:6344,6346:6348,6350:6352,6355:6356,6359:6360,6363:6364,6367:6368,6371:6372,6375:6377,6379:6381,6383:6385,6388:6389,6392:6393,6396:6397,6400:6401,6404:6406,6408:6410,6412:6414,6416:6418,6421:6422,6425:6426,6429:6430,6433:6434,6437:6439,6441:6443,6445:6447,6449:6451,6454:6455,6458:6459,6462:6463,6466:6468,6470:6472,6474:6476,6478:6480,6482:6484,6487:6488,6491:6492,6495:6496};for(;t>0?e<=t:t<=e;){if(i+=t>0?r:-1*r,i>1&&(i-=1),i<0&&(i+=1),i>=.257800926&&i<=.5){let a=s[e]||e<-1?e+1:e;t>0&&a<=t&&n.push(a),t<0&&n.push(a)}t>0?e++:e--}return n},getDayOfYear:({month:{index:t},day:e})=>(t<=6?31*t:186+30*(t-6))+e,getAllDays(t){const{year:e}=t,n=this.getLeaps(e),r=n.includes(e);return this.yearLength*(e-1)+(r?n.length-1:n.length)+this.getDayOfYear(t)},guessYear:(t,e)=>~~((t+.5)/365.241)+(e>0?1:-1)}),ofe=sfe;const Hh=w1(ofe);function afe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var lfe=afe({name:"persian_fa",months:[["فروردین","فر"],["اردیبهشت","ار"],["خرداد","خرد"],["تیر","تیر"],["مرداد","مر"],["شهریور","شه"],["مهر","مه"],["آبان","آبا"],["آذر","آذ"],["دی","دی"],["بهمن","بهم"],["اسفند","اسف"]],weekDays:[["شنبه","شن"],["یکشنبه","یک"],["دوشنبه","دو"],["سهشنبه","سه"],["چهارشنبه","چهار"],["پنجشنبه","پنج"],["جمعه","جم"]],digits:["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],meridiems:[["قبل از ظهر","ق.ظ"],["بعد از ظهر","ب.ظ"]]}),cfe=lfe;const Lh=w1(cfe),IH=rT(),uY=({value:t,row:e,column:n,updateData:r,schema:i,context:s})=>{var L;const[a,u]=W.useState(t),[h,m]=W.useState(!1),g=W.useRef(null);W.useEffect(()=>{u(t)},[t]),W.useEffect(()=>{h&&g.current&&g.current.focus&&(g.current.focus(),g.current.select&&g.current.select())},[h]);const y=(i==null?void 0:i.type)||"text",x=["regular_price","sale_price","cost_price","margin","profit"].includes(n.id)&&s==="profit",C=(i==null?void 0:i.editable)!==!1||x||n.id==="stock_status"||n.id==="manage_stock",E=D=>{if(D===t){m(!1);return}if(!!e.original.parent_id&&["regular_price","sale_price","cost_price","stock_status","manage_stock"].includes(n.id)&&window.confirm("آیا میخواهید این تغییر روی سایر متغیرهای این محصول نیز اعمال شود؟")){r(e.original.id,n.id,D,!0),m(!1);return}r(e.original.id,n.id,D),m(!1)};if(!C){const D=y==="price"||n.id.includes("profit"),z=y==="percent"||n.id==="margin";let H=a;if(D&&(H=Xo(a)),z&&(H=`${Number(a||0).toFixed(1)}%`),n.id==="margin"){const V=Number(a),F=V<15?"bg-rose-50 text-rose-600 border-rose-100":V<30?"bg-amber-50 text-amber-600 border-amber-100":"bg-primary-50 text-primary-600 border-primary-100";return o.jsxs("div",{className:`px-2.5 py-1 rounded-xl border text-[10px] font-black inline-flex items-center gap-1.5 shadow-sm ${F}`,children:[V<15&&o.jsx(Ph,{size:10}),H]})}return n.id==="categories"&&Array.isArray(a)&&(H=a.join("، ")),o.jsx("div",{className:`px-2 py-2 text-right font-bold truncate ${D?"text-primary-700":"text-slate-600"}`,children:H!=null&&H!==""?H:o.jsx("span",{className:"text-slate-300 font-normal italic text-[11px]",children:"ثبت نشده"})})}if(h||n.id==="manage_stock"){if(n.id==="manage_stock")return s==="bulk_edit"?o.jsxs("select",{ref:g,value:a?"yes":"no",onChange:D=>E(D.target.value==="yes"),onBlur:()=>m(!1),autoFocus:!0,className:"wm-select h-9 !py-0 !px-4 !text-[11px] font-black border-primary-500 shadow-lg",children:[o.jsx("option",{value:"yes",children:"فعال"}),o.jsx("option",{value:"no",children:"غیرفعال"})]}):o.jsxs("div",{className:"flex items-center justify-center py-2 h-full",children:[o.jsx("button",{onClick:()=>E(!a),className:`w-10 h-5 rounded-full transition-all relative ${a?"bg-emerald-500":"bg-slate-300"}`,children:o.jsx("div",{className:`absolute top-0.5 w-4 h-4 bg-white rounded-full transition-all ${a?"left-0.5":"left-5.5"}`})}),o.jsx("span",{className:"text-[10px] font-black mr-2 text-slate-500",children:a?"فعال":"غیرفعال"})]});if(n.id==="stock_status"){const D=a==="instock",z=()=>E(D?"outofstock":"instock");return o.jsxs("div",{className:"flex items-center justify-center py-2 h-full gap-2",children:[o.jsx("button",{onClick:z,className:`w-10 h-5 rounded-full transition-all relative ${D?"bg-emerald-500":"bg-slate-300"}`,children:o.jsx("div",{className:`absolute top-0.5 w-4 h-4 bg-white rounded-full transition-all ${D?"left-5.5":"left-0.5"}`})}),o.jsx("span",{className:`text-[10px] font-black ${D?"text-emerald-600":"text-slate-400"}`,children:D?"موجود":"ناموجود"})]})}if(y==="boolean"){const D=()=>E(!a);return o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("button",{onClick:D,className:`w-10 h-5 rounded-full transition-all relative ${a?"bg-emerald-500":"bg-slate-300"}`,children:o.jsx("div",{className:`absolute top-0.5 w-4 h-4 bg-white rounded-full transition-all ${a?"left-0.5":"left-5.5"}`})})})}return y==="select"&&(i!=null&&i.options)?o.jsx("div",{className:"relative group/sel",children:o.jsx("select",{ref:g,value:a||"",onChange:D=>E(D.target.value),onBlur:()=>m(!1),autoFocus:!0,className:"wm-select !h-10 !px-4 !text-[12px] bg-white border-primary-500 shadow-lg font-black",children:i.options.map(D=>o.jsx("option",{value:D.value,children:D.label},D.value))})}):y==="date"?o.jsx(Dh,{calendar:Hh,locale:Lh,value:a,onChange:D=>{var H,V,F;const z=((F=(V=(H=D==null?void 0:D.toDate)==null?void 0:H.call(D))==null?void 0:V.toLocaleDateString)==null?void 0:F.call(V,"en-CA"))||"";E(z)},className:"rmdp-mobile",onOpenPickNewDate:!1,render:(D,z)=>o.jsx("input",{ref:g,onClick:z,value:D,readOnly:!0,className:"wm-input !h-10 !px-4 !text-[12px] bg-white border-primary-500 shadow-lg font-black"})}):o.jsx("input",{ref:g,type:"text",value:a??"",onChange:D=>{const z=D.target.value;u(jH(n.id)?X7(z):z)},onBlur:()=>E(a),onKeyDown:D=>{D.key==="Enter"&&E(a),D.key==="Escape"&&(u(t),m(!1))},autoFocus:!0,className:"wm-input !h-10 !px-4 !text-[12px] bg-white border-primary-500 shadow-2xl font-black rounded-xl"})}if(y==="boolean")return o.jsx("div",{onClick:()=>m(!0),className:"flex justify-center cursor-pointer py-2",children:o.jsx("div",{className:`p-1 rounded-md border ${a?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-slate-50 text-slate-300 border-slate-100"}`,children:a?o.jsx(IU,{size:14}):o.jsx(qi,{size:14})})});if(y==="select"&&(i!=null&&i.options)){const D=((L=i.options.find(z=>z.value===a))==null?void 0:L.label)||a;return o.jsx("div",{onClick:()=>m(!0),className:"cursor-pointer px-3 py-1 rounded-full text-[10px] font-black border bg-slate-50 text-slate-600 border-slate-200 inline-block",children:D||o.jsx("span",{className:"text-slate-300",children:"-"})})}const M=y==="price"||n.id.includes("profit");let j=a;return M?j=Xo(a):n.id==="margin"&&(j=`${Number(a||0).toFixed(1)}%`),o.jsx("div",{onClick:()=>m(!0),className:"cursor-pointer min-h-[2.5rem] w-full px-2 py-2 transition-all hover:bg-slate-50/80 rounded-lg flex items-center group/cell",children:o.jsx("div",{className:`truncate w-full text-right font-black transition-colors ${M?"text-primary-700 group-hover:text-primary-800":"text-slate-700 group-hover:text-primary-600"} text-[12px]`,children:j!=null&&j!==""?j:o.jsx("span",{className:"text-slate-300 italic text-[10px] font-normal tracking-wide",children:"ثبت نشده..."})})})},ufe=({src:t,className:e})=>{const[n,r]=W.useState(!1);return n||!t?o.jsx("div",{className:`relative ${e.includes("w-10")?"w-10 h-10":e.includes("w-24")?"w-24 h-24":"w-16 h-16"} shrink-0 bg-slate-50 flex items-center justify-center text-slate-300 rounded-xl`,children:o.jsx(bc,{size:e.includes("w-10")?14:20})}):o.jsx("div",{className:`relative ${e.includes("w-10")?"w-10 h-10":e.includes("w-24")?"w-24 h-24":"w-16 h-16"} shrink-0 bg-slate-100 rounded-xl overflow-hidden`,children:o.jsx("img",{src:t,className:`${e} w-full h-full object-cover`,onError:()=>r(!0),loading:"lazy"})})},DH=({data:t,variations:e={},updateData:n,onSelectionChange:r,onSortingChange:i,onRowClick:s,settings:a,selectedIds:u=[],context:h,compact:m=!1})=>{const[g,y]=W.useState([]),[x,C]=W.useState({}),E=W.useMemo(()=>MH(),[]),M=W.useMemo(()=>{let D=[];return!t||!Array.isArray(t)||t.forEach(z=>{D.push(z),e[z.id]&&e[z.id].forEach(H=>{D.push({...H,parent_id:z.id})})}),D},[t,e]);W.useEffect(()=>{if(u.length===0)Object.keys(x).length>0&&C({});else if(Object.values(x).filter(Boolean).length!==u.length){const z={};u.forEach(H=>{z[H]=!0}),C(z)}},[u]),W.useEffect(()=>{if(r){const D=Object.entries(x).filter(([z,H])=>H).map(([z])=>Number(z));JSON.stringify(D.sort())!==JSON.stringify([...u].sort())&&r(D)}},[x,r]),W.useEffect(()=>{i&&i(g)},[g]);const j=W.useMemo(()=>{let D=(a==null?void 0:a.visible_columns)||["image","name","sku","regular_price","stock","stock_status"];if(h!=="profit"){const H=D.includes("image"),V=D.includes("name");H&&V&&(D=["image","name",...D.filter(B=>B!=="image"&&B!=="name")])}const z=[IH.display({id:"select",header:({table:H})=>o.jsx("div",{className:"flex items-center justify-center w-10",children:o.jsxs("label",{className:"wm-checkbox-wrapper",onClick:V=>V.stopPropagation(),children:[o.jsx("input",{type:"checkbox",className:"wm-checkbox",checked:H.getIsAllPageRowsSelected(),onChange:H.getToggleAllPageRowsSelectedHandler()}),o.jsx("div",{className:"wm-checkbox-inner"})]})}),cell:({row:H})=>o.jsx("div",{className:"flex items-center justify-center w-10",children:o.jsxs("label",{className:"wm-checkbox-wrapper",onClick:V=>V.stopPropagation(),children:[o.jsx("input",{type:"checkbox",className:"wm-checkbox whitespace-nowrap",checked:H.getIsSelected(),onChange:H.getToggleSelectedHandler()}),o.jsx("div",{className:`wm-checkbox-inner ${H.getIsSelected()?"!bg-primary-500 !border-primary-500 after:!block":""}`})]})}),size:40})];return D.forEach(H=>{const V=E.find(te=>te.key===H);if(!V&&H!=="name"&&H!=="image")return;const F=H,B=(V==null?void 0:V.label)||(H==="name"?"نام محصول":H==="image"?"تصویر":H);z.push(IH.accessor(F,{id:F,header:()=>o.jsx("div",{className:"flex items-center gap-2 group/h py-2",children:o.jsx("span",{className:"wm-meta !text-slate-500",children:B})}),cell:te=>{const ve=te;if(F==="image"){const ce=(a==null?void 0:a.image_size)==="small"?"w-10 h-10":(a==null?void 0:a.image_size)==="large"?"w-24 h-24":"w-16 h-16",_e=ve.getValue();return o.jsx(ufe,{src:_e,className:`${ce} object-cover`})}if(F==="name"){const ce=!!ve.row.original.parent_id,_e=ve.getValue();return o.jsxs("div",{className:`flex flex-col gap-1 min-w-[220px] max-w-[320px] ${ce?"pr-8 relative":"pr-2"}`,children:[ce&&o.jsx("div",{className:"absolute right-3 top-3.5 w-4 h-4 border-r-2 border-b-2 border-primary-200 rounded-br-2xl"}),o.jsxs("div",{className:"flex items-center gap-1",children:[ce&&o.jsx("span",{className:"text-primary-400 font-black mr-1",children:"/"}),o.jsx(uY,{...ve,value:_e,updateData:n,schema:V,context:h})]}),o.jsxs("div",{className:"flex gap-2 items-center px-4 -mt-2 mb-2",children:[ve.row.original.sku&&o.jsx("span",{className:"text-[9px] bg-slate-100 text-slate-500 px-2 py-0.5 rounded-lg font-mono font-bold tracking-tighter",children:ve.row.original.sku}),ve.row.original.type==="variable"&&o.jsx("span",{className:"text-[9px] bg-primary-50 text-primary-600 px-2 py-0.5 rounded-lg font-black shadow-sm ring-1 ring-primary-100",children:"متغیر"}),o.jsxs("div",{className:"flex items-center gap-1 mr-auto",children:[o.jsxs("a",{href:ve.row.original.edit_link,target:"_blank",className:"px-2 py-1 bg-blue-50 hover:bg-blue-100 text-blue-600 rounded-md transition-all flex items-center gap-1 no-underline border border-blue-200",title:"ویرایش در ووکامرس",onClick:pe=>pe.stopPropagation(),children:[o.jsx(Tae,{size:10}),o.jsx("span",{className:"text-[8px] font-black",children:"ویرایش در ووکامرس"})]}),o.jsxs("a",{href:ve.row.original.view_link,target:"_blank",className:"px-2 py-1 bg-emerald-50 hover:bg-emerald-100 text-emerald-600 rounded-md transition-all flex items-center gap-1 no-underline border border-emerald-200",title:"نمایش محصول",onClick:pe=>pe.stopPropagation(),children:[o.jsx($u,{size:10}),o.jsx("span",{className:"text-[8px] font-black",children:"نمایش محصول"})]})]})]})]})}if(F==="categories"){const ce=ve.getValue(),_e=Array.isArray(ce)?ce.join("، "):ce;return o.jsx("div",{className:"px-2 py-2 text-right font-bold text-slate-600 text-[11px] truncate",title:_e,children:_e||"-"})}return o.jsx(uY,{...ve,value:ve.getValue(),updateData:n,schema:V,context:h})},size:m?H==="image"?50:H==="sku"?70:H==="select"?30:H==="name"?180:["regular_price","sale_price","cost_price","profit"].includes(H)?90:H==="margin"||H==="stock"?70:H==="categories"?130:(V==null?void 0:V.width)||90:H==="image"?80:H==="sku"?100:H==="select"?40:(V==null?void 0:V.width)||120}))}),z.push(IH.display({id:"actions",header:()=>o.jsx("span",{className:"wm-meta !text-slate-500",children:"عملیات"}),cell:({row:H})=>o.jsx("div",{className:"flex justify-center group/act",children:o.jsxs("button",{onClick:V=>{V.stopPropagation(),s==null||s(H.original)},className:"p-2 hover:bg-primary-50 rounded-lg text-slate-400 hover:text-primary-600 transition-all flex items-center justify-center gap-1",children:[o.jsx("span",{className:"text-[10px] font-black opacity-0 group-hover/act:opacity-100 transition-opacity",children:"جزئیات"}),o.jsx(yae,{size:16})]})}),size:80})),z},[E,a,n]),L=cT({data:M,columns:j,state:{sorting:g,rowSelection:x},onSortingChange:y,onRowSelectionChange:C,getCoreRowModel:lT(),getSortedRowModel:TH(),getRowId:D=>{var z;return((z=D==null?void 0:D.id)==null?void 0:z.toString())||Math.random().toString()},enableRowSelection:!0});return o.jsxs("div",{className:`relative ${m?"overflow-hidden":"overflow-auto"} bg-white rounded-b-xl border border-slate-100 max-h-[70vh]`,children:[o.jsxs("table",{className:`w-full text-right border-collapse ${m?"table-fixed":"table-auto"}`,style:{minWidth:m?"100%":L.getCenterTotalSize()},children:[o.jsx("thead",{className:"bg-slate-50/95 border-b border-slate-100 sticky top-0 z-20 backdrop-blur-sm",children:L.getHeaderGroups().map(D=>o.jsx("tr",{children:D.headers.map(z=>o.jsx("th",{style:{width:z.getSize()},className:"px-4 py-4 text-xs font-black text-slate-400 border-b border-slate-100 bg-slate-50/80",children:o.jsxs("div",{className:"flex items-center gap-1.5 cursor-pointer whitespace-nowrap justify-start",onClick:z.column.getToggleSortingHandler(),children:[mg(z.column.columnDef.header,z.getContext()),z.column.getIsSorted()==="asc"?o.jsx(YD,{size:10,className:"text-primary-500"}):z.column.getIsSorted()==="desc"?o.jsx(UD,{size:10,className:"text-primary-500"}):null]})},z.id))},D.id))}),o.jsx("tbody",{className:"divide-y divide-slate-100/50",children:L.getRowModel().rows.map(D=>o.jsx("tr",{onClick:z=>{const H=z.target;H.closest("input")||H.closest("select")||H.closest("button")||h!=="profit"&&(s==null||s(D.original))},className:`transition-colors hover:bg-slate-50/70 ${D.getIsSelected()?"bg-primary-50/30":""}`,children:D.getVisibleCells().map(z=>o.jsx("td",{className:"py-1 px-2 overflow-hidden border-b border-slate-50/50",style:{width:z.column.getSize(),minWidth:z.column.id==="image"?(a==null?void 0:a.image_size)==="small"?50:80:"auto"},children:o.jsx("div",{className:`${z.column.id==="image"?"flex justify-center":""} w-full`,children:mg(z.column.columnDef.cell,z.getContext())})},z.id))},D.id))})]}),t.length===0&&o.jsxs("div",{className:"p-20 text-center flex flex-col items-center",children:[o.jsx(bc,{size:48,className:"text-slate-200 mb-4"}),o.jsx("p",{className:"text-slate-400 font-bold",children:"محصولی پیدا نشد"})]})]})},dfe=({items:t,onRollback:e,onFilterChange:n})=>{const[r,i]=W.useState(null),[s,a]=W.useState(null),[u,h]=W.useState(""),[m,g]=W.useState(""),[y,x]=W.useState(!1),[C,E]=W.useState([]),[M,j]=W.useState(null);W.useEffect(()=>{const B={type:u,q:m};r&&r.toDate&&(B.date_from=r.toDate().toLocaleDateString("en-CA")),s&&s.toDate&&(B.date_to=s.toDate().toLocaleDateString("en-CA")),n(B)},[u,r,s,m]);const L=B=>{window.confirm("آیا از بازگردانی این تغییرات مطمئن هستید؟ این عملیات قابل برگشت نیست.")&&e(B)},D=B=>B?B.includes("سفارش")?B:{regular_price:"قیمت عادی",sale_price:"قیمت ویژه",stock:"موجودی",manage_stock:"مدیریت انبار",stock_status:"وضعیت انبار",name:"نام محصول",seo_title:"سئو (عنوان)",seo_description:"سئو (توضیحات)",seo_keywords:"سئو (کلمات)",cost_price:"قیمت خرید",coupon_code:"کد کوپن",coupon_amount:"مبلغ کوپن",coupon_type:"نوع کوپن",coupon_expiry_date:"انقضا کوپن",coupon_usage_limit:"حد استفاده کوپن",coupon_minimum_amount:"حداقل خرید کوپن",coupon_description:"توضیحات کوپن",coupon_deleted:"حذف کوپن",coupon_generated:"ایجاد کوپن",coupon_bulk_update:"ویرایش گروهی کوپن",sku:"SKU",status:"وضعیت"}[B]||B:"نامعلوم",z=B=>({manual:"دستی",automation:"اتوماسیون",bulk_edit:"ویرایش گروهی",import:"درونریزی"})[B]||B,H=B=>{E(te=>te.includes(B)?te.filter(ve=>ve!==B):[...te,B])},V=(B,te=25)=>B?B.length<=te?B:B.slice(0,te)+"... (بیشتر)":"خالی",F=t.reduce((B,te)=>{const ve=B.find(ce=>ce.id===te.batch_id);return ve?ve.items.push(te):B.push({id:te.batch_id,date:te.date,user_name:te.user_name,source:te.source,items:[te]}),B},[]);return o.jsxs("div",{className:"space-y-8",dir:"rtl",children:[o.jsxs("div",{className:"flex items-center gap-3 w-full",children:[o.jsxs("div",{className:"relative flex-1 group",children:[o.jsx("input",{type:"text",value:m,onChange:B=>g(B.target.value),placeholder:"نام محصول یا SKU...",className:"wm-input h-14 !pr-24 !pl-4 focus:!ring-primary-500/10 !text-[13px] font-bold"}),o.jsx("div",{className:"absolute right-1.5 top-1.5 bottom-1.5 w-14 bg-primary-600 text-white rounded-xl flex items-center justify-center shadow-lg shadow-primary-500/10 z-10 transition-transform active:scale-95",children:o.jsx(Ia,{size:22})})]}),o.jsx("div",{className:"flex bg-slate-50 p-1.5 rounded-2xl border border-slate-200 shadow-inner flex-1 h-14 items-center",children:["","product","price","stock","seo","order","coupon"].map(B=>o.jsx("button",{type:"button",onClick:()=>h(B),className:`flex-1 h-full rounded-xl text-[13px] font-bold transition-all flex items-center justify-center gap-2 ${u===B?"bg-white text-primary-600 shadow-sm ring-1 ring-slate-100":"text-slate-500 hover:text-slate-800"}`,children:B===""?"همه":B==="product"?"محصولات":B==="price"?"قیمتها":B==="stock"?"موجودی":B==="seo"?"سئو":B==="order"?"سفارشات":"کوپنها"},B))}),o.jsxs("div",{className:"flex items-center gap-2 bg-white px-5 rounded-2xl border border-slate-200 shadow-soft relative h-14 flex-shrink-0 focus-within:ring-4 focus-within:ring-primary-500/10 focus-within:border-primary-500 transition-all",children:[o.jsx(Ll,{size:18,className:"text-slate-400"}),o.jsx(Dh,{calendar:Hh,locale:Lh,value:r,onChange:i,containerClassName:"h-full flex items-center",render:(B,te)=>o.jsx("input",{onClick:te,value:B,readOnly:!0,placeholder:"از تاریخ",className:"!bg-transparent !border-none !outline-none !shadow-none !h-full font-black w-24 text-center cursor-pointer text-slate-700 text-sm placeholder:text-slate-400 !m-0 !p-0"})}),o.jsx("div",{className:"h-4 w-px bg-slate-200 mx-2"}),o.jsx(Dh,{calendar:Hh,locale:Lh,value:s,onChange:a,containerClassName:"h-full flex items-center",render:(B,te)=>o.jsx("input",{onClick:te,value:B,readOnly:!0,placeholder:"تا تاریخ",className:"!bg-transparent !border-none !outline-none !shadow-none !h-full font-black w-24 text-center cursor-pointer text-slate-700 text-sm placeholder:text-slate-400 !m-0 !p-0"})}),(r||s)&&o.jsx("button",{onClick:()=>{i(null),a(null)},className:"p-1 text-rose-500 hover:bg-rose-50 rounded-lg transition-all ml-1",title:"حذف فیلتر تاریخ",children:o.jsx(T1,{size:14})})]}),o.jsxs("button",{onClick:()=>x(!y),className:`flex items-center gap-3 h-14 px-8 rounded-2xl text-sm font-black transition-all border flex-shrink-0 ${y?"bg-primary-600 text-white border-primary-600 shadow-md active:scale-95":"bg-white text-slate-600 border-slate-200 hover:bg-slate-50 shadow-sm"}`,children:[y?o.jsx(Cae,{size:22}):o.jsx(Zc,{size:22}),y?"نمای انفرادی":"نمای گروهبندی"]})]}),o.jsx("div",{className:"bg-white rounded-[2rem] shadow-sm border border-slate-200 overflow-hidden",children:o.jsxs("div",{className:"divide-y divide-slate-100",children:[y?F.map(B=>o.jsxs("div",{className:"border-b border-slate-50 last:border-0",children:[o.jsxs("div",{onClick:()=>H(B.id),className:"p-6 flex items-center justify-between cursor-pointer hover:bg-slate-50 transition-colors",children:[o.jsxs("div",{className:"flex items-center gap-6",children:[o.jsx("div",{className:"w-12 h-12 bg-indigo-50 text-indigo-600 rounded-2xl flex items-center justify-center",children:o.jsx(Zc,{size:24})}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("h4",{className:"font-black text-slate-800",children:["عملیات گروهی #",B.id?B.id.slice(-6):"---"]}),o.jsxs("span",{className:"text-[10px] px-2 py-0.5 bg-indigo-100 text-indigo-700 rounded-lg font-black",children:[B.items.length," تغییر"]}),B.source&&o.jsx("span",{className:`text-[10px] px-2 py-0.5 rounded-lg font-black ${B.source==="automation"?"bg-amber-100 text-amber-700":"bg-slate-100 text-slate-500"}`,children:z(B.source)})]}),o.jsxs("div",{className:"flex items-center gap-4 mt-1 text-xs text-slate-400",children:[o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx(Ll,{size:12})," ",new Date(B.date).toLocaleString("fa-IR")]}),B.user_name&&o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx(p0,{size:12})," ",B.user_name]})]})]})]}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("button",{onClick:te=>{te.stopPropagation(),L(B.id)},className:"bg-amber-50 text-amber-600 px-5 py-2.5 rounded-xl hover:bg-amber-100 transition-all font-black flex items-center gap-2 border border-amber-200",children:[o.jsx(T1,{size:14}),"بازگردانی کل دسته"]}),C.includes(B.id)?o.jsx(vae,{size:20,className:"text-slate-300"}):o.jsx(Xp,{size:20,className:"text-slate-300"})]})]}),o.jsx(tr,{children:C.includes(B.id)&&o.jsx(ht.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden bg-slate-50/30",children:o.jsx("div",{className:"p-4 space-y-2 border-t border-slate-100",children:B.items.map(te=>o.jsxs("div",{className:"bg-white p-5 rounded-2xl border border-slate-100 flex items-center gap-6 hover:shadow-md transition-all",children:[o.jsx("div",{className:"w-10 h-10 bg-slate-50 text-slate-400 rounded-xl flex items-center justify-center shrink-0 shadow-sm",children:o.jsx(Od,{size:16})}),o.jsxs("div",{className:"flex-[3] min-w-0",children:[o.jsx("div",{className:"text-[13px] font-bold text-slate-800 truncate",children:te.product_name}),o.jsx("div",{className:"text-[11px] text-slate-400 font-bold mt-0.5",children:D(te.field_name)})]}),o.jsxs("div",{className:"flex-[5] flex items-center gap-3 justify-center",children:[o.jsx("span",{onClick:()=>te.old_value&&te.old_value.length>25&&j({title:"مقدار قبلی",value:te.old_value}),className:`text-[13px] text-slate-500 bg-slate-50 px-3 py-1.5 rounded-xl border border-slate-100 line-through opacity-60 text-center flex-1 truncate ${te.old_value&&te.old_value.length>25?"cursor-pointer hover:opacity-100 hover:border-slate-300 transition-all font-black":""}`,children:V(te.old_value)}),o.jsx(h0,{size:12,className:"text-slate-300 transform rotate-180"}),o.jsx("span",{onClick:()=>te.new_value&&te.new_value.length>25&&j({title:"مقدار جدید",value:te.new_value}),className:`text-[13px] text-primary-700 font-bold bg-primary-50 px-3 py-1.5 rounded-xl border border-primary-100 text-center flex-1 truncate ${te.new_value&&te.new_value.length>25?"cursor-pointer hover:bg-primary-100 hover:border-primary-300 transition-all font-black":""}`,children:V(te.new_value)})]}),o.jsxs("div",{className:"flex-[4] flex items-center justify-end gap-3 whitespace-nowrap text-[13px] font-bold text-slate-500",children:[new Date(te.date).toLocaleDateString("fa-IR"),o.jsx("div",{className:"w-px h-3 bg-slate-200"}),new Date(te.date).toLocaleTimeString("fa-IR",{hour:"2-digit",minute:"2-digit"})]})]},te.id))})})})]},B.id)):t.map((B,te)=>o.jsx(hfe,{item:B,index:te,getFieldLabel:D,getSourceLabel:z,onRollback:L,onPreview:(ve,ce)=>j({title:ve,value:ce}),truncate:V},B.id)),t.length===0&&o.jsxs("div",{className:"py-20 text-center space-y-4 opacity-40",children:[o.jsx(T1,{size:64,className:"mx-auto text-slate-300"}),o.jsx("p",{className:"text-xl font-black text-slate-500 italic",children:"موردی یافت نشد"})]})]})}),o.jsx(tr,{children:M&&o.jsxs("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center p-4",children:[o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>j(null),className:"absolute inset-0 bg-slate-900/60 backdrop-blur-sm"}),o.jsx(ht.div,{initial:{scale:.9,opacity:0,y:20},animate:{scale:1,opacity:1,y:0},exit:{scale:.9,opacity:0,y:20},className:"relative w-full max-w-2xl bg-white rounded-[2.5rem] shadow-2xl overflow-hidden",children:o.jsxs("div",{className:"p-8",children:[o.jsxs("div",{className:"flex items-center justify-between mb-6",children:[o.jsx("h3",{className:"text-lg font-black text-slate-800",children:M.title}),o.jsx("button",{onClick:()=>j(null),className:"p-2 bg-slate-100 text-slate-400 rounded-xl hover:bg-rose-50 hover:text-rose-500 transition-all",children:o.jsx(qi,{size:18})})]}),o.jsx("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100 max-h-[60vh] overflow-y-auto leading-relaxed text-slate-700 font-bold text-sm text-right",children:M.value}),o.jsx("button",{onClick:()=>j(null),className:"w-full mt-6 h-14 bg-primary-600 text-white rounded-2xl font-black shadow-xl shadow-primary-500/20 active:scale-95 transition-all",children:"بستن پنجره"})]})})]})})]})},hfe=({item:t,index:e,getFieldLabel:n,getSourceLabel:r,onRollback:i,onPreview:s,truncate:a})=>o.jsxs(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:e*.02},className:"px-6 py-5 hover:bg-slate-50/50 flex items-center gap-6 group transition-all border-b border-slate-50 last:border-0",children:[o.jsx("div",{className:"w-12 h-12 flex-shrink-0 bg-slate-100 rounded-2xl flex items-center justify-center text-slate-500 group-hover:bg-primary-50 group-hover:text-primary-500 transition-colors shadow-sm",children:o.jsx(Od,{size:20})}),o.jsxs("div",{className:"flex-[3] min-w-0",children:[o.jsx("h4",{className:"font-bold text-slate-800 text-[13px] truncate",title:t.product_name||`محصول #${t.product_id}`,children:t.product_name||`محصول #${t.product_id}`}),o.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[o.jsx("span",{className:"text-[11px] text-slate-400 font-bold",children:"ID:"}),o.jsxs("code",{className:"text-[11px] font-bold text-slate-600 bg-slate-100 px-1.5 py-0.5 rounded",children:["#",t.product_id]})]})]}),o.jsxs("div",{className:"flex-[2] flex flex-col gap-1.5 items-start",children:[o.jsxs("span",{className:"text-[13px] px-2.5 py-1 bg-white text-slate-700 rounded-lg font-bold border border-slate-200 shadow-sm flex items-center gap-1.5",children:[o.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-primary-500"}),n(t.field_name)]}),t.source&&o.jsx("span",{className:`text-[12px] px-2 py-0.5 rounded-md font-bold ring-1 ring-inset ${t.source==="automation"?"bg-amber-50 text-amber-700 ring-amber-500/20":t.source==="bulk_edit"?"bg-indigo-50 text-indigo-700 ring-indigo-500/20":"bg-slate-50 text-slate-500 ring-slate-500/20"}`,children:r(t.source)})]}),o.jsxs("div",{className:"flex-[5] flex items-center gap-3",children:[o.jsx("div",{className:"flex-1",children:o.jsx("div",{onClick:()=>t.old_value&&t.old_value.length>25&&s("مقدار قبلی",t.old_value),className:`text-[13px] text-slate-500 bg-white px-3 py-2 rounded-xl border border-slate-200 line-through opacity-60 truncate shadow-sm text-center ${t.old_value&&t.old_value.length>25?"cursor-pointer hover:opacity-100 hover:border-slate-300 transition-all font-black":""}`,children:a(t.old_value)})}),o.jsx("div",{className:"shrink-0",children:o.jsx(h0,{size:14,className:"text-slate-300 transform rotate-180"})}),o.jsx("div",{className:"flex-1",children:o.jsx("div",{onClick:()=>t.new_value&&t.new_value.length>25&&s("مقدار جدید",t.new_value),className:`text-[13px] text-primary-700 font-bold bg-primary-50 px-3 py-2 rounded-xl border border-primary-100 shadow-sm truncate text-center ${t.new_value&&t.new_value.length>25?"cursor-pointer hover:bg-primary-100 hover:border-primary-300 transition-all font-black":""}`,children:a(t.new_value)})})]}),o.jsxs("div",{className:"flex-[4] flex items-center justify-end gap-4 whitespace-nowrap",children:[o.jsxs("div",{className:"flex items-center gap-2 text-slate-600 font-bold text-[13px]",children:[o.jsx(Ll,{size:14,className:"text-slate-400"}),new Date(t.date).toLocaleDateString("fa-IR")]}),o.jsx("div",{className:"w-px h-4 bg-slate-200"}),o.jsxs("div",{className:"flex items-center gap-2 text-slate-600 font-bold text-[13px]",children:[o.jsx(T1,{size:14,className:"text-slate-400"}),new Date(t.date).toLocaleTimeString("fa-IR",{hour:"2-digit",minute:"2-digit"})]}),o.jsx("div",{className:"w-px h-4 bg-slate-200"}),o.jsxs("div",{className:"flex items-center gap-2 text-slate-700 font-bold text-[13px]",children:[o.jsx(p0,{size:14,className:"text-slate-400"}),t.user_name||"سیستم"]})]}),o.jsx("div",{className:"w-12 h-12 flex-shrink-0 flex items-center justify-center",children:o.jsx("button",{onClick:()=>i(t.batch_id),className:"opacity-0 group-hover:opacity-100 bg-white text-rose-500 h-11 w-11 rounded-[1.25rem] hover:bg-rose-50 hover:text-rose-600 transition-all border border-slate-200 flex items-center justify-center shadow-lg hover:shadow-rose-500/10 active:scale-95 translate-x-2 group-hover:translate-x-0",title:"بازگردانی این تغییر",children:o.jsx(T1,{size:18})})})]});let ffe={data:""},mfe=t=>{if(typeof window=="object"){let e=(t?t.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return e.nonce=window.__nonce__,e.parentNode||(t||document.head).appendChild(e),e.firstChild}return t||ffe},pfe=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,gfe=/\/\*[^]*?\*\/| +/g,dY=/\n+/g,gg=(t,e)=>{let n="",r="",i="";for(let s in t){let a=t[s];s[0]=="@"?s[1]=="i"?n=s+" "+a+";":r+=s[1]=="f"?gg(a,s):s+"{"+gg(a,s[1]=="k"?"":e)+"}":typeof a=="object"?r+=gg(a,e?e.replace(/([^,])+/g,u=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,h=>/&/.test(h)?h.replace(/&/g,u):u?u+" "+h:h)):s):a!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=gg.p?gg.p(s,a):s+":"+a+";")}return n+(e&&i?e+"{"+i+"}":i)+r},mm={},hY=t=>{if(typeof t=="object"){let e="";for(let n in t)e+=n+hY(t[n]);return e}return t},vfe=(t,e,n,r,i)=>{let s=hY(t),a=mm[s]||(mm[s]=(h=>{let m=0,g=11;for(;m<h.length;)g=101*g+h.charCodeAt(m++)>>>0;return"go"+g})(s));if(!mm[a]){let h=s!==t?t:(m=>{let g,y,x=[{}];for(;g=pfe.exec(m.replace(gfe,""));)g[4]?x.shift():g[3]?(y=g[3].replace(dY," ").trim(),x.unshift(x[0][y]=x[0][y]||{})):x[0][g[1]]=g[2].replace(dY," ").trim();return x[0]})(t);mm[a]=gg(i?{["@keyframes "+a]:h}:h,n?"":"."+a)}let u=n&&mm.g?mm.g:null;return n&&(mm.g=mm[a]),((h,m,g,y)=>{y?m.data=m.data.replace(y,h):m.data.indexOf(h)===-1&&(m.data=g?h+m.data:m.data+h)})(mm[a],e,r,u),a},bfe=(t,e,n)=>t.reduce((r,i,s)=>{let a=e[s];if(a&&a.call){let u=a(n),h=u&&u.props&&u.props.className||/^go/.test(u)&&u;a=h?"."+h:u&&typeof u=="object"?u.props?"":gg(u,""):u===!1?"":u}return r+i+(a??"")},"");function hT(t){let e=this||{},n=t.call?t(e.p):t;return vfe(n.unshift?n.raw?bfe(n,[].slice.call(arguments,1),e.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(e.p):i),{}):n,mfe(e.target),e.g,e.o,e.k)}let fY,HH,LH;hT.bind({g:1});let pm=hT.bind({k:1});function yfe(t,e,n,r){gg.p=e,fY=t,HH=n,LH=r}function vg(t,e){let n=this||{};return function(){let r=arguments;function i(s,a){let u=Object.assign({},s),h=u.className||i.className;n.p=Object.assign({theme:HH&&HH()},u),n.o=/ *go\d+/.test(h),u.className=hT.apply(n,r)+(h?" "+h:"");let m=t;return t[0]&&(m=u.as||t,delete u.as),LH&&m[0]&&LH(u),fY(m,u)}return i}}var xfe=t=>typeof t=="function",fT=(t,e)=>xfe(t)?t(e):t,wfe=(()=>{let t=0;return()=>(++t).toString()})(),mY=(()=>{let t;return()=>{if(t===void 0&&typeof window<"u"){let e=matchMedia("(prefers-reduced-motion: reduce)");t=!e||e.matches}return t}})(),Cfe=20,$H="default",pY=(t,e)=>{let{toastLimit:n}=t.settings;switch(e.type){case 0:return{...t,toasts:[e.toast,...t.toasts].slice(0,n)};case 1:return{...t,toasts:t.toasts.map(a=>a.id===e.toast.id?{...a,...e.toast}:a)};case 2:let{toast:r}=e;return pY(t,{type:t.toasts.find(a=>a.id===r.id)?1:0,toast:r});case 3:let{toastId:i}=e;return{...t,toasts:t.toasts.map(a=>a.id===i||i===void 0?{...a,dismissed:!0,visible:!1}:a)};case 4:return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(a=>a.id!==e.toastId)};case 5:return{...t,pausedAt:e.time};case 6:let s=e.time-(t.pausedAt||0);return{...t,pausedAt:void 0,toasts:t.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+s}))}}},mT=[],gY={toasts:[],pausedAt:void 0,settings:{toastLimit:Cfe}},$h={},vY=(t,e=$H)=>{$h[e]=pY($h[e]||gY,t),mT.forEach(([n,r])=>{n===e&&r($h[e])})},bY=t=>Object.keys($h).forEach(e=>vY(t,e)),Sfe=t=>Object.keys($h).find(e=>$h[e].toasts.some(n=>n.id===t)),pT=(t=$H)=>e=>{vY(e,t)},Rfe={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},_fe=(t={},e=$H)=>{let[n,r]=W.useState($h[e]||gY),i=W.useRef($h[e]);W.useEffect(()=>(i.current!==$h[e]&&r($h[e]),mT.push([e,r]),()=>{let a=mT.findIndex(([u])=>u===e);a>-1&&mT.splice(a,1)}),[e]);let s=n.toasts.map(a=>{var u,h,m;return{...t,...t[a.type],...a,removeDelay:a.removeDelay||((u=t[a.type])==null?void 0:u.removeDelay)||(t==null?void 0:t.removeDelay),duration:a.duration||((h=t[a.type])==null?void 0:h.duration)||(t==null?void 0:t.duration)||Rfe[a.type],style:{...t.style,...(m=t[a.type])==null?void 0:m.style,...a.style}}});return{...n,toasts:s}},Efe=(t,e="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:e,ariaProps:{role:"status","aria-live":"polite"},message:t,pauseDuration:0,...n,id:(n==null?void 0:n.id)||wfe()}),X1=t=>(e,n)=>{let r=Efe(e,t,n);return pT(r.toasterId||Sfe(r.id))({type:2,toast:r}),r.id},Jo=(t,e)=>X1("blank")(t,e);Jo.error=X1("error"),Jo.success=X1("success"),Jo.loading=X1("loading"),Jo.custom=X1("custom"),Jo.dismiss=(t,e)=>{let n={type:3,toastId:t};e?pT(e)(n):bY(n)},Jo.dismissAll=t=>Jo.dismiss(void 0,t),Jo.remove=(t,e)=>{let n={type:4,toastId:t};e?pT(e)(n):bY(n)},Jo.removeAll=t=>Jo.remove(void 0,t),Jo.promise=(t,e,n)=>{let r=Jo.loading(e.loading,{...n,...n==null?void 0:n.loading});return typeof t=="function"&&(t=t()),t.then(i=>{let s=e.success?fT(e.success,i):void 0;return s?Jo.success(s,{id:r,...n,...n==null?void 0:n.success}):Jo.dismiss(r),i}).catch(i=>{let s=e.error?fT(e.error,i):void 0;s?Jo.error(s,{id:r,...n,...n==null?void 0:n.error}):Jo.dismiss(r)}),t};var Nfe=1e3,kfe=(t,e="default")=>{let{toasts:n,pausedAt:r}=_fe(t,e),i=W.useRef(new Map).current,s=W.useCallback((y,x=Nfe)=>{if(i.has(y))return;let C=setTimeout(()=>{i.delete(y),a({type:4,toastId:y})},x);i.set(y,C)},[]);W.useEffect(()=>{if(r)return;let y=Date.now(),x=n.map(C=>{if(C.duration===1/0)return;let E=(C.duration||0)+C.pauseDuration-(y-C.createdAt);if(E<0){C.visible&&Jo.dismiss(C.id);return}return setTimeout(()=>Jo.dismiss(C.id,e),E)});return()=>{x.forEach(C=>C&&clearTimeout(C))}},[n,r,e]);let a=W.useCallback(pT(e),[e]),u=W.useCallback(()=>{a({type:5,time:Date.now()})},[a]),h=W.useCallback((y,x)=>{a({type:1,toast:{id:y,height:x}})},[a]),m=W.useCallback(()=>{r&&a({type:6,time:Date.now()})},[r,a]),g=W.useCallback((y,x)=>{let{reverseOrder:C=!1,gutter:E=8,defaultPosition:M}=x||{},j=n.filter(z=>(z.position||M)===(y.position||M)&&z.height),L=j.findIndex(z=>z.id===y.id),D=j.filter((z,H)=>H<L&&z.visible).length;return j.filter(z=>z.visible).slice(...C?[D+1]:[0,D]).reduce((z,H)=>z+(H.height||0)+E,0)},[n]);return W.useEffect(()=>{n.forEach(y=>{if(y.dismissed)s(y.id,y.removeDelay);else{let x=i.get(y.id);x&&(clearTimeout(x),i.delete(y.id))}})},[n,s]),{toasts:n,handlers:{updateHeight:h,startPause:u,endPause:m,calculateOffset:g}}},Tfe=pm` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,jfe=pm` from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; }`,Mfe=pm` from { transform: scale(0) rotate(90deg); opacity: 0; } to { transform: scale(1) rotate(90deg); opacity: 1; }`,Pfe=vg("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${t=>t.primary||"#ff4b4b"}; position: relative; transform: rotate(45deg); animation: ${Tfe} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; animation: ${jfe} 0.15s ease-out forwards; animation-delay: 150ms; position: absolute; border-radius: 3px; opacity: 0; background: ${t=>t.secondary||"#fff"}; bottom: 9px; left: 4px; height: 2px; width: 12px; } &:before { animation: ${Mfe} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } `,Afe=pm` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `,Ofe=vg("div")` width: 12px; height: 12px; box-sizing: border-box; border: 2px solid; border-radius: 100%; border-color: ${t=>t.secondary||"#e0e0e0"}; border-right-color: ${t=>t.primary||"#616161"}; animation: ${Afe} 1s linear infinite; `,Ife=pm` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,Dfe=pm` 0% { height: 0; width: 0; opacity: 0; } 40% { height: 0; width: 6px; opacity: 1; } 100% { opacity: 1; height: 10px; }`,Hfe=vg("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${t=>t.primary||"#61d345"}; position: relative; transform: rotate(45deg); animation: ${Ife} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; animation: ${Dfe} 0.2s ease-out forwards; opacity: 0; animation-delay: 200ms; position: absolute; border-right: 2px solid; border-bottom: 2px solid; border-color: ${t=>t.secondary||"#fff"}; bottom: 6px; left: 6px; height: 10px; width: 6px; } `,Lfe=vg("div")` position: absolute; `,$fe=vg("div")` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; `,Ffe=pm` from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; }`,zfe=vg("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; animation: ${Ffe} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; `,Vfe=({toast:t})=>{let{icon:e,type:n,iconTheme:r}=t;return e!==void 0?typeof e=="string"?W.createElement(zfe,null,e):e:n==="blank"?null:W.createElement($fe,null,W.createElement(Ofe,{...r}),n!=="loading"&&W.createElement(Lfe,null,n==="error"?W.createElement(Pfe,{...r}):W.createElement(Hfe,{...r})))},Bfe=t=>` 0% {transform: translate3d(0,${t*-200}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} `,Wfe=t=>` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 100% {transform: translate3d(0,${t*-150}%,-1px) scale(.6); opacity:0;} `,Ufe="0%{opacity:0;} 100%{opacity:1;}",Yfe="0%{opacity:1;} 100%{opacity:0;}",Gfe=vg("div")` display: flex; align-items: center; background: #fff; color: #363636; line-height: 1.3; will-change: transform; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); max-width: 350px; pointer-events: auto; padding: 8px 10px; border-radius: 8px; `,Kfe=vg("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; `,qfe=(t,e)=>{let n=t.includes("top")?1:-1,[r,i]=mY()?[Ufe,Yfe]:[Bfe(n),Wfe(n)];return{animation:e?`${pm(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${pm(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Xfe=W.memo(({toast:t,position:e,style:n,children:r})=>{let i=t.height?qfe(t.position||e||"top-center",t.visible):{opacity:0},s=W.createElement(Vfe,{toast:t}),a=W.createElement(Kfe,{...t.ariaProps},fT(t.message,t));return W.createElement(Gfe,{className:t.className,style:{...i,...n,...t.style}},typeof r=="function"?r({icon:s,message:a}):W.createElement(W.Fragment,null,s,a))});yfe(W.createElement);var Qfe=({id:t,className:e,style:n,onHeightUpdate:r,children:i})=>{let s=W.useCallback(a=>{if(a){let u=()=>{let h=a.getBoundingClientRect().height;r(t,h)};u(),new MutationObserver(u).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[t,r]);return W.createElement("div",{ref:s,className:e,style:n},i)},Zfe=(t,e)=>{let n=t.includes("top"),r=n?{top:0}:{bottom:0},i=t.includes("center")?{justifyContent:"center"}:t.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:mY()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${e*(n?1:-1)}px)`,...r,...i}},Jfe=hT` z-index: 9999; > * { pointer-events: auto; } `,gT=16,eme=({reverseOrder:t,position:e="top-center",toastOptions:n,gutter:r,children:i,toasterId:s,containerStyle:a,containerClassName:u})=>{let{toasts:h,handlers:m}=kfe(n,s);return W.createElement("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:gT,left:gT,right:gT,bottom:gT,pointerEvents:"none",...a},className:u,onMouseEnter:m.startPause,onMouseLeave:m.endPause},h.map(g=>{let y=g.position||e,x=m.calculateOffset(g,{reverseOrder:t,gutter:r,defaultPosition:e}),C=Zfe(y,x);return W.createElement(Qfe,{id:g.id,key:g.id,onHeightUpdate:m.updateHeight,className:g.visible?Jfe:"",style:C},g.type==="custom"?fT(g.message,g):i?i(g):W.createElement(Xfe,{toast:g,position:y}))}))},ze=Jo;const tme=()=>{const[t,e]=W.useState(!1),[n,r]=W.useState(!1),[i,s]=W.useState([]),[a,u]=W.useState(""),[h,m]=W.useState("upload"),[g,y]=W.useState([]),[x,C]=W.useState([]),[E,M]=W.useState({}),[j,L]=W.useState(null),[D,z]=W.useState("plugin"),[H,V]=W.useState(["شناسه","شناسه محصول (SKU)","نام محصول","قیمت اصلی","قیمت ویژه","موجودی","وضعیت موجودی","دستهبندیها"]),F=["شناسه","شناسه محصول (SKU)","نام محصول","نوع محصول","قیمت اصلی","قیمت ویژه","تاریخ شروع حراج","تاریخ پایان حراج","موجودی","وضعیت موجودی","مدیریت موجودی","دستهبندیها","عنوان سئو","توضیحات سئو","کلمات کلیدی سئو"];W.useEffect(()=>{B()},[]);const B=async()=>{try{const Le=await(await fetch(`${window.woocommersa_data.apiUrl}/categories`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();Le&&Le.success&&Array.isArray(Le.data)?s(Le.data):Array.isArray(Le)?s(Le):s([])}catch{console.error("Failed to fetch categories"),s([])}},te=async()=>{e(!0);try{const pe=new URL(`${window.woocommersa_data.apiUrl}/export`);a&&pe.searchParams.append("category",a),pe.searchParams.append("columns",H.join(","));const Fe=await(await fetch(pe.toString(),{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).blob(),nt=window.URL.createObjectURL(Fe),dt=document.createElement("a");dt.href=nt,dt.download=`woocommersa_export_${new Date().toISOString().split("T")[0]}.csv`,document.body.appendChild(dt),dt.click(),dt.remove(),ze.success("خروجی با موفقیت فرستاده شد")}catch{ze.error("خطا در دریافت خروجی")}finally{e(!1)}},ve=async pe=>{var nt;const Le=(nt=pe.target.files)==null?void 0:nt[0];if(!Le)return;r(!0);const Fe=new FormData;Fe.append("file",Le);try{const $e=await(await fetch(`${window.woocommersa_data.apiUrl}/import/parse`,{method:"POST",headers:{"X-WP-Nonce":window.woocommersa_data.nonce},body:Fe})).json();if($e.success){y($e.columns),C($e.fields),L(Le),m("source");const Re={};$e.columns.forEach(Ze=>{const Ee=$e.fields.find(Q=>Q.label.toLowerCase()===Ze.toLowerCase()||Q.id.toLowerCase()===Ze.toLowerCase());Ee&&(Re[Ze]=Ee.id)}),M(Re)}else ze.error($e.message)}catch{ze.error("خطا در تحلیل فایل")}finally{r(!1)}},ce=pe=>{z(pe);const Le={};g.forEach(Fe=>{var dt;let nt="";if(pe==="plugin")nt=((dt=x.find($e=>$e.label===Fe||$e.id===Fe))==null?void 0:dt.id)||"";else{const $e=Fe.toLowerCase();$e.includes("sku")||$e.includes("کد کالا")||$e.includes("شناسه")?nt="sku":$e.includes("price")||$e.includes("قیمت")?nt="regular_price":$e.includes("stock")||$e.includes("موجودی")?nt="stock":($e.includes("name")||$e.includes("عنوان"))&&(nt="name")}nt&&(Le[Fe]=nt)}),M(Le),m("mapping")},_e=async()=>{if(!j)return;const pe=Object.values(E);if(!pe.includes("sku")&&!pe.includes("id")){ze.error("انتخاب ستون شناسه (ID) یا SKU برای شناسایی محصولات الزامی است");return}m("processing");const Le=new FormData;Le.append("file",j),Le.append("mapping",JSON.stringify(E)),Le.append("source_type",D);try{const nt=await(await fetch(`${window.woocommersa_data.apiUrl}/import`,{method:"POST",headers:{"X-WP-Nonce":window.woocommersa_data.nonce},body:Le})).json();nt.success?(ze.success(`درونریزی انجام شد: ${nt.updated} بروزرسانی، ${nt.skipped} نادیده گرفته شد`),m("upload"),L(null)):(ze.error(nt.message),m("mapping"))}catch{ze.error("خطا در انجام درونریزی"),m("mapping")}};return o.jsxs("div",{className:"space-y-8",dir:"rtl",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[o.jsxs("div",{className:"wm-glass-panel p-10 rounded-[2.5rem] bg-white border border-slate-200 shadow-xl shadow-slate-200/50 flex flex-col",children:[o.jsx("div",{className:"w-20 h-20 rounded-3xl bg-primary-50 text-primary-600 flex items-center justify-center mb-8 self-center shadow-inner",children:o.jsx(om,{size:40})}),o.jsx("h2",{className:"wm-title-lg text-slate-800 text-center mb-3",children:"برونبری محصولات (Export)"}),o.jsx("p",{className:"text-slate-500 text-center leading-relaxed mb-8",children:"دریافت لیست هوشمند محصولات برای ویرایش آفلاین در اکسل."}),o.jsxs("div",{className:"space-y-6 mt-auto",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsxs("label",{className:"wm-label text-slate-400 mr-2 flex items-center gap-2",children:[o.jsx(sg,{size:14})," فیلتر بر اساس دسته:"]}),o.jsxs("div",{className:"relative group",children:[o.jsxs("select",{value:a,onChange:pe=>u(pe.target.value),className:"w-full h-14 bg-slate-50 border border-slate-200 rounded-2xl px-6 wm-label outline-none appearance-none focus:border-primary-500 focus:bg-white transition-all",children:[o.jsx("option",{value:"",children:"همه دستهبندیها"}),Array.isArray(i)&&i.map(pe=>o.jsx("option",{value:pe.id,children:pe.name},pe.id))]}),o.jsx(Xp,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 pointer-events-none group-hover:text-primary-500 transition-colors",size:18})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("label",{className:"wm-label text-slate-400 mr-2 flex items-center gap-2",children:[o.jsx(sg,{size:14})," انتخاب ستونهای خروجی:"]}),o.jsx("div",{className:"grid grid-cols-2 gap-2 bg-slate-50 p-4 rounded-2xl border border-slate-100 max-h-40 overflow-y-auto custom-scrollbar",children:F.map(pe=>o.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",children:[o.jsx("input",{type:"checkbox",checked:H.includes(pe),disabled:pe==="شناسه"||pe==="شناسه محصول (SKU)"||pe==="نام محصول"||pe==="قیمت اصلی",onChange:Le=>{Le.target.checked?V([...H,pe]):V(H.filter(Fe=>Fe!==pe))},className:"w-4 h-4 rounded border-slate-300 text-primary-600 focus:ring-primary-500"}),o.jsx("span",{className:`text-[10px] font-bold ${H.includes(pe)?"text-slate-700":"text-slate-400"} group-hover:text-primary-600 transition-colors`,children:pe})]},pe))})]}),o.jsxs("button",{onClick:te,disabled:t,className:"w-full h-16 rounded-2xl bg-slate-900 text-white wm-label hover:bg-black shadow-2xl shadow-slate-900/20 transition-all flex items-center justify-center gap-3 active:scale-95",children:[t?o.jsx(ur,{className:"animate-spin"}):o.jsx(FU,{}),t?"در حال آمادهسازی...":"دانلود فایل هوشمند CSV"]})]})]}),o.jsxs("div",{className:"wm-glass-panel p-10 rounded-[2.5rem] bg-indigo-50/30 border border-indigo-100 shadow-xl shadow-indigo-100/50 flex flex-col relative overflow-hidden",children:[o.jsx("div",{className:"w-20 h-20 rounded-3xl bg-indigo-600 text-white flex items-center justify-center mb-8 self-center shadow-lg shadow-indigo-200",children:o.jsx(i2,{size:40})}),o.jsxs(tr,{mode:"wait",children:[h==="upload"&&o.jsxs(ht.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"flex-1 flex flex-col",children:[o.jsx("h2",{className:"wm-title-lg text-slate-800 text-center mb-3",children:"درونریزی هوشمند (Import)"}),o.jsx("p",{className:"text-slate-500 text-center leading-relaxed mb-8",children:"فایل اکسل خود را اینجا رها کنید تا سیستم بهصورت خودکار ستونها را شناسایی کند."}),o.jsx("div",{className:`w-full h-48 border-4 border-dashed border-indigo-200 rounded-[2rem] flex flex-col items-center justify-center bg-white hover:border-indigo-400 hover:bg-indigo-50/50 cursor-pointer transition-all group relative ${n?"opacity-50":""}`,children:o.jsxs("label",{className:"cursor-pointer flex flex-col items-center w-full h-full justify-center",children:[n?o.jsx(ur,{className:"animate-spin text-indigo-500",size:40}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"p-4 rounded-full bg-indigo-50 text-indigo-500 group-hover:scale-110 transition-transform",children:o.jsx(Sx,{size:40})}),o.jsx("span",{className:"text-sm font-black text-indigo-400 mt-4",children:"انتخاب فایل CSV"})]}),o.jsx("input",{type:"file",accept:".csv",className:"hidden",onChange:ve,disabled:n})]})})]},"upload"),h==="source"&&o.jsxs(ht.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"flex-1 flex flex-col items-center justify-center text-center space-y-6",children:[o.jsx("h3",{className:"wm-title-md text-slate-800",children:"منبع فایل ورودی را مشخص کنید"}),o.jsx("p",{className:"text-slate-500 text-sm",children:"این مورد به شناسایی و تطبیق بهتر ستونها کمک میکند."}),o.jsxs("div",{className:"grid grid-cols-1 w-full gap-4",children:[o.jsx("button",{onClick:()=>ce("plugin"),className:"p-6 rounded-3xl border-2 border-indigo-100 bg-white hover:border-indigo-600 hover:shadow-lg transition-all text-right group",children:o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"p-3 rounded-2xl bg-indigo-50 text-indigo-600 group-hover:bg-indigo-600 group-hover:text-white transition-colors",children:o.jsx(FU,{})}),o.jsxs("div",{children:[o.jsx("span",{className:"block font-black text-slate-800",children:"خروجی همین افزونه"}),o.jsx("span",{className:"block text-xs text-slate-400 mt-1",children:"فایلی که قبلا از بخش برونبری دانلود و ویرایش شده است."})]})]})}),o.jsx("button",{onClick:()=>ce("accounting"),className:"p-6 rounded-3xl border-2 border-slate-100 bg-white hover:border-indigo-600 hover:shadow-lg transition-all text-right group",children:o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"p-3 rounded-2xl bg-slate-50 text-slate-400 group-hover:bg-indigo-600 group-hover:text-white transition-colors",children:o.jsx(sg,{})}),o.jsxs("div",{children:[o.jsx("span",{className:"block font-black text-slate-800",children:"فایل نرمافزار حسابداری"}),o.jsx("span",{className:"block text-xs text-slate-400 mt-1",children:"فایلهای ورودی از سپیدار، هلو و سایر سیستمهای مالی."})]})]})})]})]},"source"),h==="mapping"&&o.jsxs(ht.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"flex-1 flex flex-col",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("h3",{className:"font-black text-slate-800 flex items-center gap-2",children:[o.jsx(sg,{size:20,className:"text-indigo-600"})," تطبیق ستونها (",D==="plugin"?"فایل افزونه":"فایل متفرقه",")"]}),o.jsx("button",{onClick:()=>m("upload"),className:"text-slate-400 hover:text-rose-500 transition-colors",children:o.jsx(qi,{size:20})})]}),o.jsx("div",{className:"bg-white rounded-3xl border border-indigo-100 divide-y divide-slate-100 max-h-56 overflow-y-auto custom-scrollbar mb-6",children:g.map(pe=>o.jsxs("div",{className:"p-4 flex items-center justify-between gap-4",children:[o.jsx("span",{className:"text-xs font-bold text-slate-500 truncate max-w-[120px]",children:pe}),o.jsx(h0,{size:14,className:"text-slate-200 rotate-180"}),o.jsxs("select",{value:E[pe]||"",onChange:Le=>M({...E,[pe]:Le.target.value}),className:"bg-slate-50 border-none px-4 py-2 rounded-xl text-xs font-black outline-none focus:ring-2 ring-indigo-500/20",children:[o.jsx("option",{value:"",children:"نادیده بگیرید"}),x.map(Le=>o.jsx("option",{value:Le.id,children:Le.label},Le.id))]})]},pe))}),o.jsxs("button",{onClick:_e,className:"w-full h-14 rounded-2xl bg-indigo-600 text-white wm-label hover:bg-indigo-700 shadow-xl shadow-indigo-600/20 flex items-center justify-center gap-3 mt-auto",children:[o.jsx(ho,{size:20})," شروع عملیات بروزرسانی"]})]},"mapping"),h==="processing"&&o.jsxs(ht.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"flex-1 flex flex-col items-center justify-center py-10",children:[o.jsxs("div",{className:"relative w-24 h-24 mb-6",children:[o.jsx("div",{className:"absolute inset-0 border-4 border-indigo-100 rounded-full"}),o.jsx("div",{className:"absolute inset-0 border-4 border-indigo-600 rounded-full border-t-transparent animate-spin"}),o.jsx(ur,{className:"absolute inset-0 m-auto text-indigo-600",size:32})]}),o.jsx("h3",{className:"text-xl font-black text-slate-800 mb-2",children:"در حال پردازش دادهها..."}),o.jsx("p",{className:"text-slate-400 text-sm",children:"لطفا این صفحه را نبندید."})]},"processing")]})]})]}),o.jsxs("div",{className:"bg-amber-50 border border-amber-200 p-6 rounded-[2rem] flex gap-4 items-start",children:[o.jsx(r2,{className:"text-amber-500 shrink-0 mt-1",size:24}),o.jsxs("div",{children:[o.jsx("h4",{className:"font-black text-amber-800 mb-1",children:"نکات امنیتی درونریزی:"}),o.jsxs("ul",{className:"text-sm text-amber-700 space-y-1 list-disc list-inside opacity-80",children:[o.jsxs("li",{children:["سیستم محصولات را بر اساس ",o.jsx("b",{children:"شناسه محصول (SKU)"})," شناسایی و بروزرسانی میکند."]}),o.jsx("li",{children:"برای فیلدهای سئو، سیستم هر دو افزونه RankMath و Yoast را پشتیبانی میکند."}),o.jsx("li",{children:"توصیه میشود قبل از درونریزی حجیم، حتما از دیتابیس خود نسخه پشتیبان تهیه کنید."})]})]})]})]})},nme=({onFilterRequest:t})=>{const[e,n]=W.useState(null),[r,i]=W.useState(!0),s=async()=>{i(!0);try{const y=await(await fetch(`${window.woocommersa_data.apiUrl}/health?force_refresh=1`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();n(y)}catch(g){console.error("Error fetching health stats:",g)}finally{i(!1)}};W.useEffect(()=>{s()},[]);const a=()=>{if(!e||e.total_products===0)return 0;const y=[e.no_image/e.total_products*20,e.no_price/e.total_products*25,e.no_seo/e.total_products*15,e.no_sku/e.total_products*10,e.no_description/e.total_products*10,e.out_of_stock/e.total_products*10,e.duplicate_skus/e.total_products*10].reduce((x,C)=>x+C,0);return Math.max(0,Math.min(100,Math.round(100-y)))},u=g=>!(e!=null&&e.total_products)||!g?0:Math.round(g/e.total_products*100),h=a(),m=[{id:"no_image",title:"بدون تصویر",value:e==null?void 0:e.no_image,icon:zU,color:"text-rose-600",bg:"bg-rose-50",border:"border-rose-100",hover:"hover:border-rose-300",action:"رفع در ویرایشگر تصاویر"},{id:"no_price",title:"بدون قیمت",value:e==null?void 0:e.no_price,icon:KD,color:"text-rose-600",bg:"bg-rose-50",border:"border-rose-100",hover:"hover:border-rose-300",action:"قیمتگذاری سریع"},{id:"no_seo",title:"بدون سئو",value:e==null?void 0:e.no_seo,icon:Ia,color:"text-amber-600",bg:"bg-amber-50",border:"border-amber-100",hover:"hover:border-amber-300",action:"سئو خودکار"},{id:"out_of_stock",title:"ناموجود",value:e==null?void 0:e.out_of_stock,icon:bc,color:"text-orange-600",bg:"bg-orange-50",border:"border-orange-100",hover:"hover:border-orange-300",action:"بررسی موجودی"},{id:"duplicate_skus",title:"SKU تکراری",value:e==null?void 0:e.duplicate_skus,icon:Ph,color:"text-rose-700",bg:"bg-rose-100/50",border:"border-rose-200",hover:"hover:border-rose-400",action:"یکتا سازی کدها"},{id:"no_category",title:"بدون دستهبندی",value:e==null?void 0:e.no_category,icon:Zc,color:"text-indigo-600",bg:"bg-indigo-50",border:"border-indigo-100",hover:"hover:border-indigo-300",action:"دستهبندی سریع"},{id:"heavy_images",title:"تصاویر حجیم",value:e==null?void 0:e.heavy_images,icon:qs,color:"text-blue-600",bg:"bg-blue-50",border:"border-blue-100",hover:"hover:border-blue-300",action:"بهینهسازی حجم"}];return r?o.jsxs("div",{className:"p-20 flex flex-col items-center justify-center space-y-6 h-[70vh]",children:[o.jsxs("div",{className:"relative",children:[o.jsx(ur,{className:"animate-spin text-primary-500",size:64}),o.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:o.jsx(qs,{className:"text-primary-200",size:24})})]}),o.jsxs("div",{className:"text-center space-y-2",children:[o.jsx("h2",{className:"text-2xl font-black text-slate-800",children:"تحقیق در وضعیت سلامت فروشگاه..."}),o.jsx("p",{className:"text-slate-400 font-bold",children:"ما در حال آنالیز کوئریهای دیتابیس شما هستیم."})]})]}):o.jsxs("div",{className:"space-y-6",dir:"rtl",children:[o.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 items-stretch",children:[o.jsxs("div",{className:"flex-1 bg-white p-8 rounded-[2rem] shadow-sm border border-slate-200 flex flex-col justify-center relative overflow-hidden",children:[o.jsxs("div",{className:"relative z-10 space-y-4",children:[o.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-primary-50 text-primary-600 border border-primary-100",children:[o.jsx(og,{size:14}),o.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest",children:"پایش زنده سلامت"})]}),o.jsx("h1",{className:"text-2xl font-black text-slate-800 leading-tight",children:"گزارش هوشمند سلامت محصولات"}),o.jsx("p",{className:"text-slate-500 text-xs max-w-lg font-bold",children:"آنالیز ۷ پارامتر حیاتی برای بهبود تجربه مشتری و سئو گوگل."}),o.jsxs("div",{className:"flex gap-3",children:[o.jsxs("button",{onClick:s,className:"h-10 px-5 bg-slate-100 text-slate-700 rounded-xl font-black text-[11px] hover:bg-slate-200 transition-all flex items-center gap-2",children:[o.jsx(ur,{size:14,className:r?"animate-spin":""})," بروزرسانی"]}),o.jsxs("div",{className:"h-10 flex items-center gap-2 px-5 rounded-xl bg-slate-50 border border-slate-100 text-slate-400 text-[11px] font-bold",children:[o.jsx(bc,{size:14})," ",e==null?void 0:e.total_products," محصول"]})]})]}),o.jsx(qs,{size:180,className:"absolute -left-10 -bottom-10 text-slate-50 rotate-12"})]}),o.jsxs("div",{className:"bg-white p-6 rounded-[2rem] shadow-sm border border-slate-200 flex items-center gap-8 min-w-[320px]",children:[o.jsxs("div",{className:"relative flex-shrink-0",children:[o.jsxs("svg",{className:"w-24 h-24 transform -rotate-90",children:[o.jsx("circle",{cx:"48",cy:"48",r:"40",stroke:"currentColor",strokeWidth:"8",fill:"transparent",className:"text-slate-100"}),o.jsx(ht.circle,{cx:"48",cy:"48",r:"40",stroke:"currentColor",strokeWidth:"8",fill:"transparent",strokeDasharray:2*Math.PI*40,initial:{strokeDashoffset:2*Math.PI*40},animate:{strokeDashoffset:2*Math.PI*40*(1-h/100)},className:h>80?"text-emerald-500":h>50?"text-amber-500":"text-rose-500"})]}),o.jsxs("div",{className:"absolute inset-0 flex items-center justify-center font-black text-xl text-slate-800",children:[h,"٪"]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("div",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"امتیاز سلامت"}),o.jsx("div",{className:`px-3 py-1 rounded-lg font-black text-[11px] w-fit ${h>80?"bg-emerald-50 text-emerald-600":h>50?"bg-amber-50 text-amber-600":"bg-rose-50 text-rose-600"}`,children:h>80?"عالی":h>50?"نیازمند رسیدگی":"وضعیت بحرانی"})]})]})]}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"p-3 bg-primary-600 rounded-2xl shadow-lg shadow-primary-500/20",children:o.jsx(Hr,{size:20,className:"text-white"})}),o.jsx("h3",{className:"text-xl font-black text-slate-900",children:"جزئیات پارامترهای فنی"})]}),o.jsx("p",{className:"text-xs font-bold text-slate-400",children:"کلیک روی هر کارت برای مشاهده لیست محصولات"})]}),o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-4",children:m.map((g,y)=>o.jsx(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:y*.05},children:o.jsxs("div",{className:`bg-white border ${g.border} hover:border-primary-300 p-5 rounded-3xl transition-all duration-200 hover:shadow-md cursor-pointer group`,onClick:()=>t(g.id),children:[o.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[o.jsx("div",{className:`w-12 h-12 ${g.bg} ${g.color} rounded-2xl flex items-center justify-center shrink-0`,children:o.jsx(g.icon,{size:24})}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"text-[10px] font-black text-slate-400 uppercase tracking-wider",children:g.title}),o.jsx("div",{className:"text-2xl font-black text-slate-900 leading-none mt-1",children:g.value||0})]})]}),o.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-slate-50",children:[o.jsxs("span",{className:`text-[9px] font-black px-2 py-1 rounded-lg ${g.bg} ${g.color}`,children:[u(g.value),"٪ کل"]}),o.jsxs("div",{className:"flex items-center gap-1 text-[10px] font-bold text-slate-400 group-hover:text-primary-600 transition-colors",children:[g.action," ",o.jsx(MU,{size:12})]})]})]})},g.id))})]}),o.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col md:flex-row items-center gap-6",children:[o.jsx("div",{className:"w-12 h-12 flex-shrink-0 bg-primary-600 text-white rounded-2xl flex items-center justify-center shadow-lg shadow-primary-500/10",children:o.jsx(og,{size:24})}),o.jsxs("div",{className:"flex-1 space-y-1 text-center md:text-right",children:[o.jsx("h4",{className:"text-sm font-black text-slate-800",children:"پیشنهاد سیستم: اولویتبندی بر اساس بازخورد"}),o.jsxs("p",{className:"text-[11px] text-slate-500 font-bold leading-relaxed",children:["اولویتهای شما: ۱. ",o.jsx("span",{className:"text-rose-600",children:"اصلاح قیمتها"})," ۲. ",o.jsx("span",{className:"text-amber-600",children:"بهینهسازی سئو تصاویر"}),"."]})]}),o.jsxs("button",{onClick:()=>t("no_price"),className:"h-11 px-8 bg-slate-900 text-white rounded-xl font-black text-[11px] hover:bg-slate-800 transition-all flex items-center gap-2",children:["مشاهده پیشنهادات هوشمند ",o.jsx(f0,{size:16,className:"rotate-180"})]})]})]})},rme=({onNavigate:t})=>{var fe,Ve;const[e,n]=W.useState([]),[r,i]=W.useState(!1),[s,a]=W.useState(!1),[u,h]=W.useState([]),[m,g]=W.useState({name:"",condition_field:"stock",condition_operator:">",condition_value:"",action_type:"discount",action_value:"",action_unit:"percent",target_price:"regular_price",min_margin_percent:"0"}),[y,x]=W.useState([]),[C,E]=W.useState([]),[M,j]=W.useState({enabled:!1,interval:"hourly"}),[L,D]=W.useState(!1),[z,H]=W.useState(!1),[V,F]=W.useState(null),[B,te]=W.useState(!1),ve=async()=>{a(!0);try{const xe=await(await fetch(`${window.woocommersa_data.apiUrl}/pricing-rules`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();n(Array.isArray(xe)?xe:[])}catch(ne){console.error(ne),ze.error("خطا در دریافت قوانین"),n([])}finally{a(!1)}},ce=async()=>{try{const xe=await(await fetch(`${window.woocommersa_data.apiUrl}/categories`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();xe&&xe.success&&Array.isArray(xe.data)?x(xe.data):Array.isArray(xe)?x(xe):x([])}catch(ne){console.error("Error fetching categories:",ne),x([])}},_e=async()=>{try{const xe=await(await fetch(`${window.woocommersa_data.apiUrl}/products/brands`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();xe&&xe.success&&Array.isArray(xe.data)?E(xe.data):E([])}catch(ne){console.error("Error fetching brands:",ne),E([])}},pe=async()=>{try{const xe=await(await fetch(`${window.woocommersa_data.apiUrl}/pricing-rules/settings`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();j(xe)}catch(ne){console.error(ne)}},Le=async ne=>{D(!0);try{await fetch(`${window.woocommersa_data.apiUrl}/pricing-rules/settings`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({...M,enabled:ne})}),j({...M,enabled:ne}),ze.success(ne?"اتوماسیون فعال شد":"اتوماسیون متوقف شد")}catch(xe){console.error(xe),ze.error("خطا در تنظیمات اتوماسیون")}finally{D(!1)}};W.useEffect(()=>{ve(),ce(),_e(),pe()},[]);const Fe=async(ne,xe)=>{const Ke=xe==="active"?"inactive":"active";try{await fetch(`${window.woocommersa_data.apiUrl}/pricing-rules/${ne}`,{method:"PATCH",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({status:Ke})}),ze.success(Ke==="active"?"قانون فعال شد":"قانون غیرفعال شد"),ve()}catch(qe){console.error(qe),ze.error("خطا در تغییر وضعیت")}},nt=async ne=>{if(confirm("آیا از حذف این قانون اطمینان دارید؟"))try{await fetch(`${window.woocommersa_data.apiUrl}/pricing-rules/${ne}`,{method:"DELETE",headers:{"X-WP-Nonce":window.woocommersa_data.nonce}}),ze.success("قانون با موفقیت حذف شد"),ve()}catch(xe){console.error(xe),ze.error("خطا در حذف قانون")}},dt=async()=>{if(u.length===0||!confirm(`آیا از حذف ${u.length} قانون انتخاب شده اطمینان دارید؟`))return;const ne=ze.loading("درحال حذف گروهی...");try{await Promise.all(u.map(xe=>fetch(`${window.woocommersa_data.apiUrl}/pricing-rules/${xe}`,{method:"DELETE",headers:{"X-WP-Nonce":window.woocommersa_data.nonce}}))),ze.success("موارد انتخاب شده حذف شدند",{id:ne}),h([]),ve()}catch(xe){console.error(xe),ze.error("خطا در حذف گروهی",{id:ne})}},$e=async()=>{if(!m.name||!m.condition_value||!m.action_value){ze.error("لطفاً تمامی فیلدها را پر کنید");return}const ne=ze.loading("درحال ذخیره...");try{let xe=m.action_value.replace("%","");m.action_unit==="percent"&&(xe+="%");const Ke={id:V,name:m.name,conditions:[{field:m.condition_field,operator:m.condition_operator,value:m.condition_value}],action_type:m.action_type,action_value:xe,target_price:m.target_price,min_margin_percent:m.min_margin_percent};await fetch(`${window.woocommersa_data.apiUrl}/pricing-rules`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify(Ke)}),ze.success(V?"قانون بروزرسانی شد":"قانون جدید ثبت شد",{id:ne}),i(!1),F(null),g({name:"",condition_field:"stock",condition_operator:">",condition_value:"",action_type:"discount",action_value:"",action_unit:"percent",target_price:"regular_price",min_margin_percent:"0"}),ve()}catch(xe){console.error(xe),ze.error("خطا در ذخیرهسازی",{id:ne})}},Re=ne=>{const xe=Array.isArray(ne.conditions)?ne.conditions[0]:{field:"stock",operator:">",value:""},Ke=ne.action_value.includes("%"),qe=ne.action_value.replace("%","");g({name:ne.name,condition_field:xe.field,condition_operator:xe.operator,condition_value:xe.value,action_type:ne.action_type,action_value:qe,action_unit:Ke?"percent":"fixed",target_price:ne.target_price||"regular_price",min_margin_percent:String(ne.min_margin_percent||0)}),F(ne.id),i(!0),window.scrollTo({top:0,behavior:"smooth"})},Ze=async ne=>{te(!0);const xe=ze.loading("درحال اجرای قوانین معلق...");try{const qe=await(await fetch(`${window.woocommersa_data.apiUrl}/pricing-rules/apply`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({ids:ne})})).json();qe.affected_count>0?ze.success(`عملیات با موفقیت انجام شد. محصولات تحت تاثیر: ${qe.affected_count}`,{id:xe,duration:4e3}):ze.error("هیچ محصولی مطابق با شرایط این قوانین یافت نشد.",{id:xe,duration:5e3}),ve()}catch(Ke){console.error(Ke),ze.error("خطا در اجرای قوانین",{id:xe})}finally{te(!1)}},Ee=()=>{u.length===e.length?h([]):h(e.map(ne=>ne.id))},Q=ne=>{u.includes(ne)?h(u.filter(xe=>xe!==ne)):h([...u,ne])};return o.jsxs("div",{className:"space-y-8",dir:"rtl",children:[o.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-6 bg-slate-50/50 p-6 rounded-3xl border border-slate-100",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center transition-all ${M.enabled?"bg-green-100 text-green-600":"bg-slate-200 text-slate-400"}`,children:o.jsx(ur,{className:M.enabled?"animate-spin-slow":"",size:24})}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-black text-slate-800 text-sm",children:"اتوماسیون هوشمند قیمت"}),o.jsx("p",{className:"text-xs text-slate-500 font-medium",children:"اجرای خودکار قوانین در فواصل زمانی مشخص"})]}),o.jsxs("div",{className:"flex items-center gap-3 bg-white p-2 pr-4 rounded-2xl border border-slate-200",children:[o.jsx("button",{onClick:()=>H(!0),disabled:L,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${M.enabled?"bg-indigo-600":"bg-slate-300"} ${L?"opacity-50 cursor-not-allowed":""}`,children:o.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${M.enabled?"-translate-x-6":"-translate-x-1"}`})}),o.jsxs("div",{className:"text-right flex flex-col justify-center",children:[o.jsxs("div",{className:"flex items-center gap-1.5 h-4 mb-0.5",children:[o.jsx("h3",{className:"font-black text-slate-800 text-[11px] leading-tight",children:"اتوماسیون قیمت"}),t&&o.jsx("button",{onClick:()=>t("settings"),className:"p-1 rounded bg-slate-100 text-slate-400 hover:bg-primary-50 hover:text-primary-500 transition-all",title:"تنظیمات پیشرفته",children:o.jsx(sg,{size:10})})]}),o.jsxs("p",{className:"text-[9px] text-slate-400 font-bold",children:["وضعیت: ",M.enabled?"فعال":"غیرفعال"]})]})]})]}),o.jsxs("div",{className:"flex gap-4",children:[u.length>0&&o.jsxs("button",{onClick:dt,className:"flex items-center gap-2 px-6 py-3 rounded-2xl bg-rose-50 text-rose-600 wm-label hover:bg-rose-100 transition-all border border-rose-200",children:[o.jsx(zu,{size:20}),"حذف (",u.length,")"]}),o.jsxs("button",{onClick:()=>Ze(u),className:`flex items-center gap-2 px-6 py-3 rounded-2xl transition-all ${u.length>0&&!B?"bg-green-600 text-white shadow-xl shadow-green-500/20":"bg-slate-100 text-slate-400 cursor-not-allowed"}`,disabled:u.length===0||B,children:[B?o.jsx(ur,{className:"animate-spin",size:20}):o.jsx(JD,{size:20,fill:"currentColor"}),B?"درحال اجرا...":"اجرای قوانین انتخاب شده"]}),o.jsxs("button",{onClick:()=>i(!0),className:"flex items-center gap-3 px-8 py-3 bg-primary-600 text-white rounded-2xl wm-label hover:bg-primary-700 shadow-xl shadow-primary-500/20 transition-all active:scale-95",children:[o.jsx(m0,{size:22,strokeWidth:3}),"قانون جدید"]})]})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[o.jsx(tr,{children:r&&o.jsx(ht.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden",children:o.jsxs("div",{className:"wm-glass-panel p-8 rounded-[2.5rem] bg-slate-50/50 border-2 border-primary-100 space-y-8",children:[o.jsxs("div",{className:"space-y-10",children:[o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8 items-end",children:[o.jsxs("div",{className:"space-y-3 lg:col-span-5",children:[o.jsx("label",{className:"wm-label block pr-1 text-slate-600 font-black",children:"عنوان قانون هوشمند"}),o.jsx("input",{type:"text",value:m.name,onChange:ne=>g({...m,name:ne.target.value}),placeholder:"مثلاً: تخفیف انبارگردانی نوروزی",className:"wm-input h-14"})]}),o.jsxs("div",{className:"space-y-3 lg:col-span-4",children:[o.jsx("label",{className:"wm-label block pr-1 text-slate-600 font-black",children:"مبنای قیمت هدف"}),o.jsxs("select",{value:m.target_price,onChange:ne=>g({...m,target_price:ne.target.value}),className:"wm-select h-14",children:[o.jsx("option",{value:"regular_price",children:"قیمت اصلی (Regular Price)"}),o.jsx("option",{value:"sale_price",children:"قیمت ویژه (Sale Price)"})]})]}),o.jsxs("div",{className:"space-y-3 lg:col-span-3",children:[o.jsxs("label",{className:"wm-label block pr-1 text-slate-600 font-black flex items-center gap-2",children:["محافظ سود",o.jsx("span",{className:"text-[10px] bg-rose-100 text-rose-600 px-2 py-0.5 rounded-full font-bold",children:"% حداقل"})]}),o.jsx("input",{type:"number",value:m.min_margin_percent,onChange:ne=>g({...m,min_margin_percent:ne.target.value}),placeholder:"مثلاً: 10",className:"wm-input h-14"})]})]}),o.jsxs("div",{className:"flex flex-col lg:flex-row items-center gap-6",children:[o.jsxs("div",{className:"flex-1 w-full bg-white/60 p-6 rounded-[2rem] border border-slate-200 shadow-sm space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[o.jsx("div",{className:"w-8 h-8 rounded-xl bg-amber-100 text-amber-600 flex items-center justify-center font-black text-xs",children:"شرط"}),o.jsx("label",{className:"wm-label text-slate-600 font-black",children:"شرط اجرایی (اگر...)"})]}),o.jsxs("div",{className:"flex gap-3",children:[o.jsxs("select",{value:m.condition_field,onChange:ne=>g({...m,condition_field:ne.target.value,condition_operator:["category","vendor","brand"].includes(ne.target.value)?"=":">"}),className:"wm-select flex-1 h-14",children:[o.jsx("option",{value:"stock",children:"موجودی انبار"}),o.jsx("option",{value:"sales_30d",children:"آمار فروش ۳۰ روز"}),o.jsx("option",{value:"category",children:"دستهبندی خاص"}),o.jsx("option",{value:"brand",children:"برند خاص"}),((fe=window.woocommersa_data)==null?void 0:fe.hasDokan)&&o.jsx("option",{value:"vendor",children:"فروشنده خاص (دکان)"})]}),o.jsxs("select",{value:m.condition_operator,onChange:ne=>g({...m,condition_operator:ne.target.value}),className:"wm-select w-32 shrink-0 h-14",children:[o.jsx("option",{value:">",children:"بیشتر از"}),o.jsx("option",{value:"<",children:"کمتر از"}),o.jsx("option",{value:"=",children:"مساوی با"})]}),m.condition_field==="category"?o.jsxs("select",{value:m.condition_value,onChange:ne=>g({...m,condition_value:ne.target.value}),className:"wm-select flex-1 h-14",children:[o.jsx("option",{value:"",children:"انتخاب دستهبندی..."}),Array.isArray(y)&&y.map(ne=>o.jsx("option",{value:ne.id,children:ne.name},ne.id))]}):m.condition_field==="brand"?o.jsxs("select",{value:m.condition_value,onChange:ne=>g({...m,condition_value:ne.target.value}),className:"wm-select flex-1 h-14",children:[o.jsx("option",{value:"",children:"انتخاب برند..."}),Array.isArray(C)&&C.map(ne=>o.jsx("option",{value:ne.id,children:ne.name},ne.id))]}):m.condition_field==="vendor"?o.jsxs("select",{value:m.condition_value,onChange:ne=>g({...m,condition_value:ne.target.value}),className:"wm-select flex-1 h-14",children:[o.jsx("option",{value:"",children:"انتخاب فروشنده..."}),(((Ve=window.woocommersa_data)==null?void 0:Ve.vendorsList)||[]).map(ne=>o.jsx("option",{value:ne.id,children:ne.name},ne.id))]}):o.jsx("input",{type:"number",value:m.condition_value,onChange:ne=>g({...m,condition_value:ne.target.value}),placeholder:"مقدار",className:"wm-input w-24 shrink-0 h-14"})]})]}),o.jsx("div",{className:"hidden lg:flex w-12 h-12 rounded-full bg-slate-100 text-slate-300 items-center justify-center -rotate-90 lg:rotate-0",children:o.jsx(JD,{size:20,fill:"currentColor"})}),o.jsxs("div",{className:"flex-1 w-full bg-primary-50/30 p-6 rounded-[2rem] border border-primary-100 shadow-sm space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[o.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary-100 text-primary-600 flex items-center justify-center font-black text-xs",children:"عملیات"}),o.jsx("label",{className:"wm-label text-slate-600 font-black",children:"عملیات تغییر قیمت (آنگاه...)"})]}),o.jsxs("div",{className:"flex gap-3",children:[o.jsxs("select",{value:m.action_type,onChange:ne=>g({...m,action_type:ne.target.value}),className:"wm-select flex-1 h-14 bg-white",children:[o.jsx("option",{value:"discount",children:"کاهش قیمت"}),o.jsx("option",{value:"increase",children:"افزایش قیمت"})]}),o.jsxs("div",{className:"flex flex-1 bg-white rounded-2xl border border-slate-200 overflow-hidden shrink-0 h-14",children:[o.jsx("input",{type:"number",value:m.action_value,onChange:ne=>g({...m,action_value:ne.target.value}),placeholder:"مقدار",className:"flex-1 px-4 outline-none text-sm font-black text-slate-700"}),o.jsxs("select",{value:m.action_unit,onChange:ne=>g({...m,action_unit:ne.target.value}),className:"bg-slate-50 border-r border-slate-200 px-4 outline-none text-[11px] font-black cursor-pointer hover:bg-slate-100 transition-colors text-slate-600",children:[o.jsx("option",{value:"percent",children:"درصد (%)"}),o.jsx("option",{value:"fixed",children:"مبلغ ثابت"})]})]})]})]})]})]}),o.jsxs("div",{className:"flex justify-end gap-4 pt-6 border-t border-slate-100",children:[o.jsx("button",{onClick:()=>{i(!1),F(null)},className:"px-8 py-3 rounded-2xl text-slate-400 font-bold wm-label hover:bg-slate-100 transition-all",children:"انصراف"}),o.jsx("button",{onClick:$e,className:"px-12 h-16 rounded-[1.5rem] bg-primary-600 text-white wm-label hover:bg-primary-700 shadow-2xl shadow-primary-500/30 active:scale-95 transition-all text-lg font-black tracking-tight",children:V?"بروزرسانی تغییرات":"ایجاد قانون هوشمند"})]})]})})}),o.jsx("div",{className:"wm-glass-panel overflow-hidden rounded-3xl border border-slate-100 shadow-sm bg-white",children:o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{className:"bg-slate-50 border-b border-slate-100",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-4 text-right",children:o.jsx("input",{type:"checkbox",checked:e.length>0&&u.length===e.length,onChange:Ee,className:"w-4 h-4 rounded border-slate-300 text-primary-600"})}),o.jsx("th",{className:"px-6 py-4 text-right text-xs font-black text-slate-400",children:"نام قانون"}),o.jsx("th",{className:"px-6 py-4 text-right text-xs font-black text-slate-400",children:"شرط هوشمند"}),o.jsx("th",{className:"px-6 py-4 text-right text-xs font-black text-slate-400",children:"عملیات"}),o.jsx("th",{className:"px-6 py-4 text-right text-xs font-black text-slate-400",children:"قیمت هدف"}),o.jsx("th",{className:"px-6 py-4 text-right text-xs font-black text-slate-400",children:"حداقل سود"}),o.jsx("th",{className:"px-6 py-4 text-right text-xs font-black text-slate-400",children:"وضعیت"}),o.jsx("th",{className:"px-6 py-4 text-left text-xs font-black text-slate-400",children:"حذف"})]})}),o.jsxs("tbody",{children:[s&&o.jsx("tr",{children:o.jsx("td",{colSpan:7,className:"p-10 text-center",children:o.jsx(ur,{className:"animate-spin mx-auto text-primary-500"})})}),!s&&e.length===0?o.jsx("tr",{children:o.jsxs("td",{colSpan:7,className:"p-20 text-center text-slate-300",children:[o.jsx(Zc,{size:48,className:"mx-auto mb-4 opacity-20"}),"هنوز قانونی تعریف نشده است"]})}):e.map(ne=>{var xe,Ke;return o.jsxs("tr",{className:`border-b border-slate-50 hover:bg-slate-50/50 transition-colors ${u.includes(ne.id)?"bg-primary-50/30":""}`,children:[o.jsx("td",{className:"px-6 py-5 text-right",children:o.jsx("input",{type:"checkbox",checked:u.includes(ne.id),onChange:()=>Q(ne.id),className:"w-4 h-4 rounded border-slate-300 text-primary-600"})}),o.jsx("td",{className:"px-6 py-5",children:o.jsx("div",{className:"font-bold text-slate-800",children:ne.name})}),o.jsx("td",{className:"px-6 py-5",children:o.jsxs("span",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-lg bg-amber-50 text-amber-700 text-[10px] font-black border border-amber-100",children:["شرط: ",Array.isArray(ne.conditions)?(ne.conditions[0].field==="stock"?"موجودی":ne.conditions[0].field==="category"?"دستهبندی":ne.conditions[0].field==="brand"?"برند":"فروش")+" "+ne.conditions[0].operator+" "+(ne.conditions[0].field==="category"?Array.isArray(y)&&((xe=y.find(qe=>qe.id==ne.conditions[0].value))==null?void 0:xe.name)||ne.conditions[0].value:ne.conditions[0].field==="brand"&&Array.isArray(C)&&((Ke=C.find(qe=>qe.id==ne.conditions[0].value))==null?void 0:Ke.name)||ne.conditions[0].value):"..."]})}),o.jsx("td",{className:"px-6 py-5",children:o.jsxs("span",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-lg bg-indigo-50 text-indigo-700 text-[10px] font-black border border-indigo-100 uppercase",children:["عملیات: ",ne.action_type==="discount"?"کاهش":"افزایش"," ",ne.action_value,!ne.action_value.includes("%")&&" تومان"]})}),o.jsx("td",{className:"px-6 py-5",children:o.jsx("span",{className:"text-[10px] font-bold text-slate-500 bg-slate-100 px-2 py-1 rounded",children:ne.target_price==="sale_price"?"قیمت ویژه":"قیمت اصلی"})}),o.jsx("td",{className:"px-6 py-5",children:o.jsxs("span",{className:"text-[10px] font-bold text-rose-600 bg-rose-50 px-2 py-1 rounded border border-rose-100",children:[ne.min_margin_percent,"% + خرید"]})}),o.jsx("td",{className:"px-6 py-5",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{onClick:()=>Fe(ne.id,ne.status),className:`px-4 py-1.5 rounded-full text-[10px] font-black transition-all flex items-center gap-2 ${ne.status==="active"?"bg-green-100 text-green-700 border border-green-200":"bg-slate-100 text-slate-400 border border-slate-200"}`,children:[o.jsx(jae,{size:12}),ne.status==="active"?"فعال":"غیرفعال"]}),o.jsx("button",{onClick:()=>Ze([ne.id]),className:"p-2 rounded-lg bg-indigo-50 text-indigo-600 hover:bg-indigo-100 transition-all",title:"اجرای همین قانون",children:o.jsx(JD,{size:14,fill:"currentColor"})})]})}),o.jsx("td",{className:"px-6 py-5 text-left",children:o.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[o.jsx("button",{onClick:()=>Re(ne),className:"p-2.5 rounded-xl text-slate-400 hover:bg-slate-100 transition-all",children:o.jsx(Zc,{size:18})}),o.jsx("button",{onClick:()=>nt(ne.id),className:"p-2.5 rounded-xl text-slate-300 hover:bg-red-50 hover:text-red-500 transition-all",children:o.jsx(zu,{size:18})})]})})]},ne.id)})]})]})})]}),o.jsx(tr,{children:z&&o.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4",children:[o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>H(!1),className:"absolute inset-0 bg-slate-900/60 backdrop-blur-sm"}),o.jsx(ht.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"relative w-full max-w-lg bg-white rounded-[2.5rem] shadow-2xl overflow-hidden",children:o.jsxs("div",{className:"p-8 text-center space-y-6",children:[o.jsx("div",{className:"w-20 h-20 bg-indigo-100 text-indigo-600 rounded-3xl flex items-center justify-center mx-auto",children:o.jsx(ur,{size:40,className:"animate-spin-slow"})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-xl font-black text-slate-800 mb-2",children:"اتوماسیون هوشمند قیمت"}),o.jsx("p",{className:"text-sm text-slate-500 font-medium leading-relaxed",children:"با فعالسازی این بخش، تمام قوانین فعال شما به صورت خودکار و در فواصل زمانی منظم (یکساعته) روی محصولات سایت اعمال خواهند شد. محصولاتی که با شرایط هر قانون مطابقت داشته باشند، بهروزرسانی میشوند."})]}),o.jsxs("div",{className:"flex gap-4",children:[o.jsx("button",{onClick:()=>H(!1),className:"flex-1 h-14 rounded-2xl text-slate-500 font-bold hover:bg-slate-100 transition-all",children:"بستن"}),o.jsx("button",{onClick:()=>{Le(!M.enabled),H(!1)},className:`flex-1 h-14 rounded-2xl font-black text-white shadow-lg transition-all active:scale-95 ${M.enabled?"bg-rose-500 shadow-rose-500/30":"bg-indigo-600 shadow-indigo-500/30"}`,children:M.enabled?"غیرفعالسازی اتوماسیون":"فعالسازی همین حالا"})]})]})})]})})]})},FH=({selectedCount:t,onApply:e,context:n="standard"})=>{const[r,i]=bi.useState(!1),[s,a]=bi.useState(!1),[u,h]=bi.useState(!1),[m,g]=bi.useState([]);return bi.useEffect(()=>{(async()=>{try{const C=await(await fetch(`${window.woocommersa_data.apiUrl}/categories`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();g(Array.isArray(C==null?void 0:C.data)?C.data:Array.isArray(C)?C:[])}catch(x){console.error(x)}})()},[]),t===0?null:o.jsx("div",{className:"relative flex items-center justify-center gap-4",children:o.jsxs(ht.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},className:"bg-slate-900 rounded-3xl p-3 shadow-premium flex items-center gap-4 border border-slate-800",children:[o.jsxs("div",{className:"flex items-center gap-4 px-6 border-l border-slate-800",children:[o.jsx("div",{className:"w-10 h-10 bg-primary-500 rounded-xl flex items-center justify-center font-black text-white shadow-soft",children:t}),o.jsx("span",{className:"text-white font-bold text-sm whitespace-nowrap",children:"محصول انتخاب شده"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[n==="seo"&&o.jsxs("div",{className:"relative",children:[o.jsxs("button",{onClick:()=>{h(!u),i(!1),a(!1)},className:"flex items-center gap-3 px-5 h-14 rounded-2xl bg-primary-500/10 text-primary-400 font-bold hover:bg-primary-500 hover:text-white transition-all text-sm group border border-primary-500/20",children:[o.jsx(XD,{size:18,className:"group-hover:rotate-12 transition-transform"}),"عملیات سئو",o.jsx(Xp,{size:14,className:`opacity-50 transition-transform ${u?"rotate-180":""}`})]}),o.jsx(tr,{children:u&&o.jsxs(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"absolute bottom-full mb-4 left-0 bg-slate-900 border border-slate-800 rounded-2xl p-5 shadow-premium w-64 z-[100] ring-4 ring-black/10",children:[o.jsx("p",{className:"text-[10px] font-black text-slate-400 mb-4 px-2 uppercase tracking-widest",children:"بهینهسازی هوشمند سئو"}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("button",{onClick:()=>{e({_type:"seo-generate"}),h(!1)},className:"w-full text-right px-4 py-3 hover:bg-primary-500/20 rounded-xl text-xs text-white transition-all flex items-center justify-between border border-transparent hover:border-primary-500/30 group/item",children:[o.jsx("span",{className:"font-bold",children:"تولید سئو با هوش مصنوعی"}),o.jsx(Hr,{size:14,className:"text-amber-400"})]}),o.jsxs("button",{onClick:()=>{e({seo_robots:"index"}),h(!1)},className:"w-full text-right px-4 py-3 hover:bg-slate-800 rounded-xl text-xs text-white transition-all flex items-center justify-between border border-transparent hover:border-slate-700",children:[o.jsx("span",{className:"font-bold",children:"ثبت به عنوان Index"}),o.jsx(DU,{size:14,className:"text-emerald-500"})]}),o.jsxs("button",{onClick:()=>{e({seo_robots:"noindex"}),h(!1)},className:"w-full text-right px-4 py-3 hover:bg-slate-800 rounded-xl text-xs text-white transition-all flex items-center justify-between border border-transparent hover:border-slate-700",children:[o.jsx("span",{className:"font-bold",children:"ثبت به عنوان No-Index"}),o.jsx(qi,{size:14,className:"text-rose-500"})]})]})]})})]}),o.jsxs("div",{className:"relative",children:[o.jsxs("button",{onClick:()=>{i(!r),a(!1),h(!1)},className:"flex items-center gap-3 px-5 h-14 rounded-2xl bg-slate-800 text-slate-300 font-bold hover:bg-slate-700 hover:text-white transition-all text-sm group",children:[o.jsx(Od,{size:18,className:"text-slate-500 group-hover:text-primary-400"}),n==="profit"?"تنظیمات مالی":"تغییر قیمت",o.jsx(Xp,{size:14,className:`opacity-50 transition-transform ${r?"rotate-180":""}`})]}),o.jsx(tr,{children:r&&o.jsxs(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"absolute bottom-full mb-4 left-0 bg-slate-900 border border-slate-800 rounded-2xl p-5 shadow-premium w-72 z-[100] ring-4 ring-black/10",children:[o.jsx("p",{className:"text-[10px] font-black text-slate-400 mb-4 px-2 uppercase tracking-widest",children:"عملیات مالی گروهی"}),o.jsx("div",{className:"flex flex-col gap-2",children:n==="profit"?o.jsxs(o.Fragment,{children:[o.jsxs("button",{onClick:()=>{e({_type:"bulk-edit",field:"margin"}),i(!1)},className:"w-full text-right px-4 py-3 hover:bg-primary-500/20 rounded-xl text-xs text-white transition-all flex items-center justify-between border border-transparent hover:border-primary-500/30 group/item",children:[o.jsx("span",{className:"font-bold",children:"تنظیم حاشیه سود"}),o.jsx(Hr,{size:14,className:"text-primary-400"})]}),o.jsxs("button",{onClick:()=>{e({_type:"bulk-edit",field:"profit"}),i(!1)},className:"w-full text-right px-4 py-3 hover:bg-primary-500/20 rounded-xl text-xs text-white transition-all flex items-center justify-between border border-transparent hover:border-primary-500/30 group/item",children:[o.jsx("span",{className:"font-bold",children:"تنظیم سود واحد"}),o.jsx(Hr,{size:14,className:"text-primary-400"})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("button",{onClick:()=>{e({regular_price:{operation:"increase",value:10,unit:"percentage"}}),i(!1)},className:"w-full text-right px-4 py-3 hover:bg-slate-800 rounded-xl text-xs text-white transition-all flex items-center justify-between border border-transparent hover:border-slate-700 group/item",children:[o.jsx("span",{className:"font-bold",children:"۱۰٪ افزایش قیمت"}),o.jsx("span",{className:"px-2 py-0.5 bg-green-500/20 text-green-400 rounded-lg text-[10px] font-black group-hover/item:scale-110 transition-transform",children:"+10%"})]}),o.jsxs("button",{onClick:()=>{e({regular_price:{operation:"decrease",value:10,unit:"percentage"}}),i(!1)},className:"w-full text-right px-4 py-3 hover:bg-slate-800 rounded-xl text-xs text-white transition-all flex items-center justify-between border border-transparent hover:border-slate-700 group/item",children:[o.jsx("span",{className:"font-bold",children:"۱۰٪ کاهش قیمت"}),o.jsx("span",{className:"px-2 py-0.5 bg-rose-500/20 text-rose-400 rounded-lg text-[10px] font-black group-hover/item:scale-110 transition-transform",children:"-10%"})]})]})})]})})]}),o.jsxs("div",{className:"relative",children:[o.jsxs("button",{onClick:()=>{a(!s),i(!1),h(!1)},className:"flex items-center gap-3 px-5 h-14 rounded-2xl bg-slate-800 text-slate-300 font-bold hover:bg-slate-700 hover:text-white transition-all text-sm group",children:[o.jsx(Xp,{size:14,className:`opacity-50 transition-transform ${s?"rotate-180":""}`}),"دستهبندی"]}),o.jsx(tr,{children:s&&o.jsxs(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"absolute bottom-full mb-4 left-0 bg-slate-900 border border-slate-800 rounded-3xl p-5 shadow-2xl w-64 z-[100] ring-4 ring-black/10",children:[o.jsx("p",{className:"text-[10px] font-black text-slate-400 mb-4 px-2 uppercase tracking-widest",children:"تغییر سریع دستهبندی"}),o.jsx("div",{className:"flex flex-col gap-1 max-h-60 overflow-y-auto wm-custom-scrollbar",children:m.map(y=>o.jsx("button",{onClick:()=>{e({categories:{operation:"add",value:[y.id]}}),a(!1)},className:"w-full text-right px-4 py-2 hover:bg-slate-800 rounded-xl text-xs text-white transition-all",children:y.name},y.id))})]})})]}),o.jsxs("button",{onClick:()=>e({_type:"delete"}),className:"flex items-center gap-3 px-6 h-14 rounded-2xl bg-rose-500/10 text-rose-500 font-bold hover:bg-rose-500 hover:text-white transition-all text-sm group",children:[o.jsx(zu,{size:18,className:"group-hover:scale-110 transition-transform"}),"حذف"]})]}),o.jsx("div",{className:"mr-auto pl-6",children:o.jsxs("button",{onClick:()=>e({_type:"bulk-edit"}),className:"flex items-center gap-3 px-10 h-14 rounded-2xl bg-primary-500 text-white font-black hover:bg-primary-600 shadow-soft transition-all active:scale-95 text-sm whitespace-nowrap",children:[o.jsx(Hr,{size:20,fill:"currentColor"}),"ویرایش گروهی محصولات"]})})]})})},ime=({selectedIds:t=[]})=>{const[e,n]=W.useState("grid"),[r,i]=W.useState("cards"),[s,a]=W.useState([]),[u,h]=W.useState(!1),[m,g]=W.useState(null),[y,x]=W.useState(""),[C,E]=W.useState(""),[M,j]=W.useState(""),[L,D]=W.useState(t),[z,H]=W.useState(1),[V]=W.useState(25),[F,B]=W.useState(0),[te,ve]=W.useState([]),[ce,_e]=W.useState([]),[pe,Le]=W.useState([]),[Fe,nt]=W.useState(null),[dt,$e]=W.useState(null),[Re,Ze]=W.useState(null),[Ee,Q]=W.useState({}),[fe,Ve]=W.useState("all"),[ne,xe]=W.useState(["no_seo_title"]),[Ke,qe]=W.useState("{product_name} | خرید و قیمت در {site_name}"),[we,k]=W.useState("خرید آنلاین {product_name} با بهترین قیمت در فروشگاه ما. ضمانت کیفیت و ارسال سریع محصولات {category}."),[_,N]=W.useState([]),[O,G]=W.useState(0);W.useEffect(()=>{q(),I(),e==="grid"&&Z(),e==="redirects"&&U()},[z,M,C,y,e,V]),W.useEffect(()=>{const se=setInterval(async()=>{try{const J=await(await fetch(`${window.woocommersa_data.apiUrl}/jobs/active`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();Le(Array.isArray(J)?J:[])}catch{}},5e3);return()=>clearInterval(se)},[]);const q=async()=>{var se,ie;try{const me=await(await fetch(`${(se=window.woocommersa_data)==null?void 0:se.apiUrl}/seo/health-stats`,{headers:{"X-WP-Nonce":(ie=window.woocommersa_data)==null?void 0:ie.nonce}})).json();g(me)}catch(J){console.error(J)}},I=async()=>{var se,ie;try{const me=await(await fetch(`${(se=window.woocommersa_data)==null?void 0:se.apiUrl}/categories`,{headers:{"X-WP-Nonce":(ie=window.woocommersa_data)==null?void 0:ie.nonce}})).json();ve(me.data||me||[])}catch(J){console.error(J)}},Z=async()=>{var se,ie;h(!0);try{const J=new URLSearchParams({page:z.toString(),per_page:V.toString(),search:y,category:C,health_filter:M}),Se=await(await fetch(`${(se=window.woocommersa_data)==null?void 0:se.apiUrl}/seo/products?${J}`,{headers:{"X-WP-Nonce":(ie=window.woocommersa_data)==null?void 0:ie.nonce}})).json();a(Se.products||[]),B(Se.total||0)}catch(J){console.error(J)}h(!1)},U=async()=>{var se,ie;h(!0);try{const me=await(await fetch(`${(se=window.woocommersa_data)==null?void 0:se.apiUrl}/seo/redirects`,{headers:{"X-WP-Nonce":(ie=window.woocommersa_data)==null?void 0:ie.nonce}})).json();_e(me.redirects||[])}catch(J){console.error(J)}h(!1)},re=(se,ie,J)=>{a(me=>me.map(Se=>Se.id===se?{...Se,[ie]:J}:Se)),Q(me=>({...me,[`${se}_${ie}`]:{field:ie,value:J}}))},ae=async(se,ie,J)=>{var me,Se;a(je=>je.map(Pe=>Pe.id===se?{...Pe,[ie]:J}:Pe));try{const je={updates:[{id:se,[ie]:J}]};await fetch(`${(me=window.woocommersa_data)==null?void 0:me.apiUrl}/seo/batch-update`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":(Se=window.woocommersa_data)==null?void 0:Se.nonce},body:JSON.stringify(je)})}catch{ze.error("خطا در ذخیرهسازی")}},he=async()=>{var se,ie;if(Object.keys(Ee).length!==0){h(!0);try{const J=Object.entries(Ee).reduce((Se,[je,Pe])=>{const[ut]=je.split("_");return Se[ut]||(Se[ut]={id:parseInt(ut)}),Se[ut][Pe.field]=Pe.value,Se},{}),me=Object.values(J);await fetch(`${(se=window.woocommersa_data)==null?void 0:se.apiUrl}/seo/batch-update`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":(ie=window.woocommersa_data)==null?void 0:ie.nonce},body:JSON.stringify({updates:me})}),ze.success("تمامی تغییرات با موفقیت در دیتابیس ثبت شدند."),Q({}),q()}catch{ze.error("خطا در ذخیرهسازی")}h(!1)}},Me=async se=>{var ie,J;h(!0);try{const Se=await(await fetch(`${(ie=window.woocommersa_data)==null?void 0:ie.apiUrl}/seo/generate`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":(J=window.woocommersa_data)==null?void 0:J.nonce},body:JSON.stringify({ids:[se.id]})})).json();Se.success&&Se.data&&(re(se.id,"seo_title",Se.data.title),re(se.id,"seo_description",Se.data.description),ze.success("سئو محصول با هوش مصنوعی بروزرسانی شد."))}catch{ze.error("خطا در تولید محتوا")}h(!1)},tt=async(se,ie)=>{var J,me;h(!0);try{(await(await fetch(`${(J=window.woocommersa_data)==null?void 0:J.apiUrl}/seo/save-faq`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":(me=window.woocommersa_data)==null?void 0:me.nonce},body:JSON.stringify({product_id:se,faq:ie})})).json()).success&&(a(Pe=>Pe.map(ut=>ut.id===se?{...ut,seo_faq:ie}:ut)),$e(null),ze.success("سوالات متداول با موفقیت ذخیره شد."))}catch{ze.error("خطا در ذخیرهسازی")}h(!1)},ot=async se=>{var ie,J;h(!0);try{const Se=await(await fetch(`${(ie=window.woocommersa_data)==null?void 0:ie.apiUrl}/seo/recommendations?id=${se}`,{headers:{"X-WP-Nonce":(J=window.woocommersa_data)==null?void 0:J.nonce}})).json();Ze({productId:se,recommendations:Se.recommendations,analysis:Se.analysis})}catch(me){console.error(me)}h(!1)},lt=async()=>{var se,ie;if(!ne.length)return ze.error("لطفاً حداقل یک معیار هدفگیری را انتخاب کنید.");h(!0),G(30),N(["آمادهسازی عملیات...","تحلیل محصولات در دسته انتخابی..."]);try{const me=await(await fetch(`${(se=window.woocommersa_data)==null?void 0:se.apiUrl}/seo/bulk-apply`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":(ie=window.woocommersa_data)==null?void 0:ie.nonce},body:JSON.stringify({criteria:ne.length===1?ne[0]:"all",selected_ids:[],category:fe,title_template:Ke,desc_template:we})})).json();me.success?(G(100),N(Se=>[...Se,"عملیات در صف پردازش قرار گرفت.","میتوانید پیشرفت کار را از دکمه شناور مانیتورینگ مشاهده کنید."]),ze.success("عملیات انبوه با موفقیت آغاز شد.")):ze.error(me.error||"خطا در اجرای عملیات")}catch{ze.error("بروز خطا در اجرای عملیات.")}h(!1)},X=async()=>{var se,ie;h(!0);try{const me=await(await fetch(`${(se=window.woocommersa_data)==null?void 0:se.apiUrl}/seo/redirects/sync`,{method:"POST",headers:{"X-WP-Nonce":(ie=window.woocommersa_data)==null?void 0:ie.nonce}})).json();me.success&&(ze.success(`تعداد ${me.count} ریدایرکت با موفقیت همگامسازی شد.`),U())}catch{ze.error("خطا در همگامسازی ریدایرکتها")}h(!1)},de=async se=>{var J,me,Se,je;if(se._type==="bulk-edit"){n("templates");return}if(se._type==="seo-generate"){h(!0);const Pe=ze.loading("درحال تولید محتوای سئو با هوش مصنوعی...");try{(await(await fetch(`${(J=window.woocommersa_data)==null?void 0:J.apiUrl}/seo/generate`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":(me=window.woocommersa_data)==null?void 0:me.nonce},body:JSON.stringify({ids:L})})).json()).success?(ze.success("تولید سئو برای کل موارد انتخابی در صف پردازش قرار گرفت.",{id:Pe}),D([]),Z()):ze.error("خطا در شروع عملیات",{id:Pe})}catch{ze.error("خطا در ارتباط با سرور",{id:Pe})}h(!1);return}const ie=ze.loading("درحال اعمال تغییرات گروهی...");try{const Pe=se.seo_robots!==void 0,ut=Pe?"/seo/batch-update":"/products/bulk-update",wt=Pe?{updates:L.map(Rt=>({id:Rt,...se}))}:{ids:L,updates:se};(await fetch(`${(Se=window.woocommersa_data)==null?void 0:Se.apiUrl}${ut}`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":(je=window.woocommersa_data)==null?void 0:je.nonce},body:JSON.stringify(wt)})).ok?(ze.success("عملیات با موفقیت انجام شد.",{id:ie}),D([]),Z()):ze.error("خطا در اجرای عملیات",{id:ie})}catch{ze.error("خطا در ارتباط با سرور",{id:ie})}},Ce=async(se,ie)=>{var J,me;try{await fetch(`${(J=window.woocommersa_data)==null?void 0:J.apiUrl}/seo/redirects/update`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":(me=window.woocommersa_data)==null?void 0:me.nonce},body:JSON.stringify({id:se,data:ie})}),_e(Se=>Se.map(je=>je.id===se?{...je,...ie}:je))}catch{ze.error("خطا در بروزرسانی")}},Oe=async se=>{var ie,J;if(confirm("آیا از حذف این ریدایرکت اطمینان دارید؟"))try{await fetch(`${(ie=window.woocommersa_data)==null?void 0:ie.apiUrl}/seo/redirects/delete?id=${se}`,{method:"POST",headers:{"X-WP-Nonce":(J=window.woocommersa_data)==null?void 0:J.nonce}}),_e(me=>me.filter(Se=>Se.id!==se)),ze.success("ریدایرکت حذف شد")}catch{ze.error("خطا در حذف")}},Ge=se=>pe.some(ie=>(ie.status==="processing"||ie.status==="pending")&&ie.items&&ie.items.includes(se)),Qe=()=>{if(!ce.length)return ze.error("لیست ریدایرکتها خالی است.");const se=["ID","Source URL","Target URL","Type","Hits","Status","Date"],ie=ce.map(Pe=>[Pe.id,Pe.old_url,Pe.new_url,Pe.type,Pe.hits,Pe.status==="active"?"فعال":"غیرفعال",Pe.created_at]),J="\uFEFF"+[se,...ie].map(Pe=>Pe.join(",")).join(` `),me=new Blob([J],{type:"text/csv;charset=utf-8;"}),Se=URL.createObjectURL(me),je=document.createElement("a");je.setAttribute("href",Se),je.setAttribute("download","woocommersa-redirects.csv"),document.body.appendChild(je),je.click(),document.body.removeChild(je)};return o.jsxs("div",{className:"wm-section relative z-10 text-right",dir:"rtl",children:[o.jsxs("div",{className:"wm-row-between mb-10",children:[o.jsxs("div",{className:"flex items-center gap-6",children:[o.jsx("div",{className:"w-16 h-16 bg-primary-600 rounded-2xl flex items-center justify-center text-white shadow-glow-primary shrink-0 ring-8 ring-primary-500/10",children:o.jsx(XD,{size:32})}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("h1",{className:"wm-title-lg flex items-center gap-4",children:"سیستم سئو هوشمند"}),o.jsxs("p",{className:"wm-hint font-bold flex items-center gap-2",children:[o.jsx(Jc,{size:14,className:"text-amber-500"})," مدیریت هوشمند و خودکار سئو کاتالوگ محصولات"]})]})]}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"bg-white p-1.5 rounded-2xl shadow-soft border border-slate-100 flex gap-1",children:[o.jsxs("button",{onClick:()=>n("grid"),className:`px-8 py-3 rounded-[1.5rem] text-xs font-black transition-all flex items-center gap-3 ${e==="grid"?"bg-slate-900 text-white shadow-lg":"text-slate-400 hover:text-slate-600"}`,children:[o.jsx(Hr,{size:18})," کاتالوگ محصولات"]}),o.jsxs("button",{onClick:()=>n("templates"),className:`px-8 py-3 rounded-[1.5rem] text-xs font-black transition-all flex items-center gap-3 ${e==="templates"?"bg-slate-900 text-white shadow-lg":"text-slate-400 hover:text-slate-600"}`,children:[o.jsx(Fu,{size:18})," هدفگیری انبوه"]}),o.jsxs("button",{onClick:()=>n("redirects"),className:`px-8 py-3 rounded-[1.5rem] text-xs font-black transition-all flex items-center gap-3 ${e==="redirects"?"bg-slate-900 text-white shadow-lg":"text-slate-400 hover:text-slate-600"}`,children:[o.jsx(BU,{size:18})," مدیریت ریدایرکتها"]})]}),o.jsx("button",{onClick:()=>{q(),Z(),e==="redirects"&&U()},className:"w-14 h-14 bg-white text-primary-500 rounded-2xl border border-slate-100 shadow-soft flex items-center justify-center",children:o.jsx(ig,{size:22,className:u?"animate-spin":""})})]})]}),e==="grid"&&o.jsxs("div",{className:"space-y-8",children:[m&&o.jsxs("div",{className:"grid grid-cols-5 gap-6",children:[o.jsxs("div",{onClick:()=>j(""),className:`p-6 bg-white rounded-[2rem] border-2 transition-all cursor-pointer ${M===""?"border-primary-500 shadow-xl scale-105":"border-white shadow-soft hover:border-slate-100"}`,children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx("div",{className:"w-10 h-10 bg-slate-100 text-slate-500 rounded-xl flex items-center justify-center",children:o.jsx(bc,{size:20})}),o.jsx("span",{className:"text-2xl font-black text-slate-800",children:m.total_products})]}),o.jsx("div",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"کل کاتالوگ"})]}),o.jsxs("div",{onClick:()=>j("no_seo"),className:`p-6 bg-white rounded-[2rem] border-2 transition-all cursor-pointer ${M==="no_seo"?"border-rose-500 shadow-xl scale-105":"border-white shadow-soft hover:border-slate-100"}`,children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx("div",{className:"w-10 h-10 bg-rose-50 text-rose-500 rounded-xl flex items-center justify-center",children:o.jsx(Ph,{size:20})}),o.jsx("span",{className:"text-2xl font-black text-rose-600",children:m.no_seo})]}),o.jsx("div",{className:"text-[10px] font-black text-rose-400 uppercase tracking-widest",children:"بدون سئو"})]}),o.jsxs("div",{onClick:()=>j("no_faq"),className:`p-6 bg-white rounded-[2rem] border-2 transition-all cursor-pointer ${M==="no_faq"?"border-indigo-500 shadow-xl scale-105":"border-white shadow-soft hover:border-slate-100"}`,children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx("div",{className:"w-10 h-10 bg-indigo-50 text-indigo-500 rounded-xl flex items-center justify-center",children:o.jsx(rg,{size:20})}),o.jsx("span",{className:"text-2xl font-black text-indigo-600",children:m.no_faq})]}),o.jsx("div",{className:"text-[10px] font-black text-indigo-400 uppercase tracking-widest",children:"بدون FAQ"})]}),o.jsxs("div",{onClick:()=>j("no_keywords"),className:`p-6 bg-white rounded-[2rem] border-2 transition-all cursor-pointer ${M==="no_keywords"?"border-amber-500 shadow-xl scale-105":"border-white shadow-soft hover:border-slate-100"}`,children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx("div",{className:"w-10 h-10 bg-amber-50 text-amber-500 rounded-xl flex items-center justify-center",children:o.jsx(Fu,{size:20})}),o.jsx("span",{className:"text-2xl font-black text-amber-600",children:m.no_keywords})]}),o.jsx("div",{className:"text-[10px] font-black text-amber-400 uppercase tracking-widest",children:"بدون کلمه کلیدی"})]}),o.jsxs("div",{className:"p-6 bg-primary-600 rounded-[2rem] shadow-xl text-white",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center text-white",children:o.jsx(DU,{size:20})}),o.jsx("span",{className:"text-2xl font-black",children:m.total_products-m.no_seo})]}),o.jsx("div",{className:"text-[10px] font-black text-primary-200 uppercase tracking-widest",children:"بهینهسازی شده"})]})]}),o.jsxs("div",{className:"wm-card p-6 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[o.jsxs("div",{className:"relative flex-1 max-w-md group",children:[o.jsx(Ia,{size:18,className:"absolute right-5 top-1/2 -translate-y-1/2 text-slate-300 group-focus-within:text-primary-500 transition-colors pointer-events-none"}),o.jsx("input",{value:y,onChange:se=>x(se.target.value),className:"w-full h-14 bg-slate-50 border border-slate-100 rounded-2xl text-[13px] font-black focus:bg-white focus:border-primary-500 transition-all outline-none",style:{paddingRight:"75px",textAlign:"right"},placeholder:"جستجوی محصول یا SKU..."})]}),o.jsx("div",{className:"w-64",children:o.jsxs("select",{value:C,onChange:se=>E(se.target.value),className:"wm-select h-14 !text-xs !font-black !rounded-2xl",children:[o.jsx("option",{value:"",children:"تمامی دستهها"}),te.map(se=>o.jsx("option",{value:se.slug,children:se.name},se.id))]})})]}),o.jsxs("div",{className:"flex items-center gap-4 mr-6",children:[o.jsxs("button",{onClick:he,disabled:Object.keys(Ee).length===0,className:`h-14 px-8 rounded-2xl font-black text-xs transition-all flex items-center gap-3 ${Object.keys(Ee).length>0?"bg-emerald-600 text-white shadow-glow-emerald active:scale-95":"bg-slate-50 text-slate-300"}`,children:[o.jsx(Ak,{size:18})," ذخیره نهایی تغییرات"]}),o.jsxs("div",{className:"h-14 bg-slate-50 p-1.5 rounded-2xl flex gap-1 border border-slate-100",children:[o.jsx("button",{onClick:()=>i("cards"),className:`w-11 h-11 flex items-center justify-center rounded-xl transition-all ${r==="cards"?"bg-white text-slate-900 shadow-md ring-1 ring-slate-100":"text-slate-400 hover:text-slate-600"}`,children:o.jsx(tg,{size:20})}),o.jsx("button",{onClick:()=>i("list"),className:`w-11 h-11 flex items-center justify-center rounded-xl transition-all ${r==="list"?"bg-white text-slate-900 shadow-md ring-1 ring-slate-100":"text-slate-400 hover:text-slate-600"}`,children:o.jsx(Sae,{size:20})})]})]})]}),o.jsx(tr,{mode:"wait",children:r==="cards"?o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:s.map(se=>o.jsxs("div",{className:`bg-white rounded-[3rem] shadow-soft hover:shadow-2xl transition-all border overflow-hidden group relative ${Ge(se.id)?"border-primary-500 ring-4 ring-primary-50":"border-slate-50"}`,children:[Ge(se.id)&&o.jsxs("div",{className:"absolute top-4 left-4 z-20 flex items-center gap-2 bg-primary-600 text-white px-3 py-1.5 rounded-full text-[9px] font-black shadow-lg animate-pulse",children:[o.jsx(ig,{size:10,className:"animate-spin"})," در حال پردازش..."]}),o.jsxs("div",{className:"p-8",children:[o.jsxs("div",{className:"flex items-center gap-5 justify-between mb-8",children:[o.jsxs("div",{className:"flex items-center gap-5",children:[o.jsx("div",{className:"w-16 h-16 bg-slate-50 rounded-2xl overflow-hidden shrink-0 border border-slate-100 shadow-soft",children:se.image?o.jsx("img",{src:se.image,className:"w-full h-full object-cover"}):o.jsx(bc,{className:"w-full h-full p-4 text-slate-300"})}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-xs font-black text-slate-800 line-clamp-1 mb-1",children:se.name}),o.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:se.sku||"No SKU"})]})]}),o.jsx("input",{type:"checkbox",checked:L.includes(se.id),onChange:()=>D(ie=>ie.includes(se.id)?ie.filter(J=>J!==se.id):[...ie,se.id]),className:"w-6 h-6 rounded-lg border-2 border-slate-100 text-primary-600 focus:ring-primary-500"})]}),o.jsxs("div",{className:"space-y-6",children:[o.jsx("input",{value:se.seo_title,onChange:ie=>re(se.id,"seo_title",ie.target.value),onBlur:ie=>ae(se.id,"seo_title",ie.target.value),className:"wm-input !h-12 !text-[11px] !font-black bg-slate-50/30",placeholder:"عنوان سئو..."}),o.jsx("textarea",{value:se.seo_description,onChange:ie=>re(se.id,"seo_description",ie.target.value),onBlur:ie=>ae(se.id,"seo_description",ie.target.value),className:"wm-input !py-4 !h-28 !font-bold !text-xs bg-slate-50/30 resize-none",placeholder:"توضیحات سئو..."}),o.jsxs("div",{className:"bg-slate-50/80 p-5 rounded-[1.75rem] flex items-center justify-between",children:[o.jsx("span",{className:"text-[10px] font-black text-slate-500 uppercase",children:"ایندکس گوگل"}),o.jsx("button",{onClick:()=>ae(se.id,"seo_robots",se.seo_robots==="noindex"?"index":"noindex"),className:`w-11 h-6 rounded-full relative transition-all ${se.seo_robots==="noindex"?"bg-slate-200":"bg-emerald-500"}`,children:o.jsx("div",{className:`absolute top-1 w-4 h-4 bg-white rounded-full transition-all ${se.seo_robots==="noindex"?"left-1":"left-6"}`})})]}),o.jsxs("div",{className:"bg-slate-50/80 p-5 rounded-[1.75rem] flex items-center justify-between",children:[o.jsx("input",{value:se.seo_redirect||"",onChange:ie=>re(se.id,"seo_redirect",ie.target.value),onBlur:ie=>ae(se.id,"seo_redirect",ie.target.value),className:"bg-transparent border-none p-0 text-[11px] font-black text-slate-700 w-full",placeholder:"ریدایرکت ۳۰۱..."}),o.jsx("input",{type:"checkbox",checked:!!se.seo_redirect_status,onChange:()=>ae(se.id,"seo_redirect_status",!se.seo_redirect_status),className:"w-6 h-6 rounded-lg text-emerald-500 focus:ring-emerald-500 border-slate-200"})]})]})]}),o.jsxs("div",{className:"p-8 border-t border-slate-50 bg-slate-50/20 flex flex-col gap-3",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{onClick:()=>nt(se),className:"flex-1 h-12 bg-white border border-slate-200 text-slate-700 rounded-2xl text-[11px] font-black hover:bg-slate-900 hover:text-white transition-all",children:"پیشنمایش"}),o.jsx("button",{onClick:()=>Me(se),className:"flex-[2] h-12 bg-primary-600 text-white rounded-2xl text-[11px] font-black hover:bg-black transition-all flex items-center justify-center gap-2",children:"سئو هوشمند با AI"})]}),o.jsx("button",{onClick:()=>ot(se.id),className:"w-full h-12 bg-white text-slate-600 rounded-2xl border border-slate-200 flex items-center justify-center font-black text-[11px] gap-2",children:"تحلیل حرفهای سئو"}),o.jsx("button",{onClick:()=>$e({productId:se.id,questions:se.seo_faq||[]}),className:"w-full h-12 bg-indigo-50/50 text-indigo-700 rounded-2xl border border-indigo-100 flex items-center justify-center font-black text-[11px] gap-2",children:"مدیریت سوالات FAQ"})]})]},se.id))},"grid"):o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"wm-card overflow-hidden !rounded-[2.5rem]",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-right",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"bg-white text-slate-900 border-b border-slate-200",children:[o.jsx("th",{className:"py-6 px-10 whitespace-nowrap w-20 text-center rounded-r-[2.5rem]",children:o.jsx("input",{type:"checkbox",checked:L.length===s.length&&s.length>0,onChange:()=>D(L.length===s.length?[]:s.map(se=>se.id)),className:"w-6 h-6 rounded-lg opacity-30 checked:opacity-100"})}),o.jsx("th",{className:"py-6 px-6 font-black text-xs uppercase tracking-tighter whitespace-nowrap",children:"مشخصات محصول"}),o.jsx("th",{className:"py-6 px-6 font-black text-xs uppercase tracking-tighter whitespace-nowrap",children:"محتوای سئو گوگل"}),o.jsx("th",{className:"py-6 px-6 font-black text-xs uppercase tracking-tighter whitespace-nowrap",children:"وضعیت و ریدایرکت"}),o.jsx("th",{className:"py-6 px-6 font-black text-xs uppercase tracking-tighter whitespace-nowrap text-center",children:"نمره سئو"}),o.jsx("th",{className:"py-6 pr-10 pl-4 whitespace-nowrap w-48 text-center rounded-l-[2.5rem]",children:"عملیات"})]})}),o.jsx("tbody",{className:"divide-y divide-slate-50",children:s.map(se=>o.jsxs("tr",{className:`hover:bg-slate-50 transition-all ${Ge(se.id)?"bg-primary-50/30":""}`,children:[o.jsx("td",{className:"py-8 px-10 text-center",children:o.jsx("input",{type:"checkbox",checked:L.includes(se.id),onChange:()=>D(ie=>ie.includes(se.id)?ie.filter(J=>J!==se.id):[...ie,se.id]),className:"w-6 h-6 rounded-lg border-2 border-slate-200"})}),o.jsx("td",{className:"py-8 px-6",children:o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"w-16 h-16 bg-slate-100 rounded-xl overflow-hidden shrink-0 relative",children:[se.image?o.jsx("img",{src:se.image,className:"w-full h-full object-cover"}):o.jsx(bc,{className:"w-full h-full p-4 text-slate-300"}),Ge(se.id)&&o.jsx("div",{className:"absolute inset-0 bg-primary-600/40 flex items-center justify-center text-white",children:o.jsx(ig,{className:"animate-spin",size:24})})]}),o.jsx("div",{className:"min-w-0 max-w-[180px] font-black text-xs text-slate-800 line-clamp-2",children:se.name})]})}),o.jsx("td",{className:"py-8 px-6",children:o.jsxs("div",{className:"flex flex-col gap-2 min-w-[280px]",children:[o.jsx("input",{value:se.seo_title,onChange:ie=>re(se.id,"seo_title",ie.target.value),onBlur:ie=>ae(se.id,"seo_title",ie.target.value),className:"w-full h-10 px-4 bg-slate-50 border border-slate-100 rounded-xl text-xs font-black",placeholder:"عنوان سئو..."}),o.jsx("textarea",{value:se.seo_description,onChange:ie=>re(se.id,"seo_description",ie.target.value),onBlur:ie=>ae(se.id,"seo_description",ie.target.value),className:"w-full h-16 p-3 bg-slate-50 border border-slate-100 rounded-xl text-[10px] font-bold resize-none",placeholder:"متای توضیحات..."})]})}),o.jsx("td",{className:"py-8 px-6",children:o.jsxs("div",{className:"flex flex-col gap-2 min-w-[220px]",children:[o.jsxs("div",{className:"bg-slate-50 p-2 rounded-xl flex items-center justify-between",children:[o.jsx("span",{className:"text-[10px] font-black text-slate-500 uppercase",children:"ریدایرکت فعال"}),o.jsx("button",{onClick:()=>ae(se.id,"seo_redirect_status",!se.seo_redirect_status),className:`w-8 h-4 rounded-full relative transition-all ${se.seo_redirect_status?"bg-emerald-500":"bg-slate-200"}`,children:o.jsx("div",{className:`absolute top-0.5 w-3 h-3 bg-white rounded-full transition-all ${se.seo_redirect_status?"left-4":"left-0.5"}`})})]}),o.jsx("input",{value:se.seo_redirect||"",onChange:ie=>re(se.id,"seo_redirect",ie.target.value),onBlur:ie=>ae(se.id,"seo_redirect",ie.target.value),className:"w-full h-10 px-4 bg-slate-50 border border-slate-100 rounded-xl text-[10px] font-black",placeholder:"https://..."})]})}),o.jsx("td",{className:"py-8 px-6 text-center",children:o.jsxs("div",{className:`w-12 h-12 rounded-xl flex items-center justify-center font-black text-xs mx-auto ${se.content_score>70?"bg-emerald-50 text-emerald-600":"bg-amber-50 text-amber-600"}`,children:[se.content_score,"%"]})}),o.jsx("td",{className:"py-8 pr-10 pl-4",children:o.jsxs("div",{className:"flex flex-col gap-1.5 w-full",children:[o.jsx("button",{onClick:()=>nt(se),className:"h-8 bg-white border border-slate-200 rounded-lg text-[10px] font-black",children:"پیشنمایش"}),o.jsx("button",{onClick:()=>Me(se),className:"h-8 bg-primary-600 text-white rounded-lg text-[10px] font-black flex items-center justify-center gap-2",children:"سئو هوشمند"}),o.jsx("button",{onClick:()=>ot(se.id),className:"h-8 bg-white border border-slate-200 rounded-lg text-[10px] font-black",children:"تحلیل سئو"}),o.jsx("button",{onClick:()=>$e({productId:se.id,questions:se.seo_faq||[]}),className:"h-8 bg-indigo-50/50 text-indigo-700 border border-indigo-100 rounded-lg text-[10px] font-black",children:"مدیریت FAQ"}),o.jsxs("div",{className:"flex items-center justify-between bg-slate-50 p-1 rounded-lg",children:[o.jsx("span",{className:"text-[9px] font-black px-1",children:"ایندکس"}),o.jsx("button",{onClick:()=>ae(se.id,"seo_robots",se.seo_robots==="noindex"?"index":"noindex"),className:`w-8 h-4 rounded-full relative ${se.seo_robots==="noindex"?"bg-slate-200":"bg-emerald-500"}`,children:o.jsx("div",{className:`absolute top-0.5 w-3 h-3 bg-white rounded-full transition-all ${se.seo_robots==="noindex"?"left-0.5":"left-[18px]"}`})})]})]})})]},se.id))})]})})},"list")}),F>V&&o.jsxs("div",{className:"flex items-center justify-between bg-white p-8 rounded-[2.5rem] border border-slate-100 shadow-soft",children:[o.jsxs("span",{className:"text-xs font-black text-slate-400",children:["نمایش ",(z-1)*V+1," تا ",Math.min(z*V,F)," از ",F," محصول"]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("button",{onClick:()=>H(se=>Math.max(1,se-1)),disabled:z===1,className:"w-12 h-12 bg-white border border-slate-200 rounded-2xl flex items-center justify-center text-slate-500 disabled:opacity-30",children:o.jsx(f0,{size:20})}),o.jsx("button",{onClick:()=>H(se=>se+1),disabled:z>=Math.ceil(F/V),className:"w-12 h-12 bg-white border border-slate-200 rounded-2xl flex items-center justify-center text-slate-500 disabled:opacity-30",children:o.jsx(N1,{size:20})})]})]}),o.jsx("div",{className:"fixed bottom-10 left-1/2 -translate-x-1/2 z-[100]",children:o.jsx(FH,{selectedCount:L.length,onApply:de})})]}),e==="templates"&&o.jsxs("div",{className:"wm-card p-12 space-y-12",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h2",{className:"text-3xl font-black text-slate-800 tracking-tight",children:"هدفگیری انبوه سئو"}),o.jsxs("div",{className:"flex items-center gap-3 bg-amber-50 text-amber-700 px-6 py-3 rounded-2xl border border-amber-100",children:[o.jsx(Jc,{size:18}),o.jsx("span",{className:"text-xs font-black",children:"پردازش هوشمند در پسزمینه انجام میشود."})]})]}),o.jsxs("div",{className:"grid grid-cols-12 gap-12",children:[o.jsxs("div",{className:"col-span-12 lg:col-span-7 space-y-10",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsx("label",{className:"text-xs font-black text-slate-500",children:"انتخاب دسته محصولات"}),o.jsxs("select",{value:fe,onChange:se=>Ve(se.target.value),className:"wm-select h-16 !rounded-2xl",children:[o.jsx("option",{value:"all",children:"تمام کاتالوگ محصولات"}),te.map(se=>o.jsx("option",{value:se.slug,children:se.name},se.id))]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("label",{className:"text-xs font-black text-slate-500",children:"معیار هدفگیری"}),o.jsx("div",{className:"grid grid-cols-1 gap-2",children:["no_seo_title","no_seo_description","missing_alt","noindex","all"].map(se=>o.jsxs("label",{className:"flex items-center gap-3 p-4 bg-slate-50 rounded-xl cursor-pointer hover:bg-slate-100 transition-all font-bold text-[11px]",children:[o.jsx("input",{type:"checkbox",checked:ne.includes(se),onChange:()=>xe(ie=>ie.includes(se)?ie.filter(J=>J!==se):[...ie,se]),className:"w-5 h-5 rounded border-slate-200 text-primary-600"}),se==="no_seo_title"?"محصولات بدون عنوان سئو":se==="no_seo_description"?"محصولات بدون متای توضیحات":se==="missing_alt"?"تصاویر بدون متن جایگزین (ALT)":se==="noindex"?"محصولات No-Index":"همه موارد"]},se))})]})]}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("label",{className:"text-xs font-black text-slate-500",children:"الگوی تولید عنوان سئو"}),o.jsx("span",{className:"text-[10px] font-bold text-primary-500 cursor-help",title:"{product_name}, {site_name}, {category}, {brand}",children:"راهنمای تگها"})]}),o.jsx("input",{value:Ke,onChange:se=>qe(se.target.value),className:"wm-input h-14 !font-black !text-xs",placeholder:"الگوی عنوان..."})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx("label",{className:"text-xs font-black text-slate-500",children:"الگوی تولید متای توضیحات"}),o.jsx("textarea",{value:we,onChange:se=>k(se.target.value),className:"wm-input h-32 !py-4 !font-bold !text-xs resize-none",placeholder:"الگوی توضیحات..."})]})]}),o.jsxs("button",{onClick:lt,disabled:u,className:"w-full h-16 bg-primary-600 text-white rounded-[1.5rem] font-black hover:bg-black transition-all shadow-glow-primary flex items-center justify-center gap-4",children:[o.jsx(Fu,{size:24})," اجرای هوشمند عملیات بر روی دسته انتخابی"]})]}),o.jsx("div",{className:"col-span-12 lg:col-span-5 space-y-8",children:o.jsxs("div",{className:"p-10 bg-slate-900 rounded-[3rem] text-white shadow-2xl relative overflow-hidden",children:[o.jsx("div",{className:"absolute top-0 left-0 w-full h-1 bg-white/10",children:o.jsx(ht.div,{className:"h-full bg-primary-500 shadow-[0_0_20px_rgba(37,99,235,0.8)]",initial:{width:0},animate:{width:`${O}%`}})}),o.jsxs("h3",{className:"text-lg font-black mb-8 flex items-center gap-4",children:[o.jsx(ig,{className:O>0&&O<100?"animate-spin":""})," لاگ عملیات پسزمینه"]}),o.jsx("div",{className:"space-y-5 min-h-[300px] max-h-[300px] overflow-y-auto pr-2 scrollbar-hide text-right border-r-2 border-white/5",children:_.length===0?o.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-white/20 gap-4",children:[o.jsx(bc,{size:48}),o.jsx("span",{className:"text-xs font-black italic",children:"در انتظار شروع عملیات..."})]}):_.map((se,ie)=>o.jsxs(ht.div,{initial:{x:20,opacity:0},animate:{x:0,opacity:1},className:"text-[11px] font-bold text-slate-300 flex items-center gap-3",children:[o.jsx("div",{className:"w-2 h-2 rounded-full bg-primary-500 shrink-0 shadow-[0_0_8px_rgba(37,99,235,1)]"})," ",se]},ie))})]})})]})]}),e==="redirects"&&o.jsxs("div",{className:"space-y-8",children:[o.jsxs("div",{className:"wm-card p-8 flex items-center justify-between bg-white border border-slate-100",children:[o.jsxs("div",{className:"flex items-center gap-6",children:[o.jsx("div",{className:"w-16 h-16 bg-rose-50 text-rose-600 rounded-3xl flex items-center justify-center shadow-inner",children:o.jsx(BU,{size:32})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-2xl font-black text-slate-800",children:"مدیریت متمرکز ریدایرکتها"}),o.jsx("p",{className:"text-xs font-bold text-slate-400 mt-1",children:"لیست تمامی انتقالهای ۳۰۱ فعال در سیستم سئو"})]})]}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("button",{onClick:X,className:"h-14 px-8 bg-emerald-50 text-emerald-700 border border-emerald-100 rounded-2xl text-xs font-black hover:bg-emerald-600 hover:text-white transition-all flex items-center gap-3 shadow-soft",children:[o.jsx(ig,{size:18,className:u?"animate-spin":""})," همگامسازی از کاتالوگ"]}),o.jsxs("button",{onClick:Qe,className:"h-14 px-8 bg-white border border-slate-200 text-slate-700 rounded-2xl text-xs font-black hover:bg-slate-50 transition-all flex items-center gap-3 shadow-soft",children:[o.jsx(om,{size:18})," خروجی CSV (فارسی)"]})]})]}),o.jsx("div",{className:"wm-card overflow-hidden !rounded-[2.5rem]",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-right",dir:"ltr",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"bg-slate-50 text-slate-900 border-b border-slate-100 font-black text-xs",children:[o.jsx("th",{className:"py-6 px-10 text-right",children:"لینک قدیمی (Source)"}),o.jsx("th",{className:"py-6 px-6 text-center w-12"}),o.jsx("th",{className:"py-6 px-10 text-left",children:"مقصد جدید (Target URL)"}),o.jsx("th",{className:"py-6 px-6 text-center uppercase tracking-tighter",children:"بازدید (Hits)"}),o.jsx("th",{className:"py-6 px-6 text-center uppercase tracking-tighter",children:"وضعیت"}),o.jsx("th",{className:"py-6 pr-6 pl-10 text-center",children:"عملیات"})]})}),o.jsx("tbody",{className:"divide-y divide-slate-50",children:ce.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:6,className:"py-20 text-center text-slate-300 font-bold italic",children:"هیچ ریدایرکت فعالی در سیستم یافت نشد."})}):ce.map(se=>o.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[o.jsx("td",{className:"py-6 px-10",children:o.jsxs("div",{className:"text-[11px] font-black text-slate-500 bg-slate-100/50 px-4 py-2 rounded-xl border border-slate-100 inline-block",children:["/",se.old_url]})}),o.jsx("td",{className:"py-6 px-6 text-center",children:o.jsx(MU,{size:20,className:"text-primary-500 mx-auto"})}),o.jsx("td",{className:"py-6 px-10 text-left",children:o.jsx("input",{value:se.new_url,onChange:ie=>_e(J=>J.map(me=>me.id===se.id?{...me,new_url:ie.target.value}:me)),onBlur:ie=>Ce(se.id,{new_url:ie.target.value}),className:"w-full h-10 px-4 bg-white border border-slate-100 rounded-xl text-[11px] font-bold text-emerald-600 text-left",dir:"ltr"})}),o.jsx("td",{className:"py-6 px-6 text-center",children:o.jsx("div",{className:"w-12 h-8 bg-blue-50 text-blue-600 rounded-lg flex items-center justify-center text-[10px] font-black mx-auto",children:se.hits||0})}),o.jsx("td",{className:"py-6 px-6 text-center",children:o.jsx("button",{onClick:()=>Ce(se.id,{status:se.status==="active"?"inactive":"active"}),className:`w-11 h-6 rounded-full relative transition-all mx-auto ${se.status==="active"?"bg-emerald-500":"bg-slate-300"}`,children:o.jsx(ht.div,{className:"absolute top-1 w-4 h-4 bg-white rounded-full",animate:{left:se.status==="active"?"24px":"4px"}})})}),o.jsx("td",{className:"py-6 pr-6 pl-10 text-center",children:o.jsx("button",{onClick:()=>Oe(se.id),className:"w-10 h-10 bg-white text-rose-500 border border-rose-100 rounded-xl flex items-center justify-center hover:bg-rose-500 hover:text-white transition-all mx-auto opacity-0 group-hover:opacity-100",children:o.jsx(zu,{size:18})})})]},se.id))})]})})})]}),o.jsx(tr,{children:dt&&o.jsx("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-sm z-[2147483647] flex items-center justify-center p-8",onClick:()=>$e(null),children:o.jsxs(ht.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"bg-white w-full max-w-2xl rounded-[3rem] shadow-[0_64px_128px_-32px_rgba(0,0,0,0.5)] overflow-hidden",onClick:se=>se.stopPropagation(),children:[o.jsxs("div",{className:"p-10 border-b border-slate-100 flex items-center justify-between bg-indigo-50/50",children:[o.jsxs("div",{className:"flex items-center gap-5",children:[o.jsx("div",{className:"w-16 h-16 bg-white rounded-3xl flex items-center justify-center text-indigo-600 shadow-xl ring-1 ring-indigo-100",children:o.jsx(rg,{size:32})}),o.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tight",children:"سوالات متداول (FAQ)"})]}),o.jsx("button",{onClick:()=>$e(null),className:"w-12 h-12 bg-white text-slate-400 rounded-xl flex items-center justify-center shadow-soft ring-1 ring-slate-100",children:o.jsx(qi,{size:24})})]}),o.jsxs("div",{className:"p-10 max-h-[50vh] overflow-y-auto space-y-6 scrollbar-hide text-right",children:[dt.questions.map((se,ie)=>o.jsxs("div",{className:"p-6 bg-slate-50 rounded-[2rem] border border-slate-100 space-y-4 relative group",children:[o.jsx("button",{onClick:()=>$e({...dt,questions:dt.questions.filter((J,me)=>me!==ie)}),className:"absolute top-4 left-4 w-8 h-8 bg-white text-rose-500 rounded-lg flex items-center justify-center opacity-0 group-hover:opacity-100 transition-all border border-rose-100",children:o.jsx(zu,{size:16})}),o.jsx("input",{value:se.question,onChange:J=>{const me=[...dt.questions];me[ie].question=J.target.value,$e({...dt,questions:me})},className:"w-full h-12 px-6 rounded-xl bg-white border border-slate-200 font-black text-xs",placeholder:"متن پرسش..."}),o.jsx("textarea",{value:se.answer,onChange:J=>{const me=[...dt.questions];me[ie].answer=J.target.value,$e({...dt,questions:me})},className:"w-full p-6 rounded-xl bg-white border border-slate-200 font-bold text-xs h-24 resize-none",placeholder:"متن پاسخ..."})]},ie)),o.jsx("button",{onClick:()=>$e({...dt,questions:[...dt.questions,{question:"",answer:""}]}),className:"w-full py-6 border-2 border-dashed border-slate-200 rounded-[1.5rem] text-xs font-black text-slate-400 hover:border-primary-500 hover:text-primary-600 transition-all",children:"+ افزودن سوال جدید"})]}),o.jsxs("div",{className:"p-10 bg-slate-50 border-t border-slate-100 flex gap-4",children:[o.jsx("button",{onClick:()=>tt(dt.productId,dt.questions),className:"flex-[2] h-14 bg-indigo-600 text-white rounded-2xl font-black text-sm shadow-xl hover:bg-indigo-700 transition-all",children:"ذخیره سوالات FAQ"}),o.jsx("button",{onClick:()=>$e(null),className:"flex-1 h-14 bg-white text-slate-500 border border-slate-200 rounded-2xl font-black text-sm",children:"انصراف"})]})]})})}),o.jsx(tr,{children:Re&&o.jsx("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-sm z-[2147483647] flex items-center justify-center p-8",onClick:()=>Ze(null),children:o.jsxs(ht.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"bg-white w-full max-w-2xl rounded-[3rem] shadow-[0_64px_128px_-32px_rgba(0,0,0,0.5)] overflow-hidden",onClick:se=>se.stopPropagation(),children:[o.jsxs("div",{className:"p-10 border-b border-slate-100 flex items-center justify-between bg-slate-900 text-white",children:[o.jsxs("div",{className:"flex items-center gap-5",children:[o.jsx("div",{className:"w-16 h-16 bg-primary-500 rounded-3xl flex items-center justify-center text-white shadow-lg",children:o.jsx(Hr,{size:32})}),o.jsx("h3",{className:"text-2xl font-black tracking-tight",children:"تحلیل حرفهای سئو"})]}),o.jsx("button",{onClick:()=>Ze(null),className:"w-12 h-12 bg-white/10 text-white/40 rounded-xl flex items-center justify-center hover:bg-white/20 hover:text-white transition-all",children:o.jsx(qi,{size:24})})]}),o.jsx("div",{className:"p-10 space-y-6 text-right",children:o.jsxs("div",{className:"bg-slate-50 p-8 rounded-[2rem] border border-slate-100",children:[o.jsxs("h5",{className:"text-sm font-black text-slate-800 mb-4 flex items-center gap-3",children:[o.jsx(ho,{size:18,className:"text-emerald-500"})," توصیههای بهینهسازی:"]}),o.jsx("div",{className:"text-[13px] font-bold text-slate-600 leading-loose",style:{whiteSpace:"pre-line"},children:Re.recommendations})]})}),o.jsx("div",{className:"p-10 bg-slate-50 border-t border-slate-100",children:o.jsx("button",{onClick:()=>Ze(null),className:"w-full h-14 bg-white border border-slate-200 rounded-2xl font-black text-sm hover:bg-slate-100 transition-all",children:"بستن پنجره تحلیل"})})]})})}),o.jsx(tr,{children:Fe&&o.jsx("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-sm z-[2147483647] flex items-center justify-center p-8",onClick:()=>nt(null),children:o.jsxs(ht.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"bg-white w-full max-w-2xl rounded-[3rem] shadow-[0_64px_128px_-32px_rgba(0,0,0,0.5)] overflow-hidden",onClick:se=>se.stopPropagation(),children:[o.jsxs("div",{className:"p-10 border-b border-slate-100 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-6",children:[o.jsx("div",{className:"w-16 h-16 bg-primary-50 rounded-3xl flex items-center justify-center text-primary-600 shadow-inner",children:o.jsx(Jp,{size:32})}),o.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tight",children:"پیشنمایش گوگل ۲۰۲۶"})]}),o.jsx("button",{onClick:()=>nt(null),className:"w-12 h-12 bg-slate-50 text-slate-400 rounded-xl flex items-center justify-center hover:bg-rose-50 hover:text-rose-500 transition-all",children:o.jsx(qi,{size:24})})]}),o.jsx("div",{className:"p-10 bg-[#f8f9fa] flex items-center justify-center overflow-hidden",children:o.jsxs("div",{className:"bg-white p-10 rounded-[2rem] shadow-xl border border-slate-100 w-full space-y-4 text-left",dir:"ltr",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-8 h-8 bg-slate-100 rounded-full flex items-center justify-center",children:o.jsx(XD,{size:14,className:"text-slate-400"})}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"text-xs font-medium text-[#202124]",children:"Woocommersa"}),o.jsxs("span",{className:"text-[10px] text-[#4d5156] truncate max-w-[200px]",children:[window.location.hostname," › products"]})]})]}),o.jsx("h4",{className:"text-xl text-[#1a0dab] hover:underline cursor-pointer font-medium leading-tight line-clamp-2",children:Fe.seo_title||Fe.name}),o.jsx("p",{className:"text-[13px] text-[#4d5156] leading-relaxed line-clamp-2",children:Fe.seo_description||"Your SEO description will appear here..."})]})}),o.jsxs("div",{className:"p-10 bg-white grid grid-cols-3 gap-4 border-t border-slate-50",children:[o.jsxs("div",{className:"flex items-center gap-2 justify-center py-3 bg-emerald-50 text-emerald-600 rounded-xl text-[10px] font-black",children:[o.jsx(ho,{size:16})," سازگار با موبایل"]}),o.jsxs("div",{className:"flex items-center gap-2 justify-center py-3 bg-blue-50 text-blue-600 rounded-xl text-[10px] font-black",children:[o.jsx(rg,{size:16})," نتایج غنی (FAQ)"]}),o.jsxs("div",{className:"flex items-center gap-2 justify-center py-3 bg-indigo-50 text-indigo-600 rounded-xl text-[10px] font-black",children:[o.jsx(Hr,{size:16})," سرعت لود بالا"]})]})]})})})]})},yY=[{id:"regular_price",label:"قیمت عادی",icon:Od,color:"text-blue-500"},{id:"sale_price",label:"قیمت ویژه",icon:Hr,color:"text-amber-500"},{id:"cost_price",label:"قیمت خرید",icon:jk,color:"text-emerald-500"},{id:"stock",label:"موجودی",icon:bc,color:"text-indigo-500"},{id:"stock_status",label:"وضعیت انبار",icon:qs,color:"text-rose-500"},{id:"manage_stock",label:"مدیریت انبار",icon:Zc,color:"text-slate-500"},{id:"sale_from",label:"شروع تخفیف",icon:Ll,color:"text-orange-500"},{id:"sale_to",label:"پایان تخفیف",icon:Ll,color:"text-rose-600"},{id:"name",label:"نام محصول",icon:Ia,color:"text-primary-500"},{id:"sku",label:"SKU (کد کالا)",icon:Od,color:"text-slate-400"},{id:"brand",label:"برند محصولات",icon:Fu,color:"text-orange-500"},{id:"regular_price_by_margin",label:"حاشیه سود",icon:Hr,color:"text-purple-500"}],sme={regular_price:{operations:[{id:"set",label:"جایگزینی با"},{id:"increase",label:"افزایش به میزان"},{id:"decrease",label:"کاهش به میزان"}],units:[{id:"percentage",label:"درصد (%)"},{id:"fixed",label:"مبلغ ثابت"}],type:"number",isPrice:!0},sale_price:{operations:[{id:"set",label:"جایگزینی با"},{id:"increase",label:"افزایش به میزان"},{id:"decrease",label:"کاهش به میزان"}],units:[{id:"percentage",label:"درصد (%)"},{id:"fixed",label:"مبلغ ثابت"}],type:"number",isPrice:!0},cost_price:{operations:[{id:"set",label:"جایگزینی با"},{id:"increase",label:"افزایش به میزان"},{id:"decrease",label:"کاهش به میزان"}],units:[{id:"percentage",label:"درصد (%)"},{id:"fixed",label:"مبلغ ثابت"}],type:"number",isPrice:!0},stock:{operations:[{id:"set",label:"تنظیم وضعیت و تعداد"}],units:[{id:"fixed",label:"عدد"}],type:"stock_combined"},stock_status:{operations:[{id:"set",label:"تغییر به"}],units:[],type:"select"},manage_stock:{operations:[{id:"set",label:"تغییر به"}],units:[],type:"select"},sale_from:{operations:[{id:"set",label:"تغییر به"}],units:[],type:"date"},sale_to:{operations:[{id:"set",label:"تغییر به"}],units:[],type:"date"},name:{operations:[{id:"set",label:"تغییر به"},{id:"prepend",label:"افزودن به ابتدا"},{id:"append",label:"افزودن به انتها"}],units:[],type:"text"},sku:{operations:[{id:"set",label:"تغییر به"},{id:"prepend",label:"افزودن به ابتدا"},{id:"append",label:"افزودن به انتها"}],units:[],type:"text"},brand:{operations:[{id:"set",label:"تغییر به (جایگزینی)"},{id:"add",label:"افزودن برند جدید"},{id:"remove",label:"حذف برند انتخاب شده"}],units:[],type:"brand_select"},regular_price_by_margin:{operations:[{id:"set",label:"تنظیم بر اساس"}],units:[{id:"percentage",label:"درصد سود"}],type:"number",isPrice:!0}},xY=[{id:"none",label:"بدون رُند کردن"},{id:"5",label:"مضرب ۵"},{id:"10",label:"مضرب ۱۰"},{id:"100",label:"مضرب ۱۰۰"},{id:"1000",label:"مضرب ۱۰۰۰"},{id:"digits_1",label:"۱ رقم معنادار"},{id:"digits_2",label:"۲ رقم معنادار"},{id:"digits_3",label:"۳ رقم معنادار"},{id:"ceil_5",label:"رو به بالا (۵)"},{id:"ceil_10",label:"رو به بالا (۱۰)"},{id:"ceil_100",label:"رو به بالا (۱۰۰)"}],ome=({settings:t,initialSelectedIds:e=[]})=>{var Ce,Oe,Ge,Qe,se;const[n,r]=W.useState([]),[i,s]=W.useState(!1),[a,u]=W.useState(e);W.useEffect(()=>{u(e)},[e]);const[h,m]=W.useState("regular_price"),[g,y]=W.useState("increase"),[x,C]=W.useState("percentage"),[E,M]=W.useState(""),[j,L]=W.useState("none"),[D,z]=W.useState(!1),[H,V]=W.useState(0),[F,B]=W.useState(null),[te,ve]=W.useState(""),[ce,_e]=W.useState([]),[pe,Le]=W.useState(""),[Fe,nt]=W.useState([]),[dt,$e]=W.useState(""),[Re,Ze]=W.useState(""),[Ee,Q]=W.useState("20"),[fe,Ve]=W.useState(1),[ne,xe]=W.useState({}),[Ke,qe]=W.useState(!1),[we,k]=W.useState(!0),[_,N]=W.useState({}),[O,G]=W.useState(null),[q,I]=W.useState("instock"),Z=sme[h];W.useEffect(()=>{a.length>0&&G(null)},[a.length]),W.useEffect(()=>{Z&&(Z.operations.find(ie=>ie.id===g)||y(Z.operations[0].id),Z.units.length>0&&!Z.units.find(ie=>ie.id===x)&&C(Z.units[0].id))},[h]);const U=async()=>{try{const J=await(await fetch(`${window.woocommersa_data.apiUrl}/categories`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();_e(Array.isArray(J.data)?J.data:[])}catch{_e([])}},re=async()=>{try{const J=await(await fetch(`${window.woocommersa_data.apiUrl}/products/brands`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();nt(Array.isArray(J.data)?J.data:[])}catch{nt([])}},ae=async()=>{var ie,J;s(!0);try{const me=(ie=window.woocommersa_data)==null?void 0:ie.apiUrl,Se=(J=window.woocommersa_data)==null?void 0:J.nonce;if(!me||!Se)return;const je=new URL(`${me}/products`);je.searchParams.append("per_page",Ee),je.searchParams.append("page",fe.toString()),te&&je.searchParams.append("category",te),pe&&je.searchParams.append("brand",pe),Re&&je.searchParams.append("search",Re),dt&&je.searchParams.append("vendor",dt);const ut=await(await fetch(je.toString(),{headers:{"X-WP-Nonce":Se}})).json(),wt=(ut==null?void 0:ut.data)||[];r(fe===1?wt:kt=>[...kt,...wt]),k(wt.length>=parseInt(Ee))}catch{ze.error("خطا در دریافت لیست محصولات")}finally{s(!1)}};W.useEffect(()=>{U(),re()},[]),W.useEffect(()=>{const ie=setTimeout(()=>{Ve(1),ae()},500);return()=>clearTimeout(ie)},[Re,te,pe,Ee,dt]),W.useEffect(()=>{fe>1&&ae()},[fe]),W.useEffect(()=>{const ie=n.filter(J=>(J.type==="variable"||J.has_variations)&&!_[J.id]);ie.length>0&&ie.forEach(async J=>{try{const Se=await(await fetch(`${window.woocommersa_data.apiUrl}/products/variations/${J.id}`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();N(je=>({...je,[J.id]:Se}))}catch(me){console.error("Error fetching variations for",J.id,me)}})},[n]);const he=async()=>{if(!E||a.length===0){ze.error("لطفا فیلدها را تکمیل کرده و حداقل یک محصول را انتخاب کنید");return}if(h==="stock"){const je=n.filter(Pe=>{if(!a.includes(Pe.id))return!1;const ut=Pe.manage_stock;return!(ut===!0||ut==="yes"||ut===1)});if(je.length>0){alert(`⚠️ خطای مدیریت انبار مدیریت انبار برای ${je.length} محصول منتخب غیرفعال است. ابتدا باید گزینه مدیریت انبار را برای این محصولات فعال کنید تا بتوانید موجودی ثبت کنید.`);return}}if(a.length>200)try{const je=await fetch(`${window.woocommersa_data.apiUrl}/jobs`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({ids:a,updates:{[h]:{operation:g,value:E,unit:x,rounding:j}}})}),Pe=await je.json();if(je.ok){ze.success("عملیات در پسزمینه شروع شد"),B(Pe);return}}catch{ze.error("خطا در شروع عملیات");return}z(!0),V(0);const J=50;let me=0,Se=0;try{for(let je=0;je<a.length;je+=J){const Pe=a.slice(je,je+J);V(Math.round(je/a.length*100));const ut=await fetch(`${window.woocommersa_data.apiUrl}/products/bulk-update`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({ids:Pe,updates:h==="stock"?{stock_status:{operation:"set",value:q},stock:{operation:"set",value:E}}:{[h]:{operation:g,value:E,unit:x,rounding:j}}})}),wt=await ut.json();ut.ok?(me+=wt.success||0,Se+=wt.failed||0):Se+=Pe.length}ze.success(`پایان عملیات: ${me} موفق و ${Se} خطا`),G(`${me} محصول با موفقیت بروزرسانی شدند`),ae(),u([])}catch{ze.error("اختلال در ارتباط با سرور")}finally{z(!1),V(100)}},Me=async()=>{const ie=Object.keys(ne).map(Number);if(ie.length===0)return;qe(!0);const J=ze.loading("در حال ذخیره تغییرات دستی...");try{const me=ie.map(Pe=>({id:Pe,changes:ne[Pe]})),je=await(await fetch(`${window.woocommersa_data.apiUrl}/products/batch-save`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({products:me})})).json();je.success>0||je.failed===0?(ze.success(`${je.success} مورد با موفقیت بروزرسانی شد`,{id:J}),G(`${je.success} مورد با موفقیت ذخیره شد`),xe({}),await ae(),N({})):ze.error("خطا در ذخیره برخی تغییرات",{id:J})}catch{ze.error("خطا در ارتباط با سرور",{id:J})}finally{qe(!1)}},tt=W.useMemo(()=>{let ie=843e3;if(a.length===1){const J=n.find(me=>me.id===a[0]);if(J){const me=Number(h==="sale_price"?J.sale_price:J.regular_price);!isNaN(me)&&me>0&&(ie=me)}}return ie},[a,n,h]),ot=W.useMemo(()=>{const ie=Number(E)||0;let J=tt;if(g==="increase"?J=x==="percentage"||x==="percent"?tt*(1+ie/100):tt+ie:g==="decrease"?J=x==="percentage"||x==="percent"?tt*(1-ie/100):tt-ie:g==="set"&&(J=ie),j==="none"||!j)return J;switch(j){case"5":J=Math.round(J/5)*5;break;case"10":J=Math.round(J/10)*10;break;case"100":J=Math.round(J/100)*100;break;case"1000":J=Math.round(J/1e3)*1e3;break;case"ceil_5":J=Math.ceil(J/5)*5;break;case"ceil_10":J=Math.ceil(J/10)*10;break;case"ceil_100":J=Math.ceil(J/100)*100;break;case"digits_1":{if(J===0)break;const me=Math.pow(10,1-Math.floor(Math.log10(Math.abs(J)))-1);J=Math.round(J*me)/me;break}case"digits_2":{if(J===0)break;const me=Math.pow(10,2-Math.floor(Math.log10(Math.abs(J)))-1);J=Math.round(J*me)/me;break}case"digits_3":{if(J===0)break;const me=Math.pow(10,3-Math.floor(Math.log10(Math.abs(J)))-1);J=Math.round(J*me)/me;break}}return J},[E,g,x,j,tt]),lt=W.useCallback((ie,J,me,Se=!1)=>{xe(je=>{const Pe={...je};if(Pe[ie]={...je[ie]||{},[J]:me},Se){let ut=null;Object.entries(_).forEach(([wt,kt])=>{kt.find(Rt=>Rt.id===ie)&&(ut=Number(wt))}),ut&&_[ut]&&_[ut].forEach(wt=>{Pe[wt.id]={...Pe[wt.id]||{},[J]:me}})}return Pe})},[_]),X=W.useMemo(()=>n.map(ie=>{const J=ne[ie.id];return J?{...ie,...J}:ie}),[n,ne]),de=W.useMemo(()=>{const ie={};return Object.entries(_).forEach(([J,me])=>{ie[Number(J)]=me.map(Se=>{const je=ne[Se.id];return je?{...Se,...je}:Se})}),ie},[_,ne]);return o.jsxs("div",{className:"space-y-10 pb-20",dir:"rtl",children:[o.jsxs("section",{className:"relative",children:[o.jsx("div",{className:"absolute -top-10 -right-10 w-64 h-64 bg-primary-500/5 rounded-full blur-3xl"}),o.jsxs("div",{className:"wm-card p-10 relative z-10 transition-all hover:border-primary-500/10",children:[o.jsxs("div",{className:"flex items-center justify-between mb-8",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-12 h-12 bg-primary-600 rounded-2xl flex items-center justify-center text-white shadow-xl shadow-primary-500/40",children:o.jsx(Hr,{size:24})}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-2xl font-black text-slate-800",children:"بروزرسانی هوشمند"}),o.jsx("p",{className:"text-slate-400 text-xs font-bold mt-1",children:"فرمول تغییرات گروهی خود را در زیر بسازید"})]})]}),a.length>0&&o.jsxs(ht.div,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},className:"px-5 py-2.5 bg-emerald-50 text-emerald-600 rounded-2xl border border-emerald-100 flex items-center gap-2 font-black text-xs",children:[o.jsx(ho,{size:16}),a.length," محصول انتخاب شده"]})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-4 bg-slate-50/50 p-6 rounded-3xl border border-slate-100 mb-8",children:[o.jsxs("div",{className:"flex-1 min-w-[200px] space-y-2",children:[o.jsx("span",{className:"wm-meta mb-2 block",children:"مرحله ۱: فیلد"}),o.jsxs("div",{className:"relative group",children:[o.jsx("select",{value:h,onChange:ie=>m(ie.target.value),className:"wm-select h-14 pr-12",children:yY.map(ie=>o.jsx("option",{value:ie.id,children:ie.label},ie.id))}),o.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 text-primary-500",children:bi.createElement(((Ce=yY.find(ie=>ie.id===h))==null?void 0:Ce.icon)||Od,{size:20})})]})]}),o.jsx(h0,{className:"text-slate-300 shrink-0 mt-6 hidden lg:block rotate-180",size:20}),o.jsxs("div",{className:"flex-1 min-w-[180px] space-y-2",children:[o.jsx("span",{className:"wm-meta mb-2 block",children:"مرحله ۲: عملیات"}),o.jsx("div",{className:"relative",children:o.jsx("select",{value:g,onChange:ie=>y(ie.target.value),className:"wm-select h-14",children:Z==null?void 0:Z.operations.map(ie=>o.jsx("option",{value:ie.id,children:ie.label},ie.id))})})]}),o.jsx(h0,{className:"text-slate-300 shrink-0 mt-6 hidden lg:block rotate-180",size:20}),o.jsxs("div",{className:"flex-[1.5] min-w-[240px] space-y-2",children:[o.jsx("span",{className:"wm-meta mb-2 block",children:"مرحله ۳: مقدار"}),o.jsx("div",{className:"flex gap-2",children:(Z==null?void 0:Z.type)==="select"?o.jsxs("select",{value:E,onChange:ie=>M(ie.target.value),className:"w-full h-16 px-6 bg-white border border-slate-200 rounded-2xl outline-none focus:ring-4 focus:ring-primary-500/10 focus:border-primary-500 font-bold text-sm transition-all shadow-sm",children:[o.jsx("option",{value:"",children:"انتخاب کنید..."}),h==="stock_status"&&o.jsxs(o.Fragment,{children:[o.jsx("option",{value:"instock",children:"✅ در انبار"}),o.jsx("option",{value:"outofstock",children:"❌ ناموجود"}),o.jsx("option",{value:"onbackorder",children:"پیش خرید"})]}),h==="manage_stock"&&o.jsxs(o.Fragment,{children:[o.jsx("option",{value:"yes",children:"فعال"}),o.jsx("option",{value:"no",children:"غیرفعال"})]}),h==="status"&&o.jsxs(o.Fragment,{children:[o.jsx("option",{value:"publish",children:"منتشر شده"}),o.jsx("option",{value:"draft",children:"پیشنویس"}),o.jsx("option",{value:"private",children:"خصوصی"})]})]}):(Z==null?void 0:Z.type)==="brand_select"?o.jsxs("select",{value:E,onChange:ie=>M(ie.target.value),className:"w-full h-16 px-6 bg-white border border-slate-200 rounded-2xl outline-none focus:ring-4 focus:ring-primary-500/10 focus:border-primary-500 font-bold text-sm transition-all shadow-sm",children:[o.jsx("option",{value:"",children:"انتخاب برند..."}),Fe.map(ie=>o.jsx("option",{value:ie.id,children:ie.name},ie.id))]}):(Z==null?void 0:Z.type)==="date"?o.jsx(Dh,{calendar:Hh,locale:Lh,value:E,onChange:ie=>{var J,me,Se;return M(((Se=(me=(J=ie==null?void 0:ie.toDate)==null?void 0:J.call(ie))==null?void 0:me.toLocaleDateString)==null?void 0:Se.call(me,"en-CA"))||"")},containerClassName:"w-full",inputClass:"w-full h-16 px-6 bg-white border border-slate-200 rounded-2xl outline-none focus:ring-4 focus:ring-primary-500/10 font-bold text-sm shadow-sm"}):o.jsxs("div",{className:"flex-1 relative",children:[o.jsx("input",{type:(Z==null?void 0:Z.type)==="number"||(Z==null?void 0:Z.type)==="stock_combined"?"number":"text",value:E,onChange:ie=>M(ie.target.value),placeholder:(Z==null?void 0:Z.type)==="stock_combined"?"تعداد جدید...":"مقدار جدید...",className:"wm-input h-14"}),(Z==null?void 0:Z.type)==="stock_combined"&&o.jsxs("div",{className:"absolute left-2 top-1/2 -translate-y-1/2 flex items-center gap-2 p-1 bg-white rounded-xl border border-slate-200 shadow-sm",children:[o.jsx("button",{onClick:()=>I("instock"),className:`px-3 py-2 rounded-lg text-[10px] font-black transition-all ${q==="instock"?"bg-emerald-500 text-white shadow-md":"text-slate-400 hover:text-slate-600"}`,children:"موجود"}),o.jsx("button",{onClick:()=>I("outofstock"),className:`px-3 py-2 rounded-lg text-[10px] font-black transition-all ${q==="outofstock"?"bg-rose-500 text-white shadow-md":"text-slate-400 hover:text-slate-600"}`,children:"ناموجود"})]}),(Z==null?void 0:Z.units.length)>0&&(Z==null?void 0:Z.type)!=="stock_combined"&&o.jsx("div",{className:"absolute left-2 top-1/2 -translate-y-1/2 flex gap-1 p-1 bg-slate-50 rounded-xl border border-slate-200",children:Z.units.filter(ie=>g!=="set"||ie.id==="fixed").map(ie=>o.jsx("button",{onClick:()=>C(ie.id),className:`px-4 py-2 rounded-lg text-xs font-black transition-all ${x===ie.id?"bg-primary-600 text-white shadow-md":"text-slate-400 hover:text-slate-600"}`,children:ie.label},ie.id))})]})})]})]}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 items-end p-8 bg-white rounded-3xl border border-slate-100 shadow-sm",children:[o.jsx("div",{className:"flex flex-col gap-6",children:(Z==null?void 0:Z.isPrice)&&o.jsxs("div",{className:"flex items-center gap-6",children:[o.jsxs("div",{className:"space-y-1 flex-1",children:[o.jsx("span",{className:"wm-meta mb-1 block",children:"رُند کردن نهایی مبلغ"}),o.jsxs("div",{className:"relative",children:[o.jsx("select",{value:j,onChange:ie=>L(ie.target.value),className:"wm-select h-12 pr-10 text-[13px]",children:xY.map(ie=>o.jsx("option",{value:ie.id,children:ie.label},ie.id))}),o.jsx("div",{className:"absolute right-3.5 top-1/2 -translate-y-1/2 text-primary-500",children:o.jsx(ur,{size:14})})]})]}),(E||j!=="none"&&j!=="")&&o.jsxs("div",{className:"bg-primary-50 px-6 py-4 rounded-3xl border border-primary-100 flex flex-col gap-3 min-w-[260px] shadow-sm",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-1.5 h-1.5 bg-primary-500 rounded-full animate-pulse"}),o.jsx("span",{className:"wm-meta text-primary-500 font-black",children:"پیشنمایش تغییرات مبلغ"})]}),o.jsxs("div",{className:"flex items-center justify-between bg-white/60 p-3 rounded-2xl border border-primary-50/50",children:[o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"text-[9px] font-bold text-slate-400 mb-1",children:"قیمت فعلی:"}),o.jsx("span",{className:"text-[13px] text-slate-500 line-through decoration-rose-400/50 font-medium",children:tt.toLocaleString()})]}),o.jsx(h0,{size:16,className:"text-primary-300 rotate-180"}),o.jsxs("div",{className:"flex flex-col items-end",children:[o.jsx("span",{className:"text-[9px] font-bold text-primary-400 mb-1",children:"قیمت نهایی:"}),o.jsx("span",{className:"text-lg font-black text-primary-600 leading-none",children:ot.toLocaleString()})]})]}),j!=="none"&&j!==""&&o.jsxs("div",{className:"px-3 py-1.5 bg-emerald-50 rounded-xl border border-emerald-100 flex items-center gap-2",children:[o.jsx(ur,{size:10,className:"text-emerald-500"}),o.jsxs("span",{className:"text-[9px] font-black text-emerald-600",children:["همراه با رُند کردن (",(Oe=xY.find(ie=>ie.id===j))==null?void 0:Oe.label,")"]})]})]})]})}),o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsx(tr,{mode:"wait",children:O?o.jsxs(ht.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},className:"p-5 bg-emerald-50 rounded-2xl border border-emerald-100 flex items-start gap-4 text-emerald-700",children:[o.jsx("div",{className:"w-8 h-8 bg-emerald-500/10 rounded-lg flex items-center justify-center text-emerald-600",children:o.jsx(ho,{size:16})}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"text-[11px] font-black uppercase tracking-widest text-emerald-500 mb-1",children:"عملیات موفق"}),o.jsx("span",{className:"text-[12px] font-bold",children:O})]})]},"success-msg"):a.length===0&&o.jsxs(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,scale:.9},className:"wm-alert-warning",children:[o.jsx("div",{className:"w-8 h-8 bg-amber-500/10 rounded-lg flex items-center justify-center",children:o.jsx(Ph,{size:16})}),o.jsx("span",{className:"text-[11px] font-bold",children:"لطفاً ابتدا محصولات مورد نظر را از لیست پایین انتخاب کنید تا دکمه اجرا فعال شود."})]},"warning-msg")}),o.jsxs("button",{onClick:he,disabled:D||a.length===0,className:`h-16 w-full rounded-2xl font-black text-lg transition-all flex items-center justify-center gap-4 relative overflow-hidden group shadow-soft active:scale-[0.98] disabled:bg-slate-100 disabled:text-slate-400 disabled:shadow-none disabled:border-slate-100 border-2 ${D?"bg-slate-800 border-slate-800 text-white":"wm-btn-primary bg-primary-600 hover:bg-white hover:text-primary-600 hover:border-primary-600"}`,children:[D?o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(qs,{className:"animate-spin",size:20}),o.jsxs("span",{children:["در حال اعمال تغییرات... ( ",H,"% )"]})]}):o.jsxs(o.Fragment,{children:[o.jsx(Hr,{size:20,className:"group-hover:scale-110 transition-transform"}),o.jsxs("span",{children:["اجرای عملیات روی ",a.length," محصول منتخب"]})]}),D&&o.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-1.5 bg-white/10",children:o.jsx(ht.div,{className:"h-full bg-primary-400",initial:{width:0},animate:{width:`${H}%`}})})]})]})]})]})]}),o.jsx("section",{className:"bg-white/80 backdrop-blur-md rounded-[2.5rem] p-5 shadow-soft border border-slate-100/50 sticky top-24 z-40",children:o.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-5",children:[o.jsxs("div",{className:"flex-1 relative w-full group",children:[o.jsx(Ia,{className:"absolute right-6 top-1/2 -translate-y-1/2 text-slate-400 z-10",size:20}),o.jsx("input",{type:"text",value:Re,onChange:ie=>Ze(ie.target.value),placeholder:"جستجوی سریع محصولات (نام یا SKU)...",className:"wm-input !h-16 !pr-16 !pl-16 bg-white border-slate-200"}),o.jsx("button",{onClick:ae,className:"absolute left-1.5 top-1.5 bottom-1.5 w-11 bg-primary-600 text-white rounded-xl shadow-glow-primary transition-transform hover:scale-105 active:scale-95 flex items-center justify-center z-10",children:i?o.jsx(ur,{className:"animate-spin",size:18}):o.jsx(Ia,{size:18})})]}),o.jsx("div",{className:"w-full md:w-56 relative",children:o.jsxs("select",{value:te,onChange:ie=>ve(ie.target.value),className:"wm-select !h-16 !pr-6 bg-white border-slate-200",children:[o.jsx("option",{value:"",children:"همه دستهبندیها"}),ce.map(ie=>o.jsx("option",{value:ie.slug,children:ie.name},ie.id))]})}),o.jsx("div",{className:"w-full md:w-56 relative",children:o.jsxs("select",{value:pe,onChange:ie=>Le(ie.target.value),className:"wm-select !h-16 !pr-6 bg-white border-slate-200",children:[o.jsx("option",{value:"",children:"همه برندها"}),Fe.map(ie=>o.jsx("option",{value:ie.id,children:ie.name},ie.id))]})}),((Ge=window.woocommersa_data)==null?void 0:Ge.hasDokan)&&!((Qe=window.woocommersa_data)!=null&&Qe.isVendor)&&o.jsx("div",{className:"w-full md:w-72 relative",children:o.jsxs("select",{value:dt,onChange:ie=>$e(ie.target.value),className:"wm-select !h-16 !pr-6 bg-white border-slate-200",children:[o.jsx("option",{value:"",children:"همه فروشندگان"}),(((se=window.woocommersa_data)==null?void 0:se.vendorsList)||[]).map(ie=>o.jsx("option",{value:ie.id,children:ie.name},ie.id))]})})]})}),o.jsxs("section",{className:"bg-white rounded-[2.5rem] shadow-premium border border-slate-100 overflow-hidden",children:[o.jsxs("div",{className:"p-8 border-b border-slate-50 flex items-center justify-between bg-slate-50/50 backdrop-blur-sm",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-2 h-7 bg-primary-600 rounded-full shadow-glow-primary"}),o.jsx("h3",{className:"wm-title-md",children:"لیست محصولات انتخابی"})]}),o.jsx("div",{className:"flex gap-4",children:o.jsx("div",{className:"w-32",children:o.jsx("select",{value:Ee,onChange:ie=>Q(ie.target.value),className:"wm-select h-14 bg-white",children:[25,50,100,200].map(ie=>o.jsxs("option",{value:ie.toString(),children:[ie," ردیف"]},ie))})})})]}),o.jsxs("div",{className:"min-h-[500px] relative",children:[o.jsx(tr,{mode:"wait",children:i?o.jsxs(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 z-50 bg-white/60 backdrop-blur-sm flex flex-col items-center justify-center",children:[o.jsx("div",{className:"w-16 h-16 border-4 border-primary-500/20 border-t-primary-500 rounded-full animate-spin mb-4"}),o.jsx("p",{className:"font-black text-slate-600 animate-pulse",children:"در حال بروزرسانی لیست..."})]}):null}),o.jsx(DH,{data:X,variations:de,onSelectionChange:u,selectedIds:a,updateData:lt,settings:t,context:"bulk_edit"}),we&&!i&&o.jsx("div",{className:"p-10 flex justify-center bg-slate-50/30 border-t border-slate-100",children:o.jsxs("button",{onClick:()=>Ve(ie=>ie+1),className:"px-12 py-4 bg-white border border-slate-200 text-slate-800 font-black rounded-2xl hover:bg-slate-50 hover:border-primary-500/30 transition-all shadow-lg flex items-center gap-4 group",children:[o.jsx(ur,{size:18,className:"group-hover:rotate-180 transition-transform duration-500"}),o.jsx("span",{children:"بارگذاری محصولات بیشتر"})]})})]})]}),o.jsx(tr,{children:F&&o.jsxs(ht.div,{initial:{y:50,opacity:0,scale:.9},animate:{y:0,opacity:1,scale:1},exit:{y:50,opacity:0,scale:.9},className:"fixed bottom-12 left-12 z-[200] w-[400px] bg-slate-900 rounded-4xl p-8 shadow-premium border border-white/5 text-white",children:[o.jsxs("div",{className:"flex items-center justify-between mb-8",children:[o.jsxs("h4",{className:"font-black text-lg flex items-center gap-3",children:[o.jsx(qs,{className:"text-primary-400 animate-pulse",size:24}),"عملیات پسزمینه"]}),o.jsx("button",{onClick:()=>B(null),className:"p-2 hover:bg-white/10 rounded-xl transition-colors",children:o.jsx(qi,{size:20})})]}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex justify-between items-end",children:[o.jsx("span",{className:"text-xs text-slate-400 font-bold",children:"میزان پیشرفت"}),o.jsxs("span",{className:"text-2xl font-black text-primary-400 tracking-tighter",children:[Math.round(F.processed/F.total*100),"%"]})]}),o.jsx("div",{className:"h-3 bg-white/5 rounded-full overflow-hidden p-0.5 border border-white/5",children:o.jsx(ht.div,{className:"h-full bg-gradient-to-r from-primary-600 to-primary-400 rounded-full",initial:{width:0},animate:{width:`${F.processed/F.total*100}%`}})}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"bg-white/5 p-4 rounded-3xl border border-white/5",children:[o.jsx("span",{className:"text-[10px] text-slate-500 font-black uppercase tracking-widest block mb-1",children:"موفق"}),o.jsx("span",{className:"text-xl font-black text-emerald-400",children:F.processed})]}),o.jsxs("div",{className:"bg-white/5 p-4 rounded-3xl border border-white/5",children:[o.jsx("span",{className:"text-[10px] text-slate-500 font-black uppercase tracking-widest block mb-1",children:"ناموفق"}),o.jsx("span",{className:"text-xl font-black text-rose-400",children:F.failed||0})]})]}),o.jsx("div",{className:"p-4 bg-primary-500/10 rounded-2xl border border-primary-500/20 text-[10px] font-bold text-primary-300 text-center leading-relaxed",children:"این فرآیند به طور خودکار در سرور مدیریت میشود. میتوانید با خیال راحت از صفحه خارج شوید."})]})]})}),o.jsx(tr,{children:Object.keys(ne).length>0&&o.jsxs(ht.div,{initial:{y:100,opacity:0},animate:{y:0,opacity:1},exit:{y:100,opacity:0},className:"fixed bottom-10 left-1/2 -translate-x-1/2 z-[100] bg-white border border-slate-200 rounded-3xl shadow-premium p-2 pl-8 flex items-center gap-6",children:[o.jsxs("div",{className:"flex flex-col",children:[o.jsxs("span",{className:"text-xs font-black text-slate-800",children:[Object.keys(ne).length," محصول ویرایش شده"]}),o.jsx("span",{className:"text-[10px] text-slate-400 font-bold",children:"تغییرات هنوز ذخیره نشدهاند"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{onClick:()=>xe({}),disabled:Ke,className:"wm-btn-secondary h-12",children:"لغو تغییرات"}),o.jsxs("button",{onClick:Me,disabled:Ke,className:"px-8 h-12 rounded-2xl bg-primary-600 text-white font-black text-xs hover:bg-primary-700 transition-all shadow-xl shadow-primary-500/30 flex items-center gap-2 active:scale-95",children:[Ke?o.jsx(ur,{className:"animate-spin",size:16}):o.jsx(Hr,{size:16}),"ذخیره نهایی تمامی تغییرات"]})]})]})})]})},R0=rT(),wY=({value:t,row:e,column:n,onChange:r})=>{const[i,s]=W.useState(t||""),[a,u]=W.useState(!1),h=W.useRef(null);W.useEffect(()=>{s(t||"")},[t]);const m=n.id==="caption"?190:800,g=i.length>m,y=()=>{u(!1),i!==t&&r(e.original.id,n.id,i)};return a?n.id==="description"?o.jsxs("div",{className:"relative z-50",children:[o.jsx("textarea",{ref:h,value:i,onChange:x=>s(x.target.value),onBlur:y,className:`w-full min-w-[250px] p-4 text-xs border-2 rounded-2xl outline-none bg-white shadow-2xl transition-all ${g?"border-rose-500 ring-4 ring-rose-500/10":"border-primary-500 ring-4 ring-primary-500/10"}`,autoFocus:!0}),o.jsxs("div",{className:`absolute bottom-2 left-4 text-[10px] font-black ${g?"text-rose-500":"text-slate-400"}`,children:[i.length,"/",m]})]}):o.jsxs("div",{className:"relative z-50",children:[o.jsx("input",{ref:h,value:i,onChange:x=>s(x.target.value),onBlur:y,className:`w-full min-w-[200px] h-10 px-4 text-xs border-2 rounded-xl outline-none bg-white shadow-2xl transition-all ${g?"border-rose-500 ring-4 ring-rose-500/10":"border-primary-500 ring-4 ring-primary-500/10"}`,autoFocus:!0}),(n.id==="alt"||n.id==="title"||n.id==="caption")&&o.jsxs("div",{className:`absolute -bottom-5 left-1 text-[9px] font-black ${g?"text-rose-500":"text-slate-400"}`,children:[i.length,"/",m]})]}):o.jsxs("div",{onClick:()=>u(!0),className:`cursor-text min-h-[2.5rem] w-full hover:bg-slate-50 border border-transparent hover:border-slate-200 rounded-xl px-3 py-2 transition-all text-slate-700 text-xs flex flex-col justify-center gap-1 ${g?"bg-rose-50/50":""}`,children:[o.jsx("div",{className:"line-clamp-2",title:i,children:i||o.jsx("span",{className:"text-slate-300 italic",children:"بدون محتوا..."})}),(n.id==="caption"||n.id==="description"||n.id==="alt"||n.id==="title")&&i&&o.jsxs("div",{className:`text-[9px] font-bold ${g?"text-rose-500":"text-slate-400"}`,children:[i.length,"/",m," کاراکتر"]})]})},ame=({initialFilter:t,initialProductId:e})=>{const[n,r]=W.useState([]),[i,s]=W.useState(!1),[a,u]=W.useState(0),[h,m]=W.useState(1),[g,y]=W.useState(25),[x,C]=W.useState(""),[E,M]=W.useState(""),[j,L]=W.useState([]),[D,z]=W.useState(t==="no_alt"||t==="missing_alt"),[H,V]=W.useState(t==="no_image"),[F]=W.useState(t==="missing_title"),[B,te]=W.useState(t==="heavy_images"?"400":""),[ve,ce]=W.useState(!1);W.useEffect(()=>{t&&(t==="heavy_images"&&te("400"),(t==="no_alt"||t==="missing_alt")&&z(!0),t==="no_image"&&V(!0)),e&&C(`id:${e}`)},[t,e]);const[_e,pe]=W.useState([]),[Le,Fe]=W.useState("خرید {product_name}"),[nt,dt]=W.useState(!1),[$e,Re]=W.useState({}),[Ze,Ee]=W.useState(!1),[Q,fe]=W.useState(null),Ve=async()=>{try{const O=await(await fetch(`${window.woocommersa_data.apiUrl}/categories`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();L(Array.isArray(O.data)?O.data:[])}catch(N){console.error(N)}},ne=async()=>{s(!0);try{const N=window.woocommersa_data.apiUrl,O=window.woocommersa_data.nonce,G=new URL(`${N}/bulk-images`);G.searchParams.append("page",h.toString()),G.searchParams.append("per_page",g.toString()),x&&G.searchParams.append("search",x),E&&G.searchParams.append("category",E),D&&G.searchParams.append("missing_alt","true"),H&&G.searchParams.append("missing_product_image","true"),F&&G.searchParams.append("missing_title","true"),ve&&G.searchParams.append("non_square","true"),B&&G.searchParams.append("min_size",B);const I=await(await fetch(G.toString(),{headers:{"X-WP-Nonce":O}})).json();r(I.images||I.data||[]),u(I.total||0)}catch{ze.error("خطا در دریافت تصاویر")}finally{s(!1)}};W.useEffect(()=>{Ve()},[]),W.useEffect(()=>{ne()},[h,g,D,H,F,E,ve,B]);const xe=(N,O,G)=>{const q=`${N}-${O}`;Re(I=>({...I,[q]:{id:N,field:O,value:G}})),r(I=>I.map(Z=>Z.id===N?{...Z,[O]:G}:Z))},Ke=async(N,O,G)=>{const q=new FormData;q.append("id",N.toString()),G&&q.append("product_id",G.toString()),q.append("image",O);const I=ze.loading("درحال جایگزینی تصویر...");try{const Z=window.woocommersa_data.apiUrl,U=window.woocommersa_data.nonce,ae=await(await fetch(`${Z}/bulk-images/replace`,{method:"POST",headers:{"X-WP-Nonce":U},body:q})).json();ae.success?(ne(),ze.success("تصویر با موفقیت جایگزین شد",{id:I})):ze.error(ae.message||"خطا در آپلود",{id:I})}catch{ze.error("خطای سیستمی در آپلود",{id:I})}},qe=async()=>{if(_e.length===0){ze.error("هیچ تصویری انتخاب نشده است");return}dt(!0);const N=ze.loading(`${_e.length} مورد در حال سئو شدن...`);try{const O=window.woocommersa_data.apiUrl,G=window.woocommersa_data.nonce,I=await(await fetch(`${O}/bulk-images/auto-seo`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":G},body:JSON.stringify({ids:_e,pattern:Le})})).json();I.success&&(ze.success(`${I.count} متن جایگزین (Alt) با موفقیت اصلاح شد`,{id:N}),ne(),pe([]))}catch{ze.error("خطا در اجرای سئو خودکار",{id:N})}finally{dt(!1)}},we=async()=>{const N=Object.values($e);if(N.length===0){ze.error("هیچ تغییری برای ذخیره وجود ندارد");return}Ee(!0);try{const O=window.woocommersa_data.apiUrl,G=window.woocommersa_data.nonce,I=await(await fetch(`${O}/bulk-images/update`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":G},body:JSON.stringify({changes:N})})).json();if(I.success)ze.success(`${N.length} مورد با موفقیت ذخیره شد`),Re({});else throw new Error(I.message)}catch{ze.error("خطا در ذخیره تغییرات")}finally{Ee(!1)}},k=W.useMemo(()=>[R0.display({id:"select",header:()=>o.jsx("div",{className:"flex items-center justify-center",children:o.jsxs("label",{className:"wm-checkbox-wrapper",onClick:N=>N.stopPropagation(),children:[o.jsx("input",{type:"checkbox",className:"wm-checkbox",checked:_e.length===n.length&&n.length>0,onChange:N=>{N.target.checked?pe(n.map(O=>O.id)):pe([])}}),o.jsx("div",{className:"wm-checkbox-inner"})]})}),cell:N=>o.jsx("div",{className:"flex items-center justify-center",children:o.jsxs("label",{className:"wm-checkbox-wrapper",onClick:O=>O.stopPropagation(),children:[o.jsx("input",{type:"checkbox",className:"wm-checkbox",checked:_e.includes(N.row.original.id),onChange:()=>{pe(O=>O.includes(N.row.original.id)?O.filter(G=>G!==N.row.original.id):[...O,N.row.original.id])}}),o.jsx("div",{className:"wm-checkbox-inner"})]})})}),R0.accessor("preview",{header:"مشاهده و جایگزینی",cell:N=>o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{onClick:()=>fe(N.row.original),className:"w-16 h-16 rounded-2xl overflow-hidden border-2 border-slate-100 cursor-pointer hover:scale-105 transition-all shadow-sm group relative flex-shrink-0 bg-slate-50 flex items-center justify-center",children:[N.getValue()?o.jsx("img",{src:N.getValue(),className:"w-full h-full object-cover",alt:""}):o.jsx(eg,{size:24,className:"text-slate-300"}),o.jsx("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:o.jsx(Eae,{size:16,className:"text-white"})})]}),o.jsxs("label",{className:"cursor-pointer group flex flex-col items-center justify-center w-8 h-8 rounded-xl bg-slate-50 border border-slate-200 hover:bg-primary-50 hover:border-primary-200 transition-all",title:"جایگزینی سریع تصویر",children:[o.jsx(ur,{size:12,className:"text-slate-400 group-hover:text-primary-600"}),o.jsx("input",{type:"file",className:"hidden",accept:"image/*",onChange:O=>{var G;return((G=O.target.files)==null?void 0:G[0])&&Ke(N.row.original.id,O.target.files[0])}})]})]})}),R0.accessor("parent_product",{header:"محصول مرتبط",cell:N=>o.jsx("span",{className:"font-bold text-slate-600 truncate max-w-[150px] block",children:N.getValue()||"بدون محصول"})}),R0.accessor("title",{header:"عنوان (Title)",cell:N=>o.jsx(wY,{...N,value:N.getValue(),onChange:xe})}),R0.accessor("alt",{header:"متن جایگزین (Alt)",cell:N=>o.jsx(wY,{...N,value:N.getValue(),onChange:xe})}),R0.accessor("size",{header:"وضعیت سلامت",cell:N=>{const O=N.row.original,G=O.size_raw>400,q=O.width!==O.height;let I=100;O.alt||(I-=30),G&&(I-=30),q&&(I-=20);const Z=()=>I>=90?"bg-emerald-50 text-emerald-600":I>=70?"bg-blue-50 text-blue-600":I>=40?"bg-amber-50 text-amber-600":"bg-rose-50 text-rose-600";return o.jsxs("div",{className:"space-y-1.5 min-w-[120px]",children:[o.jsx("div",{className:"flex items-center gap-2",children:o.jsxs("span",{className:`text-[10px] font-black px-2 py-0.5 rounded-lg ${Z()}`,children:["Grade: ",I>=90?"A":I>=70?"B":I>=40?"C":"F"," (",I,")"]})}),o.jsx("span",{className:`text-[10px] font-bold px-2 py-1 rounded-lg block w-fit ${G?"bg-rose-50 text-rose-600 animate-pulse border border-rose-100":"bg-slate-50 text-slate-500"}`,children:N.getValue()}),o.jsxs("div",{className:"flex gap-1 items-center",children:[o.jsxs("span",{className:"text-[9px] font-mono text-slate-400",children:[O.width,"×",O.height]}),q&&o.jsx(r2,{size:10,className:"text-amber-500"})]})]})}}),R0.display({id:"external",header:"رسانه",cell:N=>o.jsx("a",{href:N.row.original.edit_link,target:"_blank",rel:"noreferrer",className:"w-8 h-8 rounded-xl bg-slate-50 text-slate-400 hover:bg-primary-50 hover:text-primary-600 transition-all flex items-center justify-center border border-slate-100",title:"ویرایش در وردپرس",children:o.jsx($u,{size:14})})})],[n.length,_e,$e]),_=cT({data:n,columns:k,getCoreRowModel:lT()});return o.jsxs("div",{className:"space-y-8 pb-32",dir:"rtl",children:[o.jsxs("div",{className:"wm-row-between",children:[o.jsxs("div",{className:"flex items-center gap-5",children:[o.jsx("div",{className:"w-16 h-16 bg-primary-600 rounded-[2rem] flex items-center justify-center text-white shadow-glow-primary shrink-0",children:o.jsx(eg,{size:32})}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("h2",{className:"wm-title-lg",children:"مدیریت هوشمند رسانهها"}),o.jsx("p",{className:"wm-hint font-bold",children:"تحلیل، سئو و بهینهسازی تصاویر محصولات به صورت گروهی"})]})]}),o.jsxs("div",{className:"flex gap-4",children:[o.jsxs("div",{className:"bg-white px-7 py-4 rounded-3xl border border-slate-100 shadow-soft flex flex-col items-center min-w-[130px]",children:[o.jsx("span",{className:"wm-meta mb-1",children:"کل تصاویر"}),o.jsx("span",{className:"text-2xl font-black text-slate-800",children:a.toLocaleString()})]}),o.jsxs("div",{className:"bg-white px-7 py-4 rounded-3xl border border-slate-100 shadow-soft flex flex-col items-center min-w-[130px]",children:[o.jsx("span",{className:"wm-meta mb-1 text-primary-600/60",children:"نمایش فعلی"}),o.jsx("span",{className:"text-2xl font-black text-primary-600",children:n.length})]})]})]}),o.jsx("section",{className:"bg-white shadow-premium rounded-[2.5rem] p-6 border border-slate-100/60 sticky top-24 z-40",children:o.jsxs("div",{className:"flex flex-wrap items-center gap-5",children:[o.jsxs("div",{className:"flex-1 min-w-[320px] relative group",children:[o.jsx(Ia,{className:"absolute right-6 top-1/2 -translate-y-1/2 text-slate-400 z-10",size:20}),o.jsx("input",{type:"text",value:x,onChange:N=>C(N.target.value),onKeyDown:N=>N.key==="Enter"&&ne(),placeholder:"جستجوی در تصاویر (نام محصول یا شناسه)...",className:"wm-input !h-16 !pr-16 !pl-16 bg-slate-50/50 border-transparent focus:bg-white"}),o.jsx("button",{onClick:ne,className:"absolute left-1.5 top-1.5 bottom-1.5 w-11 bg-primary-600 text-white rounded-xl shadow-glow-primary transition-transform hover:scale-105 active:scale-95 flex items-center justify-center z-10",children:i?o.jsx(ur,{className:"animate-spin",size:18}):o.jsx(Ia,{size:18})})]}),o.jsx("div",{className:"w-full md:w-72",children:o.jsxs("select",{value:E,onChange:N=>M(N.target.value),className:"wm-select !h-16 bg-slate-50/50 border-transparent focus:bg-white",children:[o.jsx("option",{value:"",children:"همه دستهبندیها"}),j.map(N=>o.jsx("option",{value:N.slug,children:N.name},N.id))]})}),o.jsxs("div",{className:"flex gap-2 bg-slate-100/50 p-2 rounded-2xl self-stretch",children:[o.jsxs("button",{onClick:()=>{z(!D),V(!1)},className:`px-6 flex items-center gap-3 rounded-xl text-[12px] font-black transition-all ${D?"bg-rose-500 text-white shadow-lg shadow-rose-500/20":"text-slate-400 hover:bg-white hover:text-slate-600"}`,children:[o.jsx(r2,{size:14})," فاقد متن Alt"]}),o.jsxs("button",{onClick:()=>{V(!H),z(!1),ce(!1)},className:`px-6 flex items-center gap-3 rounded-xl text-[12px] font-black transition-all ${H?"bg-rose-600 text-white shadow-lg shadow-rose-600/20":"text-slate-400 hover:bg-white hover:text-slate-600"}`,children:[o.jsx(eg,{size:14})," فاقد تصویر"]}),o.jsxs("button",{onClick:()=>{ce(!ve),V(!1)},className:`px-6 flex items-center gap-3 rounded-xl text-[12px] font-black transition-all ${ve?"bg-amber-500 text-white shadow-lg shadow-amber-500/20":"text-slate-400 hover:bg-white hover:text-slate-600"}`,children:[o.jsx(tg,{size:14})," غیرمربعی"]})]}),o.jsxs("div",{className:"flex gap-3 ml-auto",children:[o.jsx("button",{onClick:ne,className:"h-16 w-16 bg-slate-50 border border-slate-100 rounded-2xl flex items-center justify-center text-slate-400 hover:text-primary-600 hover:bg-white hover:border-primary-500/30 transition-all shadow-sm active:scale-95",children:o.jsx(ur,{className:i?"animate-spin":"",size:20})}),o.jsxs("button",{onClick:we,disabled:Object.keys($e).length===0||Ze,className:"h-16 px-10 bg-emerald-600 text-white rounded-2xl font-black text-sm hover:bg-emerald-700 transition-all shadow-glow-primary active:scale-95 disabled:opacity-50 disabled:active:scale-100 flex items-center gap-3",children:[o.jsx(Hr,{size:18}),"ذخیره ",Object.keys($e).length," تغییر نهایی"]})]})]})}),o.jsxs("section",{className:"bg-white rounded-[2.5rem] shadow-premium border border-slate-100 overflow-hidden",children:[o.jsxs("div",{className:"p-8 border-b border-slate-50 flex items-center justify-between bg-slate-50/50 backdrop-blur-sm",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-2 h-7 bg-primary-600 rounded-full shadow-glow-primary"}),o.jsx("h3",{className:"wm-title-md",children:H?"محصولات فاقد تصویر":"فهرست رسانهها"})]}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-32",children:o.jsx("select",{value:g,onChange:N=>{y(Number(N.target.value)),m(1)},className:"wm-select h-14 bg-white",children:[25,50,100,200].map(N=>o.jsxs("option",{value:N,children:[N," ردیف"]},N))})}),Object.keys($e).length>0&&o.jsx("span",{className:"text-[11px] font-black text-amber-600 bg-amber-50 px-4 py-2 rounded-xl border border-amber-100 animate-pulse",children:"منتظر ذخیره نهایی..."})]})]}),o.jsxs("div",{className:"relative min-h-[500px]",children:[o.jsx(tr,{children:i&&o.jsxs(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 z-50 bg-white/60 backdrop-blur-sm flex flex-col items-center justify-center",children:[o.jsx("div",{className:"w-16 h-16 border-4 border-primary-500/20 border-t-primary-500 rounded-full animate-spin mb-4"}),o.jsx("p",{className:"font-black text-slate-600 animate-pulse",children:"درحال تحلیل دیتابیس تصاویر..."})]})}),o.jsx("div",{className:"overflow-auto relative max-h-[70vh] border-b border-slate-100",children:o.jsxs("table",{className:"w-full text-right border-collapse",children:[o.jsx("thead",{className:"sticky top-0 z-20 bg-slate-50 shadow-sm border-b border-slate-100 backdrop-blur-sm",children:_.getHeaderGroups().map(N=>o.jsx("tr",{children:N.headers.map(O=>o.jsx("th",{className:"bg-slate-50/80 px-6 py-6 border-b border-slate-100",children:o.jsx("span",{className:"wm-meta !text-slate-500",children:mg(O.column.columnDef.header,O.getContext())})},O.id))},N.id))}),o.jsx("tbody",{className:"divide-y divide-slate-100/50",children:n.length===0&&!i?o.jsx("tr",{children:o.jsx("td",{colSpan:100,className:"py-32 text-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-4 opacity-30",children:[H?o.jsx(zU,{size:64}):o.jsx(eg,{size:64}),o.jsx("span",{className:"font-black text-lg",children:H?"همه محصولات تصویر دارند!":"تصویری یافت نشد"})]})})}):_.getRowModel().rows.map(N=>o.jsx("tr",{className:`transition-all hover:bg-slate-50/70 ${_e.includes(N.original.id)?"bg-primary-50/30":""}`,children:N.getVisibleCells().map(O=>o.jsx("td",{className:"px-6 py-4 align-middle",children:mg(O.column.columnDef.cell,O.getContext())},O.id))},N.id))})]})}),o.jsxs("div",{className:"p-8 bg-slate-50/50 border-t border-slate-100 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-6",children:[o.jsx("div",{className:"flex items-center gap-3 bg-white px-4 py-2.5 rounded-2xl border border-slate-200 shadow-sm",children:o.jsxs("span",{className:"text-[11px] font-black text-slate-400",children:["نمایش ",n.length," مورد از ",a]})}),o.jsx("div",{className:"w-28",children:o.jsx("select",{value:g,onChange:N=>{y(Number(N.target.value)),m(1)},className:"wm-select h-12 !text-[11px]",children:[25,50,100,200].map(N=>o.jsxs("option",{value:N,children:[N," ردیف"]},N))})}),_e.length>0&&!H&&o.jsxs("div",{className:"flex items-center gap-2 bg-primary-600 text-white px-5 py-2.5 rounded-2xl shadow-glow-primary font-black text-[11px]",children:[o.jsx(ho,{size:14}),_e.length," مورد انتخاب شده"]})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("button",{disabled:h===1,onClick:()=>m(N=>N-1),className:"w-14 h-14 bg-white border border-slate-200 rounded-2xl flex items-center justify-center text-slate-600 hover:text-primary-600 hover:border-primary-500/30 transition-all disabled:opacity-20 active:scale-95",children:o.jsx(f0,{size:24})}),o.jsxs("div",{className:"h-14 px-8 bg-white border-2 border-primary-100 flex items-center justify-center rounded-2xl font-black text-primary-600 shadow-inner",children:["صفحه ",h]}),o.jsx("button",{disabled:n.length<g,onClick:()=>m(N=>N+1),className:"w-14 h-14 bg-white border border-slate-200 rounded-2xl flex items-center justify-center text-slate-600 hover:text-primary-600 hover:border-primary-500/30 transition-all disabled:opacity-20 active:scale-95",children:o.jsx(N1,{size:24})})]})]})]})]}),o.jsx(tr,{children:_e.length>0&&!H&&o.jsx(ht.div,{initial:{y:50,opacity:0},animate:{y:0,opacity:1},exit:{y:50,opacity:0},className:"fixed bottom-12 inset-x-0 flex justify-center z-[500] px-4 md:px-8 pointer-events-none",children:o.jsxs("div",{className:"w-full max-w-5xl bg-slate-900/95 backdrop-blur-2xl rounded-[3rem] p-4 shadow-premium border border-white/10 flex items-center gap-6 pointer-events-auto",children:[o.jsx("div",{className:"w-14 h-14 bg-primary-500 rounded-[1.5rem] flex items-center justify-center text-white shrink-0 shadow-lg",children:o.jsx(Jc,{size:24})}),o.jsxs("div",{className:"flex flex-col gap-1 flex-1",children:[o.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest px-2",children:"الگوی هوشمند سئو"}),o.jsx("div",{className:"flex-1 relative group",children:o.jsx("input",{type:"text",value:Le,onChange:N=>Fe(N.target.value),className:"w-full bg-white/5 border border-white/10 rounded-2xl h-12 px-6 text-white font-bold text-xs outline-none focus:ring-4 focus:ring-primary-500/20 focus:border-primary-500 transition-all",placeholder:"مثلاً: خرید {product_name} با بهترین قیمت"})})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("button",{onClick:qe,disabled:nt,className:"h-16 px-10 bg-primary-600 text-white rounded-[2rem] font-black text-sm hover:bg-white hover:text-primary-600 transition-all flex items-center gap-3 active:scale-95 disabled:opacity-50 shadow-glow-primary",children:[o.jsx(Hr,{size:20,className:nt?"animate-pulse":""}),o.jsx("span",{children:nt?"درحال اجرا...":`اعمال روی ${_e.length} مورد`})]}),o.jsx("button",{onClick:()=>pe([]),className:"w-16 h-16 bg-white/5 text-slate-400 hover:text-rose-400 hover:bg-rose-500/10 rounded-[2rem] flex items-center justify-center transition-all border border-white/5",children:o.jsx(ur,{size:20,className:"rotate-45"})})]})]})})}),o.jsx(tr,{children:Q&&o.jsxs("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center p-4 md:p-10",children:[o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>fe(null),className:"absolute inset-0 bg-slate-900/95 backdrop-blur-md"}),o.jsxs(ht.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"relative bg-white w-full max-w-6xl rounded-[3.5rem] overflow-hidden shadow-2xl flex flex-col md:flex-row h-full max-h-[90vh] dir-rtl",children:[o.jsxs("div",{className:"flex-1 bg-slate-50 flex items-center justify-center p-12 overflow-hidden relative",children:[Q.full?o.jsx("img",{src:Q.full,className:"max-w-full max-h-full object-contain shadow-2xl rounded-2xl",alt:""}):o.jsxs("div",{className:"flex flex-col items-center gap-4 text-slate-300",children:[o.jsx(eg,{size:64}),o.jsx("span",{className:"font-black",children:"تصویر بزرگ یافت نشد"})]}),o.jsx("div",{className:"absolute top-8 left-8 flex gap-2",children:o.jsxs("div",{className:"bg-white/80 backdrop-blur px-4 py-2 rounded-xl text-[10px] font-black shadow-sm",children:[Q.width," × ",Q.height," px"]})})]}),o.jsxs("div",{className:"w-full md:w-[400px] p-10 flex flex-col gap-8 overflow-y-auto bg-white border-r border-slate-100",dir:"rtl",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex justify-between items-start",children:[o.jsxs("div",{className:"max-w-[80%]",children:[o.jsx("h3",{className:"text-2xl font-black text-slate-900 leading-tight",children:Q.parent_product||"بدون محصول"}),o.jsxs("p",{className:"text-xs text-slate-400 font-bold mt-2",children:["شناسه رسانه: #",Q.id]})]}),o.jsx("button",{onClick:()=>fe(null),className:"w-12 h-12 bg-slate-50 text-slate-400 hover:text-rose-500 rounded-2xl flex items-center justify-center transition-all",children:o.jsx(ur,{className:"rotate-45",size:24})})]}),o.jsxs("div",{className:"p-6 bg-slate-50 rounded-[2rem] space-y-4",children:[o.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-200 pb-2",children:"مشخصات فنی فایل"}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex justify-between items-center text-xs",children:[o.jsx("span",{className:"font-bold text-slate-500",children:"نام فایل:"}),o.jsx("span",{className:"font-mono text-slate-400",children:Q.filename})]}),o.jsxs("div",{className:"flex justify-between items-center text-xs",children:[o.jsx("span",{className:"font-bold text-slate-500",children:"حجم اشغالی:"}),o.jsx("span",{className:`font-black ${Q.size_raw>400?"text-rose-500":"text-primary-600"}`,children:Q.size})]}),o.jsxs("div",{className:"flex justify-between items-center text-xs",children:[o.jsx("span",{className:"font-bold text-slate-500",children:"تاریخ آپلود:"}),o.jsx("span",{className:"text-slate-400",children:new Date(Q.date).toLocaleDateString("fa-IR")})]})]})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("a",{href:Q.edit_link,target:"_blank",rel:"noreferrer",className:"w-full h-14 bg-primary-50 text-primary-600 rounded-2xl flex items-center justify-center gap-2 font-black text-sm hover:bg-primary-100 transition-all border border-primary-100",children:[o.jsx($u,{size:18}),"ویرایش در کتابخانه وردپرس"]}),o.jsxs("label",{className:"w-full h-14 bg-slate-900 text-white rounded-2xl flex items-center justify-center gap-2 font-black text-sm hover:bg-slate-800 transition-all cursor-pointer",children:[o.jsx(ur,{size:18}),"جایگزینی فایل تصویر",o.jsx("input",{type:"file",className:"hidden",accept:"image/*",onChange:N=>{var O;(O=N.target.files)!=null&&O[0]&&Q&&(Ke(Q.id,N.target.files[0],Q.parent_id),fe(null))}})]})]}),o.jsxs("div",{className:"mt-auto p-8 bg-amber-50 rounded-[2.5rem] border border-amber-100/50 relative overflow-hidden group",children:[o.jsx(Jc,{className:"absolute -right-4 -top-4 w-24 h-24 text-amber-200/30 group-hover:scale-110 transition-transform"}),o.jsxs("h4",{className:"text-xs font-black text-amber-900 mb-2 flex items-center gap-2",children:[o.jsx(Jc,{size:16})," پیشنهاد سئو"]}),o.jsxs("p",{className:"text-[11px] text-amber-800/70 leading-relaxed font-bold",children:["برای این محصول، متن جایگزین پیشنهادی ما: ",o.jsx("br",{}),o.jsxs("span",{className:"text-amber-900 block mt-1",children:['"',Q.parent_product||"محصول",' - خرید با قیمت مناسب"']}),"است."]})]})]})]})]})})]})},CY=[{id:"name",label:"نام محصول",type:"text"},{id:"sku",label:"SKU",type:"text"},{id:"regular_price",label:"قیمت عادی",type:"number"},{id:"sale_price",label:"قیمت ویژه",type:"number"},{id:"stock",label:"موجودی",type:"number"},{id:"stock_status",label:"وضعیت موجودی",type:"select"},{id:"category",label:"دستهبندی",type:"select"},{id:"brand",label:"برند",type:"select"},{id:"type",label:"نوع محصول",type:"select"},{id:"id",label:"شناسه (ID)",type:"number"}],SY={text:[{label:"برابر با",value:"="},{label:"شامل میشود",value:"contains"},{label:"شامل نمیشود",value:"!="}],number:[{label:"برابر با",value:"="},{label:"بزرگتر از",value:">"},{label:"کوچکتر از",value:"<"},{label:"بزرگتر یا مساوی",value:">="},{label:"کوچکتر یا مساوی",value:"<="}],select:[{label:"برابر با",value:"="},{label:"نامساوی",value:"!="}]},lme=({onApply:t,onClose:e})=>{const[n,r]=W.useState([{id:"1",field:"name",operator:"contains",value:""}]),[i,s]=W.useState([]),[a,u]=W.useState(""),[h,m]=W.useState([]),[g,y]=W.useState([]),[x,C]=W.useState(!1);W.useEffect(()=>{E(),M(),j()},[]);const E=async()=>{try{const te=await(await fetch(`${window.woocommersa_data.apiUrl}/smart-filters`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();s(te)}catch{console.error("Error fetching filters")}},M=async()=>{try{const te=await(await fetch(`${window.woocommersa_data.apiUrl}/categories`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();te.success&&Array.isArray(te.data)?m(te.data):Array.isArray(te)?m(te):m([])}catch{console.error("Error fetching categories"),m([])}},j=async()=>{try{const te=await(await fetch(`${window.woocommersa_data.apiUrl}/products/brands`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();te.success&&Array.isArray(te.data)?y(te.data):Array.isArray(te)&&y(te)}catch{console.error("Error fetching brands")}},L=()=>{r([...n,{id:Date.now().toString(),field:"name",operator:"contains",value:""}])},D=B=>{n.length>1&&r(n.filter(te=>te.id!==B))},z=(B,te)=>{r(n.map(ve=>ve.id===B?{...ve,...te}:ve))},H=async()=>{if(!a)return ze.error("نام فیلتر را وارد کنید");try{(await fetch(`${window.woocommersa_data.apiUrl}/smart-filters`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({name:a,rules:n})})).ok&&(ze.success("فیلتر ذخیره شد"),C(!1),u(""),E())}catch{ze.error("خطا در ذخیرهسازی")}},V=async B=>{try{(await fetch(`${window.woocommersa_data.apiUrl}/smart-filters/${B}`,{method:"DELETE",headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).ok&&(ze.success("فیلتر حذف شد"),E())}catch{ze.error("خطا در حذف")}},F=B=>{var te;return((te=CY.find(ve=>ve.id===B))==null?void 0:te.type)||"text"};return o.jsxs("div",{className:"bg-white/90 backdrop-blur-2xl rounded-[3rem] border border-white shadow-premium overflow-hidden flex flex-col max-h-[85vh] transition-all",children:[o.jsxs("div",{className:"p-8 bg-slate-50/80 backdrop-blur-sm border-b border-slate-100 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-5",children:[o.jsx("div",{className:"w-14 h-14 rounded-2xl bg-primary-600 flex items-center justify-center text-white shadow-glow-primary",children:o.jsx(Rx,{size:24})}),o.jsxs("div",{children:[o.jsx("h3",{className:"wm-title-lg mb-1",children:"فیلتر هوشمند محصولات"}),o.jsx("p",{className:"text-slate-400 text-[11px] font-bold",children:"ترکیب قوانین مختلف برای دسترسی به دقیقترین لیست محصولات"})]})]}),o.jsx("button",{onClick:e,className:"w-12 h-12 flex items-center justify-center hover:bg-rose-50 hover:text-rose-500 rounded-2xl text-slate-400 transition-all active:scale-95",children:o.jsx(qi,{size:24})})]}),o.jsxs("div",{className:"flex-1 overflow-auto p-8 space-y-6",children:[i.length>0&&o.jsxs("div",{className:"space-y-4",children:[o.jsx("label",{className:"wm-meta px-2",children:"فیلترهای ذخیره شده اخیر"}),o.jsx("div",{className:"flex flex-wrap gap-3",children:i.map(B=>o.jsxs("div",{className:"group flex items-center gap-2 bg-white border border-slate-200 hover:border-primary-500/40 hover:shadow-soft rounded-2xl px-4 py-3 transition-all cursor-pointer",children:[o.jsx("span",{onClick:()=>{r(B.rules),t(B.rules)},className:"text-[13px] font-black text-slate-700 group-hover:text-primary-600",children:B.name}),o.jsx("button",{onClick:()=>V(B.id),className:"p-1 text-slate-300 hover:text-rose-500 transition-colors opacity-0 group-hover:opacity-100",children:o.jsx(zu,{size:16})})]},B.id))})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("label",{className:"text-[11px] font-black text-slate-400 uppercase tracking-wider",children:"قوانین فیلتر"}),o.jsx(tr,{children:n.map((B,te)=>{const ve=F(B.field);return o.jsxs(ht.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,scale:.95},className:"flex items-center gap-4 bg-slate-50 p-4 rounded-2xl border border-slate-100 group",children:[o.jsx("div",{className:"w-10 h-10 shrink-0 rounded-full bg-white border border-slate-200 flex items-center justify-center text-[11px] font-black text-slate-400 shadow-sm",children:te+1}),o.jsx("div",{className:"relative flex-1",children:o.jsx("select",{value:B.field,onChange:ce=>z(B.id,{field:ce.target.value,operator:SY[F(ce.target.value)][0].value,value:""}),className:"wm-select w-full",children:CY.map(ce=>o.jsx("option",{value:ce.id,children:ce.label},ce.id))})}),o.jsx("div",{className:"relative min-w-[150px] flex-1",children:o.jsx("select",{value:B.operator,onChange:ce=>z(B.id,{operator:ce.target.value}),className:"wm-select w-full",children:SY[ve].map(ce=>o.jsx("option",{value:ce.value,children:ce.label},ce.value))})}),B.field==="category"?o.jsx("div",{className:"relative flex-[2]",children:o.jsxs("select",{value:B.value,onChange:ce=>z(B.id,{value:ce.target.value}),className:"wm-select w-full",children:[o.jsx("option",{value:"",children:"انتخاب دستهبندی..."}),h.map(ce=>o.jsx("option",{value:ce.id,children:ce.name},ce.id))]})}):B.field==="brand"?o.jsx("div",{className:"relative flex-[2]",children:o.jsxs("select",{value:B.value,onChange:ce=>z(B.id,{value:ce.target.value}),className:"wm-select w-full",children:[o.jsx("option",{value:"",children:"انتخاب برند..."}),g.map(ce=>o.jsx("option",{value:ce.id,children:ce.name},ce.id))]})}):B.field==="stock_status"?o.jsxs("div",{className:"relative flex-[2]",children:[o.jsxs("select",{value:B.value,onChange:ce=>z(B.id,{value:ce.target.value}),className:"wm-select w-full",children:[o.jsx("option",{value:"",children:"انتخاب وضعیت..."}),o.jsx("option",{value:"instock",children:"موجود در انبار"}),o.jsx("option",{value:"outofstock",children:"ناموجود"}),o.jsx("option",{value:"onbackorder",children:"پیشخرید"})]}),o.jsx(Xp,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300 pointer-events-none",size:16})]}):B.field==="type"?o.jsxs("div",{className:"relative flex-[2]",children:[o.jsxs("select",{value:B.value,onChange:ce=>z(B.id,{value:ce.target.value}),className:"wm-select w-full",children:[o.jsx("option",{value:"",children:"انتخاب نوع..."}),o.jsx("option",{value:"simple",children:"محصول ساده"}),o.jsx("option",{value:"variable",children:"محصول متغیر"}),o.jsx("option",{value:"grouped",children:"محصول گروهبندی شده"}),o.jsx("option",{value:"external",children:"محصول خارجی"})]}),o.jsx(Xp,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300 pointer-events-none",size:16})]}):o.jsx("input",{type:ve==="number"?"number":"text",value:B.value,onChange:ce=>z(B.id,{value:ce.target.value}),placeholder:"مقدار مورد نظر...",className:"wm-input flex-[2]"}),o.jsx("button",{onClick:()=>D(B.id),className:"p-2 text-slate-300 hover:text-rose-500 transition-colors",children:o.jsx(qi,{size:18})})]},B.id)})})]}),o.jsxs("button",{onClick:L,className:"flex items-center gap-2 text-primary-600 font-black text-xs hover:gap-3 transition-all",children:[o.jsx(m0,{size:16})," افزودن قانون جدید"]})]}),o.jsxs("div",{className:"p-8 bg-slate-50/80 border-t border-slate-100 flex items-center justify-between",children:[o.jsxs("button",{onClick:()=>C(!0),className:"flex items-center gap-3 text-slate-500 hover:text-primary-600 font-black text-[13px] transition-all group",children:[o.jsx("div",{className:"w-10 h-10 bg-white border border-slate-200 rounded-xl flex items-center justify-center group-hover:border-primary-200 group-hover:bg-primary-50 transition-all",children:o.jsx(Ak,{size:18})}),"ذخیره این فیلتر برای مراجعات بعدی"]}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("button",{onClick:e,className:"px-8 py-4 font-black text-slate-500 hover:text-slate-800 transition-colors",children:"انصراف"}),o.jsx("button",{onClick:()=>t(n),className:"wm-btn-primary h-14 px-12",children:"اعمال فیلترها"})]})]}),o.jsx(tr,{children:x&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 z-50 bg-white/60 backdrop-blur-sm p-8 flex items-center justify-center",children:o.jsxs(ht.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},className:"bg-white rounded-3xl border border-slate-200 shadow-2xl p-6 w-full max-w-sm space-y-4",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("h4",{className:"text-slate-900 font-black text-base",children:"نام فیلتر را وارد کنید"}),o.jsx("p",{className:"text-slate-400 text-xs",children:"تا بتوانید در مراجعات بعدی سریعتر به آن دسترسی داشته باشید."})]}),o.jsx("input",{autoFocus:!0,type:"text",value:a,onChange:B=>u(B.target.value),placeholder:"مثلاً: محصولات بدون موجودی",className:"w-full bg-slate-50 border border-slate-200 rounded-xl px-4 py-3 text-sm font-bold outline-none focus:ring-4 focus:ring-primary-500/10 focus:border-primary-500 transition-all"}),o.jsxs("div",{className:"flex gap-3",children:[o.jsx("button",{onClick:()=>C(!1),className:"flex-1 py-3 text-slate-500 font-bold hover:bg-slate-50 rounded-xl transition-colors",children:"انصراف"}),o.jsx("button",{onClick:H,className:"flex-1 py-3 bg-primary-600 text-white font-black rounded-xl hover:bg-primary-700 shadow-lg shadow-primary-500/20 transition-all",children:"تایید و ذخیره"})]})]})})})]})},bg=rT(),cme=({value:t,row:e,column:n,updateData:r,options:i})=>{const[s,a]=W.useState(t),[u,h]=W.useState(!1),m=W.useRef(null);W.useEffect(()=>{a(t)},[t]),W.useEffect(()=>{u&&m.current&&(m.current.focus(),m.current.select&&m.current.select())},[u]);const g=()=>{h(!1),s!==t&&r(e.original.id,n.id,s)};return u?i?o.jsx("select",{ref:m,value:s,onChange:y=>a(y.target.value),onBlur:g,className:"w-full px-2 py-1 text-sm border-2 border-primary-500 rounded-xl outline-none bg-white shadow-xl z-50 relative",children:Object.entries(i).map(([y,x])=>o.jsx("option",{value:y.replace("wc-",""),children:x},y))}):o.jsx("input",{ref:m,type:"text",value:s,onChange:y=>a(y.target.value),onBlur:g,onKeyDown:y=>{y.key==="Enter"&&g(),y.key==="Escape"&&(a(t),h(!1))},className:"w-full px-3 py-1.5 text-sm border-2 border-primary-500 rounded-xl outline-none bg-white shadow-lg z-50 relative"}):o.jsx("div",{onClick:()=>h(!0),className:"cursor-pointer min-h-[2.5rem] w-full px-3 py-2 transition-all hover:bg-slate-100/50 rounded-xl flex items-center justify-start group",children:o.jsx("div",{className:"truncate w-full text-right font-medium text-slate-700",title:s,children:n.id==="status"?o.jsx("span",{className:`inline-flex items-center justify-center px-3 py-1.5 rounded-full text-[11px] border shadow-sm font-black uppercase tracking-tight leading-none ${Khe(s)}`,children:Ghe(s)}):s||o.jsx("span",{className:"text-slate-300 italic text-xs",children:"خالی..."})})})},ume=({data:t,updateData:e,onSelectionChange:n,statuses:r,onViewDetail:i})=>{const[s,a]=W.useState([]),[u,h]=W.useState({});W.useEffect(()=>{if(n){const y=Object.keys(u).map(x=>{var E;const C=parseInt(x);return(E=t[C])==null?void 0:E.id}).filter(Boolean);n(y)}},[u,t,n]);const m=W.useMemo(()=>[bg.display({id:"select",header:({table:y})=>o.jsx("div",{className:"flex items-center justify-center",children:o.jsxs("label",{className:"wm-checkbox-wrapper",onClick:x=>x.stopPropagation(),children:[o.jsx("input",{type:"checkbox",className:"wm-checkbox",checked:y.getIsAllRowsSelected(),onChange:y.getToggleAllRowsSelectedHandler()}),o.jsx("div",{className:"wm-checkbox-inner"})]})}),cell:({row:y})=>o.jsx("div",{className:"flex items-center justify-center",children:o.jsxs("label",{className:"wm-checkbox-wrapper",onClick:x=>x.stopPropagation(),children:[o.jsx("input",{type:"checkbox",className:"wm-checkbox",checked:y.getIsSelected(),onChange:y.getToggleSelectedHandler()}),o.jsx("div",{className:"wm-checkbox-inner"})]})})}),bg.accessor("order_number",{id:"order_number",header:()=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Mk,{size:14})," شماره"]}),cell:y=>o.jsxs("span",{className:"font-black text-slate-900 bg-slate-100 px-2 py-1 rounded-lg",children:["#",y.getValue()]})}),bg.accessor("date",{id:"date",header:()=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ll,{size:14})," تاریخ"]}),cell:y=>o.jsx("span",{className:"text-slate-500 text-[13px] font-bold whitespace-nowrap",children:Yhe(y.getValue())})}),bg.accessor("customer",{id:"customer",header:()=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(p0,{size:14})," مشتری"]}),cell:y=>o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"font-black text-slate-800 text-sm whitespace-nowrap",children:y.getValue().name}),o.jsx("span",{className:"text-[11px] text-slate-400 font-bold",children:y.getValue().phone||y.getValue().email})]})}),bg.accessor("status",{id:"status",header:()=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(qs,{size:14})," وضعیت"]}),cell:y=>o.jsx(cme,{...y,value:y.getValue(),options:r,updateData:e})}),bg.accessor("total",{id:"total",header:()=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Zp,{size:14})," مبلغ"]}),cell:y=>o.jsx("span",{className:"font-black text-emerald-600 whitespace-nowrap text-base",children:Xo(y.getValue())})}),bg.accessor("items_count",{id:"items_count",header:()=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(bc,{size:14})," اقلام"]}),cell:y=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"w-7 h-7 bg-slate-100 text-slate-600 rounded-lg flex items-center justify-center text-[11px] font-black",children:y.getValue()}),o.jsx("span",{className:"text-[12px] font-bold text-slate-400",children:"قلم کالا"})]})}),bg.display({id:"actions",header:"عملیات",cell:({row:y})=>o.jsx("div",{className:"flex items-center gap-1",children:o.jsx("button",{onClick:()=>i(y.original),className:"p-2.5 hover:bg-primary-50 rounded-xl text-slate-400 hover:text-primary-600 transition-all flex items-center justify-center",title:"نمایش جزئیات",children:o.jsx($u,{size:18})})})})],[r,e,i]),g=cT({data:t,columns:m,state:{sorting:s,rowSelection:u},onSortingChange:a,onRowSelectionChange:h,getCoreRowModel:lT(),getSortedRowModel:TH(),enableRowSelection:!0});return o.jsx("div",{className:"overflow-auto relative max-h-[70vh] border border-slate-100 rounded-xl",children:o.jsxs("table",{className:"w-full border-collapse wm-sticky-table",children:[o.jsx("thead",{className:"bg-slate-50 sticky top-0 z-20 backdrop-blur-sm shadow-sm",children:g.getHeaderGroups().map(y=>o.jsx("tr",{children:y.headers.map(x=>o.jsx("th",{style:{width:x.id==="select"?"60px":"auto"},className:`px-6 py-4 text-right text-[12px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-100 bg-slate-50/50 transition-colors ${x.column.getCanSort()?"cursor-pointer hover:bg-slate-100":""}`,onClick:x.column.getToggleSortingHandler(),children:o.jsxs("div",{className:"flex items-center gap-2",children:[x.isPlaceholder?null:mg(x.column.columnDef.header,x.getContext()),x.column.getCanSort()&&o.jsx("div",{className:"text-slate-400",children:x.column.getIsSorted()==="asc"?o.jsx(YD,{size:14}):x.column.getIsSorted()==="desc"?o.jsx(UD,{size:14}):o.jsx(jU,{size:14,className:"opacity-0 group-hover:opacity-100"})})]})},x.id))},y.id))}),o.jsx("tbody",{className:"divide-y divide-slate-100",children:o.jsx(tr,{children:g.getRowModel().rows.map(y=>o.jsx(ht.tr,{initial:{opacity:0},animate:{opacity:1},className:`group hover:bg-slate-50/50 transition-colors ${y.getIsSelected()?"bg-primary-50/30":""}`,children:y.getVisibleCells().map(x=>o.jsx("td",{className:"px-6 py-4",children:mg(x.column.columnDef.cell,x.getContext())},x.id))},y.id))})})]})})},dme=()=>{const[t,e]=W.useState([]),[n,r]=W.useState({}),[i,s]=W.useState(!0),[a,u]=W.useState(""),[h,m]=W.useState(""),[g,y]=W.useState(null),[x,C]=W.useState(1),[E,M]=W.useState(1),[j,L]=W.useState(0),[D,z]=W.useState(25),[H,V]=W.useState([]),[F,B]=W.useState(null),[te,ve]=W.useState({today_count:0,today_revenue:0,pending_count:0}),[ce,_e]=W.useState(!1),[pe,Le]=W.useState("all"),[Fe,nt]=W.useState(""),[dt,$e]=W.useState(""),[Re,Ze]=W.useState(null),[Ee,Q]=W.useState(null),fe=async()=>{s(!0);try{const we=new URLSearchParams({page:String(x),status:h,search:a,per_page:String(D)});g&&Array.isArray(g)&&g.length===2&&g[0]&&g[1]&&(we.append("date_from",g[0].toDate().toLocaleDateString("en-CA")),we.append("date_to",g[1].toDate().toLocaleDateString("en-CA")));const _=await(await fetch(`${window.woocommersa_data.apiUrl}/orders?${we}`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();e(Array.isArray(_.orders)?_.orders:[]),L(_.total||0),M(_.pages||1),_.summary&&ve(_.summary)}catch{ze.error("خطا در دریافت سفارشها")}finally{s(!1)}},Ve=async()=>{try{const k=await(await fetch(`${window.woocommersa_data.apiUrl}/abandoned-carts/stats`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();k.success&&Q(k.data)}catch(we){console.error(we)}},ne=async()=>{try{const k=await(await fetch(`${window.woocommersa_data.apiUrl}/order-statuses`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();r(k)}catch(we){console.error(we)}};W.useEffect(()=>{ne(),Ve()},[]),W.useEffect(()=>{fe()},[x,h,g,D]);const xe=async(we,k,_)=>{try{(await fetch(`${window.woocommersa_data.apiUrl}/orders/update`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({id:we,field:k,value:_})})).ok&&(e(O=>O.map(G=>G.id===we?{...G,[k]:_}:G)),ze.success("سفارش بروزرسانی شد",{id:`upd-${we}`}))}catch{ze.error("خطا در بروزرسانی")}},Ke=async we=>{if(H.length!==0&&window.confirm(`آیا از تغییر وضعیت ${H.length} سفارش به "${n[`wc-${we}`]}" مطمئن هستید؟`)){ze.loading("در حال بروزرسانی گروهی...",{id:"bulk-orders"});try{for(const k of H)await fetch(`${window.woocommersa_data.apiUrl}/orders/update`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({id:k,field:"status",value:we})});ze.success("بروزرسانی گروهی با موفقیت انجام شد",{id:"bulk-orders"}),fe()}catch{ze.error("خطا در بروزرسانی گروهی",{id:"bulk-orders"})}}},qe=async()=>{ze.loading("در حال تهیه خروجی...",{id:"export-orders"});try{const we=new URLSearchParams({per_page:"-1"});pe==="custom"&&(dt&&we.append("status",dt),Fe&&we.append("search",Fe),Re&&Array.isArray(Re)&&Re.length===2&&Re[0]&&Re[1]&&(we.append("date_from",Re[0].toDate().toLocaleDateString("en-CA")),we.append("date_to",Re[1].toDate().toLocaleDateString("en-CA"))));const N=(await(await fetch(`${window.woocommersa_data.apiUrl}/orders?${we}`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json()).orders||[];if(N.length===0){ze.error("هیچ سفارشی با این فیلترها یافت نشد!",{id:"export-orders"});return}const G=[["Order ID","Date","Customer","Status","Total","Payment","Shipping","Tracking","Items"].join(","),...N.map(U=>[U.order_number,U.date,`"${U.customer}"`,U.status,U.total,`"${U.payment_method}"`,`"${U.shipping_method}"`,`"${U.tracking_code}"`,`"${U.items}"`].join(","))].join(` `),q=new Blob(["\uFEFF"+G],{type:"text/csv;charset=utf-8;"}),I=URL.createObjectURL(q),Z=document.createElement("a");Z.setAttribute("href",I),Z.setAttribute("download",`orders-export-${new Date().toISOString().split("T")[0]}.csv`),Z.click(),ze.success("خروجی با موفقیت تهیه شد",{id:"export-orders"}),_e(!1)}catch{ze.error("خطا در تهیه خروجی",{id:"export-orders"})}};return o.jsxs("div",{className:"space-y-6 relative",children:[o.jsxs("section",{className:"grid grid-cols-1 md:grid-cols-5 gap-4",children:[o.jsxs("div",{className:"bg-white p-5 rounded-[2rem] border border-white shadow-sm flex items-center gap-4 group hover:shadow-md transition-all",children:[o.jsx("div",{className:"w-12 h-12 bg-primary-50 text-primary-600 flex items-center justify-center rounded-2xl group-hover:scale-110 transition-transform",children:o.jsx(Da,{size:20})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"تعداد سفارشات امروز"}),o.jsx("div",{className:"text-xl font-black text-slate-900",children:te.today_count})]})]}),o.jsxs("div",{className:"bg-white p-5 rounded-[2rem] border border-white shadow-sm flex items-center gap-4 group hover:shadow-md transition-all",children:[o.jsx("div",{className:"w-12 h-12 bg-emerald-50 text-emerald-600 flex items-center justify-center rounded-2xl group-hover:scale-110 transition-transform",children:o.jsx(Zp,{size:20})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"فروش ناخالص امروز"}),o.jsxs("div",{className:"text-xl font-black text-slate-900",children:[te.today_revenue.toLocaleString()," ",o.jsx("span",{className:"text-[10px]",children:"تومان"})]})]})]}),o.jsxs("div",{className:"bg-white p-5 rounded-[2rem] border border-white shadow-sm flex items-center gap-4 group hover:shadow-md transition-all",children:[o.jsx("div",{className:"w-12 h-12 bg-amber-50 text-amber-600 flex items-center justify-center rounded-2xl group-hover:scale-110 transition-transform",children:o.jsx(Qp,{size:20})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"در انتظار بررسی"}),o.jsx("div",{className:"text-xl font-black text-slate-900",children:te.pending_count})]})]}),o.jsxs("div",{className:"bg-white p-5 rounded-[2rem] border border-white shadow-sm flex items-center gap-4 group hover:shadow-md transition-all relative overflow-hidden",children:[o.jsx("div",{className:"absolute top-0 right-0 w-16 h-16 bg-rose-50 rounded-full -mr-8 -mt-8 opacity-50"}),o.jsx("div",{className:"w-12 h-12 bg-rose-100 text-rose-600 flex items-center justify-center rounded-2xl group-hover:scale-110 transition-transform relative z-10",children:o.jsx(bc,{size:20})}),o.jsxs("div",{className:"relative z-10",children:[o.jsxs("div",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest flex items-center gap-1",children:["سبدهای قابل بازیابی",Ee&&Ee.recovery_rate>0&&o.jsxs("span",{className:"bg-green-100 text-green-600 px-1.5 py-0.5 rounded text-[8px]",children:[Ee.recovery_rate,"%"]})]}),o.jsxs("div",{className:"text-xl font-black text-slate-900",children:[(Ee==null?void 0:Ee.abandoned_count)||0," ",o.jsx("span",{className:"text-[10px] text-slate-400 font-bold",children:"مورد"})]})]})]}),o.jsxs("div",{className:"bg-white p-5 rounded-[2rem] border border-white shadow-sm flex items-center gap-4 group hover:shadow-md transition-all border-dashed border-slate-200 opacity-60",children:[o.jsx("div",{className:"w-12 h-12 bg-slate-50 text-slate-400 flex items-center justify-center rounded-2xl",children:o.jsx(ho,{size:20})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"سفارشات نهایی"}),o.jsx("div",{className:"text-xl font-black text-slate-900",children:j})]})]})]}),o.jsxs(tr,{children:[ce&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-slate-900/40 backdrop-blur-sm",children:o.jsxs(ht.div,{initial:{scale:.95,y:20},animate:{scale:1,y:0},exit:{scale:.95,y:20},className:"bg-white rounded-[2rem] p-6 shdaow-2xl w-full max-w-lg border border-white",children:[o.jsxs("div",{className:"flex items-center justify-between mb-6",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-10 h-10 bg-primary-50 text-primary-600 flex items-center justify-center rounded-xl",children:o.jsx(xae,{size:20})}),o.jsx("h3",{className:"font-black text-slate-800 text-lg",children:"خروجی اکسل/CSV سفارشات"})]}),o.jsx("button",{onClick:()=>_e(!1),className:"w-10 h-10 text-slate-400 hover:bg-slate-50 hover:text-slate-600 rounded-xl flex items-center justify-center transition-all",children:o.jsx(qi,{size:20})})]}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex gap-4 p-1 bg-slate-50 rounded-2xl",children:[o.jsx("button",{onClick:()=>Le("all"),className:`flex-1 py-3 text-sm font-bold rounded-xl transition-all ${pe==="all"?"bg-white text-primary-600 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:"کل سفارشات"}),o.jsx("button",{onClick:()=>Le("custom"),className:`flex-1 py-3 text-sm font-bold rounded-xl transition-all ${pe==="custom"?"bg-white text-primary-600 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:"مشخص کردن فیلتر"})]}),o.jsx(tr,{children:pe==="custom"&&o.jsxs(ht.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"space-y-4 overflow-hidden",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-xs font-black text-slate-400",children:"جستجوی مشتری"}),o.jsx("input",{type:"text",placeholder:"نام، ایمیل مشتری خاص یا شناسه...",className:"w-full h-12 bg-white border border-slate-200 rounded-xl px-4 outline-none focus:border-primary-500",value:Fe,onChange:we=>nt(we.target.value)})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-xs font-black text-slate-400",children:"وضعیت خاص"}),o.jsxs("select",{className:"w-full h-12 bg-white border border-slate-200 rounded-xl px-4 outline-none focus:border-primary-500",value:dt,onChange:we=>$e(we.target.value),children:[o.jsx("option",{value:"",children:"همه وضعیتها"}),Object.entries(n).map(([we,k])=>o.jsx("option",{value:we.replace("wc-",""),children:k},we))]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("label",{className:"text-xs font-black text-slate-400",children:"بازه زمانی"}),Re&&o.jsx("button",{onClick:()=>Ze(null),className:"text-[10px] font-bold text-red-500 hover:text-red-600 bg-red-50 px-2 py-0.5 rounded-md transition-colors",children:"حذف فیلتر"})]}),o.jsx(Dh,{value:Re,onChange:Ze,range:!0,calendar:Hh,locale:Lh,inputClass:"w-full h-12 bg-white border border-slate-200 rounded-xl px-4 outline-none focus:border-primary-500 font-bold text-sm",placeholder:"انتخاب بازه سفارشی",containerClassName:"w-full relative z-[110]"})]})]})}),o.jsxs("button",{onClick:qe,className:"w-full h-14 bg-primary-600 text-white font-black rounded-2xl flex items-center justify-center gap-2 hover:bg-primary-700 transition-all shadow-lg shadow-primary-500/20 active:scale-95",children:[o.jsx(om,{size:18}),"دریافت و دانلود فایل اکسل (CSV)"]})]})]})}),F&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[110] flex items-center justify-end p-0 bg-slate-900/40 backdrop-blur-sm",onClick:()=>B(null),children:o.jsxs(ht.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"bg-white h-full w-full max-w-xl shadow-2xl flex flex-col relative",onClick:we=>we.stopPropagation(),children:[o.jsxs("div",{className:"p-8 border-b border-slate-100 flex items-center justify-between bg-slate-50/50",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsxs("h3",{className:"text-2xl font-black text-slate-800 flex items-center gap-3",children:[o.jsx(bc,{className:"text-primary-500"}),"سفارش #",F.order_number]}),o.jsxs("p",{className:"text-xs font-bold text-slate-400 flex items-center gap-2",children:[o.jsx(Qp,{size:14})," ثبت شده در ",F.date]})]}),o.jsx("button",{onClick:()=>B(null),className:"w-12 h-12 bg-white text-slate-400 hover:text-red-500 rounded-2xl flex items-center justify-center transition-all shadow-sm",children:o.jsx(qi,{size:24})})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto p-8 space-y-10 custom-scrollbar",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-100 pb-2",children:"اطلاعات مشتری و ارسال"}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"p-5 rounded-3xl bg-slate-50 border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-slate-800 font-black text-sm",children:[o.jsx(p0,{size:16,className:"text-primary-500"})," ",F.customer.name]}),o.jsxs("div",{className:"flex items-center gap-2 text-slate-500 font-bold text-xs",children:[o.jsx(Rae,{size:14})," ",F.customer.email]}),o.jsxs("div",{className:"flex items-center gap-2 text-slate-500 font-bold text-xs",dir:"ltr",children:[o.jsx(ZD,{size:14})," ",F.customer.phone]})]}),o.jsxs("div",{className:"p-5 rounded-3xl bg-slate-50 border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-slate-800 font-black text-sm",children:[o.jsx(_ae,{size:16,className:"text-primary-500"})," آدرس ارسال"]}),o.jsx("p",{className:"text-[11px] font-bold text-slate-500 leading-relaxed",children:F.customer.address})]})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-100 pb-2",children:["اقلام سفارش (",F.items_count," قلم)"]}),o.jsx("div",{className:"space-y-3",children:F.items_list.map((we,k)=>o.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-3xl border border-slate-50 hover:bg-slate-50 transition-all group",children:[o.jsx("div",{className:"w-16 h-16 bg-slate-100 rounded-2xl overflow-hidden flex-shrink-0 flex items-center justify-center",children:we.image?o.jsx("img",{src:we.image,className:"w-full h-full object-cover"}):o.jsx(Da,{className:"text-slate-300"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-black text-slate-800 truncate",title:we.name,children:we.name}),o.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase",children:["SKU: ",we.sku||"---"]})]}),o.jsxs("div",{className:"text-left flex-shrink-0",children:[o.jsxs("p",{className:"text-sm font-black text-slate-900",children:[Number(we.total).toLocaleString()," ",o.jsx("span",{className:"text-[10px]",children:"تومان"})]}),o.jsxs("p",{className:"text-[10px] font-black text-primary-500 bg-primary-50 px-2 py-0.5 rounded-full inline-block mt-1",children:["x",we.qty]})]})]},k))})]}),o.jsxs("div",{className:"bg-slate-900 rounded-[2.5rem] p-8 text-white space-y-4 shadow-2xl shadow-primary-900/20",children:[o.jsxs("div",{className:"flex items-center justify-between text-slate-400 text-xs font-bold px-2",children:[o.jsx("span",{children:"جمع اقلام:"}),o.jsxs("span",{children:[F.items_list.reduce((we,k)=>we+Number(k.total),0).toLocaleString()," تومان"]})]}),o.jsxs("div",{className:"flex items-center justify-between text-slate-400 text-xs font-bold px-2",children:[o.jsx("span",{children:"هزینه ارسال:"}),o.jsxs("span",{children:[F.shipping_total.toLocaleString()," تومان"]})]}),o.jsxs("div",{className:"flex items-center justify-between text-red-400 text-xs font-bold px-2",children:[o.jsx("span",{children:"تخفیف:"}),o.jsxs("span",{children:["- ",F.discount_total.toLocaleString()," تومان"]})]}),o.jsxs("div",{className:"pt-4 border-t border-white/10 flex items-center justify-between px-2",children:[o.jsx("span",{className:"text-sm font-black",children:"مبلغ نهایی پرداخت شده:"}),o.jsxs("span",{className:"text-2xl font-black text-primary-400",children:[F.total.toLocaleString()," ",o.jsx("span",{className:"text-xs",children:"تومان"})]})]})]})]}),o.jsx("div",{className:"p-8 border-t border-slate-100 flex items-center gap-4 bg-slate-50/50",children:o.jsxs("button",{className:"flex-1 h-14 bg-primary-600 text-white font-black rounded-2xl flex items-center justify-center gap-2 hover:bg-primary-700 transition-all shadow-lg shadow-primary-500/20 active:scale-95",onClick:()=>window.open(`${window.woocommersa_data.adminUrl}post.php?post=${F.id}&action=edit`,"_blank"),children:[o.jsx($u,{size:18}),"باز کردن در پیشخوان وردپرس"]})})]})})]}),o.jsxs("div",{className:"flex justify-end gap-3 px-2",children:[o.jsxs("button",{onClick:()=>{Le("all"),nt(""),$e(""),Ze(null),_e(!0)},className:"flex items-center gap-2 bg-white text-slate-700 h-10 px-5 rounded-xl font-black text-[11px] shadow-sm border border-slate-200 hover:border-primary-500 hover:text-primary-600 transition-all active:scale-95",children:[o.jsx(om,{size:14}),"خروجی CSV"]}),o.jsx("button",{onClick:fe,className:"w-10 h-10 bg-white text-slate-400 rounded-xl border border-slate-200 hover:text-primary-600 hover:border-primary-200 transition-all shadow-sm flex items-center justify-center",children:o.jsx(ur,{size:16,className:i?"animate-spin":""})})]}),o.jsxs("section",{className:"bg-white rounded-[2.5rem] p-8 shadow-xl shadow-slate-200/50 border border-white relative z-20",children:[o.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-primary-50 rounded-full blur-3xl -mr-16 -mt-16 opacity-50"}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-6 relative z-10",children:[o.jsxs("div",{className:"md:col-span-4 space-y-2",children:[o.jsxs("label",{className:"text-xs font-black text-slate-400 uppercase tracking-widest mr-2 flex items-center gap-1",children:[o.jsx(Ia,{size:12})," جستجوی مشتری"]}),o.jsxs("div",{className:"relative group",children:[o.jsx("input",{type:"text",placeholder:"نام، ایمیل یا شماره سفارش...",className:"w-full h-14 pl-14 pr-6 bg-white rounded-2xl border border-slate-200 focus:ring-4 focus:ring-primary-500/10 focus:border-primary-500 outline-none shadow-sm wm-label transition-all",value:a,onChange:we=>u(we.target.value),onKeyDown:we=>we.key==="Enter"&&fe()}),o.jsx("button",{onClick:fe,className:"absolute left-1.5 top-1/2 -translate-y-1/2 w-11 h-11 bg-primary-600 text-white rounded-xl hover:bg-primary-700 transition-all flex items-center justify-center shadow-lg shadow-primary-500/20 active:scale-95 z-10",children:i?o.jsx(ur,{className:"animate-spin",size:18}):o.jsx(Ia,{size:18})})]})]}),o.jsxs("div",{className:"md:col-span-3 space-y-2",children:[o.jsxs("label",{className:"wm-meta flex items-center gap-1",children:[o.jsx(Rx,{size:12})," وضعیت سفارش"]}),o.jsxs("select",{className:"wm-select h-14",value:h,onChange:we=>m(we.target.value),children:[o.jsx("option",{value:"",children:"همه وضعیتها"}),o.jsx("option",{value:"abandoned",className:"font-black text-rose-500 bg-rose-50",children:"⚠️ سبدهای رها شده (مجازی)"}),Object.entries(n).map(([we,k])=>o.jsx("option",{value:we.replace("wc-",""),children:k},we))]})]}),o.jsxs("div",{className:"md:col-span-3 space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between mr-2",children:[o.jsxs("label",{className:"text-xs font-black text-slate-400 uppercase tracking-widest flex items-center gap-1",children:[o.jsx(Ll,{size:12})," بازه زمانی"]}),g&&o.jsx("button",{onClick:()=>y(null),className:"text-[10px] font-bold text-red-500 hover:text-red-600 bg-red-50 px-2 py-0.5 rounded-md",children:"حذف"})]}),o.jsx(Dh,{value:g,onChange:y,range:!0,calendar:Hh,locale:Lh,calendarPosition:"bottom-right",inputClass:"w-full h-14 pl-12 pr-4 bg-white border border-slate-200 rounded-2xl outline-none focus:ring-4 focus:ring-primary-500/10 font-bold text-xs",placeholder:"بازه تاریخ...",containerClassName:"w-full !z-[100]",render:(we,k)=>o.jsxs("div",{className:"relative group",children:[o.jsx(Ll,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 z-10 pointer-events-none",size:18}),o.jsx("input",{onClick:k,value:we,readOnly:!0,placeholder:"بازه تاریخ...",className:"w-full h-14 bg-white border border-slate-200 rounded-2xl px-5 py-3 pr-4 pl-12 outline-none transition-all wm-hint cursor-pointer focus:ring-4 focus:ring-primary-500/10 focus:border-primary-500"})]})})]}),o.jsxs("div",{className:"md:col-span-2 space-y-2",children:[o.jsx("label",{className:"text-xs font-black text-slate-400 uppercase tracking-widest mr-2 block",children:"نمایش هر صفحه"}),o.jsx("select",{value:D,onChange:we=>{z(Number(we.target.value)),C(1)},className:"wm-select h-14",children:[25,50,100,200].map(we=>o.jsxs("option",{value:we,children:[we," ردیف"]},we))})]})]})]}),o.jsx(tr,{children:H.length>0&&o.jsx(ht.div,{initial:{y:50,opacity:0},animate:{y:0,opacity:1},exit:{y:50,opacity:0},className:"fixed bottom-12 inset-x-0 flex justify-center z-[500] px-4 pointer-events-none",children:o.jsxs("div",{className:"bg-slate-900/95 backdrop-blur-2xl text-white px-8 py-5 rounded-[2.5rem] shadow-[0_20px_50px_rgba(0,0,0,0.3)] flex items-center gap-10 border border-white/10 pointer-events-auto",children:[o.jsxs("div",{className:"flex items-center gap-4 border-l border-white/10 pl-10",children:[o.jsx("div",{className:"w-10 h-10 bg-primary-500 rounded-2xl flex items-center justify-center font-black text-white shadow-glow-primary",children:H.length}),o.jsxs("div",{children:[o.jsx("div",{className:"text-[10px] font-black text-slate-500 uppercase tracking-widest leading-none mb-1",children:"موارد برگزیده"}),o.jsx("span",{className:"text-sm font-bold",children:"سفارش انتخاب شده"})]})]}),o.jsxs("div",{className:"flex items-center gap-6",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest px-1",children:"عملیات گروهی سریع"}),o.jsxs("select",{className:"bg-white/5 border border-white/10 rounded-xl px-4 py-2 text-xs font-bold text-white outline-none focus:border-primary-500 focus:ring-4 focus:ring-primary-500/20 transition-all cursor-pointer min-w-[160px]",onChange:we=>Ke(we.target.value),value:"",children:[o.jsx("option",{value:"",disabled:!0,className:"text-slate-900",children:"تغییر وضعیت تمام موارد..."}),Object.entries(n).map(([we,k])=>o.jsx("option",{value:we.replace("wc-",""),className:"text-slate-900 bg-white",children:k},we))]})]}),o.jsx("button",{className:"bg-white/5 hover:bg-rose-500/10 text-slate-400 hover:text-rose-400 px-6 py-2.5 rounded-xl text-xs font-black transition-all border border-white/5 active:scale-95",onClick:()=>V([]),children:"لغو انتخاب"})]})]})})}),o.jsxs("section",{className:"bg-white rounded-[2.5rem] p-4 shadow-xl shadow-slate-200/50 border border-white overflow-hidden min-h-[500px] flex flex-col",children:[i?o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4",children:[o.jsx("div",{className:"w-16 h-16 border-4 border-primary-500/20 border-t-primary-500 rounded-full animate-spin"}),o.jsx("p",{className:"text-slate-400 font-bold animate-pulse",children:"در حال فراخوانی اطلاعات..."})]}):t.length===0?o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-6 opacity-40",children:[o.jsx(bc,{size:80,className:"text-slate-300"}),o.jsx("p",{className:"text-xl font-black text-slate-400",children:"سفارشی یافت نشد"})]}):o.jsx(ume,{data:t,updateData:xe,onSelectionChange:V,statuses:n,onViewDetail:B}),o.jsxs("div",{className:"mt-8 pt-8 border-t border-slate-100 flex flex-col md:flex-row items-center justify-between gap-6 px-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"text-xs font-bold text-slate-400 italic",children:["نمایش ",t.length," مورد در این صفحه (از کل ",j,")"]}),o.jsx("div",{className:"w-28",children:o.jsx("select",{value:D,onChange:we=>{z(Number(we.target.value)),C(1)},className:"wm-select h-10 !text-[11px]",children:[25,50,100,200].map(we=>o.jsxs("option",{value:we,children:[we," ردیف"]},we))})})]}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("button",{disabled:x===1,onClick:()=>C(we=>we-1),className:"px-6 py-2 bg-slate-50 rounded-xl font-bold text-slate-600 disabled:opacity-30 hover:bg-slate-100 transition-all border border-transparent hover:border-slate-200",children:"قبلی"}),o.jsxs("span",{className:"text-sm font-black text-slate-400 px-4 bg-slate-50 py-2 rounded-xl border border-slate-100",children:["صفحه ",o.jsx("span",{className:"text-primary-600",children:x})," از ",E]}),o.jsx("button",{disabled:x===E,onClick:()=>C(we=>we+1),className:"px-6 py-2 bg-slate-50 rounded-xl font-bold text-slate-600 disabled:opacity-30 hover:bg-slate-100 transition-all border border-transparent hover:border-slate-200",children:"بعدی"})]})]})]})]})},hme=({isOpen:t,onClose:e,selectedCount:n,onApply:r,categories:i,initialField:s="regular_price"})=>{const[a,u]=W.useState(s),[h,m]=W.useState("set");bi.useEffect(()=>{t&&u(s)},[t,s]);const[g,y]=W.useState(""),[x,C]=W.useState("fixed"),[E,M]=W.useState("none");if(!t)return null;const j=()=>{if(!g&&h!=="delete"){ze.error("لطفاً مقداری وارد کنید");return}const L={};a==="category"?L.categories={operation:"add",value:[g]}:L[a]={operation:h,value:Number(g)||g,unit:x,rounding:E},r(L),e()};return o.jsx(tr,{children:o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"wm-modal-overlay",onClick:e,children:o.jsxs(ht.div,{initial:{scale:.95,opacity:0,y:20},animate:{scale:1,opacity:1,y:0},exit:{scale:.95,opacity:0,y:20},className:"wm-modal-panel max-w-lg",onClick:L=>L.stopPropagation(),children:[o.jsxs("div",{className:"wm-modal-header",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-12 h-12 bg-primary-50 text-primary-600 rounded-2xl flex items-center justify-center shadow-soft",children:o.jsx(Hr,{size:24})}),o.jsxs("div",{children:[o.jsx("h3",{className:"wm-title-md",children:"ویرایش گروهی هوشمند"}),o.jsxs("p",{className:"wm-hint font-bold",children:["در حال ویرایش ",n," محصول"]})]})]}),o.jsx("button",{onClick:e,className:"w-10 h-10 rounded-xl hover:bg-slate-100 text-slate-400 transition-colors flex items-center justify-center",children:o.jsx(qi,{size:20})})]}),o.jsxs("div",{className:"wm-modal-body",dir:"rtl",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"wm-label mr-2",children:"فیلد مورد نظر:"}),o.jsx("div",{className:"relative",children:o.jsxs("select",{value:a,onChange:L=>u(L.target.value),className:"wm-select",children:[o.jsx("option",{value:"regular_price",children:"قیمت عادی"}),o.jsx("option",{value:"sale_price",children:"قیمت فروش ویژه"}),o.jsx("option",{value:"cost_price",children:"قیمت خرید (Cost Price)"}),o.jsx("option",{value:"margin",children:"حاشیه سود (%)"}),o.jsx("option",{value:"profit",children:"سود واحد (تومان)"}),o.jsx("option",{value:"regular_price_by_margin",children:"تنظیم قیمت بر اساس حاشیه سود (%)"}),o.jsx("option",{value:"stock",children:"موجودی انبار"}),o.jsx("option",{value:"category",children:"دستهبندی"}),o.jsx("option",{value:"status",children:"وضعیت انتشار"}),o.jsx("option",{value:"seo_title",children:"عنوان سئو"}),o.jsx("option",{value:"seo_description",children:"توضیحات سئو"}),o.jsx("option",{value:"seo_keywords",children:"کلمات کلیدی سئو"}),o.jsx("option",{value:"seo_index",children:"وضعیت ایندکس (Robots)"}),o.jsx("option",{value:"image_alt",children:"متن جایگزین تصویر (Alt)"})]})})]}),a!=="category"&&a!=="status"&&o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"wm-label mr-2",children:"عملیات:"}),o.jsxs("select",{value:h,onChange:L=>m(L.target.value),className:"wm-select h-12 pr-5 pl-4",children:[o.jsx("option",{value:"set",children:"جایگزینی"}),o.jsx("option",{value:"increase",children:"افزایش"}),o.jsx("option",{value:"decrease",children:"کاهش"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"wm-label mr-2",children:"واحد:"}),o.jsxs("select",{value:x,onChange:L=>C(L.target.value),className:"wm-select h-12 pr-5 pl-4",children:[o.jsx("option",{value:"fixed",children:"تومان"}),o.jsx("option",{value:"percentage",children:"درصد (%)"})]})]})]}),(a==="regular_price"||a==="sale_price")&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"wm-label mr-2",children:"رُند کردن قیمت:"}),o.jsx("div",{className:"relative",children:o.jsxs("select",{value:E,onChange:L=>M(L.target.value),className:"wm-select",children:[o.jsx("option",{value:"none",children:"بدون رُند کردن"}),o.jsx("option",{value:"5",children:"مضرب ۵ (مثلاً ۱۲۳ ← ۱۲۵)"}),o.jsx("option",{value:"10",children:"مضرب ۱۰ (مثلاً ۱۲۳ ← ۱۲۰)"}),o.jsx("option",{value:"100",children:"مضرب ۱۰۰ (مثلاً ۱۲۳ ← ۱۰۰)"}),o.jsx("option",{value:"1000",children:"مضرب ۱۰۰۰ (مثلاً ۱۲۳۰ ← ۱۰۰۰)"}),o.jsx("option",{value:"digits_3",children:"۳ رقم رُند (مثلاً ۱۲۳ ← ۱۲۰)"}),o.jsx("option",{value:"digits_2",children:"۲ رقم رُند (مثلاً ۱۲ ← ۱۰)"}),o.jsx("option",{value:"ceil_5",children:"سقف مضرب ۵ (همیشه به بالا)"}),o.jsx("option",{value:"ceil_10",children:"سقف مضرب ۱۰ (همیشه به بالا)"})]})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"wm-label mr-2",children:"مقدار جدید:"}),a==="category"?o.jsx("div",{className:"relative",children:o.jsxs("select",{value:g,onChange:L=>y(L.target.value),className:"wm-select",children:[o.jsx("option",{value:"",children:"انتخاب دستهبندی..."}),i.map(L=>o.jsx("option",{value:L.name,children:L.name},L.id))]})}):a==="status"?o.jsx("div",{className:"relative",children:o.jsxs("select",{value:g,onChange:L=>y(L.target.value),className:"wm-select",children:[o.jsx("option",{value:"publish",children:"منتشر شده"}),o.jsx("option",{value:"draft",children:"پیشنویس"}),o.jsx("option",{value:"private",children:"خصوصی"})]})}):o.jsx("input",{type:a==="seo_title"||a==="seo_description"||a==="seo_keywords"||a==="image_alt"||a==="seo_index"?"text":"number",value:g,onChange:L=>y(L.target.value),placeholder:a==="seo_title"||a==="seo_description"||a==="seo_keywords"||a==="image_alt"?"متن خود را وارد کنید...":"مثلاً ۵۰۰۰۰ یا ۱۰",className:"wm-input"})]}),o.jsxs("div",{className:"wm-alert-warning",children:[o.jsx(Ph,{size:20,className:"text-amber-500 shrink-0 mt-0.5"}),o.jsxs("p",{className:"text-[11px] font-bold leading-relaxed",children:['هشدار: این تغییرات پس از کلیک بر روی دکمه "اعمال تغییرات" به صورت دستهجمعی روی تمامی ',n," محصول انتخاب شده اعمال خواهد شد. این عملیات قابل بازگشت (Undo) است."]})]})]}),o.jsxs("div",{className:"wm-modal-footer",children:[o.jsxs("button",{onClick:j,className:"wm-btn-primary flex-1",children:[o.jsx(Hr,{size:18,fill:"currentColor"}),"اعمال تغییرات گروهی"]}),o.jsx("button",{onClick:e,className:"wm-btn-secondary px-8",children:"انصراف"})]})]})})})},fme=({updateData:t})=>{const[e,n]=W.useState([]),[r,i]=W.useState(!0),[s,a]=W.useState([]),[u,h]=W.useState(!1),[m,g]=W.useState("regular_price"),[y,x]=W.useState([]),[C,E]=W.useState(null),[M,j]=W.useState(""),[L,D]=W.useState(""),[z,H]=W.useState(""),[V,F]=W.useState(1),[B,te]=W.useState(0),[ve,ce]=W.useState(25),[_e,pe]=W.useState(null),[Le,Fe]=W.useState({}),nt=async()=>{i(!0);try{let Ee=`${window.woocommersa_data.apiUrl}/products?page=${V}&per_page=${ve}`;M&&(Ee+=`&search=${encodeURIComponent(M)}`),L&&(Ee+=`&category=${encodeURIComponent(L)}`),z&&(Ee+=`&profit_filter=${encodeURIComponent(z)}`);const fe=await(await fetch(Ee,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();te((fe==null?void 0:fe.total)||0),n((fe==null?void 0:fe.data)||[]);const ne=await(await fetch(`${window.woocommersa_data.apiUrl}/profit-stats`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();pe(ne)}catch{ze.error("خطا در دریافت اطلاعات سود")}finally{i(!1)}},dt=async()=>{try{const Q=await(await fetch(`${window.woocommersa_data.apiUrl}/categories`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();x(Array.isArray(Q==null?void 0:Q.data)?Q.data:Array.isArray(Q)?Q:[])}catch{}};W.useEffect(()=>{nt(),dt()},[L,z,V,ve]),W.useEffect(()=>{const Ee=setTimeout(()=>{M!==""&&nt()},500);return()=>clearTimeout(Ee)},[M]),W.useEffect(()=>{const Ee=async()=>{const Q=e.filter(ne=>ne.type==="variable");if(Q.length===0)return;const fe={...Le};let Ve=!1;for(const ne of Q)if(!fe[ne.id])try{const Ke=await(await fetch(`${window.woocommersa_data.apiUrl}/products/variations/${ne.id}`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();fe[ne.id]=Ke,Ve=!0}catch(xe){console.error(xe)}Ve&&Fe(fe)};e.length>0&&Ee()},[e]);const $e=async Ee=>{if(Object.keys(Ee).length===0||Ee._type==="bulk-edit"){Ee.field?g(Ee.field):g("regular_price"),h(!0);return}const Q=ze.loading("درحال اعمال تغییرات گروهی...");try{(await fetch(`${window.woocommersa_data.apiUrl}/products/bulk-update`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({ids:s,updates:Ee})})).ok?(ze.success("تغییرات با موفقیت اعمال شد",{id:Q}),Fe({}),nt(),a([])):ze.error("خطا در اعمال تغییرات",{id:Q})}catch{ze.error("خطا در ارتباط با سرور",{id:Q})}},Re=Ee=>{const Q=parseFloat(Ee.sale_price||Ee.regular_price||Ee.price||"0"),fe=parseFloat(Ee.cost_price||"0"),Ve=(_e==null?void 0:_e.overhead_percent)||0,ne=Q*(Ve/100),xe=fe+ne,Ke=Q-xe,qe=Q>0?Ke/Q*100:0;return{price:Q,cost:fe,effectiveCost:xe,profit:Ke,margin:qe,overheadValue:ne}},Ze=(Ee,Q,fe)=>{t(Ee,Q,fe),n(Ve=>Ve.map(ne=>{if(ne.id!==Ee)return ne;let xe={...ne,[Q]:fe};const Ke=(_e==null?void 0:_e.overhead_percent)||0;if(Q==="margin"){const qe=parseFloat(fe)||0,we=parseFloat(xe.cost_price||"0");if(qe<100){const k=Math.round(we/(1-qe/100));xe.regular_price=k.toString(),xe.sale_price="";const _=we+k*(Ke/100);xe.profit=(k-_).toString(),t(Ee,"regular_price",xe.regular_price)}}if(Q==="profit"){const qe=parseFloat(fe)||0,we=parseFloat(xe.cost_price||"0"),k=Ke/100;if(1-k>0){const _=Math.round((we+qe)/(1-k));xe.regular_price=_.toString(),xe.sale_price="";const N=_>0?qe/_*100:0;xe.margin=N.toString(),t(Ee,"regular_price",xe.regular_price)}}if(Q==="cost_price"){const qe=parseFloat(fe)||0,we=parseFloat(xe.sale_price||xe.regular_price||"0"),k=qe+we*(Ke/100),_=we-k,N=we>0?_/we*100:0;xe.profit=_.toString(),xe.margin=N.toString()}if(Q==="regular_price"||Q==="sale_price"){const qe=parseFloat(fe)||0,k=parseFloat(xe.cost_price||"0")+qe*(Ke/100),_=qe-k,N=qe>0?_/qe*100:0;xe.profit=_.toString(),xe.margin=N.toString()}return xe}))};return o.jsxs("div",{className:"space-y-10",dir:"rtl",children:[o.jsxs("section",{className:"bg-white rounded-[2rem] p-8 shadow-sm border border-slate-100 flex flex-col md:flex-row md:items-center justify-between gap-6",children:[o.jsxs("div",{className:"flex items-center gap-5",children:[o.jsx("div",{className:"w-16 h-16 bg-primary-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-lg shadow-primary-500/20",children:o.jsx(OU,{size:32})}),o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-black text-slate-900",children:"تحلیل سود و مارجین"}),o.jsx("p",{className:"text-slate-400 text-xs font-bold mt-1",children:"مدیریت هوشمند قیمت خرید، سود خالص و حاشیه سود محصولات"})]})]}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"px-6 py-4 bg-slate-50 rounded-2xl border border-slate-100 flex flex-col items-center min-w-[140px]",children:[o.jsx("span",{className:"text-[10px] text-slate-400 font-bold mb-1",children:"میانگین مارجین"}),o.jsxs("span",{className:"text-xl font-black text-primary-600",children:[(_e==null?void 0:_e.avgMargin)||0,"%"]})]}),o.jsxs("div",{className:"px-6 py-4 bg-slate-50 rounded-2xl border border-slate-100 flex flex-col items-center min-w-[170px]",children:[o.jsx("span",{className:"text-[10px] text-slate-400 font-bold mb-1",children:"پتانسیل سود انبار"}),o.jsx("span",{className:"text-xl font-black text-emerald-600",children:Xo((_e==null?void 0:_e.totalProfitPotential)||0)})]})]})]}),o.jsxs("section",{className:"bg-white rounded-[3.5rem] p-10 shadow-2xl border border-slate-100 space-y-8 relative overflow-hidden",children:[o.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-6",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-14 h-14 bg-indigo-50 text-indigo-600 rounded-[1.5rem] flex items-center justify-center shadow-inner",children:o.jsx(OU,{size:28})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"لیست آنالیز کالاها"}),o.jsx("p",{className:"text-slate-400 text-xs font-bold",children:"برای مشاهده محاسبات دقیق روی هر ردیف کلیک کنید"})]})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("input",{type:"text",placeholder:"جستجو...",value:M,onChange:Ee=>j(Ee.target.value),className:"w-48 h-12 px-6 bg-slate-50 border border-slate-200 rounded-2xl outline-none focus:ring-4 focus:ring-primary-500/10 font-bold text-xs"}),o.jsxs("select",{value:z,onChange:Ee=>H(Ee.target.value),className:"h-12 px-4 bg-slate-50 border border-slate-200 rounded-2xl outline-none font-bold text-[11px]",children:[o.jsx("option",{value:"",children:"همه وضعیتها"}),o.jsx("option",{value:"loss",className:"text-rose-600 font-bold",children:"❌ زیانده"}),o.jsx("option",{value:"low_margin",className:"text-amber-600 font-bold",children:"⚠️ سود پایین"}),o.jsx("option",{value:"no_cost",children:"❓ فاقد قیمت خرید"})]}),o.jsxs("select",{value:L,onChange:Ee=>D(Ee.target.value),className:"h-12 px-4 bg-slate-50 border border-slate-200 rounded-2xl outline-none font-bold text-[11px] w-40",children:[o.jsx("option",{value:"",children:"همه دستهبندیها"}),y.map(Ee=>o.jsx("option",{value:Ee.slug,children:Ee.name},Ee.id))]}),o.jsx("button",{onClick:nt,className:"w-12 h-12 bg-rose-50 text-rose-600 rounded-2xl flex items-center justify-center hover:bg-rose-100 transition-all shadow-lg shadow-rose-500/10 active:scale-95 group",title:"بروزرسانی آمار و لیست",children:o.jsx(ur,{size:20,className:`${r?"animate-spin":""} group-hover:rotate-180 transition-transform duration-500`})})]})]}),o.jsxs("div",{className:"relative rounded-[2.5rem] border border-slate-100 overflow-hidden bg-slate-50/20 min-h-[500px]",children:[r&&o.jsxs("div",{className:"absolute inset-0 bg-white/60 backdrop-blur-sm z-30 flex flex-col items-center justify-center gap-4",children:[o.jsx(ur,{className:"animate-spin text-primary-500",size:40}),o.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"در حال واکشی دادههای مالی..."})]}),o.jsx(DH,{data:e,variations:Le,updateData:Ze,onSelectionChange:a,selectedIds:s,onRowClick:E,context:"profit",compact:!1,settings:{visible_columns:["image","name","sku","regular_price","sale_price","cost_price","margin","profit","stock","categories"],image_size:"small"}}),o.jsxs("div",{className:"p-8 bg-white border-t border-slate-100 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"text-xs font-bold text-slate-400",children:["نمایش ",e.length," از ",B," محصول"]}),o.jsx("div",{className:"w-28",children:o.jsx("select",{value:ve,onChange:Ee=>{ce(Number(Ee.target.value)),F(1)},className:"wm-select h-10 !text-[11px]",children:[25,50,100,200].map(Ee=>o.jsxs("option",{value:Ee,children:[Ee," ردیف"]},Ee))})})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{onClick:()=>F(V-1),disabled:V===1,className:"h-10 px-4 bg-slate-50 rounded-xl text-slate-500 disabled:opacity-30 font-black text-[10px]",children:"قبلی"}),o.jsx("span",{className:"w-10 h-10 flex items-center justify-center bg-primary-600 text-white rounded-xl font-black text-sm shadow-lg shadow-primary-500/30",children:V}),o.jsx("button",{onClick:()=>F(V+1),disabled:e.length<ve,className:"h-10 px-4 bg-slate-50 rounded-xl text-slate-500 disabled:opacity-30 font-black text-[10px]",children:"بعدی"})]})]})]})]}),o.jsx(tr,{children:C&&o.jsxs(o.Fragment,{children:[o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>E(null),className:"fixed inset-0 bg-slate-900/40 backdrop-blur-sm z-[998]"}),o.jsxs(ht.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"fixed top-[32px] md:top-[32px] right-0 h-[calc(100%-32px)] w-[450px] bg-white z-[9999] shadow-2xl flex flex-col p-8 border-l border-slate-100",children:[o.jsxs("div",{className:"flex items-center justify-between mb-8",children:[o.jsx("button",{onClick:()=>E(null),className:"w-10 h-10 rounded-full bg-slate-50 flex items-center justify-center text-slate-400 hover:bg-slate-100 hover:text-slate-900 transition-all",children:o.jsx(qi,{size:20})}),o.jsx("h3",{className:"font-black text-slate-900",children:"جزئیات و آنالیز سود"})]}),o.jsxs("div",{className:"flex flex-col items-center gap-4 p-6 bg-slate-50 rounded-[2.5rem] border border-slate-100 mb-8",children:[o.jsx("img",{src:C.image,className:"w-32 h-32 object-cover rounded-3xl shadow-xl"}),o.jsxs("div",{className:"text-center space-y-1",children:[o.jsx("h4",{className:"font-black text-slate-900",children:C.name}),o.jsxs("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest leading-none mt-1",children:["SKU: ",C.sku||"-"]})]})]}),(()=>{const Ee=Re(C),Q=Ee.profit>0;return o.jsxs("div",{className:"flex-1 space-y-8 overflow-y-auto no-scrollbar pb-10",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:`p-5 rounded-3xl flex flex-col items-center justify-center border ${Q?"bg-emerald-50 border-emerald-100":"bg-rose-50 border-rose-100"}`,children:[o.jsx("span",{className:`text-[10px] font-bold ${Q?"text-emerald-600":"text-rose-600"} mb-2`,children:"سود خالص"}),o.jsx("div",{className:`text-xl font-black ${Q?"text-emerald-700":"text-rose-700"}`,children:Xo(Ee.profit)})]}),o.jsxs("div",{className:`p-5 rounded-3xl flex flex-col items-center justify-center border ${Ee.margin>15?"bg-indigo-50 border-indigo-100":"bg-amber-50 border-amber-100"}`,children:[o.jsx("span",{className:`text-[10px] font-bold ${Ee.margin>15?"text-indigo-600":"text-amber-600"} mb-2`,children:"حاشیه سود"}),o.jsxs("div",{className:`text-xl font-black ${Ee.margin>15?"text-indigo-700":"text-amber-700"}`,children:[Ee.margin.toFixed(1),"٪"]}),Ee.margin<=15&&o.jsx("span",{className:"text-[9px] text-amber-600 font-bold",children:"⚠️ سود پایین خطرناک"})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("h5",{className:"font-black text-slate-900 text-xs flex items-center gap-2",children:[o.jsx(Pae,{size:14,className:"text-rose-500"}),"آنالیز اجزای قیمت (بهای تمام شده)"]}),o.jsxs("div",{className:"space-y-3 bg-slate-50 p-6 rounded-3xl",children:[o.jsxs("div",{className:"flex justify-between items-center group",children:[o.jsx("span",{className:"text-xs text-slate-500 font-bold",children:"قیمت خرید (Cost)"}),o.jsx("span",{className:"text-sm font-black text-slate-900",children:Xo(C.cost_price||"0")})]}),o.jsxs("div",{className:"flex justify-between items-center",children:[o.jsxs("span",{className:"text-xs text-slate-500 font-bold flex items-center gap-1.5 focus:text-primary-600",children:["هزینههای جانبی (",_e==null?void 0:_e.overhead_percent,"٪)",o.jsx(Ph,{size:10,className:"text-slate-300"})]}),o.jsxs("span",{className:"text-sm font-black text-rose-500",children:["+",Xo(Ee.overheadValue)]})]}),o.jsx("div",{className:"h-px bg-slate-200"}),o.jsxs("div",{className:"flex justify-between items-center",children:[o.jsx("span",{className:"text-xs text-slate-800 font-black",children:"بهای تمام شده نهایی"}),o.jsx("span",{className:"text-base font-black text-slate-900",children:Xo(Ee.effectiveCost)})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex justify-between text-[11px] font-bold",children:[o.jsx("span",{className:"text-slate-400",children:"سهم بهای تمام شده از قیمت فروش"}),o.jsxs("span",{className:"text-slate-900",children:[Math.round(Ee.effectiveCost/Ee.price*100),"٪"]})]}),o.jsxs("div",{className:"h-3 w-full bg-slate-100 rounded-full flex overflow-hidden",children:[o.jsx("div",{className:"h-full bg-rose-500",style:{width:`${Ee.effectiveCost/Ee.price*100}%`}}),o.jsx("div",{className:"h-full bg-emerald-500",style:{width:`${100-Ee.effectiveCost/Ee.price*100}%`}})]}),o.jsxs("div",{className:"flex items-center gap-4 mt-2",children:[o.jsxs("div",{className:"flex items-center gap-1.5 text-[9px] font-bold text-slate-400",children:[o.jsx("div",{className:"w-2 h-2 rounded-full bg-rose-500"})," هزینه کل"]}),o.jsxs("div",{className:"flex items-center gap-1.5 text-[9px] font-bold text-slate-400",children:[o.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-500"})," سود خالص"]})]})]}),o.jsxs("div",{className:`p-6 rounded-3xl border-2 border-dashed flex items-start gap-4 ${Q?"bg-emerald-50/50 border-emerald-200":"bg-rose-50/50 border-rose-200"}`,children:[Q?o.jsx(Mae,{className:"text-emerald-500",size:20}):o.jsx(Ph,{className:"text-rose-500",size:20}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("h6",{className:`text-xs font-black ${Q?"text-emerald-900":"text-rose-900"}`,children:Q?"وضعیت عالی است":"هشدار سود منفی!"}),o.jsx("p",{className:"text-[11px] text-slate-500 leading-relaxed font-bold",children:Q?"این محصول با حاشیه سود فعلی بازدهی مناسبی دارد. پیشنهاد میشود برای افزایش فروش روی سئوی آن تمرکز کنید.":"قیمت فروش شما با احتساب هزینههای جانبی از قیمت خرید کمتر است. سریعاً قیمت را حداقل ۱۵٪ افزایش دهید."})]})]})]})})(),o.jsxs("button",{onClick:()=>E(null),className:"mt-4 h-14 bg-slate-900 text-white rounded-2xl font-black text-xs hover:bg-slate-800 transition-all flex items-center justify-center gap-2 shadow-xl shadow-slate-200",children:["تایید و بازگشت ",o.jsx(f0,{size:18,className:"rotate-180"})]})]})]})}),o.jsx("div",{className:"fixed bottom-10 left-1/2 -translate-x-1/2 z-[100]",children:o.jsx(FH,{selectedCount:s.length,onApply:$e,context:"profit"})}),o.jsx(hme,{isOpen:u,onClose:()=>h(!1),selectedCount:s.length,categories:y,onApply:$e,initialField:m})]})},RY=t=>parseInt(t,10),_0=({text:t})=>o.jsxs("div",{className:"group relative inline-block cursor-help ml-1",children:[o.jsx(Cx,{size:14,className:"text-slate-300 hover:text-primary-500 transition-colors"}),o.jsxs("div",{className:"absolute bottom-full right-0 mb-2 hidden group-hover:block w-48 p-3 bg-slate-800 text-white text-[10px] rounded-xl shadow-xl z-50 leading-relaxed font-bold",children:[t,o.jsx("div",{className:"absolute top-full right-4 border-8 border-transparent border-t-slate-800"})]})]}),zH=({value:t,onChange:e,placeholder:n,className:r,showUnit:i=!0,hideBadge:s=!1,unit:a="تومان"})=>o.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-[120px]",children:[o.jsxs("div",{className:"relative",children:[o.jsx("input",{type:"number",value:t||"",onChange:u=>e(parseInt(u.target.value)||0),className:`w-full h-14 bg-white px-4 rounded-xl border border-slate-200 font-black text-sm text-center shadow-sm focus:border-primary-500 outline-none transition-all ${r}`,placeholder:n}),i&&o.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-[9px] text-slate-400 font-bold pointer-events-none",children:a})]}),t>0&&!s&&o.jsxs("div",{className:"text-[9px] font-black text-primary-600 text-center truncate px-1",children:[new Intl.NumberFormat("fa-IR").format(t)," ",i?a:""]})]}),Q1=({label:t,value:e,colorClass:n="text-rose-600 border-slate-200"})=>{const r=()=>{navigator.clipboard.writeText(e)};return o.jsxs("code",{onClick:r,className:`bg-white px-2 py-1 rounded-lg border font-black cursor-pointer hover:bg-slate-100 transition-all active:scale-95 text-[11px] inline-flex items-center gap-1 mx-0.5 ${n}`,title:"برای کپی کلیک کنید",children:[t,o.jsx($U,{size:10,className:"opacity-40"})]})},mme=({onSave:t})=>{var Ze,Ee,Q,fe,Ve,ne,xe,Ke,qe,we,k,_,N,O,G,q;const[e,n]=W.useState("general"),[r,i]=W.useState(!0),[s,a]=W.useState({items_per_page:25,seo_integration:"auto",auto_rollback:!0,rollback_retention:7,rollback_max_snapshots:20,save_mode:"auto",debug_mode:!1,job_safe_mode:!1,job_retry_limit:3,job_error_threshold:20,visible_columns:["image","name","sku","regular_price","sale_price","stock","stock_status","categories","cost_price","margin"],coupon_columns:["code","type","amount","expiry_date","usage_limit","minimum_amount","description"],variable_display_mode:"expandable",table_mode:"simple",image_size:"medium",enable_history:!0,max_history_records:5e3,history_cleanup_days:30,show_history_in_grid:!1,price_limit:"none",confirm_large_changes:!0,large_change_threshold:100,allowed_roles:["administrator","shop_manager"],enable_automation:!0,automation_interval:"daily",automation_sale_behavior:"apply_regular",log_automation:!0,perf_mode:"medium",profit_overhead_percent:0,ai_mode:"local",ai_api_key:"",ai_proxy_url:"https://api.openai.com/v1/chat/completions",ai_model:"gpt-4o-mini",canvas_mode:!1,canvas_slug:"woocommersa-app",canvas_font:"system",pos_pwa_enabled:!1,pos_enabled:!1,pos_slug:"pos",pos_shop_name:"",pos_phone:"",pos_address:"",pos_tax_percent:0,pos_footer_text:"",pos_sms_enabled:!1,pos_sms_pattern:"",pos_sms_template:"سلام {name} عزیز، سفارش شما با شماره {order_id} با موفقیت ثبت گردید.",pos_bale_enabled:!1,pos_bale_template:"سلام {name} عزیز، سفارش شما با موفقیت ثبت شد. شماره سفارش: {order_id}",sms:{gateway:"ippanel",api_key:"",username:"",password:"",originator:"",patterns:{status_pending:"",status_processing:"",status_on_hold:"",status_completed:"",status_cancelled:"",tracking_added:""}},brand_source_type:"auto",brand_source_slug:"",abandoned_cart_enabled:!1,abandoned_cart_intervals:["6h","1d"],abandoned_cart_start_hour:9,abandoned_cart_end_hour:21,abandoned_cart_min_amount:0,abandoned_cart_pattern:"",abandoned_cart_template:"سلام، سبد خرید شما در انتظار نهایی شدن است. برای تکمیل خرید کلیک کنید: {url}",abandoned_cart_rules:[],abandoned_cart_exit_intent:!1,bale_bot_enabled:!1,bale_bot_token:"",bale_safir_token:"",bale_bot_template:"سلام، سبد خرید شما در انتظار نهایی شدن است. برای تکمیل خرید کلیک کنید: {url}"}),[u,h]=W.useState(!1),[m,g]=W.useState(!1),[y,x]=W.useState(null),[C,E]=W.useState([]),[M,j]=W.useState({sources:[],active:null}),[L,D]=W.useState(!1),[z,H]=W.useState(!1);W.useEffect(()=>{const I=async()=>{var U,re;i(!0);try{const ae=(U=window.woocommersa_data)==null?void 0:U.apiUrl,he=(re=window.woocommersa_data)==null?void 0:re.nonce;if(!ae||!he){console.error("WooCommersa data missing");return}const tt=await(await fetch(`${ae}/settings`,{headers:{"X-WP-Nonce":he}})).json();tt&&typeof tt=="object"&&a(ot=>({...ot,...tt}))}catch(ae){console.error(ae)}finally{i(!1)}},Z=async()=>{var U,re;try{const ae=(U=window.woocommersa_data)==null?void 0:U.apiUrl,he=(re=window.woocommersa_data)==null?void 0:re.nonce,tt=await(await fetch(`${ae}/settings/brand-sources`,{headers:{"X-WP-Nonce":he}})).json();j(tt)}catch(ae){console.error(ae)}};I(),Z()},[]);const V=async()=>{var I,Z;H(!0);try{const U=(I=window.woocommersa_data)==null?void 0:I.apiUrl,re=(Z=window.woocommersa_data)==null?void 0:Z.nonce,he=await(await fetch(`${U}/system-info`,{headers:{"X-WP-Nonce":re}})).json();x(he)}catch(U){console.error(U)}finally{H(!1)}},F=async()=>{var I,Z;D(!0);try{const U=(I=window.woocommersa_data)==null?void 0:I.apiUrl,re=(Z=window.woocommersa_data)==null?void 0:Z.nonce,he=await(await fetch(`${U}/logs`,{headers:{"X-WP-Nonce":re}})).json();E(he.logs||[])}catch(U){console.error(U)}finally{D(!1)}},B=async()=>{var I,Z;if(confirm("آیا از پاک کردن تمامی لاگها اطمینان دارید؟"))try{const U=(I=window.woocommersa_data)==null?void 0:I.apiUrl,re=(Z=window.woocommersa_data)==null?void 0:Z.nonce;await fetch(`${U}/logs/clear`,{method:"POST",headers:{"X-WP-Nonce":re}}),E([])}catch(U){console.error(U)}};W.useEffect(()=>{e==="system"&&V(),e==="logs"&&F()},[e]);const te=async()=>{var I,Z;h(!0);try{const U=(I=window.woocommersa_data)==null?void 0:I.apiUrl,re=(Z=window.woocommersa_data)==null?void 0:Z.nonce;await fetch(`${U}/settings`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":re},body:JSON.stringify(s)}),g(!0),t&&t(),setTimeout(()=>g(!1),3e3)}catch(U){console.error(U)}finally{h(!1)}},[ve,ce]=W.useState(!1),_e=async()=>{var I,Z;ce(!0);try{const U=(I=window.woocommersa_data)==null?void 0:I.apiUrl,re=(Z=window.woocommersa_data)==null?void 0:Z.nonce,he=await(await fetch(`${U}/settings/sms/test`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":re},body:JSON.stringify(s.sms)})).json();alert(he.message||(he.success?`اتصال برقرار شد. موجودی: ${he.balance}`:"خطا در اتصال"))}catch{alert("خطا در برقراری ارتباط با سرور.")}finally{ce(!1)}},[pe,Le]=W.useState(null),Fe=async(I,Z)=>{var re,ae,he;const U=prompt("لطفاً شماره موبایل جهت دریافت پیامک تست را وارد کنید:",s.pos_phone||"");if(U){Le(I);try{const Me=(re=window.woocommersa_data)==null?void 0:re.apiUrl,tt=(ae=window.woocommersa_data)==null?void 0:ae.nonce;let ot={};Z==="pos"?ot={order_id:"1234",name:"مشتری تست"}:Z==="abandoned"?ot={url:(he=window.woocommersa_data)==null?void 0:he.siteUrl}:ot={name:"کاربر تست",order_id:"1001",status:"تکمیل شده"};const X=await(await fetch(`${Me}/settings/sms/test-pattern`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":tt},body:JSON.stringify({settings:s,phone:U,pattern_id:I,type:Z,vars:ot})})).json();alert(X.message||(X.success?"پیامک تست با موفقیت ارسال شد.":"خطا در ارسال پیامک تست."))}catch{alert("خطا در برقراری ارتباط با سرور.")}finally{Le(null)}}},nt=()=>{var Z;const I=(Z=window.woocommersa_data)==null?void 0:Z.apiUrl;window.open(`${I}/settings/export`,"_blank")},dt=async I=>{var re;const Z=(re=I.target.files)==null?void 0:re[0];if(!Z)return;const U=new FileReader;U.onload=async ae=>{var Me,tt,ot;const he=(Me=ae.target)==null?void 0:Me.result;if(confirm("آیا از بازنشانی تمام تنظیمات و جایگزینی با فایل انتخابی مطمئن هستید؟")){h(!0);try{const lt=(tt=window.woocommersa_data)==null?void 0:tt.apiUrl,X=(ot=window.woocommersa_data)==null?void 0:ot.nonce;(await fetch(`${lt}/settings/import`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":X},body:JSON.stringify({settings_json:he})})).ok?(alert("تنظیمات با موفقیت درونریزی شد. صفحه مجدداً بارگذاری میشود."),window.location.reload()):alert("خطا در درونریزی تنظیمات.")}catch(lt){console.error(lt),alert("خطای غیرمنتظره در درونریزی.")}finally{h(!1)}}},U.readAsText(Z)},$e=[{id:"general",name:"عمومی",icon:sg},{id:"display",name:"نمایش",icon:Jp},{id:"data",name:"دیتا و تاریخچه",icon:jk},{id:"security",name:"امنیت",icon:e2},{id:"automation",name:"اتوماسیون",icon:Hr},{id:"ai",name:"هوش مصنوعی (SEO)",icon:Jc},{id:"sms",name:"سامانه پیامک",icon:rg},{id:"abandoned",name:"سبد خرید رها شده",icon:Da},{id:"pos",name:"میز فروش حضوری",icon:Zp},{id:"system",name:"وضعیت سیستم",icon:UU},{id:"logs",name:"گزارشات (Logs)",icon:qs},{id:"about",name:"راهنما و شناسنامه",icon:PU}],Re=(I,Z="product")=>{const U=Z==="product"?"visible_columns":"coupon_columns";a(re=>({...re,[U]:(re[U]||[]).includes(I)?(re[U]||[]).filter(ae=>ae!==I):[...re[U]||[],I]}))};return r?o.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[o.jsx(ur,{className:"animate-spin text-primary-600",size:40}),o.jsx("p",{className:"text-slate-500 font-bold",children:"در حال دریافت تنظیمات..."})]}):o.jsxs("div",{className:"space-y-8",dir:"rtl",children:[o.jsx("div",{className:"flex items-center justify-end",children:o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(tr,{children:m&&o.jsxs(ht.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},className:"bg-emerald-500 text-white px-6 py-2.5 rounded-2xl flex items-center gap-3 font-black text-sm shadow-premium",children:[o.jsx(ho,{size:18}),"تنظیمات با موفقیت ذخیره شد"]})}),o.jsxs("button",{onClick:te,disabled:u,className:"wm-btn-primary px-10 h-14",children:[u?o.jsx(ur,{className:"animate-spin",size:20}):o.jsx(Ak,{size:20}),"ذخیره نهایی تمامی تنظیمات"]})]})}),o.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-8 items-start",children:[o.jsxs("div",{className:"lg:col-span-1 wm-card p-4 space-y-1 bg-white/50 backdrop-blur-sm",children:[$e.map(I=>o.jsxs("button",{onClick:()=>n(I.id),className:`flex items-center gap-3 p-4 rounded-2xl text-right font-black text-[13px] transition-all duration-300 ${e===I.id?"bg-primary-600 text-white shadow-premium ring-4 ring-primary-500/10":"text-slate-500 hover:bg-slate-100/80"}`,children:[o.jsx(I.icon,{size:18,className:e===I.id?"animate-pulse":""}),I.name]},I.id)),o.jsxs("div",{className:"mt-6 p-5 rounded-3xl bg-slate-100/50 border border-slate-200/50",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx(qs,{size:16,className:"text-primary-500"}),o.jsx("span",{className:"wm-meta",children:"حالت عملکرد"})]}),o.jsxs("select",{value:s.perf_mode,onChange:I=>a({...s,perf_mode:I.target.value}),className:"wm-select h-12 text-[12px] bg-white shadow-sm",children:[o.jsx("option",{value:"small",children:"فروشگاه کوچک (<۱۰۰۰)"}),o.jsx("option",{value:"medium",children:"فروشگاه متوسط (<۵۰۰۰)"}),o.jsx("option",{value:"large",children:"فروشگاه بزرگ (>۱۰۰۰۰)"})]})]})]}),o.jsx("div",{className:"lg:col-span-3 space-y-8",children:o.jsxs("div",{className:"wm-card p-10 bg-white",children:[e==="general"&&o.jsxs(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-10",children:[o.jsxs("section",{className:"space-y-4",children:[o.jsxs("h3",{className:"wm-title-md flex items-center gap-2",children:[o.jsx(tg,{className:"text-primary-500",size:22}),"تنظیمات نمایش اصلی"]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[o.jsxs("label",{className:"wm-label",children:["تعداد محصولات در هر صفحه",o.jsx(_0,{text:"مشخص میکند در هر بار لود کردن جدول Spreadsheet، چه تعداد محصول نمایش داده شود."})]}),o.jsx("select",{value:s.items_per_page,onChange:I=>a({...s,items_per_page:parseInt(I.target.value)}),className:"wm-select h-14 bg-white",children:[10,25,50,100,200].map(I=>o.jsxs("option",{value:I,children:[I," محصول"]},I))}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("label",{className:"wm-label",children:["یکپارچهسازی سئو (SEO)",o.jsx(_0,{text:"انتخاب افزونه سئو فعال روی سایت شما برای ویرایش عنوان و توضیحات متا."})]}),o.jsxs("select",{value:s.seo_integration,onChange:I=>a({...s,seo_integration:I.target.value}),className:"wm-select h-14 bg-white",children:[o.jsx("option",{value:"disabled",children:"غیرفعال"}),o.jsx("option",{value:"rankmath",children:"RankMath"}),o.jsx("option",{value:"yoast",children:"Yoast"}),o.jsx("option",{value:"auto",children:"تشخیص خودکار"})]})]})]})]}),o.jsxs("section",{className:"space-y-6 pt-6 border-t border-slate-100",children:[o.jsxs("h3",{className:"wm-title-md flex items-center gap-2",children:[o.jsx(Fu,{className:"text-primary-500",size:22}),"مدیریت منبع برند محصولات"]}),o.jsxs("div",{className:"p-6 rounded-3xl bg-slate-50 border border-slate-100 space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("span",{className:"wm-label block",children:"نوع منبع برند"}),o.jsx("p",{className:"wm-hint",children:"نحوه شناسایی برند محصولات در فروشگاه شما."})]}),o.jsxs("select",{value:s.brand_source_type||"auto",onChange:I=>{const Z=I.target.value;a({...s,brand_source_type:Z,brand_source_slug:Z==="auto"?"":s.brand_source_slug})},className:"wm-select h-12 w-48 bg-white",children:[o.jsx("option",{value:"auto",children:"تشخیص خودکار (هوشمند)"}),o.jsx("option",{value:"taxonomy",children:"Taxonomy (دستهبندی)"}),o.jsx("option",{value:"attribute",children:"Attribute (ویژگی)"}),o.jsx("option",{value:"meta",children:"Meta (فیلد سفارشی)"})]})]}),s.brand_source_type!=="auto"&&o.jsxs("div",{className:"space-y-3 pt-6 border-t border-slate-200",children:[o.jsx("label",{className:"wm-label",children:"انتخاب منبع دقیق"}),o.jsxs("select",{value:s.brand_source_slug,onChange:I=>a({...s,brand_source_slug:I.target.value}),className:"wm-select h-14 w-full bg-white font-mono text-sm",children:[o.jsx("option",{value:"",children:"انتخاب کنید..."}),(M.sources||[]).filter(I=>I.type===s.brand_source_type).map(I=>o.jsxs("option",{value:I.slug,children:[I.label," (",I.slug,")"]},I.slug))]})]}),s.brand_source_type==="auto"&&M.active&&o.jsxs("div",{className:"flex items-center gap-2 text-xs font-bold text-emerald-600 bg-emerald-50 p-4 rounded-2xl border border-emerald-100",children:[o.jsx(ho,{size:16}),"منبع شناسایی شده فعلی: ",o.jsx("span",{className:"font-mono text-[10px] bg-emerald-100 px-2 py-0.5 rounded ml-1",children:M.active.slug})," (",M.active.type==="taxonomy"?"دستهبندی":M.active.type==="attribute"?"ویژگی":"متادیتا",")"]})]})]}),o.jsxs("section",{className:"space-y-4 pt-6 border-t border-slate-100",children:[o.jsxs("h3",{className:"wm-title-md flex items-center gap-2",children:[o.jsx(QD,{className:"text-primary-500",size:22}),"تنظیمات محاسبات سود (Financial)"]}),o.jsx("div",{className:"wm-alert-info !bg-slate-50 !border-slate-100",children:o.jsxs("div",{className:"flex items-center justify-between w-full",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("span",{className:"wm-label !m-0 block",children:"درصد هزینههای جانبی (Overhead)"}),o.jsx("p",{className:"wm-hint",children:"این درصد به صورت خودکار از قیمت فروش کسر و به بهای تمام شده اضافه میشود."})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("input",{type:"number",value:s.profit_overhead_percent,onChange:I=>a({...s,profit_overhead_percent:parseFloat(I.target.value)||0}),className:"w-24 wm-input h-11 text-center bg-white shadow-sm"}),o.jsx("span",{className:"font-bold text-slate-400",children:"٪"})]})]})})]}),o.jsxs("section",{className:"space-y-6 pt-6 border-t border-slate-100",children:[o.jsxs("h3",{id:"setting-canvas-mode",className:"wm-title-md flex items-center gap-3",children:[o.jsx(Hr,{className:"text-primary-500",size:22}),"محیط بوم اختصاصی (Canvas Mode)"]}),o.jsxs("div",{className:"p-8 rounded-[2rem] bg-primary-50/30 border border-primary-100 space-y-8",children:[o.jsxs("div",{className:"p-6 rounded-[2.5rem] bg-white border border-primary-100 flex items-start gap-6 shadow-sm",children:[o.jsx("div",{className:"p-4 bg-primary-50 rounded-2xl text-primary-600",children:o.jsx(Aae,{size:28})}),o.jsxs("div",{className:"space-y-6 flex-1",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("h4",{className:"text-lg font-black text-primary-900",children:"قلم محیط مدیریت و بوم (App Font)"}),o.jsx("p",{className:"text-xs text-slate-500 leading-relaxed font-bold",children:"قلم مورد نظر خود را برای نمایش در تمامی بخشهای افزونه انتخاب کنید."})]}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[{id:"system",name:"پیشفرض (System)",desc:"قلم استاندارد سیستم"},{id:"vazir",name:"وزیر متن (Vazir)",desc:"مدرن و خوانا"},{id:"yekan",name:"یکان بخ (Yekan Bakh)",desc:"حرفهای و محبوب"},{id:"iransans",name:"ایران سنس ایکس",desc:"استاندارد و زیبا (FaNum)"}].map(I=>o.jsxs("button",{onClick:()=>a({...s,canvas_font:I.id}),className:`p-5 rounded-2xl text-right border-2 transition-all group ${s.canvas_font===I.id?"border-primary-500 bg-primary-50 shadow-lg shadow-primary-500/10":"border-slate-50 bg-slate-50/50 hover:bg-white hover:border-primary-200"}`,children:[o.jsx("div",{className:`font-black text-sm transition-colors ${s.canvas_font===I.id?"text-primary-900":"text-slate-700"}`,children:I.name}),o.jsx("div",{className:"text-[10px] text-slate-400 mt-1 font-bold",children:I.desc})]},I.id))})]})]}),o.jsx("div",{className:"h-px bg-primary-100/50 mx-4"}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("span",{className:"wm-label block",children:"فعالسازی حالت بوم اختصاصی"}),o.jsx("p",{className:"wm-hint",children:"استفاده از افزونه در یک صفحه اختصاصی و تمامصفحه بدون مزاحمت منوهای وردپرس."})]}),o.jsx("div",{className:`w-14 h-7 rounded-full transition-all relative cursor-pointer flex items-center px-1 ${s.canvas_mode?"bg-primary-600 justify-start":"bg-slate-300 justify-end"}`,onClick:()=>a({...s,canvas_mode:!s.canvas_mode}),children:o.jsx("div",{className:"w-5 h-5 bg-white rounded-full shadow-sm transition-all"})})]}),o.jsx(tr,{children:s.canvas_mode&&o.jsxs(ht.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"space-y-6 overflow-hidden",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx("label",{className:"wm-label block pr-2",children:"آدرس اختصاصی (Slug)"}),o.jsxs("div",{className:"flex items-center gap-3",dir:"ltr",children:[o.jsxs("span",{className:"text-slate-400 font-mono text-sm",children:[((Ze=window.woocommersa_data)==null?void 0:Ze.siteUrl)||"","/"]}),o.jsx("input",{type:"text",value:s.canvas_slug,onChange:I=>a({...s,canvas_slug:I.target.value}),className:"flex-1 h-14 px-6 rounded-2xl border border-slate-200 outline-none focus:border-primary-500 font-mono text-sm bg-white",placeholder:"woocommersa-app"})]}),o.jsx("p",{className:"wm-hint text-right italic",children:"آدرسی که برای دسترسی به محیط بوم اختصاصی استفاده خواهید کرد."})]}),o.jsxs("div",{className:"p-5 rounded-3xl bg-white border border-primary-100 flex items-start gap-4 shadow-sm group hover:border-primary-400 transition-all",children:[o.jsx("div",{className:"p-3 bg-primary-50 rounded-2xl text-primary-600 group-hover:bg-primary-600 group-hover:text-white transition-all",children:o.jsx(am,{size:24})}),o.jsxs("div",{className:"flex-1 space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("h4",{className:"wm-label text-primary-900 mb-0",children:"قابلیت اپلیکیشن پیشرو (PWA)"}),o.jsx("p",{className:"wm-hint text-slate-600 italic leading-relaxed",children:"تبدیل محیط بوم و میز فروش به یک اپلیکیشن قابل نصب در دسکتاپ و موبایل."})]}),o.jsx("div",{className:`w-12 h-6 rounded-full transition-all relative cursor-pointer flex items-center px-1 shadow-inner ${s.pos_pwa_enabled?"bg-emerald-500 justify-start":"bg-slate-300 justify-end"}`,onClick:()=>a({...s,pos_pwa_enabled:!s.pos_pwa_enabled}),children:o.jsx("div",{className:"w-4 h-4 bg-white rounded-full shadow-md transition-all"})})]}),s.pos_pwa_enabled&&o.jsx("div",{className:"p-4 bg-emerald-50 rounded-2xl border border-emerald-100 animate-in fade-in slide-in-from-top-2",children:o.jsxs("p",{className:"text-[11px] text-emerald-700 font-bold leading-relaxed",children:[o.jsx(ho,{size:14,className:"inline-block ml-1"}),"قابلیت نصب فعال شد. اکنون کاربران میتوانند با کلیک روی آیکون نصب در مرورگر، ووکامرسا را به عنوان یک برنامه مستقل ذخیره کنند."]})})]})]}),o.jsx("div",{className:"flex gap-4",children:o.jsxs("a",{href:`${((Ee=window.woocommersa_data)==null?void 0:Ee.siteUrl)||""}/${s.canvas_slug}`,target:"_blank",rel:"noreferrer",className:"flex-1 h-14 flex items-center justify-center gap-2 bg-primary-600 text-white rounded-2xl wm-label hover:bg-primary-700 transition-all shadow-lg shadow-primary-500/20",children:[o.jsx(Jp,{size:20}),"ورود به محیط بوم (Canvas)"]})})]})})]})]}),o.jsxs("section",{className:"space-y-6 pt-6 border-t border-slate-100",children:[o.jsxs("h3",{className:"text-xl font-black text-slate-800 flex items-center gap-2",children:[o.jsx(ur,{className:"text-amber-500",size:22}),"بازگشت و ذخیره خودکار"]}),o.jsxs("div",{className:"p-6 rounded-3xl bg-amber-50/50 border border-amber-100 space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsxs("span",{className:"font-black text-slate-800 flex items-center gap-1",children:["ایجاد Snapshot قبل از تغییرات دسته جمعی",o.jsx(_0,{text:"قبل از هر عملیات حجیم، یک کپی از وضعیت فعلی ذخیره میشود تا در صورت اشتباه بتوانید آن را بازگردانید."})]}),o.jsx("p",{className:"text-xs text-slate-500",children:"یک نسخه پشتیبان موقت برای بازگردانی سریع ایجاد میشود."})]}),o.jsx("div",{className:`w-14 h-7 rounded-full transition-all relative cursor-pointer flex items-center px-1 ${s.auto_rollback?"bg-amber-500 justify-start":"bg-slate-300 justify-end"}`,onClick:()=>a({...s,auto_rollback:!s.auto_rollback}),children:o.jsx("div",{className:"w-5 h-5 bg-white rounded-full shadow-sm transition-all"})})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 pt-2",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-xs font-bold text-slate-500 pr-2",children:"مدت نگهداری Snapshot"}),o.jsxs("select",{value:s.rollback_retention,onChange:I=>a({...s,rollback_retention:RY(I.target.value)}),className:"w-full p-3 rounded-xl bg-white border border-slate-200 font-bold text-sm",children:[o.jsx("option",{value:7,children:"۷ روز"}),o.jsx("option",{value:14,children:"۱۴ روز"}),o.jsx("option",{value:30,children:"۳۰ روز"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("label",{className:"text-xs font-bold text-slate-500 pr-2",children:["حداکثر تعداد Snapshot",o.jsx(_0,{text:"تعداد کل نسخههای پشتیبان که در سیستم ذخیره میشود. قدیمیترینها به صورت خودکار حذف میشوند."})]}),o.jsxs("select",{value:s.rollback_max_snapshots,onChange:I=>a({...s,rollback_max_snapshots:RY(I.target.value)}),className:"w-full p-3 rounded-xl bg-white border border-slate-200 font-bold text-sm",children:[o.jsx("option",{value:10,children:"۱۰ مورد"}),o.jsx("option",{value:20,children:"۲۰ مورد"}),o.jsx("option",{value:50,children:"۵۰ مورد"})]})]})]})]}),o.jsxs("div",{className:"flex items-center justify-between p-6 rounded-3xl bg-slate-50 border border-slate-100",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsxs("span",{className:"font-black text-slate-800 text-sm",children:["حالت ذخیرهسازی تغییرات",o.jsx(_0,{text:"حالت خودکار تغییرات را لحظهای ثبت میکند (مشابه گوگل شیت). حالت دستی امکان اعمال تغییرات متعدد و ذخیره با یک دکمه را فراهم میکند."})]}),o.jsx("p",{className:"text-xs text-slate-500",children:"نحوه ذخیره اطلاعات در نمای اکسل"})]}),o.jsxs("select",{value:s.save_mode||"auto",onChange:I=>a({...s,save_mode:I.target.value}),className:"p-3 rounded-xl bg-white border border-slate-200 font-bold text-xs",children:[o.jsx("option",{value:"auto",children:"خودکار (سریع)"}),o.jsx("option",{value:"manual",children:"دستی (گروهی)"})]})]}),o.jsxs("div",{className:"flex items-center justify-between p-6 rounded-3xl bg-slate-900 text-white border border-slate-800 shadow-xl",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsxs("span",{className:"font-black flex items-center gap-2",children:[o.jsx(og,{className:"text-emerald-500",size:18}),"حالت ایمن (Safe Mode)",o.jsx(_0,{text:"در این حالت، پردازشها با سرعت کمتر و دقت بیشتر انجام میشوند تا از فشار به سرور جلوگیری شود."})]}),o.jsx("p",{className:"text-[10px] text-slate-400 font-bold",children:"کاهش سرعت پردازش برای پایداری بیشتر"})]}),o.jsx("div",{className:`w-14 h-7 rounded-full transition-all relative cursor-pointer flex items-center px-1 ${s.job_safe_mode?"bg-emerald-500 justify-start":"bg-slate-700 justify-end"}`,onClick:()=>a({...s,job_safe_mode:!s.job_safe_mode}),children:o.jsx(ht.div,{layout:!0,className:"w-5 h-5 bg-white rounded-full shadow-lg"})})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 pt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"wm-label block pr-2",children:"تعداد تلاش مجدد (Retries)"}),o.jsxs("select",{value:s.job_retry_limit,onChange:I=>a({...s,job_retry_limit:parseInt(I.target.value)}),className:"w-full h-14 px-6 rounded-2xl bg-white border border-slate-200 font-bold outline-none",children:[o.jsx("option",{value:1,children:"۱ بار"}),o.jsx("option",{value:3,children:"۳ بار (پیشفرض)"}),o.jsx("option",{value:5,children:"۵ بار"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"wm-label block pr-2",children:"آستانه خطای مجاز (٪)"}),o.jsxs("div",{className:"relative",children:[o.jsx("input",{type:"number",value:s.job_error_threshold,onChange:I=>a({...s,job_error_threshold:parseInt(I.target.value)}),className:"w-full h-14 px-6 rounded-2xl bg-white border border-slate-200 font-bold outline-none"}),o.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 font-bold",children:"٪"})]})]})]}),o.jsxs("div",{className:"flex items-center justify-between p-6 rounded-3xl bg-slate-900 text-white border border-slate-800 shadow-xl",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsxs("span",{className:"font-black flex items-center gap-2",children:[o.jsx(qs,{className:"text-primary-500",size:18}),"حالت عیبیابی (Debug Mode)",o.jsx(_0,{text:"با فعال کردن این گزینه، تمامی رویدادهای سیستم با جزئیات کامل در فایل لاگ ذخیره میشوند. فقط در زمان عیبیابی فعال کنید."})]}),o.jsx("p",{className:"text-[10px] text-slate-400 font-bold",children:"ثبت وقایع سیستمی با جزئیات فنی"})]}),o.jsx("div",{className:`w-14 h-7 rounded-full transition-all relative cursor-pointer flex items-center px-1 ${s.debug_mode?"bg-primary-500 justify-start":"bg-slate-700 justify-end"}`,onClick:()=>a({...s,debug_mode:!s.debug_mode}),children:o.jsx(ht.div,{layout:!0,className:"w-5 h-5 bg-white rounded-full shadow-lg"})})]})]})]}),e==="display"&&o.jsxs(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-10",children:[o.jsxs("section",{className:"space-y-6",children:[o.jsx("h3",{className:"text-xl font-black text-slate-800",children:"ستونهای قابل نمایش"}),o.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:MH().map(I=>{var ae;const Z=I.key==="vendor_name",U=(ae=window.woocommersa_data)==null?void 0:ae.hasDokan,re=Z&&!U;return o.jsxs("div",{className:"relative group",children:[o.jsxs("label",{className:`flex items-center gap-3 p-4 rounded-2xl border-2 transition-all ${re?"opacity-50 cursor-not-allowed border-slate-100 bg-slate-50/10":s.visible_columns.includes(I.key)?"border-primary-500 bg-primary-50/30 cursor-pointer":"border-slate-50 bg-slate-50/30 cursor-pointer"}`,children:[o.jsx("input",{type:"checkbox",checked:s.visible_columns.includes(I.key)&&!re,onChange:()=>!re&&Re(I.key),className:"hidden",disabled:re}),o.jsx("div",{className:`w-5 h-5 rounded-md border-2 flex items-center justify-center ${s.visible_columns.includes(I.key)&&!re?"bg-primary-600 border-primary-600 text-white":"border-slate-300"}`,children:s.visible_columns.includes(I.key)&&!re&&o.jsx(ho,{size:12})}),o.jsx("span",{className:"text-sm font-bold text-slate-700",children:I.label})]}),re&&o.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 hidden group-hover:block w-40 p-2 bg-slate-800 text-white text-[10px] rounded-lg shadow-xl z-50 text-center font-bold",children:["نیازمند افزونه دکان",o.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-slate-800"})]})]},I.key)})})]}),o.jsxs("section",{className:"space-y-6 pt-8 border-t border-slate-100",children:[o.jsx("h3",{className:"text-xl font-black text-slate-800",children:"ستونهای جدول کوپنها"}),o.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:[{id:"code",name:"کد کوپن"},{id:"type",name:"نوع تخفیف"},{id:"amount",name:"مقدار تخفیف"},{id:"expiry_date",name:"تاریخ انقضا"},{id:"usage_limit",name:"حد استفاده"},{id:"usage_count",name:"تعداد استفاده"},{id:"minimum_amount",name:"حداقل خرید"},{id:"maximum_amount",name:"حداکثر خرید"},{id:"description",name:"توضیحات"}].map(I=>o.jsxs("label",{className:`flex items-center gap-3 p-4 rounded-2xl border-2 cursor-pointer transition-all ${s.coupon_columns.includes(I.id)?"border-primary-500 bg-primary-50/30":"border-slate-50 bg-slate-50/30"}`,children:[o.jsx("input",{type:"checkbox",checked:s.coupon_columns.includes(I.id),onChange:()=>Re(I.id,"coupon"),className:"hidden"}),o.jsx("div",{className:`w-5 h-5 rounded-md border-2 flex items-center justify-center ${s.coupon_columns.includes(I.id)?"bg-primary-600 border-primary-600 text-white":"border-slate-300"}`,children:s.coupon_columns.includes(I.id)&&o.jsx(ho,{size:12})}),o.jsx("span",{className:"text-sm font-bold text-slate-700",children:I.name})]},I.id))})]}),o.jsxs("section",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 pt-8 border-t border-slate-100",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsx("label",{className:"text-sm font-black text-slate-700 pr-2",children:"نمایش محصولات متغیر"}),o.jsx("div",{className:"space-y-2",children:[{id:"parent_only",name:"فقط محصول اصلی"},{id:"expandable",name:"محصول + متغیرها (بازشونده)"},{id:"variations_only",name:"فقط متغیرها"}].map(I=>o.jsx("button",{onClick:()=>a({...s,variable_display_mode:I.id}),className:`w-full p-4 rounded-xl text-right text-sm font-bold border-2 transition-all ${s.variable_display_mode===I.id?"border-primary-500 bg-primary-50 text-primary-700":"border-slate-100 text-slate-500"}`,children:I.name},I.id))})]}),o.jsxs("div",{className:"space-y-8",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsx("label",{className:"text-sm font-black text-slate-700 pr-2",children:"حالت جدول"}),o.jsxs("div",{className:"flex gap-4",children:[o.jsx("button",{onClick:()=>a({...s,table_mode:"simple"}),className:`flex-1 p-4 rounded-xl font-bold border-2 ${s.table_mode==="simple"?"border-primary-500 bg-primary-50":"border-slate-100"}`,children:"ساده"}),o.jsx("button",{onClick:()=>a({...s,table_mode:"excel"}),className:`flex-1 p-4 rounded-xl font-bold border-2 ${s.table_mode==="excel"?"border-primary-500 bg-primary-50":"border-slate-100"}`,children:"اکسل حرفهای"})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("label",{className:"text-sm font-black text-slate-700 pr-2",children:"اندازه تصویر محصول"}),o.jsx("div",{className:"flex gap-2",children:["small","medium","large"].map(I=>o.jsx("button",{onClick:()=>a({...s,image_size:I}),className:`flex-1 py-3 rounded-xl text-xs font-black uppercase border-2 ${s.image_size===I?"border-primary-500 bg-primary-50":"border-slate-100"}`,children:I},I))})]})]})]})]}),e==="data"&&o.jsxs(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-10",children:[o.jsxs("div",{className:"flex items-center justify-between p-6 rounded-3xl bg-indigo-50/50 border border-indigo-100",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("span",{className:"font-black text-slate-800",children:"ثبت تاریخچه تغییرات (History)"}),o.jsx("p",{className:"text-xs text-slate-500",children:"تمام تغییرات قیمت، موجودی و سئو ثبت و قابل بازگشت باشد."})]}),o.jsx("div",{className:`w-14 h-7 rounded-full transition-all relative cursor-pointer flex items-center px-1 ${s.enable_history?"bg-indigo-600 justify-start":"bg-slate-300 justify-end"}`,onClick:()=>a({...s,enable_history:!s.enable_history}),children:o.jsx("div",{className:"w-5 h-5 bg-white rounded-full shadow-sm transition-all"})})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsx("label",{className:"text-sm font-black text-slate-700 pr-2",children:"حداکثر رکوردهای تاریخچه"}),o.jsxs("select",{value:s.max_history_records,onChange:I=>a({...s,max_history_records:parseInt(I.target.value)}),className:"w-full p-4 rounded-2xl bg-slate-50 border border-slate-200 font-bold outline-none",children:[o.jsx("option",{value:1e3,children:"۱۰۰۰ رکورد (بهینه)"}),o.jsx("option",{value:5e3,children:"۵۰۰۰ رکورد"}),o.jsx("option",{value:1e4,children:"۱۰۰۰۰ رکورد"})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("label",{className:"text-sm font-black text-slate-700 pr-2",children:"پاکسازی خودکار تاریخچه"}),o.jsxs("select",{value:s.history_cleanup_days,onChange:I=>a({...s,history_cleanup_days:parseInt(I.target.value)}),className:"w-full p-4 rounded-2xl bg-slate-50 border border-slate-200 font-bold outline-none",children:[o.jsx("option",{value:7,children:"بعد از ۷ روز"}),o.jsx("option",{value:30,children:"بعد از ۳۰ روز"}),o.jsx("option",{value:90,children:"بعد از ۹۰ روز"})]})]})]}),o.jsxs("div",{className:"p-10 rounded-[2.5rem] bg-indigo-50 border-2 border-indigo-100 border-dashed space-y-6",children:[o.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between gap-6",children:[o.jsxs("div",{className:"space-y-1 text-center md:text-right",children:[o.jsxs("h4",{className:"font-black text-indigo-900 flex items-center gap-2 justify-center md:justify-start",children:[o.jsx(om,{size:20}),"برونبری تنظیمات (Export)"]}),o.jsx("p",{className:"text-xs text-indigo-700 font-bold",children:"یک فایل پشتیبان کامل از تمامی تنظیمات فعلی افزونه دریافت کنید."})]}),o.jsxs("button",{onClick:nt,className:"h-14 px-10 bg-indigo-600 text-white rounded-2xl font-black text-sm hover:bg-indigo-700 shadow-xl shadow-indigo-500/20 transition-all flex items-center gap-3 active:scale-95",children:[o.jsx(om,{size:20}),"دانلود فایل تنظیمات (JSON)"]})]}),o.jsx("div",{className:"h-px bg-indigo-200"}),o.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between gap-6",children:[o.jsxs("div",{className:"space-y-1 text-center md:text-right",children:[o.jsxs("h4",{className:"font-black text-slate-800 flex items-center gap-2 justify-center md:justify-start",children:[o.jsx(i2,{size:20}),"درونریزی تنظیمات (Import)"]}),o.jsx("p",{className:"text-xs text-slate-500 font-bold italic",children:"جایگزینی تنظیمات فعلی با تنظیمات یک فایل پشتیبان قدیمی."})]}),o.jsxs("div",{className:"relative overflow-hidden",children:[o.jsx("input",{type:"file",accept:".json",onChange:dt,className:"absolute inset-0 opacity-0 cursor-pointer z-10"}),o.jsxs("button",{className:"h-14 px-10 bg-white text-slate-600 border-2 border-slate-200 rounded-2xl font-black text-sm hover:bg-slate-50 transition-all flex items-center gap-3",children:[o.jsx(i2,{size:20}),"انتخاب فایل و درونریزی"]})]})]})]})]}),e==="security"&&o.jsx(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-10",children:o.jsxs("section",{className:"space-y-8",children:[o.jsxs("div",{className:"p-8 rounded-[2rem] bg-rose-50/50 border border-rose-100 space-y-6",children:[o.jsxs("h4",{className:"font-black text-rose-800 text-lg flex items-center gap-2",children:[o.jsx(e2,{size:20})," محدودیتهای امنیتی"]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx("label",{className:"text-sm font-bold text-slate-700 pr-2",children:"حداکثر درصد تغییر قیمت مجاز"}),o.jsxs("select",{value:s.price_limit,onChange:I=>a({...s,price_limit:I.target.value}),className:"w-full p-4 rounded-2xl bg-white border border-rose-200 font-bold",children:[o.jsx("option",{value:"none",children:"بدون محدودیت"}),o.jsx("option",{value:"10",children:"۱۰ درصد"}),o.jsx("option",{value:"20",children:"۲۰ درصد"}),o.jsx("option",{value:"50",children:"۵۰ درصد"})]}),o.jsx("p",{className:"text-[10px] text-rose-600 font-bold",children:"مانع از بروز اشتباهات فاحش در قیمتگذاری میشود."})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx("label",{className:"text-sm font-bold text-slate-700 pr-2",children:"تایید تغییرات بزرگ"}),o.jsxs("div",{className:"flex items-center justify-between p-4 bg-white rounded-2xl border border-rose-100",children:[o.jsx("span",{className:"text-xs font-bold text-slate-600",children:"در تغییرات بیش از ۱۰۰ محصول"}),o.jsx("input",{type:"checkbox",checked:s.confirm_large_changes,onChange:I=>a({...s,confirm_large_changes:I.target.checked}),className:"w-5 h-5 accent-rose-500"})]})]})]})]}),o.jsxs("div",{className:"space-y-6",children:[o.jsx("h4",{className:"font-black text-slate-800 text-lg",children:"سطح دسترسی کاربران"}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:["administrator","shop_manager"].map(I=>o.jsxs("label",{className:"flex items-center justify-between p-5 rounded-3xl bg-slate-50 border border-slate-100 cursor-pointer",children:[o.jsx("span",{className:"font-bold text-slate-700 capitalize",children:I.replace("_"," ")}),o.jsx("input",{type:"checkbox",checked:s.allowed_roles.includes(I),onChange:()=>{const Z=s.allowed_roles.includes(I)?s.allowed_roles.filter(U=>U!==I):[...s.allowed_roles,I];a({...s,allowed_roles:Z})},className:"w-5 h-5 accent-primary-600"})]},I))})]})]})}),e==="automation"&&o.jsxs(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-10",children:[o.jsxs("div",{className:"flex items-center justify-between p-8 rounded-[2rem] bg-green-50/50 border border-green-100 shadow-sm shadow-green-500/5",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("span",{className:"text-xl font-black text-green-900 block",children:"فعالسازی قوانین اتوماسیون"}),o.jsx("p",{className:"text-sm text-green-700/70 max-w-md",children:'با فعالسازی این گزینه، قوانین تعریف شده در بخش "اتوماسیون قیمت" به صورت خودکار و در زمانهای مشخص اجرا میشوند.'})]}),o.jsx("div",{className:`w-16 h-8 rounded-full transition-all relative cursor-pointer ${s.enable_automation?"bg-green-600":"bg-slate-300"}`,onClick:()=>a({...s,enable_automation:!s.enable_automation}),children:o.jsx("div",{className:`w-6 h-6 bg-white rounded-full absolute top-1 transition-all ${s.enable_automation?"left-1":"left-9"}`})})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsx("label",{className:"text-sm font-black text-slate-700 pr-2",children:"زمانبندی اجرای قوانین"}),o.jsxs("select",{value:s.automation_interval,onChange:I=>a({...s,automation_interval:I.target.value}),className:"w-full p-4 rounded-2xl bg-slate-50 border border-slate-200 font-bold outline-none transition-all focus:bg-white focus:border-green-500",children:[o.jsx("option",{value:"hourly",children:"هر ساعت"}),o.jsx("option",{value:"daily",children:"روزانه (پیشنهادی)"}),o.jsx("option",{value:"weekly",children:"هفتگی"})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("label",{className:"text-sm font-black text-slate-700 pr-2",children:"رفتار با محصولات تخفیفدار"}),o.jsxs("select",{value:s.automation_sale_behavior,onChange:I=>a({...s,automation_sale_behavior:I.target.value}),className:"w-full p-4 rounded-2xl bg-slate-50 border border-slate-200 font-bold outline-none transition-all focus:bg-white focus:border-green-500",children:[o.jsx("option",{value:"skip",children:"قانون بر روی محصولات دارای تخفیف اجرا نشود"}),o.jsx("option",{value:"apply_regular",children:"روی قیمت اصلی (Regular) اعمال شود"}),o.jsx("option",{value:"apply_sale",children:"روی قیمت تخفیف (Sale) اعمال شود"})]})]})]}),o.jsxs("label",{className:"flex items-center gap-4 p-6 rounded-3xl bg-slate-50 border border-slate-100 cursor-pointer group hover:bg-white hover:border-green-200 transition-all",children:[o.jsx("input",{type:"checkbox",checked:s.log_automation,onChange:I=>a({...s,log_automation:I.target.checked}),className:"w-6 h-6 accent-green-600 transition-all"}),o.jsxs("div",{className:"space-y-0.5",children:[o.jsx("span",{className:"font-bold text-slate-800",children:"ذخیره لاگ اجرای قوانین"}),o.jsx("p",{className:"text-xs text-slate-500",children:"مشاهده گزارش دقیق از هر بار اجرای خودکار قوانین در بخش تاریخچه."})]})]})]}),e==="sms"&&o.jsxs(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-12",children:[o.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between p-8 rounded-[2.5rem] bg-indigo-50/50 border border-indigo-100 gap-6",children:[o.jsxs("div",{className:"space-y-2 text-center md:text-right",children:[o.jsxs("h3",{className:"text-2xl font-black text-indigo-900 flex items-center gap-3 justify-center md:justify-start",children:[o.jsx(Ok,{className:"text-indigo-600",size:28}),"تنظیمات درگاه پیامک"]}),o.jsx("p",{className:"text-sm text-indigo-700/70 font-bold",children:"برای ارسال خودکار وضعیت سفارش و کد رهگیری، درگاه خود را تنظیم کنید."})]}),o.jsxs("button",{onClick:_e,disabled:ve,className:"h-14 px-8 bg-white border-2 border-indigo-200 text-indigo-600 rounded-2xl font-black text-sm hover:bg-indigo-50 transition-all flex items-center gap-3 shadow-xl shadow-indigo-500/10 disabled:opacity-50",children:[ve?o.jsx(ur,{className:"animate-spin",size:20}):o.jsx(Hr,{size:20}),"تست اتصال و موجودی"]})]}),o.jsxs("section",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 p-8 rounded-[2rem] bg-slate-50 border border-slate-100",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"wm-label block pr-2",children:"انتخاب درگاه پیامکی"}),o.jsxs("select",{value:((Q=s.sms)==null?void 0:Q.gateway)||"ippanel",onChange:I=>a({...s,sms:{...s.sms,gateway:I.target.value}}),className:"w-full h-14 px-6 rounded-2xl bg-white border border-slate-200 wm-hint outline-none focus:ring-4 focus:ring-indigo-500/10 transition-all",children:[o.jsx("option",{value:"ippanel",children:"IPPanel (آیپی پنل)"}),o.jsx("option",{value:"farazsms",children:"Faraz SMS (فراز اساماس)"}),o.jsx("option",{value:"kavehnegar",children:"Kavehnegar (کاوه نگار)"}),o.jsx("option",{value:"smsir",children:"Sms.ir (پنل جدید v2)"}),o.jsx("option",{value:"melipayamak",children:"Meli Payamak (ملیپیامک)"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"wm-label block pr-2",children:((fe=s.sms)==null?void 0:fe.gateway)==="melipayamak"?"نام کاربری پنل":"کلید API (API Key)"}),o.jsx("input",{type:((Ve=s.sms)==null?void 0:Ve.gateway)==="melipayamak"?"text":"password",value:((xe=s.sms)==null?void 0:xe[((ne=s.sms)==null?void 0:ne.gateway)==="melipayamak"?"username":"api_key"])||"",onChange:I=>{var Z;return a({...s,sms:{...s.sms,[((Z=s.sms)==null?void 0:Z.gateway)==="melipayamak"?"username":"api_key"]:I.target.value}})},className:"w-full h-14 px-6 rounded-2xl bg-white border border-slate-200 wm-hint outline-none focus:ring-4 focus:ring-indigo-500/10 text-left font-mono transition-all",placeholder:((Ke=s.sms)==null?void 0:Ke.gateway)==="melipayamak"?"Username":"XXXX-XXXX-XXXX-XXXX"})]}),((qe=s.sms)==null?void 0:qe.gateway)==="melipayamak"&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"wm-label block pr-2",children:"رمز عبور پنل"}),o.jsx("input",{type:"password",value:((we=s.sms)==null?void 0:we.password)||"",onChange:I=>a({...s,sms:{...s.sms,password:I.target.value}}),className:"w-full h-14 px-6 rounded-2xl bg-white border border-slate-200 wm-hint outline-none focus:ring-4 focus:ring-indigo-500/10 text-left font-mono transition-all",placeholder:"Password"})]}),(((k=s.sms)==null?void 0:k.gateway)==="ippanel"||((_=s.sms)==null?void 0:_.gateway)==="farazsms")&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"wm-label block pr-2",children:"شماره فرستنده (Originator)"}),o.jsx("input",{type:"text",value:((N=s.sms)==null?void 0:N.originator)||"",onChange:I=>a({...s,sms:{...s.sms,originator:I.target.value}}),className:"w-full h-14 px-6 rounded-2xl bg-white border border-slate-200 wm-hint outline-none focus:ring-4 focus:ring-indigo-500/10 text-left font-mono transition-all",placeholder:"+98100011"}),o.jsx("p",{className:"text-[10px] text-slate-400 font-bold pr-2 italic",children:"مخصوص پنلهای IPPanel. اگر متغیر است خالی بگذارید."})]})]}),o.jsxs("section",{className:"space-y-6 pt-10 border-t border-slate-100",children:[o.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[o.jsx("div",{className:"p-2 bg-indigo-50 rounded-lg text-indigo-600",children:o.jsx(tg,{size:20})}),o.jsx("h3",{className:"text-xl font-black text-slate-800",children:"تنظیمات کدهای الگو (Pattern Codes)"})]}),o.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-100 mb-8 flex items-start gap-4",children:[o.jsx("div",{className:"p-3 bg-white rounded-2xl text-amber-500 shadow-sm",children:o.jsx(Cx,{size:24})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-black text-slate-800",children:"راهنمای متغیرهای الگو:"}),o.jsxs("p",{className:"text-xs text-slate-500 leading-relaxed font-bold",children:["در وبسرویس خود الگوها را بسازید. متغیرهای زیر در زمان ارسال جایگزین میشوند:",o.jsx("br",{}),o.jsx("code",{className:"text-indigo-600 mx-1",children:"%name%"}),": نام مشتری |",o.jsx("code",{className:"text-indigo-600 mx-1",children:"%order_id%"}),": شماره سفارش |",o.jsx("code",{className:"text-indigo-600 mx-1",children:"%status%"}),": وضعیت سفارش |",o.jsx("code",{className:"text-indigo-600 mx-1",children:"%tracking_code%"}),": کد رهگیری"]})]})]}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[{id:"status_pending",name:"در انتظار پرداخت"},{id:"status_processing",name:"در حال انجام"},{id:"status_on_hold",name:"در انتظار بررسی"},{id:"status_completed",name:"تکمیل شده"},{id:"status_cancelled",name:"لغو شده"},{id:"tracking_added",name:"ارسال کد رهگیری پستی",highlight:!0}].map(I=>{var Z,U,re,ae,he,Me,tt,ot,lt,X;return o.jsxs("div",{className:`p-6 rounded-3xl border transition-all ${I.highlight?"bg-primary-50/30 border-primary-200":"bg-white border-slate-100"}`,children:[o.jsxs("div",{className:"flex items-center justify-between mb-3",children:[o.jsx("span",{className:"font-black text-slate-800 text-sm",children:I.name}),o.jsx("div",{className:`w-2 h-2 rounded-full ${(U=(Z=s.sms)==null?void 0:Z.patterns)!=null&&U[I.id]?"bg-green-500":"bg-slate-200"}`})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{type:"text",value:((ae=(re=s.sms)==null?void 0:re.patterns)==null?void 0:ae[I.id])||"",onChange:de=>{const Ce={...s.sms.patterns,[I.id]:de.target.value};a({...s,sms:{...s.sms,patterns:Ce}})},className:"flex-1 h-12 px-5 rounded-xl bg-white border border-slate-200 wm-hint outline-none focus:border-indigo-500 font-mono text-xs",placeholder:"کد الگو را وارد کنید..."}),o.jsx("button",{onClick:()=>{var de,Ce;return Fe((Ce=(de=s.sms)==null?void 0:de.patterns)==null?void 0:Ce[I.id],"sms")},disabled:pe===((Me=(he=s.sms)==null?void 0:he.patterns)==null?void 0:Me[I.id])||!((ot=(tt=s.sms)==null?void 0:tt.patterns)!=null&&ot[I.id]),className:"h-12 w-12 flex items-center justify-center bg-indigo-50 text-indigo-600 rounded-xl hover:bg-indigo-100 transition-all disabled:opacity-30",title:"تست ارسال الگو",children:pe===((X=(lt=s.sms)==null?void 0:lt.patterns)==null?void 0:X[I.id])?o.jsx(ur,{className:"animate-spin",size:16}):o.jsx(Hr,{size:16})})]})]},I.id)})})]})]}),e==="pos"&&o.jsxs(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-12",children:[o.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between p-8 rounded-[2.5rem] bg-emerald-50/50 border border-emerald-100 gap-6",children:[o.jsxs("div",{className:"space-y-2 text-center md:text-right",children:[o.jsxs("h3",{className:"text-2xl font-black text-emerald-900 flex items-center gap-3 justify-center md:justify-start",children:[o.jsx(Zp,{className:"text-emerald-600",size:28}),"ماژول فروش حضوری (POS)"]}),o.jsx("p",{className:"text-sm text-emerald-700/70 font-bold",children:"مدیریت فروشگاه فیزیکی و ثبت سریع سفارشات حضوری."})]}),o.jsx("div",{className:`w-16 h-8 rounded-full transition-all relative cursor-pointer flex items-center px-1 shadow-inner ${s.pos_enabled?"bg-emerald-600 justify-start":"bg-slate-300 justify-end"}`,onClick:()=>a({...s,pos_enabled:!s.pos_enabled}),children:o.jsx("div",{className:"w-6 h-6 bg-white rounded-full shadow-lg transition-all"})})]}),s.pos_enabled&&o.jsxs("div",{className:"bg-white p-10 rounded-[3rem] border border-slate-100 space-y-10",children:[o.jsxs("div",{className:"space-y-6",children:[o.jsxs("h4",{className:"font-black text-slate-800 flex items-center gap-2",children:[o.jsx($u,{size:20,className:"text-emerald-500"}),"دسترسی به پنل"]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 items-end",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx("label",{className:"wm-label block pr-2",children:"آدرس اختصاصی (Slug)"}),o.jsxs("div",{className:"flex items-center gap-3",dir:"ltr",children:[o.jsxs("span",{className:"text-slate-400 font-mono text-sm",children:[((O=window.woocommersa_data)==null?void 0:O.siteUrl)||"","/"]}),o.jsx("input",{type:"text",value:s.pos_slug,onChange:I=>a({...s,pos_slug:I.target.value}),className:"flex-1 h-14 px-4 rounded-2xl bg-white border border-slate-200 outline-none focus:border-emerald-500 font-mono text-sm shadow-inner",placeholder:"pos"})]})]}),o.jsxs("a",{href:`${((G=window.woocommersa_data)==null?void 0:G.siteUrl)||""}/${s.pos_slug}`,target:"_blank",rel:"noreferrer",className:"flex items-center justify-center gap-3 h-14 bg-emerald-600 hover:bg-emerald-700 text-white rounded-2xl font-black text-sm transition-all shadow-xl shadow-emerald-500/20 group",children:[o.jsx(Jp,{size:20,className:"group-hover:scale-110 transition-transform"}),"ورود به میز فروش حضوری (POS)",o.jsx($u,{size:16,className:"opacity-50"})]})]})]}),o.jsx("hr",{className:"border-slate-100"}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("h4",{className:"font-black text-slate-800 flex items-center gap-2",children:[o.jsx(Pk,{size:20,className:"text-amber-500"}),"تنظیمات فاکتور حرارتی"]}),o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"wm-label block pr-2",children:"نام فروشگاه در فاکتور"}),o.jsx("input",{type:"text",value:s.pos_shop_name,onChange:I=>a({...s,pos_shop_name:I.target.value}),className:"w-full h-14 px-5 rounded-2xl bg-slate-50 border border-slate-100 font-bold text-sm shadow-inner",placeholder:"مثلاً فروشگاه آنلاین من"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"wm-label block pr-2",children:"شماره تماس فاکتور"}),o.jsx("input",{type:"text",value:s.pos_phone,onChange:I=>a({...s,pos_phone:I.target.value}),className:"w-full h-14 px-5 rounded-2xl bg-slate-50 border border-slate-100 font-bold text-sm shadow-inner",placeholder:"021..."})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"wm-label block pr-2",children:"آدرس فروشگاه در فاکتور"}),o.jsx("input",{type:"text",value:s.pos_address,onChange:I=>a({...s,pos_address:I.target.value}),className:"w-full h-14 px-5 rounded-2xl bg-slate-50 border border-slate-100 font-bold text-sm shadow-inner",placeholder:"آدرس دقیق جهت چاپ در فاکتور"})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 items-end",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx("label",{className:"wm-label block pr-2 text-[12px] h-5 mb-1",children:"مالیات و عوارض (٪)"}),o.jsxs("div",{className:"relative group",children:[o.jsx("input",{type:"number",value:s.pos_tax_percent,onChange:I=>a({...s,pos_tax_percent:parseFloat(I.target.value)||0}),className:"w-full h-14 px-5 rounded-2xl bg-slate-50 border border-slate-100 font-black text-sm shadow-inner text-center focus:bg-white focus:border-emerald-500 transition-all",placeholder:"0"}),o.jsx("span",{className:"absolute left-5 top-1/2 -translate-y-1/2 text-slate-400 font-bold opacity-50 group-focus-within:text-emerald-500 group-focus-within:opacity-100 transition-all",children:"٪"})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx("label",{className:"wm-label block pr-2 text-[12px] h-5 mb-1",children:"متن فوتر فاکتور"}),o.jsx("div",{className:"relative",children:o.jsx("input",{type:"text",value:s.pos_footer_text,onChange:I=>a({...s,pos_footer_text:I.target.value}),className:"w-full h-14 px-5 rounded-2xl bg-slate-50 border border-slate-100 font-black text-sm shadow-inner text-center focus:bg-white focus:border-emerald-500 transition-all",placeholder:"مثلاً: از خرید شما متشکریم"})})]})]})]})]}),o.jsxs("div",{className:"pt-8 border-t border-slate-100 space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("h4",{className:"font-black text-slate-800 flex items-center gap-2",children:[o.jsx(Ok,{size:18,className:"text-indigo-500"}),"اطلاعرسانی پیامکی فروش حضوری"]}),o.jsx("div",{className:`w-12 h-6 rounded-full transition-all relative cursor-pointer flex items-center px-1 shadow-inner ${s.pos_sms_enabled?"bg-indigo-600 justify-start":"bg-slate-300 justify-end"}`,onClick:()=>a({...s,pos_sms_enabled:!s.pos_sms_enabled}),children:o.jsx("div",{className:"w-4 h-4 bg-white rounded-full shadow-md transition-all"})})]}),s.pos_sms_enabled&&o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 bg-slate-50 p-10 rounded-[2.5rem] border border-slate-100 shadow-inner",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2 pr-2",children:[o.jsx(Hr,{className:"text-amber-500",size:18}),o.jsx("label",{className:"wm-label block",children:"کد پترن (Pattern ID)"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{type:"text",value:s.pos_sms_pattern,onChange:I=>a({...s,pos_sms_pattern:I.target.value}),className:"flex-1 h-14 px-6 rounded-2xl bg-white border border-slate-200 font-black text-sm outline-none focus:border-indigo-500 transition-all shadow-sm font-mono",placeholder:"مثلاً 98765"}),o.jsx("button",{onClick:()=>Fe(s.pos_sms_pattern,"pos"),disabled:pe===s.pos_sms_pattern||!s.pos_sms_pattern,className:"h-14 w-14 flex items-center justify-center bg-indigo-600 text-white rounded-2xl hover:bg-indigo-700 transition-all disabled:opacity-30 shadow-lg shadow-indigo-200",title:"تست ارسال الگو",children:pe===s.pos_sms_pattern?o.jsx(ur,{className:"animate-spin",size:20}):o.jsx(Hr,{size:20})})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2 pr-2",children:[o.jsx(rg,{className:"text-indigo-500",size:18}),o.jsx("label",{className:"wm-label block",children:"متن پیامک جایگزین (Fallback)"})]}),o.jsxs("div",{className:"relative group",children:[o.jsx("textarea",{value:s.pos_sms_template,onChange:I=>a({...s,pos_sms_template:I.target.value}),className:"w-full h-32 p-5 rounded-3xl bg-white border border-slate-200 font-bold text-[13px] outline-none focus:border-indigo-500 transition-all resize-none shadow-sm leading-relaxed",placeholder:"سلام {name} عزیز..."}),o.jsxs("div",{className:"absolute bottom-3 right-4 flex flex-wrap items-center gap-2 bg-white/90 backdrop-blur-sm p-2 rounded-xl border border-slate-100 shadow-sm opacity-60 group-hover:opacity-100 transition-opacity",children:[o.jsx("span",{className:"text-[10px] text-slate-400 font-bold",children:"متغیرها:"}),o.jsx(Q1,{label:"name",value:"name"}),o.jsx(Q1,{label:"order_id",value:"order_id"})]})]})]})]})]}),o.jsxs("div",{className:"pt-8 border-t border-slate-100 space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("h4",{className:"font-black text-slate-800 flex items-center gap-2",children:[o.jsx(WU,{size:18,className:"text-blue-500"}),"اطلاعرسانی بله فروش حضوری"]}),o.jsx("div",{className:`w-12 h-6 rounded-full transition-all relative cursor-pointer flex items-center px-1 shadow-inner ${s.pos_bale_enabled?"bg-blue-600 justify-start":"bg-slate-300 justify-end"}`,onClick:()=>a({...s,pos_bale_enabled:!s.pos_bale_enabled}),children:o.jsx("div",{className:"w-4 h-4 bg-white rounded-full shadow-md transition-all"})})]}),s.pos_bale_enabled&&o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 bg-slate-50 p-10 rounded-[2.5rem] border border-slate-100 shadow-inner",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2 pr-2",children:[o.jsx(rg,{className:"text-blue-500",size:18}),o.jsx("label",{className:"wm-label block",children:"متن پیام بله (سفیر)"})]}),o.jsx("textarea",{value:s.pos_bale_template,onChange:I=>a({...s,pos_bale_template:I.target.value}),className:"w-full h-40 p-6 rounded-3xl bg-white border border-slate-200 font-bold text-[13px] outline-none focus:border-blue-500 transition-all resize-y shadow-sm leading-relaxed",placeholder:"سلام {name} عزیز، سفارش {order_id} ثبت شد."})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2 pr-2",children:[o.jsx(Jc,{className:"text-blue-500",size:18}),o.jsx("label",{className:"wm-label block",children:"توضیحات و متغیرها"})]}),o.jsx("div",{className:"bg-white/80 backdrop-blur-sm p-8 rounded-[2rem] border border-blue-100 shadow-sm w-full",children:o.jsxs("div",{className:"text-[13px] text-blue-900 font-bold leading-relaxed",children:["این پیام از طریق سرویس سفیر بله برای مشتری ارسال میشود.",o.jsxs("div",{className:"mt-6 space-y-4",children:[o.jsx("span",{className:"text-[11px] text-slate-400 block mb-2",children:"متغیرهای قابل استفاده:"}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsx(Q1,{label:"{name}",value:"{name}",colorClass:"text-blue-600 border-blue-100"}),o.jsx(Q1,{label:"{order_id}",value:"{order_id}",colorClass:"text-blue-600 border-blue-100"}),o.jsx(Q1,{label:"{total}",value:"{total}",colorClass:"text-blue-600 border-blue-100"})]})]})]})})]})]})]})]})]}),e==="abandoned"&&o.jsxs(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-10",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[o.jsxs("div",{className:"p-8 rounded-[2.5rem] bg-rose-50/50 border border-rose-100 flex flex-col justify-between gap-6 shadow-sm",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-10 h-10 rounded-xl bg-rose-500 text-white flex items-center justify-center shadow-lg shadow-rose-500/20",children:o.jsx(Da,{size:20})}),o.jsx("h3",{className:"text-lg font-black text-rose-900",children:"سبد خرید رها شده"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("p",{className:"text-[10px] text-rose-700/60 font-bold",children:"بازگردانی هوشمند"}),o.jsx("div",{className:`w-14 h-7 rounded-full transition-all relative cursor-pointer flex items-center px-1 shadow-inner ${s.abandoned_cart_enabled?"bg-rose-500 justify-start":"bg-slate-300 justify-end"}`,onClick:()=>a({...s,abandoned_cart_enabled:!s.abandoned_cart_enabled}),children:o.jsx("div",{className:"w-5 h-5 bg-white rounded-full shadow-md transition-all"})})]})]}),o.jsxs("div",{className:"p-8 rounded-[2.5rem] bg-indigo-50/50 border border-indigo-100 flex flex-col justify-between gap-6 shadow-sm",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-10 h-10 rounded-xl bg-indigo-500 text-white flex items-center justify-center shadow-lg shadow-indigo-500/20",children:o.jsx(Hr,{size:20})}),o.jsx("h3",{className:"text-lg font-black text-indigo-900",children:"پاپآپ لحظه خروج"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("p",{className:"text-[10px] text-indigo-700/60 font-bold",children:"صید شماره موبایل"}),o.jsx("div",{className:`w-14 h-7 rounded-full transition-all relative cursor-pointer flex items-center px-1 shadow-inner ${s.abandoned_cart_exit_intent?"bg-indigo-500 justify-start":"bg-slate-300 justify-end"}`,onClick:()=>a({...s,abandoned_cart_exit_intent:!s.abandoned_cart_exit_intent}),children:o.jsx("div",{className:"w-5 h-5 bg-white rounded-full shadow-md transition-all"})})]})]}),o.jsxs("div",{className:"p-8 rounded-[2.5rem] bg-blue-50/50 border border-blue-100 flex flex-col justify-between gap-6 shadow-sm",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-500 text-white flex items-center justify-center shadow-lg shadow-blue-500/20",children:o.jsx(WU,{size:20})}),o.jsx("h3",{className:"text-lg font-black text-blue-900",children:"پیامرسان بله"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("p",{className:"text-[10px] text-blue-700/60 font-bold",children:"ارسال رایگان/سفیر"}),o.jsx("div",{className:`w-14 h-7 rounded-full transition-all relative cursor-pointer flex items-center px-1 shadow-inner ${s.bale_bot_enabled?"bg-blue-500 justify-start":"bg-slate-300 justify-end"}`,onClick:()=>a({...s,bale_bot_enabled:!s.bale_bot_enabled}),children:o.jsx("div",{className:"w-5 h-5 bg-white rounded-full shadow-md transition-all"})})]})]})]}),o.jsxs("section",{className:"p-10 rounded-[3rem] bg-white border border-slate-100 shadow-sm space-y-10",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-12 h-12 rounded-2xl bg-amber-50 text-amber-500 flex items-center justify-center",children:o.jsx(Ok,{size:24})}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-xl font-black text-slate-800",children:"تنظیمات کلی پیامک یادآوری"}),o.jsx("p",{className:"text-[11px] text-slate-400 font-bold",children:"تنظیمات پیشفرض برای تمامی پلههای بازگردانی"})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-10",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsxs("label",{className:"text-[11px] font-black text-slate-500 uppercase tracking-widest flex items-center gap-2 pr-1",children:[o.jsx(Fu,{size:14,className:"text-amber-500"})," کد الگوی پیامک (Global Pattern)"]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("input",{type:"text",value:s.abandoned_cart_pattern,onChange:I=>a({...s,abandoned_cart_pattern:I.target.value}),className:"flex-1 h-12 px-5 rounded-2xl bg-slate-50 border border-slate-100 wm-hint outline-none focus:border-amber-500 transition-all font-mono font-bold",placeholder:"مثلاً 123456"}),o.jsx("button",{onClick:()=>Fe(s.abandoned_cart_pattern,"abandoned"),disabled:pe===s.abandoned_cart_pattern||!s.abandoned_cart_pattern,className:"h-12 w-12 flex items-center justify-center bg-amber-50 text-amber-600 rounded-xl hover:bg-amber-100 transition-all disabled:opacity-30",children:pe===s.abandoned_cart_pattern?o.jsx(ur,{className:"animate-spin",size:16}):o.jsx(Hr,{size:16})})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("label",{className:"text-[11px] font-black text-slate-500 uppercase tracking-widest flex items-center gap-2 pr-1",children:[o.jsx(rg,{size:14,className:"text-indigo-500"})," قالب پیشفرض (Fallback)"]}),o.jsx("textarea",{value:s.abandoned_cart_template,onChange:I=>a({...s,abandoned_cart_template:I.target.value}),className:"w-full h-32 p-5 rounded-2xl bg-slate-50 border border-slate-100 wm-hint outline-none focus:border-indigo-500 transition-all leading-relaxed resize-y",placeholder:"متن پیامک..."})]})]})]}),s.bale_bot_enabled&&o.jsxs(ht.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},className:"grid grid-cols-1 md:grid-cols-2 gap-8 p-10 bg-blue-50/30 rounded-[3rem] border border-blue-100/50 shadow-sm overflow-hidden",children:[o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between pr-2",children:[o.jsx("label",{className:"text-[11px] font-black text-blue-900 uppercase tracking-widest",children:"توکن ربات بله (Standard Bot Token)"}),o.jsxs("a",{href:"https://ble.ir/botfather",target:"_blank",rel:"noreferrer",className:"text-[10px] font-bold text-blue-600 hover:underline flex items-center gap-1",children:[o.jsx(Cx,{size:12}),"چطور دریافت کنم؟"]})]}),o.jsx("input",{type:"text",value:s.bale_bot_token,onChange:I=>a({...s,bale_bot_token:I.target.value}),className:"w-full h-14 px-5 rounded-2xl bg-white border border-blue-200 font-bold text-xs font-mono shadow-sm outline-none focus:border-blue-500 transition-all",placeholder:"123456789:ABCDEF..."})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between pr-2",children:[o.jsx("label",{className:"text-[11px] font-black text-blue-900 uppercase tracking-widest",children:"توکن سرویس سفیر (Safir API Key)"}),o.jsxs("a",{href:"https://safir.ble.ir",target:"_blank",rel:"noreferrer",className:"text-[10px] font-bold text-blue-600 hover:underline flex items-center gap-1",children:[o.jsx(Cx,{size:12}),"چطور دریافت کنم؟"]})]}),o.jsx("input",{type:"text",value:s.bale_safir_token,onChange:I=>a({...s,bale_safir_token:I.target.value}),className:"w-full h-14 px-5 rounded-2xl bg-white border border-blue-200 font-bold text-xs font-mono shadow-sm outline-none focus:border-blue-500 transition-all",placeholder:"API Key..."})]})]}),o.jsx("div",{className:"space-y-6",children:o.jsxs("div",{className:"space-y-4",children:[o.jsx("label",{className:"text-[11px] font-black text-blue-900 uppercase tracking-widest pr-2",children:"قالب پیام اختصاصی بله"}),o.jsx("textarea",{value:s.bale_bot_template,onChange:I=>a({...s,bale_bot_template:I.target.value}),className:"w-full h-32 p-5 rounded-2xl bg-white border border-blue-200 wm-hint outline-none focus:border-blue-500 shadow-sm leading-relaxed",placeholder:"متن پیام یادآوری بله..."}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("span",{className:"text-[9px] font-black bg-white/50 text-blue-600 px-2 py-1 rounded-lg border border-blue-100",children:"{coupon}"}),o.jsx("span",{className:"text-[9px] font-black bg-white/50 text-blue-600 px-2 py-1 rounded-lg border border-blue-100",children:"{incentive}"})]})]})})]}),o.jsxs("section",{className:"space-y-10",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 pt-10 border-t border-slate-100",children:[o.jsxs("div",{className:"space-y-2 text-right",children:[o.jsxs("h4",{className:"text-2xl font-black text-slate-800 flex items-center gap-3 justify-end",children:["قوانین هوشمند بازگردانی",o.jsx(Zc,{className:"text-primary-500",size:24})]}),o.jsx("p",{className:"text-sm text-slate-400 font-bold",children:"تعیین پاداش و پترن اختصاصی برای هر مرحله"})]}),o.jsxs("button",{onClick:()=>{const I="rule_"+Math.random().toString(36).substr(2,9),Z=[...s.abandoned_cart_rules||[],{id:I,min:0,max:0,type:"percent",value:10,interval:"any",products:[],categories:[],sms:"",pattern:""}];a({...s,abandoned_cart_rules:Z})},className:"h-14 px-8 bg-primary-600 text-white rounded-2xl font-black text-sm flex items-center gap-3 hover:bg-primary-700 transition-all shadow-xl shadow-primary-500/20 active:scale-95",children:[o.jsx(m0,{size:18})," افزودن پله جدید"]})]}),o.jsx("div",{className:"grid grid-cols-1 gap-12",children:(s.abandoned_cart_rules||[]).map((I,Z)=>o.jsxs("div",{className:"p-12 rounded-[4rem] bg-white border border-slate-100 relative group animate-in fade-in slide-in-from-bottom-8 duration-700 shadow-2xl shadow-slate-200/50",children:[o.jsx("button",{onClick:()=>{const U=s.abandoned_cart_rules.filter((re,ae)=>ae!==Z);a({...s,abandoned_cart_rules:U})},className:"absolute -left-5 -top-5 w-14 h-14 bg-white text-rose-500 border-4 border-rose-50 rounded-3xl flex items-center justify-center hover:bg-rose-500 hover:text-white transition-all shadow-2xl opacity-0 group-hover:opacity-100 z-10",children:o.jsx(zu,{size:24})}),o.jsxs("div",{className:"flex flex-col gap-12",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-10",children:[o.jsxs("div",{className:"space-y-5",children:[o.jsxs("label",{className:"text-[12px] font-black text-slate-500 uppercase tracking-widest flex items-center gap-3 pr-1",children:[o.jsx("div",{className:"w-8 h-8 rounded-xl bg-indigo-50 text-indigo-500 flex items-center justify-center",children:o.jsx(Zp,{size:14})}),"محدوده مبلغ سبد خرید (تومان)"]}),o.jsxs("div",{className:"flex items-center gap-4 p-3 bg-slate-50/50 rounded-2xl border border-slate-100 shadow-inner",children:[o.jsx(zH,{value:I.min,onChange:U=>{const re=[...s.abandoned_cart_rules];re[Z].min=U,a({...s,abandoned_cart_rules:re})},placeholder:"حداقل"}),o.jsx("div",{className:"w-10 h-[2px] bg-slate-300 rounded-full flex-shrink-0"}),o.jsx(zH,{value:I.max,onChange:U=>{const re=[...s.abandoned_cart_rules];re[Z].max=U,a({...s,abandoned_cart_rules:re})},placeholder:"حداکثر"})]})]}),o.jsxs("div",{className:"space-y-5",children:[o.jsxs("label",{className:"text-[12px] font-black text-slate-500 uppercase tracking-widest flex items-center gap-3 pr-1",children:[o.jsx("div",{className:"w-8 h-8 rounded-xl bg-emerald-50 text-emerald-500 flex items-center justify-center",children:o.jsx(QD,{size:14})}),"نوع و مقدار پاداش"]}),o.jsxs("div",{className:"flex items-center gap-3 p-3 bg-slate-50/50 rounded-2xl border border-slate-100 shadow-inner",children:[o.jsxs("select",{value:I.type,onChange:U=>{const re=[...s.abandoned_cart_rules];re[Z].type=U.target.value,a({...s,abandoned_cart_rules:re})},className:"flex-1 h-14 bg-white px-4 rounded-xl border border-slate-200 font-black text-xs outline-none shadow-sm focus:border-emerald-500 transition-all",children:[o.jsx("option",{value:"percent",children:"درصدی (٪)"}),o.jsx("option",{value:"fixed",children:"مبلغ ثابت"}),o.jsx("option",{value:"free_shipping",children:"ارسال رایگان"})]}),I.type!=="free_shipping"&&o.jsx(zH,{value:I.value,onChange:U=>{const re=[...s.abandoned_cart_rules];re[Z].value=U,a({...s,abandoned_cart_rules:re})},showUnit:!0,unit:I.type==="percent"?"٪":"تومان",hideBadge:!0})]})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-10",children:[o.jsxs("div",{className:"space-y-5",children:[o.jsxs("label",{className:"text-[12px] font-black text-slate-500 uppercase tracking-widest flex items-center gap-3 pr-1",children:[o.jsx("div",{className:"w-8 h-8 rounded-xl bg-amber-50 text-amber-500 flex items-center justify-center",children:o.jsx(Qp,{size:14})}),"نوبت یادآوری (Sequence)"]}),o.jsxs("select",{value:I.interval,onChange:U=>{const re=[...s.abandoned_cart_rules];re[Z].interval=U.target.value,a({...s,abandoned_cart_rules:re})},className:"w-full h-14 bg-white px-5 rounded-2xl border border-slate-200 font-black text-xs shadow-sm outline-none focus:border-amber-400 transition-all",children:[o.jsx("option",{value:"any",children:"فرقی نمیکند (همه مراحل)"}),o.jsx("option",{value:"6h",children:"فقط مرحله اول (۶ ساعت)"}),o.jsx("option",{value:"12h",children:"فقط مرحله دوم (۱۲ ساعت)"}),o.jsx("option",{value:"1d",children:"فقط مرحله سوم (۱ روز)"}),o.jsx("option",{value:"2d",children:"مراحل بعدی (۲ روز به بالا)"})]})]}),o.jsxs("div",{className:"space-y-5",children:[o.jsxs("label",{className:"text-[12px] font-black text-slate-500 uppercase tracking-widest flex items-center gap-3 pr-1",children:[o.jsx("div",{className:"w-8 h-8 rounded-xl bg-orange-50 text-orange-500 flex items-center justify-center",children:o.jsx(Hr,{size:14})}),"کد پترن اختصاصی این پله"]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("input",{type:"text",value:I.pattern||"",onChange:U=>{const re=[...s.abandoned_cart_rules];re[Z].pattern=U.target.value,a({...s,abandoned_cart_rules:re})},className:"w-full h-14 bg-white px-5 rounded-2xl border border-slate-200 font-black text-xs shadow-sm outline-none focus:border-orange-400 transition-all font-mono",placeholder:"Pattern ID..."}),o.jsx("button",{onClick:()=>Fe(I.pattern,"abandoned"),disabled:!I.pattern,className:"w-14 h-14 bg-orange-50 text-orange-600 rounded-2xl flex items-center justify-center hover:bg-orange-100 transition-all shadow-sm",children:o.jsx(Hr,{size:18})})]})]})]}),o.jsxs("div",{className:"space-y-5",children:[o.jsxs("label",{className:"text-[12px] font-black text-slate-500 uppercase tracking-widest flex items-center gap-3 pr-1",children:[o.jsx("div",{className:"w-8 h-8 rounded-xl bg-primary-50 text-primary-500 flex items-center justify-center",children:o.jsx(rg,{size:14})}),"متن پیامک جایگزین (Fallback)"]}),o.jsxs("div",{className:"relative",children:[o.jsx("textarea",{value:I.sms,onChange:U=>{const re=[...s.abandoned_cart_rules];re[Z].sms=U.target.value,a({...s,abandoned_cart_rules:re})},className:"w-full h-32 p-6 rounded-[2rem] bg-slate-50 border border-slate-200 font-bold text-xs outline-none focus:bg-white focus:border-primary-500 transition-all resize-none leading-relaxed shadow-inner",placeholder:"اگر فیلد پترن بالا خالی باشد، این متن ارسال میشود..."}),o.jsx("div",{className:"absolute bottom-6 left-4 flex gap-2",children:["url","coupon","incentive"].map(U=>o.jsxs("span",{className:"text-[9px] font-black bg-white text-slate-400 px-2 py-1 rounded-lg border border-slate-100",children:["{",U,"}"]},U))})]})]})]})]},Z))})]})]}),e==="system"&&o.jsx(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-10",children:z?o.jsxs("div",{className:"flex flex-col items-center justify-center py-20 gap-4",children:[o.jsx(ur,{className:"animate-spin text-primary-500",size:32}),o.jsx("span",{className:"font-bold text-slate-400",children:"در حال دریافت اطلاعات..."})]}):y&&y.software&&o.jsxs("div",{className:"space-y-12",children:[o.jsxs("section",{className:"space-y-6",children:[o.jsxs("h3",{className:"text-xl font-black text-slate-800 flex items-center gap-3",children:[o.jsx("div",{className:"p-2 bg-emerald-50 rounded-lg text-emerald-600",children:o.jsx(YU,{size:20})}),"دستیار هوشمند سلامت (Health Audit)"]}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Object.entries(y.diagnostics||{}).map(([I,Z])=>o.jsxs("div",{className:"p-6 rounded-[2rem] bg-white border border-slate-100 shadow-sm space-y-4 hover:border-emerald-200 transition-all group",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"font-bold text-slate-700 text-sm",children:Z.label}),o.jsx("div",{className:`flex items-center gap-1.5 px-3 py-1 rounded-full text-[10px] font-black ${Z.status==="success"?"bg-green-100 text-green-600":Z.status==="warning"?"bg-amber-100 text-amber-600":"bg-rose-100 text-rose-600"}`,children:Z.status==="success"?"بهینه":Z.status==="warning"?"نیاز به بررسی":"بحرانی"})]}),o.jsxs("div",{className:"flex items-center gap-4 text-[10px] font-bold text-slate-400",children:[o.jsxs("span",{children:["فعلی: ",o.jsx("b",{className:"text-slate-600",children:Z.current})]}),o.jsx("div",{className:"w-1 h-1 bg-slate-200 rounded-full"}),o.jsxs("span",{children:["پیشنهادی: ",o.jsx("b",{className:"text-slate-600",children:Z.recommended})]})]}),o.jsx("p",{className:"text-[11px] text-slate-500 leading-relaxed italic pr-2 border-r-2 border-slate-100 group-hover:border-emerald-200 transition-all",children:Z.tip})]},I))})]}),o.jsxs("section",{className:"space-y-6 pt-6 border-t border-slate-100",children:[o.jsxs("h3",{className:"text-xl font-black text-slate-800 flex items-center gap-3",children:[o.jsx("div",{className:"p-2 bg-primary-50 rounded-lg text-primary-600",children:o.jsx(tg,{size:20})}),"نسخههای نرمافزاری"]}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[{label:"وردپرس",value:y.software.wp_version},{label:"ووکامرس",value:y.software.wc_version},{label:"افزونه ووکامرسا",value:y.software.plugin_version,color:"text-primary-600"},{label:"PHP",value:y.software.php_version},{label:"MySQL",value:y.software.mysql_version}].map((I,Z)=>o.jsxs("div",{className:"p-6 rounded-3xl bg-slate-50 border border-slate-100 flex items-center justify-between shadow-sm",children:[o.jsx("span",{className:"text-slate-500 font-bold text-sm",children:I.label}),o.jsx("span",{className:`font-black text-lg ${I.color||"text-slate-800"}`,children:I.value})]},Z))})]}),o.jsxs("section",{className:"space-y-6",children:[o.jsxs("h3",{className:"text-xl font-black text-slate-800 flex items-center gap-3",children:[o.jsx("div",{className:"p-2 bg-amber-50 rounded-lg text-amber-600",children:o.jsx(UU,{size:20})}),"تنظیمات سرور"]}),o.jsx("div",{className:"overflow-hidden rounded-3xl border border-slate-100 shadow-sm",children:o.jsxs("table",{className:"w-full text-right bg-white",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[o.jsx("th",{className:"p-5 font-black text-slate-600",children:"پارامتر سیستم و سرور"}),o.jsx("th",{className:"p-5 font-black text-slate-600",children:"مقدار فعلی"})]})}),o.jsx("tbody",{className:"divide-y divide-slate-50",children:[{label:"نام سایت",value:y.software.site_title},{label:"URL سایت",value:y.software.home_url},{label:"قالب فعال",value:y.software.active_theme},{label:"PHP Memory Limit",value:y.server.memory_limit},{label:"Max Execution Time",value:y.server.max_execution_time+"s"},{label:"Server Software",value:y.server.server_software},{label:"SSL Active",value:y.environment.is_ssl?"بله":"خیر",color:y.environment.is_ssl?"text-green-600":"text-rose-600"},{label:"زبان سیستم",value:y.environment.language},{label:"تایمزون",value:y.environment.timezone},{label:"تعداد افزونههای فعال",value:y.plugins.active_count}].map((I,Z)=>o.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors",children:[o.jsx("td",{className:"p-5 text-sm font-bold text-slate-700",children:I.label}),o.jsx("td",{className:`p-5 text-sm font-black ${I.color||"text-slate-900"}`,children:I.value})]},Z))})]})})]})]})}),e==="logs"&&o.jsxs(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsxs("h3",{className:"text-xl font-black text-slate-800 flex items-center gap-3",children:[o.jsx("div",{className:"p-2 bg-rose-50 rounded-lg text-rose-600",children:o.jsx(qs,{size:20})}),"گزارشات عملکرد سیستم"]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("button",{onClick:F,className:"p-3 bg-slate-50 text-slate-600 rounded-xl hover:bg-slate-100 transition-all font-bold text-xs flex items-center gap-2",children:[o.jsx(ur,{size:14,className:L?"animate-spin":""}),"بروزرسانی"]}),o.jsxs("button",{onClick:B,className:"p-3 bg-rose-50 text-rose-600 rounded-xl hover:bg-rose-100 transition-all font-bold text-xs flex items-center gap-2",children:[o.jsx(zu,{size:14}),"پاکسازی گزارشات"]})]})]}),o.jsx("div",{className:"wm-glass-panel overflow-hidden rounded-[2rem] border border-slate-100",children:L&&C.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center py-40 gap-4 bg-white",children:[o.jsx(ur,{className:"animate-spin text-primary-500",size:32}),o.jsx("span",{className:"font-bold text-slate-400",children:"در حال دریافت لاگها..."})]}):C.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center py-32 gap-6 bg-slate-50/30",children:[o.jsx("div",{className:"w-20 h-20 bg-slate-100 rounded-full flex items-center justify-center text-slate-300",children:o.jsx(qs,{size:40})}),o.jsxs("div",{className:"text-center",children:[o.jsx("h4",{className:"font-black text-slate-600 text-lg",children:"گزارشی ثبت نشده است"}),o.jsx("p",{className:"text-slate-400 text-sm mt-1",children:"تمام وقایع سیستم در این بخش نمایش داده میشوند."})]})]}):o.jsx("div",{className:"overflow-x-auto bg-white",children:o.jsxs("table",{className:"w-full text-right border-collapse",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[o.jsx("th",{className:"p-5 font-black text-slate-600 text-sm",children:"زمان"}),o.jsx("th",{className:"p-5 font-black text-slate-600 text-sm",children:"کاربر"}),o.jsx("th",{className:"p-5 font-black text-slate-600 text-sm",children:"سطح"}),o.jsx("th",{className:"p-5 font-black text-slate-600 text-sm",children:"عملیات"}),o.jsx("th",{className:"p-5 font-black text-slate-600 text-sm",children:"شرح مورد"})]})}),o.jsx("tbody",{className:"divide-y divide-slate-50",children:C.map((I,Z)=>o.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors",children:[o.jsx("td",{className:"p-6 text-[13px] font-bold text-slate-500 whitespace-nowrap",dir:"ltr",children:I.date}),o.jsx("td",{className:"p-6 text-[14px] font-bold text-slate-700",children:I.user_name||"سیستم"}),o.jsx("td",{className:"p-6",children:o.jsx("span",{className:`px-4 py-1.5 rounded-full text-[11px] font-black uppercase ${I.level==="error"?"bg-rose-100 text-rose-600":I.level==="warning"?"bg-amber-100 text-amber-600":"bg-green-100 text-green-600"}`,children:I.level==="error"?"خطا":I.level==="warning"?"هشدار":"اطلاعات"})}),o.jsx("td",{className:"p-6 text-[14px] font-black text-slate-900",children:I.action}),o.jsx("td",{className:"p-6 text-[14px] text-slate-600 leading-relaxed max-w-md",title:I.message_fa,children:I.message_fa})]},Z))})]})})})]}),e==="ai"&&o.jsx(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-10",children:o.jsxs("section",{className:"space-y-6",children:[o.jsxs("h3",{className:"wm-title-md flex items-center gap-3",children:[o.jsx(Jc,{className:"text-primary-500",size:24}),"تنظیمات موتور هوش مصنوعی سئو"]}),o.jsxs("div",{className:"p-8 rounded-[2.5rem] bg-indigo-50/50 border border-indigo-100 flex items-start gap-6",children:[o.jsx("div",{className:"p-4 bg-indigo-100 text-indigo-600 rounded-2xl",children:o.jsx(Hr,{size:28})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"font-black text-indigo-900 text-sm",children:"چگونه هوش مصنوعی سئو کار میکند؟"}),o.jsx("p",{className:"text-xs text-indigo-700 leading-relaxed font-bold italic",children:"این موتور میتواند به صورت خودکار برای محصولات شما تایتل و دیسکریپشن سئو تولید کند. اگر در ایران هستید، حتماً از یک «پروکسی» استفاده کنید یا حالت را روی «لوکال» قرار دهید."})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsx("label",{className:"wm-label block pr-2",children:"منبع پردازش هوش مصنوعی"}),o.jsxs("div",{className:"flex gap-4",children:[o.jsxs("button",{onClick:()=>a({...s,ai_mode:"remote"}),className:`flex-1 p-5 rounded-2xl border-2 transition-all text-right ${s.ai_mode==="remote"?"border-primary-500 bg-primary-50":"border-slate-100 bg-white"}`,children:[o.jsx("div",{className:"font-black text-xs",children:"سرور ابری (OpenAI)"}),o.jsx("div",{className:"text-[10px] text-slate-400 mt-1",children:"نیازمند اینترنت آزاد و API Key"})]}),o.jsxs("button",{onClick:()=>a({...s,ai_mode:"local"}),className:`flex-1 p-5 rounded-2xl border-2 transition-all text-right ${s.ai_mode==="local"?"border-indigo-500 bg-indigo-50":"border-slate-100 bg-white"}`,children:[o.jsx("div",{className:"font-black text-xs",children:"موتور محلی (Local)"}),o.jsx("div",{className:"text-[10px] text-slate-400 mt-1",children:"رایگان، آفلاین و بدون محدودیت"})]})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("label",{className:"wm-label block pr-2",children:"مدل منتخب (GPT Model)"}),o.jsxs("select",{value:s.ai_model,onChange:I=>a({...s,ai_model:I.target.value}),className:"w-full h-14 px-6 rounded-2xl bg-white border border-slate-200 wm-hint outline-none focus:ring-4 focus:ring-primary-500/10 transition-all font-mono",children:[o.jsx("option",{value:"gpt-4o-mini",children:"GPT-4o Mini (پیشنهادی - ارزان و سریع)"}),o.jsx("option",{value:"gpt-4o",children:"GPT-4o (قدرتمند و گران)"}),o.jsx("option",{value:"gpt-3.5-turbo",children:"GPT-3.5 Turbo (پایدار)"})]})]})]}),o.jsx(tr,{children:s.ai_mode==="remote"&&o.jsxs(ht.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"space-y-8 pt-6 border-t border-slate-100 overflow-hidden",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx("label",{className:"wm-label block pr-2",children:"OpenAI API Key"}),o.jsxs("div",{className:"relative",children:[o.jsx("input",{type:"password",value:s.ai_api_key,onChange:I=>a({...s,ai_api_key:I.target.value}),className:"w-full h-14 px-12 rounded-2xl border border-slate-200 outline-none focus:border-primary-500 font-mono text-sm",placeholder:"sk-..."}),o.jsx(e2,{className:"absolute left-4 top-4 text-slate-300",size:20})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx("label",{className:"wm-label block pr-2",children:"Endpoint / Proxy URL (بسیار مهم برای ایران)"}),o.jsxs("div",{className:"relative",children:[o.jsx("input",{type:"text",value:s.ai_proxy_url,onChange:I=>a({...s,ai_proxy_url:I.target.value}),className:"w-full h-14 px-12 rounded-2xl border border-slate-200 outline-none focus:border-primary-500 font-mono text-sm",dir:"ltr",placeholder:"https://api.openai.com/v1/chat/completions"}),o.jsx($u,{className:"absolute left-4 top-4 text-slate-300",size:20})]}),o.jsx("p",{className:"wm-hint leading-relaxed italic",children:"اگر از سرورهای ایران استفاده می کنید، باید آدرس پروکسی خود یا سرویسهایی مثل One-API را اینجا وارد کنید."})]})]})}),s.ai_mode==="local"&&o.jsxs("div",{className:"p-10 rounded-[3rem] bg-indigo-50 border border-indigo-100 space-y-6",children:[o.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[o.jsx("div",{className:"w-12 h-12 bg-white rounded-2xl flex items-center justify-center text-indigo-600 shadow-sm",children:o.jsx(LU,{size:24})}),o.jsxs("div",{children:[o.jsx("h4",{className:"font-black text-indigo-900",children:"موتور محلی کاملاً شخصیسازی شده"}),o.jsx("p",{className:"text-[10px] text-indigo-500 font-black uppercase tracking-widest",children:"Spintax & Variables Engine Running"})]})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-bold italic",children:"موتور محلی از ترکیب هوشمند متغیرهای محصول (نام، برند، قیمت) و عبارات معادل (Spintax) استفاده میکند. این روش ۱۰۰٪ رایگان است و هیچ وابستگی به اینترنت ندارد."})]})]})}),e==="about"&&o.jsxs(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-16 py-4",children:[o.jsxs("div",{className:"text-center space-y-6 max-w-3xl mx-auto",children:[o.jsx(ht.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},className:"inline-flex p-6 rounded-[2.5rem] bg-gradient-to-br from-primary-500 to-indigo-600 text-white shadow-2xl shadow-primary-500/20 mb-4",children:o.jsx(am,{size:48})}),o.jsx("h2",{className:"text-4xl font-black text-slate-900 tracking-tight",children:"پیشران هوشمند فروشگاه شما"}),o.jsx("p",{className:"text-lg text-slate-500 leading-relaxed font-medium",children:"ووکامرسا فراتر از یک ابزار، سیستمعاملی است که مدیریت فروشگاه را از یک کار کُند و طاقتفرسا به تجربهای سریع، لذتبخش و سودآور تبدیل میکند."}),o.jsxs("div",{className:"flex items-center justify-center gap-3 pt-4",children:[o.jsxs("span",{className:"px-4 py-2 rounded-full bg-emerald-50 text-emerald-600 text-[10px] font-black uppercase tracking-widest border border-emerald-100 flex items-center gap-2",children:[o.jsx(og,{size:14})," پایداری ۱۰۰٪ تضمین شده"]}),o.jsxs("span",{className:"px-4 py-2 rounded-full bg-primary-50 text-primary-600 text-[10px] font-black uppercase tracking-widest border border-primary-100 flex items-center gap-2",children:[o.jsx(Jc,{size:14})," آماده برای سال ۲۰۲۶"]})]})]}),o.jsxs("section",{className:"space-y-8",children:[o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("h3",{className:"text-2xl font-black text-slate-800",children:"قابلیتهای استراتژیک"}),o.jsx("div",{className:"w-12 h-1.5 bg-primary-500 rounded-full"})]}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[{title:"مدیریت اکسلی متمرکز",desc:"ویرایش در لحظه هزاران محصول در یک جدول واحد بدون رفرش صفحه. سرعتی مشابه Google Sheets.",icon:tg,color:"text-blue-600",bg:"bg-blue-50"},{title:"اتوماسیون سئو پیشرفته",desc:"تولید خودکار متادیتا، اسکیماهای FAQ و متون تصاویر با الگوهای هوشمند و سازگاری با RankMath.",icon:j1,color:"text-emerald-600",bg:"bg-emerald-50"},{title:"تحلیل سود و مارجین",desc:"مانیتورینگ زنده سود خالص و درصد مارجین بر اساس قیمت خرید و هزینههای جانبی فروشگاه.",icon:QD,color:"text-indigo-600",bg:"bg-indigo-50"}].map((I,Z)=>o.jsxs("div",{className:"wm-glass-panel p-8 rounded-[2.5rem] border border-slate-100 bg-white hover:shadow-2xl hover:shadow-slate-200/50 transition-all group",children:[o.jsx("div",{className:`p-4 rounded-2xl ${I.bg} ${I.color} w-fit mb-6 group-hover:scale-110 transition-transform`,children:o.jsx(I.icon,{size:28})}),o.jsx("h4",{className:"text-lg font-black text-slate-800 mb-3",children:I.title}),o.jsx("p",{className:"text-sm text-slate-500 leading-relaxed font-medium",children:I.desc})]},Z))})]}),o.jsxs("section",{className:"space-y-8 bg-slate-50/50 p-10 rounded-[3rem] border border-slate-100",children:[o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("h3",{className:"text-2xl font-black text-slate-800",children:"ماژولهای هوشمند"}),o.jsx("p",{className:"text-xs text-slate-400 font-bold",children:"بخشهای مختلف پنل مدیریتی ووکامرسا"})]}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[{id:"m1",title:"عملیات انبوه (Bulk Update)",desc:"اعمال فرمولهای ریاضی و متنی روی هزاران محصول به صورت همزمان.",features:["تغییر درصدی قیمتها","جایگزینی متنی انبوه","تغییر وضعیت دستهبندی و برند"],icon:Zc},{id:"m2",title:"سلامت محصولات (Health)",desc:"اسکنر هوشمند برای پیدا کردن نقصهای دادهای و سئو در کل سایت.",features:["شناسایی محصولات بدون تصویر","نمایش کالاهای بدون قیمت","گزارش خطاهای متادیتا سئو"],icon:qs},{id:"m3",title:"مدیریت تصاویر و مدیا",desc:"کنترل کامل گالری تصاویر و بهینهسازی سئوی بصری محصولات.",features:["ویرایش گروهی Alt Text","تغییر سریع تصویر شاخص","شناسایی و حذف مدیاهای اضافی"],icon:eg},{id:"m4",title:"گزارشات و جعبه سیاه (History)",desc:"ثبت جزئی تمام تغییرات انجام شده توسط ادمینها برای امنیت کامل.",features:["ثبت مقدار قبلی و جدید","دکمه بازگردانی (Undo)","فیلتر بر اساس کاربر و زمان"],icon:k1},{id:"m5",title:"سفارشات و کوپنها",desc:"استفاده از قدرت اکسل برای مدیریت فروش و کدهای تخفیف به صورت انبوه.",features:["تغییر وضعیت گروهی سفارشات","ویرایش سریع محدودیت کوپنها","ثبت کدهای رهگیری پستی"],icon:Da},{id:"m6",title:"اتوماسیون و سناریوها (Rules)",desc:"تعریف قوانین منطقی برای خودکارسازی فرآیندهای قیمتگذاری و فروش.",features:["تغییر قیمت بر اساس موجودی","زمانبندی حراجهای خودکار","هماهنگسازی قیمت با نوسان ارز"],icon:Hr}].map(I=>o.jsxs("div",{className:"p-6 rounded-3xl bg-white border border-slate-100 flex items-start gap-5 hover:border-primary-200 transition-all group",children:[o.jsx("div",{className:"p-3 bg-slate-50 rounded-2xl text-slate-400 group-hover:text-primary-500 transition-colors",children:o.jsx(I.icon,{size:24})}),o.jsxs("div",{className:"space-y-3",children:[o.jsx("h4",{className:"font-black text-slate-800",children:I.title}),o.jsx("p",{className:"text-xs text-slate-500 leading-relaxed font-medium",children:I.desc}),o.jsx("div",{className:"flex flex-wrap gap-2 pt-1",children:I.features.map((Z,U)=>o.jsx("span",{className:"px-2.5 py-1 bg-slate-50 text-slate-400 text-[9px] font-black rounded-lg border border-slate-100",children:Z},U))})]})]},I.id))})]}),o.jsxs("section",{className:"space-y-8",children:[o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("h3",{className:"text-2xl font-black text-slate-800",children:"در چه شرایطی به ووکامرسا نیاز دارید؟"}),o.jsx("p",{className:"text-xs text-slate-400 font-bold italic",children:"سناریوهای واقعی سودآوری"})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-10",children:[o.jsxs("div",{className:"p-10 rounded-[3rem] bg-gradient-to-br from-slate-800 to-slate-900 shadow-2xl relative overflow-hidden group",children:[o.jsx("div",{className:"absolute top-0 right-0 p-8 opacity-10 group-hover:scale-110 transition-transform",children:o.jsx(eu,{size:120,className:"text-white"})}),o.jsxs("div",{className:"relative z-10 space-y-6",children:[o.jsx("div",{className:"w-12 h-12 bg-white/10 rounded-2xl flex items-center justify-center text-primary-400",children:o.jsx(Hr,{size:24})}),o.jsx("h4",{className:"text-xl font-black text-white",children:"تغییرات آنی در بازار پرنوسان"}),o.jsx("p",{className:"text-sm text-slate-300 leading-bold",children:"اگر قیمت دلار تغییر کرده و باید ۵۰۰۰ محصول را با فرمولهای مختلف بهروز کنید، ووکامرسا این کار را برای شما از ۵ ساعت به ۵ دقیقه تقلیل میدهد."}),o.jsxs("div",{className:"flex items-center gap-2 text-primary-400 font-black text-[10px] uppercase",children:[o.jsx(am,{size:14})," حداکثر سرعت عملیاتی"]})]})]}),o.jsxs("div",{className:"p-10 rounded-[3rem] bg-indigo-600 shadow-2xl relative overflow-hidden group",children:[o.jsx("div",{className:"absolute top-0 right-0 p-8 opacity-10 group-hover:scale-110 transition-transform",children:o.jsx(j1,{size:120,className:"text-white"})}),o.jsxs("div",{className:"relative z-10 space-y-6",children:[o.jsx("div",{className:"w-12 h-12 bg-white/10 rounded-2xl flex items-center justify-center text-indigo-300",children:o.jsx(Jc,{size:24})}),o.jsx("h4",{className:"text-xl font-black text-white",children:"بهینهسازی سئو در مقیاس کلان"}),o.jsx("p",{className:"text-sm text-indigo-100 leading-bold",children:"زمانی که میخواهید برای تمام محصولات یک دستهبندی خاص، متادیسکریپشن و تایتل سئو بر اساس کلمات کلیدی هدف اصلاح کنید، سیستم هوشمند ما بهترین دستیار شماست."}),o.jsxs("div",{className:"flex items-center gap-2 text-indigo-200 font-black text-[10px] uppercase",children:[o.jsx(og,{size:14})," سئو بر اساس استانداردهای ۲۰۲۶"]})]})]})]})]}),o.jsxs("div",{className:"p-10 rounded-[3rem] bg-amber-50 border border-amber-100 flex flex-col items-center gap-6 text-center",children:[o.jsx("div",{className:"p-4 bg-white rounded-3xl text-amber-500 shadow-sm",children:o.jsx(Fu,{size:32})}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("h3",{className:"text-2xl font-black text-amber-900",children:"چرا مدیران حرفهای ووکامرسا را انتخاب میکنند؟"}),o.jsx("p",{className:"text-sm text-amber-800/70 max-w-xl leading-relaxed font-bold",children:"تفاوت در جزئیات است. ما از معماری React مدرن برای سرعت بینظیر، و از سیستمهای کش لایه به لایه برای حفظ سلامت دیتابیس شما استفاده کردهایم. با ووکامرسا، شما صاحب یک تکنولوژی در کلاس جهانی هستید."})]})]}),o.jsxs("div",{className:"pt-20 border-t border-slate-100 flex flex-col items-center gap-8",children:[o.jsxs("div",{className:"flex items-center gap-8 opacity-40 hover:opacity-100 transition-all duration-500 cursor-default",children:[o.jsxs("div",{className:"flex items-center gap-2.5 text-[11px] font-black text-slate-500",children:[o.jsx(LU,{size:16,className:"text-primary-500"}),"Core Architecture: Amin Gholampour"]}),o.jsx("div",{className:"w-1.5 h-1.5 bg-slate-300 rounded-full"}),o.jsxs("a",{href:"https://amingholampour.ir",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-[11px] font-black text-slate-500 hover:text-primary-600 transition-all",children:[o.jsx($u,{size:14}),"amingholampour.ir"]})]}),o.jsxs("div",{className:"flex flex-col items-center gap-1",children:[o.jsx("p",{className:"text-[11px] font-black text-slate-300 tracking-widest uppercase",children:"Premium Product Design Systems"}),o.jsxs("p",{className:"text-[10px] font-bold text-slate-200 italic",children:["Version ",((q=y==null?void 0:y.software)==null?void 0:q.plugin_version)||"1.0.0"," | Engineered for Enterprise Excellence"]})]})]})]})]})})]})]})},vT=t=>{switch(t){case"champions":return"bg-emerald-500 text-white shadow-emerald-500/20";case"loyal":return"bg-blue-500 text-white shadow-blue-500/20";case"at_risk":return"bg-amber-500 text-white shadow-amber-500/20";case"dormant":return"bg-rose-500 text-white shadow-rose-500/20";default:return"bg-slate-400 text-white shadow-slate-400/20"}},Z1=t=>{switch(t){case"champions":return"قهرمان (Champions)";case"loyal":return"وفادار (Loyal)";case"at_risk":return"در مرز ریسک";case"dormant":return"راکد (Dormant)";case"new":return"مشتری جدید";default:return t}},pme=()=>{var q,I,Z;const[t,e]=W.useState(!0),[n,r]=W.useState([]),[i,s]=W.useState(null),[a,u]=W.useState(""),[h,m]=W.useState(""),[g,y]=W.useState(""),[x,C]=W.useState(null),[E,M]=W.useState(1),[j,L]=W.useState(1),[D,z]=W.useState(0),[H,V]=W.useState(25),[F,B]=W.useState(null),[te,ve]=W.useState(!1),[ce,_e]=W.useState(!1),[pe,Le]=W.useState("main"),[Fe,nt]=W.useState(15),[dt,$e]=W.useState(null),[Re,Ze]=W.useState(!1),[Ee,Q]=W.useState(!1),[fe,Ve]=W.useState(!1),[ne,xe]=W.useState(!1),Ke=async()=>{e(!0);try{const U={page:E.toString(),search:a,min_spent:h,min_orders:g,per_page:String(H)};x&&Array.isArray(x)&&x.length===2&&x[0]&&x[1]&&(U.date_from=x[0].toDate().toLocaleDateString("en-CA"),U.date_to=x[1].toDate().toLocaleDateString("en-CA"));const re=new URLSearchParams(U),ae=await fetch(`${window.woocommersa_data.apiUrl}/customers-overview?${re}`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}}),he=await ae.json();ae.ok&&he?(r(he.customers||[]),L(he.pages||1),z(he.total||0),s(he.stats||null)):(r([]),L(1),z(0),he&&he.message&&ze.error(he.message))}catch(U){console.error(U),r([]),ze.error("خطا در دریافت لیست مشتریان")}finally{e(!1)}};W.useEffect(()=>{Ke()},[E,H]);const qe=U=>{U.preventDefault(),M(1),Ke()},we=async()=>{xe(!0);const U=ze.loading("در حال آمادهسازی فایل خروجی...");try{const re={search:a,min_spent:h,min_orders:g};x&&Array.isArray(x)&&x.length===2&&x[0]&&x[1]&&(re.date_from=x[0].toDate().toLocaleDateString("en-CA"),re.date_to=x[1].toDate().toLocaleDateString("en-CA"));const ae=new URLSearchParams(re),Me=await(await fetch(`${window.woocommersa_data.apiUrl}/analysis/export-customers?${ae}`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();if(Me.success&&Me.customers){const tt=["نام","ایمیل","شماره تماس","تعداد سفارش","مجموع خرید","بخشبندی","تاریخ آخرین سفارش"],ot=Me.customers.map(Oe=>[Oe.name,Oe.email,Oe.phone,Oe.total_orders,Oe.total_spent,Z1(Oe.segment),Oe.last_order_date]);let lt="\uFEFF"+tt.join(",")+` `+ot.map(Oe=>Oe.join(",")).join(` `);const X=new Blob([lt],{type:"text/csv;charset=utf-8;"}),de=document.createElement("a"),Ce=URL.createObjectURL(X);de.setAttribute("href",Ce),de.setAttribute("download",`customers_export_${new Date().toISOString().split("T")[0]}.csv`),document.body.appendChild(de),de.click(),document.body.removeChild(de),ze.success("فایل اکسل با موفقیت دانلود شد",{id:U})}}catch{ze.error("خطا در استخراج دادهها",{id:U})}finally{xe(!1)}},k=async()=>{xe(!0);const U=ze.loading("در حال دریافت شمارهها...");try{const re={search:a,min_spent:h,min_orders:g};x&&Array.isArray(x)&&x.length===2&&x[0]&&x[1]&&(re.date_from=x[0].toDate().toLocaleDateString("en-CA"),re.date_to=x[1].toDate().toLocaleDateString("en-CA"));const ae=new URLSearchParams(re),Me=await(await fetch(`${window.woocommersa_data.apiUrl}/analysis/export-customers?${ae}`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();if(Me.success&&Me.customers){const tt=Me.customers.map(ot=>ot.phone).filter(ot=>ot&&ot.trim()!=="").join(",");await navigator.clipboard.writeText(tt),ze.success(`${Me.customers.length} شماره تماس در حافظه کپی شد`,{id:U})}}catch{ze.error("خطا در کپی شمارهها",{id:U})}finally{xe(!1)}},_=async()=>{if(F){_e(!0);try{const U=await fetch(`${window.woocommersa_data.apiUrl}/analysis/create-quick-coupon`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({email:F.email,name:F.name,percent:Fe})}),re=await U.json();U.ok&&re.success?(ze.success(`کد تخفیف ${re.code} با موفقیت ساخته شد!`),Le("coupon"),F.generatedCoupon=re.code):ze.error(re.message||"خطا در ساخت کد تخفیف")}catch{ze.error("خطای ارتباط با سرور")}finally{_e(!1)}}},N=async U=>{Ze(!0),$e(null);try{const re=await fetch(`${window.woocommersa_data.apiUrl}/analysis/get-ai-insight`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({email:U})}),ae=await re.json();re.ok&&$e(ae.insight)}catch(re){console.error(re)}finally{Ze(!1)}},O=async()=>{if(!(!F||!F.generatedCoupon)){Q(!0);try{const U=await fetch(`${window.woocommersa_data.apiUrl}/analysis/send-coupon-sms`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({email:F.email,phone:F.phone,name:F.name,code:F.generatedCoupon})}),re=await U.json();U.ok&&re.success?ze.success("کد تخفیف از طریق پیامک ارسال شد"):ze.error(re.message||"خطا در ارسال پیامک")}catch{ze.error("خطای ارتباط با سرور")}finally{Q(!1)}}},G=U=>{if(!U)return"نامشخص";try{return new Date(U).toLocaleDateString("fa-IR",{year:"numeric",month:"long",day:"numeric"})}catch{return U}};return o.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500",dir:"rtl",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[o.jsx("div",{className:"bg-white p-6 rounded-[2rem] border border-slate-100 shadow-xl relative overflow-hidden group",children:o.jsxs("div",{className:"relative z-10",children:[o.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase mb-1",children:"سود تهِ جیب شما (برآورد)"}),o.jsx("h4",{className:"text-2xl font-black text-emerald-600",children:Xo((i==null?void 0:i.profit)||0)}),o.jsxs("div",{className:"mt-4 flex items-center gap-2 text-[10px] font-bold text-slate-400 bg-slate-50 px-2 py-1 rounded-lg w-fit",children:[o.jsx(eu,{size:10,className:"text-emerald-500"})," بر اساس بازه انتخابی"]})]})}),o.jsx("div",{className:"bg-white p-6 rounded-[2rem] border border-slate-100 shadow-xl relative overflow-hidden group",children:o.jsxs("div",{className:"relative z-10",children:[o.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase mb-1",children:"میانگین هر خرید (AOV)"}),o.jsx("h4",{className:"text-2xl font-black text-slate-900",children:Xo((i==null?void 0:i.aov)||0)}),o.jsxs("div",{className:"mt-4 flex items-center gap-2 text-[10px] font-bold text-indigo-600 bg-indigo-50 px-2 py-1 rounded-lg w-fit",children:[o.jsx(qs,{size:10})," ارزش متوسط تراکنشها"]})]})}),o.jsx("div",{className:"bg-white p-6 rounded-[2rem] border border-slate-100 shadow-xl relative overflow-hidden group",children:o.jsxs("div",{className:"relative z-10",children:[o.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase mb-1",children:"نرخ بازگشت مشتری"}),o.jsxs("h4",{className:"text-2xl font-black text-primary-600",children:[(i==null?void 0:i.returning_rate)||0,"%"]}),o.jsx("div",{className:"w-full bg-slate-100 h-1.5 rounded-full mt-4 overflow-hidden",children:o.jsx(ht.div,{initial:{width:0},animate:{width:`${(i==null?void 0:i.returning_rate)||0}%`},className:"bg-primary-500 h-full rounded-full"})})]})}),o.jsx("div",{className:"bg-slate-900 p-6 rounded-[2rem] text-white shadow-xl relative overflow-hidden group",children:o.jsxs("div",{className:"relative z-10",children:[o.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase mb-1",children:"کل فروش (تمام ادوار)"}),o.jsx("h4",{className:"text-2xl font-black text-white",children:Xo((i==null?void 0:i.revenue)||0)}),o.jsxs("p",{className:"text-[10px] text-slate-500 mt-4 leading-relaxed font-bold italic",children:["نمایش ",D," مشتری منحصربهفرد"]})]})})]}),(i==null?void 0:i.segments)&&o.jsxs("section",{className:"wm-glass-panel p-8 rounded-[2rem] border border-slate-100 shadow-lg",children:[o.jsxs("div",{className:"flex items-center justify-between mb-6",children:[o.jsxs("h3",{className:"wm-title-sm flex items-center gap-2",children:[o.jsx(Ik,{className:"text-primary-500",size:20}),"توزیع بخشبندی مشتریان (RFM)"]}),o.jsx(qs,{size:18,className:"text-slate-200"})]}),o.jsx("div",{className:"flex w-full h-10 rounded-2xl overflow-hidden shadow-inner bg-slate-100 p-1",children:Object.entries(i.segments).map(([U,re])=>{if(re===0)return null;const ae=re/D*100;return o.jsxs(ht.div,{initial:{width:0},animate:{width:`${ae}%`},className:`h-full flex items-center justify-center text-[8px] font-black group relative ${vT(U)}`,children:[o.jsxs("span",{className:"opacity-0 group-hover:opacity-100 transition-opacity truncate px-1",children:[Math.round(ae),"%"]}),o.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 hidden group-hover:block bg-slate-800 text-white text-[10px] px-3 py-1 rounded-lg whitespace-nowrap z-50",children:[Z1(U),": ",re," نفر"]})]},U)})}),o.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-4 mt-6",children:Object.keys(i.segments).map(U=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:`w-3 h-3 rounded-full ${vT(U).split(" ")[0]}`}),o.jsx("span",{className:"text-[10px] font-bold text-slate-500",children:Z1(U)}),o.jsx("span",{className:"text-[10px] font-black text-slate-900 bg-slate-50 px-2 py-0.5 rounded-md border border-slate-100",children:i.segments[U]})]},U))})]}),o.jsx("section",{className:"bg-white rounded-3xl p-6 shadow-xl border border-slate-100",children:o.jsxs("form",{onSubmit:qe,className:"flex flex-wrap lg:flex-nowrap items-center gap-4 w-full",children:[o.jsxs("div",{className:"relative flex-[2] min-w-[280px] group",children:[o.jsx(Ia,{className:"absolute right-5 top-1/2 -translate-y-1/2 text-slate-400 group-focus-within:text-primary-500 transition-colors",size:20}),o.jsx("input",{type:"text",value:a,onChange:U=>u(U.target.value),placeholder:"جستجو بر اساس نام یا ایمیل...",className:"wm-input !pr-14 !pl-4 h-14 !text-sm font-black"})]}),o.jsxs("div",{className:"relative flex-1 min-w-[300px] h-14 group",children:[o.jsxs("div",{className:"flex items-center gap-2 bg-slate-50 px-5 rounded-2xl border border-slate-200 shadow-sm relative h-14 focus-within:ring-4 focus-within:ring-primary-500/10 focus-within:border-primary-500 transition-all",children:[o.jsx(Ll,{size:18,className:"text-slate-400 group-focus-within:text-primary-500 transition-colors"}),o.jsx(Dh,{value:x,onChange:C,range:!0,calendar:Hh,locale:Lh,calendarPosition:"bottom-right",containerClassName:"flex-1",render:(U,re)=>o.jsx("input",{onClick:re,value:U,readOnly:!0,placeholder:"بازه تاریخ...",className:"!bg-transparent !border-none !outline-none !shadow-none !h-full font-bold w-full text-right cursor-pointer text-slate-700 text-[13px] placeholder:text-slate-400 !m-0 !p-0"})})]}),x&&o.jsx("button",{type:"button",onClick:()=>{C(null),M(1),Ke()},className:"absolute left-3 top-1/2 -translate-y-1/2 text-rose-500 hover:bg-rose-50 p-1 rounded-lg transition-all z-10",children:o.jsx(qi,{size:16})})]}),o.jsx("div",{className:"flex-1 min-w-[160px] relative group",children:o.jsx("input",{type:"number",value:h,onChange:U=>m(U.target.value),placeholder:"حداقل خرید",className:"wm-input h-14 !px-6 !text-sm font-black"})}),o.jsx("div",{className:"flex-1 min-w-[140px] relative group",children:o.jsx("input",{type:"number",value:g,onChange:U=>y(U.target.value),placeholder:"تعداد خرید",className:"wm-input h-14 !px-6 !text-sm font-black"})}),o.jsxs("button",{type:"submit",className:"h-14 px-10 bg-primary-600 hover:bg-primary-700 text-white rounded-2xl font-black text-sm shadow-xl shadow-primary-500/20 active:scale-95 transition-all flex items-center gap-2 shrink-0",children:[o.jsx(Rx,{size:20}),"فیلتر"]}),o.jsx("div",{className:"w-28 shrink-0",children:o.jsx("select",{value:H,onChange:U=>{V(Number(U.target.value)),M(1)},className:"wm-select h-14 !text-sm font-black",children:[25,50,100,200].map(U=>o.jsxs("option",{value:U,children:[U," ردیف"]},U))})}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{type:"button",disabled:ne,onClick:we,className:"w-14 h-14 bg-white border border-slate-200 text-slate-400 hover:text-primary-600 hover:border-primary-100 rounded-2xl flex items-center justify-center hover:bg-primary-50 transition-all shrink-0 disabled:opacity-50",title:"خروجی کامل اکسل",children:ne?o.jsx(ig,{size:20,className:"animate-spin"}):o.jsx(om,{size:22})}),o.jsx("button",{type:"button",disabled:ne,onClick:k,className:"w-14 h-14 bg-white border border-slate-200 text-slate-400 hover:text-emerald-600 hover:border-emerald-100 rounded-2xl flex items-center justify-center hover:bg-emerald-50 transition-all shrink-0 disabled:opacity-50",title:"کپی لیست شمارهها",children:ne?o.jsx(ig,{size:20,className:"animate-spin"}):o.jsx($U,{size:22})})]})]})}),o.jsxs("section",{className:"bg-white rounded-[2rem] shadow-xl border border-slate-100 overflow-hidden",children:[o.jsx("div",{className:"overflow-auto relative max-h-[70vh] border-b border-slate-100",children:o.jsxs("table",{className:"w-full border-collapse border-spacing-0",children:[o.jsx("thead",{className:"sticky top-0 z-20 bg-slate-50 shadow-sm backdrop-blur-sm",children:o.jsxs("tr",{className:"border-b border-slate-100",children:[o.jsx("th",{className:"px-6 py-4 text-right text-[11px] font-black text-slate-400 uppercase tracking-widest",children:"مشخصات مشتری"}),o.jsx("th",{className:"px-6 py-4 text-right text-[11px] font-black text-slate-400 uppercase tracking-widest",children:"وضعیت RFM"}),o.jsx("th",{className:"px-6 py-4 text-right text-[11px] font-black text-slate-400 uppercase tracking-widest",children:"تعداد خرید (سفارش)"}),o.jsx("th",{className:"px-6 py-4 text-right text-[11px] font-black text-slate-400 uppercase tracking-widest text-rose-400",children:"سبد رها شده"}),o.jsx("th",{className:"px-6 py-4 text-right text-[11px] font-black text-slate-400 uppercase tracking-widest",children:"مجموع خرید"}),o.jsx("th",{className:"px-6 py-4 text-right text-[11px] font-black text-slate-400 uppercase tracking-widest",children:"سود خالص (Estimated)"}),o.jsx("th",{className:"px-6 py-4 text-right text-[11px] font-black text-slate-400 uppercase tracking-widest",children:"تاریخ آخرین سفارش"}),o.jsx("th",{className:"px-6 py-4 text-center text-[11px] font-black text-slate-400 uppercase tracking-widest",children:"عملیات"})]})}),o.jsx("tbody",{className:"divide-y divide-slate-50",children:t?o.jsx("tr",{children:o.jsx("td",{colSpan:7,className:"py-20",children:o.jsxs("div",{className:"flex flex-col items-center justify-center text-slate-300",children:[o.jsx("div",{className:"w-10 h-10 border-4 border-primary-500/20 border-t-primary-500 rounded-full animate-spin mb-4"}),o.jsx("p",{className:"font-black text-sm",children:"در حال تحلیل هوشمند دادهها..."})]})})}):n.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:7,className:"py-20 text-center",children:o.jsxs("div",{className:"flex flex-col items-center justify-center text-slate-300",children:[o.jsx(Ia,{size:48,className:"mb-4 opacity-50"}),o.jsx("p",{className:"font-black text-lg",children:"نتیجهای با فیلترهای فعلی یافت نشد"})]})})}):n.map((U,re)=>o.jsxs(ht.tr,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:re*.03},className:"group hover:bg-slate-50 transition-colors",children:[o.jsx("td",{className:"px-6 py-4",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-10 h-10 rounded-full bg-slate-100 flex items-center justify-center font-black text-slate-400 text-xs shadow-inner",children:U.name.substring(0,1)}),o.jsxs("div",{children:[o.jsx("p",{className:"font-black text-slate-900 text-sm",children:U.name}),o.jsx("p",{className:"text-[10px] font-bold text-slate-400",children:U.email})]})]})}),o.jsx("td",{className:"px-6 py-4",children:o.jsx("span",{className:`px-3 py-1 rounded-lg text-[9px] font-black shadow-sm ${vT(U.segment)}`,children:Z1(U.segment)})}),o.jsxs("td",{className:"px-6 py-4 font-black text-slate-600 text-sm",children:[U.total_orders," سفارش"]}),o.jsx("td",{className:"px-6 py-4 font-black text-rose-500 text-sm",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Da,{size:14,className:"opacity-50"}),U.abandoned_count||0," مورد"]})}),o.jsx("td",{className:"px-6 py-4",children:o.jsx("p",{className:"font-black text-slate-700 text-sm",children:Xo(U.total_spent)})}),o.jsx("td",{className:"px-6 py-4",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("p",{className:"font-black text-emerald-600 text-sm",children:Xo(U.total_profit)}),U.total_profit>U.total_spent*.5&&o.jsx(eu,{size:12,className:"text-emerald-500"})]})}),o.jsx("td",{className:"px-6 py-4",children:o.jsxs("div",{className:"flex flex-col",children:[o.jsx("p",{className:"font-black text-slate-700 text-xs",children:U.last_order.date?new Date(U.last_order.date).toLocaleDateString("fa-IR"):"-"}),o.jsxs("p",{className:"text-[9px] text-slate-400 font-bold",children:[U.days_since_last," روز پیش"]})]})}),o.jsx("td",{className:"px-6 py-4",children:o.jsxs("div",{className:"flex items-center justify-center gap-2",children:[o.jsx("button",{onClick:()=>{B(U),ve(!0),N(U.email)},className:"w-9 h-9 flex items-center justify-center bg-white border border-slate-100 text-slate-400 hover:text-primary-600 hover:border-primary-100 rounded-xl transition-all shadow-sm",title:"نمایش تحلیل عمیق",children:o.jsx(Jp,{size:16})}),o.jsx("button",{onClick:()=>{B(U),Ve(!0)},className:"w-9 h-9 flex items-center justify-center bg-white border border-slate-100 text-slate-400 hover:text-emerald-600 hover:border-emerald-100 rounded-xl transition-all shadow-sm",title:"تاریخچه سفارشات",children:o.jsx(k1,{size:16})})]})})]},`${U.email}-${re}`))})]})}),o.jsxs("div",{className:"p-6 bg-slate-50 border-t border-slate-100 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"text-xs font-bold text-slate-400",children:["نمایش ",n.length," مورد در این صفحه (از کل ",D,")"]}),o.jsx("div",{className:"w-28",children:o.jsx("select",{value:H,onChange:U=>{V(Number(U.target.value)),M(1)},className:"wm-select h-10 !text-[11px]",children:[25,50,100,200].map(U=>o.jsxs("option",{value:U,children:[U," ردیف"]},U))})})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{disabled:E===1,onClick:()=>M(U=>U-1),className:"p-2 rounded-xl bg-white border border-slate-200 text-slate-400 hover:text-primary-600 disabled:opacity-50 transition-all font-black text-xs px-4",children:"قبلی"}),o.jsxs("span",{className:"px-4 font-black text-xs text-slate-600",children:["صفحه ",E," از ",j]}),o.jsx("button",{disabled:E===j,onClick:()=>M(U=>U+1),className:"p-2 rounded-xl bg-white border border-slate-200 text-slate-400 hover:text-primary-600 disabled:opacity-50 transition-all font-black text-xs px-4",children:"بعدی"})]})]})]}),o.jsx(tr,{children:F&&o.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-end p-0",children:[o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>B(null),className:"absolute inset-0 bg-slate-900/60 backdrop-blur-md"}),o.jsxs(ht.div,{initial:{x:"100%",borderRadius:"2rem 0 0 2rem"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"relative w-full max-w-xl h-full bg-white shadow-2xl overflow-y-auto",children:[o.jsxs("div",{className:"p-8 border-b border-slate-100 flex items-center justify-between bg-white sticky top-0 z-20",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:`w-14 h-14 rounded-[1.5rem] flex items-center justify-center shadow-xl ${vT(F.segment)}`,children:o.jsx(Ik,{size:28})}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-xl font-black text-slate-900 leading-none mb-1",children:F.name}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-slate-400 text-xs font-bold",children:F.email}),o.jsx("div",{className:"w-1 h-1 bg-slate-200 rounded-full"}),o.jsx("span",{className:"text-primary-500 text-xs font-black",children:Z1(F.segment)})]})]})]}),o.jsx("button",{onClick:()=>B(null),className:"w-10 h-10 hover:bg-slate-50 border border-slate-100 rounded-xl flex items-center justify-center transition-all font-black text-slate-400 hover:text-rose-500 text-2xl group active:scale-95",children:o.jsx(qi,{size:20,className:"group-hover:rotate-90 transition-transform"})})]}),o.jsxs("div",{className:"p-8 space-y-10 pb-32",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"p-6 rounded-[2.5rem] bg-indigo-50/50 border border-indigo-100/50 space-y-1 shadow-sm group hover:bg-indigo-50 transition-colors",children:[o.jsx("p",{className:"text-[10px] font-black text-indigo-400 uppercase tracking-wider",children:"کل خرید مشتری"}),o.jsx("h4",{className:"text-xl font-black text-indigo-700",children:Xo(F.total_spent)})]}),o.jsxs("div",{className:"p-6 rounded-[2.5rem] bg-emerald-50/50 border border-emerald-100/50 space-y-1 shadow-sm group hover:bg-emerald-50 transition-colors",children:[o.jsx("p",{className:"text-[10px] font-black text-emerald-400 uppercase tracking-wider",children:"سود تهِ جیب شما"}),o.jsx("h4",{className:"text-xl font-black text-emerald-700",children:Xo(F.total_profit)})]}),o.jsx("div",{className:"p-6 rounded-[2.5rem] bg-rose-50/50 border border-rose-100/50 space-y-1 shadow-sm group hover:bg-rose-50 transition-colors col-span-2",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-[10px] font-black text-rose-400 uppercase tracking-wider",children:"تعداد سبد رها شده"}),o.jsxs("h4",{className:"text-xl font-black text-rose-700",children:[F.abandoned_count||0," مورد"]})]}),F.last_abandoned_date&&o.jsxs("div",{className:"text-left",children:[o.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-wider",children:"آخرین رها شده"}),o.jsx("p",{className:"text-xs font-bold text-slate-500",children:G(F.last_abandoned_date)})]})]})})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("h4",{className:"font-black text-slate-800 flex items-center justify-between px-2",children:o.jsxs("span",{className:"flex items-center gap-2 text-sm uppercase tracking-tight",children:[o.jsx("div",{className:"w-1.5 h-4 bg-primary-500 rounded-full"}),"جزئیات آخرین تراکنش"]})}),o.jsxs("div",{className:"bg-slate-50/50 rounded-[2.5rem] p-8 border border-slate-100 shadow-sm space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase",children:"شماره سفارش"}),o.jsxs("p",{className:"font-black text-slate-900 border-b-2 border-primary-500/20 w-fit",children:["#",F.last_order.number]})]}),o.jsxs("div",{className:"text-left",children:[o.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase",children:"تاریخ سفارش"}),o.jsx("p",{className:"font-black text-slate-900 text-xs",children:G(F.last_order.date)})]})]}),o.jsxs("div",{className:"flex items-center justify-between border-t border-slate-200/50 pt-4",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase",children:"وضعیت سفارش"}),o.jsx("p",{className:"font-black text-emerald-600 text-[10px] bg-emerald-50 px-2 py-0.5 rounded-md",children:F.last_order.status})]}),o.jsxs("div",{className:"text-left",children:[o.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase",children:"مبلغ نهایی"}),o.jsx("p",{className:"font-black text-primary-600 text-lg",children:Xo(parseFloat(F.last_order.total))})]})]}),o.jsxs("div",{className:"space-y-3 pt-4 border-t border-slate-200/50",children:[o.jsxs("p",{className:"text-[10px] font-black text-slate-500 flex items-center gap-2",children:[o.jsx(Da,{size:14,className:"text-primary-500"})," اقلام خریداری شده:"]}),(q=F.last_order.items_raw)==null?void 0:q.map((U,re)=>o.jsxs("div",{className:"flex items-center justify-between py-1 px-2 hover:bg-white rounded-xl transition-all",children:[o.jsx("span",{className:"text-xs font-bold text-slate-700",children:U.name}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("span",{className:"text-[10px] font-black text-slate-400 bg-slate-100 px-1.5 py-0.5 rounded",children:["x",U.qty]}),o.jsx("span",{className:"text-xs font-black text-slate-900",children:Xo(parseFloat(U.total))})]})]},re))]})]})]}),o.jsxs("div",{className:"space-y-4 pt-4 relative",children:[o.jsxs("h4",{className:"font-black text-slate-800 flex items-center gap-3 px-2",children:[o.jsx("div",{className:"w-1.5 h-4 bg-amber-500 rounded-full"}),o.jsx("span",{className:"text-sm uppercase tracking-tight",children:"پنل عملیات بازاریابی"})]}),o.jsxs("div",{className:"p-8 rounded-[2.5rem] bg-slate-900 text-white space-y-6 shadow-2xl relative overflow-hidden group",children:[o.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-primary-500/10 rounded-full blur-3xl -mr-16 -mt-16"}),o.jsxs(tr,{mode:"wait",children:[pe==="main"&&o.jsxs(ht.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"space-y-4",children:[o.jsxs("p",{className:"text-[11px] font-bold text-slate-400 leading-relaxed bg-white/5 p-4 rounded-xl border border-white/5 text-right",dir:"rtl",children:["💡 ",F.segment==="at_risk"&&"این مشتری مدتی است خرید نکرده است. ارسال یک پیام واتساپ یا کد تخفیف اختصاصی میتواند او را برگرداند.",F.segment==="champions"&&"این مشتری قهرمان شماست! پیشنهاد میشود یک کد تخفیف VIP اختصاصی برای او بسازید.",F.segment==="new"&&"اولین خرید این مشتری است. ارسال یک پیام تشکر صمیمانه، احتمال بازگشت او را ۸۰٪ افزایش میدهد.",F.segment==="loyal"&&"تمرکز بر روی افزایش میانگین سبد خرید (AOV) این مشتری از طریق پیشنهادات مکمل توصیه میشود.",F.segment==="dormant"&&"مشتری غیرفعال شده است. یک کمپین ویژه با تخفیف چشمگیر آخرین شانس برای زنده کردن این اکانت است."]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-between px-2",children:[o.jsx("label",{className:"text-xs font-black text-slate-300",children:"درصد تخفیف دلخواه"}),o.jsxs("span",{className:"text-xl font-black text-emerald-500",children:[Fe,"٪"]})]}),o.jsxs("div",{className:"bg-slate-900/50 p-6 rounded-[2rem] border border-white/5 shadow-inner",children:[o.jsx("input",{type:"range",min:"1",max:"100",value:Fe,onChange:U=>nt(parseInt(U.target.value)),className:"w-full h-2 bg-slate-800 rounded-lg appearance-none cursor-pointer accent-emerald-500"}),o.jsxs("div",{className:"flex justify-between mt-4 text-[10px] font-bold text-slate-500 italic",children:[o.jsx("span",{children:"۵٪"}),o.jsx("span",{children:"۵۰٪"}),o.jsx("span",{children:"۱۰۰٪"})]})]})]}),o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs("button",{onClick:_,disabled:ce,className:"w-full h-14 bg-primary-600 hover:bg-primary-500 text-white rounded-2xl font-black text-sm transition-all shadow-xl shadow-primary-600/20 flex items-center justify-center gap-3 active:scale-95 disabled:opacity-50",children:[ce?o.jsx("div",{className:"w-5 h-5 border-2 border-white/20 border-t-white rounded-full animate-spin"}):o.jsx(Hr,{size:18}),"ساخت کد تخفیف جادویی (",Fe,"٪ ویژه)"]}),o.jsxs("a",{href:`https://wa.me/${(I=F.phone)==null?void 0:I.replace(/[^0-9]/g,"")}?text=${encodeURIComponent(`سلام ${F.name} عزیز، از خرید شما ممنونیم! یک هدیه ویژه برای شما داریم. کد تخفیف: ${F.generatedCoupon||"WCM-SHOK"}`)}`,target:"_blank",rel:"noreferrer",className:"w-full h-14 bg-emerald-600 hover:bg-emerald-500 text-white rounded-2xl font-black text-sm transition-all flex items-center justify-center gap-3 active:scale-95",children:[o.jsx("div",{className:"w-5 h-5 flex items-center justify-center",children:o.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"w-full h-full",children:o.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.885 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"})})}),"ارسال هدیه در واتساپ"]}),o.jsx("button",{onClick:()=>ve(!0),className:"w-full h-14 bg-white/10 hover:bg-white/20 text-white rounded-2xl font-black text-xs transition-all border border-white/10 active:scale-95",children:"مشاهده پروفایل و سفر مشتری (Deep Analysis)"})]})]},"main"),pe==="coupon"&&o.jsxs(ht.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},className:"bg-primary-500 rounded-3xl p-6 text-center space-y-4 shadow-2xl",children:[o.jsx("div",{className:"w-16 h-16 bg-white/20 rounded-full flex items-center justify-center mx-auto mb-2 animate-bounce",children:o.jsx(Hr,{size:32})}),o.jsx("h5",{className:"text-xl font-black text-white",children:"کد تخفیف جادویی ساخته شد!"}),o.jsx("div",{onClick:()=>{navigator.clipboard.writeText(F.generatedCoupon),ze.success("کد تخفیف کپی شد")},className:"bg-white text-primary-600 font-black text-2xl py-4 rounded-2xl border-2 border-primary-400 shadow-inner cursor-pointer hover:bg-slate-50 transition-colors active:scale-95",children:F.generatedCoupon}),o.jsx("p",{className:"text-[10px] text-white/70 font-bold",children:"برای کپی کردن روی کد بالا کلیک کنید"}),o.jsxs("div",{className:"flex flex-col gap-2 pt-4",children:[o.jsxs("button",{onClick:O,disabled:Ee,className:"h-12 bg-white/20 hover:bg-white/30 rounded-xl text-[10px] font-black flex items-center justify-center gap-2 transition-all border border-white/5 disabled:opacity-50",children:[Ee?o.jsx(ig,{size:14,className:"animate-spin"}):o.jsx(Hr,{size:14}),"ارسال از طریق پیامک (SMS)"]}),o.jsx("button",{onClick:()=>Le("main"),className:"text-xs font-black text-white/50 hover:text-white mt-2",children:"بازگشت"})]})]},"coupon")]})]})]})]})]})]})}),o.jsx(tr,{children:te&&o.jsxs("div",{className:"fixed inset-0 z-[300] overflow-hidden",children:[o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>ve(!1),className:"absolute inset-0 bg-slate-900/40 backdrop-blur-sm"}),o.jsx("div",{className:"fixed inset-y-0 left-0 flex max-w-full",children:o.jsxs(ht.div,{initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%",opacity:0},transition:{type:"spring",damping:30,stiffness:300},className:"w-screen max-w-md bg-white shadow-2xl flex flex-col h-full pointer-events-auto",children:[o.jsxs("div",{className:"p-8 border-b border-slate-100 flex items-center justify-between bg-slate-50",children:[o.jsxs("h3",{className:"text-lg font-black text-slate-900 flex items-center gap-2",children:[o.jsx(qs,{size:20,className:"text-primary-500"}),"سفر و تحلیل فنی مشتری"]}),o.jsx("button",{onClick:()=>ve(!1),className:"w-8 h-8 rounded-full hover:bg-slate-200 flex items-center justify-center font-bold text-slate-400",children:"×"})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto p-8 space-y-12",children:[o.jsxs("section",{className:"space-y-4",children:[o.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-100 pb-2",children:"تحلیل هوشمند رفتار (AI Insight)"}),o.jsxs("div",{className:"bg-primary-50 p-6 rounded-[2rem] border border-primary-100/50 shadow-sm relative overflow-hidden group",children:[o.jsx("div",{className:"absolute top-0 right-0 w-24 h-24 bg-primary-500/5 rounded-full -mr-12 -mt-12"}),o.jsx("div",{className:"relative z-10",children:Re?o.jsxs("div",{className:"flex flex-col items-center py-4 gap-3 text-primary-400",children:[o.jsx(qs,{className:"animate-pulse",size:24}),o.jsx("p",{className:"text-[10px] font-black",children:"هوش مصنوعی در حال تحلیل ذائقه مشتری..."})]}):o.jsx("p",{className:"text-[11px] font-bold text-primary-700 leading-relaxed text-right",dir:"rtl",children:dt||"اطلاعات کافی برای تحلیل هوشمند یافت نشد."})})]})]}),o.jsxs("section",{className:"space-y-4",children:[o.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-100 pb-2",children:"منبع جذب مشتری"}),o.jsxs("div",{className:"bg-indigo-50 p-4 rounded-2xl flex items-center gap-4 border border-indigo-100/50",children:[o.jsx("div",{className:"w-10 h-10 bg-white rounded-xl shadow-sm flex items-center justify-center text-indigo-500",children:o.jsx(eu,{size:20})}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-black text-indigo-900",children:"جستجوی مستقیم (Direct)"}),o.jsx("p",{className:"text-[10px] font-bold text-indigo-400",children:"بدون کمپین - ورود از آدرس سایت"})]})]})]}),o.jsxs("section",{className:"space-y-4",children:[o.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-100 pb-2",children:"پروفایل فنی و دستگاه"}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"bg-slate-50 p-3 rounded-xl border border-slate-100",children:[o.jsx("p",{className:"text-[9px] font-bold text-slate-400 mb-0.5",children:"سیستم عامل"}),o.jsx("p",{className:"text-xs font-black text-slate-700",children:"Windows 11"})]}),o.jsxs("div",{className:"bg-slate-50 p-3 rounded-xl border border-slate-100",children:[o.jsx("p",{className:"text-[9px] font-bold text-slate-400 mb-0.5",children:"مرورگر"}),o.jsx("p",{className:"text-xs font-black text-slate-700",children:"Chrome 122"})]}),o.jsxs("div",{className:"bg-emerald-50 p-3 rounded-xl border border-emerald-100/50 col-span-2",children:[o.jsx("p",{className:"text-[9px] font-bold text-emerald-400 mb-0.5",children:"سرعت لود (LCP)"}),o.jsx("p",{className:"text-xs font-black text-emerald-700",children:"۱.۸ ثانیه - عالی"})]})]})]}),o.jsxs("section",{className:"space-y-6 relative text-right",dir:"rtl",children:[o.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-100 pb-2",children:"تایملاین رفتار مشتری (Journey)"}),o.jsx("div",{className:"space-y-8 relative before:absolute before:right-2.5 before:top-2 before:bottom-2 before:w-0.5 before:bg-slate-100",children:[{time:"۵ دقیقه پیش",action:"ثبت نهایی سفارش",type:"order"},{time:"۸ دقیقه پیش",action:"بررسی سبد خرید و انتخاب روش ارسال",type:"cart"},{time:"۱۱ دقیقه پیش",action:"مشاهده صفحه محصول: نام محصول",type:"page"},{time:"۱۵ دقیقه پیش",action:"ورود به سایت از صفحه اصلی",type:"entry"}].map((U,re)=>o.jsxs("div",{className:"relative pr-8",children:[o.jsx("div",{className:`absolute right-0 top-1 w-5 h-5 rounded-full border-4 border-white shadow-sm z-10 ${U.type==="order"?"bg-emerald-500":U.type==="cart"?"bg-amber-500":"bg-slate-300"}`}),o.jsx("p",{className:"text-[10px] font-black text-slate-400 leading-none mb-1",children:U.time}),o.jsx("p",{className:"text-xs font-bold text-slate-700",children:U.action})]},re))})]}),o.jsx("div",{className:"p-4 bg-primary-50 rounded-2xl border border-primary-100",children:o.jsx("p",{className:"text-[10px] font-bold text-primary-600 leading-relaxed text-center",children:'💡 این اطلاعات به زودی با "پیکسل هوشمند WooCommersa" دقیقتر تحلیل خواهد شد.'})})]})]})})]})}),o.jsx(tr,{children:fe&&F&&o.jsxs("div",{className:"fixed inset-0 z-[400] overflow-hidden",children:[o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>Ve(!1),className:"absolute inset-0 bg-emerald-950/20 backdrop-blur-md"}),o.jsx("div",{className:"fixed inset-y-0 left-0 flex max-w-full",children:o.jsxs(ht.div,{initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"},transition:{type:"spring",damping:30,stiffness:300},className:"w-screen max-w-lg bg-white shadow-2xl flex flex-col h-full pointer-events-auto rounded-r-[3rem] overflow-hidden",children:[o.jsxs("div",{className:"p-8 border-b border-slate-100 flex items-center justify-between bg-emerald-50/50",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-12 h-12 bg-emerald-600 text-white rounded-2xl flex items-center justify-center shadow-lg shadow-emerald-500/20",children:o.jsx(k1,{size:24})}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-lg font-black text-slate-900",children:"تاریخچه سفارشات"}),o.jsxs("p",{className:"text-[10px] font-bold text-slate-400",children:["لیست تراکنشهای بومی ",F.name]})]})]}),o.jsx("button",{onClick:()=>Ve(!1),className:"w-10 h-10 rounded-xl hover:bg-white border border-transparent hover:border-slate-100 flex items-center justify-center font-bold text-slate-400 transition-all",children:"×"})]}),o.jsxs("div",{className:"flex-1 overflow-y-auto p-8 space-y-6",children:[o.jsxs("div",{className:"bg-slate-50/50 border border-slate-100 rounded-[2rem] p-6 space-y-4 hover:bg-white hover:shadow-xl transition-all duration-300",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"px-3 py-1 bg-emerald-100 text-emerald-700 rounded-lg text-[10px] font-black italic",children:"جدیدترین تراکنش"}),o.jsxs("span",{className:"font-black text-slate-900 text-sm",children:["#",F.last_order.number]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase",children:"تاریخ ثبت"}),o.jsx("p",{className:"text-xs font-black text-slate-700",children:G(F.last_order.date)})]}),o.jsxs("div",{className:"space-y-1 text-left",children:[o.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase",children:"وضعیت نهایی"}),o.jsx("p",{className:"text-xs font-black text-emerald-600 bg-emerald-50 px-2 py-0.5 rounded-md inline-block",children:F.last_order.status})]})]}),o.jsxs("div",{className:"pt-4 border-t border-slate-100",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("span",{className:"text-[10px] font-black text-slate-500 flex items-center gap-2",children:[o.jsx(Da,{size:14,className:"text-emerald-500"})," لیست اقلام:"]}),o.jsx("span",{className:"text-sm font-black text-emerald-600",children:Xo(parseFloat(F.last_order.total))})]}),o.jsx("div",{className:"space-y-2",children:(Z=F.last_order.items_raw)==null?void 0:Z.map((U,re)=>o.jsxs("div",{className:"flex items-center justify-between bg-white/50 p-3 rounded-xl border border-slate-50",children:[o.jsx("span",{className:"text-[11px] font-bold text-slate-700",children:U.name}),o.jsxs("span",{className:"text-[10px] font-black text-slate-400",children:["x",U.qty]})]},re))})]})]}),o.jsxs("div",{className:"py-12 flex flex-col items-center justify-center text-slate-300 gap-3",children:[o.jsx(Rx,{size:32,className:"opacity-20"}),o.jsx("p",{className:"text-[10px] font-black text-slate-400",children:"بقیه تاریخچه در نسخههای آینده افزونه اضافه خواهد شد"})]})]}),o.jsx("div",{className:"p-8 bg-slate-50 border-t border-slate-100",children:o.jsx("button",{onClick:()=>{Ve(!1),B(null)},className:"w-full h-14 bg-slate-900 text-white rounded-2xl font-black text-xs hover:bg-slate-800 transition-all shadow-xl",children:"بستن و بازگشت به آنالیز"})})]})})]})})]})},gm=rT(),Vx=({value:t,row:e,column:n,updateData:r,options:i})=>{const[s,a]=W.useState(t),[u,h]=W.useState(!1),m=W.useRef(null);W.useEffect(()=>{a(t)},[t]),W.useEffect(()=>{u&&m.current&&(m.current.focus(),m.current.select&&m.current.select())},[u]);const g=()=>{h(!1),s!==t&&r(e.original.id,n.id,s)},y=C=>{switch(C){case"percent":return"درصدی";case"fixed_cart":return"مبلغ ثابت سبد";case"fixed_product":return"مبلغ ثابت محصول";default:return C}};if(u)return i?o.jsx("select",{ref:m,value:s,onChange:C=>a(C.target.value),onBlur:g,className:"w-full h-10 px-3 py-1 text-sm border-2 border-primary-500 rounded-xl outline-none bg-white shadow-xl z-50 relative font-bold",children:Object.entries(i).map(([C,E])=>o.jsx("option",{value:C,children:E},C))}):n.id==="expiry_date"?o.jsx(Dh,{calendar:Hh,locale:Lh,value:s,onChange:C=>{var E,M,j;return a(((j=(M=(E=C==null?void 0:C.toDate)==null?void 0:E.call(C))==null?void 0:M.toLocaleDateString)==null?void 0:j.call(M,"en-CA"))||"")},className:"rmdp-mobile",onOpenPickNewDate:!1,render:(C,E)=>o.jsx("div",{className:"relative w-full",children:o.jsx("input",{ref:m,onClick:E,value:C,readOnly:!0,onBlur:g,className:"w-full h-10 px-3 py-1 text-sm border-2 border-primary-500 rounded-xl outline-none bg-white shadow-lg z-50 relative font-bold"})})}):o.jsx("div",{className:"relative w-full",children:o.jsx("input",{ref:m,type:"text",value:s,onChange:C=>a(C.target.value),onBlur:g,onKeyDown:C=>{C.key==="Enter"&&g(),C.key==="Escape"&&(a(t),h(!1))},className:"w-full h-10 px-3 py-1 text-sm border-2 border-primary-500 rounded-xl outline-none bg-white shadow-lg z-50 relative font-bold"})});const x=s??"";return o.jsx("div",{onClick:()=>h(!0),className:"cursor-pointer min-h-[2.5rem] w-full px-3 py-2 transition-all hover:bg-slate-100/50 rounded-lg flex items-center justify-start group",children:o.jsxs("div",{className:"truncate w-full text-right font-medium text-slate-700 flex items-center justify-between gap-2",title:String(x),children:[o.jsx("div",{className:"flex items-center gap-2",children:n.id==="type"?o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"text-[11px] font-black text-slate-500 bg-slate-100 px-2.5 py-1 rounded-full border border-slate-200",children:y(x)}),e.original.first_purchase&&o.jsxs("span",{className:"text-[9px] font-black bg-indigo-100 text-indigo-600 px-2 py-0.5 rounded-md border border-indigo-200 flex items-center gap-1",children:[o.jsx(qD,{size:10})," خرید اول"]})]}):n.id==="amount"?o.jsx("span",{className:"font-black text-primary-600",children:e.original.type==="percent"?`${x||0}%`:`${Number(x||0).toLocaleString()} تومان`}):x||o.jsx("span",{className:"text-slate-300 italic text-xs",children:"خالی..."})}),n.id==="code"&&e.original.expiry_date&&new Date(e.original.expiry_date)<new Date&&o.jsx("span",{className:"text-[9px] font-bold text-rose-500 bg-rose-50 px-1.5 py-0.5 rounded border border-rose-100 animate-pulse",children:"منقضی"})]})})},gme=({data:t,updateData:e,onSelectionChange:n,onSortingChange:r,settings:i})=>{const[s,a]=W.useState([]),[u,h]=W.useState({});W.useEffect(()=>{r&&r(s)},[s,r]);const m={percent:"درصدی",fixed_cart:"مبلغ ثابت سبد خرید",fixed_product:"مبلغ ثابت محصول"};W.useEffect(()=>{if(n){const x=Object.keys(u).map(C=>{var M;const E=parseInt(C);return(M=t[E])==null?void 0:M.id}).filter(Boolean);n(x)}},[u,t,n]);const g=W.useMemo(()=>[gm.display({id:"select",header:({table:x})=>o.jsx("div",{className:"flex items-center justify-center",children:o.jsxs("label",{className:"wm-checkbox-wrapper",onClick:C=>C.stopPropagation(),children:[o.jsx("input",{type:"checkbox",className:"wm-checkbox",checked:x.getIsAllRowsSelected(),onChange:x.getToggleAllRowsSelectedHandler()}),o.jsx("div",{className:"wm-checkbox-inner"})]})}),cell:({row:x})=>o.jsx("div",{className:"flex items-center justify-center",children:o.jsxs("label",{className:"wm-checkbox-wrapper",onClick:C=>C.stopPropagation(),children:[o.jsx("input",{type:"checkbox",className:"wm-checkbox",checked:x.getIsSelected(),onChange:x.getToggleSelectedHandler()}),o.jsx("div",{className:"wm-checkbox-inner"})]})})}),gm.accessor("code",{id:"code",header:()=>o.jsxs("div",{className:"flex items-center gap-2 font-black",children:[o.jsx(Mk,{size:14})," کد کوپن"]}),cell:x=>o.jsx(Vx,{...x,value:x.getValue(),updateData:e})}),gm.accessor("type",{id:"type",header:()=>o.jsxs("div",{className:"flex items-center gap-2 font-black",children:[o.jsx(Od,{size:14})," نوع تخفیف"]}),cell:x=>o.jsx(Vx,{...x,value:x.getValue(),options:m,updateData:e})}),gm.accessor("amount",{id:"amount",header:()=>o.jsxs("div",{className:"flex items-center gap-2 font-black",children:[o.jsx(bae,{size:14})," مقدار"]}),cell:x=>o.jsx(Vx,{...x,value:x.getValue(),updateData:e})}),gm.accessor("expiry_date",{id:"expiry_date",header:()=>o.jsxs("div",{className:"flex items-center gap-2 font-black",children:[o.jsx(Ll,{size:14})," تاریخ انقضا"]}),cell:x=>o.jsx(Vx,{...x,value:x.getValue(),updateData:e})}),gm.accessor("usage_limit",{id:"usage_limit",header:()=>o.jsxs("div",{className:"flex items-center gap-2 font-black",children:[o.jsx(qs,{size:14})," حد استفاده"]}),cell:x=>o.jsxs("div",{className:"space-y-1.5 w-full min-w-[120px]",children:[o.jsxs("div",{className:"flex items-center justify-between text-[10px] font-bold",children:[o.jsxs("span",{className:"text-slate-400",children:[x.row.original.usage_count," استفاده شده"]}),o.jsx("span",{className:"text-slate-600",children:x.getValue()||"∞"})]}),x.getValue()?o.jsx("div",{className:"h-1.5 w-full bg-slate-100 rounded-full overflow-hidden border border-slate-200",children:o.jsx(ht.div,{initial:{width:0},animate:{width:`${Math.min(100,x.row.original.usage_count/x.getValue()*100)}%`},className:`h-full rounded-full ${x.row.original.usage_count/x.getValue()>.9?"bg-rose-500":"bg-primary-500"}`})}):o.jsx("div",{className:"h-1.5 w-full bg-slate-100 rounded-full overflow-hidden border border-slate-200",children:o.jsx("div",{className:"h-full w-full bg-slate-200 opacity-30"})})]})}),gm.accessor("minimum_amount",{id:"minimum_amount",header:()=>o.jsxs("div",{className:"flex items-center gap-2 font-black",children:[o.jsx(t2,{size:14})," حداقل خرید"]}),cell:x=>o.jsx(Vx,{...x,value:x.getValue(),updateData:e})}),gm.accessor("description",{id:"description",header:()=>o.jsxs("div",{className:"flex items-center gap-2 font-black",children:[o.jsx(Sx,{size:14})," توضیحات"]}),cell:x=>o.jsx(Vx,{...x,updateData:e})}),gm.display({id:"actions",header:"عملیات",cell:({row:x})=>o.jsx("a",{href:`${window.woocommersa_data.adminUrl}post.php?post=${x.original.id}&action=edit`,target:"_blank",rel:"noreferrer",className:"p-2.5 hover:bg-slate-100 rounded-xl text-slate-400 hover:text-primary-600 transition-all flex items-center justify-center",title:"ویرایش در وردپرس",children:o.jsx($u,{size:18})})})].filter(x=>x.id==="select"||x.id==="actions"||!(i!=null&&i.coupon_columns)||i.coupon_columns.length===0?!0:i.coupon_columns.includes(x.id)),[e,i]),y=cT({data:t,columns:g,state:{sorting:s,rowSelection:u},onSortingChange:a,onRowSelectionChange:h,getCoreRowModel:lT(),getSortedRowModel:TH(),enableRowSelection:!0});return o.jsx("div",{className:"overflow-auto relative max-h-[70vh] border border-slate-100 rounded-xl",children:o.jsxs("table",{className:"w-full border-collapse",children:[o.jsx("thead",{className:"bg-slate-50 sticky top-0 z-20 backdrop-blur-sm shadow-sm border-b border-slate-100",children:y.getHeaderGroups().map(x=>o.jsx("tr",{children:x.headers.map(C=>o.jsx("th",{className:`px-6 py-4 text-right text-[11px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-100 bg-slate-50/50 transition-colors ${C.column.getCanSort()?"cursor-pointer hover:bg-slate-100":""}`,onClick:C.column.getToggleSortingHandler(),children:o.jsxs("div",{className:"flex items-center gap-2",children:[C.isPlaceholder?null:mg(C.column.columnDef.header,C.getContext()),C.column.getCanSort()&&o.jsx("div",{className:"text-slate-400",children:C.column.getIsSorted()==="asc"?o.jsx(YD,{size:14}):C.column.getIsSorted()==="desc"?o.jsx(UD,{size:14}):o.jsx(jU,{size:14,className:"opacity-0 group-hover:opacity-100"})})]})},C.id))},x.id))}),o.jsx("tbody",{className:"divide-y divide-slate-100 bg-white",children:o.jsx(tr,{children:y.getRowModel().rows.map(x=>o.jsx(ht.tr,{initial:{opacity:0},animate:{opacity:1},className:`group hover:bg-slate-50/50 transition-colors ${x.getIsSelected()?"bg-primary-50/30":""}`,children:x.getVisibleCells().map(C=>o.jsx("td",{className:"px-6 py-4",children:mg(C.column.columnDef.cell,C.getContext())},C.id))},x.id))})})]})})},vme=({settings:t})=>{const[e,n]=W.useState([]),[r,i]=W.useState(!0),[s,a]=W.useState(""),[u,h]=W.useState(""),[m,g]=W.useState(""),[y,x]=W.useState(""),[C,E]=W.useState(1),[M,j]=W.useState(1),[L,D]=W.useState(0),[z,H]=W.useState(25),[V,F]=W.useState([]),[B,te]=W.useState(!1),[ve,ce]=W.useState(!1),[_e,pe]=W.useState({count:10,prefix:"SALE-",amount:10,type:"percent",expiry_date:"",validity_days:0,usage_limit:1}),[Le,Fe]=W.useState(!1),[nt,dt]=W.useState({}),[$e,Re]=W.useState(!1),[Ze,Ee]=W.useState({count:1,amount:15,type:"percent",prefix:"WELCOME-"}),Q=async()=>{i(!0);try{const k=new URLSearchParams({page:String(C),type:u,special_type:m,status:y,search:s,per_page:String(z)}),N=await(await fetch(`${window.woocommersa_data.apiUrl}/coupons?${k}`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();n(N.coupons||[]),D(N.total),j(N.pages)}catch{ze.error("خطا در دریافت کوپنها")}finally{i(!1)}};W.useEffect(()=>{Q()},[C,u,m,y,z]),W.useEffect(()=>(B||ve||Le||$e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[B,ve,Le,$e]),W.useEffect(()=>{const k=setTimeout(()=>{s!==""&&Q()},500);return()=>clearTimeout(k)},[s]);const fe=async(k,_,N)=>{try{(await fetch(`${window.woocommersa_data.apiUrl}/coupons/update`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({id:k,field:_,value:N})})).ok&&(n(G=>G.map(q=>q.id===k?{...q,[_]:N}:q)),ze.success("کوپن بروزرسانی شد",{id:`upd-${k}`}))}catch{ze.error("خطا در بروزرسانی")}},Ve=async()=>{if(V.length!==0&&window.confirm(`آیا از حذف ${V.length} کوپن مطمئن هستید؟ این عمل غیرقابل بازگشت است.`)){ze.loading("در حال حذف...",{id:"bulk-del"});try{(await fetch(`${window.woocommersa_data.apiUrl}/coupons/delete`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({ids:V})})).ok&&(ze.success(`${V.length} کوپن حذف شدند`,{id:"bulk-del"}),Q(),F([]))}catch{ze.error("خطا در حذف گروهی",{id:"bulk-del"})}}},ne=async()=>{ze.loading("در حال تولید کوپنها...",{id:"gen-coupons"});try{const k=await fetch(`${window.woocommersa_data.apiUrl}/coupons/generate`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify(_e)});if(k.ok)ze.success("کوپنها با موفقیت ساخته شدند",{id:"gen-coupons"}),te(!1),Q();else{const _=await k.json();ze.error(_.message||"خطا در تولید کوپن",{id:"gen-coupons"})}}catch{ze.error("خطای ارتباط با سرور",{id:"gen-coupons"})}},xe=async()=>{ze.loading("در حال تولید کوپن اول...",{id:"gen-first"});try{const k=await fetch(`${window.woocommersa_data.apiUrl}/coupons/generate-first-purchase`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify(Ze)});if(k.ok)ze.success(`تعداد ${Ze.count||1} کوپن با موفقیت ساخته شد`,{id:"gen-first"}),ce(!1),Q();else{const _=await k.json();ze.error(_.message||"خطا در تولید کوپن اول",{id:"gen-first"})}}catch{ze.error("خطای ارتباط با بخش سئو/کوپن",{id:"gen-first"})}},Ke=async()=>{if(V.length!==0){ze.loading("در حال بروزرسانی گروهی...",{id:"bulk-upd"});try{(await fetch(`${window.woocommersa_data.apiUrl}/coupons/bulk-update`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({ids:V,updates:nt})})).ok&&(ze.success("بروزرسانی گروهی انجام شد",{id:"bulk-upd"}),Q(),F([]),Re(!1),Fe(!1),dt({}))}catch{ze.error("خطا در بروزرسانی گروهی",{id:"bulk-upd"})}}},qe=[{id:"type",label:"نوع تخفیف"},{id:"amount",label:"مقدار تخفیف"},{id:"expiry_date",label:"تاریخ انقضا"},{id:"usage_limit",label:"حد استفاده"},{id:"minimum_amount",label:"حداقل خرید"},{id:"maximum_amount",label:"حداکثر خرید"}],we=k=>{switch(k){case"percent":return"درصدی";case"fixed_cart":return"مبلغ ثابت سبد";case"fixed_product":return"مبلغ ثابت محصول";default:return k}};return o.jsxs("div",{className:"space-y-6",dir:"rtl",children:[o.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-4 bg-white p-6 rounded-[2rem] shadow-xl border border-slate-100",children:[o.jsxs("div",{className:"relative flex-1 group w-full",children:[o.jsx("input",{type:"text",value:s,onChange:k=>a(k.target.value),placeholder:"جستجوی کد کوپن یا توضیحات...",className:"w-full h-14 pl-14 pr-6 bg-white rounded-2xl border border-slate-200 focus:ring-4 focus:ring-primary-500/10 focus:border-primary-500 outline-none shadow-sm transition-all"}),o.jsx("button",{onClick:Q,className:"absolute left-1.5 top-1.5 w-11 h-11 bg-primary-600 text-white rounded-xl hover:bg-primary-700 transition-all flex items-center justify-center shadow-lg shadow-primary-500/20 active:scale-95 z-10",children:r?o.jsx(ur,{className:"animate-spin",size:18}):o.jsx(Ia,{size:18})})]}),o.jsxs("div",{className:"flex items-center gap-3 w-full md:w-auto",children:[o.jsxs("select",{value:u,onChange:k=>{h(k.target.value),E(1)},className:"wm-select h-14 min-w-[150px] font-bold text-xs",children:[o.jsx("option",{value:"",children:"نوع تخفیف"}),o.jsx("option",{value:"percent",children:"درصدی"}),o.jsx("option",{value:"fixed_cart",children:"مبلغ ثابت سبد"}),o.jsx("option",{value:"fixed_product",children:"مبلغ ثابت محصول"})]}),o.jsxs("select",{value:m,onChange:k=>{g(k.target.value),E(1)},className:`wm-select h-14 font-bold text-xs min-w-[150px] ${m?"ring-4 ring-indigo-500/10 border-indigo-500 text-indigo-600":""}`,children:[o.jsx("option",{value:"",children:"همه کوپنها"}),o.jsx("option",{value:"first_purchase",children:"فقط خرید اول"})]}),o.jsxs("select",{value:y,onChange:k=>{x(k.target.value),E(1)},className:`wm-select h-14 font-bold text-xs min-w-[150px] ${y==="active"?"text-emerald-600 border-emerald-200":y==="expired"?"text-rose-600 border-rose-200":""}`,children:[o.jsx("option",{value:"",children:"همه وضعیتها"}),o.jsx("option",{value:"active",children:"فعال و معتبر"}),o.jsx("option",{value:"expired",children:"منقضی شده"})]}),o.jsx("button",{onClick:Q,className:"w-14 h-14 bg-slate-50 text-slate-500 rounded-2xl hover:bg-primary-50 hover:text-primary-600 transition-all flex items-center justify-center border-2 border-transparent active:scale-95 shrink-0",children:o.jsx(ur,{className:r?"animate-spin":"",size:20})})]}),o.jsxs("div",{className:"flex items-center gap-2 w-full md:w-auto border-r md:pr-4 border-slate-100",children:[o.jsxs("button",{onClick:()=>ce(!0),className:"h-14 px-6 bg-indigo-600 text-white rounded-2xl font-black text-xs flex items-center gap-2 hover:bg-indigo-700 shadow-lg shadow-indigo-500/30 transition-all active:scale-95 shrink-0",children:[o.jsx(qD,{size:18}),"تخفیف خرید اول"]}),o.jsxs("button",{onClick:()=>te(!0),className:"h-14 px-6 bg-primary-600 text-white rounded-2xl font-black text-xs flex items-center gap-2 hover:bg-primary-700 shadow-lg shadow-primary-500/30 transition-all active:scale-95 shrink-0",children:[o.jsx(m0,{size:18}),"ساخت خودکار"]})]})]}),o.jsx("div",{className:"bg-white rounded-[2.5rem] shadow-2xl shadow-slate-200/50 border border-slate-200 overflow-hidden flex flex-col min-h-[500px]",children:r&&e.length===0?o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 py-20",children:[o.jsx("div",{className:"w-16 h-16 border-4 border-primary-100 border-t-primary-600 rounded-full animate-spin"}),o.jsx("span",{className:"text-slate-400 font-bold",children:"در حال بارگذاری کوپنها..."})]}):e.length===0?o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 py-20 text-slate-400",children:[o.jsx(Od,{size:48,className:"opacity-20"}),o.jsx("span",{className:"font-bold",children:"هیچ کوپنی یافت نشد"})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(gme,{data:e,updateData:fe,onSelectionChange:F,settings:t})}),o.jsxs("div",{className:"p-6 border-t border-slate-100 bg-slate-50/50 flex flex-col md:flex-row items-center justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"text-sm font-bold text-slate-500",children:["نمایش ",e.length," از مجموع ",L," کوپن"]}),o.jsx("div",{className:"w-28",children:o.jsx("select",{value:z,onChange:k=>{H(Number(k.target.value)),E(1)},className:"wm-select h-10 !text-[11px]",children:[25,50,100,200].map(k=>o.jsxs("option",{value:k,children:[k," ردیف"]},k))})}),V.length>0&&o.jsxs("div",{className:"flex items-center gap-2 animate-in fade-in slide-in-from-right-4",children:[o.jsx("div",{className:"h-6 w-px bg-slate-200"}),o.jsxs("span",{className:"text-xs font-black text-primary-600 px-3 py-1 bg-primary-50 rounded-full border border-primary-100",children:[V.length," مورد انتخاب شده"]}),o.jsx("button",{onClick:()=>Fe(!0),className:"p-2 text-primary-600 hover:bg-primary-50 rounded-xl transition-colors",title:"ویرایش گروهی",children:o.jsx(Zc,{size:18})}),o.jsx("button",{onClick:Ve,className:"p-2 text-rose-500 hover:bg-rose-50 rounded-xl transition-colors",title:"حذف گروهی",children:o.jsx(zu,{size:18})})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{disabled:C===1,onClick:()=>E(k=>k-1),className:"h-10 px-4 bg-white border border-slate-200 rounded-xl hover:bg-slate-50 disabled:opacity-30 disabled:hover:bg-white text-slate-600 font-bold flex items-center gap-2 transition-all",children:[o.jsx(f0,{size:16}),"قبلی"]}),o.jsxs("div",{className:"flex items-center gap-1",children:[[...Array(Math.min(5,M))].map((k,_)=>{const N=_+1;return o.jsx("button",{onClick:()=>E(N),className:`w-10 h-10 rounded-xl font-black text-sm transition-all ${C===N?"bg-primary-600 text-white shadow-lg shadow-primary-500/30":"bg-white border border-slate-200 text-slate-500 hover:bg-slate-50"}`,children:N},N)}),M>5&&o.jsx("span",{className:"px-2 text-slate-300 tracking-widest",children:"..."})]}),o.jsxs("button",{disabled:C===M,onClick:()=>E(k=>k+1),className:"h-10 px-4 bg-white border border-slate-200 rounded-xl hover:bg-slate-50 disabled:opacity-30 disabled:hover:bg-white text-slate-600 font-bold flex items-center gap-2 transition-all",children:["بعدی",o.jsx(N1,{size:16})]})]})]})]})}),o.jsx(tr,{children:B&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-slate-900/60 backdrop-blur-md flex items-center justify-center p-8",onClick:()=>te(!1),children:o.jsxs(ht.div,{initial:{scale:.9,y:20},animate:{scale:1,y:0},exit:{scale:.9,y:20},className:"w-full max-w-lg bg-white rounded-[2.5rem] shadow-2xl overflow-hidden",dir:"rtl",onClick:k=>k.stopPropagation(),children:[o.jsxs("div",{className:"p-8 border-b border-slate-100 flex items-center justify-between bg-primary-50/30",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-12 h-12 bg-primary-600 rounded-2xl flex items-center justify-center shadow-lg shadow-primary-500/30 text-white",children:o.jsx(m0,{size:24})}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-black text-lg text-slate-900 leading-none",children:"ساخت خودکار کوپن"}),o.jsx("p",{className:"text-xs text-slate-400 mt-1 font-bold italic",children:"تولید هوشمند کدهای تخفیف با الگو"})]})]}),o.jsx("button",{onClick:()=>te(!1),className:"text-slate-400 hover:text-slate-600 transition-colors",children:o.jsx(GD,{size:24})})]}),o.jsxs("div",{className:"p-8 space-y-6",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-[11px] font-black text-slate-500 mr-2",children:"تعداد کوپن"}),o.jsx("input",{type:"number",value:_e.count,onChange:k=>pe({..._e,count:parseInt(k.target.value)}),className:"w-full h-12 px-4 bg-slate-50 rounded-xl border-2 border-transparent focus:border-primary-500 outline-none font-bold text-center"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-[11px] font-black text-slate-500 mr-2",children:"پیشوند کد"}),o.jsx("input",{type:"text",value:_e.prefix,onChange:k=>pe({..._e,prefix:k.target.value}),className:"w-full h-12 px-4 bg-slate-50 rounded-xl border-2 border-transparent focus:border-primary-500 outline-none font-bold text-center uppercase"})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-[11px] font-black text-slate-500 mr-2",children:"نوع تخفیف"}),o.jsxs("select",{value:_e.type,onChange:k=>pe({..._e,type:k.target.value}),className:"w-full h-12 px-4 bg-slate-50 rounded-xl border-2 border-transparent focus:border-primary-500 outline-none font-bold cursor-pointer",children:[o.jsx("option",{value:"percent",children:"درصدی"}),o.jsx("option",{value:"fixed_cart",children:"مبلغ ثابت سبد"}),o.jsx("option",{value:"fixed_product",children:"مبلغ ثابت محصول"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-[11px] font-black text-slate-500 mr-2",children:"مقدار تخفیف"}),o.jsxs("div",{className:"relative",children:[o.jsx("input",{type:"number",value:_e.amount,onChange:k=>pe({..._e,amount:parseFloat(k.target.value)}),className:"w-full h-12 px-4 bg-slate-50 rounded-xl border-2 border-transparent focus:border-primary-500 outline-none font-bold text-center"}),o.jsx("div",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 font-bold text-[10px]",children:_e.type==="percent"?"%":"تومان"})]})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-[11px] font-black text-slate-500 mr-2",children:"تاریخ انقضا (ثابت)"}),o.jsxs("div",{className:"relative",children:[o.jsx(Dh,{calendar:Hh,locale:Lh,value:_e.expiry_date,onChange:k=>{var _,N,O;return pe({..._e,expiry_date:((O=(N=(_=k==null?void 0:k.toDate)==null?void 0:_.call(k))==null?void 0:N.toLocaleDateString)==null?void 0:O.call(N,"en-CA"))||"",validity_days:0})},className:"rmdp-mobile",render:(k,_)=>o.jsxs("div",{className:"relative",children:[o.jsx("input",{onClick:_,value:k,readOnly:!0,placeholder:"انتخاب تاریخ...",className:"w-full h-12 px-4 bg-slate-50 rounded-xl border-2 border-transparent focus:border-primary-500 outline-none font-bold text-center cursor-pointer"}),o.jsx(Ll,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:18})]})}),_e.expiry_date&&o.jsxs("div",{className:"mt-1 text-[10px] font-bold text-primary-600 mr-2 flex items-center gap-1",children:[o.jsx(ho,{size:10})," تاریخ شمسی انتخاب شد"]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-[11px] font-black text-slate-500 mr-2",children:"مدت اعتبار (تعداد روز)"}),o.jsx("input",{type:"number",placeholder:"مثلاً 30 روز",value:_e.validity_days||"",onChange:k=>pe({..._e,validity_days:parseInt(k.target.value)||0,expiry_date:""}),className:"w-full h-12 px-4 bg-slate-50 rounded-xl border-2 border-transparent focus:border-primary-500 outline-none font-bold text-center"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-[11px] font-black text-slate-500 mr-2",children:"تعداد استفاده (هر کوپن)"}),o.jsx("input",{type:"number",placeholder:"مثلاً 1 (فقط یکبار استفاده)",value:_e.usage_limit||"",onChange:k=>pe({..._e,usage_limit:parseInt(k.target.value)||0}),className:"w-full h-12 px-4 bg-slate-50 rounded-xl border-2 border-transparent focus:border-primary-500 outline-none font-bold text-center"}),o.jsx("p",{className:"text-[10px] text-slate-400 font-bold mr-2",children:"خالی بماند = نامحدود"})]}),o.jsxs("div",{className:"p-4 bg-slate-50 rounded-2xl border border-slate-100 flex items-center justify-between",children:[o.jsx("span",{className:"text-xs font-bold text-slate-500",children:"مثال کد تولید شده:"}),o.jsxs("code",{className:"text-xs font-black text-primary-600 bg-white px-3 py-1 rounded-lg border border-slate-200",children:[_e.prefix,"F3A9B2"]})]})]}),o.jsxs("div",{className:"p-8 bg-slate-50 border-t border-slate-100 flex items-center gap-4",children:[o.jsx("button",{onClick:ne,className:"flex-1 h-14 bg-primary-600 text-white rounded-2xl font-black text-sm flex items-center justify-center gap-2 hover:bg-primary-700 shadow-xl shadow-primary-500/30 transition-all active:scale-95",children:"تولید و ذخیره نهایی"}),o.jsx("button",{onClick:()=>te(!1),className:"px-8 h-14 bg-white text-slate-500 border border-slate-200 rounded-2xl font-bold text-sm hover:bg-slate-100 transition-all",children:"انصراف"})]})]})},"generate-modal")}),o.jsx(tr,{children:ve&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-slate-900/60 backdrop-blur-md flex items-center justify-center p-8",onClick:()=>ce(!1),children:o.jsxs(ht.div,{initial:{scale:.9,y:20},animate:{scale:1,y:0},exit:{scale:.9,y:20},className:"w-full max-w-lg bg-white rounded-[2.5rem] shadow-2xl overflow-hidden",dir:"rtl",onClick:k=>k.stopPropagation(),children:[o.jsxs("div",{className:"p-8 border-b border-slate-100 flex items-center justify-between bg-indigo-50/30",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-12 h-12 bg-indigo-600 rounded-2xl flex items-center justify-center shadow-lg shadow-indigo-500/30 text-white",children:o.jsx(qD,{size:24})}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-black text-lg text-slate-900 leading-none",children:"تخفیف ویژه اولین خرید"}),o.jsx("p",{className:"text-xs text-slate-400 mt-1 font-bold italic",children:"مختص مشتریانی که هنوز خریدی نداشتهاند"})]})]}),o.jsx("button",{onClick:()=>ce(!1),className:"text-slate-400 hover:text-slate-600 transition-colors",children:o.jsx(GD,{size:24})})]}),o.jsxs("div",{className:"p-8 space-y-6",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-[11px] font-black text-slate-500 mr-2",children:"تعداد کوپن"}),o.jsx("input",{type:"number",value:Ze.count,onChange:k=>Ee({...Ze,count:parseInt(k.target.value)||1}),className:"w-full h-12 px-4 bg-slate-50 rounded-xl border-2 border-transparent focus:border-indigo-500 outline-none font-bold text-center"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-[11px] font-black text-slate-500 mr-2",children:"پیشوند کد (اختیاری)"}),o.jsx("input",{type:"text",placeholder:"WELCOME-",value:Ze.prefix,onChange:k=>Ee({...Ze,prefix:k.target.value.toUpperCase()}),className:"w-full h-12 px-4 bg-slate-50 rounded-xl border-2 border-transparent focus:border-indigo-500 outline-none font-bold text-center uppercase"})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-[11px] font-black text-slate-500 mr-2",children:"نوع تخفیف"}),o.jsxs("select",{value:Ze.type,onChange:k=>Ee({...Ze,type:k.target.value}),className:"w-full h-12 px-4 bg-slate-50 rounded-xl border-2 border-transparent focus:border-indigo-500 outline-none font-bold cursor-pointer",children:[o.jsx("option",{value:"percent",children:"درصدی"}),o.jsx("option",{value:"fixed_cart",children:"مبلغ ثابت سبد"})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-[11px] font-black text-slate-500 mr-2",children:"مقدار تخفیف"}),o.jsx("input",{type:"number",value:Ze.amount,onChange:k=>Ee({...Ze,amount:parseFloat(k.target.value)||0}),className:"w-full h-12 px-4 bg-slate-50 rounded-xl border-2 border-transparent focus:border-indigo-500 outline-none font-bold text-center"})]})]}),o.jsxs("div",{className:"p-4 bg-blue-50 rounded-2xl border border-blue-100 flex items-start gap-4",children:[o.jsx(VU,{className:"text-blue-600 shrink-0 mt-1",size:18}),o.jsx("p",{className:"text-[10px] text-blue-700 leading-relaxed font-bold",children:"این کوپنها به طور خودکار محدود به ۱ بار استفاده برای هر مشتری میشوند و سیستم از اعمال آنها روی کاربرانی که سابقه خرید دارند جلوگیری میکند."})]})]}),o.jsxs("div",{className:"p-8 bg-slate-50 border-t border-slate-100 flex items-center gap-4",children:[o.jsx("button",{onClick:xe,className:"flex-1 h-14 bg-indigo-600 text-white rounded-2xl font-black text-sm flex items-center justify-center gap-2 hover:bg-indigo-700 shadow-xl shadow-indigo-500/30 transition-all active:scale-95",children:"تولید کوپن هوشمند"}),o.jsx("button",{onClick:()=>ce(!1),className:"px-8 h-14 bg-white text-slate-500 border border-slate-200 rounded-2xl font-bold text-sm hover:bg-slate-100 transition-all",children:"انصراف"})]})]})},"first-purchase-modal")}),o.jsx(tr,{children:Le&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-slate-900/60 backdrop-blur-md flex items-center justify-center p-8",onClick:()=>Fe(!1),children:o.jsxs(ht.div,{initial:{scale:.9,y:20},animate:{scale:1,y:0},exit:{scale:.9,y:20},className:"w-full max-w-2xl bg-white rounded-[3rem] shadow-2xl overflow-hidden border border-slate-200",dir:"rtl",onClick:k=>k.stopPropagation(),children:[o.jsxs("div",{className:"p-8 border-b border-slate-100 bg-primary-50/20 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-14 h-14 bg-primary-600 rounded-[1.5rem] flex items-center justify-center shadow-lg shadow-primary-500/30 text-white",children:o.jsx(Zc,{size:28})}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-black text-xl text-slate-900",children:"ویرایش گروهی کوپنها"}),o.jsxs("p",{className:"text-xs text-slate-400 mt-1 font-bold",children:["برای ",V.length," کوپن انتخاب شده"]})]})]}),o.jsx("button",{onClick:()=>Fe(!1),className:"w-10 h-10 rounded-full hover:bg-slate-100 flex items-center justify-center text-slate-400 transition-colors",children:o.jsx(GD,{size:24})})]}),o.jsxs("div",{className:"p-10 space-y-8 max-h-[60vh] overflow-y-auto wm-custom-scrollbar",children:[o.jsx("div",{className:"grid grid-cols-2 gap-8",children:qe.map(k=>o.jsxs("div",{className:"space-y-3",children:[o.jsxs("label",{className:"text-xs font-black text-slate-500 px-1 flex items-center gap-2",children:[k.id==="type"?o.jsx(Rx,{size:14}):k.id==="amount"?o.jsx(Hr,{size:14}):o.jsx(Ll,{size:14}),k.label]}),k.id==="type"?o.jsxs("select",{value:nt[k.id]||"",onChange:_=>dt({...nt,[k.id]:_.target.value}),className:"w-full h-14 px-5 bg-slate-50 border-2 border-transparent focus:border-primary-500 focus:bg-white rounded-2xl outline-none font-bold transition-all appearance-none cursor-pointer",children:[o.jsx("option",{value:"",children:"(بدون تغییر)"}),o.jsx("option",{value:"percent",children:"درصدی"}),o.jsx("option",{value:"fixed_cart",children:"مبلغ ثابت سبد"}),o.jsx("option",{value:"fixed_product",children:"مبلغ ثابت محصول"})]}):o.jsxs("div",{className:"space-y-1",children:[o.jsx("input",{type:k.id==="expiry_date"?"date":"text",placeholder:k.id==="amount"?"مثال: 20 یا +5 یا -2":"مقدار جدید...",value:nt[k.id]||"",onChange:_=>dt({...nt,[k.id]:_.target.value}),className:"w-full h-14 px-5 bg-slate-50 border-2 border-transparent focus:border-primary-500 focus:bg-white rounded-2xl outline-none font-bold transition-all"}),k.id==="expiry_date"&&nt[k.id]&&o.jsxs("p",{className:"text-[10px] font-bold text-primary-600 mr-2",children:["معادل شمسی: ",new Intl.DateTimeFormat("fa-IR-u-ca-persian",{year:"numeric",month:"long",day:"numeric"}).format(new Date(nt[k.id]))]}),k.id==="usage_limit"&&o.jsx("p",{className:"text-[9px] text-slate-400 mr-2",children:"حداکثر تعداد دفعاتی که این کوپن میتواند استفاده شود."}),k.id==="minimum_amount"&&o.jsx("p",{className:"text-[9px] text-slate-400 mr-2",children:"حداقل مبلغ خرید برای فعال شدن کوپن."}),k.id==="maximum_amount"&&o.jsx("p",{className:"text-[9px] text-slate-400 mr-2",children:"سقف مبلغ خریدی که کوپن روی آن اعمال میشود."})]})]},k.id))}),o.jsxs("div",{className:"p-6 bg-amber-50 rounded-3xl border border-amber-100 flex items-start gap-4",children:[o.jsx(Ph,{className:"text-amber-600 shrink-0 mt-1",size:20}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-xs font-black text-amber-900 leading-none",children:"نکته برای مقدار (Amount):"}),o.jsxs("p",{className:"text-[11px] text-amber-700 leading-relaxed font-medium",children:["شما میتوانید از نمادهای ",o.jsx("code",{className:"bg-amber-100 px-1 rounded",children:"+"})," و ",o.jsx("code",{className:"bg-amber-100 px-1 rounded",children:"-"})," برای افزایش یا کاهش نسبی مقدار فعلی کوپنها استفاده کنید."]})]})]})]}),o.jsxs("div",{className:"p-8 bg-slate-50 border-t border-slate-100 flex items-center gap-4",children:[o.jsxs("button",{onClick:()=>Re(!0),disabled:Object.keys(nt).length===0,className:"flex-1 h-16 bg-primary-600 text-white rounded-[1.5rem] font-black text-sm flex items-center justify-center gap-3 hover:bg-primary-700 shadow-xl shadow-primary-500/30 transition-all active:scale-95 disabled:opacity-50 disabled:shadow-none",children:[o.jsx(Jp,{size:20}),"پیشنمایش تغییرات"]}),o.jsx("button",{onClick:()=>Fe(!1),className:"px-10 h-16 bg-white text-slate-500 border-2 border-slate-200 rounded-[1.5rem] font-bold text-sm hover:bg-slate-100 transition-all",children:"انصراف"})]})]})},"bulk-edit-modal")}),o.jsx(tr,{children:$e&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-slate-900/80 backdrop-blur-xl flex items-center justify-center p-8",onClick:()=>Re(!1),children:o.jsx(ht.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"w-full max-w-xl bg-white rounded-[3rem] shadow-2xl overflow-hidden border border-white/20",dir:"rtl",onClick:k=>k.stopPropagation(),children:o.jsxs("div",{className:"p-10 text-center space-y-6",children:[o.jsx("div",{className:"w-20 h-20 bg-primary-50 text-primary-600 rounded-3xl flex items-center justify-center mx-auto shadow-inner",children:o.jsx(Qp,{size:40,className:"animate-pulse"})}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("h3",{className:"font-black text-2xl text-slate-900",children:"تأیید نهایی تغییرات"}),o.jsxs("p",{className:"text-slate-500 font-medium italic",children:["آیا از اعمال تغییرات زیر روی ",V.length," کوپن مطمئن هستید؟"]})]}),o.jsxs("div",{className:"bg-slate-50 rounded-3xl p-6 space-y-4 border border-slate-200 shadow-sm overflow-hidden relative",children:[Object.entries(nt).map(([k,_])=>{var N;return o.jsxs("div",{className:"flex items-center justify-between border-b border-slate-100 pb-3 last:border-0 last:pb-0",children:[o.jsx("span",{className:"text-sm font-black text-slate-400",children:(N=qe.find(O=>O.id===k))==null?void 0:N.label}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"text-xs text-slate-400 line-through",children:"(مقدار فعلی)"}),o.jsx(f0,{size:14,className:"text-primary-400"}),o.jsx("span",{className:"text-sm font-black text-primary-600 px-3 py-1 bg-white rounded-lg border border-primary-100",children:k==="type"?we(_):_})]})]},k)}),o.jsx("div",{className:"absolute top-0 right-0 w-24 h-24 bg-primary-500/5 blur-3xl rounded-full"})]}),o.jsxs("div",{className:"flex items-center gap-4 pt-4",children:[o.jsxs("button",{onClick:Ke,className:"flex-1 h-16 bg-primary-600 text-white rounded-3xl font-black text-sm flex items-center justify-center gap-3 hover:bg-primary-700 shadow-2xl shadow-primary-500/40 transition-all active:scale-95",children:[o.jsx(ho,{size:22}),"بله، اعمال کن"]}),o.jsx("button",{onClick:()=>Re(!1),className:"flex-1 h-16 bg-white text-rose-500 border-2 border-rose-100 rounded-3xl font-black text-sm hover:bg-rose-50 shadow-lg shadow-rose-200/20 transition-all",children:"بازگشت و اصلاح"})]})]})})},"preview-modal")})]})};/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:_Y,setPrototypeOf:EY,isFrozen:bme,getPrototypeOf:yme,getOwnPropertyDescriptor:xme}=Object;let{freeze:$l,seal:Ku,create:bT}=Object,{apply:VH,construct:BH}=typeof Reflect<"u"&&Reflect;$l||($l=function(e){return e}),Ku||(Ku=function(e){return e}),VH||(VH=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return e.apply(n,i)}),BH||(BH=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new e(...r)});const yT=zl(Array.prototype.forEach),wme=zl(Array.prototype.lastIndexOf),NY=zl(Array.prototype.pop),J1=zl(Array.prototype.push),Cme=zl(Array.prototype.splice),xT=zl(String.prototype.toLowerCase),WH=zl(String.prototype.toString),UH=zl(String.prototype.match),eR=zl(String.prototype.replace),Sme=zl(String.prototype.indexOf),Rme=zl(String.prototype.trim),ru=zl(Object.prototype.hasOwnProperty),Fl=zl(RegExp.prototype.test),tR=_me(TypeError);function zl(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return VH(t,e,r)}}function _me(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return BH(t,n)}}function Br(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xT;EY&&EY(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const s=n(i);s!==i&&(bme(e)||(e[r]=s),i=s)}t[i]=!0}return t}function Eme(t){for(let e=0;e<t.length;e++)ru(t,e)||(t[e]=null);return t}function Fh(t){const e=bT(null);for(const[n,r]of _Y(t))ru(t,n)&&(Array.isArray(r)?e[n]=Eme(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=Fh(r):e[n]=r);return e}function nR(t,e){for(;t!==null;){const r=xme(t,e);if(r){if(r.get)return zl(r.get);if(typeof r.value=="function")return zl(r.value)}t=yme(t)}function n(){return null}return n}const kY=$l(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),YH=$l(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),GH=$l(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Nme=$l(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),KH=$l(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),kme=$l(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),TY=$l(["#text"]),jY=$l(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),qH=$l(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),MY=$l(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),wT=$l(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Tme=Ku(/\{\{[\w\W]*|[\w\W]*\}\}/gm),jme=Ku(/<%[\w\W]*|[\w\W]*%>/gm),Mme=Ku(/\$\{[\w\W]*/gm),Pme=Ku(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ame=Ku(/^aria-[\-\w]+$/),PY=Ku(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ome=Ku(/^(?:\w+script|data):/i),Ime=Ku(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),AY=Ku(/^html$/i),Dme=Ku(/^[a-z][.\w]*(-[.\w]+)+$/i);var OY=Object.freeze({__proto__:null,ARIA_ATTR:Ame,ATTR_WHITESPACE:Ime,CUSTOM_ELEMENT:Dme,DATA_ATTR:Pme,DOCTYPE_NAME:AY,ERB_EXPR:jme,IS_ALLOWED_URI:PY,IS_SCRIPT_OR_DATA:Ome,MUSTACHE_EXPR:Tme,TMPLIT_EXPR:Mme});const rR={element:1,text:3,progressingInstruction:7,comment:8,document:9},Hme=function(){return typeof window>"u"?null:window},Lme=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},IY=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function DY(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Hme();const e=Ct=>DY(Ct);if(e.version="3.3.3",e.removed=[],!t||!t.document||t.document.nodeType!==rR.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:u,Element:h,NodeFilter:m,NamedNodeMap:g=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:y,DOMParser:x,trustedTypes:C}=t,E=h.prototype,M=nR(E,"cloneNode"),j=nR(E,"remove"),L=nR(E,"nextSibling"),D=nR(E,"childNodes"),z=nR(E,"parentNode");if(typeof a=="function"){const Ct=n.createElement("template");Ct.content&&Ct.content.ownerDocument&&(n=Ct.content.ownerDocument)}let H,V="";const{implementation:F,createNodeIterator:B,createDocumentFragment:te,getElementsByTagName:ve}=n,{importNode:ce}=r;let _e=IY();e.isSupported=typeof _Y=="function"&&typeof z=="function"&&F&&F.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:pe,ERB_EXPR:Le,TMPLIT_EXPR:Fe,DATA_ATTR:nt,ARIA_ATTR:dt,IS_SCRIPT_OR_DATA:$e,ATTR_WHITESPACE:Re,CUSTOM_ELEMENT:Ze}=OY;let{IS_ALLOWED_URI:Ee}=OY,Q=null;const fe=Br({},[...kY,...YH,...GH,...KH,...TY]);let Ve=null;const ne=Br({},[...jY,...qH,...MY,...wT]);let xe=Object.seal(bT(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ke=null,qe=null;const we=Object.seal(bT(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let k=!0,_=!0,N=!1,O=!0,G=!1,q=!0,I=!1,Z=!1,U=!1,re=!1,ae=!1,he=!1,Me=!0,tt=!1;const ot="user-content-";let lt=!0,X=!1,de={},Ce=null;const Oe=Br({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ge=null;const Qe=Br({},["audio","video","img","source","image","track"]);let se=null;const ie=Br({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),J="http://www.w3.org/1998/Math/MathML",me="http://www.w3.org/2000/svg",Se="http://www.w3.org/1999/xhtml";let je=Se,Pe=!1,ut=null;const wt=Br({},[J,me,Se],WH);let kt=Br({},["mi","mo","mn","ms","mtext"]),Rt=Br({},["annotation-xml"]);const sn=Br({},["title","style","font","a","script"]);let jn=null;const An=["application/xhtml+xml","text/html"],Jn="text/html";let Qt=null,Gt=null;const ir=n.createElement("form"),kn=function(ge){return ge instanceof RegExp||ge instanceof Function},Kt=function(){let ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Gt&&Gt===ge)){if((!ge||typeof ge!="object")&&(ge={}),ge=Fh(ge),jn=An.indexOf(ge.PARSER_MEDIA_TYPE)===-1?Jn:ge.PARSER_MEDIA_TYPE,Qt=jn==="application/xhtml+xml"?WH:xT,Q=ru(ge,"ALLOWED_TAGS")?Br({},ge.ALLOWED_TAGS,Qt):fe,Ve=ru(ge,"ALLOWED_ATTR")?Br({},ge.ALLOWED_ATTR,Qt):ne,ut=ru(ge,"ALLOWED_NAMESPACES")?Br({},ge.ALLOWED_NAMESPACES,WH):wt,se=ru(ge,"ADD_URI_SAFE_ATTR")?Br(Fh(ie),ge.ADD_URI_SAFE_ATTR,Qt):ie,Ge=ru(ge,"ADD_DATA_URI_TAGS")?Br(Fh(Qe),ge.ADD_DATA_URI_TAGS,Qt):Qe,Ce=ru(ge,"FORBID_CONTENTS")?Br({},ge.FORBID_CONTENTS,Qt):Oe,Ke=ru(ge,"FORBID_TAGS")?Br({},ge.FORBID_TAGS,Qt):Fh({}),qe=ru(ge,"FORBID_ATTR")?Br({},ge.FORBID_ATTR,Qt):Fh({}),de=ru(ge,"USE_PROFILES")?ge.USE_PROFILES:!1,k=ge.ALLOW_ARIA_ATTR!==!1,_=ge.ALLOW_DATA_ATTR!==!1,N=ge.ALLOW_UNKNOWN_PROTOCOLS||!1,O=ge.ALLOW_SELF_CLOSE_IN_ATTR!==!1,G=ge.SAFE_FOR_TEMPLATES||!1,q=ge.SAFE_FOR_XML!==!1,I=ge.WHOLE_DOCUMENT||!1,re=ge.RETURN_DOM||!1,ae=ge.RETURN_DOM_FRAGMENT||!1,he=ge.RETURN_TRUSTED_TYPE||!1,U=ge.FORCE_BODY||!1,Me=ge.SANITIZE_DOM!==!1,tt=ge.SANITIZE_NAMED_PROPS||!1,lt=ge.KEEP_CONTENT!==!1,X=ge.IN_PLACE||!1,Ee=ge.ALLOWED_URI_REGEXP||PY,je=ge.NAMESPACE||Se,kt=ge.MATHML_TEXT_INTEGRATION_POINTS||kt,Rt=ge.HTML_INTEGRATION_POINTS||Rt,xe=ge.CUSTOM_ELEMENT_HANDLING||{},ge.CUSTOM_ELEMENT_HANDLING&&kn(ge.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(xe.tagNameCheck=ge.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ge.CUSTOM_ELEMENT_HANDLING&&kn(ge.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(xe.attributeNameCheck=ge.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ge.CUSTOM_ELEMENT_HANDLING&&typeof ge.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(xe.allowCustomizedBuiltInElements=ge.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),G&&(_=!1),ae&&(re=!0),de&&(Q=Br({},TY),Ve=bT(null),de.html===!0&&(Br(Q,kY),Br(Ve,jY)),de.svg===!0&&(Br(Q,YH),Br(Ve,qH),Br(Ve,wT)),de.svgFilters===!0&&(Br(Q,GH),Br(Ve,qH),Br(Ve,wT)),de.mathMl===!0&&(Br(Q,KH),Br(Ve,MY),Br(Ve,wT))),ru(ge,"ADD_TAGS")||(we.tagCheck=null),ru(ge,"ADD_ATTR")||(we.attributeCheck=null),ge.ADD_TAGS&&(typeof ge.ADD_TAGS=="function"?we.tagCheck=ge.ADD_TAGS:(Q===fe&&(Q=Fh(Q)),Br(Q,ge.ADD_TAGS,Qt))),ge.ADD_ATTR&&(typeof ge.ADD_ATTR=="function"?we.attributeCheck=ge.ADD_ATTR:(Ve===ne&&(Ve=Fh(Ve)),Br(Ve,ge.ADD_ATTR,Qt))),ge.ADD_URI_SAFE_ATTR&&Br(se,ge.ADD_URI_SAFE_ATTR,Qt),ge.FORBID_CONTENTS&&(Ce===Oe&&(Ce=Fh(Ce)),Br(Ce,ge.FORBID_CONTENTS,Qt)),ge.ADD_FORBID_CONTENTS&&(Ce===Oe&&(Ce=Fh(Ce)),Br(Ce,ge.ADD_FORBID_CONTENTS,Qt)),lt&&(Q["#text"]=!0),I&&Br(Q,["html","head","body"]),Q.table&&(Br(Q,["tbody"]),delete Ke.tbody),ge.TRUSTED_TYPES_POLICY){if(typeof ge.TRUSTED_TYPES_POLICY.createHTML!="function")throw tR('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ge.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw tR('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');H=ge.TRUSTED_TYPES_POLICY,V=H.createHTML("")}else H===void 0&&(H=Lme(C,i)),H!==null&&typeof V=="string"&&(V=H.createHTML(""));$l&&$l(ge),Gt=ge}},zt=Br({},[...YH,...GH,...Nme]),Wt=Br({},[...KH,...kme]),en=function(ge){let ct=z(ge);(!ct||!ct.tagName)&&(ct={namespaceURI:je,tagName:"template"});const xt=xT(ge.tagName),Bn=xT(ct.tagName);return ut[ge.namespaceURI]?ge.namespaceURI===me?ct.namespaceURI===Se?xt==="svg":ct.namespaceURI===J?xt==="svg"&&(Bn==="annotation-xml"||kt[Bn]):!!zt[xt]:ge.namespaceURI===J?ct.namespaceURI===Se?xt==="math":ct.namespaceURI===me?xt==="math"&&Rt[Bn]:!!Wt[xt]:ge.namespaceURI===Se?ct.namespaceURI===me&&!Rt[Bn]||ct.namespaceURI===J&&!kt[Bn]?!1:!Wt[xt]&&(sn[xt]||!zt[xt]):!!(jn==="application/xhtml+xml"&&ut[ge.namespaceURI]):!1},tn=function(ge){J1(e.removed,{element:ge});try{z(ge).removeChild(ge)}catch{j(ge)}},mn=function(ge,ct){try{J1(e.removed,{attribute:ct.getAttributeNode(ge),from:ct})}catch{J1(e.removed,{attribute:null,from:ct})}if(ct.removeAttribute(ge),ge==="is")if(re||ae)try{tn(ct)}catch{}else try{ct.setAttribute(ge,"")}catch{}},dn=function(ge){let ct=null,xt=null;if(U)ge="<remove></remove>"+ge;else{const Sn=UH(ge,/^[\r\n\t ]+/);xt=Sn&&Sn[0]}jn==="application/xhtml+xml"&&je===Se&&(ge='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ge+"</body></html>");const Bn=H?H.createHTML(ge):ge;if(je===Se)try{ct=new x().parseFromString(Bn,jn)}catch{}if(!ct||!ct.documentElement){ct=F.createDocument(je,"template",null);try{ct.documentElement.innerHTML=Pe?V:Bn}catch{}}const vn=ct.body||ct.documentElement;return ge&&xt&&vn.insertBefore(n.createTextNode(xt),vn.childNodes[0]||null),je===Se?ve.call(ct,I?"html":"body")[0]:I?ct.documentElement:vn},Ne=function(ge){return B.call(ge.ownerDocument||ge,ge,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},oe=function(ge){return ge instanceof y&&(typeof ge.nodeName!="string"||typeof ge.textContent!="string"||typeof ge.removeChild!="function"||!(ge.attributes instanceof g)||typeof ge.removeAttribute!="function"||typeof ge.setAttribute!="function"||typeof ge.namespaceURI!="string"||typeof ge.insertBefore!="function"||typeof ge.hasChildNodes!="function")},Ae=function(ge){return typeof u=="function"&&ge instanceof u};function Je(Ct,ge,ct){yT(Ct,xt=>{xt.call(e,ge,ct,Gt)})}const vt=function(ge){let ct=null;if(Je(_e.beforeSanitizeElements,ge,null),oe(ge))return tn(ge),!0;const xt=Qt(ge.nodeName);if(Je(_e.uponSanitizeElement,ge,{tagName:xt,allowedTags:Q}),q&&ge.hasChildNodes()&&!Ae(ge.firstElementChild)&&Fl(/<[/\w!]/g,ge.innerHTML)&&Fl(/<[/\w!]/g,ge.textContent)||ge.nodeType===rR.progressingInstruction||q&&ge.nodeType===rR.comment&&Fl(/<[/\w]/g,ge.data))return tn(ge),!0;if(!(we.tagCheck instanceof Function&&we.tagCheck(xt))&&(!Q[xt]||Ke[xt])){if(!Ke[xt]&&$t(xt)&&(xe.tagNameCheck instanceof RegExp&&Fl(xe.tagNameCheck,xt)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(xt)))return!1;if(lt&&!Ce[xt]){const Bn=z(ge)||ge.parentNode,vn=D(ge)||ge.childNodes;if(vn&&Bn){const Sn=vn.length;for(let Bt=Sn-1;Bt>=0;--Bt){const Tr=M(vn[Bt],!0);Tr.__removalCount=(ge.__removalCount||0)+1,Bn.insertBefore(Tr,L(ge))}}}return tn(ge),!0}return ge instanceof h&&!en(ge)||(xt==="noscript"||xt==="noembed"||xt==="noframes")&&Fl(/<\/no(script|embed|frames)/i,ge.innerHTML)?(tn(ge),!0):(G&&ge.nodeType===rR.text&&(ct=ge.textContent,yT([pe,Le,Fe],Bn=>{ct=eR(ct,Bn," ")}),ge.textContent!==ct&&(J1(e.removed,{element:ge.cloneNode()}),ge.textContent=ct)),Je(_e.afterSanitizeElements,ge,null),!1)},Vt=function(ge,ct,xt){if(qe[ct]||Me&&(ct==="id"||ct==="name")&&(xt in n||xt in ir))return!1;if(!(_&&!qe[ct]&&Fl(nt,ct))){if(!(k&&Fl(dt,ct))){if(!(we.attributeCheck instanceof Function&&we.attributeCheck(ct,ge))){if(!Ve[ct]||qe[ct]){if(!($t(ge)&&(xe.tagNameCheck instanceof RegExp&&Fl(xe.tagNameCheck,ge)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(ge))&&(xe.attributeNameCheck instanceof RegExp&&Fl(xe.attributeNameCheck,ct)||xe.attributeNameCheck instanceof Function&&xe.attributeNameCheck(ct,ge))||ct==="is"&&xe.allowCustomizedBuiltInElements&&(xe.tagNameCheck instanceof RegExp&&Fl(xe.tagNameCheck,xt)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(xt))))return!1}else if(!se[ct]){if(!Fl(Ee,eR(xt,Re,""))){if(!((ct==="src"||ct==="xlink:href"||ct==="href")&&ge!=="script"&&Sme(xt,"data:")===0&&Ge[ge])){if(!(N&&!Fl($e,eR(xt,Re,"")))){if(xt)return!1}}}}}}}return!0},$t=function(ge){return ge!=="annotation-xml"&&UH(ge,Ze)},jt=function(ge){Je(_e.beforeSanitizeAttributes,ge,null);const{attributes:ct}=ge;if(!ct||oe(ge))return;const xt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ve,forceKeepAttr:void 0};let Bn=ct.length;for(;Bn--;){const vn=ct[Bn],{name:Sn,namespaceURI:Bt,value:Tr}=vn,dr=Qt(Sn),Sr=Tr;let In=Sn==="value"?Sr:Rme(Sr);if(xt.attrName=dr,xt.attrValue=In,xt.keepAttr=!0,xt.forceKeepAttr=void 0,Je(_e.uponSanitizeAttribute,ge,xt),In=xt.attrValue,tt&&(dr==="id"||dr==="name")&&(mn(Sn,ge),In=ot+In),q&&Fl(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,In)){mn(Sn,ge);continue}if(dr==="attributename"&&UH(In,"href")){mn(Sn,ge);continue}if(xt.forceKeepAttr)continue;if(!xt.keepAttr){mn(Sn,ge);continue}if(!O&&Fl(/\/>/i,In)){mn(Sn,ge);continue}G&&yT([pe,Le,Fe],Fr=>{In=eR(In,Fr," ")});const ni=Qt(ge.nodeName);if(!Vt(ni,dr,In)){mn(Sn,ge);continue}if(H&&typeof C=="object"&&typeof C.getAttributeType=="function"&&!Bt)switch(C.getAttributeType(ni,dr)){case"TrustedHTML":{In=H.createHTML(In);break}case"TrustedScriptURL":{In=H.createScriptURL(In);break}}if(In!==Sr)try{Bt?ge.setAttributeNS(Bt,Sn,In):ge.setAttribute(Sn,In),oe(ge)?tn(ge):NY(e.removed)}catch{mn(Sn,ge)}}Je(_e.afterSanitizeAttributes,ge,null)},Ft=function Ct(ge){let ct=null;const xt=Ne(ge);for(Je(_e.beforeSanitizeShadowDOM,ge,null);ct=xt.nextNode();)Je(_e.uponSanitizeShadowNode,ct,null),vt(ct),jt(ct),ct.content instanceof s&&Ct(ct.content);Je(_e.afterSanitizeShadowDOM,ge,null)};return e.sanitize=function(Ct){let ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ct=null,xt=null,Bn=null,vn=null;if(Pe=!Ct,Pe&&(Ct="<!-->"),typeof Ct!="string"&&!Ae(Ct))if(typeof Ct.toString=="function"){if(Ct=Ct.toString(),typeof Ct!="string")throw tR("dirty is not a string, aborting")}else throw tR("toString is not a function");if(!e.isSupported)return Ct;if(Z||Kt(ge),e.removed=[],typeof Ct=="string"&&(X=!1),X){if(Ct.nodeName){const Tr=Qt(Ct.nodeName);if(!Q[Tr]||Ke[Tr])throw tR("root node is forbidden and cannot be sanitized in-place")}}else if(Ct instanceof u)ct=dn("<!---->"),xt=ct.ownerDocument.importNode(Ct,!0),xt.nodeType===rR.element&&xt.nodeName==="BODY"||xt.nodeName==="HTML"?ct=xt:ct.appendChild(xt);else{if(!re&&!G&&!I&&Ct.indexOf("<")===-1)return H&&he?H.createHTML(Ct):Ct;if(ct=dn(Ct),!ct)return re?null:he?V:""}ct&&U&&tn(ct.firstChild);const Sn=Ne(X?Ct:ct);for(;Bn=Sn.nextNode();)vt(Bn),jt(Bn),Bn.content instanceof s&&Ft(Bn.content);if(X)return Ct;if(re){if(ae)for(vn=te.call(ct.ownerDocument);ct.firstChild;)vn.appendChild(ct.firstChild);else vn=ct;return(Ve.shadowroot||Ve.shadowrootmode)&&(vn=ce.call(r,vn,!0)),vn}let Bt=I?ct.outerHTML:ct.innerHTML;return I&&Q["!doctype"]&&ct.ownerDocument&&ct.ownerDocument.doctype&&ct.ownerDocument.doctype.name&&Fl(AY,ct.ownerDocument.doctype.name)&&(Bt="<!DOCTYPE "+ct.ownerDocument.doctype.name+`> `+Bt),G&&yT([pe,Le,Fe],Tr=>{Bt=eR(Bt,Tr," ")}),H&&he?H.createHTML(Bt):Bt},e.setConfig=function(){let Ct=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Kt(Ct),Z=!0},e.clearConfig=function(){Gt=null,Z=!1},e.isValidAttribute=function(Ct,ge,ct){Gt||Kt({});const xt=Qt(Ct),Bn=Qt(ge);return Vt(xt,Bn,ct)},e.addHook=function(Ct,ge){typeof ge=="function"&&J1(_e[Ct],ge)},e.removeHook=function(Ct,ge){if(ge!==void 0){const ct=wme(_e[Ct],ge);return ct===-1?void 0:Cme(_e[Ct],ct,1)[0]}return NY(_e[Ct])},e.removeHooks=function(Ct){_e[Ct]=[]},e.removeAllHooks=function(){_e=IY()},e}var $me=DY();function Fme(t){const e=t.length;let n=0;for(;n<e;)t[n]=[t[n]],n+=1}function HY(t,e){const n=e.length;let r=0;for(;r<n;)t.push(e[r]),r+=1}function CT(t){const e=[];if(!t||t.length===0||!t[0]||t[0].length===0)return e;const n=t.length,r=t[0].length;for(let i=0;i<n;i++)for(let s=0;s<r;s++)e[s]||(e[s]=[]),e[s][i]=t[i][s];return e}function xc(t,e,n,r){let i=-1,s=t,a=n;Array.isArray(t)||(s=Array.from(t));const u=s.length;for(i+=1;i<u;)a=e(a,s[i],i,s),i+=1;return a}function E0(t,e){let n=0,r=t;Array.isArray(t)||(r=Array.from(t));const i=r.length,s=[];let a=-1;for(;n<i;){const u=r[n];e(u,n,r)&&(a+=1,s[a]=u),n+=1}return s}function di(t,e){let n=0,r=t;Array.isArray(t)||(r=Array.from(t));const i=r.length,s=[];let a=-1;for(;n<i;){const u=r[n];a+=1,s[a]=e(u,n,r),n+=1}return s}function Te(t,e){let n=0,r=t;Array.isArray(t)||(r=Array.from(t));const i=r.length;for(;n<i&&e(r[n],n,r)!==!1;)n+=1;return t}function zme(t){const e=[];return Te(t,n=>{e.indexOf(n)===-1&&e.push(n)}),e}function LY(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const[r,...i]=[...e];let s=r;return Te(i,a=>{s=s.filter(u=>!a.includes(u))}),s}function Vme(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r=e[e.length-1];let i,s=e;typeof r=="function"&&(i=r,s=s.slice(0,-1));const a=i?(g,y)=>y.some(x=>i(g,x)):(g,y)=>y.includes(g),[u,...h]=s;let m=u;return Te(h,g=>{m=m.filter(y=>a(y,g))}),m}function $Y(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ";return t.split(e)}function Bme(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ";return t.join(e)}function Jr(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return xc(t,(s,a,u)=>{const h=a.replace(/\r?\n\s*/g,""),m=n[u]?n[u]:"";return s+h+m},"").trim()}function Bx(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];const i=document.createElement("template");i.innerHTML=t.reduce((u,h,m)=>{var g;return u+h+((g=n[m])!==null&&g!==void 0?g:"")},"");const s=i.content.cloneNode(!0),a={};return s.querySelectorAll("[data-ref]").forEach(u=>{const h=u.getAttribute("data-ref");u.removeAttribute("data-ref"),a[h]=u}),{fragment:s,refs:a}}function Hi(t){let e;switch(typeof t){case"string":case"number":e=`${t}`;break;case"object":e=t===null?"":t.toString();break;case"undefined":e="";break;default:e=t.toString();break}return e}function Lt(t){return typeof t<"u"}function ls(t){return typeof t>"u"}function Yr(t){return t===null||t===""||ls(t)}function Wme(t){return Object.prototype.toString.call(t)==="[object RegExp]"}const iR="length",sR=t=>parseInt(t,16),FY=t=>parseInt(t,10),ST=(t,e,n)=>t.substr(e,n),oR=t=>t.codePointAt(0)-65,XH=t=>`${t}`.replace(/\-/g,""),Ume=t=>sR(ST(XH(t),sR("12"),oR("F")))/(sR(ST(XH(t),oR("B"),~~![][iR]))||9),Yme=()=>typeof location<"u"&&/^([a-z0-9\-]+\.)?\x68\x61\x6E\x64\x73\x6F\x6E\x74\x61\x62\x6C\x65\x2E\x63\x6F\x6D$/i.test(location.host);let zY=!1;const VY={invalid:()=>Jr` The license key for Handsontable is invalid.\x20 If you need any help, contact us at support@handsontable.com.`,expired:t=>{let{keyValidityDate:e,hotVersion:n}=t;return Jr` The license key for Handsontable expired on ${e}, and is not valid for the installed\x20 version ${n}. Renew your license key at handsontable.com or downgrade to a version released prior\x20 to ${e}. If you need any help, contact us at sales@handsontable.com.`},missing:()=>Jr` The license key for Handsontable is missing. Use your purchased key to activate the product.\x20 Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20 passing the key: 'non-commercial-and-evaluation'. If you need any help, contact\x20 us at support@handsontable.com.`,non_commercial:()=>""},BY={invalid:()=>Jr` The license key for Handsontable is invalid.\x20 <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> on how to\x20 install it properly or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,expired:t=>{let{keyValidityDate:e,hotVersion:n}=t;return Jr` The license key for Handsontable expired on ${e}, and is not valid for the installed\x20 version ${n}. <a href="https://handsontable.com/pricing" target="_blank">Renew</a> your\x20 license key or downgrade to a version released prior to ${e}. If you need any\x20 help, contact us at <a href="mailto:sales@handsontable.com">sales@handsontable.com</a>.`},missing:()=>Jr` The license key for Handsontable is missing. Use your purchased key to activate the product.\x20 Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20 passing the key: 'non-commercial-and-evaluation'.\x20 <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> about it in\x20 the documentation or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,non_commercial:()=>""};function Gme(t,e,n){const r=!Yr(t),i=typeof t=="string"&&t.toLowerCase()==="non-commercial-and-evaluation",s="17.0.0";let a,u="invalid",h="invalid";t=XH(t||"");const m=Kme(t);if(r||i||m)if(m){const[g,y,x]=n.split("/").map(Number),C=Math.floor(Date.UTC(x,y-1,g)/864e5),E=Ume(t);a=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"long",day:"2-digit",timeZone:"UTC"}).format((E+1)*864e5),C>E?(u="expired",h="expired"):(u="valid",h="valid")}else i?(u="non_commercial",h="valid"):(u="invalid",h="invalid");else u="missing",h="missing";if(Yme()&&(u="valid",h="valid"),!zY&&u!=="valid"&&(VY[u]({keyValidityDate:a,hotVersion:s})&&console[u==="non_commercial"?"info":"warn"](VY[u]({keyValidityDate:a,hotVersion:s})),zY=!0),h!=="valid"&&e&&BY[h]({keyValidityDate:a,hotVersion:s})){const y=document.createElement("div");y.className="handsontable hot-display-license-info",y.innerHTML=BY[h]({keyValidityDate:a,hotVersion:s}),e.appendChild(y)}}function Kme(t){let e=[][iR],n=e;if(t[iR]!==oR("Z"))return!1;for(let r="",i="B<H4P+".split(""),s=oR(i.shift());s;s=oR(i.shift()||"A"))--s<""[iR]?n=n|(FY(`${FY(sR(r)+(sR(ST(t,Math.abs(s),2))+[]).padStart(2,"0"))}`)%97||2)>>1:r=ST(t,s,s?i[iR]===1?9:8:6);return n===e}function Hd(t){return t[0].toUpperCase()+t.substr(1)}function WY(){function t(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return t()+t()+t()+t()}function UY(t){if(typeof t!="string")return!1;try{const e=JSON.parse(t);return typeof e=="object"&&e!==null}catch{return!1}}function YY(t){return/^([0-9][0-9]?%$)|(^100%$)/.test(t)}function RT(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return`${t}`.replace(/(?:\\)?\[([^[\]]+)]/g,(n,r)=>n.charAt(0)==="\\"?n.substr(1,n.length-1):e[r]===void 0?"":e[r])}function vm(t){return _T(`${t}`,{ALLOWED_TAGS:[]})}function _T(t,e){return $me.sanitize(t,e)}function aR(t){return typeof t!="string"?t:t.replace(/([A-Z])/g,"-$1").replace(/_/g,"-").toLowerCase()}const Ld=t=>["tabindex",t],qme=()=>["role","treegrid"],bm=()=>["role","presentation"],Xme=()=>["role","gridcell"],Qme=()=>["role","gridcell button"],Zme=()=>["role","rowheader"],GY=()=>["role","rowgroup"],Jme=()=>["role","columnheader"],KY=()=>["role","row"],epe=()=>["role","menu"],tpe=()=>["role","menuitem"],npe=()=>["role","menuitemcheckbox"],rpe=()=>["role","combobox"],qY=()=>["role","listbox"],ipe=()=>["role","option"],spe=()=>["role","checkbox"],ope=()=>["role","dialog"],ape=()=>["role","alertdialog"],lpe=()=>["role","group"],cpe=()=>["scope","col"],upe=()=>["scope","row"],dpe=()=>["type","text"],wc=t=>["aria-label",t],hpe=t=>["aria-labelledby",t],fpe=t=>["aria-describedby",t],ym=()=>["aria-hidden","true"],lR=function(){return["aria-disabled",arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0]},mpe=()=>["aria-multiselectable","true"],XY=t=>["aria-haspopup",t],QY=t=>["aria-rowcount",t],ET=t=>["aria-colcount",t],ZY=t=>["aria-rowindex",t],QH=t=>["aria-colindex",t],qu=t=>["aria-expanded",t],ppe=t=>["aria-sort",t],JY=()=>["aria-readonly","true"],eG=()=>["aria-invalid","true"],tG=t=>["aria-checked",t],ZH=()=>["aria-selected","true"],gpe=()=>["aria-autocomplete","list"],vpe=t=>["aria-controls",t],bpe=t=>["aria-activedescendant",t],ype=t=>["aria-live",t],xpe=t=>["aria-relevant",t],wpe=t=>["aria-setsize",t],Cpe=t=>["aria-posinset",t],Spe=()=>["aria-modal","true"];function gt(t){throw new Error(t,{cause:{handsontable:!0}})}function cR(t){let e;return Array.isArray(t)?e=t.length?new Array(t.length).fill(null):[]:(e={},Mr(t,(n,r)=>{r!=="__children"&&(n&&typeof n=="object"&&!Array.isArray(n)?e[r]=cR(n):Array.isArray(n)?n.length&&typeof n[0]=="object"&&!Array.isArray(n[0])?e[r]=[cR(n[0])]:e[r]=[]:e[r]=null)})),e}function Rpe(t,e){return e.prototype.constructor=e,t.prototype=new e,t.prototype.constructor=t,t}function jo(t,e,n){const r=Array.isArray(n);return Mr(e,(i,s)=>{(r===!1||n.includes(s))&&(t[s]=i)}),t}function NT(t,e){Mr(e,(n,r)=>{e[r]&&typeof e[r]=="object"?(t[r]||(Array.isArray(e[r])?t[r]=[]:Object.prototype.toString.call(e[r])==="[object Date]"?t[r]=e[r]:t[r]={}),NT(t[r],e[r])):t[r]=e[r]})}function ea(t){return typeof t=="object"?JSON.parse(JSON.stringify(t)):t}function zh(t){const e={};return Mr(t,(n,r)=>{e[r]=n}),e}function ci(t){t.MIXINS||(t.MIXINS=[]);for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Te(n,i=>{t.MIXINS.push(i.MIXIN_NAME),Mr(i,(s,a)=>{if(t.prototype[a]!==void 0&>(`Mixin conflict. Property '${a}' already exist and cannot be overwritten.`),typeof s=="function")t.prototype[a]=s;else{const u=function(g,y){const x=`_${g}`,C=E=>{let M=E;return(Array.isArray(M)||nn(M))&&(M=ea(M)),M};return function(){return this[x]===void 0&&(this[x]=C(y)),this[x]}},h=function(g){const y=`_${g}`;return function(x){this[y]=x}};Object.defineProperty(t.prototype,a,{get:u(a,s),set:h(a),configurable:!0})}})}),t}function N0(t,e){return JSON.stringify(t)===JSON.stringify(e)}function nn(t){return Object.prototype.toString.call(t)==="[object Object]"}function xm(t,e,n,r){r.value=n,r.writable=r.writable!==!1,r.enumerable=r.enumerable!==!1,r.configurable=r.configurable!==!1,Object.defineProperty(t,e,r)}function Mr(t,e){for(const n in t)if((!t.hasOwnProperty||t.hasOwnProperty&&Object.prototype.hasOwnProperty.call(t,n))&&e(t[n],n,t)===!1)break;return t}function JH(t,e){const n=e.split(".");let r=t;return Mr(n,i=>{if(r=r[i],r===void 0)return r=void 0,!1}),r}function eL(t,e,n){if(typeof e!="string")return;const r=e.split(".");let i=t;r.forEach((s,a)=>{s==="__proto__"||s==="constructor"||s==="prototype"||(a!==r.length-1?(Ps(i,s)||(i[s]={}),i=i[s]):i[s]=n)})}function tL(t){if(!nn(t))return 0;const e=function(n){let r=0;return nn(n)?Mr(n,(i,s)=>{s!=="__children"&&(r+=e(i))}):r+=1,r};return e(t)}function Cc(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"value";const n=`_${e}`,r={_touched:!1,[n]:t,isTouched(){return this._touched}};return Object.defineProperty(r,e,{get(){return this[n]},set(i){this._touched=!0,this[n]=i},enumerable:!0,configurable:!0}),r}function Ps(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function kT(t,e){if(typeof t!="object"||t===null)return e;if(typeof e!="object"||e===null)return t;const n={};return Object.keys(e).forEach(r=>{typeof e[r]=="object"&&e[r]!==null&&!Array.isArray(e[r])?n[r]=kT(t[r],e[r]):n[r]=Ps(t,r)&&t[r]!==void 0?t[r]:e[r]}),Object.keys(t).forEach(r=>{Ps(n,r)||(n[r]=t[r])}),n}function nL(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n={...t};return Object.keys(e).forEach(r=>{if(r==="__proto__"||r==="constructor"||r==="prototype")return;const i=e[r],s=n[r];nn(i)&&nn(s)?n[r]=nL(s,i):n[r]=i}),n}function Mo(t){return nn(t)&&Lt(t.key)&&Lt(t.value)}function TT(t){return window.requestAnimationFrame(t)}function jT(t){window.cancelAnimationFrame(t)}function nG(){return"ontouchstart"in window}function _pe(){return typeof window<"u"}let Wx;function Epe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Wx||(typeof Intl=="object"?Wx=new Intl.Collator(t,e).compare:typeof String.prototype.localeCompare=="function"?Wx=(n,r)=>`${n}`.localeCompare(r):Wx=(n,r)=>n===r?0:n>r?-1:1,Wx)}const Xu=t=>{const e={value:!1};return e.test=(n,r)=>{e.value=t(n,r)},e},yg={chrome:Xu((t,e)=>/Chrome/.test(t)&&/Google/.test(e)),chromeWebKit:Xu(t=>/CriOS/.test(t)),edge:Xu(t=>/Edge/.test(t)),edgeWebKit:Xu(t=>/EdgiOS/.test(t)),firefox:Xu(t=>/Firefox/.test(t)),firefoxWebKit:Xu(t=>/FxiOS/.test(t)),mobile:Xu(t=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t)),safari:Xu((t,e)=>/Safari/.test(t)&&/Apple Computer/.test(e))},uR={mac:Xu(t=>/^Mac/.test(t)),win:Xu(t=>/^Win/.test(t)),linux:Xu(t=>/^Linux/.test(t)),ios:Xu(t=>/iPhone|iPad|iPod/i.test(t))};function Npe(){let{userAgent:t=navigator.userAgent,vendor:e=navigator.vendor}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Mr(yg,n=>{let{test:r}=n;return void r(t,e)})}function kpe(){let{platform:t=navigator.platform}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Mr(uR,e=>{let{test:n}=e;return void n(t)})}_pe()&&(Npe(),kpe());function rG(){return yg.chrome.value}function Tpe(){return yg.chromeWebKit.value}function dR(){return yg.firefox.value}function jpe(){return yg.firefoxWebKit.value}function MT(){return yg.safari.value}function Mpe(){return yg.edge.value}function Vh(){return yg.mobile.value}function iG(){return uR.ios.value}function rL(){let{maxTouchPoints:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:navigator;return t>2&&uR.mac.value}function iL(){return uR.win.value}function sG(){return uR.mac.value}function Ppe(){Lt(console)&&console.log(...arguments)}function Yn(){Lt(console)&&console.warn(...arguments)}function xg(t){Lt(console)&&console.warn(`Deprecated: ${t}`)}function sL(){Lt(console)&&console.error(...arguments)}function Ape(){let{logFunction:t=Ppe,message:e,items:n,maxSample:r=5,itemFormatter:i=m=>`${m}`}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!Array.isArray(n)||n.length===0)return;const s=n.length,a=n.slice(0,r).map(m=>` - ${i(m)}`),u=s>r?` - ...and ${s-r} more`:"",h=["Affected cells:",...a,...u?[u]:[]].join(` `);t(RT(e,{itemsCount:`${s} cell${s>1?"s":""}`,affectedCells:h}))}function Ope(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=null,i=t;for(;i!==null;){if(n===e){r=i;break}i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:(n+=1,i=i.parentNode)}return r}function PT(t,e){const n=t.closest(".handsontable");return!!n&&(n.parentNode===e||n===e)}function Ipe(t){return Object.getPrototypeOf(t.parent)&&t.frameElement}function wg(t){return Ipe(t)&&t.parent}function k0(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;const{ELEMENT_NODE:r,DOCUMENT_FRAGMENT_NODE:i}=Node;let s=t;for(;s!=null&&s!==n;){const{nodeType:a,nodeName:u}=s;if(a===r&&(e.includes(u)||e.includes(s)))return s;const{host:h}=s;h&&a===i?s=h:s=s.parentNode}return null}function AT(t,e,n){const r=[];let i=t;for(;i&&(i=k0(i,e,n),!(!i||n&&!n.contains(i)));)r.push(i),i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:i=i.parentNode;const s=r.length;return s?r[s-1]:null}function Dpe(t,e){const n={element:void 0,classNames:[]};let r=t;for(;r!==null&&r!==t.ownerDocument.documentElement&&!n.element;){if(typeof e=="string"&&r.classList.contains(e))n.element=r,n.classNames.push(e);else if(e instanceof RegExp){const i=Array.from(r.classList).filter(s=>e.test(s));i.length&&(n.element=r,n.classNames.push(...i))}r=r.parentElement}return n}function T0(t,e){let n=t.parentNode,r=[];for(typeof e=="string"?t.defaultView?r=Array.prototype.slice.call(t.querySelectorAll(e),0):r=Array.prototype.slice.call(t.ownerDocument.querySelectorAll(e),0):r.push(e);n!==null;){if(r.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function Hpe(t){let e=0,n=t;if(n.previousSibling)for(;n=n.previousSibling;)e+=1;return e}function j0(t,e,n){const r=n.parentElement.querySelector(`.ht_clone_${t}`);return r?r.contains(e):null}function oG(t){return!t||!t.length?[]:t.filter(e=>!!e)}function aG(t,e){if(!t||!t.length)return{regexFree:[],regexes:[]};const n=[],r=[];return r.push(...t.filter(i=>{const s=i instanceof RegExp;return s&&e&&n.push(i),!s})),{regexFree:r,regexes:n}}function Dn(t,e){return t.classList===void 0||typeof e!="string"||e===""?!1:t.classList.contains(e)}function st(t,e){typeof e=="string"&&(e=e.split(" ")),e=oG(e),e.length>0&&t.classList.add(...e)}function cn(t,e){typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);let{regexFree:n,regexes:r}=aG(e,!0);n=oG(n),n.length>0&&t.classList.remove(...n),r.forEach(i=>{t.classList.forEach(s=>{i.test(s)&&t.classList.remove(s)})})}function gn(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;Array.isArray(e)||(e=[[e,n]]),e.forEach(r=>{Array.isArray(r)&&r[0]!==""&&t.setAttribute(...r)})}function wm(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);const{regexFree:n,regexes:r}=aG(e,!0);n.forEach(i=>{i!==""&&t.removeAttribute(i)}),r.forEach(i=>{t.getAttributeNames().forEach(s=>{i.test(s)&&t.removeAttribute(s)})})}function lG(t){if(t.nodeType===3)t.parentNode.removeChild(t);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(t.nodeName)>-1){const e=t.childNodes;for(let n=e.length-1;n>=0;n--)lG(e[n])}}function Bh(t){let e;for(;e=t.lastChild;)t.removeChild(e)}const Lpe=/(<(.*)>|&(.*);)/;let cG=!1;function M0(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_T;Lpe.test(e)?(!cG&&n===_T&&(cG=!0,xg("The HTML sanitization using DOMPurify library is deprecated and will be removed in the next major release. Use the `sanitizer` option instead.\n\nMigration guide: https://handsontable.com/docs/migration-from-16.2-to-17.0/\n`sanitizer` documentation: https://handsontable.com/docs/api/options/#sanitizer")),t.innerHTML=typeof n=="function"?n(e,"innerHTML"):e):Cg(t,e)}function Cg(t,e){const n=t.firstChild;n&&n.nodeType===3&&n.nextSibling===null?n.textContent=e:(Bh(t),t.appendChild(t.ownerDocument.createTextNode(e)))}function P0(t){const e=t.ownerDocument.documentElement,n=t.ownerDocument.defaultView;let r=t;for(;r!==e;){if(r===null)return!1;if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE)if(r.host){if(r.host.impl)return P0(r.host.impl);if(r.host)return P0(r.host);gt("Lost in Web Components world")}else return!1;else if(n.getComputedStyle(r).display==="none")return!1;r=r.parentNode}return!0}function $pe(t){const n=t.ownerDocument.defaultView;let r=t;for(;r.parentNode;){if(r.style.height==="0px"||r.style.height==="0"){const i=n.getComputedStyle(r).getPropertyValue("overflow");return i==="hidden"||i==="clip"}r=r.parentNode}return!1}function sl(t){const e=t.ownerDocument,n=e.defaultView,r=e.documentElement;let i=t,s,a,u;for(s=i.offsetLeft,a=i.offsetTop,u=i;(i=i.offsetParent)&&!(i===e.body||!("offsetLeft"in i));)s+=i.offsetLeft,a+=i.offsetTop,u=i;return u&&u.style.position==="fixed"&&(s+=n.pageXOffset||r.scrollLeft,a+=n.pageYOffset||r.scrollTop),{left:s,top:a}}function uG(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollY}function oL(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollX}function aL(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?uG(e):t.scrollTop}function dG(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?oL(e):t.scrollLeft}function OT(t){let e=t.ownerDocument,n=e?e.defaultView:void 0;e||(e=t.document?t.document:t,n=e.defaultView);const r=["auto","scroll"];let i=t.parentNode;for(;i&&i.style&&e.body!==i;){let{overflow:s,overflowX:a,overflowY:u}=i.style;if([s,a,u].includes("scroll"))return i;if({overflow:s,overflowX:a,overflowY:u}=n.getComputedStyle(i),r.includes(s)||r.includes(a)||r.includes(u)||i.clientHeight<=i.scrollHeight+1&&(r.includes(u)||r.includes(s))||i.clientWidth<=i.scrollWidth+1&&(r.includes(a)||r.includes(s)))return i;i=i.parentNode}return n}function Fpe(t){return t.scrollHeight-t.clientHeight}function zpe(t){return t.scrollWidth-t.clientWidth}function hR(t){const e=t.ownerDocument,n=e.defaultView;let r=t.parentNode;for(;r&&r.style&&e.body!==r;){if(r.style.overflow!=="visible"&&r.style.overflow!=="")return r;const i=n.getComputedStyle(r),s=["scroll","hidden","auto","clip"],a=i.getPropertyValue("overflow"),u=i.getPropertyValue("overflow-y"),h=i.getPropertyValue("overflow-x");if(s.includes(a)||s.includes(u)||s.includes(h))return r;r=r.parentNode}return n}function IT(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window;if(t){if(t===n)return e==="width"?`${n.innerWidth}px`:e==="height"?`${n.innerHeight}px`:void 0}else return;const r=t.style[e];if(r!==""&&r!==void 0)return r;const i=n.getComputedStyle(t);if(i[e]!==""&&i[e]!==void 0)return i[e]}function po(t){return t.offsetWidth}function Po(t){return t.offsetHeight}function fR(t){return t.clientHeight||t.innerHeight}function hG(t){return t.clientWidth||t.innerWidth}function fG(t){return t.selectionStart?t.selectionStart:0}function Vpe(t){return t.selectionEnd?t.selectionEnd:0}function mG(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window;t.getSelection&&(t.getSelection().empty?t.getSelection().empty():t.getSelection().removeAllRanges&&t.getSelection().removeAllRanges())}function DT(t,e,n){if(n===void 0&&(n=e),t.setSelectionRange){t.focus();try{t.setSelectionRange(e,n)}catch{const i=t.parentNode,s=i.style.display;i.style.display="block",t.setSelectionRange(e,n),i.style.display=s}}}function Bpe(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return iL()?Number.isInteger(t.defaultView.devicePixelRatio||1)?0:2:0}function Wpe(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;const e=t.createElement("div");e.style.height="200px",e.style.width="100%";const n=t.createElement("div");MT()&&!Vh()&&!rL()&&n.classList.add("htScrollbarSafariTest"),n.style.boxSizing="content-box",n.style.height="150px",n.style.left="0px",n.style.overflow="hidden",n.style.position="absolute",n.style.top="0px",n.style.width="200px",n.style.visibility="hidden",n.appendChild(e),t.body.appendChild(n);const r=e.offsetWidth;n.style.overflow="scroll";let i=e.offsetWidth;return r===i&&(i=n.clientWidth),t.body.removeChild(n),r-i}let lL;function go(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return lL===void 0&&(lL=Wpe(t)),lL}function pG(t){return t instanceof Window?t.document.body.scrollHeight>t.innerHeight:t.offsetWidth!==t.clientWidth}function gG(t){return t instanceof Window?t.document.body.scrollWidth>t.innerWidth:t.offsetHeight!==t.clientHeight}function cL(t,e,n){t.style.transform=`translate3d(${e},${n},0)`}function HT(t){t.style.transform&&t.style.transform!==""&&(t.style.transform="")}function LT(t){return t&&(["INPUT","SELECT","TEXTAREA"].indexOf(t.nodeName)>-1||t.contentEditable==="true")}function vG(t){return LT(t)&&t.hasAttribute("data-hot-input")===!1}function bG(t){return!t.parentNode}function Upe(t,e){new IntersectionObserver((r,i)=>{r.forEach(s=>{s.isIntersecting&&t.offsetParent!==null&&(e(),i.unobserve(t))})},{root:t.ownerDocument.body}).observe(t)}function yG(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const r=t.ownerDocument,i=r.createRange(),s=r.defaultView.getSelection();gn(t,"contenteditable",!0),n&&gn(t,...ym()),e&&st(t,"invisibleSelection"),i.selectNodeContents(t),s.removeAllRanges(),s.addRange(i)}function xG(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const n=t.ownerDocument.defaultView.getSelection();t.hasAttribute("aria-hidden")&&t.removeAttribute("aria-hidden"),n.removeAllRanges(),e&&cn(t,"invisibleSelection"),t.removeAttribute("contenteditable")}function Ype(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;yG(t,n),e(),xG(t,n)}function Cm(t){var e;const n=t==null||(e=t.ownerDocument)===null||e===void 0?void 0:e.defaultView.Element;return!!(n&&n!==null&&t instanceof n)}function ri(t){return typeof t=="function"}function $T(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200,n=null,r;function i(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];return n&&clearTimeout(n),n=setTimeout(()=>{r=t.apply(this,a)},e),r}return i}function wG(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];return t.apply(this,n.concat(a))}}function Gpe(t){const e=t.length;function n(r){return function(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];const h=r.concat(a);let m;return h.length>=e?m=t.apply(this,h):m=n(h),m}}return n([])}function uL(t,e,n,r,i,s,a,u){return Lt(u)?t.call(e,n,r,i,s,a,u):Lt(a)?t.call(e,n,r,i,s,a):Lt(s)?t.call(e,n,r,i,s):Lt(i)?t.call(e,n,r,i):Lt(r)?t.call(e,n,r):Lt(n)?t.call(e,n):t.call(e)}const Hn={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:dR()?182:174,AUDIO_MUTE:dR()?181:173,AUDIO_UP:dR()?183:175,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND_LEFT:91,COMMAND_RIGHT:93,COMMAND_FIREFOX:224,CONTROL:17,DELETE:46,END:35,ENTER:13,ESCAPE:27,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,F16:127,F17:128,F18:129,F19:130,HOME:36,INSERT:45,MEDIA_NEXT:176,MEDIA_PLAY_PAUSE:179,MEDIA_PREV:177,MEDIA_STOP:178,NULL:0,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PERIOD:190,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,A:65,C:67,D:68,F:70,L:76,O:79,P:80,S:83,V:86,X:88,Y:89,Z:90},Kpe=[Hn.ALT,Hn.ARROW_DOWN,Hn.ARROW_LEFT,Hn.ARROW_RIGHT,Hn.ARROW_UP,Hn.AUDIO_DOWN,Hn.AUDIO_MUTE,Hn.AUDIO_UP,Hn.BACKSPACE,Hn.CAPS_LOCK,Hn.DELETE,Hn.END,Hn.ENTER,Hn.ESCAPE,Hn.F1,Hn.F2,Hn.F3,Hn.F4,Hn.F5,Hn.F6,Hn.F7,Hn.F8,Hn.F9,Hn.F10,Hn.F11,Hn.F12,Hn.F13,Hn.F14,Hn.F15,Hn.F16,Hn.F17,Hn.F18,Hn.F19,Hn.HOME,Hn.INSERT,Hn.MEDIA_NEXT,Hn.MEDIA_PLAY_PAUSE,Hn.MEDIA_PREV,Hn.MEDIA_STOP,Hn.NULL,Hn.NUM_LOCK,Hn.PAGE_DOWN,Hn.PAGE_UP,Hn.PAUSE,Hn.SCROLL_LOCK,Hn.SHIFT,Hn.TAB];function CG(t){return t===32||t>=48&&t<=57||t>=96&&t<=111||t>=186&&t<=192||t>=219&&t<=222||t>=226||t>=65&&t<=90}function SG(t){return Kpe.includes(t)}function qpe(t){return[Hn.CONTROL,Hn.COMMAND_LEFT,Hn.COMMAND_RIGHT,Hn.COMMAND_FIREFOX].includes(t)}function Ux(t,e){const n=e.split("|");let r=!1;return Te(n,i=>{if(t===Hn[i])return r=!0,!1}),r}function iu(t){t.isImmediatePropagationEnabled=!1,t.cancelBubble=!0}function A0(t){return t.isImmediatePropagationEnabled===!1}function O0(t){return t.button===2}function dL(t){return t.button===0}function Xpe(t){return typeof TouchEvent<"u"&&t instanceof TouchEvent}function Qpe(t,e){const n={x:t.offsetX,y:t.offsetY};let r=t.target;if(!Cm(e)||r!==e&&r.contains(e))return n;for(;r!==e;)n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;return n}const I0=["afterCellMetaReset","afterChange","afterContextMenuDefaultOptions","beforeContextMenuSetItems","afterDropdownMenuDefaultOptions","beforeDropdownMenuSetItems","afterContextMenuHide","beforeContextMenuShow","afterContextMenuShow","afterCopyLimit","beforeCreateCol","afterColumnSequenceCacheUpdate","afterColumnSequenceChange","afterCreateCol","beforeCreateRow","afterCreateRow","afterDeselect","afterDestroy","afterDocumentKeyDown","afterDrawSelection","beforeRemoveCellClassNames","beforeCompositionStart","afterGetCellMeta","afterGetColHeader","afterGetRowHeader","afterInit","afterLoadData","afterUpdateData","afterMomentumScroll","afterOnCellCornerMouseDown","afterOnCellCornerDblClick","afterOnCellMouseDown","afterOnCellMouseUp","afterOnCellContextMenu","afterOnCellMouseOver","afterOnCellMouseOut","afterRemoveCol","afterRemoveRow","beforeRenderer","afterRenderer","afterRowSequenceCacheUpdate","afterRowSequenceChange","beforeViewportScrollVertically","beforeViewportScrollHorizontally","beforeViewportScroll","afterScrollHorizontally","afterScrollVertically","afterScroll","afterSelection","afterSelectionByProp","afterSelectionEnd","afterSelectionEndByProp","afterSelectionFocusSet","beforeSelectColumns","afterSelectColumns","beforeSelectRows","afterSelectRows","beforeSelectAll","afterSelectAll","afterSetCellMeta","afterRemoveCellMeta","afterSetDataAtCell","afterSetDataAtRowProp","afterSetSourceDataAtCell","afterSetTheme","afterUpdateSettings","afterValidate","beforeLanguageChange","afterLanguageChange","beforeAutofill","afterAutofill","beforeCellAlignment","beforeChange","beforeChangeRender","beforeHeightChange","beforeWidthChange","beforeDrawBorders","beforeGetCellMeta","beforeRemoveCellMeta","beforeInit","beforeInitWalkontable","beforeLoadData","beforeUpdateData","beforeKeyDown","beforeOnCellMouseDown","beforeOnCellMouseUp","beforeOnCellContextMenu","beforeOnCellMouseOver","beforeOnCellMouseOut","beforeRemoveCol","beforeRemoveRow","beforeViewRender","afterViewRender","beforeRender","afterRender","beforeRowWrap","beforeColumnWrap","beforeSetCellMeta","beforeSelectionFocusSet","beforeSetRangeStartOnly","beforeSetRangeStart","beforeSetRangeEnd","beforeSelectionHighlightSet","beforeTouchScroll","beforeValidate","beforeValueRender","construct","init","modifyColHeader","modifyColWidth","modifyFiltersMultiSelectValue","modifyFocusedElement","modifyRowHeader","modifyRowHeight","modifyRowHeightByOverlayName","modifyData","modifySourceData","modifyRowData","modifyGetCellCoords","modifyGetCoordsElement","modifyFocusOnTabNavigation","beforeHighlightingRowHeader","beforeHighlightingColumnHeader","beforeColumnSort","afterColumnSort","modifyAutofillRange","modifyCopyableRange","beforeCut","afterCut","beforeCopy","afterCopy","beforePaste","afterPaste","beforeColumnFreeze","afterColumnFreeze","beforeColumnMove","afterColumnMove","beforeColumnUnfreeze","afterColumnUnfreeze","beforeRowMove","afterRowMove","beforeColumnResize","afterColumnResize","beforeRowResize","afterRowResize","afterGetColumnHeaderRenderers","afterGetRowHeaderRenderers","beforeStretchingColumnWidth","beforeFilter","afterFilter","beforePageChange","afterPageChange","beforePageSizeChange","afterPageSizeChange","afterPageSizeVisibilityChange","afterPageCounterVisibilityChange","afterPageNavigationVisibilityChange","afterFormulasValuesUpdate","afterNamedExpressionAdded","afterNamedExpressionRemoved","afterSheetAdded","afterSheetRenamed","afterSheetRemoved","modifyColumnHeaderHeight","modifyColumnHeaderValue","beforeUndo","beforeUndoStackChange","afterUndo","afterUndoStackChange","beforeRedo","beforeRedoStackChange","afterRedo","afterRedoStackChange","modifyRowHeaderWidth","modifyTransformFocus","modifyTransformStart","modifyTransformEnd","afterModifyTransformFocus","afterModifyTransformStart","afterModifyTransformEnd","afterViewportRowCalculatorOverride","afterViewportColumnCalculatorOverride","afterPluginsInitialized","beforeHideRows","afterHideRows","beforeUnhideRows","afterUnhideRows","beforeHideColumns","afterHideColumns","beforeUnhideColumns","afterUnhideColumns","beforeTrimRow","afterTrimRow","beforeUntrimRow","afterUntrimRow","beforeDropdownMenuShow","afterDropdownMenuShow","afterDropdownMenuHide","beforeAddChild","afterAddChild","beforeDetachChild","afterDetachChild","beforeBeginEditing","afterDialogHide","afterDialogShow","beforeDialogHide","beforeDialogShow","dialogFocusPreviousElement","dialogFocusNextElement","afterDialogFocus","beforeLoadingShow","afterLoadingShow","beforeLoadingHide","afterLoadingHide","beforeEmptyDataStateShow","afterEmptyDataStateShow","beforeEmptyDataStateHide","afterEmptyDataStateHide","afterBeginEditing","beforeMergeCells","afterMergeCells","beforeUnmergeCells","afterUnmergeCells","afterListen","afterUnlisten","afterRefreshDimensions","beforeRefreshDimensions","beforeColumnCollapse","afterColumnCollapse","beforeColumnExpand","afterColumnExpand","modifyAutoColumnSizeSeed"],hL=new Map([["modifyRow","8.0.0"],["modifyCol","8.0.0"],["unmodifyRow","8.0.0"],["unmodifyCol","8.0.0"],["skipLengthCache","8.0.0"],["hiddenColumn","8.0.0"],["hiddenRow","8.0.0"]]),fL=new Map([[]]);function Zpe(t,e){RG(t,e),e.add(t)}function mL(t,e,n){RG(t,e),e.set(t,n)}function RG(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _G(t,e,n){return t.set(FT(t,e),n),n}function $a(t,e){return t.get(FT(t,e))}function FT(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Jpe=100;var su=new WeakMap,Yx=new WeakMap,pL=new WeakMap,gL=new WeakSet;class EG{constructor(){Zpe(this,gL),mL(this,su,new Map),mL(this,Yx,new Map),mL(this,pL,new Set),I0.forEach(e=>FT(gL,this,NG).call(this,e))}getHooks(e){var n;return(n=$a(su,this).get(e))!==null&&n!==void 0?n:[]}add(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};$a(su,this).has(e)||(FT(gL,this,NG).call(this,e),I0.push(e));const i=$a(su,this).get(e),s=i.find(g=>g.callback===n);if(s){s.skip===!0&&(s.skip=!1);return}const a=Number.isInteger(r.orderIndex)?r.orderIndex:0,u=!!r.runOnce,h=!!r.initialHook;let m=!1;if(h){const g=i.find(y=>y.initialHook);g&&(g.callback=n,m=!0)}if(!m){i.push({callback:n,orderIndex:a,runOnce:u,initialHook:h,skip:!1});let g=$a(pL,this).has(e);!g&&a!==0&&(g=!0,$a(pL,this).add(e)),g&&i.length>1&&$a(su,this).set(e,i.toSorted((y,x)=>y.orderIndex-x.orderIndex))}}has(e){return $a(su,this).has(e)&&$a(su,this).get(e).length>0}remove(e,n){if(!$a(su,this).has(e))return!1;const r=$a(su,this).get(e),i=r.find(s=>s.callback===n);if(i){let s=$a(Yx,this).get(e);return i.skip=!0,s+=1,s>Jpe&&($a(su,this).set(e,r.filter(a=>!a.skip)),s=0),$a(Yx,this).set(e,s),!0}return!1}destroy(){$a(su,this).clear(),$a(Yx,this).clear(),_G(su,this,null),_G(Yx,this,null)}}function NG(t){$a(su,this).set(t,[]),$a(Yx,this).set(t,0)}function ege(t,e,n){return(e=tge(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tge(t){var e=nge(t,"string");return typeof e=="symbol"?e:e+""}function nge(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const rge=Jr`The plugin hook "[hookName]" was removed in Handsontable [removedInVersion].\x20 Please consult release notes https://github.com/handsontable/handsontable/releases/tag/[removedInVersion] to\x20 learn about the migration path.`;class un{constructor(){ege(this,"globalBucket",new EG)}static getSingleton(){return sge()}getBucket(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e?(e.pluginHookBucket||(e.pluginHookBucket=new EG),e.pluginHookBucket):this.globalBucket}add(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;return Array.isArray(n)?Te(n,s=>this.add(e,s,r)):(hL.has(e)&&Yn(RT(rge,{hookName:e,removedInVersion:hL.get(e)})),fL.has(e)&&Yn(fL.get(e)),this.getBucket(r).add(e,n,{orderIndex:i,runOnce:!1})),this}once(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;return Array.isArray(n)?Te(n,s=>this.once(e,s,r)):this.getBucket(r).add(e,n,{orderIndex:i,runOnce:!0}),this}addAsFixed(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return Array.isArray(n)?Te(n,i=>this.addAsFixed(e,i,r)):this.getBucket(r).add(e,n,{initialHook:!0}),this}remove(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return this.getBucket(r).remove(e,n)}has(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this.getBucket(n).has(e)}run(e,n,r,i,s,a,u,h){{const m=this.getBucket().getHooks(n),g=m?m.length:0;let y=0;if(g)for(;y<g;){if(!m[y]||m[y].skip){y+=1;continue}const x=uL(m[y].callback,e,r,i,s,a,u,h);x!==void 0&&(r=x),m[y]&&m[y].runOnce&&this.remove(n,m[y].callback),y+=1}}{const m=this.getBucket(e).getHooks(n),g=m?m.length:0;let y=0;if(g)for(;y<g;){if(!m[y]||m[y].skip){y+=1;continue}const x=uL(m[y].callback,e,r,i,s,a,u,h);x!==void 0&&(r=x),m[y]&&m[y].runOnce&&this.remove(n,m[y].callback,e),y+=1}}return r}destroy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.getBucket(e).destroy()}register(e){this.isRegistered(e)||I0.push(e)}deregister(e){this.isRegistered(e)&&I0.splice(I0.indexOf(e),1)}isDeprecated(e){return fL.has(e)||hL.has(e)}isRegistered(e){return I0.indexOf(e)>=0}getRegistered(){return I0}}const ige=new un;function sge(){return ige}const D0=new Map;function ou(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"common";D0.has(t)||D0.set(t,new Map);const e=D0.get(t);function n(h,m){e.set(h,m)}function r(h){return e.get(h)}function i(h){return e.has(h)}function s(){return[...e.keys()]}function a(){return[...e.values()]}function u(){D0.delete(t),e.clear()}return{register:n,getItem:r,hasItem:i,getNames:s,getValues:a,clear:u}}function oge(t,e){var n;return D0==null||(n=D0.get(t.guid))===null||n===void 0?void 0:n.get(e)}const vL=new WeakMap,{register:age,getItem:kG,hasItem:TG,getNames:L9e,getValues:$9e}=ou("editors");function lge(t){const e={},n=t;this.getConstructor=function(){return t},this.getInstance=function(r){return r.guid in e||(e[r.guid]=new n(r)),e[r.guid]},un.getSingleton().add("afterDestroy",function(){e[this.guid]=null})}function jG(t,e){let n;return typeof t=="function"?(vL.get(t)||ol(null,t),n=vL.get(t)):typeof t=="string"?n=kG(t):gt('Only strings and functions can be passed as "editor" parameter'),n||gt(`No editor registered under name "${t}"`),n.getInstance(e)}function bL(t){return typeof t=="function"?t:(TG(t)||gt(`No registered editor found under "${t}" name`),kG(t).getConstructor())}function ol(t,e){t&&typeof t!="string"&&(e=t,t=e.EDITOR_TYPE);const n=new lge(e);typeof t=="string"&&age(t,n),vL.set(e,n)}function cge(t,e,n){return(e=uge(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uge(t){var e=dge(t,"string");return typeof e=="symbol"?e:e+""}function dge(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Sc{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;cge(this,"context",void 0),this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])}addEventListener(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;function s(a){r.call(this,hge(a))}return this.context.eventListeners.push({element:e,event:n,callback:r,callbackProxy:s,options:i,eventManager:this}),e.addEventListener(n,s,i),()=>{this.removeEventListener(e,n,r)}}removeEventListener(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=this.context.eventListeners.length,a;for(;s;)if(s-=1,a=this.context.eventListeners[s],a.event===n&&a.element===e){if(r&&r!==a.callback||i&&a.eventManager!==this)continue;this.context.eventListeners.splice(s,1),a.element.removeEventListener(a.event,a.callbackProxy,a.options)}}clearEvents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.context)return;let n=this.context.eventListeners.length;for(;n;){n-=1;const r=this.context.eventListeners[n];e&&r.eventManager!==this||(this.context.eventListeners.splice(n,1),r.element.removeEventListener(r.event,r.callbackProxy,r.options))}}clear(){this.clearEvents()}destroy(){this.clearEvents(),this.context=null}destroyWithOwnEventsOnly(){this.clearEvents(!0),this.context=null}fireEvent(e,n){let r=e.document,i=e;r||(r=e.ownerDocument?e.ownerDocument:e,i=r.defaultView);const s={bubbles:!0,cancelable:n!=="mousemove",view:i,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0};let a;r.createEvent?(a=r.createEvent("MouseEvents"),a.initMouseEvent(n,s.bubbles,s.cancelable,s.view,s.detail,s.screenX,s.screenY,s.clientX,s.clientY,s.ctrlKey,s.altKey,s.shiftKey,s.metaKey,s.button,r.body.parentNode)):a=r.createEventObject(),e.dispatchEvent?e.dispatchEvent(a):e.fireEvent(`on${n}`,a)}}function hge(t){const e=t.stopImmediatePropagation;return t.stopImmediatePropagation=function(){e.apply(this),iu(this)},t}function fge(t,e){mge(t,e),e.add(t)}function mge(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function H0(t,e,n){return(e=pge(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pge(t){var e=gge(t,"string");return typeof e=="symbol"?e:e+""}function gge(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yL(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var zT=new WeakSet;class xL{constructor(e,n,r){fge(this,zT),H0(this,"hot",void 0),H0(this,"tableMeta",void 0),H0(this,"selection",void 0),H0(this,"eventManager",void 0),H0(this,"destroyed",!1),H0(this,"activeEditor",void 0),H0(this,"cellProperties",void 0),this.hot=e,this.tableMeta=n,this.selection=r,this.eventManager=new Sc(e),this.hot.addHook("afterDocumentKeyDown",i=>yL(zT,this,MG).call(this,i)),this.hot.addHook("beforeCompositionStart",i=>yL(zT,this,MG).call(this,i)),this.hot.view._wt.update("onCellDblClick",(i,s,a)=>yL(zT,this,vge).call(this,i,s,a))}getActiveEditor(){return this.activeEditor}prepareEditor(){var e;if(this.activeEditor&&this.activeEditor.isWaiting()){this.closeEditor(!1,!1,m=>{m&&this.prepareEditor()});return}const n=(e=this.hot.getSelectedRangeActive())===null||e===void 0?void 0:e.highlight;if(!n||n.isHeader())return;const{row:r,col:i}=n,s=this.hot.runHooks("modifyGetCellCoords",r,i,!1,"meta");let a=r,u=i;if(Array.isArray(s)&&([a,u]=s),this.cellProperties=this.hot.getCellMeta(a,u),!this.isCellEditable()){this.clearActiveEditor();return}const h=this.hot.getCell(r,i,!0);if(h){const m=this.hot.getCellEditor(this.cellProperties),g=this.hot.colToProp(u),y=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(a),u);this.activeEditor=jG(m,this.hot),this.activeEditor.prepare(r,i,g,h,y,this.cellProperties)}}isEditorOpened(){return this.activeEditor&&this.activeEditor.isOpened()}openEditor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(!this.isCellEditable()){this.clearActiveEditor();return}const i=this.hot.getSelectedRangeActive();let s=this.hot.runHooks("beforeBeginEditing",i.highlight.row,i.highlight.col,e,n,r);if(n instanceof MouseEvent&&typeof s!="boolean"&&(s=this.hot.selection.getLayerLevel()===0&&i.isSingle()),s===!1){this.clearActiveEditor();return}this.activeEditor||(this.hot.scrollToFocusedCell(),this.prepareEditor()),this.activeEditor&&(r&&this.activeEditor.enableFullEditMode(),this.activeEditor.beginEditing(e,n))}closeEditor(e,n,r){this.activeEditor?this.activeEditor.finishEditing(e,n,r):r&&r(!1)}closeEditorAndSaveChanges(e){this.closeEditor(!1,e)}closeEditorAndRestoreOriginalValue(e){this.closeEditor(!0,e)}clearActiveEditor(){this.activeEditor=void 0}isCellEditable(){const e=this.hot.getSelectedRangeActive();if(!e)return!1;const n=this.hot.getCellEditor(this.cellProperties),{row:r,col:i}=e.highlight,{rowIndexMapper:s,columnIndexMapper:a}=this.hot,u=s.isHidden(this.hot.toPhysicalRow(r))||a.isHidden(this.hot.toPhysicalColumn(i));return!(this.cellProperties.readOnly||!n||u)}moveSelectionAfterEnter(e){const n={...typeof this.tableMeta.enterMoves=="function"?this.tableMeta.enterMoves(e):this.tableMeta.enterMoves};e.shiftKey&&(n.row=-n.row,n.col=-n.col),this.hot.selection.isMultiple()?this.selection.transformFocus(n.row,n.col):this.selection.transformStart(n.row,n.col,!0)}destroy(){this.destroyed=!0,this.eventManager.destroy()}}function MG(t){const e=this.hot.getSelectedRangeActive();if(!this.hot.isListening()||!e||e.highlight.isHeader()||A0(t))return;const{keyCode:n}=t,r=(t.ctrlKey||t.metaKey)&&!t.altKey;(!this.activeEditor||this.activeEditor&&!this.activeEditor.isWaiting())&&!SG(n)&&!qpe(n)&&!r&&!this.isEditorOpened()&&this.openEditor("",t)}function vge(t,e){e.isCell()&&(this.hot.getShortcutManager().isCtrlPressed()?this.clearActiveEditor():this.openEditor(null,t,!0))}const PG=new WeakMap;xL.getInstance=function(t,e,n){let r=PG.get(t);return r||(r=new xL(t,e,n),PG.set(t,r)),r};const AG={" ":" ","&":"&","<":"<",">":">"},bge=new RegExp(Object.keys(AG).map(t=>`(${t})`).join("|"),"gi");function yge(t){return(t&&t.nodeName||"")==="TABLE"}function OG(t){const e=t.hasColHeaders(),n=t.hasRowHeaders(),r=[e?-1:0,n?-1:0,t.countRows()-1,t.countCols()-1],i=t.getData(...r),s=i.length,a=s>0?i[0].length:0,u=["<table>","</table>"],h=e?["<thead>","</thead>"]:[],m=["<tbody>","</tbody>"],g=n?1:0,y=e?1:0;for(let x=0;x<s;x+=1){const C=e&&x===0,E=[];for(let j=0;j<a;j+=1){const L=!C&&n&&j===0;let D="";if(C)D=`<th>${t.getColHeader(j-g)}</th>`;else if(L)D=`<th>${t.getRowHeader(x-y)}</th>`;else{const z=i[x][j],{hidden:H,rowspan:V,colspan:F}=t.getCellMeta(x-y,j-g);if(!H){const B=[];if(V&&B.push(`rowspan="${V}"`),F&&B.push(`colspan="${F}"`),Yr(z))D=`<td ${B.join(" ")}></td>`;else{const te=z.toString().replace(/</g,"<").replace(/>/g,">").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r `).replace(/\x20/gi," ").replace(/\t/gi,"	");D=`<td ${B.join(" ")}>${te}</td>`}}}E.push(D)}const M=["<tr>",...E,"</tr>"].join("");C?h.splice(1,0,M):m.splice(-1,0,M)}return u.splice(1,0,h.join(""),m.join("")),u.join("")}function IG(t){const e=t.length,n=["<table>"];for(let r=0;r<e;r+=1){const i=t[r],s=i.length,a=[];r===0&&n.push("<tbody>");for(let u=0;u<s;u+=1){const h=i[u],m=Yr(h)?"":h.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r `).replace(/\x20{2,}/gi,g=>`<span style="mso-spacerun: yes">${" ".repeat(g.length-1)} </span>`).replace(/\t/gi,"	");a.push(`<td>${m}</td>`)}n.push("<tr>",...a,"</tr>"),r+1===e&&n.push("</tbody>")}return n.push("</table>"),n.join("")}function DG(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;const n={},r=e.createDocumentFragment(),i=e.createElement("div");r.appendChild(i);let s=t;if(typeof s=="string"){const z=s.replace(/<td\b[^>]*?>([\s\S]*?)<\/\s*td>/g,H=>{const V=H.match(/<td\b[^>]*?>/g)[0],F=/<p.*?>/g,B=H.substring(V.length,H.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(F,` `).replace(` `,"").replaceAll(/<\/(.*)>\s+$/mg,"</$1>").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^ $/mg,"");return`${V}${B}</td>`});i.insertAdjacentHTML("afterbegin",`${z}`),s=i.querySelector("table")}if(!s||!yge(s))return;const a=i.querySelector('meta[name$="enerator"]'),u=s.querySelector("tbody th")!==null,h=s.querySelector("tr"),m=h?Array.from(h.cells).reduce((z,H)=>z+H.colSpan,0)-(u?1:0):0,g=s.tFoot&&Array.from(s.tFoot.rows)||[],y=[];let x=!1,C=0,E=0;if(s.tHead){const z=Array.from(s.tHead.rows).filter(H=>{const V=H.querySelector("td")!==null;return V&&y.push(H),!V});C=z.length,x=C>0,C>1?n.nestedHeaders=Array.from(z).reduce((H,V)=>{const F=Array.from(V.cells).reduce((B,te,ve)=>{if(u&&ve===0)return B;const{colSpan:ce,innerHTML:_e}=te,pe=ce>1?{label:_e,colspan:ce}:_e;return B.push(pe),B},[]);return H.push(F),H},[]):x&&(n.colHeaders=Array.from(z[0].children).reduce((H,V,F)=>(u&&F===0||H.push(V.innerHTML),H),[]))}y.length&&(n.fixedRowsTop=y.length),g.length&&(n.fixedRowsBottom=g.length);const M=[...y,...Array.from(s.tBodies).reduce((z,H)=>(z.push(...Array.from(H.rows)),z),[]),...g];E=M.length;const j=new Array(E);for(let z=0;z<E;z++)j[z]=new Array(m);const L=[],D=[];for(let z=0;z<E;z++){const H=M[z],V=Array.from(H.cells),F=V.length;for(let B=0;B<F;B++){const te=V[B],{nodeName:ve,innerHTML:ce,rowSpan:_e,colSpan:pe}=te,Le=j[z].findIndex(Fe=>Fe===void 0);if(ve==="TD"){if(_e>1||pe>1){for(let $e=z;$e<z+_e;$e++)if($e<E)for(let Re=Le;Re<Le+pe;Re++)j[$e][Re]=null;const nt=te.getAttribute("style");nt&&nt.includes("mso-ignore:colspan")||L.push({col:Le,row:z,rowspan:_e,colspan:pe})}let Fe="";a&&/excel/gi.test(a.content)?Fe=ce.replace(/[\r\n][\x20]{0,2}/g," ").replace(/<br(\s*|\/)>[\r\n]?[\x20]{0,3}/gim,`\r `):Fe=ce.replace(/<br(\s*|\/)>[\r\n]?/gim,`\r `),j[z][Le]=Fe.replace(bge,nt=>AG[nt])}else D.push(ce)}}return L.length&&(n.mergeCells=L),D.length&&(n.rowHeaders=D),j.length&&(n.data=j),n}function Vl(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=typeof t;if(n==="number")return!isNaN(t)&&isFinite(t);if(n==="string"){if(t.length===0)return!1;if(t.length===1)return/\d/.test(t);const r=Array.from(new Set([".",...e])).map(i=>`\\${i}`).join("|");return new RegExp(`^[+-]?(((${r})?\\d+((${r})\\d+)?(e[+-]?\\d+)?)|(0x[a-f\\d]+))$`,"i").test(t.trim())}else if(n==="object")return!!t&&typeof t.valueOf()=="number"&&!(t instanceof Date);return!1}function xge(t){return Vl(t,[","])}function En(t,e,n){let r=-1;for(typeof e=="function"?(n=e,e=t):r=t-1;++r<=e&&n(r)!==!1;);}function HG(t,e,n){let r=t+1;for(typeof e=="function"&&(n=e,e=0);--r>=e&&n(r)!==!1;);}function LG(t,e){return e=parseInt(e.toString().replace("%",""),10),e=isNaN(e)?0:e,parseInt(t*e/100,10)}function Lr(t,e,n){return Math.min(t,e)===t?e:Math.max(t,n)===t?n:t}function wge(t){const e=t.replace(",",".");return isNaN(parseFloat(e))===!1?parseFloat(e):null}function Gx(t){return Number.isInteger(t)&&t>=0}const wL="asc",Cge="desc",$G=new Map([[wL,[-1,1]],[Cge,[1,-1]]]),Sge=t=>`The priority '${t}' is already declared in a map.`,Rge=t=>`The priority '${t}' is not a number.`;function _ge(){let{errorPriorityExists:t,errorPriorityNaN:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=new Map;t=ri(t)?t:Sge,e=ri(e)?e:Rge;function r(s,a){Vl(s)||gt(e(s)),n.has(s)&>(t(s)),n.set(s,a)}function i(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wL;const[a,u]=$G.get(s)||$G.get(wL);return[...n].sort((h,m)=>h[0]<m[0]?a:u).map(h=>h[1])}return{addItem:r,getItems:i}}const Ege=t=>`The id '${t}' is already declared in a map.`;function mR(){let{errorIdExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Map;t=ri(t)?t:Ege;function n(g,y){m(g)&>(t(g)),e.set(g,y)}function r(g){return e.delete(g)}function i(){e.clear()}function s(g){const[y]=u().find(x=>{let[C,E]=x;return g===E?C:!1})||[null];return y}function a(g){return e.get(g)}function u(){return[...e]}function h(){return[...e.values()]}function m(g){return e.has(g)}return{addItem:n,clear:i,getId:s,getItem:a,getItems:u,getValues:h,hasItem:m,removeItem:r}}const Nge=t=>`'${t}' value is already declared in a unique set.`;function kge(){let{errorItemExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Set;t=ri(t)?t:Nge;function n(s){e.has(s)&>(t(s)),e.add(s)}function r(){return[...e]}function i(){e.clear()}return{addItem:n,clear:i,getItems:r}}const CL=t=>`There is already registered "${t}" plugin.`,FG=_ge({errorPriorityExists:t=>`There is already registered plugin on priority "${t}".`,errorPriorityNaN:t=>`The priority "${t}" is not a number.`}),zG=kge({errorItemExists:CL}),SL=mR({errorIdExists:CL});function VG(){return[...FG.getItems(),...zG.getItems()]}function RL(t){const e=Hd(t);return SL.getItem(e)}function Tge(t){return!!RL(t)}function Gr(t,e,n){[t,e,n]=Mge(t,e,n),RL(t)===void 0&&jge(t,e,n)}function jge(t,e,n){const r=Hd(t);SL.hasItem(r)&>(CL(r)),n===void 0?zG.addItem(r):FG.addItem(n,r),SL.addItem(r,e)}function Mge(t,e,n){return typeof t=="function"&&(e=t,t=e.PLUGIN_KEY,n=e.PLUGIN_PRIORITY),[t,e,n]}const{register:Pge,getItem:Age,hasItem:BG,getNames:V9e,getValues:B9e}=ou("renderers");function _L(t){return typeof t=="function"?t:(BG(t)||gt(`No registered renderer found under "${t}" name`),Age(t))}function Bl(t,e){typeof t!="string"&&(e=t,t=e.RENDERER_TYPE),Pge(t,e)}const{register:Oge,getItem:Ige,hasItem:WG,getNames:W9e,getValues:U9e}=ou("validators");function Dge(t){return typeof t=="function"?t:(WG(t)||gt(`No registered validator found under "${t}" name`),Ige(t))}function Sm(t,e){typeof t!="string"&&(e=t,t=e.VALIDATOR_TYPE),Oge(t,e)}function pR(t,e,n){return(e=Hge(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hge(t){var e=Lge(t,"string");return typeof e=="symbol"?e:e+""}function Lge(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class $ge{constructor(){pR(this,"count",0),pR(this,"startColumn",null),pR(this,"endColumn",null),pR(this,"startPosition",null),pR(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedWidth:r,zeroBasedScrollOffset:i,viewportWidth:s,columnWidth:a}=n,u=i>0?s+1:s;r>=i&&r+a<=i+u&&((this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=e),this.endColumn=e)}finalize(e){var n;const{scrollOffset:r,viewportWidth:i,inlineStartOffset:s,zeroBasedScrollOffset:a,totalColumns:u,needReverse:h,startPositions:m,columnWidth:g}=e;if(this.endColumn===u-1&&h)for(this.startColumn=this.endColumn;this.startColumn>0;){const E=m[this.endColumn]+g-m[this.startColumn-1];if(E<=i&&(this.startColumn-=1),E>=i)break}this.startPosition=(n=m[this.startColumn])!==null&&n!==void 0?n:null;const y=a>0?i+1:i,x=r+i-y,C=this.startColumn===null?0:e.getColumnWidth(this.startColumn);x<-1*s||r>m.at(-1)||-1*r-i>-1*C?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,u<this.endColumn&&(this.endColumn=u-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function gR(t,e,n){return(e=Fge(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fge(t){var e=zge(t,"string");return typeof e=="symbol"?e:e+""}function zge(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Vge{constructor(){gR(this,"count",0),gR(this,"startRow",null),gR(this,"endRow",null),gR(this,"startPosition",null),gR(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedHeight:r,zeroBasedScrollOffset:i,innerViewportHeight:s,rowHeight:a}=n;r>=i&&r+a<=s&&(this.startRow===null&&(this.startRow=e),this.endRow=e)}finalize(e){var n;const{scrollOffset:r,viewportHeight:i,horizontalScrollbarHeight:s,totalRows:a,needReverse:u,startPositions:h,rowHeight:m}=e;if(this.endRow===a-1&&u)for(this.startRow=this.endRow;this.startRow>0;){const x=h[this.endRow]+m-h[this.startRow-1];if(x<=i-s&&(this.startRow-=1),x>=i-s)break}this.startPosition=(n=h[this.startRow])!==null&&n!==void 0?n:null;const g=r+i-s,y=this.startRow===null?0:e.getRowHeight(this.startRow);g<y||r>h.at(-1)?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,a<this.endRow&&(this.endRow=a-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function vR(t,e,n){return(e=Bge(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bge(t){var e=Wge(t,"string");return typeof e=="symbol"?e:e+""}function Wge(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class UG{constructor(){vR(this,"count",0),vR(this,"startColumn",null),vR(this,"endColumn",null),vR(this,"startPosition",null),vR(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedWidth:r,zeroBasedScrollOffset:i,viewportWidth:s}=n;r<=i&&(this.startColumn=e);const a=i>0?s+1:s;r>=i&&r<=i+a&&(this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=e),this.endColumn=e}finalize(e){var n;const{scrollOffset:r,viewportWidth:i,inlineStartOffset:s,zeroBasedScrollOffset:a,totalColumns:u,needReverse:h,startPositions:m,columnWidth:g}=e;if(this.endColumn===u-1&&h)for(this.startColumn=this.endColumn;this.startColumn>0;){const C=m[this.endColumn]+g-m[this.startColumn-1];if(this.startColumn-=1,C>i)break}this.startPosition=(n=m[this.startColumn])!==null&&n!==void 0?n:null;const y=a>0?i+1:i;r+i-y<-1*s||r>m.at(-1)+g||-1*r-i>0?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,u<this.endColumn&&(this.endColumn=u-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function bR(t,e,n){return(e=Uge(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Uge(t){var e=Yge(t,"string");return typeof e=="symbol"?e:e+""}function Yge(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class YG{constructor(){bR(this,"count",0),bR(this,"startRow",null),bR(this,"endRow",null),bR(this,"startPosition",null),bR(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedHeight:r,zeroBasedScrollOffset:i,innerViewportHeight:s}=n;r<=i&&(this.startRow=e),r>=i&&r<=s&&this.startRow===null&&(this.startRow=e),this.endRow=e}finalize(e){var n;const{scrollOffset:r,viewportHeight:i,horizontalScrollbarHeight:s,totalRows:a,needReverse:u,startPositions:h,rowHeight:m}=e;if(this.endRow===a-1&&u)for(this.startRow=this.endRow;this.startRow>0;){const y=h[this.endRow]+m-h[this.startRow-1];if(this.startRow-=1,y>=i-s)break}this.startPosition=(n=h[this.startRow])!==null&&n!==void 0?n:null,r+i-s<0||r>h.at(-1)+m?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,a<this.endRow&&(this.endRow=a-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function yR(t,e,n){return(e=Gge(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Gge(t){var e=Kge(t,"string");return typeof e=="symbol"?e:e+""}function Kge(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class qge{constructor(){yR(this,"count",0),yR(this,"startColumn",0),yR(this,"endColumn",0),yR(this,"startPosition",0),yR(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalColumns:n}=e;this.count=n,this.endColumn=this.count-1}process(){}finalize(){}}function xR(t,e,n){return(e=Xge(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xge(t){var e=Qge(t,"string");return typeof e=="symbol"?e:e+""}function Qge(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Zge{constructor(){xR(this,"count",0),xR(this,"startRow",0),xR(this,"endRow",0),xR(this,"startPosition",0),xR(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalRows:n}=e;this.count=n,this.endRow=this.count-1}process(){}finalize(){}}function GG(t,e,n){return(e=Jge(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Jge(t){var e=eve(t,"string");return typeof e=="symbol"?e:e+""}function eve(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class tve extends UG{constructor(){super(...arguments),GG(this,"columnStartOffset",0),GG(this,"columnEndOffset",0)}finalize(e){var n;super.finalize(e);const{overrideFn:r,totalColumns:i,startPositions:s}=e;if(this.startColumn!==null&&typeof r=="function"){const a=this.startColumn,u=this.endColumn;r(this),this.columnStartOffset=a-this.startColumn,this.columnEndOffset=this.endColumn-u}this.startColumn<0&&(this.startColumn=0),this.startPosition=(n=s[this.startColumn])!==null&&n!==void 0?n:null,i<this.endColumn&&(this.endColumn=i-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function KG(t,e,n){return(e=nve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nve(t){var e=rve(t,"string");return typeof e=="symbol"?e:e+""}function rve(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ive extends YG{constructor(){super(...arguments),KG(this,"rowStartOffset",0),KG(this,"rowEndOffset",0)}finalize(e){var n;super.finalize(e);const{overrideFn:r,totalRows:i,startPositions:s}=e;if(this.startRow!==null&&typeof r=="function"){const a=this.startRow,u=this.endRow;r(this),this.rowStartOffset=a-this.startRow,this.rowEndOffset=this.endRow-u}this.startRow<0&&(this.startRow=0),this.startPosition=(n=s[this.startRow])!==null&&n!==void 0?n:null,i<this.endRow&&(this.endRow=i-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function qG(t,e,n){return(e=sve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sve(t){var e=ove(t,"string");return typeof e=="symbol"?e:e+""}function ove(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class XG{constructor(e){qG(this,"calculationTypes",[]),qG(this,"calculationResults",new Map),this.calculationTypes=e}_initialize(e){this.calculationTypes.forEach(n=>{let[r,i]=n;this.calculationResults.set(r,i),i.initialize(e)})}_process(e,n){this.calculationTypes.forEach(r=>{let[,i]=r;return i.process(e,n)})}_finalize(e){this.calculationTypes.forEach(n=>{let[,r]=n;return r.finalize(e)})}getResultsFor(e){return this.calculationResults.get(e)}}function $d(t,e,n){return(e=ave(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ave(t){var e=lve(t,"string");return typeof e=="symbol"?e:e+""}function lve(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Kx=50;class cve extends XG{constructor(e){let{calculationTypes:n,viewportWidth:r,scrollOffset:i,totalColumns:s,columnWidthFn:a,overrideFn:u,inlineStartOffset:h}=e;super(n),$d(this,"viewportWidth",0),$d(this,"scrollOffset",0),$d(this,"zeroBasedScrollOffset",0),$d(this,"totalColumns",0),$d(this,"columnWidthFn",null),$d(this,"columnWidth",0),$d(this,"overrideFn",null),$d(this,"inlineStartOffset",0),$d(this,"totalCalculatedWidth",0),$d(this,"startPositions",[]),$d(this,"needReverse",!0),this.viewportWidth=r,this.scrollOffset=i,this.zeroBasedScrollOffset=Math.max(i,0),this.totalColumns=s,this.columnWidthFn=a,this.overrideFn=u,this.inlineStartOffset=h,this.calculate()}calculate(){this._initialize(this);for(let e=0;e<this.totalColumns;e++)if(this.columnWidth=this.getColumnWidth(e),this._process(e,this),this.startPositions.push(this.totalCalculatedWidth),this.totalCalculatedWidth+=this.columnWidth,this.totalCalculatedWidth>=this.zeroBasedScrollOffset+this.viewportWidth){this.needReverse=!1;break}this._finalize(this)}getColumnWidth(e){const n=this.columnWidthFn(e);return isNaN(n)?Kx:n}}function Qu(t,e,n){return(e=uve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uve(t){var e=dve(t,"string");return typeof e=="symbol"?e:e+""}function dve(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class hve extends XG{constructor(e){let{calculationTypes:n,viewportHeight:r,scrollOffset:i,totalRows:s,defaultRowHeight:a,rowHeightFn:u,overrideFn:h,horizontalScrollbarHeight:m}=e;super(n),Qu(this,"viewportHeight",0),Qu(this,"scrollOffset",0),Qu(this,"zeroBasedScrollOffset",0),Qu(this,"totalRows",0),Qu(this,"rowHeightFn",null),Qu(this,"rowHeight",0),Qu(this,"overrideFn",null),Qu(this,"horizontalScrollbarHeight",0),Qu(this,"innerViewportHeight",0),Qu(this,"totalCalculatedHeight",0),Qu(this,"startPositions",[]),Qu(this,"needReverse",!0),this.defaultHeight=a,this.viewportHeight=r,this.scrollOffset=i,this.zeroBasedScrollOffset=Math.max(i,0),this.totalRows=s,this.rowHeightFn=u,this.overrideFn=h,this.horizontalScrollbarHeight=m??0,this.innerViewportHeight=this.zeroBasedScrollOffset+this.viewportHeight-this.horizontalScrollbarHeight,this.calculate()}calculate(){this._initialize(this);for(let e=0;e<this.totalRows;e++)if(this.rowHeight=this.getRowHeight(e),this._process(e,this),this.startPositions.push(this.totalCalculatedHeight),this.totalCalculatedHeight+=this.rowHeight,this.totalCalculatedHeight>=this.innerViewportHeight){this.needReverse=!1;break}this._finalize(this)}getRowHeight(e){const n=this.rowHeightFn(e);return isNaN(n)?this.defaultHeight:n}}function fve(t,e,n){mve(t,e),e.set(t,n)}function mve(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function QG(t,e,n){return(e=pve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pve(t){var e=gve(t,"string");return typeof e=="symbol"?e:e+""}function gve(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qx(t,e){return t.get(JG(t,e))}function ZG(t,e,n){return t.set(JG(t,e),n),n}function JG(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Rm=new WeakMap;class L0{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;QG(this,"row",null),QG(this,"col",null),fve(this,Rm,!1),ZG(Rm,this,r),typeof e<"u"&&typeof n<"u"&&(this.row=e,this.col=n)}isValid(e){const{countRows:n,countCols:r,countRowHeaders:i,countColHeaders:s}={countRows:0,countCols:0,countRowHeaders:0,countColHeaders:0,...e};return!(!Number.isInteger(this.row)||!Number.isInteger(this.col)||this.row<-s||this.col<-i||this.row>=n||this.col>=r)}isEqual(e){return e===this?!0:this.row===e.row&&this.col===e.col}isHeader(){return!this.isCell()}isCell(){return this.row>=0&&this.col>=0}isRtl(){return qx(Rm,this)}isSouthEastOf(e){return this.row>=e.row&&(qx(Rm,this)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(qx(Rm,this)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(qx(Rm,this)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(qx(Rm,this)?this.col<=e.col:this.col>=e.col)}normalize(){return this.row=this.row===null?this.row:Math.max(this.row,0),this.col=this.col===null?this.col:Math.max(this.col,0),this}assign(e){return Number.isInteger(e==null?void 0:e.row)&&(this.row=e.row),Number.isInteger(e==null?void 0:e.col)&&(this.col=e.col),e instanceof L0&&ZG(Rm,this,e.isRtl()),this}clone(){return new L0(this.row,this.col,qx(Rm,this))}toObject(){return{row:this.row,col:this.col}}}function vve(t,e,n){bve(t,e),e.set(t,n)}function bve(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function EL(t,e,n){return(e=yve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yve(t){var e=xve(t,"string");return typeof e=="symbol"?e:e+""}function xve(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zu(t,e){return t.get(eK(t,e))}function wve(t,e,n){return t.set(eK(t,e),n),n}function eK(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Rc=new WeakMap;class Xx{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;EL(this,"highlight",null),EL(this,"from",null),EL(this,"to",null),vve(this,Rc,!1),this.highlight=e.clone(),this.from=n.clone(),this.to=r.clone(),wve(Rc,this,i)}setHighlight(e){return this.highlight=e.clone(),this}setFrom(e){return this.from=e.clone(),this}setTo(e){return this.to=e.clone(),this}normalize(){return this.highlight.normalize(),this.from.normalize(),this.to.normalize(),this}isValid(e){return this.from.isValid(e)&&this.to.isValid(e)}isSingle(){return this.isSingleCell()||this.isSingleHeader()}isSingleCell(){return this.from.row>=0&&this.from.row===this.to.row&&this.from.col>=0&&this.from.col===this.to.col}isSingleHeader(){return(this.from.row<0||this.from.col<0)&&this.from.row===this.to.row&&this.from.col===this.to.col}isHeader(){return this.from.isHeader()&&this.to.isHeader()?!0:this.from.col<0&&this.to.col<0||this.from.row<0&&this.to.row<0}containsHeaders(){return this.from.isHeader()||this.to.isHeader()}getOuterHeight(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1}getOuterWidth(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1}getHeight(){if(this.from.row<0&&this.to.row<0)return 0;const e=Math.max(this.from.row,0),n=Math.max(this.to.row,0);return Math.max(e,n)-Math.min(e,n)+1}getWidth(){if(this.from.col<0&&this.to.col<0)return 0;const e=Math.max(this.from.col,0),n=Math.max(this.to.col,0);return Math.max(e,n)-Math.min(e,n)+1}getCellsCount(){return this.getWidth()*this.getHeight()}includes(e){const{row:n,col:r}=e,i=this.getOuterTopStartCorner(),s=this.getOuterBottomEndCorner();return i.row<=n&&s.row>=n&&i.col<=r&&s.col>=r}includesRange(e){return this.includes(e.getOuterTopStartCorner())&&this.includes(e.getOuterBottomEndCorner())}isEqual(e){return Math.min(this.from.row,this.to.row)===Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)===Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)===Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)===Math.max(e.from.col,e.to.col)}overlaps(e){return e.isSouthEastOf(this.getOuterTopLeftCorner())&&e.isNorthWestOf(this.getOuterBottomRightCorner())}isSouthEastOf(e){return this.getOuterTopLeftCorner().isSouthEastOf(e)||this.getOuterBottomRightCorner().isSouthEastOf(e)}isNorthWestOf(e){return this.getOuterTopLeftCorner().isNorthWestOf(e)||this.getOuterBottomRightCorner().isNorthWestOf(e)}isOverlappingHorizontally(e){return this.getOuterTopEndCorner().col>=e.getOuterTopStartCorner().col&&this.getOuterTopEndCorner().col<=e.getOuterTopEndCorner().col||this.getOuterTopStartCorner().col<=e.getOuterTopEndCorner().col&&this.getOuterTopStartCorner().col>=e.getOuterTopStartCorner().col}isOverlappingVertically(e){return this.getOuterBottomStartCorner().row>=e.getOuterTopRightCorner().row&&this.getOuterBottomStartCorner().row<=e.getOuterBottomStartCorner().row||this.getOuterTopEndCorner().row<=e.getOuterBottomStartCorner().row&&this.getOuterTopEndCorner().row>=e.getOuterTopRightCorner().row}expand(e){const n=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner();return e.row<n.row||e.col<n.col||e.row>r.row||e.col>r.col?(this.from=this._createCellCoords(Math.min(n.row,e.row),Math.min(n.col,e.col)),this.to=this._createCellCoords(Math.max(r.row,e.row),Math.max(r.col,e.col)),!0):!1}expandByRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(this.includesRange(e)||!this.overlaps(e))return!1;const r=this.getOuterTopStartCorner(),i=this.getOuterBottomEndCorner(),s=this.getDirection(),a=e.getOuterTopStartCorner(),u=e.getOuterBottomEndCorner(),h=Math.min(r.row,a.row),m=Math.min(r.col,a.col),g=Math.max(i.row,u.row),y=Math.max(i.col,u.col),x=this._createCellCoords(h,m),C=this._createCellCoords(g,y);return this.from=x,this.to=C,this.setDirection(s),n&&(this.highlight.row===this.getOuterBottomRightCorner().row&&this.getVerticalDirection()==="N-S"&&this.flipDirectionVertically(),this.highlight.col===this.getOuterTopRightCorner().col&&this.getHorizontalDirection()==="W-E"&&this.flipDirectionHorizontally()),!0}getDirection(){if(this.from.isNorthWestOf(this.to))return"NW-SE";if(this.from.isNorthEastOf(this.to))return"NE-SW";if(this.from.isSouthEastOf(this.to))return"SE-NW";if(this.from.isSouthWestOf(this.to))return"SW-NE"}setDirection(e){switch(e){case"NW-SE":[this.from,this.to]=[this.getOuterTopLeftCorner(),this.getOuterBottomRightCorner()];break;case"NE-SW":[this.from,this.to]=[this.getOuterTopRightCorner(),this.getOuterBottomLeftCorner()];break;case"SE-NW":[this.from,this.to]=[this.getOuterBottomRightCorner(),this.getOuterTopLeftCorner()];break;case"SW-NE":[this.from,this.to]=[this.getOuterBottomLeftCorner(),this.getOuterTopRightCorner()];break}}getVerticalDirection(){return["NE-SW","NW-SE"].indexOf(this.getDirection())>-1?"N-S":"S-N"}getHorizontalDirection(){return["NW-SE","SW-NE"].indexOf(this.getDirection())>-1?"W-E":"E-W"}flipDirectionVertically(){switch(this.getDirection()){case"NW-SE":this.setDirection("SW-NE");break;case"NE-SW":this.setDirection("SE-NW");break;case"SE-NW":this.setDirection("NE-SW");break;case"SW-NE":this.setDirection("NW-SE");break}}flipDirectionHorizontally(){switch(this.getDirection()){case"NW-SE":this.setDirection("NE-SW");break;case"NE-SW":this.setDirection("NW-SE");break;case"SE-NW":this.setDirection("SW-NE");break;case"SW-NE":this.setDirection("SE-NW");break}}getTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getTopLeftCorner(){return Zu(Rc,this)?this.getTopEndCorner():this.getTopStartCorner()}getBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getBottomRightCorner(){return Zu(Rc,this)?this.getBottomStartCorner():this.getBottomEndCorner()}getTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getTopRightCorner(){return Zu(Rc,this)?this.getTopStartCorner():this.getTopEndCorner()}getBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getBottomLeftCorner(){return Zu(Rc,this)?this.getBottomEndCorner():this.getBottomStartCorner()}getOuterTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterTopLeftCorner(){return Zu(Rc,this)?this.getOuterTopEndCorner():this.getOuterTopStartCorner()}getOuterBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterBottomRightCorner(){return Zu(Rc,this)?this.getOuterBottomStartCorner():this.getOuterBottomEndCorner()}getOuterTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterTopRightCorner(){return Zu(Rc,this)?this.getOuterTopStartCorner():this.getOuterTopEndCorner()}getOuterBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterBottomLeftCorner(){return Zu(Rc,this)?this.getOuterBottomEndCorner():this.getOuterBottomStartCorner()}isCorner(e){return e.isEqual(this.getOuterTopLeftCorner())||e.isEqual(this.getOuterTopRightCorner())||e.isEqual(this.getOuterBottomLeftCorner())||e.isEqual(this.getOuterBottomRightCorner())}getOppositeCorner(e){if(!(e instanceof L0))return!1;if(e.isEqual(this.getOuterBottomEndCorner()))return this.getOuterTopStartCorner();if(e.isEqual(this.getOuterTopStartCorner()))return this.getOuterBottomEndCorner();if(e.isEqual(this.getOuterTopEndCorner()))return this.getOuterBottomStartCorner();if(e.isEqual(this.getOuterBottomStartCorner()))return this.getOuterTopEndCorner()}getBordersSharedWith(e){if(!this.includesRange(e))return[];const n={top:Math.min(this.from.row,this.to.row),bottom:Math.max(this.from.row,this.to.row),left:Math.min(this.from.col,this.to.col),right:Math.max(this.from.col,this.to.col)},r={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},i=[];return n.top===r.top&&i.push("top"),n.right===r.right&&i.push(Zu(Rc,this)?"left":"right"),n.bottom===r.bottom&&i.push("bottom"),n.left===r.left&&i.push(Zu(Rc,this)?"right":"left"),i}getInner(){const e=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner(),r=[];for(let i=e.row;i<=n.row;i++)for(let s=e.col;s<=n.col;s++)!(this.from.row===i&&this.from.col===s)&&!(this.to.row===i&&this.to.col===s)&&r.push(this._createCellCoords(i,s));return r}getAll(){const e=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner(),r=[];for(let i=e.row;i<=n.row;i++)for(let s=e.col;s<=n.col;s++)e.row===i&&e.col===s?r.push(e):n.row===i&&n.col===s?r.push(n):r.push(this._createCellCoords(i,s));return r}forAll(e){const n=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner();for(let i=n.row;i<=r.row;i++)for(let s=n.col;s<=r.col;s++)if(e(i,s)===!1)return}clone(){return new Xx(this.highlight,this.from,this.to,Zu(Rc,this))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,n){return new L0(e,n,Zu(Rc,this))}}function Wh(t,e,n){Cve(t,e),e.set(t,n)}function Cve(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Nn(t,e){return t.get(tK(t,e))}function Sg(t,e,n){return t.set(tK(t,e),n),n}function tK(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Ju=new WeakMap,NL=new WeakMap,Ca=new WeakMap,Qx=new WeakMap,VT=new WeakMap,Fd=new WeakMap,kL=new WeakMap,wR=new WeakMap,$0=new WeakMap,Uh=new WeakMap;let nK=class{constructor(e,n,r,i,s,a){let u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null;Wh(this,Ju,void 0),Wh(this,NL,void 0),Wh(this,Ca,void 0),Wh(this,Qx,void 0),Wh(this,VT,void 0),Wh(this,Fd,void 0),Wh(this,kL,void 0),Wh(this,wR,void 0),Wh(this,$0,[null,null]),Wh(this,Uh,[null,null]),Sg(Ju,this,r),Sg(NL,this,n),Sg(Ca,this,s),Sg(Qx,this,a),Sg(VT,this,u),Sg(Fd,this,i),Sg(kL,this,e),this.registerEvents()}registerEvents(){Nn(Fd,this).addEventListener(Nn(Ca,this).holder,"contextmenu",r=>this.onContextMenu(r)),Nn(Fd,this).addEventListener(Nn(Ca,this).TABLE,"mouseover",r=>this.onMouseOver(r)),Nn(Fd,this).addEventListener(Nn(Ca,this).TABLE,"mouseout",r=>this.onMouseOut(r));const e=()=>{Nn(Fd,this).addEventListener(Nn(Ca,this).holder,"touchstart",r=>this.onTouchStart(r)),Nn(Fd,this).addEventListener(Nn(Ca,this).holder,"touchend",r=>this.onTouchEnd(r)),this.momentumScrolling||(this.momentumScrolling={}),Nn(Fd,this).addEventListener(Nn(Ca,this).holder,"scroll",()=>{clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||Nn(Ju,this).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout(()=>{this.touchApplied||(this.momentumScrolling.ongoing=!1,Nn(Ju,this).getSetting("onAfterMomentumScroll"))},200)})},n=()=>{Nn(Fd,this).addEventListener(Nn(Ca,this).holder,"mouseup",r=>this.onMouseUp(r)),Nn(Fd,this).addEventListener(Nn(Ca,this).holder,"mousedown",r=>this.onMouseDown(r))};Vh()?e():(nG()&&e(),n())}selectedCellWasTouched(e){const r=this.parentCell(e).coords;if(Nn(wR,this)&&r){const[i,s]=[r.row,Nn(wR,this).from.row],[a,u]=[r.col,Nn(wR,this).from.col];return i===s&&a===u}return!1}parentCell(e){const n={},r=Nn(Ca,this).TABLE,i=AT(e,["TD","TH"],r);return i?(n.coords=Nn(Ca,this).getCoords(i),n.TD=i):Dn(e,"wtBorder")&&Dn(e,"current")?(n.coords=Nn(Qx,this).getFocusSelection().cellRange.highlight,n.TD=Nn(Ca,this).getCell(n.coords)):Dn(e,"wtBorder")&&Dn(e,"area")&&Nn(Qx,this).getAreaSelection().cellRange&&(n.coords=Nn(Qx,this).getAreaSelection().cellRange.to,n.TD=Nn(Ca,this).getCell(n.coords)),n}onMouseDown(e){const n=Nn(NL,this).rootDocument.activeElement,r=wG(Ope,e.target),i=e.target;if(!["TD","TH"].includes(n.nodeName)&&(i===n||r(0)===n||r(1)===n))return;const s=this.parentCell(i);Dn(i,"corner")?Nn(Ju,this).getSetting("onCellCornerMouseDown",e,i):s.TD&&Nn(Ju,this).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,s.coords,s.TD),(e.button===0||this.touchApplied)&&s.TD&&(Nn(Uh,this)[0]=s.TD,clearTimeout(Nn($0,this)[0]),Nn($0,this)[0]=setTimeout(()=>{Nn(Uh,this)[0]=null},1e3))}onContextMenu(e){if(Nn(Ju,this).has("onCellContextMenu")){const n=this.parentCell(e.target);n.TD&&this.callListener("onCellContextMenu",e,n.coords,n.TD)}}onMouseOver(e){if(!Nn(Ju,this).has("onCellMouseOver"))return;const n=Nn(Ca,this).TABLE,r=AT(e.target,["TD","TH"],n),i=Nn(VT,this)||this;r&&r!==i.lastMouseOver&&T0(r,n)&&(i.lastMouseOver=r,this.callListener("onCellMouseOver",e,Nn(Ca,this).getCoords(r),r))}onMouseOut(e){if(!Nn(Ju,this).has("onCellMouseOut"))return;const n=Nn(Ca,this).TABLE,r=AT(e.target,["TD","TH"],n),i=AT(e.relatedTarget,["TD","TH"],n),s=Nn(VT,this)||this;r&&r!==i&&T0(r,n)&&(this.callListener("onCellMouseOut",e,Nn(Ca,this).getCoords(r),r),i===null&&(s.lastMouseOver=null))}onMouseUp(e){const n=this.parentCell(e.target);n.TD&&Nn(Ju,this).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,n.coords,n.TD),!(e.button!==0&&!this.touchApplied)&&(n.TD===Nn(Uh,this)[0]&&n.TD===Nn(Uh,this)[1]?(Dn(e.target,"corner")?this.callListener("onCellCornerDblClick",e,n.coords,n.TD):this.callListener("onCellDblClick",e,n.coords,n.TD),Nn(Uh,this)[0]=null,Nn(Uh,this)[1]=null):n.TD===Nn(Uh,this)[0]&&(Nn(Uh,this)[1]=n.TD,clearTimeout(Nn($0,this)[1]),Nn($0,this)[1]=setTimeout(()=>{Nn(Uh,this)[1]=null},500)))}onTouchStart(e){Sg(wR,this,Nn(Qx,this).getFocusSelection().cellRange),this.touchApplied=!0,this.onMouseDown(e)}onTouchEnd(e){var n;const r=e.target,i=(n=this.parentCell(r))===null||n===void 0?void 0:n.coords,s=Lt(i)&&i.row>=0&&i.col>=0;if(e.cancelable&&s&&Nn(Ju,this).getSetting("isDataViewInstance")){const u=["A","BUTTON","INPUT"];iG()&&(Tpe()||jpe())&&this.selectedCellWasTouched(r)&&!u.includes(r.tagName)?e.preventDefault():this.selectedCellWasTouched(r)||e.preventDefault()}this.onMouseUp(e),this.touchApplied=!1}callListener(e,n,r,i){const s=Nn(Ju,this).getSettingPure(e);s&&s(n,r,i,Nn(kL,this).call(this))}destroy(){clearTimeout(Nn($0,this)[0]),clearTimeout(Nn($0,this)[1]),Nn(Fd,this).destroy()}};function TL(t,e,n){return(e=Sve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Sve(t){var e=Rve(t,"string");return typeof e=="symbol"?e:e+""}function Rve(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class _ve{constructor(e,n,r){TL(this,"offset",void 0),TL(this,"total",void 0),TL(this,"countTH",void 0),this.offset=e,this.total=n,this.countTH=r}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleRowHeadedColumnToSourceColumn(e){return this.renderedToSource(this.offsettedTH(e))}sourceColumnToVisibleRowHeadedColumn(e){return this.unOffsettedTH(this.sourceToRendered(e))}}function jL(t,e,n){return(e=Eve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Eve(t){var e=Nve(t,"string");return typeof e=="symbol"?e:e+""}function Nve(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class kve{constructor(e,n,r){jL(this,"offset",void 0),jL(this,"total",void 0),jL(this,"countTH",void 0),this.offset=e,this.total=n,this.countTH=r}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleColHeadedRowToSourceRow(e){return this.renderedToSource(this.offsettedTH(e))}sourceRowToVisibleColHeadedRow(e){return this.unOffsettedTH(this.sourceToRendered(e))}}function BT(t,e,n){return(e=Tve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tve(t){var e=jve(t,"string");return typeof e=="symbol"?e:e+""}function jve(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Mve{constructor(){BT(this,"currentSize",0),BT(this,"nextSize",0),BT(this,"currentOffset",0),BT(this,"nextOffset",0)}setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}}const Pve=0,WT=1,CR=2;function ML(t,e,n){return(e=Ave(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ave(t){var e=Ove(t,"string");return typeof e=="symbol"?e:e+""}function Ove(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Ive{constructor(){ML(this,"size",new Mve),ML(this,"workingSpace",Pve),ML(this,"sharedSize",null)}setSize(e){this.size.setSize(e)}setOffset(e){this.size.setOffset(e)}getViewSize(){return this.size}isShared(){return this.sharedSize!==null}isPlaceOn(e){return this.workingSpace===e}append(e){this.workingSpace=WT,e.workingSpace=CR,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=CR,e.workingSpace=WT,this.sharedSize=e.getViewSize()}}function Dve(t,e,n){return(e=Hve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hve(t){var e=Lve(t,"string");return typeof e=="symbol"?e:e+""}function Lve(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class rK{constructor(e,n){Dve(this,"order",[]),this.order=[...Array(n).keys()].map(r=>e+r)}get length(){return this.order.length}has(e){return this.order.indexOf(e)>-1}get(e){return e<this.order.length?this.order[e]:-1}remove(e){this.order.splice(this.order.indexOf(e),1)}prepend(e){return this.order.unshift(e),this.order.pop()}}function $ve(t,e,n){return(e=Fve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fve(t){var e=zve(t,"string");return typeof e=="symbol"?e:e+""}function zve(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Vve{constructor(e){$ve(this,"sizeSet",void 0),this.sizeSet=e}diff(){const{sizeSet:e}=this,{currentSize:n,nextSize:r}=e.getViewSize();let i=Math.max(r,n);if(i===0)return[];const{currentOffset:s,nextOffset:a}=e.getViewSize(),u=new rK(s,n),h=new rK(a,r),m=[];for(let g=0;g<i;g++){const y=u.get(g),x=h.get(g);if(x===-1)m.push(["remove",y]);else if(y===-1)!e.isShared()||e.isShared()&&e.isPlaceOn(CR)?m.push(["append",x]):m.push(["prepend",x]);else if(x>y)u.has(x)&&(u.remove(x),r<=u.length&&(i-=1)),m.push(["replace",x,y]);else if(x<y){const C=u.prepend(x);m.push(["insert_before",x,y,C])}else m.push(["none",x])}return m}}function Bve(t,e,n){return(e=Wve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wve(t){var e=Uve(t,"string");return typeof e=="symbol"?e:e+""}function Uve(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Yve{constructor(e){Bve(this,"leads",[]),this.orderView=e}applyCommand(e){const{rootNode:n}=this.orderView,[r,i,s,a]=e,u=this.orderView.nodesPool(i);switch(this.orderView.collectedNodes.push(u),r){case"prepend":n.insertBefore(u,n.firstChild);break;case"append":n.appendChild(u);break;case"insert_before":n.insertBefore(u,this.orderView.nodesPool(s)),n.removeChild(this.orderView.nodesPool(a));break;case"replace":n.replaceChild(u,this.orderView.nodesPool(s));break;case"remove":n.removeChild(u);break}}start(){this.orderView.collectedNodes.length=0,this.leads=this.orderView.viewDiffer.diff()}render(){this.leads.length>0&&this.applyCommand(this.leads.shift())}end(){for(;this.leads.length>0;)this.applyCommand(this.leads.shift())}}function Gve(t,e,n){return(e=Kve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Kve(t){var e=qve(t,"string");return typeof e=="symbol"?e:e+""}function qve(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Xve{constructor(e){Gve(this,"visualIndex",0),this.orderView=e}getRenderedChildCount(){const{rootNode:e,sizeSet:n}=this.orderView;let r=0;if(this.orderView.isSharedViewSet()){let i=e.firstElementChild;for(;i;){if(i.tagName===this.orderView.childNodeType)r+=1;else if(n.isPlaceOn(WT))break;i=i.nextElementSibling}}else r=e.childElementCount;return r}start(){this.orderView.collectedNodes.length=0,this.visualIndex=0;const{rootNode:e,sizeSet:n}=this.orderView,r=this.orderView.isSharedViewSet(),{nextSize:i}=n.getViewSize();let s=this.getRenderedChildCount();for(;s<i;){const u=this.orderView.nodesPool();!r||r&&n.isPlaceOn(CR)?e.appendChild(u):e.insertBefore(u,e.firstChild),s+=1}const a=r&&n.isPlaceOn(WT);for(;s>i;)e.removeChild(a?e.firstChild:e.lastChild),s-=1}render(){const{rootNode:e,sizeSet:n}=this.orderView;let r=this.visualIndex;this.orderView.isSharedViewSet()&&n.isPlaceOn(CR)&&(r+=n.sharedSize.nextSize);let i=e.childNodes[r];if(i.tagName!==this.orderView.childNodeType){const s=this.orderView.nodesPool();e.replaceChild(s,i),i=s}this.orderView.collectedNodes.push(i),this.visualIndex+=1}end(){}}function Qve(t){return dR()?new Xve(t):new Yve(t)}function F0(t,e,n){return(e=Zve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zve(t){var e=Jve(t,"string");return typeof e=="symbol"?e:e+""}function Jve(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class iK{constructor(e,n,r){F0(this,"rootNode",void 0),F0(this,"nodesPool",void 0),F0(this,"sizeSet",new Ive),F0(this,"collectedNodes",[]),F0(this,"viewDiffer",new Vve(this.sizeSet)),F0(this,"childNodeType",void 0),F0(this,"rendererAdapter",void 0),this.rootNode=e,this.nodesPool=n,this.childNodeType=r,this.rendererAdapter=Qve(this)}setSize(e){return this.sizeSet.setSize(e),this}setOffset(e){return this.sizeSet.setOffset(e),this}isSharedViewSet(){return this.sizeSet.isShared()}getNode(e){return e<this.collectedNodes.length?this.collectedNodes[e]:null}getCurrentNode(){const e=this.collectedNodes.length;return e>0?this.collectedNodes[e-1]:null}start(){this.rendererAdapter.start()}render(){this.rendererAdapter.render()}end(){this.rendererAdapter.end()}}class sK extends iK{prependView(e){return this.sizeSet.prepend(e.sizeSet),e.sizeSet.append(this.sizeSet),this}appendView(e){return this.sizeSet.append(e.sizeSet),e.sizeSet.prepend(this.sizeSet),this}}function oK(t,e,n){return(e=e0e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e0e(t){var e=t0e(t,"string");return typeof e=="symbol"?e:e+""}function t0e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class n0e{constructor(e){oK(this,"nodeType",void 0),oK(this,"pool",new Map),this.nodeType=e.toUpperCase()}setRootDocument(e){this.rootDocument=e}obtain(e,n){if(dR())return this.rootDocument.createElement(this.nodeType);const i=typeof n=="number"?`${e}x${n}`:e.toString();if(this.pool.has(i))return this.pool.get(i);const s=this.rootDocument.createElement(this.nodeType);return this.pool.set(i,s),s}}function SR(t,e,n){return(e=r0e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r0e(t){var e=i0e(t,"string");return typeof e=="symbol"?e:e+""}function i0e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class RR{constructor(e,n){SR(this,"nodesPool",null),SR(this,"nodeType",void 0),SR(this,"rootNode",void 0),SR(this,"table",null),SR(this,"renderedNodes",0),this.nodesPool=typeof e=="string"?new n0e(e):null,this.nodeType=e,this.rootNode=n}setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}adjust(){}render(){}}function aK(t,e,n){return(e=s0e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s0e(t){var e=o0e(t,"string");return typeof e=="symbol"?e:e+""}function o0e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class a0e extends RR{constructor(){super("TH"),aK(this,"orderViews",new WeakMap),aK(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new sK(e,r=>this.nodesPool.obtain(this.sourceRowIndex,r),this.nodeType),this.orderViews.set(e,n)),n}render(){const{rowsToRender:e,rowHeaderFunctions:n,rowHeadersCount:r,rows:i,cells:s}=this.table;for(let a=0;a<e;a++){const u=this.table.renderedRowToSource(a),h=i.getRenderedNode(a);this.sourceRowIndex=u;const m=this.obtainOrderView(h),g=s.obtainOrderView(h);m.appendView(g).setSize(r).setOffset(0).start();for(let y=r-1;y>=0;y--){m.render();const x=m.getCurrentNode();x.className="",x.removeAttribute("style"),wm(x,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&gn(x,[Zme(),upe(),QH(y+1),Ld(-1)]),n[y](u,x,y)}m.end()}}}class l0e extends RR{constructor(e){super(null,e)}adjust(){const{columnHeadersCount:e,rowHeadersCount:n}=this.table;let r=this.rootNode.firstChild;if(e){const{columnsToRender:i}=this.table,s=i+n;for(let u=0,h=e;u<h;u++){for(r=this.rootNode.childNodes[u],r||(r=this.table.rootDocument.createElement("tr"),this.rootNode.appendChild(r)),this.renderedNodes=r.childNodes.length;this.renderedNodes<s;)r.appendChild(this.table.rootDocument.createElement("th")),this.renderedNodes+=1;for(;this.renderedNodes>s;)r.removeChild(r.lastChild),this.renderedNodes-=1}const a=this.rootNode.childNodes.length;if(a>e)for(let u=e;u<a;u++)this.rootNode.removeChild(this.rootNode.lastChild)}else r&&Bh(r)}render(){const{columnHeadersCount:e}=this.table;this.table.isAriaEnabled()&&gn(this.rootNode,[GY()]);for(let n=0;n<e;n+=1){const{columnHeaderFunctions:r,columnsToRender:i,rowHeadersCount:s}=this.table,a=this.rootNode.childNodes[n];this.table.isAriaEnabled()&&gn(a,[KY(),ZY(n+1)]);for(let u=-1*s;u<i;u+=1){const h=this.table.renderedColumnToSource(u),m=a.childNodes[u+s];m.className="",m.removeAttribute("style"),wm(m,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&gn(m,[QH(u+1+this.table.rowHeadersCount),Ld(-1),Jme(),...u>=0?[cpe()]:[Qme(),wc("Select whole grid")]]),r[n](h,m,n)}}}}let lK=!1;class c0e extends RR{constructor(e){super(null,e)}adjust(){const{columnsToRender:e,rowHeadersCount:n}=this.table,r=e+n;for(;this.renderedNodes<r;)this.rootNode.appendChild(this.table.rootDocument.createElement("col")),this.renderedNodes+=1;for(;this.renderedNodes>r;)this.rootNode.removeChild(this.rootNode.lastChild),this.renderedNodes-=1}render(){this.adjust();const{columnsToRender:e,rowHeadersCount:n}=this.table;!lK&&e>1e3&&(lK=!0,Yn(Jr`Performance tip: Handsontable rendered more than 1000 visible columns.\x20 Consider limiting the number of rendered columns by specifying the table width and/or\x20 turning off the "renderAllColumns" option.`));for(let i=0;i<n;i++){const s=this.table.renderedColumnToSource(i),a=this.table.columnUtils.getHeaderWidth(s);this.rootNode.childNodes[i].style.width=`${a}px`}for(let i=0;i<e;i++){const s=this.table.renderedColumnToSource(i),a=this.table.columnUtils.getWidth(s);this.rootNode.childNodes[i+n].style.width=`${a}px`}const r=this.rootNode.firstChild;r&&st(r,"rowHeader")}}function u0e(t,e,n){return(e=d0e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d0e(t){var e=h0e(t,"string");return typeof e=="symbol"?e:e+""}function h0e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Zx={rowEven:"ht__row_even",rowOdd:"ht__row_odd"};let cK=!1;class f0e extends RR{constructor(e){super("TR",e),u0e(this,"orderView",void 0),this.orderView=new iK(e,n=>this.nodesPool.obtain(n),this.nodeType)}getRenderedNode(e){return this.orderView.getNode(e)}render(){const{rowsToRender:e}=this.table;!cK&&e>1e3&&(cK=!0,Yn(Jr`Performance tip: Handsontable rendered more than 1000 visible rows.\x20 Consider limiting the number of rendered rows by specifying the table height and/or\x20 turning off the "renderAllRows" option.`)),this.table.isAriaEnabled()&&gn(this.rootNode,[GY()]),this.orderView.setSize(e).setOffset(this.table.renderedRowToSource(0)).start();for(let i=0;i<e;i++){this.orderView.render();const s=this.orderView.getCurrentNode(),a=this.table.renderedRowToSource(i);if(this.table.isAriaEnabled()){var n,r;gn(s,[KY(),ZY(a+((n=(r=this.table.rowUtils)===null||r===void 0||(r=r.dataAccessObject)===null||r===void 0?void 0:r.columnHeaders.length)!==null&&n!==void 0?n:0)+1)])}(a+1)%2===0?Dn(s,Zx.rowEven)||(cn(s,Zx.rowOdd),st(s,Zx.rowEven)):Dn(s,Zx.rowOdd)||(cn(s,Zx.rowEven),st(s,Zx.rowOdd))}this.orderView.end()}}function uK(t,e,n){return(e=m0e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m0e(t){var e=p0e(t,"string");return typeof e=="symbol"?e:e+""}function p0e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class g0e extends RR{constructor(){super("TD"),uK(this,"orderViews",new WeakMap),uK(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new sK(e,r=>this.nodesPool.obtain(this.sourceRowIndex,r),this.nodeType),this.orderViews.set(e,n)),n}render(){const{rowsToRender:e,columnsToRender:n,rows:r,rowHeaders:i}=this.table;for(let u=0;u<e;u++){const h=this.table.renderedRowToSource(u),m=r.getRenderedNode(u);this.sourceRowIndex=h;const g=this.obtainOrderView(m),y=i.obtainOrderView(m);g.prependView(y).setSize(n).setOffset(0).start();for(let x=0;x<n;x++){g.render();const C=this.table.renderedColumnToSource(x),E=g.getCurrentNode();if(Dn(E,"hide")||(E.className=""),E.removeAttribute("style"),E.removeAttribute("dir"),wm(E,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.cellRenderer(h,C,E),this.table.isAriaEnabled()){var s,a;gn(E,[...E.hasAttribute("role")?[]:[Xme()],Ld(-1),QH(C+((s=(a=this.table.rowUtils)===null||a===void 0||(a=a.dataAccessObject)===null||a===void 0?void 0:a.rowHeaders.length)!==null&&s!==void 0?s:0)+1)])}}g.end()}}}function Ao(t,e,n){return(e=v0e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v0e(t){var e=b0e(t,"string");return typeof e=="symbol"?e:e+""}function b0e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class y0e{constructor(e){let{cellRenderer:n,stylesHandler:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ao(this,"rootNode",void 0),Ao(this,"rootDocument",void 0),Ao(this,"rowHeaders",null),Ao(this,"columnHeaders",null),Ao(this,"colGroup",null),Ao(this,"rows",null),Ao(this,"cells",null),Ao(this,"rowFilter",null),Ao(this,"columnFilter",null),Ao(this,"rowUtils",null),Ao(this,"columnUtils",null),Ao(this,"rowsToRender",0),Ao(this,"columnsToRender",0),Ao(this,"rowHeaderFunctions",[]),Ao(this,"rowHeadersCount",0),Ao(this,"columnHeaderFunctions",[]),Ao(this,"columnHeadersCount",0),Ao(this,"cellRenderer",void 0),Ao(this,"activeOverlayName",void 0),Ao(this,"stylesHandler",void 0),this.rootNode=e,this.rootDocument=this.rootNode.ownerDocument,this.cellRenderer=n,this.stylesHandler=r}setActiveOverlayName(e){this.activeOverlayName=e}setAxisUtils(e,n){this.rowUtils=e,this.columnUtils=n}setViewportSize(e,n){this.rowsToRender=e,this.columnsToRender=n}setFilters(e,n){this.rowFilter=e,this.columnFilter=n}setHeaderContentRenderers(e,n){this.rowHeaderFunctions=e,this.rowHeadersCount=e.length,this.columnHeaderFunctions=n,this.columnHeadersCount=n.length}setRenderers(){let{rowHeaders:e,columnHeaders:n,colGroup:r,rows:i,cells:s}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.setTable(this),n.setTable(this),r.setTable(this),i.setTable(this),s.setTable(this),this.rowHeaders=e,this.columnHeaders=n,this.colGroup=r,this.rows=i,this.cells=s}renderedRowToSource(e){return this.rowFilter.renderedToSource(e)}renderedColumnToSource(e){return this.columnFilter.renderedToSource(e)}isAriaEnabled(){return this.rowUtils.wtSettings.getSetting("ariaTags")}render(){this.colGroup.adjust(),this.columnHeaders.adjust(),this.rows.adjust(),this.rowHeaders.adjust(),this.columnHeaders.render(),this.rows.render(),this.rowHeaders.render(),this.cells.render(),this.columnUtils.calculateWidths(),this.colGroup.render();const{rowsToRender:e,rows:n}=this;for(let r=0;r<e;r++){const i=n.getRenderedNode(r),s=this.rowUtils;if(i.firstChild){const a=this.renderedRowToSource(r),u=s.getHeightByOverlayName(a,this.activeOverlayName),m=this.stylesHandler.areCellsBorderBox()?0:1;u?i.firstChild.style.height=`${u-m}px`:i.firstChild.style.height=""}}}}class x0e{constructor(){let{TABLE:e,THEAD:n,COLGROUP:r,TBODY:i,rowUtils:s,columnUtils:a,cellRenderer:u,stylesHandler:h}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.renderer=new y0e(e,{cellRenderer:u,stylesHandler:h}),this.renderer.setRenderers({rowHeaders:new a0e,columnHeaders:new l0e(n),colGroup:new c0e(r),rows:new f0e(i),cells:new g0e}),this.renderer.setAxisUtils(s,a)}setActiveOverlayName(e){return this.renderer.setActiveOverlayName(e),this}setFilters(e,n){return this.renderer.setFilters(e,n),this}setViewportSize(e,n){return this.renderer.setViewportSize(e,n),this}setHeaderContentRenderers(e,n){return this.renderer.setHeaderContentRenderers(e,n),this}adjust(){this.renderer.adjust()}render(){this.renderer.render()}}function PL(t,e,n){return(e=w0e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function w0e(t){var e=C0e(t,"string");return typeof e=="symbol"?e:e+""}function C0e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class S0e{constructor(e,n){PL(this,"dataAccessObject",void 0),PL(this,"wtSettings",void 0),PL(this,"headerWidths",new Map),this.dataAccessObject=e,this.wtSettings=n}getWidth(e){return this.wtSettings.getSetting("columnWidth",e)||this.wtSettings.getSetting("defaultColumnWidth")}getHeaderHeight(e){let n=this.wtSettings.getSetting("stylesHandler").getDefaultRowHeight();const r=this.dataAccessObject.wtViewport.oversizedColumnHeaders[e];return r!==void 0&&(n=n?Math.max(n,r):r),n}getHeaderWidth(e){return this.headerWidths.get(this.dataAccessObject.wtTable.columnFilter.sourceToRendered(e))}calculateWidths(){const{wtSettings:e}=this;let n=e.getSetting("rowHeaderWidth");if(n=e.getSetting("onModifyRowHeaderWidth",n),n!=null){const r=e.getSetting("rowHeaders").length,i=e.getSetting("defaultColumnWidth");for(let s=0;s<r;s++){let a=Array.isArray(n)?n[s]:n;a=a??i,this.headerWidths.set(s,a)}}}}function dK(t,e,n){return(e=R0e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R0e(t){var e=_0e(t,"string");return typeof e=="symbol"?e:e+""}function _0e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class E0e{constructor(e,n){dK(this,"dataAccessObject",void 0),dK(this,"wtSettings",void 0),this.dataAccessObject=e,this.wtSettings=n}getHeight(e){let n=this.wtSettings.getSetting("rowHeight",e);const r=this.dataAccessObject.wtViewport.oversizedRows[e];return r!==void 0&&(n=n===void 0?r:Math.max(n,r)),n}getHeightByOverlayName(e,n){let r=this.wtSettings.getSetting("rowHeightByOverlayName",e,n);const i=this.dataAccessObject.wtViewport.oversizedRows[e];return i!==void 0&&(r=r===void 0?i:Math.max(r,i)),r}}function Yh(t,e,n){return(e=N0e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function N0e(t){var e=k0e(t,"string");return typeof e=="symbol"?e:e+""}function k0e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Jx{constructor(e,n,r,i,s){Yh(this,"wtSettings",null),Yh(this,"domBindings",void 0),Yh(this,"TBODY",null),Yh(this,"THEAD",null),Yh(this,"COLGROUP",null),Yh(this,"hasTableHeight",!0),Yh(this,"hasTableWidth",!0),Yh(this,"isTableVisible",!1),Yh(this,"tableOffset",0),Yh(this,"holderOffset",0),this.domBindings=r,this.isMaster=s==="master",this.name=s,this.dataAccessObject=e,this.facadeGetter=n,this.wtSettings=i,this.instance=this.dataAccessObject.wot,this.wot=this.dataAccessObject.wot,this.TABLE=r.rootTable,lG(this.TABLE),this.spreader=this.createSpreader(this.TABLE),this.hider=this.createHider(this.spreader),this.holder=this.createHolder(this.hider),this.wtRootElement=this.holder.parentNode,this.isMaster&&this.alignOverlaysWithTrimmingContainer(),this.fixTableDomTree(),this.rowFilter=null,this.columnFilter=null,this.correctHeaderWidth=!1;const a=this.wtSettings.getSettingPure("rowHeaderWidth");this.wtSettings.update("rowHeaderWidth",()=>this._modifyRowHeaderWidth(a)),this.rowUtils=new E0e(this.dataAccessObject,this.wtSettings),this.columnUtils=new S0e(this.dataAccessObject,this.wtSettings),this.tableRenderer=new x0e({TABLE:this.TABLE,THEAD:this.THEAD,COLGROUP:this.COLGROUP,TBODY:this.TBODY,rowUtils:this.rowUtils,columnUtils:this.columnUtils,cellRenderer:this.wtSettings.getSettingPure("cellRenderer"),stylesHandler:this.wtSettings.getSetting("stylesHandler")})}is(e){return this.name===e}fixTableDomTree(){const e=this.domBindings.rootDocument;this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=e.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=e.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=e.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD))}createSpreader(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!Dn(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.className="wtSpreader",n&&n.insertBefore(r,e),r.appendChild(e)),r.style.position="relative",this.wtSettings.getSetting("ariaTags")&&gn(r,[bm()]),r}createHider(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!Dn(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.className="wtHider",n&&n.insertBefore(r,e),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&gn(r,[bm()]),r}createHolder(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!Dn(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.style.position="relative",r.className="wtHolder",this.isMaster&&gn(r,[Ld(-1)]),n&&n.insertBefore(r,e),this.isMaster&&(r.parentNode.className+="ht_master handsontable",r.parentNode.setAttribute("dir",this.wtSettings.getSettingPure("rtlMode")?"rtl":"ltr"),this.wtSettings.getSetting("ariaTags")&&gn(r.parentNode,[bm()])),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&gn(r,[bm()]),r}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:n}=this,{wtOverlays:r,wtViewport:i}=this.dataAccessObject,s=n.getSetting("totalRows"),a=n.getSetting("totalColumns"),u=n.getSetting("rowHeaders"),h=u.length,m=n.getSetting("columnHeaders"),g=m.length;let y=e;if(this.isMaster&&(r.beforeDraw(),this.holderOffset=sl(this.holder),y=i.createCalculators(y),h&&!n.getSetting("fixedColumnsStart"))){const C=r.inlineStartOverlay.getScrollPosition(),E=this.correctHeaderWidth;this.correctHeaderWidth=C!==0,E!==this.correctHeaderWidth&&(y=!1)}if(y)this.isMaster&&r.refresh(!0);else{this.isMaster?this.tableOffset=sl(this.TABLE):this.tableOffset=this.dataAccessObject.parentTableOffset;const C=Math.max(this.getFirstRenderedRow(),0),E=Math.max(this.getFirstRenderedColumn(),0);this.rowFilter=new kve(C,s,g),this.columnFilter=new _ve(E,a,h);let M=!0;if(this.isMaster){this.alignOverlaysWithTrimmingContainer();const j={};this.wtSettings.getSetting("beforeDraw",!0,j),M=j.skipRender!==!0}M&&(this.tableRenderer.setHeaderContentRenderers(u,m),(this.is(Gh)||this.is(Rg))&&this.tableRenderer.setHeaderContentRenderers(u,[]),this.resetOversizedRows(),this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(),this.getRenderedColumnsCount()).setFilters(this.rowFilter,this.columnFilter).render(),this.isMaster&&this.markOversizedColumnHeaders(),this.adjustColumnHeaderHeights(),(this.isMaster||this.is(Gh))&&this.markOversizedRows(),this.isMaster?(this.wtSettings.getSetting("externalRowCalculator")||i.createVisibleCalculators(),r.refresh(!1),r.applyToDOM(),this.wtSettings.getSetting("onDraw",!0)):this.is(Gh)&&this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize())}let x=!1;return this.isMaster&&(x=r.topOverlay.resetFixedPosition(),r.bottomOverlay.clone&&(x=r.bottomOverlay.resetFixedPosition()||x),x=r.inlineStartOverlay.resetFixedPosition()||x,r.topInlineStartCornerOverlay&&r.topInlineStartCornerOverlay.resetFixedPosition(),r.bottomInlineStartCornerOverlay&&r.bottomInlineStartCornerOverlay.clone&&r.bottomInlineStartCornerOverlay.resetFixedPosition()),x?(r.refreshAll(),r.adjustElementsSize()):this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(y),this.isMaster&&r.afterDraw(),this.dataAccessObject.drawn=!0,this}markIfOversizedColumnHeader(e){const n=this.columnFilter.renderedToSource(e);let r=this.wtSettings.getSetting("columnHeaders").length;const i=this.wtSettings.getSetting("stylesHandler").getDefaultRowHeight();let s,a,u;const h=this.wtSettings.getSetting("columnHeaderHeight")||[];for(;r;)r-=1,s=this.getColumnHeaderHeight(r),a=this.getColumnHeader(n,r),a&&(u=fR(a),(!s&&i<u||s<u)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=u),Array.isArray(h)?h[r]!==null&&h[r]!==void 0&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=h[r]):isNaN(h)||(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=h),this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]<(h[r]||h)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=h[r]||h))}adjustColumnHeaderHeights(){const{wtSettings:e}=this,n=this.THEAD.childNodes,r=this.dataAccessObject.wtViewport.oversizedColumnHeaders,i=e.getSetting("columnHeaders");for(let s=0,a=i.length;s<a;s++)if(r[s]){if(!n[s]||n[s].childNodes.length===0)return;n[s].childNodes[0].style.height=`${r[s]}px`}}resetOversizedRows(){const{wtSettings:e}=this,{wtViewport:n}=this.dataAccessObject;if(!(!this.isMaster&&!this.is(Gh))&&!e.getSetting("externalRowCalculator")){const r=this.getRenderedRowsCount();for(let i=0;i<r;i++){const s=this.rowFilter.renderedToSource(i);n.oversizedRows&&n.oversizedRows[s]&&(n.oversizedRows[s]=void 0)}}}getCell(e){let n=e.row,r=e.col;const i=this.wtSettings.getSetting("onModifyGetCellCoords",n,r,!this.isMaster,"render");if(i&&Array.isArray(i)&&([n,r]=i),this.isRowBeforeRenderedRows(n))return-1;if(this.isRowAfterRenderedRows(n))return-2;if(this.isColumnBeforeRenderedColumns(r))return-3;if(this.isColumnAfterRenderedColumns(r))return-4;const s=this.getRow(n);!s&&n>=0&>("TR was expected to be rendered but is not");const a=s.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(r)];return!a&&r>=0&>("TD or TH was expected to be rendered but is not"),a}getRow(e){let n=null,r=null;if(e<0){var i;n=(i=this.rowFilter)===null||i===void 0?void 0:i.sourceRowToVisibleColHeadedRow(e),r=this.THEAD}else{var s;n=(s=this.rowFilter)===null||s===void 0?void 0:s.sourceToRendered(e),r=this.TBODY}return n!==void 0&&r!==void 0?r.childNodes.length<n+1?!1:r.childNodes[n]:!1}getColumnHeader(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.THEAD.childNodes[n];return r==null?void 0:r.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]}getColumnHeaders(e){const n=[],r=this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e);return this.THEAD.childNodes.forEach(i=>{const s=i.childNodes[r];s&&n.push(s)}),n}getRowHeader(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.wtSettings.getSetting("rowHeaders").length;if(n>=r)return;const i=this.rowFilter.sourceToRendered(e),s=i<0?this.rowFilter.sourceRowToVisibleColHeadedRow(e):i,u=(i<0?this.THEAD:this.TBODY).childNodes[s];return u==null?void 0:u.childNodes[n]}getRowHeaders(e){const n=[],r=this.wtSettings.getSetting("rowHeaders").length;for(let i=0;i<r;i++){const s=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)],a=s==null?void 0:s.childNodes[i];a&&n.push(a)}return n}getCoords(e){let n=e;if(n.nodeName!=="TD"&&n.nodeName!=="TH"&&(n=k0(n,["TD","TH"])),n===null)return null;const r=n.parentNode;if(!r)return null;const i=r.parentNode;let s=Hpe(r),a=n.cellIndex;j0(B0,n,this.wtRootElement)||j0(z0,n,this.wtRootElement)?i.nodeName==="THEAD"&&(s-=i.childNodes.length):j0(Rg,n,this.wtRootElement)||j0(Gh,n,this.wtRootElement)?s=this.wtSettings.getSetting("totalRows")-i.childNodes.length+s:i===this.THEAD?s=this.rowFilter.visibleColHeadedRowToSourceRow(s):this.rowFilter&&(s=this.rowFilter.renderedToSource(s)),j0(B0,n,this.wtRootElement)||j0(V0,n,this.wtRootElement)||j0(Rg,n,this.wtRootElement)?a=this.columnFilter.offsettedTH(a):this.columnFilter&&(a=this.columnFilter.visibleRowHeadedColumnToSourceColumn(a));const u=this.wtSettings.getSetting("onModifyGetCoordsElement",s,a);return u&&Array.isArray(u)&&([s,a]=u),this.wot.createCellCoords(s,a)}markOversizedRows(){if(this.wtSettings.getSetting("externalRowCalculator"))return;let e=this.TBODY.childNodes.length;const n=this.wtSettings.getSetting("stylesHandler"),r=e*n.getDefaultRowHeight(),i=fR(this.TBODY)-1,s=n.areCellsBorderBox(),a=s?Po:fR,u=s?0:1,h=s?1:0;let m,g,y,x,C;if(!(r===i&&!this.wtSettings.getSetting("fixedRowsBottom")))for(;e;){e-=1,y=this.rowFilter.renderedToSource(e),m=this.getRowHeight(y),x=this.getTrForRow(y),C=x.querySelector("th");const E=y===0?h:0;C?g=a(C):g=a(x)-u,(!m&&n.getDefaultRowHeight()<g-E||m<g)&&(s||(g+=1),this.dataAccessObject.wtViewport.oversizedRows[y]=g)}}getTrForRow(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]}isColumnHeaderRendered(e){if(e>=0)return!1;const r=this.wtSettings.getSetting("rowHeaders").length;return Math.abs(e)<=r}isRowHeaderRendered(e){if(e>=0)return!1;const r=this.wtSettings.getSetting("columnHeaders").length;return Math.abs(e)<=r}isRowBeforeRenderedRows(e){const n=this.getFirstRenderedRow();return e<0&&n<=0?!this.isRowHeaderRendered(e):e<n}isRowAfterRenderedRows(e){return e>this.getLastRenderedRow()}isColumnBeforeRenderedColumns(e){const n=this.getFirstRenderedColumn();return e<0&&n<=0?!this.isColumnHeaderRendered(e):e<n}isColumnAfterRenderedColumns(e){return this.columnFilter&&e>this.getLastRenderedColumn()}isColumnAfterViewport(e){return this.columnFilter&&e>this.getLastVisibleColumn()}isRowAfterViewport(e){return this.rowFilter&&e>this.getLastVisibleRow()}isColumnBeforeViewport(e){return this.columnFilter&&this.columnFilter.sourceToRendered(e)<0&&e>=0}isLastRowFullyVisible(){return this.getLastVisibleRow()===this.getLastRenderedRow()}isLastColumnFullyVisible(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()}allRowsInViewport(){return this.wtSettings.getSetting("totalRows")===this.getVisibleRowsCount()}allColumnsInViewport(){return this.wtSettings.getSetting("totalColumns")===this.getVisibleColumnsCount()}getRowHeight(e){return this.rowUtils.getHeight(e)}getColumnHeaderHeight(e){return this.columnUtils.getHeaderHeight(e)}getColumnWidth(e){return this.columnUtils.getWidth(e)}hasDefinedSize(){return this.hasTableHeight&&this.hasTableWidth}getWidth(){return po(this.TABLE)}getHeight(){return Po(this.TABLE)}getTotalWidth(){const e=po(this.hider);return e!==0?e:this.getWidth()}getTotalHeight(){const e=Po(this.hider);return e!==0?e:this.getHeight()}isVisible(){return P0(this.TABLE)}_modifyRowHeaderWidth(e){let n=ri(e)?e():null;return Array.isArray(n)?(n=[...n],n[n.length-1]=this._correctRowHeaderWidth(n[n.length-1])):n=this._correctRowHeaderWidth(n),n}_correctRowHeaderWidth(e){let n=e;return typeof e!="number"&&(n=this.wtSettings.getSetting("defaultColumnWidth")),this.correctHeaderWidth&&(n+=1),n}}const T0e="stickyRowsBottom",AL={getFirstRenderedRow(){const t=this.getRenderedRowsCount();return t===0?-1:this.wtSettings.getSetting("totalRows")-t},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()===0?-1:this.wtSettings.getSetting("totalRows")-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){return Math.min(this.wtSettings.getSetting("totalRows"),this.wtSettings.getSetting("fixedRowsBottom"))},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return 0}};xm(AL,"MIXIN_NAME",T0e,{writable:!1,enumerable:!1});const j0e="stickyColumnsStart",UT={getFirstRenderedColumn(){return this.getRenderedColumnsCount()===0?-1:0},getFirstVisibleColumn(){return this.getFirstRenderedColumn()},getFirstPartiallyVisibleColumn(){return this.getFirstRenderedColumn()},getLastRenderedColumn(){return this.getRenderedColumnsCount()-1},getLastVisibleColumn(){return this.getLastRenderedColumn()},getLastPartiallyVisibleColumn(){return this.getLastRenderedColumn()},getRenderedColumnsCount(){return Math.min(this.wtSettings.getSetting("totalColumns"),this.wtSettings.getSetting("fixedColumnsStart"))},getVisibleColumnsCount(){return this.getRenderedColumnsCount()},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};xm(UT,"MIXIN_NAME",j0e,{writable:!1,enumerable:!1});class OL extends Jx{constructor(e,n,r,i){super(e,n,r,i,Rg)}}ci(OL,AL),ci(OL,UT);const z0="top",Gh="bottom",V0="inline_start",B0="top_inline_start_corner",Rg="bottom_inline_start_corner",hK=[z0,Gh,V0,B0,Rg],M0e=new Map([[z0,`ht_clone_${z0}`],[Gh,`ht_clone_${Gh}`],[V0,`ht_clone_${V0} ht_clone_left`],[B0,`ht_clone_${B0} ht_clone_top_left_corner`],[Rg,`ht_clone_${Rg} ht_clone_bottom_left_corner`]]);function P0e(t,e){A0e(t,e),e.add(t)}function A0e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function O0e(t,e,n){return(e=I0e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function I0e(t){var e=D0e(t,"string");return typeof e=="symbol"?e:e+""}function D0e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function YT(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var _R=new WeakSet;class H0e{constructor(e){P0e(this,_R),O0e(this,"dataAccessObject",void 0),this.dataAccessObject=e}scrollViewport(e,n,r){if(e.col<0||e.row<0)return!1;const i=this.scrollViewportHorizontally(e.col,n),s=this.scrollViewportVertically(e.row,r);return i||s}scrollViewportHorizontally(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto";const{drawn:r,totalColumns:i}=this.dataAccessObject;if(!r)return!1;const s=Cc(n);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollHorizontally",e,s),!Number.isInteger(e)||e<0||e>i)return!1;n=s.value;const{fixedColumnsStart:a,inlineStartOverlay:u}=this.dataAccessObject,h=n==="auto";if(h&&e<a)return!1;const m=this.getFirstVisibleColumn(),g=this.getLastVisibleColumn();let y=!1;return(h&&(e<m||e>g)||!h)&&(y=u.scrollTo(e,h?e>=this.getLastPartiallyVisibleColumn():n==="end")),y}scrollViewportVertically(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto";const{drawn:r,totalRows:i}=this.dataAccessObject;if(!r)return!1;const s=Cc(n);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollVertically",e,s),!Number.isInteger(e)||e<0||e>i)return!1;n=s.value;const{fixedRowsBottom:a,fixedRowsTop:u,topOverlay:h}=this.dataAccessObject,m=n==="auto";if(m&&(e<u||e>i-a-1))return!1;const g=this.getFirstVisibleRow(),y=this.getLastVisibleRow();let x=!1;return(m&&(e<g||e>y)||!m)&&(x=h.scrollTo(e,m?e>=this.getLastPartiallyVisibleRow():n==="bottom")),x}getFirstVisibleRow(){return this.dataAccessObject.wtTable.getFirstVisibleRow()}getLastVisibleRow(){return YT(_R,this,mK).call(this,this.dataAccessObject.wtTable.getLastVisibleRow())}getFirstPartiallyVisibleRow(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow()}getLastPartiallyVisibleRow(){return YT(_R,this,mK).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleRow())}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){return YT(_R,this,fK).call(this,this.dataAccessObject.wtTable.getLastVisibleColumn())}getFirstPartiallyVisibleColumn(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn()}getLastPartiallyVisibleColumn(){return YT(_R,this,fK).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn())}}function fK(t){const{wtSettings:e,inlineStartOverlay:n,wtTable:r,wtViewport:i,totalColumns:s,rootWindow:a}=this.dataAccessObject;if(n.mainTableScrollableElement===a){const u=e.getSetting("rtlMode");let h=null;if(u){const g=r.TABLE.getBoundingClientRect(),x=this.dataAccessObject.rootWindow.document.documentElement.offsetWidth;h=Math.abs(g.right-x)}else h=sl(r.wtRootElement).left;const m=Math.abs(dG(a,a));if(h>m){const g=hG(a);let y=i.getRowHeaderWidth();for(let x=1;x<=s;x++)if(y+=n.sumCellSizes(x-1,x),h+y-m>=g){t=x-2;break}}}return t}function mK(t){const{topOverlay:e,wtTable:n,wtViewport:r,totalRows:i,rootWindow:s}=this.dataAccessObject;if(e.mainTableScrollableElement===s){const a=sl(n.wtRootElement),u=aL(s,s);if(a.top>u){const h=fR(s);let m=r.getColumnHeaderHeight();for(let g=1;g<=i;g++)if(m+=e.sumCellSizes(g-1,g),a.top+m-u>=h){t=g-2;break}}}return t}function ed(t,e,n){return(e=L0e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function L0e(t){var e=$0e(t,"string");return typeof e=="symbol"?e:e+""}function $0e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class IL{get eventManager(){return new Sc(this)}constructor(e,n){ed(this,"wtTable",void 0),ed(this,"wtScroll",void 0),ed(this,"wtViewport",void 0),ed(this,"wtOverlays",void 0),ed(this,"selectionManager",void 0),ed(this,"wtEvent",void 0),ed(this,"guid",`wt_${WY()}`),ed(this,"drawInterrupted",!1),ed(this,"drawn",!1),ed(this,"activeOverlayName","master"),ed(this,"domBindings",void 0),ed(this,"wtSettings",void 0),this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView},this.wtSettings=n,this.wtScroll=new H0e(this.createScrollDao())}findOriginalHeaders(){const e=[];if(this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(let n=0,r=this.wtTable.THEAD.childNodes[0].childNodes.length;n<r;n++)e.push(this.wtTable.THEAD.childNodes[0].childNodes[n].innerHTML);this.wtSettings.getSetting("columnHeaders").length||this.wtSettings.update("columnHeaders",[function(n,r){Cg(r,e[n])}])}}createCellCoords(e,n){return new L0(e,n,this.wtSettings.getSetting("rtlMode"))}createCellRange(e,n,r){return new Xx(e,n,r,this.wtSettings.getSetting("rtlMode"))}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.drawInterrupted=!1,!this.wtTable.isVisible()||$pe(this.wtTable.wtRootElement.parentNode)?this.drawInterrupted=!0:this.wtTable.draw(e),this}getCell(e){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1))return this.wtTable.getCell(e);const r=this.wtSettings.getSetting("totalRows"),i=this.wtSettings.getSetting("fixedRowsTop"),s=this.wtSettings.getSetting("fixedRowsBottom"),a=this.wtSettings.getSetting("fixedColumnsStart");if(e.row<i&&e.col<a)return this.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.getCell(e);if(e.row<i)return this.wtOverlays.topOverlay.clone.wtTable.getCell(e);if(e.col<a&&e.row>=r-s){if(this.wtOverlays.bottomInlineStartCornerOverlay&&this.wtOverlays.bottomInlineStartCornerOverlay.clone)return this.wtOverlays.bottomInlineStartCornerOverlay.clone.wtTable.getCell(e)}else{if(e.col<a)return this.wtOverlays.inlineStartOverlay.clone.wtTable.getCell(e);if(e.row<r&&e.row>=r-s&&this.wtOverlays.bottomOverlay&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)}scrollViewport(e,n,r){return this.wtScroll.scrollViewport(e,n,r)}scrollViewportHorizontally(e,n){return this.wtScroll.scrollViewportHorizontally(e,n)}scrollViewportVertically(e,n){return this.wtScroll.scrollViewportVertically(e,n)}getViewport(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]}destroy(){this.wtOverlays.destroy(),this.wtEvent.destroy()}createScrollDao(){const e=this;return{get drawn(){return e.drawn},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get wtTable(){return e.wtTable},get wtViewport(){return e.wtViewport},get wtSettings(){return e.wtSettings},get rootWindow(){return e.domBindings.rootWindow},get totalRows(){return e.wtSettings.getSetting("totalRows")},get totalColumns(){return e.wtSettings.getSetting("totalColumns")},get fixedRowsTop(){return e.wtSettings.getSetting("fixedRowsTop")},get fixedRowsBottom(){return e.wtSettings.getSetting("fixedRowsBottom")},get fixedColumnsStart(){return e.wtSettings.getSetting("fixedColumnsStart")}}}getTableDao(){const e=this;return{get wot(){return e},get parentTableOffset(){return e.cloneSource.wtTable.tableOffset},get cloneSource(){return e.cloneSource},get workspaceWidth(){return e.wtViewport.getWorkspaceWidth()},get wtViewport(){return e.wtViewport},get wtOverlays(){return e.wtOverlays},get selectionManager(){return e.selectionManager},get drawn(){return e.drawn},set drawn(n){e.drawn=n},get wtTable(){return e.wtTable},get startColumnRendered(){return e.wtViewport.columnsRenderCalculator.startColumn},get startColumnVisible(){return e.wtViewport.columnsVisibleCalculator.startColumn},get startColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.startColumn},get endColumnRendered(){return e.wtViewport.columnsRenderCalculator.endColumn},get endColumnVisible(){return e.wtViewport.columnsVisibleCalculator.endColumn},get endColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.endColumn},get countColumnsRendered(){return e.wtViewport.columnsRenderCalculator.count},get countColumnsVisible(){return e.wtViewport.columnsVisibleCalculator.count},get startRowRendered(){return e.wtViewport.rowsRenderCalculator.startRow},get startRowVisible(){return e.wtViewport.rowsVisibleCalculator.startRow},get startRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.startRow},get endRowRendered(){return e.wtViewport.rowsRenderCalculator.endRow},get endRowVisible(){return e.wtViewport.rowsVisibleCalculator.endRow},get endRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.endRow},get countRowsRendered(){return e.wtViewport.rowsRenderCalculator.count},get countRowsVisible(){return e.wtViewport.rowsVisibleCalculator.count},get columnHeaders(){return e.wtSettings.getSetting("columnHeaders")},get rowHeaders(){return e.wtSettings.getSetting("rowHeaders")}}}}function pK(t,e,n){return(e=F0e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function F0e(t){var e=z0e(t,"string");return typeof e=="symbol"?e:e+""}function z0e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class V0e extends IL{constructor(e,n,r){super(e,n),pK(this,"cloneSource",void 0),pK(this,"cloneOverlay",void 0);const i=this.wtSettings.getSetting("facade",this);this.cloneSource=r.source,this.cloneOverlay=r.overlay,this.wtTable=this.cloneOverlay.createTable(this.getTableDao(),i,this.domBindings,this.wtSettings),this.wtViewport=r.viewport,this.selectionManager=r.selectionManager,this.wtEvent=new nK(i,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,r.event),this.findOriginalHeaders()}}function B0e(t,e,n){return(e=W0e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function W0e(t){var e=U0e(t,"string");return typeof e=="symbol"?e:e+""}function U0e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ER{constructor(e,n,r,i,s){B0e(this,"wtSettings",null),xm(this,"wot",e,{writable:!1}),this.domBindings=s,this.facadeGetter=n,this.wtSettings=i;const{TABLE:a,hider:u,spreader:h,holder:m,wtRootElement:g}=this.wot.wtTable;this.instance=this.wot,this.type=r,this.mainTableScrollableElement=null,this.TABLE=a,this.hider=u,this.spreader=h,this.holder=m,this.wtRootElement=g,this.trimmingContainer=hR(this.hider.parentNode.parentNode),this.needFullRender=this.shouldBeRendered(),this.clone=this.makeClone()}hasRenderingStateChanged(){return this.needFullRender!==this.shouldBeRendered()}updateStateOfRendering(e){e==="before"&&this.shouldBeRendered()?this.needFullRender=!0:e==="after"&&!this.shouldBeRendered()&&(this.needFullRender=!1)}shouldBeRendered(){return!0}updateTrimmingContainer(){this.trimmingContainer=hR(this.hider.parentNode.parentNode)}updateMainScrollableElement(){const{wtTable:e}=this.wot,{rootWindow:n}=this.domBindings,r=n.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow");r==="hidden"||r==="clip"?this.mainTableScrollableElement=this.wot.wtTable.holder:this.mainTableScrollableElement=OT(e.TABLE)}getRelativeCellPosition(e,n,r){if(this.clone.wtTable.holder.contains(e)===!1){Yn(`The provided element is not a child of the ${this.type} overlay`);return}const i=this.mainTableScrollableElement===this.domBindings.rootWindow,s=r<this.wtSettings.getSetting("fixedColumnsStart"),a=n<this.wtSettings.getSetting("fixedRowsTop"),u=n>=this.wtSettings.getSetting("totalRows")-this.wtSettings.getSetting("fixedRowsBottom"),h=this.clone.wtTable.spreader,m={start:this.getRelativeStartPosition(h),top:h.offsetTop},g={start:this.getRelativeStartPosition(e),top:e.offsetTop};let y=null;return i?y=this.getRelativeCellPositionWithinWindow(a,s,g,m):y=this.getRelativeCellPositionWithinHolder(a,u,s,g,m),y}getRelativeStartPosition(e){return this.isRtl()?e.offsetParent.offsetWidth-e.offsetLeft-e.offsetWidth:e.offsetLeft}getRelativeCellPositionWithinWindow(e,n,r,i){const s=this.wot.wtTable.wtRootElement.getBoundingClientRect();let a=0,u=0;if(!n)a=i.start;else{let h=s.left;this.isRtl()&&(h=this.domBindings.rootWindow.innerWidth-(s.left+s.width+go())),a=h<=0?-1*h:0}return e?u=this.clone.wtTable.TABLE.getBoundingClientRect().top-s.top:u=i.top,{start:r.start+a,top:r.top+u}}getRelativeCellPositionWithinHolder(e,n,r,i,s){const a={horizontal:this.wot.wtOverlays.inlineStartOverlay.getScrollPosition(),vertical:this.wot.wtOverlays.topOverlay.getScrollPosition()};let u=0,h=0;if(r||(u=a.horizontal-s.start),n){const m=this.wot.wtTable.wtRootElement.getBoundingClientRect();h=this.clone.wtTable.TABLE.getBoundingClientRect().top*-1+m.top}else e||(h=a.vertical-s.top);return{start:i.start-u,top:i.top-h}}makeClone(){hK.indexOf(this.type)===-1&>(`Clone type "${this.type}" is not supported.`);const{wtTable:e,wtSettings:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=r.createElement("div"),a=r.createElement("table"),u=e.wtRootElement.parentNode;s.className=`${M0e.get(this.type)} handsontable`,s.setAttribute("dir",this.isRtl()?"rtl":"ltr"),s.style.position="absolute",s.style.top=0,s.style.overflow="visible",this.isRtl()?s.style.right=0:s.style.left=0,n.getSetting("ariaTags")&&gn(s,[bm()]),a.className=e.TABLE.className,e.TABLE.getAttribute("role")&&a.setAttribute("role",e.TABLE.getAttribute("role")),s.appendChild(a),u.appendChild(s);const m=this.wtSettings.getSetting("preventOverflow"),g=i.getComputedStyle(u).getPropertyValue("overflow");return m===!0||m==="horizontal"&&this.type===z0||m==="vertical"&&this.type===V0?this.mainTableScrollableElement=i:g==="hidden"||g==="clip"?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=OT(e.TABLE),new V0e(a,this.wtSettings,{source:this.wot,overlay:this,viewport:this.wot.wtViewport,event:this.wot.wtEvent,selectionManager:this.wot.selectionManager})}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.needFullRender){const n=this.clone.cloneSource;n.activeOverlayName=this.clone.wtTable.name,this.clone.draw(e),n.activeOverlayName="master"}}reset(){const e=this.clone.wtTable.holder,n=this.clone.wtTable.hider,r=e.style,i=n.style,s=e.parentNode.style;[r,i,s].forEach(a=>{a.width="",a.height=""})}isRtl(){return this.wtSettings.getSetting("rtlMode")}destroy(){this.clone.eventManager.destroy()}}class Y0e extends ER{constructor(e,n,r,i,s,a){super(e,n,Rg,r,i),this.bottomOverlay=s,this.inlineStartOverlay=a}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new OL(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wot:e}=this;if(this.updateTrimmingContainer(),!e.wtTable.holder.parentNode)return!1;const n=this.clone.wtTable.holder.parentNode;if(n.style.top="",this.trimmingContainer===this.domBindings.rootWindow){const s=this.inlineStartOverlay.getOverlayOffset(),a=this.bottomOverlay.getOverlayOffset();n.style[this.isRtl()?"right":"left"]=`${s}px`,n.style.bottom=`${a}px`}else HT(n),this.repositionOverlay();let r=Po(this.clone.wtTable.TABLE);const i=po(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(r=0),n.style.height=`${r}px`,n.style.width=`${i}px`,!1}repositionOverlay(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let s=0;n.hasVerticalScroll()||(s+=n.getWorkspaceHeight()-e.getTotalHeight()),n.hasVerticalScroll()&&n.hasHorizontalScroll()&&(s+=go(r)),i.style.bottom=`${s}px`}}const G0e="calculatedColumns",GT={getFirstRenderedColumn(){const t=this.dataAccessObject.startColumnRendered;return t===null?-1:t},getFirstVisibleColumn(){const t=this.dataAccessObject.startColumnVisible;return t===null?-1:t},getFirstPartiallyVisibleColumn(){const t=this.dataAccessObject.startColumnPartiallyVisible;return t===null?-1:t},getLastRenderedColumn(){const t=this.dataAccessObject.endColumnRendered;return t===null?-1:t},getLastVisibleColumn(){const t=this.dataAccessObject.endColumnVisible;return t===null?-1:t},getLastPartiallyVisibleColumn(){const t=this.dataAccessObject.endColumnPartiallyVisible;return t===null?-1:t},getRenderedColumnsCount(){return this.dataAccessObject.countColumnsRendered},getVisibleColumnsCount(){return this.dataAccessObject.countColumnsVisible},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};xm(GT,"MIXIN_NAME",G0e,{writable:!1,enumerable:!1});class DL extends Jx{constructor(e,n,r,i){super(e,n,r,i,Gh)}}ci(DL,AL),ci(DL,GT);function K0e(t,e,n){return(e=q0e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function q0e(t){var e=X0e(t,"string");return typeof e=="symbol"?e:e+""}function X0e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Q0e extends ER{constructor(e,n,r,i){super(e,n,Gh,r,i),K0e(this,"cachedFixedRowsBottom",-1),this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom")}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new DL(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const{rootWindow:e}=this.domBindings,n=this.clone.wtTable.holder.parentNode;n.style.top="";let r=0;const i=this.wtSettings.getSetting("preventOverflow");this.trimmingContainer===e&&(!i||i!=="vertical")?(r=this.getOverlayOffset(),n.style.bottom=`${r}px`):(r=this.getScrollPosition(),this.repositionOverlay());const s=this.adjustHeaderBordersPosition(r);return this.adjustElementsSize(),s}repositionOverlay(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let s=0;n.hasVerticalScroll()||(s+=n.getWorkspaceHeight()-e.getTotalHeight()),n.hasVerticalScroll()&&n.hasHorizontalScroll()&&(s+=go(r)),i.style.bottom=`${s}px`}setScrollPosition(e){const{rootWindow:n}=this.domBindings,r=this.mainTableScrollableElement;let i=!1;if(r===n&&e!==n.scrollY){const s=n.scrollY;n.scrollTo(oL(n),top),i=s!==n.scrollY}else if(e!==r.scrollTop){const s=r.scrollTop;r.scrollTop=e,i=s!==r.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const{wtTable:r,wtSettings:i}=this.wot,s=i.getSetting("stylesHandler").getDefaultRowHeight();let a=e,u=0;for(;a<n;){const h=r.getRowHeight(a);u+=h===void 0?s:h,a+=1}return u}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,a=this.clone.wtTable.holder.parentNode.style,u=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||u==="horizontal"){let m=n.getWorkspaceWidth();n.hasVerticalScroll()&&(m-=go(r)),m=Math.min(m,e.wtRootElement.scrollWidth),a.width=`${m}px`}else a.width="";this.clone.wtTable.holder.style.width=a.width;let h=Po(this.clone.wtTable.TABLE);e.hasDefinedSize()||(h=0),a.height=`${h}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=e.parentNode.style.height}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number"?this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`:e===0?this.spreader.style.top="0":gt("Incorrect value of the rowsRenderCalculator"),this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:n}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?n.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:n.style[e]=""}scrollTo(e,n){let r=this.getTableParentOffset();const s=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder;let a=0;n&&s.offsetHeight!==s.clientHeight&&(a=go(this.domBindings.rootDocument)),n?(r+=this.sumCellSizes(0,e+1),r-=this.wot.wtViewport.getViewportHeight(),r+=1):r+=this.sumCellSizes(this.wtSettings.getSetting("fixedRowsBottom"),e),r+=a,this.setScrollPosition(r)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return aL(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let r=0;if(this.trimmingContainer===e&&(!n||n!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),s=this.clone.wtTable.getTotalHeight(),a=i-s,u=this.domBindings.rootDocument.documentElement.clientHeight;r=Math.max(this.getTableParentOffset()-this.getScrollPosition()-u+i,0),r>a&&(r=0)}return r}adjustHeaderBordersPosition(e){const n=this.wtSettings.getSetting("fixedRowsBottom"),r=this.cachedFixedRowsBottom!==n,i=this.wtSettings.getSetting("columnHeaders");let s=!1;if((r||n===0)&&i.length>0){const a=this.wot.wtTable.holder.parentNode,u=Dn(a,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||this.wtSettings.getSetting("totalRows")===0?(st(a,"innerBorderBottom"),s=!u):(cn(a,"innerBorderBottom"),s=u)}return s}}const Z0e="calculatedRows",HL={getFirstRenderedRow(){const t=this.dataAccessObject.startRowRendered;return t===null?-1:t},getFirstVisibleRow(){const t=this.dataAccessObject.startRowVisible;return t===null?-1:t},getFirstPartiallyVisibleRow(){const t=this.dataAccessObject.startRowPartiallyVisible;return t===null?-1:t},getLastRenderedRow(){const t=this.dataAccessObject.endRowRendered;return t===null?-1:t},getLastVisibleRow(){const t=this.dataAccessObject.endRowVisible;return t===null?-1:t},getLastPartiallyVisibleRow(){const t=this.dataAccessObject.endRowPartiallyVisible;return t===null?-1:t},getRenderedRowsCount(){return this.dataAccessObject.countRowsRendered},getVisibleRowsCount(){return this.dataAccessObject.countRowsVisible},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};xm(HL,"MIXIN_NAME",Z0e,{writable:!1,enumerable:!1});class LL extends Jx{constructor(e,n,r,i){super(e,n,r,i,V0)}}ci(LL,HL),ci(LL,UT);const J0e="localHooks",vo={_localHooks:Object.create(null),addLocalHook(t,e){return this._localHooks[t]||(this._localHooks[t]=[]),this._localHooks[t].push(e),this},removeLocalHook(t,e){if(this._localHooks[t]){const n=this._localHooks[t].indexOf(e);n>-1&&this._localHooks[t].splice(n,1)}return this},runLocalHooks(t,e,n,r,i,s,a){if(this._localHooks[t]){const u=this._localHooks[t].length;for(let h=0;h<u;h++)uL(this._localHooks[t][h],this,e,n,r,i,s,a)}},clearLocalHooks(){return this._localHooks={},this}};xm(vo,"MIXIN_NAME",J0e,{writable:!1,enumerable:!1});let gK=class{constructor(e,n){this.settings=e,this.cellRange=n||null}isEmpty(){return this.cellRange===null}add(e){return this.isEmpty()?this.cellRange=this.settings.createCellRange(e):this.cellRange.expand(e),this}replace(e,n){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=n,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=n,!0}return!1}clear(){return this.cellRange=null,this}getCorners(){const e=this.cellRange.getOuterTopStartCorner(),n=this.cellRange.getOuterBottomEndCorner();return[e.row,e.col,n.row,n.col]}destroy(){this.runLocalHooks("destroy")}};ci(gK,vo);const vK="active-header",$L="header",FL="area",KT="focus",ebe="fill",tbe="row",nbe="column",rbe="custom-selection",zL=t=>{const e=t.wtSettings.getSetting("stylesHandler"),n=e.getCSSVariableValue("cell-autofill-size"),r=e.getCSSVariableValue("cell-autofill-border-width"),i=e.getCSSVariableValue("cell-autofill-border-color");return Object.freeze({width:n,height:n,borderWidth:r,borderStyle:"solid",borderColor:i})};function ibe(t,e){yK(t,e),e.add(t)}function bK(t,e,n){yK(t,e),e.set(t,n)}function yK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function As(t,e){return t.get(NR(t,e))}function xK(t,e,n){return t.set(NR(t,e),n),n}function NR(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var zd=new WeakMap,al=new WeakMap,qT=new WeakSet;class sbe{constructor(){ibe(this,qT),bK(this,zd,void 0),bK(this,al,void 0)}setActiveOverlay(e){return xK(al,this,e),this}setActiveSelection(e){return xK(zd,this,e),this}scan(){const e=As(zd,this).settings.selectionType,n=new Set;return e==="active-header"?(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanRowsInHeadersRange(r=>n.add(r))):e==="area"?this.scanCellsRange(r=>n.add(r)):e==="focus"?(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanRowsInHeadersRange(r=>n.add(r)),this.scanCellsRange(r=>n.add(r))):e==="fill"?this.scanCellsRange(r=>n.add(r)):e==="header"?(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanRowsInHeadersRange(r=>n.add(r))):e==="row"?(this.scanRowsInHeadersRange(r=>n.add(r)),this.scanRowsInCellsRange(r=>n.add(r))):e==="column"&&(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanColumnsInCellsRange(r=>n.add(r))),n}scanColumnsInHeadersRange(e){const[n,r,i,s]=As(zd,this).getCorners(),{wtTable:a}=As(al,this),u=a.getRenderedColumnsCount(),h=a.getColumnHeadersCount();let m=0;for(let g=-a.getRowHeadersCount();g<u;g++){const y=a.columnFilter.renderedToSource(g);if(!(y<r||y>s)){for(let x=-h;x<0;x++){if(x<n||x>i)continue;const C=x+h;let E=a.getColumnHeader(y,C);const M=As(al,this).getSetting("onBeforeHighlightingColumnHeader",y,C,{selectionType:As(zd,this).settings.selectionType,columnCursor:m,selectionWidth:s-r+1});M!==null&&(M!==y&&(E=a.getColumnHeader(M,C)),e(E))}m+=1}}}scanRowsInHeadersRange(e){const[n,r,i,s]=As(zd,this).getCorners(),{wtTable:a}=As(al,this),u=a.getRenderedRowsCount(),h=a.getRowHeadersCount();let m=0;for(let g=-a.getColumnHeadersCount();g<u;g++){const y=a.rowFilter.renderedToSource(g);if(!(y<n||y>i)){for(let x=-h;x<0;x++){if(x<r||x>s)continue;const C=x+h;let E=a.getRowHeader(y,C);const M=As(al,this).getSetting("onBeforeHighlightingRowHeader",y,C,{selectionType:As(zd,this).settings.selectionType,rowCursor:m,selectionHeight:i-n+1});M!==null&&(M!==y&&(E=a.getRowHeader(M,C)),e(E))}m+=1}}}scanCellsRange(e){const{wtTable:n}=As(al,this);NR(qT,this,obe).call(this,(r,i)=>{const s=n.getCell(As(al,this).createCellCoords(r,i)),a=As(al,this).getSetting("onAfterDrawSelection",r,i,As(zd,this).settings.layerLevel);typeof a=="string"&&st(s,a),e(s)})}scanRowsInCellsRange(e){const[n,,r]=As(zd,this).getCorners(),{wtTable:i}=As(al,this);NR(qT,this,wK).call(this,(s,a)=>{if(s>=n&&s<=r){const u=i.getCell(As(al,this).createCellCoords(s,a));e(u)}})}scanColumnsInCellsRange(e){const[,n,,r]=As(zd,this).getCorners(),{wtTable:i}=As(al,this);NR(qT,this,wK).call(this,(s,a)=>{if(a>=n&&a<=r){const u=i.getCell(As(al,this).createCellCoords(s,a));e(u)}})}}function obe(t){let[e,n,r,i]=As(zd,this).getCorners();if(e<0&&r<0||n<0&&i<0)return;const{wtTable:s}=As(al,this),a=e!==r||n!==i;if(n=Math.max(n,0),i=Math.max(i,0),e=Math.max(e,0),r=Math.max(r,0),a){if(n=Math.max(n,s.getFirstRenderedColumn()),i=Math.min(i,s.getLastRenderedColumn()),e=Math.max(e,s.getFirstRenderedRow()),r=Math.min(r,s.getLastRenderedRow()),i<n||r<e)return}else{const u=s.getCell(As(al,this).createCellCoords(e,n));if(!Cm(u))return}for(let u=e;u<=r;u+=1)for(let h=n;h<=i;h+=1)t(u,h)}function wK(t){const{wtTable:e}=As(al,this),n=e.getRenderedRowsCount(),r=e.getRenderedColumnsCount();for(let i=0;i<n;i+=1){const s=e.rowFilter.renderedToSource(i);for(let a=0;a<r;a+=1)t(s,e.columnFilter.renderedToSource(a))}}const CK="ht-border-style-",abe="-vertical",lbe="-horizontal";class SK{constructor(e,n){n&&(this.eventManager=e.eventManager,this.instance=e,this.wot=e,this.settings=n,this.mouseDown=!1,this.main=null,this.top=null,this.bottom=null,this.start=null,this.end=null,this.topStyle=null,this.bottomStyle=null,this.startStyle=null,this.endStyle=null,this.cornerDefaultStyle=zL(this.instance),this.cornerCenterPointOffset=-Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),this.corner=null,this.cornerStyle=null,this.createBorders(n),this.registerListeners())}registerListeners(){const e=this.wot.rootDocument.body;this.eventManager.addEventListener(e,"mousedown",()=>this.onMouseDown()),this.eventManager.addEventListener(e,"mouseup",()=>this.onMouseUp());for(let n=0,r=this.main.childNodes.length;n<r;n++){const i=this.main.childNodes[n];this.eventManager.addEventListener(i,"mouseenter",s=>this.onMouseEnter(s,this.main.childNodes[n]))}}onMouseDown(){this.mouseDown=!0}onMouseUp(){this.mouseDown=!1}onMouseEnter(e,n){if(!this.mouseDown||!this.wot.getSetting("hideBorderOnMouseDownOver"))return;e.preventDefault(),iu(e);const r=this,i=this.wot.rootDocument.body,s=n.getBoundingClientRect();n.style.display="none";function a(h){if(h.clientY<Math.floor(s.top)||h.clientY>Math.ceil(s.top+s.height)||h.clientX<Math.floor(s.left)||h.clientX>Math.ceil(s.left+s.width))return!0}function u(h){a(h)&&(r.eventManager.removeEventListener(i,"mousemove",u),n.style.display="block")}this.eventManager.addEventListener(i,"mousemove",u)}createBorders(e){const{rootDocument:n}=this.wot;this.main=n.createElement("div");const r=["top","start","bottom","end","corner"];let i=this.main.style;i.position="absolute",i.top=0,i.left=0;for(let u=0;u<5;u++){const h=r[u],m=n.createElement("div"),g=x=>this.settings[h]&&this.settings[h][x]?this.settings[h][x]:e.border[x];m.className=`wtBorder ${this.settings.className||""}`,this.settings[h]&&this.settings[h].hide&&(m.className+=" hidden"),i=m.style;const y=g("style");y?(["start","end"].includes(h)?m.className+=` ${CK}${y}${abe}`:m.className+=` ${CK}${y}${lbe}`,i.setProperty("--ht-custom-border-size",`${g("width")}px`),i.setProperty("--ht-custom-border-color",g("color"))):i.backgroundColor=g("color"),i.height=`${g("width")}px`,i.width=`${g("width")}px`,this.main.appendChild(m)}this.top=this.main.childNodes[0],this.start=this.main.childNodes[1],this.bottom=this.main.childNodes[2],this.end=this.main.childNodes[3],this.topStyle=this.top.style,this.startStyle=this.start.style,this.bottomStyle=this.bottom.style,this.endStyle=this.end.style,this.corner=this.main.childNodes[4],this.corner.className+=" corner",this.cornerStyle=this.corner.style,this.cornerStyle.width=`${this.cornerDefaultStyle.width}px`,this.cornerStyle.height=`${this.cornerDefaultStyle.height}px`,this.cornerStyle.border=[`${this.cornerDefaultStyle.borderWidth}px`,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),Vh()&&this.instance.getSetting("isDataViewInstance")&&this.createMultipleSelectorHandles(),this.disappear();const{wtTable:s}=this.wot;let a=s.bordersHolder;a||(a=n.createElement("div"),a.className="htBorders",s.bordersHolder=a,s.spreader.appendChild(a)),a.appendChild(this.main)}createMultipleSelectorHandles(){const{rootDocument:e,wtSettings:n}=this.wot,r=n.getSetting("stylesHandler"),i=r.getCSSVariableValue("cell-mobile-handle-size"),s=r.getCSSVariableValue("cell-mobile-handle-border-radius"),a=r.getCSSVariableValue("cell-mobile-handle-background-color"),u=r.getCSSVariableValue("cell-mobile-handle-background-opacity"),h=r.getCSSVariableValue("cell-mobile-handle-border-width"),m=r.getCSSVariableValue("cell-mobile-handle-border-color");this.selectionHandles={top:e.createElement("DIV"),topHitArea:e.createElement("DIV"),bottom:e.createElement("DIV"),bottomHitArea:e.createElement("DIV")};const g=40;this.selectionHandles.top.className="topSelectionHandle topLeftSelectionHandle",this.selectionHandles.topHitArea.className="topSelectionHandle-HitArea topLeftSelectionHandle-HitArea",this.selectionHandles.bottom.className="bottomSelectionHandle bottomRightSelectionHandle",this.selectionHandles.bottomHitArea.className="bottomSelectionHandle-HitArea bottomRightSelectionHandle-HitArea",this.selectionHandles.styles={top:this.selectionHandles.top.style,topHitArea:this.selectionHandles.topHitArea.style,bottom:this.selectionHandles.bottom.style,bottomHitArea:this.selectionHandles.bottomHitArea.style};const y={position:"absolute",height:`${g}px`,width:`${g}px`,"border-radius":`${parseInt(g/1.5,10)}px`};Mr(y,(C,E)=>{this.selectionHandles.styles.bottomHitArea[E]=C,this.selectionHandles.styles.topHitArea[E]=C});const x={position:"absolute",height:`${i}px`,width:`${i}px`,"border-radius":`${s}px`,background:`color-mix(in srgb, ${a} ${u}, transparent)`,border:`${h}px solid ${m}`};Mr(x,(C,E)=>{this.selectionHandles.styles.bottom[E]=C,this.selectionHandles.styles.top[E]=C}),this.main.appendChild(this.selectionHandles.top),this.main.appendChild(this.selectionHandles.bottom),this.main.appendChild(this.selectionHandles.topHitArea),this.main.appendChild(this.selectionHandles.bottomHitArea)}isPartRange(e,n){const r=this.wot.selectionManager.getAreaSelection();return!!(r.cellRange&&(e!==r.cellRange.to.row||n!==r.cellRange.to.col))}updateMultipleSelectionHandlesPosition(e,n,r,i,s,a){const h=this.wot.wtSettings.getSetting("rtlMode")?"right":"left",{top:m,topHitArea:g,bottom:y,bottomHitArea:x}=this.selectionHandles.styles,C=parseInt(m.borderWidth,10),E=parseInt(m.width,10),M=parseInt(g.width,10),j=this.wot.wtTable.getWidth(),L=this.wot.wtTable.getHeight();m.top=`${parseInt(r-E-1,10)}px`,m[h]=`${parseInt(i-E-1,10)}px`,g.top=`${parseInt(r-M/4*3,10)}px`,g[h]=`${parseInt(i-M/4*3,10)}px`;const D=Math.min(parseInt(i+s,10),j-E-C*2),z=Math.min(parseInt(i+s-M/4,10),j-M-C*2);y[h]=`${D}px`,x[h]=`${z}px`;const H=Math.min(parseInt(r+a,10),L-E-C*2),V=Math.min(parseInt(r+a-M/4,10),L-M-C*2);y.top=`${H}px`,x.top=`${V}px`,this.settings.border.cornerVisible&&this.settings.border.cornerVisible()?(m.display="block",g.display="block",this.isPartRange(e,n)?(y.display="none",x.display="none"):(y.display="block",x.display="block")):(m.display="none",y.display="none",g.display="none",x.display="none"),e===this.wot.wtSettings.getSetting("fixedRowsTop")||n===this.wot.wtSettings.getSetting("fixedColumnsStart")?(m.zIndex="9999",g.zIndex="9999"):(m.zIndex="",g.zIndex="")}appear(e){if(this.disabled)return;let[n,r,i,s]=e;if(n<0&&i<0||r<0&&s<0){this.disappear();return}const{wtTable:a,rootDocument:u,rootWindow:h}=this.wot,m=n!==i||r!==s,g=a.getFirstRenderedRow(),y=a.getLastRenderedRow(),x=a.getFirstRenderedColumn(),C=a.getLastRenderedColumn();if(x<0&&C<0||g<0&&y<0){this.disappear();return}let E;if(m){if(r=Math.max(r,x),s=Math.min(s,C),n=Math.max(n,g),i=Math.min(i,y),s<r||i<n){this.disappear();return}E=a.getCell(this.wot.createCellCoords(n,r))}else if(E=a.getCell(this.wot.createCellCoords(n,r)),!Cm(E)){this.disappear();return}const M=m?a.getCell(this.wot.createCellCoords(i,s)):E,j=sl(E),L=m?sl(M):j,D=sl(a.TABLE),z=j.top,H=j.left,V=this.wot.wtSettings.getSetting("rtlMode");let F=0,B=0;if(V){const $e=po(a.TABLE),Re=po(E),Ze=h.innerWidth-D.left-$e;B=H+Re-L.left,F=h.innerWidth-H-Re-Ze-1}else B=L.left+po(M)-H,F=H-D.left-1;if(this.isEntireColumnSelected(n,i)){const $e=n,Re=this.getDimensionsFromHeader("columns",r,s,$e,D);let Ze=null;Re&&([Ze,F,B]=Re),Ze&&(E=Ze)}let te=z-D.top-1,ve=L.top+Po(M)-z;if(this.isEntireRowSelected(r,s)){const $e=r,Re=this.getDimensionsFromHeader("rows",n,i,$e,D);let Ze=null;Re&&([Ze,te,ve]=Re),Ze&&(E=Ze)}const ce=h.getComputedStyle(E);parseInt(ce.borderTopWidth,10)>0&&(te+=1,ve=ve>0?ve-1:0),parseInt(ce[V?"borderRightWidth":"borderLeftWidth"],10)>0&&(F+=1,B=B>0?B-1:0);const _e=V?"right":"left",pe=Math.ceil(this.settings.border.width/2);this.topStyle.top=`${te}px`,this.topStyle[_e]=`${F}px`,this.topStyle.width=`${B+pe}px`,this.topStyle.display="block",this.startStyle.top=`${te}px`,this.startStyle[_e]=`${F}px`,this.startStyle.height=`${ve+pe}px`,this.startStyle.display="block",this.bottomStyle.top=`${te+ve-parseInt(this.bottomStyle.height,10)+pe}px`,this.bottomStyle[_e]=`${F}px`,this.bottomStyle.width=`${B+pe}px`,this.bottomStyle.display="block",this.endStyle.top=`${te}px`,this.endStyle[_e]=`${F+B-parseInt(this.endStyle.width,10)+pe}px`,this.endStyle.height=`${ve+pe}px`,this.endStyle.display="block";let Le=this.settings.border.cornerVisible;Le=typeof Le=="function"?Le(this.settings.layerLevel):Le;const Fe=this.wot.getSetting("onModifyGetCellCoords",i,s,!1,"render");let[nt,dt]=[i,s];if(Fe&&Array.isArray(Fe)&&([,,nt,dt]=Fe),Vh()||!Le||this.isPartRange(nt,dt))this.cornerStyle.display="none";else{this.cornerStyle.top=`${te+ve+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle[_e]=`${F+B+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderRightWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderLeftWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderBottomWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="none";let $e=hR(a.TABLE);const Re=$e===h;Re&&($e=u.documentElement);const Ze=parseInt(this.cornerDefaultStyle.borderWidth,10)-1,Ee=Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),Q=Math.ceil(parseInt(this.cornerDefaultStyle.height,10)/2);if(s===this.wot.getSetting("totalColumns")-1){const fe=Re?M.getBoundingClientRect().left:M.offsetLeft;let Ve=!1,ne=0;if(V?(ne=fe-parseInt(this.cornerDefaultStyle.width,10)/2,Ve=ne<0):(ne=fe+po(M)+parseInt(this.cornerDefaultStyle.width,10)/2,Ve=ne>=hG($e)),Ve){const xe=Math.floor(F+B+this.cornerCenterPointOffset-Ee-Ze);st(this.corner,"wtCornerInlineEndEdge"),this.cornerStyle[_e]=`${xe-1}px`}}else cn(this.corner,"wtCornerInlineEndEdge");if(i===this.wot.getSetting("totalRows")-1){if((Re?M.getBoundingClientRect().top:M.offsetTop)+Po(M)+parseInt(this.cornerDefaultStyle.height,10)/2>=fR($e)){const xe=Math.floor(te+ve+this.cornerCenterPointOffset-Q-Ze);st(this.corner,"wtCornerBlockEndEdge"),this.cornerStyle.top=`${xe-1}px`}}else cn(this.corner,"wtCornerBlockEndEdge");this.cornerStyle.display="block"}Vh()&&this.instance.getSetting("isDataViewInstance")&&this.updateMultipleSelectionHandlesPosition(i,s,te,F,B,ve)}isEntireColumnSelected(e,n){return e===this.wot.wtTable.getFirstRenderedRow()&&n===this.wot.wtTable.getLastRenderedRow()}isEntireRowSelected(e,n){return e===this.wot.wtTable.getFirstRenderedColumn()&&n===this.wot.wtTable.getLastRenderedColumn()}getDimensionsFromHeader(e,n,r,i,s){const{wtTable:a}=this.wot,u=a.wtRootElement.parentNode;let h=null,m=null,g=null,y=null,x=null,C=null,E=null,M=null;switch(e){case"rows":h=function(){return a.getRowHeader(...arguments)},m=function(){return Po(...arguments)},g="ht__selection--rows",C="top";break;case"columns":h=function(){return a.getColumnHeader(...arguments)},m=function(){return po(...arguments)},g="ht__selection--columns",C="left";break}if(u.classList.contains(g)){const j=this.wot.getSetting("columnHeaders").length;if(E=h(n,j-i),M=h(r,j-i),!E||!M)return!1;const L=sl(E),D=sl(M);return E&&M&&(y=L[C]-s[C]-1,x=D[C]+m(M)-L[C]),[E,y,x]}return!1}changeBorderStyle(e,n){const r=this[e].style,i=n[e];!i||i.hide?st(this[e],"hidden"):(Dn(this[e],"hidden")&&cn(this[e],"hidden"),r.backgroundColor=i.color,(e==="top"||e==="bottom")&&(r.height=`${i.width}px`),(e==="start"||e==="end")&&(r.width=`${i.width}px`))}changeBorderToDefaultStyle(e){const n={width:1,color:"#000"},r=this[e].style;r.backgroundColor=n.color,r.width=`${n.width}px`,r.height=`${n.width}px`}toggleHiddenClass(e,n){this.changeBorderToDefaultStyle(e),n?st(this[e],"hidden"):cn(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",Vh()&&this.instance.getSetting("isDataViewInstance")&&(this.selectionHandles.styles.top.display="none",this.selectionHandles.styles.topHitArea.display="none",this.selectionHandles.styles.bottom.display="none",this.selectionHandles.styles.bottomHitArea.display="none")}destroy(){this.eventManager.destroyWithOwnEventsOnly(),this.main.parentNode.removeChild(this.main)}}function cbe(t,e){RK(t,e),e.add(t)}function ew(t,e,n){RK(t,e),e.set(t,n)}function RK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pr(t,e){return t.get(VL(t,e))}function _K(t,e,n){return t.set(VL(t,e),n),n}function VL(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ll=new WeakMap,_c=new WeakMap,BL=new WeakMap,kR=new WeakMap,WL=new WeakMap,W0=new WeakMap,EK=new WeakSet;class ube{constructor(e){cbe(this,EK),ew(this,ll,void 0),ew(this,_c,void 0),ew(this,BL,new sbe),ew(this,kR,new WeakMap),ew(this,WL,new WeakSet),ew(this,W0,new Map),_K(_c,this,e)}setActiveOverlay(e){return _K(ll,this,e),Pr(BL,this).setActiveOverlay(Pr(ll,this)),Pr(kR,this).has(Pr(ll,this))||Pr(kR,this).set(Pr(ll,this),new Set),this}getFocusSelection(){return Pr(_c,this)!==null?Pr(_c,this).getFocus():null}getAreaSelection(){return Pr(_c,this)!==null?Pr(_c,this).createLayeredArea():null}getBorderInstance(e){if(!e.settings.border)return null;if(Pr(W0,this).has(e)){const r=Pr(W0,this).get(e);if(r.has(Pr(ll,this)))return r.get(Pr(ll,this));const i=new SK(Pr(ll,this),e.settings);return r.set(Pr(ll,this),i),i}const n=new SK(Pr(ll,this),e.settings);return Pr(W0,this).set(e,new Map([[Pr(ll,this),n]])),n}getBorderInstances(e){var n,r;return Array.from((n=(r=Pr(W0,this).get(e))===null||r===void 0?void 0:r.values())!==null&&n!==void 0?n:[])}destroyBorders(e){Pr(W0,this).get(e).forEach(n=>n.destroy()),Pr(W0,this).delete(e)}render(e){if(Pr(_c,this)===null)return;e&&VL(EK,this,dbe).call(this);const n=Array.from(Pr(_c,this)),r=new Map,i=new Map;for(let s=0;s<n.length;s++){const a=n[s],{className:u,headerAttributes:h,createLayers:m,selectionType:g}=a.settings;Pr(WL,this).has(a)||(Pr(WL,this).add(a),a.addLocalHook("destroy",()=>this.destroyBorders(a)));const y=this.getBorderInstance(a);if(a.isEmpty()){y==null||y.disappear();continue}u&&Pr(BL,this).setActiveSelection(a).scan().forEach(E=>{if(r.has(E)){const M=r.get(E);M.has(u)&&m===!0?M.set(u,M.get(u)+1):M.set(u,1)}else r.set(E,new Map([[u,1]]));h&&(i.has(E)||i.set(E,[]),E.nodeName==="TH"&&i.get(E).push(...h))});const x=a.getCorners();Pr(ll,this).getSetting("onBeforeDrawBorders",x,g),y==null||y.appear(x)}r.forEach((s,a)=>{var u;const h=Array.from(s).map(m=>{let[g,y]=m;return y===1?g:[g,...Array.from({length:y-1},(x,C)=>`${g}-${C+1}`)]}).flat();h.forEach(m=>Pr(kR,this).get(Pr(ll,this)).add(m)),st(a,h),a.nodeName==="TD"&&Array.isArray((u=Pr(_c,this).options)===null||u===void 0?void 0:u.cellAttributes)&&gn(a,Pr(_c,this).options.cellAttributes)}),Array.from(i.keys()).forEach(s=>{gn(s,[...i.get(s)])})}}function dbe(){const t=Pr(kR,this).get(Pr(ll,this)),e=Pr(ll,this).wtSettings.getSetting("onBeforeRemoveCellClassNames");if(Array.isArray(e))for(let n=0;n<e.length;n++)t.add(e[n]);t.forEach(n=>{var r,i;const s=Pr(ll,this).wtTable.TABLE.querySelectorAll(`.${n}`);let a=[];Array.isArray((r=Pr(_c,this).options)===null||r===void 0?void 0:r.cellAttributes)&&(a=Pr(_c,this).options.cellAttributes.map(u=>u[0])),Array.isArray((i=Pr(_c,this).options)===null||i===void 0?void 0:i.headerAttributes)&&(a=[...a,...Pr(_c,this).options.headerAttributes.map(u=>u[0])]);for(let u=0,h=s.length;u<h;u++)cn(s[u],n),wm(s[u],a)}),t.clear()}class hbe extends ER{constructor(e,n,r,i){super(e,n,V0,r,i)}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new LL(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wtTable:e}=this.wot;if(!this.needFullRender||!this.shouldBeRendered()||!e.holder.parentNode)return!1;const{rootWindow:n}=this.domBindings,r=this.clone.wtTable.holder.parentNode,i=this.wtSettings.getSetting("preventOverflow");let s=0;this.trimmingContainer===n&&(!i||i!=="horizontal")?(s=this.getOverlayOffset()*(this.isRtl()?-1:1),cL(r,`${s}px`,"0px")):(s=this.getScrollPosition(),HT(r));const a=this.adjustHeaderBordersPosition(s);return this.adjustElementsSize(),a}setScrollPosition(e){const{rootWindow:n}=this.domBindings;let r=!1;this.isRtl()&&(e=-e);const i=this.mainTableScrollableElement;if(i===n&&e!==n.scrollX){const s=n.scrollX;n.scrollTo(e,uG(n)),r=s!==n.scrollX}else if(e!==i.scrollLeft){const s=i.scrollLeft;i.scrollLeft=e,r=s!==i.scrollLeft}return r}onScroll(){this.wtSettings.getSetting("onScrollVertically")}sumCellSizes(e,n){const r=this.wtSettings.getSetting("defaultColumnWidth");let i=e,s=0;for(;i<n;)s+=this.wot.wtTable.getColumnWidth(i)||r,i+=1;return s}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,a=this.clone.wtTable.holder.parentNode.style,u=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||u==="vertical"){let m=n.getWorkspaceHeight();n.hasHorizontalScroll()&&(m-=go(r)),m=Math.min(m,e.wtRootElement.scrollHeight),a.height=`${m}px`}else a.height="";this.clone.wtTable.holder.style.height=a.height;const h=po(this.clone.wtTable.TABLE);a.width=`${h}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=zL(this.wot),r=this.wot.selectionManager.getFocusSelection()?parseInt(n.width,10)/2:0;this.clone.wtTable.hider.style.height=this.hider.style.height,e.style.height=e.parentNode.style.height,e.style.width=`${parseInt(e.parentNode.style.width,10)+r}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalColumns"),n=this.isRtl()?"right":"left";typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?this.spreader.style[n]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:e===0?this.spreader.style[n]="0":gt("Incorrect value of the columnsRenderCalculator"),this.isRtl()?this.spreader.style.left="":this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number"?this.clone.wtTable.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`:this.clone.wtTable.spreader.style.top=""}scrollTo(e,n){const{wtSettings:r}=this,i=r.getSetting("rowHeaders"),s=r.getSetting("fixedColumnsStart"),u=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder,h=s===0&&i.length>0&&!Dn(u.parentNode,"innerBorderInlineStart")?1:0;let m=this.getTableParentOffset(),g=0;if(n){const y=this.wot.wtTable.getColumnWidth(e),x=this.wot.wtViewport.getViewportWidth();y>x&&(n=!1)}return n&&u.offsetWidth!==u.clientWidth&&(g=go(this.domBindings.rootDocument)),n?(m+=this.sumCellSizes(0,e+1),m-=this.wot.wtViewport.getViewportWidth(),m+=h):m+=this.sumCellSizes(this.wtSettings.getSetting("fixedColumnsStart"),e),m+=g,zpe(this.mainTableScrollableElement)===m-h&&h>0&&this.wot.wtOverlays.expandHiderHorizontallyBy(h),this.setScrollPosition(m)}getTableParentOffset(){const e=this.wtSettings.getSetting("preventOverflow");let n=0;return!e&&this.trimmingContainer===this.domBindings.rootWindow&&(n=this.wot.wtTable.holderOffset.left),n}getScrollPosition(){return Math.abs(dG(this.mainTableScrollableElement,this.domBindings.rootWindow))}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let r=0;if(this.trimmingContainer===e&&(!n||n!=="horizontal")){this.isRtl()?r=Math.abs(Math.min(this.getTableParentOffset()-this.getScrollPosition(),0)):r=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0);const i=this.wot.wtTable.getTotalWidth(),s=this.clone.wtTable.getTotalWidth(),a=i-s;r>a&&(r=0)}return r}adjustHeaderBordersPosition(e){const{wtSettings:n}=this,r=this.wot.wtTable.holder.parentNode,i=n.getSetting("rowHeaders"),s=n.getSetting("fixedColumnsStart"),a=n.getSetting("totalRows"),u=n.getSetting("preventOverflow")==="vertical";a?cn(r,"emptyRows"):st(r,"emptyRows");let h=!1;if(!u){if(s&&!i.length)st(r,"innerBorderLeft innerBorderInlineStart");else if(!s&&i.length){const m=Dn(r,"innerBorderInlineStart");e?(st(r,"innerBorderLeft innerBorderInlineStart"),h=!m):(cn(r,"innerBorderLeft innerBorderInlineStart"),h=m)}}return h}}const fbe="stickyRowsTop",UL={getFirstRenderedRow(){return this.getRenderedRowsCount()===0?-1:0},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){return Math.min(this.wtSettings.getSetting("totalRows"),this.wtSettings.getSetting("fixedRowsTop"))},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};xm(UL,"MIXIN_NAME",fbe,{writable:!1,enumerable:!1});class YL extends Jx{constructor(e,n,r,i){super(e,n,r,i,B0)}}ci(YL,UL),ci(YL,UT);function NK(t,e,n){return(e=mbe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mbe(t){var e=pbe(t,"string");return typeof e=="symbol"?e:e+""}function pbe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gbe extends ER{constructor(e,n,r,i,s,a){super(e,n,B0,r,i),NK(this,"topOverlay",void 0),NK(this,"inlineStartOverlay",void 0),this.topOverlay=s,this.inlineStartOverlay=a}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new YL(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){if(this.updateTrimmingContainer(),!this.wot.wtTable.holder.parentNode)return!1;const e=this.clone.wtTable.holder.parentNode;if(this.trimmingContainer===this.domBindings.rootWindow){const i=this.inlineStartOverlay.getOverlayOffset()*(this.isRtl()?-1:1),s=this.topOverlay.getOverlayOffset();cL(e,`${i}px`,`${s}px`)}else HT(e);let n=Po(this.clone.wtTable.TABLE);const r=po(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(n=0),e.style.height=`${n}px`,e.style.width=`${r}px`,!1}}class GL extends Jx{constructor(e,n,r,i){super(e,n,r,i,z0)}}ci(GL,UL),ci(GL,GT);function vbe(t,e,n){return(e=bbe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bbe(t){var e=ybe(t,"string");return typeof e=="symbol"?e:e+""}function ybe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class xbe extends ER{constructor(e,n,r,i){super(e,n,z0,r,i),vbe(this,"cachedFixedRowsTop",-1),this.cachedFixedRowsTop=this.wtSettings.getSetting("fixedRowsTop")}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new GL(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const e=this.clone.wtTable.holder.parentNode,{rootWindow:n}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow");let i=0,s=!1;if(this.trimmingContainer===n&&(!r||r!=="vertical")){const{wtTable:u}=this.wot,h=u.hider.getBoundingClientRect(),m=Math.ceil(h.bottom),g=e.offsetHeight;s=m===g,i=this.getOverlayOffset(),cL(e,"0px",`${i}px`)}else i=this.getScrollPosition(),HT(e);const a=this.adjustHeaderBordersPosition(i,s);return this.adjustElementsSize(),a}setScrollPosition(e){const{rootWindow:n}=this.domBindings,r=this.mainTableScrollableElement;let i=!1;if(r===n&&e!==n.scrollY){const s=n.scrollY;n.scrollTo(oL(n),e),i=s!==n.scrollY}else if(e!==r.scrollTop){const s=r.scrollTop;r.scrollTop=e,i=s!==r.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const r=this.wtSettings.getSetting("stylesHandler").getDefaultRowHeight();let i=e,s=0;for(;i<n;){const a=this.wot.wtTable.getRowHeight(i);s+=a===void 0?r:a,i+=1}return s}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,a=this.clone.wtTable.holder.parentNode.style,u=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||u==="horizontal"){let m=n.getWorkspaceWidth();n.hasVerticalScroll()&&(m-=go(r)),m=Math.min(m,e.wtRootElement.scrollWidth),a.width=`${m}px`}else a.width="";this.clone.wtTable.holder.style.width=a.width;let h=Po(this.clone.wtTable.TABLE);e.hasDefinedSize()||(h=0),a.height=`${h}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=zL(this.wot),r=this.wot.selectionManager.getFocusSelection()?parseInt(n.height,10)/2:0;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=`${parseInt(e.parentNode.style.height,10)+r}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number"?this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`:e===0?this.spreader.style.top="0":gt("Incorrect value of the rowsRenderCalculator"),this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:n}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?n.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:n.style[e]=""}scrollTo(e,n){const{wot:r,wtSettings:i}=this,a=(r.cloneSource?r.cloneSource:r).wtTable.holder,u=i.getSetting("columnHeaders"),m=i.getSetting("fixedRowsTop")===0&&u.length>0&&!Dn(a.parentNode,"innerBorderTop")?1:0;let g=this.getTableParentOffset(),y=0;if(n){const x=this.wot.wtTable.getRowHeight(e),C=this.wot.wtViewport.getViewportHeight();x>C&&(n=!1)}if(n&&a.offsetHeight!==a.clientHeight&&(y=go(this.domBindings.rootDocument)),n){const x=i.getSetting("fixedRowsBottom"),C=i.getSetting("totalRows");g+=this.sumCellSizes(0,e+1),g-=r.wtViewport.getViewportHeight()-this.sumCellSizes(C-x,C),g+=1,g+=m}else g+=this.sumCellSizes(i.getSetting("fixedRowsTop"),e);return g+=y,Fpe(this.mainTableScrollableElement)===g-m&&m>0&&this.wot.wtOverlays.expandHiderVerticallyBy(m),this.setScrollPosition(g)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return aL(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let r=0;if(this.trimmingContainer===e&&(!n||n!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),s=this.clone.wtTable.getTotalHeight(),a=i-s;r=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0),r>a&&(r=0)}return r}adjustHeaderBordersPosition(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{wtSettings:r}=this,i=this.wot.wtTable.holder.parentNode,s=r.getSetting("totalColumns"),a=r.getSetting("preventOverflow")==="horizontal";s?cn(i,"emptyColumns"):st(i,"emptyColumns");let u=!1;if(!n&&!a){const h=r.getSetting("fixedRowsTop"),m=this.cachedFixedRowsTop!==h,g=r.getSetting("columnHeaders");if((m||h===0)&&g.length>0){const y=Dn(i,"innerBorderTop");this.cachedFixedRowsTop=r.getSetting("fixedRowsTop"),e||r.getSetting("totalRows")===0?(st(i,"innerBorderTop"),u=!y):(cn(i,"innerBorderTop"),u=y)}}return u}}function XT(t,e,n){wbe(t,e),e.set(t,n)}function wbe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _m(t,e,n){return(e=Cbe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Cbe(t){var e=Sbe(t,"string");return typeof e=="symbol"?e:e+""}function Sbe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function U0(t,e,n){return t.set(kK(t,e),n),n}function Em(t,e){return t.get(kK(t,e))}function kK(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var tw=new WeakMap,QT=new WeakMap,nw=new WeakMap,ZT=new WeakMap;class Rbe{constructor(e,n,r,i,s,a){_m(this,"wot",null),XT(this,tw,[]),_m(this,"topOverlay",null),_m(this,"bottomOverlay",null),_m(this,"inlineStartOverlay",null),_m(this,"topInlineStartCornerOverlay",null),_m(this,"bottomInlineStartCornerOverlay",null),_m(this,"browserLineHeight",void 0),_m(this,"wtSettings",null),XT(this,QT,!1),XT(this,nw,0),XT(this,ZT,null),_m(this,"resizeObserver",new ResizeObserver(y=>{TT(()=>{!Array.isArray(y)||!y.length||(U0(nw,this,Em(nw,this)+1),Em(nw,this)===300&&(Yn("The ResizeObserver callback was fired too many times in direct succession.\nThis may be due to an infinite loop caused by setting a dynamic height/width (for example, with the `dvh` units) to a Handsontable container's parent. \nThe observer will be disconnected."),this.resizeObserver.disconnect()),Em(ZT,this)!==null&&clearTimeout(Em(ZT,this)),U0(ZT,this,setTimeout(()=>{U0(nw,this,0)},100)),this.wtSettings.getSetting("onContainerElementResize"))})})),this.wot=e,this.wtSettings=i,this.domBindings=r,this.facadeGetter=n,this.wtTable=a;const{rootDocument:u,rootWindow:h}=this.domBindings;this.instance=this.wot,this.eventManager=s,this.scrollbarSize=go(u);const m=h.getComputedStyle(a.wtRootElement.parentNode).getPropertyValue("overflow"),g=m==="hidden"||m==="clip";this.scrollableElement=g?a.holder:OT(a.TABLE),this.initOverlays(),this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.initBrowserLineHeight(),this.registerListeners(),this.lastScrollX=h.scrollX,this.lastScrollY=h.scrollY}getOverlays(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const n=[...Em(tw,this)];return e&&n.push(this.wtTable),n}initBrowserLineHeight(){const{rootWindow:e,rootDocument:n}=this.domBindings,r=e.getComputedStyle(n.body),i=parseInt(r.lineHeight,10),s=parseInt(r.fontSize,10)*1.2;this.browserLineHeight=i||s}initOverlays(){const e=[this.wot,this.facadeGetter,this.wtSettings,this.domBindings];this.topOverlay=new xbe(...e),this.bottomOverlay=new Q0e(...e),this.inlineStartOverlay=new hbe(...e),this.topInlineStartCornerOverlay=new gbe(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new Y0e(...e,this.bottomOverlay,this.inlineStartOverlay),U0(tw,this,[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay])}beforeDraw(){U0(QT,this,Em(tw,this).reduce((e,n)=>n.hasRenderingStateChanged()||e,!1)),Em(tw,this).forEach(e=>e.updateStateOfRendering("before"))}afterDraw(){this.syncScrollWithMaster(),Em(tw,this).forEach(e=>{const n=e.hasRenderingStateChanged();e.updateStateOfRendering("after"),n&&!e.needFullRender&&e.reset()})}refreshAll(){if(this.wot.drawn){if(!this.wtTable.holder.parentNode){this.destroy();return}this.wot.draw(!0),this.verticalScrolling&&this.inlineStartOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}}registerListeners(){const{rootDocument:e,rootWindow:n}=this.domBindings,{mainTableScrollableElement:r}=this.topOverlay,{mainTableScrollableElement:i}=this.inlineStartOverlay;this.eventManager.addEventListener(e.documentElement,"keydown",y=>this.onKeyDown(y)),this.eventManager.addEventListener(e.documentElement,"keyup",()=>this.onKeyUp()),this.eventManager.addEventListener(e,"visibilitychange",()=>this.onKeyUp()),this.eventManager.addEventListener(r,"scroll",y=>this.onTableScroll(y),{passive:!0}),r!==i&&this.eventManager.addEventListener(i,"scroll",y=>this.onTableScroll(y),{passive:!0});const s=n.devicePixelRatio&&n.devicePixelRatio>1,a=this.scrollableElement===n,u=this.wtSettings.getSetting("preventWheel"),h={passive:a};(u||s||!rG())&&this.eventManager.addEventListener(this.wtTable.wtRootElement,"wheel",y=>this.onCloneWheel(y,u),h),[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay].forEach(y=>{this.eventManager.addEventListener(y.clone.wtTable.holder,"wheel",x=>this.onCloneWheel(x,u),h)});let g;this.eventManager.addEventListener(n,"resize",()=>{TT(()=>{clearTimeout(g),this.wtSettings.getSetting("onWindowResize"),g=setTimeout(()=>{U0(nw,this,0)},200)})}),a||this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement)}onTableScroll(e){const n=this.domBindings.rootWindow,r=this.inlineStartOverlay.mainTableScrollableElement,i=this.topOverlay.mainTableScrollableElement,s=e.target;this.keyPressed&&(i!==n&&s!==n&&!e.target.contains(i)||r!==n&&s!==n&&!e.target.contains(r))||this.syncScrollPositions(e)}onCloneWheel(e,n){if(e.ctrlKey)return;const{rootWindow:r}=this.domBindings,i=this.inlineStartOverlay.mainTableScrollableElement,s=this.topOverlay.mainTableScrollableElement,a=e.target,u=s!==r&&a!==r&&!a.contains(s),h=i!==r&&a!==r&&!a.contains(i);if(this.keyPressed&&(u||h)||this.scrollableElement===r)return;const m=this.translateMouseWheelToScroll(e);(n||this.scrollableElement!==r&&m)&&e.preventDefault()}onKeyDown(e){this.keyPressed=Ux(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")}onKeyUp(){this.keyPressed=!1}translateMouseWheelToScroll(e){let n=isNaN(e.deltaY)?-1*e.wheelDeltaY:e.deltaY,r=isNaN(e.deltaX)?-1*e.wheelDeltaX:e.deltaX;e.deltaMode===1&&(r+=r*this.browserLineHeight,n+=n*this.browserLineHeight);const i=this.scrollVertically(n),s=this.scrollHorizontally(r);return i||s}scrollVertically(e){const n=this.scrollableElement.scrollTop;return this.scrollableElement.scrollTop+=e,n!==this.scrollableElement.scrollTop}scrollHorizontally(e){const n=this.scrollableElement.scrollLeft;return this.scrollableElement.scrollLeft+=e,n!==this.scrollableElement.scrollLeft}syncScrollPositions(){if(this.destroyed)return;const e=this.topOverlay.clone.wtTable.holder,n=this.inlineStartOverlay.clone.wtTable.holder;let r=this.scrollableElement.scrollLeft,i=this.scrollableElement.scrollTop;if(this.wot.wtViewport.isHorizontallyScrollableByWindow()&&(r=this.scrollableElement.scrollX),this.wot.wtViewport.isVerticallyScrollableByWindow()&&(i=this.scrollableElement.scrollY),this.horizontalScrolling=this.lastScrollX!==r,this.verticalScrolling=this.lastScrollY!==i,this.lastScrollX=r,this.lastScrollY=i,this.horizontalScrolling){e.scrollLeft=r;const s=this.bottomOverlay.needFullRender?this.bottomOverlay.clone.wtTable.holder:null;s&&(s.scrollLeft=r)}this.verticalScrolling&&(n.scrollTop=i),this.refreshAll()}syncScrollWithMaster(){if(!Em(QT,this))return;const e=this.topOverlay.mainTableScrollableElement,{scrollLeft:n,scrollTop:r}=e;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=n),this.bottomOverlay.needFullRender&&(this.bottomOverlay.clone.wtTable.holder.scrollLeft=n),this.inlineStartOverlay.needFullRender&&(this.inlineStartOverlay.clone.wtTable.holder.scrollTop=r),U0(QT,this,!1)}updateMainScrollableElements(){this.eventManager.clearEvents(!0),this.inlineStartOverlay.updateMainScrollableElement(),this.topOverlay.updateMainScrollableElement(),this.bottomOverlay.needFullRender&&this.bottomOverlay.updateMainScrollableElement();const{wtTable:e}=this,{rootWindow:n}=this.domBindings,r=n.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow");r==="hidden"||r==="clip"?this.scrollableElement=e.holder:this.scrollableElement=OT(e.TABLE),this.registerListeners()}destroy(){this.resizeObserver.disconnect(),this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.inlineStartOverlay.destroy(),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.destroy(),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.destroy(),this.destroyed=!0}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.updateLastSpreaderSize()&&this.adjustElementsSize(),this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.inlineStartOverlay.refresh(e),this.topOverlay.refresh(e),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.refresh(e),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.refresh(e)}updateLastSpreaderSize(){const e=this.wtTable.spreader,n=e.clientWidth,r=e.clientHeight,i=n!==this.spreaderLastSize.width||r!==this.spreaderLastSize.height;return i&&(this.spreaderLastSize.width=n,this.spreaderLastSize.height=r),i}adjustElementsSize(){const{wtViewport:e}=this.wot,{wtTable:n}=this,{rootWindow:r}=this.domBindings,i=this.scrollableElement===r,s=this.wtSettings.getSetting("totalColumns"),a=this.wtSettings.getSetting("totalRows"),u=e.getRowHeaderWidth(),h=e.getColumnHeaderHeight(),m=this.wtSettings.getSetting("externalRowCalculator")?0:1,g=h+this.topOverlay.sumCellSizes(0,a)+m,y=u+this.inlineStartOverlay.sumCellSizes(0,s),C=n.hider.style,E=()=>i?!1:this.scrollableElement.scrollTop>Math.max(0,g-n.holder.clientHeight),M=()=>i?!1:this.scrollableElement.scrollLeft>Math.max(0,y-n.holder.clientWidth),j=E()?1:0,L=M()?1:0;C.width=`${y+L}px`,C.height=`${g+j}px`,this.topOverlay.adjustElementsSize(),this.inlineStartOverlay.adjustElementsSize(),this.bottomOverlay.adjustElementsSize()}expandHiderVerticallyBy(e){const{wtTable:n}=this;n.hider.style.height=`${parseInt(n.hider.style.height,10)+e}px`}expandHiderHorizontallyBy(e){const{wtTable:n}=this;n.hider.style.width=`${parseInt(n.hider.style.width,10)+e}px`}applyToDOM(){this.wtTable.isVisible()&&(this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.inlineStartOverlay.applyToDOM())}getParentOverlay(e){if(!e)return null;const n=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];let r=null;return Te(n,i=>{i&&i.clone&&i.clone.wtTable.TABLE.contains(e)&&(r=i.clone)}),r}syncOverlayTableClassNames(){const e=this.wtTable.TABLE,n=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];Te(n,r=>{r&&(r.clone.wtTable.TABLE.className=e.className)})}}function TK(t,e,n){return(e=_be(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _be(t){var e=Ebe(t,"string");return typeof e=="symbol"?e:e+""}function Ebe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Nbe{constructor(e){TK(this,"settings",{}),TK(this,"defaults",Object.freeze(this.getDefaults())),Mr(this.defaults,(n,r)=>{e[r]!==void 0?this.settings[r]=e[r]:n===void 0?gt(`A required setting "${r}" was not provided`):this.settings[r]=n})}getDefaults(){return{facade:void 0,table:void 0,isDataViewInstance:!0,externalRowCalculator:!1,currentRowClassName:null,currentColumnClassName:null,preventOverflow(){return!1},preventWheel:!1,data:void 0,fixedColumnsStart:0,fixedRowsTop:0,fixedRowsBottom:0,shouldRenderInlineStartOverlay:()=>this.getSetting("fixedColumnsStart")>0||this.getSetting("rowHeaders").length>0,shouldRenderTopOverlay:()=>this.getSetting("fixedRowsTop")>0||this.getSetting("columnHeaders").length>0,shouldRenderBottomOverlay:()=>this.getSetting("fixedRowsBottom")>0,minSpareRows:0,rowHeaders(){return[]},columnHeaders(){return[]},totalRows:void 0,totalColumns:void 0,cellRenderer:(e,n,r)=>{const i=this.getSetting("data",e,n);Cg(r,i??"")},columnWidth(){},rowHeight(){},rowHeightByOverlayName(){},defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride:null,viewportRowRenderingThreshold:null,viewportColumnRenderingThreshold:null,onCellMouseDown:null,onCellContextMenu:null,onCellMouseOver:null,onCellMouseOut:null,onCellMouseUp:null,onCellDblClick:null,onCellCornerMouseDown:null,onCellCornerDblClick:null,beforeDraw:null,onDraw:null,onBeforeRemoveCellClassNames:null,onAfterDrawSelection:null,onBeforeDrawBorders:null,onBeforeViewportScrollHorizontally:e=>e,onBeforeViewportScrollVertically:e=>e,onScrollHorizontally:null,onScrollVertically:null,onBeforeTouchScroll:null,onAfterMomentumScroll:null,onModifyRowHeaderWidth:null,onModifyGetCellCoords:null,onModifyGetCoordsElement:null,onModifyGetCoords:null,onBeforeHighlightingRowHeader:e=>e,onBeforeHighlightingColumnHeader:e=>e,onWindowResize:null,onContainerElementResize:null,renderAllColumns:!1,renderAllRows:!1,groups:!1,rowHeaderWidth:null,columnHeaderHeight:null,headerClassName:null,rtlMode:!1,ariaTags:!0,stylesHandler:null}}update(e,n){return n===void 0?Mr(e,(r,i)=>{this.settings[i]=r}):this.settings[e]=n,this}getSetting(e,n,r,i,s){return typeof this.settings[e]=="function"?this.settings[e](n,r,i,s):n!==void 0&&Array.isArray(this.settings[e])?this.settings[e][n]:this.settings[e]}getSettingPure(e){return this.settings[e]}has(e){return!!this.settings[e]}}class KL extends Jx{constructor(e,n,r,i){super(e,n,r,i,"master")}alignOverlaysWithTrimmingContainer(){const e=hR(this.wtRootElement),{rootWindow:n}=this.domBindings;if(e===n)this.wtSettings.getSetting("preventOverflow")||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible");else{const r=e.parentElement,i=IT(e,"height",n),s=IT(e,"overflow",n),a=this.holder.style,{scrollWidth:u,scrollHeight:h}=e;let m=e.offsetWidth,g=e.offsetHeight;if(r&&["auto","hidden","scroll","clip"].includes(s)){const x=e.cloneNode(!1);x.style.overflow="auto",x.style.position="absolute",e.nextElementSibling?r.insertBefore(x,e.nextElementSibling):r.appendChild(x);const C=parseInt(n.getComputedStyle(x).height,10);r.removeChild(x),C===0&&(g=0)}g=Math.min(g,h),a.height=i==="auto"?"auto":`${g}px`,m=Math.min(m,u),a.width=`${m}px`,a.overflow="",this.hasTableHeight=a.height==="auto"?!0:g>0,this.hasTableWidth=m>0}this.isTableVisible=P0(this.TABLE)}markOversizedColumnHeaders(){const{wtSettings:e}=this,{wtViewport:n}=this.dataAccessObject,r="master",s=e.getSetting("columnHeaders").length;if(s&&!n.hasOversizedColumnHeadersMarked[r]){const u=e.getSetting("rowHeaders").length,h=this.getRenderedColumnsCount();for(let m=0;m<s;m++)for(let g=-1*u;g<h;g++)this.markIfOversizedColumnHeader(g);n.hasOversizedColumnHeadersMarked[r]=!0}}}ci(KL,HL),ci(KL,GT);class kbe{constructor(e,n,r,i,s){this.dataAccessObject=e,this.wot=e.wot,this.instance=this.wot,this.domBindings=n,this.wtSettings=r,this.wtTable=s,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.hasOversizedColumnHeadersMarked={},this.clientHeight=0,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.rowsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllRows")?new Zge:new ive],["fullyVisible",()=>new Vge],["partiallyVisible",()=>new YG]]),this.columnsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllColumns")?new qge:new tve],["fullyVisible",()=>new $ge],["partiallyVisible",()=>new UG]]),this.eventManager=i,this.eventManager.addEventListener(this.domBindings.rootWindow,"resize",()=>{this.clientHeight=this.getWorkspaceHeight()})}getWorkspaceHeight(){const e=this.domBindings.rootDocument,n=this.dataAccessObject.topOverlayTrimmingContainer;let r=0;return n===this.domBindings.rootWindow?r=e.documentElement.clientHeight:r=Po(n)>0&&n.clientHeight>0?n.clientHeight:1/0,r}getViewportHeight(){let e=this.getWorkspaceHeight();if(e===1/0)return e;const n=this.getColumnHeaderHeight();return n>0&&(e-=n),e}getWorkspaceWidth(){const{rootDocument:e,rootWindow:n}=this.domBindings,r=this.dataAccessObject.inlineStartOverlayTrimmingContainer;let i;if(r===n){const s=this.wtSettings.getSetting("totalColumns");i=this.wtTable.holder.offsetWidth,this.getRowHeaderWidth()+this.sumColumnWidths(0,s)>i&&(i=e.documentElement.clientWidth)}else i=r.clientWidth;return i}getViewportWidth(){const e=this.getWorkspaceWidth();if(e===1/0)return e;const n=this.getRowHeaderWidth();return n>0?e-n:e}hasVerticalScroll(){if(this.isVerticallyScrollableByWindow()){const s=this.domBindings.rootDocument.documentElement;return s.scrollHeight>s.clientHeight}const{holder:e,hider:n}=this.wtTable,r=e.clientHeight,i=n.offsetHeight;return r<i?!0:i>this.getWorkspaceHeight()}hasHorizontalScroll(){if(this.isVerticallyScrollableByWindow()){const i=this.domBindings.rootDocument.documentElement;return i.scrollWidth>i.clientWidth}const{hider:e}=this.wtTable,n=e.offsetWidth,r=this.hasVerticalScroll()?go():0;return n>this.getWorkspaceWidth()-r}isVerticallyScrollableByWindow(){return this.dataAccessObject.topOverlayTrimmingContainer===this.domBindings.rootWindow}isHorizontallyScrollableByWindow(){return this.dataAccessObject.inlineStartOverlayTrimmingContainer===this.domBindings.rootWindow}sumColumnWidths(e,n){let r=0,i=e;for(;i<n;)r+=this.wtTable.getColumnWidth(i),i+=1;return r}getWorkspaceOffset(){return sl(this.wtTable.holder)}getColumnHeaderHeight(){return this.wtSettings.getSetting("columnHeaders").length?isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=Po(this.wtTable.THEAD)):this.columnHeaderHeight=0,this.columnHeaderHeight}getRowHeaderWidth(){const e=this.wtSettings.getSetting("rowHeaderWidth"),n=this.wtSettings.getSetting("rowHeaders");if(e){this.rowHeaderWidth=0;for(let r=0,i=n.length;r<i;r++)this.rowHeaderWidth+=e[r]||e}if(isNaN(this.rowHeaderWidth))if(n.length){let r=this.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(let i=0,s=n.length;i<s;i++)r?(this.rowHeaderWidth+=po(r),r=r.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0;return this.rowHeaderWidth=this.wtSettings.getSetting("onModifyRowHeaderWidth",this.rowHeaderWidth)||this.rowHeaderWidth,this.rowHeaderWidth}createRowsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:n,wtTable:r}=this;let i=this.getViewportHeight(),s,a;this.rowHeaderWidth=NaN;let u=this.dataAccessObject.topScrollPosition-this.dataAccessObject.topParentOffset;const h=n.getSetting("fixedRowsTop"),m=n.getSetting("fixedRowsBottom"),g=n.getSetting("totalRows");return h&&u>=0&&(a=this.dataAccessObject.topOverlay.sumCellSizes(0,h),u+=a,i-=a),m&&this.dataAccessObject.bottomOverlay.clone&&(a=this.dataAccessObject.bottomOverlay.sumCellSizes(g-m,g),i-=a),r.holder.clientHeight===r.holder.offsetHeight?s=0:s=go(this.domBindings.rootDocument),new hve({calculationTypes:e.map(y=>[y,this.rowsCalculatorTypes.get(y)()]),viewportHeight:i,scrollOffset:u,totalRows:n.getSetting("totalRows"),defaultRowHeight:n.getSetting("stylesHandler").getDefaultRowHeight(),rowHeightFn:y=>r.getRowHeight(y),overrideFn:n.getSettingPure("viewportRowCalculatorOverride"),horizontalScrollbarHeight:s})}createColumnsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:n,wtTable:r}=this;let i=this.getViewportWidth(),s=Math.abs(this.dataAccessObject.inlineStartScrollPosition)-this.dataAccessObject.inlineStartParentOffset;this.columnHeaderHeight=NaN;const a=n.getSetting("fixedColumnsStart");if(a&&s>=0){const u=this.dataAccessObject.inlineStartOverlay.sumCellSizes(0,a);s+=u,i-=u}return r.holder.clientWidth!==r.holder.offsetWidth&&(i-=go(this.domBindings.rootDocument)),new cve({calculationTypes:e.map(u=>[u,this.columnsCalculatorTypes.get(u)()]),viewportWidth:i,scrollOffset:s,totalColumns:n.getSetting("totalColumns"),columnWidthFn:u=>r.getColumnWidth(u),overrideFn:n.getSettingPure("viewportColumnCalculatorOverride"),inlineStartOffset:this.dataAccessObject.inlineStartParentOffset})}createCalculators(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:n}=this,r=this.createRowsCalculator(),i=this.createColumnsCalculator();if(e&&!n.getSetting("renderAllRows")){const s=r.getResultsFor("fullyVisible"),a=r.getResultsFor("partiallyVisible");e=this.areAllProposedVisibleRowsAlreadyRendered(s,a)}if(e&&!n.getSetting("renderAllColumns")){const s=i.getResultsFor("fullyVisible"),a=i.getResultsFor("partiallyVisible");e=this.areAllProposedVisibleColumnsAlreadyRendered(s,a)}return e||(this.rowsRenderCalculator=r.getResultsFor("rendered"),this.columnsRenderCalculator=i.getResultsFor("rendered")),this.rowsVisibleCalculator=r.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=i.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=r.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=i.getResultsFor("partiallyVisible"),e}createVisibleCalculators(){const e=this.createRowsCalculator(["fullyVisible","partiallyVisible"]),n=this.createColumnsCalculator(["fullyVisible","partiallyVisible"]);this.rowsVisibleCalculator=e.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=n.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=e.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=n.getResultsFor("partiallyVisible")}areAllProposedVisibleRowsAlreadyRendered(e,n){if(!this.rowsVisibleCalculator)return!1;let{startRow:r,endRow:i}=e;const{startRow:s,endRow:a}=n;if(r===null&&i===null){if(!e.isVisibleInTrimmingContainer&&!this.wtTable.isRowBeforeRenderedRows(s)&&!this.wtTable.isRowAfterRenderedRows(a))return!0;r=s,i=a}const{startRow:u,endRow:h,rowStartOffset:m,rowEndOffset:g}=this.rowsRenderCalculator,y=this.wtSettings.getSetting("totalRows")-1,x=this.wtSettings.getSetting("viewportRowRenderingThreshold");return Number.isInteger(x)&&x>0?(r=Math.max(0,r-Math.min(m,x)),i=Math.min(y,i+Math.min(g,x))):x==="auto"&&(r=Math.max(0,r-Math.ceil(m/2)),i=Math.min(y,i+Math.ceil(g/2))),r<u||r===u&&r>0?!1:!(i>h||i===h&&i<y)}areAllProposedVisibleColumnsAlreadyRendered(e,n){if(!this.columnsVisibleCalculator)return!1;let{startColumn:r,endColumn:i}=e;const{startColumn:s,endColumn:a}=n;if(r===null&&i===null){if(!e.isVisibleInTrimmingContainer&&!this.wtTable.isColumnBeforeRenderedColumns(s)&&!this.wtTable.isColumnAfterRenderedColumns(a))return!0;r=s,i=a}const{startColumn:u,endColumn:h,columnStartOffset:m,columnEndOffset:g}=this.columnsRenderCalculator,y=this.wtSettings.getSetting("totalColumns")-1,x=this.wtSettings.getSetting("viewportColumnRenderingThreshold");return Number.isInteger(x)&&x>0?(r=Math.max(0,r-Math.min(m,x)),i=Math.min(y,i+Math.min(g,x))):x==="auto"&&(r=Math.max(0,r-Math.ceil(m/2)),i=Math.min(y,i+Math.ceil(g/2))),r<u||r===u&&r>0?!1:!(i>h||i===h&&i<y)}resetHasOversizedColumnHeadersMarked(){Mr(this.hasOversizedColumnHeadersMarked,(e,n,r)=>{r[n]=void 0})}}class Tbe extends IL{constructor(e,n){super(e,new Nbe(n));const r=this.wtSettings.getSetting("facade",this);this.wtTable=new KL(this.getTableDao(),r,this.domBindings,this.wtSettings),this.wtViewport=new kbe(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new ube(this.wtSettings.getSetting("selections")),this.wtEvent=new nK(r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new Rbe(this,r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.exportSettingsAsClassNames(),this.findOriginalHeaders()}exportSettingsAsClassNames(){const e={rowHeaders:"htRowHeaders",columnHeaders:"htColumnHeaders"},n=[],r=[];Mr(e,(i,s)=>{this.wtSettings.getSetting(s).length&&r.push(i),n.push(i)}),cn(this.wtTable.wtRootElement.parentNode,n),st(this.wtTable.wtRootElement.parentNode,r)}getOverlayByName(e){var n;if(!hK.includes(e))return null;const r=e.replace(/_([a-z])/g,i=>i[1].toUpperCase());return(n=this.wtOverlays[`${r}Overlay`])!==null&&n!==void 0?n:null}getViewportDao(){const e=this;return{get wot(){return e},get topOverlayTrimmingContainer(){return e.wtOverlays.topOverlay.trimmingContainer},get inlineStartOverlayTrimmingContainer(){return e.wtOverlays.inlineStartOverlay.trimmingContainer},get topScrollPosition(){return e.wtOverlays.topOverlay.getScrollPosition()},get topParentOffset(){return e.wtOverlays.topOverlay.getTableParentOffset()},get inlineStartScrollPosition(){return e.wtOverlays.inlineStartOverlay.getScrollPosition()},get inlineStartParentOffset(){return e.wtOverlays.inlineStartOverlay.getTableParentOffset()},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get bottomOverlay(){return e.wtOverlays.bottomOverlay}}}}class qL{constructor(e){e instanceof IL?this._wot=e:this._initFromSettings(e)}_initFromSettings(e){e.facade=n=>{const r=new qL(n);return()=>r},this._wot=new Tbe(e.table,e)}get guid(){return this._wot.guid}get rootDocument(){return this._wot.domBindings.rootDocument}get rootWindow(){return this._wot.domBindings.rootWindow}get wtSettings(){return this._wot.wtSettings}get cloneSource(){return this._wot.cloneSource}get cloneOverlay(){return this._wot.cloneOverlay}get selectionManager(){return this._wot.selectionManager}get wtViewport(){return this._wot.wtViewport}get wtOverlays(){return this._wot.wtOverlays}get wtTable(){return this._wot.wtTable}get wtEvent(){return this._wot.wtEvent}get wtScroll(){return this._wot.wtScroll}get drawn(){return this._wot.drawn}set drawn(e){this._wot.drawn=e}get activeOverlayName(){return this._wot.activeOverlayName}get drawInterrupted(){return this._wot.drawInterrupted}set drawInterrupted(e){this._wot.drawInterrupted=e}get lastMouseOver(){return this._wot.lastMouseOver}set lastMouseOver(e){this._wot.lastMouseOver=e}get momentumScrolling(){return this._wot.momentumScrolling}set momentumScrolling(e){this._wot.momentumScrolling=e}get touchApplied(){return this._wot.touchApplied}set touchApplied(e){this._wot.touchApplied=e}get domBindings(){return this._wot.domBindings}get eventListeners(){return this._wot.eventListeners}set eventListeners(e){this._wot.eventListeners=e}get eventManager(){return this._wot.eventManager}createCellCoords(e,n){return this._wot.createCellCoords(e,n)}createCellRange(e,n,r){return this._wot.createCellRange(e,n,r)}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this._wot.draw(e),this}getCell(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this._wot.getCell(e,n)}scrollViewport(e,n,r){return this._wot.scrollViewport(e,n,r)}scrollViewportHorizontally(e,n){return this._wot.scrollViewportHorizontally(e,n)}scrollViewportVertically(e,n){return this._wot.scrollViewportVertically(e,n)}getViewport(){return this._wot.getViewport()}getOverlayName(){return this._wot.cloneOverlay?this._wot.cloneOverlay.type:"master"}getOverlayByName(e){return this._wot.getOverlayByName(e)}exportSettingsAsClassNames(){return this._wot.exportSettingsAsClassNames()}update(e,n){return this._wot.wtSettings.update(e,n),this}getSetting(e,n,r,i,s){return this._wot.wtSettings.getSetting(e,n,r,i,s)}hasSetting(e){return this._wot.wtSettings.hasSetting(e)}destroy(){this._wot.destroy()}}function jK(t){let{isShiftKey:e,isLeftClick:n,isRightClick:r,coords:i,selection:s,controller:a,cellCoordsFactory:u}=t;const h=s.isSelected()?s.getSelectedRange().current():null,m=s.isSelectedByCorner(),g=s.isSelectedByRowHeader();if(s.markSource("mouse"),e&&h)i.row>=0&&i.col>=0&&!a.cell?s.setRangeEnd(i):(m||g)&&i.row>=0&&i.col>=0&&!a.cell?s.setRangeEnd(u(i.row,i.col)):m&&i.row<0&&!a.column?s.setRangeEnd(u(h.to.row,i.col)):g&&i.col<0&&!a.row?s.setRangeEnd(u(i.row,h.to.col)):(!m&&!g&&i.col<0||m&&i.col<0)&&!a.row?s.selectRows(Math.max(h.from.row,0),i.row,i.col):(!m&&!g&&i.row<0||g&&i.row<0)&&!a.column&&s.selectColumns(Math.max(h.from.col,0),i.col,i.row);else{const y=!s.inInSelection(i),x=n||r&&y;i.row<0&&i.col>=0&&!a.column?x&&s.selectColumns(i.col,i.col,i.row):i.col<0&&i.row>=0&&!a.row?x&&s.selectRows(i.row,i.row,i.col):i.col>=0&&i.row>=0&&!a.cell?x&&s.setRangeStart(i):i.col<0&&i.row<0&&s.selectAll(!0,!0,{disableHeadersHighlight:!0,focusPosition:{row:0,col:0}})}s.markEndSource()}function jbe(t){let{isLeftClick:e,coords:n,selection:r,controller:i,cellCoordsFactory:s}=t;if(!e)return;const a=r.isSelectedByRowHeader(),u=r.isSelectedByColumnHeader(),h=r.tableProps.countCols(),m=r.tableProps.countRows();r.markSource("mouse"),u&&!i.column?r.setRangeEnd(s(m-1,n.col)):a&&!i.row?r.setRangeEnd(s(n.row,h-1)):i.cell||r.setRangeEnd(n),r.markEndSource()}function MK(t){let{isLeftClick:e,selection:n,cellRangeMapper:r}=t;if(!e||n.settings.selectionMode!=="multiple")return;const i=n.getSelectedRange(),s=i.clone().map(u=>r.toRenderable(u)),a=s.current();if(s.size()>1&&!a.isHeader()&&!n.isMultiple(a)){const u=s.findAll(a);u.length===s.size()?(i.pop(),n.refresh()):u.length>1&&(i.removeLayers(u.map(h=>{let{layer:m}=h;return m})),n.refresh())}}const Mbe=new Map([["touchstart",jK],["touchend",MK],["mousedown",jK],["mouseover",jbe],["mouseup",MK]]);function XL(t,e){Mbe.get(t.type)({isShiftKey:t.shiftKey,isLeftClick:dL(t)||t.type==="touchstart",isRightClick:O0(t),...e})}const PK=new WeakMap,QL=Symbol("rootInstance");function Pbe(t){PK.set(t,!0)}function Abe(t){return t===QL}function Vd(t){return PK.has(t)}function Obe(t,e){AK(t,e),e.add(t)}function _g(t,e,n){AK(t,e),e.set(t,n)}function AK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Eg(t,e,n){return(e=Ibe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ibe(t){var e=Dbe(t,"string");return typeof e=="symbol"?e:e+""}function Dbe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bo(t,e){return t.get(rw(t,e))}function Ec(t,e,n){return t.set(rw(t,e),n),n}function rw(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ZL=new WeakMap,JT=new WeakMap,ej=new WeakMap,Nm=new WeakMap,Bd=new WeakMap,JL=new WeakMap,e5=new WeakMap,iw=new WeakMap,TR=new WeakSet;class Hbe{constructor(e){Obe(this,TR),Eg(this,"hot",void 0),Eg(this,"eventManager",void 0),Eg(this,"settings",void 0),Eg(this,"THEAD",void 0),Eg(this,"TBODY",void 0),Eg(this,"_wt",void 0),Eg(this,"activeWt",void 0),_g(this,ZL,0),_g(this,JT,0),Eg(this,"postponedAdjustElementsSize",!1),_g(this,ej,!1),_g(this,Nm,void 0),_g(this,Bd,void 0),_g(this,JL,0),_g(this,e5,0),_g(this,iw,null),this.hot=e,this.eventManager=new Sc(this.hot),this.settings=this.hot.getSettings(),this.createElements(),this.registerEvents(),this.initializeWalkontable()}render(){if(!this.hot.isRenderSuspended()){const e=this.hot.forceFullRender;this.hot.runHooks("beforeRender",e),this._wt.draw(!e),rw(TR,this,$be).call(this),this.postponedAdjustElementsSize&&(this.postponedAdjustElementsSize=!1,this.adjustElementsSize(!0)),this.hot.runHooks("afterRender",e),this.hot.forceFullRender=!1}}adjustElementsSize(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)?this._wt.wtOverlays.adjustElementsSize():this.postponedAdjustElementsSize=!0}getCellAtCoords(e,n){const r=this._wt.getCell(e,n);return r<0?null:r}scrollViewport(e,n,r){return this._wt.scrollViewport(e,n,r)}scrollViewportHorizontally(e,n){return this._wt.scrollViewportHorizontally(e,n)}scrollViewportVertically(e,n){return this._wt.scrollViewportVertically(e,n)}createElements(){const{rootElement:e,rootDocument:n}=this.hot,r=e.getAttribute("style");r&&e.setAttribute("data-originalstyle",r),st(e,"handsontable"),Ec(Bd,this,n.createElement("TABLE")),st(bo(Bd,this),"htCore"),this.hot.getSettings().tableClassName&&st(bo(Bd,this),this.hot.getSettings().tableClassName),this.settings.ariaTags&&(gn(bo(Bd,this),[bm()]),gn(e,[qme(),QY(-1),ET(this.hot.countCols()),mpe()])),this.THEAD=n.createElement("THEAD"),bo(Bd,this).appendChild(this.THEAD),this.TBODY=n.createElement("TBODY"),bo(Bd,this).appendChild(this.TBODY),this.hot.table=bo(Bd,this),this.hot.container.insertBefore(bo(Bd,this),this.hot.container.firstChild)}registerEvents(){const{rootWrapperElement:e,rootElement:n,rootDocument:r,selection:i,rootWindow:s}=this.hot,a=r.documentElement;this.eventManager.addEventListener(n,"mousedown",h=>{Ec(ej,this,!0),this.isTextSelectionAllowed(h.target)||(mG(s),h.preventDefault(),s.focus())}),this.eventManager.addEventListener(n,"mouseup",()=>{Ec(ej,this,!1)}),this.eventManager.addEventListener(n,"mousemove",h=>{bo(ej,this)&&!this.isTextSelectionAllowed(h.target)&&(this.settings.fragmentSelection&&mG(s),h.preventDefault())}),this.eventManager.addEventListener(a,"keyup",h=>{i.isInProgress()&&!h.shiftKey&&i.finish()}),this.eventManager.addEventListener(a,"mouseup",h=>{i.isInProgress()&&dL(h)&&i.finish(),Ec(Nm,this,!1);const m=vG(r.activeElement);LT(r.activeElement)&&!m||(m||!i.isSelected()&&!i.isSelectedByAnyHeader()&&!(e??n).contains(h.target)&&!O0(h))&&this.hot.unlisten()}),this.eventManager.addEventListener(a,"contextmenu",h=>{i.isInProgress()&&O0(h)&&(i.finish(),Ec(Nm,this,!1))}),this.eventManager.addEventListener(a,"touchend",()=>{i.isInProgress()&&i.finish(),Ec(Nm,this,!1)}),this.eventManager.addEventListener(a,"mousedown",h=>{const m=h.target,g=h.x||h.clientX,y=h.y||h.clientY;let x=h.target;if(bo(Nm,this)||!n||!this.hot.view)return;const{holder:C}=this._wt.wtTable;if(x===C){const M=go(r);if(r.elementFromPoint(g+M,y)!==C||r.elementFromPoint(g,y+M)!==C)return}else for(;x!==a;){if(x===null){if(h.isTargetWebComponent)break;return}if(x===n)return;x=x.parentNode}(typeof this.settings.outsideClickDeselects=="function"?this.settings.outsideClickDeselects(m):this.settings.outsideClickDeselects)?this.hot.deselectCell():this.hot.destroyEditor(!1,!1)});let u=wg(s);for(;u!==null;)this.eventManager.addEventListener(u.document.documentElement,"click",()=>{this.hot.unlisten()}),u=wg(u);this.eventManager.addEventListener(bo(Bd,this),"selectstart",h=>{this.settings.fragmentSelection||LT(h.target)||h.preventDefault()})}translateFromRenderableToVisualCoords(e){let{row:n,col:r}=e;return this.hot._createCellCoords(...this.translateFromRenderableToVisualIndex(n,r))}translateFromRenderableToVisualIndex(e,n){let r=e>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(e):e,i=n>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(n):n;return r===null&&(r=e),i===null&&(i=n),[r,i]}countRenderableIndexes(e,n){const r=Math.min(e.getNotTrimmedIndexesLength(),n),i=e.getNearestNotHiddenIndex(r-1,-1);return i===null?0:e.getRenderableFromVisualIndex(i)+1}countRenderableColumns(){return this.countRenderableIndexes(this.hot.columnIndexMapper,this.settings.maxCols)}countRenderableRows(){return this.countRenderableIndexes(this.hot.rowIndexMapper,this.settings.maxRows)}countNotHiddenRowIndexes(e,n){return this.countNotHiddenIndexes(e,n,this.hot.rowIndexMapper,this.countRenderableRows())}countNotHiddenColumnIndexes(e,n){return this.countNotHiddenIndexes(e,n,this.hot.columnIndexMapper,this.countRenderableColumns())}countNotHiddenIndexes(e,n,r,i){if(isNaN(e)||e<0)return 0;const s=r.getNearestNotHiddenIndex(e,n),a=r.getRenderableFromVisualIndex(s);if(!Number.isInteger(a))return 0;let u=0;return n<0?u=a+1:n>0&&(u=i-a),u}countNotHiddenFixedColumnsStart(){const e=this.hot.countCols(),n=Math.min(parseInt(this.settings.fixedColumnsStart,10),e)-1;return this.countNotHiddenColumnIndexes(n,-1)}countNotHiddenFixedRowsTop(){const e=this.hot.countRows(),n=Math.min(parseInt(this.settings.fixedRowsTop,10),e)-1;return this.countNotHiddenRowIndexes(n,-1)}countNotHiddenFixedRowsBottom(){const e=this.hot.countRows(),n=Math.max(e-parseInt(this.settings.fixedRowsBottom,10),0);return this.countNotHiddenRowIndexes(n,1)}countRenderableColumnsInRange(e,n){let r=0;for(let i=e;i<=n;i++)this.hot.columnIndexMapper.getRenderableFromVisualIndex(i)!==null&&(r+=1);return r}countRenderableRowsInRange(e,n){let r=0;for(let i=e;i<=n;i++)this.hot.rowIndexMapper.getRenderableFromVisualIndex(i)!==null&&(r+=1);return r}addClassNameToLicenseElement(e){var n;const r=(n=this.hot.rootElement.parentNode)===null||n===void 0?void 0:n.querySelector(".hot-display-license-info");r&&st(r,e)}removeClassNameFromLicenseElement(e){var n;const r=(n=this.hot.rootElement.parentNode)===null||n===void 0?void 0:n.querySelector(".hot-display-license-info");r&&cn(r,e)}isMainTableNotFullyCoveredByOverlays(){const e=this.countNotHiddenFixedRowsTop()+this.countNotHiddenFixedRowsBottom(),n=this.countNotHiddenFixedColumnsStart();return this.hot.countRenderedRows()>e&&this.hot.countRenderedCols()>n}initializeWalkontable(){const e={ariaTags:this.settings.ariaTags,rtlMode:this.hot.isRtl(),externalRowCalculator:this.hot.getPlugin("autoRowSize")&&this.hot.getPlugin("autoRowSize").isEnabled(),table:bo(Bd,this),isDataViewInstance:()=>Vd(this.hot),preventOverflow:()=>this.settings.preventOverflow,preventWheel:()=>this.settings.preventWheel,viewportColumnRenderingThreshold:()=>this.settings.viewportColumnRenderingThreshold,viewportRowRenderingThreshold:()=>this.settings.viewportRowRenderingThreshold,data:(s,a)=>this.hot.getDataAtCell(...this.translateFromRenderableToVisualIndex(s,a)),totalRows:()=>this.countRenderableRows(),totalColumns:()=>this.countRenderableColumns(),fixedColumnsStart:()=>this.countNotHiddenFixedColumnsStart(),fixedRowsTop:()=>this.countNotHiddenFixedRowsTop(),fixedRowsBottom:()=>this.countNotHiddenFixedRowsBottom(),shouldRenderInlineStartOverlay:()=>this.settings.fixedColumnsStart>0||e.rowHeaders().length>0,shouldRenderTopOverlay:()=>this.settings.fixedRowsTop>0||e.columnHeaders().length>0,shouldRenderBottomOverlay:()=>this.settings.fixedRowsBottom>0,minSpareRows:()=>this.settings.minSpareRows,renderAllRows:this.settings.renderAllRows,renderAllColumns:this.settings.renderAllColumns,rowHeaders:()=>{const s=[];return this.hot.hasRowHeaders()&&s.push((a,u)=>{const h=a>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(a):a;this.appendRowHeader(h,u)}),this.hot.runHooks("afterGetRowHeaderRenderers",s),Ec(JT,this,s.length),this.hot.getSettings().ariaTags&&rw(TR,this,OK).call(this)===this.hot.countCols()&&rw(TR,this,Lbe).call(this,bo(JT,this)),s},columnHeaders:()=>{const s=[];return this.hot.hasColHeaders()&&s.push((a,u)=>{const h=a>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(a):a;this.appendColHeader(h,u)}),this.hot.runHooks("afterGetColumnHeaderRenderers",s),Ec(ZL,this,s.length),s},columnWidth:s=>{const a=this.hot.columnIndexMapper.getVisualFromRenderableIndex(s);return this.hot.getColWidth(a===null?s:a)},rowHeight:s=>{const a=this.hot.rowIndexMapper.getVisualFromRenderableIndex(s);return this.hot.getRowHeight(a===null?s:a)},rowHeightByOverlayName:(s,a)=>{const u=this.hot.rowIndexMapper.getVisualFromRenderableIndex(s),h=u===null?s:u;return this.hot.runHooks("modifyRowHeightByOverlayName",this.hot.getRowHeight(h),h,a)},cellRenderer:(s,a,u)=>{const[h,m]=this.translateFromRenderableToVisualIndex(s,a),g=this.hot.runHooks("modifyGetCellCoords",h,m,!1,"meta");let y=h,x=m;Array.isArray(g)&&([y,x]=g);const C=this.hot.getCellMeta(y,x),E=this.hot.colToProp(x);let M=this.hot.getDataAtRowProp(y,E);this.hot.hasHook("beforeValueRender")&&(M=this.hot.runHooks("beforeValueRender",M,C));const j=this.hot.getCellRenderer(C);let L=M;typeof C.valueFormatter=="function"?L=C.valueFormatter(L,C):typeof j.valueFormatter=="function"&&(L=j.valueFormatter.call(C,L,C)),this.hot.runHooks("beforeRenderer",u,h,m,E,M,C);const D=[this.hot,u,h,m,E,L,C];j(...D),C._isBaseRendererCalled||this.hot.getCellRenderer({renderer:"base"})(...D),this.hot.runHooks("afterRenderer",u,h,m,E,M,C),C._isBaseRendererCalled=!1},selections:this.hot.selection.highlight,hideBorderOnMouseDownOver:()=>this.settings.fragmentSelection,onWindowResize:()=>{this.hot&&!this.hot.isDestroyed&&this.hot.refreshDimensions()},onContainerElementResize:()=>{this.hot&&!this.hot.isDestroyed&&P0(this.hot.rootElement)&&this.hot.refreshDimensions()},onCellMouseDown:(s,a,u,h)=>{const m=this.translateFromRenderableToVisualCoords(a),g={row:!1,column:!1,cell:!1};this.hot.listen(),this.activeWt=h,Ec(Nm,this,!0),Ec(iw,this,{x:s.clientX,y:s.clientY}),this.hot.runHooks("beforeOnCellMouseDown",s,m,u,g),!A0(s)&&(XL(s,{coords:m,selection:this.hot.selection,controller:g,cellCoordsFactory:(y,x)=>this.hot._createCellCoords(y,x)}),this.hot.runHooks("afterOnCellMouseDown",s,m,u),this.activeWt=this._wt)},onCellContextMenu:(s,a,u,h)=>{const m=this.translateFromRenderableToVisualCoords(a);this.activeWt=h,Ec(Nm,this,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",s,m,u),!A0(s)&&(this.hot.runHooks("afterOnCellContextMenu",s,m,u),this.activeWt=this._wt)},onCellMouseOut:(s,a,u,h)=>{const m=this.translateFromRenderableToVisualCoords(a);this.activeWt=h,this.hot.runHooks("beforeOnCellMouseOut",s,m,u),!A0(s)&&(this.hot.runHooks("afterOnCellMouseOut",s,m,u),this.activeWt=this._wt)},onCellMouseOver:(s,a,u,h)=>{const m=this.translateFromRenderableToVisualCoords(a),g={row:!1,column:!1,cell:!1};this.activeWt=h,this.hot.runHooks("beforeOnCellMouseOver",s,m,u,g),!A0(s)&&(bo(Nm,this)&&(!bo(iw,this)||bo(iw,this).x!==s.clientX||bo(iw,this).y!==s.clientY)&&XL(s,{coords:m,selection:this.hot.selection,controller:g,cellCoordsFactory:(y,x)=>this.hot._createCellCoords(y,x)}),this.hot.runHooks("afterOnCellMouseOver",s,m,u),this.activeWt=this._wt,Ec(iw,this,null))},onCellMouseUp:(s,a,u,h)=>{const m=this.translateFromRenderableToVisualCoords(a);this.activeWt=h,this.hot.runHooks("beforeOnCellMouseUp",s,m,u),!(A0(s)||this.hot.isDestroyed)&&(XL(s,{coords:m,selection:this.hot.selection,cellRangeMapper:oge(this.hot,"cellRangeMapper")}),this.hot.runHooks("afterOnCellMouseUp",s,m,u),this.activeWt=this._wt)},onCellCornerMouseDown:s=>{s.preventDefault(),this.hot.runHooks("afterOnCellCornerMouseDown",s)},onCellCornerDblClick:s=>{s.preventDefault(),this.hot.runHooks("afterOnCellCornerDblClick",s)},beforeDraw:(s,a)=>this.beforeRender(s,a),onDraw:s=>this.afterRender(s),onBeforeViewportScrollVertically:(s,a)=>{const u=this.hot.rowIndexMapper,h=s<0;let m=s;return!h&&(m=u.getVisualFromRenderableIndex(s),m===null)?s:(m=this.hot.runHooks("beforeViewportScrollVertically",m,a),this.hot.runHooks("beforeViewportScroll"),h?m:u.getRenderableFromVisualIndex(m))},onBeforeViewportScrollHorizontally:(s,a)=>{const u=this.hot.columnIndexMapper,h=s<0;let m=s;return!h&&(m=u.getVisualFromRenderableIndex(s),m===null)?s:(m=this.hot.runHooks("beforeViewportScrollHorizontally",m,a),this.hot.runHooks("beforeViewportScroll"),h?m:u.getRenderableFromVisualIndex(m))},onScrollVertically:()=>{this.hot.runHooks("afterScrollVertically"),this.hot.runHooks("afterScroll")},onScrollHorizontally:()=>{this.hot.runHooks("afterScrollHorizontally"),this.hot.runHooks("afterScroll")},onBeforeRemoveCellClassNames:()=>this.hot.runHooks("beforeRemoveCellClassNames"),onBeforeHighlightingRowHeader:(s,a,u)=>{const h=this.hot.rowIndexMapper,m=s<0;let g=s;m||(g=h.getVisualFromRenderableIndex(s));const y=this.hot.runHooks("beforeHighlightingRowHeader",g,a,u);return m?y:h.getRenderableFromVisualIndex(h.getNearestNotHiddenIndex(y,1))},onBeforeHighlightingColumnHeader:(s,a,u)=>{const h=this.hot.columnIndexMapper,m=s<0;let g=s;m||(g=h.getVisualFromRenderableIndex(s));const y=this.hot.runHooks("beforeHighlightingColumnHeader",g,a,u);return m?y:h.getRenderableFromVisualIndex(h.getNearestNotHiddenIndex(y,1))},onAfterDrawSelection:(s,a,u)=>{let h;const[m,g]=this.translateFromRenderableToVisualIndex(s,a),y=this.hot.selection.getSelectedRange();if(y.size()>0){const C=y.peekByIndex(u??0);h=[C.from.row,C.from.col,C.to.row,C.to.col]}return this.hot.runHooks("afterDrawSelection",m,g,h,u)},onBeforeDrawBorders:(s,a)=>{const[u,h,m,g]=s,y=[this.hot.rowIndexMapper.getVisualFromRenderableIndex(u),this.hot.columnIndexMapper.getVisualFromRenderableIndex(h),this.hot.rowIndexMapper.getVisualFromRenderableIndex(m),this.hot.columnIndexMapper.getVisualFromRenderableIndex(g)];return this.hot.runHooks("beforeDrawBorders",y,a)},onBeforeTouchScroll:()=>this.hot.runHooks("beforeTouchScroll"),onAfterMomentumScroll:()=>this.hot.runHooks("afterMomentumScroll"),onModifyRowHeaderWidth:s=>this.hot.runHooks("modifyRowHeaderWidth",s),onModifyGetCellCoords:(s,a,u,h)=>{const m=this.hot.rowIndexMapper,g=this.hot.columnIndexMapper,y=a>=0?g.getVisualFromRenderableIndex(a):a,x=s>=0?m.getVisualFromRenderableIndex(s):s,C=this.hot.runHooks("modifyGetCellCoords",x,y,u,h);if(Array.isArray(C)){const[E,M,j,L]=C;return[E>=0?m.getRenderableFromVisualIndex(m.getNearestNotHiddenIndex(E,1)):E,M>=0?g.getRenderableFromVisualIndex(g.getNearestNotHiddenIndex(M,1)):M,j>=0?m.getRenderableFromVisualIndex(m.getNearestNotHiddenIndex(j,-1)):j,L>=0?g.getRenderableFromVisualIndex(g.getNearestNotHiddenIndex(L,-1)):L]}},onModifyGetCoordsElement:(s,a)=>{const u=this.hot.rowIndexMapper,h=this.hot.columnIndexMapper,m=a>=0?h.getVisualFromRenderableIndex(a):a,g=s>=0?u.getVisualFromRenderableIndex(s):s,y=this.hot.runHooks("modifyGetCoordsElement",g,m);if(Array.isArray(y)){const[x,C]=y;return[x>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(x,1)):x,C>=0?h.getRenderableFromVisualIndex(h.getNearestNotHiddenIndex(C,1)):C]}},viewportRowCalculatorOverride:s=>{let a=this.settings.viewportRowRenderingOffset;if(a==="auto"&&this.settings.fixedRowsTop&&(a=10),a>0||a==="auto"){const u=this.countRenderableRows(),h=s.startRow,m=s.endRow;if(typeof a=="number")s.startRow=Math.max(h-a,0),s.endRow=Math.min(m+a,u-1);else if(a==="auto"){const g=Math.max(1,Math.ceil(m/u*12));s.startRow=Math.max(h-g,0),s.endRow=Math.min(m+g,u-1)}}this.hot.runHooks("afterViewportRowCalculatorOverride",s)},viewportColumnCalculatorOverride:s=>{let a=this.settings.viewportColumnRenderingOffset;if(a==="auto"&&this.settings.fixedColumnsStart&&(a=10),a>0||a==="auto"){const u=this.countRenderableColumns(),h=s.startColumn,m=s.endColumn;if(typeof a=="number"&&(s.startColumn=Math.max(h-a,0),s.endColumn=Math.min(m+a,u-1)),a==="auto"){const g=Math.max(1,Math.ceil(m/u*6));s.startColumn=Math.max(h-g,0),s.endColumn=Math.min(m+g,u-1)}}this.hot.runHooks("afterViewportColumnCalculatorOverride",s)},rowHeaderWidth:()=>this.settings.rowHeaderWidth,columnHeaderHeight:()=>{const s=this.hot.runHooks("modifyColumnHeaderHeight");return this.settings.columnHeaderHeight||s},stylesHandler:()=>this.hot.stylesHandler};this.hot.runHooks("beforeInitWalkontable",e),this._wt=new qL(e),this.activeWt=this._wt;const n=this._wt.wtTable.spreader,{width:r,height:i}=this.hot.rootElement.getBoundingClientRect();this.setLastSize(r,i),this.eventManager.addEventListener(n,"mousedown",s=>{s.target===n&&s.which===3&&s.stopPropagation()}),this.eventManager.addEventListener(n,"contextmenu",s=>{s.target===n&&s.which===3&&s.stopPropagation()}),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"click",()=>{this.settings.observeDOMVisibility&&this._wt.drawInterrupted&&this.hot.render()})}isTextSelectionAllowed(e){var n,r;if(LT(e))return!0;const i=T0(e,this._wt.wtTable.spreader);if(this.settings.fragmentSelection===!0&&i)return!0;const s=(n=(r=this.hot.getSelectedRangeActive())===null||r===void 0?void 0:r.isSingleCell())!==null&&n!==void 0?n:!1;return!!(this.settings.fragmentSelection==="cell"&&s&&i||!this.settings.fragmentSelection&&this.isCellEdited()&&s)}isMouseDown(){return bo(Nm,this)}isCellEdited(){const e=this.hot.getActiveEditor();return e&&e.isOpened()}beforeRender(e,n){e&&this.hot.runHooks("beforeViewRender",this.hot.forceFullRender,n)}afterRender(e){e&&this.hot.runHooks("afterViewRender",this.hot.forceFullRender)}appendRowHeader(e,n){if(n.firstChild){const r=n.firstChild;if(!Dn(r,"relative")){Bh(n),this.appendRowHeader(e,n);return}this.updateCellHeader(r.querySelector(".rowHeader"),e,this.hot.getRowHeader)}else{const{rootDocument:r,getRowHeader:i}=this.hot,s=r.createElement("div"),a=r.createElement("span");s.className="relative",a.className="rowHeader",this.updateCellHeader(a,e,i),s.appendChild(a),n.appendChild(s)}this.hot.runHooks("afterGetRowHeader",e,n)}appendColHeader(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hot.getColHeader,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;const s=()=>{const a=e>=0?this.hot.getColumnMeta(e).headerClassName:null;return a?a.split(" "):[]};if(n.firstChild){const a=n.firstChild;Dn(a,"relative")?(this.updateCellHeader(a.querySelector(".colHeader"),e,r,i),a.className="",st(a,["relative",...s()])):(Bh(n),this.appendColHeader(e,n,r,i))}else{const{rootDocument:a}=this.hot,u=a.createElement("div"),h=a.createElement("span"),m=s();u.classList.add("relative",...m),h.className="colHeader",this.settings.ariaTags&&(gn(u,...bm()),gn(h,...bm())),this.updateCellHeader(h,e,r,i),u.appendChild(h),n.appendChild(u)}this.hot.runHooks("afterGetColHeader",e,n,i)}updateCellHeader(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=n;const a=this._wt.wtOverlays.getParentOverlay(e)||this._wt;e.parentNode&&(Dn(e,"colHeader")?s=a.wtTable.columnFilter.sourceToRendered(n):Dn(e,"rowHeader")&&(s=a.wtTable.rowFilter.sourceToRendered(n))),s>-1?M0(e,r(n,i),this.hot.getSettings().sanitizer):(Cg(e," "),st(e,"cornerHeader"))}maximumVisibleElementWidth(e){const r=this._wt.wtViewport.getWorkspaceWidth()-e;return r>0?r:0}maximumVisibleElementHeight(e){const r=this._wt.wtViewport.getWorkspaceHeight()-e;return r>0?r:0}setLastSize(e,n){Ec(JL,this,e),Ec(e5,this,n)}getLastSize(){return{width:bo(JL,this),height:bo(e5,this)}}getFirstRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedRow());return e.getNearestNotHiddenIndex(n??0,1)}getLastRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedRow());return e.getNearestNotHiddenIndex(n??this.hot.countRows()-1,-1)}getFirstRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedColumn());return e.getNearestNotHiddenIndex(n??0,1)}getLastRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedColumn());return e.getNearestNotHiddenIndex(n??this.hot.countCols()-1,-1)}getFirstFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleRow())}getLastFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleRow())}getFirstFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleColumn())}getLastFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleColumn())}getFirstPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleRow())}getLastPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleRow())}getFirstPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleColumn())}getLastPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleColumn())}getColumnHeadersCount(){return bo(ZL,this)}getRowHeadersCount(){return bo(JT,this)}getViewportWidth(){return this._wt.wtViewport.getViewportWidth()}getWorkspaceWidth(){return this._wt.wtViewport.getWorkspaceWidth()}getViewportHeight(){return this._wt.wtViewport.getViewportHeight()}getWorkspaceHeight(){return this._wt.wtViewport.getWorkspaceHeight()}getElementOverlayName(e){var n;return((n=this._wt.wtOverlays.getParentOverlay(e))!==null&&n!==void 0?n:this._wt).wtTable.name}getOverlayByName(e){return this._wt.getOverlayByName(e)}getActiveOverlayName(){return this._wt.activeOverlayName}isVisible(){return this._wt.wtTable.isVisible()}hasVerticalScroll(){return this._wt.wtViewport.hasVerticalScroll()}hasHorizontalScroll(){return this._wt.wtViewport.hasHorizontalScroll()}getTableWidth(){return this._wt.wtTable.getWidth()}getTableHeight(){return this._wt.wtTable.getHeight()}getTotalTableWidth(){return this._wt.wtTable.getTotalWidth()}getTotalTableHeight(){return this._wt.wtTable.getTotalHeight()}getTableOffset(){return this._wt.wtViewport.getWorkspaceOffset()}getTableScrollPosition(){return{left:this._wt.wtTable.holder.scrollLeft,top:this._wt.wtTable.holder.scrollTop}}setTableScrollPosition(e){this._wt.wtTable.holder.scrollLeft=e.left,this._wt.wtTable.holder.scrollTop=e.top}getRowHeaderWidth(){return this._wt.wtViewport.getRowHeaderWidth()}getColumnHeaderHeight(){return this._wt.wtViewport.getColumnHeaderHeight()}isVerticallyScrollableByWindow(){return this._wt.wtViewport.isVerticallyScrollableByWindow()}isHorizontallyScrollableByWindow(){return this._wt.wtViewport.isHorizontallyScrollableByWindow()}destroy(){this._wt.destroy(),this.eventManager.destroy()}}function OK(){return parseInt(this.hot.rootElement.getAttribute(ET()[0]),10)}function Lbe(t){const e=rw(TR,this,OK).call(this)+t;gn(this.hot.rootElement,...ET(e))}function $be(){const t=this.hot.rootElement;this.hasVerticalScroll()?st(t,"htHasScrollY"):cn(t,"htHasScrollY"),this.isVerticallyScrollableByWindow()?st(t,"htVerticallyScrollableByWindow"):cn(t,"htVerticallyScrollableByWindow"),this.hasHorizontalScroll()?st(t,"htHasScrollX"):cn(t,"htHasScrollX"),this.isHorizontallyScrollableByWindow()?st(t,"htHorizontallyScrollableByWindow"):cn(t,"htHorizontallyScrollableByWindow")}const IK="ABCDEFGHIJKLMNOPQRSTUVWXYZ".length;function Fbe(t){let e=t+1,n="",r;for(;e>0;)r=(e-1)%IK,n=String.fromCharCode(65+r)+n,e=parseInt((e-r)/IK,10);return n}function DK(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=t;const r=[];return(!Array.isArray(t)||!Array.isArray(t[0]))&&(n=[t]),n.forEach((i,s)=>{Array.isArray(i)?i.forEach((a,u)=>{r.push([s+e,u,a])}):Object.keys(i).forEach(a=>{r.push([s+e,a,i[a]])})}),r}function HK(t){let e=0;return Array.isArray(t)&&(t[0]&&Array.isArray(t[0])?e=t[0].length:t[0]&&nn(t[0])&&(e=tL(t[0]))),e}function zbe(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>Array.isArray(e)))}function Vbe(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object"&&!Array.isArray(e)&&e!==null))}function LK(t,e,n){return(e=Bbe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bbe(t){var e=Wbe(t,"string");return typeof e=="symbol"?e:e+""}function Wbe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Y0{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;LK(this,"indexedValues",[]),LK(this,"initValueOrFn",void 0),this.initValueOrFn=e}getValues(){return this.indexedValues}getValueAtIndex(e){const n=this.indexedValues;if(e<n.length)return n[e]}setValues(e){this.indexedValues=e.slice(),this.runLocalHooks("change")}setValueAtIndex(e,n){return e<this.indexedValues.length?(this.indexedValues[e]=n,this.runLocalHooks("change"),!0):!1}clear(){this.setDefaultValues()}getLength(){return this.getValues().length}setDefaultValues(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.indexedValues.length;this.indexedValues.length=0,ri(this.initValueOrFn)?En(e-1,n=>this.indexedValues.push(this.initValueOrFn(n))):En(e-1,()=>this.indexedValues.push(this.initValueOrFn)),this.runLocalHooks("change")}init(e){return this.setDefaultValues(e),this.runLocalHooks("init"),this}insert(){this.runLocalHooks("change")}remove(){this.runLocalHooks("change")}destroy(){this.clearLocalHooks(),this.indexedValues=null,this.initValueOrFn=null}}ci(Y0,vo);function t5(t,e,n,r){const i=n.length?n[0]:void 0;return[...t.slice(0,i),...n.map((s,a)=>ri(r)?r(s,a):r),...i===void 0?[]:t.slice(i)]}function n5(t,e){return E0(t,(n,r)=>e.includes(r)===!1)}class Ng extends Y0{insert(e,n){this.indexedValues=t5(this.indexedValues,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){this.indexedValues=n5(this.indexedValues,e),super.remove(e)}}class tj extends Ng{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getHiddenIndexes(){return xc(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}function r5(t,e,n){return[...t.slice(0,e),...n,...t.slice(e)]}function jR(t,e){return E0(t,n=>e.includes(n)===!1)}function i5(t,e){return di(t,n=>n-e.filter(r=>r<n).length)}function s5(t,e){const n=e[0],r=e.length;return di(t,i=>i>=n?i+r:i)}function Ube(t,e,n){return(e=Ybe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ybe(t){var e=Gbe(t,"string");return typeof e=="symbol"?e:e+""}function Gbe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class nj extends Y0{constructor(){super(...arguments),Ube(this,"orderOfIndexes",[])}getValues(){return this.orderOfIndexes.map(e=>this.indexedValues[e])}setValues(e){this.orderOfIndexes=[...Array(e.length).keys()],super.setValues(e)}setValueAtIndex(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.orderOfIndexes.length;return e<this.indexedValues.length?(this.indexedValues[e]=n,this.orderOfIndexes.includes(e)===!1&&this.orderOfIndexes.splice(r,0,e),this.runLocalHooks("change"),!0):!1}clearValue(e){this.orderOfIndexes=jR(this.orderOfIndexes,[e]),ri(this.initValueOrFn)?super.setValueAtIndex(e,this.initValueOrFn(e)):super.setValueAtIndex(e,this.initValueOrFn)}getLength(){return this.orderOfIndexes.length}setDefaultValues(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.indexedValues.length;this.orderOfIndexes.length=0,super.setDefaultValues(e)}insert(e,n){this.indexedValues=t5(this.indexedValues,e,n,this.initValueOrFn),this.orderOfIndexes=s5(this.orderOfIndexes,n),super.insert(e,n)}remove(e){this.indexedValues=n5(this.indexedValues,e),this.orderOfIndexes=jR(this.orderOfIndexes,e),this.orderOfIndexes=i5(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map(e=>[e,this.getValueAtIndex(e)])}}class MR extends Ng{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getTrimmedIndexes(){return xc(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}const $K=new Map([["indexesSequence",{getListWithInsertedItems:r5,getListWithRemovedItems:jR}],["physicallyIndexed",{getListWithInsertedItems:t5,getListWithRemovedItems:n5}]]),FK=t=>($K.has(t)===!1&>(`Alter strategy with ID '${t}' does not exist.`),$K.get(t));class zK extends Y0{constructor(){super(e=>e)}insert(e,n){const r=s5(this.indexedValues,n);this.indexedValues=r5(r,e,n),super.insert(e,n)}remove(e){const n=jR(this.indexedValues,e);this.indexedValues=i5(n,e),super.remove(e)}}const VK=new Map([["hiding",tj],["index",Y0],["linkedPhysicalIndexToValue",nj],["physicalIndexToValue",Ng],["trimming",MR]]);function Kbe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return VK.has(t)||gt(`The provided map type ("${t}") does not exist.`),new(VK.get(t))(e)}function qbe(t,e,n){return(e=Xbe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xbe(t){var e=Qbe(t,"string");return typeof e=="symbol"?e:e+""}function Qbe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class o5{constructor(){qbe(this,"collection",new Map)}register(e,n){this.collection.has(e)===!1&&(this.collection.set(e,n),n.addLocalHook("change",()=>this.runLocalHooks("change",n)))}unregister(e){const n=this.collection.get(e);Lt(n)&&(n.destroy(),this.collection.delete(e),this.runLocalHooks("change",n))}unregisterAll(){this.collection.forEach((e,n)=>this.unregister(n)),this.collection.clear()}get(e){return ls(e)?Array.from(this.collection.values()):this.collection.get(e)}getLength(){return this.collection.size}removeFromEvery(e){this.collection.forEach(n=>{n.remove(e)})}insertToEvery(e,n){this.collection.forEach(r=>{r.insert(e,n)})}initEvery(e){this.collection.forEach(n=>{n.init(e)})}}ci(o5,vo);function a5(t,e,n){return(e=Zbe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zbe(t){var e=Jbe(t,"string");return typeof e=="symbol"?e:e+""}function Jbe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class BK extends o5{constructor(e,n){super(),a5(this,"mergedValuesCache",[]),a5(this,"aggregationFunction",void 0),a5(this,"fallbackValue",void 0),this.aggregationFunction=e,this.fallbackValue=n}getMergedValues(){if((arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0)return this.mergedValuesCache;if(this.getLength()===0)return[];const n=di(this.get(),s=>s.getValues()),r=[],i=Lt(n[0])&&n[0].length||0;for(let s=0;s<i;s+=1){const a=[];for(let u=0;u<this.getLength();u+=1)a.push(n[u][s]);r.push(a)}return di(r,this.aggregationFunction)}getMergedValueAtIndex(e,n){const r=this.getMergedValues(n)[e];return Lt(r)?r:this.fallbackValue}updateCache(){this.mergedValuesCache=this.getMergedValues(!1)}}function eye(t,e,n){tye(t,e),e.set(t,n)}function tye(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nye(t,e,n){return t.set(WK(t,e),n),n}function rye(t,e){return t.get(WK(t,e))}function WK(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var l5=new WeakMap;class UK{constructor(){eye(this,l5,[])}subscribe(e){return this.addLocalHook("change",e),this._write(rye(l5,this)),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){nye(l5,this,e)}}ci(UK,vo);function YK(t,e){const n=[];let r=0,i=0;for(;r<t.length&&i<e.length;r++,i++)t[r]!==e[i]&&n.push({op:"replace",index:i,oldValue:t[r],newValue:e[i]});for(;r<e.length;r++)n.push({op:"insert",index:r,oldValue:void 0,newValue:e[r]});for(;i<t.length;i++)n.push({op:"remove",index:i,oldValue:t[i],newValue:void 0});return n}function PR(t,e,n){iye(t,e),e.set(t,n)}function iye(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function td(t,e){return t.get(GK(t,e))}function rj(t,e,n){return t.set(GK(t,e),n),n}function GK(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ij=new WeakMap,AR=new WeakMap,sj=new WeakMap,oj=new WeakMap,aj=new WeakMap;class sye{constructor(){let{initialIndexValue:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};PR(this,ij,new Set),PR(this,AR,[]),PR(this,sj,[]),PR(this,oj,!1),PR(this,aj,!1),rj(aj,this,e??!1)}createObserver(){const e=new UK;return td(ij,this).add(e),e.addLocalHook("unsubscribe",()=>{td(ij,this).delete(e)}),e._writeInitialChanges(YK(td(AR,this),td(sj,this))),e}emit(e){let n=td(sj,this);(!td(oj,this)||td(AR,this).length!==e.length)&&(e.length===0?e=new Array(n.length).fill(td(aj,this)):rj(AR,this,new Array(e.length).fill(td(aj,this))),td(oj,this)||(rj(oj,this,!0),n=td(AR,this)));const r=YK(n,e);td(ij,this).forEach(i=>i._write(r)),rj(sj,this,e)}}function Wl(t,e,n){return(e=oye(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oye(t){var e=aye(t,"string");return typeof e=="symbol"?e:e+""}function aye(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class c5{constructor(){Wl(this,"indexesSequence",new zK),Wl(this,"trimmingMapsCollection",new BK(e=>e.some(n=>n===!0),!1)),Wl(this,"hidingMapsCollection",new BK(e=>e.some(n=>n===!0),!1)),Wl(this,"variousMapsCollection",new o5),Wl(this,"hidingChangesObservable",new sye({initialIndexValue:!1})),Wl(this,"notTrimmedIndexesCache",[]),Wl(this,"notHiddenIndexesCache",[]),Wl(this,"isBatched",!1),Wl(this,"indexesSequenceChanged",!1),Wl(this,"indexesChangeSource",void 0),Wl(this,"trimmedIndexesChanged",!1),Wl(this,"hiddenIndexesChanged",!1),Wl(this,"renderablePhysicalIndexesCache",[]),Wl(this,"fromPhysicalToVisualIndexesCache",new Map),Wl(this,"fromVisualToRenderableIndexesCache",new Map),this.indexesSequence.addLocalHook("change",()=>{this.indexesSequenceChanged=!0,this.updateCache(),this.runLocalHooks("indexesSequenceChange",this.indexesChangeSource),this.runLocalHooks("change",this.indexesSequence,null)}),this.trimmingMapsCollection.addLocalHook("change",e=>{this.trimmedIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.trimmingMapsCollection)}),this.hidingMapsCollection.addLocalHook("change",e=>{this.hiddenIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.hidingMapsCollection)}),this.variousMapsCollection.addLocalHook("change",e=>{this.runLocalHooks("change",e,this.variousMapsCollection)})}suspendOperations(){this.isBatched=!0}resumeOperations(){this.isBatched=!1,this.updateCache()}createChangesObserver(e){return e!=="hiding"&>(`Unsupported index map type "${e}".`),this.hidingChangesObservable.createObserver()}createAndRegisterIndexMap(e,n,r){return this.registerMap(e,Kbe(n,r))}registerMap(e,n){(this.trimmingMapsCollection.get(e)||this.hidingMapsCollection.get(e)||this.variousMapsCollection.get(e))&>(`Map with name "${e}" has been already registered.`),n instanceof MR?this.trimmingMapsCollection.register(e,n):n instanceof tj?this.hidingMapsCollection.register(e,n):this.variousMapsCollection.register(e,n);const r=this.getNumberOfIndexes();return r>0&&n.init(r),n}unregisterMap(e){this.trimmingMapsCollection.unregister(e),this.hidingMapsCollection.unregister(e),this.variousMapsCollection.unregister(e)}unregisterAll(){this.trimmingMapsCollection.unregisterAll(),this.hidingMapsCollection.unregisterAll(),this.variousMapsCollection.unregisterAll()}getPhysicalFromVisualIndex(e){const n=this.notTrimmedIndexesCache[e];return Lt(n)?n:null}getPhysicalFromRenderableIndex(e){const n=this.renderablePhysicalIndexesCache[e];return Lt(n)?n:null}getVisualFromPhysicalIndex(e){const n=this.fromPhysicalToVisualIndexesCache.get(e);return Lt(n)?n:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){const n=this.fromVisualToRenderableIndexesCache.get(e);return Lt(n)?n:null}getNearestNotHiddenIndex(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(this.getPhysicalFromVisualIndex(e)===null)return null;if(this.fromVisualToRenderableIndexesCache.has(e))return e;const s=Array.from(this.fromVisualToRenderableIndexesCache.keys());let a=-1;return n>0?a=s.findIndex(u=>u>e):a=s.reverse().findIndex(u=>u<e),a===-1?r?this.getNearestNotHiddenIndex(e,-n,!1):null:s[a]}initToLength(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getNumberOfIndexes();this.notTrimmedIndexesCache=[...new Array(e).keys()],this.notHiddenIndexesCache=[...new Array(e).keys()],this.suspendOperations(),this.indexesChangeSource="init",this.indexesSequence.init(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.initEvery(e),this.resumeOperations(),this.suspendOperations(),this.hidingMapsCollection.initEvery(e),this.variousMapsCollection.initEvery(e),this.resumeOperations(),this.runLocalHooks("init")}fitToLength(e){const n=this.getNumberOfIndexes();if(e<n){const r=[...Array(this.getNumberOfIndexes()-e).keys()].map(i=>i+e);this.removeIndexes(r)}else this.insertIndexes(n,e-n)}getIndexesSequence(){return this.indexesSequence.getValues()}setIndexesSequence(e){this.indexesChangeSource===void 0&&(this.indexesChangeSource="update"),this.indexesSequence.setValues(e),this.indexesChangeSource==="update"&&(this.indexesChangeSource=void 0)}getNotTrimmedIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notTrimmedIndexesCache:this.getIndexesSequence().filter(r=>this.isTrimmed(r)===!1)}getNotTrimmedIndexesLength(){return this.getNotTrimmedIndexes().length}getNotHiddenIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notHiddenIndexesCache:this.getIndexesSequence().filter(r=>this.isHidden(r)===!1)}getNotHiddenIndexesLength(){return this.getNotHiddenIndexes().length}getRenderableIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.renderablePhysicalIndexesCache:this.getNotTrimmedIndexes().filter(r=>this.isHidden(r)===!1)}getRenderableIndexesLength(){return this.getRenderableIndexes().length}getNumberOfIndexes(){return this.getIndexesSequence().length}moveIndexes(e,n){typeof e=="number"&&(e=[e]);const r=di(e,m=>this.getPhysicalFromVisualIndex(m)),i=this.getNotTrimmedIndexesLength(),s=e.length,a=jR(this.getIndexesSequence(),r),u=a.filter(m=>this.isTrimmed(m)===!1);let h=a.indexOf(u[u.length-1])+1;if(n+s<i){const m=u[n];h=a.indexOf(m)}this.indexesChangeSource="move",this.setIndexesSequence(r5(a,h,r)),this.indexesChangeSource=void 0}isTrimmed(e){return this.trimmingMapsCollection.getMergedValueAtIndex(e)}isHidden(e){return this.hidingMapsCollection.getMergedValueAtIndex(e)}insertIndexes(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"start";const i=this.getNotTrimmedIndexes()[e],s=Lt(i)?i:this.getNumberOfIndexes(),a=this.getIndexesSequence().includes(i)?this.getIndexesSequence().indexOf(i):this.getNumberOfIndexes(),u=di(new Array(n).fill(s),(m,g)=>m+g);this.suspendOperations(),this.indexesChangeSource="insert",this.indexesSequence.insert(a,u),this.indexesChangeSource=void 0;const h=r==="end"?u.map(m=>m+1):u;this.trimmingMapsCollection.insertToEvery(a,h),this.hidingMapsCollection.insertToEvery(a,h),this.variousMapsCollection.insertToEvery(a,h),this.resumeOperations()}removeIndexes(e){this.suspendOperations(),this.indexesChangeSource="remove",this.indexesSequence.remove(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.removeFromEvery(e),this.hidingMapsCollection.removeFromEvery(e),this.variousMapsCollection.removeFromEvery(e),this.resumeOperations()}updateCache(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const n=this.indexesSequenceChanged||this.trimmedIndexesChanged||this.hiddenIndexesChanged;(e===!0||this.isBatched===!1&&n===!0)&&(this.trimmingMapsCollection.updateCache(),this.hidingMapsCollection.updateCache(),this.notTrimmedIndexesCache=this.getNotTrimmedIndexes(!1),this.notHiddenIndexesCache=this.getNotHiddenIndexes(!1),this.renderablePhysicalIndexesCache=this.getRenderableIndexes(!1),this.cacheFromPhysicalToVisualIndexes(),this.cacheFromVisualToRenderableIndexes(),this.hiddenIndexesChanged&&this.hidingChangesObservable.emit(this.hidingMapsCollection.getMergedValues()),this.runLocalHooks("cacheUpdated",{indexesSequenceChanged:this.indexesSequenceChanged,trimmedIndexesChanged:this.trimmedIndexesChanged,hiddenIndexesChanged:this.hiddenIndexesChanged}),this.indexesSequenceChanged=!1,this.trimmedIndexesChanged=!1,this.hiddenIndexesChanged=!1)}cacheFromPhysicalToVisualIndexes(){const e=this.getNotTrimmedIndexesLength();this.fromPhysicalToVisualIndexesCache.clear();for(let n=0;n<e;n+=1){const r=this.getPhysicalFromVisualIndex(n);this.fromPhysicalToVisualIndexesCache.set(r,n)}}cacheFromVisualToRenderableIndexes(){const e=this.getRenderableIndexesLength();this.fromVisualToRenderableIndexesCache.clear();for(let n=0;n<e;n+=1){const r=this.getPhysicalFromRenderableIndex(n),i=this.getVisualFromPhysicalIndex(r);this.fromVisualToRenderableIndexesCache.set(i,n)}}}ci(c5,vo);function lye(t,e){return Mr(e,(n,r)=>{ls(t[r])&&(t[r]=n)}),t}function KK(t){const n=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/.exec(t);return n?`${n[1].toLowerCase()}-${n[2].toUpperCase()}`:t}function qK(t){Lt(t)&&sL(Jr`Language with code "${t}" was not found. You should register particular language\x20 before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.`)}function cye(t,e){return Array.isArray(t)&&Number.isInteger(e)?t[e]:t}function XK(t,e){return Array.isArray(t)?t.map(n=>XK(n,e)):RT(t,e)}const{register:uye,getValues:dye}=ou("phraseFormatters");function QK(t,e){uye(t,e)}function hye(){return dye()}QK("pluralize",cye),QK("substitute",XK);const u5="Common:",lj=`${u5}ok`,d5=`${u5}cancel`,ZK="ContextMenu:items",yr=ZK,h5=`${yr}.noItems`,f5=`${yr}.insertRowAbove`,m5=`${yr}.insertRowBelow`,p5=`${yr}.insertColumnOnTheLeft`,g5=`${yr}.insertColumnOnTheRight`,v5=`${yr}.removeRow`,b5=`${yr}.removeColumn`,y5=`${yr}.undo`,x5=`${yr}.redo`,cj=`${yr}.readOnly`,w5=`${yr}.clearColumn`,C5=`${yr}.copy`,S5=`${yr}.copyWithHeaders`,R5=`${yr}.copyWithGroupHeaders`,_5=`${yr}.copyHeadersOnly`,E5=`${yr}.cut`,N5=`${yr}.freezeColumn`,k5=`${yr}.unfreezeColumn`,T5=`${yr}.mergeCells`,j5=`${yr}.unmergeCells`,M5=`${yr}.addComment`,P5=`${yr}.editComment`,A5=`${yr}.removeComment`,O5=`${yr}.readOnlyComment`,I5=`${yr}.align`,D5=`${yr}.align.left`,H5=`${yr}.align.center`,L5=`${yr}.align.right`,$5=`${yr}.align.justify`,F5=`${yr}.align.top`,z5=`${yr}.align.middle`,V5=`${yr}.align.bottom`,B5=`${yr}.borders`,W5=`${yr}.borders.top`,U5=`${yr}.borders.right`,Y5=`${yr}.borders.bottom`,G5=`${yr}.borders.left`,K5=`${yr}.borders.remove`,q5=`${yr}.nestedHeaders.insertChildRow`,X5=`${yr}.nestedHeaders.detachFromParent`,Q5=`${yr}.hideColumn`,Z5=`${yr}.showColumn`,J5=`${yr}.hideRow`,e4=`${yr}.showRow`,Ul="Filters:",Os=`${Ul}conditions`,uj=`${Os}.none`,t4=`${Os}.isEmpty`,n4=`${Os}.isNotEmpty`,r4=`${Os}.isEqualTo`,i4=`${Os}.isNotEqualTo`,s4=`${Os}.beginsWith`,o4=`${Os}.endsWith`,a4=`${Os}.contains`,l4=`${Os}.doesNotContain`,fye=`${Os}.byValue`,c4=`${Os}.greaterThan`,u4=`${Os}.greaterThanOrEqualTo`,d4=`${Os}.lessThan`,h4=`${Os}.lessThanOrEqualTo`,OR=`${Os}.isBetween`,f4=`${Os}.isNotBetween`,IR=`${Os}.after`,DR=`${Os}.before`,dj=`${Os}.today`,hj=`${Os}.tomorrow`,fj=`${Os}.yesterday`,m4=`${Ul}labels.filterByCondition`,p4=`${Ul}labels.filterByValue`,g4=`${Ul}labels.conjunction`,mj=`${Ul}labels.disjunction`,pj=`${Ul}values.blankCells`,v4=`${Ul}buttons.selectAll`,b4=`${Ul}buttons.clear`,y4=`${Ul}buttons.ok`,x4=`${Ul}buttons.cancel`,w4=`${Ul}buttons.placeholder.search`,C4=`${Ul}buttons.placeholder.value`,S4=`${Ul}buttons.placeholder.secondValue`,Kh="Pagination:",R4=`${Kh}section.pagination`,_4=`${Kh}.pageSize.auto`,gj=`${Kh}section.pageSize`,E4=`${Kh}section.counter`,N4=`${Kh}section.navigation`,k4=`${Kh}firstPage`,T4=`${Kh}prevPage`,j4=`${Kh}nextPage`,M4=`${Kh}lastPage`,P4="CheckboxRenderer:",A4=`${P4}checked`,O4=`${P4}unchecked`,JK="Loading:",I4=`${JK}title`,sw="EmptyDataState:",D4=`${sw}title`,H4=`${sw}description`,L4=`${sw}title.filters`,$4=`${sw}description.filters`,F4=`${sw}buttons.filters.reset`,mye=Object.freeze(Object.defineProperty({__proto__:null,CANCEL:d5,CHECKBOX_CHECKED:A4,CHECKBOX_RENDERER_NAMESPACE:P4,CHECKBOX_UNCHECKED:O4,COMMON_NAMESPACE:u5,CONTEXTMENU_ITEMS_ADD_COMMENT:M5,CONTEXTMENU_ITEMS_ALIGNMENT:I5,CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM:V5,CONTEXTMENU_ITEMS_ALIGNMENT_CENTER:H5,CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY:$5,CONTEXTMENU_ITEMS_ALIGNMENT_LEFT:D5,CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE:z5,CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT:L5,CONTEXTMENU_ITEMS_ALIGNMENT_TOP:F5,CONTEXTMENU_ITEMS_BORDERS:B5,CONTEXTMENU_ITEMS_BORDERS_BOTTOM:Y5,CONTEXTMENU_ITEMS_BORDERS_LEFT:G5,CONTEXTMENU_ITEMS_BORDERS_RIGHT:U5,CONTEXTMENU_ITEMS_BORDERS_TOP:W5,CONTEXTMENU_ITEMS_CLEAR_COLUMN:w5,CONTEXTMENU_ITEMS_COPY:C5,CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY:_5,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS:R5,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS:S5,CONTEXTMENU_ITEMS_CUT:E5,CONTEXTMENU_ITEMS_EDIT_COMMENT:P5,CONTEXTMENU_ITEMS_FREEZE_COLUMN:N5,CONTEXTMENU_ITEMS_HIDE_COLUMN:Q5,CONTEXTMENU_ITEMS_HIDE_ROW:J5,CONTEXTMENU_ITEMS_INSERT_LEFT:p5,CONTEXTMENU_ITEMS_INSERT_RIGHT:g5,CONTEXTMENU_ITEMS_MERGE_CELLS:T5,CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD:X5,CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD:q5,CONTEXTMENU_ITEMS_NO_ITEMS:h5,CONTEXTMENU_ITEMS_READ_ONLY:cj,CONTEXTMENU_ITEMS_READ_ONLY_COMMENT:O5,CONTEXTMENU_ITEMS_REDO:x5,CONTEXTMENU_ITEMS_REMOVE_BORDERS:K5,CONTEXTMENU_ITEMS_REMOVE_COLUMN:b5,CONTEXTMENU_ITEMS_REMOVE_COMMENT:A5,CONTEXTMENU_ITEMS_REMOVE_ROW:v5,CONTEXTMENU_ITEMS_ROW_ABOVE:f5,CONTEXTMENU_ITEMS_ROW_BELOW:m5,CONTEXTMENU_ITEMS_SHOW_COLUMN:Z5,CONTEXTMENU_ITEMS_SHOW_ROW:e4,CONTEXTMENU_ITEMS_UNDO:y5,CONTEXTMENU_ITEMS_UNFREEZE_COLUMN:k5,CONTEXTMENU_ITEMS_UNMERGE_CELLS:j5,CONTEXT_MENU_ITEMS_NAMESPACE:ZK,EMPTY_DATA_STATE_BUTTONS_FILTERS_RESET:F4,EMPTY_DATA_STATE_DESCRIPTION:H4,EMPTY_DATA_STATE_DESCRIPTION_FILTERS:$4,EMPTY_DATA_STATE_NAMESPACE:sw,EMPTY_DATA_STATE_TITLE:D4,EMPTY_DATA_STATE_TITLE_FILTERS:L4,FILTERS_BUTTONS_CANCEL:x4,FILTERS_BUTTONS_CLEAR:b4,FILTERS_BUTTONS_OK:y4,FILTERS_BUTTONS_PLACEHOLDER_SEARCH:w4,FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE:S4,FILTERS_BUTTONS_PLACEHOLDER_VALUE:C4,FILTERS_BUTTONS_SELECT_ALL:v4,FILTERS_CONDITIONS_AFTER:IR,FILTERS_CONDITIONS_BEFORE:DR,FILTERS_CONDITIONS_BEGINS_WITH:s4,FILTERS_CONDITIONS_BETWEEN:OR,FILTERS_CONDITIONS_BY_VALUE:fye,FILTERS_CONDITIONS_CONTAINS:a4,FILTERS_CONDITIONS_EMPTY:t4,FILTERS_CONDITIONS_ENDS_WITH:o4,FILTERS_CONDITIONS_EQUAL:r4,FILTERS_CONDITIONS_GREATER_THAN:c4,FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL:u4,FILTERS_CONDITIONS_LESS_THAN:d4,FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL:h4,FILTERS_CONDITIONS_NAMESPACE:Os,FILTERS_CONDITIONS_NONE:uj,FILTERS_CONDITIONS_NOT_BETWEEN:f4,FILTERS_CONDITIONS_NOT_CONTAIN:l4,FILTERS_CONDITIONS_NOT_EMPTY:n4,FILTERS_CONDITIONS_NOT_EQUAL:i4,FILTERS_CONDITIONS_TODAY:dj,FILTERS_CONDITIONS_TOMORROW:hj,FILTERS_CONDITIONS_YESTERDAY:fj,FILTERS_DIVS_FILTER_BY_CONDITION:m4,FILTERS_DIVS_FILTER_BY_VALUE:p4,FILTERS_LABELS_CONJUNCTION:g4,FILTERS_LABELS_DISJUNCTION:mj,FILTERS_NAMESPACE:Ul,FILTERS_VALUES_BLANK_CELLS:pj,LOADING_NAMESPACE:JK,LOADING_TITLE:I4,OK:lj,PAGINATION_COUNTER_SECTION:E4,PAGINATION_FIRST_PAGE:k4,PAGINATION_LAST_PAGE:M4,PAGINATION_NAMESPACE:Kh,PAGINATION_NAV_SECTION:N4,PAGINATION_NEXT_PAGE:j4,PAGINATION_PAGE_SIZE_AUTO:_4,PAGINATION_PAGE_SIZE_SECTION:gj,PAGINATION_PREV_PAGE:T4,PAGINATION_SECTION:R4},Symbol.toStringTag,{value:"Module"}));/** * @preserve * Authors: Handsoncode * Last updated: Nov 15, 2017 * * Description: Definition file for English - United States language-country. */const eq={languageCode:"en-US",[lj]:"OK",[d5]:"Cancel",[h5]:"No available options",[f5]:"Insert row above",[m5]:"Insert row below",[p5]:"Insert column left",[g5]:"Insert column right",[v5]:["Remove row","Remove rows"],[b5]:["Remove column","Remove columns"],[y5]:"Undo",[x5]:"Redo",[cj]:"Read only",[w5]:"Clear column",[I5]:"Alignment",[D5]:"Left",[H5]:"Center",[L5]:"Right",[$5]:"Justify",[F5]:"Top",[z5]:"Middle",[V5]:"Bottom",[N5]:"Freeze column",[k5]:"Unfreeze column",[B5]:"Borders",[W5]:"Top",[U5]:"Right",[Y5]:"Bottom",[G5]:"Left",[K5]:"Remove border(s)",[M5]:"Add comment",[P5]:"Edit comment",[A5]:"Delete comment",[O5]:"Read-only comment",[T5]:"Merge cells",[j5]:"Unmerge cells",[C5]:"Copy",[S5]:["Copy with header","Copy with headers"],[R5]:["Copy with group header","Copy with group headers"],[_5]:["Copy header only","Copy headers only"],[E5]:"Cut",[q5]:"Insert child row",[X5]:"Detach from parent",[Q5]:["Hide column","Hide columns"],[Z5]:["Show column","Show columns"],[J5]:["Hide row","Hide rows"],[e4]:["Show row","Show rows"],[uj]:"None",[t4]:"Is empty",[n4]:"Is not empty",[r4]:"Is equal to",[i4]:"Is not equal to",[s4]:"Begins with",[o4]:"Ends with",[a4]:"Contains",[l4]:"Does not contain",[c4]:"Greater than",[u4]:"Greater than or equal to",[d4]:"Less than",[h4]:"Less than or equal to",[OR]:"Is between",[f4]:"Is not between",[IR]:"After",[DR]:"Before",[dj]:"Today",[hj]:"Tomorrow",[fj]:"Yesterday",[pj]:"Blank cells",[m4]:"Filter by condition",[p4]:"Filter by value",[g4]:"And",[mj]:"Or",[v4]:"Select all",[b4]:"Clear",[y4]:"OK",[x4]:"Cancel",[w4]:"Search",[C4]:"Value",[S4]:"Second value",[R4]:"Pagination",[gj]:"Page size",[_4]:"Auto",[E4]:"[start] - [end] of [total]",[N4]:"Page [currentPage] of [totalPages]",[k4]:"Go to first page",[T4]:"Go to previous page",[j4]:"Go to next page",[M4]:"Go to last page",[A4]:"Checked",[O4]:"Unchecked",[I4]:"Loading...",[D4]:"No data available",[H4]:"There’s nothing to display yet.",[L4]:"No results found",[$4]:"It looks like your current filters are hiding all results.",[F4]:"Reset filters"},pye=mye,z4=eq.languageCode,{register:gye,getItem:tq,hasItem:vye,getValues:bye}=ou("languagesDictionaries");nq(eq);function nq(t,e){let n=t,r=e;return nn(t)&&(r=t,n=r.languageCode),yye(n,r),gye(n,ea(r)),ea(r)}function yye(t,e){t!==z4&&lye(e,tq(z4))}function rq(t){return V4(t)?ea(tq(t)):null}function V4(t){return vye(t)}function xye(){return bye()}function iq(t,e,n){const r=rq(t);if(r===null)return null;const i=r[e];if(ls(i))return null;const s=wye(i,n);return Array.isArray(s)?s[0]:s}function wye(t,e){return hye().reduce((n,r)=>r(n,e),t)}function Cye(t){let e=KK(t);return V4(e)||(e=z4,qK(t)),e}function Sye(t,e,n){return(e=Rye(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rye(t){var e=_ye(t,"string");return typeof e=="symbol"?e:e+""}function _ye(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class km extends gK{constructor(e,n){super(e,null),Sye(this,"visualCellRange",null),this.visualCellRange=n||null,this.commit()}add(e){return this.visualCellRange===null?this.visualCellRange=this.settings.createCellRange(e):this.visualCellRange.expand(e),this}clear(){return this.visualCellRange=null,super.clear()}trimToVisibleCellsRangeOnly(e){let{from:n,to:r}=e,i=this.getNearestNotHiddenCoords(n,1),s=this.getNearestNotHiddenCoords(r,-1);return i===null||s===null?null:((i.row>s.row||i.col>s.col)&&(i=n,s=r),this.settings.createCellRange(i,i,s))}getNearestNotHiddenCoords(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:n;const i=this.getNearestNotHiddenIndex(this.settings.rowIndexMapper,e.row,n);if(i===null)return null;const s=this.getNearestNotHiddenIndex(this.settings.columnIndexMapper,e.col,r);return s===null?null:this.settings.createCellCoords(i,s)}getNearestNotHiddenIndex(e,n,r){return n<0?n:e.getNearestNotHiddenIndex(n,r)}commit(){if(this.visualCellRange===null)return this;const e=this.trimToVisibleCellsRangeOnly(this.visualCellRange);return e===null?this.cellRange=null:this.cellRange=this.createRenderableCellRange(e.from,e.to),this}syncWith(e){const n=e.from.clone().normalize(),r=e.getVerticalDirection()==="N-S"?1:-1,i=e.getHorizontalDirection()==="W-E"?1:-1,s=this.settings.visualToRenderableCoords(this.visualCellRange.highlight);let a=null;if((s===null||s.col===null||s.row===null)&&(a=this.getNearestNotHiddenCoords(n,r,i)),a!==null&&e.overlaps(a)){const u=e.highlight.clone();if(u.row>=0&&(u.row=a.row),u.col>=0&&(u.col=a.col),this.cellRange===null){const h=this.settings.visualToRenderableCoords(u);this.cellRange=this.settings.createCellRange(h)}e.setHighlight(u)}return this.settings.selectionType==="focus"&&s!==null&&a===null&&e.setHighlight(this.visualCellRange.highlight),this}getCorners(){const{from:e,to:n}=this.cellRange;return[Math.min(e.row,n.row),Math.min(e.col,n.col),Math.max(e.row,n.row),Math.max(e.col,n.col)]}getVisualCorners(){const e=this.settings.renderableToVisualCoords(this.cellRange.getTopStartCorner()),n=this.settings.renderableToVisualCoords(this.cellRange.getBottomEndCorner());return[e.row,e.col,n.row,n.col]}createRenderableCellRange(e,n){const r=this.settings.visualToRenderableCoords(e),i=this.settings.visualToRenderableCoords(n);return r.row===null||r.col===null||i.row===null||i.col===null?null:this.settings.createCellRange(r,r,i)}}function B4(t){let{activeHeaderClassName:e,...n}=t;return new km({className:e,...n,selectionType:vK})}function Eye(t){let{areaCornerVisible:e,...n}=t;return new km({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:e},...n,selectionType:FL})}function Nye(t){let{...e}=t;return new km({className:"highlight",...e,selectionType:FL})}function kye(t){let{columnClassName:e,...n}=t;return new km({className:e,...n,selectionType:nbe})}function Tye(t){let{cellCornerVisible:e,...n}=t;return new km({className:"current",headerAttributes:[ZH()],border:{width:2,color:"#4b89ff",cornerVisible:e},...n,selectionType:KT})}function jye(t){let{border:e,visualCellRange:n,...r}=t;return new km({...e,...r,selectionType:rbe},n)}function Mye(t){let{...e}=t;return new km({className:"fill",border:{width:1,color:"#ff0000"},...e,selectionType:ebe})}function sq(t){let{headerClassName:e,...n}=t;return new km({className:e,...n,selectionType:$L})}function Pye(t){let{rowClassName:e,...n}=t;return new km({className:e,...n,selectionType:tbe})}function Aye(t,e){Oye(t,e),e.add(t)}function Oye(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Nc(t,e,n){return(e=Iye(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Iye(t){var e=Dye(t,"string");return typeof e=="symbol"?e:e+""}function Dye(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Tm(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var qh=new WeakSet;class Hye{constructor(e){Aye(this,qh),Nc(this,"options",void 0),Nc(this,"layerLevel",0),Nc(this,"focus",void 0),Nc(this,"fill",void 0),Nc(this,"layeredAreas",new Map),Nc(this,"areas",new Map),Nc(this,"rowHeaders",new Map),Nc(this,"columnHeaders",new Map),Nc(this,"activeRowHeaders",new Map),Nc(this,"activeColumnHeaders",new Map),Nc(this,"activeCornerHeaders",new Map),Nc(this,"rowHighlights",new Map),Nc(this,"columnHighlights",new Map),Nc(this,"customSelections",[]),this.options=e,this.focus=Tye(e),this.fill=Mye(e)}isEnabledFor(e,n){let r=e;e===KT&&(r="current");let i=this.options.disabledCellSelection(n.row,n.col);return typeof i=="string"&&(i=[i]),i===!1||Array.isArray(i)&&!i.includes(r)}useLayerLevel(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.layerLevel=e,this}getFocus(){return this.focus}getFill(){return this.fill}createLayeredArea(){return Tm(qh,this,jm).call(this,this.layeredAreas,Eye)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return Tm(qh,this,jm).call(this,this.areas,Nye)}getAreas(){return[...this.areas.values()]}createRowHeader(){return Tm(qh,this,jm).call(this,this.rowHeaders,sq)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return Tm(qh,this,jm).call(this,this.columnHeaders,sq)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return Tm(qh,this,jm).call(this,this.activeRowHeaders,B4)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return Tm(qh,this,jm).call(this,this.activeColumnHeaders,B4)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return Tm(qh,this,jm).call(this,this.activeCornerHeaders,B4)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return Tm(qh,this,jm).call(this,this.rowHighlights,Pye)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return Tm(qh,this,jm).call(this,this.columnHighlights,kye)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push(jye({...this.options,...e}))}clear(){this.focus.clear(),this.fill.clear(),Te(this.areas.values(),e=>void e.clear()),Te(this.layeredAreas.values(),e=>void e.clear()),Te(this.rowHeaders.values(),e=>void e.clear()),Te(this.columnHeaders.values(),e=>void e.clear()),Te(this.activeRowHeaders.values(),e=>void e.clear()),Te(this.activeColumnHeaders.values(),e=>void e.clear()),Te(this.activeCornerHeaders.values(),e=>void e.clear()),Te(this.rowHighlights.values(),e=>void e.clear()),Te(this.columnHighlights.values(),e=>void e.clear())}[Symbol.iterator](){return[this.focus,this.fill,...this.areas.values(),...this.layeredAreas.values(),...this.rowHeaders.values(),...this.columnHeaders.values(),...this.activeRowHeaders.values(),...this.activeColumnHeaders.values(),...this.activeCornerHeaders.values(),...this.rowHighlights.values(),...this.columnHighlights.values(),...this.customSelections][Symbol.iterator]()}}function jm(t,e){const n=this.layerLevel;if(t.has(n))return t.get(n);const r=e({layerLevel:n,...this.options});return t.set(n,r),r}function oq(t,e,n){return(e=Lye(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lye(t){var e=$ye(t,"string");return typeof e=="symbol"?e:e+""}function $ye(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class W4{constructor(e){oq(this,"ranges",[]),oq(this,"createCellRange",void 0),this.createCellRange=e}isEmpty(){return this.size()===0}set(e){return this.clear(),this.ranges.push(this.createCellRange(e)),this}add(e){return this.ranges.push(this.createCellRange(e)),this}push(e){return this.ranges.push(e),this}pop(){return this.ranges.pop()}current(){return this.peekByIndex(this.size()-1)}previous(){return this.peekByIndex(this.size()-2)}includes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>!0;return this.ranges.some((r,i)=>r.includes(e)&&n(r,i))}findAll(e){const n=[];return this.ranges.forEach((r,i)=>{r.isEqual(e)&&n.push({range:r,layer:i})}),n}remove(e){return this.ranges=this.ranges.filter(n=>!e.some(r=>r.isEqual(n))),this}removeLayers(e){return this.ranges=this.ranges.filter((n,r)=>!e.includes(r)),this}clear(){return this.ranges.length=0,this}size(){return this.ranges.length}clone(){const e=new W4(this.createCellRange);return e.ranges=this.ranges.map(n=>n.clone()),e}map(e){return this.ranges=this.ranges.map((n,r)=>e(n,r)),this}peekByIndex(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n;return e>=0&&e<this.size()&&(n=this.ranges[e]),n}[Symbol.iterator](){return this.ranges[Symbol.iterator]()}}function Fye(t,e){aq(t,e),e.add(t)}function zye(t,e,n){return(e=Vye(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vye(t){var e=Bye(t,"string");return typeof e=="symbol"?e:e+""}function Bye(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function U4(t,e,n){aq(t,e),e.set(t,n)}function aq(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Oo(t,e){return t.get(yi(t,e))}function ow(t,e,n){return t.set(yi(t,e),n),n}function yi(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Mm=new WeakMap,G0=new WeakMap,au=new WeakMap,Ri=new WeakSet;class Y4{constructor(e,n){Fye(this,Ri),U4(this,Mm,void 0),U4(this,G0,0),U4(this,au,{x:0,y:0}),zye(this,"tableApi",void 0),ow(Mm,this,e),this.tableApi=n}setActiveLayerIndex(e){ow(G0,this,e)}getCurrentSelection(){return Oo(Mm,this).peekByIndex(Oo(G0,this))}transformStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;ow(au,this,this.calculateOffset());const i=this.tableApi.createCellCoords(e,n);let s=this.getCurrentSelection().highlight;const a=this.tableApi.visualToRenderableCoords(s);let u=0,h=0;if(this.runLocalHooks("beforeTransformStart",i),a.row!==null&&a.col!==null){let{width:m,height:g}=yi(Ri,this,G4).call(this);const{row:y,col:x}=yi(Ri,this,dq).call(this,s),C=this.tableApi.fixedRowsBottom(),E=this.tableApi.minSpareRows(),M=this.tableApi.minSpareCols(),j=this.tableApi.autoWrapRow(),L=this.tableApi.autoWrapCol(),D=this.tableApi.createCellCoords(y+i.row,x+i.col);if(D.row>=g){const V=Cc(r&&E>0&&C===0),F=D.col+1,B=F>=m,te=this.tableApi.createCellCoords(D.row-g,B?F-m:F);if(this.runLocalHooks("beforeColumnWrap",V,yi(Ri,this,aw).call(this,te),B),V.value)this.runLocalHooks("insertRowRequire",this.countRenderableRows());else if(L){if(this.shouldSwitchSelectionLayer()&&B&&Oo(Mm,this).size()>1){yi(Ri,this,lq).call(this);const ve=yi(Ri,this,vj).call(this,"forward");ve!==null&&te.assign(ve)}D.assign(te)}}else if(D.row<0){const V=Cc(L),F=D.col-1,B=F<0,te=this.tableApi.createCellCoords(g+D.row,B?m+F:F);if(this.runLocalHooks("beforeColumnWrap",V,yi(Ri,this,aw).call(this,te),B),L){if(this.shouldSwitchSelectionLayer()&&B&&Oo(Mm,this).size()>1){yi(Ri,this,cq).call(this);const ve=yi(Ri,this,vj).call(this,"backward");ve!==null&&te.assign(ve)}D.assign(te)}}if({width:m,height:g}=yi(Ri,this,G4).call(this),D.col>=m){const V=Cc(r&&M>0),F=D.row+1,B=F>=g,te=this.tableApi.createCellCoords(B?F-g:F,D.col-m);if(this.runLocalHooks("beforeRowWrap",V,yi(Ri,this,aw).call(this,te),B),V.value)this.runLocalHooks("insertColRequire",this.countRenderableColumns());else if(j){if(this.shouldSwitchSelectionLayer()&&B&&Oo(Mm,this).size()>1){yi(Ri,this,lq).call(this);const ve=yi(Ri,this,vj).call(this,"forward");ve!==null&&te.assign(ve)}D.assign(te)}}else if(D.col<0){const V=Cc(j),F=D.row-1,B=F<0,te=this.tableApi.createCellCoords(B?g+F:F,m+D.col);if(this.runLocalHooks("beforeRowWrap",V,yi(Ri,this,aw).call(this,te),B),j){if(this.shouldSwitchSelectionLayer()&&B&&Oo(Mm,this).size()>1){yi(Ri,this,cq).call(this);const ve=yi(Ri,this,vj).call(this,"backward");ve!==null&&te.assign(ve)}D.assign(te)}}const{rowDir:z,colDir:H}=yi(Ri,this,uq).call(this,D);u=z,h=H,s=yi(Ri,this,aw).call(this,D)}return this.runLocalHooks("afterTransformStart",s,u,h),{selectionLayer:Oo(G0,this),visualCoords:s}}transformEnd(e,n){ow(au,this,this.calculateOffset());const r=this.tableApi.createCellCoords(e,n),i=this.getCurrentSelection(),s=this.tableApi.visualToRenderableCoords(i.highlight),a=yi(Ri,this,bj).call(this,i.to.row,i.from.row),u=yi(Ri,this,yj).call(this,i.to.col,i.from.col),h=i.to.clone();let m=0,g=0;if(this.runLocalHooks("beforeTransformEnd",r),s.row!==null&&s.col!==null&&a!==null&&u!==null){const{row:y,col:x}=yi(Ri,this,dq).call(this,i.highlight),C=this.tableApi.createCellCoords(a+r.row,u+r.col),E=i.getTopStartCorner(),M=i.getTopEndCorner(),j=i.getBottomEndCorner();if(r.col<0&&u>=x&&C.col<x){const H=C.col-x;C.col=yi(Ri,this,yj).call(this,E.col,M.col)+H}else if(r.col>0&&u<=x&&C.col>x){const H=yi(Ri,this,yj).call(this,M.col,E.col),V=Math.max(C.col-H,1);C.col=H+V}if(r.row<0&&a>=y&&C.row<y){const H=C.row-y;C.row=yi(Ri,this,bj).call(this,E.row,j.row)+H}else if(r.row>0&&a<=y&&C.row>y){const H=yi(Ri,this,bj).call(this,j.row,E.row),V=Math.max(C.row-H,1);C.row=H+V}const{rowDir:L,colDir:D}=yi(Ri,this,uq).call(this,C);m=L,g=D;const z=yi(Ri,this,aw).call(this,C);r.row===0&&r.col!==0?h.col=z.col:r.row!==0&&r.col===0?h.row=z.row:(h.row=z.row,h.col=z.col)}return this.runLocalHooks("afterTransformEnd",h,m,g),{selectionLayer:Oo(G0,this),visualCoords:h}}calculateOffset(){gt("`calculateOffset` is not implemented")}countRenderableRows(){gt("`countRenderableRows` is not implemented")}countRenderableColumns(){gt("`countRenderableColumns` is not implemented")}shouldSwitchSelectionLayer(){gt("`shouldSwitchSelectionLayer` is not implemented")}}function lq(){const t=Oo(G0,this)+1;this.setActiveLayerIndex(t>=Oo(Mm,this).size()?0:t),ow(au,this,this.calculateOffset())}function cq(){const t=Oo(G0,this)-1;this.setActiveLayerIndex(t<0?Oo(Mm,this).size()-1:t),ow(au,this,this.calculateOffset())}function uq(t){const{width:e,height:n}=yi(Ri,this,G4).call(this);let r=0,i=0;return t.row<0?(r=-1,t.row=0):t.row>0&&t.row>=n&&(r=1,t.row=n-1),t.col<0?(i=-1,t.col=0):t.col>0&&t.col>=e&&(i=1,t.col=e-1),{rowDir:r,colDir:i}}function G4(){return{width:Oo(au,this).x+this.countRenderableColumns(),height:Oo(au,this).y+this.countRenderableRows()}}function vj(t){if(!["forward","backward"].includes(t))return null;const e=this.getCurrentSelection().getTopStartCorner(),n=this.getCurrentSelection().getBottomEndCorner(),[r,i,s,a]=t==="forward"?[e.row,n.row,e.col,n.col]:[n.row,e.row,n.col,e.col],u=yi(Ri,this,bj).call(this,r,i),h=yi(Ri,this,yj).call(this,s,a);return u===null||h===null?null:this.tableApi.createCellCoords(u,h)}function bj(t,e){const n=this.tableApi.findFirstNonHiddenRenderableRow(t,e);return n===null?null:Oo(au,this).y+n}function yj(t,e){const n=this.tableApi.findFirstNonHiddenRenderableColumn(t,e);return n===null?null:Oo(au,this).x+n}function dq(t){const{row:e,col:n}=this.tableApi.visualToRenderableCoords(t);return(e===null||n===null)&>("Renderable coords are not visible."),this.tableApi.createCellCoords(Oo(au,this).y+e,Oo(au,this).x+n)}function aw(t){const e=t.clone();return e.col=t.col-Oo(au,this).x,e.row=t.row-Oo(au,this).y,this.tableApi.renderableToVisualCoords(e)}ci(Y4,vo);class Wye extends Y4{calculateOffset(){return{x:this.tableApi.navigableHeaders()?this.tableApi.countRowHeaders():0,y:this.tableApi.navigableHeaders()?this.tableApi.countColHeaders():0}}countRenderableRows(){return this.tableApi.countRenderableRows()}countRenderableColumns(){return this.tableApi.countRenderableColumns()}shouldSwitchSelectionLayer(){return!1}}class Uye extends Y4{calculateOffset(){const e=this.getCurrentSelection(),{row:n,col:r}=e.getOuterTopStartCorner(),i=this.tableApi.countRenderableColumnsInRange(0,r-1),s=this.tableApi.countRenderableRowsInRange(0,n-1),a=e.highlight.isHeader(),u=a?Math.abs(r):0,h=a?Math.abs(n):0;return{x:r<0?u:-i,y:n<0?h:-s}}countRenderableRows(){const e=this.getCurrentSelection();return this.tableApi.countRenderableRowsInRange(0,e.getOuterBottomEndCorner().row)}countRenderableColumns(){const e=this.getCurrentSelection();return this.tableApi.countRenderableColumnsInRange(0,e.getOuterBottomEndCorner().col)}transformEnd(){gt("`transformEnd` is not valid for focus selection use `transformStart` instead")}shouldSwitchSelectionLayer(){return!0}}const xj=0,wj=1,hq=2,K4=3,Yye=[K4,hq],Gye=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],q4=Symbol("root"),fq=Symbol("child");function lw(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:q4;e!==q4&&e!==fq&>("The second argument is used internally only and cannot be overwritten.");const n=Array.isArray(t),r=e===q4;let i=xj;if(n){const s=t[0];t.length===0?i=wj:r&&s instanceof Xx?i=K4:r&&Array.isArray(s)?i=lw(s,fq):t.length>=2&&t.length<=4&&!t.some((u,h)=>!Gye[h].includes(typeof u))&&(i=hq)}return i}function HR(t){let{createCellCoords:e,createCellRange:n,keepDirection:r=!1,propToCol:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Yye.includes(t)||gt("Unsupported selection ranges schema type was provided."),function(s){const a=t===K4;let u=a?s.from.row:s[0],h=a?s.from.col:s[1],m=a?s.to.row:s[2],g=a?s.to.col:s[3];if(typeof i=="function"&&(typeof h=="string"&&(h=i(h)),typeof g=="string"&&(g=i(g))),ls(m)&&(m=u),ls(g)&&(g=h),!r){const E=u,M=h,j=m,L=g;u=Math.min(E,j),h=Math.min(M,L),m=Math.max(E,j),g=Math.max(M,L)}const y=a?s.highlight.clone():e(u,h),x=e(u,h),C=e(m,g);return n(y,x,C)}}function Kye(t){const e=lw(t.getSelected());if(e===xj||e===wj)return[];const n=HR(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),r=new Set;Te(t.getSelected(),a=>{const{from:u,to:h}=n(a),m=Math.max(u.col,0),g=h.col-m+1;Te(Array.from(new Array(g),(y,x)=>m+x),y=>{r.has(y)||r.add(y)})});const i=Array.from(r).sort((a,u)=>a-u);return xc(i,(a,u,h,m)=>(h!==0&&u===m[h-1]+1?a[a.length-1][1]+=1:a.push([u,1]),a),[])}function qye(t){const e=lw(t.getSelected());if(e===xj||e===wj)return[];const n=HR(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),r=new Set;Te(t.getSelected(),a=>{const{from:u,to:h}=n(a),m=Math.max(u.row,0),g=h.row-m+1;Te(Array.from(new Array(g),(y,x)=>m+x),y=>{r.has(y)||r.add(y)})});const i=Array.from(r).sort((a,u)=>a-u);return xc(i,(a,u,h,m)=>(h!==0&&u===m[h-1]+1?a[a.length-1][1]+=1:a.push([u,1]),a),[])}function K0(t,e,n){Xye(t,e),e.set(t,n)}function Xye(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function q0(t,e,n){return(e=Qye(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qye(t){var e=Zye(t,"string");return typeof e=="symbol"?e:e+""}function Zye(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ys(t,e){return t.get(mq(t,e))}function lu(t,e,n){return t.set(mq(t,e),n),n}function mq(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var cu=new WeakMap,cw=new WeakMap,Cj=new WeakMap,kg=new WeakMap,Sj=new WeakMap,LR=new WeakMap,Rj=new WeakMap;class pq{constructor(e,n){var r=this;q0(this,"settings",void 0),q0(this,"tableProps",void 0),q0(this,"inProgress",!1),q0(this,"selectedRange",new W4((i,s,a)=>this.tableProps.createCellRange(i,s,a))),q0(this,"highlight",void 0),K0(this,cu,void 0),K0(this,cw,void 0),q0(this,"selectedByRowHeader",new Set),q0(this,"selectedByColumnHeader",new Set),K0(this,Cj,!1),K0(this,kg,!1),K0(this,Sj,"unknown"),K0(this,LR,-1),K0(this,Rj,0),this.settings=e,this.tableProps=n,this.highlight=new Hye({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[ZH()],rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,disabledCellSelection:(i,s)=>this.tableProps.isDisabledCellSelection(i,s),cellCornerVisible:function(){return r.isCellCornerVisible(...arguments)},areaCornerVisible:function(){return r.isAreaCornerVisible(...arguments)},visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),createCellCoords:(i,s)=>this.tableProps.createCellCoords(i,s),createCellRange:(i,s,a)=>this.tableProps.createCellRange(i,s,a)}),lu(cu,this,new Wye(this.selectedRange,{...this.tableProps,navigableHeaders:()=>e.navigableHeaders,fixedRowsBottom:()=>e.fixedRowsBottom,minSpareRows:()=>e.minSpareRows,minSpareCols:()=>e.minSpareCols,autoWrapRow:()=>e.autoWrapRow,autoWrapCol:()=>e.autoWrapCol})),lu(cw,this,new Uye(this.selectedRange,{...this.tableProps,navigableHeaders:()=>e.navigableHeaders,fixedRowsBottom:()=>0,minSpareRows:()=>0,minSpareCols:()=>0,autoWrapRow:()=>!0,autoWrapCol:()=>!0})),ys(cu,this).addLocalHook("beforeTransformStart",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return r.runLocalHooks("beforeModifyTransformStart",...s)}),ys(cu,this).addLocalHook("afterTransformStart",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return r.runLocalHooks("afterModifyTransformStart",...s)}),ys(cu,this).addLocalHook("beforeTransformEnd",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return r.runLocalHooks("beforeModifyTransformEnd",...s)}),ys(cu,this).addLocalHook("afterTransformEnd",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return r.runLocalHooks("afterModifyTransformEnd",...s)}),ys(cu,this).addLocalHook("insertRowRequire",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return r.runLocalHooks("insertRowRequire",...s)}),ys(cu,this).addLocalHook("insertColRequire",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return r.runLocalHooks("insertColRequire",...s)}),ys(cu,this).addLocalHook("beforeRowWrap",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return r.runLocalHooks("beforeRowWrap",...s)}),ys(cu,this).addLocalHook("beforeColumnWrap",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return r.runLocalHooks("beforeColumnWrap",...s)}),ys(cw,this).addLocalHook("beforeTransformStart",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return r.runLocalHooks("beforeModifyTransformFocus",...s)}),ys(cw,this).addLocalHook("afterTransformStart",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return r.runLocalHooks("afterModifyTransformFocus",...s)})}getSelectedRange(){return this.selectedRange}getActiveSelectedRange(){return this.selectedRange.peekByIndex(ys(Rj,this))}getActiveSelectionLayerIndex(){return ys(Rj,this)}setActiveSelectionLayerIndex(e){lu(Rj,this,e)}markSource(e){lu(Sj,this,e)}markEndSource(){lu(Sj,this,"unknown")}getSelectionSource(){return ys(Sj,this)}setExpectedLayers(e){lu(LR,this,e)}begin(){this.inProgress=!0}finish(){this.runLocalHooks("afterSelectionFinished",Array.from(this.selectedRange)),this.inProgress=!1,lu(LR,this,-1)}isInProgress(){return this.inProgress}setRangeStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e;const s=this.settings.selectionMode==="multiple",a=ls(n)?this.tableProps.getShortcutManager().isCtrlPressed():n,u=e.clone();lu(kg,this,!1),lu(Cj,this,!1),this.runLocalHooks(`beforeSetRangeStart${r?"Only":""}`,u),(!s||s&&!a&&ls(n))&&(this.selectedRange.clear(),Te(this.highlight.getAreas(),h=>void h.clear()),Te(this.highlight.getLayeredAreas(),h=>void h.clear()),Te(this.highlight.getRowHeaders(),h=>void h.clear()),Te(this.highlight.getColumnHeaders(),h=>void h.clear()),Te(this.highlight.getActiveRowHeaders(),h=>void h.clear()),Te(this.highlight.getActiveColumnHeaders(),h=>void h.clear()),Te(this.highlight.getActiveCornerHeaders(),h=>void h.clear()),Te(this.highlight.getRowHighlights(),h=>void h.clear()),Te(this.highlight.getColumnHighlights(),h=>void h.clear())),this.selectedRange.add(u).current().setHighlight(i.clone()),this.getLayerLevel()===0&&(this.selectedByRowHeader.clear(),this.selectedByColumnHeader.clear()),r||this.setRangeEnd(e)}setRangeStartOnly(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e;this.setRangeStart(e,n,!0,r)}setRangeEnd(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLayerLevel();if(this.selectedRange.isEmpty())return;this.setActiveSelectionLayerIndex(n);const r=e.clone(),i=this.tableProps.countRows(),s=this.tableProps.countCols(),a=this.getActiveSelectedRange().clone().setTo(e).isSingleHeader();if((i>0||s>0)&&(i===0&&r.col<0&&!a||s===0&&r.row<0&&!a))return;this.runLocalHooks("beforeSetRangeEnd",r),this.begin();const u=this.getActiveSelectedRange();if(this.settings.navigableHeaders||u.highlight.normalize(),this.settings.selectionMode==="single")u.setFrom(u.highlight),u.setTo(u.highlight);else{const m=u.getHorizontalDirection(),g=u.getVerticalDirection(),y=this.isMultiple();u.setTo(r),y&&(m!==u.getHorizontalDirection()||u.getWidth()===1&&!u.includes(u.highlight))&&u.from.assign({col:u.highlight.col}),y&&(g!==u.getVerticalDirection()||u.getHeight()===1&&!u.includes(u.highlight))&&u.from.assign({row:u.highlight.row})}i>0&&s>0&&(!this.settings.navigableHeaders||this.settings.navigableHeaders&&!u.isSingleHeader())&&u.to.normalize(),this.runLocalHooks("beforeHighlightSet"),this.setRangeFocus(this.getActiveSelectedRange().highlight,n),this.applyAndCommit(this.getActiveSelectedRange(),n);const h=ys(LR,this)===-1||this.selectedRange.size()===ys(LR,this);this.runLocalHooks("afterSetRangeEnd",e,h)}applyAndCommit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getActiveSelectedRange(),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLayerLevel();const r=this.tableProps.countRows(),i=this.tableProps.countCols();this.highlight.useLayerLevel(n);const s=this.highlight.createArea(),a=this.highlight.createLayeredArea(),u=this.highlight.createRowHeader(),h=this.highlight.createColumnHeader(),m=this.highlight.createActiveRowHeader(),g=this.highlight.createActiveColumnHeader(),y=this.highlight.createActiveCornerHeader(),x=this.highlight.createRowHighlight(),C=this.highlight.createColumnHighlight();if(s.clear(),a.clear(),u.clear(),h.clear(),m.clear(),g.clear(),y.clear(),x.clear(),C.clear(),this.highlight.isEnabledFor(FL,e.highlight)&&(this.isMultiple()||n>=1)&&(s.add(e.from).add(e.to).commit(),a.add(e.from).add(e.to).commit(),n===1)){const E=this.selectedRange.peekByIndex(n-1);this.highlight.useLayerLevel(n-1),this.highlight.createArea().add(E.from).commit().syncWith(E),this.highlight.createLayeredArea().add(E.from).commit().syncWith(E),this.highlight.useLayerLevel(n)}if(this.highlight.isEnabledFor($L,e.highlight)){if(!e.isSingleHeader()){const j=this.tableProps.createCellCoords(Math.max(e.from.row,0),-1),L=this.tableProps.createCellCoords(e.to.row,-1),D=this.tableProps.createCellCoords(-1,Math.max(e.from.col,0)),z=this.tableProps.createCellCoords(-1,e.to.col);this.settings.selectionMode==="single"?(u.add(j).commit(),h.add(D).commit(),x.add(j).commit(),C.add(D).commit()):(u.add(j).add(L).commit(),h.add(D).add(z).commit(),x.add(j).add(L).commit(),C.add(D).add(z).commit())}const E=!ys(kg,this)&&this.isEntireRowSelected()&&(i>0&&i===e.getWidth()||i===0&&this.isSelectedByRowHeader()),M=!ys(kg,this)&&this.isEntireColumnSelected()&&(r>0&&r===e.getHeight()||r===0&&this.isSelectedByColumnHeader());E&&m.add(this.tableProps.createCellCoords(Math.max(e.from.row,0),Math.min(-this.tableProps.countRowHeaders(),-1))).add(this.tableProps.createCellCoords(Math.max(e.to.row,0),-1)).commit(),M&&g.add(this.tableProps.createCellCoords(Math.min(-this.tableProps.countColHeaders(),-1),Math.max(e.from.col,0))).add(this.tableProps.createCellCoords(-1,Math.max(e.to.col,0))).commit(),E&&M&&y.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(),-this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1,-1)).commit()}}setRangeFocus(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLayerLevel();if(this.selectedRange.isEmpty())return;this.setActiveSelectionLayerIndex(n),ys(cu,this).setActiveLayerIndex(n),ys(cw,this).setActiveLayerIndex(n);const r=this.getActiveSelectedRange();this.inProgress||this.runLocalHooks("beforeSetFocus",e);const i=this.highlight.getFocus();i.clear(),r.setHighlight(e),this.inProgress||this.runLocalHooks("beforeHighlightSet"),this.highlight.isEnabledFor(KT,r.highlight)&&i.add(r.highlight).commit().syncWith(r),this.inProgress||(lu(Cj,this,!0),this.runLocalHooks("afterSetFocus",r.highlight))}transformStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{visualCoords:i}=ys(cu,this).transformStart(e,n,r);this.setRangeStart(i)}transformEnd(e,n){const{visualCoords:r,selectionLayer:i}=ys(cu,this).transformEnd(e,n);this.setRangeEnd(r,i)}transformFocus(e,n){const{selectionLayer:r,visualCoords:i}=ys(cw,this).transformStart(e,n);this.setRangeFocus(i.normalize(),r)}shiftRows(e,n){if(!this.isSelected())return;const r=this.getActiveSelectedRange();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByColumnHeader()||r.getOuterTopStartCorner().row>=e){const{from:i,to:s,highlight:a}=r,u=this.tableProps.countRows(),h=this.isSelectedByRowHeader(),m=this.isSelectedByColumnHeader(),g=m?-1:0,y=m?0:n;this.getSelectedRange().pop();const x=this.tableProps.createCellCoords(Lr(i.row+y,g,u-1),i.col),C=this.tableProps.createCellCoords(Lr(s.row+n,g,u-1),s.col);this.markSource("shift"),a.row>=e?this.setRangeStartOnly(x,!0,this.tableProps.createCellCoords(Lr(a.row+n,0,u-1),a.col)):this.setRangeStartOnly(x,!0),h&&this.selectedByRowHeader.add(this.getLayerLevel()),m&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(C),this.markEndSource()}}shiftColumns(e,n){if(!this.isSelected())return;const r=this.getActiveSelectedRange();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByRowHeader()||r.getOuterTopStartCorner().col>=e){const{from:i,to:s,highlight:a}=r,u=this.tableProps.countCols(),h=this.isSelectedByRowHeader(),m=this.isSelectedByColumnHeader(),g=h?-1:0,y=h?0:n;this.getSelectedRange().pop();const x=this.tableProps.createCellCoords(i.row,Lr(i.col+y,g,u-1)),C=this.tableProps.createCellCoords(s.row,Lr(s.col+n,g,u-1));this.markSource("shift"),a.col>=e?this.setRangeStartOnly(x,!0,this.tableProps.createCellCoords(a.row,Lr(a.col+n,0,u-1))):this.setRangeStartOnly(x,!0),h&&this.selectedByRowHeader.add(this.getLayerLevel()),m&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(C),this.markEndSource()}}getLayerLevel(){return this.selectedRange.size()-1}isSelected(){return!this.selectedRange.isEmpty()}isMultiple(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getActiveSelectedRange();if(!this.isSelected())return!1;const n=Cc(!e.isSingle());return this.runLocalHooks("afterIsMultipleSelection",n),n.value}isFocusSelectionChanged(){return this.isSelected()&&ys(Cj,this)}isSelectedByRowHeader(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner(e)&&(e===-1?this.selectedByRowHeader.size>0:this.selectedByRowHeader.has(e))}isEntireRowSelected(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();const n=i=>{const{col:s}=i.getOuterTopStartCorner(),a=this.tableProps.countRowHeaders(),u=this.tableProps.countCols();return(a>0&&s<0||a===0)&&i.getWidth()===u};if(e===-1)return Array.from(this.selectedRange).some(i=>n(i));const r=this.selectedRange.peekByIndex(e);return r?n(r):!1}isSelectedByColumnHeader(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner()&&(e===-1?this.selectedByColumnHeader.size>0:this.selectedByColumnHeader.has(e))}isEntireColumnSelected(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();const n=i=>{const{row:s}=i.getOuterTopStartCorner(),a=this.tableProps.countColHeaders(),u=this.tableProps.countRows();return(a>0&&s<0||a===0)&&i.getHeight()===u};if(e===-1)return Array.from(this.selectedRange).some(i=>n(i));const r=this.selectedRange.peekByIndex(e);return r?n(r):!1}isSelectedByAnyHeader(){return this.isSelectedByRowHeader(-1)||this.isSelectedByColumnHeader(-1)||this.isSelectedByCorner()}isSelectedByCorner(){return this.selectedByColumnHeader.has(this.getLayerLevel())&&this.selectedByRowHeader.has(this.getLayerLevel())}inInSelection(e){return this.selectedRange.includes(e)}isCellCornerVisible(){return this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&!this.isMultiple()}isCellVisible(e){const n=this.tableProps.visualToRenderableCoords(e);return n.row!==null&&n.col!==null}isAreaCornerVisible(e){return Number.isInteger(e)&&e!==this.getLayerLevel()?!1:this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&this.isMultiple()}clear(){this.selectedRange.clear(),this.highlight.clear()}deselect(){this.isSelected()&&(this.inProgress=!1,this.clear(),this.runLocalHooks("afterDeselect"))}selectAll(){var e;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{focusPosition:!1,disableHeadersHighlight:!1};const s=this.tableProps.countRows(),a=this.tableProps.countCols(),u=this.tableProps.countRowHeaders(),h=this.tableProps.countColHeaders(),m=r?-h:0,g=n?-u:0;if(m===0&&g===0&&(s===0||a===0))return;let y=(e=this.getActiveSelectedRange())===null||e===void 0?void 0:e.highlight;const{focusPosition:x,disableHeadersHighlight:C}=i;x&&Number.isInteger(x==null?void 0:x.row)&&Number.isInteger(x==null?void 0:x.col)&&(y=this.tableProps.createCellCoords(Lr(x.row,m,s-1),Lr(x.col,g,a-1)));const E=this.tableProps.createCellCoords(m,g),M=this.tableProps.createCellCoords(s-1,a-1);this.clear(),this.runLocalHooks("beforeSelectAll",E,M,y),this.setRangeStartOnly(E,void 0,y),lu(kg,this,C),g<0&&this.selectedByRowHeader.add(this.getLayerLevel()),m<0&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(M),this.runLocalHooks("afterSelectAll",E,M,y),this.finish()}selectCells(e){var n=this;const r=lw(e);if(r===wj)return!1;r===xj&>(Jr`Unsupported format of the selection ranges was passed. To select cells pass\x20 the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\x20 columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);const i=HR(r,{createCellCoords:function(){return n.tableProps.createCellCoords(...arguments)},createCellRange:function(){return n.tableProps.createCellRange(...arguments)},propToCol:h=>this.tableProps.propToCol(h),keepDirection:!0}),s=this.settings.navigableHeaders,a={countRows:this.tableProps.countRows(),countCols:this.tableProps.countCols(),countRowHeaders:s?this.tableProps.countRowHeaders():0,countColHeaders:s?this.tableProps.countColHeaders():0},u=!e.some(h=>{const m=i(h),g=m.isValid(a);return!(g&&!m.containsHeaders()||g&&m.containsHeaders()&&m.isSingleHeader())});return u&&(this.clear(),this.setExpectedLayers(e.length),Te(e,h=>{const{from:m,to:g}=i(h);this.setRangeStartOnly(m.clone(),!1),this.setRangeEnd(g.clone())}),this.finish()),u}selectColumns(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=typeof e=="string"?this.tableProps.propToCol(e):e,s=typeof n=="string"?this.tableProps.propToCol(n):n,a=this.tableProps.countRows(),u=this.tableProps.countCols(),h=this.tableProps.countColHeaders(),m=h===0?0:-h,g=this.tableProps.createCellCoords(m,i),y=this.tableProps.createCellCoords(a-1,s),x=this.tableProps.createCellRange(g,g,y).isValid({countRows:a,countCols:u,countRowHeaders:0,countColHeaders:h});if(x){let C=0,E=0;Number.isInteger(r==null?void 0:r.row)&&Number.isInteger(r==null?void 0:r.col)?(C=Lr(r.row,m,a-1),E=Lr(r.col,Math.min(i,s),Math.max(i,s))):(C=Lr(r,m,a-1),E=i);const M=this.tableProps.createCellCoords(C,E),j=h===0?0:Lr(M.row,m,-1),L=a-1,D=this.tableProps.createCellCoords(j,i),z=this.tableProps.createCellCoords(L,s);this.runLocalHooks("beforeSelectColumns",D,z,M),this.setRangeStartOnly(D,void 0,M),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(z),this.runLocalHooks("afterSelectColumns",D,z,M),this.finish()}return x}selectRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=this.tableProps.countRows(),s=this.tableProps.countCols(),a=this.tableProps.countRowHeaders(),u=a===0?0:-a,h=this.tableProps.createCellCoords(e,u),m=this.tableProps.createCellCoords(n,s-1),g=this.tableProps.createCellRange(h,h,m).isValid({countRows:i,countCols:s,countRowHeaders:a,countColHeaders:0});if(g){let y=0,x=0;Number.isInteger(r==null?void 0:r.row)&&Number.isInteger(r==null?void 0:r.col)?(y=Lr(r.row,Math.min(e,n),Math.max(e,n)),x=Lr(r.col,u,s-1)):(y=e,x=Lr(r,u,s-1));const C=this.tableProps.createCellCoords(y,x),E=a===0?0:Lr(C.col,u,-1),M=s-1,j=this.tableProps.createCellCoords(e,E),L=this.tableProps.createCellCoords(n,M);this.runLocalHooks("beforeSelectRows",j,L,C),this.setRangeStartOnly(j,void 0,C),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(L),this.runLocalHooks("afterSelectRows",j,L,C),this.finish()}return g}importSelection(e){let{ranges:n,activeRange:r,activeSelectionLayer:i,selectedByRowHeader:s,selectedByColumnHeader:a,disableHeadersHighlight:u}=e;n.length!==0&&(this.selectedRange.clear(),this.highlight.clear(),this.inProgress=!1,lu(kg,this,u),this.selectedByRowHeader=new Set(s),this.selectedByColumnHeader=new Set(a),this.setActiveSelectionLayerIndex(0),n.forEach((h,m)=>{this.selectedRange.push(h),this.applyAndCommit(h,m)}),this.setRangeFocus(r.highlight,i),lu(kg,this,!1),this.inProgress=!1)}exportSelection(){return{ranges:Array.from(this.selectedRange).map(e=>e.clone()),activeRange:this.getActiveSelectedRange(),activeSelectionLayer:this.getActiveSelectionLayerIndex(),selectedByRowHeader:Array.from(this.selectedByRowHeader),selectedByColumnHeader:Array.from(this.selectedByColumnHeader),disableHeadersHighlight:ys(kg,this)}}refresh(){if(!this.isSelected())return;const e=this.tableProps.countRows(),n=this.tableProps.countCols();if(e===0||n===0){this.deselect();return}const r=this.selectedRange.ranges.map(u=>u.clone());this.getSelectionSource()==="unknown"&&this.markSource("refresh");const s=new Set(this.selectedByRowHeader),a=new Set(this.selectedByColumnHeader);this.clear(),this.setExpectedLayers(r.length),r.forEach(u=>{const{from:h,to:m,highlight:g}=u,y=e-1,x=n-1;g.assign({row:Lr(g.row,this.settings.navigableHeaders?-1/0:0,y),col:Lr(g.col,this.settings.navigableHeaders?-1/0:0,x)}),h.assign({row:Lr(h.row,-1/0,y),col:Lr(h.col,-1/0,x)}),m.assign({row:Lr(m.row,-1/0,y),col:Lr(m.col,-1/0,x)}),this.setRangeStartOnly(h,!0,g),this.setRangeEnd(m)}),this.selectedByRowHeader=s,this.selectedByColumnHeader=a,this.finish(),this.markEndSource()}commit(){if(this.highlight.getCustomSelections().forEach(i=>{i.commit()}),!this.isSelected())return;const n=this.getLayerLevel(),r=this.getActiveSelectedRange();this.highlight.isEnabledFor(KT,r.highlight)&&this.highlight.getFocus().commit().syncWith(r);for(let i=0;i<this.selectedRange.size();i+=1){this.highlight.useLayerLevel(i);const s=this.highlight.createArea(),a=this.highlight.createLayeredArea(),u=this.highlight.createRowHeader(),h=this.highlight.createColumnHeader(),m=this.highlight.createActiveRowHeader(),g=this.highlight.createActiveColumnHeader(),y=this.highlight.createActiveCornerHeader(),x=this.highlight.createRowHighlight(),C=this.highlight.createColumnHighlight();s.commit(),a.commit(),u.commit(),h.commit(),m.commit(),g.commit(),y.commit(),x.commit(),C.commit()}this.highlight.useLayerLevel(n)}}ci(pq,vo);const gq=/^(\r\n|\n\r|\r|\n)/,Jye=/^[^\t\r\n]+/,vq=/^\t/;function exe(t){const e=[[""]];if(t.length===0)return e;let n=0,r=0,i;for(;t.length>0&&i!==t.length;)if(i=t.length,t.match(vq))t=t.replace(vq,""),n+=1,e[r][n]="";else if(t.match(gq))t=t.replace(gq,""),n=0,r+=1,e[r]=[""];else{let s="";if(t.startsWith('"')){let a=0,u=!0;for(;u;){const h=t.slice(0,1);h==='"'&&(a+=1),s+=h,t=t.slice(1),(t.length===0||t.match(/^[\t\r\n]/)&&a%2===0)&&(u=!1)}s=s.replace(/^"/,"").replace(/"$/,"").replace(/["]*/g,h=>new Array(Math.floor(h.length/2)).fill('"').join(""))}else{const a=t.match(Jye);s=a?a[0]:"",t=t.slice(s.length)}e[r][n]=s}return e}function _j(t){let e,n,r,i,s="",a;for(e=0,n=t.length;e<n;e+=1){for(i=t[e].length,r=0;r<i;r+=1)r>0&&(s+=" "),a=t[e][r],typeof a=="string"?a.indexOf(` `)>-1?s+=`"${a.replace(/"/g,'""')}"`:s+=a:a==null?s+="":s+=a;e!==n-1&&(s+=` `)}return s}function X4(t,e){const{instance:n,visualRow:r,visualCol:i,valueSetter:s}=e;return ri(s)?s.call(n,t,r,i,e):t}function bq(t,e){const{instance:n,visualRow:r,visualCol:i,valueGetter:s}=e;return ri(s)?s.call(n,t,r,i,e):t}function X0(t,e,n){return(e=txe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function txe(t){var e=nxe(t,"string");return typeof e=="symbol"?e:e+""}function nxe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class uw{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}constructor(e,n,r){X0(this,"hot",void 0),X0(this,"metaManager",void 0),X0(this,"tableMeta",void 0),X0(this,"dataSource",void 0),X0(this,"duckSchema",void 0),X0(this,"colToPropCache",void 0),X0(this,"propToColCache",void 0),this.hot=e,this.metaManager=r,this.tableMeta=r.getTableMeta(),this.dataSource=n,this.refreshDuckSchema(),this.createMap()}createMap(){const e=this.getSchema();typeof e>"u"&>("trying to create `columns` definition but you didn't provide `schema` nor `data`");const n=this.tableMeta.columns;let r;if(this.colToPropCache=[],this.propToColCache=new Map,n){let i=0,s=0,a=!1;if(typeof n=="function"){const u=tL(e);i=u>0?u:this.countFirstRowKeys(),a=!0}else{const u=this.tableMeta.maxCols;i=Math.min(u,n.length)}for(r=0;r<i;r++){const u=a?n(r):n[r];if(nn(u)){if(typeof u.data<"u"){const h=a?s:r;this.colToPropCache[h]=u.data,this.propToColCache.set(u.data,h)}s+=1}}}else this.recursiveDuckColumns(e)}countFirstRowKeys(){return HK(this.dataSource)}recursiveDuckColumns(e,n,r){let i=n,s=r,a;return typeof i>"u"&&(i=0,s=""),typeof e=="object"&&!Array.isArray(e)&&Mr(e,(u,h)=>{u===null?(a=s+h,this.colToPropCache.push(a),this.propToColCache.set(a,i),i+=1):i=this.recursiveDuckColumns(u,i,`${h}.`)}),i}colToProp(e){if(Number.isInteger(e)===!1)return e;const n=this.hot.toPhysicalColumn(e);return n===null?e:this.colToPropCache&&Lt(this.colToPropCache[n])?this.colToPropCache[n]:n}propToCol(e){const n=this.propToColCache.get(e);if(Lt(n))return this.hot.toVisualColumn(n);const r=this.hot.toVisualColumn(e);return r===null?e:r}getSchema(){const e=this.tableMeta.dataSchema;return e?typeof e=="function"?e():e:this.duckSchema}createDuckSchema(){return this.dataSource&&this.dataSource[0]?cR(this.dataSource[0]):{}}refreshDuckSchema(){this.duckSchema=this.createDuckSchema()}createRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:r,mode:i="above"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.hot.countSourceRows();let a=s,u=0,h=e;if((typeof h!="number"||h>=s)&&(h=s),h<this.hot.countRows()&&(a=this.hot.toPhysicalRow(h)),this.hot.runHooks("beforeCreateRow",h,n,r)===!1||a===null)return{delta:0};const g=this.tableMeta.maxRows,y=this.getSchema().length,x=[];for(;u<n&&s+u<g;){let E=null;this.hot.dataType==="array"?this.tableMeta.dataSchema?E=ea(this.getSchema()):(E=[],En(y-1,()=>E.push(null))):this.hot.dataType==="function"?E=this.tableMeta.dataSchema(h+u):(E={},NT(E,this.getSchema())),x.push(E),u+=1}this.hot.rowIndexMapper.insertIndexes(h,u),i==="below"&&(a=Math.min(a+1,s)),this.spliceData(a,0,x);const C=this.hot.toVisualRow(a);return this.hot.countSourceRows()===x.length&&this.hot.columnIndexMapper.initToLength(this.hot.getInitialColumnCount()),u>0&&(e==null?this.metaManager.createRow(null,u):r!=="auto"&&this.metaManager.createRow(a,n)),this.hot.runHooks("afterCreateRow",C,u,r),{delta:u,startPhysicalIndex:a}}createCol(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:r,mode:i="start"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.hot.isColumnModificationAllowed()||gt("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource.");const s=this.dataSource,a=this.tableMeta.maxCols,u=this.hot.countSourceCols(),h=this.hot.countCols(),m=this.hot.countSourceRows(),g=typeof e=="number"&&e<=u?e:h;if(this.hot.runHooks("beforeCreateCol",g,n,r)===!1)return{delta:0};const y=g<h?this.hot.toPhysicalColumn(g):u,x=i==="end"?Math.min(y+1,u):y;let C=0;for(let E=x;C<n&&h+C<a;E++){if(typeof g!="number"||g>=h+C)if(m>0)for(let M=0;M<m;M+=1)typeof s[M]>"u"&&(s[M]=[]),s[M].push(null);else s.push([null]);else for(let M=0;M<m;M++)s[M].splice(E,0,null);C+=1}return C>0&&(e==null?this.metaManager.createColumn(null,C):r!=="auto"&&this.metaManager.createColumn(x,n)),this.hot.columnIndexMapper.insertIndexes(g,C,i),this.hot.runHooks("afterCreateCol",this.hot.toVisualColumn(x),C,r),this.refreshDuckSchema(),{delta:C,startPhysicalIndex:x}}removeRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0,i=Number.isInteger(e)?e:-n;const s=this.visualRowsToPhysical(i,n),a=this.hot.countSourceRows();if(i=(a+i)%a,this.hot.runHooks("beforeRemoveRow",i,s.length,s,r)===!1)return!1;const h=s.length;if(this.filterData(i,h,s),i<this.hot.countRows()){this.hot.rowIndexMapper.removeIndexes(s);const g=Lt(this.tableMeta.columns)||Lt(this.tableMeta.dataSchema)||this.tableMeta.colHeaders;this.hot.rowIndexMapper.getNotTrimmedIndexesLength()===0&&!g&&this.hot.columnIndexMapper.setIndexesSequence([])}return s.slice(0).sort((g,y)=>y-g).forEach(g=>{this.metaManager.removeRow(g,1)}),this.hot.runHooks("afterRemoveRow",i,h,s,r),!0}removeCol(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0;(this.hot.dataType==="object"||this.tableMeta.columns)&>("cannot remove column with object data source or columns option specified");let i=typeof e!="number"?-n:e;i=(this.hot.countCols()+i)%this.hot.countCols();const s=this.visualColumnsToPhysical(i,n),a=s.slice(0).sort((y,x)=>x-y);if(this.hot.runHooks("beforeRemoveCol",i,n,s,r)===!1)return!1;let h=!0;const m=a.length,g=this.dataSource;for(let y=0;y<m;y++)h&&s[0]!==s[y]-y&&(h=!1);if(h)for(let y=0,x=this.hot.countSourceRows();y<x;y++)g[y].splice(s[0],n),y===0&&this.metaManager.removeColumn(s[0],n);else for(let y=0,x=this.hot.countSourceRows();y<x;y++)for(let C=0;C<m;C++)g[y].splice(a[C],1),y===0&&this.metaManager.removeColumn(a[C],1);return i<this.hot.countCols()&&(this.hot.columnIndexMapper.removeIndexes(s),!this.tableMeta.rowHeaders&&this.hot.columnIndexMapper.getNotTrimmedIndexesLength()===0&&this.hot.rowIndexMapper.setIndexesSequence([])),this.hot.runHooks("afterRemoveCol",i,n,s,r),this.refreshDuckSchema(),!0}spliceCol(e,n,r){const i=this.hot.getDataAtCol(e),s=i.slice(n,n+r),a=i.slice(n+r);for(var u=arguments.length,h=new Array(u>3?u-3:0),m=3;m<u;m++)h[m-3]=arguments[m];HY(h,a);let g=0;for(;g<r;)h.push(null),g+=1;return Fme(h),this.hot.populateFromArray(n,e,h,null,null,"spliceCol"),s}spliceRow(e,n,r){const i=this.hot.getSourceDataAtRow(e),s=i.slice(n,n+r),a=i.slice(n+r);for(var u=arguments.length,h=new Array(u>3?u-3:0),m=3;m<u;m++)h[m-3]=arguments[m];HY(h,a);let g=0;for(;g<r;)h.push(null),g+=1;return this.hot.populateFromArray(e,n,[h],null,null,"spliceRow"),s}spliceData(e,n,r){if(this.hot.runHooks("beforeDataSplice",e,n,r)!==!1){const s=[...this.dataSource.slice(0,e),...r,...this.dataSource.slice(e)];this.dataSource.length=0,s.forEach(a=>this.dataSource.push(a))}}filterData(e,n,r){let i=this.hot.runHooks("filterData",e,n,r);Array.isArray(i)===!1&&(i=this.dataSource.filter((s,a)=>r.indexOf(a)===-1)),this.dataSource.length=0,Array.prototype.push.apply(this.dataSource,i)}get(e,n){const r=this.hot.toPhysicalRow(e);let i=this.dataSource[r];const s=this.hot.runHooks("modifyRowData",r);i=isNaN(s)?s:i;const{dataDotNotation:a}=this.hot.getSettings();let u=null;if(i&&i.hasOwnProperty&&Ps(i,n))u=i[n];else if(a&&typeof n=="string"&&n.indexOf(".")>-1){let g=i;if(!g)return null;const y=n.split(".");for(let x=0,C=y.length;x<C;x++)if(g=g[y[x]],typeof g>"u")return null;u=g}else typeof n=="function"&&(u=n(this.dataSource.slice(r,r+1)[0]));const h=this.propToCol(n),m=this.hot.toPhysicalColumn(h);if(Gx(r)&&Gx(m)&&(u=bq(u,this.metaManager.getCellMeta(r,m,{visualRow:e,visualColumn:h,skipMetaExtension:!0}))),this.hot.hasHook("modifyData")){const g=Cc(u);this.hot.runHooks("modifyData",e,h,g,"get"),g.isTouched()&&(u=g.value)}return u}getCopyable(e,n){return this.hot.getCellMeta(e,this.propToCol(n)).copyable?this.get(e,n):""}set(e,n,r){const i=this.hot.toPhysicalRow(e);let s=r,a=this.dataSource[i];const u=this.hot.runHooks("modifyRowData",i);if(a=isNaN(u)?u:a,this.hot.hasHook("modifyData")){const m=Cc(s);this.hot.runHooks("modifyData",e,this.propToCol(n),m,"set"),m.isTouched()&&(s=m.value)}const{dataDotNotation:h}=this.hot.getSettings();if(a&&a.hasOwnProperty&&Ps(a,n))a[n]=s;else if(h&&typeof n=="string"&&n.indexOf(".")>-1){let m=a,g=0,y;const x=n.split(".");for(g=0,y=x.length-1;g<y;g++){if(x[g]==="__proto__"||x[g]==="constructor"||x[g]==="prototype")return;typeof m[x[g]]>"u"&&(m[x[g]]={}),m=m[x[g]]}m[x[g]]=s}else if(typeof n=="function")n(this.dataSource.slice(i,i+1)[0],s);else{if(n==="__proto__"||n==="constructor"||n==="prototype")return;a[n]=s}}visualRowsToPhysical(e,n){const r=this.hot.countSourceRows(),i=[];let s=(r+e)%r,a=n,u;for(;s<r&&a;)u=this.hot.toPhysicalRow(s),i.push(u),a-=1,s+=1;return i}visualColumnsToPhysical(e,n){const r=this.hot.countCols(),i=[];let s=(r+e)%r,a=n;for(;s<r&&a;){const u=this.hot.toPhysicalColumn(s);i.push(u),a-=1,s+=1}return i}clear(){for(let e=0;e<this.hot.countSourceRows();e++)for(let n=0;n<this.hot.countCols();n++)this.set(e,this.colToProp(n),"")}getLength(){const e=this.tableMeta.maxRows;let n;e<0||e===0?n=0:n=e||1/0;const r=this.hot.rowIndexMapper.getNotTrimmedIndexesLength();return Math.min(r,n)}getAll(){const e={row:0,col:0},n={row:Math.max(this.hot.countRows()-1,0),col:Math.max(this.hot.countCols()-1,0)};return e.row-n.row===0&&!this.hot.countSourceRows()?[]:this.getRange(e,n,uw.DESTINATION_RENDERER)}countCachedColumns(){return this.colToPropCache.length}getRange(e,n,r){const i=[];let s,a,u;const h=this.tableMeta.maxRows,m=this.tableMeta.maxCols;if(h===0||m===0)return[];const g=r===uw.DESTINATION_CLIPBOARD_GENERATOR?this.getCopyable:this.get,y=Math.min(Math.max(h-1,0),Math.max(e.row,n.row)),x=Math.min(Math.max(m-1,0),Math.max(e.col,n.col));for(s=Math.min(e.row,n.row);s<=y;s++){u=[];const C=s>=0?this.hot.toPhysicalRow(s):s;for(a=Math.min(e.col,n.col);a<=x&&C!==null;a++)u.push(g.call(this,s,this.colToProp(a)));C!==null&&i.push(u)}return i}getText(e,n){return _j(this.getRange(e,n,uw.DESTINATION_RENDERER))}getCopyableText(e,n){return _j(this.getRange(e,n,uw.DESTINATION_CLIPBOARD_GENERATOR))}destroy(){this.hot=null,this.metaManager=null,this.dataSource=null,this.duckSchema=null,this.colToPropCache.length=0,this.propToColCache.clear(),this.propToColCache=void 0}}function $R(t,e,n){return(e=rxe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rxe(t){var e=ixe(t,"string");return typeof e=="symbol"?e:e+""}function ixe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sxe{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];$R(this,"hot",void 0),$R(this,"data",void 0),$R(this,"dataType","array"),$R(this,"colToProp",()=>{}),$R(this,"propToCol",()=>{}),this.hot=e,this.data=n}modifyRowData(e){let n;return this.hot.hasHook("modifyRowData")&&(n=this.hot.runHooks("modifyRowData",e)),n!==void 0&&!Number.isInteger(n)?n:this.data[e]}getData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return!this.data||this.data.length===0?this.data:this.getByRange(null,null,e)}setData(e){this.data=e}getAtColumn(e){const n=[];return Te(this.data,(r,i)=>{const s=this.getAtCell(i,e);n.push(s)}),n}getAtRow(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const s=n===void 0&&r===void 0,{dataDotNotation:a}=this.hot.getSettings();let u=null,h=null;if(u=this.modifyRowData(e),Array.isArray(u))h=[],s?u.forEach((m,g)=>{h[g]=this.getAtPhysicalCell(e,g,u)}):En(n,r,m=>{h[m-n]=this.getAtPhysicalCell(e,m,u)});else if(nn(u)||ri(u))if(i?h=[]:h={},!s||i){const g=this.countFirstRowKeys()-1;En(0,g,y=>{const x=this.colToProp(y);if(y>=(n||0)&&y<=(r||g)&&!Number.isInteger(x)){const C=this.getAtPhysicalCell(e,x,u);i?h.push(C):a?eL(h,x,C):h[x]=C}})}else Mr(u,(m,g)=>{const y=this.getAtPhysicalCell(e,g,u);a?eL(h,g,y):h[g]=y});return h}setAtCell(e,n,r){if(!(e>=this.countRows()||n>=this.countFirstRowKeys())){if(this.hot.hasHook("modifySourceData")){const i=Cc(r);this.hot.runHooks("modifySourceData",e,n,i,"set"),i.isTouched()&&(r=i.value)}["__proto__","constructor","prototype"].includes(e)||(Number.isInteger(n)?this.data[e][n]=r:eL(this.data[e],n,r))}}getAtPhysicalCell(e,n,r){let i=null;if(r)if(typeof n=="string"){const{dataDotNotation:s}=this.hot.getSettings();i=s?JH(r,n):r[n]}else typeof n=="function"?i=n(r):i=r[n];if(this.hot.hasHook("modifySourceData")){const s=Cc(i);this.hot.runHooks("modifySourceData",e,n,s,"get"),s.isTouched()&&(i=s.value)}return i}getAtCell(e,n){const r=this.modifyRowData(e);return this.getAtPhysicalCell(e,this.colToProp(n),r)}getByRange(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=!1,s=null,a=null,u=null,h=null;e===null||n===null?(i=!0,s=0,u=this.countRows()-1):(s=Math.min(e.row,n.row),a=Math.min(e.col,n.col),u=Math.max(e.row,n.row),h=Math.max(e.col,n.col));const m=[];return En(s,u,g=>{m.push(i?this.getAtRow(g,void 0,void 0,r):this.getAtRow(g,a,h,r))}),m}getCopyable(e,n){const r=this.propToCol(n);return this.hot.getCellMeta(e,r).copyable?this.getAtCell(this.hot.toPhysicalRow(e),r):""}countRows(){if(this.hot.hasHook("modifySourceLength")){const e=this.hot.runHooks("modifySourceLength");if(Number.isInteger(e))return e}return this.data.length}countFirstRowKeys(){return HK(this.data)}destroy(){this.data=null,this.hot=null}}const{register:oxe,getItem:axe,hasItem:yq,getNames:G9e,getValues:K9e}=ou("cellTypes");function lxe(t){return yq(t)||gt(`You declared cell type "${t}" as a string that is not mapped to a known object. Cell type must be an object or a string mapped to an object registered by "Handsontable.cellTypes.registerCellType" method`),axe(t)}function kc(t,e){typeof t!="string"&&(e=t,t=e.CELL_TYPE);const{editor:n,renderer:r,validator:i}=e;n&&ol(t,n),r&&Bl(t,r),i&&Sm(t,i),oxe(t,e)}function cxe(t,e){var n;return t==="CELL_TYPE"?!1:((n=e._automaticallyAssignedMetaProps)===null||n===void 0?void 0:n.has(t))||!Ps(e,t)}function Ej(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;const r=typeof e.type=="string"?lxe(e.type):e.type;if(t._automaticallyAssignedMetaProps&&Mr(e,(s,a)=>void t._automaticallyAssignedMetaProps.delete(a)),!nn(r))return;n===t&&!t._automaticallyAssignedMetaProps&&(t._automaticallyAssignedMetaProps=new Set);const i={};Mr(r,(s,a)=>{if(cxe(a,n)){var u;i[a]=s,(u=t._automaticallyAssignedMetaProps)===null||u===void 0||u.add(a)}}),jo(t,i)}function uxe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];function n(){}Rpe(n,t);for(let r=0;r<e.length;r++)n.prototype[e[r]]=void 0;return n}function Nj(t,e){t()||gt(`Assertion failed: ${e}`)}function FR(t){return t==null}const xq=()=>({_automaticallyAssignedMetaProps:void 0,activeHeaderClassName:"ht__active_highlight",allowEmpty:!0,allowHtml:!1,allowInsertColumn:!0,allowInsertRow:!0,allowInvalid:!0,allowRemoveColumn:!0,allowRemoveRow:!0,ariaTags:!0,autoColumnSize:void 0,autoRowSize:void 0,autoWrapCol:!1,autoWrapRow:!1,bindRowsWithHeaders:void 0,cell:[],cells:void 0,checkedTemplate:void 0,className:void 0,colHeaders:null,collapsibleColumns:void 0,columnHeaderHeight:void 0,columns:void 0,columnSorting:void 0,columnSummary:void 0,colWidths:void 0,commentedCellClassName:"htCommentCell",comments:!1,contextMenu:void 0,copyable:!0,copyPaste:!0,correctFormat:!1,currentColClassName:void 0,currentHeaderClassName:"ht__highlight",currentRowClassName:void 0,customBorders:!1,data:void 0,dataDotNotation:!0,dataSchema:void 0,dateFormat:"DD/MM/YYYY",timeFormat:"h:mm:ss a",datePickerConfig:void 0,defaultDate:void 0,disableVisualSelection:!1,dialog:!1,dragToScroll:!0,dropdownMenu:void 0,editor:void 0,emptyDataState:!1,enterBeginsEditing:!0,enterCommits:!0,enterMoves:{col:0,row:1},fillHandle:{autoInsertRow:!1},filter:!0,filteringCaseSensitive:!1,filters:void 0,filterSelectedItems:!0,fixedColumnsLeft:0,fixedColumnsStart:0,fixedRowsBottom:0,fixedRowsTop:0,formulas:void 0,fragmentSelection:!1,headerClassName:void 0,height:void 0,hiddenColumns:void 0,hiddenRows:void 0,initialState:void 0,invalidCellClassName:"htInvalid",imeFastEdit:!1,isEmptyCol(t){let e,n,r;for(e=0,n=this.countRows();e<n;e++)if(r=this.getDataAtCell(e,t),Yr(r)===!1)return!1;return!0},isEmptyRow(t){let e,n,r,i;for(e=0,n=this.countCols();e<n;e++)if(r=this.getDataAtCell(t,e),Yr(r)===!1)return typeof r=="object"?(i=this.getCellMeta(t,e),N0(this.getSchema()[i.prop],r)):!1;return!0},label:void 0,language:"en-US",layoutDirection:"inherit",licenseKey:void 0,locale:"en-US",loading:!1,manualColumnFreeze:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,maxCols:1/0,maxRows:1/0,maxSelections:void 0,mergeCells:!1,minCols:0,minRowHeights:void 0,minRows:0,minSpareCols:0,minSpareRows:0,multiColumnSorting:void 0,navigableHeaders:!1,tabNavigation:!0,nestedHeaders:void 0,nestedRows:void 0,noWordWrapClassName:"htNoWrap",numericFormat:void 0,observeDOMVisibility:!0,outsideClickDeselects:!0,pagination:void 0,placeholder:void 0,placeholderCellClassName:"htPlaceholder",preventOverflow:!1,preventWheel:!1,readOnly:!1,readOnlyCellClassName:"htDimmed",renderAllRows:!1,renderAllColumns:!1,renderer:void 0,valueFormatter:void 0,valueParser:void 0,rowHeaders:void 0,rowHeaderWidth:void 0,rowHeights:void 0,search:!1,searchInput:!0,selectionMode:"multiple",selectOptions:void 0,skipColumnOnPaste:!1,skipRowOnPaste:!1,sortByRelevance:!0,sourceSortFunction:void 0,source:void 0,startCols:5,startRows:5,stretchH:"none",strict:void 0,tableClassName:void 0,textEllipsis:!1,themeName:void 0,theme:void 0,injectCoreCss:!0,tabMoves:{row:0,col:1},title:void 0,trimDropdown:!0,trimRows:void 0,trimWhitespace:!0,type:"text",uncheckedTemplate:void 0,undo:!0,validator:void 0,sourceDataValidator:void 0,sourceDataWarningMessage:void 0,valueGetter:void 0,valueSetter:void 0,viewportColumnRenderingOffset:"auto",viewportRowRenderingOffset:"auto",viewportColumnRenderingThreshold:0,viewportRowRenderingThreshold:0,visibleRows:10,width:void 0,wordWrap:!0,sanitizer:void 0,parsePastedValue:!1});function wq(t,e,n){return(e=dxe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dxe(t){var e=hxe(t,"string");return typeof e=="symbol"?e:e+""}function hxe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fxe(){return class{}}class mxe{constructor(e){wq(this,"metaCtor",fxe()),wq(this,"meta",void 0),this.meta=this.metaCtor.prototype,jo(this.meta,xq()),this.meta.instance=e}getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){var n;jo(this.meta,e),Ej(this.meta,{...e,type:(n=e.type)!==null&&n!==void 0?n:this.meta.type},e)}}function pxe(t,e,n){return(e=gxe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gxe(t){var e=vxe(t,"string");return typeof e=="symbol"?e:e+""}function vxe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bxe{constructor(e){pxe(this,"meta",void 0);const n=e.getMetaConstructor();this.meta=new n}getMeta(){return this.meta}updateMeta(e){jo(this.meta,e),Ej(this.meta,e,e)}}function kj(t,e,n){return(e=yxe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yxe(t){var e=xxe(t,"string");return typeof e=="symbol"?e:e+""}function xxe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Tj{constructor(e){kj(this,"valueFactory",void 0),kj(this,"data",[]),kj(this,"index",[]),kj(this,"holes",new Set),this.valueFactory=e}obtain(e){Nj(()=>Gx(e),"Expecting an unsigned number.");const n=this._getStorageIndexByKey(e);let r;if(n>=0)r=this.data[n],r===void 0&&(r=this.valueFactory(e),this.data[n]=r);else if(r=this.valueFactory(e),this.holes.size>0){const i=this.holes.values().next().value;this.holes.delete(i),this.data[i]=r,this.index[e]=i}else this.data.push(r),this.index[e]=this.data.length-1;return r}insert(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Nj(()=>Gx(e)||FR(e),"Expecting an unsigned number or null/undefined argument.");const r=[],i=this.data.length;for(let a=0;a<n;a++)r.push(i+a),this.data.push(void 0);const s=FR(e)?this.index.length:e;this.index=[...this.index.slice(0,s),...r,...this.index.slice(s)]}remove(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Nj(()=>Gx(e)||FR(e),"Expecting an unsigned number or null/undefined argument.");const r=this.index.splice(FR(e)?this.index.length-n:e,n);for(let i=0;i<r.length;i++){const s=r[i];typeof s=="number"&&this.holes.add(s)}}size(){return this.data.length-this.holes.size}values(){return this.data.filter((e,n)=>e!==void 0&&!this.holes.has(n))[Symbol.iterator]()}entries(){const e=[];for(let r=0;r<this.data.length;r++){const i=this._getKeyByStorageIndex(r);i!==-1&&this.data[r]!==void 0&&e.push([i,this.data[r]])}let n=0;return{next:()=>{if(n<e.length){const r=e[n];return n+=1,{value:r,done:!1}}return{done:!0}}}}clear(){this.data=[],this.index=[],this.holes.clear()}_getStorageIndexByKey(e){return this.index.length>e?this.index[e]:-1}_getKeyByStorageIndex(e){return this.index.indexOf(e)}[Symbol.iterator](){return this.entries()}}function Cq(t,e,n){return(e=wxe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wxe(t){var e=Cxe(t,"string");return typeof e=="symbol"?e:e+""}function Cxe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Sxe=["data","width"];class Rxe{constructor(e){Cq(this,"globalMeta",void 0),Cq(this,"metas",new Tj(()=>this._createMeta())),this.globalMeta=e,this.metas=new Tj(()=>this._createMeta())}updateMeta(e,n){const r=this.getMeta(e);jo(r,n),Ej(r,n)}createColumn(e,n){this.metas.insert(e,n)}removeColumn(e,n){this.metas.remove(e,n)}getMeta(e){return this.metas.obtain(e)}getMetaConstructor(e){return this.metas.obtain(e).constructor}clearCache(){this.metas.clear()}_createMeta(){return uxe(this.globalMeta.getMetaConstructor(),Sxe).prototype}}function Sq(t,e,n){return(e=_xe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _xe(t){var e=Exe(t,"string");return typeof e=="symbol"?e:e+""}function Exe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Nxe{constructor(e){Sq(this,"columnMeta",void 0),Sq(this,"metas",new Tj(()=>this._createRow())),this.columnMeta=e}updateMeta(e,n,r){const i=this.getMeta(e,n);jo(i,r),Ej(i,r)}createRow(e,n){this.metas.insert(e,n)}createColumn(e,n){for(let r=0;r<this.metas.size();r++)this.metas.obtain(r).insert(e,n)}removeRow(e,n){this.metas.remove(e,n)}removeColumn(e,n){for(let r=0;r<this.metas.size();r++)this.metas.obtain(r).remove(e,n)}getMeta(e,n,r){const i=this.metas.obtain(e).obtain(n);return r===void 0?i:i[r]}setMeta(e,n,r,i){var s;const a=this.metas.obtain(e).obtain(n);(s=a._automaticallyAssignedMetaProps)===null||s===void 0||s.delete(r),a[r]=i}removeMeta(e,n,r){const i=this.metas.obtain(e).obtain(n);delete i[r]}getMetas(){const e=[],n=Array.from(this.metas.values());for(let r=0;r<n.length;r++)Lt(n[r])&&e.push(...n[r].values());return e}getMetasAtRow(e){Nj(()=>Gx(e),"Expecting an unsigned number.");const n=new Map(this.metas);return n.has(e)?Array.from(n.get(e).values()):[]}clearCache(){this.metas.clear()}_createRow(){return new Tj(e=>this._createMeta(e))}_createMeta(e){const n=this.columnMeta.getMetaConstructor(e);return new n}}class Rq{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];this.hot=e,this.globalMeta=new mxe(e),this.tableMeta=new bxe(this.globalMeta),this.columnMeta=new Rxe(this.globalMeta),this.cellMeta=new Nxe(this.columnMeta),r.forEach(i=>new i(this)),this.globalMeta.updateMeta(n)}getGlobalMeta(){return this.globalMeta.getMeta()}updateGlobalMeta(e){this.globalMeta.updateMeta(e)}getTableMeta(){return this.tableMeta.getMeta()}updateTableMeta(e){this.tableMeta.updateMeta(e)}getColumnMeta(e){return this.columnMeta.getMeta(e)}updateColumnMeta(e,n){this.columnMeta.updateMeta(e,n)}getCellMeta(e,n,r){const i=this.cellMeta.getMeta(e,n);return i.visualRow=r.visualRow,i.visualCol=r.visualColumn,i.row=e,i.col=n,r.skipMetaExtension||this.runLocalHooks("afterGetCellMeta",i),i}getCellMetaKeyValue(e,n,r){return typeof r!="string"&>("The passed cell meta object key is not a string"),this.cellMeta.getMeta(e,n,r)}setCellMeta(e,n,r,i){this.cellMeta.setMeta(e,n,r,i)}updateCellMeta(e,n,r){this.cellMeta.updateMeta(e,n,r)}removeCellMeta(e,n,r){this.cellMeta.removeMeta(e,n,r)}getCellsMeta(){return this.cellMeta.getMetas()}getCellsMetaAtRow(e){return this.cellMeta.getMetasAtRow(e)}createRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createRow(e,n)}removeRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeRow(e,n)}createColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createColumn(e,n),this.columnMeta.createColumn(e,n)}removeColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeColumn(e,n),this.columnMeta.removeColumn(e,n)}clearCellsCache(){this.cellMeta.clearCache()}clearCache(){this.cellMeta.clearCache(),this.columnMeta.clearCache()}}ci(Rq,vo);function kxe(t,e,n){const r=e.sourceDataValidator;if(!ri(r)||r(t,e,n)===!0)return!0;const{row:s,col:a,sourceDataWarningMessage:u,allowInvalid:h}=e;return u&&Eq(u,[{row:s,col:a,value:t}]),h===!0}function _q(t,e){const n=t.countSourceRows(),r=t.countSourceCols();if(n===0||r===0)return;const i=new Map;for(let a=0;a<n;a+=1)for(let u=0;u<r;u+=1){const h=t.toVisualRow(a),m=t.toVisualColumn(u);if(h===null||m===null)continue;const g=t.getCellMeta(h,m),{sourceDataWarningMessage:y,sourceDataValidator:x,allowInvalid:C}=g;if(!ri(x))continue;const E=t._getDataSource(),M=E.getAtCell(a,u,null);if(x(M,g,e)!==!0&&(C===!1&&E.setAtCell(a,u,null),y)){var s;const L=y,D=(s=i.get(L))!==null&&s!==void 0?s:[];D.push({row:a,col:u,value:M,message:L}),i.set(L,D)}}i.forEach((a,u)=>{Eq(u,a)})}function Eq(t,e){Ape({logFunction:Yn,message:t,items:e,itemFormatter:n=>{let{row:r,col:i,value:s}=n;const a=Hi(s),u=a.length>64?`${a.slice(0,64)}...`:a;return`row ${r}, col ${i}, value: "${u}"`}})}function Nq(t,e,n,r){const{hotInstance:i,dataMap:s,dataSource:a,internalSource:u,source:h,metaManager:m,firstRun:g}=r,y=Hd(u),x=i.getSettings();Array.isArray(x.dataSchema)?i.dataType="array":ri(x.dataSchema)?i.dataType="function":i.dataType="object",s&&s.destroy(),t=i.runHooks(`before${y}`,t,g,h);const C=new uw(i,t,m);if(e(C),typeof t=="object"&&t!==null)t.push&&t.splice||(t=[t]);else if(t===null){const E=C.getSchema();t=[];let M,j=0,L=0;for(j=0,L=x.startRows;j<L;j++)if((i.dataType==="object"||i.dataType==="function")&&x.dataSchema)M=ea(E),t.push(M);else if(i.dataType==="array")M=ea(E[0]),t.push(M);else{M=[];for(let D=0,z=x.startCols;D<z;D++)M.push(null);t.push(M)}}else gt(`${u} only accepts array of objects or array of arrays (${typeof t} given)`);Array.isArray(t[0])&&(i.dataType="array"),x.data=t,C.dataSource=t,a.data=t,a.dataType=i.dataType,a.colToProp=C.colToProp.bind(C),a.propToCol=C.propToCol.bind(C),a.countCachedColumns=C.countCachedColumns.bind(C),n(C),g||_q(i,u),i.runHooks(`after${y}`,t,g,h),g||(i.runHooks("afterChange",null,u),i.view.adjustElementsSize(),i.render()),i.getSettings().ariaTags&&gn(i.rootElement,[QY(-1),ET(i.countCols()+(i.view?i.countRowHeaders():0))])}function kq(t,e,n){return(e=Txe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Txe(t){var e=jxe(t,"string");return typeof e=="symbol"?e:e+""}function jxe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Mxe{constructor(e){var n=this;kq(this,"metaManager",void 0),kq(this,"metaSyncMemo",new Map),this.metaManager=e,e.addLocalHook("afterGetCellMeta",function(){return n.extendCellMeta(...arguments)}),un.getSingleton().add("beforeRender",r=>{r&&this.metaSyncMemo.clear()},this.metaManager.hot)}extendCellMeta(e){var n;const{row:r,col:i}=e;if((n=this.metaSyncMemo.get(r))!==null&&n!==void 0&&n.has(i))return;const{visualRow:s,visualCol:a}=e,u=this.metaManager.hot,h=u.colToProp(a);e.prop=h,u.runHooks("beforeGetCellMeta",s,a,e);const m=Ps(e,"type")?e.type:null;let g=ri(e.cells)?e.cells(r,i,h):null;if(m)if(g){var y;g.type=(y=g.type)!==null&&y!==void 0?y:m}else g={type:m};g&&this.metaManager.updateCellMeta(r,i,g),u.runHooks("afterGetCellMeta",s,a,e),this.metaSyncMemo.has(r)||this.metaSyncMemo.set(r,new Set),this.metaSyncMemo.get(r).add(i)}}function Pxe(t,e,n){Axe(t,e),e.set(t,n)}function Axe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Q4(t,e,n){return(e=Oxe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Oxe(t){var e=Ixe(t,"string");return typeof e=="symbol"?e:e+""}function Ixe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Dxe(t,e){return t.get(Hxe(t,e))}function Hxe(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Tq=new WeakSet,jq=new WeakSet;var Mq=new WeakMap;class Lxe{constructor(e){Q4(this,"metaManager",void 0),Q4(this,"usageTracker",new Set),Q4(this,"propDescriptors",new Map([["ariaTags",{initOnly:!0}],["fixedColumnsLeft",{target:"fixedColumnsStart",onChange(n){this.metaManager.hot.isRtl()&&n==="fixedColumnsLeft"&>("The `fixedColumnsLeft` is not supported for RTL. Please use option `fixedColumnsStart`."),this.usageTracker.has("fixedColumnsLeft")&&this.usageTracker.has("fixedColumnsStart")&>("The `fixedColumnsLeft` and `fixedColumnsStart` should not be used together. Please use only the option `fixedColumnsStart`.")}}],["correctFormat",{onChange(){Tq.has(this.metaManager.hot)||(Tq.add(this.metaManager.hot),xg("The `correctFormat` option is deprecated and will be removed in the next major release.\n\nMigration guide: https://handsontable.com/docs/migration-from-16.2-to-17.0/"))}}],["datePickerConfig",{onChange(){jq.has(this.metaManager.hot)||(jq.add(this.metaManager.hot),xg("The `datePickerConfig` option is deprecated and will be removed in the next major release.\n\nMigration guide: https://handsontable.com/docs/migration-from-16.2-to-17.0/"))}}],["layoutDirection",{initOnly:!0}],["renderAllColumns",{initOnly:!0}],["renderAllRows",{initOnly:!0}]])),Pxe(this,Mq,(n,r,i)=>{i||gt(`The \`${n}\` option can not be updated after the Handsontable is initialized.`)}),this.metaManager=e,this.extendMetaProps()}extendMetaProps(){this.propDescriptors.forEach((e,n)=>{const{initOnly:r,target:i,onChange:s}=e,a=typeof i=="string",u=a?i:n,h=`_${u}`;this.metaManager.globalMeta.meta[h]=this.metaManager.globalMeta.meta[u],s?(this.installPropWatcher(n,h,s),a&&this.installPropWatcher(i,h,s)):r&&(this.installPropWatcher(n,h,Dxe(Mq,this)),this.metaManager.globalMeta.meta._initOnlySettings||(this.metaManager.globalMeta.meta._initOnlySettings=[]),this.metaManager.globalMeta.meta._initOnlySettings.push(n))})}installPropWatcher(e,n,r){const i=this;Object.defineProperty(this.metaManager.globalMeta.meta,e,{get(){return this[n]},set(s){const a=!i.usageTracker.has(e);i.usageTracker.add(e),r.call(i,e,s,a),this[n]=s},enumerable:!0,configurable:!0})}}function $xe(t,e){Aq(t,e),e.add(t)}function Pq(t,e,n){Aq(t,e),e.set(t,n)}function Aq(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Oq(t,e){return t.get(dw(t,e))}function Iq(t,e,n){return t.set(dw(t,e),n),n}function dw(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Z4=new WeakMap,J4=new WeakMap,zR=new WeakSet;class Fxe{constructor(e){let{rowIndexMapper:n,columnIndexMapper:r}=e;$xe(this,zR),Pq(this,Z4,void 0),Pq(this,J4,void 0),Iq(Z4,this,n),Iq(J4,this,r)}toRenderable(e){const n=e.getVerticalDirection()==="N-S"?1:-1,r=e.getHorizontalDirection()==="W-E"?1:-1,i=dw(zR,this,Dq).call(this,e.from,n,r);if(i===null)return null;const s=dw(zR,this,Dq).call(this,e.to,-n,-r);if(s===null)return null;const a=e.clone();return a.from=i,a.to=s,a.includes(e.highlight)||(a.highlight=i),a}}function Dq(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e;const r=dw(zR,this,Hq).call(this,Oq(Z4,this),t.row,e);if(r===null)return null;const i=dw(zR,this,Hq).call(this,Oq(J4,this),t.col,n);return i===null?null:t.clone().assign({row:r,col:i})}function Hq(t,e,n){return e<0?e:t.getNearestNotHiddenIndex(e,n)}function hw(t){Cm(t)&&t.scrollIntoView({block:"nearest",inline:"nearest"})}function jj(t){const{selection:e,view:n}=t,r=t.getSelectedRangeActive(),i=e.getSelectionSource(),s=n.getFirstFullyVisibleColumn(),a=n.getLastFullyVisibleColumn(),u=r.getTopStartCorner().col,h=r.getBottomEndCorner().col,m=u<=s,g=h>=a,y=n.getFirstFullyVisibleRow(),x=n.getLastFullyVisibleRow(),C=r.getTopStartCorner().row,E=r.getBottomEndCorner().row,M=C<=y,j=E>=x;return{getComputedColumnTarget(L){return i==="mouse"||i==="keyboard"?L.col:m&&g?r.highlight.col:m?u:g?h:L.col},getComputedRowTarget(L){return i==="mouse"||i==="keyboard"?L.row:M&&j?r.highlight.row:M?C:j?E:L.row}}}function zxe(t){return e=>{const n=jj(t).getComputedColumnTarget(e);t.scrollViewportTo({col:n},()=>{const r=!!t.getSettings().colHeaders;hw(t.getCell(r?-1:0,n,!0))})}}function Vxe(){return()=>{}}function Bxe(t){return e=>{t.scrollViewportTo(e.toObject(),()=>{const n=t.getSelectedRangeActive();if(!n)return;const{row:r,col:i}=n.highlight;hw(t.getCell(r,i,!0))})}}function Wxe(t){return e=>{const n=jj(t),r={row:n.getComputedRowTarget(e),col:n.getComputedColumnTarget(e)};t.scrollViewportTo(r,()=>{const{row:i,col:s}=r;hw(t.getCell(i,s,!0))})}}function Uxe(t){return e=>{const n=jj(t),r={row:n.getComputedRowTarget(e),col:n.getComputedColumnTarget(e)};t.scrollViewportTo(r,()=>{const{row:i,col:s}=r;hw(t.getCell(i,s,!0))})}}function Yxe(t){return e=>{const n=jj(t).getComputedRowTarget(e);t.scrollViewportTo({row:n},()=>{const r=!!t.getSettings().rowHeaders;hw(t.getCell(n,r?-1:0,!0))})}}function Gxe(t){return e=>{const n=t.selection.getSelectionSource(),{row:r,col:i}=e,s=()=>{hw(t.getCell(r,i,!0))};if(r<0&&i>=0)t.scrollViewportTo({col:i},s);else if(i<0&&r>=0)t.scrollViewportTo({row:r},s);else{if(n==="mouse"&&(i===t.view.getLastPartiallyVisibleColumn()||r===t.view.getLastPartiallyVisibleRow()))return;t.scrollViewportTo({row:r,col:i},s)}}}function Kxe(t){const{selection:e}=t;let n=!1,r=!1;return{resume(){r=!1},suspend(){r=!0},skipNextScrollCycle(){n=!0},scrollTo(i){var s;if(n||r){n=!1;return}let a;e.isFocusSelectionChanged()?a=Bxe(t):e.isSelectedByCorner()?a=Vxe():e.isSelectedByRowHeader()?a=Yxe(t):e.isSelectedByColumnHeader()?a=zxe(t):e.getSelectedRange().size()===1&&e.isMultiple()?a=Wxe(t):e.getSelectedRange().size()===1&&!e.isMultiple()?a=Gxe(t):e.getSelectedRange().size()>1&&(a=Uxe(t)),(s=a)===null||s===void 0||s(i)}}}const qxe=Object.freeze({INLINE:"inline",MODAL:"modal"}),Q0=Object.freeze({UNKNOWN:"unknown",CLICK:"click",TAB_FROM_ABOVE:"tab_from_above",TAB_FROM_BELOW:"tab_from_below"}),Xxe="grid";function Qxe(t,e){const n=Lq(t,Q0.TAB_FROM_ABOVE),r=Lq(t,Q0.TAB_FROM_BELOW);return e.prepend(n),e.append(r),{activate(){n.tabIndex=0,r.tabIndex=0},deactivate(){n.tabIndex=-1,r.tabIndex=-1},destroy(){n.remove(),r.remove()}}}function Lq(t,e){const r=t.rootDocument.createElement("div");return r.style.display="none",r.classList.add("htFocusCatcher"),r.dataset.htFocusSource=e,r}function Zxe(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r={shortcutsContextName:Xxe,type:qxe.INLINE,contains:C=>C===e||e.contains(C),runOnlyIf:()=>!0,...n},i=Qxe(t,e);return{getType:()=>r.type,hasContainerDetached:()=>!t.rootWrapperElement.contains(e),getShortcutsContextName:()=>r.shortcutsContextName,runOnlyIf:()=>r.runOnlyIf(),contains:C=>r.contains(C),activate:function(){var C;let E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Q0.UNKNOWN;(C=r.onActivate)===null||C===void 0||C.call(r,E)},deactivate:()=>{var C;(C=r.onDeactivate)===null||C===void 0||C.call(r)},activateFocusCatchers:()=>{i==null||i.activate()},deactivateFocusCatchers:()=>{i==null||i.deactivate()},enable:()=>{e.removeAttribute("inert")},disable:()=>{e.setAttribute("inert","true")},destroy:()=>{i==null||i.destroy()}}}function Jxe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=!1;function r(g){if(!n){var y;(y=e.onFocus)===null||y===void 0||y.call(e,g)}}function i(g){var y;(y=e.onClick)===null||y===void 0||y.call(e,g)}function s(g){if(g.key==="Tab"){var y;(y=e.onTabKeyDown)===null||y===void 0||y.call(e,g)}}function a(){n=!0}function u(){n=!1}return{mount:()=>{let g=t;for(;g;){const{documentElement:y}=g.document;y.addEventListener("focusin",r),y.addEventListener("click",i),y.addEventListener("keydown",s),y.addEventListener("mousedown",a),y.addEventListener("mouseup",u),g=wg(g)}},unmount:()=>{let g=t;for(;g;){const{documentElement:y}=g.document;y.removeEventListener("focusin",r),y.removeEventListener("click",i),y.removeEventListener("keydown",s),y.removeEventListener("mousedown",a),y.removeEventListener("mouseup",u),g=wg(g)}}}}function ewe(t){const e=mR({errorIdExists:E=>`The "${E}" focus scope is already registered.`}),n=t.getShortcutManager();let r=null;function i(){return r?e.getId(r):null}function s(E,M){let j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};e.hasItem(E)&>(`Scope with id "${E}" already registered`);const L=Zxe(t,M,j);e.addItem(E,L),n.getOrCreateContext(L.getShortcutsContextName())}function a(E){e.hasItem(E)||gt(`Scope with id "${E}" not found`),e.getItem(E).destroy(),e.removeItem(E)}function u(E){e.hasItem(E)||gt(`Scope with id "${E}" not found`),m(e.getItem(E))}function h(E){e.hasItem(E)||gt(`Scope with id "${E}" not found`),g(e.getItem(E))}function m(E){let M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Q0.UNKNOWN;r!==E&&(r!==null&&g(r),r=E,r.activate(M),n.setActiveContextName(E.getShortcutsContextName()))}function g(E){y(),r===E&&(r=null,E.deactivate())}function y(){const E=e.getValues(),M=E.filter(j=>j.runOnlyIf()&&j.getType()==="modal");E.forEach(j=>{M.length>0&&M.includes(j)||M.length===0||j.hasContainerDetached()?j.enable():j.disable(),j===r?j.contains(t.rootDocument.activeElement)?j.deactivateFocusCatchers():j.activateFocusCatchers():j.runOnlyIf()?j.activateFocusCatchers():j.deactivateFocusCatchers()})}function x(E,M){if(!E.isConnected||!P0(E))return;const j=e.getValues().filter(D=>D.runOnlyIf());let L=!1;j.forEach(D=>{!L&&D.contains(E)&&(L=!0,M!==Q0.UNKNOWN&&t.listen(),m(D,M))}),!L&&r&&(g(r),t.unlisten())}const C=Jxe(t.rootWindow,{onFocus:E=>{var M;x(E.target,(M=E.target.dataset.htFocusSource)!==null&&M!==void 0?M:Q0.UNKNOWN)},onClick:E=>{x(E.target,Q0.CLICK)},onTabKeyDown:()=>{y()}});return C.mount(),{getActiveScopeId:i,registerScope:s,unregisterScope:a,activateScope:E=>u(E),deactivateScope:E=>h(E),destroy:()=>C.unmount()}}function twe(t,e){$q(t,e),e.add(t)}function fw(t,e,n){$q(t,e),e.set(t,n)}function $q(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Li(t,e){return t.get(Wd(t,e))}function Z0(t,e,n){return t.set(Wd(t,e),n),n}function Wd(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const mw=Object.freeze({CELL:"cell",MIXED:"mixed"});var Xs=new WeakMap,Mj=new WeakMap,Pj=new WeakMap,Aj=new WeakMap,Oj=new WeakMap,Ij=new WeakMap,Xh=new WeakSet;class nwe{constructor(e){twe(this,Xh),fw(this,Xs,void 0),fw(this,Mj,void 0),fw(this,Pj,1),fw(this,Aj,null),fw(this,Oj,new Map),fw(this,Ij,!1),Z0(Xs,this,e)}init(){var e=this;const n=Li(Xs,this).getSettings();Z0(Mj,this,n.imeFastEdit?mw.MIXED:mw.CELL),Li(Xs,this).addHook("afterUpdateSettings",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Wd(Xh,e,owe).call(e,...i)}),Li(Xs,this).addHook("afterSelection",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Wd(Xh,e,Fq).call(e,...i)}),Li(Xs,this).addHook("afterSelectionFocusSet",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Wd(Xh,e,Fq).call(e,...i)}),Li(Xs,this).addHook("afterSelectionEnd",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Wd(Xh,e,iwe).call(e,...i)}),Li(Xs,this).addHook("afterRender",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Wd(Xh,e,swe).call(e,...i)})}getFocusMode(){return Li(Mj,this)}setFocusMode(e){Object.values(mw).includes(e)?Z0(Mj,this,e):Yn(`"${e}" is not a valid focus mode.`)}getRefocusDelay(){return Li(Pj,this)}setRefocusDelay(e){Z0(Pj,this,e)}setRefocusElementGetter(e){Z0(Aj,this,e)}getRefocusElement(){var e;return typeof Li(Aj,this)=="function"?Li(Aj,this).call(this):(e=Li(Xs,this).getActiveEditor())===null||e===void 0?void 0:e.TEXTAREA}focusOnHighlightedCell(e){const n=r=>{var i,s;const a=(i=Li(Xs,this).getSelectedRangeActive())===null||i===void 0?void 0:i.highlight;if(!a)return;let u=Li(Xs,this).runHooks("modifyFocusedElement",a.row,a.col,r);Cm(u)||(u=r),u&&!((s=Li(Xs,this).getActiveEditor())!==null&&s!==void 0&&s.isOpened())&&u.focus({preventScroll:!0})};e?n(e):Wd(Xh,this,e$).call(this,r=>n(r))}refocusToEditorTextarea(){var e;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Li(Pj,this);if(Li(Xs,this).getSettings().imeFastEdit&&!((e=Li(Xs,this).getActiveEditor())!==null&&e!==void 0&&e.isOpened())){var r,i;(r=Li(Xs,this).getActiveEditor())===null||r===void 0||(i=r.refreshValue)===null||i===void 0||i.call(r),Li(Oj,this).has(n)||Li(Oj,this).set(n,$T(()=>{if(!Li(Xs,this).isDestroyed){var s;(s=this.getRefocusElement())===null||s===void 0||s.select()}},n)),Li(Oj,this).get(n)()}}}function e$(t){var e;const n=(e=Li(Xs,this).getSelectedRangeActive())===null||e===void 0?void 0:e.highlight;if(!n||!Li(Xs,this).selection.isCellVisible(n)){t(null);return}const r=Li(Xs,this).getCell(n.row,n.col,!0);r===null?Li(Xs,this).addHookOnce("afterScroll",()=>{t(Li(Xs,this).getCell(n.row,n.col,!0))}):t(r)}function rwe(){Wd(Xh,this,e$).call(this,t=>{const{activeElement:e}=Li(Xs,this).rootDocument;e&&vG(e)&&e.blur(),this.focusOnHighlightedCell(t)})}function iwe(){Wd(Xh,this,e$).call(this,t=>{this.getFocusMode()===mw.MIXED&&(t==null?void 0:t.nodeName)==="TD"&&this.refocusToEditorTextarea()})}function Fq(){Z0(Ij,this,!0)}function swe(){Li(Ij,this)&&(Z0(Ij,this,!1),Wd(Xh,this,rwe).call(this))}function owe(t){typeof t.imeFastEdit=="boolean"&&this.setFocusMode(t.imeFastEdit?mw.MIXED:mw.CELL)}function awe(t){return e=>{if(!e)return null;const{rowIndexMapper:n,columnIndexMapper:r}=t;if(n.isHidden(e.row)||r.isHidden(e.col))return null;const i=t$(t),s=n$(t);return i===null||s===null?null:(e.row=Lr(e.row,i.row,s.row),e.col=Lr(e.col,i.col,s.col),e)}}function t$(t){const{rowIndexMapper:e,columnIndexMapper:n}=t,{navigableHeaders:r}=t.getSettings();let i=r&&t.countColHeaders()>0?-t.countColHeaders():0,s=r&&t.countRowHeaders()>0?-t.countRowHeaders():0;return i===0&&(i=e.getVisualFromRenderableIndex(i)),s===0&&(s=n.getVisualFromRenderableIndex(s)),i===null||s===null?null:t._createCellCoords(i,s)}function n$(t){var e,n;const{rowIndexMapper:r,columnIndexMapper:i}=t,{navigableHeaders:s}=t.getSettings();let a=r.getRenderableIndexesLength()-1,u=i.getRenderableIndexesLength()-1;if(a<0){if(!s||t.countColHeaders()===0)return null;a=-1}if(u<0){if(!s||t.countColHeaders()===0)return null;u=-1}return t._createCellCoords((e=r.getVisualFromRenderableIndex(a))!==null&&e!==void 0?e:a,(n=i.getVisualFromRenderableIndex(u))!==null&&n!==void 0?n:u)}const VR="gridDefault",r$="grid",Dj="grid.tabNavigation",Pm="editorManager.handlingEditor",lwe="editor",cwe={name:"editorCloseAndSave",callback(t){t._getEditorManager().closeEditorAndSaveChanges()}},uwe="hooksRefRegisterer",zq={_hooksStorage:Object.create(null),addHook(t,e){return this._hooksStorage[t]||(this._hooksStorage[t]=[]),this.hot.addHook(t,e),this._hooksStorage[t].push(e),this},removeHooksByKey(t){Te(this._hooksStorage[t]||[],e=>{this.hot.removeHook(t,e)})},clearHooks(){Mr(this._hooksStorage,(t,e)=>this.removeHooksByKey(e)),this._hooksStorage={}}};xm(zq,"MIXIN_NAME",uwe,{writable:!1,enumerable:!1});function nd(t,e,n){return(e=dwe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dwe(t){var e=hwe(t,"string");return typeof e=="symbol"?e:e+""}function hwe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const fwe="base",Qs=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"});class J0{static get EDITOR_TYPE(){return fwe}constructor(e){nd(this,"hot",void 0),nd(this,"state",Qs.VIRGIN),nd(this,"_opened",!1),nd(this,"_fullEditMode",!1),nd(this,"_closeCallback",null),nd(this,"_closeAfterDataChange",!0),nd(this,"TD",null),nd(this,"row",null),nd(this,"col",null),nd(this,"prop",null),nd(this,"originalValue",null),nd(this,"cellProperties",null),this.hot=e,this.init()}_fireCallbacks(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)}init(){}getValue(){gt("Editor getValue() method unimplemented")}setValue(){gt("Editor setValue() method unimplemented")}open(){gt("Editor open() method unimplemented")}close(){gt("Editor close() method unimplemented")}prepare(e,n,r,i,s,a){this.TD=i,this.row=e,this.col=n,this.prop=r,this.originalValue=s,this.cellProperties=a,this.state=this.isOpened()?this.state:Qs.VIRGIN}extend(){return class extends this.constructor{}}saveValue(e,n){let r,i,s,a;if(n){const h=this.hot.getSelectedRangeActive(),m=h.getTopStartCorner(),g=h.getBottomEndCorner();r=m.row,i=m.col,s=g.row,a=g.col}else[r,i,s,a]=[this.row,this.col,null,null];const u=this.hot.runHooks("modifyGetCellCoords",r,i,!1,"meta");Array.isArray(u)&&([r,i]=u),this.hot.populateFromArray(r,i,e,s,a,"edit")}beginEditing(e,n){if(this.state!==Qs.VIRGIN)return;const r=this.hot,i=r.rowIndexMapper.getRenderableFromVisualIndex(this.row),s=r.columnIndexMapper.getRenderableFromVisualIndex(this.col),a=()=>{if(this.state=Qs.EDITING,this.isInFullEditMode()){const h=this.cellProperties.valueGetter?this.cellProperties.valueGetter(this.originalValue):this.originalValue,m=typeof e=="string"?e:Hi(h);this.setValue(m)}this.open(n),this._opened=!0,this.focus(),r.view.render(),r.runHooks("afterBeginEditing",this.row,this.col)};this.hot.addHookOnce("afterScroll",a),r.view.scrollViewport(r._createCellCoords(i,s))||(this.hot.removeHook("afterScroll",a),a()),this.addHook("beforeDialogShow",()=>this.cancelChanges())}finishEditing(e,n,r){if(r){const i=this._closeCallback;this._closeCallback=s=>{i&&i(s),r(s),this.hot.view.render()}}if(!this.isWaiting()){if(this.state===Qs.VIRGIN){this.hot._registerTimeout(()=>{this._fireCallbacks(!0)});return}if(this.state===Qs.EDITING){if(e){this.cancelChanges(),this.hot.view.render();return}let i=this.getValue();this.cellProperties.trimWhitespace&&(i=typeof i=="string"?String.prototype.trim.call(i||""):i),typeof this.cellProperties.valueParser=="function"&&(i=this.cellProperties.valueParser(i,this.cellProperties)),this.state=Qs.WAITING,this.saveValue([[i]],n),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",s=>{this.state=Qs.FINISHED,this.discardEditor(s)}):(this.state=Qs.FINISHED,this.discardEditor(!0))}}}cancelChanges(){this.state=Qs.FINISHED,this.discardEditor()}discardEditor(e){this.state===Qs.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.hot.selectCell(this.row,this.col),this.focus(),this.state=Qs.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Qs.VIRGIN,this._fireCallbacks(!0),this.hot.getShortcutManager().setActiveContextName("grid")))}enableFullEditMode(){this._fullEditMode=!0}isInFullEditMode(){return this._fullEditMode}isOpened(){return this._opened}isWaiting(){return this.state===Qs.WAITING}getEditedCellRect(){var e;const n=this.getEditedCell();if(!n)return;const{wtOverlays:r,wtViewport:i}=this.hot.view._wt,s=this.hot.rootWindow,a=sl(n),u=po(n),h=sl(this.hot.rootElement),m=po(this.hot.rootElement),g=r.topOverlay.holder,y=r.inlineStartOverlay.holder,x=g!==s?g.scrollTop:0,C=y!==s?y.scrollLeft:0,E=s.innerWidth-h.left-m,{wtTable:M}=(e=r.getParentOverlay(n))!==null&&e!==void 0?e:this.hot.view._wt,j=M.name,L=["master","inline_start"].includes(j)?x:0,D=["master","top","bottom"].includes(j)?C:0,z=a.top===h.top?0:1;let H=a.top-h.top-z-L,V=0;this.hot.isRtl()?V=s.innerWidth-a.left-u-E-1+D:V=a.left-h.left-1-D,["top","top_inline_start_corner"].includes(j)&&(H+=r.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(j)&&(V+=Math.abs(r.inlineStartOverlay.getOverlayOffset()));const F=this.hot.hasColHeaders(),B=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),te=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),ce=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(F&&B<=0||B===ce)&&(H+=1),te<=0&&(V+=1);const _e=i.rowsRenderCalculator.startPosition,pe=i.columnsRenderCalculator.startPosition,Le=Math.abs(r.inlineStartOverlay.getScrollPosition()),Fe=r.topOverlay.getScrollPosition(),nt=go(this.hot.rootDocument);let dt=n.offsetTop;if(["inline_start","master"].includes(j)&&(dt+=_e-Fe),["bottom","bottom_inline_start_corner"].includes(j)){const{wtViewport:we,wtTable:k}=r.bottomOverlay.clone;dt+=we.getWorkspaceHeight()-k.getHeight()-nt}let $e=n.offsetLeft;this.hot.isRtl()?($e>=0?$e=M.getWidth()-n.offsetLeft:$e=Math.abs($e),$e+=pe-Le-u):["top","master","bottom"].includes(j)&&($e+=pe-Le);const Re=s.getComputedStyle(this.TD),Ze=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",Ee=parseInt(Re[Ze],10)>0?0:1,Q=parseInt(Re.borderTopWidth,10)>0?0:1,fe=po(n)+Ee,Ve=Po(n)+Q,ne=pG(g)?nt:0,xe=gG(y)?nt:0,Ke=this.hot.view.maximumVisibleElementWidth($e)-ne+Ee,qe=Math.max(this.hot.view.maximumVisibleElementHeight(dt)-xe+Q,this.hot.stylesHandler.getDefaultRowHeight());return{top:H,start:V,height:Ve,maxHeight:qe,width:fe,maxWidth:Ke}}getEditedCellsLayerClass(){switch(this.checkEditorSection()){case"inline-start":return"ht_clone_left ht_clone_inline_start";case"bottom":return"ht_clone_bottom";case"bottom-inline-start-corner":return"ht_clone_bottom_left_corner ht_clone_bottom_inline_start_corner";case"top":return"ht_clone_top";case"top-inline-start-corner":return"ht_clone_top_left_corner ht_clone_top_inline_start_corner";default:return"ht_clone_master"}}getEditedCell(){return this.hot.getCell(this.row,this.col,!0)}checkEditorSection(){const e=this.hot.countRows();let n="";return this.row<this.hot.getSettings().fixedRowsTop?this.col<this.hot.getSettings().fixedColumnsStart?n="top-inline-start-corner":n="top":this.hot.getSettings().fixedRowsBottom&&this.row>=e-this.hot.getSettings().fixedRowsBottom?this.col<this.hot.getSettings().fixedColumnsStart?n="bottom-inline-start-corner":n="bottom":this.col<this.hot.getSettings().fixedColumnsStart&&(n="inline-start"),n}}ci(J0,zq);const mwe={name:"editorCloseAndSaveByArrowKeys",callback(t,e,n){const r=t._getEditorManager(),i=r.getActiveEditor();i.isInFullEditMode()&&i.state===Qs.EDITING||(r.closeEditorAndSaveChanges(),t.getSelected()&&(n.includes("arrowdown")?t.selection.transformStart(1,0):n.includes("arrowup")?t.selection.transformStart(-1,0):n.includes("arrowleft")?t.selection.transformStart(0,-1*t.getDirectionFactor()):n.includes("arrowright")&&t.selection.transformStart(0,t.getDirectionFactor())),e.preventDefault())}},pwe={name:"editorCloseAndSaveByEnter",callback(t,e){const n=t._getEditorManager();n.closeEditorAndSaveChanges(e.ctrlKey||e.metaKey),n.moveSelectionAfterEnter(e)}},gwe={name:"editorCloseWithoutSaving",callback(t){const e=t._getEditorManager();e.closeEditorAndRestoreOriginalValue(t.getShortcutManager().isCtrlPressed()),e.activeEditor.focus()}},vwe={name:"editorFastOpen",callback(t,e){const{highlight:n}=t.getSelectedRangeActive();n.isHeader()||t._getEditorManager().openEditor(null,e,!0)}},bwe={name:"editorOpen",callback(t,e,n){const{selection:r}=t,i=t._getEditorManager(),s=t.getSelectedRange(),a=t.getSelectedRangeActive(),{highlight:u}=a;if((s.some(h=>r.isMultiple(h))||s.length>1)&&!a.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0){const h=t.getSettings(),m=typeof h.enterMoves=="function"?h.enterMoves(e):h.enterMoves;n.includes("shift")?r.transformFocus(-m.row,-m.col):r.transformFocus(m.row,m.col);return}u.isHeader()||(t.getSettings().enterBeginsEditing?i.cellProperties.readOnly?i.moveSelectionAfterEnter(e):i.openEditor(null,e,!0):i.moveSelectionAfterEnter(e),iu(e))}};function ywe(){return[cwe,mwe,pwe,gwe,vwe,bwe]}const xwe={name:"extendCellsSelectionDown",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeActive();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(1,0),e.markEndSource())}},wwe={name:"extendCellsSelectionDownByViewportHeight",callback(t){const{selection:e,rowIndexMapper:n}=t,{to:r}=t.getSelectedRangeActive(),i=Math.min(r.row+t.countVisibleRows(),t.countRows()-1),s=n.getNearestNotHiddenIndex(i,-1);if(s!==null){const a=t._createCellCoords(s,r.col),u=r.row-t.getFirstFullyVisibleRow(),h=Math.min(a.row-u,t.countRows()-1);e.markSource("keyboard"),e.setRangeEnd(a,t.getActiveSelectionLayerIndex()),e.markEndSource(),t.scrollViewportTo({row:h,verticalSnap:"top",horizontalSnap:"start"})}}},Cwe={name:"extendCellsSelectionLeft",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeActive();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,-1*t.getDirectionFactor()),e.markEndSource())}},Swe={name:"extendCellsSelectionRight",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeActive();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,t.getDirectionFactor()),e.markEndSource())}},Rwe={name:"extendCellsSelectionToColumns",callback(t){const{selection:e}=t,{highlight:n,from:r,to:i}=t.getSelectedRangeActive();e.markSource("keyboard"),e.isSelectedByRowHeader()?e.selectAll(!0,!0):t.selectColumns(r.col,i.col,n),e.markEndSource()}},_we={name:"extendCellsSelectionToMostBottom",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:r,from:i,to:s}=t.getSelectedRangeActive(),a=r.isHeader()&&e.isSelectedByRowHeader();if(r.isCell()||a){const u=n.getNearestNotHiddenIndex(t.countRows()-1,-1),h=i.clone();h.row=r.row,e.markSource("keyboard"),e.setRangeStart(h,void 0,!1,r.clone()),a&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(u,s.col)),e.markEndSource()}}},Ewe={name:"extendCellsSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:s}=t.getSelectedRangeActive();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&r.isCell()){const a=n.getNearestNotHiddenIndex(t.countCols()-1,-1),u=i.clone();u.col=r.col,e.markSource("keyboard"),e.setRangeStart(u,void 0,!1,r.clone()),e.setRangeEnd(t._createCellCoords(s.row,a)),e.markEndSource()}}},Nwe={name:"extendCellsSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:s}=t.getSelectedRangeActive();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&r.isCell()){const a=parseInt(t.getSettings().fixedColumnsStart,10),u=n.getNearestNotHiddenIndex(a,1),h=i.clone();h.col=r.col,e.markSource("keyboard"),e.setRangeStart(h,void 0,!1,r.clone()),e.setRangeEnd(t._createCellCoords(s.row,u)),e.markEndSource()}}},kwe={name:"extendCellsSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:s}=t.getSelectedRangeActive(),a=r.isHeader()&&e.isSelectedByColumnHeader();if(r.isCell()||a){const u=n.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]),h=i.clone();h.col=r.col,e.markSource("keyboard"),e.setRangeStart(h,void 0,!1,r.clone()),a&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(s.row,u)),e.markEndSource()}}},Twe={name:"extendCellsSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:s}=t.getSelectedRangeActive(),a=r.isHeader()&&e.isSelectedByColumnHeader();if(r.isCell()||a){const u=n.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]),h=i.clone();h.col=r.col,e.markSource("keyboard"),e.setRangeStart(h,void 0,!1,r.clone()),a&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(s.row,u)),e.markEndSource()}}},jwe={name:"extendCellsSelectionToMostTop",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:r,from:i,to:s}=t.getSelectedRangeActive(),a=r.isHeader()&&e.isSelectedByRowHeader();if(r.isCell()||a){const u=n.getNearestNotHiddenIndex(0,1),h=i.clone();h.row=r.row,e.markSource("keyboard"),e.setRangeStart(h,void 0,!1,r.clone()),a&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(u,s.col)),e.markEndSource()}}},Mwe={name:"extendCellsSelectionToRows",callback(t){const{selection:e}=t,{highlight:n,from:r,to:i}=t.getSelectedRangeActive();e.markSource("keyboard"),e.isSelectedByColumnHeader()?e.selectAll(!0,!0):t.selectRows(r.row,i.row,n),e.markEndSource()}},Pwe={name:"extendCellsSelectionUp",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeActive();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(-1,0),e.markEndSource())}},Awe={name:"extendCellsSelectionUpByViewportHeight",callback(t){const{selection:e,rowIndexMapper:n}=t,{to:r}=t.getSelectedRangeActive(),i=Math.max(r.row-t.countVisibleRows(),0),s=n.getNearestNotHiddenIndex(i,1);if(s!==null){const a=t._createCellCoords(s,r.col),u=r.row-t.getFirstFullyVisibleRow(),h=Math.max(a.row-u,0);e.markSource("keyboard"),e.setRangeEnd(a,t.getActiveSelectionLayerIndex()),e.markEndSource(),t.scrollViewportTo({row:h,verticalSnap:"top",horizontalSnap:"start"})}}};function Owe(){return[xwe,wwe,Cwe,Swe,Rwe,_we,Ewe,Nwe,kwe,Twe,jwe,Mwe,Pwe,Awe]}const Iwe={name:"moveCellSelectionDown",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(1,0),e.markEndSource()}},Dwe={name:"moveCellSelectionDownByViewportHeight",callback(t){const{selection:e}=t,{navigableHeaders:n}=t.getSettings(),r=n?t.countColHeaders():0,{row:i}=t.getSelectedRangeActive().highlight;let s=t.countVisibleRows()+r;s=s===0?1:s,i===t.countRows()-1?s=1:i+s>t.countRows()&&(s=t.countRows()-i-1),e.markSource("keyboard"),e.transformStart(s,0),e.markEndSource(),t.getSelectedRangeActive().highlight.row<0&&t.scrollViewportTo({row:0})}},Hwe={name:"moveCellSelectionInlineEnd",callback(t,e){const{selection:n}=t,r=t.getSettings(),i=t.getSelectedRange(),s=t.getSelectedRangeActive(),a=typeof r.tabMoves=="function"?r.tabMoves(e):r.tabMoves;n.markSource("keyboard"),(i.some(u=>n.isMultiple(u))||i.length>1)&&!s.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?n.transformFocus(-a.row,-a.col):n.transformStart(-a.row,-a.col),n.markEndSource()}},Lwe={name:"moveCellSelectionInlineStart",callback(t,e){const{selection:n}=t,r=t.getSettings(),i=t.getSelectedRange(),s=t.getSelectedRangeActive(),a=typeof r.tabMoves=="function"?r.tabMoves(e):r.tabMoves;n.markSource("keyboard"),(i.some(u=>n.isMultiple(u))||i.length>1)&&!s.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?n.transformFocus(a.row,a.col):n.transformStart(a.row,a.col),n.markEndSource()}},$we={name:"moveCellSelectionLeft",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,-1*t.getDirectionFactor()),e.markEndSource()}},Fwe={name:"moveCellSelectionRight",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,t.getDirectionFactor()),e.markEndSource()}},zwe={name:"moveCellSelectionToMostBottom",callback(t){const{selection:e}=t,{col:n}=t.getSelectedRangeActive().highlight;let r=t.rowIndexMapper.getNearestNotHiddenIndex(t.countRows()-1,-1);r===null&&(r=-1),e.setRangeStart(t._createCellCoords(r,n))}},Vwe={name:"moveCellSelectionToMostBottomInlineEnd",callback(t){const{selection:e,rowIndexMapper:n,columnIndexMapper:r}=t,i=parseInt(t.getSettings().fixedRowsBottom,10),s=n.getNearestNotHiddenIndex(t.countRows()-i-1,-1),a=r.getNearestNotHiddenIndex(t.countCols()-1,-1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(s,a)),e.markEndSource()}},Bwe={name:"moveCellSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t;e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(t.getSelectedRangeActive().highlight.row,n.getNearestNotHiddenIndex(t.countCols()-1,-1))),e.markEndSource()}},Wwe={name:"moveCellSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:n}=t,r=parseInt(t.getSettings().fixedColumnsStart,10),i=t.getSelectedRangeActive().highlight.row,s=n.getNearestNotHiddenIndex(r,1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(i,s)),e.markEndSource()}},Uwe={name:"moveCellSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:n}=t,r=t.getSelectedRangeActive().highlight.row;let i=n.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]);i===null&&(i=t.isRtl()?-1:-t.countRowHeaders()),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,i)),e.markEndSource()}},Ywe={name:"moveCellSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:n}=t,{row:r}=t.getSelectedRangeActive().highlight;let i=n.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]);i===null&&(i=t.isRtl()?-t.countRowHeaders():-1),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,i)),e.markEndSource()}},Gwe={name:"moveCellSelectionToMostTop",callback(t){const{selection:e}=t,{col:n}=t.getSelectedRangeActive().highlight;let r=t.rowIndexMapper.getNearestNotHiddenIndex(0,1);r===null&&(r=-t.countColHeaders()),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,n)),e.markEndSource()}},Kwe={name:"moveCellSelectionToMostTopInlineStart",callback(t){const{selection:e,rowIndexMapper:n,columnIndexMapper:r}=t,i=parseInt(t.getSettings().fixedRowsTop,10),s=parseInt(t.getSettings().fixedColumnsStart,10),a=n.getNearestNotHiddenIndex(i,1),u=r.getNearestNotHiddenIndex(s,1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(a,u)),e.markEndSource()}},qwe={name:"moveCellSelectionUp",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(-1,0),e.markEndSource()}},Xwe={name:"moveCellSelectionUpByViewportHight",callback(t){const{selection:e}=t,{navigableHeaders:n}=t.getSettings(),r=n?t.countColHeaders():0,{row:i}=t.getSelectedRangeActive().highlight;let s=t.countVisibleRows()+r;s=s===0?-1:-s,i===-r?s=-1:i+s<r&&(s=-(i+r)),e.markSource("keyboard"),e.transformStart(s,0),e.markEndSource(),t.getSelectedRangeActive().highlight.row<0&&t.scrollViewportTo({row:0})}};function Qwe(){return[Iwe,Dwe,Hwe,Lwe,$we,Fwe,zwe,Vwe,Bwe,Wwe,Uwe,Ywe,Gwe,Kwe,qwe,Xwe]}const Zwe={name:"emptySelectedCells",callback(t){t.emptySelectedCells(),t._getEditorManager().prepareEditor()}},Jwe={name:"scrollToFocusedCell",callback(t){const{highlight:e}=t.getSelectedRangeActive(),n=t.getFirstFullyVisibleRow()-1,r=t.getFirstFullyVisibleColumn()-1,i=t.getLastFullyVisibleRow()+1,s=t.getLastFullyVisibleColumn()+1,a=t._createCellCoords(n,r),u=t._createCellCoords(i,s);if(!t._createCellRange(a,a,u).includes(e)&&(e.row>=0||e.col>=0)){const m={};if(e.col>=0){const g=Math.floor(t.countVisibleCols()/2);m.col=Math.max(e.col-g,0)}if(e.row>=0){const g=Math.floor(t.countVisibleRows()/2);m.row=Math.max(e.row-g,0)}t.scrollViewportTo({...m,verticalSnap:"top",horizontalSnap:"start"})}}},eCe={name:"selectAllCells",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!0}),e.markEndSource()}},tCe={name:"selectAllCellsAndHeaders",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!1}),e.markEndSource()}},nCe={name:"populateSelectedCellsData",callback(t){const e=t.getSelectedRange(),{row:n,col:r}=e[e.length-1].highlight.normalize(),i=t.getDataAtCell(n,r),s=new Map;for(let a=0;a<e.length;a++)e[a].forAll((u,h)=>{if(u>=0&&h>=0&&(u!==n||h!==r)){const{readOnly:m}=t.getCellMeta(u,h);m||s.set(`${u}x${h}`,[u,h,i])}});t.setDataAtCell(Array.from(s.values()))}},rCe={name:"tabNavigation",callback(t){const e={wrapped:!1,flipped:!1};let n=!1,r=!1;return t.addHook("afterSelection",(i,s,a,u,h)=>{n&&(e.wrapped&&e.flipped||r)&&(r=!1,h.value=!0)}),t.addHook("beforeRowWrap",(i,s,a)=>{e.wrapped=!0,e.flipped=a}),{before(){const{tabNavigation:i}=t.getSettings();n=!0,i||(r=!0)},after(i){const{tabNavigation:s,autoWrapRow:a}=t.getSettings();if(n=!1,!s||!t.selection.isSelected()||a&&e.wrapped&&e.flipped||!a&&e.wrapped)return e.wrapped=!1,e.flipped=!1,t.deselectCell(),!1;i.preventDefault()}}}},iCe=[...ywe(),...Owe(),...Qwe(),Zwe,Jwe,eCe,tCe,nCe,rCe];function Vq(t){const e={};return iCe.forEach(n=>{let{name:r,callback:i}=n;e[r]=function(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];return i(t,...a)}}),e}function sCe(t){const e=t.getShortcutManager().addContext(lwe),n=Vq(t),r={group:Pm};e.addShortcuts([{keys:[["Enter"],["Enter","Shift"]],callback:(i,s)=>n.editorCloseAndSaveByEnter(i,s)},{keys:[["Enter","Control/Meta"],["Enter","Control/Meta","Shift"]],captureCtrl:!0,callback:(i,s)=>n.editorCloseAndSaveByEnter(i,s)},{keys:[["Tab"],["Tab","Shift"],["PageDown"],["PageUp"]],forwardToContext:t.getShortcutManager().getContext(r$),callback:(i,s)=>n.editorCloseAndSave(i,s)},{keys:[["ArrowDown"],["ArrowUp"],["ArrowLeft"],["ArrowRight"]],preventDefault:!1,callback:(i,s)=>n.editorCloseAndSaveByArrowKeys(i,s)},{keys:[["Escape"],["Escape","Control/Meta"]],callback:()=>n.editorCloseWithoutSaving()}],r)}function oCe(t){const e=t.getShortcutManager().addContext(r$),n=Vq(t),r={runOnlyIf:()=>{const{navigableHeaders:s}=t.getSettings();return Lt(t.getSelected())&&(s||!s&&t.countRenderedRows()>0&&t.countRenderedCols()>0)},group:VR};e.addShortcuts([{keys:[["F2"]],callback:s=>n.editorFastOpen(s)},{keys:[["Enter"],["Enter","Shift"]],callback:(s,a)=>n.editorOpen(s,a)},{keys:[["Backspace"],["Delete"]],callback:()=>n.emptySelectedCells()}],{group:Pm,runOnlyIf:()=>Lt(t.getSelected())}),e.addShortcuts([{keys:[["Control/Meta","A"]],callback:()=>n.selectAllCells(),runOnlyIf:()=>{var s;return Lt(t.getSelected())&&!((s=t.getSelectedRangeActive())!==null&&s!==void 0&&s.highlight.isHeader())}},{keys:[["Control/Meta","A"]],callback:()=>{},runOnlyIf:()=>{var s;return Lt(t.getSelected())&&((s=t.getSelectedRangeActive())===null||s===void 0?void 0:s.highlight.isHeader())},preventDefault:!0},{keys:[["Control/Meta","Shift","Space"]],callback:()=>n.selectAllCellsAndHeaders()},{keys:[["Control/Meta","Enter"]],callback:()=>n.populateSelectedCellsData(),runOnlyIf:()=>Lt(t.getSelected())&&!t.getSelectedRangeActive().highlight.isHeader()&&t.getSelectedRangeActive().getCellsCount()>1},{keys:[["Control","Space"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToColumns()},{keys:[["Shift","Space"]],stopPropagation:!0,callback:()=>n.extendCellsSelectionToRows()},{keys:[["ArrowUp"]],callback:()=>n.moveCellSelectionUp()},{keys:[["ArrowUp","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostTop()},{keys:[["ArrowUp","Shift"]],callback:()=>n.extendCellsSelectionUp()},{keys:[["ArrowUp","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostTop(),runOnlyIf:()=>Lt(t.getSelected())&&!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowDown"]],callback:()=>n.moveCellSelectionDown()},{keys:[["ArrowDown","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostBottom()},{keys:[["ArrowDown","Shift"]],callback:()=>n.extendCellsSelectionDown()},{keys:[["ArrowDown","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostBottom(),runOnlyIf:()=>Lt(t.getSelected())&&!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowLeft"]],callback:()=>n.moveCellSelectionLeft()},{keys:[["ArrowLeft","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostLeft()},{keys:[["ArrowLeft","Shift"]],callback:()=>n.extendCellsSelectionLeft()},{keys:[["ArrowLeft","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostLeft(),runOnlyIf:()=>Lt(t.getSelected())&&!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["ArrowRight"]],callback:()=>n.moveCellSelectionRight()},{keys:[["ArrowRight","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostRight()},{keys:[["ArrowRight","Shift"]],callback:()=>n.extendCellsSelectionRight()},{keys:[["ArrowRight","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostRight(),runOnlyIf:()=>Lt(t.getSelected())&&!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["Home"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostInlineStart(),runOnlyIf:()=>Lt(t.getSelected())&&t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["Home","Shift"]],callback:()=>n.extendCellsSelectionToMostInlineStart()},{keys:[["Home","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostTopInlineStart(),runOnlyIf:()=>Lt(t.getSelected())&&t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostInlineEnd(),runOnlyIf:()=>Lt(t.getSelected())&&t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End","Shift"]],callback:()=>n.extendCellsSelectionToMostInlineEnd()},{keys:[["End","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostBottomInlineEnd(),runOnlyIf:()=>Lt(t.getSelected())&&t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["PageUp"]],callback:()=>n.moveCellSelectionUpByViewportHight()},{keys:[["PageUp","Shift"]],callback:()=>n.extendCellsSelectionUpByViewportHeight()},{keys:[["PageDown"]],callback:()=>n.moveCellSelectionDownByViewportHeight()},{keys:[["PageDown","Shift"]],callback:()=>n.extendCellsSelectionDownByViewportHeight()},{keys:[["Tab"]],preventDefault:!1,callback:s=>n.moveCellSelectionInlineStart(s)},{keys:[["Shift","Tab"]],preventDefault:!1,callback:s=>n.moveCellSelectionInlineEnd(s)},{keys:[["Control/Meta","Backspace"]],callback:()=>n.scrollToFocusedCell()}],r);const i=n.tabNavigation();e.addShortcuts([{keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:VR,group:Dj,position:"before",callback:s=>i.before(s)},{keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:VR,group:Dj,callback:s=>i.after(s),position:"after"}])}function aCe(t){[oCe,sCe].forEach(e=>e(t))}function lCe(t){var e;const n=awe(t),r={wrapped:!1,flipped:!1};let i,s=!0,a=!1;t.addHook("afterSelection",()=>{if(s){var m;i=(m=t.getSelectedRangeActive())===null||m===void 0?void 0:m.highlight}}),t.addHook("beforeRowWrap",(m,g,y)=>{r.wrapped=!0,r.flipped=y}),t.addHook("beforeEmptyDataStateShow",()=>{a=!0}),t.addHook("beforeEmptyDataStateHide",()=>{a=!1}),t.getShortcutManager().getContext(r$).addShortcuts([{keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:VR,group:Dj,position:"before",callback(){const{tabNavigation:m}=t.getSettings();t.getSelectedRangeActive()&&!m&&(s=!1)}},{keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:VR,group:Dj,callback(m){const{tabNavigation:g,autoWrapRow:y}=t.getSettings();s=!0,(!g||!t.selection.isSelected()||y&&r.wrapped&&r.flipped||!y&&r.wrapped)&&(y&&r.wrapped&&r.flipped&&(i=m.shiftKey?t$(t):n$(t)),r.wrapped=!1,r.flipped=!1)},position:"after"}]);const h=(e=t.rootGridElement)!==null&&e!==void 0?e:t.rootElement;t.getFocusScopeManager().registerScope("grid",h,{contains:m=>h===m||h.contains(m)?!0:m.closest(".htMenu")!==null?!1:t.rootPortalElement.contains(m),runOnlyIf:()=>{const{navigableHeaders:m}=t.getSettings();return(a||!m)&&t.countRenderedRows()===0&&t.countRenderedCols()===0&&t.countRowHeaders()>0&&t.countColHeaders()>0?!1:!m&&t.countRenderedRows()>0&&t.countRenderedCols()>0||m&&(t.countRowHeaders()>0||t.countColHeaders()>0)},onActivate:m=>{if(m==="tab_from_above"){var g;const x=(g=n(i))!==null&&g!==void 0?g:t$(t);x&&t.runHooks("modifyFocusOnTabNavigation","from_above",x)!==!1&&t.selectCell(x.row,x.col)}else if(m==="tab_from_below"){var y;const x=(y=n(i))!==null&&y!==void 0?y:n$(t);x&&t.runHooks("modifyFocusOnTabNavigation","from_below",x)!==!1&&t.selectCell(x.row,x.col)}}})}function cCe(t){[lCe].forEach(e=>e(t))}const Bq=new Map([[" ","space"],["spacebar","space"],["scroll","scrolllock"],["del","delete"],["esc","escape"],["medianexttrack","mediatracknext"],["mediaprevioustrack","mediatrackprevious"],["volumeup","audiovolumeup"],["volumedown","audiovolumedown"],["volumemute","audiovolumemute"],["multiply","*"],["add","+"],["divide","/"],["subtract","-"],["left","arrowleft"],["right","arrowright"],["up","arrowup"],["down","arrowdown"]]),Hj=t=>t.map(e=>{const n=e.toLowerCase();return Bq.has(n)?Bq.get(n):n}).sort().join("+"),uCe=t=>t.split("+"),Wq=new Map([[96,"numpad0"],[97,"numpad1"],[98,"numpad2"],[99,"numpad3"],[100,"numpad4"],[101,"numpad5"],[102,"numpad6"],[103,"numpad7"],[104,"numpad8"],[105,"numpad9"],[106,"multiply"],[107,"add"],[108,"decimal"],[109,"subtract"],[110,"decimal"],[111,"divide"],[112,"f1"],[113,"f2"],[114,"f3"],[115,"f4"],[116,"f5"],[117,"f6"],[118,"f7"],[119,"f8"],[120,"f9"],[121,"f10"],[122,"f11"],[123,"f12"],[186,"semicolon"],[187,"equal"],[188,"comma"],[189,"minus"],[190,"period"],[191,"slash"],[192,"backquote"],[219,"bracketleft"],[220,"backslash"],[221,"bracketright"],[222,"quote"]]),i$=t=>{let{which:e,key:n}=t;if(Wq.has(e))return Wq.get(e);const r=String.fromCharCode(e).toLowerCase();return/^[a-z0-9]$/.test(r)?r:n.toLowerCase()},Uq=Symbol("shortcut-context");function s$(t){return nn(t)&&t.__kindOf===Uq}const dCe=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"table";const n=mR({errorIdExists:m=>`The "${m}" shortcut is already registered in the "${t}" context.`}),r=function(){let{keys:m,callback:g,group:y,runOnlyIf:x=()=>!0,captureCtrl:C=!1,preventDefault:E=!0,stopPropagation:M=!1,relativeToGroup:j,position:L,forwardToContext:D}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ls(y)&>("You need to define the shortcut's group."),ri(g)===!1&>("The shortcut's callback needs to be a function."),Array.isArray(m)===!1&>(Jr`Pass the shortcut\'s keys as an array of arrays,\x20 using the KeyboardEvent.key properties:\x20 https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.`);const z={callback:g,group:y,runOnlyIf:x,captureCtrl:C,preventDefault:E,stopPropagation:M};Lt(j)&&(z.relativeToGroup=j,z.position=L),s$(D)&&(z.forwardToContext=D),m.forEach(H=>{const V=Hj(H);if(n.hasItem(V)){const B=n.getItem(V);let te=B.findIndex(ve=>ve.group===j);te!==-1?L==="before"?te-=1:te+=1:te=B.length,B.splice(te,0,z)}else n.addItem(V,[z])})},i=function(m){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m.forEach(y=>{Mr(g,(x,C)=>{Object.prototype.hasOwnProperty.call(y,C)===!1&&(y[C]=g[C])}),r(y)})},s=m=>{const g=Hj(m);n.removeItem(g)};return{__kindOf:Uq,scope:e,addShortcut:r,addShortcuts:i,getShortcuts:m=>{const g=Hj(m),y=n.getItem(g);return Lt(y)?y.slice():[]},hasShortcut:m=>{const g=Hj(m);return n.hasItem(g)},removeShortcutsByKeys:s,removeShortcutsByGroup:m=>{n.getItems().forEach(y=>{let[x,C]=y;const E=C.filter(M=>M.group!==m);E.length===0?s(uCe(x)):(C.length=0,C.push(...E))})}}};function hCe(){const t=new Set;return{press(e){t.add(e)},release(e){t.delete(e)},releaseAll(){t.clear()},isPressed(e){return t.has(e)}}}const fCe=["meta","alt","shift","control"],BR=hCe(),WR=[];let Lj=0;function mCe(t,e,n,r,i){const s=C=>fCe.includes(C),a=function(C){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const M=[];return C.altKey&&M.push("alt"),E&&(C.ctrlKey||C.metaKey)?M.push("control/meta"):(C.ctrlKey&&M.push("control"),C.metaKey&&M.push("meta")),C.shiftKey&&M.push("shift"),M},u=C=>{if(e(C)===!1||n(C)===!1||C.keyCode===229||typeof C.key!="string"||A0(C))return;const M=i$(C);let j=[];s(M)||(j=a(C));const L=[M].concat(j);!i(C,L)&&(sG()&&j.includes("meta")||!sG()&&j.includes("control"))&&i(C,[M].concat(a(C,!0))),r(C)},h=C=>{if(typeof C.key=="string"){const E=i$(C);s(E)&&BR.press(E)}},m=C=>{if(typeof C.key=="string"){const E=i$(C);s(E)&&BR.release(E)}},g=()=>{BR.releaseAll()};return{mount:()=>{let C=t;for(Lj+=1;C;)Lj===1&&(C.document.documentElement.addEventListener("keydown",h),WR.push({event:"keydown",listener:h}),C.document.documentElement.addEventListener("keyup",m),WR.push({event:"keyup",listener:m})),C.document.documentElement.addEventListener("keydown",u),C.document.documentElement.addEventListener("blur",g),C=wg(C)},unmount:()=>{let C=t;for(Lj-=1;C;){if(Lj===0){for(let E=0;E<WR.length;E++){const{event:M,listener:j}=WR[E];C.document.documentElement.removeEventListener(M,j)}WR.length=0}C.document.documentElement.removeEventListener("keydown",u),C.document.documentElement.removeEventListener("blur",g),C=wg(C)}},isPressed:C=>BR.isPressed(C),releasePressedKeys:()=>BR.releaseAll()}}const pCe=t=>{let{ownerWindow:e,handleEvent:n,beforeKeyDown:r,afterKeyDown:i}=t;const s=mR({errorIdExists:j=>`The "${j}" context name is already registered.`});let a="grid";const u=function(j){let L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"table";const D=dCe(j,L);return s.addItem(j,D),D},h=()=>a,m=j=>s.getItem(j),g=function(j){var L;let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"table";return(L=m(j))!==null&&L!==void 0?L:u(j,D)},y=j=>{s.hasItem(j)||gt(Jr`You've tried to activate the "${j}" shortcut context\x20 that does not exist. Before activation, register the context using the "addContext" method.`),a=j};let x=!1;const C=function(j,L){let D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h();const z=s$(D)?D:m(D);let H=!1;if(!z.hasShortcut(L))return H;const V=z.getShortcuts(L);for(let F=0;F<V.length;F++){const{callback:B,runOnlyIf:te,preventDefault:ve,stopPropagation:ce,captureCtrl:_e,forwardToContext:pe}=V[F];if(te(j)===!0){if(x=_e,H=B(j,L)===!1,x=!1,ve&&j.preventDefault(),ce&&(iu(j),j.stopPropagation()),H)break;pe&&C(j,L,pe)}}return H},M=mCe(e,j=>{const L=h(),D=s$(L)?L:m(L);return n(j,D.scope)},r,i,C);return M.mount(),{addContext:u,getActiveContextName:h,getContext:m,getOrCreateContext:g,setActiveContextName:y,isCtrlPressed:()=>!x&&(M.isPressed("control")||M.isPressed("meta")),releasePressedKeys:()=>M.releasePressedKeys(),destroy:()=>M.unmount()}};function o$(t){const{classNames:e}=Dpe(t,/ht-theme-[a-zA-Z0-9_-]+/);return e.pop()}const gCe=`/*! * Copyright (c) HANDSONCODE sp. z o. o. * * HANDSONTABLE is a software distributed by HANDSONCODE sp. z o. o., a Polish corporation based in * Gdynia, Poland, at Aleja Zwyciestwa 96-98, registered by the District Court in Gdansk under number * 538651, EU tax ID number: PL5862294002, share capital: PLN 62,800.00. * * This software is protected by applicable copyright laws, including international treaties, and dual- * licensed - depending on whether your use for commercial purposes, meaning intended for or * resulting in commercial advantage or monetary compensation, or not. * * If your use is strictly personal or solely for evaluation purposes, meaning for the purposes of testing * the suitability, performance, and usefulness of this software outside the production environment, * you agree to be bound by the terms included in the "handsontable-non-commercial-license.pdf" file. * * Your use of this software for commercial purposes is subject to the terms included in an applicable * license agreement. * * In any case, you must not make any such use of this software as to develop software which may be * considered competitive with this software. * * UNLESS EXPRESSLY AGREED OTHERWISE, HANDSONCODE PROVIDES THIS SOFTWARE ON AN "AS IS" * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, AND IN NO EVENT AND UNDER NO * LEGAL THEORY, SHALL HANDSONCODE BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM * USE OR INABILITY TO USE THIS SOFTWARE. * * Version: 17.0.0 * Release date: 09/03/2026 (built at 09/03/2026 08:59:19) */ .ht-root-wrapper { font-family: var(--ht-font-family), -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; position: relative; display: flex; flex-direction: column; height: 100%; } .htFocusCatcher { display: block !important; position: absolute; width: 0; height: 0; margin: 0; padding: 0; border: 0; opacity: 0; z-index: -1; } .ht-grid { flex: 1 1 auto; min-height: 0; } .handsontable { font-family: var(--ht-font-family), -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; position: relative; font-size: var(--ht-font-size); line-height: var(--ht-line-height); font-weight: var(--ht-font-weight); letter-spacing: var(--ht-letter-spacing); color: var(--ht-foreground-color); /* Miscellaneous */ touch-action: manipulation; scrollbar-width: thin; scrollbar-color: var(--ht-scrollbar-thumb-color) var(--ht-scrollbar-track-color); } .handsontable .wtHolder::-webkit-scrollbar { width: 9px; height: 9px; } .handsontable .wtHolder::-webkit-scrollbar-track { background: var(--ht-scrollbar-track-color); border-radius: var(--ht-scrollbar-border-radius); } .handsontable .wtHolder::-webkit-scrollbar-thumb { background-color: var(--ht-scrollbar-thumb-color); border-radius: var(--ht-scrollbar-border-radius); } .handsontable .wtHolder::-webkit-scrollbar-corner { background: var(--ht-scrollbar-track-color); border-end-end-radius: var(--ht-scrollbar-border-radius); } .handsontable.ht-wrapper { border-radius: var(--ht-wrapper-border-radius, 0); height: 100%; width: 100%; } .handsontable.ht-wrapper:not(.htFirstDatasetColumnNotRendered) td:first-of-type { border-inline-start-width: 1px; } .handsontable.ht-wrapper::before { content: ""; display: block; position: absolute; inset: 0; border: var(--ht-wrapper-border-width) solid var(--ht-wrapper-border-color); border-radius: var(--ht-wrapper-border-radius, 0); z-index: 999; pointer-events: none; overflow: hidden; } .handsontable.htGhostTable table thead th { border-bottom-width: 0; } .handsontable.htGhostTable table tbody tr:first-of-type th:first-child, .handsontable.htGhostTable table tbody tr:first-of-type td:first-child { height: calc(var(--ht-cell-vertical-padding) * 2 + var(--ht-line-height) + 1px); } .handsontable.htGhostTable table tbody tr th, .handsontable.htGhostTable table tbody tr td { border-top-width: 0; height: calc(var(--ht-cell-vertical-padding) * 2 + var(--ht-line-height) + 1px); } .handsontable.htHasScrollX:not(.htHorizontallyScrollableByWindow) .ht_master .wtHolder, .handsontable.htHasScrollY:not(.htVerticallyScrollableByWindow) .ht_master .wtHolder { border-radius: var(--ht-wrapper-border-radius, 0); } .handsontable:not(.htHorizontallyScrollableByWindow) .ht_master .wtHolder, .handsontable:not(.htVerticallyScrollableByWindow) .ht_master .wtHolder { background-color: var(--ht-background-color); } .handsontable tr.ht__row_even th { background-color: var(--ht-row-header-even-background-color); } .handsontable tr.ht__row_even td { background-color: var(--ht-row-cell-even-background-color); } .handsontable tr.ht__row_odd th { background-color: var(--ht-row-header-odd-background-color); } .handsontable tr.ht__row_odd td { background-color: var(--ht-row-cell-odd-background-color); } .handsontable th, .handsontable td { height: calc(var(--ht-cell-vertical-padding) * 2 + var(--ht-line-height) + 1px); padding: var(--ht-cell-vertical-padding) var(--ht-cell-horizontal-padding); vertical-align: top; border-top-width: 0; border-inline-start-width: 0; border-inline-end-width: 1px; border-bottom-width: 1px; border-style: solid; font-size: var(--ht-font-size); line-height: var(--ht-line-height); white-space: pre-wrap; overflow: hidden; outline: none; outline-width: 0; empty-cells: show; box-sizing: border-box; color: var(--ht-foreground-color); border-top-color: var(--ht-cell-vertical-border-color); border-bottom-color: var(--ht-cell-vertical-border-color); border-inline-start-color: var(--ht-cell-horizontal-border-color); border-inline-end-color: var(--ht-cell-horizontal-border-color); } .handsontable th.invisibleSelection, .handsontable td.invisibleSelection { outline: none; } .handsontable th.invisibleSelection::selection, .handsontable td.invisibleSelection::selection { background: transparent; } .handsontable th { position: relative; overflow: visible; text-align: center; font-weight: var(--ht-header-font-weight); white-space: nowrap; color: var(--ht-header-foreground-color); background-color: var(--ht-header-background-color); } .handsontable th:last-child { /* Foundation framework fix */ border-inline-start-width: 0; border-inline-end-width: 1px; border-bottom-width: 1px; border-inline-end-color: var(--ht-border-color); } .handsontable th:last-child.ht__active_highlight { border-inline-end-color: var(--ht-header-active-border-color); } .handsontable th:first-child { border-inline-start-color: var(--ht-border-color); } .handsontable th:first-child.ht__active_highlight { border-inline-start-color: var(--ht-header-active-border-color); } .handsontable th:first-child, .handsontable th:nth-child(2) { border-inline-start-width: 1px; } .handsontable th.current { box-shadow: inset 0 0 0 1px var(--ht-cell-selection-border-color); } .handsontable th.active { color: var(--ht-header-active-foreground-color); background-color: var(--ht-header-active-background-color); } .handsontable th.ht__highlight { color: var(--ht-header-highlighted-foreground-color); background-color: var(--ht-header-highlighted-background-color); } .handsontable th.ht__active_highlight { border-color: var(--ht-header-active-border-color); color: var(--ht-header-active-foreground-color); background-color: var(--ht-header-active-background-color); } .handsontable tbody tr.ht__row_odd th.ht__highlight, .handsontable tbody tr.ht__row_even th.ht__highlight { color: var(--ht-header-row-highlighted-foreground-color); background-color: var(--ht-header-row-highlighted-background-color); } .handsontable tbody tr.ht__row_odd th.ht__active_highlight, .handsontable tbody tr.ht__row_even th.ht__active_highlight { color: var(--ht-header-row-active-foreground-color); background-color: var(--ht-header-row-active-background-color); } .handsontable tbody tr:first-of-type th:first-child:empty::after, .handsontable tbody tr:first-of-type td:first-child:empty::after { content: ""; display: block; min-height: var(--ht-line-height); } .handsontable tbody tr th { padding: 0; color: var(--ht-header-row-foreground-color); background-color: var(--ht-header-row-background-color); } .handsontable tbody tr th.ht__active_highlight { box-shadow: 0 -1px 0 0 var(--ht-header-active-border-color); } .handsontable tbody tr th .relative { padding: var(--ht-cell-vertical-padding) var(--ht-cell-horizontal-padding); min-height: 100%; } .handsontable tbody tr td:first-child { border-inline-start-color: var(--ht-border-color); } .handsontable tbody tr td:last-child { border-inline-end-color: var(--ht-border-color); } .handsontable thead tr th { padding: 0; } .handsontable thead tr th.ht__active_highlight { box-shadow: -1px 0 0 0 var(--ht-header-active-border-color); } .handsontable thead tr th .relative { padding: var(--ht-cell-vertical-padding) var(--ht-cell-horizontal-padding); } .handsontable thead tr th .relative .colHeader { text-overflow: ellipsis; overflow: hidden; vertical-align: top; max-width: calc(100% + 1px); } .handsontable thead tr th .relative:has(.collapsibleIndicator, .changeType) .colHeader { max-width: calc(100% - (var(--ht-icon-size) + var(--ht-gap-size)) - 1px); } .handsontable tr:first-child th, .handsontable tr:first-child td { border-top-color: var(--ht-border-color); border-top-width: 1px; } .handsontable tr:first-child th.ht__active_highlight, .handsontable tr:first-child td.ht__active_highlight { border-top-color: var(--ht-header-active-border-color); } .handsontable tr:last-child th, .handsontable tr:last-child td { border-bottom-color: var(--ht-border-color); } .handsontable tr:last-child th.ht__active_highlight, .handsontable tr:last-child td.ht__active_highlight { border-bottom-color: var(--ht-header-active-border-color); } .handsontable div[class^=ht_clone] thead .ht__highlight .relative::after { content: ""; display: block; position: absolute; left: -1px; right: -1px; bottom: -1px; height: var(--ht-header-highlighted-shadow-size); background-color: var(--ht-accent-color); } .handsontable div[class^=ht_clone] thead tr:only-of-type .ht__highlight .relative::after { bottom: 0; } .handsontable div[class^=ht_clone] tbody .ht__highlight .relative::after { content: ""; display: block; position: absolute; top: -1px; right: -1px; bottom: -1px; width: var(--ht-header-highlighted-shadow-size); background-color: var(--ht-accent-color); } .handsontable div[class^=ht_clone] td:first-of-type { border-inline-start-width: 1px; } .handsontable thead tr:not(:last-child) th { /* Fix for - nested columns with hidden column */ overflow: hidden; } .handsontable .hide { display: none; } .handsontable .relative { position: relative; box-sizing: border-box; } .handsontable .wtHider { width: 0; } .handsontable .wtSpreader { position: relative; /* must be 0, otherwise blank space appears in scroll demo after scrolling max to the right */ width: 0; height: auto; } .handsontable .htAutoSize { position: absolute; left: -99000px; top: -99000px; visibility: hidden; } .handsontable .htTextEllipsis { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } .handsontable table, .handsontable tbody, .handsontable thead, .handsontable input, .handsontable textarea, .handsontable div { box-sizing: content-box; } .handsontable input, .handsontable textarea { min-height: initial; } .handsontable .htCore { width: 0; margin: 0; border-width: 0; border-spacing: 0; border-collapse: separate; outline-width: 0; table-layout: fixed; cursor: default; background-color: var(--ht-background-color); } .handsontable col { width: 64px; } .handsontable col.rowHeader { width: 64px; } .handsontable col.hidden { width: 0 !important; } .handsontable span.colHeader, .handsontable span.rowHeader { display: inline-block; font-size: var(--ht-font-size); line-height: var(--ht-line-height); } .handsontable tr.hidden { display: none; } .handsontable tr.hidden td, .handsontable tr.hidden th { display: none; } .handsontable a { color: var(--ht-link-color); } .handsontable a:hover { color: var(--ht-link-hover-color); } .handsontable .ht_clone_top th:nth-child(2) { border-inline-start-width: 0; border-inline-end-width: 1px; } .handsontable.htRowHeaders thead tr th:nth-child(2) { border-inline-start-width: 1px; } .handsontable .ht_master:not(.innerBorderInlineStart):not(.emptyColumns) tbody tr th, .handsontable .ht_master:not(.innerBorderInlineStart):not(.emptyColumns) thead tr th:first-child, .handsontable .ht_master:not(.innerBorderInlineStart):not(.emptyColumns) ~ .handsontable:not(.htGhostTable) tbody tr th, .handsontable .ht_master:not(.innerBorderInlineStart):not(.emptyColumns) ~ .handsontable:not(.ht_clone_top):not(.htGhostTable) thead tr th:first-child { border-inline-end-width: 0; border-inline-start-width: 1px; } .handsontable .ht_master:not(.innerBorderTop):not(.innerBorderBottom) thead tr:last-child th, .handsontable .ht_master:not(.innerBorderTop):not(.innerBorderBottom) ~ .handsontable thead tr:last-child th, .handsontable .ht_master:not(.innerBorderTop):not(.innerBorderBottom) thead tr.lastChild th, .handsontable .ht_master:not(.innerBorderTop):not(.innerBorderBottom) ~ .handsontable thead tr.lastChild th { border-bottom-width: 0; } .handsontable.htAutoRowSize .ht_master.innerBorderTop tbody tr:first-child th, .handsontable.htAutoRowSize .ht_master.innerBorderTop tbody tr:first-child td { border-top-width: 0; } .handsontable.htAutoRowSize .ht_master.innerBorderTop ~ .ht_clone_inline_start tbody tr:first-child th, .handsontable.htAutoRowSize .ht_master.innerBorderTop ~ .ht_clone_inline_start tbody tr:first-child td { border-top-width: 0; } .handsontable .ht_master table.htCore > thead, .handsontable .ht_master table.htCore > tbody > tr > th, .handsontable .ht_clone_inline_start table.htCore > thead { visibility: hidden; } .ht_master, .ht_clone_inline_start, .ht_clone_top, .ht_clone_bottom { overflow: hidden; } .ht_master .wtHolder, .ht_clone_inline_start .wtHolder, .ht_clone_top .wtHolder, .ht_clone_bottom .wtHolder { overflow: hidden; } .ht_master .wtHolder { overflow: auto; } [dir=rtl].handsontable td[dir=ltr] { border-inline-end-width: 0; border-inline-start-width: 1px; } [dir=rtl].handsontable tbody tr td[dir=ltr]:last-child { border-inline-start-color: var(--ht-border-color); } [dir=rtl].handsontable div[class^=ht_clone] tbody .ht__highlight .relative::after { right: auto; left: -1px; } .htScrollbarSafariTest::-webkit-scrollbar { width: 9px; height: 9px; } .handsontable.ht-wrapper:not(.htColumnHeaders) .ht_master .htCore tbody tr:first-child td:first-child { border-start-start-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper:not(.htColumnHeaders) .ht_master .htCore tbody tr:first-child td:last-child { border-start-end-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper:not(.htColumnHeaders) .ht_clone_top_inline_start_corner .htCore tbody tr:first-child td:first-child { border-start-start-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper:not(.htColumnHeaders) .ht_clone_top .htCore tbody tr:first-child td:first-child { border-start-start-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper:not(.htColumnHeaders) .ht_clone_top .htCore tbody tr:first-child td:last-child { border-start-end-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper:not(.htColumnHeaders) .ht_clone_inline_start .htCore tbody tr:first-child th:first-child, .handsontable.ht-wrapper:not(.htColumnHeaders) .ht_clone_inline_start .htCore tbody tr:first-child td:first-child { border-start-start-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_master .htCore { border-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_master .htCore thead tr:first-child th:first-child { border-start-start-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_master .htCore thead tr:first-child th:last-child { border-start-end-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_master .htCore thead tr:last-child th:first-child { border-end-start-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_master .htCore thead tr:last-child th:last-child { border-end-end-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_master .htCore tbody tr:last-child td:first-child { border-end-start-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_master .htCore tbody tr:last-child td:last-child { border-end-end-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_clone_top_inline_start_corner .htCore { border-start-start-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_clone_top_inline_start_corner .htCore thead tr:first-child th:first-child { border-start-start-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_clone_top .htCore { border-start-start-radius: var(--ht-wrapper-border-radius); border-start-end-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_clone_top .htCore thead tr:first-child th:first-child { border-start-start-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_clone_top .htCore thead tr:first-child th:last-child { border-start-end-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_clone_inline_start .htCore { border-start-start-radius: var(--ht-wrapper-border-radius); border-end-start-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_clone_inline_start .htCore thead tr:first-child th:first-child { border-start-start-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_clone_inline_start .htCore tbody tr:last-child th:first-child, .handsontable.ht-wrapper .ht_clone_inline_start .htCore tbody tr:last-child td:first-child { border-end-start-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_clone_bottom_inline_start_corner .htCore { border-end-start-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_clone_bottom_inline_start_corner .htCore tr:last-child th:first-child, .handsontable.ht-wrapper .ht_clone_bottom_inline_start_corner .htCore tr:last-child td:first-child { border-end-start-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_clone_bottom .htCore { border-end-start-radius: var(--ht-wrapper-border-radius); border-end-end-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_clone_bottom .htCore tr:last-child th:first-child, .handsontable.ht-wrapper .ht_clone_bottom .htCore tr:last-child td:first-child { border-end-start-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper .ht_clone_bottom .htCore tr:last-child th:last-child, .handsontable.ht-wrapper .ht_clone_bottom .htCore tr:last-child td:last-child { border-end-end-radius: var(--ht-wrapper-border-radius); } .handsontable.ht-wrapper.htHasScrollX .htCore { border-end-start-radius: 0; border-end-end-radius: 0; } .handsontable.ht-wrapper.htHasScrollX .htCore thead tr:last-child th:first-child, .handsontable.ht-wrapper.htHasScrollX .htCore tbody tr:last-child td:first-child, .handsontable.ht-wrapper.htHasScrollX .htCore tbody tr:last-child th:first-child { border-end-start-radius: 0 !important; } .handsontable.ht-wrapper.htHasScrollX .htCore thead tr:last-child th:last-child, .handsontable.ht-wrapper.htHasScrollX .htCore tbody tr:last-child td:last-child, .handsontable.ht-wrapper.htHasScrollX .htCore tbody tr:last-child th:last-child { border-end-end-radius: 0 !important; } .handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore { border-start-end-radius: 0; border-end-end-radius: 0; } .handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore thead tr:first-child th:last-child, .handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore tbody tr:first-child td:last-child, .handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore tbody tr:first-child th:last-child { border-start-end-radius: 0 !important; } .handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore thead tr:last-child th:last-child, .handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore tbody tr:last-child td:last-child, .handsontable.ht-wrapper.htHasScrollY:not(.htVerticallyScrollableByWindow) .htCore tbody tr:last-child th:last-child { border-end-end-radius: 0 !important; } .handsontable.mobile { user-select: none; -webkit-tap-highlight-color: transparent; -webkit-overflow-scrolling: touch; } .handsontable.mobile .wtHolder { user-select: none; -webkit-tap-highlight-color: transparent; -webkit-overflow-scrolling: touch; } .handsontable.mobile .handsontableInput:focus { box-shadow: inset 0 0 0 2px var(--ht-accent-color); -webkit-appearance: none; } .handsontable .topSelectionHandle, .handsontable .topSelectionHandle-HitArea, .handsontable .bottomSelectionHandle, .handsontable .bottomSelectionHandle-HitArea { inset-inline-start: -10000px; inset-inline-end: unset; top: -10000px; z-index: 9999; } .handsontable.hide-tween { -webkit-animation: opacity-hide 0.2s; animation: opacity-hide 0.2s; animation-fill-mode: forwards; -webkit-animation-fill-mode: forwards; } .handsontable.show-tween { -webkit-animation: opacity-show 0.3s; animation: opacity-show 0.3s; animation-fill-mode: forwards; -webkit-animation-fill-mode: forwards; } .ht_clone_master { z-index: 100; } .ht_clone_inline_start { z-index: 120; } .ht_clone_bottom { z-index: 130; } .ht_clone_bottom_inline_start_corner { z-index: 150; } .ht_clone_top { z-index: 160; } .ht_clone_top_inline_start_corner { z-index: 180; } .ht_editor_hidden { z-index: -1; } .ht_editor_visible { z-index: 200; } .handsontable td.area { position: relative; } .handsontable td.area::before { content: ""; position: absolute; inset: 0; background: var(--ht-cell-selection-background-color, #1a42e8); } .handsontable td.area-1 { position: relative; } .handsontable td.area-1::before { content: ""; position: absolute; inset: 0; background: var(--ht-cell-selection-background-color, #1a42e8); } .handsontable td.area-2 { position: relative; } .handsontable td.area-2::before { content: ""; position: absolute; inset: 0; background: var(--ht-cell-selection-background-color, #1a42e8); } .handsontable td.area-3 { position: relative; } .handsontable td.area-3::before { content: ""; position: absolute; inset: 0; background: var(--ht-cell-selection-background-color, #1a42e8); } .handsontable td.area-4 { position: relative; } .handsontable td.area-4::before { content: ""; position: absolute; inset: 0; background: var(--ht-cell-selection-background-color, #1a42e8); } .handsontable td.area-5 { position: relative; } .handsontable td.area-5::before { content: ""; position: absolute; inset: 0; background: var(--ht-cell-selection-background-color, #1a42e8); } .handsontable td.area-6 { position: relative; } .handsontable td.area-6::before { content: ""; position: absolute; inset: 0; background: var(--ht-cell-selection-background-color, #1a42e8); } .handsontable td.area-7 { position: relative; } .handsontable td.area-7::before { content: ""; position: absolute; inset: 0; background: var(--ht-cell-selection-background-color, #1a42e8); } .handsontable td.area::before { opacity: 0.14; } .handsontable td.area-1::before { opacity: 0.21; } .handsontable td.area-2::before { opacity: 0.28; } .handsontable td.area-3::before { opacity: 0.35; } .handsontable td.area-4::before { opacity: 0.42; } .handsontable td.area-5::before { opacity: 0.49; } .handsontable td.area-6::before { opacity: 0.56; } .handsontable td.area-7::before { opacity: 0.63; } .handsontable td.area { border-color: color-mix(in srgb, var(--ht-border-color), var(--ht-foreground-color) 10%); } .handsontable .wtBorder { position: absolute; font-size: 0; } .handsontable .wtBorder:nth-child(1), .handsontable .wtBorder:nth-child(3) { z-index: 2; } .handsontable .wtBorder:nth-child(2), .handsontable .wtBorder:nth-child(4) { z-index: 1; } .handsontable .wtBorder.hidden { display: none !important; } .handsontable .wtBorder.current { z-index: 10; background-color: var(--ht-cell-selection-border-color) !important; } .handsontable .wtBorder.area { z-index: 8; background-color: var(--ht-cell-selection-border-color) !important; } .handsontable .wtBorder.fill { z-index: 6; background-color: var(--ht-cell-autofill-fill-border-color, #68696c) !important; } .handsontable .wtBorder.corner { border-radius: var(--ht-cell-autofill-border-radius) !important; background-color: var(--ht-cell-autofill-background-color, #1a42e8) !important; border-color: var(--ht-cell-autofill-border-color) !important; font-size: 0; cursor: crosshair; z-index: 10; } .handsontable .wtBorder.corner::after { content: ""; position: absolute; border-radius: var(--ht-cell-autofill-border-radius); inset: min(0px, (var(--ht-cell-autofill-size) - var(--ht-cell-autofill-hit-area-size)) / 2); background: transparent; } .handsontable .wtBorder.corner.wtCornerInlineEndEdge::after { inset-inline-end: 0; } .handsontable .wtBorder.corner.wtCornerBlockEndEdge::after { inset-block-end: 0; } .hot-display-license-info { font-family: var(--ht-font-family), -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; padding: var(--ht-license-vertical-padding, 16px) var(--ht-license-horizontal-padding, 16px); font-size: var(--ht-font-size-small); line-height: var(--ht-line-height-small); color: var(--ht-license-foreground-color); background-color: var(--ht-license-background-color, #f7f7f9); text-align: left; border: 1px solid var(--ht-border-color, #f7f7f9); margin-top: 10px; border-radius: var(--ht-wrapper-border-radius); } .hot-display-license-info a { font-size: var(--ht-license-font-size); color: var(--ht-link-color); } .hot-display-license-info a:hover { color: var(--ht-link-hover-color); } .handsontable .htAutocompleteArrow { position: relative; cursor: default; width: var(--ht-icon-size); height: var(--ht-icon-size); font-size: 0; float: right; top: calc((var(--ht-line-height) - var(--ht-icon-size)) / 2); margin-inline-start: calc(var(--ht-gap-size) * 2); margin-inline-end: 1px; } .handsontable .htAutocompleteArrow::after { content: ""; display: block; position: absolute; top: 0; left: 0; opacity: 0.6; } [dir=rtl].handsontable .htAutocompleteArrow { float: left; } .handsontable .htCheckboxRendererInput { position: relative; display: inline-block; width: var(--ht-checkbox-size); height: var(--ht-checkbox-size); margin: 0; vertical-align: middle; cursor: pointer; margin-top: -2px; outline: none; } .handsontable .htCheckboxRendererInput:first-child { margin-inline-end: var(--ht-gap-size); } .handsontable .htCheckboxRendererInput:last-child { margin-inline-start: var(--ht-gap-size); } .handsontable .htCheckboxRendererInput::before { content: ""; display: inline-block; position: absolute; top: 0; left: 0; width: var(--ht-checkbox-size); height: var(--ht-checkbox-size); border-radius: var(--ht-checkbox-border-radius); border: 1px solid var(--ht-checkbox-border-color); background-color: var(--ht-checkbox-background-color); box-sizing: border-box; pointer-events: none; transition: all var(--ht-table-transition) ease-in-out; } .handsontable .htCheckboxRendererInput::after { content: ""; display: block; position: absolute; top: 0; left: 0; color: var(--ht-checkbox-icon-color); pointer-events: none; width: var(--ht-checkbox-size) !important; height: var(--ht-checkbox-size) !important; } .handsontable .htCheckboxRendererInput:checked::before { border-color: var(--ht-checkbox-checked-border-color); background-color: var(--ht-checkbox-checked-background-color); } .handsontable .htCheckboxRendererInput:checked::after { color: var(--ht-checkbox-checked-icon-color); } .handsontable .htCheckboxRendererInput:checked:disabled::before { border-color: var(--ht-checkbox-checked-disabled-border-color); background-color: var(--ht-checkbox-checked-disabled-background-color); } .handsontable .htCheckboxRendererInput:checked:disabled::after { color: var(--ht-checkbox-checked-disabled-icon-color); } .handsontable .htCheckboxRendererInput:checked:focus::before { border-color: var(--ht-checkbox-checked-focus-border-color); background-color: var(--ht-checkbox-checked-focus-background-color); } .handsontable .htCheckboxRendererInput:checked:focus::after { color: var(--ht-checkbox-checked-focus-icon-color); } .handsontable .htCheckboxRendererInput:focus::before { border-color: var(--ht-checkbox-focus-border-color); background-color: var(--ht-checkbox-focus-background-color); outline: 1px solid var(--ht-checkbox-focus-ring-color); } .handsontable .htCheckboxRendererInput:focus::after { color: var(--ht-checkbox-focus-icon-color); } .handsontable .htCheckboxRendererInput:disabled { cursor: initial; } .handsontable .htCheckboxRendererInput:disabled::before { border-color: var(--ht-checkbox-disabled-border-color); background-color: var(--ht-checkbox-disabled-background-color); } .handsontable .htCheckboxRendererInput:disabled::after { color: var(--ht-checkbox-disabled-icon-color); } .handsontable .htCheckboxRendererInput:indeterminate::before { border-color: var(--ht-checkbox-indeterminate-border-color); background-color: var(--ht-checkbox-indeterminate-background-color); } .handsontable .htCheckboxRendererInput:indeterminate::after { color: var(--ht-checkbox-indeterminate-icon-color); } .handsontable .htCheckboxRendererInput:indeterminate:disabled::before { border-color: var(--ht-checkbox-indeterminate-disabled-border-color); background-color: var(--ht-checkbox-indeterminate-disabled-background-color); } .handsontable .htCheckboxRendererInput:indeterminate:disabled::after { color: var(--ht-checkbox-indeterminate-disabled-icon-color); } .handsontable .htCheckboxRendererInput:indeterminate:focus::before { border-color: var(--ht-checkbox-indeterminate-focus-border-color); background-color: var(--ht-checkbox-indeterminate-focus-background-color); } .handsontable .htCheckboxRendererInput:indeterminate:focus::after { color: var(--ht-checkbox-indeterminate-focus-icon-color); } .handsontable .htCheckboxRendererInput.noValue { opacity: 0.5; } .handsontable .htCheckboxRendererLabel { display: inline-block; position: relative; font-size: inherit; line-height: inherit; cursor: pointer; color: inherit; margin: 0; } .handsontable .htCheckboxRendererLabel.fullWidth { width: 100%; } .handsontable .htPlaceholder { color: var(--ht-placeholder-color); } .handsontable .htDimmed { color: var(--ht-read-only-color) !important; background-color: var(--ht-cell-read-only-background-color) !important; } .handsontable .htLeft { text-align: left; } .handsontable .htCenter { text-align: center; } .handsontable .htRight { text-align: right; } .handsontable .htJustify { text-align: justify; } .handsontable .htTop { vertical-align: top; } .handsontable .htMiddle { vertical-align: middle; } .handsontable .htBottom { vertical-align: bottom; } .handsontable .htInvalid { /* gives priority over td.area selection background */ background-color: var(--ht-cell-error-background-color) !important; } .handsontable .htNoWrap { white-space: nowrap; } .handsontable .htSearchResult { background-color: var(--ht-cell-success-background-color) !important; } .handsontable .ht-multi-select-renderer { padding: var(--ht-cell-vertical-padding) var(--ht-cell-horizontal-padding); overflow: hidden; } .handsontable .ht-multi-select-chips-container { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--ht-gap-size); overflow: hidden; max-width: 100%; } .handsontable .ht-multi-select-chip { display: inline-flex; align-items: center; gap: var(--ht-gap-size); padding: var(--ht-chip-vertical-padding) calc((var(--ht-line-height) - var(--ht-icon-size)) / 2) var(--ht-chip-vertical-padding) var(--ht-chip-horizontal-padding); border-radius: var(--ht-chip-border-radius); background: var(--ht-chip-background); white-space: nowrap; flex-shrink: 0; max-width: 100px; box-sizing: border-box; } .handsontable .ht-multi-select-chip-label { overflow: hidden; text-overflow: ellipsis; color: var(--ht-foreground-color); font-style: normal; font-weight: var(--ht-font-weight); line-height: var(--ht-line-height, 40px); letter-spacing: var(--ht-letter-spacing, 0); padding: 0 var(--ht-chip-gap); } .handsontable .ht-multi-select-chip-remove { position: relative; display: flex; align-items: center; justify-content: center; width: var(--ht-icon-size) !important; height: var(--ht-icon-size) !important; padding: 0; cursor: pointer; flex-shrink: 0; color: var(--ht-icon-button-icon-color); background-size: contain; background-repeat: no-repeat; background-position: center; } .handsontable .ht-multi-select-chip-remove::before { content: ""; display: block; position: absolute; top: 0; left: 0; } .handsontable .ht-multi-select-chip-remove:hover { background-color: var(--ht-icon-button-hover-background-color); } .handsontable .ht-multi-select-overflow { display: inline-flex; align-items: center; justify-content: center; padding: 0 calc(var(--ht-gap-size) * 2); background: var(--ht-chip-background); border-radius: var(--ht-chip-border-radius); color: var(--ht-foreground-color); white-space: nowrap; flex-shrink: 0; } .handsontableInputHolder { position: absolute; top: 0; left: 0; } .handsontableInputHolder .handsontableInput { display: block; margin: 0; padding: calc(var(--ht-cell-vertical-padding, 4px) + 1px) calc(var(--ht-cell-horizontal-padding, 8px) + 1px); font-family: inherit !important; font-size: inherit !important; line-height: inherit !important; color: var(--ht-cell-editor-foreground-color); background-color: var(--ht-cell-editor-background-color, #ffffff); box-shadow: inset 0 0 0 var(--ht-cell-editor-border-width, 2px) var(--ht-cell-editor-border-color, #1a42e8), 0 0 var(--ht-cell-editor-shadow-blur-radius, 0) 0 var(--ht-cell-editor-shadow-color, transparent); border: none; border-radius: 0; -webkit-appearance: none !important; box-sizing: border-box; /* Miscellaneous */ outline-width: 0; /* overwrite styles potentially made by a framework */ } .handsontableInputHolder .handsontableInput:focus { outline: none; } .htSelectEditor { position: absolute; } .htSelectEditor select { position: absolute; inset: 0; width: 100%; height: 100%; padding: calc(var(--ht-cell-vertical-padding, 4px) + 1px) calc(var(--ht-cell-horizontal-padding, 8px) + 1px); padding-inline-end: 26px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ht-cell-editor-foreground-color); background-color: var(--ht-cell-editor-background-color, #ffffff); font-family: inherit !important; font-size: inherit !important; line-height: inherit !important; box-shadow: inset 0 0 0 var(--ht-cell-editor-border-width, 2px) var(--ht-cell-editor-border-color, #1a42e8), 0 0 var(--ht-cell-editor-shadow-blur-radius, 0) 0 var(--ht-cell-editor-shadow-color, transparent); border: none; border-radius: 0; box-sizing: border-box; -webkit-appearance: none !important; } .htSelectEditor select:focus { outline: none; } .htSelectEditor .htAutocompleteArrow { top: 50%; transform: translateY(-50%); margin-inline-end: 4px; z-index: 1; pointer-events: none; } .handsontable.listbox { box-shadow: var(--ht-menu-shadow-x, 0) var(--ht-menu-shadow-y, 0) var(--ht-menu-shadow-blur, 8px) color-mix(in srgb, var(--ht-menu-shadow-color, rgb(0, 0, 0)) var(--ht-menu-shadow-opacity, 100%), transparent); margin: 0; border: var(--ht-menu-border-width, 1px) solid var(--ht-menu-border-color, #e5e5e9); } .handsontable.listbox .ht_master { overflow: hidden; background-color: var(--ht-background-color); } .handsontable.listbox .wtHolder { overflow: auto; border-radius: 0 !important; } .handsontable.listbox .wtHider, .handsontable.listbox .htCore { border-radius: 0 !important; } .handsontable.listbox table { overflow: hidden; } .handsontable.listbox table th, .handsontable.listbox table tr:first-child th, .handsontable.listbox table tr:last-child th, .handsontable.listbox table tr:first-child td, .handsontable.listbox table td { border-color: transparent !important; } .handsontable.listbox table th, .handsontable.listbox table td { white-space: nowrap; text-overflow: ellipsis; border-radius: 0 !important; } .handsontable.listbox table .wtBorder { visibility: hidden; } .handsontable.listbox table strong { font-weight: bold; color: inherit; } .handsontable.listbox table tr td:hover td { background: color-mix(in srgb, var(--ht-menu-item-hover-color) var(--ht-menu-item-hover-color-opacity, 100%), transparent) !important; cursor: pointer; box-shadow: none !important; } .handsontable.listbox table td { transition: var(--ht-table-transition) background ease-in-out; } .handsontable.listbox table td:hover { background-color: color-mix(in srgb, var(--ht-menu-item-hover-color) var(--ht-menu-item-hover-color-opacity, 100%), transparent) !important; cursor: pointer; } .handsontable.listbox table td.current:not([aria-expanded=true]) { box-shadow: inset 0 0 0 1px var(--ht-accent-color); } .handsontable.listbox table td.htDimmed { cursor: default; font-style: inherit; color: inherit !important; } .handsontable.listbox table td.htDimmed:not(.handsontable.listbox table td:hover) { background-color: inherit !important; } .handsontable.listbox table thead th { height: auto !important; text-align: left; } .handsontable.listbox table thead th .relative { padding-top: calc(var(--ht-cell-vertical-padding) + var(--ht-gap-size)); padding-bottom: calc(var(--ht-cell-vertical-padding) + var(--ht-gap-size)); } .handsontable.listbox .ht_clone_top .wtHider { overflow: hidden; } .handsontable.listbox .ht_clone_top table { border-radius: 0; } .handsontable.listbox .htBorders div { background: none !important; } .handsontable.autocompleteEditor tr.ht__row_even th, .handsontable.autocompleteEditor tr.ht__row_even td { background-color: var(--ht-background-color, #ffffff); } .handsontable.autocompleteEditor tr.ht__row_odd th, .handsontable.autocompleteEditor tr.ht__row_odd td { background-color: var(--ht-background-color, #ffffff); } [dir=rtl].handsontable.listbox table thead th { text-align: right; } .pika-single { font-family: var(--ht-font-family), -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; box-shadow: var(--ht-menu-shadow-x, 0) var(--ht-menu-shadow-y, 0) var(--ht-menu-shadow-blur, 8px) color-mix(in srgb, var(--ht-menu-shadow-color, rgb(0, 0, 0)) var(--ht-menu-shadow-opacity, 100%), transparent); position: relative; display: block; padding: 10px; font-size: var(--ht-font-size); line-height: var(--ht-line-height); font-weight: var(--ht-font-weight); color: var(--ht-foreground-color); background: var(--ht-background-color, #ffffff); border: var(--ht-menu-border-width, 1px) solid var(--ht-menu-border-color, #e5e5e9); border-radius: var(--ht-menu-border-radius); z-index: 9999; } .pika-single.is-hidden { display: none; } .pika-single .pika-row { background-color: transparent; } .pika-single .pika-title { display: flex; align-items: center; justify-content: center; } .pika-single .pika-label { position: relative; order: 2; padding: 5px; color: var(--ht-accent-color); } .pika-single .pika-label .pika-select { position: absolute; inset: 0; opacity: 0; cursor: pointer; } .pika-single .pika-prev, .pika-single .pika-next { width: 20px; height: 20px; white-space: nowrap; text-indent: -9999px; cursor: pointer; color: var(--ht-accent-color); background: none; border: none; padding: 0; } .pika-single .pika-prev { order: 1; margin-right: auto; } .pika-single .pika-next { order: 3; margin-left: auto; } .pika-single .pika-table thead { height: 50px; } .pika-single .pika-table th { padding: 1px; vertical-align: middle; } .pika-single .pika-table th abbr { text-decoration: none; font-weight: normal; border: none; cursor: initial; } .pika-single .pika-table td { padding: 1px; vertical-align: middle; } .pika-single .pika-table td.is-disabled .pika-button { pointer-events: none; opacity: 0.5; } .pika-single .pika-table td.is-today .pika-button { background: color-mix(in srgb, var(--ht-menu-item-hover-color) var(--ht-menu-item-hover-color-opacity, 100%), transparent); } .pika-single .pika-table td.is-selected .pika-button { background: var(--ht-accent-color, #1a42e8); color: var(--ht-primary-button-foreground-color, #ffffff); } .pika-single .pika-table td.pika-week { width: 12.5%; text-align: center; } .pika-single .pika-table .pika-button { width: 100%; aspect-ratio: 1/1; background: transparent; color: var(--ht-foreground-color); border: none; border-radius: var(--ht-button-border-radius); margin: 0; padding: 10px; cursor: pointer; font-size: inherit; } .pika-single .pika-table .pika-button:hover { background: color-mix(in srgb, var(--ht-menu-item-hover-color) var(--ht-menu-item-hover-color-opacity, 100%), transparent); } [dir=rtl].htDatepickerHolder .pika-single .pika-next { transform: rotate(180deg); margin-left: 0; margin-right: auto; } [dir=rtl].htDatepickerHolder .pika-single .pika-prev { transform: rotate(180deg); margin-left: auto; margin-right: 0; } .handsontableEditor { position: absolute; } .handsontableEditor .ht-multi-select-editor { box-shadow: var(--ht-menu-shadow-x, 0) var(--ht-menu-shadow-y, 0) var(--ht-menu-shadow-blur, 8px) color-mix(in srgb, var(--ht-menu-shadow-color, rgb(0, 0, 0)) var(--ht-menu-shadow-opacity, 100%), transparent); overflow-y: auto; border-radius: 0 0 var(--ht-menu-border-radius) var(--ht-menu-border-radius); border: var(--ht-menu-border-width) solid var(--ht-menu-border-color); background: var(--ht-background-color); width: max-content; min-width: 120px; padding: var(--ht-menu-vertical-padding) var(--ht-menu-horizontal-padding); } .handsontableEditor .ht-multi-select-editor .ht-multi-select-editor-search-input-wrapper { display: flex; padding: var(--ht-menu-item-vertical-padding) var(--ht-menu-item-horizontal-padding); align-items: center; gap: var(--ht-gap-size); align-self: stretch; position: relative; } .handsontableEditor .ht-multi-select-editor .ht-multi-select-editor-search-icon { position: absolute; left: calc(var(--ht-menu-item-horizontal-padding) + 10px); top: 50%; transform: translateY(-50%); width: 16px; height: 16px; background-repeat: no-repeat; background-position: center; background-size: contain; opacity: 0.5; pointer-events: none; z-index: 1; } .handsontableEditor .ht-multi-select-editor input.ht-multi-select-editor-search-input { box-sizing: border-box; width: 100%; border-radius: var(--ht-input-border-radius); color: var(--ht-input-foreground-color); background-color: var(--ht-input-background-color); border: 1px solid var(--ht-input-border-color); transition: var(--ht-table-transition) all ease-in-out; line-height: var(--ht-line-height); font-size: var(--ht-font-size); padding: var(--ht-input-vertical-padding) var(--ht-menu-item-horizontal-padding) var(--ht-input-vertical-padding) 32px; } .handsontableEditor .ht-multi-select-editor input.ht-multi-select-editor-search-input:hover { border-color: var(--ht-input-hover-border-color); color: var(--ht-input-hover-foreground-color); background-color: var(--ht-input-hover-background-color); } .handsontableEditor .ht-multi-select-editor input.ht-multi-select-editor-search-input:disabled { border-color: var(--ht-input-disabled-border-color); color: var(--ht-input-disabled-foreground-color); background-color: var(--ht-input-disabled-background-color); } .handsontableEditor .ht-multi-select-editor input.ht-multi-select-editor-search-input:focus { border-color: var(--ht-input-focus-border-color); color: var(--ht-input-focus-foreground-color); background-color: var(--ht-input-focus-background-color); outline: none; outline-offset: 0; box-shadow: none; } .handsontableEditor .ht-multi-select-editor input.ht-multi-select-editor-search-input::placeholder { color: var(--ht-foreground-color); opacity: 0.6; } .handsontableEditor .ht-multi-select-editor .ht-multi-select-editor-separator { width: 100%; height: 1px; background-color: var(--ht-menu-border-color); margin: var(--ht-menu-vertical-padding) 0 var(--ht-menu-vertical-padding) 0; padding: 0; } .handsontableEditor .ht-multi-select-editor ul { list-style: none; display: flex; flex-direction: column; align-items: flex-start; width: 100%; margin: 0; padding: var(--ht-gap-size) var(--ht-menu-horizontal-padding); } .handsontableEditor .ht-multi-select-editor ul li { display: flex; align-items: center; align-self: stretch; background: var(--ht-background-color); padding: var(--ht-menu-item-vertical-padding) var(--ht-menu-item-horizontal-padding); user-select: none; cursor: pointer; } .handsontableEditor .ht-multi-select-editor ul li * { cursor: pointer; } .handsontableEditor .ht-multi-select-editor ul li.ht-multi-select-editor-item-selected { background: color-mix(in srgb, var(--ht-menu-item-active-color) var(--ht-menu-item-active-color-opacity, 100%), transparent); } .handsontableEditor .ht-multi-select-editor ul li div { display: flex; align-items: center; flex: 1 0 0; } .handsontableEditor .ht-multi-select-editor ul li div input { position: relative; appearance: none; margin: 0; padding: 0; width: var(--ht-checkbox-size); height: var(--ht-checkbox-size); display: flex; } .handsontableEditor .ht-multi-select-editor ul li div input::after { content: ""; display: block; position: absolute; top: 0; left: 0; } .handsontableEditor .ht-multi-select-editor ul li div input::before { content: ""; display: block; position: absolute; top: 0; left: 0; box-sizing: border-box; width: var(--ht-checkbox-size); height: var(--ht-checkbox-size); border-radius: var(--ht-checkbox-border-radius); border: 1px solid var(--ht-checkbox-border-color); background: var(--ht-checkbox-background-color); background-repeat: no-repeat; background-position: center; } .handsontableEditor .ht-multi-select-editor ul li div input:checked::before { border-color: var(--ht-checkbox-checked-border-color); background: var(--ht-checkbox-checked-background-color); } .handsontableEditor .ht-multi-select-editor ul li div input:checked::after { color: var(--ht-checkbox-checked-icon-color); background-color: currentColor; } .handsontableEditor .ht-multi-select-editor ul li div input:focus { outline: none; } .handsontableEditor .ht-multi-select-editor ul li div label { overflow: hidden; color: var(--ht-foreground-color); text-overflow: ellipsis; font-size: var(--ht-font-size); font-style: normal; font-weight: 400; line-height: var(--ht-line-height); letter-spacing: var(--ht-letter-spacing); width: 100%; padding: 0 0 0 calc(var(--ht-gap-size) * 2); } .handsontableEditor .ht-multi-select-editor ul li:hover { background: color-mix(in srgb, var(--ht-menu-item-hover-color) var(--ht-menu-item-hover-color-opacity, 100%), transparent); } .handsontableEditor .ht-multi-select-editor ul li:has(input:focus) { background: color-mix(in srgb, var(--ht-menu-item-hover-color) var(--ht-menu-item-hover-color-opacity, 100%), transparent); } .handsontable .htUISelectCaption { width: 100%; padding: var(--ht-input-vertical-padding) var(--ht-input-horizontal-padding); padding-inline-end: calc(var(--ht-input-horizontal-padding) + var(--ht-icon-size)); margin: 0; font-family: inherit; font-size: var(--ht-font-size); line-height: var(--ht-line-height); font-weight: var(--ht-font-weight); border-radius: var(--ht-input-border-radius); box-sizing: border-box; cursor: pointer; outline: none !important; border: var(--ht-input-border-width) solid var(--ht-input-border-color); color: var(--ht-input-foreground-color); background-color: var(--ht-input-background-color); text-overflow: ellipsis; white-space: nowrap; overflow: hidden; transition: var(--ht-table-transition) all ease-in-out; } .handsontable .htUISelectCaption::after { content: ""; display: block; position: absolute; right: calc(var(--ht-input-horizontal-padding) - var(--ht-icon-size) / 4); top: 50%; transform: translateY(-50%); } .handsontable .htUISelectCaption:hover { border-color: var(--ht-input-hover-border-color); color: var(--ht-input-hover-foreground-color); background-color: var(--ht-input-hover-background-color); } .handsontable .htUISelectCaption:disabled { border-color: var(--ht-input-disabled-border-color); color: var(--ht-input-disabled-foreground-color); background-color: var(--ht-input-disabled-background-color); } .handsontable .htUISelectCaption:focus { border-color: var(--ht-input-focus-border-color); color: var(--ht-input-focus-foreground-color); background-color: var(--ht-input-focus-background-color); } .handsontable .htUISelect { cursor: pointer; position: relative; outline: none !important; } .handsontable .htUISelect:focus .htUISelectCaption { border-color: var(--ht-input-focus-border-color); color: var(--ht-input-focus-foreground-color); background-color: var(--ht-input-focus-background-color); } [dir=rtl].handsontable .htUISelectCaption::after { right: auto; left: calc(var(--ht-input-horizontal-padding) - var(--ht-icon-size) / 4); } .handsontable .htFiltersMenuCondition .htUIInput input, .handsontable .htFiltersMenuValue .htUIMultipleSelectSearch input { width: 100%; padding: var(--ht-input-vertical-padding) var(--ht-input-horizontal-padding); font-family: inherit; font-size: var(--ht-font-size); line-height: var(--ht-line-height); font-weight: var(--ht-font-weight); border-radius: var(--ht-input-border-radius); box-sizing: border-box; cursor: pointer; outline: none !important; border: var(--ht-input-border-width) solid var(--ht-input-border-color); color: var(--ht-input-foreground-color); background-color: var(--ht-input-background-color); transition: var(--ht-table-transition) all ease-in-out; } .handsontable .htFiltersMenuCondition .htUIInput input:hover, .handsontable .htFiltersMenuValue .htUIMultipleSelectSearch input:hover { border-color: var(--ht-input-hover-border-color); color: var(--ht-input-hover-foreground-color); background-color: var(--ht-input-hover-background-color); } .handsontable .htFiltersMenuCondition .htUIInput input:disabled, .handsontable .htFiltersMenuValue .htUIMultipleSelectSearch input:disabled { border-color: var(--ht-input-disabled-border-color); color: var(--ht-input-disabled-foreground-color); background-color: var(--ht-input-disabled-background-color); } .handsontable .htFiltersMenuCondition .htUIInput input:focus, .handsontable .htFiltersMenuValue .htUIMultipleSelectSearch input:focus { border-color: var(--ht-input-focus-border-color); color: var(--ht-input-focus-foreground-color); background-color: var(--ht-input-focus-background-color); } .handsontable .htUIInput { position: relative; padding: 0; outline: none !important; text-align: center; } .handsontable .htUIInputIcon { position: absolute; } .handsontable .htUIInput.htUIButton input, .handsontable .ht-button { min-width: 64px; padding: var(--ht-button-vertical-padding) var(--ht-button-horizontal-padding); font-family: inherit; font-size: var(--ht-font-size); line-height: var(--ht-line-height); font-weight: var(--ht-font-weight); border-radius: var(--ht-button-border-radius); border-width: 1px; border-style: solid; box-sizing: border-box; outline: none !important; cursor: pointer; transition: var(--ht-table-transition) all ease-in-out; } .handsontable .htUIInput.htUIButtonCancel input, .handsontable .ht-button--secondary { border-color: var(--ht-secondary-button-border-color); background-color: var(--ht-secondary-button-background-color); color: var(--ht-secondary-button-foreground-color); } .handsontable .htUIInput.htUIButtonCancel input:hover, .handsontable .ht-button--secondary:hover { border-color: var(--ht-secondary-button-hover-border-color); background-color: var(--ht-secondary-button-hover-background-color); color: var(--ht-secondary-button-hover-foreground-color); } .handsontable .htUIInput.htUIButtonCancel input:disabled, .handsontable .ht-button--secondary:disabled { border-color: var(--ht-secondary-button-disabled-border-color); background-color: var(--ht-secondary-button-disabled-background-color); color: var(--ht-secondary-button-disabled-foreground-color); } .handsontable .htUIInput.htUIButtonCancel input:focus, .handsontable .ht-button--secondary:focus { border-color: var(--ht-secondary-button-focus-border-color); background-color: var(--ht-secondary-button-focus-background-color); color: var(--ht-secondary-button-focus-foreground-color); box-shadow: 0 0 0 1px var(--ht-accent-color); } .htUIInput.htUIButtonOK input, .ht-button--primary { border-color: var(--ht-primary-button-border-color); background-color: var(--ht-primary-button-background-color); color: var(--ht-primary-button-foreground-color); } .htUIInput.htUIButtonOK input:hover, .ht-button--primary:hover { border-color: var(--ht-primary-button-hover-border-color); background-color: var(--ht-primary-button-hover-background-color); color: var(--ht-primary-button-hover-foreground-color); } .htUIInput.htUIButtonOK input:disabled, .ht-button--primary:disabled { border-color: var(--ht-primary-button-disabled-border-color); background-color: var(--ht-primary-button-disabled-background-color); color: var(--ht-primary-button-disabled-foreground-color); } .htUIInput.htUIButtonOK input:focus, .ht-button--primary:focus { border-color: var(--ht-primary-button-focus-border-color); background-color: var(--ht-primary-button-focus-background-color); color: var(--ht-primary-button-focus-foreground-color); box-shadow: 0 0 0 1px var(--ht-accent-color); } .handsontable .htUIRadio { position: relative; display: inline-flex; margin: 0; padding: var(--ht-gap-size) calc(2 * var(--ht-gap-size)); padding-bottom: 0; align-items: center; gap: var(--ht-gap-size); cursor: pointer; } .handsontable .htUIRadio:first-child { padding-inline-start: 0; } .handsontable .htUIRadio > input[type=radio] { position: relative; width: var(--ht-radio-size); height: var(--ht-radio-size); margin: 0; appearance: none; cursor: pointer; border-radius: calc(0.5 * var(--ht-radio-size)); outline: none; } .handsontable .htUIRadio > input[type=radio]::before { content: ""; display: block; position: absolute; inset: 0; border-radius: calc(0.5 * var(--ht-radio-size)); border: 1px solid var(--ht-radio-border-color); background-color: var(--ht-radio-background-color); } .handsontable .htUIRadio > input[type=radio]::after { content: ""; display: block; position: absolute; color: var(--ht-radio-icon-color); } .handsontable .htUIRadio > input[type=radio]:checked::before { border-color: var(--ht-radio-checked-border-color); background-color: var(--ht-radio-checked-background-color); } .handsontable .htUIRadio > input[type=radio]:checked::after { color: var(--ht-radio-checked-icon-color); } .handsontable .htUIRadio > input[type=radio]:checked:disabled { cursor: initial; } .handsontable .htUIRadio > input[type=radio]:checked:disabled::before { border-color: var(--ht-radio-checked-disabled-border-color); background-color: var(--ht-radio-checked-disabled-background-color); } .handsontable .htUIRadio > input[type=radio]:checked:disabled::after { color: var(--ht-radio-checked-disabled-icon-color); } .handsontable .htUIRadio > input[type=radio]:checked:focus::before { border-color: var(--ht-radio-checked-focus-border-color); background-color: var(--ht-radio-checked-focus-background-color); } .handsontable .htUIRadio > input[type=radio]:checked:focus::after { color: var(--ht-radio-checked-focus-icon-color); } .handsontable .htUIRadio > input[type=radio]:disabled { cursor: initial; } .handsontable .htUIRadio > input[type=radio]:disabled::before { border-color: var(--ht-radio-disabled-border-color); background-color: var(--ht-radio-disabled-background-color); } .handsontable .htUIRadio > input[type=radio]:disabled::after { color: var(--ht-radio-disabled-icon-color); } .handsontable .htUIRadio > input[type=radio]:focus::before { border-color: var(--ht-radio-focus-border-color); background-color: var(--ht-radio-focus-background-color); outline: 1px solid var(--ht-radio-focus-ring-color); } .handsontable .htUIRadio > input[type=radio]:focus::after { color: var(--ht-radio-focus-icon-color); } .handsontable .htUIRadio label { vertical-align: middle; cursor: pointer; color: inherit; } .handsontable .htUIRadio label::before { content: ""; display: block; position: absolute; inset: 0; } .handsontable .collapsibleIndicator { top: calc((var(--ht-line-height) - var(--ht-icon-size)) / 2); margin-inline-start: var(--ht-gap-size); margin-inline-end: 1px; } .handsontable .collapsibleIndicator, .handsontable .ht_nestingButton { position: relative; width: var(--ht-icon-size); height: var(--ht-icon-size); box-sizing: border-box; border-radius: var(--ht-collapse-button-border-radius); overflow: hidden; cursor: pointer; /* hide text */ text-indent: -100px; font-size: 0; float: right; } .handsontable .collapsibleIndicator::before, .handsontable .ht_nestingButton::before { content: ""; display: block; position: absolute; top: 0; left: 0; transition: var(--ht-table-transition) all ease-in-out; } .handsontable .collapsibleIndicator.expanded, .handsontable .collapsibleIndicator.ht_nestingCollapse, .handsontable .ht_nestingButton.expanded, .handsontable .ht_nestingButton.ht_nestingCollapse { background-color: var(--ht-collapse-button-open-background-color); box-shadow: 0 0 0 1px var(--ht-collapse-button-open-border-color); } .handsontable .collapsibleIndicator.expanded::before, .handsontable .collapsibleIndicator.ht_nestingCollapse::before, .handsontable .ht_nestingButton.expanded::before, .handsontable .ht_nestingButton.ht_nestingCollapse::before { color: var(--ht-collapse-button-open-icon-color); } .handsontable .collapsibleIndicator.expanded:hover, .handsontable .collapsibleIndicator.ht_nestingCollapse:hover, .handsontable .ht_nestingButton.expanded:hover, .handsontable .ht_nestingButton.ht_nestingCollapse:hover { background-color: var(--ht-collapse-button-open-hover-background-color); box-shadow: 0 0 0 1px var(--ht-collapse-button-open-hover-border-color); } .handsontable .collapsibleIndicator.expanded:hover::before, .handsontable .collapsibleIndicator.ht_nestingCollapse:hover::before, .handsontable .ht_nestingButton.expanded:hover::before, .handsontable .ht_nestingButton.ht_nestingCollapse:hover::before { color: var(--ht-collapse-button-open-hover-icon-color); } .handsontable .collapsibleIndicator.collapsed, .handsontable .collapsibleIndicator.ht_nestingExpand, .handsontable .ht_nestingButton.collapsed, .handsontable .ht_nestingButton.ht_nestingExpand { background-color: var(--ht-collapse-button-close-background-color); box-shadow: 0 0 0 1px var(--ht-collapse-button-close-border-color); } .handsontable .collapsibleIndicator.collapsed::before, .handsontable .collapsibleIndicator.ht_nestingExpand::before, .handsontable .ht_nestingButton.collapsed::before, .handsontable .ht_nestingButton.ht_nestingExpand::before { color: var(--ht-collapse-button-close-icon-color); } .handsontable .collapsibleIndicator.collapsed:hover, .handsontable .collapsibleIndicator.ht_nestingExpand:hover, .handsontable .ht_nestingButton.collapsed:hover, .handsontable .ht_nestingButton.ht_nestingExpand:hover { background-color: var(--ht-collapse-button-close-hover-background-color); box-shadow: 0 0 0 1px var(--ht-collapse-button-close-hover-border-color); } .handsontable .collapsibleIndicator.collapsed:hover::before, .handsontable .collapsibleIndicator.ht_nestingExpand:hover::before, .handsontable .ht_nestingButton.collapsed:hover::before, .handsontable .ht_nestingButton.ht_nestingExpand:hover::before { color: var(--ht-collapse-button-close-hover-icon-color); } .handsontable th.ht__active_highlight .collapsibleIndicator.collapsed::before, .handsontable th.ht__active_highlight .collapsibleIndicator.ht_nestingExpand::before, .handsontable th.ht__active_highlight .ht_nestingButton.collapsed::before, .handsontable th.ht__active_highlight .ht_nestingButton.ht_nestingExpand::before { color: var(--ht-collapse-button-close-icon-active-color); } .handsontable th.ht__active_highlight .collapsibleIndicator.collapsed:hover::before, .handsontable th.ht__active_highlight .collapsibleIndicator.ht_nestingExpand:hover::before, .handsontable th.ht__active_highlight .ht_nestingButton.collapsed:hover::before, .handsontable th.ht__active_highlight .ht_nestingButton.ht_nestingExpand:hover::before { color: var(--ht-collapse-button-close-hover-icon-active-color); } .handsontable th.ht__active_highlight .collapsibleIndicator.expanded::before, .handsontable th.ht__active_highlight .collapsibleIndicator.ht_nestingCollapse::before, .handsontable th.ht__active_highlight .ht_nestingButton.expanded::before, .handsontable th.ht__active_highlight .ht_nestingButton.ht_nestingCollapse::before { color: var(--ht-collapse-button-open-icon-active-color); } .handsontable th.ht__active_highlight .collapsibleIndicator.expanded:hover::before, .handsontable th.ht__active_highlight .collapsibleIndicator.ht_nestingCollapse:hover::before, .handsontable th.ht__active_highlight .ht_nestingButton.expanded:hover::before, .handsontable th.ht__active_highlight .ht_nestingButton.ht_nestingCollapse:hover::before { color: var(--ht-collapse-button-open-hover-icon-active-color); } [dir=rtl].handsontable .collapsibleIndicator, [dir=rtl].handsontable .ht_nestingButton { float: left; } .handsontable thead th.hiddenHeader:not(:first-of-type) { display: none; } .handsontable thead th.hiddenHeaderText .colHeader { opacity: 0; } .handsontable th.ht_nestingLevels > .relative { display: flex; align-items: center; gap: 5px; } .handsontable th.ht_nestingLevels span:last-child { padding-left: calc(var(--ht-icon-size) + 5px); } .handsontable th.ht_nestingLevels span.ht_nestingLevel { display: inline-block; } .handsontable th.ht_nestingLevels span.ht_nestingLevel_empty { position: relative; display: inline-block; width: 5px; height: 1px; order: -2; } .handsontable th.ht_nestingLevels .ht_nestingButton { position: relative; cursor: pointer; order: -1; } .handsontable th.beforeHiddenColumn, .handsontable th.afterHiddenColumn { position: relative; } .handsontable th.beforeHiddenColumn::before, .handsontable th.beforeHiddenColumn::after, .handsontable th.afterHiddenColumn::before, .handsontable th.afterHiddenColumn::after { position: absolute; top: 50%; width: 10px !important; height: 10px !important; transform: translateY(-50%); color: var(--ht-hidden-indicator-color); } .handsontable th.beforeHiddenColumn::after { content: ""; display: block; right: -2px; } .handsontable th.afterHiddenColumn::before { content: ""; display: block; left: -2px; } .handsontable th.ht__active_highlight.beforeHiddenColumn::before, .handsontable th.ht__active_highlight.beforeHiddenColumn::after, .handsontable th.ht__active_highlight.afterHiddenColumn::before, .handsontable th.ht__active_highlight.afterHiddenColumn::after { color: var(--ht-icon-button-active-icon-color, var(--ht-icon-active-button-icon-color)); } [dir=rtl].handsontable th.beforeHiddenColumn::after { right: initial; left: -2px; transform: translateY(-50%) rotate(180deg); } [dir=rtl].handsontable th.afterHiddenColumn::before { right: -2px; left: initial; transform: translateY(-50%) rotate(180deg); } .handsontable th.beforeHiddenRow, .handsontable th.afterHiddenRow { position: relative; } .handsontable th.beforeHiddenRow::before, .handsontable th.beforeHiddenRow::after, .handsontable th.afterHiddenRow::before, .handsontable th.afterHiddenRow::after { position: absolute; left: 50%; width: 10px !important; height: 10px !important; transform: translateX(-50%); color: var(--ht-hidden-indicator-color); } .handsontable th.beforeHiddenRow::after { content: ""; display: block; bottom: -2px; } .handsontable th.afterHiddenRow::before { content: ""; display: block; top: -2px; } .handsontable th.ht__active_highlight.beforeHiddenRow::before, .handsontable th.ht__active_highlight.beforeHiddenRow::after, .handsontable th.ht__active_highlight.afterHiddenRow::before, .handsontable th.ht__active_highlight.afterHiddenRow::after { color: var(--ht-icon-button-active-icon-color, var(--ht-icon-active-button-icon-color)); } .handsontable .changeType { position: relative; box-sizing: border-box; width: var(--ht-icon-size); height: var(--ht-icon-size); border-radius: var(--ht-icon-button-border-radius); box-shadow: 0 0 0 1px var(--ht-icon-button-border-color); border: none; color: inherit; padding: 0; margin: 0; background-color: var(--ht-icon-button-background-color); order: 1; z-index: 1; float: right; top: calc((var(--ht-line-height) - var(--ht-icon-size)) / 2); margin-inline-start: var(--ht-gap-size); margin-inline-end: 1px; } .handsontable .changeType::before { content: ""; display: block; position: absolute; top: 0; left: 0; color: var(--ht-icon-button-icon-color); } .handsontable .changeType:hover { cursor: pointer; box-shadow: 0 0 0 1px var(--ht-icon-button-hover-border-color); background-color: var(--ht-icon-button-hover-background-color); } .handsontable .changeType:hover::before { color: var(--ht-icon-button-hover-icon-color); } .handsontable .ht__active_highlight .changeType { box-shadow: 0 0 0 1px var(--ht-icon-button-active-border-color, var(--ht-icon-active-button-border-color)); background-color: var(--ht-icon-button-active-background-color, var(--ht-icon-active-button-background-color)); } .handsontable .ht__active_highlight .changeType::before { color: var(--ht-icon-button-active-icon-color, var(--ht-icon-active-button-icon-color)); } .handsontable .ht__active_highlight .changeType:hover { box-shadow: 0 0 0 1px var(--ht-icon-button-active-hover-border-color, var(--ht-icon-active-button-hover-border-color)); background-color: var(--ht-icon-button-active-hover-background-color, var(--ht-icon-active-button-hover-background-color)); } .handsontable .ht__active_highlight .changeType:hover::before { color: var(--ht-icon-button-active-hover-icon-color, var(--ht-icon-active-button-hover-icon-color)); } .handsontable th.htFiltersActive { background-color: var(--ht-header-filter-background-color); } .handsontable th.htFiltersActive.ht__active_highlight { background-color: color-mix(in srgb, var(--ht-header-active-background-color), var(--ht-header-filter-background-color) 20%); } .handsontable th.htFiltersActive.ht__active_highlight .changeType::after { background-color: var(--ht-header-active-foreground-color); } .handsontable.htDropdownMenu > .ht_master, .handsontable.htContextMenu > .ht_master, .handsontable.htFiltersConditionsMenu > .ht_master { box-shadow: var(--ht-menu-shadow-x, 0) var(--ht-menu-shadow-y, 0) var(--ht-menu-shadow-blur, 8px) color-mix(in srgb, var(--ht-menu-shadow-color, rgb(0, 0, 0)) var(--ht-menu-shadow-opacity, 100%), transparent); border: var(--ht-menu-border-width, 1px) solid var(--ht-menu-border-color, #e5e5e9); border-radius: var(--ht-menu-border-radius); overflow: hidden; padding: var(--ht-menu-vertical-padding, 8px) var(--ht-menu-horizontal-padding, 0); background-color: var(--ht-background-color, #ffffff); } .handsontable.htDropdownMenu:not(.htGhostTable), .handsontable.htContextMenu:not(.htGhostTable), .handsontable.htFiltersConditionsMenu:not(.htGhostTable) { display: none; position: absolute; /* needs to be higher than 1050 - z-index for Twitter Bootstrap modal (#1569) */ z-index: 1060; } .handsontable.htDropdownMenu .ht_clone_top, .handsontable.htDropdownMenu .ht_clone_bottom, .handsontable.htDropdownMenu .ht_clone_inline_start, .handsontable.htDropdownMenu .ht_clone_top_inline_start_corner, .handsontable.htDropdownMenu .ht_clone_bottom_inline_start_corner, .handsontable.htContextMenu .ht_clone_top, .handsontable.htContextMenu .ht_clone_bottom, .handsontable.htContextMenu .ht_clone_inline_start, .handsontable.htContextMenu .ht_clone_top_inline_start_corner, .handsontable.htContextMenu .ht_clone_bottom_inline_start_corner, .handsontable.htFiltersConditionsMenu .ht_clone_top, .handsontable.htFiltersConditionsMenu .ht_clone_bottom, .handsontable.htFiltersConditionsMenu .ht_clone_inline_start, .handsontable.htFiltersConditionsMenu .ht_clone_top_inline_start_corner, .handsontable.htFiltersConditionsMenu .ht_clone_bottom_inline_start_corner { display: none; } .handsontable.htDropdownMenu table.htCore, .handsontable.htContextMenu table.htCore, .handsontable.htFiltersConditionsMenu table.htCore { overflow: hidden; } .handsontable.htDropdownMenu .htCustomMenuRenderer .table.htCore, .handsontable.htContextMenu .htCustomMenuRenderer .table.htCore, .handsontable.htFiltersConditionsMenu .htCustomMenuRenderer .table.htCore { box-shadow: none; } .handsontable.htDropdownMenu.handsontable:focus, .handsontable.htContextMenu.handsontable:focus, .handsontable.htFiltersConditionsMenu.handsontable:focus { outline: none; } .handsontable.htDropdownMenu .wtBorder, .handsontable.htContextMenu .wtBorder, .handsontable.htFiltersConditionsMenu .wtBorder { visibility: hidden; } .handsontable.htDropdownMenu tbody tr:first-of-type td:first-child, .handsontable.htDropdownMenu tbody tr:first-of-type th:first-child, .handsontable.htContextMenu tbody tr:first-of-type td:first-child, .handsontable.htContextMenu tbody tr:first-of-type th:first-child, .handsontable.htFiltersConditionsMenu tbody tr:first-of-type td:first-child, .handsontable.htFiltersConditionsMenu tbody tr:first-of-type th:first-child { height: calc(var(--ht-cell-vertical-padding) * 2 + var(--ht-line-height) + 1px); } .handsontable.htDropdownMenu table tbody tr td, .handsontable.htContextMenu table tbody tr td, .handsontable.htFiltersConditionsMenu table tbody tr td { position: relative; padding: var(--ht-menu-item-vertical-padding, 4px) var(--ht-menu-item-horizontal-padding, 8px); border-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; background: var(--ht-background-color, #ffffff); cursor: pointer; transition: var(--ht-table-transition) background ease-in-out; } .handsontable.htDropdownMenu table tbody tr td:first-child, .handsontable.htContextMenu table tbody tr td:first-child, .handsontable.htFiltersConditionsMenu table tbody tr td:first-child { border-top-width: 0; border-inline-end-width: 0; border-bottom-width: 0; border-inline-start-width: 0; } .handsontable.htDropdownMenu table tbody tr td.htDimmed, .handsontable.htContextMenu table tbody tr td.htDimmed, .handsontable.htFiltersConditionsMenu table tbody tr td.htDimmed { font-style: normal; color: inherit !important; background-color: inherit !important; } .handsontable.htDropdownMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htDropdownMenu table tbody tr td.htDisabled, .handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htContextMenu table tbody tr td.htDisabled, .handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled):hover, .handsontable.htContextMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htDropdownMenu table tbody tr td.htDisabled, .handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htContextMenu table tbody tr td.htDisabled, .handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled):hover, .handsontable.htFiltersConditionsMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htDropdownMenu table tbody tr td.htDisabled, .handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htContextMenu table tbody tr td.htDisabled, .handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled):hover { background: color-mix(in srgb, var(--ht-menu-item-hover-color) var(--ht-menu-item-hover-color-opacity, 100%), transparent) !important; cursor: pointer; } .handsontable.htDropdownMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htDropdownMenu table tbody tr td.htDisabled, .handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htContextMenu table tbody tr td.htDisabled, .handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled).current:not([aria-expanded=true]), .handsontable.htContextMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htDropdownMenu table tbody tr td.htDisabled, .handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htContextMenu table tbody tr td.htDisabled, .handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled).current:not([aria-expanded=true]), .handsontable.htFiltersConditionsMenu table tbody tr td:not(.handsontable.htDropdownMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htDropdownMenu table tbody tr td.htDisabled, .handsontable.htContextMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htContextMenu table tbody tr td.htDisabled, .handsontable.htFiltersConditionsMenu table tbody tr td.htCustomMenuRenderer, .handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled).current:not([aria-expanded=true]) { box-shadow: inset 0 0 0 1px var(--ht-accent-color); } .handsontable.htDropdownMenu table tbody tr td.htSubmenu .htItemWrapper, .handsontable.htContextMenu table tbody tr td.htSubmenu .htItemWrapper, .handsontable.htFiltersConditionsMenu table tbody tr td.htSubmenu .htItemWrapper { margin-inline-end: calc(2 * var(--ht-gap-size, 4px) + var(--ht-icon-size)); } .handsontable.htDropdownMenu table tbody tr td.htSubmenu .htItemWrapper::after, .handsontable.htContextMenu table tbody tr td.htSubmenu .htItemWrapper::after, .handsontable.htFiltersConditionsMenu table tbody tr td.htSubmenu .htItemWrapper::after { content: ""; display: block; position: absolute; top: 50%; right: calc(var(--ht-menu-item-horizontal-padding) + var(--ht-gap-size) * 2); transform: translateY(-50%); } .handsontable.htDropdownMenu table tbody tr td.htSeparator, .handsontable.htContextMenu table tbody tr td.htSeparator, .handsontable.htFiltersConditionsMenu table tbody tr td.htSeparator { border-top: 1px solid var(--ht-border-color); height: 0; padding: 0; cursor: default; } .handsontable.htDropdownMenu table tbody tr td.htDisabled, .handsontable.htContextMenu table tbody tr td.htDisabled, .handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled { color: var(--ht-disabled-color); cursor: default; } .handsontable.htDropdownMenu table tbody tr td.htDisabled:hover, .handsontable.htContextMenu table tbody tr td.htDisabled:hover, .handsontable.htFiltersConditionsMenu table tbody tr td.htDisabled:hover { background: var(--ht-background-color); color: var(--ht-disabled-color); } .handsontable.htDropdownMenu table tbody tr td.htHidden, .handsontable.htContextMenu table tbody tr td.htHidden, .handsontable.htFiltersConditionsMenu table tbody tr td.htHidden { display: none; } .handsontable.htDropdownMenu table tbody tr td:has(.htItemWrapper .selected), .handsontable.htContextMenu table tbody tr td:has(.htItemWrapper .selected), .handsontable.htFiltersConditionsMenu table tbody tr td:has(.htItemWrapper .selected) { background-color: color-mix(in srgb, var(--ht-menu-item-active-color) var(--ht-menu-item-active-color-opacity, 100%), transparent); } .handsontable.htDropdownMenu table tbody tr td .htItemWrapper, .handsontable.htContextMenu table tbody tr td .htItemWrapper, .handsontable.htFiltersConditionsMenu table tbody tr td .htItemWrapper { margin-inline: calc(2 * var(--ht-gap-size, 4px)); } .handsontable.htDropdownMenu table tbody tr td .htItemWrapper::before, .handsontable.htContextMenu table tbody tr td .htItemWrapper::before, .handsontable.htFiltersConditionsMenu table tbody tr td .htItemWrapper::before { vertical-align: text-bottom; margin-right: 12px; } .handsontable.htDropdownMenu table tbody tr td .htItemWrapper span.selected, .handsontable.htContextMenu table tbody tr td .htItemWrapper span.selected, .handsontable.htFiltersConditionsMenu table tbody tr td .htItemWrapper span.selected { font-size: 0; inset: 0; } .handsontable.htDropdownMenu table tbody tr td .htItemWrapper span.selected::after, .handsontable.htContextMenu table tbody tr td .htItemWrapper span.selected::after, .handsontable.htFiltersConditionsMenu table tbody tr td .htItemWrapper span.selected::after { content: ""; display: block; position: absolute; top: 50%; right: calc(var(--ht-menu-item-horizontal-padding) + var(--ht-gap-size) * 2); color: var(--ht-accent-color); transform: translateY(-50%); } .handsontable.htDropdownMenu table tbody tr td div span.selected, .handsontable.htContextMenu table tbody tr td div span.selected, .handsontable.htFiltersConditionsMenu table tbody tr td div span.selected { position: absolute; inset-inline-end: 0; } .handsontable.htDropdownMenu table tbody tr td .htUIButton, .handsontable.htContextMenu table tbody tr td .htUIButton, .handsontable.htFiltersConditionsMenu table tbody tr td .htUIButton { width: calc(50% - var(--ht-gap-size)); } .handsontable.htDropdownMenu table tbody tr td .htUIButton input, .handsontable.htContextMenu table tbody tr td .htUIButton input, .handsontable.htFiltersConditionsMenu table tbody tr td .htUIButton input { width: 100%; } .handsontable .htUIClearAll a, .handsontable .htUISelectAll a { padding: var(--ht-gap-size); display: inline-block; text-decoration: none; } .handsontable .htUIMultipleSelect .ht_master .wtHolder { overflow-y: scroll !important; background: transparent; border-radius: 0 !important; } .handsontable .htUIMultipleSelect .ht_master .wtHolder .htCore { box-shadow: none; } [dir=rtl].handsontable.htDropdownMenu table tbody tr td.htSubmenu .htItemWrapper::after, [dir=rtl].handsontable.htContextMenu table tbody tr td.htSubmenu .htItemWrapper::after, [dir=rtl].handsontable.htFiltersConditionsMenu table tbody tr td.htSubmenu .htItemWrapper::after { left: calc(4 * var(--ht-gap-size)); right: auto; transform: translateY(-50%) rotate(180deg); } [dir=rtl].handsontable.htDropdownMenu table tbody tr td .htItemWrapper span.selected::after, [dir=rtl].handsontable.htContextMenu table tbody tr td .htItemWrapper span.selected::after, [dir=rtl].handsontable.htFiltersConditionsMenu table tbody tr td .htItemWrapper span.selected::after { left: calc(4 * var(--ht-gap-size)); right: auto; } [dir=rtl].handsontable .changeType { float: left; } .handsontable.htFiltersConditionsMenu:not(.htGhostTable) { z-index: 1070; } .handsontable .ht_master table td.htCustomMenuRenderer { cursor: auto; } .handsontable .ht_master table td.htCustomMenuRenderer.htFiltersMenuActionBar { padding-top: calc(var(--ht-menu-item-vertical-padding, 4px) * 2); } .handsontable .htFiltersMenuLabel { font-size: var(--ht-font-size-small); line-height: var(--ht-line-height-small); font-weight: var(--ht-font-weight); margin-bottom: calc(var(--ht-gap-size, 2px) * 2); } .handsontable .htFiltersMenuLabel:empty { display: none; } .handsontable .htFiltersMenuCondition { padding-top: calc(var(--ht-gap-size, 2px) * 3) !important; padding-bottom: 0 !important; } .handsontable .htFiltersMenuCondition .border { border-bottom: 1px solid var(--ht-border-color) !important; } .handsontable .htFiltersMenuCondition .htUIInput { margin-top: calc(var(--ht-gap-size, 2px) * 2); } .handsontable .htFiltersMenuValue { padding-top: calc(var(--ht-gap-size, 2px) * 3) !important; padding-bottom: 0 !important; border-bottom: 1px solid var(--ht-border-color) !important; } .handsontable .htFiltersMenuOperators { padding-top: calc(var(--ht-gap-size, 2px) * 2) !important; padding-bottom: 0 !important; } .handsontable .htUISelectionControls { padding-top: calc(var(--ht-gap-size, 2px) * 2) !important; padding-bottom: var(--ht-gap-size, 2px) !important; margin: 0 calc(var(--ht-gap-size, 2px) * -1); } .handsontable .htUIMultipleSelectHot { --ht-cell-horizontal-padding: calc( var(--ht-menu-item-horizontal-padding, 2px) + var(--ht-gap-size, 2px) * 2); overflow: initial !important; width: calc(100% + var(--ht-menu-item-horizontal-padding, 2px) * 2 + var(--ht-gap-size, 2px) * 4); margin: 0 calc((var(--ht-menu-item-horizontal-padding, 2px) + var(--ht-gap-size, 2px) * 2) * -1); } .handsontable .htUIMultipleSelectHot::before { content: ""; display: block; position: absolute; top: -1px; left: 0; width: 100%; height: 1px; background-color: var(--ht-border-color); } .handsontable .htUIMultipleSelectHot .wtHolder { padding: 0; overflow-x: hidden; box-sizing: border-box; } .handsontable .htUIMultipleSelectHot .wtHolder .wtSpreader { padding: calc(var(--ht-gap-size) * 2) 0; } .handsontable .htUIMultipleSelectHot .wtHolder td { height: auto !important; padding: 4px var(--ht-cell-horizontal-padding); } .handsontable .htUIClearAll, .handsontable .htUISelectAll { display: inline-block; margin-right: var(--ht-gap-size, 4px); margin-bottom: var(--ht-gap-size, 4px); } .handsontable .htUIClearAll a, .handsontable .htUISelectAll a { font-size: var(--ht-font-size); line-height: var(--ht-line-height); color: var(--ht-link-color); border-radius: var(--ht-button-border-radius); } .handsontable .htUIClearAll a:hover, .handsontable .htUISelectAll a:hover { color: var(--ht-link-hover-color); } .handsontable .htUIClearAll a:focus, .handsontable .htUISelectAll a:focus { outline: 1px solid var(--ht-link-hover-color); } .handsontable .htUIMultipleSelect .ht_master .wtHolder { overflow: auto; } .handsontable .htUIMultipleSelect .ht_master .wtHolder .wtHider, .handsontable .htUIMultipleSelect .ht_master .wtHolder .htCore, .handsontable .htUIMultipleSelect .ht_master .wtHolder tr, .handsontable .htUIMultipleSelect .ht_master .wtHolder td { background: none; } .handsontable .htUIInput.htUIButton { cursor: pointer; display: inline-block; } .handsontable .htUIInput.htUIButtonOK { margin-inline-start: 0; margin-inline-end: calc(2 * var(--ht-gap-size, 2px)); } .handsontable .htCommentCell { position: relative; } .handsontable .htCommentCell::after { content: ""; display: block; position: absolute; top: 0; inset-inline-end: 0; inset-inline-start: unset; border-inline-start: var(--ht-comments-indicator-size, 4px) solid transparent; border-inline-end: none; border-top: var(--ht-comments-indicator-size, 4px) solid var(--ht-comments-indicator-color, #1a42e8); } .htCommentsContainer .htComments { display: none; z-index: 1059; position: absolute; } .htCommentsContainer .htCommentTextArea { font-family: var(--ht-font-family), -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; box-shadow: var(--ht-menu-shadow-x, 0) var(--ht-menu-shadow-y, 0) var(--ht-menu-shadow-blur, 8px) color-mix(in srgb, var(--ht-menu-shadow-color, rgb(0, 0, 0)) var(--ht-menu-shadow-opacity, 100%), transparent); width: 240px; height: 88px; font-size: var(--ht-font-size); line-height: var(--ht-line-height); font-weight: var(--ht-font-weight); margin: 0 -1px; padding: var(--ht-comments-textarea-vertical-padding) var(--ht-comments-textarea-horizontal-padding); border: var(--ht-comments-textarea-border-width, 1px) solid var(--ht-comments-textarea-border-color, transparent); border-inline-start: var(--ht-comments-textarea-border-width, 1px) solid var(--ht-comments-textarea-border-color, #1a42e8); color: var(--ht-comments-textarea-foreground-color); background-color: var(--ht-comments-textarea-background-color, #ffffff); outline: 0 !important; box-sizing: border-box; -webkit-appearance: none; } .htCommentsContainer .htCommentTextArea:focus { border: var(--ht-comments-textarea-focus-border-width, 1px) solid var(--ht-comments-textarea-focus-border-color, #1a42e8); color: var(--ht-comments-textarea-focus-foreground-color); background-color: var(--ht-comments-textarea-focus-background-color, #ffffff); } .htBorders .wtBorder.ht-border-style-dashed-vertical { background-image: repeating-linear-gradient(to bottom, var(--ht-custom-border-color) 0 5px, transparent 0 10px); } .htBorders .wtBorder.ht-border-style-dashed-horizontal { background-image: repeating-linear-gradient(to right, var(--ht-custom-border-color) 0 5px, transparent 0 10px); } .htBorders .wtBorder.ht-border-style-dotted-horizontal { background-image: radial-gradient(circle, var(--ht-custom-border-color) calc(var(--ht-custom-border-size) / 2), transparent 0); background-size: calc(var(--ht-custom-border-size) * 2) var(--ht-custom-border-size); background-repeat: repeat-x; } .htBorders .wtBorder.ht-border-style-dotted-vertical { background-image: radial-gradient(circle, var(--ht-custom-border-color) calc(var(--ht-custom-border-size) / 2), transparent 0); background-size: var(--ht-custom-border-size) calc(var(--ht-custom-border-size) * 2); background-repeat: repeat-y; } .handsontable .columnSorting:not(.indicatorDisabled) { position: relative; } .handsontable .columnSorting:not(.indicatorDisabled).sortAction { min-width: calc(var(--ht-icon-size, 16px) + 8px); } .handsontable .columnSorting:not(.indicatorDisabled).sortAction.ascending, .handsontable .columnSorting:not(.indicatorDisabled).sortAction.descending { padding-inline-end: calc(var(--ht-icon-size, 16px) + 2px); max-width: calc(100% - (var(--ht-icon-size, 16px) * 2 + var(--ht-gap-size, 4px) + 3px)) !important; } .handsontable .columnSorting:not(.indicatorDisabled).sortAction:hover { text-decoration: none; cursor: pointer; } .handsontable .columnSorting:not(.indicatorDisabled).sortAction::before { content: ""; display: block; width: var(--ht-icon-size, 16px); position: absolute; top: 50%; right: 2px; transform: translateY(-50%); text-align: right; } .handsontable .htRight .columnSorting.sortAction.ascending, .handsontable .htRight .columnSorting.sortAction.descending { padding-inline-start: calc(var(--ht-icon-size, 16px) + 2px); padding-inline-end: 0; } .handsontable .htRight .columnSorting.sortAction::before { left: 2px; right: auto; text-align: left; } [dir=rtl] .handsontable .columnSorting.sortAction::before { left: 2px; right: auto; text-align: left; } [dir=rtl] .handsontable .htRight .columnSorting.sortAction.ascending, [dir=rtl] .handsontable .htRight .columnSorting.sortAction.descending { padding-inline-start: 0; padding-inline-end: calc(var(--ht-icon-size, 16px) + 2px); } [dir=rtl] .handsontable .htLeft .columnSorting.sortAction.ascending, [dir=rtl] .handsontable .htLeft .columnSorting.sortAction.descending { padding-inline-start: calc(var(--ht-icon-size, 16px) + 2px); padding-inline-end: 0; } [dir=rtl] .handsontable .htLeft .columnSorting.sortAction::before { left: auto; right: 2px; text-align: right; } .htGhostTable .htCore span.colHeader.columnSorting:not(.indicatorDisabled)::before { content: "*"; display: inline-block; position: relative; /* The multi-line header and header with longer text need more padding to not hide arrow, we make header wider in \`GhostTable\` to make some space for arrow which is positioned absolutely in the main table */ padding-inline-end: calc(var(--ht-icon-size, 16px) + 2px); } .handsontable .colHeader.columnSorting::after { content: ""; display: block; width: 8px; position: absolute; top: 50%; right: 0; transform: translateY(-50%); margin-top: 4px; font-size: 8px; text-align: right; } .handsontable .colHeader.columnSorting[class^=sort-]::after, .handsontable .colHeader.columnSorting[class*=" sort-"]::after { content: "+"; } .handsontable .colHeader.columnSorting.sort-1::after { content: "1"; } .handsontable .colHeader.columnSorting.sort-2::after { content: "2"; } .handsontable .colHeader.columnSorting.sort-3::after { content: "3"; } .handsontable .colHeader.columnSorting.sort-4::after { content: "4"; } .handsontable .colHeader.columnSorting.sort-5::after { content: "5"; } .handsontable .colHeader.columnSorting.sort-6::after { content: "6"; } .handsontable .colHeader.columnSorting.sort-7::after { content: "7"; } .handsontable .htRight .colHeader.columnSorting::after { left: 0; right: auto; text-align: left; } [dir=rtl] .handsontable .colHeader.columnSorting::after { left: 0; right: auto; text-align: left; } [dir=rtl] .handsontable .htLeft .colHeader.columnSorting::after { left: auto; right: 0; text-align: right; } .htGhostTable th div button.changeType + span.colHeader.columnSorting:not(.indicatorDisabled) { padding-right: var(--ht-gap-size); } .handsontable .htRowHeaders .ht_master.innerBorderInlineStart ~ .ht_clone_top_inline_start_corner th:nth-child(2), .handsontable .htRowHeaders .ht_master.innerBorderInlineStart ~ .ht_clone_inline_start td:first-of-type { border-left: 0 none; } .handsontable .ht_clone_top_inline_start_corner th.ht__active_highlight { box-shadow: none; } .handsontable .manualColumnResizer { position: absolute; top: 0; width: 10px; margin: 0; cursor: col-resize; background: none; opacity: 0; z-index: 210; } .handsontable .manualColumnResizer::before, .handsontable .manualColumnResizer::after { content: ""; display: block; position: absolute; top: 50%; left: 1px; width: 2px; height: calc(100% - 12px); max-height: 16px; margin-top: 0.5px; background: var(--ht-resize-indicator-color); border-radius: 2px; transform: translateY(-50%); } .handsontable .manualColumnResizer::after { left: auto; right: 0; } .handsontable .manualColumnResizer:hover, .handsontable .manualColumnResizer.active { opacity: 1; } .handsontable .manualColumnResizerGuide { position: absolute; inset-inline-end: unset; top: 0; width: 0; margin-inline-start: 5px; margin-inline-end: unset; display: none; border-inline-end: 1px solid var(--ht-accent-color); border-inline-start: none; } .handsontable .manualColumnResizerGuide.active { display: block; z-index: 209; } .handsontable .manualRowResizer { position: absolute; left: 0; z-index: 210; height: 10px; margin: 0; cursor: row-resize; background: none; opacity: 0; } .handsontable .manualRowResizer::before, .handsontable .manualRowResizer::after { content: ""; display: block; position: absolute; top: 1px; left: 50%; width: calc(100% - 12px); max-width: 16px; height: 2px; background: var(--ht-resize-indicator-color); border-radius: 2px; transform: translateX(-50%); } .handsontable .manualRowResizer::after { top: auto; bottom: 0; } .handsontable .manualRowResizer:hover, .handsontable .manualRowResizer.active { opacity: 1; } .handsontable .manualRowResizerGuide { position: absolute; left: 0; bottom: 0; height: 0; margin-top: 5px; display: none; border-bottom: 1px solid var(--ht-accent-color); border-top: none; } .handsontable .manualRowResizerGuide.active { display: block; z-index: 209; } .handsontable tbody td[rowspan][class*=area][class*=highlight]:not([class*=fullySelectedMergedCell])::before { opacity: 0; } .handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-multiple]::before { opacity: 0.14; } .handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-0]:before { opacity: 0.14; } .handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-1]:before { opacity: 0.21; } .handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-2]:before { opacity: 0.28; } .handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-3]:before { opacity: 0.35; } .handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-4]:before { opacity: 0.42; } .handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-5]:before { opacity: 0.49; } .handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-6]:before { opacity: 0.56; } .handsontable tbody td[rowspan][class*=area][class*=highlight][class*=fullySelectedMergedCell-7]:before { opacity: 0.63; } .handsontable .wtHider { position: relative; } .handsontable .ht__manualColumnMove.after-selection--columns thead th.ht__highlight, .handsontable.ht__manualColumnMove.after-selection--columns thead th.ht__highlight { cursor: move; cursor: -moz-grab; cursor: -webkit-grab; cursor: grab; } .handsontable .ht__manualColumnMove.on-moving--columns *, .handsontable .ht__manualColumnMove.on-moving--columns thead th.ht__highlight, .handsontable.ht__manualColumnMove.on-moving--columns *, .handsontable.ht__manualColumnMove.on-moving--columns thead th.ht__highlight { cursor: move; cursor: -moz-grabbing; cursor: -webkit-grabbing; cursor: grabbing; } .handsontable .ht__manualColumnMove.on-moving--columns .manualColumnResizer, .handsontable.ht__manualColumnMove.on-moving--columns .manualColumnResizer { display: none; } .handsontable .ht__manualColumnMove--guideline, .handsontable .ht__manualColumnMove--backlight, .handsontable.ht__manualColumnMove--guideline, .handsontable.ht__manualColumnMove--backlight { position: absolute; height: 100%; display: none; } .handsontable .ht__manualColumnMove--guideline, .handsontable.ht__manualColumnMove--guideline { width: 1px; top: 0; margin-inline-start: -0.5px; margin-inline-end: 0; z-index: 205; background: var(--ht-move-indicator-color, #1a42e8); } .handsontable .ht__manualColumnMove--backlight, .handsontable.ht__manualColumnMove--backlight { display: none; z-index: 205; pointer-events: none; background: color-mix(in srgb, var(--ht-move-backlight-color) var(--ht-move-backlight-opacity, 100%), transparent); } .handsontable .on-moving--columns.show-ui .ht__manualColumnMove--guideline, .handsontable .on-moving--columns .ht__manualColumnMove--backlight, .handsontable.on-moving--columns.show-ui .ht__manualColumnMove--guideline, .handsontable.on-moving--columns .ht__manualColumnMove--backlight { display: block; } .handsontable .wtHider { position: relative; } .handsontable .ht__manualRowMove.after-selection--rows tbody th.ht__highlight, .handsontable.ht__manualRowMove.after-selection--rows tbody th.ht__highlight { cursor: move; cursor: -moz-grab; cursor: -webkit-grab; cursor: grab; } .handsontable .ht__manualRowMove.on-moving--rows *, .handsontable .ht__manualRowMove.on-moving--rows tbody th.ht__highlight, .handsontable.ht__manualRowMove.on-moving--rows *, .handsontable.ht__manualRowMove.on-moving--rows tbody th.ht__highlight { cursor: move; cursor: -moz-grabbing; cursor: -webkit-grabbing; cursor: grabbing; } .handsontable .ht__manualRowMove.on-moving--rows .manualRowResizer, .handsontable.ht__manualRowMove.on-moving--rows .manualRowResizer { display: none; } .handsontable .ht__manualRowMove--guideline, .handsontable .ht__manualRowMove--backlight, .handsontable.ht__manualRowMove--guideline, .handsontable.ht__manualRowMove--backlight { position: absolute; width: 100%; display: none; } .handsontable .ht__manualRowMove--guideline, .handsontable.ht__manualRowMove--guideline { border-top: 1px solid var(--ht-move-indicator-color); left: 0; z-index: 205; } .handsontable .ht__manualRowMove--backlight, .handsontable.ht__manualRowMove--backlight { display: none; z-index: 205; pointer-events: none; background: color-mix(in srgb, var(--ht-move-backlight-color) var(--ht-move-backlight-opacity, 100%), transparent); } .handsontable .on-moving--rows.show-ui .ht__manualRowMove--guideline, .handsontable .on-moving--rows .ht__manualRowMove--backlight, .handsontable.on-moving--rows.show-ui .ht__manualRowMove--guideline, .handsontable.on-moving--rows .ht__manualRowMove--backlight { display: block; } .ht-dialog { position: absolute; top: 0; left: 0; display: none; font-size: var(--ht-font-size); line-height: var(--ht-line-height); letter-spacing: var(--ht-letter-spacing); width: 100%; height: 100%; z-index: 1060; opacity: 0; overflow-y: auto; border-radius: var(--ht-wrapper-border-radius); border: 1px solid var(--ht-border-color); box-sizing: border-box !important; } .ht-dialog[dir=rtl] { left: auto; right: 0; } .ht-dialog:focus { border: 1px solid var(--ht-accent-color); outline: none; } .ht-dialog:has(.htFocusCatcher:focus) { border: 1px solid var(--ht-accent-color); outline: none; } .ht-dialog * { box-sizing: border-box !important; } .ht-dialog--background-solid { background-color: var(--ht-dialog-solid-background-color); } .ht-dialog--background-semi-transparent { background-color: color-mix(in srgb, var(--ht-dialog-semi-transparent-background-color) var(--ht-dialog-semi-transparent-background-opacity, 100%), transparent); } .ht-dialog--animation { transition: opacity var(--ht-table-transition) ease-in-out; } .ht-dialog--show { opacity: 1; } .ht-dialog__content-wrapper { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 100%; padding: calc(var(--ht-gap-size) * 4); border-radius: var(--ht-wrapper-border-radius); } .ht-dialog__content { position: relative; padding: var(--ht-dialog-content-padding-horizontal) var(--ht-dialog-content-padding-vertical); max-width: 480px; color: var(--ht-foreground-color); } .ht-dialog__content--background { box-shadow: var(--ht-shadow-x, 0) var(--ht-shadow-y, 0) var(--ht-shadow-blur, 8px) color-mix(in srgb, var(--ht-shadow-color, rgb(0, 0, 0)) var(--ht-shadow-opacity, 100%), transparent); border-radius: var(--ht-dialog-content-border-radius); background-color: var(--ht-dialog-content-background-color); } .ht-dialog--confirm .ht-dialog__content-wrapper { text-align: center; padding: calc(var(--ht-gap-size) * 2); } .ht-dialog--confirm .ht-dialog__content-wrapper-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 480px; padding: calc(var(--ht-gap-size) * 2); border-radius: var(--ht-wrapper-border-radius); } .ht-dialog--confirm .ht-dialog__content-wrapper-inner--background { box-shadow: var(--ht-shadow-x, 0) var(--ht-shadow-y, 0) var(--ht-shadow-blur, 8px) color-mix(in srgb, var(--ht-shadow-color, rgb(0, 0, 0)) var(--ht-shadow-opacity, 100%), transparent); border-radius: var(--ht-dialog-content-border-radius); background-color: var(--ht-dialog-content-background-color); } .ht-dialog--confirm .ht-dialog__content-wrapper-inner:focus { outline: none; box-shadow: 0 0 0 1px var(--ht-accent-color); } .ht-dialog--confirm .ht-dialog__content { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--ht-gap-size); } .ht-dialog--confirm .ht-dialog__content:has(.ht-dialog__buttons) { gap: calc(var(--ht-gap-size) * 2); } .ht-dialog--confirm .ht-dialog__title { margin: 0; font-size: var(--ht-font-size); font-weight: var(--ht-font-weight); line-height: var(--ht-line-height); } .ht-dialog--confirm .ht-dialog__description { margin: 0; color: var(--ht-foreground-secondary-color); font-size: var(--ht-font-size-small); line-height: var(--ht-line-height-small); font-weight: var(--ht-font-weight); } .ht-dialog--confirm .ht-dialog__buttons { display: flex; justify-content: center; flex-direction: row; flex-wrap: wrap; gap: calc(var(--ht-gap-size) * 2); } .handsontable.ht-pagination { color: var(--ht-pagination-bar-foreground-color); background: var(--ht-pagination-bar-background-color); border: 1px solid var(--ht-wrapper-border-color); border-top-color: transparent; border-radius: 0 0 var(--ht-wrapper-border-radius) var(--ht-wrapper-border-radius); font-size: var(--ht-font-size); line-height: var(--ht-line-height); box-sizing: border-box; overflow-x: auto; } .handsontable.ht-pagination--bordered { border-top-color: var(--ht-wrapper-border-color); } .handsontable.ht-pagination .ht-pagination__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: calc(var(--ht-gap-size) * 4); border-radius: 0 0 var(--ht-wrapper-border-radius) var(--ht-wrapper-border-radius); padding-inline: var(--ht-pagination-bar-horizontal-padding); padding-block: var(--ht-pagination-bar-vertical-padding); min-width: 230px; } .handsontable.ht-pagination .ht-page-size-section { display: flex; align-items: center; gap: calc(var(--ht-gap-size) * 2); } .handsontable.ht-pagination .ht-page-size-section__label { white-space: nowrap; } .handsontable.ht-pagination .ht-page-size-section__select-wrapper { position: relative; border-radius: var(--ht-input-border-radius); } .handsontable.ht-pagination .ht-page-size-section__select-wrapper select { padding-inline-start: var(--ht-gap-size); padding-inline-end: calc(var(--ht-gap-size) + var(--ht-icon-size)); padding-top: var(--ht-gap-size); padding-bottom: var(--ht-gap-size); border-radius: var(--ht-input-border-radius); color: var(--ht-input-foreground-color); background-color: var(--ht-input-background-color); border: 1px solid var(--ht-input-border-color); line-height: calc(var(--ht-line-height) - 4px); -webkit-appearance: none; font-size: inherit; cursor: pointer; } .handsontable.ht-pagination .ht-page-size-section__select-wrapper select:disabled { opacity: 0.4; cursor: default; color: var(--ht-input-disabled-foreground-color); background-color: var(--ht-input-disabled-background-color); border-color: var(--ht-input-disabled-border-color); } .handsontable.ht-pagination .ht-page-size-section__select-wrapper select:hover:not(:disabled) { color: var(--ht-input-hover-foreground-color); background-color: var(--ht-input-hover-background-color); border-color: var(--ht-input-hover-border-color); } .handsontable.ht-pagination .ht-page-size-section__select-wrapper select:focus { color: var(--ht-input-focus-foreground-color); background-color: var(--ht-input-focus-background-color); border-color: var(--ht-input-focus-border-color); outline: none; } .handsontable.ht-pagination .ht-page-size-section__select-wrapper::after { content: ""; display: block; position: absolute; inset-inline-end: var(--ht-gap-size); inset-block-end: 50%; transform: translateY(50%); background-color: var(--ht-foreground-color); pointer-events: none; } .handsontable.ht-pagination .ht-page-counter-section { margin-inline-end: auto; } .handsontable.ht-pagination .ht-page-navigation-section { display: flex; align-items: center; gap: 1px; } .handsontable.ht-pagination .ht-page-navigation-section__button { font-size: inherit; border: 1px solid var(--ht-pagination-bar-background-color); color: var(--ht-secondary-button-foreground-color); background-color: var(--ht-pagination-bar-background-color); border-radius: var(--ht-icon-button-large-border-radius); padding: var(--ht-icon-button-large-padding); cursor: pointer; } .handsontable.ht-pagination .ht-page-navigation-section__button::before { content: ""; display: block; } .handsontable.ht-pagination .ht-page-navigation-section__button--disabled { cursor: default; pointer-events: none; color: var(--ht-secondary-button-disabled-foreground-color); } .handsontable.ht-pagination .ht-page-navigation-section__button:hover:not(:disabled) { background-color: var(--ht-secondary-button-hover-background-color); } .handsontable.ht-pagination .ht-page-navigation-section__button:focus { outline: none; border: 1px solid var(--ht-accent-color); } .handsontable.ht-pagination .ht-page-navigation-section__label { white-space: nowrap; min-width: 100px; text-align: center; } .handsontable.ht-wrapper.htPagination { border-end-start-radius: 0; border-end-end-radius: 0; } .handsontable.ht-wrapper.htPagination .htCore { border-end-start-radius: 0; border-end-end-radius: 0; } .handsontable.ht-wrapper.htPagination .htCore thead tr:last-child th:first-child, .handsontable.ht-wrapper.htPagination .htCore tbody tr:last-child td:first-child, .handsontable.ht-wrapper.htPagination .htCore tbody tr:last-child th:first-child { border-end-start-radius: 0 !important; } .handsontable.ht-wrapper.htPagination .htCore thead tr:last-child th:last-child, .handsontable.ht-wrapper.htPagination .htCore tbody tr:last-child td:last-child, .handsontable.ht-wrapper.htPagination .htCore tbody tr:last-child th:last-child { border-end-end-radius: 0 !important; } .ht-loading__icon-svg { display: block; width: var(--ht-icon-size); height: var(--ht-icon-size); color: var(--ht-accent-color); animation: ht-loading-spin 1s linear infinite; transform-origin: 50% 50%; } .ht-loading__content { display: flex; align-items: center; gap: calc(var(--ht-gap-size) * 2); } .ht-loading__title { margin: 0; font-size: var(--ht-font-size); font-weight: var(--ht-font-weight); line-height: var(--ht-line-height); } .ht-loading__description { margin: 0; color: var(--ht-foreground-secondary-color); font-size: var(--ht-font-size-small); line-height: var(--ht-line-height-small); font-weight: var(--ht-font-weight); } @keyframes ht-loading-spin { to { transform: rotate(360deg); } } .ht-empty-data-state { display: none; position: absolute; width: 100%; left: 0; z-index: 999; overflow-y: auto; border: 1px solid var(--ht-border-color); border-radius: var(--ht-wrapper-border-radius); box-sizing: border-box; background-color: var(--ht-background-color); } .ht-empty-data-state * { box-sizing: border-box !important; } .ht-empty-data-state__content-wrapper { display: flex; align-items: center; justify-content: center; text-align: center; width: 100%; min-height: 100%; padding: calc(var(--ht-gap-size) * 2); border-radius: var(--ht-wrapper-border-radius); } .ht-empty-data-state__content-wrapper-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 480px; padding: calc(var(--ht-gap-size) * 2); border-radius: var(--ht-wrapper-border-radius); } .ht-empty-data-state__content-wrapper-inner:focus { outline: none; box-shadow: 0 0 0 1px var(--ht-accent-color); } .ht-empty-data-state__content { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--ht-gap-size); } .ht-empty-data-state__title { margin: 0; font-size: var(--ht-font-size); font-weight: var(--ht-font-weight); line-height: var(--ht-line-height); } .ht-empty-data-state__description { margin: 0; color: var(--ht-foreground-secondary-color); font-size: var(--ht-font-size-small); line-height: var(--ht-line-height-small); font-weight: var(--ht-font-weight); } .ht-empty-data-state__buttons { display: flex; justify-content: center; flex-direction: row; flex-wrap: wrap; gap: calc(var(--ht-gap-size) * 2); } .ht-empty-data-state__buttons--has-buttons { margin-top: calc(var(--ht-gap-size) * 2); } .ht-empty-data-state--disable-top-border { border-start-start-radius: 0; border-start-end-radius: 0; border-top-width: 0; } .ht-empty-data-state--disable-inline-border { border-start-start-radius: 0; border-end-start-radius: 0; border-inline-start-width: 0; } .ht-empty-data-state--disable-bottom-border, .ht-empty-data-state:has(~ .ht-pagination) { border-end-start-radius: 0; border-end-end-radius: 0; border-bottom-width: 0; } `;function vCe(t,e){Yq(t,e),e.add(t)}function Tg(t,e,n){Yq(t,e),e.set(t,n)}function Yq(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yo(t,e){return t.get(rd(t,e))}function jg(t,e,n){return t.set(rd(t,e),n),n}function rd(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Gq="handsontable-core-styles";var $j=new WeakMap,UR=new WeakMap,Fj=new WeakMap,a$=new WeakMap,Mg=new WeakMap,YR=new WeakMap,GR=new WeakMap,l$=new WeakMap,Ud=new WeakSet;class bCe{constructor(e){let{hot:n,rootElement:r,rootDocument:i,onThemeChange:s=()=>{},injectCoreCss:a=!0}=e;vCe(this,Ud),Tg(this,$j,void 0),Tg(this,UR,void 0),Tg(this,Fj,void 0),Tg(this,a$,void 0),Tg(this,Mg,void 0),Tg(this,YR,{}),Tg(this,GR,{}),Tg(this,l$,void 0),jg($j,this,n),jg(Fj,this,r),jg(Mg,this,i),jg(l$,this,s),a&&rd(Ud,this,yCe).call(this)}getCSSVariableValue(e){var n;if(yo(YR,this)[`--ht-${e}`])return yo(YR,this)[`--ht-${e}`];const r=(n=rd(Ud,this,CCe).call(this,`--ht-${e}`))!==null&&n!==void 0?n:rd(Ud,this,qq).call(this,`--ht-${e}`);if(r!==null)return yo(YR,this)[`--ht-${e}`]=r,r}getStyleForTD(e){var n;return(n=yo(GR,this))===null||n===void 0||(n=n.td)===null||n===void 0?void 0:n[e]}getDefaultRowHeight(e){const n=rd(Ud,this,xCe).call(this);return e!==void 0&&e===yo($j,this).view.getFirstRenderedVisibleRow()?n+1:n}areCellsBorderBox(){return this.getStyleForTD("box-sizing")==="border-box"}useTheme(e){if(!/ht-theme-.*/.test(e)){Yn(`${e} isn't a valid theme name. Please ensure it follows the format ht-theme-<theme-name>.`);return}rd(Ud,this,Xq).call(this),e&&e!==yo(UR,this)&&jg(UR,this,e),yo(l$,this).call(this,yo(UR,this)),rd(Ud,this,Kq).call(this)}getThemeName(){return yo(UR,this)}clearCache(){rd(Ud,this,Xq).call(this),rd(Ud,this,Kq).call(this)}}function yCe(){if(!yo($j,this)||!yo(Mg,this)||!yo(Mg,this).head)return;const t=yo(Mg,this).getElementById(Gq);if(t&&t instanceof HTMLStyleElement)return;const e=yo(Mg,this).createElement("style");e.id=Gq,e.textContent=gCe,yo(Mg,this).head.appendChild(e)}function xCe(){const t=this.getCSSVariableValue("line-height"),e=this.getCSSVariableValue("cell-vertical-padding"),n=Math.ceil(parseFloat(this.getStyleForTD("border-bottom-width")));return t===null||e===null||isNaN(n)?null:t+2*e+n}function Kq(){jg(a$,this,getComputedStyle(yo(Fj,this)));const t=rd(Ud,this,wCe).call(this,["box-sizing","border-bottom-width"]);yo(GR,this).td={...yo(GR,this).td,"box-sizing":t["box-sizing"],"border-bottom-width":t["border-bottom-width"]}}function wCe(t){const e=yo(Mg,this),n=yo(Fj,this),r=e.createElement("table"),i=e.createElement("tbody"),s=e.createElement("tr"),a=e.createElement("tr"),u=e.createElement("td");a.appendChild(u),i.appendChild(s),i.appendChild(a),r.appendChild(i),n.appendChild(r);const h=getComputedStyle(u),m={};return t.forEach(g=>{m[g]=h.getPropertyValue(g)}),n.removeChild(r),m}function CCe(t){const e=Math.ceil(parseFloat(rd(Ud,this,qq).call(this,t)));return Number.isNaN(e)?null:e}function qq(t){var e;const n=(e=yo(a$,this))===null||e===void 0?void 0:e.getPropertyValue(t);return n===""?null:n}function Xq(){jg(GR,this,{}),jg(YR,this,{})}let uu=null,zj=0;function SCe(t){const e=t.ownerDocument;if(!uu){uu=e.createElement("div"),uu.setAttribute("role","status"),uu.setAttribute("aria-live","assertive"),uu.setAttribute("aria-atomic","true");const n=uu.style;n.position="absolute",n.width="1px",n.height="1px",n.margin="-1px",n.overflow="hidden",n.clipPath="rect(0 0 0 0)",n.whiteSpace="nowrap",t.appendChild(uu)}zj+=1}function RCe(){zj!==0&&(zj===1&&(uu.remove(),uu=null),zj-=1)}function _Ce(t){uu&&(uu.textContent="",setTimeout(()=>{uu&&(uu.textContent=t)},100))}const ECe={size_0:"0px",size_0_5:"2px",size_1:"4px",size_2:"8px",size_1_5:"6px",size_3:"12px",size_4:"16px",size_5:"20px",size_6:"24px",size_7:"28px",size_8:"32px",size_9:"36px",size_10:"40px",size_0_25:"1px"},NCe={default:{cellVertical:"sizing.size_1",cellHorizontal:"sizing.size_2",barsHorizontal:"sizing.size_4",barsVertical:"sizing.size_2",gap:"sizing.size_1",buttonHorizontal:"sizing.size_3",buttonVertical:"sizing.size_1_5",dialogHorizontal:"sizing.size_2",dialogVertical:"sizing.size_2",inputHorizontal:"sizing.size_3",inputVertical:"sizing.size_1_5",menuVertical:"sizing.size_2",menuHorizontal:"sizing.size_0",menuItemVertical:"sizing.size_1",menuItemHorizontal:"sizing.size_3"},compact:{cellVertical:"sizing.size_0_5",cellHorizontal:"sizing.size_1_5",barsHorizontal:"sizing.size_2",barsVertical:"sizing.size_1",gap:"sizing.size_0_5",buttonHorizontal:"sizing.size_2",buttonVertical:"sizing.size_0_5",dialogHorizontal:"sizing.size_1_5",dialogVertical:"sizing.size_1_5",inputHorizontal:"sizing.size_2",inputVertical:"sizing.size_0_5",menuVertical:"sizing.size_2",menuHorizontal:"sizing.size_0",menuItemVertical:"sizing.size_0_5",menuItemHorizontal:"sizing.size_2"},comfortable:{cellVertical:"sizing.size_2",cellHorizontal:"sizing.size_3",barsHorizontal:"sizing.size_4",barsVertical:"sizing.size_2",gap:"sizing.size_1_5",buttonHorizontal:"sizing.size_4",buttonVertical:"sizing.size_2",dialogHorizontal:"sizing.size_3",dialogVertical:"sizing.size_3",inputHorizontal:"sizing.size_4",inputVertical:"sizing.size_2",menuVertical:"sizing.size_3",menuHorizontal:"sizing.size_0",menuItemVertical:"sizing.size_2",menuItemHorizontal:"sizing.size_2"}},kCe=new Set(["name","sizing","density","icons","colors","tokens","colorScheme"]),Qq=new Set(["light","dark","auto"]),c$=new Set(["default","compact","comfortable"]),TCe=new Set(["arrowRight","arrowRightWithBar","arrowLeft","arrowLeftWithBar","arrowDown","menu","selectArrow","arrowNarrowUp","arrowNarrowDown","check","checkbox","caretHiddenLeft","caretHiddenRight","caretHiddenUp","caretHiddenDown","collapseOff","collapseOn","radio","chipClose","search"]),jCe=new Set(["fontFamily","fontSize","fontSizeSmall","lineHeight","lineHeightSmall","fontWeight","letterSpacing","gapSize","iconSize","tableTransition","borderColor","accentColor","foregroundColor","foregroundSecondaryColor","backgroundColor","backgroundSecondaryColor","placeholderColor","readOnlyColor","disabledColor","shadowColor","shadowX","shadowY","shadowBlur","shadowOpacity","barForegroundColor","barBackgroundColor","barHorizontalPadding","barVerticalPadding","cellHorizontalBorderColor","cellVerticalBorderColor","cellHorizontalPadding","cellVerticalPadding","wrapperBorderWidth","wrapperBorderRadius","wrapperBorderColor","rowHeaderOddBackgroundColor","rowHeaderEvenBackgroundColor","rowCellOddBackgroundColor","rowCellEvenBackgroundColor","cellEditorBorderWidth","cellEditorBorderColor","cellEditorForegroundColor","cellEditorBackgroundColor","cellEditorShadowBlurRadius","cellEditorShadowColor","cellSuccessBackgroundColor","cellErrorBackgroundColor","cellReadOnlyBackgroundColor","cellSelectionBorderColor","cellSelectionBackgroundColor","cellAutofillSize","cellAutofillHitAreaSize","cellAutofillBorderWidth","cellAutofillBorderRadius","cellAutofillBorderColor","cellAutofillBackgroundColor","cellAutofillFillBorderColor","cellMobileHandleSize","cellMobileHandleBorderWidth","cellMobileHandleBorderRadius","cellMobileHandleBorderColor","cellMobileHandleBackgroundColor","cellMobileHandleBackgroundOpacity","resizeIndicatorColor","moveBacklightColor","moveBacklightOpacity","moveIndicatorColor","hiddenIndicatorColor","scrollbarBorderRadius","scrollbarTrackColor","scrollbarThumbColor","headerFontWeight","headerForegroundColor","headerBackgroundColor","headerHighlightedShadowSize","headerHighlightedForegroundColor","headerHighlightedBackgroundColor","headerActiveBorderColor","headerActiveForegroundColor","headerActiveBackgroundColor","headerFilterBackgroundColor","headerRowForegroundColor","headerRowBackgroundColor","headerRowHighlightedForegroundColor","headerRowHighlightedBackgroundColor","headerRowActiveForegroundColor","headerRowActiveBackgroundColor","checkboxSize","checkboxBorderRadius","checkboxBorderColor","checkboxBackgroundColor","checkboxIconColor","checkboxFocusBorderColor","checkboxFocusBackgroundColor","checkboxFocusIconColor","checkboxFocusRingColor","checkboxDisabledBorderColor","checkboxDisabledBackgroundColor","checkboxDisabledIconColor","checkboxCheckedBorderColor","checkboxCheckedBackgroundColor","checkboxCheckedIconColor","checkboxCheckedFocusBorderColor","checkboxCheckedFocusBackgroundColor","checkboxCheckedFocusIconColor","checkboxCheckedDisabledBorderColor","checkboxCheckedDisabledBackgroundColor","checkboxCheckedDisabledIconColor","checkboxIndeterminateBorderColor","checkboxIndeterminateBackgroundColor","checkboxIndeterminateIconColor","checkboxIndeterminateFocusBorderColor","checkboxIndeterminateFocusBackgroundColor","checkboxIndeterminateFocusIconColor","checkboxIndeterminateDisabledBorderColor","checkboxIndeterminateDisabledBackgroundColor","checkboxIndeterminateDisabledIconColor","radioSize","radioBorderColor","radioBackgroundColor","radioIconColor","radioFocusBorderColor","radioFocusBackgroundColor","radioFocusIconColor","radioFocusRingColor","radioDisabledBorderColor","radioDisabledBackgroundColor","radioDisabledIconColor","radioCheckedBorderColor","radioCheckedBackgroundColor","radioCheckedIconColor","radioCheckedFocusBorderColor","radioCheckedFocusBackgroundColor","radioCheckedFocusIconColor","radioCheckedDisabledBorderColor","radioCheckedDisabledBackgroundColor","radioCheckedDisabledIconColor","iconButtonBorderRadius","iconButtonLargeBorderRadius","iconButtonLargePadding","iconButtonBorderColor","iconButtonBackgroundColor","iconButtonIconColor","iconButtonHoverBorderColor","iconButtonHoverBackgroundColor","iconButtonHoverIconColor","iconButtonActiveBorderColor","iconButtonActiveBackgroundColor","iconButtonActiveIconColor","iconButtonActiveHoverBorderColor","iconButtonActiveHoverBackgroundColor","iconButtonActiveHoverIconColor","collapseButtonBorderRadius","collapseButtonOpenBorderColor","collapseButtonOpenBackgroundColor","collapseButtonOpenIconColor","collapseButtonOpenIconActiveColor","collapseButtonOpenHoverBorderColor","collapseButtonOpenHoverBackgroundColor","collapseButtonOpenHoverIconColor","collapseButtonOpenHoverIconActiveColor","collapseButtonCloseBorderColor","collapseButtonCloseBackgroundColor","collapseButtonCloseIconColor","collapseButtonCloseIconActiveColor","collapseButtonCloseHoverBorderColor","collapseButtonCloseHoverBackgroundColor","collapseButtonCloseHoverIconColor","collapseButtonCloseHoverIconActiveColor","buttonBorderRadius","buttonHorizontalPadding","buttonVerticalPadding","primaryButtonBorderColor","primaryButtonForegroundColor","primaryButtonBackgroundColor","primaryButtonDisabledBorderColor","primaryButtonDisabledForegroundColor","primaryButtonDisabledBackgroundColor","primaryButtonHoverBorderColor","primaryButtonHoverForegroundColor","primaryButtonHoverBackgroundColor","primaryButtonFocusBorderColor","primaryButtonFocusForegroundColor","primaryButtonFocusBackgroundColor","secondaryButtonBorderColor","secondaryButtonForegroundColor","secondaryButtonBackgroundColor","secondaryButtonDisabledBorderColor","secondaryButtonDisabledForegroundColor","secondaryButtonDisabledBackgroundColor","secondaryButtonHoverBorderColor","secondaryButtonHoverForegroundColor","secondaryButtonHoverBackgroundColor","secondaryButtonFocusBorderColor","secondaryButtonFocusForegroundColor","secondaryButtonFocusBackgroundColor","commentsTextareaHorizontalPadding","commentsTextareaVerticalPadding","commentsTextareaBorderWidth","commentsTextareaBorderColor","commentsTextareaForegroundColor","commentsTextareaBackgroundColor","commentsTextareaFocusBorderWidth","commentsTextareaFocusBorderColor","commentsTextareaFocusForegroundColor","commentsTextareaFocusBackgroundColor","commentsIndicatorSize","commentsIndicatorColor","licenseHorizontalPadding","licenseVerticalPadding","licenseForegroundColor","licenseBackgroundColor","linkColor","linkHoverColor","inputBorderWidth","inputBorderRadius","inputHorizontalPadding","inputVerticalPadding","inputBorderColor","inputForegroundColor","inputBackgroundColor","inputHoverBorderColor","inputHoverForegroundColor","inputHoverBackgroundColor","inputDisabledBorderColor","inputDisabledForegroundColor","inputDisabledBackgroundColor","inputFocusBorderColor","inputFocusForegroundColor","inputFocusBackgroundColor","menuBorderWidth","menuBorderRadius","menuHorizontalPadding","menuVerticalPadding","menuItemHorizontalPadding","menuItemVerticalPadding","menuBorderColor","menuShadowX","menuShadowY","menuShadowBlur","menuShadowColor","menuShadowOpacity","menuItemHoverColor","menuItemHoverColorOpacity","menuItemActiveColor","menuItemActiveColorOpacity","dialogSemiTransparentBackgroundColor","dialogSemiTransparentBackgroundOpacity","dialogSolidBackgroundColor","dialogContentPaddingHorizontal","dialogContentPaddingVertical","dialogContentBorderRadius","dialogContentBackgroundColor","paginationBarForegroundColor","paginationBarBackgroundColor","paginationBarHorizontalPadding","paginationBarVerticalPadding","chipBackground","chipBorderRadius","chipVerticalPadding","chipHorizontalPadding","chipGap"]);function MCe(t,e){return(typeof t!="string"||t.trim()==="")&>(`[ThemeBuilder] ${e}.name must be a non-empty string.`),t}function Zq(t){if(!Qq.has(t)){const e=[...Qq].join(", ");gt(`[ThemeBuilder] Invalid color scheme: "${t}". Must be one of: ${e}.`)}return t}function u$(t){if(!c$.has(t)){const e=[...c$].join(", ");gt(`[ThemeBuilder] Invalid density: "${t}". Must be one of: ${e}.`)}return t}function PCe(t,e){nn(t)||gt(`[ThemeBuilder] ${e}.sizes must be an object.`),Object.keys(t).forEach(n=>{c$.has(n)||Yn(`[ThemeBuilder] Unknown density size key: "${n}" in ${e}.sizes. This may be a custom density size or a typo.`)})}function ACe(t,e){nn(t)?((!t.type||!t.sizes)&>(`[ThemeBuilder] ${e} must be a string or an object with a 'type' and 'sizes' property.`),u$(t.type),PCe(t.sizes,`${e}.sizes`)):typeof t=="string"&&u$(t)}function Jq(t,e){Object.entries(t).forEach(n=>{let[r,i]=n;const s=`${e}.${r}`;typeof i!="string"&&(nn(i)?Jq(i,s):gt(`[ThemeBuilder] ${s} must be a string or an object.`))})}function d$(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const{type:i="key",warnMissing:s=!1}=r;if(!t){s&&Yn(`[ThemeBuilder] No ${i}s provided in ${n}. All ${i}s are missing.`);return}if(Object.keys(t).forEach(u=>{e.has(u)||Yn(`[ThemeBuilder] Unknown ${i} key: "${u}" in ${n}. This may be a custom ${i} or a typo.`)}),s){const u=[];e.forEach(h=>{h in t||u.push(h)}),u.length>0&&Yn(`[ThemeBuilder] Missing ${i}(s) in ${n}: ${u.join(", ")}`)}}function eX(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{requiredFields:r=[]}=n;(typeof t!="object"||t===null)&>(`[ThemeBuilder] ${e} must be an object.`);const{name:i,sizing:s,density:a,icons:u,colors:h,tokens:m,colorScheme:g}=t;d$(t,kCe,e,{type:"param"}),r.forEach(y=>{t[y]===void 0&>(`[ThemeBuilder] ${e}.${y} is required.`)}),i!==void 0&&MCe(i,e),s!==void 0&&(nn(s)||gt(`[ThemeBuilder] ${e}.sizing must be an object.`)),a!==void 0&&(!nn(a)&&typeof a!="string"&>(`[ThemeBuilder] ${e}.density must be a string or an object.`),ACe(a,`${e}.density`)),u!==void 0&&(nn(u)||gt(`[ThemeBuilder] ${e}.icons must be an object.`),d$(u,TCe,`${e}.icons`,{type:"icon",warnMissing:r.includes("icons")})),h!==void 0&&(nn(h)||gt(`[ThemeBuilder] ${e}.colors must be an object.`),Jq(h,`${e}.colors`)),m!==void 0&&(nn(m)||gt(`[ThemeBuilder] ${e}.tokens must be an object.`),d$(m,jCe,`${e}.tokens`,{type:"token",warnMissing:r.includes("tokens")})),g!==void 0&&Zq(g)}function OCe(t,e){tX(t,e),e.add(t)}function KR(t,e,n){tX(t,e),e.set(t,n)}function tX(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Is(t,e){return t.get(Ag(t,e))}function Pg(t,e,n){return t.set(Ag(t,e),n),n}function Ag(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const ICe=["sizing","icons","colors","tokens"],DCe=["name","icons","colors","tokens"];var du=new WeakMap,pw=new WeakMap,Vj=new WeakMap,gw=new WeakMap,eb=new WeakMap,tb=new WeakSet;class HCe{constructor(e){OCe(this,tb),KR(this,du,void 0),KR(this,pw,void 0),KR(this,Vj,new Set),KR(this,gw,"auto"),KR(this,eb,"default"),eX(e,"themeConfig",{requiredFields:DCe}),Pg(du,this,{name:void 0,sizing:ECe,density:{type:Is(eb,this),sizes:NCe},icons:{},colors:{},tokens:{},colorScheme:Is(gw,this)}),Ag(tb,this,nX).call(this,e),Pg(du,this,Is(pw,this))}subscribe(e){return typeof e!="function"&>("[ThemeBuilder] listener must be a function."),Is(Vj,this).add(e),()=>Is(Vj,this).delete(e)}params(e){return eX(e,"params"),Ag(tb,this,nX).call(this,e),Ag(tb,this,h$).call(this),this}setColorScheme(e){return Pg(gw,this,Zq(e)),Is(pw,this).colorScheme=Is(gw,this),Is(du,this).colorScheme=Is(gw,this),Ag(tb,this,h$).call(this),this}setDensityType(e){return Pg(eb,this,u$(e)),Is(pw,this).density.type=Is(eb,this),Is(du,this).density.type=Is(eb,this),Ag(tb,this,h$).call(this),this}getThemeConfig(){return Is(pw,this)}}function h$(){const t=this.getThemeConfig();Is(Vj,this).forEach(e=>e(t))}function LCe(t,e){if(nn(e)){var n;t.density=nL(t.density,e),Pg(eb,this,e.type),(n=Is(du,this))!==null&&n!==void 0&&n.density&&(Is(du,this).density.type=e.type)}else if(typeof e=="string"){var r;t.density.type=e,Pg(eb,this,e),(r=Is(du,this))!==null&&r!==void 0&&r.density&&(Is(du,this).density.type=e)}}function nX(t){const e=ea(Is(du,this));if(t.name!==void 0&&(Is(du,this).name!==void 0?Yn('[ThemeBuilder] The "name" property can only be set during `registerTheme()` and cannot be updated via `params()`.'):e.name=t.name),ICe.forEach(r=>{t[r]!==void 0&&nn(t[r])&&(e[r]=nL(e[r],t[r]))}),t.density!==void 0&&Ag(tb,this,LCe).call(this,e,t.density),t.colorScheme!==void 0){var n;e.colorScheme=t.colorScheme,Pg(gw,this,t.colorScheme),(n=Is(du,this))!==null&&n!==void 0&&n.colorScheme&&(Is(du,this).colorScheme=t.colorScheme)}Pg(pw,this,e)}function $Ce(t){return new HCe(t)}const Qi=(t,e)=>`width: var(--ht-icon-size); height: var(--ht-icon-size); -webkit-mask-size: contain; -webkit-mask-image: url("${t[e]}"); background-color: currentColor;`,FCe=(t,e)=>{const n="";return`${n}.htDropdownMenu table tbody tr td.htSubmenu .htItemWrapper::after, ${n}.htContextMenu table tbody tr td.htSubmenu .htItemWrapper::after, ${n}.htFiltersConditionsMenu table tbody tr td.htSubmenu .htItemWrapper::after, ${n}.pika-single .pika-next { ${Qi(t,"arrowRight")} } ${n}.pika-single .pika-prev { ${Qi(t,"arrowLeft")} } ${n}.ht-page-size-section__select-wrapper::after { ${Qi(t,"arrowDown")} } ${n}.changeType::before { ${Qi(t,"menu")} } ${n}.htUISelectCaption::after, .htAutocompleteArrow::after { ${Qi(t,"selectArrow")} } ${n}.columnSorting.sortAction.ascending::before { ${Qi(t,"arrowNarrowUp")} } ${n}.columnSorting.sortAction.descending::before { ${Qi(t,"arrowNarrowDown")} } ${n}.ht-page-navigation-section .ht-page-first::before { ${Qi(t,"arrowLeftWithBar")} } ${n}[dir="rtl"] .ht-page-navigation-section .ht-page-first::before { ${Qi(t,"arrowRightWithBar")} } ${n}.ht-page-navigation-section .ht-page-prev::before { ${Qi(t,"arrowLeft")} } ${n}[dir="rtl"] .ht-page-navigation-section .ht-page-prev::before { ${Qi(t,"arrowRight")} } ${n}.ht-page-navigation-section .ht-page-next::before { ${Qi(t,"arrowRight")} } ${n}[dir="rtl"] .ht-page-navigation-section .ht-page-next::before { ${Qi(t,"arrowLeft")} } ${n}.ht-page-navigation-section .ht-page-last::before { ${Qi(t,"arrowRightWithBar")} } ${n}[dir="rtl"] .ht-page-navigation-section .ht-page-last::before { ${Qi(t,"arrowLeftWithBar")} } ${n}.htDropdownMenu table tbody tr td .htItemWrapper span.selected::after, ${n}.htContextMenu table tbody tr td .htItemWrapper span.selected::after, ${n}.htFiltersConditionsMenu table tbody tr td .htItemWrapper span.selected::after { ${Qi(t,"check")} } ${n}.htCheckboxRendererInput { appearance: none; } ${n}.htCheckboxRendererInput::after { ${Qi(t,"checkbox")} } ${n}th.beforeHiddenColumn::after { ${Qi(t,"caretHiddenLeft")} } ${n}th.afterHiddenColumn::before { ${Qi(t,"caretHiddenRight")} } ${n}th.beforeHiddenRow::after { ${Qi(t,"caretHiddenUp")} } ${n}th.afterHiddenRow::before { ${Qi(t,"caretHiddenDown")} } ${n}.collapsibleIndicator::before, ${n}.ht_nestingButton::before { ${Qi(t,"collapseOff")} } ${n}.collapsibleIndicator.collapsed::before, ${n}.ht_nestingButton.ht_nestingExpand::before { ${Qi(t,"collapseOn")} } ${n}.htUIRadio > input[type="radio"]::after { ${Qi(t,"radio")} } ${n}.ht-multi-select-chip-remove::before { ${Qi(t,"chipClose")} } ${n}.ht-multi-select-editor-search-icon { ${Qi(t,"search")} } ${n}.ht-multi-select-editor-item-selected input::after { ${Qi(t,"checkbox")} }`},f$="--ht-",zCe=["font-family"],VCe=["tokens.","colors.","sizing.","density."];function BCe(t){return typeof t=="string"&&VCe.some(e=>t.includes(e))}function WCe(t){return t.includes("tokens.")?`var(${f$}${aR(t.split(".").slice(1).join("-"))})`:`var(${f$}${aR(t.split(".").join("-"))})`}function UCe(t,e){return`${f$}${t?`${t}-`:""}${aR(e)}`}function vw(t,e){if(BCe(t))return WCe(t);if(Array.isArray(t)){if(t.length>=2){const[n,r]=t;return typeof n=="string"&&typeof r=="string"?`light-dark(${vw(n,e)}, ${vw(r,e)})`:typeof n=="string"?vw(n,e):typeof r=="string"?vw(r,e):""}return vw(t[0],e)}return e&&zCe.includes(e)?String(t):aR(t)}function YCe(t,e,n){return`${UCe(t,e)}: ${vw(n,e)};`}function qR(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",r="";return Object.entries(t).forEach(i=>{let[s,a]=i;const u=aR(s),h=n?`${n}-${u}`:u;nn(a)?r+=qR(a,e,h):r+=`${YCe(e,h,a)} `}),r}function GCe(t,e){KCe(t,e),e.add(t)}function KCe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Bj(t,e,n){return(e=qCe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qCe(t){var e=XCe(t,"string");return typeof e=="symbol"?e:e+""}function XCe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function rX(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const QCe="ht-theme-";var m$=new WeakSet;class ZCe{constructor(e){let{hot:n,themeObject:r}=e;GCe(this,m$),Bj(this,"hot",void 0),Bj(this,"themeStyles",void 0),Bj(this,"themeClassName",void 0),Bj(this,"themeConfig",void 0),this.hot=n,this.update(r)}getClassName(){return this.themeClassName}update(e){this.hot&&(e.getThemeConfig===void 0&>('[ThemeManager] The "theme" option must be an instance of ThemeBuilder.'),this.themeConfig=e.getThemeConfig(),this.themeClassName=`${QCe}${this.themeConfig.name}`,typeof e.subscribe=="function"&&e.subscribe(n=>{var r;(r=this.hot)!==null&&r!==void 0&&r.stylesHandler&&(this.themeConfig=n,rX(m$,this,iX).call(this),this.hot.stylesHandler.clearCache(),this.hot.render(),this.hot.runHooks("afterSetTheme",this.themeClassName,!1))}),this.mount(),this.hot.runHooks("afterSetTheme",this.themeClassName,!0))}mount(){rX(m$,this,iX).call(this)}unmount(){this.themeStyles&&this.themeStyles.remove()}destroy(){this.unmount(),this.hot.themeManager=null}}function iX(){if(!this.themeConfig||!this.hot||!this.hot.rootDocument||!this.hot.rootWrapperElement)return;const t=this.themeConfig.colorScheme==="auto"?"light dark":this.themeConfig.colorScheme;this.themeStyles?this.themeStyles.textContent="":this.themeStyles=this.hot.rootDocument.createElement("style"),this.themeStyles.textContent=`:where(.${this.themeClassName}) { `,this.themeStyles.textContent+=`color-scheme: ${t}; `,this.themeConfig.sizing&&(this.themeStyles.textContent+=qR(this.themeConfig.sizing,"sizing")),this.themeConfig.density&&this.themeConfig.density.type&&this.themeConfig.density.sizes&&this.themeConfig.density.sizes[this.themeConfig.density.type]&&(this.themeStyles.textContent+=qR(this.themeConfig.density.sizes[this.themeConfig.density.type],"density")),this.themeConfig.colors&&(this.themeStyles.textContent+=qR(this.themeConfig.colors,"colors")),this.themeConfig.tokens&&(this.themeStyles.textContent+=qR(this.themeConfig.tokens)),this.themeConfig.icons&&(this.themeStyles.textContent+=FCe(this.themeConfig.icons)),this.themeStyles.textContent+="}",this.hot.rootWrapperElement&&this.hot.rootWrapperElement.querySelector("style")?this.hot.rootWrapperElement.querySelector("style").textContent=this.themeStyles.textContent:this.hot.rootWrapperElement.prepend(this.themeStyles)}function JCe(t){let{hot:e,themeObject:n}=t;return new ZCe({hot:e,themeObject:n})}const eSe={name:"main",density:"default",icons:{arrowRight:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.64648 10.9393L9.93938 7.64644L6.64648 4.35354' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A",arrowRightWithBar:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.9292 4.64188L8.27934 7.99203L4.9292 11.3422M11.0711 4.08353V11.3422' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E",arrowLeft:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.93933 10.9393L6.64644 7.64644L9.93933 4.35354' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A",arrowLeftWithBar:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.0713 4.64188L7.72115 7.99203L11.0713 11.3422M4.92936 4.08353L4.92936 11.3422' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E",arrowDown:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg opacity='0.6'%3E%3Cpath d='M11.5859 6L8.29304 9.29289L5.00015 6' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3C/svg%3E",menu:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.0002 6.66663C11.4262 6.66663 11.6487 7.15963 11.3917 7.47813L11.3537 7.52013L8.35372 10.5201C8.26762 10.6062 8.15307 10.6579 8.03156 10.6656C7.91005 10.6732 7.78992 10.6363 7.69372 10.5616L7.64672 10.5201L4.64672 7.52013L4.60522 7.47313L4.57822 7.43463L4.55122 7.38663L4.54272 7.36863L4.52922 7.33513L4.51322 7.28113L4.50822 7.25463L4.50322 7.22463L4.50122 7.19613V7.13713L4.50372 7.10813L4.50822 7.07813L4.51322 7.05213L4.52922 6.99813L4.54272 6.96463L4.57772 6.89863L4.61022 6.85363L4.64672 6.81313L4.69372 6.77163L4.73222 6.74463L4.78022 6.71763L4.79822 6.70913L4.83172 6.69563L4.88572 6.67963L4.91222 6.67463L4.94222 6.66963L4.97072 6.66763L11.0002 6.66663Z' fill='currentColor'/%3E%3C/svg%3E%0A",selectArrow:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.0002 6.66663C11.4262 6.66663 11.6487 7.15963 11.3917 7.47813L11.3537 7.52013L8.35372 10.5201C8.26762 10.6062 8.15307 10.6579 8.03156 10.6656C7.91005 10.6732 7.78992 10.6363 7.69372 10.5616L7.64672 10.5201L4.64672 7.52013L4.60522 7.47313L4.57822 7.43463L4.55122 7.38663L4.54272 7.36863L4.52922 7.33513L4.51322 7.28113L4.50822 7.25463L4.50322 7.22463L4.50122 7.19613V7.13713L4.50372 7.10813L4.50822 7.07813L4.51322 7.05213L4.52922 6.99813L4.54272 6.96463L4.57772 6.89863L4.61022 6.85363L4.64672 6.81313L4.69372 6.77163L4.73222 6.74463L4.78022 6.71763L4.79822 6.70913L4.83172 6.69563L4.88572 6.67963L4.91222 6.67463L4.94222 6.66963L4.97072 6.66763L11.0002 6.66663Z' fill='currentColor'/%3E%3C/svg%3E%0A",arrowNarrowUp:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.00008 12.6667L8.00008 3.33335M8.00008 3.33335L5.33342 6.00002M8.00008 3.33335L10.6667 6.00002' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A",arrowNarrowDown:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.00004 3.33331V12.6666M8.00004 12.6666L10.6667 9.99998M8.00004 12.6666L5.33337 9.99998' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A",check:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.33337 8.00002L6.66671 11.3334L13.3334 4.66669' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A",checkbox:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 8L7 10L11 6' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A",caretHiddenLeft:"data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.08482 1.35771L6.11503 1.3551H6.17649L6.2067 1.35771L6.23795 1.36239L6.26503 1.3676L6.32128 1.38427L6.35618 1.39833L6.42493 1.43479L6.4718 1.46864L6.51399 1.50667L6.55722 1.55562L6.58534 1.59573L6.61347 1.64573L6.62232 1.66448L6.63639 1.69937L6.65305 1.75562L6.65826 1.78323L6.66347 1.81448L6.66555 1.84417L6.66659 1.87489V8.12489C6.66659 8.56864 6.15305 8.80042 5.82128 8.53271L5.77753 8.49312L2.65253 5.36812C2.56286 5.27844 2.50899 5.15912 2.50103 5.03254C2.49307 4.90596 2.53157 4.78083 2.6093 4.68062L2.65253 4.63167L5.77753 1.50667L5.82649 1.46344L5.86659 1.43531L5.91659 1.40719L5.93534 1.39833L5.97024 1.38427L6.02649 1.3676L6.05409 1.36239L6.08482 1.35771Z' fill='currentColor'/%3E%3C/svg%3E",caretHiddenRight:"data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.33337 1.87499C3.33337 1.43124 3.84692 1.19947 4.17869 1.46718L4.22244 1.50676L7.34744 4.63176C7.43711 4.72145 7.49098 4.84077 7.49894 4.96735C7.5069 5.09392 7.4684 5.21905 7.39067 5.31926L7.34744 5.36822L4.22244 8.49322L4.17348 8.53645L4.13337 8.56457L4.08337 8.5927L4.06462 8.60155L4.02973 8.61562L3.97348 8.63228L3.94587 8.63749L3.91462 8.6427L3.88494 8.64478L3.85421 8.64582L3.82348 8.64478L3.79327 8.64218L3.76202 8.63749L3.73494 8.63228L3.67869 8.61562L3.64379 8.60155L3.57504 8.5651L3.52817 8.53124L3.48598 8.49322L3.44275 8.44426L3.41462 8.40416L3.3865 8.35416L3.37764 8.33541L3.36358 8.30051L3.34692 8.24426L3.34171 8.21666L3.3365 8.18541L3.33442 8.15572L3.33337 1.87499Z' fill='currentColor'/%3E%3C/svg%3E",caretHiddenUp:"data:image/svg+xml;charset=utf-8,%3Csvg width='8' height='8' viewBox='0 0 8 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.76425 2.43099C3.82165 2.3736 3.89801 2.33913 3.97902 2.33403C4.06003 2.32894 4.14012 2.35358 4.20425 2.40333L4.23558 2.43099L6.23558 4.43099L6.26325 4.46233L6.28125 4.48799L6.29925 4.51999L6.30492 4.53199L6.31392 4.55433L6.32458 4.59033L6.32792 4.60799L6.33125 4.62799L6.33258 4.64699L6.33325 4.66666L6.33258 4.68633L6.33092 4.70566L6.32792 4.72566L6.32458 4.74299L6.31392 4.77899L6.30492 4.80133L6.28158 4.84533L6.25992 4.87533L6.23558 4.90233L6.20425 4.92999L6.17858 4.94799L6.14658 4.96599L6.13458 4.97166L6.11225 4.98066L6.07625 4.99133L6.05858 4.99466L6.03858 4.99799L6.01958 4.99933L5.99992 4.99999H1.99992C1.71592 4.99999 1.56758 4.67133 1.73892 4.45899L1.76425 4.43099L3.76425 2.43099Z' fill='currentColor'/%3E%3C/svg%3E%0A",caretHiddenDown:"data:image/svg+xml;charset=utf-8,%3Csvg width='8' height='8' viewBox='0 0 8 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.9999 3C6.2839 3 6.43224 3.32867 6.2609 3.541L6.23557 3.569L4.23557 5.569C4.17817 5.62639 4.10181 5.66087 4.0208 5.66596C3.93979 5.67106 3.8597 5.64642 3.79557 5.59667L3.76424 5.569L1.76424 3.569L1.73657 3.53767L1.71857 3.512L1.70057 3.48L1.6949 3.468L1.6859 3.44567L1.67524 3.40967L1.6719 3.392L1.66857 3.372L1.66724 3.353V3.31367L1.6689 3.29433L1.6719 3.27433L1.67524 3.257L1.6859 3.221L1.6949 3.19867L1.71824 3.15467L1.7399 3.12467L1.76424 3.09767L1.79557 3.07L1.82124 3.052L1.85324 3.034L1.86524 3.02833L1.88757 3.01933L1.92357 3.00867L1.94124 3.00533L1.96124 3.002L1.98024 3.00067L5.9999 3Z' fill='currentColor'/%3E%3C/svg%3E%0A",collapseOff:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.33325 8H11.6666' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A",collapseOn:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M7.49988 11.6667C7.49988 11.9428 7.72374 12.1667 7.99988 12.1667C8.27602 12.1667 8.49988 11.9428 8.49988 11.6667V8.50002H11.6666C11.9427 8.50002 12.1666 8.27616 12.1666 8.00002C12.1666 7.72388 11.9427 7.50002 11.6666 7.50002H8.49988V4.33337C8.49988 4.05723 8.27602 3.83337 7.99988 3.83337C7.72374 3.83337 7.49988 4.05723 7.49988 4.33337V7.50002H4.33325C4.05711 7.50002 3.83325 7.72388 3.83325 8.00002C3.83325 8.27616 4.05711 8.50002 4.33325 8.50002H7.49988V11.6667Z' fill='currentColor'/%3E%3C/svg%3E%0A",radio:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='4' fill='currentColor'/%3E%3C/svg%3E%0A",chipClose:"data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4L4 12M4 4L12 12' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A",search:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32' fill='none'%3E%3Cg opacity='0.5'%3E%3Cpath d='M28 28L20 20M4 13.3333C4 14.559 4.24141 15.7727 4.71046 16.905C5.1795 18.0374 5.86699 19.0663 6.73367 19.933C7.60035 20.7997 8.62925 21.4872 9.76162 21.9562C10.894 22.4253 12.1077 22.6667 13.3333 22.6667C14.559 22.6667 15.7727 22.4253 16.905 21.9562C18.0374 21.4872 19.0663 20.7997 19.933 19.933C20.7997 19.0663 21.4872 18.0374 21.9562 16.905C22.4253 15.7727 22.6667 14.559 22.6667 13.3333C22.6667 12.1077 22.4253 10.894 21.9562 9.76162C21.4872 8.62925 20.7997 7.60035 19.933 6.73367C19.0663 5.86699 18.0374 5.1795 16.905 4.71046C15.7727 4.24141 14.559 4 13.3333 4C12.1077 4 10.894 4.24141 9.76162 4.71046C8.62925 5.1795 7.60035 5.86699 6.73367 6.73367C5.86699 7.60035 5.1795 8.62925 4.71046 9.76162C4.24141 10.894 4 12.1077 4 13.3333Z' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3C/svg%3E"},colors:{white:"#ffffffff",black:"#000000ff",primary:{100:"#6180ffff",200:"#5573f0ff",300:"#4669f6ff",400:"#2e56fcff",500:"#1a42e8ff",600:"#1535bcff"},palette:{50:"#f7f7f9ff",100:"#e7e7e9ff",200:"#b9b9bbff",300:"#a3a3a3ff",400:"#68696cff",500:"#404144ff",600:"#313132ff",700:"#282829ff",800:"#222222ff",900:"#1e1e1fff",950:"#050506ff"},transparent:"#ffffff00"},tokens:{fontFamily:"Inter",fontSize:"14px",fontSizeSmall:"12px",lineHeight:"20px",lineHeightSmall:"18px",fontWeight:"400",letterSpacing:"0px",borderColor:["colors.palette.100","colors.palette.700"],accentColor:["colors.primary.500","colors.primary.300"],foregroundColor:["colors.palette.800","colors.palette.200"],foregroundSecondaryColor:["colors.palette.400","colors.palette.300"],backgroundColor:["colors.white","colors.palette.950"],backgroundSecondaryColor:["colors.palette.50","colors.palette.900"],placeholderColor:["colors.palette.300","colors.palette.400"],readOnlyColor:["colors.palette.400","colors.palette.300"],disabledColor:["colors.palette.300","colors.palette.400"],gapSize:"density.gap",iconSize:"sizing.size_4",tableTransition:"0.15s",wrapperBorderWidth:"0px",wrapperBorderRadius:"sizing.size_1",wrapperBorderColor:"tokens.borderColor",barForegroundColor:"tokens.foregroundColor",barBackgroundColor:"tokens.backgroundSecondaryColor",barHorizontalPadding:"density.barsHorizontal",barVerticalPadding:"density.barsVertical",shadowColor:["colors.palette.800","colors.palette.200"],shadowX:"sizing.size_0",shadowY:"sizing.size_2",shadowBlur:"sizing.size_4",shadowOpacity:"8%",cellHorizontalPadding:"density.cellHorizontal",cellVerticalPadding:"density.cellVertical",cellHorizontalBorderColor:"tokens.borderColor",cellVerticalBorderColor:"tokens.borderColor",cellSelectionBorderColor:"tokens.accentColor",cellSelectionBackgroundColor:["colors.primary.400","colors.primary.200"],cellSuccessBackgroundColor:"#37bc6c33",cellErrorBackgroundColor:"#fa4d3233",cellReadOnlyBackgroundColor:"tokens.backgroundSecondaryColor",cellAutofillSize:"sizing.size_1_5",cellAutofillHitAreaSize:"sizing.size_3",cellAutofillBorderWidth:"sizing.size_0_25",cellAutofillBorderRadius:"sizing.size_1",cellAutofillBorderColor:"tokens.backgroundColor",cellAutofillBackgroundColor:"tokens.accentColor",cellAutofillFillBorderColor:"tokens.foregroundColor",cellEditorBorderWidth:"2px",cellEditorBorderColor:"tokens.accentColor",cellEditorForegroundColor:["colors.palette.950","colors.white"],cellEditorBackgroundColor:"tokens.backgroundColor",cellEditorShadowBlurRadius:"0px",cellEditorShadowColor:"tokens.accentColor",cellMobileHandleSize:"sizing.size_3",cellMobileHandleBorderWidth:"sizing.size_0_25",cellMobileHandleBorderRadius:"sizing.size_3",cellMobileHandleBorderColor:"tokens.accentColor",cellMobileHandleBackgroundColor:"tokens.accentColor",cellMobileHandleBackgroundOpacity:"40%",headerFontWeight:"tokens.fontWeight",headerForegroundColor:"tokens.foregroundColor",headerBackgroundColor:"tokens.backgroundSecondaryColor",headerHighlightedShadowSize:"0px",headerHighlightedForegroundColor:["colors.palette.950","colors.white"],headerHighlightedBackgroundColor:["colors.palette.100","colors.palette.700"],headerActiveBorderColor:["colors.primary.400","colors.primary.200"],headerActiveForegroundColor:"colors.white",headerActiveBackgroundColor:"tokens.accentColor",headerFilterBackgroundColor:"tokens.cellSuccessBackgroundColor",headerRowForegroundColor:"tokens.foregroundColor",headerRowBackgroundColor:"tokens.backgroundSecondaryColor",headerRowHighlightedForegroundColor:["colors.palette.950","colors.white"],headerRowHighlightedBackgroundColor:["colors.palette.100","colors.palette.700"],headerRowActiveForegroundColor:"colors.white",headerRowActiveBackgroundColor:"tokens.accentColor",rowHeaderOddBackgroundColor:"tokens.backgroundSecondaryColor",rowHeaderEvenBackgroundColor:"tokens.backgroundSecondaryColor",rowCellOddBackgroundColor:"tokens.backgroundColor",rowCellEvenBackgroundColor:"tokens.backgroundColor",buttonBorderRadius:"sizing.size_1",buttonHorizontalPadding:"density.buttonHorizontal",buttonVerticalPadding:"density.buttonVertical",primaryButtonBorderColor:"colors.transparent",primaryButtonForegroundColor:"colors.white",primaryButtonBackgroundColor:"tokens.accentColor",primaryButtonDisabledBorderColor:"colors.transparent",primaryButtonDisabledForegroundColor:"tokens.disabledColor",primaryButtonDisabledBackgroundColor:["colors.palette.100","colors.palette.700"],primaryButtonHoverBorderColor:"colors.transparent",primaryButtonHoverForegroundColor:"tokens.backgroundColor",primaryButtonHoverBackgroundColor:["colors.primary.600","colors.primary.100"],primaryButtonFocusBorderColor:"tokens.backgroundColor",primaryButtonFocusForegroundColor:"tokens.backgroundColor",primaryButtonFocusBackgroundColor:"tokens.accentColor",secondaryButtonBorderColor:"tokens.borderColor",secondaryButtonForegroundColor:"tokens.foregroundColor",secondaryButtonBackgroundColor:"tokens.backgroundColor",secondaryButtonDisabledBorderColor:"tokens.borderColor",secondaryButtonDisabledForegroundColor:"tokens.disabledColor",secondaryButtonDisabledBackgroundColor:["colors.palette.100","colors.palette.700"],secondaryButtonHoverBorderColor:"tokens.borderColor",secondaryButtonHoverForegroundColor:"tokens.foregroundColor",secondaryButtonHoverBackgroundColor:["colors.palette.100","colors.palette.700"],secondaryButtonFocusBorderColor:"tokens.borderColor",secondaryButtonFocusForegroundColor:"tokens.foregroundColor",secondaryButtonFocusBackgroundColor:"tokens.backgroundColor",iconButtonBorderRadius:"sizing.size_0_5",iconButtonLargeBorderRadius:"sizing.size_1",iconButtonLargePadding:"sizing.size_1",iconButtonBorderColor:["colors.palette.50","colors.palette.900"],iconButtonBackgroundColor:"tokens.backgroundSecondaryColor",iconButtonIconColor:["colors.palette.300","colors.palette.400"],iconButtonHoverBorderColor:["colors.palette.200","colors.palette.600"],iconButtonHoverBackgroundColor:["colors.palette.200","colors.palette.600"],iconButtonHoverIconColor:["colors.palette.300","colors.palette.400"],iconButtonActiveBorderColor:["colors.primary.400","colors.primary.200"],iconButtonActiveBackgroundColor:"tokens.accentColor",iconButtonActiveIconColor:"colors.white",iconButtonActiveHoverBorderColor:["colors.primary.400","colors.primary.200"],iconButtonActiveHoverBackgroundColor:["colors.primary.400","colors.primary.200"],iconButtonActiveHoverIconColor:"colors.white",collapseButtonBorderRadius:"sizing.size_1",collapseButtonOpenBorderColor:["colors.palette.200","colors.palette.500"],collapseButtonOpenBackgroundColor:["colors.white","colors.palette.950"],collapseButtonOpenIconColor:["colors.palette.400","colors.palette.300"],collapseButtonOpenIconActiveColor:["colors.palette.400","colors.palette.300"],collapseButtonOpenHoverBorderColor:["colors.palette.200","colors.palette.500"],collapseButtonOpenHoverBackgroundColor:["colors.palette.50","colors.palette.900"],collapseButtonOpenHoverIconColor:["colors.palette.400","colors.palette.300"],collapseButtonOpenHoverIconActiveColor:["colors.palette.400","colors.palette.300"],collapseButtonCloseBorderColor:["colors.palette.200","colors.palette.500"],collapseButtonCloseBackgroundColor:["colors.palette.100","colors.palette.700"],collapseButtonCloseIconColor:["colors.palette.400","colors.palette.300"],collapseButtonCloseIconActiveColor:["colors.palette.400","colors.palette.300"],collapseButtonCloseHoverBorderColor:["colors.palette.200","colors.palette.500"],collapseButtonCloseHoverBackgroundColor:["colors.palette.100","colors.palette.700"],collapseButtonCloseHoverIconColor:["colors.palette.400","colors.palette.300"],collapseButtonCloseHoverIconActiveColor:["colors.palette.400","colors.palette.300"],linkColor:["colors.primary.600","colors.primary.100"],linkHoverColor:"tokens.accentColor",inputBorderWidth:"1px",inputBorderRadius:"sizing.size_1",inputHorizontalPadding:"density.inputHorizontal",inputVerticalPadding:"density.inputVertical",inputBorderColor:"tokens.borderColor",inputForegroundColor:"tokens.foregroundColor",inputBackgroundColor:"tokens.backgroundSecondaryColor",inputHoverBorderColor:"tokens.borderColor",inputHoverForegroundColor:"tokens.foregroundColor",inputHoverBackgroundColor:"tokens.backgroundColor",inputDisabledBorderColor:"tokens.borderColor",inputDisabledForegroundColor:"tokens.disabledColor",inputDisabledBackgroundColor:["colors.palette.200","colors.palette.500"],inputFocusBorderColor:"tokens.accentColor",inputFocusForegroundColor:"tokens.foregroundColor",inputFocusBackgroundColor:"tokens.backgroundColor",checkboxSize:"tokens.iconSize",checkboxBorderRadius:"sizing.size_1",checkboxBorderColor:["colors.palette.200","colors.palette.500"],checkboxBackgroundColor:"tokens.backgroundColor",checkboxIconColor:"colors.transparent",checkboxFocusBorderColor:["colors.palette.200","colors.palette.500"],checkboxFocusBackgroundColor:"tokens.backgroundColor",checkboxFocusIconColor:"colors.transparent",checkboxFocusRingColor:"tokens.accentColor",checkboxDisabledBorderColor:["colors.palette.200","colors.palette.500"],checkboxDisabledBackgroundColor:["colors.palette.100","colors.palette.700"],checkboxDisabledIconColor:"colors.transparent",checkboxCheckedBorderColor:["colors.primary.400","colors.primary.200"],checkboxCheckedBackgroundColor:"tokens.accentColor",checkboxCheckedIconColor:"colors.white",checkboxCheckedFocusBorderColor:"tokens.backgroundColor",checkboxCheckedFocusBackgroundColor:"tokens.accentColor",checkboxCheckedFocusIconColor:"colors.white",checkboxCheckedDisabledBorderColor:["colors.palette.200","colors.palette.500"],checkboxCheckedDisabledBackgroundColor:["colors.palette.100","colors.palette.700"],checkboxCheckedDisabledIconColor:"tokens.disabledColor",checkboxIndeterminateBorderColor:["colors.primary.400","colors.primary.200"],checkboxIndeterminateBackgroundColor:"tokens.accentColor",checkboxIndeterminateIconColor:"colors.white",checkboxIndeterminateFocusBorderColor:"tokens.backgroundColor",checkboxIndeterminateFocusBackgroundColor:"tokens.accentColor",checkboxIndeterminateFocusIconColor:"colors.white",checkboxIndeterminateDisabledBorderColor:["colors.palette.200","colors.palette.600"],checkboxIndeterminateDisabledBackgroundColor:["colors.palette.200","colors.palette.500"],checkboxIndeterminateDisabledIconColor:"tokens.disabledColor",radioSize:"tokens.iconSize",radioBorderColor:["colors.palette.200","colors.palette.500"],radioBackgroundColor:"tokens.backgroundColor",radioIconColor:"colors.transparent",radioFocusBorderColor:"tokens.borderColor",radioFocusBackgroundColor:"tokens.backgroundColor",radioFocusIconColor:"colors.transparent",radioFocusRingColor:"tokens.accentColor",radioDisabledBorderColor:["colors.palette.200","colors.palette.500"],radioDisabledBackgroundColor:["colors.palette.100","colors.palette.700"],radioDisabledIconColor:"colors.transparent",radioCheckedBorderColor:"tokens.accentColor",radioCheckedBackgroundColor:"tokens.backgroundColor",radioCheckedIconColor:"tokens.accentColor",radioCheckedFocusBorderColor:["colors.primary.400","colors.primary.200"],radioCheckedFocusBackgroundColor:"tokens.backgroundColor",radioCheckedFocusIconColor:["colors.primary.400","colors.primary.200"],radioCheckedDisabledBorderColor:["colors.palette.200","colors.palette.500"],radioCheckedDisabledBackgroundColor:["colors.palette.100","colors.palette.700"],radioCheckedDisabledIconColor:"tokens.disabledColor",moveBacklightColor:["colors.palette.800","colors.palette.200"],moveBacklightOpacity:"8%",moveIndicatorColor:"tokens.accentColor",resizeIndicatorColor:["colors.palette.300","colors.palette.400"],hiddenIndicatorColor:["colors.palette.300","colors.palette.400"],menuBorderWidth:"1px",menuBorderRadius:"sizing.size_1",menuHorizontalPadding:"density.menuHorizontal",menuVerticalPadding:"density.menuVertical",menuItemHorizontalPadding:"density.menuItemHorizontal",menuItemVerticalPadding:"density.menuItemVertical",menuBorderColor:"tokens.borderColor",menuShadowX:"tokens.shadowX",menuShadowY:"tokens.shadowY",menuShadowBlur:"tokens.shadowBlur",menuShadowColor:["colors.palette.950","colors.white"],menuShadowOpacity:"8%",menuItemHoverColor:["colors.palette.800","colors.palette.200"],menuItemHoverColorOpacity:"4%",menuItemActiveColor:"tokens.accentColor",menuItemActiveColorOpacity:"8%",commentsTextareaHorizontalPadding:"density.cellHorizontal",commentsTextareaVerticalPadding:"density.cellVertical",commentsTextareaBorderWidth:"1px",commentsTextareaBorderColor:"colors.transparent",commentsTextareaForegroundColor:"tokens.foregroundColor",commentsTextareaBackgroundColor:"tokens.backgroundSecondaryColor",commentsTextareaFocusBorderWidth:"1px",commentsTextareaFocusBorderColor:"tokens.accentColor",commentsTextareaFocusForegroundColor:"tokens.foregroundColor",commentsTextareaFocusBackgroundColor:"tokens.backgroundColor",commentsIndicatorSize:"sizing.size_1_5",commentsIndicatorColor:"tokens.accentColor",licenseHorizontalPadding:"tokens.barHorizontalPadding",licenseVerticalPadding:"tokens.barVerticalPadding",licenseForegroundColor:"tokens.barForegroundColor",licenseBackgroundColor:"tokens.barBackgroundColor",paginationBarForegroundColor:"tokens.barForegroundColor",paginationBarBackgroundColor:"tokens.barBackgroundColor",paginationBarHorizontalPadding:"tokens.barHorizontalPadding",paginationBarVerticalPadding:"tokens.barVerticalPadding",dialogSemiTransparentBackgroundColor:["colors.white","colors.palette.950"],dialogSemiTransparentBackgroundOpacity:"80%",dialogSolidBackgroundColor:["colors.white","colors.palette.950"],dialogContentPaddingHorizontal:"density.dialogHorizontal",dialogContentPaddingVertical:"density.dialogVertical",dialogContentBorderRadius:"sizing.size_2",dialogContentBackgroundColor:"tokens.backgroundSecondaryColor",chipBackground:"tokens.backgroundSecondaryColor",chipBorderRadius:"sizing.size_0_5",chipVerticalPadding:"sizing.size_0",chipHorizontalPadding:"sizing.size_0_5",chipGap:"sizing.size_1",scrollbarBorderRadius:"sizing.size_2",scrollbarTrackColor:"tokens.backgroundSecondaryColor",scrollbarThumbColor:["colors.palette.300","colors.palette.400"]}},{hasItem:tSe,getItem:nSe,getNames:rSe,getValues:iSe,register:sSe}=ou("themes");function Wj(t){return tSe(t)}function Uj(t){if(!Wj(t)){Yn(`Theme "${t}" is not registered. Please ensure it is registered before using it.`);return}return nSe(t)}function oSe(){return rSe()}function aSe(){return iSe()}function lSe(t,e){let n=t,r=ea(e);return typeof t=="string"&&nn(e)?r.name=t:nn(t)&&(r=ea(t),n=r.name),{themeName:n,themeConfigObject:r}}function p$(t,e){const{themeName:n,themeConfigObject:r}=lSe(t,e),i=$Ce(r);return Wj(n)?(Yn(`Theme "${n}" is already registered. Registration skipped.`),Uj(n)):(sSe(n,i),i)}let g$=null;const v$=new Map;function sX(t,e){var n,r,i=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=this;const u=new Sc(a);let h,m,g,y,x,C,E=!0;const M={...e.initialState,...e};Abe(s)&&Pbe(this),this.rootContainer=t,this.rootWrapperElement=void 0,this.rootGridElement=void 0,this.rootPortalElement=void 0,this.rootElement=Vd(this)?t.ownerDocument.createElement("div"):t,this.rootDocument=t.ownerDocument,this.rootWindow=this.rootDocument.defaultView,Vd(this)&&(this.rootWrapperElement=this.rootDocument.createElement("div"),this.rootGridElement=this.rootDocument.createElement("div"),this.rootPortalElement=this.rootDocument.createElement("div"),st(this.rootElement,["ht-wrapper","handsontable"]),st(this.rootWrapperElement,"ht-root-wrapper"),st(this.rootGridElement,"ht-grid"),this.rootGridElement.appendChild(this.rootElement),this.rootWrapperElement.appendChild(this.rootGridElement),this.rootContainer.appendChild(this.rootWrapperElement),st(this.rootPortalElement,"ht-portal"),this.rootDocument.body.appendChild(this.rootPortalElement)),this.isDestroyed=!1,this.renderSuspendedCounter=0,this.executionSuspendedCounter=0;const j=(n=M==null?void 0:M.layoutDirection)!==null&&n!==void 0?n:"inherit",L=["rtl","ltr"].includes(j)?j:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",L),(r=this.rootWrapperElement)===null||r===void 0||r.setAttribute("dir",L),this.isRtl=function(){return L==="rtl"},this.isLtr=function(){return!a.isRtl()},this.getDirectionFactor=function(){return a.isLtr()?1:-1},this.stylesHandler=new bCe({hot:a,rootElement:a.rootElement,rootDocument:a.rootDocument,onThemeChange:k=>{Vd(this)&&(cn(this.rootWrapperElement,/ht-theme-.*/g),cn(this.rootPortalElement,/ht-theme-.*/g),k&&(st(this.rootWrapperElement,k),st(this.rootPortalElement,k),getComputedStyle(this.rootWrapperElement).getPropertyValue("--ht-line-height")||Yn(`The "${k}" theme is enabled, but its stylesheets are missing or not imported correctly. Import the correct CSS files in order to use that theme.`)))},injectCoreCss:typeof(e==null?void 0:e.injectCoreCss)=="boolean"?e.injectCoreCss:!0}),this.themeManager=null,M.language=Cye(M.language);const D=Object.fromEntries(Object.entries(M).filter(k=>{let[_]=k;return!(un.getSingleton().isRegistered(_)||un.getSingleton().isDeprecated(_))})),z=new Rq(a,D,[Mxe,Lxe]),H=z.getTableMeta(),V=z.getGlobalMeta(),F=mR();this.container=this.rootDocument.createElement("div"),this.rootElement.insertBefore(this.container,this.rootElement.firstChild),this.guid=`ht_${WY()}`,v$.set(this.guid,this),this.columnIndexMapper=new c5,this.rowIndexMapper=new c5,this.columnIndexMapper.addLocalHook("indexesSequenceChange",k=>{a.runHooks("afterColumnSequenceChange",k)}),this.rowIndexMapper.addLocalHook("indexesSequenceChange",k=>{a.runHooks("afterRowSequenceChange",k)}),u.addEventListener(this.rootDocument.documentElement,"compositionstart",k=>{a.runHooks("beforeCompositionStart",k)}),m=new sxe(a);const B=ou(this.guid);B.register("cellRangeMapper",new Fxe({rowIndexMapper:this.rowIndexMapper,columnIndexMapper:this.columnIndexMapper})),(!this.rootElement.id||this.rootElement.id.substring(0,3)==="ht_")&&(this.rootElement.id=this.guid);const te=k=>{const{row:_,col:N}=k;return a._createCellCoords(_>=0?a.rowIndexMapper.getRenderableFromVisualIndex(_):_,N>=0?a.columnIndexMapper.getRenderableFromVisualIndex(N):N)},ve=k=>{const{row:_,col:N}=k;return a._createCellCoords(_>=0?a.rowIndexMapper.getVisualFromRenderableIndex(_):_,N>=0?a.columnIndexMapper.getVisualFromRenderableIndex(N):N)},ce=(k,_)=>{const N=_>k?1:-1,O=Math.min(k,_),G=Math.max(k,_),q=a.rowIndexMapper.getNearestNotHiddenIndex(k,N);return q===null||N===1&&q>G||N===-1&&q<O?null:q>=0?a.rowIndexMapper.getRenderableFromVisualIndex(q):q},_e=(k,_)=>{const N=_>k?1:-1,O=Math.min(k,_),G=Math.max(k,_),q=a.columnIndexMapper.getNearestNotHiddenIndex(k,N);return q===null||N===1&&q>G||N===-1&&q<O?null:q>=0?a.columnIndexMapper.getRenderableFromVisualIndex(q):q};let pe=new pq(H,{rowIndexMapper:a.rowIndexMapper,columnIndexMapper:a.columnIndexMapper,countCols:()=>a.countCols(),countRows:()=>a.countRows(),propToCol:k=>h.propToCol(k),isEditorOpened:()=>a.getActiveEditor()?a.getActiveEditor().isOpened():!1,countRenderableColumns:()=>this.view.countRenderableColumns(),countRenderableRows:()=>this.view.countRenderableRows(),countRowHeaders:()=>this.countRowHeaders(),countColHeaders:()=>this.countColHeaders(),countRenderableRowsInRange:function(){return i.view.countRenderableRowsInRange(...arguments)},countRenderableColumnsInRange:function(){return i.view.countRenderableColumnsInRange(...arguments)},getShortcutManager:()=>a.getShortcutManager(),createCellCoords:(k,_)=>a._createCellCoords(k,_),createCellRange:(k,_,N)=>a._createCellRange(k,_,N),visualToRenderableCoords:te,renderableToVisualCoords:ve,findFirstNonHiddenRenderableRow:ce,findFirstNonHiddenRenderableColumn:_e,isDisabledCellSelection:(k,_)=>k<0||_<0?a.getSettings().disableVisualSelection:a.getCellMeta(k,_).disableVisualSelection});this.selection=pe;const Le=k=>{let{hiddenIndexesChanged:_}=k;this.forceFullRender=!0,_&&this.selection.commit()};this.columnIndexMapper.addLocalHook("cacheUpdated",k=>{Le(k),this.runHooks("afterColumnSequenceCacheUpdate",k)}),this.rowIndexMapper.addLocalHook("cacheUpdated",k=>{Le(k),this.runHooks("afterRowSequenceCacheUpdate",k)}),this.selection.addLocalHook("afterSetRangeEnd",(k,_)=>{const N=Cc(!1),O=this.selection.getSelectedRange(),{from:G,to:q}=O.current(),I=O.size()-1;this.runHooks("afterSelection",G.row,G.col,q.row,q.col,N,I),this.runHooks("afterSelectionByProp",G.row,a.colToProp(G.col),q.row,a.colToProp(q.col),N,I);const Z=pe.getSelectionSource();_&&!["loadData","updateData"].includes(Z)&&(!N.isTouched()||N.isTouched()&&!N.value)&&C.scrollTo(k);const re=pe.isSelectedByRowHeader(),ae=pe.isSelectedByColumnHeader();re&&ae?st(this.rootElement,["ht__selection--rows","ht__selection--columns"]):re?(cn(this.rootElement,"ht__selection--columns"),st(this.rootElement,"ht__selection--rows")):ae?(cn(this.rootElement,"ht__selection--rows"),st(this.rootElement,"ht__selection--columns")):cn(this.rootElement,["ht__selection--rows","ht__selection--columns"]),["shift","refresh","loadData","updateData"].includes(Z)||y.closeEditor(null),["refresh","loadData","updateData"].includes(Z)||(a.view.render(),y.prepareEditor())}),this.selection.addLocalHook("beforeSetFocus",k=>{this.runHooks("beforeSelectionFocusSet",k.row,k.col)}),this.selection.addLocalHook("afterSetFocus",k=>{const _=Cc(!1);this.runHooks("afterSelectionFocusSet",k.row,k.col,_),(!_.isTouched()||_.isTouched()&&!_.value)&&C.scrollTo(k),y.closeEditor(),a.view.render(),y.prepareEditor()}),this.selection.addLocalHook("afterSelectionFinished",k=>{const _=k.length-1,{from:N,to:O}=k[_];this.runHooks("afterSelectionEnd",N.row,N.col,O.row,O.col,_),this.runHooks("afterSelectionEndByProp",N.row,a.colToProp(N.col),O.row,a.colToProp(O.col),_),pe.getSelectionSource()==="refresh"&&(a.view.render(),y.prepareEditor())}),this.selection.addLocalHook("afterIsMultipleSelection",k=>{const _=this.runHooks("afterIsMultipleSelection",k.value);k.value&&(k.value=_)}),this.selection.addLocalHook("afterDeselect",()=>{y.closeEditor(),a.view.render(),cn(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this.runHooks("afterDeselect")}),this.selection.addLocalHook("beforeHighlightSet",()=>this.runHooks("beforeSelectionHighlightSet")).addLocalHook("beforeSetRangeStart",function(){for(var k=arguments.length,_=new Array(k),N=0;N<k;N++)_[N]=arguments[N];return i.runHooks("beforeSetRangeStart",..._)}).addLocalHook("beforeSetRangeStartOnly",function(){for(var k=arguments.length,_=new Array(k),N=0;N<k;N++)_[N]=arguments[N];return i.runHooks("beforeSetRangeStartOnly",..._)}).addLocalHook("beforeSetRangeEnd",function(){for(var k=arguments.length,_=new Array(k),N=0;N<k;N++)_[N]=arguments[N];return i.runHooks("beforeSetRangeEnd",..._)}).addLocalHook("beforeSelectColumns",function(){for(var k=arguments.length,_=new Array(k),N=0;N<k;N++)_[N]=arguments[N];return i.runHooks("beforeSelectColumns",..._)}).addLocalHook("afterSelectColumns",function(){for(var k=arguments.length,_=new Array(k),N=0;N<k;N++)_[N]=arguments[N];return i.runHooks("afterSelectColumns",..._)}).addLocalHook("beforeSelectRows",function(){for(var k=arguments.length,_=new Array(k),N=0;N<k;N++)_[N]=arguments[N];return i.runHooks("beforeSelectRows",..._)}).addLocalHook("afterSelectRows",function(){for(var k=arguments.length,_=new Array(k),N=0;N<k;N++)_[N]=arguments[N];return i.runHooks("afterSelectRows",..._)}).addLocalHook("beforeSelectAll",function(){for(var k=arguments.length,_=new Array(k),N=0;N<k;N++)_[N]=arguments[N];return i.runHooks("beforeSelectAll",..._)}).addLocalHook("afterSelectAll",function(){for(var k=arguments.length,_=new Array(k),N=0;N<k;N++)_[N]=arguments[N];return i.runHooks("afterSelectAll",..._)}).addLocalHook("beforeModifyTransformStart",function(){for(var k=arguments.length,_=new Array(k),N=0;N<k;N++)_[N]=arguments[N];return i.runHooks("modifyTransformStart",..._)}).addLocalHook("afterModifyTransformStart",function(){for(var k=arguments.length,_=new Array(k),N=0;N<k;N++)_[N]=arguments[N];return i.runHooks("afterModifyTransformStart",..._)}).addLocalHook("beforeModifyTransformFocus",function(){for(var k=arguments.length,_=new Array(k),N=0;N<k;N++)_[N]=arguments[N];return i.runHooks("modifyTransformFocus",..._)}).addLocalHook("afterModifyTransformFocus",function(){for(var k=arguments.length,_=new Array(k),N=0;N<k;N++)_[N]=arguments[N];return i.runHooks("afterModifyTransformFocus",..._)}).addLocalHook("beforeModifyTransformEnd",function(){for(var k=arguments.length,_=new Array(k),N=0;N<k;N++)_[N]=arguments[N];return i.runHooks("modifyTransformEnd",..._)}).addLocalHook("afterModifyTransformEnd",function(){for(var k=arguments.length,_=new Array(k),N=0;N<k;N++)_[N]=arguments[N];return i.runHooks("afterModifyTransformEnd",..._)}).addLocalHook("beforeRowWrap",function(){for(var k=arguments.length,_=new Array(k),N=0;N<k;N++)_[N]=arguments[N];return i.runHooks("beforeRowWrap",..._)}).addLocalHook("beforeColumnWrap",function(){for(var k=arguments.length,_=new Array(k),N=0;N<k;N++)_[N]=arguments[N];return i.runHooks("beforeColumnWrap",..._)}).addLocalHook("insertRowRequire",k=>this.alter("insert_row_above",k,1,"auto")).addLocalHook("insertColRequire",k=>this.alter("insert_col_start",k,1,"auto")),g={alter(k,_){let N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,O=arguments.length>3?arguments[3]:void 0,G=arguments.length>4?arguments[4]:void 0;const q=I=>{if(I.length===0)return[];const Z=[...I];return Z.sort((re,ae)=>{let[he]=re,[Me]=ae;return he===Me?0:he>Me?1:-1}),xc(Z,(re,ae)=>{let[he,Me]=ae;const tt=re[re.length-1],[ot,lt]=tt,X=ot+lt;if(he<=X){const de=Math.max(Me-(X-he),0);tt[1]+=de}else re.push([he,Me]);return re},[Z[0]])};switch(k){case"insert_row_below":case"insert_row_above":const I=a.countSourceRows();if(H.maxRows===I)return;const Z=k==="insert_row_below"?"below":"above";_=_??(Z==="below"?I:0);const{delta:U,startPhysicalIndex:re}=h.createRow(_,N,{source:O,mode:Z});pe.shiftRows(a.toVisualRow(re),U);break;case"insert_col_start":case"insert_col_end":const ae=k==="insert_col_end"?"end":"start";_=_??(ae==="end"?a.countSourceCols():0);const{delta:he,startPhysicalIndex:Me}=h.createCol(_,N,{source:O,mode:ae});if(he){if(Array.isArray(H.colHeaders)){const lt=[a.toVisualColumn(Me),0];lt.length+=he,Array.prototype.splice.apply(H.colHeaders,lt)}pe.shiftColumns(a.toVisualColumn(Me),he)}break;case"remove_row":const tt=lt=>{let X=0;Te(lt,de=>{let[Ce,Oe]=de;const Ge=Yr(Ce)?a.countRows()-1:Math.max(Ce-X,0);if(Number.isInteger(Ce)&&(Ce=Math.max(Ce-X,0)),!h.removeRow(Ce,Oe,O))return;if(pe.isSelected()){const{row:me}=a.getSelectedRangeActive().highlight;me>=Ce&&me<=Ce+Oe-1&&y.closeEditor(!0)}const se=a.countRows(),ie=H.fixedRowsTop;ie>=Ge+1&&(H.fixedRowsTop-=Math.min(Oe,ie-Ge));const J=H.fixedRowsBottom;if(J&&Ge>=se-J&&(H.fixedRowsBottom-=Math.min(Oe,J)),se===0)pe.deselect();else if(O==="ContextMenu.removeRow"){const me=pe.getSelectedRange(),Se=me.pop();me.clear().set(Se.from).current().setTo(Se.to),pe.refresh()}else pe.shiftRows(Ce,-Oe);X+=Oe})};Array.isArray(_)?tt(q(_)):tt([[_,N]]);break;case"remove_col":const ot=lt=>{let X=0;Te(lt,de=>{let[Ce,Oe]=de;const Ge=Yr(Ce)?a.countCols()-1:Math.max(Ce-X,0);let Qe=a.toPhysicalColumn(Ge);if(Number.isInteger(Ce)&&(Ce=Math.max(Ce-X,0)),!h.removeCol(Ce,Oe,O))return;if(pe.isSelected()){const{col:me}=a.getSelectedRangeActive().highlight;me>=Ce&&me<=Ce+Oe-1&&y.closeEditor(!0)}if(a.countCols()===0)pe.deselect();else if(O==="ContextMenu.removeColumn"){const me=pe.getSelectedRange(),Se=me.pop();me.clear().set(Se.from).current().setTo(Se.to),pe.refresh()}else pe.shiftColumns(Ce,-Oe);const J=H.fixedColumnsStart;J>=Ge+1&&(H.fixedColumnsStart-=Math.min(Oe,J-Ge)),Array.isArray(H.colHeaders)&&(typeof Qe>"u"&&(Qe=-1),H.colHeaders.splice(Qe,Oe)),X+=Oe})};Array.isArray(_)?ot(q(_)):ot([[_,N]]);break;default:gt(`There is no such action "${k}"`)}G||g.adjustRowsAndCols(),a.view.adjustElementsSize(),a.view.render()},adjustRowsAndCols(){const k=H.minRows,_=H.minSpareRows,N=H.minCols,O=H.minSpareCols;if(k){const G=a.countRows();G<k&&h.createRow(G,k-G,{source:"auto"})}if(_){const G=a.countEmptyRows(!0);if(G<_){const q=_-G,I=Math.min(q,H.maxRows-a.countSourceRows());h.createRow(a.countRows(),I,{source:"auto"})}}{let G;(N||O)&&(G=a.countEmptyCols(!0));let q=a.countCols();if(N&&!H.columns&&q<N){const I=N-q;G+=I,h.createCol(q,I,{source:"auto"})}if(O&&!H.columns&&a.dataType==="array"&&G<O){q=a.countCols();const I=O-G,Z=Math.min(I,H.maxCols-q);h.createCol(q,Z,{source:"auto"})}}},populateFromArray(k,_,N,O,G){let q,I,Z,U;const re=[],ae={},he=[],Me=k.row,tt=k.col;if(I=_.length,I===0)return!1;let ot=0,lt=0;switch(nn(N)&&(ot=N.col-tt+1,lt=N.row-Me+1),G){case"shift_down":const de=CT(_),Ce=de.length,Oe=Math.max(Ce,ot),Ge=a.getData().slice(Me),Qe=CT(Ge).slice(tt,tt+Oe);for(Z=0;Z<Oe;Z+=1)if(Z<Ce){for(q=0,I=de[Z].length;q<lt-I;q+=1)de[Z].push(de[Z][q%I]);Z<Qe.length?he.push(de[Z].concat(Qe[Z])):he.push(de[Z].concat(new Array(Ge.length).fill(null)))}else he.push(de[Z%Ce].concat(Qe[Z]));a.populateFromArray(Me,tt,CT(he));break;case"shift_right":const se=_.length,ie=Math.max(se,lt),J=a.getData().slice(Me).map(Rt=>Rt.slice(tt));for(q=0;q<ie;q+=1)if(q<se){for(Z=0,U=_[q].length;Z<ot-U;Z+=1)_[q].push(_[q][Z%U]);if(q<J.length)for(let Rt=0;Rt<J[q].length;Rt+=1)_[q].push(J[q][Rt]);else _[q].push(...new Array(J[0].length).fill(null))}else _.push(_[q%I].slice(0,ie).concat(J[q]));a.populateFromArray(Me,tt,_);break;case"overwrite":default:ae.row=k.row,ae.col=k.col;let me=0,Se=0,je=!0,Pe;const ut=function(sn){let jn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const An=_[sn%_.length];return jn!==null?An[jn%An.length]:An},wt=_.length,kt=N?N.row-k.row+1:0;for(N?I=kt:I=Math.max(wt,kt),q=0;q<I&&!(N&&ae.row>N.row&&kt>wt||!H.allowInsertRow&&ae.row>a.countRows()-1||ae.row>=H.maxRows);q++){const Rt=q-me,sn=ut(Rt).length,jn=N?N.col-k.col+1:0;if(N?U=jn:U=Math.max(sn,jn),ae.col=k.col,Pe=a.getCellMeta(ae.row,ae.col),(O==="CopyPaste.paste"||O==="Autofill.fill")&&Pe.skipRowOnPaste){me+=1,ae.row+=1,I+=1;continue}for(Se=0,Z=0;Z<U;Z++){var X;if(N&&ae.col>N.col&&jn>sn||!H.allowInsertColumn&&ae.col>a.countCols()-1||ae.col>=H.maxCols)break;if(Pe=a.getCellMeta(ae.row,ae.col),(O==="CopyPaste.paste"||O==="Autofill.fill")&&Pe.skipColumnOnPaste){Se+=1,ae.col+=1,U+=1;continue}if(Pe.readOnly&&O!=="UndoRedo.undo"){ae.col+=1;continue}const An=Z-Se,Jn=!!Pe.valueSetter;let Qt=ut(Rt,An),Gt=(X=a.getSourceDataAtCell(ae.row,ae.col))!==null&&X!==void 0?X:null;if(Qt!==null&&typeof Qt=="object"){if(Array.isArray(Qt)&&Gt===null&&(Gt=[]),!Jn&&(typeof Gt!="object"||Gt===null))je=!1,Pe.parsePastedValue&&O==="CopyPaste.paste"&&(je=!0);else if(Gt!==null){const ir=cR(Array.isArray(Gt)?Gt:Gt[0]||Gt),kn=cR(Array.isArray(Qt)?Qt:Qt[0]||Qt);Jn||N0(ir,kn)||Array.isArray(ir)&&Array.isArray(kn)?Qt=ea(Qt):je=!1}}else!Jn&&Gt!==null&&typeof Gt=="object"&&(je=!1);je&&re.push([ae.row,ae.col,Qt]),je=!0,ae.col+=1}ae.row+=1}a.setDataAtCell(re,null,null,O||"populateFromArray");break}}};function Fe(k){const _=KK(k);V4(_)?(a.runHooks("beforeLanguageChange",_),V.language=_,a.runHooks("afterLanguageChange",_)):qK(k)}function nt(k,_){const N=k==="className"?a.rootElement:a.table;if(E)st(N,_);else{let O=[],G=[];V[k]&&(O=Array.isArray(V[k])?V[k]:$Y(V[k])),_&&(G=Array.isArray(_)?_:$Y(_));const q=LY(O,G),I=LY(G,O);q.length&&cn(N,q),I.length&&st(N,I)}V[k]=_}this.init=function(){m.setData(H.data),a.runHooks("beforeInit"),(Vh()||rL())&&st(a.rootElement,"mobile"),this.updateSettings(M,!0),this.view=new Hbe(this),y=xL.getInstance(a,H,pe),C=Kxe(a),x.init(),Vd(this)&&(SCe(a.rootPortalElement),Gme(M.licenseKey,this.rootWrapperElement,"09/03/2026")),a.runHooks("init"),this.render(),E&&a.rootElement.offsetParent===null&&Upe(a.rootElement,()=>{a.view._wt.wtOverlays.updateLastSpreaderSize(),a.view.adjustElementsSize(),a.render()}),typeof E=="object"&&(a.runHooks("afterChange",E[0],E[1]),E=!1),a.runHooks("afterInit")};function dt(k){let _;typeof k>"u"?(Wj("main")?_=Uj("main"):_=p$(eSe),_=Uj("main")):typeof k.getThemeConfig!="function"?_=p$(k):_=k,a.themeManager=JCe({hot:a,themeObject:_})}function $e(){let k=!1;return{validatorsInQueue:0,valid:!0,addValidatorToQueue(){this.validatorsInQueue+=1,k=!1},removeValidatorFormQueue(){this.validatorsInQueue=this.validatorsInQueue-1<0?0:this.validatorsInQueue-1,this.checkIfQueueIsEmpty()},onQueueEmpty(){},checkIfQueueIsEmpty(){this.validatorsInQueue===0&&k===!1&&(k=!0,this.onQueueEmpty(this.valid))}}}function Re(k,_,N){if(!k.length){N();return}const O=a.getActiveEditor(),G=new $e;let q=!0;G.onQueueEmpty=()=>{O&&q&&O._closeAfterDataChange&&O.cancelChanges(),N()};for(let I=k.length-1;I>=0;I--){const[Z,U,,re]=k[I],ae=h.propToCol(U);let he;Number.isInteger(ae)?he=a.getCellMeta(Z,ae):he={...Object.getPrototypeOf(H),...H},a.getCellValidator(he)&&(G.addValidatorToQueue(),a.validateCell(re,he,function(Me,tt){return function(ot){typeof ot!="boolean"&>("Validation error: result is not boolean"),ot===!1&&tt.allowInvalid===!1&&(q=!1,k.splice(Me,1),tt.valid=!0),G.removeValidatorFormQueue()}}(I,he),_))}G.checkIfQueueIsEmpty()}function Ze(k,_){for(let q=k.length-1;q>=0;q--){let I=!1;if(k[q]===null){k.splice(q,1);continue}if(!((k[q][2]===null||k[q][2]===void 0)&&(k[q][3]===null||k[q][3]===void 0))){if(H.allowInsertRow)for(;k[q][0]>a.countRows()-1;){const{delta:Z}=h.createRow(void 0,void 0,{source:"auto"});if(Z===0){I=!0;break}}if(a.dataType==="array"&&(!H.columns||H.columns.length===0)&&H.allowInsertColumn)for(;h.propToCol(k[q][1])>a.countCols()-1;){const{delta:Z}=h.createCol(void 0,void 0,{source:"auto"});if(Z===0){I=!0;break}}I||h.set(k[q][0],k[q][1],k[q][3])}}const N=k.length>0,O=y.getActiveEditor(),G=O==null?void 0:O._closeAfterDataChange;N?(g.adjustRowsAndCols(),a.runHooks("beforeChangeRender",k,_),O!=null&&O.isOpened()&&G&&y.closeEditor(),a.view.adjustElementsSize(),a.render(),(O!=null&&O.isOpened()&&G||!(O!=null&&O.isOpened()))&&y.prepareEditor(),a.runHooks("afterChange",k,_||"edit"),O&&Lt(O.refreshValue)&&O.refreshValue()):a.render()}this._createCellCoords=function(k,_){return a.view._wt.createCellCoords(k,_)},this._createCellRange=function(k,_,N){return a.view._wt.createCellRange(k,_,N)},this.validateCell=function(k,_,N,O){let G=a.getCellValidator(_);function q(I){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)||_.hidden===!0){N(I);return}const U=_.visualCol,re=_.visualRow,ae=a.getCell(re,U,!0);if(ae&&ae.nodeName!=="TH"){const he=a.rowIndexMapper.getRenderableFromVisualIndex(re),Me=a.columnIndexMapper.getRenderableFromVisualIndex(U);a.view._wt.getSetting("cellRenderer",he,Me,ae)}N(I)}Wme(G)&&(G=function(I){return function(Z,U){U(I.test(Z))}}(G)),ri(G)?(k=a.runHooks("beforeValidate",k,_.visualRow,_.prop,O),a._registerMicrotask(()=>{G.call(_,k,I=>{a&&(I=a.runHooks("afterValidate",I,k,_.visualRow,_.prop,O),_.valid=I,q(I),a.runHooks("postAfterValidate",I,k,_.visualRow,_.prop,O))})})):a._registerMicrotask(()=>{_.valid=!0,q(_.valid,!1)})};function Ee(k,_,N){return Array.isArray(k)?k:[[k,_,N]]}function Q(k,_){const N=a.runHooks("beforeChange",k,_||"edit"),O=k.filter(q=>q!==null);if(N===!1||O.length===0){var G;return(G=a.getActiveEditor())===null||G===void 0||G.cancelChanges(),[]}for(let q=O.length-1;q>=0;q--){const[I,Z,,U]=O[q],re=h.propToCol(Z);let ae;Number.isInteger(re)?ae=a.getCellMeta(I,re):ae={...Object.getPrototypeOf(H),...H},O[q][3]=X4(U,ae)}return O}this.setDataAtCell=function(k,_,N,O){const G=Ee(k,_,N),q=[];let I=O,Z,U,re;for(Z=0,U=G.length;Z<U;Z++){const[he,Me,tt]=G[Z];typeof G[Z]!="object"&>("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter"),typeof G[Z][1]!="number"&>("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`"),Me>=this.countCols()?re=Me:re=h.colToProp(Me),q.push([he,re,m.getAtCell(this.toPhysicalRow(he),Me),tt])}!I&&typeof k=="object"&&(I=_);const ae=Q(q,I);a.runHooks("afterSetDataAtCell",ae,I),Re(ae,I,()=>{Ze(ae,I)})},this.setDataAtRowProp=function(k,_,N,O){const G=Ee(k,_,N),q=[];let I=O,Z,U;for(Z=0,U=G.length;Z<U;Z++){const[ae,he,Me]=G[Z];q.push([ae,he,m.getAtCell(this.toPhysicalRow(ae),he),Me])}!I&&typeof k=="object"&&(I=_);const re=Q(q,O);a.runHooks("afterSetDataAtRowProp",re,I),Re(re,I,()=>{Ze(re,I)})},this.listen=function(){a&&!a.isListening()&&(v$.forEach(k=>{a!==k&&k.unlisten()}),g$=a.guid,a.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(g$=null,a.runHooks("afterUnlisten"))},this.isListening=function(){return g$===a.guid},this.destroyEditor=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,_=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;y.closeEditor(k),a.view.render(),_&&pe.isSelected()&&y.prepareEditor()},this.populateFromArray=function(k,_,N,O,G,q,I){typeof N=="object"&&typeof N[0]=="object"||gt("populateFromArray parameter `input` must be an array of arrays");const Z=typeof O=="number"?a._createCellCoords(O,G):null;return g.populateFromArray(a._createCellCoords(k,_),N,Z,q,I)},this.spliceCol=function(k,_,N){for(var O=arguments.length,G=new Array(O>3?O-3:0),q=3;q<O;q++)G[q-3]=arguments[q];return h.spliceCol(k,_,N,...G)},this.spliceRow=function(k,_,N){for(var O=arguments.length,G=new Array(O>3?O-3:0),q=3;q<O;q++)G[q-3]=arguments[q];return h.spliceRow(k,_,N,...G)},this.getSelected=function(){if(pe.isSelected())return di(pe.getSelectedRange(),k=>{let{from:_,to:N}=k;return[_.row,_.col,N.row,N.col]})},this.getSelectedLast=function(){const k=this.getSelected();let _;return k&&k.length>0&&(_=k[k.length-1]),_},this.getSelectedActive=function(){const k=this.getSelectedRangeActive();if(!k)return;const{from:_,to:N}=k;return[_.row,_.col,N.row,N.col]},this.getSelectedRange=function(){if(pe.isSelected())return Array.from(pe.getSelectedRange())},this.getSelectedRangeLast=function(){const k=this.getSelectedRange();let _;return k&&k.length>0&&(_=k[k.length-1]),_},this.getSelectedRangeActive=function(){return pe.getActiveSelectedRange()},this.getActiveSelectionLayerIndex=function(){return pe.getActiveSelectionLayerIndex()},this.emptySelectedCells=function(k){if(!pe.isSelected()||this.countRows()===0||this.countCols()===0)return;const _=[];Te(pe.getSelectedRange(),N=>{if(N.isSingleHeader())return;const O=N.getTopStartCorner(),G=N.getBottomEndCorner();En(O.row,G.row,q=>{En(O.col,G.col,I=>{this.getCellMeta(q,I).readOnly||_.push([q,I,null])})})}),_.length>0&&this.setDataAtCell(_,k)},this.isRenderSuspended=function(){return this.renderSuspendedCounter>0},this.suspendRender=function(){this.renderSuspendedCounter+=1},this.resumeRender=function(){const k=this.renderSuspendedCounter-1;this.renderSuspendedCounter=Math.max(k,0),!this.isRenderSuspended()&&k===this.renderSuspendedCounter&&a.view.render()},this.render=function(){this.view&&(this.forceFullRender=!0,this.isRenderSuspended()||a.view.render())},this.batchRender=function(k){this.suspendRender();const _=k();return this.resumeRender(),_},this.isExecutionSuspended=function(){return this.executionSuspendedCounter>0},this.suspendExecution=function(){this.executionSuspendedCounter+=1,this.columnIndexMapper.suspendOperations(),this.rowIndexMapper.suspendOperations()},this.resumeExecution=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const _=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(_,0),(!this.isExecutionSuspended()&&_===this.executionSuspendedCounter||k)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(k){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.suspendExecution();const N=k();return this.resumeExecution(_),N},this.batch=function(k){this.suspendRender(),this.suspendExecution();const _=k();return this.resumeExecution(),this.resumeRender(),_},this.refreshDimensions=function(){if(!a.view)return;const k=a.view,{width:_,height:N}=k.getLastSize(),{width:O,height:G}=a.rootElement.getBoundingClientRect(),q=O!==_||G!==N;a.runHooks("beforeRefreshDimensions",{width:_,height:N},{width:O,height:G},q)!==!1&&((q||k._wt.wtOverlays.scrollableElement===a.rootWindow)&&(k.setLastSize(O,G),k.adjustElementsSize(),a.render()),a.runHooks("afterRefreshDimensions",{width:_,height:N},{width:O,height:G},q))},this.updateData=function(k,_){Nq(k,N=>{h=N},N=>{h=N,a.columnIndexMapper.fitToLength(this.getInitialColumnCount()),a.rowIndexMapper.fitToLength(this.countSourceRows()),g.adjustRowsAndCols(),pe.markSource("updateData"),pe.refresh(),pe.markEndSource()},{hotInstance:a,dataMap:h,dataSource:m,internalSource:"updateData",source:_,metaManager:z,firstRun:E})},this.loadData=function(k,_){Nq(k,N=>{h=N},()=>{z.clearCellsCache(),a.initIndexMappers(),g.adjustRowsAndCols(),pe.markSource("loadData"),pe.refresh(),pe.markEndSource(),E&&(E=[null,"loadData"])},{hotInstance:a,dataMap:h,dataSource:m,internalSource:"loadData",source:_,metaManager:z,firstRun:E})},this.getInitialColumnCount=function(){const k=H.columns;let _=0;if(Array.isArray(k))_=k.length;else if(ri(k))if(a.dataType==="array"){const N=this.countSourceCols();for(let O=0;O<N;O+=1)k(O)&&(_+=1)}else(a.dataType==="object"||a.dataType==="function")&&(_=h.colToPropCache.length);else if(Lt(H.dataSchema)){const N=h.getSchema();_=Array.isArray(N)?N.length:tL(N)}else _=this.countSourceCols();return _},this.initIndexMappers=function(){this.columnIndexMapper.initToLength(this.getInitialColumnCount()),this.rowIndexMapper.initToLength(this.countSourceRows())},this.getData=function(k,_,N,O){return ls(k)?h.getAll():h.getRange(a._createCellCoords(k,_),a._createCellCoords(N,O),h.DESTINATION_RENDERER)},this.getCopyableText=function(k,_,N,O){return h.getCopyableText(a._createCellCoords(k,_),a._createCellCoords(N,O))},this.getCopyableData=function(k,_){return h.getCopyable(k,h.colToProp(_))},this.getCopyableSourceData=function(k,_){return m.getCopyable(k,h.colToProp(_))},this.getSchema=function(){return h.getSchema()},this.updateSettings=function(k){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const N=(E?a.loadData:a.updateData).bind(this);let O=!1,G,q;Lt(k.rows)&>('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?'),Lt(k.cols)&>('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?'),Lt(k.ganttChart)&>('Since 8.0.0 the "ganttChart" setting is no longer supported.'),Lt(k.rowHeights)&&Lt(k.minRowHeights)&&Yn("Both `rowHeights` and `minRowHeights` are defined in your configuration. As one is the alias of the other, only one of them can be used at a time. `rowHeights` will be used as the row height configuration.");for(G in k)if(!(G==="data"||G==="language"))if(G==="className")nt("className",k.className);else if(G==="tableClassName"&&a.table)nt("tableClassName",k.tableClassName),a.view._wt.wtOverlays.syncOverlayTableClassNames();else if(un.getSingleton().isRegistered(G)||un.getSingleton().isDeprecated(G)){const lt=k[G];ri(lt)?(un.getSingleton().addAsFixed(G,lt,a),H[G]=lt):Array.isArray(lt)&&(un.getSingleton().add(G,lt,a),H[G]=lt)}else!_&&Ps(k,G)&&(V[G]=k[G]);const I=o$(a.rootContainer),Z=Ps(k,"themeName"),U=Ps(k,"theme");if(Z&&U&&Yn("Both `theme` and `themeName` are defined in your configuration. These options are aliases and cannot be used together. The `themeName` option will be ignored."),_){let lt;U&&typeof k.theme=="string"?lt=k.theme:Z&&typeof k.themeName=="string"&&k.themeName&&!U?(lt=k.themeName,H.theme=k.themeName,H.themeName=void 0):I?lt=I:a.themeManager&&(lt=a.themeManager.getClassName()),a.useTheme(lt)}else{const lt=a.getCurrentThemeName();if(U&&typeof k.theme=="string"&<!==k.theme){var re;a.useTheme(k.theme),(re=a.themeManager)===null||re===void 0||re.unmount()}else if(Z&&!U&<!==k.themeName){var ae;H.theme=k.themeName,H.themeName=void 0,a.useTheme(k.themeName),(ae=a.themeManager)===null||ae===void 0||ae.unmount()}else Vd(a)&&!I&&nn(k.theme)&&(a.themeManager===null?(dt(k.theme),a.useTheme(a.themeManager.getClassName())):(a.themeManager.update(k.theme),a.useTheme(a.themeManager.getClassName())))}k.data===void 0&&H.data===void 0?N(null,"updateSettings"):k.data!==void 0?N(k.data,"updateSettings"):k.columns!==void 0&&(h.createMap(),a.initIndexMappers()),!E&&k.language&&Fe(k.language);const he=a.countCols(),Me=H.columns;if(Me&&ri(Me)&&(O=!0),(k.cell!==void 0||k.cells!==void 0||k.columns!==void 0)&&z.clearCache(),he>0)for(G=0,q=0;G<he;G++){if(Me){const lt=O?Me(G):Me[q];lt&&z.updateColumnMeta(q,lt)}q+=1}Lt(k.cell)&&Mr(k.cell,lt=>{a.setCellMetaObject(lt.row,lt.col,lt)}),a.runHooks("afterCellMetaReset"),E&&_q(a,"init");let tt=a.rootElement.style.height;tt!==""&&(tt=parseInt(a.rootElement.style.height,10)),_&&a.rootElement.getAttribute("style")&&a.rootElement.setAttribute("data-initialstyle",a.rootElement.getAttribute("style"));let ot=k.height;if(typeof k.height<"u")if(ri(ot)&&(ot=ot()),ot=a.runHooks("beforeHeightChange",ot),ot===null){const lt=a.rootElement.getAttribute("data-initialstyle");lt&&(lt.indexOf("height")>-1||lt.indexOf("overflow")>-1)?a.rootElement.setAttribute("style",lt):(a.rootElement.style.height="",a.rootElement.style.overflow="")}else ot!==void 0&&(a.rootElement.style.height=isNaN(ot)?`${ot}`:`${ot}px`,a.rootElement.style.overflow="clip");if(typeof k.width<"u"){let lt=k.width;ri(lt)&&(lt=lt()),lt=a.runHooks("beforeWidthChange",lt),a.rootElement.style.width=isNaN(lt)?`${lt}`:`${lt}px`}_||(a.view&&(a.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),a.view._wt.exportSettingsAsClassNames()),a.runHooks("afterUpdateSettings",k)),g.adjustRowsAndCols(),a.view&&!E&&(a.render(),a.view._wt.wtOverlays.adjustElementsSize()),!_&&a.view&&(tt===""||ot===""||ot===void 0)&&tt!==ot&&a.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const k=a.getSelectedRangeActive();if(H.getValue){if(ri(H.getValue))return H.getValue.call(a);if(k)return a.getData()[k.highlight.row][H.getValue]}else if(k)return a.getDataAtCell(k.highlight.row,k.highlight.col);return null},this.getSettings=function(){return H},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(k,_,N,O,G){g.alter(k,_,N,O,G)},this.getCell=function(k,_){let N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,O=_,G=k;if(_>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(_)))return null;O=this.columnIndexMapper.getRenderableFromVisualIndex(_)}if(k>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(k)))return null;G=this.rowIndexMapper.getRenderableFromVisualIndex(k)}return G===null||O===null||G===void 0||O===void 0?null:a.view.getCellAtCoords(a._createCellCoords(G,O),N)},this.getCoords=function(k){const _=this.view._wt.wtTable.getCoords(k);if(_===null)return null;const{row:N,col:O}=_;let G=N,q=O;return N>=0&&(G=this.rowIndexMapper.getVisualFromRenderableIndex(N)),O>=0&&(q=this.columnIndexMapper.getVisualFromRenderableIndex(O)),a._createCellCoords(G,q)},this.colToProp=function(k){return h.colToProp(k)},this.propToCol=function(k){return h.propToCol(k)},this.toVisualRow=k=>this.rowIndexMapper.getVisualFromPhysicalIndex(k),this.toVisualColumn=k=>this.columnIndexMapper.getVisualFromPhysicalIndex(k),this.toPhysicalRow=k=>this.rowIndexMapper.getPhysicalFromVisualIndex(k),this.toPhysicalColumn=k=>this.columnIndexMapper.getPhysicalFromVisualIndex(k),this.getDataAtCell=function(k,_){return h.get(k,h.colToProp(_))},this.getDataAtRowProp=function(k,_){return h.get(k,_)},this.getDataAtCol=function(k){const _=[],N=h.getRange(a._createCellCoords(0,k),a._createCellCoords(H.data.length-1,k),h.DESTINATION_RENDERER);for(let O=0;O<N.length;O+=1)for(let G=0;G<N[O].length;G+=1)_.push(N[O][G]);return _},this.getDataAtProp=function(k){const _=[],N=h.getRange(a._createCellCoords(0,h.propToCol(k)),a._createCellCoords(H.data.length-1,h.propToCol(k)),h.DESTINATION_RENDERER);for(let O=0;O<N.length;O+=1)for(let G=0;G<N[O].length;G+=1)_.push(N[O][G]);return _},this.getSourceData=function(k,_,N,O){let G;return k===void 0?G=m.getData():G=m.getByRange(a._createCellCoords(k,_),a._createCellCoords(N,O)),G},this.getSourceDataArray=function(k,_,N,O){let G;return k===void 0?G=m.getData(!0):G=m.getByRange(a._createCellCoords(k,_),a._createCellCoords(N,O),!0),G},this.getSourceDataAtCol=function(k){return m.getAtColumn(k)},this.setSourceDataAtCell=function(k,_,N,O){const G=Ee(k,_,N),q=this.hasHook("afterSetSourceDataAtCell"),I=[],Z=(re,ae)=>{const he=this.toVisualRow(re),Me=this.toVisualColumn(ae);return Number.isInteger(Me)?this.getCellMeta(he,Me):{...Object.getPrototypeOf(H),...H}};q&&Te(G,re=>{let[ae,he,Me]=re;const tt=X4(Me,Z(ae,he));I.push([ae,he,m.getAtCell(ae,he),tt])}),Te(G,re=>{let[ae,he,Me]=re;const tt=Z(ae,he),ot=X4(Me,tt);kxe(ot,tt,O??"setSourceDataAtCell")&&m.setAtCell(ae,he,ot)}),q&&this.runHooks("afterSetSourceDataAtCell",I,O),this.render();const U=a.getActiveEditor();U&&Lt(U.refreshValue)&&U.refreshValue()},this.getSourceDataAtRow=function(k){return m.getAtRow(k)},this.getSourceDataAtCell=function(k,_){return m.getAtCell(k,_)},this.getDataAtRow=function(k){return h.getRange(a._createCellCoords(k,0),a._createCellCoords(k,this.countCols()-1),h.DESTINATION_RENDERER)[0]||[]},this.getDataType=function(k,_,N,O){const G=k===void 0?[0,0,this.countRows(),this.countCols()]:[k,_,N,O],[q,I]=G;let[,,Z,U]=G,re=null,ae=null;Z===void 0&&(Z=q),U===void 0&&(U=I);let he="mixed";return En(Math.max(Math.min(q,Z),0),Math.max(q,Z),Me=>{let tt=!0;return En(Math.max(Math.min(I,U),0),Math.max(I,U),ot=>(ae=this.getCellMeta(Me,ot).type,re?tt=re===ae:re=ae,tt)),he=tt?ae:"mixed",tt}),he},this.removeCellMeta=function(k,_,N){const[O,G]=[this.toPhysicalRow(k),this.toPhysicalColumn(_)];let q=z.getCellMetaKeyValue(O,G,N);a.runHooks("beforeRemoveCellMeta",k,_,N,q)!==!1&&(z.removeCellMeta(O,G,N),a.runHooks("afterRemoveCellMeta",k,_,N,q)),q=null},this.spliceCellsMeta=function(k){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;for(var N=arguments.length,O=new Array(N>2?N-2:0),G=2;G<N;G++)O[G-2]=arguments[G];O.length>0&&!Array.isArray(O[0])&>("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array."),_>0&&z.removeRow(this.toPhysicalRow(k),_),O.length>0&&Te(O.reverse(),q=>{z.createRow(this.toPhysicalRow(k)),Te(q,(I,Z)=>this.setCellMetaObject(k,Z,I))}),a.render()},this.setCellMetaObject=function(k,_,N){typeof N=="object"&&Mr(N,(O,G)=>{this.setCellMeta(k,_,G,O)})},this.setCellMeta=function(k,_,N,O){if(a.runHooks("beforeSetCellMeta",k,_,N,O)===!1)return;let q=k,I=_;k<this.countRows()&&(q=this.toPhysicalRow(k)),_<this.countCols()&&(I=this.toPhysicalColumn(_)),z.setCellMeta(q,I,N,O),a.runHooks("afterSetCellMeta",k,_,N,O)},this.getCellsMeta=function(){return z.getCellsMeta()},this.getCellMeta=function(k,_){let N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{skipMetaExtension:!1},O=this.toPhysicalRow(k),G=this.toPhysicalColumn(_);return O===null&&(O=k),G===null&&(G=_),z.getCellMeta(O,G,{visualRow:k,visualColumn:_,...N})},this.getColumnMeta=function(k){return z.getColumnMeta(this.toPhysicalColumn(k))},this.getCellMetaAtRow=function(k){return z.getCellsMetaAtRow(k)},this.isColumnModificationAllowed=function(){return!(a.dataType==="object"||H.columns)},this.getCellRenderer=function(k,_){const N=typeof k=="number"?a.getCellMeta(k,_).renderer:k.renderer;return typeof N=="string"?_L(N):ls(N)?_L("text"):N},this.getCellEditor=function(k,_){const N=typeof k=="number"?a.getCellMeta(k,_).editor:k.editor;return typeof N=="string"?bL(N):ls(N)?bL("text"):N},this.getCellValidator=function(k,_){const N=typeof k=="number"?a.getCellMeta(k,_).validator:k.validator;return typeof N=="string"?Dge(N):N},this.validateCells=function(k){this._validateCells(k)},this.validateRows=function(k,_){Array.isArray(k)||gt("validateRows parameter `rows` must be an array"),this._validateCells(_,k)},this.validateColumns=function(k,_){Array.isArray(k)||gt("validateColumns parameter `columns` must be an array"),this._validateCells(_,void 0,k)},this._validateCells=function(k,_,N){const O=new $e;k&&(O.onQueueEmpty=k);let G=a.countRows()-1;for(;G>=0;){if(_!==void 0&&_.indexOf(G)===-1){G-=1;continue}let q=a.countCols()-1;for(;q>=0;){if(N!==void 0&&N.indexOf(q)===-1){q-=1;continue}O.addValidatorToQueue(),a.validateCell(a.getDataAtCell(G,q),a.getCellMeta(G,q),I=>{typeof I!="boolean"&>("Validation error: result is not boolean"),I===!1&&(O.valid=!1),O.removeValidatorFormQueue()},"validateCells"),q-=1}G-=1}O.checkIfQueueIsEmpty()},this.getRowHeader=function(k){let _=H.rowHeaders,N=k;return N!==void 0&&(N=a.runHooks("modifyRowHeader",N)),N===void 0?(_=[],En(a.countRows()-1,O=>{_.push(a.getRowHeader(O))})):Array.isArray(_)&&_[N]!==void 0?_=_[N]:ri(_)?_=_(N):_&&typeof _!="string"&&typeof _!="number"&&(_=N+1),_},this.hasRowHeaders=function(){return!!H.rowHeaders},this.hasColHeaders=function(){if(H.colHeaders!==void 0&&H.colHeaders!==null)return!!H.colHeaders;for(let k=0,_=a.countCols();k<_;k++)if(a.getColHeader(k))return!0;return!1},this.getColHeader=function(k){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;const N=a.runHooks("modifyColHeader",k);if(N===void 0){const Z=[],U=a.countCols();for(let re=0;re<U;re++)Z.push(a.getColHeader(re));return Z}let O=H.colHeaders;const G=function(Z){const U=[],re=a.countCols();let ae=0;for(;ae<re;ae++)ri(H.columns)&&H.columns(ae)&&U.push(ae);return U[Z]},q=a.toPhysicalColumn(N),I=G(q);return H.colHeaders===!1?O=null:H.columns&&ri(H.columns)&&H.columns(I)&&H.columns(I).title?O=H.columns(I).title:H.columns&&H.columns[q]&&H.columns[q].title?O=H.columns[q].title:Array.isArray(H.colHeaders)&&H.colHeaders[q]!==void 0?O=H.colHeaders[q]:ri(H.colHeaders)?O=H.colHeaders(q):H.colHeaders&&typeof H.colHeaders!="string"&&typeof H.colHeaders!="number"&&(O=Fbe(N)),O=a.runHooks("modifyColumnHeaderValue",O,k,_),O},this._getColWidthFromSettings=function(k){let _;if(k>=0&&(_=a.getCellMeta(0,k).width),(_===void 0||_===H.width)&&(_=H.colWidths),_!=null){switch(typeof _){case"object":_=_[k];break;case"function":_=_(k);break}typeof _=="string"&&(_=Number.parseInt(_,10))}return _},this.getColWidth=function(k,_){let N=a._getColWidthFromSettings(k);return N=a.runHooks("modifyColWidth",N,k,_),N===void 0&&(N=Kx),N},this._getRowHeightFromSettings=function(k){var _;const N=a.stylesHandler.getDefaultRowHeight(k);let O=(_=H.rowHeights)!==null&&_!==void 0?_:H.minRowHeights;if(O!=null){switch(typeof O){case"object":O=O[k];break;case"function":O=O(k);break}typeof O=="string"&&(O=Number.parseInt(O,10))}return O!=null&&O<N?N:O},this.getRowHeight=function(k,_){let N=a._getRowHeightFromSettings(k);return N=a.runHooks("modifyRowHeight",N,k,_),N},this.countSourceRows=function(){return m.countRows()},this.countSourceCols=function(){return m.countFirstRowKeys()},this.countRows=function(){return h.getLength()},this.countCols=function(){const k=H.maxCols,_=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(k,_)},this.countRenderedRows=function(){return a.view._wt.drawn?a.view._wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return a.view._wt.drawn?a.view._wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return a.view._wt.drawn?a.view._wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return a.view._wt.drawn?a.view._wt.wtTable.getVisibleColumnsCount():-1},this.countRowHeaders=function(){return this.view.getRowHeadersCount()},this.countColHeaders=function(){return this.view.getColumnHeadersCount()},this.countEmptyRows=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,_=0;return HG(a.countRows()-1,N=>{if(a.isEmptyRow(N))_+=1;else if(k===!0)return!1}),_},this.countEmptyCols=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,_=0;return HG(a.countCols()-1,N=>{if(a.isEmptyCol(N))_+=1;else if(k===!0)return!1}),_},this.isEmptyRow=function(k){return H.isEmptyRow.call(a,k)},this.isEmptyCol=function(k){return H.isEmptyCol.call(a,k)},this.selectCell=function(k,_,N,O){let G=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,q=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;return ls(k)||ls(_)?!1:this.selectCells([[k,_,N,O]],G,q)},this.selectCells=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[[]],_=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;_===!1&&C.suspend();const O=pe.selectCells(k);return O&&N&&a.listen(),C.resume(),O},this.selectColumns=function(k){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:k,N=arguments.length>2?arguments[2]:void 0;return pe.selectColumns(k,_,N)},this.selectRows=function(k){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:k,N=arguments.length>2?arguments[2]:void 0;return pe.selectRows(k,_,N)},this.deselectCell=function(){pe.deselect()},this.selectAll=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,_=arguments.length>1&&arguments[1]!==void 0?arguments[1]:k,N=arguments.length>2?arguments[2]:void 0;C.skipNextScrollCycle(),pe.selectAll(k,_,N)};const fe=(k,_)=>k.getNearestNotHiddenIndex(_,1,!0);this.scrollViewportTo=function(k,_){if(typeof k=="number"){var N;k={row:arguments[0],col:arguments[1],verticalSnap:arguments[2]?"bottom":"top",horizontalSnap:arguments[3]?"end":"start",considerHiddenIndexes:(N=arguments[4])!==null&&N!==void 0?N:!0}}const{row:O,col:G,considerHiddenIndexes:q}=k??{};let I=O,Z=G;if(ri(_)&&this.addHookOnce("afterScroll",_),q===void 0||q){const he=Number.isInteger(O)&&O>=0,Me=Number.isInteger(G)&&G>=0,tt=he?fe(this.rowIndexMapper,O):void 0,ot=Me?fe(this.columnIndexMapper,G):void 0;if(tt===null||ot===null)return!1;I=he?a.rowIndexMapper.getRenderableFromVisualIndex(tt):O,Z=Me?a.columnIndexMapper.getRenderableFromVisualIndex(ot):G}const U=Number.isInteger(I),re=Number.isInteger(Z);let ae=!1;return U&&I>=0&&re&&Z>=0?ae=a.view.scrollViewport(a._createCellCoords(I,Z),k.horizontalSnap,k.verticalSnap):U&&I>=0&&(re&&Z<0||!re)?ae=a.view.scrollViewportVertically(I,k.verticalSnap):re&&Z>=0&&(U&&I<0||!U)&&(ae=a.view.scrollViewportHorizontally(Z,k.horizontalSnap)),ri(_)&&(ae?this.view.render():(this.removeHook("afterScroll",_),this._registerMicrotask(()=>_()))),ae},this.scrollToFocusedCell=function(k){if(!this.selection.isSelected())return!1;ri(k)&&this.addHookOnce("afterScroll",k);const{highlight:_}=this.getSelectedRangeActive(),N=this.scrollViewportTo(_.toObject());return N?this.view.render():ri(k)&&(this.removeHook("afterScroll",k),this._registerMicrotask(()=>k())),N},this.destroy=function(){if(a._clearTimeouts(),a._clearMicrotasks(),a.view&&a.view.destroy(),m&&m.destroy(),m=null,Vd(this)){var k;RCe(),this.getFocusScopeManager().destroy(),(k=a.themeManager)===null||k===void 0||k.destroy()}this.getShortcutManager().destroy(),B.clear(),z.clearCache(),v$.delete(this.guid),u.destroy(),y&&y.destroy(),a.rootContainer&&Bh(a.rootContainer),a.rootPortalElement&&a.rootPortalElement.remove(),a.batchExecution(()=>{a.rowIndexMapper.unregisterAll(),a.columnIndexMapper.unregisterAll(),F.getItems().forEach(_=>{let[,N]=_;N.destroy()}),F.clear(),a.runHooks("afterDestroy")},!0),un.getSingleton().destroy(a),Mr(a,(_,N,O)=>{ri(_)?O[N]=Ve(N):N!=="guid"&&(O[N]=null)}),a.isDestroyed=!0,h&&h.destroy(),h=null,g=null,pe=null,y=null,a=null};function Ve(k){return()=>{gt(`The "${k}" method cannot be called because this Handsontable instance has been destroyed`)}}this.getActiveEditor=function(){return y.getActiveEditor()},this.getFirstRenderedVisibleRow=function(){return a.view.getFirstRenderedVisibleRow()},this.getLastRenderedVisibleRow=function(){return a.view.getLastRenderedVisibleRow()},this.getFirstRenderedVisibleColumn=function(){return a.view.getFirstRenderedVisibleColumn()},this.getLastRenderedVisibleColumn=function(){return a.view.getLastRenderedVisibleColumn()},this.getFirstFullyVisibleRow=function(){return a.view.getFirstFullyVisibleRow()},this.getLastFullyVisibleRow=function(){return a.view.getLastFullyVisibleRow()},this.getFirstFullyVisibleColumn=function(){return a.view.getFirstFullyVisibleColumn()},this.getLastFullyVisibleColumn=function(){return a.view.getLastFullyVisibleColumn()},this.getFirstPartiallyVisibleRow=function(){return a.view.getFirstPartiallyVisibleRow()},this.getLastPartiallyVisibleRow=function(){return a.view.getLastPartiallyVisibleRow()},this.getFirstPartiallyVisibleColumn=function(){return a.view.getFirstPartiallyVisibleColumn()},this.getLastPartiallyVisibleColumn=function(){return a.view.getLastPartiallyVisibleColumn()},this.getPlugin=function(k){return F.getItem(Hd(k))},this.getPluginName=function(k){return F.getId(k)},this.getInstance=function(){return a},this.addHook=function(k,_,N){un.getSingleton().add(k,_,a,N)},this.hasHook=function(k){return un.getSingleton().has(k,a)||un.getSingleton().has(k)},this.addHookOnce=function(k,_,N){un.getSingleton().once(k,_,a,N)},this.removeHook=function(k,_){un.getSingleton().remove(k,_,a)},this.runHooks=function(k,_,N,O,G,q,I){return un.getSingleton().run(a,k,_,N,O,G,q,I)},this.getTranslatedPhrase=function(k,_){return iq(H.language,k,_)},this.toHTML=()=>OG(this),this.toTableElement=()=>{const k=this.rootDocument.createElement("div");return k.insertAdjacentHTML("afterbegin",OG(this)),k.firstElementChild},this.timeouts=[],this.useTheme=k=>{const _=!!E;this.stylesHandler.useTheme(k);const N=this.stylesHandler.getThemeName();!_&&N&&(o$(this.rootContainer)&&(cn(this.rootContainer,/ht-theme-.*/g),st(this.rootContainer,N)),a.render(),a.scrollViewportTo(0,0)),this.runHooks("afterSetTheme",N,_)},this.getCurrentThemeName=()=>this.stylesHandler.getThemeName(),this.getTableHeight=()=>this.rootElement.offsetHeight,this.getTableWidth=()=>this.rootElement.offsetWidth,this._registerTimeout=function(k){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,N=k;typeof N=="function"&&(N=setTimeout(N,_)),this.timeouts.push(N)},this._clearTimeouts=function(){Te(this.timeouts,k=>{clearTimeout(k)})},this.microtasks=[],this._registerMicrotask=function(k){const _={cancelled:!1};this.microtasks.push(_),this.rootWindow.queueMicrotask(()=>{_.cancelled||k()})},this._clearMicrotasks=function(){Te(this.microtasks,k=>{k.cancelled=!0}),this.microtasks.length=0},this._getEditorManager=function(){return y},this._getDataSource=function(){return m},this._getMetaManager=function(){return z};const ne=pCe({handleEvent(){return a.isListening()},beforeKeyDown:k=>this.runHooks("beforeKeyDown",k),afterKeyDown:k=>{this.isDestroyed||a.runHooks("afterDocumentKeyDown",k)},ownerWindow:this.rootWindow});this.addHook("beforeOnCellMouseDown",k=>{k.ctrlKey===!1&&k.metaKey===!1&&ne.releasePressedKeys()}),this.getShortcutManager=function(){return ne},x=new nwe(a);const xe=Vd(this)?ewe(a):null;this.getFocusManager=function(){return x},this.getFocusScopeManager=function(){return Vd(a)||gt("The FocusScopeManager is only available for the main Handsontable instance."),xe};const Ke=M.theme,qe=M.themeName,we=o$(a.rootContainer);Vd(a)&&!we&&(nn(Ke)||!Ke&&!qe)&&dt(Ke),VG().forEach(k=>{const _=RL(k);F.addItem(k,new _(this))}),aCe(a),Vd(this)&&cCe(a),ne.setActiveContextName("grid"),un.getSingleton().run(a,"construct")}const cSe="base",uSe="htTextEllipsis";function Yj(t,e,n,r,i,s,a){const u=a.ariaTags,h=[],m=[],g=[],y=[];a._isBaseRendererCalled=!0,a.className&&st(e,a.className),a.readOnly?(h.push(a.readOnlyCellClassName),u&&y.push(JY())):u&&g.push(JY()[0]),a.valid===!1&&a.invalidCellClassName?(h.push(a.invalidCellClassName),u&&y.push(eG())):(m.push(a.invalidCellClassName),u&&g.push(eG()[0])),a.wordWrap===!1&&a.noWordWrapClassName&&h.push(a.noWordWrapClassName),!s&&a.placeholder&&h.push(a.placeholderCellClassName),a.textEllipsis&&h.push(uSe),cn(e,m),st(e,h),wm(e,g),gn(e,y)}Yj.RENDERER_TYPE=cSe;function oX(t,e,n){t.addEventListener(e,n,!1)}function aX(t,e,n){t.removeEventListener(e,n,!1)}function Gj(t){return t.ownerDocument.defaultView.getComputedStyle(t)}function lX(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300,textContent:y=>y.value,...e},r=t.body,i=t.createTextNode(""),s=t.createElement("span");let a;function u(){var y,x;i.textContent=n.textContent(a),s.style.position="absolute",s.style.fontSize=Gj(a).fontSize,s.style.fontFamily=Gj(a).fontFamily,s.style.whiteSpace="pre",r.appendChild(s);const C=parseInt(((y=Gj(a))===null||y===void 0?void 0:y.paddingInlineStart)||0,10),E=parseInt(((x=Gj(a))===null||x===void 0?void 0:x.paddingInlineEnd)||0,10),M=s.clientWidth+C+E+1;r.removeChild(s);const j=a.style;j.height=`${n.minHeight}px`,n.minWidth>M?j.width=`${n.minWidth}px`:M>n.maxWidth?j.width=`${n.maxWidth}px`:j.width=`${M}px`;const L=a.scrollHeight?a.scrollHeight-1:0;n.minHeight>L?j.height=`${n.minHeight}px`:n.maxHeight<L?(j.height=`${n.maxHeight}px`,j.overflowY="visible"):j.height=`${L}px`}function h(){t.defaultView.setTimeout(u,0)}function m(y){if(y&&y.minHeight)if(y.minHeight==="inherit")n.minHeight=a.clientHeight;else{const x=parseInt(y.minHeight,10);isNaN(x)||(n.minHeight=x)}if(y&&y.maxHeight)if(y.maxHeight==="inherit")n.maxHeight=a.clientHeight;else{const x=parseInt(y.maxHeight,10);isNaN(x)||(n.maxHeight=x)}if(y&&y.minWidth)if(y.minWidth==="inherit")n.minWidth=a.clientWidth;else{const x=parseInt(y.minWidth,10);isNaN(x)||(n.minWidth=x)}if(y&&y.maxWidth)if(y.maxWidth==="inherit")n.maxWidth=a.clientWidth;else{const x=parseInt(y.maxWidth,10);isNaN(x)||(n.maxWidth=x)}s.firstChild||(s.className="autoResize",s.style.display="inline-block",s.appendChild(i))}function g(y,x){let C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;a=y,m(x),a.nodeName==="TEXTAREA"&&(a.style.resize="none",a.style.height=`${n.minHeight}px`,a.style.minWidth=`${n.minWidth}px`,a.style.maxWidth=`${n.maxWidth}px`,a.style.overflowY="hidden"),C&&(oX(a,"input",u),oX(a,"keydown",h)),u()}return{init:g,resize:u,unObserve(){aX(a,"input",u),aX(a,"keydown",h)}}}function cX(t,e){const n=fG(e),r=e.value.split(` `);let i=n,s=0;for(let a=0;a<r.length;a++){const u=r[a];a!==0&&(s+=r[a-1].length+1);const h=s+u.length;if(t==="home"?i=s:t==="end"&&(i=h),n<=h)break}DT(e,i)}function nb(t,e,n){return(e=dSe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dSe(t){var e=hSe(t,"string");return typeof e=="symbol"?e:e+""}function hSe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const fSe="ht_editor_visible",Kj="ht_editor_hidden",uX="textEditor",mSe="text";class Am extends J0{static get EDITOR_TYPE(){return mSe}constructor(e){super(e),nb(this,"eventManager",new Sc(this)),nb(this,"autoResize",lX(this.hot.rootDocument)),nb(this,"TEXTAREA",void 0),nb(this,"textareaStyle",void 0),nb(this,"TEXTAREA_PARENT",void 0),nb(this,"textareaParentStyle",void 0),nb(this,"layerClass",void 0),this.eventManager=new Sc(this),this.createElements(),this.bindEvents(),this.hot.addHookOnce("afterDestroy",()=>this.destroy())}getValue(){return this.TEXTAREA.value}setValue(e){this.TEXTAREA.value=e}open(){this._opened=!0,this.refreshDimensions(),this.showEditableElement(),this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this._opened=!1,this.autoResize.unObserve(),PT(this.hot.rootDocument.activeElement,this.hot.rootElement)&&this.hot.listen(),this.hideEditableElement(),this.unregisterShortcuts()}prepare(e,n,r,i,s,a){const u=this.state;if(super.prepare(e,n,r,i,s,a),!a.readOnly){this.refreshDimensions(!0);const{allowInvalid:h}=a;h&&!this.isOpened()&&(this.TEXTAREA.value=""),u!==Qs.FINISHED&&!this.isOpened()&&this.hideEditableElement()}}beginEditing(e,n){this.state===Qs.VIRGIN&&(this.TEXTAREA.value="",super.beginEditing(e,n))}focus(){this.TEXTAREA.select(),DT(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"textarea";const{rootDocument:n}=this.hot;this.TEXTAREA=n.createElement(e),gn(this.TEXTAREA,[["data-hot-input",""],Ld(-1)]),st(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.textareaStyle.overflowY="visible",this.TEXTAREA_PARENT=n.createElement("DIV"),st(this.TEXTAREA_PARENT,"handsontableInputHolder"),Dn(this.TEXTAREA_PARENT,this.layerClass)&&cn(this.TEXTAREA_PARENT,this.layerClass),st(this.TEXTAREA_PARENT,Kj),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){Mpe()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",cn(this.TEXTAREA_PARENT,this.layerClass),st(this.TEXTAREA_PARENT,Kj)}showEditableElement(){this.textareaParentStyle.height="",this.textareaParentStyle.overflow="",this.textareaParentStyle.position="",this.textareaParentStyle[this.hot.isRtl()?"left":"right"]="auto",this.textareaParentStyle.opacity="1",this.textareaStyle.textIndent="";const e=this.TEXTAREA_PARENT.childNodes;let n=!1;En(e.length-1,r=>{const i=e[r];if(Dn(i,"handsontableEditor"))return n=!0,!1}),Dn(this.TEXTAREA_PARENT,Kj)&&cn(this.TEXTAREA_PARENT,Kj),n?(this.layerClass=fSe,st(this.TEXTAREA_PARENT,this.layerClass)):(this.layerClass=this.getEditedCellsLayerClass(),st(this.TEXTAREA_PARENT,this.layerClass))}refreshValue(){const e=this.hot.toPhysicalRow(this.row),n=this.hot.getSourceDataAtCell(e,this.col);this.originalValue=n,this.setValue(n),this.refreshDimensions()}refreshDimensions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.state!==Qs.EDITING&&!e)return;if(this.TD=this.getEditedCell(),!this.TD){e||this.close();return}const{top:n,start:r,width:i,maxWidth:s,height:a,maxHeight:u}=this.getEditedCellRect();this.textareaParentStyle.top=`${n}px`,this.textareaParentStyle[this.hot.isRtl()?"right":"left"]=`${r}px`,this.showEditableElement();const h=this.hot.rootWindow.getComputedStyle(this.TD);this.TEXTAREA.style.fontSize=h.fontSize,this.TEXTAREA.style.fontFamily=h.fontFamily,this.TEXTAREA.style.backgroundColor=this.TD.style.backgroundColor,this.autoResize.init(this.TEXTAREA,{minWidth:Math.min(i,s),minHeight:Math.min(a,u),maxWidth:s,maxHeight:u},!0)}bindEvents(){iG()&&this.eventManager.addEventListener(this.TEXTAREA,"focusout",()=>this.finishEditing(!1)),this.addHook("afterScrollHorizontally",()=>this.refreshDimensions()),this.addHook("afterScrollVertically",()=>this.refreshDimensions()),this.addHook("afterColumnResize",()=>{this.refreshDimensions(),this.state===Qs.EDITING&&this.focus()}),this.addHook("afterRowResize",()=>{this.refreshDimensions(),this.state===Qs.EDITING&&this.focus()})}destroy(){this.eventManager.destroy(),this.clearHooks()}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor"),r={runOnlyIf:()=>Lt(this.hot.getSelected()),group:uX},i=()=>{this.hot.rootDocument.execCommand("insertText",!1,` `)};n.addShortcuts([{keys:[["Control","Enter"]],callback:()=>(i(),!1),runOnlyIf:s=>!this.hot.selection.isMultiple()&&!s.altKey},{keys:[["Meta","Enter"]],callback:()=>(i(),!1),runOnlyIf:()=>!this.hot.selection.isMultiple()},{keys:[["Alt","Enter"]],callback:()=>(i(),!1)},{keys:[["Home"]],callback:(s,a)=>{let[u]=a;cX(u,this.TEXTAREA)}},{keys:[["End"]],callback:(s,a)=>{let[u]=a;cX(u,this.TEXTAREA)}}],r)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(uX)}}const pSe="text";function Yd(t,e,n,r,i,s,a){let u=s;!u&&a.placeholder&&(u=a.placeholder),u=Hi(u),a.trimWhitespace&&(u=u.trim()),Cg(e,u)}Yd.RENDERER_TYPE=pSe;const dX={CELL_TYPE:"text",editor:Am,renderer:Yd};kc(dX),Bl(Yj),$r.editors={BaseEditor:J0};function $r(t,e){const n=new sX(t,e||{},QL);return n.init(),n}$r.Core=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new sX(t,e,QL)},$r.DefaultSettings=xq(),$r.hooks=un.getSingleton(),$r.CellCoords=L0,$r.CellRange=Xx,$r.packageName="handsontable",$r.buildDate="09/03/2026 08:59:20",$r.version="17.0.0",$r.languages={dictionaryKeys:pye,getLanguageDictionary:rq,getLanguagesDictionaries:xye,registerLanguageDictionary:nq,getTranslatedPhrase:iq},$r.themes={hasTheme:Wj,getTheme:Uj,getThemeNames:oSe,getThemes:aSe,registerTheme:p$};var Gd={};function b$(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function gSe(t){if(Array.isArray(t))return b$(t)}function vSe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function XR(t,e,n){return e=qj(e),RSe(t,fX()?Reflect.construct(e,n||[],qj(t).constructor):e.apply(t,n))}function bw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hX(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pX(r.key),r)}}function yw(t,e,n){return e&&hX(t.prototype,e),n&&hX(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function bSe(t,e,n){return(e=pX(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qj(t){return qj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qj(t)}function QR(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y$(t,e)}function fX(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fX=function(){return!!t})()}function ySe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function xSe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mX(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function wSe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?mX(Object(n),!0).forEach(function(r){bSe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mX(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function CSe(t,e){if(t==null)return{};var n,r,i=SSe(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function SSe(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function RSe(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vSe(t)}function y$(t,e){return y$=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},y$(t,e)}function _Se(t){return gSe(t)||ySe(t)||NSe(t)||xSe()}function ESe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function pX(t){var e=ESe(t,"string");return typeof e=="symbol"?e:e+""}function hu(t){"@babel/helpers - typeof";return hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hu(t)}function NSe(t,e){if(t){if(typeof t=="string")return b$(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b$(t,e):void 0}}var x$=null,kSe="Your `HotTable` configuration includes `autoRowSize`/`autoColumnSize` options, which are not compatible with the component-based renderers`. Disable `autoRowSize` and `autoColumnSize` to prevent row and column misalignment.",TSe="The Handsontable instance bound to this component was destroyed and cannot be used properly.",Xj="global",jSe="hot-wrapper-editor-container";function MSe(){if(typeof console<"u"){var t;(t=console).warn.apply(t,arguments)}}function w$(t,e){var n=bi.Children.toArray(t),r=bi.Children.count(t),i=null;return r!==0&&(r===1&&n[0].props[e]?i=n[0]:i=n.find(function(s){return s.props[e]!==void 0})),i||null}function gX(t){return t?t.type.WrappedComponent?t.type.WrappedComponent:t.type:null}function vX(t,e){if(typeof t>"u"||e===null)return null;var n=yX(e.props,!1);return n.className="".concat(jSe," ").concat(n.className),TU.createPortal(bi.createElement("div",Object.assign({},n),e),t.body)}function bX(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Xj,r=w$(t,"hot-editor"),i=gX(r);return r?bi.cloneElement(r,{emitEditorInstance:function(a,u){e.get(i)||e.set(i,new Map);var h=e.get(i);h.set(u??Xj,a)},editorColumnScope:n,isEditor:!0}):null}function PSe(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:document,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;n||(n=document),x$||(x$=n.createDocumentFragment());var s=i??n.createElement("DIV");x$.appendChild(s);var a=bi.cloneElement(t,wSe({key:"".concat(e.row,"-").concat(e.col)},e));return{portal:TU.createPortal(a,s,r),portalContainer:s}}function yX(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return{id:t.id||(e?"hot-"+Math.random().toString(36).substring(5):void 0),className:t.className||"",style:t.style||{}}}function ASe(){return typeof window<"u"}var xX=function(){function t(){bw(this,t)}return yw(t,null,[{key:"getSettings",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.prevProps,s=i===void 0?{}:i,a=r.isInit,u=a===void 0?!1:a,h=r.initOnlySettingKeys,m=h===void 0?[]:h,g=function(j){return!u&&m.includes(j)?s[j]===n[j]:!1},y={};if(n.settings){var x=n.settings;for(var C in x)x.hasOwnProperty(C)&&!g(C)&&(y[C]=x[C])}for(var E in n)E!=="settings"&&E!=="children"&&!g(E)&&n.hasOwnProperty(E)&&(y[E]=n[E]);return y}}])}(),OSe=function(t){function e(){return bw(this,e),XR(this,e,arguments)}return QR(e,t),yw(e,[{key:"getSettingsProps",value:function(){var r=this;return this.internalProps=["_componentRendererColumns","_emitColumnSettings","_columnIndex","_getChildElementByType","_getRendererWrapper","_getEditorClass","_getEditorCache","_getOwnerDocument","hot-renderer","hot-editor","children"],Object.keys(this.props).filter(function(i){return!r.internalProps.includes(i)}).reduce(function(i,s){return i[s]=r.props[s],i},{})}},{key:"getLocalEditorElement",value:function(){return bX(this.props.children,this.props._getEditorCache(),this.props._columnIndex)}},{key:"createColumnSettings",value:function(){var r=this.props._getChildElementByType(this.props.children,"hot-renderer"),i=this.getLocalEditorElement();this.columnSettings=xX.getSettings(this.getSettingsProps()),r!==null&&(this.columnSettings.renderer=this.props._getRendererWrapper(r),this.props._componentRendererColumns.set(this.props._columnIndex,!0)),i!==null&&(this.columnSettings.editor=this.props._getEditorClass(i,this.props._columnIndex))}},{key:"emitColumnSettings",value:function(){this.props._emitColumnSettings(this.columnSettings,this.props._columnIndex)}},{key:"componentDidMount",value:function(){this.createColumnSettings(),this.emitColumnSettings()}},{key:"componentDidUpdate",value:function(){this.createColumnSettings(),this.emitColumnSettings()}},{key:"render",value:function(){var r=this.props._getOwnerDocument(),i=vX(r,this.getLocalEditorElement());return bi.createElement(bi.Fragment,null,i)}}])}(bi.Component),ISe=function(t){function e(){var n;return bw(this,e),n=XR(this,e,arguments),n.state={portals:[]},n}return QR(e,t),yw(e,[{key:"render",value:function(){return bi.createElement(bi.Fragment,null,this.state.portals)}}])}(bi.Component),DSe="16.2.0";function HSe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var C$={exports:{}},Qj={exports:{}},_i={},wX;function LSe(){if(wX)return _i;wX=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,u=t?Symbol.for("react.context"):60110,h=t?Symbol.for("react.async_mode"):60111,m=t?Symbol.for("react.concurrent_mode"):60111,g=t?Symbol.for("react.forward_ref"):60112,y=t?Symbol.for("react.suspense"):60113,x=t?Symbol.for("react.suspense_list"):60120,C=t?Symbol.for("react.memo"):60115,E=t?Symbol.for("react.lazy"):60116,M=t?Symbol.for("react.block"):60121,j=t?Symbol.for("react.fundamental"):60117,L=t?Symbol.for("react.responder"):60118,D=t?Symbol.for("react.scope"):60119;function z(V){if(hu(V)==="object"&&V!==null){var F=V.$$typeof;switch(F){case e:switch(V=V.type,V){case h:case m:case r:case s:case i:case y:return V;default:switch(V=V&&V.$$typeof,V){case u:case g:case E:case C:case a:return V;default:return F}}case n:return F}}}function H(V){return z(V)===m}return _i.AsyncMode=h,_i.ConcurrentMode=m,_i.ContextConsumer=u,_i.ContextProvider=a,_i.Element=e,_i.ForwardRef=g,_i.Fragment=r,_i.Lazy=E,_i.Memo=C,_i.Portal=n,_i.Profiler=s,_i.StrictMode=i,_i.Suspense=y,_i.isAsyncMode=function(V){return H(V)||z(V)===h},_i.isConcurrentMode=H,_i.isContextConsumer=function(V){return z(V)===u},_i.isContextProvider=function(V){return z(V)===a},_i.isElement=function(V){return hu(V)==="object"&&V!==null&&V.$$typeof===e},_i.isForwardRef=function(V){return z(V)===g},_i.isFragment=function(V){return z(V)===r},_i.isLazy=function(V){return z(V)===E},_i.isMemo=function(V){return z(V)===C},_i.isPortal=function(V){return z(V)===n},_i.isProfiler=function(V){return z(V)===s},_i.isStrictMode=function(V){return z(V)===i},_i.isSuspense=function(V){return z(V)===y},_i.isValidElementType=function(V){return typeof V=="string"||typeof V=="function"||V===r||V===m||V===s||V===i||V===y||V===x||hu(V)==="object"&&V!==null&&(V.$$typeof===E||V.$$typeof===C||V.$$typeof===a||V.$$typeof===u||V.$$typeof===g||V.$$typeof===j||V.$$typeof===L||V.$$typeof===D||V.$$typeof===M)},_i.typeOf=z,_i}var Ei={},CX;function $Se(){return CX||(CX=1,Gd.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,u=t?Symbol.for("react.context"):60110,h=t?Symbol.for("react.async_mode"):60111,m=t?Symbol.for("react.concurrent_mode"):60111,g=t?Symbol.for("react.forward_ref"):60112,y=t?Symbol.for("react.suspense"):60113,x=t?Symbol.for("react.suspense_list"):60120,C=t?Symbol.for("react.memo"):60115,E=t?Symbol.for("react.lazy"):60116,M=t?Symbol.for("react.block"):60121,j=t?Symbol.for("react.fundamental"):60117,L=t?Symbol.for("react.responder"):60118,D=t?Symbol.for("react.scope"):60119;function z(O){return typeof O=="string"||typeof O=="function"||O===r||O===m||O===s||O===i||O===y||O===x||hu(O)==="object"&&O!==null&&(O.$$typeof===E||O.$$typeof===C||O.$$typeof===a||O.$$typeof===u||O.$$typeof===g||O.$$typeof===j||O.$$typeof===L||O.$$typeof===D||O.$$typeof===M)}function H(O){if(hu(O)==="object"&&O!==null){var G=O.$$typeof;switch(G){case e:var q=O.type;switch(q){case h:case m:case r:case s:case i:case y:return q;default:var I=q&&q.$$typeof;switch(I){case u:case g:case E:case C:case a:return I;default:return G}}case n:return G}}}var V=h,F=m,B=u,te=a,ve=e,ce=g,_e=r,pe=E,Le=C,Fe=n,nt=s,dt=i,$e=y,Re=!1;function Ze(O){return Re||(Re=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),Ee(O)||H(O)===h}function Ee(O){return H(O)===m}function Q(O){return H(O)===u}function fe(O){return H(O)===a}function Ve(O){return hu(O)==="object"&&O!==null&&O.$$typeof===e}function ne(O){return H(O)===g}function xe(O){return H(O)===r}function Ke(O){return H(O)===E}function qe(O){return H(O)===C}function we(O){return H(O)===n}function k(O){return H(O)===s}function _(O){return H(O)===i}function N(O){return H(O)===y}Ei.AsyncMode=V,Ei.ConcurrentMode=F,Ei.ContextConsumer=B,Ei.ContextProvider=te,Ei.Element=ve,Ei.ForwardRef=ce,Ei.Fragment=_e,Ei.Lazy=pe,Ei.Memo=Le,Ei.Portal=Fe,Ei.Profiler=nt,Ei.StrictMode=dt,Ei.Suspense=$e,Ei.isAsyncMode=Ze,Ei.isConcurrentMode=Ee,Ei.isContextConsumer=Q,Ei.isContextProvider=fe,Ei.isElement=Ve,Ei.isForwardRef=ne,Ei.isFragment=xe,Ei.isLazy=Ke,Ei.isMemo=qe,Ei.isPortal=we,Ei.isProfiler=k,Ei.isStrictMode=_,Ei.isSuspense=N,Ei.isValidElementType=z,Ei.typeOf=H}()),Ei}var SX;function RX(){return SX||(SX=1,Gd.NODE_ENV==="production"?Qj.exports=LSe():Qj.exports=$Se()),Qj.exports}/* object-assign (c) Sindre Sorhus @license MIT */var S$,_X;function FSe(){if(_X)return S$;_X=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function i(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var a={},u=0;u<10;u++)a["_"+String.fromCharCode(u)]=u;var h=Object.getOwnPropertyNames(a).map(function(g){return a[g]});if(h.join("")!=="0123456789")return!1;var m={};return"abcdefghijklmnopqrst".split("").forEach(function(g){m[g]=g}),Object.keys(Object.assign({},m)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return S$=i()?Object.assign:function(s,a){for(var u,h=r(s),m,g=1;g<arguments.length;g++){u=Object(arguments[g]);for(var y in u)e.call(u,y)&&(h[y]=u[y]);if(t){m=t(u);for(var x=0;x<m.length;x++)n.call(u,m[x])&&(h[m[x]]=u[m[x]])}}return h},S$}var R$,EX;function _$(){if(EX)return R$;EX=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return R$=t,R$}var E$,NX;function kX(){return NX||(NX=1,E$=Function.call.bind(Object.prototype.hasOwnProperty)),E$}var N$,TX;function zSe(){if(TX)return N$;TX=1;var t=function(){};if(Gd.NODE_ENV!=="production"){var e=_$(),n={},r=kX();t=function(a){var u="Warning: "+a;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}}}function i(s,a,u,h,m){if(Gd.NODE_ENV!=="production"){for(var g in s)if(r(s,g)){var y;try{if(typeof s[g]!="function"){var x=Error((h||"React class")+": "+u+" type `"+g+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+hu(s[g])+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw x.name="Invariant Violation",x}y=s[g](a,g,h,u,null,e)}catch(E){y=E}if(y&&!(y instanceof Error)&&t((h||"React class")+": type specification of "+u+" `"+g+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+hu(y)+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),y instanceof Error&&!(y.message in n)){n[y.message]=!0;var C=m?m():"";t("Failed "+u+" type: "+y.message+(C??""))}}}}return i.resetWarningCache=function(){Gd.NODE_ENV!=="production"&&(n={})},N$=i,N$}var k$,jX;function VSe(){if(jX)return k$;jX=1;var t=RX(),e=FSe(),n=_$(),r=kX(),i=zSe(),s=function(){};Gd.NODE_ENV!=="production"&&(s=function(h){var m="Warning: "+h;typeof console<"u"&&console.error(m);try{throw new Error(m)}catch{}});function a(){return null}return k$=function(h,m){var g=typeof Symbol=="function"&&Symbol.iterator,y="@@iterator";function x(Q){var fe=Q&&(g&&Q[g]||Q[y]);if(typeof fe=="function")return fe}var C="<<anonymous>>",E={array:D("array"),bigint:D("bigint"),bool:D("boolean"),func:D("function"),number:D("number"),object:D("object"),string:D("string"),symbol:D("symbol"),any:z(),arrayOf:H,element:V(),elementType:F(),instanceOf:B,node:_e(),objectOf:ve,oneOf:te,oneOfType:ce,shape:Le,exact:Fe};function M(Q,fe){return Q===fe?Q!==0||1/Q===1/fe:Q!==Q&&fe!==fe}function j(Q,fe){this.message=Q,this.data=fe&&hu(fe)==="object"?fe:{},this.stack=""}j.prototype=Error.prototype;function L(Q){if(Gd.NODE_ENV!=="production")var fe={},Ve=0;function ne(Ke,qe,we,k,_,N,O){if(k=k||C,N=N||we,O!==n){if(m){var G=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw G.name="Invariant Violation",G}else if(Gd.NODE_ENV!=="production"&&typeof console<"u"){var q=k+":"+we;!fe[q]&&Ve<3&&(s("You are manually calling a React.PropTypes validation function for the `"+N+"` prop on `"+k+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),fe[q]=!0,Ve++)}}return qe[we]==null?Ke?qe[we]===null?new j("The "+_+" `"+N+"` is marked as required "+("in `"+k+"`, but its value is `null`.")):new j("The "+_+" `"+N+"` is marked as required in "+("`"+k+"`, but its value is `undefined`.")):null:Q(qe,we,k,_,N)}var xe=ne.bind(null,!1);return xe.isRequired=ne.bind(null,!0),xe}function D(Q){function fe(Ve,ne,xe,Ke,qe,we){var k=Ve[ne],_=$e(k);if(_!==Q){var N=Re(k);return new j("Invalid "+Ke+" `"+qe+"` of type "+("`"+N+"` supplied to `"+xe+"`, expected ")+("`"+Q+"`."),{expectedType:Q})}return null}return L(fe)}function z(){return L(a)}function H(Q){function fe(Ve,ne,xe,Ke,qe){if(typeof Q!="function")return new j("Property `"+qe+"` of component `"+xe+"` has invalid PropType notation inside arrayOf.");var we=Ve[ne];if(!Array.isArray(we)){var k=$e(we);return new j("Invalid "+Ke+" `"+qe+"` of type "+("`"+k+"` supplied to `"+xe+"`, expected an array."))}for(var _=0;_<we.length;_++){var N=Q(we,_,xe,Ke,qe+"["+_+"]",n);if(N instanceof Error)return N}return null}return L(fe)}function V(){function Q(fe,Ve,ne,xe,Ke){var qe=fe[Ve];if(!h(qe)){var we=$e(qe);return new j("Invalid "+xe+" `"+Ke+"` of type "+("`"+we+"` supplied to `"+ne+"`, expected a single ReactElement."))}return null}return L(Q)}function F(){function Q(fe,Ve,ne,xe,Ke){var qe=fe[Ve];if(!t.isValidElementType(qe)){var we=$e(qe);return new j("Invalid "+xe+" `"+Ke+"` of type "+("`"+we+"` supplied to `"+ne+"`, expected a single ReactElement type."))}return null}return L(Q)}function B(Q){function fe(Ve,ne,xe,Ke,qe){if(!(Ve[ne]instanceof Q)){var we=Q.name||C,k=Ee(Ve[ne]);return new j("Invalid "+Ke+" `"+qe+"` of type "+("`"+k+"` supplied to `"+xe+"`, expected ")+("instance of `"+we+"`."))}return null}return L(fe)}function te(Q){if(!Array.isArray(Q))return Gd.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),a;function fe(Ve,ne,xe,Ke,qe){for(var we=Ve[ne],k=0;k<Q.length;k++)if(M(we,Q[k]))return null;var _=JSON.stringify(Q,function(O,G){var q=Re(G);return q==="symbol"?String(G):G});return new j("Invalid "+Ke+" `"+qe+"` of value `"+String(we)+"` "+("supplied to `"+xe+"`, expected one of "+_+"."))}return L(fe)}function ve(Q){function fe(Ve,ne,xe,Ke,qe){if(typeof Q!="function")return new j("Property `"+qe+"` of component `"+xe+"` has invalid PropType notation inside objectOf.");var we=Ve[ne],k=$e(we);if(k!=="object")return new j("Invalid "+Ke+" `"+qe+"` of type "+("`"+k+"` supplied to `"+xe+"`, expected an object."));for(var _ in we)if(r(we,_)){var N=Q(we,_,xe,Ke,qe+"."+_,n);if(N instanceof Error)return N}return null}return L(fe)}function ce(Q){if(!Array.isArray(Q))return Gd.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var fe=0;fe<Q.length;fe++){var Ve=Q[fe];if(typeof Ve!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Ze(Ve)+" at index "+fe+"."),a}function ne(xe,Ke,qe,we,k){for(var _=[],N=0;N<Q.length;N++){var O=Q[N],G=O(xe,Ke,qe,we,k,n);if(G==null)return null;G.data&&r(G.data,"expectedType")&&_.push(G.data.expectedType)}var q=_.length>0?", expected one of type ["+_.join(", ")+"]":"";return new j("Invalid "+we+" `"+k+"` supplied to "+("`"+qe+"`"+q+"."))}return L(ne)}function _e(){function Q(fe,Ve,ne,xe,Ke){return nt(fe[Ve])?null:new j("Invalid "+xe+" `"+Ke+"` supplied to "+("`"+ne+"`, expected a ReactNode."))}return L(Q)}function pe(Q,fe,Ve,ne,xe){return new j((Q||"React class")+": "+fe+" type `"+Ve+"."+ne+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+xe+"`.")}function Le(Q){function fe(Ve,ne,xe,Ke,qe){var we=Ve[ne],k=$e(we);if(k!=="object")return new j("Invalid "+Ke+" `"+qe+"` of type `"+k+"` "+("supplied to `"+xe+"`, expected `object`."));for(var _ in Q){var N=Q[_];if(typeof N!="function")return pe(xe,Ke,qe,_,Re(N));var O=N(we,_,xe,Ke,qe+"."+_,n);if(O)return O}return null}return L(fe)}function Fe(Q){function fe(Ve,ne,xe,Ke,qe){var we=Ve[ne],k=$e(we);if(k!=="object")return new j("Invalid "+Ke+" `"+qe+"` of type `"+k+"` "+("supplied to `"+xe+"`, expected `object`."));var _=e({},Ve[ne],Q);for(var N in _){var O=Q[N];if(r(Q,N)&&typeof O!="function")return pe(xe,Ke,qe,N,Re(O));if(!O)return new j("Invalid "+Ke+" `"+qe+"` key `"+N+"` supplied to `"+xe+"`.\nBad object: "+JSON.stringify(Ve[ne],null," ")+` Valid keys: `+JSON.stringify(Object.keys(Q),null," "));var G=O(we,N,xe,Ke,qe+"."+N,n);if(G)return G}return null}return L(fe)}function nt(Q){switch(hu(Q)){case"number":case"string":case"undefined":return!0;case"boolean":return!Q;case"object":if(Array.isArray(Q))return Q.every(nt);if(Q===null||h(Q))return!0;var fe=x(Q);if(fe){var Ve=fe.call(Q),ne;if(fe!==Q.entries){for(;!(ne=Ve.next()).done;)if(!nt(ne.value))return!1}else for(;!(ne=Ve.next()).done;){var xe=ne.value;if(xe&&!nt(xe[1]))return!1}}else return!1;return!0;default:return!1}}function dt(Q,fe){return Q==="symbol"?!0:fe?fe["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&fe instanceof Symbol:!1}function $e(Q){var fe=hu(Q);return Array.isArray(Q)?"array":Q instanceof RegExp?"object":dt(fe,Q)?"symbol":fe}function Re(Q){if(typeof Q>"u"||Q===null)return""+Q;var fe=$e(Q);if(fe==="object"){if(Q instanceof Date)return"date";if(Q instanceof RegExp)return"regexp"}return fe}function Ze(Q){var fe=Re(Q);switch(fe){case"array":case"object":return"an "+fe;case"boolean":case"date":case"regexp":return"a "+fe;default:return fe}}function Ee(Q){return!Q.constructor||!Q.constructor.name?C:Q.constructor.name}return E.checkPropTypes=i,E.resetWarningCache=i.resetWarningCache,E.PropTypes=E,E},k$}var T$,MX;function BSe(){if(MX)return T$;MX=1;var t=_$();function e(){}function n(){}return n.resetWarningCache=e,T$=function(){function i(u,h,m,g,y,x){if(x!==t){var C=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw C.name="Invariant Violation",C}}i.isRequired=i;function s(){return i}var a={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:s,element:i,elementType:i,instanceOf:s,node:i,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:e};return a.PropTypes=a,a},T$}if(Gd.NODE_ENV!=="production"){var WSe=RX(),USe=!0;C$.exports=VSe()(WSe.isElement,USe)}else C$.exports=BSe()();var YSe=C$.exports,j$=HSe(YSe),M$=function(t){function e(){var n;return bw(this,e),n=XR(this,e,arguments),n.id=null,n.__hotInstance=null,n.hotElementRef=null,n.columnSettings=[],n.renderersPortalManager=null,n.portalCache=new Map,n.portalContainerCache=new Map,n.renderedCellCache=new Map,n.editorCache=new Map,n.componentRendererColumns=new Map,n}return QR(e,t),yw(e,[{key:"hotInstance",get:function(){return!this.__hotInstance||this.__hotInstance&&!this.__hotInstance.isDestroyed?this.__hotInstance:(console.warn(TSe),null)},set:function(r){this.__hotInstance=r}},{key:"_isHotInstanceDestroyed",value:function(){return this.__hotInstance&&this.__hotInstance.isDestroyed}},{key:"getPortalContainerCache",value:function(){return this.portalContainerCache}},{key:"getRenderedCellCache",value:function(){return this.renderedCellCache}},{key:"getEditorCache",value:function(){return this.editorCache}},{key:"clearCache",value:function(){this.getRenderedCellCache().clear(),this.componentRendererColumns.clear()}},{key:"getOwnerDocument",value:function(){return ASe()?this.hotElementRef?this.hotElementRef.ownerDocument:document:null}},{key:"setHotElementRef",value:function(r){this.hotElementRef=r}},{key:"getRendererWrapper",value:function(r){var i=this;return function(a,u,h,m,g,y,x){var C=i.getRenderedCellCache(),E=i.getPortalContainerCache(),M="".concat(h,"-").concat(m),j=a.guid,L="".concat(j,"-").concat(M),D="".concat(M,"-").concat(j);if(C.has(M)&&(u.innerHTML=C.get(M).innerHTML),u&&!u.getAttribute("ghost-table")){for(var z=i.portalCache.get(D),H=E.get(L);u.firstChild;)u.removeChild(u.firstChild);if(z&&H)u.appendChild(H);else{var V=PSe(r,{TD:u,row:h,col:m,prop:g,value:y,cellProperties:x,isRenderer:!0},u.ownerDocument,D,H),F=V.portal,B=V.portalContainer;E.set(L,B),u.appendChild(B),i.portalCache.set(D,F)}}return C.set(M,u),u}}},{key:"getEditorClass",value:function(r){var i,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xj,a=gX(r),u=(i=this.getEditorCache().get(a))===null||i===void 0?void 0:i.get(s);return this.makeEditorClass(u)}},{key:"makeEditorClass",value:function(r){var i=function(s){function a(u){var h;return bw(this,a),h=XR(this,a,[u]),r.hotCustomEditorInstance=h,h.editorComponent=r,h}return QR(a,s),yw(a,[{key:"focus",value:function(){}},{key:"getValue",value:function(){}},{key:"setValue",value:function(){}},{key:"open",value:function(){}},{key:"close",value:function(){}}])}($r.editors.BaseEditor);return Object.getOwnPropertyNames($r.editors.BaseEditor.prototype).forEach(function(s){s!=="constructor"&&(i.prototype[s]=function(){for(var a,u=arguments.length,h=new Array(u),m=0;m<u;m++)h[m]=arguments[m];return(a=r[s]).call.apply(a,[r].concat(h))})}),i}},{key:"getGlobalRendererElement",value:function(){return w$(this.props.children,"hot-renderer")}},{key:"getGlobalEditorElement",value:function(){return bX(this.props.children,this.getEditorCache())}},{key:"createNewGlobalSettings",value:function(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=this._isHotInstanceDestroyed()?[]:((r=this.hotInstance)===null||r===void 0||(r=r.getSettings())===null||r===void 0?void 0:r._initOnlySettings)||[],u=xX.getSettings(this.props,{prevProps:s,isInit:i,initOnlySettingKeys:a}),h=this.getGlobalRendererElement(),m=this.getGlobalEditorElement();if(this.columnSettings.length&&(u.columns=this.columnSettings),m)u.editor=this.getEditorClass(m,Xj);else{var g;this.props.editor||(g=this.props.settings)!==null&&g!==void 0&&g.editor?u.editor=this.props.editor||this.props.settings.editor:u.editor=bL("text")}if(h)u.renderer=this.getRendererWrapper(h),this.componentRendererColumns.set("global",!0);else{var y;this.props.renderer||(y=this.props.settings)!==null&&y!==void 0&&y.renderer?u.renderer=this.props.renderer||this.props.settings.renderer:u.renderer=_L("text")}return u}},{key:"displayAutoSizeWarning",value:function(r){var i,s;this.hotInstance&&((i=this.hotInstance.getPlugin("autoRowSize"))!==null&&i!==void 0&&i.enabled||(s=this.hotInstance.getPlugin("autoColumnSize"))!==null&&s!==void 0&&s.enabled)&&this.componentRendererColumns.size>0&&MSe(kSe)}},{key:"setHotColumnSettings",value:function(r,i){this.columnSettings[i]=r}},{key:"handsontableBeforeViewRender",value:function(){this.portalCache.clear(),this.getRenderedCellCache().clear()}},{key:"handsontableAfterViewRender",value:function(){this.renderersPortalManager.setState({portals:_Se(this.portalCache.values())})}},{key:"updateHot",value:function(r){this.hotInstance&&this.hotInstance.updateSettings(r,!1)}},{key:"setRenderersPortalManagerRef",value:function(r){this.renderersPortalManager=r}},{key:"componentDidMount",value:function(){var r=this,i=this.createNewGlobalSettings(!0);this.hotInstance=new $r.Core(this.hotElementRef,i),this.hotInstance.addHook("beforeViewRender",function(){return r.handsontableBeforeViewRender()}),this.hotInstance.addHook("afterViewRender",function(){return r.handsontableAfterViewRender()}),this.hotInstance.init(),this.displayAutoSizeWarning(i)}},{key:"componentDidUpdate",value:function(r){this.clearCache();var i=this.createNewGlobalSettings(!1,r);this.updateHot(i),this.displayAutoSizeWarning(i)}},{key:"componentWillUnmount",value:function(){this.clearCache(),this.hotInstance&&this.hotInstance.destroy()}},{key:"render",value:function(){var r=this,i=function(g){return g.type===OSe},s=bi.Children.toArray(this.props.children),a=s.filter(function(m){return i(m)}).map(function(m,g){return bi.cloneElement(m,{_componentRendererColumns:r.componentRendererColumns,_emitColumnSettings:r.setHotColumnSettings.bind(r),_columnIndex:g,_getChildElementByType:w$.bind(r),_getRendererWrapper:r.getRendererWrapper.bind(r),_getEditorClass:r.getEditorClass.bind(r),_getOwnerDocument:r.getOwnerDocument.bind(r),_getEditorCache:r.getEditorCache.bind(r),children:m.props.children})}),u=yX(this.props),h=vX(this.getOwnerDocument(),this.getGlobalEditorElement());return bi.createElement(bi.Fragment,null,bi.createElement("div",Object.assign({ref:this.setHotElementRef.bind(this)},u),a),bi.createElement(ISe,{ref:this.setRenderersPortalManagerRef.bind(this)}),h)}}],[{key:"version",get:function(){return DSe}}])}(bi.Component);M$.propTypes={style:j$.object,id:j$.string,className:j$.string};var GSe=["children"],PX=bi.forwardRef(function(t,e){var n,r=t.children,i=CSe(t,GSe),s=typeof bi.useId=="function"?bi.useId():void 0,a=(n=i.id)!==null&&n!==void 0?n:s;return bi.createElement(M$,Object.assign({id:a},i,{ref:e}),r)});PX.version=M$.version,bi.Component;function AX(t,e,n){return(e=KSe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function KSe(t){var e=qSe(t,"string");return typeof e=="symbol"?e:e+""}function qSe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const OX="handsontableEditor",XSe="handsontable";class P$ extends Am{constructor(){super(...arguments),AX(this,"isFlippedVertically",!1),AX(this,"isFlippedHorizontally",!1)}static get EDITOR_TYPE(){return XSe}open(){super.open();const e=this.htContainer.style;this.htEditor&&(this.htEditor.destroy(),e.width="",e.height="",e.overflow=""),e.display==="none"&&(e.display=""),this.htEditor=new this.hot.constructor(this.htContainer,this.htOptions),this.htEditor.init(),this.htEditor.rootElement.style.display="",this.cellProperties.strict?this.htEditor.selectCell(0,0):this.htEditor.deselectCell(),DT(this.TEXTAREA,0,this.TEXTAREA.value.length),this.htEditor.updateSettings({width:this.getTargetDropdownWidth(),height:this.getTargetDropdownHeight()}),this.refreshDimensions(),this.flipDropdownVerticallyIfNeeded(),this.flipDropdownHorizontallyIfNeeded()}close(){this.htEditor&&(this.htEditor.rootElement.style.display="none"),this.removeHooksByKey("beforeKeyDown"),super.close()}prepare(e,n,r,i,s,a){super.prepare(e,n,r,i,s,a);const u=this,h={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,autoWrapCol:!1,autoWrapRow:!1,ariaTags:!1,themeName:this.hot.getCurrentThemeName(),afterOnCellMouseDown(m,g){const y=this.getSourceData(g.row,g.col);y!==void 0&&u.setValue(y),u.hot.destroyEditor()},preventWheel:!0,layoutDirection:this.hot.isRtl()?"rtl":"ltr"};this.cellProperties.handsontable&&jo(h,a.handsontable),this.htOptions=h}beginEditing(e,n){const r=this.hot.getSettings().onBeginEditing;r&&r()===!1||super.beginEditing(e,n)}createElements(){super.createElements();const e=this.hot.rootDocument.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()}finishEditing(e,n,r){if(this.htEditor&&this.htEditor.isListening()&&this.hot.listen(),this.htEditor&&this.htEditor.getSelectedActive()){const i=this.htEditor.getValue();i!==void 0&&this.setValue(i)}super.finishEditing(e,n,r)}flipDropdownVerticallyIfNeeded(){const{view:e}=this.hot,n=this.getEditedCellRect();let r=n.top;if(e.isVerticallyScrollableByWindow()){const u=e.getTableOffset().top-this.hot.rootWindow.scrollY;r=Math.max(r+u,0)}const i=this.getDropdownHeight(),s=e.getWorkspaceHeight()-r-n.height,a=i>s&&r>s+n.height;return a?this.flipDropdownVertically():this.unflipDropdownVertically(),{isFlipped:a,spaceAbove:r,spaceBelow:s}}flipDropdownVertically(){const e=this.htEditor.rootElement.style;e.position="absolute",e.top=`${-this.getDropdownHeight()}px`,this.isFlippedVertically=!0}unflipDropdownVertically(){const e=this.htEditor.rootElement.style;e.position="absolute",e.top="",this.isFlippedVertically=!1}flipDropdownHorizontallyIfNeeded(){const{view:e}=this.hot,n=this.getEditedCellRect();let r=n.start+n.width;if(e.isHorizontallyScrollableByWindow()){const u=e.getTableOffset().left-this.hot.rootWindow.scrollX;r=Math.max(r+u,0)}const i=this.getDropdownWidth(),s=e.getWorkspaceWidth()-r+n.width,a=i>s&&r>s;return a?this.flipDropdownHorizontally():this.unflipDropdownHorizontally(),{isFlipped:a,spaceInlineStart:r,spaceInlineEnd:s}}flipDropdownHorizontally(){const e=this.htEditor.rootElement.style,{width:n}=this.getEditedCellRect();e.position="absolute",e[this.hot.isRtl()?"right":"left"]=`${-(this.getDropdownWidth()-n)}px`,this.isFlippedHorizontally=!0}unflipDropdownHorizontally(){const e=this.htEditor.rootElement.style;e.position="absolute",e[this.hot.isRtl()?"right":"left"]="",this.isFlippedHorizontally=!1}getDropdownHeight(){return this.htEditor.getTableHeight()}getDropdownWidth(){return this.htEditor.getTableWidth()}getTargetDropdownWidth(){return this.htEditor.view.getTableWidth()}getTargetDropdownHeight(){return this.htEditor.view.getTableHeight()+1}assignHooks(){this.hot.addHook("afterDestroy",()=>{var e;(e=this.htEditor)===null||e===void 0||e.destroy()}),this.hot.addHook("afterSetTheme",(e,n)=>{n||this.close()})}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor");super.registerShortcuts();const r={group:OX,relativeToGroup:Pm,position:"before"},i=(s,a)=>{const u=this.htEditor;if(s!==void 0&&(s<0||this.isFlippedVertically&&s>u.countRows()-1?u.deselectCell():u.selectCell(s,0),u.getData().length))return a.preventDefault(),iu(a),this.hot.listen(),this.TEXTAREA.focus(),!1};n.addShortcuts([{keys:[["ArrowUp"]],callback:s=>{const a=this.htEditor;let u,h;return!a.getSelectedActive()&&this.isFlippedVertically?u=a.countRows()-1:a.getSelectedActive()&&(this.isFlippedVertically?(h=a.getSelectedActive()[0],u=Math.max(0,h-1)):(h=a.getSelectedActive()[0],u=h-1)),i(u,s)},preventDefault:!1},{keys:[["ArrowDown"]],callback:s=>{const a=this.htEditor;let u,h;if(!a.getSelectedActive()&&!this.isFlippedVertically)u=0;else if(a.getSelectedActive()){if(this.isFlippedVertically)u=a.getSelectedActive()[0]+1;else if(!this.isFlippedVertically){const m=a.countRows()-1;h=a.getSelectedActive()[0],u=Math.min(m,h+1)}}return i(u,s)},preventDefault:!1}],r)}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(OX)}}function QSe(t,e){DX(t,e),e.add(t)}function IX(t,e,n){DX(t,e),e.set(t,n)}function DX(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function A$(t,e,n){return(e=ZSe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ZSe(t){var e=JSe(t,"string");return typeof e=="symbol"?e:e+""}function JSe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function O$(t,e){return t.get(I$(t,e))}function I$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const e1e="autocomplete";var D$=new WeakMap,HX=new WeakMap,H$=new WeakSet;class L$ extends P${constructor(){super(...arguments),QSe(this,H$),A$(this,"query",null),A$(this,"strippedChoices",[]),A$(this,"rawChoices",[]),IX(this,D$,this.hot.guid.slice(0,9)),IX(this,HX,$T(()=>{this.focus()},100))}static get EDITOR_TYPE(){return e1e}getValue(){const e=this.rawChoices.find(n=>{const r=this.stripValueIfNeeded(n);return(Mo(r)?r.value:r)===this.TEXTAREA.value});return Lt(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),st(this.htContainer,"autocompleteEditor"),st(this.htContainer,this.hot.rootWindow.navigator.platform.indexOf("Mac")===-1?"":"htMacScroll"),this.hot.getSettings().ariaTags&&gn(this.TEXTAREA,[dpe(),rpe(),XY("listbox"),gpe()])}prepare(e,n,r,i,s,a){super.prepare(e,n,r,i,s,a),this.hot.getSettings().ariaTags&&gn(this.TEXTAREA,[qu("false"),vpe(`${O$(D$,this)}-listbox-${e}-${n}`)]),this.htOptions={...this.htOptions,valueGetter:u=>Mo(u)?u.value:u}}open(){super.open();const e=this.cellProperties.trimDropdown===void 0?!0:this.cellProperties.trimDropdown,n=this.hot.getSettings().ariaTags,r=Array.isArray(this.cellProperties.source)?this.cellProperties.source:null,i=r==null?void 0:r.length,{row:s,col:a}=this;this.showEditableElement(),this.focus(),this.addHook("beforeKeyDown",u=>this.onBeforeKeyDown(u)),this.htEditor.addHook("afterScroll",O$(HX,this)),this.htEditor.updateSettings({colWidths:e?[po(this.TEXTAREA)-2]:void 0,autoColumnSize:!0,renderer:(u,h,m,g,y,x,C)=>{Yd(u,h,m,g,y,x,C);const{filteringCaseSensitive:E,allowHtml:M,locale:j}=this.cellProperties,L=this.query;let D=Hi(x),z,H;D&&!M&&(z=E===!0?D.indexOf(L):D.toLocaleLowerCase(j).indexOf(L.toLocaleLowerCase(j)),z!==-1&&(H=D.substr(z,L.length),D=D.replace(H,`<strong>${H}</strong>`))),n&&gn(h,[ipe(),...r?[wpe(i)]:[],...r?[Cpe(r.indexOf(x)+1)]:[],["id",`${this.htEditor.rootElement.id}_${m}-${g}`]]),h.innerHTML=D},afterSelectionEnd:(u,h)=>{if(n){const m=y=>{gn(y,[ZH()]),gn(this.TEXTAREA,...bpe(y.id))},g=this.htEditor.getCell(u,h,!0);g!==null?m(g):this.htEditor.addHookOnce("afterScrollVertically",()=>{const y=this.htEditor.getCell(u,h,!0);m(y)})}}}),n&&(gn(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...bm()),gn(this.htEditor.rootElement,[qY(),ype("polite"),xpe("text"),["id",`${O$(D$,this)}-listbox-${s}-${a}`]]),gn(this.TEXTAREA,...qu("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&gn(this.TEXTAREA,[qu("false")])}discardEditor(e){super.discardEditor(e),this.hot.view.render()}finishEditing(e,n,r){if(this.isOpened()){const i=this.hot.getSelectedRangeActive();(ls(i)||Lt(i)&&!i.includes(this.hot._createCellCoords(this.row,this.col)))&&(e=!0)}super.finishEditing(e,n,r)}queryChoices(e){const n=this.cellProperties.source;this.query=e,typeof n=="function"?n.call(this.cellProperties,e,r=>{this.rawChoices=r,this.updateChoicesList(this.stripValuesIfNeeded(r))}):Array.isArray(n)?(this.rawChoices=n,this.updateChoicesList(this.stripValuesIfNeeded(n))):this.updateChoicesList([])}updateChoicesList(e){const n=fG(this.TEXTAREA),r=Vpe(this.TEXTAREA),i=this.cellProperties.sortByRelevance,s=this.cellProperties.filter,a=this.stripValueIfNeeded(this.getValue()),u=Mo(a)?a.value:a;let h=null,m=e;i||(m=m.toSorted());const g=[],y=this.cellProperties.locale,x=this.cellProperties.filteringCaseSensitive,C=x?u:u.toLocaleLowerCase(y);for(let E=0;E<m.length;E++){const M=Mo(m[E])?vm(Hi(m[E].value)):vm(Hi(m[E]));if((x?M:M.toLocaleLowerCase(y)).indexOf(C)!==-1&&(g.push(E),s===!1))break}s===!1?a.length>0&&(h=g[0]):(m=g.map(E=>m[E]),h=m.indexOf(C)>-1?m.indexOf(C):0),this.strippedChoices=m,m.length===0?this.htEditor.rootElement.style.display="none":this.htEditor.rootElement.style.display="",this.htEditor.loadData(CT([m])),m.length>0&&(this.updateDropdownDimensions(),this.flipDropdownVerticallyIfNeeded(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(h)),this.hot.listen(),DT(this.TEXTAREA,n,n===r?void 0:r)}flipDropdownVerticallyIfNeeded(){const e=super.flipDropdownVerticallyIfNeeded(),{isFlipped:n,spaceAbove:r,spaceBelow:i}=e;return this.limitDropdownIfNeeded(n?r:i),e}limitDropdownIfNeeded(e){const n=this.getDropdownHeight();if(n>e){let r=0,i=0,s=null;do i=this.htEditor.stylesHandler.getDefaultRowHeight(),r+=i;while(r<e);s=r-i,this.isFlippedVertically&&(this.htEditor.rootElement.style.top=`${parseInt(this.htEditor.rootElement.style.top,10)+n-s}px`),this.setDropdownHeight(r-i)}}updateDropdownDimensions(){const e=Bpe(),n=this.getTargetEditorWidth()+e,r=this.getTargetEditorHeight()+e;this.htEditor.updateSettings({width:n,height:r}),I$(H$,this,LX).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}setDropdownHeight(e){this.htEditor.updateSettings({height:e}),I$(H$,this,LX).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}highlightBestMatchingChoice(e){typeof e=="number"?this.htEditor.selectCell(e,0,void 0,void 0,void 0,!1):this.htEditor.deselectCell()}getTargetEditorHeight(){let e=0;if(!this.hot.getCurrentThemeName()){const i=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore"));e=parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)}const n=Math.min(this.cellProperties.visibleRows,this.strippedChoices.length);return Array.from({length:n},(i,s)=>s).reduce((i,s)=>{const a=this.hot.stylesHandler.getDefaultRowHeight()+(s===0?1:0);return i+a},0)+e}getTargetEditorWidth(){let e=0;if(!this.hot.getCurrentThemeName()){const n=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore"));e=parseInt(n.borderInlineStartWidth,10)+parseInt(n.borderInlineEndWidth,10)}return this.htEditor.getColWidth(0)+e}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:n}=this.cellProperties,r=i=>Hi(n?i:vm(i));return e.every(i=>Mo(i))?e.map(i=>({key:r(i.key),value:r(i.value)})):e.map(i=>r(i))}onBeforeKeyDown(e){if(CG(e.keyCode)||e.keyCode===Hn.BACKSPACE||e.keyCode===Hn.DELETE||e.keyCode===Hn.INSERT){let n=10;if(e.keyCode===Hn.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(n+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},n)}}}function LX(){this.htEditor.view.hasVerticalScroll()&&this.htEditor.updateSettings({width:this.getTargetEditorWidth()+go(this.hot.rootDocument)})}const t1e="checkbox";class $X extends J0{static get EDITOR_TYPE(){return t1e}beginEditing(e,n){if(n&&n.type==="mouseup"&&n.target.nodeName==="TD"){const r=this.TD.querySelector('input[type="checkbox"]');Dn(r,"htBadValue")||r.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}//! moment.js //! version : 2.30.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com var FX;function Tt(){return FX.apply(null,arguments)}function n1e(t){FX=t}function Kd(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function rb(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function hi(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function $$(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(hi(t,e))return!1;return!0}function Tc(t){return t===void 0}function Om(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function ZR(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function zX(t,e){var n=[],r,i=t.length;for(r=0;r<i;++r)n.push(e(t[r],r));return n}function Og(t,e){for(var n in e)hi(e,n)&&(t[n]=e[n]);return hi(e,"toString")&&(t.toString=e.toString),hi(e,"valueOf")&&(t.valueOf=e.valueOf),t}function Qh(t,e,n,r){return mQ(t,e,n,r,!0).utc()}function r1e(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function Er(t){return t._pf==null&&(t._pf=r1e()),t._pf}var F$;Array.prototype.some?F$=Array.prototype.some:F$=function(t){var e=Object(this),n=e.length>>>0,r;for(r=0;r<n;r++)if(r in e&&t.call(this,e[r],r,e))return!0;return!1};function z$(t){var e=null,n=!1,r=t._d&&!isNaN(t._d.getTime());if(r&&(e=Er(t),n=F$.call(e.parsedDateParts,function(i){return i!=null}),r=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n),t._strict&&(r=r&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=r;else return r;return t._isValid}function Zj(t){var e=Qh(NaN);return t!=null?Og(Er(e),t):Er(e).userInvalidated=!0,e}var VX=Tt.momentProperties=[],V$=!1;function B$(t,e){var n,r,i,s=VX.length;if(Tc(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),Tc(e._i)||(t._i=e._i),Tc(e._f)||(t._f=e._f),Tc(e._l)||(t._l=e._l),Tc(e._strict)||(t._strict=e._strict),Tc(e._tzm)||(t._tzm=e._tzm),Tc(e._isUTC)||(t._isUTC=e._isUTC),Tc(e._offset)||(t._offset=e._offset),Tc(e._pf)||(t._pf=Er(e)),Tc(e._locale)||(t._locale=e._locale),s>0)for(n=0;n<s;n++)r=VX[n],i=e[r],Tc(i)||(t[r]=i);return t}function JR(t){B$(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),V$===!1&&(V$=!0,Tt.updateOffset(this),V$=!1)}function qd(t){return t instanceof JR||t!=null&&t._isAMomentObject!=null}function BX(t){Tt.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function id(t,e){var n=!0;return Og(function(){if(Tt.deprecationHandler!=null&&Tt.deprecationHandler(null,t),n){var r=[],i,s,a,u=arguments.length;for(s=0;s<u;s++){if(i="",typeof arguments[s]=="object"){i+=` [`+s+"] ";for(a in arguments[0])hi(arguments[0],a)&&(i+=a+": "+arguments[0][a]+", ");i=i.slice(0,-2)}else i=arguments[s];r.push(i)}BX(t+` Arguments: `+Array.prototype.slice.call(r).join("")+` `+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var WX={};function UX(t,e){Tt.deprecationHandler!=null&&Tt.deprecationHandler(t,e),WX[t]||(BX(e),WX[t]=!0)}Tt.suppressDeprecationWarnings=!1,Tt.deprecationHandler=null;function Zh(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function i1e(t){var e,n;for(n in t)hi(t,n)&&(e=t[n],Zh(e)?this[n]=e:this["_"+n]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function W$(t,e){var n=Og({},t),r;for(r in e)hi(e,r)&&(rb(t[r])&&rb(e[r])?(n[r]={},Og(n[r],t[r]),Og(n[r],e[r])):e[r]!=null?n[r]=e[r]:delete n[r]);for(r in t)hi(t,r)&&!hi(e,r)&&rb(t[r])&&(n[r]=Og({},n[r]));return n}function U$(t){t!=null&&this.set(t)}var Y$;Object.keys?Y$=Object.keys:Y$=function(t){var e,n=[];for(e in t)hi(t,e)&&n.push(e);return n};var s1e={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function o1e(t,e,n){var r=this._calendar[t]||this._calendar.sameElse;return Zh(r)?r.call(e,n):r}function Jh(t,e,n){var r=""+Math.abs(t),i=e-r.length,s=t>=0;return(s?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var G$=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Jj=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,K$={},xw={};function Fn(t,e,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),t&&(xw[t]=i),e&&(xw[e[0]]=function(){return Jh(i.apply(this,arguments),e[1],e[2])}),n&&(xw[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function a1e(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function l1e(t){var e=t.match(G$),n,r;for(n=0,r=e.length;n<r;n++)xw[e[n]]?e[n]=xw[e[n]]:e[n]=a1e(e[n]);return function(i){var s="",a;for(a=0;a<r;a++)s+=Zh(e[a])?e[a].call(i,t):e[a];return s}}function eM(t,e){return t.isValid()?(e=YX(e,t.localeData()),K$[e]=K$[e]||l1e(e),K$[e](t)):t.localeData().invalidDate()}function YX(t,e){var n=5;function r(i){return e.longDateFormat(i)||i}for(Jj.lastIndex=0;n>=0&&Jj.test(t);)t=t.replace(Jj,r),Jj.lastIndex=0,n-=1;return t}var c1e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function u1e(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(G$).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[t])}var d1e="Invalid date";function h1e(){return this._invalidDate}var f1e="%d",m1e=/\d{1,2}/;function p1e(t){return this._ordinal.replace("%d",t)}var g1e={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function v1e(t,e,n,r){var i=this._relativeTime[n];return Zh(i)?i(t,e,n,r):i.replace(/%d/i,t)}function b1e(t,e){var n=this._relativeTime[t>0?"future":"past"];return Zh(n)?n(e):n.replace(/%s/i,e)}var GX={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function sd(t){return typeof t=="string"?GX[t]||GX[t.toLowerCase()]:void 0}function q$(t){var e={},n,r;for(r in t)hi(t,r)&&(n=sd(r),n&&(e[n]=t[r]));return e}var y1e={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function x1e(t){var e=[],n;for(n in t)hi(t,n)&&e.push({unit:n,priority:y1e[n]});return e.sort(function(r,i){return r.priority-i.priority}),e}var KX=/\d/,fu=/\d\d/,qX=/\d{3}/,X$=/\d{4}/,tM=/[+-]?\d{6}/,cs=/\d\d?/,XX=/\d\d\d\d?/,QX=/\d\d\d\d\d\d?/,nM=/\d{1,3}/,Q$=/\d{1,4}/,rM=/[+-]?\d{1,6}/,ww=/\d+/,iM=/[+-]?\d+/,w1e=/Z|[+-]\d\d:?\d\d/gi,sM=/Z|[+-]\d\d(?::?\d\d)?/gi,C1e=/[+-]?\d+(\.\d{1,3})?/,e_=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Cw=/^[1-9]\d?/,Z$=/^([1-9]\d|\d)/,oM;oM={};function yn(t,e,n){oM[t]=Zh(e)?e:function(r,i){return r&&n?n:e}}function S1e(t,e){return hi(oM,t)?oM[t](e._strict,e._locale):new RegExp(R1e(t))}function R1e(t){return Im(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,r,i,s){return n||r||i||s}))}function Im(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function od(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function Qr(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=od(e)),n}var J$={};function Xi(t,e){var n,r=e,i;for(typeof t=="string"&&(t=[t]),Om(e)&&(r=function(s,a){a[e]=Qr(s)}),i=t.length,n=0;n<i;n++)J$[t[n]]=r}function t_(t,e){Xi(t,function(n,r,i,s){i._w=i._w||{},e(n,i._w,i,s)})}function _1e(t,e,n){e!=null&&hi(J$,t)&&J$[t](e,n._a,n,t)}function aM(t){return t%4===0&&t%100!==0||t%400===0}var cl=0,Dm=1,ef=2,ta=3,Xd=4,Hm=5,ib=6,E1e=7,N1e=8;Fn("Y",0,0,function(){var t=this.year();return t<=9999?Jh(t,4):"+"+t}),Fn(0,["YY",2],0,function(){return this.year()%100}),Fn(0,["YYYY",4],0,"year"),Fn(0,["YYYYY",5],0,"year"),Fn(0,["YYYYYY",6,!0],0,"year"),yn("Y",iM),yn("YY",cs,fu),yn("YYYY",Q$,X$),yn("YYYYY",rM,tM),yn("YYYYYY",rM,tM),Xi(["YYYYY","YYYYYY"],cl),Xi("YYYY",function(t,e){e[cl]=t.length===2?Tt.parseTwoDigitYear(t):Qr(t)}),Xi("YY",function(t,e){e[cl]=Tt.parseTwoDigitYear(t)}),Xi("Y",function(t,e){e[cl]=parseInt(t,10)});function n_(t){return aM(t)?366:365}Tt.parseTwoDigitYear=function(t){return Qr(t)+(Qr(t)>68?1900:2e3)};var ZX=Sw("FullYear",!0);function k1e(){return aM(this.year())}function Sw(t,e){return function(n){return n!=null?(JX(this,t,n),Tt.updateOffset(this,e),this):r_(this,t)}}function r_(t,e){if(!t.isValid())return NaN;var n=t._d,r=t._isUTC;switch(e){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function JX(t,e,n){var r,i,s,a,u;if(!(!t.isValid()||isNaN(n))){switch(r=t._d,i=t._isUTC,e){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}s=n,a=t.month(),u=t.date(),u=u===29&&a===1&&!aM(s)?28:u,i?r.setUTCFullYear(s,a,u):r.setFullYear(s,a,u)}}function T1e(t){return t=sd(t),Zh(this[t])?this[t]():this}function j1e(t,e){if(typeof t=="object"){t=q$(t);var n=x1e(t),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](t[n[r].unit])}else if(t=sd(t),Zh(this[t]))return this[t](e);return this}function M1e(t,e){return(t%e+e)%e}var xo;Array.prototype.indexOf?xo=Array.prototype.indexOf:xo=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function eF(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=M1e(e,12);return t+=(e-n)/12,n===1?aM(t)?29:28:31-n%7%2}Fn("M",["MM",2],"Mo",function(){return this.month()+1}),Fn("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),Fn("MMMM",0,0,function(t){return this.localeData().months(this,t)}),yn("M",cs,Cw),yn("MM",cs,fu),yn("MMM",function(t,e){return e.monthsShortRegex(t)}),yn("MMMM",function(t,e){return e.monthsRegex(t)}),Xi(["M","MM"],function(t,e){e[Dm]=Qr(t)-1}),Xi(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);i!=null?e[Dm]=i:Er(n).invalidMonth=t});var P1e="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),eQ="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),tQ=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,A1e=e_,O1e=e_;function I1e(t,e){return t?Kd(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||tQ).test(e)?"format":"standalone"][t.month()]:Kd(this._months)?this._months:this._months.standalone}function D1e(t,e){return t?Kd(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[tQ.test(e)?"format":"standalone"][t.month()]:Kd(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function H1e(t,e,n){var r,i,s,a=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)s=Qh([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(s,"").toLocaleLowerCase();return n?e==="MMM"?(i=xo.call(this._shortMonthsParse,a),i!==-1?i:null):(i=xo.call(this._longMonthsParse,a),i!==-1?i:null):e==="MMM"?(i=xo.call(this._shortMonthsParse,a),i!==-1?i:(i=xo.call(this._longMonthsParse,a),i!==-1?i:null)):(i=xo.call(this._longMonthsParse,a),i!==-1?i:(i=xo.call(this._shortMonthsParse,a),i!==-1?i:null))}function L1e(t,e,n){var r,i,s;if(this._monthsParseExact)return H1e.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=Qh([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(s="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(s.replace(".",""),"i")),n&&e==="MMMM"&&this._longMonthsParse[r].test(t))return r;if(n&&e==="MMM"&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function nQ(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=Qr(e);else if(e=t.localeData().monthsParse(e),!Om(e))return t}var n=e,r=t.date();return r=r<29?r:Math.min(r,eF(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,r):t._d.setMonth(n,r),t}function rQ(t){return t!=null?(nQ(this,t),Tt.updateOffset(this,!0),this):r_(this,"Month")}function $1e(){return eF(this.year(),this.month())}function F1e(t){return this._monthsParseExact?(hi(this,"_monthsRegex")||iQ.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(hi(this,"_monthsShortRegex")||(this._monthsShortRegex=A1e),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function z1e(t){return this._monthsParseExact?(hi(this,"_monthsRegex")||iQ.call(this),t?this._monthsStrictRegex:this._monthsRegex):(hi(this,"_monthsRegex")||(this._monthsRegex=O1e),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function iQ(){function t(h,m){return m.length-h.length}var e=[],n=[],r=[],i,s,a,u;for(i=0;i<12;i++)s=Qh([2e3,i]),a=Im(this.monthsShort(s,"")),u=Im(this.months(s,"")),e.push(a),n.push(u),r.push(u),r.push(a);e.sort(t),n.sort(t),r.sort(t),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function V1e(t,e,n,r,i,s,a){var u;return t<100&&t>=0?(u=new Date(t+400,e,n,r,i,s,a),isFinite(u.getFullYear())&&u.setFullYear(t)):u=new Date(t,e,n,r,i,s,a),u}function i_(t){var e,n;return t<100&&t>=0?(n=Array.prototype.slice.call(arguments),n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function lM(t,e,n){var r=7+e-n,i=(7+i_(t,0,r).getUTCDay()-e)%7;return-i+r-1}function sQ(t,e,n,r,i){var s=(7+n-r)%7,a=lM(t,r,i),u=1+7*(e-1)+s+a,h,m;return u<=0?(h=t-1,m=n_(h)+u):u>n_(t)?(h=t+1,m=u-n_(t)):(h=t,m=u),{year:h,dayOfYear:m}}function s_(t,e,n){var r=lM(t.year(),e,n),i=Math.floor((t.dayOfYear()-r-1)/7)+1,s,a;return i<1?(a=t.year()-1,s=i+Lm(a,e,n)):i>Lm(t.year(),e,n)?(s=i-Lm(t.year(),e,n),a=t.year()+1):(a=t.year(),s=i),{week:s,year:a}}function Lm(t,e,n){var r=lM(t,e,n),i=lM(t+1,e,n);return(n_(t)-r+i)/7}Fn("w",["ww",2],"wo","week"),Fn("W",["WW",2],"Wo","isoWeek"),yn("w",cs,Cw),yn("ww",cs,fu),yn("W",cs,Cw),yn("WW",cs,fu),t_(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=Qr(t)});function B1e(t){return s_(t,this._week.dow,this._week.doy).week}var W1e={dow:0,doy:6};function U1e(){return this._week.dow}function Y1e(){return this._week.doy}function G1e(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function K1e(t){var e=s_(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}Fn("d",0,"do","day"),Fn("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),Fn("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),Fn("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),Fn("e",0,0,"weekday"),Fn("E",0,0,"isoWeekday"),yn("d",cs),yn("e",cs),yn("E",cs),yn("dd",function(t,e){return e.weekdaysMinRegex(t)}),yn("ddd",function(t,e){return e.weekdaysShortRegex(t)}),yn("dddd",function(t,e){return e.weekdaysRegex(t)}),t_(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);i!=null?e.d=i:Er(n).invalidWeekday=t}),t_(["d","e","E"],function(t,e,n,r){e[r]=Qr(t)});function q1e(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function X1e(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function tF(t,e){return t.slice(e,7).concat(t.slice(0,e))}var Q1e="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),oQ="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Z1e="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),J1e=e_,eRe=e_,tRe=e_;function nRe(t,e){var n=Kd(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?tF(n,this._week.dow):t?n[t.day()]:n}function rRe(t){return t===!0?tF(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function iRe(t){return t===!0?tF(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function sRe(t,e,n){var r,i,s,a=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)s=Qh([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(s,"").toLocaleLowerCase();return n?e==="dddd"?(i=xo.call(this._weekdaysParse,a),i!==-1?i:null):e==="ddd"?(i=xo.call(this._shortWeekdaysParse,a),i!==-1?i:null):(i=xo.call(this._minWeekdaysParse,a),i!==-1?i:null):e==="dddd"?(i=xo.call(this._weekdaysParse,a),i!==-1||(i=xo.call(this._shortWeekdaysParse,a),i!==-1)?i:(i=xo.call(this._minWeekdaysParse,a),i!==-1?i:null)):e==="ddd"?(i=xo.call(this._shortWeekdaysParse,a),i!==-1||(i=xo.call(this._weekdaysParse,a),i!==-1)?i:(i=xo.call(this._minWeekdaysParse,a),i!==-1?i:null)):(i=xo.call(this._minWeekdaysParse,a),i!==-1||(i=xo.call(this._weekdaysParse,a),i!==-1)?i:(i=xo.call(this._shortWeekdaysParse,a),i!==-1?i:null))}function oRe(t,e,n){var r,i,s;if(this._weekdaysParseExact)return sRe.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=Qh([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(s="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(s.replace(".",""),"i")),n&&e==="dddd"&&this._fullWeekdaysParse[r].test(t))return r;if(n&&e==="ddd"&&this._shortWeekdaysParse[r].test(t))return r;if(n&&e==="dd"&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function aRe(t){if(!this.isValid())return t!=null?this:NaN;var e=r_(this,"Day");return t!=null?(t=q1e(t,this.localeData()),this.add(t-e,"d")):e}function lRe(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function cRe(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=X1e(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function uRe(t){return this._weekdaysParseExact?(hi(this,"_weekdaysRegex")||nF.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(hi(this,"_weekdaysRegex")||(this._weekdaysRegex=J1e),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function dRe(t){return this._weekdaysParseExact?(hi(this,"_weekdaysRegex")||nF.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(hi(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=eRe),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function hRe(t){return this._weekdaysParseExact?(hi(this,"_weekdaysRegex")||nF.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(hi(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tRe),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function nF(){function t(g,y){return y.length-g.length}var e=[],n=[],r=[],i=[],s,a,u,h,m;for(s=0;s<7;s++)a=Qh([2e3,1]).day(s),u=Im(this.weekdaysMin(a,"")),h=Im(this.weekdaysShort(a,"")),m=Im(this.weekdays(a,"")),e.push(u),n.push(h),r.push(m),i.push(u),i.push(h),i.push(m);e.sort(t),n.sort(t),r.sort(t),i.sort(t),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function rF(){return this.hours()%12||12}function fRe(){return this.hours()||24}Fn("H",["HH",2],0,"hour"),Fn("h",["hh",2],0,rF),Fn("k",["kk",2],0,fRe),Fn("hmm",0,0,function(){return""+rF.apply(this)+Jh(this.minutes(),2)}),Fn("hmmss",0,0,function(){return""+rF.apply(this)+Jh(this.minutes(),2)+Jh(this.seconds(),2)}),Fn("Hmm",0,0,function(){return""+this.hours()+Jh(this.minutes(),2)}),Fn("Hmmss",0,0,function(){return""+this.hours()+Jh(this.minutes(),2)+Jh(this.seconds(),2)});function aQ(t,e){Fn(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}aQ("a",!0),aQ("A",!1);function lQ(t,e){return e._meridiemParse}yn("a",lQ),yn("A",lQ),yn("H",cs,Z$),yn("h",cs,Cw),yn("k",cs,Cw),yn("HH",cs,fu),yn("hh",cs,fu),yn("kk",cs,fu),yn("hmm",XX),yn("hmmss",QX),yn("Hmm",XX),yn("Hmmss",QX),Xi(["H","HH"],ta),Xi(["k","kk"],function(t,e,n){var r=Qr(t);e[ta]=r===24?0:r}),Xi(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),Xi(["h","hh"],function(t,e,n){e[ta]=Qr(t),Er(n).bigHour=!0}),Xi("hmm",function(t,e,n){var r=t.length-2;e[ta]=Qr(t.substr(0,r)),e[Xd]=Qr(t.substr(r)),Er(n).bigHour=!0}),Xi("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[ta]=Qr(t.substr(0,r)),e[Xd]=Qr(t.substr(r,2)),e[Hm]=Qr(t.substr(i)),Er(n).bigHour=!0}),Xi("Hmm",function(t,e,n){var r=t.length-2;e[ta]=Qr(t.substr(0,r)),e[Xd]=Qr(t.substr(r))}),Xi("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[ta]=Qr(t.substr(0,r)),e[Xd]=Qr(t.substr(r,2)),e[Hm]=Qr(t.substr(i))});function mRe(t){return(t+"").toLowerCase().charAt(0)==="p"}var pRe=/[ap]\.?m?\.?/i,gRe=Sw("Hours",!0);function vRe(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var cQ={calendar:s1e,longDateFormat:c1e,invalidDate:d1e,ordinal:f1e,dayOfMonthOrdinalParse:m1e,relativeTime:g1e,months:P1e,monthsShort:eQ,week:W1e,weekdays:Q1e,weekdaysMin:Z1e,weekdaysShort:oQ,meridiemParse:pRe},xs={},o_={},a_;function bRe(t,e){var n,r=Math.min(t.length,e.length);for(n=0;n<r;n+=1)if(t[n]!==e[n])return n;return r}function uQ(t){return t&&t.toLowerCase().replace("_","-")}function yRe(t){for(var e=0,n,r,i,s;e<t.length;){for(s=uQ(t[e]).split("-"),n=s.length,r=uQ(t[e+1]),r=r?r.split("-"):null;n>0;){if(i=cM(s.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&bRe(s,r)>=n-1)break;n--}e++}return a_}function xRe(t){return!!(t&&t.match("^[^/\\\\]*$"))}function cM(t){var e=null,n;if(xs[t]===void 0&&typeof module<"u"&&module&&module.exports&&xRe(t))try{e=a_._abbr,n=require,n("./locale/"+t),Ig(e)}catch{xs[t]=null}return xs[t]}function Ig(t,e){var n;return t&&(Tc(e)?n=$m(t):n=iF(t,e),n?a_=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),a_._abbr}function iF(t,e){if(e!==null){var n,r=cQ;if(e.abbr=t,xs[t]!=null)UX("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=xs[t]._config;else if(e.parentLocale!=null)if(xs[e.parentLocale]!=null)r=xs[e.parentLocale]._config;else if(n=cM(e.parentLocale),n!=null)r=n._config;else return o_[e.parentLocale]||(o_[e.parentLocale]=[]),o_[e.parentLocale].push({name:t,config:e}),null;return xs[t]=new U$(W$(r,e)),o_[t]&&o_[t].forEach(function(i){iF(i.name,i.config)}),Ig(t),xs[t]}else return delete xs[t],null}function wRe(t,e){if(e!=null){var n,r,i=cQ;xs[t]!=null&&xs[t].parentLocale!=null?xs[t].set(W$(xs[t]._config,e)):(r=cM(t),r!=null&&(i=r._config),e=W$(i,e),r==null&&(e.abbr=t),n=new U$(e),n.parentLocale=xs[t],xs[t]=n),Ig(t)}else xs[t]!=null&&(xs[t].parentLocale!=null?(xs[t]=xs[t].parentLocale,t===Ig()&&Ig(t)):xs[t]!=null&&delete xs[t]);return xs[t]}function $m(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return a_;if(!Kd(t)){if(e=cM(t),e)return e;t=[t]}return yRe(t)}function CRe(){return Y$(xs)}function sF(t){var e,n=t._a;return n&&Er(t).overflow===-2&&(e=n[Dm]<0||n[Dm]>11?Dm:n[ef]<1||n[ef]>eF(n[cl],n[Dm])?ef:n[ta]<0||n[ta]>24||n[ta]===24&&(n[Xd]!==0||n[Hm]!==0||n[ib]!==0)?ta:n[Xd]<0||n[Xd]>59?Xd:n[Hm]<0||n[Hm]>59?Hm:n[ib]<0||n[ib]>999?ib:-1,Er(t)._overflowDayOfYear&&(e<cl||e>ef)&&(e=ef),Er(t)._overflowWeeks&&e===-1&&(e=E1e),Er(t)._overflowWeekday&&e===-1&&(e=N1e),Er(t).overflow=e),t}var SRe=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,RRe=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_Re=/Z|[+-]\d\d(?::?\d\d)?/,uM=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],oF=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ERe=/^\/?Date\((-?\d+)/i,NRe=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,kRe={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function dQ(t){var e,n,r=t._i,i=SRe.exec(r)||RRe.exec(r),s,a,u,h,m=uM.length,g=oF.length;if(i){for(Er(t).iso=!0,e=0,n=m;e<n;e++)if(uM[e][1].exec(i[1])){a=uM[e][0],s=uM[e][2]!==!1;break}if(a==null){t._isValid=!1;return}if(i[3]){for(e=0,n=g;e<n;e++)if(oF[e][1].exec(i[3])){u=(i[2]||" ")+oF[e][0];break}if(u==null){t._isValid=!1;return}}if(!s&&u!=null){t._isValid=!1;return}if(i[4])if(_Re.exec(i[4]))h="Z";else{t._isValid=!1;return}t._f=a+(u||"")+(h||""),lF(t)}else t._isValid=!1}function TRe(t,e,n,r,i,s){var a=[jRe(t),eQ.indexOf(e),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return s&&a.push(parseInt(s,10)),a}function jRe(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function MRe(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function PRe(t,e,n){if(t){var r=oQ.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(r!==i)return Er(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function ARe(t,e,n){if(t)return kRe[t];if(e)return 0;var r=parseInt(n,10),i=r%100,s=(r-i)/100;return s*60+i}function hQ(t){var e=NRe.exec(MRe(t._i)),n;if(e){if(n=TRe(e[4],e[3],e[2],e[5],e[6],e[7]),!PRe(e[1],n,t))return;t._a=n,t._tzm=ARe(e[8],e[9],e[10]),t._d=i_.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),Er(t).rfc2822=!0}else t._isValid=!1}function ORe(t){var e=ERe.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(dQ(t),t._isValid===!1)delete t._isValid;else return;if(hQ(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:Tt.createFromInputFallback(t)}Tt.createFromInputFallback=id("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function Rw(t,e,n){return t??e??n}function IRe(t){var e=new Date(Tt.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function aF(t){var e,n,r=[],i,s,a;if(!t._d){for(i=IRe(t),t._w&&t._a[ef]==null&&t._a[Dm]==null&&DRe(t),t._dayOfYear!=null&&(a=Rw(t._a[cl],i[cl]),(t._dayOfYear>n_(a)||t._dayOfYear===0)&&(Er(t)._overflowDayOfYear=!0),n=i_(a,0,t._dayOfYear),t._a[Dm]=n.getUTCMonth(),t._a[ef]=n.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=r[e]=i[e];for(;e<7;e++)t._a[e]=r[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[ta]===24&&t._a[Xd]===0&&t._a[Hm]===0&&t._a[ib]===0&&(t._nextDay=!0,t._a[ta]=0),t._d=(t._useUTC?i_:V1e).apply(null,r),s=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[ta]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==s&&(Er(t).weekdayMismatch=!0)}}function DRe(t){var e,n,r,i,s,a,u,h,m;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(s=1,a=4,n=Rw(e.GG,t._a[cl],s_(us(),1,4).year),r=Rw(e.W,1),i=Rw(e.E,1),(i<1||i>7)&&(h=!0)):(s=t._locale._week.dow,a=t._locale._week.doy,m=s_(us(),s,a),n=Rw(e.gg,t._a[cl],m.year),r=Rw(e.w,m.week),e.d!=null?(i=e.d,(i<0||i>6)&&(h=!0)):e.e!=null?(i=e.e+s,(e.e<0||e.e>6)&&(h=!0)):i=s),r<1||r>Lm(n,s,a)?Er(t)._overflowWeeks=!0:h!=null?Er(t)._overflowWeekday=!0:(u=sQ(n,r,i,s,a),t._a[cl]=u.year,t._dayOfYear=u.dayOfYear)}Tt.ISO_8601=function(){},Tt.RFC_2822=function(){};function lF(t){if(t._f===Tt.ISO_8601){dQ(t);return}if(t._f===Tt.RFC_2822){hQ(t);return}t._a=[],Er(t).empty=!0;var e=""+t._i,n,r,i,s,a,u=e.length,h=0,m,g;for(i=YX(t._f,t._locale).match(G$)||[],g=i.length,n=0;n<g;n++)s=i[n],r=(e.match(S1e(s,t))||[])[0],r&&(a=e.substr(0,e.indexOf(r)),a.length>0&&Er(t).unusedInput.push(a),e=e.slice(e.indexOf(r)+r.length),h+=r.length),xw[s]?(r?Er(t).empty=!1:Er(t).unusedTokens.push(s),_1e(s,r,t)):t._strict&&!r&&Er(t).unusedTokens.push(s);Er(t).charsLeftOver=u-h,e.length>0&&Er(t).unusedInput.push(e),t._a[ta]<=12&&Er(t).bigHour===!0&&t._a[ta]>0&&(Er(t).bigHour=void 0),Er(t).parsedDateParts=t._a.slice(0),Er(t).meridiem=t._meridiem,t._a[ta]=HRe(t._locale,t._a[ta],t._meridiem),m=Er(t).era,m!==null&&(t._a[cl]=t._locale.erasConvertYear(m,t._a[cl])),aF(t),sF(t)}function HRe(t,e,n){var r;return n==null?e:t.meridiemHour!=null?t.meridiemHour(e,n):(t.isPM!=null&&(r=t.isPM(n),r&&e<12&&(e+=12),!r&&e===12&&(e=0)),e)}function LRe(t){var e,n,r,i,s,a,u=!1,h=t._f.length;if(h===0){Er(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<h;i++)s=0,a=!1,e=B$({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],lF(e),z$(e)&&(a=!0),s+=Er(e).charsLeftOver,s+=Er(e).unusedTokens.length*10,Er(e).score=s,u?s<r&&(r=s,n=e):(r==null||s<r||a)&&(r=s,n=e,a&&(u=!0));Og(t,n||e)}function $Re(t){if(!t._d){var e=q$(t._i),n=e.day===void 0?e.date:e.day;t._a=zX([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),aF(t)}}function FRe(t){var e=new JR(sF(fQ(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function fQ(t){var e=t._i,n=t._f;return t._locale=t._locale||$m(t._l),e===null||n===void 0&&e===""?Zj({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),qd(e)?new JR(sF(e)):(ZR(e)?t._d=e:Kd(n)?LRe(t):n?lF(t):zRe(t),z$(t)||(t._d=null),t))}function zRe(t){var e=t._i;Tc(e)?t._d=new Date(Tt.now()):ZR(e)?t._d=new Date(e.valueOf()):typeof e=="string"?ORe(t):Kd(e)?(t._a=zX(e.slice(0),function(n){return parseInt(n,10)}),aF(t)):rb(e)?$Re(t):Om(e)?t._d=new Date(e):Tt.createFromInputFallback(t)}function mQ(t,e,n,r,i){var s={};return(e===!0||e===!1)&&(r=e,e=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(rb(t)&&$$(t)||Kd(t)&&t.length===0)&&(t=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=i,s._l=n,s._i=t,s._f=e,s._strict=r,FRe(s)}function us(t,e,n,r){return mQ(t,e,n,r,!1)}var VRe=id("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=us.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:Zj()}),BRe=id("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=us.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:Zj()});function pQ(t,e){var n,r;if(e.length===1&&Kd(e[0])&&(e=e[0]),!e.length)return us();for(n=e[0],r=1;r<e.length;++r)(!e[r].isValid()||e[r][t](n))&&(n=e[r]);return n}function WRe(){var t=[].slice.call(arguments,0);return pQ("isBefore",t)}function URe(){var t=[].slice.call(arguments,0);return pQ("isAfter",t)}var YRe=function(){return Date.now?Date.now():+new Date},l_=["year","quarter","month","week","day","hour","minute","second","millisecond"];function GRe(t){var e,n=!1,r,i=l_.length;for(e in t)if(hi(t,e)&&!(xo.call(l_,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(r=0;r<i;++r)if(t[l_[r]]){if(n)return!1;parseFloat(t[l_[r]])!==Qr(t[l_[r]])&&(n=!0)}return!0}function KRe(){return this._isValid}function qRe(){return Qd(NaN)}function dM(t){var e=q$(t),n=e.year||0,r=e.quarter||0,i=e.month||0,s=e.week||e.isoWeek||0,a=e.day||0,u=e.hour||0,h=e.minute||0,m=e.second||0,g=e.millisecond||0;this._isValid=GRe(e),this._milliseconds=+g+m*1e3+h*6e4+u*1e3*60*60,this._days=+a+s*7,this._months=+i+r*3+n*12,this._data={},this._locale=$m(),this._bubble()}function hM(t){return t instanceof dM}function cF(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function XRe(t,e,n){var r=Math.min(t.length,e.length),i=Math.abs(t.length-e.length),s=0,a;for(a=0;a<r;a++)Qr(t[a])!==Qr(e[a])&&s++;return s+i}function gQ(t,e){Fn(t,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+Jh(~~(n/60),2)+e+Jh(~~n%60,2)})}gQ("Z",":"),gQ("ZZ",""),yn("Z",sM),yn("ZZ",sM),Xi(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=uF(sM,t)});var QRe=/([\+\-]|\d\d)/gi;function uF(t,e){var n=(e||"").match(t),r,i,s;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(QRe)||["-",0,0],s=+(i[1]*60)+Qr(i[2]),s===0?0:i[0]==="+"?s:-s)}function dF(t,e){var n,r;return e._isUTC?(n=e.clone(),r=(qd(t)||ZR(t)?t.valueOf():us(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),Tt.updateOffset(n,!1),n):us(t).local()}function hF(t){return-Math.round(t._d.getTimezoneOffset())}Tt.updateOffset=function(){};function ZRe(t,e,n){var r=this._offset||0,i;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=uF(sM,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(i=hF(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?xQ(this,Qd(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,Tt.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:hF(this)}function JRe(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function e_e(t){return this.utcOffset(0,t)}function t_e(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(hF(this),"m")),this}function n_e(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=uF(w1e,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function r_e(t){return this.isValid()?(t=t?us(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function i_e(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function s_e(){if(!Tc(this._isDSTShifted))return this._isDSTShifted;var t={},e;return B$(t,this),t=fQ(t),t._a?(e=t._isUTC?Qh(t._a):us(t._a),this._isDSTShifted=this.isValid()&&XRe(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function o_e(){return this.isValid()?!this._isUTC:!1}function a_e(){return this.isValid()?this._isUTC:!1}function vQ(){return this.isValid()?this._isUTC&&this._offset===0:!1}var l_e=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,c_e=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Qd(t,e){var n=t,r=null,i,s,a;return hM(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:Om(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(r=l_e.exec(t))?(i=r[1]==="-"?-1:1,n={y:0,d:Qr(r[ef])*i,h:Qr(r[ta])*i,m:Qr(r[Xd])*i,s:Qr(r[Hm])*i,ms:Qr(cF(r[ib]*1e3))*i}):(r=c_e.exec(t))?(i=r[1]==="-"?-1:1,n={y:sb(r[2],i),M:sb(r[3],i),w:sb(r[4],i),d:sb(r[5],i),h:sb(r[6],i),m:sb(r[7],i),s:sb(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(a=u_e(us(n.from),us(n.to)),n={},n.ms=a.milliseconds,n.M=a.months),s=new dM(n),hM(t)&&hi(t,"_locale")&&(s._locale=t._locale),hM(t)&&hi(t,"_isValid")&&(s._isValid=t._isValid),s}Qd.fn=dM.prototype,Qd.invalid=qRe;function sb(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function bQ(t,e){var n={};return n.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function u_e(t,e){var n;return t.isValid()&&e.isValid()?(e=dF(e,t),t.isBefore(e)?n=bQ(t,e):(n=bQ(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function yQ(t,e){return function(n,r){var i,s;return r!==null&&!isNaN(+r)&&(UX(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),s=n,n=r,r=s),i=Qd(n,r),xQ(this,i,t),this}}function xQ(t,e,n,r){var i=e._milliseconds,s=cF(e._days),a=cF(e._months);t.isValid()&&(r=r??!0,a&&nQ(t,r_(t,"Month")+a*n),s&&JX(t,"Date",r_(t,"Date")+s*n),i&&t._d.setTime(t._d.valueOf()+i*n),r&&Tt.updateOffset(t,s||a))}var d_e=yQ(1,"add"),h_e=yQ(-1,"subtract");function wQ(t){return typeof t=="string"||t instanceof String}function f_e(t){return qd(t)||ZR(t)||wQ(t)||Om(t)||p_e(t)||m_e(t)||t===null||t===void 0}function m_e(t){var e=rb(t)&&!$$(t),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,s,a=r.length;for(i=0;i<a;i+=1)s=r[i],n=n||hi(t,s);return e&&n}function p_e(t){var e=Kd(t),n=!1;return e&&(n=t.filter(function(r){return!Om(r)&&wQ(t)}).length===0),e&&n}function g_e(t){var e=rb(t)&&!$$(t),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,s;for(i=0;i<r.length;i+=1)s=r[i],n=n||hi(t,s);return e&&n}function v_e(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function b_e(t,e){arguments.length===1&&(arguments[0]?f_e(arguments[0])?(t=arguments[0],e=void 0):g_e(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||us(),r=dF(n,this).startOf("day"),i=Tt.calendarFormat(this,r)||"sameElse",s=e&&(Zh(e[i])?e[i].call(this,n):e[i]);return this.format(s||this.localeData().calendar(i,this,us(n)))}function y_e(){return new JR(this)}function x_e(t,e){var n=qd(t)?t:us(t);return this.isValid()&&n.isValid()?(e=sd(e)||"millisecond",e==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf()):!1}function w_e(t,e){var n=qd(t)?t:us(t);return this.isValid()&&n.isValid()?(e=sd(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function C_e(t,e,n,r){var i=qd(t)?t:us(t),s=qd(e)?e:us(e);return this.isValid()&&i.isValid()&&s.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===")"?this.isBefore(s,n):!this.isAfter(s,n))):!1}function S_e(t,e){var n=qd(t)?t:us(t),r;return this.isValid()&&n.isValid()?(e=sd(e)||"millisecond",e==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(e).valueOf()<=r&&r<=this.clone().endOf(e).valueOf())):!1}function R_e(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function __e(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function E_e(t,e,n){var r,i,s;if(!this.isValid())return NaN;if(r=dF(t,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=sd(e),e){case"year":s=fM(this,r)/12;break;case"month":s=fM(this,r);break;case"quarter":s=fM(this,r)/3;break;case"second":s=(this-r)/1e3;break;case"minute":s=(this-r)/6e4;break;case"hour":s=(this-r)/36e5;break;case"day":s=(this-r-i)/864e5;break;case"week":s=(this-r-i)/6048e5;break;default:s=this-r}return n?s:od(s)}function fM(t,e){if(t.date()<e.date())return-fM(e,t);var n=(e.year()-t.year())*12+(e.month()-t.month()),r=t.clone().add(n,"months"),i,s;return e-r<0?(i=t.clone().add(n-1,"months"),s=(e-r)/(r-i)):(i=t.clone().add(n+1,"months"),s=(e-r)/(i-r)),-(n+s)||0}Tt.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",Tt.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function N_e(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function k_e(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?eM(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Zh(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",eM(n,"Z")):eM(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function T_e(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",n,r,i,s;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),n="["+t+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",s=e+'[")]',this.format(n+r+i+s)}function j_e(t){t||(t=this.isUtc()?Tt.defaultFormatUtc:Tt.defaultFormat);var e=eM(this,t);return this.localeData().postformat(e)}function M_e(t,e){return this.isValid()&&(qd(t)&&t.isValid()||us(t).isValid())?Qd({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function P_e(t){return this.from(us(),t)}function A_e(t,e){return this.isValid()&&(qd(t)&&t.isValid()||us(t).isValid())?Qd({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function O_e(t){return this.to(us(),t)}function CQ(t){var e;return t===void 0?this._locale._abbr:(e=$m(t),e!=null&&(this._locale=e),this)}var SQ=id("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function RQ(){return this._locale}var mM=1e3,_w=60*mM,pM=60*_w,_Q=(365*400+97)*24*pM;function Ew(t,e){return(t%e+e)%e}function EQ(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-_Q:new Date(t,e,n).valueOf()}function NQ(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-_Q:Date.UTC(t,e,n)}function I_e(t){var e,n;if(t=sd(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?NQ:EQ,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=Ew(e+(this._isUTC?0:this.utcOffset()*_w),pM);break;case"minute":e=this._d.valueOf(),e-=Ew(e,_w);break;case"second":e=this._d.valueOf(),e-=Ew(e,mM);break}return this._d.setTime(e),Tt.updateOffset(this,!0),this}function D_e(t){var e,n;if(t=sd(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?NQ:EQ,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=pM-Ew(e+(this._isUTC?0:this.utcOffset()*_w),pM)-1;break;case"minute":e=this._d.valueOf(),e+=_w-Ew(e,_w)-1;break;case"second":e=this._d.valueOf(),e+=mM-Ew(e,mM)-1;break}return this._d.setTime(e),Tt.updateOffset(this,!0),this}function H_e(){return this._d.valueOf()-(this._offset||0)*6e4}function L_e(){return Math.floor(this.valueOf()/1e3)}function $_e(){return new Date(this.valueOf())}function F_e(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function z_e(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function V_e(){return this.isValid()?this.toISOString():null}function B_e(){return z$(this)}function W_e(){return Og({},Er(this))}function U_e(){return Er(this).overflow}function Y_e(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Fn("N",0,0,"eraAbbr"),Fn("NN",0,0,"eraAbbr"),Fn("NNN",0,0,"eraAbbr"),Fn("NNNN",0,0,"eraName"),Fn("NNNNN",0,0,"eraNarrow"),Fn("y",["y",1],"yo","eraYear"),Fn("y",["yy",2],0,"eraYear"),Fn("y",["yyy",3],0,"eraYear"),Fn("y",["yyyy",4],0,"eraYear"),yn("N",fF),yn("NN",fF),yn("NNN",fF),yn("NNNN",rEe),yn("NNNNN",iEe),Xi(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?Er(n).era=i:Er(n).invalidEra=t}),yn("y",ww),yn("yy",ww),yn("yyy",ww),yn("yyyy",ww),yn("yo",sEe),Xi(["y","yy","yyy","yyyy"],cl),Xi(["yo"],function(t,e,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[cl]=n._locale.eraYearOrdinalParse(t,i):e[cl]=parseInt(t,10)});function G_e(t,e){var n,r,i,s=this._eras||$m("en")._eras;for(n=0,r=s.length;n<r;++n){switch(typeof s[n].since){case"string":i=Tt(s[n].since).startOf("day"),s[n].since=i.valueOf();break}switch(typeof s[n].until){case"undefined":s[n].until=1/0;break;case"string":i=Tt(s[n].until).startOf("day").valueOf(),s[n].until=i.valueOf();break}}return s}function K_e(t,e,n){var r,i,s=this.eras(),a,u,h;for(t=t.toUpperCase(),r=0,i=s.length;r<i;++r)if(a=s[r].name.toUpperCase(),u=s[r].abbr.toUpperCase(),h=s[r].narrow.toUpperCase(),n)switch(e){case"N":case"NN":case"NNN":if(u===t)return s[r];break;case"NNNN":if(a===t)return s[r];break;case"NNNNN":if(h===t)return s[r];break}else if([a,u,h].indexOf(t)>=0)return s[r]}function q_e(t,e){var n=t.since<=t.until?1:-1;return e===void 0?Tt(t.since).year():Tt(t.since).year()+(e-t.offset)*n}function X_e(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].name;return""}function Q_e(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].narrow;return""}function Z_e(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].abbr;return""}function J_e(){var t,e,n,r,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(n=i[t].since<=i[t].until?1:-1,r=this.clone().startOf("day").valueOf(),i[t].since<=r&&r<=i[t].until||i[t].until<=r&&r<=i[t].since)return(this.year()-Tt(i[t].since).year())*n+i[t].offset;return this.year()}function eEe(t){return hi(this,"_erasNameRegex")||mF.call(this),t?this._erasNameRegex:this._erasRegex}function tEe(t){return hi(this,"_erasAbbrRegex")||mF.call(this),t?this._erasAbbrRegex:this._erasRegex}function nEe(t){return hi(this,"_erasNarrowRegex")||mF.call(this),t?this._erasNarrowRegex:this._erasRegex}function fF(t,e){return e.erasAbbrRegex(t)}function rEe(t,e){return e.erasNameRegex(t)}function iEe(t,e){return e.erasNarrowRegex(t)}function sEe(t,e){return e._eraYearOrdinalRegex||ww}function mF(){var t=[],e=[],n=[],r=[],i,s,a,u,h,m=this.eras();for(i=0,s=m.length;i<s;++i)a=Im(m[i].name),u=Im(m[i].abbr),h=Im(m[i].narrow),e.push(a),t.push(u),n.push(h),r.push(a),r.push(u),r.push(h);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}Fn(0,["gg",2],0,function(){return this.weekYear()%100}),Fn(0,["GG",2],0,function(){return this.isoWeekYear()%100});function gM(t,e){Fn(0,[t,t.length],0,e)}gM("gggg","weekYear"),gM("ggggg","weekYear"),gM("GGGG","isoWeekYear"),gM("GGGGG","isoWeekYear"),yn("G",iM),yn("g",iM),yn("GG",cs,fu),yn("gg",cs,fu),yn("GGGG",Q$,X$),yn("gggg",Q$,X$),yn("GGGGG",rM,tM),yn("ggggg",rM,tM),t_(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=Qr(t)}),t_(["gg","GG"],function(t,e,n,r){e[r]=Tt.parseTwoDigitYear(t)});function oEe(t){return kQ.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function aEe(t){return kQ.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function lEe(){return Lm(this.year(),1,4)}function cEe(){return Lm(this.isoWeekYear(),1,4)}function uEe(){var t=this.localeData()._week;return Lm(this.year(),t.dow,t.doy)}function dEe(){var t=this.localeData()._week;return Lm(this.weekYear(),t.dow,t.doy)}function kQ(t,e,n,r,i){var s;return t==null?s_(this,r,i).year:(s=Lm(t,r,i),e>s&&(e=s),hEe.call(this,t,e,n,r,i))}function hEe(t,e,n,r,i){var s=sQ(t,e,n,r,i),a=i_(s.year,0,s.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}Fn("Q",0,"Qo","quarter"),yn("Q",KX),Xi("Q",function(t,e){e[Dm]=(Qr(t)-1)*3});function fEe(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}Fn("D",["DD",2],"Do","date"),yn("D",cs,Cw),yn("DD",cs,fu),yn("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),Xi(["D","DD"],ef),Xi("Do",function(t,e){e[ef]=Qr(t.match(cs)[0])});var TQ=Sw("Date",!0);Fn("DDD",["DDDD",3],"DDDo","dayOfYear"),yn("DDD",nM),yn("DDDD",qX),Xi(["DDD","DDDD"],function(t,e,n){n._dayOfYear=Qr(t)});function mEe(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}Fn("m",["mm",2],0,"minute"),yn("m",cs,Z$),yn("mm",cs,fu),Xi(["m","mm"],Xd);var pEe=Sw("Minutes",!1);Fn("s",["ss",2],0,"second"),yn("s",cs,Z$),yn("ss",cs,fu),Xi(["s","ss"],Hm);var gEe=Sw("Seconds",!1);Fn("S",0,0,function(){return~~(this.millisecond()/100)}),Fn(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Fn(0,["SSS",3],0,"millisecond"),Fn(0,["SSSS",4],0,function(){return this.millisecond()*10}),Fn(0,["SSSSS",5],0,function(){return this.millisecond()*100}),Fn(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),Fn(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),Fn(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),Fn(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),yn("S",nM,KX),yn("SS",nM,fu),yn("SSS",nM,qX);var Dg,jQ;for(Dg="SSSS";Dg.length<=9;Dg+="S")yn(Dg,ww);function vEe(t,e){e[ib]=Qr(("0."+t)*1e3)}for(Dg="S";Dg.length<=9;Dg+="S")Xi(Dg,vEe);jQ=Sw("Milliseconds",!1),Fn("z",0,0,"zoneAbbr"),Fn("zz",0,0,"zoneName");function bEe(){return this._isUTC?"UTC":""}function yEe(){return this._isUTC?"Coordinated Universal Time":""}var Dt=JR.prototype;Dt.add=d_e,Dt.calendar=b_e,Dt.clone=y_e,Dt.diff=E_e,Dt.endOf=D_e,Dt.format=j_e,Dt.from=M_e,Dt.fromNow=P_e,Dt.to=A_e,Dt.toNow=O_e,Dt.get=T1e,Dt.invalidAt=U_e,Dt.isAfter=x_e,Dt.isBefore=w_e,Dt.isBetween=C_e,Dt.isSame=S_e,Dt.isSameOrAfter=R_e,Dt.isSameOrBefore=__e,Dt.isValid=B_e,Dt.lang=SQ,Dt.locale=CQ,Dt.localeData=RQ,Dt.max=BRe,Dt.min=VRe,Dt.parsingFlags=W_e,Dt.set=j1e,Dt.startOf=I_e,Dt.subtract=h_e,Dt.toArray=F_e,Dt.toObject=z_e,Dt.toDate=$_e,Dt.toISOString=k_e,Dt.inspect=T_e,typeof Symbol<"u"&&Symbol.for!=null&&(Dt[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Dt.toJSON=V_e,Dt.toString=N_e,Dt.unix=L_e,Dt.valueOf=H_e,Dt.creationData=Y_e,Dt.eraName=X_e,Dt.eraNarrow=Q_e,Dt.eraAbbr=Z_e,Dt.eraYear=J_e,Dt.year=ZX,Dt.isLeapYear=k1e,Dt.weekYear=oEe,Dt.isoWeekYear=aEe,Dt.quarter=Dt.quarters=fEe,Dt.month=rQ,Dt.daysInMonth=$1e,Dt.week=Dt.weeks=G1e,Dt.isoWeek=Dt.isoWeeks=K1e,Dt.weeksInYear=uEe,Dt.weeksInWeekYear=dEe,Dt.isoWeeksInYear=lEe,Dt.isoWeeksInISOWeekYear=cEe,Dt.date=TQ,Dt.day=Dt.days=aRe,Dt.weekday=lRe,Dt.isoWeekday=cRe,Dt.dayOfYear=mEe,Dt.hour=Dt.hours=gRe,Dt.minute=Dt.minutes=pEe,Dt.second=Dt.seconds=gEe,Dt.millisecond=Dt.milliseconds=jQ,Dt.utcOffset=ZRe,Dt.utc=e_e,Dt.local=t_e,Dt.parseZone=n_e,Dt.hasAlignedHourOffset=r_e,Dt.isDST=i_e,Dt.isLocal=o_e,Dt.isUtcOffset=a_e,Dt.isUtc=vQ,Dt.isUTC=vQ,Dt.zoneAbbr=bEe,Dt.zoneName=yEe,Dt.dates=id("dates accessor is deprecated. Use date instead.",TQ),Dt.months=id("months accessor is deprecated. Use month instead",rQ),Dt.years=id("years accessor is deprecated. Use year instead",ZX),Dt.zone=id("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",JRe),Dt.isDSTShifted=id("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",s_e);function xEe(t){return us(t*1e3)}function wEe(){return us.apply(null,arguments).parseZone()}function MQ(t){return t}var fi=U$.prototype;fi.calendar=o1e,fi.longDateFormat=u1e,fi.invalidDate=h1e,fi.ordinal=p1e,fi.preparse=MQ,fi.postformat=MQ,fi.relativeTime=v1e,fi.pastFuture=b1e,fi.set=i1e,fi.eras=G_e,fi.erasParse=K_e,fi.erasConvertYear=q_e,fi.erasAbbrRegex=tEe,fi.erasNameRegex=eEe,fi.erasNarrowRegex=nEe,fi.months=I1e,fi.monthsShort=D1e,fi.monthsParse=L1e,fi.monthsRegex=z1e,fi.monthsShortRegex=F1e,fi.week=B1e,fi.firstDayOfYear=Y1e,fi.firstDayOfWeek=U1e,fi.weekdays=nRe,fi.weekdaysMin=iRe,fi.weekdaysShort=rRe,fi.weekdaysParse=oRe,fi.weekdaysRegex=uRe,fi.weekdaysShortRegex=dRe,fi.weekdaysMinRegex=hRe,fi.isPM=mRe,fi.meridiem=vRe;function vM(t,e,n,r){var i=$m(),s=Qh().set(r,e);return i[n](s,t)}function PQ(t,e,n){if(Om(t)&&(e=t,t=void 0),t=t||"",e!=null)return vM(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=vM(t,r,n,"month");return i}function pF(t,e,n,r){typeof t=="boolean"?(Om(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,Om(e)&&(n=e,e=void 0),e=e||"");var i=$m(),s=t?i._week.dow:0,a,u=[];if(n!=null)return vM(e,(n+s)%7,r,"day");for(a=0;a<7;a++)u[a]=vM(e,(a+s)%7,r,"day");return u}function CEe(t,e){return PQ(t,e,"months")}function SEe(t,e){return PQ(t,e,"monthsShort")}function REe(t,e,n){return pF(t,e,n,"weekdays")}function _Ee(t,e,n){return pF(t,e,n,"weekdaysShort")}function EEe(t,e,n){return pF(t,e,n,"weekdaysMin")}Ig("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=Qr(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}}),Tt.lang=id("moment.lang is deprecated. Use moment.locale instead.",Ig),Tt.langData=id("moment.langData is deprecated. Use moment.localeData instead.",$m);var Fm=Math.abs;function NEe(){var t=this._data;return this._milliseconds=Fm(this._milliseconds),this._days=Fm(this._days),this._months=Fm(this._months),t.milliseconds=Fm(t.milliseconds),t.seconds=Fm(t.seconds),t.minutes=Fm(t.minutes),t.hours=Fm(t.hours),t.months=Fm(t.months),t.years=Fm(t.years),this}function AQ(t,e,n,r){var i=Qd(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function kEe(t,e){return AQ(this,t,e,1)}function TEe(t,e){return AQ(this,t,e,-1)}function OQ(t){return t<0?Math.floor(t):Math.ceil(t)}function jEe(){var t=this._milliseconds,e=this._days,n=this._months,r=this._data,i,s,a,u,h;return t>=0&&e>=0&&n>=0||t<=0&&e<=0&&n<=0||(t+=OQ(gF(n)+e)*864e5,e=0,n=0),r.milliseconds=t%1e3,i=od(t/1e3),r.seconds=i%60,s=od(i/60),r.minutes=s%60,a=od(s/60),r.hours=a%24,e+=od(a/24),h=od(IQ(e)),n+=h,e-=OQ(gF(h)),u=od(n/12),n%=12,r.days=e,r.months=n,r.years=u,this}function IQ(t){return t*4800/146097}function gF(t){return t*146097/4800}function MEe(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if(t=sd(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+r/864e5,n=this._months+IQ(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(gF(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return e*24+r/36e5;case"minute":return e*1440+r/6e4;case"second":return e*86400+r/1e3;case"millisecond":return Math.floor(e*864e5)+r;default:throw new Error("Unknown unit "+t)}}function zm(t){return function(){return this.as(t)}}var DQ=zm("ms"),PEe=zm("s"),AEe=zm("m"),OEe=zm("h"),IEe=zm("d"),DEe=zm("w"),HEe=zm("M"),LEe=zm("Q"),$Ee=zm("y"),FEe=DQ;function zEe(){return Qd(this)}function VEe(t){return t=sd(t),this.isValid()?this[t+"s"]():NaN}function ob(t){return function(){return this.isValid()?this._data[t]:NaN}}var BEe=ob("milliseconds"),WEe=ob("seconds"),UEe=ob("minutes"),YEe=ob("hours"),GEe=ob("days"),KEe=ob("months"),qEe=ob("years");function XEe(){return od(this.days()/7)}var Vm=Math.round,Nw={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function QEe(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function ZEe(t,e,n,r){var i=Qd(t).abs(),s=Vm(i.as("s")),a=Vm(i.as("m")),u=Vm(i.as("h")),h=Vm(i.as("d")),m=Vm(i.as("M")),g=Vm(i.as("w")),y=Vm(i.as("y")),x=s<=n.ss&&["s",s]||s<n.s&&["ss",s]||a<=1&&["m"]||a<n.m&&["mm",a]||u<=1&&["h"]||u<n.h&&["hh",u]||h<=1&&["d"]||h<n.d&&["dd",h];return n.w!=null&&(x=x||g<=1&&["w"]||g<n.w&&["ww",g]),x=x||m<=1&&["M"]||m<n.M&&["MM",m]||y<=1&&["y"]||["yy",y],x[2]=e,x[3]=+t>0,x[4]=r,QEe.apply(null,x)}function JEe(t){return t===void 0?Vm:typeof t=="function"?(Vm=t,!0):!1}function eNe(t,e){return Nw[t]===void 0?!1:e===void 0?Nw[t]:(Nw[t]=e,t==="s"&&(Nw.ss=e-1),!0)}function tNe(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=Nw,i,s;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(r=Object.assign({},Nw,e),e.s!=null&&e.ss==null&&(r.ss=e.s-1)),i=this.localeData(),s=ZEe(this,!n,r,i),n&&(s=i.pastFuture(+this,s)),i.postformat(s)}var vF=Math.abs;function kw(t){return(t>0)-(t<0)||+t}function bM(){if(!this.isValid())return this.localeData().invalidDate();var t=vF(this._milliseconds)/1e3,e=vF(this._days),n=vF(this._months),r,i,s,a,u=this.asSeconds(),h,m,g,y;return u?(r=od(t/60),i=od(r/60),t%=60,r%=60,s=od(n/12),n%=12,a=t?t.toFixed(3).replace(/\.?0+$/,""):"",h=u<0?"-":"",m=kw(this._months)!==kw(u)?"-":"",g=kw(this._days)!==kw(u)?"-":"",y=kw(this._milliseconds)!==kw(u)?"-":"",h+"P"+(s?m+s+"Y":"")+(n?m+n+"M":"")+(e?g+e+"D":"")+(i||r||t?"T":"")+(i?y+i+"H":"")+(r?y+r+"M":"")+(t?y+a+"S":"")):"P0D"}var ii=dM.prototype;ii.isValid=KRe,ii.abs=NEe,ii.add=kEe,ii.subtract=TEe,ii.as=MEe,ii.asMilliseconds=DQ,ii.asSeconds=PEe,ii.asMinutes=AEe,ii.asHours=OEe,ii.asDays=IEe,ii.asWeeks=DEe,ii.asMonths=HEe,ii.asQuarters=LEe,ii.asYears=$Ee,ii.valueOf=FEe,ii._bubble=jEe,ii.clone=zEe,ii.get=VEe,ii.milliseconds=BEe,ii.seconds=WEe,ii.minutes=UEe,ii.hours=YEe,ii.days=GEe,ii.weeks=XEe,ii.months=KEe,ii.years=qEe,ii.humanize=tNe,ii.toISOString=bM,ii.toString=bM,ii.toJSON=bM,ii.locale=CQ,ii.localeData=RQ,ii.toIsoString=id("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",bM),ii.lang=SQ,Fn("X",0,0,"unix"),Fn("x",0,0,"valueOf"),yn("x",iM),yn("X",C1e),Xi("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)}),Xi("x",function(t,e,n){n._d=new Date(Qr(t))});//! moment.js Tt.version="2.30.1",n1e(us),Tt.fn=Dt,Tt.min=WRe,Tt.max=URe,Tt.now=YRe,Tt.utc=Qh,Tt.unix=xEe,Tt.months=CEe,Tt.isDate=ZR,Tt.locale=Ig,Tt.invalid=Zj,Tt.duration=Qd,Tt.isMoment=qd,Tt.weekdays=REe,Tt.parseZone=wEe,Tt.localeData=$m,Tt.isDuration=hM,Tt.monthsShort=SEe,Tt.weekdaysMin=EEe,Tt.defineLocale=iF,Tt.updateLocale=wRe,Tt.locales=CRe,Tt.weekdaysShort=_Ee,Tt.normalizeUnits=sd,Tt.relativeTimeRounding=JEe,Tt.relativeTimeThreshold=eNe,Tt.calendarFormat=v_e,Tt.prototype=Dt,Tt.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};/*! * Pikaday * * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday */const Hg=()=>window,ad=()=>window.document,bF=(t,e)=>window.setTimeout(t,e),tf=function(t,e,n,r){t.addEventListener(e,n,!!r)},Bm=function(t,e,n,r){t.removeEventListener(e,n,!!r)},nNe=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},mu=function(t,e){return(" "+t.className+" ").indexOf(" "+e+" ")!==-1},yF=function(t,e){mu(t,e)||(t.className=t.className===""?e:t.className+" "+e)},xF=function(t,e){t.className=nNe((" "+t.className+" ").replace(" "+e+" "," "))},wF=function(t){return/Array/.test(Object.prototype.toString.call(t))},pu=function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())},rNe=function(t){let e=t.getDay();return e===0||e===6},iNe=function(t){return t%4===0&&t%100!==0||t%400===0},HQ=function(t,e){return[31,iNe(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},yM=function(t){pu(t)&&t.setHours(0,0,0,0)},xM=function(t,e){return t.getTime()===e.getTime()},wM=function(t,e,n){let r,i;for(r in e)i=t[r]!==void 0,i&&typeof e[r]=="object"&&e[r]!==null&&e[r].nodeName===void 0?pu(e[r])?n&&(t[r]=new Date(e[r].getTime())):wF(e[r])?n&&(t[r]=e[r].slice(0)):t[r]=wM({},e[r],n):(n||!i)&&(t[r]=e[r]);return t},LQ=function(t,e,n){let r=ad().createEvent("HTMLEvents");r.initEvent(e,!0,!1),r=wM(r,n),t.dispatchEvent(r)},$Q=function(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t},nf={field:null,bound:void 0,ariaLabel:"Use the arrow keys to pick a date",position:"bottom left",reposition:!0,format:"YYYY-MM-DD",toString:null,parse:null,defaultDate:null,setDefaultDate:!1,firstDay:0,firstWeekOfYearMinDays:4,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,pickWholeWeek:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,enableSelectionDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,blurFieldOnSelect:!0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null,keyboardInput:!0},FQ=function(t,e,n){for(e+=t.firstDay;e>=7;)e-=7;return n?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},sNe=function(t){let e=[],n="false";if(t.isEmpty)if(t.showDaysInNextAndPreviousMonths)e.push("is-outside-current-month"),t.enableSelectionDaysInNextAndPreviousMonths||e.push("is-selection-disabled");else return'<td class="is-empty"></td>';return t.isDisabled&&e.push("is-disabled"),t.isToday&&e.push("is-today"),t.isSelected&&(e.push("is-selected"),n="true"),t.hasEvent&&e.push("has-event"),t.isInRange&&e.push("is-inrange"),t.isStartRange&&e.push("is-startrange"),t.isEndRange&&e.push("is-endrange"),'<td data-day="'+t.day+'" class="'+e.join(" ")+'" aria-selected="'+n+'"><button class="pika-button pika-day" type="button" data-pika-year="'+t.year+'" data-pika-month="'+t.month+'" data-pika-day="'+t.day+'">'+t.day+"</button></td>"},oNe=function(t,e){t.setHours(0,0,0,0);let n=t.getDate(),r=t.getDay(),i=e,s=i-1,a=7,u=function(x){return(x+a-1)%a};t.setDate(n+s-u(r));let h=new Date(t.getFullYear(),0,i),m=24*60*60*1e3,g=(t.getTime()-h.getTime())/m;return 1+Math.round((g-s+u(h.getDay()))/a)},aNe=function(t,e,n,r,i){let s=new Date(r,n,e);return'<td class="pika-week">'+(t.hasMoment?t.moment(s).isoWeek():oNe(s,i))+"</td>"},lNe=function(t,e,n,r){return'<tr class="pika-row'+(n?" pick-whole-week":"")+(r?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"},cNe=function(t){return"<tbody>"+t.join("")+"</tbody>"},uNe=function(t){let e,n=[];for(t.showWeekNumber&&n.push("<th></th>"),e=0;e<7;e++)n.push('<th scope="col"><abbr title="'+FQ(t,e)+'">'+FQ(t,e,!0)+"</abbr></th>");return"<thead><tr>"+(t.isRTL?n.reverse():n).join("")+"</tr></thead>"},dNe=function(t,e,n,r,i,s){let a,u,h,m=t._o,g=n===m.minYear,y=n===m.maxYear,x='<div id="'+s+'" class="pika-title" role="heading" aria-live="polite">',C,E,M=!0,j=!0;for(h=[],a=0;a<12;a++)h.push('<option value="'+(n===i?a-e:12+a-e)+'"'+(a===r?' selected="selected"':"")+(g&&a<m.minMonth||y&&a>m.maxMonth?' disabled="disabled"':"")+">"+m.i18n.months[a]+"</option>");for(C='<div class="pika-label">'+m.i18n.months[r]+'<select class="pika-select pika-select-month" tabindex="-1">'+h.join("")+"</select></div>",wF(m.yearRange)?(a=m.yearRange[0],u=m.yearRange[1]+1):(a=n-m.yearRange,u=1+n+m.yearRange),h=[];a<u&&a<=m.maxYear;a++)a>=m.minYear&&h.push('<option value="'+a+'"'+(a===n?' selected="selected"':"")+">"+a+"</option>");return E='<div class="pika-label">'+n+m.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+h.join("")+"</select></div>",m.showMonthAfterYear?x+=E+C:x+=C+E,g&&(r===0||m.minMonth>=r)&&(M=!1),y&&(r===11||m.maxMonth<=r)&&(j=!1),e===0&&(x+='<button class="pika-prev'+(M?"":" is-disabled")+'" type="button">'+m.i18n.previousMonth+"</button>"),e===t._o.numberOfMonths-1&&(x+='<button class="pika-next'+(j?"":" is-disabled")+'" type="button">'+m.i18n.nextMonth+"</button>"),x+="</div>"},hNe=function(t,e,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+uNe(t)+cNe(e)+"</table>"};function CF(t){let e=this,n=e.config(t);e._onMouseDown=function(i){if(!e._v)return;i=i||Hg().event;let s=i.target||i.srcElement;if(s)if(mu(s,"is-disabled")||(mu(s,"pika-button")&&!mu(s,"is-empty")&&!mu(s.parentNode,"is-disabled")?(e.setDate(new Date(s.getAttribute("data-pika-year"),s.getAttribute("data-pika-month"),s.getAttribute("data-pika-day"))),n.bound&&bF(function(){e.hide(),n.blurFieldOnSelect&&n.field&&n.field.blur()},100)):mu(s,"pika-prev")?e.prevMonth():mu(s,"pika-next")&&e.nextMonth()),mu(s,"pika-select"))e._c=!0;else if(i.preventDefault)i.preventDefault();else return i.returnValue=!1,!1},e._onChange=function(i){i=i||Hg().event;let s=i.target||i.srcElement;s&&(mu(s,"pika-select-month")?e.gotoMonth(s.value):mu(s,"pika-select-year")&&e.gotoYear(s.value))},e._onKeyChange=function(i){if(i=i||Hg().event,e.isVisible())switch(i.keyCode){case 13:case 27:n.field&&n.field.blur();break;case 37:e.adjustDate("subtract",1);break;case 38:e.adjustDate("subtract",7);break;case 39:e.adjustDate("add",1);break;case 40:e.adjustDate("add",7);break;case 8:case 46:e.setDate(null);break}},e._parseFieldValue=function(){if(n.parse)return n.parse(n.field.value,n.format);if(this.hasMoment){let i=this.moment(n.field.value,n.format,n.formatStrict);return i&&i.isValid()?i.toDate():null}else return new Date(Date.parse(n.field.value))},e._onInputChange=function(i){let s;i.firedBy!==e&&(s=e._parseFieldValue(),pu(s)&&e.setDate(s),e._v||e.show())},e._onInputFocus=function(){e.show()},e._onInputClick=function(){e.show()},e._onInputBlur=function(){let i=ad().activeElement;do if(mu(i,"pika-single"))return;while(i=i.parentNode);e._c||(e._b=bF(function(){e.hide()},50)),e._c=!1},e._onClick=function(i){i=i||Hg().event;let s=i.target||i.srcElement,a=s;if(s){!hasEventListeners&&mu(s,"pika-select")&&(s.onchange||(s.setAttribute("onchange","return;"),tf(s,"change",e._onChange)));do if(mu(a,"pika-single")||a===n.trigger)return;while(a=a.parentNode);e._v&&s!==n.trigger&&a!==n.trigger&&e.hide()}},e.el=ad().createElement("div"),e.el.className="pika-single"+(n.isRTL?" is-rtl":"")+(n.theme?" "+n.theme:""),tf(e.el,"mousedown",e._onMouseDown,!0),tf(e.el,"touchend",e._onMouseDown,!0),tf(e.el,"change",e._onChange),n.keyboardInput&&tf(ad(),"keydown",e._onKeyChange),n.field&&(n.container?n.container.appendChild(e.el):n.bound?ad().body.appendChild(e.el):n.field.parentNode.insertBefore(e.el,n.field.nextSibling),tf(n.field,"change",e._onInputChange),n.defaultDate||(n.defaultDate=e._parseFieldValue(),n.setDefaultDate=!0));let r=n.defaultDate;pu(r)?n.setDefaultDate?e.setDate(r,!0):e.gotoDate(r):e.gotoDate(new Date),n.bound?(this.hide(),e.el.className+=" is-bound",tf(n.trigger,"click",e._onInputClick),tf(n.trigger,"focus",e._onInputFocus),tf(n.trigger,"blur",e._onInputBlur)):this.show()}CF.prototype={config:function(t){this._o||(this._o=wM({},nf,!0));let e=wM(this._o,t,!0);e.isRTL=!!e.isRTL,e.field=e.field&&e.field.nodeName?e.field:null,e.theme=typeof e.theme=="string"&&e.theme?e.theme:null,e.bound=!!(e.bound!==void 0?e.field&&e.bound:e.field),e.trigger=e.trigger&&e.trigger.nodeName?e.trigger:e.field,e.disableWeekends=!!e.disableWeekends,e.disableDayFn=typeof e.disableDayFn=="function"?e.disableDayFn:null;let n=parseInt(e.numberOfMonths,10)||1;if(e.numberOfMonths=n>4?4:n,pu(e.minDate)||(e.minDate=!1),pu(e.maxDate)||(e.maxDate=!1),e.minDate&&e.maxDate&&e.maxDate<e.minDate&&(e.maxDate=e.minDate=!1),e.minDate&&this.setMinDate(e.minDate),e.maxDate&&this.setMaxDate(e.maxDate),wF(e.yearRange)){let r=new Date().getFullYear()-10;e.yearRange[0]=parseInt(e.yearRange[0],10)||r,e.yearRange[1]=parseInt(e.yearRange[1],10)||r}else e.yearRange=Math.abs(parseInt(e.yearRange,10))||nf.yearRange,e.yearRange>100&&(e.yearRange=100);return e},toString:function(t){return t=t||this._o.format,pu(this._d)?this._o.toString?this._o.toString(this._d,t):this.hasMoment?this.moment(this._d).format(t):this._d.toDateString():""},getMoment:function(){return this.hasMoment?this.moment(this._d):null},setMoment:function(t,e){this.hasMoment&&this.moment.isMoment(t)&&this.setDate(t.toDate(),e)},useMoment:function(t){this.hasMoment=!0,this.moment=t},getDate:function(){return pu(this._d)?new Date(this._d.getTime()):null},setDate:function(t,e){if(!t)return this._d=null,this._o.field&&(this._o.field.value="",LQ(this._o.field,"change",{firedBy:this})),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!pu(t))return;let n=this._o.minDate,r=this._o.maxDate;pu(n)&&t<n?t=n:pu(r)&&t>r&&(t=r),this._d=new Date(t.getTime()),yM(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),LQ(this._o.field,"change",{firedBy:this})),!e&&typeof this._o.onSelect=="function"&&this._o.onSelect.call(this,this.getDate())},clear:function(){this.setDate(null)},gotoDate:function(t){let e=!0;if(pu(t)){if(this.calendars){let n=new Date(this.calendars[0].year,this.calendars[0].month,1),r=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),i=t.getTime();r.setMonth(r.getMonth()+1),r.setDate(r.getDate()-1),e=i<n.getTime()||r.getTime()<i}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}],this._o.mainCalendar==="right"&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(t,e){let n=this.getDate()||new Date,r=parseInt(e)*24*60*60*1e3,i;t==="add"?i=new Date(n.valueOf()+r):t==="subtract"&&(i=new Date(n.valueOf()-r)),this.setDate(i)},adjustCalendars:function(){this.calendars[0]=$Q(this.calendars[0]);for(let t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=$Q({month:this.calendars[0].month+t,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())},setMinDate:function(t){t instanceof Date?(yM(t),this._o.minDate=t,this._o.minYear=t.getFullYear(),this._o.minMonth=t.getMonth()):(this._o.minDate=nf.minDate,this._o.minYear=nf.minYear,this._o.minMonth=nf.minMonth,this._o.startRange=nf.startRange),this.draw()},setMaxDate:function(t){t instanceof Date?(yM(t),this._o.maxDate=t,this._o.maxYear=t.getFullYear(),this._o.maxMonth=t.getMonth()):(this._o.maxDate=nf.maxDate,this._o.maxYear=nf.maxYear,this._o.maxMonth=nf.maxMonth,this._o.endRange=nf.endRange),this.draw()},setStartRange:function(t){this._o.startRange=t},setEndRange:function(t){this._o.endRange=t},draw:function(t){if(!this._v&&!t)return;let e=this._o,n=e.minYear,r=e.maxYear,i=e.minMonth,s=e.maxMonth,a="",u;this._y<=n&&(this._y=n,!isNaN(i)&&this._m<i&&(this._m=i)),this._y>=r&&(this._y=r,!isNaN(s)&&this._m>s&&(this._m=s));for(let h=0;h<e.numberOfMonths;h++)u="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2),a+='<div class="pika-lendar">'+dNe(this,h,this.calendars[h].year,this.calendars[h].month,this.calendars[0].year,u)+this.render(this.calendars[h].year,this.calendars[h].month,u)+"</div>";this.el.innerHTML=a,e.bound&&e.field.type!=="hidden"&&bF(function(){e.trigger.focus()},1),typeof this._o.onDraw=="function"&&this._o.onDraw(this),e.bound&&e.field.setAttribute("aria-label",e.ariaLabel)},adjustPosition:function(){let t,e,n,r,i,s,a,u,h,m,g;this._o.container||(this.el.style.position="absolute",t=this._o.trigger,e=this.el.offsetWidth,n=this.el.offsetHeight,r=Hg().innerWidth||ad().documentElement.clientWidth,i=Hg().innerHeight||ad().documentElement.clientHeight,s=ad().body.scrollTop||ad().documentElement.scrollTop,m=!0,g=!0,h=t.getBoundingClientRect(),a=h.left+Hg().pageXOffset,u=h.bottom+Hg().pageYOffset,(this._o.reposition&&a+e>r||this._o.position.indexOf("right")>-1&&a-e+t.offsetWidth>0)&&(a=a-e+t.offsetWidth,m=!1),(this._o.reposition&&u+n>i+s||this._o.position.indexOf("top")>-1&&u-n-t.offsetHeight>0)&&(u=u-n-t.offsetHeight,g=!1),a<0&&(a=0),u<0&&(u=0),this.el.style.left=a+"px",this.el.style.top=u+"px",yF(this.el,m?"left-aligned":"right-aligned"),yF(this.el,g?"bottom-aligned":"top-aligned"),xF(this.el,m?"right-aligned":"left-aligned"),xF(this.el,g?"top-aligned":"bottom-aligned"))},render:function(t,e,n){let r=this._o,i=new Date,s=HQ(t,e),a=new Date(t,e,1).getDay(),u=[],h=[];yM(i),r.firstDay>0&&(a-=r.firstDay,a<0&&(a+=7));let m=e===0?11:e-1,g=e===11?0:e+1,y=e===0?t-1:t,x=e===11?t+1:t,C=HQ(y,m),E=s+a,M=E;for(;M>7;)M-=7;E+=7-M;let j=!1;for(let L=0,D=0;L<E;L++){let z=new Date(t,e,1+(L-a)),H=pu(this._d)?xM(z,this._d):!1,V=xM(z,i),F=r.events.indexOf(z.toDateString())!==-1,B=L<a||L>=s+a,te=1+(L-a),ve=e,ce=t,_e=r.startRange&&xM(r.startRange,z),pe=r.endRange&&xM(r.endRange,z),Le=r.startRange&&r.endRange&&r.startRange<z&&z<r.endRange,Fe=r.minDate&&z<r.minDate||r.maxDate&&z>r.maxDate||r.disableWeekends&&rNe(z)||r.disableDayFn&&r.disableDayFn(z);B&&(L<a?(te=C+te,ve=m,ce=y):(te=te-s,ve=g,ce=x));let nt={day:te,month:ve,year:ce,hasEvent:F,isSelected:H,isToday:V,isDisabled:Fe,isEmpty:B,isStartRange:_e,isEndRange:pe,isInRange:Le,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:r.enableSelectionDaysInNextAndPreviousMonths};r.pickWholeWeek&&H&&(j=!0),h.push(sNe(nt)),++D===7&&(r.showWeekNumber&&h.unshift(aNe(this,L-a,e,t,r.firstWeekOfYearMinDays)),u.push(lNe(h,r.isRTL,r.pickWholeWeek,j)),h=[],D=0,j=!1)}return hNe(r,u,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),xF(this.el,"is-hidden"),this._o.bound&&(tf(ad(),"click",this._onClick),this.adjustPosition()),typeof this._o.onOpen=="function"&&this._o.onOpen.call(this))},hide:function(){let t=this._v;t!==!1&&(this._o.bound&&Bm(ad(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),yF(this.el,"is-hidden"),this._v=!1,t!==void 0&&typeof this._o.onClose=="function"&&this._o.onClose.call(this))},destroy:function(){let t=this._o;this.hide(),Bm(this.el,"mousedown",this._onMouseDown,!0),Bm(this.el,"touchend",this._onMouseDown,!0),Bm(this.el,"change",this._onChange),t.keyboardInput&&Bm(ad(),"keydown",this._onKeyChange),t.field&&(Bm(t.field,"change",this._onInputChange),t.bound&&(Bm(t.trigger,"click",this._onInputClick),Bm(t.trigger,"focus",this._onInputFocus),Bm(t.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};function fNe(t,e){mNe(t,e),e.add(t)}function mNe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zQ(t,e,n){return(e=pNe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pNe(t){var e=gNe(t,"string");return typeof e=="symbol"?e:e+""}function gNe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function SF(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const VQ="date",BQ="dateEditor",vNe="DD/MM/YYYY",WQ=new WeakSet;var CM=new WeakSet;class UQ extends Am{constructor(){super(...arguments),fNe(this,CM),zQ(this,"parentDestroyed",!1),zQ(this,"$datePicker",null)}static get EDITOR_TYPE(){return VQ}init(){typeof Tt!="function"&>("You need to include moment.js to your project."),typeof CF!="function"&>("You need to include Pikaday to your project."),super.init(),this.hot.addHook("afterDestroy",()=>{this.parentDestroyed=!0,this.destroyElements()}),this.hot.addHook("afterSetTheme",(e,n)=>{n||this.close()})}createElements(){super.createElements(),this.datePicker=this.hot.rootDocument.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,this.datePicker.setAttribute("dir",this.hot.isRtl()?"rtl":"ltr"),st(this.datePicker,"htDatepickerHolder"),this.hot.rootPortalElement.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",e=>{Dn(e.target,"pika-day")&&this.hideDatepicker(),e.stopPropagation()})}destroyElements(){const e=this.datePicker.parentNode;this.$datePicker&&this.$datePicker.destroy(),e&&e.removeChild(this.datePicker)}prepare(e,n,r,i,s,a){super.prepare(e,n,r,i,s,a)}open(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;WQ.has(this.cellProperties.instance)||(WQ.add(this.cellProperties.instance),xg("The Pikaday-based `date` editor is deprecated and will be removed in the next major release, replaced by the native HTML date input.\n\nMigration guide: https://handsontable.com/docs/migration-from-16.2-to-17.0/\n`date` cell type documentation: https://handsontable.com/docs/date-cell-type/"));const r=this.hot.getShortcutManager().getContext("editor");this.showDatepicker(e),super.open(),r.addShortcuts([{keys:[["ArrowLeft"]],callback:()=>{this.$datePicker.adjustDate("subtract",1)}},{keys:[["ArrowRight"]],callback:()=>{this.$datePicker.adjustDate("add",1)}},{keys:[["ArrowUp"]],callback:()=>{this.$datePicker.adjustDate("subtract",7)}},{keys:[["ArrowDown"]],callback:()=>{this.$datePicker.adjustDate("add",7)}}],{group:BQ})}close(){var e;(e=this.$datePicker)!==null&&e!==void 0&&e.destroy&&this.$datePicker.destroy(),this.hot._registerTimeout(()=>{const i=this.hot._getEditorManager();i.closeEditor(),this.hot.view.render(),i.prepareEditor()}),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(BQ),super.close()}finishEditing(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.finishEditing(e,n)}showDatepicker(e){const n=SF(CM,this,RF).call(this),r=this.hot.view.isMouseDown(),i=e?SG(e.keyCode):!1;let s;this.datePicker.style.display="block",this.$datePicker=new CF(this.getDatePickerConfig()),typeof this.$datePicker.useMoment=="function"&&this.$datePicker.useMoment(Tt),this.$datePicker._onInputFocus=function(){},this.originalValue?(s=this.originalValue,Tt(s,n,!0).isValid()&&this.$datePicker.setMoment(Tt(s,n),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),!i&&!r&&this.setValue("")):this.cellProperties.defaultDate?(s=this.cellProperties.defaultDate,Tt(s,n,!0).isValid()&&this.$datePicker.setMoment(Tt(s,n),!0),!i&&!r&&this.setValue("")):this.$datePicker.gotoToday()}hideDatepicker(){this.datePickerStyle.display="none",this.$datePicker.hide()}getDatePickerConfig(){var e;const n=this.TEXTAREA,r={};this.cellProperties&&this.cellProperties.datePickerConfig&&NT(r,this.cellProperties.datePickerConfig);const i=r.onSelect,s=r.onClose;return r.field=n,r.trigger=n,r.container=this.datePicker,r.bound=!1,r.keyboardInput=!1,r.format=(e=r.format)!==null&&e!==void 0?e:SF(CM,this,RF).call(this),r.reposition=r.reposition||!1,r.isRTL=!1,r.onSelect=a=>{let u=a;isNaN(u.getTime())||(u=Tt(u).format(SF(CM,this,RF).call(this))),this.setValue(u),i&&i(),Vh()&&this.hideDatepicker()},r.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),s&&s()},r}refreshDimensions(e){var n;if(super.refreshDimensions(e),this.state!==Qs.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.hideDatepicker();return}const{rowIndexMapper:r,columnIndexMapper:i}=this.hot,{wtOverlays:s}=this.hot.view._wt,{wtTable:a}=(n=s.getParentOverlay(this.TD))!==null&&n!==void 0?n:this.hot.view._wt,u=r.getVisualFromRenderableIndex(a.getFirstPartiallyVisibleRow()),h=r.getVisualFromRenderableIndex(a.getLastPartiallyVisibleRow()),m=i.getVisualFromRenderableIndex(a.getFirstPartiallyVisibleColumn()),g=i.getVisualFromRenderableIndex(a.getLastPartiallyVisibleColumn());if(this.row>=u&&this.row<=h&&this.col>=m&&this.col<=g){const y=this.TD.getBoundingClientRect();this.datePickerStyle.top=`${this.hot.rootWindow.pageYOffset+y.top+Po(this.TD)}px`;let x=this.hot.rootWindow.pageXOffset;this.hot.isRtl()?x+=y.right-po(this.datePicker):x+=y.left,this.datePickerStyle.left=`${x}px`}else this.hideDatepicker()}}function RF(){var t;return(t=this.cellProperties.dateFormat)!==null&&t!==void 0?t:vNe}const bNe="dropdown";class YQ extends L${static get EDITOR_TYPE(){return bNe}prepare(e,n,r,i,s,a){a.filter=!1,a.strict=!0,super.prepare(e,n,r,i,s,a)}}const GQ=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/;function yNe(t){const e=new Date(t);return isNaN(new Date(`${t}T00:00`).getDate())?e:new Date(e.getTime()+e.getTimezoneOffset()*6e4)}function rf(t){if(Yr(t))return null;if(typeof t=="string"&&GQ.test(t)){const[e,n,r]=t.split("-").map(Number);return new Date(e,n-1,r)}return null}function _F(t){if(typeof t!="string"||!GQ.test(t))return!1;const e=new Date(t);return!Number.isNaN(e.getTime())&&t===e.toISOString().slice(0,10)}const KQ=/^([01]\d|2[0-3]):([0-5]\d)(?::([0-5]\d)(?:\.(\d{1,3}))?)?$/;function ab(t){if(Yr(t)||typeof t!="string")return null;const e=KQ.exec(t);if(!e)return null;const n=Number(e[1]),r=Number(e[2]),i=e[3]!==void 0?Number(e[3]):0,s=e[4],a=s!==void 0?Number(s.padEnd(3,"0").slice(0,3)):0;return new Date(1970,0,1,n,r,i,a)}function EF(t){return typeof t=="string"&&KQ.test(t)}const xNe="intl-date";class qQ extends Am{static get EDITOR_TYPE(){return xNe}init(){super.init(),this.hot.addHook("afterSetTheme",(e,n)=>{n||this.close()})}createElements(){super.createElements("input"),this.TEXTAREA.setAttribute("type","date")}setValue(e){if(Yr(e)&&(e=this.cellProperties.defaultDate),!_F(e)){Yn(Jr`IntlDateEditor: value must be in ISO date format ("YYYY-MM-DD")\x20 required by the native date input. Received:`,e);return}super.setValue(e)}focus(){this.TEXTAREA.select()}open(){super.open();try{this.TEXTAREA.showPicker()}catch{}}}const wNe="intl-time";class XQ extends Am{static get EDITOR_TYPE(){return wNe}init(){super.init(),this.hot.addHook("afterSetTheme",(e,n)=>{n||this.close()})}createElements(){super.createElements("input"),this.TEXTAREA.setAttribute("type","time")}setValue(e){if(!EF(e)){Yn(Jr`IntlTimeEditor: value must be in 24-hour time format ("HH:mm", "HH:mm:ss" or "HH:mm:ss.SSS")\x20 required by the native time input. Received:`,e);return}super.setValue(e)}focus(){this.TEXTAREA.select()}open(){super.open();try{this.TEXTAREA.showPicker()}catch{}}}const CNe="numeric";class QQ extends Am{static get EDITOR_TYPE(){return CNe}}function SNe(t,e,n){return(e=RNe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function RNe(t){var e=_Ne(t,"string");return typeof e=="symbol"?e:e+""}function _Ne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const ENe="password";class ZQ extends Am{constructor(){super(...arguments),SNe(this,"autoResize",lX(this.hot.rootDocument,{textContent:e=>"•".repeat(e.value.length)}))}static get EDITOR_TYPE(){return ENe}createElements(){super.createElements(),this.TEXTAREA=this.hot.rootDocument.createElement("input"),this.TEXTAREA.setAttribute("type","password"),this.TEXTAREA.setAttribute("data-hot-input",""),this.TEXTAREA.className="handsontableInput",this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,Bh(this.TEXTAREA_PARENT),this.TEXTAREA.setAttribute(...Ld(-1)),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}const NF="ht_editor_visible",JQ="selectEditor",NNe="select";class eZ extends J0{static get EDITOR_TYPE(){return NNe}init(){this.selectWrapper=this.hot.rootDocument.createElement("div"),this.select=this.hot.rootDocument.createElement("select"),this.select.setAttribute("data-hot-input","true"),this.selectWrapper.style.display="none";const e=this.hot.rootDocument.createElement("DIV"),n=this.hot.getSettings().ariaTags;e.className="htAutocompleteArrow",n&&e.setAttribute(...ym()),e.appendChild(this.hot.rootDocument.createTextNode("▼")),st(this.selectWrapper,"htSelectEditor"),this.selectWrapper.appendChild(this.select),this.selectWrapper.insertBefore(e,this.selectWrapper.firstChild),this.hot.rootElement.appendChild(this.selectWrapper),this.registerHooks()}getValue(){return this.select.value}setValue(e){this.select.value=e}open(){this._opened=!0,this.refreshDimensions(),this.selectWrapper.style.display="",this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this._opened=!1,this.selectWrapper.style.display="none",Dn(this.selectWrapper,NF)&&cn(this.selectWrapper,NF),this.unregisterShortcuts(),this.clearHooks()}focus(){this.select.focus()}registerHooks(){this.addHook("afterScrollHorizontally",()=>this.refreshDimensions()),this.addHook("afterScrollVertically",()=>this.refreshDimensions()),this.addHook("afterColumnResize",()=>this.refreshDimensions()),this.addHook("afterRowResize",()=>this.refreshDimensions())}prepare(e,n,r,i,s,a){super.prepare(e,n,r,i,s,a);const u=this.cellProperties.selectOptions;let h;typeof u=="function"?h=this.prepareOptions(u(this.row,this.col,this.prop)):h=this.prepareOptions(u),Bh(this.select),Mr(h,(m,g)=>{const y=this.hot.rootDocument.createElement("OPTION");y.value=g,M0(y,m,this.hot.getSettings().sanitizer),this.select.appendChild(y)})}prepareOptions(e){let n={};if(Array.isArray(e))for(let r=0,i=e.length;r<i;r++)n[e[r]]=e[r];else typeof e=="object"&&(n=e);return n}refreshValue(){const e=this.hot.getSourceDataAtCell(this.row,this.prop);this.originalValue=e,this.setValue(e),this.refreshDimensions()}refreshDimensions(){if(this.state!==Qs.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.close();return}const{top:e,start:n,width:r,height:i}=this.getEditedCellRect(),s=this.selectWrapper.style;s.height=`${i}px`,s.width=`${r}px`,s.top=`${e}px`,s[this.hot.isRtl()?"right":"left"]=`${n}px`,s.margin="0px",st(this.selectWrapper,NF)}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor"),r={group:JQ};this.isInFullEditMode()&&n.addShortcuts([{keys:[["ArrowUp"]],callback:()=>{const i=this.select.selectedIndex-1;i>=0&&(this.select[i].selected=!0)}},{keys:[["ArrowDown"]],callback:()=>{const i=this.select.selectedIndex+1;i<=this.select.length-1&&(this.select[i].selected=!0)}}],r)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(JQ)}}const kNe="time";class tZ extends Am{static get EDITOR_TYPE(){return kNe}prepare(e,n,r,i,s,a){super.prepare(e,n,r,i,s,a),this.TEXTAREA.dir="ltr"}}function Tw(t){return t.querySelector('input[type="checkbox"]')}function TNe(t){return UY(t)?JSON.parse(t):t}function jNe(t,e){return Vme(t,e,(n,r)=>JSON.stringify(n)===JSON.stringify(r))}function nZ(t,e){return Mo(e)?Array.isArray(t)&&t.some(n=>Mo(n)?N0(n,e):n===e):t.includes(e)}function MNe(t,e){PNe(t,e),e.add(t)}function PNe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ANe(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var rZ=new WeakSet;class iZ{constructor(e){let{input:n,eventManager:r}=e;MNe(this,rZ),this.input=n,this.eventManager=r,this.enabled=!0,this.onInput=this.onInput.bind(this)}getInputElement(){return this.input}setValue(e){this.input.value=e}toggle(e){this.enabled=e,this.input&&(e?this.listen():this.unlisten())}listen(){this.eventManager.addEventListener(this.input,"input",this.onInput)}unlisten(){this.eventManager.removeEventListener(this.input,"input",this.onInput)}onInput(){ANe(rZ,this,ONe).call(this,this.input.value)}}function ONe(t){this.runLocalHooks("triggerFilter",t)}ci(iZ,vo);const jw="ht-multi-select-editor",INe=`${jw}-search-input-wrapper`,DNe=`${jw}-search-icon`,sZ=`${jw}-search-input`,HNe=`${jw}-separator`,LNe="Search...",$Ne="Search options",FNe=`${jw}-item-`,kF=`${jw}-item-selected`;function oZ(t){const e=Tw(t);st(t,kF),e.checked||(e.checked=!0)}function aZ(t){const e=Tw(t);cn(t,kF),e.checked&&(e.checked=!1)}function zNe(t){let{root:e}=t;const n=e.createElement("div");return n.className=INe,n}function VNe(t){let{root:e}=t;const n=e.createElement("div");return st(n,DNe),gn(n,[ym()]),n}function BNe(t){let{root:e}=t;const n=e.createElement("input");return gn(n,[wc($Ne),["type","text"],["size",3],["placeholder",LNe],["id",sZ]]),st(n,sZ),n}function WNe(t){let{root:e}=t;const n=e.createElement("div");return n.className=HNe,n}function UNe(t){let{root:e}=t;return e.createElement("ul")}function YNe(t){let{dropdownListElement:e}=t;return e.offsetWidth}function GNe(t){let{dropdownListElement:e}=t;e.querySelectorAll(`.${kF}`).forEach(n=>aZ(n))}function lZ(t){let{dropdownListElement:e,index:n}=t;const r=e.children[n];if(r){const i=Tw(r);i&&i.blur()}}function KNe(t){let{dropdownListElement:e,index:n}=t;const r=e.children[n];if(r){const i=Tw(r);i&&i.focus()}}function qNe(t){let{dropdownListElement:e}=t;e.querySelectorAll('input[type="checkbox"]:not(:checked)').forEach(n=>{n.dataset.disabled=!0})}function XNe(t){let{dropdownListElement:e}=t;e.querySelectorAll('input[type="checkbox"]').forEach(n=>{n.dataset.disabled=!1})}function QNe(t){let{rootDocument:e,instanceId:n,itemKey:r,itemValue:i,indexWithinList:s,checked:a=!1,disabled:u=!1}=t;const h=e.createElement("li"),m=e.createElement("div"),g=e.createElement("input"),y=e.createElement("label");return g.id=`${n}-${FNe}${s}`,g.type="checkbox",g.dataset.value=i,g.dataset.index=s,g.dataset.disabled=a?!1:u,r&&(g.dataset.key=r),y.htmlFor=g.id,y.textContent=i,m.appendChild(g),m.appendChild(y),h.appendChild(m),h}function ZNe(t,e){cZ(t,e),e.add(t)}function sf(t,e,n){cZ(t,e),e.set(t,n)}function cZ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _t(t,e){return t.get(Fa(t,e))}function Lg(t,e,n){return t.set(Fa(t,e),n),n}function Fa(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var TF=new WeakMap,Io=new WeakMap,gu=new WeakMap,$g=new WeakMap,c_=new WeakMap,lb=new WeakMap,u_=new WeakMap,Zd=new WeakMap,Mw=new WeakMap,fr=new WeakMap,ul=new WeakSet;class uZ{constructor(e,n){ZNe(this,ul),sf(this,TF,null),sf(this,Io,null),sf(this,gu,null),sf(this,$g,null),sf(this,c_,null),sf(this,lb,null),sf(this,u_,null),sf(this,Zd,null),sf(this,Mw,new Sc(this)),sf(this,fr,{visibleRowsNumber:null,entriesCount:0,flippedVertically:!1,currentlySelectedItemIndex:0,checkboxChangeListeners:new Map,areCheckboxesDisabled:!1,sourceSortFunction:null}),Lg(Io,this,e),Lg(Zd,this,_t(Io,this).ownerDocument),Lg(TF,this,n),this.init()}init(){Lg(gu,this,UNe({root:_t(Zd,this)})),Lg($g,this,BNe({root:_t(Zd,this)}));const e=VNe({root:_t(Zd,this)});Lg(lb,this,zNe({root:_t(Zd,this)})),Lg(c_,this,WNe({root:_t(Zd,this)})),_t(lb,this).appendChild(e),_t(lb,this).appendChild(_t($g,this)),_t(Io,this).appendChild(_t(lb,this)),_t(Io,this).appendChild(_t(c_,this)),_t(Io,this).appendChild(_t(gu,this)),Lg(u_,this,new iZ({input:_t($g,this),eventManager:_t(Mw,this)}))}setVisibleRowsNumberSetting(e){_t(fr,this).visibleRowsNumberSetting=e}setSourceSortFunction(e){_t(fr,this).sourceSortFunction=e??null}setSearchInputVisibility(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;_t(lb,this).style.display=e?"":"none",_t(c_,this).style.display=e?"":"none",_t(u_,this).toggle(e)}fillDropdown(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];this.removeAllDropdownItems(),_t(fr,this).currentlySelectedItemIndex=0,Array.isArray(n)||(n=[]),_t(fr,this).sourceSortFunction&&(e=_t(fr,this).sourceSortFunction(e)),e.forEach((r,i)=>{var s;Fa(ul,this,nke).call(this,{rootDocument:_t(Zd,this),itemKey:r==null?void 0:r.key,itemValue:(s=r==null?void 0:r.value)!==null&&s!==void 0?s:r,indexWithinList:i,checked:nZ(n,r),disabled:_t(fr,this).areCheckboxesDisabled})}),_t(fr,this).entriesCount=e.length,this.runLocalHooks("afterDropdownFill")}updateDimensions(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=Fa(ul,this,dZ).call(this),i=Fa(ul,this,JNe).call(this,e),s=i?e.spaceAbove:e.spaceBelow;if(!n&&i&&(_t(fr,this).flippedVertically=!0),_t(fr,this).entriesCount>0&&s<this.getHeight(!0)){const a=Math.max(Math.floor((s-Fa(ul,this,hZ).call(this))/r)-1,1);_t(fr,this).actualRenderedItemsCount=_t(fr,this).visibleRowsNumberSetting?Math.min(a,_t(fr,this).visibleRowsNumberSetting):a}else _t(fr,this).actualRenderedItemsCount=Math.min(_t(fr,this).entriesCount,_t(fr,this).visibleRowsNumberSetting);_t(fr,this).actualRenderedItemsCount&&_t(fr,this).entriesCount>_t(fr,this).actualRenderedItemsCount?_t(Io,this).style.height=`${this.getHeight()}px`:_t(Io,this).style.height="",Fa(ul,this,eke).call(this,e),_t(Io,this).scrollTop=0}getDropdownWidth(){return YNe({dropdownListElement:_t(gu,this)})}deselectAllItems(){GNe({dropdownListElement:_t(gu,this)})}focusFirstItem(){_t(fr,this).entriesCount>0&&Fa(ul,this,SM).call(this,0)}focusItem(e){Fa(ul,this,SM).call(this,e)}focusPreviousItem(){if(_t(fr,this).currentlySelectedItemIndex===0){this.focusSearchInput();return}lZ({dropdownListElement:_t(gu,this),index:_t(fr,this).currentlySelectedItemIndex}),Fa(ul,this,SM).call(this,_t(fr,this).currentlySelectedItemIndex-1)}focusNextItem(){_t(fr,this).currentlySelectedItemIndex!==_t(fr,this).entriesCount-1&&(lZ({dropdownListElement:_t(gu,this),index:_t(fr,this).currentlySelectedItemIndex}),Fa(ul,this,SM).call(this,_t(fr,this).currentlySelectedItemIndex+1))}focusSearchInput(){_t($g,this)&&_t($g,this).focus()}reset(){this.removeAllDropdownItems(),Fa(ul,this,ske).call(this),_t($g,this)&&(_t($g,this).value=""),_t(Io,this).style.position="",_t(Io,this).style.top="",_t(Io,this).style.height="",_t(Io,this).scrollTop=0}isFlippedVertically(){return _t(fr,this).flippedVertically}getHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=_t(Zd,this).defaultView.getComputedStyle(_t(Io,this));return Fa(ul,this,tke).call(this,e)+Fa(ul,this,hZ).call(this)+(n===!0?2*parseInt(r.getPropertyValue("--ht-menu-vertical-padding"),10):0)}getInputController(){return _t(u_,this)}removeAllDropdownItems(){Array.from(_t(gu,this).children).forEach(e=>Fa(ul,this,ike).call(this,e)),_t(fr,this).checkboxChangeListeners.clear(),_t(gu,this).innerHTML=""}disableCheckboxes(){_t(fr,this).areCheckboxesDisabled=!0,qNe({dropdownListElement:_t(gu,this)})}enableCheckboxes(){_t(fr,this).areCheckboxesDisabled=!1,XNe({dropdownListElement:_t(gu,this)})}}function SM(t){_t(fr,this).currentlySelectedItemIndex=t,KNe({dropdownListElement:_t(gu,this),index:t})}function JNe(t){const{spaceAbove:e,spaceBelow:n,cellHeight:r}=t;return this.getHeight(!0)>n&&e>n+r}function eke(t){const{cellHeight:e}=t;_t(fr,this).flippedVertically?(_t(Io,this).style.position="absolute",_t(Io,this).style.top=`${-this.getHeight(!1,!0)-e-2}px`):(_t(Io,this).style.position="",_t(Io,this).style.top="")}function dZ(){const t=_t(Zd,this).defaultView.getComputedStyle(_t(Io,this));return 2*parseInt(t.getPropertyValue("--ht-menu-item-vertical-padding"),10)+parseInt(t.getPropertyValue("--ht-line-height"),10)}function tke(){var t;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const n=_t(fr,this).entriesCount,r=e?n:(t=_t(fr,this).actualRenderedItemsCount)!==null&&t!==void 0?t:n,i=Fa(ul,this,dZ).call(this);return r*i}function hZ(){if(!_t(u_,this).enabled)return 0;const t=_t(Zd,this).defaultView.getComputedStyle(_t(Io,this)),e=_t(lb,this).offsetHeight,n=_t(c_,this).offsetHeight+2*parseInt(t.getPropertyValue("--ht-menu-vertical-padding"),10);return e+n}function nke(t){let{rootDocument:e,itemKey:n,itemValue:r,indexWithinList:i,checked:s=!1,disabled:a=!1}=t;const u=QNe({rootDocument:e,instanceId:_t(TF,this),itemKey:n,itemValue:r,indexWithinList:i,checked:s,disabled:a});s&&oZ(u),Fa(ul,this,rke).call(this,u),_t(gu,this).appendChild(u)}function rke(t){const e=Tw(t),n=()=>{if(e.dataset.disabled==="true"&&e.checked){e.checked=!1;return}e.checked?(oZ(t),this.runLocalHooks("afterDropdownItemChecked",e.dataset.key,e.dataset.value)):(aZ(t),this.runLocalHooks("afterDropdownItemUnchecked",e.dataset.key,e.dataset.value))},r=i=>{i.target===e||e.dataset.disabled==="true"||i.target.tagName==="LABEL"||(e.checked=!e.checked,e.dispatchEvent(new Event("change")))};_t(fr,this).checkboxChangeListeners.set(e,{change:n,click:r}),_t(Mw,this).addEventListener(e,"change",n),_t(Mw,this).addEventListener(t,"click",r)}function ike(t){const e=Tw(t),n=_t(fr,this).checkboxChangeListeners.get(e);_t(Mw,this).removeEventListener(e,"change",n.change),_t(Mw,this).removeEventListener(t,"click",n.click),_t(fr,this).checkboxChangeListeners.delete(e)}function ske(){_t(fr,this).visibleRowsNumberSetting=null,_t(fr,this).entriesCount=0,_t(fr,this).flippedVertically=!1,_t(fr,this).currentlySelectedItemIndex=0,_t(fr,this).checkboxChangeListeners.clear(),_t(fr,this).areCheckboxesDisabled=!1,_t(fr,this).sourceSortFunction=null}ci(uZ,vo);function fZ(t,e,n){return(e=oke(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oke(t){var e=ake(t,"string");return typeof e=="symbol"?e:e+""}function ake(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class jF{constructor(e){var n;fZ(this,"selectedItems",(n=this.selectedItems)!==null&&n!==void 0?n:new Set),fZ(this,"maxSelectionsCount",1/0),Array.isArray(e)?this.selectedItems=new Set(e):this.selectedItems=new Set}setMaxSelectionCount(e){this.maxSelectionsCount=e}add(e){this.selectedItems.size>=this.maxSelectionsCount||(Array.isArray(e)?e.forEach(n=>this.selectedItems.add(n)):this.selectedItems.add(e))}remove(e){if(Mo(e)){const r=Array.from(this.selectedItems).find(i=>N0(i,e));if(r!==void 0)return this.selectedItems.delete(r),!0}else return this.selectedItems.delete(e);return!1}has(e){return nZ(this.getItemsArray(),e)}clear(){this.selectedItems.clear()}getSize(){return this.selectedItems.size}getItemsArray(){return Array.from(this.selectedItems)}}function lke(t,e){pZ(t,e),e.add(t)}function mZ(t,e,n){pZ(t,e),e.set(t,n)}function pZ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function MF(t,e,n){return(e=cke(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cke(t){var e=uke(t,"string");return typeof e=="symbol"?e:e+""}function uke(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wo(t,e){return t.get(ui(t,e))}function PF(t,e,n){return t.set(ui(t,e),n),n}function ui(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const gZ="multiselect",dke="ht-multi-select-editor",hke="Select options",AF="multiselectEditor",fke="ht_editor_visible";var dl=new WeakMap,of=new WeakMap,mi=new WeakSet;class vZ extends J0{static get EDITOR_TYPE(){return gZ}constructor(e){var n;super(e),lke(this,mi),MF(this,"_closeAfterDataChange",!1),mZ(this,dl,new jF),mZ(this,of,null),MF(this,"dropdownContainerElement",null),MF(this,"dropdownController",(n=this.dropdownController)!==null&&n!==void 0?n:null),this.eventManager=new Sc(this),this.createElements(),this.bindEvents()}createElements(){const{rootDocument:e}=this.hot;PF(of,this,e.createElement("div")),wo(of,this).style.display="none",st(wo(of,this),"handsontableEditor"),this.dropdownContainerElement=this.hot.rootDocument.createElement("div"),st(this.dropdownContainerElement,`${dke} handsontableEditor`),gn(this.dropdownContainerElement,[wc(hke),lpe()]),wo(of,this).appendChild(this.dropdownContainerElement),this.hot.rootElement.appendChild(wo(of,this)),this.dropdownController=new uZ(this.dropdownContainerElement,this.hot.guid)}prepare(e,n,r,i,s,a){super.prepare(e,n,r,i,s,a);const u=TNe(s),h=Array.isArray(u)?u:[u],m=jNe(h,ui(mi,this,RM).call(this));this.dropdownController.reset(),m.length>=ui(mi,this,cb).call(this,"maxSelections")&&ui(mi,this,OF).call(this),ui(mi,this,CZ).call(this,m),this.dropdownController.setSourceSortFunction(this.cellProperties.sourceSortFunction),this.dropdownController.fillDropdown(ui(mi,this,RM).call(this),m),this.dropdownController.setVisibleRowsNumberSetting(ui(mi,this,cb).call(this,"visibleRows")),this.dropdownController.setSearchInputVisibility(ui(mi,this,cb).call(this,"searchInput")),a.maxSelections!==void 0&&wo(dl,this).setMaxSelectionCount(a.maxSelections)}finishEditing(e,n,r){super.finishEditing(e,n,r)}bindEvents(){var e=this;this.dropdownController.addLocalHook("afterDropdownItemChecked",(n,r)=>{ui(mi,this,bke).call(this,n,r),wo(dl,this).getSize()>=this.cellProperties.maxSelections&&ui(mi,this,OF).call(this)}),this.dropdownController.addLocalHook("afterDropdownItemUnchecked",(n,r)=>{ui(mi,this,yke).call(this,n,r),wo(dl,this).getSize()<this.cellProperties.maxSelections&&ui(mi,this,bZ).call(this)}),this.addHook("afterDestroy",()=>this.destroy()),this.addHook("afterSetSourceDataAtCell",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ui(mi,e,xke).call(e,...r)}),this.addHook("afterScrollHorizontally",()=>this.refreshDimensions()),this.addHook("afterScrollVertically",()=>this.refreshDimensions()),this.dropdownController.getInputController().addLocalHook("triggerFilter",n=>ui(mi,this,yZ).call(this,n))}open(e){if(CG(e==null?void 0:e.keyCode)){const n=e.key.length===1?e.key:String.fromCharCode(e.keyCode);this.dropdownController.getInputController().enabled&&(this.dropdownController.getInputController().setValue(n),ui(mi,this,yZ).call(this,n)),e.preventDefault(),this.enableFullEditMode()}ui(mi,this,gke).call(this),this.refreshDimensions(),this.hot.getShortcutManager().setActiveContextName("editor"),ui(mi,this,mke).call(this),this.dropdownController.getInputController().listen(),this.dropdownController.updateDimensions(ui(mi,this,xZ).call(this))}close(){ui(mi,this,vke).call(this),ui(mi,this,pke).call(this),this.dropdownController.getInputController().unlisten()}getValue(){return wo(dl,this).getItemsArray()}setValue(){}refreshDimensions(){if(!this.getEditedCell()){this.close();return}const{top:e,start:n,height:r}=this.getEditedCellRect(),i=wo(of,this).style;i.top=`${e+r}px`,i[this.hot.isRtl()?"right":"left"]=`${n}px`,st(wo(of,this),fke)}focus(){ui(mi,this,cb).call(this,"searchInput")===!1?this.dropdownController.focusFirstItem():this.dropdownController.focusSearchInput()}getInputElement(){return this.dropdownController.getInputController().getInputElement()}destroy(){this.close(),this.dropdownController.reset()}}function RM(){var t;return(t=this.cellProperties.source)!==null&&t!==void 0?t:[]}function mke(){const e=this.hot.getShortcutManager().getContext("editor");e.addShortcuts([{keys:[["ArrowUp"]],callback:()=>{this.dropdownController.focusPreviousItem()}},{keys:[["ArrowDown"]],callback:()=>{this.hot.rootDocument.activeElement===this.getInputElement()?this.dropdownController.focusFirstItem():this.dropdownController.focusNextItem()}}],{group:AF}),e.addShortcuts([{keys:[["enter"],["shift","enter"],["control/meta","enter"],["control/meta","shift","enter"]],runOnlyIf:()=>!ui(mi,this,cb).call(this,"enterCommits"),callback:n=>{const r=this.hot.rootDocument.activeElement;return r.tagName==="INPUT"&&r.type==="checkbox"&&(r.checked=!r.checked,r.dispatchEvent(new Event("change"))),n.preventDefault(),!1}},{keys:[["space"]],runOnlyIf:()=>!ui(mi,this,cb).call(this,"enterCommits"),callback:n=>{n.preventDefault()}}],{group:AF,relativeToGroup:Pm,position:"before"})}function pke(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(AF)}function gke(){wo(of,this).style.display=""}function vke(){wo(of,this).style.display="none"}function OF(){this.dropdownController.disableCheckboxes()}function bZ(){this.dropdownController.enableCheckboxes()}function yZ(t){var e;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(e=ui(mi,this,cb).call(this,"filterSelectedItems"))!==null&&e!==void 0?e:!0;const r=ui(mi,this,RM).call(this).filter(i=>{var s;const a=(s=i==null?void 0:i.value)!==null&&s!==void 0?s:i;return!n&&wo(dl,this).has(i)?!0:this.cellProperties.filteringCaseSensitive?a.includes(t):a.toLowerCase().includes(t.toLowerCase())});this.dropdownController.fillDropdown(r,wo(dl,this).getItemsArray()),this.dropdownController.updateDimensions(ui(mi,this,xZ).call(this),!0)}function xZ(){const t=this.getEditedCellRect(),e=this.hot.view.isVerticallyScrollableByWindow(),n=this.hot.view.getWorkspaceHeight();let r=t.top;if(e){const s=this.hot.view.getTableOffset().top-this.hot.rootWindow.scrollY;r=Math.max(r+s,0)}const i=n-r-t.height;return{spaceAbove:r,spaceBelow:i,cellHeight:t.height}}function wZ(){const t=wo(dl,this).getItemsArray();this.saveValue([[t]])}function bke(t,e){t?wo(dl,this).add({key:t,value:e}):wo(dl,this).add(e),ui(mi,this,wZ).call(this),this.refreshDimensions()}function yke(t,e){t?wo(dl,this).remove({key:t,value:e}):wo(dl,this).remove(e),ui(mi,this,wZ).call(this),this.refreshDimensions()}function CZ(t){t.length>0?PF(dl,this,new jF(t)):PF(dl,this,new jF)}function cb(t){return this.cellProperties[t]}function xke(t,e){this.isOpened()&&e===`${gZ}-renderer`&&parseInt(t[0][0],10)===this.cellProperties.visualRow&&parseInt(t[0][1],10)===this.cellProperties.visualCol&&(ui(mi,this,CZ).call(this,t[0][3]),this.dropdownController.fillDropdown(ui(mi,this,RM).call(this),wo(dl,this).getItemsArray()),this.dropdownController.focusItem(0),wo(dl,this).getSize()>=this.cellProperties.maxSelections?ui(mi,this,OF).call(this):ui(mi,this,bZ).call(this))}function wke(){ol(J0),ol(L$),ol($X),ol(UQ),ol(YQ),ol(P$),ol(qQ),ol(XQ),ol(QQ),ol(ZQ),ol(eZ),ol(Am),ol(tZ),ol(vZ)}const Cke="html";function IF(t,e,n,r,i,s){M0(e,s??"",!1)}IF.RENDERER_TYPE=Cke;const Ske="autocomplete";function Pw(t,e,n,r,i,s,a){const{rootDocument:u}=t,h=a.allowHtml?IF:Yd,m=u.createElement("DIV"),g=t.getSettings().ariaTags;if(m.className="htAutocompleteArrow",g&&m.setAttribute(...ym()),m.appendChild(u.createTextNode("▼")),h.apply(this,[t,e,n,r,i,s,a]),e.firstChild||e.appendChild(u.createTextNode(" ")),e.insertBefore(m,e.firstChild),st(e,"htAutocomplete"),!t.acArrowListener){const y=new Sc(t);t.acArrowListener=function(x){Dn(x.target,"htAutocompleteArrow")&&t.view._wt.getSetting("onCellDblClick",null,t._createCellCoords(n,r),e)},y.addEventListener(t.rootElement,"mousedown",t.acArrowListener),t.addHookOnce("afterDestroy",()=>{y.destroy()})}}Pw.RENDERER_TYPE=Ske;const Rke="dropdown";function _M(t,e,n,r,i,s,a){Pw.apply(this,[t,e,n,r,i,s,a])}_M.RENDERER_TYPE=Rke;const d_="#bad-value#",SZ=new WeakMap,RZ=new WeakMap,_ke="htBadValue",Aw="data-row",Ow="data-col",Eke="checkboxRenderer",_Z="checkbox";un.getSingleton().add("modifyAutoColumnSizeSeed",function(t,e,n){const{label:r,type:i,row:s,column:a,prop:u}=e;if(i!==_Z||!r)return;const{value:h,property:m}=r;let g=n;if(h)g=typeof h=="function"?h(s,a,u,n):h;else if(m){const y=this.getDataAtRowProp(s,m);g=y!==null?y:n}return`${Hi(g).length}`});function EM(t,e,n,r,i,s,a){const{rootDocument:u}=t,h=t.getSettings().ariaTags;Nke(t);let m=kke(u);const g=a.label;let y=!1;if(typeof a.checkedTemplate>"u"&&(a.checkedTemplate=!0),typeof a.uncheckedTemplate>"u"&&(a.uncheckedTemplate=!1),Bh(e),s===a.checkedTemplate||Hi(s).toLocaleLowerCase(a.locale)===Hi(a.checkedTemplate).toLocaleLowerCase(a.locale)?m.checked=!0:s===a.uncheckedTemplate||Hi(s).toLocaleLowerCase(a.locale)===Hi(a.uncheckedTemplate).toLocaleLowerCase(a.locale)?m.checked=!1:Yr(s)?st(m,"noValue"):(m.style.display="none",st(m,_ke),y=!0),gn(m,[[Aw,n],[Ow,r]]),h&&gn(m,[wc(m.checked?t.getTranslatedPhrase(A4):t.getTranslatedPhrase(O4)),tG(m.checked),spe()]),!y&&g){let M="";if(g.value)M=typeof g.value=="function"?g.value.call(this,n,r,i,s):g.value;else if(g.property){const L=t.getDataAtRowProp(n,g.property);M=L!==null?L:""}const j=Tke(u,M,g.separated!==!0);g.position==="before"?g.separated?(e.appendChild(j),e.appendChild(m)):(j.appendChild(m),m=j):(!g.position||g.position==="after")&&(g.separated?(e.appendChild(m),e.appendChild(j)):(j.insertBefore(m,j.firstChild),m=j))}(!g||g&&!g.separated)&&e.appendChild(m),y&&e.appendChild(u.createTextNode(d_)),SZ.has(t)||(SZ.set(t,!0),x());function x(){const j=t.getShortcutManager().getContext("grid"),L={group:Eke,relativeToGroup:Pm,position:"before"};j.addShortcuts([{keys:[["space"]],callback:()=>(C(),!E()),runOnlyIf:()=>{var D;return(D=t.getSelectedRangeActive())===null||D===void 0?void 0:D.highlight.isCell()}},{keys:[["enter"]],callback:()=>(C(),!E()),runOnlyIf:()=>{const D=t.getSelectedRangeActive();return t.getSettings().enterBeginsEditing&&(D==null?void 0:D.highlight.isCell())&&!t.selection.isMultiple()}},{keys:[["delete"],["backspace"]],callback:()=>(C(!0),!E()),runOnlyIf:()=>{var D;return(D=t.getSelectedRangeActive())===null||D===void 0?void 0:D.highlight.isCell()}}],L)}function C(){let M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const j=t.getSelectedRange(),L=[],D=new Map;let z=[],H=0;if(j){for(let V=0;V<j.length;V++){const{row:F,col:B}=j[V].getTopStartCorner(),{row:te,col:ve}=j[V].getBottomEndCorner();for(let ce=F;ce<=te;ce+=1)for(let _e=B;_e<=ve;_e+=1){const pe=t.getCellMeta(ce,_e);if(pe.hidden)continue;const Le={checkedTemplate:pe.checkedTemplate,uncheckedTemplate:pe.uncheckedTemplate};if(pe.type!=="checkbox"){M===!0&&!pe.readOnly&&(D.has(L.length)?D.set(L.length,[...D.get(L.length),[ce,_e,null]]):D.set(L.length,[[ce,_e,null]]));continue}if(pe.readOnly===!0)continue;typeof pe.checkedTemplate>"u"&&(pe.checkedTemplate=!0),typeof pe.uncheckedTemplate>"u"&&(pe.uncheckedTemplate=!1);const Fe=t.getDataAtCell(ce,_e);M===!1?[pe.checkedTemplate,pe.checkedTemplate.toString()].includes(Fe)?z.push([ce,_e,pe.uncheckedTemplate,Le]):[pe.uncheckedTemplate,pe.uncheckedTemplate.toString(),null,void 0].includes(Fe)&&z.push([ce,_e,pe.checkedTemplate,Le]):z.push([ce,_e,pe.uncheckedTemplate,Le]),H+=1}L.push(H),H=0}z.every(V=>{let[,,F]=V;return F===z[0][2]})?z=z.map(V=>{let[F,B,te]=V;return[F,B,te]}):z=z.map(V=>{let[F,B,,te]=V;return[F,B,te.checkedTemplate]}),z.length>0&&L.forEach((V,F)=>{let B=z.splice(0,V);D.size&&D.has(F)&&(B=[...B,...D.get(F)]),t.setDataAtCell(B)})}}function E(){const M=t.getSelectedRange();if(M){for(let j=0;j<M.length;j++){const L=M[j].getTopStartCorner(),D=M[j].getBottomEndCorner();for(let z=L.row;z<=D.row;z++)for(let H=L.col;H<=D.col;H++){if(t.getCellMeta(z,H).readOnly)continue;const F=t.getCell(z,H);if(Cm(F)&&F.querySelectorAll("input[type=checkbox]").length>0)return!0}}return!1}}}EM.RENDERER_TYPE=_Z;function Nke(t){let e=RZ.get(t);if(!e){const{rootElement:n}=t;e=new Sc(t),e.addEventListener(n,"click",r=>Mke(r,t)),e.addEventListener(n,"mouseup",r=>jke(r,t)),e.addEventListener(n,"change",r=>Pke(r,t)),RZ.set(t,e)}return e}function kke(t){const e=t.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("tabindex","-1"),e.cloneNode(!1)}function Tke(t,e,n){const r=t.createElement("label");r.className=`htCheckboxRendererLabel ${n?"fullWidth":""}`;const i=t.createTextNode(e);if(n){const s=t.createElement("span");s.appendChild(i),r.appendChild(s)}else r.appendChild(i);return r.cloneNode(!0)}function jke(t,e){const{target:n}=t;DF(n)&&(!n.hasAttribute(Aw)||!n.hasAttribute(Ow)||setTimeout(e.listen,10))}function Mke(t,e){const{target:n}=t;if(!DF(n)||!n.hasAttribute(Aw)||!n.hasAttribute(Ow))return;const r=parseInt(n.getAttribute(Aw),10),i=parseInt(n.getAttribute(Ow),10);e.getCellMeta(r,i).readOnly&&t.preventDefault()}function Pke(t,e){const{target:n}=t;if(!DF(n)||!n.hasAttribute(Aw)||!n.hasAttribute(Ow))return;const r=parseInt(n.getAttribute(Aw),10),i=parseInt(n.getAttribute(Ow),10),s=e.getCellMeta(r,i);if(!s.readOnly){let a=null;t.target.checked?a=s.uncheckedTemplate===void 0?!0:s.checkedTemplate:a=s.uncheckedTemplate===void 0?!1:s.uncheckedTemplate,e.setDataAtCell(r,i,a)}}function DF(t){return t.tagName==="INPUT"&&t.getAttribute("type")==="checkbox"}const Ake="handsontable";function HF(t,e,n,r,i,s,a){Pw.apply(this,[t,e,n,r,i,s,a])}HF.RENDERER_TYPE=Ake;const Oke="intl-date",Ike={year:"numeric",month:"2-digit",day:"2-digit"};function EZ(t,e){const{dateFormat:n,locale:r,allowEmpty:i}=e;if(Yr(t))return i?t:d_;const s=rf(t);if(s===null)return d_;const a=nn(n)?n:Ike;return new Intl.DateTimeFormat(r,a).format(s)}function NM(t,e,n,r,i,s,a){Yd.apply(this,[t,e,n,r,i,s,a])}NM.valueFormatter=EZ,NM.RENDERER_TYPE=Oke;const Dke="intl-time",Hke={hour:"numeric",minute:"2-digit"};function Lke(t,e){const{timeFormat:n,locale:r,allowEmpty:i}=e;if(Yr(t))return i?t:d_;const s=ab(t);if(s===null)return d_;const a=nn(n)?n:Hke;return new Intl.DateTimeFormat(r,a).format(s)}function LF(t,e,n,r,i,s,a){Yd.apply(this,[t,e,n,r,i,s,a]),e.dir="ltr"}LF.RENDERER_TYPE=Dke;var $ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fke(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}/*! * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */var $F,NZ;function zke(){return NZ||(NZ=1,$F={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(t){let e=t%10;return~~(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}),$F}/*! * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */var FF,kZ;function TZ(){if(kZ)return FF;kZ=1;const t=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function e(h){return h.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function n(h,m,g,y,x,C,E){if(!isNaN(+h))return+h;let M="",j=h.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(j!==h)return-1*n(j,m,g,y,x,C);for(let F=0;F<t.length;F++){let B=t[F];if(M=h.replace(RegExp(`([0-9 ])(${B.key})$`),"$1"),M!==h)return n(M,m,g,y,x,C)*B.factor}if(M=h.replace("%",""),M!==h)return n(M,m,g,y,x,C)/100;let L=parseFloat(h);if(isNaN(L))return;let D=y(L);if(D&&D!=="."&&(M=h.replace(new RegExp(`${e(D)}$`),""),M!==h))return n(M,m,g,y,x,C);let z={};Object.keys(C).forEach(F=>{z[C[F]]=F});let H=Object.keys(z).sort().reverse(),V=H.length;for(let F=0;F<V;F++){let B=H[F],te=z[B];if(M=h.replace(B,""),M!==h){let ve;switch(te){case"thousand":ve=Math.pow(10,3);break;case"million":ve=Math.pow(10,6);break;case"billion":ve=Math.pow(10,9);break;case"trillion":ve=Math.pow(10,12);break}return n(M,m,g,y,x,C)*ve}}}function r(h,m,g){let y=h.replace(g,"");return y=y.replace(new RegExp(`([0-9])${e(m.thousands)}([0-9])`,"g"),"$1$2"),y=y.replace(m.decimal,"."),y}function i(h,m,g="",y,x,C,E){if(h==="")return;if(h===x)return 0;let M=r(h,m,g);return n(M,m,g,y,x,C)}function s(h,m){if(!(h.indexOf(":")&&m.thousands!==":"))return!1;let y=h.split(":");if(y.length!==3)return!1;let x=+y[0],C=+y[1],E=+y[2];return!isNaN(x)&&!isNaN(C)&&!isNaN(E)}function a(h){let m=h.split(":"),g=+m[0],y=+m[1];return+m[2]+60*y+3600*g}function u(h,m){const g=UF();let y=g.currentDelimiters(),x=g.currentCurrency().symbol,C=g.currentOrdinal(),E=g.getZeroFormat(),M=g.currentAbbreviations(),j;if(typeof h=="string")s(h,y)?j=a(h):j=i(h,y,x,C,E,M);else if(typeof h=="number")j=h;else return;if(j!==void 0)return j}return FF={unformat:u},FF}/*! * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */var zF,jZ;function VF(){if(jZ)return zF;jZ=1;let t=TZ();const e=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,n=["currency","percent","byte","time","ordinal","number"],r=["trillion","billion","million","thousand"],i=["prefix","infix","postfix"],s=["sign","parenthesis"],a={type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},m={output:{type:"string",validValues:n},base:{type:"string",validValues:["decimal","binary","general"],restriction:(j,L)=>L.output==="byte",message:"`base` must be provided only when the output is `byte`",mandatory:j=>j.output==="byte"},characteristic:{type:"number",restriction:j=>j>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:r},average:"boolean",lowPrecision:{type:"boolean",restriction:(j,L)=>L.average===!0,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:i},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:j=>j>=0,message:"value must be positive"},{restriction:(j,L)=>!L.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:j=>j>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:s},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(j,L)=>L.output==="percent",message:"`prefixSymbol` can be provided only when the output is `percent`"}},g={languageTag:{type:"string",mandatory:!0,restriction:j=>j.match(e),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:a,spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function y(j,L){let D=x(j),z=E(L);return D&&z}function x(j){return t.unformat(j)!==void 0}function C(j,L,D,z=!1){let H=Object.keys(j).map(V=>{if(!L[V])return console.error(`${D} Invalid key: ${V}`),!1;let F=j[V],B=L[V];if(typeof B=="string"&&(B={type:B}),B.type==="format"){if(!C(F,m,`[Validate ${V}]`,!0))return!1}else if(typeof F!==B.type)return console.error(`${D} ${V} type mismatched: "${B.type}" expected, "${typeof F}" provided`),!1;if(B.restrictions&&B.restrictions.length){let te=B.restrictions.length;for(let ve=0;ve<te;ve++){let{restriction:ce,message:_e}=B.restrictions[ve];if(!ce(F,j))return console.error(`${D} ${V} invalid value: ${_e}`),!1}}return B.restriction&&!B.restriction(F,j)?(console.error(`${D} ${V} invalid value: ${B.message}`),!1):B.validValues&&B.validValues.indexOf(F)===-1?(console.error(`${D} ${V} invalid value: must be among ${JSON.stringify(B.validValues)}, "${F}" provided`),!1):!(B.children&&!C(F,B.children,`[Validate ${V}]`))});return z||H.push(...Object.keys(L).map(V=>{let F=L[V];if(typeof F=="string"&&(F={type:F}),F.mandatory){let B=F.mandatory;if(typeof B=="function"&&(B=B(j)),B&&j[V]===void 0)return console.error(`${D} Missing mandatory key "${V}"`),!1}return!0})),H.reduce((V,F)=>V&&F,!0)}function E(j){return C(j,m,"[Validate format]")}function M(j){return C(j,g,"[Validate language]")}return zF={validate:y,validateFormat:E,validateInput:x,validateLanguage:M},zF}/*! * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */function Vke(t,e){let n=t.match(/^{([^}]*)}/);return n?(e.prefix=n[1],t.slice(n[0].length)):t}function Bke(t,e){let n=t.match(/{([^}]*)}$/);return n?(e.postfix=n[1],t.slice(0,-n[0].length)):t}function Wke(t,e){if(t.indexOf("$")!==-1){e.output="currency";return}if(t.indexOf("%")!==-1){e.output="percent";return}if(t.indexOf("bd")!==-1){e.output="byte",e.base="general";return}if(t.indexOf("b")!==-1){e.output="byte",e.base="binary";return}if(t.indexOf("d")!==-1){e.output="byte",e.base="decimal";return}if(t.indexOf(":")!==-1){e.output="time";return}t.indexOf("o")!==-1&&(e.output="ordinal")}function Uke(t,e){t.indexOf(",")!==-1&&(e.thousandSeparated=!0)}function Yke(t,e){t.indexOf(" ")!==-1&&(e.spaceSeparated=!0,e.spaceSeparatedCurrency=!0,(e.average||e.forceAverage)&&(e.spaceSeparatedAbbreviation=!0))}function Gke(t,e){let n=t.match(/[1-9]+[0-9]*/);n&&(e.totalLength=+n[0])}function Kke(t,e){let r=t.split(".")[0].match(/0+/);r&&(e.characteristic=r[0].length)}function qke(t,e){let n=t.split(".")[1];if(n){let r=n.match(/0+/);r&&(e.mantissa=r[0].length)}}function Xke(t,e){const n=t.split(".")[1];n&&(e.trimMantissa=n.indexOf("[")!==-1)}function Qke(t,e){t.indexOf("a")!==-1&&(e.average=!0)}function Zke(t,e){t.indexOf("K")!==-1?e.forceAverage="thousand":t.indexOf("M")!==-1?e.forceAverage="million":t.indexOf("B")!==-1?e.forceAverage="billion":t.indexOf("T")!==-1&&(e.forceAverage="trillion")}function Jke(t,e){t.match(/\[\.]/)?e.optionalMantissa=!0:t.match(/\./)&&(e.optionalMantissa=!1)}function eTe(t,e){if(t.indexOf(".")!==-1){let n=t.split(".")[0];e.optionalCharacteristic=n.indexOf("0")===-1}}function tTe(t,e){t.match(/^\+?\([^)]*\)$/)&&(e.negative="parenthesis"),t.match(/^\+?-/)&&(e.negative="sign")}function nTe(t,e){t.match(/^\+/)&&(e.forceSign=!0)}function rTe(t,e={}){return typeof t!="string"?t:(t=Vke(t,e),t=Bke(t,e),Wke(t,e),Gke(t,e),Kke(t,e),eTe(t,e),Qke(t,e),Zke(t,e),qke(t,e),Jke(t,e),Xke(t,e),Uke(t,e),Yke(t,e),tTe(t,e),nTe(t,e),e)}var BF={parseFormat:rTe};/*! * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */var WF,MZ;function UF(){if(MZ)return WF;MZ=1;const t=zke(),e=VF(),n=BF;let r={},i,s={},a=null,u={};function h(g){i=g}function m(){return s[i]}return r.languages=()=>Object.assign({},s),r.currentLanguage=()=>i,r.currentBytes=()=>m().bytes||{},r.currentCurrency=()=>m().currency,r.currentAbbreviations=()=>m().abbreviations,r.currentDelimiters=()=>m().delimiters,r.currentOrdinal=()=>m().ordinal,r.currentDefaults=()=>Object.assign({},m().defaults,u),r.currentOrdinalDefaultFormat=()=>Object.assign({},r.currentDefaults(),m().ordinalFormat),r.currentByteDefaultFormat=()=>Object.assign({},r.currentDefaults(),m().byteFormat),r.currentPercentageDefaultFormat=()=>Object.assign({},r.currentDefaults(),m().percentageFormat),r.currentCurrencyDefaultFormat=()=>Object.assign({},r.currentDefaults(),m().currencyFormat),r.currentTimeDefaultFormat=()=>Object.assign({},r.currentDefaults(),m().timeFormat),r.setDefaults=g=>{g=n.parseFormat(g),e.validateFormat(g)&&(u=g)},r.getZeroFormat=()=>a,r.setZeroFormat=g=>a=typeof g=="string"?g:null,r.hasZeroFormat=()=>a!==null,r.languageData=g=>{if(g){if(s[g])return s[g];throw new Error(`Unknown tag "${g}"`)}return m()},r.registerLanguage=(g,y=!1)=>{if(!e.validateLanguage(g))throw new Error("Invalid language data");s[g.languageTag]=g,y&&h(g.languageTag)},r.setLanguage=(g,y=t.languageTag)=>{if(!s[g]){let x=g.split("-")[0],C=Object.keys(s).find(E=>E.split("-")[0]===x);if(!s[C]){h(y);return}h(C);return}h(g)},r.registerLanguage(t),i=t.languageTag,WF=r,WF}function iTe(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}/*! * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */function sTe(t,e){t.forEach(n=>{let r;try{r=iTe(`../languages/${n}`)}catch{console.error(`Unable to load "${n}". No matching language file found.`)}r&&e.registerLanguage(r)})}var oTe=t=>({loadLanguagesInNode:e=>sTe(e,t)}),PZ={exports:{}};(function(t){(function(e){var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,s=Math.floor,a="[BigNumber Error] ",u=a+"Number primitive has more than 15 significant digits: ",h=1e14,m=14,g=9007199254740991,y=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],x=1e7,C=1e9;function E(F){var B,te,ve,ce=ne.prototype={constructor:ne,toString:null,valueOf:null},_e=new ne(1),pe=20,Le=4,Fe=-7,nt=21,dt=-1e7,$e=1e7,Re=!1,Ze=1,Ee=0,Q={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},fe="0123456789abcdefghijklmnopqrstuvwxyz",Ve=!0;function ne(_,N){var O,G,q,I,Z,U,re,ae,he=this;if(!(he instanceof ne))return new ne(_,N);if(N==null){if(_&&_._isBigNumber===!0){he.s=_.s,!_.c||_.e>$e?he.c=he.e=null:_.e<dt?he.c=[he.e=0]:(he.e=_.e,he.c=_.c.slice());return}if((U=typeof _=="number")&&_*0==0){if(he.s=1/_<0?(_=-_,-1):1,_===~~_){for(I=0,Z=_;Z>=10;Z/=10,I++);I>$e?he.c=he.e=null:(he.e=I,he.c=[_]);return}ae=String(_)}else{if(!r.test(ae=String(_)))return ve(he,ae,U);he.s=ae.charCodeAt(0)==45?(ae=ae.slice(1),-1):1}(I=ae.indexOf("."))>-1&&(ae=ae.replace(".","")),(Z=ae.search(/e/i))>0?(I<0&&(I=Z),I+=+ae.slice(Z+1),ae=ae.substring(0,Z)):I<0&&(I=ae.length)}else{if(D(N,2,fe.length,"Base"),N==10&&Ve)return he=new ne(_),we(he,pe+he.e+1,Le);if(ae=String(_),U=typeof _=="number"){if(_*0!=0)return ve(he,ae,U,N);if(he.s=1/_<0?(ae=ae.slice(1),-1):1,ne.DEBUG&&ae.replace(/^0\.0*|\./,"").length>15)throw Error(u+_)}else he.s=ae.charCodeAt(0)===45?(ae=ae.slice(1),-1):1;for(O=fe.slice(0,N),I=Z=0,re=ae.length;Z<re;Z++)if(O.indexOf(G=ae.charAt(Z))<0){if(G=="."){if(Z>I){I=re;continue}}else if(!q&&(ae==ae.toUpperCase()&&(ae=ae.toLowerCase())||ae==ae.toLowerCase()&&(ae=ae.toUpperCase()))){q=!0,Z=-1,I=0;continue}return ve(he,String(_),U,N)}U=!1,ae=te(ae,N,10,he.s),(I=ae.indexOf("."))>-1?ae=ae.replace(".",""):I=ae.length}for(Z=0;ae.charCodeAt(Z)===48;Z++);for(re=ae.length;ae.charCodeAt(--re)===48;);if(ae=ae.slice(Z,++re)){if(re-=Z,U&&ne.DEBUG&&re>15&&(_>g||_!==s(_)))throw Error(u+he.s*_);if((I=I-Z-1)>$e)he.c=he.e=null;else if(I<dt)he.c=[he.e=0];else{if(he.e=I,he.c=[],Z=(I+1)%m,I<0&&(Z+=m),Z<re){for(Z&&he.c.push(+ae.slice(0,Z)),re-=m;Z<re;)he.c.push(+ae.slice(Z,Z+=m));Z=m-(ae=ae.slice(Z)).length}else Z-=re;for(;Z--;ae+="0");he.c.push(+ae)}}else he.c=[he.e=0]}ne.clone=E,ne.ROUND_UP=0,ne.ROUND_DOWN=1,ne.ROUND_CEIL=2,ne.ROUND_FLOOR=3,ne.ROUND_HALF_UP=4,ne.ROUND_HALF_DOWN=5,ne.ROUND_HALF_EVEN=6,ne.ROUND_HALF_CEIL=7,ne.ROUND_HALF_FLOOR=8,ne.EUCLID=9,ne.config=ne.set=function(_){var N,O;if(_!=null)if(typeof _=="object"){if(_.hasOwnProperty(N="DECIMAL_PLACES")&&(O=_[N],D(O,0,C,N),pe=O),_.hasOwnProperty(N="ROUNDING_MODE")&&(O=_[N],D(O,0,8,N),Le=O),_.hasOwnProperty(N="EXPONENTIAL_AT")&&(O=_[N],O&&O.pop?(D(O[0],-C,0,N),D(O[1],0,C,N),Fe=O[0],nt=O[1]):(D(O,-C,C,N),Fe=-(nt=O<0?-O:O))),_.hasOwnProperty(N="RANGE"))if(O=_[N],O&&O.pop)D(O[0],-C,-1,N),D(O[1],1,C,N),dt=O[0],$e=O[1];else if(D(O,-C,C,N),O)dt=-($e=O<0?-O:O);else throw Error(a+N+" cannot be zero: "+O);if(_.hasOwnProperty(N="CRYPTO"))if(O=_[N],O===!!O)if(O)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))Re=O;else throw Re=!O,Error(a+"crypto unavailable");else Re=O;else throw Error(a+N+" not true or false: "+O);if(_.hasOwnProperty(N="MODULO_MODE")&&(O=_[N],D(O,0,9,N),Ze=O),_.hasOwnProperty(N="POW_PRECISION")&&(O=_[N],D(O,0,C,N),Ee=O),_.hasOwnProperty(N="FORMAT"))if(O=_[N],typeof O=="object")Q=O;else throw Error(a+N+" not an object: "+O);if(_.hasOwnProperty(N="ALPHABET"))if(O=_[N],typeof O=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(O))Ve=O.slice(0,10)=="0123456789",fe=O;else throw Error(a+N+" invalid: "+O)}else throw Error(a+"Object expected: "+_);return{DECIMAL_PLACES:pe,ROUNDING_MODE:Le,EXPONENTIAL_AT:[Fe,nt],RANGE:[dt,$e],CRYPTO:Re,MODULO_MODE:Ze,POW_PRECISION:Ee,FORMAT:Q,ALPHABET:fe}},ne.isBigNumber=function(_){if(!_||_._isBigNumber!==!0)return!1;if(!ne.DEBUG)return!0;var N,O,G=_.c,q=_.e,I=_.s;e:if({}.toString.call(G)=="[object Array]"){if((I===1||I===-1)&&q>=-C&&q<=C&&q===s(q)){if(G[0]===0){if(q===0&&G.length===1)return!0;break e}if(N=(q+1)%m,N<1&&(N+=m),String(G[0]).length==N){for(N=0;N<G.length;N++)if(O=G[N],O<0||O>=h||O!==s(O))break e;if(O!==0)return!0}}}else if(G===null&&q===null&&(I===null||I===1||I===-1))return!0;throw Error(a+"Invalid BigNumber: "+_)},ne.maximum=ne.max=function(){return Ke(arguments,-1)},ne.minimum=ne.min=function(){return Ke(arguments,1)},ne.random=function(){var _=9007199254740992,N=Math.random()*_&2097151?function(){return s(Math.random()*_)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(O){var G,q,I,Z,U,re=0,ae=[],he=new ne(_e);if(O==null?O=pe:D(O,0,C),Z=i(O/m),Re)if(crypto.getRandomValues){for(G=crypto.getRandomValues(new Uint32Array(Z*=2));re<Z;)U=G[re]*131072+(G[re+1]>>>11),U>=9e15?(q=crypto.getRandomValues(new Uint32Array(2)),G[re]=q[0],G[re+1]=q[1]):(ae.push(U%1e14),re+=2);re=Z/2}else if(crypto.randomBytes){for(G=crypto.randomBytes(Z*=7);re<Z;)U=(G[re]&31)*281474976710656+G[re+1]*1099511627776+G[re+2]*4294967296+G[re+3]*16777216+(G[re+4]<<16)+(G[re+5]<<8)+G[re+6],U>=9e15?crypto.randomBytes(7).copy(G,re):(ae.push(U%1e14),re+=7);re=Z/7}else throw Re=!1,Error(a+"crypto unavailable");if(!Re)for(;re<Z;)U=N(),U<9e15&&(ae[re++]=U%1e14);for(Z=ae[--re],O%=m,Z&&O&&(U=y[m-O],ae[re]=s(Z/U)*U);ae[re]===0;ae.pop(),re--);if(re<0)ae=[I=0];else{for(I=-1;ae[0]===0;ae.splice(0,1),I-=m);for(re=1,U=ae[0];U>=10;U/=10,re++);re<m&&(I-=m-re)}return he.e=I,he.c=ae,he}}(),ne.sum=function(){for(var _=1,N=arguments,O=new ne(N[0]);_<N.length;)O=O.plus(N[_++]);return O},te=function(){var _="0123456789";function N(O,G,q,I){for(var Z,U=[0],re,ae=0,he=O.length;ae<he;){for(re=U.length;re--;U[re]*=G);for(U[0]+=I.indexOf(O.charAt(ae++)),Z=0;Z<U.length;Z++)U[Z]>q-1&&(U[Z+1]==null&&(U[Z+1]=0),U[Z+1]+=U[Z]/q|0,U[Z]%=q)}return U.reverse()}return function(O,G,q,I,Z){var U,re,ae,he,Me,tt,ot,lt,X=O.indexOf("."),de=pe,Ce=Le;for(X>=0&&(he=Ee,Ee=0,O=O.replace(".",""),lt=new ne(G),tt=lt.pow(O.length-X),Ee=he,lt.c=N(V(j(tt.c),tt.e,"0"),10,q,_),lt.e=lt.c.length),ot=N(O,G,q,Z?(U=fe,_):(U=_,fe)),ae=he=ot.length;ot[--he]==0;ot.pop());if(!ot[0])return U.charAt(0);if(X<0?--ae:(tt.c=ot,tt.e=ae,tt.s=I,tt=B(tt,lt,de,Ce,q),ot=tt.c,Me=tt.r,ae=tt.e),re=ae+de+1,X=ot[re],he=q/2,Me=Me||re<0||ot[re+1]!=null,Me=Ce<4?(X!=null||Me)&&(Ce==0||Ce==(tt.s<0?3:2)):X>he||X==he&&(Ce==4||Me||Ce==6&&ot[re-1]&1||Ce==(tt.s<0?8:7)),re<1||!ot[0])O=Me?V(U.charAt(1),-de,U.charAt(0)):U.charAt(0);else{if(ot.length=re,Me)for(--q;++ot[--re]>q;)ot[re]=0,re||(++ae,ot=[1].concat(ot));for(he=ot.length;!ot[--he];);for(X=0,O="";X<=he;O+=U.charAt(ot[X++]));O=V(O,ae,U.charAt(0))}return O}}(),B=function(){function _(G,q,I){var Z,U,re,ae,he=0,Me=G.length,tt=q%x,ot=q/x|0;for(G=G.slice();Me--;)re=G[Me]%x,ae=G[Me]/x|0,Z=ot*re+ae*tt,U=tt*re+Z%x*x+he,he=(U/I|0)+(Z/x|0)+ot*ae,G[Me]=U%I;return he&&(G=[he].concat(G)),G}function N(G,q,I,Z){var U,re;if(I!=Z)re=I>Z?1:-1;else for(U=re=0;U<I;U++)if(G[U]!=q[U]){re=G[U]>q[U]?1:-1;break}return re}function O(G,q,I,Z){for(var U=0;I--;)G[I]-=U,U=G[I]<q[I]?1:0,G[I]=U*Z+G[I]-q[I];for(;!G[0]&&G.length>1;G.splice(0,1));}return function(G,q,I,Z,U){var re,ae,he,Me,tt,ot,lt,X,de,Ce,Oe,Ge,Qe,se,ie,J,me,Se=G.s==q.s?1:-1,je=G.c,Pe=q.c;if(!je||!je[0]||!Pe||!Pe[0])return new ne(!G.s||!q.s||(je?Pe&&je[0]==Pe[0]:!Pe)?NaN:je&&je[0]==0||!Pe?Se*0:Se/0);for(X=new ne(Se),de=X.c=[],ae=G.e-q.e,Se=I+ae+1,U||(U=h,ae=M(G.e/m)-M(q.e/m),Se=Se/m|0),he=0;Pe[he]==(je[he]||0);he++);if(Pe[he]>(je[he]||0)&&ae--,Se<0)de.push(1),Me=!0;else{for(se=je.length,J=Pe.length,he=0,Se+=2,tt=s(U/(Pe[0]+1)),tt>1&&(Pe=_(Pe,tt,U),je=_(je,tt,U),J=Pe.length,se=je.length),Qe=J,Ce=je.slice(0,J),Oe=Ce.length;Oe<J;Ce[Oe++]=0);me=Pe.slice(),me=[0].concat(me),ie=Pe[0],Pe[1]>=U/2&&ie++;do{if(tt=0,re=N(Pe,Ce,J,Oe),re<0){if(Ge=Ce[0],J!=Oe&&(Ge=Ge*U+(Ce[1]||0)),tt=s(Ge/ie),tt>1)for(tt>=U&&(tt=U-1),ot=_(Pe,tt,U),lt=ot.length,Oe=Ce.length;N(ot,Ce,lt,Oe)==1;)tt--,O(ot,J<lt?me:Pe,lt,U),lt=ot.length,re=1;else tt==0&&(re=tt=1),ot=Pe.slice(),lt=ot.length;if(lt<Oe&&(ot=[0].concat(ot)),O(Ce,ot,Oe,U),Oe=Ce.length,re==-1)for(;N(Pe,Ce,J,Oe)<1;)tt++,O(Ce,J<Oe?me:Pe,Oe,U),Oe=Ce.length}else re===0&&(tt++,Ce=[0]);de[he++]=tt,Ce[0]?Ce[Oe++]=je[Qe]||0:(Ce=[je[Qe]],Oe=1)}while((Qe++<se||Ce[0]!=null)&&Se--);Me=Ce[0]!=null,de[0]||de.splice(0,1)}if(U==h){for(he=1,Se=de[0];Se>=10;Se/=10,he++);we(X,I+(X.e=he+ae*m-1)+1,Z,Me)}else X.e=ae,X.r=+Me;return X}}();function xe(_,N,O,G){var q,I,Z,U,re;if(O==null?O=Le:D(O,0,8),!_.c)return _.toString();if(q=_.c[0],Z=_.e,N==null)re=j(_.c),re=G==1||G==2&&(Z<=Fe||Z>=nt)?H(re,Z):V(re,Z,"0");else if(_=we(new ne(_),N,O),I=_.e,re=j(_.c),U=re.length,G==1||G==2&&(N<=I||I<=Fe)){for(;U<N;re+="0",U++);re=H(re,I)}else if(N-=Z,re=V(re,I,"0"),I+1>U){if(--N>0)for(re+=".";N--;re+="0");}else if(N+=I-U,N>0)for(I+1==U&&(re+=".");N--;re+="0");return _.s<0&&q?"-"+re:re}function Ke(_,N){for(var O,G,q=1,I=new ne(_[0]);q<_.length;q++)G=new ne(_[q]),(!G.s||(O=L(I,G))===N||O===0&&I.s===N)&&(I=G);return I}function qe(_,N,O){for(var G=1,q=N.length;!N[--q];N.pop());for(q=N[0];q>=10;q/=10,G++);return(O=G+O*m-1)>$e?_.c=_.e=null:O<dt?_.c=[_.e=0]:(_.e=O,_.c=N),_}ve=function(){var _=/^(-?)0([xbo])(?=\w[\w.]*$)/i,N=/^([^.]+)\.$/,O=/^\.([^.]+)$/,G=/^-?(Infinity|NaN)$/,q=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(I,Z,U,re){var ae,he=U?Z:Z.replace(q,"");if(G.test(he))I.s=isNaN(he)?null:he<0?-1:1;else{if(!U&&(he=he.replace(_,function(Me,tt,ot){return ae=(ot=ot.toLowerCase())=="x"?16:ot=="b"?2:8,!re||re==ae?tt:Me}),re&&(ae=re,he=he.replace(N,"$1").replace(O,"0.$1")),Z!=he))return new ne(he,ae);if(ne.DEBUG)throw Error(a+"Not a"+(re?" base "+re:"")+" number: "+Z);I.s=null}I.c=I.e=null}}();function we(_,N,O,G){var q,I,Z,U,re,ae,he,Me=_.c,tt=y;if(Me){e:{for(q=1,U=Me[0];U>=10;U/=10,q++);if(I=N-q,I<0)I+=m,Z=N,re=Me[ae=0],he=s(re/tt[q-Z-1]%10);else if(ae=i((I+1)/m),ae>=Me.length)if(G){for(;Me.length<=ae;Me.push(0));re=he=0,q=1,I%=m,Z=I-m+1}else break e;else{for(re=U=Me[ae],q=1;U>=10;U/=10,q++);I%=m,Z=I-m+q,he=Z<0?0:s(re/tt[q-Z-1]%10)}if(G=G||N<0||Me[ae+1]!=null||(Z<0?re:re%tt[q-Z-1]),G=O<4?(he||G)&&(O==0||O==(_.s<0?3:2)):he>5||he==5&&(O==4||G||O==6&&(I>0?Z>0?re/tt[q-Z]:0:Me[ae-1])%10&1||O==(_.s<0?8:7)),N<1||!Me[0])return Me.length=0,G?(N-=_.e+1,Me[0]=tt[(m-N%m)%m],_.e=-N||0):Me[0]=_.e=0,_;if(I==0?(Me.length=ae,U=1,ae--):(Me.length=ae+1,U=tt[m-I],Me[ae]=Z>0?s(re/tt[q-Z]%tt[Z])*U:0),G)for(;;)if(ae==0){for(I=1,Z=Me[0];Z>=10;Z/=10,I++);for(Z=Me[0]+=U,U=1;Z>=10;Z/=10,U++);I!=U&&(_.e++,Me[0]==h&&(Me[0]=1));break}else{if(Me[ae]+=U,Me[ae]!=h)break;Me[ae--]=0,U=1}for(I=Me.length;Me[--I]===0;Me.pop());}_.e>$e?_.c=_.e=null:_.e<dt&&(_.c=[_.e=0])}return _}function k(_){var N,O=_.e;return O===null?_.toString():(N=j(_.c),N=O<=Fe||O>=nt?H(N,O):V(N,O,"0"),_.s<0?"-"+N:N)}return ce.absoluteValue=ce.abs=function(){var _=new ne(this);return _.s<0&&(_.s=1),_},ce.comparedTo=function(_,N){return L(this,new ne(_,N))},ce.decimalPlaces=ce.dp=function(_,N){var O,G,q,I=this;if(_!=null)return D(_,0,C),N==null?N=Le:D(N,0,8),we(new ne(I),_+I.e+1,N);if(!(O=I.c))return null;if(G=((q=O.length-1)-M(this.e/m))*m,q=O[q])for(;q%10==0;q/=10,G--);return G<0&&(G=0),G},ce.dividedBy=ce.div=function(_,N){return B(this,new ne(_,N),pe,Le)},ce.dividedToIntegerBy=ce.idiv=function(_,N){return B(this,new ne(_,N),0,1)},ce.exponentiatedBy=ce.pow=function(_,N){var O,G,q,I,Z,U,re,ae,he,Me=this;if(_=new ne(_),_.c&&!_.isInteger())throw Error(a+"Exponent not an integer: "+k(_));if(N!=null&&(N=new ne(N)),U=_.e>14,!Me.c||!Me.c[0]||Me.c[0]==1&&!Me.e&&Me.c.length==1||!_.c||!_.c[0])return he=new ne(Math.pow(+k(Me),U?_.s*(2-z(_)):+k(_))),N?he.mod(N):he;if(re=_.s<0,N){if(N.c?!N.c[0]:!N.s)return new ne(NaN);G=!re&&Me.isInteger()&&N.isInteger(),G&&(Me=Me.mod(N))}else{if(_.e>9&&(Me.e>0||Me.e<-1||(Me.e==0?Me.c[0]>1||U&&Me.c[1]>=24e7:Me.c[0]<8e13||U&&Me.c[0]<=9999975e7)))return I=Me.s<0&&z(_)?-0:0,Me.e>-1&&(I=1/I),new ne(re?1/I:I);Ee&&(I=i(Ee/m+2))}for(U?(O=new ne(.5),re&&(_.s=1),ae=z(_)):(q=Math.abs(+k(_)),ae=q%2),he=new ne(_e);;){if(ae){if(he=he.times(Me),!he.c)break;I?he.c.length>I&&(he.c.length=I):G&&(he=he.mod(N))}if(q){if(q=s(q/2),q===0)break;ae=q%2}else if(_=_.times(O),we(_,_.e+1,1),_.e>14)ae=z(_);else{if(q=+k(_),q===0)break;ae=q%2}Me=Me.times(Me),I?Me.c&&Me.c.length>I&&(Me.c.length=I):G&&(Me=Me.mod(N))}return G?he:(re&&(he=_e.div(he)),N?he.mod(N):I?we(he,Ee,Le,Z):he)},ce.integerValue=function(_){var N=new ne(this);return _==null?_=Le:D(_,0,8),we(N,N.e+1,_)},ce.isEqualTo=ce.eq=function(_,N){return L(this,new ne(_,N))===0},ce.isFinite=function(){return!!this.c},ce.isGreaterThan=ce.gt=function(_,N){return L(this,new ne(_,N))>0},ce.isGreaterThanOrEqualTo=ce.gte=function(_,N){return(N=L(this,new ne(_,N)))===1||N===0},ce.isInteger=function(){return!!this.c&&M(this.e/m)>this.c.length-2},ce.isLessThan=ce.lt=function(_,N){return L(this,new ne(_,N))<0},ce.isLessThanOrEqualTo=ce.lte=function(_,N){return(N=L(this,new ne(_,N)))===-1||N===0},ce.isNaN=function(){return!this.s},ce.isNegative=function(){return this.s<0},ce.isPositive=function(){return this.s>0},ce.isZero=function(){return!!this.c&&this.c[0]==0},ce.minus=function(_,N){var O,G,q,I,Z=this,U=Z.s;if(_=new ne(_,N),N=_.s,!U||!N)return new ne(NaN);if(U!=N)return _.s=-N,Z.plus(_);var re=Z.e/m,ae=_.e/m,he=Z.c,Me=_.c;if(!re||!ae){if(!he||!Me)return he?(_.s=-N,_):new ne(Me?Z:NaN);if(!he[0]||!Me[0])return Me[0]?(_.s=-N,_):new ne(he[0]?Z:Le==3?-0:0)}if(re=M(re),ae=M(ae),he=he.slice(),U=re-ae){for((I=U<0)?(U=-U,q=he):(ae=re,q=Me),q.reverse(),N=U;N--;q.push(0));q.reverse()}else for(G=(I=(U=he.length)<(N=Me.length))?U:N,U=N=0;N<G;N++)if(he[N]!=Me[N]){I=he[N]<Me[N];break}if(I&&(q=he,he=Me,Me=q,_.s=-_.s),N=(G=Me.length)-(O=he.length),N>0)for(;N--;he[O++]=0);for(N=h-1;G>U;){if(he[--G]<Me[G]){for(O=G;O&&!he[--O];he[O]=N);--he[O],he[G]+=h}he[G]-=Me[G]}for(;he[0]==0;he.splice(0,1),--ae);return he[0]?qe(_,he,ae):(_.s=Le==3?-1:1,_.c=[_.e=0],_)},ce.modulo=ce.mod=function(_,N){var O,G,q=this;return _=new ne(_,N),!q.c||!_.s||_.c&&!_.c[0]?new ne(NaN):!_.c||q.c&&!q.c[0]?new ne(q):(Ze==9?(G=_.s,_.s=1,O=B(q,_,0,3),_.s=G,O.s*=G):O=B(q,_,0,Ze),_=q.minus(O.times(_)),!_.c[0]&&Ze==1&&(_.s=q.s),_)},ce.multipliedBy=ce.times=function(_,N){var O,G,q,I,Z,U,re,ae,he,Me,tt,ot,lt,X,de,Ce=this,Oe=Ce.c,Ge=(_=new ne(_,N)).c;if(!Oe||!Ge||!Oe[0]||!Ge[0])return!Ce.s||!_.s||Oe&&!Oe[0]&&!Ge||Ge&&!Ge[0]&&!Oe?_.c=_.e=_.s=null:(_.s*=Ce.s,!Oe||!Ge?_.c=_.e=null:(_.c=[0],_.e=0)),_;for(G=M(Ce.e/m)+M(_.e/m),_.s*=Ce.s,re=Oe.length,Me=Ge.length,re<Me&&(lt=Oe,Oe=Ge,Ge=lt,q=re,re=Me,Me=q),q=re+Me,lt=[];q--;lt.push(0));for(X=h,de=x,q=Me;--q>=0;){for(O=0,tt=Ge[q]%de,ot=Ge[q]/de|0,Z=re,I=q+Z;I>q;)ae=Oe[--Z]%de,he=Oe[Z]/de|0,U=ot*ae+he*tt,ae=tt*ae+U%de*de+lt[I]+O,O=(ae/X|0)+(U/de|0)+ot*he,lt[I--]=ae%X;lt[I]=O}return O?++G:lt.splice(0,1),qe(_,lt,G)},ce.negated=function(){var _=new ne(this);return _.s=-_.s||null,_},ce.plus=function(_,N){var O,G=this,q=G.s;if(_=new ne(_,N),N=_.s,!q||!N)return new ne(NaN);if(q!=N)return _.s=-N,G.minus(_);var I=G.e/m,Z=_.e/m,U=G.c,re=_.c;if(!I||!Z){if(!U||!re)return new ne(q/0);if(!U[0]||!re[0])return re[0]?_:new ne(U[0]?G:q*0)}if(I=M(I),Z=M(Z),U=U.slice(),q=I-Z){for(q>0?(Z=I,O=re):(q=-q,O=U),O.reverse();q--;O.push(0));O.reverse()}for(q=U.length,N=re.length,q-N<0&&(O=re,re=U,U=O,N=q),q=0;N;)q=(U[--N]=U[N]+re[N]+q)/h|0,U[N]=h===U[N]?0:U[N]%h;return q&&(U=[q].concat(U),++Z),qe(_,U,Z)},ce.precision=ce.sd=function(_,N){var O,G,q,I=this;if(_!=null&&_!==!!_)return D(_,1,C),N==null?N=Le:D(N,0,8),we(new ne(I),_,N);if(!(O=I.c))return null;if(q=O.length-1,G=q*m+1,q=O[q]){for(;q%10==0;q/=10,G--);for(q=O[0];q>=10;q/=10,G++);}return _&&I.e+1>G&&(G=I.e+1),G},ce.shiftedBy=function(_){return D(_,-g,g),this.times("1e"+_)},ce.squareRoot=ce.sqrt=function(){var _,N,O,G,q,I=this,Z=I.c,U=I.s,re=I.e,ae=pe+4,he=new ne("0.5");if(U!==1||!Z||!Z[0])return new ne(!U||U<0&&(!Z||Z[0])?NaN:Z?I:1/0);if(U=Math.sqrt(+k(I)),U==0||U==1/0?(N=j(Z),(N.length+re)%2==0&&(N+="0"),U=Math.sqrt(+N),re=M((re+1)/2)-(re<0||re%2),U==1/0?N="5e"+re:(N=U.toExponential(),N=N.slice(0,N.indexOf("e")+1)+re),O=new ne(N)):O=new ne(U+""),O.c[0]){for(re=O.e,U=re+ae,U<3&&(U=0);;)if(q=O,O=he.times(q.plus(B(I,q,ae,1))),j(q.c).slice(0,U)===(N=j(O.c)).slice(0,U))if(O.e<re&&--U,N=N.slice(U-3,U+1),N=="9999"||!G&&N=="4999"){if(!G&&(we(q,q.e+pe+2,0),q.times(q).eq(I))){O=q;break}ae+=4,U+=4,G=1}else{(!+N||!+N.slice(1)&&N.charAt(0)=="5")&&(we(O,O.e+pe+2,1),_=!O.times(O).eq(I));break}}return we(O,O.e+pe+1,Le,_)},ce.toExponential=function(_,N){return _!=null&&(D(_,0,C),_++),xe(this,_,N,1)},ce.toFixed=function(_,N){return _!=null&&(D(_,0,C),_=_+this.e+1),xe(this,_,N)},ce.toFormat=function(_,N,O){var G,q=this;if(O==null)_!=null&&N&&typeof N=="object"?(O=N,N=null):_&&typeof _=="object"?(O=_,_=N=null):O=Q;else if(typeof O!="object")throw Error(a+"Argument not an object: "+O);if(G=q.toFixed(_,N),q.c){var I,Z=G.split("."),U=+O.groupSize,re=+O.secondaryGroupSize,ae=O.groupSeparator||"",he=Z[0],Me=Z[1],tt=q.s<0,ot=tt?he.slice(1):he,lt=ot.length;if(re&&(I=U,U=re,re=I,lt-=I),U>0&<>0){for(I=lt%U||U,he=ot.substr(0,I);I<lt;I+=U)he+=ae+ot.substr(I,U);re>0&&(he+=ae+ot.slice(I)),tt&&(he="-"+he)}G=Me?he+(O.decimalSeparator||"")+((re=+O.fractionGroupSize)?Me.replace(new RegExp("\\d{"+re+"}\\B","g"),"$&"+(O.fractionGroupSeparator||"")):Me):he}return(O.prefix||"")+G+(O.suffix||"")},ce.toFraction=function(_){var N,O,G,q,I,Z,U,re,ae,he,Me,tt,ot=this,lt=ot.c;if(_!=null&&(U=new ne(_),!U.isInteger()&&(U.c||U.s!==1)||U.lt(_e)))throw Error(a+"Argument "+(U.isInteger()?"out of range: ":"not an integer: ")+k(U));if(!lt)return new ne(ot);for(N=new ne(_e),ae=O=new ne(_e),G=re=new ne(_e),tt=j(lt),I=N.e=tt.length-ot.e-1,N.c[0]=y[(Z=I%m)<0?m+Z:Z],_=!_||U.comparedTo(N)>0?I>0?N:ae:U,Z=$e,$e=1/0,U=new ne(tt),re.c[0]=0;he=B(U,N,0,1),q=O.plus(he.times(G)),q.comparedTo(_)!=1;)O=G,G=q,ae=re.plus(he.times(q=ae)),re=q,N=U.minus(he.times(q=N)),U=q;return q=B(_.minus(O),G,0,1),re=re.plus(q.times(ae)),O=O.plus(q.times(G)),re.s=ae.s=ot.s,I=I*2,Me=B(ae,G,I,Le).minus(ot).abs().comparedTo(B(re,O,I,Le).minus(ot).abs())<1?[ae,G]:[re,O],$e=Z,Me},ce.toNumber=function(){return+k(this)},ce.toPrecision=function(_,N){return _!=null&&D(_,1,C),xe(this,_,N,2)},ce.toString=function(_){var N,O=this,G=O.s,q=O.e;return q===null?G?(N="Infinity",G<0&&(N="-"+N)):N="NaN":(_==null?N=q<=Fe||q>=nt?H(j(O.c),q):V(j(O.c),q,"0"):_===10&&Ve?(O=we(new ne(O),pe+q+1,Le),N=V(j(O.c),O.e,"0")):(D(_,2,fe.length,"Base"),N=te(V(j(O.c),q,"0"),10,_,G,!0)),G<0&&O.c[0]&&(N="-"+N)),N},ce.valueOf=ce.toJSON=function(){return k(this)},ce._isBigNumber=!0,F!=null&&ne.set(F),ne}function M(F){var B=F|0;return F>0||F===B?B:B-1}function j(F){for(var B,te,ve=1,ce=F.length,_e=F[0]+"";ve<ce;){for(B=F[ve++]+"",te=m-B.length;te--;B="0"+B);_e+=B}for(ce=_e.length;_e.charCodeAt(--ce)===48;);return _e.slice(0,ce+1||1)}function L(F,B){var te,ve,ce=F.c,_e=B.c,pe=F.s,Le=B.s,Fe=F.e,nt=B.e;if(!pe||!Le)return null;if(te=ce&&!ce[0],ve=_e&&!_e[0],te||ve)return te?ve?0:-Le:pe;if(pe!=Le)return pe;if(te=pe<0,ve=Fe==nt,!ce||!_e)return ve?0:!ce^te?1:-1;if(!ve)return Fe>nt^te?1:-1;for(Le=(Fe=ce.length)<(nt=_e.length)?Fe:nt,pe=0;pe<Le;pe++)if(ce[pe]!=_e[pe])return ce[pe]>_e[pe]^te?1:-1;return Fe==nt?0:Fe>nt^te?1:-1}function D(F,B,te,ve){if(F<B||F>te||F!==s(F))throw Error(a+(ve||"Argument")+(typeof F=="number"?F<B||F>te?" out of range: ":" not an integer: ":" not a primitive number: ")+String(F))}function z(F){var B=F.c.length-1;return M(F.e/m)==B&&F.c[B]%2!=0}function H(F,B){return(F.length>1?F.charAt(0)+"."+F.slice(1):F)+(B<0?"e":"e+")+B}function V(F,B,te){var ve,ce;if(B<0){for(ce=te+".";++B;ce+=te);F=ce+F}else if(ve=F.length,++B>ve){for(ce=te,B-=ve;--B;ce+=te);F+=ce}else B<ve&&(F=F.slice(0,B)+"."+F.slice(B));return F}n=E(),n.default=n.BigNumber=n,t.exports?t.exports=n:(e||(e=typeof self<"u"&&self?self:window),e.BigNumber=n)})($ke)})(PZ);var AZ=PZ.exports;/*! * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */const Jd=UF(),aTe=VF(),lTe=BF,cTe=AZ,za={trillion:Math.pow(10,12),billion:Math.pow(10,9),million:Math.pow(10,6),thousand:Math.pow(10,3)},h_={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1,roundingFunction:Math.round,spaceSeparatedAbbreviation:!1},{binarySuffixes:OZ,decimalSuffixes:kM}=Jd.currentBytes(),YF={general:{scale:1024,suffixes:kM},binary:{scale:1024,suffixes:OZ},decimal:{scale:1e3,suffixes:kM}};function uTe(t,e={},n){if(typeof e=="string"&&(e=lTe.parseFormat(e)),!aTe.validateFormat(e))return"ERROR: invalid format";let i=e.prefix||"",s=e.postfix||"",a=dTe(t,e,n);return a=jTe(a,i),a=MTe(a,s),a}function dTe(t,e,n){switch(e.output){case"currency":return e=Iw(e,Jd.currentCurrencyDefaultFormat()),yTe(t,e,Jd);case"percent":return e=Iw(e,Jd.currentPercentageDefaultFormat()),bTe(t,e,Jd,n);case"byte":return e=Iw(e,Jd.currentByteDefaultFormat()),pTe(t,e,Jd,n);case"time":return e=Iw(e,Jd.currentTimeDefaultFormat()),vTe(t);case"ordinal":return e=Iw(e,Jd.currentOrdinalDefaultFormat()),gTe(t,e,Jd);case"number":default:return f_({instance:t,providedFormat:e})}}function hTe(t){let e=YF.decimal;return TM(t._value,e.suffixes,e.scale).suffix}function fTe(t){let e=YF.binary;return TM(t._value,e.suffixes,e.scale).suffix}function mTe(t){let e=YF.general;return TM(t._value,e.suffixes,e.scale).suffix}function TM(t,e,n){let r=e[0],i=Math.abs(t);if(i>=n){for(let s=1;s<e.length;++s){let a=Math.pow(n,s),u=Math.pow(n,s+1);if(i>=a&&i<u){r=e[s],t=t/a;break}}r===e[0]&&(t=t/Math.pow(n,e.length-1),r=e[e.length-1])}return{value:t,suffix:r}}function pTe(t,e,n,r){let i=e.base||"binary",s=Object.assign({},h_,e);const{binarySuffixes:a,decimalSuffixes:u}=n.currentBytes();let m={general:{scale:1024,suffixes:u||kM,marker:"bd"},binary:{scale:1024,suffixes:a||OZ,marker:"b"},decimal:{scale:1e3,suffixes:u||kM,marker:"d"}}[i],{value:g,suffix:y}=TM(t._value,m.suffixes,m.scale);return`${f_({instance:r(g),providedFormat:e,state:n,defaults:n.currentByteDefaultFormat()})}${s.spaceSeparated?" ":""}${y}`}function gTe(t,e,n){let r=n.currentOrdinal(),i=Object.assign({},h_,e),s=f_({instance:t,providedFormat:e,state:n}),a=r(t._value);return`${s}${i.spaceSeparated?" ":""}${a}`}function vTe(t){let e=Math.floor(t._value/60/60),n=Math.floor((t._value-e*60*60)/60),r=Math.round(t._value-e*60*60-n*60);return`${e}:${n<10?"0":""}${n}:${r<10?"0":""}${r}`}function bTe(t,e,n,r){let i=e.prefixSymbol,s=f_({instance:r(t._value*100),providedFormat:e,state:n}),a=Object.assign({},h_,e);return i?`%${a.spaceSeparated?" ":""}${s}`:`${s}${a.spaceSeparated?" ":""}%`}function yTe(t,e,n){const r=n.currentCurrency();let i=Object.assign({},e),s=Object.assign({},h_,i),a,u="",h=!!s.totalLength||!!s.forceAverage||s.average,m=i.currencyPosition||r.position,g=i.currencySymbol||r.symbol;const y=s.spaceSeparatedCurrency!==void 0?s.spaceSeparatedCurrency:s.spaceSeparated;i.lowPrecision===void 0&&(i.lowPrecision=!1),y&&(u=" "),m==="infix"&&(a=u+g+u);let x=f_({instance:t,providedFormat:i,state:n,decimalSeparator:a});return m==="prefix"&&(t._value<0&&s.negative==="sign"?x=`-${u}${g}${x.slice(1)}`:t._value>0&&s.forceSign?x=`+${u}${g}${x.slice(1)}`:x=g+u+x),(!m||m==="postfix")&&(u=!s.spaceSeparatedAbbreviation&&h?"":u,x=x+u+g),x}function xTe({value:t,forceAverage:e,lowPrecision:n=!0,abbreviations:r,spaceSeparated:i=!1,totalLength:s=0,roundingFunction:a=Math.round}){let u="",h=Math.abs(t),m=-1;if(e&&r[e]&&za[e]?(u=r[e],t=t/za[e]):h>=za.trillion||n&&a(h/za.trillion)===1?(u=r.trillion,t=t/za.trillion):h<za.trillion&&h>=za.billion||n&&a(h/za.billion)===1?(u=r.billion,t=t/za.billion):h<za.billion&&h>=za.million||n&&a(h/za.million)===1?(u=r.million,t=t/za.million):(h<za.million&&h>=za.thousand||n&&a(h/za.thousand)===1)&&(u=r.thousand,t=t/za.thousand),u&&(u=(i?" ":"")+u),s){let y=t<0,x=t.toString().split(".")[0],C=y?x.length-1:x.length;m=Math.max(s-C,0)}return{value:t,abbreviation:u,mantissaPrecision:m}}function wTe({value:t,characteristicPrecision:e}){let[n,r]=t.toExponential().split("e"),i=+n;if(!e)return{value:i,abbreviation:`e${r}`};let s=1;return s<e&&(i=i*Math.pow(10,e-s),r=+r-(e-s),r=r>=0?`+${r}`:r),{value:i,abbreviation:`e${r}`}}function jM(t){let e="";for(let n=0;n<t;n++)e+="0";return e}function CTe(t,e){let n=t.toString(),[r,i]=n.split("e"),[s,a=""]=r.split(".");if(+i>0)n=s+a+jM(i-a.length);else{let u=".";+s<0?u=`-0${u}`:u=`0${u}`;let h=(jM(-i-1)+Math.abs(s)+a).substr(0,e);h.length<e&&(h+=jM(e-h.length)),n=u+h}return+i>0&&e>0&&(n+=`.${jM(e)}`),n}function STe(t,e,n=Math.round){return t.toString().indexOf("e")!==-1?CTe(t,e):new cTe(n(+`${t}e+${e}`)/Math.pow(10,e)).toFixed(e)}function RTe(t,e,n,r,i,s){if(r===-1)return t;let a=STe(e,r,s),[u,h=""]=a.toString().split(".");if(h.match(/^0+$/)&&(n||i))return u;let m=h.match(/0+$/);return i&&m?`${u}.${h.toString().slice(0,m.index)}`:a.toString()}function _Te(t,e,n,r){let i=t,[s,a]=i.toString().split(".");if(s.match(/^-?0$/)&&n)return a?`${s.replace("0","")}.${a}`:s.replace("0","");const u=e<0&&s.indexOf("-")===0;if(u&&(s=s.slice(1),i=i.slice(1)),s.length<r){let h=r-s.length;for(let m=0;m<h;m++)i=`0${i}`}return u&&(i=`-${i}`),i.toString()}function ETe(t,e){let n=[],r=0;for(let i=t;i>0;i--)r===e&&(n.unshift(i),r=0),r++;return n}function NTe(t,e,n,r,i){let s=r.currentDelimiters(),a=s.thousands;i=i||s.decimal;let u=s.thousandsSize||3,h=t.toString(),m=h.split(".")[0],g=h.split(".")[1];const y=e<0&&m.indexOf("-")===0;return n&&(y&&(m=m.slice(1)),ETe(m.length,u).forEach((C,E)=>{m=m.slice(0,C+E)+a+m.slice(C+E)}),y&&(m=`-${m}`)),g?h=m+i+g:h=m,h}function kTe(t,e){return t+e}function TTe(t,e,n){return e===0?t:+t==0?t.replace("-",""):e>0?`+${t}`:n==="sign"?t:`(${t.replace("-","")})`}function jTe(t,e){return e+t}function MTe(t,e){return t+e}function f_({instance:t,providedFormat:e,state:n=Jd,decimalSeparator:r,defaults:i=n.currentDefaults()}){let s=t._value;if(s===0&&n.hasZeroFormat())return n.getZeroFormat();if(!isFinite(s))return s.toString();let a=Object.assign({},h_,i,e),u=a.totalLength,h=u?0:a.characteristic,m=a.optionalCharacteristic,g=a.forceAverage,y=a.lowPrecision,x=!!u||!!g||a.average,C=u?-1:x&&e.mantissa===void 0?0:a.mantissa,E=u?!1:e.optionalMantissa===void 0?C===-1:a.optionalMantissa,M=a.trimMantissa,j=a.thousandSeparated,L=a.spaceSeparated,D=a.negative,z=a.forceSign,H=a.exponential,V=a.roundingFunction,F="";if(x){let te=xTe({value:s,forceAverage:g,lowPrecision:y,abbreviations:n.currentAbbreviations(),spaceSeparated:L,roundingFunction:V,totalLength:u});s=te.value,F+=te.abbreviation,u&&(C=te.mantissaPrecision)}if(H){let te=wTe({value:s,characteristicPrecision:h});s=te.value,F=te.abbreviation+F}let B=RTe(s.toString(),s,E,C,M,V);return B=_Te(B,s,m,h),B=NTe(B,s,j,n,r),(x||H)&&(B=kTe(B,F)),(z||s<0)&&(B=TTe(B,s,D)),B}function Iw(t,e){if(!t)return e;let n=Object.keys(t);return n.length===1&&n[0]==="output"?e:t}var PTe=t=>({format:(...e)=>uTe(...e,t),getByteUnit:(...e)=>mTe(...e,t),getBinaryByteUnit:(...e)=>fTe(...e,t),getDecimalByteUnit:(...e)=>hTe(...e,t),formatOrDefault:Iw});/*! * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */const Wm=AZ;function ATe(t,e,n){let r=new Wm(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new Wm(i),t._value=r.plus(i).toNumber(),t}function IZ(t,e,n){let r=new Wm(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new Wm(i),t._value=r.minus(i).toNumber(),t}function OTe(t,e,n){let r=new Wm(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new Wm(i),t._value=r.times(i).toNumber(),t}function ITe(t,e,n){let r=new Wm(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new Wm(i),t._value=r.dividedBy(i).toNumber(),t}function DTe(t,e,n){let r=e;return n.isNumbro(e)&&(r=e._value),t._value=r,t}function HTe(t,e,n){let r=n(t._value);return IZ(r,e,n),Math.abs(r._value)}var LTe=t=>({add:(e,n)=>ATe(e,n,t),subtract:(e,n)=>IZ(e,n,t),multiply:(e,n)=>OTe(e,n,t),divide:(e,n)=>ITe(e,n,t),set:(e,n)=>DTe(e,n,t),difference:(e,n)=>HTe(e,n,t),BigNumber:Wm});/*! * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */const $Te="2.5.0",af=UF(),FTe=VF(),zTe=oTe(Zs),VTe=TZ();let ub=PTe(Zs),db=LTe(Zs);const BTe=BF;class DZ{constructor(e){this._value=e}clone(){return Zs(this._value)}format(e={}){return ub.format(this,e)}formatCurrency(e){return typeof e=="string"&&(e=BTe.parseFormat(e)),e=ub.formatOrDefault(e,af.currentCurrencyDefaultFormat()),e.output="currency",ub.format(this,e)}formatTime(e={}){return e.output="time",ub.format(this,e)}binaryByteUnits(){return ub.getBinaryByteUnit(this)}decimalByteUnits(){return ub.getDecimalByteUnit(this)}byteUnits(){return ub.getByteUnit(this)}difference(e){return db.difference(this,e)}add(e){return db.add(this,e)}subtract(e){return db.subtract(this,e)}multiply(e){return db.multiply(this,e)}divide(e){return db.divide(this,e)}set(e){return db.set(this,HZ(e))}value(){return this._value}valueOf(){return this._value}}function HZ(t){let e=t;return Zs.isNumbro(t)?e=t._value:typeof t=="string"?e=Zs.unformat(t):isNaN(t)&&(e=NaN),e}function Zs(t){return new DZ(HZ(t))}Zs.version=$Te,Zs.isNumbro=function(t){return t instanceof DZ},Zs.language=af.currentLanguage,Zs.registerLanguage=af.registerLanguage,Zs.setLanguage=af.setLanguage,Zs.languages=af.languages,Zs.languageData=af.languageData,Zs.zeroFormat=af.setZeroFormat,Zs.defaultFormat=af.currentDefaults,Zs.setDefaults=af.setDefaults,Zs.defaultCurrencyFormat=af.currentCurrencyDefaultFormat,Zs.validate=FTe.validate,Zs.loadLanguagesInNode=zTe.loadLanguagesInNode,Zs.unformat=VTe.unformat,Zs.BigNumber=db.BigNumber;var WTe=Zs,hb=Fke(WTe);const UTe={useGrouping:!1,maximumFractionDigits:20};function YTe(t,e){const{numericFormat:n}=e,r=n&&n.culture||"-",i=n&&n.pattern;if(typeof r<"u"&&!hb.languages()[r]){const s=r.replace("-",""),a=hb.allLanguages?hb.allLanguages[r]:hb[s];a&&hb.registerLanguage(a)}return hb.setLanguage(r),hb(t).format(i||"0")}function GTe(t,e){const{numericFormat:n,locale:r}=e;return new Intl.NumberFormat(r,n??UTe).format(t)}function LZ(t){const{numericFormat:e}=t;return(e==null?void 0:e.pattern)!==void 0||(e==null?void 0:e.culture)!==void 0}const KTe="numeric",$Z=new WeakSet;function FZ(t,e){return Vl(t)&&(LZ(e)?t=YTe(t,e):t=GTe(t,e)),t}function m_(t,e,n,r,i,s,a){if(LZ(a)&&!$Z.has(a.instance)&&($Z.add(a.instance),xg("The `numericFormat.pattern` and `numericFormat.culture` options are deprecated and will be removed in the next major release. Pass `Intl.NumberFormat` options directly to `numericFormat` and use the `locale` cell property instead of `culture`.\n\nMigration guide: https://handsontable.com/docs/migration-from-16.2-to-17.0/\n`numericFormat` documentation: https://handsontable.com/docs/api/options/#numericformat\n`locale` documentation: https://handsontable.com/docs/api/options/#locale")),Vl(t.getDataAtCell(n,r))){let m=[];if(Array.isArray(a.className))m=a.className;else{var h;const g=(h=a.className)!==null&&h!==void 0?h:"";g.length&&(m=g.split(" "))}m.indexOf("htLeft")<0&&m.indexOf("htCenter")<0&&m.indexOf("htRight")<0&&m.indexOf("htJustify")<0&&m.push("htRight"),m.indexOf("htNumeric")<0&&m.push("htNumeric"),a.className=m.join(" "),e.dir="ltr"}Yd.apply(this,[t,e,n,r,i,s,a])}m_.valueFormatter=FZ,m_.RENDERER_TYPE=KTe;const qTe="password";function XTe(t,e){const n=e.hashLength||Hi(t).length,r=e.hashSymbol||"*";let i="";for(let s=0;s<n;s++)i+=r;return i}function MM(t,e,n,r,i,s){M0(e,s,t.getSettings().sanitizer)}MM.valueFormatter=XTe,MM.RENDERER_TYPE=qTe;const QTe="select";function GF(t,e,n,r,i,s,a){Yd.apply(this,[t,e,n,r,i,s,a])}GF.RENDERER_TYPE=QTe;const ZTe="time",zZ=new WeakSet;function KF(t,e,n,r,i,s,a){!zZ.has(a.instance)&&typeof a.timeFormat=="string"&&(zZ.add(a.instance),xg("The `time` cell type with string-based `timeFormat` (moment.js) is deprecated. In the next major release, `time` will accept only Intl.DateTimeFormat options (object). To start migrating, use the `intl-time` cell type now; it will become the `time` cell type after the next major release (the `intl-time` will become an alias for `time`).\n\nMigration guide: https://handsontable.com/docs/migration-from-16.2-to-17.0/\n`time` cell type: https://handsontable.com/docs/time-cell-type/")),Yd.apply(this,[t,e,n,r,i,s,a]),e.dir="ltr"}KF.RENDERER_TYPE=ZTe;function JTe(){Bl(Pw),Bl(Yj),Bl(EM),Bl(_M),Bl(HF),Bl(IF),Bl(NM),Bl(LF),Bl(m_),Bl(MM),Bl(GF),Bl(Yd),Bl(KF)}const eje="autocomplete";function PM(t,e){const n=s=>nn(s)&&Lt(s.key)&&Lt(s.value),r=s=>n(s)?r(s.key)&&r(s.value):s==null;let i=t;if(r(i)&&(i=""),this.allowEmpty&&i===""){e(!0);return}this.strict&&this.source?typeof this.source=="function"?this.source(i,VZ(i,e)):VZ(i,e)(this.source):e(!0)}PM.VALIDATOR_TYPE=eje;function VZ(t,e){const n=t;return function(r){let i=!1;for(let s=0,a=r.length;s<a;s++)if(N0(n,r[s])){i=!0;break}e(i)}}const tje="date";function qF(t,e){const n=jG(VQ,this.instance);let r=t,i=!0;r==null&&(r="");let s=Tt(r,this.dateFormat||n.defaultDateFormat,!0).isValid(),a=Tt(new Date(r)).isValid()||s;if(this.allowEmpty&&r===""&&(a=!0,s=!0),a||(i=!1),!a&&s&&(i=!0),a&&!s)if(this.correctFormat===!0){const u=nje(r,this.dateFormat);this.instance.setDataAtCell(this.visualRow,this.visualCol,u,"dateValidator"),i=!0}else i=!1;e(i)}qF.VALIDATOR_TYPE=tje;function nje(t,e){const n=Tt(yNe(t)),r=Tt(t,e),i=t.search(/[A-Za-z]/g)>-1;let s;return n.isValid()&&n.format("x")===r.format("x")||!r.isValid()||i?s=n:s=r,s.format(e)}const rje="dropdown";function XF(t,e){PM.apply(this,[t,e])}XF.VALIDATOR_TYPE=rje;const ije="intl-date",sje=`Source data warning ([itemsCount]). Invalid value for "intl-date" cell type. [affectedCells] Expected a value compatible with the ISO 8601 date format ("YYYY-MM-DD").`;function oje(t,e){return e.allowEmpty&&Yr(t)?!0:_F(t)}function QF(t,e){if(this.allowEmpty&&Yr(t)){e(!0);return}e(_F(t))}QF.VALIDATOR_TYPE=ije;const aje="intl-time",lje=`Source data warning ([itemsCount]). Invalid value for "intl-time" cell type. [affectedCells] Expected a value compatible with the 24-hour time format ("HH:mm", "HH:mm:ss" or "HH:mm:ss.SSS").`;function cje(t,e){return e.allowEmpty&&Yr(t)?!0:EF(t)}function ZF(t,e){if(this.allowEmpty&&Yr(t)){e(!0);return}e(EF(t))}ZF.VALIDATOR_TYPE=aje;const uje="multiselect";function JF(t,e){let n=t;if(n==null&&(n=""),this.allowEmpty&&n===""){e(!0);return}else if(!this.allowEmpty&&n===""){e(!1);return}if(!Array.isArray(n)){e(!1);return}if(Array.isArray(n)&&n.length===0){e(!0);return}this.source?typeof this.source=="function"?this.source(n,BZ(n,e)):BZ(n,e)(this.source):e(!0)}JF.VALIDATOR_TYPE=uje;function BZ(t,e){const n=t;return function(r){let i=!0;for(let s=0,a=n.length;s<a;s++){let u=!1;for(let h=0,m=r.length;h<m;h++)if(Mo(n[s])&&!Mo(r[h])||!Mo(n[s])&&Mo(r[h])){u=!1;break}else(Mo(n[s])&&Mo(r[h])&&N0(n[s],r[h])||typeof n[s]=="string"&&typeof r[h]=="string"&&n[s]===r[h])&&(u=!0);if(!u){i=!1;break}}e(i)}}const dje="numeric";function ez(t,e){let n=t;n==null&&(n=""),this.allowEmpty&&n===""?e(!0):e(n===""?!1:Vl(t))}ez.VALIDATOR_TYPE=dje;const hje=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],fje="time";function tz(t,e){const n=this.timeFormat||"h:mm:ss a";let r=!0,i=t;i===null&&(i=""),i=/^\d{3,}$/.test(i)?parseInt(i,10):i;const s=/^\d{1,2}$/.test(i);s&&(i+=":00");const a=Tt(i,hje,!0).isValid()?Tt(i):Tt(i,n);let u=a.isValid(),h=Tt(i,n,!0).isValid()&&!s;if(this.allowEmpty&&i===""&&(u=!0,h=!0),u||(r=!1),!u&&h&&(r=!0),u&&!h)if(this.correctFormat===!0){const m=a.format(n);this.instance.setDataAtCell(this.visualRow,this.visualCol,m,"timeValidator"),r=!0}else r=!1;e(r)}tz.VALIDATOR_TYPE=fje;function mje(){Sm(PM),Sm(XF),Sm(qF),Sm(QF),Sm(ZF),Sm(JF),Sm(ez),Sm(tz)}function WZ(t){return nn(t)&&t.value!==void 0?t.value:t}function UZ(t,e,n){const r=this.getSourceDataAtCell(this.toPhysicalRow(e),this.toPhysicalColumn(n));return Mo(r)?Mo(t)?t:{key:t,value:t}:t}const pje={CELL_TYPE:"autocomplete",editor:L$,renderer:Pw,validator:PM,valueGetter:WZ,valueSetter:UZ,parsePastedValue:!0};function gje(t,e,n){const{checkedTemplate:r,uncheckedTemplate:i}=this.getCellMeta(e,n),s=Hi(t),a=s===Hi(r),u=s===Hi(i);return a||u?a?r:i:t}const vje={CELL_TYPE:"checkbox",editor:$X,renderer:EM,valueSetter:gje},bje="date",YZ=new WeakSet;function GZ(t,e,n,r,i,s,a){!YZ.has(a.instance)&&typeof a.dateFormat=="string"&&(YZ.add(a.instance),xg("The `date` cell type with string-based `dateFormat` (moment.js) is deprecated. In the next major release, `date` will accept only Intl.DateTimeFormat options (object). To start migrating, use the `intl-date` cell type now; it will become the `date` cell type after the next major release (the `intl-date` will become an alias for `date`).\n\nMigration guide: https://handsontable.com/docs/migration-from-16.2-to-17.0/\n`date` cell type: https://handsontable.com/docs/date-cell-type/")),Pw.apply(this,[t,e,n,r,i,s,a])}GZ.RENDERER_TYPE=bje;const yje={CELL_TYPE:"date",editor:UQ,renderer:GZ,validator:qF};function xje(t){return WZ.call(this,t)}function wje(t,e,n,r){return UZ.call(this,t,e,n,r)}const Cje={CELL_TYPE:"dropdown",editor:YQ,renderer:_M,validator:XF,filter:!1,strict:!0,valueGetter:xje,valueSetter:wje,parsePastedValue:!0},Sje={CELL_TYPE:"handsontable",editor:P$,renderer:HF},Rje={CELL_TYPE:"intl-date",editor:qQ,renderer:NM,validator:QF,sourceDataValidator:oje,sourceDataWarningMessage:sje,valueFormatter:EZ},_je={CELL_TYPE:"intl-time",editor:XQ,renderer:LF,validator:ZF,sourceDataValidator:cje,sourceDataWarningMessage:lje,valueFormatter:Lke},AM="ht-multi-select",nz=`${AM}-chip`,rz=`${AM}-chip-remove`,Eje=`${AM}-chip-label`,KZ=`${AM}-overflow`,qZ=new WeakSet,Um=new WeakMap,iz=new WeakMap;function sz(t,e){return Mo(t)?t[e]:t}function XZ(t){if(t==null||t==="")return[];if(Array.isArray(t))return t;if(typeof t=="string")try{const e=JSON.parse(t);return Array.isArray(e)?e:[e]}catch{return t.trim()?[t]:[]}return[t]}function Nje(t,e,n,r,i){const s=t.createElement("span"),a=sz(e,"value");st(s,nz),s.dataset.row=r,s.dataset.prop=i,s.title=a;const u=t.createElement("span");st(u,Eje),u.textContent=a,s.appendChild(u);const h=t.createElement("span");return st(h,rz),n&&h.setAttribute(...ym()),s.dataset.key=sz(e,"key"),s.appendChild(h),s}function kje(t,e){const n=t.createElement("span");return st(n,KZ),n.textContent=`+${e}`,n}function Tje(t,e){if(iz.has(t))return;iz.set(t,new Sc(t)),iz.get(t).addEventListener(t.rootElement,"click",r=>{if(!Dn(r.target,rz))return;r.preventDefault(),r.stopPropagation();const i=r.target.closest(`.${nz}`);if(!i)return;const s=i.dataset.row,a=i.dataset.prop,u=t.toPhysicalRow(s),h=typeof a=="string"?a:t.toPhysicalColumn(a),m=t.propToCol(a),g=t.getSourceDataAtCell(u,m),y=i.dataset.key,x=Aje(XZ(g),y);t.setSourceDataAtCell(u,h,x,`${e}-renderer`),t.render()}),t.addHook("beforeOnCellMouseDown",r=>{Dn(r.target,rz)&&iu(r)})}function jje(t,e){var n,r,i;const s=t.getColWidth(e);return Um.has(t)?((n=Um.get(t))===null||n===void 0||(n=n[e])===null||n===void 0?void 0:n.width)!==s&&Um.set(t,{...Um.get(t),[e]:{width:s}}):Um.set(t,{[e]:{width:s}}),qZ.has(t)||(t.addHook("beforeColumnResize",(a,u)=>{var h;((h=Um.get(t))===null||h===void 0||(h=h[u])===null||h===void 0?void 0:h.width)!==a&&Um.set(t,{...Um.get(t),[u]:{width:a}})}),qZ.add(t)),(r=(i=Um.get(t))===null||i===void 0||(i=i[e])===null||i===void 0?void 0:i.width)!==null&&r!==void 0?r:s}function Mje(t,e,n){const r=t,i=e.querySelectorAll(`.${nz}`);for(let x=0;x<i.length;x++)i[x].style.display="";if(r===null||i.length===0)return;let s=e.querySelector(`.${KZ}`);s?(s.style.display="",s.style.visibility="hidden"):(s=kje(n,i.length),s.style.visibility="hidden",e.appendChild(s));const a=n.defaultView.getComputedStyle(e),u=parseFloat(a.gap)||0,h=s.offsetWidth;let m=0,g=0;for(let x=0;x<i.length;x++){const C=i[x].offsetWidth,E=x<i.length-1?u:0,M=m+C+E,j=x<i.length-1,L=r-(j?h+u:0);if(M<=L)m=M,g+=1;else break}const y=i.length-g;if(y>0){for(let x=g;x<i.length;x++)i[x].style.display="none";s.textContent=`+${y}`,s.style.visibility="visible"}else s.style.display="none"}function Pje(t,e,n){Mje(t,e,n)}function Aje(t,e){return t.filter(n=>sz(n,"key")!==e)}const QZ="multiselect",Oje="ht-multi-select-renderer",Ije="ht-multi-select-chips-container";function ZZ(t,e,n,r,i,s,a){Yj.apply(this,[t,e,n,r,i,s,a]);let u=s;if(!u&&a.placeholder){u=a.placeholder,u=Hi(u),Cg(e,u);return}const{rootDocument:h}=t,m=t.getSettings().ariaTags,g=t.toPhysicalRow(n),y=typeof r=="string"?r:t.toPhysicalColumn(r),x=t.getSourceDataAtCell(g,y),C=XZ(x);if(Bh(e),st(e,Oje),C.length===0){e.appendChild(h.createTextNode(""));return}const E=h.createElement("div");E.className=Ije,C.forEach(j=>{const L=Nje(h,j,m,n,i);E.appendChild(L)}),e.appendChild(E),Tje(t,QZ);const M=jje(t,r);Pje(M,E,h)}ZZ.RENDERER_TYPE=QZ;function Dje(t){return Array.isArray(t)?Bme(t.map(e=>Mo(e)?e.value:e),", "):t}function Hje(t,e,n){if(Array.isArray(t)){const r=this.getSourceDataAtCell(this.toPhysicalRow(e),n);if(Array.isArray(r)&&r.length>0&&Mo(r[0]))return t.map(i=>Mo(i)?i:{key:i,value:i})}return t}const Lje={CELL_TYPE:"multiselect",_complexDataFormat:!0,editor:vZ,renderer:ZZ,validator:JF,valueGetter:Dje,valueSetter:Hje,parsePastedValue:!0};function $je(t){if(typeof t=="string"&&xge(t)){const e=wge(t);return FR(e)?t:e}return t}const Fje={CELL_TYPE:"numeric",editor:QQ,renderer:m_,validator:ez,dataType:"number",valueSetter:$je,valueFormatter:FZ},zje={CELL_TYPE:"password",editor:ZQ,renderer:MM,copyable:!1},Vje={CELL_TYPE:"select",editor:eZ,renderer:GF},Bje={CELL_TYPE:"time",editor:tZ,renderer:KF,validator:tz};function Wje(){kc(pje),kc(vje),kc(yje),kc(Cje),kc(Sje),kc(Rje),kc(_je),kc(Lje),kc(Fje),kc(zje),kc(Vje),kc(dX),kc(Bje)}function Uje(t,e){eJ(t,e),e.add(t)}function Dw(t,e,n){return(e=Yje(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yje(t){var e=Gje(t,"string");return typeof e=="symbol"?e:e+""}function Gje(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function JZ(t,e,n){eJ(t,e),e.set(t,n)}function eJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function OM(t,e,n){return t.set(oz(t,e),n),n}function Js(t,e){return t.get(oz(t,e))}function oz(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const tJ=new Map([["plugin",Tge],["cell-type",yq],["editor",TG],["renderer",BG],["validator",WG]]),nJ=Symbol("mainSetting"),Kje="base",IM=[];let fb=null;var Co=new WeakMap,mb=new WeakMap,rJ=new WeakSet;class Zr{static get PLUGIN_KEY(){return Kje}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}static get DEFAULT_SETTINGS(){return{}}static get SETTINGS_VALIDATORS(){return null}constructor(e){Uje(this,rJ),JZ(this,Co,null),Dw(this,"eventManager",new Sc(this)),Dw(this,"pluginName",null),Dw(this,"pluginsInitializedCallbacks",[]),Dw(this,"isPluginsReady",!1),Dw(this,"enabled",!1),Dw(this,"initialized",!1),JZ(this,mb,{}),xm(this,"hot",e,{writable:!1}),fb=null,this.hot.addHook("afterPluginsInitialized",()=>this.onAfterPluginsInitialized()),this.hot.addHook("afterUpdateSettings",n=>this.onUpdateSettings(n)),this.hot.addHook("beforeInit",()=>this.init())}init(){this.pluginName=this.hot.getPluginName(this),this.updatePluginSettings(this.hot.getSettings()[this.constructor.PLUGIN_KEY]);const e=this.constructor.PLUGIN_DEPS,n=Array.isArray(e)?e:[];if(n.length>0){const i=[];if(n.forEach(s=>{const[a,u]=s.split(":");tJ.has(a)||gt(`Unknown plugin dependency type "${a}" was found.`),tJ.get(a)(u)||i.push(` - ${u} (${a})`)}),i.length>0){const s=[`The ${this.pluginName} plugin requires the following modules: `,`${i.join(` `)} `].join("");IM.push(s)}}if(fb||(fb=VG()),fb.indexOf(this.pluginName)>=0&&fb.splice(fb.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()}),fb.length===0){if(IM.length>0){const i=[`${IM.join(` `)} `,"You have to import and register them manually."].join("");IM.length=0,gt(i)}this.hot.runHooks("afterPluginsInitialized")}this.initialized=!0}enablePlugin(){this.enabled=!0}disablePlugin(){var e;(e=this.eventManager)===null||e===void 0||e.clear(),this.clearHooks(),this.enabled=!1}getSetting(e){var n=this;const r=this.constructor.DEFAULT_SETTINGS,i=this.constructor.SETTINGS_VALIDATORS;if(e===void 0)return nn(Js(Co,this))?kT(Js(Co,this),r):Js(Co,this);let s;if((Array.isArray(Js(Co,this))||nn(Js(Co,this)))&&r[nJ]===e)if(Array.isArray(Js(Co,this)))s=Js(Co,this);else{var a;s=(a=Js(Co,this)[e])!==null&&a!==void 0?a:r[e]}else if(e.includes(".")){const u=JH(Js(Co,this),e),h=JH(r,e);nn(u)?s=kT(u,h):s=u!==void 0?u:h}else nn(Js(Co,this))?s=kT(Js(Co,this),r)[e]:s=r[e];if(typeof s=="function"&&i&&typeof i=="object"){const u=i[e];if(u&&typeof u=="function")return function(){for(var h=arguments.length,m=new Array(h),g=0;g<h;g++)m[g]=arguments[g];const y=s(...m);if(u(y)===!1){const C=m.map(M=>typeof M=="string"?`"${M}"`:"").join(", "),E=m.length>0?C:"";Yn(`${n.pluginName} Plugin: "${e}" function (${E}) result is not valid and will be ignored.`);return}return y}}return s}updatePluginSettings(e){const n=this.constructor.SETTINGS_VALIDATORS;if(n&&typeof n=="function"&&typeof e!="object"){if(n(e)===!1){Yn(`${this.pluginName} Plugin: option is not valid and it will be ignored.`);return}return OM(Co,this,e),Js(Co,this)}return n&&typeof n=="object"&&typeof e=="object"?((Js(Co,this)===null||typeof Js(Co,this)!="object")&&OM(Co,this,{...this.constructor.DEFAULT_SETTINGS}),Object.keys(n).forEach(r=>{if(!(r in e))return;const i=n[r];if((i?i(e[r]):!0)===!1){Yn(`${this.pluginName} Plugin: "${r}" option is not valid and it will be ignored.`);return}Js(Co,this)[r]=e[r]}),Js(Co,this)):(OM(Co,this,e),e)}addHook(e,n,r){Js(mb,this)[e]=Js(mb,this)[e]||[];const i=Js(mb,this)[e];this.hot.addHook(e,n,r),i.push(n),Js(mb,this)[e]=i}removeHooks(e){Te(Js(mb,this)[e]||[],n=>{this.hot.removeHook(e,n)})}clearHooks(){const e=Js(mb,this);Mr(e,(n,r)=>this.removeHooks(r)),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){Te(this.pluginsInitializedCallbacks,e=>e()),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){const n=oz(rJ,this,qje).call(this,e);this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&n&&(this.updatePluginSettings(e[this.constructor.PLUGIN_KEY]),this.updatePlugin(e)))}updatePlugin(){}destroy(){var e;OM(Co,this,null),(e=this.eventManager)===null||e===void 0||e.destroy(),this.clearHooks(),Mr(this,(n,r)=>{r!=="hot"&&(this[r]=null)}),delete this.t,delete this.hot}}function qje(t){if(!t)return!1;const e=this.constructor.SETTING_KEYS;if(typeof e=="boolean")return e;for(let n=0;n<e.length;n++)if(t[e[n]]!==void 0)return!0;return!1}function pb(t,e,n){return(e=Xje(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xje(t){var e=Qje(t,"string");return typeof e=="symbol"?e:e+""}function Qje(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}let iJ=class{constructor(e){pb(this,"hot",null),pb(this,"container",null),pb(this,"injected",!1),pb(this,"rows",[]),pb(this,"columns",[]),pb(this,"samples",null),pb(this,"settings",{useHeaders:!0}),this.hot=e}addRow(e,n){this.columns.length&>("Doesn't support multi-dimensional table"),this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));const r={row:e};this.rows.push(r),this.samples=n,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol(e)),this.table.tr.appendChild(this.createRow(e)),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}addColumnHeadersRow(e){const n=this.hot.getColHeader(0);if(n!=null){const r={row:-1};this.rows.push(r),this.container=this.createContainer(this.hot.rootElement.className),this.samples=e,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.appendColumnHeadersRow(),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}}addColumn(e,n){this.rows.length&>("Doesn't support multi-dimensional table"),this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));const r={col:e};this.columns.push(r),this.samples=n,this.table=this.createTable(this.hot.table.className),this.getSetting("useHeaders")&&this.hot.getColHeader(e)!==null&&this.hot.view.appendColHeader(e,this.table.th,void 0,-1),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}getHeights(e){this.injected||this.injectTable(),Te(this.rows,n=>{const{height:r}=n.table.getBoundingClientRect();e(n.row,Math.ceil(r))})}getWidths(e){this.injected||this.injectTable(),Te(this.columns,n=>{const{width:r}=n.table.getBoundingClientRect();e(n.col,Math.ceil(r))})}setSettings(e){this.settings=e}setSetting(e,n){this.settings||(this.settings={}),this.settings[e]=n}getSettings(){return this.settings}getSetting(e){return this.settings?this.settings[e]:null}createColGroupsCol(e){const n=this.hot.rootDocument.createDocumentFragment();return this.hot.hasRowHeaders()&&n.appendChild(this.createColElement(-1,-1)),this.samples.forEach(r=>{Te(r.strings,i=>{n.appendChild(this.createColElement(i.col,e))})}),n}createRow(e){const{rootDocument:n}=this.hot,r=n.createDocumentFragment(),i=n.createElement("th");return this.hot.hasRowHeaders()&&(this.hot.view.appendRowHeader(e,i),r.appendChild(i)),this.samples.forEach(s=>{Te(s.strings,a=>{const u=a.col,h=this.hot.getCellMeta(e,u),m=this.hot.getCellRenderer(h),g=n.createElement("td");g.setAttribute("ghost-table",1),m(this.hot,g,e,u,this.hot.colToProp(u),a.value,h),r.appendChild(g)})}),r}appendColumnHeadersRow(){const{rootDocument:e}=this.hot,n=e.createDocumentFragment(),r=[];if(this.hot.hasRowHeaders()){const i=e.createElement("th");r.push([-1,i]),n.appendChild(i)}this.samples.forEach(i=>{Te(i.strings,s=>{const a=s.col,u=e.createElement("th");r.push([a,u]),n.appendChild(u)})}),this.table.tHead.appendChild(n),Te(r,i=>{const[s,a]=i;this.hot.view.appendColHeader(s,a)})}createCol(e){const{rootDocument:n}=this.hot,r=n.createDocumentFragment();return this.samples.forEach(i=>{Te(i.strings,s=>{const a=s.row,u=this.hot.getCellMeta(a,e),h=this.hot.getCellRenderer(u),m=n.createElement("td"),g=n.createElement("tr");m.setAttribute("ghost-table",1),h(this.hot,m,a,e,this.hot.colToProp(e),s.value,u),g.appendChild(m),r.appendChild(g)})}),r}clean(){this.rows.length=0,this.rows[-1]=void 0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()}injectTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)}removeTable(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)}createColElement(e,n){const r=this.hot.rootDocument.createElement("col");let i=0;n>=0&&e>=0&&(i=this.hot.getCellMeta(n,e).colspan);let s=this.hot.getColWidth(e);if(i>1)for(let a=e+1;a<e+i;a++)s+=this.hot.getColWidth(a);return r.style.width=`${s}px`,r}createTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:n}=this.hot,r=n.createDocumentFragment(),i=n.createElement("table"),s=n.createElement("thead"),a=n.createElement("tbody"),u=n.createElement("colgroup"),h=n.createElement("tr"),m=n.createElement("th");return this.isVertical()&&i.appendChild(u),this.isHorizontal()&&(h.appendChild(m),s.appendChild(h),i.style.tableLayout="auto",i.style.width="auto"),i.appendChild(s),this.isVertical()&&a.appendChild(h),i.appendChild(a),st(i,e),r.appendChild(i),{fragment:r,table:i,tHead:s,tBody:a,colGroup:u,tr:h,th:m}}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:n}=this.hot,r=n.createDocumentFragment(),i=n.createElement("div"),s=`htGhostTable htAutoSize ${e.trim()}`;return st(i,s),r.appendChild(i),{fragment:r,container:i}}isVertical(){return!!(this.rows.length&&!this.columns.length)}isHorizontal(){return!!(this.columns.length&&!this.rows.length)}};function p_(t,e,n){return(e=Zje(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zje(t){var e=Jje(t,"string");return typeof e=="symbol"?e:e+""}function Jje(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class DM{static get SAMPLE_COUNT(){return 3}constructor(e){p_(this,"samples",null),p_(this,"dataFactory",null),p_(this,"customSampleCount",null),p_(this,"allowDuplicates",!1),p_(this,"includeHidden",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:DM.SAMPLE_COUNT}setSampleCount(e){this.customSampleCount=e}setAllowDuplicates(e){this.allowDuplicates=e}setIncludeHidden(e){this.includeHidden=e}generateRowSamples(e,n){return this.generateSamples("row",n,e)}generateColumnSamples(e,n){return this.generateSamples("col",n,e)}generateSamples(e,n,r){const i=new Map,{from:s,to:a}=typeof r=="number"?{from:r,to:r}:r;return En(s,a,u=>{const h=this.generateSample(e,n,u);i.set(u,h)}),i}generateSample(e,n,r){e!=="row"&&e!=="col"&>("Unsupported sample type");const i=new Map,s=e==="row"?"col":"row",a=[];return En(n.from,n.to,u=>{const h=e==="row"?this.dataFactory(r,u,this):this.dataFactory(u,r,this);if(h===!1)return;const{value:m,bundleSeed:g}=h,y=typeof g=="string"&&g.length>0;let x;y?x=g:nn(m)?x=`${Object.keys(m).length}`:Array.isArray(m)?x=`${m.length}`:x=`${Hi(m).length}`,i.has(x)||i.set(x,{needed:this.getSampleCount(),strings:[]});const C=i.get(x);C.needed&&(!(a.indexOf(m)>-1)||this.allowDuplicates||y)&&(C.strings.push({value:m,[s]:u}),a.push(m),C.needed-=1)}),i}}function eMe(t,e){sJ(t,e),e.add(t)}function az(t,e,n){sJ(t,e),e.set(t,n)}function sJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function g_(t,e,n){return(e=tMe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tMe(t){var e=nMe(t,"string");return typeof e=="symbol"?e:e+""}function nMe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fg(t,e){return t.get(jc(t,e))}function HM(t,e,n){return t.set(jc(t,e),n),n}function jc(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}un.getSingleton().register("modifyAutoColumnSizeSeed");const lz="autoColumnSize",rMe=10,iMe="autoColumnSize";var cz=new WeakMap,Hw=new WeakMap,Lw=new WeakMap,vu=new WeakSet;class v_ extends Zr{static get PLUGIN_KEY(){return lz}static get PLUGIN_PRIORITY(){return rMe}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 50}constructor(e){super(e),eMe(this,vu),g_(this,"ghostTable",new iJ(this.hot)),g_(this,"samplesGenerator",new DM((n,r)=>{const i=this.hot.toPhysicalRow(n),s=this.hot.toPhysicalColumn(r);if(this.hot.rowIndexMapper.isHidden(i)||this.hot.columnIndexMapper.isHidden(s))return!1;const a=this.hot.getCellMeta(n,r);let u="";a.spanned||(u=this.hot.getDataAtCell(n,r),typeof a.valueFormatter=="function"&&(u=a.valueFormatter(u,a)));let h="";return this.hot.hasHook("modifyAutoColumnSizeSeed")&&(h=this.hot.runHooks("modifyAutoColumnSizeSeed",h,a,u)),{value:u,bundleSeed:h}})),g_(this,"inProgress",!1),g_(this,"measuredColumns",0),g_(this,"columnWidthsMap",new Ng),az(this,cz,!1),az(this,Hw,[]),az(this,Lw,[]),this.hot.columnIndexMapper.registerMap(iMe,this.columnWidthsMap),this.addHook("beforeColumnResize",(n,r,i)=>jc(vu,this,lJ).call(this,n,r,i))}isEnabled(){return this.hot.getSettings()[lz]!==!1&&!this.hot.getSettings().colWidths}enablePlugin(){var e=this;if(this.enabled)return;this.ghostTable.setSetting("useHeaders",this.getSetting("useHeaders")),this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const n=this.getSetting("samplingRatio");n&&!isNaN(n)&&this.samplesGenerator.setSampleCount(parseInt(n,10)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return jc(vu,e,aMe).call(e,...i)}),this.addHook("beforeChangeRender",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return jc(vu,e,lMe).call(e,...i)}),this.addHook("afterFormulasValuesUpdate",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return jc(vu,e,uMe).call(e,...i)}),this.addHook("beforeRender",()=>jc(vu,this,oMe).call(this)),this.addHook("modifyColWidth",(r,i)=>this.getColumnWidth(i,r)),this.addHook("init",()=>jc(vu,this,cMe).call(this)),super.enablePlugin()}updatePlugin(){HM(Lw,this,this.findColumnsWhereHeaderWasChanged()),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.addHook("beforeColumnResize",(e,n,r)=>jc(vu,this,lJ).call(this,e,n,r))}calculateVisibleColumnsWidth(){if(!this.hot.countRows())return;const e=this.getFirstVisibleColumn(),n=this.getLastVisibleColumn();if(e===-1||n===-1)return;const r=this.hot.forceFullRender;this.calculateColumnsWidth({from:e,to:n},void 0,r)}calculateColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countRows()-1},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,s=typeof n=="number"?{from:n,to:n}:n;En(i.from,i.to,a=>{let u=this.hot.toPhysicalColumn(a);u===null&&(u=a),(r||this.columnWidthsMap.getValueAtIndex(u)===null&&!this.hot._getColWidthFromSettings(u))&&jc(vu,this,oJ).call(this,a,s)}),this.ghostTable.columns.length&&(jc(vu,this,aJ).call(this),this.measuredColumns=i.to+1,this.ghostTable.clean())}calculateAllColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0;const i=this.hot.countCols()-1;let s=null;this.inProgress=!0;const a=()=>{if(!this.hot){jT(s),this.inProgress=!1;return}this.calculateColumnsWidth({from:r,to:Math.min(r+v_.CALCULATION_STEP,i)},e,n),r=r+v_.CALCULATION_STEP+1,r<i?s=TT(a):(jT(s),this.inProgress=!1,this.hot.view.adjustElementsSize())},u=this.getSyncCalculationLimit();u>=0&&(this.calculateColumnsWidth({from:0,to:u},e,n),r=u+1),r<i?a():this.inProgress=!1}recalculateAllColumnsWidth(){this.hot.view.isVisible()&&this.calculateAllColumnsWidth({from:0,to:this.hot.countRows()-1},!0)}getSyncCalculationLimit(){const e=this.hot.getSettings()[lz];let n=v_.SYNC_CALCULATION_LIMIT;const r=this.hot.countCols()-1;return nn(e)&&(n=e.syncLimit,YY(n)?n=LG(r,n):n>>=0),Math.min(n,r)}getColumnWidth(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=n;return i===void 0&&(i=this.columnWidthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e)),r&&typeof i=="number"&&(i=Math.max(i,Kx))),i}getFirstVisibleColumn(){var e;return(e=this.hot.getFirstRenderedVisibleColumn())!==null&&e!==void 0?e:-1}getLastVisibleColumn(){var e;return(e=this.hot.getLastRenderedVisibleColumn())!==null&&e!==void 0?e:-1}findColumnsWhereHeaderWasChanged(){return this.hot.getColHeader().reduce((r,i,s)=>{const a=Fg(Hw,this).length;return(a-1<s||Fg(Hw,this)[s]!==i)&&r.push(this.hot.toVisualColumn(s)),a-1<s?Fg(Hw,this).push(i):Fg(Hw,this)[s]=i,r},[])}clearCache(e){Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(n=>{this.columnWidthsMap.setValueAtIndex(n,null)})},!0):this.columnWidthsMap.clear()}isNeedRecalculate(){return!!this.columnWidthsMap.getValues().slice(0,this.measuredColumns).filter(e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function sMe(t){const e={from:0,to:this.hot.countRows()-1};t.forEach(n=>{const r=this.hot.toPhysicalColumn(n);r!==null&&(this.hot._getColWidthFromSettings(r)||jc(vu,this,oJ).call(this,n,e))}),this.ghostTable.columns.length&&(jc(vu,this,aJ).call(this),this.ghostTable.clean())}function oJ(t,e){this.samplesGenerator.generateColumnSamples(t,e).forEach((r,i)=>this.ghostTable.addColumn(i,r))}function aJ(){this.hot.batchExecution(()=>{this.ghostTable.getWidths((t,e)=>{const n=this.hot.toPhysicalColumn(t);this.columnWidthsMap.setValueAtIndex(n,e)})},!0)}function oMe(){this.calculateVisibleColumnsWidth(),this.inProgress||(jc(vu,this,sMe).call(this,Fg(Lw,this)),HM(Lw,this,[]))}function aMe(t,e){e||this.recalculateAllColumnsWidth()}function lMe(t){const e=t.reduce((n,r)=>{let[,i]=r;const s=this.hot.propToCol(i);return Number.isInteger(s)&&n.indexOf(s)===-1&&n.push(s),n},[]);Fg(Lw,this).push(...e)}function lJ(t,e,n){let r=t;return n&&(this.calculateColumnsWidth(e,void 0,!0),r=this.getColumnWidth(e,void 0,!1)),r}function cMe(){HM(Hw,this,this.hot.getColHeader()),this.recalculateAllColumnsWidth(),HM(cz,this,!0)}function uMe(t){if(!Fg(cz,this))return;const e=t.reduce((n,r)=>{var i;const s=(i=r.address)===null||i===void 0?void 0:i.col;if(Number.isInteger(s)){const a=this.hot.toVisualColumn(s);n.indexOf(a)===-1&&n.push(a)}return n},[]);Fg(Lw,this).push(...e)}const gb={horizontal:"horizontal",vertical:"vertical"};function dMe(t,e,n){let r,i,s;return e[0]===t[0]&&e[1]<t[1]?(s="left",r=n(e[0],e[1]),i=n(e[2],t[1]-1)):e[2]===t[2]&&e[0]===t[0]&&e[3]>t[3]?(s="right",r=n(e[0],t[3]+1),i=n(e[2],e[3])):e[0]<t[0]&&e[1]===t[1]?(s="up",r=n(e[0],e[1]),i=n(t[0]-1,e[3])):e[2]>t[2]&&e[1]===t[1]&&(s="down",r=n(t[2]+1,e[1]),i=n(e[2],e[3])),r&&r.normalize(),i&&i.normalize(),{directionOfDrag:s,startOfDragCoords:r,endOfDragCoords:i}}function hMe(t){const e={};return t===!0?(e.directions=Object.keys(gb),e.autoInsertRow=!0):nn(t)?(Lt(t.autoInsertRow)?t.direction===gb.horizontal?e.autoInsertRow=!1:e.autoInsertRow=t.autoInsertRow:e.autoInsertRow=!1,Lt(t.direction)?e.directions=[t.direction]:e.directions=Object.keys(gb)):typeof t=="string"?(e.directions=[t],e.autoInsertRow=!0):(e.directions=[],e.autoInsertRow=!1),e}function fMe(t,e){mMe(t,e),e.add(t)}function mMe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $w(t,e,n){return(e=pMe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pMe(t){var e=gMe(t,"string");return typeof e=="symbol"?e:e+""}function gMe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fw(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}un.getSingleton().register("modifyAutofillRange"),un.getSingleton().register("beforeAutofill"),un.getSingleton().register("afterAutofill");const cJ="autofill",vMe=20,bMe=["fillHandle"],yMe="insert_row_below",xMe=200;var vb=new WeakSet;class wMe extends Zr{constructor(){super(...arguments),fMe(this,vb),$w(this,"addingStarted",!1),$w(this,"mouseDownOnCellCorner",!1),$w(this,"mouseDragOutside",!1),$w(this,"handleDraggedCells",0),$w(this,"directions",[]),$w(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return cJ}static get PLUGIN_PRIORITY(){return vMe}static get SETTING_KEYS(){return[cJ,...bMe]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",e=>Fw(vb,this,RMe).call(this,e)),this.addHook("afterOnCellCornerDblClick",e=>Fw(vb,this,SMe).call(this,e)),this.addHook("beforeOnCellMouseOver",(e,n)=>Fw(vb,this,_Me).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.clearMappedSettings(),super.disablePlugin()}getSelectionData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const n=this.hot.getSelectedRangeLast(),{row:r,col:i}=n.getTopStartCorner(),{row:s,col:a}=n.getBottomEndCorner(),u=this.hot.runHooks("modifyCopyableRange",[{startRow:r,startCol:i,endRow:s,endCol:a}]),h=[],m=[],g=[];return Te(u,y=>{for(let x=y.startRow;x<=y.endRow;x+=1)h.indexOf(x)===-1&&h.push(x);for(let x=y.startCol;x<=y.endCol;x+=1)m.indexOf(x)===-1&&m.push(x)}),Te(h,y=>{const x=[];Te(m,C=>{const E=e?this.hot.getSourceDataAtCell(y,C):null;e&&(nn(E)||Array.isArray(E))?x.push(this.hot.getCopyableSourceData(y,C)):x.push(this.hot.getCopyableData(y,C))}),g.push(x)}),g}fillIn(){if(this.hot.selection.highlight.getFill().isEmpty())return!1;const[e,n,r,i]=this.hot.selection.highlight.getFill().getVisualCorners(),s=this.hot.getSelectedRangeLast(),a=s.getTopStartCorner(),u=s.getBottomEndCorner();this.resetSelectionOfDraggedArea();const h=[a.row,a.col,u.row,u.col],m=this.hot.runHooks("modifyAutofillRange",[Math.min(a.row,e),Math.min(a.col,n),Math.max(u.row,r),Math.max(u.col,i)],h),{directionOfDrag:g,startOfDragCoords:y,endOfDragCoords:x}=dMe(h,m,(C,E)=>this.hot._createCellCoords(C,E));if(y&&y.row>-1&&y.col>-1){const C=this.getSelectionData(),E=this.getSelectionData(!0),M=s.clone(),j=this.hot._createCellRange(y,y,x),L=this.hot.runHooks("beforeAutofill",C,M,j,g);if(L===!1)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let D=L;const z=L;if(["up","left"].indexOf(g)>-1&&!(z.length===1&&z[0].length===0))if(D=[],g==="up"){const H=x.row-y.row+1,V=H%z.length;for(let F=0;F<H;F++)D.push(z[(F+(z.length-V))%z.length])}else{const H=x.col-y.col+1,V=H%z[0].length;for(let F=0;F<z.length;F++){D.push([]);for(let B=0;B<H;B++)D[F].push(z[F][(B+(z[F].length-V))%z[F].length])}}if(E.some(H=>H.some(V=>nn(V)||Array.isArray(V)))){const H=Fw(vb,this,CMe).call(this,D,E,y,x,g);H.length&&(D=H)}this.hot.populateFromArray(y.row,y.col,D,x.row,x.col,`${this.pluginName}.fill`,null),this.setSelection(m),this.hot.runHooks("afterAutofill",D,M,j,g),this.hot.render()}else this.hot.view.render();return!0}reduceSelectionAreaIfNeeded(e){return e.row<0&&(e.row=0),e.col<0&&(e.col=0),e}getCoordsOfDragAndDropBorders(e){const n=this.hot.getSelectedRangeLast(),r=n.getBottomEndCorner();let i=e;if(this.directions.includes(gb.vertical)&&this.directions.includes(gb.horizontal)){const s=n.getTopStartCorner();(r.col<=e.col||s.col>=e.col)&&(i=this.hot._createCellCoords(r.row,e.col)),(r.row<e.row||s.row>e.row)&&(i=this.hot._createCellCoords(e.row,r.col))}else if(this.directions.includes(gb.vertical))i=this.hot._createCellCoords(e.row,r.col);else if(this.directions.includes(gb.horizontal))i=this.hot._createCellCoords(r.row,e.col);else return;return this.reduceSelectionAreaIfNeeded(i)}showBorder(e){const n=this.getCoordsOfDragAndDropBorders(e);n&&this.redrawBorders(n)}addRow(){this.hot._registerTimeout(()=>{this.hot.alter(yMe,void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1},xMe)}addNewRowIfNeeded(){if(!this.hot.selection.highlight.getFill().isEmpty()&&this.addingStarted===!1&&this.autoInsertRow){const e=this.hot.getSelectedLast(),n=this.hot.selection.highlight.getFill().getVisualCorners(),r=this.hot.countRows();e[2]<r-1&&n[2]===r-1&&(this.addingStarted=!0,this.addRow())}}getIndexOfLastAdjacentFilledInRow(e){const n=this.hot.getData(),r=this.hot.countRows();let i;for(let s=e[2]+1;s<r;s++){for(let h=e[1];h<=e[3];h++){const m=n[s][h];if(!Yr(m))return-1}const a=n[s][e[1]-1],u=n[s][e[3]+1];(!Yr(a)||!Yr(u))&&(i=s)}return i}addSelectionFromStartAreaToSpecificRowIndex(e,n){this.hot.selection.highlight.getFill().clear().add(this.hot._createCellCoords(e[0],e[1])).add(this.hot._createCellCoords(n,e[3])).commit()}setSelection(e){this.hot.selectCell(...di(e,n=>Math.max(n,0)),!1,!1)}selectAdjacent(){const e=this.hot.getSelectedLast(),n=this.getIndexOfLastAdjacentFilledInRow(e);return n===-1||n===void 0?!1:(this.addSelectionFromStartAreaToSpecificRowIndex(e,n),!0)}resetSelectionOfDraggedArea(){this.handleDraggedCells=0,this.hot.selection.highlight.getFill().clear()}redrawBorders(e){this.hot.selection.highlight.getFill().clear().add(this.hot.getSelectedRangeLast().from).add(this.hot.getSelectedRangeLast().to).add(e).commit(),this.hot.view.render()}getIfMouseWasDraggedOutside(e){const{documentElement:n}=this.hot.rootDocument,r=sl(this.hot.table).top-(this.hot.rootWindow.pageYOffset||n.scrollTop)+Po(this.hot.table),i=sl(this.hot.table).left-(this.hot.rootWindow.pageXOffset||n.scrollLeft)+po(this.hot.table);return e.clientY>r&&e.clientX<=i}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",()=>Fw(vb,this,EMe).call(this)),this.eventManager.addEventListener(e,"mousemove",n=>Fw(vb,this,NMe).call(this,n))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){const e=hMe(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}}function CMe(t,e,n,r){const i=[];for(let s=Math.min(n.row,r.row);s<=Math.max(n.row,r.row);s+=1){i.push([]);for(let a=Math.min(n.col,r.col);a<=Math.max(n.col,r.col);a+=1){const u=this.hot.getSourceDataAtCell(s,a),h=this.hot.getCellMeta(s,a).source,m=this.hot.getCellMeta(s,a)._complexDataFormat||nn(h==null?void 0:h[0])||Array.isArray(h==null?void 0:h[0]),g=s-Math.min(n.row,r.row),y=a-Math.min(n.col,r.col),x=g%e.length,C=y%e[0].length;nn(u)||Array.isArray(u)||m?i[g][y]=e[x][C]:i[g][y]=t[x][C]}}return i}function SMe(){this.selectAdjacent()&&this.fillIn()}function RMe(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function _Me(t){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(t),this.addNewRowIfNeeded())}function EMe(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function NMe(t){const e=this.getIfMouseWasDraggedOutside(t);this.addingStarted===!1&&this.handleDraggedCells>0&&e?(this.mouseDragOutside=!0,this.addingStarted=!0):this.mouseDragOutside=!1,this.mouseDragOutside&&this.autoInsertRow&&this.addRow()}function kMe(t,e){dJ(t,e),e.add(t)}function uJ(t,e,n){dJ(t,e),e.set(t,n)}function dJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zw(t,e,n){return(e=TMe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function TMe(t){var e=jMe(t,"string");return typeof e=="symbol"?e:e+""}function jMe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hJ(t,e,n){return t.set(bu(t,e),n),n}function LM(t,e){return t.get(bu(t,e))}function bu(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const uz="autoRowSize",MMe=40,PMe="autoRowSize",fJ="htFirstDatasetColumnNotRendered",mJ="htAutoRowSize";var b_=new WeakMap,dz=new WeakMap,ld=new WeakSet;class y_ extends Zr{static get PLUGIN_KEY(){return uz}static get PLUGIN_PRIORITY(){return MMe}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 500}constructor(e){super(e),kMe(this,ld),zw(this,"headerHeight",null),zw(this,"ghostTable",new iJ(this.hot)),zw(this,"samplesGenerator",new DM((n,r)=>{const i=this.hot.toPhysicalColumn(r);if(this.hot.columnIndexMapper.isHidden(i))return!1;let s;if(n>=0&&r>=0&&(s=this.hot.getCellMeta(n,r),s.hidden))return!1;let a;if(n>=0){var u;a=this.hot.getDataAtCell(n,r),typeof((u=s)===null||u===void 0?void 0:u.valueFormatter)=="function"&&(a=s.valueFormatter(a,s))}else n===-1&&(a=this.hot.getColHeader(r));return{value:a}})),zw(this,"inProgress",!1),zw(this,"measuredRows",0),zw(this,"rowHeightsMap",new Ng),uJ(this,b_,[]),uJ(this,dz,!1),this.hot.rowIndexMapper.registerMap(PMe,this.rowHeightsMap),this.addHook("beforeRowResize",(n,r,i)=>bu(ld,this,gJ).call(this,n,r,i))}isEnabled(){const e=this.hot.getSettings()[uz];return e===!0||nn(e)}enablePlugin(){var e=this;if(this.enabled)return;this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const n=this.getSetting("samplingRatio");n&&!isNaN(n)&&this.samplesGenerator.setSampleCount(parseInt(n,10)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return bu(ld,e,DMe).call(e,...i)}),this.addHook("beforeChangeRender",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return bu(ld,e,HMe).call(e,...i)}),this.addHook("beforeColumnResize",()=>this.recalculateAllRowsHeight()),this.addHook("afterFormulasValuesUpdate",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return bu(ld,e,$Me).call(e,...i)}),this.addHook("beforeViewRender",()=>bu(ld,this,OMe).call(this)),this.addHook("beforeRender",()=>bu(ld,this,IMe).call(this)),this.addHook("modifyRowHeight",(r,i)=>this.getRowHeight(i,r)),this.addHook("init",()=>bu(ld,this,LMe).call(this)),this.addHook("modifyColumnHeaderHeight",()=>this.getColumnHeaderHeight()),st(this.hot.rootElement,mJ),super.enablePlugin()}disablePlugin(){this.headerHeight=null,cn(this.hot.rootElement,mJ),super.disablePlugin(),bu(ld,this,pJ).call(this,!1),this.addHook("beforeRowResize",(e,n,r)=>bu(ld,this,gJ).call(this,e,n,r))}calculateVisibleRowsHeight(){if(!this.hot.countCols())return;const e=this.getFirstVisibleRow(),n=this.getLastVisibleRow();if(e===-1||n===-1)return;const r=this.hot.forceFullRender;this.calculateRowsHeight({from:e,to:n},void 0,r)}calculateRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countCols()-1},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,s=typeof n=="number"?{from:n,to:n}:n;if(this.hot.getColHeader(0)!==null){const a=this.samplesGenerator.generateRowSamples(-1,s);this.ghostTable.addColumnHeadersRow(a.get(-1))}En(i.from,i.to,a=>{let u=this.hot.toPhysicalRow(a);u===null&&(u=a),(r||this.rowHeightsMap.getValueAtIndex(u)===null)&&this.samplesGenerator.generateRowSamples(a,s).forEach((m,g)=>this.ghostTable.addRow(g,m))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((a,u)=>{a<0?this.headerHeight=u:this.rowHeightsMap.setValueAtIndex(this.hot.toPhysicalRow(a),u)})},!0),this.measuredRows=i.to+1,this.ghostTable.clean())}calculateAllRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0;const i=this.hot.countRows()-1;let s=null;this.inProgress=!0;const a=()=>{if(!this.hot){jT(s),this.inProgress=!1;return}this.calculateRowsHeight({from:r,to:Math.min(r+y_.CALCULATION_STEP,i)},e,n),r=r+y_.CALCULATION_STEP+1,r<i?s=TT(a):(jT(s),this.inProgress=!1,this.hot.view.adjustElementsSize())},u=this.getSyncCalculationLimit();u>=0&&(this.calculateRowsHeight({from:0,to:u},e,n),r=u+1),r<i?a():(this.inProgress=!1,this.hot.view.adjustElementsSize())}recalculateAllRowsHeight(){this.hot.view.isVisible()&&this.calculateAllRowsHeight({from:0,to:this.hot.countCols()-1},!0)}getSyncCalculationLimit(){const e=this.hot.getSettings()[uz];let n=y_.SYNC_CALCULATION_LIMIT;const r=this.hot.countRows()-1;return nn(e)&&(n=e.syncLimit,YY(n)?n=LG(r,n):n>>=0),Math.min(n,r)}getRowHeight(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.hot.stylesHandler.getDefaultRowHeight(e);if(e<0){var r;return(r=this.headerHeight)!==null&&r!==void 0?r:n}const i=this.hot.toPhysicalRow(e);if(this.hot.rowIndexMapper.isHidden(i))return n;const s=this.rowHeightsMap.getValueAtIndex(i);let a=n;return s!==null&&s>n&&(a=s,e===this.hot.view.getFirstRenderedVisibleRow()&&(a+=1)),a}getColumnHeaderHeight(){return this.headerHeight}getFirstVisibleRow(){var e;return(e=this.hot.getFirstRenderedVisibleRow())!==null&&e!==void 0?e:-1}getLastVisibleRow(){var e;return(e=this.hot.getLastRenderedVisibleRow())!==null&&e!==void 0?e:-1}clearCache(e){this.headerHeight=null,Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(n=>{this.rowHeightsMap.setValueAtIndex(n,null)})},!0):this.rowHeightsMap.clear()}clearCacheByRange(e){const{from:n,to:r}=typeof e=="number"?{from:e,to:e}:e;this.hot.batchExecution(()=>{En(Math.min(n,r),Math.max(n,r),i=>{this.rowHeightsMap.setValueAtIndex(i,null)})},!0)}isNeedRecalculate(){return!!this.rowHeightsMap.getValues().slice(0,this.measuredRows).filter(e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function AMe(t){const e={from:0,to:this.hot.countCols()-1};t.forEach(n=>{this.samplesGenerator.generateRowSamples(n,e).forEach((i,s)=>this.ghostTable.addRow(s,i))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((n,r)=>{const i=this.hot.toPhysicalRow(n);this.rowHeightsMap.setValueAtIndex(i,r)})},!0),this.ghostTable.clean())}function pJ(t){const e=this.hot.getFirstRenderedVisibleColumn(),n=this.hot.columnIndexMapper.getPhysicalFromVisualIndex(e);t===!1||n===this.hot.columnIndexMapper.getPhysicalFromRenderableIndex(0)?cn(this.hot.rootElement,fJ):st(this.hot.rootElement,fJ)}function OMe(){bu(ld,this,pJ).call(this)}function IMe(){this.calculateVisibleRowsHeight(),this.inProgress||(bu(ld,this,AMe).call(this,LM(b_,this)),hJ(b_,this,[]))}function gJ(t,e,n){let r=t;return n&&(this.calculateRowsHeight(e,void 0,!0),r=this.getRowHeight(e)),r}function DMe(t,e){e||this.recalculateAllRowsHeight()}function HMe(t){const e=t.reduce((n,r)=>{let[i]=r;return n.indexOf(i)===-1&&n.push(i),n},[]);LM(b_,this).push(...e)}function LMe(){this.recalculateAllRowsHeight(),hJ(dz,this,!0)}function $Me(t){if(!LM(dz,this))return;const e=t.reduce((n,r)=>{var i;const s=(i=r.address)===null||i===void 0?void 0:i.row;if(Number.isInteger(s)){const a=this.hot.toVisualRow(s);n.indexOf(a)===-1&&n.push(a)}return n},[]);LM(b_,this).push(...e)}const{getListWithInsertedItems:FMe,getListWithRemovedItems:zMe}=FK("physicallyIndexed");class VMe extends Y0{constructor(){super(e=>e)}insert(e,n){const r=s5(this.indexedValues,n);this.indexedValues=FMe(r,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){const n=zMe(this.indexedValues,e);this.indexedValues=i5(n,e),super.remove(e)}}const{getListWithInsertedItems:BMe,getListWithRemovedItems:WMe}=FK("physicallyIndexed");class UMe extends Y0{constructor(){super(e=>e)}insert(e,n){this.indexedValues=BMe(this.indexedValues,e,n,(r,i)=>this.getNextValue(i)),super.insert(e,n)}remove(e){this.indexedValues=WMe(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}function YMe(t,e){GMe(t,e),e.add(t)}function GMe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function KMe(t,e,n){return(e=qMe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qMe(t){var e=XMe(t,"string");return typeof e=="symbol"?e:e+""}function XMe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function QMe(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const vJ="bindRowsWithHeaders",ZMe=210,JMe="loose",bJ=new Map([["loose",VMe],["strict",UMe]]);var yJ=new WeakSet;class ePe extends Zr{constructor(){super(...arguments),YMe(this,yJ),KMe(this,"headerIndexes",null)}static get PLUGIN_KEY(){return vJ}static get PLUGIN_PRIORITY(){return ZMe}isEnabled(){return!!this.hot.getSettings()[vJ]}enablePlugin(){var e;if(this.enabled)return;const n=(e=bJ.get(this.getSetting()))!==null&&e!==void 0?e:bJ.get(JMe);this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new n),this.addHook("modifyRowHeader",r=>QMe(yJ,this,tPe).call(this,r)),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function tPe(t){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(t))}function nPe(t,e){xJ(t,e),e.add(t)}function rPe(t,e,n){xJ(t,e),e.set(t,n)}function xJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wJ(t,e,n){return(e=iPe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iPe(t){var e=sPe(t,"string");return typeof e=="symbol"?e:e+""}function sPe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function CJ(t,e){return t.get(Vw(t,e))}function hz(t,e,n){return t.set(Vw(t,e),n),n}function Vw(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const $M="collapsibleColumns",oPe=290,aPe=["nestedHeaders"],Bw="collapsibleIndicator",SJ=$M,RJ=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var Ww=new WeakMap,x_=new WeakSet;class lPe extends Zr{constructor(){super(...arguments),nPe(this,x_),wJ(this,"nestedHeadersPlugin",null),wJ(this,"headerStateManager",null),rPe(this,Ww,null)}static get PLUGIN_KEY(){return $M}static get PLUGIN_PRIORITY(){return oPe}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[$M,...aPe]}isEnabled(){return!!this.hot.getSettings()[$M]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();n||Yn("You need to configure the Nested Headers plugin in order to use collapsible headers."),hz(Ww,this,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",()=>Vw(x_,this,dPe).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Vw(x_,e,hPe).call(e,...i)}),this.addHook("afterGetColHeader",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Vw(x_,e,cPe).call(e,...i)}),this.addHook("beforeOnCellMouseDown",(r,i,s)=>Vw(x_,this,uPe).call(this,r,i,s)),this.registerShortcuts(),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(this.hot.view){if(!this.nestedHeadersPlugin.detectedOverlappedHeaders){const{collapsibleColumns:e}=this.hot.getSettings();typeof e=="boolean"?this.headerStateManager.mapState(n=>({collapsible:n.origColspan>1})):Array.isArray(e)&&(this.headerStateManager.mapState(()=>({collapsible:!1})),this.headerStateManager.mergeStateWith(e))}super.updatePlugin()}}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),hz(Ww,this,null),this.nestedHeadersPlugin=null,this.unregisterShortcuts(),this.clearButtons(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{var e;const{row:n,col:r}=this.hot.getSelectedRangeActive().highlight,{collapsible:i,isCollapsed:s,columnIndex:a}=(e=this.headerStateManager.getHeaderTreeNodeData(n,r))!==null&&e!==void 0?e:{};if(i)return s?this.expandSection({row:n,col:a}):this.collapseSection({row:n,col:a}),!1},runOnlyIf:()=>{var e,n;return((e=this.hot.getSelectedRangeActive())===null||e===void 0?void 0:e.isSingle())&&((n=this.hot.getSelectedRangeActive())===null||n===void 0?void 0:n.highlight.isHeader())},group:SJ,relativeToGroup:Pm,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(SJ)}clearButtons(){if(!this.hot.view)return;const e=this.hot.view._wt.getSetting("columnHeaders").length,n=this.hot.view._wt.wtTable.THEAD,r=this.hot.view._wt.wtOverlays.topOverlay.clone.wtTable.THEAD,i=this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay?this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null,s=function(a){a&&a.parentNode.removeChild(a)};En(0,e-1,a=>{const u=n.childNodes[a],h=r.childNodes[a],m=i?i.childNodes[a]:null;En(0,u.childNodes.length-1,g=>{let y=u.childNodes[g].querySelector(`.${Bw}`);s(y),h&&h.childNodes[g]&&(y=h.childNodes[g].querySelector(`.${Bw}`),s(y)),i&&m&&m.childNodes[g]&&(y=m.childNodes[g].querySelector(`.${Bw}`),s(y))})})}expandSection(e){this.toggleCollapsibleSection([e],"expand")}collapseSection(e){this.toggleCollapsibleSection([e],"collapse")}toggleAllCollapsibleSections(e){const n=this.headerStateManager.mapNodes(r=>{const{collapsible:i,origColspan:s,headerLevel:a,columnIndex:u,isCollapsed:h}=r;if(i===!0&&s>1&&(h&&e==="expand"||!h&&e==="collapse"))return{row:this.headerStateManager.levelToRowCoords(a),col:u}});this.toggleCollapsibleSection(n,e)}collapseAll(){this.toggleAllCollapsibleSections("collapse")}expandAll(){this.toggleAllCollapsibleSections("expand")}toggleCollapsibleSection(e,n){if(RJ.has(n)||gt(`Unsupported action is passed (${n}).`),!Array.isArray(e))return;const r=E0(e,C=>{let{row:E}=C;return E<0});let i=r.length>0;Te(r,C=>{var E;let{row:M,col:j}=C;const{collapsible:L,isCollapsed:D}=(E=this.headerStateManager.getHeaderSettings(M,j))!==null&&E!==void 0?E:{};if(!L||D&&n==="collapse"||!D&&n==="expand")return i=!1,!1});const s=[],a=[];i&&Te(r,C=>{let{row:E,col:M}=C;const{colspanCompensation:j,affectedColumns:L,rollbackModification:D}=this.headerStateManager.triggerNodeModification(n,E,M);j>0&&(a.push(...L),s.push(D))});const u=this.getCollapsedColumns();let h=[];n==="collapse"?h=zme([...u,...a]):n==="expand"&&(h=E0(u,C=>!a.includes(C)));const m=RJ.get(n);if(this.hot.runHooks(m.beforeHook,u,h,i)===!1){Te(s,C=>{C()});return}this.hot.batchExecution(()=>{Te(a,C=>{CJ(Ww,this).setValueAtIndex(this.hot.toPhysicalColumn(C),m.hideColumn)})},!0);const y=this.getCollapsedColumns().length!==u.length,x=this.hot.getSelectedRangeActive();if(n==="collapse"&&y&&x){const{row:C,col:E}=x.highlight;if((this.hot.rowIndexMapper.isHidden(C)||this.hot.columnIndexMapper.isHidden(E))&&a.includes(E)){const j=C>=0?this.hot.rowIndexMapper.getNearestNotHiddenIndex(C,1,!0):C,L=E>=0?this.hot.columnIndexMapper.getNearestNotHiddenIndex(E,1,!0):E;j!==null&&L!==null&&this.hot.selectCell(j,L)}}this.hot.runHooks(m.afterHook,u,h,i,y),this.hot.view.adjustElementsSize(),this.hot.render()}getCollapsedColumns(){return CJ(Ww,this).getHiddenIndexes()}destroy(){hz(Ww,this,null),super.destroy()}}function cPe(t,e,n){var r;const{collapsible:i,origColspan:s,isCollapsed:a}=(r=this.headerStateManager.getHeaderSettings(n,t))!==null&&r!==void 0?r:{},u=i&&s>1&&t>=this.hot.getSettings().fixedColumnsStart,h=this.hot.getSettings().ariaTags;let m=e.querySelector(`.${Bw}`);if(wm(e,[qu("")[0]]),u)m||(m=this.hot.rootDocument.createElement("div"),st(m,Bw),e.querySelector("div:first-child").appendChild(m)),cn(m,["collapsed","expanded"]),a?(st(m,"collapsed"),Cg(m,"+"),h&&gn(e,...qu(!1))):(st(m,"expanded"),Cg(m,"-"),h&&gn(e,...qu(!0))),h&&gn(m,...ym());else{var g;(g=m)===null||g===void 0||g.remove()}}function uPe(t,e){Dn(t.target,Bw)&&(Dn(t.target,"expanded")?(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"collapse")):Dn(t.target,"collapsed")&&(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"expand")),iu(t))}function dPe(){this.updatePlugin()}function hPe(t,e){e||this.updatePlugin()}function bb(t,e,n){return(e=fPe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fPe(t){var e=mPe(t,"string");return typeof e=="symbol"?e:e+""}function mPe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const pPe=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"],gPe=!1,vPe=!0,bPe=!0;class yPe{constructor(e,n){bb(this,"hot",void 0),bb(this,"sortingStates",new nj),bb(this,"sortEmptyCells",gPe),bb(this,"indicator",vPe),bb(this,"headerAction",bPe),bb(this,"compareFunctionFactory",void 0),bb(this,"mapName",void 0),this.hot=e,this.mapName=n,this.hot.columnIndexMapper.registerMap(n,this.sortingStates)}updateAllColumnsProperties(e){nn(e)&&Mr(e,(n,r)=>{pPe.includes(r)&&(this[r]=n)})}getAllColumnsProperties(){const e={sortEmptyCells:this.sortEmptyCells,indicator:this.indicator,headerAction:this.headerAction};return typeof this.compareFunctionFactory=="function"&&(e.compareFunctionFactory=this.compareFunctionFactory),e}getSortOrderOfColumn(e){var n;return(n=this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))===null||n===void 0?void 0:n.sortOrder}getIndexOfColumnInSortQueue(e){return e=this.hot.toPhysicalColumn(e),this.sortingStates.getEntries().findIndex(n=>{let[r]=n;return r===e})}getNumberOfSortedColumns(){return this.sortingStates.getLength()}isListOfSortedColumnsEmpty(){return this.getNumberOfSortedColumns()===0}isColumnSorted(e){return nn(this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))}getSortStates(){return this.sortingStates===null?[]:this.sortingStates.getEntries().map(n=>{let[r,i]=n;return{column:this.hot.toVisualColumn(r),...i}})}getColumnSortState(e){const n=this.getSortOrderOfColumn(e);if(Lt(n))return{column:e,sortOrder:n}}setSortStates(e){this.sortingStates.clear();for(let n=0;n<e.length;n+=1)this.sortingStates.setValueAtIndex(this.hot.toPhysicalColumn(e[n].column),{sortOrder:e[n].sortOrder})}destroy(){this.hot.columnIndexMapper.unregisterMap(this.mapName),this.sortingStates=null}}function _J(t,e,n){const r=e.locale;return function(i,s){const{sortEmptyCells:a}=n;return typeof i=="string"&&(i=i.toLocaleLowerCase(r)),typeof s=="string"&&(s=s.toLocaleLowerCase(r)),i===s?hl:Yr(i)?Yr(s)?hl:a&&t==="asc"?ei:ti:Yr(s)?a&&t==="asc"?ti:ei:isNaN(i)&&!isNaN(s)?t==="asc"?ti:ei:!isNaN(i)&&isNaN(s)||(isNaN(i)||isNaN(s)||(i=parseFloat(i),s=parseFloat(s)),i<s)?t==="asc"?ei:ti:i>s?t==="asc"?ti:ei:hl}}const EJ="default";function xPe(t,e,n){return function(r,i){const s=parseFloat(r),a=parseFloat(i),{sortEmptyCells:u}=n;if(s===a||isNaN(s)&&isNaN(a))return hl;if(u){if(Yr(r))return t==="asc"?ei:ti;if(Yr(i))return t==="asc"?ti:ei}return isNaN(s)?ti:isNaN(a)?ei:s<a?t==="asc"?ei:ti:s>a?t==="asc"?ti:ei:hl}}const wPe="numeric";function CPe(t,e,n){const r=e.checkedTemplate,i=e.uncheckedTemplate,{sortEmptyCells:s}=n;return function(a,u){const h=Yr(a),m=Yr(u),g=h?i:a,y=m?i:u,x=g===i||g===r,C=y===i||y===r;if(s===!1){if(h&&m===!1)return ti;if(h===!1&&m)return ei}return x===!1&&C?t==="asc"?ei:ti:x&&C===!1?t==="asc"?ti:ei:x===!1&&C===!1?_J(t,e,n)(a,u):g===i&&y===r?t==="asc"?ei:ti:g===r&&y===i?t==="asc"?ti:ei:hl}}const SPe="checkbox";function RPe(t,e,n){return OJ(t,e.dateFormat,n)}const _Pe="date";function EPe(t,e,n){return HPe(t,e.dateFormat,n)}const NPe="intl-date";function kPe(t,e,n){return OJ(t,e.timeFormat,n)}const TPe="time";function jPe(t,e,n){return LPe(t,e.timeFormat,n)}const MPe="intl-time",{register:yb,getItem:NJ,hasItem:PPe}=ou("sorting.compareFunctionFactory"),{register:kJ,getItem:APe}=ou("sorting.mainSortComparator");function TJ(t){return PPe(t)?NJ(t):NJ(EJ)}yb(SPe,CPe),yb(_Pe,RPe),yb(NPe,EPe),yb(EJ,_J),yb(wPe,xPe),yb(TPe,kPe),yb(MPe,jPe);const hl=0,ei=-1,ti=1;function OPe(t,e){const n=APe(e);for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];t.sort(n(...i))}const FM="asc",zM="desc",jJ="colHeader";function IPe(t){if(nn(t)===!1)return!1;const{column:e,sortOrder:n}=t;return Number.isInteger(e)&&[FM,zM].includes(n)}function DPe(t){if(t.some(n=>IPe(n)===!1))return!1;const e=t.map(n=>{let{column:r}=n;return r});return new Set(e).size===e.length}function MJ(t){if(t!==zM)return t===FM?zM:FM}function PJ(t){return t.querySelector(`.${jJ}`)}function AJ(t,e){if(t<0||!e.parentNode)return!1;const n=e.parentNode.parentNode.childNodes;return Array.from(n).indexOf(e.parentNode)-n.length===-1}function fz(t,e,n){return t===-1&&e>=0&&O0(n)===!1}function OJ(t,e,n){return function(r,i){const{sortEmptyCells:s}=n;if(r===i)return hl;if(Yr(r))return Yr(i)?hl:s&&t==="asc"?ei:ti;if(Yr(i))return s&&t==="asc"?ti:ei;const a=Tt(r,e),u=Tt(i,e);return a.isValid()?u.isValid()?u.isAfter(a)?t==="asc"?ei:ti:u.isBefore(a)?t==="asc"?ti:ei:hl:ei:ti}}function HPe(t,e,n){return function(r,i){const{sortEmptyCells:s}=n;if(r===i)return hl;if(Yr(r))return Yr(i)?hl:s&&t==="asc"?ei:ti;if(Yr(i))return s&&t==="asc"?ti:ei;const a=rf(r),u=rf(i);return a===null?ti:u===null?ei:u>a?t==="asc"?ei:ti:u<a?t==="asc"?ti:ei:hl}}function LPe(t,e,n){return function(r,i){const{sortEmptyCells:s}=n;if(r===i)return hl;if(Yr(r))return Yr(i)?hl:s&&t==="asc"?ei:ti;if(Yr(i))return s&&t==="asc"?ti:ei;const a=ab(r),u=ab(i);return a===null?ti:u===null?ei:u>a?t==="asc"?ei:ti:u<a?t==="asc"?ti:ei:hl}}function $Pe(t,e){Yn(Jr`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously.\x20 Only \`${t}\` will work. The \`${e}\` plugin will remain disabled.`)}const FPe="ascending",zPe="descending",IJ="indicatorDisabled",DJ="columnSorting",HJ="sortAction",LJ=new Map([[FM,FPe],[zM,zPe]]);function VPe(t,e,n,r){const i=[DJ];if(r&&i.push(HJ),n===!1)return i.push(IJ),i;const s=t.getSortOrderOfColumn(e);return Lt(s)&&i.push(LJ.get(s)),i}function BPe(){return Array.from(LJ.values()).concat(HJ,IJ,DJ)}function WPe(t,e){return function(n,r){const[,...i]=n,[,...s]=r;return function(u){const h=t[u],m=e[u],g=i[u],y=s[u],x=m.columnSorting;return(x.compareFunctionFactory?x.compareFunctionFactory:TJ(m.type))(h,m,x)(g,y)}(0)}}function UPe(t,e){YPe(t,e),e.add(t)}function YPe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function VM(t,e,n){return(e=GPe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GPe(t){var e=KPe(t,"string");return typeof e=="symbol"?e:e+""}function KPe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Uw(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const BM="columnSorting",qPe=50,WM="append",XPe="replace",$J=BM;kJ(BM,WPe),un.getSingleton().register("beforeColumnSort"),un.getSingleton().register("afterColumnSort");const w_=new WeakMap;var xb=new WeakSet;class FJ extends Zr{constructor(){super(...arguments),UPe(this,xb),VM(this,"columnStatesManager",null),VM(this,"columnMetaCache",null),VM(this,"pluginKey",BM),VM(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return BM}static get PLUGIN_PRIORITY(){return qPe}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e=this;if(w_.has(this.hot)&&w_.get(this.hot)!==this.pluginKey){this.hot.updateSettings({[this.pluginKey]:!1}),$Pe(w_.get(this.hot),this.pluginKey);return}this.enabled||(w_.set(this.hot,this.pluginKey),this.columnStatesManager=new yPe(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new Ng(n=>{let r=this.hot.toVisualColumn(n);return r===null&&(r=n),this.getMergedPluginSettings(r)}),this.hot.columnIndexMapper.registerMap(`${this.pluginKey}.columnMeta`,this.columnMetaCache),this.addHook("afterGetColHeader",(n,r)=>Uw(xb,this,QPe).call(this,n,r)),this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Uw(xb,e,JPe).call(e,...r)}),this.addHook("afterOnCellMouseDown",(n,r)=>this.onAfterOnCellMouseDown(n,r)),this.addHook("afterInit",()=>Uw(xb,this,mz).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Uw(xb,e,ZPe).call(e,...r)}),this.hot.view&&Uw(xb,this,mz).call(this),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){const e=(n,r)=>{const i=PJ(r);AJ(n,r)===!1||i===null||this.updateHeaderClasses(i)};w_.delete(this.hot),this.hot.addHook("afterGetColHeader",e),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("afterGetColHeader",e)}),this.hot.batchExecution(()=>{this.indexesSequenceCache!==null&&(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginKey),this.indexesSequenceCache=null)},!0),this.hot.columnIndexMapper.unregisterMap(`${this.pluginKey}.columnMeta`),this.columnStatesManager.destroy(),this.columnMetaCache=null,this.columnStatesManager=null,this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeActive();return this.sort(this.getColumnNextConfig(e.col)),!1},runOnlyIf:()=>{var e,n;const r=(e=this.hot.getSelectedRangeActive())===null||e===void 0?void 0:e.highlight;return r&&((n=this.hot.getSelectedRangeActive())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(r)&&r.row===-1&&r.col>=0},relativeToGroup:Pm,position:"before",group:$J})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup($J)}sort(e){const n=this.getSortConfig(),r=this.getNormalizedSortConfigs(e),i=this.areValidSortConfigs(r);this.hot.runHooks("beforeColumnSort",n,r,i)!==!1&&(n.length===0&&this.indexesSequenceCache===null&&(this.indexesSequenceCache=this.hot.rowIndexMapper.registerMap(this.pluginKey,new zK),this.indexesSequenceCache.setValues(this.hot.rowIndexMapper.getIndexesSequence())),i&&(this.columnStatesManager.setSortStates(r),this.sortByPresetSortStates(r)),this.hot.runHooks("afterColumnSort",n,i?r:n,i),i&&this.hot.render())}clearSort(){this.sort([])}isSorted(){return this.enabled&&!this.columnStatesManager.isListOfSortedColumnsEmpty()}getSortConfig(e){return Lt(e)?this.columnStatesManager.getColumnSortState(e):this.columnStatesManager.getSortStates()}setSortConfig(e){const n=this.getNormalizedSortConfigs(e);this.areValidSortConfigs(n)&&this.columnStatesManager.setSortStates(n)}getNormalizedSortConfigs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Array.isArray(e)?e.slice(0,1):[e]}areValidSortConfigs(e){const n=this.hot.countCols();return DPe(e)&&e.every(r=>{let{column:i}=r;return i<=n&&i>=0})}getColumnNextConfig(e){const n=this.columnStatesManager.getSortOrderOfColumn(e);if(Lt(n)){const i=MJ(n);return Lt(i)?{column:e,sortOrder:i}:void 0}const r=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e<r)return{column:e,sortOrder:MJ()}}getNextSortConfig(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:WM;const r=this.columnStatesManager.getIndexOfColumnInSortQueue(e),i=r!==-1,s=this.getSortConfig(),a=this.getColumnNextConfig(e);if(i){if(ls(a))return[...s.slice(0,r),...s.slice(r+1)];if(n===WM)return[...s.slice(0,r),...s.slice(r+1),a];if(n===XPe)return[...s.slice(0,r),a,...s.slice(r+1)]}return Lt(a)?s.concat(a):s}getPluginColumnConfig(e){if(nn(e)){const n=e[this.pluginKey];if(nn(n))return n}return{}}getMergedPluginSettings(e){const n=this.hot.getSettings()[this.pluginKey],r=this.columnStatesManager.getAllColumnsProperties(),i=this.hot.getCellMeta(0,e),s=Object.getPrototypeOf(i);return Array.isArray(s.columns)?Object.assign(r,n,this.getPluginColumnConfig(s.columns[e])):ri(s.columns)?Object.assign(r,n,this.getPluginColumnConfig(s.columns(e))):Object.assign(r,n)}getFirstCellSettings(e){const n=this.hot.getCellMeta(0,e),r=Object.create(n);return r[this.pluginKey]=this.columnMetaCache.getValueAtIndex(this.hot.toPhysicalColumn(e)),r}getNumberOfRowsToSort(e){const n=this.hot.getSettings();return n.maxRows<=e?n.maxRows:e-n.minSpareRows}sortByPresetSortStates(e){if(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),e.length===0)return;const n=[],r=this.hot.countRows(),i=m=>di(e,g=>this.hot.getDataAtCell(m,g.column));for(let m=0;m<this.getNumberOfRowsToSort(r);m+=1)n.push([this.hot.toPhysicalRow(m)].concat(i(m)));const s=di(n,m=>m[0]);OPe(n,this.pluginKey,di(e,m=>m.sortOrder),di(e,m=>this.getFirstCellSettings(m.column)));for(let m=n.length;m<r;m+=1)n.push([m].concat(i(m)));const a=di(n,m=>m[0]),u=new Map(di(s,(m,g)=>[m,a[g]])),h=di(this.hot.rowIndexMapper.getIndexesSequence(),m=>u.has(m)?u.get(m):m);this.hot.rowIndexMapper.setIndexesSequence(h)}sortBySettings(e){if(nn(e)){this.columnStatesManager.updateAllColumnsProperties(e);const n=e.initialConfig;(Array.isArray(n)||nn(n))&&this.sort(n)}else this.hot.render()}updateHeaderClasses(e){if(cn(e,BPe()),this.enabled!==!1){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];st(e,VPe(...r))}}onUpdateSettings(e){super.onUpdateSettings(e),this.columnMetaCache!==null&&this.columnMetaCache.init(this.hot.columnIndexMapper.getNumberOfIndexes()),Lt(e[this.pluginKey])&&this.sortBySettings(e[this.pluginKey])}wasClickableHeaderClicked(e,n){return this.getFirstCellSettings(n)[this.pluginKey].headerAction&&Dn(e.target,jJ)}onAfterOnCellMouseDown(e,n){if(fz(n.row,n.col,e)!==!1&&this.wasClickableHeaderClicked(e,n.col)){this.hot.getShortcutManager().isCtrlPressed()&&(this.hot.deselectCell(),this.hot.selectColumns(n.col));const r=this.hot.getActiveEditor(),i=this.getColumnNextConfig(n.col);r!=null&&r.isOpened()&&this.hot.getCellValidator(r.row,r.col)?this.hot.addHookOnce("postAfterValidate",()=>{this.sort(i)}):this.sort(i)}}destroy(){var e;(e=this.columnStatesManager)===null||e===void 0||e.destroy(),super.destroy()}}function mz(){const t=this.hot.getSettings()[this.pluginKey];this.sortBySettings(t)}function QPe(t,e){const n=PJ(e);if(AJ(t,e)===!1||n===null)return;const r=this.getFirstCellSettings(t)[this.pluginKey],i=r.indicator,s=r.headerAction;if(this.updateHeaderClasses(n,this.columnStatesManager,t,i,s),this.hot.getSettings().ariaTags){const a=this.columnStatesManager.getSortOrderOfColumn(t);gn(e,...ppe(a?`${a}ending`:"none"))}}function ZPe(t){t===!0&&this.hot.view&&Uw(xb,this,mz).call(this)}function JPe(t,e,n,r){fz(e.row,e.col,t)!==!1&&this.wasClickableHeaderClicked(t,e.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(r.column=!0)}function pz(t){return t==null||isNaN(t)}function eAe(t,e){if(typeof t!="number")return t;const n=r=>r.toString();switch(typeof e){case"number":return n(t.toFixed(Math.min(Math.max(0,e),100)));case"boolean":return e?n(Math.round(t)):t;case"string":if(e==="auto"){const r=Math.round(t).toString().length;return n(t.toFixed(8-r))}return t;default:return t}}function wb(t,e,n){return(e=tAe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tAe(t){var e=nAe(t,"string");return typeof e=="symbol"?e:e+""}function nAe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class rAe{constructor(e,n){wb(this,"plugin",void 0),wb(this,"hot",void 0),wb(this,"endpoints",[]),wb(this,"settings",void 0),wb(this,"settingsType","array"),wb(this,"currentEndpoint",null),wb(this,"cellsToSetCache",[]),this.plugin=e,this.hot=this.plugin.hot,this.settings=n}initEndpoints(){this.endpoints=this.parseSettings(),this.refreshAllEndpoints()}getEndpoint(e){return this.settingsType==="function"?this.fillMissingEndpointData(this.settings)[e]:this.endpoints[e]}getAllEndpoints(){return this.settingsType==="function"?this.fillMissingEndpointData(this.settings):this.endpoints}fillMissingEndpointData(e){return this.parseSettings(e.call(this))}parseSettings(e){const n=[];let r=e;if(!r&&typeof this.settings=="function"){this.settingsType="function";return}return r||(r=this.settings),Te(r,i=>{const s={};this.assignSetting(i,s,"ranges",[[0,this.hot.countRows()-1]]),this.assignSetting(i,s,"reversedRowCoords",!1),this.assignSetting(i,s,"destinationRow",new Error(` You must provide a destination row for the Column Summary plugin in order to work properly! `)),this.assignSetting(i,s,"destinationColumn",new Error(` You must provide a destination column for the Column Summary plugin in order to work properly! `)),this.assignSetting(i,s,"sourceColumn",i.destinationColumn),this.assignSetting(i,s,"type","sum"),this.assignSetting(i,s,"forceNumeric",!1),this.assignSetting(i,s,"suppressDataTypeErrors",!0),this.assignSetting(i,s,"customFunction",null),this.assignSetting(i,s,"readOnly",!0),this.assignSetting(i,s,"roundFloat",!1),n.push(s)}),n}assignSetting(e,n,r,i){if(r==="ranges"&&e[r]===void 0){n[r]=i;return}else if(r==="ranges"&&e[r].length===0)return;if(e[r]===void 0){if(i instanceof Error)throw i;n[r]=i}else r==="destinationRow"&&n.reversedRowCoords?n[r]=this.hot.countRows()-e[r]-1:n[r]=e[r]}resetSetupBeforeStructureAlteration(e,n,r){if(this.settingsType!=="function")return;const i=e.indexOf("row")>-1?"row":"col",s=this.getAllEndpoints();Te(s,a=>{i==="row"&&a.destinationRow>=n&&(e==="insert_row"?a.alterRowOffset=r:e==="remove_row"&&(a.alterRowOffset=-1*r)),i==="col"&&a.destinationColumn>=n&&(e==="insert_col"?a.alterColumnOffset=r:e==="remove_col"&&(a.alterColumnOffset=-1*r))}),this.resetAllEndpoints(s,!1)}resetSetupAfterStructureAlteration(e,n,r,i,s){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;if(s==="auto")return;if(this.settingsType==="function"){const x=()=>(this.hot.removeHook("beforeViewRender",x),this.refreshAllEndpoints());this.hot.addHookOnce("beforeViewRender",x);return}const u=e.indexOf("row")>-1?"row":"col",h=e.indexOf("remove")>-1?-1:1,m=this.getAllEndpoints(),g=e.indexOf("move_row")===0,y=n;Te(m,x=>{u==="row"&&x.destinationRow>=y&&(x.alterRowOffset=h*r),u==="col"&&x.destinationColumn>=y&&(x.alterColumnOffset=h*r)}),this.resetAllEndpoints(m,!g),g?Te(m,x=>{this.extendEndpointRanges(x,y,i[0],i.length),this.recreatePhysicalRanges(x),this.clearOffsetInformation(x)}):Te(m,x=>{this.shiftEndpointCoordinates(x,y)}),a&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,n,r,i){Te(e.ranges,s=>{s[1]&&(n>=s[0]&&n<=s[1]?r>s[1]?s[1]+=i:r<s[0]&&(s[0]-=i):r>=s[0]&&r<=s[1]&&(s[1]-=i,n<=s[0]&&(s[0]+=1,s[1]+=1)))})}recreatePhysicalRanges(e){const n=e.ranges,r=[],i=[];Te(n,s=>{const a=[];if(s[1])for(let u=s[0];u<=s[1];u++)a.push(this.hot.toPhysicalRow(u));else a.push(this.hot.toPhysicalRow(s[0]));i.push(a)}),Te(i,s=>{let a=[];Te(s,(u,h)=>{h===0?a.push(u):s[h]!==s[h-1]+1&&(a.push(s[h-1]),r.push(a),a=[],a.push(u)),h===s.length-1&&(a.push(u),r.push(a))})}),e.ranges=r}shiftEndpointCoordinates(e,n){e.alterRowOffset&&e.alterRowOffset!==0?(e.destinationRow+=e.alterRowOffset||0,Te(e.ranges,r=>{Te(r,(i,s)=>{i>=n&&(r[s]+=e.alterRowOffset||0)})})):e.alterColumnOffset&&e.alterColumnOffset!==0&&(e.destinationColumn+=e.alterColumnOffset||0,e.sourceColumn+=e.alterColumnOffset||0)}resetAllEndpoints(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getAllEndpoints(),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e.some(i=>{const s=i.alterRowOffset||0,a=i.alterColumnOffset||0;return i.destinationRow+s>=this.hot.countRows()||i.destinationColumn+a>=this.hot.countCols()})||(this.cellsToSetCache=[],Te(e,i=>{this.resetEndpointValue(i,n)}),this.cellsToSetCache.length&&this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],Te(this.getAllEndpoints(),e=>{this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e,"init")}),this.currentEndpoint=null,this.cellsToSetCache.length&&this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshChangedEndpoints(e){const n=[];this.cellsToSetCache=[],Te(e,(r,i,s)=>{`${r[2]||""}`!=`${r[3]}`&&Te(this.getAllEndpoints(),(a,u)=>{this.hot.propToCol(s[i][1])===a.sourceColumn&&n.indexOf(u)===-1&&n.push(u)})}),Te(n,r=>{this.refreshEndpoint(this.getEndpoint(r))}),this.cellsToSetCache.length&&this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshCellMetas(){this.endpoints.forEach(e=>{const n=this.hot.toVisualRow(e.destinationRow);if(n!==null){const r=this.hot.getCellMeta(n,e.destinationColumn);r.readOnly=e.readOnly,r.className="columnSummaryResult"}})}refreshEndpoint(e){this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e),this.currentEndpoint=null}resetEndpointValue(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const r=e.alterRowOffset||0,i=e.alterColumnOffset||0;this.cellsToSetCache.push([this.hot.toVisualRow(e.destinationRow+(n?r:0)),this.hot.toVisualColumn(e.destinationColumn+(n?i:0)),""])}setEndpointValue(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=this.hot.toVisualRow(e.destinationRow);if(e.destinationRow>=this.hot.countRows()||e.destinationColumn>=this.hot.countCols()){this.throwOutOfBoundsWarning();return}const s=this.hot.toVisualRow(e.destinationRow);if(s!==null){const a=this.hot.getCellMeta(s,e.destinationColumn);(n==="init"||a.readOnly!==e.readOnly)&&(a.readOnly=e.readOnly,a.className="columnSummaryResult")}e.result=eAe(e.result,e.roundFloat),r?this.hot.setDataAtCell(i,e.destinationColumn,e.result,"ColumnSummary.set"):this.cellsToSetCache.push([i,e.destinationColumn,e.result]),e.alterRowOffset=void 0,e.alterColumnOffset=void 0}throwOutOfBoundsWarning(){Yn("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}}function iAe(t,e){sAe(t,e),e.add(t)}function sAe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function oAe(t,e,n){return(e=aAe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aAe(t){var e=lAe(t,"string");return typeof e=="symbol"?e:e+""}function lAe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Yw(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const gz="columnSummary",cAe=220;var Cb=new WeakSet;class uAe extends Zr{constructor(){super(...arguments),iAe(this,Cb),oAe(this,"endpoints",null)}static get PLUGIN_KEY(){return gz}static get PLUGIN_PRIORITY(){return cAe}isEnabled(){return!!this.hot.getSettings()[gz]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[gz],this.endpoints=new rAe(this,this.settings),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Yw(Cb,e,dAe).call(e,...r)}),this.addHook("afterChange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Yw(Cb,e,fAe).call(e,...r)}),this.addHook("afterUpdateSettings",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Yw(Cb,e,hAe).call(e,...r)}),this.addHook("afterLoadData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Yw(Cb,e,mAe).call(e,...r)}),this.addHook("afterUpdateData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Yw(Cb,e,pAe).call(e,...r)}),this.addHook("beforeCreateRow",(n,r,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_row",n,r,null,i)),this.addHook("beforeCreateCol",(n,r,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_col",n,r,null,i)),this.addHook("beforeRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_row",...r)}),this.addHook("beforeRemoveCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_col",...r)}),this.addHook("afterCreateRow",(n,r,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_row",n,r,null,i)),this.addHook("afterCreateCol",(n,r,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_col",n,r,null,i)),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_row",...r)}),this.addHook("afterRemoveCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_col",...r)}),this.addHook("afterRowMove",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Yw(Cb,e,gAe).call(e,...r)}),super.enablePlugin())}disablePlugin(){this.endpoints=null,this.settings=null,this.currentEndpoint=null,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.endpoints.initEndpoints(),super.updatePlugin()}calculate(e){switch(e.type.toLowerCase()){case"sum":e.result=this.calculateSum(e);break;case"min":e.result=this.calculateMinMax(e,e.type);break;case"max":e.result=this.calculateMinMax(e,e.type);break;case"count":e.result=this.countEntries(e);break;case"average":e.result=this.calculateAverage(e);break;case"custom":e.result=e.customFunction.call(this,e);break}}calculateSum(e){let n=0;return Mr(e.ranges,r=>{n+=this.getPartialSum(r,e.sourceColumn)}),n}getPartialSum(e,n){let r=0,i=e[1]||e[0],s=null,a=0;do{if(s=this.getCellValue(i,n),s=pz(s)?null:s,s!==null){const u=(`${s}`.split(".")[1]||[]).length||1;u>a&&(a=u)}r+=s||0,i-=1}while(i>=e[0]);return Math.round(r*10**a)/10**a}calculateMinMax(e,n){let r=null;return Mr(e.ranges,i=>{const s=this.getPartialMinMax(i,e.sourceColumn,n);if(r===null&&s!==null&&(r=s),s!==null)switch(n){case"min":r=Math.min(r,s);break;case"max":r=Math.max(r,s);break}}),r===null?"Not enough data":r}getPartialMinMax(e,n,r){let i=null,s=e[1]||e[0],a;do{if(a=this.getCellValue(s,n),a=pz(a)?null:a,i===null)i=a;else if(a!==null)switch(r){case"min":i=Math.min(i,a);break;case"max":i=Math.max(i,a);break}s-=1}while(s>=e[0]);return i}countEmpty(e,n){let r,i=0,s=e[1]||e[0];do r=this.getCellValue(s,n),r=pz(r)?null:r,r===null&&(i+=1),s-=1;while(s>=e[0]);return i}countEntries(e){let n=0;const r=e.ranges;return Mr(r,i=>{const s=i[1]===void 0?1:i[1]-i[0]+1,a=this.countEmpty(i,e.sourceColumn);n+=s,n-=a}),n}calculateAverage(e){const n=this.calculateSum(e),r=this.countEntries(e);return n/r}getCellValue(e,n){const r=this.hot.toVisualRow(e),i=this.hot.toVisualColumn(n);let s=this.hot.getSourceDataAtCell(e,n),a="";return r!==null&&i!==null&&(a=this.hot.getCellMeta(r,i).className||""),a.indexOf("columnSummaryResult")>-1?null:(this.endpoints.currentEndpoint.forceNumeric&&(typeof s=="string"&&(s=s.replace(/,/,".")),s=parseFloat(s)),isNaN(s)&&(this.endpoints.currentEndpoint.suppressDataTypeErrors||gt(Jr`ColumnSummary plugin: cell at (${e}, ${n}) is not in a\x20 numeric format. Cannot do the calculation.`)),s)}}function dAe(){this.endpoints.initEndpoints()}function hAe(t){t.columns!==void 0&&this.endpoints.refreshCellMetas()}function fAe(t,e){t&&e!=="ColumnSummary.reset"&&e!=="ColumnSummary.set"&&e!=="loadData"&&this.endpoints.refreshChangedEndpoints(t)}function mAe(t,e){e||this.endpoints.refreshAllEndpoints()}function pAe(t,e){e||this.endpoints.refreshAllEndpoints()}function gAe(t,e){this.endpoints.resetSetupBeforeStructureAlteration("move_row",t[0],t.length,t,this.pluginName),this.endpoints.resetSetupAfterStructureAlteration("move_row",e,t.length,t,this.pluginName)}function vAe(t,e){zJ(t,e),e.add(t)}function vz(t,e,n){zJ(t,e),e.set(t,n)}function zJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gw(t,e){return t.get(yz(t,e))}function bz(t,e,n){return t.set(yz(t,e),n),n}function yz(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var UM=new WeakMap,YM=new WeakMap,GM=new WeakMap,VJ=new WeakSet;class BJ{constructor(){vAe(this,VJ),vz(this,UM,!0),vz(this,YM,null),vz(this,GM,new ResizeObserver(e=>yz(VJ,this,bAe).call(this,e)))}setObservedElement(e){bz(YM,this,e)}unobserve(){Gw(GM,this).unobserve(Gw(YM,this))}observe(){bz(UM,this,!0),Gw(GM,this).observe(Gw(YM,this))}destroy(){Gw(GM,this).disconnect()}}function bAe(t){if(Gw(UM,this)||!Array.isArray(t)||!t.length){bz(UM,this,!1);return}t.forEach(e=>{let{borderBoxSize:n}=e;const{inlineSize:r,blockSize:i}=n[0];this.runLocalHooks("resize",r,i)})}ci(BJ,vo);function zg(t,e,n){yAe(t,e),e.set(t,n)}function yAe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $i(t,e){return t.get(WJ(t,e))}function lf(t,e,n){return t.set(WJ(t,e),n),n}function WJ(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Kw=new WeakMap,xz=new WeakMap,wz=new WeakMap,Ym=new WeakMap,Vg=new WeakMap,Bg=new WeakMap,KM=new WeakMap,qw=new WeakMap;class Sb{static get CLASS_EDITOR_CONTAINER(){return"htCommentsContainer"}static get CLASS_EDITOR(){return"htComments"}static get CLASS_INPUT(){return"htCommentTextArea"}static get CLASS_CELL(){return"htCommentCell"}constructor(e,n,r){var i=this;zg(this,Kw,void 0),zg(this,xz,void 0),zg(this,wz,!1),zg(this,Ym,null),zg(this,Vg,void 0),zg(this,Bg,void 0),zg(this,KM,!0),zg(this,qw,new BJ),lf(Kw,this,e),lf(xz,this,r),lf(wz,this,n),lf(Vg,this,this.createEditor()),lf(Bg,this,$i(Vg,this).style),$i(qw,this).setObservedElement(this.getInputElement()),$i(qw,this).addLocalHook("resize",function(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];return i.runLocalHooks("resize",...a)}),this.hide()}setPosition(e,n){$i(Bg,this).left=`${e}px`,$i(Bg,this).top=`${n}px`}setSize(e,n){if(e&&n){const r=this.getInputElement();r.style.width=`${e}px`,r.style.height=`${n}px`}}getSize(){return{width:po(this.getInputElement()),height:Po(this.getInputElement())}}observeSize(){$i(qw,this).observe()}resetSize(){const e=this.getInputElement();e.style.width="",e.style.height=""}setReadOnlyState(e){const n=this.getInputElement();n.readOnly=e}show(){$i(Bg,this).display="block",lf(KM,this,!1)}hide(){$i(qw,this).unobserve(),$i(KM,this)||($i(Bg,this).display="none"),lf(KM,this,!0)}isVisible(){return $i(Bg,this).display==="block"}setValue(){const n=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"")||"";this.getInputElement().value=n}getValue(){return this.getInputElement().value}isFocused(){return $i(Kw,this).activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=$i(Kw,this).createElement("div"),n=$i(Kw,this).createElement("textarea");return e.style.display="none",lf(Ym,this,$i(Kw,this).createElement("div")),$i(Ym,this).setAttribute("dir",$i(wz,this)?"rtl":"ltr"),st($i(Ym,this),Sb.CLASS_EDITOR_CONTAINER),$i(xz,this).appendChild($i(Ym,this)),st(e,Sb.CLASS_EDITOR),st(n,Sb.CLASS_INPUT),n.setAttribute("data-hot-input",!0),e.appendChild(n),$i(Ym,this).appendChild(e),e}getInputElement(){return $i(Vg,this).querySelector(`.${Sb.CLASS_INPUT}`)}getEditorElement(){return $i(Vg,this)}destroy(){const e=$i(Ym,this)?$i(Ym,this).parentNode:null;$i(Vg,this).parentNode.removeChild($i(Vg,this)),lf(Vg,this,null),lf(Bg,this,null),$i(qw,this).destroy(),e&&e.removeChild($i(Ym,this))}}ci(Sb,vo);function Cz(t,e,n){return(e=xAe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xAe(t){var e=wAe(t,"string");return typeof e=="symbol"?e:e+""}function wAe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const CAe=250,SAe=250;class UJ{constructor(e){Cz(this,"wasLastActionShow",!0),Cz(this,"showDebounced",null),Cz(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout(()=>{this.wasLastActionShow===!1&&this.runLocalHooks("hide")},SAe)}show(e){this.wasLastActionShow=!0,this.showDebounced(e)}cancelHiding(){this.wasLastActionShow=!0,clearTimeout(this.hidingTimer),this.hidingTimer=null}updateDelay(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:CAe;this.showDebounced=$T(n=>{this.wasLastActionShow&&this.runLocalHooks("show",n.from.row,n.from.col)},e)}destroy(){this.clearLocalHooks()}}ci(UJ,vo);function RAe(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")} ${e}`}function _Ae(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")} ${e}`}function Rb(t,e){const n={};return Te(t,r=>{r.forAll((i,s)=>{i>=0&&s>=0&&(n[i]||(n[i]=[]),n[i][s]=e(i,s))})}),n}function Wg(t,e,n,r,i){Te(t,s=>{s.forAll((a,u)=>{a>=0&&u>=0&&EAe(a,u,e,n,r,i)})})}function EAe(t,e,n,r,i,s){const a=i(t,e);let u=r;a.className&&(n==="vertical"?u=RAe(a.className,r):u=_Ae(a.className,r)),s(t,e,"className",u)}function YJ(t){return`<span class="selected">✓</span>${t}`}function qM(t,e){let n=!1;return Array.isArray(t)&&Te(t,r=>(r.forAll((i,s)=>{if(i>=0&&s>=0&&e(i,s))return n=!0,!1}),n)),n}function XM(t,e){const n={top:0,left:0};if(e!==t.ownerDocument){const{frameElement:r}=e.defaultView,{top:i,left:s}=r.getBoundingClientRect();n.top=i,n.left=s}return n}const Xn="---------";function NAe(){return{name:Xn}}const cd="alignment";function kAe(){return{key:cd,name(){return this.getTranslatedPhrase(I5)},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const t=this.getSelectedRangeActive();return!t||t.isSingleHeader()?!0:!(this.getSelectedRange()&&!this.selection.isSelectedByCorner())},submenu:{items:[{key:`${cd}:left`,name(){return this.getTranslatedPhrase(D5)},callback(){const t=this.getSelectedRange(),e=Rb(t,(i,s)=>this.getCellMeta(i,s).className),n="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",e,t,n,r),Wg(t,n,r,(i,s)=>this.getCellMeta(i,s),(i,s,a,u)=>this.setCellMeta(i,s,a,u)),this.render()},disabled:!1},{key:`${cd}:center`,name(){return this.getTranslatedPhrase(H5)},callback(){const t=this.getSelectedRange(),e=Rb(t,(i,s)=>this.getCellMeta(i,s).className),n="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",e,t,n,r),Wg(t,n,r,(i,s)=>this.getCellMeta(i,s),(i,s,a,u)=>this.setCellMeta(i,s,a,u)),this.render()},disabled:!1},{key:`${cd}:right`,name(){return this.getTranslatedPhrase(L5)},callback(){const t=this.getSelectedRange(),e=Rb(t,(i,s)=>this.getCellMeta(i,s).className),n="horizontal",r="htRight";this.runHooks("beforeCellAlignment",e,t,n,r),Wg(t,n,r,(i,s)=>this.getCellMeta(i,s),(i,s,a,u)=>this.setCellMeta(i,s,a,u)),this.render()},disabled:!1},{key:`${cd}:justify`,name(){return this.getTranslatedPhrase($5)},callback(){const t=this.getSelectedRange(),e=Rb(t,(i,s)=>this.getCellMeta(i,s).className),n="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",e,t,n,r),Wg(t,n,r,(i,s)=>this.getCellMeta(i,s),(i,s,a,u)=>this.setCellMeta(i,s,a,u)),this.render()},disabled:!1},{name:Xn},{key:`${cd}:top`,name(){return this.getTranslatedPhrase(F5)},callback(){const t=this.getSelectedRange(),e=Rb(t,(i,s)=>this.getCellMeta(i,s).className),n="vertical",r="htTop";this.runHooks("beforeCellAlignment",e,t,n,r),Wg(t,n,r,(i,s)=>this.getCellMeta(i,s),(i,s,a,u)=>this.setCellMeta(i,s,a,u)),this.render()},disabled:!1},{key:`${cd}:middle`,name(){return this.getTranslatedPhrase(z5)},callback(){const t=this.getSelectedRange(),e=Rb(t,(i,s)=>this.getCellMeta(i,s).className),n="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",e,t,n,r),Wg(t,n,r,(i,s)=>this.getCellMeta(i,s),(i,s,a,u)=>this.setCellMeta(i,s,a,u)),this.render()},disabled:!1},{key:`${cd}:bottom`,name(){return this.getTranslatedPhrase(V5)},callback(){const t=this.getSelectedRange(),e=Rb(t,(i,s)=>this.getCellMeta(i,s).className),n="vertical",r="htBottom";this.runHooks("beforeCellAlignment",e,t,n,r),Wg(t,n,r,(i,s)=>this.getCellMeta(i,s),(i,s,a,u)=>this.setCellMeta(i,s,a,u)),this.render()},disabled:!1}]}}}const QM="clear_column";function TAe(){return{key:QM,name(){return this.getTranslatedPhrase(w5)},callback(t,e){const n=e[0].start.col,r=e[0].end.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(e[0].start.row,e[0].end.row),r,"ContextMenu.clearColumn")},disabled(){const t=this.getSelectedRangeActive();if(!t||t.isSingleHeader()&&t.highlight.col<0||!this.selection.isSelectedByColumnHeader())return!0;let e=!1;return t.forAll((n,r)=>{if(n<0||r<0)return!0;const{readOnly:i}=this.getCellMeta(n,r);return i?!0:(e=!0,!1)}),!e}}}const C_="col_left";function jAe(){return{key:C_,name(){return this.getTranslatedPhrase(p5)},callback(){const t=this.getSelectedRangeActive().getTopLeftCorner(),e=this.isRtl()?"insert_col_end":"insert_col_start";this.alter(e,t.col,1,"ContextMenu.columnLeft")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeActive();return!t||this.selection.isSelectedByRowHeader()||t.isSingleHeader()&&t.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols?!0:this.selection.isSelectedByCorner()?this.countCols()===0:!1},hidden(){return!this.getSettings().allowInsertColumn}}}const S_="col_right";function MAe(){return{key:S_,name(){return this.getTranslatedPhrase(g5)},callback(){const t=this.getSelectedRangeActive().getTopRightCorner(),e=this.isRtl()?"insert_col_start":"insert_col_end";this.alter(e,t.col,1,"ContextMenu.columnRight")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeActive();return!!(!t||this.selection.isSelectedByRowHeader()||t.isSingleHeader()&&t.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols)},hidden(){return!this.getSettings().allowInsertColumn}}}const R_="make_read_only";function PAe(){return{key:R_,checkable:!0,ariaChecked(){return qM(this.getSelectedRange(),(e,n)=>this.getCellMeta(e,n).readOnly)},ariaLabel(){return this.getTranslatedPhrase(cj)},name(){let t=this.getTranslatedPhrase(cj);return qM(this.getSelectedRange(),(n,r)=>this.getCellMeta(n,r).readOnly)&&(t=YJ(t)),t},callback(){const t=this.getSelectedRange(),e=qM(t,(n,r)=>this.getCellMeta(n,r).readOnly);Te(t,n=>{n.forAll((r,i)=>{r>=0&&i>=0&&this.setCellMeta(r,i,"readOnly",!e)})}),this.render()},disabled(){const t=this.getSelectedRangeActive();return!!(!t||t.isSingleHeader()||this.selection.isSelectedByCorner()||this.countRows()===0||this.countCols()===0||!this.getSelectedRange()||this.getSelectedRange().length===0)}}}const ZM="redo";function AAe(){return{key:ZM,name(){return this.getTranslatedPhrase(x5)},callback(){this.getPlugin("undoRedo").redo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}}const __="remove_col";function OAe(){return{key:__,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[,n,,r]=t[0];n-r!==0&&(e=1)}return this.getTranslatedPhrase(b5,e)},callback(){this.alter("remove_col",Kye(this),null,"ContextMenu.removeColumn")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeActive();if(!t||t.isSingleHeader()&&t.highlight.col<0)return!0;const e=this.countCols();return this.selection.isSelectedByCorner()?e===0:this.selection.isSelectedByRowHeader()||e===0},hidden(){return!this.getSettings().allowRemoveColumn}}}const JM="remove_row";function IAe(){return{key:JM,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[n,,r]=t[0];n-r!==0&&(e=1)}return this.getTranslatedPhrase(v5,e)},callback(){this.alter("remove_row",qye(this),1,"ContextMenu.removeRow")},disabled(){const t=this.getSelectedRangeActive();if(!t||t.isSingleHeader()&&t.highlight.row<0)return!0;const e=this.countRows();return this.selection.isSelectedByCorner()?e===0:this.selection.isSelectedByColumnHeader()||e===0},hidden(){return!this.getSettings().allowRemoveRow}}}const eP="row_above";function DAe(){return{key:eP,name(){return this.getTranslatedPhrase(f5)},callback(){const t=this.getSelectedRangeActive().getTopLeftCorner();this.alter("insert_row_above",t.row,1,"ContextMenu.rowAbove")},disabled(){const t=this.getSelectedRangeActive();return!t||this.selection.isSelectedByColumnHeader()||t.isSingleHeader()&&t.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows?!0:this.selection.isSelectedByCorner()?this.countRows()===0:!1},hidden(){return!this.getSettings().allowInsertRow}}}const tP="row_below";function HAe(){return{key:tP,name(){return this.getTranslatedPhrase(m5)},callback(){const t=this.getSelectedRangeActive().getBottomRightCorner();this.alter("insert_row_below",t.row,1,"ContextMenu.rowBelow")},disabled(){const t=this.getSelectedRangeActive();return!!(!t||this.selection.isSelectedByColumnHeader()||t.isSingleHeader()&&t.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows)},hidden(){return!this.getSettings().allowInsertRow}}}const E_="no_items";function LAe(){return{key:E_,name(){return this.getTranslatedPhrase(h5)},disabled:!0,isCommand:!1}}const nP="undo";function $Ae(){return{key:nP,name(){return this.getTranslatedPhrase(y5)},callback(){this.getPlugin("undoRedo").undo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}}const FAe=[eP,tP,C_,S_,QM,JM,__,nP,ZM,R_,cd,Xn,E_],zAe={[Xn]:NAe,[E_]:LAe,[eP]:DAe,[tP]:HAe,[C_]:jAe,[S_]:MAe,[QM]:TAe,[JM]:IAe,[__]:OAe,[nP]:$Ae,[ZM]:AAe,[R_]:PAe,[cd]:kAe};function GJ(){const t={};return Mr(zAe,(e,n)=>{t[n]=e()}),t}function VAe(t){return{key:"commentsAddEdit",name(){var e;const n=(e=this.getSelectedRangeActive())===null||e===void 0?void 0:e.highlight;return n!=null&&n.isCell()&&t.getCommentAtCell(n.row,n.col)?this.getTranslatedPhrase(P5):this.getTranslatedPhrase(M5)},callback(){const e=this.getSelectedRangeActive();t.setRange(e),t.show(),t.focusEditor()},disabled(){const e=this.getSelectedRangeActive();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function BAe(t){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(A5)},callback(){this.getSelectedRangeActive().forAll((n,r)=>{n>=0&&r>=0&&t.removeCommentAtCell(n,r,!1)}),this.render()},disabled(){const e=this.getSelectedRangeActive();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function WAe(t){return{key:"commentsReadOnly",name(){const e=this.getTranslatedPhrase(O5);return qM(this.getSelectedRange(),(r,i)=>t.getCommentMeta(r,i,iP))?YJ(e):e},callback(){this.getSelectedRangeActive().forAll((n,r)=>{if(n>=0&&r>=0){const i=!!t.getCommentMeta(n,r,iP);t.updateCommentMeta(n,r,{[iP]:!i})}})},disabled(){const e=this.getSelectedRangeActive();return!!(!e||e.highlight.isHeader()||!t.getCommentAtCell(e.highlight.row,e.highlight.col)||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function UAe(t,e){KJ(t,e),e.add(t)}function _b(t,e,n){KJ(t,e),e.set(t,n)}function KJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function YAe(t,e,n){return(e=GAe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GAe(t){var e=KAe(t,"string");return typeof e=="symbol"?e:e+""}function KAe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cf(t,e,n){return t.set(na(t,e),n),n}function Nr(t,e){return t.get(na(t,e))}function na(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const rP="comments",qAe=60,Gm="comment",N_="value",qJ="style",iP="readOnly",k_=rP,Sz=`plugin:${rP}`;var Fi=new WeakMap,uf=new WeakMap,sP=new WeakMap,oP=new WeakMap,aP=new WeakMap,Rz=new WeakMap,lP=new WeakMap,Sa=new WeakSet;class XAe extends Zr{constructor(){super(...arguments),UAe(this,Sa),YAe(this,"range",{}),_b(this,Fi,null),_b(this,uf,null),_b(this,sP,!1),_b(this,oP,!1),_b(this,aP,!1),_b(this,Rz,null),_b(this,lP,"")}static get PLUGIN_KEY(){return rP}static get PLUGIN_PRIORITY(){return qAe}static get DEFAULT_SETTINGS(){return{displayDelay:250}}isEnabled(){return!!this.hot.getSettings()[rP]}enablePlugin(){var e=this;this.enabled||(Nr(Fi,this)||(cf(Fi,this,new Sb(this.hot.rootDocument,this.hot.isRtl(),this.hot.rootPortalElement)),Nr(Fi,this).addLocalHook("resize",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return na(Sa,e,iOe).call(e,...r)}),this.hot.addHook("afterSetTheme",(n,r)=>{r||this.hide()})),Nr(uf,this)||cf(uf,this,new UJ(this.getSetting("displayDelay"))),this.addHook("afterContextMenuDefaultOptions",n=>this.addToContextMenu(n)),this.addHook("afterRenderer",(n,r,i,s,a,u)=>na(Sa,this,tOe).call(this,n,u)),this.addHook("afterScroll",()=>na(Sa,this,sOe).call(this)),this.addHook("afterBeginEditing",()=>this.hide()),this.addHook("afterDocumentKeyDown",n=>na(Sa,this,XJ).call(this,n)),this.addHook("beforeCompositionStart",n=>na(Sa,this,XJ).call(this,n)),Nr(uf,this).addLocalHook("hide",()=>this.hide()),Nr(uf,this).addLocalHook("show",(n,r)=>this.showAtCell(n,r)),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){Nr(uf,this).updateDelay(this.getSetting("displayDelay")),super.updatePlugin()}disablePlugin(){this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager(),n=e.getContext("grid"),r=e.addContext(Sz);n.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const i=this.hot.getSelectedRangeActive();cf(oP,this,!0),this.hot.scrollToFocusedCell(()=>{this.setRange(i),this.show(),this.focusEditor(),e.setActiveContextName(Sz),this.hot._registerTimeout(()=>{cf(oP,this,!1)})})},stopPropagation:!0,runOnlyIf:()=>{var i;return(i=this.hot.getSelectedRangeActive())===null||i===void 0?void 0:i.highlight.isCell()},group:k_}),r.addShortcut({keys:[["Escape"]],callback:()=>{Nr(Fi,this).setValue(Nr(lP,this)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Nr(Fi,this).isVisible()&&Nr(Fi,this).isFocused(),group:k_}),r.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Nr(Fi,this).isVisible()&&Nr(Fi,this).isFocused(),group:k_}),r.addShortcut({keys:[["Shift","Tab"],["Tab"]],forwardToContext:e.getContext("grid"),callback:()=>{cf(aP,this,!0),Nr(Fi,this).setValue(Nr(Fi,this).getValue()),this.setComment(),this.hide(),e.setActiveContextName("grid")},group:k_})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(k_)}registerListeners(){const{rootDocument:e}=this.hot,n=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",r=>na(Sa,this,JAe).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>na(Sa,this,QAe).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>na(Sa,this,eOe).call(this)),this.eventManager.addEventListener(n,"focus",()=>na(Sa,this,rOe).call(this)),this.eventManager.addEventListener(n,"blur",()=>na(Sa,this,nOe).call(this)),this.eventManager.addEventListener(this.getEditorInputElement(),"mousedown",r=>na(Sa,this,ZAe).call(this,r))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const n=k0(e.target,"TD","TBODY");return!!(n&&Dn(n,"htCommentCell")&&k0(n,[this.hot.rootElement]))}targetIsCommentTextArea(e){return this.getEditorInputElement()===e.target}setComment(e){this.range.from||gt('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const n=Nr(Fi,this).getValue();let r="";e!=null?r=e:n!=null&&(r=n);const{row:i,col:s}=na(Sa,this,Xw).call(this);this.updateCommentMeta(i,s,{[N_]:r}),this.hot.render()}setCommentAtCell(e,n,r){this.setRange({from:this.hot._createCellCoords(e,n)}),this.setComment(r)}removeComment(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.range.from||gt('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const{row:n,col:r}=na(Sa,this,Xw).call(this);this.hot.setCellMeta(n,r,Gm),e&&this.hot.render(),this.hide()}removeCommentAtCell(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;this.setRange({from:this.hot._createCellCoords(e,n)}),this.removeComment(r)}getComment(){const{row:e,col:n}=na(Sa,this,Xw).call(this);return this.getCommentMeta(e,n,N_)}getCommentAtCell(e,n){return this.getCommentMeta(e,n,N_)}show(){var e;this.range.from||gt('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const{row:n,col:r}=na(Sa,this,Xw).call(this);if(n<0||n>this.hot.countSourceRows()-1||r<0||r>this.hot.countSourceCols()-1)return!1;const i=this.hot.getCellMeta(n,r);return Nr(uf,this).cancelHiding(),Nr(Fi,this).setValue((e=i[Gm]?i[Gm][N_]:null)!==null&&e!==void 0?e:""),Nr(Fi,this).show(),this.refreshEditor(!0),!0}showAtCell(e,n){return this.setRange({from:this.hot._createCellCoords(e,n)}),this.show()}hide(){Nr(Fi,this).hide()}refreshEditor(){if(!(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&(!this.range.from||!Nr(Fi,this).isVisible()))return;const{rowIndexMapper:n,columnIndexMapper:r}=this.hot,{row:i,col:s}=na(Sa,this,Xw).call(this);let a=n.getRenderableFromVisualIndex(i),u=r.getRenderableFromVisualIndex(s);const h=a===null;Nr(Fi,this).setPosition(0,0),a===null&&(a=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(i,-1))),u===null&&(u=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(s,-1)));const m=a===null,g=u===null;a=a??0,u=u??0;const{rootWindow:y,view:{_wt:x}}=this.hot,{wtTable:C}=x,E=x.getCell({row:a,col:u},!0),M=this.getCommentMeta(i,s,qJ);M?Nr(Fi,this).setSize(M.width,M.height):Nr(Fi,this).resetSize();const j=g?0:C.getColumnWidth(u),L=h&&!m?Po(E):0,{left:D,top:z,width:H,height:V}=E.getBoundingClientRect(),{width:F,height:B}=Nr(Fi,this).getSize(),{innerWidth:te,innerHeight:ve}=this.hot.rootWindow,ce=this.hot.rootDocument.documentElement,_e=go(this.hot.rootDocument),pe=pG(this.hot.rootWindow)?_e:0,Le=gG(this.hot.rootWindow)?_e:0;let Fe=D+y.scrollX+j,nt=z+y.scrollY+L;this.hot.isRtl()&&(Fe-=F+j),this.hot.isLtr()&&D+H+F>te-pe?Fe=D+y.scrollX-F-1:this.hot.isRtl()&&Fe<-(ce.scrollWidth-ce.clientWidth)&&(Fe=D+y.scrollX+j+1),z+B>ve-Le&&(nt-=B-V+1),Nr(Fi,this).setPosition(Fe,nt),Nr(Fi,this).setReadOnlyState(this.getCommentMeta(i,s,iP)),Nr(Fi,this).observeSize()}focusEditor(){Nr(Fi,this).focus()}updateCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n)[Gm];let s;i?(s=ea(i),NT(s,r)):s=r,this.hot.setCellMeta(e,n,Gm,s)}getCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n);if(i[Gm])return i[Gm][r]}addToContextMenu(e){e.items.push({name:Xn},VAe(this),BAe(this),WAe(this))}getEditorInputElement(){return Nr(Fi,this).getInputElement()}destroy(){var e,n;(e=Nr(Fi,this))===null||e===void 0||e.destroy(),(n=Nr(uf,this))===null||n===void 0||n.destroy(),super.destroy()}}function QAe(t){if(!(!this.hot.view||!this.hot.view._wt)&&!Nr(sP,this)&&!this.targetIsCommentTextArea(t)){const e=k0(t.target,"TD","TBODY");let n=null;e&&(n=this.hot.getCoords(e)),(!e||this.range.from&&n&&(this.range.from.row!==n.row||this.range.from.col!==n.col))&&this.hide()}}function ZAe(t){t.stopPropagation()}function JAe(t){const{rootDocument:e}=this.hot;if(!(Nr(sP,this)||Nr(Fi,this).isFocused()||Dn(t.target,"wtBorder")||Nr(Rz,this)===t.target||!Nr(Fi,this)))if(cf(Rz,this,e.elementFromPoint(t.clientX,t.clientY)),this.targetIsCellWithComment(t)){const n=this.hot._createCellRange(this.hot.getCoords(t.target));Nr(uf,this).show(n)}else T0(t.target,e)&&!this.targetIsCommentTextArea(t)&&Nr(uf,this).hide()}function eOe(){cf(sP,this,!1)}function tOe(t,e){e[Gm]&&e[Gm][N_]&&st(t,e.commentedCellClassName)}function nOe(){if(Nr(aP,this)){cf(aP,this,!1);return}cf(lP,this,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function rOe(){cf(lP,this,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(Sz)}function iOe(t,e){const{row:n,col:r}=na(Sa,this,Xw).call(this);this.updateCommentMeta(n,r,{[qJ]:{width:t,height:e}})}function XJ(t){Nr(Fi,this).isFocused()&&iu(t)}function sOe(){Nr(oP,this)||this.hide()}function Xw(){return this.range instanceof Xx?this.range.highlight:this.hot._createCellCoords(this.range.from.row,this.range.from.col)}function _z(t,e,n){return(e=oOe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oOe(t){var e=aOe(t,"string");return typeof e=="symbol"?e:e+""}function aOe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class QJ{constructor(e){_z(this,"hot",void 0),_z(this,"commands",{}),_z(this,"commonCallback",null),this.hot=e}registerCommand(e,n){this.commands[e]=n}setCommonCallback(e){this.commonCallback=e}execute(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];const s=e.split(":"),a=s[0],u=s.length===2?s[1]:null;let h=this.commands[a];if(h||gt(`Menu command '${a}' not exists.`),u&&h.submenu&&(h=lOe(u,h.submenu.items)),h.disabled===!0||typeof h.disabled=="function"&&h.disabled.call(this.hot)===!0||Ps(h,"submenu"))return;const m=[];typeof h.callback=="function"&&m.push(h.callback),typeof this.commonCallback=="function"&&m.push(this.commonCallback),r.unshift(s.join(":")),Te(m,g=>g.apply(this.hot,r))}}function lOe(t,e){let n;return Te(e,r=>{const i=r.key?r.key.split(":"):null;if(Array.isArray(i)&&i[1]===t)return n=r,!1}),n}function Ez(t,e,n){return(e=cOe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cOe(t){var e=uOe(t,"string");return typeof e=="symbol"?e:e+""}function uOe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ZJ{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Ez(this,"hot",void 0),Ez(this,"predefinedItems",GJ()),Ez(this,"defaultOrderPattern",void 0),this.hot=e,this.defaultOrderPattern=n}setPredefinedItems(e){const n={};this.defaultOrderPattern.length=0,Mr(e,(r,i)=>{let s="";r.name===Xn?(n[Xn]=r,s=Xn):isNaN(parseInt(i,10))?(r.key=r.key===void 0?i:r.key,n[i]=r,s=r.key):(n[r.key]=r,s=r.key),this.defaultOrderPattern.push(s)}),this.predefinedItems=n}getItems(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return dOe(e,this.defaultOrderPattern,this.predefinedItems)}}function dOe(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=[];let i=t;return i&&i.items?i=i.items:Array.isArray(i)||(i=e),nn(i)?Mr(i,(s,a)=>{let u=n[typeof s=="string"?s:a];u||(u=s),nn(s)?jo(u,s):typeof u=="string"&&(u={name:u}),u.key===void 0&&(u.key=a),r.push(u)}):Te(i,(s,a)=>{let u=n[s];!u&&FAe.indexOf(s)>=0||(u||(u={name:s,key:`${a}`}),nn(s)&&jo(u,s),u.key===void 0&&(u.key=a),r.push(u))}),r}function Ug(t,e,n){return(e=hOe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hOe(t){var e=fOe(t,"string");return typeof e=="symbol"?e:e+""}function fOe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class mOe{constructor(e,n){Ug(this,"top",void 0),Ug(this,"topRelative",void 0),Ug(this,"left",void 0),Ug(this,"leftRelative",void 0),Ug(this,"scrollTop",void 0),Ug(this,"scrollLeft",void 0),Ug(this,"cellHeight",void 0),Ug(this,"cellWidth",void 0);const r=n.scrollY,i=n.scrollX;let s,a,u,h,m,g;this.rootWindow=n,this.type=this.getSourceType(e),this.type==="literal"?(s=parseInt(e.top,10),u=parseInt(e.left,10),m=e.height||0,g=e.width||0,a=s,h=u,s+=r,u+=i):this.type==="event"&&(s=parseInt(e.pageY,10),u=parseInt(e.pageX,10),m=e.target.clientHeight,g=e.target.clientWidth,a=s-r,h=u-i),this.top=s,this.topRelative=a,this.left=u,this.leftRelative=h,this.scrollTop=r,this.scrollLeft=i,this.cellHeight=m,this.cellWidth=g}getSourceType(e){let n="literal";return e instanceof Event&&(n="event"),n}fitsAbove(e){return this.topRelative>=e.offsetHeight}fitsBelow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.innerHeight;return this.topRelative+e.offsetHeight<=n}fitsOnRight(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.document.documentElement.clientWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=n}fitsOnLeft(e){return this.leftRelative>=e.offsetWidth}}function T_(t,e,n){pOe(t,e),e.set(t,n)}function pOe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xr(t,e){return t.get(JJ(t,e))}function cP(t,e,n){return t.set(JJ(t,e),n),n}function JJ(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Yl=new WeakMap,Mc=new WeakMap,Pc=new WeakMap,Nz=new WeakMap,Qw=new WeakMap;class gOe{constructor(e){T_(this,Yl,void 0),T_(this,Mc,void 0),T_(this,Pc,void 0),T_(this,Nz,!1),T_(this,Qw,{above:0,below:0,left:0,right:0}),cP(Nz,this,e)}setOffset(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return xr(Qw,this)[e]=n,this}setElement(e){return cP(Yl,this,e),this}setParentElement(e){return cP(Mc,this,e),this}updatePosition(e){cP(Pc,this,new mOe(e,xr(Yl,this).ownerDocument.defaultView)),xr(Nz,this)?(xr(Pc,this).fitsBelow(xr(Yl,this))?this.setPositionBelowCursor():xr(Pc,this).fitsAbove(xr(Yl,this))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){xr(Yl,this).dir==="rtl"?xr(Pc,this).fitsOnLeft(xr(Yl,this))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():xr(Pc,this).fitsOnRight(xr(Yl,this))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=xr(Qw,this).above+xr(Pc,this).top-xr(Yl,this).offsetHeight;if(xr(Mc,this)){const r=xr(Mc,this).ownerDocument.defaultView.getComputedStyle(xr(Mc,this).querySelector(".ht_master")),i=Number.parseInt(r.paddingTop,10),s=Number.parseInt(r.borderTop,10);e=xr(Pc,this).top+xr(Pc,this).cellHeight-xr(Yl,this).scrollHeight+i+s}xr(Yl,this).style.top=`${e}px`}setPositionBelowCursor(){let e=xr(Qw,this).below+xr(Pc,this).top+1;if(xr(Mc,this)){const r=xr(Mc,this).ownerDocument.defaultView.getComputedStyle(xr(Mc,this).querySelector(".ht_master")),i=Number.parseInt(r.paddingTop,10),s=Number.parseInt(r.borderTop,10);e=xr(Pc,this).top-i-s}xr(Yl,this).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=xr(Pc,this).left;if(xr(Mc,this)){const n=xr(Mc,this).ownerDocument.defaultView,r=Number.parseInt(n.getComputedStyle(xr(Mc,this).querySelector(".htCore")).borderRightWidth,10);e+=xr(Pc,this).cellWidth+r}else e+=xr(Qw,this).right;xr(Yl,this).style.left=`${e}px`}setPositionOnLeftOfCursor(){let e=xr(Qw,this).left+xr(Pc,this).left-xr(Yl,this).offsetWidth;if(xr(Mc,this)){const n=xr(Mc,this).ownerDocument.defaultView,r=Number.parseInt(n.getComputedStyle(xr(Mc,this).querySelector(".htCore")).borderLeftWidth,10);e-=r}xr(Yl,this).style.left=`${e}px`}}function eee(t){let{initialPage:e=-1,size:n=()=>0,onItemSelect:r=()=>{},onClear:i=()=>{}}=t;const s=new Set;let a=Lr(e,-1,M()-1);function u(L,D){const z=M()-1;return L<0&&(L=z),L>z&&(L=0),s.has(L)?-1:(s.add(L),r(L,!1)===!1&&(L=u(D===1?++L:--L,D)),L)}function h(L){L>-1&&L<M()&&r(L,!0)!==!1&&(a=L)}function m(L){L>-1&&L<M()&&(a=L)}function g(){return a}function y(){M()>0&&(s.clear(),a=u(0,1))}function x(){M()>0&&(s.clear(),a=u(M()-1,-1))}function C(){M()>0&&(s.clear(),a=u(++a,1))}function E(){M()>0&&(s.clear(),a=u(--a,-1))}function M(){return Math.max(n(),0)}function j(){s.clear(),a=e,i()}return{setCurrentPage:h,setPageCursorAt:m,getCurrentPage:g,toFirstItem:y,toLastItem:x,toNextItem:C,toPreviousItem:E,getSize:M,clear:j}}function vOe(t){return di(t,e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()}))}function kz(t){return Ps(t,"submenu")}function Tz(t){return new RegExp(Xn,"i").test(t.name)}function uP(t,e){return t.disabled===!0||typeof t.disabled=="function"&&t.disabled.call(e)===!0}function tee(t){return Ps(t,"disableSelection")}function bOe(t){return Dn(t,"htSeparator")}function yOe(t){return Dn(t,"htSubmenu")}function xOe(t){return Dn(t,"htDisabled")}function wOe(t){return Dn(t,"htSelectionDisabled")}function COe(t,e){return!t.hidden||!(typeof t.hidden=="function"&&t.hidden.call(e))}function nee(t,e){const n=t.slice(0);for(let r=0;r<n.length&&n[r].name===e;)n.shift();return n}function SOe(t,e){let n=t.slice(0);return n.reverse(),n=nee(n,e),n.reverse(),n}function ROe(t){const e=[];return Te(t,(n,r)=>{r>0?e[e.length-1].name!==n.name&&e.push(n):e.push(n)}),e}function _Oe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xn,n=t.slice(0);return n=nee(n,e),n=SOe(n,e),n=ROe(n),n}function EOe(t){return t.checkable===!0}function NOe(t){return eee({size:()=>t.countRows(),onItemSelect(e,n){const r=t.getCell(e,0);if(!r||bOe(r)||xOe(r)||wOe(r))return!1;t.selectCell(e,0,...n?[e,0,!1,!1]:[])},onClear(){t.deselectCell()}})}function kOe(t){const{hot:e,hotMenu:n}=t;return[{keys:[["Control/Meta","A"]],forwardToContext:e.getShortcutManager().getContext("grid"),callback:()=>t.close(!0)},{keys:[["Tab"],["Shift","Tab"]],callback:(r,i)=>{const s=e.getSettings(),a=typeof s.tabMoves=="function"?s.tabMoves(r):s.tabMoves;i.includes("shift")?e.selection.transformStart(-a.row,-a.col):e.selection.transformStart(a.row,a.col),t.close(!0)}},{keys:[["Escape"]],callback:()=>t.close()},{keys:[["ArrowDown"]],callback:()=>t.getNavigator().toNextItem()},{keys:[["ArrowUp"]],callback:()=>t.getNavigator().toPreviousItem()},{keys:[[e.isRtl()?"ArrowLeft":"ArrowRight"]],callback:()=>{const r=n.getSelectedActive();if(r){const i=t.openSubMenu(r[0]);i&&i.getNavigator().toFirstItem()}}},{keys:[[e.isRtl()?"ArrowRight":"ArrowLeft"]],callback:()=>{n.getSelectedActive()&&t.isSubMenu()&&(t.close(),t.isSubMenu()&&t.parentMenu.hotMenu.listen())}},{keys:[["Control/Meta","ArrowUp"],["Home"]],callback:()=>t.getNavigator().toFirstItem()},{keys:[["Control/Meta","ArrowDown"],["End"]],callback:()=>t.getNavigator().toLastItem()},{keys:[["Enter"],["Space"]],callback:r=>{const i=n.getSelectedActive();i&&(n.getSourceDataAtRow(i[0]).submenu?t.openSubMenu(i[0]).getNavigator().toFirstItem():(t.executeCommand(r),t.close(!0)))}},{keys:[["PageUp"]],callback:()=>{n.getSelectedActive()?n.selection.transformStart(-n.countVisibleRows(),0):t.getNavigator().toFirstItem()}},{keys:[["PageDown"]],callback:()=>{n.getSelectedActive()?n.selection.transformStart(n.countVisibleRows(),0):t.getNavigator().toLastItem()}}]}const ree="menu",iee=ree;function TOe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=[];r(kOe(t)),e.forEach(m=>{let{shortcuts:g,contextName:y}=m;i(g,y)});function r(m,g){u(g).addShortcuts(m,{group:ree})}function i(m,g){const y=u(g);m.forEach(x=>{let{keys:C}=x;C.forEach(E=>y.removeShortcutsByKeys(E))}),n.push({shortcuts:m,contextName:g}),r(m,g)}function s(){return[...n]}function a(m){return m?`${iee}:${m}`:iee}function u(m){var g;const y=t.hotMenu.getShortcutManager(),x=a(m);return(g=y.getContext(x))!==null&&g!==void 0?g:y.addContext(x)}function h(m){t.hotMenu.getShortcutManager().setActiveContextName(a(m))}return{addCustomShortcuts:i,getCustomShortcuts:s,getContext:u,listen:h}}function jOe(t){return(e,n,r,i,s,a,u)=>{const h=e.getSourceDataAtRow(r),m=t.rootDocument.createElement("div"),g=typeof a=="function"?a.call(t):a,y=typeof h.ariaLabel=="function"?h.ariaLabel.call(t):h.ariaLabel,x=typeof h.ariaChecked=="function"?h.ariaChecked.call(t):h.ariaChecked;if(u.readOnlyCellClassName="",Bh(n),st(m,"htItemWrapper"),t.getSettings().ariaTags){const C=!uP(h,t)&&!tee(h)&&!Tz(h);gn(n,[...EOe(h)?[npe(),wc(y),tG(x)]:[tpe(),wc(g)],...C?[Ld(-1)]:[],...uP(h,t)?[lR()]:[],...kz(h)?[qu(!1)]:[]])}n.className="",n.appendChild(m),Tz(h)?st(n,"htSeparator"):typeof h.renderer=="function"?(st(n,"htCustomMenuRenderer"),n.appendChild(h.renderer(e,m,r,i,s,g))):M0(m,g,t.getSettings().sanitizer),uP(h,t)?st(n,"htDisabled"):tee(h)?st(n,"htSelectionDisabled"):kz(h)&&st(n,"htSubmenu")}}function jz(t,e,n){MOe(t,e),e.set(t,n)}function MOe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function df(t,e,n){return(e=POe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function POe(t){var e=AOe(t,"string");return typeof e=="symbol"?e:e+""}function AOe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Mz(t,e,n){return t.set(see(t,e),n),n}function Eb(t,e){return t.get(see(t,e))}function see(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const oee=215;var j_=new WeakMap,dP=new WeakMap,hP=new WeakMap;class Zw{get tableBorderWidth(){return Eb(hP,this)===void 0&&this.hotMenu&&Mz(hP,this,parseInt(this.hotMenu.rootWindow.getComputedStyle(this.hotMenu.view._wt.wtTable.TABLE).borderWidth,10)),Eb(hP,this)}constructor(e,n){var r=this;df(this,"hot",void 0),df(this,"options",void 0),df(this,"eventManager",new Sc(this)),df(this,"container",void 0),df(this,"positioner",void 0),df(this,"hotMenu",null),df(this,"hotSubMenus",{}),df(this,"parentMenu",void 0),df(this,"menuItems",null),df(this,"origOutsideClickDeselects",null),jz(this,j_,void 0),jz(this,dP,void 0),jz(this,hP,void 0),this.hot=e,this.options=n||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:oee,container:this.hot.rootPortalElement},this.container=this.createContainer(this.options.name),this.positioner=new gOe(this.options.keepInViewport),this.parentMenu=this.options.parent||null,this.registerEvents(),this.isSubMenu()&&this.addLocalHook("afterSelectionChange",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return r.parentMenu.runLocalHooks("afterSelectionChange",...s)}),this.hot.addHook("afterSetTheme",(i,s)=>{this.options.container!==this.hot.rootPortalElement&&(cn(this.options.container,/ht-theme-.*/g),st(this.options.container,i)),s||this.close()})}registerEvents(){let e=this.hot.rootWindow;for(;e;)this.eventManager.addEventListener(e.document,"mousedown",n=>this.onDocumentMouseDown(n)),this.eventManager.addEventListener(e.document,"touchstart",n=>this.onDocumentMouseDown(n)),this.eventManager.addEventListener(e.document,"contextmenu",n=>this.onDocumentContextMenu(n)),e=wg(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return Eb(j_,this)}getKeyboardShortcutsCtrl(){return Eb(dP,this)}getSelectedItem(){return this.hasSelectedItem()?this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelectedActive()[0]):null}hasSelectedItem(){return Array.isArray(this.hotMenu.getSelectedActive())}isSubMenu(){return this.parentMenu!==null}open(){this.runLocalHooks("beforeOpen"),this.container.removeAttribute("style"),this.container.style.display="block";const e=$T(u=>this.openSubMenu(u),300),n=this.options.minWidth||oee;let r=!1,i=E0(this.menuItems,u=>(u.key===E_&&(r=!0),COe(u,this.hot)));if(i.length<1&&!r)i.push(GJ()[E_]);else if(i.length===0)return;i=_Oe(i,Xn);let s=!1;const a={data:i,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth(u){return Lt(u)&&u<n?n:u},autoRowSize:!1,readOnly:!0,editor:!1,copyPaste:!1,hiddenRows:!0,maxCols:1,columns:[{data:"name",renderer:jOe(this.hot)}],renderAllRows:!0,fragmentSelection:!1,outsideClickDeselects:!1,disableVisualSelection:"area",layoutDirection:this.hot.isRtl()?"rtl":"ltr",ariaTags:!1,themeName:this.hot.getCurrentThemeName(),beforeRefreshDimensions:()=>!1,beforeOnCellMouseOver:(u,h)=>{Eb(j_,this).setPageCursorAt(h.row)},afterOnCellMouseOver:(u,h)=>{this.isAllSubMenusClosed()?e(h.row):this.openSubMenu(h.row)},afterOnCellContextMenu:u=>{u.preventDefault(),iL()&&s&&this.hasSelectedItem()&&this.close(!0)},afterSelection:(u,h,m,g,y)=>{this.hotMenu.view.isMouseDown()&&(y.value=!0),this.runLocalHooks("afterSelectionChange",this.getSelectedItem())},beforeOnCellMouseUp:u=>{this.hasSelectedItem()&&(s=!this.isCommandPassive(this.getSelectedItem()),this.executeCommand(u))},afterOnCellMouseUp:u=>{(!iL()||!O0(u))&&s&&this.hasSelectedItem()&&(Vh()||rL()?this.hot._registerTimeout(()=>this.close(!0),325):this.close(!0))},afterUnlisten:()=>{!this.hasSelectedItem()&&this.isOpened()&&this.hotMenu.listen()}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new this.hot.constructor(this.container,a),this.hotMenu.addHook("afterInit",()=>this.onAfterInit()),this.hotMenu.init(),Mz(j_,this,NOe(this.hotMenu)),Mz(dP,this,TOe(this)),Eb(dP,this).listen(),this.focus(),this.isSubMenu()&&this.addLocalHook("afterOpen",()=>this.parentMenu.runLocalHooks("afterSubmenuOpen",this)),this.runLocalHooks("afterOpen",this)}close(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.isOpened()){if(e&&this.isSubMenu())this.parentMenu.close();else if(Eb(j_,this).clear(),this.closeAllSubMenus(),this.container.style.display="none",this.hotMenu.destroy(),this.hotMenu=null,this.hot.getSettings().outsideClickDeselects=this.origOutsideClickDeselects,this.runLocalHooks("afterClose"),this.isSubMenu()){if(this.hot.getSettings().ariaTags){const n=this.parentMenu.hotMenu.getSelectedActive();if(n){const r=this.parentMenu.hotMenu.getCell(n[0],0);gn(r,[qu(!1)])}}this.parentMenu.hotMenu.listen()}}}openSubMenu(e){if(!this.hotMenu)return!1;const n=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!n||!yOe(n))return!1;const r=this.hotMenu.getSourceDataAtRow(e),i=new Zw(this.hot,{parent:this,name:r.name,className:this.options.className,keepInViewport:!0,container:this.options.container});return i.setMenuItems(r.submenu.items),i.open(),i.setPosition(n.getBoundingClientRect()),this.hotSubMenus[r.key]=i,this.hot.getSettings().ariaTags&&gn(n,[qu(!0)]),i}closeSubMenu(e){const n=this.hotMenu.getSourceDataAtRow(e),r=this.hotSubMenus[n.key];if(r){r.destroy(),delete this.hotSubMenus[n.key];const i=this.hotMenu.getCell(e,0);this.hot.getSettings().ariaTags&&gn(i,[qu(!1)])}}closeAllSubMenus(){Te(this.hotMenu.getData(),(e,n)=>this.closeSubMenu(n))}isAllSubMenusClosed(){return Object.keys(this.hotSubMenus).length===0}focus(){this.isOpened()&&(this.hotMenu.rootElement.focus({preventScroll:!0}),this.getKeyboardShortcutsCtrl().listen(),this.hotMenu.listen())}destroy(){const e=this.container.parentNode;this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy(),e&&e.removeChild(this.container)}isOpened(){return this.hotMenu!==null}executeCommand(e){if(!this.isOpened()||!this.hasSelectedItem())return;const n=this.getSelectedItem();if(this.runLocalHooks("select",n,e),this.isCommandPassive(n))return;const r=this.hot.getSelectedRange(),i=r?vOe(r):[];this.runLocalHooks("executeCommand",n.key,i,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",n.key,i,e)}isCommandPassive(e){return e.isCommand===!1||Tz(e)||uP(e,this.hot)||kz(e)}setOffset(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.positioner.setOffset(e,n)}setPosition(e){this.isSubMenu()&&this.positioner.setParentElement(this.parentMenu.container),this.positioner.setElement(this.container).updatePosition(e)}updateMenuDimensions(){const{wtTable:e}=this.hotMenu.view._wt,n=this.hotMenu.getSettings().data,r=e.hider.style,i=e.holder.style,s=parseInt(r.width,10),a=xc(n,(u,h,m)=>{const y=this.hotMenu.getCell(m,0)?Po(this.hotMenu.getCell(m,0)):0;return u+(h.name===Xn?1:y)},0);i.width=`${s}px`,i.height=`${a}px`,r.height=i.height}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const n=this.options.container.ownerDocument;let r=e,i;return r&&(ri(r)&&(r=r.call(this.hot),r===null||ls(r)?r="":r=r.toString()),r=r.replace(/[^A-Za-z0-9]/g,"_"),r=`${this.options.className}Sub_${r}`,i=n.querySelector(`.${this.options.className}.${r}`)),i||(i=n.createElement("div"),st(i,`htMenu handsontable ${this.options.className}`),r&&st(i,r),this.options.container.appendChild(i)),i}onAfterInit(){this.updateMenuDimensions(),this.hot.getSettings().ariaTags&&gn(this.hotMenu.rootElement,[epe(),Ld(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!T0(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!T0(e.target,".htMenu")&&this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&Dn(e.target,"htCore")&&T0(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}ci(Zw,vo);function OOe(t,e){IOe(t,e),e.add(t)}function IOe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pz(t,e,n){return(e=DOe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function DOe(t){var e=HOe(t,"string");return typeof e=="symbol"?e:e+""}function HOe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fP(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const M_="contextMenu",LOe=70,aee=M_;un.getSingleton().register("afterContextMenuDefaultOptions"),un.getSingleton().register("beforeContextMenuShow"),un.getSingleton().register("afterContextMenuShow"),un.getSingleton().register("afterContextMenuHide"),un.getSingleton().register("afterContextMenuExecute");var P_=new WeakSet;class mP extends Zr{constructor(){super(...arguments),OOe(this,P_),Pz(this,"commandExecutor",new QJ(this.hot)),Pz(this,"itemsFactory",null),Pz(this,"menu",null)}static get PLUGIN_KEY(){return M_}static get PLUGIN_PRIORITY(){return LOe}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[eP,tP,Xn,C_,S_,Xn,JM,__,Xn,nP,ZM,Xn,R_,Xn,cd]}isEnabled(){return!!this.hot.getSettings()[M_]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[M_];typeof n.callback=="function"&&this.commandExecutor.setCommonCallback(n.callback),this.menu=new Zw(this.hot,{className:"htContextMenu",keepInViewport:!0,container:n.uiContainer||this.hot.rootPortalElement}),this.menu.addLocalHook("beforeOpen",()=>fP(P_,this,FOe).call(this)),this.menu.addLocalHook("afterOpen",()=>fP(P_,this,zOe).call(this)),this.menu.addLocalHook("afterClose",()=>fP(P_,this,VOe).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e.executeCommand.call(e,...i)}),this.addHook("afterOnCellContextMenu",r=>fP(P_,this,$Oe).call(this,r)),this.addHook("beforeDialogShow",()=>this.close()),this.registerShortcuts(),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&(this.menu.destroy(),this.menu=null),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control/Meta","Shift","Backslash"],["Shift","F10"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeActive();this.hot.scrollToFocusedCell();const n=this.hot.getCell(e.row,e.col,!0).getBoundingClientRect(),r=XM(this.menu.container,this.hot.rootDocument);this.open({left:n.left+r.left,top:n.top+r.top-1+n.height},{left:n.width,above:-n.height}),this.menu.getNavigator().toFirstItem()},runOnlyIf:()=>{var e;const n=(e=this.hot.getSelectedRangeActive())===null||e===void 0?void 0:e.highlight;return n&&this.hot.selection.isCellVisible(n)&&!this.menu.isOpened()},group:aee})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(aee)}open(e){var n;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};(n=this.menu)!==null&&n!==void 0&&n.isOpened()||(this.prepareMenuItems(),this.menu.open(),Mr(r,(i,s)=>{this.menu.setOffset(s,i)}),this.menu.setPosition(e))}close(){var e;(e=this.menu)===null||e===void 0||e.close(),this.itemsFactory=null}executeCommand(e){this.itemsFactory===null&&this.prepareMenuItems();for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.commandExecutor.execute(e,...r)}prepareMenuItems(){this.itemsFactory=new ZJ(this.hot,mP.DEFAULT_ITEMS);const e=this.hot.getSettings()[M_],n={items:this.itemsFactory.getItems(e)};this.hot.runHooks("afterContextMenuDefaultOptions",n),this.itemsFactory.setPredefinedItems(n.items);const r=this.itemsFactory.getItems(e);this.hot.runHooks("beforeContextMenuSetItems",r),this.menu.setMenuItems(r),Te(r,i=>this.commandExecutor.registerCommand(i.key,i))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function $Oe(t){const e=this.hot.getSettings(),n=e.rowHeaders,r=e.colHeaders;function i(u){return u.nodeName==="TD"||u.parentNode.nodeName==="TD"}const s=t.target;if(this.close(),Dn(s,"handsontableInput")||(t.preventDefault(),t.stopPropagation(),!(n||r)&&!i(s)&&!(Dn(s,"current")&&Dn(s,"wtBorder"))))return;const a=XM(this.menu.container,this.hot.rootDocument);this.open({top:t.clientY+a.top,left:t.clientX+a.left})}function FOe(){this.hot.runHooks("beforeContextMenuShow",this)}function zOe(){this.hot.runHooks("afterContextMenuShow",this)}function VOe(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}mP.SEPARATOR={name:Xn};function BOe(t){return{key:"copy",name(){return this.getTranslatedPhrase(C5)},callback(){t.copyCellsOnly()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeActive();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function WOe(t){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeActive(),n=e?Lr(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(_5,n)},callback(){t.copyColumnHeadersOnly()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeActive();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function UOe(t){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeActive(),n=e?Lr(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(R5,n)},callback(){t.copyWithAllColumnHeaders()},disabled(){if(!this.hasColHeaders()||!this.getSettings().nestedHeaders)return!0;const e=this.getSelectedRangeActive();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function YOe(t){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeActive(),n=e?Lr(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(S5,n)},callback(){t.copyWithColumnHeaders()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeActive();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function GOe(t){return{key:"cut",name(){return this.getTranslatedPhrase(E5)},callback(){t.cut()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeActive();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}class KOe{constructor(){this.data={}}setData(e,n){this.data[e]=n}getData(e){return this.data[e]||void 0}}class qOe{constructor(){this.clipboardData=new KOe}preventDefault(){}composedPath(){return[]}}function XOe(t,e){lee(t,e),e.add(t)}function Jw(t,e,n){lee(t,e),e.set(t,n)}function lee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gl(t,e){return t.get(tC(t,e))}function eC(t,e,n){return t.set(tC(t,e),n),n}function tC(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Yg=new WeakMap,Az=new WeakMap,A_=new WeakMap,Oz=new WeakMap,Iz=new WeakMap,O_=new WeakMap,I_=new WeakSet;class QOe{constructor(e){let{countRows:n,countColumns:r,rowsLimit:i,columnsLimit:s,countColumnHeaders:a}=e;XOe(this,I_),Jw(this,Yg,void 0),Jw(this,Az,void 0),Jw(this,A_,void 0),Jw(this,Oz,void 0),Jw(this,Iz,void 0),Jw(this,O_,void 0),eC(Az,this,n),eC(A_,this,r),eC(Oz,this,i),eC(Iz,this,s),eC(O_,this,a)}setSelectedRange(e){eC(Yg,this,e)}getCellsRange(){if(Gl(Az,this).call(this)===0||Gl(A_,this).call(this)===0)return null;const{row:e,col:n}=Gl(Yg,this).getTopStartCorner(),{row:r,col:i}=Gl(Yg,this).getBottomEndCorner(),s=tC(I_,this,ZOe).call(this,e,r),a=tC(I_,this,Dz).call(this,n,i);return{isRangeTrimmed:r!==s||i!==a,startRow:e,startCol:n,endRow:s,endCol:a}}getMostBottomColumnHeadersRange(){if(Gl(A_,this).call(this)===0||Gl(O_,this).call(this)===0)return null;const{col:e}=Gl(Yg,this).getTopStartCorner(),{col:n}=Gl(Yg,this).getBottomEndCorner(),r=tC(I_,this,Dz).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-1,startCol:e,endRow:-1,endCol:r}}getAllColumnHeadersRange(){if(Gl(A_,this).call(this)===0||Gl(O_,this).call(this)===0)return null;const{col:e}=Gl(Yg,this).getTopStartCorner(),{col:n}=Gl(Yg,this).getBottomEndCorner(),r=tC(I_,this,Dz).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-Gl(O_,this).call(this),startCol:e,endRow:-1,endCol:r}}}function Dz(t,e){return Math.min(e,Math.max(t+Gl(Iz,this).call(this)-1,t))}function ZOe(t,e){return Math.min(e,Math.max(t+Gl(Oz,this).call(this)-1,t))}function cee(t){const e=[],n=[];return Te(t,r=>{const i=Math.min(r.startRow,r.endRow),s=Math.max(r.startRow,r.endRow);En(i,s,h=>{e.indexOf(h)===-1&&e.push(h)});const a=Math.min(r.startCol,r.endCol),u=Math.max(r.startCol,r.endCol);En(a,u,h=>{n.indexOf(h)===-1&&n.push(h)})}),{rows:e,columns:n}}function JOe(t,e){uee(t,e),e.add(t)}function Gg(t,e,n){uee(t,e),e.set(t,n)}function uee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function D_(t,e,n){return(e=eIe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eIe(t){var e=tIe(t,"string");return typeof e=="symbol"?e:e+""}function tIe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ac(t,e){return t.get(fl(t,e))}function eh(t,e,n){return t.set(fl(t,e),n),n}function fl(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}un.getSingleton().register("afterCopyLimit"),un.getSingleton().register("modifyCopyableRange"),un.getSingleton().register("beforeCut"),un.getSingleton().register("afterCut"),un.getSingleton().register("beforePaste"),un.getSingleton().register("afterPaste"),un.getSingleton().register("beforeCopy"),un.getSingleton().register("afterCopy");const Hz="copyPaste",nIe=80,rIe=["fragmentSelection"],dee="application/ht-source-data-json-html",hee=['<meta name="generator" content="Handsontable"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join(""),fee=new WeakSet;var Lz=new WeakMap,$z=new WeakMap,Fz=new WeakMap,nC=new WeakMap,pP=new WeakMap,gP=new WeakMap,rC=new WeakMap,vP=new WeakMap,Kl=new WeakSet;class iIe extends Zr{constructor(){super(...arguments),JOe(this,Kl),D_(this,"columnsLimit",1/0),D_(this,"rowsLimit",1/0),D_(this,"pasteMode","overwrite"),D_(this,"uiContainer",this.hot.rootDocument.body),Gg(this,Lz,!1),Gg(this,$z,!1),Gg(this,Fz,!1),Gg(this,nC,"cells-only"),Gg(this,pP,!1),Gg(this,gP,!1),Gg(this,rC,new QOe({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),Gg(this,vP,!1),D_(this,"copyableRanges",[])}static get PLUGIN_KEY(){return Hz}static get SETTING_KEYS(){return[Hz,...rIe]}static get PLUGIN_PRIORITY(){return nIe}static get DEFAULT_SETTINGS(){return{pasteMode:"overwrite",rowsLimit:1/0,columnsLimit:1/0,copyColumnHeaders:!1,copyColumnGroupHeaders:!1,copyColumnHeadersOnly:!1}}isEnabled(){return!!this.hot.getSettings()[Hz]}enablePlugin(){var e,n,r=this;this.enabled||(this.pasteMode=(e=this.getSetting("pasteMode"))!==null&&e!==void 0?e:this.pasteMode,this.rowsLimit=isNaN(this.getSetting("rowsLimit"))?this.rowsLimit:this.getSetting("rowsLimit"),this.columnsLimit=isNaN(this.getSetting("columnsLimit"))?this.columnsLimit:this.getSetting("columnsLimit"),eh(Lz,this,this.getSetting("copyColumnHeaders")),eh($z,this,this.getSetting("copyColumnGroupHeaders")),eh(Fz,this,this.getSetting("copyColumnHeadersOnly")),this.uiContainer=(n=this.getSetting("uiContainer"))!==null&&n!==void 0?n:this.uiContainer,this.addHook("afterContextMenuDefaultOptions",i=>fl(Kl,this,aIe).call(this,i)),this.addHook("afterSelection",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return fl(Kl,r,lIe).call(r,...s)}),this.addHook("afterSelectionEnd",()=>fl(Kl,this,cIe).call(this)),this.eventManager.addEventListener(this.hot.rootDocument,"copy",function(){return r.onCopy(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"cut",function(){return r.onCut(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"paste",function(){return r.onPaste(...arguments)}),MT()&&(this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseenter",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return fl(Kl,r,uIe).call(r,...s)}),this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseleave",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return fl(Kl,r,dIe).call(r,...s)}),this.addHook("afterSelection",()=>fl(Kl,this,hIe).call(this))),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin()}copy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"cells-only";eh(nC,this,e),eh(pP,this,!0),fl(Kl,this,mee).call(this,"copy")}copyCellsOnly(){this.copy("cells-only")}copyColumnHeadersOnly(){this.copy("column-headers-only")}copyWithAllColumnHeaders(){this.copy("with-column-group-headers")}copyWithColumnHeaders(){this.copy("with-column-headers")}cut(){eh(gP,this,!0),fl(Kl,this,mee).call(this,"cut")}getRangedCopyableData(e){return _j(this.getRangedData(e))}getRangedData(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=[],{rows:i,columns:s}=cee(e);return Te(i,a=>{const u=[];Te(s,h=>{if(a<0)u.push(this.hot.getColHeader(h,a));else{let m=n?this.hot.getCopyableSourceData(a,h):this.hot.getCopyableData(a,h);n&&(nn(m)||Array.isArray(m))&&(m=JSON.stringify(m)),u.push(m)}}),r.push(u)}),r}paste(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;if(!e&&!n)return;const r=new qOe;e&&r.clipboardData.setData("text/plain",e),n&&r.clipboardData.setData("text/html",n),this.onPaste(r)}setCopyableText(){const e=this.hot.getSelectedRangeActive();if(!e)return;if(e.isSingleHeader()){this.copyableRanges=[];return}Ac(rC,this).setSelectedRange(e);const n=new Map([["headers",null],["cells",null]]);Ac(nC,this)==="column-headers-only"?n.set("headers",Ac(rC,this).getMostBottomColumnHeadersRange()):(Ac(nC,this)==="with-column-headers"?n.set("headers",Ac(rC,this).getMostBottomColumnHeadersRange()):Ac(nC,this)==="with-column-group-headers"&&n.set("headers",Ac(rC,this).getAllColumnHeadersRange()),n.set("cells",Ac(rC,this).getCellsRange())),this.copyableRanges=Array.from(n.values()).filter(i=>i!==null).map(i=>{let{startRow:s,startCol:a,endRow:u,endCol:h}=i;return{startRow:s,startCol:a,endRow:u,endCol:h}}),this.copyableRanges=this.hot.runHooks("modifyCopyableRange",this.copyableRanges);const r=n.get("cells");if(r!==null&&r.isRangeTrimmed){const{startRow:i,startCol:s,endRow:a,endCol:u}=r;this.hot.runHooks("afterCopyLimit",a-i+1,u-s+1,this.rowsLimit,this.columnsLimit)}}isEditorOpened(){var e;return(e=this.hot.getActiveEditor())===null||e===void 0?void 0:e.isOpened()}populateValues(e){let{plainData:n,originalPlainData:r,sourceData:i}=e;if(!n.length)return[null,null,null,null];const s=this.hot.getSelectedRangeActive(),a=n.length,u=n[0].length,h=[],{row:m,col:g}=s.getTopStartCorner(),{row:y,col:x}=s.getBottomEndCorner();let C=m,E=g,M=m,j=g;for(;h.length<a||C<=y;){const{skipRowOnPaste:z,visualRow:H}=this.hot.getCellMeta(C,g);if(C=H+1,z===!0)continue;M=H,E=g;const V=[],F=h.length%a;for(;V.length<u||E<=x;){var L,D;const{skipColumnOnPaste:B,visualCol:te,parsePastedValue:ve}=this.hot.getCellMeta(H,E),ce=V.length%u;if(E=te+1,B===!0)continue;j=te;const _e=i==null||(L=i[F])===null||L===void 0?void 0:L[ce],pe=r==null||(D=r[F])===null||D===void 0?void 0:D[ce];let Le=n[F][ce];ve&&i&&UY(_e)&&Le===pe&&(Le=JSON.parse(_e)),V.push(Le)}h.push(V)}return eh(vP,this,!0),this.hot.populateFromArray(m,g,h,void 0,void 0,"CopyPaste.paste",this.pasteMode),[m,g,M,j]}onCopy(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n==null?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!Ac(pP,this)||this.isEditorOpened()||Cm(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!PT(n,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),eh(pP,this,!1);const s=this.getRangedData(this.copyableRanges),a=this.getRangedData(this.copyableRanges,!0),u=fl(Kl,this,sIe).call(this,this.copyableRanges);!!this.hot.runHooks("beforeCopy",s,this.copyableRanges,u)&&(fl(Kl,this,gee).call(this,e,s,a),this.hot.runHooks("afterCopy",s,this.copyableRanges,u)),eh(nC,this,"cells-only")}onCut(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n==null?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!Ac(gP,this)||this.isEditorOpened()||Cm(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!PT(n,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),eh(gP,this,!1);const s=this.getRangedData(this.copyableRanges),a=this.getRangedData(this.copyableRanges,!0);!!this.hot.runHooks("beforeCut",s,this.copyableRanges)&&(fl(Kl,this,gee).call(this,e,s,a),this.hot.emptySelectedCells("CopyPaste.cut"),this.hot.runHooks("afterCut",s,this.copyableRanges))}onPaste(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n==null?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()||this.isEditorOpened()||!this.hot.getSelected()||Cm(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!PT(n,this.hot.rootElement)))return;e.preventDefault();let s,a;if(e&&typeof e.clipboardData<"u"){const x=e.clipboardData.getData(dee);x&&(a=DG(x,this.hot.rootDocument).data);const C=e.clipboardData.getData("text/html"),{sanitizer:E}=this.hot.getSettings();let M=C;typeof E=="function"?M=E(C,"CopyPaste.paste"):(fee.has(this.hot)||(fee.add(this.hot),xg("The HTML sanitization using DOMPurify library is deprecated and will be removed in the next major release. Use the `sanitizer` option instead.\n\nMigration guide: https://handsontable.com/docs/migration-from-16.2-to-17.0/\n`sanitizer` documentation: https://handsontable.com/docs/api/options/#sanitizer")),M=_T(C,{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0})),M&&/(<table)|(<TABLE)/g.test(M)?s=DG(M,this.hot.rootDocument).data:s=e.clipboardData.getData("text/plain")}else typeof ClipboardEvent>"u"&&typeof this.hot.rootWindow.clipboardData<"u"&&(s=this.hot.rootWindow.clipboardData.getData("Text"));if(typeof s=="string"&&(s=exe(s)),s===void 0||s&&s.length===0)return;const u=ea(s);if(this.hot.runHooks("beforePaste",s,this.copyableRanges)===!1)return;const[h,m,g,y]=this.populateValues({plainData:s,sourceData:a,originalPlainData:u});h!==null&&m!==null&&this.hot.selectCell(h,m,Math.min(this.hot.countRows()-1,g),Math.min(this.hot.countCols()-1,y)),this.hot.runHooks("afterPaste",s,this.copyableRanges)}destroy(){super.destroy()}}function mee(t){if(MT()){const e=this.hot.getSelectedRangeActive();if(e){const{row:n,col:r}=e.highlight,i=this.hot.getCell(n,r,!0);i&&Ype(i,()=>{this.hot.rootDocument.execCommand(t)})}}else this.hot.rootDocument.execCommand(t)}function sIe(t){const{rows:e}=cee(t);let n=0;for(let r=0;r<e.length&&!(e[r]>=0);r++)n+=1;return{columnHeadersCount:n}}function oIe(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeActive();if(t){const{row:e,col:n}=t.highlight,r=this.hot.getCell(e,n,!0);r&&yG(r)}}}function pee(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeActive();if(t){const{row:e,col:n}=t.highlight,r=this.hot.getCell(e,n,!0);r!=null&&r.hasAttribute("contenteditable")&&xG(r)}}}function gee(t,e,n){const r=_j(e);if(t&&t.clipboardData){const i=IG(e),s=IG(n);t.clipboardData.setData("text/plain",r),t.clipboardData.setData("text/html",[hee,i].join("")),t.clipboardData.setData(dee,[hee,s].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",r)}function aIe(t){t.items.push({name:"---------"},BOe(this)),Ac(Lz,this)&&t.items.push(YOe(this)),Ac($z,this)&&t.items.push(UOe(this)),Ac(Fz,this)&&t.items.push(WOe(this)),t.items.push(GOe(this))}function lIe(t,e,n,r,i){Ac(vP,this)&&(i.value=!0),eh(vP,this,!1)}function cIe(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function uIe(){fl(Kl,this,pee).call(this)}function dIe(){fl(Kl,this,oIe).call(this)}function hIe(){fl(Kl,this,pee).call(this)}function vee(t,e){return`border_row${t}col${e}`}function H_(){return{width:1,color:"#000"}}function Km(){return{hide:!0}}function fIe(){return{width:1,color:"#000",cornerVisible:!1}}function zz(t){if(Lt(t.start)||Lt(t.left)){var e;t.start=(e=t.start)!==null&&e!==void 0?e:t.left}if(Lt(t.end)||Lt(t.right)){var n;t.end=(n=t.end)!==null&&n!==void 0?n:t.right}return delete t.left,delete t.right,t}function L_(t){return Lt(t.start)&&(t.left=t.start),Lt(t.end)&&(t.right=t.end),t}function Vz(t,e){return{id:vee(t,e),border:fIe(),row:t,col:e,top:Km(),bottom:Km(),start:Km(),end:Km()}}function mIe(t,e){return Ps(e,"border")&&e.border&&(t.border=e.border),Ps(e,"top")&&Lt(e.top)&&(e.top?(nn(e.top)||(e.top=H_()),t.top=e.top):(e.top=Km(),t.top=e.top)),Ps(e,"bottom")&&Lt(e.bottom)&&(e.bottom?(nn(e.bottom)||(e.bottom=H_()),t.bottom=e.bottom):(e.bottom=Km(),t.bottom=e.bottom)),Ps(e,"start")&&Lt(e.start)&&(e.start?(nn(e.start)||(e.start=H_()),t.start=e.start):(e.start=Km(),t.start=e.start)),Ps(e,"end")&&Lt(e.end)&&(e.end?(nn(e.end)||(e.end=H_()),t.end=e.end):(e.end=Km(),t.end=e.end)),t}function qm(t,e){let n=!1;return Te(t.getSelectedRange(),r=>{r.forAll((i,s)=>{if(i<0||s<0)return;const a=t.getCellMeta(i,s).borders;if(a)if(e){if(!Ps(a[e],"hide")||a[e].hide===!1)return n=!0,!1}else return n=!0,!1})}),n}function bP(t){return`<span class="selected">✓</span>${t}`}function pIe(t){return t.some(e=>Lt(e.left)||Lt(e.right))}function gIe(t){return t.some(e=>Lt(e.start)||Lt(e.end))}const vIe=new Map([["left","start"],["right","end"]]);function bIe(t){var e;return(e=vIe.get(t))!==null&&e!==void 0?e:t}function yIe(t){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(Y5);return qm(this,"bottom")&&(e=bP(e)),e},callback(e,n){const r=qm(this,"bottom");t.prepareBorder(n,"bottom",r)}}}function xIe(t){const e=t.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let n=this.getTranslatedPhrase(G5);return qm(this,e)&&(n=bP(n)),n},callback(n,r){const i=qm(this,e);t.prepareBorder(r,e,i)}}}function wIe(t){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(K5)},callback(e,n){t.prepareBorder(n,"noBorders")},disabled(){return!qm(this)}}}function CIe(t){const e=t.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let n=this.getTranslatedPhrase(U5);return qm(this,e)&&(n=bP(n)),n},callback(n,r){const i=qm(this,e);t.prepareBorder(r,e,i)}}}function SIe(t){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(W5);return qm(this,"top")&&(e=bP(e)),e},callback(e,n){const r=qm(this,"top");t.prepareBorder(n,"top",r)}}}function RIe(t,e){_Ie(t,e),e.add(t)}function _Ie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function EIe(t,e,n){return(e=NIe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function NIe(t){var e=kIe(t,"string");return typeof e=="symbol"?e:e+""}function kIe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Bz(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const yP="customBorders",TIe=90,bee=["dashed","dotted","solid"];var xP=new WeakSet;class jIe extends Zr{constructor(){super(...arguments),RIe(this,xP),EIe(this,"savedBorders",[])}static get PLUGIN_KEY(){return yP}static get PLUGIN_PRIORITY(){return TIe}isEnabled(){return!!this.hot.getSettings()[yP]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>Bz(xP,this,PIe).call(this,e)),this.addHook("init",()=>Bz(xP,this,AIe).call(this)),super.enablePlugin())}disablePlugin(){this.hideBorders(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.changeBorderSettings(),super.updatePlugin()}setBorders(e,n){let r=["top","bottom","start","end"],i=null;n&&(this.checkSettingsCohesion([n]),r=Object.keys(n),i=zz(n));const s=lw(e),a=HR(s,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});Te(e,u=>{a(u).forAll((h,m)=>{Te(r,g=>{this.prepareBorderFromCustomAdded(h,m,i,bIe(g))})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const n=lw(e),r=HR(n,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),i=[];return Te(e,s=>{r(s).forAll((a,u)=>{Te(this.savedBorders,h=>{h.row===a&&h.col===u&&i.push(L_(h))})})}),i}clearBorders(e){e?this.setBorders(e):(Te(this.savedBorders,n=>{this.clearBordersFromSelectionSettings(n.id),this.clearNullCellRange(),this.hot.removeCellMeta(n.row,n.col,"borders")}),this.savedBorders.length=0)}insertBorderIntoSettings(e,n){this.checkSavedBorders(e)||this.savedBorders.push(e);const i=this.hot._createCellRange(this.hot._createCellCoords(e.row,e.col));this.checkCustomSelections(e,i,n)||this.hot.selection.highlight.addCustomSelection({border:e,visualCellRange:i})}prepareBorderFromCustomAdded(e,n,r,i){const s=this.hot.countRows(),a=this.hot.countCols();if(e>=s||n>=a)return;let u=Vz(e,n);r&&(u=mIe(u,r),Te(this.hot.selection.highlight.customSelections,h=>{if(u.id===h.settings.id)return Object.assign(h.settings,r),u.id=h.settings.id,u.top=h.settings.top,u.bottom=h.settings.bottom,u.start=h.settings.start,u.end=h.settings.end,!1})),this.hot.setCellMeta(e,n,"borders",L_(u)),this.insertBorderIntoSettings(u,i)}prepareBorderFromCustomAddedRange(e,n){const r=Math.min(e.to.row,this.hot.countRows()-1),i=Math.min(e.to.col,this.hot.countCols()-1);En(e.from.row,r,s=>{En(e.from.col,i,a=>{const u=Vz(s,a);let h=0;s===e.from.row&&Ps(n,"top")&&(h+=1,u.top=n.top),s===e.to.row&&Ps(n,"bottom")&&(h+=1,u.bottom=n.bottom),a===e.from.col&&Ps(n,"start")&&(h+=1,u.start=n.start),a===e.to.col&&Ps(n,"end")&&(h+=1,u.end=n.end),h>0&&(this.hot.setCellMeta(s,a,"borders",L_(u)),this.insertBorderIntoSettings(u))})})}removeAllBorders(e,n){const r=vee(e,n);this.spliceBorder(r),this.clearBordersFromSelectionSettings(r),this.clearNullCellRange(),this.hot.removeCellMeta(e,n,"borders")}setBorder(e,n,r,i){let s=this.hot.getCellMeta(e,n).borders;!s||s.border===void 0?s=Vz(e,n):s=zz(s),i?(s[r]=Km(),this.countHide(s)===4?this.removeAllBorders(e,n):(this.checkCustomSelectionsFromContextMenu(s,r,i)||this.insertBorderIntoSettings(s),this.hot.setCellMeta(e,n,"borders",L_(s)))):(s[r]=H_(),this.checkCustomSelectionsFromContextMenu(s,r,i)||this.insertBorderIntoSettings(s),this.hot.setCellMeta(e,n,"borders",L_(s)))}prepareBorder(e,n,r){Te(e,i=>{let{start:s,end:a}=i;if(s.row===a.row&&s.col===a.col)n==="noBorders"?this.removeAllBorders(s.row,s.col):this.setBorder(s.row,s.col,n,r);else switch(n){case"noBorders":En(s.col,a.col,u=>{En(s.row,a.row,h=>{this.removeAllBorders(h,u)})});break;case"top":En(s.col,a.col,u=>{this.setBorder(s.row,u,n,r)});break;case"bottom":En(s.col,a.col,u=>{this.setBorder(a.row,u,n,r)});break;case"start":En(s.row,a.row,u=>{this.setBorder(u,s.col,n,r)});break;case"end":En(s.row,a.row,u=>{this.setBorder(u,a.col,n,r)});break}})}createCustomBorders(e){Te(e,n=>{const r=zz(n);n.range?this.prepareBorderFromCustomAddedRange(n.range,r):this.prepareBorderFromCustomAdded(n.row,n.col,r)})}countHide(e){const{top:n,bottom:r,start:i,end:s}=e;return xc([n,r,i,s],(u,h)=>{let m=u;return h&&h.hide&&(m+=1),m},0)}clearBordersFromSelectionSettings(e){const n=di(this.hot.selection.highlight.customSelections,r=>r.settings.id).indexOf(e);n>-1&&this.hot.selection.highlight.customSelections[n].clear()}clearNullCellRange(){Te(this.hot.selection.highlight.customSelections,(e,n)=>{if(e.cellRange===null)return this.hot.selection.highlight.customSelections[n].destroy(),this.hot.selection.highlight.customSelections.splice(n,1),!1})}hideBorders(){Te(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()})}spliceBorder(e){const n=di(this.savedBorders,r=>r.id).indexOf(e);n>-1&&this.savedBorders.splice(n,1)}checkSavedBorders(e){let n=!1;return this.countHide(e)===4?(this.spliceBorder(e.id),n=!0):Te(this.savedBorders,(i,s)=>{if(e.id===i.id)return this.savedBorders[s]=e,n=!0,!1}),n}checkCustomSelectionsFromContextMenu(e,n,r){let i=!1;return Te(this.hot.selection.highlight.customSelections,s=>{if(e.id===s.settings.id){const a=this.hot.view._wt.selectionManager.getBorderInstances(s);return Te(a,u=>{u.toggleHiddenClass(n,r)}),i=!0,!1}}),i}checkCustomSelections(e,n,r){const i=this.countHide(e);let s=!1;return i===4?(this.removeAllBorders(e.row,e.col),s=!0):Te(this.hot.selection.highlight.customSelections,a=>{if(e.id===a.settings.id){if(a.visualCellRange=n,a.commit(),r){const u=this.hot.view._wt.selectionManager.getBorderInstances(a);Te(u,h=>{h.changeBorderStyle(r,e)})}return s=!0,!1}}),s}changeBorderSettings(){const e=this.hot.getSettings()[yP];if(Array.isArray(e)){const n=ea(e);this.checkSettingsCohesion(n),n.length||(this.savedBorders=n),this.createCustomBorders(n)}else e!==void 0&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const n=pIe(e),r=gIe(e);n&&r&>('The "left"/"right" and "start"/"end" options should not be used together. Please use only the option "start"/"end".'),this.hot.isRtl()&&n&>('The "left"/"right" properties are not supported for RTL. Please use option "start"/"end".'),Bz(xP,this,MIe).call(this,e)}destroy(){super.destroy()}}function MIe(t){t.forEach(e=>{Object.keys(e).forEach(n=>{const r=e[n].style;Lt(r)&&!bee.includes(r)?(Yn(`The "${r}" border style is not supported. Please use one of the following styles: ${bee.join(", ")}. The border style will be ignored.`),delete e[n].style):Lt(r)&&r==="solid"&&delete e[n].style})})}function PIe(t){this.hot.getSettings()[yP]&&t.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(B5)},disabled(){const e=this.getSelectedRangeActive();return!e||e.isSingleHeader()?!0:this.selection.isSelectedByCorner()},submenu:{items:[SIe(this),CIe(this),yIe(this),xIe(this),wIe(this)]}})}function AIe(){this.changeBorderSettings()}function OIe(t,e){IIe(t,e),e.add(t)}function IIe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wz(t,e,n){return(e=DIe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function DIe(t){var e=HIe(t,"string");return typeof e=="symbol"?e:e+""}function HIe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yee(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const xee="dragToScroll",LIe=100;var Uz=new WeakSet;class $Ie extends Zr{constructor(){super(...arguments),OIe(this,Uz),Wz(this,"boundaries",null),Wz(this,"callback",null),Wz(this,"listening",!1)}static get PLUGIN_KEY(){return xee}static get PLUGIN_PRIORITY(){return LIe}isEnabled(){return!!this.hot.getSettings()[xee]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>yee(Uz,this,wee).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>yee(Uz,this,wee).call(this,e)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.unregisterEvents(),super.disablePlugin()}setBoundaries(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{left:0,right:this.hot.rootWindow.innerWidth,top:0,bottom:this.hot.rootWindow.innerHeight};this.boundaries=e}setCallback(e){this.callback=e}check(e,n){let r=0,i=0;n<this.boundaries.top?i=n-this.boundaries.top:n>this.boundaries.bottom&&(i=n-this.boundaries.bottom),e<this.boundaries.left?r=e-this.boundaries.left:e>this.boundaries.right&&(r=e-this.boundaries.right),this.callback(r,i)}listen(){this.listening=!0}unlisten(){this.listening=!1}isListening(){return this.listening}registerEvents(){const{rootWindow:e}=this.hot;let n=e;for(;n;)this.eventManager.addEventListener(n.document,"contextmenu",()=>this.unlisten()),this.eventManager.addEventListener(n.document,"mouseup",()=>this.unlisten()),this.eventManager.addEventListener(n.document,"mousemove",r=>this.onMouseMove(r)),n=wg(n)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function wee(t){if(O0(t))return;const e=this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;this.setBoundaries(e!==this.hot.rootWindow?e.getBoundingClientRect():void 0),this.setCallback((n,r)=>{var i,s;const a=(i=e.scrollLeft)!==null&&i!==void 0?i:e.scrollX,u=(s=e.scrollTop)!==null&&s!==void 0?s:e.scrollY;e.scroll(a+Math.sign(n)*50,u+Math.sign(r)*20)}),this.listen()}function FIe(t,e){Cee(t,e),e.add(t)}function zIe(t,e,n){Cee(t,e),e.set(t,n)}function Cee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yz(t,e,n){return(e=VIe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function VIe(t){var e=BIe(t,"string");return typeof e=="symbol"?e:e+""}function BIe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function WIe(t,e){return t.get(ud(t,e))}function See(t,e,n){return t.set(ud(t,e),n),n}function ud(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}un.getSingleton().register("afterDropdownMenuDefaultOptions"),un.getSingleton().register("beforeDropdownMenuShow"),un.getSingleton().register("afterDropdownMenuShow"),un.getSingleton().register("afterDropdownMenuHide"),un.getSingleton().register("afterDropdownMenuExecute");const wP="dropdownMenu",UIe=230,$_="changeType",Gz=wP;var CP=new WeakMap,th=new WeakSet;class SP extends Zr{static get PLUGIN_KEY(){return wP}static get PLUGIN_PRIORITY(){return UIe}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[C_,S_,Xn,__,Xn,QM,Xn,R_,Xn,cd]}constructor(e){super(e),FIe(this,th),Yz(this,"commandExecutor",new QJ(this.hot)),Yz(this,"itemsFactory",null),Yz(this,"menu",null),zIe(this,CP,!1),this.hot.addHook("afterGetColHeader",(n,r)=>ud(th,this,GIe).call(this,n,r))}isEnabled(){return this.hot.getSettings()[wP]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new ZJ(this.hot,SP.DEFAULT_ITEMS),this.addHook("beforeOnCellMouseDown",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return ud(th,e,JIe).call(e,...s)}),this.addHook("beforeViewportScrollHorizontally",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return ud(th,e,ZIe).call(e,...s)}),this.addHook("beforeDialogShow",()=>this.close());const n=this.hot.getSettings()[wP],r={items:this.itemsFactory.getItems(n)};this.registerEvents(),typeof n.callback=="function"&&this.commandExecutor.setCommonCallback(n.callback),this.registerShortcuts(),super.enablePlugin(),this.callOnPluginsReady(()=>{this.hot.runHooks("afterDropdownMenuDefaultOptions",r),this.itemsFactory.setPredefinedItems(r.items);const i=this.itemsFactory.getItems(n);this.menu&&this.menu.destroy(),this.menu=new Zw(this.hot,{className:"htDropdownMenu",keepInViewport:!0,container:n.uiContainer||this.hot.rootPortalElement}),this.hot.runHooks("beforeDropdownMenuSetItems",i),this.menu.setMenuItems(i),this.menu.addLocalHook("beforeOpen",()=>ud(th,this,KIe).call(this)),this.menu.addLocalHook("afterOpen",()=>ud(th,this,qIe).call(this)),this.menu.addLocalHook("afterSubmenuOpen",s=>ud(th,this,XIe).call(this,s)),this.menu.addLocalHook("afterClose",()=>ud(th,this,QIe).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];return e.executeCommand.call(e,...a)}),Te(i,s=>this.commandExecutor.registerCommand(s.key,s))})}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&this.menu.destroy(),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager().getContext("grid"),n=()=>{const{highlight:r}=this.hot.getSelectedRangeActive();if((r.isHeader()&&r.row===-1||r.isCell())&&r.col>=0){this.hot.selectColumns(r.col,r.col,-1);const{from:i}=this.hot.getSelectedRangeActive(),s=XM(this.menu.container,this.hot.rootDocument),a=this.hot.getCell(-1,i.col,!0).querySelector(`.${$_}`),u=a.getBoundingClientRect();this.open({left:u.left+s.left,top:u.top+a.offsetHeight+s.top},{left:u.width,right:0,above:0,below:3}),this.menu.getNavigator().toFirstItem()}};e.addShortcuts([{keys:[["Shift","Alt","ArrowDown"],["Control/Meta","Enter"]],callback:n,runOnlyIf:()=>{var r;const i=(r=this.hot.getSelectedRangeActive())===null||r===void 0?void 0:r.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isHeader()&&!this.menu.isOpened()},captureCtrl:!0,group:Gz},{keys:[["Shift","Alt","ArrowDown"]],callback:n,runOnlyIf:()=>{var r;const i=(r=this.hot.getSelectedRangeActive())===null||r===void 0?void 0:r.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isCell()&&!this.menu.isOpened()},group:Gz}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Gz)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>ud(th,this,YIe).call(this,e))}open(e){var n;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};(n=this.menu)!==null&&n!==void 0&&n.isOpened()||(this.menu.open(),Mr(r,(i,s)=>{this.menu.setOffset(s,i)}),this.menu.setPosition(e))}close(){var e;(e=this.menu)===null||e===void 0||e.close()}executeCommand(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.commandExecutor.execute(e,...r)}setListening(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.menu.isOpened()&&(e?this.menu.hotMenu.listen():this.menu.hotMenu.unlisten())}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function Ree(t){t.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function YIe(t){if(Dn(t.target,$_)){const e=XM(this.menu.container,this.hot.rootDocument),n=t.target.getBoundingClientRect();t.stopPropagation(),See(CP,this,!1),this.open({left:n.left+e.left,top:n.top+t.target.offsetHeight+e.top},{left:n.width,right:0,above:0,below:3})}}function GIe(t,e){const n=e.parentNode;if(!n)return;const r=n.parentNode.childNodes,i=Array.prototype.indexOf.call(r,n);if(t<0||i!==r.length-1)return;const s=e.querySelector(`.${$_}`);if(this.enabled&&s)return;if(!this.enabled){s&&s.parentNode.removeChild(s);return}const a=this.hot.rootDocument.createElement("button");a.className=$_,a.type="button",a.tabIndex=-1,this.hot.getSettings().ariaTags&&(gn(a,[ym(),wc(" ")]),gn(e,[XY("menu")])),a.onclick=function(){return!1},e.firstChild.insertBefore(a,e.firstChild.firstChild)}function KIe(){this.hot.runHooks("beforeDropdownMenuShow",this)}function qIe(){this.hot.runHooks("afterDropdownMenuShow",this),ud(th,this,Ree).call(this,this.menu)}function XIe(t){ud(th,this,Ree).call(this,t)}function QIe(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function ZIe(t){return WIe(CP,this)?null:t}function JIe(t){Dn(t.target,$_)&&See(CP,this,!0)}SP.SEPARATOR={name:Xn};function _ee(t,e,n){return(e=eDe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eDe(t){var e=tDe(t,"string");return typeof e=="symbol"?e:e+""}function tDe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class nDe{constructor(e){_ee(this,"hot",void 0),_ee(this,"options",{}),this.hot=e}setOptions(e){this.options=e}getData(){const{startRow:e,startCol:n,endRow:r,endCol:i}=this._getDataRange(),s=this.options,a=[];return En(e,r,u=>{const h=[];!s.exportHiddenRows&&this._isHiddenRow(u)||(En(n,i,m=>{!s.exportHiddenColumns&&this._isHiddenColumn(m)||h.push(this.hot.getDataAtCell(u,m))}),a.push(h))}),a}getRowHeaders(){const e=[];if(this.options.rowHeaders){const{startRow:n,endRow:r}=this._getDataRange(),i=this.hot.getRowHeader();En(n,r,s=>{!this.options.exportHiddenRows&&this._isHiddenRow(s)||e.push(i[s])})}return e}getColumnHeaders(){const e=[];if(this.options.columnHeaders){const{startCol:n,endCol:r}=this._getDataRange(),i=this.hot.getColHeader();En(n,r,s=>{!this.options.exportHiddenColumns&&this._isHiddenColumn(s)||e.push(i[s])})}return e}_getDataRange(){const e=this.hot.countCols()-1,n=this.hot.countRows()-1;let[r=0,i=0,s=n,a=e]=this.options.range;return r=Math.max(r,0),i=Math.max(i,0),s=Math.min(s,n),a=Math.min(a,e),{startRow:r,startCol:i,endRow:s,endCol:a}}_isHiddenRow(e){return this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(e))}_isHiddenColumn(e){return this.hot.columnIndexMapper.isHidden(this.hot.toPhysicalColumn(e))}}function Eee(t,e,n){return(e=rDe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rDe(t){var e=iDe(t,"string");return typeof e=="symbol"?e:e+""}function iDe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Kz{static get DEFAULT_OPTIONS(){return{mimeType:"text/plain",fileExtension:"txt",filename:"Handsontable [YYYY]-[MM]-[DD]",encoding:"utf-8",bom:!1,columnHeaders:!1,rowHeaders:!1,exportHiddenColumns:!1,exportHiddenRows:!1,range:[]}}constructor(e,n){Eee(this,"dataProvider",void 0),Eee(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(n),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let n=zh(this.constructor.DEFAULT_OPTIONS);const r=new Date;return n=jo(zh(Kz.DEFAULT_OPTIONS),n),n=jo(n,e),n.filename=RT(n.filename,{YYYY:r.getFullYear(),MM:`${r.getMonth()+1}`.padStart(2,"0"),DD:`${r.getDate()}`.padStart(2,"0")}),n}}function sDe(t,e){oDe(t,e),e.add(t)}function oDe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Nee(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const kee="\r",aDe='"',lDe=` `,cDe="=",uDe="+",dDe="-",hDe="@",fDe=" ";var qz=new WeakSet;class mDe extends Kz{constructor(){super(...arguments),sDe(this,qz)}static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:`\r `,sanitizeValues:!1}}export(){const e=this.options,n=this.dataProvider.getData();let r=this.dataProvider.getColumnHeaders();const i=r.length>0,s=this.dataProvider.getRowHeaders(),a=s.length>0;let u=e.bom?"\uFEFF":"";return i&&(r=di(r,h=>this._escapeCell(h,{force:!0,sanitizeValue:e.sanitizeValues})),a&&(u+=e.columnDelimiter),u+=r.join(e.columnDelimiter),u+=e.rowDelimiter),Te(n,(h,m)=>{m>0&&(u+=e.rowDelimiter),a&&(u+=this._escapeCell(s[m],{sanitizeValue:e.sanitizeValues}),u+=e.columnDelimiter);const g=h.map(y=>this._escapeCell(y,{sanitizeValue:e.sanitizeValues})).join(e.columnDelimiter);u+=g}),u}_escapeCell(e){let{force:n=!1,sanitizeValue:r=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=Hi(e);return i===""||(r&&(n=!0),r instanceof RegExp?i=Nee(qz,this,gDe).call(this,i,r):typeof r=="function"?i=r(i):r&&(i=Nee(qz,this,pDe).call(this,i)),(n||i.indexOf(kee)>=0||i.indexOf(aDe)>=0||i.indexOf(lDe)>=0||i.indexOf(this.options.columnDelimiter)>=0)&&(i=i.replace(new RegExp('"',"g"),'""'),i=`"${i}"`)),i}}function pDe(t){return t.startsWith(cDe)||t.startsWith(uDe)||t.startsWith(dDe)||t.startsWith(hDe)||t.startsWith(fDe)||t.startsWith(kee)?`'${t}`:t}function gDe(t,e){return e.test(t)?`'${t}`:t}const Xz={["csv"]:mDe};function vDe(t,e,n){return typeof Xz[t]=="function"?new Xz[t](e,n):null}const bDe="exportFile",yDe=240;class xDe extends Zr{static get PLUGIN_KEY(){return bDe}static get PLUGIN_PRIORITY(){return yDe}isEnabled(){return!0}exportAsString(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createTypeFormatter(e,n).export()}exportAsBlob(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createBlob(this._createTypeFormatter(e,n))}downloadFile(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{rootDocument:r,rootWindow:i}=this.hot,s=this._createTypeFormatter(e,n),a=this._createBlob(s),u=i.URL||i.webkitURL,h=r.createElement("a"),m=`${s.options.filename}.${s.options.fileExtension}`;if(h.download!==void 0){const g=u.createObjectURL(a);h.style.display="none",h.setAttribute("href",g),h.setAttribute("download",m),r.body.appendChild(h),h.dispatchEvent(new MouseEvent("click")),r.body.removeChild(h),setTimeout(()=>{u.revokeObjectURL(g)},100)}else navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob(a,m)}_createTypeFormatter(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Xz[e]||gt(`Export format type "${e}" is not supported.`),vDe(e,new nDe(this.hot),n)}_createBlob(e){let n=null;return typeof Blob<"u"&&(n=new Blob([e.export()],{type:`${e.options.mimeType};charset=${e.options.encoding}`})),n}}function iC(t,e,n){return(e=wDe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wDe(t){var e=CDe(t,"string");return typeof e=="symbol"?e:e+""}function CDe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class F_{constructor(e,n){let{id:r,stateless:i=!0}=n;iC(this,"hot",void 0),iC(this,"id",void 0),iC(this,"elements",[]),iC(this,"hidden",!1),iC(this,"stateId",""),iC(this,"state",void 0),this.hot=e,this.id=r,this.stateId=`Filters.component.${this.id}`,this.state=i?null:this.hot.columnIndexMapper.registerMap(this.stateId,new nj)}getElements(){return this.elements}reset(){Te(this.elements,e=>e.reset())}hide(){this.hidden=!0}show(){this.hidden=!1}isHidden(){return this.hot===null||this.hidden}restoreState(e){this.state&&this.setState(this.state.getValueAtIndex(e))}setState(){gt("The state setting logic is not implemented")}saveState(e){this.state&&this.state.setValueAtIndex(e,this.getState())}getState(){gt("The state gathering logic is not implemented")}destroy(){this.hot.columnIndexMapper.unregisterMap(this.stateId),this.clearLocalHooks(),Te(this.elements,e=>e.destroy()),this.state=null,this.elements=null,this.hot=null}}ci(F_,vo);const z_={};function dd(t,e){z_[t]||gt(`Filter condition "${t}" does not exist.`);const{condition:n,descriptor:r}=z_[t];let i=e;return r.inputValuesDecorator&&(i=r.inputValuesDecorator(i)),function(s){return n.apply(s.meta.instance,[].concat([s],[i]))}}function Nb(t){return z_[t]||gt(`Filter condition "${t}" does not exist.`),z_[t].descriptor}function Ni(t,e,n){n.key=t,z_[t]={condition:e,descriptor:n}}const Do="none";function SDe(){return!0}Ni(Do,SDe,{name:uj,inputsCount:0,showOperators:!1});const kb="empty";function RDe(t){return Yr(t.value)}Ni(kb,RDe,{name:t4,inputsCount:0,showOperators:!0});const sC="not_empty";function _De(t,e){return!dd(kb,e)(t)}Ni(sC,_De,{name:n4,inputsCount:0,showOperators:!0});const Tb="eq";function EDe(t,e){let[n]=e;return Hi(t.value).toLocaleLowerCase(t.meta.locale)===Hi(n)}Ni(Tb,EDe,{name:r4,inputsCount:1,showOperators:!0});const oC="neq";function NDe(t,e){return!dd(Tb,e)(t)}Ni(oC,NDe,{name:i4,inputsCount:1,showOperators:!0});const Tee="gt";function kDe(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>r}Ni(Tee,kDe,{name:c4,inputsCount:1,showOperators:!0});const jee="gte";function TDe(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>=r}Ni(jee,TDe,{name:u4,inputsCount:1,showOperators:!0});const Mee="lt";function jDe(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<r}Ni(Mee,jDe,{name:d4,inputsCount:1,showOperators:!0});const Pee="lte";function MDe(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<=r}Ni(Pee,MDe,{name:h4,inputsCount:1,showOperators:!0});const Qz="date_after";function PDe(t,e){let[n]=e;const r=Tt(t.value,t.meta.dateFormat),i=Tt(n,t.meta.dateFormat);return!r.isValid()||!i.isValid()?!1:r.diff(i)>=0}Ni(Qz,PDe,{name:IR,inputsCount:1,showOperators:!0});const Zz="date_before";function ADe(t,e){let[n]=e;const r=Tt(t.value,t.meta.dateFormat),i=Tt(n,t.meta.dateFormat);return!r.isValid()||!i.isValid()?!1:r.diff(i)<=0}Ni(Zz,ADe,{name:DR,inputsCount:1,showOperators:!0});const RP="between";function ODe(t,e){let[n,r]=e,i=n,s=r;if(t.meta.type==="numeric"){const a=parseFloat(i,10),u=parseFloat(s,10);i=Math.min(a,u),s=Math.max(a,u)}else if(t.meta.type==="date"){const a=dd(Zz,[s]),u=dd(Qz,[i]);return a(t)&&u(t)}return t.value>=i&&t.value<=s}Ni(RP,ODe,{name:OR,inputsCount:2,showOperators:!0});const Aee="not_between";function IDe(t,e){return!dd(RP,e)(t)}Ni(Aee,IDe,{name:f4,inputsCount:2,showOperators:!0});const Jz="begins_with";function DDe(t,e){let[n]=e;return Hi(t.value).toLocaleLowerCase(t.meta.locale).startsWith(Hi(n))}Ni(Jz,DDe,{name:s4,inputsCount:1,showOperators:!0});const eV="ends_with";function HDe(t,e){let[n]=e;return Hi(t.value).toLocaleLowerCase(t.meta.locale).endsWith(Hi(n))}Ni(eV,HDe,{name:o4,inputsCount:1,showOperators:!0});const _P="contains";function LDe(t,e){let[n]=e;return Hi(t.value).toLocaleLowerCase(t.meta.locale).indexOf(Hi(n))>=0}Ni(_P,LDe,{name:a4,inputsCount:1,showOperators:!0});const tV="not_contains";function $De(t,e){return!dd(_P,e)(t)}Ni(tV,$De,{name:l4,inputsCount:1,showOperators:!0});const Oee="date_tomorrow";function FDe(t){const e=Tt(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(Tt().subtract(-1,"days").startOf("day"),"d"):!1}Ni(Oee,FDe,{name:hj,inputsCount:0});const Iee="date_today";function zDe(t){const e=Tt(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(Tt().startOf("day"),"d"):!1}Ni(Iee,zDe,{name:dj,inputsCount:0});const Dee="date_yesterday";function VDe(t){const e=Tt(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(Tt().subtract(1,"days").startOf("day"),"d"):!1}Ni(Dee,VDe,{name:fj,inputsCount:0});const nV="intl_date_before";function BDe(t,e){let[n]=e;const r=rf(t.value),i=rf(n);return r===null||i===null?!1:r<=i}Ni(nV,BDe,{name:DR,inputsCount:1,showOperators:!0,inputType:"date"});const rV="intl_date_after";function WDe(t,e){let[n]=e;const r=rf(t.value),i=rf(n);return r===null||i===null?!1:r>=i}Ni(rV,WDe,{name:IR,inputsCount:1,showOperators:!0,inputType:"date"});const Hee="intl_date_between";function UDe(t,e){let[n,r]=e;const i=dd(nV,[r]),s=dd(rV,[n]);return i(t)&&s(t)}Ni(Hee,UDe,{name:OR,inputsCount:2,showOperators:!0,inputType:"date"});const Lee="intl_date_tomorrow";function YDe(t){const e=rf(t.value);if(e===null)return!1;const n=new Date;return n.setDate(n.getDate()+1),e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()&&e.getDate()===n.getDate()}Ni(Lee,YDe,{name:hj,inputsCount:0,inputType:"date"});const $ee="intl_date_today";function GDe(t){const e=rf(t.value);if(e===null)return!1;const n=new Date;return e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()&&e.getDate()===n.getDate()}Ni($ee,GDe,{name:dj,inputsCount:0,inputType:"date"});const Fee="intl_date_yesterday";function KDe(t){const e=rf(t.value);if(e===null)return!1;const n=new Date;return n.setDate(n.getDate()-1),e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()&&e.getDate()===n.getDate()}Ni(Fee,KDe,{name:fj,inputsCount:0,inputType:"date"});const iV="intl_time_before";function qDe(t,e){let[n]=e;const r=ab(t.value),i=ab(n);return r===null||i===null?!1:r<=i}Ni(iV,qDe,{name:DR,inputsCount:1,showOperators:!0,inputType:"time"});const sV="intl_time_after";function XDe(t,e){let[n]=e;const r=ab(t.value),i=ab(n);return r===null||i===null?!1:r>=i}Ni(sV,XDe,{name:IR,inputsCount:1,showOperators:!0,inputType:"time"});const zee="intl_time_between";function QDe(t,e){let[n,r]=e;const i=dd(iV,[r]),s=dd(sV,[n]);return i(t)&&s(t)}Ni(zee,QDe,{name:OR,inputsCount:2,showOperators:!0,inputType:"time"}),Epe();function ZDe(t,e){let n=t;return n===""&&(n=`(${e})`),n}function V_(t){const e=new Set(t);return function(n){return e.has(n)}}function oV(t){return t??""}function aV(t){return Array.from(new Set(t)).map(e=>oV(e)).sort((e,n)=>typeof e=="number"&&typeof n=="number"?e-n:e===n?0:e>n?1:-1)}function Vee(t,e,n,r){const i=[],s=t===e;let a;return s||(a=V_(e)),t.forEach(u=>{let h=!1;(s||a(u))&&(h=!0);const m={checked:h,value:u,visualValue:ZDe(u,n)};r&&r(m),i.push(m)}),i}const jb="by_value";function JDe(t,e){let[n]=e;return n(t.value)}Ni(jb,JDe,{name:"By value",inputsCount:0,inputValuesDecorator(t){let[e]=t;return[V_(e)]},showOperators:!1});const B_={};function e2e(t){B_[t]||gt(`Operation with id "${t}" does not exist.`);const e=B_[t].func;return function(n,r){return e(n,r)}}function t2e(t){return B_[t].name}function lV(t,e,n){B_[t]={name:e,func:n}}const Kg="conjunction",n2e=g4;function r2e(t,e){return t.every(n=>n.func(e))}lV(Kg,n2e,r2e);const EP="disjunction",i2e=mj;function s2e(t,e){return t.some(n=>n.func(e))}lV(EP,i2e,s2e);const cV="disjunctionWithExtraCondition",o2e=mj;function a2e(t,e){return t.length<3&>("Operation doesn't work on less then three conditions."),t.slice(0,t.length-1).some(n=>n.func(e))&&t[t.length-1].func(e)}lV(cV,o2e,a2e);const l2e="numeric",Bee="text",c2e="date",u2e="intl-date",d2e="intl-time",Wee={[l2e]:[Do,Xn,kb,sC,Xn,Tb,oC,Xn,Tee,jee,Mee,Pee,RP,Aee],[Bee]:[Do,Xn,kb,sC,Xn,Tb,oC,Xn,Jz,eV,Xn,_P,tV],[c2e]:[Do,Xn,kb,sC,Xn,Tb,oC,Xn,Zz,Qz,RP,Xn,Oee,Iee,Dee],[u2e]:[Do,Xn,kb,sC,Xn,Tb,oC,Xn,nV,rV,Hee,Xn,Lee,$ee,Fee],[d2e]:[Do,Xn,kb,sC,Xn,Tb,oC,Xn,Xn,Jz,eV,Xn,_P,tV,Xn,iV,sV,zee]};function h2e(t){const e=[];let n=t;return Wee[n]||(n=Bee),Te(Wee[n],r=>{let i;r===Xn?i={name:Xn}:i=zh(Nb(r)),e.push(i)}),e}function W_(t,e,n){return(e=f2e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f2e(t){var e=m2e(t,"string");return typeof e=="symbol"?e:e+""}function m2e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const uV="built",dV="building",Uee=["click","input","keydown","keypress","keyup","focus","blur","change"];let nh=class eae{static get DEFAULTS(){return zh({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,n){W_(this,"hot",void 0),W_(this,"eventManager",new Sc(this)),W_(this,"options",void 0),W_(this,"_element",void 0),W_(this,"buildState",void 0),this.hot=e,this.options=jo(eae.DEFAULTS,n),this._element=this.hot.rootDocument.createElement(this.options.wrapIt?"div":this.options.tagName)}setValue(e){this.options.value=e,this.update()}getValue(){return this.options.value}get element(){return this.buildState===dV?this._element:this.buildState===uV?(this.update(),this._element):(this.buildState=dV,this.build(),this.buildState=uV,this._element)}isBuilt(){return this.buildState===uV}translateIfPossible(e){return typeof e=="string"&&e.startsWith(Ul)?this.hot.getTranslatedPhrase(e):e}build(){const e=(n,r)=>{this.eventManager.addEventListener(n,r,i=>this.runLocalHooks(r,i,this))};if(this.buildState||(this.buildState=dV),this._element.setAttribute("data-hot-input",!0),this.options.tabIndex!==void 0&&this._element.setAttribute("tabindex",this.options.tabIndex),this.options.role!==void 0&&this._element.setAttribute("role",this.options.role),this.options.className&&st(this._element,this.options.className),this.options.children.length)Te(this.options.children,n=>this._element.appendChild(n.element));else if(this.options.wrapIt){const n=this.hot.rootDocument.createElement(this.options.tagName);n.setAttribute("data-hot-input",!0),Mr(this.options,(r,i)=>{n[i]!==void 0&&i!=="className"&&i!=="tagName"&&i!=="children"&&(n[i]=this.translateIfPossible(r))}),this._element.appendChild(n),Te(Uee,r=>e(n,r))}else Te(Uee,n=>e(this._element,n))}update(){}reset(){this.options.value="",this.update()}show(){this.element.style.display=""}hide(){this.element.style.display="none"}focus(){}destroy(){this.eventManager.destroy(),this.eventManager=null,this.hot=null,this._element.parentNode&&this._element.parentNode.removeChild(this._element),this._element=null}};ci(nh,vo);function p2e(t,e){Yee(t,e),e.add(t)}function g2e(t,e,n){Yee(t,e),e.set(t,n)}function Yee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function NP(t,e){return t.get(kP(t,e))}function v2e(t,e,n){return t.set(kP(t,e),n),n}function kP(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var aC=new WeakMap,hV=new WeakSet;class qg extends nh{static get DEFAULTS(){return zh({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,n){super(e,jo(qg.DEFAULTS,n)),p2e(this,hV),g2e(this,aC,void 0),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",e=>kP(hV,this,Gee).call(this,e)),this.addLocalHook("input",e=>kP(hV,this,Gee).call(this,e))}build(){super.build();const e=this.hot.rootDocument.createElement("div");v2e(aC,this,this._element.firstChild),st(this._element,"htUIInput"),st(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(NP(aC,this).type=this.options.type,NP(aC,this).placeholder=this.translateIfPossible(this.options.placeholder),NP(aC,this).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&NP(aC,this).focus()}}function Gee(t){this.options.value=t.target.value}function b2e(t,e){Kee(t,e),e.add(t)}function U_(t,e,n){Kee(t,e),e.set(t,n)}function Kee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lC(t,e,n){return t.set(Y_(t,e),n),n}function Ds(t,e){return t.get(Y_(t,e))}function Y_(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ra=new WeakMap,TP=new WeakMap,jP=new WeakMap,fV=new WeakMap,MP=new WeakMap,PP=new WeakSet;class G_ extends nh{static get DEFAULTS(){return zh({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,n){super(e,jo(G_.DEFAULTS,n)),b2e(this,PP),U_(this,ra,null),U_(this,TP,[]),U_(this,jP,void 0),U_(this,fV,void 0),U_(this,MP,void 0),this.registerHooks()}getMenu(){return Ds(ra,this)}registerHooks(){this.addLocalHook("click",()=>Y_(PP,this,w2e).call(this))}setItems(e){lC(TP,this,this.translateNames(e)),Ds(ra,this)&&Ds(ra,this).setMenuItems(Ds(TP,this))}translateNames(e){return Te(e,n=>{n.name=this.translateIfPossible(n.name)}),e}build(){super.build(),lC(ra,this,new Zw(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),Ds(ra,this).setMenuItems(Ds(TP,this));const e=new nh(this.hot,{className:"htUISelectCaption"}),n=new nh(this.hot,{className:"htUISelectDropdown"});lC(jP,this,e),lC(fV,this,e.element),lC(MP,this,n),this.hot.getSettings().ariaTags&&(gn(n.element,[ym()]),gn(this._element,[qY()])),Te([e,n],r=>this._element.appendChild(r.element)),Ds(ra,this).addLocalHook("select",r=>Y_(PP,this,y2e).call(this,r)),Ds(ra,this).addLocalHook("afterClose",()=>Y_(PP,this,x2e).call(this)),this.update()}update(){if(!this.isBuilt())return;let e;this.options.value?e=this.options.value.name:e=Ds(ra,this).hot.getTranslatedPhrase(uj),Ds(fV,this).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();Ds(ra,this)&&(Ds(ra,this).open(),Ds(ra,this).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),Ds(ra,this).getNavigator().toFirstItem(),Ds(ra,this).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:n=>{this.closeOptions(),this.runLocalHooks("tabKeydown",n)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){Ds(ra,this)&&Ds(ra,this).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){Ds(ra,this)&&(Ds(ra,this).destroy(),lC(ra,this,null)),Ds(jP,this)&&Ds(jP,this).destroy(),Ds(MP,this)&&Ds(MP,this).destroy(),super.destroy()}}function y2e(t){t.name!==Xn&&(this.options.value=t,this.update(),this.runLocalHooks("select",this.options.value))}function x2e(){this.runLocalHooks("afterClose")}function w2e(){this.openOptions()}function C2e(t,e){S2e(t,e),e.add(t)}function S2e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qee(t,e,n){return(e=R2e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R2e(t){var e=_2e(t,"string");return typeof e=="symbol"?e:e+""}function _2e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xee(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var mV=new WeakSet;class pV extends F_{constructor(e,n){super(e,{id:n.id,stateless:!1}),C2e(this,mV),qee(this,"name",""),qee(this,"addSeparator",!1),this.name=n.name,this.addSeparator=n.addSeparator,this.elements.push(new G_(this.hot,{menuContainer:n.menuContainer})),this.elements.push(new qg(this.hot,{placeholder:C4})),this.elements.push(new qg(this.hot,{placeholder:S4})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",e=>Xee(mV,this,E2e).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),Te(this.getInputElements(),e=>{e.addLocalHook("keydown",n=>Xee(mV,this,N2e).call(this,n))})}setState(e){if(this.reset(),!e)return;const n=zh(e.command);n.name.startsWith(Os)&&(n.name=this.hot.getTranslatedPhrase(n.name)),this.getSelectElement().setValue(n),Te(e.args,(r,i)=>{if(i>n.inputsCount-1)return!1;const s=this.getInputElement(i);s.setValue(r),s[n.inputsCount>i?"show":"hide"](),i||this.hot._registerTimeout(()=>s.focus(),10)})}getState(){const e=this.getSelectElement().getValue()||Nb(Do),n=[];return Te(this.getInputElements(),(r,i)=>{e.inputsCount>i&&n.push(r.getValue())}),{command:e,args:n}}updateState(e,n){const r=Nb(e?e.name:Do);this.state.setValueAtIndex(n,{command:r,args:e?e.args:[]}),e||Te(this.getInputElements(),i=>i.setValue(null))}getSelectElement(){return this.elements.filter(e=>e instanceof G_)[0]}getInputElement(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.getInputElements()[e]}getInputElements(){return this.elements.filter(e=>e instanceof qg)}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,r,i,s,a)=>{st(n.parentNode,"htFiltersMenuCondition"),this.addSeparator&&st(n.parentNode,"border");const u=this.hot.rootDocument.createElement("div");return st(u,"htFiltersMenuLabel"),u.textContent=a,n.appendChild(u),n.parentElement.hasAttribute("ghost-table")||Te(this.elements,h=>n.appendChild(h.element)),n}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let n=[Nb(Do)];if(e!==null){const{visualIndex:r}=e;n=h2e(this.hot.getDataType(0,r,this.hot.countRows(),r))}Te(this.getInputElements(),r=>r.hide()),this.getSelectElement().setItems(n),super.reset(),this.getSelectElement().setValue(n[0])}}function E2e(t){Te(this.getInputElements(),(e,n)=>{var r;e[t.inputsCount>n?"show":"hide"](),e.options.type=(r=t.inputType)!==null&&r!==void 0?r:"text",n===0&&this.hot._registerTimeout(()=>e.focus(),10)}),this.runLocalHooks("change",t)}function N2e(t){Ux(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),iu(t))}function Qee(t,e,n){k2e(t,e),e.set(t,n)}function k2e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function K_(t,e){return t.get(Jee(t,e))}function Zee(t,e,n){return t.set(Jee(t,e),n),n}function Jee(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var cC=new WeakMap,gV=new WeakMap;class AP extends nh{static get DEFAULTS(){return zh({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,n){super(e,jo(AP.DEFAULTS,n)),Qee(this,cC,void 0),Qee(this,gV,void 0)}build(){super.build();const e=this.hot.rootDocument.createElement("label");e.textContent=this.translateIfPossible(this.options.label.textContent),e.htmlFor=this.translateIfPossible(this.options.label.htmlFor),Zee(gV,this,e),Zee(cC,this,this._element.firstChild),K_(cC,this).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(K_(gV,this).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return this.isBuilt()?K_(cC,this).checked:!1}setChecked(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isBuilt()&&(K_(cC,this).checked=e)}focus(){this.isBuilt()&&K_(cC,this).focus()}}function T2e(t,e){j2e(t,e),e.add(t)}function j2e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function M2e(t,e,n){return(e=P2e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function P2e(t){var e=A2e(t,"string");return typeof e=="symbol"?e:e+""}function A2e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function O2e(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const ete=0;var tte=new WeakSet;class I2e extends F_{constructor(e,n){super(e,{id:n.id,stateless:!1}),T2e(this,tte),M2e(this,"name",""),this.name=n.name,this.buildOperatorsElement()}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n)=>(st(n.parentNode,"htFiltersMenuOperators"),Te(this.elements,r=>n.appendChild(r.element)),n)}}buildOperatorsElement(){const e=[Kg,EP];Te(e,n=>{const r=new AP(this.hot,{name:"operator",label:{htmlFor:n,textContent:t2e(n)},value:n,checked:n===e[ete],id:n});r.addLocalHook("change",i=>O2e(tte,this,D2e).call(this,i)),this.elements.push(r)})}setChecked(e){this.elements.length<e&>(Jr`Radio button with index ${e} doesn't exist.`),Te(this.elements,(n,r)=>{n.setChecked(r===e)})}getActiveOperationId(){const e=this.elements.find(n=>n instanceof AP&&n.isChecked());return e?e.getValue():Kg}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&Te(this.elements,n=>{n.setChecked(n.getValue()===e)})}updateState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Kg,n=arguments.length>1?arguments[1]:void 0,r=e;r===cV&&(r=EP),this.state.setValueAtIndex(n,r)}reset(){this.setChecked(ete)}}function D2e(t){this.setState(t.target.value)}function H2e(t,e,n){L2e(t,e),e.set(t,n)}function L2e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vV(t,e){return t.get(nte(t,e))}function $2e(t,e,n){return t.set(nte(t,e),n),n}function nte(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var q_=new WeakMap;class X_ extends nh{static get DEFAULTS(){return zh({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,n){super(e,jo(X_.DEFAULTS,n)),H2e(this,q_,void 0)}build(){super.build(),$2e(q_,this,this._element.firstChild)}update(){this.isBuilt()&&(vV(q_,this).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&vV(q_,this).focus()}activate(){vV(q_,this).click()}}function F2e(t,e){rte(t,e),e.add(t)}function uC(t,e,n){rte(t,e),e.set(t,n)}function rte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ar(t,e){return t.get(dC(t,e))}function rh(t,e,n){return t.set(dC(t,e),n),n}function dC(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const ite="multipleSelect.itemBox";var ih=new WeakMap,ds=new WeakMap,bV=new WeakMap,Xm=new WeakMap,Xg=new WeakMap,Qg=new WeakMap,Q_=new WeakSet;class Z_ extends nh{static get DEFAULTS(){return zh({className:"htUIMultipleSelect",value:[]})}constructor(e,n){super(e,jo(Z_.DEFAULTS,n)),F2e(this,Q_),uC(this,ih,[]),uC(this,ds,void 0),uC(this,bV,void 0),uC(this,Xm,void 0),uC(this,Xg,void 0),uC(this,Qg,void 0),rh(Xm,this,new qg(this.hot,{placeholder:w4,className:"htUIMultipleSelectSearch"})),rh(Xg,this,new X_(this.hot,{textContent:v4,className:"htUISelectAll"})),rh(Qg,this,new X_(this.hot,{textContent:b4,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return ar(ds,this)}registerHooks(){ar(Xm,this).addLocalHook("keydown",e=>dC(Q_,this,V2e).call(this,e)),ar(Xm,this).addLocalHook("input",e=>dC(Q_,this,z2e).call(this,e)),ar(Xg,this).addLocalHook("click",e=>dC(Q_,this,B2e).call(this,e)),ar(Qg,this).addLocalHook("click",e=>dC(Q_,this,W2e).call(this,e))}setItems(e){var n;rh(ih,this,e),(n=ar(ds,this))===null||n===void 0||n.loadData(ar(ih,this))}setLocale(e){rh(bV,this,e)}getLocale(){return ar(bV,this)}getItems(){return[...ar(ih,this)]}getValue(){return Y2e(ar(ih,this))}getSearchInputElement(){return ar(Xm,this)}getSelectAllElement(){return ar(Xg,this)}getClearAllElement(){return ar(Qg,this)}isSelectedAllValues(){return ar(ih,this).length===this.getValue().length}build(){var e;super.build();const{rootDocument:n}=this.hot,r=n.createElement("div"),i=new nh(this.hot,{className:"htUISelectionControls",children:[ar(Xg,this),ar(Qg,this)]});this._element.appendChild(ar(Xm,this).element),this._element.appendChild(i.element),this._element.appendChild(r),(e=ar(ds,this))===null||e===void 0||e.destroy(),st(r,"htUIMultipleSelectHot"),rh(ds,this,new this.hot.constructor(r,{data:[[]],columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(u,h,m,g,y,x)=>{u.title=x.instance.getDataAtRowProp(h,x.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{ar(ds,this).listen()},modifyColWidth:u=>{const h=ar(ds,this).container.scrollWidth-go(n);return u!==void 0&&u<h?h:u},autoColumnSize:!0,autoRowSize:!1,hiddenRows:!0,maxCols:1,autoWrapCol:!0,height:110,copyPaste:!1,disableVisualSelection:"area",fillHandle:!1,fragmentSelection:"cell",tabMoves:{row:1,col:0},themeName:this.hot.getCurrentThemeName(),layoutDirection:this.hot.isRtl()?"rtl":"ltr"})),ar(ds,this).init();const a=ar(ds,this).getShortcutManager().getContext("grid");a.removeShortcutsByKeys(["Tab"]),a.removeShortcutsByKeys(["Shift","Tab"]),a.addShortcut({keys:[["Escape"]],callback:u=>{this.runLocalHooks("keydown",u,this)},group:ite}),a.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:u=>{ar(ds,this).deselectCell(),this.runLocalHooks("keydown",u,this),this.runLocalHooks("listTabKeydown",u,this)},group:ite})}focus(){this.isBuilt()&&ar(ds,this).listen()}reset(){ar(Xm,this).reset(),ar(Xg,this).reset(),ar(Qg,this).reset()}update(){!this.isBuilt()||ar(ds,this).rootElement.offsetHeight===0||(ar(ds,this).updateSettings({data:U2e(ar(ih,this),this.options.value)}),super.update())}destroy(){var e;(e=ar(ds,this))===null||e===void 0||e.destroy(),ar(Xm,this).destroy(),ar(Qg,this).destroy(),ar(Xg,this).destroy(),rh(Xm,this,null),rh(Qg,this,null),rh(Xg,this,null),rh(ds,this,null),rh(ih,this,null),super.destroy()}}function z2e(t){const e=t.target.value.toLocaleLowerCase(this.getLocale());if(this.options.searchMode==="apply"){const n=ar(ds,this).getPlugin("hiddenRows");n.showRows(n.getHiddenRows()),ar(ih,this).forEach((r,i)=>{r.checked=`${r.value}`.toLocaleLowerCase(this.getLocale()).indexOf(e)>=0,r.checked||n.hideRow(i)}),ar(ds,this).view.adjustElementsSize(),ar(ds,this).render()}else{let n;e===""?n=[...ar(ih,this)]:n=ar(ih,this).filter(r=>`${r.value}`.toLocaleLowerCase(this.getLocale()).indexOf(e)>=0),ar(ds,this).loadData(n)}}function V2e(t){this.runLocalHooks("keydown",t,this),wG(Ux,t.keyCode)("ARROW_DOWN")&&(t.preventDefault(),iu(t),ar(ds,this).listen(),ar(ds,this).selectCell(0,0))}function B2e(t){const e=[];t.preventDefault(),ar(ds,this).getSourceData().forEach((n,r)=>{n.checked=!0,e.push(DK(n,r)[0])}),ar(ds,this).setSourceDataAtCell(e)}function W2e(t){const e=[];t.preventDefault(),ar(ds,this).getSourceData().forEach((n,r)=>{n.checked=!1,e.push(DK(n,r)[0])}),ar(ds,this).setSourceDataAtCell(e)}function U2e(t,e){const n=V_(e);return t.map(r=>(r.checked=n(r.value),r))}function Y2e(t){const e=[];return t.forEach(n=>{n.checked&&e.push(n.value)}),e}function G2e(t,e){K2e(t,e),e.add(t)}function K2e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ste(t,e,n){return(e=q2e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function q2e(t){var e=X2e(t,"string");return typeof e=="symbol"?e:e+""}function X2e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function OP(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var J_=new WeakSet;class Q2e extends F_{constructor(e,n){super(e,{id:n.id,stateless:!1}),G2e(this,J_),ste(this,"name",""),ste(this,"searchMode",void 0),this.name=n.name,this.searchMode=n.searchMode,this.elements.push(new Z_(this.hot,{searchMode:this.searchMode})),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>OP(J_,this,Z2e).call(this,e)).addLocalHook("listTabKeydown",e=>this.runLocalHooks("listTabKeydown",e)),this.hot.addHook("modifyFiltersMultiSelectValue",(e,n)=>OP(J_,this,J2e).call(this,e,n))}getElements(){const e=this.getMultipleSelectElement();return[e.getSearchInputElement(),e.getSelectAllElement(),e.getClearAllElement(),this.getMultipleSelectElement()]}setState(e){if(this.reset(),e&&e.command.key===jb){const n=this.getMultipleSelectElement();n.setItems(e.itemsSnapshot),n.setValue(e.args[0]),n.setLocale(e.locale)}}getState(){const e=this.getMultipleSelectElement(),n=e.getItems();return{command:{key:e.isSelectedAllValues()||!n.length?Do:jb},args:[e.getValue()],itemsSnapshot:n}}updateState(e){const n=(r,i,s,a,u)=>{const[h]=E0(i,y=>y.name===jb),m={},g=this.hot.getTranslatedPhrase(pj);if(h){const y=a(r,u),x=di(y,D=>D.value),C=new Map(y.map(D=>[D.value,D.meta])),E=aV(x);s&&(h.args[0]=s);const M=[],j=Vee(E,h.args[0],g,D=>{D.checked&&M.push(D.value),OP(J_,this,ote).call(this,D,C)}),L=e.editedConditionStack.column;m.locale=this.hot.getCellMeta(0,L).locale,m.args=[M],m.command=Nb(jb),m.itemsSnapshot=j}else m.args=[],m.command=Nb(Do);this.state.setValueAtIndex(r,m)};n(e.editedConditionStack.column,e.editedConditionStack.conditions,e.conditionArgsChange,e.filteredRowsFactory),e.dependentConditionStacks.length&&n(e.dependentConditionStacks[0].column,e.dependentConditionStacks[0].conditions,e.conditionArgsChange,e.filteredRowsFactory,e.editedConditionStack)}getMultipleSelectElement(){return this.elements.filter(e=>e instanceof Z_)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,r,i,s,a)=>{st(n.parentNode,"htFiltersMenuValue");const u=this.hot.rootDocument.createElement("div");return st(u,"htFiltersMenuLabel"),u.textContent=a,n.appendChild(u),n.parentElement.hasAttribute("ghost-table")||Te(this.elements,h=>n.appendChild(h.element)),n}}}reset(){const e=this.hot.getTranslatedPhrase(pj),n=this._getColumnVisibleValues(),r=n.map(h=>h.value),i=new Map(n.map(h=>[h.value,h.meta])),s=aV(r),a=Vee(s,s,e,h=>{OP(J_,this,ote).call(this,h,i)});this.getMultipleSelectElement().setItems(a),super.reset(),this.getMultipleSelectElement().setValue(s);const u=this.hot.getPlugin("filters").getSelectedColumn();u!==null&&this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0,u.visualIndex).locale)}_getColumnVisibleValues(){const e=this.hot.getPlugin("filters").getSelectedColumn();return e===null?[]:di(this.hot.getDataAtCol(e.visualIndex),(n,r)=>({value:oV(n),meta:this.hot.getCellMeta(r,e.visualIndex)}))}}function Z2e(t){Ux(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),iu(t)),Ux(t.keyCode,"ENTER")&&(this.searchMode==="apply"&&this.runLocalHooks("accept"),iu(t))}function ote(t,e){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(t.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",t.visualValue,e.get(t.value)))}function J2e(t,e){return e.valueFormatter?e.valueFormatter(t,e):t}var ate;function eHe(t,e){tHe(t,e),e.add(t)}function tHe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nHe(t,e,n){return(e=rHe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rHe(t){var e=iHe(t,"string");return typeof e=="symbol"?e:e+""}function iHe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sHe(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var lte=new WeakSet;class eE extends F_{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,n){super(e,{id:n.id,stateless:!0}),eHe(this,lte),nHe(this,"name",""),this.name=n.name,this.elements.push(new qg(this.hot,{type:"button",value:y4,className:"htUIButton htUIButtonOK",identifier:eE.BUTTON_OK})),this.elements.push(new qg(this.hot,{type:"button",value:x4,className:"htUIButton htUIButtonCancel",identifier:eE.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){Te(this.elements,e=>{e.addLocalHook("click",(n,r)=>sHe(lte,this,oHe).call(this,n,r))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n)=>(st(n.parentNode,"htFiltersMenuActionBar"),Te(this.elements,r=>n.appendChild(r.element)),n)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}ate=eE;function oHe(t,e){e.options.identifier===ate.BUTTON_OK?this.accept():this.cancel()}function yV(t,e,n){return(e=aHe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aHe(t){var e=lHe(t,"string");return typeof e=="symbol"?e:e+""}function lHe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const cte="ConditionCollection.filteringStates";class xV{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;yV(this,"hot",void 0),yV(this,"isMapRegistrable",void 0),yV(this,"filteringStates",new nj),this.hot=e,this.isMapRegistrable=n,this.isMapRegistrable===!0?this.hot.columnIndexMapper.registerMap(cte,this.filteringStates):this.filteringStates.init(this.hot.columnIndexMapper.getNumberOfIndexes())}isEmpty(){return this.getFilteredColumns().length===0}isMatch(e,n){var r;const i=this.filteringStates.getValueAtIndex(n),s=(r=i==null?void 0:i.conditions)!==null&&r!==void 0?r:[],a=i==null?void 0:i.operation;return this.isMatchInConditions(s,e,a)}isMatchInConditions(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Kg;return e.length?e2e(r)(e,n):!0}addCondition(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Kg,i=arguments.length>3?arguments[3]:void 0;const s=this.hot.getCellMeta(0,e).locale,a=n.args.map(g=>typeof g=="string"?g.toLocaleLowerCase(s):g),u=n.name||n.command.key;this.runLocalHooks("beforeAdd",e);const h=this.getOperation(e);h?h!==r&>(Jr`The column of index ${e} has been already applied with a \`${h}\`\x20 filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20 Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20 use it consequently for a particular column).`):ls(B_[r])&>(Jr`Unexpected operation named \`${r}\`. Possible ones are\x20 \`disjunction\` and \`conjunction\`.`);const m=this.getConditions(e);m.length===0?this.filteringStates.setValueAtIndex(e,{operation:r,conditions:[{name:u,args:a,func:dd(u,a)}]},i):m.push({name:u,args:a,func:dd(u,a)}),this.runLocalHooks("afterAdd",e)}getConditions(e){var n,r;return(n=(r=this.filteringStates.getValueAtIndex(e))===null||r===void 0?void 0:r.conditions)!==null&&n!==void 0?n:[]}getOperation(e){var n;return(n=this.filteringStates.getValueAtIndex(e))===null||n===void 0?void 0:n.operation}getFilteredColumns(){return this.filteringStates.getEntries().map(e=>{let[n]=e;return n})}getColumnStackPosition(e){return this.getFilteredColumns().indexOf(e)}exportAllConditions(){return this.filteringStates.getEntries().reduce((e,n)=>{let[r,{operation:i,conditions:s}]=n;return e.push({column:r,operation:i,conditions:s.map(a=>{let{name:u,args:h}=a;return{name:u,args:[...h]}})}),e},[])}importAllConditions(e){this.clean(),e.forEach(n=>{n.conditions.forEach(r=>this.addCondition(n.column,r))})}removeConditions(e){this.runLocalHooks("beforeRemove",e),this.filteringStates.clearValue(e),this.runLocalHooks("afterRemove",e)}clean(){this.runLocalHooks("beforeClean"),this.filteringStates.clear(),this.runLocalHooks("afterClean")}hasConditions(e,n){const r=this.getConditions(e);return n?r.some(i=>i.name===n):r.length>0}destroy(){this.isMapRegistrable&&this.hot.columnIndexMapper.unregisterMap(cte),this.filteringStates=null,this.clearLocalHooks()}}ci(xV,vo);function ute(t,e,n){return(e=cHe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cHe(t){var e=uHe(t,"string");return typeof e=="symbol"?e:e+""}function uHe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class dte{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>[];ute(this,"conditionCollection",void 0),ute(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=n}filter(){let e=[];return Te(this.conditionCollection.getFilteredColumns(),(n,r)=>{let i=this.columnDataFactory(n);r&&(i=this._getIntersectData(i,e)),e=this.filterByColumn(n,i)}),e}filterByColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=[];return Te(n,i=>{i!==void 0&&this.conditionCollection.isMatch(i,e)&&r.push(i)}),r}_getIntersectData(e,n){const r=[];return Te(n,i=>{const s=i.meta.row;e[s]!==void 0&&(r[s]=e[s])}),r}}function dHe(t,e){hHe(t,e),e.add(t)}function hHe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Mb(t,e,n){return(e=fHe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fHe(t){var e=mHe(t,"string");return typeof e=="symbol"?e:e+""}function mHe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wV(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var IP=new WeakSet;class hte{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:()=>[];dHe(this,IP),Mb(this,"hot",void 0),Mb(this,"conditionCollection",void 0),Mb(this,"columnDataFactory",void 0),Mb(this,"changes",[]),Mb(this,"grouping",!1),Mb(this,"latestEditedColumnPosition",-1),Mb(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=n,this.columnDataFactory=r,this.conditionCollection.addLocalHook("beforeRemove",i=>wV(IP,this,pHe).call(this,i)),this.conditionCollection.addLocalHook("afterRemove",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("afterAdd",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("beforeClean",()=>wV(IP,this,gHe).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>wV(IP,this,vHe).call(this))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,Te(this.changes,e=>{this.updateStatesAtColumn(e)}),this.changes.length=0}updateStatesAtColumn(e,n){var r=this;if(this.grouping){this.changes.indexOf(e)===-1&&this.changes.push(e);return}const i=this.conditionCollection.exportAllConditions();let s=this.conditionCollection.getColumnStackPosition(e);s===-1&&(s=this.latestEditedColumnPosition);const a=i.slice(0,s),u=i.slice(s);u.length&&u[0].column===e&&u.shift();const h=Gpe(function(g,y){let x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const C=new xV(r.hot,!1),E=[].concat(g,x);C.importAllConditions(E);const M=r.columnDataFactory(y);let j;C.isEmpty()?j=M:j=new dte(C,z=>r.columnDataFactory(z)).filter();const L=di(j,z=>z.meta.row),D=V_(L);return C.destroy(),E0(M,z=>D(z.meta.row))})(a),m=[].concat(this.conditionCollection.getConditions(e));this.runLocalHooks("update",{editedConditionStack:{column:e,conditions:m},dependentConditionStacks:u,filteredRowsFactory:h,conditionArgsChange:n})}destroy(){this.clearLocalHooks(),Mr(this,(e,n)=>{this[n]=null})}}function pHe(t){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(t)}function gHe(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function vHe(){Te(this.latestOrderStack,t=>{this.updateStatesAtColumn(t)})}ci(hte,vo);function bHe(t){return eee({initialPage:0,size:()=>t.length,onItemSelect:(n,r)=>{const i=t[n];if(i instanceof Z_)return r;if(i.element&&!P0(i.element))return!1;i.focus()}})}const tE="filters";function yHe(t,e){let n=-1,r;const i=bHe(e),s=y=>()=>{r.isOpened()&&r.getKeyboardShortcutsCtrl().listen(tE),i.setCurrentPage(e.indexOf(y))};e.forEach(y=>{y instanceof nh&&(y.addLocalHook("click",s(y)),y.addLocalHook("focus",s(y)),y.addLocalHook("afterClose",s(y)))}),h(t);function a(y){const x=r.getKeyboardShortcutsCtrl(),C=y.getKeyboardShortcutsCtrl();i.clear(),C.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:x.getContext(tE),callback:()=>{y.isSubMenu()&&y.close(),x.listen(tE)}}]),!y.isSubMenu()&&x.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:E=>{const M=r.getNavigator();M.getCurrentPage()>-1&&(n=M.getCurrentPage()),M.clear(),E.shiftKey?i.toPreviousItem():i.toNextItem()}},{keys:[["Escape"]],callback:()=>{r.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:E=>{const M=e[i.getCurrentPage()];M instanceof G_&&(M.openOptions(),E.preventDefault()),M instanceof X_&&(M.activate(),E.preventDefault()),M instanceof nh||E.preventDefault()}}],tE)}function u(){r.focus(),r.getKeyboardShortcutsCtrl().listen(tE)}function h(y){y.addLocalHook("afterSelectionChange",x=>{x.key.startsWith("filter_")||i.clear()}),y.addLocalHook("afterSubmenuOpen",a),y.addLocalHook("afterOpen",a),r=y}function m(){return r}function g(){return n}return{...i,listen:u,setMenu:h,getMenu:m,getLastMenuPage:g}}function xHe(t,e){fte(t,e),e.add(t)}function CV(t,e,n){fte(t,e),e.set(t,n)}function fte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nE(t,e,n){return(e=wHe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wHe(t){var e=CHe(t,"string");return typeof e=="symbol"?e:e+""}function CHe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function DP(t,e,n){return t.set(Oc(t,e),n),n}function hd(t,e){return t.get(Oc(t,e))}function Oc(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const SV="filters",SHe=250,mte=SV;var Qm=new WeakMap,RV=new WeakMap,Pb=new WeakMap,yu=new WeakSet;class RHe extends Zr{static get PLUGIN_KEY(){return SV}static get PLUGIN_PRIORITY(){return SHe}static get DEFAULT_SETTINGS(){return{searchMode:"show"}}static get SETTINGS_VALIDATORS(){return{searchMode:e=>typeof e=="string"&&["show","apply"].includes(e)}}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){var n;super(e),n=this,xHe(this,yu),nE(this,"dropdownMenuPlugin",null),nE(this,"conditionCollection",null),nE(this,"conditionUpdateObserver",null),nE(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),nE(this,"filtersRowsMap",null),CV(this,Qm,void 0),CV(this,RV,new WeakSet),CV(this,Pb,[]),this.hot.addHook("afterGetColHeader",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Oc(yu,n,MHe).call(n,...i)})}isEnabled(){return!!this.hot.getSettings()[SV]}enablePlugin(){var e=this;if(this.enabled)return;this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new MR),this.dropdownMenuPlugin=this.hot.getPlugin("dropdownMenu");const n=this.hot.getSettings().dropdownMenu,r=n&&n.uiContainer||this.hot.rootPortalElement,i=u=>(u.addLocalHook("accept",()=>Oc(yu,this,pte).call(this,"accept")),u.addLocalHook("cancel",()=>Oc(yu,this,pte).call(this,"cancel")),u.addLocalHook("change",h=>Oc(yu,this,jHe).call(this,u,h)),u),s=()=>`${this.hot.getTranslatedPhrase(m4)}:`,a=()=>`${this.hot.getTranslatedPhrase(p4)}:`;if(!this.components.get("filter_by_condition")){const u=new pV(this.hot,{id:"filter_by_condition",name:s,addSeparator:!1,menuContainer:r});u.addLocalHook("afterClose",()=>Oc(yu,this,gte).call(this)),this.components.set("filter_by_condition",i(u))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new I2e(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const u=new pV(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:r});u.addLocalHook("afterClose",()=>Oc(yu,this,gte).call(this)),this.components.set("filter_by_condition2",i(u))}if(!this.components.get("filter_by_value")){const u=this.getSetting("searchMode");this.components.set("filter_by_value",i(new Q2e(this.hot,{id:"filter_by_value",name:a,searchMode:u})))}if(this.components.get("filter_action_bar")||this.components.set("filter_action_bar",i(new eE(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new xV(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new hte(this.hot,this.conditionCollection,u=>this.getDataMapAtColumn(u)),this.conditionUpdateObserver.addLocalHook("update",u=>Oc(yu,this,PHe).call(this,u))),this.components.forEach(u=>u.show()),this.addHook("afterDropdownMenuDefaultOptions",function(){for(var u=arguments.length,h=new Array(u),m=0;m<u;m++)h[m]=arguments[m];return Oc(yu,e,THe).call(e,...h)}),this.addHook("beforeDropdownMenuShow",()=>Oc(yu,this,kHe).call(this)),this.addHook("afterDropdownMenuShow",()=>Oc(yu,this,EHe).call(this)),this.addHook("afterDropdownMenuHide",()=>Oc(yu,this,NHe).call(this)),this.addHook("afterChange",u=>Oc(yu,this,_He).call(this,u)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!hd(Qm,this)&&this.dropdownMenuPlugin.enabled){const u=[{focus:()=>{const m=hd(Qm,this).getMenu(),g=m.getNavigator(),y=hd(Qm,this).getLastMenuPage();m.focus(),y>0?g.setCurrentPage(y):g.toFirstItem()}},...Array.from(this.components).map(m=>{let[,g]=m;return g.getElements()}).flat()];DP(Qm,this,yHe(this.dropdownMenuPlugin.menu,u));const h=m=>{hd(Qm,this).listen(),m.preventDefault(),Ux(m.keyCode,"TAB")&&(m.shiftKey?hd(Qm,this).toPreviousItem():hd(Qm,this).toNextItem())};this.components.get("filter_by_value").addLocalHook("listTabKeydown",h),this.components.get("filter_by_condition").addLocalHook("selectTabKeydown",h)}this.registerShortcuts(),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){if(this.enabled){var e;(e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled&&this.dropdownMenuPlugin.menu.clearLocalHooks(),this.components.forEach((n,r)=>{n.destroy(),this.components.set(r,null)}),this.conditionCollection.destroy(),this.conditionCollection=null,this.hot.rowIndexMapper.unregisterMap(this.pluginName)}this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Alt","A"]],stopPropagation:!0,callback:()=>{const e=this.hot.getSelected();this.clearConditions(),this.filter(),e&&this.hot.selectCells(e)},group:mte})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(mte)}addCondition(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Kg;const s=this.hot.toPhysicalColumn(e);this.conditionCollection.addCondition(s,{command:{key:n},args:r},i)}removeConditions(e){const n=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(n)}clearConditions(e){if(e===void 0)this.conditionCollection.clean();else{const n=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(n)}}importConditions(e){this.conditionCollection.importAllConditions(e)}exportConditions(){return this.conditionCollection.exportAllConditions()}filter(){const{navigableHeaders:e}=this.hot.getSettings(),n=!this.conditionCollection.isEmpty(),r=this.exportConditions(),i=this.hot.runHooks("beforeFilter",r,hd(Pb,this));if(i!==!1&&n){const s=this._createDataFilter(),a=[];let u=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear(),u=di(s.filter(),m=>m.meta.row);const h=V_(u);En(this.hot.countSourceRows()-1,m=>{h(m)||a.push(m)}),Te(a,m=>{this.filtersRowsMap.setValueAtIndex(m,!0)})},!0),!e&&!u.length&&this.hot.deselectCell(),DP(Pb,this,this.exportConditions())}else i!==!1&&!n?(DP(Pb,this,this.exportConditions()),this.filtersRowsMap.clear()):this.importConditions(hd(Pb,this));this.hot.selection.isSelected()&&this.hot.selectCell(e?-1:0,this.hot.getSelectedRangeActive().highlight.col),i!==!1&&(this.hot.runHooks("afterFilter",r),this.hot.view.adjustElementsSize(),this.hot.render())}getSelectedColumn(){var e;const n=(e=this.hot.getSelectedRangeActive())===null||e===void 0?void 0:e.highlight;return n?{visualIndex:n.col,physicalIndex:this.hot.toPhysicalColumn(n.col)}:null}getDataMapAtColumn(e){const n=this.hot.countSourceRows(),r=this.hot.toVisualColumn(e),i=[];for(let s=0;s<n;s++){const a=this.hot._getMetaManager().getCellMeta(s,e,{visualRow:s,visualColumn:e,skipMetaExtension:!0});let u=bq(this.hot.getSourceDataAtCell(s,r),a);if(this.hot.hasHook("modifyData")){const h=Cc(u);this.hot.runHooks("modifyData",s,e,h,"get"),h.isTouched()&&(u=h.value)}i.push({meta:a,value:oV(u)})}return i}updateValueComponentCondition(e){const n=this.hot.getDataAtCol(e),r=aV(n);this.conditionUpdateObserver.updateStatesAtColumn(e,r)}restoreComponents(e){var n;const r=(n=this.getSelectedColumn())===null||n===void 0?void 0:n.physicalIndex;e.forEach(i=>{i.isHidden()||i.restoreState(r)}),this.updateDependentComponentsVisibility()}getOperationBasedOnArguments(e,n,r,i){let s=e;return s===EP&&n.command.key!==Do&&r.command.key!==Do&&i.command.key!==Do?s=cV:i.command.key!==Do&&(n.command.key===Do||r.command.key===Do)&&(s=Kg),s}setListeningDropdownMenu(){this.dropdownMenuPlugin&&this.dropdownMenuPlugin.setListening()}updateDependentComponentsVisibility(){const e=this.components.get("filter_by_condition"),{command:n}=e.getState(),r=[this.components.get("filter_by_condition2"),this.components.get("filter_operators")];n.showOperators?this.showComponents(...r):this.hideComponents(...r)}_createDataFilter(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.conditionCollection;return new dte(e,n=>this.getDataMapAtColumn(n))}getIndexesOfComponents(){const e=[];if(!this.dropdownMenuPlugin)return e;const n=this.dropdownMenuPlugin.menu;for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Te(i,a=>{Te(n.menuItems,(u,h)=>{u.key===a.getMenuItemDescriptor().key&&e.push(h)})}),e}changeComponentsVisibility(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.dropdownMenuPlugin)return;const r=this.dropdownMenuPlugin.menu.hotMenu,i=r.getPlugin("hiddenRows");for(var s=arguments.length,a=new Array(s>1?s-1:0),u=1;u<s;u++)a[u-1]=arguments[u];const h=this.getIndexesOfComponents(...a);e?i.showRows(h):i.hideRows(h),r.render()}hideComponents(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.changeComponentsVisibility(!1,...n)}showComponents(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.changeComponentsVisibility(!0,...n)}destroy(){this.enabled&&(this.components.forEach((e,n)=>{e!==null&&(e.destroy(),this.components.set(n,null))}),this.conditionCollection.destroy(),this.conditionUpdateObserver.destroy(),this.hot.rowIndexMapper.unregisterMap(this.pluginName)),super.destroy()}}function _He(t){t&&Te(t,e=>{const[,n]=e,r=this.hot.propToCol(n);this.conditionCollection.hasConditions(r)&&this.updateValueComponentCondition(r)})}function EHe(){const t=this.dropdownMenuPlugin.menu;this.restoreComponents(Array.from(this.components.values())),t.updateMenuDimensions()}function NHe(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function kHe(){const t=this.dropdownMenuPlugin.menu;hd(RV,this).has(t)||hd(Qm,this).setMenu(t),hd(RV,this).add(t)}function THe(t){t.items.push({name:Xn}),this.components.forEach(e=>{t.items.push(e.getMenuItemDescriptor())})}function pte(t){var e;if(t==="accept"){const r=this.getSelectedColumn();if(r===null){var n;(n=this.dropdownMenuPlugin)===null||n===void 0||n.close();return}const{physicalIndex:i}=r,s=this.components.get("filter_by_condition").getState(),a=this.components.get("filter_by_condition2").getState(),u=this.components.get("filter_by_value").getState(),h=this.getOperationBasedOnArguments(this.components.get("filter_operators").getActiveOperationId(),s,a,u);this.conditionUpdateObserver.groupChanges();let m=this.conditionCollection.getColumnStackPosition(i);m===-1&&(m=void 0),this.conditionCollection.removeConditions(i),s.command.key!==Do&&(this.conditionCollection.addCondition(i,s,h,m),a.command.key!==Do&&this.conditionCollection.addCondition(i,a,h,m)),u.command.key!==Do&&this.conditionCollection.addCondition(i,u,h,m),this.conditionUpdateObserver.flush(),this.components.forEach(g=>g.saveState(i)),this.filter()}(e=this.dropdownMenuPlugin)===null||e===void 0||e.close()}function jHe(t,e){const n=this.dropdownMenuPlugin.menu;this.updateDependentComponentsVisibility(),t.constructor===pV&&!e.inputsCount&&this.setListeningDropdownMenu(),n.updateMenuDimensions()}function gte(){this.setListeningDropdownMenu()}function MHe(t,e,n){const r=this.hot.toPhysicalColumn(t);this.enabled&&this.conditionCollection.hasConditions(r)&&n===this.hot.view.getColumnHeadersCount()-1?st(e,"htFiltersActive"):cn(e,"htFiltersActive")}function PHe(t){var e;if(!((e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled))return;const{editedConditionStack:{conditions:n,column:r},conditionArgsChange:i}=t;Array.isArray(i)&&DP(Pb,this,hd(Pb,this).map(u=>(u.column===r&&n.length>0&&u.conditions.forEach(h=>{h.name==="by_value"&&(h.args=[[...i]])}),u)));const s=n.filter(u=>u.name===jb),a=n.filter(u=>u.name!==jb);if(s.length>=2||a.length>=3)Yn(Jr`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20 The overall amount of conditions exceed the capability of the dropdown menu.\x20 For more details see the documentation.`);else{const u=this.conditionCollection.getOperation(r);this.components.get("filter_by_condition").updateState(a[0],r),this.components.get("filter_by_condition2").updateState(a[1],r),this.components.get("filter_operators").updateState(u,r),this.components.get("filter_by_value").updateState(t)}}const vte="internal-use-in-handsontable",_V={licenseKey:vte,useArrayArithmetic:!0,useColumnIndex:!1,useStats:!1,evaluateNullToZero:!0,precisionEpsilon:1e-13,precisionRounding:14,smartRounding:!0,leapYear1900:!1,nullDate:{year:1899,month:12,day:30},nullYear:30,dateFormats:["DD/MM/YYYY","DD/MM/YY"],timeFormats:["hh:mm","hh:mm:ss.sss"],matchWholeCell:!0,useRegularExpressions:!1,useWildcards:!0,functionArgSeparator:",",thousandSeparator:"",decimalSeparator:".",language:"enGB"};function bte(t){var e;return{maxColumns:t.maxColumns,maxRows:t.maxRows,language:(e=t[ml])===null||e===void 0||(e=e.language)===null||e===void 0?void 0:e.langCode}}function yte(t){return Object.keys(t).reduce((e,n)=>(n!=="hyperformula"&&(e[n]=t[n]),e),{})}function AHe(t){var e;const n=t[ml],r=yte(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=bte(t);return{..._V,...r,...i}}function OHe(t){var e;const n=t[ml],r=yte(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=bte(t);return{...r,...i}}function IHe(t,e){return Object.keys(e).some(n=>e[n]!==void 0&&e[n]!==t[n])}function HP(){const t="engine_relationship",e=ou(ml);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function EV(){const t="shared_engine_usage",e=ou(ml);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function DHe(t){const e=t.getSettings(),n=e[ml],r=n==null?void 0:n.engine;if(n===!0||ls(r))return null;if(typeof r.hyperformula=="function"||typeof r=="function"){var i;return HHe((i=r.hyperformula)!==null&&i!==void 0?i:r,e,t)}else if(typeof r=="object"&&ls(r.hyperformula)){const s=HP(),a=EV().get(r);return s.has(r)||s.set(r,[]),s.get(r).push(t),a&&a.push(t.guid),r.getConfig().licenseKey||r.updateConfig({licenseKey:vte}),(r.getConfig().leapYear1900!==_V.leapYear1900||N0(r.getConfig().nullDate,_V.nullDate)===!1)&&Yn(Jr`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\` settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),r}return null}function HHe(t,e,n){const r=e[ml],i=AHe(e),s=HP(),a=EV();LHe(t,r.functions),$He(t,r.language);const u=t.buildEmpty(i);return s.set(u,[n]),a.set(u,[n.guid]),FHe(u,r.namedExpressions),u.on("sheetAdded",()=>{u.rebuildAndRecalculate()}),u.on("sheetRemoved",()=>{u.rebuildAndRecalculate()}),u}function xte(t){var e;const n=HP(),r=n.size===0?[]:Array.from((e=n.get(t))!==null&&e!==void 0?e:[]);return new Map(r.map(i=>[i.getPlugin("formulas").sheetId,i]))}function wte(t,e){if(t){const n=HP(),r=n.get(t),i=EV(),s=i.get(t);r&&r.includes(e)&&(r.splice(r.indexOf(e),1),r.length===0&&n.delete(t)),s&&s.includes(e.guid)&&(s.splice(s.indexOf(e.guid),1),s.length===0&&(i.delete(t),t.destroy()))}}function LHe(t,e){e&&e.forEach(n=>{const{name:r,plugin:i,translations:s}=n;try{t.registerFunction(r,i,s)}catch(a){Yn(a.message)}})}function $He(t,e){if(e){const{langCode:n}=e;try{t.registerLanguage(n,e)}catch(r){Yn(r.message)}}}function FHe(t,e){e&&(t.suspendEvaluation(),e.forEach(n=>{const{name:r,expression:i,scope:s,options:a}=n;try{t.addNamedExpression(r,i,s,a)}catch(u){Yn(u.message)}}),t.resumeEvaluation())}function zHe(t,e){return(ls(e)||!t.doesSheetExist(e))&&(e=t.addSheet(e)),e}const Cte="DD/MM/YYYY";function VHe(t){return typeof t=="string"&&t.charAt(0)==="'"&&t.charAt(1)==="="}function BHe(t){return VHe(t)?t.substr(1):t}function WHe(t){return typeof t=="string"&&t.startsWith("=")}function NV(t,e){return typeof t=="string"&&e==="date"}function Ste(t,e){return Tt(t,e,!0).isValid()}function Rte(t,e){return Tt(t,e,!0).format(Cte)}function UHe(t,e){return Tt(t,Cte,!0).format(e)}function _te(t,e){const r=new Date(Date.UTC(0,0,t+-1));return Tt(r).format(e)}function YHe(t,e,n){const r=Array.from(Array(n).keys()).filter(s=>t.includes(s)===!1);if(e===0){var i;return(i=r[e])!==null&&i!==void 0?i:0}return r[e-1]+1}function GHe(t,e){const n=[];return t.forEach(r=>{const i={from:r,to:e};n.forEach(s=>{const a=s.from>s.to,u=s.to<=i.from;s.from>i.from&&u&&a&&(i.from+=1)}),i.from>=e&&(e+=1),n.push(i)}),n}function KHe(t){return t.forEach((e,n)=>{t.slice(n+1).forEach(i=>{const s=i.from<i.to;i.from>e.from&&s&&(i.from-=1)})}),t}function kV(t,e,n){const r=GHe(t,YHe(t,e,n));return KHe(r)}function Ab(t,e,n){qHe(t,e),e.set(t,n)}function qHe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hs(t,e){return t.get(Ete(t,e))}function Zg(t,e,n){return t.set(Ete(t,e),n),n}function Ete(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var rE=new WeakMap,Jg=new WeakMap,xu=new WeakMap,LP=new WeakMap,TV=new WeakMap,jV=new WeakMap,$P=new WeakMap;class Nte{constructor(e,n,r){Ab(this,rE,void 0),Ab(this,Jg,void 0),Ab(this,xu,void 0),Ab(this,LP,[]),Ab(this,TV,[]),Ab(this,jV,void 0),Ab(this,$P,[]),Zg(rE,this,e),Zg(Jg,this,n),Zg(xu,this,r)}setRemovedHfIndexes(e){return Zg($P,this,e.map(n=>{const r=hs(Jg,this).getVisualFromPhysicalIndex(n);return this.getHfIndexFromVisualIndex(r)})),hs($P,this)}getRemovedHfIndexes(){return hs($P,this)}getHfIndexFromVisualIndex(e){const n=hs(Jg,this).getIndexesSequence(),r=hs(Jg,this).getNotTrimmedIndexes();return n.indexOf(r[e],e)}syncMoves(e){const r=`move${Hd(hs(rE,this))}s`;hs(xu,this).getEngine().batch(()=>{e.forEach(i=>{const s=i.from!==i.to,a=i.from+1!==i.to;s&&a&&hs(xu,this).getEngine()[r](hs(xu,this).getSheetId(),i.from,1,i.to)})})}storeMovesInformation(e,n,r){r!==!1&&(Zg(TV,this,e.map(i=>this.getHfIndexFromVisualIndex(i))),Zg(jV,this,this.getHfIndexFromVisualIndex(n)))}calculateAndSyncMoves(e,n){if(hs(xu,this).isPerformingUndoRedo()||e===!1||n===!1)return;const r=kV(hs(TV,this),hs(jV,this),hs(Jg,this).getNumberOfIndexes());hs(xu,this).getSheetId()===null?hs(xu,this).getPostponeAction(()=>this.syncMoves(r)):this.syncMoves(r)}getIndexesChangeSyncMethod(){const e=`set${Hd(hs(rE,this))}Order`;return n=>{if(hs(xu,this).isPerformingUndoRedo())return;const r=hs(Jg,this).getIndexesSequence();if(n==="update"&&r.length>0){const i=hs(LP,this).map(h=>r.indexOf(h)),s=hs(xu,this).getEngine().getSheetDimensions(hs(xu,this).getSheetId());let a;hs(rE,this)==="row"?a=s.height:a=s.width;const u=i.length;for(let h=u;h<a;h+=1)i.push(h);hs(xu,this).getEngine()[e](hs(xu,this).getSheetId(),i)}Zg(LP,this,r)}}init(){Zg(LP,this,hs(Jg,this).getIndexesSequence())}}function Ob(t,e,n){XHe(t,e),e.set(t,n)}function XHe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zm(t,e){return t.get(kte(t,e))}function Ib(t,e,n){return t.set(kte(t,e),n),n}function kte(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var FP=new WeakMap,zP=new WeakMap,MV=new WeakMap,PV=new WeakMap,AV=new WeakMap,OV=new WeakMap,IV=new WeakMap;class QHe{constructor(e,n,r){Ob(this,FP,void 0),Ob(this,zP,void 0),Ob(this,MV,void 0),Ob(this,PV,!1),Ob(this,AV,!1),Ob(this,OV,null),Ob(this,IV,null),Ib(FP,this,new Nte("row",e,this)),Ib(zP,this,new Nte("column",n,this)),Ib(MV,this,r)}getForAxis(e){return e==="row"?Zm(FP,this):Zm(zP,this)}setPerformUndo(e){Ib(PV,this,e)}setPerformRedo(e){Ib(AV,this,e)}isPerformingUndoRedo(){return Zm(PV,this)||Zm(AV,this)}getSheetId(){return Zm(IV,this)}getEngine(){return Zm(OV,this)}getPostponeAction(){return Zm(MV,this)}setupSyncEndpoint(e,n){Ib(OV,this,e),Ib(IV,this,n),Zm(FP,this).init(),Zm(zP,this).init()}}function ZHe(t,e){Tte(t,e),e.add(t)}function Db(t,e,n){return(e=JHe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function JHe(t){var e=eLe(t,"string");return typeof e=="symbol"?e:e+""}function eLe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function DV(t,e,n){Tte(t,e),e.set(t,n)}function Tte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ev(t,e,n){return t.set(kr(t,e),n),n}function Hb(t,e){return t.get(kr(t,e))}function kr(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const ml="formulas",tLe=["maxRows","maxColumns","language"],nLe=260;un.getSingleton().register("afterNamedExpressionAdded"),un.getSingleton().register("afterNamedExpressionRemoved"),un.getSingleton().register("afterSheetAdded"),un.getSingleton().register("afterSheetRemoved"),un.getSingleton().register("afterSheetRenamed"),un.getSingleton().register("afterFormulasValuesUpdate");const hC=t=>t==="UndoRedo.undo"||t==="UndoRedo.redo"||t==="auto";var Jm=new WeakMap,VP=new WeakMap,iE=new WeakMap,Ar=new WeakSet;class rLe extends Zr{constructor(){var e;super(...arguments),e=this,ZHe(this,Ar),DV(this,Jm,!1),DV(this,VP,!1),DV(this,iE,[["valuesUpdated",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return kr(Ar,e,yLe).call(e,...r)}],["namedExpressionAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return kr(Ar,e,xLe).call(e,...r)}],["namedExpressionRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return kr(Ar,e,wLe).call(e,...r)}],["sheetAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return kr(Ar,e,CLe).call(e,...r)}],["sheetRenamed",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return kr(Ar,e,SLe).call(e,...r)}],["sheetRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return kr(Ar,e,RLe).call(e,...r)}]]),Db(this,"staticRegister",ou("formulas")),Db(this,"engine",null),Db(this,"sheetId",null),Db(this,"sheetName",null),Db(this,"indexSyncer",null),Db(this,"rowAxisSyncer",null),Db(this,"columnAxisSyncer",null)}static get PLUGIN_KEY(){return ml}static get PLUGIN_PRIORITY(){return nLe}static get SETTING_KEYS(){return[ml,...tLe]}isEnabled(){return!!this.hot.getSettings()[ml]}enablePlugin(){var e,n=this;if(!this.enabled){if(this.engine=(e=DHe(this.hot))!==null&&e!==void 0?e:this.engine,!this.engine){Yn("Missing the required `engine` key in the Formulas settings. Please fill it with either an engine class or an engine instance.");return}if(this.sheetName!==null&&!this.engine.doesSheetExist(this.sheetName)){const r=this.addSheet(this.sheetName,kr(Ar,this,oE).call(this));r!==!1&&kr(Ar,this,sE).call(this,r)}this.addHook("beforeLoadData",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,Mte).call(n,...i)}),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,Pte).call(n,...i)}),this.addHook("beforeUpdateData",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,Mte).call(n,...i)}),this.addHook("afterUpdateData",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,Pte).call(n,...i)}),this.addHook("modifyData",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,aLe).call(n,...i)}),this.addHook("modifySourceData",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,lLe).call(n,...i)}),this.addHook("beforeValidate",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,iLe).call(n,...i)}),this.addHook("afterSetSourceDataAtCell",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,cLe).call(n,...i)}),this.addHook("afterSetDataAtCell",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,Ate).call(n,...i)}),this.addHook("afterSetDataAtRowProp",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,Ate).call(n,...i)}),this.addHook("beforeCreateRow",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,uLe).call(n,...i)}),this.addHook("beforeCreateCol",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,dLe).call(n,...i)}),this.addHook("afterCreateRow",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,mLe).call(n,...i)}),this.addHook("afterCreateCol",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,pLe).call(n,...i)}),this.addHook("beforeRemoveRow",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,hLe).call(n,...i)}),this.addHook("beforeRemoveCol",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,fLe).call(n,...i)}),this.addHook("afterRemoveRow",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,gLe).call(n,...i)}),this.addHook("afterRemoveCol",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,vLe).call(n,...i)}),this.indexSyncer=new QHe(this.hot.rowIndexMapper,this.hot.columnIndexMapper,r=>{this.hot.addHookOnce("init",()=>{r()})}),this.rowAxisSyncer=this.indexSyncer.getForAxis("row"),this.columnAxisSyncer=this.indexSyncer.getForAxis("column"),this.hot.addHook("afterRowSequenceChange",this.rowAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("afterColumnSequenceChange",this.columnAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("beforeRowMove",(r,i,s,a)=>{this.rowAxisSyncer.storeMovesInformation(r,i,a)}),this.hot.addHook("beforeColumnMove",(r,i,s,a)=>{this.columnAxisSyncer.storeMovesInformation(r,i,a)}),this.hot.addHook("afterRowMove",(r,i,s,a,u)=>{this.rowAxisSyncer.calculateAndSyncMoves(a,u)}),this.hot.addHook("afterColumnMove",(r,i,s,a,u)=>{this.columnAxisSyncer.calculateAndSyncMoves(a,u)}),this.hot.addHook("beforeColumnFreeze",(r,i)=>{this.columnAxisSyncer.storeMovesInformation([r],this.hot.getSettings().fixedColumnsStart,i)}),this.hot.addHook("afterColumnFreeze",(r,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.hot.addHook("beforeColumnUnfreeze",(r,i)=>{this.columnAxisSyncer.storeMovesInformation([r],this.hot.getSettings().fixedColumnsStart-1,i)}),this.hot.addHook("afterColumnUnfreeze",(r,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.addHook("afterCellMetaReset",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,oLe).call(n,...i)}),this.addHook("beforeUndo",()=>{this.indexSyncer.setPerformUndo(!0),this.engine.undo()}),this.addHook("beforeRedo",()=>{this.indexSyncer.setPerformRedo(!0),this.engine.redo()}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformUndo(!1)}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformRedo(!1)}),this.addHook("afterDetachChild",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,bLe).call(n,...i)}),this.addHook("beforeAutofill",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return kr(Ar,n,sLe).call(n,...i)}),Hb(iE,this).forEach(r=>{let[i,s]=r;return this.engine.on(i,s)}),super.enablePlugin()}}disablePlugin(){Hb(iE,this).forEach(e=>{let[n,r]=e;return this.engine.off(n,r)}),wte(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const n=OHe(this.hot.getSettings());IHe(this.engine.getConfig(),n)&&this.engine.updateConfig(n);const r=this.hot.getSettings()[ml];if(Lt(r)&&Lt(r.sheetName)&&r.sheetName!==this.sheetName&&this.switchSheet(r.sheetName),!e.data&&this.sheetName===null){const i=this.hot.getSettings()[ml].sheetName;if(i&&this.engine.doesSheetExist(i))this.switchSheet(this.sheetName);else{const s=this.addSheet(i??void 0,kr(Ar,this,oE).call(this));kr(Ar,this,sE).call(this,s)}}super.updatePlugin(e)}destroy(){Hb(iE,this).forEach(e=>{var n;let[r,i]=e;return(n=this.engine)===null||n===void 0?void 0:n.off(r,i)}),ev(iE,this,null),wte(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,n){if(Lt(n)&&!zbe(n))return Yn("The provided data should be an array of arrays."),!1;if(e!=null&&this.engine.doesSheetExist(e))return Yn("Sheet with the provided name already exists."),!1;try{const r=this.engine.addSheet(e??void 0);return n&&this.engine.setSheetContent(this.engine.getSheetId(r),n),r}catch(r){return Yn(r.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e)){sL(`The sheet named \`${e}\` does not exist, switch aborted.`);return}kr(Ar,this,sE).call(this,e);const n=this.engine.getSheetSerialized(this.sheetId);n.length>0&&this.hot.loadData(n,`${Hd(ml)}.switchSheet`)}getCellType(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;const i=this.hot.toPhysicalRow(e),s=this.hot.toPhysicalColumn(n);return i!==null&&s!==null?this.engine.getCellType({sheet:r,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n)}):"EMPTY"}isFormulaCellType(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;return this.engine.doesCellHaveFormula({sheet:r,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n)})}renderDependentSheets(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=new Set;e.forEach(i=>{var s;const a=i==null||(s=i.address)===null||s===void 0?void 0:s.sheet;a!==void 0&&(r.has(a)||r.add(a))}),xte(this.engine).forEach((i,s)=>{if((n||s!==this.sheetId)&&r.has(s)){var a;i.render(),(a=i.view)===null||a===void 0||a.adjustElementsSize()}})}validateDependentCells(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=s=>{var a;const{row:u,col:h,sheet:m}=(a=s==null?void 0:s.address)!==null&&a!==void 0?a:{};return Lt(m)?`${m}:${u}x${h}`:""},i=new Set(n.map(s=>r(s)));e.forEach(s=>{var a,u;const{row:h,col:m}=(a=s.address)!==null&&a!==void 0?a:{};if(Lt(h)===!1||Lt(m)===!1||h>=this.hot.countRows()||m>=this.hot.countCols())return;const g=s==null||(u=s.address)===null||u===void 0?void 0:u.sheet,y=r(s);if(g!==void 0&&!i.has(y)){const x=xte(this.engine).get(g);if(!x)return;x.validateCell(x.getDataAtCell(h,m),x.getCellMeta(h,m),()=>{})}})}syncChangeWithEngine(e,n,r){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(i)){Yn(`Not possible to set cell data at ${JSON.stringify(i)}`);return}const s=this.hot.getCellMeta(e,n);return NV(r,s.type)&&(Ste(r,s.dateFormat)?r=Rte(r,s.dateFormat):WHe(r)===!1&&(r=`'${r}`)),this.engine.setCellContents(i,r)}}function sE(t){this.sheetName=t,this.sheetId=this.engine.getSheetId(this.sheetName)}function jte(t,e,n){if(nn(n)&&n!==null){const r=this.hot.toVisualRow(t),i=this.hot.toVisualColumn(e),s=this.hot.getCellMeta(r,i).valueGetter;return s?s.call(this.hot,n):n.toString()}return n}function oE(t,e,n,r){return this.hot.getSourceDataArray(t,e,n,r).map((i,s)=>i.map((a,u)=>kr(Ar,this,jte).call(this,s,u,a)))}function iLe(t,e,n){const r=this.hot.propToCol(n);if(this.isFormulaCellType(e,r)){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r),sheet:this.sheetId},s=this.hot.getCellMeta(e,r);let a=this.engine.getCellValue(i);return s.type==="date"&&Vl(a)&&(a=_te(a,s.dateFormat)),typeof a=="object"&&a!==null?a.value:a}return t}function sLe(t,e,n){const{row:r,col:i}=e.getTopStartCorner(),{row:s,col:a}=e.getBottomEndCorner(),{row:u,col:h}=n.getTopStartCorner(),{row:m,col:g}=n.getBottomEndCorner(),y={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(r),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(i),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(s),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(a),sheet:this.sheetId}},x={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(u),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(h),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(m),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(g),sheet:this.sheetId}};if(this.engine.isItPossibleToSetCellContents(x)===!1)return!1;const C=this.engine.getFillRangeData(y,x),{row:E,col:M}=y.start,{row:j,col:L}=y.end,D=j-E+1,z=L-M+1;for(let H=0;H<C.length;H+=1)for(let V=0;V<C[H].length;V+=1){const F=C[H][V],B=E+H%D,te=M+V%z,ve=this.hot.getCellMeta(B,te);NV(F,ve.type)&&(F.startsWith("'")?C[H][V]=F.slice(1):this.isFormulaCellType(B,te,this.sheetId)===!1&&(C[H][V]=UHe(F,ve.dateFormat)))}return C}function Mte(t,e){(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes(Hd(ml))||ev(VP,this,ls(this.hot.getSettings().data))}function oLe(){if(Hb(VP,this)){this.switchSheet(this.sheetName);return}const t=kr(Ar,this,oE).call(this);t.forEach((n,r)=>{n.forEach((i,s)=>{const a=this.hot.getCellMeta(r,s,{skipMetaExtension:!0}),u=a.dateFormat;NV(i,a.type)&&(Ste(i,u)?t[r][s]=Rte(i,u):i.startsWith("=")||(t[r][s]=`'${i}`))})}),ev(Jm,this,!0);const e=this.engine.setSheetContent(this.sheetId,t);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(e),ev(Jm,this,!1)}function Pte(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(n.includes(Hd(ml)))return;const r=zHe(this.engine,this.hot.getSettings()[ml].sheetName);if(kr(Ar,this,sE).call(this,r),n!=="updateSettings")if(Hb(VP,this))this.switchSheet(this.sheetName);else{const i=kr(Ar,this,oE).call(this);if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,i)){ev(Jm,this,!0);const s=this.engine.setSheetContent(this.sheetId,i);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(s),ev(Jm,this,!1)}}}function aLe(t,e,n,r){if(r!=="get"||Hb(Jm,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName)||t===null||e===null)return;const i=this.getCellType(t,e);if(i==="VALUE"||i==="EMPTY"){n.value=BHe(n.value);return}const s={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(t),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(e),sheet:this.sheetId};let a=this.engine.getCellValue(s);const u=this.hot.getCellMeta(t,e,{skipMetaExtension:!0});u.type==="date"&&Vl(a)&&(a=_te(a,u.dateFormat)),n.value=typeof a=="object"&&a!==null?a.value:a}function lLe(t,e,n,r){if(r!=="get"||Hb(Jm,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t),s=this.hot.propToCol(e);if(i===null||s===null)return;const a=this.getCellType(i,s);if(a==="VALUE"||a==="EMPTY")return;const u=this.engine.getSheetDimensions(this.engine.getSheetId(this.sheetName));if(u.width===0&&u.height===0)return;const h={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),sheet:this.sheetId};n.value=this.engine.getCellSerialized(h)}function Ate(t,e){if(hC(e))return;const n=[],r=[],i=this.engine.batch(()=>{t.forEach(s=>{let[a,u,,h]=s;const m=this.hot.propToCol(u),g=this.hot.toPhysicalRow(a),y=this.hot.toPhysicalColumn(m),x={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(a),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(m),sheet:this.sheetId};h=kr(Ar,this,jte).call(this,g,y,h),g!==null&&y!==null?this.syncChangeWithEngine(a,m,h):n.push([a,m,h]),r.push({address:x})})});n.length&&this.hot.addHookOnce("afterChange",()=>{const s=this.engine.batch(()=>{n.forEach(a=>{let[u,h,m]=a;this.syncChangeWithEngine(u,h,m)})});this.renderDependentSheets(s,!0)}),this.renderDependentSheets(i),this.validateDependentCells(i,r)}function cLe(t,e){if(hC(e))return;const n=[],r=[];t.forEach(i=>{let[s,a,,u]=i;const h=this.hot.propToCol(a);if(!Vl(h))return;const m={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(s),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(h),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(m)){Yn(`Not possible to set source cell data at ${JSON.stringify(m)}`);return}r.push({address:m}),n.push(...this.engine.setCellContents(m,u))}),this.renderDependentSheets(n),this.validateDependentCells(n,r)}function uLe(t,e){let n=this.rowAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countRows()&&(n=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddRows(this.sheetId,[n,e]))return!1}function dLe(t,e){let n=this.columnAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countCols()&&(n=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddColumns(this.sheetId,[n,e]))return!1}function hLe(t,e,n){return this.rowAxisSyncer.setRemovedHfIndexes(n).every(s=>this.engine.isItPossibleToRemoveRows(this.sheetId,[s,1]))===!1?!1:void 0}function fLe(t,e,n){return this.columnAxisSyncer.setRemovedHfIndexes(n).every(s=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[s,1]))===!1?!1:void 0}function mLe(t,e,n){if(hC(n))return;const r=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function pLe(t,e,n){if(hC(n))return;const r=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function gLe(t,e,n,r){if(hC(r))return;const i=this.rowAxisSyncer.getRemovedHfIndexes().sort((a,u)=>u-a),s=this.engine.batch(()=>{i.forEach(a=>{this.engine.removeRows(this.sheetId,[a,1])})});this.renderDependentSheets(s)}function vLe(t,e,n,r){if(hC(r))return;const i=this.columnAxisSyncer.getRemovedHfIndexes().sort((a,u)=>u-a),s=this.engine.batch(()=>{i.forEach(a=>{this.engine.removeColumns(this.sheetId,[a,1])})});this.renderDependentSheets(s)}function bLe(t,e,n){var r;ev(Jm,this,!0);const i=kr(Ar,this,oE).call(this,n,0,n+(((r=e.__children)===null||r===void 0?void 0:r.length)||0),this.hot.countSourceCols());ev(Jm,this,!1),i.forEach((s,a)=>{s.forEach((u,h)=>{this.engine.setCellContents({col:h,row:n+a,sheet:this.sheetId},[[u]])})})}function yLe(t){this.hot.runHooks("afterFormulasValuesUpdate",t)}function xLe(t,e){this.hot.runHooks("afterNamedExpressionAdded",t,e)}function wLe(t,e){this.hot.runHooks("afterNamedExpressionRemoved",t,e)}function CLe(t){this.hot.runHooks("afterSheetAdded",t)}function SLe(t,e){kr(Ar,this,sE).call(this,e),this.hot.runHooks("afterSheetRenamed",t,e)}function RLe(t,e){this.hot.runHooks("afterSheetRemoved",t,e)}function _Le(t){return{key:"hidden_columns_hide",name(){const e=this.getSelectedActive();let n=0;if(Array.isArray(e)){const[,r,,i]=e;r-i!==0&&(n=1)}return this.getTranslatedPhrase(Q5,n)},callback(){const{from:e,to:n}=this.getSelectedRangeActive(),r=Math.max(Math.min(e.col,n.col),0),i=Math.max(e.col,n.col),s=[];for(let h=r;h<=i;h+=1)s.push(h);t.hideColumns(s);const a=s[s.length-1],u=this.columnIndexMapper.getNearestNotHiddenIndex(a,1,!0);Number.isInteger(u)&&u>=0?this.selectColumns(u):this.deselectCell(),this.view.adjustElementsSize(),this.render()},disabled:!1,hidden(){return!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())}}}function ELe(t){const e=[];return{key:"hidden_columns_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(Z5,n)},callback(){var n,r;if(e.length===0)return;let i=e[0],s=e[e.length-1];i=(n=this.columnIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&n!==void 0?n:0,s=(r=this.columnIndexMapper.getNearestNotHiddenIndex(s+1,1))!==null&&r!==void 0?r:this.countCols()-1,t.showColumns(e),this.view.adjustElementsSize(),this.render(),s-i+1===this.countCols()||this.selectColumns(i,s)},disabled:!1,hidden(){const n=di(t.getHiddenColumns(),y=>this.toPhysicalColumn(y));if(!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())||n.length<1)return!0;e.length=0;const r=this.getSelectedRangeActive(),i=r.getTopStartCorner().col,s=r.getBottomEndCorner().col,a=this.columnIndexMapper,u=a.getRenderableFromVisualIndex(i),h=a.getRenderableFromVisualIndex(s),m=a.getNotTrimmedIndexes(),g=[];if(i!==s){const y=s-i+1,x=h-u+1;if(y>x){const C=m.slice(i,s+1);g.push(...C.filter(E=>n.includes(E)))}}else if(u===0&&u<i)g.push(...m.slice(0,i));else if(u===null)g.push(...m.slice(0,this.countCols()));else{const y=this.countCols()-1,x=a.getRenderableFromVisualIndex(a.getNearestNotHiddenIndex(y,-1));h===x&&y>s&&g.push(...m.slice(s+1))}return Te(g,y=>{e.push(this.toVisualColumn(y))}),e.length===0}}}function NLe(t,e){Ote(t,e),e.add(t)}function kLe(t,e,n){Ote(t,e),e.set(t,n)}function Ote(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Lb(t,e){return t.get(tv(t,e))}function Ite(t,e,n){return t.set(tv(t,e),n),n}function tv(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}un.getSingleton().register("beforeHideColumns"),un.getSingleton().register("afterHideColumns"),un.getSingleton().register("beforeUnhideColumns"),un.getSingleton().register("afterUnhideColumns");const Dte="hiddenColumns",TLe=310;var hf=new WeakMap,$b=new WeakSet;class jLe extends Zr{constructor(){super(...arguments),NLe(this,$b),kLe(this,hf,null)}static get PLUGIN_KEY(){return Dte}static get PLUGIN_PRIORITY(){return TLe}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,columns:[]}}isEnabled(){return!!this.hot.getSettings()[Dte]}enablePlugin(){var e=this;this.enabled||(Ite(hf,this,new tj),Lb(hf,this).addLocalHook("init",()=>tv($b,this,DLe).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,Lb(hf,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return tv($b,e,ILe).call(e,...r)}),this.addHook("afterGetCellMeta",(n,r,i)=>tv($b,this,PLe).call(this,n,r,i)),this.addHook("modifyColWidth",(n,r)=>tv($b,this,MLe).call(this,n,r),2),this.addHook("afterGetColHeader",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return tv($b,e,OLe).call(e,...r)}),this.addHook("modifyCopyableRange",n=>tv($b,this,ALe).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.columnIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showColumns(e){const n=this.getHiddenColumns(),r=this.isValidConfig(e);let i=n;const s=Lb(hf,this).getValues().slice(),a=e.length>0;if(r&&a){const h=e.map(m=>this.hot.toPhysicalColumn(m));Te(h,m=>{s[m]=!1}),i=xc(s,(m,g,y)=>(g&&m.push(this.hot.toVisualColumn(y)),m),[])}this.hot.runHooks("beforeUnhideColumns",n,i,r&&a)!==!1&&(r&&a&&Lb(hf,this).setValues(s),this.hot.view.adjustElementsSize(),this.hot.runHooks("afterUnhideColumns",n,i,r&&a,r&&i.length<n.length))}showColumn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.showColumns(n)}hideColumns(e){const n=this.getHiddenColumns(),r=this.isValidConfig(e);let i=n;r&&(i=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeHideColumns",n,i,r)!==!1&&(r&&this.hot.batchExecution(()=>{Te(e,a=>{Lb(hf,this).setValueAtIndex(this.hot.toPhysicalColumn(a),!0)})},!0),this.hot.runHooks("afterHideColumns",n,i,r,r&&i.length>n.length))}hideColumn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.hideColumns(n)}getHiddenColumns(){return di(Lb(hf,this).getHiddenIndexes(),e=>this.hot.toVisualColumn(e))}isHidden(e){return Lb(hf,this).getValueAtIndex(this.hot.toPhysicalColumn(e))||!1}isValidConfig(e){const n=this.hot.countCols();return Array.isArray(e)&&e.length>0?e.every(r=>Number.isInteger(r)&&r>=0&&r<n):!1}resetCellsMeta(){Te(this.hot.getCellsMeta(),e=>{e.skipColumnOnPaste=!1})}destroy(){Ite(hf,this,null),super.destroy()}}function MLe(t,e){if(this.isHidden(e))return 0;if(this.getSetting("indicators")&&(this.isHidden(e+1)||this.isHidden(e-1))&&typeof t=="number"&&this.hot.hasColHeaders())return t+15}function PLe(t,e,n){if(this.getSetting("copyPasteEnabled")===!1&&this.isHidden(e)&&(n.skipColumnOnPaste=!0),this.isHidden(e-1))n.className=n.className||"",n.className.indexOf("afterHiddenColumn")===-1&&(n.className+=" afterHiddenColumn");else if(n.className){const r=n.className.split(" ");if(r.length>0){const i=r.indexOf("afterHiddenColumn");i>-1&&r.splice(i,1),n.className=r.join(" ")}}}function ALe(t){if(this.getSetting("copyPasteEnabled"))return t;const e=[],n=(r,i,s,a)=>{e.push({startRow:r,endRow:i,startCol:s,endCol:a})};return Te(t,r=>{let i=!0,s=0;En(r.startCol,r.endCol,a=>{this.isHidden(a)?(i||n(r.startRow,r.endRow,s,a-1),i=!0):(i&&(s=a),a===r.endCol&&n(r.startRow,r.endRow,s,a),i=!1)})}),e}function OLe(t,e){if(!this.getSetting("indicators")||t<0)return;const n=[];t>=1&&this.isHidden(t-1)&&n.push("afterHiddenColumn"),t<this.hot.countCols()-1&&this.isHidden(t+1)&&n.push("beforeHiddenColumn"),st(e,n)}function ILe(t){t.items.push({name:Xn},_Le(this),ELe(this))}function DLe(){const t=this.getSetting("columns");Array.isArray(t)&&this.hideColumns(t)}function HLe(t){return{key:"hidden_rows_hide",name(){const e=this.getSelectedActive();let n=0;if(Array.isArray(e)){const[r,,i]=e;r-i!==0&&(n=1)}return this.getTranslatedPhrase(J5,n)},callback(){const{from:e,to:n}=this.getSelectedRangeActive(),r=Math.max(Math.min(e.row,n.row),0),i=Math.max(e.row,n.row),s=[];for(let h=r;h<=i;h+=1)s.push(h);t.hideRows(s);const a=s[s.length-1],u=this.rowIndexMapper.getNearestNotHiddenIndex(a,1,!0);Number.isInteger(u)&&u>=0?this.selectRows(u):this.deselectCell(),this.view.adjustElementsSize(),this.render()},disabled:!1,hidden(){return!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())}}}function LLe(t){const e=[];return{key:"hidden_rows_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(e4,n)},callback(){var n,r;if(e.length===0)return;let i=e[0],s=e[e.length-1];i=(n=this.rowIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&n!==void 0?n:0,s=(r=this.rowIndexMapper.getNearestNotHiddenIndex(s+1,1))!==null&&r!==void 0?r:this.countRows()-1,t.showRows(e),this.view.adjustElementsSize(),this.render(),s-i+1===this.countRows()||this.selectRows(i,s)},disabled:!1,hidden(){const n=di(t.getHiddenRows(),y=>this.toPhysicalRow(y));if(!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())||n.length<1)return!0;e.length=0;const r=this.getSelectedRangeActive(),i=r.getTopStartCorner().row,s=r.getBottomEndCorner().row,a=this.rowIndexMapper,u=a.getRenderableFromVisualIndex(i),h=a.getRenderableFromVisualIndex(s),m=a.getNotTrimmedIndexes(),g=[];if(i!==s){const y=s-i+1,x=h-u+1;if(y>x){const C=m.slice(i,s+1);g.push(...C.filter(E=>n.includes(E)))}}else if(u===0&&u<i)g.push(...m.slice(0,i));else if(u===null)g.push(...m.slice(0,this.countRows()));else{const y=this.countRows()-1,x=a.getRenderableFromVisualIndex(a.getNearestNotHiddenIndex(y,-1));h===x&&y>s&&g.push(...m.slice(s+1))}return Te(g,y=>{e.push(this.toVisualRow(y))}),e.length===0}}}function $Le(t,e){Hte(t,e),e.add(t)}function FLe(t,e,n){Hte(t,e),e.set(t,n)}function Hte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fb(t,e){return t.get(nv(t,e))}function Lte(t,e,n){return t.set(nv(t,e),n),n}function nv(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}un.getSingleton().register("beforeHideRows"),un.getSingleton().register("afterHideRows"),un.getSingleton().register("beforeUnhideRows"),un.getSingleton().register("afterUnhideRows");const $te="hiddenRows",zLe=320;var ff=new WeakMap,zb=new WeakSet;class VLe extends Zr{constructor(){super(...arguments),$Le(this,zb),FLe(this,ff,null)}static get PLUGIN_KEY(){return $te}static get PLUGIN_PRIORITY(){return zLe}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,rows:[]}}isEnabled(){return!!this.hot.getSettings()[$te]}enablePlugin(){var e=this;this.enabled||(Lte(ff,this,new tj),Fb(ff,this).addLocalHook("init",()=>nv(zb,this,KLe).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,Fb(ff,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return nv(zb,e,GLe).call(e,...r)}),this.addHook("afterGetCellMeta",(n,r,i)=>nv(zb,this,WLe).call(this,n,r,i)),this.addHook("modifyRowHeight",(n,r)=>nv(zb,this,BLe).call(this,n,r)),this.addHook("afterGetRowHeader",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return nv(zb,e,YLe).call(e,...r)}),this.addHook("modifyCopyableRange",n=>nv(zb,this,ULe).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.rowIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showRows(e){const n=this.getHiddenRows(),r=this.isValidConfig(e);let i=n;const s=Fb(ff,this).getValues().slice(),a=e.length>0;if(r&&a){const h=e.map(m=>this.hot.toPhysicalRow(m));Te(h,m=>{s[m]=!1}),i=xc(s,(m,g,y)=>(g&&m.push(this.hot.toVisualRow(y)),m),[])}this.hot.runHooks("beforeUnhideRows",n,i,r&&a)!==!1&&(r&&a&&Fb(ff,this).setValues(s),this.hot.runHooks("afterUnhideRows",n,i,r&&a,r&&i.length<n.length))}showRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.showRows(n)}hideRows(e){const n=this.getHiddenRows(),r=this.isValidConfig(e);let i=n;r&&(i=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeHideRows",n,i,r)!==!1&&(r&&this.hot.batchExecution(()=>{Te(e,a=>{Fb(ff,this).setValueAtIndex(this.hot.toPhysicalRow(a),!0)})},!0),this.hot.runHooks("afterHideRows",n,i,r,r&&i.length>n.length))}hideRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.hideRows(n)}getHiddenRows(){return di(Fb(ff,this).getHiddenIndexes(),e=>this.hot.toVisualRow(e))}isHidden(e){return Fb(ff,this).getValueAtIndex(this.hot.toPhysicalRow(e))||!1}isValidConfig(e){const n=this.hot.countRows();return Array.isArray(e)&&e.length>0?e.every(r=>Number.isInteger(r)&&r>=0&&r<n):!1}resetCellsMeta(){Te(this.hot.getCellsMeta(),e=>{e.skipRowOnPaste=!1})}destroy(){Lte(ff,this,null),super.destroy()}}function BLe(t,e){return this.isHidden(e)?0:t}function WLe(t,e,n){if(this.getSetting("copyPasteEnabled")===!1&&this.isHidden(t)&&(n.skipRowOnPaste=!0),this.isHidden(t-1))n.className=n.className||"",n.className.indexOf("afterHiddenRow")===-1&&(n.className+=" afterHiddenRow");else if(n.className){const r=n.className.split(" ");if(r.length>0){const i=r.indexOf("afterHiddenRow");i>-1&&r.splice(i,1),n.className=r.join(" ")}}}function ULe(t){if(this.getSetting("copyPasteEnabled"))return t;const e=[],n=(r,i,s,a)=>{e.push({startRow:r,endRow:i,startCol:s,endCol:a})};return Te(t,r=>{let i=!0,s=0;En(r.startRow,r.endRow,a=>{this.isHidden(a)?(i||n(s,a-1,r.startCol,r.endCol),i=!0):(i&&(s=a),a===r.endRow&&n(s,a,r.startCol,r.endCol),i=!1)})}),e}function YLe(t,e){if(!this.getSetting("indicators")||t<0)return;const n=[];t>=1&&this.isHidden(t-1)&&n.push("afterHiddenRow"),t<this.hot.countRows()-1&&this.isHidden(t+1)&&n.push("beforeHiddenRow"),st(e,n)}function GLe(t){t.items.push({name:Xn},HLe(this),LLe(this))}function KLe(){const t=this.getSetting("rows");Array.isArray(t)&&this.hideRows(t)}function qLe(t){return{key:"freeze_column",name(){return this.getTranslatedPhrase(N5)},callback(e,n){const[{start:{col:r}}]=n;t.freezeColumn(r),this.view.adjustElementsSize(),this.render()},hidden(){const e=this.getSelectedRange();let n=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col<=this.getSettings().fixedColumnsStart-1)&&(n=!0),n}}}function XLe(t){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(k5)},callback(e,n){const[{start:{col:r}}]=n;t.unfreezeColumn(r),this.view.adjustElementsSize(),this.render()},hidden(){const e=this.getSelectedRange();let n=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col>=this.getSettings().fixedColumnsStart)&&(n=!0),n}}}function QLe(t,e){Fte(t,e),e.add(t)}function ZLe(t,e,n){Fte(t,e),e.set(t,n)}function Fte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function HV(t,e){return t.get(BP(t,e))}function LV(t,e,n){return t.set(BP(t,e),n),n}function BP(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}un.getSingleton().register("beforeColumnFreeze"),un.getSingleton().register("afterColumnFreeze"),un.getSingleton().register("beforeColumnUnfreeze"),un.getSingleton().register("afterColumnUnfreeze");const zte="manualColumnFreeze",JLe=110;var Vb=new WeakMap,$V=new WeakSet;class e5e extends Zr{constructor(){super(...arguments),QLe(this,$V),ZLe(this,Vb,!1)}static get PLUGIN_KEY(){return zte}static get PLUGIN_PRIORITY(){return JLe}isEnabled(){return!!this.hot.getSettings()[zte]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>BP($V,this,t5e).call(this,e)),this.addHook("beforeColumnMove",(e,n)=>BP($V,this,n5e).call(this,e,n)),super.enablePlugin())}disablePlugin(){LV(Vb,this,!1),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}freezeColumn(e){const n=this.hot.getSettings(),r=n.fixedColumnsStart<this.hot.countCols()&&e>n.fixedColumnsStart-1;HV(Vb,this)||LV(Vb,this,!0),this.hot.runHooks("beforeColumnFreeze",e,r)!==!1&&(r&&(this.hot.columnIndexMapper.moveIndexes(e,n.fixedColumnsStart),n._fixedColumnsStart+=1),this.hot.runHooks("afterColumnFreeze",e,r))}unfreezeColumn(e){const n=this.hot.getSettings(),r=n.fixedColumnsStart>0&&e<=n.fixedColumnsStart-1;HV(Vb,this)||LV(Vb,this,!0),this.hot.runHooks("beforeColumnUnfreeze",e,r)!==!1&&(r&&(n._fixedColumnsStart-=1,this.hot.columnIndexMapper.moveIndexes(e,n.fixedColumnsStart)),this.hot.runHooks("afterColumnUnfreeze",e,r))}}function t5e(t){t.items.push({name:"---------"},qLe(this),XLe(this))}function n5e(t,e){if(HV(Vb,this)){const n=this.hot.getSettings().fixedColumnsStart;if(e<n||t.some(r=>r<n))return!1}}function WP(t,e,n){return(e=r5e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r5e(t){var e=i5e(t,"string");return typeof e=="symbol"?e:e+""}function i5e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const FV=0,Vte=1,Bte=2,fC="px";let Wte=class{constructor(e){WP(this,"hot",void 0),WP(this,"_element",null),WP(this,"state",FV),WP(this,"inlineProperty",void 0),this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}appendTo(e){e.appendChild(this._element),this.state=Bte}build(){this.state===FV&&(this._element=this.hot.rootDocument.createElement("div"),this.state=Vte)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=FV}isAppended(){return this.state===Bte}isBuilt(){return this.state>=Vte}setPosition(e,n){Vl(e)&&(this._element.style.top=e+fC),Vl(n)&&(this._element.style[this.inlineProperty]=n+fC)}getPosition(){const e=this._element.style;return{top:e.top?parseInt(e.top,10):0,start:e[this.inlineProperty]?parseInt(e[this.inlineProperty],10):0}}setSize(e,n){Vl(e)&&(this._element.style.width=e+fC),Vl(n)&&(this._element.style.height=n+fC)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,n){Vl(e)&&(this._element.style.marginTop=e+fC),Vl(n)&&(this._element.style[`margin${Hd(this.inlineProperty)}`]=n+fC)}getOffset(){const e=this._element.style,n=`margin${Hd(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[n]?parseInt(e[n],10):0}}};const s5e="ht__manualColumnMove--backlight";let o5e=class extends Wte{build(){super.build(),st(this._element,s5e)}};const a5e="ht__manualColumnMove--guideline";let l5e=class extends Wte{build(){super.build(),st(this._element,a5e)}};function c5e(t,e){Ute(t,e),e.add(t)}function sh(t,e,n){Ute(t,e),e.set(t,n)}function Ute(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ic(t,e,n){return t.set(rv(t,e),n),n}function Cn(t,e){return t.get(rv(t,e))}function rv(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}un.getSingleton().register("beforeColumnMove"),un.getSingleton().register("afterColumnMove");const zV="manualColumnMove",u5e=120,Yte="ht__manualColumnMove",UP="show-ui",VV="on-moving--columns",BV="after-selection--columns";var ql=new WeakMap,iv=new WeakMap,ep=new WeakMap,YP=new WeakMap,sv=new WeakMap,Xl=new WeakMap,GP=new WeakMap,fd=new WeakMap,mC=new WeakMap,KP=new WeakMap,aE=new WeakMap,Bb=new WeakSet;class d5e extends Zr{constructor(){super(...arguments),c5e(this,Bb),sh(this,ql,new o5e(this.hot)),sh(this,iv,new l5e(this.hot)),sh(this,ep,[]),sh(this,YP,0),sh(this,sv,!1),sh(this,Xl,{}),sh(this,GP,void 0),sh(this,fd,void 0),sh(this,mC,void 0),sh(this,KP,void 0),sh(this,aE,void 0)}static get PLUGIN_KEY(){return zV}static get PLUGIN_PRIORITY(){return u5e}isEnabled(){return!!this.hot.getSettings()[zV]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rv(Bb,e,h5e).call(e,...r)}),this.addHook("beforeOnCellMouseOver",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rv(Bb,e,m5e).call(e,...r)}),this.addHook("afterScrollVertically",()=>rv(Bb,this,g5e).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rv(Bb,e,v5e).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),st(this.hot.rootElement,Yte),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){cn(this.hot.rootElement,Yte),this.unregisterEvents(),Cn(ql,this).destroy(),Cn(iv,this).destroy(),super.disablePlugin()}moveColumn(e,n){return this.moveColumns([e],n)}moveColumns(e,n){const r=Cn(GP,this),i=this.isMovePossible(e,n),s=this.hot.runHooks("beforeColumnMove",e,n,r,i);if(Ic(GP,this,void 0),s===!1)return;i&&this.hot.columnIndexMapper.moveIndexes(e,n);const a=i&&this.isColumnOrderChanged(e,n);return this.hot.runHooks("afterColumnMove",e,n,r,i,a),a}dragColumn(e,n){return this.dragColumns([e],n)}dragColumns(e,n){const r=this.countFinalIndex(e,n);return Ic(GP,this,n),this.moveColumns(e,r)}isMovePossible(e,n){const r=this.hot.columnIndexMapper.getNotTrimmedIndexesLength(),i=e.length+n>r,s=n<0,a=e.some(h=>h<0),u=e.some(h=>h>=r);return!(i||s||a||u)}isColumnOrderChanged(e,n){return e.some((r,i)=>r-i!==n)}countFinalIndex(e,n){const r=xc(e,(i,s)=>(s<n&&(i+=1),i),0);return n-r}getColumnsWidth(e,n){const r=this.hot.columnIndexMapper;let i=0;for(let s=e;s<=n;s+=1){const a=r.getRenderableFromVisualIndex(s);s<0?i+=this.hot.view._wt.wtViewport.getRowHeaderWidth()||0:a!==null&&(i+=this.hot.view._wt.wtTable.getColumnWidth(a)||0)}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[zV];Array.isArray(e)&&this.moveColumns(e,0)}isFixedColumnsStart(e){return e<this.hot.getSettings().fixedColumnsStart}prepareColumnsToMoving(e,n){const r=[];return En(e,n,i=>{r.push(i)}),r}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(Cn(fd,this))&&e>0&&this.hot.scrollViewportTo({col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(e-1,-1)});const n=this.hot.view._wt.wtTable,r=this.hot.view._wt.wtOverlays.scrollableElement,i=typeof r.scrollX=="number"?r.scrollX:r.scrollLeft;let s=this.hot.view.THEAD.offsetLeft+this.getColumnsWidth(0,Cn(fd,this)-1);const a=n.hider.offsetWidth,u=n.TBODY.offsetLeft,h=Cn(ql,this).getOffset().start,m=Cn(ql,this).getSize().width;let g=0,y=0;if(this.hot.isRtl()){const E=this.hot.rootWindow,M=po(this.hot.rootElement),j=E.innerWidth-Cn(mC,this)-M;y=E.innerWidth-Cn(Xl,this).eventPageX-j-(r.scrollX===void 0?i:0)}else y=Cn(Xl,this).eventPageX-(Cn(mC,this)-(r.scrollX===void 0?i:0));if(Cn(KP,this)&&(g=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(Cn(fd,this))&&(s+=i),s+=g,Cn(fd,this)<0)Cn(aE,this)>0?Cn(Xl,this).col=0:Cn(Xl,this).col=e>0?e-1:e;else if(Cn(Xl,this).TD.offsetWidth/2+s<=y){const E=Cn(fd,this)>=Cn(YP,this)?Cn(YP,this)-1:Cn(fd,this);Cn(Xl,this).col=E+1,s+=Cn(Xl,this).TD.offsetWidth}else Cn(Xl,this).col=Cn(fd,this);let x=y,C=s;y+m+h>=a?x=a-m-h:y+h<u+g&&(x=u+g+Math.abs(h)),s>=a-1?C=a-1:C===0?C=1:r.scrollX!==void 0&&Cn(fd,this)<Cn(aE,this)&&(C-=Cn(mC,this)<=r.scrollX?Cn(mC,this):0),Cn(ql,this).setPosition(null,x),Cn(iv,this).setPosition(null,C)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>rv(Bb,this,f5e).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>rv(Bb,this,p5e).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){Cn(ql,this).build(),Cn(iv,this).build()}destroy(){Cn(ql,this).destroy(),Cn(iv,this).destroy(),super.destroy()}}function h5e(t,e,n,r){const i=this.hot.view._wt.wtTable,s=this.hot.selection.isSelectedByColumnHeader(),a=this.hot.getSelectedRangeActive(),u=Dn(t.target,"sortAction");if(!a||!s||Cn(sv,this)||t.button!==0||u){Ic(sv,this,!1),Cn(ep,this).length=0,cn(this.hot.rootElement,[VV,UP]);return}const h=Cn(iv,this).isBuilt()&&!Cn(iv,this).isAppended(),m=Cn(ql,this).isBuilt()&&!Cn(ql,this).isAppended();h&&m&&(Cn(iv,this).appendTo(i.hider),Cn(ql,this).appendTo(i.hider));const{from:g,to:y}=a,x=Math.min(g.col,y.col),C=Math.max(g.col,y.col);if(e.row<0&&e.col>=x&&e.col<=C){r.column=!0,Ic(sv,this,!0);const E=n.firstChild?Qpe(t,n.firstChild).x:t.offsetX;Cn(Xl,this).eventPageX=t.pageX,Ic(fd,this,e.col),Cn(Xl,this).TD=n,Cn(Xl,this).col=e.col,Ic(ep,this,this.prepareColumnsToMoving(x,C)),Ic(KP,this,!!this.hot.getSettings().rowHeaders),Ic(YP,this,this.hot.countCols()),Ic(aE,this,this.hot.getSettings().fixedColumnsStart),Ic(mC,this,sl(this.hot.rootElement).left);const M=Cn(KP,this)?-1:0,j=i.holder.scrollTop+i.getColumnHeaderHeight(0)+1,L=e.col<Cn(aE,this),D=this.hot.view._wt.wtOverlays.inlineStartOverlay.getOverlayOffset(),z=Math.abs(E-(this.hot.isRtl()?n.offsetWidth:0)),H=this.getColumnsWidth(x,e.col-1)+z,V=this.getColumnsWidth(M,x-1)+(L?D:0)+H;Cn(ql,this).setPosition(j,V),Cn(ql,this).setSize(this.getColumnsWidth(x,C),i.hider.offsetHeight-j),Cn(ql,this).setOffset(null,-H),st(this.hot.rootElement,VV)}else cn(this.hot.rootElement,BV),Ic(sv,this,!1),Cn(ep,this).length=0}function f5e(t){Cn(sv,this)&&(Cn(Xl,this).eventPageX=t.pageX,this.refreshPositions())}function m5e(t,e,n,r){!this.hot.getSelectedRangeActive()||!Cn(sv,this)||(Cn(ep,this).indexOf(e.col)>-1?cn(this.hot.rootElement,UP):st(this.hot.rootElement,UP),r.row=!0,r.column=!0,r.cell=!0,Ic(fd,this,e.col),Cn(Xl,this).TD=n)}function p5e(){const t=Cn(Xl,this).col,e=Cn(ep,this).length;if(Ic(fd,this,void 0),Ic(sv,this,!1),cn(this.hot.rootElement,[VV,UP,BV]),this.hot.selection.isSelectedByColumnHeader()&&st(this.hot.rootElement,BV),e<1||t===void 0)return;const n=Cn(ep,this)[0],r=this.hot.toPhysicalColumn(n),i=this.dragColumns(Cn(ep,this),t);if(Cn(ep,this).length=0,i===!0){this.hot.view.adjustElementsSize(),this.hot.render();const s=this.hot.toVisualColumn(r),a=s+e-1;this.hot.selectColumns(s,a)}}function g5e(){const t=this.hot.view._wt.wtTable,e=t.getColumnHeaderHeight(0)+1,n=t.holder.scrollTop,r=e+n;Cn(ql,this).setPosition(r),Cn(ql,this).setSize(null,t.hider.offsetHeight-r)}function v5e(){this.moveBySettingsOrLoad()}function b5e(t,e){Gte(t,e),e.add(t)}function pl(t,e,n){Gte(t,e),e.set(t,n)}function Gte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function eo(t,e,n){return t.set(oh(t,e),n),n}function rn(t,e){return t.get(oh(t,e))}function oh(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const qP="manualColumnResize",y5e=130;var tp=new WeakMap,XP=new WeakMap,wu=new WeakMap,QP=new WeakMap,mf=new WeakMap,x5e=new WeakMap,pC=new WeakMap,ZP=new WeakMap,Dc=new WeakMap,np=new WeakMap,Wb=new WeakMap,JP=new WeakMap,gC=new WeakMap,lE=new WeakMap,ah=new WeakMap,cE=new WeakMap,pf=new WeakSet;class w5e extends Zr{static get PLUGIN_KEY(){return qP}static get PLUGIN_PRIORITY(){return y5e}constructor(e){super(e),b5e(this,pf),pl(this,tp,null),pl(this,XP,null),pl(this,wu,[]),pl(this,QP,null),pl(this,mf,null),pl(this,x5e,null),pl(this,pC,null),pl(this,ZP,null),pl(this,Dc,this.hot.rootDocument.createElement("DIV")),pl(this,np,this.hot.rootDocument.createElement("DIV")),pl(this,Wb,null),pl(this,JP,!1),pl(this,gC,0),pl(this,lE,null),pl(this,ah,void 0),pl(this,cE,void 0),st(rn(Dc,this),"manualColumnResizer"),st(rn(np,this),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[qP]}enablePlugin(){var e=this;this.enabled||(eo(ah,this,new Ng),rn(ah,this).addLocalHook("init",()=>oh(pf,this,C5e).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,rn(ah,this)),this.addHook("modifyColWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return oh(pf,e,k5e).call(e,...r)},1),this.addHook("beforeStretchingColumnWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return oh(pf,e,T5e).call(e,...r)},1),this.addHook("beforeColumnResize",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return oh(pf,e,j5e).call(e,...r)}),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){eo(cE,this,rn(ah,this).getValues()),this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}setManualSize(e,n){const r=Math.max(n,20),i=this.hot.toPhysicalColumn(e);return rn(ah,this).setValueAtIndex(i,r),r}clearManualSize(e){const n=this.hot.toPhysicalColumn(e);rn(ah,this).setValueAtIndex(n,null)}setupHandlePosition(e){if(!e.parentNode||rn(gC,this)>1)return;eo(tp,this,e);const{_wt:n}=this.hot.view,r=n.wtTable.getCoords(rn(tp,this)),i=r.col;if(i<0)return;const s=Po(rn(tp,this)),a=rn(tp,this).getBoundingClientRect(),u=i<n.getSetting("fixedColumnsStart");let h;u&&(h=n.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(rn(tp,this),r.row,r.col)),h||(h=n.wtOverlays.topOverlay.getRelativeCellPosition(rn(tp,this),r.row,r.col)),eo(XP,this,this.hot.columnIndexMapper.getVisualFromRenderableIndex(i)),eo(wu,this,[]);const m=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByColumnHeader();if(this.hot.selection.isSelected()&&m){const g=this.hot.getSelectedRange();Te(g,y=>{const x=y.getTopStartCorner().col,C=y.getBottomEndCorner().col;En(x,C,E=>{rn(wu,this).includes(E)||rn(wu,this).push(E)})})}rn(wu,this).includes(rn(XP,this))||eo(wu,this,[rn(XP,this)]),eo(ZP,this,h.start-6),eo(pC,this,parseInt(a.width,10)),rn(Dc,this).style.top=`${h.top}px`,rn(Dc,this).style[this.inlineDir]=`${rn(ZP,this)+rn(pC,this)}px`,rn(Dc,this).style.height=`${s}px`,this.hot.rootElement.appendChild(rn(Dc,this))}refreshHandlePosition(){rn(Dc,this).style[this.inlineDir]=`${rn(ZP,this)+rn(QP,this)}px`}setupGuidePosition(){const e=parseInt(Po(rn(Dc,this)),10),n=parseInt(rn(Dc,this).style.top,10)+e,r=this.hot.view.getTableHeight();st(rn(Dc,this),"active"),st(rn(np,this),"active"),rn(np,this).style.top=`${n}px`,this.refreshGuidePosition(),rn(np,this).style.height=`${r-e}px`,this.hot.rootElement.appendChild(rn(np,this))}refreshGuidePosition(){rn(np,this).style[this.inlineDir]=rn(Dc,this).style[this.inlineDir]}hideHandleAndGuide(){cn(rn(Dc,this),"active"),cn(rn(np,this),"active")}checkIfColumnHeader(e){const n=k0(e,["THEAD"],this.hot.rootElement),{topOverlay:r,topInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;return[r.clone.wtTable.THEAD,i.clone.wtTable.THEAD].includes(n)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}afterMouseDownTimeout(){const e=()=>{this.hot.view.adjustElementsSize(),this.hot.render()},n=(r,i)=>{const s=this.hot.runHooks("beforeColumnResize",rn(mf,this),r,!0);s!==void 0&&eo(mf,this,s),this.setManualSize(r,rn(mf,this)),this.hot.runHooks("afterColumnResize",rn(mf,this),r,!0),i&&e()};rn(gC,this)>=2&&(rn(wu,this).length>1?(Te(rn(wu,this),i=>{n(i)}),e()):Te(rn(wu,this),i=>{n(i,!0)})),eo(gC,this,0),eo(lE,this,null)}bindEvents(){const{rootWindow:e,rootElement:n}=this.hot;this.eventManager.addEventListener(n,"mouseover",r=>oh(pf,this,S5e).call(this,r)),this.eventManager.addEventListener(n,"mousedown",r=>oh(pf,this,R5e).call(this,r)),this.eventManager.addEventListener(e,"mousemove",r=>oh(pf,this,_5e).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>oh(pf,this,E5e).call(this)),this.eventManager.addEventListener(rn(Dc,this),"contextmenu",()=>oh(pf,this,N5e).call(this))}destroy(){super.destroy()}}function C5e(){const t=this.hot.getSettings()[qP];Array.isArray(t)?(this.hot.batchExecution(()=>{t.forEach((e,n)=>{rn(ah,this).setValueAtIndex(n,e)})},!0),eo(cE,this,t)):t===!0&&Array.isArray(rn(cE,this))&&this.hot.batchExecution(()=>{rn(cE,this).forEach((e,n)=>{rn(ah,this).setValueAtIndex(n,e)})},!0)}function S5e(t){if(!bG(t.target)&&rn(JP,this)!==!0&&this.checkIfColumnHeader(t.target)){const e=this.getClosestTHParent(t.target);if(!e)return;const n=e.getAttribute("colspan");e&&(n===null||n==="1")&&(rn(Wb,this)||this.setupHandlePosition(e))}}function R5e(t){t.target.parentNode===this.hot.rootElement&&Dn(t.target,"manualColumnResizer")&&(this.setupHandlePosition(rn(tp,this)),this.setupGuidePosition(),eo(Wb,this,!0),rn(lE,this)===null&&(eo(lE,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(rn(lE,this))),eo(gC,this,rn(gC,this)+1),this.startX=t.pageX,eo(mf,this,rn(pC,this)))}function _5e(t){if(rn(Wb,this)){const e=(t.pageX-this.startX)*this.hot.getDirectionFactor();eo(QP,this,rn(pC,this)+e),Te(rn(wu,this),n=>{eo(mf,this,this.setManualSize(n,rn(QP,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function E5e(){const t=()=>{this.hot.view.adjustElementsSize(),this.hot.render()},e=(n,r)=>{this.hot.runHooks("beforeColumnResize",rn(mf,this),n,!1),r&&t(),this.hot.runHooks("afterColumnResize",rn(mf,this),n,!1)};rn(Wb,this)&&(this.hideHandleAndGuide(),eo(Wb,this,!1),rn(mf,this)!==rn(pC,this)&&(rn(wu,this).length>1?(Te(rn(wu,this),r=>{e(r)}),t()):Te(rn(wu,this),r=>{e(r,!0)})),this.setupHandlePosition(rn(tp,this)))}function N5e(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(rn(Dc,this)),this.hot.rootElement.removeChild(rn(np,this)),eo(Wb,this,!1),eo(JP,this,!0),this.hot._registerMicrotask(()=>{eo(JP,this,!1)})}function k5e(t,e){let n=t;if(this.enabled){const r=this.hot.toPhysicalColumn(e),i=rn(ah,this).getValueAtIndex(r);this.hot.getSettings()[qP]&&i&&(n=i)}return n}function T5e(t,e){const n=rn(ah,this).getValueAtIndex(this.hot.toPhysicalColumn(e));return typeof n=="number"?n:t}function j5e(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}function WV(t,e,n){return(e=M5e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function M5e(t){var e=P5e(t,"string");return typeof e=="symbol"?e:e+""}function P5e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const UV=0,Kte=1,qte=2,vC="px";let Xte=class{constructor(e){WV(this,"hot",void 0),WV(this,"_element",null),WV(this,"state",UV),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=qte}build(){this.state===UV&&(this._element=this.hot.rootDocument.createElement("div"),this.state=Kte)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=UV}isAppended(){return this.state===qte}isBuilt(){return this.state>=Kte}setPosition(e,n){e!==void 0&&(this._element.style.top=e+vC),n!==void 0&&(this._element.style.left=n+vC)}getPosition(){return{top:this._element.style.top?parseInt(this._element.style.top,10):0,left:this._element.style.left?parseInt(this._element.style.left,10):0}}setSize(e,n){e&&(this._element.style.width=e+vC),n&&(this._element.style.height=n+vC)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,n){e&&(this._element.style.marginTop=e+vC),n&&(this._element.style.marginLeft=n+vC)}getOffset(){return{top:this._element.style.marginTop?parseInt(this._element.style.marginTop,10):0,left:this._element.style.marginLeft?parseInt(this._element.style.marginLeft,10):0}}};const A5e="ht__manualRowMove--backlight";class O5e extends Xte{build(){super.build(),st(this._element,A5e)}}const I5e="ht__manualRowMove--guideline";class D5e extends Xte{build(){super.build(),st(this._element,I5e)}}function H5e(t,e){Qte(t,e),e.add(t)}function bC(t,e,n){Qte(t,e),e.set(t,n)}function Qte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ub(t,e,n){return t.set(ov(t,e),n),n}function mr(t,e){return t.get(ov(t,e))}function ov(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}un.getSingleton().register("beforeRowMove"),un.getSingleton().register("afterRowMove");const YV="manualRowMove",L5e=140,Zte="ht__manualRowMove",eA="show-ui",GV="on-moving--rows",KV="after-selection--rows";var Ql=new WeakMap,av=new WeakMap,rp=new WeakMap,lv=new WeakMap,Hc=new WeakMap,tA=new WeakMap,Yb=new WeakSet;class $5e extends Zr{constructor(){super(...arguments),H5e(this,Yb),bC(this,Ql,new O5e(this.hot)),bC(this,av,new D5e(this.hot)),bC(this,rp,[]),bC(this,lv,void 0),bC(this,Hc,{}),bC(this,tA,void 0)}static get PLUGIN_KEY(){return YV}static get PLUGIN_PRIORITY(){return L5e}isEnabled(){return!!this.hot.getSettings()[YV]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ov(Yb,e,F5e).call(e,...r)}),this.addHook("beforeOnCellMouseOver",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ov(Yb,e,V5e).call(e,...r)}),this.addHook("afterScrollHorizontally",()=>ov(Yb,this,W5e).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ov(Yb,e,U5e).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),st(this.hot.rootElement,Zte),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){cn(this.hot.rootElement,Zte),this.unregisterEvents(),mr(Ql,this).destroy(),mr(av,this).destroy(),super.disablePlugin()}moveRow(e,n){return this.moveRows([e],n)}moveRows(e,n){const r=mr(tA,this),i=this.isMovePossible(e,n),s=this.hot.runHooks("beforeRowMove",e,n,r,i);if(Ub(tA,this,void 0),s===!1)return;i&&this.hot.rowIndexMapper.moveIndexes(e,n);const a=i&&this.isRowOrderChanged(e,n);return this.hot.runHooks("afterRowMove",e,n,r,i,a),a}dragRow(e,n){return this.dragRows([e],n)}dragRows(e,n){const r=this.countFinalIndex(e,n);return Ub(tA,this,n),this.moveRows(e,r)}isMovePossible(e,n){const r=this.hot.rowIndexMapper.getNotTrimmedIndexesLength(),i=e.length+n>r,s=n<0,a=e.some(h=>h<0),u=e.some(h=>h>=r);return!(i||s||a||u)}isRowOrderChanged(e,n){return e.some((r,i)=>r-i!==n)}countFinalIndex(e,n){const r=xc(e,(i,s)=>(s<n&&(i+=1),i),0);return n-r}getRowsHeight(e,n){const r=this.hot.rowIndexMapper;let i=0;for(let s=e;s<=n;s++){const a=r.getRenderableFromVisualIndex(s);a!==null&&(i+=this.hot.view._wt.wtTable.getRowHeight(a)||this.hot.stylesHandler.getDefaultRowHeight())}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[YV];Array.isArray(e)&&this.moveRows(e,0)}isFixedRowTop(e){return e<this.hot.getSettings().fixedRowsTop}isFixedRowBottom(e){return e>this.hot.countRows()-1-this.hot.getSettings().fixedRowsBottom}prepareRowsToMoving(){const e=this.hot.getSelectedRangeActive(),n=[];if(!e)return n;const{from:r,to:i}=e,s=Math.min(r.row,i.row),a=Math.max(r.row,i.row);return En(s,a,u=>{n.push(u)}),n}refreshPositions(){const e=mr(Hc,this).coords,n=this.hot.getFirstFullyVisibleRow(),r=this.hot.getLastFullyVisibleRow(),i=this.hot.countRows();this.isFixedRowTop(e.row)&&n>0&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(n-1,-1)),this.isFixedRowBottom(e.row)&&r<i&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(r+1,1),void 0,!0);const s=this.hot.view._wt.wtTable,a=mr(Hc,this).TD,u=this.hot.rootElement,h=sl(u),m=hR(u),g=s.holder.scrollTop,y=this.hot.rootWindow!==m?m.scrollTop:0,x=h.top-y,C=mr(Hc,this).eventPageY-x+g,E=s.hider.offsetHeight,M=s.TBODY.offsetTop,j=mr(Ql,this).getOffset().top,L=mr(Ql,this).getSize().height,D=a.offsetHeight/2,z=a.offsetHeight;let H=this.hot.view.THEAD.offsetHeight+this.getRowsHeight(0,e.row-1);const V=C>=H+D;this.isFixedRowTop(e.row)&&(H+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?mr(Hc,this).row=n>0?n-1:n:V?(mr(Hc,this).row=e.row+1,H+=e.row===0?z-1:z):mr(Hc,this).row=e.row;let F=C,B=H;C+L+j>=E?F=E-L-j:C+j<M&&(F=M+Math.abs(j)),H>=E-1&&(B=E-1),mr(Ql,this).setPosition(F),mr(av,this).setPosition(B)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>ov(Yb,this,z5e).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>ov(Yb,this,B5e).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){mr(Ql,this).build(),mr(av,this).build()}destroy(){mr(Ql,this).destroy(),mr(av,this).destroy(),super.destroy()}}function F5e(t,e,n,r){const{wtTable:i,wtViewport:s}=this.hot.view._wt,a=this.hot.selection.isSelectedByRowHeader(),u=this.hot.getSelectedRangeActive();if(!u||!a||mr(lv,this)||t.button!==0){Ub(lv,this,!1),mr(rp,this).length=0,cn(this.hot.rootElement,[GV,eA]);return}const h=mr(av,this).isBuilt()&&!mr(av,this).isAppended(),m=mr(Ql,this).isBuilt()&&!mr(Ql,this).isAppended();h&&m&&(mr(av,this).appendTo(i.hider),mr(Ql,this).appendTo(i.hider));const{from:g,to:y}=u,x=Math.min(g.row,y.row),C=Math.max(g.row,y.row);if(e.col<0&&e.row>=x&&e.row<=C){r.row=!0,Ub(lv,this,!0),mr(Hc,this).eventPageY=t.pageY,mr(Hc,this).coords=e,mr(Hc,this).TD=n,Ub(rp,this,this.prepareRowsToMoving());const E=i.holder.scrollLeft+s.getRowHeaderWidth(),M=this.getRowsHeight(x,e.row-1)+(t.clientY-n.getBoundingClientRect().top);mr(Ql,this).setPosition(null,E),mr(Ql,this).setSize(i.hider.offsetWidth-E,this.getRowsHeight(x,C)),mr(Ql,this).setOffset(-M,null),st(this.hot.rootElement,GV),this.refreshPositions()}else cn(this.hot.rootElement,KV),Ub(lv,this,!1),mr(rp,this).length=0}function z5e(t){mr(lv,this)&&(mr(Hc,this).eventPageY=t.pageY,this.refreshPositions())}function V5e(t,e,n,r){!this.hot.getSelectedRangeActive()||!mr(lv,this)||(mr(rp,this).indexOf(e.row)>-1?cn(this.hot.rootElement,eA):st(this.hot.rootElement,eA),r.row=!0,r.column=!0,r.cell=!0,mr(Hc,this).coords=e,mr(Hc,this).TD=n)}function B5e(){const t=mr(Hc,this).row,e=mr(rp,this).length;if(Ub(lv,this,!1),cn(this.hot.rootElement,[GV,eA,KV]),this.hot.selection.isSelectedByRowHeader()&&st(this.hot.rootElement,KV),e<1||t===void 0)return;const n=mr(rp,this)[0],r=this.hot.toPhysicalRow(n),i=this.dragRows(mr(rp,this),t);if(mr(rp,this).length=0,i===!0){this.hot.view.adjustElementsSize(),this.hot.render();const s=this.hot.toVisualRow(r),a=s+e-1;this.hot.selectRows(s,a)}}function W5e(){const t=this.hot.view._wt.wtTable,e=this.hot.view._wt.wtViewport.getRowHeaderWidth(),n=t.holder.scrollLeft,r=e+n;mr(Ql,this).setPosition(null,r),mr(Ql,this).setSize(t.hider.offsetWidth-r)}function U5e(){this.moveBySettingsOrLoad()}function Y5e(t,e){Jte(t,e),e.add(t)}function gl(t,e,n){Jte(t,e),e.set(t,n)}function Jte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Hs(t,e,n){return t.set(ip(t,e),n),n}function Jt(t,e){return t.get(ip(t,e))}function ip(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const nA="manualRowResize",G5e=30;var gf=new WeakMap,rA=new WeakMap,Cu=new WeakMap,uE=new WeakMap,cv=new WeakMap,qV=new WeakMap,yC=new WeakMap,iA=new WeakMap,Zl=new WeakMap,vf=new WeakMap,Gb=new WeakMap,sA=new WeakMap,xC=new WeakMap,dE=new WeakMap,sp=new WeakMap,hE=new WeakMap,uv=new WeakSet;class K5e extends Zr{static get PLUGIN_KEY(){return nA}static get PLUGIN_PRIORITY(){return G5e}constructor(e){super(e),Y5e(this,uv),gl(this,gf,null),gl(this,rA,null),gl(this,Cu,[]),gl(this,uE,null),gl(this,cv,null),gl(this,qV,null),gl(this,yC,null),gl(this,iA,null),gl(this,Zl,this.hot.rootDocument.createElement("DIV")),gl(this,vf,this.hot.rootDocument.createElement("DIV")),gl(this,Gb,!1),gl(this,sA,!1),gl(this,xC,0),gl(this,dE,null),gl(this,sp,void 0),gl(this,hE,void 0),st(Jt(Zl,this),"manualRowResizer"),st(Jt(vf,this),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[nA]}enablePlugin(){this.enabled||(Hs(sp,this,new Ng),Jt(sp,this).addLocalHook("init",()=>ip(uv,this,t4e).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,Jt(sp,this)),this.addHook("modifyRowHeight",(e,n)=>ip(uv,this,e4e).call(this,e,n)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){Hs(hE,this,Jt(sp,this).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}setManualSize(e,n){const r=this.hot.toPhysicalRow(e),i=Math.max(n,this.hot.stylesHandler.getDefaultRowHeight());return Jt(sp,this).setValueAtIndex(r,i),i}getLastDesiredRowHeight(){return Jt(uE,this)}setupHandlePosition(e){if(Jt(xC,this)>1)return;Hs(gf,this,e);const{view:n}=this.hot,{_wt:r}=n,i=r.wtTable.getCoords(Jt(gf,this)),s=i.row;if(s<0)return;const a=po(Jt(gf,this)),u=Jt(gf,this).getBoundingClientRect(),h=s<r.getSetting("fixedRowsTop"),m=s>=n.countNotHiddenRowIndexes(0,1)-r.getSetting("fixedRowsBottom");let g;h?g=r.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(Jt(gf,this),i.row,i.col):m&&(g=r.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(Jt(gf,this),i.row,i.col)),g||(g=r.wtOverlays.inlineStartOverlay.getRelativeCellPosition(Jt(gf,this),i.row,i.col)),Hs(rA,this,this.hot.rowIndexMapper.getVisualFromRenderableIndex(s)),Hs(Cu,this,[]);const y=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&y){const x=this.hot.getSelectedRange();Te(x,C=>{const E=C.getTopStartCorner().row,M=C.getBottomStartCorner().row;En(E,M,j=>{Jt(Cu,this).includes(j)||Jt(Cu,this).push(j)})})}Jt(Cu,this).includes(Jt(rA,this))||Hs(Cu,this,[Jt(rA,this)]),Hs(iA,this,g.top-6),Hs(yC,this,parseInt(u.height,10)),Jt(Zl,this).style.top=`${Jt(iA,this)+Jt(yC,this)}px`,Jt(Zl,this).style[this.inlineDir]=`${g.start}px`,Jt(Zl,this).style.width=`${a}px`,this.hot.rootElement.appendChild(Jt(Zl,this))}refreshHandlePosition(){Jt(Zl,this).style.top=`${Jt(iA,this)+Jt(uE,this)}px`}setupGuidePosition(){const e=parseInt(po(Jt(Zl,this)),10),n=parseInt(Jt(Zl,this).style[this.inlineDir],10)+e,r=this.hot.view.getTableWidth();st(Jt(Zl,this),"active"),st(Jt(vf,this),"active"),Jt(vf,this).style.top=Jt(Zl,this).style.top,Jt(vf,this).style[this.inlineDir]=`${n}px`,Jt(vf,this).style.width=`${r-e}px`,this.hot.rootElement.appendChild(Jt(vf,this))}refreshGuidePosition(){Jt(vf,this).style.top=Jt(Zl,this).style.top}hideHandleAndGuide(){cn(Jt(Zl,this),"active"),cn(Jt(vf,this),"active")}checkIfRowHeader(e){const n=k0(e,["TBODY"],this.hot.rootElement),{inlineStartOverlay:r,topInlineStartCornerOverlay:i,bottomInlineStartCornerOverlay:s}=this.hot.view._wt.wtOverlays;return[r.clone.wtTable.TBODY,i.clone.wtTable.TBODY,s.clone.wtTable.TBODY].includes(n)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}getActualRowHeight(e){const n=this.hot.view._wt.wtTable.getRowHeight(e);return n!==void 0&&Jt(cv,this)<n?n:Jt(cv,this)}afterMouseDownTimeout(){const e=()=>{this.hot.view.adjustElementsSize(),this.hot.render()},n=(r,i)=>{const s=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(r),r,!0);s!==void 0&&Hs(cv,this,s),this.setManualSize(r,Jt(cv,this)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(r),r,!0),i&&e()};Jt(xC,this)>=2&&(Jt(Cu,this).length>1?(Te(Jt(Cu,this),i=>{n(i)}),e()):Te(Jt(Cu,this),i=>{n(i,!0)})),Hs(xC,this,0),Hs(dE,this,null)}bindEvents(){const{rootElement:e,rootWindow:n}=this.hot;this.eventManager.addEventListener(e,"mouseover",r=>ip(uv,this,q5e).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>ip(uv,this,X5e).call(this,r)),this.eventManager.addEventListener(n,"mousemove",r=>ip(uv,this,Q5e).call(this,r)),this.eventManager.addEventListener(n,"mouseup",()=>ip(uv,this,Z5e).call(this)),this.eventManager.addEventListener(Jt(Zl,this),"contextmenu",()=>ip(uv,this,J5e).call(this))}destroy(){super.destroy()}}function q5e(t){if(!bG(t.target)&&Jt(sA,this)!==!0&&this.checkIfRowHeader(t.target)){const e=this.getClosestTHParent(t.target);e&&(Jt(Gb,this)||this.setupHandlePosition(e))}}function X5e(t){Dn(t.target,"manualRowResizer")&&(this.setupHandlePosition(Jt(gf,this)),this.setupGuidePosition(),Hs(Gb,this,!0),Jt(dE,this)===null&&(Hs(dE,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(Jt(dE,this))),Hs(xC,this,Jt(xC,this)+1),Hs(qV,this,t.pageY),Hs(cv,this,Jt(yC,this)))}function Q5e(t){Jt(Gb,this)&&(Hs(uE,this,Jt(yC,this)+(t.pageY-Jt(qV,this))),Te(Jt(Cu,this),e=>{Hs(cv,this,this.setManualSize(e,Jt(uE,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition())}function Z5e(){const t=()=>{this.hot.view.adjustElementsSize(),this.hot.render()},e=(n,r)=>{this.hot.runHooks("beforeRowResize",this.getActualRowHeight(n),n,!1),r&&t(),this.hot.runHooks("afterRowResize",this.getActualRowHeight(n),n,!1)};Jt(Gb,this)&&(this.hideHandleAndGuide(),Hs(Gb,this,!1),Jt(cv,this)!==Jt(yC,this)&&(Jt(Cu,this).length>1?(Te(Jt(Cu,this),r=>{e(r)}),t()):Te(Jt(Cu,this),r=>{e(r,!0)})),this.setupHandlePosition(Jt(gf,this)))}function J5e(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(Jt(Zl,this)),this.hot.rootElement.removeChild(Jt(vf,this)),Hs(Gb,this,!1),Hs(sA,this,!0),this.hot._registerMicrotask(()=>{Hs(sA,this,!1)})}function e4e(t,e){let n=t;if(this.enabled){const i=this.hot.toPhysicalRow(e),s=Jt(sp,this).getValueAtIndex(i);if(this.hot.getSettings()[nA]&&s){var r;(r=this.hot.getPlugin("autoRowSize"))!==null&&r!==void 0&&r.isEnabled()?n=Math.max(s,n??0):n=s}}return n}function t4e(){const t=this.hot.getSettings()[nA];this.hot.batchExecution(()=>{Array.isArray(t)?(t.forEach((e,n)=>{Jt(sp,this).setValueAtIndex(n,e)}),Hs(hE,this,t)):t===!0&&Array.isArray(Jt(hE,this))&&Jt(hE,this).forEach((e,n)=>{Jt(sp,this).setValueAtIndex(n,e)})},!0)}function n4e(t,e,n){r4e(t,e),e.set(t,n)}function r4e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Kb(t,e,n){return(e=i4e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i4e(t){var e=s4e(t,"string");return typeof e=="symbol"?e:e+""}function s4e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ene(t,e){return t.get(tne(t,e))}function oA(t,e,n){return t.set(tne(t,e),n),n}function tne(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var qb=new WeakMap;class bf{constructor(e,n,r,i,s,a){Kb(this,"row",void 0),Kb(this,"col",void 0),Kb(this,"rowspan",void 0),Kb(this,"colspan",void 0),Kb(this,"removed",!1),Kb(this,"cellCoordsFactory",void 0),Kb(this,"cellRangeFactory",void 0),n4e(this,qb,null),this.row=e,this.col=n,this.rowspan=r,this.colspan=i,this.cellCoordsFactory=s,this.cellRangeFactory=a}static NEGATIVE_VALUES_WARNING(e){let{row:n,col:r,rowspan:i,colspan:s}=e;return Jr`The merged cell declared with {row: ${n}, col: ${r},\x20 rowspan: ${i}, colspan: ${s}} contains negative values, which is\x20 not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING(e){let{row:n,col:r}=e;return Jr`The merged cell declared at [${n}, ${r}] is positioned\x20 (or positioned partially) outside of the table range. It was not added to the table, please fix your setup.`}static IS_SINGLE_CELL(e){let{row:n,col:r}=e;return Jr`The merged cell declared at [${n}, ${r}] has both "rowspan"\x20 and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.`}static ZERO_SPAN_WARNING(e){let{row:n,col:r}=e;return Jr`The merged cell declared at [${n}, ${r}] has "rowspan"\x20 or "colspan" declared as "0", which is not supported. It cannot be added to the collection.`}static containsNegativeValues(e){let{row:n,col:r,rowspan:i,colspan:s}=e;return n<0||r<0||i<0||s<0}static isSingleCell(e){let{rowspan:n,colspan:r}=e;return r===1&&n===1}static containsZeroSpan(e){let{rowspan:n,colspan:r}=e;return r===0||n===0}static isOutOfBounds(e,n,r){return e.row<0||e.col<0||e.row>=n||e.row+e.rowspan-1>=n||e.col>=r||e.col+e.colspan-1>=r}normalize(e){const n=e.countRows(),r=e.countCols();this.row<0?this.row=0:this.row>n-1&&(this.row=n-1),this.col<0?this.col=0:this.col>r-1&&(this.col=r-1),this.row+this.rowspan>n-1&&(this.rowspan=n-this.row),this.col+this.colspan>r-1&&(this.colspan=r-this.col),oA(qb,this,null)}includes(e,n){return this.row<=e&&this.col<=n&&this.row+this.rowspan-1>=e&&this.col+this.colspan-1>=n}includesHorizontally(e){return this.col<=e&&this.col+this.colspan-1>=e}includesVertically(e){return this.row<=e&&this.row+this.rowspan-1>=e}shift(e,n){const r=e[0]||e[1],i=n+Math.abs(e[0]||e[1])-1,s=e[0]?"colspan":"rowspan",a=e[0]?"col":"row",u=Math.min(n,i),h=Math.max(n,i),m=this[a],g=this[a]+this[s]-1;if(m>=n&&(this[a]+=r),r>0)n<=g&&n>m&&(this[s]+=r);else if(r<0){if(u<=m&&h>=g)return this.removed=!0,oA(qb,this,null),!1;if(m>=u&&m<=h){const y=h-m+1,x=Math.abs(r)-y;this[a]-=x+r,this[s]-=y}else if(m<=u&&g>=h)this[s]+=r;else if(m<=u&&g>=u&&g<h){const y=g-u+1;this[s]-=y}}return oA(qb,this,null),!0}isFarther(e,n){return e?n==="down"?e.row+e.rowspan-1<this.row+this.rowspan-1:n==="up"?e.row>this.row:n==="right"?e.col+e.colspan-1<this.col+this.colspan-1:n==="left"?e.col>this.col:null:!0}getLastRow(){return this.row+this.rowspan-1}getLastColumn(){return this.col+this.colspan-1}getRange(){return ene(qb,this)||oA(qb,this,this.cellRangeFactory(this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.getLastRow(),this.getLastColumn()))),ene(qb,this)}}function o4e(t,e){a4e(t,e),e.add(t)}function a4e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function aA(t,e,n){return(e=l4e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l4e(t){var e=c4e(t,"string");return typeof e=="symbol"?e:e+""}function c4e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xb(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var dv=new WeakSet;class lA{constructor(e){o4e(this,dv),aA(this,"plugin",void 0),aA(this,"mergedCells",[]),aA(this,"mergedCellsMatrix",new Map),aA(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){let{row:n,col:r}=e;return Jr`The merged cell declared at [${n}, ${r}], overlaps\x20 with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20 fix your setup.`}get(e,n){var r;return this.mergedCellsMatrix.has(e)&&(r=this.mergedCellsMatrix.get(e).get(n))!==null&&r!==void 0?r:!1}getByRange(e){const{row:n,col:r}=e.getTopStartCorner(),{row:i,col:s}=e.getBottomEndCorner(),a=this.mergedCells.length;let u=!1;for(let h=0;h<a;h++){const m=this.mergedCells[h],{row:g,col:y,rowspan:x,colspan:C}=m;if(g>=n&&g+x-1<=i&&y>=r&&y+C-1<=s){u=m;break}}return u}filterOverlappingMergeCells(e){const n=new Set;return this.mergedCells.forEach(i=>{const{row:s,col:a,colspan:u,rowspan:h}=i;for(let m=s;m<s+h;m++)for(let g=a;g<a+u;g++)n.add(`r${m},c${g}`)}),e.filter(i=>{const{row:s,col:a,colspan:u,rowspan:h}=i,m=new Set;let g=!1;for(let y=s;y<s+h;y++){for(let x=a;x<a+u;x++){const C=`r${y},c${x}`;if(n.has(C)){Yn(lA.IS_OVERLAPPING_WARNING(i)),g=!0;break}m.add(C)}if(g)break}return g||n.add(...m),!g})}getWithinRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{row:r,col:i}=e.getTopStartCorner(),{row:s,col:a}=e.getBottomEndCorner(),u=[];for(let h=r;h<=s;h++)for(let m=i;m<=a;m++){const g=this.get(h,m);g&&(n||!n&&g.row===h&&g.col===m)&&u.push(g)}return u}add(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=e.row,i=e.col,s=e.rowspan,a=e.colspan,u=new bf(r,i,s,a,this.hot._createCellCoords,this.hot._createCellRange),h=this.get(r,i),m=n?!1:this.isOverlapping(u);return!h&&!m?(this.hot&&u.normalize(this.hot),this.mergedCells.push(u),Xb(dv,this,nne).call(this,u),u):(m&&Yn(lA.IS_OVERLAPPING_WARNING(u)),!1)}remove(e,n){const r=this.get(e,n),i=r?this.mergedCells.indexOf(r):-1;return r&&i!==-1?(this.mergedCells.splice(i,1),Xb(dv,this,u4e).call(this,r),r):!1}clear(){Te(this.mergedCells,e=>{let{row:n,col:r,rowspan:i,colspan:s}=e;En(n,n+i,a=>{En(r,r+s,u=>{const h=this.hot.getCell(a,u);h&&(h.removeAttribute("rowspan"),h.removeAttribute("colspan"),h.style.display="")})})}),this.mergedCells.length=0,this.mergedCellsMatrix=new Map}isOverlapping(e){const n=e.getRange();for(let r=0;r<this.mergedCells.length;r++)if(this.mergedCells[r].getRange().overlaps(n))return!0;return!1}isFirstRenderableMergedCell(e,n){const r=this.get(e,n);if(!r)return!1;const{row:i,col:s,rowspan:a,colspan:u}=r,h=this.hot.view.getActiveOverlayName(),m=["top","top_inline_start_corner"].includes(h)?0:this.hot.getFirstRenderedVisibleRow(),g=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(h)?0:this.hot.getFirstRenderedVisibleColumn(),y=Lr(m,i,i+a-1),x=Lr(g,s,s+u-1);return this.hot.rowIndexMapper.getNearestNotHiddenIndex(y,1)===e&&this.hot.columnIndexMapper.getNearestNotHiddenIndex(x,1)===n}getFirstRenderableCoords(e,n){const r=this.get(e,n);if(!r||this.isFirstRenderableMergedCell(e,n))return this.hot._createCellCoords(e,n);const i=this.hot.rowIndexMapper.getNearestNotHiddenIndex(r.row,1),s=this.hot.columnIndexMapper.getNearestNotHiddenIndex(r.col,1);return this.hot._createCellCoords(i,s)}getStartMostColumnIndex(e,n){const r=Xb(dv,this,cA).call(this,e,"col",-1);let i=n;for(let s=0;s<r.length;s++)if(r[s]<=n){i=r[s];break}return i}getEndMostColumnIndex(e,n){const r=Xb(dv,this,cA).call(this,e,"col",1);let i=n;for(let s=0;s<r.length;s++)if(r[s]>=n){i=r[s];break}return i}getTopMostRowIndex(e,n){const r=Xb(dv,this,cA).call(this,e,"row",-1);let i=n;for(let s=0;s<r.length;s++)if(r[s]<=n){i=r[s];break}return i}getBottomMostRowIndex(e,n){const r=Xb(dv,this,cA).call(this,e,"row",1);let i=n;for(let s=0;s<r.length;s++)if(r[s]>=n){i=r[s];break}return i}shiftCollections(e,n,r){const i=[0,0];switch(e){case"right":i[0]+=r;break;case"left":i[0]-=r;break;case"down":i[1]+=r;break;case"up":i[1]-=r;break}const s=[];this.mergedCells.forEach(a=>{a.shift(i,n),a.removed&&s.push(a)}),s.forEach(a=>{this.mergedCells.splice(this.mergedCells.indexOf(a),1)}),this.mergedCellsMatrix.clear(),this.mergedCells.forEach(a=>{Xb(dv,this,nne).call(this,a)})}}function cA(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const r=new Map,i=n===1?t.getTopStartCorner():t.getBottomEndCorner(),s=n===1?t.getBottomEndCorner():t.getTopStartCorner();for(let a=i.row;n===1?a<=s.row:a>=s.row;a+=n)for(let u=i.col;n===1?u<=s.col:u>=s.col;u+=n){const h=e==="row"?a:u,m=this.get(a,u);let g=h;m&&(g=n===1?m[e]+m[`${e}span`]-1:m[e]),r.has(h)||r.set(h,new Set),r.get(h).add(g)}return Array.from(new Set(Array.from(r.entries()).filter(a=>{let[,u]=a;return u.size===1}).flatMap(a=>{let[,u]=a;return Array.from(u)})))}function nne(t){for(let e=t.row;e<t.row+t.rowspan;e++)for(let n=t.col;n<t.col+t.colspan;n++)this.mergedCellsMatrix.has(e)||this.mergedCellsMatrix.set(e,new Map),this.mergedCellsMatrix.get(e).set(n,t)}function u4e(t){for(let e=t.row;e<t.row+t.rowspan;e++)for(let n=t.col;n<t.col+t.colspan;n++)this.mergedCellsMatrix.get(e).delete(n)}function XV(t,e,n){return(e=d4e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d4e(t){var e=h4e(t,"string");return typeof e=="symbol"?e:e+""}function h4e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class f4e{constructor(e){XV(this,"plugin",void 0),XV(this,"mergedCellsCollection",void 0),XV(this,"currentFillData",null),this.plugin=e,this.mergedCellsCollection=this.plugin.mergedCellsCollection}getDirection(e,n){let r=null;return n[0]===e[0]&&n[1]===e[1]&&n[3]===e[3]?r="down":n[2]===e[2]&&n[1]===e[1]&&n[3]===e[3]?r="up":n[1]===e[1]&&n[2]===e[2]?r="right":r="left",r}snapDragArea(e,n,r,i){const s=n.slice(0),a=this.getAutofillSize(e,n,r),[u,h,m,g]=e,x=["up","down"].indexOf(r)>-1?m-u+1:g-h+1,C=Math.floor(a/x)*x,E=a-C,M=this.getFarthestCollection(e,n,r,i);if(M){if(r==="down"){const j=M.row+M.rowspan-u-E;s[2]+j>=this.plugin.hot.countRows()?s[2]-=E:s[2]+=E?j:0}else if(r==="right"){const j=M.col+M.colspan-h-E;s[3]+j>=this.plugin.hot.countCols()?s[3]-=E:s[3]+=E?j:0}else if(r==="up"){const j=m-E-M.row+1;s[0]+j<0?s[0]+=E:s[0]-=E?j:0}else if(r==="left"){const j=g-E-M.col+1;s[1]+j<0?s[1]+=E:s[1]-=E?j:0}}return this.updateCurrentFillCache({baseArea:e,dragDirection:r,foundMergedCells:i,fillSize:a,dragArea:s,cycleLength:x}),s}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),jo(this.currentFillData,e)}getAutofillSize(e,n,r){const[i,s,a,u]=e,[h,m,g,y]=n;switch(r){case"up":return i-h;case"down":return g-a;case"left":return s-m;case"right":return y-u;default:return null}}getDragArea(e,n,r){const[i,s,a,u]=e,[h,m,g,y]=n;switch(r){case"up":return[h,m,i-1,u];case"down":{const x=this.mergedCellsCollection.get(g,u),C=x?x.rowspan-1:0;return[a+1,s,g+C,u]}case"left":return[h,m,a,s-1];case"right":{const x=this.mergedCellsCollection.get(g,u),C=x?x.colspan-1:0;return[i,u+C,g,y]}default:return null}}getFarthestCollection(e,n,r,i){const[s,a,u,h]=e,m=["up","down"].indexOf(r)>-1,g=m?u:h,y=m?s:a,x=this.getAutofillSize(e,n,r),C=m?u-s+1:h-a+1,E=Math.floor(x/C)*C,M=x-E;let j=null,L=null,D=null;switch(r){case"up":j="includesVertically",D=g-M+1;break;case"left":j="includesHorizontally",D=g-M+1;break;case"down":j="includesVertically",D=y+M-1;break;case"right":j="includesHorizontally",D=y+M-1;break}return Te(i,z=>{z[j](D)&&z.isFarther(L,r)&&(L=z)}),L}recreateAfterDataPopulation(e){if(!this.currentFillData)return;const n=this.getRangeFromChanges(e),r=this.currentFillData.foundMergedCells,i=this.currentFillData.dragDirection,s=(m,g)=>{switch(i){case"up":return m.row-g>=n.from.row;case"down":return m.row+m.rowspan-1+g<=n.to.row;case"left":return m.col-g>=n.from.column;case"right":return m.col+m.colspan-1+g<=n.to.column;default:return null}};let a=0,u=null,h=1;do for(let m=0;m<r.length;m+=1){if(u=r[m],a=h*this.currentFillData.cycleLength,s(u,a))switch(i){case"up":this.plugin.mergedCellsCollection.add({row:u.row-a,rowspan:u.rowspan,col:u.col,colspan:u.colspan},!0);break;case"down":this.plugin.mergedCellsCollection.add({row:u.row+a,rowspan:u.rowspan,col:u.col,colspan:u.colspan},!0);break;case"left":this.plugin.mergedCellsCollection.add({row:u.row,rowspan:u.rowspan,col:u.col-a,colspan:u.colspan},!0);break;case"right":this.plugin.mergedCellsCollection.add({row:u.row,rowspan:u.rowspan,col:u.col+a,colspan:u.colspan},!0);break}m===r.length-1&&(h+=1)}while(s(u,a));this.currentFillData=null,this.plugin.hot.render(),r.length>0&&this.plugin.ifChromeForceRepaint()}getRangeFromChanges(e){const n={min:null,max:null},r={min:null,max:null};return Te(e,i=>{const s=i[0],a=this.plugin.hot.propToCol(i[1]);(n.min===null||s<n.min)&&(n.min=s),(n.max===null||s>n.max)&&(n.max=s),(r.min===null||a<r.min)&&(r.min=a),(r.max===null||a>r.max)&&(r.max=a)}),{from:{row:n.min,column:r.min},to:{row:n.max,column:r.max}}}dragAreaOverlapsCollections(e,n,r){const i=this.getDragArea(e,n,r),[s,a,u,h]=i,m=this.plugin.hot._createCellCoords(s,a),g=this.plugin.hot._createCellCoords(u,h),y=this.plugin.hot._createCellRange(m,m,g);if(this.mergedCellsCollection.getWithinRange(y,!0).length===0)return!1;const C=this.mergedCellsCollection.getWithinRange(y,!1);return C.length===0?!0:r==="up"||r==="down"?!C.every(E=>{let{colspan:M}=E;return M===y.getWidth()}):!C.every(E=>{let{rowspan:M}=E;return M===y.getHeight()})}}function QV(t,e,n){return(e=m4e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m4e(t){var e=p4e(t,"string");return typeof e=="symbol"?e:e+""}function p4e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class g4e{constructor(e){QV(this,"plugin",void 0),QV(this,"hot",void 0),QV(this,"fullySelectedMergedCellClassName","fullySelectedMergedCell"),this.plugin=e,this.hot=e.hot}getSelectedMergedCellClassName(e,n,r,i){const s=Math.min(r[0],r[2]),a=Math.min(r[1],r[3]),u=Math.max(r[0],r[2]),h=Math.max(r[1],r[3]);if(i===void 0||!this.plugin.mergedCellsCollection.isFirstRenderableMergedCell(e,n))return;const g=this.plugin.mergedCellsCollection.get(e,n);if(!g)return;const y=g.getLastRow(),x=g.getLastColumn();if(s<=g.row&&a<=g.col&&u>=y&&h>=x)return`${this.fullySelectedMergedCellClassName}-${i}`;if(this.isMergeCellFullySelected(g,this.plugin.hot.getSelectedRange()))return`${this.fullySelectedMergedCellClassName}-multiple`}isMergeCellFullySelected(e,n){const r=[];if(!n||!e)return!1;for(let i=0;i<e.rowspan;i+=1)for(let s=0;s<e.colspan;s+=1)r.push(this.hot._createCellCoords(e.row+i,e.col+s));for(let i=0;i<r.length;i+=1){const s=[];for(let a=0;a<n.length;a+=1)s[a]=n[a].includes(r[i]);if(!s.includes(!0))return!1}return!0}getSelectedMergedCellClassNameToRemove(){const e=[];for(let n=0;n<=7;n+=1)e.push(`${this.fullySelectedMergedCellClassName}-${n}`);return e.push(`${this.fullySelectedMergedCellClassName}-multiple`),e}}function v4e(t){return{key:"mergeCells",name(){const e=this.getSelectedActive();if(e){const n=t.mergedCellsCollection.get(e[0],e[1]);if(n.row===e[0]&&n.col===e[1]&&n.row+n.rowspan-1===e[2]&&n.col+n.colspan-1===e[3])return this.getTranslatedPhrase(j5)}return this.getTranslatedPhrase(T5)},callback(){const e=this.getSelectedRangeActive();if(!e)return;e.setDirection(this.isRtl()?"NE-SW":"NW-SE");const{from:n,to:r}=e;t.toggleMerge(e),this.selectCell(n.row,n.col,r.row,r.col,!1)},disabled(){const e=this.getSelectedActive();return e?bf.isSingleCell({row:e[0],col:e[1],rowspan:e[2]-e[0]+1,colspan:e[3]-e[1]+1})||this.selection.isSelectedByCorner():!0},hidden:!1}}function fE(t,e,n){return(e=b4e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function b4e(t){var e=y4e(t,"string");return typeof e=="symbol"?e:e+""}function y4e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class rne{constructor(e){fE(this,"data",void 0),fE(this,"next",null),fE(this,"prev",null),this.data=e}}class uA{constructor(){fE(this,"first",null),fE(this,"last",null)}push(e){const n=new rne(e);if(this.first===null)this.first=n,this.last=n;else{const r=this.last;this.last=n,n.prev=r,r.next=n}return n}unshift(e){const n=new rne(e);if(this.first===null)this.first=n,this.last=n;else{const r=this.first;this.first=n,n.next=r,r.prev=n}}inorder(e){let n=this.first;for(;n;){const r=e(n);if(n===this.last||r===!0)break;n=n.next}}remove(e){if(this.first===null)return!1;let n=this.first,r,i;for(;n;){if(n.data===e)return r=n.next,i=n.prev,r&&(r.prev=i),i&&(i.next=r),n===this.first&&(this.first=r),n===this.last&&(this.last=i),!0;n=n.next}return!1}hasCycle(){let e=this.first,n=this.first;for(;;){if(e===null||(e=e.next,e===null))return!1;if(e=e.next,n=n.next,e===n)return!0}}pop(){if(this.last===null)return null;const e=this.last;return this.last=this.last.prev,e}shift(){if(this.first===null)return null;const e=this.first;return this.first=this.first.next,e}recursiveReverse(){function e(r,i){i&&(e(i,i.next),i.next=r)}if(!this.first)return;e(this.first,this.first.next),this.first.next=null;const n=this.first;this.first=this.last,this.last=n}reverse(){if(!this.first||!this.first.next)return;let e=this.first.next,n=this.first,r;for(;e;)r=e.next,e.next=n,n.prev=e,n=e,e=r;this.first.next=null,this.last.prev=null,r=this.first,this.first=n,this.last=r}}function x4e(t,e){ine(t,e),e.add(t)}function Qb(t,e,n){ine(t,e),e.set(t,n)}function ine(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xi(t,e){return t.get(dA(t,e))}function Su(t,e,n){return t.set(dA(t,e),n),n}function dA(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var yf=new WeakMap,xf=new WeakMap,wf=new WeakMap,Cf=new WeakMap,ZV=new WeakMap,hA=new WeakMap,fA=new WeakMap,JV=new WeakSet;class w4e{constructor(e){let{mergedCellsGetter:n,rowIndexMapper:r,columnIndexMapper:i}=e;x4e(this,JV),Qb(this,yf,new uA),Qb(this,xf,new uA),Qb(this,wf,null),Qb(this,Cf,null),Qb(this,ZV,null),Qb(this,hA,null),Qb(this,fA,null),Su(ZV,this,n),Su(hA,this,r),Su(fA,this,i)}getCurrentVerticalNode(){return xi(Cf,this).data}getFirstVerticalNode(){return xi(xf,this).first.data}getNextVerticalNode(){return xi(Cf,this).next.data}getPrevVerticalNode(){return xi(Cf,this).prev.data}getCurrentHorizontalNode(){return xi(wf,this).data}getFirstHorizontalNode(){return xi(yf,this).first.data}getNextHorizontalNode(){return xi(wf,this).next.data}getPrevHorizontalNode(){return xi(wf,this).prev.data}setPrevNodeAsActive(){Su(Cf,this,xi(Cf,this).prev),Su(wf,this,xi(wf,this).prev)}setNextNodeAsActive(){Su(Cf,this,xi(Cf,this).next),Su(wf,this,xi(wf,this).next)}buildFocusOrder(e){Su(yf,this,new uA),e.forEach((n,r)=>{const i=new WeakSet,s=n.getTopStartCorner(),a=n.getBottomEndCorner();for(let u=s.row;u<=a.row;u++)if(!xi(hA,this).isHidden(u))for(let h=s.col;h<=a.col;h++){if(xi(fA,this).isHidden(h))continue;const m=dA(JV,this,sne).call(this,{selectedRange:n,selectionLayer:r,listOrder:xi(yf,this),mergeCellsVisitor:i,row:u,column:h});m&&Su(wf,this,m)}}),xi(yf,this).first&&(xi(yf,this).first.prev=xi(yf,this).last,xi(yf,this).last.next=xi(yf,this).first),Su(xf,this,new uA),e.forEach((n,r)=>{const i=new WeakSet,s=n.getTopStartCorner(),a=n.getBottomEndCorner();for(let u=s.col;u<=a.col;u++)if(!xi(fA,this).isHidden(u))for(let h=s.row;h<=a.row;h++){if(xi(hA,this).isHidden(h))continue;const m=dA(JV,this,sne).call(this,{selectedRange:n,selectionLayer:r,listOrder:xi(xf,this),mergeCellsVisitor:i,row:h,column:u});m&&Su(Cf,this,m)}}),xi(xf,this).first&&(xi(xf,this).first.prev=xi(xf,this).last,xi(xf,this).last.next=xi(xf,this).first)}setActiveNode(e,n,r){return xi(yf,this).inorder(i=>{const{selectionLayer:s,rowStart:a,rowEnd:u,colStart:h,colEnd:m}=i.data;if(s===r&&e>=a&&e<=u&&n>=h&&n<=m)return Su(wf,this,i),!0}),xi(xf,this).inorder(i=>{const{selectionLayer:s,rowStart:a,rowEnd:u,colStart:h,colEnd:m}=i.data;if(s===r&&e>=a&&e<=u&&n>=h&&n<=m)return Su(Cf,this,i),!0}),this}}function sne(t){let{selectedRange:e,selectionLayer:n,listOrder:r,mergeCellsVisitor:i,row:s,column:a}=t;const u=e.getTopStartCorner(),h=e.getBottomEndCorner(),m=e.highlight.clone().normalize(),g=xi(ZV,this).call(this,s,a);if(g&&i.has(g))return null;const y={selectionLayer:n,colStart:a,colEnd:a,rowStart:s,rowEnd:s};if(g){if(i.add(g),g.row<u.row||g.row+g.rowspan-1>h.row||g.col<u.col||g.col+g.colspan-1>h.col)return null;y.colStart=g.col,y.colEnd=g.col+g.colspan-1,y.rowStart=g.row,y.rowEnd=g.row+g.rowspan-1}const x=r.push(y);return s===m.row&&a===m.col||g&&m.row>=g.row&&m.row<=g.row+g.rowspan-1&&m.col>=g.col&&m.col<=g.col+g.colspan-1?x:null}function one(t,e,n){const{rowIndexMapper:r,stylesHandler:i}=t;let s=0;for(let u=e;u<e+n;u++)if(!r.isHidden(u)){var a;s+=(a=t.getRowHeight(u))!==null&&a!==void 0?a:i.getDefaultRowHeight(u)}return s}function C4e(t){const{hot:e}=t,{rowIndexMapper:n,columnIndexMapper:r}=e,i=new Map;function s(){}function a(u,h,m){const g=t.mergedCellsCollection.get(h,m);if(!nn(g)){u.removeAttribute("rowspan"),u.removeAttribute("colspan"),i.has(h)&&!e.getSettings().rowHeaders&&(u.style.height=`${i.get(h)}px`,i.delete(h)),u.style.display="";return}const{row:y,col:x,colspan:C,rowspan:E}=g,[M,j]=t.translateMergedCellToRenderable(y,E,x,C),L=t.getSetting("virtualized");if(x===0&&!e.getSettings().rowHeaders){const ce=e._getRowHeightFromSettings(h);if(ce!==void 0){const pe=e.stylesHandler.areCellsBorderBox()?0:1;i.set(h,ce-pe)}else if(MT()){const _e=one(e,y,E);i.set(h,_e/E)}}const D=n.getRenderableFromVisualIndex(h),z=r.getRenderableFromVisualIndex(m),H=M-D+1,V=j-z+1;let F=n.getNearestNotHiddenIndex(y,1),B=r.getNearestNotHiddenIndex(x,1);if(L){const ce=e.view.getActiveOverlayName();["top","top_inline_start_corner"].includes(ce)||(F=Math.max(F,e.getFirstRenderedVisibleRow())),["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(ce)||(B=Math.max(B,e.getFirstRenderedVisibleColumn()))}const te=Math.min(E,H),ve=Math.min(C,V);F===h&&B===m?(u.setAttribute("rowspan",te),u.setAttribute("colspan",ve)):(u.removeAttribute("rowspan"),u.removeAttribute("colspan"),u.style.display="none")}return{before:s,after:a}}function S4e(t,e){ane(t,e),e.add(t)}function mA(t,e,n){ane(t,e),e.set(t,n)}function ane(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function e3(t,e,n){return(e=R4e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R4e(t){var e=_4e(t,"string");return typeof e=="symbol"?e:e+""}function _4e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mE(t,e,n){return t.set(ki(t,e),n),n}function Zi(t,e){return t.get(ki(t,e))}function ki(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}un.getSingleton().register("beforeMergeCells"),un.getSingleton().register("afterMergeCells"),un.getSingleton().register("beforeUnmergeCells"),un.getSingleton().register("afterUnmergeCells");const t3="mergeCells",E4e=150,lne=t3;var md=new WeakMap,pd=new WeakMap,Sf=new WeakMap,cne=new WeakMap,zi=new WeakSet;class N4e extends Zr{constructor(){super(...arguments),S4e(this,zi),e3(this,"mergedCellsCollection",null),e3(this,"autofillCalculations",null),e3(this,"selectionCalculations",null),mA(this,md,null),mA(this,pd,{row:0,col:0}),mA(this,Sf,new w4e({mergedCellsGetter:(e,n)=>this.mergedCellsCollection.get(e,n),rowIndexMapper:this.hot.rowIndexMapper,columnIndexMapper:this.hot.columnIndexMapper})),mA(this,cne,C4e(this))}static get PLUGIN_KEY(){return t3}static get PLUGIN_PRIORITY(){return E4e}static get DEFAULT_SETTINGS(){return{[nJ]:"cells",virtualized:!1,cells:[]}}isEnabled(){return!!this.hot.getSettings()[t3]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new lA(this),this.autofillCalculations=new f4e(this),this.selectionCalculations=new g4e(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,k4e).call(e,...r)}),this.addHook("modifyTransformFocus",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,j4e).call(e,...r)}),this.addHook("modifyTransformStart",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,M4e).call(e,...r)}),this.addHook("modifyTransformEnd",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,P4e).call(e,...r)}),this.addHook("beforeSelectionHighlightSet",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,A4e).call(e,...r)}),this.addHook("beforeSetRangeStart",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,dne).call(e,...r)}),this.addHook("beforeSetRangeStartOnly",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,dne).call(e,...r)}),this.addHook("beforeSelectionFocusSet",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,I4e).call(e,...r)}),this.addHook("afterSelectionFocusSet",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,D4e).call(e,...r)}),this.addHook("afterSelectionEnd",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,H4e).call(e,...r)}),this.addHook("modifyGetCellCoords",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,une).call(e,...r)}),this.addHook("modifyGetCoordsElement",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,une).call(e,...r)}),this.addHook("afterIsMultipleSelection",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,T4e).call(e,...r)}),this.addHook("afterRenderer",function(){return Zi(cne,e).after(...arguments)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,O4e).call(e,...r)}),this.addHook("afterGetCellMeta",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,L4e).call(e,...r)}),this.addHook("afterViewportRowCalculatorOverride",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,$4e).call(e,...r)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,F4e).call(e,...r)}),this.addHook("modifyAutofillRange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,z4e).call(e,...r)}),this.addHook("afterCreateCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,V4e).call(e,...r)}),this.addHook("afterRemoveCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,B4e).call(e,...r)}),this.addHook("afterCreateRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,W4e).call(e,...r)}),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,U4e).call(e,...r)}),this.addHook("afterChange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,Y4e).call(e,...r)}),this.addHook("beforeDrawBorders",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,G4e).call(e,...r)}),this.addHook("afterDrawSelection",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,K4e).call(e,...r)}),this.addHook("beforeRemoveCellClassNames",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,q4e).call(e,...r)}),this.addHook("beforeBeginEditing",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,X4e).call(e,...r)}),this.addHook("modifyRowHeightByOverlayName",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return ki(zi,e,Q4e).call(e,...r)}),this.addHook("beforeUndoStackChange",(n,r)=>{if(r==="MergeCells")return!1}),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.clearCollections(),this.unregisterShortcuts(),this.hot.render(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.generateFromSettings(),super.updatePlugin()}ifChromeForceRepaint(){if(!rG())return;const e=[];let n=[];this.mergedCellsCollection.mergedCells.forEach(r=>{const{row:i,rowspan:s}=r;for(let a=i+1;a<i+s;a++)n.push(a)}),n=[...new Set(n)],n.forEach(r=>{const i=this.hot.rowIndexMapper.getRenderableFromVisualIndex(r);this.hot.view._wt.wtOverlays.getOverlays(!0).map(s=>(s==null?void 0:s.name)==="master"?s:s.clone.wtTable).forEach(s=>{const a=s.getRow(i);a&&(a.style.background=IT(a,"backgroundColor").replace(")",", 0.99)"),e.push(a))})}),this.hot._registerTimeout(()=>{e.forEach(r=>{var i;r.style.background=(i=IT(r,"backgroundColor"))===null||i===void 0?void 0:i.replace(", 0.99)",")")})},1)}validateSetting(e){return e?bf.containsNegativeValues(e)?(Yn(bf.NEGATIVE_VALUES_WARNING(e)),!1):bf.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?(Yn(bf.IS_OUT_OF_BOUNDS_WARNING(e)),!1):bf.isSingleCell(e)?(Yn(bf.IS_SINGLE_CELL(e)),!1):bf.containsZeroSpan(e)?(Yn(bf.ZERO_SPAN_WARNING(e)),!1):!0:!1}generateFromSettings(){const e=this.getSetting("cells").filter(i=>this.validateSetting(i)),n=this.mergedCellsCollection.filterOverlappingMergeCells(e),r=[];n.forEach(i=>{const{row:s,col:a,rowspan:u,colspan:h}=i,m=this.hot._createCellCoords(s,a),g=this.hot._createCellCoords(s+u-1,a+h-1),y=this.hot._createCellRange(m,m,g);this.mergeRange(y,!0,!0);for(let x=s;x<s+u;x++)for(let C=a;C<a+h;C++)(x!==s||C!==a)&&r.push([x,C,null])}),r.length!==0&&this.hot.setDataAtCell(r,void 0,void 0,this.pluginName)}clearCollections(){this.mergedCellsCollection.clear()}canMergeRange(e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)?!0:this.validateSetting(e)}mergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeActive();if(!e)return;e.setDirection(this.hot.isRtl()?"NE-SW":"NW-SE");const{from:n,to:r}=e;this.unmergeRange(e,!0),this.mergeRange(e),this.hot.selectCell(n.row,n.col,r.row,r.col,!1)}unmergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeActive();if(!e)return;const{from:n,to:r}=e;this.unmergeRange(e,!0),this.hot.selectCell(n.row,n.col,r.row,r.col,!1)}mergeRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=e.getTopStartCorner(),s=e.getBottomEndCorner(),a={row:i.row,col:i.col,rowspan:s.row-i.row+1,colspan:s.col-i.col+1},u=[];let h=null;return this.canMergeRange(a,n)?(this.hot.runHooks("beforeMergeCells",e,n),En(0,a.rowspan-1,g=>{En(0,a.colspan-1,y=>{let x=null;u[g]||(u[g]=[]),g===0&&y===0?x=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(a.row),this.hot.toPhysicalColumn(a.col)):this.hot.setCellMeta(a.row+g,a.col+y,"hidden",!0),u[g][y]=x})}),this.hot.setCellMeta(a.row,a.col,"spanned",!0),this.mergedCellsCollection.add(a,n)?(r?h=[a.row,a.col,u]:this.hot.populateFromArray(a.row,a.col,u,void 0,void 0,this.pluginName),n||this.ifChromeForceRepaint(),this.hot.runHooks("afterMergeCells",e,a,n),h):!0):!1}unmergeRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.mergedCellsCollection.getWithinRange(e);r.length!==0&&(this.hot.runHooks("beforeUnmergeCells",e,n),Te(r,i=>{this.mergedCellsCollection.remove(i.row,i.col),En(0,i.rowspan-1,s=>{En(0,i.colspan-1,a=>{this.hot.removeCellMeta(i.row+s,i.col+a,"hidden"),this.hot.removeCellMeta(i.row+s,i.col+a,"copyable")})}),this.hot.removeCellMeta(i.row,i.col,"spanned")}),this.hot.runHooks("afterUnmergeCells",e,n),this.hot.render())}toggleMerge(e){const{from:n,to:r}=e.clone().normalize(),i=this.mergedCellsCollection.get(n.row,n.col);i.row===n.row&&i.col===n.col&&i.row+i.rowspan-1===r.row&&i.col+i.colspan-1===r.col?this.unmergeRange(e):this.mergeSelection(e)}merge(e,n,r,i){const s=this.hot._createCellCoords(e,n),a=this.hot._createCellCoords(r,i);this.mergeRange(this.hot._createCellRange(s,s,a))}unmerge(e,n,r,i){const s=this.hot._createCellCoords(e,n),a=this.hot._createCellCoords(r,i);this.unmergeRange(this.hot._createCellRange(s,s,a))}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control","m"]],callback:()=>{const r=this.hot.getSelectedRangeActive();r&&!r.isSingleHeader()&&(this.toggleMerge(r),this.hot.render())},runOnlyIf:r=>!r.altKey,group:lne})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(lne)}modifyViewportRowStart(e,n){const r=this.hot.rowIndexMapper,i=r.getVisualFromRenderableIndex(e.startRow);for(let s=0;s<n;s+=1){const a=this.mergedCellsCollection.get(i,s);if(nn(a)){const u=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(a.row,1));if(u<e.startRow){e.startRow=u,this.modifyViewportRowStart(e,n);return}}}}modifyViewportRowEnd(e,n){const r=this.hot.rowIndexMapper,i=r.getVisualFromRenderableIndex(e.endRow);for(let s=0;s<n;s+=1){const a=this.mergedCellsCollection.get(i,s);if(nn(a)){const u=a.row+a.rowspan-1,h=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(u,-1));if(h>e.endRow){e.endRow=h,this.modifyViewportRowEnd(e,n);return}}}}modifyViewportColumnStart(e,n){const r=this.hot.columnIndexMapper,i=r.getVisualFromRenderableIndex(e.startColumn);for(let s=0;s<n;s+=1){const a=this.mergedCellsCollection.get(s,i);if(nn(a)){const u=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(a.col,1));if(u<e.startColumn){e.startColumn=u,this.modifyViewportColumnStart(e,n);return}}}}modifyViewportColumnEnd(e,n){const r=this.hot.columnIndexMapper,i=r.getVisualFromRenderableIndex(e.endColumn);for(let s=0;s<n;s+=1){const a=this.mergedCellsCollection.get(s,i);if(nn(a)){const u=a.col+a.colspan-1,h=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(u,-1));if(h>e.endColumn){e.endColumn=h,this.modifyViewportColumnEnd(e,n);return}}}}translateMergedCellToRenderable(e,n,r,i){const{rowIndexMapper:s,columnIndexMapper:a}=this.hot;let u,h;n===0?u=s.getNearestNotHiddenIndex(e,1):u=s.getNearestNotHiddenIndex(e+n-1,-1),i===0?h=a.getNearestNotHiddenIndex(r,1):h=a.getNearestNotHiddenIndex(r+i-1,-1);const m=e>=0?s.getRenderableFromVisualIndex(u):e,g=r>=0?a.getRenderableFromVisualIndex(h):r;return[m,g]}}function k4e(){this.generateFromSettings(),this.hot.render()}function T4e(t){if(t){const e=this.mergedCellsCollection.mergedCells,n=this.hot.getSelectedRangeActive(),r=n.getTopStartCorner(),i=n.getBottomEndCorner();for(let s=0;s<e.length;s+=1)if(r.row===e[s].row&&r.col===e[s].col&&i.row===e[s].row+e[s].rowspan-1&&i.col===e[s].col+e[s].colspan-1)return!1}return t}function j4e(t){Zi(pd,this).row=t.row,Zi(pd,this).col=t.col}function M4e(t){const e=this.hot.getSelectedRangeActive(),{highlight:n}=e,{columnIndexMapper:r,rowIndexMapper:i}=this.hot;Zi(md,this)&&(i.getRenderableFromVisualIndex(Zi(md,this).row)!==null&&(n.row=Zi(md,this).row),r.getRenderableFromVisualIndex(Zi(md,this).col)!==null&&(n.col=Zi(md,this).col),mE(md,this,null));const s=this.mergedCellsCollection.get(n.row,n.col);if(!s)return;const a=s.col,u=s.col+s.colspan-1;if(t.col<0){const g=n.col>=a&&n.col<=u?a-1:u,y=r.getNearestNotHiddenIndex(g,-1);y===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,n.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(y,n.col)-1,1)}else if(t.col>0){const g=n.col>=a&&n.col<=u?u+1:a,y=r.getNearestNotHiddenIndex(g,1);y===null?t.col=this.hot.view.countRenderableColumnsInRange(n.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(n.col,y)-1,1)}const h=s.row,m=s.row+s.rowspan-1;if(t.row<0){const g=n.row>=h&&n.row<=m?h-1:m,y=i.getNearestNotHiddenIndex(g,-1);y===null?t.row=-this.hot.view.countRenderableRowsInRange(0,n.row):t.row=-Math.max(this.hot.view.countRenderableRowsInRange(y,n.row)-1,1)}else if(t.row>0){const g=n.row>=h&&n.row<=m?m+1:h,y=i.getNearestNotHiddenIndex(g,1);y===null?t.row=this.hot.view.countRenderableRowsInRange(n.row,this.hot.countRows()):t.row=Math.max(this.hot.view.countRenderableRowsInRange(n.row,y)-1,1)}}function P4e(t){const e=this.hot.getSelectedRangeActive(),n=e.clone(),{to:r}=e,{columnIndexMapper:i,rowIndexMapper:s}=this.hot,a=(u,h)=>{n.expand(this.hot._createCellCoords(u,h));for(let m=0;m<this.mergedCellsCollection.mergedCells.length;m+=1)n.expandByRange(this.mergedCellsCollection.mergedCells[m].getRange())};if(t.col<0){let u=this.mergedCellsCollection.getStartMostColumnIndex(e,r.col)+t.col;a(r.row,u),e.getHorizontalDirection()==="E-W"&&n.getHorizontalDirection()==="E-W"&&(u=n.getTopStartCorner().col);const h=i.getNearestNotHiddenIndex(u,1);h!==null&&(t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(h,r.col)-1,1))}else if(t.col>0){let u=this.mergedCellsCollection.getEndMostColumnIndex(e,r.col)+t.col;a(r.row,u),e.getHorizontalDirection()==="W-E"&&n.getHorizontalDirection()==="W-E"&&(u=n.getBottomEndCorner().col);const h=i.getNearestNotHiddenIndex(u,-1);h!==null&&(t.col=Math.max(this.hot.view.countRenderableColumnsInRange(r.col,h)-1,1))}if(t.row<0){let u=this.mergedCellsCollection.getTopMostRowIndex(e,r.row)+t.row;a(u,r.col),e.getVerticalDirection()==="S-N"&&n.getVerticalDirection()==="S-N"&&(u=n.getTopStartCorner().row);const h=s.getNearestNotHiddenIndex(u,1);h!==null&&(t.row=-Math.max(this.hot.view.countRenderableRowsInRange(h,r.row)-1,1))}else if(t.row>0){let u=this.mergedCellsCollection.getBottomMostRowIndex(e,r.row)+t.row;a(u,r.col),e.getVerticalDirection()==="N-S"&&n.getVerticalDirection()==="N-S"&&(u=n.getBottomStartCorner().row);const h=s.getNearestNotHiddenIndex(u,-1);h!==null&&(t.row=Math.max(this.hot.view.countRenderableRowsInRange(r.row,h)-1,1))}}function A4e(){const t=this.hot.getSelectedRangeLast(),{highlight:e}=t;if(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader()){mE(md,this,e.clone());return}for(let r=0;r<this.mergedCellsCollection.mergedCells.length;r+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[r].getRange(),!1);for(let r=0;r<this.mergedCellsCollection.mergedCells.length;r+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[r].getRange(),!1);const n=this.mergedCellsCollection.get(e.row,e.col);mE(md,this,e.clone()),n&&e.assign(n)}function une(t,e,n,r){if(t<0||e<0)return;const i=this.mergedCellsCollection.get(t,e);if(!i)return;const{row:s,col:a,colspan:u,rowspan:h}=i,m=s,g=a,y=s+h-1,x=a+u-1;if(r==="render"&&this.getSetting("virtualized")){const C=this.hot.view.getActiveOverlayName(),E=["top","top_inline_start_corner"].includes(C)?0:this.hot.getFirstRenderedVisibleRow(),M=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(C)?0:this.hot.getFirstRenderedVisibleColumn();return[Lr(E,m,y),Lr(M,g,x),Lr(this.hot.getLastRenderedVisibleRow(),m,y),Lr(this.hot.getLastRenderedVisibleColumn(),g,x)]}return[m,g,y,x]}function O4e(t){t.items.push({name:"---------"},v4e(this))}function dne(){mE(md,this,null)}function I4e(){if(Zi(md,this).isCell())return;const t=this.hot.getSelectedRangeActive(),e=t.getVerticalDirection(),n=t.getHorizontalDirection(),r=Zi(md,this).clone().normalize();Zi(Sf,this).setActiveNode(r.row,r.col),Zi(pd,this).row>0||Zi(pd,this).col>0?Zi(Sf,this).setPrevNodeAsActive():(n==="E-W"&&Zi(pd,this).col<0||e==="S-N"&&Zi(pd,this).row<0)&&Zi(Sf,this).setNextNodeAsActive()}function D4e(t,e){const{columnIndexMapper:n,rowIndexMapper:r}=this.hot;let i=this.hot.getActiveSelectionLayerIndex(),s=null,a=null;if(Zi(pd,this).col<0){const{rowEnd:u,colEnd:h,selectionLayer:m}=Zi(Sf,this).getPrevHorizontalNode();a=n.getNearestNotHiddenIndex(h,-1),s=r.getNearestNotHiddenIndex(u,-1),i=m}else if(Zi(pd,this).col>0){const{rowStart:u,colStart:h,selectionLayer:m}=Zi(Sf,this).getNextHorizontalNode();a=n.getNearestNotHiddenIndex(h,1),s=r.getNearestNotHiddenIndex(u,1),i=m}else if(Zi(pd,this).row<0){const{rowEnd:u,colEnd:h,selectionLayer:m}=Zi(Sf,this).getPrevVerticalNode();a=n.getNearestNotHiddenIndex(h,-1),s=r.getNearestNotHiddenIndex(u,-1),i=m}else if(Zi(pd,this).row>0){const{rowStart:u,colStart:h,selectionLayer:m}=Zi(Sf,this).getNextVerticalNode();a=n.getNearestNotHiddenIndex(h,1),s=r.getNearestNotHiddenIndex(u,1),i=m}if(s!==null||a!==null){this.hot.selection.setActiveSelectionLayerIndex(i);const u=this.hot.getSelectedRangeActive(),h=this.hot._createCellCoords(s,a),m=this.mergedCellsCollection.get(h.row,h.col),g=this.hot.selection.highlight.getFocus();t=h.row,e=h.col,m?u.highlight.assign({row:this.hot.rowIndexMapper.getNearestNotHiddenIndex(m.row,1),col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(m.col,1)}):u.highlight.assign(h),g.clear(),g.add(h).commit()}Zi(Sf,this).setActiveNode(t,e,i),mE(pd,this,{row:0,col:0})}function H4e(){Zi(Sf,this).buildFocusOrder(this.hot.getSelectedRange())}function L4e(t,e,n){const r=this.mergedCellsCollection.get(t,e);r&&(r.row!==t||r.col!==e?n.copyable=!1:(n.rowspan=r.rowspan,n.colspan=r.colspan))}function $4e(t){if(this.getSetting("virtualized"))return;const e=this.hot.countCols();this.modifyViewportRowStart(t,e),this.modifyViewportRowEnd(t,e)}function F4e(t){if(this.getSetting("virtualized"))return;const e=this.hot.countRows();this.modifyViewportColumnStart(t,e),this.modifyViewportColumnEnd(t,e)}function z4e(t,e){const n=this.autofillCalculations.getDirection(e,t);if(this.autofillCalculations.dragAreaOverlapsCollections(e,t,n))return e;const r=this.hot._createCellCoords(e[0],e[1]),i=this.hot._createCellCoords(e[2],e[3]),s=this.hot._createCellRange(r,r,i),a=this.mergedCellsCollection.getWithinRange(s);return a.length===0?t:this.autofillCalculations.snapDragArea(e,t,n,a)}function V4e(t,e){this.mergedCellsCollection.shiftCollections("right",t,e)}function B4e(t,e){this.mergedCellsCollection.shiftCollections("left",t,e)}function W4e(t,e,n){n!=="auto"&&this.mergedCellsCollection.shiftCollections("down",t,e)}function U4e(t,e){this.mergedCellsCollection.shiftCollections("up",t,e)}function Y4e(t,e){e==="Autofill.fill"&&this.autofillCalculations.recreateAfterDataPopulation(t)}function G4e(t,e){if(e&&e==="area"){const n=this.hot.getSelectedRangeActive(),r=this.mergedCellsCollection.getWithinRange(n);Te(r,i=>{n.getBottomEndCorner().row===i.getLastRow()&&n.getBottomEndCorner().col===i.getLastColumn()&&(t[2]=i.row,t[3]=i.col)})}}function K4e(t,e,n,r){if(n)return this.selectionCalculations.getSelectedMergedCellClassName(t,e,n,r)}function q4e(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function X4e(t,e,n,r){if(!(r instanceof MouseEvent))return;const i=this.hot.getSelectedRangeActive(),s=this.mergedCellsCollection.getByRange(i);if(!s)return;const a=this.hot._createCellCoords(s.row,s.col),u=this.hot._createCellCoords(s.row+s.rowspan-1,s.col+s.colspan-1);return this.hot.selection.getLayerLevel()===0&&i.isEqual(this.hot._createCellRange(a,a,u))}function Q4e(t,e,n){if(this.hot.getSettings().rowHeaders||n==="bottom"||n==="bottom_inline_start_corner")return t;let r,i;if(n==="master")r=this.hot.getFirstRenderedVisibleColumn(),i=this.hot.getLastRenderedVisibleColumn();else{const x=this.hot.view.getOverlayByName(n);r=this.hot.columnIndexMapper.getVisualFromRenderableIndex(x.clone.wtTable.getFirstRenderedColumn()),i=this.hot.columnIndexMapper.getVisualFromRenderableIndex(x.clone.wtTable.getLastRenderedColumn())}if(!this.mergedCellsCollection.get(e,r))return t;const a=this.hot._createCellCoords(e,r),u=this.hot._createCellCoords(e,i),h=this.hot._createCellRange(a,a,u),m=this.mergedCellsCollection.getWithinRange(h,!0),g=m.reduce((x,C)=>{let{rowspan:E}=C;return Math.max(x,E)},1);let y=0;return m.length>1&&m[0].rowspan<g&&(y=g-m[0].rowspan),m.forEach(x=>{let{rowspan:C}=x,E=0;n==="top"||n==="top_inline_start_corner"?E=Math.min(g,this.hot.view.countNotHiddenFixedRowsTop()-e):E=C-y,t=Math.max(t??0,one(this.hot,e,E))}),t}function Z4e(t,e){return function(n,r){const[,...i]=n,[,...s]=r;return function a(u){const h=t[u],m=e[u],g=i[u],y=s[u],x=m.multiColumnSorting,E=(x.compareFunctionFactory?x.compareFunctionFactory:TJ(m.type))(h,m,x)(g,y);if(E===hl){const M=u+1;if(typeof e[M]<"u")return a(M)}return E}(0)}}const hne="sort";function J4e(t,e,n){const r=[];return n===!1||t.isColumnSorted(e)&&t.getNumberOfSortedColumns()>1&&r.push(`${hne}-${t.getIndexOfColumnInSortQueue(e)+1}`),r}function e$e(t){const e=t.className.split(" "),n=new RegExp(`^${hne}-[0-9]{1,2}$`);return e.filter(r=>n.test(r))}function t$e(t,e,n){return(e=n$e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n$e(t){var e=r$e(t,"string");return typeof e=="symbol"?e:e+""}function r$e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const pA="multiColumnSorting",i$e=170,fne=pA;kJ(pA,Z4e);class s$e extends FJ{constructor(){super(...arguments),t$e(this,"pluginKey",pA)}static get PLUGIN_KEY(){return pA}static get PLUGIN_PRIORITY(){return i$e}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){super.enablePlugin()}disablePlugin(){super.disablePlugin()}registerShortcuts(){super.registerShortcuts(),this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Shift","Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeActive();return e.row===-1&&e.col>=0&&this.sort(this.getNextSortConfig(e.col,WM)),!1},runOnlyIf:()=>{var e,n;const r=(e=this.hot.getSelectedRangeActive())===null||e===void 0?void 0:e.highlight;return r&&((n=this.hot.getSelectedRangeActive())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(r)&&r.isHeader()},relativeToGroup:Pm,position:"before",group:fne})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(fne)}sort(e){super.sort(e)}clearSort(){super.clearSort()}isSorted(){return super.isSorted()}getSortConfig(e){return super.getSortConfig(e)}setSortConfig(e){super.setSortConfig(e)}getNormalizedSortConfigs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Array.isArray(e)?e:[e]}updateHeaderClasses(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];super.updateHeaderClasses(e,...r),cn(e,e$e(e)),this.enabled!==!1&&st(e,J4e(...r))}onAfterOnCellMouseDown(e,n){fz(n.row,n.col,e)!==!1&&this.wasClickableHeaderClicked(e,n.col)&&(this.hot.getShortcutManager().isCtrlPressed()?(this.hot.deselectCell(),this.hot.selectColumns(n.col),this.sort(this.getNextSortConfig(n.col,WM))):this.sort(this.getColumnNextConfig(n.col)))}}function mne(t,e,n){return(e=o$e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o$e(t){var e=a$e(t,"string");return typeof e=="symbol"?e:e+""}function a$e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const l$e="multipleSelectionHandles",c$e=160;class u$e extends Zr{constructor(){super(...arguments),mne(this,"dragged",[]),mne(this,"lastSetCell",null)}static get PLUGIN_KEY(){return l$e}static get PLUGIN_PRIORITY(){return c$e}isEnabled(){return Vh()}enablePlugin(){this.enabled||(this.registerListeners(),super.enablePlugin())}registerListeners(){const e=this,{rootElement:n}=this.hot;function r(i){if(e.dragged.length===1)return e.dragged.splice(0,e.dragged.length),!0;const s=e.dragged.indexOf(i);if(s===-1)return!1;s===0?e.dragged=e.dragged.slice(0,1):s===1&&(e.dragged=e.dragged.slice(-1))}this.eventManager.addEventListener(n,"touchstart",i=>{let s;if(Dn(i.target,"topSelectionHandle-HitArea"))return s=e.hot.getSelectedRangeActive(),e.dragged.push("top"),e.touchStartRange={width:s.getWidth(),height:s.getHeight(),direction:s.getDirection()},i.preventDefault(),!1;if(Dn(i.target,"bottomSelectionHandle-HitArea"))return s=e.hot.getSelectedRangeActive(),e.dragged.push("bottom"),e.touchStartRange={width:s.getWidth(),height:s.getHeight(),direction:s.getDirection()},i.preventDefault(),!1}),this.eventManager.addEventListener(n,"touchend",i=>{if(Dn(i.target,"topSelectionHandle-HitArea"))return r.call(e,"top"),e.touchStartRange=void 0,i.preventDefault(),!1;if(Dn(i.target,"bottomSelectionHandle-HitArea"))return r.call(e,"bottom"),e.touchStartRange=void 0,i.preventDefault(),!1}),this.eventManager.addEventListener(n,"touchmove",i=>{const{rootDocument:s}=this.hot;let a,u,h,m,g,y;if(e.dragged.length===0)return;const x=s.elementFromPoint(i.touches[0].clientX,i.touches[0].clientY);!x||x===e.lastSetCell||((x.nodeName==="TD"||x.nodeName==="TH")&&(a=e.hot.getCoords(x),a.col===-1&&(a.col=0),u=e.hot.getSelectedRangeActive(),h=u.getWidth(),m=u.getHeight(),g=u.getDirection(),h===1&&m===1&&e.hot.selection.setRangeEnd(a),y=e.getCurrentRangeCoords(u,a,e.touchStartRange.direction,g,e.dragged[0]),y.start!==null&&e.hot.selection.setRangeStart(y.start),e.hot.selection.setRangeEnd(y.end),e.lastSetCell=x),i.preventDefault())})}getCurrentRangeCoords(e,n,r,i,s){const a=e.getTopStartCorner(),u=e.getBottomEndCorner(),h=e.getBottomStartCorner(),m=e.getTopEndCorner();let g={start:null,end:null};switch(r){case"NE-SW":switch(i){case"NE-SW":case"NW-SE":s==="top"?g={start:this.hot._createCellCoords(n.row,e.highlight.col),end:this.hot._createCellCoords(h.row,n.col)}:g={start:this.hot._createCellCoords(e.highlight.row,n.col),end:this.hot._createCellCoords(n.row,a.col)};break;case"SE-NW":s==="bottom"&&(g={start:this.hot._createCellCoords(u.row,n.col),end:this.hot._createCellCoords(n.row,a.col)});break}break;case"NW-SE":switch(i){case"NE-SW":s==="top"?g={start:n,end:h}:g.end=n;break;case"NW-SE":s==="top"?g={start:n,end:u}:g.end=n;break;case"SE-NW":s==="top"?g={start:n,end:a}:g.end=n;break;case"SW-NE":s==="top"?g={start:n,end:m}:g.end=n;break}break;case"SW-NE":switch(i){case"NW-SE":s==="bottom"?g={start:this.hot._createCellCoords(n.row,a.col),end:this.hot._createCellCoords(h.row,n.col)}:g={start:this.hot._createCellCoords(a.row,n.col),end:this.hot._createCellCoords(n.row,u.col)};break;case"SW-NE":s==="top"?g={start:this.hot._createCellCoords(e.highlight.row,n.col),end:this.hot._createCellCoords(n.row,u.col)}:g={start:this.hot._createCellCoords(n.row,a.col),end:this.hot._createCellCoords(a.row,n.col)};break;case"SE-NW":s==="bottom"?g={start:this.hot._createCellCoords(n.row,m.col),end:this.hot._createCellCoords(a.row,n.col)}:s==="top"&&(g={start:h,end:n});break}break;case"SE-NW":switch(i){case"NW-SE":case"NE-SW":case"SW-NE":s==="top"&&(g.end=n);break;case"SE-NW":s==="top"?g.end=n:g={start:n,end:a};break}break}return g}isDragged(){return this.dragged.length>0}}function n3(){let{label:t="",colspan:e=1,origColspan:n=1,collapsible:r=!1,crossHiddenColumns:i=[],isCollapsed:s=!1,isHidden:a=!1,isRoot:u=!1,isPlaceholder:h=!1,headerClassNames:m=[]}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{label:t,colspan:e,origColspan:n,collapsible:r,isCollapsed:s,crossHiddenColumns:i,isHidden:a,isRoot:u,isPlaceholder:h,headerClassNames:m}}function pne(){return{label:"",isPlaceholder:!0}}function d$e(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0;const n=[];if(e===0)return n;Te(t,i=>{const s=[];let a=0;n.push(s),Te(i,u=>{const h=n3();if(nn(u)){const{label:g,colspan:y,headerClassName:x}=u;h.label=Hi(g),typeof y=="number"&&y>1&&(h.colspan=y,h.origColspan=y),typeof x=="string"&&(h.headerClassNames=[...x.split(" ")])}else h.label=Hi(u);a+=h.origColspan;let m=!1;if(a>=e&&(h.colspan=h.origColspan-(a-e),h.origColspan=h.colspan,m=!0),s.push(h),h.colspan>1)for(let g=0;g<h.colspan-1;g++)s.push(pne());return!m})});const r=Math.max(...di(n,i=>i.length));return Te(n,i=>{if(i.length<r){const s=di(new Array(r-i.length),()=>n3());i.splice(i.length,0,...s)}}),n}function r3(t,e,n){h$e(t,e),e.set(t,n)}function h$e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lh(t,e){return t.get(gne(t,e))}function pE(t,e,n){return t.set(gne(t,e),n),n}function gne(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const vne=["label","collapsible"];var op=new WeakMap,Zb=new WeakMap,i3=new WeakMap;class f$e{constructor(){r3(this,op,[]),r3(this,Zb,0),r3(this,i3,1/0)}setColumnsLimit(e){pE(i3,this,e)}setData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];pE(op,this,d$e(e,lh(i3,this))),pE(Zb,this,lh(op,this).length)}getData(){return lh(op,this)}mergeWith(e){Te(e,n=>{let{row:r,col:i,...s}=n;const a=this.getHeaderSettings(r,i);a!==null&&jo(a,s,vne)})}map(e){Te(lh(op,this),n=>{Te(n,r=>{const i=e({...r});nn(i)&&jo(r,i,vne)})})}getHeaderSettings(e,n){var r;if(e>=lh(Zb,this)||e<0)return null;const i=lh(op,this)[e];return Array.isArray(i)===!1||n>=i.length?null:(r=i[n])!==null&&r!==void 0?r:null}getHeadersSettings(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const i=[];if(e>=lh(Zb,this)||e<0)return i;const s=lh(op,this)[e];let a=0;for(let u=n;u<s.length;u++){const h=s[u];if(h.isPlaceholder&>("The first column settings cannot overlap the other header layers"),a+=h.colspan,i.push(h),h.colspan>1&&(u+=h.colspan-1),a===r)break;a>r&>("The last column settings cannot overlap the other header layers")}return i}getLayersCount(){return lh(Zb,this)}getColumnsCount(){return lh(Zb,this)>0?lh(op,this)[0].length:0}clear(){pE(op,this,[]),pE(Zb,this,0)}}function s3(t,e,n){return(e=m$e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m$e(t){var e=p$e(t,"string");return typeof e=="symbol"?e:e+""}function p$e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const bne="DF-pre-order";function yne(t,e){let n=t.call(e,this);for(let r=0;r<this.childs.length;r++){if(n===!1)return!1;n=yne.call(this.childs[r],t,e)}return n}const g$e="DF-post-order";function xne(t,e){for(let n=0;n<this.childs.length;n++)if(xne.call(this.childs[n],t,e)===!1)return!1;return t.call(e,this)}const wne="BF";function v$e(t,e){const n=[this];function r(){if(n.length===0)return;const i=n.shift();n.push(...i.childs),t.call(e,i)!==!1&&r()}r()}const b$e=wne,Cne=new Map([[bne,yne],[g$e,xne],[wne,v$e]]);class gA{constructor(e){s3(this,"data",{}),s3(this,"parent",null),s3(this,"childs",[]),this.data=e}addChild(e){e.parent=this,this.childs.push(e)}cloneTree(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this;const n=new gA({...e.data});for(let r=0;r<e.childs.length;r++)n.addChild(this.cloneTree(e.childs[r]));return n}replaceTreeWith(e){this.data={...e.data},this.childs=[];for(let n=0;n<e.childs.length;n++)this.addChild(e.childs[n])}walkDown(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:b$e;Cne.has(n)||gt(`Traversal strategy "${n}" does not exist`),Cne.get(n).call(this,e,this)}walkUp(e){const n=this,r=i=>{e.call(n,i)!==!1&&i.parent!==null&&r(i.parent)};r(this)}}function o3(t,e,n){y$e(t,e),e.set(t,n)}function y$e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jl(t,e){return t.get(Sne(t,e))}function x$e(t,e,n){return t.set(Sne(t,e),n),n}function Sne(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var wC=new WeakMap,Jb=new WeakMap,CC=new WeakMap;class w$e{constructor(e){o3(this,wC,new Map),o3(this,Jb,new Map),o3(this,CC,null),x$e(CC,this,e)}getRoots(){return Array.from(Jl(wC,this).values())}getRootByColumn(e){let n;return Jl(Jb,this).has(e)&&(n=Jl(wC,this).get(Jl(Jb,this).get(e))),n}getNode(e,n){const r=this.getRootByColumn(n);if(!r)return;const i=n-Jl(Jb,this).get(n);let s=0,a;return r.walkDown(u=>{const{data:{origColspan:h,headerLevel:m}}=u;if(e===m){if(i>=s&&i<=s+h-1)return a=u,a.data.isRoot=n===a.data.columnIndex,!1;s+=h}}),a}rebuildTreeIndex(){let e=0;Jl(Jb,this).clear(),Te(Jl(wC,this),n=>{let[,{data:{colspan:r}}]=n;for(let i=e;i<e+r;i++)Jl(Jb,this).set(i,e);e+=r})}buildTree(){this.clear();const e=Jl(CC,this).getColumnsCount();let n=0;for(;n<e;){const r=Jl(CC,this).getHeaderSettings(0,n),i=new gA;Jl(wC,this).set(n,i),this.buildLeaves(i,n,0,r.origColspan),n+=r.origColspan}this.rebuildTreeIndex()}buildLeaves(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;const s=Jl(CC,this).getHeadersSettings(r,n,i);r+=1,Te(s,a=>{const u={...a,headerLevel:r-1,columnIndex:n};let h;r===1?(e.data=u,h=e):(h=new gA(u),e.addChild(h)),r<Jl(CC,this).getLayersCount()&&this.buildLeaves(h,n,r,a.origColspan),n+=a.origColspan})}clear(){Jl(wC,this).clear(),Jl(Jb,this).clear()}}function Rne(t,e){t.walkDown(n=>{let{data:r,childs:i}=n;if(!r.isHidden&&(e(r.columnIndex),i.length===0))for(let s=1;s<r.colspan;s++)e(r.columnIndex+s)})}function vA(t,e){let{childs:n}=t;if(n.length!==0)return n[0].data[e]}function bA(t){return vA(t,"origColspan")===t.data.origColspan}function a3(t){const{data:e,childs:n}=t;if(!e.isCollapsed||e.isHidden||e.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(bA(t))return a3(n[0]);e.isCollapsed=!1;const i=n.slice(1),s=new Set;let a=0;if(i.length>0)Te(i,u=>{u.replaceTreeWith(u.data.clonedTree),u.data.clonedTree=null;const h=u.data;a+=h.colspan,Rne(u,m=>{s.add(m)})});else{const{colspan:u,origColspan:h,columnIndex:m}=e;a=h-u;for(let g=1;g<h;g++)s.add(m+g)}return t.walkUp(u=>{const{data:h}=u;h.colspan+=a,h.colspan>=h.origColspan?(h.colspan=h.origColspan,h.isCollapsed=!1):bA(u)&&(h.isCollapsed=vA(u,"isCollapsed"))}),{rollbackModification:()=>l3(t),affectedColumns:Array.from(s),colspanCompensation:a}}function l3(t){var e;const{data:n,childs:r}=t;if(n.isCollapsed||n.isHidden||n.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(bA(t))return l3(r[0]);n.isCollapsed=!0;const s=r.slice(1),a=new Set;if(s.length>0)Te(s,h=>{Rne(h,m=>{a.add(m)}),h.data.clonedTree=h.cloneTree(),h.walkDown(m=>{let{data:g}=m;g.isHidden=!0})});else{const{origColspan:h,columnIndex:m}=n;for(let g=1;g<h;g++){const y=m+g;a.add(y)}}const u=n.colspan-((e=vA(t,"colspan"))!==null&&e!==void 0?e:1);return t.walkUp(h=>{const{data:m}=h;m.colspan-=u,m.colspan<=1?(m.colspan=1,m.isCollapsed=!0):bA(h)&&(m.isCollapsed=vA(h,"isCollapsed"))}),{rollbackModification:()=>a3(t),affectedColumns:Array.from(a),colspanCompensation:u}}function C$e(t,e){Number.isInteger(e)||gt("The passed gridColumnIndex argument has invalid type."),t.childs.length>0&>(Jr`The passed node is not the last node on the tree. Only for\x20 the last node, the hide column modification can be applied.`);const{crossHiddenColumns:n}=t.data;if(n.includes(e))return;let r=!1;t.walkUp(i=>{const{data:{collapsible:s}}=i;if(s)return r=!0,!1}),!r&&t.walkUp(i=>{const{data:s}=i;s.crossHiddenColumns.push(e),s.colspan>1?s.colspan-=1:s.isHidden=!0})}function S$e(t,e){Number.isInteger(e)||gt("The passed gridColumnIndex argument has invalid type."),t.childs.length>0&>(Jr`The passed node is not the last node on the tree. Only for\x20 the last node, the show column modification can be applied.`);const{crossHiddenColumns:n}=t.data;if(!n.includes(e))return;let r=!1;t.walkUp(i=>{const{data:{collapsible:s}}=i;if(s)return r=!0,!1}),!r&&t.walkUp(i=>{const{data:s}=i;s.crossHiddenColumns.splice(s.crossHiddenColumns.indexOf(e),1),!s.isHidden&&s.colspan<s.origColspan&&(s.colspan+=1),s.isHidden=!1})}const _ne=new Map([["collapse",l3],["expand",a3],["hide-column",C$e],["show-column",S$e]]);function R$e(t,e,n){return _ne.has(t)||gt(`The node modifier action ("${t}") does not exist.`),_ne.get(t)(e,n)}function yA(t){const e=[];return Te(t,n=>{n.walkDown(r=>{const i=r.data,{origColspan:s,columnIndex:a,headerLevel:u,crossHiddenColumns:h}=i,m=E$e(e,u);let g=!1;for(let y=a;y<a+s;y++)if(h.includes(y)||g)m.push(pne());else{const C=_$e(i);C.isRoot=!0,m.push(C),g=!0}})}),e}function _$e(t){const{crossHiddenColumns:e,...n}=n3(t);return n}function E$e(t,e){let n;return Array.isArray(t[e])?n=t[e]:(n=[],t[e]=n),n}function c3(t,e,n){N$e(t,e),e.set(t,n)}function N$e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gE(t,e,n){return t.set(Ene(t,e),n),n}function Ls(t,e){return t.get(Ene(t,e))}function Ene(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Rf=new WeakMap,Lc=new WeakMap,ey=new WeakMap;class k$e{constructor(){c3(this,Rf,new f$e),c3(this,Lc,new w$e(Ls(Rf,this))),c3(this,ey,[[]])}setState(e){Ls(Rf,this).setData(e);let n=!1;try{Ls(Lc,this).buildTree()}catch{Ls(Lc,this).clear(),Ls(Rf,this).clear(),n=!0}return gE(ey,this,yA(Ls(Lc,this).getRoots())),n}setColumnsLimit(e){Ls(Rf,this).setColumnsLimit(e)}mergeStateWith(e){const n=di(e,r=>{let{row:i,...s}=r;return{row:i<0?this.rowCoordsToLevel(i):i,...s}});Ls(Rf,this).mergeWith(n),Ls(Lc,this).buildTree(),gE(ey,this,yA(Ls(Lc,this).getRoots()))}mapState(e){Ls(Rf,this).map(e),Ls(Lc,this).buildTree(),gE(ey,this,yA(Ls(Lc,this).getRoots()))}mapNodes(e){return xc(Ls(Lc,this).getRoots(),(n,r)=>(r.walkDown(i=>{const s=e(i.data);s!==void 0&&n.push(s)}),n),[])}triggerNodeModification(e,n,r){n<0&&(n=this.rowCoordsToLevel(n));const i=Ls(Lc,this).getNode(n,r);let s;return i&&(s=R$e(e,i,r),gE(ey,this,yA(Ls(Lc,this).getRoots()))),s}triggerColumnModification(e,n){return this.triggerNodeModification(e,-1,n)}rowCoordsToLevel(e){if(e>=0)return null;const n=e+Math.max(this.getLayersCount(),1);return n<0?null:n}levelToRowCoords(e){if(e<0)return null;const n=e-Math.max(this.getLayersCount(),1);return n>=0?null:n}getHeaderSettings(e,n){var r,i;return e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount()?null:(r=(i=Ls(ey,this)[e])===null||i===void 0?void 0:i[n])!==null&&r!==void 0?r:null}getHeaderTreeNodeData(e,n){const r=this.getHeaderTreeNode(e,n);return r?{...r.data}:null}getHeaderTreeNode(e,n){if(e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount())return null;const r=Ls(Lc,this).getNode(e,n);return r||null}findTopMostEntireHeaderLevel(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;const r=n-e+1;let i=!1,s=null;for(let a=e;a<=n;a++){const u=Ls(Lc,this).getRootByColumn(a);if(!u)break;i=!0,u.walkDown(h=>{const{columnIndex:m,headerLevel:g,origColspan:y,isHidden:x}=h.data;x||y<=r&&m>=e&&m+y-1<=n&&(s===null||g<s)&&(s=g)},bne)}return i&&s===null?-1:this.levelToRowCoords(s??0)}findLeftMostColumnIndex(e,n){var r;const{isRoot:i}=(r=this.getHeaderSettings(e,n))!==null&&r!==void 0?r:{isRoot:!0};if(i)return n;let s=n-1;for(;s>=0;){var a;const{isRoot:u}=(a=this.getHeaderSettings(e,s))!==null&&a!==void 0?a:{isRoot:!0};if(u)break;s-=1}return s}findRightMostColumnIndex(e,n){var r;const{isRoot:i,origColspan:s}=(r=this.getHeaderSettings(e,n))!==null&&r!==void 0?r:{isRoot:!0,origColspan:1};if(i)return n+s-1;let a=n+1;for(;a<this.getColumnsCount();){var u;const{isRoot:h}=(u=this.getHeaderSettings(e,a))!==null&&u!==void 0?u:{isRoot:!0};if(h)break;a+=1}return a-1}getLayersCount(){return Ls(Rf,this).getLayersCount()}getColumnsCount(){return Ls(Rf,this).getColumnsCount()}clear(){gE(ey,this,[]),Ls(Rf,this).clear(),Ls(Lc,this).clear()}}function vE(t,e,n){return(e=T$e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function T$e(t){var e=j$e(t,"string");return typeof e=="symbol"?e:e+""}function j$e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class M$e{constructor(e,n){vE(this,"hot",void 0),vE(this,"nestedHeaderSettingsGetter",void 0),vE(this,"layersCount",0),vE(this,"container",void 0),vE(this,"widthsMap",void 0),this.hot=e,this.nestedHeaderSettingsGetter=n,this.widthsMap=this.hot.columnIndexMapper.createAndRegisterIndexMap("nestedHeaders.widthsMap","physicalIndexToValue")}setLayersCount(e){return this.layersCount=e,this}getWidth(e){return this.widthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e))}buildWidthsMap(){const e=this.hot.getCurrentThemeName();this.container=this.hot.rootDocument.createElement("div"),this.container.classList.add("handsontable","htGhostTable","htAutoSize"),e&&this.container.classList.add(e),this._buildGhostTable(this.container),this.hot.rootDocument.body.appendChild(this.container);const n=this.container.querySelectorAll("tr:last-of-type th"),r=n.length;this.widthsMap.clear();for(let i=0;i<r;i++){const s=this.hot.columnIndexMapper.getVisualFromRenderableIndex(i),a=this.hot.toPhysicalColumn(s);this.widthsMap.setValueAtIndex(a,n[i].offsetWidth)}this.container.parentNode.removeChild(this.container),this.container=null}_buildGhostTable(e){const{rootDocument:n,columnIndexMapper:r}=this.hot,i=n.createDocumentFragment(),s=n.createElement("table"),a=!!this.hot.getSettings().dropdownMenu,u=r.getRenderableIndexesLength();for(let h=0;h<this.layersCount;h++){const m=n.createElement("tr");for(let g=0;g<u;g++){let y=r.getVisualFromRenderableIndex(g);y===null&&(y=g);const x=n.createElement("th"),C=this.nestedHeaderSettingsGetter(h,y);if(C&&(!C.isPlaceholder||C.isHidden)){let E=C.label;a&&(E+='<button class="changeType"></button>'),M0(x,E,this.hot.getSettings().sanitizer),x.colSpan=C.colspan,m.appendChild(x)}}s.appendChild(m)}i.appendChild(s),e.appendChild(i)}clear(){this.widthsMap.clear(),this.container=null}}function P$e(t,e){kne(t,e),e.add(t)}function Nne(t,e,n){return(e=A$e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A$e(t){var e=O$e(t,"string");return typeof e=="symbol"?e:e+""}function O$e(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function SC(t,e,n){kne(t,e),e.set(t,n)}function kne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ap(t,e,n){return t.set(ia(t,e),n),n}function wr(t,e){return t.get(ia(t,e))}function ia(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Tne="nestedHeaders",I$e=280;var Ti=new WeakMap,hv=new WeakMap,bE=new WeakMap,xA=new WeakMap,wA=new WeakMap,ty=new WeakMap,Ra=new WeakSet;class D$e extends Zr{constructor(){super(...arguments),P$e(this,Ra),SC(this,Ti,new k$e),SC(this,hv,null),SC(this,bE,null),SC(this,xA,!1),SC(this,wA,null),Nne(this,"ghostTable",new M$e(this.hot,(e,n)=>this.getHeaderSettings(e,n))),Nne(this,"detectedOverlappedHeaders",!1),SC(this,ty,()=>{var e;const n=(e=this.hot)===null||e===void 0?void 0:e.getSelectedRangeActive();if(!n)return;const{highlight:r}=n;if(r.isHeader()&&r.col>=0){const s=wr(Ti,this).findLeftMostColumnIndex(r.row,r.col),a=this.hot.selection.highlight.getFocus();a.visualCellRange.highlight.col=s,a.visualCellRange.from.col=s,a.visualCellRange.to.col=s,a.commit()}})}static get PLUGIN_KEY(){return Tne}static get PLUGIN_PRIORITY(){return I$e}isEnabled(){return!!this.hot.getSettings()[Tne]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();(!Array.isArray(n)||!Array.isArray(n[0]))&&Yn(Jr`Your Nested Headers plugin configuration is invalid. The settings has to be\x20 passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",()=>ia(Ra,this,Z$e).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return ia(Ra,e,J$e).call(e,...i)}),this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return ia(Ra,e,F$e).call(e,...i)}),this.addHook("afterOnCellMouseDown",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return ia(Ra,e,z$e).call(e,...i)}),this.addHook("beforeOnCellMouseOver",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return ia(Ra,e,V$e).call(e,...i)}),this.addHook("beforeOnCellMouseUp",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return ia(Ra,e,B$e).call(e,...i)}),this.addHook("beforeSelectionHighlightSet",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return ia(Ra,e,W$e).call(e,...i)}),this.addHook("modifyTransformStart",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return ia(Ra,e,U$e).call(e,...i)}),this.addHook("afterSelection",()=>wr(ty,this).call(this)),this.addHook("afterSelectionFocusSet",()=>wr(ty,this).call(this)),this.addHook("beforeViewportScrollHorizontally",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return ia(Ra,e,H$e).call(e,...i)}),this.addHook("afterGetColumnHeaderRenderers",r=>ia(Ra,this,G$e).call(this,r)),this.addHook("modifyColWidth",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return ia(Ra,e,q$e).call(e,...i)}),this.addHook("modifyColumnHeaderValue",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return ia(Ra,e,X$e).call(e,...i)}),this.addHook("beforeHighlightingColumnHeader",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return ia(Ra,e,L$e).call(e,...i)}),this.addHook("beforeCopy",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return ia(Ra,e,$$e).call(e,...i)}),this.addHook("beforeSelectColumns",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return ia(Ra,e,Y$e).call(e,...i)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return ia(Ra,e,K$e).call(e,...i)}),this.addHook("modifyFocusedElement",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return ia(Ra,e,Q$e).call(e,...i)}),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",wr(ty,this)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",wr(ty,this)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();wr(Ti,this).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=wr(Ti,this).setState(e)),this.detectedOverlappedHeaders&&Yn(Jr`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20 is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((n,r)=>{const i=n===!0?"hide-column":"show-column";wr(Ti,this).triggerColumnModification(i,r)}),!wr(hv,this)&&this.enabled&&ap(hv,this,this.hot.columnIndexMapper.createChangesObserver("hiding").subscribe(n=>{n.forEach(r=>{let{op:i,index:s,newValue:a}=r;if(i==="replace"){const u=a===!0?"hide-column":"show-column";wr(Ti,this).triggerColumnModification(u,s)}}),this.ghostTable.buildWidthsMap()})),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.removeLocalHook("cacheUpdated",wr(ty,this)),this.hot.columnIndexMapper.removeLocalHook("cacheUpdated",wr(ty,this)),this.clearColspans(),wr(Ti,this).clear(),wr(hv,this).unsubscribe(),ap(hv,this,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return wr(Ti,this)}getLayersCount(){return wr(Ti,this).getLayersCount()}getHeaderSettings(e,n){return wr(Ti,this).getHeaderSettings(e,n)}clearColspans(){if(!this.hot.view)return;const{_wt:e}=this.hot.view,n=e.getSetting("columnHeaders").length,r=e.wtTable.THEAD,i=e.wtOverlays.topOverlay.clone.wtTable.THEAD,s=e.wtOverlays.topInlineStartCornerOverlay?e.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null;for(let a=0;a<n;a++){const u=r.childNodes[a];if(!u)break;const h=i.childNodes[a],m=s?s.childNodes[a]:null;for(let g=0,y=u.childNodes.length;g<y;g++)u.childNodes[g].removeAttribute("colspan"),cn(u.childNodes[g],"hiddenHeader"),h&&h.childNodes[g]&&(h.childNodes[g].removeAttribute("colspan"),cn(h.childNodes[g],"hiddenHeader")),s&&m&&m.childNodes[g]&&(m.childNodes[g].removeAttribute("colspan"),cn(m.childNodes[g],"hiddenHeader"))}}headerRendererFactory(e){var n=this;const r=this.hot.view._wt.getSetting("fixedColumnsStart");return(i,s)=>{var a;const{columnIndexMapper:u,view:h}=this.hot;let m=u.getVisualFromRenderableIndex(i);m===null&&(m=i),s.removeAttribute("colspan"),cn(s,"hiddenHeader"),cn(s,"hiddenHeaderText");const{colspan:g,isHidden:y,isPlaceholder:x,headerClassNames:C}=(a=wr(Ti,this).getHeaderSettings(e,m))!==null&&a!==void 0?a:{};if(x||y)st(s,"hiddenHeader");else if(g>1){var E,M,j;const{wtOverlays:L}=h._wt,D=(E=L.topInlineStartCornerOverlay)===null||E===void 0?void 0:E.clone.wtTable.THEAD.contains(s),z=(M=L.inlineStartOverlay)===null||M===void 0?void 0:M.clone.wtTable.THEAD.contains(s);((j=L.topOverlay)===null||j===void 0?void 0:j.clone.wtTable.THEAD.contains(s))&&m<r&&st(s,"hiddenHeaderText");const V=D||z?Math.min(g,r-i):g;V>1&&s.setAttribute("colspan",V)}if(this.hot.view.appendColHeader(m,s,function(){return n.getColumnHeaderValue(...arguments)},e),!x&&!y){const L=s.querySelector("div.relative");L&&C&&C.length>0&&(cn(L,this.hot.getColumnMeta(m).headerClassName),st(L,C))}}}getColumnHeaderValue(e,n){var r;const{isHidden:i,isPlaceholder:s}=(r=wr(Ti,this).getHeaderSettings(n,e))!==null&&r!==void 0?r:{};return s||i?"":this.hot.getColHeader(e,n)}destroy(){ap(Ti,this,null),wr(hv,this)!==null&&(wr(hv,this).unsubscribe(),ap(hv,this,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return wr(Ti,this).getHeaderTreeNodeData(e.row,e.col)}}function H$e(t,e){var n;const r=this.hot.getSelectedRangeActive();if(!r)return t;const{highlight:i}=r,{navigableHeaders:s}=this.hot.getSettings(),a=this.hot.selection.isSelectedByColumnHeader(),u=s?i.row:(n=wr(wA,this))===null||n===void 0?void 0:n.row,h=a?t:i.col,m=u<0&&h>=0;if(ap(wA,this,null),!m)return t;const g=this.hot.getFirstFullyVisibleColumn(),y=this.hot.getLastFullyVisibleColumn(),x=y-g+1,C=wr(Ti,this).findLeftMostColumnIndex(u,h),E=wr(Ti,this).findRightMostColumnIndex(u,h),M=E-C+1;if(C<g&&E>y)return C;if(a){let j=null;return C>=g&&E>y?M>x?(e.value="start",j=C):(e.value="end",j=E):C<g&&E<=y&&(M>x?(e.value="end",j=E):(e.value="start",j=C)),j}return C<=g?C:E}function L$e(t,e,n){const r=wr(Ti,this).getHeaderTreeNodeData(e,t);if(!r)return t;const{columnCursor:i,selectionType:s,selectionWidth:a}=n,{isRoot:u,colspan:h}=wr(Ti,this).getHeaderSettings(e,t);if(s===$L){if(!u)return r.columnIndex}else if(s===vK&&(h>a-i||!u))return null;return t}function $$e(t,e,n){let{columnHeadersCount:r}=n;if(r!==0)for(let s=0;s<e.length;s++){const{startRow:a,startCol:u,endRow:h,endCol:m}=e[s],g=h-a+1,y=u-m+1;if(a>=0||y===1)break;for(let x=u;x<=m;x++)for(let C=a;C<=h;C++){var i;const E=g+C,M=x-u;if(M===0)continue;((i=wr(Ti,this).getHeaderTreeNodeData(C,x))===null||i===void 0?void 0:i.isRoot)===!1&&(t[E][M]="")}}}function F$e(t,e,n,r){this._getHeaderTreeNodeDataByCoords(e)&&(r.column=!0)}function z$e(t,e){const n=this._getHeaderTreeNodeDataByCoords(e);if(!n)return;ap(bE,this,e.clone()),ap(xA,this,!0);const{selection:r}=this.hot,i=r.isSelected()?r.getSelectedRange().current():null,s=[],{columnIndex:a,origColspan:u}=n,h=!r.inInSelection(e);t.shiftKey&&i?e.col<i.from.col?s.push(i.getTopEndCorner().col,a,e.row):e.col>i.from.col?s.push(i.getTopStartCorner().col,a+u-1,e.row):s.push(a,a+u-1,e.row):(dL(t)||O0(t)&&h||Xpe(t))&&s.push(a,a+u-1,e.row),r.selectColumns(...s)}function V$e(t,e,n,r){if(!this.hot.view.isMouseDown()||r.column)return;const i=this._getHeaderTreeNodeDataByCoords(e);if(!i)return;const{columnIndex:s,origColspan:a}=i,u=this.hot.getSelectedRangeActive(),h=u.getTopStartCorner(),m=u.getBottomEndCorner(),{from:g}=u;r.column=!0,r.cell=!0;const y=[],x=Lr(e.row,-1/0,-1);e.col<g.col?y.push(m.col,s,x):e.col>g.col?y.push(h.col,s+a-1,x):y.push(s,s+a-1,x),this.hot.selection.selectColumns(...y)}function B$e(){ap(xA,this,!1)}function W$e(){const{navigableHeaders:t}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!wr(xA,this)||!t)return;const e=this.hot.getSelectedRangeLast(),n=e.getTopStartCorner().col,r=e.getBottomEndCorner().col,{columnIndex:i,origColspan:s}=wr(Ti,this).getHeaderTreeNodeData(wr(bE,this).row,wr(bE,this).col);if(e.setHighlight(wr(bE,this)),s>e.getWidth()||i<n||i+s-1>r){const a=wr(Ti,this).findTopMostEntireHeaderLevel(Lr(n,i,i+s-1),Lr(r,i,i+s-1));e.highlight.row=a,e.highlight.col=e.from.col}}function U$e(t){const{highlight:e}=this.hot.getSelectedRangeActive(),n=this.hot._createCellCoords(e.row+t.row,e.col+t.col);if(!(n.isHeader()&&n.col>=0))return;const i=wr(Ti,this).findLeftMostColumnIndex(n.row,n.col),s=wr(Ti,this).findRightMostColumnIndex(n.row,n.col);if(t.col<0){const a=e.col>=i&&e.col<=s?i-1:s,u=this.hot.columnIndexMapper.getNearestNotHiddenIndex(a,-1);u===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,e.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(u,e.col)-1,1)}else if(t.col>0){const a=e.col>=i&&e.col<=s?s+1:i,u=this.hot.columnIndexMapper.getNearestNotHiddenIndex(a,1);u===null?t.col=this.hot.view.countRenderableColumnsInRange(e.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(e.col,u)-1,1)}}function Y$e(t,e,n){const r=t.row,i=this._getHeaderTreeNodeDataByCoords({row:r,col:t.col}),s=this._getHeaderTreeNodeDataByCoords({row:r,col:e.col});ap(wA,this,n.clone()),e.col<t.col?(i&&(t.col=i.columnIndex+i.origColspan-1),s&&(e.col=s.columnIndex)):e.col>=t.col&&(i&&(t.col=i.columnIndex),s&&(e.col=s.columnIndex+s.origColspan-1))}function G$e(t){if(wr(Ti,this).getLayersCount()>0){t.length=0;for(let e=0;e<wr(Ti,this).getLayersCount();e++)t.push(this.headerRendererFactory(e))}}function K$e(t){const e=wr(Ti,this).getLayersCount();let n=t.startColumn,r=!!e;for(let i=0;i<e;i++){const s=wr(Ti,this).findLeftMostColumnIndex(i,t.startColumn),a=this.hot.columnIndexMapper.getRenderableFromVisualIndex(s);if(s>=0&&(r=!1),Vl(a)&&a<t.startColumn){n=a;break}}t.startColumn=r?wr(Ti,this).getHeaderTreeNodeData(0,n).columnIndex:n}function q$e(t,e){const n=this.ghostTable.getWidth(e);return t>n?t:n}function X$e(t,e,n){var r;const{label:i}=(r=wr(Ti,this).getHeaderTreeNodeData(n,e))!==null&&r!==void 0?r:{label:""};return i}function Q$e(t,e){if(t<0)return this.hot.getCell(t,wr(Ti,this).findLeftMostColumnIndex(t,e),!0)}function Z$e(){this.updatePlugin()}function J$e(t,e){e||this.updatePlugin()}function yE(t,e,n){return(e=eFe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eFe(t){var e=tFe(t,"string");return typeof e=="symbol"?e:e+""}function tFe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class nFe{constructor(e,n){yE(this,"hot",void 0),yE(this,"data",null),yE(this,"plugin",void 0),yE(this,"parentReference",new WeakMap),yE(this,"cache",{levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap}),this.hot=n,this.plugin=e}setData(e){this.data=e}getData(){return this.data}getRawSourceData(){let e=null;return this.plugin.disableCoreAPIModifiers(),e=this.hot.getSourceData(),this.plugin.enableCoreAPIModifiers(),e}updateWithData(e){this.setData(e),this.rewriteCache()}rewriteCache(){this.cache={levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap},En(0,this.data.length-1,e=>{this.cacheNode(this.data[e],0,null)})}cacheNode(e,n,r){this.cache.levels[n]||(this.cache.levels[n]=[],this.cache.levelCount+=1),this.cache.levels[n].push(e),this.cache.rows.push(e),this.cache.nodeInfo.set(e,{parent:r,row:this.cache.rows.length-1,level:n}),this.hasChildren(e)&&Te(e.__children,i=>{this.cacheNode(i,n+1,e)})}getDataObject(e){return e==null?null:this.cache.rows[e]}readTreeNodes(e,n,r,i){let s=!1,a=n;if(isNaN(a)&&a.end)return a;let u=e;return u||(u={__children:this.data},s=!0,a-=1),r!=null&&a===r?{result:u,end:!0}:i!=null&&u===i?{result:a,end:!0}:(a+=1,u.__children&&Te(u.__children,h=>{if(this.parentReference.set(h,s?null:u),a=this.readTreeNodes(h,a,r,i),isNaN(a)&&a.end)return!1}),a)}mockParent(){const e=this.mockNode();return e.__children=this.data,e}mockNode(){const e={};return Mr(this.data[0],(n,r)=>{e[r]=null}),e}getRowIndex(e){return e==null?null:this.cache.nodeInfo.get(e).row}getRowIndexWithinParent(e){let n=null;isNaN(e)?n=e:n=this.getDataObject(e);const r=this.getRowParent(e);return r==null?this.data.indexOf(n):r.__children.indexOf(n)}countAllRows(){const e={__children:this.data};return this.countChildren(e)}countChildren(e){let n=0,r=e;return isNaN(r)||(r=this.getDataObject(r)),!r||!r.__children?0:(Te(r.__children,i=>{n+=1,i.__children&&(n+=this.countChildren(i))}),n)}getRowParent(e){let n;return isNaN(e)?n=e:n=this.getDataObject(e),this.getRowObjectParent(n)}getRowObjectParent(e){return!e||typeof e!="object"?null:this.cache.nodeInfo.get(e).parent}getRowLevel(e){let n=null;return isNaN(e)?n=e:n=this.getDataObject(e),n?this.getRowObjectLevel(n):null}getRowObjectLevel(e){return e==null?null:this.cache.nodeInfo.get(e).level}hasChildren(e){let n=e;return isNaN(n)||(n=this.getDataObject(n)),!!(n.__children&&n.__children.length)}isChild(e){return this.getRowParent(e)!==null}getChild(e,n){var r;return((r=e.__children)===null||r===void 0?void 0:r[n])||null}isRowHighestLevel(e){return!this.isChild(e)}isParent(e){var n;let r=e;return isNaN(r)||(r=this.getDataObject(r)),r&&!!r.__children&&((n=r.__children)===null||n===void 0?void 0:n.length)!==0}addChild(e,n){let r=n;this.hot.runHooks("beforeAddChild",e,r);let i=null;e&&(i=this.getRowIndex(e)),this.hot.runHooks("beforeCreateRow",i+this.countChildren(e)+1,1);let s=e;e||(s=this.mockParent()),s.__children||(s.__children=[]),r||(r=this.mockNode()),s.__children.push(r),this.rewriteCache();const a=this.getRowIndex(r);this.hot.rowIndexMapper.insertIndexes(a,1),this.hot.runHooks("afterCreateRow",a,1),this.hot.runHooks("afterAddChild",e,r)}addChildAtIndex(e,n,r){let i=r,s;if(i||(i=this.mockNode()),this.hot.runHooks("beforeAddChild",e,i,n),e){const u=this.getRowIndex(e)+n+1;this.hot.runHooks("beforeCreateRow",u,1),e.__children.splice(n,null,i),this.rewriteCache(),this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(e),"__children",e.__children,"NestedRows.addChildAtIndex"),this.hot.rowIndexMapper.insertIndexes(u,1),this.plugin.enableCoreAPIModifiers(),this.hot.runHooks("afterCreateRow",u,1),s=u}else this.plugin.disableCoreAPIModifiers(),this.hot.alter("insert_row_above",n,1,"NestedRows.addChildAtIndex"),this.plugin.enableCoreAPIModifiers(),s=this.getRowIndex(this.data[n]);i=this.getDataObject(s),this.hot.runHooks("afterAddChild",e,i,n)}addSibling(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"below";const r=this.translateTrimmedRow(e),i=this.getRowParent(r),s=this.getRowIndexWithinParent(r);switch(n){case"below":this.addChildAtIndex(i,s+1,null);break;case"above":this.addChildAtIndex(i,s,null);break}}detachFromParent(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=null;const i=[];Array.isArray(e)?(En(e[0],e[2],x=>{const C=this.translateTrimmedRow(x);i.push(this.getDataObject(C))}),En(0,i.length-2,x=>{this.detachFromParent(i[x],!1)}),r=i[i.length-1]):r=e;const s=this.getRowIndex(r),a=this.countChildren(r),u=this.getRowIndexWithinParent(r),h=this.getRowParent(r),m=this.getRowParent(h),g=this.getRowIndex(m);let y=null;if(this.hot.runHooks("beforeDetachChild",h,r),u!=null){const x=Array.from(new Array(s+a+1).keys()).splice(-1*(a+1));if(this.hot.runHooks("beforeRemoveRow",s,a+1,x,this.plugin.pluginName),h.__children.splice(u,1),this.rewriteCache(),this.hot.runHooks("afterRemoveRow",s,a+1,x,this.plugin.pluginName),m){y=g+this.countChildren(m);const C=this.getChild(m,this.countChildren(m)-1),E=this.getRowIndex(C);this.hot.runHooks("beforeCreateRow",E+1,a+1,this.plugin.pluginName),m.__children.push(r)}else y=this.hot.countRows()+1,this.hot.runHooks("beforeCreateRow",y-2,a+1,this.plugin.pluginName),this.data.push(r)}this.rewriteCache(),this.hot.runHooks("afterCreateRow",y-2,a+1,this.plugin.pluginName),this.hot.runHooks("afterDetachChild",h,r,this.getRowIndex(r)),n&&this.hot.render()}filterData(e,n,r){const i=[];Te(r,s=>{i.push(this.getDataObject(s))}),Te(i,s=>{const a=this.getRowIndexWithinParent(s),u=this.getRowParent(s);u===null?this.data.splice(a,1):u.__children.splice(a,1)}),this.rewriteCache()}spliceData(e,n,r){const i=this.getDataObject(e-1);let s=null,a=e;i&&i.__children&&i.__children.length===0?(s=i,a=0):e<this.countAllRows()&&(s=this.getRowParent(e),a=this.getRowIndexWithinParent(e)),s?r?s.__children.splice(a,n,...r):s.__children.splice(a,n):r?this.data.splice(a,n,...r):this.data.splice(a,n),this.rewriteCache()}syncRowWithRawSource(e){let n=e,r=n;do r=this.getRowParent(r),r!==null&&(n=r);while(r!==null);this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(n),"__children",n.__children,"NestedRows.syncRowWithRawSource"),this.plugin.enableCoreAPIModifiers()}moveRow(e,n,r,i){const s=n===this.hot.countRows(),a=this.getRowParent(e),u=this.getRowIndexWithinParent(e),h=a.__children.slice(u,u+1),m=e>n;let g=s?this.getRowParent(n-1):this.getRowParent(n);g==null&&(g=this.getRowParent(n-1)),g==null&&(g=this.getDataObject(n-1)),g?g.__children||(g.__children=[]):(g=this.getDataObject(n),g.__children=[]);const y=s||r||i?g.__children.length:this.getRowIndexWithinParent(n),x=a===g;g.__children.splice(y,0,h[0]),a.__children.splice(u+(m&&x?1:0),1),this.syncRowWithRawSource(a),x||this.syncRowWithRawSource(g)}translateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.translateTrimmedRow(e):e}untranslateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.untranslateTrimmedRow(e):e}}function jne(t,e,n){return(e=rFe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rFe(t){var e=iFe(t,"string");return typeof e=="symbol"?e:e+""}function iFe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class u3{constructor(e,n){jne(this,"hot",void 0),jne(this,"plugin",void 0),this.hot=n,this.plugin=e}}class _f extends u3{static get CSS_CLASSES(){return{indicatorContainer:"ht_nestingLevels",parent:"ht_nestingParent",indicator:"ht_nestingLevel",emptyIndicator:"ht_nestingLevel_empty",button:"ht_nestingButton",expandButton:"ht_nestingExpand",collapseButton:"ht_nestingCollapse"}}constructor(e,n){super(e,n),this.dataManager=this.plugin.dataManager,this.collapsingUI=this.plugin.collapsingUI,this.rowHeaderWidthCache=null}appendLevelIndicators(e,n){const r=this.hot.toPhysicalRow(e),i=this.dataManager.getDataObject(r);if(!i)return;const s=this.dataManager.getRowLevel(r),a=n.getElementsByTagName("DIV")[0],u=a.querySelector("span.rowHeader"),h=a.querySelectorAll('[class^="ht_nesting"]'),m=this.hot.getSettings().ariaTags;if(Te(h,g=>{g&&a.removeChild(g)}),st(n,_f.CSS_CLASSES.indicatorContainer),s){const{rootDocument:g}=this.hot,y=u.cloneNode(!0);a.innerHTML="",En(0,s-1,()=>{const x=g.createElement("SPAN");st(x,_f.CSS_CLASSES.emptyIndicator),a.appendChild(x)}),a.appendChild(y)}if(this.dataManager.hasChildren(i)){const g=this.hot.rootDocument.createElement("DIV");m&&gn(g,[ym()]),st(n,_f.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(r)?(st(g,`${_f.CSS_CLASSES.button} ${_f.CSS_CLASSES.expandButton}`),m&&gn(n,[qu(!1)])):(st(g,`${_f.CSS_CLASSES.button} ${_f.CSS_CLASSES.collapseButton}`),m&&gn(n,[qu(!0)])),a.appendChild(g)}}updateRowHeaderWidth(e){let n=e;n||(n=this.dataManager.cache.levelCount);let r=11;r=this.hot.stylesHandler.getCSSVariableValue("cell-horizontal-padding")*2,this.rowHeaderWidthCache=Math.max(50,r+10*n+25),this.hot.render()}}class sFe extends u3{constructor(e,n){var r;super(e,n),r=this,this.dataManager=this.plugin.dataManager,this.collapsedRows=[],this.collapsedRowsStash={stash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;r.lastCollapsedRows=r.collapsedRows.slice(0),r.expandMultipleChildren(r.lastCollapsedRows,i)},shiftStash:function(i,s){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;s==null&&(s=1/0),Te(r.lastCollapsedRows,(u,h)=>{u>=i&&u<s&&(r.lastCollapsedRows[h]=u+a)})},applyStash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;r.collapseMultipleChildren(r.lastCollapsedRows,i),r.lastCollapsedRows=void 0},trimStash:(i,s)=>{En(i,i+s-1,a=>{const u=this.lastCollapsedRows.indexOf(a);u>-1&&this.lastCollapsedRows.splice(u,1)})}}}collapseChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];let s=null,a=null,u=null;return isNaN(e)?(s=e,a=this.dataManager.getRowIndex(s)):(s=this.dataManager.getDataObject(e),a=e),this.dataManager.hasChildren(s)&&Te(s.__children,h=>{i.push(this.dataManager.getRowIndex(h))}),u=this.collapseRows(i,!0,!1),r&&this.trimRows(u),n&&this.renderAndAdjust(),this.collapsedRows.indexOf(a)===-1&&this.collapsedRows.push(a),u}collapseMultipleChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];Te(e,s=>{i.push(...this.collapseChildren(s,!1,!1))}),r&&this.trimRows(i),n&&this.renderAndAdjust()}collapseRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.collapseRows([e],n)}collapseRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return Te(e,s=>{i.push(s),n&&this.collapseChildRows(s,i)}),r&&this.trimRows(i),i}collapseChildRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);Te(i.__children,s=>{const a=this.dataManager.getRowIndex(s);n.push(a),this.collapseChildRows(a,n)})}r&&this.trimRows(n)}expandRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.expandRows([e],n)}expandRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return Te(e,s=>{i.push(s),n&&this.expandChildRows(s,i)}),r&&this.untrimRows(i),i}expandChildRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);Te(i.__children,s=>{if(!this.isAnyParentCollapsed(s)){const a=this.dataManager.getRowIndex(s);n.push(a),this.expandChildRows(a,n)}})}r&&this.untrimRows(n)}expandChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];let s=null,a=null,u=null;return isNaN(e)?(s=e,a=this.dataManager.getRowIndex(e)):(s=this.dataManager.getDataObject(e),a=e),this.collapsedRows.splice(this.collapsedRows.indexOf(a),1),this.dataManager.hasChildren(s)&&Te(s.__children,h=>{const m=this.dataManager.getRowIndex(h);i.push(m)}),u=this.expandRows(i,!0,!1),r&&this.untrimRows(u),n&&this.renderAndAdjust(),u}expandMultipleChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];Te(e,s=>{i.push(...this.expandChildren(s,!1,!1))}),r&&this.untrimRows(i),n&&this.renderAndAdjust()}collapseAll(){const e=this.dataManager.getData(),n=[];Te(e,r=>{this.dataManager.hasChildren(r)&&n.push(r)}),this.collapseMultipleChildren(n),this.renderAndAdjust()}expandAll(){const e=this.dataManager.getData(),n=[];Te(e,r=>{this.dataManager.hasChildren(r)&&n.push(r)}),this.expandMultipleChildren(n),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution(()=>{Te(e,n=>{this.plugin.collapsedRowsMap.setValueAtIndex(n,!0)})},!0)}untrimRows(e){this.hot.batchExecution(()=>{Te(e,n=>{this.plugin.collapsedRowsMap.setValueAtIndex(n,!1)})},!0)}areChildrenCollapsed(e){let n=isNaN(e)?e:this.dataManager.getDataObject(e),r=!0;return n===null&&(n={__children:this.dataManager.data}),this.dataManager.hasChildren(n)&&Te(n.__children,i=>{const s=this.dataManager.getRowIndex(i);if(!this.plugin.collapsedRowsMap.getValueAtIndex(s))return r=!1,!1}),r}isAnyParentCollapsed(e){let n=e;for(;n!==null;){n=this.dataManager.getRowParent(n);const r=this.dataManager.getRowIndex(n);if(this.collapsedRows.indexOf(r)>-1)return!0}return!1}toggleState(e,n){if(n.col>=0)return;const r=this.translateTrimmedRow(n.row);Dn(e.target,_f.CSS_CLASSES.button)&&(this.areChildrenCollapsed(r)?this.expandChildren(r):this.collapseChildren(r),iu(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.view.adjustElementsSize(),this.hot.render()}}function oFe(t,e,n){aFe(t,e),e.set(t,n)}function aFe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lFe(t,e,n){return(e=cFe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cFe(t){var e=uFe(t,"string");return typeof e=="symbol"?e:e+""}function uFe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dFe(t,e){return t.get(hFe(t,e))}function hFe(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Mne=new WeakMap;class fFe extends u3{constructor(){super(...arguments),lFe(this,"dataManager",this.plugin.dataManager),oFe(this,Mne,{row_above:(e,n)=>{const r=n[n.length-1];this.dataManager.addSibling(r.start.row,"above")},row_below:(e,n)=>{const r=n[n.length-1];this.dataManager.addSibling(r.start.row,"below")}})}appendOptions(e){const n=[{key:"add_child",name(){return this.getTranslatedPhrase(q5)},callback:()=>{const r=this.dataManager.translateTrimmedRow(this.hot.getSelectedActive()[0]),i=this.dataManager.getDataObject(r);this.dataManager.addChild(i)},disabled:()=>{const r=this.hot.getSelectedActive();return!r||r[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{key:"detach_from_parent",name(){return this.getTranslatedPhrase(X5)},callback:()=>{this.dataManager.detachFromParent(this.hot.getSelectedActive())},disabled:()=>{const r=this.hot.getSelectedActive(),i=this.dataManager.translateTrimmedRow(r[0]);return!this.dataManager.getRowParent(i)||!r||r[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{name:"---------"}];return En(0,e.items.length-1,r=>{if(r===0)return Te(n,(i,s)=>{e.items.splice(r+s,0,i)}),!1}),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return En(0,e.items.length-1,n=>{const r=dFe(Mne,this)[e.items[n].key];r!=null&&(e.items[n].callback=r)}),e}}function CA(t,e,n){return(e=mFe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mFe(t){var e=pFe(t,"string");return typeof e=="symbol"?e:e+""}function pFe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gFe{constructor(e){CA(this,"plugin",void 0),CA(this,"hot",void 0),CA(this,"dataManager",void 0),CA(this,"collapsingUI",void 0),this.plugin=e,this.hot=e.hot,this.dataManager=e.dataManager,this.collapsingUI=e.collapsingUI}onBeforeRowMove(e,n,r,i){if(this.displayAPICompatibilityWarning({rows:e,finalIndex:n,dropIndex:r,movePossible:i}))return!1;this.movedToCollapsed=!1;const a=r===this.hot.countRows(),u=a?this.hot.countSourceRows():this.dataManager.translateTrimmedRow(r);let h=!0;const m=e.map(E=>{if(!h)return!1;const M=this.dataManager.translateTrimmedRow(E);return h=this.shouldAllowMoving(M,u),M}),g=m.indexOf(u)===-1;if(!h||!g)return!1;const y=this.getBaseParent(m),x=this.getTargetParent(a,u),C=y===x;return this.movedToCollapsed=this.collapsingUI.areChildrenCollapsed(x),this.collapsingUI.collapsedRowsStash.stash(),this.shiftCollapsibleParentsLocations(m,u,C),this.moveRows(m,u,x),this.dataManager.rewriteCache(),this.moveCellsMeta(m,u),this.collapsingUI.collapsedRowsStash.applyStash(!1),this.hot.runHooks("afterRowMove",e,n,r,i,i&&this.isRowOrderChanged(e,n)),this.hot.render(),this.selectCells(e,r),!1}displayAPICompatibilityWarning(e){const{rows:n,finalIndex:r,dropIndex:i,movePossible:s}=e;let a=!1;return ls(i)&&(Yn(Jr`Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\x20 when the NestedRows plugin is enabled. Please use the 'dragRows' method instead.`),this.hot.runHooks("afterRowMove",n,r,i,s,!1),a=!0),a}shouldAllowMoving(e,n){return!(this.dataManager.isParent(e)||this.dataManager.isRowHighestLevel(e)||e===n||n===0)}getBaseParent(e){return this.dataManager.getRowParent(e[0])}getTargetParent(e,n){let r=this.dataManager.getRowParent(e?n-1:n);return r==null&&(r=this.dataManager.getRowParent(n-1)),r}shiftCollapsibleParentsLocations(e,n,r){r||(Math.max(...e)<=n?this.collapsingUI.collapsedRowsStash.shiftStash(e[0],n,-1*e.length):this.collapsingUI.collapsedRowsStash.shiftStash(n,e[0],e.length))}moveRows(e,n,r){const i=n===this.dataManager.getRowIndex(r)+this.dataManager.countChildren(r)+1;this.hot.batchRender(()=>{e.forEach(s=>{this.dataManager.moveRow(s,n,this.movedToCollapsed,i)})})}moveCellsMeta(e,n){const r=[],i=Math.max(...e)<n;e.forEach(s=>{r.push(this.hot.getCellMetaAtRow(s))}),this.hot.spliceCellsMeta(e[0],e.length),this.hot.spliceCellsMeta(n-(i?r.length:0),0,...r)}selectCells(e,n){const r=e.length;let i=0,s=0;if(this.movedToCollapsed){let a=null;e[r-1]<n?a=this.dataManager.translateTrimmedRow(n-r):a=this.dataManager.translateTrimmedRow(n);const u=this.dataManager.getRowParent(a===null?this.hot.countSourceRows()-1:a-1),h=this.dataManager.getRowIndex(u);i=this.dataManager.untranslateTrimmedRow(h),s=i}else e[r-1]<n?(s=n-1,i=s-r+1):(i=n,s=i+r-1);this.hot.selectCells([[i,0,s,this.hot.countCols()-1]],!1)}isRowOrderChanged(e,n){return e.some((r,i)=>r-i!==n)}}function vFe(t,e){Ane(t,e),e.add(t)}function Pne(t,e,n){Ane(t,e),e.set(t,n)}function Ane(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function d3(t,e,n){return(e=bFe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bFe(t){var e=yFe(t,"string");return typeof e=="symbol"?e:e+""}function yFe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function SA(t,e){return t.get(sa(t,e))}function RA(t,e,n){return t.set(sa(t,e),n),n}function sa(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const _A="nestedRows",xFe=300,One=_A,wFe="The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled.";var EA=new WeakMap,RC=new WeakMap,_a=new WeakSet;class CFe extends Zr{constructor(){super(...arguments),vFe(this,_a),d3(this,"dataManager",null),d3(this,"headersUI",null),d3(this,"collapsedRowsMap",null),Pne(this,EA,!1),Pne(this,RC,!1)}static get PLUGIN_KEY(){return _A}static get PLUGIN_PRIORITY(){return xFe}isEnabled(){return!!this.hot.getSettings()[_A]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new MR),this.dataManager=new nFe(this,this.hot),this.collapsingUI=new sFe(this,this.hot),this.headersUI=new _f(this,this.hot),this.contextMenuUI=new fFe(this,this.hot),this.rowMoveController=new gFe(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sa(_a,e,DFe).call(e,...r)}),this.addHook("beforeViewRender",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sa(_a,e,HFe).call(e,...r)}),this.addHook("modifyRowData",function(){return e.onModifyRowData(...arguments)}),this.addHook("modifySourceLength",function(){return e.onModifySourceLength(...arguments)}),this.addHook("beforeDataSplice",function(){return e.onBeforeDataSplice(...arguments)}),this.addHook("filterData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sa(_a,e,_Fe).call(e,...r)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sa(_a,e,EFe).call(e,...r)}),this.addHook("afterGetRowHeader",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sa(_a,e,NFe).call(e,...r)}),this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sa(_a,e,RFe).call(e,...r)}),this.addHook("beforeRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sa(_a,e,jFe).call(e,...r)}),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sa(_a,e,TFe).call(e,...r)}),this.addHook("beforeAddChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sa(_a,e,MFe).call(e,...r)}),this.addHook("afterAddChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sa(_a,e,PFe).call(e,...r)}),this.addHook("beforeDetachChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sa(_a,e,AFe).call(e,...r)}),this.addHook("afterDetachChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sa(_a,e,OFe).call(e,...r)}),this.addHook("modifyRowHeaderWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sa(_a,e,kFe).call(e,...r)}),this.addHook("afterCreateRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sa(_a,e,IFe).call(e,...r)}),this.addHook("beforeRowMove",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return sa(_a,e,SFe).call(e,...r)}),this.addHook("beforeLoadData",n=>sa(_a,this,Ine).call(this,n)),this.addHook("beforeUpdateData",n=>sa(_a,this,Ine).call(this,n)),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("nestedRows"),this.unregisterShortcuts(),super.disablePlugin()}updatePlugin(){this.disablePlugin();const e=this.dataManager.getData();this.enablePlugin(),this.dataManager.updateWithData(e),super.updatePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeActive(),n=this.collapsingUI.translateTrimmedRow(e.row);return this.collapsingUI.areChildrenCollapsed(n)?this.collapsingUI.expandChildren(n):this.collapsingUI.collapseChildren(n),!1},runOnlyIf:()=>{var e,n;const r=(e=this.hot.getSelectedRangeActive())===null||e===void 0?void 0:e.highlight;return r&&((n=this.hot.getSelectedRangeActive())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(r)&&r.col===-1&&r.row>=0},group:One,relativeToGroup:Pm,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(One)}disableCoreAPIModifiers(){RA(RC,this,!0)}enableCoreAPIModifiers(){RA(RC,this,!1)}onModifyRowData(e){if(!SA(RC,this))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!SA(RC,this))return this.dataManager.countAllRows()}onBeforeDataSplice(e,n,r){return SA(RC,this)||this.dataManager.isRowHighestLevel(e)?!0:(this.dataManager.spliceData(e,n,r),!1)}destroy(){super.destroy()}}function SFe(t,e,n,r){return this.rowMoveController.onBeforeRowMove(t,e,n,r)}function RFe(t,e,n){this.collapsingUI.toggleState(t,e,n)}function _Fe(t,e,n){return this.collapsingUI.collapsedRowsStash.stash(),this.collapsingUI.collapsedRowsStash.trimStash(n[0],e),this.collapsingUI.collapsedRowsStash.shiftStash(n[0],null,-1*e),this.dataManager.filterData(t,e,n),RA(EA,this,!0),this.dataManager.getData().slice()}function EFe(t){return this.contextMenuUI.appendOptions(t)}function NFe(t,e){this.headersUI.appendLevelIndicators(t,e)}function kFe(t){return Math.max(this.headersUI.rowHeaderWidthCache,t)}function TFe(t,e,n,r){r!==this.pluginName&&this.hot._registerTimeout(()=>{RA(EA,this,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()})}function jFe(t,e,n){const r=Array.from(n.reduce((i,s)=>{if(this.dataManager.isParent(s)){const a=this.dataManager.getDataObject(s).__children;return i.add(s),Array.isArray(a)&&a.forEach(u=>i.add(this.dataManager.getRowIndex(u))),i}return i.add(s)},new Set));n.length=0,n.push(...r)}function MFe(){this.collapsingUI.collapsedRowsStash.stash()}function PFe(t,e){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(e)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function AFe(){this.collapsingUI.collapsedRowsStash.stash()}function OFe(t,e,n){this.collapsingUI.collapsedRowsStash.shiftStash(n,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function IFe(){this.dataManager.rewriteCache()}function DFe(){this.headersUI.updateRowHeaderWidth()}function HFe(t,e){SA(EA,this)&&(e.skipRender=!0)}function Ine(t){if(!Vbe(t)){sL(wFe),this.hot.getSettings()[_A]=!1,this.disablePlugin();return}this.dataManager.setData(t),this.dataManager.rewriteCache()}function LFe(t,e){Dne(t,e),e.add(t)}function fv(t,e,n){Dne(t,e),e.set(t,n)}function Dne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wr(t,e){return t.get(xE(t,e))}function Ef(t,e,n){return t.set(xE(t,e),n),n}function xE(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const $Fe=` <div data-ref="container" class="ht-pagination handsontable"> <div class="ht-pagination__inner"> <div data-ref="pageSizeSection" class="ht-page-size-section"> <span data-ref="pageSizeLabel" class="ht-page-size-section__label"></span> <div class="ht-page-size-section__select-wrapper"> <select data-ref="pageSizeSelect" name="pageSize" data-hot-input></select> </div> </div> <div data-ref="pageCounterSection" class="ht-page-counter-section"></div> <nav data-ref="pageNavSection" class="ht-page-navigation-section"> <button data-ref="first" class="ht-page-navigation-section__button ht-page-first"></button> <button data-ref="prev" class="ht-page-navigation-section__button ht-page-prev"></button> <span data-ref="pageNavLabel" class="ht-page-navigation-section__label"></span> <button data-ref="next" class="ht-page-navigation-section__button ht-page-next"></button> <button data-ref="last" class="ht-page-navigation-section__button ht-page-last"></button> </nav> </div> </div> `;var _C=new WeakMap,ny=new WeakMap,h3=new WeakMap,vl=new WeakMap,EC=new WeakMap,gd=new WeakMap,f3=new WeakMap,m3=new WeakMap,NA=new WeakSet;class Hne{constructor(e){let{rootElement:n,uiContainer:r,isRtl:i,themeName:s,phraseTranslator:a,shouldHaveBorder:u,a11yAnnouncer:h}=e;LFe(this,NA),fv(this,_C,void 0),fv(this,ny,void 0),fv(this,h3,!1),fv(this,vl,void 0),fv(this,EC,void 0),fv(this,gd,void 0),fv(this,f3,void 0),fv(this,m3,void 0),Ef(_C,this,n),Ef(ny,this,r),Ef(h3,this,i),Ef(EC,this,s),Ef(gd,this,a),Ef(f3,this,u),Ef(m3,this,h),this.install()}install(){var e;if((e=Wr(vl,this))!==null&&e!==void 0&&e.container)return;const n=Bx`${$Fe}`,{container:r,first:i,prev:s,next:a,last:u,pageSizeSelect:h}=n.refs;Ef(vl,this,n.refs),r.setAttribute("dir",Wr(h3,this)?"rtl":"ltr"),r.tabIndex=-1;const m=y=>y.currentTarget.disabled,g=(y,x,C)=>{x.addEventListener(y,E=>{m(E)||C()})};g("click",i,()=>this.runLocalHooks("firstPageClick")),g("click",s,()=>this.runLocalHooks("prevPageClick")),g("click",a,()=>this.runLocalHooks("nextPageClick")),g("click",u,()=>this.runLocalHooks("lastPageClick")),h.addEventListener("change",()=>{const y=h.value==="auto"?"auto":Number.parseInt(h.value,10);this.runLocalHooks("pageSizeChange",y)}),this.setCounterSectionVisibility(!1),this.setNavigationSectionVisibility(!1),this.setPageSizeSectionVisibility(!1),Wr(ny,this)?(Wr(ny,this).appendChild(n.fragment),st(r,[Wr(EC,this),"handsontable"])):Wr(_C,this).after(n.fragment)}getContainer(){return Wr(vl,this).container}getFocusableElements(){const{first:e,prev:n,next:r,last:i,pageSizeSelect:s}=Wr(vl,this);return[s,e,n,r,i].filter(a=>!a.disabled)}updateWidth(e){return Wr(vl,this).container.style.width=`${e}px`,this}updateTheme(e){if(Ef(EC,this,e),Wr(ny,this)){const{container:n}=Wr(vl,this);cn(n,/ht-theme-.*/g),Wr(EC,this)&&st(n,Wr(EC,this))}return this}getHeight(){return Wr(vl,this).container.offsetHeight}refreshBorderState(){const{container:e}=Wr(vl,this);return Wr(ny,this)||Wr(f3,this).call(this)?st(e,"ht-pagination--bordered"):cn(e,"ht-pagination--bordered"),this}updateState(e){let{currentPage:n,totalPages:r,firstVisibleRowIndex:i,lastVisibleRowIndex:s,totalRenderedRows:a,pageSizeList:u,pageSize:h,autoPageSize:m}=e;const{first:g,prev:y,next:x,last:C,pageCounterSection:E,pageNavSection:M,pageNavLabel:j,pageSizeSelect:L,pageSizeLabel:D}=Wr(vl,this),z=Wr(gd,this).call(this,E4,{start:i+1,end:s+1,total:a}),H=Wr(gd,this).call(this,N4,{currentPage:n,totalPages:r}),V=Wr(gd,this).call(this,gj);E.textContent=z,j.textContent=H,L.textContent="",D.textContent=`${V}:`,gn(M,[wc(Wr(gd,this).call(this,R4))]),gn(L,[wc(Wr(gd,this).call(this,gj))]),Wr(m3,this).call(this,H),this.refreshBorderState(),u.forEach(te=>{const ve=te==="auto"?Wr(gd,this).call(this,_4):te,ce=new Option(ve,te);(m&&te==="auto"||!m&&te===h)&&(ce.selected=!0),L.add(ce)});const F=n===1,B=n===r;if(M.style.display!=="none"){const te=Wr(_C,this).ownerDocument.activeElement;F?(st(g,"ht-page-navigation-section__button--disabled"),st(y,"ht-page-navigation-section__button--disabled"),g.disabled=!0,y.disabled=!0):(cn(g,"ht-page-navigation-section__button--disabled"),cn(y,"ht-page-navigation-section__button--disabled"),g.disabled=!1,y.disabled=!1),B?(st(x,"ht-page-navigation-section__button--disabled"),st(C,"ht-page-navigation-section__button--disabled"),x.disabled=!0,C.disabled=!0):(cn(x,"ht-page-navigation-section__button--disabled"),cn(C,"ht-page-navigation-section__button--disabled"),x.disabled=!1,C.disabled=!1),[g,y,x,C].includes(te)&&(y.disabled?x.focus():x.disabled&&y.focus())}return gn(g,[wc(Wr(gd,this).call(this,k4)),lR(F)]),gn(y,[wc(Wr(gd,this).call(this,T4)),lR(F)]),gn(x,[wc(Wr(gd,this).call(this,j4)),lR(B)]),gn(C,[wc(Wr(gd,this).call(this,M4)),lR(B)]),this}setPageSizeSectionVisibility(e){const{pageSizeSection:n,pageSizeSelect:r}=Wr(vl,this);return n.style.display=e?"":"none",r.disabled=!e,xE(NA,this,p3).call(this),this}setCounterSectionVisibility(e){return Wr(vl,this).pageCounterSection.style.display=e?"":"none",xE(NA,this,p3).call(this),this}setNavigationSectionVisibility(e){const{pageNavSection:n,first:r,prev:i,next:s,last:a}=Wr(vl,this);return n.style.display=e?"":"none",r.disabled=!e,i.disabled=!e,s.disabled=!e,a.disabled=!e,xE(NA,this,p3).call(this),this}destroy(){var e;(e=Wr(vl,this))===null||e===void 0||e.container.remove(),Ef(vl,this,null)}}function p3(){const{container:t,pageSizeSection:e,pageCounterSection:n,pageNavSection:r}=Wr(vl,this),i=e.style.display!=="none"||n.style.display!=="none"||r.style.display!=="none";Wr(ny,this)||(i?st(Wr(_C,this).querySelector(".ht-wrapper"),"htPagination"):cn(Wr(_C,this).querySelector(".ht-wrapper"),"htPagination")),t.style.display=i?"":"none"}ci(Hne,vo);const FFe=["nestedRows","mergeCells","fixedRowsTop","fixedRowsBottom"];function zFe(t){return FFe.some(e=>{const n=!!t[e];return n&&Yn(Jr`The \`pagination\` plugin cannot be used with the \`${e}\` option.\x20 This combination is not supported. The plugin will remain disabled.`),n})}function g3(t,e,n){return(e=VFe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function VFe(t){var e=BFe(t,"string");return typeof e=="symbol"?e:e+""}function BFe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class WFe{constructor(){g3(this,"pageSize",1),g3(this,"totalItems",0),g3(this,"totalPages",0)}calculate(e){let{pageSize:n,totalItems:r}=e;this.pageSize=Math.max(n,1),this.totalItems=r,this.totalPages=Math.max(1,Math.ceil(this.totalItems/this.pageSize))}getTotalPages(){return this.totalPages}getState(e){if(e-=1,e<0||e>=this.getTotalPages())return;const n=e*this.pageSize,r=Math.max(0,Math.min(n+this.pageSize-1,this.totalItems-1));return{startIndex:n,endIndex:r,pageSize:this.pageSize}}}function UFe(t,e,n){return(e=YFe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function YFe(t){var e=GFe(t,"string");return typeof e=="symbol"?e:e+""}function GFe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class KFe{constructor(){UFe(this,"pages",[])}calculate(e){let{itemsSizeProvider:n,viewportSizeProvider:r}=e;const i=n(),s=r(),a=[];let u=0,h=0,m=0;for(let g=0;g<i.length;g++){const y=i[g];m>0&&h+y>=s&&(a.push({startIndex:u,endIndex:g-1,pageSize:m}),u=g,h=0,m=0),h+=y,m+=1}a.push({startIndex:u,endIndex:Math.max(0,i.length-1),pageSize:m}),this.pages=a}getTotalPages(){return this.pages.length}getState(e){if(e-=1,!(e<0||e>=this.getTotalPages()))return this.pages[e]}}const Lne=new Map([["fixed",WFe],["auto",KFe]]);function $ne(t){Lne.has(t)||gt(`Unknown pagination strategy type: ${t}`);const e=Lne.get(t);return new e}function qFe(t,e){Fne(t,e),e.add(t)}function mv(t,e,n){Fne(t,e),e.set(t,n)}function Fne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qn(t,e){return t.get(rs(t,e))}function Va(t,e,n){return t.set(rs(t,e),n),n}function rs(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const ry="pagination",XFe=900,QFe=`plugin:${ry}`,zne=Jr`The \`auto\` page size setting requires the \`autoRowSize\`\x20 plugin to be enabled. Set the \`autoRowSize: true\` in the configuration to ensure correct behavior.`;var wE=new WeakMap,ec=new WeakMap,ch=new WeakMap,to=new WeakMap,uh=new WeakMap,kA=new WeakMap,TA=new WeakMap,fs=new WeakSet,v3=new WeakMap;class ZFe extends Zr{constructor(){super(...arguments),qFe(this,fs),mv(this,wE,null),mv(this,ec,1),mv(this,ch,10),mv(this,to,null),mv(this,uh,null),mv(this,kA,!1),mv(this,TA,!1),mv(this,v3,()=>{var e;!Qn(kA,this)&&(e=this.hot)!==null&&e!==void 0&&e.view&&rs(fs,this,iy).call(this)})}static get PLUGIN_KEY(){return ry}static get PLUGIN_PRIORITY(){return XFe}static get DEFAULT_SETTINGS(){return{pageSize:10,pageSizeList:["auto",5,10,20,50,100],initialPage:1,showPageSize:!0,showCounter:!0,showNavigation:!0,uiContainer:null}}isEnabled(){return!!this.hot.getSettings()[ry]}enablePlugin(){var e,n=this;if(zFe(this.hot.getSettings())){this.hot.getSettings()[ry]=!1;return}if(this.enabled)return;const r=this.hot.getSettings()[ry];(r==null?void 0:r.initialPage)!==void 0&&Va(ec,this,this.getSetting("initialPage")),(r==null?void 0:r.pageSize)!==void 0&&Va(ch,this,this.getSetting("pageSize")),Va(wE,this,this.hot.rowIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding",!1)),Qn(ch,this)==="auto"&&!((e=this.hot.getPlugin("autoRowSize"))!==null&&e!==void 0&&e.enabled)&&Yn(zne),Va(uh,this,$ne(Qn(ch,this)==="auto"?"auto":"fixed")),Qn(to,this)||(Va(to,this,new Hne({rootElement:this.hot.rootGridElement,uiContainer:this.getSetting("uiContainer"),isRtl:this.hot.isRtl(),themeName:this.hot.getCurrentThemeName(),phraseTranslator:function(){return n.hot.getTranslatedPhrase(...arguments)},shouldHaveBorder:()=>rs(fs,this,JFe).call(this),a11yAnnouncer:i=>_Ce(i)})),rs(fs,this,Vne).call(this),Qn(to,this).addLocalHook("firstPageClick",()=>this.firstPage()).addLocalHook("prevPageClick",()=>this.prevPage()).addLocalHook("nextPageClick",()=>this.nextPage()).addLocalHook("lastPageClick",()=>this.lastPage()).addLocalHook("pageSizeChange",i=>this.setPageSize(i))),this.addHook("init",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return rs(fs,n,lze).call(n,...s)},-1),this.addHook("beforeSelectAll",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return rs(fs,n,Bne).call(n,...s)}),this.addHook("beforeSelectColumns",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return rs(fs,n,Bne).call(n,...s)}),this.addHook("beforeSetRangeEnd",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return rs(fs,n,nze).call(n,...s)}),this.addHook("beforeSelectionHighlightSet",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return rs(fs,n,rze).call(n,...s)}),this.addHook("beforePaste",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return rs(fs,n,ize).call(n,...s)}),this.addHook("afterViewRender",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return rs(fs,n,sze).call(n,...s)}),this.addHook("afterRender",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return rs(fs,n,oze).call(n,...s)}),this.addHook("afterScrollVertically",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return rs(fs,n,cze).call(n,...s)}),this.addHook("afterLanguageChange",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return rs(fs,n,uze).call(n,...s)}),this.addHook("beforeHeightChange",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return rs(fs,n,aze).call(n,...s)}),this.addHook("afterSetTheme",function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return rs(fs,n,dze).call(n,...s)}),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",Qn(v3,this)),rs(fs,this,eze).call(this),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),rs(fs,this,iy).call(this),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.removeLocalHook("cacheUpdated",Qn(v3,this)).unregisterMap(this.pluginName),rs(fs,this,tze).call(this),Qn(to,this).destroy(),Va(to,this,null),super.disablePlugin()}getPaginationData(){const e=Qn(uh,this).getTotalPages();let n=-1,r=-1;const{pageSize:i,startIndex:s}=Qn(uh,this).getState(Qn(ec,this)),a=this.hot.countRows();let u=0;for(let h=s;u<i&&!(h>=a);h++)this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(h))||(n===-1&&(n=h),r=h,u+=1);return{currentPage:Qn(ec,this),totalPages:e,pageSize:i,pageSizeList:[...this.getSetting("pageSizeList")],autoPageSize:Qn(ch,this)==="auto",numberOfRenderedRows:this.hot.rowIndexMapper.getRenderableIndexesLength(),firstVisibleRowIndex:n,lastVisibleRowIndex:r}}setPage(e){const n=Qn(ec,this);this.hot.runHooks("beforePageChange",n,e)!==!1&&(Va(ec,this,e),rs(fs,this,iy).call(this),this.hot.scrollViewportTo({row:0}),this.hot.runHooks("afterPageChange",n,Qn(ec,this)),this.hot.view.adjustElementsSize(),this.hot.render())}resetPage(){this.setPage(this.getSetting("initialPage"))}setPageSize(e){var n;const r=Qn(ch,this);this.hot.runHooks("beforePageSizeChange",r,e)!==!1&&(e==="auto"&&!((n=this.hot.getPlugin("autoRowSize"))!==null&&n!==void 0&&n.enabled)&&Yn(zne),Va(uh,this,$ne(e==="auto"?"auto":"fixed")),Va(ch,this,e),rs(fs,this,iy).call(this),this.hot.runHooks("afterPageSizeChange",r,Qn(ch,this)),this.hot.view.adjustElementsSize(),this.hot.render())}resetPageSize(){this.setPageSize(this.getSetting("pageSize"))}resetPagination(){this.resetPage(),this.resetPageSize(),rs(fs,this,Vne).call(this)}nextPage(){this.setPage(Qn(ec,this)+1)}prevPage(){this.setPage(Qn(ec,this)-1)}firstPage(){this.setPage(1)}lastPage(){this.setPage(Qn(uh,this).getTotalPages())}hasPreviousPage(){return Qn(ec,this)>1}hasNextPage(){return Qn(ec,this)<Qn(uh,this).getTotalPages()}getCurrentPageData(){const{firstVisibleRowIndex:e,lastVisibleRowIndex:n}=this.getPaginationData();return e===-1||n===-1?[]:this.hot.getData(e,0,n,this.hot.countCols()-1)}showPageSizeSection(){Qn(to,this).setPageSizeSectionVisibility(!0),this.hot.runHooks("afterPageSizeVisibilityChange",!0)}hidePageSizeSection(){Qn(to,this).setPageSizeSectionVisibility(!1),this.hot.runHooks("afterPageSizeVisibilityChange",!1)}showPageCounterSection(){Qn(to,this).setCounterSectionVisibility(!0),this.hot.runHooks("afterPageCounterVisibilityChange",!0)}hidePageCounterSection(){Qn(to,this).setCounterSectionVisibility(!1),this.hot.runHooks("afterPageCounterVisibilityChange",!1)}showPageNavigationSection(){Qn(to,this).setNavigationSectionVisibility(!0),this.hot.runHooks("afterPageNavigationVisibilityChange",!0)}hidePageNavigationSection(){Qn(to,this).setNavigationSectionVisibility(!1),this.hot.runHooks("afterPageNavigationVisibilityChange",!1)}destroy(){var e;Va(wE,this,null),Va(uh,this,null),(e=Qn(to,this))===null||e===void 0||e.destroy(),Va(to,this,null),super.destroy()}}function Vne(){this.getSetting("showPageSize")?this.showPageSizeSection():this.hidePageSizeSection(),this.getSetting("showCounter")?this.showPageCounterSection():this.hidePageCounterSection(),this.getSetting("showNavigation")?this.showPageNavigationSection():this.hidePageNavigationSection()}function iy(){Va(kA,this,!0),Qn(wE,this).clear();const t=this.hot.rowIndexMapper.getRenderableIndexes(),e=t.length,{stylesHandler:n}=this.hot;Qn(uh,this).calculate({pageSize:Qn(ch,this),totalItems:e,viewportSizeProvider:()=>{const{view:s}=this.hot;if(s.isVerticallyScrollableByWindow()){const u=getComputedStyle(this.hot.rootDocument.body),h=Number.parseInt(u.marginTop,10)+Number.parseInt(u.marginBottom,10),m=this.hot.hasColHeaders()?s._wt.wtTable.getColumnHeaderHeight():0,g=Qn(to,this).getHeight();return s.getWorkspaceHeight()-g-m-h}const a=s.hasHorizontalScroll()?go():0;return s.getViewportHeight()-a},itemsSizeProvider:()=>this.hot.rowIndexMapper.getRenderableIndexes().map(a=>{var u;const h=this.hot.toVisualRow(a);return(u=this.hot.getRowHeight(h))!==null&&u!==void 0?u:n.getDefaultRowHeight(h)})});const r=Qn(uh,this).getTotalPages();if(Va(ec,this,Lr(Qn(ec,this),1,r)),t.length>0){const{startIndex:s,pageSize:a}=Qn(uh,this).getState(Qn(ec,this));t.splice(s,a)}t.length>0?this.hot.batchExecution(()=>{t.forEach(s=>Qn(wE,this).setValueAtIndex(s,!0))},!0):this.hot.rowIndexMapper.updateCache(!0),Va(kA,this,!1);const i=this.getPaginationData();Qn(to,this).updateState({...i,totalRenderedRows:e})}function JFe(){if(!this.hot.view)return!0;const{view:t}=this.hot;if(t.isVerticallyScrollableByWindow())return!1;if(t.hasHorizontalScroll()||t.getTableHeight()<t.getWorkspaceHeight())return!0;const{lastVisibleRowIndex:e}=this.getPaginationData();return t.getLastFullyVisibleRow()!==e}function eze(){this.hot.getFocusScopeManager().registerScope(ry,Qn(to,this).getContainer(),{shortcutsContextName:QFe,runOnlyIf:()=>this.getSetting("showPageSize")||this.getSetting("showNavigation"),onActivate:t=>{const e=Qn(to,this).getFocusableElements();e.length>0&&(t==="tab_from_above"?e.at(0).focus():t==="tab_from_below"&&e.at(-1).focus())}})}function tze(){this.hot.getFocusScopeManager().unregisterScope(ry)}function Bne(t,e){const{firstVisibleRowIndex:n,lastVisibleRowIndex:r}=this.getPaginationData();(Qn(ec,this)>1||t.row>=0)&&(t.row=n),e.row=r}function nze(t){if(this.hot.selection.isSelectedByColumnHeader()){const{lastVisibleRowIndex:e}=this.getPaginationData();t.row=e}}function rze(){if(!this.hot.getSettings().navigableHeaders)return;const t=this.hot.getSelectedRangeLast();if(!t.isSingle()){const{highlight:e}=t;e.row=Lr(e.row,t.getTopStartCorner().row,t.getBottomEndCorner().row)}}function ize(t,e){const{firstVisibleRowIndex:n,lastVisibleRowIndex:r}=this.getPaginationData();if(n===-1||r===-1)return!1;e.forEach(i=>{let{startRow:s}=i;if(t.length===0)return;const a=Math.min(t.length-(r-s+1),t.length);t.splice(0,a)})}function sze(){if(Qn(ch,this)!=="auto"||Qn(TA,this)){Va(TA,this,!1);return}rs(fs,this,iy).call(this),Va(TA,this,!0),this.hot.view.adjustElementsSize(),this.hot.render()}function oze(){const{view:t}=this.hot,e=t.isHorizontallyScrollableByWindow()?t.getTotalTableWidth():t.getWorkspaceWidth();Qn(to,this).updateWidth(e).refreshBorderState()}function aze(t){return this.getSetting("uiContainer")||!(typeof t=="number"||typeof t=="string"&&/^\d+$/.test(t)||typeof t=="string"&&t.endsWith("px"))?t:`calc(${typeof t=="string"&&t.endsWith("px")?t:`${t}px`} - ${Qn(to,this).getHeight()}px)`}function lze(){Qn(ch,this)!=="auto"&&rs(fs,this,iy).call(this)}function cze(){Qn(to,this).refreshBorderState()}function uze(){rs(fs,this,iy).call(this)}function dze(t){Qn(to,this).updateTheme(t)}function hze(t,e){fze(t,e),e.add(t)}function fze(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function b3(t,e,n){return(e=mze(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mze(t){var e=pze(t,"string");return typeof e=="symbol"?e:e+""}function pze(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Wne(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const y3="search",gze=190,vze="htSearchResult",bze=function(t,e,n,r,i){t.getCellMeta(e,n).isSearchResult=i},yze=function(t,e,n){return ls(t)||t===null||!t.toLocaleLowerCase||t.length===0||ls(e)||e===null?!1:e.toString().toLocaleLowerCase(n.locale).indexOf(t.toLocaleLowerCase(n.locale))!==-1};var x3=new WeakSet;class xze extends Zr{constructor(){super(...arguments),hze(this,x3),b3(this,"callback",bze),b3(this,"queryMethod",yze),b3(this,"searchResultClass",vze)}static get PLUGIN_KEY(){return y3}static get PLUGIN_PRIORITY(){return gze}isEnabled(){return this.hot.getSettings()[y3]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[y3];this.updatePluginSettings(n),this.addHook("beforeRenderer",function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Wne(x3,e,Une).call(e,...i)}),super.enablePlugin()}disablePlugin(){var e=this;const n=function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return Wne(x3,e,Une).call(e,...i)};this.hot.addHook("beforeRenderer",n),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("beforeRenderer",n)}),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}query(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getCallback(),r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.getQueryMethod();const i=this.hot.countRows(),s=this.hot.countCols(),a=[],u=this.hot;return En(0,i-1,h=>{En(0,s-1,m=>{const g=this.hot.getDataAtCell(h,m),y=this.hot.getCellMeta(h,m),x=y.search.callback||n,E=(y.search.queryMethod||r)(e,g,y);if(E){const M={row:h,col:m,data:g};a.push(M)}x&&x(u,h,m,g,E)})}),a}getCallback(){return this.callback}setCallback(e){this.callback=e}getQueryMethod(){return this.queryMethod}setQueryMethod(e){this.queryMethod=e}getSearchResultClass(){return this.searchResultClass}setSearchResultClass(e){this.searchResultClass=e}updatePluginSettings(e){nn(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}}function Une(t,e,n,r,i,s){const a=s.className||[];let u=[];typeof a=="string"?u=a.split(" "):u.push(...a),this.isEnabled()&&s.isSearchResult?u.includes(this.searchResultClass)||u.push(`${this.searchResultClass}`):u.includes(this.searchResultClass)&&u.splice(u.indexOf(this.searchResultClass),1),s.className=u.join(" ")}function jA(t,e,n){return(e=wze(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wze(t){var e=Cze(t,"string");return typeof e=="symbol"?e:e+""}function Cze(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Yne{constructor(e){jA(this,"viewportWidth",void 0),jA(this,"overwriteColumnWidthFn",void 0),jA(this,"baseWidths",new Map),jA(this,"stretchedWidths",new Map),this.overwriteColumnWidthFn=e}prepare(e){let{viewportWidth:n}=e;this.viewportWidth=n,this.baseWidths.clear(),this.stretchedWidths.clear()}setColumnBaseWidth(e,n){this.baseWidths.set(e,n)}calculate(){}getWidths(){return Array.from(this.stretchedWidths)}}class Sze extends Yne{calculate(){const e=Array.from(this.baseWidths).reduce((y,x)=>{let[,C]=x;return y+C},0);if(this.viewportWidth-e<0){this.stretchedWidths.clear();return}const r=this.viewportWidth/e,i=[],s=[];let a=this.viewportWidth,u=0;if(this.baseWidths.forEach((y,x)=>{const C=Math.round(y*r),E=this.overwriteColumnWidthFn(C,x);C===E&&C>=Kx?(i.push([x,E]),u+=E):C!==E&&(i.push([x,E]),s.push(x),a-=E)}),a<=Kx){this.stretchedWidths.clear();return}const h=a/u;let m=-1,g=0;i.forEach((y,x)=>{let[C,E]=y,M=E;s.includes(C)||(M=Math.round(E*h)),this.stretchedWidths.set(C,M),m=C,x<i.length-1&&(g+=M)}),this.stretchedWidths.size>1&&this.stretchedWidths.set(m,Math.round(this.viewportWidth-g))}}function Gne(t,e,n){Rze(t,e),e.set(t,n)}function Rze(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function w3(t,e){return t.get(Kne(t,e))}function MA(t,e,n){return t.set(Kne(t,e),n),n}function Kne(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var PA=new WeakMap,CE=new WeakMap;class _ze extends Yne{constructor(){super(...arguments),Gne(this,PA,0),Gne(this,CE,-1)}prepare(e){super.prepare(e),MA(PA,this,0),MA(CE,this,-1)}setColumnBaseWidth(e,n){super.setColumnBaseWidth(e,n),MA(CE,this,e),MA(PA,this,n)}calculate(){if(w3(CE,this)===-1)return;const e=Array.from(this.baseWidths).reduce((r,i)=>{let[,s]=i;return r+s},0),n=Math.max(this.viewportWidth-e+w3(PA,this),0);this.stretchedWidths.set(w3(CE,this),n)}}function Eze(t,e){qne(t,e),e.add(t)}function AA(t,e,n){qne(t,e),e.set(t,n)}function qne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ws(t,e){return t.get(NC(t,e))}function C3(t,e,n){return t.set(NC(t,e),n),n}function NC(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Nze="stretchColumns";var Ea=new WeakMap,kC=new WeakMap,S3=new WeakMap,OA=new WeakMap,SE=new WeakSet;class kze{constructor(e){Eze(this,SE),AA(this,Ea,void 0),AA(this,kC,void 0),AA(this,S3,new Map([["all",new Sze(NC(SE,this,Xne).bind(this))],["last",new _ze(NC(SE,this,Xne).bind(this))]])),AA(this,OA,"none"),C3(Ea,this,e),C3(kC,this,ws(Ea,this).columnIndexMapper.createAndRegisterIndexMap(Nze,"physicalIndexToValue"))}useStrategy(e){C3(OA,this,ws(S3,this).has(e)?e:"none")}refreshStretching(){if(ws(OA,this)==="none"){ws(kC,this).clear();return}ws(Ea,this).batchExecution(()=>{ws(kC,this).clear();const e=ws(S3,this).get(ws(OA,this));let r=ws(Ea,this).view.getViewportWidth();NC(SE,this,Tze).call(this)&&(r-=go(ws(Ea,this).rootDocument)),e.prepare({viewportWidth:r});for(let i=0;i<ws(Ea,this).countCols();i++)ws(Ea,this).columnIndexMapper.isHidden(ws(Ea,this).toPhysicalColumn(i))||e.setColumnBaseWidth(i,NC(SE,this,jze).call(this,i));e.calculate(),e.getWidths().forEach(i=>{let[s,a]=i;ws(kC,this).setValueAtIndex(ws(Ea,this).toPhysicalColumn(s),a)})},!0)}getStretchedWidth(e){return ws(kC,this).getValueAtIndex(ws(Ea,this).toPhysicalColumn(e))}}function Tze(){const{view:t,stylesHandler:e}=ws(Ea,this);if(t.isVerticallyScrollableByWindow())return!1;const n=t.getViewportHeight(),r=ws(Ea,this).countRows(),i=e.getDefaultRowHeight();let s=0,a=!1;for(let h=0;h<r;h++){var u;if(!ws(Ea,this).rowIndexMapper.isHidden(ws(Ea,this).toPhysicalRow(h))&&(s+=(u=ws(Ea,this).getRowHeight(h))!==null&&u!==void 0?u:i,s>n)){a=!0;break}}return a}function jze(t){var e;return(e=ws(Ea,this).getColWidth(t,"StretchColumns"))!==null&&e!==void 0?e:Kx}function Xne(t,e){return ws(Ea,this).runHooks("beforeStretchingColumnWidth",t,e)}function Mze(t,e){Qne(t,e),e.add(t)}function R3(t,e,n){Qne(t,e),e.set(t,n)}function Qne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _3(t,e,n){return t.set(IA(t,e),n),n}function lp(t,e){return t.get(IA(t,e))}function IA(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Pze="stretchColumns",Aze=155;var TC=new WeakMap,DA=new WeakMap,RE=new WeakMap,E3=new WeakSet;class Oze extends Zr{constructor(){super(...arguments),Mze(this,E3),R3(this,TC,new kze(this.hot)),R3(this,DA,null),R3(this,RE,new ResizeObserver(e=>{requestAnimationFrame(()=>{var n;(n=this.hot)!==null&&n!==void 0&&n.view.isHorizontallyScrollableByWindow()&&e.forEach(r=>{let{contentRect:i}=r;lp(DA,this)!==null&&lp(DA,this)!==i.width&&(this.hot.view.adjustElementsSize(),this.hot.refreshDimensions()),_3(DA,this,i.width)})})}))}static get PLUGIN_KEY(){return Pze}static get PLUGIN_PRIORITY(){return Aze}static get SETTING_KEYS(){return!0}isEnabled(){return["all","last"].includes(this.hot.getSettings().stretchH)}enablePlugin(){var e=this;this.enabled||(lp(TC,this).useStrategy(this.hot.getSettings().stretchH),lp(RE,this).observe(this.hot.rootElement),this.addHook("beforeRender",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return IA(E3,e,Dze).call(e,...r)}),this.addHook("modifyColWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return IA(E3,e,Ize).call(e,...r)},10),super.enablePlugin())}updatePlugin(){lp(TC,this).useStrategy(this.hot.getSettings().stretchH),super.updatePlugin()}disablePlugin(){super.disablePlugin(),lp(RE,this).unobserve(this.hot.rootElement)}getColumnWidth(e){return lp(TC,this).getStretchedWidth(e)}destroy(){lp(RE,this).disconnect(),_3(RE,this,null),_3(TC,this,null),super.destroy()}}function Ize(t,e,n){if(n===this.pluginName)return;const r=this.getColumnWidth(e);return typeof r=="number"?r:t}function Dze(t){t&&lp(TC,this).refreshStretching()}function Hze(t,e){Lze(t,e),e.add(t)}function Lze(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function HA(t,e,n){return(e=$ze(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $ze(t){var e=Fze(t,"string");return typeof e=="symbol"?e:e+""}function Fze(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function N3(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const zze="touchScroll",Vze=200;var LA=new WeakSet;class Bze extends Zr{constructor(){super(...arguments),Hze(this,LA),HA(this,"scrollbars",[]),HA(this,"clones",[]),HA(this,"lockedCollection",!1),HA(this,"freezeOverlays",!1)}static get PLUGIN_KEY(){return zze}static get PLUGIN_PRIORITY(){return Vze}static get SETTING_KEYS(){return!0}isEnabled(){return nG()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",()=>N3(LA,this,Wze).call(this)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",()=>N3(LA,this,Uze).call(this)),this.addHook("afterMomentumScroll",()=>N3(LA,this,Yze).call(this))}}function Wze(){if(this.lockedCollection)return;const{topOverlay:t,bottomOverlay:e,inlineStartOverlay:n,topInlineStartCornerOverlay:r,bottomInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;this.lockedCollection=!0,this.scrollbars.length=0,this.scrollbars.push(t),e.clone&&this.scrollbars.push(e),this.scrollbars.push(n),r&&this.scrollbars.push(r),i&&i.clone&&this.scrollbars.push(i),this.clones=[],t.needFullRender&&this.clones.push(t.clone.wtTable.holder.parentNode),e.needFullRender&&this.clones.push(e.clone.wtTable.holder.parentNode),n.needFullRender&&this.clones.push(n.clone.wtTable.holder.parentNode),r&&this.clones.push(r.clone.wtTable.holder.parentNode),i&&i.clone&&this.clones.push(i.clone.wtTable.holder.parentNode)}function Uze(){this.freezeOverlays=!0,Te(this.clones,t=>{st(t,"hide-tween")})}function Yze(){this.freezeOverlays=!1,Te(this.clones,t=>{cn(t,"hide-tween"),st(t,"show-tween")}),this.hot._registerTimeout(()=>{Te(this.clones,t=>{cn(t,"show-tween")})},400),Te(this.scrollbars,t=>{t.refresh(),t.resetFixedPosition()}),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}function Gze(t,e){Kze(t,e),e.add(t)}function Kze(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qze(t,e,n){return(e=Xze(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xze(t){var e=Qze(t,"string");return typeof e=="symbol"?e:e+""}function Qze(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zze(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const $A="trimRows",Jze=330;var Zne=new WeakSet;class eVe extends Zr{constructor(){super(...arguments),Gze(this,Zne),qze(this,"trimmedRowsMap",null)}static get PLUGIN_KEY(){return $A}static get PLUGIN_PRIORITY(){return Jze}isEnabled(){return!!this.hot.getSettings()[$A]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new MR),this.trimmedRowsMap.addLocalHook("init",()=>Zze(Zne,this,tVe).call(this)),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[$A];Array.isArray(e)&&this.hot.batchExecution(()=>{this.trimmedRowsMap.clear(),Te(e,n=>{this.trimmedRowsMap.setValueAtIndex(n,!0)})},!0),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("trimRows"),super.disablePlugin()}getTrimmedRows(){return this.trimmedRowsMap.getTrimmedIndexes()}trimRows(e){const n=this.getTrimmedRows(),r=this.isValidConfig(e);let i=n;r&&(i=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeTrimRow",n,i,r)!==!1&&(r&&this.hot.batchExecution(()=>{Te(e,a=>{this.trimmedRowsMap.setValueAtIndex(a,!0)})},!0),this.hot.runHooks("afterTrimRow",n,i,r,r&&i.length>n.length))}trimRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.trimRows(n)}untrimRows(e){const n=this.getTrimmedRows(),r=this.isValidConfig(e);let i=n;const s=this.trimmedRowsMap.getValues().slice(),a=e.length>0;r&&a&&(Te(e,h=>{s[h]=!1}),i=xc(s,(h,m,g)=>(m&&h.push(g),h),[])),this.hot.runHooks("beforeUntrimRow",n,i,r&&a)!==!1&&(r&&a&&this.trimmedRowsMap.setValues(s),this.hot.runHooks("afterUntrimRow",n,i,r&&a,r&&i.length<n.length))}untrimRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.untrimRows(n)}isTrimmed(e){return this.trimmedRowsMap.getValueAtIndex(e)||!1}untrimAll(){this.untrimRows(this.getTrimmedRows())}isValidConfig(e){const n=this.hot.countSourceRows();return e.every(r=>Number.isInteger(r)&&r>=0&&r<n)}destroy(){super.destroy()}}function tVe(){const t=this.hot.getSettings()[$A];Array.isArray(t)&&this.hot.batchExecution(()=>{Te(t,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0)}function nVe(t,e,n){return(e=rVe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rVe(t){var e=iVe(t,"string");return typeof e=="symbol"?e:e+""}function iVe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class vd{constructor(e){nVe(this,"actionType",""),this.actionType=e}undo(){gt("Not implemented")}redo(){gt("Not implemented")}}function FA(t,e,n){return(e=sVe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sVe(t){var e=oVe(t,"string");return typeof e=="symbol"?e:e+""}function oVe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class k3 extends vd{constructor(e){let{stateBefore:n,range:r,type:i,alignment:s}=e;super("cell_alignment"),FA(this,"stateBefore",void 0),FA(this,"range",void 0),FA(this,"type",void 0),FA(this,"alignment",void 0),this.stateBefore=n,this.range=r,this.type=i,this.alignment=s}static startRegisteringEvents(e,n){e.addHook("beforeCellAlignment",(r,i,s,a)=>{n.done(()=>new k3({stateBefore:r,range:i,type:s,alignment:a}))})}undo(e,n){Te(this.range,r=>{r.forAll((i,s)=>{i>=0&&s>=0&&e.setCellMeta(i,s,"className",this.stateBefore[i][s]||" htLeft")})}),e.addHookOnce("afterViewRender",n),e.render()}redo(e,n){Wg(this.range,this.type,this.alignment,(r,i)=>e.getCellMeta(r,i),(r,i,s,a)=>e.setCellMeta(r,i,s,a)),e.addHookOnce("afterViewRender",n),e.render()}}function Jne(t,e,n){return(e=aVe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aVe(t){var e=lVe(t,"string");return typeof e=="symbol"?e:e+""}function lVe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class T3 extends vd{constructor(e){let{columns:n,finalIndex:r}=e;super("col_move"),Jne(this,"columns",void 0),Jne(this,"finalColumnIndex",void 0),this.columns=n.slice(),this.finalColumnIndex=r}static startRegisteringEvents(e,n){e.addHook("beforeColumnMove",(r,i)=>{r!==!1&&n.done(()=>new T3({columns:r,finalIndex:i}))})}undo(e,n){const r=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",n),kV(this.columns,this.finalColumnIndex,e.columnIndexMapper.getNumberOfIndexes()).reverse().forEach(s=>{let{from:a,to:u}=s;a<u&&(u-=1),r.moveColumn(u,a)}),e.render(),e.deselectCell(),e.selectColumns(this.columns[0],this.columns[0]+this.columns.length-1)}redo(e,n){const r=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",n),r.moveColumns(this.columns.slice(),this.finalColumnIndex),e.render(),e.deselectCell(),e.selectColumns(this.finalColumnIndex,this.finalColumnIndex+this.columns.length-1)}}function ere(t,e,n){return(e=cVe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cVe(t){var e=uVe(t,"string");return typeof e=="symbol"?e:e+""}function uVe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class j3 extends vd{constructor(e){let{currentSortState:n,newSortState:r}=e;super("col_sort"),ere(this,"previousSortState",void 0),ere(this,"nextSortState",void 0),this.previousSortState=n,this.nextSortState=r}static startRegisteringEvents(e,n){e.addHook("beforeColumnSort",(r,i,s)=>{s&&n.done(()=>new j3({currentSortState:r,newSortState:i}))})}undo(e,n){const r=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting"),s=i.isEnabled()?i:r;this.previousSortState.length?s.sort(this.previousSortState):s.clearSort(),n()}redo(e,n){const r=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting");(i.isEnabled()?i:r).sort(this.nextSortState),n()}}function tre(t,e,n){return(e=dVe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dVe(t){var e=hVe(t,"string");return typeof e=="symbol"?e:e+""}function hVe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class M3 extends vd{constructor(e){let{index:n,amount:r}=e;super("insert_col"),tre(this,"index",void 0),tre(this,"amount",void 0),this.index=n,this.amount=r}static startRegisteringEvents(e,n){e.addHook("afterCreateCol",(r,i,s)=>{n.done(()=>new M3({index:r,amount:i}),s)})}undo(e,n){e.addHookOnce("afterRemoveCol",n),e.alter("remove_col",this.index,this.amount,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterCreateCol",n),e.alter("insert_col_start",this.index,this.amount,"UndoRedo.redo")}}function nre(t,e,n){return(e=fVe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fVe(t){var e=mVe(t,"string");return typeof e=="symbol"?e:e+""}function mVe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class P3 extends vd{constructor(e){let{index:n,amount:r}=e;super("insert_row"),nre(this,"index",void 0),nre(this,"amount",void 0),this.index=n,this.amount=r}static startRegisteringEvents(e,n){e.addHook("afterCreateRow",(r,i,s)=>{n.done(()=>new P3({index:r,amount:i}),s)})}undo(e,n){const r=e.countRows(),i=e.getSettings().minSpareRows;this.index>=r&&this.index-i<r&&(this.index-=i),e.addHookOnce("afterRemoveRow",n),e.alter("remove_row",this.index,this.amount,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterCreateRow",n),e.alter("insert_row_above",this.index,this.amount,"UndoRedo.redo")}}function zA(t,e,n){return(e=pVe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pVe(t){var e=gVe(t,"string");return typeof e=="symbol"?e:e+""}function gVe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class A3 extends vd{constructor(e){let{changes:n,selected:r,countCols:i,countRows:s}=e;super("change"),zA(this,"changes",void 0),zA(this,"selected",void 0),zA(this,"countCols",void 0),zA(this,"countRows",void 0),this.changes=n,this.selected=r,this.countCols=i,this.countRows=s}static startRegisteringEvents(e,n){e.addHook("beforeChange",function(r,i){const s=r&&r.length;if(!s||!r.find(h=>{const[,,m,g]=h;return m!==g}))return;const u=()=>{const h=r.reduce((g,y)=>(g.push([...y]),g),[]);h.forEach(g=>{g[1]=e.propToCol(g[1])});const m=s>1?this.getSelected():[[h[0][0],h[0][1]]];return new A3({changes:h,selected:m,countCols:e.countCols(),countRows:e.countRows()})};n.done(u,i)})}undo(e,n){const r=ea(this.changes);for(let i=0,s=r.length;i<s;i++)r[i].splice(3,1);e.addHookOnce("afterChange",()=>{const i=e.countRows()-this.countRows;i>0&&e.alter("remove_row",null,i,"UndoRedo.undo");const s=e.countCols()-this.countCols;s>0&&e.isColumnModificationAllowed()&&e.alter("remove_col",null,s,"UndoRedo.undo"),e.scrollToFocusedCell(),e.selectCells(this.selected,!1,!1),n()}),e.setDataAtCell(r,null,null,"UndoRedo.undo")}redo(e,n){const r=ea(this.changes);for(let i=0,s=r.length;i<s;i++)r[i].splice(2,1);e.addHookOnce("afterChange",()=>{e.selectCells(this.selected,!1,!1),n()}),e.setDataAtCell(r,null,null,"UndoRedo.redo")}}function rre(t,e,n){return(e=vVe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vVe(t){var e=bVe(t,"string");return typeof e=="symbol"?e:e+""}function bVe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class O3 extends vd{constructor(e){let{conditionsStack:n,previousConditionsStack:r}=e;super("filter"),rre(this,"conditionsStack",void 0),rre(this,"previousConditionsStack",void 0),this.conditionsStack=n,this.previousConditionsStack=r}static startRegisteringEvents(e,n){e.addHook("beforeFilter",(r,i)=>{n.done(()=>new O3({conditionsStack:r,previousConditionsStack:i}))})}undo(e,n){const r=e.getPlugin("filters");e.addHookOnce("afterViewRender",n),r.importConditions(this.previousConditionsStack),r.filter()}redo(e,n){const r=e.getPlugin("filters");e.addHookOnce("afterViewRender",n),r.importConditions(this.conditionsStack),r.filter()}}function yVe(t,e,n){return(e=xVe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xVe(t){var e=wVe(t,"string");return typeof e=="symbol"?e:e+""}function wVe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class I3 extends vd{constructor(e){let{data:n,cellRange:r}=e;super("merge_cells"),yVe(this,"cellRange",void 0),this.cellRange=r,this.data=n}static startRegisteringEvents(e,n){e.addHook("beforeMergeCells",(r,i)=>{if(i)return;const s=r.getTopStartCorner(),a=r.getBottomEndCorner(),u=e.getData(s.row,s.col,a.row,a.col);n.done(()=>new I3({data:u,cellRange:r}))})}undo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.unmergeRange(this.cellRange,!0);const i=this.cellRange.getTopStartCorner();e.populateFromArray(i.row,i.col,this.data,void 0,void 0,"MergeCells")}redo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.mergeRange(this.cellRange)}}function ire(t,e,n,r,i){const s=[];return En(r,i,a=>{En(e,n,u=>{const h=t.getCellMeta(u,a);s.push([h.visualRow,h.visualCol,h])})}),s}function cp(t,e,n){return(e=CVe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function CVe(t){var e=SVe(t,"string");return typeof e=="symbol"?e:e+""}function SVe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class D3 extends vd{constructor(e){let{index:n,indexes:r,data:i,amount:s,headers:a,columnPositions:u,rowPositions:h,fixedColumnsStart:m,removedCellMetas:g}=e;super("remove_col"),cp(this,"index",void 0),cp(this,"indexes",void 0),cp(this,"data",void 0),cp(this,"amount",void 0),cp(this,"headers",void 0),cp(this,"columnPositions",void 0),cp(this,"rowPositions",void 0),cp(this,"fixedColumnsStart",void 0),cp(this,"removedCellMetas",void 0),this.index=n,this.indexes=r,this.data=i,this.amount=s,this.headers=a,this.columnPositions=u.slice(0),this.rowPositions=h.slice(0),this.fixedColumnsStart=m,this.removedCellMetas=g}static startRegisteringEvents(e,n){e.addHook("beforeRemoveCol",(r,i,s,a)=>{const u=()=>{const h=e.getSourceDataArray(),m=(e.countCols()+r)%e.countCols(),g=m+i-1,y=[],x=[],C=[];return En(h.length-1,E=>{const M=[],j=h[E];En(m,g,L=>{M.push(j[e.toPhysicalColumn(L)])}),y.push(M)}),En(i-1,E=>{C.push(e.toPhysicalColumn(m+E))}),Array.isArray(e.getSettings().colHeaders)&&En(i-1,E=>{x.push(e.getSettings().colHeaders[e.toPhysicalColumn(m+E)]||null)}),new D3({index:m,indexes:C,data:y,amount:i,headers:x,columnPositions:e.columnIndexMapper.getIndexesSequence(),rowPositions:e.rowIndexMapper.getIndexesSequence(),fixedColumnsStart:e.getSettings().fixedColumnsStart,removedCellMetas:ire(e,0,e.countRows(),m,g)})};n.done(u,a)})}undo(e,n){const r=e.getSettings();r.fixedColumnsStart=this.fixedColumnsStart;const i=this.indexes.slice(0).sort(),s=(g,y,x)=>x[this.indexes.indexOf(i[y])],a=this.data.length,u=[];for(let g=0;g<a;g++)u.push(di(this.data[g],s));const h=di(this.headers,s),m=[];e.columnIndexMapper.setIndexesSequence(this.columnPositions),e.alter("insert_col_start",e.toVisualColumn(this.indexes[0]),this.indexes.length,"UndoRedo.undo"),e.batchExecution(()=>{e.rowIndexMapper.setIndexesSequence(this.rowPositions),e.columnIndexMapper.setIndexesSequence(this.columnPositions)},!0),Te(e.getSourceDataArray(),(g,y)=>{Te(i,(x,C)=>{g[x]=u[y][C],m.push([y,x,g[x]])})}),typeof this.headers<"u"&&Te(h,(g,y)=>{e.getSettings().colHeaders[i[y]]=g}),this.removedCellMetas.forEach(g=>{let[y,x,C]=g;e.setCellMetaObject(y,x,C)}),e.addHookOnce("afterViewRender",n),e.setSourceDataAtCell(m,null,null,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterRemoveCol",n),e.alter("remove_col",this.index,this.amount,"UndoRedo.redo")}}function jC(t,e,n){return(e=RVe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function RVe(t){var e=_Ve(t,"string");return typeof e=="symbol"?e:e+""}function _Ve(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class H3 extends vd{constructor(e){let{index:n,data:r,fixedRowsBottom:i,fixedRowsTop:s,rowIndexesSequence:a,removedCellMetas:u}=e;super("remove_row"),jC(this,"index",void 0),jC(this,"data",void 0),jC(this,"fixedRowsBottom",void 0),jC(this,"fixedRowsTop",void 0),jC(this,"rowIndexesSequence",void 0),jC(this,"removedCellMetas",void 0),this.index=n,this.data=r,this.fixedRowsBottom=i,this.fixedRowsTop=s,this.rowIndexesSequence=a,this.removedCellMetas=u}static startRegisteringEvents(e,n){e.addHook("beforeRemoveRow",(r,i,s,a)=>{const u=()=>{const h=e.toPhysicalRow(r),m=h+i-1,g=ea(e.getSourceData(h,0,h+i-1,e.countSourceCols()-1));return new H3({index:h,data:g,fixedRowsBottom:e.getSettings().fixedRowsBottom,fixedRowsTop:e.getSettings().fixedRowsTop,rowIndexesSequence:e.rowIndexMapper.getIndexesSequence(),removedCellMetas:ire(e,h,m,0,e.countCols()-1)})};n.done(u,a)})}undo(e,n){const r=e.getSettings(),i=[];r.fixedRowsBottom=this.fixedRowsBottom,r.fixedRowsTop=this.fixedRowsTop,this.data.forEach((s,a)=>{Object.keys(s).forEach(u=>{const h=parseInt(u,10);i.push([this.index+a,isNaN(h)?u:h,s[u]])})}),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),e.alter("insert_row_above",e.toVisualRow(this.index),this.data.length,"UndoRedo.undo"),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),this.removedCellMetas.forEach(s=>{let[a,u,h]=s;e.setCellMetaObject(a,u,h)}),e.addHookOnce("afterViewRender",n),e.setSourceDataAtCell(i,null,null,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterRemoveRow",n),e.alter("remove_row",e.toVisualRow(this.index),this.data.length,"UndoRedo.redo")}}function sre(t,e,n){return(e=EVe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function EVe(t){var e=NVe(t,"string");return typeof e=="symbol"?e:e+""}function NVe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class L3 extends vd{constructor(e){let{rows:n,finalIndex:r}=e;super("row_move"),sre(this,"rows",void 0),sre(this,"finalRowIndex",void 0),this.rows=n.slice(),this.finalRowIndex=r}static startRegisteringEvents(e,n){e.addHook("beforeRowMove",(r,i)=>{r!==!1&&n.done(()=>new L3({rows:r,finalIndex:i}))})}undo(e,n){const r=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",n),kV(this.rows,this.finalRowIndex,e.rowIndexMapper.getNumberOfIndexes()).reverse().forEach(s=>{let{from:a,to:u}=s;a<u&&(u-=1),r.moveRow(u,a)}),e.render(),e.deselectCell(),e.selectRows(this.rows[0],this.rows[0]+this.rows.length-1)}redo(e,n){const r=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",n),r.moveRows(this.rows.slice(),this.finalRowIndex),e.render(),e.deselectCell(),e.selectRows(this.finalRowIndex,this.finalRowIndex+this.rows.length-1)}}function kVe(t,e,n){return(e=TVe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function TVe(t){var e=jVe(t,"string");return typeof e=="symbol"?e:e+""}function jVe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class $3 extends vd{constructor(e){let{cellRange:n}=e;super("unmerge_cells"),kVe(this,"cellRange",void 0),this.cellRange=n}static startRegisteringEvents(e,n){e.addHook("afterUnmergeCells",(r,i)=>{i||n.done(()=>new $3({cellRange:r}))})}undo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.mergeRange(this.cellRange,!0)}redo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.unmergeRange(this.cellRange,!0),e.render()}}function MVe(t,e){[k3,T3,j3,M3,P3,A3,O3,I3,D3,H3,L3,$3].forEach(n=>n.startRegisteringEvents(t,e))}function PVe(t,e){AVe(t,e),e.add(t)}function AVe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function F3(t,e,n){return(e=OVe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function OVe(t){var e=IVe(t,"string");return typeof e=="symbol"?e:e+""}function IVe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function DVe(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const ore="undoRedo",HVe="undoRedo",LVe=1e3;un.getSingleton().register("beforeUndo"),un.getSingleton().register("afterUndo"),un.getSingleton().register("beforeRedo"),un.getSingleton().register("afterRedo");var are=new WeakSet;class $Ve extends Zr{static get PLUGIN_KEY(){return HVe}static get PLUGIN_PRIORITY(){return LVe}static get SETTING_KEYS(){return!0}constructor(e){super(e),PVe(this,are),F3(this,"doneActions",[]),F3(this,"undoneActions",[]),F3(this,"ignoreNewActions",!1),MVe(e,this)}isEnabled(){return!!this.hot.getSettings().undo}enablePlugin(){var e=this;this.enabled||(this.addHook("afterChange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return DVe(are,e,FVe).call(e,...r)}),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){super.disablePlugin(),this.clear(),this.unregisterShortcuts()}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("grid"),i={runOnlyIf:s=>!s.altKey,group:ore};n.addShortcuts([{keys:[["Control/Meta","z"]],callback:()=>{this.undo()}},{keys:[["Control/Meta","y"],["Control/Meta","Shift","z"]],callback:()=>{this.redo()}}],i)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(ore)}done(e,n){if(this.ignoreNewActions||n==="UndoRedo.undo"||n==="UndoRedo.redo"||n==="auto")return;const i=this.doneActions.slice();if(this.hot.runHooks("beforeUndoStackChange",i,n)===!1)return;const a=e(),u=this.undoneActions.slice();this.doneActions.push(a),this.hot.runHooks("afterUndoStackChange",i,this.doneActions.slice()),this.hot.runHooks("beforeRedoStackChange",u),this.undoneActions.length=0,this.hot.runHooks("afterRedoStackChange",u,this.undoneActions.slice())}undo(){if(!this.isUndoAvailable())return;const e=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",e);const n=this.doneActions.pop();this.hot.runHooks("afterUndoStackChange",e,this.doneActions.slice());const r=ea(n);if(this.hot.runHooks("beforeUndo",r)===!1)return;this.ignoreNewActions=!0;const s=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",s),n.undo(this.hot,()=>{this.ignoreNewActions=!1,this.undoneActions.push(n)}),this.hot.runHooks("afterRedoStackChange",s,this.undoneActions.slice()),this.hot.runHooks("afterUndo",r)}redo(){if(!this.isRedoAvailable())return;const e=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",e);const n=this.undoneActions.pop();this.hot.runHooks("afterRedoStackChange",e,this.undoneActions.slice());const r=ea(n);if(this.hot.runHooks("beforeRedo",r)===!1)return;this.ignoreNewActions=!0;const s=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",s),n.redo(this.hot,()=>{this.ignoreNewActions=!1,this.doneActions.push(n)}),this.hot.runHooks("afterUndoStackChange",s,this.doneActions.slice()),this.hot.runHooks("afterRedo",r)}isUndoAvailable(){return this.doneActions.length>0}isRedoAvailable(){return this.undoneActions.length>0}clear(){this.doneActions.length=0,this.undoneActions.length=0}destroy(){this.clear(),this.doneActions=null,this.undoneActions=null,super.destroy()}}function FVe(t,e){e==="loadData"&&this.clear()}const Na="ht-dialog";function zVe(){function t(){return` <div data-ref="contentElement" class="${Na}__content"></div> `}let e=null;const n={};function r(){const s=Bx`${t()}`;return Object.assign(n,s.refs),e=s.fragment,s}function i(){return e===null&>("Compile the template first."),[]}return{TEMPLATE_NAME:"base",dialogA11YOptions(){return{role:"dialog"}},compile:r,focusableElements:i}}function VVe(t){let{id:e="",title:n="",description:r="",buttons:i=[]}=t;function s(){return` <div tabindex="-1" data-ref="contentElement" class="${Na}__content-wrapper-inner"> <div class="${Na}__content"> <h2 id="${e}-dialog-confirm-title" class="${Na}__title">${vm(n)}</h2> <p id="${e}-dialog-confirm-description" class="${Na}__description">${vm(r)}</p> </div> ${i.length>0?` <div data-ref="buttonsContainer" class="${Na}__buttons"> ${i.map(g=>` <button class="ht-button ht-button--${g.type}">${vm(g.text)}</button> `).join("")} </div> `:""} </div> `}let a=null;const u={};function h(){const g=Bx`${s()}`;return Object.assign(u,g.refs),a=g.fragment,g}function m(){a===null&>("Compile the template first.");const{contentElement:g,buttonsContainer:y}=u,x=[];return y?x.push(...Array.from(y.children)):x.push(g),x}return{TEMPLATE_NAME:"confirm",dialogA11YOptions(){return{role:"alertdialog",ariaLabelledby:`${e}-dialog-confirm-title`,ariaDescribedby:r?`${e}-dialog-confirm-description`:void 0}},compile:h,focusableElements:m}}const _E=new Map([["base",zVe],["confirm",VVe]]);function BVe(t,e){lre(t,e),e.add(t)}function sy(t,e,n){lre(t,e),e.set(t,n)}function lre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ms(t,e){return t.get(VA(t,e))}function bd(t,e,n){return t.set(VA(t,e),n),n}function VA(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const WVe=` <div data-ref="dialogElement" class="${Na}"> <div data-ref="dialogWrapperElement" class="${Na}__content-wrapper"> </div> `;var z3=new WeakMap,bl=new WeakMap,V3=new WeakMap,EE=new WeakMap,Nf=new WeakMap,BA=new WeakMap,B3=new WeakMap,W3=new WeakSet;class cre{constructor(e){let{rootElement:n,isRtl:r,sanitizer:i}=e;BVe(this,W3),sy(this,z3,void 0),sy(this,bl,void 0),sy(this,V3,!1),sy(this,EE,!1),sy(this,Nf,_E.get("base")),sy(this,BA,[]),sy(this,B3,void 0),bd(z3,this,n),bd(V3,this,r),bd(B3,this,i),this.install()}useTemplate(e){var n;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!_E.has(e)||e==="base"){const i=Array.from(_E.keys()).filter(s=>s!=="base").join(", ");gt(Jr`Invalid template: ${e}.\x20 Valid templates are: ${i}.`)}bd(Nf,this,_E.get(e)(r)),bd(BA,this,((n=r.buttons)!==null&&n!==void 0?n:[]).map(i=>i.callback))}useDefaultTemplate(){bd(Nf,this,_E.get("base")()),bd(BA,this,[])}install(){var e;if((e=ms(bl,this))!==null&&e!==void 0&&e.dialogElement)return;const n=Bx`${WVe}`;bd(bl,this,n.refs);const{dialogElement:r}=ms(bl,this);gn(r,[Spe(),["dir",ms(V3,this)?"rtl":"ltr"]]),r.addEventListener("transitionstart",()=>VA(W3,this,YVe).call(this)),r.addEventListener("transitionend",()=>VA(W3,this,UVe).call(this)),ms(z3,this).after(n.fragment)}getContainer(){return ms(bl,this).dialogElement}getFocusableElements(){return ms(Nf,this).focusableElements()}updateDialog(e){let{isVisible:n,content:r,customClassName:i,background:s,contentBackground:a,animation:u,a11y:h}=e;const m=ms(Nf,this).compile(),{dialogElement:g,dialogWrapperElement:y}=ms(bl,this);y.innerHTML="",y.appendChild(m.fragment),Object.assign(ms(bl,this),m.refs);const{contentElement:x,buttonsContainer:C}=ms(bl,this);ms(Nf,this).TEMPLATE_NAME!=="base"&&Object.assign(h,ms(Nf,this).dialogA11YOptions());const E=i?` ${i}`:"",M=s?` ${Na}--background-${s}`:"",j=u?` ${Na}--animation`:"",L=n?` ${Na}--show`:"";g.className=[Na,`${Na}--${ms(Nf,this).TEMPLATE_NAME}`,"handsontable",E,M,j,L].join(" "),gn(g,[ms(Nf,this).TEMPLATE_NAME==="base"?Ld(-1):void 0]),gn(g,[h.role==="alertdialog"?ape():ope()]),h.ariaLabel&&!h.ariaLabelledby?gn(g,[h.ariaLabel?wc(h.ariaLabel):void 0]):wm(g,"aria-label"),h.ariaLabelledby?gn(g,[hpe(h.ariaLabelledby)]):wm(g,"aria-labelledby"),h.ariaDescribedby?gn(g,[fpe(h.ariaDescribedby)]):wm(g,"aria-describedby");const D=a?` ${Na}__content--background`:"";return st(x,`${Na}__content${D}`),ms(Nf,this).TEMPLATE_NAME==="base"?(x.innerHTML="",typeof r=="string"?M0(x,r,ms(B3,this)):(r instanceof HTMLElement||r instanceof DocumentFragment)&&x.appendChild(r)):C&&Array.from(C.children).forEach((z,H)=>{const V=ms(BA,this)[H];V&&z.addEventListener("click",V)}),this}showDialog(e){const{dialogElement:n}=ms(bl,this);return n.style.display="block",e&&n.offsetHeight,st(n,`${Na}--show`),bd(EE,this,!1),this}hideDialog(e){const{dialogElement:n}=ms(bl,this);return cn(n,`${Na}--show`),(e&&!ms(EE,this)||!e)&&(n.style.display="none"),bd(EE,this,!1),this}focusDialog(){ms(bl,this).dialogElement.focus()}updateWidth(e){return ms(bl,this).dialogElement.style.width=`${e}px`,this}updateHeight(e){return ms(bl,this).dialogElement.style.height=`calc(100% - ${e}px)`,this}destroyDialog(){var e;(e=ms(bl,this))===null||e===void 0||e.dialogElement.remove(),bd(bl,this,null)}}function UVe(){const{dialogElement:t}=ms(bl,this);Dn(t,`${Na}--show`)||(t.style.display="none")}function YVe(){bd(EE,this,!0)}ci(cre,vo);function GVe(t,e){ure(t,e),e.add(t)}function U3(t,e,n){ure(t,e),e.set(t,n)}function ure(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function pv(t,e,n){return t.set(oy(t,e),n),n}function ka(t,e){return t.get(oy(t,e))}function oy(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const gv="dialog",KVe=360,Y3=gv,WA=`plugin:${gv}`;var Ba=new WeakMap,MC=new WeakMap,PC=new WeakMap,AC=new WeakSet;class UA extends Zr{constructor(){super(...arguments),GVe(this,AC),U3(this,Ba,null),U3(this,MC,!1),U3(this,PC,null)}static get PLUGIN_KEY(){return gv}static get PLUGIN_PRIORITY(){return KVe}static get DEFAULT_SETTINGS(){return{template:null,content:"",customClassName:"",background:"solid",contentBackground:!1,animation:!0,closable:!1,a11y:{role:"dialog",ariaLabel:"Dialog",ariaLabelledby:"",ariaDescribedby:""}}}static get SETTINGS_VALIDATORS(){return{template:e=>nn(e)&&typeof["alert","confirm"].includes(e.type)&&typeof e.title=="string"&&(typeof(e==null?void 0:e.description)>"u"||typeof(e==null?void 0:e.description)=="string")&&(typeof(e==null?void 0:e.buttons)>"u"||Array.isArray(e==null?void 0:e.buttons)&&e.buttons.every(n=>typeof n=="object"&&typeof n.text=="string"&&["primary","secondary"].includes(n.type)&&(typeof n.callback>"u"||typeof n.callback=="function"))),content:e=>typeof e=="string"||typeof HTMLElement<"u"&&e instanceof HTMLElement||typeof DocumentFragment<"u"&&e instanceof DocumentFragment,customClassName:e=>typeof e=="string",background:e=>["solid","semi-transparent"].includes(e),contentBackground:e=>typeof e=="boolean",animation:e=>typeof e=="boolean",closable:e=>typeof e=="boolean",a11y:e=>nn(e)&&(typeof(e==null?void 0:e.role)>"u"||["dialog","alertdialog"].includes(e==null?void 0:e.role))&&(typeof(e==null?void 0:e.ariaLabel)>"u"||typeof(e==null?void 0:e.ariaLabel)=="string")&&(typeof(e==null?void 0:e.ariaLabelledby)>"u"||typeof(e==null?void 0:e.ariaLabelledby)=="string")&&(typeof(e==null?void 0:e.ariaDescribedby)>"u"||typeof(e==null?void 0:e.ariaDescribedby)=="string")}}isEnabled(){return!!this.hot.getSettings()[gv]}enablePlugin(){this.enabled||(ka(Ba,this)||pv(Ba,this,new cre({rootElement:this.hot.rootGridElement,sanitizer:this.hot.getSettings().sanitizer,isRtl:this.hot.isRtl()})),oy(AC,this,qVe).call(this),oy(AC,this,QVe).call(this),this.addHook("afterViewRender",()=>oy(AC,this,JVe).call(this)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hide(),oy(AC,this,XVe).call(this),oy(AC,this,ZVe).call(this),super.disablePlugin()}isVisible(){return ka(MC,this)}show(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.enabled){if(this.isVisible()){this.update(e);return}this.hot.runHooks("beforeDialogShow"),this.update(e),ka(Ba,this).showDialog(this.getSetting("animation")),pv(MC,this,!0),this.hot.getFocusScopeManager().activateScope(gv),pv(PC,this,this.hot.selection.exportSelection()),this.hot.deselectCell(),this.hot.runHooks("afterDialogShow")}}hide(){var e;this.isVisible()&&(this.hot.runHooks("beforeDialogHide"),ka(Ba,this).hideDialog(this.getSetting("animation")),pv(MC,this,!1),this.hot.getFocusScopeManager().deactivateScope(gv),((e=ka(PC,this))===null||e===void 0?void 0:e.ranges.length)>0?(this.hot.selection.importSelection(ka(PC,this)),this.hot.view.render(),pv(PC,this,null)):this.hot.selectCell(0,0),this.hot.runHooks("afterDialogHide"))}update(e){if(!this.enabled)return;this.updatePluginSettings(e);const n=this.getSetting("template");n!==UA.DEFAULT_SETTINGS.template&&this.getSetting("content")!==UA.DEFAULT_SETTINGS.content&>("The `template` option cannot be used together with the `content` option."),n?ka(Ba,this).useTemplate(n.type,{id:this.hot.guid,...n}):ka(Ba,this).useDefaultTemplate(),ka(Ba,this).updateDialog({isVisible:this.isVisible(),content:this.getSetting("content"),customClassName:this.getSetting("customClassName"),background:this.getSetting("background"),contentBackground:this.getSetting("contentBackground"),animation:this.getSetting("animation"),a11y:this.getSetting("a11y")})}showAlert(e,n){const{title:r="Alert",description:i}=nn(e)?e:{title:e};this.show({template:{type:"confirm",title:r,description:i,buttons:[{text:this.hot.getTranslatedPhrase(lj),type:"primary",callback:function(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];return n==null?void 0:n(...a)}}]},contentBackground:!1,background:"solid",animation:!0,closable:!1})}showConfirm(e,n,r){const{title:i="Confirm",description:s}=nn(e)?e:{title:e};this.show({template:{type:"confirm",title:i,description:s,buttons:[{text:this.hot.getTranslatedPhrase(d5),type:"secondary",callback:function(){for(var a=arguments.length,u=new Array(a),h=0;h<a;h++)u[h]=arguments[h];return r==null?void 0:r(...u)}},{text:this.hot.getTranslatedPhrase(lj),type:"primary",callback:function(){for(var a=arguments.length,u=new Array(a),h=0;h<a;h++)u[h]=arguments[h];return n==null?void 0:n(...u)}}]},contentBackground:!0,background:"semi-transparent",animation:!0,closable:!1})}focus(){ka(Ba,this).focusDialog()}destroy(){var e;(e=ka(Ba,this))===null||e===void 0||e.destroyDialog(),pv(Ba,this,null),pv(MC,this,!1),pv(PC,this,null),super.destroy()}}function qVe(){var t;const e=this.hot.getShortcutManager(),n=(t=e.getContext(WA))!==null&&t!==void 0?t:e.addContext(WA);n.addShortcut({keys:[["Escape"]],callback:()=>{this.hide()},runOnlyIf:()=>ka(MC,this)&&this.getSetting("closable"),group:Y3}),n.addShortcut({keys:[["Shift","Tab"],["Tab"]],preventDefault:!1,callback:r=>{this.hot._registerTimeout(()=>{r.shiftKey?this.hot.runHooks("dialogFocusPreviousElement"):this.hot.runHooks("dialogFocusNextElement")})},group:Y3})}function XVe(){this.hot.getShortcutManager().getContext(WA).removeShortcutsByGroup(Y3)}function QVe(){this.hot.getFocusScopeManager().registerScope(gv,ka(Ba,this).getContainer(),{shortcutsContextName:WA,type:"modal",runOnlyIf:()=>this.isVisible(),onActivate:t=>{const e=this.hot.isListening(),n=ka(Ba,this).getFocusableElements();n.length>0?t==="tab_from_above"?n.at(0).focus():t==="tab_from_below"&&n.at(-1).focus():t!=="tab_from_above"&&t!=="tab_from_below"&&e&&!ka(Ba,this).getContainer().contains(this.hot.rootDocument.activeElement)&&ka(Ba,this).getContainer().focus(),e&&this.hot.runHooks("afterDialogFocus",t==="unknown"?"show":t)}})}function ZVe(){this.hot.getFocusScopeManager().unregisterScope(gv)}function JVe(){const{view:t,rootWrapperElement:e,rootWindow:n}=this.hot,r=t.isHorizontallyScrollableByWindow()?t.getTotalTableWidth():t.getWorkspaceWidth();ka(Ba,this).updateWidth(r);const i=e.querySelector(".hot-display-license-info");if(i){const s=i.offsetHeight,a=Number.parseFloat(n.getComputedStyle(i).marginTop);ka(Ba,this).updateHeight(s+a)}}function e3e(t){let{id:e,icon:n,title:r,description:i}=t;return` <div class="${ly}__content"> <i class="${ly}__icon">${n}</i> <div class="${ly}__text"> <h2 id="${e}-${ay}-title" class="${ly}__title">${r}</h2> ${i?`<p id="${e}-${ay}-description" class="${ly}__description">${i}</p>`:""} </div> </div> `}function t3e(t,e){dre(t,e),e.add(t)}function n3e(t,e,n){dre(t,e),e.set(t,n)}function dre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hre(t,e,n){return t.set(G3(t,e),n),n}function Ru(t,e){return t.get(G3(t,e))}function G3(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const ay="loading",r3e=350,ly=`ht-${ay}`;var yl=new WeakMap,fre=new WeakSet;class i3e extends Zr{constructor(){super(...arguments),t3e(this,fre),n3e(this,yl,null)}static get PLUGIN_KEY(){return ay}static get PLUGIN_PRIORITY(){return r3e}static get DEFAULT_SETTINGS(){return{icon:`<svg class="${ly}__icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path stroke="currentColor" stroke-width="2" d="M15 8a7 7 0 1 1-3.5-6.062"></path></svg>`,title:void 0,description:""}}static get SETTINGS_VALIDATORS(){return{icon:e=>typeof e=="string",title:e=>typeof e=="string",description:e=>typeof e=="string"}}isEnabled(){return!!this.hot.getSettings()[ay]}enablePlugin(){if(!this.enabled){if(Ru(yl,this)===null){var e;hre(yl,this,this.hot.getPlugin("dialog")),(e=Ru(yl,this))!==null&&e!==void 0&&e.isEnabled()||(this.hot.getSettings().dialog=!0),this.hot.addHook("afterDialogFocus",()=>G3(fre,this,s3e).call(this))}super.enablePlugin()}}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hide(),super.disablePlugin()}isVisible(){var e,n;return(e=(n=Ru(yl,this))===null||n===void 0?void 0:n.isVisible())!==null&&e!==void 0?e:!1}show(){var e;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.isEnabled()||!Ru(yl,this)||!((e=Ru(yl,this))!==null&&e!==void 0&&e.isEnabled()))return;if(this.isVisible()){this.update(n);return}this.hot.runHooks("beforeLoadingShow")!==!1&&(this.update(n),Ru(yl,this).show(),this.hot.runHooks("afterLoadingShow"))}hide(){var e;!Ru(yl,this)||!((e=Ru(yl,this))!==null&&e!==void 0&&e.isEnabled())||!this.isVisible()||this.hot.runHooks("beforeLoadingHide")===!1||(Ru(yl,this).hide(),this.hot.runHooks("afterLoadingHide"))}update(e){var n,r;if(!this.isEnabled()||!Ru(yl,this)||!((n=Ru(yl,this))!==null&&n!==void 0&&n.isEnabled()))return;this.updatePluginSettings(e);const i=this.hot.guid,s=this.getSetting("icon"),a=(r=this.getSetting("title"))!==null&&r!==void 0?r:this.hot.getTranslatedPhrase(I4),u=this.getSetting("description"),h=e3e({id:i,icon:s,title:a,description:u});Ru(yl,this).update({content:h,customClassName:ly,background:this.hot.countSourceRows()===0?"solid":"semi-transparent",a11y:{role:"alertdialog",ariaLabelledby:`${i}-${ay}-title`,ariaDescribedby:u?`${i}-${ay}-description`:void 0}})}destroy(){hre(yl,this,null),super.destroy()}}function s3e(){Ru(yl,this).focus()}function YA(t,e,n){o3e(t,e),e.set(t,n)}function o3e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Cs(t,e){return t.get(mre(t,e))}function up(t,e,n){return t.set(mre(t,e),n),n}function mre(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const tc="ht-empty-data-state",a3e=150,l3e=`<div data-ref="emptyDataStateElement" class="${tc} handsontable"> <div class="${tc}__content-wrapper"> <div data-ref="emptyDataStateInner" class="${tc}__content-wrapper-inner"></div> </div> </div>`,c3e=t=>{let{title:e,description:n,buttons:r}=t;return` <div class="${tc}__content"> ${e?`<h2 class="${tc}__title">${vm(e)}</h2>`:""} ${n?`<p class="${tc}__description">${vm(n)}</p>`:""} </div> <div data-ref="emptyDataStateButtons" class="${tc}__buttons${(r==null?void 0:r.length)>0?` ${tc}__buttons--has-buttons`:""}" >${(r==null?void 0:r.length)>0?r.map(i=>`<button class="ht-button ht-button--${i.type}">${vm(i.text)}</button>`).join(""):""}</div>`};var K3=new WeakMap,q3=new WeakMap,Ta=new WeakMap,_u=new WeakMap;class u3e{constructor(e){let{rootElement:n,rootDocument:r}=e;YA(this,K3,void 0),YA(this,q3,void 0),YA(this,Ta,void 0),YA(this,_u,void 0),up(K3,this,n),up(q3,this,r),this.install()}install(){var e;if((e=Cs(Ta,this))!==null&&e!==void 0&&e.emptyDataStateElement)return;const n=Bx`${l3e}`;up(Ta,this,n.refs);const{emptyDataStateInner:r,emptyDataStateElement:i}=Cs(Ta,this);gn(r,[Ld(-1)]),gn(i,[Ld(-1)]),Cs(K3,this).after(n.fragment)}getElement(){var e;return(e=Cs(Ta,this))===null||e===void 0?void 0:e.emptyDataStateElement}getFocusableElements(){const{emptyDataStateButtons:e,emptyDataStateInner:n}=Cs(Ta,this),r=Array.from(e==null?void 0:e.children);return r.length===0?[n]:r}show(){var e;(e=Cs(Ta,this))!==null&&e!==void 0&&e.emptyDataStateElement&&(Cs(Ta,this).emptyDataStateElement.style.display="block")}hide(){var e,n;(e=Cs(Ta,this))!==null&&e!==void 0&&e.emptyDataStateElement&&((n=Cs(_u,this))===null||n===void 0||n.remove(),up(_u,this,null),Cs(Ta,this).emptyDataStateElement.style.display="none")}updateContent(e){var n;const{emptyDataStateInner:r}=Cs(Ta,this);let i="";typeof e=="string"?i={title:e}:i={title:e==null?void 0:e.title,description:e==null?void 0:e.description,buttons:e==null?void 0:e.buttons};const s=Bx`${c3e(i)}`;up(Ta,this,{...Cs(Ta,this),...s.refs}),r.innerHTML="",r.appendChild(s.fragment),((n=i.buttons)===null||n===void 0?void 0:n.length)>0&&Array.from(Cs(Ta,this).emptyDataStateButtons.children).forEach((a,u)=>{a.addEventListener("click",i.buttons[u].callback)})}updateClassNames(e){const{emptyDataStateElement:n}=Cs(Ta,this);e.countRenderableColumns()>0&&e.getColumnHeadersCount()>0?st(n,`${tc}--disable-top-border`):cn(n,`${tc}--disable-top-border`),e.countRenderableRows()>0&&e.getRowHeadersCount()>0?st(n,`${tc}--disable-inline-border`):cn(n,`${tc}--disable-inline-border`),e.hasHorizontalScroll()&&!e.isHorizontallyScrollableByWindow()?st(n,`${tc}--disable-bottom-border`):cn(n,`${tc}--disable-bottom-border`)}updateSize(e){const{emptyDataStateElement:n}=Cs(Ta,this),r=e.hasHorizontalScroll()?go(e.hot.rootDocument):0,i=e.countRenderableRows(),s=e.countRenderableColumns(),a=e.getColumnHeadersCount();if(n.style.top=s>0?`${e.getColumnHeaderHeight()}px`:"0px",n.style.insetInlineStart=i>0?`${e.getRowHeaderWidth()}px`:"0px",i===0)Cs(_u,this)||(up(_u,this,Cs(q3,this).createElement("div")),Cs(_u,this).classList.add(`${tc}-placeholder`),e._wt.wtTable.holder.appendChild(Cs(_u,this))),Cs(_u,this).style.width="100%",Cs(_u,this).style.height=`${a3e}px`;else{var u;(u=Cs(_u,this))===null||u===void 0||u.remove(),up(_u,this,null)}let h=e.getWorkspaceWidth(),m=e.getTableHeight();e.isHorizontallyScrollableByWindow()?s>0?h=e.getTotalTableWidth():i>0&&(h=e.getViewportWidth()):i>0?h=e.getViewportWidth():e.getTableWidth()-e.getRowHeaderWidth()<e.getViewportWidth()&&s>0&&(h=e.getTableWidth()),e.isVerticallyScrollableByWindow()||e.hasVerticalScroll()?s>0?m=e.hot.getTableHeight()-e.getColumnHeaderHeight():m=e.hot.getTableHeight():a>0&&s>0?m=e.getViewportHeight()-r:a>0&&s===0&&(m=e.getWorkspaceHeight()-r),n.style.width=`${h}px`,n.style.height=`${m}px`}destroy(){var e,n;(e=Cs(Ta,this))===null||e===void 0||(e=e.emptyDataStateElement)===null||e===void 0||e.remove(),(n=Cs(_u,this))===null||n===void 0||n.remove(),up(_u,this,null),up(Ta,this,null)}}function d3e(t,e){pre(t,e),e.add(t)}function NE(t,e,n){pre(t,e),e.set(t,n)}function pre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $c(t,e,n){return t.set(So(t,e),n),n}function $s(t,e){return t.get(So(t,e))}function So(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const cy="emptyDataState",h3e=370,X3=Object.freeze({UNKNOWN:"unknown",FILTERS:"filters"}),f3e=`plugin:${cy}`;var uy=new WeakMap,oa=new WeakMap,OC=new WeakMap,GA=new WeakMap,IC=new WeakMap,Ho=new WeakSet;class m3e extends Zr{constructor(){super(...arguments),d3e(this,Ho),NE(this,uy,!1),NE(this,oa,null),NE(this,OC,null),NE(this,GA,!1),NE(this,IC,null)}static get PLUGIN_KEY(){return cy}static get PLUGIN_PRIORITY(){return h3e}static get DEFAULT_SETTINGS(){return{message:void 0}}static get SETTINGS_VALIDATORS(){return{message:e=>typeof e=="string"||typeof e=="function"||nn(e)&&(typeof(e==null?void 0:e.title)>"u"||typeof(e==null?void 0:e.title)=="string")&&(typeof(e==null?void 0:e.description)>"u"||typeof(e==null?void 0:e.description)=="string")&&(typeof(e==null?void 0:e.buttons)>"u"||Array.isArray(e==null?void 0:e.buttons)&&(e==null?void 0:e.buttons.every(n=>typeof n=="object"&&typeof n.text=="string"&&typeof n.type=="string"&&["primary","secondary"].includes(n.type)&&typeof n.callback=="function")))||e===void 0}}isEnabled(){return!!this.hot.getSettings()[cy]}enablePlugin(){this.enabled||($s(oa,this)||($c(oa,this,new u3e({rootElement:this.hot.rootGridElement,rootDocument:this.hot.rootDocument})),So(Ho,this,b3e).call(this),So(Ho,this,p3e).call(this),So(Ho,this,g3e).call(this)),this.addHook("afterInit",()=>So(Ho,this,S3e).call(this)),this.addHook("afterRender",()=>So(Ho,this,R3e).call(this)),this.addHook("afterRowSequenceCacheUpdate",()=>So(Ho,this,Q3).call(this)),this.addHook("afterColumnSequenceCacheUpdate",()=>So(Ho,this,Q3).call(this)),this.addHook("beforeFilter",e=>So(Ho,this,_3e).call(this,e)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),So(Ho,this,Z3).call(this),this.isVisible()&&$s(oa,this).show(),super.updatePlugin()}disablePlugin(){So(Ho,this,y3e).call(this),So(Ho,this,v3e).call(this),$s(oa,this).destroy(),$c(oa,this,null),super.disablePlugin()}isVisible(){return $s(uy,this)}destroy(){var e;$c(uy,this,!1),(e=$s(oa,this))===null||e===void 0||e.destroy(),$c(oa,this,null),$c(OC,this,null),$c(GA,this,!1),$c(IC,this,null),super.destroy()}}function p3e(){this.eventManager.addEventListener($s(oa,this).getElement(),"wheel",t=>So(Ho,this,C3e).call(this,t))}function g3e(){$c(OC,this,new MutationObserver(()=>{if(!this.hot)return;const t=$s(oa,this).getElement();this.hot.rootGridElement.nextElementSibling!==t&&this.hot.rootGridElement.after(t)})),$s(OC,this).observe(this.hot.rootWrapperElement,{childList:!0})}function v3e(){$s(OC,this).disconnect(),$c(OC,this,null)}function b3e(){this.hot.getFocusScopeManager().registerScope(cy,$s(oa,this).getElement(),{shortcutsContextName:f3e,runOnlyIf:()=>this.isVisible(),onActivate:t=>{var e;const n=(e=$s(oa,this))===null||e===void 0?void 0:e.getFocusableElements();n.length>0&&(t==="tab_from_above"?n.at(0).focus():t==="tab_from_below"&&n.at(-1).focus())}})}function y3e(){this.hot.getFocusScopeManager().unregisterScope(cy)}function gre(t){var e,n,r;let i;return typeof this.getSetting("message")=="function"?i=this.getSetting("message")(t):i=this.getSetting("message"),typeof i=="string"&&(i={title:i}),!((e=i)!==null&&e!==void 0&&e.title)&&!((n=i)!==null&&n!==void 0&&n.description)&&!((r=i)!==null&&r!==void 0&&r.buttons)&&(i={},t===X3.FILTERS?(i.title=this.hot.getTranslatedPhrase(L4),i.description=this.hot.getTranslatedPhrase($4),i.buttons=[{text:this.hot.getTranslatedPhrase(F4),type:"secondary",callback:()=>{const s=this.hot.getPlugin("filters");s&&(s.clearConditions(),s.filter())}}]):(i.title=this.hot.getTranslatedPhrase(D4),i.description=this.hot.getTranslatedPhrase(H4))),i}function Q3(){this.hot.view&&(this.hot.view.countRenderableColumns()===0||this.hot.view.countRenderableRows()===0?So(Ho,this,x3e).call(this):So(Ho,this,w3e).call(this))}function x3e(){$s(uy,this)||(this.hot.runHooks("beforeEmptyDataStateShow"),So(Ho,this,Z3).call(this),$s(oa,this).show(),$c(uy,this,!0),$c(IC,this,this.hot.selection.exportSelection()),this.hot.getFocusScopeManager().activateScope(cy),this.hot.runHooks("afterEmptyDataStateShow"))}function Z3(){$s(GA,this)?$s(oa,this).updateContent(So(Ho,this,gre).call(this,X3.FILTERS)):$s(oa,this).updateContent(So(Ho,this,gre).call(this,X3.UNKNOWN))}function w3e(){var t;$s(uy,this)&&(this.hot.runHooks("beforeEmptyDataStateHide"),$s(oa,this).hide(),$c(uy,this,!1),this.hot.getFocusScopeManager().deactivateScope(cy),((t=$s(IC,this))===null||t===void 0?void 0:t.ranges.length)>0?(this.hot.selection.importSelection($s(IC,this)),this.hot.view.render(),$c(IC,this,null)):this.hot.selectCell(0,0),this.hot.runHooks("afterEmptyDataStateHide"))}function C3e(t){const e=Number.isNaN(t.deltaX)?-1*t.wheelDeltaX:t.deltaX;e!==0&&this.hot.view.hasHorizontalScroll()&&!this.hot.view.isHorizontallyScrollableByWindow()&&(this.hot.view.setTableScrollPosition({left:this.hot.view.getTableScrollPosition().left+e}),t.preventDefault())}function S3e(){So(Ho,this,Q3).call(this),this.hot.render()}function R3e(){var t;(t=$s(oa,this))!==null&&t!==void 0&&t.getElement()&&this.isVisible()&&($s(oa,this).updateSize(this.hot.view),$s(oa,this).updateClassNames(this.hot.view))}function _3e(t){$c(GA,this,(t==null?void 0:t.length)>0),this.isVisible()&&So(Ho,this,Z3).call(this)}function E3e(){Gr(v_),Gr(wMe),Gr(y_),Gr(ePe),Gr(lPe),Gr(FJ),Gr(uAe),Gr(XAe),Gr(mP),Gr(iIe),Gr(jIe),Gr($Ie),Gr(SP),Gr(xDe),Gr(RHe),Gr(rLe),Gr(jLe),Gr(VLe),Gr(e5e),Gr(d5e),Gr(w5e),Gr($5e),Gr(K5e),Gr(N4e),Gr(s$e),Gr(u$e),Gr(D$e),Gr(CFe),Gr(ZFe),Gr(xze),Gr(Oze),Gr(Bze),Gr(eVe),Gr($Ve),Gr(UA),Gr(i3e),Gr(m3e)}function N3e(){wke(),JTe(),mje(),Wje(),E3e()}N3e();const vre=(t,e,n,r,i,s,a)=>{var x;let u=Yd;if(a.type==="numeric"&&(u=m_),a.type==="dropdown"&&(u=_M),a.type==="checkbox"&&(u=EM),i==="categories"&&Array.isArray(s)&&t.wm_categories){const C=t.wm_categories_map||{};s=s.map(M=>C[M]||M).join(", ")}i==="brands"&&Array.isArray(s)&&(s=s.join(", ")),u(t,e,n,r,i,s,a),jH(i)?(e.style.textAlign="left",e.classList.add("font-system")):e.style.textAlign="right";const h=t.wm_pending_changes||{},m=(x=t.getSourceDataAtRow(n))==null?void 0:x.id;if(m&&h[m]&&h[m][i]!==void 0){e.style.backgroundColor="#FFFBEB",e.style.boxShadow="inset 0 0 0 1px #F59E0B";const C=document.createElement("div");C.className="abs-corner-indicator",C.style.position="absolute",C.style.top="0",C.style.left="0",C.style.borderTop="6px solid #F59E0B",C.style.borderRight="6px solid transparent",e.appendChild(C)}const g=t.getSourceDataAtRow(n);if(((g==null?void 0:g.type)==="variation"||g!=null&&g.parent_id)&&(e.classList.add("bg-slate-50/50","text-slate-500"),i==="name"&&(e.style.paddingRight="32px",e.style.fontStyle="italic",s&&!s.toString().startsWith("/")&&(e.innerHTML=`<span style="color:#94a3b8;margin-right:-20px;font-weight:900;font-style:normal">/</span> ${s}`))),i==="name"&&g&&g.edit_link){const C=document.createElement("div");C.className="flex items-center gap-1 mt-1 justify-end",C.style.pointerEvents="auto",C.innerHTML=` <a href="${g.edit_link}" target="_blank" title="ویرایش در ووکامرس" class="px-1.5 py-0.5 bg-blue-50 hover:bg-blue-100 text-blue-600 rounded transition-colors flex items-center gap-1 no-underline border border-blue-200"> <span style="font-size: 7px; font-weight: 900;">ویرایش در ووکامرس</span> <svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg> </a> <a href="${g.view_link}" target="_blank" title="نمایش محصول" class="px-1.5 py-0.5 bg-emerald-50 hover:bg-emerald-100 text-emerald-600 rounded transition-colors flex items-center gap-1 no-underline border border-emerald-200"> <span style="font-size: 7px; font-weight: 900;">نمایش محصول</span> <svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg> </a> `,e.appendChild(C)}if(i==="stock_status"){const C=s==="instock";e.innerHTML=` <div class="flex items-center justify-center gap-2 h-full"> <div class="w-8 h-4 rounded-full transition-all relative ${C?"bg-emerald-500":"bg-slate-300"}" style="cursor: pointer;"> <div class="absolute top-0.5 w-3 h-3 bg-white rounded-full transition-all ${C?"left-4.5":"left-0.5"}"></div> </div> <span style="font-size: 10px; font-weight: 900; color: ${C?"#10B981":"#64748b"}">${C?"موجود":"ناموجود"}</span> </div> `}const y=g&&(g.manage_stock===!0||g.manage_stock==="yes");i==="stock"&&g&&!y&&(e.style.backgroundColor="#FEF2F2",e.style.color="#FDA4AF",e.title="ابتدا مدیریت انبار را فعال کنید")},k3e=(t,e,n,r,i,s,a)=>{if(vre(t,e,n,r,i,s,a),s!=null&&s!==""){const u=document.createElement("span");u.className="text-[9px] mr-1 opacity-50 font-black",u.innerText="تومان",e.innerHTML=Xo(s).replace(" تومان","")+" ",e.appendChild(u),e.style.fontWeight="900"}},T3e=(t,e,n,r,i,s,a)=>{e.innerHTML="";const u=document.createElement("div");u.className="flex items-center justify-center h-full w-full p-1";const h=document.createElement("div");if(h.className="w-10 h-10 bg-slate-100 rounded-lg flex items-center justify-center overflow-hidden border border-slate-100 shadow-sm",s&&typeof s=="string"&&s.startsWith("http")){const m=document.createElement("img");m.src=s,m.className="w-full h-full object-cover transition-opacity duration-300 opacity-0",m.onload=()=>m.classList.remove("opacity-0"),m.loading="lazy",h.appendChild(m)}else h.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#cbd5e1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-package"><path d="M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/></svg>';u.appendChild(h),e.appendChild(u),e.style.verticalAlign="middle"},j3e=(t,e,n,r,i,s,a)=>{const u=!!s;return e.innerHTML=`<input type="checkbox" style="width:20px;height:20px;cursor:pointer" ${u?"checked":""} />`,e.className="htCenter htMiddle wm-checkbox-cell",e},M3e=({data:t,variations:e={},onSaveBatch:n,settings:r,onPendingChangeCount:i,categories:s=[],selectedIds:a=[],onSelectionChange:u})=>{W.useEffect(()=>{console.log("SpreadsheetGrid v1.6.38 Initialized")},[]);const h=W.useRef(null),[m,g]=W.useState({}),y=W.useRef(null),x=W.useMemo(()=>{let H=[];return t.forEach(V=>{H.push({...V,isSelected:a.includes(V.id)}),V.type==="variable"&&e[V.id]&&H.push(...e[V.id].map(F=>({...F,parent_name:V.name,isSelected:a.includes(F.id)})))}),H},[t,e,a]);W.useEffect(()=>{var V;const H=(V=h.current)==null?void 0:V.hotInstance;if(H)try{H.wm_pending_changes=m,H.wm_categories=s,H.wm_categories_map=s.reduce((F,B)=>(F[B.slug]=B.name,F),{}),H.render()}catch(F){console.error("WooCommersa Grid Render Error:",F)}i==null||i(Object.keys(m).length)},[m,s]),W.useEffect(()=>{if(Object.keys(m).length>0){if((r==null?void 0:r.save_mode)==="manual")return;y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{const F=Object.entries(m).map(([B,te])=>({id:parseInt(B),changes:te}));n(F).then(()=>{g({}),ze.success("تغییرات با موفقیت همگامسازی شد")}).catch(B=>{console.error("Save Batch Error:",B),ze.error("خطا در ذخیرهسازی خودکار")})},1e3)}return()=>{y.current&&clearTimeout(y.current)}},[m,n,r==null?void 0:r.save_mode]),W.useEffect(()=>((r==null?void 0:r.save_mode)==="manual"&&(window.triggerSpreadsheetSave=async()=>{try{const H=Object.entries(m).map(([V,F])=>({id:parseInt(V),changes:F}));if(H.length===0)return;await n(H),g({}),ze.success("تمامی تغییرات دستی ذخیره شدند")}catch{ze.error("خطا در ذخیرهسازی دستی")}}),()=>{try{delete window.triggerSpreadsheetSave}catch{}}),[m,n,r]);const C=W.useCallback((H,V)=>{!H||V==="loadData"||H.forEach(F=>{var _e;const[B,te,ve,ce]=F;if(te==="stock"&&ce!==ve&&ce!==null&&ce!==""){const pe=(_e=h.current)==null?void 0:_e.hotInstance;if(pe){const Le=pe.getSourceDataAtRow(B);if(!(Le&&(Le.manage_stock===!0||Le.manage_stock==="yes"))){alert(`⚠️ خطای مدیریت انبار مدیریت انبار برای این محصول فعال نیست. برای ثبت موجودی، ابتدا باید گزینه "مدیریت انبار" را برای این محصول فعال کنید.`),F[3]=ve;return}}}if(jH(te)&&ce!==null&&ce!==void 0){const pe=X7(ce.toString());isNaN(Number(pe))&&pe!==""?(ze.error("لطفاً فقط عدد وارد کنید"),F[3]=ve):F[3]=pe}})},[]),E=W.useCallback((H,V)=>{if(!H||V==="loadData")return;let F=!1;const B=[...a];g(te=>{const ve={...te};return H.forEach(([ce,_e,pe,Le])=>{if(pe===Le)return;const Fe=x[ce];if(!Fe)return;const nt=Fe.id;if(_e==="isSelected"){if(F=!0,Le)B.includes(nt)||B.push(nt);else{const dt=B.indexOf(nt);dt>-1&&B.splice(dt,1)}return}if(ve[nt]||(ve[nt]={}),_e==="categories"&&s.length>0){const dt=s.find($e=>$e.name===Le);ve[nt][_e]=dt?[dt.slug]:[Le]}else ve[nt][_e]=Le}),ve}),F&&u&&u(B)},[x,s,a,u]),M=W.useMemo(()=>MH(),[]),j=W.useMemo(()=>{const H=(r==null?void 0:r.visible_columns)||["id","name","sku","regular_price","sale_price","stock","stock_status"],V=[{data:"isSelected",renderer:j3e,width:44,label:" "}];return M.filter(F=>H.includes(F.key)||F.key==="id").forEach(F=>{const B={data:F.key,readOnly:!F.editable,width:F.width||120,renderer:vre};F.type==="price"?(B.type="numeric",B.renderer=k3e):F.type==="image"?(B.renderer=T3e,B.readOnly=!0):F.type==="number"?B.type="numeric":F.type==="boolean"?B.type="checkbox":F.type==="select"&&(B.type="dropdown",F.key==="categories"&&s.length>0?B.source=s.map(te=>te.name):F.options&&(B.source=F.options.map(te=>te.label||te.value))),B.header=F.label;try{const te=localStorage.getItem("wm_excel_col_widths");if(te){const ve=JSON.parse(te);ve&&ve[F.key]&&(B.width=ve[F.key])}}catch{}V.push(B)}),V},[M,r==null?void 0:r.visible_columns,s]),L=x.length>0&&a.length>=x.length,D=j.map((H,V)=>V===0?`<div class="flex items-center justify-center h-full w-full"><input type="checkbox" class="wm-select-all-header" ${L?"checked":""} /></div>`:H.header),z=j.map(({header:H,...V})=>V);return W.useEffect(()=>{var F;const H=(F=h.current)==null?void 0:F.hotInstance;if(!H||!H.rootElement)return;const V=B=>{const te=B.target;te&&te.classList.contains("wm-select-all-header")&&(B.preventDefault(),B.stopPropagation(),u&&u(!L?x.map(ce=>ce.id):[]))};return H.rootElement.addEventListener("click",V),()=>{H&&H.rootElement&&H.rootElement.removeEventListener("click",V)}},[x,u,L]),o.jsxs("div",{className:"w-full h-full overflow-hidden bg-white relative",style:{direction:"ltr"},children:[o.jsx("div",{dir:"rtl",className:"spreadsheet-container",children:o.jsx(PX,{ref:h,data:x,colHeaders:D,columns:z,rowHeaders:!0,width:"100%",height:"calc(100vh - 380px)",stretchH:"all",fixedColumnsStart:2,layoutDirection:"rtl",licenseKey:"non-commercial-and-evaluation",beforeChange:C,afterChange:E,beforeOnCellMouseDown:(H,V)=>{var B,te;if(V.col===0&&V.row>=0){H.stopImmediatePropagation();const ve=(B=h.current)==null?void 0:B.hotInstance;if(ve)try{const ce=ve.getDataAtRowProp(V.row,"isSelected");ve.setDataAtRowProp(V.row,"isSelected",!ce)}catch{}return}const F=(te=h.current)==null?void 0:te.hotInstance;if(F&&V.row>=0&&F.colToProp(V.col)==="stock"){const ce=F.getSourceDataAtRow(V.row);ce&&(ce.manage_stock===!0||ce.manage_stock==="yes")||(H.stopImmediatePropagation(),alert(`⚠️ خطای مدیریت انبار مدیریت انبار برای این محصول فعال نیست. برای ثبت موجودی، ابتدا باید گزینه "مدیریت انبار" را برای این محصول فعال کنید.`))}},cells:function(H,V,F){const B={},te=this.instance;if(te&&F==="stock"){const ve=te.getSourceDataAtRow(H);ve&&(ve.manage_stock===!0||ve.manage_stock==="yes")||(B.readOnly=!0)}return B},afterOnCellMouseDown:(H,V)=>{var te;const F=(te=h.current)==null?void 0:te.hotInstance;if(!F||V.row<0)return;const B=F.colToProp(V.col);if(B==="stock_status"){const ce=F.getDataAtRowProp(V.row,B)==="instock"?"outofstock":"instock";F.setDataAtRowProp(V.row,B,ce)}},afterColumnResize:(H,V)=>{var F;try{const B=(F=j[H])==null?void 0:F.data;if(B){const te=localStorage.getItem("wm_excel_col_widths"),ve=te?JSON.parse(te):{};ve[B]=V,localStorage.setItem("wm_excel_col_widths",JSON.stringify(ve))}}catch{}},viewportColumnRenderingOffset:15,viewportRowRenderingOffset:20,className:"ht-theme-main ht-rtl wm-excel-theme",manualColumnResize:!0,manualRowResize:!0,manualColumnMove:!0,filters:!0,dropdownMenu:!0,contextMenu:["row_above","row_below","remove_row","---------","copy","cut","undo","redo"],autoWrapRow:!0,autoWrapCol:!0,undo:!0,fillHandle:!0,copyPaste:!0,outsideClickDeselects:!1,selectionMode:"multiple"})}),o.jsx("div",{className:"absolute bottom-4 right-4 flex items-center gap-3 z-50 pointer-events-none",children:Object.keys(m).length>0&&o.jsxs("div",{className:"bg-slate-900/90 backdrop-blur-xl text-white px-5 py-2.5 rounded-2xl text-[11px] font-black shadow-2xl border border-white/10 flex items-center gap-3 animate-in fade-in slide-in-from-bottom-4 pointer-events-auto",children:[o.jsx("div",{className:"w-2 h-2 bg-amber-500 rounded-full animate-pulse"}),Object.keys(m).length," تغییر در انتظار ",(r==null?void 0:r.save_mode)==="manual"?"ذخیره دستی":"ذخیره خودکار..."]})})]})},P3e=({isOpen:t,onClose:e,title:n,content:r})=>o.jsx(tr,{children:t&&o.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4 bg-slate-900/40 backdrop-blur-sm",children:o.jsxs(ht.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"bg-white rounded-[2.5rem] shadow-2xl w-full max-w-2xl overflow-hidden border border-slate-100",children:[o.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-slate-50 bg-slate-50/50",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-10 h-10 bg-primary-100 rounded-xl flex items-center justify-center text-primary-600",children:o.jsx(Cx,{size:24})}),o.jsxs("h3",{className:"text-xl font-black text-slate-800",children:["راهنمای ",n]})]}),o.jsx("button",{onClick:e,className:"w-10 h-10 flex items-center justify-center rounded-xl bg-white border border-slate-200 text-slate-400 hover:text-rose-500 hover:border-rose-100 transition-all",children:o.jsx(qi,{size:20})})]}),o.jsxs("div",{className:"p-8 max-h-[70vh] overflow-auto leading-relaxed text-slate-600 font-medium",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-6 text-primary-600 font-black",children:[o.jsx(PU,{size:20}),o.jsx("span",{children:"نحوه استفاده و مثالها"})]}),o.jsx("div",{className:"space-y-4 text-sm",dir:"rtl",children:r})]}),o.jsx("div",{className:"p-6 bg-slate-50 border-t border-slate-100 flex justify-end",children:o.jsx("button",{onClick:e,className:"px-8 py-3 bg-white border border-slate-200 rounded-2xl font-black text-slate-700 hover:bg-slate-100 transition-all",children:"متوجه شدم"})})]})})}),A3e=()=>{const[t,e]=W.useState([]),[n,r]=W.useState(!1),i=async()=>{try{const h=await(await fetch(`${window.woocommersa_data.apiUrl}/jobs/active`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();Array.isArray(h)&&e(h)}catch(u){console.error("Error fetching jobs",u)}},s=async u=>{if(confirm("آیا از لغو این عملیات اطمینان دارید؟"))try{await fetch(`${window.woocommersa_data.apiUrl}/jobs/cancel`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({id:u})}),ze.success("عملیات با موفقیت لغو شد."),i()}catch{ze.error("خطا در لغو عملیات")}};W.useEffect(()=>{i();const u=setInterval(()=>{i()},3e3);return()=>clearInterval(u)},[]);const a=t.filter(u=>u.status==="processing"||u.status==="pending"||u.status==="retrying").length;return t.length===0?null:o.jsxs("div",{className:"fixed bottom-6 right-6 z-[2000]",dir:"rtl",children:[o.jsx(tr,{children:!n&&a>0&&o.jsxs(ht.button,{initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},onClick:()=>r(!0),className:"w-16 h-16 bg-slate-900 text-white rounded-2xl flex items-center justify-center shadow-2xl relative group ring-4 ring-primary-500/20",children:[o.jsx(qs,{className:"animate-pulse",size:28}),o.jsx("span",{className:"absolute -top-2 -right-2 w-7 h-7 bg-primary-500 rounded-full flex items-center justify-center text-[11px] font-black border-2 border-white shadow-lg",children:a})]})}),o.jsx(tr,{children:n&&o.jsxs(ht.div,{initial:{y:50,opacity:0,scale:.9},animate:{y:0,opacity:1,scale:1},exit:{y:50,opacity:0,scale:.9},className:"w-96 bg-white/95 backdrop-blur-2xl rounded-[2.5rem] shadow-[0_32px_96px_-16px_rgba(0,0,0,0.2)] border border-slate-200 overflow-hidden",children:[o.jsxs("div",{className:"p-6 bg-slate-900 text-white flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-8 h-8 bg-primary-500/20 text-primary-400 rounded-xl flex items-center justify-center",children:o.jsx(qs,{size:18})}),o.jsx("h4",{className:"font-black text-sm",children:"مانیتورینگ هوشمند عملیات"})]}),o.jsx("button",{onClick:()=>r(!1),className:"w-8 h-8 bg-white/10 text-white/40 hover:text-white rounded-lg flex items-center justify-center transition-all",children:o.jsx(qi,{size:18})})]}),o.jsx("div",{className:"max-h-[450px] overflow-y-auto p-5 space-y-4 no-scrollbar",children:t.map(u=>o.jsxs("div",{className:"p-5 bg-slate-50 rounded-[1.75rem] border border-slate-100 space-y-4 relative group",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.jsxs("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:["ID: ",u.id]}),o.jsx("span",{className:"text-xs font-black text-slate-700",children:u.type==="seo_template"?"هدفگیری انبوه سئو":u.type==="bulk_update"?"ویرایش گروهی محصولات":u.type==="seo_ai"?"تولید محتوای هوشمند":"پردازش گروهبندی شده"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[(u.status==="processing"||u.status==="pending"||u.status==="retrying")&&o.jsx("button",{onClick:()=>s(u.id),className:"w-7 h-7 bg-white text-rose-500 rounded-lg flex items-center justify-center shadow-sm border border-rose-50 hover:bg-rose-500 hover:text-white transition-all",title:"لغو عملیات",children:o.jsx(zu,{size:12})}),o.jsxs("div",{className:`px-3 py-1.5 rounded-xl text-[9px] font-black flex items-center gap-2 ${u.status==="completed"?"bg-emerald-100 text-emerald-600":u.status==="failed"?"bg-rose-100 text-rose-600":u.status==="processing"?"bg-primary-100 text-primary-600 animate-pulse":u.status==="cancelled"?"bg-slate-200 text-slate-500":"bg-amber-100 text-amber-600"}`,children:[u.status==="completed"&&o.jsx(ho,{size:12}),u.status==="failed"&&o.jsx(Ph,{size:12}),u.status==="processing"&&o.jsx(ur,{size:12,className:"animate-spin"}),u.status==="cancelled"&&o.jsx(qi,{size:12}),u.status==="completed"?"تکمیل شد":u.status==="failed"?"خطا در اجرا":u.status==="processing"?"در حال اجرا":u.status==="cancelled"?"لغو شده":"در صف انتظار"]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex justify-between text-[11px] font-black text-slate-600",children:[o.jsxs("span",{className:"flex items-center gap-1.5",children:[u.processed," از ",u.total," محصول",u.error_count>0&&o.jsxs("span",{className:"text-rose-500",children:["(",u.error_count," خطا)"]})]}),o.jsxs("span",{children:[Math.round(u.processed/u.total*100),"%"]})]}),o.jsx("div",{className:"h-2.5 bg-slate-200 rounded-full overflow-hidden p-0.5",children:o.jsx(ht.div,{className:`h-full rounded-full ${u.status==="failed"?"bg-rose-500":u.status==="cancelled"?"bg-slate-400":"bg-primary-500 shadow-[0_0_10px_rgba(37,99,235,0.5)]"}`,initial:{width:0},animate:{width:`${u.processed/u.total*100}%`}})})]}),(u.last_error||u.status==="completed"&&u.error_count>0)&&o.jsx("div",{className:"p-3 bg-white/50 rounded-xl text-[9px] font-bold text-slate-500 leading-relaxed",children:u.status==="failed"?`جزئیات خطا: ${u.last_error}`:`گزارش: تعداد ${u.processed} محصول با موفقیت و ${u.error_count} محصول با خطا پردازش شدند.`}),o.jsxs("div",{className:"flex justify-between items-center text-[9px] text-slate-400 font-medium pt-1 border-t border-slate-200/50",children:[o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(Qp,{size:10}),"شروع: ",new Date(u.created_at).toLocaleTimeString("fa-IR")]}),u.retries>0&&o.jsxs("span",{className:"text-amber-500 font-black",children:["تلاش مجدد: ",u.retries]})]})]},u.id))}),o.jsxs("div",{className:"p-5 bg-slate-50 border-t border-slate-200 flex items-center justify-between",children:[o.jsxs("button",{onClick:i,className:"px-5 py-2.5 bg-white border border-slate-200 text-[10px] font-black text-slate-600 rounded-xl hover:bg-slate-900 hover:text-white hover:border-slate-900 transition-all flex items-center gap-2",children:[o.jsx(ur,{size:14})," بروزرسانی لیست"]}),o.jsx("span",{className:"text-[10px] font-black text-slate-400",children:"سیستم مدیریت وظایف سئو"})]})]})})]})},O3e=({onNavigate:t})=>{const[e,n]=W.useState([]),[r,i]=W.useState({total_abandoned:0,total_recovered:0,top_abandoned_product:null}),[s,a]=W.useState(!0),[u,h]=W.useState(1),[m,g]=W.useState(null),[y,x]=W.useState(null),C=async()=>{a(!0);try{const j=new URLSearchParams({page:String(u)});m&&Array.isArray(m)&&m.length===2&&m[0]&&m[1]&&(j.append("date_from",m[0].toDate().toLocaleDateString("en-CA")),j.append("date_to",m[1].toDate().toLocaleDateString("en-CA")));const[L,D]=await Promise.all([fetch(`${window.woocommersa_data.apiUrl}/abandoned-carts?${j.toString()}`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}}),fetch(`${window.woocommersa_data.apiUrl}/abandoned-carts/stats`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})]),z=await L.json(),H=await D.json();z.success&&n(z.data),H.success&&i(H.data)}catch{ze.error("خطا در دریافت اطلاعات")}finally{a(!1)}},E=()=>{if(e.length===0)return ze.error("دادهای برای خروجی وجود ندارد");const j=["مشتری","ایمیل","کالاها","وضعیت یادآوری","تاریخ ثبت","وضعیت نهایی"],L=e.map(V=>[V.phone,V.email||"-",Object.values(V.cart_data||{}).map(F=>`${F.product_name} (${F.quantity})`).join(" | "),V.reminders_sent.join(", ")||"ارسال نشده",V.created_at,V.status==="recovered"?"بازیابی شده":"رها شده"]),D="\uFEFF"+[j,...L].map(V=>V.join(",")).join(` `),z=new Blob([D],{type:"text/csv;charset=utf-8;"}),H=document.createElement("a");H.href=URL.createObjectURL(z),H.setAttribute("download",`abandoned_carts_${new Date().toISOString().split("T")[0]}.csv`),document.body.appendChild(H),H.click(),document.body.removeChild(H),ze.success("فایل خروجی با موفقیت آماده شد")};W.useEffect(()=>{C()},[u,m]);const M=j=>({"6h":"۶ ساعت","12h":"۱۲ ساعت","1d":"۱ روز","2d":"۲ روز","4d":"۴ روز","7d":"۷ روز"})[j]||j;return o.jsxs("div",{className:"space-y-8",children:[o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[o.jsxs(ht.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"bg-white p-6 rounded-[2rem] border border-slate-100 shadow-xl shadow-slate-200/40 relative overflow-hidden group",children:[o.jsx("div",{className:"absolute -right-4 -top-4 w-24 h-24 bg-rose-50 rounded-full blur-2xl group-hover:bg-rose-100 transition-colors"}),o.jsxs("div",{className:"flex items-center gap-4 relative",children:[o.jsx("div",{className:"p-4 bg-rose-50 rounded-2xl text-rose-600",children:o.jsx(Da,{size:24})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-black text-slate-400 mb-1 uppercase tracking-widest",children:"سبدهای رها شده"}),o.jsx("div",{className:"text-3xl font-black text-slate-800",children:r.total_abandoned})]})]})]}),o.jsxs(ht.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"bg-white p-6 rounded-[2rem] border border-slate-100 shadow-xl shadow-slate-200/40 relative overflow-hidden group",children:[o.jsx("div",{className:"absolute -right-4 -top-4 w-24 h-24 bg-emerald-50 rounded-full blur-2xl group-hover:bg-emerald-100 transition-colors"}),o.jsxs("div",{className:"flex items-center gap-4 relative",children:[o.jsx("div",{className:"p-4 bg-emerald-50 rounded-2xl text-emerald-600",children:o.jsx(ho,{size:24})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-black text-slate-400 mb-1 uppercase tracking-widest",children:"بازیابی شده"}),o.jsx("div",{className:"text-3xl font-black text-slate-800",children:r.total_recovered})]})]})]}),o.jsxs(ht.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.15},className:"bg-white p-6 rounded-[2rem] border border-slate-100 shadow-xl shadow-slate-200/40 relative overflow-hidden group",children:[o.jsx("div",{className:"absolute -right-4 -top-4 w-24 h-24 bg-primary-50 rounded-full blur-2xl group-hover:bg-primary-100 transition-colors"}),o.jsxs("div",{className:"flex items-center gap-4 relative",children:[o.jsx("div",{className:"p-4 bg-primary-50 rounded-2xl text-primary-600",children:o.jsx(Od,{size:24})}),o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"text-xs font-black text-slate-400 mb-1 uppercase tracking-widest flex items-center justify-between",children:["بیشترین رها شده",r.top_abandoned_product&&o.jsxs("span",{className:"bg-rose-100 text-rose-600 px-1.5 py-0.5 rounded text-[8px]",children:[r.top_abandoned_product.count," بار"]})]}),o.jsx("div",{className:"text-sm font-black text-slate-800 truncate max-w-[120px]",children:r.top_abandoned_product?r.top_abandoned_product.name:"در حال محاسبه..."})]})]})]}),o.jsxs(ht.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:"bg-white p-6 rounded-[2rem] border border-slate-100 shadow-xl shadow-slate-200/40 relative overflow-hidden group",children:[o.jsx("div",{className:"absolute -right-4 -top-4 w-24 h-24 bg-amber-50 rounded-full blur-2xl group-hover:bg-amber-100 transition-colors"}),o.jsxs("div",{className:"flex items-center gap-4 relative",children:[o.jsx("div",{className:"p-4 bg-amber-50 rounded-2xl text-amber-600",children:o.jsx(eu,{size:24})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-xs font-black text-slate-400 mb-1 uppercase tracking-widest",children:"نرخ بازگشت"}),o.jsxs("div",{className:"text-3xl font-black text-slate-800",children:[r.total_abandoned>0?Math.round(r.total_recovered/(r.total_abandoned+r.total_recovered)*100):0,"٪"]})]})]})]})]}),o.jsxs("div",{className:"bg-white rounded-[2.5rem] border border-slate-200 shadow-2xl overflow-hidden",children:[o.jsxs("div",{className:"p-8 border-b border-slate-100 flex items-center justify-between bg-slate-50/50",children:[o.jsxs("div",{className:"flex items-center gap-6",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-12 h-12 bg-white rounded-2xl flex items-center justify-center border border-slate-200 shadow-sm",children:o.jsx(Qp,{className:"text-primary-600",size:24})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-xl font-black text-slate-800",children:"لیست سبدهای خرید"}),o.jsx("p",{className:"text-xs text-slate-400 font-bold mt-1",children:"مشاهده وضعیت یادآوریها و بازیابیها"})]})]}),o.jsx("div",{className:"h-12 w-px bg-slate-200 mx-2 hidden md:block"}),o.jsxs("div",{className:"relative group",children:[o.jsx(Dh,{value:m,onChange:g,range:!0,calendar:Hh,locale:Lh,calendarPosition:"bottom-right",inputClass:"h-12 pr-12 pl-4 bg-white border border-slate-200 rounded-xl text-xs font-black text-slate-600 focus:border-primary-500 transition-all outline-none min-w-[220px]",placeholder:"فیلتر براساس تاریخ..."}),o.jsx(Ll,{className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 group-hover:text-primary-500 transition-colors",size:16}),m&&o.jsx("button",{onClick:()=>g(null),className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-300 hover:text-rose-500 transition-colors",children:o.jsx(qi,{size:14})})]})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("button",{onClick:E,className:"px-5 py-3 bg-white border border-slate-200 rounded-2xl hover:bg-emerald-50 hover:border-emerald-200 hover:text-emerald-600 transition-all active:scale-95 shadow-sm flex items-center gap-2 text-xs font-black",children:[o.jsx(om,{size:18}),"خروجی اکسل"]}),o.jsx("button",{onClick:C,className:"p-3 bg-white border border-slate-200 rounded-2xl hover:bg-slate-50 transition-all active:scale-95 shadow-sm",children:o.jsx(ur,{size:20,className:s?"animate-spin":""})})]})]}),o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-right border-collapse",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"bg-slate-50/30",children:[o.jsx("th",{className:"px-8 py-5 text-xs font-black text-slate-400 uppercase tracking-widest border-b border-slate-100",children:"مشتری"}),o.jsx("th",{className:"px-8 py-5 text-xs font-black text-slate-400 uppercase tracking-widest border-b border-slate-100",children:"محتویات سبد"}),o.jsx("th",{className:"px-8 py-5 text-xs font-black text-slate-400 uppercase tracking-widest border-b border-slate-100",children:"وضعیت یادآوری"}),o.jsx("th",{className:"px-8 py-5 text-xs font-black text-slate-400 uppercase tracking-widest border-b border-slate-100",children:"تاریخ ثبت"}),o.jsx("th",{className:"px-8 py-5 text-xs font-black text-slate-400 uppercase tracking-widest border-b border-slate-100",children:"آخرین بروزرسانی"}),o.jsx("th",{className:"px-8 py-5 text-xs font-black text-slate-400 uppercase tracking-widest border-b border-slate-100",children:"وضعیت نهایی"})]})}),o.jsxs("tbody",{children:[e.map(j=>o.jsxs("tr",{className:"group hover:bg-slate-50/80 transition-colors",children:[o.jsx("td",{className:"px-8 py-6 border-b border-slate-100",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-10 h-10 bg-slate-100 rounded-xl flex items-center justify-center text-slate-500 group-hover:bg-white transition-colors border border-transparent group-hover:border-slate-200",children:o.jsx(p0,{size:18})}),o.jsxs("div",{children:[o.jsxs("div",{className:"text-sm font-black text-slate-800 flex items-center gap-2",children:[o.jsx(ZD,{size:12,className:"text-slate-400"}),j.phone]}),o.jsx("div",{className:"text-[10px] text-slate-400 font-bold mt-0.5",children:j.email||"بدون ایمیل"})]})]})}),o.jsx("td",{className:"px-8 py-6 border-b border-slate-100",children:o.jsxs("div",{className:"flex flex-col gap-1 max-w-[250px]",children:[Object.values(j.cart_data||{}).slice(0,3).map((L,D)=>o.jsxs("div",{className:"flex items-center gap-2 group/item",children:[o.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-slate-300 group-hover/item:bg-primary-500 transition-colors"}),o.jsxs("span",{className:"text-[10px] font-bold text-slate-600 truncate",children:[L.product_name," ",o.jsxs("span",{className:"text-slate-400 font-black",children:["(",L.quantity,"×)"]})]})]},D)),Object.values(j.cart_data||{}).length>3&&o.jsxs("button",{onClick:()=>x(j),className:"text-[9px] font-black text-primary-500 mt-1 mr-3 flex items-center gap-1 hover:text-primary-600 transition-colors group/link",children:[o.jsx($u,{size:10,className:"group-hover/link:translate-x-0.5 transition-transform"}),"+",Object.keys(j.cart_data||{}).length-3," مورد دیگر (مشاهده همه)"]})]})}),o.jsx("td",{className:"px-8 py-6 border-b border-slate-100",children:o.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:j.reminders_sent.length>0?j.reminders_sent.map(L=>o.jsxs("span",{className:"px-2 py-1 bg-amber-50 text-amber-600 rounded-lg text-[10px] font-black border border-amber-100 flex items-center gap-1",children:[o.jsx(Qp,{size:10}),M(L)]},L)):o.jsx("span",{className:"text-[10px] text-slate-400 font-bold italic",children:"در نوبت ارسال..."})})}),o.jsx("td",{className:"px-8 py-6 border-b border-slate-100",children:o.jsxs("div",{className:"text-[11px] font-bold text-slate-600 flex items-center gap-1.5",children:[o.jsx(Ll,{size:12,className:"text-slate-400"}),new Date(j.created_at).toLocaleDateString("fa-IR")]})}),o.jsx("td",{className:"px-8 py-6 border-b border-slate-100",children:o.jsx("div",{className:"text-[11px] font-bold text-slate-600",children:new Date(j.updated_at).toLocaleTimeString("fa-IR",{hour:"2-digit",minute:"2-digit"})})}),o.jsx("td",{className:"px-8 py-6 border-b border-slate-100",children:j.status==="recovered"?o.jsxs("div",{className:"inline-flex items-center gap-1.5 px-3 py-1 bg-emerald-50 text-emerald-600 rounded-full text-[10px] font-black border border-emerald-100",children:[o.jsx(ho,{size:12}),"بازیابی موفق"]}):o.jsxs("div",{className:"inline-flex items-center gap-1.5 px-3 py-1 bg-amber-50 text-amber-600 rounded-full text-[10px] font-black border border-amber-100",children:[o.jsx(Qp,{size:12}),"رها شده"]})})]},j.id)),e.length===0&&!s&&o.jsx("tr",{children:o.jsx("td",{colSpan:6,className:"py-20 text-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-4",children:[o.jsx("div",{className:"p-4 bg-slate-50 rounded-full text-slate-300",children:o.jsx(Da,{size:48})}),o.jsx("p",{className:"text-slate-400 font-bold",children:"هنوز هیچ سبد خرید رها شدهای ثبت نشده است."})]})})})]})]})}),o.jsxs("div",{className:"p-6 bg-slate-50/50 border-t border-slate-100 flex items-center justify-between",children:[o.jsx("button",{disabled:u===1,onClick:()=>h(j=>j-1),className:"px-6 py-2 bg-white border border-slate-200 rounded-xl font-bold text-slate-600 hover:bg-slate-50 transition-all active:scale-95 disabled:opacity-50 disabled:pointer-events-none",children:"قبلی"}),o.jsx("span",{className:"font-black text-primary-600 px-4 bg-primary-50 py-2 rounded-xl border border-primary-100",children:u}),o.jsx("button",{onClick:()=>h(j=>j+1),className:"px-6 py-2 bg-white border border-slate-200 rounded-xl font-bold text-slate-600 hover:bg-slate-50 transition-all active:scale-95",children:"بعدی"})]})]}),o.jsxs("div",{className:"p-6 bg-primary-600 rounded-[2rem] text-white flex flex-col md:flex-row items-center justify-between gap-6 relative overflow-hidden shadow-2xl shadow-primary-500/30",children:[o.jsx("div",{className:"absolute right-0 top-0 w-64 h-64 bg-white/10 rounded-full blur-3xl translate-x-1/2 -translate-y-1/2"}),o.jsxs("div",{className:"flex items-center gap-5 relative",children:[o.jsx("div",{className:"p-4 bg-white/10 rounded-2xl backdrop-blur-md",children:o.jsx(VU,{size:28})}),o.jsxs("div",{children:[o.jsx("h4",{className:"text-lg font-black",children:"یکپارچگی با بخش سفارشات"}),o.jsx("p",{className:"text-sm font-medium text-white/80 mt-1 max-w-md",children:"شما میتوانید آمارهای بازیابی شده را مستقیماً در بالای لیست سفارشات خود نیز مشاهده کنید تا تاثیر واقعی این سیستم را در فروش روزانه حس کنید."})]})]}),o.jsx("button",{onClick:()=>t==null?void 0:t("orders"),className:"px-8 py-4 bg-white text-primary-600 rounded-2xl font-black transition-all hover:bg-primary-50 active:scale-95 shadow-xl relative group",children:"مشاهده آمار در سفارشات"})]}),o.jsx(tr,{children:y&&o.jsx("div",{className:"fixed inset-0 z-[5000] flex items-center justify-center p-6 bg-slate-900/60 backdrop-blur-md",children:o.jsxs(ht.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"w-full max-w-2xl bg-white rounded-[2.5rem] shadow-2xl overflow-hidden",children:[o.jsxs("div",{className:"p-8 border-b border-slate-100 flex items-center justify-between bg-slate-50/50",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-12 h-12 bg-white rounded-2xl flex items-center justify-center border border-slate-200 shadow-sm text-primary-600",children:o.jsx(Da,{size:24})}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-xl font-black text-slate-800",children:"جزییات کامل سبد خرید"}),o.jsxs("p",{className:"text-xs text-slate-400 font-bold mt-1",children:["شماره مشتری: ",y.phone]})]})]}),o.jsx("button",{onClick:()=>x(null),className:"w-10 h-10 bg-white border border-slate-200 rounded-xl flex items-center justify-center text-slate-400 hover:text-rose-500 transition-all active:scale-90 shadow-sm",children:o.jsx(qi,{size:20})})]}),o.jsx("div",{className:"p-8 max-h-[60vh] overflow-y-auto",children:o.jsx("div",{className:"space-y-4",children:Object.values(y.cart_data||{}).map((j,L)=>o.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-2xl border border-slate-100 hover:border-primary-200 transition-all group",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-12 h-12 bg-white rounded-xl border border-slate-200 flex items-center justify-center text-slate-300 font-black text-xs group-hover:border-primary-100 transition-colors",children:L+1}),o.jsxs("div",{children:[o.jsx("div",{className:"text-sm font-black text-slate-700",children:j.product_name}),o.jsxs("div",{className:"text-[10px] text-slate-400 font-bold mt-0.5",children:["تعداد: ",j.quantity," عدد"]})]})]}),o.jsxs("div",{className:"text-sm font-black text-primary-600 bg-primary-50 px-4 py-2 rounded-xl border border-primary-100/50",children:[(j.line_total||0).toLocaleString()," ",o.jsx("span",{className:"text-[10px] opacity-70",children:"تومان"})]})]},L))})}),o.jsxs("div",{className:"p-8 border-t border-slate-100 bg-slate-50/50 flex items-center justify-between",children:[o.jsxs("div",{className:"text-slate-400 font-bold text-sm",children:["مجموع اقلام: ",Object.keys(y.cart_data||{}).length," کالا"]}),o.jsx("button",{onClick:()=>x(null),className:"px-8 py-4 bg-slate-800 text-white rounded-2xl font-black active:scale-95 transition-all shadow-lg shadow-slate-200",children:"بستن پنجره"})]})]})})})]})},I3e=()=>{var se,ie;const[t,e]=W.useState(""),[n,r]=W.useState([]),[i,s]=W.useState(!1),[a,u]=W.useState([]),[h,m]=W.useState(null),[g,y]=W.useState(null),[x,C]=W.useState(!1),[E,M]=W.useState(!1),[j,L]=W.useState(!1),[D,z]=W.useState(null),[H,V]=W.useState(!1),[F,B]=W.useState(""),[te,ve]=W.useState([]),[ce,_e]=W.useState(!1),[pe,Le]=W.useState(!1),[Fe,nt]=W.useState([]),[dt,$e]=W.useState(!1),[Re,Ze]=W.useState(null),[Ee,Q]=W.useState(!1),[fe,Ve]=W.useState(0),[ne,xe]=W.useState("fixed"),[Ke,qe]=W.useState("cash"),we=[{id:"cash",label:"نقدی",icon:o.jsx(Zp,{size:16})},{id:"terminal",label:"کارتخوان",icon:o.jsx(Hr,{size:16})},{id:"card_to_card",label:"کارت به کارت",icon:o.jsx(Ok,{size:16})}],[k,_]=W.useState([]),[N,O]=W.useState(!1),[G,q]=W.useState({first_name:"",last_name:"",phone:"",email:"",city:"",state:"",address:""}),I=W.useRef(null);W.useEffect(()=>{I.current&&I.current.focus(),Z()},[]);const Z=async()=>{var J,me;O(!0);try{const Se=(J=window.woocommersa_data)==null?void 0:J.apiUrl,je=(me=window.woocommersa_data)==null?void 0:me.nonce,ut=await(await fetch(`${Se}/pos/search`,{headers:{"X-WP-Nonce":je}})).json();ut.success&&_(ut.data)}catch(Se){console.error("Fetch Defaults Error:",Se)}finally{O(!1)}},U=async()=>{var J,me;$e(!0);try{const Se=(J=window.woocommersa_data)==null?void 0:J.apiUrl,je=(me=window.woocommersa_data)==null?void 0:me.nonce,ut=await(await fetch(`${Se}/pos/orders/today`,{headers:{"X-WP-Nonce":je}})).json();ut.success&&nt(ut.data)}catch(Se){console.error("Fetch Orders Error:",Se)}finally{$e(!1)}},re=async()=>{var J,me;_e(!0);try{const Se=(J=window.woocommersa_data)==null?void 0:J.apiUrl,je=(me=window.woocommersa_data)==null?void 0:me.nonce,ut=await(await fetch(`${Se}/pos/customers`,{headers:{"X-WP-Nonce":je}})).json();ut.success&&ve(ut.data)}catch(Se){console.error("Fetch Customers Error:",Se)}finally{_e(!1)}},ae=async J=>{var me,Se;Q(!0);try{const je=(me=window.woocommersa_data)==null?void 0:me.apiUrl,Pe=(Se=window.woocommersa_data)==null?void 0:Se.nonce,wt=await(await fetch(`${je}/pos/orders/details/${J}`,{headers:{"X-WP-Nonce":Pe}})).json();wt.success&&Ze(wt.data)}catch{ze.error("خطا در دریافت جزئیات سفارش")}finally{Q(!1)}};W.useEffect(()=>{const J=setTimeout(async()=>{var me,Se;if(t.length<2){r([]);return}s(!0);try{const je=(me=window.woocommersa_data)==null?void 0:me.apiUrl,Pe=(Se=window.woocommersa_data)==null?void 0:Se.nonce,wt=await(await fetch(`${je}/pos/search?search=${encodeURIComponent(t)}`,{headers:{"X-WP-Nonce":Pe}})).json();wt.success&&r(wt.data)}catch(je){console.error("POS Search Error:",je)}finally{s(!1)}},500);return()=>clearTimeout(J)},[t]),W.useEffect(()=>{if(!x)return;if(F.length===0){re();return}const J=setTimeout(async()=>{var me,Se;if(F.length<2){ve([]);return}_e(!0);try{const je=(me=window.woocommersa_data)==null?void 0:me.apiUrl,Pe=(Se=window.woocommersa_data)==null?void 0:Se.nonce,wt=await(await fetch(`${je}/pos/customers?search=${encodeURIComponent(F)}`,{headers:{"X-WP-Nonce":Pe}})).json();wt.success&&ve(wt.data)}catch(je){console.error("Customer Search Error:",je)}finally{_e(!1)}},400);return()=>clearTimeout(J)},[F,x]);const he=(J,me)=>{const Se=me?me.stock_status:J.stock_status,je=me?me.stock:J.stock;if(Se!=="instock"||je!==null&&je<=0){ze.error(`محصول ${me?"انتخاب شده":J.name} در حال حاضر ناموجود است.`);return}const Pe=me?me.id:J.id,ut=me?`${J.name} - ${Object.values(me.attributes).join(" / ")}`:J.name,wt=parseFloat(me?me.price:J.price);u(kt=>{const Rt=kt.find(sn=>sn.id===Pe);return Rt?je!==null&&Rt.quantity+1>je?(ze.error("موجودی انبار برای این کالا کافی نیست."),kt):kt.map(sn=>sn.id===Pe?{...sn,quantity:sn.quantity+1}:sn):[...kt,{id:Pe,parent_id:J.id,name:ut,price:wt,quantity:1,image:J.image,attributes:me==null?void 0:me.attributes}]}),ze.success(`${ut} به سبد خرید اضافه شد`),me||e(""),m(null)},Me=async()=>{var me,Se;if(!G.first_name||!G.phone){ze.error("نام و شماره تماس الزامی است");return}const J=ze.loading("در حال ثبت مشتری...");try{const je=(me=window.woocommersa_data)==null?void 0:me.apiUrl,Pe=(Se=window.woocommersa_data)==null?void 0:Se.nonce,wt=await(await fetch(`${je}/pos/customers/create`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":Pe},body:JSON.stringify(G)})).json();wt.success?(ze.success("مشتری با موفقیت ثبت شد",{id:J}),y(wt.data),M(!1),C(!1),q({first_name:"",last_name:"",phone:"",email:"",city:"",state:"",address:""})):ze.error(wt.message||"خطا در ثبت مشتری",{id:J})}catch{ze.error("خطای شبکه",{id:J})}},tt=async()=>{var je,Pe,ut;if(a.length===0)return;L(!0);const J=ze.loading("در حال ثبت نهایی سفارش..."),me=(je=window.woocommersa_data)==null?void 0:je.apiUrl,Se=(Pe=window.woocommersa_data)==null?void 0:Pe.nonce;try{const kt=await(await fetch(`${me}/pos/orders/create`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":Se},body:JSON.stringify({items:a,customer_id:(g==null?void 0:g.id)||0,payment_method:`pos_${Ke}`,payment_method_label:((ut=we.find(Rt=>Rt.id===Ke))==null?void 0:ut.label)||"فروش حضوری",discount:ne==="fixed"?fe:X*(fe/100),discount_info:{type:ne,value:fe}})})).json();kt.success?(ze.success("سفارش با موفقیت ثبت شد",{id:J}),z({order_id:kt.order_id,order_key:kt.order_key,total:kt.total}),u([]),y(null),Ve(0),qe("cash"),e("")):ze.error(kt.message||"خطا در ثبت سفارش",{id:J})}catch{ze.error("خطای شبکه",{id:J})}finally{L(!1)}},ot=(J,me)=>{u(Se=>Se.map(je=>{if(je.id===J){const Pe=Math.max(1,je.quantity+me);return{...je,quantity:Pe}}return je}))},lt=J=>{u(me=>me.filter(Se=>Se.id!==J)),ze.error("محصول از سبد حذف شد")},X=a.reduce((J,me)=>J+me.price*me.quantity,0),de=ne==="fixed"?fe:X*(fe/100),Ce=((se=window.woocommersa_data)==null?void 0:se.pos_tax_percent)||0,Oe=Math.round((X-de)*(Ce/100)),Ge=X-de+Oe,Qe=J=>new Intl.NumberFormat("fa-IR").format(J);return o.jsxs("div",{className:"flex h-screen bg-slate-900 text-slate-100 overflow-hidden font-vazir rtl",dir:"rtl",children:[o.jsx("style",{children:` .no-scrollbar::-webkit-scrollbar { display: none; } .no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; } input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; } `}),o.jsxs("div",{className:"flex-1 flex flex-col p-6 overflow-hidden",children:[o.jsxs("header",{className:"flex items-center justify-between mb-8",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-12 h-12 bg-emerald-500 rounded-2xl flex items-center justify-center shadow-lg shadow-emerald-500/20",children:o.jsx(Da,{className:"text-white",size:24})}),o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-black",children:"میز فروش حضوری"}),o.jsx("p",{className:"text-slate-400 text-xs font-bold mt-1",children:"مدیریت سریع فروشگاه و خریداران حضوری"})]})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"h-14 px-5 bg-slate-800/80 rounded-2xl border border-white/5 flex items-center gap-3 backdrop-blur-sm shadow-inner",children:[o.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500 animate-pulse shadow-[0_0_10px_rgba(16,185,129,0.5)]"}),o.jsx("span",{className:"text-[11px] font-black text-slate-200 uppercase tracking-tight",children:"سیستم متصل است"})]}),o.jsxs("button",{onClick:()=>{Le(!0),U()},className:"h-14 px-6 bg-slate-800/80 hover:bg-slate-700 text-slate-100 rounded-2xl flex items-center gap-3 transition-all border border-white/10 shadow-lg group backdrop-blur-sm",children:[o.jsx(eu,{size:20,className:"text-blue-400 group-hover:scale-110 transition-transform"}),o.jsx("span",{className:"text-xs font-black",children:"فروشهای امروز"})]}),o.jsx("button",{onClick:()=>window.close(),className:"w-14 h-14 bg-rose-500/10 text-rose-500 hover:bg-rose-500 hover:text-white rounded-2xl flex items-center justify-center transition-all border border-rose-500/20 shadow-lg shadow-rose-500/10",children:o.jsx(qi,{size:24})})]})]}),o.jsxs("div",{className:"flex-1 flex flex-col min-h-0 bg-slate-800/30 rounded-[2.5rem] border border-white/5 backdrop-blur-md p-8 relative overflow-hidden",children:[o.jsxs("div",{className:"relative mb-8",children:[o.jsx("div",{className:"absolute right-6 top-1/2 -translate-y-1/2 text-slate-400",children:i?o.jsx(ur,{className:"animate-spin",size:24}):o.jsx(Ia,{size:24})}),o.jsx("input",{ref:I,type:"text",placeholder:"جستجوی محصول بر اساس نام، SKU یا اسکن بارکد...",className:"w-full h-20 bg-slate-900/50 border-2 border-white/5 rounded-3xl pr-20 pl-6 text-xl font-bold outline-none focus:border-emerald-500/50 transition-all placeholder:text-slate-600 shadow-inner",value:t,onChange:J=>e(J.target.value)})]}),o.jsx("div",{className:"flex-1 overflow-y-auto no-scrollbar pb-10",children:n.length>0?o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:n.map(J=>o.jsxs(ht.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},onClick:()=>J.type==="variable"?m(J):he(J),className:"group bg-slate-900/40 border border-white/5 p-4 rounded-3xl hover:bg-slate-900/80 hover:border-emerald-500/30 transition-all cursor-pointer relative overflow-hidden",children:[o.jsxs("div",{className:"flex gap-4",children:[o.jsx("div",{className:"w-20 h-20 rounded-2xl bg-slate-800 overflow-hidden shrink-0 border border-white/5",children:J.image?o.jsx("img",{src:J.image,alt:"",className:"w-full h-full object-cover group-hover:scale-110 transition-transform duration-500"}):o.jsx("div",{className:"w-full h-full flex items-center justify-center text-slate-700",children:o.jsx(bc,{size:32})})}),o.jsxs("div",{className:"flex-1 min-w-0 py-1",children:[o.jsx("h4",{className:"font-black text-slate-200 truncate group-hover:text-white transition-colors",children:J.name}),o.jsxs("p",{className:"text-[10px] font-bold text-slate-500 mt-1 uppercase",children:["SKU: ",J.sku||"---"]}),o.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[o.jsxs("span",{className:"text-emerald-400 font-black",children:[Qe(parseFloat(J.price))," ",o.jsx("span",{className:"text-[10px]",children:"تومان"})]}),J.type==="variable"?o.jsx("span",{className:"px-2 py-1 bg-blue-500/10 text-blue-400 rounded-lg text-[9px] font-black border border-blue-500/20",children:"متغیر"}):o.jsx("span",{className:`px-2 py-1 rounded-lg text-[9px] font-black border ${J.stock_status==="instock"?"bg-emerald-500/10 text-emerald-400 border-emerald-500/20":"bg-rose-500/10 text-rose-400 border-rose-500/20"}`,children:J.stock_status==="instock"?"موجود":"ناموجود"})]})]})]}),o.jsx("div",{className:"absolute inset-x-0 bottom-0 h-1 bg-emerald-500 scale-x-0 group-hover:scale-x-100 transition-transform origin-right"})]},J.id))}):t.length>=2&&!i?o.jsxs("div",{className:"text-center py-20",children:[o.jsx(j1,{size:64,className:"mx-auto mb-6 text-slate-700"}),o.jsx("h2",{className:"text-xl font-black text-slate-400 mb-2",children:"محصولی پیدا نشد!"}),o.jsx("p",{className:"text-slate-600 font-bold italic",children:"عبارت دیگری را جستجو کنید یا بارکد را بررسی نمایید."})]}):o.jsxs("div",{className:"space-y-8",children:[o.jsx("div",{className:"flex items-center justify-between",children:o.jsxs("h3",{className:"text-lg font-black text-slate-400 flex items-center gap-2",children:[o.jsx(Jc,{size:20,className:"text-amber-500"}),"محصولات پرفروش و جدید"]})}),N?o.jsxs("div",{className:"flex flex-col items-center justify-center py-20 gap-4",children:[o.jsx(ur,{className:"animate-spin text-slate-700",size:48}),o.jsx("span",{className:"font-bold text-slate-600",children:"در حال دریافت محصولات..."})]}):o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:k.map(J=>o.jsx(ht.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},onClick:()=>J.type==="variable"?m(J):he(J),className:"group bg-slate-900/40 border border-white/5 p-4 rounded-3xl hover:bg-slate-900/80 hover:border-emerald-500/30 transition-all cursor-pointer relative overflow-hidden",children:o.jsxs("div",{className:"flex gap-4",children:[o.jsx("div",{className:"w-20 h-20 rounded-2xl bg-slate-800 overflow-hidden shrink-0 border border-white/5",children:o.jsx("img",{src:J.image,alt:"",className:"w-full h-full object-cover group-hover:scale-110 transition-transform duration-500"})}),o.jsxs("div",{className:"flex-1 min-w-0 py-1",children:[o.jsx("h4",{className:"font-black text-slate-200 truncate group-hover:text-white transition-colors",children:J.name}),o.jsx("div",{className:"mt-3 flex items-center justify-between",children:o.jsxs("span",{className:"text-emerald-400 font-black",children:[Qe(parseFloat(J.price))," ",o.jsx("span",{className:"text-[10px]",children:"تومان"})]})})]})]})},J.id))})]})})]})]}),o.jsxs("div",{className:"w-[480px] bg-slate-900 border-r border-white/5 flex flex-col shadow-2xl z-20",children:[o.jsxs("div",{className:"p-6 border-b border-white/5 bg-slate-800/30",children:[o.jsxs("div",{className:"flex items-center justify-between mb-3",children:[o.jsxs("h3",{className:"text-[10px] font-black text-slate-500 flex items-center gap-2 uppercase tracking-wider",children:[o.jsx(p0,{size:14}),"مشتری"]}),g?o.jsx("button",{onClick:()=>y(null),className:"text-rose-500 text-[9px] font-black hover:underline",children:"تغییر"}):o.jsxs("button",{onClick:()=>C(!0),className:"flex items-center gap-1.5 text-emerald-500 text-[10px] font-black bg-emerald-500/5 px-2.5 py-1 rounded-lg border border-emerald-500/10 hover:bg-emerald-500/10 transition-all",children:[o.jsx(GU,{size:12}),"انتخاب مشتری"]})]}),g?o.jsxs(ht.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},className:"flex items-center gap-3 bg-slate-900/50 p-3 rounded-xl border border-emerald-500/20",children:[o.jsx("div",{className:"w-10 h-10 bg-emerald-500/10 rounded-lg flex items-center justify-center text-emerald-500 border border-emerald-500/20",children:o.jsx(HU,{size:22})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("div",{className:"font-black text-slate-200 text-sm truncate",children:g.name}),o.jsxs("div",{className:"text-[10px] font-bold text-slate-500 flex items-center gap-1 mt-0.5",children:[o.jsx(ZD,{size:10})," ",g.phone]})]})]}):o.jsxs("div",{className:"flex items-center gap-3 bg-slate-900/30 p-3 rounded-xl border border-white/5 border-dashed",children:[o.jsx("div",{className:"w-10 h-10 bg-slate-800 rounded-lg flex items-center justify-center text-slate-600",children:o.jsx(HU,{size:22})}),o.jsx("div",{className:"text-slate-500 font-bold text-xs italic",children:"مشتری مهمان"})]})]}),o.jsxs("div",{className:"p-6 flex-1 flex flex-col min-h-0",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("h3",{className:"text-sm font-black flex items-center gap-2",children:[o.jsx(t2,{className:"text-emerald-500",size:16}),"سبد خرید"]}),a.length>0&&o.jsx("button",{onClick:()=>{confirm("کل سبد خرید پاک شود؟")&&u([])},className:"text-rose-500 hover:bg-rose-500/10 px-2 py-1 rounded-lg text-[10px] font-black transition-all",children:"خالی کردن"})]}),o.jsx("div",{className:"flex-1 overflow-y-auto no-scrollbar space-y-3 pr-1 min-h-0",children:o.jsx(tr,{initial:!1,children:a.length>0?a.map(J=>o.jsxs(ht.div,{layout:!0,initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"bg-slate-800/40 border border-white/5 p-3 rounded-xl flex gap-3 hover:border-white/10 transition-all",children:[o.jsx("div",{className:"w-14 h-14 rounded-lg bg-slate-800 overflow-hidden shrink-0 border border-white/5",children:o.jsx("img",{src:J.image,alt:"",className:"w-full h-full object-cover"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("h5",{className:"text-[13px] font-black text-slate-200 truncate",children:J.name}),o.jsxs("div",{className:"flex items-center justify-between mt-2",children:[o.jsxs("p",{className:"text-emerald-400 font-black text-[11px]",children:[Qe(J.price)," ",o.jsx("span",{className:"text-[9px]",children:"تومان"})]}),o.jsxs("div",{className:"flex items-center gap-2 bg-slate-900/50 rounded-lg p-0.5 border border-white/5",children:[o.jsx("button",{onClick:()=>ot(J.id,-1),className:"w-6 h-6 flex items-center justify-center hover:bg-white/5 rounded text-slate-400 transition-all",children:o.jsx(Nae,{size:12})}),o.jsx("span",{className:"text-xs font-black w-4 text-center",children:J.quantity}),o.jsx("button",{onClick:()=>ot(J.id,1),className:"w-6 h-6 flex items-center justify-center hover:bg-white/5 rounded text-slate-400 transition-all",children:o.jsx(m0,{size:12})})]}),o.jsx("button",{onClick:()=>lt(J.id),className:"text-slate-600 hover:text-rose-500 p-1.5 transition-colors",children:o.jsx(zu,{size:14})})]})]})]},J.id)):o.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-slate-700 italic py-10",children:[o.jsx(t2,{size:40,className:"mb-3 opacity-10"}),o.jsx("p",{className:"text-xs",children:"سبد خرید فعلاً خالی است"})]})})})]}),o.jsxs("div",{className:"p-6 bg-slate-800/50 border-t border-white/5 space-y-4",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{onClick:()=>V(!0),className:"group flex items-center justify-between bg-slate-900/60 p-4 rounded-2xl border border-white/5 hover:border-emerald-500/40 transition-all cursor-pointer hover:bg-slate-900 shadow-lg",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-10 h-10 bg-amber-500/10 rounded-xl flex items-center justify-center text-amber-500 border border-amber-500/20 group-hover:bg-amber-500 group-hover:text-white transition-all",children:o.jsx(Jc,{size:18})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-[10px] font-black text-slate-500 uppercase tracking-widest",children:"تخفیف روی کل سبد"}),o.jsx("div",{className:"text-xs font-black text-slate-300 mt-0.5",children:"مشاهده و تنظیم تخفیف"})]})]}),o.jsxs("div",{className:"text-left",children:[o.jsx("div",{className:"text-sm font-black text-emerald-400",children:de>0?ne==="fixed"?`${Qe(fe)} تومان`:`${fe}٪`:"بدون تخفیف"}),de>0&&o.jsx("div",{className:"text-[9px] text-slate-600 font-bold",children:"اعمال شده"})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx("span",{className:"text-slate-400 text-[10px] font-black uppercase tracking-wider pr-2",children:"روش پرداخت"}),o.jsx("div",{className:"grid grid-cols-3 gap-2",children:we.map(J=>o.jsxs("button",{onClick:()=>qe(J.id),className:`h-12 rounded-xl flex flex-col items-center justify-center gap-1 transition-all border ${Ke===J.id?"bg-emerald-500/20 border-emerald-500 text-emerald-400 shadow-lg shadow-emerald-500/10":"bg-white/5 border-white/5 text-slate-400 hover:bg-white/10"}`,children:[J.icon,o.jsx("span",{className:"text-[10px] font-bold",children:J.label})]},J.id))})]}),o.jsxs("div",{className:"bg-slate-950/40 p-4 rounded-2xl space-y-2 border border-white/5",children:[o.jsxs("div",{className:"flex justify-between text-slate-400 text-[10px] font-bold",children:[o.jsx("span",{children:"جمع اقلام:"}),o.jsx("span",{className:"font-mono",children:X.toLocaleString()})]}),de>0&&o.jsxs("div",{className:"flex justify-between text-rose-400 text-[10px] font-bold",children:[o.jsxs("span",{children:["تخفیف (",ne==="fixed"?"نقدی":`${fe}٪`,"):"]}),o.jsxs("span",{className:"font-mono",children:["-",de.toLocaleString()]})]}),Ce>0&&o.jsxs("div",{className:"flex justify-between text-slate-500 text-[9px] font-bold",children:[o.jsxs("span",{children:["مالیات (",Ce,"%):"]}),o.jsx("span",{className:"font-mono",children:Oe.toLocaleString()})]}),o.jsxs("div",{className:"flex justify-between items-center pt-2 border-t border-white/5 mt-1",children:[o.jsx("span",{className:"text-sm font-black",children:"قابل پرداخت:"}),o.jsxs("div",{className:"text-left",children:[o.jsx("div",{className:"text-xl font-black text-emerald-500",children:Ge.toLocaleString()}),o.jsx("div",{className:"text-[9px] text-slate-500 font-bold -mt-1",children:"تومان"})]})]})]})]}),o.jsxs("button",{onClick:tt,disabled:j||a.length===0,className:"w-full h-14 bg-emerald-500 hover:bg-emerald-600 disabled:opacity-50 disabled:cursor-not-allowed text-white rounded-2xl font-black text-lg transition-all shadow-xl shadow-emerald-500/20 flex items-center justify-center gap-3 active:scale-[0.98]",children:[j?o.jsx(ur,{className:"animate-spin",size:24}):o.jsx(ho,{size:24}),"ثبت نهایی و چاپ فاکتور"]})]})]}),o.jsxs(tr,{children:[h&&o.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-8 bg-slate-950/80 backdrop-blur-sm",children:o.jsxs(ht.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"bg-slate-900 border border-white/10 w-full max-w-2xl rounded-[2.5rem] shadow-2xl overflow-hidden",children:[o.jsxs("div",{className:"p-8 border-b border-white/5 flex items-center justify-between bg-white/5",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-16 h-16 rounded-2xl bg-slate-800 border border-white/10 overflow-hidden",children:o.jsx("img",{src:h.image,alt:"",className:"w-full h-full object-cover"})}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-xl font-black text-white",children:h.name}),o.jsx("p",{className:"text-slate-400 text-xs font-bold mt-1",children:"انتخاب متغیر محصول"})]})]}),o.jsx("button",{onClick:()=>m(null),className:"w-12 h-12 bg-white/5 hover:bg-white/10 rounded-2xl flex items-center justify-center transition-all",children:o.jsx(qi,{size:24})})]}),o.jsx("div",{className:"p-8 max-h-[50vh] overflow-y-auto no-scrollbar space-y-3",children:(ie=h.variations)==null?void 0:ie.map(J=>o.jsxs("div",{onClick:()=>he(h,J),className:"p-5 bg-slate-800/50 border border-white/5 rounded-2xl flex items-center justify-between group hover:bg-emerald-500/10 hover:border-emerald-500/30 transition-all cursor-pointer",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"w-10 h-10 rounded-xl bg-slate-900 border border-white/10 flex items-center justify-center group-hover:bg-emerald-500 group-hover:text-white transition-all",children:[o.jsx(IU,{size:20,className:"opacity-0 group-hover:opacity-100 transition-opacity"}),o.jsx(m0,{size:20,className:"group-hover:hidden"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"font-bold text-slate-200",children:Object.values(J.attributes).join(" / ")}),o.jsxs("div",{className:"text-[10px] text-slate-500 font-mono mt-0.5",children:["SKU: ",J.sku||"---"]})]})]}),o.jsxs("div",{className:"text-right",children:[o.jsxs("div",{className:"font-black text-emerald-400",children:[Qe(parseFloat(J.price))," تومان"]}),o.jsxs("div",{className:`text-[10px] font-bold mt-1 ${J.stock>0?"text-slate-500":"text-rose-500"}`,children:["موجودی: ",J.stock??"نامشخص"]})]})]},J.id))}),o.jsx("div",{className:"p-8 bg-white/5 border-t border-white/5 text-center",children:o.jsx("button",{onClick:()=>m(null),className:"wm-btn-secondary px-10 h-14",children:"انصراف"})})]})}),x&&o.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-8 bg-slate-950/80 backdrop-blur-sm",children:o.jsxs(ht.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"bg-slate-900 border border-white/10 w-full max-w-xl rounded-[2.5rem] shadow-2xl overflow-hidden flex flex-col h-[600px]",children:[o.jsxs("div",{className:"p-8 border-b border-white/5 flex items-center justify-between bg-white/5",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-xl font-black text-white",children:"انتخاب مشتری"}),o.jsx("p",{className:"text-slate-400 text-xs font-bold mt-1",children:"جستجو در لیست مشتریان موجود"})]}),o.jsx("button",{onClick:()=>C(!1),className:"w-12 h-12 bg-white/5 hover:bg-white/10 rounded-2xl flex items-center justify-center transition-all",children:o.jsx(qi,{size:24})})]}),o.jsxs("div",{className:"p-8 space-y-6 flex-1 flex flex-col overflow-hidden",children:[o.jsxs("div",{className:"relative",children:[o.jsx(Ia,{className:"absolute right-4 top-1/2 -translate-y-1/2 text-slate-500",size:18}),o.jsx("input",{autoFocus:!0,type:"text",placeholder:"نام، ایمیل یا شماره تماس...",className:"w-full h-14 bg-slate-950 border border-white/10 rounded-2xl pr-12 pl-4 text-sm font-bold focus:border-emerald-500 outline-none transition-all",value:F,onChange:J=>B(J.target.value)}),ce&&o.jsx(ur,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-emerald-500 animate-spin",size:18})]}),o.jsx("div",{className:"flex-1 overflow-y-auto no-scrollbar space-y-3",children:te.length>0?te.map(J=>o.jsxs("div",{onClick:()=>{y(J),C(!1)},className:"p-4 bg-slate-800/40 border border-white/5 rounded-2xl flex items-center justify-between group hover:bg-emerald-500/10 hover:border-emerald-500/30 transition-all cursor-pointer",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-10 h-10 bg-slate-900 rounded-xl flex items-center justify-center text-slate-500 group-hover:text-emerald-500 transition-colors",children:o.jsx(p0,{size:20})}),o.jsxs("div",{children:[o.jsx("div",{className:"font-bold text-slate-200",children:J.name}),o.jsx("div",{className:"text-[10px] text-slate-500 font-bold mt-0.5",children:J.phone||"فاقد شماره"})]})]}),o.jsx(N1,{size:18,className:"text-slate-700 group-hover:text-emerald-500 transition-all"})]},J.id)):F.length>=2&&!ce?o.jsxs("div",{className:"text-center py-10",children:[o.jsx(Ph,{className:"mx-auto mb-4 text-slate-700",size:32}),o.jsx("p",{className:"text-slate-600 text-sm font-bold",children:"مشتری با این مشخصات پیدا نشد."})]}):o.jsx("div",{className:"text-center py-10 opacity-30 italic text-sm",children:"آماده جستجو..."})})]}),o.jsxs("div",{className:"p-8 bg-white/5 border-t border-white/5 flex gap-3",children:[o.jsxs("button",{onClick:()=>M(!0),className:"flex-1 h-14 bg-emerald-600 text-white rounded-2xl font-black flex items-center justify-center gap-2 hover:bg-emerald-700 transition-all shadow-lg shadow-emerald-600/10",children:[o.jsx(GU,{size:20})," ثبت مشتری جدید"]}),o.jsx("button",{onClick:()=>{y(null),C(!1)},className:"px-6 h-14 bg-slate-800 text-slate-400 rounded-2xl font-black hover:bg-slate-700 transition-all",children:"مهمان"})]})]})}),E&&o.jsx("div",{className:"fixed inset-0 z-[110] flex items-center justify-center p-8 bg-slate-950/90 backdrop-blur-md",children:o.jsxs(ht.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"bg-slate-900 border border-white/10 w-full max-w-xl rounded-[2.5rem] shadow-2xl overflow-hidden flex flex-col",children:[o.jsxs("div",{className:"p-8 border-b border-white/5 flex items-center justify-between bg-emerald-500/5",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-xl font-black text-white",children:"ثبت مشتری جدید"}),o.jsx("p",{className:"text-emerald-500/60 text-xs font-bold mt-1",children:"اطلاعات پایه را وارد کنید"})]}),o.jsx("button",{onClick:()=>M(!1),className:"w-12 h-12 bg-white/5 hover:bg-white/10 rounded-2xl flex items-center justify-center transition-all",children:o.jsx(qi,{size:24})})]}),o.jsxs("div",{className:"p-8 grid grid-cols-2 gap-5",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsxs("label",{className:"text-[10px] font-black text-slate-500 mr-2",children:["نام ",o.jsx("span",{className:"text-rose-500",children:"*"})]}),o.jsx("input",{type:"text",className:"w-full h-14 bg-slate-950 border border-white/10 rounded-xl px-4 text-sm font-bold focus:border-emerald-500 outline-none transition-all",value:G.first_name,onChange:J=>q({...G,first_name:J.target.value})})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-[10px] font-black text-slate-500 mr-2",children:"نام خانوادگی"}),o.jsx("input",{type:"text",className:"w-full h-14 bg-slate-950 border border-white/10 rounded-xl px-4 text-sm font-bold focus:border-emerald-500 outline-none transition-all",value:G.last_name,onChange:J=>q({...G,last_name:J.target.value})})]}),o.jsxs("div",{className:"space-y-2 col-span-2",children:[o.jsxs("label",{className:"text-[10px] font-black text-slate-500 mr-2",children:["شماره تماس (نام کاربری) ",o.jsx("span",{className:"text-rose-500",children:"*"})]}),o.jsx("input",{type:"number",dir:"ltr",className:"w-full h-14 bg-slate-950 border border-white/10 rounded-xl px-4 text-lg font-black focus:border-emerald-500 outline-none transition-all text-left",value:G.phone,onChange:J=>q({...G,phone:J.target.value}),placeholder:"0912..."})]}),o.jsxs("div",{className:"space-y-2 col-span-2",children:[o.jsx("label",{className:"text-[10px] font-black text-slate-500 mr-2",children:"ایمیل (اختیاری)"}),o.jsx("input",{type:"email",dir:"ltr",className:"w-full h-14 bg-slate-950 border border-white/10 rounded-xl px-4 text-sm font-bold focus:border-emerald-500 outline-none transition-all text-left",value:G.email,onChange:J=>q({...G,email:J.target.value})})]})]}),o.jsxs("div",{className:"p-8 bg-white/5 border-t border-white/5 flex gap-3",children:[o.jsx("button",{onClick:Me,className:"flex-1 h-16 bg-emerald-600 text-white rounded-2xl font-black text-lg shadow-xl shadow-emerald-600/20 hover:bg-emerald-700 transition-all",children:"تایید و ثبت نهایی"}),o.jsx("button",{onClick:()=>M(!1),className:"px-8 h-16 bg-slate-800 text-slate-400 rounded-2xl font-black hover:bg-slate-700 transition-all",children:"انصراف"})]})]})}),H&&o.jsx("div",{className:"fixed inset-0 z-[110] flex items-center justify-center p-8 bg-slate-950/90 backdrop-blur-md",children:o.jsxs(ht.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"bg-slate-900 border border-white/10 w-full max-w-lg rounded-[2.5rem] shadow-2xl overflow-hidden flex flex-col",children:[o.jsxs("div",{className:"p-8 border-b border-white/5 flex items-center justify-between bg-amber-500/5",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-xl font-black text-white",children:"تنظیم تخفیف"}),o.jsx("p",{className:"text-amber-500/60 text-xs font-bold mt-1",children:"کسر مبلغ یا درصد از کل فاکتور"})]}),o.jsx("button",{onClick:()=>V(!1),className:"w-12 h-12 bg-white/5 hover:bg-white/10 rounded-2xl flex items-center justify-center transition-all",children:o.jsx(qi,{size:24})})]}),o.jsxs("div",{className:"p-10 space-y-8",children:[o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"flex items-center justify-between px-2",children:o.jsx("label",{className:"text-xs font-black text-slate-400 uppercase tracking-widest flex items-center gap-2",children:"واحد تخفیف را انتخاب کنید"})}),o.jsxs("div",{className:"grid grid-cols-2 bg-slate-950 rounded-2xl p-1.5 border border-white/5",children:[o.jsxs("button",{onClick:()=>xe("fixed"),className:`h-14 rounded-xl text-sm font-black transition-all flex items-center justify-center gap-2 ${ne==="fixed"?"bg-emerald-500 text-white shadow-lg":"text-slate-500 hover:text-slate-300 hover:bg-white/5"}`,children:[o.jsx(Zp,{size:18})," مبلغ (تومان)"]}),o.jsxs("button",{onClick:()=>xe("percent"),className:`h-14 rounded-xl text-sm font-black transition-all flex items-center justify-center gap-2 ${ne==="percent"?"bg-emerald-500 text-white shadow-lg":"text-slate-500 hover:text-slate-300 hover:bg-white/5"}`,children:[o.jsx(Mk,{size:18})," درصد (٪)"]})]})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsx("label",{className:"text-xs font-black text-slate-400 pr-2",children:"مقدار تخفیف"}),o.jsxs("div",{className:"relative",children:[o.jsx("input",{autoFocus:!0,type:"number",value:fe||"",onChange:J=>Ve(Math.max(0,parseInt(J.target.value)||0)),className:"w-full h-20 bg-slate-950 border-2 border-white/5 rounded-3xl px-8 text-3xl font-black outline-none focus:border-emerald-500 text-emerald-400 transition-all text-center",placeholder:"0"}),o.jsx("div",{className:"absolute left-8 top-1/2 -translate-y-1/2 text-slate-600 font-black text-lg pointer-events-none",children:ne==="fixed"?"تومان":"٪"})]})]}),o.jsxs("div",{className:"bg-emerald-500/5 border border-emerald-500/10 p-5 rounded-2xl flex items-center justify-between",children:[o.jsx("span",{className:"text-sm font-bold text-slate-400",children:"مبلغ نهایی تخفیف:"}),o.jsxs("span",{className:"text-xl font-black text-emerald-400",children:[Qe(de)," تومان"]})]})]}),o.jsx("div",{className:"p-8 bg-white/5 border-t border-white/5",children:o.jsx("button",{onClick:()=>V(!1),className:"w-full h-16 bg-emerald-500 hover:bg-emerald-600 text-white rounded-2xl font-black text-lg transition-all shadow-xl shadow-emerald-500/20",children:"تایید و بازگشت"})})]})}),D&&o.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center p-8 bg-slate-950/95 backdrop-blur-xl",children:o.jsxs(ht.div,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},className:"bg-slate-900 border border-emerald-500/20 w-full max-md rounded-[3rem] shadow-[0_0_50px_rgba(16,185,129,0.1)] overflow-hidden",children:[o.jsxs("div",{className:"pt-12 pb-8 flex flex-col items-center bg-gradient-to-b from-emerald-500/10 to-transparent",children:[o.jsx("div",{className:"w-24 h-24 bg-emerald-500 rounded-full flex items-center justify-center text-white mb-6 shadow-lg shadow-emerald-500/30",children:o.jsx(ho,{size:56})}),o.jsx("h2",{className:"text-3xl font-black text-white mb-2",children:"فروش با موفقیت ثبت شد"}),o.jsx("p",{className:"text-emerald-500/60 font-bold",children:"موجودی انبار بهروزرسانی گردید"})]}),o.jsxs("div",{className:"p-10 space-y-6",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"bg-slate-950/50 p-4 rounded-2xl border border-white/5",children:[o.jsxs("span",{className:"text-[10px] font-black text-slate-500 block mb-1 flex items-center gap-1",children:[o.jsx(Mk,{size:10})," شماره سفارش"]}),o.jsxs("span",{className:"text-lg font-black text-slate-200",children:["#",D.order_id]})]}),o.jsxs("div",{className:"bg-slate-950/50 p-4 rounded-2xl border border-white/5",children:[o.jsxs("span",{className:"text-[10px] font-black text-slate-500 block mb-1 flex items-center gap-1",children:[o.jsx(Ll,{size:10})," تاریخ"]}),o.jsx("span",{className:"text-lg font-black text-slate-200",children:new Intl.DateTimeFormat("fa-IR").format(new Date)})]})]}),o.jsxs("div",{className:"bg-emerald-500/5 p-6 rounded-3xl border border-emerald-500/10 flex justify-between items-center",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"w-10 h-10 bg-emerald-500/10 rounded-xl flex items-center justify-center text-emerald-500",children:o.jsx(Zp,{size:20})}),o.jsx("span",{className:"font-black text-slate-400",children:"مبلغ دریافتی"})]}),o.jsxs("span",{className:"text-2xl font-black text-emerald-400",children:[Qe(D.total)," ",o.jsx("span",{className:"text-xs font-bold",children:"تومان"})]})]}),o.jsxs("div",{className:"flex gap-4",children:[o.jsxs("button",{onClick:()=>{window.open(`${window.woocommersa_data.siteUrl}/?woocommersa_print_pos=${D.order_id}`,"_blank")},className:"flex-1 h-14 bg-slate-800 hover:bg-slate-700 text-white rounded-2xl font-black flex items-center justify-center gap-3 transition-all border border-white/5",children:[o.jsx(Pk,{size:20})," چاپ فاکتور"]}),o.jsxs("button",{onClick:()=>z(null),className:"flex-1 h-14 bg-emerald-600 hover:bg-emerald-700 text-white rounded-2xl font-black flex items-center justify-center gap-3 transition-all shadow-lg shadow-emerald-600/10",children:[o.jsx(h0,{size:20,className:"rotate-180"})," فروش جدید"]})]}),o.jsxs("button",{onClick:()=>{window.location.href=`${window.woocommersa_data.adminUrl}post.php?post=${D.order_id}&action=edit`},className:"w-full flex items-center justify-center gap-2 text-slate-500 text-xs font-bold hover:text-white transition-colors",children:[o.jsx(Sx,{size:14})," مشاهده جزئیات سفارش در پنل ووکامرس"]})]})]})}),pe&&o.jsx("div",{className:"fixed inset-0 z-[150] flex items-center justify-center p-8 bg-slate-950/90 backdrop-blur-md",children:o.jsxs(ht.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"bg-slate-900 border border-white/10 w-full max-w-4xl rounded-[2.5rem] shadow-2xl overflow-hidden flex flex-col h-[700px]",children:[o.jsxs("div",{className:"p-8 border-b border-white/5 flex items-center justify-between bg-white/5",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-12 h-12 bg-blue-500/10 rounded-2xl flex items-center justify-center text-blue-500 border border-blue-500/20",children:o.jsx(eu,{size:24})}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-xl font-black text-white",children:"گزارش فروش حضوری امروز"}),o.jsx("p",{className:"text-slate-400 text-xs font-bold mt-1",children:new Intl.DateTimeFormat("fa-IR").format(new Date)})]})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("button",{onClick:()=>window.open(`${window.woocommersa_data.apiUrl}/pos/orders/export?format=csv&_wpnonce=${window.woocommersa_data.nonce}`,"_blank"),className:"h-12 px-5 bg-slate-800 hover:bg-slate-700 text-slate-300 rounded-2xl flex items-center gap-2 transition-all text-[11px] font-black border border-white/5",children:[o.jsx(om,{size:16,className:"text-emerald-400"})," خروجی اکسل"]}),o.jsxs("button",{onClick:()=>window.open(`${window.woocommersa_data.apiUrl}/pos/orders/export?format=pdf&_wpnonce=${window.woocommersa_data.nonce}`,"_blank"),className:"h-12 px-5 bg-slate-800 hover:bg-slate-700 text-slate-300 rounded-2xl flex items-center gap-2 transition-all text-[11px] font-black border border-white/5",children:[o.jsx(Sx,{size:16,className:"text-rose-400"})," خروجی PDF"]}),o.jsx("button",{onClick:()=>Le(!1),className:"w-12 h-12 bg-white/5 hover:bg-white/10 rounded-2xl flex items-center justify-center transition-all border border-white/5",children:o.jsx(qi,{size:24})})]})]}),o.jsx("div",{className:"flex-1 overflow-y-auto p-8 no-scrollbar",children:dt?o.jsxs("div",{className:"flex flex-col items-center justify-center py-20 gap-4",children:[o.jsx(ur,{className:"animate-spin text-blue-500",size:48}),o.jsx("span",{className:"font-bold text-slate-400",children:"در حال دریافت لیست سفارشات..."})]}):Fe.length>0?o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-5 gap-4 px-6 py-3 bg-slate-950/50 rounded-xl text-[10px] font-black text-slate-500 uppercase tracking-widest",children:[o.jsx("span",{children:"شناسه"}),o.jsx("span",{children:"مشتری"}),o.jsx("span",{children:"ساعت"}),o.jsx("span",{children:"آیتمها"}),o.jsx("span",{className:"text-left",children:"مبلغ کل"})]}),Fe.map(J=>o.jsxs("div",{className:"grid grid-cols-5 gap-4 px-6 py-5 bg-slate-800/40 border border-white/5 rounded-2xl hover:bg-slate-800/80 transition-all items-center group",children:[o.jsxs("span",{className:"font-black text-slate-400",children:["#",J.id]}),o.jsx("span",{className:"font-black text-slate-200 truncate",children:J.customer}),o.jsx("span",{className:"font-bold text-slate-500 text-xs",children:J.time}),o.jsxs("span",{className:"font-bold text-slate-500 text-xs",children:[J.items_count," کالا"]}),o.jsxs("div",{className:"flex items-center justify-end gap-2",children:[o.jsx("span",{className:"font-black text-emerald-400 ml-4",children:Qe(J.total)}),o.jsx("button",{onClick:()=>ae(J.id),className:"w-9 h-9 rounded-xl bg-blue-500/10 text-blue-400 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-all hover:bg-blue-500 hover:text-white shadow-lg shadow-blue-500/20",children:o.jsx(Jp,{size:16})}),o.jsx("button",{onClick:()=>window.open(`${window.woocommersa_data.siteUrl}/?woocommersa_print_pos=${J.id}`,"_blank"),className:"w-8 h-8 rounded-lg bg-emerald-500/10 text-emerald-400 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-all hover:bg-emerald-500 hover:text-white",children:o.jsx(Pk,{size:14})})]})]},J.id))]}):o.jsx("div",{className:"text-center py-20 opacity-30 italic",children:"هنوز هیچ سفارشی در تاریخ امروز ثبت نشده است."})}),o.jsxs("div",{className:"p-8 bg-white/5 border-t border-white/5 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-6",children:[o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"text-[10px] font-black text-slate-500 mb-1 uppercase",children:"مجموع تعداد"}),o.jsxs("span",{className:"text-xl font-black text-white",children:[Fe.length," سفارش"]})]}),o.jsx("div",{className:"w-px h-10 bg-white/10"}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"text-[10px] font-black text-slate-500 mb-1 uppercase",children:"مجموع فروش امروز"}),o.jsxs("span",{className:"text-xl font-black text-emerald-400",children:[Qe(Fe.reduce((J,me)=>J+parseFloat(me.total),0))," ",o.jsx("span",{className:"text-xs",children:"تومان"})]})]})]}),o.jsx("button",{onClick:()=>Le(!1),className:"px-8 h-14 bg-slate-800 text-white rounded-2xl font-black hover:bg-slate-700 transition-all",children:"بستن گزارش"})]})]})}),Re&&o.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center p-8 bg-slate-950/95 backdrop-blur-xl",children:o.jsx(ht.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"bg-slate-900 border border-white/10 w-full max-w-2xl rounded-[2.5rem] shadow-2xl overflow-hidden flex flex-col h-[600px]",children:Ee?o.jsxs("div",{className:"p-20 flex flex-col items-center justify-center gap-4",children:[o.jsx(ur,{className:"animate-spin text-emerald-500",size:40}),o.jsx("p",{className:"text-slate-400 font-bold",children:"در حال دریافت جزئیات..."})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"p-8 border-b border-white/5 flex items-center justify-between bg-white/5",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("div",{className:"w-12 h-12 bg-emerald-500/10 rounded-2xl flex items-center justify-center text-emerald-500 border border-emerald-500/20",children:o.jsx(Jp,{size:24})}),o.jsxs("div",{children:[o.jsxs("h3",{className:"text-xl font-black text-white",children:["جزئیات سفارش #",Re.id]}),o.jsx("p",{className:"text-slate-400 text-xs font-bold mt-1",children:Re.date})]})]}),o.jsx("button",{onClick:()=>Ze(null),className:"w-10 h-10 bg-white/5 hover:bg-white/10 rounded-xl flex items-center justify-center transition-all",children:o.jsx(qi,{size:20})})]}),o.jsxs("div",{className:"p-8 flex-1 overflow-y-auto no-scrollbar",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-6",children:[o.jsxs("div",{className:"bg-slate-800/50 p-4 rounded-2xl border border-white/5",children:[o.jsx("span",{className:"text-[10px] font-black text-slate-500 block mb-1",children:"مشتری"}),o.jsx("span",{className:"text-sm font-black text-slate-200",children:Re.customer})]}),o.jsxs("div",{className:"bg-slate-800/50 p-4 rounded-2xl border border-white/5",children:[o.jsx("span",{className:"text-[10px] font-black text-slate-500 block mb-1",children:"روش پرداخت"}),o.jsx("span",{className:"text-sm font-black text-slate-200",children:Re.payment})]})]}),o.jsxs("div",{className:"space-y-3 mb-6",children:[o.jsx("h4",{className:"text-[10px] font-black text-slate-500 uppercase pr-2",children:"لیست کالاها"}),o.jsx("div",{className:"bg-slate-950/30 rounded-2xl border border-white/5 overflow-hidden",children:Re.items.map((J,me)=>o.jsxs("div",{className:"p-4 flex items-center justify-between border-b border-white/5 last:border-0",children:[o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"font-black text-slate-200 text-sm",children:J.name}),o.jsxs("span",{className:"text-[10px] text-slate-500 font-bold mt-1",children:[J.qty," عدد"]})]}),o.jsx("span",{className:"text-sm font-black text-white",children:Qe(J.total)})]},me))})]}),o.jsxs("div",{className:"bg-slate-950/40 p-5 rounded-2xl space-y-2 border border-white/5",children:[o.jsxs("div",{className:"flex justify-between text-xs font-bold text-slate-500",children:[o.jsx("span",{children:"جمع اقلام:"}),o.jsx("span",{children:Qe(Re.subtotal)})]}),Re.discount>0&&o.jsxs("div",{className:"flex justify-between text-xs font-bold text-rose-400",children:[o.jsx("span",{children:"تخفیف:"}),o.jsxs("span",{children:["-",Qe(Re.discount)]})]}),o.jsxs("div",{className:"flex justify-between text-lg font-black text-emerald-400 pt-2 border-t border-white/5 mt-2",children:[o.jsx("span",{children:"مبلغ نهایی:"}),o.jsx("span",{children:Qe(Re.total)})]})]})]}),o.jsxs("div",{className:"p-8 bg-white/5 border-t border-white/5 flex gap-4",children:[o.jsxs("button",{onClick:()=>window.open(Re.admin_url,"_blank"),className:"flex-1 h-14 bg-slate-800 hover:bg-slate-700 text-white rounded-2xl font-black flex items-center justify-center gap-2 transition-all",children:[o.jsx($u,{size:18})," مشاهده در پنل"]}),o.jsxs("button",{onClick:()=>window.open(`${window.woocommersa_data.siteUrl}/?woocommersa_print_pos=${Re.id}`,"_blank"),className:"flex-1 h-14 bg-emerald-600 hover:bg-emerald-700 text-white rounded-2xl font-black flex items-center justify-center gap-2 transition-all",children:[o.jsx(Pk,{size:18})," چاپ مجدد"]})]})]})})})]}),o.jsx("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50",children:o.jsxs("a",{href:"https://www.rtl-theme.com/woocommersa-wordpress-plugin/",target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 px-4 py-2 bg-slate-900/80 backdrop-blur-md border border-white/10 rounded-full text-[10px] text-slate-400 hover:text-white transition-all group shadow-2xl",children:[o.jsx(Jc,{size:12,className:"text-emerald-500 group-hover:animate-spin"}),"قدرت گرفته از ",o.jsx("span",{className:"font-black text-slate-200",children:"افزونه ووکامرسا"})]})})]})},D3e=({page:t,perPage:e,search:n,activeFilter:r,selectedCategory:i,stockStatus:s,smartFilterRules:a,sorting:u,selectedVendor:h})=>{const[m,g]=W.useState([]),[y,x]=W.useState(0),[C,E]=W.useState(!0),M=W.useCallback(async()=>{const j=window.woocommersa_data;if(!(!(j!=null&&j.apiUrl)||!(j!=null&&j.nonce))){E(!0);try{const L=new URL(`${j.apiUrl}/products`);L.searchParams.append("page",t.toString()),L.searchParams.append("per_page",e.toString()),r&&L.searchParams.append("filter",r),n&&L.searchParams.append("search",n),i&&L.searchParams.append("category",i),s&&L.searchParams.append("stock_status",s),h&&L.searchParams.append("vendor",h),a.length>0&&L.searchParams.append("smart_filters",JSON.stringify(a)),u&&u.length>0&&(L.searchParams.append("orderby",u[0].id),L.searchParams.append("order",u[0].desc?"desc":"asc"));const z=await(await fetch(L.toString(),{headers:{"X-WP-Nonce":j.nonce}})).json();g((z==null?void 0:z.data)||(z==null?void 0:z.products)||[]),x((z==null?void 0:z.total)||0)}catch(L){console.error("Fetch error:",L),ze.error("خطا در دریافت لیست محصولات")}finally{E(!1)}}},[t,e,n,r,i,s,h,a,u]);return W.useEffect(()=>{const j=setTimeout(()=>{M()},300);return()=>clearTimeout(j)},[M]),{products:m,total:y,loading:C,refetch:M,setProducts:g,setLoading:E}},J3=[{title:"اصلی",items:[{id:"spreadsheet",icon:n2,label:"ویرایش اکسلی"}]},{title:"مدیریت محصولات",items:[{id:"bulk-edit",icon:Zc,label:"ویرایش گروهی"},{id:"bulk-images",icon:eg,label:"ویرایش تصاویر"}]},{title:"ابزارها",items:[{id:"coupons",icon:Od,label:"مدیریت کوپن ها"},{id:"orders",icon:Da,label:"مدیریت سفارشات"},{id:"pricing-rules",icon:Hr,label:"اتوماسیون قیمت"},{id:"history",icon:k1,label:"گزارش تغییرات"},{id:"templates",icon:Sx,label:"سیستم سئو"},{id:"abandoned-carts",icon:Da,label:"سبد خرید رها شده"},{id:"import-export",icon:jk,label:"درون ریزی/ برون ریزی"}]},{title:"تحلیل فروش",items:[{id:"customers",icon:Ik,label:"تحلیل مشتریان"},{id:"health",icon:qs,label:"سلامت محصولات"},{id:"profit",icon:KD,label:"سود و مارجین"}]},{title:"تنظیمات سیستم",items:[{id:"settings",icon:sg,label:"تنظیمات"}]}],H3e={spreadsheet:o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"p-5 bg-primary-50/50 rounded-[2rem] border border-primary-100 flex items-start gap-4",children:[o.jsx("div",{className:"p-3 bg-white rounded-2xl text-primary-600 shadow-sm border border-primary-50",children:o.jsx(n2,{size:24})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"font-black text-slate-800 text-sm mb-1",children:"ویرایش اکسلی (Spreadsheet View)"}),o.jsx("p",{className:"text-xs text-slate-500 leading-relaxed italic",children:"محیطی دقیق و سریع مشابه نرمافزار Excel برای مدیریت متمرکز تمامی دادههای محصولات."})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-rose-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(Fu,{size:14}),o.jsx("span",{children:"این ابزار چیکار میکنه؟"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:"این بخش قلب تپنده ووکامرسا است. تمام محصولات شما را در یک نمای جدولی لیست میکند و به شما اجازه میدهد فیلدها (قیمت، نام، موجودی، وزن و ...) را مستقیماً با یک کلیک ویرایش کنید بدون اینکه به صفحه ویرایش هر محصول بروید."})]}),o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-emerald-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(eu,{size:14}),o.jsx("span",{children:"چه سودی برای شما دارد؟"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:"ذخیره زمان طلایی! بهجای ساعتها انتظار برای باز شدن صفحات وردپرس، میتوانید صدها محصول را در چند دقیقه اصلاح کنید. این یعنی تمرکز بیشتر روی استراتژی فروش و تمرکز کمتر روی کارهای روتین."})]})]}),o.jsxs("div",{className:"p-5 bg-amber-50/30 rounded-[2rem] border border-amber-100/50 space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2 text-amber-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(ng,{size:14}),o.jsx("span",{children:"یک مثال واقعی (Case Study)"})]}),o.jsx("div",{className:"p-4 bg-white/70 rounded-2xl border border-amber-100 text-xs text-slate-700 leading-relaxed text-justify",children:"فرض کنید قصد دارید قیمت تمام محصولات یک دستهبندی خاص را به دلیل نوسان ارز تغییر دهید. کافیست محصولات را فیلتر کنید، در ستون قیمت فروش کلیک کنید و قیمت جدید را وارد کنید. سیستم بلافاصله آن را در دیتابیس ثبت میکند."})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-slate-400 font-black text-[10px] uppercase tracking-widest px-2",children:[o.jsx(ho,{size:14}),o.jsx("span",{children:"ویژگیهای کلیدی این بخش"})]}),o.jsx("ul",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[{icon:kae,text:"ویرایش درجا (Inline) سلولها"},{icon:j1,text:"فیلترهای پیشرفته و هوشمند"},{icon:Hr,text:"ذخیرهسازی آنی و خودکار"},{icon:Zc,text:"پشتیبانی کامل از محصولات متغیر"}].map((t,e)=>o.jsxs("li",{className:"flex items-center gap-2 p-3 bg-slate-50 rounded-xl border border-slate-100 text-[11px] text-slate-600",children:[o.jsx(t.icon,{size:14,className:"text-primary-500"}),t.text]},e))})]})]}),"bulk-edit":o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"p-5 bg-primary-50/50 rounded-[2rem] border border-primary-100 flex items-start gap-4",children:[o.jsx("div",{className:"p-3 bg-white rounded-2xl text-primary-600 shadow-sm border border-primary-50",children:o.jsx(Zc,{size:24})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"font-black text-slate-800 text-sm mb-1",children:"ویرایش گروهی (Bulk Update)"}),o.jsx("p",{className:"text-xs text-slate-500 leading-relaxed italic",children:"اعمال تغییرات یکسان بر روی هزاران محصول به صورت همزمان با دقت میلیمتری."})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-rose-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(am,{size:14}),o.jsx("span",{children:"این ابزار چیکار میکنه؟"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:"این بخش به شما اجازه میدهد عملیات پیچیده ریاضی یا متنی را روی دستهای از محصولات اعمال کنید. مثلاً افزایش ۱۰ درصدی قیمتها، افزودن یک واژه به تمام عناوین، یا تغییر وضعیت موجودی محصولات خاص."})]}),o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-emerald-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(og,{size:14}),o.jsx("span",{children:"چه سودی برای شما دارد؟"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:"حذف خطای انسانی و سرعت فوقتخیلی! اعمال تغییر روی ۱۰۰۰ محصول به صورت دستی غیرممکن است، اما با این ابزار تنها چند ثانیه زمان میبرد و دقت ۱۰۰ درصدی را تضمین میکند."})]})]}),o.jsxs("div",{className:"p-5 bg-amber-50/30 rounded-[2rem] border border-amber-100/50 space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2 text-amber-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(ng,{size:14}),o.jsx("span",{children:"یک مثال واقعی (Case Study)"})]}),o.jsx("div",{className:"p-4 bg-white/70 rounded-2xl border border-amber-100 text-xs text-slate-700 leading-relaxed text-justify",children:'جشنواره عید است و میخواهید تمام کفشهای ورزشی نایک را ۲۰٪ تخفیف بدهید. محصولات را فیلتر میکنید، مقدار "-۲۰٪" را در فیلد قیمت حراج وارد میکنید و دکمه اجرا را میزنید. تمام!'})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-slate-400 font-black text-[10px] uppercase tracking-widest px-2",children:[o.jsx(ho,{size:14}),o.jsx("span",{children:"ویژگیهای کلیدی این بخش"})]}),o.jsx("ul",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[{icon:am,text:"پردازش فوق سریع متوالی"},{icon:Oae,text:"پشتیبانی از فرمولهای پیشرفته"},{icon:YU,text:"جلوگیری از تغییرات ناخواسته"},{icon:gae,text:"مدیریت حرفهای ویژگیها و برندها"}].map((t,e)=>o.jsxs("li",{className:"flex items-center gap-2 p-3 bg-slate-50 rounded-xl border border-slate-100 text-[11px] text-slate-600",children:[o.jsx(t.icon,{size:14,className:"text-primary-500"}),t.text]},e))})]})]}),"bulk-images":o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"p-5 bg-primary-50/50 rounded-[2rem] border border-primary-100 flex items-start gap-4",children:[o.jsx("div",{className:"p-3 bg-white rounded-2xl text-primary-600 shadow-sm border border-primary-50",children:o.jsx(eg,{size:24})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"font-black text-slate-800 text-sm mb-1",children:"ویرایشگر تصاویر (Image Editor)"}),o.jsx("p",{className:"text-xs text-slate-500 leading-relaxed italic",children:"مدیریت بصری گالری تصاویر محصولات، بهینهسازی حجم و شناسایی محصولات بدون عکس."})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-rose-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(Fu,{size:14}),o.jsx("span",{children:"این ابزار چیکار میکنه؟"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:"این بخش تمام مدیاهای محصولات را در یک نمای کاربرپسند نشان میدهد. میتوانید تصاویر شاخص را سریعاً تغییر دهید، گالریها را مدیریت کنید و متون جایگزین (Alt Text) را برای سئو بهتر اصلاح کنید."})]}),o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-emerald-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(eu,{size:14}),o.jsx("span",{children:"چه سودی برای شما دارد؟"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:'بهبود نرخ تبدیل (Conversion Rate)! محصولات با تصاویر باکیفیت و بهینه، اعتماد مشتری را جلب میکنند. همچنین شناسایی محصولات بدون عکس باعث میشود هیچ محصول "کوری" در فروشگاه شما نباشد.'})]})]}),o.jsxs("div",{className:"p-5 bg-amber-50/30 rounded-[2rem] border border-amber-100/50 space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2 text-amber-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(ng,{size:14}),o.jsx("span",{children:"یک مثال واقعی (Case Study)"})]}),o.jsx("div",{className:"p-4 bg-white/70 rounded-2xl border border-amber-100 text-xs text-slate-700 leading-relaxed text-justify",children:"متوجه میشوید نرخ پرش در برخی صفحات بالاست. با این ابزار متوجه میشوید تصاویر شاخص محصولات گوشی موبایل حجم بسیار بالایی دارند. سریعاً آنها را جایگزین میکنید و سرعت لود صفحه را ۳ برابر میکنید."})]})]}),health:o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"p-5 bg-primary-50/50 rounded-[2rem] border border-primary-100 flex items-start gap-4",children:[o.jsx("div",{className:"p-3 bg-white rounded-2xl text-primary-600 shadow-sm border border-primary-50",children:o.jsx(qs,{size:24})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"font-black text-slate-800 text-sm mb-1",children:"سلامت محصولات (Product Health)"}),o.jsx("p",{className:"text-xs text-slate-500 leading-relaxed italic",children:"آنالیز هوشمند برای شناسایی نقصهای دادهای، مشکلات سئو و استانداردهای فروشگاهی."})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-rose-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(j1,{size:14}),o.jsx("span",{children:"این ابزار چیکار میکنه؟"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:"یک پزشک متخصص برای دیتابیس شما! این ابزار محصولات را اسکن کرده و مواردی که عکس ندارند، قیمت نخوردهاند، سئو نشدهاند یا توضیحات کافی ندارند را لیست میکند."})]}),o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-emerald-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(og,{size:14}),o.jsx("span",{children:"چه سودی برای شما دارد؟"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:"تضمین کیفیت فروشگاه! شما هرگز محصولی را که ضررده یا ناقص باشد از نگاهتان دور نمیماند. با رفع این نواقص، رتبه گوگل و اعتماد مشتریان به برند شما افزایش مییابد."})]})]}),o.jsxs("div",{className:"p-5 bg-amber-50/30 rounded-[2rem] border border-amber-100/50 space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2 text-amber-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(ng,{size:14}),o.jsx("span",{children:"یک مثال واقعی (Case Study)"})]}),o.jsx("div",{className:"p-4 bg-white/70 rounded-2xl border border-amber-100 text-xs text-slate-700 leading-relaxed text-justify",children:'بعد از اپلود ۱۰۰ محصول جدید، فراموش میکنید برای ۲۰ مورد قیمت تعیین کنید. داشبورد سلامت فوراً هشدار "۲۰ محصول بدون قیمت" را نشان میدهد و شما با یک کلیک به ویرایشگر هدایت میشوید.'})]})]}),profit:o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"p-5 bg-primary-50/50 rounded-[2rem] border border-primary-100 flex items-start gap-4",children:[o.jsx("div",{className:"p-3 bg-white rounded-2xl text-primary-600 shadow-sm border border-primary-50",children:o.jsx(KD,{size:24})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"font-black text-slate-800 text-sm mb-1",children:"سود و مارجین (Profit Analysis)"}),o.jsx("p",{className:"text-xs text-slate-500 leading-relaxed italic",children:"مدیریت قیمت خرید و محاسبه خودکار سود خالص بر اساس فرمولهای دلخواه."})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-rose-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(Fu,{size:14}),o.jsx("span",{children:"این ابزار چیکار میکنه؟"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:"این ابزار قیمت خرید (Cost) و قیمت فروش را مقایسه کرده و در لحظه میزان سود و درصد حاشیه سود (Margin) را برای هر محصول یا کل فروشگاه محاسبه میکند."})]}),o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-emerald-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(eu,{size:14}),o.jsx("span",{children:"چه سودی برای شما دارد؟"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:"مانیتورینگ سلامت مالی! متوجه میشوید کدام محصولات واقعاً ثروتآفرین هستند و کدام یک به دلیل هزینههای جانبی بودجه شما را هدر میدهند. این ابزار به شما قدرت تصمیمگیری بر اساس اعداد را میدهد."})]})]})]}),"pricing-rules":o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"p-5 bg-primary-50/50 rounded-[2rem] border border-primary-100 flex items-start gap-4",children:[o.jsx("div",{className:"p-3 bg-white rounded-2xl text-primary-600 shadow-sm border border-primary-50",children:o.jsx(Hr,{size:24})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"font-black text-slate-800 text-sm mb-1",children:"اتوماسیون قیمت (Automation)"}),o.jsx("p",{className:"text-xs text-slate-500 leading-relaxed italic",children:"تنظیم قوانین هوشمند برای تغییر خودکار قیمتها بر اساس موجودی یا زمان."})]})]}),o.jsxs("div",{className:"p-5 bg-amber-50/30 rounded-[2rem] border border-amber-100/50 space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2 text-amber-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(ng,{size:14}),o.jsx("span",{children:"یک مثال واقعی (Case Study)"})]}),o.jsx("div",{className:"p-4 bg-white/70 rounded-2xl border border-amber-100 text-xs text-slate-700 leading-relaxed text-justify",children:"میخواهید قانونی بگذارید که اگر موجودی محصولی از ۱۰ عدد کمتر شد، قیمت آن ۱۵٪ افزایش یابد تا از اتمام زودهنگام کالا جلوگیری کنید. اتوماسیون این کار را ۲۴ ساعته برایتان انجام میدهد."})]})]}),"import-export":o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"p-5 bg-primary-50/50 rounded-[2rem] border border-primary-100 flex items-start gap-4",children:[o.jsx("div",{className:"p-3 bg-white rounded-2xl text-primary-600 shadow-sm border border-primary-50",children:o.jsx(jk,{size:24})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"font-black text-slate-800 text-sm mb-1",children:"درونریزی و برونریزی (Migration)"}),o.jsx("p",{className:"text-xs text-slate-500 leading-relaxed italic",children:"انتقال فوق سریع دادهها بین اکسل و ووکامرس با نگاشت (Mapping) هوشمند فیلدها."})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-rose-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(Fu,{size:14}),o.jsx("span",{children:"این ابزار چیکار میکنه؟"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:"این بخش پل ارتباطی بین فروشگاه شما و سایر نرمافزارها (مانند سیستمهای حسابداری) است. میتوانید کل محصولات خود را به صورت فایل CSV خروجی بگیرید یا هزاران محصول جدید را در چند ثانیه وارد سایت کنید."})]}),o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-emerald-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(eu,{size:14}),o.jsx("span",{children:"چه سودی برای شما دارد؟"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:'رهایی از تایپ تکراری! اگر لیست قیمت جدیدی از تامینکننده دریافت کردید، نیازی به باز کردن تکتک محصولات نیست. کافیست از ابزار "درونریزی" استفاده کنید تا دیتابیس شما در یک چشم به هم زدن آپدیت شود.'})]})]})]}),customers:o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"p-5 bg-primary-50/50 rounded-[2rem] border border-primary-100 flex items-start gap-4",children:[o.jsx("div",{className:"p-3 bg-white rounded-2xl text-primary-600 shadow-sm border border-primary-50",children:o.jsx(Ik,{size:24})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"font-black text-slate-800 text-sm mb-1",children:"تحلیل مشتریان (Customer Insights)"}),o.jsx("p",{className:"text-xs text-slate-500 leading-relaxed italic",children:"شناسایی هوشمند مشتریان وفادار، پیگیری رفتار خرید و تحلیل ارزش طول عمر مشتری (LTV)."})]})]}),o.jsxs("div",{className:"p-5 bg-amber-50/30 rounded-[2rem] border border-amber-100/50 space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2 text-amber-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(ng,{size:14}),o.jsx("span",{children:"یک مثال واقعی (Case Study)"})]}),o.jsx("div",{className:"p-4 bg-white/70 rounded-2xl border border-amber-100 text-xs text-slate-700 leading-relaxed text-justify",children:"میخواهید بدانید کدام مشتریان در ۳ ماه اخیر بیش از ۱۰ میلیون تومان خرید کردهاند تا برای آنها کد تخفیف اختصاصی بفرستید. این بخش دقیقاً این لیست را در اختیار شما قرار میدهد."})]})]}),history:o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"p-5 bg-primary-50/50 rounded-[2rem] border border-primary-100 flex items-start gap-4",children:[o.jsx("div",{className:"p-3 bg-white rounded-2xl text-primary-600 shadow-sm border border-primary-50",children:o.jsx(k1,{size:24})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"font-black text-slate-800 text-sm mb-1",children:"گزارش تغییرات (Audit Logs)"}),o.jsx("p",{className:"text-xs text-slate-500 leading-relaxed italic",children:"جعبه سیاه فروشگاه شما! ثبت تمام جزئیات تغییرات و قابلیت بازگردانی (Undo) در هر زمان."})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-rose-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(og,{size:14}),o.jsx("span",{children:"امنیت و آرامش خاطر"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:'هر تغییری که توسط ادمینها یا مدیران فروشگاه انجام شود با ذکر زمان، کاربر و مقدار قبلی/جدید ثبت میشود. اگر اشتباهی رخ دهد، دکمه "بازگردانی" منتظر شماست.'})]}),o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-emerald-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(wae,{size:14}),o.jsx("span",{children:"ردیابی دقیق"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:"میتوانید فیلتر کنید که در یک تاریخ خاص چه محصولاتی تغییر کردهاند. این برای مدیریت تیمهای بزرگ و نظارت بر عملکرد اپراتورها حیاتی است."})]})]})]}),orders:o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"p-5 bg-primary-50/50 rounded-[2rem] border border-primary-100 flex items-start gap-4",children:[o.jsx("div",{className:"p-3 bg-white rounded-2xl text-primary-600 shadow-sm border border-primary-50",children:o.jsx(Da,{size:24})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"font-black text-slate-800 text-sm mb-1",children:"مدیریت سفارشات (Order Grid)"}),o.jsx("p",{className:"text-xs text-slate-500 leading-relaxed italic",children:"نمای اکسلی سفارشات برای بررسی سریع وضعیت، کد رهگیری و تغییرات انبوه."})]})]}),o.jsxs("div",{className:"p-5 bg-amber-50/30 rounded-[2rem] border border-amber-100/50 space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2 text-amber-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(ng,{size:14}),o.jsx("span",{children:"یک مثال واقعی (Case Study)"})]}),o.jsx("div",{className:"p-4 bg-white/70 rounded-2xl border border-amber-100 text-xs text-slate-700 leading-relaxed text-justify",children:'امروز ۵۰ سفارش ارسالی دارید و باید کد رهگیری پستی تمام آنها را در سیستم ثبت کنید. بهجای باز کردن ۵۰ صفحه، در این جدول کدهای رهگیری را یکی پس از دیگری وارد کرده و وضعیت را به "تکمیل شده" تغییر میدهید.'})]})]}),coupons:o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"p-5 bg-primary-50/50 rounded-[2rem] border border-primary-100 flex items-start gap-4",children:[o.jsx("div",{className:"p-3 bg-white rounded-2xl text-primary-600 shadow-sm border border-primary-50",children:o.jsx(Od,{size:24})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"font-black text-slate-800 text-sm mb-1",children:"مدیریت کوپنها (Coupon Manager)"}),o.jsx("p",{className:"text-xs text-slate-500 leading-relaxed italic",children:"ساخت و ویرایش انبوه کدهای تخفیف با تنظیمات پیشرفته محدودیت و انقضا."})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-rose-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(am,{size:14}),o.jsx("span",{children:"کمپینهای سریع"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:"میتوانید تاریخ انقضای تمام کدهای تخفیف جشنواره قبلی را تنها با یک درگ کردن (مشابه اکسل) تمدید کنید یا درصدهای تخفیف را اصلاح نمایید."})]}),o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-emerald-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(eu,{size:14}),o.jsx("span",{children:"کنترل حاشیه سود"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:"براساس تحلیلهای این بخش، میتوانید کدهایی را که بیش از حد استفاده شدهاند شناسایی و غیرفعال کنید تا تعادل مالی فروشگاه حفظ شود."})]})]})]}),templates:o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"p-5 bg-primary-50/50 rounded-[2rem] border border-primary-100 flex items-start gap-4",children:[o.jsx("div",{className:"p-3 bg-white rounded-2xl text-primary-600 shadow-sm border border-primary-50",children:o.jsx(Sx,{size:24})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"font-black text-slate-800 text-sm mb-1",children:"سیستم سئو (SEO Automation)"}),o.jsx("p",{className:"text-xs text-slate-500 leading-relaxed italic",children:"اتصال هوشمند به RankMath و Yoast برای تولید خودکار تگهای Title و Meta Description."})]})]}),o.jsxs("div",{className:"p-5 bg-amber-50/30 rounded-[2rem] border border-amber-100/50 space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2 text-amber-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(ng,{size:14}),o.jsx("span",{children:"یک مثال واقعی (Case Study)"})]}),o.jsx("div",{className:"p-4 bg-white/70 rounded-2xl border border-amber-100 text-xs text-slate-700 leading-relaxed text-justify",children:'میخواهید تمام محصولات سایت عنوانی با فرمت "[نام محصول] | خرید با بهترین قیمت از [نام فروشگاه]" داشته باشند. کافیست یک قالب تعریف کنید تا ووکامرسا آن را روی هزاران محصول اعمال کند.'})]})]}),settings:o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"p-5 bg-primary-50/50 rounded-[2rem] border border-primary-100 flex items-start gap-4",children:[o.jsx("div",{className:"p-3 bg-white rounded-2xl text-primary-600 shadow-sm border border-primary-50",children:o.jsx(sg,{size:24})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"font-black text-slate-800 text-sm mb-1",children:"تنظیمات اصلی (Configuration)"}),o.jsx("p",{className:"text-xs text-slate-500 leading-relaxed italic",children:"سفارشیسازی کامل رفتار افزونه، امنیت، سطوح دسترسی و ظاهر محیط اختصاصی بوم."})]})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-center italic",children:"در این بخش میتوانید مشخص کنید کدام نقشهای کاربری به ووکامرسا دسترسی داشته باشند و نحوه تعامل افزونه با دیتابیس را بهینه کنید."})]}),"abandoned-carts":o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"p-5 bg-primary-50/50 rounded-[2rem] border border-primary-100 flex items-start gap-4",children:[o.jsx("div",{className:"p-3 bg-white rounded-2xl text-primary-600 shadow-sm border border-primary-50",children:o.jsx(Da,{size:24})}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"font-black text-slate-800 text-sm mb-1",children:"سبد خرید رها شده (Abandoned Cart Recovery)"}),o.jsx("p",{className:"text-xs text-slate-500 leading-relaxed italic",children:"بازگردانی هوشمند مشتریانی که در میانه راه خرید را رها کردهاند با استفاده از پیامکهای یادآوری."})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-emerald-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(eu,{size:14}),o.jsx("span",{children:"چرا این بخش مهم است؟"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:"طبق آمار، بیش از ۷۰٪ سبدهای خرید رها میشوند. این سیستم با ارسال پیامک در زمانهای طلایی، مشتری را به سایت بازگردانده و فروش شما را بدون نیاز به تبلیغات جدید افزایش میدهد."})]}),o.jsxs("div",{className:"p-5 bg-slate-50 rounded-2xl border border-slate-100 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-rose-600 font-black text-[10px] uppercase tracking-widest",children:[o.jsx(Fu,{size:14}),o.jsx("span",{children:"عملکرد هوشمند"})]}),o.jsx("p",{className:"text-xs text-slate-600 leading-relaxed text-justify",children:"سیستم به محض اینکه کاربر شماره خود را وارد کند، آن را ردیابی کرده و در صورت عدم تکمیل خرید، در بازههای زمانی ۶ ساعت تا ۷ روز (به انتخاب شما) یادآوری ارسال میکند."})]})]})]})},L3e=()=>{var ir,kn,Kt,zt,Wt,en,tn,mn,dn;W.useEffect(()=>{console.log("WooCommersa App v2.0.0 Loaded")},[]);const[t,e]=W.useState("spreadsheet"),[n,r]=W.useState(void 0),[i,s]=W.useState(""),[a,u]=W.useState(""),[h,m]=W.useState(1),[g,y]=W.useState(25),[x,C]=W.useState(""),[E,M]=W.useState(""),[j,L]=W.useState(""),[D,z]=W.useState([]),[H,V]=W.useState([]),[F,B]=W.useState(null),[te,ve]=W.useState({}),[ce,_e]=W.useState({}),[pe,Le]=W.useState([]),[Fe,nt]=W.useState([]),[dt,$e]=W.useState(!1),[Re,Ze]=W.useState(!1),[Ee,Q]=W.useState(0),[fe,Ve]=W.useState([]),[ne,xe]=W.useState(null),[Ke,qe]=W.useState(!!((ir=window.woocommersa_data)!=null&&ir.isCanvas)),[we,k]=W.useState(!1),_=!!((kn=window.woocommersa_data)!=null&&kn.isCanvas),N=!!((Kt=window.woocommersa_data)!=null&&Kt.isPos),O=(_?0:32)+80+56,G=W.useRef(null),q=W.useRef(!0),[I,Z]=W.useState(!1),[U,re]=W.useState(!1),ae=W.useRef({isDown:!1,startX:0,scrollLeft:0}),[he]=W.useState({state:"online",label:"سیستم آنلاین",icon:o.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-500 animate-pulse shadow-[0_0_8px_theme('colors.emerald.500')]"})}),Me=Ne=>Ne.length?`${Ne[0].id}_${Ne[0].desc?"desc":"asc"}`:"",tt=Ne=>{if(!Ne)return[];const oe=Ne.split("_");return oe.length<2?[]:[{id:oe[0],desc:oe[1]==="desc"}]},ot=Ne=>({spreadsheet:"ویرایش اکسلی","bulk-edit":"ویرایش گروهی","bulk-images":"ویرایش تصاویر",coupons:"مدیریت کوپنها",orders:"پیگیری سفارشات",customers:"لیست مشتریان","pricing-rules":"قوانین قیمتگذاری",history:"تاریخچه تغییرات",health:"سلامت کاتالوگ",templates:"قالبهای سئو",profit:"آنالیز سود","import-export":"درونریزی و خروجی","abandoned-carts":"سبد خرید رها شده",settings:"تنظیمات"})[Ne]||"عمومی",lt=()=>{if(G.current){const{scrollLeft:Ne,scrollWidth:oe,clientWidth:Ae}=G.current,Je=Math.abs(Ne);re(Je>10),Z(Je+Ae<oe-10)}},X=Ne=>{G.current&&(G.current.scrollBy({left:Ne,behavior:"smooth"}),setTimeout(lt,400))},{products:de,total:Ce,loading:Oe,refetch:Ge,setProducts:Qe}=D3e({page:h,perPage:g,search:a,activeFilter:i,selectedCategory:x,stockStatus:j,smartFilterRules:Fe,sorting:fe,selectedVendor:E});W.useEffect(()=>{const Ne=setTimeout(lt,500);return window.addEventListener("resize",lt),()=>{clearTimeout(Ne),window.removeEventListener("resize",lt)}},[]),W.useEffect(()=>{if(Ke)return;const Ne=G.current;if(!Ne){console.warn("WooCommersa: Horizontal menu element not found.");return}console.log("WooCommersa: Attaching horizontal menu listeners...",{isCanvas:_});const oe=Vt=>{Ne&&Ne.scrollWidth>Ne.clientWidth&&(Vt.preventDefault(),Ne.scrollBy({left:Vt.deltaY,behavior:"smooth"}),setTimeout(lt,150))};Ne.addEventListener("wheel",oe,{passive:!1});let Ae,Je,vt;return Ne.scrollWidth>Ne.clientWidth&&(vt=setTimeout(()=>{if(!Ne||!G.current||Ne.scrollWidth<=Ne.clientWidth)return;console.log("WooCommersa: Starting wiggle effect...");const Vt=Ne.scrollLeft,$t=-200,jt=1200,Ft=performance.now(),Ct=ge=>{const ct=ge-Ft,xt=Math.min(ct/jt,1),Bn=xt<.5?4*xt*xt*xt:1-Math.pow(-2*xt+2,3)/2;if(Ne&&(Ne.scrollLeft=Vt+$t*Bn),xt<1)Ae=requestAnimationFrame(Ct);else{const vn=performance.now(),Sn=Bt=>{const Tr=Bt-vn,dr=Math.min(Tr/jt,1),Sr=dr<.5?4*dr*dr*dr:1-Math.pow(-2*dr+2,3)/2;Ne&&(Ne.scrollLeft=Vt+$t-$t*Sr),dr<1?Je=requestAnimationFrame(Sn):lt()};Je=requestAnimationFrame(Sn)}};Ae=requestAnimationFrame(Ct)},3e3)),()=>{if(vt&&clearTimeout(vt),Ae&&cancelAnimationFrame(Ae),Je&&cancelAnimationFrame(Je),Ne&&typeof Ne.removeEventListener=="function")try{Ne.removeEventListener("wheel",oe)}catch{}}},[Ke,_]),W.useEffect(()=>{!_&&!localStorage.getItem("wm_canvas_suggested")&&k(!0)},[_]);const se=()=>{localStorage.setItem("wm_canvas_suggested","1"),k(!1),e("settings"),setTimeout(()=>{const Ne=document.getElementById("setting-canvas-mode");Ne&&Ne.scrollIntoView({behavior:"smooth"})},500)},ie=()=>{nt([]),u(""),m(1),ze.success("فیلترها پاک شدند")},J=(Ne,oe)=>{e(Ne),r(oe||void 0)};W.useEffect(()=>{if(Ke){const Ne=setTimeout(()=>qe(!1),2e3);return()=>clearTimeout(Ne)}},[Ke]),W.useEffect(()=>{me(),Se();const Ne=new URLSearchParams(window.location.search),oe=Ne.get("tab"),Ae=Ne.get("sort"),Je=Ne.get("p");oe&&e(oe),Ae&&Ve(tt(Ae)),Je&&m(parseInt(Je))},[]),W.useEffect(()=>{if(q.current){q.current=!1;return}const Ne=new URLSearchParams;t!=="spreadsheet"&&Ne.set("tab",t),fe.length&&Ne.set("sort",Me(fe)),h>1&&Ne.set("p",String(h));const oe=`${window.location.pathname}${Ne.toString()?"?"+Ne.toString():""}`;window.history.replaceState({tab:t},"",oe)},[t,fe,h]),W.useEffect(()=>{window.scrollTo({top:0,behavior:"auto"})},[t]);const me=async()=>{try{const oe=await(await fetch(`${window.woocommersa_data.apiUrl}/categories`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();z(Array.isArray(oe==null?void 0:oe.data)?oe.data:Array.isArray(oe)?oe:[])}catch(Ne){console.error(Ne)}},Se=async()=>{try{const oe=await(await fetch(`${window.woocommersa_data.apiUrl}/settings`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();B(oe)}catch(Ne){console.error(Ne)}},je=async Ne=>{try{const oe=new URLSearchParams;Ne&&(typeof Ne=="string"?oe.append("type",Ne):Object.entries(Ne).forEach(([Vt,$t])=>{$t&&oe.append(Vt,$t)}));const Ae=`${window.woocommersa_data.apiUrl}/history${oe.toString()?"?"+oe.toString():""}`,vt=await(await fetch(Ae,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();V(Array.isArray(vt==null?void 0:vt.data)?vt.data:Array.isArray(vt)?vt:[])}catch(oe){console.error("WooCommersa History Error:",oe)}},Pe=async Ne=>{const oe=ze.loading("در حال بازگردانی...");try{(await fetch(`${window.woocommersa_data.apiUrl}/history/rollback`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({id:Ne})})).ok?(ze.success("موفق",{id:oe}),je(),Ge()):ze.error("خطا",{id:oe})}catch{ze.error("خطا")}};W.useEffect(()=>{const Ne=async()=>{const oe=de.filter(Ae=>Ae.type==="variable"&&!ce[Ae.id]).map(Ae=>Ae.id);if(oe.length)try{const Je=await(await fetch(`${window.woocommersa_data.apiUrl}/products/variations?parent_ids=${oe.join(",")}`,{headers:{"X-WP-Nonce":window.woocommersa_data.nonce}})).json();_e(vt=>({...vt,...Je}))}catch(Ae){console.error(Ae)}};de.length&&(t==="spreadsheet"||t==="bulk-edit")&&Ne()},[de,t,ce]);const ut=async(Ne,oe,Ae)=>{const Je=de.find($t=>$t.id===Ne)||Object.values(ce).flat().find($t=>$t.id===Ne);if(!Je)return;const vt=(F==null?void 0:F.save_mode)||"auto";let Vt=[Ne];if(Je.parent_id&&["regular_price","sale_price","stock_status","manage_stock","stock"].includes(oe)&&window.confirm("آیا مایلید این تغییر روی تمامی متغیرهای این محصول اعمال شود؟")){const $t=ce[Je.parent_id]||[];$t.length&&(Vt=$t.map(jt=>jt.id))}if(Qe($t=>$t.map(jt=>Vt.includes(jt.id)?{...jt,[oe]:Ae}:jt)),_e($t=>{const jt={...$t};return Object.keys(jt).forEach(Ft=>{jt[Number(Ft)]=jt[Number(Ft)].map(Ct=>Vt.includes(Ct.id)?{...Ct,[oe]:Ae}:Ct)}),jt}),vt==="manual"){Vt.forEach($t=>{ve(jt=>({...jt,[`${$t}_${oe}`]:{id:$t,field:oe,value:Ae}}))});return}try{if(!(await fetch(`${window.woocommersa_data.apiUrl}/products/batch-save`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({products:Vt.map(jt=>({id:jt,changes:{[oe]:Ae}}))})})).ok){ze.error("خطا در ذخیره سازی");return}ze.success("تغییرات اعمال شد",{id:`s-${Ne}-${oe}`,duration:1e3})}catch{ze.error("خطای شبکه")}},wt=async()=>{if((F==null?void 0:F.table_mode)==="excel"&&window.triggerSpreadsheetSave){await window.triggerSpreadsheetSave(),Q(0);return}const Ne=Object.values(te);if(!Ne.length)return;const oe={};Ne.forEach(vt=>{oe[vt.id]={...oe[vt.id],[vt.field]:vt.value}});const Ae=Object.keys(oe).map(vt=>({id:parseInt(vt),changes:oe[vt]})),Je=ze.loading("در حال ذخیره...");try{(await fetch(`${window.woocommersa_data.apiUrl}/products/batch-save`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({products:Ae})})).ok?(ze.success("ذخیره شد",{id:Je}),ve({})):ze.error("خطا")}catch{ze.error("خطا")}},kt=async Ne=>{const oe=ze.loading("ذخیره گروهی...");try{(await fetch(`${window.woocommersa_data.apiUrl}/products/batch-save`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({products:Ne})})).ok?(ze.success("ذخیره شد",{id:oe}),Ge()):ze.error("خطا")}catch{ze.error("خطا")}},Rt=async Ne=>{if(Ne._type==="bulk-edit"){e("bulk-edit");return}if(Ne._type==="delete"){if(!window.confirm(`آیا از حذف ${pe.length} محصول اطمینان دارید؟`))return;const Ae=ze.loading("در حال حذف...");try{(await fetch(`${window.woocommersa_data.apiUrl}/products/bulk-delete`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({ids:pe})})).ok?(ze.success("محصولات حذف شدند",{id:Ae}),Le([]),Ge()):ze.error("خطا در حذف",{id:Ae})}catch{ze.error("خطا در شبکه")}return}const oe=ze.loading("در حال اعمال تغییرات...");try{(await fetch(`${window.woocommersa_data.apiUrl}/products/bulk-update`,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.woocommersa_data.nonce},body:JSON.stringify({ids:pe,updates:Ne})})).ok?(ze.success("تغییرات با موفقیت اعمال شد",{id:oe}),setTimeout(Ge,500)):ze.error("خطا در اعمال تغییرات",{id:oe})}catch{ze.error("خطا در شبکه",{id:oe})}},sn=Ne=>{Ne==="heavy_images"||Ne==="no_image"?(xe(Ne),e("bulk-images")):Ne==="no_seo"?(e("templates"),m(1)):(s(Ne),e("spreadsheet"),m(1))},An=!!((zt=window.woocommersa_data)!=null&&zt.isVendor)?[{title:"پنل فروشنده",items:[{id:"spreadsheet",icon:J3[0].items[0].icon,label:"ویرایش اکسلی"},{id:"bulk-edit",icon:J3[1].items[0].icon,label:"ویرایش گروهی"}]}]:J3,Jn=An.flatMap(Ne=>Ne.items),Qt=(F==null?void 0:F.canvas_font)||((Wt=window.woocommersa_data)==null?void 0:Wt.canvasFont)||"system",Gt=Qt==="yekan"?"font-yekan":Qt==="vazir"?"font-vazir":Qt==="iransans"?"font-iransans":"font-system";return N?o.jsx("div",{id:"woocommersa-app-root",className:Gt,dir:"rtl",children:o.jsx(I3e,{})}):Ke?o.jsxs("div",{className:`fixed inset-0 bg-[#0F172A] z-[99999] flex flex-col items-center justify-center ${Gt} text-white`,children:[o.jsx("div",{className:"wm-splash-loader mb-12"}),o.jsxs("div",{className:"flex flex-col items-center",children:[o.jsx("h2",{className:"text-4xl font-black tracking-widest bg-gradient-to-r from-white to-slate-400 bg-clip-text text-transparent",children:"ووکامرسا"}),o.jsx("div",{className:"mt-4 px-3 py-1 bg-white/5 rounded-full border border-white/10",children:o.jsxs("span",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:["نسخه ",((en=window.woocommersa_data)==null?void 0:en.version)||"1.0.0"]})})]})]}):o.jsxs("div",{id:"woocommersa-app-root",className:`min-h-screen bg-slate-50 text-slate-800 ${Gt}`,dir:"rtl",style:{"--wm-sticky-top":`${O}px`},children:[o.jsx("style",{children:` .notice, .updated, .error, .update-nag, .is-dismissible { display: none !important; } #wpbody-content:has(#woocommersa-app-root) { padding: 0 !important; } #wpbody:has(#woocommersa-app-root) { background: #0F172A !important; } .wm-header-glass { margin-left: 0 !important; margin-right: 0 !important; width: 100% !important; } `}),o.jsx(eme,{position:"top-right"})," ",o.jsx(A3e,{}),o.jsx("header",{className:"wm-header-glass sticky z-[1000] shadow-xl",style:{top:_?0:32},children:o.jsxs("div",{className:"wm-container h-24 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-12",children:[o.jsxs("div",{className:"flex items-center gap-5 cursor-pointer",onClick:()=>e("spreadsheet"),children:[o.jsx("div",{className:"w-12 h-12 bg-white/10 rounded-2xl flex items-center justify-center ring-1 ring-white/20",children:o.jsx(AU,{className:"text-primary-500 w-7 h-7"})}),o.jsx("h1",{className:"text-2xl font-black text-white",children:"ووکامرسا"})]}),o.jsx("nav",{className:"hidden xl:flex gap-2",children:An.map(Ne=>{const oe=Ne.items.some(Ae=>Ae.id===t);return o.jsxs("div",{className:"relative group px-1",children:[o.jsxs("div",{onClick:()=>e(Ne.items[0].id),className:`px-4 py-2.5 rounded-xl transition-all cursor-pointer font-black flex items-center gap-2 ${oe?"bg-primary-50 text-primary-600":"text-slate-400 hover:text-white hover:bg-white/5"}`,children:[Ne.title,o.jsx(Xp,{size:14,className:`transition-transform duration-300 ${oe?"text-primary-400":"text-slate-500"} group-hover:rotate-180`})]}),o.jsx("div",{className:"absolute right-0 top-full pt-2 opacity-0 group-hover:opacity-100 transition-all z-[1100] translate-y-2 group-hover:translate-y-0 pointer-events-none group-hover:pointer-events-auto",children:o.jsx("div",{className:"bg-white rounded-2xl shadow-2xl border border-slate-100 p-2 min-w-[240px]",children:Ne.items.map(Ae=>o.jsxs("button",{onClick:()=>e(Ae.id),className:`w-full flex items-center gap-4 px-4 py-3.5 rounded-xl transition-all group/item ${t===Ae.id?"bg-primary-50 text-primary-600 font-black":"hover:bg-slate-50 text-slate-600"}`,children:[o.jsx("div",{className:`p-2 rounded-lg transition-colors ${t===Ae.id?"bg-white shadow-sm":"bg-slate-50 group-hover/item:bg-white"}`,children:o.jsx(Ae.icon,{size:18})}),o.jsx("span",{children:Ae.label})]},Ae.id))})})]},Ne.title)})})]}),o.jsxs("div",{className:"flex items-center gap-4",children:[!_&&(F==null?void 0:F.canvas_mode)&&o.jsxs("a",{href:window.woocommersa_data.canvasUrl||"#",className:"hidden lg:flex h-10 px-4 bg-primary-600 hover:bg-primary-700 text-white rounded-xl items-center gap-2 transition-all shadow-lg shadow-primary-600/20 active:scale-95 no-underline",children:[o.jsx(am,{size:16}),o.jsx("span",{className:"text-[11px] font-black",children:"محیط اختصاصی"})]}),!_&&(F==null?void 0:F.pos_enabled)&&o.jsxs("a",{href:window.woocommersa_data.posUrl||"#",target:"_blank",rel:"noreferrer",className:"hidden lg:flex h-10 px-4 bg-emerald-600 hover:bg-emerald-700 text-white rounded-xl items-center gap-2 transition-all shadow-lg shadow-emerald-600/20 active:scale-95 no-underline",children:[o.jsx(Da,{className:"w-4 h-4"}),o.jsx("span",{className:"text-[11px] font-black",children:"میز فروش حضوری"})]}),o.jsxs("div",{className:"hidden md:flex h-10 px-4 bg-white/5 rounded-xl border border-white/10 items-center gap-3",children:[he.icon,o.jsx("span",{className:"text-[12px] font-black text-slate-300",children:he.label})]}),o.jsxs("button",{onClick:()=>Ze(!0),className:"h-10 px-4 bg-white/5 hover:bg-white/10 text-slate-400 hover:text-white rounded-xl border border-white/10 transition-all flex items-center gap-2 group",children:[o.jsxs("span",{className:"text-[10px] font-black hidden sm:inline",children:["راهنمای ",ot(t)]}),o.jsxs("div",{className:"w-6 h-6 rounded-lg bg-white/10 flex items-center justify-center group-hover:bg-primary-500/20 transition-colors",children:[o.jsx(tg,{size:14,className:"text-white hidden"}),o.jsx(am,{size:14,className:"text-white hidden"}),o.jsx(AU,{size:14,className:"text-white hidden"}),o.jsx(Cx,{size:14,className:"text-white group-hover:text-primary-500 transition-colors"})]})]})]})]})}),o.jsx("div",{className:"wm-header-glass sticky z-[990] transition-all duration-300 border-t border-white/5 shadow-2xl",style:{top:(_?0:32)+96},children:o.jsxs("div",{className:"wm-container h-16 flex items-center justify-between gap-3 overflow-hidden px-2",children:[o.jsx("div",{className:"shrink-0 flex items-center",children:o.jsx("button",{onClick:Ne=>{Ne.preventDefault(),X(200)},style:{opacity:U?1:.3,pointerEvents:U?"auto":"none"},className:"w-10 h-10 bg-white shadow-premium border border-slate-100 rounded-full flex items-center justify-center cursor-pointer hover:bg-slate-50 active:scale-95 transition-all",children:o.jsx(f0,{size:20,className:"text-slate-600"})})}),o.jsx("div",{ref:G,onMouseDown:Ne=>{G.current&&(ae.current={isDown:!0,startX:Ne.pageX-G.current.offsetLeft,scrollLeft:G.current.scrollLeft})},onMouseLeave:()=>{ae.current.isDown=!1},onMouseUp:()=>{ae.current.isDown=!1},onMouseMove:Ne=>{if(!ae.current.isDown||!G.current)return;Ne.preventDefault();const Ae=(Ne.pageX-G.current.offsetLeft-ae.current.startX)*1.5;G.current.scrollLeft=ae.current.scrollLeft-Ae,lt()},className:"h-full flex-1 flex items-center justify-start overflow-x-auto no-scrollbar py-2 gap-1 relative",children:Jn.map(Ne=>o.jsxs("button",{onClick:()=>e(Ne.id),className:`flex shrink-0 items-center gap-2 px-6 py-2.5 rounded-xl transition-all whitespace-nowrap text-[13px] font-black ${t===Ne.id?"bg-primary-600 text-white shadow-premium":"text-slate-500 hover:bg-slate-100 hover:text-slate-900"}`,children:[o.jsx(Ne.icon,{size:16}),Ne.label]},Ne.id))}),o.jsx("div",{className:"shrink-0 flex items-center",children:o.jsx("button",{onClick:Ne=>{Ne.preventDefault(),X(-200)},style:{opacity:I?1:.3,pointerEvents:I?"auto":"none"},className:"w-10 h-10 bg-white shadow-premium border border-slate-100 rounded-full flex items-center justify-center cursor-pointer hover:bg-slate-50 active:scale-95 transition-all",children:o.jsx(N1,{size:20,className:"text-slate-600"})})})]})}),o.jsx("main",{className:"wm-container min-h-[600px] py-10 relative",children:o.jsxs(tr,{mode:"popLayout",children:[t==="spreadsheet"&&o.jsxs(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"space-y-8",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[o.jsxs("div",{className:"relative flex-[2] min-w-[280px]",children:[o.jsx(Ia,{className:"absolute right-6 top-1/2 -translate-y-1/2 text-slate-400 z-10",size:20}),o.jsx("input",{type:"text",placeholder:"جستجوی پیشرفته...",value:a,onChange:Ne=>{u(Ne.target.value),m(1)},className:"wm-input !pr-24 !pl-4 h-14"}),o.jsx("button",{onClick:Ge,className:"absolute left-1.5 top-1.5 bottom-1.5 w-11 bg-primary-600 text-white rounded-xl flex items-center justify-center",children:Oe?o.jsx(ur,{className:"animate-spin",size:18}):o.jsx(Ia,{size:18})})]}),o.jsx("div",{className:"relative flex-[1.5] min-w-[160px]",children:o.jsxs("select",{value:x,onChange:Ne=>{C(Ne.target.value),m(1)},className:"wm-select h-14 w-full cursor-pointer",children:[o.jsx("option",{value:"",children:"همه دستهبندیها"}),D.map(Ne=>o.jsx("option",{value:Ne.slug,children:Ne.name},Ne.id))]})}),o.jsx("div",{className:"relative flex-1 min-w-[140px]",children:o.jsxs("select",{value:j,onChange:Ne=>{L(Ne.target.value),m(1)},className:"wm-select h-14 w-full cursor-pointer",children:[o.jsx("option",{value:"",children:"وضعیت موجودی"}),o.jsx("option",{value:"instock",children:"موجود"}),o.jsx("option",{value:"outofstock",children:"ناموجود"}),o.jsx("option",{value:"onbackorder",children:"پیشخرید"})]})}),((tn=window.woocommersa_data)==null?void 0:tn.hasDokan)&&!((mn=window.woocommersa_data)!=null&&mn.isVendor)&&o.jsx("div",{className:"relative flex-1 min-w-[140px]",children:o.jsxs("select",{value:E,onChange:Ne=>{M(Ne.target.value),m(1)},className:"wm-select h-14 w-full cursor-pointer",children:[o.jsx("option",{value:"",children:"همه فروشندگان"}),(((dn=window.woocommersa_data)==null?void 0:dn.vendorsList)||[]).map(Ne=>o.jsx("option",{value:Ne.id,children:Ne.name},Ne.id))]})}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{onClick:()=>$e(!0),className:`h-14 px-6 bg-white border border-slate-200 rounded-2xl flex items-center gap-3 ${Fe.length>0?"border-primary-500 bg-primary-50/10":""}`,children:[o.jsx(Rx,{size:18})," فیلتر هوشمند"]}),(Fe.length>0||a)&&o.jsx("button",{onClick:ie,className:"w-14 h-14 bg-rose-50 text-rose-500 border border-rose-100 rounded-2xl flex items-center justify-center",children:o.jsx(zu,{size:20})})]}),o.jsxs("div",{className:"flex bg-slate-100 p-1.5 rounded-2xl border border-slate-200 h-14 items-center",children:[o.jsxs("button",{onClick:()=>B({...F,table_mode:"excel"}),className:`h-full px-5 flex items-center gap-2 rounded-xl text-xs font-black transition-all ${(F==null?void 0:F.table_mode)==="excel"?"bg-white text-primary-600 shadow-md":"text-slate-500 hover:text-slate-700"}`,children:[o.jsx(n2,{size:16})," اکسل"]}),o.jsxs("button",{onClick:()=>B({...F,table_mode:"simple"}),className:`h-full px-5 flex items-center gap-2 rounded-xl text-xs font-black transition-all ${(F==null?void 0:F.table_mode)!=="excel"?"bg-white text-primary-600 shadow-md":"text-slate-500 hover:text-slate-700"}`,children:[o.jsx(tg,{size:16})," ساده"]})]}),o.jsxs("div",{className:"flex bg-slate-100 p-1.5 rounded-2xl border border-slate-200 h-14 items-center",title:"نحوه ذخیره سازی",children:[o.jsx("button",{onClick:()=>B({...F,save_mode:"auto"}),className:`h-full px-4 flex items-center gap-2 rounded-xl text-[11px] font-black transition-all ${(F==null?void 0:F.save_mode)!=="manual"?"bg-white text-primary-600 shadow-md":"text-slate-500 hover:text-slate-700"}`,children:"خودکار"}),o.jsx("button",{onClick:()=>B({...F,save_mode:"manual"}),className:`h-full px-4 flex items-center gap-2 rounded-xl text-[11px] font-black transition-all ${(F==null?void 0:F.save_mode)==="manual"?"bg-white text-primary-600 shadow-md":"text-slate-500 hover:text-slate-700"}`,children:"دستی"})]}),o.jsx("div",{className:"relative w-28",children:o.jsx("select",{value:g,onChange:Ne=>{y(Number(Ne.target.value)),m(1)},className:"wm-select h-14 w-full cursor-pointer",children:[25,50,100,200].map(Ne=>o.jsxs("option",{value:Ne,children:[Ne," ردیف"]},Ne))})})]}),o.jsxs("div",{className:"bg-white rounded-3xl shadow-2xl border border-slate-200 flex flex-col",children:[(F==null?void 0:F.table_mode)==="excel"?o.jsx(M3e,{data:de,variations:ce,onSaveBatch:kt,settings:F,onPendingChangeCount:Q,categories:D,selectedIds:pe,onSelectionChange:Le},`excel-view-${h}`):o.jsx(DH,{data:de,variations:ce,updateData:ut,settings:F,selectedIds:pe,onSelectionChange:Le,onSortingChange:Ve},`simple-view-${h}`),o.jsxs("div",{className:"p-6 border-t border-slate-100 bg-slate-50/50 flex items-center justify-between",children:[o.jsxs("div",{className:"text-sm font-bold text-slate-500",children:["محصولات (",de.length," از ",Ce,")"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{disabled:h===1,onClick:()=>m(Ne=>Ne-1),className:"px-6 py-2 bg-white border border-slate-200 rounded-xl",children:"قبلی"}),o.jsx("span",{className:"font-bold text-primary-600 px-4",children:h}),o.jsx("button",{disabled:de.length<g,onClick:()=>m(Ne=>Ne+1),className:"px-6 py-2 bg-white border border-slate-200 rounded-xl",children:"بعدی"})]})]})]}),o.jsx("div",{className:"fixed bottom-10 left-1/2 -translate-x-1/2 z-[200]",children:o.jsx(FH,{selectedCount:pe.length,onApply:Rt})}),o.jsxs(tr,{children:[dt&&o.jsx("div",{className:"fixed inset-0 z-[5000] flex items-center justify-center p-8 bg-slate-900/40 backdrop-blur-md",children:o.jsx(ht.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"w-full max-w-4xl",children:o.jsx(lme,{onApply:Ne=>{nt(Ne),$e(!1)},onClose:()=>$e(!1)})})}),(Object.keys(te).length>0||Ee>0)&&(F==null?void 0:F.save_mode)==="manual"&&o.jsxs(ht.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},className:"fixed bottom-10 left-10 z-[150] shadow-2xl flex flex-col rounded-2xl overflow-hidden bg-white",children:[o.jsxs("div",{className:"bg-amber-100 text-amber-800 text-xs font-black px-4 py-2 text-center",children:[Object.keys(te).length||Ee," ذخیره نشده"]}),o.jsxs("button",{onClick:wt,className:"px-8 py-4 bg-primary-600 text-white font-black flex items-center gap-3",children:[o.jsx(Ak,{size:20})," ذخیره تغییرات"]})]})]})]},"grid"),t==="orders"&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full",children:o.jsx(dme,{})},"orders"),t==="coupons"&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full",children:o.jsx(vme,{settings:F})},"coupons"),t==="customers"&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full",children:o.jsx(pme,{})},"customers"),t==="health"&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full",children:o.jsx(nme,{onFilterRequest:sn})},"health"),t==="profit"&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full",children:o.jsx(fme,{updateData:ut,settings:F})},"profit"),t==="pricing-rules"&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full",children:o.jsx(rme,{onNavigate:J})},"pricing"),t==="templates"&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full",children:o.jsx(ime,{selectedIds:pe,settings:F,onNavigate:J})},"tpl"),t==="bulk-images"&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full",children:o.jsx(ame,{initialFilter:ne,initialProductId:n})},"bulk-images"),t==="bulk-edit"&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full",children:o.jsx(ome,{settings:F,initialSelectedIds:pe})},"bulk-edit"),t==="history"&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full",children:o.jsx(dfe,{items:H,onRollback:Pe,onFilterChange:je})},"hist"),t==="import-export"&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full",children:o.jsx(tme,{})},"ie"),t==="abandoned-carts"&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full",children:o.jsx(O3e,{onNavigate:J})},"abandoned"),t==="settings"&&o.jsx(ht.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"w-full",children:o.jsx(mme,{onSave:Se})},"settings")]})}),o.jsx(P3e,{isOpen:Re,onClose:()=>Ze(!1),title:"راهنما",content:H3e[t]||"راهنما در دسترس نیست"}),o.jsx(tr,{children:we&&o.jsx("div",{className:"wm-modal-overlay",children:o.jsxs(ht.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"wm-modal-panel",children:[o.jsx("div",{className:"wm-modal-header !bg-primary-600",children:o.jsxs("h3",{className:"text-white font-black flex items-center gap-2",children:[o.jsx(Hr,{size:20})," پیشنهاد تجربه بهتر"]})}),o.jsxs("div",{className:"wm-modal-body text-center py-10",children:[o.jsx("div",{className:"w-20 h-20 bg-primary-50 rounded-full flex items-center justify-center mx-auto mb-6 text-primary-600",children:o.jsx(am,{size:40})}),o.jsx("h4",{className:"text-xl font-black text-slate-800 mb-3",children:"حالت اپلیکیشنی را امتحان کنید!"}),o.jsx("p",{className:"text-slate-500 font-bold leading-relaxed px-4",children:'برای تجربه کاربری بهتر، سرعت بیشتر و حذف منوهای مزاحم وردپرس، پیشنهاد میکنیم از "حالت بوم اختصاصی" استفاده کنید.'})]}),o.jsxs("div",{className:"wm-modal-footer",children:[o.jsx("button",{onClick:se,className:"flex-1 wm-btn-primary",children:"فعالسازی و ورود"}),o.jsx("button",{onClick:()=>{localStorage.setItem("wm_canvas_suggested","1"),k(!1)},className:"flex-1 wm-btn-secondary",children:"بعداً"})]})]})})})]})},bre=document.getElementById("woocommersa-app");bre&&_1.createRoot(bre).render(o.jsx(bi.StrictMode,{children:o.jsx(L3e,{})}))})();