You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
984 KiB
99 lines
984 KiB
var Kh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ec(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.')}var bu=function(t){return t&&t.Math===Math&&t},xn=bu(typeof globalThis=="object"&&globalThis)||bu(typeof window=="object"&&window)||bu(typeof self=="object"&&self)||bu(typeof Kh=="object"&&Kh)||bu(typeof Kh=="object"&&Kh)||function(){return this}()||Function("return this")(),Ov={},Ci=function(t){try{return!!t()}catch{return!0}},AA=Ci,Cr=!AA(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),HA=Ci,Gg=!HA(function(){var t=function(){}.bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),NA=Gg,Xh=Function.prototype.call,vr=NA?Xh.bind(Xh):function(){return Xh.apply(Xh,arguments)},e_={},t_={}.propertyIsEnumerable,n_=Object.getOwnPropertyDescriptor,DA=n_&&!t_.call({1:2},1);e_.f=DA?function(e){var n=n_(this,e);return!!n&&n.enumerable}:t_;var jg=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}},i_=Gg,r_=Function.prototype,yC=r_.call,LA=i_&&r_.bind.bind(yC,yC),un=i_?LA:function(t){return function(){return yC.apply(t,arguments)}},s_=un,$A=s_({}.toString),kA=s_("".slice),Ba=function(t){return kA($A(t),8,-1)},FA=un,VA=Ci,WA=Ba,Km=Object,BA=FA("".split),UA=VA(function(){return!Km("z").propertyIsEnumerable(0)})?function(t){return WA(t)==="String"?BA(t,""):Km(t)}:Km,Kg=function(t){return t==null},YA=Kg,zA=TypeError,Xg=function(t){if(YA(t))throw new zA("Can't call method on "+t);return t},GA=UA,jA=Xg,qg=function(t){return GA(jA(t))},Xm=typeof document=="object"&&document.all,bn=typeof Xm>"u"&&Xm!==void 0?function(t){return typeof t=="function"||t===Xm}:function(t){return typeof t=="function"},KA=bn,ns=function(t){return typeof t=="object"?t!==null:KA(t)},qm=xn,XA=bn,qA=function(t){return XA(t)?t:void 0},lu=function(t,e){return arguments.length<2?qA(qm[t]):qm[t]&&qm[t][e]},ZA=un,Zg=ZA({}.isPrototypeOf),xv=typeof navigator<"u"&&String(navigator.userAgent)||"",o_=xn,Zm=xv,yR=o_.process,bR=o_.Deno,RR=yR&&yR.versions||bR&&bR.version,ER=RR&&RR.v8,lr,tg;ER&&(lr=ER.split("."),tg=lr[0]>0&&lr[0]<4?1:+(lr[0]+lr[1]));!tg&&Zm&&(lr=Zm.match(/Edge\/(\d+)/),(!lr||lr[1]>=74)&&(lr=Zm.match(/Chrome\/(\d+)/),lr&&(tg=+lr[1])));var QA=tg,TR=QA,JA=Ci,e1=xn,t1=e1.String,Av=!!Object.getOwnPropertySymbols&&!JA(function(){var t=Symbol("symbol detection");return!t1(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&TR&&TR<41}),n1=Av,a_=n1&&!Symbol.sham&&typeof Symbol.iterator=="symbol",i1=lu,r1=bn,s1=Zg,o1=a_,a1=Object,Hv=o1?function(t){return typeof t=="symbol"}:function(t){var e=i1("Symbol");return r1(e)&&s1(e.prototype,a1(t))},l1=String,Qg=function(t){try{return l1(t)}catch{return"Object"}},u1=bn,c1=Qg,h1=TypeError,Ch=function(t){if(u1(t))return t;throw new h1(c1(t)+" is not a function")},d1=Ch,f1=Kg,Jg=function(t,e){var n=t[e];return f1(n)?void 0:d1(n)},Qm=vr,Jm=bn,ep=ns,g1=TypeError,m1=function(t,e){var n,i;if(e==="string"&&Jm(n=t.toString)&&!ep(i=Qm(n,t))||Jm(n=t.valueOf)&&!ep(i=Qm(n,t))||e!=="string"&&Jm(n=t.toString)&&!ep(i=Qm(n,t)))return i;throw new g1("Can't convert object to primitive value")},l_={exports:{}},MR=xn,p1=Object.defineProperty,Nv=function(t,e){try{p1(MR,t,{value:e,configurable:!0,writable:!0})}catch{MR[t]=e}return e},w1=xn,C1=Nv,_R="__core-js_shared__",IR=l_.exports=w1[_R]||C1(_R,{});(IR.versions||(IR.versions=[])).push({version:"3.37.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Dv=l_.exports,PR=Dv,u_=function(t,e){return PR[t]||(PR[t]=e||{})},v1=Xg,S1=Object,vh=function(t){return S1(v1(t))},y1=un,b1=vh,R1=y1({}.hasOwnProperty),is=Object.hasOwn||function(e,n){return R1(b1(e),n)},E1=un,T1=0,M1=Math.random(),_1=E1(1 .toString),c_=function(t){return"Symbol("+(t===void 0?"":t)+")_"+_1(++T1+M1,36)},I1=xn,P1=u_,OR=is,O1=c_,x1=Av,A1=a_,Wl=I1.Symbol,tp=P1("wks"),H1=A1?Wl.for||Wl:Wl&&Wl.withoutSetter||O1,No=function(t){return OR(tp,t)||(tp[t]=x1&&OR(Wl,t)?Wl[t]:H1("Symbol."+t)),tp[t]},N1=vr,xR=ns,AR=Hv,D1=Jg,L1=m1,$1=No,k1=TypeError,F1=$1("toPrimitive"),V1=function(t,e){if(!xR(t)||AR(t))return t;var n=D1(t,F1),i;if(n){if(e===void 0&&(e="default"),i=N1(n,t,e),!xR(i)||AR(i))return i;throw new k1("Can't convert object to primitive value")}return e===void 0&&(e="number"),L1(t,e)},W1=V1,B1=Hv,h_=function(t){var e=W1(t,"string");return B1(e)?e:e+""},U1=xn,HR=ns,bC=U1.document,Y1=HR(bC)&&HR(bC.createElement),Lv=function(t){return Y1?bC.createElement(t):{}},z1=Cr,G1=Ci,j1=Lv,d_=!z1&&!G1(function(){return Object.defineProperty(j1("div"),"a",{get:function(){return 7}}).a!==7}),K1=Cr,X1=vr,q1=e_,Z1=jg,Q1=qg,J1=h_,eH=is,tH=d_,NR=Object.getOwnPropertyDescriptor;Ov.f=K1?NR:function(e,n){if(e=Q1(e),n=J1(n),tH)try{return NR(e,n)}catch{}if(eH(e,n))return Z1(!X1(q1.f,e,n),e[n])};var Do={},nH=Cr,iH=Ci,f_=nH&&iH(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),rH=ns,sH=String,oH=TypeError,Vs=function(t){if(rH(t))return t;throw new oH(sH(t)+" is not an object")},aH=Cr,lH=d_,uH=f_,qh=Vs,DR=h_,cH=TypeError,np=Object.defineProperty,hH=Object.getOwnPropertyDescriptor,ip="enumerable",rp="configurable",sp="writable";Do.f=aH?uH?function(e,n,i){if(qh(e),n=DR(n),qh(i),typeof e=="function"&&n==="prototype"&&"value"in i&&sp in i&&!i[sp]){var r=hH(e,n);r&&r[sp]&&(e[n]=i.value,i={configurable:rp in i?i[rp]:r[rp],enumerable:ip in i?i[ip]:r[ip],writable:!1})}return np(e,n,i)}:np:function(e,n,i){if(qh(e),n=DR(n),qh(i),lH)try{return np(e,n,i)}catch{}if("get"in i||"set"in i)throw new cH("Accessors not supported");return"value"in i&&(e[n]=i.value),e};var dH=Cr,fH=Do,gH=jg,Sh=dH?function(t,e,n){return fH.f(t,e,gH(1,n))}:function(t,e,n){return t[e]=n,t},g_={exports:{}},RC=Cr,mH=is,m_=Function.prototype,pH=RC&&Object.getOwnPropertyDescriptor,$v=mH(m_,"name"),wH=$v&&function(){}.name==="something",CH=$v&&(!RC||RC&&pH(m_,"name").configurable),vH={EXISTS:$v,PROPER:wH,CONFIGURABLE:CH},SH=un,yH=bn,EC=Dv,bH=SH(Function.toString);yH(EC.inspectSource)||(EC.inspectSource=function(t){return bH(t)});var RH=EC.inspectSource,EH=xn,TH=bn,LR=EH.WeakMap,MH=TH(LR)&&/native code/.test(String(LR)),_H=u_,IH=c_,$R=_H("keys"),p_=function(t){return $R[t]||($R[t]=IH(t))},kv={},PH=MH,w_=xn,OH=ns,xH=Sh,op=is,ap=Dv,AH=p_,HH=kv,kR="Object already initialized",TC=w_.TypeError,NH=w_.WeakMap,ng,Jc,ig,DH=function(t){return ig(t)?Jc(t):ng(t,{})},LH=function(t){return function(e){var n;if(!OH(e)||(n=Jc(e)).type!==t)throw new TC("Incompatible receiver, "+t+" required");return n}};if(PH||ap.state){var Rr=ap.state||(ap.state=new NH);Rr.get=Rr.get,Rr.has=Rr.has,Rr.set=Rr.set,ng=function(t,e){if(Rr.has(t))throw new TC(kR);return e.facade=t,Rr.set(t,e),e},Jc=function(t){return Rr.get(t)||{}},ig=function(t){return Rr.has(t)}}else{var Qa=AH("state");HH[Qa]=!0,ng=function(t,e){if(op(t,Qa))throw new TC(kR);return e.facade=t,xH(t,Qa,e),e},Jc=function(t){return op(t,Qa)?t[Qa]:{}},ig=function(t){return op(t,Qa)}}var $H={set:ng,get:Jc,has:ig,enforce:DH,getterFor:LH},Fv=un,kH=Ci,FH=bn,Zh=is,MC=Cr,VH=vH.CONFIGURABLE,WH=RH,C_=$H,BH=C_.enforce,UH=C_.get,FR=String,Pf=Object.defineProperty,YH=Fv("".slice),zH=Fv("".replace),GH=Fv([].join),jH=MC&&!kH(function(){return Pf(function(){},"length",{value:8}).length!==8}),KH=String(String).split("String"),XH=g_.exports=function(t,e,n){YH(FR(e),0,7)==="Symbol("&&(e="["+zH(FR(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!Zh(t,"name")||VH&&t.name!==e)&&(MC?Pf(t,"name",{value:e,configurable:!0}):t.name=e),jH&&n&&Zh(n,"arity")&&t.length!==n.arity&&Pf(t,"length",{value:n.arity});try{n&&Zh(n,"constructor")&&n.constructor?MC&&Pf(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var i=BH(t);return Zh(i,"source")||(i.source=GH(KH,typeof e=="string"?e:"")),t};Function.prototype.toString=XH(function(){return FH(this)&&UH(this).source||WH(this)},"toString");var qH=g_.exports,ZH=bn,QH=Do,JH=qH,eN=Nv,tN=function(t,e,n,i){i||(i={});var r=i.enumerable,s=i.name!==void 0?i.name:e;if(ZH(n)&&JH(n,s,i),i.global)r?t[e]=n:eN(e,n);else{try{i.unsafe?t[e]&&(r=!0):delete t[e]}catch{}r?t[e]=n:QH.f(t,e,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return t},v_={},nN=Math.ceil,iN=Math.floor,rN=Math.trunc||function(e){var n=+e;return(n>0?iN:nN)(n)},sN=rN,em=function(t){var e=+t;return e!==e||e===0?0:sN(e)},oN=em,aN=Math.max,lN=Math.min,uN=function(t,e){var n=oN(t);return n<0?aN(n+e,0):lN(n,e)},cN=em,hN=Math.min,dN=function(t){var e=cN(t);return e>0?hN(e,9007199254740991):0},fN=dN,yh=function(t){return fN(t.length)},gN=qg,mN=uN,pN=yh,VR=function(t){return function(e,n,i){var r=gN(e),s=pN(r);if(s===0)return!t&&-1;var o=mN(i,s),a;if(t&&n!==n){for(;s>o;)if(a=r[o++],a!==a)return!0}else for(;s>o;o++)if((t||o in r)&&r[o]===n)return t||o||0;return!t&&-1}},wN={includes:VR(!0),indexOf:VR(!1)},CN=un,lp=is,vN=qg,SN=wN.indexOf,yN=kv,WR=CN([].push),S_=function(t,e){var n=vN(t),i=0,r=[],s;for(s in n)!lp(yN,s)&&lp(n,s)&&WR(r,s);for(;e.length>i;)lp(n,s=e[i++])&&(~SN(r,s)||WR(r,s));return r},Vv=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],bN=S_,RN=Vv,EN=RN.concat("length","prototype");v_.f=Object.getOwnPropertyNames||function(e){return bN(e,EN)};var y_={};y_.f=Object.getOwnPropertySymbols;var TN=lu,MN=un,_N=v_,IN=y_,PN=Vs,ON=MN([].concat),xN=TN("Reflect","ownKeys")||function(e){var n=_N.f(PN(e)),i=IN.f;return i?ON(n,i(e)):n},BR=is,AN=xN,HN=Ov,NN=Do,b_=function(t,e,n){for(var i=AN(e),r=NN.f,s=HN.f,o=0;o<i.length;o++){var a=i[o];!BR(t,a)&&!(n&&BR(n,a))&&r(t,a,s(e,a))}},DN=Ci,LN=bn,$N=/#|\.prototype\./,bh=function(t,e){var n=FN[kN(t)];return n===WN?!0:n===VN?!1:LN(e)?DN(e):!!e},kN=bh.normalize=function(t){return String(t).replace($N,".").toLowerCase()},FN=bh.data={},VN=bh.NATIVE="N",WN=bh.POLYFILL="P",BN=bh,Qh=xn,UN=Ov.f,YN=Sh,zN=tN,GN=Nv,jN=b_,KN=BN,An=function(t,e){var n=t.target,i=t.global,r=t.stat,s,o,a,l,u,c;if(i?o=Qh:r?o=Qh[n]||GN(n,{}):o=Qh[n]&&Qh[n].prototype,o)for(a in e){if(u=e[a],t.dontCallGetSet?(c=UN(o,a),l=c&&c.value):l=o[a],s=KN(i?a:n+(r?".":"#")+a,t.forced),!s&&l!==void 0){if(typeof u==typeof l)continue;jN(u,l)}(t.sham||l&&l.sham)&&YN(u,"sham",!0),zN(o,a,u,t)}},XN=Gg,R_=Function.prototype,UR=R_.apply,YR=R_.call,tm=typeof Reflect=="object"&&Reflect.apply||(XN?YR.bind(UR):function(){return YR.apply(UR,arguments)}),qN=un,ZN=Ch,E_=function(t,e,n){try{return qN(ZN(Object.getOwnPropertyDescriptor(t,e)[n]))}catch{}},QN=ns,JN=function(t){return QN(t)||t===null},eD=JN,tD=String,nD=TypeError,iD=function(t){if(eD(t))return t;throw new nD("Can't set "+tD(t)+" as a prototype")},rD=E_,sD=ns,oD=Xg,aD=iD,T_=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,e={},n;try{n=rD(Object.prototype,"__proto__","set"),n(e,[]),t=e instanceof Array}catch{}return function(r,s){return oD(r),aD(s),sD(r)&&(t?n(r,s):r.__proto__=s),r}}():void 0),lD=Do.f,uD=function(t,e,n){n in t||lD(t,n,{configurable:!0,get:function(){return e[n]},set:function(i){e[n]=i}})},cD=bn,hD=ns,zR=T_,dD=function(t,e,n){var i,r;return zR&&cD(i=e.constructor)&&i!==n&&hD(r=i.prototype)&&r!==n.prototype&&zR(t,r),t},fD=No,gD=fD("toStringTag"),M_={};M_[gD]="z";var mD=String(M_)==="[object z]",pD=mD,wD=bn,Of=Ba,CD=No,vD=CD("toStringTag"),SD=Object,yD=Of(function(){return arguments}())==="Arguments",bD=function(t,e){try{return t[e]}catch{}},__=pD?Of:function(t){var e,n,i;return t===void 0?"Undefined":t===null?"Null":typeof(n=bD(e=SD(t),vD))=="string"?n:yD?Of(e):(i=Of(e))==="Object"&&wD(e.callee)?"Arguments":i},RD=__,ED=String,Wv=function(t){if(RD(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return ED(t)},TD=Wv,MD=function(t,e){return t===void 0?arguments.length<2?"":e:TD(t)},_D=ns,ID=Sh,PD=function(t,e){_D(e)&&"cause"in e&&ID(t,"cause",e.cause)},OD=un,I_=Error,xD=OD("".replace),AD=function(t){return String(new I_(t).stack)}("zxcasd"),P_=/\n\s*at [^:]*:[^\n]*/,HD=P_.test(AD),ND=function(t,e){if(HD&&typeof t=="string"&&!I_.prepareStackTrace)for(;e--;)t=xD(t,P_,"");return t},DD=Ci,LD=jg,$D=!DD(function(){var t=new Error("a");return"stack"in t?(Object.defineProperty(t,"stack",LD(1,7)),t.stack!==7):!0}),kD=Sh,FD=ND,VD=$D,GR=Error.captureStackTrace,WD=function(t,e,n,i){VD&&(GR?GR(t,e):kD(t,"stack",FD(n,i)))},jR=lu,BD=is,KR=Sh,UD=Zg,XR=T_,qR=b_,ZR=uD,YD=dD,zD=MD,GD=PD,jD=WD,KD=Cr,XD=function(t,e,n,i){var r="stackTraceLimit",s=i?2:1,o=t.split("."),a=o[o.length-1],l=jR.apply(null,o);if(l){var u=l.prototype;if(BD(u,"cause")&&delete u.cause,!n)return l;var c=jR("Error"),h=e(function(d,g){var p=zD(i?g:d,void 0),C=i?new l(d):new l;return p!==void 0&&KR(C,"message",p),jD(C,h,C.stack,2),this&&UD(u,this)&&YD(C,this,h),arguments.length>s&&GD(C,arguments[s]),C});h.prototype=u,a!=="Error"?XR?XR(h,c):qR(h,c,{name:!0}):KD&&r in l&&(ZR(h,l,r),ZR(h,l,"prepareStackTrace")),qR(h,l);try{u.name!==a&&KR(u,"name",a),u.constructor=h}catch{}return h}},O_=An,qD=xn,rs=tm,x_=XD,_C="WebAssembly",QR=qD[_C],rg=new Error("e",{cause:7}).cause!==7,Ua=function(t,e){var n={};n[t]=x_(t,e,rg),O_({global:!0,constructor:!0,arity:1,forced:rg},n)},Bv=function(t,e){if(QR&&QR[t]){var n={};n[t]=x_(_C+"."+t,e,rg),O_({target:_C,stat:!0,constructor:!0,arity:1,forced:rg},n)}};Ua("Error",function(t){return function(n){return rs(t,this,arguments)}});Ua("EvalError",function(t){return function(n){return rs(t,this,arguments)}});Ua("RangeError",function(t){return function(n){return rs(t,this,arguments)}});Ua("ReferenceError",function(t){return function(n){return rs(t,this,arguments)}});Ua("SyntaxError",function(t){return function(n){return rs(t,this,arguments)}});Ua("TypeError",function(t){return function(n){return rs(t,this,arguments)}});Ua("URIError",function(t){return function(n){return rs(t,this,arguments)}});Bv("CompileError",function(t){return function(n){return rs(t,this,arguments)}});Bv("LinkError",function(t){return function(n){return rs(t,this,arguments)}});Bv("RuntimeError",function(t){return function(n){return rs(t,this,arguments)}});var ZD=Ba,A_=Array.isArray||function(e){return ZD(e)==="Array"},QD=Cr,JD=A_,eL=TypeError,tL=Object.getOwnPropertyDescriptor,nL=QD&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}(),H_=nL?function(t,e){if(JD(t)&&!tL(t,"length").writable)throw new eL("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e},iL=TypeError,rL=9007199254740991,N_=function(t){if(t>rL)throw iL("Maximum allowed index exceeded");return t},sL=An,oL=vh,aL=yh,lL=H_,uL=N_,cL=Ci,hL=cL(function(){return[].push.call({length:4294967296},1)!==4294967297}),dL=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}},fL=hL||!dL();sL({target:"Array",proto:!0,arity:1,forced:fL},{push:function(e){var n=oL(this),i=aL(n),r=arguments.length;uL(i+r);for(var s=0;s<r;s++)n[i]=arguments[s],i++;return lL(n,i),i}});var up=un,Jh=Set.prototype,ss={Set,add:up(Jh.add),has:up(Jh.has),remove:up(Jh.delete),proto:Jh},gL=ss.has,Ya=function(t){return gL(t),t},mL=vr,za=function(t,e,n){for(var i=n?t:t.iterator,r=t.next,s,o;!(s=mL(r,i)).done;)if(o=e(s.value),o!==void 0)return o},D_=un,pL=za,L_=ss,wL=L_.Set,$_=L_.proto,CL=D_($_.forEach),k_=D_($_.keys),vL=k_(new wL).next,Rh=function(t,e,n){return n?pL({iterator:k_(t),next:vL},e):CL(t,e)},F_=ss,SL=Rh,yL=F_.Set,bL=F_.add,Uv=function(t){var e=new yL;return SL(t,function(n){bL(e,n)}),e},RL=E_,EL=ss,Eh=RL(EL.proto,"size","get")||function(t){return t.size},TL=function(t){return{iterator:t,next:t.next,done:!1}},JR=Ch,V_=Vs,eE=vr,ML=em,_L=TL,tE="Invalid size",IL=RangeError,PL=TypeError,OL=Math.max,W_=function(t,e){this.set=t,this.size=OL(e,0),this.has=JR(t.has),this.keys=JR(t.keys)};W_.prototype={getIterator:function(){return _L(V_(eE(this.keys,this.set)))},includes:function(t){return eE(this.has,this.set,t)}};var Ga=function(t){V_(t);var e=+t.size;if(e!==e)throw new PL(tE);var n=ML(e);if(n<0)throw new IL(tE);return new W_(t,n)},xL=Ya,B_=ss,AL=Uv,HL=Eh,NL=Ga,DL=Rh,LL=za,$L=B_.has,nE=B_.remove,kL=function(e){var n=xL(this),i=NL(e),r=AL(n);return HL(n)<=i.size?DL(n,function(s){i.includes(s)&&nE(r,s)}):LL(i.getIterator(),function(s){$L(n,s)&&nE(r,s)}),r},FL=lu,iE=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},ja=function(t){var e=FL("Set");try{new e()[t](iE(0));try{return new e()[t](iE(-1)),!1}catch{return!0}}catch{return!1}},VL=An,WL=kL,BL=ja;VL({target:"Set",proto:!0,real:!0,forced:!BL("difference")},{difference:WL});var UL=Ya,Yv=ss,YL=Eh,zL=Ga,GL=Rh,jL=za,KL=Yv.Set,rE=Yv.add,XL=Yv.has,qL=function(e){var n=UL(this),i=zL(e),r=new KL;return YL(n)>i.size?jL(i.getIterator(),function(s){XL(n,s)&&rE(r,s)}):GL(n,function(s){i.includes(s)&&rE(r,s)}),r},ZL=An,QL=Ci,JL=qL,e$=ja,t$=!e$("intersection")||QL(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});ZL({target:"Set",proto:!0,real:!0,forced:t$},{intersection:JL});var n$=vr,sE=Vs,i$=Jg,zv=function(t,e,n){var i,r;sE(t);try{if(i=i$(t,"return"),!i){if(e==="throw")throw n;return n}i=n$(i,t)}catch(s){r=!0,i=s}if(e==="throw")throw n;if(r)throw i;return sE(i),n},r$=Ya,s$=ss.has,o$=Eh,a$=Ga,l$=Rh,u$=za,c$=zv,h$=function(e){var n=r$(this),i=a$(e);if(o$(n)<=i.size)return l$(n,function(s){if(i.includes(s))return!1},!0)!==!1;var r=i.getIterator();return u$(r,function(s){if(s$(n,s))return c$(r,"normal",!1)})!==!1},d$=An,f$=h$,g$=ja;d$({target:"Set",proto:!0,real:!0,forced:!g$("isDisjointFrom")},{isDisjointFrom:f$});var m$=Ya,p$=Eh,w$=Rh,C$=Ga,v$=function(e){var n=m$(this),i=C$(e);return p$(n)>i.size?!1:w$(n,function(r){if(!i.includes(r))return!1},!0)!==!1},S$=An,y$=v$,b$=ja;S$({target:"Set",proto:!0,real:!0,forced:!b$("isSubsetOf")},{isSubsetOf:y$});var R$=Ya,E$=ss.has,T$=Eh,M$=Ga,_$=za,I$=zv,P$=function(e){var n=R$(this),i=M$(e);if(T$(n)<i.size)return!1;var r=i.getIterator();return _$(r,function(s){if(!E$(n,s))return I$(r,"normal",!1)})!==!1},O$=An,x$=P$,A$=ja;O$({target:"Set",proto:!0,real:!0,forced:!A$("isSupersetOf")},{isSupersetOf:x$});var H$=Ya,Gv=ss,N$=Uv,D$=Ga,L$=za,$$=Gv.add,k$=Gv.has,F$=Gv.remove,V$=function(e){var n=H$(this),i=D$(e).getIterator(),r=N$(n);return L$(i,function(s){k$(n,s)?F$(r,s):$$(r,s)}),r},W$=An,B$=V$,U$=ja;W$({target:"Set",proto:!0,real:!0,forced:!U$("symmetricDifference")},{symmetricDifference:B$});var Y$=Ya,z$=ss.add,G$=Uv,j$=Ga,K$=za,X$=function(e){var n=Y$(this),i=j$(e).getIterator(),r=G$(n);return K$(i,function(s){z$(r,s)}),r},q$=An,Z$=X$,Q$=ja;q$({target:"Set",proto:!0,real:!0,forced:!Q$("union")},{union:Z$});var J$=Ba,ek=un,tk=function(t){if(J$(t)==="Function")return ek(t)},oE=tk,nk=Ch,ik=Gg,rk=oE(oE.bind),U_=function(t,e){return nk(t),e===void 0?t:ik?rk(t,e):function(){return t.apply(e,arguments)}},sk=lu,Y_=sk("document","documentElement"),ok=un,jv=ok([].slice),ak=TypeError,z_=function(t,e){if(t<e)throw new ak("Not enough arguments");return t},lk=xv,uk=/(?:ipad|iphone|ipod).*applewebkit/i.test(lk),ck=xn,hk=Ba,dk=hk(ck.process)==="process",wi=xn,fk=tm,gk=U_,aE=bn,mk=is,G_=Ci,lE=Y_,pk=jv,uE=Lv,wk=z_,Ck=uk,vk=dk,IC=wi.setImmediate,PC=wi.clearImmediate,Sk=wi.process,cp=wi.Dispatch,yk=wi.Function,cE=wi.MessageChannel,bk=wi.String,hp=0,Oc={},hE="onreadystatechange",eh,Vo,dp,fp;G_(function(){eh=wi.location});var Kv=function(t){if(mk(Oc,t)){var e=Oc[t];delete Oc[t],e()}},gp=function(t){return function(){Kv(t)}},dE=function(t){Kv(t.data)},fE=function(t){wi.postMessage(bk(t),eh.protocol+"//"+eh.host)};(!IC||!PC)&&(IC=function(e){wk(arguments.length,1);var n=aE(e)?e:yk(e),i=pk(arguments,1);return Oc[++hp]=function(){fk(n,void 0,i)},Vo(hp),hp},PC=function(e){delete Oc[e]},vk?Vo=function(t){Sk.nextTick(gp(t))}:cp&&cp.now?Vo=function(t){cp.now(gp(t))}:cE&&!Ck?(dp=new cE,fp=dp.port2,dp.port1.onmessage=dE,Vo=gk(fp.postMessage,fp)):wi.addEventListener&&aE(wi.postMessage)&&!wi.importScripts&&eh&&eh.protocol!=="file:"&&!G_(fE)?(Vo=fE,wi.addEventListener("message",dE,!1)):hE in uE("script")?Vo=function(t){lE.appendChild(uE("script"))[hE]=function(){lE.removeChild(this),Kv(t)}}:Vo=function(t){setTimeout(gp(t),0)});var j_={set:IC,clear:PC},Rk=An,Ek=xn,gE=j_.clear;Rk({global:!0,bind:!0,enumerable:!0,forced:Ek.clearImmediate!==gE},{clearImmediate:gE});var Tk=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",K_=xn,Mk=tm,_k=bn,Ik=Tk,Pk=xv,Ok=jv,xk=z_,Ak=K_.Function,Hk=/MSIE .\./.test(Pk)||Ik&&function(){var t=K_.Bun.version.split(".");return t.length<3||t[0]==="0"&&(t[1]<3||t[1]==="3"&&t[2]==="0")}(),Nk=function(t,e){var n=e?2:1;return Hk?function(i,r){var s=xk(arguments.length,1)>n,o=_k(i)?i:Ak(i),a=s?Ok(arguments,n):[],l=s?function(){Mk(o,this,a)}:o;return e?t(l,r):t(l)}:t},Dk=An,X_=xn,mE=j_.set,Lk=Nk,pE=X_.setImmediate?Lk(mE,!1):mE;Dk({global:!0,bind:!0,enumerable:!0,forced:X_.setImmediate!==pE},{setImmediate:pE});/*! @license DOMPurify 2.5.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.5.5/LICENSE */function po(t){"@babel/helpers - typeof";return po=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},po(t)}function OC(t,e){return OC=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},OC(t,e)}function $k(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function xf(t,e,n){return $k()?xf=Reflect.construct:xf=function(r,s,o){var a=[null];a.push.apply(a,s);var l=Function.bind.apply(r,a),u=new l;return o&&OC(u,o.prototype),u},xf.apply(null,arguments)}function er(t){return kk(t)||Fk(t)||Vk(t)||Wk()}function kk(t){if(Array.isArray(t))return xC(t)}function Fk(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Vk(t,e){if(t){if(typeof t=="string")return xC(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xC(t,e)}}function xC(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Wk(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Bk=Object.hasOwnProperty,wE=Object.setPrototypeOf,Uk=Object.isFrozen,Yk=Object.getPrototypeOf,zk=Object.getOwnPropertyDescriptor,Un=Object.freeze,Fi=Object.seal,Gk=Object.create,q_=typeof Reflect<"u"&&Reflect,sg=q_.apply,AC=q_.construct;sg||(sg=function(e,n,i){return e.apply(n,i)});Un||(Un=function(e){return e});Fi||(Fi=function(e){return e});AC||(AC=function(e,n){return xf(e,er(n))});var jk=Vi(Array.prototype.forEach),CE=Vi(Array.prototype.pop),Ru=Vi(Array.prototype.push),Af=Vi(String.prototype.toLowerCase),mp=Vi(String.prototype.toString),vE=Vi(String.prototype.match),Yi=Vi(String.prototype.replace),Kk=Vi(String.prototype.indexOf),Xk=Vi(String.prototype.trim),Sn=Vi(RegExp.prototype.test),pp=qk(TypeError);function Vi(t){return function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return sg(t,e,i)}}function qk(t){return function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return AC(t,n)}}function ze(t,e,n){var i;n=(i=n)!==null&&i!==void 0?i:Af,wE&&wE(t,null);for(var r=e.length;r--;){var s=e[r];if(typeof s=="string"){var o=n(s);o!==s&&(Uk(e)||(e[r]=o),s=o)}t[s]=!0}return t}function Wo(t){var e=Gk(null),n;for(n in t)sg(Bk,t,[n])===!0&&(e[n]=t[n]);return e}function ed(t,e){for(;t!==null;){var n=zk(t,e);if(n){if(n.get)return Vi(n.get);if(typeof n.value=="function")return Vi(n.value)}t=Yk(t)}function i(r){return console.warn("fallback value for",r),null}return i}var SE=Un(["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","section","select","shadow","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"]),wp=Un(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Cp=Un(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Zk=Un(["animate","color-profile","cursor","discard","fedropshadow","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"]),vp=Un(["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"]),Qk=Un(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),yE=Un(["#text"]),bE=Un(["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","face","for","headers","height","hidden","high","href","hreflang","id","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","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Sp=Un(["accent-height","accumulate","additive","alignment-baseline","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","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","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","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","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","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"]),RE=Un(["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"]),td=Un(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Jk=Fi(/\{\{[\w\W]*|[\w\W]*\}\}/gm),eF=Fi(/<%[\w\W]*|[\w\W]*%>/gm),tF=Fi(/\${[\w\W]*}/gm),nF=Fi(/^data-[\-\w.\u00B7-\uFFFF]/),iF=Fi(/^aria-[\-\w]+$/),rF=Fi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),sF=Fi(/^(?:\w+script|data):/i),oF=Fi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),aF=Fi(/^html$/i),lF=Fi(/^[a-z][.\w]*(-[.\w]+)+$/i),uF=function(){return typeof window>"u"?null:window},cF=function(e,n){if(po(e)!=="object"||typeof e.createPolicy!="function")return null;var i=null,r="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(r)&&(i=n.currentScript.getAttribute(r));var s="dompurify"+(i?"#"+i:"");try{return e.createPolicy(s,{createHTML:function(a){return a},createScriptURL:function(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}};function Z_(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:uF(),e=function(A){return Z_(A)};if(e.version="2.5.5",e.removed=[],!t||!t.document||t.document.nodeType!==9)return e.isSupported=!1,e;var n=t.document,i=t.document,r=t.DocumentFragment,s=t.HTMLTemplateElement,o=t.Node,a=t.Element,l=t.NodeFilter,u=t.NamedNodeMap,c=u===void 0?t.NamedNodeMap||t.MozNamedAttrMap:u,h=t.HTMLFormElement,d=t.DOMParser,g=t.trustedTypes,p=a.prototype,C=ed(p,"cloneNode"),S=ed(p,"nextSibling"),b=ed(p,"childNodes"),R=ed(p,"parentNode");if(typeof s=="function"){var E=i.createElement("template");E.content&&E.content.ownerDocument&&(i=E.content.ownerDocument)}var H=cF(g,n),P=H?H.createHTML(""):"",B=i,Y=B.implementation,j=B.createNodeIterator,z=B.createDocumentFragment,G=B.getElementsByTagName,Z=n.importNode,ne={};try{ne=Wo(i).documentMode?i.documentMode:{}}catch{}var ie={};e.isSupported=typeof R=="function"&&Y&&Y.createHTMLDocument!==void 0&&ne!==9;var Ce=Jk,Me=eF,et=tF,Ne=nF,we=iF,pe=sF,ht=oF,f=lF,m=rF,w=null,O=ze({},[].concat(er(SE),er(wp),er(Cp),er(vp),er(yE))),I=null,F=ze({},[].concat(er(bE),er(Sp),er(RE),er(td))),U=Object.seal(Object.create(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}})),K=null,le=null,he=!0,Q=!0,Oe=!1,Pe=!0,W=!1,Xe=!0,Le=!1,tt=!1,Fe=!1,Te=!1,v=!1,y=!1,T=!0,$=!1,_="user-content-",k=!0,N=!1,x={},L=null,D=ze({},["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"]),V=null,te=ze({},["audio","video","img","source","image","track"]),ue=null,ye=ze({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$e="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",Ye="http://www.w3.org/1999/xhtml",Ie=Ye,Qe=!1,Dt=null,Za=ze({},[$e,qe,Ye],mp),Ui,Su=["application/xhtml+xml","text/html"],Si="text/html",xt,nn=null,Cn=i.createElement("form"),_t=function(A){return A instanceof RegExp||A instanceof Function},zm=function(A){nn&&nn===A||((!A||po(A)!=="object")&&(A={}),A=Wo(A),Ui=Su.indexOf(A.PARSER_MEDIA_TYPE)===-1?Ui=Si:Ui=A.PARSER_MEDIA_TYPE,xt=Ui==="application/xhtml+xml"?mp:Af,w="ALLOWED_TAGS"in A?ze({},A.ALLOWED_TAGS,xt):O,I="ALLOWED_ATTR"in A?ze({},A.ALLOWED_ATTR,xt):F,Dt="ALLOWED_NAMESPACES"in A?ze({},A.ALLOWED_NAMESPACES,mp):Za,ue="ADD_URI_SAFE_ATTR"in A?ze(Wo(ye),A.ADD_URI_SAFE_ATTR,xt):ye,V="ADD_DATA_URI_TAGS"in A?ze(Wo(te),A.ADD_DATA_URI_TAGS,xt):te,L="FORBID_CONTENTS"in A?ze({},A.FORBID_CONTENTS,xt):D,K="FORBID_TAGS"in A?ze({},A.FORBID_TAGS,xt):{},le="FORBID_ATTR"in A?ze({},A.FORBID_ATTR,xt):{},x="USE_PROFILES"in A?A.USE_PROFILES:!1,he=A.ALLOW_ARIA_ATTR!==!1,Q=A.ALLOW_DATA_ATTR!==!1,Oe=A.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=A.ALLOW_SELF_CLOSE_IN_ATTR!==!1,W=A.SAFE_FOR_TEMPLATES||!1,Xe=A.SAFE_FOR_XML!==!1,Le=A.WHOLE_DOCUMENT||!1,Te=A.RETURN_DOM||!1,v=A.RETURN_DOM_FRAGMENT||!1,y=A.RETURN_TRUSTED_TYPE||!1,Fe=A.FORCE_BODY||!1,T=A.SANITIZE_DOM!==!1,$=A.SANITIZE_NAMED_PROPS||!1,k=A.KEEP_CONTENT!==!1,N=A.IN_PLACE||!1,m=A.ALLOWED_URI_REGEXP||m,Ie=A.NAMESPACE||Ye,U=A.CUSTOM_ELEMENT_HANDLING||{},A.CUSTOM_ELEMENT_HANDLING&&_t(A.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(U.tagNameCheck=A.CUSTOM_ELEMENT_HANDLING.tagNameCheck),A.CUSTOM_ELEMENT_HANDLING&&_t(A.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(U.attributeNameCheck=A.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),A.CUSTOM_ELEMENT_HANDLING&&typeof A.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(U.allowCustomizedBuiltInElements=A.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),W&&(Q=!1),v&&(Te=!0),x&&(w=ze({},er(yE)),I=[],x.html===!0&&(ze(w,SE),ze(I,bE)),x.svg===!0&&(ze(w,wp),ze(I,Sp),ze(I,td)),x.svgFilters===!0&&(ze(w,Cp),ze(I,Sp),ze(I,td)),x.mathMl===!0&&(ze(w,vp),ze(I,RE),ze(I,td))),A.ADD_TAGS&&(w===O&&(w=Wo(w)),ze(w,A.ADD_TAGS,xt)),A.ADD_ATTR&&(I===F&&(I=Wo(I)),ze(I,A.ADD_ATTR,xt)),A.ADD_URI_SAFE_ATTR&&ze(ue,A.ADD_URI_SAFE_ATTR,xt),A.FORBID_CONTENTS&&(L===D&&(L=Wo(L)),ze(L,A.FORBID_CONTENTS,xt)),k&&(w["#text"]=!0),Le&&ze(w,["html","head","body"]),w.table&&(ze(w,["tbody"]),delete K.tbody),Un&&Un(A),nn=A)},hR=ze({},["mi","mo","mn","ms","mtext"]),dR=ze({},["foreignobject","annotation-xml"]),IA=ze({},["title","style","font","a","script"]),Gh=ze({},wp);ze(Gh,Cp),ze(Gh,Zk);var Gm=ze({},vp);ze(Gm,Qk);var PA=function(A){var ee=R(A);(!ee||!ee.tagName)&&(ee={namespaceURI:Ie,tagName:"template"});var ae=Af(A.tagName),at=Af(ee.tagName);return Dt[A.namespaceURI]?A.namespaceURI===qe?ee.namespaceURI===Ye?ae==="svg":ee.namespaceURI===$e?ae==="svg"&&(at==="annotation-xml"||hR[at]):!!Gh[ae]:A.namespaceURI===$e?ee.namespaceURI===Ye?ae==="math":ee.namespaceURI===qe?ae==="math"&&dR[at]:!!Gm[ae]:A.namespaceURI===Ye?ee.namespaceURI===qe&&!dR[at]||ee.namespaceURI===$e&&!hR[at]?!1:!Gm[ae]&&(IA[ae]||!Gh[ae]):!!(Ui==="application/xhtml+xml"&&Dt[A.namespaceURI]):!1},yi=function(A){Ru(e.removed,{element:A});try{A.parentNode.removeChild(A)}catch{try{A.outerHTML=P}catch{A.remove()}}},jh=function(A,ee){try{Ru(e.removed,{attribute:ee.getAttributeNode(A),from:ee})}catch{Ru(e.removed,{attribute:null,from:ee})}if(ee.removeAttribute(A),A==="is"&&!I[A])if(Te||v)try{yi(ee)}catch{}else try{ee.setAttribute(A,"")}catch{}},fR=function(A){var ee,ae;if(Fe)A="<remove></remove>"+A;else{var at=vE(A,/^[\r\n\t ]+/);ae=at&&at[0]}Ui==="application/xhtml+xml"&&Ie===Ye&&(A='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+A+"</body></html>");var jn=H?H.createHTML(A):A;if(Ie===Ye)try{ee=new d().parseFromString(jn,Ui)}catch{}if(!ee||!ee.documentElement){ee=Y.createDocument(Ie,"template",null);try{ee.documentElement.innerHTML=Qe?P:jn}catch{}}var Rn=ee.body||ee.documentElement;return A&&ae&&Rn.insertBefore(i.createTextNode(ae),Rn.childNodes[0]||null),Ie===Ye?G.call(ee,Le?"html":"body")[0]:Le?ee.documentElement:Rn},gR=function(A){return j.call(A.ownerDocument||A,A,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null,!1)},mR=function(A){return A instanceof h&&(typeof A.nodeName!="string"||typeof A.textContent!="string"||typeof A.removeChild!="function"||!(A.attributes instanceof c)||typeof A.removeAttribute!="function"||typeof A.setAttribute!="function"||typeof A.namespaceURI!="string"||typeof A.insertBefore!="function"||typeof A.hasChildNodes!="function")},yu=function(A){return po(o)==="object"?A instanceof o:A&&po(A)==="object"&&typeof A.nodeType=="number"&&typeof A.nodeName=="string"},us=function(A,ee,ae){ie[A]&&jk(ie[A],function(at){at.call(e,ee,ae,nn)})},pR=function(A){var ee;if(us("beforeSanitizeElements",A,null),mR(A)||Sn(/[\u0080-\uFFFF]/,A.nodeName))return yi(A),!0;var ae=xt(A.nodeName);if(us("uponSanitizeElement",A,{tagName:ae,allowedTags:w}),A.hasChildNodes()&&!yu(A.firstElementChild)&&(!yu(A.content)||!yu(A.content.firstElementChild))&&Sn(/<[/\w]/g,A.innerHTML)&&Sn(/<[/\w]/g,A.textContent)||ae==="select"&&Sn(/<template/i,A.innerHTML)||A.nodeType===7||Xe&&A.nodeType===8&&Sn(/<[/\w]/g,A.data))return yi(A),!0;if(!w[ae]||K[ae]){if(!K[ae]&&CR(ae)&&(U.tagNameCheck instanceof RegExp&&Sn(U.tagNameCheck,ae)||U.tagNameCheck instanceof Function&&U.tagNameCheck(ae)))return!1;if(k&&!L[ae]){var at=R(A)||A.parentNode,jn=b(A)||A.childNodes;if(jn&&at)for(var Rn=jn.length,vn=Rn-1;vn>=0;--vn){var Fo=C(jn[vn],!0);Fo.__removalCount=(A.__removalCount||0)+1,at.insertBefore(Fo,S(A))}}return yi(A),!0}return A instanceof a&&!PA(A)||(ae==="noscript"||ae==="noembed"||ae==="noframes")&&Sn(/<\/no(script|embed|frames)/i,A.innerHTML)?(yi(A),!0):(W&&A.nodeType===3&&(ee=A.textContent,ee=Yi(ee,Ce," "),ee=Yi(ee,Me," "),ee=Yi(ee,et," "),A.textContent!==ee&&(Ru(e.removed,{element:A.cloneNode()}),A.textContent=ee)),us("afterSanitizeElements",A,null),!1)},wR=function(A,ee,ae){if(T&&(ee==="id"||ee==="name")&&(ae in i||ae in Cn))return!1;if(!(Q&&!le[ee]&&Sn(Ne,ee))){if(!(he&&Sn(we,ee))){if(!I[ee]||le[ee]){if(!(CR(A)&&(U.tagNameCheck instanceof RegExp&&Sn(U.tagNameCheck,A)||U.tagNameCheck instanceof Function&&U.tagNameCheck(A))&&(U.attributeNameCheck instanceof RegExp&&Sn(U.attributeNameCheck,ee)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(ee))||ee==="is"&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&Sn(U.tagNameCheck,ae)||U.tagNameCheck instanceof Function&&U.tagNameCheck(ae))))return!1}else if(!ue[ee]){if(!Sn(m,Yi(ae,ht,""))){if(!((ee==="src"||ee==="xlink:href"||ee==="href")&&A!=="script"&&Kk(ae,"data:")===0&&V[A])){if(!(Oe&&!Sn(pe,Yi(ae,ht,"")))){if(ae)return!1}}}}}}return!0},CR=function(A){return A!=="annotation-xml"&&vE(A,f)},vR=function(A){var ee,ae,at,jn;us("beforeSanitizeAttributes",A,null);var Rn=A.attributes;if(Rn){var vn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:I};for(jn=Rn.length;jn--;){ee=Rn[jn];var Fo=ee,rn=Fo.name,jm=Fo.namespaceURI;if(ae=rn==="value"?ee.value:Xk(ee.value),at=xt(rn),vn.attrName=at,vn.attrValue=ae,vn.keepAttr=!0,vn.forceKeepAttr=void 0,us("uponSanitizeAttribute",A,vn),ae=vn.attrValue,!vn.forceKeepAttr&&(jh(rn,A),!!vn.keepAttr)){if(!Pe&&Sn(/\/>/i,ae)){jh(rn,A);continue}if(Xe&&Sn(/((--!?|])>)|<\/(style|title)/i,ae)){jh(rn,A);continue}W&&(ae=Yi(ae,Ce," "),ae=Yi(ae,Me," "),ae=Yi(ae,et," "));var SR=xt(A.nodeName);if(wR(SR,at,ae)){if($&&(at==="id"||at==="name")&&(jh(rn,A),ae=_+ae),H&&po(g)==="object"&&typeof g.getAttributeType=="function"&&!jm)switch(g.getAttributeType(SR,at)){case"TrustedHTML":{ae=H.createHTML(ae);break}case"TrustedScriptURL":{ae=H.createScriptURL(ae);break}}try{jm?A.setAttributeNS(jm,rn,ae):A.setAttribute(rn,ae),mR(A)?yi(A):CE(e.removed)}catch{}}}}us("afterSanitizeAttributes",A,null)}},OA=function be(A){var ee,ae=gR(A);for(us("beforeSanitizeShadowDOM",A,null);ee=ae.nextNode();)us("uponSanitizeShadowNode",ee,null),!pR(ee)&&(ee.content instanceof r&&be(ee.content),vR(ee));us("afterSanitizeShadowDOM",A,null)};return e.sanitize=function(be){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee,ae,at,jn,Rn;if(Qe=!be,Qe&&(be="<!-->"),typeof be!="string"&&!yu(be))if(typeof be.toString=="function"){if(be=be.toString(),typeof be!="string")throw pp("dirty is not a string, aborting")}else throw pp("toString is not a function");if(!e.isSupported){if(po(t.toStaticHTML)==="object"||typeof t.toStaticHTML=="function"){if(typeof be=="string")return t.toStaticHTML(be);if(yu(be))return t.toStaticHTML(be.outerHTML)}return be}if(tt||zm(A),e.removed=[],typeof be=="string"&&(N=!1),N){if(be.nodeName){var vn=xt(be.nodeName);if(!w[vn]||K[vn])throw pp("root node is forbidden and cannot be sanitized in-place")}}else if(be instanceof o)ee=fR("<!---->"),ae=ee.ownerDocument.importNode(be,!0),ae.nodeType===1&&ae.nodeName==="BODY"||ae.nodeName==="HTML"?ee=ae:ee.appendChild(ae);else{if(!Te&&!W&&!Le&&be.indexOf("<")===-1)return H&&y?H.createHTML(be):be;if(ee=fR(be),!ee)return Te?null:y?P:""}ee&&Fe&&yi(ee.firstChild);for(var Fo=gR(N?be:ee);at=Fo.nextNode();)at.nodeType===3&&at===jn||pR(at)||(at.content instanceof r&&OA(at.content),vR(at),jn=at);if(jn=null,N)return be;if(Te){if(v)for(Rn=z.call(ee.ownerDocument);ee.firstChild;)Rn.appendChild(ee.firstChild);else Rn=ee;return(I.shadowroot||I.shadowrootmod)&&(Rn=Z.call(n,Rn,!0)),Rn}var rn=Le?ee.outerHTML:ee.innerHTML;return Le&&w["!doctype"]&&ee.ownerDocument&&ee.ownerDocument.doctype&&ee.ownerDocument.doctype.name&&Sn(aF,ee.ownerDocument.doctype.name)&&(rn="<!DOCTYPE "+ee.ownerDocument.doctype.name+`>
|
|
`+rn),W&&(rn=Yi(rn,Ce," "),rn=Yi(rn,Me," "),rn=Yi(rn,et," ")),H&&y?H.createHTML(rn):rn},e.setConfig=function(be){zm(be),tt=!0},e.clearConfig=function(){nn=null,tt=!1},e.isValidAttribute=function(be,A,ee){nn||zm({});var ae=xt(be),at=xt(A);return wR(ae,at,ee)},e.addHook=function(be,A){typeof A=="function"&&(ie[be]=ie[be]||[],Ru(ie[be],A))},e.removeHook=function(be){if(ie[be])return CE(ie[be])},e.removeHooks=function(be){ie[be]&&(ie[be]=[])},e.removeAllHooks=function(){ie={}},e}var hF=Z_();//! moment.js
|
|
//! version : 2.30.1
|
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
//! license : MIT
|
|
//! momentjs.com
|
|
var Q_;function X(){return Q_.apply(null,arguments)}function dF(t){Q_=t}function dr(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function Oa(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function st(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Xv(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(st(t,e))return!1;return!0}function ei(t){return t===void 0}function $s(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function Th(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function J_(t,e){var n=[],i,r=t.length;for(i=0;i<r;++i)n.push(e(t[i],i));return n}function So(t,e){for(var n in e)st(e,n)&&(t[n]=e[n]);return st(e,"toString")&&(t.toString=e.toString),st(e,"valueOf")&&(t.valueOf=e.valueOf),t}function os(t,e,n,i){return bI(t,e,n,i,!0).utc()}function fF(){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 We(t){return t._pf==null&&(t._pf=fF()),t._pf}var HC;Array.prototype.some?HC=Array.prototype.some:HC=function(t){var e=Object(this),n=e.length>>>0,i;for(i=0;i<n;i++)if(i in e&&t.call(this,e[i],i,e))return!0;return!1};function qv(t){var e=null,n=!1,i=t._d&&!isNaN(t._d.getTime());if(i&&(e=We(t),n=HC.call(e.parsedDateParts,function(r){return r!=null}),i=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&&(i=i&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=i;else return i;return t._isValid}function nm(t){var e=os(NaN);return t!=null?So(We(e),t):We(e).userInvalidated=!0,e}var EE=X.momentProperties=[],yp=!1;function Zv(t,e){var n,i,r,s=EE.length;if(ei(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),ei(e._i)||(t._i=e._i),ei(e._f)||(t._f=e._f),ei(e._l)||(t._l=e._l),ei(e._strict)||(t._strict=e._strict),ei(e._tzm)||(t._tzm=e._tzm),ei(e._isUTC)||(t._isUTC=e._isUTC),ei(e._offset)||(t._offset=e._offset),ei(e._pf)||(t._pf=We(e)),ei(e._locale)||(t._locale=e._locale),s>0)for(n=0;n<s;n++)i=EE[n],r=e[i],ei(r)||(t[i]=r);return t}function Mh(t){Zv(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),yp===!1&&(yp=!0,X.updateOffset(this),yp=!1)}function fr(t){return t instanceof Mh||t!=null&&t._isAMomentObject!=null}function eI(t){X.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function Wi(t,e){var n=!0;return So(function(){if(X.deprecationHandler!=null&&X.deprecationHandler(null,t),n){var i=[],r,s,o,a=arguments.length;for(s=0;s<a;s++){if(r="",typeof arguments[s]=="object"){r+=`
|
|
[`+s+"] ";for(o in arguments[0])st(arguments[0],o)&&(r+=o+": "+arguments[0][o]+", ");r=r.slice(0,-2)}else r=arguments[s];i.push(r)}eI(t+`
|
|
Arguments: `+Array.prototype.slice.call(i).join("")+`
|
|
`+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var TE={};function tI(t,e){X.deprecationHandler!=null&&X.deprecationHandler(t,e),TE[t]||(eI(e),TE[t]=!0)}X.suppressDeprecationWarnings=!1;X.deprecationHandler=null;function as(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function gF(t){var e,n;for(n in t)st(t,n)&&(e=t[n],as(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 NC(t,e){var n=So({},t),i;for(i in e)st(e,i)&&(Oa(t[i])&&Oa(e[i])?(n[i]={},So(n[i],t[i]),So(n[i],e[i])):e[i]!=null?n[i]=e[i]:delete n[i]);for(i in t)st(t,i)&&!st(e,i)&&Oa(t[i])&&(n[i]=So({},n[i]));return n}function Qv(t){t!=null&&this.set(t)}var DC;Object.keys?DC=Object.keys:DC=function(t){var e,n=[];for(e in t)st(t,e)&&n.push(e);return n};var mF={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function pF(t,e,n){var i=this._calendar[t]||this._calendar.sameElse;return as(i)?i.call(e,n):i}function Jr(t,e,n){var i=""+Math.abs(t),r=e-i.length,s=t>=0;return(s?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+i}var Jv=/(\[[^\[]*\])|(\\)?([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,nd=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,bp={},Xl={};function Re(t,e,n,i){var r=i;typeof i=="string"&&(r=function(){return this[i]()}),t&&(Xl[t]=r),e&&(Xl[e[0]]=function(){return Jr(r.apply(this,arguments),e[1],e[2])}),n&&(Xl[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),t)})}function wF(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function CF(t){var e=t.match(Jv),n,i;for(n=0,i=e.length;n<i;n++)Xl[e[n]]?e[n]=Xl[e[n]]:e[n]=wF(e[n]);return function(r){var s="",o;for(o=0;o<i;o++)s+=as(e[o])?e[o].call(r,t):e[o];return s}}function Hf(t,e){return t.isValid()?(e=nI(e,t.localeData()),bp[e]=bp[e]||CF(e),bp[e](t)):t.localeData().invalidDate()}function nI(t,e){var n=5;function i(r){return e.longDateFormat(r)||r}for(nd.lastIndex=0;n>=0&&nd.test(t);)t=t.replace(nd,i),nd.lastIndex=0,n-=1;return t}var vF={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 SF(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(Jv).map(function(i){return i==="MMMM"||i==="MM"||i==="DD"||i==="dddd"?i.slice(1):i}).join(""),this._longDateFormat[t])}var yF="Invalid date";function bF(){return this._invalidDate}var RF="%d",EF=/\d{1,2}/;function TF(t){return this._ordinal.replace("%d",t)}var MF={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 _F(t,e,n,i){var r=this._relativeTime[n];return as(r)?r(t,e,n,i):r.replace(/%d/i,t)}function IF(t,e){var n=this._relativeTime[t>0?"future":"past"];return as(n)?n(e):n.replace(/%s/i,e)}var ME={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 Bi(t){return typeof t=="string"?ME[t]||ME[t.toLowerCase()]:void 0}function eS(t){var e={},n,i;for(i in t)st(t,i)&&(n=Bi(i),n&&(e[n]=t[i]));return e}var PF={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 OF(t){var e=[],n;for(n in t)st(t,n)&&e.push({unit:n,priority:PF[n]});return e.sort(function(i,r){return i.priority-r.priority}),e}var iI=/\d/,vi=/\d\d/,rI=/\d{3}/,tS=/\d{4}/,im=/[+-]?\d{6}/,Ot=/\d\d?/,sI=/\d\d\d\d?/,oI=/\d\d\d\d\d\d?/,rm=/\d{1,3}/,nS=/\d{1,4}/,sm=/[+-]?\d{1,6}/,uu=/\d+/,om=/[+-]?\d+/,xF=/Z|[+-]\d\d:?\d\d/gi,am=/Z|[+-]\d\d(?::?\d\d)?/gi,AF=/[+-]?\d+(\.\d{1,3})?/,_h=/[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,cu=/^[1-9]\d?/,iS=/^([1-9]\d|\d)/,og;og={};function fe(t,e,n){og[t]=as(e)?e:function(i,r){return i&&n?n:e}}function HF(t,e){return st(og,t)?og[t](e._strict,e._locale):new RegExp(NF(t))}function NF(t){return Ds(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,i,r,s){return n||i||r||s}))}function Ds(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Di(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function Ze(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=Di(e)),n}var LC={};function St(t,e){var n,i=e,r;for(typeof t=="string"&&(t=[t]),$s(e)&&(i=function(s,o){o[e]=Ze(s)}),r=t.length,n=0;n<r;n++)LC[t[n]]=i}function Ih(t,e){St(t,function(n,i,r,s){r._w=r._w||{},e(n,r._w,r,s)})}function DF(t,e,n){e!=null&&st(LC,t)&&LC[t](e,n._a,n,t)}function lm(t){return t%4===0&&t%100!==0||t%400===0}var On=0,Is=1,Gr=2,ln=3,ur=4,Ps=5,Ea=6,LF=7,$F=8;Re("Y",0,0,function(){var t=this.year();return t<=9999?Jr(t,4):"+"+t});Re(0,["YY",2],0,function(){return this.year()%100});Re(0,["YYYY",4],0,"year");Re(0,["YYYYY",5],0,"year");Re(0,["YYYYYY",6,!0],0,"year");fe("Y",om);fe("YY",Ot,vi);fe("YYYY",nS,tS);fe("YYYYY",sm,im);fe("YYYYYY",sm,im);St(["YYYYY","YYYYYY"],On);St("YYYY",function(t,e){e[On]=t.length===2?X.parseTwoDigitYear(t):Ze(t)});St("YY",function(t,e){e[On]=X.parseTwoDigitYear(t)});St("Y",function(t,e){e[On]=parseInt(t,10)});function xc(t){return lm(t)?366:365}X.parseTwoDigitYear=function(t){return Ze(t)+(Ze(t)>68?1900:2e3)};var aI=hu("FullYear",!0);function kF(){return lm(this.year())}function hu(t,e){return function(n){return n!=null?(lI(this,t,n),X.updateOffset(this,e),this):th(this,t)}}function th(t,e){if(!t.isValid())return NaN;var n=t._d,i=t._isUTC;switch(e){case"Milliseconds":return i?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return i?n.getUTCSeconds():n.getSeconds();case"Minutes":return i?n.getUTCMinutes():n.getMinutes();case"Hours":return i?n.getUTCHours():n.getHours();case"Date":return i?n.getUTCDate():n.getDate();case"Day":return i?n.getUTCDay():n.getDay();case"Month":return i?n.getUTCMonth():n.getMonth();case"FullYear":return i?n.getUTCFullYear():n.getFullYear();default:return NaN}}function lI(t,e,n){var i,r,s,o,a;if(!(!t.isValid()||isNaN(n))){switch(i=t._d,r=t._isUTC,e){case"Milliseconds":return void(r?i.setUTCMilliseconds(n):i.setMilliseconds(n));case"Seconds":return void(r?i.setUTCSeconds(n):i.setSeconds(n));case"Minutes":return void(r?i.setUTCMinutes(n):i.setMinutes(n));case"Hours":return void(r?i.setUTCHours(n):i.setHours(n));case"Date":return void(r?i.setUTCDate(n):i.setDate(n));case"FullYear":break;default:return}s=n,o=t.month(),a=t.date(),a=a===29&&o===1&&!lm(s)?28:a,r?i.setUTCFullYear(s,o,a):i.setFullYear(s,o,a)}}function FF(t){return t=Bi(t),as(this[t])?this[t]():this}function VF(t,e){if(typeof t=="object"){t=eS(t);var n=OF(t),i,r=n.length;for(i=0;i<r;i++)this[n[i].unit](t[n[i].unit])}else if(t=Bi(t),as(this[t]))return this[t](e);return this}function WF(t,e){return(t%e+e)%e}var Zt;Array.prototype.indexOf?Zt=Array.prototype.indexOf:Zt=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function rS(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=WF(e,12);return t+=(e-n)/12,n===1?lm(t)?29:28:31-n%7%2}Re("M",["MM",2],"Mo",function(){return this.month()+1});Re("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)});Re("MMMM",0,0,function(t){return this.localeData().months(this,t)});fe("M",Ot,cu);fe("MM",Ot,vi);fe("MMM",function(t,e){return e.monthsShortRegex(t)});fe("MMMM",function(t,e){return e.monthsRegex(t)});St(["M","MM"],function(t,e){e[Is]=Ze(t)-1});St(["MMM","MMMM"],function(t,e,n,i){var r=n._locale.monthsParse(t,i,n._strict);r!=null?e[Is]=r:We(n).invalidMonth=t});var BF="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),uI="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),cI=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,UF=_h,YF=_h;function zF(t,e){return t?dr(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||cI).test(e)?"format":"standalone"][t.month()]:dr(this._months)?this._months:this._months.standalone}function GF(t,e){return t?dr(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[cI.test(e)?"format":"standalone"][t.month()]:dr(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function jF(t,e,n){var i,r,s,o=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)s=os([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(s,"").toLocaleLowerCase();return n?e==="MMM"?(r=Zt.call(this._shortMonthsParse,o),r!==-1?r:null):(r=Zt.call(this._longMonthsParse,o),r!==-1?r:null):e==="MMM"?(r=Zt.call(this._shortMonthsParse,o),r!==-1?r:(r=Zt.call(this._longMonthsParse,o),r!==-1?r:null)):(r=Zt.call(this._longMonthsParse,o),r!==-1?r:(r=Zt.call(this._shortMonthsParse,o),r!==-1?r:null))}function KF(t,e,n){var i,r,s;if(this._monthsParseExact)return jF.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(r=os([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),!n&&!this._monthsParse[i]&&(s="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(s.replace(".",""),"i")),n&&e==="MMMM"&&this._longMonthsParse[i].test(t))return i;if(n&&e==="MMM"&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}}function hI(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=Ze(e);else if(e=t.localeData().monthsParse(e),!$s(e))return t}var n=e,i=t.date();return i=i<29?i:Math.min(i,rS(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,i):t._d.setMonth(n,i),t}function dI(t){return t!=null?(hI(this,t),X.updateOffset(this,!0),this):th(this,"Month")}function XF(){return rS(this.year(),this.month())}function qF(t){return this._monthsParseExact?(st(this,"_monthsRegex")||fI.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(st(this,"_monthsShortRegex")||(this._monthsShortRegex=UF),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function ZF(t){return this._monthsParseExact?(st(this,"_monthsRegex")||fI.call(this),t?this._monthsStrictRegex:this._monthsRegex):(st(this,"_monthsRegex")||(this._monthsRegex=YF),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function fI(){function t(l,u){return u.length-l.length}var e=[],n=[],i=[],r,s,o,a;for(r=0;r<12;r++)s=os([2e3,r]),o=Ds(this.monthsShort(s,"")),a=Ds(this.months(s,"")),e.push(o),n.push(a),i.push(a),i.push(o);e.sort(t),n.sort(t),i.sort(t),this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function QF(t,e,n,i,r,s,o){var a;return t<100&&t>=0?(a=new Date(t+400,e,n,i,r,s,o),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,n,i,r,s,o),a}function nh(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 ag(t,e,n){var i=7+e-n,r=(7+nh(t,0,i).getUTCDay()-e)%7;return-r+i-1}function gI(t,e,n,i,r){var s=(7+n-i)%7,o=ag(t,i,r),a=1+7*(e-1)+s+o,l,u;return a<=0?(l=t-1,u=xc(l)+a):a>xc(t)?(l=t+1,u=a-xc(t)):(l=t,u=a),{year:l,dayOfYear:u}}function ih(t,e,n){var i=ag(t.year(),e,n),r=Math.floor((t.dayOfYear()-i-1)/7)+1,s,o;return r<1?(o=t.year()-1,s=r+Ls(o,e,n)):r>Ls(t.year(),e,n)?(s=r-Ls(t.year(),e,n),o=t.year()+1):(o=t.year(),s=r),{week:s,year:o}}function Ls(t,e,n){var i=ag(t,e,n),r=ag(t+1,e,n);return(xc(t)-i+r)/7}Re("w",["ww",2],"wo","week");Re("W",["WW",2],"Wo","isoWeek");fe("w",Ot,cu);fe("ww",Ot,vi);fe("W",Ot,cu);fe("WW",Ot,vi);Ih(["w","ww","W","WW"],function(t,e,n,i){e[i.substr(0,1)]=Ze(t)});function JF(t){return ih(t,this._week.dow,this._week.doy).week}var eV={dow:0,doy:6};function tV(){return this._week.dow}function nV(){return this._week.doy}function iV(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function rV(t){var e=ih(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}Re("d",0,"do","day");Re("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)});Re("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)});Re("dddd",0,0,function(t){return this.localeData().weekdays(this,t)});Re("e",0,0,"weekday");Re("E",0,0,"isoWeekday");fe("d",Ot);fe("e",Ot);fe("E",Ot);fe("dd",function(t,e){return e.weekdaysMinRegex(t)});fe("ddd",function(t,e){return e.weekdaysShortRegex(t)});fe("dddd",function(t,e){return e.weekdaysRegex(t)});Ih(["dd","ddd","dddd"],function(t,e,n,i){var r=n._locale.weekdaysParse(t,i,n._strict);r!=null?e.d=r:We(n).invalidWeekday=t});Ih(["d","e","E"],function(t,e,n,i){e[i]=Ze(t)});function sV(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function oV(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function sS(t,e){return t.slice(e,7).concat(t.slice(0,e))}var aV="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),mI="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),lV="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),uV=_h,cV=_h,hV=_h;function dV(t,e){var n=dr(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?sS(n,this._week.dow):t?n[t.day()]:n}function fV(t){return t===!0?sS(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function gV(t){return t===!0?sS(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function mV(t,e,n){var i,r,s,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)s=os([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(s,"").toLocaleLowerCase();return n?e==="dddd"?(r=Zt.call(this._weekdaysParse,o),r!==-1?r:null):e==="ddd"?(r=Zt.call(this._shortWeekdaysParse,o),r!==-1?r:null):(r=Zt.call(this._minWeekdaysParse,o),r!==-1?r:null):e==="dddd"?(r=Zt.call(this._weekdaysParse,o),r!==-1||(r=Zt.call(this._shortWeekdaysParse,o),r!==-1)?r:(r=Zt.call(this._minWeekdaysParse,o),r!==-1?r:null)):e==="ddd"?(r=Zt.call(this._shortWeekdaysParse,o),r!==-1||(r=Zt.call(this._weekdaysParse,o),r!==-1)?r:(r=Zt.call(this._minWeekdaysParse,o),r!==-1?r:null)):(r=Zt.call(this._minWeekdaysParse,o),r!==-1||(r=Zt.call(this._weekdaysParse,o),r!==-1)?r:(r=Zt.call(this._shortWeekdaysParse,o),r!==-1?r:null))}function pV(t,e,n){var i,r,s;if(this._weekdaysParseExact)return mV.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(r=os([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(s="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(s.replace(".",""),"i")),n&&e==="dddd"&&this._fullWeekdaysParse[i].test(t))return i;if(n&&e==="ddd"&&this._shortWeekdaysParse[i].test(t))return i;if(n&&e==="dd"&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}}function wV(t){if(!this.isValid())return t!=null?this:NaN;var e=th(this,"Day");return t!=null?(t=sV(t,this.localeData()),this.add(t-e,"d")):e}function CV(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 vV(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=oV(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function SV(t){return this._weekdaysParseExact?(st(this,"_weekdaysRegex")||oS.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(st(this,"_weekdaysRegex")||(this._weekdaysRegex=uV),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function yV(t){return this._weekdaysParseExact?(st(this,"_weekdaysRegex")||oS.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(st(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=cV),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function bV(t){return this._weekdaysParseExact?(st(this,"_weekdaysRegex")||oS.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(st(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=hV),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function oS(){function t(c,h){return h.length-c.length}var e=[],n=[],i=[],r=[],s,o,a,l,u;for(s=0;s<7;s++)o=os([2e3,1]).day(s),a=Ds(this.weekdaysMin(o,"")),l=Ds(this.weekdaysShort(o,"")),u=Ds(this.weekdays(o,"")),e.push(a),n.push(l),i.push(u),r.push(a),r.push(l),r.push(u);e.sort(t),n.sort(t),i.sort(t),r.sort(t),this._weekdaysRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function aS(){return this.hours()%12||12}function RV(){return this.hours()||24}Re("H",["HH",2],0,"hour");Re("h",["hh",2],0,aS);Re("k",["kk",2],0,RV);Re("hmm",0,0,function(){return""+aS.apply(this)+Jr(this.minutes(),2)});Re("hmmss",0,0,function(){return""+aS.apply(this)+Jr(this.minutes(),2)+Jr(this.seconds(),2)});Re("Hmm",0,0,function(){return""+this.hours()+Jr(this.minutes(),2)});Re("Hmmss",0,0,function(){return""+this.hours()+Jr(this.minutes(),2)+Jr(this.seconds(),2)});function pI(t,e){Re(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}pI("a",!0);pI("A",!1);function wI(t,e){return e._meridiemParse}fe("a",wI);fe("A",wI);fe("H",Ot,iS);fe("h",Ot,cu);fe("k",Ot,cu);fe("HH",Ot,vi);fe("hh",Ot,vi);fe("kk",Ot,vi);fe("hmm",sI);fe("hmmss",oI);fe("Hmm",sI);fe("Hmmss",oI);St(["H","HH"],ln);St(["k","kk"],function(t,e,n){var i=Ze(t);e[ln]=i===24?0:i});St(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t});St(["h","hh"],function(t,e,n){e[ln]=Ze(t),We(n).bigHour=!0});St("hmm",function(t,e,n){var i=t.length-2;e[ln]=Ze(t.substr(0,i)),e[ur]=Ze(t.substr(i)),We(n).bigHour=!0});St("hmmss",function(t,e,n){var i=t.length-4,r=t.length-2;e[ln]=Ze(t.substr(0,i)),e[ur]=Ze(t.substr(i,2)),e[Ps]=Ze(t.substr(r)),We(n).bigHour=!0});St("Hmm",function(t,e,n){var i=t.length-2;e[ln]=Ze(t.substr(0,i)),e[ur]=Ze(t.substr(i))});St("Hmmss",function(t,e,n){var i=t.length-4,r=t.length-2;e[ln]=Ze(t.substr(0,i)),e[ur]=Ze(t.substr(i,2)),e[Ps]=Ze(t.substr(r))});function EV(t){return(t+"").toLowerCase().charAt(0)==="p"}var TV=/[ap]\.?m?\.?/i,MV=hu("Hours",!0);function _V(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var CI={calendar:mF,longDateFormat:vF,invalidDate:yF,ordinal:RF,dayOfMonthOrdinalParse:EF,relativeTime:MF,months:BF,monthsShort:uI,week:eV,weekdays:aV,weekdaysMin:lV,weekdaysShort:mI,meridiemParse:TV},Nt={},Eu={},rh;function IV(t,e){var n,i=Math.min(t.length,e.length);for(n=0;n<i;n+=1)if(t[n]!==e[n])return n;return i}function _E(t){return t&&t.toLowerCase().replace("_","-")}function PV(t){for(var e=0,n,i,r,s;e<t.length;){for(s=_E(t[e]).split("-"),n=s.length,i=_E(t[e+1]),i=i?i.split("-"):null;n>0;){if(r=um(s.slice(0,n).join("-")),r)return r;if(i&&i.length>=n&&IV(s,i)>=n-1)break;n--}e++}return rh}function OV(t){return!!(t&&t.match("^[^/\\\\]*$"))}function um(t){var e=null,n;if(Nt[t]===void 0&&typeof module<"u"&&module&&module.exports&&OV(t))try{e=rh._abbr,n=Ec,n("./locale/"+t),Mo(e)}catch{Nt[t]=null}return Nt[t]}function Mo(t,e){var n;return t&&(ei(e)?n=Ws(t):n=lS(t,e),n?rh=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),rh._abbr}function lS(t,e){if(e!==null){var n,i=CI;if(e.abbr=t,Nt[t]!=null)tI("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."),i=Nt[t]._config;else if(e.parentLocale!=null)if(Nt[e.parentLocale]!=null)i=Nt[e.parentLocale]._config;else if(n=um(e.parentLocale),n!=null)i=n._config;else return Eu[e.parentLocale]||(Eu[e.parentLocale]=[]),Eu[e.parentLocale].push({name:t,config:e}),null;return Nt[t]=new Qv(NC(i,e)),Eu[t]&&Eu[t].forEach(function(r){lS(r.name,r.config)}),Mo(t),Nt[t]}else return delete Nt[t],null}function xV(t,e){if(e!=null){var n,i,r=CI;Nt[t]!=null&&Nt[t].parentLocale!=null?Nt[t].set(NC(Nt[t]._config,e)):(i=um(t),i!=null&&(r=i._config),e=NC(r,e),i==null&&(e.abbr=t),n=new Qv(e),n.parentLocale=Nt[t],Nt[t]=n),Mo(t)}else Nt[t]!=null&&(Nt[t].parentLocale!=null?(Nt[t]=Nt[t].parentLocale,t===Mo()&&Mo(t)):Nt[t]!=null&&delete Nt[t]);return Nt[t]}function Ws(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return rh;if(!dr(t)){if(e=um(t),e)return e;t=[t]}return PV(t)}function AV(){return DC(Nt)}function uS(t){var e,n=t._a;return n&&We(t).overflow===-2&&(e=n[Is]<0||n[Is]>11?Is:n[Gr]<1||n[Gr]>rS(n[On],n[Is])?Gr:n[ln]<0||n[ln]>24||n[ln]===24&&(n[ur]!==0||n[Ps]!==0||n[Ea]!==0)?ln:n[ur]<0||n[ur]>59?ur:n[Ps]<0||n[Ps]>59?Ps:n[Ea]<0||n[Ea]>999?Ea:-1,We(t)._overflowDayOfYear&&(e<On||e>Gr)&&(e=Gr),We(t)._overflowWeeks&&e===-1&&(e=LF),We(t)._overflowWeekday&&e===-1&&(e=$F),We(t).overflow=e),t}var HV=/^\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)?)?$/,NV=/^\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)?)?$/,DV=/Z|[+-]\d\d(?::?\d\d)?/,id=[["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]],Rp=[["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/]],LV=/^\/?Date\((-?\d+)/i,$V=/^(?:(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}))$/,kV={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 vI(t){var e,n,i=t._i,r=HV.exec(i)||NV.exec(i),s,o,a,l,u=id.length,c=Rp.length;if(r){for(We(t).iso=!0,e=0,n=u;e<n;e++)if(id[e][1].exec(r[1])){o=id[e][0],s=id[e][2]!==!1;break}if(o==null){t._isValid=!1;return}if(r[3]){for(e=0,n=c;e<n;e++)if(Rp[e][1].exec(r[3])){a=(r[2]||" ")+Rp[e][0];break}if(a==null){t._isValid=!1;return}}if(!s&&a!=null){t._isValid=!1;return}if(r[4])if(DV.exec(r[4]))l="Z";else{t._isValid=!1;return}t._f=o+(a||"")+(l||""),hS(t)}else t._isValid=!1}function FV(t,e,n,i,r,s){var o=[VV(t),uI.indexOf(e),parseInt(n,10),parseInt(i,10),parseInt(r,10)];return s&&o.push(parseInt(s,10)),o}function VV(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function WV(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function BV(t,e,n){if(t){var i=mI.indexOf(t),r=new Date(e[0],e[1],e[2]).getDay();if(i!==r)return We(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function UV(t,e,n){if(t)return kV[t];if(e)return 0;var i=parseInt(n,10),r=i%100,s=(i-r)/100;return s*60+r}function SI(t){var e=$V.exec(WV(t._i)),n;if(e){if(n=FV(e[4],e[3],e[2],e[5],e[6],e[7]),!BV(e[1],n,t))return;t._a=n,t._tzm=UV(e[8],e[9],e[10]),t._d=nh.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),We(t).rfc2822=!0}else t._isValid=!1}function YV(t){var e=LV.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(vI(t),t._isValid===!1)delete t._isValid;else return;if(SI(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:X.createFromInputFallback(t)}X.createFromInputFallback=Wi("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 Ll(t,e,n){return t??e??n}function zV(t){var e=new Date(X.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function cS(t){var e,n,i=[],r,s,o;if(!t._d){for(r=zV(t),t._w&&t._a[Gr]==null&&t._a[Is]==null&&GV(t),t._dayOfYear!=null&&(o=Ll(t._a[On],r[On]),(t._dayOfYear>xc(o)||t._dayOfYear===0)&&(We(t)._overflowDayOfYear=!0),n=nh(o,0,t._dayOfYear),t._a[Is]=n.getUTCMonth(),t._a[Gr]=n.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=i[e]=r[e];for(;e<7;e++)t._a[e]=i[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[ln]===24&&t._a[ur]===0&&t._a[Ps]===0&&t._a[Ea]===0&&(t._nextDay=!0,t._a[ln]=0),t._d=(t._useUTC?nh:QF).apply(null,i),s=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[ln]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==s&&(We(t).weekdayMismatch=!0)}}function GV(t){var e,n,i,r,s,o,a,l,u;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(s=1,o=4,n=Ll(e.GG,t._a[On],ih(Pt(),1,4).year),i=Ll(e.W,1),r=Ll(e.E,1),(r<1||r>7)&&(l=!0)):(s=t._locale._week.dow,o=t._locale._week.doy,u=ih(Pt(),s,o),n=Ll(e.gg,t._a[On],u.year),i=Ll(e.w,u.week),e.d!=null?(r=e.d,(r<0||r>6)&&(l=!0)):e.e!=null?(r=e.e+s,(e.e<0||e.e>6)&&(l=!0)):r=s),i<1||i>Ls(n,s,o)?We(t)._overflowWeeks=!0:l!=null?We(t)._overflowWeekday=!0:(a=gI(n,i,r,s,o),t._a[On]=a.year,t._dayOfYear=a.dayOfYear)}X.ISO_8601=function(){};X.RFC_2822=function(){};function hS(t){if(t._f===X.ISO_8601){vI(t);return}if(t._f===X.RFC_2822){SI(t);return}t._a=[],We(t).empty=!0;var e=""+t._i,n,i,r,s,o,a=e.length,l=0,u,c;for(r=nI(t._f,t._locale).match(Jv)||[],c=r.length,n=0;n<c;n++)s=r[n],i=(e.match(HF(s,t))||[])[0],i&&(o=e.substr(0,e.indexOf(i)),o.length>0&&We(t).unusedInput.push(o),e=e.slice(e.indexOf(i)+i.length),l+=i.length),Xl[s]?(i?We(t).empty=!1:We(t).unusedTokens.push(s),DF(s,i,t)):t._strict&&!i&&We(t).unusedTokens.push(s);We(t).charsLeftOver=a-l,e.length>0&&We(t).unusedInput.push(e),t._a[ln]<=12&&We(t).bigHour===!0&&t._a[ln]>0&&(We(t).bigHour=void 0),We(t).parsedDateParts=t._a.slice(0),We(t).meridiem=t._meridiem,t._a[ln]=jV(t._locale,t._a[ln],t._meridiem),u=We(t).era,u!==null&&(t._a[On]=t._locale.erasConvertYear(u,t._a[On])),cS(t),uS(t)}function jV(t,e,n){var i;return n==null?e:t.meridiemHour!=null?t.meridiemHour(e,n):(t.isPM!=null&&(i=t.isPM(n),i&&e<12&&(e+=12),!i&&e===12&&(e=0)),e)}function KV(t){var e,n,i,r,s,o,a=!1,l=t._f.length;if(l===0){We(t).invalidFormat=!0,t._d=new Date(NaN);return}for(r=0;r<l;r++)s=0,o=!1,e=Zv({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[r],hS(e),qv(e)&&(o=!0),s+=We(e).charsLeftOver,s+=We(e).unusedTokens.length*10,We(e).score=s,a?s<i&&(i=s,n=e):(i==null||s<i||o)&&(i=s,n=e,o&&(a=!0));So(t,n||e)}function XV(t){if(!t._d){var e=eS(t._i),n=e.day===void 0?e.date:e.day;t._a=J_([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(i){return i&&parseInt(i,10)}),cS(t)}}function qV(t){var e=new Mh(uS(yI(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function yI(t){var e=t._i,n=t._f;return t._locale=t._locale||Ws(t._l),e===null||n===void 0&&e===""?nm({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),fr(e)?new Mh(uS(e)):(Th(e)?t._d=e:dr(n)?KV(t):n?hS(t):ZV(t),qv(t)||(t._d=null),t))}function ZV(t){var e=t._i;ei(e)?t._d=new Date(X.now()):Th(e)?t._d=new Date(e.valueOf()):typeof e=="string"?YV(t):dr(e)?(t._a=J_(e.slice(0),function(n){return parseInt(n,10)}),cS(t)):Oa(e)?XV(t):$s(e)?t._d=new Date(e):X.createFromInputFallback(t)}function bI(t,e,n,i,r){var s={};return(e===!0||e===!1)&&(i=e,e=void 0),(n===!0||n===!1)&&(i=n,n=void 0),(Oa(t)&&Xv(t)||dr(t)&&t.length===0)&&(t=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=r,s._l=n,s._i=t,s._f=e,s._strict=i,qV(s)}function Pt(t,e,n,i){return bI(t,e,n,i,!1)}var QV=Wi("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Pt.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:nm()}),JV=Wi("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Pt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:nm()});function RI(t,e){var n,i;if(e.length===1&&dr(e[0])&&(e=e[0]),!e.length)return Pt();for(n=e[0],i=1;i<e.length;++i)(!e[i].isValid()||e[i][t](n))&&(n=e[i]);return n}function eW(){var t=[].slice.call(arguments,0);return RI("isBefore",t)}function tW(){var t=[].slice.call(arguments,0);return RI("isAfter",t)}var nW=function(){return Date.now?Date.now():+new Date},Tu=["year","quarter","month","week","day","hour","minute","second","millisecond"];function iW(t){var e,n=!1,i,r=Tu.length;for(e in t)if(st(t,e)&&!(Zt.call(Tu,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(i=0;i<r;++i)if(t[Tu[i]]){if(n)return!1;parseFloat(t[Tu[i]])!==Ze(t[Tu[i]])&&(n=!0)}return!0}function rW(){return this._isValid}function sW(){return Sr(NaN)}function cm(t){var e=eS(t),n=e.year||0,i=e.quarter||0,r=e.month||0,s=e.week||e.isoWeek||0,o=e.day||0,a=e.hour||0,l=e.minute||0,u=e.second||0,c=e.millisecond||0;this._isValid=iW(e),this._milliseconds=+c+u*1e3+l*6e4+a*1e3*60*60,this._days=+o+s*7,this._months=+r+i*3+n*12,this._data={},this._locale=Ws(),this._bubble()}function Nf(t){return t instanceof cm}function $C(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function oW(t,e,n){var i=Math.min(t.length,e.length),r=Math.abs(t.length-e.length),s=0,o;for(o=0;o<i;o++)Ze(t[o])!==Ze(e[o])&&s++;return s+r}function EI(t,e){Re(t,0,0,function(){var n=this.utcOffset(),i="+";return n<0&&(n=-n,i="-"),i+Jr(~~(n/60),2)+e+Jr(~~n%60,2)})}EI("Z",":");EI("ZZ","");fe("Z",am);fe("ZZ",am);St(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=dS(am,t)});var aW=/([\+\-]|\d\d)/gi;function dS(t,e){var n=(e||"").match(t),i,r,s;return n===null?null:(i=n[n.length-1]||[],r=(i+"").match(aW)||["-",0,0],s=+(r[1]*60)+Ze(r[2]),s===0?0:r[0]==="+"?s:-s)}function fS(t,e){var n,i;return e._isUTC?(n=e.clone(),i=(fr(t)||Th(t)?t.valueOf():Pt(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+i),X.updateOffset(n,!1),n):Pt(t).local()}function kC(t){return-Math.round(t._d.getTimezoneOffset())}X.updateOffset=function(){};function lW(t,e,n){var i=this._offset||0,r;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=dS(am,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(r=kC(this)),this._offset=t,this._isUTC=!0,r!=null&&this.add(r,"m"),i!==t&&(!e||this._changeInProgress?_I(this,Sr(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,X.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?i:kC(this)}function uW(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function cW(t){return this.utcOffset(0,t)}function hW(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(kC(this),"m")),this}function dW(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=dS(xF,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function fW(t){return this.isValid()?(t=t?Pt(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function gW(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function mW(){if(!ei(this._isDSTShifted))return this._isDSTShifted;var t={},e;return Zv(t,this),t=yI(t),t._a?(e=t._isUTC?os(t._a):Pt(t._a),this._isDSTShifted=this.isValid()&&oW(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function pW(){return this.isValid()?!this._isUTC:!1}function wW(){return this.isValid()?this._isUTC:!1}function TI(){return this.isValid()?this._isUTC&&this._offset===0:!1}var CW=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,vW=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Sr(t,e){var n=t,i=null,r,s,o;return Nf(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:$s(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(i=CW.exec(t))?(r=i[1]==="-"?-1:1,n={y:0,d:Ze(i[Gr])*r,h:Ze(i[ln])*r,m:Ze(i[ur])*r,s:Ze(i[Ps])*r,ms:Ze($C(i[Ea]*1e3))*r}):(i=vW.exec(t))?(r=i[1]==="-"?-1:1,n={y:Bo(i[2],r),M:Bo(i[3],r),w:Bo(i[4],r),d:Bo(i[5],r),h:Bo(i[6],r),m:Bo(i[7],r),s:Bo(i[8],r)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(o=SW(Pt(n.from),Pt(n.to)),n={},n.ms=o.milliseconds,n.M=o.months),s=new cm(n),Nf(t)&&st(t,"_locale")&&(s._locale=t._locale),Nf(t)&&st(t,"_isValid")&&(s._isValid=t._isValid),s}Sr.fn=cm.prototype;Sr.invalid=sW;function Bo(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function IE(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 SW(t,e){var n;return t.isValid()&&e.isValid()?(e=fS(e,t),t.isBefore(e)?n=IE(t,e):(n=IE(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function MI(t,e){return function(n,i){var r,s;return i!==null&&!isNaN(+i)&&(tI(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=i,i=s),r=Sr(n,i),_I(this,r,t),this}}function _I(t,e,n,i){var r=e._milliseconds,s=$C(e._days),o=$C(e._months);t.isValid()&&(i=i??!0,o&&hI(t,th(t,"Month")+o*n),s&&lI(t,"Date",th(t,"Date")+s*n),r&&t._d.setTime(t._d.valueOf()+r*n),i&&X.updateOffset(t,s||o))}var yW=MI(1,"add"),bW=MI(-1,"subtract");function II(t){return typeof t=="string"||t instanceof String}function RW(t){return fr(t)||Th(t)||II(t)||$s(t)||TW(t)||EW(t)||t===null||t===void 0}function EW(t){var e=Oa(t)&&!Xv(t),n=!1,i=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],r,s,o=i.length;for(r=0;r<o;r+=1)s=i[r],n=n||st(t,s);return e&&n}function TW(t){var e=dr(t),n=!1;return e&&(n=t.filter(function(i){return!$s(i)&&II(t)}).length===0),e&&n}function MW(t){var e=Oa(t)&&!Xv(t),n=!1,i=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],r,s;for(r=0;r<i.length;r+=1)s=i[r],n=n||st(t,s);return e&&n}function _W(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 IW(t,e){arguments.length===1&&(arguments[0]?RW(arguments[0])?(t=arguments[0],e=void 0):MW(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||Pt(),i=fS(n,this).startOf("day"),r=X.calendarFormat(this,i)||"sameElse",s=e&&(as(e[r])?e[r].call(this,n):e[r]);return this.format(s||this.localeData().calendar(r,this,Pt(n)))}function PW(){return new Mh(this)}function OW(t,e){var n=fr(t)?t:Pt(t);return this.isValid()&&n.isValid()?(e=Bi(e)||"millisecond",e==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf()):!1}function xW(t,e){var n=fr(t)?t:Pt(t);return this.isValid()&&n.isValid()?(e=Bi(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function AW(t,e,n,i){var r=fr(t)?t:Pt(t),s=fr(e)?e:Pt(e);return this.isValid()&&r.isValid()&&s.isValid()?(i=i||"()",(i[0]==="("?this.isAfter(r,n):!this.isBefore(r,n))&&(i[1]===")"?this.isBefore(s,n):!this.isAfter(s,n))):!1}function HW(t,e){var n=fr(t)?t:Pt(t),i;return this.isValid()&&n.isValid()?(e=Bi(e)||"millisecond",e==="millisecond"?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(e).valueOf()<=i&&i<=this.clone().endOf(e).valueOf())):!1}function NW(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function DW(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function LW(t,e,n){var i,r,s;if(!this.isValid())return NaN;if(i=fS(t,this),!i.isValid())return NaN;switch(r=(i.utcOffset()-this.utcOffset())*6e4,e=Bi(e),e){case"year":s=Df(this,i)/12;break;case"month":s=Df(this,i);break;case"quarter":s=Df(this,i)/3;break;case"second":s=(this-i)/1e3;break;case"minute":s=(this-i)/6e4;break;case"hour":s=(this-i)/36e5;break;case"day":s=(this-i-r)/864e5;break;case"week":s=(this-i-r)/6048e5;break;default:s=this-i}return n?s:Di(s)}function Df(t,e){if(t.date()<e.date())return-Df(e,t);var n=(e.year()-t.year())*12+(e.month()-t.month()),i=t.clone().add(n,"months"),r,s;return e-i<0?(r=t.clone().add(n-1,"months"),s=(e-i)/(i-r)):(r=t.clone().add(n+1,"months"),s=(e-i)/(r-i)),-(n+s)||0}X.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";X.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function $W(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function kW(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?Hf(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):as(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Hf(n,"Z")):Hf(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function FW(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",n,i,r,s;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),n="["+t+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",s=e+'[")]',this.format(n+i+r+s)}function VW(t){t||(t=this.isUtc()?X.defaultFormatUtc:X.defaultFormat);var e=Hf(this,t);return this.localeData().postformat(e)}function WW(t,e){return this.isValid()&&(fr(t)&&t.isValid()||Pt(t).isValid())?Sr({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function BW(t){return this.from(Pt(),t)}function UW(t,e){return this.isValid()&&(fr(t)&&t.isValid()||Pt(t).isValid())?Sr({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function YW(t){return this.to(Pt(),t)}function PI(t){var e;return t===void 0?this._locale._abbr:(e=Ws(t),e!=null&&(this._locale=e),this)}var OI=Wi("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 xI(){return this._locale}var lg=1e3,ql=60*lg,ug=60*ql,AI=(365*400+97)*24*ug;function Zl(t,e){return(t%e+e)%e}function HI(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-AI:new Date(t,e,n).valueOf()}function NI(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-AI:Date.UTC(t,e,n)}function zW(t){var e,n;if(t=Bi(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?NI:HI,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-=Zl(e+(this._isUTC?0:this.utcOffset()*ql),ug);break;case"minute":e=this._d.valueOf(),e-=Zl(e,ql);break;case"second":e=this._d.valueOf(),e-=Zl(e,lg);break}return this._d.setTime(e),X.updateOffset(this,!0),this}function GW(t){var e,n;if(t=Bi(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?NI:HI,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+=ug-Zl(e+(this._isUTC?0:this.utcOffset()*ql),ug)-1;break;case"minute":e=this._d.valueOf(),e+=ql-Zl(e,ql)-1;break;case"second":e=this._d.valueOf(),e+=lg-Zl(e,lg)-1;break}return this._d.setTime(e),X.updateOffset(this,!0),this}function jW(){return this._d.valueOf()-(this._offset||0)*6e4}function KW(){return Math.floor(this.valueOf()/1e3)}function XW(){return new Date(this.valueOf())}function qW(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function ZW(){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 QW(){return this.isValid()?this.toISOString():null}function JW(){return qv(this)}function eB(){return So({},We(this))}function tB(){return We(this).overflow}function nB(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Re("N",0,0,"eraAbbr");Re("NN",0,0,"eraAbbr");Re("NNN",0,0,"eraAbbr");Re("NNNN",0,0,"eraName");Re("NNNNN",0,0,"eraNarrow");Re("y",["y",1],"yo","eraYear");Re("y",["yy",2],0,"eraYear");Re("y",["yyy",3],0,"eraYear");Re("y",["yyyy",4],0,"eraYear");fe("N",gS);fe("NN",gS);fe("NNN",gS);fe("NNNN",fB);fe("NNNNN",gB);St(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,i){var r=n._locale.erasParse(t,i,n._strict);r?We(n).era=r:We(n).invalidEra=t});fe("y",uu);fe("yy",uu);fe("yyy",uu);fe("yyyy",uu);fe("yo",mB);St(["y","yy","yyy","yyyy"],On);St(["yo"],function(t,e,n,i){var r;n._locale._eraYearOrdinalRegex&&(r=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[On]=n._locale.eraYearOrdinalParse(t,r):e[On]=parseInt(t,10)});function iB(t,e){var n,i,r,s=this._eras||Ws("en")._eras;for(n=0,i=s.length;n<i;++n){switch(typeof s[n].since){case"string":r=X(s[n].since).startOf("day"),s[n].since=r.valueOf();break}switch(typeof s[n].until){case"undefined":s[n].until=1/0;break;case"string":r=X(s[n].until).startOf("day").valueOf(),s[n].until=r.valueOf();break}}return s}function rB(t,e,n){var i,r,s=this.eras(),o,a,l;for(t=t.toUpperCase(),i=0,r=s.length;i<r;++i)if(o=s[i].name.toUpperCase(),a=s[i].abbr.toUpperCase(),l=s[i].narrow.toUpperCase(),n)switch(e){case"N":case"NN":case"NNN":if(a===t)return s[i];break;case"NNNN":if(o===t)return s[i];break;case"NNNNN":if(l===t)return s[i];break}else if([o,a,l].indexOf(t)>=0)return s[i]}function sB(t,e){var n=t.since<=t.until?1:-1;return e===void 0?X(t.since).year():X(t.since).year()+(e-t.offset)*n}function oB(){var t,e,n,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),i[t].since<=n&&n<=i[t].until||i[t].until<=n&&n<=i[t].since)return i[t].name;return""}function aB(){var t,e,n,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),i[t].since<=n&&n<=i[t].until||i[t].until<=n&&n<=i[t].since)return i[t].narrow;return""}function lB(){var t,e,n,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),i[t].since<=n&&n<=i[t].until||i[t].until<=n&&n<=i[t].since)return i[t].abbr;return""}function uB(){var t,e,n,i,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=r[t].since<=r[t].until?1:-1,i=this.clone().startOf("day").valueOf(),r[t].since<=i&&i<=r[t].until||r[t].until<=i&&i<=r[t].since)return(this.year()-X(r[t].since).year())*n+r[t].offset;return this.year()}function cB(t){return st(this,"_erasNameRegex")||mS.call(this),t?this._erasNameRegex:this._erasRegex}function hB(t){return st(this,"_erasAbbrRegex")||mS.call(this),t?this._erasAbbrRegex:this._erasRegex}function dB(t){return st(this,"_erasNarrowRegex")||mS.call(this),t?this._erasNarrowRegex:this._erasRegex}function gS(t,e){return e.erasAbbrRegex(t)}function fB(t,e){return e.erasNameRegex(t)}function gB(t,e){return e.erasNarrowRegex(t)}function mB(t,e){return e._eraYearOrdinalRegex||uu}function mS(){var t=[],e=[],n=[],i=[],r,s,o,a,l,u=this.eras();for(r=0,s=u.length;r<s;++r)o=Ds(u[r].name),a=Ds(u[r].abbr),l=Ds(u[r].narrow),e.push(o),t.push(a),n.push(l),i.push(o),i.push(a),i.push(l);this._erasRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}Re(0,["gg",2],0,function(){return this.weekYear()%100});Re(0,["GG",2],0,function(){return this.isoWeekYear()%100});function hm(t,e){Re(0,[t,t.length],0,e)}hm("gggg","weekYear");hm("ggggg","weekYear");hm("GGGG","isoWeekYear");hm("GGGGG","isoWeekYear");fe("G",om);fe("g",om);fe("GG",Ot,vi);fe("gg",Ot,vi);fe("GGGG",nS,tS);fe("gggg",nS,tS);fe("GGGGG",sm,im);fe("ggggg",sm,im);Ih(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,i){e[i.substr(0,2)]=Ze(t)});Ih(["gg","GG"],function(t,e,n,i){e[i]=X.parseTwoDigitYear(t)});function pB(t){return DI.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function wB(t){return DI.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function CB(){return Ls(this.year(),1,4)}function vB(){return Ls(this.isoWeekYear(),1,4)}function SB(){var t=this.localeData()._week;return Ls(this.year(),t.dow,t.doy)}function yB(){var t=this.localeData()._week;return Ls(this.weekYear(),t.dow,t.doy)}function DI(t,e,n,i,r){var s;return t==null?ih(this,i,r).year:(s=Ls(t,i,r),e>s&&(e=s),bB.call(this,t,e,n,i,r))}function bB(t,e,n,i,r){var s=gI(t,e,n,i,r),o=nh(s.year,0,s.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}Re("Q",0,"Qo","quarter");fe("Q",iI);St("Q",function(t,e){e[Is]=(Ze(t)-1)*3});function RB(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}Re("D",["DD",2],"Do","date");fe("D",Ot,cu);fe("DD",Ot,vi);fe("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});St(["D","DD"],Gr);St("Do",function(t,e){e[Gr]=Ze(t.match(Ot)[0])});var LI=hu("Date",!0);Re("DDD",["DDDD",3],"DDDo","dayOfYear");fe("DDD",rm);fe("DDDD",rI);St(["DDD","DDDD"],function(t,e,n){n._dayOfYear=Ze(t)});function EB(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}Re("m",["mm",2],0,"minute");fe("m",Ot,iS);fe("mm",Ot,vi);St(["m","mm"],ur);var TB=hu("Minutes",!1);Re("s",["ss",2],0,"second");fe("s",Ot,iS);fe("ss",Ot,vi);St(["s","ss"],Ps);var MB=hu("Seconds",!1);Re("S",0,0,function(){return~~(this.millisecond()/100)});Re(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Re(0,["SSS",3],0,"millisecond");Re(0,["SSSS",4],0,function(){return this.millisecond()*10});Re(0,["SSSSS",5],0,function(){return this.millisecond()*100});Re(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Re(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Re(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Re(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});fe("S",rm,iI);fe("SS",rm,vi);fe("SSS",rm,rI);var yo,$I;for(yo="SSSS";yo.length<=9;yo+="S")fe(yo,uu);function _B(t,e){e[Ea]=Ze(("0."+t)*1e3)}for(yo="S";yo.length<=9;yo+="S")St(yo,_B);$I=hu("Milliseconds",!1);Re("z",0,0,"zoneAbbr");Re("zz",0,0,"zoneName");function IB(){return this._isUTC?"UTC":""}function PB(){return this._isUTC?"Coordinated Universal Time":""}var J=Mh.prototype;J.add=yW;J.calendar=IW;J.clone=PW;J.diff=LW;J.endOf=GW;J.format=VW;J.from=WW;J.fromNow=BW;J.to=UW;J.toNow=YW;J.get=FF;J.invalidAt=tB;J.isAfter=OW;J.isBefore=xW;J.isBetween=AW;J.isSame=HW;J.isSameOrAfter=NW;J.isSameOrBefore=DW;J.isValid=JW;J.lang=OI;J.locale=PI;J.localeData=xI;J.max=JV;J.min=QV;J.parsingFlags=eB;J.set=VF;J.startOf=zW;J.subtract=bW;J.toArray=qW;J.toObject=ZW;J.toDate=XW;J.toISOString=kW;J.inspect=FW;typeof Symbol<"u"&&Symbol.for!=null&&(J[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});J.toJSON=QW;J.toString=$W;J.unix=KW;J.valueOf=jW;J.creationData=nB;J.eraName=oB;J.eraNarrow=aB;J.eraAbbr=lB;J.eraYear=uB;J.year=aI;J.isLeapYear=kF;J.weekYear=pB;J.isoWeekYear=wB;J.quarter=J.quarters=RB;J.month=dI;J.daysInMonth=XF;J.week=J.weeks=iV;J.isoWeek=J.isoWeeks=rV;J.weeksInYear=SB;J.weeksInWeekYear=yB;J.isoWeeksInYear=CB;J.isoWeeksInISOWeekYear=vB;J.date=LI;J.day=J.days=wV;J.weekday=CV;J.isoWeekday=vV;J.dayOfYear=EB;J.hour=J.hours=MV;J.minute=J.minutes=TB;J.second=J.seconds=MB;J.millisecond=J.milliseconds=$I;J.utcOffset=lW;J.utc=cW;J.local=hW;J.parseZone=dW;J.hasAlignedHourOffset=fW;J.isDST=gW;J.isLocal=pW;J.isUtcOffset=wW;J.isUtc=TI;J.isUTC=TI;J.zoneAbbr=IB;J.zoneName=PB;J.dates=Wi("dates accessor is deprecated. Use date instead.",LI);J.months=Wi("months accessor is deprecated. Use month instead",dI);J.years=Wi("years accessor is deprecated. Use year instead",aI);J.zone=Wi("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",uW);J.isDSTShifted=Wi("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",mW);function OB(t){return Pt(t*1e3)}function xB(){return Pt.apply(null,arguments).parseZone()}function kI(t){return t}var ot=Qv.prototype;ot.calendar=pF;ot.longDateFormat=SF;ot.invalidDate=bF;ot.ordinal=TF;ot.preparse=kI;ot.postformat=kI;ot.relativeTime=_F;ot.pastFuture=IF;ot.set=gF;ot.eras=iB;ot.erasParse=rB;ot.erasConvertYear=sB;ot.erasAbbrRegex=hB;ot.erasNameRegex=cB;ot.erasNarrowRegex=dB;ot.months=zF;ot.monthsShort=GF;ot.monthsParse=KF;ot.monthsRegex=ZF;ot.monthsShortRegex=qF;ot.week=JF;ot.firstDayOfYear=nV;ot.firstDayOfWeek=tV;ot.weekdays=dV;ot.weekdaysMin=gV;ot.weekdaysShort=fV;ot.weekdaysParse=pV;ot.weekdaysRegex=SV;ot.weekdaysShortRegex=yV;ot.weekdaysMinRegex=bV;ot.isPM=EV;ot.meridiem=_V;function cg(t,e,n,i){var r=Ws(),s=os().set(i,e);return r[n](s,t)}function FI(t,e,n){if($s(t)&&(e=t,t=void 0),t=t||"",e!=null)return cg(t,e,n,"month");var i,r=[];for(i=0;i<12;i++)r[i]=cg(t,i,n,"month");return r}function pS(t,e,n,i){typeof t=="boolean"?($s(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,$s(e)&&(n=e,e=void 0),e=e||"");var r=Ws(),s=t?r._week.dow:0,o,a=[];if(n!=null)return cg(e,(n+s)%7,i,"day");for(o=0;o<7;o++)a[o]=cg(e,(o+s)%7,i,"day");return a}function AB(t,e){return FI(t,e,"months")}function HB(t,e){return FI(t,e,"monthsShort")}function NB(t,e,n){return pS(t,e,n,"weekdays")}function DB(t,e,n){return pS(t,e,n,"weekdaysShort")}function LB(t,e,n){return pS(t,e,n,"weekdaysMin")}Mo("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=Ze(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}});X.lang=Wi("moment.lang is deprecated. Use moment.locale instead.",Mo);X.langData=Wi("moment.langData is deprecated. Use moment.localeData instead.",Ws);var cs=Math.abs;function $B(){var t=this._data;return this._milliseconds=cs(this._milliseconds),this._days=cs(this._days),this._months=cs(this._months),t.milliseconds=cs(t.milliseconds),t.seconds=cs(t.seconds),t.minutes=cs(t.minutes),t.hours=cs(t.hours),t.months=cs(t.months),t.years=cs(t.years),this}function VI(t,e,n,i){var r=Sr(e,n);return t._milliseconds+=i*r._milliseconds,t._days+=i*r._days,t._months+=i*r._months,t._bubble()}function kB(t,e){return VI(this,t,e,1)}function FB(t,e){return VI(this,t,e,-1)}function PE(t){return t<0?Math.floor(t):Math.ceil(t)}function VB(){var t=this._milliseconds,e=this._days,n=this._months,i=this._data,r,s,o,a,l;return t>=0&&e>=0&&n>=0||t<=0&&e<=0&&n<=0||(t+=PE(FC(n)+e)*864e5,e=0,n=0),i.milliseconds=t%1e3,r=Di(t/1e3),i.seconds=r%60,s=Di(r/60),i.minutes=s%60,o=Di(s/60),i.hours=o%24,e+=Di(o/24),l=Di(WI(e)),n+=l,e-=PE(FC(l)),a=Di(n/12),n%=12,i.days=e,i.months=n,i.years=a,this}function WI(t){return t*4800/146097}function FC(t){return t*146097/4800}function WB(t){if(!this.isValid())return NaN;var e,n,i=this._milliseconds;if(t=Bi(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+i/864e5,n=this._months+WI(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(FC(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return e*24+i/36e5;case"minute":return e*1440+i/6e4;case"second":return e*86400+i/1e3;case"millisecond":return Math.floor(e*864e5)+i;default:throw new Error("Unknown unit "+t)}}function Bs(t){return function(){return this.as(t)}}var BI=Bs("ms"),BB=Bs("s"),UB=Bs("m"),YB=Bs("h"),zB=Bs("d"),GB=Bs("w"),jB=Bs("M"),KB=Bs("Q"),XB=Bs("y"),qB=BI;function ZB(){return Sr(this)}function QB(t){return t=Bi(t),this.isValid()?this[t+"s"]():NaN}function Ka(t){return function(){return this.isValid()?this._data[t]:NaN}}var JB=Ka("milliseconds"),eU=Ka("seconds"),tU=Ka("minutes"),nU=Ka("hours"),iU=Ka("days"),rU=Ka("months"),sU=Ka("years");function oU(){return Di(this.days()/7)}var ys=Math.round,Bl={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function aU(t,e,n,i,r){return r.relativeTime(e||1,!!n,t,i)}function lU(t,e,n,i){var r=Sr(t).abs(),s=ys(r.as("s")),o=ys(r.as("m")),a=ys(r.as("h")),l=ys(r.as("d")),u=ys(r.as("M")),c=ys(r.as("w")),h=ys(r.as("y")),d=s<=n.ss&&["s",s]||s<n.s&&["ss",s]||o<=1&&["m"]||o<n.m&&["mm",o]||a<=1&&["h"]||a<n.h&&["hh",a]||l<=1&&["d"]||l<n.d&&["dd",l];return n.w!=null&&(d=d||c<=1&&["w"]||c<n.w&&["ww",c]),d=d||u<=1&&["M"]||u<n.M&&["MM",u]||h<=1&&["y"]||["yy",h],d[2]=e,d[3]=+t>0,d[4]=i,aU.apply(null,d)}function uU(t){return t===void 0?ys:typeof t=="function"?(ys=t,!0):!1}function cU(t,e){return Bl[t]===void 0?!1:e===void 0?Bl[t]:(Bl[t]=e,t==="s"&&(Bl.ss=e-1),!0)}function hU(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,i=Bl,r,s;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(i=Object.assign({},Bl,e),e.s!=null&&e.ss==null&&(i.ss=e.s-1)),r=this.localeData(),s=lU(this,!n,i,r),n&&(s=r.pastFuture(+this,s)),r.postformat(s)}var Ep=Math.abs;function Ja(t){return(t>0)-(t<0)||+t}function dm(){if(!this.isValid())return this.localeData().invalidDate();var t=Ep(this._milliseconds)/1e3,e=Ep(this._days),n=Ep(this._months),i,r,s,o,a=this.asSeconds(),l,u,c,h;return a?(i=Di(t/60),r=Di(i/60),t%=60,i%=60,s=Di(n/12),n%=12,o=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",u=Ja(this._months)!==Ja(a)?"-":"",c=Ja(this._days)!==Ja(a)?"-":"",h=Ja(this._milliseconds)!==Ja(a)?"-":"",l+"P"+(s?u+s+"Y":"")+(n?u+n+"M":"")+(e?c+e+"D":"")+(r||i||t?"T":"")+(r?h+r+"H":"")+(i?h+i+"M":"")+(t?h+o+"S":"")):"P0D"}var it=cm.prototype;it.isValid=rW;it.abs=$B;it.add=kB;it.subtract=FB;it.as=WB;it.asMilliseconds=BI;it.asSeconds=BB;it.asMinutes=UB;it.asHours=YB;it.asDays=zB;it.asWeeks=GB;it.asMonths=jB;it.asQuarters=KB;it.asYears=XB;it.valueOf=qB;it._bubble=VB;it.clone=ZB;it.get=QB;it.milliseconds=JB;it.seconds=eU;it.minutes=tU;it.hours=nU;it.days=iU;it.weeks=oU;it.months=rU;it.years=sU;it.humanize=hU;it.toISOString=dm;it.toString=dm;it.toJSON=dm;it.locale=PI;it.localeData=xI;it.toIsoString=Wi("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",dm);it.lang=OI;Re("X",0,0,"unix");Re("x",0,0,"valueOf");fe("x",om);fe("X",AF);St("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)});St("x",function(t,e,n){n._d=new Date(Ze(t))});//! moment.js
|
|
X.version="2.30.1";dF(Pt);X.fn=J;X.min=eW;X.max=tW;X.now=nW;X.utc=os;X.unix=OB;X.months=AB;X.isDate=Th;X.locale=Mo;X.invalid=nm;X.duration=Sr;X.isMoment=fr;X.weekdays=NB;X.parseZone=xB;X.localeData=Ws;X.isDuration=Nf;X.monthsShort=HB;X.weekdaysMin=LB;X.defineLocale=lS;X.updateLocale=xV;X.locales=AV;X.weekdaysShort=DB;X.normalizeUnits=Bi;X.relativeTimeRounding=uU;X.relativeTimeThreshold=cU;X.calendarFormat=_W;X.prototype=J;X.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"};function dU(t){const e=t.length;let n=0;for(;n<e;)t[n]=[t[n]],n+=1}function OE(t,e){const n=e.length;let i=0;for(;i<n;)t.push(e[i]),i+=1}function Lf(t){const e=[];if(!t||t.length===0||!t[0]||t[0].length===0)return e;const n=t.length,i=t[0].length;for(let r=0;r<n;r++)for(let s=0;s<i;s++)e[s]||(e[s]=[]),e[s][r]=t[r][s];return e}function Hn(t,e,n,i){let r=-1,s=t,o=n;Array.isArray(t)||(s=Array.from(t));const a=s.length;for(r+=1;r<a;)o=e(o,s[r],r,s),r+=1;return o}function gr(t,e){let n=0,i=t;Array.isArray(t)||(i=Array.from(t));const r=i.length,s=[];let o=-1;for(;n<r;){const a=i[n];e(a,n,i)&&(o+=1,s[o]=a),n+=1}return s}function Ke(t,e){let n=0,i=t;Array.isArray(t)||(i=Array.from(t));const r=i.length,s=[];let o=-1;for(;n<r;){const a=i[n];o+=1,s[o]=e(a,n,i),n+=1}return s}function M(t,e){let n=0,i=t;Array.isArray(t)||(i=Array.from(t));const r=i.length;for(;n<r&&e(i[n],n,i)!==!1;)n+=1;return t}function UI(t){const e=[];return M(t,n=>{e.indexOf(n)===-1&&e.push(n)}),e}function xE(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const[i,...r]=[...e];let s=i;return M(r,o=>{s=s.filter(a=>!o.includes(a))}),s}function AE(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ";return t.split(e)}function ct(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return Hn(t,(s,o,a)=>{const l=o.replace(/\r?\n\s*/g,""),u=n[a]?n[a]:"";return s+l+u},"").trim()}function Qt(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 de(t){return typeof t<"u"}function Mt(t){return typeof t>"u"}function Xt(t){return t===null||t===""||Mt(t)}function fU(t){return Object.prototype.toString.call(t)==="[object RegExp]"}const Tc="length",Ac=t=>parseInt(t,16),HE=t=>parseInt(t,10),hg=(t,e,n)=>t.substr(e,n),Hc=t=>t.codePointAt(0)-65,VC=t=>`${t}`.replace(/\-/g,""),gU=t=>Ac(hg(VC(t),Ac("12"),Hc("F")))/(Ac(hg(VC(t),Hc("B"),~~![][Tc]))||9),mU=()=>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 NE=!1;const DE={invalid:()=>ct`
|
|
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 ct`
|
|
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:()=>ct`
|
|
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:()=>""},LE={invalid:()=>ct`
|
|
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 ct`
|
|
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:()=>ct`
|
|
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 pU(t,e){const n=!Xt(t),i=typeof t=="string"&&t.toLowerCase()==="non-commercial-and-evaluation",r="14.4.0";let s,o="invalid",a="invalid";t=VC(t||"");const l=wU(t);if(n||i||l)if(l){const u=X("11/06/2024","DD/MM/YYYY"),c=Math.floor(u.toDate().getTime()/864e5),h=gU(t);s=X((h+1)*864e5,"x").format("MMMM DD, YYYY"),c>h?(o="expired",a="expired"):(o="valid",a="valid")}else i?(o="non_commercial",a="valid"):(o="invalid",a="invalid");else o="missing",a="missing";if(mU()&&(o="valid",a="valid"),!NE&&o!=="valid"&&(DE[o]({keyValidityDate:s,hotVersion:r})&&console[o==="non_commercial"?"info":"warn"](DE[o]({keyValidityDate:s,hotVersion:r})),NE=!0),a!=="valid"&&e.parentNode&&LE[a]({keyValidityDate:s,hotVersion:r})){const c=document.createElement("div");c.className="hot-display-license-info",c.innerHTML=LE[a]({keyValidityDate:s,hotVersion:r}),e.parentNode.insertBefore(c,e.nextSibling)}}function wU(t){let e=[][Tc],n=e;if(t[Tc]!==Hc("Z"))return!1;for(let i="",r="B<H4P+".split(""),s=Hc(r.shift());s;s=Hc(r.shift()||"A"))--s<""[Tc]?n=n|(HE(`${HE(Ac(i)+(Ac(hg(t,Math.abs(s),2))+[]).padStart(2,"0"))}`)%97||2)>>1:i=hg(t,s,s?r[Tc]===1?9:8:6);return n===e}function mr(t){return t[0].toUpperCase()+t.substr(1)}function YI(){function t(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return t()+t()+t()+t()}function zI(t){return/^([0-9][0-9]?%$)|(^100%$)/.test(t)}function GI(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return`${t}`.replace(/(?:\\)?\[([^[\]]+)]/g,(n,i)=>n.charAt(0)==="\\"?n.substr(1,n.length-1):e[i]===void 0?"":e[i])}function $E(t){return wS(`${t}`,{ALLOWED_TAGS:[]})}function wS(t,e){return hF.sanitize(t,e)}const du=t=>["tabindex",t],CU=()=>["role","treegrid"],qr=()=>["role","presentation"],vU=()=>["role","gridcell"],SU=()=>["role","rowheader"],jI=()=>["role","rowgroup"],yU=()=>["role","columnheader"],WC=()=>["role","row"],bU=()=>["role","menu"],RU=()=>["role","menuitem"],EU=()=>["role","combobox"],KI=()=>["role","listbox"],TU=()=>["role","option"],MU=()=>["role","checkbox"],_U=()=>["scope","col"],IU=()=>["scope","row"],PU=()=>["type","text"],CS=t=>["aria-label",t],Us=()=>["aria-hidden","true"],OU=()=>["aria-disabled","true"],xU=()=>["aria-multiselectable","true"],XI=t=>["aria-haspopup",t],qI=t=>["aria-rowcount",t],fm=t=>["aria-colcount",t],ZI=t=>["aria-rowindex",t],vS=t=>["aria-colindex",t],ki=t=>["aria-expanded",t],AU=t=>["aria-sort",t],kE=()=>["aria-readonly","true"],FE=()=>["aria-invalid","true"],HU=t=>["aria-checked",t],SS=()=>["aria-selected","true"],NU=()=>["aria-autocomplete","list"],DU=t=>["aria-controls",t],LU=t=>["aria-activedescendant",t],$U=t=>["aria-live",t],kU=t=>["aria-relevant",t],FU=t=>["aria-setsize",t],VU=t=>["aria-posinset",t];function WU(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,i=null,r=t;for(;r!==null;){if(n===e){i=r;break}r.host&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE?r=r.host:(n+=1,r=r.parentNode)}return i}function BU(t,e){const n=t.closest(".handsontable");return!!n&&(n.parentNode===e||n===e)}function UU(t){return Object.getPrototypeOf(t.parent)&&t.frameElement}function iu(t){return UU(t)&&t.parent}function Aa(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;const{ELEMENT_NODE:i,DOCUMENT_FRAGMENT_NODE:r}=Node;let s=t;for(;s!=null&&s!==n;){const{nodeType:o,nodeName:a}=s;if(o===i&&(e.includes(a)||e.includes(s)))return s;const{host:l}=s;l&&o===r?s=l:s=s.parentNode}return null}function rd(t,e,n){const i=[];let r=t;for(;r&&(r=Aa(r,e,n),!(!r||n&&!n.contains(r)));)i.push(r),r.host&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE?r=r.host:r=r.parentNode;const s=i.length;return s?i[s-1]:null}function xa(t,e){let n=t.parentNode,i=[];for(typeof e=="string"?t.defaultView?i=Array.prototype.slice.call(t.querySelectorAll(e),0):i=Array.prototype.slice.call(t.ownerDocument.querySelectorAll(e),0):i.push(e);n!==null;){if(i.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function YU(t){let e=0,n=t;if(n.previousSibling)for(;n=n.previousSibling;)e+=1;return e}function Uo(t,e,n){const i=n.parentElement.querySelector(`.ht_clone_${t}`);return i?i.contains(e):null}function QI(t){return!t||!t.length?[]:t.filter(e=>!!e)}function JI(t,e){if(!t||!t.length)return{regexFree:[],regexes:[]};const n=[],i=[];return i.push(...t.filter(r=>{const s=r instanceof RegExp;return s&&e&&n.push(r),!s})),{regexFree:i,regexes:n}}function _e(t,e){return t.classList===void 0||typeof e!="string"||e===""?!1:t.classList.contains(e)}function q(t,e){typeof e=="string"&&(e=e.split(" ")),e=QI(e),e.length>0&&t.classList.add(...e)}function He(t,e){typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);let{regexFree:n,regexes:i}=JI(e,!0);n=QI(n),n.length>0&&t.classList.remove(...n),i.forEach(r=>{t.classList.forEach(s=>{r.test(s)&&t.classList.remove(s)})})}function Ee(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(i=>{Array.isArray(i)&&i[0]!==""&&t.setAttribute(...i)})}function fu(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:i}=JI(e,!0);n.forEach(r=>{r!==""&&t.removeAttribute(r)}),i.forEach(r=>{t.getAttributeNames().forEach(s=>{r.test(s)&&t.removeAttribute(s)})})}function eP(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--)eP(e[n])}}function es(t){let e;for(;e=t.lastChild;)t.removeChild(e)}const zU=/(<(.*)>|&(.*);)/;function gu(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;zU.test(e)?t.innerHTML=n?wS(e):e:Ha(t,e)}function Ha(t,e){const n=t.firstChild;n&&n.nodeType===3&&n.nextSibling===null?n.textContent=e:(es(t),t.appendChild(t.ownerDocument.createTextNode(e)))}function Na(t){const e=t.ownerDocument.documentElement;let n=t;for(;n!==e;){if(n===null)return!1;if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE)if(n.host){if(n.host.impl)return Na(n.host.impl);if(n.host)return Na(n.host);throw new Error("Lost in Web Components world")}else return!1;else if(xo(n).display==="none")return!1;n=n.parentNode}return!0}function pn(t){const e=t.ownerDocument,n=e.defaultView,i=e.documentElement;let r=t,s,o,a;for(s=r.offsetLeft,o=r.offsetTop,a=r;(r=r.offsetParent)&&!(r===e.body||!("offsetLeft"in r));)s+=r.offsetLeft,o+=r.offsetTop,a=r;return a&&a.style.position==="fixed"&&(s+=n.pageXOffset||i.scrollLeft,o+=n.pageYOffset||i.scrollTop),{left:s,top:o}}function tP(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollY}function yS(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollX}function bS(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?tP(e):t.scrollTop}function nP(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?yS(e):t.scrollLeft}function dg(t){let e=t.ownerDocument,n=e?e.defaultView:void 0;e||(e=t.document?t.document:t,n=e.defaultView);const i=["auto","scroll"];let r=t.parentNode;for(;r&&r.style&&e.body!==r;){let{overflow:s,overflowX:o,overflowY:a}=r.style;if([s,o,a].includes("scroll"))return r;if({overflow:s,overflowX:o,overflowY:a}=n.getComputedStyle(r),i.includes(s)||i.includes(o)||i.includes(a)||r.clientHeight<=r.scrollHeight+1&&(i.includes(a)||i.includes(s))||r.clientWidth<=r.scrollWidth+1&&(i.includes(o)||i.includes(s)))return r;r=r.parentNode}return n}function GU(t){return t.scrollHeight-t.clientHeight}function jU(t){return t.scrollWidth-t.clientWidth}function ru(t){const e=t.ownerDocument,n=e.defaultView;let i=t.parentNode;for(;i&&i.style&&e.body!==i;){if(i.style.overflow!=="visible"&&i.style.overflow!=="")return i;const r=xo(i,n),s=["scroll","hidden","auto"],o=r.getPropertyValue("overflow"),a=r.getPropertyValue("overflow-y"),l=r.getPropertyValue("overflow-x");if(s.includes(o)||s.includes(a)||s.includes(l))return i;i=i.parentNode}return n}function sh(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 i=t.style[e];if(i!==""&&i!==void 0)return i;const r=xo(t,n);if(r[e]!==""&&r[e]!==void 0)return r[e]}function xo(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t.currentStyle||e.getComputedStyle(t)}function Ct(t){return t.offsetWidth}function Yt(t){return t.offsetHeight}function Ul(t){return t.clientHeight||t.innerHeight}function iP(t){return t.clientWidth||t.innerWidth}function rP(t){return t.selectionStart?t.selectionStart:0}function KU(t){return t.selectionEnd?t.selectionEnd:0}function VE(){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 gm(t,e,n){if(n===void 0&&(n=e),t.setSelectionRange){t.focus();try{t.setSelectionRange(e,n)}catch{const r=t.parentNode,s=r.style.display;r.style.display="block",t.setSelectionRange(e,n),r.style.display=s}}}let Tp;function XU(){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");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||t.documentElement).appendChild(n);const i=e.offsetWidth;n.style.overflow="scroll";let r=e.offsetWidth;return i===r&&(r=n.clientWidth),(t.body||t.documentElement).removeChild(n),i-r}function wn(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return Tp===void 0&&(Tp=XU(t)),Tp}function qU(t){return t.offsetWidth!==t.clientWidth}function ZU(t){return t.offsetHeight!==t.clientHeight}function RS(t,e,n){t.style.transform=`translate3d(${e},${n},0)`}function mm(t){t.style.transform&&t.style.transform!==""&&(t.style.transform="")}function $f(t){return t&&(["INPUT","SELECT","TEXTAREA"].indexOf(t.nodeName)>-1||t.contentEditable==="true")}function sP(t){return $f(t)&&t.hasAttribute("data-hot-input")===!1}function oP(t){return!t.parentNode}function QU(t,e){new IntersectionObserver((i,r)=>{i.forEach(s=>{s.isIntersecting&&t.offsetParent!==null&&(e(),r.unobserve(t))})},{root:t.ownerDocument.body}).observe(t)}function aP(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 i=t.ownerDocument,r=i.createRange(),s=i.defaultView.getSelection();Ee(t,"contenteditable",!0),n&&Ee(t,...Us()),e&&q(t,"invisibleSelection"),r.selectNodeContents(t),s.removeAllRanges(),s.addRange(r)}function lP(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&&He(t,"invisibleSelection"),t.removeAttribute("contenteditable")}function JU(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;aP(t,n),e(),lP(t,n)}function Et(t){return typeof t=="function"}function ES(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200,n=null,i;function r(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return n&&clearTimeout(n),n=setTimeout(()=>{i=t.apply(this,o)},e),i}return r}function uP(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return t.apply(this,n.concat(o))}}function eY(t){const e=t.length;function n(i){return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];const l=i.concat(o);let u;return l.length>=e?u=t.apply(this,l):u=n(l),u}}return n([])}function BC(t,e,n,i,r,s,o,a){return de(a)?t.call(e,n,i,r,s,o,a):de(o)?t.call(e,n,i,r,s,o):de(s)?t.call(e,n,i,r,s):de(r)?t.call(e,n,i,r):de(i)?t.call(e,n,i):de(n)?t.call(e,n):t.call(e)}var tY=un,WE=A_,nY=bn,BE=Ba,iY=Wv,UE=tY([].push),rY=function(t){if(nY(t))return t;if(WE(t)){for(var e=t.length,n=[],i=0;i<e;i++){var r=t[i];typeof r=="string"?UE(n,r):(typeof r=="number"||BE(r)==="Number"||BE(r)==="String")&&UE(n,iY(r))}var s=n.length,o=!0;return function(a,l){if(o)return o=!1,l;if(WE(this))return l;for(var u=0;u<s;u++)if(n[u]===a)return l}}},sY=An,cP=lu,hP=tm,oY=vr,Ph=un,dP=Ci,YE=bn,zE=Hv,fP=jv,aY=rY,lY=Av,uY=String,_o=cP("JSON","stringify"),sd=Ph(/./.exec),GE=Ph("".charAt),cY=Ph("".charCodeAt),hY=Ph("".replace),dY=Ph(1 .toString),fY=/[\uD800-\uDFFF]/g,jE=/^[\uD800-\uDBFF]$/,KE=/^[\uDC00-\uDFFF]$/,XE=!lY||dP(function(){var t=cP("Symbol")("stringify detection");return _o([t])!=="[null]"||_o({a:t})!=="{}"||_o(Object(t))!=="{}"}),qE=dP(function(){return _o("\uDF06\uD834")!=='"\\udf06\\ud834"'||_o("\uDEAD")!=='"\\udead"'}),gY=function(t,e){var n=fP(arguments),i=aY(e);if(!(!YE(i)&&(t===void 0||zE(t))))return n[1]=function(r,s){if(YE(i)&&(s=oY(i,this,uY(r),s)),!zE(s))return s},hP(_o,null,n)},mY=function(t,e,n){var i=GE(n,e-1),r=GE(n,e+1);return sd(jE,t)&&!sd(KE,r)||sd(KE,t)&&!sd(jE,i)?"\\u"+dY(cY(t,0),16):t};_o&&sY({target:"JSON",stat:!0,arity:3,forced:XE||qE},{stringify:function(e,n,i){var r=fP(arguments),s=hP(XE?gY:_o,null,r);return qE&&typeof s=="string"?hY(s,fY,mY):s}});function oh(t){let e;return Array.isArray(t)?e=t.length?new Array(t.length).fill(null):[]:(e={},Ue(t,(n,i)=>{i!=="__children"&&(n&&typeof n=="object"&&!Array.isArray(n)?e[i]=oh(n):Array.isArray(n)?n.length&&typeof n[0]=="object"&&!Array.isArray(n[0])?e[i]=[oh(n[0])]:e[i]=[]:e[i]=null)})),e}function Ys(t,e){return e.prototype.constructor=e,t.prototype=new e,t.prototype.constructor=t,t}function tn(t,e,n){const i=Array.isArray(n);return Ue(e,(r,s)=>{(i===!1||n.includes(s))&&(t[s]=r)}),t}function pm(t,e){Ue(e,(n,i)=>{e[i]&&typeof e[i]=="object"?(t[i]||(Array.isArray(e[i])?t[i]=[]:Object.prototype.toString.call(e[i])==="[object Date]"?t[i]=e[i]:t[i]={}),pm(t[i],e[i])):t[i]=e[i]})}function Yn(t){return typeof t=="object"?JSON.parse(JSON.stringify(t)):t}function pr(t){const e={};return Ue(t,(n,i)=>{e[i]=n}),e}function bt(t){t.MIXINS||(t.MIXINS=[]);for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return M(n,r=>{t.MIXINS.push(r.MIXIN_NAME),Ue(r,(s,o)=>{if(t.prototype[o]!==void 0)throw new Error(`Mixin conflict. Property '${o}' already exist and cannot be overwritten.`);if(typeof s=="function")t.prototype[o]=s;else{const a=function(c,h){const d=`_${c}`,g=p=>{let C=p;return(Array.isArray(C)||ke(C))&&(C=Yn(C)),C};return function(){return this[d]===void 0&&(this[d]=g(h)),this[d]}},l=function(c){const h=`_${c}`;return function(d){this[h]=d}};Object.defineProperty(t.prototype,o,{get:a(o,s),set:l(o),configurable:!0})}})}),t}function TS(t,e){return JSON.stringify(t)===JSON.stringify(e)}function ke(t){return Object.prototype.toString.call(t)==="[object Object]"}function zs(t,e,n,i){i.value=n,i.writable=i.writable!==!1,i.enumerable=i.enumerable!==!1,i.configurable=i.configurable!==!1,Object.defineProperty(t,e,i)}function Ue(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 pY(t,e){const n=e.split(".");let i=t;return Ue(n,r=>{if(i=i[r],i===void 0)return i=void 0,!1}),i}function Mp(t,e,n){const i=e.split(".");let r=t;i.forEach((s,o)=>{o!==i.length-1?(Ut(r,s)||(r[s]={}),r=r[s]):r[s]=n})}function MS(t){if(!ke(t))return 0;const e=function(n){let i=0;return ke(n)?Ue(n,(r,s)=>{s!=="__children"&&(i+=e(r))}):i+=1,i};return e(t)}function cr(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"value";const n=`_${e}`,i={_touched:!1,[n]:t,isTouched(){return this._touched}};return Object.defineProperty(i,e,{get(){return this[n]},set(r){this._touched=!0,this[n]=r},enumerable:!0,configurable:!0}),i}function Ut(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function _S(t){return window.requestAnimationFrame(t)}function fg(t){window.cancelAnimationFrame(t)}function gP(){return"ontouchstart"in window}function wY(){return typeof window<"u"}let el;function CY(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return el||(typeof Intl=="object"?el=new Intl.Collator(t,e).compare:typeof String.prototype.localeCompare=="function"?el=(n,i)=>`${n}`.localeCompare(i):el=(n,i)=>n===i?0:n>i?-1:1,el)}const Oi=t=>{const e={value:!1};return e.test=(n,i)=>{e.value=t(n,i)},e},Lo={chrome:Oi((t,e)=>/Chrome/.test(t)&&/Google/.test(e)),chromeWebKit:Oi(t=>/CriOS/.test(t)),edge:Oi(t=>/Edge/.test(t)),edgeWebKit:Oi(t=>/EdgiOS/.test(t)),firefox:Oi(t=>/Firefox/.test(t)),firefoxWebKit:Oi(t=>/FxiOS/.test(t)),mobile:Oi(t=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t)),safari:Oi((t,e)=>/Safari/.test(t)&&/Apple Computer/.test(e))},Oh={mac:Oi(t=>/^Mac/.test(t)),win:Oi(t=>/^Win/.test(t)),linux:Oi(t=>/^Linux/.test(t)),ios:Oi(t=>/iPhone|iPad|iPod/i.test(t))};function vY(){let{userAgent:t=navigator.userAgent,vendor:e=navigator.vendor}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ue(Lo,n=>{let{test:i}=n;return void i(t,e)})}function SY(){let{platform:t=navigator.platform}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ue(Oh,e=>{let{test:n}=e;return void n(t)})}wY()&&(vY(),SY());function mP(){return Lo.chrome.value}function yY(){return Lo.chromeWebKit.value}function _p(){return Lo.firefox.value}function bY(){return Lo.firefoxWebKit.value}function pP(){return Lo.safari.value}function RY(){return Lo.edge.value}function bo(){return Lo.mobile.value}function wP(){return Oh.ios.value}function CP(){let{maxTouchPoints:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:navigator;return t>2&&Oh.mac.value}function ZE(){return Oh.win.value}function UC(){return Oh.mac.value}const Se={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:_p()?182:174,AUDIO_MUTE:_p()?181:173,AUDIO_UP:_p()?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},EY=[Se.ALT,Se.ARROW_DOWN,Se.ARROW_LEFT,Se.ARROW_RIGHT,Se.ARROW_UP,Se.AUDIO_DOWN,Se.AUDIO_MUTE,Se.AUDIO_UP,Se.BACKSPACE,Se.CAPS_LOCK,Se.DELETE,Se.END,Se.ENTER,Se.ESCAPE,Se.F1,Se.F2,Se.F3,Se.F4,Se.F5,Se.F6,Se.F7,Se.F8,Se.F9,Se.F10,Se.F11,Se.F12,Se.F13,Se.F14,Se.F15,Se.F16,Se.F17,Se.F18,Se.F19,Se.HOME,Se.INSERT,Se.MEDIA_NEXT,Se.MEDIA_PLAY_PAUSE,Se.MEDIA_PREV,Se.MEDIA_STOP,Se.NULL,Se.NUM_LOCK,Se.PAGE_DOWN,Se.PAGE_UP,Se.PAUSE,Se.SCROLL_LOCK,Se.SHIFT,Se.TAB];function TY(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 vP(t){return EY.includes(t)}function MY(t){return[Se.CONTROL,Se.COMMAND_LEFT,Se.COMMAND_RIGHT,Se.COMMAND_FIREFOX].includes(t)}function xh(t,e){const n=e.split("|");let i=!1;return M(n,r=>{if(t===Se[r])return i=!0,!1}),i}function yr(t){t.isImmediatePropagationEnabled=!1,t.cancelBubble=!0}function Ra(t){return t.isImmediatePropagationEnabled===!1}function Da(t){return t.button===2}function IS(t){return t.button===0}function _Y(t,e){const n={x:t.offsetX,y:t.offsetY};let i=t.target;if(!(e instanceof HTMLElement)||i!==e&&i.contains(e))return n;for(;i!==e;)n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;return n}var SP={},IY=S_,PY=Vv,OY=Object.keys||function(e){return IY(e,PY)},xY=Cr,AY=f_,HY=Do,NY=Vs,DY=qg,LY=OY;SP.f=xY&&!AY?Object.defineProperties:function(e,n){NY(e);for(var i=DY(n),r=LY(n),s=r.length,o=0,a;s>o;)HY.f(e,a=r[o++],i[a]);return e};var $Y=Vs,kY=SP,QE=Vv,FY=kv,VY=Y_,WY=Lv,BY=p_,JE=">",e0="<",YC="prototype",zC="script",yP=BY("IE_PROTO"),Ip=function(){},bP=function(t){return e0+zC+JE+t+e0+"/"+zC+JE},t0=function(t){t.write(bP("")),t.close();var e=t.parentWindow.Object;return t=null,e},UY=function(){var t=WY("iframe"),e="java"+zC+":",n;return t.style.display="none",VY.appendChild(t),t.src=String(e),n=t.contentWindow.document,n.open(),n.write(bP("document.F=Object")),n.close(),n.F},od,kf=function(){try{od=new ActiveXObject("htmlfile")}catch{}kf=typeof document<"u"?document.domain&&od?t0(od):UY():t0(od);for(var t=QE.length;t--;)delete kf[YC][QE[t]];return kf()};FY[yP]=!0;var YY=Object.create||function(e,n){var i;return e!==null?(Ip[YC]=$Y(e),i=new Ip,Ip[YC]=null,i[yP]=e):i=kf(),n===void 0?i:kY.f(i,n)},zY=No,GY=YY,jY=Do.f,GC=zY("unscopables"),jC=Array.prototype;jC[GC]===void 0&&jY(jC,GC,{configurable:!0,value:GY(null)});var PS=function(t){jC[GC][t]=!0},KY=PS;KY("flatMap");function vt(){de(console)&&console.warn(...arguments)}function OS(){de(console)&&console.error(...arguments)}function XY(t,e,n){return e=qY(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qY(t){var e=ZY(t,"string");return typeof e=="symbol"?e:e+""}function ZY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const tl=["afterCellMetaReset","afterChange","afterContextMenuDefaultOptions","beforeContextMenuSetItems","afterDropdownMenuDefaultOptions","beforeDropdownMenuSetItems","afterContextMenuHide","beforeContextMenuShow","afterContextMenuShow","afterCopyLimit","beforeCreateCol","afterColumnSequenceChange","afterCreateCol","beforeCreateRow","afterCreateRow","afterDeselect","afterDestroy","afterDocumentKeyDown","afterDrawSelection","beforeRemoveCellClassNames","afterGetCellMeta","afterGetColHeader","afterGetRowHeader","afterInit","afterLoadData","afterUpdateData","afterMomentumScroll","afterOnCellCornerMouseDown","afterOnCellCornerDblClick","afterOnCellMouseDown","afterOnCellMouseUp","afterOnCellContextMenu","afterOnCellMouseOver","afterOnCellMouseOut","afterRemoveCol","afterRemoveRow","beforeRenderer","afterRenderer","afterRowSequenceChange","beforeViewportScrollVertically","beforeViewportScrollHorizontally","beforeViewportScroll","afterScrollHorizontally","afterScrollVertically","afterScroll","afterSelection","afterSelectionByProp","afterSelectionEnd","afterSelectionEndByProp","afterSelectionFocusSet","beforeSelectColumns","afterSelectColumns","beforeSelectRows","afterSelectRows","afterSetCellMeta","afterRemoveCellMeta","afterSetDataAtCell","afterSetDataAtRowProp","afterSetSourceDataAtCell","afterUpdateSettings","afterValidate","beforeLanguageChange","afterLanguageChange","beforeAutofill","afterAutofill","beforeCellAlignment","beforeChange","beforeChangeRender","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","modifyData","modifySourceData","modifyRowData","modifyGetCellCoords","modifyFocusOnTabNavigation","beforeHighlightingRowHeader","beforeHighlightingColumnHeader","persistentStateLoad","persistentStateReset","persistentStateSave","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","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","afterBeginEditing","beforeMergeCells","afterMergeCells","beforeUnmergeCells","afterUnmergeCells","afterListen","afterUnlisten","afterRefreshDimensions","beforeRefreshDimensions","beforeColumnCollapse","afterColumnCollapse","beforeColumnExpand","afterColumnExpand","modifyAutoColumnSizeSeed"],QY=ct`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.`,Pp=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"]]),Op=new Map([[]]),ad=new WeakMap;class ce{static getSingleton(){return ez()}constructor(){XY(this,"globalBucket",void 0),this.globalBucket=this.createEmptyBucket()}createEmptyBucket(){const e=Object.create(null);return M(tl,n=>{e[n]=[],this.initOrderMap(e,n)}),e}getBucket(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e?(e.pluginHookBucket||(e.pluginHookBucket=this.createEmptyBucket()),e.pluginHookBucket):this.globalBucket}add(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;if(Array.isArray(n))M(n,s=>this.add(e,s,i));else{Pp.has(e)&&vt(GI(QY,{hookName:e,removedInVersion:Pp.get(e)})),Op.has(e)&&vt(Op.get(e));const s=this.getBucket(i);if(typeof s[e]>"u"&&(this.register(e),s[e]=[],this.initOrderMap(s,e)),n.skip=!1,s[e].indexOf(n)===-1){let o=!1;n.initialHook&&M(s[e],(a,l)=>{if(a.initialHook)return s[e][l]=n,o=!0,!1}),o||s[e].push(n)}this.setCallbackOrderIndex(s,e,n,r),this.orderBucketByOrderIndex(s,e)}return this}once(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;Array.isArray(n)?M(n,s=>this.once(e,s,i)):(n.runOnce=!0,this.add(e,n,i,r))}remove(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;const r=this.getBucket(i);return typeof r[e]<"u"&&r[e].indexOf(n)>=0?(n.skip=!0,!0):!1}has(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const i=this.getBucket(n);return!!(i[e]!==void 0&&i[e].length)}run(e,n,i,r,s,o,a,l){{const u=this.globalBucket[n],c=u?u.length:0;let h=0;if(c)for(;h<c;){if(!u[h]||u[h].skip){h+=1;continue}const d=BC(u[h],e,i,r,s,o,a,l);d!==void 0&&(i=d),u[h]&&u[h].runOnce&&this.remove(n,u[h]),h+=1}}{const u=this.getBucket(e)[n],c=u?u.length:0;let h=0;if(c)for(;h<c;){if(!u[h]||u[h].skip){h+=1;continue}const d=BC(u[h],e,i,r,s,o,a,l);d!==void 0&&(i=d),u[h]&&u[h].runOnce&&this.remove(n,u[h],e),h+=1}}return i}destroy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;Ue(this.getBucket(e),(n,i,r)=>r[i].length=0)}register(e){this.isRegistered(e)||tl.push(e)}deregister(e){this.isRegistered(e)&&tl.splice(tl.indexOf(e),1)}isDeprecated(e){return Op.has(e)||Pp.has(e)}isRegistered(e){return tl.indexOf(e)>=0}getRegistered(){return tl}setCallbackOrderIndex(e,n,i,r){const s=Number.isInteger(r)?r:0,o=this.getCallbackOrderMap(e,n);o.set(s,[...o.get(s)||[],i])}orderBucketByOrderIndex(e,n){const i=this.getCallbackOrderMap(e,n);i===void 0||i.size===0||i.size===1&&i.has(0)||(e[n]=[...i].sort((r,s)=>r[0]-s[0]).flatMap(r=>{let[,s]=r;return s}))}initOrderMap(e,n){ad.has(e)||ad.set(e,[]),ad.get(e)[n]=new Map}getCallbackOrderMap(e,n){return ad.get(e)[n]}}const JY=new ce;function ez(){return JY}const xp=new Map;function br(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"common";xp.has(t)||xp.set(t,new Map);const e=xp.get(t);function n(a,l){e.set(a,l)}function i(a){return e.get(a)}function r(a){return e.has(a)}function s(){return[...e.keys()]}function o(){return[...e.values()]}return{register:n,getItem:i,hasItem:r,getNames:s,getValues:o}}const KC=new WeakMap,{register:tz,getItem:RP,hasItem:EP,getNames:_se,getValues:Ise}=br("editors");function nz(t){const e={},n=t;this.getConstructor=function(){return t},this.getInstance=function(i){return i.guid in e||(e[i.guid]=new n(i)),e[i.guid]},ce.getSingleton().add("afterDestroy",function(){e[this.guid]=null})}function TP(t,e){let n;if(typeof t=="function")KC.get(t)||ui(null,t),n=KC.get(t);else if(typeof t=="string")n=RP(t);else throw Error('Only strings and functions can be passed as "editor" parameter');if(!n)throw Error(`No editor registered under name "${t}"`);return n.getInstance(e)}function n0(t){if(typeof t=="function")return t;if(!EP(t))throw Error(`No registered editor found under "${t}" name`);return RP(t).getConstructor()}function ui(t,e){t&&typeof t!="string"&&(e=t,t=e.EDITOR_TYPE);const n=new nz(e);typeof t=="string"&&tz(t,n),KC.set(e,n)}function iz(t,e,n){return e=rz(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rz(t){var e=sz(t,"string");return typeof e=="symbol"?e:e+""}function sz(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class wr{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;iz(this,"context",void 0),this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])}addEventListener(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;function s(o){i.call(this,oz(o))}return this.context.eventListeners.push({element:e,event:n,callback:i,callbackProxy:s,options:r,eventManager:this}),e.addEventListener(n,s,r),()=>{this.removeEventListener(e,n,i)}}removeEventListener(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=this.context.eventListeners.length,o;for(;s;)if(s-=1,o=this.context.eventListeners[s],o.event===n&&o.element===e){if(i&&i!==o.callback||r&&o.eventManager!==this)continue;this.context.eventListeners.splice(s,1),o.element.removeEventListener(o.event,o.callbackProxy,o.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 i=this.context.eventListeners[n];e&&i.eventManager!==this||(this.context.eventListeners.splice(n,1),i.element.removeEventListener(i.event,i.callbackProxy,i.options))}}clear(){this.clearEvents()}destroy(){this.clearEvents(),this.context=null}destroyWithOwnEventsOnly(){this.clearEvents(!0),this.context=null}fireEvent(e,n){let i=e.document,r=e;i||(i=e.ownerDocument?e.ownerDocument:e,r=i.defaultView);const s={bubbles:!0,cancelable:n!=="mousemove",view:r,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0};let o;i.createEvent?(o=i.createEvent("MouseEvents"),o.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,i.body.parentNode)):o=i.createEventObject(),e.dispatchEvent?e.dispatchEvent(o):e.fireEvent(`on${n}`,o)}}function oz(t){const e=t.stopImmediatePropagation;return t.stopImmediatePropagation=function(){e.apply(this),yr(this)},t}function az(t,e){lz(t,e),e.add(t)}function lz(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yo(t,e,n){return e=uz(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uz(t){var e=cz(t,"string");return typeof e=="symbol"?e:e+""}function cz(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function i0(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 Ap=new WeakSet;class XC{constructor(e,n,i){az(this,Ap),Yo(this,"hot",void 0),Yo(this,"tableMeta",void 0),Yo(this,"selection",void 0),Yo(this,"eventManager",void 0),Yo(this,"destroyed",!1),Yo(this,"activeEditor",void 0),Yo(this,"cellProperties",void 0),this.hot=e,this.tableMeta=n,this.selection=i,this.eventManager=new wr(e),this.hot.addHook("afterDocumentKeyDown",r=>i0(Ap,this,hz).call(this,r)),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"compositionstart",r=>{!this.destroyed&&this.hot.isListening()&&this.openEditor("",r)}),this.hot.view._wt.update("onCellDblClick",(r,s,o)=>i0(Ap,this,dz).call(this,r,s,o))}getActiveEditor(){return this.activeEditor}prepareEditor(){var e;if(this.activeEditor&&this.activeEditor.isWaiting()){this.closeEditor(!1,!1,u=>{u&&this.prepareEditor()});return}const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!n||n.isHeader())return;const{row:i,col:r}=n,s=this.hot.runHooks("modifyGetCellCoords",i,r);let o=i,a=r;if(Array.isArray(s)&&([o,a]=s),this.cellProperties=this.hot.getCellMeta(o,a),!this.isCellEditable()){this.clearActiveEditor();return}const l=this.hot.getCell(i,r,!0);if(l){const u=this.hot.getCellEditor(this.cellProperties),c=this.hot.colToProp(a),h=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(o),a);this.activeEditor=TP(u,this.hot),this.activeEditor.prepare(i,r,c,l,h,this.cellProperties)}}isEditorOpened(){return this.activeEditor&&this.activeEditor.isOpened()}openEditor(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(!this.isCellEditable()){this.clearActiveEditor();return}const r=this.hot.getSelectedRangeLast();let s=this.hot.runHooks("beforeBeginEditing",r.highlight.row,r.highlight.col,e,n,i);if(n instanceof MouseEvent&&typeof s!="boolean"&&(s=this.hot.selection.getLayerLevel()===0&&r.isSingle()),s===!1){this.clearActiveEditor();return}this.activeEditor||(this.hot.scrollToFocusedCell(),this.prepareEditor()),this.activeEditor&&(i&&this.activeEditor.enableFullEditMode(),this.activeEditor.beginEditing(e,n))}closeEditor(e,n,i){this.activeEditor?this.activeEditor.finishEditing(e,n,i):i&&i(!1)}closeEditorAndSaveChanges(e){this.closeEditor(!1,e)}closeEditorAndRestoreOriginalValue(e){this.closeEditor(!0,e)}clearActiveEditor(){this.activeEditor=void 0}isCellEditable(){const e=this.hot.getSelectedRangeLast();if(!e)return!1;const n=this.hot.getCellEditor(this.cellProperties),{row:i,col:r}=e.highlight,{rowIndexMapper:s,columnIndexMapper:o}=this.hot,a=s.isHidden(this.hot.toPhysicalRow(i))||o.isHidden(this.hot.toPhysicalColumn(r));return!(this.cellProperties.readOnly||!n||a)}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 hz(t){const e=this.hot.getSelectedRangeLast();if(!this.hot.isListening()||!e||e.highlight.isHeader()||Ra(t))return;const{keyCode:n}=t,i=(t.ctrlKey||t.metaKey)&&!t.altKey;(!this.activeEditor||this.activeEditor&&!this.activeEditor.isWaiting())&&!vP(n)&&!MY(n)&&!i&&!this.isEditorOpened()&&this.openEditor("",t)}function dz(t,e){e.isCell()&&this.openEditor(null,t,!0)}const r0=new WeakMap;XC.getInstance=function(t,e,n){let i=r0.get(t);return i||(i=new XC(t,e,n),r0.set(t,i)),i};function fz(t,e){MP(t,e),e.add(t)}function Mu(t,e,n){MP(t,e),e.set(t,n)}function MP(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function At(t,e){return t.get(_s(t,e))}function _u(t,e,n){return t.set(_s(t,e),n),n}function _s(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 Ql=Object.freeze({CELL:"cell",MIXED:"mixed"});var gn=new WeakMap,ld=new WeakMap,ud=new WeakMap,cd=new WeakMap,hd=new WeakMap,uo=new WeakSet;class gz{constructor(e){var n=this;fz(this,uo),Mu(this,gn,void 0),Mu(this,ld,void 0),Mu(this,ud,1),Mu(this,cd,null),Mu(this,hd,new Map);const i=e.getSettings();_u(gn,this,e),_u(ld,this,i.imeFastEdit?Ql.MIXED:Ql.CELL),At(gn,this).addHook("afterUpdateSettings",function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return _s(uo,n,pz).call(n,...s)}),At(gn,this).addHook("afterSelection",function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return _s(uo,n,s0).call(n,...s)}),At(gn,this).addHook("afterSelectionFocusSet",function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return _s(uo,n,s0).call(n,...s)}),At(gn,this).addHook("afterSelectionEnd",function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return _s(uo,n,mz).call(n,...s)})}getFocusMode(){return At(ld,this)}setFocusMode(e){Object.values(Ql).includes(e)?_u(ld,this,e):vt(`"${e}" is not a valid focus mode.`)}getRefocusDelay(){return At(ud,this)}setRefocusDelay(e){_u(ud,this,e)}setRefocusElementGetter(e){_u(cd,this,e)}getRefocusElement(){if(typeof At(cd,this)=="function")return At(cd,this).call(this);var e;return(e=At(gn,this).getActiveEditor())===null||e===void 0?void 0:e.TEXTAREA}focusOnHighlightedCell(e){const n=i=>{var r,s;const o=(r=At(gn,this).getSelectedRangeLast())===null||r===void 0?void 0:r.highlight;if(!o)return;let a=At(gn,this).runHooks("modifyFocusedElement",o.row,o.col,i);a instanceof HTMLElement||(a=i),a&&!((s=At(gn,this).getActiveEditor())!==null&&s!==void 0&&s.isOpened())&&a.focus({preventScroll:!0})};e?n(e):_s(uo,this,xS).call(this,i=>n(i))}refocusToEditorTextarea(){var e;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:At(ud,this);const i=this.getRefocusElement();At(gn,this).getSettings().imeFastEdit&&!((e=At(gn,this).getActiveEditor())!==null&&e!==void 0&&e.isOpened())&&i&&(At(hd,this).has(n)||At(hd,this).set(n,ES(()=>{i.select()},n)),At(hd,this).get(n)())}}function xS(t){var e;const n=(e=At(gn,this).getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!n||!At(gn,this).selection.isCellVisible(n)){t(null);return}const i=At(gn,this).getCell(n.row,n.col,!0);i===null?At(gn,this).addHookOnce("afterScroll",()=>{t(At(gn,this).getCell(n.row,n.col,!0))}):t(i)}function s0(){_s(uo,this,xS).call(this,t=>{const{activeElement:e}=At(gn,this).rootDocument;e&&sP(e)&&e.blur(),this.focusOnHighlightedCell(t)})}function mz(){_s(uo,this,xS).call(this,t=>{this.getFocusMode()===Ql.MIXED&&t.nodeName==="TD"&&this.refocusToEditorTextarea()})}function pz(t){typeof t.imeFastEdit=="boolean"&&this.setFocusMode(t.imeFastEdit?Ql.MIXED:Ql.CELL)}var wz=ns,Cz=Ba,vz=No,Sz=vz("match"),yz=function(t){var e;return wz(t)&&((e=t[Sz])!==void 0?!!e:Cz(t)==="RegExp")},bz=Vs,Rz=function(){var t=bz(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e},Ez=vr,Tz=is,Mz=Zg,_z=Rz,o0=RegExp.prototype,Iz=function(t){var e=t.flags;return e===void 0&&!("flags"in o0)&&!Tz(t,"flags")&&Mz(o0,t)?Ez(_z,t):e},AS=un,Pz=vh,Oz=Math.floor,Hp=AS("".charAt),xz=AS("".replace),Np=AS("".slice),Az=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Hz=/\$([$&'`]|\d{1,2})/g,Nz=function(t,e,n,i,r,s){var o=n+t.length,a=i.length,l=Hz;return r!==void 0&&(r=Pz(r),l=Az),xz(s,l,function(u,c){var h;switch(Hp(c,0)){case"$":return"$";case"&":return t;case"`":return Np(e,0,n);case"'":return Np(e,o);case"<":h=r[Np(c,1,-1)];break;default:var d=+c;if(d===0)return u;if(d>a){var g=Oz(d/10);return g===0?u:g<=a?i[g-1]===void 0?Hp(c,1):i[g-1]+Hp(c,1):u}h=i[d-1]}return h===void 0?"":h})},Dz=An,Lz=vr,HS=un,a0=Xg,$z=bn,kz=Kg,Fz=yz,Iu=Wv,Vz=Jg,Wz=Iz,Bz=Nz,Uz=No,Yz=Uz("replace"),zz=TypeError,Dp=HS("".indexOf);HS("".replace);var l0=HS("".slice),Gz=Math.max;Dz({target:"String",proto:!0},{replaceAll:function(e,n){var i=a0(this),r,s,o,a,l,u,c,h,d,g=0,p=0,C="";if(!kz(e)){if(r=Fz(e),r&&(s=Iu(a0(Wz(e))),!~Dp(s,"g")))throw new zz("`.replaceAll` does not allow non-global regexes");if(o=Vz(e,Yz),o)return Lz(o,e,i,n)}for(a=Iu(i),l=Iu(e),u=$z(n),u||(n=Iu(n)),c=l.length,h=Gz(1,c),g=Dp(a,l);g!==-1;)d=u?Iu(n(l,g,a)):Bz(l,a,g,[],void 0,n),C+=l0(a,p,g)+d,p=g+c,g=g+h>a.length?-1:Dp(a,l,g+h);return p<a.length&&(C+=l0(a,p)),C}});const _P={" ":" ","&":"&","<":"<",">":">"},jz=new RegExp(Object.keys(_P).map(t=>`(${t})`).join("|"),"gi");function Kz(t){return(t&&t.nodeName||"")==="TABLE"}function u0(t){const e=t.hasColHeaders(),n=t.hasRowHeaders(),i=[e?-1:0,n?-1:0,t.countRows()-1,t.countCols()-1],r=t.getData(...i),s=r.length,o=s>0?r[0].length:0,a=["<table>","</table>"],l=e?["<thead>","</thead>"]:[],u=["<tbody>","</tbody>"],c=n?1:0,h=e?1:0;for(let d=0;d<s;d+=1){const g=e&&d===0,p=[];for(let S=0;S<o;S+=1){const b=!g&&n&&S===0;let R="";if(g)R=`<th>${t.getColHeader(S-c)}</th>`;else if(b)R=`<th>${t.getRowHeader(d-h)}</th>`;else{const E=r[d][S],{hidden:H,rowspan:P,colspan:B}=t.getCellMeta(d-h,S-c);if(!H){const Y=[];if(P&&Y.push(`rowspan="${P}"`),B&&Y.push(`colspan="${B}"`),Xt(E))R=`<td ${Y.join(" ")}></td>`;else{const j=E.toString().replace("<","<").replace(">",">").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
|
|
`).replace(/\x20/gi," ").replace(/\t/gi,"	");R=`<td ${Y.join(" ")}>${j}</td>`}}}p.push(R)}const C=["<tr>",...p,"</tr>"].join("");g?l.splice(1,0,C):u.splice(-1,0,C)}return a.splice(1,0,l.join(""),u.join("")),a.join("")}function c0(t){const e=t.length,n=["<table>"];for(let i=0;i<e;i+=1){const r=t[i],s=r.length,o=[];i===0&&n.push("<tbody>");for(let a=0;a<s;a+=1){const l=r[a],u=Xt(l)?"":l.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
|
|
`).replace(/\x20{2,}/gi,c=>`<span style="mso-spacerun: yes">${" ".repeat(c.length-1)} </span>`).replace(/\t/gi,"	");o.push(`<td>${u}</td>`)}n.push("<tr>",...o,"</tr>"),i+1===e&&n.push("</tbody>")}return n.push("</table>"),n.join("")}function Xz(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;const n={},i=e.createDocumentFragment(),r=e.createElement("div");i.appendChild(r);let s=t;if(typeof s=="string"){const E=s.replace(/<td\b[^>]*?>([\s\S]*?)<\/\s*td>/g,H=>{const P=H.match(/<td\b[^>]*?>/g)[0],B=/<p.*?>/g,Y=H.substring(P.length,H.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(B,`
|
|
`).replace(`
|
|
`,"").replaceAll(/<\/(.*)>\s+$/mg,"</$1>").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^ $/mg,"");return`${P}${Y}</td>`});r.insertAdjacentHTML("afterbegin",`${E}`),s=r.querySelector("table")}if(!s||!Kz(s))return;const o=r.querySelector('meta[name$="enerator"]'),a=s.querySelector("tbody th")!==null,l=s.querySelector("tr"),u=l?Array.from(l.cells).reduce((E,H)=>E+H.colSpan,0)-(a?1:0):0,c=s.tFoot&&Array.from(s.tFoot.rows)||[],h=[];let d=!1,g=0,p=0;if(s.tHead){const E=Array.from(s.tHead.rows).filter(H=>{const P=H.querySelector("td")!==null;return P&&h.push(H),!P});g=E.length,d=g>0,g>1?n.nestedHeaders=Array.from(E).reduce((H,P)=>{const B=Array.from(P.cells).reduce((Y,j,z)=>{if(a&&z===0)return Y;const{colSpan:G,innerHTML:Z}=j,ne=G>1?{label:Z,colspan:G}:Z;return Y.push(ne),Y},[]);return H.push(B),H},[]):d&&(n.colHeaders=Array.from(E[0].children).reduce((H,P,B)=>(a&&B===0||H.push(P.innerHTML),H),[]))}h.length&&(n.fixedRowsTop=h.length),c.length&&(n.fixedRowsBottom=c.length);const C=[...h,...Array.from(s.tBodies).reduce((E,H)=>(E.push(...Array.from(H.rows)),E),[]),...c];p=C.length;const S=new Array(p);for(let E=0;E<p;E++)S[E]=new Array(u);const b=[],R=[];for(let E=0;E<p;E++){const H=C[E],P=Array.from(H.cells),B=P.length;for(let Y=0;Y<B;Y++){const j=P[Y],{nodeName:z,innerHTML:G,rowSpan:Z,colSpan:ne}=j,ie=S[E].findIndex(Ce=>Ce===void 0);if(z==="TD"){if(Z>1||ne>1){for(let Ne=E;Ne<E+Z;Ne++)if(Ne<p)for(let we=ie;we<ie+ne;we++)S[Ne][we]=null;const Me=j.getAttribute("style");Me&&Me.includes("mso-ignore:colspan")||b.push({col:ie,row:E,rowspan:Z,colspan:ne})}let Ce="";o&&/excel/gi.test(o.content)?Ce=G.replace(/[\r\n][\x20]{0,2}/g," ").replace(/<br(\s*|\/)>[\r\n]?[\x20]{0,3}/gim,`\r
|
|
`):Ce=G.replace(/<br(\s*|\/)>[\r\n]?/gim,`\r
|
|
`),S[E][ie]=Ce.replace(jz,Me=>_P[Me])}else R.push(G)}}return b.length&&(n.mergeCells=b),R.length&&(n.rowHeaders=R),S.length&&(n.data=S),n}function Bn(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 i=Array.from(new Set([".",...e])).map(r=>`\\${r}`).join("|");return new RegExp(`^[+-]?(((${i})?\\d+((${i})\\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 qz(t){return Bn(t,[","])}function me(t,e,n){let i=-1;for(typeof e=="function"?(n=e,e=t):i=t-1;++i<=e&&n(i)!==!1;);}function qC(t,e,n){let i=t+1;for(typeof e=="function"&&(n=e,e=0);--i>=e&&n(i)!==!1;);}function IP(t,e){return e=parseInt(e.toString().replace("%",""),10),e=isNaN(e)?0:e,parseInt(t*e/100,10)}function gt(t,e,n){return Math.min(t,e)===t?e:Math.max(t,n)===t?n:t}const ZC="asc",Zz="desc",h0=new Map([[ZC,[-1,1]],[Zz,[1,-1]]]),Qz=t=>`The priority '${t}' is already declared in a map.`,Jz=t=>`The priority '${t}' is not a number.`;function e2(){let{errorPriorityExists:t,errorPriorityNaN:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=new Map;t=Et(t)?t:Qz,e=Et(e)?e:Jz;function i(s,o){if(!Bn(s))throw new Error(e(s));if(n.has(s))throw new Error(t(s));n.set(s,o)}function r(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ZC;const[o,a]=h0.get(s)||h0.get(ZC);return[...n].sort((l,u)=>l[0]<u[0]?o:a).map(l=>l[1])}return{addItem:i,getItems:r}}const t2=t=>`The id '${t}' is already declared in a map.`;function wm(){let{errorIdExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Map;t=Et(t)?t:t2;function n(u,c){if(l(u))throw new Error(t(u));e.set(u,c)}function i(u){return e.delete(u)}function r(){e.clear()}function s(u){const[c]=a().find(h=>{let[d,g]=h;return u===g?d:!1})||[null];return c}function o(u){return e.get(u)}function a(){return[...e]}function l(u){return e.has(u)}return{addItem:n,clear:r,getId:s,getItem:o,getItems:a,hasItem:l,removeItem:i}}const n2=t=>`'${t}' value is already declared in a unique set.`;function i2(){let{errorItemExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Set;t=Et(t)?t:n2;function n(s){if(e.has(s))throw new Error(t(s));e.add(s)}function i(){return[...e]}function r(){e.clear()}return{addItem:n,clear:r,getItems:i}}const NS=t=>`There is already registered "${t}" plugin.`,r2=t=>`There is already registered plugin on priority "${t}".`,s2=t=>`The priority "${t}" is not a number.`,PP=e2({errorPriorityExists:r2,errorPriorityNaN:s2}),OP=i2({errorItemExists:NS}),QC=wm({errorIdExists:NS});function xP(){return[...PP.getItems(),...OP.getItems()]}function DS(t){const e=mr(t);return QC.getItem(e)}function o2(t){return!!DS(t)}function rt(t,e,n){[t,e,n]=l2(t,e,n),DS(t)===void 0&&a2(t,e,n)}function a2(t,e,n){const i=mr(t);if(QC.hasItem(i))throw new Error(NS(i));n===void 0?OP.addItem(i):PP.addItem(n,i),QC.addItem(i,e)}function l2(t,e,n){return typeof t=="function"&&(e=t,t=e.PLUGIN_KEY,n=e.PLUGIN_PRIORITY),[t,e,n]}const{register:u2,getItem:c2,hasItem:AP,getNames:Pse,getValues:Ose}=br("renderers");function d0(t){if(typeof t=="function")return t;if(!AP(t))throw Error(`No registered renderer found under "${t}" name`);return c2(t)}function _i(t,e){typeof t!="string"&&(e=t,t=e.RENDERER_TYPE),u2(t,e)}const{register:h2,getItem:d2,hasItem:HP,getNames:xse,getValues:Ase}=br("validators");function f2(t){if(typeof t=="function")return t;if(!HP(t))throw Error(`No registered validator found under "${t}" name`);return d2(t)}function $l(t,e){typeof t!="string"&&(e=t,t=e.VALIDATOR_TYPE),h2(t,e)}function dd(t,e,n){return e=g2(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function g2(t){var e=m2(t,"string");return typeof e=="symbol"?e:e+""}function m2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class p2{constructor(e){dd(this,"count",0),dd(this,"startColumn",0),dd(this,"endColumn",0),dd(this,"startPosition",0),this.count=e.totalColumns,this.endColumn=this.count-1}}function fd(t,e,n){return e=w2(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function w2(t){var e=C2(t,"string");return typeof e=="symbol"?e:e+""}function C2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class v2{constructor(e){fd(this,"count",0),fd(this,"startRow",0),fd(this,"endRow",0),fd(this,"startPosition",0),this.count=e.totalRows,this.endRow=this.count-1}}var S2=An,y2=vh,b2=yh,R2=em,E2=PS;S2({target:"Array",proto:!0},{at:function(e){var n=y2(this),i=b2(n),r=R2(e),s=r>=0?r:i+r;return s<0||s>=i?void 0:n[s]}});E2("at");const co=1,In=2,f0=3;function T2(t,e,n){M2(t,e),e.set(t,n)}function M2(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pu(t,e,n){return e=_2(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _2(t){var e=I2(t,"string");return typeof e=="symbol"?e:e+""}function I2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nl(t,e){return t.get(NP(t,e))}function P2(t,e,n){return t.set(NP(t,e),n),n}function NP(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 Ks=new WeakMap;class Ah{static get DEFAULT_WIDTH(){return 50}constructor(e){Pu(this,"count",0),Pu(this,"startColumn",null),Pu(this,"endColumn",null),Pu(this,"startPosition",null),Pu(this,"isVisibleInTrimmingContainer",!1),T2(this,Ks,void 0),P2(Ks,this,e),this.calculate()}calculate(){const{calculationType:e,overrideFn:n,scrollOffset:i,totalColumns:r,viewportWidth:s}=nl(Ks,this),o=Math.max(nl(Ks,this).scrollOffset,0),a=o>0?s+1:s;let l=0,u=!0;const c=[];let h,d=0,g=0;for(let b=0;b<r;b++)if(h=this._getColumnWidth(b),l<=o&&e!==In&&(this.startColumn=b,d=h),l>=o&&l+(e===In?h:0)<=o+a&&((this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=b,d=h),this.endColumn=b),c.push(l),l+=h,g=h,e!==In&&(this.endColumn=b),l>=o+s){u=!1;break}const p=i+s-a,C=e===In?0:g,S=e===In?d:0;if(p<-1*nl(Ks,this).inlineStartOffset||i>c.at(-1)+C||-1*nl(Ks,this).scrollOffset-nl(Ks,this).viewportWidth>-1*S?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,this.endColumn===r-1&&u)for(this.startColumn=this.endColumn;this.startColumn>0;){const b=c[this.endColumn]+h-c[this.startColumn-1];if((b<=s||e!==In)&&(this.startColumn-=1),b>s)break}e===co&&this.startColumn!==null&&n&&n(this),this.startPosition=c[this.startColumn],this.startPosition===void 0&&(this.startPosition=null),r<this.endColumn&&(this.endColumn=r-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}_getColumnWidth(e){let n=nl(Ks,this).columnWidthFn(e);return isNaN(n)&&(n=Ah.DEFAULT_WIDTH),n}}function O2(t,e,n){x2(t,e),e.set(t,n)}function x2(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ou(t,e,n){return e=A2(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A2(t){var e=H2(t,"string");return typeof e=="symbol"?e:e+""}function H2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Lp(t,e){return t.get(DP(t,e))}function N2(t,e,n){return t.set(DP(t,e),n),n}function DP(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 xu=new WeakMap;class Cm{static get DEFAULT_HEIGHT(){return 23}constructor(e){Ou(this,"count",0),Ou(this,"startRow",null),Ou(this,"endRow",null),Ou(this,"startPosition",null),Ou(this,"isVisibleInTrimmingContainer",!1),O2(this,xu,void 0),N2(xu,this,e),this.calculate()}calculate(){const{calculationType:e,overrideFn:n,rowHeightFn:i,scrollOffset:r,totalRows:s,viewportHeight:o}=Lp(xu,this),a=Math.max(Lp(xu,this).scrollOffset,0),l=Lp(xu,this).horizontalScrollbarHeight||0,u=a+o-l;let c=0,h=!0;const d=[];let g,p=0,C=0;for(let E=0;E<s;E++)if(g=i(E),isNaN(g)&&(g=Cm.DEFAULT_HEIGHT),c<=a&&e!==In&&(this.startRow=E,p=g),c>=a&&c+(e===In?g:0)<=u&&(this.startRow===null&&(this.startRow=E,p=g),this.endRow=E),d.push(c),c+=g,C=g,e!==In&&(this.endRow=E),c>=u){h=!1;break}const S=r+o-l,b=e===In?p:0,R=e===In?0:C;if(S<b||r>d.at(-1)+R?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,this.endRow===s-1&&h)for(this.startRow=this.endRow;this.startRow>0;){const E=d[this.endRow]+g-d[this.startRow-1];if((E<=o-l||e!==In)&&(this.startRow-=1),E>=o-l)break}e===co&&this.startRow!==null&&n&&n(this),this.startPosition=d[this.startRow],this.startPosition===void 0&&(this.startPosition=null),s<this.endRow&&(this.endRow=s-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function D2(t,e,n){L2(t,e),e.set(t,n)}function L2(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function g0(t,e,n){return e=$2(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $2(t){var e=k2(t,"string");return typeof e=="symbol"?e:e+""}function k2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function il(t,e){return t.get(LP(t,e))}function m0(t,e,n){return t.set(LP(t,e),n),n}function LP(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 hs=new WeakMap;class La{constructor(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;g0(this,"row",null),g0(this,"col",null),D2(this,hs,!1),m0(hs,this,i),typeof e<"u"&&typeof n<"u"&&(this.row=e,this.col=n)}isValid(e){const{countRows:n,countCols:i,countRowHeaders:r,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<-r||this.row>=n||this.col>=i)}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 il(hs,this)}isSouthEastOf(e){return this.row>=e.row&&(il(hs,this)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(il(hs,this)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(il(hs,this)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(il(hs,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?.row)&&(this.row=e.row),Number.isInteger(e?.col)&&(this.col=e.col),e instanceof La&&m0(hs,this,e.isRtl()),this}clone(){return new La(this.row,this.col,il(hs,this))}toObject(){return{row:this.row,col:this.col}}}function F2(t,e,n){V2(t,e),e.set(t,n)}function V2(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $p(t,e,n){return e=W2(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function W2(t){var e=B2(t,"string");return typeof e=="symbol"?e:e+""}function B2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bi(t,e){return t.get($P(t,e))}function U2(t,e,n){return t.set($P(t,e),n),n}function $P(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 Kn=new WeakMap;class Hh{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;$p(this,"highlight",null),$p(this,"from",null),$p(this,"to",null),F2(this,Kn,!1),this.highlight=e.clone(),this.from=n.clone(),this.to=i.clone(),U2(Kn,this,r)}setHighlight(e){return this.highlight=e.clone(),this}setFrom(e){return this.from=e.clone(),this}setTo(e){return this.to=e.clone(),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:i}=e,r=this.getOuterTopStartCorner(),s=this.getOuterBottomEndCorner();return r.row<=n&&s.row>=n&&r.col<=i&&s.col>=i}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(),i=this.getOuterBottomEndCorner();return e.row<n.row||e.col<n.col||e.row>i.row||e.col>i.col?(this.from=this._createCellCoords(Math.min(n.row,e.row),Math.min(n.col,e.col)),this.to=this._createCellCoords(Math.max(i.row,e.row),Math.max(i.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 i=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner(),s=this.getDirection(),o=e.getOuterTopStartCorner(),a=e.getOuterBottomEndCorner(),l=Math.min(i.row,o.row),u=Math.min(i.col,o.col),c=Math.max(r.row,a.row),h=Math.max(r.col,a.col),d=this._createCellCoords(l,u),g=this._createCellCoords(c,h);return this.from=d,this.to=g,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 bi(Kn,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 bi(Kn,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 bi(Kn,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 bi(Kn,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 bi(Kn,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 bi(Kn,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 bi(Kn,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 bi(Kn,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 La))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)},i={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)},r=[];return n.top===i.top&&r.push("top"),n.right===i.right&&r.push(bi(Kn,this)?"left":"right"),n.bottom===i.bottom&&r.push("bottom"),n.left===i.left&&r.push(bi(Kn,this)?"right":"left"),r}getInner(){const e=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner(),i=[];for(let r=e.row;r<=n.row;r++)for(let s=e.col;s<=n.col;s++)!(this.from.row===r&&this.from.col===s)&&!(this.to.row===r&&this.to.col===s)&&i.push(this._createCellCoords(r,s));return i}getAll(){const e=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner(),i=[];for(let r=e.row;r<=n.row;r++)for(let s=e.col;s<=n.col;s++)e.row===r&&e.col===s?i.push(e):n.row===r&&n.col===s?i.push(n):i.push(this._createCellCoords(r,s));return i}forAll(e){const n=this.getOuterTopStartCorner(),i=this.getOuterBottomEndCorner();for(let r=n.row;r<=i.row;r++)for(let s=n.col;s<=i.col;s++)if(e(r,s)===!1)return}clone(){return new Hh(this.highlight,this.from,this.to,bi(Kn,this))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,n){return new La(e,n,bi(Kn,this))}}function Er(t,e,n){Y2(t,e),e.set(t,n)}function Y2(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ve(t,e){return t.get(kP(t,e))}function Xs(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 Ri=new WeakMap,kp=new WeakMap,cn=new WeakMap,rl=new WeakMap,gd=new WeakMap,zi=new WeakMap,Fp=new WeakMap,Au=new WeakMap,zo=new WeakMap,Tr=new WeakMap;let FP=class{constructor(e,n,i,r,s,o){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null;Er(this,Ri,void 0),Er(this,kp,void 0),Er(this,cn,void 0),Er(this,rl,void 0),Er(this,gd,void 0),Er(this,zi,void 0),Er(this,Fp,void 0),Er(this,Au,void 0),Er(this,zo,[null,null]),Er(this,Tr,[null,null]),Xs(Ri,this,i),Xs(kp,this,n),Xs(cn,this,s),Xs(rl,this,o),Xs(gd,this,a),Xs(zi,this,r),Xs(Fp,this,e),this.registerEvents()}registerEvents(){ve(zi,this).addEventListener(ve(cn,this).holder,"contextmenu",i=>this.onContextMenu(i)),ve(zi,this).addEventListener(ve(cn,this).TABLE,"mouseover",i=>this.onMouseOver(i)),ve(zi,this).addEventListener(ve(cn,this).TABLE,"mouseout",i=>this.onMouseOut(i));const e=()=>{ve(zi,this).addEventListener(ve(cn,this).holder,"touchstart",i=>this.onTouchStart(i)),ve(zi,this).addEventListener(ve(cn,this).holder,"touchend",i=>this.onTouchEnd(i)),this.momentumScrolling||(this.momentumScrolling={}),ve(zi,this).addEventListener(ve(cn,this).holder,"scroll",()=>{clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||ve(Ri,this).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout(()=>{this.touchApplied||(this.momentumScrolling.ongoing=!1,ve(Ri,this).getSetting("onAfterMomentumScroll"))},200)})},n=()=>{ve(zi,this).addEventListener(ve(cn,this).holder,"mouseup",i=>this.onMouseUp(i)),ve(zi,this).addEventListener(ve(cn,this).holder,"mousedown",i=>this.onMouseDown(i))};bo()?e():(gP()&&e(),n())}selectedCellWasTouched(e){const i=this.parentCell(e).coords;if(ve(Au,this)&&i){const[r,s]=[i.row,ve(Au,this).from.row],[o,a]=[i.col,ve(Au,this).from.col];return r===s&&o===a}return!1}parentCell(e){const n={},i=ve(cn,this).TABLE,r=rd(e,["TD","TH"],i);return r?(n.coords=ve(cn,this).getCoords(r),n.TD=r):_e(e,"wtBorder")&&_e(e,"current")?(n.coords=ve(rl,this).getFocusSelection().cellRange.highlight,n.TD=ve(cn,this).getCell(n.coords)):_e(e,"wtBorder")&&_e(e,"area")&&ve(rl,this).getAreaSelection().cellRange&&(n.coords=ve(rl,this).getAreaSelection().cellRange.to,n.TD=ve(cn,this).getCell(n.coords)),n}onMouseDown(e){const n=ve(kp,this).rootDocument.activeElement,i=uP(WU,e.target),r=e.target;if(!["TD","TH"].includes(n.nodeName)&&(r===n||i(0)===n||i(1)===n))return;const s=this.parentCell(r);_e(r,"corner")?ve(Ri,this).getSetting("onCellCornerMouseDown",e,r):s.TD&&ve(Ri,this).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,s.coords,s.TD),(e.button===0||this.touchApplied)&&s.TD&&(ve(Tr,this)[0]=s.TD,clearTimeout(ve(zo,this)[0]),ve(zo,this)[0]=setTimeout(()=>{ve(Tr,this)[0]=null},1e3))}onContextMenu(e){if(ve(Ri,this).has("onCellContextMenu")){const n=this.parentCell(e.target);n.TD&&this.callListener("onCellContextMenu",e,n.coords,n.TD)}}onMouseOver(e){if(!ve(Ri,this).has("onCellMouseOver"))return;const n=ve(cn,this).TABLE,i=rd(e.target,["TD","TH"],n),r=ve(gd,this)||this;i&&i!==r.lastMouseOver&&xa(i,n)&&(r.lastMouseOver=i,this.callListener("onCellMouseOver",e,ve(cn,this).getCoords(i),i))}onMouseOut(e){if(!ve(Ri,this).has("onCellMouseOut"))return;const n=ve(cn,this).TABLE,i=rd(e.target,["TD","TH"],n),r=rd(e.relatedTarget,["TD","TH"],n),s=ve(gd,this)||this;i&&i!==r&&xa(i,n)&&(this.callListener("onCellMouseOut",e,ve(cn,this).getCoords(i),i),r===null&&(s.lastMouseOver=null))}onMouseUp(e){const n=this.parentCell(e.target);n.TD&&ve(Ri,this).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,n.coords,n.TD),!(e.button!==0&&!this.touchApplied)&&(n.TD===ve(Tr,this)[0]&&n.TD===ve(Tr,this)[1]?(_e(e.target,"corner")?this.callListener("onCellCornerDblClick",e,n.coords,n.TD):this.callListener("onCellDblClick",e,n.coords,n.TD),ve(Tr,this)[0]=null,ve(Tr,this)[1]=null):n.TD===ve(Tr,this)[0]&&(ve(Tr,this)[1]=n.TD,clearTimeout(ve(zo,this)[1]),ve(zo,this)[1]=setTimeout(()=>{ve(Tr,this)[1]=null},500)))}onTouchStart(e){Xs(Au,this,ve(rl,this).getFocusSelection().cellRange),this.touchApplied=!0,this.onMouseDown(e)}onTouchEnd(e){var n;const i=e.target,r=(n=this.parentCell(i))===null||n===void 0?void 0:n.coords,s=de(r)&&r.row>=0&&r.col>=0;if(e.cancelable&&s&&ve(Ri,this).getSetting("isDataViewInstance")){const a=["A","BUTTON","INPUT"];wP()&&(yY()||bY())&&this.selectedCellWasTouched(i)&&!a.includes(i.tagName)?e.preventDefault():this.selectedCellWasTouched(i)||e.preventDefault()}this.onMouseUp(e),this.touchApplied=!1}callListener(e,n,i,r){const s=ve(Ri,this).getSettingPure(e);s&&s(n,i,r,ve(Fp,this).call(this))}destroy(){clearTimeout(ve(zo,this)[0]),clearTimeout(ve(zo,this)[1]),ve(zi,this).destroy()}};function Vp(t,e,n){return e=z2(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function z2(t){var e=G2(t,"string");return typeof e=="symbol"?e:e+""}function G2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class j2{constructor(e,n,i){Vp(this,"offset",void 0),Vp(this,"total",void 0),Vp(this,"countTH",void 0),this.offset=e,this.total=n,this.countTH=i}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 Wp(t,e,n){return e=K2(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function K2(t){var e=X2(t,"string");return typeof e=="symbol"?e:e+""}function X2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class q2{constructor(e,n,i){Wp(this,"offset",void 0),Wp(this,"total",void 0),Wp(this,"countTH",void 0),this.offset=e,this.total=n,this.countTH=i}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))}}const Z2=0,gg=1,mg=2;function md(t,e,n){return e=Q2(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Q2(t){var e=J2(t,"string");return typeof e=="symbol"?e:e+""}function J2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class p0{constructor(){md(this,"currentSize",0),md(this,"nextSize",0),md(this,"currentOffset",0),md(this,"nextOffset",0)}setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}}function Bp(t,e,n){return e=eG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eG(t){var e=tG(t,"string");return typeof e=="symbol"?e:e+""}function tG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class nG{constructor(){Bp(this,"size",new p0),Bp(this,"workingSpace",Z2),Bp(this,"sharedSize",null)}setSize(e){this.size.setSize(e)}setOffset(e){this.size.setOffset(e)}getViewSize(){return this.size}isShared(){return this.sharedSize instanceof p0}isPlaceOn(e){return this.workingSpace===e}append(e){this.workingSpace=gg,e.workingSpace=mg,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=mg,e.workingSpace=gg,this.sharedSize=e.getViewSize()}}function sl(t,e,n){return e=iG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iG(t){var e=rG(t,"string");return typeof e=="symbol"?e:e+""}function rG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class VP{constructor(e,n,i){sl(this,"rootNode",void 0),sl(this,"nodesPool",void 0),sl(this,"sizeSet",new nG),sl(this,"childNodeType",void 0),sl(this,"visualIndex",0),sl(this,"collectedNodes",[]),this.rootNode=e,this.nodesPool=n,this.childNodeType=i.toUpperCase()}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}getRenderedChildCount(){const{rootNode:e,sizeSet:n}=this;let i=0;if(this.isSharedViewSet()){let r=e.firstElementChild;for(;r;){if(r.tagName===this.childNodeType)i+=1;else if(n.isPlaceOn(gg))break;r=r.nextElementSibling}}else i=e.childElementCount;return i}start(){this.collectedNodes.length=0,this.visualIndex=0;const{rootNode:e,sizeSet:n}=this,i=this.isSharedViewSet(),{nextSize:r}=n.getViewSize();let s=this.getRenderedChildCount();for(;s<r;){const a=this.nodesPool();!i||i&&n.isPlaceOn(mg)?e.appendChild(a):e.insertBefore(a,e.firstChild),s+=1}const o=i&&n.isPlaceOn(gg);for(;s>r;)e.removeChild(o?e.firstChild:e.lastChild),s-=1}render(){const{rootNode:e,sizeSet:n}=this;let i=this.visualIndex;this.isSharedViewSet()&&n.isPlaceOn(mg)&&(i+=n.sharedSize.nextSize);let r=e.childNodes[i];if(r.tagName!==this.childNodeType){const s=this.nodesPool();e.replaceChild(s,r),r=s}this.collectedNodes.push(r),this.visualIndex+=1}end(){}}class WP extends VP{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 sG(t,e,n){return e=oG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oG(t){var e=aG(t,"string");return typeof e=="symbol"?e:e+""}function aG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class lG{constructor(e){sG(this,"nodeType",void 0),this.nodeType=e.toUpperCase()}setRootDocument(e){this.rootDocument=e}obtain(){return this.rootDocument.createElement(this.nodeType)}}function Hu(t,e,n){return e=uG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uG(t){var e=cG(t,"string");return typeof e=="symbol"?e:e+""}function cG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Nh{constructor(e,n){Hu(this,"nodesPool",null),Hu(this,"nodeType",void 0),Hu(this,"rootNode",void 0),Hu(this,"table",null),Hu(this,"renderedNodes",0),this.nodesPool=typeof e=="string"?new lG(e):null,this.nodeType=e,this.rootNode=n}setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}adjust(){}render(){}}function w0(t,e,n){return e=hG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hG(t){var e=dG(t,"string");return typeof e=="symbol"?e:e+""}function dG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class fG extends Nh{constructor(){super("TH"),w0(this,"orderViews",new WeakMap),w0(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new WP(e,i=>this.nodesPool.obtain(this.sourceRowIndex,i),this.nodeType),this.orderViews.set(e,n)),n}render(){const{rowsToRender:e,rowHeaderFunctions:n,rowHeadersCount:i,rows:r,cells:s}=this.table;for(let o=0;o<e;o++){const a=this.table.renderedRowToSource(o),l=r.getRenderedNode(o);this.sourceRowIndex=a;const u=this.obtainOrderView(l),c=s.obtainOrderView(l);u.appendView(c).setSize(i).setOffset(this.table.renderedColumnToSource(0)).start();for(let h=0;h<i;h++){u.render();const d=u.getCurrentNode();d.className="",d.removeAttribute("style"),fu(d,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Ee(d,[SU(),IU(),vS(h+1),du(-1)]),n[h](a,d,h)}u.end()}}}class gG extends Nh{constructor(e){super(null,e)}adjust(){const{columnHeadersCount:e,rowHeadersCount:n}=this.table;let i=this.rootNode.firstChild;if(e){const{columnsToRender:r}=this.table,s=r+n;for(let a=0,l=e;a<l;a++){for(i=this.rootNode.childNodes[a],i||(i=this.table.rootDocument.createElement("tr"),this.rootNode.appendChild(i)),this.renderedNodes=i.childNodes.length;this.renderedNodes<s;)i.appendChild(this.table.rootDocument.createElement("th")),this.renderedNodes+=1;for(;this.renderedNodes>s;)i.removeChild(i.lastChild),this.renderedNodes-=1}const o=this.rootNode.childNodes.length;if(o>e)for(let a=e;a<o;a++)this.rootNode.removeChild(this.rootNode.lastChild)}else i&&es(i)}render(){const{columnHeadersCount:e}=this.table;this.table.isAriaEnabled()&&Ee(this.rootNode,[jI()]);for(let n=0;n<e;n+=1){const{columnHeaderFunctions:i,columnsToRender:r,rowHeadersCount:s}=this.table,o=this.rootNode.childNodes[n];this.table.isAriaEnabled()&&Ee(o,[WC(),ZI(n+1)]);for(let a=-1*s;a<r;a+=1){const l=this.table.renderedColumnToSource(a),u=o.childNodes[a+s];u.className="",u.removeAttribute("style"),fu(u,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Ee(u,[vS(a+1+this.table.rowHeadersCount),du(-1),yU(),...a>=0?[_U()]:[WC()]]),i[n](l,u,n)}}}}let C0=!1;class mG extends Nh{constructor(e){super(null,e)}adjust(){const{columnsToRender:e,rowHeadersCount:n}=this.table,i=e+n;for(;this.renderedNodes<i;)this.rootNode.appendChild(this.table.rootDocument.createElement("col")),this.renderedNodes+=1;for(;this.renderedNodes>i;)this.rootNode.removeChild(this.rootNode.lastChild),this.renderedNodes-=1}render(){this.adjust();const{columnsToRender:e,rowHeadersCount:n}=this.table;!C0&&e>1e3&&(C0=!0,vt(ct`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 r=0;r<n;r++){const s=this.table.renderedColumnToSource(r),o=this.table.columnUtils.getHeaderWidth(s);this.rootNode.childNodes[r].style.width=`${o}px`}for(let r=0;r<e;r++){const s=this.table.renderedColumnToSource(r),o=this.table.columnUtils.getStretchedColumnWidth(s);this.rootNode.childNodes[r+n].style.width=`${o}px`}const i=this.rootNode.firstChild;i&&q(i,"rowHeader")}}function pG(t,e,n){return e=wG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wG(t){var e=CG(t,"string");return typeof e=="symbol"?e:e+""}function CG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}let v0=!1;class vG extends Nh{constructor(e){super("TR",e),pG(this,"orderView",void 0),this.orderView=new VP(e,n=>this.nodesPool.obtain(n),this.nodeType)}getRenderedNode(e){return this.orderView.getNode(e)}render(){const{rowsToRender:e}=this.table;!v0&&e>1e3&&(v0=!0,vt(ct`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()&&Ee(this.rootNode,[jI()]),this.orderView.setSize(e).setOffset(this.table.renderedRowToSource(0)).start();for(let r=0;r<e;r++){this.orderView.render();const s=this.orderView.getCurrentNode(),o=this.table.renderedRowToSource(r);if(this.table.isAriaEnabled()){var n,i;Ee(s,[WC(),ZI(o+((n=(i=this.table.rowUtils)===null||i===void 0||(i=i.dataAccessObject)===null||i===void 0?void 0:i.columnHeaders.length)!==null&&n!==void 0?n:0)+1)])}}this.orderView.end()}}function S0(t,e,n){return e=SG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function SG(t){var e=yG(t,"string");return typeof e=="symbol"?e:e+""}function yG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bG extends Nh{constructor(){super("TD"),S0(this,"orderViews",new WeakMap),S0(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new WP(e,i=>this.nodesPool.obtain(this.sourceRowIndex,i),this.nodeType),this.orderViews.set(e,n)),n}render(){const{rowsToRender:e,columnsToRender:n,rows:i,rowHeaders:r}=this.table;for(let a=0;a<e;a++){const l=this.table.renderedRowToSource(a),u=i.getRenderedNode(a);this.sourceRowIndex=l;const c=this.obtainOrderView(u),h=r.obtainOrderView(u);c.prependView(h).setSize(n).setOffset(this.table.renderedColumnToSource(0)).start();for(let d=0;d<n;d++){c.render();const g=c.getCurrentNode(),p=this.table.renderedColumnToSource(d);if(_e(g,"hide")||(g.className=""),g.removeAttribute("style"),g.removeAttribute("dir"),fu(g,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.cellRenderer(l,p,g),this.table.isAriaEnabled()){var s,o;Ee(g,[...g.hasAttribute("role")?[]:[vU()],du(-1),vS(p+((s=(o=this.table.rowUtils)===null||o===void 0||(o=o.dataAccessObject)===null||o===void 0?void 0:o.rowHeaders.length)!==null&&s!==void 0?s:0)+1)])}}c.end()}}}function hn(t,e,n){return e=RG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function RG(t){var e=EG(t,"string");return typeof e=="symbol"?e:e+""}function EG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class TG{constructor(e){let{cellRenderer:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};hn(this,"rootNode",void 0),hn(this,"rootDocument",void 0),hn(this,"rowHeaders",null),hn(this,"columnHeaders",null),hn(this,"colGroup",null),hn(this,"rows",null),hn(this,"cells",null),hn(this,"rowFilter",null),hn(this,"columnFilter",null),hn(this,"rowUtils",null),hn(this,"columnUtils",null),hn(this,"rowsToRender",0),hn(this,"columnsToRender",0),hn(this,"rowHeaderFunctions",[]),hn(this,"rowHeadersCount",0),hn(this,"columnHeaderFunctions",[]),hn(this,"columnHeadersCount",0),hn(this,"cellRenderer",void 0),this.rootNode=e,this.rootDocument=this.rootNode.ownerDocument,this.cellRenderer=n}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:i,rows:r,cells:s}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.setTable(this),n.setTable(this),i.setTable(this),r.setTable(this),s.setTable(this),this.rowHeaders=e,this.columnHeaders=n,this.colGroup=i,this.rows=r,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 i=0;i<e;i++){const r=n.getRenderedNode(i);if(r.firstChild){const s=this.renderedRowToSource(i),o=this.rowUtils.getHeight(s);o?r.firstChild.style.height=`${o-1}px`:r.firstChild.style.height=""}}}}class MG{constructor(){let{TABLE:e,THEAD:n,COLGROUP:i,TBODY:r,rowUtils:s,columnUtils:o,cellRenderer:a}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.renderer=new TG(e,{cellRenderer:a}),this.renderer.setRenderers({rowHeaders:new fG,columnHeaders:new gG(n),colGroup:new mG(i),rows:new vG(r),cells:new bG}),this.renderer.setAxisUtils(s,o)}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 Nu(t,e,n){_G(t,e),e.set(t,n)}function _G(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function pd(t,e,n){return e=IG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function IG(t){var e=PG(t,"string");return typeof e=="symbol"?e:e+""}function PG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function En(t,e){return t.get(BP(t,e))}function Du(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")}var wd=new WeakMap,ol=new WeakMap,Lu=new WeakMap,Cd=new WeakMap,Go=new WeakMap;class LS{static get DEFAULT_WIDTH(){return 50}constructor(e){let{totalColumns:n,stretchMode:i,stretchingColumnWidthFn:r,columnWidthFn:s}=e;pd(this,"stretchAllRatio",0),pd(this,"stretchLastWidth",0),pd(this,"stretchAllColumnsWidth",[]),Nu(this,wd,0),pd(this,"needVerifyLastColumnWidth",!0),Nu(this,ol,()=>0),Nu(this,Lu,o=>o),Nu(this,Cd,o=>o),Nu(this,Go,()=>"none"),Du(ol,this,n),Du(Go,this,i),Du(Lu,this,r??En(Lu,this)),Du(Cd,this,s??En(Cd,this))}refreshStretching(e){if(En(Go,this).call(this)==="none")return;this.stretchAllRatio=0,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0,this.stretchLastWidth=0,Du(wd,this,e);let n=0;for(let r=0;r<En(ol,this).call(this);r++){const s=this._getColumnWidth(r),o=En(Lu,this).call(this,void 0,r);typeof o=="number"?e-=o:n+=s}const i=e-n;if(En(Go,this).call(this)==="all"&&i>0)this.stretchAllRatio=e/n,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0;else if(En(Go,this).call(this)==="last"&&e!==1/0){const r=this._getColumnWidth(En(ol,this).call(this)-1),s=i+r;this.stretchLastWidth=s>=0?s:r}}getStretchedColumnWidth(e,n){let i=null;return En(Go,this).call(this)==="all"&&this.stretchAllRatio!==0?i=this._getStretchedAllColumnWidth(e,n):En(Go,this).call(this)==="last"&&this.stretchLastWidth!==0&&(i=this._getStretchedLastColumnWidth(e)),i}_getStretchedAllColumnWidth(e,n){let i=0;if(!this.stretchAllColumnsWidth[e]){const r=Math.round(n*this.stretchAllRatio),s=En(Lu,this).call(this,r,e);s===void 0?this.stretchAllColumnsWidth[e]=r:this.stretchAllColumnsWidth[e]=isNaN(s)?this._getColumnWidth(e):s}if(this.stretchAllColumnsWidth.length===En(ol,this).call(this)&&this.needVerifyLastColumnWidth){this.needVerifyLastColumnWidth=!1;for(let r=0;r<this.stretchAllColumnsWidth.length;r++)i+=this.stretchAllColumnsWidth[r];i!==En(wd,this)&&(this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length-1]+=En(wd,this)-i)}return this.stretchAllColumnsWidth[e]}_getStretchedLastColumnWidth(e){return e===En(ol,this).call(this)-1?this.stretchLastWidth:null}_getColumnWidth(e){let n=En(Cd,this).call(this,e);return isNaN(n)&&(n=LS.DEFAULT_WIDTH),n}}function vd(t,e,n){return e=OG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function OG(t){var e=xG(t,"string");return typeof e=="symbol"?e:e+""}function xG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class AG{constructor(e,n){vd(this,"dataAccessObject",void 0),vd(this,"wtSettings",void 0),vd(this,"headerWidths",new Map),vd(this,"stretching",void 0),this.dataAccessObject=e,this.wtSettings=n,this.stretching=new LS({totalColumns:()=>this.wtSettings.getSetting("totalColumns"),stretchMode:()=>this.wtSettings.getSetting("stretchH"),stretchingColumnWidthFn:(i,r)=>this.wtSettings.getSetting("onBeforeStretchingColumnWidth",i,r),columnWidthFn:i=>this.dataAccessObject.wtTable.getColumnWidth(i)})}getWidth(e){return this.wtSettings.getSetting("columnWidth",e)||this.wtSettings.getSetting("defaultColumnWidth")}getStretchedColumnWidth(e){let n=this.getWidth(e);const i=this.stretching.getStretchedColumnWidth(e,n);return i&&(n=i),n}getHeaderHeight(e){let n=this.wtSettings.getSetting("defaultRowHeight");const i=this.dataAccessObject.wtViewport.oversizedColumnHeaders[e];return i!==void 0&&(n=n?Math.max(n,i):i),n}getHeaderWidth(e){return this.headerWidths.get(this.dataAccessObject.wtTable.columnFilter.sourceToRendered(e))}refreshStretching(){const{wtTable:e,wtViewport:n,cloneSource:i}=this.dataAccessObject,r=i?i.wtTable.holder:e.holder,s=r.offsetHeight<r.scrollHeight?wn():0;this.stretching.refreshStretching(n.getViewportWidth()-s)}calculateWidths(){const{wtSettings:e}=this;let n=e.getSetting("rowHeaderWidth");if(this.refreshStretching(),n=e.getSetting("onModifyRowHeaderWidth",n),n!=null){const i=e.getSetting("rowHeaders").length,r=e.getSetting("defaultColumnWidth");for(let s=0;s<i;s++){let o=Array.isArray(n)?n[s]:n;o=o??r,this.headerWidths.set(s,o)}}}}function y0(t,e,n){return e=HG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function HG(t){var e=NG(t,"string");return typeof e=="symbol"?e:e+""}function NG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class DG{constructor(e,n){y0(this,"dataAccessObject",void 0),y0(this,"wtSettings",void 0),this.dataAccessObject=e,this.wtSettings=n}getHeight(e){let n=this.wtSettings.getSetting("rowHeight",e);const i=this.dataAccessObject.wtViewport.oversizedRows[e];return i!==void 0&&(n=n===void 0?i:Math.max(n,i)),n}}function Mr(t,e,n){return e=LG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LG(t){var e=$G(t,"string");return typeof e=="symbol"?e:e+""}function $G(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class mu{constructor(e,n,i,r,s){Mr(this,"wtSettings",null),Mr(this,"domBindings",void 0),Mr(this,"TBODY",null),Mr(this,"THEAD",null),Mr(this,"COLGROUP",null),Mr(this,"hasTableHeight",!0),Mr(this,"hasTableWidth",!0),Mr(this,"isTableVisible",!1),Mr(this,"tableOffset",0),Mr(this,"holderOffset",0),this.domBindings=i,this.isMaster=s==="master",this.name=s,this.dataAccessObject=e,this.facadeGetter=n,this.wtSettings=r,this.instance=this.dataAccessObject.wot,this.wot=this.dataAccessObject.wot,this.TABLE=i.rootTable,eP(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 o=this.wtSettings.getSettingPure("rowHeaderWidth");this.wtSettings.update("rowHeaderWidth",()=>this._modifyRowHeaderWidth(o)),this.rowUtils=new DG(this.dataAccessObject,this.wtSettings),this.columnUtils=new AG(this.dataAccessObject,this.wtSettings),this.tableRenderer=new MG({TABLE:this.TABLE,THEAD:this.THEAD,COLGROUP:this.COLGROUP,TBODY:this.TBODY,rowUtils:this.rowUtils,columnUtils:this.columnUtils,cellRenderer:this.wtSettings.getSettingPure("cellRenderer")})}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 i;return(!n||n.nodeType!==Node.ELEMENT_NODE||!_e(n,"wtHolder"))&&(i=this.domBindings.rootDocument.createElement("div"),i.className="wtSpreader",n&&n.insertBefore(i,e),i.appendChild(e)),i.style.position="relative",this.wtSettings.getSetting("ariaTags")&&Ee(i,[qr()]),i}createHider(e){const n=e.parentNode;let i;return(!n||n.nodeType!==Node.ELEMENT_NODE||!_e(n,"wtHolder"))&&(i=this.domBindings.rootDocument.createElement("div"),i.className="wtHider",n&&n.insertBefore(i,e),i.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Ee(i,[qr()]),i}createHolder(e){const n=e.parentNode;let i;return(!n||n.nodeType!==Node.ELEMENT_NODE||!_e(n,"wtHolder"))&&(i=this.domBindings.rootDocument.createElement("div"),i.style.position="relative",i.className="wtHolder",n&&n.insertBefore(i,e),this.isMaster&&(i.parentNode.className+="ht_master handsontable",i.parentNode.setAttribute("dir",this.wtSettings.getSettingPure("rtlMode")?"rtl":"ltr"),this.wtSettings.getSetting("ariaTags")&&Ee(i.parentNode,[qr()])),i.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Ee(i,[qr()]),i}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:n}=this,{wtOverlays:i,wtViewport:r}=this.dataAccessObject,s=n.getSetting("totalRows"),o=n.getSetting("totalColumns"),a=n.getSetting("rowHeaders"),l=a.length,u=n.getSetting("columnHeaders"),c=u.length;let h=e;if(this.isMaster&&(this.holderOffset=pn(this.holder),h=r.createRenderCalculators(h),l&&!n.getSetting("fixedColumnsStart"))){const g=i.inlineStartOverlay.getScrollPosition(),p=this.correctHeaderWidth;this.correctHeaderWidth=g!==0,p!==this.correctHeaderWidth&&(h=!1)}if(this.isMaster&&i.beforeDraw(),h)this.isMaster&&(r.createVisibleCalculators(),r.createPartiallyVisibleCalculators()),i&&i.refresh(!0);else{this.isMaster?this.tableOffset=pn(this.TABLE):this.tableOffset=this.dataAccessObject.parentTableOffset;const g=s>0?this.getFirstRenderedRow():0,p=o>0?this.getFirstRenderedColumn():0;this.rowFilter=new q2(g,s,c),this.columnFilter=new j2(p,o,l);let C=!0;if(this.isMaster){this.alignOverlaysWithTrimmingContainer();const S={};this.wtSettings.getSetting("beforeDraw",!0,S),C=S.skipRender!==!0}if(C){this.tableRenderer.setHeaderContentRenderers(a,u),(this.is(jr)||this.is(Io))&&this.tableRenderer.setHeaderContentRenderers(a,[]),this.resetOversizedRows(),this.tableRenderer.setViewportSize(this.getRenderedRowsCount(),this.getRenderedColumnsCount()).setFilters(this.rowFilter,this.columnFilter).render();let S;if(this.isMaster&&(S=this.dataAccessObject.workspaceWidth,r.containerWidth=null,this.markOversizedColumnHeaders()),this.adjustColumnHeaderHeights(),(this.isMaster||this.is(jr))&&this.markOversizedRows(),this.isMaster){r.createVisibleCalculators(),r.createPartiallyVisibleCalculators(),i.refresh(!1),i.applyToDOM();const b=Ct(this.hider),R=Ct(this.TABLE);b!==0&&R!==b&&(this.columnUtils.calculateWidths(),this.tableRenderer.renderer.colGroup.render()),S!==r.getWorkspaceWidth()&&(r.containerWidth=null,this.columnUtils.calculateWidths(),this.tableRenderer.renderer.colGroup.render()),this.wtSettings.getSetting("onDraw",!0)}else this.is(jr)&&this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize()}}let d=!1;return this.isMaster&&(d=i.topOverlay.resetFixedPosition(),i.bottomOverlay.clone&&(d=i.bottomOverlay.resetFixedPosition()||d),d=i.inlineStartOverlay.resetFixedPosition()||d,i.topInlineStartCornerOverlay&&i.topInlineStartCornerOverlay.resetFixedPosition(),i.bottomInlineStartCornerOverlay&&i.bottomInlineStartCornerOverlay.clone&&i.bottomInlineStartCornerOverlay.resetFixedPosition()),d?(i.refreshAll(),i.adjustElementsSize()):this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(h),this.isMaster&&i.afterDraw(),this.dataAccessObject.drawn=!0,this}markIfOversizedColumnHeader(e){const n=this.columnFilter.renderedToSource(e);let i=this.wtSettings.getSetting("columnHeaders").length;const r=this.wtSettings.getSetting("defaultRowHeight");let s,o,a;const l=this.wtSettings.getSetting("columnHeaderHeight")||[];for(;i;)i-=1,s=this.getColumnHeaderHeight(i),o=this.getColumnHeader(n,i),o&&(a=Ul(o),(!s&&r<a||s<a)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[i]=a),Array.isArray(l)?l[i]!==null&&l[i]!==void 0&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[i]=l[i]):isNaN(l)||(this.dataAccessObject.wtViewport.oversizedColumnHeaders[i]=l),this.dataAccessObject.wtViewport.oversizedColumnHeaders[i]<(l[i]||l)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[i]=l[i]||l))}adjustColumnHeaderHeights(){const{wtSettings:e}=this,n=this.THEAD.childNodes,i=this.dataAccessObject.wtViewport.oversizedColumnHeaders,r=e.getSetting("columnHeaders");for(let s=0,o=r.length;s<o;s++)if(i[s]){if(!n[s]||n[s].childNodes.length===0)return;n[s].childNodes[0].style.height=`${i[s]}px`}}resetOversizedRows(){const{wtSettings:e}=this,{wtViewport:n}=this.dataAccessObject;if(!(!this.isMaster&&!this.is(jr))&&!e.getSetting("externalRowCalculator")){const i=this.getRenderedRowsCount();for(let r=0;r<i;r++){const s=this.rowFilter.renderedToSource(r);n.oversizedRows&&n.oversizedRows[s]&&(n.oversizedRows[s]=void 0)}}}getCell(e){let n=e.row,i=e.col;const r=this.wtSettings.getSetting("onModifyGetCellCoords",n,i);if(r&&Array.isArray(r)&&([n,i]=r),this.isRowBeforeRenderedRows(n))return-1;if(this.isRowAfterRenderedRows(n))return-2;if(this.isColumnBeforeRenderedColumns(i))return-3;if(this.isColumnAfterRenderedColumns(i))return-4;const s=this.getRow(n);if(!s&&n>=0)throw new Error("TR was expected to be rendered but is not");const o=s.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(i)];if(!o&&i>=0)throw new Error("TD or TH was expected to be rendered but is not");return o}getRow(e){let n=null,i=null;if(e<0){var r;n=(r=this.rowFilter)===null||r===void 0?void 0:r.sourceRowToVisibleColHeadedRow(e),i=this.THEAD}else{var s;n=(s=this.rowFilter)===null||s===void 0?void 0:s.sourceToRendered(e),i=this.TBODY}return n!==void 0&&i!==void 0?i.childNodes.length<n+1?!1:i.childNodes[n]:!1}getColumnHeader(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const i=this.THEAD.childNodes[n];return i?.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]}getColumnHeaders(e){const n=[],i=this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e);return this.THEAD.childNodes.forEach(r=>{const s=r.childNodes[i];s&&n.push(s)}),n}getRowHeader(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const i=this.wtSettings.getSetting("rowHeaders").length;if(n>=i)return;const r=this.rowFilter.sourceToRendered(e),s=r<0?this.rowFilter.sourceRowToVisibleColHeadedRow(e):r,a=(r<0?this.THEAD:this.TBODY).childNodes[s];return a?.childNodes[n]}getRowHeaders(e){const n=[],i=this.wtSettings.getSetting("rowHeaders").length;for(let r=0;r<i;r++){const s=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)],o=s?.childNodes[r];o&&n.push(o)}return n}getCoords(e){let n=e;if(n.nodeName!=="TD"&&n.nodeName!=="TH"&&(n=Aa(n,["TD","TH"])),n===null)return null;const i=n.parentNode,r=i.parentNode;let s=YU(i),o=n.cellIndex;return Uo(Fa,n,this.wtRootElement)||Uo($a,n,this.wtRootElement)?r.nodeName==="THEAD"&&(s-=r.childNodes.length):Uo(Io,n,this.wtRootElement)||Uo(jr,n,this.wtRootElement)?s=this.wtSettings.getSetting("totalRows")-r.childNodes.length+s:r===this.THEAD?s=this.rowFilter.visibleColHeadedRowToSourceRow(s):s=this.rowFilter.renderedToSource(s),Uo(Fa,n,this.wtRootElement)||Uo(ka,n,this.wtRootElement)||Uo(Io,n,this.wtRootElement)?o=this.columnFilter.offsettedTH(o):o=this.columnFilter.visibleRowHeadedColumnToSourceColumn(o),this.wot.createCellCoords(s,o)}markOversizedRows(){if(this.wtSettings.getSetting("externalRowCalculator"))return;let e=this.TBODY.childNodes.length;const n=e*this.wtSettings.getSetting("defaultRowHeight"),i=Ul(this.TBODY)-1;let r,s,o,a,l;if(!(n===i&&!this.wtSettings.getSetting("fixedRowsBottom")))for(;e;)e-=1,o=this.rowFilter.renderedToSource(e),r=this.getRowHeight(o),a=this.getTrForRow(o),l=a.querySelector("th"),l?s=Ul(l):s=Ul(a)-1,(!r&&this.wtSettings.getSetting("defaultRowHeight")<s||r<s)&&(s+=1,this.dataAccessObject.wtViewport.oversizedRows[o]=s)}getTrForRow(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]}isColumnHeaderRendered(e){if(e>=0)return!1;const i=this.wtSettings.getSetting("rowHeaders").length;return Math.abs(e)<=i}isRowHeaderRendered(e){if(e>=0)return!1;const i=this.wtSettings.getSetting("columnHeaders").length;return Math.abs(e)<=i}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)}getStretchedColumnWidth(e){return this.columnUtils.getStretchedColumnWidth(e)}hasDefinedSize(){return this.hasTableHeight&&this.hasTableWidth}getWidth(){return Ct(this.TABLE)}getHeight(){return Yt(this.TABLE)}getTotalWidth(){const e=Ct(this.hider);return e!==0?e:this.getWidth()}getTotalHeight(){const e=Yt(this.hider);return e!==0?e:this.getHeight()}isVisible(){return Na(this.TABLE)}_modifyRowHeaderWidth(e){let n=Et(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 kG="stickyRowsBottom",$S={getFirstRenderedRow(){const t=this.wtSettings.getSetting("totalRows"),e=this.wtSettings.getSetting("fixedRowsBottom"),n=t-e;return t===0||e===0?-1:n<0?0:n},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.wtSettings.getSetting("totalRows")-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){const t=this.wtSettings.getSetting("totalRows");return Math.min(this.wtSettings.getSetting("fixedRowsBottom"),t)},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return 0}};zs($S,"MIXIN_NAME",kG,{writable:!1,enumerable:!1});const FG="stickyColumnsStart",vm={getFirstRenderedColumn(){return this.wtSettings.getSetting("totalColumns")===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(){const t=this.wtSettings.getSetting("totalColumns");return Math.min(this.wtSettings.getSetting("fixedColumnsStart"),t)},getVisibleColumnsCount(){return this.getRenderedColumnsCount()},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};zs(vm,"MIXIN_NAME",FG,{writable:!1,enumerable:!1});class kS extends mu{constructor(e,n,i,r){super(e,n,i,r,Io)}}bt(kS,$S);bt(kS,vm);const $a="top",jr="bottom",ka="inline_start",Fa="top_inline_start_corner",Io="bottom_inline_start_corner",VG=[$a,jr,ka,Fa,Io],WG=new Map([[$a,`ht_clone_${$a}`],[jr,`ht_clone_${jr}`],[ka,`ht_clone_${ka} ht_clone_left`],[Fa,`ht_clone_${Fa} ht_clone_top_left_corner`],[Io,`ht_clone_${Io} ht_clone_bottom_left_corner`]]);function BG(t,e){UG(t,e),e.add(t)}function UG(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function YG(t,e,n){return e=zG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zG(t){var e=GG(t,"string");return typeof e=="symbol"?e:e+""}function GG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Sd(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 $u=new WeakSet;class jG{constructor(e){BG(this,$u),YG(this,"dataAccessObject",void 0),this.dataAccessObject=e}scrollViewport(e,n,i,r,s){const o=this.scrollViewportHorizontally(e.col,i,s),a=this.scrollViewportVertically(e.row,n,r);return o||a}scrollViewportHorizontally(e,n,i){const{drawn:r,totalColumns:s}=this.dataAccessObject;if(!r||!Number.isInteger(e)||e<0||e>s)return!1;const o=n===void 0&&i===void 0,{fixedColumnsStart:a,inlineStartOverlay:l}=this.dataAccessObject;if(o&&e<a||(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollHorizontally",e),!Number.isInteger(e)||e<0||e>s))return!1;const u=this.getFirstVisibleColumn(),c=this.getLastVisibleColumn();let h=!1;return(o&&(e<u||e>c)||!o)&&(h=l.scrollTo(e,o?e>=this.getLastPartiallyVisibleColumn():n)),h}scrollViewportVertically(e,n,i){const{drawn:r,totalRows:s}=this.dataAccessObject;if(!r||!Number.isInteger(e)||e<0||e>s)return!1;const o=n===void 0&&i===void 0,{fixedRowsBottom:a,fixedRowsTop:l,topOverlay:u}=this.dataAccessObject;if(o&&(e<l||e>s-a-1)||(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollVertically",e),!Number.isInteger(e)||e<0||e>s))return!1;const c=this.getFirstVisibleRow(),h=this.getLastVisibleRow();let d=!1;return(o&&(e<c||e>h)||!o)&&(d=u.scrollTo(e,o?e>=this.getLastPartiallyVisibleRow():i)),d}getFirstVisibleRow(){return this.dataAccessObject.wtTable.getFirstVisibleRow()}getLastVisibleRow(){return Sd($u,this,R0).call(this,this.dataAccessObject.wtTable.getLastVisibleRow())}getFirstPartiallyVisibleRow(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow()}getLastPartiallyVisibleRow(){return Sd($u,this,R0).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleRow())}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){return Sd($u,this,b0).call(this,this.dataAccessObject.wtTable.getLastVisibleColumn())}getFirstPartiallyVisibleColumn(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn()}getLastPartiallyVisibleColumn(){return Sd($u,this,b0).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn())}}function b0(t){const{wtSettings:e,inlineStartOverlay:n,wtTable:i,wtViewport:r,totalColumns:s,rootWindow:o}=this.dataAccessObject;if(n.mainTableScrollableElement===o){const a=e.getSetting("rtlMode");let l=null;if(a){const c=i.TABLE.getBoundingClientRect(),d=this.dataAccessObject.rootWindow.document.documentElement.offsetWidth;l=Math.abs(c.right-d)}else l=pn(i.wtRootElement).left;const u=Math.abs(nP(o,o));if(l>u){const c=iP(o);let h=r.getRowHeaderWidth();for(let d=1;d<=s;d++)if(h+=n.sumCellSizes(d-1,d),l+h-u>=c){t=d-2;break}}}return t}function R0(t){const{topOverlay:e,wtTable:n,wtViewport:i,totalRows:r,rootWindow:s}=this.dataAccessObject;if(e.mainTableScrollableElement===s){const o=pn(n.wtRootElement),a=bS(s,s);if(o.top>a){const l=Ul(s);let u=i.getColumnHeaderHeight();for(let c=1;c<=r;c++)if(u+=e.sumCellSizes(c-1,c),o.top+u-a>=l){t=c-2;break}}}return t}function Gi(t,e,n){return e=KG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function KG(t){var e=XG(t,"string");return typeof e=="symbol"?e:e+""}function XG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class FS{get eventManager(){return new wr(this)}constructor(e,n){Gi(this,"wtTable",void 0),Gi(this,"wtScroll",void 0),Gi(this,"wtViewport",void 0),Gi(this,"wtOverlays",void 0),Gi(this,"selectionManager",void 0),Gi(this,"wtEvent",void 0),Gi(this,"guid",`wt_${YI()}`),Gi(this,"drawInterrupted",!1),Gi(this,"drawn",!1),Gi(this,"domBindings",void 0),Gi(this,"wtSettings",void 0),this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView},this.wtSettings=n,this.wtScroll=new jG(this.createScrollDao())}findOriginalHeaders(){const e=[];if(this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(let n=0,i=this.wtTable.THEAD.childNodes[0].childNodes.length;n<i;n++)e.push(this.wtTable.THEAD.childNodes[0].childNodes[n].innerHTML);this.wtSettings.getSetting("columnHeaders").length||this.wtSettings.update("columnHeaders",[function(n,i){Ha(i,e[n])}])}}createCellCoords(e,n){return new La(e,n,this.wtSettings.getSetting("rtlMode"))}createCellRange(e,n,i){return new Hh(e,n,i,this.wtSettings.getSetting("rtlMode"))}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.drawInterrupted=!1,this.wtTable.isVisible()?this.wtTable.draw(e):this.drawInterrupted=!0,this}getCell(e){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1))return this.wtTable.getCell(e);const i=this.wtSettings.getSetting("totalRows"),r=this.wtSettings.getSetting("fixedRowsTop"),s=this.wtSettings.getSetting("fixedRowsBottom"),o=this.wtSettings.getSetting("fixedColumnsStart");if(e.row<r&&e.col<o)return this.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.getCell(e);if(e.row<r)return this.wtOverlays.topOverlay.clone.wtTable.getCell(e);if(e.col<o&&e.row>=i-s){if(this.wtOverlays.bottomInlineStartCornerOverlay&&this.wtOverlays.bottomInlineStartCornerOverlay.clone)return this.wtOverlays.bottomInlineStartCornerOverlay.clone.wtTable.getCell(e)}else{if(e.col<o)return this.wtOverlays.inlineStartOverlay.clone.wtTable.getCell(e);if(e.row<i&&e.row>=i-s&&this.wtOverlays.bottomOverlay&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)}scrollViewport(e,n,i,r,s){return e.col<0||e.row<0?!1:this.wtScroll.scrollViewport(e,n,i,r,s)}scrollViewportHorizontally(e,n,i){return e<0?!1:this.wtScroll.scrollViewportHorizontally(e,n,i)}scrollViewportVertically(e,n,i){return e<0?!1:this.wtScroll.scrollViewportVertically(e,n,i)}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 E0(t,e,n){return e=qG(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qG(t){var e=ZG(t,"string");return typeof e=="symbol"?e:e+""}function ZG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class QG extends FS{constructor(e,n,i){super(e,n),E0(this,"cloneSource",void 0),E0(this,"cloneOverlay",void 0);const r=this.wtSettings.getSetting("facade",this);this.cloneSource=i.source,this.cloneOverlay=i.overlay,this.wtTable=this.cloneOverlay.createTable(this.getTableDao(),r,this.domBindings,this.wtSettings),this.wtViewport=i.viewport,this.selectionManager=i.selectionManager,this.wtEvent=new FP(r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,i.event),this.findOriginalHeaders()}}function JG(t,e,n){return e=ej(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ej(t){var e=tj(t,"string");return typeof e=="symbol"?e:e+""}function tj(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Dh{constructor(e,n,i,r,s){JG(this,"wtSettings",null),zs(this,"wot",e,{writable:!1}),this.domBindings=s,this.facadeGetter=n,this.wtSettings=r;const{TABLE:o,hider:a,spreader:l,holder:u,wtRootElement:c}=this.wot.wtTable;this.instance=this.wot,this.type=i,this.mainTableScrollableElement=null,this.TABLE=o,this.hider=a,this.spreader=l,this.holder=u,this.wtRootElement=c,this.trimmingContainer=ru(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=ru(this.hider.parentNode.parentNode)}updateMainScrollableElement(){const{wtTable:e}=this.wot,{rootWindow:n}=this.domBindings;n.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=this.wot.wtTable.holder:this.mainTableScrollableElement=dg(e.TABLE)}getRelativeCellPosition(e,n,i){if(this.clone.wtTable.holder.contains(e)===!1){vt(`The provided element is not a child of the ${this.type} overlay`);return}const r=this.mainTableScrollableElement===this.domBindings.rootWindow,s=i<this.wtSettings.getSetting("fixedColumnsStart"),o=n<this.wtSettings.getSetting("fixedRowsTop"),a=n>=this.wtSettings.getSetting("totalRows")-this.wtSettings.getSetting("fixedRowsBottom"),l=this.clone.wtTable.spreader,u={start:this.getRelativeStartPosition(l),top:l.offsetTop},c={start:this.getRelativeStartPosition(e),top:e.offsetTop};let h=null;return r?h=this.getRelativeCellPositionWithinWindow(o,s,c,u):h=this.getRelativeCellPositionWithinHolder(o,a,s,c,u),h}getRelativeStartPosition(e){return this.isRtl()?e.offsetParent.offsetWidth-e.offsetLeft-e.offsetWidth:e.offsetLeft}getRelativeCellPositionWithinWindow(e,n,i,r){const s=this.wot.wtTable.wtRootElement.getBoundingClientRect();let o=0,a=0;if(!n)o=r.start;else{let l=s.left;this.isRtl()&&(l=this.domBindings.rootWindow.innerWidth-(s.left+s.width+wn())),o=l<=0?-1*l:0}return e?a=this.clone.wtTable.TABLE.getBoundingClientRect().top-s.top:a=r.top,{start:i.start+o,top:i.top+a}}getRelativeCellPositionWithinHolder(e,n,i,r,s){const o={horizontal:this.wot.wtOverlays.inlineStartOverlay.getScrollPosition(),vertical:this.wot.wtOverlays.topOverlay.getScrollPosition()};let a=0,l=0;if(i||(a=o.horizontal-s.start),n){const u=this.wot.wtTable.wtRootElement.getBoundingClientRect();l=this.clone.wtTable.TABLE.getBoundingClientRect().top*-1+u.top}else e||(l=o.vertical-s.top);return{start:r.start-a,top:r.top-l}}makeClone(){if(VG.indexOf(this.type)===-1)throw new Error(`Clone type "${this.type}" is not supported.`);const{wtTable:e,wtSettings:n}=this.wot,{rootDocument:i,rootWindow:r}=this.domBindings,s=i.createElement("div"),o=i.createElement("table"),a=e.wtRootElement.parentNode;s.className=`${WG.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")&&Ee(s,[qr()]),o.className=e.TABLE.className,e.TABLE.getAttribute("role")&&o.setAttribute("role",e.TABLE.getAttribute("role")),s.appendChild(o),a.appendChild(s);const u=this.wtSettings.getSetting("preventOverflow");return u===!0||u==="horizontal"&&this.type===$a||u==="vertical"&&this.type===ka?this.mainTableScrollableElement=r:r.getComputedStyle(a).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=dg(e.TABLE),new QG(o,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;this.needFullRender&&this.clone.draw(e)}reset(){const e=this.clone.wtTable.holder,n=this.clone.wtTable.hider,i=e.style,r=n.style,s=e.parentNode.style;[i,r,s].forEach(o=>{o.width="",o.height=""})}isRtl(){return this.wtSettings.getSetting("rtlMode")}destroy(){this.clone.eventManager.destroy()}}class nj extends Dh{constructor(e,n,i,r,s,o){super(e,n,Io,i,r),this.bottomOverlay=s,this.inlineStartOverlay=o}createTable(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return new kS(...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(),o=this.bottomOverlay.getOverlayOffset();n.style[this.isRtl()?"right":"left"]=`${s}px`,n.style.bottom=`${o}px`}else mm(n),this.repositionOverlay();let i=Yt(this.clone.wtTable.TABLE);const r=Ct(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(i=0),n.style.height=`${i}px`,n.style.width=`${r}px`,!1}repositionOverlay(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:i}=this.domBindings,r=this.clone.wtTable.holder.parentNode;let s=0;n.hasVerticalScroll()||(s+=n.getWorkspaceHeight()-e.getTotalHeight()),n.hasVerticalScroll()&&n.hasHorizontalScroll()&&(s+=wn(i)),r.style.bottom=`${s}px`}}const ij="calculatedColumns",Sm={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}};zs(Sm,"MIXIN_NAME",ij,{writable:!1,enumerable:!1});class VS extends mu{constructor(e,n,i,r){super(e,n,i,r,jr)}}bt(VS,$S);bt(VS,Sm);function rj(t,e,n){return e=sj(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sj(t){var e=oj(t,"string");return typeof e=="symbol"?e:e+""}function oj(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class aj extends Dh{constructor(e,n,i,r){super(e,n,jr,i,r),rj(this,"cachedFixedRowsBottom",-1),this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom")}createTable(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return new VS(...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 i=0;const r=this.wtSettings.getSetting("preventOverflow");this.trimmingContainer===e&&(!r||r!=="vertical")?(i=this.getOverlayOffset(),n.style.bottom=`${i}px`):(i=this.getScrollPosition(),this.repositionOverlay());const s=this.adjustHeaderBordersPosition(i);return this.adjustElementsSize(),s}repositionOverlay(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:i}=this.domBindings,r=this.clone.wtTable.holder.parentNode;let s=0;n.hasVerticalScroll()||(s+=n.getWorkspaceHeight()-e.getTotalHeight()),n.hasVerticalScroll()&&n.hasHorizontalScroll()&&(s+=wn(i)),r.style.bottom=`${s}px`}setScrollPosition(e){const{rootWindow:n}=this.domBindings;let i=!1;return this.mainTableScrollableElement===n?(n.scrollTo(yS(n),e),i=!0):this.mainTableScrollableElement.scrollTop!==e&&(this.mainTableScrollableElement.scrollTop=e,i=!0),i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const{wtTable:i,wtSettings:r}=this.wot,s=r.getSetting("defaultRowHeight");let o=e,a=0;for(;o<n;){const l=i.getRowHeight(o);a+=l===void 0?s:l,o+=1}return a}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:i,rootWindow:r}=this.domBindings,s=wn(i),a=this.clone.wtTable.holder.parentNode.style,l=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==r||l==="horizontal"){let c=n.getWorkspaceWidth();this.wot.wtOverlays.hasScrollbarRight&&(c-=s),c=Math.min(c,e.wtRootElement.scrollWidth),a.width=`${c}px`}else a.width="";this.clone.wtTable.holder.style.width=a.width;let u=Yt(this.clone.wtTable.TABLE);this.wot.wtTable.hasDefinedSize()||(u=0),a.height=`${u}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");if(typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number")this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style.top="0";else throw new Error("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 i=this.getTableParentOffset();const s=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder;let o=0;n&&s.offsetHeight!==s.clientHeight&&(o=wn(this.domBindings.rootDocument)),n?(i+=this.sumCellSizes(0,e+1),i-=this.wot.wtViewport.getViewportHeight(),i+=1):i+=this.sumCellSizes(this.wtSettings.getSetting("fixedRowsBottom"),e),i+=o,this.setScrollPosition(i)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return bS(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let i=0;if(this.trimmingContainer===e&&(!n||n!=="vertical")){const r=this.wot.wtTable.getTotalHeight(),s=this.clone.wtTable.getTotalHeight(),o=r-s,a=this.domBindings.rootDocument.documentElement.clientHeight;i=Math.max(this.getTableParentOffset()-this.getScrollPosition()-a+r,0),i>o&&(i=0)}return i}adjustHeaderBordersPosition(e){const n=this.wtSettings.getSetting("fixedRowsBottom"),i=this.cachedFixedRowsBottom!==n,r=this.wtSettings.getSetting("columnHeaders");let s=!1;if((i||n===0)&&r.length>0){const o=this.wot.wtTable.holder.parentNode,a=_e(o,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||this.wtSettings.getSetting("totalRows")===0?(q(o,"innerBorderBottom"),s=!a):(He(o,"innerBorderBottom"),s=a)}return s}}const lj="calculatedRows",WS={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}};zs(WS,"MIXIN_NAME",lj,{writable:!1,enumerable:!1});class BS extends mu{constructor(e,n,i,r){super(e,n,i,r,ka)}}bt(BS,WS);bt(BS,vm);const uj="localHooks",zn={_localHooks:Object.create(null),addLocalHook(t,e){return this._localHooks[t]||(this._localHooks[t]=[]),this._localHooks[t].push(e),this},runLocalHooks(t,e,n,i,r,s,o){if(this._localHooks[t]){const a=this._localHooks[t].length;for(let l=0;l<a;l++)BC(this._localHooks[t][l],this,e,n,i,r,s,o)}},clearLocalHooks(){return this._localHooks={},this}};zs(zn,"MIXIN_NAME",uj,{writable:!1,enumerable:!1});let UP=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")}};bt(UP,zn);const YP="active-header",US="header",YS="area",zS="focus",cj="fill",hj="row",dj="column",fj="custom-selection",GS=Object.freeze({width:"6px",height:"6px",borderWidth:"1px",borderStyle:"solid",borderColor:"#FFF"});var gj=PS;gj("flat");function mj(t,e){zP(t,e),e.add(t)}function T0(t,e,n){zP(t,e),e.set(t,n)}function zP(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qt(t,e){return t.get(Nc(t,e))}function M0(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")}var ji=new WeakMap,Qn=new WeakMap,yd=new WeakSet;class pj{constructor(){mj(this,yd),T0(this,ji,void 0),T0(this,Qn,void 0)}setActiveOverlay(e){return M0(Qn,this,e),this}setActiveSelection(e){return M0(ji,this,e),this}scan(){const e=qt(ji,this).settings.selectionType,n=new Set;return e==="active-header"?(this.scanColumnsInHeadersRange(i=>n.add(i)),this.scanRowsInHeadersRange(i=>n.add(i))):e==="area"?this.scanCellsRange(i=>n.add(i)):e==="focus"?(this.scanColumnsInHeadersRange(i=>n.add(i)),this.scanRowsInHeadersRange(i=>n.add(i)),this.scanCellsRange(i=>n.add(i))):e==="fill"?this.scanCellsRange(i=>n.add(i)):e==="header"?(this.scanColumnsInHeadersRange(i=>n.add(i)),this.scanRowsInHeadersRange(i=>n.add(i))):e==="row"?(this.scanRowsInHeadersRange(i=>n.add(i)),this.scanRowsInCellsRange(i=>n.add(i))):e==="column"&&(this.scanColumnsInHeadersRange(i=>n.add(i)),this.scanColumnsInCellsRange(i=>n.add(i))),n}scanColumnsInHeadersRange(e){const[n,i,r,s]=qt(ji,this).getCorners(),{wtTable:o}=qt(Qn,this),a=o.getRenderedColumnsCount(),l=o.getColumnHeadersCount();let u=0;for(let c=-o.getRowHeadersCount();c<a;c++){const h=o.columnFilter.renderedToSource(c);if(!(h<i||h>s)){for(let d=-l;d<0;d++){if(d<n||d>r)continue;const g=d+l;let p=o.getColumnHeader(h,g);const C=qt(Qn,this).getSetting("onBeforeHighlightingColumnHeader",h,g,{selectionType:qt(ji,this).settings.selectionType,columnCursor:u,selectionWidth:s-i+1});C!==null&&(C!==h&&(p=o.getColumnHeader(C,g)),e(p))}u+=1}}}scanRowsInHeadersRange(e){const[n,i,r,s]=qt(ji,this).getCorners(),{wtTable:o}=qt(Qn,this),a=o.getRenderedRowsCount(),l=o.getRowHeadersCount();let u=0;for(let c=-o.getColumnHeadersCount();c<a;c++){const h=o.rowFilter.renderedToSource(c);if(!(h<n||h>r)){for(let d=-l;d<0;d++){if(d<i||d>s)continue;const g=d+l;let p=o.getRowHeader(h,g);const C=qt(Qn,this).getSetting("onBeforeHighlightingRowHeader",h,g,{selectionType:qt(ji,this).settings.selectionType,rowCursor:u,selectionHeight:r-n+1});C!==null&&(C!==h&&(p=o.getRowHeader(C,g)),e(p))}u+=1}}}scanCellsRange(e){const[n,i,r,s]=qt(ji,this).getCorners(),{wtTable:o}=qt(Qn,this);Nc(yd,this,Up).call(this,(a,l)=>{if(a>=n&&a<=r&&l>=i&&l<=s){const u=o.getCell(qt(Qn,this).createCellCoords(a,l)),c=qt(Qn,this).getSetting("onAfterDrawSelection",a,l,qt(ji,this).settings.layerLevel);typeof c=="string"&&q(u,c),e(u)}})}scanRowsInCellsRange(e){const[n,,i]=qt(ji,this).getCorners(),{wtTable:r}=qt(Qn,this);Nc(yd,this,Up).call(this,(s,o)=>{if(s>=n&&s<=i){const a=r.getCell(qt(Qn,this).createCellCoords(s,o));e(a)}})}scanColumnsInCellsRange(e){const[,n,,i]=qt(ji,this).getCorners(),{wtTable:r}=qt(Qn,this);Nc(yd,this,Up).call(this,(s,o)=>{if(o>=n&&o<=i){const a=r.getCell(qt(Qn,this).createCellCoords(s,o));e(a)}})}}function Up(t){const{wtTable:e}=qt(Qn,this),n=e.getRenderedRowsCount(),i=e.getRenderedColumnsCount();for(let r=0;r<n;r+=1){const s=e.rowFilter.renderedToSource(r);for(let o=0;o<i;o+=1)t(s,e.columnFilter.renderedToSource(o))}}class _0{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=GS,this.cornerCenterPointOffset=-(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,i=this.main.childNodes.length;n<i;n++){const r=this.main.childNodes[n];this.eventManager.addEventListener(r,"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(),yr(e);const i=this,r=this.wot.rootDocument.body,s=n.getBoundingClientRect();n.style.display="none";function o(l){if(l.clientY<Math.floor(s.top)||l.clientY>Math.ceil(s.top+s.height)||l.clientX<Math.floor(s.left)||l.clientX>Math.ceil(s.left+s.width))return!0}function a(l){o(l)&&(i.eventManager.removeEventListener(r,"mousemove",a),n.style.display="block")}this.eventManager.addEventListener(r,"mousemove",a)}createBorders(e){const{rootDocument:n}=this.wot;this.main=n.createElement("div");const i=["top","start","bottom","end","corner"];let r=this.main.style;r.position="absolute",r.top=0,r.left=0;for(let a=0;a<5;a++){const l=i[a],u=n.createElement("div");u.className=`wtBorder ${this.settings.className||""}`,this.settings[l]&&this.settings[l].hide&&(u.className+=" hidden"),r=u.style,r.backgroundColor=this.settings[l]&&this.settings[l].color?this.settings[l].color:e.border.color,r.height=this.settings[l]&&this.settings[l].width?`${this.settings[l].width}px`:`${e.border.width}px`,r.width=this.settings[l]&&this.settings[l].width?`${this.settings[l].width}px`:`${e.border.width}px`,this.main.appendChild(u)}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,this.cornerStyle.height=this.cornerDefaultStyle.height,this.cornerStyle.border=[this.cornerDefaultStyle.borderWidth,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),bo()&&this.instance.getSetting("isDataViewInstance")&&this.createMultipleSelectorHandles(),this.disappear();const{wtTable:s}=this.wot;let o=s.bordersHolder;o||(o=n.createElement("div"),o.className="htBorders",s.bordersHolder=o,s.spreader.appendChild(o)),o.appendChild(this.main)}createMultipleSelectorHandles(){const{rootDocument:e}=this.wot;this.selectionHandles={top:e.createElement("DIV"),topHitArea:e.createElement("DIV"),bottom:e.createElement("DIV"),bottomHitArea:e.createElement("DIV")};const n=10,i=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 r={position:"absolute",height:`${i}px`,width:`${i}px`,"border-radius":`${parseInt(i/1.5,10)}px`};Ue(r,(o,a)=>{this.selectionHandles.styles.bottomHitArea[a]=o,this.selectionHandles.styles.topHitArea[a]=o});const s={position:"absolute",height:`${n}px`,width:`${n}px`,"border-radius":`${parseInt(n/1.5,10)}px`,background:"#F5F5FF",border:"1px solid #4285c8"};Ue(s,(o,a)=>{this.selectionHandles.styles.bottom[a]=o,this.selectionHandles.styles.top[a]=o}),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 i=this.wot.selectionManager.getAreaSelection();return!!(i.cellRange&&(e!==i.cellRange.to.row||n!==i.cellRange.to.col))}updateMultipleSelectionHandlesPosition(e,n,i,r,s,o){const l=this.wot.wtSettings.getSetting("rtlMode")?"right":"left",{top:u,topHitArea:c,bottom:h,bottomHitArea:d}=this.selectionHandles.styles,g=parseInt(u.borderWidth,10),p=parseInt(u.width,10),C=parseInt(c.width,10),S=this.wot.wtTable.getWidth(),b=this.wot.wtTable.getHeight();u.top=`${parseInt(i-p-1,10)}px`,u[l]=`${parseInt(r-p-1,10)}px`,c.top=`${parseInt(i-C/4*3,10)}px`,c[l]=`${parseInt(r-C/4*3,10)}px`;const R=Math.min(parseInt(r+s,10),S-p-g*2),E=Math.min(parseInt(r+s-C/4,10),S-C-g*2);h[l]=`${R}px`,d[l]=`${E}px`;const H=Math.min(parseInt(i+o,10),b-p-g*2),P=Math.min(parseInt(i+o-C/4,10),b-C-g*2);h.top=`${H}px`,d.top=`${P}px`,this.settings.border.cornerVisible&&this.settings.border.cornerVisible()?(u.display="block",c.display="block",this.isPartRange(e,n)?(h.display="none",d.display="none"):(h.display="block",d.display="block")):(u.display="none",h.display="none",c.display="none",d.display="none"),e===this.wot.wtSettings.getSetting("fixedRowsTop")||n===this.wot.wtSettings.getSetting("fixedColumnsStart")?(u.zIndex="9999",c.zIndex="9999"):(u.zIndex="",c.zIndex="")}appear(e){if(this.disabled)return;const{wtTable:n,rootDocument:i,rootWindow:r}=this.wot;let s,o,a,l,u,c;const h=n.getRenderedRowsCount();for(let we=0;we<h;we+=1){const pe=n.rowFilter.renderedToSource(we);if(pe>=e[0]&&pe<=e[2]){s=pe,u=e[0];break}}for(let we=h-1;we>=0;we-=1){const pe=n.rowFilter.renderedToSource(we);if(pe>=e[0]&&pe<=e[2]){o=pe;break}}const d=n.getRenderedColumnsCount();for(let we=0;we<d;we+=1){const pe=n.columnFilter.renderedToSource(we);if(pe>=e[1]&&pe<=e[3]){a=pe,c=e[1];break}}for(let we=d-1;we>=0;we-=1){const pe=n.columnFilter.renderedToSource(we);if(pe>=e[1]&&pe<=e[3]){l=pe;break}}if(s===void 0||a===void 0){this.disappear();return}let g=n.getCell(this.wot.createCellCoords(s,a));const p=s!==o||a!==l,C=p?n.getCell(this.wot.createCellCoords(o,l)):g,S=pn(g),b=p?pn(C):S,R=pn(n.TABLE),E=Ct(n.TABLE),H=S.top,P=S.left,B=this.wot.wtSettings.getSetting("rtlMode");let Y=0,j=0;if(B){const we=Ct(g),pe=r.innerWidth-R.left-E;j=P+we-b.left,Y=r.innerWidth-P-we-pe-1}else j=b.left+Ct(C)-P,Y=P-R.left-1;if(this.isEntireColumnSelected(s,o)){const we=this.getDimensionsFromHeader("columns",a,l,u,R);let pe=null;we&&([pe,Y,j]=we),pe&&(g=pe)}let z=H-R.top-1,G=b.top+Yt(C)-H;if(this.isEntireRowSelected(a,l)){const we=this.getDimensionsFromHeader("rows",s,o,c,R);let pe=null;we&&([pe,z,G]=we),pe&&(g=pe)}const Z=xo(g,r);parseInt(Z.borderTopWidth,10)>0&&(z+=1,G=G>0?G-1:0),parseInt(Z[B?"borderRightWidth":"borderLeftWidth"],10)>0&&(Y+=1,j=j>0?j-1:0);const ne=B?"right":"left";this.topStyle.top=`${z}px`,this.topStyle[ne]=`${Y}px`,this.topStyle.width=`${j}px`,this.topStyle.display="block",this.startStyle.top=`${z}px`,this.startStyle[ne]=`${Y}px`,this.startStyle.height=`${G}px`,this.startStyle.display="block";const ie=Math.floor(this.settings.border.width/2);this.bottomStyle.top=`${z+G-ie}px`,this.bottomStyle[ne]=`${Y}px`,this.bottomStyle.width=`${j}px`,this.bottomStyle.display="block",this.endStyle.top=`${z}px`,this.endStyle[ne]=`${Y+j-ie}px`,this.endStyle.height=`${G+1}px`,this.endStyle.display="block";let Ce=this.settings.border.cornerVisible;Ce=typeof Ce=="function"?Ce(this.settings.layerLevel):Ce;const Me=this.wot.getSetting("onModifyGetCellCoords",o,l);let[et,Ne]=[o,l];if(Me&&Array.isArray(Me)&&([,,et,Ne]=Me),bo()||!Ce||this.isPartRange(et,Ne))this.cornerStyle.display="none";else{this.cornerStyle.top=`${z+G+this.cornerCenterPointOffset-1}px`,this.cornerStyle[ne]=`${Y+j+this.cornerCenterPointOffset-1}px`,this.cornerStyle.borderRightWidth=this.cornerDefaultStyle.borderWidth,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="none";let we=ru(n.TABLE);const pe=we===r;pe&&(we=i.documentElement);const ht=parseInt(this.cornerDefaultStyle.width,10)/2,f=parseInt(this.cornerDefaultStyle.height,10)/2;if(l===this.wot.getSetting("totalColumns")-1){const m=pe?C.getBoundingClientRect().left:C.offsetLeft;let w=!1,O=0;B?(O=m-parseInt(this.cornerDefaultStyle.width,10)/2,w=O<0):(O=m+Ct(C)+parseInt(this.cornerDefaultStyle.width,10)/2,w=O>=iP(we)),w&&(this.cornerStyle[ne]=`${Math.floor(Y+j+this.cornerCenterPointOffset-ht)}px`,this.cornerStyle[B?"borderLeftWidth":"borderRightWidth"]=0)}o===this.wot.getSetting("totalRows")-1&&(pe?C.getBoundingClientRect().top:C.offsetTop)+Yt(C)+parseInt(this.cornerDefaultStyle.height,10)/2>=Ul(we)&&(this.cornerStyle.top=`${Math.floor(z+G+this.cornerCenterPointOffset-f)}px`,this.cornerStyle.borderBottomWidth=0),this.cornerStyle.display="block"}bo()&&this.instance.getSetting("isDataViewInstance")&&this.updateMultipleSelectionHandlesPosition(o,l,z,Y,j,G)}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,i,r,s){const{wtTable:o}=this.wot,a=o.wtRootElement.parentNode;let l=null,u=null,c=null,h=null,d=null,g=null,p=null,C=null;switch(e){case"rows":l=function(){return o.getRowHeader(...arguments)},u=function(){return Yt(...arguments)},c="ht__selection--rows",g="top";break;case"columns":l=function(){return o.getColumnHeader(...arguments)},u=function(){return Ct(...arguments)},c="ht__selection--columns",g="left";break}if(a.classList.contains(c)){const S=this.wot.getSetting("columnHeaders").length;if(p=l(n,S-r),C=l(i,S-r),!p||!C)return!1;const b=pn(p),R=pn(C);return p&&C&&(h=b[g]-s[g]-1,d=R[g]+u(C)-b[g]),[p,h,d]}return!1}changeBorderStyle(e,n){const i=this[e].style,r=n[e];!r||r.hide?q(this[e],"hidden"):(_e(this[e],"hidden")&&He(this[e],"hidden"),i.backgroundColor=r.color,(e==="top"||e==="bottom")&&(i.height=`${r.width}px`),(e==="start"||e==="end")&&(i.width=`${r.width}px`))}changeBorderToDefaultStyle(e){const n={width:1,color:"#000"},i=this[e].style;i.backgroundColor=n.color,i.width=`${n.width}px`,i.height=`${n.width}px`}toggleHiddenClass(e,n){this.changeBorderToDefaultStyle(e),n?q(this[e],"hidden"):He(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",bo()&&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 wj(t,e){GP(t,e),e.add(t)}function al(t,e,n){GP(t,e),e.set(t,n)}function GP(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function je(t,e){return t.get(jS(t,e))}function I0(t,e,n){return t.set(jS(t,e),n),n}function jS(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 _n=new WeakMap,ti=new WeakMap,Yp=new WeakMap,Mc=new WeakMap,zp=new WeakMap,jo=new WeakMap,P0=new WeakSet;class Cj{constructor(e){wj(this,P0),al(this,_n,void 0),al(this,ti,void 0),al(this,Yp,new pj),al(this,Mc,new WeakMap),al(this,zp,new WeakSet),al(this,jo,new Map),I0(ti,this,e)}setActiveOverlay(e){return I0(_n,this,e),je(Yp,this).setActiveOverlay(je(_n,this)),je(Mc,this).has(je(_n,this))||je(Mc,this).set(je(_n,this),new Set),this}getFocusSelection(){return je(ti,this)!==null?je(ti,this).getFocus():null}getAreaSelection(){return je(ti,this)!==null?je(ti,this).createLayeredArea():null}getBorderInstance(e){if(!e.settings.border)return null;if(je(jo,this).has(e)){const i=je(jo,this).get(e);if(i.has(je(_n,this)))return i.get(je(_n,this));const r=new _0(je(_n,this),e.settings);return i.set(je(_n,this),r),r}const n=new _0(je(_n,this),e.settings);return je(jo,this).set(e,new Map([[je(_n,this),n]])),n}getBorderInstances(e){var n,i;return Array.from((n=(i=je(jo,this).get(e))===null||i===void 0?void 0:i.values())!==null&&n!==void 0?n:[])}destroyBorders(e){je(jo,this).get(e).forEach(n=>n.destroy()),je(jo,this).delete(e)}render(e){if(je(ti,this)===null)return;e&&jS(P0,this,vj).call(this);const n=Array.from(je(ti,this)),i=new Map,r=new Map;for(let s=0;s<n.length;s++){const o=n[s],{className:a,headerAttributes:l,createLayers:u,selectionType:c}=o.settings;je(zp,this).has(o)||(je(zp,this).add(o),o.addLocalHook("destroy",()=>this.destroyBorders(o)));const h=this.getBorderInstance(o);if(o.isEmpty()){h?.disappear();continue}a&&je(Yp,this).setActiveSelection(o).scan().forEach(p=>{if(i.has(p)){const C=i.get(p);C.has(a)&&u===!0?C.set(a,C.get(a)+1):C.set(a,1)}else i.set(p,new Map([[a,1]]));l&&(r.has(p)||r.set(p,[]),p.nodeName==="TH"&&r.get(p).push(...l))});const d=o.getCorners();je(_n,this).getSetting("onBeforeDrawBorders",d,c),h?.appear(d)}i.forEach((s,o)=>{var a;const l=Array.from(s).map(u=>{let[c,h]=u;return h===1?c:[c,...Array.from({length:h-1},(d,g)=>`${c}-${g+1}`)]}).flat();l.forEach(u=>je(Mc,this).get(je(_n,this)).add(u)),q(o,l),o.nodeName==="TD"&&Array.isArray((a=je(ti,this).options)===null||a===void 0?void 0:a.cellAttributes)&&Ee(o,je(ti,this).options.cellAttributes)}),Array.from(r.keys()).forEach(s=>{Ee(s,[...r.get(s)])})}}function vj(){const t=je(Mc,this).get(je(_n,this)),e=je(_n,this).wtSettings.getSetting("onBeforeRemoveCellClassNames");if(Array.isArray(e))for(let n=0;n<e.length;n++)t.add(e[n]);t.forEach(n=>{var i,r;const s=je(_n,this).wtTable.TABLE.querySelectorAll(`.${n}`);let o=[];Array.isArray((i=je(ti,this).options)===null||i===void 0?void 0:i.cellAttributes)&&(o=je(ti,this).options.cellAttributes.map(a=>a[0])),Array.isArray((r=je(ti,this).options)===null||r===void 0?void 0:r.headerAttributes)&&(o=[...o,...je(ti,this).options.headerAttributes.map(a=>a[0])]);for(let a=0,l=s.length;a<l;a++)He(s[a],n),fu(s[a],o)}),t.clear()}class Sj extends Dh{constructor(e,n,i,r){super(e,n,ka,i,r)}createTable(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return new BS(...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,i=this.clone.wtTable.holder.parentNode,r=this.wtSettings.getSetting("preventOverflow");let s=0;this.trimmingContainer===n&&(!r||r!=="horizontal")?(s=this.getOverlayOffset()*(this.isRtl()?-1:1),RS(i,`${s}px`,"0px")):(s=this.getScrollPosition(),mm(i));const o=this.adjustHeaderBordersPosition(s);return this.adjustElementsSize(),o}setScrollPosition(e){const{rootWindow:n}=this.domBindings;let i=!1;return this.isRtl()&&(e=-e),this.mainTableScrollableElement===n&&n.scrollX!==e?(n.scrollTo(e,tP(n)),i=!0):this.mainTableScrollableElement.scrollLeft!==e&&(this.mainTableScrollableElement.scrollLeft=e,i=!0),i}onScroll(){this.wtSettings.getSetting("onScrollVertically")}sumCellSizes(e,n){const i=this.wtSettings.getSetting("defaultColumnWidth");let r=e,s=0;for(;r<n;)s+=this.wot.wtTable.getStretchedColumnWidth(r)||i,r+=1;return s}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e}=this.wot,{rootDocument:n,rootWindow:i}=this.domBindings,r=wn(n),o=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="vertical"){let u=this.wot.wtViewport.getWorkspaceHeight();this.wot.wtOverlays.hasScrollbarBottom&&(u-=r),u=Math.min(u,e.wtRootElement.scrollHeight),o.height=`${u}px`}else o.height="";this.clone.wtTable.holder.style.height=o.height;const l=Ct(this.clone.wtTable.TABLE);o.width=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=this.wot.selectionManager.getFocusSelection()?parseInt(GS.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)+n}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalColumns"),n=this.isRtl()?"right":"left";if(typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number")this.spreader.style[n]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style[n]="0";else throw new Error("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:i}=this,r=i.getSetting("rowHeaders"),s=i.getSetting("fixedColumnsStart"),a=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder,l=s===0&&r.length>0&&!_e(a.parentNode,"innerBorderInlineStart")?1:0;let u=this.getTableParentOffset(),c=0;if(n){const h=this.wot.wtTable.getColumnWidth(e),d=this.wot.wtViewport.getViewportWidth();h>d&&(n=!1)}return n&&a.offsetWidth!==a.clientWidth&&(c=wn(this.domBindings.rootDocument)),n?(u+=this.sumCellSizes(0,e+1),u-=this.wot.wtViewport.getViewportWidth(),u+=l):u+=this.sumCellSizes(this.wtSettings.getSetting("fixedColumnsStart"),e),u+=c,jU(this.mainTableScrollableElement)===u-l&&l>0&&this.wot.wtOverlays.expandHiderHorizontallyBy(l),this.setScrollPosition(u)}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(nP(this.mainTableScrollableElement,this.domBindings.rootWindow))}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let i=0;if(this.trimmingContainer===e&&(!n||n!=="horizontal")){this.isRtl()?i=Math.abs(Math.min(this.getTableParentOffset()-this.getScrollPosition(),0)):i=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0);const r=this.wot.wtTable.getTotalWidth(),s=this.clone.wtTable.getTotalWidth(),o=r-s;i>o&&(i=0)}return i}adjustHeaderBordersPosition(e){const{wtSettings:n}=this,i=this.wot.wtTable.holder.parentNode,r=n.getSetting("rowHeaders"),s=n.getSetting("fixedColumnsStart"),o=n.getSetting("totalRows"),a=n.getSetting("preventOverflow")==="vertical";o?He(i,"emptyRows"):q(i,"emptyRows");let l=!1;if(!a){if(s&&!r.length)q(i,"innerBorderLeft innerBorderInlineStart");else if(!s&&r.length){const u=_e(i,"innerBorderInlineStart");e?(q(i,"innerBorderLeft innerBorderInlineStart"),l=!u):(He(i,"innerBorderLeft innerBorderInlineStart"),l=u)}}return l}}const yj="stickyRowsTop",KS={getFirstRenderedRow(){return this.wtSettings.getSetting("totalRows")===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(){const t=this.wtSettings.getSetting("totalRows");return Math.min(this.wtSettings.getSetting("fixedRowsTop"),t)},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};zs(KS,"MIXIN_NAME",yj,{writable:!1,enumerable:!1});class XS extends mu{constructor(e,n,i,r){super(e,n,i,r,Fa)}}bt(XS,KS);bt(XS,vm);function O0(t,e,n){return e=bj(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bj(t){var e=Rj(t,"string");return typeof e=="symbol"?e:e+""}function Rj(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Ej extends Dh{constructor(e,n,i,r,s,o){super(e,n,Fa,i,r),O0(this,"topOverlay",void 0),O0(this,"inlineStartOverlay",void 0),this.topOverlay=s,this.inlineStartOverlay=o}createTable(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return new XS(...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 r=this.inlineStartOverlay.getOverlayOffset()*(this.isRtl()?-1:1),s=this.topOverlay.getOverlayOffset();RS(e,`${r}px`,`${s}px`)}else mm(e);let n=Yt(this.clone.wtTable.TABLE);const i=Ct(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(n=0),e.style.height=`${n}px`,e.style.width=`${i}px`,!1}}class qS extends mu{constructor(e,n,i,r){super(e,n,i,r,$a)}}bt(qS,KS);bt(qS,Sm);function Tj(t,e,n){return e=Mj(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Mj(t){var e=_j(t,"string");return typeof e=="symbol"?e:e+""}function _j(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Ij extends Dh{constructor(e,n,i,r){super(e,n,$a,i,r),Tj(this,"cachedFixedRowsTop",-1),this.cachedFixedRowsTop=this.wtSettings.getSetting("fixedRowsTop")}createTable(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return new qS(...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,i=this.wtSettings.getSetting("preventOverflow");let r=0,s=!1;if(this.trimmingContainer===n&&(!i||i!=="vertical")){const{wtTable:a}=this.wot,l=a.hider.getBoundingClientRect(),u=Math.ceil(l.bottom),c=e.offsetHeight;s=u===c,r=this.getOverlayOffset(),RS(e,"0px",`${r}px`)}else r=this.getScrollPosition(),mm(e);const o=this.adjustHeaderBordersPosition(r,s);return this.adjustElementsSize(),o}setScrollPosition(e){const n=this.domBindings.rootWindow;let i=!1;return this.mainTableScrollableElement===n&&n.scrollY!==e?(n.scrollTo(yS(n),e),i=!0):this.mainTableScrollableElement.scrollTop!==e&&(this.mainTableScrollableElement.scrollTop=e,i=!0),i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const i=this.wtSettings.getSetting("defaultRowHeight");let r=e,s=0;for(;r<n;){const o=this.wot.wtTable.getRowHeight(r);s+=o===void 0?i:o,r+=1}return s}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e}=this.wot,{rootDocument:n,rootWindow:i}=this.domBindings,r=wn(n),o=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let u=this.wot.wtViewport.getWorkspaceWidth();this.wot.wtOverlays.hasScrollbarRight&&(u-=r),u=Math.min(u,e.wtRootElement.scrollWidth),o.width=`${u}px`}else o.width="";this.clone.wtTable.holder.style.width=o.width;let l=Yt(this.clone.wtTable.TABLE);this.wot.wtTable.hasDefinedSize()||(l=0),o.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=this.wot.selectionManager.getFocusSelection()?parseInt(GS.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)+n}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");if(typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number")this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style.top="0";else throw new Error("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:i,wtSettings:r}=this,o=(i.cloneSource?i.cloneSource:i).wtTable.holder,a=r.getSetting("columnHeaders"),u=r.getSetting("fixedRowsTop")===0&&a.length>0&&!_e(o.parentNode,"innerBorderTop")?1:0;let c=this.getTableParentOffset(),h=0;if(n){const d=this.wot.wtTable.getRowHeight(e),g=this.wot.wtViewport.getViewportHeight();d>g&&(n=!1)}if(n&&o.offsetHeight!==o.clientHeight&&(h=wn(this.domBindings.rootDocument)),n){const d=r.getSetting("fixedRowsBottom"),g=r.getSetting("totalRows");c+=this.sumCellSizes(0,e+1),c-=i.wtViewport.getViewportHeight()-this.sumCellSizes(g-d,g),c+=1,c+=u}else c+=this.sumCellSizes(r.getSetting("fixedRowsTop"),e);return c+=h,GU(this.mainTableScrollableElement)===c-u&&u>0&&this.wot.wtOverlays.expandHiderVerticallyBy(u),this.setScrollPosition(c)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return bS(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let i=0;if(this.trimmingContainer===e&&(!n||n!=="vertical")){const r=this.wot.wtTable.getTotalHeight(),s=this.clone.wtTable.getTotalHeight(),o=r-s;i=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0),i>o&&(i=0)}return i}adjustHeaderBordersPosition(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{wtSettings:i}=this,r=this.wot.wtTable.holder.parentNode,s=i.getSetting("totalColumns"),o=i.getSetting("preventOverflow")==="horizontal";s?He(r,"emptyColumns"):q(r,"emptyColumns");let a=!1;if(!n&&!o){const l=i.getSetting("fixedRowsTop"),u=this.cachedFixedRowsTop!==l,c=i.getSetting("columnHeaders");if((u||l===0)&&c.length>0){const h=_e(r,"innerBorderTop");this.cachedFixedRowsTop=i.getSetting("fixedRowsTop"),e||i.getSetting("totalRows")===0?(q(r,"innerBorderTop"),a=!h):(He(r,"innerBorderTop"),a=h)}}return a}}function x0(t,e,n){Pj(t,e),e.set(t,n)}function Pj(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ds(t,e,n){return e=Oj(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Oj(t){var e=xj(t,"string");return typeof e=="symbol"?e:e+""}function xj(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Gp(t,e,n){return t.set(jP(t,e),n),n}function ku(t,e){return t.get(jP(t,e))}function jP(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,bd=new WeakMap;class Aj{constructor(e,n,i,r,s,o){ds(this,"wot",null),x0(this,ll,[]),ds(this,"topOverlay",null),ds(this,"bottomOverlay",null),ds(this,"inlineStartOverlay",null),ds(this,"topInlineStartCornerOverlay",null),ds(this,"bottomInlineStartCornerOverlay",null),ds(this,"browserLineHeight",void 0),ds(this,"wtSettings",null),x0(this,bd,!1),ds(this,"resizeObserver",new ResizeObserver(c=>{_S(()=>{!Array.isArray(c)||!c.length||this.wtSettings.getSetting("onContainerElementResize")})})),this.wot=e,this.wtSettings=r,this.domBindings=i,this.facadeGetter=n,this.wtTable=o;const{rootDocument:a,rootWindow:l}=this.domBindings;this.instance=this.wot,this.eventManager=s,this.scrollbarSize=wn(a);const u=l.getComputedStyle(o.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden";this.scrollableElement=u?o.holder:dg(o.TABLE),this.initOverlays(),this.hasScrollbarBottom=!1,this.hasScrollbarRight=!1,this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.initBrowserLineHeight(),this.registerListeners(),this.lastScrollX=l.scrollX,this.lastScrollY=l.scrollY}getOverlays(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const n=[...ku(ll,this)];return e&&n.push(this.wtTable),n}initBrowserLineHeight(){const{rootWindow:e,rootDocument:n}=this.domBindings,i=e.getComputedStyle(n.body),r=parseInt(i.lineHeight,10),s=parseInt(i.fontSize,10)*1.2;this.browserLineHeight=r||s}initOverlays(){const e=[this.wot,this.facadeGetter,this.wtSettings,this.domBindings];this.topOverlay=new Ij(...e),this.bottomOverlay=new aj(...e),this.inlineStartOverlay=new Sj(...e),this.topInlineStartCornerOverlay=new Ej(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new nj(...e,this.bottomOverlay,this.inlineStartOverlay),Gp(ll,this,[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay])}beforeDraw(){Gp(bd,this,ku(ll,this).reduce((e,n)=>n.hasRenderingStateChanged()||e,!1)),ku(ll,this).forEach(e=>e.updateStateOfRendering("before"))}afterDraw(){this.syncScrollWithMaster(),ku(ll,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:i}=this.topOverlay,{mainTableScrollableElement:r}=this.inlineStartOverlay;this.eventManager.addEventListener(e.documentElement,"keydown",h=>this.onKeyDown(h)),this.eventManager.addEventListener(e.documentElement,"keyup",()=>this.onKeyUp()),this.eventManager.addEventListener(e,"visibilitychange",()=>this.onKeyUp()),this.eventManager.addEventListener(i,"scroll",h=>this.onTableScroll(h),{passive:!0}),i!==r&&this.eventManager.addEventListener(r,"scroll",h=>this.onTableScroll(h),{passive:!0});const s=n.devicePixelRatio&&n.devicePixelRatio>1,o=this.scrollableElement===n,a=this.wtSettings.getSetting("preventWheel"),l={passive:o};(a||s||!mP())&&this.eventManager.addEventListener(this.wtTable.wtRootElement,"wheel",h=>this.onCloneWheel(h,a),l),[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay].forEach(h=>{if(h&&h.needFullRender){const{holder:d}=h.clone.wtTable;this.eventManager.addEventListener(d,"wheel",g=>this.onCloneWheel(g,a),l)}});let c;this.eventManager.addEventListener(n,"resize",()=>{clearTimeout(c),c=setTimeout(()=>{this.wtSettings.getSetting("onWindowResize")},200)}),o||this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement)}deregisterListeners(){this.eventManager.clearEvents(!0)}onTableScroll(e){const n=this.domBindings.rootWindow,i=this.inlineStartOverlay.mainTableScrollableElement,r=this.topOverlay.mainTableScrollableElement,s=e.target;this.keyPressed&&(r!==n&&s!==n&&!e.target.contains(r)||i!==n&&s!==n&&!e.target.contains(i))||this.syncScrollPositions(e)}onCloneWheel(e,n){const{rootWindow:i}=this.domBindings,r=this.inlineStartOverlay.mainTableScrollableElement,s=this.topOverlay.mainTableScrollableElement,o=e.target,a=s!==i&&o!==i&&!o.contains(s),l=r!==i&&o!==i&&!o.contains(r);if(this.keyPressed&&(a||l))return;const u=this.translateMouseWheelToScroll(e);(n||this.scrollableElement!==i&&u)&&e.preventDefault()}onKeyDown(e){this.keyPressed=xh(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,i=isNaN(e.deltaX)?-1*e.wheelDeltaX:e.deltaX;e.deltaMode===1&&(i+=i*this.browserLineHeight,n+=n*this.browserLineHeight);const r=this.scrollVertically(n),s=this.scrollHorizontally(i);return r||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{rootWindow:e}=this.domBindings,n=this.topOverlay.clone.wtTable.holder,i=this.inlineStartOverlay.clone.wtTable.holder,[r,s]=[this.scrollableElement.scrollLeft,this.scrollableElement.scrollTop];if(this.horizontalScrolling=n.scrollLeft!==r||this.lastScrollX!==e.scrollX,this.verticalScrolling=i.scrollTop!==s||this.lastScrollY!==e.scrollY,this.lastScrollX=e.scrollX,this.lastScrollY=e.scrollY,this.horizontalScrolling){n.scrollLeft=r;const o=this.bottomOverlay.needFullRender?this.bottomOverlay.clone.wtTable.holder:null;o&&(o.scrollLeft=r)}this.verticalScrolling&&(i.scrollTop=s),this.refreshAll()}syncScrollWithMaster(){if(!ku(bd,this))return;const e=this.topOverlay.mainTableScrollableElement,{scrollLeft:n,scrollTop:i}=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=i),Gp(bd,this,!1)}updateMainScrollableElements(){this.deregisterListeners(),this.inlineStartOverlay.updateMainScrollableElement(),this.topOverlay.updateMainScrollableElement(),this.bottomOverlay.needFullRender&&this.bottomOverlay.updateMainScrollableElement();const{wtTable:e}=this,{rootWindow:n}=this.domBindings;n.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.scrollableElement=e.holder:this.scrollableElement=dg(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,i=e.clientHeight,r=n!==this.spreaderLastSize.width||i!==this.spreaderLastSize.height;return r&&(this.spreaderLastSize.width=n,this.spreaderLastSize.height=i),r}adjustElementsSize(){const{wtViewport:e}=this.wot,{wtTable:n}=this,{rootWindow:i}=this.domBindings,r=this.scrollableElement===i,s=this.wtSettings.getSetting("totalColumns"),o=this.wtSettings.getSetting("totalRows"),a=e.getRowHeaderWidth(),u=e.getColumnHeaderHeight()+this.topOverlay.sumCellSizes(0,o)+1,c=a+this.inlineStartOverlay.sumCellSizes(0,s),d=n.hider.style,g=()=>r?!1:this.scrollableElement.scrollTop>Math.max(0,u-n.holder.clientHeight),p=()=>r?!1:this.scrollableElement.scrollLeft>Math.max(0,c-n.holder.clientWidth),C=g()?1:0,S=p()?1:0;if(d.width=`${c+S}px`,d.height=`${u+C}px`,this.scrollbarSize>0){const{scrollHeight:b,scrollWidth:R}=n.wtRootElement,{scrollHeight:E,scrollWidth:H}=n.holder;this.hasScrollbarRight=b<E,this.hasScrollbarBottom=R<H,this.hasScrollbarRight&&n.hider.scrollWidth+this.scrollbarSize>R?this.hasScrollbarBottom=!0:this.hasScrollbarBottom&&n.hider.scrollHeight+this.scrollbarSize>b&&(this.hasScrollbarRight=!0)}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 i=null;return M(n,r=>{r&&r.clone&&r.clone.wtTable.TABLE.contains(e)&&(i=r.clone)}),i}syncOverlayTableClassNames(){const e=this.wtTable.TABLE,n=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];M(n,i=>{i&&(i.clone.wtTable.TABLE.className=e.className)})}}function A0(t,e,n){return e=Hj(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hj(t){var e=Nj(t,"string");return typeof e=="symbol"?e:e+""}function Nj(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Dj{constructor(e){A0(this,"settings",{}),A0(this,"defaults",Object.freeze(this.getDefaults())),Ue(this.defaults,(n,i)=>{if(e[i]!==void 0)this.settings[i]=e[i];else{if(n===void 0)throw new Error(`A required setting "${i}" was not provided`);this.settings[i]=n}})}getDefaults(){return{facade:void 0,table:void 0,isDataViewInstance:!0,externalRowCalculator:!1,stretchH:"none",currentRowClassName:null,currentColumnClassName:null,preventOverflow(){return!1},preventWheel:!1,data:void 0,freezeOverlays:!1,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,i)=>{const r=this.getSetting("data",e,n);Ha(i,r??"")},columnWidth(){},rowHeight(){},defaultRowHeight:23,defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride: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,onBeforeStretchingColumnWidth:e=>e,onModifyRowHeaderWidth:null,onModifyGetCellCoords: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}}update(e,n){return n===void 0?Ue(e,(i,r)=>{this.settings[r]=i}):this.settings[e]=n,this}getSetting(e,n,i,r,s){return typeof this.settings[e]=="function"?this.settings[e](n,i,r,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 ZS extends mu{constructor(e,n,i,r){super(e,n,i,r,"master")}alignOverlaysWithTrimmingContainer(){const e=ru(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 i=e.parentElement,r=sh(e,"height",n),s=sh(e,"overflow",n),o=this.holder.style,{scrollWidth:a,scrollHeight:l}=e;let u=e.offsetWidth,c=e.offsetHeight;if(i&&["auto","hidden","scroll"].includes(s)){const d=e.cloneNode(!1);d.style.overflow="auto",d.style.position="absolute",e.nextElementSibling?i.insertBefore(d,e.nextElementSibling):i.appendChild(d);const g=parseInt(xo(d,n).height,10);i.removeChild(d),g===0&&(c=0)}c=Math.min(c,l),o.height=r==="auto"?"auto":`${c}px`,u=Math.min(u,a),o.width=`${u}px`,o.overflow="",this.hasTableHeight=o.height==="auto"?!0:c>0,this.hasTableWidth=u>0}this.isTableVisible=Na(this.TABLE)}markOversizedColumnHeaders(){const{wtSettings:e}=this,{wtViewport:n}=this.dataAccessObject,i="master",s=e.getSetting("columnHeaders").length;if(s&&!n.hasOversizedColumnHeadersMarked[i]){const a=e.getSetting("rowHeaders").length,l=this.getRenderedColumnsCount();for(let u=0;u<s;u++)for(let c=-1*a;c<l;c++)this.markIfOversizedColumnHeader(c);n.hasOversizedColumnHeadersMarked[i]=!0}}}bt(ZS,WS);bt(ZS,Sm);class Lj{constructor(e,n,i,r,s){this.dataAccessObject=e,this.wot=e.wot,this.instance=this.wot,this.domBindings=n,this.wtSettings=i,this.wtTable=s,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.hasOversizedColumnHeadersMarked={},this.clientHeight=0,this.containerWidth=NaN,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.eventManager=r,this.eventManager.addEventListener(this.domBindings.rootWindow,"resize",()=>{this.clientHeight=this.getWorkspaceHeight()})}getWorkspaceHeight(){const e=this.domBindings.rootDocument,n=this.dataAccessObject.topOverlayTrimmingContainer;let i=0;return n===this.domBindings.rootWindow?i=e.documentElement.clientHeight:i=Yt(n)>0&&n.clientHeight>0?n.clientHeight:1/0,i}getWorkspaceWidth(){const{wtSettings:e}=this,{rootDocument:n,rootWindow:i}=this.domBindings,r=this.dataAccessObject.inlineStartOverlayTrimmingContainer,s=n.documentElement.offsetWidth,o=e.getSetting("totalColumns"),a=e.getSetting("preventOverflow"),l=e.getSetting("rtlMode"),u=this.wtTable.TABLE.getBoundingClientRect(),c=l?u.right-s:u.left,h=s-c;let d,g;if(a)return Ct(this.wtTable.wtRootElement);if(e.getSetting("freezeOverlays")?d=Math.min(h,s):d=Math.min(this.getContainerFillWidth(),h,s),r===i&&o>0&&this.sumColumnWidths(0,o-1)>d)return n.documentElement.clientWidth;if(r!==i&&(g=sh(this.dataAccessObject.inlineStartOverlayTrimmingContainer,"overflow",i),g==="scroll"||g==="hidden"||g==="auto"))return Math.max(d,r.clientWidth);const p=e.getSetting("stretchH");return p==="none"||!p?Math.max(d,Ct(this.wtTable.TABLE)):d}hasVerticalScroll(){return this.wtTable.hider.offsetHeight>this.getWorkspaceHeight()}hasHorizontalScroll(){return this.wtTable.hider.offsetWidth>this.getWorkspaceWidth()}sumColumnWidths(e,n){let i=0,r=e;for(;r<n;)i+=this.wtTable.getColumnWidth(r),r+=1;return i}getContainerFillWidth(){if(this.containerWidth)return this.containerWidth;const e=this.wtTable.holder,n=this.domBindings.rootDocument.createElement("div");n.style.width="100%",n.style.height="1px",e.appendChild(n);const i=n.offsetWidth;return this.containerWidth=i,e.removeChild(n),i}getWorkspaceOffset(){return pn(this.wtTable.TABLE)}getColumnHeaderHeight(){return this.wtSettings.getSetting("columnHeaders").length?isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=Yt(this.wtTable.THEAD)):this.columnHeaderHeight=0,this.columnHeaderHeight}getViewportHeight(){let e=this.getWorkspaceHeight();if(e===1/0)return e;const n=this.getColumnHeaderHeight();return n>0&&(e-=n),e}getRowHeaderWidth(){const e=this.wtSettings.getSetting("rowHeaderWidth"),n=this.wtSettings.getSetting("rowHeaders");if(e){this.rowHeaderWidth=0;for(let i=0,r=n.length;i<r;i++)this.rowHeaderWidth+=e[i]||e}if(isNaN(this.rowHeaderWidth))if(n.length){let i=this.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(let r=0,s=n.length;r<s;r++)i?(this.rowHeaderWidth+=Ct(i),i=i.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0;return this.rowHeaderWidth=this.wtSettings.getSetting("onModifyRowHeaderWidth",this.rowHeaderWidth)||this.rowHeaderWidth,this.rowHeaderWidth}getViewportWidth(){const e=this.getWorkspaceWidth();if(e===1/0)return e;const n=this.getRowHeaderWidth();return n>0?e-n:e}createRowsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:co;const{wtSettings:n,wtTable:i}=this;if(n.getSetting("renderAllRows")&&e===co)return new v2({totalRows:n.getSetting("totalRows")});let r=this.getViewportHeight(),s,o;this.rowHeaderWidth=NaN;let a=this.dataAccessObject.topScrollPosition-this.dataAccessObject.topParentOffset;const l=n.getSetting("fixedRowsTop"),u=n.getSetting("fixedRowsBottom"),c=n.getSetting("totalRows");return l&&a>=0&&(o=this.dataAccessObject.topOverlay.sumCellSizes(0,l),a+=o,r-=o),u&&this.dataAccessObject.bottomOverlay.clone&&(o=this.dataAccessObject.bottomOverlay.sumCellSizes(c-u,c),r-=o),i.holder.clientHeight===i.holder.offsetHeight?s=0:s=wn(this.domBindings.rootDocument),new Cm({viewportHeight:r,scrollOffset:a,totalRows:n.getSetting("totalRows"),rowHeightFn:h=>i.getRowHeight(h),overrideFn:n.getSettingPure("viewportRowCalculatorOverride"),calculationType:e,horizontalScrollbarHeight:s})}createColumnsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:co;const{wtSettings:n,wtTable:i}=this;if(n.getSetting("renderAllColumns")&&e===co)return new p2({totalColumns:n.getSetting("totalColumns")});let r=this.getViewportWidth(),s=Math.abs(this.dataAccessObject.inlineStartScrollPosition)-this.dataAccessObject.inlineStartParentOffset;this.columnHeaderHeight=NaN;const o=n.getSetting("fixedColumnsStart");if(o&&s>=0){const a=this.dataAccessObject.inlineStartOverlay.sumCellSizes(0,o);s+=a,r-=a}return i.holder.clientWidth!==i.holder.offsetWidth&&(r-=wn(this.domBindings.rootDocument)),new Ah({viewportWidth:r,scrollOffset:s,totalColumns:n.getSetting("totalColumns"),columnWidthFn:a=>i.getColumnWidth(a),overrideFn:n.getSettingPure("viewportColumnCalculatorOverride"),calculationType:e,inlineStartOffset:this.dataAccessObject.inlineStartParentOffset})}createRenderCalculators(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:n}=this;if(e&&!n.getSetting("renderAllRows")){const i=this.createRowsCalculator(In);e=this.areAllProposedVisibleRowsAlreadyRendered(i)}if(e&&!n.getSetting("renderAllColumns")){const i=this.createColumnsCalculator(In);e=this.areAllProposedVisibleColumnsAlreadyRendered(i)}return e||(this.rowsRenderCalculator=this.createRowsCalculator(co),this.columnsRenderCalculator=this.createColumnsCalculator(co)),this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,e}createVisibleCalculators(){this.rowsVisibleCalculator=this.createRowsCalculator(In),this.columnsVisibleCalculator=this.createColumnsCalculator(In)}createPartiallyVisibleCalculators(){this.rowsPartiallyVisibleCalculator=this.createRowsCalculator(f0),this.columnsPartiallyVisibleCalculator=this.createColumnsCalculator(f0)}areAllProposedVisibleRowsAlreadyRendered(e){if(!this.rowsVisibleCalculator)return!1;let{startRow:n,endRow:i}=e;if(n===null&&i===null){if(!e.isVisibleInTrimmingContainer)return!0;n=this.rowsPartiallyVisibleCalculator.startRow,i=this.rowsPartiallyVisibleCalculator.endRow}const{startRow:r,endRow:s}=this.rowsRenderCalculator;return n<r||n===r&&n>0?!1:!(i>s||i===s&&i<this.wtSettings.getSetting("totalRows")-1)}areAllProposedVisibleColumnsAlreadyRendered(e){if(!this.columnsVisibleCalculator)return!1;let{startColumn:n,endColumn:i}=e;if(n===null&&i===null){if(!e.isVisibleInTrimmingContainer)return!0;n=this.columnsPartiallyVisibleCalculator.startColumn,i=this.columnsPartiallyVisibleCalculator.endColumn}const{startColumn:r,endColumn:s}=this.columnsRenderCalculator;return n<r||n===r&&n>0?!1:!(i>s||i===s&&i<this.wtSettings.getSetting("totalColumns")-1)}resetHasOversizedColumnHeadersMarked(){Ue(this.hasOversizedColumnHeadersMarked,(e,n,i)=>{i[n]=void 0})}}class $j extends FS{constructor(e,n){super(e,new Dj(n));const i=this.wtSettings.getSetting("facade",this);this.wtTable=new ZS(this.getTableDao(),i,this.domBindings,this.wtSettings),this.wtViewport=new Lj(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new Cj(this.wtSettings.getSetting("selections")),this.wtEvent=new FP(i,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new Aj(this,i,this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.exportSettingsAsClassNames(),this.findOriginalHeaders()}exportSettingsAsClassNames(){const e={rowHeaders:"htRowHeaders",columnHeaders:"htColumnHeaders"},n=[],i=[];Ue(e,(r,s)=>{this.wtSettings.getSetting(s).length&&i.push(r),n.push(r)}),He(this.wtTable.wtRootElement.parentNode,n),q(this.wtTable.wtRootElement.parentNode,i)}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 QS{constructor(e){e instanceof FS?this._wot=e:this._initFromSettings(e)}_initFromSettings(e){e.facade=n=>{const i=new QS(n);return()=>i},this._wot=new $j(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 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,i){return this._wot.createCellRange(e,n,i)}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,i,r,s){return this._wot.scrollViewport(e,n,i,r,s)}scrollViewportHorizontally(e,n,i){return this._wot.scrollViewportHorizontally(e,n,i)}scrollViewportVertically(e,n,i){return this._wot.scrollViewportVertically(e,n,i)}getViewport(){return this._wot.getViewport()}getOverlayName(){return this._wot.cloneOverlay?this._wot.cloneOverlay.type:"master"}exportSettingsAsClassNames(){return this._wot.exportSettingsAsClassNames()}update(e,n){return this._wot.wtSettings.update(e,n),this}getSetting(e,n,i,r,s){return this._wot.wtSettings.getSetting(e,n,i,r,s)}hasSetting(e){return this._wot.wtSettings.hasSetting(e)}destroy(){this._wot.destroy()}}function H0(t){let{isShiftKey:e,isLeftClick:n,isRightClick:i,coords:r,selection:s,controller:o,cellCoordsFactory:a}=t;const l=s.isSelected()?s.getSelectedRange().current():null,u=s.isSelectedByCorner(),c=s.isSelectedByRowHeader();if(s.markSource("mouse"),e&&l)r.row>=0&&r.col>=0&&!o.cell?s.setRangeEnd(r):(u||c)&&r.row>=0&&r.col>=0&&!o.cell?s.setRangeEnd(a(r.row,r.col)):u&&r.row<0&&!o.column?s.setRangeEnd(a(l.to.row,r.col)):c&&r.col<0&&!o.row?s.setRangeEnd(a(r.row,l.to.col)):(!u&&!c&&r.col<0||u&&r.col<0)&&!o.row?s.selectRows(Math.max(l.from.row,0),r.row,r.col):(!u&&!c&&r.row<0||c&&r.row<0)&&!o.column&&s.selectColumns(Math.max(l.from.col,0),r.col,r.row);else{const h=!s.inInSelection(r),d=n||i&&h;r.row<0&&r.col>=0&&!o.column?d&&s.selectColumns(r.col,r.col,r.row):r.col<0&&r.row>=0&&!o.row?d&&s.selectRows(r.row,r.row,r.col):r.col>=0&&r.row>=0&&!o.cell?d&&s.setRangeStart(r):r.col<0&&r.row<0&&s.selectAll(!0,!0,{disableHeadersHighlight:!0,focusPosition:{row:0,col:0}})}s.markEndSource()}function kj(t){let{isLeftClick:e,coords:n,selection:i,controller:r,cellCoordsFactory:s}=t;if(!e)return;const o=i.isSelectedByRowHeader(),a=i.isSelectedByColumnHeader(),l=i.tableProps.countCols(),u=i.tableProps.countRows();i.markSource("mouse"),a&&!r.column?i.setRangeEnd(s(u-1,n.col)):o&&!r.row?i.setRangeEnd(s(n.row,l-1)):r.cell||i.setRangeEnd(n),i.markEndSource()}const Fj=new Map([["mousedown",H0],["mouseover",kj],["touchstart",H0]]);function N0(t,e){let{coords:n,selection:i,controller:r,cellCoordsFactory:s}=e;Fj.get(t.type)({coords:n,selection:i,controller:r,cellCoordsFactory:s,isShiftKey:t.shiftKey,isLeftClick:IS(t)||t.type==="touchstart",isRightClick:Da(t)})}const KP=new WeakMap,JS=Symbol("rootInstance");function Vj(t){KP.set(t,!0)}function Wj(t){return t===JS}function Ff(t){return KP.has(t)}function Bj(t,e){XP(t,e),e.add(t)}function Ko(t,e,n){XP(t,e),e.set(t,n)}function XP(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qs(t,e,n){return e=Uj(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Uj(t){var e=Yj(t,"string");return typeof e=="symbol"?e:e+""}function Yj(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dn(t,e){return t.get(ah(t,e))}function Ei(t,e,n){return t.set(ah(t,e),n),n}function ah(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 jp=new WeakMap,Rd=new WeakMap,Ed=new WeakMap,fs=new WeakMap,Ki=new WeakMap,Kp=new WeakMap,Xp=new WeakMap,Vf=new WeakSet;class zj{constructor(e){Bj(this,Vf),qs(this,"hot",void 0),qs(this,"eventManager",void 0),qs(this,"settings",void 0),qs(this,"THEAD",void 0),qs(this,"TBODY",void 0),qs(this,"_wt",void 0),qs(this,"activeWt",void 0),Ko(this,jp,0),Ko(this,Rd,0),qs(this,"postponedAdjustElementsSize",!1),Ko(this,Ed,!1),Ko(this,fs,void 0),Ko(this,Ki,void 0),Ko(this,Kp,0),Ko(this,Xp,0),this.hot=e,this.eventManager=new wr(this.hot),this.settings=this.hot.getSettings(),this.createElements(),this.registerEvents(),this.initializeWalkontable()}render(){this.hot.isRenderSuspended()||(this.hot.runHooks("beforeRender",this.hot.forceFullRender),this.postponedAdjustElementsSize&&(this.postponedAdjustElementsSize=!1,this.adjustElementsSize(!0)),this._wt.draw(!this.hot.forceFullRender),this.hot.runHooks("afterRender",this.hot.forceFullRender),this.hot.forceFullRender=!1,this.hot.renderCall=!1)}adjustElementsSize(){this.hot.isRenderSuspended()?this.postponedAdjustElementsSize=!0:this._wt.wtOverlays.adjustElementsSize()}getCellAtCoords(e,n){const i=this._wt.getCell(e,n);return i<0?null:i}scrollViewport(e,n,i,r,s){return this._wt.scrollViewport(e,n,i,r,s)}scrollViewportHorizontally(e,n,i){return this._wt.scrollViewportHorizontally(e,n,i)}scrollViewportVertically(e,n,i){return this._wt.scrollViewportVertically(e,n,i)}createElements(){const{rootElement:e,rootDocument:n}=this.hot,i=e.getAttribute("style");i&&e.setAttribute("data-originalstyle",i),q(e,"handsontable"),Ei(Ki,this,n.createElement("TABLE")),q(dn(Ki,this),"htCore"),this.hot.getSettings().tableClassName&&q(dn(Ki,this),this.hot.getSettings().tableClassName),this.settings.ariaTags&&(Ee(dn(Ki,this),[qr()]),Ee(e,[CU(),qI(-1),fm(this.hot.countCols()),xU()])),this.THEAD=n.createElement("THEAD"),dn(Ki,this).appendChild(this.THEAD),this.TBODY=n.createElement("TBODY"),dn(Ki,this).appendChild(this.TBODY),this.hot.table=dn(Ki,this),this.hot.container.insertBefore(dn(Ki,this),this.hot.container.firstChild)}registerEvents(){const{rootElement:e,rootDocument:n,selection:i,rootWindow:r}=this.hot,s=n.documentElement;this.eventManager.addEventListener(e,"mousedown",a=>{Ei(Ed,this,!0),this.isTextSelectionAllowed(a.target)||(VE(r),a.preventDefault(),r.focus())}),this.eventManager.addEventListener(e,"mouseup",()=>{Ei(Ed,this,!1)}),this.eventManager.addEventListener(e,"mousemove",a=>{dn(Ed,this)&&!this.isTextSelectionAllowed(a.target)&&(this.settings.fragmentSelection&&VE(r),a.preventDefault())}),this.eventManager.addEventListener(s,"keyup",a=>{i.isInProgress()&&!a.shiftKey&&i.finish()}),this.eventManager.addEventListener(s,"mouseup",a=>{i.isInProgress()&&IS(a)&&i.finish(),Ei(fs,this,!1);const l=sP(n.activeElement);$f(n.activeElement)&&!l||(l||!i.isSelected()&&!i.isSelectedByAnyHeader()&&!e.contains(a.target)&&!Da(a))&&this.hot.unlisten()}),this.eventManager.addEventListener(s,"contextmenu",a=>{i.isInProgress()&&Da(a)&&(i.finish(),Ei(fs,this,!1))}),this.eventManager.addEventListener(s,"touchend",()=>{i.isInProgress()&&i.finish(),Ei(fs,this,!1)}),this.eventManager.addEventListener(s,"mousedown",a=>{const l=a.target,u=a.x||a.clientX,c=a.y||a.clientY;let h=a.target;if(dn(fs,this)||!e||!this.hot.view)return;const{holder:d}=this.hot.view._wt.wtTable;if(h===d){const p=wn(n);if(n.elementFromPoint(u+p,c)!==d||n.elementFromPoint(u,c+p)!==d)return}else for(;h!==s;){if(h===null){if(a.isTargetWebComponent)break;return}if(h===e)return;h=h.parentNode}(typeof this.settings.outsideClickDeselects=="function"?this.settings.outsideClickDeselects(l):this.settings.outsideClickDeselects)?this.hot.deselectCell():this.hot.destroyEditor(!1,!1)});let o=iu(r);for(;o!==null;)this.eventManager.addEventListener(o.document.documentElement,"click",()=>{this.hot.unlisten()}),o=iu(o);this.eventManager.addEventListener(dn(Ki,this),"selectstart",a=>{this.settings.fragmentSelection||$f(a.target)||a.preventDefault()})}translateFromRenderableToVisualCoords(e){let{row:n,col:i}=e;return this.hot._createCellCoords(...this.translateFromRenderableToVisualIndex(n,i))}translateFromRenderableToVisualIndex(e,n){let i=e>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(e):e,r=n>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(n):n;return i===null&&(i=e),r===null&&(r=n),[i,r]}countRenderableIndexes(e,n){const i=Math.min(e.getNotTrimmedIndexesLength(),n),r=e.getNearestNotHiddenIndex(i-1,-1);return r===null?0:e.getRenderableFromVisualIndex(r)+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,i,r){if(isNaN(e)||e<0)return 0;const s=i.getNearestNotHiddenIndex(e,n),o=i.getRenderableFromVisualIndex(s);if(!Number.isInteger(o))return 0;let a=0;return n<0?a=o+1:n>0&&(a=r-o),a}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 i=0;for(let r=e;r<=n;r++)this.hot.columnIndexMapper.getRenderableFromVisualIndex(r)!==null&&(i+=1);return i}countRenderableRowsInRange(e,n){let i=0;for(let r=e;r<=n;r++)this.hot.rowIndexMapper.getRenderableFromVisualIndex(r)!==null&&(i+=1);return i}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:dn(Ki,this),isDataViewInstance:()=>Ff(this.hot),preventOverflow:()=>this.settings.preventOverflow,preventWheel:()=>this.settings.preventWheel,stretchH:()=>this.settings.stretchH,data:(s,o)=>this.hot.getDataAtCell(...this.translateFromRenderableToVisualIndex(s,o)),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((o,a)=>{const l=o>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(o):o;this.appendRowHeader(l,a)}),this.hot.runHooks("afterGetRowHeaderRenderers",s),Ei(Rd,this,s.length),this.hot.getSettings().ariaTags&&ah(Vf,this,qP).call(this)===this.hot.countCols()&&ah(Vf,this,Gj).call(this,dn(Rd,this)),s},columnHeaders:()=>{const s=[];return this.hot.hasColHeaders()&&s.push((o,a)=>{const l=o>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(o):o;this.appendColHeader(l,a)}),this.hot.runHooks("afterGetColumnHeaderRenderers",s),Ei(jp,this,s.length),s},columnWidth:s=>{const o=this.hot.columnIndexMapper.getVisualFromRenderableIndex(s);return this.hot.getColWidth(o===null?s:o)},rowHeight:s=>{const o=this.hot.rowIndexMapper.getVisualFromRenderableIndex(s);return this.hot.getRowHeight(o===null?s:o)},cellRenderer:(s,o,a)=>{const[l,u]=this.translateFromRenderableToVisualIndex(s,o),c=this.hot.runHooks("modifyGetCellCoords",l,u);let h=l,d=u;Array.isArray(c)&&([h,d]=c);const g=this.hot.getCellMeta(h,d),p=this.hot.colToProp(d);let C=this.hot.getDataAtRowProp(h,p);this.hot.hasHook("beforeValueRender")&&(C=this.hot.runHooks("beforeValueRender",C,g)),this.hot.runHooks("beforeRenderer",a,l,u,p,C,g),this.hot.getCellRenderer(g)(this.hot,a,l,u,p,C,g),this.hot.runHooks("afterRenderer",a,l,u,p,C,g)},selections:this.hot.selection.highlight,hideBorderOnMouseDownOver:()=>this.settings.fragmentSelection,onWindowResize:()=>{this.hot&&!this.hot.isDestroyed&&this.hot.refreshDimensions()},onContainerElementResize:()=>{this.hot&&!this.hot.isDestroyed&&Na(this.hot.rootElement)&&this.hot.refreshDimensions()},onCellMouseDown:(s,o,a,l)=>{const u=this.translateFromRenderableToVisualCoords(o),c={row:!1,column:!1,cell:!1};this.hot.listen(),this.activeWt=l,Ei(fs,this,!0),this.hot.runHooks("beforeOnCellMouseDown",s,u,a,c),!Ra(s)&&(N0(s,{coords:u,selection:this.hot.selection,controller:c,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseDown",s,u,a),this.activeWt=this._wt)},onCellContextMenu:(s,o,a,l)=>{const u=this.translateFromRenderableToVisualCoords(o);this.activeWt=l,Ei(fs,this,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",s,u,a),!Ra(s)&&(this.hot.runHooks("afterOnCellContextMenu",s,u,a),this.activeWt=this._wt)},onCellMouseOut:(s,o,a,l)=>{const u=this.translateFromRenderableToVisualCoords(o);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOut",s,u,a),!Ra(s)&&(this.hot.runHooks("afterOnCellMouseOut",s,u,a),this.activeWt=this._wt)},onCellMouseOver:(s,o,a,l)=>{const u=this.translateFromRenderableToVisualCoords(o),c={row:!1,column:!1,cell:!1};this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOver",s,u,a,c),!Ra(s)&&(dn(fs,this)&&N0(s,{coords:u,selection:this.hot.selection,controller:c,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseOver",s,u,a),this.activeWt=this._wt)},onCellMouseUp:(s,o,a,l)=>{const u=this.translateFromRenderableToVisualCoords(o);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseUp",s,u,a),!(Ra(s)||this.hot.isDestroyed)&&(this.hot.runHooks("afterOnCellMouseUp",s,u,a),this.activeWt=this._wt)},onCellCornerMouseDown:s=>{s.preventDefault(),this.hot.runHooks("afterOnCellCornerMouseDown",s)},onCellCornerDblClick:s=>{s.preventDefault(),this.hot.runHooks("afterOnCellCornerDblClick",s)},beforeDraw:(s,o)=>this.beforeRender(s,o),onDraw:s=>this.afterRender(s),onBeforeViewportScrollVertically:s=>{const o=this.hot.rowIndexMapper,a=s<0;let l=s;return!a&&(l=o.getVisualFromRenderableIndex(s),l===null)?s:(l=this.hot.runHooks("beforeViewportScrollVertically",l),this.hot.runHooks("beforeViewportScroll"),a?l:o.getRenderableFromVisualIndex(l))},onBeforeViewportScrollHorizontally:s=>{const o=this.hot.columnIndexMapper,a=s<0;let l=s;return!a&&(l=o.getVisualFromRenderableIndex(s),l===null)?s:(l=this.hot.runHooks("beforeViewportScrollHorizontally",l),this.hot.runHooks("beforeViewportScroll"),a?l:o.getRenderableFromVisualIndex(l))},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,o,a)=>{const l=this.hot.rowIndexMapper,u=s<0;let c=s;u||(c=l.getVisualFromRenderableIndex(s));const h=this.hot.runHooks("beforeHighlightingRowHeader",c,o,a);return u?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onBeforeHighlightingColumnHeader:(s,o,a)=>{const l=this.hot.columnIndexMapper,u=s<0;let c=s;u||(c=l.getVisualFromRenderableIndex(s));const h=this.hot.runHooks("beforeHighlightingColumnHeader",c,o,a);return u?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onAfterDrawSelection:(s,o,a)=>{let l;const[u,c]=this.translateFromRenderableToVisualIndex(s,o),h=this.hot.selection.getSelectedRange();if(h.size()>0){const g=h.peekByIndex(a??0);l=[g.from.row,g.from.col,g.to.row,g.to.col]}return this.hot.runHooks("afterDrawSelection",u,c,l,a)},onBeforeDrawBorders:(s,o)=>{const[a,l,u,c]=s,h=[this.hot.rowIndexMapper.getVisualFromRenderableIndex(a),this.hot.columnIndexMapper.getVisualFromRenderableIndex(l),this.hot.rowIndexMapper.getVisualFromRenderableIndex(u),this.hot.columnIndexMapper.getVisualFromRenderableIndex(c)];return this.hot.runHooks("beforeDrawBorders",h,o)},onBeforeTouchScroll:()=>this.hot.runHooks("beforeTouchScroll"),onAfterMomentumScroll:()=>this.hot.runHooks("afterMomentumScroll"),onBeforeStretchingColumnWidth:(s,o)=>{const a=this.hot.columnIndexMapper.getVisualFromRenderableIndex(o);return this.hot.runHooks("beforeStretchingColumnWidth",s,a)},onModifyRowHeaderWidth:s=>this.hot.runHooks("modifyRowHeaderWidth",s),onModifyGetCellCoords:(s,o,a)=>{const l=this.hot.rowIndexMapper,u=this.hot.columnIndexMapper,c=o>=0?u.getVisualFromRenderableIndex(o):o,h=s>=0?l.getVisualFromRenderableIndex(s):s,d=this.hot.runHooks("modifyGetCellCoords",h,c,a);if(Array.isArray(d)){const[g,p,C,S]=d;return[g>=0?l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(g,1)):g,p>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(p,1)):p,C>=0?l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(C,-1)):C,S>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(S,-1)):S]}},viewportRowCalculatorOverride:s=>{let o=this.settings.viewportRowRenderingOffset;if(o==="auto"&&this.settings.fixedRowsTop&&(o=10),o>0||o==="auto"){const a=this.countRenderableRows(),l=s.startRow,u=s.endRow;if(typeof o=="number")s.startRow=Math.max(l-o,0),s.endRow=Math.min(u+o,a-1);else if(o==="auto"){const c=Math.ceil(u/a*12);s.startRow=Math.max(l-c,0),s.endRow=Math.min(u+c,a-1)}}this.hot.runHooks("afterViewportRowCalculatorOverride",s)},viewportColumnCalculatorOverride:s=>{let o=this.settings.viewportColumnRenderingOffset;if(o==="auto"&&this.settings.fixedColumnsStart&&(o=10),o>0||o==="auto"){const a=this.countRenderableColumns(),l=s.startColumn,u=s.endColumn;if(typeof o=="number"&&(s.startColumn=Math.max(l-o,0),s.endColumn=Math.min(u+o,a-1)),o==="auto"){const c=Math.ceil(u/a*6);s.startColumn=Math.max(l-c,0),s.endColumn=Math.min(u+c,a-1)}}this.hot.runHooks("afterViewportColumnCalculatorOverride",s)},rowHeaderWidth:()=>this.settings.rowHeaderWidth,columnHeaderHeight:()=>{const s=this.hot.runHooks("modifyColumnHeaderHeight");return this.settings.columnHeaderHeight||s}};this.hot.runHooks("beforeInitWalkontable",e),this._wt=new QS(e),this.activeWt=this._wt;const n=this._wt.wtTable.spreader,{width:i,height:r}=this.hot.rootElement.getBoundingClientRect();this.setLastSize(i,r),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.forceFullRender=!0,this.render())})}isTextSelectionAllowed(e){if($f(e))return!0;const n=xa(e,this.hot.view._wt.wtTable.spreader);return!!(this.settings.fragmentSelection===!0&&n||this.settings.fragmentSelection==="cell"&&this.isSelectedOnlyCell()&&n||!this.settings.fragmentSelection&&this.isCellEdited()&&this.isSelectedOnlyCell())}isMouseDown(){return dn(fs,this)}isSelectedOnlyCell(){var e,n;return(e=(n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingleCell())!==null&&e!==void 0?e:!1}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 i=n.firstChild;if(!_e(i,"relative")){es(n),this.appendRowHeader(e,n);return}this.updateCellHeader(i.querySelector(".rowHeader"),e,this.hot.getRowHeader)}else{const{rootDocument:i,getRowHeader:r}=this.hot,s=i.createElement("div"),o=i.createElement("span");s.className="relative",o.className="rowHeader",this.updateCellHeader(o,e,r),s.appendChild(o),n.appendChild(s)}this.hot.runHooks("afterGetRowHeader",e,n)}appendColHeader(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hot.getColHeader,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(n.firstChild){const s=n.firstChild;_e(s,"relative")?this.updateCellHeader(s.querySelector(".colHeader"),e,i,r):(es(n),this.appendColHeader(e,n,i,r))}else{const{rootDocument:s}=this.hot,o=s.createElement("div"),a=s.createElement("span");o.className="relative",a.className="colHeader",this.settings.ariaTags&&(Ee(o,...qr()),Ee(a,...qr())),this.updateCellHeader(a,e,i,r),o.appendChild(a),n.appendChild(o)}this.hot.runHooks("afterGetColHeader",e,n,r)}updateCellHeader(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=n;const o=this._wt.wtOverlays.getParentOverlay(e)||this._wt;e.parentNode&&(_e(e,"colHeader")?s=o.wtTable.columnFilter.sourceToRendered(n):_e(e,"rowHeader")&&(s=o.wtTable.rowFilter.sourceToRendered(n))),s>-1?gu(e,i(n,r)):(Ha(e," "),q(e,"cornerHeader"))}maximumVisibleElementWidth(e){const i=this._wt.wtViewport.getWorkspaceWidth()-e;return i>0?i:0}maximumVisibleElementHeight(e){const i=this._wt.wtViewport.getWorkspaceHeight()-e;return i>0?i:0}setLastSize(e,n){Ei(Kp,this,e),Ei(Xp,this,n)}getLastSize(){return{width:dn(Kp,this),height:dn(Xp,this)}}getFirstFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstVisibleRow())}getLastFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastVisibleRow())}getFirstFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstVisibleColumn())}getLastFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastVisibleColumn())}getFirstPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstPartiallyVisibleRow())}getLastPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastPartiallyVisibleRow())}getFirstPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstPartiallyVisibleColumn())}getLastPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastPartiallyVisibleColumn())}getColumnHeadersCount(){return dn(jp,this)}getRowHeadersCount(){return dn(Rd,this)}getViewportWidth(){return this.hot.view._wt.wtViewport.getViewportWidth()}getWorkspaceWidth(){return this.hot.view._wt.wtViewport.getWorkspaceWidth()}getViewportHeight(){return this.hot.view._wt.wtViewport.getViewportHeight()}getWorkspaceHeight(){return this.hot.view._wt.wtViewport.getWorkspaceHeight()}destroy(){this._wt.destroy(),this.eventManager.destroy()}}function qP(){return parseInt(this.hot.rootElement.getAttribute(fm()[0]),10)}function Gj(t){const e=ah(Vf,this,qP).call(this)+t;Ee(this.hot.rootElement,...fm(e))}const jj="ABCDEFGHIJKLMNOPQRSTUVWXYZ",D0=jj.length;function Kj(t){let e=t+1,n="",i;for(;e>0;)i=(e-1)%D0,n=String.fromCharCode(65+i)+n,e=parseInt((e-i)/D0,10);return n}function ZP(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=t;const i=[];return(!Array.isArray(t)||!Array.isArray(t[0]))&&(n=[t]),n.forEach((r,s)=>{Array.isArray(r)?r.forEach((o,a)=>{i.push([s+e,a,o])}):Object.keys(r).forEach(o=>{i.push([s+e,o,r[o]])})}),i}function QP(t){let e=0;return Array.isArray(t)&&(t[0]&&Array.isArray(t[0])?e=t[0].length:t[0]&&ke(t[0])&&(e=MS(t[0]))),e}function Xj(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>Array.isArray(e)))}function qj(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object"&&!Array.isArray(e)&&e!==null))}function Fu(t,e,n){return e=Zj(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zj(t){var e=Qj(t,"string");return typeof e=="symbol"?e:e+""}function Qj(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Jj{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];Fu(this,"hot",void 0),Fu(this,"data",void 0),Fu(this,"dataType","array"),Fu(this,"colToProp",()=>{}),Fu(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 M(this.data,(i,r)=>{const s=this.getAtCell(r,e);n.push(s)}),n}getAtRow(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const s=n===void 0&&i===void 0,{dataDotNotation:o}=this.hot.getSettings();let a=null,l=null;if(a=this.modifyRowData(e),Array.isArray(a))l=[],s?a.forEach((u,c)=>{l[c]=this.getAtPhysicalCell(e,c,a)}):me(n,i,u=>{l[u-n]=this.getAtPhysicalCell(e,u,a)});else if(ke(a)||Et(a))if(r?l=[]:l={},!s||r){const c=this.countFirstRowKeys()-1;me(0,c,h=>{const d=this.colToProp(h);if(h>=(n||0)&&h<=(i||c)&&!Number.isInteger(d)){const g=this.getAtPhysicalCell(e,d,a);r?l.push(g):o?Mp(l,d,g):l[d]=g}})}else Ue(a,(u,c)=>{const h=this.getAtPhysicalCell(e,c,a);o?Mp(l,c,h):l[c]=h});return l}setAtCell(e,n,i){if(!(e>=this.countRows()||n>=this.countFirstRowKeys())){if(this.hot.hasHook("modifySourceData")){const r=cr(i);this.hot.runHooks("modifySourceData",e,n,r,"set"),r.isTouched()&&(i=r.value)}Number.isInteger(n)?this.data[e][n]=i:Mp(this.data[e],n,i)}}getAtPhysicalCell(e,n,i){let r=null;if(i)if(typeof n=="string"){const{dataDotNotation:s}=this.hot.getSettings();r=s?pY(i,n):i[n]}else typeof n=="function"?r=n(i):r=i[n];if(this.hot.hasHook("modifySourceData")){const s=cr(r);this.hot.runHooks("modifySourceData",e,n,s,"get"),s.isTouched()&&(r=s.value)}return r}getAtCell(e,n){const i=this.modifyRowData(e);return this.getAtPhysicalCell(e,this.colToProp(n),i)}getByRange(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=!1,s=null,o=null,a=null,l=null;e===null||n===null?(r=!0,s=0,a=this.countRows()-1):(s=Math.min(e.row,n.row),o=Math.min(e.col,n.col),a=Math.max(e.row,n.row),l=Math.max(e.col,n.col));const u=[];return me(s,a,c=>{u.push(r?this.getAtRow(c,void 0,void 0,i):this.getAtRow(c,o,l,i))}),u}countRows(){if(this.hot.hasHook("modifySourceLength")){const e=this.hot.runHooks("modifySourceLength");if(Number.isInteger(e))return e}return this.data.length}countFirstRowKeys(){return QP(this.data)}destroy(){this.data=null,this.hot=null}}function L0(t,e,n){return e=eK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eK(t){var e=tK(t,"string");return typeof e=="symbol"?e:e+""}function tK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Xa{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;L0(this,"indexedValues",[]),L0(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,Et(this.initValueOrFn)?me(e-1,n=>this.indexedValues.push(this.initValueOrFn(n))):me(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}}bt(Xa,zn);function ey(t,e,n,i){const r=n.length?n[0]:void 0;return[...t.slice(0,r),...n.map((s,o)=>Et(i)?i(s,o):i),...r===void 0?[]:t.slice(r)]}function ty(t,e){return gr(t,(n,i)=>e.includes(i)===!1)}class $o extends Xa{insert(e,n){this.indexedValues=ey(this.indexedValues,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){this.indexedValues=ty(this.indexedValues,e),super.remove(e)}}class ym extends $o{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getHiddenIndexes(){return Hn(this.getValues(),(e,n,i)=>(n&&e.push(i),e),[])}}function ny(t,e,n){return[...t.slice(0,e),...n,...t.slice(e)]}function lh(t,e){return gr(t,n=>e.includes(n)===!1)}function iy(t,e){return Ke(t,n=>n-e.filter(i=>i<n).length)}function ry(t,e){const n=e[0],i=e.length;return Ke(t,r=>r>=n?r+i:r)}function nK(t,e,n){return e=iK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iK(t){var e=rK(t,"string");return typeof e=="symbol"?e:e+""}function rK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bm extends Xa{constructor(){super(...arguments),nK(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 i=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(i,0,e),this.runLocalHooks("change"),!0):!1}clearValue(e){this.orderOfIndexes=lh(this.orderOfIndexes,[e]),Et(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=ey(this.indexedValues,e,n,this.initValueOrFn),this.orderOfIndexes=ry(this.orderOfIndexes,n),super.insert(e,n)}remove(e){this.indexedValues=ty(this.indexedValues,e),this.orderOfIndexes=lh(this.orderOfIndexes,e),this.orderOfIndexes=iy(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map(e=>[e,this.getValueAtIndex(e)])}}class Lh extends $o{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getTrimmedIndexes(){return Hn(this.getValues(),(e,n,i)=>(n&&e.push(i),e),[])}}const $0=new Map([["indexesSequence",{getListWithInsertedItems:ny,getListWithRemovedItems:lh}],["physicallyIndexed",{getListWithInsertedItems:ey,getListWithRemovedItems:ty}]]),JP=t=>{if($0.has(t)===!1)throw new Error(`Alter strategy with ID '${t}' does not exist.`);return $0.get(t)};class eO extends Xa{constructor(){super(e=>e)}insert(e,n){const i=ry(this.indexedValues,n);this.indexedValues=ny(i,e,n),super.insert(e,n)}remove(e){const n=lh(this.indexedValues,e);this.indexedValues=iy(n,e),super.remove(e)}}const k0=new Map([["hiding",ym],["index",Xa],["linkedPhysicalIndexToValue",bm],["physicalIndexToValue",$o],["trimming",Lh]]);function sK(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!k0.has(t))throw new Error(`The provided map type ("${t}") does not exist.`);return new(k0.get(t))(e)}function oK(t,e,n){return e=aK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aK(t){var e=lK(t,"string");return typeof e=="symbol"?e:e+""}function lK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sy{constructor(){oK(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);de(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 Mt(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(i=>{i.insert(e,n)})}initEvery(e){this.collection.forEach(n=>{n.init(e)})}}bt(sy,zn);function qp(t,e,n){return e=uK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uK(t){var e=cK(t,"string");return typeof e=="symbol"?e:e+""}function cK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class F0 extends sy{constructor(e,n){super(),qp(this,"mergedValuesCache",[]),qp(this,"aggregationFunction",void 0),qp(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=Ke(this.get(),s=>s.getValues()),i=[],r=de(n[0])&&n[0].length||0;for(let s=0;s<r;s+=1){const o=[];for(let a=0;a<this.getLength();a+=1)o.push(n[a][s]);i.push(o)}return Ke(i,this.aggregationFunction)}getMergedValueAtIndex(e,n){const i=this.getMergedValues(n)[e];return de(i)?i:this.fallbackValue}updateCache(){this.mergedValuesCache=this.getMergedValues(!1)}}function hK(t,e,n){dK(t,e),e.set(t,n)}function dK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fK(t,e,n){return t.set(tO(t,e),n),n}function gK(t,e){return t.get(tO(t,e))}function tO(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 Zp=new WeakMap;class nO{constructor(){hK(this,Zp,[])}subscribe(e){return this.addLocalHook("change",e),this._write(gK(Zp,this)),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){fK(Zp,this,e)}}bt(nO,zn);function V0(t,e){const n=[];let i=0,r=0;for(;i<t.length&&r<e.length;i++,r++)t[i]!==e[r]&&n.push({op:"replace",index:r,oldValue:t[i],newValue:e[r]});for(;i<e.length;i++)n.push({op:"insert",index:i,oldValue:void 0,newValue:e[i]});for(;r<t.length;r++)n.push({op:"remove",index:r,oldValue:t[r],newValue:void 0});return n}function Vu(t,e,n){mK(t,e),e.set(t,n)}function mK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ti(t,e){return t.get(iO(t,e))}function Td(t,e,n){return t.set(iO(t,e),n),n}function iO(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 Md=new WeakMap,Wu=new WeakMap,_d=new WeakMap,Id=new WeakMap,Pd=new WeakMap;class pK{constructor(){let{initialIndexValue:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vu(this,Md,new Set),Vu(this,Wu,[]),Vu(this,_d,[]),Vu(this,Id,!1),Vu(this,Pd,!1),Td(Pd,this,e??!1)}createObserver(){const e=new nO;return Ti(Md,this).add(e),e.addLocalHook("unsubscribe",()=>{Ti(Md,this).delete(e)}),e._writeInitialChanges(V0(Ti(Wu,this),Ti(_d,this))),e}emit(e){let n=Ti(_d,this);(!Ti(Id,this)||Ti(Wu,this).length!==e.length)&&(e.length===0?e=new Array(n.length).fill(Ti(Pd,this)):Td(Wu,this,new Array(e.length).fill(Ti(Pd,this))),Ti(Id,this)||(Td(Id,this,!0),n=Ti(Wu,this)));const i=V0(n,e);Ti(Md,this).forEach(r=>r._write(i)),Td(_d,this,e)}}function Nn(t,e,n){return e=wK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wK(t){var e=CK(t,"string");return typeof e=="symbol"?e:e+""}function CK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class JC{constructor(){Nn(this,"indexesSequence",new eO),Nn(this,"trimmingMapsCollection",new F0(e=>e.some(n=>n===!0),!1)),Nn(this,"hidingMapsCollection",new F0(e=>e.some(n=>n===!0),!1)),Nn(this,"variousMapsCollection",new sy),Nn(this,"hidingChangesObservable",new pK({initialIndexValue:!1})),Nn(this,"notTrimmedIndexesCache",[]),Nn(this,"notHiddenIndexesCache",[]),Nn(this,"isBatched",!1),Nn(this,"indexesSequenceChanged",!1),Nn(this,"indexesChangeSource",void 0),Nn(this,"trimmedIndexesChanged",!1),Nn(this,"hiddenIndexesChanged",!1),Nn(this,"renderablePhysicalIndexesCache",[]),Nn(this,"fromPhysicalToVisualIndexesCache",new Map),Nn(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){if(e!=="hiding")throw new Error(`Unsupported index map type "${e}".`);return this.hidingChangesObservable.createObserver()}createAndRegisterIndexMap(e,n,i){return this.registerMap(e,sK(n,i))}registerMap(e,n){if(this.trimmingMapsCollection.get(e)||this.hidingMapsCollection.get(e)||this.variousMapsCollection.get(e))throw Error(`Map with name "${e}" has been already registered.`);n instanceof Lh?this.trimmingMapsCollection.register(e,n):n instanceof ym?this.hidingMapsCollection.register(e,n):this.variousMapsCollection.register(e,n);const i=this.getNumberOfIndexes();return i>0&&n.init(i),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 de(n)?n:null}getPhysicalFromRenderableIndex(e){const n=this.renderablePhysicalIndexesCache[e];return de(n)?n:null}getVisualFromPhysicalIndex(e){const n=this.fromPhysicalToVisualIndexesCache.get(e);return de(n)?n:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){const n=this.fromVisualToRenderableIndexesCache.get(e);return de(n)?n:null}getNearestNotHiddenIndex(e,n){let i=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 o=-1;return n>0?o=s.findIndex(a=>a>e):o=s.reverse().findIndex(a=>a<e),o===-1?i?this.getNearestNotHiddenIndex(e,-n,!1):null:s[o]}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 i=[...Array(this.getNumberOfIndexes()-e).keys()].map(r=>r+e);this.removeIndexes(i)}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(i=>this.isTrimmed(i)===!1)}getNotTrimmedIndexesLength(){return this.getNotTrimmedIndexes().length}getNotHiddenIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notHiddenIndexesCache:this.getIndexesSequence().filter(i=>this.isHidden(i)===!1)}getNotHiddenIndexesLength(){return this.getNotHiddenIndexes().length}getRenderableIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.renderablePhysicalIndexesCache:this.getNotTrimmedIndexes().filter(i=>this.isHidden(i)===!1)}getRenderableIndexesLength(){return this.getRenderableIndexes().length}getNumberOfIndexes(){return this.getIndexesSequence().length}moveIndexes(e,n){typeof e=="number"&&(e=[e]);const i=Ke(e,u=>this.getPhysicalFromVisualIndex(u)),r=this.getNotTrimmedIndexesLength(),s=e.length,o=lh(this.getIndexesSequence(),i),a=o.filter(u=>this.isTrimmed(u)===!1);let l=o.indexOf(a[a.length-1])+1;if(n+s<r){const u=a[n];l=o.indexOf(u)}this.indexesChangeSource="move",this.setIndexesSequence(ny(o,l,i)),this.indexesChangeSource=void 0}isTrimmed(e){return this.trimmingMapsCollection.getMergedValueAtIndex(e)}isHidden(e){return this.hidingMapsCollection.getMergedValueAtIndex(e)}insertIndexes(e,n){const i=this.getNotTrimmedIndexes()[e],r=de(i)?i:this.getNumberOfIndexes(),s=this.getIndexesSequence().includes(i)?this.getIndexesSequence().indexOf(i):this.getNumberOfIndexes(),o=Ke(new Array(n).fill(r),(a,l)=>a+l);this.suspendOperations(),this.indexesChangeSource="insert",this.indexesSequence.insert(s,o),this.indexesChangeSource=void 0,this.trimmingMapsCollection.insertToEvery(s,o),this.hidingMapsCollection.insertToEvery(s,o),this.variousMapsCollection.insertToEvery(s,o),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 i=this.getPhysicalFromVisualIndex(n);this.fromPhysicalToVisualIndexesCache.set(i,n)}}cacheFromVisualToRenderableIndexes(){const e=this.getRenderableIndexesLength();this.fromVisualToRenderableIndexesCache.clear();for(let n=0;n<e;n+=1){const i=this.getPhysicalFromRenderableIndex(n),r=this.getVisualFromPhysicalIndex(i);this.fromVisualToRenderableIndexesCache.set(r,n)}}}bt(JC,zn);function vK(t,e){return Ue(e,(n,i)=>{Mt(t[i])&&(t[i]=n)}),t}function rO(t){const n=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/.exec(t);return n?`${n[1].toLowerCase()}-${n[2].toUpperCase()}`:t}function sO(t){de(t)&&OS(ct`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 SK(t,e){return Array.isArray(t)&&Number.isInteger(e)?t[e]:t}const{register:yK,getValues:bK}=br("phraseFormatters");function RK(t,e){yK(t,e)}function EK(){return bK()}RK("pluralize",SK);const oO="ContextMenu:items",De=oO,oy=`${De}.noItems`,ay=`${De}.insertRowAbove`,ly=`${De}.insertRowBelow`,uy=`${De}.insertColumnOnTheLeft`,cy=`${De}.insertColumnOnTheRight`,hy=`${De}.removeRow`,dy=`${De}.removeColumn`,fy=`${De}.undo`,gy=`${De}.redo`,my=`${De}.readOnly`,py=`${De}.clearColumn`,wy=`${De}.copy`,Cy=`${De}.copyWithHeaders`,vy=`${De}.copyWithGroupHeaders`,Sy=`${De}.copyHeadersOnly`,yy=`${De}.cut`,by=`${De}.freezeColumn`,Ry=`${De}.unfreezeColumn`,Ey=`${De}.mergeCells`,Ty=`${De}.unmergeCells`,My=`${De}.addComment`,_y=`${De}.editComment`,Iy=`${De}.removeComment`,Py=`${De}.readOnlyComment`,Oy=`${De}.align`,xy=`${De}.align.left`,Ay=`${De}.align.center`,Hy=`${De}.align.right`,Ny=`${De}.align.justify`,Dy=`${De}.align.top`,Ly=`${De}.align.middle`,$y=`${De}.align.bottom`,ky=`${De}.borders`,Fy=`${De}.borders.top`,Vy=`${De}.borders.right`,Wy=`${De}.borders.bottom`,By=`${De}.borders.left`,Uy=`${De}.borders.remove`,Yy=`${De}.nestedHeaders.insertChildRow`,zy=`${De}.nestedHeaders.detachFromParent`,Gy=`${De}.hideColumn`,jy=`${De}.showColumn`,Ky=`${De}.hideRow`,Xy=`${De}.showRow`,Gn="Filters:",zt=`${Gn}conditions`,Rm=`${zt}.none`,qy=`${zt}.isEmpty`,Zy=`${zt}.isNotEmpty`,Qy=`${zt}.isEqualTo`,Jy=`${zt}.isNotEqualTo`,eb=`${zt}.beginsWith`,tb=`${zt}.endsWith`,nb=`${zt}.contains`,ib=`${zt}.doesNotContain`,TK=`${zt}.byValue`,rb=`${zt}.greaterThan`,sb=`${zt}.greaterThanOrEqualTo`,ob=`${zt}.lessThan`,ab=`${zt}.lessThanOrEqualTo`,lb=`${zt}.isBetween`,ub=`${zt}.isNotBetween`,cb=`${zt}.after`,hb=`${zt}.before`,db=`${zt}.today`,fb=`${zt}.tomorrow`,gb=`${zt}.yesterday`,mb=`${Gn}labels.filterByCondition`,pb=`${Gn}labels.filterByValue`,wb=`${Gn}labels.conjunction`,Em=`${Gn}labels.disjunction`,pg=`${Gn}values.blankCells`,Cb=`${Gn}buttons.selectAll`,vb=`${Gn}buttons.clear`,Sb=`${Gn}buttons.ok`,yb=`${Gn}buttons.cancel`,bb=`${Gn}buttons.placeholder.search`,Rb=`${Gn}buttons.placeholder.value`,Eb=`${Gn}buttons.placeholder.secondValue`,Tb="CheckboxRenderer:",Mb=`${Tb}checked`,_b=`${Tb}unchecked`,MK=Object.freeze(Object.defineProperty({__proto__:null,CHECKBOX_CHECKED:Mb,CHECKBOX_RENDERER_NAMESPACE:Tb,CHECKBOX_UNCHECKED:_b,CONTEXTMENU_ITEMS_ADD_COMMENT:My,CONTEXTMENU_ITEMS_ALIGNMENT:Oy,CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM:$y,CONTEXTMENU_ITEMS_ALIGNMENT_CENTER:Ay,CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY:Ny,CONTEXTMENU_ITEMS_ALIGNMENT_LEFT:xy,CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE:Ly,CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT:Hy,CONTEXTMENU_ITEMS_ALIGNMENT_TOP:Dy,CONTEXTMENU_ITEMS_BORDERS:ky,CONTEXTMENU_ITEMS_BORDERS_BOTTOM:Wy,CONTEXTMENU_ITEMS_BORDERS_LEFT:By,CONTEXTMENU_ITEMS_BORDERS_RIGHT:Vy,CONTEXTMENU_ITEMS_BORDERS_TOP:Fy,CONTEXTMENU_ITEMS_CLEAR_COLUMN:py,CONTEXTMENU_ITEMS_COPY:wy,CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY:Sy,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS:vy,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS:Cy,CONTEXTMENU_ITEMS_CUT:yy,CONTEXTMENU_ITEMS_EDIT_COMMENT:_y,CONTEXTMENU_ITEMS_FREEZE_COLUMN:by,CONTEXTMENU_ITEMS_HIDE_COLUMN:Gy,CONTEXTMENU_ITEMS_HIDE_ROW:Ky,CONTEXTMENU_ITEMS_INSERT_LEFT:uy,CONTEXTMENU_ITEMS_INSERT_RIGHT:cy,CONTEXTMENU_ITEMS_MERGE_CELLS:Ey,CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD:zy,CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD:Yy,CONTEXTMENU_ITEMS_NO_ITEMS:oy,CONTEXTMENU_ITEMS_READ_ONLY:my,CONTEXTMENU_ITEMS_READ_ONLY_COMMENT:Py,CONTEXTMENU_ITEMS_REDO:gy,CONTEXTMENU_ITEMS_REMOVE_BORDERS:Uy,CONTEXTMENU_ITEMS_REMOVE_COLUMN:dy,CONTEXTMENU_ITEMS_REMOVE_COMMENT:Iy,CONTEXTMENU_ITEMS_REMOVE_ROW:hy,CONTEXTMENU_ITEMS_ROW_ABOVE:ay,CONTEXTMENU_ITEMS_ROW_BELOW:ly,CONTEXTMENU_ITEMS_SHOW_COLUMN:jy,CONTEXTMENU_ITEMS_SHOW_ROW:Xy,CONTEXTMENU_ITEMS_UNDO:fy,CONTEXTMENU_ITEMS_UNFREEZE_COLUMN:Ry,CONTEXTMENU_ITEMS_UNMERGE_CELLS:Ty,CONTEXT_MENU_ITEMS_NAMESPACE:oO,FILTERS_BUTTONS_CANCEL:yb,FILTERS_BUTTONS_CLEAR:vb,FILTERS_BUTTONS_OK:Sb,FILTERS_BUTTONS_PLACEHOLDER_SEARCH:bb,FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE:Eb,FILTERS_BUTTONS_PLACEHOLDER_VALUE:Rb,FILTERS_BUTTONS_SELECT_ALL:Cb,FILTERS_CONDITIONS_AFTER:cb,FILTERS_CONDITIONS_BEFORE:hb,FILTERS_CONDITIONS_BEGINS_WITH:eb,FILTERS_CONDITIONS_BETWEEN:lb,FILTERS_CONDITIONS_BY_VALUE:TK,FILTERS_CONDITIONS_CONTAINS:nb,FILTERS_CONDITIONS_EMPTY:qy,FILTERS_CONDITIONS_ENDS_WITH:tb,FILTERS_CONDITIONS_EQUAL:Qy,FILTERS_CONDITIONS_GREATER_THAN:rb,FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL:sb,FILTERS_CONDITIONS_LESS_THAN:ob,FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL:ab,FILTERS_CONDITIONS_NAMESPACE:zt,FILTERS_CONDITIONS_NONE:Rm,FILTERS_CONDITIONS_NOT_BETWEEN:ub,FILTERS_CONDITIONS_NOT_CONTAIN:ib,FILTERS_CONDITIONS_NOT_EMPTY:Zy,FILTERS_CONDITIONS_NOT_EQUAL:Jy,FILTERS_CONDITIONS_TODAY:db,FILTERS_CONDITIONS_TOMORROW:fb,FILTERS_CONDITIONS_YESTERDAY:gb,FILTERS_DIVS_FILTER_BY_CONDITION:mb,FILTERS_DIVS_FILTER_BY_VALUE:pb,FILTERS_LABELS_CONJUNCTION:wb,FILTERS_LABELS_DISJUNCTION:Em,FILTERS_NAMESPACE:Gn,FILTERS_VALUES_BLANK_CELLS:pg},Symbol.toStringTag,{value:"Module"}));/**
|
|
* @preserve
|
|
* Authors: Handsoncode
|
|
* Last updated: Nov 15, 2017
|
|
*
|
|
* Description: Definition file for English - United States language-country.
|
|
*/const aO={languageCode:"en-US",[oy]:"No available options",[ay]:"Insert row above",[ly]:"Insert row below",[uy]:"Insert column left",[cy]:"Insert column right",[hy]:["Remove row","Remove rows"],[dy]:["Remove column","Remove columns"],[fy]:"Undo",[gy]:"Redo",[my]:"Read only",[py]:"Clear column",[Oy]:"Alignment",[xy]:"Left",[Ay]:"Center",[Hy]:"Right",[Ny]:"Justify",[Dy]:"Top",[Ly]:"Middle",[$y]:"Bottom",[by]:"Freeze column",[Ry]:"Unfreeze column",[ky]:"Borders",[Fy]:"Top",[Vy]:"Right",[Wy]:"Bottom",[By]:"Left",[Uy]:"Remove border(s)",[My]:"Add comment",[_y]:"Edit comment",[Iy]:"Delete comment",[Py]:"Read-only comment",[Ey]:"Merge cells",[Ty]:"Unmerge cells",[wy]:"Copy",[Cy]:["Copy with header","Copy with headers"],[vy]:["Copy with group header","Copy with group headers"],[Sy]:["Copy header only","Copy headers only"],[yy]:"Cut",[Yy]:"Insert child row",[zy]:"Detach from parent",[Gy]:["Hide column","Hide columns"],[jy]:["Show column","Show columns"],[Ky]:["Hide row","Hide rows"],[Xy]:["Show row","Show rows"],[Rm]:"None",[qy]:"Is empty",[Zy]:"Is not empty",[Qy]:"Is equal to",[Jy]:"Is not equal to",[eb]:"Begins with",[tb]:"Ends with",[nb]:"Contains",[ib]:"Does not contain",[rb]:"Greater than",[sb]:"Greater than or equal to",[ob]:"Less than",[ab]:"Less than or equal to",[lb]:"Is between",[ub]:"Is not between",[cb]:"After",[hb]:"Before",[db]:"Today",[fb]:"Tomorrow",[gb]:"Yesterday",[pg]:"Blank cells",[mb]:"Filter by condition",[pb]:"Filter by value",[wb]:"And",[Em]:"Or",[Cb]:"Select all",[vb]:"Clear",[Sb]:"OK",[yb]:"Cancel",[bb]:"Search",[Rb]:"Value",[Eb]:"Second value",[Mb]:"Checked",[_b]:"Unchecked"},_K=MK,ev=aO.languageCode,{register:IK,getItem:lO,hasItem:PK,getValues:OK}=br("languagesDictionaries");uO(aO);function uO(t,e){let n=t,i=e;return ke(t)&&(i=t,n=i.languageCode),xK(n,i),IK(n,Yn(i)),Yn(i)}function xK(t,e){t!==ev&&vK(e,lO(ev))}function cO(t){return Ib(t)?Yn(lO(t)):null}function Ib(t){return PK(t)}function AK(){return OK()}function hO(t,e,n){const i=cO(t);if(i===null)return null;const r=i[e];if(Mt(r))return null;const s=HK(r,n);return Array.isArray(s)?s[0]:s}function HK(t,e){let n=t;return M(EK(),i=>{n=i(t,e)}),n}function NK(t){let e=rO(t);return Ib(e)||(e=ev,sO(t)),e}function DK(t,e,n){return e=LK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LK(t){var e=$K(t,"string");return typeof e=="symbol"?e:e+""}function $K(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Gs extends UP{constructor(e,n){super(e,null),DK(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:i}=e,r=this.getNearestNotHiddenCoords(n,1),s=this.getNearestNotHiddenCoords(i,-1);return r===null||s===null?null:((r.row>s.row||r.col>s.col)&&(r=n,s=i),this.settings.createCellRange(r,r,s))}getNearestNotHiddenCoords(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:n;const r=this.getNearestNotHiddenIndex(this.settings.rowIndexMapper,e.row,n);if(r===null)return null;const s=this.getNearestNotHiddenIndex(this.settings.columnIndexMapper,e.col,i);return s===null?null:this.settings.createCellCoords(r,s)}getNearestNotHiddenIndex(e,n,i){return n<0?n:e.getNearestNotHiddenIndex(n,i)}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(),i=e.getVerticalDirection()==="N-S"?1:-1,r=e.getHorizontalDirection()==="W-E"?1:-1,s=this.settings.visualToRenderableCoords(this.visualCellRange.highlight);let o=null;if((s===null||s.col===null||s.row===null)&&(o=this.getNearestNotHiddenCoords(n,i,r)),o!==null&&e.overlaps(o)){const a=e.highlight.clone();if(a.row>=0&&(a.row=o.row),a.col>=0&&(a.col=o.col),this.cellRange===null){const l=this.settings.visualToRenderableCoords(a);this.cellRange=this.settings.createCellRange(l)}e.setHighlight(a)}return this.settings.selectionType==="focus"&&s!==null&&o===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 i=this.settings.visualToRenderableCoords(e),r=this.settings.visualToRenderableCoords(n);return i.row===null||i.col===null||r.row===null||r.col===null?null:this.settings.createCellRange(i,i,r)}}function Qp(t){let{activeHeaderClassName:e,...n}=t;return new Gs({className:e,...n,selectionType:YP})}function kK(t){let{areaCornerVisible:e,...n}=t;return new Gs({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:e},...n,selectionType:YS})}function FK(t){let{...e}=t;return new Gs({className:"highlight",...e,selectionType:YS})}function VK(t){let{columnClassName:e,...n}=t;return new Gs({className:e,...n,selectionType:dj})}function WK(t){let{cellCornerVisible:e,...n}=t;return new Gs({className:"current",headerAttributes:[SS()],border:{width:2,color:"#4b89ff",cornerVisible:e},...n,selectionType:zS})}function BK(t){let{border:e,visualCellRange:n,...i}=t;return new Gs({...e,...i,selectionType:fj},n)}function UK(t){let{...e}=t;return new Gs({className:"fill",border:{width:1,color:"#ff0000"},...e,selectionType:cj})}function W0(t){let{headerClassName:e,...n}=t;return new Gs({className:e,...n,selectionType:US})}function YK(t){let{rowClassName:e,...n}=t;return new Gs({className:e,...n,selectionType:hj})}function zK(t,e){GK(t,e),e.add(t)}function GK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xn(t,e,n){return e=jK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jK(t){var e=KK(t,"string");return typeof e=="symbol"?e:e+""}function KK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gs(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 XK{constructor(e){zK(this,_r),Xn(this,"options",void 0),Xn(this,"layerLevel",0),Xn(this,"focus",void 0),Xn(this,"fill",void 0),Xn(this,"layeredAreas",new Map),Xn(this,"areas",new Map),Xn(this,"rowHeaders",new Map),Xn(this,"columnHeaders",new Map),Xn(this,"activeRowHeaders",new Map),Xn(this,"activeColumnHeaders",new Map),Xn(this,"activeCornerHeaders",new Map),Xn(this,"rowHighlights",new Map),Xn(this,"columnHighlights",new Map),Xn(this,"customSelections",[]),this.options=e,this.focus=WK(e),this.fill=UK(e)}isEnabledFor(e,n){let i=e;e===zS&&(i="current");let r=this.options.disabledCellSelection(n.row,n.col);return typeof r=="string"&&(r=[r]),r===!1||Array.isArray(r)&&!r.includes(i)}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 gs(_r,this,ms).call(this,this.layeredAreas,kK)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return gs(_r,this,ms).call(this,this.areas,FK)}getAreas(){return[...this.areas.values()]}createRowHeader(){return gs(_r,this,ms).call(this,this.rowHeaders,W0)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return gs(_r,this,ms).call(this,this.columnHeaders,W0)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return gs(_r,this,ms).call(this,this.activeRowHeaders,Qp)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return gs(_r,this,ms).call(this,this.activeColumnHeaders,Qp)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return gs(_r,this,ms).call(this,this.activeCornerHeaders,Qp)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return gs(_r,this,ms).call(this,this.rowHighlights,YK)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return gs(_r,this,ms).call(this,this.columnHighlights,VK)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push(BK({...this.options,...e}))}clear(){this.focus.clear(),this.fill.clear(),M(this.areas.values(),e=>void e.clear()),M(this.layeredAreas.values(),e=>void e.clear()),M(this.rowHeaders.values(),e=>void e.clear()),M(this.columnHeaders.values(),e=>void e.clear()),M(this.activeRowHeaders.values(),e=>void e.clear()),M(this.activeColumnHeaders.values(),e=>void e.clear()),M(this.activeCornerHeaders.values(),e=>void e.clear()),M(this.rowHighlights.values(),e=>void e.clear()),M(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 ms(t,e){const n=this.layerLevel;if(t.has(n))return t.get(n);const i=e({layerLevel:n,...this.options});return t.set(n,i),i}function B0(t,e,n){return e=qK(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qK(t){var e=ZK(t,"string");return typeof e=="symbol"?e:e+""}function ZK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class QK{constructor(e){B0(this,"ranges",[]),B0(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}pop(){return this.ranges.pop(),this}current(){return this.peekByIndex(this.size()-1)}previous(){return this.peekByIndex(this.size()-2)}includes(e){return this.ranges.some(n=>n.includes(e))}clear(){return this.ranges.length=0,this}size(){return this.ranges.length}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 JK(t,e){dO(t,e),e.add(t)}function Jp(t,e,n){dO(t,e),e.set(t,n)}function dO(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nt(t,e){return t.get(en(t,e))}function ew(t,e,n){return t.set(en(t,e),n),n}function en(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 Od=new WeakMap,Rt=new WeakMap,ts=new WeakMap,on=new WeakSet;class tv{constructor(e,n){JK(this,on),Jp(this,Od,void 0),Jp(this,Rt,void 0),Jp(this,ts,{x:0,y:0}),ew(Od,this,e),ew(Rt,this,n)}transformStart(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const r=nt(Rt,this).createCellCoords(e,n);let s=nt(Od,this).current().highlight;const o=nt(Rt,this).visualToRenderableCoords(s);let a=0,l=0;if(this.runLocalHooks("beforeTransformStart",r),o.row!==null&&o.col!==null){const{width:u,height:c}=en(on,this,fO).call(this),{row:h,col:d}=en(on,this,Y0).call(this,s),g=nt(Rt,this).fixedRowsBottom(),p=nt(Rt,this).minSpareRows(),C=nt(Rt,this).minSpareCols(),S=nt(Rt,this).autoWrapRow(),b=nt(Rt,this).autoWrapCol(),R=nt(Rt,this).createCellCoords(h+r.row,d+r.col);if(R.row>=c){const P=cr(i&&p>0&&g===0),B=R.col+1,Y=nt(Rt,this).createCellCoords(R.row-c,B>=u?B-u:B);this.runLocalHooks("beforeColumnWrap",P,en(on,this,ul).call(this,Y),B>=u),P.value?this.runLocalHooks("insertRowRequire",nt(Rt,this).countRenderableRows()):b&&R.assign(Y)}else if(R.row<0){const P=cr(b),B=R.col-1,Y=nt(Rt,this).createCellCoords(c+R.row,B<0?u+B:B);this.runLocalHooks("beforeColumnWrap",P,en(on,this,ul).call(this,Y),B<0),b&&R.assign(Y)}if(R.col>=u){const P=cr(i&&C>0),B=R.row+1,Y=nt(Rt,this).createCellCoords(B>=c?B-c:B,R.col-u);this.runLocalHooks("beforeRowWrap",P,en(on,this,ul).call(this,Y),B>=c),P.value?this.runLocalHooks("insertColRequire",nt(Rt,this).countRenderableColumns()):S&&R.assign(Y)}else if(R.col<0){const P=cr(S),B=R.row-1,Y=nt(Rt,this).createCellCoords(B<0?c+B:B,u+R.col);this.runLocalHooks("beforeRowWrap",P,en(on,this,ul).call(this,Y),B<0),S&&R.assign(Y)}const{rowDir:E,colDir:H}=en(on,this,U0).call(this,R);a=E,l=H,s=en(on,this,ul).call(this,R)}return this.runLocalHooks("afterTransformStart",s,a,l),s}transformEnd(e,n){const i=nt(Rt,this).createCellCoords(e,n),r=nt(Od,this).current(),s=nt(Rt,this).visualToRenderableCoords(r.highlight),o=en(on,this,tw).call(this,r.to.row,r.from.row),a=en(on,this,nw).call(this,r.to.col,r.from.col),l=r.to.clone();let u=0,c=0;if(this.runLocalHooks("beforeTransformEnd",i),s.row!==null&&s.col!==null&&o!==null&&a!==null){const{row:h,col:d}=en(on,this,Y0).call(this,r.highlight),g=nt(Rt,this).createCellCoords(o+i.row,a+i.col),p=r.getTopStartCorner(),C=r.getTopEndCorner(),S=r.getBottomEndCorner();if(i.col<0&&a>=d&&g.col<d){const H=g.col-d;g.col=en(on,this,nw).call(this,p.col,C.col)+H}else if(i.col>0&&a<=d&&g.col>d){const H=en(on,this,nw).call(this,C.col,p.col),P=Math.max(g.col-H,1);g.col=H+P}if(i.row<0&&o>=h&&g.row<h){const H=g.row-h;g.row=en(on,this,tw).call(this,p.row,S.row)+H}else if(i.row>0&&o<=h&&g.row>h){const H=en(on,this,tw).call(this,S.row,p.row),P=Math.max(g.row-H,1);g.row=H+P}const{rowDir:b,colDir:R}=en(on,this,U0).call(this,g);u=b,c=R;const E=en(on,this,ul).call(this,g);i.row===0&&i.col!==0?l.col=E.col:i.row!==0&&i.col===0?l.row=E.row:(l.row=E.row,l.col=E.col)}return this.runLocalHooks("afterTransformEnd",l,u,c),l}setOffsetSize(e){let{x:n,y:i}=e;ew(ts,this,{x:n,y:i})}}function U0(t){const{width:e,height:n}=en(on,this,fO).call(this);let i=0,r=0;return t.row<0?(i=-1,t.row=0):t.row>0&&t.row>=n&&(i=1,t.row=n-1),t.col<0?(r=-1,t.col=0):t.col>0&&t.col>=e&&(r=1,t.col=e-1),{rowDir:i,colDir:r}}function fO(){return{width:nt(ts,this).x+nt(Rt,this).countRenderableColumns(),height:nt(ts,this).y+nt(Rt,this).countRenderableRows()}}function tw(t,e){const n=nt(Rt,this).findFirstNonHiddenRenderableRow(t,e);return n===null?null:nt(ts,this).y+n}function nw(t,e){const n=nt(Rt,this).findFirstNonHiddenRenderableColumn(t,e);return n===null?null:nt(ts,this).x+n}function Y0(t){const{row:e,col:n}=nt(Rt,this).visualToRenderableCoords(t);if(e===null||n===null)throw new Error("Renderable coords are not visible.");return nt(Rt,this).createCellCoords(nt(ts,this).y+e,nt(ts,this).x+n)}function ul(t){const e=t.clone();return e.col=t.col-nt(ts,this).x,e.row=t.row-nt(ts,this).y,nt(Rt,this).renderableToVisualCoords(e)}bt(tv,zn);const Tm=0,Mm=1,gO=2,Pb=3,e3=[Pb,gO],t3=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],iw=Symbol("root"),z0=Symbol("child");function su(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:iw;if(e!==iw&&e!==z0)throw new Error("The second argument is used internally only and cannot be overwritten.");const n=Array.isArray(t),i=e===iw;let r=Tm;if(n){const s=t[0];t.length===0?r=Mm:i&&s instanceof Hh?r=Pb:i&&Array.isArray(s)?r=su(s,z0):t.length>=2&&t.length<=4&&!t.some((a,l)=>!t3[l].includes(typeof a))&&(r=gO)}return r}function uh(t){let{createCellCoords:e,createCellRange:n,keepDirection:i=!1,propToCol:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!e3.includes(t))throw new Error("Unsupported selection ranges schema type was provided.");return function(s){const o=t===Pb;let a=o?s.from.row:s[0],l=o?s.from.col:s[1],u=o?s.to.row:s[2],c=o?s.to.col:s[3];if(typeof r=="function"&&(typeof l=="string"&&(l=r(l)),typeof c=="string"&&(c=r(c))),Mt(u)&&(u=a),Mt(c)&&(c=l),!i){const g=a,p=l,C=u,S=c;a=Math.min(g,C),l=Math.min(p,S),u=Math.max(g,C),c=Math.max(p,S)}const h=e(a,l),d=e(u,c);return n(h,h,d)}}function n3(t){const e=su(t.getSelected());if(e===Tm||e===Mm)return[];const n=uh(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),i=new Set;M(t.getSelected(),o=>{const{from:a,to:l}=n(o),u=Math.max(a.col,0),c=l.col-u+1;M(Array.from(new Array(c),(h,d)=>u+d),h=>{i.has(h)||i.add(h)})});const r=Array.from(i).sort((o,a)=>o-a);return Hn(r,(o,a,l,u)=>(l!==0&&a===u[l-1]+1?o[o.length-1][1]+=1:o.push([a,1]),o),[])}function i3(t){const e=su(t.getSelected());if(e===Tm||e===Mm)return[];const n=uh(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),i=new Set;M(t.getSelected(),o=>{const{from:a,to:l}=n(o),u=Math.max(a.row,0),c=l.row-u+1;M(Array.from(new Array(c),(h,d)=>u+d),h=>{i.has(h)||i.add(h)})});const r=Array.from(i).sort((o,a)=>o-a);return Hn(r,(o,a,l,u)=>(l!==0&&a===u[l-1]+1?o[o.length-1][1]+=1:o.push([a,1]),o),[])}function cl(t,e,n){r3(t,e),e.set(t,n)}function r3(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xo(t,e,n){return e=s3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s3(t){var e=o3(t,"string");return typeof e=="symbol"?e:e+""}function o3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Lt(t,e){return t.get(mO(t,e))}function Ir(t,e,n){return t.set(mO(t,e),n),n}function mO(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 qn=new WeakMap,qo=new WeakMap,xd=new WeakMap,Bu=new WeakMap,Ad=new WeakMap,Uu=new WeakMap;class pO{constructor(e,n){var i=this;Xo(this,"settings",void 0),Xo(this,"tableProps",void 0),Xo(this,"inProgress",!1),Xo(this,"selectedRange",new QK((r,s,o)=>this.tableProps.createCellRange(r,s,o))),Xo(this,"highlight",void 0),cl(this,qn,void 0),cl(this,qo,void 0),Xo(this,"selectedByRowHeader",new Set),Xo(this,"selectedByColumnHeader",new Set),cl(this,xd,!1),cl(this,Bu,!1),cl(this,Ad,"unknown"),cl(this,Uu,-1),this.settings=e,this.tableProps=n,this.highlight=new XK({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[SS()],rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,disabledCellSelection:(r,s)=>this.tableProps.isDisabledCellSelection(r,s),cellCornerVisible:function(){return i.isCellCornerVisible(...arguments)},areaCornerVisible:function(){return i.isAreaCornerVisible(...arguments)},visualToRenderableCoords:r=>this.tableProps.visualToRenderableCoords(r),renderableToVisualCoords:r=>this.tableProps.renderableToVisualCoords(r),createCellCoords:(r,s)=>this.tableProps.createCellCoords(r,s),createCellRange:(r,s,o)=>this.tableProps.createCellRange(r,s,o)}),Ir(qn,this,new tv(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>this.tableProps.countRenderableRows(),countRenderableColumns:()=>this.tableProps.countRenderableColumns(),visualToRenderableCoords:r=>this.tableProps.visualToRenderableCoords(r),renderableToVisualCoords:r=>this.tableProps.renderableToVisualCoords(r),findFirstNonHiddenRenderableRow:function(){return i.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return i.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(r,s)=>this.tableProps.createCellCoords(r,s),fixedRowsBottom:()=>e.fixedRowsBottom,minSpareRows:()=>e.minSpareRows,minSpareCols:()=>e.minSpareCols,autoWrapRow:()=>e.autoWrapRow,autoWrapCol:()=>e.autoWrapCol})),Ir(qo,this,new tv(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>{const r=this.selectedRange.current();return this.tableProps.countRenderableRowsInRange(0,r.getOuterBottomEndCorner().row)},countRenderableColumns:()=>{const r=this.selectedRange.current();return this.tableProps.countRenderableColumnsInRange(0,r.getOuterBottomEndCorner().col)},visualToRenderableCoords:r=>this.tableProps.visualToRenderableCoords(r),renderableToVisualCoords:r=>this.tableProps.renderableToVisualCoords(r),findFirstNonHiddenRenderableRow:function(){return i.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return i.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(r,s)=>this.tableProps.createCellCoords(r,s),fixedRowsBottom:()=>0,minSpareRows:()=>0,minSpareCols:()=>0,autoWrapRow:()=>!0,autoWrapCol:()=>!0})),Lt(qn,this).addLocalHook("beforeTransformStart",function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return i.runLocalHooks("beforeModifyTransformStart",...s)}),Lt(qn,this).addLocalHook("afterTransformStart",function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return i.runLocalHooks("afterModifyTransformStart",...s)}),Lt(qn,this).addLocalHook("beforeTransformEnd",function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return i.runLocalHooks("beforeModifyTransformEnd",...s)}),Lt(qn,this).addLocalHook("afterTransformEnd",function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return i.runLocalHooks("afterModifyTransformEnd",...s)}),Lt(qn,this).addLocalHook("insertRowRequire",function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return i.runLocalHooks("insertRowRequire",...s)}),Lt(qn,this).addLocalHook("insertColRequire",function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return i.runLocalHooks("insertColRequire",...s)}),Lt(qn,this).addLocalHook("beforeRowWrap",function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return i.runLocalHooks("beforeRowWrap",...s)}),Lt(qn,this).addLocalHook("beforeColumnWrap",function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return i.runLocalHooks("beforeColumnWrap",...s)}),Lt(qo,this).addLocalHook("beforeTransformStart",function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return i.runLocalHooks("beforeModifyTransformFocus",...s)}),Lt(qo,this).addLocalHook("afterTransformStart",function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return i.runLocalHooks("afterModifyTransformFocus",...s)})}getSelectedRange(){return this.selectedRange}markSource(e){Ir(Ad,this,e)}markEndSource(){Ir(Ad,this,"unknown")}getSelectionSource(){return Lt(Ad,this)}setExpectedLayers(e){Ir(Uu,this,e)}begin(){this.inProgress=!0}finish(){this.runLocalHooks("afterSelectionFinished",Array.from(this.selectedRange)),this.inProgress=!1,Ir(Uu,this,-1)}isInProgress(){return this.inProgress}setRangeStart(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e;const s=this.settings.selectionMode==="multiple",o=Mt(n)?this.tableProps.getShortcutManager().isCtrlPressed():n,a=e.clone();Ir(xd,this,!1),this.runLocalHooks(`beforeSetRangeStart${i?"Only":""}`,a),(!s||s&&!o&&Mt(n))&&this.selectedRange.clear(),this.selectedRange.add(a).current().setHighlight(r.clone()),this.getLayerLevel()===0&&(this.selectedByRowHeader.clear(),this.selectedByColumnHeader.clear()),i||this.setRangeEnd(e)}setRangeStartOnly(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e;this.setRangeStart(e,n,!0,i)}setRangeEnd(e){if(this.selectedRange.isEmpty())return;const n=e.clone(),i=this.tableProps.countRows(),r=this.tableProps.countCols(),s=this.selectedRange.current().clone().setTo(e).isSingleHeader();if((i>0||r>0)&&(i===0&&n.col<0&&!s||r===0&&n.row<0&&!s))return;this.runLocalHooks("beforeSetRangeEnd",n),this.begin();const o=this.selectedRange.current();if(this.settings.navigableHeaders||o.highlight.normalize(),this.settings.selectionMode==="single")o.setFrom(o.highlight),o.setTo(o.highlight);else{const l=o.getHorizontalDirection(),u=o.getVerticalDirection(),c=this.isMultiple();o.setTo(n),c&&(l!==o.getHorizontalDirection()||o.getWidth()===1&&!o.includes(o.highlight))&&o.from.assign({col:o.highlight.col}),c&&(u!==o.getVerticalDirection()||o.getHeight()===1&&!o.includes(o.highlight))&&o.from.assign({row:o.highlight.row})}i>0&&r>0&&(!this.settings.navigableHeaders||this.settings.navigableHeaders&&!o.isSingleHeader())&&o.to.normalize(),this.runLocalHooks("beforeHighlightSet"),this.setRangeFocus(this.selectedRange.current().highlight),this.applyAndCommit();const a=Lt(Uu,this)===-1||this.selectedRange.size()===Lt(Uu,this);this.runLocalHooks("afterSetRangeEnd",e,a)}applyAndCommit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.selectedRange.current(),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLayerLevel();const i=this.tableProps.countRows(),r=this.tableProps.countCols();n<this.highlight.layerLevel&&(M(this.highlight.getAreas(),p=>void p.clear()),M(this.highlight.getLayeredAreas(),p=>void p.clear()),M(this.highlight.getRowHeaders(),p=>void p.clear()),M(this.highlight.getColumnHeaders(),p=>void p.clear()),M(this.highlight.getActiveRowHeaders(),p=>void p.clear()),M(this.highlight.getActiveColumnHeaders(),p=>void p.clear()),M(this.highlight.getActiveCornerHeaders(),p=>void p.clear()),M(this.highlight.getRowHighlights(),p=>void p.clear()),M(this.highlight.getColumnHighlights(),p=>void p.clear())),this.highlight.useLayerLevel(n);const s=this.highlight.createArea(),o=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),u=this.highlight.createActiveRowHeader(),c=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),g=this.highlight.createColumnHighlight();if(s.clear(),o.clear(),a.clear(),l.clear(),u.clear(),c.clear(),h.clear(),d.clear(),g.clear(),this.highlight.isEnabledFor(YS,e.highlight)&&(this.isMultiple()||n>=1)&&(s.add(e.from).add(e.to).commit(),o.add(e.from).add(e.to).commit(),n===1)){const p=this.selectedRange.previous();this.highlight.useLayerLevel(n-1),this.highlight.createArea().add(p.from).commit().syncWith(p),this.highlight.createLayeredArea().add(p.from).commit().syncWith(p),this.highlight.useLayerLevel(n)}if(this.highlight.isEnabledFor(US,e.highlight)){if(!e.isSingleHeader()){const S=this.tableProps.createCellCoords(Math.max(e.from.row,0),-1),b=this.tableProps.createCellCoords(e.to.row,-1),R=this.tableProps.createCellCoords(-1,Math.max(e.from.col,0)),E=this.tableProps.createCellCoords(-1,e.to.col);this.settings.selectionMode==="single"?(a.add(S).commit(),l.add(R).commit(),d.add(S).commit(),g.add(R).commit()):(a.add(S).add(b).commit(),l.add(R).add(E).commit(),d.add(S).add(b).commit(),g.add(R).add(E).commit())}const p=!Lt(Bu,this)&&this.isEntireRowSelected()&&(r>0&&r===e.getWidth()||r===0&&this.isSelectedByRowHeader()),C=!Lt(Bu,this)&&this.isEntireColumnSelected()&&(i>0&&i===e.getHeight()||i===0&&this.isSelectedByColumnHeader());p&&u.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(),C&&c.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(),p&&C&&h.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(),-this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1,-1)).commit()}}setRangeFocus(e){if(this.selectedRange.isEmpty())return;const n=this.selectedRange.current();this.inProgress||this.runLocalHooks("beforeSetFocus",e);const i=this.highlight.getFocus();i.clear(),n.setHighlight(e),this.inProgress||this.runLocalHooks("beforeHighlightSet"),this.highlight.isEnabledFor(zS,n.highlight)&&i.add(n.highlight).commit().syncWith(n),this.inProgress||(Ir(xd,this,!0),this.runLocalHooks("afterSetFocus",n.highlight))}transformStart(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.settings.navigableHeaders&&Lt(qn,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}),this.setRangeStart(Lt(qn,this).transformStart(e,n,i))}transformEnd(e,n){this.settings.navigableHeaders&&Lt(qn,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}),this.setRangeEnd(Lt(qn,this).transformEnd(e,n))}transformFocus(e,n){const i=this.selectedRange.current(),{row:r,col:s}=i.getOuterTopStartCorner(),o=this.tableProps.countRenderableColumnsInRange(0,s-1),a=this.tableProps.countRenderableRowsInRange(0,r-1);i.highlight.isHeader()?Lt(qo,this).setOffsetSize({x:s<0?Math.abs(s):-o,y:r<0?Math.abs(r):-a}):Lt(qo,this).setOffsetSize({x:s<0?0:-o,y:r<0?0:-a});const l=Lt(qo,this).transformStart(e,n);this.setRangeFocus(l.normalize())}shiftRows(e,n){if(!this.isSelected())return;const i=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByColumnHeader()||i.getOuterTopStartCorner().row>=e){const{from:r,to:s,highlight:o}=i,a=this.tableProps.countRows(),l=this.isSelectedByRowHeader(),u=this.isSelectedByColumnHeader(),c=u?-1:0,h=u?0:n;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(gt(r.row+h,c,a-1),r.col),g=this.tableProps.createCellCoords(gt(s.row+n,c,a-1),s.col);this.markSource("shift"),o.row>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(gt(o.row+n,0,a-1),o.col)):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),u&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(g),this.markEndSource()}}shiftColumns(e,n){if(!this.isSelected())return;const i=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByRowHeader()||i.getOuterTopStartCorner().col>=e){const{from:r,to:s,highlight:o}=i,a=this.tableProps.countCols(),l=this.isSelectedByRowHeader(),u=this.isSelectedByColumnHeader(),c=l?-1:0,h=l?0:n;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(r.row,gt(r.col+h,c,a-1)),g=this.tableProps.createCellCoords(s.row,gt(s.col+n,c,a-1));this.markSource("shift"),o.col>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(o.row,gt(o.col+n,0,a-1))):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),u&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(g),this.markEndSource()}}getLayerLevel(){return this.selectedRange.size()-1}isSelected(){return!this.selectedRange.isEmpty()}isMultiple(){if(!this.isSelected())return!1;const e=cr(!this.selectedRange.current().isSingle());return this.runLocalHooks("afterIsMultipleSelection",e),e.value}isFocusSelectionChanged(){return this.isSelected()&&Lt(xd,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=r=>{const{col:s}=r.getOuterTopStartCorner(),o=this.tableProps.countRowHeaders(),a=this.tableProps.countCols();return(o>0&&s<0||o===0)&&r.getWidth()===a};if(e===-1)return Array.from(this.selectedRange).some(r=>n(r));const i=this.selectedRange.peekByIndex(e);return i?n(i):!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=r=>{const{row:s}=r.getOuterTopStartCorner(),o=this.tableProps.countColHeaders(),a=this.tableProps.countRows();return(o>0&&s<0||o===0)&&r.getHeight()===a};if(e===-1)return Array.from(this.selectedRange).some(r=>n(r));const i=this.selectedRange.peekByIndex(e);return i?n(i):!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,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{focusPosition:!1,disableHeadersHighlight:!1};const s=this.tableProps.countRows(),o=this.tableProps.countCols(),a=this.tableProps.countRowHeaders(),l=this.tableProps.countColHeaders(),u=i?-l:0,c=n?-a:0;if(u===0&&c===0&&(s===0||o===0))return;let h=(e=this.getSelectedRange().current())===null||e===void 0?void 0:e.highlight;const{focusPosition:d,disableHeadersHighlight:g}=r;Ir(Bu,this,g),d&&Number.isInteger(d?.row)&&Number.isInteger(d?.col)&&(h=this.tableProps.createCellCoords(gt(d.row,u,s-1),gt(d.col,c,o-1)));const p=this.tableProps.createCellCoords(u,c),C=this.tableProps.createCellCoords(s-1,o-1);this.clear(),this.setRangeStartOnly(p,void 0,h),c<0&&this.selectedByRowHeader.add(this.getLayerLevel()),u<0&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(C),this.finish(),Ir(Bu,this,!1)}selectCells(e){var n=this;const i=su(e);if(i===Mm)return!1;if(i===Tm)throw new Error(ct`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 r=uh(i,{createCellCoords:function(){return n.tableProps.createCellCoords(...arguments)},createCellRange:function(){return n.tableProps.createCellRange(...arguments)},propToCol:l=>this.tableProps.propToCol(l),keepDirection:!0}),s=this.settings.navigableHeaders,o={countRows:this.tableProps.countRows(),countCols:this.tableProps.countCols(),countRowHeaders:s?this.tableProps.countRowHeaders():0,countColHeaders:s?this.tableProps.countColHeaders():0},a=!e.some(l=>{const u=r(l),c=u.isValid(o);return!(c&&!u.containsHeaders()||c&&u.containsHeaders()&&u.isSingleHeader())});return a&&(this.clear(),this.setExpectedLayers(e.length),M(e,l=>{const{from:u,to:c}=r(l);this.setRangeStartOnly(u.clone(),!1),this.setRangeEnd(c.clone())}),this.finish()),a}selectColumns(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const r=typeof e=="string"?this.tableProps.propToCol(e):e,s=typeof n=="string"?this.tableProps.propToCol(n):n,o=this.tableProps.countRows(),a=this.tableProps.countCols(),l=this.tableProps.countColHeaders(),u=l===0?0:-l,c=this.tableProps.createCellCoords(u,r),h=this.tableProps.createCellCoords(o-1,s),d=this.tableProps.createCellRange(c,c,h).isValid({countRows:o,countCols:a,countRowHeaders:0,countColHeaders:l});if(d){let g=0,p=0;Number.isInteger(i?.row)&&Number.isInteger(i?.col)?(g=gt(i.row,u,o-1),p=gt(i.col,Math.min(r,s),Math.max(r,s))):(g=gt(i,u,o-1),p=r);const C=this.tableProps.createCellCoords(g,p),S=l===0?0:gt(C.row,u,-1),b=o-1,R=this.tableProps.createCellCoords(S,r),E=this.tableProps.createCellCoords(b,s);this.runLocalHooks("beforeSelectColumns",R,E,C),R.row=S,E.row=b,this.setRangeStartOnly(R,void 0,C),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(E),this.runLocalHooks("afterSelectColumns",R,E,C),this.finish()}return d}selectRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const r=this.tableProps.countRows(),s=this.tableProps.countCols(),o=this.tableProps.countRowHeaders(),a=o===0?0:-o,l=this.tableProps.createCellCoords(e,a),u=this.tableProps.createCellCoords(n,s-1),c=this.tableProps.createCellRange(l,l,u).isValid({countRows:r,countCols:s,countRowHeaders:o,countColHeaders:0});if(c){let h=0,d=0;Number.isInteger(i?.row)&&Number.isInteger(i?.col)?(h=gt(i.row,Math.min(e,n),Math.max(e,n)),d=gt(i.col,a,s-1)):(h=e,d=gt(i,a,s-1));const g=this.tableProps.createCellCoords(h,d),p=o===0?0:gt(g.col,a,-1),C=s-1,S=this.tableProps.createCellCoords(e,p),b=this.tableProps.createCellCoords(n,C);this.runLocalHooks("beforeSelectRows",S,b,g),S.col=p,b.col=C,this.setRangeStartOnly(S,void 0,g),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(b),this.runLocalHooks("afterSelectRows",S,b,g),this.finish()}return c}refresh(){if(!this.isSelected())return;const e=this.tableProps.countRows(),n=this.tableProps.countCols();if(e===0||n===0){this.deselect();return}const i=this.selectedRange.peekByIndex(this.selectedRange.size()-1),{from:r,to:s,highlight:o}=i;this.clear(),o.assign({row:gt(o.row,-1/0,e-1),col:gt(o.col,-1/0,n-1)}),r.assign({row:gt(r.row,-1/0,e-1),col:gt(r.col,-1/0,n-1)}),s.assign({row:gt(s.row,0,e-1),col:gt(s.col,0,n-1)}),this.selectedRange.ranges.push(i),this.highlight.getFocus().add(o).commit().syncWith(i),this.applyAndCommit(i)}commit(){if(this.highlight.getCustomSelections().forEach(r=>{r.commit()}),!this.isSelected())return;const n=this.highlight.getFocus(),i=this.getLayerLevel();n.commit().syncWith(this.selectedRange.current());for(let r=0;r<this.selectedRange.size();r+=1){this.highlight.useLayerLevel(r);const s=this.highlight.createArea(),o=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),u=this.highlight.createActiveRowHeader(),c=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),g=this.highlight.createColumnHighlight();s.commit(),o.commit(),a.commit(),l.commit(),u.commit(),c.commit(),h.commit(),d.commit(),g.commit()}this.highlight.useLayerLevel(i)}}bt(pO,zn);const G0=/^(\r\n|\n\r|\r|\n)/,a3=/^[^\t\r\n]+/,j0=/^\t/;function l3(t){const e=[[""]];if(t.length===0)return e;let n=0,i=0,r;for(;t.length>0&&r!==t.length;)if(r=t.length,t.match(j0))t=t.replace(j0,""),n+=1,e[i][n]="";else if(t.match(G0))t=t.replace(G0,""),n=0,i+=1,e[i]=[""];else{let s="";if(t.startsWith('"')){let o=0,a=!0;for(;a;){const l=t.slice(0,1);l==='"'&&(o+=1),s+=l,t=t.slice(1),(t.length===0||t.match(/^[\t\r\n]/)&&o%2===0)&&(a=!1)}s=s.replace(/^"/,"").replace(/"$/,"").replace(/["]*/g,l=>new Array(Math.floor(l.length/2)).fill('"').join(""))}else{const o=t.match(a3);s=o?o[0]:"",t=t.slice(s.length)}e[i][n]=s}return e}function Dc(t){let e,n,i,r,s="",o;for(e=0,n=t.length;e<n;e+=1){for(r=t[e].length,i=0;i<r;i+=1)i>0&&(s+=" "),o=t[e][i],typeof o=="string"?o.indexOf(`
|
|
`)>-1?s+=`"${o.replace(/"/g,'""')}"`:s+=o:o==null?s+="":s+=o;e!==n-1&&(s+=`
|
|
`)}return s}function Zo(t,e,n){return e=u3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u3(t){var e=c3(t,"string");return typeof e=="symbol"?e:e+""}function c3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Yl{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}constructor(e,n,i){Zo(this,"hot",void 0),Zo(this,"metaManager",void 0),Zo(this,"tableMeta",void 0),Zo(this,"dataSource",void 0),Zo(this,"duckSchema",void 0),Zo(this,"colToPropCache",void 0),Zo(this,"propToColCache",void 0),this.hot=e,this.metaManager=i,this.tableMeta=i.getTableMeta(),this.dataSource=n,this.duckSchema=this.createDuckSchema(),this.createMap()}createMap(){const e=this.getSchema();if(typeof e>"u")throw new Error("trying to create `columns` definition but you didn't provide `schema` nor `data`");const n=this.tableMeta.columns;let i;if(this.colToPropCache=[],this.propToColCache=new Map,n){let r=0,s=0,o=!1;if(typeof n=="function"){const a=MS(e);r=a>0?a:this.countFirstRowKeys(),o=!0}else{const a=this.tableMeta.maxCols;r=Math.min(a,n.length)}for(i=0;i<r;i++){const a=o?n(i):n[i];if(ke(a)){if(typeof a.data<"u"){const l=o?s:i;this.colToPropCache[l]=a.data,this.propToColCache.set(a.data,l)}s+=1}}}else this.recursiveDuckColumns(e)}countFirstRowKeys(){return QP(this.dataSource)}recursiveDuckColumns(e,n,i){let r=n,s=i,o;return typeof r>"u"&&(r=0,s=""),typeof e=="object"&&!Array.isArray(e)&&Ue(e,(a,l)=>{a===null?(o=s+l,this.colToPropCache.push(o),this.propToColCache.set(o,r),r+=1):r=this.recursiveDuckColumns(a,r,`${l}.`)}),r}colToProp(e){if(Number.isInteger(e)===!1)return e;const n=this.hot.toPhysicalColumn(e);return n===null?e:this.colToPropCache&&de(this.colToPropCache[n])?this.colToPropCache[n]:n}propToCol(e){const n=this.propToColCache.get(e);if(de(n))return this.hot.toVisualColumn(n);const i=this.hot.toVisualColumn(e);return i===null?e:i}getSchema(){const e=this.tableMeta.dataSchema;return e?typeof e=="function"?e():e:this.duckSchema}createDuckSchema(){return this.dataSource&&this.dataSource[0]?oh(this.dataSource[0]):{}}refreshDuckSchema(){this.duckSchema=this.createDuckSchema()}createRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:i,mode:r="above"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.hot.countSourceRows();let o=s,a=0,l=e;if((typeof l!="number"||l>=s)&&(l=s),l<this.hot.countRows()&&(o=this.hot.toPhysicalRow(l)),this.hot.runHooks("beforeCreateRow",l,n,i)===!1||o===null)return{delta:0};const c=this.tableMeta.maxRows,h=this.getSchema().length,d=[];for(;a<n&&s+a<c;){let p=null;this.hot.dataType==="array"?this.tableMeta.dataSchema?p=Yn(this.getSchema()):(p=[],me(h-1,()=>p.push(null))):this.hot.dataType==="function"?p=this.tableMeta.dataSchema(l+a):(p={},pm(p,this.getSchema())),d.push(p),a+=1}this.hot.rowIndexMapper.insertIndexes(l,a),r==="below"&&(o=Math.min(o+1,s)),this.spliceData(o,0,d);const g=this.hot.toVisualRow(o);return this.hot.countSourceRows()===d.length&&this.hot.columnIndexMapper.initToLength(this.hot.getInitialColumnCount()),a>0&&(e==null?this.metaManager.createRow(null,a):i!=="auto"&&this.metaManager.createRow(o,n)),this.hot.runHooks("afterCreateRow",g,a,i),this.hot.forceFullRender=!0,{delta:a,startPhysicalIndex:o}}createCol(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:i,mode:r="start"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!this.hot.isColumnModificationAllowed())throw new Error("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,o=this.tableMeta.maxCols,a=this.hot.countSourceCols();let l=e;if((typeof l!="number"||l>=a)&&(l=a),this.hot.runHooks("beforeCreateCol",l,n,i)===!1)return{delta:0};let c=a;l<this.hot.countCols()&&(c=this.hot.toPhysicalColumn(l));const h=this.hot.countSourceRows();let d=this.hot.countCols(),g=0,p=c;r==="end"&&(p=Math.min(p+1,a));const C=p;for(;g<n&&d<o;){if(typeof l!="number"||l>=d)if(h>0)for(let b=0;b<h;b+=1)typeof s[b]>"u"&&(s[b]=[]),s[b].push(null);else s.push([null]);else for(let b=0;b<h;b++)s[b].splice(p,0,null);g+=1,p+=1,d+=1}this.hot.columnIndexMapper.insertIndexes(l,g),g>0&&(e==null?this.metaManager.createColumn(null,g):i!=="auto"&&this.metaManager.createColumn(C,n));const S=this.hot.toVisualColumn(C);return this.hot.runHooks("afterCreateCol",S,g,i),this.hot.forceFullRender=!0,this.refreshDuckSchema(),{delta:g,startPhysicalIndex:C}}removeRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,i=arguments.length>2?arguments[2]:void 0,r=Number.isInteger(e)?e:-n;const s=this.visualRowsToPhysical(r,n),o=this.hot.countSourceRows();if(r=(o+r)%o,this.hot.runHooks("beforeRemoveRow",r,s.length,s,i)===!1)return!1;const l=s.length;if(this.filterData(r,l,s),r<this.hot.countRows()){this.hot.rowIndexMapper.removeIndexes(s);const c=de(this.tableMeta.columns)||de(this.tableMeta.dataSchema);this.hot.rowIndexMapper.getNotTrimmedIndexesLength()===0&&c===!1&&this.hot.columnIndexMapper.setIndexesSequence([])}return s.slice(0).sort((c,h)=>h-c).forEach(c=>{this.metaManager.removeRow(c,1)}),this.hot.runHooks("afterRemoveRow",r,l,s,i),this.hot.forceFullRender=!0,!0}removeCol(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,i=arguments.length>2?arguments[2]:void 0;if(this.hot.dataType==="object"||this.tableMeta.columns)throw new Error("cannot remove column with object data source or columns option specified");let r=typeof e!="number"?-n:e;r=(this.hot.countCols()+r)%this.hot.countCols();const s=this.visualColumnsToPhysical(r,n),o=s.slice(0).sort((h,d)=>d-h);if(this.hot.runHooks("beforeRemoveCol",r,n,s,i)===!1)return!1;let l=!0;const u=o.length,c=this.dataSource;for(let h=0;h<u;h++)l&&s[0]!==s[h]-h&&(l=!1);if(l)for(let h=0,d=this.hot.countSourceRows();h<d;h++)c[h].splice(s[0],n),h===0&&this.metaManager.removeColumn(s[0],n);else for(let h=0,d=this.hot.countSourceRows();h<d;h++)for(let g=0;g<u;g++)c[h].splice(o[g],1),h===0&&this.metaManager.removeColumn(o[g],1);return r<this.hot.countCols()&&(this.hot.columnIndexMapper.removeIndexes(s),this.hot.columnIndexMapper.getNotTrimmedIndexesLength()===0&&this.hot.rowIndexMapper.setIndexesSequence([])),this.hot.runHooks("afterRemoveCol",r,n,s,i),this.hot.forceFullRender=!0,this.refreshDuckSchema(),!0}spliceCol(e,n,i){const r=this.hot.getDataAtCol(e),s=r.slice(n,n+i),o=r.slice(n+i);for(var a=arguments.length,l=new Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];OE(l,o);let c=0;for(;c<i;)l.push(null),c+=1;return dU(l),this.hot.populateFromArray(n,e,l,null,null,"spliceCol"),s}spliceRow(e,n,i){const r=this.hot.getSourceDataAtRow(e),s=r.slice(n,n+i),o=r.slice(n+i);for(var a=arguments.length,l=new Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];OE(l,o);let c=0;for(;c<i;)l.push(null),c+=1;return this.hot.populateFromArray(e,n,[l],null,null,"spliceRow"),s}spliceData(e,n,i){if(this.hot.runHooks("beforeDataSplice",e,n,i)!==!1){const s=[...this.dataSource.slice(0,e),...i,...this.dataSource.slice(e)];this.dataSource.length=0,s.forEach(o=>this.dataSource.push(o))}}filterData(e,n,i){let r=this.hot.runHooks("filterData",e,n,i);Array.isArray(r)===!1&&(r=this.dataSource.filter((s,o)=>i.indexOf(o)===-1)),this.dataSource.length=0,Array.prototype.push.apply(this.dataSource,r)}get(e,n){const i=this.hot.toPhysicalRow(e);let r=this.dataSource[i];const s=this.hot.runHooks("modifyRowData",i);r=isNaN(s)?s:r;const{dataDotNotation:o}=this.hot.getSettings();let a=null;if(r&&r.hasOwnProperty&&Ut(r,n))a=r[n];else if(o&&typeof n=="string"&&n.indexOf(".")>-1){let l=r;if(!l)return null;const u=n.split(".");for(let c=0,h=u.length;c<h;c++)if(l=l[u[c]],typeof l>"u")return null;a=l}else typeof n=="function"&&(a=n(this.dataSource.slice(i,i+1)[0]));if(this.hot.hasHook("modifyData")){const l=cr(a);this.hot.runHooks("modifyData",i,this.propToCol(n),l,"get"),l.isTouched()&&(a=l.value)}return a}getCopyable(e,n){return this.hot.getCellMeta(e,this.propToCol(n)).copyable?this.get(e,n):""}set(e,n,i){const r=this.hot.toPhysicalRow(e);let s=i,o=this.dataSource[r];const a=this.hot.runHooks("modifyRowData",r);if(o=isNaN(a)?a:o,this.hot.hasHook("modifyData")){const u=cr(s);this.hot.runHooks("modifyData",r,this.propToCol(n),u,"set"),u.isTouched()&&(s=u.value)}const{dataDotNotation:l}=this.hot.getSettings();if(o&&o.hasOwnProperty&&Ut(o,n))o[n]=s;else if(l&&typeof n=="string"&&n.indexOf(".")>-1){let u=o,c=0,h;const d=n.split(".");for(c=0,h=d.length-1;c<h;c++)typeof u[d[c]]>"u"&&(u[d[c]]={}),u=u[d[c]];u[d[c]]=s}else typeof n=="function"?n(this.dataSource.slice(r,r+1)[0],s):o[n]=s}visualRowsToPhysical(e,n){const i=this.hot.countSourceRows(),r=[];let s=(i+e)%i,o=n,a;for(;s<i&&o;)a=this.hot.toPhysicalRow(s),r.push(a),o-=1,s+=1;return r}visualColumnsToPhysical(e,n){const i=this.hot.countCols(),r=[];let s=(i+e)%i,o=n;for(;s<i&&o;){const a=this.hot.toPhysicalColumn(s);r.push(a),o-=1,s+=1}return r}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 i=this.hot.rowIndexMapper.getNotTrimmedIndexesLength();return Math.min(i,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,Yl.DESTINATION_RENDERER)}countCachedColumns(){return this.colToPropCache.length}getRange(e,n,i){const r=[];let s,o,a;const l=this.tableMeta.maxRows,u=this.tableMeta.maxCols;if(l===0||u===0)return[];const c=i===Yl.DESTINATION_CLIPBOARD_GENERATOR?this.getCopyable:this.get,h=Math.min(Math.max(l-1,0),Math.max(e.row,n.row)),d=Math.min(Math.max(u-1,0),Math.max(e.col,n.col));for(s=Math.min(e.row,n.row);s<=h;s++){a=[];const g=s>=0?this.hot.toPhysicalRow(s):s;for(o=Math.min(e.col,n.col);o<=d&&g!==null;o++)a.push(c.call(this,s,this.colToProp(o)));g!==null&&r.push(a)}return r}getText(e,n){return Dc(this.getRange(e,n,Yl.DESTINATION_RENDERER))}getCopyableText(e,n){return Dc(this.getRange(e,n,Yl.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}}const{register:h3,getItem:d3,hasItem:wO,getNames:Dse,getValues:Lse}=br("cellTypes");function f3(t){if(!wO(t))throw Error(`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`);return d3(t)}function tr(t,e){typeof t!="string"&&(e=t,t=e.CELL_TYPE);const{editor:n,renderer:i,validator:r}=e;n&&ui(t,n),i&&_i(t,i),r&&$l(t,r),h3(t,e)}function g3(t,e){var n;return t==="CELL_TYPE"?!1:((n=e._automaticallyAssignedMetaProps)===null||n===void 0?void 0:n.has(t))||!Ut(e,t)}function _m(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;const i=typeof e.type=="string"?f3(e.type):e.type;if(t._automaticallyAssignedMetaProps&&Ue(e,(s,o)=>void t._automaticallyAssignedMetaProps.delete(o)),!ke(i))return;n===t&&!t._automaticallyAssignedMetaProps&&(t._automaticallyAssignedMetaProps=new Set);const r={};Ue(i,(s,o)=>{if(g3(o,n)){var a;r[o]=s,(a=t._automaticallyAssignedMetaProps)===null||a===void 0||a.add(o)}}),tn(t,r)}function m3(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];function n(){}Ys(n,t);for(let i=0;i<e.length;i++)n.prototype[e[i]]=void 0;return n}function Wf(t){return Number.isInteger(t)&&t>=0}function Bf(t,e){if(!t())throw new Error(`Assertion failed: ${e}`)}function Hd(t){return t==null}const CO=()=>({_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,dragToScroll:!0,dropdownMenu:void 0,editor:void 0,enterBeginsEditing:!0,enterMoves:{col:0,row:1},fillHandle:{autoInsertRow:!1},filter:!0,filteringCaseSensitive:!1,filters:void 0,fixedColumnsLeft:0,fixedColumnsStart:0,fixedRowsBottom:0,fixedRowsTop:0,formulas:void 0,fragmentSelection:!1,height:void 0,hiddenColumns:void 0,hiddenRows:void 0,invalidCellClassName:"htInvalid",imeFastEdit:!1,isEmptyCol(t){let e,n,i;for(e=0,n=this.countRows();e<n;e++)if(i=this.getDataAtCell(e,t),Xt(i)===!1)return!1;return!0},isEmptyRow(t){let e,n,i,r;for(e=0,n=this.countCols();e<n;e++)if(i=this.getDataAtCell(t,e),Xt(i)===!1)return typeof i=="object"?(r=this.getCellMeta(t,e),TS(this.getSchema()[r.prop],i)):!1;return!0},label:void 0,language:"en-US",layoutDirection:"inherit",licenseKey:void 0,locale:"en-US",manualColumnFreeze:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,maxCols:1/0,maxRows:1/0,mergeCells:!1,minCols: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,persistentState:void 0,placeholder:void 0,placeholderCellClassName:"htPlaceholder",preventOverflow:!1,preventWheel:!1,readOnly:!1,readOnlyCellClassName:"htDimmed",renderAllRows:!1,renderAllColumns:!1,renderer:void 0,rowHeaders:void 0,rowHeaderWidth:void 0,rowHeights:void 0,search:!1,selectionMode:"multiple",selectOptions:void 0,skipColumnOnPaste:!1,skipRowOnPaste:!1,sortByRelevance:!0,source:void 0,startCols:5,startRows:5,stretchH:"none",strict:void 0,tableClassName:void 0,tabMoves:{row:0,col:1},title:void 0,trimDropdown:!0,trimRows:void 0,trimWhitespace:!0,type:"text",uncheckedTemplate:void 0,undo:void 0,validator:void 0,viewportColumnRenderingOffset:"auto",viewportRowRenderingOffset:"auto",visibleRows:10,width:void 0,wordWrap:!0});function K0(t,e,n){return e=p3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p3(t){var e=w3(t,"string");return typeof e=="symbol"?e:e+""}function w3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function C3(){return class{}}class v3{constructor(e){K0(this,"metaCtor",C3()),K0(this,"meta",void 0),this.meta=this.metaCtor.prototype,tn(this.meta,CO()),this.meta.instance=e}getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){var n;tn(this.meta,e),_m(this.meta,{...e,type:(n=e.type)!==null&&n!==void 0?n:this.meta.type},e)}}function S3(t,e,n){return e=y3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y3(t){var e=b3(t,"string");return typeof e=="symbol"?e:e+""}function b3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class R3{constructor(e){S3(this,"meta",void 0);const n=e.getMetaConstructor();this.meta=new n}getMeta(){return this.meta}updateMeta(e){tn(this.meta,e),_m(this.meta,e,e)}}function Nd(t,e,n){return e=E3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function E3(t){var e=T3(t,"string");return typeof e=="symbol"?e:e+""}function T3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class wg{constructor(e){Nd(this,"valueFactory",void 0),Nd(this,"data",[]),Nd(this,"index",[]),Nd(this,"holes",new Set),this.valueFactory=e}obtain(e){Bf(()=>Wf(e),"Expecting an unsigned number.");const n=this._getStorageIndexByKey(e);let i;if(n>=0)i=this.data[n],i===void 0&&(i=this.valueFactory(e),this.data[n]=i);else if(i=this.valueFactory(e),this.holes.size>0){const r=this.holes.values().next().value;this.holes.delete(r),this.data[r]=i,this.index[e]=r}else this.data.push(i),this.index[e]=this.data.length-1;return i}insert(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Bf(()=>Wf(e)||Hd(e),"Expecting an unsigned number or null/undefined argument.");const i=[],r=this.data.length;for(let o=0;o<n;o++)i.push(r+o),this.data.push(void 0);const s=Hd(e)?this.index.length:e;this.index=[...this.index.slice(0,s),...i,...this.index.slice(s)]}remove(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Bf(()=>Wf(e)||Hd(e),"Expecting an unsigned number or null/undefined argument.");const i=this.index.splice(Hd(e)?this.index.length-n:e,n);for(let r=0;r<i.length;r++){const s=i[r];typeof s=="number"&&this.holes.add(s)}}size(){return this.data.length-this.holes.size}values(){return gr(this.data,(e,n)=>!this.holes.has(n))[Symbol.iterator]()}entries(){const e=[];for(let i=0;i<this.data.length;i++){const r=this._getKeyByStorageIndex(i);r!==-1&&e.push([r,this.data[i]])}let n=0;return{next:()=>{if(n<e.length){const i=e[n];return n+=1,{value:i,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 X0(t,e,n){return e=M3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function M3(t){var e=_3(t,"string");return typeof e=="symbol"?e:e+""}function _3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const I3=["data","width"];class P3{constructor(e){X0(this,"globalMeta",void 0),X0(this,"metas",new wg(()=>this._createMeta())),this.globalMeta=e,this.metas=new wg(()=>this._createMeta())}updateMeta(e,n){const i=this.getMeta(e);tn(i,n),_m(i,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 m3(this.globalMeta.getMetaConstructor(),I3).prototype}}function q0(t,e,n){return e=O3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O3(t){var e=x3(t,"string");return typeof e=="symbol"?e:e+""}function x3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class A3{constructor(e){q0(this,"columnMeta",void 0),q0(this,"metas",new wg(()=>this._createRow())),this.columnMeta=e}updateMeta(e,n,i){const r=this.getMeta(e,n);tn(r,i),_m(r,i)}createRow(e,n){this.metas.insert(e,n)}createColumn(e,n){for(let i=0;i<this.metas.size();i++)this.metas.obtain(i).insert(e,n)}removeRow(e,n){this.metas.remove(e,n)}removeColumn(e,n){for(let i=0;i<this.metas.size();i++)this.metas.obtain(i).remove(e,n)}getMeta(e,n,i){const r=this.metas.obtain(e).obtain(n);return i===void 0?r:r[i]}setMeta(e,n,i,r){var s;const o=this.metas.obtain(e).obtain(n);(s=o._automaticallyAssignedMetaProps)===null||s===void 0||s.delete(i),o[i]=r}removeMeta(e,n,i){const r=this.metas.obtain(e).obtain(n);delete r[i]}getMetas(){const e=[],n=Array.from(this.metas.values());for(let i=0;i<n.length;i++)de(n[i])&&e.push(...n[i].values());return e}getMetasAtRow(e){Bf(()=>Wf(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 wg(e=>this._createMeta(e))}_createMeta(e){const n=this.columnMeta.getMetaConstructor(e);return new n}}class vO{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];this.hot=e,this.globalMeta=new v3(e),this.tableMeta=new R3(this.globalMeta),this.columnMeta=new P3(this.globalMeta),this.cellMeta=new A3(this.columnMeta),i.forEach(r=>new r(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,i){let{visualRow:r,visualColumn:s}=i;const o=this.cellMeta.getMeta(e,n);return o.visualRow=r,o.visualCol=s,o.row=e,o.col=n,this.runLocalHooks("afterGetCellMeta",o),o}getCellMetaKeyValue(e,n,i){if(typeof i!="string")throw new Error("The passed cell meta object key is not a string");return this.cellMeta.getMeta(e,n,i)}setCellMeta(e,n,i,r){this.cellMeta.setMeta(e,n,i,r)}updateCellMeta(e,n,i){this.cellMeta.updateMeta(e,n,i)}removeCellMeta(e,n,i){this.cellMeta.removeMeta(e,n,i)}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()}}bt(vO,zn);function Z0(t,e,n,i){const{hotInstance:r,dataMap:s,dataSource:o,internalSource:a,source:l,metaManager:u,firstRun:c}=i,h=mr(a),d=r.getSettings();Array.isArray(d.dataSchema)?r.dataType="array":Et(d.dataSchema)?r.dataType="function":r.dataType="object",s&&s.destroy(),t=r.runHooks(`before${h}`,t,c,l);const g=new Yl(r,t,u);if(e(g),typeof t=="object"&&t!==null)t.push&&t.splice||(t=[t]);else if(t===null){const p=g.getSchema();t=[];let C,S=0,b=0;for(S=0,b=d.startRows;S<b;S++)if((r.dataType==="object"||r.dataType==="function")&&d.dataSchema)C=Yn(p),t.push(C);else if(r.dataType==="array")C=Yn(p[0]),t.push(C);else{C=[];for(let R=0,E=d.startCols;R<E;R++)C.push(null);t.push(C)}}else throw new Error(`${a} only accepts array of objects or array of arrays (${typeof t} given)`);Array.isArray(t[0])&&(r.dataType="array"),d.data=t,g.dataSource=t,o.data=t,o.dataType=r.dataType,o.colToProp=g.colToProp.bind(g),o.propToCol=g.propToCol.bind(g),o.countCachedColumns=g.countCachedColumns.bind(g),n(g),r.runHooks(`after${h}`,t,c,l),c||(r.runHooks("afterChange",null,a),r.render()),r.getSettings().ariaTags&&Ee(r.rootElement,[qI(-1),fm(r.countCols()+(r.view?r.countRowHeaders():0))])}function Q0(t,e,n){return e=H3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function H3(t){var e=N3(t,"string");return typeof e=="symbol"?e:e+""}function N3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class D3{constructor(e){Q0(this,"metaManager",void 0),Q0(this,"metaSyncMemo",new Map),this.metaManager=e,e.addLocalHook("afterGetCellMeta",n=>this.extendCellMeta(n)),ce.getSingleton().add("beforeRender",n=>{n&&this.metaSyncMemo.clear()},this.metaManager.hot)}extendCellMeta(e){var n;const{row:i,col:r}=e;if((n=this.metaSyncMemo.get(i))!==null&&n!==void 0&&n.has(r))return;const{visualRow:s,visualCol:o}=e,a=this.metaManager.hot,l=a.colToProp(o);e.prop=l,a.runHooks("beforeGetCellMeta",s,o,e);const u=Ut(e,"type")?e.type:null;let c=Et(e.cells)?e.cells(i,r,l):null;if(u)if(c){var h;c.type=(h=c.type)!==null&&h!==void 0?h:u}else c={type:u};c&&this.metaManager.updateCellMeta(i,r,c),a.runHooks("afterGetCellMeta",s,o,e),this.metaSyncMemo.has(i)||this.metaSyncMemo.set(i,new Set),this.metaSyncMemo.get(i).add(r)}}function L3(t,e,n){$3(t,e),e.set(t,n)}function $3(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rw(t,e,n){return e=k3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function k3(t){var e=F3(t,"string");return typeof e=="symbol"?e:e+""}function F3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function V3(t,e){return t.get(W3(t,e))}function W3(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 J0=new WeakMap;class B3{constructor(e){rw(this,"metaManager",void 0),rw(this,"usageTracker",new Set),rw(this,"propDescriptors",new Map([["ariaTags",{initOnly:!0}],["fixedColumnsLeft",{target:"fixedColumnsStart",onChange(n){if(this.metaManager.hot.isRtl()&&n==="fixedColumnsLeft")throw new Error("The `fixedColumnsLeft` is not supported for RTL. Please use option `fixedColumnsStart`.");if(this.usageTracker.has("fixedColumnsLeft")&&this.usageTracker.has("fixedColumnsStart"))throw new Error("The `fixedColumnsLeft` and `fixedColumnsStart` should not be used together. Please use only the option `fixedColumnsStart`.")}}],["layoutDirection",{initOnly:!0}],["renderAllColumns",{initOnly:!0}],["renderAllRows",{initOnly:!0}]])),L3(this,J0,(n,i,r)=>{if(!r)throw new Error(`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:i,target:r,onChange:s}=e,o=typeof r=="string",a=o?r:n,l=`_${a}`;this.metaManager.globalMeta.meta[l]=this.metaManager.globalMeta.meta[a],s?(this.installPropWatcher(n,l,s),o&&this.installPropWatcher(r,l,s)):i&&(this.installPropWatcher(n,l,V3(J0,this)),this.metaManager.globalMeta.meta._initOnlySettings||(this.metaManager.globalMeta.meta._initOnlySettings=[]),this.metaManager.globalMeta.meta._initOnlySettings.push(n))})}installPropWatcher(e,n,i){const r=this;Object.defineProperty(this.metaManager.globalMeta.meta,e,{get(){return this[n]},set(s){const o=!r.usageTracker.has(e);r.usageTracker.add(e),i.call(r,e,s,o),this[n]=s},enumerable:!0,configurable:!0})}}const SO="gridDefault",ko="editorManager.handlingEditor",U3={name:"editorCloseAndSave",callback(t){t._getEditorManager().closeEditorAndSaveChanges()}},Y3="hooksRefRegisterer",yO={_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){M(this._hooksStorage[t]||[],e=>{this.hot.removeHook(t,e)})},clearHooks(){Ue(this._hooksStorage,(t,e)=>this.removeHooksByKey(e)),this._hooksStorage={}}};zs(yO,"MIXIN_NAME",Y3,{writable:!1,enumerable:!1});function Xi(t,e,n){return e=z3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function z3(t){var e=G3(t,"string");return typeof e=="symbol"?e:e+""}function G3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const j3="base",jt=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"});class pu{static get EDITOR_TYPE(){return j3}constructor(e){Xi(this,"hot",void 0),Xi(this,"state",jt.VIRGIN),Xi(this,"_opened",!1),Xi(this,"_fullEditMode",!1),Xi(this,"_closeCallback",null),Xi(this,"TD",null),Xi(this,"row",null),Xi(this,"col",null),Xi(this,"prop",null),Xi(this,"originalValue",null),Xi(this,"cellProperties",null),this.hot=e,this.init()}_fireCallbacks(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)}init(){}getValue(){throw Error("Editor getValue() method unimplemented")}setValue(){throw Error("Editor setValue() method unimplemented")}open(){throw Error("Editor open() method unimplemented")}close(){throw Error("Editor close() method unimplemented")}prepare(e,n,i,r,s,o){this.TD=r,this.row=e,this.col=n,this.prop=i,this.originalValue=s,this.cellProperties=o,this.state=this.isOpened()?this.state:jt.VIRGIN}extend(){return class extends this.constructor{}}saveValue(e,n){let i,r,s,o;if(n){const l=this.hot.getSelectedLast();i=Math.max(Math.min(l[0],l[2]),0),r=Math.max(Math.min(l[1],l[3]),0),s=Math.max(l[0],l[2]),o=Math.max(l[1],l[3])}else[i,r,s,o]=[this.row,this.col,null,null];const a=this.hot.runHooks("modifyGetCellCoords",i,r);Array.isArray(a)&&([i,r]=a),this.hot.populateFromArray(i,r,e,s,o,"edit")}beginEditing(e,n){if(this.state!==jt.VIRGIN)return;const i=this.hot,r=i.rowIndexMapper.getRenderableFromVisualIndex(this.row),s=i.columnIndexMapper.getRenderableFromVisualIndex(this.col);if(i.view.scrollViewport(i._createCellCoords(r,s)),this.state=jt.EDITING,this.isInFullEditMode()){const o=typeof e=="string"?e:Qt(this.originalValue);this.setValue(o)}this.open(n),this._opened=!0,this.focus(),i.view.render(),i.runHooks("afterBeginEditing",this.row,this.col)}finishEditing(e,n,i){let r;if(i){const s=this._closeCallback;this._closeCallback=o=>{s&&s(o),i(o),this.hot.view.render()}}if(!this.isWaiting()){if(this.state===jt.VIRGIN){this.hot._registerTimeout(()=>{this._fireCallbacks(!0)});return}if(this.state===jt.EDITING){if(e){this.cancelChanges(),this.hot.view.render();return}const s=this.getValue();this.cellProperties.trimWhitespace?r=[[typeof s=="string"?String.prototype.trim.call(s||""):s]]:r=[[s]],this.state=jt.WAITING,this.saveValue(r,n),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",o=>{this.state=jt.FINISHED,this.discardEditor(o)}):(this.state=jt.FINISHED,this.discardEditor(!0))}}}cancelChanges(){this.state=jt.FINISHED,this.discardEditor()}discardEditor(e){this.state===jt.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.hot.selectCell(this.row,this.col),this.focus(),this.state=jt.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=jt.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===jt.WAITING}getEditedCellRect(){var e;const n=this.getEditedCell();if(!n)return;const{wtOverlays:i,wtViewport:r}=this.hot.view._wt,s=this.hot.rootWindow,o=pn(n),a=Ct(n),l=pn(this.hot.rootElement),u=Ct(this.hot.rootElement),c=i.topOverlay.holder,h=i.inlineStartOverlay.holder,d=c!==s?c.scrollTop:0,g=h!==s?h.scrollLeft:0,p=s.innerWidth-l.left-u,{wtTable:C}=(e=i.getParentOverlay(n))!==null&&e!==void 0?e:this.hot.view._wt,S=C.name,b=["master","inline_start"].includes(S)?d:0,R=["master","top","bottom"].includes(S)?g:0,E=o.top===l.top?0:1;let H=o.top-l.top-E-b,P=0;this.hot.isRtl()?P=s.innerWidth-o.left-a-p-1+R:P=o.left-l.left-1-R,["top","top_inline_start_corner"].includes(S)&&(H+=i.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(S)&&(P+=Math.abs(i.inlineStartOverlay.getOverlayOffset()));const B=this.hot.hasColHeaders(),Y=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),j=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),G=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(B&&Y<=0||Y===G)&&(H+=1),j<=0&&(P+=1);const Z=r.rowsRenderCalculator.startPosition,ne=r.columnsRenderCalculator.startPosition,ie=Math.abs(i.inlineStartOverlay.getScrollPosition()),Ce=i.topOverlay.getScrollPosition(),Me=wn(this.hot.rootDocument);let et=n.offsetTop;if(["inline_start","master"].includes(S)&&(et+=Z-Ce),["bottom","bottom_inline_start_corner"].includes(S)){const{wtViewport:K,wtTable:le}=i.bottomOverlay.clone;et+=K.getWorkspaceHeight()-le.getHeight()-Me}let Ne=n.offsetLeft;this.hot.isRtl()?(Ne>=0?Ne=C.getWidth()-n.offsetLeft:Ne=Math.abs(Ne),Ne+=ne-ie-a):["top","master","bottom"].includes(S)&&(Ne+=ne-ie);const we=xo(this.TD,this.hot.rootWindow),pe=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",ht=parseInt(we[pe],10)>0?0:1,f=parseInt(we.borderTopWidth,10)>0?0:1,m=Ct(n)+ht,w=Yt(n)+f,O=qU(c)?Me:0,I=ZU(h)?Me:0,F=this.hot.view.maximumVisibleElementWidth(Ne)-O+ht,U=Math.max(this.hot.view.maximumVisibleElementHeight(et)-I+f,23);return{top:H,start:P,height:w,maxHeight:U,width:m,maxWidth:F}}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}}bt(pu,yO);const K3={name:"editorCloseAndSaveByArrowKeys",callback(t,e,n){const i=t._getEditorManager(),r=i.getActiveEditor();r.isInFullEditMode()&&r.state===jt.EDITING||(i.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())}},X3={name:"editorCloseAndSaveByEnter",callback(t,e){const n=t._getEditorManager();n.closeEditorAndSaveChanges(e.ctrlKey||e.metaKey),n.moveSelectionAfterEnter(e)}},q3={name:"editorCloseWithoutSaving",callback(t){const e=t._getEditorManager();e.closeEditorAndRestoreOriginalValue(t.getShortcutManager().isCtrlPressed()),e.activeEditor.focus()}},Z3={name:"editorFastOpen",callback(t,e){const{highlight:n}=t.getSelectedRangeLast();n.isHeader()||t._getEditorManager().openEditor(null,e,!0)}},Q3={name:"editorOpen",callback(t,e,n){const i=t._getEditorManager(),r=t.getSelectedRangeLast(),{highlight:s}=r;if(t.selection.isMultiple()&&!r.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0){const o=t.getSettings(),a=typeof o.enterMoves=="function"?o.enterMoves(e):o.enterMoves;n.includes("shift")?t.selection.transformFocus(-a.row,-a.col):t.selection.transformFocus(a.row,a.col);return}s.isHeader()||(t.getSettings().enterBeginsEditing?i.cellProperties.readOnly?i.moveSelectionAfterEnter(e):i.openEditor(null,e,!0):i.moveSelectionAfterEnter(e),yr(e))}};function J3(){return[U3,K3,X3,q3,Z3,Q3]}const eX={name:"extendCellsSelectionDown",callback(t){const{highlight:e}=t.getSelectedRangeLast();!t.selection.isSelectedByColumnHeader()&&!t.selection.isSelectedByCorner()&&(e.isCell()||e.isHeader()&&t.selection.isSelectedByRowHeader())&&t.selection.transformEnd(1,0)}},tX={name:"extendCellsSelectionDownByViewportHeight",callback(t){const{to:e}=t.getSelectedRangeLast(),n=Math.min(e.row+t.countVisibleRows(),t.countRows()-1),i=t.rowIndexMapper.getNearestNotHiddenIndex(n,-1);if(i!==null){const r=t._createCellCoords(i,e.col),s=e.row-t.view.getFirstFullyVisibleRow(),o=Math.min(r.row-s,t.countRows()-1);t.selection.setRangeEnd(r),t.scrollViewportTo({row:o,verticalSnap:"top",horizontalSnap:"start"})}}},nX={name:"extendCellsSelectionLeft",callback(t){const{highlight:e}=t.getSelectedRangeLast();!t.selection.isSelectedByRowHeader()&&!t.selection.isSelectedByCorner()&&(e.isCell()||e.isHeader()&&t.selection.isSelectedByColumnHeader())&&t.selection.transformEnd(0,-1*t.getDirectionFactor())}},iX={name:"extendCellsSelectionRight",callback(t){const{highlight:e}=t.getSelectedRangeLast();!t.selection.isSelectedByRowHeader()&&!t.selection.isSelectedByCorner()&&(e.isCell()||e.isHeader()&&t.selection.isSelectedByColumnHeader())&&t.selection.transformEnd(0,t.getDirectionFactor())}},rX={name:"extendCellsSelectionToColumns",callback(t){const{highlight:e,from:n,to:i}=t.getSelectedRangeLast();t.selection.isSelectedByRowHeader()?t.selection.selectAll(!0,!0):t.selectColumns(n.col,i.col,e)}},sX={name:"extendCellsSelectionToMostBottom",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:i,from:r,to:s}=t.getSelectedRangeLast(),o=i.isHeader()&&t.selection.isSelectedByRowHeader();if(i.isCell()||o){const a=n.getNearestNotHiddenIndex(t.countRows()-1,-1),l=r.clone();l.row=i.row,e.setRangeStart(l,void 0,!1,i.clone()),o&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,s.col))}}},oX={name:"extendCellsSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:i,from:r,to:s}=t.getSelectedRangeLast();if(!t.selection.isSelectedByRowHeader()&&!t.selection.isSelectedByCorner()&&i.isCell()){const o=n.getNearestNotHiddenIndex(t.countCols()-1,-1),a=r.clone();a.col=i.col,e.setRangeStart(a,void 0,!1,i.clone()),e.setRangeEnd(t._createCellCoords(s.row,o))}}},aX={name:"extendCellsSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:i,from:r,to:s}=t.getSelectedRangeLast();if(!t.selection.isSelectedByRowHeader()&&!t.selection.isSelectedByCorner()&&i.isCell()){const o=parseInt(t.getSettings().fixedColumnsStart,10),a=n.getNearestNotHiddenIndex(o,1),l=r.clone();l.col=i.col,e.setRangeStart(l,void 0,!1,i.clone()),e.setRangeEnd(t._createCellCoords(s.row,a))}}},lX={name:"extendCellsSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:i,from:r,to:s}=t.getSelectedRangeLast(),o=i.isHeader()&&t.selection.isSelectedByColumnHeader();if(i.isCell()||o){const a=n.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]),l=r.clone();l.col=i.col,e.setRangeStart(l,void 0,!1,i.clone()),o&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(s.row,a))}}},uX={name:"extendCellsSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:i,from:r,to:s}=t.getSelectedRangeLast(),o=i.isHeader()&&t.selection.isSelectedByColumnHeader();if(i.isCell()||o){const a=n.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]),l=r.clone();l.col=i.col,e.setRangeStart(l,void 0,!1,i.clone()),o&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(s.row,a))}}},cX={name:"extendCellsSelectionToMostTop",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:i,from:r,to:s}=t.getSelectedRangeLast(),o=i.isHeader()&&t.selection.isSelectedByRowHeader();if(i.isCell()||o){const a=n.getNearestNotHiddenIndex(0,1),l=r.clone();l.row=i.row,e.setRangeStart(l,void 0,!1,i.clone()),o&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,s.col))}}},hX={name:"extendCellsSelectionToRows",callback(t){const{highlight:e,from:n,to:i}=t.getSelectedRangeLast();t.selection.isSelectedByColumnHeader()?t.selection.selectAll(!0,!0):t.selectRows(n.row,i.row,e)}},dX={name:"extendCellsSelectionUp",callback(t){const{highlight:e}=t.getSelectedRangeLast();!t.selection.isSelectedByColumnHeader()&&!t.selection.isSelectedByCorner()&&(e.isCell()||e.isHeader()&&t.selection.isSelectedByRowHeader())&&t.selection.transformEnd(-1,0)}},fX={name:"extendCellsSelectionUpByViewportHeight",callback(t){const{to:e}=t.getSelectedRangeLast(),n=Math.max(e.row-t.countVisibleRows(),0),i=t.rowIndexMapper.getNearestNotHiddenIndex(n,1);if(i!==null){const r=t._createCellCoords(i,e.col),s=e.row-t.view.getFirstFullyVisibleRow(),o=Math.max(r.row-s,0);t.selection.setRangeEnd(r),t.scrollViewportTo({row:o,verticalSnap:"top",horizontalSnap:"start"})}}};function gX(){return[eX,tX,nX,iX,rX,sX,oX,aX,lX,uX,cX,hX,dX,fX]}const mX={name:"moveCellSelectionDown",callback(t){let{selection:e}=t;e.transformStart(1,0)}},pX={name:"moveCellSelectionDownByViewportHeight",callback(t){const{navigableHeaders:e}=t.getSettings(),n=e?t.countColHeaders():0,{row:i}=t.getSelectedRangeLast().highlight;let r=t.countVisibleRows()+n;i===t.countRows()-1?r=1:i+r>t.countRows()&&(r=t.countRows()-i-1),t.selection.transformStart(r,0),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}},wX={name:"moveCellSelectionInlineEnd",callback(t,e){const n=t.getSettings(),i=t.getSelectedRangeLast(),r=typeof n.tabMoves=="function"?n.tabMoves(e):n.tabMoves;t.selection.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?t.selection.transformFocus(-r.row,-r.col):t.selection.transformStart(-r.row,-r.col)}},CX={name:"moveCellSelectionInlineStart",callback(t,e){const n=t.getSettings(),i=t.getSelectedRangeLast(),r=typeof n.tabMoves=="function"?n.tabMoves(e):n.tabMoves;t.selection.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?t.selection.transformFocus(r.row,r.col):t.selection.transformStart(r.row,r.col)}},vX={name:"moveCellSelectionLeft",callback(t){t.selection.transformStart(0,-1*t.getDirectionFactor())}},SX={name:"moveCellSelectionRight",callback(t){t.selection.transformStart(0,t.getDirectionFactor())}},yX={name:"moveCellSelectionToMostBottom",callback(t){const{col:e}=t.getSelectedRangeLast().highlight;let n=t.rowIndexMapper.getNearestNotHiddenIndex(t.countRows()-1,-1);n===null&&(n=-1),t.selection.setRangeStart(t._createCellCoords(n,e))}},bX={name:"moveCellSelectionToMostBottomInlineEnd",callback(t){const{selection:e,rowIndexMapper:n,columnIndexMapper:i}=t,r=parseInt(t.getSettings().fixedRowsBottom,10),s=n.getNearestNotHiddenIndex(t.countRows()-r-1,-1),o=i.getNearestNotHiddenIndex(t.countCols()-1,-1);e.setRangeStart(t._createCellCoords(s,o))}},RX={name:"moveCellSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t;e.setRangeStart(t._createCellCoords(t.getSelectedRangeLast().highlight.row,n.getNearestNotHiddenIndex(t.countCols()-1,-1)))}},EX={name:"moveCellSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:n}=t,i=parseInt(t.getSettings().fixedColumnsStart,10),r=t.getSelectedRangeLast().highlight.row,s=n.getNearestNotHiddenIndex(i,1);e.setRangeStart(t._createCellCoords(r,s))}},TX={name:"moveCellSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:n}=t,i=t.getSelectedRangeLast().highlight.row;let r=n.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]);r===null&&(r=t.isRtl()?-1:-t.countRowHeaders()),e.setRangeStart(t._createCellCoords(i,r))}},MX={name:"moveCellSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:n}=t,{row:i}=t.getSelectedRangeLast().highlight;let r=n.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]);r===null&&(r=t.isRtl()?-t.countRowHeaders():-1),e.setRangeStart(t._createCellCoords(i,r))}},_X={name:"moveCellSelectionToMostTop",callback(t){const{col:e}=t.getSelectedRangeLast().highlight;let n=t.rowIndexMapper.getNearestNotHiddenIndex(0,1);n===null&&(n=-t.countColHeaders()),t.selection.setRangeStart(t._createCellCoords(n,e))}},IX={name:"moveCellSelectionToMostTopInlineStart",callback(t){const{selection:e,rowIndexMapper:n,columnIndexMapper:i}=t,r=parseInt(t.getSettings().fixedRowsTop,10),s=parseInt(t.getSettings().fixedColumnsStart,10),o=n.getNearestNotHiddenIndex(r,1),a=i.getNearestNotHiddenIndex(s,1);e.setRangeStart(t._createCellCoords(o,a))}},PX={name:"moveCellSelectionUp",callback(t){let{selection:e}=t;e.transformStart(-1,0)}},OX={name:"moveCellSelectionUpByViewportHight",callback(t){const{navigableHeaders:e}=t.getSettings(),n=e?t.countColHeaders():0,{row:i}=t.getSelectedRangeLast().highlight;let r=-(t.countVisibleRows()+n);i===-n?r=-1:i+r<n&&(r=-(i+n)),t.selection.transformStart(r,0),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}};function xX(){return[mX,pX,wX,CX,vX,SX,yX,bX,RX,EX,TX,MX,_X,IX,PX,OX]}const AX={name:"emptySelectedCells",callback(t){t.emptySelectedCells(),t._getEditorManager().prepareEditor()}},HX={name:"scrollToFocusedCell",callback(t){const{highlight:e}=t.getSelectedRangeLast(),n=t.view.getFirstFullyVisibleRow()-1,i=t.view.getFirstFullyVisibleColumn()-1,r=t.view.getLastFullyVisibleRow()+1,s=t.view.getLastFullyVisibleColumn()+1,o=t._createCellCoords(n,i),a=t._createCellCoords(r,s);if(!t._createCellRange(o,o,a).includes(e)&&(e.row>=0||e.col>=0)){const u={};if(e.col>=0){const c=Math.floor(t.countVisibleCols()/2);u.col=Math.max(e.col-c,0)}if(e.row>=0){const c=Math.floor(t.countVisibleRows()/2);u.row=Math.max(e.row-c,0)}t.scrollViewportTo({...u,verticalSnap:"top",horizontalSnap:"start"})}}},NX={name:"selectAllCells",callback(t){t.selection.selectAll(!0,!0,{disableHeadersHighlight:!0})}},DX={name:"selectAllCellsAndHeaders",callback(t){t.selection.selectAll(!0,!0,{disableHeadersHighlight:!1})}},LX={name:"populateSelectedCellsData",callback(t){const e=t.getSelectedRange(),{row:n,col:i}=e[e.length-1].highlight.normalize(),r=t.getDataAtCell(n,i),s=new Map;for(let o=0;o<e.length;o++)e[o].forAll((a,l)=>{if(a>=0&&l>=0&&(a!==n||l!==i)){const{readOnly:u}=t.getCellMeta(a,l);u||s.set(`${a}x${l}`,[a,l,r])}});t.setDataAtCell(Array.from(s.values()))}},$X=[...J3(),...gX(),...xX(),AX,HX,NX,DX,LX];function bO(t){const e={};return $X.forEach(n=>{let{name:i,callback:r}=n;e[i]=function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return r(t,...o)}}),e}function kX(t){const e=t.getShortcutManager().addContext("editor"),n=bO(t),i={group:ko};e.addShortcuts([{keys:[["Enter"],["Enter","Shift"]],callback:(r,s)=>n.editorCloseAndSaveByEnter(r,s)},{keys:[["Enter","Control/Meta"],["Enter","Control/Meta","Shift"]],captureCtrl:!0,callback:(r,s)=>n.editorCloseAndSaveByEnter(r,s)},{keys:[["Tab"],["Tab","Shift"],["PageDown"],["PageUp"]],forwardToContext:t.getShortcutManager().getContext("grid"),callback:(r,s)=>n.editorCloseAndSave(r,s)},{keys:[["ArrowDown"],["ArrowUp"],["ArrowLeft"],["ArrowRight"]],preventDefault:!1,callback:(r,s)=>n.editorCloseAndSaveByArrowKeys(r,s)},{keys:[["Escape"],["Escape","Control/Meta"]],callback:()=>n.editorCloseWithoutSaving()}],i)}function FX(t){const e=t.getShortcutManager().addContext("grid"),n=bO(t),i={runOnlyIf:()=>{const{navigableHeaders:r}=t.getSettings();return de(t.getSelected())&&(r||!r&&t.countRenderedRows()>0&&t.countRenderedCols()>0)},group:SO};e.addShortcuts([{keys:[["F2"]],callback:r=>n.editorFastOpen(r)},{keys:[["Enter"],["Enter","Shift"]],callback:(r,s)=>n.editorOpen(r,s)},{keys:[["Backspace"],["Delete"]],callback:()=>n.emptySelectedCells()}],{group:ko,runOnlyIf:()=>de(t.getSelected())}),e.addShortcuts([{keys:[["Control/Meta","A"]],callback:()=>n.selectAllCells(),runOnlyIf:()=>!t.getSelectedRangeLast().highlight.isHeader()},{keys:[["Control/Meta","A"]],callback:()=>{},runOnlyIf:()=>t.getSelectedRangeLast().highlight.isHeader(),preventDefault:!0},{keys:[["Control/Meta","Shift","Space"]],callback:()=>n.selectAllCellsAndHeaders()},{keys:[["Control/Meta","Enter"]],callback:()=>n.populateSelectedCellsData(),runOnlyIf:()=>!t.getSelectedRangeLast().highlight.isHeader()&&t.getSelectedRangeLast().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:()=>!(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:()=>!(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:()=>!(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:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["Home"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["Home","Shift"]],callback:()=>n.extendCellsSelectionToMostInlineStart()},{keys:[["Home","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostTopInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostInlineEnd(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End","Shift"]],callback:()=>n.extendCellsSelectionToMostInlineEnd()},{keys:[["End","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostBottomInlineEnd(),runOnlyIf:()=>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:r=>n.moveCellSelectionInlineStart(r)},{keys:[["Shift","Tab"]],preventDefault:!1,callback:r=>n.moveCellSelectionInlineEnd(r)},{keys:[["Control/Meta","Backspace"]],callback:()=>n.scrollToFocusedCell()}],i)}function VX(t){[FX,kX].forEach(e=>e(t))}function WX(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=t.rootElement,i=eT(t),r=eT(t);return i.addEventListener("focus",()=>e?.onFocusFromTop()),r.addEventListener("focus",()=>e?.onFocusFromBottom()),n.firstChild.before(i),n.lastChild.after(r),{activate(){t._registerTimeout(()=>{i.tabIndex=0,r.tabIndex=0},10)},deactivate(){t._registerTimeout(()=>{i.tabIndex=-1,r.tabIndex=-1},10)}}}function eT(t){const n=t.rootDocument.createElement("input");return n.type="text",n.classList.add("htFocusCatcher"),t.getSettings().ariaTags&&Ee(n,[qr(),Us()]),n}function BX(t){const e=UX(t);let n;const{activate:i,deactivate:r}=WX(t,{onFocusFromTop(){var h;const d=(h=e(n))!==null&&h!==void 0?h:nv(t);d&&(t.runHooks("modifyFocusOnTabNavigation","from_above",d),t.selectCell(d.row,d.col)),t.listen()},onFocusFromBottom(){var h;const d=(h=e(n))!==null&&h!==void 0?h:iv(t);d&&(t.runHooks("modifyFocusOnTabNavigation","from_below",d),t.selectCell(d.row,d.col)),t.listen()}}),s={wrapped:!1,flipped:!1};let o=!0,a=!1,l=!1;t.addHook("afterListen",()=>r()),t.addHook("afterUnlisten",()=>i()),t.addHook("afterSelection",(h,d,g,p,C)=>{if(a&&(s.wrapped&&s.flipped||l)&&(l=!1,C.value=!0),o){var S;n=(S=t.getSelectedRangeLast())===null||S===void 0?void 0:S.highlight}}),t.addHook("beforeRowWrap",(h,d,g)=>{s.wrapped=!0,s.flipped=g});function u(){s.wrapped=!1,s.flipped=!1,t.deselectCell(),t.unlisten()}const c={keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:SO,group:"focusCatcher"};t.getShortcutManager().getContext("grid").addShortcuts([{...c,callback:()=>{const{tabNavigation:h}=t.getSettings();a=!0,t.getSelectedRangeLast()&&!h&&(o=!1),h||(l=!0)},position:"before"},{...c,callback:h=>{const{tabNavigation:d,autoWrapRow:g}=t.getSettings();if(a=!1,o=!0,!d||!t.selection.isSelected()||g&&s.wrapped&&s.flipped||!g&&s.wrapped)return g&&s.wrapped&&s.flipped&&(n=h.shiftKey?nv(t):iv(t)),u(),!1;h.preventDefault()},position:"after"}])}function nv(t){const{rowIndexMapper:e,columnIndexMapper:n}=t,{navigableHeaders:i}=t.getSettings();let r=i&&t.countColHeaders()>0?-t.countColHeaders():0,s=i&&t.countRowHeaders()>0?-t.countRowHeaders():0;return r===0&&(r=e.getVisualFromRenderableIndex(r)),s===0&&(s=n.getVisualFromRenderableIndex(s)),r===null||s===null?null:t._createCellCoords(r,s)}function iv(t){var e,n;const{rowIndexMapper:i,columnIndexMapper:r}=t,{navigableHeaders:s}=t.getSettings();let o=i.getRenderableIndexesLength()-1,a=r.getRenderableIndexesLength()-1;if(o<0){if(!s||t.countColHeaders()===0)return null;o=-1}if(a<0){if(!s||t.countColHeaders()===0)return null;a=-1}return t._createCellCoords((e=i.getVisualFromRenderableIndex(o))!==null&&e!==void 0?e:o,(n=r.getVisualFromRenderableIndex(a))!==null&&n!==void 0?n:a)}function UX(t){return e=>{if(!e)return null;const n=nv(t),i=iv(t);return e.col<n.col&&(e.col=n.col),e.col>i.col&&(e.col=i.col),e.row<n.row&&(e.row=n.row),e.row>i.row&&(e.row=i.row),e}}function YX(t){return e=>{let{col:n}=e;t.scrollViewportTo({col:n})}}function zX(){return()=>{}}function GX(t){return e=>{t.scrollViewportTo(e.toObject())}}function jX(t){return e=>{t.scrollViewportTo(e.toObject())}}function KX(t){return e=>{t.scrollViewportTo(e.toObject())}}function XX(t){return e=>{let{row:n}=e;t.scrollViewportTo({row:n})}}function qX(t){return e=>{const n=t.selection.getSelectionSource(),{row:i,col:r}=e;if(i<0&&r>=0)t.scrollViewportTo({col:r});else if(r<0&&i>=0)t.scrollViewportTo({row:i});else{if(n==="mouse"&&(r===t.view.getLastPartiallyVisibleColumn()||i===t.view.getLastPartiallyVisibleRow()))return;t.scrollViewportTo({row:i,col:r})}}}function ZX(t){const{selection:e}=t;let n=!1,i=!1;return{resume(){i=!1},suspend(){i=!0},skipNextScrollCycle(){n=!0},scrollTo(r){var s;if(n||i){n=!1;return}let o;e.isFocusSelectionChanged()?o=GX(t):e.isSelectedByCorner()?o=zX():e.isSelectedByRowHeader()?o=XX(t):e.isSelectedByColumnHeader()?o=YX(t):e.getSelectedRange().size()===1&&e.isMultiple()?o=jX(t):e.getSelectedRange().size()===1&&!e.isMultiple()?o=qX(t):e.getSelectedRange().size()>1&&(o=KX(t)),(s=o)===null||s===void 0||s(r)}}}const tT=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"]]),Dd=t=>t.map(e=>{const n=e.toLowerCase();return tT.has(n)?tT.get(n):n}).sort().join("+"),QX=t=>t.split("+"),nT=new RegExp("^(?:Key|Digit)([A-Z0-9])$"),JX=new Set(["Backquote","Minus","Equal","BracketLeft","BracketRight","Backslash","Semicolon","Quote","Comma","Period","Slash"]),sw=t=>{let{key:e,code:n}=t,i=e;return nT.test(n)?i=n.replace(nT,"$1"):JX.has(n)&&(i=n),i.toLowerCase()},RO=Symbol("shortcut-context");function EO(t){return ke(t)&&t.__kindOf===RO}const e4=t=>{const e=wm({errorIdExists:l=>`The "${l}" shortcut is already registered in the "${t}" context.`}),n=function(){let{keys:l,callback:u,group:c,runOnlyIf:h=()=>!0,captureCtrl:d=!1,preventDefault:g=!0,stopPropagation:p=!1,relativeToGroup:C,position:S,forwardToContext:b}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Mt(c))throw new Error("You need to define the shortcut's group.");if(Et(u)===!1)throw new Error("The shortcut's callback needs to be a function.");if(Array.isArray(l)===!1)throw new Error(ct`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 R={callback:u,group:c,runOnlyIf:h,captureCtrl:d,preventDefault:g,stopPropagation:p};de(C)&&(R.relativeToGroup=C,R.position=S),EO(b)&&(R.forwardToContext=b),l.forEach(E=>{const H=Dd(E);if(e.hasItem(H)){const B=e.getItem(H);let Y=B.findIndex(j=>j.group===C);Y!==-1?S==="before"?Y-=1:Y+=1:Y=B.length,B.splice(Y,0,R)}else e.addItem(H,[R])})},i=function(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l.forEach(c=>{Ue(u,(h,d)=>{Object.prototype.hasOwnProperty.call(c,d)===!1&&(c[d]=u[d])}),n(c)})},r=l=>{const u=Dd(l);e.removeItem(u)};return{__kindOf:RO,addShortcut:n,addShortcuts:i,getShortcuts:l=>{const u=Dd(l),c=e.getItem(u);return de(c)?c.slice():[]},hasShortcut:l=>{const u=Dd(l);return e.hasItem(u)},removeShortcutsByKeys:r,removeShortcutsByGroup:l=>{e.getItems().forEach(c=>{let[h,d]=c;const g=d.filter(p=>p.group!==l);g.length===0?r(QX(h)):(d.length=0,d.push(...g))})}}};function t4(){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 n4=["meta","alt","shift","control"],Yu=t4(),zu=[];let Ld=0;function i4(t,e,n,i,r){const s=g=>n4.includes(g),o=function(g){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const C=[];return g.altKey&&C.push("alt"),p&&(g.ctrlKey||g.metaKey)?C.push("control/meta"):(g.ctrlKey&&C.push("control"),g.metaKey&&C.push("meta")),g.shiftKey&&C.push("shift"),C},a=g=>{if(e(g)===!1)return;const p=n(g);if(g.keyCode===229||p===!1||Ra(g))return;const C=sw(g);let S=[];s(C)||(S=o(g));const b=[C].concat(S);!r(g,b)&&(UC()&&S.includes("meta")||!UC()&&S.includes("control"))&&r(g,[C].concat(o(g,!0))),i(g)},l=g=>{if(g.key){const p=sw(g);s(p)&&Yu.press(p)}},u=g=>{if(g.key){const p=sw(g);s(p)&&Yu.release(p)}},c=()=>{Yu.releaseAll()};return{mount:()=>{let g=t;for(Ld+=1;g;)Ld===1&&(g.document.documentElement.addEventListener("keydown",l),zu.push({event:"keydown",listener:l}),g.document.documentElement.addEventListener("keyup",u),zu.push({event:"keyup",listener:u})),g.document.documentElement.addEventListener("keydown",a),g.document.documentElement.addEventListener("blur",c),g=iu(g)},unmount:()=>{let g=t;for(Ld-=1;g;){if(Ld===0){for(let p=0;p<zu.length;p++){const{event:C,listener:S}=zu[p];g.document.documentElement.removeEventListener(C,S)}zu.length=0}g.document.documentElement.removeEventListener("keydown",a),g.document.documentElement.removeEventListener("blur",c),g=iu(g)}},isPressed:g=>Yu.isPressed(g),releasePressedKeys:()=>Yu.releaseAll()}}const r4=t=>{let{ownerWindow:e,handleEvent:n,beforeKeyDown:i,afterKeyDown:r}=t;const s=wm({errorIdExists:p=>`The "${p}" context name is already registered.`});let o="grid";const a=p=>{const C=e4(p);return s.addItem(p,C),C},l=()=>o,u=p=>s.getItem(p),c=p=>{if(!s.hasItem(p))throw new Error(ct`You've tried to activate the "${p}" shortcut context\x20
|
|
that does not exist. Before activation, register the context using the "addContext" method.`);o=p};let h=!1;const d=function(p,C){let S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l();const b=EO(S)?S:u(S);let R=!1;if(!b.hasShortcut(C))return R;const E=b.getShortcuts(C);for(let H=0;H<E.length;H++){const{callback:P,runOnlyIf:B,preventDefault:Y,stopPropagation:j,captureCtrl:z,forwardToContext:G}=E[H];if(B(p)===!0){if(h=z,R=P(p,C)===!1,h=!1,Y&&p.preventDefault(),j&&(yr(p),p.stopPropagation()),R)break;G&&d(p,C,G)}}return R},g=i4(e,n,i,r,d);return g.mount(),{addContext:a,getActiveContextName:l,getContext:u,setActiveContextName:c,isCtrlPressed:()=>!h&&(g.isPressed("control")||g.isPressed("meta")),releasePressedKeys:()=>g.releasePressedKeys(),destroy:()=>g.unmount()}};let ow=null;const aw=new Map;function TO(t,e){var n,i=this;let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=this;const o=new wr(s);let a,l,u,c,h,d,g=!0;Wj(r)&&Vj(this),this.rootElement=t,this.rootDocument=t.ownerDocument,this.rootWindow=this.rootDocument.defaultView,this.isDestroyed=!1,this.renderSuspendedCounter=0,this.executionSuspendedCounter=0;const p=(n=e?.layoutDirection)!==null&&n!==void 0?n:"inherit",C=["rtl","ltr"].includes(p)?p:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",C),this.isRtl=function(){return C==="rtl"},this.isLtr=function(){return!s.isRtl()},this.getDirectionFactor=function(){return s.isLtr()?1:-1},e.language=NK(e.language);const S=new vO(s,e,[D3,B3]),b=S.getTableMeta(),R=S.getGlobalMeta(),E=wm();this.container=this.rootDocument.createElement("div"),this.renderCall=!1,t.insertBefore(this.container,t.firstChild),Ff(this)&&pU(e.licenseKey,t),this.guid=`ht_${YI()}`,aw.set(this.guid,this),this.columnIndexMapper=new JC,this.rowIndexMapper=new JC,this.columnIndexMapper.addLocalHook("indexesSequenceChange",f=>{s.runHooks("afterColumnSequenceChange",f)}),this.rowIndexMapper.addLocalHook("indexesSequenceChange",f=>{s.runHooks("afterRowSequenceChange",f)}),l=new Jj(s),(!this.rootElement.id||this.rootElement.id.substring(0,3)==="ht_")&&(this.rootElement.id=this.guid);const H=f=>{const{row:m,col:w}=f;return s._createCellCoords(m>=0?s.rowIndexMapper.getRenderableFromVisualIndex(m):m,w>=0?s.columnIndexMapper.getRenderableFromVisualIndex(w):w)},P=f=>{const{row:m,col:w}=f;return s._createCellCoords(m>=0?s.rowIndexMapper.getVisualFromRenderableIndex(m):m,w>=0?s.columnIndexMapper.getVisualFromRenderableIndex(w):w)},B=(f,m)=>{const w=m>f?1:-1,O=Math.min(f,m),I=Math.max(f,m),F=s.rowIndexMapper.getNearestNotHiddenIndex(f,w);return F===null||w===1&&F>I||w===-1&&F<O?null:F>=0?s.rowIndexMapper.getRenderableFromVisualIndex(F):F},Y=(f,m)=>{const w=m>f?1:-1,O=Math.min(f,m),I=Math.max(f,m),F=s.columnIndexMapper.getNearestNotHiddenIndex(f,w);return F===null||w===1&&F>I||w===-1&&F<O?null:F>=0?s.columnIndexMapper.getRenderableFromVisualIndex(F):F};let j=new pO(b,{rowIndexMapper:s.rowIndexMapper,columnIndexMapper:s.columnIndexMapper,countCols:()=>s.countCols(),countRows:()=>s.countRows(),propToCol:f=>a.propToCol(f),isEditorOpened:()=>s.getActiveEditor()?s.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:()=>s.getShortcutManager(),createCellCoords:(f,m)=>s._createCellCoords(f,m),createCellRange:(f,m,w)=>s._createCellRange(f,m,w),visualToRenderableCoords:H,renderableToVisualCoords:P,findFirstNonHiddenRenderableRow:B,findFirstNonHiddenRenderableColumn:Y,isDisabledCellSelection:(f,m)=>f<0||m<0?s.getSettings().disableVisualSelection:s.getCellMeta(f,m).disableVisualSelection});this.selection=j;const z=f=>{let{hiddenIndexesChanged:m}=f;m&&this.selection.commit()};this.columnIndexMapper.addLocalHook("cacheUpdated",z),this.rowIndexMapper.addLocalHook("cacheUpdated",z),this.selection.addLocalHook("afterSetRangeEnd",(f,m)=>{const w=cr(!1),O=this.selection.getSelectedRange(),{from:I,to:F}=O.current(),U=O.size()-1;this.runHooks("afterSelection",I.row,I.col,F.row,F.col,w,U),this.runHooks("afterSelectionByProp",I.row,s.colToProp(I.col),F.row,s.colToProp(F.col),w,U),m&&(!w.isTouched()||w.isTouched()&&!w.value)&&d.scrollTo(f);const K=j.isSelectedByRowHeader(),le=j.isSelectedByColumnHeader();K&&le?q(this.rootElement,["ht__selection--rows","ht__selection--columns"]):K?(He(this.rootElement,"ht__selection--columns"),q(this.rootElement,"ht__selection--rows")):le?(He(this.rootElement,"ht__selection--rows"),q(this.rootElement,"ht__selection--columns")):He(this.rootElement,["ht__selection--rows","ht__selection--columns"]),j.getSelectionSource()!=="shift"&&c.closeEditor(null),s.view.render(),c.prepareEditor()}),this.selection.addLocalHook("beforeSetFocus",f=>{this.runHooks("beforeSelectionFocusSet",f.row,f.col)}),this.selection.addLocalHook("afterSetFocus",f=>{const m=cr(!1);this.runHooks("afterSelectionFocusSet",f.row,f.col,m),(!m.isTouched()||m.isTouched()&&!m.value)&&d.scrollTo(f),c.closeEditor(),s.view.render(),c.prepareEditor()}),this.selection.addLocalHook("afterSelectionFinished",f=>{const m=f.length-1,{from:w,to:O}=f[m];this.runHooks("afterSelectionEnd",w.row,w.col,O.row,O.col,m),this.runHooks("afterSelectionEndByProp",w.row,s.colToProp(w.col),O.row,s.colToProp(O.col),m)}),this.selection.addLocalHook("afterIsMultipleSelection",f=>{const m=this.runHooks("afterIsMultipleSelection",f.value);f.value&&(f.value=m)}),this.selection.addLocalHook("afterDeselect",()=>{c.closeEditor(),s.view.render(),He(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this.runHooks("afterDeselect")}),this.selection.addLocalHook("beforeHighlightSet",()=>this.runHooks("beforeSelectionHighlightSet")).addLocalHook("beforeSetRangeStart",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return i.runHooks("beforeSetRangeStart",...m)}).addLocalHook("beforeSetRangeStartOnly",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return i.runHooks("beforeSetRangeStartOnly",...m)}).addLocalHook("beforeSetRangeEnd",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return i.runHooks("beforeSetRangeEnd",...m)}).addLocalHook("beforeSelectColumns",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return i.runHooks("beforeSelectColumns",...m)}).addLocalHook("afterSelectColumns",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return i.runHooks("afterSelectColumns",...m)}).addLocalHook("beforeSelectRows",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return i.runHooks("beforeSelectRows",...m)}).addLocalHook("afterSelectRows",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return i.runHooks("afterSelectRows",...m)}).addLocalHook("beforeModifyTransformStart",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return i.runHooks("modifyTransformStart",...m)}).addLocalHook("afterModifyTransformStart",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return i.runHooks("afterModifyTransformStart",...m)}).addLocalHook("beforeModifyTransformFocus",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return i.runHooks("modifyTransformFocus",...m)}).addLocalHook("afterModifyTransformFocus",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return i.runHooks("afterModifyTransformFocus",...m)}).addLocalHook("beforeModifyTransformEnd",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return i.runHooks("modifyTransformEnd",...m)}).addLocalHook("afterModifyTransformEnd",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return i.runHooks("afterModifyTransformEnd",...m)}).addLocalHook("beforeRowWrap",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return i.runHooks("beforeRowWrap",...m)}).addLocalHook("beforeColumnWrap",function(){for(var f=arguments.length,m=new Array(f),w=0;w<f;w++)m[w]=arguments[w];return i.runHooks("beforeColumnWrap",...m)}).addLocalHook("insertRowRequire",f=>this.alter("insert_row_above",f,1,"auto")).addLocalHook("insertColRequire",f=>this.alter("insert_col_start",f,1,"auto")),u={alter(f,m){var w,O;let I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,F=arguments.length>3?arguments[3]:void 0,U=arguments.length>4?arguments[4]:void 0;const K=le=>{if(le.length===0)return[];const he=[...le];return he.sort((Oe,Pe)=>{let[W]=Oe,[Xe]=Pe;return W===Xe?0:W>Xe?1:-1}),Hn(he,(Oe,Pe)=>{let[W,Xe]=Pe;const Le=Oe[Oe.length-1],[tt,Fe]=Le,Te=tt+Fe;if(W<=Te){const v=Math.max(Xe-(Te-W),0);Le[1]+=v}else Oe.push([W,Xe]);return Oe},[he[0]])};switch(f){case"insert_row_below":case"insert_row_above":const le=s.countSourceRows();if(b.maxRows===le)return;const he=f==="insert_row_below"?"below":"above";m=(w=m)!==null&&w!==void 0?w:he==="below"?le:0;const{delta:Q,startPhysicalIndex:Oe}=a.createRow(m,I,{source:F,mode:he});j.shiftRows(s.toVisualRow(Oe),Q);break;case"insert_col_start":case"insert_col_end":const Pe=f==="insert_col_end"?"end":"start";m=(O=m)!==null&&O!==void 0?O:Pe==="end"?s.countSourceCols():0;const{delta:W,startPhysicalIndex:Xe}=a.createCol(m,I,{source:F,mode:Pe});if(W){if(Array.isArray(b.colHeaders)){const Fe=[s.toVisualColumn(Xe),0];Fe.length+=W,Array.prototype.splice.apply(b.colHeaders,Fe)}j.shiftColumns(s.toVisualColumn(Xe),W)}break;case"remove_row":const Le=Fe=>{let Te=0;M(Fe,v=>{let[y,T]=v;const $=Xt(y)?s.countRows()-1:Math.max(y-Te,0);if(Number.isInteger(y)&&(y=Math.max(y-Te,0)),!a.removeRow(y,T,F))return;if(j.isSelected()){const{row:L}=s.getSelectedRangeLast().highlight;L>=y&&L<=y+T-1&&c.closeEditor(!0)}const k=s.countRows();k===0?j.deselect():F==="ContextMenu.removeRow"?j.refresh():j.shiftRows(y,-T);const N=b.fixedRowsTop;N>=$+1&&(b.fixedRowsTop-=Math.min(T,N-$));const x=b.fixedRowsBottom;x&&$>=k-x&&(b.fixedRowsBottom-=Math.min(T,x)),Te+=T})};Array.isArray(m)?Le(K(m)):Le([[m,I]]);break;case"remove_col":const tt=Fe=>{let Te=0;M(Fe,v=>{let[y,T]=v;const $=Xt(y)?s.countCols()-1:Math.max(y-Te,0);let _=s.toPhysicalColumn($);if(Number.isInteger(y)&&(y=Math.max(y-Te,0)),!a.removeCol(y,T,F))return;if(j.isSelected()){const{col:L}=s.getSelectedRangeLast().highlight;L>=y&&L<=y+T-1&&c.closeEditor(!0)}s.countCols()===0?j.deselect():F==="ContextMenu.removeColumn"?j.refresh():j.shiftColumns(y,-T);const x=b.fixedColumnsStart;x>=$+1&&(b.fixedColumnsStart-=Math.min(T,x-$)),Array.isArray(b.colHeaders)&&(typeof _>"u"&&(_=-1),b.colHeaders.splice(_,T)),Te+=T})};Array.isArray(m)?tt(K(m)):tt([[m,I]]);break;default:throw new Error(`There is no such action "${f}"`)}s.view.render(),U||u.adjustRowsAndCols()},adjustRowsAndCols(){const f=b.minRows,m=b.minSpareRows,w=b.minCols,O=b.minSpareCols;if(f){const I=s.countRows();I<f&&a.createRow(I,f-I,{source:"auto"})}if(m){const I=s.countEmptyRows(!0);if(I<m){const F=m-I,U=Math.min(F,b.maxRows-s.countSourceRows());a.createRow(s.countRows(),U,{source:"auto"})}}{let I;(w||O)&&(I=s.countEmptyCols(!0));let F=s.countCols();if(w&&!b.columns&&F<w){const U=w-F;I+=U,a.createCol(F,U,{source:"auto"})}if(O&&!b.columns&&s.dataType==="array"&&I<O){F=s.countCols();const U=O-I,K=Math.min(U,b.maxCols-F);a.createCol(F,K,{source:"auto"})}}s.view&&s.view.adjustElementsSize()},populateFromArray(f,m,w,O,I){let F,U,K,le;const he=[],Q={},Oe=[],Pe=f.row,W=f.col;if(U=m.length,U===0)return!1;let Xe=0,Le=0;switch(ke(w)&&(Xe=w.col-W+1,Le=w.row-Pe+1),I){case"shift_down":const tt=Lf(m),Fe=tt.length,Te=Math.max(Fe,Xe),v=s.getData().slice(Pe),y=Lf(v).slice(W,W+Te);for(K=0;K<Te;K+=1)if(K<Fe){for(F=0,U=tt[K].length;F<Le-U;F+=1)tt[K].push(tt[K][F%U]);K<y.length?Oe.push(tt[K].concat(y[K])):Oe.push(tt[K].concat(new Array(v.length).fill(null)))}else Oe.push(tt[K%Fe].concat(y[K]));s.populateFromArray(Pe,W,Lf(Oe));break;case"shift_right":const T=m.length,$=Math.max(T,Le),_=s.getData().slice(Pe).map(ue=>ue.slice(W));for(F=0;F<$;F+=1)if(F<T){for(K=0,le=m[F].length;K<Xe-le;K+=1)m[F].push(m[F][K%le]);if(F<_.length)for(let ue=0;ue<_[F].length;ue+=1)m[F].push(_[F][ue]);else m[F].push(...new Array(_[0].length).fill(null))}else m.push(m[F%U].slice(0,$).concat(_[F]));s.populateFromArray(Pe,W,m);break;case"overwrite":default:Q.row=f.row,Q.col=f.col;let k=0,N=0,x=!0,L;const D=function(ye){let $e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const qe=m[ye%m.length];return $e!==null?qe[$e%qe.length]:qe},V=m.length,te=w?w.row-f.row+1:0;for(w?U=te:U=Math.max(V,te),F=0;F<U&&!(w&&Q.row>w.row&&te>V||!b.allowInsertRow&&Q.row>s.countRows()-1||Q.row>=b.maxRows);F++){const ue=F-k,ye=D(ue).length,$e=w?w.col-f.col+1:0;if(w?le=$e:le=Math.max(ye,$e),Q.col=f.col,L=s.getCellMeta(Q.row,Q.col),(O==="CopyPaste.paste"||O==="Autofill.fill")&&L.skipRowOnPaste){k+=1,Q.row+=1,U+=1;continue}for(N=0,K=0;K<le&&!(w&&Q.col>w.col&&$e>ye||!b.allowInsertColumn&&Q.col>s.countCols()-1||Q.col>=b.maxCols);K++){if(L=s.getCellMeta(Q.row,Q.col),(O==="CopyPaste.paste"||O==="Autofill.fill")&&L.skipColumnOnPaste){N+=1,Q.col+=1,le+=1;continue}if(L.readOnly&&O!=="UndoRedo.undo"){Q.col+=1;continue}const qe=K-N;let Ye=D(ue,qe),Ie=s.getDataAtCell(Q.row,Q.col);if(Ye!==null&&typeof Ye=="object")if(Array.isArray(Ye)&&Ie===null&&(Ie=[]),Ie===null||typeof Ie!="object")x=!1;else{const Qe=oh(Array.isArray(Ie)?Ie:Ie[0]||Ie),Dt=oh(Array.isArray(Ye)?Ye:Ye[0]||Ye);TS(Qe,Dt)||Array.isArray(Qe)&&Array.isArray(Dt)?Ye=Yn(Ye):x=!1}else Ie!==null&&typeof Ie=="object"&&(x=!1);x&&he.push([Q.row,Q.col,Ye]),x=!0,Q.col+=1}Q.row+=1}s.setDataAtCell(he,null,null,O||"populateFromArray");break}}};function G(f){const m=rO(f);Ib(m)?(s.runHooks("beforeLanguageChange",m),R.language=m,s.runHooks("afterLanguageChange",m)):sO(f)}function Z(f,m){const w=f==="className"?s.rootElement:s.table;if(g)q(w,m);else{let O=[],I=[];R[f]&&(O=Array.isArray(R[f])?R[f]:AE(R[f])),m&&(I=Array.isArray(m)?m:AE(m));const F=xE(O,I),U=xE(I,O);F.length&&He(w,F),U.length&&q(w,U)}R[f]=m}this.init=function(){l.setData(b.data),s.runHooks("beforeInit"),(bo()||CP())&&q(s.rootElement,"mobile"),this.updateSettings(b,!0),this.view=new zj(this),c=XC.getInstance(s,b,j),d=ZX(s),h=new gz(s),Ff(this)&&BX(s),s.runHooks("init"),this.forceFullRender=!0,this.view.render(),g&&s.rootElement.offsetParent===null&&QU(s.rootElement,()=>{s.view._wt.wtOverlays.updateLastSpreaderSize(),s.render(),s.view.adjustElementsSize()}),typeof g=="object"&&(s.runHooks("afterChange",g[0],g[1]),g=!1),s.runHooks("afterInit")};function ne(){let f=!1;return{validatorsInQueue:0,valid:!0,addValidatorToQueue(){this.validatorsInQueue+=1,f=!1},removeValidatorFormQueue(){this.validatorsInQueue=this.validatorsInQueue-1<0?0:this.validatorsInQueue-1,this.checkIfQueueIsEmpty()},onQueueEmpty(){},checkIfQueueIsEmpty(){this.validatorsInQueue===0&&f===!1&&(f=!0,this.onQueueEmpty(this.valid))}}}function ie(f){const m=f.replace(",",".");return isNaN(parseFloat(m))===!1?parseFloat(m):f}function Ce(f,m,w){if(!f.length)return;const O=s.getActiveEditor(),I=new ne;let F=!0;I.onQueueEmpty=U=>{O&&F&&O.cancelChanges(),w(U)};for(let U=f.length-1;U>=0;U--){const[K,le,,he]=f[U],Q=a.propToCol(le);let Oe;Number.isInteger(Q)?Oe=s.getCellMeta(K,Q):Oe={...Object.getPrototypeOf(b),...b},Oe.type==="numeric"&&typeof he=="string"&&qz(he)&&(f[U][3]=ie(he)),s.getCellValidator(Oe)&&(I.addValidatorToQueue(),s.validateCell(f[U][3],Oe,function(Pe,W){return function(Xe){if(typeof Xe!="boolean")throw new Error("Validation error: result is not boolean");if(Xe===!1&&W.allowInvalid===!1){F=!1,f.splice(Pe,1),W.valid=!0;const Le=s.getCell(W.visualRow,W.visualCol);Le!==null&&He(Le,b.invalidCellClassName)}I.removeValidatorFormQueue()}}(U,Oe),m))}I.checkIfQueueIsEmpty()}function Me(f,m){let w=f.length-1;if(w<0)return;for(;w>=0;w--){let I=!1;if(f[w]===null){f.splice(w,1);continue}if(!((f[w][2]===null||f[w][2]===void 0)&&(f[w][3]===null||f[w][3]===void 0))){if(b.allowInsertRow)for(;f[w][0]>s.countRows()-1;){const{delta:F}=a.createRow(void 0,void 0,{source:m});if(F===0){I=!0;break}}if(s.dataType==="array"&&(!b.columns||b.columns.length===0)&&b.allowInsertColumn)for(;a.propToCol(f[w][1])>s.countCols()-1;){const{delta:F}=a.createCol(void 0,void 0,{source:m});if(F===0){I=!0;break}}I||a.set(f[w][0],f[w][1],f[w][3])}}s.forceFullRender=!0,u.adjustRowsAndCols(),s.runHooks("beforeChangeRender",f,m),c.closeEditor(),s.view.render(),c.prepareEditor(),s.view.adjustElementsSize(),s.runHooks("afterChange",f,m||"edit");const O=s.getActiveEditor();O&&de(O.refreshValue)&&O.refreshValue()}this._createCellCoords=function(f,m){return s.view._wt.createCellCoords(f,m)},this._createCellRange=function(f,m,w){return s.view._wt.createCellRange(f,m,w)},this.validateCell=function(f,m,w,O){let I=s.getCellValidator(m);function F(U){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)||m.hidden===!0){w(U);return}const le=m.visualCol,he=m.visualRow,Q=s.getCell(he,le,!0);if(Q&&Q.nodeName!=="TH"){const Oe=s.rowIndexMapper.getRenderableFromVisualIndex(he),Pe=s.columnIndexMapper.getRenderableFromVisualIndex(le);s.view._wt.getSetting("cellRenderer",Oe,Pe,Q)}w(U)}fU(I)&&(I=function(U){return function(K,le){le(U.test(K))}}(I)),Et(I)?(f=s.runHooks("beforeValidate",f,m.visualRow,m.prop,O),s._registerImmediate(()=>{I.call(m,f,U=>{s&&(U=s.runHooks("afterValidate",U,f,m.visualRow,m.prop,O),m.valid=U,F(U),s.runHooks("postAfterValidate",U,f,m.visualRow,m.prop,O))})})):s._registerImmediate(()=>{m.valid=!0,F(m.valid,!1)})};function et(f,m,w){return Array.isArray(f)?f:[[f,m,w]]}function Ne(f,m){const w=s.getActiveEditor(),O=s.runHooks("beforeChange",f,m||"edit"),I=f.filter(F=>F!==null);return O===!1||I.length===0?(w&&w.cancelChanges(),[]):I}this.setDataAtCell=function(f,m,w,O){const I=et(f,m,w),F=[];let U=O,K,le,he;for(K=0,le=I.length;K<le;K++){if(typeof I[K]!="object")throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if(typeof I[K][1]!="number")throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");I[K][1]>=this.countCols()?he=I[K][1]:he=a.colToProp(I[K][1]),F.push([I[K][0],he,l.getAtCell(this.toPhysicalRow(I[K][0]),I[K][1]),I[K][2]])}!U&&typeof f=="object"&&(U=m);const Q=Ne(F,O);s.runHooks("afterSetDataAtCell",Q,U),Ce(Q,U,()=>{Me(Q,U)})},this.setDataAtRowProp=function(f,m,w,O){const I=et(f,m,w),F=[];let U=O,K,le;for(K=0,le=I.length;K<le;K++)F.push([I[K][0],I[K][1],l.getAtCell(this.toPhysicalRow(I[K][0]),I[K][1]),I[K][2]]);!U&&typeof f=="object"&&(U=m);const he=Ne(F,O);s.runHooks("afterSetDataAtRowProp",he,U),Ce(he,U,()=>{Me(he,U)})},this.listen=function(){s&&!s.isListening()&&(aw.forEach(f=>{s!==f&&f.unlisten()}),ow=s.guid,s.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(ow=null,s.runHooks("afterUnlisten"))},this.isListening=function(){return ow===s.guid},this.destroyEditor=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;c.closeEditor(f),s.view.render(),m&&j.isSelected()&&c.prepareEditor()},this.populateFromArray=function(f,m,w,O,I,F,U){if(!(typeof w=="object"&&typeof w[0]=="object"))throw new Error("populateFromArray parameter `input` must be an array of arrays");const K=typeof O=="number"?s._createCellCoords(O,I):null;return u.populateFromArray(s._createCellCoords(f,m),w,K,F,U)},this.spliceCol=function(f,m,w){for(var O=arguments.length,I=new Array(O>3?O-3:0),F=3;F<O;F++)I[F-3]=arguments[F];return a.spliceCol(f,m,w,...I)},this.spliceRow=function(f,m,w){for(var O=arguments.length,I=new Array(O>3?O-3:0),F=3;F<O;F++)I[F-3]=arguments[F];return a.spliceRow(f,m,w,...I)},this.getSelected=function(){if(j.isSelected())return Ke(j.getSelectedRange(),f=>{let{from:m,to:w}=f;return[m.row,m.col,w.row,w.col]})},this.getSelectedLast=function(){const f=this.getSelected();let m;return f&&f.length>0&&(m=f[f.length-1]),m},this.getSelectedRange=function(){if(j.isSelected())return Array.from(j.getSelectedRange())},this.getSelectedRangeLast=function(){const f=this.getSelectedRange();let m;return f&&f.length>0&&(m=f[f.length-1]),m},this.emptySelectedCells=function(f){if(!j.isSelected()||this.countRows()===0||this.countCols()===0)return;const m=[];M(j.getSelectedRange(),w=>{if(w.isSingleHeader())return;const O=w.getTopStartCorner(),I=w.getBottomEndCorner();me(O.row,I.row,F=>{me(O.col,I.col,U=>{this.getCellMeta(F,U).readOnly||m.push([F,U,null])})})}),m.length>0&&this.setDataAtCell(m,f)},this.isRenderSuspended=function(){return this.renderSuspendedCounter>0},this.suspendRender=function(){this.renderSuspendedCounter+=1},this.resumeRender=function(){const f=this.renderSuspendedCounter-1;this.renderSuspendedCounter=Math.max(f,0),!this.isRenderSuspended()&&f===this.renderSuspendedCounter&&(this.renderCall?this.render():s.view.render())},this.render=function(){this.view&&(this.renderCall=!0,this.forceFullRender=!0,this.isRenderSuspended()||s.view.render())},this.batchRender=function(f){this.suspendRender();const m=f();return this.resumeRender(),m},this.isExecutionSuspended=function(){return this.executionSuspendedCounter>0},this.suspendExecution=function(){this.executionSuspendedCounter+=1,this.columnIndexMapper.suspendOperations(),this.rowIndexMapper.suspendOperations()},this.resumeExecution=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const m=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(m,0),(!this.isExecutionSuspended()&&m===this.executionSuspendedCounter||f)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.suspendExecution();const w=f();return this.resumeExecution(m),w},this.batch=function(f){this.suspendRender(),this.suspendExecution();const m=f();return this.resumeExecution(),this.resumeRender(),m},this.refreshDimensions=function(){if(!s.view)return;const{width:f,height:m}=s.view.getLastSize(),{width:w,height:O}=s.rootElement.getBoundingClientRect(),I=w!==f||O!==m;s.runHooks("beforeRefreshDimensions",{width:f,height:m},{width:w,height:O},I)!==!1&&((I||s.view._wt.wtOverlays.scrollableElement===s.rootWindow)&&(s.view.setLastSize(w,O),s.render()),s.runHooks("afterRefreshDimensions",{width:f,height:m},{width:w,height:O},I))},this.updateData=function(f,m){Z0(f,w=>{a=w},w=>{a=w,s.columnIndexMapper.fitToLength(this.getInitialColumnCount()),s.rowIndexMapper.fitToLength(this.countSourceRows()),u.adjustRowsAndCols(),j.refresh()},{hotInstance:s,dataMap:a,dataSource:l,internalSource:"updateData",source:m,metaManager:S,firstRun:g})},this.loadData=function(f,m){Z0(f,w=>{a=w},()=>{S.clearCellsCache(),s.initIndexMappers(),u.adjustRowsAndCols(),j.refresh(),g&&(g=[null,"loadData"])},{hotInstance:s,dataMap:a,dataSource:l,internalSource:"loadData",source:m,metaManager:S,firstRun:g})},this.getInitialColumnCount=function(){const f=b.columns;let m=0;if(Array.isArray(f))m=f.length;else if(Et(f))if(s.dataType==="array"){const w=this.countSourceCols();for(let O=0;O<w;O+=1)f(O)&&(m+=1)}else(s.dataType==="object"||s.dataType==="function")&&(m=a.colToPropCache.length);else if(de(b.dataSchema)){const w=a.getSchema();m=Array.isArray(w)?w.length:MS(w)}else m=this.countSourceCols();return m},this.initIndexMappers=function(){this.columnIndexMapper.initToLength(this.getInitialColumnCount()),this.rowIndexMapper.initToLength(this.countSourceRows())},this.getData=function(f,m,w,O){return Mt(f)?a.getAll():a.getRange(s._createCellCoords(f,m),s._createCellCoords(w,O),a.DESTINATION_RENDERER)},this.getCopyableText=function(f,m,w,O){return a.getCopyableText(s._createCellCoords(f,m),s._createCellCoords(w,O))},this.getCopyableData=function(f,m){return a.getCopyable(f,a.colToProp(m))},this.getSchema=function(){return a.getSchema()},this.updateSettings=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const w=(g?s.loadData:s.updateData).bind(this);let O=!1,I,F;if(de(f.rows))throw new Error('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?');if(de(f.cols))throw new Error('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?');if(de(f.ganttChart))throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');for(I in f)I==="data"||(I==="language"?G(f.language):I==="className"?Z("className",f.className):I==="tableClassName"&&s.table?(Z("tableClassName",f.tableClassName),s.view._wt.wtOverlays.syncOverlayTableClassNames()):ce.getSingleton().isRegistered(I)||ce.getSingleton().isDeprecated(I)?(Et(f[I])||Array.isArray(f[I]))&&(f[I].initialHook=!0,s.addHook(I,f[I])):!m&&Ut(f,I)&&(R[I]=f[I]));f.data===void 0&&b.data===void 0?w(null,"updateSettings"):f.data!==void 0?w(f.data,"updateSettings"):f.columns!==void 0&&(a.createMap(),s.initIndexMappers());const U=s.countCols(),K=b.columns;if(K&&Et(K)&&(O=!0),(f.cell!==void 0||f.cells!==void 0||f.columns!==void 0)&&S.clearCache(),U>0)for(I=0,F=0;I<U;I++){if(K){const Q=O?K(I):K[F];Q&&S.updateColumnMeta(F,Q)}F+=1}de(f.cell)&&Ue(f.cell,Q=>{s.setCellMetaObject(Q.row,Q.col,Q)}),s.runHooks("afterCellMetaReset");let le=s.rootElement.style.height;le!==""&&(le=parseInt(s.rootElement.style.height,10));let he=f.height;if(Et(he)&&(he=he()),m&&s.rootElement.getAttribute("style")&&s.rootElement.setAttribute("data-initialstyle",s.rootElement.getAttribute("style")),he===null){const Q=s.rootElement.getAttribute("data-initialstyle");Q&&(Q.indexOf("height")>-1||Q.indexOf("overflow")>-1)?s.rootElement.setAttribute("style",Q):(s.rootElement.style.height="",s.rootElement.style.overflow="")}else he!==void 0&&(s.rootElement.style.height=isNaN(he)?`${he}`:`${he}px`,s.rootElement.style.overflow="hidden");if(typeof f.width<"u"){let Q=f.width;Et(Q)&&(Q=Q()),s.rootElement.style.width=isNaN(Q)?`${Q}`:`${Q}px`}m||(s.view&&(s.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),s.view._wt.exportSettingsAsClassNames()),s.runHooks("afterUpdateSettings",f)),u.adjustRowsAndCols(),s.view&&!g&&(s.forceFullRender=!0,s.view.render(),s.view._wt.wtOverlays.adjustElementsSize()),!m&&s.view&&(le===""||he===""||he===void 0)&&le!==he&&s.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const f=s.getSelectedLast();if(b.getValue){if(Et(b.getValue))return b.getValue.call(s);if(f)return s.getData()[f[0][0]][b.getValue]}else if(f)return s.getDataAtCell(f[0],f[1])},this.getSettings=function(){return b},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(f,m,w,O,I){u.alter(f,m,w,O,I)},this.getCell=function(f,m){let w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,O=m,I=f;if(m>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(m)))return null;O=this.columnIndexMapper.getRenderableFromVisualIndex(m)}if(f>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(f)))return null;I=this.rowIndexMapper.getRenderableFromVisualIndex(f)}return I===null||O===null||I===void 0||O===void 0?null:s.view.getCellAtCoords(s._createCellCoords(I,O),w)},this.getCoords=function(f){const m=this.view._wt.wtTable.getCoords(f);if(m===null)return null;const{row:w,col:O}=m;let I=w,F=O;return w>=0&&(I=this.rowIndexMapper.getVisualFromRenderableIndex(w)),O>=0&&(F=this.columnIndexMapper.getVisualFromRenderableIndex(O)),s._createCellCoords(I,F)},this.colToProp=function(f){return a.colToProp(f)},this.propToCol=function(f){return a.propToCol(f)},this.toVisualRow=f=>this.rowIndexMapper.getVisualFromPhysicalIndex(f),this.toVisualColumn=f=>this.columnIndexMapper.getVisualFromPhysicalIndex(f),this.toPhysicalRow=f=>this.rowIndexMapper.getPhysicalFromVisualIndex(f),this.toPhysicalColumn=f=>this.columnIndexMapper.getPhysicalFromVisualIndex(f),this.getDataAtCell=function(f,m){return a.get(f,a.colToProp(m))},this.getDataAtRowProp=function(f,m){return a.get(f,m)},this.getDataAtCol=function(f){const m=[],w=a.getRange(s._createCellCoords(0,f),s._createCellCoords(b.data.length-1,f),a.DESTINATION_RENDERER);for(let O=0;O<w.length;O+=1)for(let I=0;I<w[O].length;I+=1)m.push(w[O][I]);return m},this.getDataAtProp=function(f){const m=[],w=a.getRange(s._createCellCoords(0,a.propToCol(f)),s._createCellCoords(b.data.length-1,a.propToCol(f)),a.DESTINATION_RENDERER);for(let O=0;O<w.length;O+=1)for(let I=0;I<w[O].length;I+=1)m.push(w[O][I]);return m},this.getSourceData=function(f,m,w,O){let I;return f===void 0?I=l.getData():I=l.getByRange(s._createCellCoords(f,m),s._createCellCoords(w,O)),I},this.getSourceDataArray=function(f,m,w,O){let I;return f===void 0?I=l.getData(!0):I=l.getByRange(s._createCellCoords(f,m),s._createCellCoords(w,O),!0),I},this.getSourceDataAtCol=function(f){return l.getAtColumn(f)},this.setSourceDataAtCell=function(f,m,w,O){const I=et(f,m,w),F=this.hasHook("afterSetSourceDataAtCell"),U=[];F&&M(I,le=>{let[he,Q,Oe]=le;U.push([he,Q,l.getAtCell(he,Q),Oe])}),M(I,le=>{let[he,Q,Oe]=le;l.setAtCell(he,Q,Oe)}),F&&this.runHooks("afterSetSourceDataAtCell",U,O),this.render();const K=s.getActiveEditor();K&&de(K.refreshValue)&&K.refreshValue()},this.getSourceDataAtRow=function(f){return l.getAtRow(f)},this.getSourceDataAtCell=function(f,m){return l.getAtCell(f,m)},this.getDataAtRow=function(f){return a.getRange(s._createCellCoords(f,0),s._createCellCoords(f,this.countCols()-1),a.DESTINATION_RENDERER)[0]||[]},this.getDataType=function(f,m,w,O){const I=f===void 0?[0,0,this.countRows(),this.countCols()]:[f,m,w,O],[F,U]=I;let[,,K,le]=I,he=null,Q=null;K===void 0&&(K=F),le===void 0&&(le=U);let Oe="mixed";return me(Math.max(Math.min(F,K),0),Math.max(F,K),Pe=>{let W=!0;return me(Math.max(Math.min(U,le),0),Math.max(U,le),Xe=>(Q=this.getCellMeta(Pe,Xe).type,he?W=he===Q:he=Q,W)),Oe=W?Q:"mixed",W}),Oe},this.removeCellMeta=function(f,m,w){const[O,I]=[this.toPhysicalRow(f),this.toPhysicalColumn(m)];let F=S.getCellMetaKeyValue(O,I,w);s.runHooks("beforeRemoveCellMeta",f,m,w,F)!==!1&&(S.removeCellMeta(O,I,w),s.runHooks("afterRemoveCellMeta",f,m,w,F)),F=null},this.spliceCellsMeta=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;for(var w=arguments.length,O=new Array(w>2?w-2:0),I=2;I<w;I++)O[I-2]=arguments[I];if(O.length>0&&!Array.isArray(O[0]))throw new Error("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.");m>0&&S.removeRow(this.toPhysicalRow(f),m),O.length>0&&M(O.reverse(),F=>{S.createRow(this.toPhysicalRow(f)),M(F,(U,K)=>this.setCellMetaObject(f,K,U))}),s.render()},this.setCellMetaObject=function(f,m,w){typeof w=="object"&&Ue(w,(O,I)=>{this.setCellMeta(f,m,I,O)})},this.setCellMeta=function(f,m,w,O){if(s.runHooks("beforeSetCellMeta",f,m,w,O)===!1)return;let F=f,U=m;f<this.countRows()&&(F=this.toPhysicalRow(f)),m<this.countCols()&&(U=this.toPhysicalColumn(m)),S.setCellMeta(F,U,w,O),s.runHooks("afterSetCellMeta",f,m,w,O)},this.getCellsMeta=function(){return S.getCellsMeta()},this.getCellMeta=function(f,m){let w=this.toPhysicalRow(f),O=this.toPhysicalColumn(m);return w===null&&(w=f),O===null&&(O=m),S.getCellMeta(w,O,{visualRow:f,visualColumn:m})},this.getCellMetaAtRow=function(f){return S.getCellsMetaAtRow(f)},this.isColumnModificationAllowed=function(){return!(s.dataType==="object"||b.columns)},this.getCellRenderer=function(f,m){const w=typeof f=="number"?s.getCellMeta(f,m).renderer:f.renderer;return typeof w=="string"?d0(w):Mt(w)?d0("text"):w},this.getCellEditor=function(f,m){const w=typeof f=="number"?s.getCellMeta(f,m).editor:f.editor;return typeof w=="string"?n0(w):Mt(w)?n0("text"):w},this.getCellValidator=function(f,m){const w=typeof f=="number"?s.getCellMeta(f,m).validator:f.validator;return typeof w=="string"?f2(w):w},this.validateCells=function(f){this._validateCells(f)},this.validateRows=function(f,m){if(!Array.isArray(f))throw new Error("validateRows parameter `rows` must be an array");this._validateCells(m,f)},this.validateColumns=function(f,m){if(!Array.isArray(f))throw new Error("validateColumns parameter `columns` must be an array");this._validateCells(m,void 0,f)},this._validateCells=function(f,m,w){const O=new ne;f&&(O.onQueueEmpty=f);let I=s.countRows()-1;for(;I>=0;){if(m!==void 0&&m.indexOf(I)===-1){I-=1;continue}let F=s.countCols()-1;for(;F>=0;){if(w!==void 0&&w.indexOf(F)===-1){F-=1;continue}O.addValidatorToQueue(),s.validateCell(s.getDataAtCell(I,F),s.getCellMeta(I,F),U=>{if(typeof U!="boolean")throw new Error("Validation error: result is not boolean");U===!1&&(O.valid=!1),O.removeValidatorFormQueue()},"validateCells"),F-=1}I-=1}O.checkIfQueueIsEmpty()},this.getRowHeader=function(f){let m=b.rowHeaders,w=f;return w!==void 0&&(w=s.runHooks("modifyRowHeader",w)),w===void 0?(m=[],me(s.countRows()-1,O=>{m.push(s.getRowHeader(O))})):Array.isArray(m)&&m[w]!==void 0?m=m[w]:Et(m)?m=m(w):m&&typeof m!="string"&&typeof m!="number"&&(m=w+1),m},this.hasRowHeaders=function(){return!!b.rowHeaders},this.hasColHeaders=function(){if(b.colHeaders!==void 0&&b.colHeaders!==null)return!!b.colHeaders;for(let f=0,m=s.countCols();f<m;f++)if(s.getColHeader(f))return!0;return!1},this.getColHeader=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;const w=s.runHooks("modifyColHeader",f);if(w===void 0){const K=[],le=s.countCols();for(let he=0;he<le;he++)K.push(s.getColHeader(he));return K}let O=b.colHeaders;const I=function(K){const le=[],he=s.countCols();let Q=0;for(;Q<he;Q++)Et(b.columns)&&b.columns(Q)&&le.push(Q);return le[K]},F=s.toPhysicalColumn(w),U=I(F);return b.colHeaders===!1?O=null:b.columns&&Et(b.columns)&&b.columns(U)&&b.columns(U).title?O=b.columns(U).title:b.columns&&b.columns[F]&&b.columns[F].title?O=b.columns[F].title:Array.isArray(b.colHeaders)&&b.colHeaders[F]!==void 0?O=b.colHeaders[F]:Et(b.colHeaders)?O=b.colHeaders(F):b.colHeaders&&typeof b.colHeaders!="string"&&typeof b.colHeaders!="number"&&(O=Kj(w)),O=s.runHooks("modifyColumnHeaderValue",O,f,m),O},this._getColWidthFromSettings=function(f){let m;if(f>=0&&(m=s.getCellMeta(0,f).width),(m===void 0||m===b.width)&&(m=b.colWidths),m!=null){switch(typeof m){case"object":m=m[f];break;case"function":m=m(f);break}typeof m=="string"&&(m=parseInt(m,10))}return m},this.getColWidth=function(f){let m=s._getColWidthFromSettings(f);return m=s.runHooks("modifyColWidth",m,f),m===void 0&&(m=Ah.DEFAULT_WIDTH),m},this._getRowHeightFromSettings=function(f){let m=b.rowHeights;if(m!=null){switch(typeof m){case"object":m=m[f];break;case"function":m=m(f);break}typeof m=="string"&&(m=parseInt(m,10))}return m},this.getRowHeight=function(f){let m=s._getRowHeightFromSettings(f);return m=s.runHooks("modifyRowHeight",m,f),m},this.countSourceRows=function(){return l.countRows()},this.countSourceCols=function(){return l.countFirstRowKeys()},this.countRows=function(){return a.getLength()},this.countCols=function(){const f=b.maxCols,m=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(f,m)},this.countRenderedRows=function(){return s.view._wt.drawn?s.view._wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return s.view._wt.drawn?s.view._wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return s.view._wt.drawn?s.view._wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return s.view._wt.drawn?s.view._wt.wtTable.getVisibleColumnsCount():-1},this.countRowHeaders=function(){return this.view.getRowHeadersCount()},this.countColHeaders=function(){return this.view.getColumnHeadersCount()},this.countEmptyRows=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,m=0;return qC(s.countRows()-1,w=>{if(s.isEmptyRow(w))m+=1;else if(f===!0)return!1}),m},this.countEmptyCols=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,m=0;return qC(s.countCols()-1,w=>{if(s.isEmptyCol(w))m+=1;else if(f===!0)return!1}),m},this.isEmptyRow=function(f){return b.isEmptyRow.call(s,f)},this.isEmptyCol=function(f){return b.isEmptyCol.call(s,f)},this.selectCell=function(f,m,w,O){let I=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,F=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;return Mt(f)||Mt(m)?!1:this.selectCells([[f,m,w,O]],I,F)},this.selectCells=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[[]],m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;m===!1&&d.suspend();const O=j.selectCells(f);return O&&w&&s.listen(),d.resume(),O},this.selectColumns=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f,w=arguments.length>2?arguments[2]:void 0;return j.selectColumns(f,m,w)},this.selectRows=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f,w=arguments.length>2?arguments[2]:void 0;return j.selectRows(f,m,w)},this.deselectCell=function(){j.deselect()},this.selectAll=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f,w=arguments.length>2?arguments[2]:void 0;d.skipNextScrollCycle(),j.selectAll(f,m,w)};const we=(f,m)=>f.getNearestNotHiddenIndex(m,1,!0);this.scrollViewportTo=function(f){var m;if(typeof f=="number"){var w;f={row:arguments[0],col:arguments[1],verticalSnap:arguments[2]?"bottom":"top",horizontalSnap:arguments[3]?"end":"start",considerHiddenIndexes:(w=arguments[4])!==null&&w!==void 0?w:!0}}const{row:O,col:I,verticalSnap:F,horizontalSnap:U,considerHiddenIndexes:K}=(m=f)!==null&&m!==void 0?m:{};let le,he,Q,Oe;F!==void 0&&(le=F==="top",he=!le),U!==void 0&&(Q=U==="start",Oe=!Q);let Pe=O,W=I;if(K===void 0||K){const tt=Number.isInteger(O)&&O>=0,Fe=Number.isInteger(I)&&I>=0,Te=tt?we(this.rowIndexMapper,O):void 0,v=Fe?we(this.columnIndexMapper,I):void 0;if(Te===null||v===null)return!1;Pe=tt?s.rowIndexMapper.getRenderableFromVisualIndex(Te):O,W=Fe?s.columnIndexMapper.getRenderableFromVisualIndex(v):I}const Xe=Number.isInteger(Pe),Le=Number.isInteger(W);return Xe&&Pe>=0&&Le&&W>=0?s.view.scrollViewport(s._createCellCoords(Pe,W),le,Oe,he,Q):Xe&&Pe>=0&&(Le&&W<0||!Le)?s.view.scrollViewportVertically(Pe,le,he):Le&&W>=0&&(Xe&&Pe<0||!Xe)?s.view.scrollViewportHorizontally(W,Oe,Q):!1},this.scrollToFocusedCell=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};if(!this.selection.isSelected())return;this.addHookOnce("afterScroll",f);const{highlight:m}=this.getSelectedRangeLast();this.scrollViewportTo(m.toObject())?this.view.render():(this.removeHook("afterScroll",f),this._registerImmediate(()=>f()))},this.destroy=function(){if(s._clearTimeouts(),s._clearImmediates(),s.view&&s.view.destroy(),l&&l.destroy(),l=null,this.getShortcutManager().destroy(),S.clearCache(),aw.delete(this.guid),Ff(s)){const f=this.rootDocument.querySelector(".hot-display-license-info");f&&f.parentNode.removeChild(f)}es(s.rootElement),o.destroy(),c&&c.destroy(),s.batchExecution(()=>{s.rowIndexMapper.unregisterAll(),s.columnIndexMapper.unregisterAll(),E.getItems().forEach(f=>{let[,m]=f;m.destroy()}),E.clear(),s.runHooks("afterDestroy")},!0),ce.getSingleton().destroy(s),Ue(s,(f,m,w)=>{Et(f)?w[m]=pe(m):m!=="guid"&&(w[m]=null)}),s.isDestroyed=!0,a&&a.destroy(),a=null,u=null,j=null,c=null,s=null};function pe(f){return()=>{throw new Error(`The "${f}" method cannot be called because this Handsontable instance has been destroyed`)}}this.getActiveEditor=function(){return c.getActiveEditor()},this.getPlugin=function(f){const m=mr(f);return m==="UndoRedo"?this.undoRedo:E.getItem(m)},this.getPluginName=function(f){return f===this.undoRedo?this.undoRedo.constructor.PLUGIN_KEY:E.getId(f)},this.getInstance=function(){return s},this.addHook=function(f,m,w){ce.getSingleton().add(f,m,s,w)},this.hasHook=function(f){return ce.getSingleton().has(f,s)||ce.getSingleton().has(f)},this.addHookOnce=function(f,m,w){ce.getSingleton().once(f,m,s,w)},this.removeHook=function(f,m){ce.getSingleton().remove(f,m,s)},this.runHooks=function(f,m,w,O,I,F,U){return ce.getSingleton().run(s,f,m,w,O,I,F,U)},this.getTranslatedPhrase=function(f,m){return hO(b.language,f,m)},this.toHTML=()=>u0(this),this.toTableElement=()=>{const f=this.rootDocument.createElement("div");return f.insertAdjacentHTML("afterbegin",u0(this)),f.firstElementChild},this.timeouts=[],this._registerTimeout=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,w=f;typeof w=="function"&&(w=setTimeout(w,m)),this.timeouts.push(w)},this._clearTimeouts=function(){M(this.timeouts,f=>{clearTimeout(f)})},this.immediates=[],this._registerImmediate=function(f){this.immediates.push(setImmediate(f))},this._clearImmediates=function(){M(this.immediates,f=>{clearImmediate(f)})},this._getEditorManager=function(){return c},this.isRtl=function(){return s.rootWindow.getComputedStyle(s.rootElement).direction==="rtl"},this.isLtr=function(){return!s.isRtl()},this.getDirectionFactor=function(){return s.isLtr()?1:-1};const ht=r4({handleEvent(){return s.isListening()},beforeKeyDown:f=>this.runHooks("beforeKeyDown",f),afterKeyDown:f=>{this.isDestroyed||s.runHooks("afterDocumentKeyDown",f)},ownerWindow:this.rootWindow});this.addHook("beforeOnCellMouseDown",f=>{f.ctrlKey===!1&&f.metaKey===!1&&ht.releasePressedKeys()}),this.getShortcutManager=function(){return ht},this.getFocusManager=function(){return h},xP().forEach(f=>{const m=DS(f);E.addItem(f,new m(this))}),VX(s),ht.setActiveContextName("grid"),ce.getSingleton().run(s,"construct")}function iT(t,e,n){t.addEventListener(e,n,!1)}function rT(t,e,n){t.removeEventListener(e,n,!1)}function sT(t){return t.ownerDocument.defaultView.getComputedStyle(t)}function s4(t){const e={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},n=t.body,i=t.createTextNode(""),r=t.createElement("span");let s;function o(){i.textContent=s.value,r.style.position="absolute",r.style.fontSize=sT(s).fontSize,r.style.fontFamily=sT(s).fontFamily,r.style.whiteSpace="pre",n.appendChild(r);const c=r.clientWidth+2;n.removeChild(r);const h=s.style;h.height=`${e.minHeight}px`,e.minWidth>c?h.width=`${e.minWidth}px`:c>e.maxWidth?h.width=`${e.maxWidth}px`:h.width=`${c}px`;const d=s.scrollHeight?s.scrollHeight-1:0;e.minHeight>d?h.height=`${e.minHeight}px`:e.maxHeight<d?(h.height=`${e.maxHeight}px`,h.overflowY="visible"):h.height=`${d}px`}function a(){t.defaultView.setTimeout(o,0)}function l(c){if(c&&c.minHeight)if(c.minHeight==="inherit")e.minHeight=s.clientHeight;else{const h=parseInt(c.minHeight,10);isNaN(h)||(e.minHeight=h)}if(c&&c.maxHeight)if(c.maxHeight==="inherit")e.maxHeight=s.clientHeight;else{const h=parseInt(c.maxHeight,10);isNaN(h)||(e.maxHeight=h)}if(c&&c.minWidth)if(c.minWidth==="inherit")e.minWidth=s.clientWidth;else{const h=parseInt(c.minWidth,10);isNaN(h)||(e.minWidth=h)}if(c&&c.maxWidth)if(c.maxWidth==="inherit")e.maxWidth=s.clientWidth;else{const h=parseInt(c.maxWidth,10);isNaN(h)||(e.maxWidth=h)}r.firstChild||(r.className="autoResize",r.style.display="inline-block",r.appendChild(i))}function u(c,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s=c,l(h),s.nodeName==="TEXTAREA"&&(s.style.resize="none",s.style.height=`${e.minHeight}px`,s.style.minWidth=`${e.minWidth}px`,s.style.maxWidth=`${e.maxWidth}px`,s.style.overflowY="hidden"),d&&(iT(s,"input",o),iT(s,"keydown",a)),o()}return{init:u,resize:o,unObserve(){rT(s,"input",o),rT(s,"keydown",a)}}}function oT(t,e){const n=rP(e),i=e.value.split(`
|
|
`);let r=n,s=0;for(let o=0;o<i.length;o++){const a=i[o];o!==0&&(s+=i[o-1].length+1);const l=s+a.length;if(t==="home"?r=s:t==="end"&&(r=l),n<=l)break}gm(e,r)}function Qo(t,e,n){return e=o4(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o4(t){var e=a4(t,"string");return typeof e=="symbol"?e:e+""}function a4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const l4="ht_editor_visible",$d="ht_editor_hidden",aT="textEditor",u4="text";class qa extends pu{static get EDITOR_TYPE(){return u4}constructor(e){super(e),Qo(this,"eventManager",new wr(this)),Qo(this,"autoResize",s4(this.hot.rootDocument)),Qo(this,"TEXTAREA",void 0),Qo(this,"textareaStyle",void 0),Qo(this,"TEXTAREA_PARENT",void 0),Qo(this,"textareaParentStyle",void 0),Qo(this,"layerClass",void 0),this.eventManager=new wr(this),this.createElements(),this.bindEvents(),this.hot.addHookOnce("afterDestroy",()=>this.destroy())}getValue(){return this.TEXTAREA.value}setValue(e){this.TEXTAREA.value=e}open(){this.refreshDimensions(),this.showEditableElement(),this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this.autoResize.unObserve(),BU(this.hot.rootDocument.activeElement,this.hot.rootElement)&&this.hot.listen(),this.hideEditableElement(),this.unregisterShortcuts()}prepare(e,n,i,r,s,o){const a=this.state;if(super.prepare(e,n,i,r,s,o),!o.readOnly){this.refreshDimensions(!0);const{allowInvalid:l}=o;l&&!this.isOpened()&&(this.TEXTAREA.value=""),a!==jt.FINISHED&&!this.isOpened()&&this.hideEditableElement()}}beginEditing(e,n){this.state===jt.VIRGIN&&(this.TEXTAREA.value="",super.beginEditing(e,n))}focus(){this.TEXTAREA.select(),gm(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(){const{rootDocument:e}=this.hot;this.TEXTAREA=e.createElement("TEXTAREA"),Ee(this.TEXTAREA,[["data-hot-input",""],du(-1)]),this.hot.getSettings().ariaTags&&Ee(this.TEXTAREA,[Us()]),q(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.textareaStyle.overflowY="visible",this.TEXTAREA_PARENT=e.createElement("DIV"),q(this.TEXTAREA_PARENT,"handsontableInputHolder"),_e(this.TEXTAREA_PARENT,this.layerClass)&&He(this.TEXTAREA_PARENT,this.layerClass),q(this.TEXTAREA_PARENT,$d),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){RY()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",He(this.TEXTAREA_PARENT,this.layerClass),q(this.TEXTAREA_PARENT,$d)}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;me(e.length-1,i=>{const r=e[i];if(_e(r,"handsontableEditor"))return n=!0,!1}),_e(this.TEXTAREA_PARENT,$d)&&He(this.TEXTAREA_PARENT,$d),n?(this.layerClass=l4,q(this.TEXTAREA_PARENT,this.layerClass)):(this.layerClass=this.getEditedCellsLayerClass(),q(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!==jt.EDITING&&!e)return;if(this.TD=this.getEditedCell(),!this.TD){e||this.close();return}const{top:n,start:i,width:r,maxWidth:s,height:o,maxHeight:a}=this.getEditedCellRect();this.textareaParentStyle.top=`${n}px`,this.textareaParentStyle[this.hot.isRtl()?"right":"left"]=`${i}px`,this.showEditableElement();const l=xo(this.TD,this.hot.rootWindow);this.TEXTAREA.style.fontSize=l.fontSize,this.TEXTAREA.style.fontFamily=l.fontFamily,this.TEXTAREA.style.backgroundColor=this.TD.style.backgroundColor;const u=xo(this.TEXTAREA),c=parseInt(u.paddingLeft,10)+parseInt(u.paddingRight,10),h=parseInt(u.paddingTop,10)+parseInt(u.paddingBottom,10),d=r-c,g=o-h,p=s-c,C=a-h;this.autoResize.init(this.TEXTAREA,{minWidth:Math.min(d,p),minHeight:Math.min(g,C),maxWidth:p,maxHeight:C},!0)}bindEvents(){wP()&&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===jt.EDITING&&this.focus()}),this.addHook("afterRowResize",()=>{this.refreshDimensions(),this.state===jt.EDITING&&this.focus()})}allowKeyEventPropagation(){}destroy(){this.eventManager.destroy(),this.clearHooks()}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor"),i={runOnlyIf:()=>de(this.hot.getSelected()),group:aT},r=()=>{this.hot.rootDocument.execCommand("insertText",!1,`
|
|
`)};n.addShortcuts([{keys:[["Control","Enter"]],callback:()=>(r(),!1),runOnlyIf:s=>!this.hot.selection.isMultiple()&&!s.altKey},{keys:[["Meta","Enter"]],callback:()=>(r(),!1),runOnlyIf:()=>!this.hot.selection.isMultiple()},{keys:[["Alt","Enter"]],callback:()=>(r(),!1)},{keys:[["Home"]],callback:(s,o)=>{let[a]=o;oT(a,this.TEXTAREA)}},{keys:[["End"]],callback:(s,o)=>{let[a]=o;oT(a,this.TEXTAREA)}}],i)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(aT)}}const c4="base";function $h(t,e,n,i,r,s,o){const a=o.ariaTags,l=[],u=[],c=[],h=[];o.className&&q(e,o.className),o.readOnly?(l.push(o.readOnlyCellClassName),a&&h.push(kE())):a&&c.push(kE()[0]),o.valid===!1&&o.invalidCellClassName?(l.push(o.invalidCellClassName),a&&h.push(FE())):(u.push(o.invalidCellClassName),a&&c.push(FE()[0])),o.wordWrap===!1&&o.noWordWrapClassName&&l.push(o.noWordWrapClassName),!s&&o.placeholder&&l.push(o.placeholderCellClassName),He(e,u),q(e,l),fu(e,c),Ee(e,h)}$h.RENDERER_TYPE=c4;const h4="text";function js(t,e,n,i,r,s,o){$h.apply(this,[t,e,n,i,r,s,o]);let a=s;if(!a&&o.placeholder&&(a=o.placeholder),a=Qt(a),o.trimWhitespace&&(a=a.trim()),o.rendererTemplate){es(e);const l=t.rootDocument.createElement("TEMPLATE");l.setAttribute("bind","{{}}"),l.innerHTML=o.rendererTemplate,HTMLTemplateElement.decorate(l),l.model=t.getSourceDataAtRow(n),e.appendChild(l)}else Ha(e,a)}js.RENDERER_TYPE=h4;const d4="text",MO={CELL_TYPE:d4,editor:qa,renderer:js};tr(MO);ls.editors={BaseEditor:pu};function ls(t,e){const n=new TO(t,e||{},JS);return n.init(),n}ls.Core=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new TO(t,e,JS)};ls.DefaultSettings=CO();ls.hooks=ce.getSingleton();ls.CellCoords=La;ls.CellRange=Hh;ls.packageName="handsontable";ls.buildDate="11/06/2024 09:51:42";ls.version="14.4.0";ls.languages={dictionaryKeys:_K,getLanguageDictionary:cO,getLanguagesDictionaries:AK,registerLanguageDictionary:uO,getTranslatedPhrase:hO};const lT="handsontableEditor",f4="handsontable";class Ob extends qa{static get EDITOR_TYPE(){return f4}open(){super.open(),this.htEditor&&this.htEditor.destroy(),this.htContainer.style.display==="none"&&(this.htContainer.style.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(),gm(this.TEXTAREA,0,this.TEXTAREA.value.length),this.refreshDimensions()}close(){this.htEditor&&(this.htEditor.rootElement.style.display="none"),this.removeHooksByKey("beforeKeyDown"),super.close()}prepare(e,n,i,r,s,o){super.prepare(e,n,i,r,s,o);const a=this,l={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,afterOnCellMouseDown(u,c){const h=this.getSourceData(c.row,c.col);h!==void 0&&a.setValue(h),a.hot.destroyEditor()},preventWheel:!0,layoutDirection:this.hot.isRtl()?"rtl":"ltr"};this.cellProperties.handsontable&&tn(l,o.handsontable),this.htOptions=l}beginEditing(e,n){const i=this.hot.getSettings().onBeginEditing;i&&i()===!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,i){if(this.htEditor&&this.htEditor.isListening()&&this.hot.listen(),this.htEditor&&this.htEditor.getSelectedLast()){const r=this.htEditor.getValue();r!==void 0&&this.setValue(r)}super.finishEditing(e,n,i)}assignHooks(){this.hot.addHook("afterDestroy",()=>{this.htEditor&&this.htEditor.destroy()})}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor");super.registerShortcuts();const i={group:lT,relativeToGroup:ko,position:"before"},r=(s,o)=>{const a=this.htEditor;if(s!==void 0&&(s<0||a.flipped&&s>a.countRows()-1?a.deselectCell():a.selectCell(s,0),a.getData().length))return o.preventDefault(),yr(o),this.hot.listen(),this.TEXTAREA.focus(),!1};n.addShortcuts([{keys:[["ArrowUp"]],callback:s=>{const o=this.htEditor;let a,l;return!o.getSelectedLast()&&o.flipped?a=o.countRows()-1:o.getSelectedLast()&&(o.flipped?(l=o.getSelectedLast()[0],a=Math.max(0,l-1)):(l=o.getSelectedLast()[0],a=l-1)),r(a,s)},preventDefault:!1},{keys:[["ArrowDown"]],callback:s=>{const o=this.htEditor;let a,l;if(!o.getSelectedLast()&&!o.flipped)a=0;else if(o.getSelectedLast()){if(o.flipped)a=o.getSelectedLast()[0]+1;else if(!o.flipped){const u=o.countRows()-1;l=o.getSelectedLast()[0],a=Math.min(u,l+1)}}return r(a,s)},preventDefault:!1}],i)}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(lT)}}function g4(t,e,n){m4(t,e),e.set(t,n)}function m4(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kd(t,e,n){return e=p4(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p4(t){var e=w4(t,"string");return typeof e=="symbol"?e:e+""}function w4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function uT(t,e){return t.get(C4(t,e))}function C4(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 v4="autocomplete";var lw=new WeakMap;class xb extends Ob{constructor(){super(...arguments),kd(this,"query",null),kd(this,"strippedChoices",[]),kd(this,"rawChoices",[]),g4(this,lw,this.hot.guid.slice(0,9)),kd(this,"sortByRelevance",function(e,n,i){const r=[],s=[],o=e.length;let a=n.length,l,u,c,h;if(o===0){for(c=0;c<a;c++)s.push(c);return s}for(c=0;c<a;c++){if(u=$E(Qt(n[c])),i)h=u.indexOf(e);else{const d=this.cellProperties.locale;h=u.toLocaleLowerCase(d).indexOf(e.toLocaleLowerCase(d))}h!==-1&&(l=u.length-h-o,r.push({baseIndex:c,index:h,charsLeft:l,value:u}))}for(r.sort((d,g)=>{if(g.index===-1)return-1;if(d.index===-1)return 1;if(d.index<g.index)return-1;if(g.index<d.index)return 1;if(d.index===g.index){if(d.charsLeft<g.charsLeft)return-1;if(d.charsLeft>g.charsLeft)return 1}return 0}),c=0,a=r.length;c<a;c++)s.push(r[c].baseIndex);return s})}static get EDITOR_TYPE(){return v4}getValue(){const e=this.rawChoices.find(n=>this.stripValueIfNeeded(n)===this.TEXTAREA.value);return de(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),q(this.htContainer,"autocompleteEditor"),q(this.htContainer,this.hot.rootWindow.navigator.platform.indexOf("Mac")===-1?"":"htMacScroll"),this.hot.getSettings().ariaTags&&Ee(this.TEXTAREA,[PU(),EU(),XI("listbox"),NU()])}prepare(e,n,i,r,s,o){super.prepare(e,n,i,r,s,o),this.hot.getSettings().ariaTags&&Ee(this.TEXTAREA,[ki("false"),DU(`${uT(lw,this)}-listbox-${e}-${n}`)])}open(){super.open();const e=this.cellProperties.trimDropdown===void 0?!0:this.cellProperties.trimDropdown,n=this.hot.getSettings().ariaTags,i=Array.isArray(this.cellProperties.source)?this.cellProperties.source:null,r=i?.length,{row:s,col:o}=this;this.showEditableElement(),this.focus();let a=wn();a===0&&UC()&&(a+=15),this.addHook("beforeKeyDown",l=>this.onBeforeKeyDown(l)),this.htEditor.updateSettings({colWidths:e?[Ct(this.TEXTAREA)-2]:void 0,width:e?Ct(this.TEXTAREA)+a:void 0,autoColumnSize:!0,renderer:(l,u,c,h,d,g,p)=>{js(l,u,c,h,d,g,p);const{filteringCaseSensitive:C,allowHtml:S,locale:b}=this.cellProperties,R=this.query;let E=Qt(g),H,P;E&&!S&&(H=C===!0?E.indexOf(R):E.toLocaleLowerCase(b).indexOf(R.toLocaleLowerCase(b)),H!==-1&&(P=E.substr(H,R.length),E=E.replace(P,`<strong>${P}</strong>`))),n&&Ee(u,[TU(),...i?[FU(r)]:[],...i?[VU(i.indexOf(g)+1)]:[],["id",`${this.htEditor.rootElement.id}_${c}-${h}`]]),u.innerHTML=E},afterSelectionEnd:(l,u)=>{if(n){const c=this.htEditor.getCell(l,u,!0);Ee(c,[SS()]),Ee(this.TEXTAREA,...LU(c.id))}}}),n&&(Ee(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...qr()),Ee(this.htEditor.rootElement,[KI(),$U("polite"),kU("text"),["id",`${uT(lw,this)}-listbox-${s}-${o}`]]),Ee(this.TEXTAREA,...ki("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&Ee(this.TEXTAREA,[ki("false")])}discardEditor(e){super.discardEditor(e),this.hot.view.render()}queryChoices(e){const n=this.cellProperties.source;this.query=e,typeof n=="function"?n.call(this.cellProperties,e,i=>{this.rawChoices=i,this.updateChoicesList(this.stripValuesIfNeeded(i))}):Array.isArray(n)?(this.rawChoices=n,this.updateChoicesList(this.stripValuesIfNeeded(n))):this.updateChoicesList([])}updateChoicesList(e){const n=rP(this.TEXTAREA),i=KU(this.TEXTAREA),r=this.cellProperties.sortByRelevance,s=this.cellProperties.filter;let o=null,a=null,l=e;r&&(o=this.sortByRelevance(this.stripValueIfNeeded(this.getValue()),l,this.cellProperties.filteringCaseSensitive));const u=Array.isArray(o)?o.length:0;if(s===!1)u&&(a=o[0]);else{const c=[];for(let h=0,d=l.length;h<d&&!(r&&u<=h);h++)u?c.push(l[o[h]]):c.push(l[h]);a=0,l=c}this.strippedChoices=l,l.length===0?this.htEditor.rootElement.style.display="none":this.htEditor.rootElement.style.display="",this.htEditor.loadData(Lf([l])),l.length>0&&(this.updateDropdownDimensions(),this.flipDropdownIfNeeded(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(a)),this.hot.listen(),gm(this.TEXTAREA,n,n===i?void 0:i)}flipDropdownIfNeeded(){const e=ru(this.hot.view._wt.wtTable.TABLE),n=e===this.hot.rootWindow,i=this.cellProperties.preventOverflow;if(n||!n&&(i||i==="horizontal"))return!1;const r=pn(this.TEXTAREA),s=Yt(this.TEXTAREA),o=this.getDropdownHeight(),a=e.scrollTop,l=Yt(this.hot.view._wt.wtTable.THEAD),u=pn(e),c=r.top-u.top-l+a,h=e.scrollHeight-c-l-s,d=o>h&&c>h;return d?this.flipDropdown(o):this.unflipDropdown(),this.limitDropdownIfNeeded(d?c:h,o),d}limitDropdownIfNeeded(e,n){if(n>e){let i=0,r=0,s=0,o=null;do s=this.htEditor.getRowHeight(r)||this.htEditor.view._wt.getSetting("defaultRowHeight"),i+=s,r+=1;while(i<e);o=i-s,this.htEditor.flipped&&(this.htEditor.rootElement.style.top=`${parseInt(this.htEditor.rootElement.style.top,10)+n-o}px`),this.setDropdownHeight(i-s)}}flipDropdown(e){const n=this.htEditor.rootElement.style;n.position="absolute",n.top=`${-e}px`,this.htEditor.flipped=!0}unflipDropdown(){const e=this.htEditor.rootElement.style;e.position="absolute",e.top="",this.htEditor.flipped=void 0}updateDropdownDimensions(){const e=this.htEditor.getColWidth(0)+wn(this.hot.rootDocument)+2,n=this.cellProperties.trimDropdown;this.htEditor.updateSettings({height:this.getDropdownHeight(),width:n?void 0:e}),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}setDropdownHeight(e){this.htEditor.updateSettings({height:e})}highlightBestMatchingChoice(e){typeof e=="number"?this.htEditor.selectCell(e,0,void 0,void 0,void 0,!1):this.htEditor.deselectCell()}getDropdownHeight(){const e=this.htEditor.getRowHeight(0)||23,n=this.cellProperties.visibleRows;return this.strippedChoices.length>=n?n*e:this.strippedChoices.length*e+8}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:n}=this.cellProperties,i=Ke(e,s=>Qt(s));return Ke(i,s=>n?s:$E(s))}allowKeyEventPropagation(e){const n=this.htEditor.getSelectedRangeLast(),i={row:n?n.from.row:-1};let r=!1;return e===Se.ARROW_DOWN&&i.row>0&&i.row<this.htEditor.countRows()-1&&(r=!0),e===Se.ARROW_UP&&i.row>-1&&(r=!0),r}onBeforeKeyDown(e){if(TY(e.keyCode)||e.keyCode===Se.BACKSPACE||e.keyCode===Se.DELETE||e.keyCode===Se.INSERT){let n=10;if(e.keyCode===Se.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(n+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},n)}}}const S4="checkbox";class _O extends pu{static get EDITOR_TYPE(){return S4}beginEditing(e,n){if(n&&n.type==="mouseup"&&n.target.nodeName==="TD"){const i=this.TD.querySelector('input[type="checkbox"]');_e(i,"htBadValue")||i.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}/*!
|
|
* Pikaday
|
|
*
|
|
* Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday
|
|
*/const Ro=()=>window,Hi=()=>window.document,rv=(t,e)=>window.setTimeout(t,e),Vr=function(t,e,n,i){t.addEventListener(e,n,!!i)},ps=function(t,e,n,i){t.removeEventListener(e,n,!!i)},y4=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},li=function(t,e){return(" "+t.className+" ").indexOf(" "+e+" ")!==-1},uw=function(t,e){li(t,e)||(t.className=t.className===""?e:t.className+" "+e)},cw=function(t,e){t.className=y4((" "+t.className+" ").replace(" "+e+" "," "))},Ab=function(t){return/Array/.test(Object.prototype.toString.call(t))},di=function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())},b4=function(t){let e=t.getDay();return e===0||e===6},R4=function(t){return t%4===0&&t%100!==0||t%400===0},cT=function(t,e){return[31,R4(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},Fd=function(t){di(t)&&t.setHours(0,0,0,0)},Vd=function(t,e){return t.getTime()===e.getTime()},Cg=function(t,e,n){let i,r;for(i in e)r=t[i]!==void 0,r&&typeof e[i]=="object"&&e[i]!==null&&e[i].nodeName===void 0?di(e[i])?n&&(t[i]=new Date(e[i].getTime())):Ab(e[i])?n&&(t[i]=e[i].slice(0)):t[i]=Cg({},e[i],n):(n||!r)&&(t[i]=e[i]);return t},hT=function(t,e,n){let i=Hi().createEvent("HTMLEvents");i.initEvent(e,!0,!1),i=Cg(i,n),t.dispatchEvent(i)},dT=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},Pr={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},fT=function(t,e,n){for(e+=t.firstDay;e>=7;)e-=7;return n?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},E4=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>"},T4=function(t,e){t.setHours(0,0,0,0);let n=t.getDate(),i=t.getDay(),r=e,s=r-1,o=7,a=function(d){return(d+o-1)%o};t.setDate(n+s-a(i));let l=new Date(t.getFullYear(),0,r),u=24*60*60*1e3,c=(t.getTime()-l.getTime())/u;return 1+Math.round((c-s+a(l.getDay()))/o)},M4=function(t,e,n,i,r){let s=new Date(i,n,e);return'<td class="pika-week">'+(t.hasMoment?t.moment(s).isoWeek():T4(s,r))+"</td>"},_4=function(t,e,n,i){return'<tr class="pika-row'+(n?" pick-whole-week":"")+(i?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"},I4=function(t){return"<tbody>"+t.join("")+"</tbody>"},P4=function(t){let e,n=[];for(t.showWeekNumber&&n.push("<th></th>"),e=0;e<7;e++)n.push('<th scope="col"><abbr title="'+fT(t,e)+'">'+fT(t,e,!0)+"</abbr></th>");return"<thead><tr>"+(t.isRTL?n.reverse():n).join("")+"</tr></thead>"},O4=function(t,e,n,i,r,s){let o,a,l,u=t._o,c=n===u.minYear,h=n===u.maxYear,d='<div id="'+s+'" class="pika-title" role="heading" aria-live="polite">',g,p,C=!0,S=!0;for(l=[],o=0;o<12;o++)l.push('<option value="'+(n===r?o-e:12+o-e)+'"'+(o===i?' selected="selected"':"")+(c&&o<u.minMonth||h&&o>u.maxMonth?' disabled="disabled"':"")+">"+u.i18n.months[o]+"</option>");for(g='<div class="pika-label">'+u.i18n.months[i]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",Ab(u.yearRange)?(o=u.yearRange[0],a=u.yearRange[1]+1):(o=n-u.yearRange,a=1+n+u.yearRange),l=[];o<a&&o<=u.maxYear;o++)o>=u.minYear&&l.push('<option value="'+o+'"'+(o===n?' selected="selected"':"")+">"+o+"</option>");return p='<div class="pika-label">'+n+u.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",u.showMonthAfterYear?d+=p+g:d+=g+p,c&&(i===0||u.minMonth>=i)&&(C=!1),h&&(i===11||u.maxMonth<=i)&&(S=!1),e===0&&(d+='<button class="pika-prev'+(C?"":" is-disabled")+'" type="button">'+u.i18n.previousMonth+"</button>"),e===t._o.numberOfMonths-1&&(d+='<button class="pika-next'+(S?"":" is-disabled")+'" type="button">'+u.i18n.nextMonth+"</button>"),d+="</div>"},x4=function(t,e,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+P4(t)+I4(e)+"</table>"};function sv(t){let e=this,n=e.config(t);e._onMouseDown=function(r){if(!e._v)return;r=r||Ro().event;let s=r.target||r.srcElement;if(s)if(li(s,"is-disabled")||(li(s,"pika-button")&&!li(s,"is-empty")&&!li(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&&rv(function(){e.hide(),n.blurFieldOnSelect&&n.field&&n.field.blur()},100)):li(s,"pika-prev")?e.prevMonth():li(s,"pika-next")&&e.nextMonth()),li(s,"pika-select"))e._c=!0;else if(r.preventDefault)r.preventDefault();else return r.returnValue=!1,!1},e._onChange=function(r){r=r||Ro().event;let s=r.target||r.srcElement;s&&(li(s,"pika-select-month")?e.gotoMonth(s.value):li(s,"pika-select-year")&&e.gotoYear(s.value))},e._onKeyChange=function(r){if(r=r||Ro().event,e.isVisible())switch(r.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 r=this.moment(n.field.value,n.format,n.formatStrict);return r&&r.isValid()?r.toDate():null}else return new Date(Date.parse(n.field.value))},e._onInputChange=function(r){let s;r.firedBy!==e&&(s=e._parseFieldValue(),di(s)&&e.setDate(s),e._v||e.show())},e._onInputFocus=function(){e.show()},e._onInputClick=function(){e.show()},e._onInputBlur=function(){let r=Hi().activeElement;do if(li(r,"pika-single"))return;while(r=r.parentNode);e._c||(e._b=rv(function(){e.hide()},50)),e._c=!1},e._onClick=function(r){r=r||Ro().event;let s=r.target||r.srcElement,o=s;if(s){!hasEventListeners&&li(s,"pika-select")&&(s.onchange||(s.setAttribute("onchange","return;"),Vr(s,"change",e._onChange)));do if(li(o,"pika-single")||o===n.trigger)return;while(o=o.parentNode);e._v&&s!==n.trigger&&o!==n.trigger&&e.hide()}},e.el=Hi().createElement("div"),e.el.className="pika-single"+(n.isRTL?" is-rtl":"")+(n.theme?" "+n.theme:""),Vr(e.el,"mousedown",e._onMouseDown,!0),Vr(e.el,"touchend",e._onMouseDown,!0),Vr(e.el,"change",e._onChange),n.keyboardInput&&Vr(Hi(),"keydown",e._onKeyChange),n.field&&(n.container?n.container.appendChild(e.el):n.bound?Hi().body.appendChild(e.el):n.field.parentNode.insertBefore(e.el,n.field.nextSibling),Vr(n.field,"change",e._onInputChange),n.defaultDate||(n.defaultDate=e._parseFieldValue(),n.setDefaultDate=!0));let i=n.defaultDate;di(i)?n.setDefaultDate?e.setDate(i,!0):e.gotoDate(i):e.gotoDate(new Date),n.bound?(this.hide(),e.el.className+=" is-bound",Vr(n.trigger,"click",e._onInputClick),Vr(n.trigger,"focus",e._onInputFocus),Vr(n.trigger,"blur",e._onInputBlur)):this.show()}sv.prototype={config:function(t){this._o||(this._o=Cg({},Pr,!0));let e=Cg(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,di(e.minDate)||(e.minDate=!1),di(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),Ab(e.yearRange)){let i=new Date().getFullYear()-10;e.yearRange[0]=parseInt(e.yearRange[0],10)||i,e.yearRange[1]=parseInt(e.yearRange[1],10)||i}else e.yearRange=Math.abs(parseInt(e.yearRange,10))||Pr.yearRange,e.yearRange>100&&(e.yearRange=100);return e},toString:function(t){return t=t||this._o.format,di(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 di(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="",hT(this._o.field,"change",{firedBy:this})),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!di(t))return;let n=this._o.minDate,i=this._o.maxDate;di(n)&&t<n?t=n:di(i)&&t>i&&(t=i),this._d=new Date(t.getTime()),Fd(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),hT(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(di(t)){if(this.calendars){let n=new Date(this.calendars[0].year,this.calendars[0].month,1),i=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),r=t.getTime();i.setMonth(i.getMonth()+1),i.setDate(i.getDate()-1),e=r<n.getTime()||i.getTime()<r}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,i=parseInt(e)*24*60*60*1e3,r;t==="add"?r=new Date(n.valueOf()+i):t==="subtract"&&(r=new Date(n.valueOf()-i)),this.setDate(r)},adjustCalendars:function(){this.calendars[0]=dT(this.calendars[0]);for(let t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=dT({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?(Fd(t),this._o.minDate=t,this._o.minYear=t.getFullYear(),this._o.minMonth=t.getMonth()):(this._o.minDate=Pr.minDate,this._o.minYear=Pr.minYear,this._o.minMonth=Pr.minMonth,this._o.startRange=Pr.startRange),this.draw()},setMaxDate:function(t){t instanceof Date?(Fd(t),this._o.maxDate=t,this._o.maxYear=t.getFullYear(),this._o.maxMonth=t.getMonth()):(this._o.maxDate=Pr.maxDate,this._o.maxYear=Pr.maxYear,this._o.maxMonth=Pr.maxMonth,this._o.endRange=Pr.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,i=e.maxYear,r=e.minMonth,s=e.maxMonth,o="",a;this._y<=n&&(this._y=n,!isNaN(r)&&this._m<r&&(this._m=r)),this._y>=i&&(this._y=i,!isNaN(s)&&this._m>s&&(this._m=s));for(let l=0;l<e.numberOfMonths;l++)a="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2),o+='<div class="pika-lendar">'+O4(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year,a)+this.render(this.calendars[l].year,this.calendars[l].month,a)+"</div>";this.el.innerHTML=o,e.bound&&e.field.type!=="hidden"&&rv(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,i,r,s,o,a,l,u,c;this._o.container||(this.el.style.position="absolute",t=this._o.trigger,e=this.el.offsetWidth,n=this.el.offsetHeight,i=Ro().innerWidth||Hi().documentElement.clientWidth,r=Ro().innerHeight||Hi().documentElement.clientHeight,s=Hi().body.scrollTop||Hi().documentElement.scrollTop,u=!0,c=!0,l=t.getBoundingClientRect(),o=l.left+Ro().pageXOffset,a=l.bottom+Ro().pageYOffset,(this._o.reposition&&o+e>i||this._o.position.indexOf("right")>-1&&o-e+t.offsetWidth>0)&&(o=o-e+t.offsetWidth,u=!1),(this._o.reposition&&a+n>r+s||this._o.position.indexOf("top")>-1&&a-n-t.offsetHeight>0)&&(a=a-n-t.offsetHeight,c=!1),o<0&&(o=0),a<0&&(a=0),this.el.style.left=o+"px",this.el.style.top=a+"px",uw(this.el,u?"left-aligned":"right-aligned"),uw(this.el,c?"bottom-aligned":"top-aligned"),cw(this.el,u?"right-aligned":"left-aligned"),cw(this.el,c?"top-aligned":"bottom-aligned"))},render:function(t,e,n){let i=this._o,r=new Date,s=cT(t,e),o=new Date(t,e,1).getDay(),a=[],l=[];Fd(r),i.firstDay>0&&(o-=i.firstDay,o<0&&(o+=7));let u=e===0?11:e-1,c=e===11?0:e+1,h=e===0?t-1:t,d=e===11?t+1:t,g=cT(h,u),p=s+o,C=p;for(;C>7;)C-=7;p+=7-C;let S=!1;for(let b=0,R=0;b<p;b++){let E=new Date(t,e,1+(b-o)),H=di(this._d)?Vd(E,this._d):!1,P=Vd(E,r),B=i.events.indexOf(E.toDateString())!==-1,Y=b<o||b>=s+o,j=1+(b-o),z=e,G=t,Z=i.startRange&&Vd(i.startRange,E),ne=i.endRange&&Vd(i.endRange,E),ie=i.startRange&&i.endRange&&i.startRange<E&&E<i.endRange,Ce=i.minDate&&E<i.minDate||i.maxDate&&E>i.maxDate||i.disableWeekends&&b4(E)||i.disableDayFn&&i.disableDayFn(E);Y&&(b<o?(j=g+j,z=u,G=h):(j=j-s,z=c,G=d));let Me={day:j,month:z,year:G,hasEvent:B,isSelected:H,isToday:P,isDisabled:Ce,isEmpty:Y,isStartRange:Z,isEndRange:ne,isInRange:ie,showDaysInNextAndPreviousMonths:i.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:i.enableSelectionDaysInNextAndPreviousMonths};i.pickWholeWeek&&H&&(S=!0),l.push(E4(Me)),++R===7&&(i.showWeekNumber&&l.unshift(M4(this,b-o,e,t,i.firstWeekOfYearMinDays)),a.push(_4(l,i.isRTL,i.pickWholeWeek,S)),l=[],R=0,S=!1)}return x4(i,a,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),cw(this.el,"is-hidden"),this._o.bound&&(Vr(Hi(),"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&&ps(Hi(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),uw(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(),ps(this.el,"mousedown",this._onMouseDown,!0),ps(this.el,"touchend",this._onMouseDown,!0),ps(this.el,"change",this._onChange),t.keyboardInput&&ps(Hi(),"keydown",this._onKeyChange),t.field&&(ps(t.field,"change",this._onInputChange),t.bound&&(ps(t.trigger,"click",this._onInputClick),ps(t.trigger,"focus",this._onInputFocus),ps(t.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};function hw(t,e,n){return e=A4(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A4(t){var e=H4(t,"string");return typeof e=="symbol"?e:e+""}function H4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const IO="date",gT="dateEditor";class PO extends qa{constructor(){super(...arguments),hw(this,"defaultDateFormat","DD/MM/YYYY"),hw(this,"parentDestroyed",!1),hw(this,"$datePicker",null)}static get EDITOR_TYPE(){return IO}init(){if(typeof X!="function")throw new Error("You need to include moment.js to your project.");if(typeof sv!="function")throw new Error("You need to include Pikaday to your project.");super.init(),this.hot.addHook("afterDestroy",()=>{this.parentDestroyed=!0,this.destroyElements()})}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"),q(this.datePicker,"htDatepickerHolder"),this.hot.rootDocument.body.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",e=>{_e(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,i,r,s,o){super.prepare(e,n,i,r,s,o)}open(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const i=this.hot.getShortcutManager().getContext("editor");this.showDatepicker(e),super.open(),i.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:gT})}close(){var e;this._opened=!1,(e=this.$datePicker)!==null&&e!==void 0&&e.destroy&&this.$datePicker.destroy(),this.hot._registerTimeout(()=>{const r=this.hot._getEditorManager();r.closeEditor(),this.hot.view.render(),r.prepareEditor()}),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(gT),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=this.cellProperties.dateFormat||this.defaultDateFormat,i=this.hot.view.isMouseDown(),r=e?vP(e.keyCode):!1;let s;this.datePicker.style.display="block",this.$datePicker=new sv(this.getDatePickerConfig()),typeof this.$datePicker.useMoment=="function"&&this.$datePicker.useMoment(X),this.$datePicker._onInputFocus=function(){},this.originalValue?(s=this.originalValue,X(s,n,!0).isValid()&&this.$datePicker.setMoment(X(s,n),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),!r&&!i&&this.setValue("")):this.cellProperties.defaultDate?(s=this.cellProperties.defaultDate,X(s,n,!0).isValid()&&this.$datePicker.setMoment(X(s,n),!0),!r&&!i&&this.setValue("")):this.$datePicker.gotoToday()}hideDatepicker(){this.datePickerStyle.display="none",this.$datePicker.hide()}getDatePickerConfig(){const e=this.TEXTAREA,n={};this.cellProperties&&this.cellProperties.datePickerConfig&&pm(n,this.cellProperties.datePickerConfig);const i=n.onSelect,r=n.onClose;return n.field=e,n.trigger=e,n.container=this.datePicker,n.bound=!1,n.keyboardInput=!1,n.format=n.format||this.defaultDateFormat,n.reposition=n.reposition||!1,n.isRTL=!1,n.onSelect=s=>{let o=s;isNaN(o.getTime())||(o=X(o).format(this.cellProperties.dateFormat||this.defaultDateFormat)),this.setValue(o),i&&i()},n.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),r&&r()},n}refreshDimensions(e){var n;if(super.refreshDimensions(e),this.state!==jt.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.hideDatepicker();return}const{rowIndexMapper:i,columnIndexMapper:r}=this.hot,{wtOverlays:s}=this.hot.view._wt,{wtTable:o}=(n=s.getParentOverlay(this.TD))!==null&&n!==void 0?n:this.hot.view._wt,a=i.getVisualFromRenderableIndex(o.getFirstPartiallyVisibleRow()),l=i.getVisualFromRenderableIndex(o.getLastPartiallyVisibleRow()),u=r.getVisualFromRenderableIndex(o.getFirstPartiallyVisibleColumn()),c=r.getVisualFromRenderableIndex(o.getLastPartiallyVisibleColumn());if(this.row>=a&&this.row<=l&&this.col>=u&&this.col<=c){const h=this.TD.getBoundingClientRect();this.datePickerStyle.top=`${this.hot.rootWindow.pageYOffset+h.top+Yt(this.TD)}px`;let d=this.hot.rootWindow.pageXOffset;this.hot.isRtl()?d+=h.right-Ct(this.datePicker):d+=h.left,this.datePickerStyle.left=`${d}px`}else this.hideDatepicker()}}const N4="dropdown";class Hb extends xb{static get EDITOR_TYPE(){return N4}prepare(e,n,i,r,s,o){super.prepare(e,n,i,r,s,o),this.cellProperties.filter=!1,this.cellProperties.strict=!0}}ce.getSingleton().add("beforeValidate",function(t,e,n){const i=this.propToCol(n);if(Number.isInteger(i)){const r=this.getCellMeta(e,i);r.editor===Hb&&r.strict===void 0&&(r.filter=!1,r.strict=!0)}});const D4="numeric";class OO extends qa{static get EDITOR_TYPE(){return D4}}const L4="password";class xO extends qa{static get EDITOR_TYPE(){return L4}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,this.hot.getSettings().ariaTags&&Ee(this.TEXTAREA,[Us()]),es(this.TEXTAREA_PARENT),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}const dw="ht_editor_visible",mT="selectEditor",$4="select";class AO extends pu{static get EDITOR_TYPE(){return $4}init(){this.select=this.hot.rootDocument.createElement("select"),this.select.setAttribute("data-hot-input","true"),this.select.style.display="none",q(this.select,"htSelectEditor"),this.hot.rootElement.appendChild(this.select),this.registerHooks()}getValue(){return this.select.value}setValue(e){this.select.value=e}open(){this._opened=!0,this.refreshDimensions(),this.select.style.display="",this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this._opened=!1,this.select.style.display="none",_e(this.select,dw)&&He(this.select,dw),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,i,r,s,o){super.prepare(e,n,i,r,s,o);const a=this.cellProperties.selectOptions;let l;typeof a=="function"?l=this.prepareOptions(a(this.row,this.col,this.prop)):l=this.prepareOptions(a),es(this.select),Ue(l,(u,c)=>{const h=this.hot.rootDocument.createElement("OPTION");h.value=c,gu(h,u),this.select.appendChild(h)})}prepareOptions(e){let n={};if(Array.isArray(e))for(let i=0,r=e.length;i<r;i++)n[e[i]]=e[i];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!==jt.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.close();return}const{top:e,start:n,width:i,height:r}=this.getEditedCellRect(),s=this.select.style;s.height=`${r}px`,s.width=`${i}px`,s.top=`${e}px`,s[this.hot.isRtl()?"right":"left"]=`${n}px`,s.margin="0px",q(this.select,dw)}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor"),i={group:mT};this.isInFullEditMode()&&n.addShortcuts([{keys:[["ArrowUp"]],callback:()=>{const r=this.select.selectedIndex-1;r>=0&&(this.select[r].selected=!0)}},{keys:[["ArrowDown"]],callback:()=>{const r=this.select.selectedIndex+1;r<=this.select.length-1&&(this.select[r].selected=!0)}}],i)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(mT)}}const k4="time";class HO extends qa{static get EDITOR_TYPE(){return k4}prepare(e,n,i,r,s,o){super.prepare(e,n,i,r,s,o),this.TEXTAREA.dir="ltr"}}function F4(){ui(pu),ui(xb),ui(_O),ui(PO),ui(Hb),ui(Ob),ui(OO),ui(xO),ui(AO),ui(qa),ui(HO)}const V4="html";function Nb(t,e,n,i,r,s,o){$h.apply(this,[t,e,n,i,r,s,o]),gu(e,s??"",!1)}Nb.RENDERER_TYPE=V4;const W4="autocomplete";function wu(t,e,n,i,r,s,o){const{rootDocument:a}=t,l=o.allowHtml?Nb:js,u=a.createElement("DIV"),c=t.getSettings().ariaTags;if(u.className="htAutocompleteArrow",c&&u.setAttribute(...Us()),u.appendChild(a.createTextNode("▼")),l.apply(this,[t,e,n,i,r,s,o]),e.firstChild||e.appendChild(a.createTextNode(" ")),e.insertBefore(u,e.firstChild),q(e,"htAutocomplete"),!t.acArrowListener){const h=new wr(t);t.acArrowListener=function(d){_e(d.target,"htAutocompleteArrow")&&t.view._wt.getSetting("onCellDblClick",null,t._createCellCoords(n,i),e)},h.addEventListener(t.rootElement,"mousedown",t.acArrowListener),t.addHookOnce("afterDestroy",()=>{h.destroy()})}}wu.RENDERER_TYPE=W4;const B4="dropdown";function Db(t,e,n,i,r,s,o){wu.apply(this,[t,e,n,i,r,s,o])}Db.RENDERER_TYPE=B4;const pT=new WeakMap,wT=new WeakMap,U4="htBadValue",ou="data-row",au="data-col",Y4="checkboxRenderer",NO="checkbox";ce.getSingleton().add("modifyAutoColumnSizeSeed",function(t,e,n){const{label:i,type:r,row:s,column:o,prop:a}=e;if(r===NO){if(i){const{value:l,property:u}=i;let c=n;if(l)c=typeof l=="function"?l(s,o,a,n):l;else if(u){const h=this.getDataAtRowProp(s,u);c=h!==null?h:n}t=c}return t}});function Lb(t,e,n,i,r,s,o){const{rootDocument:a}=t,l=t.getSettings().ariaTags;$h.apply(this,[t,e,n,i,r,s,o]),z4(t);let u=G4(a);const c=o.label;let h=!1;if(typeof o.checkedTemplate>"u"&&(o.checkedTemplate=!0),typeof o.uncheckedTemplate>"u"&&(o.uncheckedTemplate=!1),es(e),s===o.checkedTemplate||Qt(s).toLocaleLowerCase(o.locale)===Qt(o.checkedTemplate).toLocaleLowerCase(o.locale)?u.checked=!0:s===o.uncheckedTemplate||Qt(s).toLocaleLowerCase(o.locale)===Qt(o.uncheckedTemplate).toLocaleLowerCase(o.locale)?u.checked=!1:Xt(s)?q(u,"noValue"):(u.style.display="none",q(u,U4),h=!0),Ee(u,[[ou,n],[au,i]]),l&&Ee(u,[CS(u.checked?t.getTranslatedPhrase(Mb):t.getTranslatedPhrase(_b)),HU(u.checked),MU()]),!h&&c){let C="";if(c.value)C=typeof c.value=="function"?c.value.call(this,n,i,r,s):c.value;else if(c.property){const b=t.getDataAtRowProp(n,c.property);C=b!==null?b:""}const S=j4(a,C,c.separated!==!0);c.position==="before"?c.separated?(e.appendChild(S),e.appendChild(u)):(S.appendChild(u),u=S):(!c.position||c.position==="after")&&(c.separated?(e.appendChild(u),e.appendChild(S)):(S.insertBefore(u,S.firstChild),u=S))}(!c||c&&!c.separated)&&e.appendChild(u),h&&e.appendChild(a.createTextNode("#bad-value#")),pT.has(t)||(pT.set(t,!0),d());function d(){const S=t.getShortcutManager().getContext("grid"),b={group:Y4,relativeToGroup:ko,position:"before"};S.addShortcuts([{keys:[["space"]],callback:()=>(g(),!p()),runOnlyIf:()=>{var R;return(R=t.getSelectedRangeLast())===null||R===void 0?void 0:R.highlight.isCell()}},{keys:[["enter"]],callback:()=>(g(),!p()),runOnlyIf:()=>{const R=t.getSelectedRangeLast();return t.getSettings().enterBeginsEditing&&R?.isSingle()&&R.highlight.isCell()}},{keys:[["delete"],["backspace"]],callback:()=>(g(!0),!p()),runOnlyIf:()=>{var R;return(R=t.getSelectedRangeLast())===null||R===void 0?void 0:R.highlight.isCell()}}],b)}function g(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const S=t.getSelectedRange(),b=[];let R=[],E=0;if(S){for(let H=0;H<S.length;H++){const{row:P,col:B}=S[H].getTopStartCorner(),{row:Y,col:j}=S[H].getBottomEndCorner();for(let z=P;z<=Y;z+=1)for(let G=B;G<=j;G+=1){const Z=t.getCellMeta(z,G),ne={checkedTemplate:Z.checkedTemplate,uncheckedTemplate:Z.uncheckedTemplate};if(Z.type!=="checkbox")return;if(Z.readOnly===!0)continue;typeof Z.checkedTemplate>"u"&&(Z.checkedTemplate=!0),typeof Z.uncheckedTemplate>"u"&&(Z.uncheckedTemplate=!1);const ie=t.getDataAtCell(z,G);C===!1?[Z.checkedTemplate,Z.checkedTemplate.toString()].includes(ie)?R.push([z,G,Z.uncheckedTemplate,ne]):[Z.uncheckedTemplate,Z.uncheckedTemplate.toString(),null,void 0].includes(ie)&&R.push([z,G,Z.checkedTemplate,ne]):R.push([z,G,Z.uncheckedTemplate,ne]),E+=1}b.push(E),E=0}R.every(H=>{let[,,P]=H;return P===R[0][2]})?R=R.map(H=>{let[P,B,Y]=H;return[P,B,Y]}):R=R.map(H=>{let[P,B,,Y]=H;return[P,B,Y.checkedTemplate]}),R.length>0&&b.forEach(H=>{const P=R.splice(0,H);t.setDataAtCell(P)})}}function p(){const C=t.getSelectedRange();if(C){for(let S=0;S<C.length;S++){const b=C[S].getTopStartCorner(),R=C[S].getBottomEndCorner();for(let E=b.row;E<=R.row;E++)for(let H=b.col;H<=R.col;H++){const P=t.getCellMeta(E,H);if(P.type!=="checkbox")return!1;const B=t.getCell(E,H);if(B==null)return!0;if(B.querySelectorAll("input[type=checkbox]").length>0&&!P.readOnly)return!0}}return!1}}}Lb.RENDERER_TYPE=NO;function z4(t){let e=wT.get(t);if(!e){const{rootElement:n}=t;e=new wr(t),e.addEventListener(n,"click",i=>X4(i,t)),e.addEventListener(n,"mouseup",i=>K4(i,t)),e.addEventListener(n,"change",i=>q4(i,t)),wT.set(t,e)}return e}function G4(t){const e=t.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("tabindex","-1"),e.cloneNode(!1)}function j4(t,e,n){const i=t.createElement("label");return i.className=`htCheckboxRendererLabel ${n?"fullWidth":""}`,i.appendChild(t.createTextNode(e)),i.cloneNode(!0)}function K4(t,e){const{target:n}=t;$b(n)&&(!n.hasAttribute(ou)||!n.hasAttribute(au)||setTimeout(e.listen,10))}function X4(t,e){const{target:n}=t;if(!$b(n)||!n.hasAttribute(ou)||!n.hasAttribute(au))return;const i=parseInt(n.getAttribute(ou),10),r=parseInt(n.getAttribute(au),10);e.getCellMeta(i,r).readOnly&&t.preventDefault()}function q4(t,e){const{target:n}=t;if(!$b(n)||!n.hasAttribute(ou)||!n.hasAttribute(au))return;const i=parseInt(n.getAttribute(ou),10),r=parseInt(n.getAttribute(au),10),s=e.getCellMeta(i,r);if(!s.readOnly){let o=null;t.target.checked?o=s.uncheckedTemplate===void 0?!0:s.checkedTemplate:o=s.uncheckedTemplate===void 0?!1:s.uncheckedTemplate,e.setDataAtCell(i,r,o)}}function $b(t){return t.tagName==="INPUT"&&t.getAttribute("type")==="checkbox"}const Z4="handsontable";function kb(t,e,n,i,r,s,o){wu.apply(this,[t,e,n,i,r,s,o])}kb.RENDERER_TYPE=Z4;var DO={exports:{}};(function(t,e){(function(n){t.exports=n()})(function(){return function n(i,r,s){function o(u,c){if(!r[u]){if(!i[u]){var h=typeof Ec=="function"&&Ec;if(!c&&h)return h(u,!0);if(a)return a(u,!0);var d=new Error("Cannot find module '"+u+"'");throw d.code="MODULE_NOT_FOUND",d}var g=r[u]={exports:{}};i[u][0].call(g.exports,function(p){return o(i[u][1][p]||p)},g,g.exports,n,i,r,s)}return r[u].exports}for(var a=typeof Ec=="function"&&Ec,l=0;l<s.length;l++)o(s[l]);return o}({1:[function(n,i,r){(function(s){var o,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,l=Math.ceil,u=Math.floor,c="[BigNumber Error] ",h=c+"Number primitive has more than 15 significant digits: ",d=1e14,g=14,p=9007199254740991,C=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],S=1e7,b=1e9;function R(z){var G=0|z;return 0<z||z===G?G:G-1}function E(z){for(var G,Z,ne=1,ie=z.length,Ce=z[0]+"";ne<ie;){for(G=z[ne++]+"",Z=g-G.length;Z--;G="0"+G);Ce+=G}for(ie=Ce.length;Ce.charCodeAt(--ie)===48;);return Ce.slice(0,ie+1||1)}function H(z,G){var Z,ne,ie=z.c,Ce=G.c,Me=z.s,et=G.s,Ne=z.e,we=G.e;if(!Me||!et)return null;if(Z=ie&&!ie[0],ne=Ce&&!Ce[0],Z||ne)return Z?ne?0:-et:Me;if(Me!=et)return Me;if(Z=Me<0,ne=Ne==we,!ie||!Ce)return ne?0:!ie^Z?1:-1;if(!ne)return we<Ne^Z?1:-1;for(et=(Ne=ie.length)<(we=Ce.length)?Ne:we,Me=0;Me<et;Me++)if(ie[Me]!=Ce[Me])return ie[Me]>Ce[Me]^Z?1:-1;return Ne==we?0:we<Ne^Z?1:-1}function P(z,G,Z,ne){if(z<G||Z<z||z!==(z<0?l(z):u(z)))throw Error(c+(ne||"Argument")+(typeof z=="number"?z<G||Z<z?" out of range: ":" not an integer: ":" not a primitive number: ")+String(z))}function B(z){var G=z.c.length-1;return R(z.e/g)==G&&z.c[G]%2!=0}function Y(z,G){return(1<z.length?z.charAt(0)+"."+z.slice(1):z)+(G<0?"e":"e+")+G}function j(z,G,Z){var ne,ie;if(G<0){for(ie=Z+".";++G;ie+=Z);z=ie+z}else if(++G>(ne=z.length)){for(ie=Z,G-=ne;--G;ie+=Z);z+=ie}else G<ne&&(z=z.slice(0,G)+"."+z.slice(G));return z}(o=function z(G){var Z,ne,ie,Ce,Me,et,Ne,we,pe,ht,f=W.prototype={constructor:W,toString:null,valueOf:null},m=new W(1),w=20,O=4,I=-7,F=21,U=-1e7,K=1e7,le=!1,he=1,Q=0,Oe={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},Pe="0123456789abcdefghijklmnopqrstuvwxyz";function W(v,y){var T,$,_,k,N,x,L,D,V=this;if(!(V instanceof W))return new W(v,y);if(y==null){if(v instanceof W)return V.s=v.s,V.e=v.e,void(V.c=(v=v.c)?v.slice():v);if((x=typeof v=="number")&&0*v==0){if(V.s=1/v<0?(v=-v,-1):1,v===~~v){for(k=0,N=v;10<=N;N/=10,k++);return V.e=k,void(V.c=[v])}D=String(v)}else{if(D=String(v),!a.test(D))return ie(V,D,x);V.s=D.charCodeAt(0)==45?(D=D.slice(1),-1):1}-1<(k=D.indexOf("."))&&(D=D.replace(".","")),0<(N=D.search(/e/i))?(k<0&&(k=N),k+=+D.slice(N+1),D=D.substring(0,N)):k<0&&(k=D.length)}else{if(P(y,2,Pe.length,"Base"),D=String(v),y==10)return Fe(V=new W(v instanceof W?v:D),w+V.e+1,O);if(x=typeof v=="number"){if(0*v!=0)return ie(V,D,x,y);if(V.s=1/v<0?(D=D.slice(1),-1):1,W.DEBUG&&15<D.replace(/^0\.0*|\./,"").length)throw Error(h+v);x=!1}else V.s=D.charCodeAt(0)===45?(D=D.slice(1),-1):1;for(T=Pe.slice(0,y),k=N=0,L=D.length;N<L;N++)if(T.indexOf($=D.charAt(N))<0){if($=="."){if(k<N){k=L;continue}}else if(!_&&(D==D.toUpperCase()&&(D=D.toLowerCase())||D==D.toLowerCase()&&(D=D.toUpperCase()))){_=!0,N=-1,k=0;continue}return ie(V,String(v),x,y)}-1<(k=(D=ne(D,y,10,V.s)).indexOf("."))?D=D.replace(".",""):k=D.length}for(N=0;D.charCodeAt(N)===48;N++);for(L=D.length;D.charCodeAt(--L)===48;);if(D=D.slice(N,++L)){if(L-=N,x&&W.DEBUG&&15<L&&(p<v||v!==u(v)))throw Error(h+V.s*v);if(K<(k=k-N-1))V.c=V.e=null;else if(k<U)V.c=[V.e=0];else{if(V.e=k,V.c=[],N=(k+1)%g,k<0&&(N+=g),N<L){for(N&&V.c.push(+D.slice(0,N)),L-=g;N<L;)V.c.push(+D.slice(N,N+=g));D=D.slice(N),N=g-D.length}else N-=L;for(;N--;D+="0");V.c.push(+D)}}else V.c=[V.e=0]}function Xe(v,y,T,$){var _,k,N,x,L;if(T==null?T=O:P(T,0,8),!v.c)return v.toString();if(_=v.c[0],N=v.e,y==null)L=E(v.c),L=$==1||$==2&&(N<=I||F<=N)?Y(L,N):j(L,N,"0");else if(k=(v=Fe(new W(v),y,T)).e,x=(L=E(v.c)).length,$==1||$==2&&(y<=k||k<=I)){for(;x<y;L+="0",x++);L=Y(L,k)}else if(y-=N,L=j(L,k,"0"),x<k+1){if(0<--y)for(L+=".";y--;L+="0");}else if(0<(y+=k-x))for(k+1==x&&(L+=".");y--;L+="0");return v.s<0&&_?"-"+L:L}function Le(v,y){for(var T,$=1,_=new W(v[0]);$<v.length;$++){if(!(T=new W(v[$])).s){_=T;break}y.call(_,T)&&(_=T)}return _}function tt(v,y,T){for(var $=1,_=y.length;!y[--_];y.pop());for(_=y[0];10<=_;_/=10,$++);return(T=$+T*g-1)>K?v.c=v.e=null:v.c=T<U?[v.e=0]:(v.e=T,y),v}function Fe(v,y,T,$){var _,k,N,x,L,D,V,te=v.c,ue=C;if(te){e:{for(_=1,x=te[0];10<=x;x/=10,_++);if((k=y-_)<0)k+=g,N=y,V=(L=te[D=0])/ue[_-N-1]%10|0;else if((D=l((k+1)/g))>=te.length){if(!$)break e;for(;te.length<=D;te.push(0));L=V=0,N=(k%=g)-g+(_=1)}else{for(L=x=te[D],_=1;10<=x;x/=10,_++);V=(N=(k%=g)-g+_)<0?0:L/ue[_-N-1]%10|0}if($=$||y<0||te[D+1]!=null||(N<0?L:L%ue[_-N-1]),$=T<4?(V||$)&&(T==0||T==(v.s<0?3:2)):5<V||V==5&&(T==4||$||T==6&&(0<k?0<N?L/ue[_-N]:0:te[D-1])%10&1||T==(v.s<0?8:7)),y<1||!te[0])return te.length=0,$?(y-=v.e+1,te[0]=ue[(g-y%g)%g],v.e=-y||0):te[0]=v.e=0,v;if(k==0?(te.length=D,x=1,D--):(te.length=D+1,x=ue[g-k],te[D]=0<N?u(L/ue[_-N]%ue[N])*x:0),$)for(;;){if(D==0){for(k=1,N=te[0];10<=N;N/=10,k++);for(N=te[0]+=x,x=1;10<=N;N/=10,x++);k!=x&&(v.e++,te[0]==d&&(te[0]=1));break}if(te[D]+=x,te[D]!=d)break;te[D--]=0,x=1}for(k=te.length;te[--k]===0;te.pop());}v.e>K?v.c=v.e=null:v.e<U&&(v.c=[v.e=0])}return v}function Te(v){var y,T=v.e;return T===null?v.toString():(y=E(v.c),y=T<=I||F<=T?Y(y,T):j(y,T,"0"),v.s<0?"-"+y:y)}return W.clone=z,W.ROUND_UP=0,W.ROUND_DOWN=1,W.ROUND_CEIL=2,W.ROUND_FLOOR=3,W.ROUND_HALF_UP=4,W.ROUND_HALF_DOWN=5,W.ROUND_HALF_EVEN=6,W.ROUND_HALF_CEIL=7,W.ROUND_HALF_FLOOR=8,W.EUCLID=9,W.config=W.set=function(v){var y,T;if(v!=null){if(typeof v!="object")throw Error(c+"Object expected: "+v);if(v.hasOwnProperty(y="DECIMAL_PLACES")&&(P(T=v[y],0,b,y),w=T),v.hasOwnProperty(y="ROUNDING_MODE")&&(P(T=v[y],0,8,y),O=T),v.hasOwnProperty(y="EXPONENTIAL_AT")&&((T=v[y])&&T.pop?(P(T[0],-b,0,y),P(T[1],0,b,y),I=T[0],F=T[1]):(P(T,-b,b,y),I=-(F=T<0?-T:T))),v.hasOwnProperty(y="RANGE"))if((T=v[y])&&T.pop)P(T[0],-b,-1,y),P(T[1],1,b,y),U=T[0],K=T[1];else{if(P(T,-b,b,y),!T)throw Error(c+y+" cannot be zero: "+T);U=-(K=T<0?-T:T)}if(v.hasOwnProperty(y="CRYPTO")){if((T=v[y])!==!!T)throw Error(c+y+" not true or false: "+T);if(T){if(typeof crypto>"u"||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw le=!T,Error(c+"crypto unavailable");le=T}else le=T}if(v.hasOwnProperty(y="MODULO_MODE")&&(P(T=v[y],0,9,y),he=T),v.hasOwnProperty(y="POW_PRECISION")&&(P(T=v[y],0,b,y),Q=T),v.hasOwnProperty(y="FORMAT")){if(typeof(T=v[y])!="object")throw Error(c+y+" not an object: "+T);Oe=T}if(v.hasOwnProperty(y="ALPHABET")){if(typeof(T=v[y])!="string"||/^.$|[+-.\s]|(.).*\1/.test(T))throw Error(c+y+" invalid: "+T);Pe=T}}return{DECIMAL_PLACES:w,ROUNDING_MODE:O,EXPONENTIAL_AT:[I,F],RANGE:[U,K],CRYPTO:le,MODULO_MODE:he,POW_PRECISION:Q,FORMAT:Oe,ALPHABET:Pe}},W.isBigNumber=function(v){return v instanceof W||v&&v._isBigNumber===!0||!1},W.maximum=W.max=function(){return Le(arguments,f.lt)},W.minimum=W.min=function(){return Le(arguments,f.gt)},W.random=(Ce=9007199254740992,Me=Math.random()*Ce&2097151?function(){return u(Math.random()*Ce)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(v){var y,T,$,_,k,N=0,x=[],L=new W(m);if(v==null?v=w:P(v,0,b),_=l(v/g),le)if(crypto.getRandomValues){for(y=crypto.getRandomValues(new Uint32Array(_*=2));N<_;)9e15<=(k=131072*y[N]+(y[N+1]>>>11))?(T=crypto.getRandomValues(new Uint32Array(2)),y[N]=T[0],y[N+1]=T[1]):(x.push(k%1e14),N+=2);N=_/2}else{if(!crypto.randomBytes)throw le=!1,Error(c+"crypto unavailable");for(y=crypto.randomBytes(_*=7);N<_;)9e15<=(k=281474976710656*(31&y[N])+1099511627776*y[N+1]+4294967296*y[N+2]+16777216*y[N+3]+(y[N+4]<<16)+(y[N+5]<<8)+y[N+6])?crypto.randomBytes(7).copy(y,N):(x.push(k%1e14),N+=7);N=_/7}if(!le)for(;N<_;)(k=Me())<9e15&&(x[N++]=k%1e14);for(_=x[--N],v%=g,_&&v&&(k=C[g-v],x[N]=u(_/k)*k);x[N]===0;x.pop(),N--);if(N<0)x=[$=0];else{for($=-1;x[0]===0;x.splice(0,1),$-=g);for(N=1,k=x[0];10<=k;k/=10,N++);N<g&&($-=g-N)}return L.e=$,L.c=x,L}),W.sum=function(){for(var v=1,y=arguments,T=new W(y[0]);v<y.length;)T=T.plus(y[v++]);return T},ne=function(){var v="0123456789";function y(T,$,_,k){for(var N,x,L=[0],D=0,V=T.length;D<V;){for(x=L.length;x--;L[x]*=$);for(L[0]+=k.indexOf(T.charAt(D++)),N=0;N<L.length;N++)L[N]>_-1&&(L[N+1]==null&&(L[N+1]=0),L[N+1]+=L[N]/_|0,L[N]%=_)}return L.reverse()}return function(T,$,_,k,N){var x,L,D,V,te,ue,ye,$e,qe=T.indexOf("."),Ye=w,Ie=O;for(0<=qe&&(V=Q,Q=0,T=T.replace(".",""),ue=($e=new W($)).pow(T.length-qe),Q=V,$e.c=y(j(E(ue.c),ue.e,"0"),10,_,v),$e.e=$e.c.length),D=V=(ye=y(T,$,_,N?(x=Pe,v):(x=v,Pe))).length;ye[--V]==0;ye.pop());if(!ye[0])return x.charAt(0);if(qe<0?--D:(ue.c=ye,ue.e=D,ue.s=k,ye=(ue=Z(ue,$e,Ye,Ie,_)).c,te=ue.r,D=ue.e),qe=ye[L=D+Ye+1],V=_/2,te=te||L<0||ye[L+1]!=null,te=Ie<4?(qe!=null||te)&&(Ie==0||Ie==(ue.s<0?3:2)):V<qe||qe==V&&(Ie==4||te||Ie==6&&1&ye[L-1]||Ie==(ue.s<0?8:7)),L<1||!ye[0])T=te?j(x.charAt(1),-Ye,x.charAt(0)):x.charAt(0);else{if(ye.length=L,te)for(--_;++ye[--L]>_;)ye[L]=0,L||(++D,ye=[1].concat(ye));for(V=ye.length;!ye[--V];);for(qe=0,T="";qe<=V;T+=x.charAt(ye[qe++]));T=j(T,D,x.charAt(0))}return T}}(),Z=function(){function v($,_,k){var N,x,L,D,V=0,te=$.length,ue=_%S,ye=_/S|0;for($=$.slice();te--;)V=((x=ue*(L=$[te]%S)+(N=ye*L+(D=$[te]/S|0)*ue)%S*S+V)/k|0)+(N/S|0)+ye*D,$[te]=x%k;return V&&($=[V].concat($)),$}function y($,_,k,N){var x,L;if(k!=N)L=N<k?1:-1;else for(x=L=0;x<k;x++)if($[x]!=_[x]){L=$[x]>_[x]?1:-1;break}return L}function T($,_,k,N){for(var x=0;k--;)$[k]-=x,x=$[k]<_[k]?1:0,$[k]=x*N+$[k]-_[k];for(;!$[0]&&1<$.length;$.splice(0,1));}return function($,_,k,N,x){var L,D,V,te,ue,ye,$e,qe,Ye,Ie,Qe,Dt,Za,Ui,Su,Si,xt,nn=$.s==_.s?1:-1,Cn=$.c,_t=_.c;if(!(Cn&&Cn[0]&&_t&&_t[0]))return new W($.s&&_.s&&(Cn?!_t||Cn[0]!=_t[0]:_t)?Cn&&Cn[0]==0||!_t?0*nn:nn/0:NaN);for(Ye=(qe=new W(nn)).c=[],nn=k+(D=$.e-_.e)+1,x||(x=d,D=R($.e/g)-R(_.e/g),nn=nn/g|0),V=0;_t[V]==(Cn[V]||0);V++);if(_t[V]>(Cn[V]||0)&&D--,nn<0)Ye.push(1),te=!0;else{for(Ui=Cn.length,Si=_t.length,nn+=2,1<(ue=u(x/(_t[V=0]+1)))&&(_t=v(_t,ue,x),Cn=v(Cn,ue,x),Si=_t.length,Ui=Cn.length),Za=Si,Qe=(Ie=Cn.slice(0,Si)).length;Qe<Si;Ie[Qe++]=0);xt=_t.slice(),xt=[0].concat(xt),Su=_t[0],_t[1]>=x/2&&Su++;do{if(ue=0,(L=y(_t,Ie,Si,Qe))<0){if(Dt=Ie[0],Si!=Qe&&(Dt=Dt*x+(Ie[1]||0)),1<(ue=u(Dt/Su)))for(x<=ue&&(ue=x-1),$e=(ye=v(_t,ue,x)).length,Qe=Ie.length;y(ye,Ie,$e,Qe)==1;)ue--,T(ye,Si<$e?xt:_t,$e,x),$e=ye.length,L=1;else ue==0&&(L=ue=1),$e=(ye=_t.slice()).length;if($e<Qe&&(ye=[0].concat(ye)),T(Ie,ye,Qe,x),Qe=Ie.length,L==-1)for(;y(_t,Ie,Si,Qe)<1;)ue++,T(Ie,Si<Qe?xt:_t,Qe,x),Qe=Ie.length}else L===0&&(ue++,Ie=[0]);Ye[V++]=ue,Ie[0]?Ie[Qe++]=Cn[Za]||0:(Ie=[Cn[Za]],Qe=1)}while((Za++<Ui||Ie[0]!=null)&&nn--);te=Ie[0]!=null,Ye[0]||Ye.splice(0,1)}if(x==d){for(V=1,nn=Ye[0];10<=nn;nn/=10,V++);Fe(qe,k+(qe.e=V+D*g-1)+1,N,te)}else qe.e=D,qe.r=+te;return qe}}(),et=/^(-?)0([xbo])(?=\w[\w.]*$)/i,Ne=/^([^.]+)\.$/,we=/^\.([^.]+)$/,pe=/^-?(Infinity|NaN)$/,ht=/^\s*\+(?=[\w.])|^\s+|\s+$/g,ie=function(v,y,T,$){var _,k=T?y:y.replace(ht,"");if(pe.test(k))v.s=isNaN(k)?null:k<0?-1:1,v.c=v.e=null;else{if(!T&&(k=k.replace(et,function(N,x,L){return _=(L=L.toLowerCase())=="x"?16:L=="b"?2:8,$&&$!=_?N:x}),$&&(_=$,k=k.replace(Ne,"$1").replace(we,"0.$1")),y!=k))return new W(k,_);if(W.DEBUG)throw Error(c+"Not a"+($?" base "+$:"")+" number: "+y);v.c=v.e=v.s=null}},f.absoluteValue=f.abs=function(){var v=new W(this);return v.s<0&&(v.s=1),v},f.comparedTo=function(v,y){return H(this,new W(v,y))},f.decimalPlaces=f.dp=function(v,y){var T,$,_;if(v!=null)return P(v,0,b),y==null?y=O:P(y,0,8),Fe(new W(this),v+this.e+1,y);if(!(T=this.c))return null;if($=((_=T.length-1)-R(this.e/g))*g,_=T[_])for(;_%10==0;_/=10,$--);return $<0&&($=0),$},f.dividedBy=f.div=function(v,y){return Z(this,new W(v,y),w,O)},f.dividedToIntegerBy=f.idiv=function(v,y){return Z(this,new W(v,y),0,1)},f.exponentiatedBy=f.pow=function(v,y){var T,$,_,k,N,x,L,D,V=this;if((v=new W(v)).c&&!v.isInteger())throw Error(c+"Exponent not an integer: "+Te(v));if(y!=null&&(y=new W(y)),N=14<v.e,!V.c||!V.c[0]||V.c[0]==1&&!V.e&&V.c.length==1||!v.c||!v.c[0])return D=new W(Math.pow(+Te(V),N?2-B(v):+Te(v))),y?D.mod(y):D;if(x=v.s<0,y){if(y.c?!y.c[0]:!y.s)return new W(NaN);($=!x&&V.isInteger()&&y.isInteger())&&(V=V.mod(y))}else{if(9<v.e&&(0<V.e||V.e<-1||(V.e==0?1<V.c[0]||N&&24e7<=V.c[1]:V.c[0]<8e13||N&&V.c[0]<=9999975e7)))return k=V.s<0&&B(v)?-0:0,-1<V.e&&(k=1/k),new W(x?1/k:k);Q&&(k=l(Q/g+2))}for(L=N?(T=new W(.5),x&&(v.s=1),B(v)):(_=Math.abs(+Te(v)))%2,D=new W(m);;){if(L){if(!(D=D.times(V)).c)break;k?D.c.length>k&&(D.c.length=k):$&&(D=D.mod(y))}if(_){if((_=u(_/2))===0)break;L=_%2}else if(Fe(v=v.times(T),v.e+1,1),14<v.e)L=B(v);else{if((_=+Te(v))==0)break;L=_%2}V=V.times(V),k?V.c&&V.c.length>k&&(V.c.length=k):$&&(V=V.mod(y))}return $?D:(x&&(D=m.div(D)),y?D.mod(y):k?Fe(D,Q,O,void 0):D)},f.integerValue=function(v){var y=new W(this);return v==null?v=O:P(v,0,8),Fe(y,y.e+1,v)},f.isEqualTo=f.eq=function(v,y){return H(this,new W(v,y))===0},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(v,y){return 0<H(this,new W(v,y))},f.isGreaterThanOrEqualTo=f.gte=function(v,y){return(y=H(this,new W(v,y)))===1||y===0},f.isInteger=function(){return!!this.c&&R(this.e/g)>this.c.length-2},f.isLessThan=f.lt=function(v,y){return H(this,new W(v,y))<0},f.isLessThanOrEqualTo=f.lte=function(v,y){return(y=H(this,new W(v,y)))===-1||y===0},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return 0<this.s},f.isZero=function(){return!!this.c&&this.c[0]==0},f.minus=function(v,y){var T,$,_,k,N=this,x=N.s;if(y=(v=new W(v,y)).s,!x||!y)return new W(NaN);if(x!=y)return v.s=-y,N.plus(v);var L=N.e/g,D=v.e/g,V=N.c,te=v.c;if(!L||!D){if(!V||!te)return V?(v.s=-y,v):new W(te?N:NaN);if(!V[0]||!te[0])return te[0]?(v.s=-y,v):new W(V[0]?N:O==3?-0:0)}if(L=R(L),D=R(D),V=V.slice(),x=L-D){for((_=(k=x<0)?(x=-x,V):(D=L,te)).reverse(),y=x;y--;_.push(0));_.reverse()}else for($=(k=(x=V.length)<(y=te.length))?x:y,x=y=0;y<$;y++)if(V[y]!=te[y]){k=V[y]<te[y];break}if(k&&(_=V,V=te,te=_,v.s=-v.s),0<(y=($=te.length)-(T=V.length)))for(;y--;V[T++]=0);for(y=d-1;x<$;){if(V[--$]<te[$]){for(T=$;T&&!V[--T];V[T]=y);--V[T],V[$]+=d}V[$]-=te[$]}for(;V[0]==0;V.splice(0,1),--D);return V[0]?tt(v,V,D):(v.s=O==3?-1:1,v.c=[v.e=0],v)},f.modulo=f.mod=function(v,y){var T,$,_=this;return v=new W(v,y),!_.c||!v.s||v.c&&!v.c[0]?new W(NaN):!v.c||_.c&&!_.c[0]?new W(_):(he==9?($=v.s,v.s=1,T=Z(_,v,0,3),v.s=$,T.s*=$):T=Z(_,v,0,he),(v=_.minus(T.times(v))).c[0]||he!=1||(v.s=_.s),v)},f.multipliedBy=f.times=function(v,y){var T,$,_,k,N,x,L,D,V,te,ue,ye,$e,qe,Ye,Ie=this,Qe=Ie.c,Dt=(v=new W(v,y)).c;if(!(Qe&&Dt&&Qe[0]&&Dt[0]))return!Ie.s||!v.s||Qe&&!Qe[0]&&!Dt||Dt&&!Dt[0]&&!Qe?v.c=v.e=v.s=null:(v.s*=Ie.s,Qe&&Dt?(v.c=[0],v.e=0):v.c=v.e=null),v;for($=R(Ie.e/g)+R(v.e/g),v.s*=Ie.s,(L=Qe.length)<(te=Dt.length)&&($e=Qe,Qe=Dt,Dt=$e,_=L,L=te,te=_),_=L+te,$e=[];_--;$e.push(0));for(qe=d,Ye=S,_=te;0<=--_;){for(T=0,ue=Dt[_]%Ye,ye=Dt[_]/Ye|0,k=_+(N=L);_<k;)T=((D=ue*(D=Qe[--N]%Ye)+(x=ye*D+(V=Qe[N]/Ye|0)*ue)%Ye*Ye+$e[k]+T)/qe|0)+(x/Ye|0)+ye*V,$e[k--]=D%qe;$e[k]=T}return T?++$:$e.splice(0,1),tt(v,$e,$)},f.negated=function(){var v=new W(this);return v.s=-v.s||null,v},f.plus=function(v,y){var T,$=this,_=$.s;if(y=(v=new W(v,y)).s,!_||!y)return new W(NaN);if(_!=y)return v.s=-y,$.minus(v);var k=$.e/g,N=v.e/g,x=$.c,L=v.c;if(!k||!N){if(!x||!L)return new W(_/0);if(!x[0]||!L[0])return L[0]?v:new W(x[0]?$:0*_)}if(k=R(k),N=R(N),x=x.slice(),_=k-N){for((T=0<_?(N=k,L):(_=-_,x)).reverse();_--;T.push(0));T.reverse()}for((_=x.length)-(y=L.length)<0&&(T=L,L=x,x=T,y=_),_=0;y;)_=(x[--y]=x[y]+L[y]+_)/d|0,x[y]=d===x[y]?0:x[y]%d;return _&&(x=[_].concat(x),++N),tt(v,x,N)},f.precision=f.sd=function(v,y){var T,$,_;if(v!=null&&v!==!!v)return P(v,1,b),y==null?y=O:P(y,0,8),Fe(new W(this),v,y);if(!(T=this.c))return null;if($=(_=T.length-1)*g+1,_=T[_]){for(;_%10==0;_/=10,$--);for(_=T[0];10<=_;_/=10,$++);}return v&&this.e+1>$&&($=this.e+1),$},f.shiftedBy=function(v){return P(v,-p,p),this.times("1e"+v)},f.squareRoot=f.sqrt=function(){var v,y,T,$,_,k=this,N=k.c,x=k.s,L=k.e,D=w+4,V=new W("0.5");if(x!==1||!N||!N[0])return new W(!x||x<0&&(!N||N[0])?NaN:N?k:1/0);if((T=(x=Math.sqrt(+Te(k)))==0||x==1/0?(((y=E(N)).length+L)%2==0&&(y+="0"),x=Math.sqrt(+y),L=R((L+1)/2)-(L<0||L%2),new W(y=x==1/0?"1e"+L:(y=x.toExponential()).slice(0,y.indexOf("e")+1)+L)):new W(x+"")).c[0]){for((x=(L=T.e)+D)<3&&(x=0);;)if(_=T,T=V.times(_.plus(Z(k,_,D,1))),E(_.c).slice(0,x)===(y=E(T.c)).slice(0,x)){if(T.e<L&&--x,(y=y.slice(x-3,x+1))!="9999"&&($||y!="4999")){+y&&(+y.slice(1)||y.charAt(0)!="5")||(Fe(T,T.e+w+2,1),v=!T.times(T).eq(k));break}if(!$&&(Fe(_,_.e+w+2,0),_.times(_).eq(k))){T=_;break}D+=4,x+=4,$=1}}return Fe(T,T.e+w+1,O,v)},f.toExponential=function(v,y){return v!=null&&(P(v,0,b),v++),Xe(this,v,y,1)},f.toFixed=function(v,y){return v!=null&&(P(v,0,b),v=v+this.e+1),Xe(this,v,y)},f.toFormat=function(v,y,T){var $;if(T==null)v!=null&&y&&typeof y=="object"?(T=y,y=null):v&&typeof v=="object"?(T=v,v=y=null):T=Oe;else if(typeof T!="object")throw Error(c+"Argument not an object: "+T);if($=this.toFixed(v,y),this.c){var _,k=$.split("."),N=+T.groupSize,x=+T.secondaryGroupSize,L=T.groupSeparator||"",D=k[0],V=k[1],te=this.s<0,ue=te?D.slice(1):D,ye=ue.length;if(x&&(_=N,N=x,ye-=x=_),0<N&&0<ye){for(_=ye%N||N,D=ue.substr(0,_);_<ye;_+=N)D+=L+ue.substr(_,N);0<x&&(D+=L+ue.slice(_)),te&&(D="-"+D)}$=V?D+(T.decimalSeparator||"")+((x=+T.fractionGroupSize)?V.replace(new RegExp("\\d{"+x+"}\\B","g"),"$&"+(T.fractionGroupSeparator||"")):V):D}return(T.prefix||"")+$+(T.suffix||"")},f.toFraction=function(v){var y,T,$,_,k,N,x,L,D,V,te,ue,ye=this,$e=ye.c;if(v!=null&&(!(x=new W(v)).isInteger()&&(x.c||x.s!==1)||x.lt(m)))throw Error(c+"Argument "+(x.isInteger()?"out of range: ":"not an integer: ")+Te(x));if(!$e)return new W(ye);for(y=new W(m),D=T=new W(m),$=L=new W(m),ue=E($e),k=y.e=ue.length-ye.e-1,y.c[0]=C[(N=k%g)<0?g+N:N],v=!v||0<x.comparedTo(y)?0<k?y:D:x,N=K,K=1/0,x=new W(ue),L.c[0]=0;V=Z(x,y,0,1),(_=T.plus(V.times($))).comparedTo(v)!=1;)T=$,$=_,D=L.plus(V.times(_=D)),L=_,y=x.minus(V.times(_=y)),x=_;return _=Z(v.minus(T),$,0,1),L=L.plus(_.times(D)),T=T.plus(_.times($)),L.s=D.s=ye.s,te=Z(D,$,k*=2,O).minus(ye).abs().comparedTo(Z(L,T,k,O).minus(ye).abs())<1?[D,$]:[L,T],K=N,te},f.toNumber=function(){return+Te(this)},f.toPrecision=function(v,y){return v!=null&&P(v,1,b),Xe(this,v,y,2)},f.toString=function(v){var y,T=this,$=T.s,_=T.e;return _===null?$?(y="Infinity",$<0&&(y="-"+y)):y="NaN":(y=v==null?_<=I||F<=_?Y(E(T.c),_):j(E(T.c),_,"0"):v===10?j(E((T=Fe(new W(T),w+_+1,O)).c),T.e,"0"):(P(v,2,Pe.length,"Base"),ne(j(E(T.c),_,"0"),10,v,$,!0)),$<0&&T.c[0]&&(y="-"+y)),y},f.valueOf=f.toJSON=function(){return Te(this)},f._isBigNumber=!0,typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"&&(f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf),G!=null&&W.set(G),W}()).default=o.BigNumber=o,i!==void 0&&i.exports?i.exports=o:(s||(s=typeof self<"u"&&self?self:window),s.BigNumber=o)})(this)},{}],2:[function(n,i,r){i.exports={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(s){var o=s%10;return~~(s%100/10)==1?"th":o===1?"st":o===2?"nd":o===3?"rd":"th"},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!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}}}},{}],3:[function(n,i,r){function s(R,E){return function(H){if(Array.isArray(H))return H}(R)||function(H,P){var B=[],Y=!0,j=!1,z=void 0;try{for(var G,Z=H[Symbol.iterator]();!(Y=(G=Z.next()).done)&&(B.push(G.value),!P||B.length!==P);Y=!0);}catch(ne){j=!0,z=ne}finally{try{Y||Z.return==null||Z.return()}finally{if(j)throw z}}return B}(R,E)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var o=n("./globalState"),a=n("./validating"),l=n("./parsing"),u=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],c={general:{scale:1024,suffixes:u,marker:"bd"},binary:{scale:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],marker:"b"},decimal:{scale:1e3,suffixes:u,marker:"d"}},h={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1};function d(R){var E=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},H=2<arguments.length?arguments[2]:void 0;if(typeof E=="string"&&(E=l.parseFormat(E)),!a.validateFormat(E))return"ERROR: invalid format";var P=E.prefix||"",B=E.postfix||"",Y=function(j,z,G){switch(z.output){case"currency":return z=b(z,o.currentCurrencyDefaultFormat()),function(Pe,W,Xe){var Le=Xe.currentCurrency(),tt=Object.assign({},h,W),Fe=void 0,Te="",v=!!tt.totalLength||!!tt.forceAverage||tt.average,y=W.currencyPosition||Le.position,T=W.currencySymbol||Le.symbol;tt.spaceSeparated&&(Te=" "),y==="infix"&&(Fe=Te+T+Te);var $=S({instance:Pe,providedFormat:W,state:Xe,decimalSeparator:Fe});return y==="prefix"&&($=Pe._value<0&&tt.negative==="sign"?"-".concat(Te).concat(T).concat($.slice(1)):T+Te+$),y&&y!=="postfix"||($=$+(Te=v?"":Te)+T),$}(j,z,o);case"percent":return z=b(z,o.currentPercentageDefaultFormat()),function(Pe,W,Xe,Le){var tt=W.prefixSymbol,Fe=S({instance:Le(100*Pe._value),providedFormat:W,state:Xe}),Te=Object.assign({},h,W);return tt?"%".concat(Te.spaceSeparated?" ":"").concat(Fe):"".concat(Fe).concat(Te.spaceSeparated?" ":"","%")}(j,z,o,G);case"byte":return z=b(z,o.currentByteDefaultFormat()),m=j,O=o,I=G,F=(w=z).base||"binary",U=c[F],K=g(m._value,U.suffixes,U.scale),le=K.value,he=K.suffix,Q=S({instance:I(le),providedFormat:w,state:O,defaults:O.currentByteDefaultFormat()}),Oe=O.currentAbbreviations(),"".concat(Q).concat(Oe.spaced?" ":"").concat(he);case"time":return z=b(z,o.currentTimeDefaultFormat()),we=j,pe=Math.floor(we._value/60/60),ht=Math.floor((we._value-60*pe*60)/60),f=Math.round(we._value-60*pe*60-60*ht),"".concat(pe,":").concat(ht<10?"0":"").concat(ht,":").concat(f<10?"0":"").concat(f);case"ordinal":return z=b(z,o.currentOrdinalDefaultFormat()),Z=j,ne=z,Ce=(ie=o).currentOrdinal(),Me=Object.assign({},h,ne),et=S({instance:Z,providedFormat:ne,state:ie}),Ne=Ce(Z._value),"".concat(et).concat(Me.spaceSeparated?" ":"").concat(Ne);case"number":default:return S({instance:j,providedFormat:z,numbro:G})}var Z,ne,ie,Ce,Me,et,Ne,we,pe,ht,f,m,w,O,I,F,U,K,le,he,Q,Oe}(R,E,H);return Y=(Y=P+Y)+B}function g(R,E,H){var P=E[0],B=Math.abs(R);if(H<=B){for(var Y=1;Y<E.length;++Y){var j=Math.pow(H,Y),z=Math.pow(H,Y+1);if(j<=B&&B<z){P=E[Y],R/=j;break}}P===E[0]&&(R/=Math.pow(H,E.length-1),P=E[E.length-1])}return{value:R,suffix:P}}function p(R){for(var E="",H=0;H<R;H++)E+="0";return E}function C(R,E){return R.toString().indexOf("e")!==-1?function(H,P){var B=H.toString(),Y=s(B.split("e"),2),j=Y[0],z=Y[1],G=s(j.split("."),2),Z=G[0],ne=G[1],ie=ne===void 0?"":ne;if(0<+z)B=Z+ie+p(z-ie.length);else{var Ce=".";Ce=+Z<0?"-0".concat(Ce):"0".concat(Ce);var Me=(p(-z-1)+Math.abs(Z)+ie).substr(0,P);Me.length<P&&(Me+=p(P-Me.length)),B=Ce+Me}return 0<+z&&0<P&&(B+=".".concat(p(P))),B}(R,E):(Math.round(+"".concat(R,"e+").concat(E))/Math.pow(10,E)).toFixed(E)}function S(R){var E=R.instance,H=R.providedFormat,P=R.state,B=P===void 0?o:P,Y=R.decimalSeparator,j=R.defaults,z=j===void 0?B.currentDefaults():j,G=E._value;if(G===0&&B.hasZeroFormat())return B.getZeroFormat();if(!isFinite(G))return G.toString();var Z,ne,ie,Ce,Me,et,Ne,we,pe=Object.assign({},h,z,H),ht=pe.totalLength,f=ht?0:pe.characteristic,m=pe.optionalCharacteristic,w=pe.forceAverage,O=!!ht||!!w||pe.average,I=ht?-1:O&&H.mantissa===void 0?0:pe.mantissa,F=!ht&&(H.optionalMantissa===void 0?I===-1:pe.optionalMantissa),U=pe.trimMantissa,K=pe.thousandSeparated,le=pe.spaceSeparated,he=pe.negative,Q=pe.forceSign,Oe=pe.exponential,Pe="";if(O){var W=function(v){var y=v.value,T=v.forceAverage,$=v.abbreviations,_=v.spaceSeparated,k=_!==void 0&&_,N=v.totalLength,x=N===void 0?0:N,L="",D=Math.abs(y),V=-1;if(D>=Math.pow(10,12)&&!T||T==="trillion"?(L=$.trillion,y/=Math.pow(10,12)):D<Math.pow(10,12)&&D>=Math.pow(10,9)&&!T||T==="billion"?(L=$.billion,y/=Math.pow(10,9)):D<Math.pow(10,9)&&D>=Math.pow(10,6)&&!T||T==="million"?(L=$.million,y/=Math.pow(10,6)):(D<Math.pow(10,6)&&D>=Math.pow(10,3)&&!T||T==="thousand")&&(L=$.thousand,y/=Math.pow(10,3)),L&&(L=(k?" ":"")+L),x){var te=y.toString().split(".")[0];V=Math.max(x-te.length,0)}return{value:y,abbreviation:L,mantissaPrecision:V}}({value:G,forceAverage:w,abbreviations:B.currentAbbreviations(),spaceSeparated:le,totalLength:ht});G=W.value,Pe+=W.abbreviation,ht&&(I=W.mantissaPrecision)}if(Oe){var Xe=(ne=(Z={value:G,characteristicPrecision:f}).value,ie=Z.characteristicPrecision,Ce=ie===void 0?0:ie,Me=s(ne.toExponential().split("e"),2),et=Me[0],Ne=Me[1],we=+et,Ce&&1<Ce&&(we*=Math.pow(10,Ce-1),Ne=0<=(Ne=+Ne-(Ce-1))?"+".concat(Ne):Ne),{value:we,abbreviation:"e".concat(Ne)});G=Xe.value,Pe=Xe.abbreviation+Pe}var Le,tt,Fe,Te=function(v,y,T,$,_){if($===-1)return v;var k=C(y,$),N=s(k.toString().split("."),2),x=N[0],L=N[1],D=L===void 0?"":L;if(D.match(/^0+$/)&&(T||_))return x;var V=D.match(/0+$/);return _&&V?"".concat(x,".").concat(D.toString().slice(0,V.index)):k.toString()}(G.toString(),G,F,I,U);return Te=function(v,y,T,$,_){var k=$.currentDelimiters(),N=k.thousands;_=_||k.decimal;var x=k.thousandsSize||3,L=v.toString(),D=L.split(".")[0],V=L.split(".")[1];return T&&(y<0&&(D=D.slice(1)),function(te,ue){for(var ye=[],$e=0,qe=te;0<qe;qe--)$e===ue&&(ye.unshift(qe),$e=0),$e++;return ye}(D.length,x).forEach(function(te,ue){D=D.slice(0,te+ue)+N+D.slice(te+ue)}),y<0&&(D="-".concat(D))),L=V?D+_+V:D}(Te=function(v,y,T,$){var _=v,k=s(_.toString().split("."),2),N=k[0],x=k[1];if(N.match(/^-?0$/)&&T)return x?"".concat(N.replace("0",""),".").concat(x):N.replace("0","");if(N.length<$)for(var L=$-N.length,D=0;D<L;D++)_="0".concat(_);return _.toString()}(Te,0,m,f),G,K,B,Y),(O||Oe)&&(Te=Te+Pe),(Q||G<0)&&(Le=Te,Fe=he,Te=(tt=G)===0?Le:+Le==0?Le.replace("-",""):0<tt?"+".concat(Le):Fe==="sign"?Le:"(".concat(Le.replace("-",""),")")),Te}function b(R,E){if(!R)return E;var H=Object.keys(R);return H.length===1&&H[0]==="output"?E:R}i.exports=function(R){return{format:function(){for(var E=arguments.length,H=new Array(E),P=0;P<E;P++)H[P]=arguments[P];return d.apply(void 0,H.concat([R]))},getByteUnit:function(){for(var E=arguments.length,H=new Array(E),P=0;P<E;P++)H[P]=arguments[P];return function(B){var Y=c.general;return g(B._value,Y.suffixes,Y.scale).suffix}.apply(void 0,H.concat([R]))},getBinaryByteUnit:function(){for(var E=arguments.length,H=new Array(E),P=0;P<E;P++)H[P]=arguments[P];return function(B){var Y=c.binary;return g(B._value,Y.suffixes,Y.scale).suffix}.apply(void 0,H.concat([R]))},getDecimalByteUnit:function(){for(var E=arguments.length,H=new Array(E),P=0;P<E;P++)H[P]=arguments[P];return function(B){var Y=c.decimal;return g(B._value,Y.suffixes,Y.scale).suffix}.apply(void 0,H.concat([R]))},formatOrDefault:b}}},{"./globalState":4,"./parsing":8,"./validating":10}],4:[function(n,i,r){var s=n("./en-US"),o=n("./validating"),a=n("./parsing"),l={},u=void 0,c={},h=null,d={};function g(C){u=C}function p(){return c[u]}l.languages=function(){return Object.assign({},c)},l.currentLanguage=function(){return u},l.currentCurrency=function(){return p().currency},l.currentAbbreviations=function(){return p().abbreviations},l.currentDelimiters=function(){return p().delimiters},l.currentOrdinal=function(){return p().ordinal},l.currentDefaults=function(){return Object.assign({},p().defaults,d)},l.currentOrdinalDefaultFormat=function(){return Object.assign({},l.currentDefaults(),p().ordinalFormat)},l.currentByteDefaultFormat=function(){return Object.assign({},l.currentDefaults(),p().byteFormat)},l.currentPercentageDefaultFormat=function(){return Object.assign({},l.currentDefaults(),p().percentageFormat)},l.currentCurrencyDefaultFormat=function(){return Object.assign({},l.currentDefaults(),p().currencyFormat)},l.currentTimeDefaultFormat=function(){return Object.assign({},l.currentDefaults(),p().timeFormat)},l.setDefaults=function(C){C=a.parseFormat(C),o.validateFormat(C)&&(d=C)},l.getZeroFormat=function(){return h},l.setZeroFormat=function(C){return h=typeof C=="string"?C:null},l.hasZeroFormat=function(){return h!==null},l.languageData=function(C){if(C){if(c[C])return c[C];throw new Error('Unknown tag "'.concat(C,'"'))}return p()},l.registerLanguage=function(C){var S=1<arguments.length&&arguments[1]!==void 0&&arguments[1];if(!o.validateLanguage(C))throw new Error("Invalid language data");c[C.languageTag]=C,S&&g(C.languageTag)},l.setLanguage=function(C){var S=1<arguments.length&&arguments[1]!==void 0?arguments[1]:s.languageTag;if(!c[C]){var b=C.split("-")[0],R=Object.keys(c).find(function(E){return E.split("-")[0]===b});return c[R]?void g(R):void g(S)}g(C)},l.registerLanguage(s),u=s.languageTag,i.exports=l},{"./en-US":2,"./parsing":8,"./validating":10}],5:[function(n,i,r){i.exports=function(s){return{loadLanguagesInNode:function(o){return a=s,void o.forEach(function(l){var u=void 0;try{u=n("../languages/".concat(l))}catch{console.error('Unable to load "'.concat(l,'". No matching language file found.'))}u&&a.registerLanguage(u)});var a}}}},{}],6:[function(n,i,r){var s=n("bignumber.js");function o(a,l,u){var c=new s(a._value),h=l;return u.isNumbro(l)&&(h=l._value),h=new s(h),a._value=c.minus(h).toNumber(),a}i.exports=function(a){return{add:function(l,u){return h=u,d=a,g=new s((c=l)._value),p=h,d.isNumbro(h)&&(p=h._value),p=new s(p),c._value=g.plus(p).toNumber(),c;var c,h,d,g,p},subtract:function(l,u){return o(l,u,a)},multiply:function(l,u){return h=u,d=a,g=new s((c=l)._value),p=h,d.isNumbro(h)&&(p=h._value),p=new s(p),c._value=g.times(p).toNumber(),c;var c,h,d,g,p},divide:function(l,u){return h=u,d=a,g=new s((c=l)._value),p=h,d.isNumbro(h)&&(p=h._value),p=new s(p),c._value=g.dividedBy(p).toNumber(),c;var c,h,d,g,p},set:function(l,u){return c=l,d=h=u,a.isNumbro(h)&&(d=h._value),c._value=d,c;var c,h,d},difference:function(l,u){return c=u,o(d=(h=a)(l._value),c,h),Math.abs(d._value);var c,h,d}}}},{"bignumber.js":1}],7:[function(n,i,r){function s(S,b){for(var R=0;R<b.length;R++){var E=b[R];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(S,E.key,E)}}var o=n("./globalState"),a=n("./validating"),l=n("./loading")(C),u=n("./unformatting"),c=n("./formatting")(C),h=n("./manipulating")(C),d=n("./parsing"),g=function(){function S(E){(function(H,P){if(!(H instanceof P))throw new TypeError("Cannot call a class as a function")})(this,S),this._value=E}var b,R;return b=S,(R=[{key:"clone",value:function(){return C(this._value)}},{key:"format",value:function(){var E=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return c.format(this,E)}},{key:"formatCurrency",value:function(E){return typeof E=="string"&&(E=d.parseFormat(E)),(E=c.formatOrDefault(E,o.currentCurrencyDefaultFormat())).output="currency",c.format(this,E)}},{key:"formatTime",value:function(){var E=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return E.output="time",c.format(this,E)}},{key:"binaryByteUnits",value:function(){return c.getBinaryByteUnit(this)}},{key:"decimalByteUnits",value:function(){return c.getDecimalByteUnit(this)}},{key:"byteUnits",value:function(){return c.getByteUnit(this)}},{key:"difference",value:function(E){return h.difference(this,E)}},{key:"add",value:function(E){return h.add(this,E)}},{key:"subtract",value:function(E){return h.subtract(this,E)}},{key:"multiply",value:function(E){return h.multiply(this,E)}},{key:"divide",value:function(E){return h.divide(this,E)}},{key:"set",value:function(E){return h.set(this,p(E))}},{key:"value",value:function(){return this._value}},{key:"valueOf",value:function(){return this._value}}])&&s(b.prototype,R),S}();function p(S){var b=S;return C.isNumbro(S)?b=S._value:typeof S=="string"?b=C.unformat(S):isNaN(S)&&(b=NaN),b}function C(S){return new g(p(S))}C.version="2.1.2",C.isNumbro=function(S){return S instanceof g},C.language=o.currentLanguage,C.registerLanguage=o.registerLanguage,C.setLanguage=o.setLanguage,C.languages=o.languages,C.languageData=o.languageData,C.zeroFormat=o.setZeroFormat,C.defaultFormat=o.currentDefaults,C.setDefaults=o.setDefaults,C.defaultCurrencyFormat=o.currentCurrencyDefaultFormat,C.validate=a.validate,C.loadLanguagesInNode=l.loadLanguagesInNode,C.unformat=u.unformat,i.exports=C},{"./formatting":3,"./globalState":4,"./loading":5,"./manipulating":6,"./parsing":8,"./unformatting":9,"./validating":10}],8:[function(n,i,r){i.exports={parseFormat:function(s){var o,a,l,u,c,h,d,g,p,C,S,b,R,E,H,P,B,Y,j,z,G=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return typeof s!="string"?s:(a=G,s=(l=(o=s).match(/^{([^}]*)}/))?(a.prefix=l[1],o.slice(l[0].length)):o,c=G,function(Z,ne){if(Z.indexOf("$")===-1){if(Z.indexOf("%")===-1)return Z.indexOf("bd")!==-1?(ne.output="byte",ne.base="general"):Z.indexOf("b")!==-1?(ne.output="byte",ne.base="binary"):Z.indexOf("d")!==-1?(ne.output="byte",ne.base="decimal"):Z.indexOf(":")===-1?Z.indexOf("o")!==-1&&(ne.output="ordinal"):ne.output="time";ne.output="percent"}else ne.output="currency"}(s=(h=(u=s).match(/{([^}]*)}$/))?(c.postfix=h[1],u.slice(0,-h[0].length)):u,G),d=G,(g=s.match(/[1-9]+[0-9]*/))&&(d.totalLength=+g[0]),p=G,(C=s.split(".")[0].match(/0+/))&&(p.characteristic=C[0].length),function(Z,ne){if(Z.indexOf(".")!==-1){var ie=Z.split(".")[0];ne.optionalCharacteristic=ie.indexOf("0")===-1}}(s,G),S=G,s.indexOf("a")!==-1&&(S.average=!0),R=G,(b=s).indexOf("K")!==-1?R.forceAverage="thousand":b.indexOf("M")!==-1?R.forceAverage="million":b.indexOf("B")!==-1?R.forceAverage="billion":b.indexOf("T")!==-1&&(R.forceAverage="trillion"),function(Z,ne){var ie=Z.split(".")[1];if(ie){var Ce=ie.match(/0+/);Ce&&(ne.mantissa=Ce[0].length)}}(s,G),H=G,(E=s).match(/\[\.]/)?H.optionalMantissa=!0:E.match(/\./)&&(H.optionalMantissa=!1),P=G,s.indexOf(",")!==-1&&(P.thousandSeparated=!0),B=G,s.indexOf(" ")!==-1&&(B.spaceSeparated=!0),j=G,(Y=s).match(/^\+?\([^)]*\)$/)&&(j.negative="parenthesis"),Y.match(/^\+?-/)&&(j.negative="sign"),z=G,s.match(/^\+/)&&(z.forceSign=!0),G)}}},{}],9:[function(n,i,r){var s=[{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 o(l){return l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(l,u){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:"",h=3<arguments.length?arguments[3]:void 0,d=4<arguments.length?arguments[4]:void 0,g=5<arguments.length?arguments[5]:void 0,p=6<arguments.length?arguments[6]:void 0;if(l!=="")return l===d?0:function C(S,b){var R=2<arguments.length&&arguments[2]!==void 0?arguments[2]:"",E=3<arguments.length?arguments[3]:void 0,H=4<arguments.length?arguments[4]:void 0,P=5<arguments.length?arguments[5]:void 0,B=6<arguments.length?arguments[6]:void 0;if(!isNaN(+S))return+S;var Y="",j=S.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(j!==S)return-1*C(j,b,R,E,H,P,B);for(var z=0;z<s.length;z++){var G=s[z];if((Y=S.replace(G.key,""))!==S)return C(Y,b,R,E,H,P,B)*G.factor}if((Y=S.replace("%",""))!==S)return C(Y,b,R,E,H,P,B)/100;var Z=parseFloat(S);if(!isNaN(Z)){var ne=E(Z);if(ne&&ne!=="."&&(Y=S.replace(new RegExp("".concat(o(ne),"$")),""))!==S)return C(Y,b,R,E,H,P,B);var ie={};Object.keys(P).forEach(function(ht){ie[P[ht]]=ht});for(var Ce=Object.keys(ie).sort().reverse(),Me=Ce.length,et=0;et<Me;et++){var Ne=Ce[et],we=ie[Ne];if((Y=S.replace(Ne,""))!==S){var pe=void 0;switch(we){case"thousand":pe=Math.pow(10,3);break;case"million":pe=Math.pow(10,6);break;case"billion":pe=Math.pow(10,9);break;case"trillion":pe=Math.pow(10,12)}return C(Y,b,R,E,H,P,B)*pe}}}}(function(C,S){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:"",R=C.replace(b,"");return R=(R=R.replace(new RegExp("([0-9])".concat(o(S.thousands),"([0-9])"),"g"),"$1$2")).replace(S.decimal,".")}(l,u,c),u,c,h,d,g,p)}i.exports={unformat:function(l,u){var c,h,d,g=n("./globalState"),p=g.currentDelimiters(),C=g.currentCurrency().symbol,S=g.currentOrdinal(),b=g.getZeroFormat(),R=g.currentAbbreviations(),E=void 0;if(typeof l=="string")E=function(H,P){if(!H.indexOf(":")||P.thousands===":")return!1;var B=H.split(":");if(B.length!==3)return!1;var Y=+B[0],j=+B[1],z=+B[2];return!isNaN(Y)&&!isNaN(j)&&!isNaN(z)}(l,p)?(c=l.split(":"),h=+c[0],d=+c[1],+c[2]+60*d+3600*h):a(l,p,C,S,b,R,u);else{if(typeof l!="number")return;E=l}if(E!==void 0)return E}}},{"./globalState":4}],10:[function(n,i,r){function s(p){return function(C){if(Array.isArray(C)){for(var S=0,b=new Array(C.length);S<C.length;S++)b[S]=C[S];return b}}(p)||function(C){if(Symbol.iterator in Object(C)||Object.prototype.toString.call(C)==="[object Arguments]")return Array.from(C)}(p)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function o(p){return(o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C})(p)}var a=n("./unformatting"),l=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,u={output:{type:"string",validValues:["currency","percent","byte","time","ordinal","number"]},base:{type:"string",validValues:["decimal","binary","general"],restriction:function(p,C){return C.output==="byte"},message:"`base` must be provided only when the output is `byte`",mandatory:function(p){return p.output==="byte"}},characteristic:{type:"number",restriction:function(p){return 0<=p},message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:["trillion","billion","million","thousand"]},average:"boolean",currencyPosition:{type:"string",validValues:["prefix","infix","postfix"]},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:function(p){return 0<=p},message:"value must be positive"},{restriction:function(p,C){return!C.exponential},message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:function(p){return 0<=p},message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:["sign","parenthesis"]},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:function(p,C){return C.output==="percent"},message:"`prefixSymbol` can be provided only when the output is `percent`"}},c={languageTag:{type:"string",mandatory:!0,restriction:function(p){return p.match(l)},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:{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},spaceSeparated:"boolean",ordinal:{type:"function",mandatory:!0},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 h(p){return!!a.unformat(p)}function d(p,C,S){var b=3<arguments.length&&arguments[3]!==void 0&&arguments[3],R=Object.keys(p).map(function(E){if(!C[E])return console.error("".concat(S," Invalid key: ").concat(E)),!1;var H=p[E],P=C[E];if(typeof P=="string"&&(P={type:P}),P.type==="format"){if(!d(H,u,"[Validate ".concat(E,"]"),!0))return!1}else if(o(H)!==P.type)return console.error("".concat(S," ").concat(E,' type mismatched: "').concat(P.type,'" expected, "').concat(o(H),'" provided')),!1;if(P.restrictions&&P.restrictions.length)for(var B=P.restrictions.length,Y=0;Y<B;Y++){var j=P.restrictions[Y],z=j.restriction,G=j.message;if(!z(H,p))return console.error("".concat(S," ").concat(E," invalid value: ").concat(G)),!1}return P.restriction&&!P.restriction(H,p)?(console.error("".concat(S," ").concat(E," invalid value: ").concat(P.message)),!1):P.validValues&&P.validValues.indexOf(H)===-1?(console.error("".concat(S," ").concat(E," invalid value: must be among ").concat(JSON.stringify(P.validValues),', "').concat(H,'" provided')),!1):!(P.children&&!d(H,P.children,"[Validate ".concat(E,"]")))});return b||R.push.apply(R,s(Object.keys(C).map(function(E){var H=C[E];if(typeof H=="string"&&(H={type:H}),H.mandatory){var P=H.mandatory;if(typeof P=="function"&&(P=P(p)),P&&p[E]===void 0)return console.error("".concat(S,' Missing mandatory key "').concat(E,'"')),!1}return!0}))),R.reduce(function(E,H){return E&&H},!0)}function g(p){return d(p,u,"[Validate format]")}i.exports={validate:function(p,C){var S=h(p),b=g(C);return S&&b},validateFormat:g,validateInput:h,validateLanguage:function(p){return d(p,c,"[Validate language]")}}},{"./unformatting":9}]},{},[7])(7)})})(DO);var Q4=DO.exports;const Jo=xA(Q4),J4="numeric";function LO(t,e){if(Bn(t)){const n=e.numericFormat,i=n&&n.culture||"-",r=n&&n.pattern;if(typeof i<"u"&&!Jo.languages()[i]){const s=i.replace("-",""),o=Jo.allLanguages?Jo.allLanguages[i]:Jo[s];o&&Jo.registerLanguage(o)}Jo.setLanguage(i),t=Jo(t).format(r||"0")}return t}function Fb(t,e,n,i,r,s,o){let a=s;if(Bn(a)){const l=o.className||"",u=l.length?l.split(" "):[];a=LO(a,o),u.indexOf("htLeft")<0&&u.indexOf("htCenter")<0&&u.indexOf("htRight")<0&&u.indexOf("htJustify")<0&&u.push("htRight"),u.indexOf("htNumeric")<0&&u.push("htNumeric"),o.className=u.join(" "),e.dir="ltr"}js(t,e,n,i,r,a,o)}Fb.RENDERER_TYPE=J4;const eq="password";function Vb(t,e,n,i,r,s,o){js.apply(this,[t,e,n,i,r,s,o]);const a=o.hashLength||e.innerHTML.length,l=o.hashSymbol||"*";let u="";me(a-1,()=>{u+=l}),gu(e,u)}Vb.RENDERER_TYPE=eq;const tq="select";function Wb(t,e,n,i,r,s,o){js.apply(this,[t,e,n,i,r,s,o])}Wb.RENDERER_TYPE=tq;const nq="time";function Bb(t,e,n,i,r,s,o){js.apply(this,[t,e,n,i,r,s,o]),e.dir="ltr"}Bb.RENDERER_TYPE=nq;function iq(){_i(wu),_i($h),_i(Lb),_i(Db),_i(kb),_i(Nb),_i(Fb),_i(Vb),_i(Wb),_i(js),_i(Bb)}const rq="autocomplete";function Im(t,e){let n=t;if(n==null&&(n=""),this.allowEmpty&&n===""){e(!0);return}this.strict&&this.source?typeof this.source=="function"?this.source(n,CT(n,e)):CT(n,e)(this.source):e(!0)}Im.VALIDATOR_TYPE=rq;function CT(t,e){const n=t;return function(i){let r=!1;for(let s=0,o=i.length;s<o;s++)if(n===i[s]){r=!0;break}e(r)}}function sq(t){const e=new Date(t);return isNaN(new Date(`${t}T00:00`).getDate())?e:new Date(e.getTime()+e.getTimezoneOffset()*6e4)}const oq="date";function Ub(t,e){const n=TP(IO,this.instance);let i=t,r=!0;i==null&&(i="");let s=X(i,this.dateFormat||n.defaultDateFormat,!0).isValid(),o=X(new Date(i)).isValid()||s;if(this.allowEmpty&&i===""&&(o=!0,s=!0),o||(r=!1),!o&&s&&(r=!0),o&&!s)if(this.correctFormat===!0){const a=aq(i,this.dateFormat);this.instance.setDataAtCell(this.visualRow,this.visualCol,a,"dateValidator"),r=!0}else r=!1;e(r)}Ub.VALIDATOR_TYPE=oq;function aq(t,e){const n=X(sq(t)),i=X(t,e),r=t.search(/[A-z]/g)>-1;let s;return n.isValid()&&n.format("x")===i.format("x")||!i.isValid()||r?s=n:s=i,s.format(e)}const lq="dropdown";function Yb(t,e){Im.apply(this,[t,e])}Yb.VALIDATOR_TYPE=lq;const uq="numeric";function zb(t,e){let n=t;n==null&&(n=""),this.allowEmpty&&n===""?e(!0):e(n===""?!1:Bn(t))}zb.VALIDATOR_TYPE=uq;const cq=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],hq="time";function Gb(t,e){const n=this.timeFormat||"h:mm:ss a";let i=!0,r=t;r===null&&(r=""),r=/^\d{3,}$/.test(r)?parseInt(r,10):r;const s=/^\d{1,2}$/.test(r);s&&(r+=":00");const o=X(r,cq,!0).isValid()?X(r):X(r,n);let a=o.isValid(),l=X(r,n,!0).isValid()&&!s;if(this.allowEmpty&&r===""&&(a=!0,l=!0),a||(i=!1),!a&&l&&(i=!0),a&&!l)if(this.correctFormat===!0){const u=o.format(n);this.instance.setDataAtCell(this.visualRow,this.visualCol,u,"timeValidator"),i=!0}else i=!1;e(i)}Gb.VALIDATOR_TYPE=hq;function dq(){$l(Im),$l(Yb),$l(Ub),$l(zb),$l(Gb)}const fq="autocomplete",gq={CELL_TYPE:fq,editor:xb,renderer:wu,validator:Im},mq="checkbox",pq={CELL_TYPE:mq,editor:_O,renderer:Lb},wq="date";function $O(t,e,n,i,r,s,o){wu.apply(this,[t,e,n,i,r,s,o])}$O.RENDERER_TYPE=wq;const Cq="date",vq={CELL_TYPE:Cq,editor:PO,renderer:$O,validator:Ub},Sq="dropdown",yq={CELL_TYPE:Sq,editor:Hb,renderer:Db,validator:Yb},bq="handsontable",Rq={CELL_TYPE:bq,editor:Ob,renderer:kb},Eq="numeric",Tq={CELL_TYPE:Eq,editor:OO,renderer:Fb,validator:zb,dataType:"number"},Mq="password",_q={CELL_TYPE:Mq,editor:xO,renderer:Vb,copyable:!1},Iq="select",Pq={CELL_TYPE:Iq,editor:AO,renderer:Wb},Oq="time",xq={CELL_TYPE:Oq,editor:HO,renderer:Bb,validator:Gb};function Aq(){tr(gq),tr(pq),tr(vq),tr(yq),tr(Rq),tr(Tq),tr(_q),tr(Pq),tr(MO),tr(xq)}function Hq(t,e){kO(t,e),e.add(t)}function Nq(t,e,n){kO(t,e),e.set(t,n)}function kO(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hl(t,e,n){return e=Dq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dq(t){var e=Lq(t,"string");return typeof e=="symbol"?e:e+""}function Lq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dl(t,e){return t.get(FO(t,e))}function FO(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 vT=new Map([["plugin",o2],["cell-type",wO],["editor",EP],["renderer",AP],["validator",HP]]),$q="base",fw=[];let Or=null;var ea=new WeakMap,ST=new WeakSet;class ut{static get PLUGIN_KEY(){return $q}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}constructor(e){Hq(this,ST),hl(this,"eventManager",new wr(this)),hl(this,"pluginName",null),hl(this,"pluginsInitializedCallbacks",[]),hl(this,"isPluginsReady",!1),hl(this,"enabled",!1),hl(this,"initialized",!1),Nq(this,ea,{}),zs(this,"hot",e,{writable:!1}),Or=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);const e=this.constructor.PLUGIN_DEPS,n=Array.isArray(e)?e:[];if(n.length>0){const r=[];if(n.forEach(s=>{const[o,a]=s.split(":");if(!vT.has(o))throw new Error(`Unknown plugin dependency type "${o}" was found.`);vT.get(o)(a)||r.push(` - ${a} (${o})`)}),r.length>0){const s=[`The ${this.pluginName} plugin requires the following modules:
|
|
`,`${r.join(`
|
|
`)}
|
|
`].join("");fw.push(s)}}if(Or||(Or=xP()),Or.indexOf("UndoRedo")>=0&&Or.splice(Or.indexOf("UndoRedo"),1),Or.indexOf(this.pluginName)>=0&&Or.splice(Or.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()}),Or.length===0){if(fw.length>0){const r=[`${fw.join(`
|
|
`)}
|
|
`,"You have to import and register them manually."].join("");throw new Error(r)}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}addHook(e,n,i){dl(ea,this)[e]=dl(ea,this)[e]||[];const r=dl(ea,this)[e];this.hot.addHook(e,n,i),r.push(n),dl(ea,this)[e]=r}removeHooks(e){M(dl(ea,this)[e]||[],n=>{this.hot.removeHook(e,n)})}clearHooks(){const e=dl(ea,this);Ue(e,(n,i)=>this.removeHooks(i)),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){M(this.pluginsInitializedCallbacks,e=>e()),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){const n=FO(ST,this,kq).call(this,e);this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&n&&this.updatePlugin(e))}updatePlugin(){}destroy(){var e;(e=this.eventManager)===null||e===void 0||e.destroy(),this.clearHooks(),Ue(this,(n,i)=>{i!=="hot"&&(this[i]=null)}),delete this.t,delete this.hot}}function kq(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 ta(t,e,n){return e=Fq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fq(t){var e=Vq(t,"string");return typeof e=="symbol"?e:e+""}function Vq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}let VO=class{constructor(e){ta(this,"hot",null),ta(this,"container",null),ta(this,"injected",!1),ta(this,"rows",[]),ta(this,"columns",[]),ta(this,"samples",null),ta(this,"settings",{useHeaders:!0}),this.hot=e}addRow(e,n){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));const i={row:e};this.rows.push(i),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),i.table=this.table.table}addColumnHeadersRow(e){const n=this.hot.getColHeader(0);if(n!=null){const i={row:-1};this.rows.push(i),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),i.table=this.table.table}}addColumn(e,n){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));const i={col:e};this.columns.push(i),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),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),i.table=this.table.table}getHeights(e){this.injected||this.injectTable(),M(this.rows,n=>{e(n.row,Yt(n.table)-1)})}getWidths(e){this.injected||this.injectTable(),M(this.columns,n=>{const{width:i}=n.table.getBoundingClientRect();e(n.col,Math.ceil(i))})}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(i=>{M(i.strings,r=>{n.appendChild(this.createColElement(r.col,e))})}),n}createRow(e){const{rootDocument:n}=this.hot,i=n.createDocumentFragment(),r=n.createElement("th");return this.hot.hasRowHeaders()&&(this.hot.view.appendRowHeader(e,r),i.appendChild(r)),this.samples.forEach(s=>{M(s.strings,o=>{const a=o.col,l=this.hot.getCellMeta(e,a),u=this.hot.getCellRenderer(l),c=n.createElement("td");c.setAttribute("ghost-table",1),u(this.hot,c,e,a,this.hot.colToProp(a),o.value,l),i.appendChild(c)})}),i}appendColumnHeadersRow(){const{rootDocument:e}=this.hot,n=e.createDocumentFragment(),i=[];if(this.hot.hasRowHeaders()){const r=e.createElement("th");i.push([-1,r]),n.appendChild(r)}this.samples.forEach(r=>{M(r.strings,s=>{const o=s.col,a=e.createElement("th");i.push([o,a]),n.appendChild(a)})}),this.table.tHead.appendChild(n),M(i,r=>{const[s,o]=r;this.hot.view.appendColHeader(s,o)})}createCol(e){const{rootDocument:n}=this.hot,i=n.createDocumentFragment();return this.samples.forEach(r=>{M(r.strings,s=>{const o=s.row,a=this.hot.getCellMeta(o,e),l=this.hot.getCellRenderer(a),u=n.createElement("td"),c=n.createElement("tr");u.setAttribute("ghost-table",1),l(this.hot,u,o,e,this.hot.colToProp(e),s.value,a),c.appendChild(u),i.appendChild(c)})}),i}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 i=this.hot.rootDocument.createElement("col");let r=0;n>=0&&e>=0&&(r=this.hot.getCellMeta(n,e).colspan);let s=this.hot.getColWidth(e);if(r>1)for(let o=e+1;o<e+r;o++)s+=this.hot.getColWidth(o);return i.style.width=`${s}px`,i}createTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:n}=this.hot,i=n.createDocumentFragment(),r=n.createElement("table"),s=n.createElement("thead"),o=n.createElement("tbody"),a=n.createElement("colgroup"),l=n.createElement("tr"),u=n.createElement("th");return this.isVertical()&&r.appendChild(a),this.isHorizontal()&&(l.appendChild(u),s.appendChild(l),r.style.tableLayout="auto",r.style.width="auto"),r.appendChild(s),this.isVertical()&&o.appendChild(l),r.appendChild(o),q(r,e),i.appendChild(r),{fragment:i,table:r,tHead:s,tBody:o,colGroup:a,tr:l,th:u}}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:n}=this.hot,i=n.createDocumentFragment(),r=n.createElement("div"),s=`htGhostTable htAutoSize ${e.trim()}`;return q(r,s),i.appendChild(r),{fragment:i,container:r}}isVertical(){return!!(this.rows.length&&!this.columns.length)}isHorizontal(){return!!(this.columns.length&&!this.rows.length)}};function Wd(t,e,n){return e=Wq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wq(t){var e=Bq(t,"string");return typeof e=="symbol"?e:e+""}function Bq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Pm{static get SAMPLE_COUNT(){return 3}constructor(e){Wd(this,"samples",null),Wd(this,"dataFactory",null),Wd(this,"customSampleCount",null),Wd(this,"allowDuplicates",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:Pm.SAMPLE_COUNT}setSampleCount(e){this.customSampleCount=e}setAllowDuplicates(e){this.allowDuplicates=e}generateRowSamples(e,n){return this.generateSamples("row",n,e)}generateColumnSamples(e,n){return this.generateSamples("col",n,e)}generateSamples(e,n,i){const r=new Map,{from:s,to:o}=typeof i=="number"?{from:i,to:i}:i;return me(s,o,a=>{const l=this.generateSample(e,n,a);r.set(a,l)}),r}generateSample(e,n,i){if(e!=="row"&&e!=="col")throw new Error("Unsupported sample type");const r=new Map,s=e==="row"?"col":"row",o=[];return me(n.from,n.to,a=>{const l=e==="row"?this.dataFactory(i,a):this.dataFactory(a,i);if(l===!1)return;const{value:u,bundleSeed:c}=l,h=typeof c=="string"&&c.length>0;let d;h?d=c:ke(u)?d=`${Object.keys(u).length}`:Array.isArray(u)?d=`${u.length}`:d=`${Qt(u).length}`,r.has(d)||r.set(d,{needed:this.getSampleCount(),strings:[]});const g=r.get(d);g.needed&&(!(o.indexOf(u)>-1)||this.allowDuplicates||h)&&(g.strings.push({value:u,[s]:a}),o.push(u),g.needed-=1)}),r}}function Uq(t,e){WO(t,e),e.add(t)}function Yq(t,e,n){WO(t,e),e.set(t,n)}function WO(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fl(t,e,n){return e=zq(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zq(t){var e=Gq(t,"string");return typeof e=="symbol"?e:e+""}function Gq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jq(t,e,n){return t.set(bs(t,e),n),n}function Bd(t,e){return t.get(bs(t,e))}function bs(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")}ce.getSingleton().register("modifyAutoColumnSizeSeed");const Gu="autoColumnSize",Kq=10,Xq="autoColumnSize";var kl=new WeakMap,Zs=new WeakSet;class Lc extends ut{static get PLUGIN_KEY(){return Gu}static get PLUGIN_PRIORITY(){return Kq}static get SETTING_KEYS(){return!0}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 50}constructor(e){super(e),Uq(this,Zs),fl(this,"ghostTable",new VO(this.hot)),fl(this,"samplesGenerator",new Pm((n,i)=>{const r=this.hot.toPhysicalRow(n),s=this.hot.toPhysicalColumn(i);if(this.hot.rowIndexMapper.isHidden(r)||this.hot.columnIndexMapper.isHidden(s))return!1;const o=this.hot.getCellMeta(n,i);let a="";o.spanned||(a=this.hot.getDataAtCell(n,i));let l="";return this.hot.hasHook("modifyAutoColumnSizeSeed")&&(l=this.hot.runHooks("modifyAutoColumnSizeSeed",l,o,a)),{value:a,bundleSeed:l}})),fl(this,"firstCalculation",!0),fl(this,"inProgress",!1),fl(this,"measuredColumns",0),fl(this,"columnWidthsMap",new $o),Yq(this,kl,[]),this.hot.columnIndexMapper.registerMap(Xq,this.columnWidthsMap),this.addHook("beforeColumnResize",(n,i,r)=>bs(Zs,this,yT).call(this,n,i,r))}isEnabled(){return this.hot.getSettings()[Gu]!==!1&&!this.hot.getSettings().colWidths}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[Gu];n&&n.useHeaders!==null&&n.useHeaders!==void 0&&this.ghostTable.setSetting("useHeaders",n.useHeaders),this.setSamplingOptions(),this.addHook("afterLoadData",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return bs(Zs,e,Zq).call(e,...r)}),this.addHook("beforeChangeRender",i=>bs(Zs,this,Qq).call(this,i)),this.addHook("afterFormulasValuesUpdate",i=>bs(Zs,this,e6).call(this,i)),this.addHook("beforeViewRender",i=>bs(Zs,this,qq).call(this,i)),this.addHook("modifyColWidth",(i,r)=>this.getColumnWidth(r,i)),this.addHook("afterInit",()=>bs(Zs,this,Jq).call(this)),super.enablePlugin()}updatePlugin(){const e=this.findColumnsWhereHeaderWasChanged();e.length&&(this.clearCache(e),this.calculateVisibleColumnsWidth()),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.addHook("beforeColumnResize",(e,n,i)=>bs(Zs,this,yT).call(this,e,n,i))}calculateVisibleColumnsWidth(){if(!this.hot.countRows())return;const n=this.hot.renderCall,i=this.getFirstVisibleColumn(),r=this.getLastVisibleColumn();i===-1||r===-1||this.calculateColumnsWidth({from:i,to:r},void 0,n)}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},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const r=typeof e=="number"?{from:e,to:e}:e,s=typeof n=="number"?{from:n,to:n}:n;me(r.from,r.to,o=>{let a=this.hot.toPhysicalColumn(o);if(a===null&&(a=o),i||this.columnWidthsMap.getValueAtIndex(a)===null&&!this.hot._getColWidthFromSettings(a)){const l=this.samplesGenerator.generateColumnSamples(o,s);M(l,u=>{let[c,h]=u;return this.ghostTable.addColumn(c,h)})}}),this.ghostTable.columns.length&&(this.hot.batchExecution(()=>{this.ghostTable.getWidths((o,a)=>{const l=this.hot.toPhysicalColumn(o);this.columnWidthsMap.setValueAtIndex(l,a)})},!0),this.measuredColumns=r.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=0;const i=this.hot.countCols()-1;let r=null;this.inProgress=!0;const s=()=>{if(!this.hot){fg(r),this.inProgress=!1;return}this.calculateColumnsWidth({from:n,to:Math.min(n+Lc.CALCULATION_STEP,i)},e),n=n+Lc.CALCULATION_STEP+1,n<i?r=_S(s):(fg(r),this.inProgress=!1,this.hot.view.adjustElementsSize())},o=this.getSyncCalculationLimit();this.firstCalculation&&o>=0&&(this.calculateColumnsWidth({from:0,to:o},e),this.firstCalculation=!1,n=o+1),n<i?s():this.inProgress=!1}setSamplingOptions(){const e=this.hot.getSettings()[Gu],n=e&&Ut(e,"samplingRatio")?e.samplingRatio:void 0,i=e&&Ut(e,"allowSampleDuplicates")?e.allowSampleDuplicates:void 0;n&&!isNaN(n)&&this.samplesGenerator.setSampleCount(parseInt(n,10)),i&&this.samplesGenerator.setAllowDuplicates(i)}recalculateAllColumnsWidth(){this.hot.view&&this.hot.view._wt.wtTable.isVisible()&&(this.clearCache(),this.calculateAllColumnsWidth())}getSyncCalculationLimit(){const e=this.hot.getSettings()[Gu];let n=Lc.SYNC_CALCULATION_LIMIT;const i=this.hot.countCols()-1;return ke(e)&&(n=e.syncLimit,zI(n)?n=IP(i,n):n>>=0),Math.min(n,i)}getColumnWidth(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=n;return r===void 0&&(r=this.columnWidthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e)),i&&typeof r=="number"&&(r=Math.max(r,Ah.DEFAULT_WIDTH))),r}getFirstVisibleColumn(){const e=this.hot.view._wt;if(e.wtViewport.columnsVisibleCalculator){const n=e.wtTable.getFirstVisibleColumn();if(n!==-1)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(n)}if(e.wtViewport.columnsRenderCalculator){const n=e.wtTable.getFirstRenderedColumn();if(n!==-1)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(n)}return-1}getLastVisibleColumn(){const e=this.hot.view._wt;if(e.wtViewport.columnsVisibleCalculator){const n=e.wtTable.getLastVisibleColumn();if(n!==-1)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(n)}if(e.wtViewport.columnsRenderCalculator){const n=e.wtTable.getLastRenderedColumn();if(n!==-1)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(n)}return-1}findColumnsWhereHeaderWasChanged(){const e=this.hot.getColHeader();return Hn(e,(i,r,s)=>{const o=Bd(kl,this).length;return(o-1<s||Bd(kl,this)[s]!==r)&&i.push(s),o-1<s?Bd(kl,this).push(r):Bd(kl,this)[s]=r,i},[])}clearCache(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];e.length?this.hot.batchExecution(()=>{M(e,n=>{this.columnWidthsMap.setValueAtIndex(n,null)})},!0):this.columnWidthsMap.clear()}isNeedRecalculate(){return!!gr(this.columnWidthsMap.getValues().slice(0,this.measuredColumns),e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function qq(){this.calculateVisibleColumnsWidth(),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllColumnsWidth()}function Zq(){this.hot.view?this.recalculateAllColumnsWidth():setTimeout(()=>{this.hot&&this.recalculateAllColumnsWidth()},0)}function Qq(t){const e=Ke(t,n=>{let[,i]=n;return this.hot.toPhysicalColumn(this.hot.propToCol(i))});this.clearCache(Array.from(new Set(e)))}function yT(t,e,n){let i=t;return n&&(this.calculateColumnsWidth(e,void 0,!0),i=this.getColumnWidth(e,void 0,!1)),i}function Jq(){jq(kl,this,this.hot.getColHeader())}function e6(t){const e=gr(t,i=>{var r;return de((r=i.address)===null||r===void 0?void 0:r.col)}),n=Ke(e,i=>i.address.col);this.clearCache(Array.from(new Set(n)))}const Ta={horizontal:"horizontal",vertical:"vertical"};function t6(t,e,n){let i,r,s;return e[0]===t[0]&&e[1]<t[1]?(s="left",i=n(e[0],e[1]),r=n(e[2],t[1]-1)):e[2]===t[2]&&e[0]===t[0]&&e[3]>t[3]?(s="right",i=n(e[0],t[3]+1),r=n(e[2],e[3])):e[0]<t[0]&&e[1]===t[1]?(s="up",i=n(e[0],e[1]),r=n(t[0]-1,e[3])):e[2]>t[2]&&e[1]===t[1]&&(s="down",i=n(t[2]+1,e[1]),r=n(e[2],e[3])),i&&i.normalize(),r&&r.normalize(),{directionOfDrag:s,startOfDragCoords:i,endOfDragCoords:r}}function n6(t){const e={};return t===!0?(e.directions=Object.keys(Ta),e.autoInsertRow=!0):ke(t)?(de(t.autoInsertRow)?t.direction===Ta.horizontal?e.autoInsertRow=!1:e.autoInsertRow=t.autoInsertRow:e.autoInsertRow=!1,de(t.direction)?e.directions=[t.direction]:e.directions=Object.keys(Ta)):typeof t=="string"?(e.directions=[t],e.autoInsertRow=!0):(e.directions=[],e.autoInsertRow=!1),e}function i6(t,e){r6(t,e),e.add(t)}function r6(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gl(t,e,n){return e=s6(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s6(t){var e=o6(t,"string");return typeof e=="symbol"?e:e+""}function o6(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ju(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")}ce.getSingleton().register("modifyAutofillRange");ce.getSingleton().register("beforeAutofill");ce.getSingleton().register("afterAutofill");const bT="autofill",a6=20,l6=["fillHandle"],u6="insert_row_below",c6=200;var ml=new WeakSet;class h6 extends ut{constructor(){super(...arguments),i6(this,ml),gl(this,"addingStarted",!1),gl(this,"mouseDownOnCellCorner",!1),gl(this,"mouseDragOutside",!1),gl(this,"handleDraggedCells",0),gl(this,"directions",[]),gl(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return bT}static get PLUGIN_PRIORITY(){return a6}static get SETTING_KEYS(){return[bT,...l6]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",e=>ju(ml,this,f6).call(this,e)),this.addHook("afterOnCellCornerDblClick",e=>ju(ml,this,d6).call(this,e)),this.addHook("beforeOnCellMouseOver",(e,n)=>ju(ml,this,g6).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.clearMappedSettings(),super.disablePlugin()}getSelectionData(){const e=this.hot.getSelectedRangeLast(),{row:n,col:i}=e.getTopStartCorner(),{row:r,col:s}=e.getBottomEndCorner(),o=this.hot.runHooks("modifyCopyableRange",[{startRow:n,startCol:i,endRow:r,endCol:s}]),a=[],l=[],u=[];return M(o,c=>{for(let h=c.startRow;h<=c.endRow;h+=1)a.indexOf(h)===-1&&a.push(h);for(let h=c.startCol;h<=c.endCol;h+=1)l.indexOf(h)===-1&&l.push(h)}),M(a,c=>{const h=[];M(l,d=>{h.push(this.hot.getCopyableData(c,d))}),u.push(h)}),u}fillIn(){if(this.hot.selection.highlight.getFill().isEmpty())return!1;const[e,n,i,r]=this.hot.selection.highlight.getFill().getVisualCorners(),s=this.hot.getSelectedRangeLast(),o=s.getTopStartCorner(),a=s.getBottomEndCorner();this.resetSelectionOfDraggedArea();const l=[o.row,o.col,a.row,a.col],u=this.hot.runHooks("modifyAutofillRange",[Math.min(o.row,e),Math.min(o.col,n),Math.max(a.row,i),Math.max(a.col,r)],l),{directionOfDrag:c,startOfDragCoords:h,endOfDragCoords:d}=t6(l,u,(g,p)=>this.hot._createCellCoords(g,p));if(h&&h.row>-1&&h.col>-1){const g=this.getSelectionData(),p=s.clone(),C=this.hot._createCellRange(h,h,d),S=this.hot.runHooks("beforeAutofill",g,p,C,c);if(S===!1)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let b=S;const R=S;if(["up","left"].indexOf(c)>-1&&!(R.length===1&&R[0].length===0))if(b=[],c==="up"){const E=d.row-h.row+1,H=E%R.length;for(let P=0;P<E;P++)b.push(R[(P+(R.length-H))%R.length])}else{const E=d.col-h.col+1,H=E%R[0].length;for(let P=0;P<R.length;P++){b.push([]);for(let B=0;B<E;B++)b[P].push(R[P][(B+(R[P].length-H))%R[P].length])}}this.hot.populateFromArray(h.row,h.col,b,d.row,d.col,`${this.pluginName}.fill`,null),this.setSelection(u),this.hot.runHooks("afterAutofill",b,p,C,c),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(),i=n.getBottomEndCorner();let r=e;if(this.directions.includes(Ta.vertical)&&this.directions.includes(Ta.horizontal)){const s=n.getTopStartCorner();(i.col<=e.col||s.col>=e.col)&&(r=this.hot._createCellCoords(i.row,e.col)),(i.row<e.row||s.row>e.row)&&(r=this.hot._createCellCoords(e.row,i.col))}else if(this.directions.includes(Ta.vertical))r=this.hot._createCellCoords(e.row,i.col);else if(this.directions.includes(Ta.horizontal))r=this.hot._createCellCoords(i.row,e.col);else return;return this.reduceSelectionAreaIfNeeded(r)}showBorder(e){const n=this.getCoordsOfDragAndDropBorders(e);n&&this.redrawBorders(n)}addRow(){this.hot._registerTimeout(()=>{this.hot.alter(u6,void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1},c6)}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(),i=this.hot.countRows();e[2]<i-1&&n[2]===i-1&&(this.addingStarted=!0,this.addRow())}}getIndexOfLastAdjacentFilledInRow(e){const n=this.hot.getData(),i=this.hot.countRows();let r;for(let s=e[2]+1;s<i;s++){for(let l=e[1];l<=e[3];l++){const u=n[s][l];if(!Xt(u))return-1}const o=n[s][e[1]-1],a=n[s][e[3]+1];(!Xt(o)||!Xt(a))&&(r=s)}return r}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(...Ke(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,i=pn(this.hot.table).top-(this.hot.rootWindow.pageYOffset||n.scrollTop)+Yt(this.hot.table),r=pn(this.hot.table).left-(this.hot.rootWindow.pageXOffset||n.scrollLeft)+Ct(this.hot.table);return e.clientY>i&&e.clientX<=r}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",()=>ju(ml,this,m6).call(this)),this.eventManager.addEventListener(e,"mousemove",n=>ju(ml,this,p6).call(this,n))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){const e=n6(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}}function d6(){this.selectAdjacent()&&this.fillIn()}function f6(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function g6(t){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(t),this.addNewRowIfNeeded())}function m6(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function p6(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 w6(t,e){C6(t,e),e.add(t)}function C6(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function na(t,e,n){return e=v6(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v6(t){var e=S6(t,"string");return typeof e=="symbol"?e:e+""}function S6(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ku(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 Ud="autoRowSize",y6=40,b6="autoRowSize";var pl=new WeakSet;class $c extends ut{static get PLUGIN_KEY(){return Ud}static get PLUGIN_PRIORITY(){return y6}static get SETTING_KEYS(){return!0}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 500}constructor(e){super(e),w6(this,pl),na(this,"headerHeight",null),na(this,"ghostTable",new VO(this.hot)),na(this,"samplesGenerator",new Pm((n,i)=>{const r=this.hot.toPhysicalRow(n),s=this.hot.toPhysicalColumn(i);if(this.hot.rowIndexMapper.isHidden(r)||this.hot.columnIndexMapper.isHidden(s)||n>=0&&i>=0&&this.hot.getCellMeta(n,i).hidden)return!1;let o;return n>=0?o=this.hot.getDataAtCell(n,i):n===-1&&(o=this.hot.getColHeader(i)),{value:o}})),na(this,"firstCalculation",!0),na(this,"inProgress",!1),na(this,"measuredRows",0),na(this,"rowHeightsMap",new $o),this.hot.rowIndexMapper.registerMap(b6,this.rowHeightsMap),this.addHook("beforeRowResize",(n,i,r)=>Ku(pl,this,RT).call(this,n,i,r))}isEnabled(){const e=this.hot.getSettings()[Ud];return e===!0||ke(e)}enablePlugin(){var e=this;this.enabled||(this.setSamplingOptions(),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return Ku(pl,e,E6).call(e,...i)}),this.addHook("beforeChangeRender",n=>Ku(pl,this,T6).call(this,n)),this.addHook("beforeColumnResize",()=>this.recalculateAllRowsHeight()),this.addHook("beforeViewRender",n=>Ku(pl,this,R6).call(this,n)),this.addHook("modifyRowHeight",(n,i)=>this.getRowHeight(i,n)),this.addHook("modifyColumnHeaderHeight",()=>this.getColumnHeaderHeight()),super.enablePlugin())}disablePlugin(){this.headerHeight=null,super.disablePlugin(),this.addHook("beforeRowResize",(e,n,i)=>Ku(pl,this,RT).call(this,e,n,i))}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},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const r=typeof e=="number"?{from:e,to:e}:e,s=typeof n=="number"?{from:n,to:n}:n;if(this.hot.getColHeader(0)!==null){const o=this.samplesGenerator.generateRowSamples(-1,s);this.ghostTable.addColumnHeadersRow(o.get(-1))}me(r.from,r.to,o=>{if(i||this.rowHeightsMap.getValueAtIndex(o)===null){const a=this.samplesGenerator.generateRowSamples(o,s);M(a,l=>{let[u,c]=l;return this.ghostTable.addRow(u,c)})}}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((o,a)=>{o<0?this.headerHeight=a:this.rowHeightsMap.setValueAtIndex(this.hot.toPhysicalRow(o),a)})},!0),this.measuredRows=r.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=0;const i=this.hot.countRows()-1;let r=null;this.inProgress=!0;const s=()=>{if(!this.hot){fg(r),this.inProgress=!1;return}this.calculateRowsHeight({from:n,to:Math.min(n+$c.CALCULATION_STEP,i)},e),n=n+$c.CALCULATION_STEP+1,n<i?r=_S(s):(fg(r),this.inProgress=!1,this.hot.view.adjustElementsSize(),this.hot.view._wt.wtOverlays.inlineStartOverlay.needFullRender&&this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.draw())},o=this.getSyncCalculationLimit();this.firstCalculation&&o>=0&&(this.calculateRowsHeight({from:0,to:o},e),this.firstCalculation=!1,n=o+1),n<i?s():(this.inProgress=!1,this.hot.view.adjustElementsSize())}setSamplingOptions(){const e=this.hot.getSettings()[Ud],n=e&&Ut(e,"samplingRatio")?e.samplingRatio:void 0,i=e&&Ut(e,"allowSampleDuplicates")?e.allowSampleDuplicates:void 0;n&&!isNaN(n)&&this.samplesGenerator.setSampleCount(parseInt(n,10)),i&&this.samplesGenerator.setAllowDuplicates(i)}recalculateAllRowsHeight(){Na(this.hot.view._wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllRowsHeight())}getSyncCalculationLimit(){const e=this.hot.getSettings()[Ud];let n=$c.SYNC_CALCULATION_LIMIT;const i=this.hot.countRows()-1;return ke(e)&&(n=e.syncLimit,zI(n)?n=IP(i,n):n>>=0),Math.min(n,i)}getRowHeight(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;const i=e<0?this.headerHeight:this.rowHeightsMap.getValueAtIndex(this.hot.toPhysicalRow(e));let r=n;return i!==null&&i>(n||0)&&(r=i),r}getColumnHeaderHeight(){return this.headerHeight}getFirstVisibleRow(){const e=this.hot.view._wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getFirstVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getFirstRenderedRow():-1}getLastVisibleRow(){const e=this.hot.view._wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getLastVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getLastRenderedRow():-1}clearCache(){this.headerHeight=null,this.rowHeightsMap.init()}clearCacheByRange(e){const{from:n,to:i}=typeof e=="number"?{from:e,to:e}:e;this.hot.batchExecution(()=>{me(Math.min(n,i),Math.max(n,i),r=>{this.rowHeightsMap.setValueAtIndex(r,null)})},!0)}isNeedRecalculate(){return!!gr(this.rowHeightsMap.getValues().slice(0,this.measuredRows),e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function R6(){const t=this.hot.renderCall,e=this.hot.getSettings().fixedRowsBottom,n=this.getFirstVisibleRow(),i=this.getLastVisibleRow();if(!(n===-1||i===-1)){if(this.calculateRowsHeight({from:n,to:i},void 0,t),e){const r=this.hot.countRows()-1;this.calculateRowsHeight({from:r-e,to:r})}this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllRowsHeight()}}function RT(t,e,n){let i=t;return n&&(this.calculateRowsHeight(e,void 0,!0),i=this.getRowHeight(e)),i}function E6(){this.hot.view?this.recalculateAllRowsHeight():this.hot._registerTimeout(()=>{this.hot&&this.recalculateAllRowsHeight()})}function T6(t){let e=null;t.length===1?e=t[0][0]:t.length>1&&(e={from:t[0][0],to:t[t.length-1][0]}),e!==null&&this.clearCacheByRange(e)}const{getListWithInsertedItems:M6,getListWithRemovedItems:_6}=JP("physicallyIndexed");class I6 extends Xa{constructor(){super(e=>e)}insert(e,n){const i=ry(this.indexedValues,n);this.indexedValues=M6(i,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){const n=_6(this.indexedValues,e);this.indexedValues=iy(n,e),super.remove(e)}}const{getListWithInsertedItems:P6,getListWithRemovedItems:O6}=JP("physicallyIndexed");class x6 extends Xa{constructor(){super(e=>e)}insert(e,n){this.indexedValues=P6(this.indexedValues,e,n,(i,r)=>this.getNextValue(r)),super.insert(e,n)}remove(e){this.indexedValues=O6(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}function A6(t,e){H6(t,e),e.add(t)}function H6(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function N6(t,e,n){return e=D6(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function D6(t){var e=L6(t,"string");return typeof e=="symbol"?e:e+""}function L6(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $6(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 gw="bindRowsWithHeaders",k6=210,F6="loose",V6=new Map([["loose",I6],["strict",x6]]);var ET=new WeakSet;class W6 extends ut{constructor(){super(...arguments),A6(this,ET),N6(this,"headerIndexes",null)}static get PLUGIN_KEY(){return gw}static get PLUGIN_PRIORITY(){return k6}isEnabled(){return!!this.hot.getSettings()[gw]}enablePlugin(){if(this.enabled)return;let e=this.hot.getSettings()[gw];typeof e!="string"&&(e=F6);const n=V6.get(e);this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new n),this.addHook("modifyRowHeader",i=>$6(ET,this,B6).call(this,i)),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function B6(t){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(t))}function U6(t,e){BO(t,e),e.add(t)}function Y6(t,e,n){BO(t,e),e.set(t,n)}function BO(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function TT(t,e,n){return e=z6(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function z6(t){var e=G6(t,"string");return typeof e=="symbol"?e:e+""}function G6(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function MT(t,e){return t.get(zl(t,e))}function mw(t,e,n){return t.set(zl(t,e),n),n}function zl(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 Uf="collapsibleColumns",j6=290,K6=["nestedHeaders"],Jl="collapsibleIndicator",_T=Uf,IT=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var wl=new WeakMap,Xu=new WeakSet;class X6 extends ut{constructor(){super(...arguments),U6(this,Xu),TT(this,"nestedHeadersPlugin",null),TT(this,"headerStateManager",null),Y6(this,wl,null)}static get PLUGIN_KEY(){return Uf}static get PLUGIN_PRIORITY(){return j6}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[Uf,...K6]}isEnabled(){return!!this.hot.getSettings()[Uf]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();n||vt("You need to configure the Nested Headers plugin in order to use collapsible headers."),mw(wl,this,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",()=>zl(Xu,this,Q6).call(this)),this.addHook("afterLoadData",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return zl(Xu,e,J6).call(e,...r)}),this.addHook("afterGetColHeader",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return zl(Xu,e,q6).call(e,...r)}),this.addHook("beforeOnCellMouseDown",(i,r,s)=>zl(Xu,this,Z6).call(this,i,r,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),mw(wl,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:i}=this.hot.getSelectedRangeLast().highlight,{collapsible:r,isCollapsed:s,columnIndex:o}=(e=this.headerStateManager.getHeaderTreeNodeData(n,i))!==null&&e!==void 0?e:{};if(r)return s?this.expandSection({row:n,col:o}):this.collapseSection({row:n,col:o}),!1},runOnlyIf:()=>{var e,n;return((e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.isSingle())&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.highlight.isHeader())},group:_T,relativeToGroup:ko,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(_T)}clearButtons(){if(!this.hot.view)return;const e=this.hot.view._wt.getSetting("columnHeaders").length,n=this.hot.view._wt.wtTable.THEAD,i=this.hot.view._wt.wtOverlays.topOverlay.clone.wtTable.THEAD,r=this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay?this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null,s=function(o){o&&o.parentNode.removeChild(o)};me(0,e-1,o=>{const a=n.childNodes[o],l=i.childNodes[o],u=r?r.childNodes[o]:null;me(0,a.childNodes.length-1,c=>{let h=a.childNodes[c].querySelector(`.${Jl}`);s(h),l&&l.childNodes[c]&&(h=l.childNodes[c].querySelector(`.${Jl}`),s(h)),r&&u&&u.childNodes[c]&&(h=u.childNodes[c].querySelector(`.${Jl}`),s(h))})})}expandSection(e){this.toggleCollapsibleSection([e],"expand")}collapseSection(e){this.toggleCollapsibleSection([e],"collapse")}toggleAllCollapsibleSections(e){const n=this.headerStateManager.mapNodes(i=>{const{collapsible:r,origColspan:s,headerLevel:o,columnIndex:a,isCollapsed:l}=i;if(r===!0&&s>1&&(l&&e==="expand"||!l&&e==="collapse"))return{row:this.headerStateManager.levelToRowCoords(o),col:a}});this.toggleCollapsibleSection(n,e)}collapseAll(){this.toggleAllCollapsibleSections("collapse")}expandAll(){this.toggleAllCollapsibleSections("expand")}toggleCollapsibleSection(e,n){if(!IT.has(n))throw new Error(`Unsupported action is passed (${n}).`);if(!Array.isArray(e))return;const i=gr(e,g=>{let{row:p}=g;return p<0});let r=i.length>0;M(i,g=>{var p;let{row:C,col:S}=g;const{collapsible:b,isCollapsed:R}=(p=this.headerStateManager.getHeaderSettings(C,S))!==null&&p!==void 0?p:{};if(!b||R&&n==="collapse"||!R&&n==="expand")return r=!1,!1});const s=[],o=[];r&&M(i,g=>{let{row:p,col:C}=g;const{colspanCompensation:S,affectedColumns:b,rollbackModification:R}=this.headerStateManager.triggerNodeModification(n,p,C);S>0&&(o.push(...b),s.push(R))});const a=this.getCollapsedColumns();let l=[];n==="collapse"?l=UI([...a,...o]):n==="expand"&&(l=gr(a,g=>!o.includes(g)));const u=IT.get(n);if(this.hot.runHooks(u.beforeHook,a,l,r)===!1){M(s,g=>{g()});return}this.hot.batchExecution(()=>{M(o,g=>{MT(wl,this).setValueAtIndex(this.hot.toPhysicalColumn(g),u.hideColumn)})},!0);const h=this.getCollapsedColumns().length!==a.length,d=this.hot.getSelectedRangeLast();if(n==="collapse"&&h&&d){const{row:g,col:p}=d.highlight;if((this.hot.rowIndexMapper.isHidden(g)||this.hot.columnIndexMapper.isHidden(p))&&o.includes(p)){const S=g>=0?this.hot.rowIndexMapper.getNearestNotHiddenIndex(g,1,!0):g,b=p>=0?this.hot.columnIndexMapper.getNearestNotHiddenIndex(p,1,!0):p;S!==null&&b!==null&&this.hot.selectCell(S,b)}}this.hot.runHooks(u.afterHook,a,l,r,h),this.hot.render(),this.hot.view.adjustElementsSize()}getCollapsedColumns(){return MT(wl,this).getHiddenIndexes()}destroy(){mw(wl,this,null),super.destroy()}}function q6(t,e,n){var i;const{collapsible:r,origColspan:s,isCollapsed:o}=(i=this.headerStateManager.getHeaderSettings(n,t))!==null&&i!==void 0?i:{},a=r&&s>1&&t>=this.hot.getSettings().fixedColumnsStart,l=this.hot.getSettings().ariaTags;let u=e.querySelector(`.${Jl}`);if(fu(e,[ki("")[0]]),a)u||(u=this.hot.rootDocument.createElement("div"),q(u,Jl),e.querySelector("div:first-child").appendChild(u)),He(u,["collapsed","expanded"]),o?(q(u,"collapsed"),Ha(u,"+"),l&&Ee(e,...ki(!1))):(q(u,"expanded"),Ha(u,"-"),l&&Ee(e,...ki(!0))),l&&Ee(u,...Us());else{var c;(c=u)===null||c===void 0||c.remove()}}function Z6(t,e){_e(t.target,Jl)&&(_e(t.target,"expanded")?(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"collapse")):_e(t.target,"collapsed")&&(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"expand")),yr(t))}function Q6(){this.updatePlugin()}function J6(t,e){e||this.updatePlugin()}function ia(t,e,n){return e=e9(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e9(t){var e=t9(t,"string");return typeof e=="symbol"?e:e+""}function t9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const n9=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"],i9=!1,r9=!0,s9=!0;class o9{constructor(e,n){ia(this,"hot",void 0),ia(this,"sortingStates",new bm),ia(this,"sortEmptyCells",i9),ia(this,"indicator",r9),ia(this,"headerAction",s9),ia(this,"compareFunctionFactory",void 0),ia(this,"mapName",void 0),this.hot=e,this.mapName=n,this.hot.columnIndexMapper.registerMap(n,this.sortingStates)}updateAllColumnsProperties(e){ke(e)&&Ue(e,(n,i)=>{n9.includes(i)&&(this[i]=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[i]=n;return i===e})}getNumberOfSortedColumns(){return this.sortingStates.getLength()}isListOfSortedColumnsEmpty(){return this.getNumberOfSortedColumns()===0}isColumnSorted(e){return ke(this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))}getSortStates(){return this.sortingStates===null?[]:this.sortingStates.getEntries().map(n=>{let[i,r]=n;return{column:this.hot.toVisualColumn(i),...r}})}getColumnSortState(e){const n=this.getSortOrderOfColumn(e);if(de(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 UO(t,e,n){const i=e.locale;return function(r,s){const{sortEmptyCells:o}=n;return typeof r=="string"&&(r=r.toLocaleLowerCase(i)),typeof s=="string"&&(s=s.toLocaleLowerCase(i)),r===s?Qr:Xt(r)?Xt(s)?Qr:o&&t==="asc"?Wt:Bt:Xt(s)?o&&t==="asc"?Bt:Wt:isNaN(r)&&!isNaN(s)?t==="asc"?Bt:Wt:!isNaN(r)&&isNaN(s)||(isNaN(r)||isNaN(s)||(r=parseFloat(r),s=parseFloat(s)),r<s)?t==="asc"?Wt:Bt:r>s?t==="asc"?Bt:Wt:Qr}}const YO="default";function a9(t,e,n){return function(i,r){const s=parseFloat(i),o=parseFloat(r),{sortEmptyCells:a}=n;if(s===o||isNaN(s)&&isNaN(o))return Qr;if(a){if(Xt(i))return t==="asc"?Wt:Bt;if(Xt(r))return t==="asc"?Bt:Wt}return isNaN(s)?Bt:isNaN(o)?Wt:s<o?t==="asc"?Wt:Bt:s>o?t==="asc"?Bt:Wt:Qr}}const l9="numeric";function u9(t,e,n){const i=e.checkedTemplate,r=e.uncheckedTemplate,{sortEmptyCells:s}=n;return function(o,a){const l=Xt(o),u=Xt(a),c=l?r:o,h=u?r:a,d=c===r||c===i,g=h===r||h===i;if(s===!1){if(l&&u===!1)return Bt;if(l===!1&&u)return Wt}return d===!1&&g?t==="asc"?Wt:Bt:d&&g===!1?t==="asc"?Bt:Wt:d===!1&&g===!1?UO(t,e,n)(o,a):c===r&&h===i?t==="asc"?Wt:Bt:c===i&&h===r?t==="asc"?Bt:Wt:Qr}}const c9="checkbox";function h9(t,e,n){return qO(t,e.dateFormat,n)}const d9="date";function f9(t,e,n){return qO(t,e.timeFormat,n)}const g9="time",{register:kh,getItem:PT,hasItem:m9}=br("sorting.compareFunctionFactory"),{register:zO,getItem:p9}=br("sorting.mainSortComparator");function GO(t){return m9(t)?PT(t):PT(YO)}kh(c9,u9);kh(d9,h9);kh(YO,UO);kh(l9,a9);kh(g9,f9);const Qr=0,Wt=-1,Bt=1;function w9(t,e){const n=p9(e);for(var i=arguments.length,r=new Array(i>2?i-2:0),s=2;s<i;s++)r[s-2]=arguments[s];t.sort(n(...r))}const vg="asc",Sg="desc",jO="colHeader";function C9(t){if(ke(t)===!1)return!1;const{column:e,sortOrder:n}=t;return Number.isInteger(e)&&[vg,Sg].includes(n)}function v9(t){if(t.some(n=>C9(n)===!1))return!1;const e=t.map(n=>{let{column:i}=n;return i});return new Set(e).size===e.length}function OT(t){if(t!==Sg)return t===vg?Sg:vg}function KO(t){return t.querySelector(`.${jO}`)}function XO(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 jb(t,e,n){return t===-1&&e>=0&&Da(n)===!1}function qO(t,e,n){return function(i,r){const{sortEmptyCells:s}=n;if(i===r)return Qr;if(Xt(i))return Xt(r)?Qr:s&&t==="asc"?Wt:Bt;if(Xt(r))return s&&t==="asc"?Bt:Wt;const o=X(i,e),a=X(r,e);return o.isValid()?a.isValid()?a.isAfter(o)?t==="asc"?Wt:Bt:a.isBefore(o)?t==="asc"?Bt:Wt:Qr:Wt:Bt}}const S9="ascending",y9="descending",ZO="indicatorDisabled",QO="columnSorting",JO="sortAction",ex=new Map([[vg,S9],[Sg,y9]]);function b9(t,e,n,i){const r=[QO];if(i&&r.push(JO),n===!1)return r.push(ZO),r;const s=t.getSortOrderOfColumn(e);return de(s)&&r.push(ex.get(s)),r}function R9(){return Array.from(ex.values()).concat(JO,ZO,QO)}function E9(t,e){return function(n,i){const[,...r]=n,[,...s]=i;return function(a){const l=t[a],u=e[a],c=r[a],h=s[a],d=u.columnSorting;return(d.compareFunctionFactory?d.compareFunctionFactory:GO(u.type))(l,u,d)(c,h)}(0)}}function T9(t,e){M9(t,e),e.add(t)}function M9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yd(t,e,n){return e=_9(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _9(t){var e=I9(t,"string");return typeof e=="symbol"?e:e+""}function I9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}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")}const yg="columnSorting",P9=50,bg="append",O9="replace",xT=yg;zO(yg,E9);ce.getSingleton().register("beforeColumnSort");ce.getSingleton().register("afterColumnSort");var ya=new WeakSet;class tx extends ut{constructor(){super(...arguments),T9(this,ya),Yd(this,"columnStatesManager",null),Yd(this,"columnMetaCache",null),Yd(this,"pluginKey",yg),Yd(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return yg}static get PLUGIN_PRIORITY(){return P9}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e=this;this.enabled||(this.columnStatesManager=new o9(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new $o(n=>{let i=this.hot.toVisualColumn(n);return i===null&&(i=n),this.getMergedPluginSettings(i)}),this.hot.columnIndexMapper.registerMap(`${this.pluginKey}.columnMeta`,this.columnMetaCache),this.addHook("afterGetColHeader",(n,i)=>Fl(ya,this,x9).call(this,n,i)),this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return Fl(ya,e,H9).call(e,...i)}),this.addHook("afterOnCellMouseDown",(n,i)=>this.onAfterOnCellMouseDown(n,i)),this.addHook("afterInit",()=>Fl(ya,this,ov).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return Fl(ya,e,A9).call(e,...i)}),this.hot.view&&Fl(ya,this,ov).call(this),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){const e=(n,i)=>{const r=KO(i);XO(n,i)===!1||r===null||this.updateHeaderClasses(r)};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))},!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.getSelectedRangeLast();return this.sort(this.getColumnNextConfig(e.col)),!1},runOnlyIf:()=>{var e,n;const i=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return i&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(i)&&i.row===-1&&i.col>=0},relativeToGroup:ko,position:"before",group:xT})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(xT)}sort(e){const n=this.getSortConfig(),i=this.getNormalizedSortConfigs(e),r=this.areValidSortConfigs(i);this.hot.runHooks("beforeColumnSort",n,i,r)!==!1&&(n.length===0&&this.indexesSequenceCache===null&&(this.indexesSequenceCache=this.hot.rowIndexMapper.registerMap(this.pluginKey,new eO),this.indexesSequenceCache.setValues(this.hot.rowIndexMapper.getIndexesSequence())),r&&(this.columnStatesManager.setSortStates(i),this.sortByPresetSortStates(i),this.saveAllSortSettings(i)),this.hot.runHooks("afterColumnSort",n,r?i:n,r),r&&(this.hot.render(),this.hot.forceFullRender=!1,this.hot.view.render()))}clearSort(){this.sort([])}isSorted(){return this.enabled&&!this.columnStatesManager.isListOfSortedColumnsEmpty()}getSortConfig(e){return de(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 v9(e)&&e.every(i=>{let{column:r}=i;return r<=n&&r>=0})}saveAllSortSettings(e){const n=this.columnStatesManager.getAllColumnsProperties(),i=r=>{let{column:s,...o}=r;return{column:this.hot.toPhysicalColumn(s),...o}};n.initialConfig=Ke(e,i),this.hot.runHooks("persistentStateSave","columnSorting",n)}getAllSavedSortSettings(){const e={};this.hot.runHooks("persistentStateLoad","columnSorting",e);const n=e.value,i=r=>{let{column:s,...o}=r;return{column:this.hot.toVisualColumn(s),...o}};return de(n)&&Array.isArray(n.initialConfig)&&(n.initialConfig=Ke(n.initialConfig,i)),n}getColumnNextConfig(e){const n=this.columnStatesManager.getSortOrderOfColumn(e);if(de(n)){const r=OT(n);return de(r)?{column:e,sortOrder:r}:void 0}const i=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e<i)return{column:e,sortOrder:OT()}}getNextSortConfig(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bg;const i=this.columnStatesManager.getIndexOfColumnInSortQueue(e),r=i!==-1,s=this.getSortConfig(),o=this.getColumnNextConfig(e);if(r){if(Mt(o))return[...s.slice(0,i),...s.slice(i+1)];if(n===bg)return[...s.slice(0,i),...s.slice(i+1),o];if(n===O9)return[...s.slice(0,i),o,...s.slice(i+1)]}return de(o)?s.concat(o):s}getPluginColumnConfig(e){if(ke(e)){const n=e[this.pluginKey];if(ke(n))return n}return{}}getMergedPluginSettings(e){const n=this.hot.getSettings()[this.pluginKey],i=this.columnStatesManager.getAllColumnsProperties(),r=this.hot.getCellMeta(0,e),s=Object.getPrototypeOf(r);return Array.isArray(s.columns)?Object.assign(i,n,this.getPluginColumnConfig(s.columns[e])):Et(s.columns)?Object.assign(i,n,this.getPluginColumnConfig(s.columns(e))):Object.assign(i,n)}getFirstCellSettings(e){const n=this.hot.getCellMeta(0,e),i=Object.create(n);return i[this.pluginKey]=this.columnMetaCache.getValueAtIndex(this.hot.toPhysicalColumn(e)),i}getNumberOfRowsToSort(e){const n=this.hot.getSettings();return n.maxRows<=e?n.maxRows:e-n.minSpareRows}sortByPresetSortStates(e){if(e.length===0){this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues());return}const n=[],i=this.hot.countRows(),r=u=>Ke(e,c=>this.hot.getDataAtCell(u,c.column));for(let u=0;u<this.getNumberOfRowsToSort(i);u+=1)n.push([this.hot.toPhysicalRow(u)].concat(r(u)));const s=Ke(n,u=>u[0]);w9(n,this.pluginKey,Ke(e,u=>u.sortOrder),Ke(e,u=>this.getFirstCellSettings(u.column)));for(let u=n.length;u<i;u+=1)n.push([u].concat(r(u)));const o=Ke(n,u=>u[0]),a=new Map(Ke(s,(u,c)=>[u,o[c]])),l=Ke(this.hot.rowIndexMapper.getIndexesSequence(),u=>a.has(u)?a.get(u):u);this.hot.rowIndexMapper.setIndexesSequence(l)}sortBySettings(e){if(ke(e)){this.columnStatesManager.updateAllColumnsProperties(e);const n=e.initialConfig;(Array.isArray(n)||ke(n))&&this.sort(n)}else this.hot.render()}updateHeaderClasses(e){if(He(e,R9()),this.enabled!==!1){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];q(e,b9(...i))}}onUpdateSettings(e){super.onUpdateSettings(),this.columnMetaCache!==null&&this.columnMetaCache.init(this.hot.columnIndexMapper.getNumberOfIndexes()),de(e[this.pluginKey])&&this.sortBySettings(e[this.pluginKey])}wasClickableHeaderClicked(e,n){return this.getFirstCellSettings(n)[this.pluginKey].headerAction&&_e(e.target,jO)}onAfterOnCellMouseDown(e,n){jb(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.getColumnNextConfig(n.col)))}destroy(){var e;(e=this.columnStatesManager)===null||e===void 0||e.destroy(),super.destroy()}}function ov(){const t=this.getAllSavedSortSettings();if(ke(t))this.sortBySettings(t);else{const e=this.hot.getSettings()[this.pluginKey];this.sortBySettings(e)}}function x9(t,e){const n=KO(e);if(XO(t,e)===!1||n===null)return;const i=this.getFirstCellSettings(t)[this.pluginKey],r=i.indicator,s=i.headerAction;if(this.updateHeaderClasses(n,this.columnStatesManager,t,r,s),this.hot.getSettings().ariaTags){const o=this.columnStatesManager.getSortOrderOfColumn(t);Ee(e,...AU(o?`${o}ending`:"none"))}}function A9(t){t===!0&&this.hot.view&&Fl(ya,this,ov).call(this)}function H9(t,e,n,i){jb(e.row,e.col,t)!==!1&&this.wasClickableHeaderClicked(t,e.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(i.column=!0)}function ra(t,e,n){return e=N9(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function N9(t){var e=D9(t,"string");return typeof e=="symbol"?e:e+""}function D9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class L9{constructor(e,n){ra(this,"plugin",void 0),ra(this,"hot",void 0),ra(this,"endpoints",[]),ra(this,"settings",void 0),ra(this,"settingsType","array"),ra(this,"currentEndpoint",null),ra(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 i=e;if(!i&&typeof this.settings=="function"){this.settingsType="function";return}return i||(i=this.settings),M(i,r=>{const s={};this.assignSetting(r,s,"ranges",[[0,this.hot.countRows()-1]]),this.assignSetting(r,s,"reversedRowCoords",!1),this.assignSetting(r,s,"destinationRow",new Error(`
|
|
You must provide a destination row for the Column Summary plugin in order to work properly!
|
|
`)),this.assignSetting(r,s,"destinationColumn",new Error(`
|
|
You must provide a destination column for the Column Summary plugin in order to work properly!
|
|
`)),this.assignSetting(r,s,"sourceColumn",r.destinationColumn),this.assignSetting(r,s,"type","sum"),this.assignSetting(r,s,"forceNumeric",!1),this.assignSetting(r,s,"suppressDataTypeErrors",!0),this.assignSetting(r,s,"customFunction",null),this.assignSetting(r,s,"readOnly",!0),this.assignSetting(r,s,"roundFloat",!1),n.push(s)}),n}assignSetting(e,n,i,r){if(i==="ranges"&&e[i]===void 0){n[i]=r;return}else if(i==="ranges"&&e[i].length===0)return;if(e[i]===void 0){if(r instanceof Error)throw r;n[i]=r}else i==="destinationRow"&&n.reversedRowCoords?n[i]=this.hot.countRows()-e[i]-1:n[i]=e[i]}resetSetupBeforeStructureAlteration(e,n,i){if(this.settingsType!=="function")return;const r=e.indexOf("row")>-1?"row":"col",s=this.getAllEndpoints();M(s,o=>{r==="row"&&o.destinationRow>=n&&(e==="insert_row"?o.alterRowOffset=i:e==="remove_row"&&(o.alterRowOffset=-1*i)),r==="col"&&o.destinationColumn>=n&&(e==="insert_col"?o.alterColumnOffset=i:e==="remove_col"&&(o.alterColumnOffset=-1*i))}),this.resetAllEndpoints(s,!1)}resetSetupAfterStructureAlteration(e,n,i,r,s){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;if(this.settingsType==="function"){const d=()=>(this.hot.removeHook("beforeViewRender",d),this.refreshAllEndpoints());this.hot.addHookOnce("beforeViewRender",d);return}const a=e.indexOf("row")>-1?"row":"col",l=e.indexOf("remove")>-1?-1:1,u=this.getAllEndpoints(),c=e.indexOf("move_row")===0,h=n;M(u,d=>{a==="row"&&d.destinationRow>=h&&(d.alterRowOffset=l*i),a==="col"&&d.destinationColumn>=h&&(d.alterColumnOffset=l*i)}),this.resetAllEndpoints(u,!c),c?M(u,d=>{this.extendEndpointRanges(d,h,r[0],r.length),this.recreatePhysicalRanges(d),this.clearOffsetInformation(d)}):M(u,d=>{this.shiftEndpointCoordinates(d,h)}),o&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,n,i,r){M(e.ranges,s=>{s[1]&&(n>=s[0]&&n<=s[1]?i>s[1]?s[1]+=r:i<s[0]&&(s[0]-=r):i>=s[0]&&i<=s[1]&&(s[1]-=r,n<=s[0]&&(s[0]+=1,s[1]+=1)))})}recreatePhysicalRanges(e){const n=e.ranges,i=[],r=[];M(n,s=>{const o=[];if(s[1])for(let a=s[0];a<=s[1];a++)o.push(this.hot.toPhysicalRow(a));else o.push(this.hot.toPhysicalRow(s[0]));r.push(o)}),M(r,s=>{let o=[];M(s,(a,l)=>{l===0?o.push(a):s[l]!==s[l-1]+1&&(o.push(s[l-1]),i.push(o),o=[],o.push(a)),l===s.length-1&&(o.push(a),i.push(o))})}),e.ranges=i}shiftEndpointCoordinates(e,n){e.alterRowOffset&&e.alterRowOffset!==0?(e.destinationRow+=e.alterRowOffset||0,M(e.ranges,i=>{M(i,(r,s)=>{r>=n&&(i[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(r=>{const s=r.alterRowOffset||0,o=r.alterColumnOffset||0;return r.destinationRow+s>=this.hot.countRows()||r.destinationColumn+o>=this.hot.countCols()})||(this.cellsToSetCache=[],M(e,r=>{this.resetEndpointValue(r,n)}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],M(this.getAllEndpoints(),e=>{this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e,"init")}),this.currentEndpoint=null,this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshChangedEndpoints(e){const n=[];this.cellsToSetCache=[],M(e,(i,r,s)=>{`${i[2]||""}`!=`${i[3]}`&&M(this.getAllEndpoints(),(o,a)=>{this.hot.propToCol(s[r][1])===o.sourceColumn&&n.indexOf(a)===-1&&n.push(a)})}),M(n,i=>{this.refreshEndpoint(this.getEndpoint(i))}),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 i=this.hot.getCellMeta(n,e.destinationColumn);i.readOnly=e.readOnly,i.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 i=e.alterRowOffset||0,r=e.alterColumnOffset||0;this.cellsToSetCache.push([this.hot.toVisualRow(e.destinationRow+(n?i:0)),this.hot.toVisualColumn(e.destinationColumn+(n?r:0)),""])}setEndpointValue(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const r=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 o=this.hot.getCellMeta(s,e.destinationColumn);(n==="init"||o.readOnly!==e.readOnly)&&(o.readOnly=e.readOnly,o.className="columnSummaryResult")}if((e.roundFloat===!0||Number.isInteger(e.roundFloat))&&!isNaN(e.result)){const o=e.roundFloat;let a=0;Number.isInteger(o)&&(a=Math.min(Math.max(0,o),100)),e.result=e.result.toFixed(a)}i?this.hot.setDataAtCell(r,e.destinationColumn,e.result,"ColumnSummary.set"):this.cellsToSetCache.push([r,e.destinationColumn,e.result]),e.alterRowOffset=void 0,e.alterColumnOffset=void 0}throwOutOfBoundsWarning(){vt("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}}function pw(t){return t==null||isNaN(t)}function $9(t,e){k9(t,e),e.add(t)}function k9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function F9(t,e,n){return e=V9(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function V9(t){var e=W9(t,"string");return typeof e=="symbol"?e:e+""}function W9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function zd(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 ww="columnSummary",B9=220;var qu=new WeakSet;class U9 extends ut{constructor(){super(...arguments),$9(this,qu),F9(this,"endpoints",null)}static get PLUGIN_KEY(){return ww}static get PLUGIN_PRIORITY(){return B9}isEnabled(){return!!this.hot.getSettings()[ww]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[ww],this.endpoints=new L9(this,this.settings),this.addHook("afterInit",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return zd(qu,e,Y9).call(e,...i)}),this.addHook("afterChange",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return zd(qu,e,G9).call(e,...i)}),this.addHook("afterUpdateSettings",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return zd(qu,e,z9).call(e,...i)}),this.addHook("beforeCreateRow",(n,i,r)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_row",n,i,null,r)),this.addHook("beforeCreateCol",(n,i,r)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_col",n,i,null,r)),this.addHook("beforeRemoveRow",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e.endpoints.resetSetupBeforeStructureAlteration("remove_row",...i)}),this.addHook("beforeRemoveCol",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e.endpoints.resetSetupBeforeStructureAlteration("remove_col",...i)}),this.addHook("afterCreateRow",(n,i,r)=>this.endpoints.resetSetupAfterStructureAlteration("insert_row",n,i,null,r)),this.addHook("afterCreateCol",(n,i,r)=>this.endpoints.resetSetupAfterStructureAlteration("insert_col",n,i,null,r)),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e.endpoints.resetSetupAfterStructureAlteration("remove_row",...i)}),this.addHook("afterRemoveCol",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e.endpoints.resetSetupAfterStructureAlteration("remove_col",...i)}),this.addHook("afterRowMove",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return zd(qu,e,j9).call(e,...i)}),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 Ue(e.ranges,i=>{n+=this.getPartialSum(i,e.sourceColumn)}),n}getPartialSum(e,n){let i=0,r=e[1]||e[0],s=null,o=0;do{if(s=this.getCellValue(r,n),s=pw(s)?null:s,s!==null){const a=(`${s}`.split(".")[1]||[]).length||1;a>o&&(o=a)}i+=s||0,r-=1}while(r>=e[0]);return Math.round(i*10**o)/10**o}calculateMinMax(e,n){let i=null;return Ue(e.ranges,r=>{const s=this.getPartialMinMax(r,e.sourceColumn,n);if(i===null&&s!==null&&(i=s),s!==null)switch(n){case"min":i=Math.min(i,s);break;case"max":i=Math.max(i,s);break}}),i===null?"Not enough data":i}getPartialMinMax(e,n,i){let r=null,s=e[1]||e[0],o;do{if(o=this.getCellValue(s,n),o=pw(o)?null:o,r===null)r=o;else if(o!==null)switch(i){case"min":r=Math.min(r,o);break;case"max":r=Math.max(r,o);break}s-=1}while(s>=e[0]);return r}countEmpty(e,n){let i,r=0,s=e[1]||e[0];do i=this.getCellValue(s,n),i=pw(i)?null:i,i===null&&(r+=1),s-=1;while(s>=e[0]);return r}countEntries(e){let n=0;const i=e.ranges;return Ue(i,r=>{const s=r[1]===void 0?1:r[1]-r[0]+1,o=this.countEmpty(r,e.sourceColumn);n+=s,n-=o}),n}calculateAverage(e){const n=this.calculateSum(e),i=this.countEntries(e);return n/i}getCellValue(e,n){const i=this.hot.toVisualRow(e),r=this.hot.toVisualColumn(n);let s=this.hot.getSourceDataAtCell(e,n),o="";if(i!==null&&r!==null&&(o=this.hot.getCellMeta(i,r).className||""),o.indexOf("columnSummaryResult")>-1)return null;if(this.endpoints.currentEndpoint.forceNumeric&&(typeof s=="string"&&(s=s.replace(/,/,".")),s=parseFloat(s)),isNaN(s)&&!this.endpoints.currentEndpoint.suppressDataTypeErrors)throw new Error(ct`ColumnSummary plugin: cell at (${e}, ${n}) is not in a\x20
|
|
numeric format. Cannot do the calculation.`);return s}}function Y9(){this.endpoints.initEndpoints()}function z9(t){t.columns!==void 0&&this.endpoints.refreshCellMetas()}function G9(t,e){t&&e!=="ColumnSummary.reset"&&e!=="ColumnSummary.set"&&e!=="loadData"&&this.endpoints.refreshChangedEndpoints(t)}function j9(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 Cl(t,e,n){return e=K9(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function K9(t){var e=X9(t,"string");return typeof e=="symbol"?e:e+""}function X9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Gl{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){Cl(this,"rootDocument",void 0),Cl(this,"isRtl",!1),Cl(this,"container",null),Cl(this,"editor",void 0),Cl(this,"editorStyle",void 0),Cl(this,"hidden",!0),this.rootDocument=e,this.isRtl=n,this.editor=this.createEditor(),this.editorStyle=this.editor.style,this.hide()}setPosition(e,n){this.editorStyle.left=`${e}px`,this.editorStyle.top=`${n}px`}setSize(e,n){if(e&&n){const i=this.getInputElement();i.style.width=`${e}px`,i.style.height=`${n}px`}}getSize(){return{width:Ct(this.getInputElement()),height:Yt(this.getInputElement())}}resetSize(){const e=this.getInputElement();e.style.width="",e.style.height=""}setReadOnlyState(e){const n=this.getInputElement();n.readOnly=e}show(){this.editorStyle.display="block",this.hidden=!1}hide(){this.hidden||(this.editorStyle.display="none"),this.hidden=!0}isVisible(){return this.editorStyle.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 this.rootDocument.activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=this.rootDocument.createElement("div"),n=this.rootDocument.createElement("textarea");return e.style.display="none",this.container=this.rootDocument.createElement("div"),this.container.setAttribute("dir",this.isRtl?"rtl":"ltr"),q(this.container,Gl.CLASS_EDITOR_CONTAINER),this.rootDocument.body.appendChild(this.container),q(e,Gl.CLASS_EDITOR),q(n,Gl.CLASS_INPUT),n.setAttribute("data-hot-input",!0),e.appendChild(n),this.container.appendChild(e),e}getInputElement(){return this.editor.querySelector(`.${Gl.CLASS_INPUT}`)}destroy(){const e=this.container?this.container.parentNode:null;this.editor.parentNode.removeChild(this.editor),this.editor=null,this.editorStyle=null,e&&e.removeChild(this.container)}}function Cw(t,e,n){return e=q9(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function q9(t){var e=Z9(t,"string");return typeof e=="symbol"?e:e+""}function Z9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Q9=250,J9=250;class nx{constructor(e){Cw(this,"wasLastActionShow",!0),Cw(this,"showDebounced",null),Cw(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout(()=>{this.wasLastActionShow===!1&&this.runLocalHooks("hide")},J9)}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]:Q9;this.showDebounced=ES(n=>{this.wasLastActionShow&&this.runLocalHooks("show",n.from.row,n.from.col)},e)}destroy(){this.clearLocalHooks()}}bt(nx,zn);function e7(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")} ${e}`}function t7(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")} ${e}`}function sa(t,e){const n={};return M(t,i=>{i.forAll((r,s)=>{r>=0&&s>=0&&(n[r]||(n[r]=[]),n[r][s]=e(r,s))})}),n}function lo(t,e,n,i,r){M(t,s=>{s.forAll((o,a)=>{o>=0&&a>=0&&n7(o,a,e,n,i,r)})})}function n7(t,e,n,i,r,s){const o=r(t,e);let a=i;o.className&&(n==="vertical"?a=e7(o.className,i):a=t7(o.className,i)),s(t,e,"className",a)}function Rs(t){return`<span class="selected">✓</span>${t}`}function Yr(t,e){let n=!1;return Array.isArray(t)&&M(t,i=>(i.forAll((r,s)=>{if(r>=0&&s>=0&&e(r,s))return n=!0,!1}),n)),n}function Om(t,e){const n={top:0,left:0};if(e!==t.ownerDocument){const{frameElement:i}=e.defaultView,{top:r,left:s}=i.getBoundingClientRect();n.top=r,n.left=s}return n}const Be="---------";function i7(){return{name:Be}}const xi="alignment";function r7(){return{key:xi,name(){return this.getTranslatedPhrase(Oy)},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const t=this.getSelectedRangeLast();return!t||t.isSingleHeader()?!0:!(this.getSelectedRange()&&!this.selection.isSelectedByCorner())},submenu:{items:[{key:`${xi}:left`,name(){let t=this.getTranslatedPhrase(xy);return Yr(this.getSelectedRange(),(n,i)=>{const r=this.getCellMeta(n,i).className;if(r&&r.indexOf("htLeft")!==-1)return!0})&&(t=Rs(t)),t},callback(){const t=this.getSelectedRange(),e=sa(t,(r,s)=>this.getCellMeta(r,s).className),n="horizontal",i="htLeft";this.runHooks("beforeCellAlignment",e,t,n,i),lo(t,n,i,(r,s)=>this.getCellMeta(r,s),(r,s,o,a)=>this.setCellMeta(r,s,o,a)),this.render()},disabled:!1},{key:`${xi}:center`,name(){let t=this.getTranslatedPhrase(Ay);return Yr(this.getSelectedRange(),(n,i)=>{const r=this.getCellMeta(n,i).className;if(r&&r.indexOf("htCenter")!==-1)return!0})&&(t=Rs(t)),t},callback(){const t=this.getSelectedRange(),e=sa(t,(r,s)=>this.getCellMeta(r,s).className),n="horizontal",i="htCenter";this.runHooks("beforeCellAlignment",e,t,n,i),lo(t,n,i,(r,s)=>this.getCellMeta(r,s),(r,s,o,a)=>this.setCellMeta(r,s,o,a)),this.render()},disabled:!1},{key:`${xi}:right`,name(){let t=this.getTranslatedPhrase(Hy);return Yr(this.getSelectedRange(),(n,i)=>{const r=this.getCellMeta(n,i).className;if(r&&r.indexOf("htRight")!==-1)return!0})&&(t=Rs(t)),t},callback(){const t=this.getSelectedRange(),e=sa(t,(r,s)=>this.getCellMeta(r,s).className),n="horizontal",i="htRight";this.runHooks("beforeCellAlignment",e,t,n,i),lo(t,n,i,(r,s)=>this.getCellMeta(r,s),(r,s,o,a)=>this.setCellMeta(r,s,o,a)),this.render()},disabled:!1},{key:`${xi}:justify`,name(){let t=this.getTranslatedPhrase(Ny);return Yr(this.getSelectedRange(),(n,i)=>{const r=this.getCellMeta(n,i).className;if(r&&r.indexOf("htJustify")!==-1)return!0})&&(t=Rs(t)),t},callback(){const t=this.getSelectedRange(),e=sa(t,(r,s)=>this.getCellMeta(r,s).className),n="horizontal",i="htJustify";this.runHooks("beforeCellAlignment",e,t,n,i),lo(t,n,i,(r,s)=>this.getCellMeta(r,s),(r,s,o,a)=>this.setCellMeta(r,s,o,a)),this.render()},disabled:!1},{name:Be},{key:`${xi}:top`,name(){let t=this.getTranslatedPhrase(Dy);return Yr(this.getSelectedRange(),(n,i)=>{const r=this.getCellMeta(n,i).className;if(r&&r.indexOf("htTop")!==-1)return!0})&&(t=Rs(t)),t},callback(){const t=this.getSelectedRange(),e=sa(t,(r,s)=>this.getCellMeta(r,s).className),n="vertical",i="htTop";this.runHooks("beforeCellAlignment",e,t,n,i),lo(t,n,i,(r,s)=>this.getCellMeta(r,s),(r,s,o,a)=>this.setCellMeta(r,s,o,a)),this.render()},disabled:!1},{key:`${xi}:middle`,name(){let t=this.getTranslatedPhrase(Ly);return Yr(this.getSelectedRange(),(n,i)=>{const r=this.getCellMeta(n,i).className;if(r&&r.indexOf("htMiddle")!==-1)return!0})&&(t=Rs(t)),t},callback(){const t=this.getSelectedRange(),e=sa(t,(r,s)=>this.getCellMeta(r,s).className),n="vertical",i="htMiddle";this.runHooks("beforeCellAlignment",e,t,n,i),lo(t,n,i,(r,s)=>this.getCellMeta(r,s),(r,s,o,a)=>this.setCellMeta(r,s,o,a)),this.render()},disabled:!1},{key:`${xi}:bottom`,name(){let t=this.getTranslatedPhrase($y);return Yr(this.getSelectedRange(),(n,i)=>{const r=this.getCellMeta(n,i).className;if(r&&r.indexOf("htBottom")!==-1)return!0})&&(t=Rs(t)),t},callback(){const t=this.getSelectedRange(),e=sa(t,(r,s)=>this.getCellMeta(r,s).className),n="vertical",i="htBottom";this.runHooks("beforeCellAlignment",e,t,n,i),lo(t,n,i,(r,s)=>this.getCellMeta(r,s),(r,s,o,a)=>this.setCellMeta(r,s,o,a)),this.render()},disabled:!1}]}}}const xm="clear_column";function s7(){return{key:xm,name(){return this.getTranslatedPhrase(py)},callback(t,e){const n=e[0].start.col,i=e[0].end.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(e[0].start.row,e[0].end.row),i,"ContextMenu.clearColumn")},disabled(){const t=this.getSelectedRangeLast();return!t||t.isSingleHeader()&&t.highlight.col<0?!0:!this.selection.isSelectedByColumnHeader()}}}const Fh="col_left";function o7(){return{key:Fh,name(){return this.getTranslatedPhrase(uy)},callback(){const t=this.getSelectedRangeLast().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.getSelectedRangeLast();return!t||t.isSingleHeader()&&t.highlight.col<0?!0:this.selection.isSelectedByCorner()?this.countCols()===0:this.selection.isSelectedByRowHeader()||this.countCols()>=this.getSettings().maxCols},hidden(){return!this.getSettings().allowInsertColumn}}}const Vh="col_right";function a7(){return{key:Vh,name(){return this.getTranslatedPhrase(cy)},callback(){const t=this.getSelectedRangeLast().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.getSelectedRangeLast();return!t||t.isSingleHeader()&&t.highlight.col<0?!0:this.selection.isSelectedByCorner()?!1:this.selection.isSelectedByRowHeader()||this.countCols()>=this.getSettings().maxCols},hidden(){return!this.getSettings().allowInsertColumn}}}const Wh="make_read_only";function l7(){return{key:Wh,name(){let t=this.getTranslatedPhrase(my);return Yr(this.getSelectedRange(),(n,i)=>this.getCellMeta(n,i).readOnly)&&(t=Rs(t)),t},callback(){const t=this.getSelectedRange(),e=Yr(t,(n,i)=>this.getCellMeta(n,i).readOnly);M(t,n=>{n.forAll((i,r)=>{i>=0&&r>=0&&this.setCellMeta(i,r,"readOnly",!e)})}),this.render()},disabled(){const t=this.getSelectedRangeLast();return!!(!t||t.isSingleHeader()||this.selection.isSelectedByCorner()||this.countRows()===0||this.countCols()===0||!this.getSelectedRange()||this.getSelectedRange().length===0)}}}const Am="redo";function u7(){return{key:Am,name(){return this.getTranslatedPhrase(gy)},callback(){this.redo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}}const Bh="remove_col";function c7(){return{key:Bh,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[,n,,i]=t[0];n-i!==0&&(e=1)}return this.getTranslatedPhrase(dy,e)},callback(){this.alter("remove_col",n3(this),null,"ContextMenu.removeColumn")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();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 Hm="remove_row";function h7(){return{key:Hm,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[n,,i]=t[0];n-i!==0&&(e=1)}return this.getTranslatedPhrase(hy,e)},callback(){this.alter("remove_row",i3(this),1,"ContextMenu.removeRow")},disabled(){const t=this.getSelectedRangeLast();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 Nm="row_above";function d7(){return{key:Nm,name(){return this.getTranslatedPhrase(ay)},callback(){const t=this.getSelectedRangeLast().getTopLeftCorner();this.alter("insert_row_above",t.row,1,"ContextMenu.rowAbove")},disabled(){const t=this.getSelectedRangeLast();return!t||t.isSingleHeader()&&t.highlight.row<0?!0:this.selection.isSelectedByCorner()?this.countRows()===0:this.selection.isSelectedByColumnHeader()||this.countRows()>=this.getSettings().maxRows},hidden(){return!this.getSettings().allowInsertRow}}}const Dm="row_below";function f7(){return{key:Dm,name(){return this.getTranslatedPhrase(ly)},callback(){const t=this.getSelectedRangeLast().getBottomRightCorner();this.alter("insert_row_below",t.row,1,"ContextMenu.rowBelow")},disabled(){const t=this.getSelectedRangeLast();return!t||t.isSingleHeader()&&t.highlight.row<0?!0:this.selection.isSelectedByCorner()?!1:this.selection.isSelectedByColumnHeader()||this.countRows()>=this.getSettings().maxRows},hidden(){return!this.getSettings().allowInsertRow}}}const ch="no_items";function g7(){return{key:ch,name(){return this.getTranslatedPhrase(oy)},disabled:!0,isCommand:!1}}const Lm="undo";function m7(){return{key:Lm,name(){return this.getTranslatedPhrase(fy)},callback(){this.undo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}}const p7=[Nm,Dm,Fh,Vh,xm,Hm,Bh,Lm,Am,Wh,xi,Be,ch],w7={[Be]:i7,[ch]:g7,[Nm]:d7,[Dm]:f7,[Fh]:o7,[Vh]:a7,[xm]:s7,[Hm]:h7,[Bh]:c7,[Lm]:m7,[Am]:u7,[Wh]:l7,[xi]:r7};function ix(){const t={};return Ue(w7,(e,n)=>{t[n]=e()}),t}function C7(t){return{key:"commentsAddEdit",name(){var e;const n=(e=this.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n!=null&&n.isCell()&&t.getCommentAtCell(n.row,n.col)?this.getTranslatedPhrase(_y):this.getTranslatedPhrase(My)},callback(){const e=this.getSelectedRangeLast();t.setRange(e),t.show(),t.focusEditor()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function v7(t){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(Iy)},callback(){this.getSelectedRangeLast().forAll((n,i)=>{n>=0&&i>=0&&t.removeCommentAtCell(n,i,!1)}),this.render()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function S7(t){return{key:"commentsReadOnly",name(){const e=this.getTranslatedPhrase(Py);return Yr(this.getSelectedRange(),(i,r)=>t.getCommentMeta(i,r,Yf))?Rs(e):e},callback(){this.getSelectedRangeLast().forAll((n,i)=>{if(n>=0&&i>=0){const r=!!t.getCommentMeta(n,i,Yf);t.updateCommentMeta(n,i,{[Yf]:!r})}})},disabled(){const e=this.getSelectedRangeLast();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 y7(t,e){rx(t,e),e.add(t)}function oa(t,e,n){rx(t,e),e.set(t,n)}function rx(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function b7(t,e,n){return e=R7(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R7(t){var e=E7(t,"string");return typeof e=="symbol"?e:e+""}function E7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Os(t,e,n){return t.set(Ii(t,e),n),n}function Ve(t,e){return t.get(Ii(t,e))}function Ii(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 kc="comments",T7=60,Es="comment",_c="value",sx="style",Yf="readOnly",Gd=kc,av=`plugin:${kc}`;var yt=new WeakMap,ir=new WeakMap,$m=new WeakMap,zf=new WeakMap,Rg=new WeakMap,lv=new WeakMap,Eg=new WeakMap,qi=new WeakSet;class M7 extends ut{constructor(){super(...arguments),y7(this,qi),b7(this,"range",{}),oa(this,yt,null),oa(this,ir,null),oa(this,$m,!1),oa(this,zf,!1),oa(this,Rg,{}),oa(this,lv,null),oa(this,Eg,"")}static get PLUGIN_KEY(){return kc}static get PLUGIN_PRIORITY(){return T7}isEnabled(){return!!this.hot.getSettings()[kc]}enablePlugin(){this.enabled||(Ve(yt,this)||Os(yt,this,new Gl(this.hot.rootDocument,this.hot.isRtl())),Ve(ir,this)||Os(ir,this,new nx(this.getDisplayDelaySetting())),this.addHook("afterContextMenuDefaultOptions",e=>this.addToContextMenu(e)),this.addHook("afterRenderer",(e,n,i,r,s,o)=>Ii(qi,this,O7).call(this,e,o)),this.addHook("afterScroll",()=>Ii(qi,this,L7).call(this)),this.addHook("afterBeginEditing",()=>this.hide()),this.addHook("afterDocumentKeyDown",e=>Ii(qi,this,D7).call(this,e)),Ve(ir,this).addLocalHook("hide",()=>this.hide()),Ve(ir,this).addLocalHook("show",(e,n)=>this.showAtCell(e,n)),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){Ve(ir,this).updateDelay(this.getDisplayDelaySetting()),super.updatePlugin()}disablePlugin(){this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager(),n=e.getContext("grid"),i=e.addContext(av);n.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const r=this.hot.getSelectedRangeLast();Os(zf,this,!0),this.hot.scrollToFocusedCell(()=>{this.setRange(r),this.show(),this.focusEditor(),e.setActiveContextName(av),this.hot._registerTimeout(()=>{Os(zf,this,!1)})})},stopPropagation:!0,runOnlyIf:()=>{var r;return((r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.highlight.isCell())&&!Ve(yt,this).isVisible()},group:Gd}),i.addShortcut({keys:[["Escape"]],callback:()=>{Ve(yt,this).setValue(Ve(Eg,this)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Ve(yt,this).isVisible()&&Ve(yt,this).isFocused(),group:Gd}),i.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Ve(yt,this).isVisible()&&Ve(yt,this).isFocused(),group:Gd})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Gd)}registerListeners(){const{rootDocument:e}=this.hot,n=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",i=>Ii(qi,this,I7).call(this,i)),this.eventManager.addEventListener(e,"mousedown",i=>Ii(qi,this,_7).call(this,i)),this.eventManager.addEventListener(e,"mouseup",()=>Ii(qi,this,P7).call(this)),this.eventManager.addEventListener(n,"focus",()=>Ii(qi,this,A7).call(this)),this.eventManager.addEventListener(n,"blur",()=>Ii(qi,this,x7).call(this)),this.eventManager.addEventListener(n,"mousedown",i=>Ii(qi,this,H7).call(this,i)),this.eventManager.addEventListener(n,"mouseup",i=>Ii(qi,this,N7).call(this,i))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const n=Aa(e.target,"TD","TBODY");return!!(n&&_e(n,"htCommentCell")&&Aa(n,[this.hot.rootElement]))}targetIsCommentTextArea(e){return this.getEditorInputElement()===e.target}setComment(e){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const n=Ve(yt,this).getValue();let i="";e!=null?i=e:n!=null&&(i=n);const r=this.range.from.row,s=this.range.from.col;this.updateCommentMeta(r,s,{[_c]:i}),this.hot.render()}setCommentAtCell(e,n,i){this.setRange({from:this.hot._createCellCoords(e,n)}),this.setComment(i)}removeComment(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');this.hot.setCellMeta(this.range.from.row,this.range.from.col,Es),e&&this.hot.render(),this.hide()}removeCommentAtCell(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;this.setRange({from:this.hot._createCellCoords(e,n)}),this.removeComment(i)}getComment(){const e=this.range.from.row,n=this.range.from.col;return this.getCommentMeta(e,n,_c)}getCommentAtCell(e,n){return this.getCommentMeta(e,n,_c)}show(){var e;if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const{from:{row:n,col:i}}=this.range;if(n<0||n>this.hot.countSourceRows()-1||i<0||i>this.hot.countSourceCols()-1)return!1;const r=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return Ve(ir,this).cancelHiding(),Ve(yt,this).setValue((e=r[Es]?r[Es][_c]:null)!==null&&e!==void 0?e:""),Ve(yt,this).show(),this.refreshEditor(!0),!0}showAtCell(e,n){return this.setRange({from:this.hot._createCellCoords(e,n)}),this.show()}hide(){Ve(yt,this).hide()}refreshEditor(){var e,n;if(!(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&(!this.range.from||!Ve(yt,this).isVisible()))return;const{rowIndexMapper:r,columnIndexMapper:s}=this.hot,{row:o,col:a}=this.range.from;let l=r.getRenderableFromVisualIndex(o),u=s.getRenderableFromVisualIndex(a);const c=l===null;Ve(yt,this).setPosition(0,0),l===null&&(l=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(o,-1))),u===null&&(u=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(a,-1)));const h=l===null,d=u===null;l=(e=l)!==null&&e!==void 0?e:0,u=(n=u)!==null&&n!==void 0?n:0;const{rootWindow:g,view:{_wt:p}}=this.hot,{wtTable:C}=p,S=p.getCell({row:l,col:u},!0),b=this.getCommentMeta(o,a,sx);b?Ve(yt,this).setSize(b.width,b.height):Ve(yt,this).resetSize();const R=d?0:C.getStretchedColumnWidth(u),E=c&&!h?Yt(S):0,{left:H,top:P,width:B,height:Y}=S.getBoundingClientRect(),{width:j,height:z}=Ve(yt,this).getSize(),{innerWidth:G,innerHeight:Z}=this.hot.rootWindow,ne=this.hot.rootDocument.documentElement;let ie=H+g.scrollX+R,Ce=P+g.scrollY+E;this.hot.isRtl()&&(ie-=j+R),this.hot.isLtr()&&H+B+j>G?ie=H+g.scrollX-j-1:this.hot.isRtl()&&ie<-(ne.scrollWidth-ne.clientWidth)&&(ie=H+g.scrollX+R+1),P+z>Z&&(Ce-=z-Y+1),Ve(yt,this).setPosition(ie,Ce),Ve(yt,this).setReadOnlyState(this.getCommentMeta(o,a,Yf))}focusEditor(){Ve(yt,this).focus()}updateCommentMeta(e,n,i){const r=this.hot.getCellMeta(e,n)[Es];let s;r?(s=Yn(r),pm(s,i)):s=i,this.hot.setCellMeta(e,n,Es,s)}getCommentMeta(e,n,i){const r=this.hot.getCellMeta(e,n);if(r[Es])return r[Es][i]}addToContextMenu(e){e.items.push({name:Be},C7(this),v7(this),S7(this))}getDisplayDelaySetting(){const e=this.hot.getSettings()[kc];if(ke(e))return e.displayDelay}getEditorInputElement(){return Ve(yt,this).getInputElement()}destroy(){Ve(yt,this)&&Ve(yt,this).destroy(),Ve(ir,this)&&Ve(ir,this).destroy(),super.destroy()}}function _7(t){if(!(!this.hot.view||!this.hot.view._wt)&&!Ve($m,this)&&!this.targetIsCommentTextArea(t)){const e=Aa(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 I7(t){const{rootDocument:e}=this.hot;if(!(Ve($m,this)||Ve(yt,this).isFocused()||_e(t.target,"wtBorder")||Ve(lv,this)===t.target||!Ve(yt,this)))if(Os(lv,this,e.elementFromPoint(t.clientX,t.clientY)),this.targetIsCellWithComment(t)){const n=this.hot._createCellRange(this.hot.getCoords(t.target));Ve(ir,this).show(n)}else xa(t.target,e)&&!this.targetIsCommentTextArea(t)&&Ve(ir,this).hide()}function P7(){Os($m,this,!1)}function O7(t,e){e[Es]&&e[Es][_c]&&q(t,e.commentedCellClassName)}function x7(){Os(Eg,this,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function A7(){Os(Eg,this,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(av)}function H7(t){Os(Rg,this,{width:Ct(t.target),height:Yt(t.target)})}function N7(t){const e=Ct(t.target),n=Yt(t.target);(e!==Ve(Rg,this).width+1||n!==Ve(Rg,this).height+2)&&this.updateCommentMeta(this.range.from.row,this.range.from.col,{[sx]:{width:e,height:n}})}function D7(t){Ve(yt,this).isVisible()&&yr(t)}function L7(){Ve(zf,this)||this.hide()}var AT=Qg,$7=TypeError,k7=function(t,e){if(!delete t[e])throw new $7("Cannot delete property "+AT(e)+" of "+AT(t))},F7=An,V7=vh,W7=yh,B7=H_,U7=k7,Y7=N_,z7=[].unshift(0)!==1,G7=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(t){return t instanceof TypeError}},j7=z7||!G7();F7({target:"Array",proto:!0,arity:1,forced:j7},{unshift:function(e){var n=V7(this),i=W7(n),r=arguments.length;if(r){Y7(i+r);for(var s=i;s--;){var o=s+r;s in n?n[o]=n[s]:U7(n,o)}for(var a=0;a<r;a++)n[a]=arguments[a]}return B7(n,i+r)}});function vw(t,e,n){return e=K7(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function K7(t){var e=X7(t,"string");return typeof e=="symbol"?e:e+""}function X7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ox{constructor(e){vw(this,"hot",void 0),vw(this,"commands",{}),vw(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,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];const s=e.split(":"),o=s[0],a=s.length===2?s[1]:null;let l=this.commands[o];if(!l)throw new Error(`Menu command '${o}' not exists.`);if(a&&l.submenu&&(l=q7(a,l.submenu.items)),l.disabled===!0||typeof l.disabled=="function"&&l.disabled.call(this.hot)===!0||Ut(l,"submenu"))return;const u=[];typeof l.callback=="function"&&u.push(l.callback),typeof this.commonCallback=="function"&&u.push(this.commonCallback),i.unshift(s.join(":")),M(u,c=>c.apply(this.hot,i))}}function q7(t,e){let n;return M(e,i=>{const r=i.key?i.key.split(":"):null;if(Array.isArray(r)&&r[1]===t)return n=i,!1}),n}function Sw(t,e,n){return e=Z7(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Z7(t){var e=Q7(t,"string");return typeof e=="symbol"?e:e+""}function Q7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ax{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Sw(this,"hot",void 0),Sw(this,"predefinedItems",ix()),Sw(this,"defaultOrderPattern",void 0),this.hot=e,this.defaultOrderPattern=n}setPredefinedItems(e){const n={};this.defaultOrderPattern.length=0,Ue(e,(i,r)=>{let s="";i.name===Be?(n[Be]=i,s=Be):isNaN(parseInt(r,10))?(i.key=i.key===void 0?r:i.key,n[r]=i,s=i.key):(n[i.key]=i,s=i.key),this.defaultOrderPattern.push(s)}),this.predefinedItems=n}getItems(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return J7(e,this.defaultOrderPattern,this.predefinedItems)}}function J7(){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 i=[];let r=t;return r&&r.items?r=r.items:Array.isArray(r)||(r=e),ke(r)?Ue(r,(s,o)=>{let a=n[typeof s=="string"?s:o];a||(a=s),ke(s)?tn(a,s):typeof a=="string"&&(a={name:a}),a.key===void 0&&(a.key=o),i.push(a)}):M(r,(s,o)=>{let a=n[s];!a&&p7.indexOf(s)>=0||(a||(a={name:s,key:`${o}`}),ke(s)&&tn(a,s),a.key===void 0&&(a.key=o),i.push(a))}),i}function Qs(t,e,n){return e=e8(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e8(t){var e=t8(t,"string");return typeof e=="symbol"?e:e+""}function t8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class n8{constructor(e,n){Qs(this,"top",void 0),Qs(this,"topRelative",void 0),Qs(this,"left",void 0),Qs(this,"leftRelative",void 0),Qs(this,"scrollTop",void 0),Qs(this,"scrollLeft",void 0),Qs(this,"cellHeight",void 0),Qs(this,"cellWidth",void 0);const i=n.scrollY,r=n.scrollX;let s,o,a,l,u,c;this.rootWindow=n,this.type=this.getSourceType(e),this.type==="literal"?(s=parseInt(e.top,10),a=parseInt(e.left,10),u=e.height||0,c=e.width||0,o=s,l=a,s+=i,a+=r):this.type==="event"&&(s=parseInt(e.pageY,10),a=parseInt(e.pageX,10),u=e.target.clientHeight,c=e.target.clientWidth,o=s-i,l=a-r),this.top=s,this.topRelative=o,this.left=a,this.leftRelative=l,this.scrollTop=i,this.scrollLeft=r,this.cellHeight=u,this.cellWidth=c}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.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=n}fitsOnLeft(e){return this.leftRelative>=e.offsetWidth}}function Zu(t,e,n){i8(t,e),e.set(t,n)}function i8(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ge(t,e){return t.get(lx(t,e))}function jd(t,e,n){return t.set(lx(t,e),n),n}function lx(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 Dn=new WeakMap,Js=new WeakMap,yn=new WeakMap,yw=new WeakMap,vl=new WeakMap;class r8{constructor(e){Zu(this,Dn,void 0),Zu(this,Js,void 0),Zu(this,yn,void 0),Zu(this,yw,!1),Zu(this,vl,{above:0,below:0,left:0,right:0}),jd(yw,this,e)}setOffset(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Ge(vl,this)[e]=n,this}setElement(e){return jd(Dn,this,e),this}setParentElement(e){return jd(Js,this,e),this}updatePosition(e){jd(yn,this,new n8(e,Ge(Dn,this).ownerDocument.defaultView)),Ge(yw,this)?(Ge(yn,this).fitsBelow(Ge(Dn,this))?this.setPositionBelowCursor():Ge(yn,this).fitsAbove(Ge(Dn,this))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){Ge(Dn,this).dir==="rtl"?Ge(yn,this).fitsOnLeft(Ge(Dn,this))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():Ge(yn,this).fitsOnRight(Ge(Dn,this))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=Ge(vl,this).above+Ge(yn,this).top-Ge(Dn,this).offsetHeight;Ge(Js,this)&&(e=Ge(yn,this).top+Ge(yn,this).cellHeight-Ge(Dn,this).offsetHeight+3),Ge(Dn,this).style.top=`${e}px`}setPositionBelowCursor(){let e=Ge(vl,this).below+Ge(yn,this).top+1;Ge(Js,this)&&(e=Ge(yn,this).top-1),Ge(Dn,this).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=Ge(yn,this).left;if(Ge(Js,this)){const{right:n}=Ge(Js,this).getBoundingClientRect();e+=Ge(yn,this).cellWidth+n-(Ge(yn,this).left+Ge(yn,this).cellWidth)}else e+=Ge(vl,this).right;Ge(Dn,this).style.left=`${e}px`}setPositionOnLeftOfCursor(){let e=Ge(vl,this).left+Ge(yn,this).left-Ge(Dn,this).offsetWidth;if(Ge(Js,this)){const{left:n}=Ge(Js,this).getBoundingClientRect();e-=Ge(yn,this).left-n}Ge(Dn,this).style.left=`${e}px`}}function ux(t){let{initialPage:e=-1,size:n=()=>0,onItemSelect:i=()=>{},onClear:r=()=>{}}=t;const s=new Set;let o=gt(e,-1,p()-1);function a(S,b){const R=p()-1;return S<0&&(S=R),S>R&&(S=0),s.has(S)?-1:(s.add(S),i(S,!1)===!1&&(S=a(b===1?++S:--S,b)),S)}function l(S){S>-1&&S<p()&&i(S,!0)!==!1&&(o=S)}function u(){return o}function c(){p()>0&&(s.clear(),o=a(0,1))}function h(){p()>0&&(s.clear(),o=a(p()-1,-1))}function d(){p()>0&&(s.clear(),o=a(++o,1))}function g(){p()>0&&(s.clear(),o=a(--o,-1))}function p(){return Math.max(n(),0)}function C(){s.clear(),o=e,r()}return{setCurrentPage:l,getCurrentPage:u,toFirstItem:c,toLastItem:h,toNextItem:d,toPreviousItem:g,getSize:p,clear:C}}function s8(t){return Ke(t,e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()}))}function uv(t){return Ut(t,"submenu")}function cv(t){return new RegExp(Be,"i").test(t.name)}function Gf(t,e){return t.disabled===!0||typeof t.disabled=="function"&&t.disabled.call(e)===!0}function HT(t){return Ut(t,"disableSelection")}function o8(t){return _e(t,"htSeparator")}function a8(t){return _e(t,"htSubmenu")}function l8(t){return _e(t,"htDisabled")}function u8(t){return _e(t,"htSelectionDisabled")}function c8(t,e){return!t.hidden||!(typeof t.hidden=="function"&&t.hidden.call(e))}function cx(t,e){const n=t.slice(0);for(let i=0;i<n.length&&n[i].name===e;)n.shift();return n}function h8(t,e){let n=t.slice(0);return n.reverse(),n=cx(n,e),n.reverse(),n}function d8(t){const e=[];return M(t,(n,i)=>{i>0?e[e.length-1].name!==n.name&&e.push(n):e.push(n)}),e}function f8(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Be,n=t.slice(0);return n=cx(n,e),n=h8(n,e),n=d8(n),n}function g8(t){return ux({size:()=>t.countRows(),onItemSelect(e,n){const i=t.getCell(e,0);if(!i||o8(i)||l8(i)||u8(i))return!1;t.selectCell(e,0,...n?[e,0,!1,!1]:[])},onClear(){t.deselectCell()}})}function m8(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:(i,r)=>{const s=e.getSettings(),o=typeof s.tabMoves=="function"?s.tabMoves(i):s.tabMoves;r.includes("shift")?e.selection.transformStart(-o.row,-o.col):e.selection.transformStart(o.row,o.col),t.close(!0)}},{keys:[["Escape"]],callback:()=>t.close()},{keys:[["ArrowDown"]],callback:()=>t.getNavigator().toNextItem()},{keys:[["ArrowUp"]],callback:()=>t.getNavigator().toPreviousItem()},{keys:[["ArrowRight"]],callback:()=>{const i=n.getSelectedLast();if(i){const r=t.openSubMenu(i[0]);r&&r.getNavigator().toFirstItem()}}},{keys:[["ArrowLeft"]],callback:()=>{n.getSelectedLast()&&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:i=>{const r=n.getSelectedLast();r&&(n.getSourceDataAtRow(r[0]).submenu?t.openSubMenu(r[0]).getNavigator().toFirstItem():(t.executeCommand(i),t.close(!0)))}},{keys:[["PageUp"]],callback:()=>{n.getSelectedLast()?n.selection.transformStart(-n.countVisibleRows(),0):t.getNavigator().toFirstItem()}},{keys:[["PageDown"]],callback:()=>{n.getSelectedLast()?n.selection.transformStart(n.countVisibleRows(),0):t.getNavigator().toLastItem()}}]}const hx="menu",NT=hx;function p8(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=[];i(m8(t)),e.forEach(u=>{let{shortcuts:c,contextName:h}=u;r(c,h)});function i(u,c){a(c).addShortcuts(u,{group:hx})}function r(u,c){const h=a(c);u.forEach(d=>{let{keys:g}=d;g.forEach(p=>h.removeShortcutsByKeys(p))}),n.push({shortcuts:u,contextName:c}),i(u,c)}function s(){return[...n]}function o(u){return u?`${NT}:${u}`:NT}function a(u){var c;const h=t.hotMenu.getShortcutManager(),d=o(u);return(c=h.getContext(d))!==null&&c!==void 0?c:h.addContext(d)}function l(u){t.hotMenu.getShortcutManager().setActiveContextName(o(u))}return{addCustomShortcuts:r,getCustomShortcuts:s,getContext:a,listen:l}}function w8(t){return(e,n,i,r,s,o)=>{if(n.hasAttribute("ghost-table"))return;const a=e.getSourceDataAtRow(i),l=t.rootDocument.createElement("div"),u=typeof o=="function"?o.call(t):o;if(es(n),q(l,"htItemWrapper"),t.getSettings().ariaTags){const c=!Gf(a,t)&&!HT(a)&&!cv(a);Ee(n,[RU(),CS(u),...c?[du(-1)]:[],...Gf(a,t)?[OU()]:[],...uv(a)?[ki(!1)]:[]])}n.className="",n.appendChild(l),cv(a)?q(n,"htSeparator"):typeof a.renderer=="function"?(q(n,"htCustomMenuRenderer"),n.appendChild(a.renderer(e,l,i,r,s,u))):gu(l,u),Gf(a,t)?q(n,"htDisabled"):HT(a)?q(n,"htSelectionDisabled"):uv(a)&&q(n,"htSubmenu")}}function DT(t,e,n){C8(t,e),e.set(t,n)}function C8(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xr(t,e,n){return e=v8(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v8(t){var e=S8(t,"string");return typeof e=="symbol"?e:e+""}function S8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function LT(t,e,n){return t.set(dx(t,e),n),n}function Qu(t,e){return t.get(dx(t,e))}function dx(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 $T=215;var Ju=new WeakMap,Kd=new WeakMap;class Cu{constructor(e,n){var i=this;xr(this,"hot",void 0),xr(this,"options",void 0),xr(this,"eventManager",new wr(this)),xr(this,"container",void 0),xr(this,"positioner",void 0),xr(this,"hotMenu",null),xr(this,"hotSubMenus",{}),xr(this,"parentMenu",void 0),xr(this,"menuItems",null),xr(this,"origOutsideClickDeselects",null),DT(this,Ju,void 0),DT(this,Kd,void 0),this.hot=e,this.options=n||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:$T,container:this.hot.rootDocument.documentElement},this.container=this.createContainer(this.options.name),this.positioner=new r8(this.options.keepInViewport),this.parentMenu=this.options.parent||null,this.registerEvents(),this.isSubMenu()&&this.addLocalHook("afterSelectionChange",function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return i.parentMenu.runLocalHooks("afterSelectionChange",...s)})}registerEvents(){let e=this.hot.rootWindow;for(;e;)this.eventManager.addEventListener(e.document,"mousedown",n=>this.onDocumentMouseDown(n)),this.eventManager.addEventListener(e.document,"contextmenu",n=>this.onDocumentContextMenu(n)),e=iu(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return Qu(Ju,this)}getKeyboardShortcutsCtrl(){return Qu(Kd,this)}getSelectedItem(){return this.hasSelectedItem()?this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelectedLast()[0]):null}hasSelectedItem(){return Array.isArray(this.hotMenu.getSelectedLast())}isSubMenu(){return this.parentMenu!==null}open(){this.runLocalHooks("beforeOpen"),this.container.removeAttribute("style"),this.container.style.display="block";const e=ES(a=>this.openSubMenu(a),300),n=this.options.minWidth||$T;let i=!1,r=gr(this.menuItems,a=>(a.key===ch&&(i=!0),c8(a,this.hot)));if(r.length<1&&!i)r.push(ix()[ch]);else if(r.length===0)return;r=f8(r,Be);let s=!1;const o={data:r,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth(a){return de(a)&&a<n?n:a},autoRowSize:!1,readOnly:!0,editor:!1,copyPaste:!1,hiddenRows:!0,maxCols:1,columns:[{data:"name",renderer:w8(this.hot)}],renderAllRows:!0,fragmentSelection:!1,outsideClickDeselects:!1,disableVisualSelection:"area",layoutDirection:this.hot.isRtl()?"rtl":"ltr",ariaTags:!1,beforeOnCellMouseOver:(a,l)=>{Qu(Ju,this).setCurrentPage(l.row)},afterOnCellMouseOver:(a,l)=>{this.isAllSubMenusClosed()?e(l.row):this.openSubMenu(l.row)},rowHeights:a=>r[a].name===Be?1:23,afterOnCellContextMenu:a=>{a.preventDefault(),ZE()&&s&&this.hasSelectedItem()&&this.close(!0)},afterSelection:(a,l,u,c,h)=>{this.hotMenu.view.isMouseDown()&&(h.value=!0),this.runLocalHooks("afterSelectionChange",this.getSelectedItem())},beforeOnCellMouseUp:a=>{this.hasSelectedItem()&&(s=!this.isCommandPassive(this.getSelectedItem()),this.executeCommand(a))},afterOnCellMouseUp:a=>{(!ZE()||!Da(a))&&s&&this.hasSelectedItem()&&(bo()||CP()?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,o),this.hotMenu.addHook("afterInit",()=>this.onAfterInit()),this.hotMenu.init(),LT(Ju,this,g8(this.hotMenu)),LT(Kd,this,p8(this)),Qu(Kd,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(Qu(Ju,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.getSelectedLast();if(n){const i=this.parentMenu.hotMenu.getCell(n[0],0);Ee(i,[ki(!1)])}}this.parentMenu.hotMenu.listen()}}}openSubMenu(e){if(!this.hotMenu)return!1;const n=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!n||!a8(n))return!1;const i=this.hotMenu.getSourceDataAtRow(e),r=new Cu(this.hot,{parent:this,name:i.name,className:this.options.className,keepInViewport:!0,container:this.options.container});return r.setMenuItems(i.submenu.items),r.open(),r.setPosition(n.getBoundingClientRect()),this.hotSubMenus[i.key]=r,this.hot.getSettings().ariaTags&&Ee(n,[ki(!0)]),r}closeSubMenu(e){const n=this.hotMenu.getSourceDataAtRow(e),i=this.hotSubMenus[n.key];if(i){i.destroy(),delete this.hotSubMenus[n.key];const r=this.hotMenu.getCell(e,0);this.hot.getSettings().ariaTags&&Ee(r,[ki(!1)])}}closeAllSubMenus(){M(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 i=this.hot.getSelectedRange(),r=i?s8(i):[];this.runLocalHooks("executeCommand",n.key,r,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",n.key,r,e)}isCommandPassive(e){return e.isCommand===!1||cv(e)||Gf(e,this.hot)||uv(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)}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const n=this.options.container.ownerDocument;let i=e,r;return i&&(Et(i)&&(i=i.call(this.hot),i===null||Mt(i)?i="":i=i.toString()),i=i.replace(/[^A-z0-9]/g,"_"),i=`${this.options.className}Sub_${i}`,r=n.querySelector(`.${this.options.className}.${i}`)),r||(r=n.createElement("div"),q(r,`htMenu ${this.options.className}`),i&&q(r,i),this.options.container.appendChild(r)),r}onAfterInit(){const{wtTable:e}=this.hotMenu.view._wt,n=this.hotMenu.getSettings().data,i=e.hider.style,r=e.holder.style,s=parseInt(i.width,10),o=Hn(n,(a,l)=>a+(l.name===Be?1:26),0);r.width=`${s+3}px`,r.height=`${o+3}px`,i.height=r.height,this.hot.getSettings().ariaTags&&Ee(this.hotMenu.rootElement,[bU(),du(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!xa(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!xa(e.target,".htMenu")&&this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&_e(e.target,"htCore")&&xa(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}bt(Cu,zn);function y8(t,e){b8(t,e),e.add(t)}function b8(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bw(t,e,n){return e=R8(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R8(t){var e=E8(t,"string");return typeof e=="symbol"?e:e+""}function E8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xd(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 Ic="contextMenu",T8=70,kT=Ic;ce.getSingleton().register("afterContextMenuDefaultOptions");ce.getSingleton().register("beforeContextMenuShow");ce.getSingleton().register("afterContextMenuShow");ce.getSingleton().register("afterContextMenuHide");ce.getSingleton().register("afterContextMenuExecute");var ec=new WeakSet;class km extends ut{constructor(){super(...arguments),y8(this,ec),bw(this,"commandExecutor",new ox(this.hot)),bw(this,"itemsFactory",null),bw(this,"menu",null)}static get PLUGIN_KEY(){return Ic}static get PLUGIN_PRIORITY(){return T8}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Nm,Dm,Be,Fh,Vh,Be,Hm,Bh,Be,Lm,Am,Be,Wh,Be,xi]}isEnabled(){return!!this.hot.getSettings()[Ic]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[Ic];typeof n.callback=="function"&&this.commandExecutor.setCommonCallback(n.callback),this.menu=new Cu(this.hot,{className:"htContextMenu",keepInViewport:!0,container:n.uiContainer||this.hot.rootDocument.body}),this.menu.addLocalHook("beforeOpen",()=>Xd(ec,this,_8).call(this)),this.menu.addLocalHook("afterOpen",()=>Xd(ec,this,I8).call(this)),this.menu.addLocalHook("afterClose",()=>Xd(ec,this,P8).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return e.executeCommand.call(e,...r)}),this.addHook("afterOnCellContextMenu",i=>Xd(ec,this,M8).call(this,i)),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.getSelectedRangeLast();this.hot.scrollToFocusedCell();const n=this.hot.getCell(e.row,e.col,!0).getBoundingClientRect(),i=Om(this.menu.container,this.hot.rootDocument);this.open({left:n.left+i.left,top:n.top+i.top-1+n.height},{left:n.width,above:-n.height}),this.menu.getNavigator().toFirstItem()},runOnlyIf:()=>{var e;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n&&this.hot.selection.isCellVisible(n)&&!this.menu.isOpened()},group:kT})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(kT)}open(e){var n;let i=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(),Ue(i,(r,s)=>{this.menu.setOffset(s,r)}),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,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.commandExecutor.execute(e,...i)}prepareMenuItems(){this.itemsFactory=new ax(this.hot,km.DEFAULT_ITEMS);const e=this.hot.getSettings()[Ic],n={items:this.itemsFactory.getItems(e)};this.hot.runHooks("afterContextMenuDefaultOptions",n),this.itemsFactory.setPredefinedItems(n.items);const i=this.itemsFactory.getItems(e);this.hot.runHooks("beforeContextMenuSetItems",i),this.menu.setMenuItems(i),M(i,r=>this.commandExecutor.registerCommand(r.key,r))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function M8(t){const e=this.hot.getSettings(),n=e.rowHeaders,i=e.colHeaders;function r(a){return a.nodeName==="TD"||a.parentNode.nodeName==="TD"}const s=t.target;if(this.close(),_e(s,"handsontableInput")||(t.preventDefault(),t.stopPropagation(),!(n||i)&&!r(s)&&!(_e(s,"current")&&_e(s,"wtBorder"))))return;const o=Om(this.menu.container,this.hot.rootDocument);this.open({top:t.clientY+o.top,left:t.clientX+o.left})}function _8(){this.hot.runHooks("beforeContextMenuShow",this)}function I8(){this.hot.runHooks("afterContextMenuShow",this)}function P8(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}km.SEPARATOR={name:Be};function O8(t){return{key:"copy",name(){return this.getTranslatedPhrase(wy)},callback(){t.copyCellsOnly()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function x8(t){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeLast(),n=e?gt(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Sy,n)},callback(){t.copyColumnHeadersOnly()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function A8(t){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeLast(),n=e?gt(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(vy,n)},callback(){t.copyWithAllColumnHeaders()},disabled(){if(!this.hasColHeaders()||!this.getSettings().nestedHeaders)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function H8(t){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeLast(),n=e?gt(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Cy,n)},callback(){t.copyWithColumnHeaders()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function N8(t){return{key:"cut",name(){return this.getTranslatedPhrase(yy)},callback(){t.cut()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}class D8{constructor(){this.data={}}setData(e,n){this.data[e]=n}getData(e){return this.data[e]||void 0}}class L8{constructor(){this.clipboardData=new D8}preventDefault(){}}function $8(t,e){fx(t,e),e.add(t)}function Sl(t,e,n){fx(t,e),e.set(t,n)}function fx(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kn(t,e){return t.get(jl(t,e))}function yl(t,e,n){return t.set(jl(t,e),n),n}function jl(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 eo=new WeakMap,Rw=new WeakMap,tc=new WeakMap,hv=new WeakMap,dv=new WeakMap,nc=new WeakMap,ic=new WeakSet;class k8{constructor(e){let{countRows:n,countColumns:i,rowsLimit:r,columnsLimit:s,countColumnHeaders:o}=e;$8(this,ic),Sl(this,eo,void 0),Sl(this,Rw,void 0),Sl(this,tc,void 0),Sl(this,hv,void 0),Sl(this,dv,void 0),Sl(this,nc,void 0),yl(Rw,this,n),yl(tc,this,i),yl(hv,this,r),yl(dv,this,s),yl(nc,this,o)}setSelectedRange(e){yl(eo,this,e)}getCellsRange(){if(kn(Rw,this).call(this)===0||kn(tc,this).call(this)===0)return null;const{row:e,col:n}=kn(eo,this).getTopStartCorner(),{row:i,col:r}=kn(eo,this).getBottomEndCorner(),s=jl(ic,this,F8).call(this,e,i),o=jl(ic,this,Ew).call(this,n,r);return{isRangeTrimmed:i!==s||r!==o,startRow:e,startCol:n,endRow:s,endCol:o}}getMostBottomColumnHeadersRange(){if(kn(tc,this).call(this)===0||kn(nc,this).call(this)===0)return null;const{col:e}=kn(eo,this).getTopStartCorner(),{col:n}=kn(eo,this).getBottomEndCorner(),i=jl(ic,this,Ew).call(this,e,n);return{isRangeTrimmed:n!==i,startRow:-1,startCol:e,endRow:-1,endCol:i}}getAllColumnHeadersRange(){if(kn(tc,this).call(this)===0||kn(nc,this).call(this)===0)return null;const{col:e}=kn(eo,this).getTopStartCorner(),{col:n}=kn(eo,this).getBottomEndCorner(),i=jl(ic,this,Ew).call(this,e,n);return{isRangeTrimmed:n!==i,startRow:-kn(nc,this).call(this),startCol:e,endRow:-1,endCol:i}}}function Ew(t,e){return Math.min(e,Math.max(t+kn(dv,this).call(this)-1,t))}function F8(t,e){return Math.min(e,Math.max(t+kn(hv,this).call(this)-1,t))}function gx(t){const e=[],n=[];return M(t,i=>{const r=Math.min(i.startRow,i.endRow),s=Math.max(i.startRow,i.endRow);me(r,s,l=>{e.indexOf(l)===-1&&e.push(l)});const o=Math.min(i.startCol,i.endCol),a=Math.max(i.startCol,i.endCol);me(o,a,l=>{n.indexOf(l)===-1&&n.push(l)})}),{rows:e,columns:n}}function V8(t,e){mx(t,e),e.add(t)}function to(t,e,n){mx(t,e),e.set(t,n)}function mx(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rc(t,e,n){return e=W8(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function W8(t){var e=B8(t,"string");return typeof e=="symbol"?e:e+""}function B8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ni(t,e){return t.get(ii(t,e))}function nr(t,e,n){return t.set(ii(t,e),n),n}function ii(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")}ce.getSingleton().register("afterCopyLimit");ce.getSingleton().register("modifyCopyableRange");ce.getSingleton().register("beforeCut");ce.getSingleton().register("afterCut");ce.getSingleton().register("beforePaste");ce.getSingleton().register("afterPaste");ce.getSingleton().register("beforeCopy");ce.getSingleton().register("afterCopy");const qd="copyPaste",U8=80,Y8=["fragmentSelection"],FT=['<meta name="generator" content="Handsontable"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join("");var fv=new WeakMap,gv=new WeakMap,mv=new WeakMap,bl=new WeakMap,Zd=new WeakMap,Qd=new WeakMap,Rl=new WeakMap,Tg=new WeakMap,hi=new WeakSet;class z8 extends ut{constructor(){super(...arguments),V8(this,hi),rc(this,"columnsLimit",1/0),rc(this,"rowsLimit",1/0),rc(this,"pasteMode","overwrite"),rc(this,"uiContainer",this.hot.rootDocument.body),to(this,fv,!1),to(this,gv,!1),to(this,mv,!1),to(this,bl,"cells-only"),to(this,Zd,!1),to(this,Qd,!1),to(this,Rl,new k8({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),to(this,Tg,!1),rc(this,"copyableRanges",[])}static get PLUGIN_KEY(){return qd}static get SETTING_KEYS(){return[qd,...Y8]}static get PLUGIN_PRIORITY(){return U8}isEnabled(){return!!this.hot.getSettings()[qd]}enablePlugin(){var e=this;if(this.enabled)return;const{[qd]:n}=this.hot.getSettings();if(typeof n=="object"){var i,r;this.pasteMode=(i=n.pasteMode)!==null&&i!==void 0?i:this.pasteMode,this.rowsLimit=isNaN(n.rowsLimit)?this.rowsLimit:n.rowsLimit,this.columnsLimit=isNaN(n.columnsLimit)?this.columnsLimit:n.columnsLimit,nr(fv,this,!!n.copyColumnHeaders),nr(gv,this,!!n.copyColumnGroupHeaders),nr(mv,this,!!n.copyColumnHeadersOnly),this.uiContainer=(r=n.uiContainer)!==null&&r!==void 0?r:this.uiContainer}this.addHook("afterContextMenuDefaultOptions",s=>ii(hi,this,K8).call(this,s)),this.addHook("afterSelection",function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return ii(hi,e,X8).call(e,...o)}),this.addHook("afterSelectionEnd",()=>ii(hi,this,q8).call(this)),this.eventManager.addEventListener(this.hot.rootDocument,"copy",function(){return e.onCopy(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"cut",function(){return e.onCut(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"paste",function(){return e.onPaste(...arguments)}),pP()&&(this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseenter",function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return ii(hi,e,Z8).call(e,...o)}),this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseleave",function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return ii(hi,e,Q8).call(e,...o)}),this.addHook("afterSelection",()=>ii(hi,this,J8).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";nr(bl,this,e),nr(Zd,this,!0),ii(hi,this,VT).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(){nr(Qd,this,!0),ii(hi,this,VT).call(this,"cut")}getRangedCopyableData(e){return Dc(this.getRangedData(e))}getRangedData(e){const n=[],{rows:i,columns:r}=gx(e);return M(i,s=>{const o=[];M(r,a=>{s<0?o.push(this.hot.getColHeader(a,s)):o.push(this.hot.getCopyableData(s,a))}),n.push(o)}),n}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 i=new L8;e&&i.clipboardData.setData("text/plain",e),n&&i.clipboardData.setData("text/html",n),this.onPaste(i)}setCopyableText(){const e=this.hot.getSelectedRangeLast();if(!e)return;if(e.isSingleHeader()){this.copyableRanges=[];return}ni(Rl,this).setSelectedRange(e);const n=new Map([["headers",null],["cells",null]]);ni(bl,this)==="column-headers-only"?n.set("headers",ni(Rl,this).getMostBottomColumnHeadersRange()):(ni(bl,this)==="with-column-headers"?n.set("headers",ni(Rl,this).getMostBottomColumnHeadersRange()):ni(bl,this)==="with-column-group-headers"&&n.set("headers",ni(Rl,this).getAllColumnHeadersRange()),n.set("cells",ni(Rl,this).getCellsRange())),this.copyableRanges=Array.from(n.values()).filter(r=>r!==null).map(r=>{let{startRow:s,startCol:o,endRow:a,endCol:l}=r;return{startRow:s,startCol:o,endRow:a,endCol:l}}),this.copyableRanges=this.hot.runHooks("modifyCopyableRange",this.copyableRanges);const i=n.get("cells");if(i!==null&&i.isRangeTrimmed){const{startRow:r,startCol:s,endRow:o,endCol:a}=i;this.hot.runHooks("afterCopyLimit",o-r+1,a-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 n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.hot.getSelectedRangeLast();if(!e.length)return;const i=e.length,r=e[0].length,s=[],{row:o,col:a}=n.getTopStartCorner(),{row:l,col:u}=n.getBottomEndCorner();let c=o,h=a,d=o,g=a;for(;s.length<i||c<=l;){const{skipRowOnPaste:p,visualRow:C}=this.hot.getCellMeta(c,a);if(c=C+1,p===!0)continue;d=C,h=a;const S=[],b=s.length%i;for(;S.length<r||h<=u;){const{skipColumnOnPaste:R,visualCol:E}=this.hot.getCellMeta(o,h);if(h=E+1,R===!0)continue;g=E;const H=S.length%r;S.push(e[b][H])}s.push(S)}return nr(Tg,this,!0),this.hot.populateFromArray(o,a,s,void 0,void 0,"CopyPaste.paste",this.pasteMode),[o,a,d,g]}onCopy(e){if(!this.hot.isListening()&&!ni(Zd,this)||this.isEditorOpened()||!this.hot.getSettings().outsideClickDeselects&&e.target!==this.hot.rootDocument.body)return;this.setCopyableText(),nr(Zd,this,!1);const n=this.getRangedData(this.copyableRanges),i=ii(hi,this,G8).call(this,this.copyableRanges);if(!!this.hot.runHooks("beforeCopy",n,this.copyableRanges,i)){const s=Dc(n);if(e&&e.clipboardData){const o=c0(n,this.hot.rootDocument);e.clipboardData.setData("text/plain",s),e.clipboardData.setData("text/html",[FT,o].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",s);this.hot.runHooks("afterCopy",n,this.copyableRanges,i)}nr(bl,this,"cells-only"),e.preventDefault()}onCut(e){if(!this.hot.isListening()&&!ni(Qd,this)||this.isEditorOpened()||!this.hot.getSettings().outsideClickDeselects&&e.target!==this.hot.rootDocument.body)return;this.setCopyableText(),nr(Qd,this,!1);const n=this.getRangedData(this.copyableRanges);if(!!this.hot.runHooks("beforeCut",n,this.copyableRanges)){const r=Dc(n);if(e&&e.clipboardData){const s=c0(n,this.hot.rootDocument);e.clipboardData.setData("text/plain",r),e.clipboardData.setData("text/html",[FT,s].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",r);this.hot.emptySelectedCells("CopyPaste.cut"),this.hot.runHooks("afterCut",n,this.copyableRanges)}e.preventDefault()}onPaste(e){if(!this.hot.isListening()||this.isEditorOpened()||!this.hot.getSelected()||!this.hot.getSettings().outsideClickDeselects&&e.target!==this.hot.rootDocument.body)return;e.preventDefault();let n;if(e&&typeof e.clipboardData<"u"){const a=wS(e.clipboardData.getData("text/html"),{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0});a&&/(<table)|(<TABLE)/g.test(a)?n=Xz(a,this.hot.rootDocument).data:n=e.clipboardData.getData("text/plain")}else typeof ClipboardEvent>"u"&&typeof this.hot.rootWindow.clipboardData<"u"&&(n=this.hot.rootWindow.clipboardData.getData("Text"));if(typeof n=="string"&&(n=l3(n)),n===void 0||n&&n.length===0||this.hot.runHooks("beforePaste",n,this.copyableRanges)===!1)return;const[i,r,s,o]=this.populateValues(n);this.hot.selectCell(i,r,Math.min(this.hot.countRows()-1,s),Math.min(this.hot.countCols()-1,o)),this.hot.runHooks("afterPaste",n,this.copyableRanges)}destroy(){super.destroy()}}function VT(t){if(pP()){const e=this.hot.getSelectedRangeLast();if(e){const{row:n,col:i}=e.highlight,r=this.hot.getCell(n,i,!0);r&&JU(r,()=>{this.hot.rootDocument.execCommand(t)})}}else this.hot.rootDocument.execCommand(t)}function G8(t){const{rows:e}=gx(t);let n=0;for(let i=0;i<e.length&&!(e[i]>=0);i++)n+=1;return{columnHeadersCount:n}}function j8(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:n}=t.highlight,i=this.hot.getCell(e,n,!0);i&&aP(i)}}}function px(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:n}=t.highlight,i=this.hot.getCell(e,n,!0);i!=null&&i.hasAttribute("contenteditable")&&lP(i)}}}function K8(t){t.items.push({name:"---------"},O8(this)),ni(fv,this)&&t.items.push(H8(this)),ni(gv,this)&&t.items.push(A8(this)),ni(mv,this)&&t.items.push(x8(this)),t.items.push(N8(this))}function X8(t,e,n,i,r){ni(Tg,this)&&(r.value=!0),nr(Tg,this,!1)}function q8(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function Z8(){ii(hi,this,px).call(this)}function Q8(){ii(hi,this,j8).call(this)}function J8(){ii(hi,this,px).call(this)}function wx(t,e){return`border_row${t}col${e}`}function Pc(){return{width:1,color:"#000"}}function xs(){return{hide:!0}}function e5(){return{width:1,color:"#000",cornerVisible:!1}}function Tw(t){if(de(t.start)||de(t.left)){var e;t.start=(e=t.start)!==null&&e!==void 0?e:t.left}if(de(t.end)||de(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 sc(t){return de(t.start)&&(t.left=t.start),de(t.end)&&(t.right=t.end),t}function Mw(t,e){return{id:wx(t,e),border:e5(),row:t,col:e,top:xs(),bottom:xs(),start:xs(),end:xs()}}function t5(t,e){return Ut(e,"border")&&e.border&&(t.border=e.border),Ut(e,"top")&&de(e.top)&&(e.top?(ke(e.top)||(e.top=Pc()),t.top=e.top):(e.top=xs(),t.top=e.top)),Ut(e,"bottom")&&de(e.bottom)&&(e.bottom?(ke(e.bottom)||(e.bottom=Pc()),t.bottom=e.bottom):(e.bottom=xs(),t.bottom=e.bottom)),Ut(e,"start")&&de(e.start)&&(e.start?(ke(e.start)||(e.start=Pc()),t.start=e.start):(e.start=xs(),t.start=e.start)),Ut(e,"end")&&de(e.end)&&(e.end?(ke(e.end)||(e.end=Pc()),t.end=e.end):(e.end=xs(),t.end=e.end)),t}function ks(t,e){let n=!1;return M(t.getSelectedRange(),i=>{i.forAll((r,s)=>{if(r<0||s<0)return;const o=t.getCellMeta(r,s).borders;if(o)if(e){if(!Ut(o[e],"hide")||o[e].hide===!1)return n=!0,!1}else return n=!0,!1})}),n}function Fm(t){return`<span class="selected">✓</span>${t}`}function n5(t){return t.some(e=>de(e.left)||de(e.right))}function i5(t){return t.some(e=>de(e.start)||de(e.end))}const r5=new Map([["left","start"],["right","end"]]);function s5(t){var e;return(e=r5.get(t))!==null&&e!==void 0?e:t}function o5(t){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(Wy);return ks(this,"bottom")&&(e=Fm(e)),e},callback(e,n){const i=ks(this,"bottom");t.prepareBorder(n,"bottom",i)}}}function a5(t){const e=t.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let n=this.getTranslatedPhrase(By);return ks(this,e)&&(n=Fm(n)),n},callback(n,i){const r=ks(this,e);t.prepareBorder(i,e,r)}}}function l5(t){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(Uy)},callback(e,n){t.prepareBorder(n,"noBorders")},disabled(){return!ks(this)}}}function u5(t){const e=t.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let n=this.getTranslatedPhrase(Vy);return ks(this,e)&&(n=Fm(n)),n},callback(n,i){const r=ks(this,e);t.prepareBorder(i,e,r)}}}function c5(t){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(Fy);return ks(this,"top")&&(e=Fm(e)),e},callback(e,n){const i=ks(this,"top");t.prepareBorder(n,"top",i)}}}function h5(t,e){d5(t,e),e.add(t)}function d5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function f5(t,e,n){return e=g5(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function g5(t){var e=m5(t,"string");return typeof e=="symbol"?e:e+""}function m5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function WT(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 jf="customBorders",p5=90;var _w=new WeakSet;class w5 extends ut{constructor(){super(...arguments),h5(this,_w),f5(this,"savedBorders",[])}static get PLUGIN_KEY(){return jf}static get PLUGIN_PRIORITY(){return p5}isEnabled(){return!!this.hot.getSettings()[jf]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>WT(_w,this,C5).call(this,e)),this.addHook("init",()=>WT(_w,this,v5).call(this)),super.enablePlugin())}disablePlugin(){this.hideBorders(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.changeBorderSettings(),super.updatePlugin()}setBorders(e,n){let i=["top","bottom","start","end"],r=null;n&&(this.checkSettingsCohesion([n]),i=Object.keys(n),r=Tw(n));const s=su(e),o=uh(s,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});M(e,a=>{o(a).forAll((l,u)=>{M(i,c=>{this.prepareBorderFromCustomAdded(l,u,r,s5(c))})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const n=su(e),i=uh(n,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),r=[];return M(e,s=>{i(s).forAll((o,a)=>{M(this.savedBorders,l=>{l.row===o&&l.col===a&&r.push(sc(l))})})}),r}clearBorders(e){e?this.setBorders(e):(M(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 r=this.hot._createCellRange(this.hot._createCellCoords(e.row,e.col));this.checkCustomSelections(e,r,n)||this.hot.selection.highlight.addCustomSelection({border:e,visualCellRange:r})}prepareBorderFromCustomAdded(e,n,i,r){const s=this.hot.countRows(),o=this.hot.countCols();if(e>=s||n>=o)return;let a=Mw(e,n);i&&(a=t5(a,i),M(this.hot.selection.highlight.customSelections,l=>{if(a.id===l.settings.id)return Object.assign(l.settings,i),a.id=l.settings.id,a.top=l.settings.top,a.bottom=l.settings.bottom,a.start=l.settings.start,a.end=l.settings.end,!1})),this.hot.setCellMeta(e,n,"borders",sc(a)),this.insertBorderIntoSettings(a,r)}prepareBorderFromCustomAddedRange(e,n){const i=Math.min(e.to.row,this.hot.countRows()-1),r=Math.min(e.to.col,this.hot.countCols()-1);me(e.from.row,i,s=>{me(e.from.col,r,o=>{const a=Mw(s,o);let l=0;s===e.from.row&&Ut(n,"top")&&(l+=1,a.top=n.top),s===e.to.row&&Ut(n,"bottom")&&(l+=1,a.bottom=n.bottom),o===e.from.col&&Ut(n,"start")&&(l+=1,a.start=n.start),o===e.to.col&&Ut(n,"end")&&(l+=1,a.end=n.end),l>0&&(this.hot.setCellMeta(s,o,"borders",sc(a)),this.insertBorderIntoSettings(a))})})}removeAllBorders(e,n){const i=wx(e,n);this.spliceBorder(i),this.clearBordersFromSelectionSettings(i),this.clearNullCellRange(),this.hot.removeCellMeta(e,n,"borders")}setBorder(e,n,i,r){let s=this.hot.getCellMeta(e,n).borders;!s||s.border===void 0?s=Mw(e,n):s=Tw(s),r?(s[i]=xs(),this.countHide(s)===4?this.removeAllBorders(e,n):(this.checkCustomSelectionsFromContextMenu(s,i,r)||this.insertBorderIntoSettings(s),this.hot.setCellMeta(e,n,"borders",sc(s)))):(s[i]=Pc(),this.checkCustomSelectionsFromContextMenu(s,i,r)||this.insertBorderIntoSettings(s),this.hot.setCellMeta(e,n,"borders",sc(s)))}prepareBorder(e,n,i){M(e,r=>{let{start:s,end:o}=r;if(s.row===o.row&&s.col===o.col)n==="noBorders"?this.removeAllBorders(s.row,s.col):this.setBorder(s.row,s.col,n,i);else switch(n){case"noBorders":me(s.col,o.col,a=>{me(s.row,o.row,l=>{this.removeAllBorders(l,a)})});break;case"top":me(s.col,o.col,a=>{this.setBorder(s.row,a,n,i)});break;case"bottom":me(s.col,o.col,a=>{this.setBorder(o.row,a,n,i)});break;case"start":me(s.row,o.row,a=>{this.setBorder(a,s.col,n,i)});break;case"end":me(s.row,o.row,a=>{this.setBorder(a,o.col,n,i)});break}})}createCustomBorders(e){M(e,n=>{const i=Tw(n);n.range?this.prepareBorderFromCustomAddedRange(n.range,i):this.prepareBorderFromCustomAdded(n.row,n.col,i)})}countHide(e){const{top:n,bottom:i,start:r,end:s}=e;return Hn([n,i,r,s],(a,l)=>{let u=a;return l&&l.hide&&(u+=1),u},0)}clearBordersFromSelectionSettings(e){const n=Ke(this.hot.selection.highlight.customSelections,i=>i.settings.id).indexOf(e);n>-1&&this.hot.selection.highlight.customSelections[n].clear()}clearNullCellRange(){M(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(){M(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()})}spliceBorder(e){const n=Ke(this.savedBorders,i=>i.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):M(this.savedBorders,(r,s)=>{if(e.id===r.id)return this.savedBorders[s]=e,n=!0,!1}),n}checkCustomSelectionsFromContextMenu(e,n,i){let r=!1;return M(this.hot.selection.highlight.customSelections,s=>{if(e.id===s.settings.id){const o=this.hot.view._wt.selectionManager.getBorderInstances(s);return M(o,a=>{a.toggleHiddenClass(n,i)}),r=!0,!1}}),r}checkCustomSelections(e,n,i){const r=this.countHide(e);let s=!1;return r===4?(this.removeAllBorders(e.row,e.col),s=!0):M(this.hot.selection.highlight.customSelections,o=>{if(e.id===o.settings.id){if(o.visualCellRange=n,o.commit(),i){const a=this.hot.view._wt.selectionManager.getBorderInstances(o);M(a,l=>{l.changeBorderStyle(i,e)})}return s=!0,!1}}),s}changeBorderSettings(){const e=this.hot.getSettings()[jf];if(Array.isArray(e)){const n=Yn(e);this.checkSettingsCohesion(n),n.length||(this.savedBorders=n),this.createCustomBorders(n)}else e!==void 0&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const n=n5(e),i=i5(e);if(n&&i)throw new Error('The "left"/"right" and "start"/"end" options should not be used together. Please use only the option "start"/"end".');if(this.hot.isRtl()&&n)throw new Error('The "left"/"right" properties are not supported for RTL. Please use option "start"/"end".')}destroy(){super.destroy()}}function C5(t){this.hot.getSettings()[jf]&&t.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(ky)},disabled(){const e=this.getSelectedRangeLast();return!e||e.isSingleHeader()?!0:this.selection.isSelectedByCorner()},submenu:{items:[c5(this),u5(this),o5(this),a5(this),l5(this)]}})}function v5(){this.changeBorderSettings()}function S5(t,e){y5(t,e),e.add(t)}function y5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Iw(t,e,n){return e=b5(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function b5(t){var e=R5(t,"string");return typeof e=="symbol"?e:e+""}function R5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function BT(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 UT="dragToScroll",E5=100;var Pw=new WeakSet;class T5 extends ut{constructor(){super(...arguments),S5(this,Pw),Iw(this,"boundaries",null),Iw(this,"callback",null),Iw(this,"listening",!1)}static get PLUGIN_KEY(){return UT}static get PLUGIN_PRIORITY(){return E5}isEnabled(){return!!this.hot.getSettings()[UT]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>BT(Pw,this,YT).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>BT(Pw,this,YT).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 i=0,r=0;n<this.boundaries.top?r=n-this.boundaries.top:n>this.boundaries.bottom&&(r=n-this.boundaries.bottom),e<this.boundaries.left?i=e-this.boundaries.left:e>this.boundaries.right&&(i=e-this.boundaries.right),this.callback(i,r)}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",i=>this.onMouseMove(i)),n=iu(n)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function YT(t){if(Da(t))return;const e=this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;this.setBoundaries(e!==this.hot.rootWindow?e.getBoundingClientRect():void 0),this.setCallback((n,i)=>{var r,s;const o=(r=e.scrollLeft)!==null&&r!==void 0?r:e.scrollX,a=(s=e.scrollTop)!==null&&s!==void 0?s:e.scrollY;e.scroll(o+Math.sign(n)*50,a+Math.sign(i)*20)}),this.listen()}function M5(t,e){Cx(t,e),e.add(t)}function _5(t,e,n){Cx(t,e),e.set(t,n)}function Cx(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ow(t,e,n){return e=I5(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function I5(t){var e=P5(t,"string");return typeof e=="symbol"?e:e+""}function P5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function O5(t,e){return t.get(Ai(t,e))}function vx(t,e,n){return t.set(Ai(t,e),n),n}function Ai(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")}ce.getSingleton().register("afterDropdownMenuDefaultOptions");ce.getSingleton().register("beforeDropdownMenuShow");ce.getSingleton().register("afterDropdownMenuShow");ce.getSingleton().register("afterDropdownMenuHide");ce.getSingleton().register("afterDropdownMenuExecute");const Kf="dropdownMenu",x5=230,Mg="changeType",xw=Kf;var Vm=new WeakMap,rr=new WeakSet;class Wm extends ut{static get PLUGIN_KEY(){return Kf}static get PLUGIN_PRIORITY(){return x5}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Fh,Vh,Be,Bh,Be,xm,Be,Wh,Be,xi]}constructor(e){super(e),M5(this,rr),Ow(this,"commandExecutor",new ox(this.hot)),Ow(this,"itemsFactory",null),Ow(this,"menu",null),_5(this,Vm,!1),this.hot.addHook("afterGetColHeader",(n,i)=>Ai(rr,this,H5).call(this,n,i))}isEnabled(){return this.hot.getSettings()[Kf]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new ax(this.hot,Wm.DEFAULT_ITEMS),this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return Ai(rr,e,F5).call(e,...s)}),this.addHook("beforeViewportScrollHorizontally",function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return Ai(rr,e,k5).call(e,...s)});const n=this.hot.getSettings()[Kf],i={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",i),this.itemsFactory.setPredefinedItems(i.items);const r=this.itemsFactory.getItems(n);this.menu&&this.menu.destroy(),this.menu=new Cu(this.hot,{className:"htDropdownMenu",keepInViewport:!0,container:n.uiContainer||this.hot.rootDocument.body}),this.hot.runHooks("beforeDropdownMenuSetItems",r),this.menu.setMenuItems(r),this.menu.addLocalHook("beforeOpen",()=>Ai(rr,this,N5).call(this)),this.menu.addLocalHook("afterOpen",()=>Ai(rr,this,D5).call(this)),this.menu.addLocalHook("afterSubmenuOpen",s=>Ai(rr,this,L5).call(this,s)),this.menu.addLocalHook("afterClose",()=>Ai(rr,this,$5).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return e.executeCommand.call(e,...o)}),M(r,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:i}=this.hot.getSelectedRangeLast();if((i.isHeader()&&i.row===-1||i.isCell())&&i.col>=0){this.hot.selectColumns(i.col,i.col,-1);const{from:r}=this.hot.getSelectedRangeLast(),s=Om(this.menu.container,this.hot.rootDocument),o=this.hot.getCell(-1,r.col,!0),a=o.getBoundingClientRect();this.open({left:a.left+s.left,top:a.top+o.offsetHeight+s.top},{left:a.width}),this.menu.getNavigator().toFirstItem()}};e.addShortcuts([{keys:[["Shift","Alt","ArrowDown"],["Control/Meta","Enter"]],callback:n,runOnlyIf:()=>{var i;const r=(i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight;return r&&this.hot.selection.isCellVisible(r)&&r.isHeader()&&!this.menu.isOpened()},captureCtrl:!0,group:xw},{keys:[["Shift","Alt","ArrowDown"]],callback:n,runOnlyIf:()=>{var i;const r=(i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight;return r&&this.hot.selection.isCellVisible(r)&&r.isCell()&&!this.menu.isOpened()},group:xw}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(xw)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>Ai(rr,this,A5).call(this,e))}open(e){var n;let i=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(),Ue(i,(r,s)=>{this.menu.setOffset(s,r)}),this.menu.setPosition(e))}close(){var e;(e=this.menu)===null||e===void 0||e.close()}executeCommand(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.commandExecutor.execute(e,...i)}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 Sx(t){t.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function A5(t){if(_e(t.target,Mg)){const e=Om(this.menu.container,this.hot.rootDocument),n=t.target.getBoundingClientRect();t.stopPropagation(),vx(Vm,this,!1),this.open({left:n.left+e.left,top:n.top+t.target.offsetHeight+3+e.top},{left:n.width})}}function H5(t,e){const n=e.parentNode;if(!n)return;const i=n.parentNode.childNodes,r=Array.prototype.indexOf.call(i,n);if(t<0||r!==i.length-1)return;const s=e.querySelector(`.${Mg}`);if(this.enabled&&s)return;if(!this.enabled){s&&s.parentNode.removeChild(s);return}const o=this.hot.rootDocument.createElement("button");o.className=Mg,o.type="button",o.tabIndex=-1,this.hot.getSettings().ariaTags&&(Ee(o,[Us(),CS(" ")]),Ee(e,[XI("menu")])),o.onclick=function(){return!1},e.firstChild.insertBefore(o,e.firstChild.firstChild)}function N5(){this.hot.runHooks("beforeDropdownMenuShow",this)}function D5(){this.hot.runHooks("afterDropdownMenuShow",this),Ai(rr,this,Sx).call(this,this.menu)}function L5(t){Ai(rr,this,Sx).call(this,t)}function $5(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function k5(t){return O5(Vm,this)?null:t}function F5(t){_e(t.target,Mg)&&vx(Vm,this,!0)}Wm.SEPARATOR={name:Be};function zT(t,e,n){return e=V5(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function V5(t){var e=W5(t,"string");return typeof e=="symbol"?e:e+""}function W5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class B5{constructor(e){zT(this,"hot",void 0),zT(this,"options",{}),this.hot=e}setOptions(e){this.options=e}getData(){const{startRow:e,startCol:n,endRow:i,endCol:r}=this._getDataRange(),s=this.options,o=[];return me(e,i,a=>{const l=[];!s.exportHiddenRows&&this._isHiddenRow(a)||(me(n,r,u=>{!s.exportHiddenColumns&&this._isHiddenColumn(u)||l.push(this.hot.getDataAtCell(a,u))}),o.push(l))}),o}getRowHeaders(){const e=[];if(this.options.rowHeaders){const{startRow:n,endRow:i}=this._getDataRange(),r=this.hot.getRowHeader();me(n,i,s=>{!this.options.exportHiddenRows&&this._isHiddenRow(s)||e.push(r[s])})}return e}getColumnHeaders(){const e=[];if(this.options.columnHeaders){const{startCol:n,endCol:i}=this._getDataRange(),r=this.hot.getColHeader();me(n,i,s=>{!this.options.exportHiddenColumns&&this._isHiddenColumn(s)||e.push(r[s])})}return e}_getDataRange(){const e=this.hot.countCols()-1,n=this.hot.countRows()-1;let[i=0,r=0,s=n,o=e]=this.options.range;return i=Math.max(i,0),r=Math.max(r,0),s=Math.min(s,n),o=Math.min(o,e),{startRow:i,startCol:r,endRow:s,endCol:o}}_isHiddenRow(e){return this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(e))}_isHiddenColumn(e){return this.hot.columnIndexMapper.isHidden(this.hot.toPhysicalColumn(e))}}function GT(t,e,n){return e=U5(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function U5(t){var e=Y5(t,"string");return typeof e=="symbol"?e:e+""}function Y5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Kb{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){GT(this,"dataProvider",void 0),GT(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(n),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let n=pr(this.constructor.DEFAULT_OPTIONS);const i=new Date;return n=tn(pr(Kb.DEFAULT_OPTIONS),n),n=tn(n,e),n.filename=GI(n.filename,{YYYY:i.getFullYear(),MM:`${i.getMonth()+1}`.padStart(2,"0"),DD:`${i.getDate()}`.padStart(2,"0")}),n}}const z5="\r",G5='"',j5=`
|
|
`;class K5 extends Kb{static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:`\r
|
|
`}}export(){const e=this.options,n=this.dataProvider.getData();let i=this.dataProvider.getColumnHeaders();const r=i.length>0,s=this.dataProvider.getRowHeaders(),o=s.length>0;let a=e.bom?"\uFEFF":"";return r&&(i=Ke(i,l=>this._escapeCell(l,!0)),o&&(a+=e.columnDelimiter),a+=i.join(e.columnDelimiter),a+=e.rowDelimiter),M(n,(l,u)=>{u>0&&(a+=e.rowDelimiter),o&&(a+=this._escapeCell(s[u])+e.columnDelimiter),a+=l.map(c=>this._escapeCell(c)).join(e.columnDelimiter)}),a}_escapeCell(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=Qt(e);return i!==""&&(n||i.indexOf(z5)>=0||i.indexOf(G5)>=0||i.indexOf(j5)>=0||i.indexOf(this.options.columnDelimiter)>=0)&&(i=i.replace(new RegExp('"',"g"),'""'),i=`"${i}"`),i}}const X5="csv",pv={[X5]:K5};function q5(t,e,n){return typeof pv[t]=="function"?new pv[t](e,n):null}const Z5="exportFile",Q5=240;class J5 extends ut{static get PLUGIN_KEY(){return Z5}static get PLUGIN_PRIORITY(){return Q5}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:i,rootWindow:r}=this.hot,s=this._createTypeFormatter(e,n),o=this._createBlob(s),a=r.URL||r.webkitURL,l=i.createElement("a"),u=`${s.options.filename}.${s.options.fileExtension}`;if(l.download!==void 0){const c=a.createObjectURL(o);l.style.display="none",l.setAttribute("href",c),l.setAttribute("download",u),i.body.appendChild(l),l.dispatchEvent(new MouseEvent("click")),i.body.removeChild(l),setTimeout(()=>{a.revokeObjectURL(c)},100)}else navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob(o,u)}_createTypeFormatter(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!pv[e])throw new Error(`Export format type "${e}" is not supported.`);return q5(e,new B5(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 El(t,e,n){return e=eZ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eZ(t){var e=tZ(t,"string");return typeof e=="symbol"?e:e+""}function tZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Uh{constructor(e,n){let{id:i,stateless:r=!0}=n;El(this,"hot",void 0),El(this,"id",void 0),El(this,"elements",[]),El(this,"hidden",!1),El(this,"stateId",""),El(this,"state",void 0),this.hot=e,this.id=i,this.stateId=`Filters.component.${this.id}`,this.state=r?null:this.hot.columnIndexMapper.registerMap(this.stateId,new bm)}getElements(){return this.elements}reset(){M(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(){throw new Error("The state setting logic is not implemented")}saveState(e){this.state&&this.state.setValueAtIndex(e,this.getState())}getState(){throw new Error("The state gathering logic is not implemented")}destroy(){this.hot.columnIndexMapper.unregisterMap(this.stateId),this.clearLocalHooks(),M(this.elements,e=>e.destroy()),this.state=null,this.elements=null,this.hot=null}}bt(Uh,zn);const hh={};function Ao(t,e){if(!hh[t])throw Error(`Filter condition "${t}" does not exist.`);const{condition:n,descriptor:i}=hh[t];let r=e;return i.inputValuesDecorator&&(r=i.inputValuesDecorator(r)),function(s){return n.apply(s.meta.instance,[].concat([s],[r]))}}function Ma(t){if(!hh[t])throw Error(`Filter condition "${t}" does not exist.`);return hh[t].descriptor}function Jt(t,e,n){n.key=t,hh[t]={condition:e,descriptor:n}}const mn="none";function nZ(){return!0}Jt(mn,nZ,{name:Rm,inputsCount:0,showOperators:!1});const Fc="empty";function iZ(t){return Xt(t.value)}Jt(Fc,iZ,{name:qy,inputsCount:0,showOperators:!0});const Xf="not_empty";function rZ(t,e){return!Ao(Fc,e)(t)}Jt(Xf,rZ,{name:Zy,inputsCount:0,showOperators:!0});const Vc="eq";function sZ(t,e){let[n]=e;return Qt(t.value).toLocaleLowerCase(t.meta.locale)===Qt(n)}Jt(Vc,sZ,{name:Qy,inputsCount:1,showOperators:!0});const qf="neq";function oZ(t,e){return!Ao(Vc,e)(t)}Jt(qf,oZ,{name:Jy,inputsCount:1,showOperators:!0});const yx="gt";function aZ(t,e){let[n]=e,i=n;return t.meta.type==="numeric"&&(i=parseFloat(i,10)),t.value>i}Jt(yx,aZ,{name:rb,inputsCount:1,showOperators:!0});const bx="gte";function lZ(t,e){let[n]=e,i=n;return t.meta.type==="numeric"&&(i=parseFloat(i,10)),t.value>=i}Jt(bx,lZ,{name:sb,inputsCount:1,showOperators:!0});const Rx="lt";function uZ(t,e){let[n]=e,i=n;return t.meta.type==="numeric"&&(i=parseFloat(i,10)),t.value<i}Jt(Rx,uZ,{name:ob,inputsCount:1,showOperators:!0});const Ex="lte";function cZ(t,e){let[n]=e,i=n;return t.meta.type==="numeric"&&(i=parseFloat(i,10)),t.value<=i}Jt(Ex,cZ,{name:ab,inputsCount:1,showOperators:!0});const Xb="date_after";function hZ(t,e){let[n]=e;const i=X(t.value,t.meta.dateFormat),r=X(n,t.meta.dateFormat);return!i.isValid()||!r.isValid()?!1:i.diff(r)>=0}Jt(Xb,hZ,{name:cb,inputsCount:1,showOperators:!0});const qb="date_before";function dZ(t,e){let[n]=e;const i=X(t.value,t.meta.dateFormat),r=X(n,t.meta.dateFormat);return!i.isValid()||!r.isValid()?!1:i.diff(r)<=0}Jt(qb,dZ,{name:hb,inputsCount:1,showOperators:!0});const _g="between";function fZ(t,e){let[n,i]=e,r=n,s=i;if(t.meta.type==="numeric"){const o=parseFloat(r,10),a=parseFloat(s,10);r=Math.min(o,a),s=Math.max(o,a)}else if(t.meta.type==="date"){const o=Ao(qb,[s]),a=Ao(Xb,[r]);return o(t)&&a(t)}return t.value>=r&&t.value<=s}Jt(_g,fZ,{name:lb,inputsCount:2,showOperators:!0});const Tx="not_between";function gZ(t,e){return!Ao(_g,e)(t)}Jt(Tx,gZ,{name:ub,inputsCount:2,showOperators:!0});const Mx="begins_with";function mZ(t,e){let[n]=e;return Qt(t.value).toLocaleLowerCase(t.meta.locale).startsWith(Qt(n))}Jt(Mx,mZ,{name:eb,inputsCount:1,showOperators:!0});const _x="ends_with";function pZ(t,e){let[n]=e;return Qt(t.value).toLocaleLowerCase(t.meta.locale).endsWith(Qt(n))}Jt(_x,pZ,{name:tb,inputsCount:1,showOperators:!0});const Zb="contains";function wZ(t,e){let[n]=e;return Qt(t.value).toLocaleLowerCase(t.meta.locale).indexOf(Qt(n))>=0}Jt(Zb,wZ,{name:nb,inputsCount:1,showOperators:!0});const Ix="not_contains";function CZ(t,e){return!Ao(Zb,e)(t)}Jt(Ix,CZ,{name:ib,inputsCount:1,showOperators:!0});const Px="date_tomorrow";function vZ(t){const e=X(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(X().subtract(-1,"days").startOf("day"),"d"):!1}Jt(Px,vZ,{name:fb,inputsCount:0});const Ox="date_today";function SZ(t){const e=X(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(X().startOf("day"),"d"):!1}Jt(Ox,SZ,{name:db,inputsCount:0});const xx="date_yesterday";function yZ(t){const e=X(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(X().subtract(1,"days").startOf("day"),"d"):!1}Jt(xx,yZ,{name:gb,inputsCount:0});CY();function bZ(t,e){let n=t;return n===""&&(n=`(${e})`),n}const wv=new Set([1]).has(1),RZ=wv&&typeof Array.from=="function";function Yh(t){let e=t;return wv&&(e=new Set(e)),function(n){let i;return wv?i=e.has(n):i=!!~e.indexOf(n),i}}function Ax(t){return t??""}function Cv(t){let e=t;return RZ?e=Array.from(new Set(e)):e=UI(e),e=e.sort((n,i)=>typeof n=="number"&&typeof i=="number"?n-i:n===i?0:n>i?1:-1),e}function jT(t,e,n,i){const r=[],s=t===e;let o;return s||(o=Yh(e)),M(t,a=>{let l=!1;(s||o(a))&&(l=!0);const u={checked:l,value:a,visualValue:bZ(a,n)};i&&i(u),r.push(u)}),r}const _a="by_value";function EZ(t,e){let[n]=e;return n(t.value)}Jt(_a,EZ,{name:"By value",inputsCount:0,inputValuesDecorator(t){let[e]=t;return[Yh(e)]},showOperators:!1});const dh={};function TZ(t){if(!dh[t])throw Error(`Operation with id "${t}" does not exist.`);const e=dh[t].func;return function(n,i){return e(n,i)}}function MZ(t){return dh[t].name}function Qb(t,e,n){dh[t]={name:e,func:n}}const Po="conjunction",_Z=wb;function IZ(t,e){return t.every(n=>n.func(e))}Qb(Po,_Z,IZ);const Ig="disjunction",PZ=Em;function OZ(t,e){return t.some(n=>n.func(e))}Qb(Ig,PZ,OZ);const Jb="disjunctionWithExtraCondition",xZ=Em;function AZ(t,e){if(t.length<3)throw Error("Operation doesn't work on less then three conditions.");return t.slice(0,t.length-1).some(n=>n.func(e))&&t[t.length-1].func(e)}Qb(Jb,xZ,AZ);const HZ="numeric",Hx="text",NZ="date",KT={[HZ]:[mn,Be,Fc,Xf,Be,Vc,qf,Be,yx,bx,Rx,Ex,_g,Tx],[Hx]:[mn,Be,Fc,Xf,Be,Vc,qf,Be,Mx,_x,Be,Zb,Ix],[NZ]:[mn,Be,Fc,Xf,Be,Vc,qf,Be,qb,Xb,_g,Be,Px,Ox,xx]};function DZ(t){const e=[];let n=t;return KT[n]||(n=Hx),M(KT[n],i=>{let r;i===Be?r={name:Be}:r=pr(Ma(i)),e.push(r)}),e}function oc(t,e,n){return e=LZ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LZ(t){var e=$Z(t,"string");return typeof e=="symbol"?e:e+""}function $Z(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Aw="built",Hw="building",XT=["click","input","keydown","keypress","keyup","focus","blur","change"];let hr=class Nx{static get DEFAULTS(){return pr({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,n){oc(this,"hot",void 0),oc(this,"eventManager",new wr(this)),oc(this,"options",void 0),oc(this,"_element",void 0),oc(this,"buildState",void 0),this.hot=e,this.options=tn(Nx.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===Hw?this._element:this.buildState===Aw?(this.update(),this._element):(this.buildState=Hw,this.build(),this.buildState=Aw,this._element)}isBuilt(){return this.buildState===Aw}translateIfPossible(e){return typeof e=="string"&&e.startsWith(Gn)?this.hot.getTranslatedPhrase(e):e}build(){const e=(n,i)=>{this.eventManager.addEventListener(n,i,r=>this.runLocalHooks(i,r,this))};if(this.buildState||(this.buildState=Hw),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&&q(this._element,this.options.className),this.options.children.length)M(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),Ue(this.options,(i,r)=>{n[r]!==void 0&&r!=="className"&&r!=="tagName"&&r!=="children"&&(n[r]=this.translateIfPossible(i))}),this._element.appendChild(n),M(XT,i=>e(n,i))}else M(XT,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}};bt(hr,zn);function kZ(t,e){Dx(t,e),e.add(t)}function FZ(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 Jd(t,e){return t.get(eR(t,e))}function VZ(t,e,n){return t.set(eR(t,e),n),n}function eR(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 Tl=new WeakMap,qT=new WeakSet;class Oo extends hr{static get DEFAULTS(){return pr({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,n){super(e,tn(Oo.DEFAULTS,n)),kZ(this,qT),FZ(this,Tl,void 0),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",e=>eR(qT,this,WZ).call(this,e))}build(){super.build();const e=this.hot.rootDocument.createElement("div");VZ(Tl,this,this._element.firstChild),q(this._element,"htUIInput"),q(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(Jd(Tl,this).type=this.options.type,Jd(Tl,this).placeholder=this.translateIfPossible(this.options.placeholder),Jd(Tl,this).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&Jd(Tl,this).focus()}}function WZ(t){this.options.value=t.target.value}function BZ(t,e){Lx(t,e),e.add(t)}function ac(t,e,n){Lx(t,e),e.set(t,n)}function Lx(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ml(t,e,n){return t.set(Wc(t,e),n),n}function $t(t,e){return t.get(Wc(t,e))}function Wc(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 sn=new WeakMap,ef=new WeakMap,tf=new WeakMap,Nw=new WeakMap,nf=new WeakMap,rf=new WeakSet;class fh extends hr{static get DEFAULTS(){return pr({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,n){super(e,tn(fh.DEFAULTS,n)),BZ(this,rf),ac(this,sn,null),ac(this,ef,[]),ac(this,tf,void 0),ac(this,Nw,void 0),ac(this,nf,void 0),this.registerHooks()}getMenu(){return $t(sn,this)}registerHooks(){this.addLocalHook("click",()=>Wc(rf,this,zZ).call(this))}setItems(e){Ml(ef,this,this.translateNames(e)),$t(sn,this)&&$t(sn,this).setMenuItems($t(ef,this))}translateNames(e){return M(e,n=>{n.name=this.translateIfPossible(n.name)}),e}build(){super.build(),Ml(sn,this,new Cu(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),$t(sn,this).setMenuItems($t(ef,this));const e=new hr(this.hot,{className:"htUISelectCaption"}),n=new hr(this.hot,{className:"htUISelectDropdown"});Ml(tf,this,e),Ml(Nw,this,e.element),Ml(nf,this,n),this.hot.getSettings().ariaTags&&(Ee(n.element,[Us()]),Ee(this._element,[KI()])),M([e,n],i=>this._element.appendChild(i.element)),$t(sn,this).addLocalHook("select",i=>Wc(rf,this,UZ).call(this,i)),$t(sn,this).addLocalHook("afterClose",()=>Wc(rf,this,YZ).call(this)),this.update()}update(){if(!this.isBuilt())return;let e;this.options.value?e=this.options.value.name:e=$t(sn,this).hot.getTranslatedPhrase(Rm),$t(Nw,this).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();$t(sn,this)&&($t(sn,this).open(),$t(sn,this).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),$t(sn,this).getNavigator().toFirstItem(),$t(sn,this).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:n=>{this.closeOptions(),this.runLocalHooks("tabKeydown",n)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){$t(sn,this)&&$t(sn,this).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){$t(sn,this)&&($t(sn,this).destroy(),Ml(sn,this,null)),$t(tf,this)&&$t(tf,this).destroy(),$t(nf,this)&&$t(nf,this).destroy(),super.destroy()}}function UZ(t){t.name!==Be&&(this.options.value=t,this.update(),this.runLocalHooks("select",this.options.value))}function YZ(){this.runLocalHooks("afterClose")}function zZ(){this.openOptions()}function GZ(t,e){jZ(t,e),e.add(t)}function jZ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ZT(t,e,n){return e=KZ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function KZ(t){var e=XZ(t,"string");return typeof e=="symbol"?e:e+""}function XZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function QT(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 Dw=new WeakSet;class vv extends Uh{constructor(e,n){super(e,{id:n.id,stateless:!1}),GZ(this,Dw),ZT(this,"name",""),ZT(this,"addSeparator",!1),this.name=n.name,this.addSeparator=n.addSeparator,this.elements.push(new fh(this.hot,{menuContainer:n.menuContainer})),this.elements.push(new Oo(this.hot,{placeholder:Rb})),this.elements.push(new Oo(this.hot,{placeholder:Eb})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",e=>QT(Dw,this,qZ).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),M(this.getInputElements(),e=>{e.addLocalHook("keydown",n=>QT(Dw,this,ZZ).call(this,n))})}setState(e){if(this.reset(),!e)return;const n=pr(e.command);n.name.startsWith(zt)&&(n.name=this.hot.getTranslatedPhrase(n.name)),this.getSelectElement().setValue(n),M(e.args,(i,r)=>{if(r>n.inputsCount-1)return!1;const s=this.getInputElement(r);s.setValue(i),s[n.inputsCount>r?"show":"hide"](),r||this.hot._registerTimeout(()=>s.focus(),10)})}getState(){const e=this.getSelectElement().getValue()||Ma(mn),n=[];return M(this.getInputElements(),(i,r)=>{e.inputsCount>r&&n.push(i.getValue())}),{command:e,args:n}}updateState(e,n){const i=Ma(e?e.name:mn);this.state.setValueAtIndex(n,{command:i,args:e?e.args:[]}),e||M(this.getInputElements(),r=>r.setValue(null))}getSelectElement(){return this.elements.filter(e=>e instanceof fh)[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 Oo)}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,i,r,s,o)=>{q(n.parentNode,"htFiltersMenuCondition"),this.addSeparator&&q(n.parentNode,"border");const a=this.hot.rootDocument.createElement("div");return q(a,"htFiltersMenuLabel"),a.textContent=o,n.appendChild(a),M(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let n=[Ma(mn)];if(e!==null){const{visualIndex:i}=e;n=DZ(this.hot.getDataType(0,i,this.hot.countRows(),i))}M(this.getInputElements(),i=>i.hide()),this.getSelectElement().setItems(n),super.reset(),this.getSelectElement().setValue(n[0])}}function qZ(t){M(this.getInputElements(),(e,n)=>{e[t.inputsCount>n?"show":"hide"](),n===0&&this.hot._registerTimeout(()=>e.focus(),10)}),this.runLocalHooks("change",t)}function ZZ(t){xh(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),yr(t))}function JT(t,e,n){QZ(t,e),e.set(t,n)}function QZ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lc(t,e){return t.get($x(t,e))}function eM(t,e,n){return t.set($x(t,e),n),n}function $x(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 _l=new WeakMap,Lw=new WeakMap;class Pg extends hr{static get DEFAULTS(){return pr({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,n){super(e,tn(Pg.DEFAULTS,n)),JT(this,_l,void 0),JT(this,Lw,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),eM(Lw,this,e),eM(_l,this,this._element.firstChild),lc(_l,this).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(lc(Lw,this).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return this.isBuilt()?lc(_l,this).checked:!1}setChecked(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isBuilt()&&(lc(_l,this).checked=e)}focus(){this.isBuilt()&&lc(_l,this).focus()}}function JZ(t,e){eQ(t,e),e.add(t)}function eQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tQ(t,e,n){return e=nQ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nQ(t){var e=iQ(t,"string");return typeof e=="symbol"?e:e+""}function iQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function rQ(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 tM=0;var nM=new WeakSet;class sQ extends Uh{constructor(e,n){super(e,{id:n.id,stateless:!1}),JZ(this,nM),tQ(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)=>(q(n.parentNode,"htFiltersMenuOperators"),M(this.elements,i=>n.appendChild(i.element)),n)}}buildOperatorsElement(){const e=[Po,Ig];M(e,n=>{const i=new Pg(this.hot,{name:"operator",label:{htmlFor:n,textContent:MZ(n)},value:n,checked:n===e[tM],id:n});i.addLocalHook("change",r=>rQ(nM,this,oQ).call(this,r)),this.elements.push(i)})}setChecked(e){if(this.elements.length<e)throw Error(ct`Radio button with index ${e} doesn't exist.`);M(this.elements,(n,i)=>{n.setChecked(i===e)})}getActiveOperationId(){const e=this.elements.find(n=>n instanceof Pg&&n.isChecked());return e?e.getValue():Po}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&M(this.elements,n=>{n.setChecked(n.getValue()===e)})}updateState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Po,n=arguments.length>1?arguments[1]:void 0,i=e;i===Jb&&(i=Ig),this.state.setValueAtIndex(n,i)}reset(){this.setChecked(tM)}}function oQ(t){this.setState(t.target.value)}function aQ(t,e,n){lQ(t,e),e.set(t,n)}function lQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $w(t,e){return t.get(kx(t,e))}function uQ(t,e,n){return t.set(kx(t,e),n),n}function kx(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 uc=new WeakMap;class gh extends hr{static get DEFAULTS(){return pr({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,n){super(e,tn(gh.DEFAULTS,n)),aQ(this,uc,void 0)}build(){super.build(),uQ(uc,this,this._element.firstChild)}update(){this.isBuilt()&&($w(uc,this).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&$w(uc,this).focus()}activate(){$w(uc,this).click()}}function cQ(t,e){Fx(t,e),e.add(t)}function Il(t,e,n){Fx(t,e),e.set(t,n)}function Fx(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xe(t,e){return t.get(Kl(t,e))}function Zi(t,e,n){return t.set(Kl(t,e),n),n}function Kl(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 iM="multipleSelect.itemBox";var sr=new WeakMap,Ht=new WeakMap,kw=new WeakMap,ws=new WeakMap,no=new WeakMap,io=new WeakMap,cc=new WeakSet;class mh extends hr{static get DEFAULTS(){return pr({className:"htUIMultipleSelect",value:[]})}constructor(e,n){super(e,tn(mh.DEFAULTS,n)),cQ(this,cc),Il(this,sr,[]),Il(this,Ht,void 0),Il(this,kw,void 0),Il(this,ws,void 0),Il(this,no,void 0),Il(this,io,void 0),Zi(ws,this,new Oo(this.hot,{placeholder:bb,className:"htUIMultipleSelectSearch"})),Zi(no,this,new gh(this.hot,{textContent:Cb,className:"htUISelectAll"})),Zi(io,this,new gh(this.hot,{textContent:vb,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return xe(Ht,this)}registerHooks(){xe(ws,this).addLocalHook("keydown",e=>Kl(cc,this,dQ).call(this,e)),xe(ws,this).addLocalHook("input",e=>Kl(cc,this,hQ).call(this,e)),xe(no,this).addLocalHook("click",e=>Kl(cc,this,fQ).call(this,e)),xe(io,this).addLocalHook("click",e=>Kl(cc,this,gQ).call(this,e))}setItems(e){Zi(sr,this,e),xe(Ht,this)&&xe(Ht,this).loadData(xe(sr,this))}setLocale(e){Zi(kw,this,e)}getLocale(){return xe(kw,this)}getItems(){return[...xe(sr,this)]}getValue(){return pQ(xe(sr,this))}getSearchInputElement(){return xe(ws,this)}getSelectAllElement(){return xe(no,this)}getClearAllElement(){return xe(io,this)}isSelectedAllValues(){return xe(sr,this).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,n=e.createElement("div"),i=new hr(this.hot,{className:"htUISelectionControls",children:[xe(no,this),xe(io,this)]});this._element.appendChild(xe(ws,this).element),this._element.appendChild(i.element),this._element.appendChild(n);const r=s=>{if(!this._element)return;xe(Ht,this)&&xe(Ht,this).destroy(),q(s,"htUIMultipleSelectHot"),Zi(Ht,this,new this.hot.constructor(s,{data:xe(sr,this),columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(l,u,c,h,d,g)=>{l.title=g.instance.getDataAtRowProp(u,g.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{xe(Ht,this).listen()},colWidths:()=>xe(Ht,this).container.scrollWidth-wn(e),maxCols:1,autoWrapCol:!0,height:110,copyPaste:!1,disableVisualSelection:"area",fillHandle:!1,fragmentSelection:"cell",tabMoves:{row:1,col:0},layoutDirection:this.hot.isRtl()?"rtl":"ltr"})),xe(Ht,this).init();const a=xe(Ht,this).getShortcutManager().getContext("grid");a.removeShortcutsByKeys(["Tab"]),a.removeShortcutsByKeys(["Shift","Tab"]),a.addShortcut({keys:[["Escape"]],callback:l=>{this.runLocalHooks("keydown",l,this)},group:iM}),a.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:l=>{xe(Ht,this).deselectCell(),this.runLocalHooks("keydown",l,this),this.runLocalHooks("listTabKeydown",l,this)},group:iM})};r(n),this.hot._registerTimeout(()=>r(n),100)}focus(){this.isBuilt()&&xe(Ht,this).listen()}reset(){xe(ws,this).reset(),xe(no,this).reset(),xe(io,this).reset()}update(){this.isBuilt()&&(xe(Ht,this).loadData(mQ(xe(sr,this),this.options.value)),super.update())}destroy(){xe(Ht,this)&&xe(Ht,this).destroy(),xe(ws,this).destroy(),xe(io,this).destroy(),xe(no,this).destroy(),Zi(ws,this,null),Zi(io,this,null),Zi(no,this,null),Zi(Ht,this,null),Zi(sr,this,null),super.destroy()}}function hQ(t){const e=t.target.value.toLocaleLowerCase(this.getLocale());let n;e===""?n=[...xe(sr,this)]:n=xe(sr,this).filter(i=>`${i.value}`.toLocaleLowerCase(this.getLocale()).indexOf(e)>=0),xe(Ht,this).loadData(n)}function dQ(t){this.runLocalHooks("keydown",t,this),uP(xh,t.keyCode)("ARROW_DOWN")&&(t.preventDefault(),yr(t),xe(Ht,this).listen(),xe(Ht,this).selectCell(0,0))}function fQ(t){const e=[];t.preventDefault(),xe(Ht,this).getSourceData().forEach((n,i)=>{n.checked=!0,e.push(ZP(n,i)[0])}),xe(Ht,this).setSourceDataAtCell(e)}function gQ(t){const e=[];t.preventDefault(),xe(Ht,this).getSourceData().forEach((n,i)=>{n.checked=!1,e.push(ZP(n,i)[0])}),xe(Ht,this).setSourceDataAtCell(e)}function mQ(t,e){const n=Yh(e);return t.map(i=>(i.checked=n(i.value),i))}function pQ(t){const e=[];return t.forEach(n=>{n.checked&&e.push(n.value)}),e}function wQ(t,e){CQ(t,e),e.add(t)}function CQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function vQ(t,e,n){return e=SQ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function SQ(t){var e=yQ(t,"string");return typeof e=="symbol"?e:e+""}function yQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;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")}var hc=new WeakSet;class bQ extends Uh{constructor(e,n){super(e,{id:n.id,stateless:!1}),wQ(this,hc),vQ(this,"name",""),this.name=n.name,this.elements.push(new mh(this.hot)),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>sf(hc,this,RQ).call(this,e)).addLocalHook("listTabKeydown",e=>this.runLocalHooks("listTabKeydown",e)),this.hot.addHook("modifyFiltersMultiSelectValue",(e,n)=>sf(hc,this,EQ).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===_a){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?mn:_a},args:[e.getValue()],itemsSnapshot:n}}updateState(e){const n=(i,r,s,o,a)=>{const[l]=gr(r,h=>h.name===_a),u={},c=this.hot.getTranslatedPhrase(pg);if(l){const h=o(i,a),d=Ke(h,R=>R.value),g=new Map(h.map(R=>[R.value,this.hot.getCellMeta(R.meta.visualRow,R.meta.visualCol)])),p=Cv(d);s&&(l.args[0]=s);const C=[],S=jT(p,l.args[0],c,R=>{R.checked&&C.push(R.value),sf(hc,this,rM).call(this,R,g)}),b=e.editedConditionStack.column;u.locale=this.hot.getCellMeta(0,b).locale,u.args=[C],u.command=Ma(_a),u.itemsSnapshot=S}else u.args=[],u.command=Ma(mn);this.state.setValueAtIndex(i,u)};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 mh)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,i,r,s,o)=>{q(n.parentNode,"htFiltersMenuValue");const a=this.hot.rootDocument.createElement("div");return q(a,"htFiltersMenuLabel"),a.textContent=o,n.appendChild(a),M(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getTranslatedPhrase(pg),n=this._getColumnVisibleValues(),i=n.map(l=>l.value),r=new Map(n.map(l=>[l.value,l.meta])),s=Cv(i),o=jT(s,s,e,l=>{sf(hc,this,rM).call(this,l,r)});this.getMultipleSelectElement().setItems(o),super.reset(),this.getMultipleSelectElement().setValue(s);const a=this.hot.getPlugin("filters").getSelectedColumn();a!==null&&this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0,a.visualIndex).locale)}_getColumnVisibleValues(){const e=this.hot.getPlugin("filters").getSelectedColumn();return e===null?[]:Ke(this.hot.getDataAtCol(e.visualIndex),(n,i)=>({value:Ax(n),meta:this.hot.getCellMeta(i,e.visualIndex)}))}}function RQ(t){xh(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),yr(t))}function rM(t,e){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(t.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",t.visualValue,e.get(t.value)))}function EQ(t,e){switch(e.type){case"numeric":return LO(t,e);default:return t}}var Vx;function TQ(t,e){MQ(t,e),e.add(t)}function MQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _Q(t,e,n){return e=IQ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function IQ(t){var e=PQ(t,"string");return typeof e=="symbol"?e:e+""}function PQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function OQ(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 sM=new WeakSet;class ph extends Uh{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,n){super(e,{id:n.id,stateless:!0}),TQ(this,sM),_Q(this,"name",""),this.name=n.name,this.elements.push(new Oo(this.hot,{type:"button",value:Sb,className:"htUIButton htUIButtonOK",identifier:ph.BUTTON_OK})),this.elements.push(new Oo(this.hot,{type:"button",value:yb,className:"htUIButton htUIButtonCancel",identifier:ph.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){M(this.elements,e=>{e.addLocalHook("click",(n,i)=>OQ(sM,this,xQ).call(this,n,i))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n)=>(q(n.parentNode,"htFiltersMenuActionBar"),M(this.elements,i=>n.appendChild(i.element)),n)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}Vx=ph;function xQ(t,e){e.options.identifier===Vx.BUTTON_OK?this.accept():this.cancel()}function Fw(t,e,n){return e=AQ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function AQ(t){var e=HQ(t,"string");return typeof e=="symbol"?e:e+""}function HQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const oM="ConditionCollection.filteringStates";class tR{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;Fw(this,"hot",void 0),Fw(this,"isMapRegistrable",void 0),Fw(this,"filteringStates",new bm),this.hot=e,this.isMapRegistrable=n,this.isMapRegistrable===!0?this.hot.columnIndexMapper.registerMap(oM,this.filteringStates):this.filteringStates.init(this.hot.columnIndexMapper.getNumberOfIndexes())}isEmpty(){return this.getFilteredColumns().length===0}isMatch(e,n){var i;const r=this.filteringStates.getValueAtIndex(n),s=(i=r?.conditions)!==null&&i!==void 0?i:[],o=r?.operation;return this.isMatchInConditions(s,e,o)}isMatchInConditions(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Po;return e.length?TZ(i)(e,n):!0}addCondition(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Po,r=arguments.length>3?arguments[3]:void 0;const s=this.hot.getCellMeta(0,e).locale,o=Ke(n.args,c=>typeof c=="string"?c.toLocaleLowerCase(s):c),a=n.name||n.command.key;this.runLocalHooks("beforeAdd",e);const l=this.getOperation(e);if(l){if(l!==i)throw Error(ct`The column of index ${e} has been already applied with a \`${l}\`\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).`)}else if(Mt(dh[i]))throw new Error(ct`Unexpected operation named \`${i}\`. Possible ones are\x20
|
|
\`disjunction\` and \`conjunction\`.`);const u=this.getConditions(e);u.length===0?this.filteringStates.setValueAtIndex(e,{operation:i,conditions:[{name:a,args:o,func:Ao(a,o)}]},r):u.push({name:a,args:o,func:Ao(a,o)}),this.runLocalHooks("afterAdd",e)}getConditions(e){var n,i;return(n=(i=this.filteringStates.getValueAtIndex(e))===null||i===void 0?void 0:i.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 Hn(this.filteringStates.getEntries(),(e,n)=>{let[i,{operation:r,conditions:s}]=n;return e.push({column:i,operation:r,conditions:Ke(s,o=>{let{name:a,args:l}=o;return{name:a,args:l}})}),e},[])}importAllConditions(e){this.clean(),M(e,n=>{M(n.conditions,i=>this.addCondition(n.column,i))})}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 i=this.getConditions(e);return n?i.some(r=>r.name===n):i.length>0}destroy(){this.isMapRegistrable&&this.hot.columnIndexMapper.unregisterMap(oM),this.filteringStates=null,this.clearLocalHooks()}}bt(tR,zn);function aM(t,e,n){return e=NQ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function NQ(t){var e=DQ(t,"string");return typeof e=="symbol"?e:e+""}function DQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Wx{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>[];aM(this,"conditionCollection",void 0),aM(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=n}filter(){let e=[];return M(this.conditionCollection.getFilteredColumns(),(n,i)=>{let r=this.columnDataFactory(n);i&&(r=this._getIntersectData(r,e)),e=this.filterByColumn(n,r)}),e}filterByColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const i=[];return M(n,r=>{r!==void 0&&this.conditionCollection.isMatch(r,e)&&i.push(r)}),i}_getIntersectData(e,n){const i=[];return M(n,r=>{const s=r.meta.visualRow;e[s]!==void 0&&(i[s]=e[s])}),i}}function LQ(t,e){$Q(t,e),e.add(t)}function $Q(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=kQ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kQ(t){var e=FQ(t,"string");return typeof e=="symbol"?e:e+""}function FQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}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")}var of=new WeakSet;class Bx{constructor(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:()=>[];LQ(this,of),aa(this,"hot",void 0),aa(this,"conditionCollection",void 0),aa(this,"columnDataFactory",void 0),aa(this,"changes",[]),aa(this,"grouping",!1),aa(this,"latestEditedColumnPosition",-1),aa(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=n,this.columnDataFactory=i,this.conditionCollection.addLocalHook("beforeRemove",r=>Vw(of,this,VQ).call(this,r)),this.conditionCollection.addLocalHook("afterRemove",r=>this.updateStatesAtColumn(r)),this.conditionCollection.addLocalHook("afterAdd",r=>this.updateStatesAtColumn(r)),this.conditionCollection.addLocalHook("beforeClean",()=>Vw(of,this,WQ).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>Vw(of,this,BQ).call(this))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,M(this.changes,e=>{this.updateStatesAtColumn(e)}),this.changes.length=0}updateStatesAtColumn(e,n){var i=this;if(this.grouping){this.changes.indexOf(e)===-1&&this.changes.push(e);return}const r=this.conditionCollection.exportAllConditions();let s=this.conditionCollection.getColumnStackPosition(e);s===-1&&(s=this.latestEditedColumnPosition);const o=r.slice(0,s),a=r.slice(s);a.length&&a[0].column===e&&a.shift();const l=eY(function(c,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const g=new tR(i.hot,!1),p=[].concat(c,d);g.importAllConditions(p);const C=i.columnDataFactory(h);let S;g.isEmpty()?S=C:S=new Wx(g,R=>i.columnDataFactory(R)).filter(),S=Ke(S,R=>R.meta.visualRow);const b=Yh(S);return g.destroy(),gr(C,R=>b(R.meta.visualRow))})(o),u=[].concat(this.conditionCollection.getConditions(e));this.runLocalHooks("update",{editedConditionStack:{column:e,conditions:u},dependentConditionStacks:a,filteredRowsFactory:l,conditionArgsChange:n})}destroy(){this.clearLocalHooks(),Ue(this,(e,n)=>{this[n]=null})}}function VQ(t){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(t)}function WQ(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function BQ(){M(this.latestOrderStack,t=>{this.updateStatesAtColumn(t)})}bt(Bx,zn);function UQ(t){return ux({initialPage:0,size:()=>t.length,onItemSelect:(n,i)=>{const r=t[n];if(r instanceof mh)return i;if(r.element&&!Na(r.element))return!1;r.focus()}})}const dc="filters";function YQ(t,e){let n=-1;const i=UQ(e),r=l=>()=>{t.isOpened()&&t.getKeyboardShortcutsCtrl().listen(dc),i.setCurrentPage(e.indexOf(l))};e.forEach(l=>{l instanceof hr&&(l.addLocalHook("click",r(l)),l.addLocalHook("focus",r(l)),l.addLocalHook("afterClose",r(l)))}),t.addLocalHook("afterSelectionChange",l=>{l.key.startsWith("filter_")||i.clear()});function s(l){const u=t.getKeyboardShortcutsCtrl(),c=l.getKeyboardShortcutsCtrl();i.clear(),c.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:u.getContext(dc),callback:()=>{l.isSubMenu()&&l.close(),u.listen(dc)}}]),!l.isSubMenu()&&u.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:h=>{const d=t.getNavigator();d.getCurrentPage()>-1&&(n=d.getCurrentPage()),d.clear(),h.shiftKey?i.toPreviousItem():i.toNextItem()}},{keys:[["Escape"]],callback:()=>{t.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:h=>{const d=e[i.getCurrentPage()];d instanceof fh&&(d.openOptions(),h.preventDefault()),d instanceof gh&&(d.activate(),h.preventDefault()),d instanceof hr||h.preventDefault()}}],dc)}t.addLocalHook("afterSubmenuOpen",s),t.addLocalHook("afterOpen",s);function o(){t.focus(),t.getKeyboardShortcutsCtrl().listen(dc)}function a(){return n}return{...i,listen:o,getLastMenuPage:a}}function zQ(t,e){Ux(t,e),e.add(t)}function GQ(t,e,n){Ux(t,e),e.set(t,n)}function Ux(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fc(t,e,n){return e=jQ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jQ(t){var e=KQ(t,"string");return typeof e=="symbol"?e:e+""}function KQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function XQ(t,e,n){return t.set(ci(t,e),n),n}function gc(t,e){return t.get(ci(t,e))}function ci(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",qQ=250,lM=Sv;var la=new WeakMap,Mi=new WeakSet;class ZQ extends ut{static get PLUGIN_KEY(){return Sv}static get PLUGIN_PRIORITY(){return qQ}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){super(e),zQ(this,Mi),fc(this,"dropdownMenuPlugin",null),fc(this,"conditionCollection",null),fc(this,"conditionUpdateObserver",null),fc(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),fc(this,"filtersRowsMap",null),GQ(this,la,void 0),this.hot.addHook("afterGetColHeader",(n,i)=>ci(Mi,this,iJ).call(this,n,i))}isEnabled(){return!!this.hot.getSettings()[Sv]}enablePlugin(){if(this.enabled)return;this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new Lh),this.dropdownMenuPlugin=this.hot.getPlugin("dropdownMenu");const e=this.hot.getSettings().dropdownMenu,n=e&&e.uiContainer||this.hot.rootDocument.body,i=o=>(o.addLocalHook("accept",()=>ci(Mi,this,uM).call(this,"accept")),o.addLocalHook("cancel",()=>ci(Mi,this,uM).call(this,"cancel")),o.addLocalHook("change",a=>ci(Mi,this,nJ).call(this,o,a)),o),r=()=>`${this.hot.getTranslatedPhrase(mb)}:`,s=()=>`${this.hot.getTranslatedPhrase(pb)}:`;if(!this.components.get("filter_by_condition")){const o=new vv(this.hot,{id:"filter_by_condition",name:r,addSeparator:!1,menuContainer:n});o.addLocalHook("afterClose",()=>ci(Mi,this,cM).call(this)),this.components.set("filter_by_condition",i(o))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new sQ(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const o=new vv(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:n});o.addLocalHook("afterClose",()=>ci(Mi,this,cM).call(this)),this.components.set("filter_by_condition2",i(o))}if(this.components.get("filter_by_value")||this.components.set("filter_by_value",i(new bQ(this.hot,{id:"filter_by_value",name:s}))),this.components.get("filter_action_bar")||this.components.set("filter_action_bar",i(new ph(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new tR(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new Bx(this.hot,this.conditionCollection,o=>this.getDataMapAtColumn(o)),this.conditionUpdateObserver.addLocalHook("update",o=>ci(Mi,this,rJ).call(this,o))),this.components.forEach(o=>o.show()),this.addHook("afterDropdownMenuDefaultOptions",o=>ci(Mi,this,tJ).call(this,o)),this.addHook("afterDropdownMenuShow",()=>ci(Mi,this,JQ).call(this)),this.addHook("afterDropdownMenuHide",()=>ci(Mi,this,eJ).call(this)),this.addHook("afterChange",o=>ci(Mi,this,QQ).call(this,o)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!gc(la,this)&&this.dropdownMenuPlugin.enabled){const o=this.dropdownMenuPlugin.menu,a=[{focus:()=>{const u=o.getNavigator(),c=gc(la,this).getLastMenuPage();o.focus(),c>0?u.setCurrentPage(c):u.toFirstItem()}},...Array.from(this.components).map(u=>{let[,c]=u;return c.getElements()}).flat()];XQ(la,this,YQ(o,a));const l=u=>{gc(la,this).listen(),u.preventDefault(),xh(u.keyCode,"TAB")&&(u.shiftKey?gc(la,this).toPreviousItem():gc(la,this).toNextItem())};this.components.get("filter_by_value").addLocalHook("listTabKeydown",l),this.components.get("filter_by_condition").addLocalHook("selectTabKeydown",l)}this.registerShortcuts(),super.enablePlugin()}disablePlugin(){if(this.enabled){var e;(e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled&&this.dropdownMenuPlugin.menu.clearLocalHooks(),this.components.forEach((n,i)=>{n.destroy(),this.components.set(i,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:lM})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(lM)}addCondition(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Po;const s=this.hot.toPhysicalColumn(e);this.conditionCollection.addCondition(s,{command:{key:n},args:i},r)}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)}}filter(){const{navigableHeaders:e}=this.hot.getSettings(),n=this._createDataFilter(),i=!this.conditionCollection.isEmpty();let r=[];const s=this.conditionCollection.exportAllConditions();if(this.hot.runHooks("beforeFilter",s)!==!1)if(i){const a=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear(),r=Ke(n.filter(),u=>u.meta.visualRow);const l=Yh(r);me(this.hot.countSourceRows()-1,u=>{l(u)||a.push(u)}),M(a,u=>{this.filtersRowsMap.setValueAtIndex(u,!0)})},!0),!e&&!r.length&&this.hot.deselectCell()}else this.filtersRowsMap.clear();this.hot.runHooks("afterFilter",s),this.hot.view.adjustElementsSize(),this.hot.render(),this.hot.selection.isSelected()&&this.hot.selectCell(e?-1:0,this.hot.getSelectedRangeLast().highlight.col)}getSelectedColumn(){var e;const n=(e=this.hot.getSelectedRangeLast())===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.toVisualColumn(e),i=[];return M(this.hot.getSourceDataAtCol(n),(r,s)=>{var o;const{row:a,col:l,visualCol:u,visualRow:c,type:h,instance:d,dateFormat:g,locale:p}=this.hot.getCellMeta(s,n),C=(o=this.hot.getDataAtCell(this.hot.toVisualRow(s),n))!==null&&o!==void 0?o:r;i.push({meta:{row:a,col:l,visualCol:u,visualRow:c,type:h,instance:d,dateFormat:g,locale:p},value:Ax(C)})}),i}updateValueComponentCondition(e){const n=this.hot.getDataAtCol(e),i=Cv(n);this.conditionUpdateObserver.updateStatesAtColumn(e,i)}restoreComponents(e){var n;const i=(n=this.getSelectedColumn())===null||n===void 0?void 0:n.physicalIndex;e.forEach(r=>{r.isHidden()||r.restoreState(i)}),this.updateDependentComponentsVisibility()}getOperationBasedOnArguments(e,n,i,r){let s=e;return s===Ig&&n.command.key!==mn&&i.command.key!==mn&&r.command.key!==mn?s=Jb:r.command.key!==mn&&(n.command.key===mn||i.command.key===mn)&&(s=Po),s}setListeningDropdownMenu(){this.dropdownMenuPlugin&&this.dropdownMenuPlugin.setListening()}updateDependentComponentsVisibility(){const e=this.components.get("filter_by_condition"),{command:n}=e.getState(),i=[this.components.get("filter_by_condition2"),this.components.get("filter_operators")];n.showOperators?this.showComponents(...i):this.hideComponents(...i)}_createDataFilter(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.conditionCollection;return new Wx(e,n=>this.getDataMapAtColumn(n))}getIndexesOfComponents(){const e=[];if(!this.dropdownMenuPlugin)return e;const n=this.dropdownMenuPlugin.menu;for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return M(r,o=>{M(n.menuItems,(a,l)=>{a.key===o.getMenuItemDescriptor().key&&e.push(l)})}),e}changeComponentsVisibility(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.dropdownMenuPlugin)return;const i=this.dropdownMenuPlugin.menu.hotMenu,r=i.getPlugin("hiddenRows");for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];const l=this.getIndexesOfComponents(...o);e?r.showRows(l):r.hideRows(l),i.render()}hideComponents(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];this.changeComponentsVisibility(!1,...n)}showComponents(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];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 QQ(t){t&&M(t,e=>{const[,n]=e,i=this.hot.propToCol(n);this.conditionCollection.hasConditions(i)&&this.updateValueComponentCondition(i)})}function JQ(){this.restoreComponents(Array.from(this.components.values()))}function eJ(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function tJ(t){t.items.push({name:Be}),this.components.forEach(e=>{t.items.push(e.getMenuItemDescriptor())})}function uM(t){var e;if(t==="accept"){const i=this.getSelectedColumn();if(i===null){var n;(n=this.dropdownMenuPlugin)===null||n===void 0||n.close();return}const{physicalIndex:r}=i,s=this.components.get("filter_by_condition").getState(),o=this.components.get("filter_by_condition2").getState(),a=this.components.get("filter_by_value").getState(),l=this.getOperationBasedOnArguments(this.components.get("filter_operators").getActiveOperationId(),s,o,a);this.conditionUpdateObserver.groupChanges();let u=this.conditionCollection.getColumnStackPosition(r);u===-1&&(u=void 0),this.conditionCollection.removeConditions(r),s.command.key!==mn&&(this.conditionCollection.addCondition(r,s,l,u),o.command.key!==mn&&this.conditionCollection.addCondition(r,o,l,u)),a.command.key!==mn&&this.conditionCollection.addCondition(r,a,l,u),this.conditionUpdateObserver.flush(),this.components.forEach(c=>c.saveState(r)),this.filtersRowsMap.clear(),this.filter()}(e=this.dropdownMenuPlugin)===null||e===void 0||e.close()}function nJ(t,e){this.updateDependentComponentsVisibility(),t.constructor===vv&&!e.inputsCount&&this.setListeningDropdownMenu()}function cM(){this.setListeningDropdownMenu()}function iJ(t,e){const n=this.hot.toPhysicalColumn(t);this.enabled&&this.conditionCollection.hasConditions(n)?q(e,"htFiltersActive"):He(e,"htFiltersActive")}function rJ(t){var e;if(!((e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled))return;const{editedConditionStack:{conditions:n,column:i}}=t,r=n.filter(o=>o.name===_a),s=n.filter(o=>o.name!==_a);if(r.length>=2||s.length>=3)vt(ct`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 o=this.conditionCollection.getOperation(i);this.components.get("filter_by_condition").updateState(s[0],i),this.components.get("filter_by_condition2").updateState(s[1],i),this.components.get("filter_operators").updateState(o,i),this.components.get("filter_by_value").updateState(t)}}const Yx="internal-use-in-handsontable",yv={licenseKey:Yx,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 zx(t){var e;return{maxColumns:t.maxColumns,maxRows:t.maxRows,language:(e=t[Pn])===null||e===void 0||(e=e.language)===null||e===void 0?void 0:e.langCode}}function Gx(t){return Object.keys(t).reduce((e,n)=>(n!=="hyperformula"&&(e[n]=t[n]),e),{})}function sJ(t){var e;const n=t[Pn],i=Gx(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),r=zx(t);return{...yv,...i,...r}}function oJ(t){var e;const n=t[Pn],i=Gx(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),r=zx(t);return{...i,...r}}function aJ(t,e){return Object.keys(e).some(n=>e[n]!==void 0&&e[n]!==t[n])}function Bm(){const t="engine_relationship",e=br(Pn);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function nR(){const t="shared_engine_usage",e=br(Pn);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function lJ(t){const e=t.getSettings(),n=e[Pn],i=n?.engine;if(n===!0||Mt(i))return null;if(typeof i.hyperformula=="function"||typeof i=="function"){var r;return uJ((r=i.hyperformula)!==null&&r!==void 0?r:i,e,t)}else if(typeof i=="object"&&Mt(i.hyperformula)){const s=Bm(),o=nR().get(i);return s.has(i)||s.set(i,[]),s.get(i).push(t),o&&o.push(t.guid),i.getConfig().licenseKey||i.updateConfig({licenseKey:Yx}),(i.getConfig().leapYear1900!==yv.leapYear1900||TS(i.getConfig().nullDate,yv.nullDate)===!1)&&vt(ct`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.`),i}return null}function uJ(t,e,n){const i=e[Pn],r=sJ(e),s=Bm(),o=nR();cJ(t,i.functions),hJ(t,i.language);const a=t.buildEmpty(r);return s.set(a,[n]),o.set(a,[n.guid]),dJ(a,i.namedExpressions),a.on("sheetAdded",()=>{a.rebuildAndRecalculate()}),a.on("sheetRemoved",()=>{a.rebuildAndRecalculate()}),a}function hM(t){var e;const n=Bm(),i=n.size===0?[]:Array.from((e=n.get(t))!==null&&e!==void 0?e:[]);return new Map(i.map(r=>[r.getPlugin("formulas").sheetId,r]))}function dM(t,e){if(t){const n=Bm(),i=n.get(t),r=nR(),s=r.get(t);i&&i.includes(e)&&(i.splice(i.indexOf(e),1),i.length===0&&n.delete(t)),s&&s.includes(e.guid)&&(s.splice(s.indexOf(e.guid),1),s.length===0&&(r.delete(t),t.destroy()))}}function cJ(t,e){e&&e.forEach(n=>{const{name:i,plugin:r,translations:s}=n;try{t.registerFunction(i,r,s)}catch(o){vt(o.message)}})}function hJ(t,e){if(e){const{langCode:n}=e;try{t.registerLanguage(n,e)}catch(i){vt(i.message)}}}function dJ(t,e){e&&(t.suspendEvaluation(),e.forEach(n=>{const{name:i,expression:r,scope:s,options:o}=n;try{t.addNamedExpression(i,r,s,o)}catch(a){vt(a.message)}}),t.resumeEvaluation())}function fJ(t,e){return(Mt(e)||!t.doesSheetExist(e))&&(e=t.addSheet(e)),e}const jx="DD/MM/YYYY";function Kx(t){return typeof t=="string"&&t.charAt(0)==="'"&&t.charAt(1)==="="}function gJ(t){return Kx(t)?t.substr(1):t}function mJ(t){return typeof t=="string"&&t.startsWith("=")}function iR(t,e){return typeof t=="string"&&e==="date"}function Xx(t,e){return X(t,e,!0).isValid()}function qx(t,e){return X(t,e,!0).format(jx)}function pJ(t,e){return X(t,jx,!0).format(e)}function Zx(t,e){const i=new Date(Date.UTC(0,0,t+-1));return X(i).format(e)}function wJ(t,e,n){const i=Array.from(Array(n).keys()).filter(s=>t.includes(s)===!1);if(e===0){var r;return(r=i[e])!==null&&r!==void 0?r:0}return i[e-1]+1}function CJ(t,e){const n=[];return t.forEach(i=>{const r={from:i,to:e};n.forEach(s=>{const o=s.from>s.to,a=s.to<=r.from;s.from>r.from&&a&&o&&(r.from+=1)}),r.from>=e&&(e+=1),n.push(r)}),n}function vJ(t){return t.forEach((e,n)=>{t.slice(n+1).forEach(r=>{const s=r.from<r.to;r.from>e.from&&s&&(r.from-=1)})}),t}function rR(t,e,n){const i=CJ(t,wJ(t,e,n));return vJ(i)}function ua(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 It(t,e){return t.get(Qx(t,e))}function ro(t,e,n){return t.set(Qx(t,e),n),n}function Qx(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 mc=new WeakMap,so=new WeakMap,oi=new WeakMap,af=new WeakMap,Ww=new WeakMap,Bw=new WeakMap,lf=new WeakMap;class fM{constructor(e,n,i){ua(this,mc,void 0),ua(this,so,void 0),ua(this,oi,void 0),ua(this,af,[]),ua(this,Ww,[]),ua(this,Bw,void 0),ua(this,lf,[]),ro(mc,this,e),ro(so,this,n),ro(oi,this,i)}setRemovedHfIndexes(e){return ro(lf,this,e.map(n=>{const i=It(so,this).getVisualFromPhysicalIndex(n);return this.getHfIndexFromVisualIndex(i)})),It(lf,this)}getRemovedHfIndexes(){return It(lf,this)}getHfIndexFromVisualIndex(e){const n=It(so,this).getIndexesSequence(),i=It(so,this).getNotTrimmedIndexes();return n.indexOf(i[e])}syncMoves(e){const i=`move${mr(It(mc,this))}s`;It(oi,this).getEngine().batch(()=>{e.forEach(r=>{const s=r.from!==r.to,o=r.from+1!==r.to;s&&o&&It(oi,this).getEngine()[i](It(oi,this).getSheetId(),r.from,1,r.to)})})}storeMovesInformation(e,n,i){i!==!1&&(ro(Ww,this,e.map(r=>this.getHfIndexFromVisualIndex(r))),ro(Bw,this,this.getHfIndexFromVisualIndex(n)))}calculateAndSyncMoves(e,n){if(It(oi,this).isPerformingUndoRedo()||e===!1||n===!1)return;const i=rR(It(Ww,this),It(Bw,this),It(so,this).getNumberOfIndexes());It(oi,this).getSheetId()===null?It(oi,this).getPostponeAction(()=>this.syncMoves(i)):this.syncMoves(i)}getIndexesChangeSyncMethod(){const e=`set${mr(It(mc,this))}Order`;return n=>{if(It(oi,this).isPerformingUndoRedo())return;const i=It(so,this).getIndexesSequence();if(n==="update"&&i.length>0){const r=It(af,this).map(l=>i.indexOf(l)),s=It(oi,this).getEngine().getSheetDimensions(It(oi,this).getSheetId());let o;It(mc,this)==="row"?o=s.height:o=s.width;const a=r.length;for(let l=a;l<o;l+=1)r.push(l);It(oi,this).getEngine()[e](It(oi,this).getSheetId(),r)}ro(af,this,i)}}init(){ro(af,this,It(so,this).getIndexesSequence())}}function ca(t,e,n){yJ(t,e),e.set(t,n)}function yJ(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(Jx(t,e))}function ha(t,e,n){return t.set(Jx(t,e),n),n}function Jx(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 uf=new WeakMap,cf=new WeakMap,Uw=new WeakMap,Yw=new WeakMap,zw=new WeakMap,Gw=new WeakMap,jw=new WeakMap;class bJ{constructor(e,n,i){ca(this,uf,void 0),ca(this,cf,void 0),ca(this,Uw,void 0),ca(this,Yw,!1),ca(this,zw,!1),ca(this,Gw,null),ca(this,jw,null),ha(uf,this,new fM("row",e,this)),ha(cf,this,new fM("column",n,this)),ha(Uw,this,i)}getForAxis(e){return e==="row"?Cs(uf,this):Cs(cf,this)}setPerformUndo(e){ha(Yw,this,e)}setPerformRedo(e){ha(zw,this,e)}isPerformingUndoRedo(){return Cs(Yw,this)||Cs(zw,this)}getSheetId(){return Cs(jw,this)}getEngine(){return Cs(Gw,this)}getPostponeAction(){return Cs(Uw,this)}setupSyncEndpoint(e,n){ha(Gw,this,e),ha(jw,this,n),Cs(uf,this).init(),Cs(cf,this).init()}}function RJ(t,e){eA(t,e),e.add(t)}function Pl(t,e,n){return e=EJ(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function EJ(t){var e=TJ(t,"string");return typeof e=="symbol"?e:e+""}function TJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Kw(t,e,n){eA(t,e),e.set(t,n)}function eA(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ho(t,e,n){return t.set(dt(t,e),n),n}function eu(t,e){return t.get(dt(t,e))}function dt(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 Pn="formulas",MJ=["maxRows","maxColumns","language"],_J=260;ce.getSingleton().register("afterNamedExpressionAdded");ce.getSingleton().register("afterNamedExpressionRemoved");ce.getSingleton().register("afterSheetAdded");ce.getSingleton().register("afterSheetRemoved");ce.getSingleton().register("afterSheetRenamed");ce.getSingleton().register("afterFormulasValuesUpdate");const vu=t=>t==="UndoRedo.undo"||t==="UndoRedo.redo"||t==="auto";var Fs=new WeakMap,sR=new WeakMap,pc=new WeakMap,pt=new WeakSet;class IJ extends ut{constructor(){var e;super(...arguments),e=this,RJ(this,pt),Kw(this,Fs,!1),Kw(this,sR,!1),Kw(this,pc,[["valuesUpdated",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return dt(pt,e,YJ).call(e,...i)}],["namedExpressionAdded",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return dt(pt,e,zJ).call(e,...i)}],["namedExpressionRemoved",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return dt(pt,e,GJ).call(e,...i)}],["sheetAdded",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return dt(pt,e,jJ).call(e,...i)}],["sheetRenamed",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return dt(pt,e,KJ).call(e,...i)}],["sheetRemoved",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return dt(pt,e,XJ).call(e,...i)}]]),Pl(this,"staticRegister",br("formulas")),Pl(this,"engine",null),Pl(this,"sheetName",null),Pl(this,"indexSyncer",null),Pl(this,"rowAxisSyncer",null),Pl(this,"columnAxisSyncer",null)}static get PLUGIN_KEY(){return Pn}static get PLUGIN_PRIORITY(){return _J}static get SETTING_KEYS(){return[Pn,...MJ]}get sheetId(){return this.sheetName===null?null:this.engine.getSheetId(this.sheetName)}isEnabled(){return!!this.hot.getSettings()[Pn]}enablePlugin(){var e,n=this;if(!this.enabled){if(this.engine=(e=lJ(this.hot))!==null&&e!==void 0?e:this.engine,!this.engine){vt("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 i=this.addSheet(this.sheetName,this.hot.getSourceDataArray());i!==!1&&(this.sheetName=i)}this.addHook("beforeLoadData",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,gM).call(n,...r)}),this.addHook("afterLoadData",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,mM).call(n,...r)}),this.addHook("beforeUpdateData",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,gM).call(n,...r)}),this.addHook("afterUpdateData",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,mM).call(n,...r)}),this.addHook("modifyData",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,AJ).call(n,...r)}),this.addHook("modifySourceData",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,HJ).call(n,...r)}),this.addHook("beforeValidate",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,PJ).call(n,...r)}),this.addHook("afterSetSourceDataAtCell",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,NJ).call(n,...r)}),this.addHook("afterSetDataAtCell",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,pM).call(n,...r)}),this.addHook("afterSetDataAtRowProp",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,pM).call(n,...r)}),this.addHook("beforeCreateRow",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,DJ).call(n,...r)}),this.addHook("beforeCreateCol",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,LJ).call(n,...r)}),this.addHook("afterCreateRow",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,FJ).call(n,...r)}),this.addHook("afterCreateCol",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,VJ).call(n,...r)}),this.addHook("beforeRemoveRow",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,$J).call(n,...r)}),this.addHook("beforeRemoveCol",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,kJ).call(n,...r)}),this.addHook("afterRemoveRow",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,WJ).call(n,...r)}),this.addHook("afterRemoveCol",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,BJ).call(n,...r)}),this.indexSyncer=new bJ(this.hot.rowIndexMapper,this.hot.columnIndexMapper,i=>{this.hot.addHookOnce("init",()=>{i()})}),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",(i,r,s,o)=>{this.rowAxisSyncer.storeMovesInformation(i,r,o)}),this.hot.addHook("beforeColumnMove",(i,r,s,o)=>{this.columnAxisSyncer.storeMovesInformation(i,r,o)}),this.hot.addHook("afterRowMove",(i,r,s,o,a)=>{this.rowAxisSyncer.calculateAndSyncMoves(o,a)}),this.hot.addHook("afterColumnMove",(i,r,s,o,a)=>{this.columnAxisSyncer.calculateAndSyncMoves(o,a)}),this.hot.addHook("beforeColumnFreeze",(i,r)=>{this.columnAxisSyncer.storeMovesInformation([i],this.hot.getSettings().fixedColumnsStart,r)}),this.hot.addHook("afterColumnFreeze",(i,r)=>{this.columnAxisSyncer.calculateAndSyncMoves(r,r)}),this.hot.addHook("beforeColumnUnfreeze",(i,r)=>{this.columnAxisSyncer.storeMovesInformation([i],this.hot.getSettings().fixedColumnsStart-1,r)}),this.hot.addHook("afterColumnUnfreeze",(i,r)=>{this.columnAxisSyncer.calculateAndSyncMoves(r,r)}),this.addHook("afterCellMetaReset",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,xJ).call(n,...r)}),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 i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,UJ).call(n,...r)}),this.addHook("beforeAutofill",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return dt(pt,n,OJ).call(n,...r)}),eu(pc,this).forEach(i=>{let[r,s]=i;return this.engine.on(r,s)}),super.enablePlugin()}}disablePlugin(){eu(pc,this).forEach(e=>{let[n,i]=e;return this.engine.off(n,i)}),dM(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const n=oJ(this.hot.getSettings());aJ(this.engine.getConfig(),n)&&this.engine.updateConfig(n);const i=this.hot.getSettings()[Pn];if(de(i)&&de(i.sheetName)&&i.sheetName!==this.sheetName&&this.switchSheet(i.sheetName),!e.data&&this.sheetName===null){const r=this.hot.getSettings()[Pn].sheetName;r&&this.engine.doesSheetExist(r)?this.switchSheet(this.sheetName):this.sheetName=this.addSheet(r??void 0,this.hot.getSourceDataArray())}super.updatePlugin(e)}destroy(){eu(pc,this).forEach(e=>{var n;let[i,r]=e;return(n=this.engine)===null||n===void 0?void 0:n.off(i,r)}),Ho(pc,this,null),dM(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,n){if(de(n)&&!Xj(n))return vt("The provided data should be an array of arrays."),!1;if(e!=null&&this.engine.doesSheetExist(e))return vt("Sheet with the provided name already exists."),!1;try{const i=this.engine.addSheet(e??void 0);return n&&this.engine.setSheetContent(this.engine.getSheetId(i),n),i}catch(i){return vt(i.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e)){OS(`The sheet named \`${e}\` does not exist, switch aborted.`);return}this.sheetName=e;const n=this.engine.getSheetSerialized(this.sheetId);n.length>0&&this.hot.loadData(n,`${mr(Pn)}.switchSheet`)}getCellType(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;const r=this.hot.toPhysicalRow(e),s=this.hot.toPhysicalColumn(n);return r!==null&&s!==null?this.engine.getCellType({sheet:i,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n)}):"EMPTY"}isFormulaCellType(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;return this.engine.doesCellHaveFormula({sheet:i,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 i=new Set;e.forEach(r=>{var s;const o=r==null||(s=r.address)===null||s===void 0?void 0:s.sheet;o!==void 0&&(i.has(o)||i.add(o))}),hM(this.engine).forEach((r,s)=>{if((n||s!==this.sheetId)&&i.has(s)){var o;r.render(),(o=r.view)===null||o===void 0||o.adjustElementsSize()}})}validateDependentCells(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const i=s=>{var o;const{row:a,col:l,sheet:u}=(o=s?.address)!==null&&o!==void 0?o:{};return de(u)?`${u}:${a}x${l}`:""},r=new Set(n.map(s=>i(s)));e.forEach(s=>{var o,a;const{row:l,col:u}=(o=s.address)!==null&&o!==void 0?o:{};if(de(l)===!1||de(u)===!1||l>=this.hot.countRows()||u>=this.hot.countCols())return;const c=s==null||(a=s.address)===null||a===void 0?void 0:a.sheet,h=i(s);if(c!==void 0&&!r.has(h)){const d=hM(this.engine).get(c);if(!d)return;d.validateCell(d.getDataAtCell(l,u),d.getCellMeta(l,u),()=>{})}})}syncChangeWithEngine(e,n,i){const r={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(r)){vt(`Not possible to set cell data at ${JSON.stringify(r)}`);return}const s=this.hot.getCellMeta(e,n);return iR(i,s.type)&&(Xx(i,s.dateFormat)?i=qx(i,s.dateFormat):mJ(i)===!1&&(i=`'${i}`)),this.engine.setCellContents(r,i)}}function PJ(t,e,n){const i=this.hot.propToCol(n);if(this.isFormulaCellType(e,i)){const r={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(i),sheet:this.sheetId},s=this.hot.getCellMeta(e,i);let o=this.engine.getCellValue(r);return s.type==="date"&&Bn(o)&&(o=Zx(o,s.dateFormat)),typeof o=="object"&&o!==null?o.value:o}return t}function OJ(t,e,n){const{row:i,col:r}=e.getTopStartCorner(),{row:s,col:o}=e.getBottomEndCorner(),{row:a,col:l}=n.getTopStartCorner(),{row:u,col:c}=n.getBottomEndCorner(),h={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(s),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(o),sheet:this.sheetId}},d={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(a),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(u),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(c),sheet:this.sheetId}};if(this.engine.isItPossibleToSetCellContents(d)===!1)return!1;const g=this.engine.getFillRangeData(h,d),{row:p,col:C}=h.start,{row:S,col:b}=h.end,R=S-p+1,E=b-C+1;for(let H=0;H<g.length;H+=1)for(let P=0;P<g[H].length;P+=1){const B=g[H][P],Y=H%R,j=P%E,z=this.hot.getCellMeta(Y,j);iR(B,z.type)&&(B.startsWith("'")?g[H][P]=B.slice(1):this.isFormulaCellType(Y,j,this.sheetId)===!1&&(g[H][P]=pJ(B,z.dateFormat)))}return g}function gM(t,e){(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes(mr(Pn))||Ho(sR,this,Mt(this.hot.getSettings().data))}function xJ(){const t=this.hot.getSourceDataArray();let e=!1;t.forEach((n,i)=>{n.forEach((r,s)=>{const o=this.hot.getCellMeta(i,s),a=o.dateFormat;iR(r,o.type)&&(e=!0,Xx(r,a)?t[i][s]=qx(r,a):this.isFormulaCellType(i,s)===!1&&(t[i][s]=`'${r}`))})}),e===!0&&(Ho(Fs,this,!0),this.engine.setSheetContent(this.sheetId,t),Ho(Fs,this,!1))}function mM(t,e){if(!(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes(mr(Pn)))if(this.sheetName=fJ(this.engine,this.hot.getSettings()[Pn].sheetName),eu(sR,this))this.switchSheet(this.sheetName);else{const i=this.hot.getSourceDataArray();if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,i)){Ho(Fs,this,!0);const r=this.engine.setSheetContent(this.sheetId,i);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(r),Ho(Fs,this,!1)}}}function AJ(t,e,n,i){if(i!=="get"||eu(Fs,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const r=this.hot.toVisualRow(t);if(r===null||e===null)return;if(!this.isFormulaCellType(r,e)&&this.getCellType(r,e)!=="ARRAY"){Kx(n.value)&&(n.value=gJ(n.value));return}const o={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(r),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(e),sheet:this.sheetId};let a=this.engine.getCellValue(o),l=this.hot.getCellsMeta().find(c=>c.visualRow===r&&c.visualCol===e);l===void 0&&(l={}),l.type==="date"&&Bn(a)&&(a=Zx(a,l.dateFormat));const u=typeof a=="object"&&a!==null?a.value:a;n.value=u}function HJ(t,e,n,i){if(i!=="get"||eu(Fs,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const r=this.hot.toVisualRow(t),s=this.hot.propToCol(e);if(r===null||s===null||!this.isFormulaCellType(r,s)&&this.getCellType(r,s)!=="ARRAY")return;const a=this.engine.getSheetDimensions(this.engine.getSheetId(this.sheetName));if(a.width===0&&a.height===0)return;const l={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(r),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),sheet:this.sheetId};n.value=this.engine.getCellSerialized(l)}function pM(t,e){if(vu(e))return;const n=[],i=[],r=this.engine.batch(()=>{t.forEach(s=>{let[o,a,,l]=s;const u=this.hot.propToCol(a),c=this.hot.toPhysicalRow(o),h=this.hot.toPhysicalColumn(u),d={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(u),sheet:this.sheetId};c!==null&&h!==null?this.syncChangeWithEngine(o,u,l):n.push([o,u,l]),i.push({address:d})})});n.length&&this.hot.addHookOnce("afterChange",()=>{const s=this.engine.batch(()=>{n.forEach(o=>{let[a,l,u]=o;this.syncChangeWithEngine(a,l,u)})});this.renderDependentSheets(s,!0)}),this.renderDependentSheets(r),this.validateDependentCells(r,i)}function NJ(t,e){if(vu(e))return;const n=[],i=[];t.forEach(r=>{let[s,o,,a]=r;const l=this.hot.propToCol(o);if(!Bn(l))return;const u={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(s),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(u)){vt(`Not possible to set source cell data at ${JSON.stringify(u)}`);return}i.push({address:u}),n.push(...this.engine.setCellContents(u,a))}),this.renderDependentSheets(n),this.validateDependentCells(n,i)}function DJ(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 LJ(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 $J(t,e,n){return this.rowAxisSyncer.setRemovedHfIndexes(n).every(s=>this.engine.isItPossibleToRemoveRows(this.sheetId,[s,1]))===!1?!1:void 0}function kJ(t,e,n){return this.columnAxisSyncer.setRemovedHfIndexes(n).every(s=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[s,1]))===!1?!1:void 0}function FJ(t,e,n){if(vu(n))return;const i=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(i)}function VJ(t,e,n){if(vu(n))return;const i=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(i)}function WJ(t,e,n,i){if(vu(i))return;const r=this.rowAxisSyncer.getRemovedHfIndexes().sort((o,a)=>a-o),s=this.engine.batch(()=>{r.forEach(o=>{this.engine.removeRows(this.sheetId,[o,1])})});this.renderDependentSheets(s)}function BJ(t,e,n,i){if(vu(i))return;const r=this.columnAxisSyncer.getRemovedHfIndexes().sort((o,a)=>a-o),s=this.engine.batch(()=>{r.forEach(o=>{this.engine.removeColumns(this.sheetId,[o,1])})});this.renderDependentSheets(s)}function UJ(t,e,n){var i;Ho(Fs,this,!0);const r=this.hot.getSourceDataArray(n,0,n+(((i=e.__children)===null||i===void 0?void 0:i.length)||0),this.hot.countSourceCols());Ho(Fs,this,!1),r.forEach((s,o)=>{s.forEach((a,l)=>{this.engine.setCellContents({col:l,row:n+o,sheet:this.sheetId},[[a]])})})}function YJ(t){this.hot.runHooks("afterFormulasValuesUpdate",t)}function zJ(t,e){this.hot.runHooks("afterNamedExpressionAdded",t,e)}function GJ(t,e){this.hot.runHooks("afterNamedExpressionRemoved",t,e)}function jJ(t){this.hot.runHooks("afterSheetAdded",t)}function KJ(t,e){this.sheetName=e,this.hot.runHooks("afterSheetRenamed",t,e)}function XJ(t,e){this.hot.runHooks("afterSheetRemoved",t,e)}function qJ(t){return{key:"hidden_columns_hide",name(){const e=this.getSelectedLast();let n=0;if(Array.isArray(e)){const[,i,,r]=e;i-r!==0&&(n=1)}return this.getTranslatedPhrase(Gy,n)},callback(){const{from:e,to:n}=this.getSelectedRangeLast(),i=Math.max(Math.min(e.col,n.col),0),r=Math.max(e.col,n.col),s=[];for(let l=i;l<=r;l+=1)s.push(l);t.hideColumns(s);const o=s[s.length-1],a=this.columnIndexMapper.getNearestNotHiddenIndex(o,1,!0);Number.isInteger(a)&&a>=0?this.selectColumns(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())}}}function ZJ(t){const e=[];return{key:"hidden_columns_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(jy,n)},callback(){var n,i;if(e.length===0)return;let r=e[0],s=e[e.length-1];r=(n=this.columnIndexMapper.getNearestNotHiddenIndex(r-1,-1))!==null&&n!==void 0?n:0,s=(i=this.columnIndexMapper.getNearestNotHiddenIndex(s+1,1))!==null&&i!==void 0?i:this.countCols()-1,t.showColumns(e),this.render(),this.view.adjustElementsSize(),s-r+1===this.countCols()||this.selectColumns(r,s)},disabled:!1,hidden(){const n=Ke(t.getHiddenColumns(),h=>this.toPhysicalColumn(h));if(!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())||n.length<1)return!0;e.length=0;const i=this.getSelectedRangeLast(),r=i.getTopStartCorner().col,s=i.getBottomEndCorner().col,o=this.columnIndexMapper,a=o.getRenderableFromVisualIndex(r),l=o.getRenderableFromVisualIndex(s),u=o.getNotTrimmedIndexes(),c=[];if(r!==s){const h=s-r+1,d=l-a+1;if(h>d){const g=u.slice(r,s+1);c.push(...g.filter(p=>n.includes(p)))}}else if(a===0&&a<r)c.push(...u.slice(0,r));else if(a===null)c.push(...u.slice(0,this.countCols()));else{const h=this.countCols()-1,d=o.getRenderableFromVisualIndex(o.getNearestNotHiddenIndex(h,-1));l===d&&h>s&&c.push(...u.slice(s+1))}return M(c,h=>{e.push(this.toVisualColumn(h))}),e.length===0}}}function QJ(t,e){tA(t,e),e.add(t)}function wM(t,e,n){tA(t,e),e.set(t,n)}function tA(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function pi(t,e){return t.get(ho(t,e))}function wc(t,e,n){return t.set(ho(t,e),n),n}function ho(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")}ce.getSingleton().register("beforeHideColumns");ce.getSingleton().register("afterHideColumns");ce.getSingleton().register("beforeUnhideColumns");ce.getSingleton().register("afterUnhideColumns");const Xw="hiddenColumns",JJ=310;var Zr=new WeakMap,Ar=new WeakMap,da=new WeakSet;class eee extends ut{constructor(){super(...arguments),QJ(this,da),wM(this,Zr,{}),wM(this,Ar,null)}static get PLUGIN_KEY(){return Xw}static get PLUGIN_PRIORITY(){return JJ}isEnabled(){return!!this.hot.getSettings()[Xw]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[Xw];ke(n)&&(wc(Zr,this,n),Mt(n.copyPasteEnabled)&&(n.copyPasteEnabled=!0)),wc(Ar,this,new ym),pi(Ar,this).addLocalHook("init",()=>ho(da,this,oee).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,pi(Ar,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return ho(da,e,see).call(e,...r)}),this.addHook("afterGetCellMeta",(i,r,s)=>ho(da,this,nee).call(this,i,r,s)),this.addHook("modifyColWidth",(i,r)=>ho(da,this,tee).call(this,i,r),2),this.addHook("afterGetColHeader",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return ho(da,e,ree).call(e,...r)}),this.addHook("modifyCopyableRange",i=>ho(da,this,iee).call(this,i)),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),wc(Zr,this,{}),super.disablePlugin(),this.resetCellsMeta()}showColumns(e){const n=this.getHiddenColumns(),i=this.isValidConfig(e);let r=n;const s=pi(Ar,this).getValues().slice(),o=e.length>0;if(i&&o){const l=e.map(u=>this.hot.toPhysicalColumn(u));M(l,u=>{s[u]=!1}),r=Hn(s,(u,c,h)=>(c&&u.push(this.hot.toVisualColumn(h)),u),[])}this.hot.runHooks("beforeUnhideColumns",n,r,i&&o)!==!1&&(i&&o&&pi(Ar,this).setValues(s),this.hot.view.adjustElementsSize(),this.hot.runHooks("afterUnhideColumns",n,r,i&&o,i&&r.length<n.length))}showColumn(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];this.showColumns(n)}hideColumns(e){const n=this.getHiddenColumns(),i=this.isValidConfig(e);let r=n;i&&(r=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeHideColumns",n,r,i)!==!1&&(i&&this.hot.batchExecution(()=>{M(e,o=>{pi(Ar,this).setValueAtIndex(this.hot.toPhysicalColumn(o),!0)})},!0),this.hot.runHooks("afterHideColumns",n,r,i,i&&r.length>n.length))}hideColumn(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];this.hideColumns(n)}getHiddenColumns(){return Ke(pi(Ar,this).getHiddenIndexes(),e=>this.hot.toVisualColumn(e))}isHidden(e){return pi(Ar,this).getValueAtIndex(this.hot.toPhysicalColumn(e))||!1}isValidConfig(e){const n=this.hot.countCols();return Array.isArray(e)&&e.length>0?e.every(i=>Number.isInteger(i)&&i>=0&&i<n):!1}resetCellsMeta(){M(this.hot.getCellsMeta(),e=>{e&&(e.skipColumnOnPaste=!1)})}destroy(){wc(Zr,this,null),wc(Ar,this,null),super.destroy()}}function tee(t,e){if(this.isHidden(e))return 0;if(pi(Zr,this).indicators&&(this.isHidden(e+1)||this.isHidden(e-1))&&typeof t=="number"&&this.hot.hasColHeaders())return t+15}function nee(t,e,n){if(pi(Zr,this).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 i=n.className.split(" ");if(i.length>0){const r=i.indexOf("afterHiddenColumn");r>-1&&i.splice(r,1),n.className=i.join(" ")}}}function iee(t){if(pi(Zr,this).copyPasteEnabled)return t;const e=[],n=(i,r,s,o)=>{e.push({startRow:i,endRow:r,startCol:s,endCol:o})};return M(t,i=>{let r=!0,s=0;me(i.startCol,i.endCol,o=>{this.isHidden(o)?(r||n(i.startRow,i.endRow,s,o-1),r=!0):(r&&(s=o),o===i.endCol&&n(i.startRow,i.endRow,s,o),r=!1)})}),e}function ree(t,e){if(!pi(Zr,this).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"),q(e,n)}function see(t){t.items.push({name:Be},qJ(this),ZJ(this))}function oee(){Array.isArray(pi(Zr,this).columns)&&this.hideColumns(pi(Zr,this).columns)}function aee(t){return{key:"hidden_rows_hide",name(){const e=this.getSelectedLast();let n=0;if(Array.isArray(e)){const[i,,r]=e;i-r!==0&&(n=1)}return this.getTranslatedPhrase(Ky,n)},callback(){const{from:e,to:n}=this.getSelectedRangeLast(),i=Math.max(Math.min(e.row,n.row),0),r=Math.max(e.row,n.row),s=[];for(let l=i;l<=r;l+=1)s.push(l);t.hideRows(s);const o=s[s.length-1],a=this.rowIndexMapper.getNearestNotHiddenIndex(o,1,!0);Number.isInteger(a)&&a>=0?this.selectRows(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())}}}function lee(t){const e=[];return{key:"hidden_rows_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(Xy,n)},callback(){var n,i;if(e.length===0)return;let r=e[0],s=e[e.length-1];r=(n=this.rowIndexMapper.getNearestNotHiddenIndex(r-1,-1))!==null&&n!==void 0?n:0,s=(i=this.rowIndexMapper.getNearestNotHiddenIndex(s+1,1))!==null&&i!==void 0?i:this.countRows()-1,t.showRows(e),this.render(),this.view.adjustElementsSize(),s-r+1===this.countRows()||this.selectRows(r,s)},disabled:!1,hidden(){const n=Ke(t.getHiddenRows(),h=>this.toPhysicalRow(h));if(!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())||n.length<1)return!0;e.length=0;const i=this.getSelectedRangeLast(),r=i.getTopStartCorner().row,s=i.getBottomEndCorner().row,o=this.rowIndexMapper,a=o.getRenderableFromVisualIndex(r),l=o.getRenderableFromVisualIndex(s),u=o.getNotTrimmedIndexes(),c=[];if(r!==s){const h=s-r+1,d=l-a+1;if(h>d){const g=u.slice(r,s+1);c.push(...g.filter(p=>n.includes(p)))}}else if(a===0&&a<r)c.push(...u.slice(0,r));else if(a===null)c.push(...u.slice(0,this.countRows()));else{const h=this.countRows()-1,d=o.getRenderableFromVisualIndex(o.getNearestNotHiddenIndex(h,-1));l===d&&h>s&&c.push(...u.slice(s+1))}return M(c,h=>{e.push(this.toVisualRow(h))}),e.length===0}}}function uee(t,e){nA(t,e),e.add(t)}function CM(t,e,n){nA(t,e),e.set(t,n)}function nA(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ni(t,e){return t.get(fo(t,e))}function Cc(t,e,n){return t.set(fo(t,e),n),n}function fo(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")}ce.getSingleton().register("beforeHideRows");ce.getSingleton().register("afterHideRows");ce.getSingleton().register("beforeUnhideRows");ce.getSingleton().register("afterUnhideRows");const qw="hiddenRows",cee=320;var As=new WeakMap,Hr=new WeakMap,fa=new WeakSet;class hee extends ut{constructor(){super(...arguments),uee(this,fa),CM(this,As,{}),CM(this,Hr,null)}static get PLUGIN_KEY(){return qw}static get PLUGIN_PRIORITY(){return cee}isEnabled(){return!!this.hot.getSettings()[qw]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[qw];ke(n)&&(Cc(As,this,n),Mt(n.copyPasteEnabled)&&(n.copyPasteEnabled=!0)),Cc(Hr,this,new ym),Ni(Hr,this).addLocalHook("init",()=>fo(fa,this,wee).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,Ni(Hr,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return fo(fa,e,pee).call(e,...r)}),this.addHook("afterGetCellMeta",(i,r,s)=>fo(fa,this,fee).call(this,i,r,s)),this.addHook("modifyRowHeight",(i,r)=>fo(fa,this,dee).call(this,i,r)),this.addHook("afterGetRowHeader",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return fo(fa,e,mee).call(e,...r)}),this.addHook("modifyCopyableRange",i=>fo(fa,this,gee).call(this,i)),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap(this.pluginName),Cc(As,this,{}),super.disablePlugin(),this.resetCellsMeta()}showRows(e){const n=this.getHiddenRows(),i=this.isValidConfig(e);let r=n;const s=Ni(Hr,this).getValues().slice(),o=e.length>0;if(i&&o){const l=e.map(u=>this.hot.toPhysicalRow(u));M(l,u=>{s[u]=!1}),r=Hn(s,(u,c,h)=>(c&&u.push(this.hot.toVisualRow(h)),u),[])}this.hot.runHooks("beforeUnhideRows",n,r,i&&o)!==!1&&(i&&o&&Ni(Hr,this).setValues(s),this.hot.runHooks("afterUnhideRows",n,r,i&&o,i&&r.length<n.length))}showRow(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];this.showRows(n)}hideRows(e){const n=this.getHiddenRows(),i=this.isValidConfig(e);let r=n;i&&(r=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeHideRows",n,r,i)!==!1&&(i&&this.hot.batchExecution(()=>{M(e,o=>{Ni(Hr,this).setValueAtIndex(this.hot.toPhysicalRow(o),!0)})},!0),this.hot.runHooks("afterHideRows",n,r,i,i&&r.length>n.length))}hideRow(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];this.hideRows(n)}getHiddenRows(){return Ke(Ni(Hr,this).getHiddenIndexes(),e=>this.hot.toVisualRow(e))}isHidden(e){return Ni(Hr,this).getValueAtIndex(this.hot.toPhysicalRow(e))||!1}isValidConfig(e){const n=this.hot.countRows();return Array.isArray(e)&&e.length>0?e.every(i=>Number.isInteger(i)&&i>=0&&i<n):!1}resetCellsMeta(){M(this.hot.getCellsMeta(),e=>{e&&(e.skipRowOnPaste=!1)})}destroy(){Cc(As,this,null),Cc(Hr,this,null),super.destroy()}}function dee(t,e){return this.isHidden(e)?0:t}function fee(t,e,n){if(Ni(As,this).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 i=n.className.split(" ");if(i.length>0){const r=i.indexOf("afterHiddenRow");r>-1&&i.splice(r,1),n.className=i.join(" ")}}}function gee(t){if(Ni(As,this).copyPasteEnabled)return t;const e=[],n=(i,r,s,o)=>{e.push({startRow:i,endRow:r,startCol:s,endCol:o})};return M(t,i=>{let r=!0,s=0;me(i.startRow,i.endRow,o=>{this.isHidden(o)?(r||n(s,o-1,i.startCol,i.endCol),r=!0):(r&&(s=o),o===i.endRow&&n(s,o,i.startCol,i.endCol),r=!1)})}),e}function mee(t,e){if(!Ni(As,this).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"),q(e,n)}function pee(t){t.items.push({name:Be},aee(this),lee(this))}function wee(){Array.isArray(Ni(As,this).rows)&&this.hideRows(Ni(As,this).rows)}function Cee(t){return{key:"freeze_column",name(){return this.getTranslatedPhrase(by)},callback(e,n){const[{start:{col:i}}]=n;t.freezeColumn(i),this.render(),this.view.adjustElementsSize()},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 vee(t){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(Ry)},callback(e,n){const[{start:{col:i}}]=n;t.unfreezeColumn(i),this.render(),this.view.adjustElementsSize()},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 See(t,e){iA(t,e),e.add(t)}function yee(t,e,n){iA(t,e),e.set(t,n)}function iA(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bv(t,e){return t.get(Og(t,e))}function Zw(t,e,n){return t.set(Og(t,e),n),n}function Og(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")}ce.getSingleton().register("beforeColumnFreeze");ce.getSingleton().register("afterColumnFreeze");ce.getSingleton().register("beforeColumnUnfreeze");ce.getSingleton().register("afterColumnUnfreeze");const vM="manualColumnFreeze",bee=110;var ba=new WeakMap,Qw=new WeakSet;class Ree extends ut{constructor(){super(...arguments),See(this,Qw),yee(this,ba,!1)}static get PLUGIN_KEY(){return vM}static get PLUGIN_PRIORITY(){return bee}isEnabled(){return!!this.hot.getSettings()[vM]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>Og(Qw,this,Eee).call(this,e)),this.addHook("beforeColumnMove",(e,n)=>Og(Qw,this,Tee).call(this,e,n)),super.enablePlugin())}disablePlugin(){Zw(ba,this,!1),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}freezeColumn(e){const n=this.hot.getSettings(),i=n.fixedColumnsStart<this.hot.countCols()&&e>n.fixedColumnsStart-1;bv(ba,this)||Zw(ba,this,!0),this.hot.runHooks("beforeColumnFreeze",e,i)!==!1&&(i&&(this.hot.columnIndexMapper.moveIndexes(e,n.fixedColumnsStart),n._fixedColumnsStart+=1),this.hot.runHooks("afterColumnFreeze",e,i))}unfreezeColumn(e){const n=this.hot.getSettings(),i=n.fixedColumnsStart>0&&e<=n.fixedColumnsStart-1;bv(ba,this)||Zw(ba,this,!0),this.hot.runHooks("beforeColumnUnfreeze",e,i)!==!1&&(i&&(n._fixedColumnsStart-=1,this.hot.columnIndexMapper.moveIndexes(e,n.fixedColumnsStart)),this.hot.runHooks("afterColumnUnfreeze",e,i))}}function Eee(t){t.items.push({name:"---------"},Cee(this),vee(this))}function Tee(t,e){if(bv(ba,this)){const n=this.hot.getSettings().fixedColumnsStart;if(e<n||t.some(i=>i<n))return!1}}function hf(t,e,n){return e=Mee(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Mee(t){var e=_ee(t,"string");return typeof e=="symbol"?e:e+""}function _ee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Jw=0,SM=1,yM=2,Ol="px";let rA=class{constructor(e){hf(this,"hot",void 0),hf(this,"_element",null),hf(this,"state",Jw),hf(this,"inlineProperty",void 0),this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}appendTo(e){e.appendChild(this._element),this.state=yM}build(){this.state===Jw&&(this._element=this.hot.rootDocument.createElement("div"),this.state=SM)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=Jw}isAppended(){return this.state===yM}isBuilt(){return this.state>=SM}setPosition(e,n){Bn(e)&&(this._element.style.top=e+Ol),Bn(n)&&(this._element.style[this.inlineProperty]=n+Ol)}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){Bn(e)&&(this._element.style.width=e+Ol),Bn(n)&&(this._element.style.height=n+Ol)}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){Bn(e)&&(this._element.style.marginTop=e+Ol),Bn(n)&&(this._element.style[`margin${mr(this.inlineProperty)}`]=n+Ol)}getOffset(){const e=this._element.style,n=`margin${mr(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[n]?parseInt(e[n],10):0}}};const Iee="ht__manualColumnMove--backlight";let Pee=class extends rA{build(){super.build(),q(this._element,Iee)}};const Oee="ht__manualColumnMove--guideline";let xee=class extends rA{build(){super.build(),q(this._element,Oee)}};function Aee(t,e){sA(t,e),e.add(t)}function Qi(t,e,n){sA(t,e),e.set(t,n)}function sA(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ri(t,e,n){return t.set(go(t,e),n),n}function ge(t,e){return t.get(go(t,e))}function go(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")}ce.getSingleton().register("beforeColumnMove");ce.getSingleton().register("afterColumnMove");const eC="manualColumnMove",Hee=120,bM="ht__manualColumnMove",xg="show-ui",Rv="on-moving--columns",Ev="after-selection--columns";var Vn=new WeakMap,wo=new WeakMap,Hs=new WeakMap,Zf=new WeakMap,Eo=new WeakMap,Fn=new WeakMap,df=new WeakMap,Pi=new WeakMap,Vl=new WeakMap,Ag=new WeakMap,Bc=new WeakMap,ga=new WeakSet;class Nee extends ut{constructor(){super(...arguments),Aee(this,ga),Qi(this,Vn,new Pee(this.hot)),Qi(this,wo,new xee(this.hot)),Qi(this,Hs,[]),Qi(this,Zf,0),Qi(this,Eo,!1),Qi(this,Fn,{}),Qi(this,df,void 0),Qi(this,Pi,void 0),Qi(this,Vl,void 0),Qi(this,Ag,void 0),Qi(this,Bc,void 0)}static get PLUGIN_KEY(){return eC}static get PLUGIN_PRIORITY(){return Hee}isEnabled(){return!!this.hot.getSettings()[eC]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return go(ga,e,Dee).call(e,...i)}),this.addHook("beforeOnCellMouseOver",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return go(ga,e,$ee).call(e,...i)}),this.addHook("afterScrollVertically",()=>go(ga,this,Fee).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return go(ga,e,Vee).call(e,...i)}),this.buildPluginUI(),this.registerEvents(),q(this.hot.rootElement,bM),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){He(this.hot.rootElement,bM),this.unregisterEvents(),ge(Vn,this).destroy(),ge(wo,this).destroy(),super.disablePlugin()}moveColumn(e,n){return this.moveColumns([e],n)}moveColumns(e,n){const i=ge(df,this),r=this.isMovePossible(e,n),s=this.hot.runHooks("beforeColumnMove",e,n,i,r);if(ri(df,this,void 0),s===!1)return;r&&this.hot.columnIndexMapper.moveIndexes(e,n);const o=r&&this.isColumnOrderChanged(e,n);return this.hot.runHooks("afterColumnMove",e,n,i,r,o),o}dragColumn(e,n){return this.dragColumns([e],n)}dragColumns(e,n){const i=this.countFinalIndex(e,n);return ri(df,this,n),this.moveColumns(e,i)}isMovePossible(e,n){const i=this.hot.columnIndexMapper.getNotTrimmedIndexesLength(),r=e.length+n>i,s=n<0,o=e.some(l=>l<0),a=e.some(l=>l>=i);return!(r||s||o||a)}isColumnOrderChanged(e,n){return e.some((i,r)=>i-r!==n)}countFinalIndex(e,n){const i=Hn(e,(r,s)=>(s<n&&(r+=1),r),0);return n-i}getColumnsWidth(e,n){const i=this.hot.columnIndexMapper;let r=0;for(let s=e;s<=n;s+=1){const o=i.getRenderableFromVisualIndex(s);s<0?r+=this.hot.view._wt.wtViewport.getRowHeaderWidth()||0:o!==null&&(r+=this.hot.view._wt.wtTable.getStretchedColumnWidth(o)||0)}return r}moveBySettingsOrLoad(){const e=this.hot.getSettings()[eC];if(Array.isArray(e))this.moveColumns(e,0);else if(e!==void 0){const n=this.persistentStateLoad();n.length&&this.moveColumns(n,0)}}isFixedColumnsStart(e){return e<this.hot.getSettings().fixedColumnsStart}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualColumnMove",this.hot.columnIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualColumnMove",e),e.value?e.value:[]}prepareColumnsToMoving(e,n){const i=[];return me(e,n,r=>{i.push(r)}),i}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(ge(Pi,this))&&e>0&&this.hot.scrollViewportTo({col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(e-1,-1)});const n=this.hot.view._wt.wtTable,i=this.hot.view._wt.wtOverlays.scrollableElement,r=typeof i.scrollX=="number"?i.scrollX:i.scrollLeft;let s=this.hot.view.THEAD.offsetLeft+this.getColumnsWidth(0,ge(Pi,this)-1);const o=n.hider.offsetWidth,a=n.TBODY.offsetLeft,l=ge(Vn,this).getOffset().start,u=ge(Vn,this).getSize().width;let c=0,h=0;if(this.hot.isRtl()){const p=this.hot.rootWindow,C=Ct(this.hot.rootElement),S=p.innerWidth-ge(Vl,this)-C;h=p.innerWidth-ge(Fn,this).eventPageX-S-(i.scrollX===void 0?r:0)}else h=ge(Fn,this).eventPageX-(ge(Vl,this)-(i.scrollX===void 0?r:0));if(ge(Ag,this)&&(c=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(ge(Pi,this))&&(s+=r),s+=c,ge(Pi,this)<0)ge(Bc,this)>0?ge(Fn,this).col=0:ge(Fn,this).col=e>0?e-1:e;else if(ge(Fn,this).TD.offsetWidth/2+s<=h){const p=ge(Pi,this)>=ge(Zf,this)?ge(Zf,this)-1:ge(Pi,this);ge(Fn,this).col=p+1,s+=ge(Fn,this).TD.offsetWidth}else ge(Fn,this).col=ge(Pi,this);let d=h,g=s;h+u+l>=o?d=o-u-l:h+l<a+c&&(d=a+c+Math.abs(l)),s>=o-1?g=o-1:g===0?g=1:i.scrollX!==void 0&&ge(Pi,this)<ge(Bc,this)&&(g-=ge(Vl,this)<=i.scrollX?ge(Vl,this):0),ge(Vn,this).setPosition(null,d),ge(wo,this).setPosition(null,g)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>go(ga,this,Lee).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>go(ga,this,kee).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){ge(Vn,this).build(),ge(wo,this).build()}destroy(){ge(Vn,this).destroy(),ge(wo,this).destroy(),super.destroy()}}function Dee(t,e,n,i){const r=this.hot.view._wt.wtTable,s=this.hot.selection.isSelectedByColumnHeader(),o=this.hot.getSelectedRangeLast(),a=_e(t.target,"sortAction");if(!o||!s||ge(Eo,this)||t.button!==0||a){ri(Eo,this,!1),ge(Hs,this).length=0,He(this.hot.rootElement,[Rv,xg]);return}const l=ge(wo,this).isBuilt()&&!ge(wo,this).isAppended(),u=ge(Vn,this).isBuilt()&&!ge(Vn,this).isAppended();l&&u&&(ge(wo,this).appendTo(r.hider),ge(Vn,this).appendTo(r.hider));const{from:c,to:h}=o,d=Math.min(c.col,h.col),g=Math.max(c.col,h.col);if(e.row<0&&e.col>=d&&e.col<=g){i.column=!0,ri(Eo,this,!0);const p=n.firstChild?_Y(t,n.firstChild).x:t.offsetX;ge(Fn,this).eventPageX=t.pageX,ri(Pi,this,e.col),ge(Fn,this).TD=n,ge(Fn,this).col=e.col,ri(Hs,this,this.prepareColumnsToMoving(d,g)),ri(Ag,this,!!this.hot.getSettings().rowHeaders),ri(Zf,this,this.hot.countCols()),ri(Bc,this,this.hot.getSettings().fixedColumnsStart),ri(Vl,this,pn(this.hot.rootElement).left);const C=ge(Ag,this)?-1:0,S=r.holder.scrollTop+r.getColumnHeaderHeight(0)+1,b=e.col<ge(Bc,this),R=this.hot.view._wt.wtOverlays.inlineStartOverlay.getOverlayOffset(),E=Math.abs(p-(this.hot.isRtl()?n.offsetWidth:0)),H=this.getColumnsWidth(d,e.col-1)+E,P=this.getColumnsWidth(C,d-1)+(b?R:0)+H;ge(Vn,this).setPosition(S,P),ge(Vn,this).setSize(this.getColumnsWidth(d,g),r.hider.offsetHeight-S),ge(Vn,this).setOffset(null,-H),q(this.hot.rootElement,Rv)}else He(this.hot.rootElement,Ev),ri(Eo,this,!1),ge(Hs,this).length=0}function Lee(t){ge(Eo,this)&&(ge(Fn,this).eventPageX=t.pageX,this.refreshPositions())}function $ee(t,e,n,i){!this.hot.getSelectedRangeLast()||!ge(Eo,this)||(ge(Hs,this).indexOf(e.col)>-1?He(this.hot.rootElement,xg):q(this.hot.rootElement,xg),i.row=!0,i.column=!0,i.cell=!0,ri(Pi,this,e.col),ge(Fn,this).TD=n)}function kee(){const t=ge(Fn,this).col,e=ge(Hs,this).length;if(ri(Pi,this,void 0),ri(Eo,this,!1),He(this.hot.rootElement,[Rv,xg,Ev]),this.hot.selection.isSelectedByColumnHeader()&&q(this.hot.rootElement,Ev),e<1||t===void 0)return;const n=ge(Hs,this)[0],i=this.hot.toPhysicalColumn(n),r=this.dragColumns(ge(Hs,this),t);if(ge(Hs,this).length=0,r===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const s=this.hot.toVisualColumn(i),o=s+e-1;this.hot.selectColumns(s,o)}}function Fee(){const t=this.hot.view._wt.wtTable,e=t.getColumnHeaderHeight(0)+1,n=t.holder.scrollTop,i=e+n;ge(Vn,this).setPosition(i),ge(Vn,this).setSize(null,t.hider.offsetHeight-i)}function Vee(){this.moveBySettingsOrLoad()}function Wee(t,e){oA(t,e),e.add(t)}function Tn(t,e,n){oA(t,e),e.set(t,n)}function oA(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Kt(t,e,n){return t.set(or(t,e),n),n}function oe(t,e){return t.get(or(t,e))}function or(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 Hg="manualColumnResize",Bee=130,RM="manualColumnWidths";var Ts=new WeakMap,ff=new WeakMap,fi=new WeakMap,Ng=new WeakMap,Kr=new WeakMap,Uee=new WeakMap,tu=new WeakMap,gf=new WeakMap,Jn=new WeakMap,Ss=new WeakMap,Va=new WeakMap,Dg=new WeakMap,Uc=new WeakMap,Yc=new WeakMap,mi=new WeakMap,zc=new WeakMap,Nr=new WeakSet;class Yee extends ut{static get PLUGIN_KEY(){return Hg}static get PLUGIN_PRIORITY(){return Bee}constructor(e){super(e),Wee(this,Nr),Tn(this,Ts,null),Tn(this,ff,null),Tn(this,fi,[]),Tn(this,Ng,null),Tn(this,Kr,null),Tn(this,Uee,null),Tn(this,tu,null),Tn(this,gf,null),Tn(this,Jn,this.hot.rootDocument.createElement("DIV")),Tn(this,Ss,this.hot.rootDocument.createElement("DIV")),Tn(this,Va,null),Tn(this,Dg,!1),Tn(this,Uc,0),Tn(this,Yc,null),Tn(this,mi,void 0),Tn(this,zc,void 0),q(oe(Jn,this),"manualColumnResizer"),q(oe(Ss,this),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Hg]}enablePlugin(){this.enabled||(Kt(mi,this,new $o),oe(mi,this).addLocalHook("init",()=>or(Nr,this,zee).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,oe(mi,this)),this.addHook("modifyColWidth",(e,n)=>or(Nr,this,Zee).call(this,e,n),1),this.addHook("beforeStretchingColumnWidth",(e,n)=>or(Nr,this,Qee).call(this,e,n)),this.addHook("beforeColumnResize",(e,n,i)=>or(Nr,this,Jee).call(this,e,n,i)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){Kt(zc,this,oe(mi,this).getValues()),this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualColumnWidths(){this.hot.runHooks("persistentStateSave",RM,oe(mi,this).getValues())}loadManualColumnWidths(){const e={};return this.hot.runHooks("persistentStateLoad",RM,e),e.value}setManualSize(e,n){const i=Math.max(n,20),r=this.hot.toPhysicalColumn(e);return oe(mi,this).setValueAtIndex(r,i),i}clearManualSize(e){const n=this.hot.toPhysicalColumn(e);oe(mi,this).setValueAtIndex(n,null)}setupHandlePosition(e){if(!e.parentNode)return;Kt(Ts,this,e);const{_wt:n}=this.hot.view,i=n.wtTable.getCoords(oe(Ts,this)),r=i.col;if(r<0)return;const s=Yt(oe(Ts,this)),o=oe(Ts,this).getBoundingClientRect(),a=r<n.getSetting("fixedColumnsStart");let l;a&&(l=n.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(oe(Ts,this),i.row,i.col)),l||(l=n.wtOverlays.topOverlay.getRelativeCellPosition(oe(Ts,this),i.row,i.col)),Kt(ff,this,this.hot.columnIndexMapper.getVisualFromRenderableIndex(r)),Kt(fi,this,[]);const u=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByColumnHeader();if(this.hot.selection.isSelected()&&u){const c=this.hot.getSelectedRange();M(c,h=>{const d=h.getTopStartCorner().col,g=h.getBottomEndCorner().col;me(d,g,p=>{oe(fi,this).includes(p)||oe(fi,this).push(p)})})}oe(fi,this).includes(oe(ff,this))||Kt(fi,this,[oe(ff,this)]),Kt(gf,this,l.start-6),Kt(tu,this,parseInt(o.width,10)),oe(Jn,this).style.top=`${l.top}px`,oe(Jn,this).style[this.inlineDir]=`${oe(gf,this)+oe(tu,this)}px`,oe(Jn,this).style.height=`${s}px`,this.hot.rootElement.appendChild(oe(Jn,this))}refreshHandlePosition(){oe(Jn,this).style[this.inlineDir]=`${oe(gf,this)+oe(Ng,this)}px`}setupGuidePosition(){const e=parseInt(Yt(oe(Jn,this)),10),n=parseInt(oe(Jn,this).style.top,10)+e,i=parseInt(this.hot.view.maximumVisibleElementHeight(0),10);q(oe(Jn,this),"active"),q(oe(Ss,this),"active"),oe(Ss,this).style.top=`${n}px`,this.refreshGuidePosition(),oe(Ss,this).style.height=`${i-e}px`,this.hot.rootElement.appendChild(oe(Ss,this))}refreshGuidePosition(){oe(Ss,this).style[this.inlineDir]=oe(Jn,this).style[this.inlineDir]}hideHandleAndGuide(){He(oe(Jn,this),"active"),He(oe(Ss,this),"active")}checkIfColumnHeader(e){const n=Aa(e,["THEAD"],this.hot.rootElement),{topOverlay:i,topInlineStartCornerOverlay:r}=this.hot.view._wt.wtOverlays;return[i.clone.wtTable.THEAD,r.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.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize()},n=(i,r)=>{const s=this.hot.runHooks("beforeColumnResize",oe(Kr,this),i,!0);s!==void 0&&Kt(Kr,this,s),this.hot.getSettings().stretchH==="all"?this.clearManualSize(i):this.setManualSize(i,oe(Kr,this)),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",oe(Kr,this),i,!0),r&&e()};oe(Uc,this)>=2&&(oe(fi,this).length>1?(M(oe(fi,this),r=>{n(r)}),e()):M(oe(fi,this),r=>{n(r,!0)})),Kt(Uc,this,0),Kt(Yc,this,null)}bindEvents(){const{rootWindow:e,rootElement:n}=this.hot;this.eventManager.addEventListener(n,"mouseover",i=>or(Nr,this,Gee).call(this,i)),this.eventManager.addEventListener(n,"mousedown",i=>or(Nr,this,jee).call(this,i)),this.eventManager.addEventListener(e,"mousemove",i=>or(Nr,this,Kee).call(this,i)),this.eventManager.addEventListener(e,"mouseup",()=>or(Nr,this,Xee).call(this)),this.eventManager.addEventListener(oe(Jn,this),"contextmenu",()=>or(Nr,this,qee).call(this))}destroy(){super.destroy()}}function zee(){const t=this.hot.getSettings()[Hg],e=this.loadManualColumnWidths();typeof e<"u"?this.hot.batchExecution(()=>{e.forEach((n,i)=>{oe(mi,this).setValueAtIndex(i,n)})},!0):Array.isArray(t)?(this.hot.batchExecution(()=>{t.forEach((n,i)=>{oe(mi,this).setValueAtIndex(i,n)})},!0),Kt(zc,this,t)):t===!0&&Array.isArray(oe(zc,this))&&this.hot.batchExecution(()=>{oe(zc,this).forEach((n,i)=>{oe(mi,this).setValueAtIndex(i,n)})},!0)}function Gee(t){if(!oP(t.target)&&oe(Dg,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")&&(oe(Va,this)||this.setupHandlePosition(e))}}function jee(t){t.target.parentNode===this.hot.rootElement&&_e(t.target,"manualColumnResizer")&&(this.setupHandlePosition(oe(Ts,this)),this.setupGuidePosition(),Kt(Va,this,!0),oe(Yc,this)===null&&(Kt(Yc,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(oe(Yc,this))),Kt(Uc,this,oe(Uc,this)+1),this.startX=t.pageX,Kt(Kr,this,oe(tu,this)))}function Kee(t){if(oe(Va,this)){const e=(t.pageX-this.startX)*this.hot.getDirectionFactor();Kt(Ng,this,oe(tu,this)+e),M(oe(fi,this),n=>{Kt(Kr,this,this.setManualSize(n,oe(Ng,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function Xee(){const t=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize()},e=(n,i)=>{this.hot.runHooks("beforeColumnResize",oe(Kr,this),n,!1),i&&t(),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",oe(Kr,this),n,!1)};oe(Va,this)&&(this.hideHandleAndGuide(),Kt(Va,this,!1),oe(Kr,this)!==oe(tu,this)&&(oe(fi,this).length>1?(M(oe(fi,this),i=>{e(i)}),t()):M(oe(fi,this),i=>{e(i,!0)})),this.setupHandlePosition(oe(Ts,this)))}function qee(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(oe(Jn,this)),this.hot.rootElement.removeChild(oe(Ss,this)),Kt(Va,this,!1),Kt(Dg,this,!0),this.hot._registerImmediate(()=>{Kt(Dg,this,!1)})}function Zee(t,e){let n=t;if(this.enabled){const i=this.hot.toPhysicalColumn(e),r=oe(mi,this).getValueAtIndex(i);this.hot.getSettings()[Hg]&&r&&(n=r)}return n}function Qee(t,e){let n=oe(mi,this).getValueAtIndex(e);return n===null&&(n=t),n}function Jee(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}function tC(t,e,n){return e=ete(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ete(t){var e=tte(t,"string");return typeof e=="symbol"?e:e+""}function tte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const nC=0,EM=1,TM=2,xl="px";let aA=class{constructor(e){tC(this,"hot",void 0),tC(this,"_element",null),tC(this,"state",nC),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=TM}build(){this.state===nC&&(this._element=this.hot.rootDocument.createElement("div"),this.state=EM)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=nC}isAppended(){return this.state===TM}isBuilt(){return this.state>=EM}setPosition(e,n){e!==void 0&&(this._element.style.top=e+xl),n!==void 0&&(this._element.style.left=n+xl)}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+xl),n&&(this._element.style.height=n+xl)}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+xl),n&&(this._element.style.marginLeft=n+xl)}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 nte="ht__manualRowMove--backlight";class ite extends aA{build(){super.build(),q(this._element,nte)}}const rte="ht__manualRowMove--guideline";class ste extends aA{build(){super.build(),q(this._element,rte)}}function ote(t,e){lA(t,e),e.add(t)}function Al(t,e,n){lA(t,e),e.set(t,n)}function lA(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ia(t,e,n){return t.set(mo(t,e),n),n}function Ae(t,e){return t.get(mo(t,e))}function mo(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")}ce.getSingleton().register("beforeRowMove");ce.getSingleton().register("afterRowMove");const iC="manualRowMove",ate=140,MM="ht__manualRowMove",Lg="show-ui",Tv="on-moving--rows",Mv="after-selection--rows";var Wn=new WeakMap,Co=new WeakMap,Ns=new WeakMap,To=new WeakMap,si=new WeakMap,mf=new WeakMap,ma=new WeakSet;class lte extends ut{constructor(){super(...arguments),ote(this,ma),Al(this,Wn,new ite(this.hot)),Al(this,Co,new ste(this.hot)),Al(this,Ns,[]),Al(this,To,void 0),Al(this,si,{}),Al(this,mf,void 0)}static get PLUGIN_KEY(){return iC}static get PLUGIN_PRIORITY(){return ate}isEnabled(){return!!this.hot.getSettings()[iC]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return mo(ma,e,ute).call(e,...i)}),this.addHook("beforeOnCellMouseOver",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return mo(ma,e,hte).call(e,...i)}),this.addHook("afterScrollHorizontally",()=>mo(ma,this,fte).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return mo(ma,e,gte).call(e,...i)}),this.buildPluginUI(),this.registerEvents(),q(this.hot.rootElement,MM),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){He(this.hot.rootElement,MM),this.unregisterEvents(),Ae(Wn,this).destroy(),Ae(Co,this).destroy(),super.disablePlugin()}moveRow(e,n){return this.moveRows([e],n)}moveRows(e,n){const i=Ae(mf,this),r=this.isMovePossible(e,n),s=this.hot.runHooks("beforeRowMove",e,n,i,r);if(Ia(mf,this,void 0),s===!1)return;r&&this.hot.rowIndexMapper.moveIndexes(e,n);const o=r&&this.isRowOrderChanged(e,n);return this.hot.runHooks("afterRowMove",e,n,i,r,o),o}dragRow(e,n){return this.dragRows([e],n)}dragRows(e,n){const i=this.countFinalIndex(e,n);return Ia(mf,this,n),this.moveRows(e,i)}isMovePossible(e,n){const i=this.hot.rowIndexMapper.getNotTrimmedIndexesLength(),r=e.length+n>i,s=n<0,o=e.some(l=>l<0),a=e.some(l=>l>=i);return!(r||s||o||a)}isRowOrderChanged(e,n){return e.some((i,r)=>i-r!==n)}countFinalIndex(e,n){const i=Hn(e,(r,s)=>(s<n&&(r+=1),r),0);return n-i}getRowsHeight(e,n){const i=this.hot.rowIndexMapper;let r=0;for(let s=e;s<=n;s++){const o=i.getRenderableFromVisualIndex(s);o!==null&&(r+=this.hot.view._wt.wtTable.getRowHeight(o)||23)}return r}moveBySettingsOrLoad(){const e=this.hot.getSettings()[iC];if(Array.isArray(e))this.moveRows(e,0);else if(e!==void 0){const n=this.persistentStateLoad();n.length&&this.moveRows(n,0)}}isFixedRowTop(e){return e<this.hot.getSettings().fixedRowsTop}isFixedRowBottom(e){return e>this.hot.countRows()-1-this.hot.getSettings().fixedRowsBottom}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualRowMove",this.hot.rowIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualRowMove",e),e.value?e.value:[]}prepareRowsToMoving(){const e=this.hot.getSelectedRangeLast(),n=[];if(!e)return n;const{from:i,to:r}=e,s=Math.min(i.row,r.row),o=Math.max(i.row,r.row);return me(s,o,a=>{n.push(a)}),n}refreshPositions(){const e=Ae(si,this).coords,n=this.hot.view.getFirstFullyVisibleRow(),i=this.hot.view.getLastFullyVisibleRow(),r=this.hot.countRows();this.isFixedRowTop(e.row)&&n>0&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(n-1,-1)),this.isFixedRowBottom(e.row)&&i<r&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(i+1,1),void 0,!0);const s=this.hot.view._wt.wtTable,o=Ae(si,this).TD,a=this.hot.rootElement,l=pn(a),u=ru(a),c=s.holder.scrollTop,h=this.hot.rootWindow!==u?u.scrollTop:0,d=l.top-h,g=Ae(si,this).eventPageY-d+c,p=s.hider.offsetHeight,C=s.TBODY.offsetTop,S=Ae(Wn,this).getOffset().top,b=Ae(Wn,this).getSize().height,R=o.offsetHeight/2,E=o.offsetHeight;let H=this.hot.view.THEAD.offsetHeight+this.getRowsHeight(0,e.row-1);const P=g>=H+R;this.isFixedRowTop(e.row)&&(H+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?Ae(si,this).row=n>0?n-1:n:P?(Ae(si,this).row=e.row+1,H+=e.row===0?E-1:E):Ae(si,this).row=e.row;let B=g,Y=H;g+b+S>=p?B=p-b-S:g+S<C&&(B=C+Math.abs(S)),H>=p-1&&(Y=p-1),Ae(Wn,this).setPosition(B),Ae(Co,this).setPosition(Y)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>mo(ma,this,cte).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>mo(ma,this,dte).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){Ae(Wn,this).build(),Ae(Co,this).build()}destroy(){Ae(Wn,this).destroy(),Ae(Co,this).destroy(),super.destroy()}}function ute(t,e,n,i){const{wtTable:r,wtViewport:s}=this.hot.view._wt,o=this.hot.selection.isSelectedByRowHeader(),a=this.hot.getSelectedRangeLast();if(!a||!o||Ae(To,this)||t.button!==0){Ia(To,this,!1),Ae(Ns,this).length=0,He(this.hot.rootElement,[Tv,Lg]);return}const l=Ae(Co,this).isBuilt()&&!Ae(Co,this).isAppended(),u=Ae(Wn,this).isBuilt()&&!Ae(Wn,this).isAppended();l&&u&&(Ae(Co,this).appendTo(r.hider),Ae(Wn,this).appendTo(r.hider));const{from:c,to:h}=a,d=Math.min(c.row,h.row),g=Math.max(c.row,h.row);if(e.col<0&&e.row>=d&&e.row<=g){i.row=!0,Ia(To,this,!0),Ae(si,this).eventPageY=t.pageY,Ae(si,this).coords=e,Ae(si,this).TD=n,Ia(Ns,this,this.prepareRowsToMoving());const p=r.holder.scrollLeft+s.getRowHeaderWidth(),C=this.getRowsHeight(d,e.row-1)+t.offsetY;Ae(Wn,this).setPosition(null,p),Ae(Wn,this).setSize(r.hider.offsetWidth-p,this.getRowsHeight(d,g)),Ae(Wn,this).setOffset(-C,null),q(this.hot.rootElement,Tv),this.refreshPositions()}else He(this.hot.rootElement,Mv),Ia(To,this,!1),Ae(Ns,this).length=0}function cte(t){Ae(To,this)&&(Ae(si,this).eventPageY=t.pageY,this.refreshPositions())}function hte(t,e,n,i){!this.hot.getSelectedRangeLast()||!Ae(To,this)||(Ae(Ns,this).indexOf(e.row)>-1?He(this.hot.rootElement,Lg):q(this.hot.rootElement,Lg),i.row=!0,i.column=!0,i.cell=!0,Ae(si,this).coords=e,Ae(si,this).TD=n)}function dte(){const t=Ae(si,this).row,e=Ae(Ns,this).length;if(Ia(To,this,!1),He(this.hot.rootElement,[Tv,Lg,Mv]),this.hot.selection.isSelectedByRowHeader()&&q(this.hot.rootElement,Mv),e<1||t===void 0)return;const n=Ae(Ns,this)[0],i=this.hot.toPhysicalRow(n),r=this.dragRows(Ae(Ns,this),t);if(Ae(Ns,this).length=0,r===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const s=this.hot.toVisualRow(i),o=s+e-1;this.hot.selectRows(s,o)}}function fte(){const t=this.hot.view._wt.wtTable,e=this.hot.view._wt.wtViewport.getRowHeaderWidth(),n=t.holder.scrollLeft,i=e+n;Ae(Wn,this).setPosition(null,i),Ae(Wn,this).setSize(t.hider.offsetWidth-i)}function gte(){this.moveBySettingsOrLoad()}function mte(t,e){uA(t,e),e.add(t)}function Mn(t,e,n){uA(t,e),e.set(t,n)}function uA(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vt(t,e,n){return t.set(Ms(t,e),n),n}function se(t,e){return t.get(Ms(t,e))}function Ms(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 $g="manualRowResize",pte=30,_M="manualRowHeights";var Br=new WeakMap,pf=new WeakMap,gi=new WeakMap,Gc=new WeakMap,vo=new WeakMap,oR=new WeakMap,nu=new WeakMap,wf=new WeakMap,$n=new WeakMap,Wr=new WeakMap,Wa=new WeakMap,kg=new WeakMap,jc=new WeakMap,Kc=new WeakMap,ar=new WeakMap,Xc=new WeakMap,oo=new WeakSet;class wte extends ut{static get PLUGIN_KEY(){return $g}static get PLUGIN_PRIORITY(){return pte}constructor(e){super(e),mte(this,oo),Mn(this,Br,null),Mn(this,pf,null),Mn(this,gi,[]),Mn(this,Gc,null),Mn(this,vo,null),Mn(this,oR,null),Mn(this,nu,null),Mn(this,wf,null),Mn(this,$n,this.hot.rootDocument.createElement("DIV")),Mn(this,Wr,this.hot.rootDocument.createElement("DIV")),Mn(this,Wa,!1),Mn(this,kg,!1),Mn(this,jc,0),Mn(this,Kc,null),Mn(this,ar,void 0),Mn(this,Xc,void 0),q(se($n,this),"manualRowResizer"),q(se(Wr,this),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[$g]}enablePlugin(){this.enabled||(Vt(ar,this,new $o),se(ar,this).addLocalHook("init",()=>Ms(oo,this,Ete).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,se(ar,this)),this.addHook("modifyRowHeight",(e,n)=>Ms(oo,this,Rte).call(this,e,n)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){Vt(Xc,this,se(ar,this).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualRowHeights(){this.hot.runHooks("persistentStateSave",_M,se(ar,this).getValues())}loadManualRowHeights(){const e={};return this.hot.runHooks("persistentStateLoad",_M,e),e.value}setManualSize(e,n){const i=this.hot.toPhysicalRow(e),r=Math.max(n,Cm.DEFAULT_HEIGHT);return se(ar,this).setValueAtIndex(i,r),r}getLastDesiredRowHeight(){return se(Gc,this)}setupHandlePosition(e){Vt(Br,this,e);const{view:n}=this.hot,{_wt:i}=n,r=i.wtTable.getCoords(se(Br,this)),s=r.row;if(s<0)return;const o=Ct(se(Br,this)),a=se(Br,this).getBoundingClientRect(),l=s<i.getSetting("fixedRowsTop"),u=s>=n.countNotHiddenRowIndexes(0,1)-i.getSetting("fixedRowsBottom");let c;l?c=i.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(se(Br,this),r.row,r.col):u&&(c=i.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(se(Br,this),r.row,r.col)),c||(c=i.wtOverlays.inlineStartOverlay.getRelativeCellPosition(se(Br,this),r.row,r.col)),Vt(pf,this,this.hot.rowIndexMapper.getVisualFromRenderableIndex(s)),Vt(gi,this,[]);const h=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&h){const d=this.hot.getSelectedRange();M(d,g=>{const p=g.getTopStartCorner().row,C=g.getBottomStartCorner().row;me(p,C,S=>{se(gi,this).includes(S)||se(gi,this).push(S)})})}se(gi,this).includes(se(pf,this))||Vt(gi,this,[se(pf,this)]),Vt(wf,this,c.top-6),Vt(nu,this,parseInt(a.height,10)),se($n,this).style.top=`${se(wf,this)+se(nu,this)}px`,se($n,this).style[this.inlineDir]=`${c.start}px`,se($n,this).style.width=`${o}px`,this.hot.rootElement.appendChild(se($n,this))}refreshHandlePosition(){se($n,this).style.top=`${se(wf,this)+se(Gc,this)}px`}setupGuidePosition(){const e=parseInt(Ct(se($n,this)),10),n=parseInt(se($n,this).style[this.inlineDir],10)+e,i=parseInt(this.hot.view.maximumVisibleElementWidth(0),10);q(se($n,this),"active"),q(se(Wr,this),"active"),se(Wr,this).style.top=se($n,this).style.top,se(Wr,this).style[this.inlineDir]=`${n}px`,se(Wr,this).style.width=`${i-e}px`,this.hot.rootElement.appendChild(se(Wr,this))}refreshGuidePosition(){se(Wr,this).style.top=se($n,this).style.top}hideHandleAndGuide(){He(se($n,this),"active"),He(se(Wr,this),"active")}checkIfRowHeader(e){const n=Aa(e,["TBODY"],this.hot.rootElement),{inlineStartOverlay:i,topInlineStartCornerOverlay:r,bottomInlineStartCornerOverlay:s}=this.hot.view._wt.wtOverlays;return[i.clone.wtTable.TBODY,r.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&&se(vo,this)<n?n:se(vo,this)}afterMouseDownTimeout(){const e=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize()},n=(i,r)=>{const s=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(i),i,!0);s!==void 0&&Vt(vo,this,s),this.setManualSize(i,se(vo,this)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(i),i,!0),r&&e()};se(jc,this)>=2&&(se(gi,this).length>1?(M(se(gi,this),r=>{n(r)}),e()):M(se(gi,this),r=>{n(r,!0)})),Vt(jc,this,0),Vt(Kc,this,null)}bindEvents(){const{rootElement:e,rootWindow:n}=this.hot;this.eventManager.addEventListener(e,"mouseover",i=>Ms(oo,this,Cte).call(this,i)),this.eventManager.addEventListener(e,"mousedown",i=>Ms(oo,this,vte).call(this,i)),this.eventManager.addEventListener(n,"mousemove",i=>Ms(oo,this,Ste).call(this,i)),this.eventManager.addEventListener(n,"mouseup",()=>Ms(oo,this,yte).call(this)),this.eventManager.addEventListener(se($n,this),"contextmenu",()=>Ms(oo,this,bte).call(this))}destroy(){super.destroy()}}function Cte(t){if(!oP(t.target)&&se(kg,this)!==!0&&this.checkIfRowHeader(t.target)){const e=this.getClosestTHParent(t.target);e&&(se(Wa,this)||this.setupHandlePosition(e))}}function vte(t){_e(t.target,"manualRowResizer")&&(this.setupHandlePosition(se(Br,this)),this.setupGuidePosition(),Vt(Wa,this,!0),se(Kc,this)===null&&(Vt(Kc,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(se(Kc,this))),Vt(jc,this,se(jc,this)+1),Vt(oR,this,t.pageY),Vt(vo,this,se(nu,this)))}function Ste(t){se(Wa,this)&&(Vt(Gc,this,se(nu,this)+(t.pageY-se(oR,this))),M(se(gi,this),e=>{Vt(vo,this,this.setManualSize(e,se(Gc,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition())}function yte(){const t=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize()},e=(n,i)=>{this.hot.runHooks("beforeRowResize",this.getActualRowHeight(n),n,!1),i&&t(),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.getActualRowHeight(n),n,!1)};se(Wa,this)&&(this.hideHandleAndGuide(),Vt(Wa,this,!1),se(vo,this)!==se(nu,this)&&(se(gi,this).length>1?(M(se(gi,this),i=>{e(i)}),t()):M(se(gi,this),i=>{e(i,!0)})),this.setupHandlePosition(se(Br,this)))}function bte(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(se($n,this)),this.hot.rootElement.removeChild(se(Wr,this)),Vt(Wa,this,!1),Vt(kg,this,!0),this.hot._registerImmediate(()=>{Vt(kg,this,!1)})}function Rte(t,e){let n=t;if(this.enabled){const i=this.hot.toPhysicalRow(e),r=se(ar,this).getValueAtIndex(i);this.hot.getSettings()[$g]&&r&&(n=r)}return n}function Ete(){const t=this.hot.getSettings()[$g],e=this.loadManualRowHeights();this.hot.batchExecution(()=>{typeof e<"u"?e.forEach((n,i)=>{se(ar,this).setValueAtIndex(i,n)}):Array.isArray(t)?(t.forEach((n,i)=>{se(ar,this).setValueAtIndex(i,n)}),Vt(Xc,this,t)):t===!0&&Array.isArray(se(Xc,this))&&se(Xc,this).forEach((n,i)=>{se(ar,this).setValueAtIndex(i,n)})},!0)}function pa(t,e,n){return e=Tte(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tte(t){var e=Mte(t,"string");return typeof e=="symbol"?e:e+""}function Mte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Ur{constructor(e,n,i,r,s,o){pa(this,"row",void 0),pa(this,"col",void 0),pa(this,"rowspan",void 0),pa(this,"colspan",void 0),pa(this,"removed",!1),pa(this,"cellCoordsFactory",void 0),pa(this,"cellRangeFactory",void 0),this.row=e,this.col=n,this.rowspan=i,this.colspan=r,this.cellCoordsFactory=s,this.cellRangeFactory=o}static NEGATIVE_VALUES_WARNING(e){return ct`The merged cell declared with {row: ${e.row}, col: ${e.col},\x20
|
|
rowspan: ${e.rowspan}, colspan: ${e.colspan}} contains negative values, which is\x20
|
|
not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING(e){return ct`The merged cell declared at [${e.row}, ${e.col}] 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){return ct`The merged cell declared at [${e.row}, ${e.col}] 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){return ct`The merged cell declared at [${e.row}, ${e.col}] has "rowspan"\x20
|
|
or "colspan" declared as "0", which is not supported. It cannot be added to the collection.`}static containsNegativeValues(e){return e.row<0||e.col<0||e.rowspan<0||e.colspan<0}static isSingleCell(e){return e.colspan===1&&e.rowspan===1}static containsZeroSpan(e){return e.colspan===0||e.rowspan===0}static isOutOfBounds(e,n,i){return e.row<0||e.col<0||e.row>=n||e.row+e.rowspan-1>=n||e.col>=i||e.col+e.colspan-1>=i}normalize(e){const n=e.countRows(),i=e.countCols();this.row<0?this.row=0:this.row>n-1&&(this.row=n-1),this.col<0?this.col=0:this.col>i-1&&(this.col=i-1),this.row+this.rowspan>n-1&&(this.rowspan=n-this.row),this.col+this.colspan>i-1&&(this.colspan=i-this.col)}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 i=e[0]||e[1],r=n+Math.abs(e[0]||e[1])-1,s=e[0]?"colspan":"rowspan",o=e[0]?"col":"row",a=Math.min(n,r),l=Math.max(n,r),u=this[o],c=this[o]+this[s]-1;if(u>=n&&(this[o]+=i),i>0)n<=c&&n>u&&(this[s]+=i);else if(i<0){if(a<=u&&l>=c)return this.removed=!0,!1;if(u>=a&&u<=l){const h=l-u+1,d=Math.abs(i)-h;this[o]-=d+i,this[s]-=h}else if(u<=a&&c>=l)this[s]+=i;else if(u<=a&&c>=a&&c<l){const h=c-a+1;this[s]-=h}}return!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 this.cellRangeFactory(this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.getLastRow(),this.getLastColumn()))}}function _v(t,e,n,i){e?e.row===n&&e.col===i?(t.setAttribute("rowspan",e.rowspan.toString()),t.setAttribute("colspan",e.colspan.toString())):(t.removeAttribute("rowspan"),t.removeAttribute("colspan"),t.style.display="none"):(t.removeAttribute("rowspan"),t.removeAttribute("colspan"),t.style.display="")}function _te(t,e){Ite(t,e),e.add(t)}function Ite(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rC(t,e,n){return e=Pte(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pte(t){var e=Ote(t,"string");return typeof e=="symbol"?e:e+""}function Ote(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Cf(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 vc=new WeakSet;class aR{constructor(e){_te(this,vc),rC(this,"plugin",void 0),rC(this,"mergedCells",[]),rC(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){return ct`The merged cell declared at [${e.row}, ${e.col}], 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){const i=this.mergedCells;let r=!1;return M(i,s=>s.row<=e&&s.row+s.rowspan-1>=e&&s.col<=n&&s.col+s.colspan-1>=n?(r=s,!1):!0),r}getByRange(e){const n=this.mergedCells;let i=!1;return M(n,r=>r.row<=e.from.row&&r.row+r.rowspan-1>=e.to.row&&r.col<=e.from.col&&r.col+r.colspan-1>=e.to.col?(i=r,i):!0),i}getWithinRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.mergedCells,r=[];let s=e;if(!s.includesRange){const o=this.hot._createCellCoords(s.from.row,s.from.col),a=this.hot._createCellCoords(s.to.row,s.to.col);s=this.hot._createCellRange(o,o,a)}return M(i,o=>{const a=this.hot._createCellCoords(o.row,o.col),l=this.hot._createCellCoords(o.row+o.rowspan-1,o.col+o.colspan-1),u=this.hot._createCellRange(a,a,l);n?s.overlaps(u)&&r.push(o):s.includesRange(u)&&r.push(o)}),r.length?r:!1}add(e){const n=this.mergedCells,i=e.row,r=e.col,s=e.rowspan,o=e.colspan,a=new Ur(i,r,s,o,this.hot._createCellCoords,this.hot._createCellRange),l=this.get(i,r),u=this.isOverlapping(a);return!l&&!u?(this.hot&&a.normalize(this.hot),n.push(a),a):(vt(aR.IS_OVERLAPPING_WARNING(a)),!1)}remove(e,n){const i=this.mergedCells,r=this.get(e,n),s=r?this.mergedCells.indexOf(r):-1;return r&&s!==-1?(i.splice(s,1),r):!1}clear(){const e=this.mergedCells,n=[],i=[];M(e,r=>{const s=this.hot.getCell(r.row,r.col);s&&n.push([s,this.get(r.row,r.col),r.row,r.col])}),this.mergedCells.length=0,M(n,(r,s)=>{me(0,r.rowspan-1,o=>{me(0,r.colspan-1,a=>{if(a!==0||o!==0){const l=this.hot.getCell(r.row+o,r.col+a);l&&i.push([l,null,null,null])}})}),n[s][1]=null}),M(n,r=>{_v(...r)}),M(i,r=>{_v(...r)})}isOverlapping(e){const n=this.hot._createCellRange(this.hot._createCellCoords(0,0),this.hot._createCellCoords(e.row,e.col),this.hot._createCellCoords(e.row+e.rowspan-1,e.col+e.colspan-1));let i=!1;return M(this.mergedCells,r=>this.hot._createCellRange(this.hot._createCellCoords(0,0),this.hot._createCellCoords(r.row,r.col),this.hot._createCellCoords(r.row+r.rowspan-1,r.col+r.colspan-1)).overlaps(n)?(i=!0,!1):!0),i}isFirstRenderableMergedCell(e,n){const i=this.get(e,n);return i&&this.hot.rowIndexMapper.getNearestNotHiddenIndex(i.row,1)===e&&this.hot.columnIndexMapper.getNearestNotHiddenIndex(i.col,1)===n}getFirstRenderableCoords(e,n){const i=this.get(e,n);if(!i||this.isFirstRenderableMergedCell(e,n))return this.hot._createCellCoords(e,n);const r=this.hot.rowIndexMapper.getNearestNotHiddenIndex(i.row,1),s=this.hot.columnIndexMapper.getNearestNotHiddenIndex(i.col,1);return this.hot._createCellCoords(r,s)}getStartMostColumnIndex(e,n){const i=Cf(vc,this,vf).call(this,e,"col",-1);let r=n;for(let s=0;s<i.length;s++)if(i[s]<=n){r=i[s];break}return r}getEndMostColumnIndex(e,n){const i=Cf(vc,this,vf).call(this,e,"col",1);let r=n;for(let s=0;s<i.length;s++)if(i[s]>=n){r=i[s];break}return r}getTopMostRowIndex(e,n){const i=Cf(vc,this,vf).call(this,e,"row",-1);let r=n;for(let s=0;s<i.length;s++)if(i[s]<=n){r=i[s];break}return r}getBottomMostRowIndex(e,n){const i=Cf(vc,this,vf).call(this,e,"row",1);let r=n;for(let s=0;s<i.length;s++)if(i[s]>=n){r=i[s];break}return r}shiftCollections(e,n,i){const r=[0,0];switch(e){case"right":r[0]+=i;break;case"left":r[0]-=i;break;case"down":r[1]+=i;break;case"up":r[1]-=i;break}M(this.mergedCells,s=>{s.shift(r,n)}),qC(this.mergedCells.length-1,0,s=>{const o=this.mergedCells[s];o&&o.removed&&this.mergedCells.splice(this.mergedCells.indexOf(o),1)})}}function vf(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const i=new Map,r=n===1?t.getTopStartCorner():t.getBottomEndCorner(),s=n===1?t.getBottomEndCorner():t.getTopStartCorner();for(let o=r.row;n===1?o<=s.row:o>=s.row;o+=n)for(let a=r.col;n===1?a<=s.col:a>=s.col;a+=n){const l=e==="row"?o:a,u=this.get(o,a);let c=l;u&&(c=n===1?u[e]+u[`${e}span`]-1:u[e]),i.has(l)||i.set(l,new Set),i.get(l).add(c)}return Array.from(new Set(Array.from(i.entries()).filter(o=>{let[,a]=o;return a.size===1}).flatMap(o=>{let[,a]=o;return Array.from(a)})))}function sC(t,e,n){return e=xte(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xte(t){var e=Ate(t,"string");return typeof e=="symbol"?e:e+""}function Ate(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Hte{constructor(e){sC(this,"plugin",void 0),sC(this,"mergedCellsCollection",void 0),sC(this,"currentFillData",null),this.plugin=e,this.mergedCellsCollection=this.plugin.mergedCellsCollection}correctSelectionAreaSize(e){if(e[0]===e[2]&&e[1]===e[3]){const n=this.mergedCellsCollection.get(e[0],e[1]);n&&(e[2]=e[0]+n.rowspan-1,e[3]=e[1]+n.colspan-1)}}getDirection(e,n){let i=null;return n[0]===e[0]&&n[1]===e[1]&&n[3]===e[3]?i="down":n[2]===e[2]&&n[1]===e[1]&&n[3]===e[3]?i="up":n[1]===e[1]&&n[2]===e[2]?i="right":i="left",i}snapDragArea(e,n,i,r){const s=n.slice(0),o=this.getAutofillSize(e,n,i),[a,l,u,c]=e,d=["up","down"].indexOf(i)>-1?u-a+1:c-l+1,g=Math.floor(o/d)*d,p=o-g,C=this.getFarthestCollection(e,n,i,r);if(C){if(i==="down"){const S=C.row+C.rowspan-a-p;s[2]+S>=this.plugin.hot.countRows()?s[2]-=p:s[2]+=p?S:0}else if(i==="right"){const S=C.col+C.colspan-l-p;s[3]+S>=this.plugin.hot.countCols()?s[3]-=p:s[3]+=p?S:0}else if(i==="up"){const S=u-p-C.row+1;s[0]+S<0?s[0]+=p:s[0]-=p?S:0}else if(i==="left"){const S=c-p-C.col+1;s[1]+S<0?s[1]+=p:s[1]-=p?S:0}}return this.updateCurrentFillCache({baseArea:e,dragDirection:i,foundMergedCells:r,fillSize:o,dragArea:s,cycleLength:d}),s}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),tn(this.currentFillData,e)}getAutofillSize(e,n,i){const[r,s,o,a]=e,[l,u,c,h]=n;switch(i){case"up":return r-l;case"down":return c-o;case"left":return s-u;case"right":return h-a;default:return null}}getDragArea(e,n,i){const[r,s,o,a]=e,[l,u,c,h]=n;switch(i){case"up":return[l,u,r-1,a];case"down":return[o+1,s,c,a];case"left":return[l,u,o,s-1];case"right":return[r,a+1,c,h];default:return null}}getFarthestCollection(e,n,i,r){const[s,o,a,l]=e,u=["up","down"].indexOf(i)>-1,c=u?a:l,h=u?s:o,d=this.getAutofillSize(e,n,i),g=u?a-s+1:l-o+1,p=Math.floor(d/g)*g,C=d-p;let S=null,b=null,R=null;switch(i){case"up":S="includesVertically",R=c-C+1;break;case"left":S="includesHorizontally",R=c-C+1;break;case"down":S="includesVertically",R=h+C-1;break;case"right":S="includesHorizontally",R=h+C-1;break}return M(r,E=>{E[S](R)&&E.isFarther(b,i)&&(b=E)}),b}recreateAfterDataPopulation(e){if(!this.currentFillData)return;const n=this.getRangeFromChanges(e),i=this.currentFillData.foundMergedCells,r=this.currentFillData.dragDirection,s=(u,c)=>{switch(r){case"up":return u.row-c>=n.from.row;case"down":return u.row+u.rowspan-1+c<=n.to.row;case"left":return u.col-c>=n.from.column;case"right":return u.col+u.colspan-1+c<=n.to.column;default:return null}};let o=0,a=null,l=1;do for(let u=0;u<i.length;u+=1){if(a=i[u],o=l*this.currentFillData.cycleLength,s(a,o))switch(r){case"up":this.plugin.mergedCellsCollection.add({row:a.row-o,rowspan:a.rowspan,col:a.col,colspan:a.colspan});break;case"down":this.plugin.mergedCellsCollection.add({row:a.row+o,rowspan:a.rowspan,col:a.col,colspan:a.colspan});break;case"left":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col-o,colspan:a.colspan});break;case"right":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col+o,colspan:a.colspan});break}u===i.length-1&&(l+=1)}while(s(a,o));this.currentFillData=null,this.plugin.hot.render(),i.length>0&&this.plugin.ifChromeForceRepaint()}getRangeFromChanges(e){const n={min:null,max:null},i={min:null,max:null};return M(e,r=>{const s=r[0],o=this.plugin.hot.propToCol(r[1]);(n.min===null||s<n.min)&&(n.min=s),(n.max===null||s>n.max)&&(n.max=s),(i.min===null||o<i.min)&&(i.min=o),(i.max===null||o>i.max)&&(i.max=o)}),{from:{row:n.min,column:i.min},to:{row:n.max,column:i.max}}}dragAreaOverlapsCollections(e,n,i){const r=this.getDragArea(e,n,i),[s,o,a,l]=r,u=this.plugin.hot._createCellCoords(s,o),c=this.plugin.hot._createCellCoords(a,l),h=this.plugin.hot._createCellRange(u,u,c);return!!this.mergedCellsCollection.getWithinRange(h,!0)}}function oC(t,e,n){return e=Nte(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nte(t){var e=Dte(t,"string");return typeof e=="symbol"?e:e+""}function Dte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Lte{constructor(e){oC(this,"plugin",void 0),oC(this,"hot",void 0),oC(this,"fullySelectedMergedCellClassName","fullySelectedMergedCell"),this.plugin=e,this.hot=e.hot}getSelectedMergedCellClassName(e,n,i,r){const s=Math.min(i[0],i[2]),o=Math.min(i[1],i[3]),a=Math.max(i[0],i[2]),l=Math.max(i[1],i[3]);if(r===void 0||!this.plugin.mergedCellsCollection.isFirstRenderableMergedCell(e,n))return;const c=this.plugin.mergedCellsCollection.get(e,n);if(!c)return;const h=c.getLastRow(),d=c.getLastColumn();if(s<=c.row&&o<=c.col&&a>=h&&l>=d)return`${this.fullySelectedMergedCellClassName}-${r}`;if(this.isMergeCellFullySelected(c,this.plugin.hot.getSelectedRange()))return`${this.fullySelectedMergedCellClassName}-multiple`}isMergeCellFullySelected(e,n){const i=[];if(!n||!e)return!1;for(let r=0;r<e.rowspan;r+=1)for(let s=0;s<e.colspan;s+=1)i.push(this.hot._createCellCoords(e.row+r,e.col+s));for(let r=0;r<i.length;r+=1){const s=[];for(let o=0;o<n.length;o+=1)s[o]=n[o].includes(i[r]);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 $te(t){return{key:"mergeCells",name(){const e=this.getSelectedLast();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(Ty)}return this.getTranslatedPhrase(Ey)},callback(){const e=this.getSelectedRangeLast();if(!e)return;e.setDirection(this.isRtl()?"NE-SW":"NW-SE");const{from:n,to:i}=e;t.toggleMerge(e),this.selectCell(n.row,n.col,i.row,i.col,!1)},disabled(){const e=this.getSelectedLast();return e?Ur.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 qc(t,e,n){return e=kte(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kte(t){var e=Fte(t,"string");return typeof e=="symbol"?e:e+""}function Fte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class IM{constructor(e){qc(this,"data",void 0),qc(this,"next",null),qc(this,"prev",null),this.data=e}}class Sf{constructor(){qc(this,"first",null),qc(this,"last",null)}push(e){const n=new IM(e);if(this.first===null)this.first=n,this.last=n;else{const i=this.last;this.last=n,n.prev=i,i.next=n}return n}unshift(e){const n=new IM(e);if(this.first===null)this.first=n,this.last=n;else{const i=this.first;this.first=n,n.next=i,i.prev=n}}inorder(e){let n=this.first;for(;n;){const i=e(n);if(n===this.last||i===!0)break;n=n.next}}remove(e){if(this.first===null)return!1;let n=this.first,i,r;for(;n;){if(n.data===e)return i=n.next,r=n.prev,i&&(i.prev=r),r&&(r.next=i),n===this.first&&(this.first=i),n===this.last&&(this.last=r),!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(i,r){r&&(e(r,r.next),r.next=i)}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,i;for(;e;)i=e.next,e.next=n,n.prev=e,n=e,e=i;this.first.next=null,this.last.prev=null,i=this.first,this.first=n,this.last=i}}function Vte(t,e){cA(t,e),e.add(t)}function wa(t,e,n){cA(t,e),e.set(t,n)}function cA(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lt(t,e){return t.get(Fg(t,e))}function ai(t,e,n){return t.set(Fg(t,e),n),n}function Fg(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 Dr=new WeakMap,Lr=new WeakMap,$r=new WeakMap,kr=new WeakMap,Iv=new WeakMap,yf=new WeakMap,bf=new WeakMap,aC=new WeakSet;class Wte{constructor(e){let{mergedCellsGetter:n,rowIndexMapper:i,columnIndexMapper:r}=e;Vte(this,aC),wa(this,Dr,new Sf),wa(this,Lr,new Sf),wa(this,$r,null),wa(this,kr,null),wa(this,Iv,null),wa(this,yf,null),wa(this,bf,null),ai(Iv,this,n),ai(yf,this,i),ai(bf,this,r)}getCurrentVerticalNode(){return lt(kr,this).data}getFirstVerticalNode(){return lt(Lr,this).first.data}getNextVerticalNode(){return lt(kr,this).next.data}getPrevVerticalNode(){return lt(kr,this).prev.data}getCurrentHorizontalNode(){return lt($r,this).data}getFirstHorizontalNode(){return lt(Dr,this).first.data}getNextHorizontalNode(){return lt($r,this).next.data}getPrevHorizontalNode(){return lt($r,this).prev.data}setPrevNodeAsActive(){ai(kr,this,lt(kr,this).prev),ai($r,this,lt($r,this).prev)}setNextNodeAsActive(){ai(kr,this,lt(kr,this).next),ai($r,this,lt($r,this).next)}buildFocusOrder(e){const n=e.getTopStartCorner(),i=e.getBottomEndCorner(),r=new WeakSet;ai(Dr,this,new Sf);for(let o=n.row;o<=i.row;o++)if(!lt(yf,this).isHidden(o))for(let a=n.col;a<=i.col;a++){if(lt(bf,this).isHidden(a))continue;const l=Fg(aC,this,PM).call(this,e,lt(Dr,this),r,o,a);l&&ai($r,this,l)}lt(Dr,this).first&&(lt(Dr,this).first.prev=lt(Dr,this).last,lt(Dr,this).last.next=lt(Dr,this).first);const s=new WeakSet;ai(Lr,this,new Sf);for(let o=n.col;o<=i.col;o++)if(!lt(bf,this).isHidden(o))for(let a=n.row;a<=i.row;a++){if(lt(yf,this).isHidden(a))continue;const l=Fg(aC,this,PM).call(this,e,lt(Lr,this),s,a,o);l&&ai(kr,this,l)}lt(Lr,this).first&&(lt(Lr,this).first.prev=lt(Lr,this).last,lt(Lr,this).last.next=lt(Lr,this).first)}setActiveNode(e,n){return lt(Dr,this).inorder(i=>{const{rowStart:r,rowEnd:s,colStart:o,colEnd:a}=i.data;if(e>=r&&e<=s&&n>=o&&n<=a)return ai($r,this,i),!1}),lt(Lr,this).inorder(i=>{const{rowStart:r,rowEnd:s,colStart:o,colEnd:a}=i.data;if(e>=r&&e<=s&&n>=o&&n<=a)return ai(kr,this,i),!1}),this}}function PM(t,e,n,i,r){const s=t.getTopStartCorner(),o=t.getBottomEndCorner(),a=t.highlight.clone().normalize(),l=lt(Iv,this).call(this,i,r);if(l&&n.has(l))return null;const u={colStart:r,colEnd:r,rowStart:i,rowEnd:i};if(l){if(n.add(l),l.row<s.row||l.row+l.rowspan-1>o.row||l.col<s.col||l.col+l.colspan-1>o.col)return null;u.colStart=l.col,u.colEnd=l.col+l.colspan-1,u.rowStart=l.row,u.rowEnd=l.row+l.rowspan-1}const c=e.push(u);return i===a.row&&r===a.col||l&&a.row>=l.row&&a.row<=l.row+l.rowspan-1&&a.col>=l.col&&a.col<=l.col+l.colspan-1?c:null}function Bte(t,e){hA(t,e),e.add(t)}function lC(t,e,n){hA(t,e),e.set(t,n)}function hA(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function uC(t,e,n){return e=Ute(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ute(t){var e=Yte(t,"string");return typeof e=="symbol"?e:e+""}function Yte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wh(t,e,n){return t.set(ft(t,e),n),n}function Tt(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")}ce.getSingleton().register("beforeMergeCells");ce.getSingleton().register("afterMergeCells");ce.getSingleton().register("beforeUnmergeCells");ce.getSingleton().register("afterUnmergeCells");const Zc="mergeCells",zte=150,OM=Zc;var Li=new WeakMap,$i=new WeakMap,Xr=new WeakMap,wt=new WeakSet;class Gte extends ut{constructor(){super(...arguments),Bte(this,wt),uC(this,"mergedCellsCollection",null),uC(this,"autofillCalculations",null),uC(this,"selectionCalculations",null),lC(this,Li,null),lC(this,$i,{row:0,col:0}),lC(this,Xr,new Wte({mergedCellsGetter:(e,n)=>this.mergedCellsCollection.get(e,n),rowIndexMapper:this.hot.rowIndexMapper,columnIndexMapper:this.hot.columnIndexMapper}))}static get PLUGIN_KEY(){return Zc}static get PLUGIN_PRIORITY(){return zte}isEnabled(){return!!this.hot.getSettings()[Zc]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new aR(this),this.autofillCalculations=new Hte(this),this.selectionCalculations=new Lte(this),this.addHook("afterInit",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,jte).call(e,...i)}),this.addHook("modifyTransformFocus",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,Xte).call(e,...i)}),this.addHook("modifyTransformStart",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,qte).call(e,...i)}),this.addHook("modifyTransformEnd",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,Zte).call(e,...i)}),this.addHook("beforeSelectionHighlightSet",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,Qte).call(e,...i)}),this.addHook("beforeSetRangeStart",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,xM).call(e,...i)}),this.addHook("beforeSetRangeStartOnly",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,xM).call(e,...i)}),this.addHook("beforeSelectionFocusSet",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,nne).call(e,...i)}),this.addHook("afterSelectionFocusSet",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,ine).call(e,...i)}),this.addHook("afterSelectionEnd",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,rne).call(e,...i)}),this.addHook("modifyGetCellCoords",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,Jte).call(e,...i)}),this.addHook("afterIsMultipleSelection",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,Kte).call(e,...i)}),this.addHook("afterRenderer",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,tne).call(e,...i)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,ene).call(e,...i)}),this.addHook("afterGetCellMeta",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,sne).call(e,...i)}),this.addHook("afterViewportRowCalculatorOverride",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,one).call(e,...i)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,ane).call(e,...i)}),this.addHook("modifyAutofillRange",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,lne).call(e,...i)}),this.addHook("afterCreateCol",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,une).call(e,...i)}),this.addHook("afterRemoveCol",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,cne).call(e,...i)}),this.addHook("afterCreateRow",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,hne).call(e,...i)}),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,dne).call(e,...i)}),this.addHook("afterChange",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,fne).call(e,...i)}),this.addHook("beforeDrawBorders",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,gne).call(e,...i)}),this.addHook("afterDrawSelection",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,mne).call(e,...i)}),this.addHook("beforeRemoveCellClassNames",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,pne).call(e,...i)}),this.addHook("beforeBeginEditing",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return ft(wt,e,wne).call(e,...i)}),this.addHook("beforeUndoStackChange",(n,i)=>{if(i==="MergeCells")return!1}),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.clearCollections(),this.unregisterShortcuts(),this.hot.render(),super.disablePlugin()}updatePlugin(){const e=this.hot.getSettings()[Zc];this.disablePlugin(),this.enablePlugin(),this.generateFromSettings(e),super.updatePlugin()}ifChromeForceRepaint(){if(!mP())return;const e=[];let n=[];this.mergedCellsCollection.mergedCells.forEach(i=>{const{row:r,rowspan:s}=i;for(let o=r+1;o<r+s;o++)n.push(o)}),n=[...new Set(n)],n.forEach(i=>{const r=this.hot.rowIndexMapper.getRenderableFromVisualIndex(i);this.hot.view._wt.wtOverlays.getOverlays(!0).map(s=>s?.name==="master"?s:s.clone.wtTable).forEach(s=>{const o=s.getRow(r);o&&(o.style.background=sh(o,"backgroundColor").replace(")",", 0.99)"),e.push(o))})}),this.hot._registerTimeout(()=>{e.forEach(i=>{i.style.background=sh(i,"backgroundColor").replace(", 0.99)",")")})},1)}validateSetting(e){let n=!0;return e?(Ur.containsNegativeValues(e)?(vt(Ur.NEGATIVE_VALUES_WARNING(e)),n=!1):Ur.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?(vt(Ur.IS_OUT_OF_BOUNDS_WARNING(e)),n=!1):Ur.isSingleCell(e)?(vt(Ur.IS_SINGLE_CELL(e)),n=!1):Ur.containsZeroSpan(e)&&(vt(Ur.ZERO_SPAN_WARNING(e)),n=!1),n):!1}generateFromSettings(e){if(Array.isArray(e)){const n=[];if(M(e,i=>{if(!this.validateSetting(i))return;const r=this.hot._createCellCoords(i.row,i.col),s=this.hot._createCellCoords(i.row+i.rowspan-1,i.col+i.colspan-1),o=this.hot._createCellRange(r,r,s);this.mergeRange(o,!0,!0),me(i.row,i.row+i.rowspan-1,a=>{me(i.col,i.col+i.colspan-1,l=>{a===i.row&&l===i.col||n.push([a,l,null])})})}),n.length===0)return;this.hot.setDataAtCell(n,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.getSelectedRangeLast();if(!e)return;e.setDirection(this.hot.isRtl()?"NE-SW":"NW-SE");const{from:n,to:i}=e;this.unmergeRange(e,!0),this.mergeRange(e),this.hot.selectCell(n.row,n.col,i.row,i.col,!1)}unmergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;const{from:n,to:i}=e;this.unmergeRange(e,!0),this.hot.selectCell(n.row,n.col,i.row,i.col,!1)}mergeRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const r=e.getTopStartCorner(),s=e.getBottomEndCorner(),o={row:r.row,col:r.col,rowspan:s.row-r.row+1,colspan:s.col-r.col+1},a=[];let l=null;return this.canMergeRange(o,n)?(this.hot.runHooks("beforeMergeCells",e,n),me(0,o.rowspan-1,c=>{me(0,o.colspan-1,h=>{let d=null;a[c]||(a[c]=[]),c===0&&h===0?d=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(o.row),this.hot.toPhysicalColumn(o.col)):this.hot.setCellMeta(o.row+c,o.col+h,"hidden",!0),a[c][h]=d})}),this.hot.setCellMeta(o.row,o.col,"spanned",!0),this.mergedCellsCollection.add(o)?(i?l=[o.row,o.col,a]:this.hot.populateFromArray(o.row,o.col,a,void 0,void 0,this.pluginName),n||this.ifChromeForceRepaint(),this.hot.runHooks("afterMergeCells",e,o,n),l):!0):!1}unmergeRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const i=this.mergedCellsCollection.getWithinRange(e);i&&(this.hot.runHooks("beforeUnmergeCells",e,n),M(i,r=>{this.mergedCellsCollection.remove(r.row,r.col),me(0,r.rowspan-1,s=>{me(0,r.colspan-1,o=>{this.hot.removeCellMeta(r.row+s,r.col+o,"hidden"),this.hot.removeCellMeta(r.row+s,r.col+o,"copyable")})}),this.hot.removeCellMeta(r.row,r.col,"spanned")}),this.hot.runHooks("afterUnmergeCells",e,n),this.hot.render())}toggleMerge(e){const n=this.mergedCellsCollection.get(e.from.row,e.from.col);n.row===e.from.row&&n.col===e.from.col&&n.row+n.rowspan-1===e.to.row&&n.col+n.colspan-1===e.to.col?this.unmergeRange(e):this.mergeSelection(e)}merge(e,n,i,r){const s=this.hot._createCellCoords(e,n),o=this.hot._createCellCoords(i,r);this.mergeRange(this.hot._createCellRange(s,s,o))}unmerge(e,n,i,r){const s=this.hot._createCellCoords(e,n),o=this.hot._createCellCoords(i,r);this.unmergeRange(this.hot._createCellRange(s,s,o))}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control","m"]],callback:()=>{const i=this.hot.getSelectedRangeLast();i&&!i.isSingleHeader()&&(this.toggleMerge(i),this.hot.render())},runOnlyIf:i=>!i.altKey,group:OM})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(OM)}modifyViewportRowStart(e,n){const i=this.hot.rowIndexMapper,r=i.getVisualFromRenderableIndex(e.startRow);for(let s=0;s<n;s+=1){const o=this.mergedCellsCollection.get(r,s);if(ke(o)){const a=i.getRenderableFromVisualIndex(i.getNearestNotHiddenIndex(o.row,1));if(a<e.startRow){e.startRow=a,this.modifyViewportRowStart(e,n);return}}}}modifyViewportRowEnd(e,n){const i=this.hot.rowIndexMapper,r=i.getVisualFromRenderableIndex(e.endRow);for(let s=0;s<n;s+=1){const o=this.mergedCellsCollection.get(r,s);if(ke(o)){const a=o.row+o.rowspan-1,l=i.getRenderableFromVisualIndex(i.getNearestNotHiddenIndex(a,-1));if(l>e.endRow){e.endRow=l,this.modifyViewportRowEnd(e,n);return}}}}modifyViewportColumnStart(e,n){const i=this.hot.columnIndexMapper,r=i.getVisualFromRenderableIndex(e.startColumn);for(let s=0;s<n;s+=1){const o=this.mergedCellsCollection.get(s,r);if(ke(o)){const a=i.getRenderableFromVisualIndex(i.getNearestNotHiddenIndex(o.col,1));if(a<e.startColumn){e.startColumn=a,this.modifyViewportColumnStart(e,n);return}}}}modifyViewportColumnEnd(e,n){const i=this.hot.columnIndexMapper,r=i.getVisualFromRenderableIndex(e.endColumn);for(let s=0;s<n;s+=1){const o=this.mergedCellsCollection.get(s,r);if(ke(o)){const a=o.col+o.colspan-1,l=i.getRenderableFromVisualIndex(i.getNearestNotHiddenIndex(a,-1));if(l>e.endColumn){e.endColumn=l,this.modifyViewportColumnEnd(e,n);return}}}}translateMergedCellToRenderable(e,n,i,r){const{rowIndexMapper:s,columnIndexMapper:o}=this.hot;let a,l;n===0?a=s.getNearestNotHiddenIndex(e,1):a=s.getNearestNotHiddenIndex(e+n-1,-1),r===0?l=o.getNearestNotHiddenIndex(i,1):l=o.getNearestNotHiddenIndex(i+r-1,-1);const u=e>=0?s.getRenderableFromVisualIndex(a):e,c=i>=0?o.getRenderableFromVisualIndex(l):i;return[u,c]}}function jte(){this.generateFromSettings(this.hot.getSettings()[Zc]),this.hot.render()}function Kte(t){if(t){const e=this.mergedCellsCollection.mergedCells,n=this.hot.getSelectedRangeLast(),i=n.getTopStartCorner(),r=n.getBottomEndCorner();for(let s=0;s<e.length;s+=1)if(i.row===e[s].row&&i.col===e[s].col&&r.row===e[s].row+e[s].rowspan-1&&r.col===e[s].col+e[s].colspan-1)return!1}return t}function Xte(t){Tt($i,this).row=t.row,Tt($i,this).col=t.col}function qte(t){const e=this.hot.getSelectedRangeLast(),{highlight:n}=e,{columnIndexMapper:i,rowIndexMapper:r}=this.hot;Tt(Li,this)&&(r.getRenderableFromVisualIndex(Tt(Li,this).row)!==null&&(n.row=Tt(Li,this).row),i.getRenderableFromVisualIndex(Tt(Li,this).col)!==null&&(n.col=Tt(Li,this).col),wh(Li,this,null));const s=this.mergedCellsCollection.get(n.row,n.col);if(!s)return;const o=s.col,a=s.col+s.colspan-1;if(t.col<0){const c=n.col>=o&&n.col<=a?o-1:a,h=i.getNearestNotHiddenIndex(c,-1);h===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,n.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(h,n.col)-1,1)}else if(t.col>0){const c=n.col>=o&&n.col<=a?a+1:o,h=i.getNearestNotHiddenIndex(c,1);h===null?t.col=this.hot.view.countRenderableColumnsInRange(n.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(n.col,h)-1,1)}const l=s.row,u=s.row+s.rowspan-1;if(t.row<0){const c=n.row>=l&&n.row<=u?l-1:u,h=r.getNearestNotHiddenIndex(c,-1);h===null?t.row=-this.hot.view.countRenderableRowsInRange(0,n.row):t.row=-Math.max(this.hot.view.countRenderableRowsInRange(h,n.row)-1,1)}else if(t.row>0){const c=n.row>=l&&n.row<=u?u+1:l,h=r.getNearestNotHiddenIndex(c,1);h===null?t.row=this.hot.view.countRenderableRowsInRange(n.row,this.hot.countRows()):t.row=Math.max(this.hot.view.countRenderableRowsInRange(n.row,h)-1,1)}}function Zte(t){const e=this.hot.getSelectedRangeLast(),n=e.clone(),{to:i}=e,{columnIndexMapper:r,rowIndexMapper:s}=this.hot,o=(a,l)=>{n.expand(this.hot._createCellCoords(a,l));for(let u=0;u<this.mergedCellsCollection.mergedCells.length;u+=1)n.expandByRange(this.mergedCellsCollection.mergedCells[u].getRange())};if(t.col<0){let a=this.mergedCellsCollection.getStartMostColumnIndex(e,i.col)+t.col;o(i.row,a),e.getHorizontalDirection()==="E-W"&&n.getHorizontalDirection()==="E-W"&&(a=n.getTopStartCorner().col);const l=r.getNearestNotHiddenIndex(a,1);l!==null&&(t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(l,i.col)-1,1))}else if(t.col>0){let a=this.mergedCellsCollection.getEndMostColumnIndex(e,i.col)+t.col;o(i.row,a),e.getHorizontalDirection()==="W-E"&&n.getHorizontalDirection()==="W-E"&&(a=n.getBottomEndCorner().col);const l=r.getNearestNotHiddenIndex(a,-1);l!==null&&(t.col=Math.max(this.hot.view.countRenderableColumnsInRange(i.col,l)-1,1))}if(t.row<0){let a=this.mergedCellsCollection.getTopMostRowIndex(e,i.row)+t.row;o(a,i.col),e.getVerticalDirection()==="S-N"&&n.getVerticalDirection()==="S-N"&&(a=n.getTopStartCorner().row);const l=s.getNearestNotHiddenIndex(a,1);l!==null&&(t.row=-Math.max(this.hot.view.countRenderableRowsInRange(l,i.row)-1,1))}else if(t.row>0){let a=this.mergedCellsCollection.getBottomMostRowIndex(e,i.row)+t.row;o(a,i.col),e.getVerticalDirection()==="N-S"&&n.getVerticalDirection()==="N-S"&&(a=n.getBottomStartCorner().row);const l=s.getNearestNotHiddenIndex(a,-1);l!==null&&(t.row=Math.max(this.hot.view.countRenderableRowsInRange(i.row,l)-1,1))}}function Qte(){const t=this.hot.getSelectedRangeLast(),{highlight:e}=t;if(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader()){wh(Li,this,e.clone());return}for(let i=0;i<this.mergedCellsCollection.mergedCells.length;i+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[i].getRange(),!1);for(let i=0;i<this.mergedCellsCollection.mergedCells.length;i+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[i].getRange(),!1);const n=this.mergedCellsCollection.get(e.row,e.col);wh(Li,this,e.clone()),n&&e.assign(n)}function Jte(t,e){if(t<0||e<0)return;const n=this.mergedCellsCollection.get(t,e);if(!n)return;const{row:i,col:r,colspan:s,rowspan:o}=n;return[i,r,i+o-1,r+s-1]}function ene(t){t.items.push({name:"---------"},$te(this))}function tne(t,e,n){const i=this.mergedCellsCollection.get(e,n),r=ke(i)?pr(i):void 0;if(ke(r)){const{rowIndexMapper:s,columnIndexMapper:o}=this.hot,{row:a,col:l,colspan:u,rowspan:c}=r,[h,d]=this.translateMergedCellToRenderable(a,c,l,u),g=s.getRenderableFromVisualIndex(e),p=o.getRenderableFromVisualIndex(n),C=h-g+1,S=d-p+1;r.row=s.getNearestNotHiddenIndex(r.row,1),r.col=o.getNearestNotHiddenIndex(r.col,1),r.rowspan=Math.min(r.rowspan,C),r.colspan=Math.min(r.colspan,S)}_v(t,r,e,n)}function xM(){wh(Li,this,null)}function nne(){if(Tt(Li,this).isCell())return;const t=this.hot.getSelectedRangeLast(),e=t.getVerticalDirection(),n=t.getHorizontalDirection(),i=Tt(Li,this).clone().normalize();Tt(Xr,this).setActiveNode(i.row,i.col),Tt($i,this).row>0||Tt($i,this).col>0?Tt(Xr,this).setPrevNodeAsActive():(n==="E-W"&&Tt($i,this).col<0||e==="S-N"&&Tt($i,this).row<0)&&Tt(Xr,this).setNextNodeAsActive()}function ine(t,e){const n=this.hot.getSelectedRangeLast(),{columnIndexMapper:i,rowIndexMapper:r}=this.hot;let s=null,o=null;if(Tt($i,this).col<0){const{rowEnd:a,colEnd:l}=Tt(Xr,this).getPrevHorizontalNode();o=i.getNearestNotHiddenIndex(l,-1),s=r.getNearestNotHiddenIndex(a,-1)}else if(Tt($i,this).col>0){const{rowStart:a,colStart:l}=Tt(Xr,this).getNextHorizontalNode();o=i.getNearestNotHiddenIndex(l,1),s=r.getNearestNotHiddenIndex(a,1)}else if(Tt($i,this).row<0){const{rowEnd:a,colEnd:l}=Tt(Xr,this).getPrevVerticalNode();o=i.getNearestNotHiddenIndex(l,-1),s=r.getNearestNotHiddenIndex(a,-1)}else if(Tt($i,this).row>0){const{rowStart:a,colStart:l}=Tt(Xr,this).getNextVerticalNode();o=i.getNearestNotHiddenIndex(l,1),s=r.getNearestNotHiddenIndex(a,1)}if(s!==null||o!==null){const a=this.hot._createCellCoords(s,o),l=this.mergedCellsCollection.get(a.row,a.col),u=this.hot.selection.highlight.getFocus();t=a.row,e=a.col,l?n.highlight.assign({row:this.hot.rowIndexMapper.getNearestNotHiddenIndex(l.row,1),col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(l.col,1)}):n.highlight.assign(a),u.clear(),u.add(a).commit()}Tt(Xr,this).setActiveNode(t,e),wh($i,this,{row:0,col:0})}function rne(){this.hot.getSelectedRangeLast().isHeader()||Tt(Xr,this).buildFocusOrder(this.hot.getSelectedRangeLast())}function sne(t,e,n){const i=this.mergedCellsCollection.get(t,e);i&&(i.row!==t||i.col!==e?n.copyable=!1:(n.rowspan=i.rowspan,n.colspan=i.colspan))}function one(t){const e=this.hot.countCols();this.modifyViewportRowStart(t,e),this.modifyViewportRowEnd(t,e)}function ane(t){const e=this.hot.countRows();this.modifyViewportColumnStart(t,e),this.modifyViewportColumnEnd(t,e)}function lne(t,e){this.autofillCalculations.correctSelectionAreaSize(e);const n=this.autofillCalculations.getDirection(e,t);let i=t;if(this.autofillCalculations.dragAreaOverlapsCollections(e,i,n))return i=e,i;const r=this.mergedCellsCollection.getWithinRange({from:{row:e[0],col:e[1]},to:{row:e[2],col:e[3]}});return r&&(i=this.autofillCalculations.snapDragArea(e,i,n,r)),i}function une(t,e){this.mergedCellsCollection.shiftCollections("right",t,e)}function cne(t,e){this.mergedCellsCollection.shiftCollections("left",t,e)}function hne(t,e,n){n!=="auto"&&this.mergedCellsCollection.shiftCollections("down",t,e)}function dne(t,e){this.mergedCellsCollection.shiftCollections("up",t,e)}function fne(t,e){e==="Autofill.fill"&&this.autofillCalculations.recreateAfterDataPopulation(t)}function gne(t,e){if(e&&e==="area"){const n=this.hot.getSelectedRangeLast(),i=this.mergedCellsCollection.getWithinRange(n);M(i,r=>{n.getBottomEndCorner().row===r.getLastRow()&&n.getBottomEndCorner().col===r.getLastColumn()&&(t[2]=r.row,t[3]=r.col)})}}function mne(t,e,n,i){if(n)return this.selectionCalculations.getSelectedMergedCellClassName(t,e,n,i)}function pne(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function wne(t,e,n,i){if(!(i instanceof MouseEvent))return;const r=this.hot.getSelectedRangeLast(),s=this.mergedCellsCollection.getByRange(r);if(!s)return;const o=this.hot._createCellCoords(s.row,s.col),a=this.hot._createCellCoords(s.row+s.rowspan-1,s.col+s.colspan-1);return this.hot.selection.getLayerLevel()===0&&r.isEqual(this.hot._createCellRange(o,o,a))}function Cne(t,e){return function(n,i){const[,...r]=n,[,...s]=i;return function o(a){const l=t[a],u=e[a],c=r[a],h=s[a],d=u.multiColumnSorting,p=(d.compareFunctionFactory?d.compareFunctionFactory:GO(u.type))(l,u,d)(c,h);if(p===Qr){const C=a+1;if(typeof e[C]<"u")return o(C)}return p}(0)}}function AM(){vt(ct`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously.
|
|
Only \`multiColumnSorting\` will work.`)}const dA="sort";function vne(t,e,n){const i=[];return n===!1||t.isColumnSorted(e)&&t.getNumberOfSortedColumns()>1&&i.push(`${dA}-${t.getIndexOfColumnInSortQueue(e)+1}`),i}function Sne(t){const e=t.className.split(" "),n=new RegExp(`^${dA}-[0-9]{1,2}$`);return e.filter(i=>n.test(i))}function yne(t,e,n){return e=bne(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bne(t){var e=Rne(t,"string");return typeof e=="symbol"?e:e+""}function Rne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Vg="multiColumnSorting",Ene=170,HM="columnSorting",NM=Vg;zO(Vg,Cne);class Tne extends tx{constructor(){super(...arguments),yne(this,"pluginKey",Vg)}static get PLUGIN_KEY(){return Vg}static get PLUGIN_PRIORITY(){return Ene}isEnabled(){return super.isEnabled()}enablePlugin(){!this.enabled&&this.hot.getSettings()[this.pluginKey]&&this.hot.getSettings()[HM]&&AM(),super.enablePlugin()}disablePlugin(){super.disablePlugin()}registerShortcuts(){super.registerShortcuts(),this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Shift","Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();return e.row===-1&&e.col>=0&&this.sort(this.getNextSortConfig(e.col,bg)),!1},runOnlyIf:()=>{var e,n;const i=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return i&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(i)&&i.isHeader()},relativeToGroup:ko,position:"before",group:NM})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(NM)}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,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];super.updateHeaderClasses(e,...i),He(e,Sne(e)),this.enabled!==!1&&q(e,vne(...i))}onUpdateSettings(e){this.hot.getSettings()[this.pluginKey]&&this.hot.getSettings()[HM]&&AM(),super.onUpdateSettings(e)}onAfterOnCellMouseDown(e,n){jb(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,bg))):this.sort(this.getColumnNextConfig(n.col)))}}function DM(t,e,n){return e=Mne(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Mne(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 i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Ine="multipleSelectionHandles",Pne=160;class One extends ut{constructor(){super(...arguments),DM(this,"dragged",[]),DM(this,"lastSetCell",null)}static get PLUGIN_KEY(){return Ine}static get PLUGIN_PRIORITY(){return Pne}isEnabled(){return bo()}enablePlugin(){this.enabled||(this.registerListeners(),super.enablePlugin())}registerListeners(){const e=this,{rootElement:n}=this.hot;function i(r){if(e.dragged.length===1)return e.dragged.splice(0,e.dragged.length),!0;const s=e.dragged.indexOf(r);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",r=>{let s;if(_e(r.target,"topSelectionHandle-HitArea"))return s=e.hot.getSelectedRangeLast(),e.dragged.push("top"),e.touchStartRange={width:s.getWidth(),height:s.getHeight(),direction:s.getDirection()},r.preventDefault(),!1;if(_e(r.target,"bottomSelectionHandle-HitArea"))return s=e.hot.getSelectedRangeLast(),e.dragged.push("bottom"),e.touchStartRange={width:s.getWidth(),height:s.getHeight(),direction:s.getDirection()},r.preventDefault(),!1}),this.eventManager.addEventListener(n,"touchend",r=>{if(_e(r.target,"topSelectionHandle-HitArea"))return i.call(e,"top"),e.touchStartRange=void 0,r.preventDefault(),!1;if(_e(r.target,"bottomSelectionHandle-HitArea"))return i.call(e,"bottom"),e.touchStartRange=void 0,r.preventDefault(),!1}),this.eventManager.addEventListener(n,"touchmove",r=>{const{rootDocument:s}=this.hot;let o,a,l,u,c,h;if(e.dragged.length===0)return;const d=s.elementFromPoint(r.touches[0].clientX,r.touches[0].clientY);!d||d===e.lastSetCell||((d.nodeName==="TD"||d.nodeName==="TH")&&(o=e.hot.getCoords(d),o.col===-1&&(o.col=0),a=e.hot.getSelectedRangeLast(),l=a.getWidth(),u=a.getHeight(),c=a.getDirection(),l===1&&u===1&&e.hot.selection.setRangeEnd(o),h=e.getCurrentRangeCoords(a,o,e.touchStartRange.direction,c,e.dragged[0]),h.start!==null&&e.hot.selection.setRangeStart(h.start),e.hot.selection.setRangeEnd(h.end),e.lastSetCell=d),r.preventDefault())})}getCurrentRangeCoords(e,n,i,r,s){const o=e.getTopStartCorner(),a=e.getBottomEndCorner(),l=e.getBottomStartCorner(),u=e.getTopEndCorner();let c={start:null,end:null};switch(i){case"NE-SW":switch(r){case"NE-SW":case"NW-SE":s==="top"?c={start:this.hot._createCellCoords(n.row,e.highlight.col),end:this.hot._createCellCoords(l.row,n.col)}:c={start:this.hot._createCellCoords(e.highlight.row,n.col),end:this.hot._createCellCoords(n.row,o.col)};break;case"SE-NW":s==="bottom"&&(c={start:this.hot._createCellCoords(a.row,n.col),end:this.hot._createCellCoords(n.row,o.col)});break}break;case"NW-SE":switch(r){case"NE-SW":s==="top"?c={start:n,end:l}:c.end=n;break;case"NW-SE":s==="top"?c={start:n,end:a}:c.end=n;break;case"SE-NW":s==="top"?c={start:n,end:o}:c.end=n;break;case"SW-NE":s==="top"?c={start:n,end:u}:c.end=n;break}break;case"SW-NE":switch(r){case"NW-SE":s==="bottom"?c={start:this.hot._createCellCoords(n.row,o.col),end:this.hot._createCellCoords(l.row,n.col)}:c={start:this.hot._createCellCoords(o.row,n.col),end:this.hot._createCellCoords(n.row,a.col)};break;case"SW-NE":s==="top"?c={start:this.hot._createCellCoords(e.highlight.row,n.col),end:this.hot._createCellCoords(n.row,a.col)}:c={start:this.hot._createCellCoords(n.row,o.col),end:this.hot._createCellCoords(o.row,n.col)};break;case"SE-NW":s==="bottom"?c={start:this.hot._createCellCoords(n.row,u.col),end:this.hot._createCellCoords(o.row,n.col)}:s==="top"&&(c={start:l,end:n});break}break;case"SE-NW":switch(r){case"NW-SE":case"NE-SW":case"SW-NE":s==="top"&&(c.end=n);break;case"SE-NW":s==="top"?c.end=n:c={start:n,end:o};break}break}return c}isDragged(){return this.dragged.length>0}}function Pv(){let{label:t="",colspan:e=1,origColspan:n=1,collapsible:i=!1,crossHiddenColumns:r=[],isCollapsed:s=!1,isHidden:o=!1,isRoot:a=!1,isPlaceholder:l=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{label:t,colspan:e,origColspan:n,collapsible:i,isCollapsed:s,crossHiddenColumns:r,isHidden:o,isRoot:a,isPlaceholder:l}}function fA(){return{label:"",isPlaceholder:!0}}function xne(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0;const n=[];if(e===0)return n;M(t,r=>{const s=[];let o=0;n.push(s),M(r,a=>{const l=Pv();if(ke(a)){const{label:c,colspan:h}=a;l.label=Qt(c),typeof h=="number"&&h>1&&(l.colspan=h,l.origColspan=h)}else l.label=Qt(a);o+=l.origColspan;let u=!1;if(o>=e&&(l.colspan=l.origColspan-(o-e),l.origColspan=l.colspan,u=!0),s.push(l),l.colspan>1)for(let c=0;c<l.colspan-1;c++)s.push(fA());return!u})});const i=Math.max(...Ke(n,r=>r.length));return M(n,r=>{if(r.length<i){const s=Ke(new Array(i-r.length),()=>Pv());r.splice(r.length,0,...s)}}),n}function cC(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 Ji(t,e){return t.get(gA(t,e))}function Sc(t,e,n){return t.set(gA(t,e),n),n}function gA(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 LM=["label","collapsible"];var vs=new WeakMap,Ca=new WeakMap,hC=new WeakMap;class Hne{constructor(){cC(this,vs,[]),cC(this,Ca,0),cC(this,hC,1/0)}setColumnsLimit(e){Sc(hC,this,e)}setData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Sc(vs,this,xne(e,Ji(hC,this))),Sc(Ca,this,Ji(vs,this).length)}getData(){return Ji(vs,this)}mergeWith(e){M(e,n=>{let{row:i,col:r,...s}=n;const o=this.getHeaderSettings(i,r);o!==null&&tn(o,s,LM)})}map(e){M(Ji(vs,this),n=>{M(n,i=>{const r=e({...i});ke(r)&&tn(i,r,LM)})})}getHeaderSettings(e,n){var i;if(e>=Ji(Ca,this)||e<0)return null;const r=Ji(vs,this)[e];return Array.isArray(r)===!1||n>=r.length?null:(i=r[n])!==null&&i!==void 0?i:null}getHeadersSettings(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const r=[];if(e>=Ji(Ca,this)||e<0)return r;const s=Ji(vs,this)[e];let o=0;for(let a=n;a<s.length;a++){const l=s[a];if(l.isPlaceholder)throw new Error("The first column settings cannot overlap the other header layers");if(o+=l.colspan,r.push(l),l.colspan>1&&(a+=l.colspan-1),o===i)break;if(o>i)throw new Error("The last column settings cannot overlap the other header layers")}return r}getLayersCount(){return Ji(Ca,this)}getColumnsCount(){return Ji(Ca,this)>0?Ji(vs,this)[0].length:0}clear(){Sc(vs,this,[]),Sc(Ca,this,0)}}function dC(t,e,n){return e=Nne(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nne(t){var e=Dne(t,"string");return typeof e=="symbol"?e:e+""}function Dne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const mA="DF-pre-order";function pA(t,e){let n=t.call(e,this);for(let i=0;i<this.childs.length;i++){if(n===!1)return!1;n=pA.call(this.childs[i],t,e)}return n}const Lne="DF-post-order";function wA(t,e){for(let n=0;n<this.childs.length;n++)if(wA.call(this.childs[n],t,e)===!1)return!1;return t.call(e,this)}const CA="BF";function $ne(t,e){const n=[this];function i(){if(n.length===0)return;const r=n.shift();n.push(...r.childs),t.call(e,r)!==!1&&i()}i()}const kne=CA,$M=new Map([[mA,pA],[Lne,wA],[CA,$ne]]);class Wg{constructor(e){dC(this,"data",{}),dC(this,"parent",null),dC(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 Wg({...e.data});for(let i=0;i<e.childs.length;i++)n.addChild(this.cloneTree(e.childs[i]));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]:kne;if(!$M.has(n))throw new Error(`Traversal strategy "${n}" does not exist`);$M.get(n).call(this,e,this)}walkUp(e){const n=this,i=r=>{e.call(n,r)!==!1&&r.parent!==null&&i(r.parent)};i(this)}}function fC(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 Ln(t,e){return t.get(vA(t,e))}function Vne(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")}var Hl=new WeakMap,va=new WeakMap,Nl=new WeakMap;class Wne{constructor(e){fC(this,Hl,new Map),fC(this,va,new Map),fC(this,Nl,null),Vne(Nl,this,e)}getRoots(){return Array.from(Ln(Hl,this).values())}getRootByColumn(e){let n;return Ln(va,this).has(e)&&(n=Ln(Hl,this).get(Ln(va,this).get(e))),n}getNode(e,n){const i=this.getRootByColumn(n);if(!i)return;const r=n-Ln(va,this).get(n);let s=0,o;return i.walkDown(a=>{const{data:{origColspan:l,headerLevel:u}}=a;if(e===u){if(r>=s&&r<=s+l-1)return o=a,o.data.isRoot=n===o.data.columnIndex,!1;s+=l}}),o}rebuildTreeIndex(){let e=0;Ln(va,this).clear(),M(Ln(Hl,this),n=>{let[,{data:{colspan:i}}]=n;for(let r=e;r<e+i;r++)Ln(va,this).set(r,e);e+=i})}buildTree(){this.clear();const e=Ln(Nl,this).getColumnsCount();let n=0;for(;n<e;){const i=Ln(Nl,this).getHeaderSettings(0,n),r=new Wg;Ln(Hl,this).set(n,r),this.buildLeaves(r,n,0,i.origColspan),n+=i.origColspan}this.rebuildTreeIndex()}buildLeaves(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;const s=Ln(Nl,this).getHeadersSettings(i,n,r);i+=1,M(s,o=>{const a={...o,headerLevel:i-1,columnIndex:n};let l;i===1?(e.data=a,l=e):(l=new Wg(a),e.addChild(l)),i<Ln(Nl,this).getLayersCount()&&this.buildLeaves(l,n,i,o.origColspan),n+=o.origColspan})}clear(){Ln(Hl,this).clear(),Ln(va,this).clear()}}function SA(t,e){t.walkDown(n=>{let{data:i,childs:r}=n;if(!i.isHidden&&(e(i.columnIndex),r.length===0))for(let s=1;s<i.colspan;s++)e(i.columnIndex+s)})}function Bg(t,e){let{childs:n}=t;if(n.length!==0)return n[0].data[e]}function Ug(t){return Bg(t,"origColspan")===t.data.origColspan}function lR(t){const{data:e,childs:n}=t;if(!e.isCollapsed||e.isHidden||e.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(Ug(t))return lR(n[0]);e.isCollapsed=!1;const r=n.slice(1),s=new Set;let o=0;if(r.length>0)M(r,a=>{a.replaceTreeWith(a.data.clonedTree),a.data.clonedTree=null;const l=a.data;o+=l.colspan,SA(a,u=>{s.add(u)})});else{const{colspan:a,origColspan:l,columnIndex:u}=e;o=l-a;for(let c=1;c<l;c++)s.add(u+c)}return t.walkUp(a=>{const{data:l}=a;l.colspan+=o,l.colspan>=l.origColspan?(l.colspan=l.origColspan,l.isCollapsed=!1):Ug(a)&&(l.isCollapsed=Bg(a,"isCollapsed"))}),{rollbackModification:()=>uR(t),affectedColumns:Array.from(s),colspanCompensation:o}}function uR(t){var e;const{data:n,childs:i}=t;if(n.isCollapsed||n.isHidden||n.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(Ug(t))return uR(i[0]);n.isCollapsed=!0;const s=i.slice(1),o=new Set;if(s.length>0)M(s,l=>{SA(l,u=>{o.add(u)}),l.data.clonedTree=l.cloneTree(),l.walkDown(u=>{let{data:c}=u;c.isHidden=!0})});else{const{origColspan:l,columnIndex:u}=n;for(let c=1;c<l;c++){const h=u+c;o.add(h)}}const a=n.colspan-((e=Bg(t,"colspan"))!==null&&e!==void 0?e:1);return t.walkUp(l=>{const{data:u}=l;u.colspan-=a,u.colspan<=1?(u.colspan=1,u.isCollapsed=!0):Ug(l)&&(u.isCollapsed=Bg(l,"isCollapsed"))}),{rollbackModification:()=>lR(t),affectedColumns:Array.from(o),colspanCompensation:a}}function Bne(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(ct`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 i=!1;t.walkUp(r=>{const{data:{collapsible:s}}=r;if(s)return i=!0,!1}),!i&&t.walkUp(r=>{const{data:s}=r;s.crossHiddenColumns.push(e),s.colspan>1?s.colspan-=1:s.isHidden=!0})}function Une(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(ct`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 i=!1;t.walkUp(r=>{const{data:{collapsible:s}}=r;if(s)return i=!0,!1}),!i&&t.walkUp(r=>{const{data:s}=r;s.crossHiddenColumns.splice(s.crossHiddenColumns.indexOf(e),1),!s.isHidden&&s.colspan<s.origColspan&&(s.colspan+=1),s.isHidden=!1})}const kM=new Map([["collapse",uR],["expand",lR],["hide-column",Bne],["show-column",Une]]);function Yne(t,e,n){if(!kM.has(t))throw new Error(`The node modifier action ("${t}") does not exist.`);return kM.get(t)(e,n)}function Rf(t){const e=[];return M(t,n=>{n.walkDown(i=>{const r=i.data,{origColspan:s,columnIndex:o,headerLevel:a,crossHiddenColumns:l}=r,u=Gne(e,a);let c=!1;for(let h=o;h<o+s;h++)if(l.includes(h)||c)u.push(fA());else{const g=zne(r);g.isRoot=!0,u.push(g),c=!0}})}),e}function zne(t){const{crossHiddenColumns:e,...n}=Pv(t);return n}function Gne(t,e){let n;return Array.isArray(t[e])?n=t[e]:(n=[],t[e]=n),n}function gC(t,e,n){jne(t,e),e.set(t,n)}function jne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yc(t,e,n){return t.set(yA(t,e),n),n}function kt(t,e){return t.get(yA(t,e))}function yA(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 Fr=new WeakMap,Zn=new WeakMap,Sa=new WeakMap;class Kne{constructor(){gC(this,Fr,new Hne),gC(this,Zn,new Wne(kt(Fr,this))),gC(this,Sa,[[]])}setState(e){kt(Fr,this).setData(e);let n=!1;try{kt(Zn,this).buildTree()}catch{kt(Zn,this).clear(),kt(Fr,this).clear(),n=!0}return yc(Sa,this,Rf(kt(Zn,this).getRoots())),n}setColumnsLimit(e){kt(Fr,this).setColumnsLimit(e)}mergeStateWith(e){const n=Ke(e,i=>{let{row:r,...s}=i;return{row:r<0?this.rowCoordsToLevel(r):r,...s}});kt(Fr,this).mergeWith(n),kt(Zn,this).buildTree(),yc(Sa,this,Rf(kt(Zn,this).getRoots()))}mapState(e){kt(Fr,this).map(e),kt(Zn,this).buildTree(),yc(Sa,this,Rf(kt(Zn,this).getRoots()))}mapNodes(e){return Hn(kt(Zn,this).getRoots(),(n,i)=>(i.walkDown(r=>{const s=e(r.data);s!==void 0&&n.push(s)}),n),[])}triggerNodeModification(e,n,i){n<0&&(n=this.rowCoordsToLevel(n));const r=kt(Zn,this).getNode(n,i);let s;return r&&(s=Yne(e,r,i),yc(Sa,this,Rf(kt(Zn,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 i,r;return e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount()?null:(i=(r=kt(Sa,this)[e])===null||r===void 0?void 0:r[n])!==null&&i!==void 0?i:null}getHeaderTreeNodeData(e,n){const i=this.getHeaderTreeNode(e,n);return i?{...i.data}:null}getHeaderTreeNode(e,n){if(e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount())return null;const i=kt(Zn,this).getNode(e,n);return i||null}findTopMostEntireHeaderLevel(e){var n;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;const r=i-e+1;let s=!1,o=null;for(let a=e;a<=i;a++){const l=kt(Zn,this).getRootByColumn(a);if(!l)break;s=!0,l.walkDown(u=>{const{columnIndex:c,headerLevel:h,origColspan:d,isHidden:g}=u.data;g||d<=r&&c>=e&&c+d-1<=i&&(o===null||h<o)&&(o=h)},mA)}return s&&o===null?-1:this.levelToRowCoords((n=o)!==null&&n!==void 0?n:0)}findLeftMostColumnIndex(e,n){var i;const{isRoot:r}=(i=this.getHeaderSettings(e,n))!==null&&i!==void 0?i:{isRoot:!0};if(r)return n;let s=n-1;for(;s>=0;){var o;const{isRoot:a}=(o=this.getHeaderSettings(e,s))!==null&&o!==void 0?o:{isRoot:!0};if(a)break;s-=1}return s}findRightMostColumnIndex(e,n){var i;const{isRoot:r,origColspan:s}=(i=this.getHeaderSettings(e,n))!==null&&i!==void 0?i:{isRoot:!0,origColspan:1};if(r)return n+s-1;let o=n+1;for(;o<this.getColumnsCount();){var a;const{isRoot:l}=(a=this.getHeaderSettings(e,o))!==null&&a!==void 0?a:{isRoot:!0};if(l)break;o+=1}return o-1}getLayersCount(){return kt(Fr,this).getLayersCount()}getColumnsCount(){return kt(Fr,this).getColumnsCount()}clear(){yc(Sa,this,[]),kt(Fr,this).clear(),kt(Zn,this).clear()}}function bc(t,e,n){return e=Xne(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xne(t){var e=qne(t,"string");return typeof e=="symbol"?e:e+""}function qne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Zne{constructor(e,n){bc(this,"hot",void 0),bc(this,"nestedHeaderSettingsGetter",void 0),bc(this,"layersCount",0),bc(this,"container",void 0),bc(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(){this.container=this.hot.rootDocument.createElement("div"),this.container.classList.add("handsontable","htGhostTable","htAutoSize"),this._buildGhostTable(this.container),this.hot.rootDocument.body.appendChild(this.container);const e=this.container.querySelectorAll("tr:last-of-type th"),n=e.length;this.widthsMap.clear();for(let i=0;i<n;i++){const r=this.hot.columnIndexMapper.getVisualFromRenderableIndex(i),s=this.hot.toPhysicalColumn(r);this.widthsMap.setValueAtIndex(s,e[i].offsetWidth)}this.container.parentNode.removeChild(this.container),this.container=null}_buildGhostTable(e){const{rootDocument:n,columnIndexMapper:i}=this.hot,r=n.createDocumentFragment(),s=n.createElement("table"),o=!!this.hot.getSettings().dropdownMenu,a=i.getRenderableIndexesLength();for(let l=0;l<this.layersCount;l++){const u=n.createElement("tr");for(let c=0;c<a;c++){let h=i.getVisualFromRenderableIndex(c);h===null&&(h=c);const d=n.createElement("th"),g=this.nestedHeaderSettingsGetter(l,h);if(g&&(!g.isPlaceholder||g.isHidden)){let p=g.label;o&&(p+='<button class="changeType"></button>'),gu(d,p),d.colSpan=g.colspan,u.appendChild(d)}}s.appendChild(u)}r.appendChild(s),e.appendChild(r)}clear(){this.widthsMap.clear(),this.container=null}}function Qne(t,e){bA(t,e),e.add(t)}function FM(t,e,n){return e=Jne(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Jne(t){var e=eie(t,"string");return typeof e=="symbol"?e:e+""}function eie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ef(t,e,n){bA(t,e),e.set(t,n)}function bA(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pa(t,e,n){return t.set(Ft(t,e),n),n}function Je(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 VM="nestedHeaders",tie=280;var mt=new WeakMap,ao=new WeakMap,Qc=new WeakMap,Um=new WeakMap,Gt=new WeakSet;class nie extends ut{constructor(){super(...arguments),Qne(this,Gt),Ef(this,mt,new Kne),Ef(this,ao,null),Ef(this,Qc,null),Ef(this,Um,!1),FM(this,"ghostTable",new Zne(this.hot,(e,n)=>this.getHeaderSettings(e,n))),FM(this,"detectedOverlappedHeaders",!1)}static get PLUGIN_KEY(){return VM}static get PLUGIN_PRIORITY(){return tie}isEnabled(){return!!this.hot.getSettings()[VM]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();(!Array.isArray(n)||!Array.isArray(n[0]))&&vt(ct`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",()=>Ft(Gt,this,Cie).call(this)),this.addHook("afterLoadData",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return Ft(Gt,e,vie).call(e,...r)}),this.addHook("beforeOnCellMouseDown",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return Ft(Gt,e,oie).call(e,...r)}),this.addHook("afterOnCellMouseDown",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return Ft(Gt,e,aie).call(e,...r)}),this.addHook("beforeOnCellMouseOver",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return Ft(Gt,e,lie).call(e,...r)}),this.addHook("beforeOnCellMouseUp",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return Ft(Gt,e,uie).call(e,...r)}),this.addHook("beforeSelectionHighlightSet",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return Ft(Gt,e,cie).call(e,...r)}),this.addHook("modifyTransformStart",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return Ft(Gt,e,hie).call(e,...r)}),this.addHook("afterSelection",()=>Ft(Gt,this,Tf).call(this)),this.addHook("afterSelectionFocusSet",()=>Ft(Gt,this,Tf).call(this)),this.addHook("beforeViewportScrollHorizontally",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return Ft(Gt,e,iie).call(e,...r)}),this.addHook("afterGetColumnHeaderRenderers",i=>Ft(Gt,this,fie).call(this,i)),this.addHook("modifyColWidth",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return Ft(Gt,e,mie).call(e,...r)}),this.addHook("modifyColumnHeaderValue",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return Ft(Gt,e,pie).call(e,...r)}),this.addHook("beforeHighlightingColumnHeader",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return Ft(Gt,e,rie).call(e,...r)}),this.addHook("beforeCopy",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return Ft(Gt,e,sie).call(e,...r)}),this.addHook("beforeSelectColumns",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return Ft(Gt,e,die).call(e,...r)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return Ft(Gt,e,gie).call(e,...r)}),this.addHook("modifyFocusedElement",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return Ft(Gt,e,wie).call(e,...r)}),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",()=>Ft(Gt,this,Tf).call(this)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",()=>Ft(Gt,this,Tf).call(this)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();Je(mt,this).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=Je(mt,this).setState(e)),this.detectedOverlappedHeaders&&vt(ct`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,i)=>{const r=n===!0?"hide-column":"show-column";Je(mt,this).triggerColumnModification(r,i)}),!Je(ao,this)&&this.enabled&&Pa(ao,this,this.hot.columnIndexMapper.createChangesObserver("hiding").subscribe(n=>{n.forEach(i=>{let{op:r,index:s,newValue:o}=i;if(r==="replace"){const a=o===!0?"hide-column":"show-column";Je(mt,this).triggerColumnModification(a,s)}}),this.ghostTable.buildWidthsMap()})),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.clearColspans(),Je(mt,this).clear(),Je(ao,this).unsubscribe(),Pa(ao,this,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return Je(mt,this)}getLayersCount(){return Je(mt,this).getLayersCount()}getHeaderSettings(e,n){return Je(mt,this).getHeaderSettings(e,n)}clearColspans(){if(!this.hot.view)return;const{_wt:e}=this.hot.view,n=e.getSetting("columnHeaders").length,i=e.wtTable.THEAD,r=e.wtOverlays.topOverlay.clone.wtTable.THEAD,s=e.wtOverlays.topInlineStartCornerOverlay?e.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null;for(let o=0;o<n;o++){const a=i.childNodes[o];if(!a)break;const l=r.childNodes[o],u=s?s.childNodes[o]:null;for(let c=0,h=a.childNodes.length;c<h;c++)a.childNodes[c].removeAttribute("colspan"),He(a.childNodes[c],"hiddenHeader"),l&&l.childNodes[c]&&(l.childNodes[c].removeAttribute("colspan"),He(l.childNodes[c],"hiddenHeader")),s&&u&&u.childNodes[c]&&(u.childNodes[c].removeAttribute("colspan"),He(u.childNodes[c],"hiddenHeader"))}}headerRendererFactory(e){var n=this;const i=this.hot.view._wt.getSetting("fixedColumnsStart");return(r,s)=>{var o;const{columnIndexMapper:a,view:l}=this.hot;let u=a.getVisualFromRenderableIndex(r);u===null&&(u=r),s.removeAttribute("colspan"),He(s,"hiddenHeader");const{colspan:c,isHidden:h,isPlaceholder:d}=(o=Je(mt,this).getHeaderSettings(e,u))!==null&&o!==void 0?o:{label:""};if(d||h)q(s,"hiddenHeader");else if(c>1){var g,p;const{wtOverlays:C}=l._wt,S=(g=C.topInlineStartCornerOverlay)===null||g===void 0?void 0:g.clone.wtTable.THEAD.contains(s),b=(p=C.inlineStartOverlay)===null||p===void 0?void 0:p.clone.wtTable.THEAD.contains(s),R=S||b?Math.min(c,i-r):c;R>1&&s.setAttribute("colspan",R)}this.hot.view.appendColHeader(u,s,function(){return n.getColumnHeaderValue(...arguments)},e)}}getColumnHeaderValue(e,n){var i;const{isHidden:r,isPlaceholder:s}=(i=Je(mt,this).getHeaderSettings(n,e))!==null&&i!==void 0?i:{};return s||r?"":this.hot.getColHeader(e,n)}destroy(){Pa(mt,this,null),Je(ao,this)!==null&&(Je(ao,this).unsubscribe(),Pa(ao,this,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return Je(mt,this).getHeaderTreeNodeData(e.row,e.col)}}function Tf(){var t;const e=(t=this.hot)===null||t===void 0?void 0:t.getSelectedRangeLast();if(!e)return;const{highlight:n}=e;if(n.isHeader()&&n.col>=0){const r=Je(mt,this).findLeftMostColumnIndex(n.row,n.col),s=this.hot.selection.highlight.getFocus();s.visualCellRange.highlight.col=r,s.visualCellRange.from.col=r,s.visualCellRange.to.col=r,s.commit()}}function iie(t){const e=this.hot.getSelectedRangeLast();if(!e)return t;const{highlight:n}=e;if(!(n.isHeader()&&n.col>=0))return t;const r=this.hot.view.getFirstFullyVisibleColumn(),s=this.hot.view.getLastFullyVisibleColumn(),o=Je(mt,this).findLeftMostColumnIndex(n.row,n.col),a=Je(mt,this).findRightMostColumnIndex(n.row,n.col);return o<r&&a>s?t:o<r?o:a}function rie(t,e,n){const i=Je(mt,this).getHeaderTreeNodeData(e,t);if(!i)return t;const{columnCursor:r,selectionType:s,selectionWidth:o}=n,{isRoot:a,colspan:l}=Je(mt,this).getHeaderSettings(e,t);if(s===US){if(!a)return i.columnIndex}else if(s===YP&&(l>o-r||!a))return null;return t}function sie(t,e,n){let{columnHeadersCount:i}=n;if(i!==0)for(let s=0;s<e.length;s++){const{startRow:o,startCol:a,endRow:l,endCol:u}=e[s],c=l-o+1,h=a-u+1;if(o>=0||h===1)break;for(let d=a;d<=u;d++)for(let g=o;g<=l;g++){var r;const p=c+g,C=d-a;if(C===0)continue;((r=Je(mt,this).getHeaderTreeNodeData(g,d))===null||r===void 0?void 0:r.isRoot)===!1&&(t[p][C]="")}}}function oie(t,e,n,i){this._getHeaderTreeNodeDataByCoords(e)&&(i.column=!0)}function aie(t,e){const n=this._getHeaderTreeNodeDataByCoords(e);if(!n)return;Pa(Qc,this,e.clone()),Pa(Um,this,!0);const{selection:i}=this.hot,r=i.isSelected()?i.getSelectedRange().current():null,s=[],{columnIndex:o,origColspan:a}=n,l=!i.inInSelection(e);t.shiftKey&&r?e.col<r.from.col?s.push(r.getTopEndCorner().col,o,e.row):e.col>r.from.col?s.push(r.getTopStartCorner().col,o+a-1,e.row):s.push(o,o+a-1,e.row):(IS(t)||Da(t)&&l)&&s.push(o,o+a-1,e.row),i.selectColumns(...s)}function lie(t,e,n,i){if(!this.hot.view.isMouseDown())return;const r=this._getHeaderTreeNodeDataByCoords(e);if(!r)return;const{columnIndex:s,origColspan:o}=r,a=this.hot.getSelectedRangeLast(),l=a.getTopStartCorner(),u=a.getBottomEndCorner(),{from:c}=a;i.column=!0,i.cell=!0;const h=[],d=gt(e.row,-1/0,-1);e.col<c.col?h.push(u.col,s,d):e.col>c.col?h.push(l.col,s+o-1,d):h.push(s,s+o-1,d),this.hot.selection.selectColumns(...h)}function uie(){Pa(Um,this,!1)}function cie(){const{navigableHeaders:t}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!Je(Um,this)||!t)return;const e=this.hot.getSelectedRangeLast(),n=e.getTopStartCorner().col,i=e.getBottomEndCorner().col,{columnIndex:r,origColspan:s}=Je(mt,this).getHeaderTreeNodeData(Je(Qc,this).row,Je(Qc,this).col);if(e.setHighlight(Je(Qc,this)),s>e.getWidth()||r<n||r+s-1>i){const o=Je(mt,this).findTopMostEntireHeaderLevel(gt(n,r,r+s-1),gt(i,r,r+s-1));e.highlight.row=o,e.highlight.col=e.from.col}}function hie(t){const{highlight:e}=this.hot.getSelectedRangeLast(),n=this.hot._createCellCoords(e.row+t.row,e.col+t.col);if(!(n.isHeader()&&n.col>=0))return;const r=Je(mt,this).findLeftMostColumnIndex(n.row,n.col),s=Je(mt,this).findRightMostColumnIndex(n.row,n.col);if(t.col<0){const o=e.col>=r&&e.col<=s?r-1:s,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(o,-1);a===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,e.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(a,e.col)-1,1)}else if(t.col>0){const o=e.col>=r&&e.col<=s?s+1:r,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(o,1);a===null?t.col=this.hot.view.countRenderableColumnsInRange(e.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(e.col,a)-1,1)}}function die(t,e){const n=t.row,i=this._getHeaderTreeNodeDataByCoords({row:n,col:t.col}),r=this._getHeaderTreeNodeDataByCoords({row:n,col:e.col});e.col<t.col?(i&&(t.col=i.columnIndex+i.origColspan-1),r&&(e.col=r.columnIndex)):e.col>=t.col&&(i&&(t.col=i.columnIndex),r&&(e.col=r.columnIndex+r.origColspan-1))}function fie(t){t.length=0;for(let e=0;e<Je(mt,this).getLayersCount();e++)t.push(this.headerRendererFactory(e))}function gie(t){const e=Je(mt,this).getLayersCount();let n=t.startColumn,i=!!e;for(let r=0;r<e;r++){const s=Je(mt,this).findLeftMostColumnIndex(r,t.startColumn),o=this.hot.columnIndexMapper.getRenderableFromVisualIndex(s);if(s>=0&&(i=!1),Bn(o)&&o<t.startColumn){n=o;break}}t.startColumn=i?Je(mt,this).getHeaderTreeNodeData(0,n).columnIndex:n}function mie(t,e){const n=this.ghostTable.getWidth(e);return t>n?t:n}function pie(t,e,n){var i;const{label:r}=(i=Je(mt,this).getHeaderTreeNodeData(n,e))!==null&&i!==void 0?i:{label:""};return r}function wie(t,e){if(t<0)return this.hot.getCell(t,Je(mt,this).findLeftMostColumnIndex(t,e),!0)}function Cie(){this.updatePlugin()}function vie(t,e){e||this.updatePlugin()}function Rc(t,e,n){return e=Sie(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Sie(t){var e=yie(t,"string");return typeof e=="symbol"?e:e+""}function yie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bie{constructor(e,n){Rc(this,"hot",void 0),Rc(this,"data",null),Rc(this,"plugin",void 0),Rc(this,"parentReference",new WeakMap),Rc(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},me(0,this.data.length-1,e=>{this.cacheNode(this.data[e],0,null)})}cacheNode(e,n,i){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:i,row:this.cache.rows.length-1,level:n}),this.hasChildren(e)&&M(e.__children,r=>{this.cacheNode(r,n+1,e)})}getDataObject(e){return e==null?null:this.cache.rows[e]}readTreeNodes(e,n,i,r){let s=!1,o=n;if(isNaN(o)&&o.end)return o;let a=e;return a||(a={__children:this.data},s=!0,o-=1),i!=null&&o===i?{result:a,end:!0}:r!=null&&a===r?{result:o,end:!0}:(o+=1,a.__children&&M(a.__children,l=>{if(this.parentReference.set(l,s?null:a),o=this.readTreeNodes(l,o,i,r),isNaN(o)&&o.end)return!1}),o)}mockParent(){const e=this.mockNode();return e.__children=this.data,e}mockNode(){const e={};return Ue(this.data[0],(n,i)=>{e[i]=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 i=this.getRowParent(e);return i==null?this.data.indexOf(n):i.__children.indexOf(n)}countAllRows(){const e={__children:this.data};return this.countChildren(e)}countChildren(e){let n=0,i=e;return isNaN(i)||(i=this.getDataObject(i)),!i||!i.__children?0:(M(i.__children,r=>{n+=1,r.__children&&(n+=this.countChildren(r))}),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 i;return((i=e.__children)===null||i===void 0?void 0:i[n])||null}isRowHighestLevel(e){return!this.isChild(e)}isParent(e){var n;let i=e;return isNaN(i)||(i=this.getDataObject(i)),i&&!!i.__children&&((n=i.__children)===null||n===void 0?void 0:n.length)!==0}addChild(e,n){let i=n;this.hot.runHooks("beforeAddChild",e,i);let r=null;e&&(r=this.getRowIndex(e)),this.hot.runHooks("beforeCreateRow",r+this.countChildren(e)+1,1);let s=e;e||(s=this.mockParent()),s.__children||(s.__children=[]),i||(i=this.mockNode()),s.__children.push(i),this.rewriteCache();const o=this.getRowIndex(i);this.hot.rowIndexMapper.insertIndexes(o,1),this.hot.runHooks("afterCreateRow",o,1),this.hot.runHooks("afterAddChild",e,i)}addChildAtIndex(e,n,i){let r=i,s;if(r||(r=this.mockNode()),this.hot.runHooks("beforeAddChild",e,r,n),e){const a=this.getRowIndex(e)+n+1;this.hot.runHooks("beforeCreateRow",a,1),e.__children.splice(n,null,r),this.rewriteCache(),this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(e),"__children",e.__children,"NestedRows.addChildAtIndex"),this.hot.rowIndexMapper.insertIndexes(a,1),this.plugin.enableCoreAPIModifiers(),this.hot.runHooks("afterCreateRow",a,1),s=a}else this.plugin.disableCoreAPIModifiers(),this.hot.alter("insert_row_above",n,1,"NestedRows.addChildAtIndex"),this.plugin.enableCoreAPIModifiers(),s=this.getRowIndex(this.data[n]);r=this.getDataObject(s),this.hot.runHooks("afterAddChild",e,r,n)}addSibling(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"below";const i=this.translateTrimmedRow(e),r=this.getRowParent(i),s=this.getRowIndexWithinParent(i);switch(n){case"below":this.addChildAtIndex(r,s+1,null);break;case"above":this.addChildAtIndex(r,s,null);break}}detachFromParent(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=null;const r=[];Array.isArray(e)?(me(e[0],e[2],d=>{const g=this.translateTrimmedRow(d);r.push(this.getDataObject(g))}),me(0,r.length-2,d=>{this.detachFromParent(r[d],!1)}),i=r[r.length-1]):i=e;const s=this.getRowIndex(i),o=this.countChildren(i),a=this.getRowIndexWithinParent(i),l=this.getRowParent(i),u=this.getRowParent(l),c=this.getRowIndex(u);let h=null;if(this.hot.runHooks("beforeDetachChild",l,i),a!=null){const d=Array.from(new Array(s+o+1).keys()).splice(-1*(o+1));if(this.hot.runHooks("beforeRemoveRow",s,o+1,d,this.plugin.pluginName),l.__children.splice(a,1),this.rewriteCache(),this.hot.runHooks("afterRemoveRow",s,o+1,d,this.plugin.pluginName),u){h=c+this.countChildren(u);const g=this.getChild(u,this.countChildren(u)-1),p=this.getRowIndex(g);this.hot.runHooks("beforeCreateRow",p+1,o+1,this.plugin.pluginName),u.__children.push(i)}else h=this.hot.countRows()+1,this.hot.runHooks("beforeCreateRow",h-2,o+1,this.plugin.pluginName),this.data.push(i)}this.rewriteCache(),this.hot.runHooks("afterCreateRow",h-2,o+1,this.plugin.pluginName),this.hot.runHooks("afterDetachChild",l,i,this.getRowIndex(i)),n&&this.hot.render()}filterData(e,n,i){const r=[];M(i,s=>{r.push(this.getDataObject(s))}),M(r,s=>{const o=this.getRowIndexWithinParent(s),a=this.getRowParent(s);a===null?this.data.splice(o,1):a.__children.splice(o,1)}),this.rewriteCache()}spliceData(e,n,i){const r=this.getDataObject(e-1);let s=null,o=e;r&&r.__children&&r.__children.length===0?(s=r,o=0):e<this.countAllRows()&&(s=this.getRowParent(e),o=this.getRowIndexWithinParent(e)),s?i?s.__children.splice(o,n,...i):s.__children.splice(o,n):i?this.data.splice(o,n,...i):this.data.splice(o,n),this.rewriteCache()}syncRowWithRawSource(e){let n=e,i=null;do i=this.getRowParent(i),i!==null&&(n=i);while(i!==null);this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndex(n),"__children",n.__children,"NestedRows.syncRowWithRawSource"),this.plugin.enableCoreAPIModifiers()}moveRow(e,n,i,r){const s=n===this.hot.countRows(),o=this.getRowParent(e),a=this.getRowIndexWithinParent(e),l=o.__children.slice(a,a+1),u=e>n;let c=s?this.getRowParent(n-1):this.getRowParent(n);c==null&&(c=this.getRowParent(n-1)),c==null&&(c=this.getDataObject(n-1)),c?c.__children||(c.__children=[]):(c=this.getDataObject(n),c.__children=[]);const h=s||i||r?c.__children.length:this.getRowIndexWithinParent(n),d=o===c;c.__children.splice(h,0,l[0]),o.__children.splice(a+(u&&d?1:0),1),this.syncRowWithRawSource(o),d||this.syncRowWithRawSource(c)}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 WM(t,e,n){return e=Rie(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rie(t){var e=Eie(t,"string");return typeof e=="symbol"?e:e+""}function Eie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class cR{constructor(e,n){WM(this,"hot",void 0),WM(this,"plugin",void 0),this.hot=n,this.plugin=e}}class zr extends cR{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 i=this.hot.toPhysicalRow(e),r=this.dataManager.getRowLevel(i),s=this.dataManager.getDataObject(i),o=n.getElementsByTagName("DIV")[0],a=o.querySelector("span.rowHeader"),l=o.querySelectorAll('[class^="ht_nesting"]'),u=this.hot.getSettings().ariaTags;if(M(l,c=>{c&&o.removeChild(c)}),q(n,zr.CSS_CLASSES.indicatorContainer),r){const{rootDocument:c}=this.hot,h=a.cloneNode(!0);o.innerHTML="",me(0,r-1,()=>{const d=c.createElement("SPAN");q(d,zr.CSS_CLASSES.emptyIndicator),o.appendChild(d)}),o.appendChild(h)}if(this.dataManager.hasChildren(s)){const c=this.hot.rootDocument.createElement("DIV");u&&Ee(c,[Us()]),q(n,zr.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(i)?(q(c,`${zr.CSS_CLASSES.button} ${zr.CSS_CLASSES.expandButton}`),u&&Ee(n,[ki(!1)])):(q(c,`${zr.CSS_CLASSES.button} ${zr.CSS_CLASSES.collapseButton}`),u&&Ee(n,[ki(!0)])),o.appendChild(c)}}updateRowHeaderWidth(e){let n=e;n||(n=this.dataManager.cache.levelCount),this.rowHeaderWidthCache=Math.max(50,11+10*n+25),this.hot.render()}}class Tie extends cR{constructor(e,n){var i;super(e,n),i=this,this.dataManager=this.plugin.dataManager,this.collapsedRows=[],this.collapsedRowsStash={stash:function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;i.lastCollapsedRows=i.collapsedRows.slice(0),i.expandMultipleChildren(i.lastCollapsedRows,r)},shiftStash:function(r,s){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;s==null&&(s=1/0),M(i.lastCollapsedRows,(a,l)=>{a>=r&&a<s&&(i.lastCollapsedRows[l]=a+o)})},applyStash:function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;i.collapseMultipleChildren(i.lastCollapsedRows,r),i.lastCollapsedRows=void 0},trimStash:(r,s)=>{me(r,r+s-1,o=>{const a=this.lastCollapsedRows.indexOf(o);a>-1&&this.lastCollapsedRows.splice(a,1)})}}}collapseChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const r=[];let s=null,o=null,a=null;return isNaN(e)?(s=e,o=this.dataManager.getRowIndex(s)):(s=this.dataManager.getDataObject(e),o=e),this.dataManager.hasChildren(s)&&M(s.__children,l=>{r.push(this.dataManager.getRowIndex(l))}),a=this.collapseRows(r,!0,!1),i&&this.trimRows(a),n&&this.renderAndAdjust(),this.collapsedRows.indexOf(o)===-1&&this.collapsedRows.push(o),a}collapseMultipleChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const r=[];M(e,s=>{r.push(...this.collapseChildren(s,!1,!1))}),i&&this.trimRows(r),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,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const r=[];return M(e,s=>{r.push(s),n&&this.collapseChildRows(s,r)}),i&&this.trimRows(r),r}collapseChildRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const r=this.dataManager.getDataObject(e);M(r.__children,s=>{const o=this.dataManager.getRowIndex(s);n.push(o),this.collapseChildRows(o,n)})}i&&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,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const r=[];return M(e,s=>{r.push(s),n&&this.expandChildRows(s,r)}),i&&this.untrimRows(r),r}expandChildRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const r=this.dataManager.getDataObject(e);M(r.__children,s=>{if(!this.isAnyParentCollapsed(s)){const o=this.dataManager.getRowIndex(s);n.push(o),this.expandChildRows(o,n)}})}i&&this.untrimRows(n)}expandChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const r=[];let s=null,o=null,a=null;return isNaN(e)?(s=e,o=this.dataManager.getRowIndex(e)):(s=this.dataManager.getDataObject(e),o=e),this.collapsedRows.splice(this.collapsedRows.indexOf(o),1),this.dataManager.hasChildren(s)&&M(s.__children,l=>{const u=this.dataManager.getRowIndex(l);r.push(u)}),a=this.expandRows(r,!0,!1),i&&this.untrimRows(a),n&&this.renderAndAdjust(),a}expandMultipleChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const r=[];M(e,s=>{r.push(...this.expandChildren(s,!1,!1))}),i&&this.untrimRows(r),n&&this.renderAndAdjust()}collapseAll(){const e=this.dataManager.getData(),n=[];M(e,i=>{this.dataManager.hasChildren(i)&&n.push(i)}),this.collapseMultipleChildren(n),this.renderAndAdjust()}expandAll(){const e=this.dataManager.getData(),n=[];M(e,i=>{this.dataManager.hasChildren(i)&&n.push(i)}),this.expandMultipleChildren(n),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution(()=>{M(e,n=>{this.plugin.collapsedRowsMap.setValueAtIndex(n,!0)})},!0)}untrimRows(e){this.hot.batchExecution(()=>{M(e,n=>{this.plugin.collapsedRowsMap.setValueAtIndex(n,!1)})},!0)}areChildrenCollapsed(e){let n=isNaN(e)?e:this.dataManager.getDataObject(e),i=!0;return n===null&&(n={__children:this.dataManager.data}),this.dataManager.hasChildren(n)&&M(n.__children,r=>{const s=this.dataManager.getRowIndex(r);if(!this.plugin.collapsedRowsMap.getValueAtIndex(s))return i=!1,!1}),i}isAnyParentCollapsed(e){let n=e;for(;n!==null;){n=this.dataManager.getRowParent(n);const i=this.dataManager.getRowIndex(n);if(this.collapsedRows.indexOf(i)>-1)return!0}return!1}toggleState(e,n){if(n.col>=0)return;const i=this.translateTrimmedRow(n.row);_e(e.target,zr.CSS_CLASSES.button)&&(this.areChildrenCollapsed(i)?this.expandChildren(i):this.collapseChildren(i),yr(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.render(),this.hot.view.adjustElementsSize()}}function Mie(t,e,n){_ie(t,e),e.set(t,n)}function _ie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Iie(t,e,n){return e=Pie(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pie(t){var e=Oie(t,"string");return typeof e=="symbol"?e:e+""}function Oie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xie(t,e){return t.get(Aie(t,e))}function Aie(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 BM=new WeakMap;class Hie extends cR{constructor(){super(...arguments),Iie(this,"dataManager",this.plugin.dataManager),Mie(this,BM,{row_above:(e,n)=>{const i=n[n.length-1];this.dataManager.addSibling(i.start.row,"above")},row_below:(e,n)=>{const i=n[n.length-1];this.dataManager.addSibling(i.start.row,"below")}})}appendOptions(e){const n=[{key:"add_child",name(){return this.getTranslatedPhrase(Yy)},callback:()=>{const i=this.dataManager.translateTrimmedRow(this.hot.getSelectedLast()[0]),r=this.dataManager.getDataObject(i);this.dataManager.addChild(r)},disabled:()=>{const i=this.hot.getSelectedLast();return!i||i[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{key:"detach_from_parent",name(){return this.getTranslatedPhrase(zy)},callback:()=>{this.dataManager.detachFromParent(this.hot.getSelectedLast())},disabled:()=>{const i=this.hot.getSelectedLast(),r=this.dataManager.translateTrimmedRow(i[0]);return!this.dataManager.getRowParent(r)||!i||i[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{name:"---------"}];return me(0,e.items.length-1,i=>{if(i===0)return M(n,(r,s)=>{e.items.splice(i+s,0,r)}),!1}),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return me(0,e.items.length-1,n=>{const i=xie(BM,this)[e.items[n].key];i!=null&&(e.items[n].callback=i)}),e}}function Mf(t,e,n){return e=Nie(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nie(t){var e=Die(t,"string");return typeof e=="symbol"?e:e+""}function Die(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Lie{constructor(e){Mf(this,"plugin",void 0),Mf(this,"hot",void 0),Mf(this,"dataManager",void 0),Mf(this,"collapsingUI",void 0),this.plugin=e,this.hot=e.hot,this.dataManager=e.dataManager,this.collapsingUI=e.collapsingUI}onBeforeRowMove(e,n,i,r){if(this.displayAPICompatibilityWarning({rows:e,finalIndex:n,dropIndex:i,movePossible:r}))return!1;this.movedToCollapsed=!1;const o=i===this.hot.countRows(),a=o?this.hot.countSourceRows():this.dataManager.translateTrimmedRow(i);let l=!0;const u=e.map(p=>{if(!l)return!1;const C=this.dataManager.translateTrimmedRow(p);return l=this.shouldAllowMoving(C,a),C}),c=u.indexOf(a)===-1;if(!l||!c)return!1;const h=this.getBaseParent(u),d=this.getTargetParent(o,a),g=h===d;return this.movedToCollapsed=this.collapsingUI.areChildrenCollapsed(d),this.collapsingUI.collapsedRowsStash.stash(),this.shiftCollapsibleParentsLocations(u,a,g),this.moveRows(u,a,d),this.dataManager.rewriteCache(),this.moveCellsMeta(u,a),this.collapsingUI.collapsedRowsStash.applyStash(!1),this.hot.runHooks("afterRowMove",e,n,i,r,r&&this.isRowOrderChanged(e,n)),this.hot.render(),this.selectCells(e,i),!1}displayAPICompatibilityWarning(e){const{rows:n,finalIndex:i,dropIndex:r,movePossible:s}=e;let o=!1;return Mt(r)&&(vt(ct`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,i,r,s,!1),o=!0),o}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 i=this.dataManager.getRowParent(e?n-1:n);return i==null&&(i=this.dataManager.getRowParent(n-1)),i}shiftCollapsibleParentsLocations(e,n,i){i||(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,i){const r=n===this.dataManager.getRowIndex(i)+this.dataManager.countChildren(i)+1;this.hot.batchRender(()=>{e.forEach(s=>{this.dataManager.moveRow(s,n,this.movedToCollapsed,r)})})}moveCellsMeta(e,n){const i=[],r=Math.max(...e)<n;e.forEach(s=>{i.push(this.hot.getCellMetaAtRow(s))}),this.hot.spliceCellsMeta(e[0],e.length),this.hot.spliceCellsMeta(n-(r?i.length:0),0,...i)}selectCells(e,n){const i=e.length;let r=0,s=0,o=null,a=null;if(this.movedToCollapsed){let l=null;e[i-1]<n?l=this.dataManager.translateTrimmedRow(n-i):l=this.dataManager.translateTrimmedRow(n);const u=this.dataManager.getRowParent(l===null?this.hot.countSourceRows()-1:l-1),c=this.dataManager.getRowIndex(u);r=this.dataManager.untranslateTrimmedRow(c),s=r}else e[i-1]<n?(s=n-1,r=s-i+1):(r=n,s=r+i-1);o=this.hot.selection,a=this.hot.countCols()-1,o.setRangeStart(this.hot._createCellCoords(r,0)),o.setRangeEnd(this.hot._createCellCoords(s,a),!0)}isRowOrderChanged(e,n){return e.some((i,r)=>i-r!==n)}}function $ie(t,e){RA(t,e),e.add(t)}function UM(t,e,n){RA(t,e),e.set(t,n)}function RA(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mC(t,e,n){return e=kie(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kie(t){var e=Fie(t,"string");return typeof e=="symbol"?e:e+""}function Fie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Qf(t,e){return t.get(an(t,e))}function Yg(t,e,n){return t.set(an(t,e),n),n}function an(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 zg="nestedRows",Vie=300,YM=zg,Wie="The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled.";var Ym=new WeakMap,Dl=new WeakMap,fn=new WeakSet;class Bie extends ut{constructor(){super(...arguments),$ie(this,fn),mC(this,"dataManager",null),mC(this,"headersUI",null),mC(this,"collapsedRowsMap",null),UM(this,Ym,!1),UM(this,Dl,!1)}static get PLUGIN_KEY(){return zg}static get PLUGIN_PRIORITY(){return Vie}isEnabled(){return!!this.hot.getSettings()[zg]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new Lh),this.dataManager=new bie(this,this.hot),this.collapsingUI=new Tie(this,this.hot),this.headersUI=new zr(this,this.hot),this.contextMenuUI=new Hie(this,this.hot),this.rowMoveController=new Lie(this),this.addHook("afterInit",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return an(fn,e,nre).call(e,...i)}),this.addHook("beforeViewRender",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return an(fn,e,ire).call(e,...i)}),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,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return an(fn,e,zie).call(e,...i)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return an(fn,e,Gie).call(e,...i)}),this.addHook("afterGetRowHeader",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return an(fn,e,jie).call(e,...i)}),this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return an(fn,e,Yie).call(e,...i)}),this.addHook("beforeRemoveRow",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return an(fn,e,qie).call(e,...i)}),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return an(fn,e,Xie).call(e,...i)}),this.addHook("beforeAddChild",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return an(fn,e,Zie).call(e,...i)}),this.addHook("afterAddChild",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return an(fn,e,Qie).call(e,...i)}),this.addHook("beforeDetachChild",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return an(fn,e,Jie).call(e,...i)}),this.addHook("afterDetachChild",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return an(fn,e,ere).call(e,...i)}),this.addHook("modifyRowHeaderWidth",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return an(fn,e,Kie).call(e,...i)}),this.addHook("afterCreateRow",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return an(fn,e,tre).call(e,...i)}),this.addHook("beforeRowMove",function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return an(fn,e,Uie).call(e,...i)}),this.addHook("beforeLoadData",n=>an(fn,this,zM).call(this,n)),this.addHook("beforeUpdateData",n=>an(fn,this,zM).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.getSelectedRangeLast(),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 i=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return i&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(i)&&i.col===-1&&i.row>=0},group:YM,relativeToGroup:ko,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(YM)}disableCoreAPIModifiers(){Yg(Dl,this,!0)}enableCoreAPIModifiers(){Yg(Dl,this,!1)}onModifyRowData(e){if(!Qf(Dl,this))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!Qf(Dl,this))return this.dataManager.countAllRows()}onBeforeDataSplice(e,n,i){return Qf(Dl,this)||this.dataManager.isRowHighestLevel(e)?!0:(this.dataManager.spliceData(e,n,i),!1)}destroy(){super.destroy()}}function Uie(t,e,n,i){return this.rowMoveController.onBeforeRowMove(t,e,n,i)}function Yie(t,e,n){this.collapsingUI.toggleState(t,e,n)}function zie(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),Yg(Ym,this,!0),this.dataManager.getData().slice()}function Gie(t){return this.contextMenuUI.appendOptions(t)}function jie(t,e){this.headersUI.appendLevelIndicators(t,e)}function Kie(t){return Math.max(this.headersUI.rowHeaderWidthCache,t)}function Xie(t,e,n,i){i!==this.pluginName&&this.hot._registerTimeout(()=>{Yg(Ym,this,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()})}function qie(t,e,n){const i=Array.from(n.reduce((r,s)=>{if(this.dataManager.isParent(s)){const o=this.dataManager.getDataObject(s).__children;return r.add(s),Array.isArray(o)&&o.forEach(a=>r.add(this.dataManager.getRowIndex(a))),r}return r.add(s)},new Set));n.length=0,n.push(...i)}function Zie(){this.collapsingUI.collapsedRowsStash.stash()}function Qie(t,e){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(e)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function Jie(){this.collapsingUI.collapsedRowsStash.stash()}function ere(t,e,n){this.collapsingUI.collapsedRowsStash.shiftStash(n,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function tre(){this.dataManager.rewriteCache()}function nre(){this.headersUI.updateRowHeaderWidth()}function ire(t,e){Qf(Ym,this)&&(e.skipRender=!0)}function zM(t){if(!qj(t)){OS(Wie),this.hot.getSettings()[zg]=!1,this.disablePlugin();return}this.dataManager.setData(t),this.dataManager.rewriteCache()}function pC(t,e,n){return e=rre(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rre(t){var e=sre(t,"string");return typeof e=="symbol"?e:e+""}function sre(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ore{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;pC(this,"rootWindow",void 0),pC(this,"prefix",void 0),pC(this,"savedKeys",[]),this.rootWindow=n,this.prefix=e,this.loadSavedKeys()}saveValue(e,n){this.rootWindow.localStorage.setItem(`${this.prefix}_${e}`,JSON.stringify(n)),this.savedKeys.indexOf(e)===-1&&(this.savedKeys.push(e),this.saveSavedKeys())}loadValue(e,n){const i=typeof e>"u"?n:e,r=this.rootWindow.localStorage.getItem(`${this.prefix}_${i}`);return r===null?void 0:JSON.parse(r)}reset(e){this.rootWindow.localStorage.removeItem(`${this.prefix}_${e}`)}resetAll(){M(this.savedKeys,(e,n)=>{this.rootWindow.localStorage.removeItem(`${this.prefix}_${this.savedKeys[n]}`)}),this.clearSavedKeys()}loadSavedKeys(){const e=this.rootWindow.localStorage.getItem(`${this.prefix}__persistentStateKeys`),n=typeof e=="string"?JSON.parse(e):void 0;this.savedKeys=n||[]}saveSavedKeys(){this.rootWindow.localStorage.setItem(`${this.prefix}__persistentStateKeys`,JSON.stringify(this.savedKeys))}clearSavedKeys(){this.savedKeys.length=0,this.saveSavedKeys()}}function are(t,e,n){return e=lre(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lre(t){var e=ure(t,"string");return typeof e=="symbol"?e:e+""}function ure(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}ce.getSingleton().register("persistentStateSave");ce.getSingleton().register("persistentStateLoad");ce.getSingleton().register("persistentStateReset");const GM="persistentState",cre=0;class hre extends ut{constructor(){super(...arguments),are(this,"storage",void 0)}static get PLUGIN_KEY(){return GM}static get PLUGIN_PRIORITY(){return cre}isEnabled(){return!!this.hot.getSettings()[GM]}enablePlugin(){this.enabled||(this.storage||(this.storage=new ore(this.hot.rootElement.id,this.hot.rootWindow)),this.addHook("persistentStateSave",(e,n)=>this.saveValue(e,n)),this.addHook("persistentStateLoad",(e,n)=>this.loadValue(e,n)),this.addHook("persistentStateReset",()=>this.resetValue()),super.enablePlugin())}disablePlugin(){this.storage=void 0,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}loadValue(e,n){n.value=this.storage.loadValue(e)}saveValue(e,n){this.storage.saveValue(e,n)}resetValue(e){typeof e>"u"?this.storage.resetAll():this.storage.reset(e)}destroy(){super.destroy()}}function dre(t,e){fre(t,e),e.add(t)}function fre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wC(t,e,n){return e=gre(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gre(t){var e=mre(t,"string");return typeof e=="symbol"?e:e+""}function mre(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jM(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 CC="search",pre=190,wre="htSearchResult",Cre=function(t,e,n,i,r){t.getCellMeta(e,n).isSearchResult=r},vre=function(t,e,n){return Mt(t)||t===null||!t.toLocaleLowerCase||t.length===0||Mt(e)||e===null?!1:e.toString().toLocaleLowerCase(n.locale).indexOf(t.toLocaleLowerCase(n.locale))!==-1};var vC=new WeakSet;class Sre extends ut{constructor(){super(...arguments),dre(this,vC),wC(this,"callback",Cre),wC(this,"queryMethod",vre),wC(this,"searchResultClass",wre)}static get PLUGIN_KEY(){return CC}static get PLUGIN_PRIORITY(){return pre}isEnabled(){return this.hot.getSettings()[CC]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[CC];this.updatePluginSettings(n),this.addHook("beforeRenderer",function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return jM(vC,e,KM).call(e,...r)}),super.enablePlugin()}disablePlugin(){var e=this;const n=function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];return jM(vC,e,KM).call(e,...r)};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(),i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.getQueryMethod();const r=this.hot.countRows(),s=this.hot.countCols(),o=[],a=this.hot;return me(0,r-1,l=>{me(0,s-1,u=>{const c=this.hot.getDataAtCell(l,u),h=this.hot.getCellMeta(l,u),d=h.search.callback||n,p=(h.search.queryMethod||i)(e,c,h);if(p){const C={row:l,col:u,data:c};o.push(C)}d&&d(a,l,u,c,p)})}),o}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){ke(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}}function KM(t,e,n,i,r,s){const o=s.className||[];let a=[];typeof o=="string"?a=o.split(" "):a.push(...o),this.isEnabled()&&s.isSearchResult?a.includes(this.searchResultClass)||a.push(`${this.searchResultClass}`):a.includes(this.searchResultClass)&&a.splice(a.indexOf(this.searchResultClass),1),s.className=a.join(" ")}function yre(t,e){bre(t,e),e.add(t)}function bre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _f(t,e,n){return e=Rre(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rre(t){var e=Ere(t,"string");return typeof e=="symbol"?e:e+""}function Ere(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function SC(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 Tre="touchScroll",Mre=200;var If=new WeakSet;class _re extends ut{constructor(){super(...arguments),yre(this,If),_f(this,"scrollbars",[]),_f(this,"clones",[]),_f(this,"lockedCollection",!1),_f(this,"freezeOverlays",!1)}static get PLUGIN_KEY(){return Tre}static get PLUGIN_PRIORITY(){return Mre}static get SETTING_KEYS(){return!0}isEnabled(){return gP()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",()=>SC(If,this,Ire).call(this)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",()=>SC(If,this,Pre).call(this)),this.addHook("afterMomentumScroll",()=>SC(If,this,Ore).call(this))}}function Ire(){if(this.lockedCollection)return;const{topOverlay:t,bottomOverlay:e,inlineStartOverlay:n,topInlineStartCornerOverlay:i,bottomInlineStartCornerOverlay:r}=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),i&&this.scrollbars.push(i),r&&r.clone&&this.scrollbars.push(r),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),i&&this.clones.push(i.clone.wtTable.holder.parentNode),r&&r.clone&&this.clones.push(r.clone.wtTable.holder.parentNode)}function Pre(){this.freezeOverlays=!0,M(this.clones,t=>{q(t,"hide-tween")})}function Ore(){this.freezeOverlays=!1,M(this.clones,t=>{He(t,"hide-tween"),q(t,"show-tween")}),this.hot._registerTimeout(()=>{M(this.clones,t=>{He(t,"show-tween")})},400),M(this.scrollbars,t=>{t.refresh(),t.resetFixedPosition()}),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}function xre(t,e){Are(t,e),e.add(t)}function Are(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 e=Nre(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nre(t){var e=Dre(t,"string");return typeof e=="symbol"?e:e+""}function Dre(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Lre(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 Jf="trimRows",$re=330;var XM=new WeakSet;class kre extends ut{constructor(){super(...arguments),xre(this,XM),Hre(this,"trimmedRowsMap",null)}static get PLUGIN_KEY(){return Jf}static get PLUGIN_PRIORITY(){return $re}isEnabled(){return!!this.hot.getSettings()[Jf]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new Lh),this.trimmedRowsMap.addLocalHook("init",()=>Lre(XM,this,Fre).call(this)),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[Jf];Array.isArray(e)&&this.hot.batchExecution(()=>{this.trimmedRowsMap.clear(),M(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(),i=this.isValidConfig(e);let r=n;i&&(r=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeTrimRow",n,r,i)!==!1&&(i&&this.hot.batchExecution(()=>{M(e,o=>{this.trimmedRowsMap.setValueAtIndex(o,!0)})},!0),this.hot.runHooks("afterTrimRow",n,r,i,i&&r.length>n.length))}trimRow(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];this.trimRows(n)}untrimRows(e){const n=this.getTrimmedRows(),i=this.isValidConfig(e);let r=n;const s=this.trimmedRowsMap.getValues().slice(),o=e.length>0;i&&o&&(M(e,l=>{s[l]=!1}),r=Hn(s,(l,u,c)=>(u&&l.push(c),l),[])),this.hot.runHooks("beforeUntrimRow",n,r,i&&o)!==!1&&(i&&o&&this.trimmedRowsMap.setValues(s),this.hot.runHooks("afterUntrimRow",n,r,i&&o,i&&r.length<n.length))}untrimRow(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];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(i=>Number.isInteger(i)&&i>=0&&i<n)}destroy(){super.destroy()}}function Fre(){const t=this.hot.getSettings()[Jf];Array.isArray(t)&&this.hot.batchExecution(()=>{M(t,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0)}var EA={},Vre=No,Wre=EA,Bre=Vre("iterator"),Ure=Array.prototype,Yre=function(t){return t!==void 0&&(Wre.Array===t||Ure[Bre]===t)},zre=__,qM=Jg,Gre=Kg,jre=EA,Kre=No,Xre=Kre("iterator"),TA=function(t){if(!Gre(t))return qM(t,Xre)||qM(t,"@@iterator")||jre[zre(t)]},qre=vr,Zre=Ch,Qre=Vs,Jre=Qg,ese=TA,tse=TypeError,nse=function(t,e){var n=arguments.length<2?ese(t):e;if(Zre(n))return Qre(qre(n,t));throw new tse(Jre(t)+" is not iterable")},ise=U_,rse=vr,sse=Vs,ose=Qg,ase=Yre,lse=yh,ZM=Zg,use=nse,cse=TA,QM=zv,hse=TypeError,eg=function(t,e){this.stopped=t,this.result=e},JM=eg.prototype,dse=function(t,e,n){var i=n&&n.that,r=!!(n&&n.AS_ENTRIES),s=!!(n&&n.IS_RECORD),o=!!(n&&n.IS_ITERATOR),a=!!(n&&n.INTERRUPTED),l=ise(e,i),u,c,h,d,g,p,C,S=function(R){return u&&QM(u,"normal",R),new eg(!0,R)},b=function(R){return r?(sse(R),a?l(R[0],R[1],S):l(R[0],R[1])):a?l(R,S):l(R)};if(s)u=t.iterator;else if(o)u=t;else{if(c=cse(t),!c)throw new hse(ose(t)+" is not iterable");if(ase(c)){for(h=0,d=lse(t);d>h;h++)if(g=b(t[h]),g&&ZM(JM,g))return g;return new eg(!1)}u=use(t,c)}for(p=s?t.next:u.next;!(C=rse(p,u)).done;){try{g=b(C.value)}catch(R){QM(u,"throw",R)}if(typeof g=="object"&&g&&ZM(JM,g))return g}return new eg(!1)},fse=Cr,gse=Do,mse=jg,pse=function(t,e,n){fse?gse.f(t,e,mse(0,n)):t[e]=n},wse=An,Cse=dse,vse=pse;wse({target:"Object",stat:!0},{fromEntries:function(e){var n={};return Cse(e,function(i,r){vse(n,i,r)},{AS_ENTRIES:!0}),n}});const MA="undoRedo",Sse="undoRedo";function re(t){const e=this;this.instance=t,this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,this.enabled=!1,t.addHook("afterChange",function(i,r){const s=i&&i.length;if(!s||!i.find(l=>{const[,,u,c]=l;return u!==c}))return;const a=()=>{const l=i.reduce((c,h)=>(c.push([...h]),c),[]);M(l,c=>{c[1]=t.propToCol(c[1])});const u=s>1?this.getSelected():[[l[0][0],l[0][1]]];return new re.ChangeAction(l,u)};e.done(a,r)}),t.addHook("afterCreateRow",(i,r,s)=>{e.done(()=>new re.CreateRowAction(i,r),s)});const n=(i,r,s,o)=>{const a=["visualRow","visualCol","row","col","prop"],l=a.length,u=[];return me(s,o,c=>{me(i,r,h=>{const d=t.getCellMeta(h,c);if(Object.keys(d).length!==l){const g=Object.fromEntries(Object.entries(d).filter(p=>{let[C]=p;return a.includes(C)===!1}));u.push([d.visualRow,d.visualCol,g])}})}),u};t.addHook("beforeRemoveRow",(i,r,s,o)=>{const a=()=>{const l=t.toPhysicalRow(i),u=l+r-1,c=Yn(e.instance.getSourceData(l,0,l+r-1,e.instance.countSourceCols()-1));return new re.RemoveRowAction(l,c,t.getSettings().fixedRowsBottom,t.getSettings().fixedRowsTop,t.rowIndexMapper.getIndexesSequence(),n(l,u,0,t.countCols()-1))};e.done(a,o)}),t.addHook("afterCreateCol",(i,r,s)=>{e.done(()=>new re.CreateColumnAction(i,r),s)}),t.addHook("beforeRemoveCol",(i,r,s,o)=>{const a=()=>{const l=e.instance.getSourceDataArray(),u=(e.instance.countCols()+i)%e.instance.countCols(),c=u+r-1,h=[],d=[],g=[];me(l.length-1,S=>{const b=[],R=l[S];me(u,c,E=>{b.push(R[t.toPhysicalColumn(E)])}),h.push(b)}),me(r-1,S=>{g.push(t.toPhysicalColumn(u+S))}),Array.isArray(t.getSettings().colHeaders)&&me(r-1,S=>{d.push(t.getSettings().colHeaders[t.toPhysicalColumn(u+S)]||null)});const p=t.columnIndexMapper.getIndexesSequence(),C=t.rowIndexMapper.getIndexesSequence();return new re.RemoveColumnAction(u,g,h,d,p,C,t.getSettings().fixedColumnsStart,n(0,t.countRows(),u,c))};e.done(a,o)}),t.addHook("beforeCellAlignment",(i,r,s,o)=>{e.done(()=>new re.CellAlignmentAction(i,r,s,o))}),t.addHook("beforeFilter",i=>{e.done(()=>new re.FiltersAction(i))}),t.addHook("beforeRowMove",(i,r)=>{i!==!1&&e.done(()=>new re.RowMoveAction(i,r))}),t.addHook("beforeColumnMove",(i,r)=>{i!==!1&&e.done(()=>new re.ColumnMoveAction(i,r))}),t.addHook("beforeMergeCells",(i,r)=>{r||e.done(()=>new re.MergeCellsAction(t,i))}),t.addHook("afterUnmergeCells",(i,r)=>{r||e.done(()=>new re.UnmergeCellsAction(t,i))}),t.addHook("afterInit",()=>{e.init()})}re.prototype.done=function(t,e){if(this.ignoreNewActions||e==="UndoRedo.undo"||e==="UndoRedo.redo"||e==="auto")return;const i=this.doneActions.slice();if(this.instance.runHooks("beforeUndoStackChange",i,e)===!1)return;const s=t(),o=this.undoneActions.slice();this.doneActions.push(s),this.instance.runHooks("afterUndoStackChange",i,this.doneActions.slice()),this.instance.runHooks("beforeRedoStackChange",o),this.undoneActions.length=0,this.instance.runHooks("afterRedoStackChange",o,this.undoneActions.slice())};re.prototype.undo=function(){if(this.isUndoAvailable()){const t=this.doneActions.slice();this.instance.runHooks("beforeUndoStackChange",t);const e=this.doneActions.pop();this.instance.runHooks("afterUndoStackChange",t,this.doneActions.slice());const n=Yn(e);if(this.instance.runHooks("beforeUndo",n)===!1)return;this.ignoreNewActions=!0;const r=this,s=this.undoneActions.slice();this.instance.runHooks("beforeRedoStackChange",s),e.undo(this.instance,()=>{r.ignoreNewActions=!1,r.undoneActions.push(e)}),this.instance.runHooks("afterRedoStackChange",s,this.undoneActions.slice()),this.instance.runHooks("afterUndo",n)}};re.prototype.redo=function(){if(this.isRedoAvailable()){const t=this.undoneActions.slice();this.instance.runHooks("beforeRedoStackChange",t);const e=this.undoneActions.pop();this.instance.runHooks("afterRedoStackChange",t,this.undoneActions.slice());const n=Yn(e);if(this.instance.runHooks("beforeRedo",n)===!1)return;this.ignoreNewActions=!0;const r=this,s=this.doneActions.slice();this.instance.runHooks("beforeUndoStackChange",s),e.redo(this.instance,()=>{r.ignoreNewActions=!1,r.doneActions.push(e)}),this.instance.runHooks("afterUndoStackChange",s,this.doneActions.slice()),this.instance.runHooks("afterRedo",n)}};re.prototype.isUndoAvailable=function(){return this.doneActions.length>0};re.prototype.isRedoAvailable=function(){return this.undoneActions.length>0};re.prototype.clear=function(){this.doneActions.length=0,this.undoneActions.length=0};re.prototype.isEnabled=function(){return this.enabled};re.prototype.enable=function(){if(this.isEnabled())return;const t=this.instance;this.enabled=!0,Rse(t),this.registerShortcuts(),t.addHook("afterChange",_A)};re.prototype.disable=function(){if(!this.isEnabled())return;const t=this.instance;this.enabled=!1,Ese(t),this.unregisterShortcuts(),t.removeHook("afterChange",_A)};re.prototype.destroy=function(){this.clear(),this.instance=null,this.doneActions=null,this.undoneActions=null};re.Action=function(){};re.Action.prototype.undo=function(){};re.Action.prototype.redo=function(){};re.ChangeAction=function(t,e){this.changes=t,this.selected=e,this.actionType="change"};Ys(re.ChangeAction,re.Action);re.ChangeAction.prototype.undo=function(t,e){const n=Yn(this.changes),i=t.countEmptyRows(!0),r=t.countEmptyCols(!0);for(let o=0,a=n.length;o<a;o++)n[o].splice(3,1);t.addHookOnce("afterChange",e),t.setDataAtCell(n,null,null,"UndoRedo.undo");for(let o=0,a=n.length;o<a;o++){const[l,u]=n[o];t.getSettings().minSpareRows&&l+1+t.getSettings().minSpareRows===t.countRows()&&i===t.getSettings().minSpareRows&&(t.alter("remove_row",parseInt(l+1,10),t.getSettings().minSpareRows),t.undoRedo.doneActions.pop()),t.getSettings().minSpareCols&&u+1+t.getSettings().minSpareCols===t.countCols()&&r===t.getSettings().minSpareCols&&(t.alter("remove_col",parseInt(u+1,10),t.getSettings().minSpareCols),t.undoRedo.doneActions.pop())}const s=t.getSelectedLast();if(s!==void 0){const[o,a]=n[0],[l,u]=s,c=t.view.getFirstFullyVisibleRow(),h=t.view.getFirstFullyVisibleColumn(),d=o>=c,g=a>=h;if((d&&g)===!1&&(l!==o||u!==a)===!0){const S={row:o,col:a};d===!1&&(S.verticalSnap="top"),g===!1&&(S.horizontalSnap="start"),t.scrollViewportTo(S)}}t.selectCells(this.selected,!1,!1)};re.ChangeAction.prototype.redo=function(t,e){const n=Yn(this.changes);for(let i=0,r=n.length;i<r;i++)n[i].splice(2,1);t.addHookOnce("afterChange",e),t.setDataAtCell(n,null,null,"UndoRedo.redo"),this.selected&&t.selectCells(this.selected,!1,!1)};re.CreateRowAction=function(t,e){this.index=t,this.amount=e,this.actionType="insert_row"};Ys(re.CreateRowAction,re.Action);re.CreateRowAction.prototype.undo=function(t,e){const n=t.countRows(),i=t.getSettings().minSpareRows;this.index>=n&&this.index-i<n&&(this.index-=i),t.addHookOnce("afterRemoveRow",e),t.alter("remove_row",this.index,this.amount,"UndoRedo.undo")};re.CreateRowAction.prototype.redo=function(t,e){t.addHookOnce("afterCreateRow",e),t.alter("insert_row_above",this.index,this.amount,"UndoRedo.redo")};re.RemoveRowAction=function(t,e,n,i,r,s){this.index=t,this.data=e,this.actionType="remove_row",this.fixedRowsBottom=n,this.fixedRowsTop=i,this.rowIndexesSequence=r,this.removedCellMetas=s};Ys(re.RemoveRowAction,re.Action);re.RemoveRowAction.prototype.undo=function(t,e){const n=t.getSettings(),i=[];n.fixedRowsBottom=this.fixedRowsBottom,n.fixedRowsTop=this.fixedRowsTop,this.data.forEach((r,s)=>{Object.keys(r).forEach(o=>{const a=parseInt(o,10);i.push([this.index+s,isNaN(a)?o:a,r[o]])})}),t.alter("insert_row_above",this.index,this.data.length,"UndoRedo.undo"),this.removedCellMetas.forEach(r=>{let[s,o,a]=r;t.setCellMetaObject(s,o,a)}),t.addHookOnce("afterViewRender",e),t.setSourceDataAtCell(i,null,null,"UndoRedo.undo"),t.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence)};re.RemoveRowAction.prototype.redo=function(t,e){t.addHookOnce("afterRemoveRow",e),t.alter("remove_row",this.index,this.data.length,"UndoRedo.redo")};re.CreateColumnAction=function(t,e){this.index=t,this.amount=e,this.actionType="insert_col"};Ys(re.CreateColumnAction,re.Action);re.CreateColumnAction.prototype.undo=function(t,e){t.addHookOnce("afterRemoveCol",e),t.alter("remove_col",this.index,this.amount,"UndoRedo.undo")};re.CreateColumnAction.prototype.redo=function(t,e){t.addHookOnce("afterCreateCol",e),t.alter("insert_col_start",this.index,this.amount,"UndoRedo.redo")};re.RemoveColumnAction=function(t,e,n,i,r,s,o,a){this.index=t,this.indexes=e,this.data=n,this.amount=this.data[0].length,this.headers=i,this.columnPositions=r.slice(0),this.rowPositions=s.slice(0),this.actionType="remove_col",this.fixedColumnsStart=o,this.removedCellMetas=a};Ys(re.RemoveColumnAction,re.Action);re.RemoveColumnAction.prototype.undo=function(t,e){const n=t.getSettings();n.fixedColumnsStart=this.fixedColumnsStart;const i=this.indexes.slice(0).sort(),r=(u,c,h)=>h[this.indexes.indexOf(i[c])],s=this.data.length,o=[];for(let u=0;u<s;u++)o.push(Ke(this.data[u],r));const a=Ke(this.headers,r),l=[];t.alter("insert_col_start",this.indexes[0],this.indexes.length,"UndoRedo.undo"),M(t.getSourceDataArray(),(u,c)=>{M(i,(h,d)=>{u[h]=o[c][d],l.push([c,h,u[h]])})}),t.setSourceDataAtCell(l,void 0,void 0,"UndoRedo.undo"),typeof this.headers<"u"&&M(a,(u,c)=>{t.getSettings().colHeaders[i[c]]=u}),this.removedCellMetas.forEach(u=>{let[c,h,d]=u;t.setCellMetaObject(c,h,d)}),t.batchExecution(()=>{t.rowIndexMapper.setIndexesSequence(this.rowPositions),t.columnIndexMapper.setIndexesSequence(this.columnPositions)},!0),t.addHookOnce("afterViewRender",e),t.render()};re.RemoveColumnAction.prototype.redo=function(t,e){t.addHookOnce("afterRemoveCol",e),t.alter("remove_col",this.index,this.amount,"UndoRedo.redo")};re.CellAlignmentAction=function(t,e,n,i){this.stateBefore=t,this.range=e,this.type=n,this.alignment=i};re.CellAlignmentAction.prototype.undo=function(t,e){M(this.range,n=>{n.forAll((i,r)=>{i>=0&&r>=0&&t.setCellMeta(i,r,"className",this.stateBefore[i][r]||" htLeft")})}),t.addHookOnce("afterViewRender",e),t.render()};re.CellAlignmentAction.prototype.redo=function(t,e){lo(this.range,this.type,this.alignment,(n,i)=>t.getCellMeta(n,i),(n,i,r,s)=>t.setCellMeta(n,i,r,s)),t.addHookOnce("afterViewRender",e),t.render()};re.FiltersAction=function(t){this.conditionsStack=t,this.actionType="filter"};Ys(re.FiltersAction,re.Action);re.FiltersAction.prototype.undo=function(t,e){const n=t.getPlugin("filters");t.addHookOnce("afterViewRender",e),n.conditionCollection.importAllConditions(this.conditionsStack.slice(0,this.conditionsStack.length-1)),n.filter()};re.FiltersAction.prototype.redo=function(t,e){const n=t.getPlugin("filters");t.addHookOnce("afterViewRender",e),n.conditionCollection.importAllConditions(this.conditionsStack),n.filter()};class yse extends re.Action{constructor(e,n){super(),this.cellRange=n;const i=this.cellRange.getTopStartCorner(),r=this.cellRange.getBottomEndCorner();this.rangeData=e.getData(i.row,i.col,r.row,r.col)}undo(e,n){const i=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),i.unmergeRange(this.cellRange,!0);const r=this.cellRange.getTopStartCorner();e.populateFromArray(r.row,r.col,this.rangeData,void 0,void 0,"MergeCells")}redo(e,n){const i=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),i.mergeRange(this.cellRange)}}re.MergeCellsAction=yse;class bse extends re.Action{constructor(e,n){super(),this.cellRange=n}undo(e,n){const i=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),i.mergeRange(this.cellRange,!0)}redo(e,n){const i=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),i.unmergeRange(this.cellRange,!0),e.render()}}re.UnmergeCellsAction=bse;re.RowMoveAction=function(t,e){this.rows=t.slice(),this.finalRowIndex=e,this.actionType="row_move"};Ys(re.RowMoveAction,re.Action);re.RowMoveAction.prototype.undo=function(t,e){const n=t.getPlugin("manualRowMove");t.addHookOnce("afterViewRender",e),rR(this.rows,this.finalRowIndex,t.rowIndexMapper.getNumberOfIndexes()).reverse().forEach(r=>{let{from:s,to:o}=r;s<o&&(o-=1),n.moveRow(o,s)}),t.render(),t.deselectCell(),t.selectRows(this.rows[0],this.rows[0]+this.rows.length-1)};re.RowMoveAction.prototype.redo=function(t,e){const n=t.getPlugin("manualRowMove");t.addHookOnce("afterViewRender",e),n.moveRows(this.rows.slice(),this.finalRowIndex),t.render(),t.deselectCell(),t.selectRows(this.finalRowIndex,this.finalRowIndex+this.rows.length-1)};re.ColumnMoveAction=function(t,e){this.columns=t.slice(),this.finalColumnIndex=e,this.actionType="col_move"};Ys(re.ColumnMoveAction,re.Action);re.ColumnMoveAction.prototype.undo=function(t,e){const n=t.getPlugin("manualColumnMove");t.addHookOnce("afterViewRender",e),rR(this.columns,this.finalColumnIndex,t.columnIndexMapper.getNumberOfIndexes()).reverse().forEach(r=>{let{from:s,to:o}=r;s<o&&(o-=1),n.moveColumn(o,s)}),t.render(),t.deselectCell(),t.selectColumns(this.columns[0],this.columns[0]+this.columns.length-1)};re.ColumnMoveAction.prototype.redo=function(t,e){const n=t.getPlugin("manualColumnMove");t.addHookOnce("afterViewRender",e),n.moveColumns(this.columns.slice(),this.finalColumnIndex),t.render(),t.deselectCell(),t.selectColumns(this.finalColumnIndex,this.finalColumnIndex+this.columns.length-1)};re.prototype.init=function(){const t=this.instance.getSettings().undo,e=typeof t>"u"||t;this.instance.undoRedo||(this.instance.undoRedo=this),e?this.instance.undoRedo.enable():this.instance.undoRedo.disable()};re.prototype.registerShortcuts=function(){const e=this.instance.getShortcutManager().getContext("grid"),i={runOnlyIf:r=>!r.altKey,group:MA};e.addShortcuts([{keys:[["Control/Meta","z"]],callback:()=>{this.undo()}},{keys:[["Control/Meta","y"],["Control/Meta","Shift","z"]],callback:()=>{this.redo()}}],i)};re.prototype.unregisterShortcuts=function(){this.instance.getShortcutManager().getContext("grid").removeShortcutsByGroup(MA)};function _A(t,e){const n=this;if(e==="loadData")return n.undoRedo.clear()}function Rse(t){t.undo=function(){return t.undoRedo.undo()},t.redo=function(){return t.undoRedo.redo()},t.isUndoAvailable=function(){return t.undoRedo.isUndoAvailable()},t.isRedoAvailable=function(){return t.undoRedo.isRedoAvailable()},t.clearUndo=function(){return t.undoRedo.clear()}}function Ese(t){delete t.undo,delete t.redo,delete t.isUndoAvailable,delete t.isRedoAvailable,delete t.clearUndo}const zh=ce.getSingleton();zh.add("afterUpdateSettings",function(){var t;(t=this.getPlugin("undoRedo"))===null||t===void 0||t.init()});zh.register("beforeUndo");zh.register("afterUndo");zh.register("beforeRedo");zh.register("afterRedo");re.PLUGIN_KEY=Sse;re.SETTING_KEYS=!0;function Tse(){rt(Lc),rt(h6),rt($c),rt(W6),rt(X6),rt(tx),rt(U9),rt(M7),rt(km),rt(z8),rt(w5),rt(T5),rt(Wm),rt(J5),rt(ZQ),rt(IJ),rt(eee),rt(hee),rt(Ree),rt(Nee),rt(Yee),rt(lte),rt(wte),rt(Gte),rt(Tne),rt(One),rt(nie),rt(Bie),rt(hre),rt(Sre),rt(_re),rt(kre),rt(re)}function Yse(){F4(),iq(),dq(),Aq(),Tse()}export{ls as H,Ec as a,Kh as c,xA as g,Yse as r};
|