index-n0gERvBg.js 1.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. var vF=Object.defineProperty;var CF=(t,e,r)=>e in t?vF(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var ln=(t,e,r)=>CF(t,typeof e!="symbol"?e+"":e,r);import{c5 as Ig,c6 as Od,ae as lx,bI as SF,al as oO,aW as xF,c7 as yF,b$ as bF,n as EF,b as RF,t as Og,a5 as TF,v as aO,K as _F,af as AF,a$ as vR,ag as Pg,d as Ao,ah as MF,ai as Dg,aj as CR,ak as IF,k as OF,c8 as PF,am as kg,at as _h,ap as Ah,an as Ng,au as SR,aP as DF,c as kF,a as NF}from"./index-D68iA7pN.js";import{M as HF}from"./index-AOcxwHT9.js";/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var lO=1252,FF=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],cx={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},ux=function(t){FF.indexOf(t)!=-1&&(lO=cx[0]=t)};function LF(){ux(1252)}var ws=function(t){ux(t)};function cO(){ws(1200),LF()}function xR(t){for(var e=[],r=0,n=t.length;r<n;++r)e[r]=t.charCodeAt(r);return e}function $F(t){for(var e=[],r=0;r<t.length>>1;++r)e[r]=String.fromCharCode(t.charCodeAt(2*r)+(t.charCodeAt(2*r+1)<<8));return e.join("")}function uO(t){for(var e=[],r=0;r<t.length>>1;++r)e[r]=String.fromCharCode(t.charCodeAt(2*r+1)+(t.charCodeAt(2*r)<<8));return e.join("")}var Pd=function(t){var e=t.charCodeAt(0),r=t.charCodeAt(1);return e==255&&r==254?$F(t.slice(2)):e==254&&r==255?uO(t.slice(2)):e==65279?t.slice(1):t},Hg=function(e){return String.fromCharCode(e)},yR=function(e){return String.fromCharCode(e)},Ua,Xa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function bR(t){for(var e="",r=0,n=0,i=0,s=0,o=0,a=0,l=0,c=0;c<t.length;)r=t.charCodeAt(c++),s=r>>2,n=t.charCodeAt(c++),o=(r&3)<<4|n>>4,i=t.charCodeAt(c++),a=(n&15)<<2|i>>6,l=i&63,isNaN(n)?a=l=64:isNaN(i)&&(l=64),e+=Xa.charAt(s)+Xa.charAt(o)+Xa.charAt(a)+Xa.charAt(l);return e}function Ci(t){var e="",r=0,n=0,i=0,s=0,o=0,a=0,l=0;t=t.replace(/[^\w\+\/\=]/g,"");for(var c=0;c<t.length;)s=Xa.indexOf(t.charAt(c++)),o=Xa.indexOf(t.charAt(c++)),r=s<<2|o>>4,e+=String.fromCharCode(r),a=Xa.indexOf(t.charAt(c++)),n=(o&15)<<4|a>>2,a!==64&&(e+=String.fromCharCode(n)),l=Xa.indexOf(t.charAt(c++)),i=(a&3)<<6|l,l!==64&&(e+=String.fromCharCode(i));return e}var yt=function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node}(),Ic=function(){if(typeof Buffer<"u"){var t=!Buffer.from;if(!t)try{Buffer.from("foo","utf8")}catch{t=!0}return t?function(e,r){return r?new Buffer(e,r):new Buffer(e)}:Buffer.from.bind(Buffer)}return function(){}}();function cl(t){return yt?Buffer.alloc?Buffer.alloc(t):new Buffer(t):typeof Uint8Array<"u"?new Uint8Array(t):new Array(t)}function ER(t){return yt?Buffer.allocUnsafe?Buffer.allocUnsafe(t):new Buffer(t):typeof Uint8Array<"u"?new Uint8Array(t):new Array(t)}var ps=function(e){return yt?Ic(e,"binary"):e.split("").map(function(r){return r.charCodeAt(0)&255})};function Oc(t){if(Array.isArray(t))return t.map(function(n){return String.fromCharCode(n)}).join("");for(var e=[],r=0;r<t.length;++r)e[r]=String.fromCharCode(t[r]);return e.join("")}function hx(t){if(typeof ArrayBuffer>"u")throw new Error("Unsupported");if(t instanceof ArrayBuffer)return hx(new Uint8Array(t));for(var e=new Array(t.length),r=0;r<t.length;++r)e[r]=t[r];return e}var Ya=yt?function(t){return Buffer.concat(t.map(function(e){return Buffer.isBuffer(e)?e:Ic(e)}))}:function(t){if(typeof Uint8Array<"u"){var e=0,r=0;for(e=0;e<t.length;++e)r+=t[e].length;var n=new Uint8Array(r),i=0;for(e=0,r=0;e<t.length;r+=i,++e)if(i=t[e].length,t[e]instanceof Uint8Array)n.set(t[e],r);else{if(typeof t[e]=="string")throw"wtf";n.set(new Uint8Array(t[e]),r)}return n}return[].concat.apply([],t.map(function(s){return Array.isArray(s)?s:[].slice.call(s)}))};function BF(t){for(var e=[],r=0,n=t.length+250,i=cl(t.length+255),s=0;s<t.length;++s){var o=t.charCodeAt(s);if(o<128)i[r++]=o;else if(o<2048)i[r++]=192|o>>6&31,i[r++]=128|o&63;else if(o>=55296&&o<57344){o=(o&1023)+64;var a=t.charCodeAt(++s)&1023;i[r++]=240|o>>8&7,i[r++]=128|o>>2&63,i[r++]=128|a>>6&15|(o&3)<<4,i[r++]=128|a&63}else i[r++]=224|o>>12&15,i[r++]=128|o>>6&63,i[r++]=128|o&63;r>n&&(e.push(i.slice(0,r)),r=0,i=cl(65535),n=65530)}return e.push(i.slice(0,r)),Ya(e)}var Ln=/\u0000/g,Dd=/[\u0001-\u0006]/g;function zu(t){for(var e="",r=t.length-1;r>=0;)e+=t.charAt(r--);return e}function vs(t,e){var r=""+t;return r.length>=e?r:xr("0",e-r.length)+r}function dx(t,e){var r=""+t;return r.length>=e?r:xr(" ",e-r.length)+r}function qm(t,e){var r=""+t;return r.length>=e?r:r+xr(" ",e-r.length)}function VF(t,e){var r=""+Math.round(t);return r.length>=e?r:xr("0",e-r.length)+r}function WF(t,e){var r=""+t;return r.length>=e?r:xr("0",e-r.length)+r}var RR=Math.pow(2,32);function zc(t,e){if(t>RR||t<-RR)return VF(t,e);var r=Math.round(t);return WF(r,e)}function Zm(t,e){return e=e||0,t.length>=7+e&&(t.charCodeAt(e)|32)===103&&(t.charCodeAt(e+1)|32)===101&&(t.charCodeAt(e+2)|32)===110&&(t.charCodeAt(e+3)|32)===101&&(t.charCodeAt(e+4)|32)===114&&(t.charCodeAt(e+5)|32)===97&&(t.charCodeAt(e+6)|32)===108}var TR=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],sv=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function UF(t){return t||(t={}),t[0]="General",t[1]="0",t[2]="0.00",t[3]="#,##0",t[4]="#,##0.00",t[9]="0%",t[10]="0.00%",t[11]="0.00E+00",t[12]="# ?/?",t[13]="# ??/??",t[14]="m/d/yy",t[15]="d-mmm-yy",t[16]="d-mmm",t[17]="mmm-yy",t[18]="h:mm AM/PM",t[19]="h:mm:ss AM/PM",t[20]="h:mm",t[21]="h:mm:ss",t[22]="m/d/yy h:mm",t[37]="#,##0 ;(#,##0)",t[38]="#,##0 ;[Red](#,##0)",t[39]="#,##0.00;(#,##0.00)",t[40]="#,##0.00;[Red](#,##0.00)",t[45]="mm:ss",t[46]="[h]:mm:ss",t[47]="mmss.0",t[48]="##0.0E+0",t[49]="@",t[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',t}var ot={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},_R={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},YF={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function Jm(t,e,r){for(var n=t<0?-1:1,i=t*n,s=0,o=1,a=0,l=1,c=0,u=0,h=Math.floor(i);c<e&&(h=Math.floor(i),a=h*o+s,u=h*c+l,!(i-h<5e-8));)i=1/(i-h),s=o,o=a,l=c,c=u;if(u>e&&(c>e?(u=l,a=s):(u=c,a=o)),!r)return[0,n*a,u];var d=Math.floor(n*a/u);return[d,n*a-d*u,u]}function oc(t,e,r){if(t>2958465||t<0)return null;var n=t|0,i=Math.floor(86400*(t-n)),s=0,o=[],a={D:n,T:i,u:86400*(t-n)-i,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(a.u)<1e-6&&(a.u=0),e&&e.date1904&&(n+=1462),a.u>.9999&&(a.u=0,++i==86400&&(a.T=i=0,++n,++a.D)),n===60)o=r?[1317,10,29]:[1900,2,29],s=3;else if(n===0)o=r?[1317,8,29]:[1900,1,0],s=6;else{n>60&&--n;var l=new Date(1900,0,1);l.setDate(l.getDate()+n-1),o=[l.getFullYear(),l.getMonth()+1,l.getDate()],s=l.getDay(),n<60&&(s=(s+6)%7),r&&(s=qF(l,o))}return a.y=o[0],a.m=o[1],a.d=o[2],a.S=i%60,i=Math.floor(i/60),a.M=i%60,i=Math.floor(i/60),a.H=i,a.q=s,a}var hO=new Date(1899,11,31,0,0,0),zF=hO.getTime(),GF=new Date(1900,2,1,0,0,0);function dO(t,e){var r=t.getTime();return e?r-=1461*24*60*60*1e3:t>=GF&&(r+=24*60*60*1e3),(r-(zF+(t.getTimezoneOffset()-hO.getTimezoneOffset())*6e4))/(24*60*60*1e3)}function fx(t){return t.indexOf(".")==-1?t:t.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function jF(t){return t.indexOf("E")==-1?t:t.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function KF(t){var e=t<0?12:11,r=fx(t.toFixed(12));return r.length<=e||(r=t.toPrecision(10),r.length<=e)?r:t.toExponential(5)}function XF(t){var e=fx(t.toFixed(11));return e.length>(t<0?12:11)||e==="0"||e==="-0"?t.toPrecision(6):e}function xf(t){var e=Math.floor(Math.log(Math.abs(t))*Math.LOG10E),r;return e>=-4&&e<=-1?r=t.toPrecision(10+e):Math.abs(e)<=9?r=KF(t):e===10?r=t.toFixed(10).substr(0,12):r=XF(t),fx(jF(r.toUpperCase()))}function wc(t,e){switch(typeof t){case"string":return t;case"boolean":return t?"TRUE":"FALSE";case"number":return(t|0)===t?t.toString(10):xf(t);case"undefined":return"";case"object":if(t==null)return"";if(t instanceof Date)return Ui(14,dO(t,e&&e.date1904),e)}throw new Error("unsupported value in General format: "+t)}function qF(t,e){e[0]-=581;var r=t.getDay();return t<60&&(r=(r+6)%7),r}function ZF(t,e,r,n){var i="",s=0,o=0,a=r.y,l,c=0;switch(t){case 98:a=r.y+543;case 121:switch(e.length){case 1:case 2:l=a%100,c=2;break;default:l=a%1e4,c=4;break}break;case 109:switch(e.length){case 1:case 2:l=r.m,c=e.length;break;case 3:return sv[r.m-1][1];case 5:return sv[r.m-1][0];default:return sv[r.m-1][2]}break;case 100:switch(e.length){case 1:case 2:l=r.d,c=e.length;break;case 3:return TR[r.q][0];default:return TR[r.q][1]}break;case 104:switch(e.length){case 1:case 2:l=1+(r.H+11)%12,c=e.length;break;default:throw"bad hour format: "+e}break;case 72:switch(e.length){case 1:case 2:l=r.H,c=e.length;break;default:throw"bad hour format: "+e}break;case 77:switch(e.length){case 1:case 2:l=r.M,c=e.length;break;default:throw"bad minute format: "+e}break;case 115:if(e!="s"&&e!="ss"&&e!=".0"&&e!=".00"&&e!=".000")throw"bad second format: "+e;return r.u===0&&(e=="s"||e=="ss")?vs(r.S,e.length):(n>=2?o=n===3?1e3:100:o=n===1?10:1,s=Math.round(o*(r.S+r.u)),s>=60*o&&(s=0),e==="s"?s===0?"0":""+s/o:(i=vs(s,2+n),e==="ss"?i.substr(0,2):"."+i.substr(2,e.length-1)));case 90:switch(e){case"[h]":case"[hh]":l=r.D*24+r.H;break;case"[m]":case"[mm]":l=(r.D*24+r.H)*60+r.M;break;case"[s]":case"[ss]":l=((r.D*24+r.H)*60+r.M)*60+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+e}c=e.length===3?1:2;break;case 101:l=a,c=1;break}var u=c>0?vs(l,c):"";return u}function qa(t){var e=3;if(t.length<=e)return t;for(var r=t.length%e,n=t.substr(0,r);r!=t.length;r+=e)n+=(n.length>0?",":"")+t.substr(r,e);return n}var fO=/%/g;function JF(t,e,r){var n=e.replace(fO,""),i=e.length-n.length;return ta(t,n,r*Math.pow(10,2*i))+xr("%",i)}function QF(t,e,r){for(var n=e.length-1;e.charCodeAt(n-1)===44;)--n;return ta(t,e.substr(0,n),r/Math.pow(10,3*(e.length-n)))}function gO(t,e){var r,n=t.indexOf("E")-t.indexOf(".")-1;if(t.match(/^#+0.0E\+0$/)){if(e==0)return"0.0E+0";if(e<0)return"-"+gO(t,-e);var i=t.indexOf(".");i===-1&&(i=t.indexOf("E"));var s=Math.floor(Math.log(e)*Math.LOG10E)%i;if(s<0&&(s+=i),r=(e/Math.pow(10,s)).toPrecision(n+1+(i+s)%i),r.indexOf("e")===-1){var o=Math.floor(Math.log(e)*Math.LOG10E);for(r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(o-r.length+s):r+="E+"+(o-s);r.substr(0,2)==="0.";)r=r.charAt(0)+r.substr(2,i)+"."+r.substr(2+i),r=r.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(a,l,c,u){return l+c+u.substr(0,(i+s)%i)+"."+u.substr(s)+"E"})}else r=e.toExponential(n);return t.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),t.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}var mO=/# (\?+)( ?)\/( ?)(\d+)/;function eL(t,e,r){var n=parseInt(t[4],10),i=Math.round(e*n),s=Math.floor(i/n),o=i-s*n,a=n;return r+(s===0?"":""+s)+" "+(o===0?xr(" ",t[1].length+1+t[4].length):dx(o,t[1].length)+t[2]+"/"+t[3]+vs(a,t[4].length))}function tL(t,e,r){return r+(e===0?"":""+e)+xr(" ",t[1].length+2+t[4].length)}var pO=/^#*0*\.([0#]+)/,wO=/\).*[0#]/,vO=/\(###\) ###\\?-####/;function Pn(t){for(var e="",r,n=0;n!=t.length;++n)switch(r=t.charCodeAt(n)){case 35:break;case 63:e+=" ";break;case 48:e+="0";break;default:e+=String.fromCharCode(r)}return e}function AR(t,e){var r=Math.pow(10,e);return""+Math.round(t*r)/r}function MR(t,e){var r=t-Math.floor(t),n=Math.pow(10,e);return e<(""+Math.round(r*n)).length?0:Math.round(r*n)}function rL(t,e){return e<(""+Math.round((t-Math.floor(t))*Math.pow(10,e))).length?1:0}function nL(t){return t<2147483647&&t>-2147483648?""+(t>=0?t|0:t-1|0):""+Math.floor(t)}function Mi(t,e,r){if(t.charCodeAt(0)===40&&!e.match(wO)){var n=e.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?Mi("n",n,r):"("+Mi("n",n,-r)+")"}if(e.charCodeAt(e.length-1)===44)return QF(t,e,r);if(e.indexOf("%")!==-1)return JF(t,e,r);if(e.indexOf("E")!==-1)return gO(e,r);if(e.charCodeAt(0)===36)return"$"+Mi(t,e.substr(e.charAt(1)==" "?2:1),r);var i,s,o,a,l=Math.abs(r),c=r<0?"-":"";if(e.match(/^00+$/))return c+zc(l,e.length);if(e.match(/^[#?]+$/))return i=zc(r,0),i==="0"&&(i=""),i.length>e.length?i:Pn(e.substr(0,e.length-i.length))+i;if(s=e.match(mO))return eL(s,l,c);if(e.match(/^#+0+$/))return c+zc(l,e.length-e.indexOf("0"));if(s=e.match(pO))return i=AR(r,s[1].length).replace(/^([^\.]+)$/,"$1."+Pn(s[1])).replace(/\.$/,"."+Pn(s[1])).replace(/\.(\d*)$/,function(g,m){return"."+m+xr("0",Pn(s[1]).length-m.length)}),e.indexOf("0.")!==-1?i:i.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),s=e.match(/^(0*)\.(#*)$/))return c+AR(l,s[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,s[1].length?"0.":".");if(s=e.match(/^#{1,3},##0(\.?)$/))return c+qa(zc(l,0));if(s=e.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+Mi(t,e,-r):qa(""+(Math.floor(r)+rL(r,s[1].length)))+"."+vs(MR(r,s[1].length),s[1].length);if(s=e.match(/^#,#*,#0/))return Mi(t,e.replace(/^#,#*,/,""),r);if(s=e.match(/^([0#]+)(\\?-([0#]+))+$/))return i=zu(Mi(t,e.replace(/[\\-]/g,""),r)),o=0,zu(zu(e.replace(/\\/g,"")).replace(/[0#]/g,function(g){return o<i.length?i.charAt(o++):g==="0"?"0":""}));if(e.match(vO))return i=Mi(t,"##########",r),"("+i.substr(0,3)+") "+i.substr(3,3)+"-"+i.substr(6);var u="";if(s=e.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(s[4].length,7),a=Jm(l,Math.pow(10,o)-1,!1),i=""+c,u=ta("n",s[1],a[1]),u.charAt(u.length-1)==" "&&(u=u.substr(0,u.length-1)+"0"),i+=u+s[2]+"/"+s[3],u=qm(a[2],o),u.length<s[4].length&&(u=Pn(s[4].substr(s[4].length-u.length))+u),i+=u,i;if(s=e.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(Math.max(s[1].length,s[4].length),7),a=Jm(l,Math.pow(10,o)-1,!0),c+(a[0]||(a[1]?"":"0"))+" "+(a[1]?dx(a[1],o)+s[2]+"/"+s[3]+qm(a[2],o):xr(" ",2*o+1+s[2].length+s[3].length));if(s=e.match(/^[#0?]+$/))return i=zc(r,0),e.length<=i.length?i:Pn(e.substr(0,e.length-i.length))+i;if(s=e.match(/^([#0?]+)\.([#0]+)$/)){i=""+r.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),o=i.indexOf(".");var h=e.indexOf(".")-o,d=e.length-i.length-h;return Pn(e.substr(0,h)+i+e.substr(e.length-d))}if(s=e.match(/^00,000\.([#0]*0)$/))return o=MR(r,s[1].length),r<0?"-"+Mi(t,e,-r):qa(nL(r)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(g){return"00,"+(g.length<3?vs(0,3-g.length):"")+g})+"."+vs(o,s[1].length);switch(e){case"###,##0.00":return Mi(t,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var f=qa(zc(l,0));return f!=="0"?c+f:"";case"###,###.00":return Mi(t,"###,##0.00",r).replace(/^0\./,".");case"#,###.00":return Mi(t,"#,##0.00",r).replace(/^0\./,".")}throw new Error("unsupported format |"+e+"|")}function iL(t,e,r){for(var n=e.length-1;e.charCodeAt(n-1)===44;)--n;return ta(t,e.substr(0,n),r/Math.pow(10,3*(e.length-n)))}function sL(t,e,r){var n=e.replace(fO,""),i=e.length-n.length;return ta(t,n,r*Math.pow(10,2*i))+xr("%",i)}function CO(t,e){var r,n=t.indexOf("E")-t.indexOf(".")-1;if(t.match(/^#+0.0E\+0$/)){if(e==0)return"0.0E+0";if(e<0)return"-"+CO(t,-e);var i=t.indexOf(".");i===-1&&(i=t.indexOf("E"));var s=Math.floor(Math.log(e)*Math.LOG10E)%i;if(s<0&&(s+=i),r=(e/Math.pow(10,s)).toPrecision(n+1+(i+s)%i),!r.match(/[Ee]/)){var o=Math.floor(Math.log(e)*Math.LOG10E);r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(o-r.length+s):r+="E+"+(o-s),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(a,l,c,u){return l+c+u.substr(0,(i+s)%i)+"."+u.substr(s)+"E"})}else r=e.toExponential(n);return t.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),t.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}function Js(t,e,r){if(t.charCodeAt(0)===40&&!e.match(wO)){var n=e.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?Js("n",n,r):"("+Js("n",n,-r)+")"}if(e.charCodeAt(e.length-1)===44)return iL(t,e,r);if(e.indexOf("%")!==-1)return sL(t,e,r);if(e.indexOf("E")!==-1)return CO(e,r);if(e.charCodeAt(0)===36)return"$"+Js(t,e.substr(e.charAt(1)==" "?2:1),r);var i,s,o,a,l=Math.abs(r),c=r<0?"-":"";if(e.match(/^00+$/))return c+vs(l,e.length);if(e.match(/^[#?]+$/))return i=""+r,r===0&&(i=""),i.length>e.length?i:Pn(e.substr(0,e.length-i.length))+i;if(s=e.match(mO))return tL(s,l,c);if(e.match(/^#+0+$/))return c+vs(l,e.length-e.indexOf("0"));if(s=e.match(pO))return i=(""+r).replace(/^([^\.]+)$/,"$1."+Pn(s[1])).replace(/\.$/,"."+Pn(s[1])),i=i.replace(/\.(\d*)$/,function(g,m){return"."+m+xr("0",Pn(s[1]).length-m.length)}),e.indexOf("0.")!==-1?i:i.replace(/^0\./,".");if(e=e.replace(/^#+([0.])/,"$1"),s=e.match(/^(0*)\.(#*)$/))return c+(""+l).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,s[1].length?"0.":".");if(s=e.match(/^#{1,3},##0(\.?)$/))return c+qa(""+l);if(s=e.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+Js(t,e,-r):qa(""+r)+"."+xr("0",s[1].length);if(s=e.match(/^#,#*,#0/))return Js(t,e.replace(/^#,#*,/,""),r);if(s=e.match(/^([0#]+)(\\?-([0#]+))+$/))return i=zu(Js(t,e.replace(/[\\-]/g,""),r)),o=0,zu(zu(e.replace(/\\/g,"")).replace(/[0#]/g,function(g){return o<i.length?i.charAt(o++):g==="0"?"0":""}));if(e.match(vO))return i=Js(t,"##########",r),"("+i.substr(0,3)+") "+i.substr(3,3)+"-"+i.substr(6);var u="";if(s=e.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(s[4].length,7),a=Jm(l,Math.pow(10,o)-1,!1),i=""+c,u=ta("n",s[1],a[1]),u.charAt(u.length-1)==" "&&(u=u.substr(0,u.length-1)+"0"),i+=u+s[2]+"/"+s[3],u=qm(a[2],o),u.length<s[4].length&&(u=Pn(s[4].substr(s[4].length-u.length))+u),i+=u,i;if(s=e.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return o=Math.min(Math.max(s[1].length,s[4].length),7),a=Jm(l,Math.pow(10,o)-1,!0),c+(a[0]||(a[1]?"":"0"))+" "+(a[1]?dx(a[1],o)+s[2]+"/"+s[3]+qm(a[2],o):xr(" ",2*o+1+s[2].length+s[3].length));if(s=e.match(/^[#0?]+$/))return i=""+r,e.length<=i.length?i:Pn(e.substr(0,e.length-i.length))+i;if(s=e.match(/^([#0]+)\.([#0]+)$/)){i=""+r.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),o=i.indexOf(".");var h=e.indexOf(".")-o,d=e.length-i.length-h;return Pn(e.substr(0,h)+i+e.substr(e.length-d))}if(s=e.match(/^00,000\.([#0]*0)$/))return r<0?"-"+Js(t,e,-r):qa(""+r).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(g){return"00,"+(g.length<3?vs(0,3-g.length):"")+g})+"."+vs(0,s[1].length);switch(e){case"###,###":case"##,###":case"#,###":var f=qa(""+l);return f!=="0"?c+f:"";default:if(e.match(/\.[0#?]*$/))return Js(t,e.slice(0,e.lastIndexOf(".")),r)+Pn(e.slice(e.lastIndexOf(".")))}throw new Error("unsupported format |"+e+"|")}function ta(t,e,r){return(r|0)===r?Js(t,e,r):Mi(t,e,r)}function oL(t){for(var e=[],r=!1,n=0,i=0;n<t.length;++n)switch(t.charCodeAt(n)){case 34:r=!r;break;case 95:case 42:case 92:++n;break;case 59:e[e.length]=t.substr(i,n-i),i=n+1}if(e[e.length]=t.substr(i),r===!0)throw new Error("Format |"+t+"| unterminated string ");return e}var SO=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function uh(t){for(var e=0,r="",n="";e<t.length;)switch(r=t.charAt(e)){case"G":Zm(t,e)&&(e+=6),e++;break;case'"':for(;t.charCodeAt(++e)!==34&&e<t.length;);++e;break;case"\\":e+=2;break;case"_":e+=2;break;case"@":++e;break;case"B":case"b":if(t.charAt(e+1)==="1"||t.charAt(e+1)==="2")return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if(t.substr(e,3).toUpperCase()==="A/P"||t.substr(e,5).toUpperCase()==="AM/PM"||t.substr(e,5).toUpperCase()==="上午/下午")return!0;++e;break;case"[":for(n=r;t.charAt(e++)!=="]"&&e<t.length;)n+=t.charAt(e);if(n.match(SO))return!0;break;case".":case"0":case"#":for(;e<t.length&&("0#?.,E+-%".indexOf(r=t.charAt(++e))>-1||r=="\\"&&t.charAt(e+1)=="-"&&"0#".indexOf(t.charAt(e+2))>-1););break;case"?":for(;t.charAt(++e)===r;);break;case"*":++e,(t.charAt(e)==" "||t.charAt(e)=="*")&&++e;break;case"(":case")":++e;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;e<t.length&&"0123456789".indexOf(t.charAt(++e))>-1;);break;case" ":++e;break;default:++e;break}return!1}function aL(t,e,r,n){for(var i=[],s="",o=0,a="",l="t",c,u,h,d="H";o<t.length;)switch(a=t.charAt(o)){case"G":if(!Zm(t,o))throw new Error("unrecognized character "+a+" in "+t);i[i.length]={t:"G",v:"General"},o+=7;break;case'"':for(s="";(h=t.charCodeAt(++o))!==34&&o<t.length;)s+=String.fromCharCode(h);i[i.length]={t:"t",v:s},++o;break;case"\\":var f=t.charAt(++o),g=f==="("||f===")"?f:"t";i[i.length]={t:g,v:f},++o;break;case"_":i[i.length]={t:"t",v:" "},o+=2;break;case"@":i[i.length]={t:"T",v:e},++o;break;case"B":case"b":if(t.charAt(o+1)==="1"||t.charAt(o+1)==="2"){if(c==null&&(c=oc(e,r,t.charAt(o+1)==="2"),c==null))return"";i[i.length]={t:"X",v:t.substr(o,2)},l=a,o+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":a=a.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(e<0||c==null&&(c=oc(e,r),c==null))return"";for(s=a;++o<t.length&&t.charAt(o).toLowerCase()===a;)s+=a;a==="m"&&l.toLowerCase()==="h"&&(a="M"),a==="h"&&(a=d),i[i.length]={t:a,v:s},l=a;break;case"A":case"a":case"上":var m={t:a,v:a};if(c==null&&(c=oc(e,r)),t.substr(o,3).toUpperCase()==="A/P"?(c!=null&&(m.v=c.H>=12?"P":"A"),m.t="T",d="h",o+=3):t.substr(o,5).toUpperCase()==="AM/PM"?(c!=null&&(m.v=c.H>=12?"PM":"AM"),m.t="T",o+=5,d="h"):t.substr(o,5).toUpperCase()==="上午/下午"?(c!=null&&(m.v=c.H>=12?"下午":"上午"),m.t="T",o+=5,d="h"):(m.t="t",++o),c==null&&m.t==="T")return"";i[i.length]=m,l=a;break;case"[":for(s=a;t.charAt(o++)!=="]"&&o<t.length;)s+=t.charAt(o);if(s.slice(-1)!=="]")throw'unterminated "[" block: |'+s+"|";if(s.match(SO)){if(c==null&&(c=oc(e,r),c==null))return"";i[i.length]={t:"Z",v:s.toLowerCase()},l=s.charAt(1)}else s.indexOf("$")>-1&&(s=(s.match(/\$([^-\[\]]*)/)||[])[1]||"$",uh(t)||(i[i.length]={t:"t",v:s}));break;case".":if(c!=null){for(s=a;++o<t.length&&(a=t.charAt(o))==="0";)s+=a;i[i.length]={t:"s",v:s};break}case"0":case"#":for(s=a;++o<t.length&&"0#?.,E+-%".indexOf(a=t.charAt(o))>-1;)s+=a;i[i.length]={t:"n",v:s};break;case"?":for(s=a;t.charAt(++o)===a;)s+=a;i[i.length]={t:a,v:s},l=a;break;case"*":++o,(t.charAt(o)==" "||t.charAt(o)=="*")&&++o;break;case"(":case")":i[i.length]={t:n===1?"t":a,v:a},++o;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(s=a;o<t.length&&"0123456789".indexOf(t.charAt(++o))>-1;)s+=t.charAt(o);i[i.length]={t:"D",v:s};break;case" ":i[i.length]={t:a,v:a},++o;break;case"$":i[i.length]={t:"t",v:"$"},++o;break;default:if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(a)===-1)throw new Error("unrecognized character "+a+" in "+t);i[i.length]={t:"t",v:a},++o;break}var p=0,S=0,y;for(o=i.length-1,l="t";o>=0;--o)switch(i[o].t){case"h":case"H":i[o].t=d,l="h",p<1&&(p=1);break;case"s":(y=i[o].v.match(/\.0+$/))&&(S=Math.max(S,y[0].length-1)),p<3&&(p=3);case"d":case"y":case"M":case"e":l=i[o].t;break;case"m":l==="s"&&(i[o].t="M",p<2&&(p=2));break;case"X":break;case"Z":p<1&&i[o].v.match(/[Hh]/)&&(p=1),p<2&&i[o].v.match(/[Mm]/)&&(p=2),p<3&&i[o].v.match(/[Ss]/)&&(p=3)}switch(p){case 0:break;case 1:c.u>=.5&&(c.u=0,++c.S),c.S>=60&&(c.S=0,++c.M),c.M>=60&&(c.M=0,++c.H);break;case 2:c.u>=.5&&(c.u=0,++c.S),c.S>=60&&(c.S=0,++c.M);break}var C="",E;for(o=0;o<i.length;++o)switch(i[o].t){case"t":case"T":case" ":case"D":break;case"X":i[o].v="",i[o].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":i[o].v=ZF(i[o].t.charCodeAt(0),i[o].v,c,S),i[o].t="t";break;case"n":case"?":for(E=o+1;i[E]!=null&&((a=i[E].t)==="?"||a==="D"||(a===" "||a==="t")&&i[E+1]!=null&&(i[E+1].t==="?"||i[E+1].t==="t"&&i[E+1].v==="/")||i[o].t==="("&&(a===" "||a==="n"||a===")")||a==="t"&&(i[E].v==="/"||i[E].v===" "&&i[E+1]!=null&&i[E+1].t=="?"));)i[o].v+=i[E].v,i[E]={v:"",t:";"},++E;C+=i[o].v,o=E-1;break;case"G":i[o].t="t",i[o].v=wc(e,r);break}var A="",O,T;if(C.length>0){C.charCodeAt(0)==40?(O=e<0&&C.charCodeAt(0)===45?-e:e,T=ta("n",C,O)):(O=e<0&&n>1?-e:e,T=ta("n",C,O),O<0&&i[0]&&i[0].t=="t"&&(T=T.substr(1),i[0].v="-"+i[0].v)),E=T.length-1;var W=i.length;for(o=0;o<i.length;++o)if(i[o]!=null&&i[o].t!="t"&&i[o].v.indexOf(".")>-1){W=o;break}var I=i.length;if(W===i.length&&T.indexOf("E")===-1){for(o=i.length-1;o>=0;--o)i[o]==null||"n?".indexOf(i[o].t)===-1||(E>=i[o].v.length-1?(E-=i[o].v.length,i[o].v=T.substr(E+1,i[o].v.length)):E<0?i[o].v="":(i[o].v=T.substr(0,E+1),E=-1),i[o].t="t",I=o);E>=0&&I<i.length&&(i[I].v=T.substr(0,E+1)+i[I].v)}else if(W!==i.length&&T.indexOf("E")===-1){for(E=T.indexOf(".")-1,o=W;o>=0;--o)if(!(i[o]==null||"n?".indexOf(i[o].t)===-1)){for(u=i[o].v.indexOf(".")>-1&&o===W?i[o].v.indexOf(".")-1:i[o].v.length-1,A=i[o].v.substr(u+1);u>=0;--u)E>=0&&(i[o].v.charAt(u)==="0"||i[o].v.charAt(u)==="#")&&(A=T.charAt(E--)+A);i[o].v=A,i[o].t="t",I=o}for(E>=0&&I<i.length&&(i[I].v=T.substr(0,E+1)+i[I].v),E=T.indexOf(".")+1,o=W;o<i.length;++o)if(!(i[o]==null||"n?(".indexOf(i[o].t)===-1&&o!==W)){for(u=i[o].v.indexOf(".")>-1&&o===W?i[o].v.indexOf(".")+1:0,A=i[o].v.substr(0,u);u<i[o].v.length;++u)E<T.length&&(A+=T.charAt(E++));i[o].v=A,i[o].t="t",I=o}}}for(o=0;o<i.length;++o)i[o]!=null&&"n?".indexOf(i[o].t)>-1&&(O=n>1&&e<0&&o>0&&i[o-1].v==="-"?-e:e,i[o].v=ta(i[o].t,i[o].v,O),i[o].t="t");var Y="";for(o=0;o!==i.length;++o)i[o]!=null&&(Y+=i[o].v);return Y}var IR=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function OR(t,e){if(e==null)return!1;var r=parseFloat(e[2]);switch(e[1]){case"=":if(t==r)return!0;break;case">":if(t>r)return!0;break;case"<":if(t<r)return!0;break;case"<>":if(t!=r)return!0;break;case">=":if(t>=r)return!0;break;case"<=":if(t<=r)return!0;break}return!1}function lL(t,e){var r=oL(t),n=r.length,i=r[n-1].indexOf("@");if(n<4&&i>-1&&--n,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if(typeof e!="number")return[4,r.length===4||i>-1?r[r.length-1]:"@"];switch(r.length){case 1:r=i>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=i>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=i>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"];break}var s=e>0?r[0]:e<0?r[1]:r[2];if(r[0].indexOf("[")===-1&&r[1].indexOf("[")===-1)return[n,s];if(r[0].match(/\[[=<>]/)!=null||r[1].match(/\[[=<>]/)!=null){var o=r[0].match(IR),a=r[1].match(IR);return OR(e,o)?[n,r[0]]:OR(e,a)?[n,r[1]]:[n,r[o!=null&&a!=null?2:1]]}return[n,s]}function Ui(t,e,r){r==null&&(r={});var n="";switch(typeof t){case"string":t=="m/d/yy"&&r.dateNF?n=r.dateNF:n=t;break;case"number":t==14&&r.dateNF?n=r.dateNF:n=(r.table!=null?r.table:ot)[t],n==null&&(n=r.table&&r.table[_R[t]]||ot[_R[t]]),n==null&&(n=YF[t]||"General");break}if(Zm(n,0))return wc(e,r);e instanceof Date&&(e=dO(e,r.date1904));var i=lL(n,e);if(Zm(i[1]))return wc(e,r);if(e===!0)e="TRUE";else if(e===!1)e="FALSE";else if(e===""||e==null)return"";return aL(i[1],e,r,i[0])}function fc(t,e){if(typeof e!="number"){e=+e||-1;for(var r=0;r<392;++r){if(ot[r]==null){e<0&&(e=r);continue}if(ot[r]==t){e=r;break}}e<0&&(e=391)}return ot[e]=t,e}function xO(){ot=UF()}var cL={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},yO=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function uL(t){var e=typeof t=="number"?ot[t]:t;return e=e.replace(yO,"(\\d+)"),new RegExp("^"+e+"$")}function hL(t,e,r){var n=-1,i=-1,s=-1,o=-1,a=-1,l=-1;(e.match(yO)||[]).forEach(function(h,d){var f=parseInt(r[d+1],10);switch(h.toLowerCase().charAt(0)){case"y":n=f;break;case"d":s=f;break;case"h":o=f;break;case"s":l=f;break;case"m":o>=0?a=f:i=f;break}}),l>=0&&a==-1&&i>=0&&(a=i,i=-1);var c=(""+(n>=0?n:new Date().getFullYear())).slice(-4)+"-"+("00"+(i>=1?i:1)).slice(-2)+"-"+("00"+(s>=1?s:1)).slice(-2);c.length==7&&(c="0"+c),c.length==8&&(c="20"+c);var u=("00"+(o>=0?o:0)).slice(-2)+":"+("00"+(a>=0?a:0)).slice(-2)+":"+("00"+(l>=0?l:0)).slice(-2);return o==-1&&a==-1&&l==-1?c:n==-1&&i==-1&&s==-1?u:c+"T"+u}var dL=function(){var t={};t.version="1.2.0";function e(){for(var T=0,W=new Array(256),I=0;I!=256;++I)T=I,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,W[I]=T;return typeof Int32Array<"u"?new Int32Array(W):W}var r=e();function n(T){var W=0,I=0,Y=0,z=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(Y=0;Y!=256;++Y)z[Y]=T[Y];for(Y=0;Y!=256;++Y)for(I=T[Y],W=256+Y;W<4096;W+=256)I=z[W]=I>>>8^T[I&255];var U=[];for(Y=1;Y!=16;++Y)U[Y-1]=typeof Int32Array<"u"?z.subarray(Y*256,Y*256+256):z.slice(Y*256,Y*256+256);return U}var i=n(r),s=i[0],o=i[1],a=i[2],l=i[3],c=i[4],u=i[5],h=i[6],d=i[7],f=i[8],g=i[9],m=i[10],p=i[11],S=i[12],y=i[13],C=i[14];function E(T,W){for(var I=W^-1,Y=0,z=T.length;Y<z;)I=I>>>8^r[(I^T.charCodeAt(Y++))&255];return~I}function A(T,W){for(var I=W^-1,Y=T.length-15,z=0;z<Y;)I=C[T[z++]^I&255]^y[T[z++]^I>>8&255]^S[T[z++]^I>>16&255]^p[T[z++]^I>>>24]^m[T[z++]]^g[T[z++]]^f[T[z++]]^d[T[z++]]^h[T[z++]]^u[T[z++]]^c[T[z++]]^l[T[z++]]^a[T[z++]]^o[T[z++]]^s[T[z++]]^r[T[z++]];for(Y+=15;z<Y;)I=I>>>8^r[(I^T[z++])&255];return~I}function O(T,W){for(var I=W^-1,Y=0,z=T.length,U=0,oe=0;Y<z;)U=T.charCodeAt(Y++),U<128?I=I>>>8^r[(I^U)&255]:U<2048?(I=I>>>8^r[(I^(192|U>>6&31))&255],I=I>>>8^r[(I^(128|U&63))&255]):U>=55296&&U<57344?(U=(U&1023)+64,oe=T.charCodeAt(Y++)&1023,I=I>>>8^r[(I^(240|U>>8&7))&255],I=I>>>8^r[(I^(128|U>>2&63))&255],I=I>>>8^r[(I^(128|oe>>6&15|(U&3)<<4))&255],I=I>>>8^r[(I^(128|oe&63))&255]):(I=I>>>8^r[(I^(224|U>>12&15))&255],I=I>>>8^r[(I^(128|U>>6&63))&255],I=I>>>8^r[(I^(128|U&63))&255]);return~I}return t.table=r,t.bstr=E,t.buf=A,t.str=O,t}(),Et=function(){var e={};e.version="1.2.1";function r(_,F){for(var P=_.split("/"),k=F.split("/"),L=0,V=0,he=Math.min(P.length,k.length);L<he;++L){if(V=P[L].length-k[L].length)return V;if(P[L]!=k[L])return P[L]<k[L]?-1:1}return P.length-k.length}function n(_){if(_.charAt(_.length-1)=="/")return _.slice(0,-1).indexOf("/")===-1?_:n(_.slice(0,-1));var F=_.lastIndexOf("/");return F===-1?_:_.slice(0,F+1)}function i(_){if(_.charAt(_.length-1)=="/")return i(_.slice(0,-1));var F=_.lastIndexOf("/");return F===-1?_:_.slice(F+1)}function s(_,F){typeof F=="string"&&(F=new Date(F));var P=F.getHours();P=P<<6|F.getMinutes(),P=P<<5|F.getSeconds()>>>1,_.write_shift(2,P);var k=F.getFullYear()-1980;k=k<<4|F.getMonth()+1,k=k<<5|F.getDate(),_.write_shift(2,k)}function o(_){var F=_.read_shift(2)&65535,P=_.read_shift(2)&65535,k=new Date,L=P&31;P>>>=5;var V=P&15;P>>>=4,k.setMilliseconds(0),k.setFullYear(P+1980),k.setMonth(V-1),k.setDate(L);var he=F&31;F>>>=5;var ve=F&63;return F>>>=6,k.setHours(F),k.setMinutes(ve),k.setSeconds(he<<1),k}function a(_){nn(_,0);for(var F={},P=0;_.l<=_.length-4;){var k=_.read_shift(2),L=_.read_shift(2),V=_.l+L,he={};switch(k){case 21589:P=_.read_shift(1),P&1&&(he.mtime=_.read_shift(4)),L>5&&(P&2&&(he.atime=_.read_shift(4)),P&4&&(he.ctime=_.read_shift(4))),he.mtime&&(he.mt=new Date(he.mtime*1e3));break}_.l=V,F[k]=he}return F}var l;function c(){return l||(l={})}function u(_,F){if(_[0]==80&&_[1]==75)return Ro(_,F);if((_[0]|32)==109&&(_[1]|32)==105)return Ag(_,F);if(_.length<512)throw new Error("CFB file size "+_.length+" < 512");var P=3,k=512,L=0,V=0,he=0,ve=0,ue=0,de=[],me=_.slice(0,512);nn(me,0);var ge=h(me);switch(P=ge[0],P){case 3:k=512;break;case 4:k=4096;break;case 0:if(ge[1]==0)return Ro(_,F);default:throw new Error("Major Version: Expected 3 or 4 saw "+P)}k!==512&&(me=_.slice(0,k),nn(me,28));var H=_.slice(0,k);d(me,P);var ce=me.read_shift(4,"i");if(P===3&&ce!==0)throw new Error("# Directory Sectors: Expected 0 saw "+ce);me.l+=4,he=me.read_shift(4,"i"),me.l+=4,me.chk("00100000","Mini Stream Cutoff Size: "),ve=me.read_shift(4,"i"),L=me.read_shift(4,"i"),ue=me.read_shift(4,"i"),V=me.read_shift(4,"i");for(var ae=-1,Ee=0;Ee<109&&(ae=me.read_shift(4,"i"),!(ae<0));++Ee)de[Ee]=ae;var Ge=f(_,k);p(ue,V,Ge,k,de);var ft=y(Ge,he,de,k);ft[he].name="!Directory",L>0&&ve!==oe&&(ft[ve].name="!MiniFAT"),ft[de[0]].name="!FAT",ft.fat_addrs=de,ft.ssz=k;var lt={},nr=[],Qt=[],To=[];C(he,ft,Ge,nr,L,lt,Qt,ve),g(Qt,To,nr),nr.shift();var Ca={FileIndex:Qt,FullPaths:To};return F&&F.raw&&(Ca.raw={header:H,sectors:Ge}),Ca}function h(_){if(_[_.l]==80&&_[_.l+1]==75)return[0,0];_.chk(Ce,"Header Signature: "),_.l+=16;var F=_.read_shift(2,"u");return[_.read_shift(2,"u"),F]}function d(_,F){var P=9;switch(_.l+=2,P=_.read_shift(2)){case 9:if(F!=3)throw new Error("Sector Shift: Expected 9 saw "+P);break;case 12:if(F!=4)throw new Error("Sector Shift: Expected 12 saw "+P);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+P)}_.chk("0600","Mini Sector Shift: "),_.chk("000000000000","Reserved: ")}function f(_,F){for(var P=Math.ceil(_.length/F)-1,k=[],L=1;L<P;++L)k[L-1]=_.slice(L*F,(L+1)*F);return k[P-1]=_.slice(P*F),k}function g(_,F,P){for(var k=0,L=0,V=0,he=0,ve=0,ue=P.length,de=[],me=[];k<ue;++k)de[k]=me[k]=k,F[k]=P[k];for(;ve<me.length;++ve)k=me[ve],L=_[k].L,V=_[k].R,he=_[k].C,de[k]===k&&(L!==-1&&de[L]!==L&&(de[k]=de[L]),V!==-1&&de[V]!==V&&(de[k]=de[V])),he!==-1&&(de[he]=k),L!==-1&&k!=de[k]&&(de[L]=de[k],me.lastIndexOf(L)<ve&&me.push(L)),V!==-1&&k!=de[k]&&(de[V]=de[k],me.lastIndexOf(V)<ve&&me.push(V));for(k=1;k<ue;++k)de[k]===k&&(V!==-1&&de[V]!==V?de[k]=de[V]:L!==-1&&de[L]!==L&&(de[k]=de[L]));for(k=1;k<ue;++k)if(_[k].type!==0){if(ve=k,ve!=de[ve])do ve=de[ve],F[k]=F[ve]+"/"+F[k];while(ve!==0&&de[ve]!==-1&&ve!=de[ve]);de[k]=-1}for(F[0]+="/",k=1;k<ue;++k)_[k].type!==2&&(F[k]+="/")}function m(_,F,P){for(var k=_.start,L=_.size,V=[],he=k;P&&L>0&&he>=0;)V.push(F.slice(he*U,he*U+U)),L-=U,he=ic(P,he*4);return V.length===0?$r(0):Ya(V).slice(0,_.size)}function p(_,F,P,k,L){var V=oe;if(_===oe){if(F!==0)throw new Error("DIFAT chain shorter than expected")}else if(_!==-1){var he=P[_],ve=(k>>>2)-1;if(!he)return;for(var ue=0;ue<ve&&(V=ic(he,ue*4))!==oe;++ue)L.push(V);p(ic(he,k-4),F-1,P,k,L)}}function S(_,F,P,k,L){var V=[],he=[];L||(L=[]);var ve=k-1,ue=0,de=0;for(ue=F;ue>=0;){L[ue]=!0,V[V.length]=ue,he.push(_[ue]);var me=P[Math.floor(ue*4/k)];if(de=ue*4&ve,k<4+de)throw new Error("FAT boundary crossed: "+ue+" 4 "+k);if(!_[me])break;ue=ic(_[me],de)}return{nodes:V,data:VR([he])}}function y(_,F,P,k){var L=_.length,V=[],he=[],ve=[],ue=[],de=k-1,me=0,ge=0,H=0,ce=0;for(me=0;me<L;++me)if(ve=[],H=me+F,H>=L&&(H-=L),!he[H]){ue=[];var ae=[];for(ge=H;ge>=0;){ae[ge]=!0,he[ge]=!0,ve[ve.length]=ge,ue.push(_[ge]);var Ee=P[Math.floor(ge*4/k)];if(ce=ge*4&de,k<4+ce)throw new Error("FAT boundary crossed: "+ge+" 4 "+k);if(!_[Ee]||(ge=ic(_[Ee],ce),ae[ge]))break}V[H]={nodes:ve,data:VR([ue])}}return V}function C(_,F,P,k,L,V,he,ve){for(var ue=0,de=k.length?2:0,me=F[_].data,ge=0,H=0,ce;ge<me.length;ge+=128){var ae=me.slice(ge,ge+128);nn(ae,64),H=ae.read_shift(2),ce=vx(ae,0,H-de),k.push(ce);var Ee={name:ce,type:ae.read_shift(1),color:ae.read_shift(1),L:ae.read_shift(4,"i"),R:ae.read_shift(4,"i"),C:ae.read_shift(4,"i"),clsid:ae.read_shift(16),state:ae.read_shift(4,"i"),start:0,size:0},Ge=ae.read_shift(2)+ae.read_shift(2)+ae.read_shift(2)+ae.read_shift(2);Ge!==0&&(Ee.ct=E(ae,ae.l-8));var ft=ae.read_shift(2)+ae.read_shift(2)+ae.read_shift(2)+ae.read_shift(2);ft!==0&&(Ee.mt=E(ae,ae.l-8)),Ee.start=ae.read_shift(4,"i"),Ee.size=ae.read_shift(4,"i"),Ee.size<0&&Ee.start<0&&(Ee.size=Ee.type=0,Ee.start=oe,Ee.name=""),Ee.type===5?(ue=Ee.start,L>0&&ue!==oe&&(F[ue].name="!StreamData")):Ee.size>=4096?(Ee.storage="fat",F[Ee.start]===void 0&&(F[Ee.start]=S(P,Ee.start,F.fat_addrs,F.ssz)),F[Ee.start].name=Ee.name,Ee.content=F[Ee.start].data.slice(0,Ee.size)):(Ee.storage="minifat",Ee.size<0?Ee.size=0:ue!==oe&&Ee.start!==oe&&F[ue]&&(Ee.content=m(Ee,F[ue].data,(F[ve]||{}).data))),Ee.content&&nn(Ee.content,0),V[ce]=Ee,he.push(Ee)}}function E(_,F){return new Date((pi(_,F+4)/1e7*Math.pow(2,32)+pi(_,F)/1e7-11644473600)*1e3)}function A(_,F){return c(),u(l.readFileSync(_),F)}function O(_,F){var P=F&&F.type;switch(P||yt&&Buffer.isBuffer(_)&&(P="buffer"),P||"base64"){case"file":return A(_,F);case"base64":return u(ps(Ci(_)),F);case"binary":return u(ps(_),F)}return u(_,F)}function T(_,F){var P=F||{},k=P.root||"Root Entry";if(_.FullPaths||(_.FullPaths=[]),_.FileIndex||(_.FileIndex=[]),_.FullPaths.length!==_.FileIndex.length)throw new Error("inconsistent CFB structure");_.FullPaths.length===0&&(_.FullPaths[0]=k+"/",_.FileIndex[0]={name:k,type:5}),P.CLSID&&(_.FileIndex[0].clsid=P.CLSID),W(_)}function W(_){var F="Sh33tJ5";if(!Et.find(_,"/"+F)){var P=$r(4);P[0]=55,P[1]=P[3]=50,P[2]=54,_.FileIndex.push({name:F,type:2,content:P,size:4,L:69,R:69,C:69}),_.FullPaths.push(_.FullPaths[0]+F),I(_)}}function I(_,F){T(_);for(var P=!1,k=!1,L=_.FullPaths.length-1;L>=0;--L){var V=_.FileIndex[L];switch(V.type){case 0:k?P=!0:(_.FileIndex.pop(),_.FullPaths.pop());break;case 1:case 2:case 5:k=!0,isNaN(V.R*V.L*V.C)&&(P=!0),V.R>-1&&V.L>-1&&V.R==V.L&&(P=!0);break;default:P=!0;break}}if(!(!P&&!F)){var he=new Date(1987,1,19),ve=0,ue=Object.create?Object.create(null):{},de=[];for(L=0;L<_.FullPaths.length;++L)ue[_.FullPaths[L]]=!0,_.FileIndex[L].type!==0&&de.push([_.FullPaths[L],_.FileIndex[L]]);for(L=0;L<de.length;++L){var me=n(de[L][0]);k=ue[me],k||(de.push([me,{name:i(me).replace("/",""),type:1,clsid:Te,ct:he,mt:he,content:null}]),ue[me]=!0)}for(de.sort(function(ce,ae){return r(ce[0],ae[0])}),_.FullPaths=[],_.FileIndex=[],L=0;L<de.length;++L)_.FullPaths[L]=de[L][0],_.FileIndex[L]=de[L][1];for(L=0;L<de.length;++L){var ge=_.FileIndex[L],H=_.FullPaths[L];if(ge.name=i(H).replace("/",""),ge.L=ge.R=ge.C=-(ge.color=1),ge.size=ge.content?ge.content.length:0,ge.start=0,ge.clsid=ge.clsid||Te,L===0)ge.C=de.length>1?1:-1,ge.size=0,ge.type=5;else if(H.slice(-1)=="/"){for(ve=L+1;ve<de.length&&n(_.FullPaths[ve])!=H;++ve);for(ge.C=ve>=de.length?-1:ve,ve=L+1;ve<de.length&&n(_.FullPaths[ve])!=n(H);++ve);ge.R=ve>=de.length?-1:ve,ge.type=1}else n(_.FullPaths[L+1]||"")==n(H)&&(ge.R=L+1),ge.type=2}}}function Y(_,F){var P=F||{};if(P.fileType=="mad")return Mg(_,P);switch(I(_),P.fileType){case"zip":return Sl(_,P)}var k=function(ce){for(var ae=0,Ee=0,Ge=0;Ge<ce.FileIndex.length;++Ge){var ft=ce.FileIndex[Ge];if(ft.content){var lt=ft.content.length;lt>0&&(lt<4096?ae+=lt+63>>6:Ee+=lt+511>>9)}}for(var nr=ce.FullPaths.length+3>>2,Qt=ae+7>>3,To=ae+127>>7,Ca=Qt+Ee+nr+To,Sa=Ca+127>>7,iv=Sa<=109?0:Math.ceil((Sa-109)/127);Ca+Sa+iv+127>>7>Sa;)iv=++Sa<=109?0:Math.ceil((Sa-109)/127);var _o=[1,iv,Sa,To,nr,Ee,ae,0];return ce.FileIndex[0].size=ae<<6,_o[7]=(ce.FileIndex[0].start=_o[0]+_o[1]+_o[2]+_o[3]+_o[4]+_o[5])+(_o[6]+7>>3),_o}(_),L=$r(k[7]<<9),V=0,he=0;{for(V=0;V<8;++V)L.write_shift(1,pe[V]);for(V=0;V<8;++V)L.write_shift(2,0);for(L.write_shift(2,62),L.write_shift(2,3),L.write_shift(2,65534),L.write_shift(2,9),L.write_shift(2,6),V=0;V<3;++V)L.write_shift(2,0);for(L.write_shift(4,0),L.write_shift(4,k[2]),L.write_shift(4,k[0]+k[1]+k[2]+k[3]-1),L.write_shift(4,0),L.write_shift(4,4096),L.write_shift(4,k[3]?k[0]+k[1]+k[2]-1:oe),L.write_shift(4,k[3]),L.write_shift(-4,k[1]?k[0]-1:oe),L.write_shift(4,k[1]),V=0;V<109;++V)L.write_shift(-4,V<k[2]?k[1]+V:-1)}if(k[1])for(he=0;he<k[1];++he){for(;V<236+he*127;++V)L.write_shift(-4,V<k[2]?k[1]+V:-1);L.write_shift(-4,he===k[1]-1?oe:he+1)}var ve=function(ce){for(he+=ce;V<he-1;++V)L.write_shift(-4,V+1);ce&&(++V,L.write_shift(-4,oe))};for(he=V=0,he+=k[1];V<he;++V)L.write_shift(-4,Se.DIFSECT);for(he+=k[2];V<he;++V)L.write_shift(-4,Se.FATSECT);ve(k[3]),ve(k[4]);for(var ue=0,de=0,me=_.FileIndex[0];ue<_.FileIndex.length;++ue)me=_.FileIndex[ue],me.content&&(de=me.content.length,!(de<4096)&&(me.start=he,ve(de+511>>9)));for(ve(k[6]+7>>3);L.l&511;)L.write_shift(-4,Se.ENDOFCHAIN);for(he=V=0,ue=0;ue<_.FileIndex.length;++ue)me=_.FileIndex[ue],me.content&&(de=me.content.length,!(!de||de>=4096)&&(me.start=he,ve(de+63>>6)));for(;L.l&511;)L.write_shift(-4,Se.ENDOFCHAIN);for(V=0;V<k[4]<<2;++V){var ge=_.FullPaths[V];if(!ge||ge.length===0){for(ue=0;ue<17;++ue)L.write_shift(4,0);for(ue=0;ue<3;++ue)L.write_shift(4,-1);for(ue=0;ue<12;++ue)L.write_shift(4,0);continue}me=_.FileIndex[V],V===0&&(me.start=me.size?me.start-1:oe);var H=V===0&&P.root||me.name;if(de=2*(H.length+1),L.write_shift(64,H,"utf16le"),L.write_shift(2,de),L.write_shift(1,me.type),L.write_shift(1,me.color),L.write_shift(-4,me.L),L.write_shift(-4,me.R),L.write_shift(-4,me.C),me.clsid)L.write_shift(16,me.clsid,"hex");else for(ue=0;ue<4;++ue)L.write_shift(4,0);L.write_shift(4,me.state||0),L.write_shift(4,0),L.write_shift(4,0),L.write_shift(4,0),L.write_shift(4,0),L.write_shift(4,me.start),L.write_shift(4,me.size),L.write_shift(4,0)}for(V=1;V<_.FileIndex.length;++V)if(me=_.FileIndex[V],me.size>=4096)if(L.l=me.start+1<<9,yt&&Buffer.isBuffer(me.content))me.content.copy(L,L.l,0,me.size),L.l+=me.size+511&-512;else{for(ue=0;ue<me.size;++ue)L.write_shift(1,me.content[ue]);for(;ue&511;++ue)L.write_shift(1,0)}for(V=1;V<_.FileIndex.length;++V)if(me=_.FileIndex[V],me.size>0&&me.size<4096)if(yt&&Buffer.isBuffer(me.content))me.content.copy(L,L.l,0,me.size),L.l+=me.size+63&-64;else{for(ue=0;ue<me.size;++ue)L.write_shift(1,me.content[ue]);for(;ue&63;++ue)L.write_shift(1,0)}if(yt)L.l=L.length;else for(;L.l<L.length;)L.write_shift(1,0);return L}function z(_,F){var P=_.FullPaths.map(function(ue){return ue.toUpperCase()}),k=P.map(function(ue){var de=ue.split("/");return de[de.length-(ue.slice(-1)=="/"?2:1)]}),L=!1;F.charCodeAt(0)===47?(L=!0,F=P[0].slice(0,-1)+F):L=F.indexOf("/")!==-1;var V=F.toUpperCase(),he=L===!0?P.indexOf(V):k.indexOf(V);if(he!==-1)return _.FileIndex[he];var ve=!V.match(Dd);for(V=V.replace(Ln,""),ve&&(V=V.replace(Dd,"!")),he=0;he<P.length;++he)if((ve?P[he].replace(Dd,"!"):P[he]).replace(Ln,"")==V||(ve?k[he].replace(Dd,"!"):k[he]).replace(Ln,"")==V)return _.FileIndex[he];return null}var U=64,oe=-2,Ce="d0cf11e0a1b11ae1",pe=[208,207,17,224,161,177,26,225],Te="00000000000000000000000000000000",Se={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:oe,FREESECT:-1,HEADER_SIGNATURE:Ce,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:Te,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function Ae(_,F,P){c();var k=Y(_,P);l.writeFileSync(F,k)}function q(_){for(var F=new Array(_.length),P=0;P<_.length;++P)F[P]=String.fromCharCode(_[P]);return F.join("")}function Oe(_,F){var P=Y(_,F);switch(F&&F.type||"buffer"){case"file":return c(),l.writeFileSync(F.filename,P),P;case"binary":return typeof P=="string"?P:q(P);case"base64":return bR(typeof P=="string"?P:q(P));case"buffer":if(yt)return Buffer.isBuffer(P)?P:Ic(P);case"array":return typeof P=="string"?ps(P):P}return P}var v;function w(_){try{var F=_.InflateRaw,P=new F;if(P._processChunk(new Uint8Array([3,0]),P._finishFlushFlag),P.bytesRead)v=_;else throw new Error("zlib does not expose bytesRead")}catch(k){console.error("cannot use native zlib: "+(k.message||k))}}function x(_,F){if(!v)return Ct(_,F);var P=v.InflateRaw,k=new P,L=k._processChunk(_.slice(_.l),k._finishFlushFlag);return _.l+=k.bytesRead,L}function R(_){return v?v.deflateRawSync(_):Q(_)}var b=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],B=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],X=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function ne(_){var F=(_<<1|_<<11)&139536|(_<<5|_<<15)&558144;return(F>>16|F>>8|F)&255}for(var fe=typeof Uint8Array<"u",le=fe?new Uint8Array(256):[],we=0;we<256;++we)le[we]=ne(we);function N(_,F){var P=le[_&255];return F<=8?P>>>8-F:(P=P<<8|le[_>>8&255],F<=16?P>>>16-F:(P=P<<8|le[_>>16&255],P>>>24-F))}function Fe(_,F){var P=F&7,k=F>>>3;return(_[k]|(P<=6?0:_[k+1]<<8))>>>P&3}function ie(_,F){var P=F&7,k=F>>>3;return(_[k]|(P<=5?0:_[k+1]<<8))>>>P&7}function Be(_,F){var P=F&7,k=F>>>3;return(_[k]|(P<=4?0:_[k+1]<<8))>>>P&15}function Ie(_,F){var P=F&7,k=F>>>3;return(_[k]|(P<=3?0:_[k+1]<<8))>>>P&31}function xe(_,F){var P=F&7,k=F>>>3;return(_[k]|(P<=1?0:_[k+1]<<8))>>>P&127}function Ye(_,F,P){var k=F&7,L=F>>>3,V=(1<<P)-1,he=_[L]>>>k;return P<8-k||(he|=_[L+1]<<8-k,P<16-k)||(he|=_[L+2]<<16-k,P<24-k)||(he|=_[L+3]<<24-k),he&V}function Ve(_,F,P){var k=F&7,L=F>>>3;return k<=5?_[L]|=(P&7)<<k:(_[L]|=P<<k&255,_[L+1]=(P&7)>>8-k),F+3}function M(_,F,P){var k=F&7,L=F>>>3;return P=(P&1)<<k,_[L]|=P,F+1}function D(_,F,P){var k=F&7,L=F>>>3;return P<<=k,_[L]|=P&255,P>>>=8,_[L+1]=P,F+8}function G(_,F,P){var k=F&7,L=F>>>3;return P<<=k,_[L]|=P&255,P>>>=8,_[L+1]=P&255,_[L+2]=P>>>8,F+16}function re(_,F){var P=_.length,k=2*P>F?2*P:F+5,L=0;if(P>=F)return _;if(yt){var V=ER(k);if(_.copy)_.copy(V);else for(;L<_.length;++L)V[L]=_[L];return V}else if(fe){var he=new Uint8Array(k);if(he.set)he.set(_);else for(;L<P;++L)he[L]=_[L];return he}return _.length=k,_}function K(_){for(var F=new Array(_),P=0;P<_;++P)F[P]=0;return F}function se(_,F,P){var k=1,L=0,V=0,he=0,ve=0,ue=_.length,de=fe?new Uint16Array(32):K(32);for(V=0;V<32;++V)de[V]=0;for(V=ue;V<P;++V)_[V]=0;ue=_.length;var me=fe?new Uint16Array(ue):K(ue);for(V=0;V<ue;++V)de[L=_[V]]++,k<L&&(k=L),me[V]=0;for(de[0]=0,V=1;V<=k;++V)de[V+16]=ve=ve+de[V-1]<<1;for(V=0;V<ue;++V)ve=_[V],ve!=0&&(me[V]=de[ve+16]++);var ge=0;for(V=0;V<ue;++V)if(ge=_[V],ge!=0)for(ve=N(me[V],k)>>k-ge,he=(1<<k+4-ge)-1;he>=0;--he)F[ve|he<<ge]=ge&15|V<<4;return k}var J=fe?new Uint16Array(512):K(512),Z=fe?new Uint16Array(32):K(32);if(!fe){for(var ee=0;ee<512;++ee)J[ee]=0;for(ee=0;ee<32;++ee)Z[ee]=0}(function(){for(var _=[],F=0;F<32;F++)_.push(5);se(_,Z,32);var P=[];for(F=0;F<=143;F++)P.push(8);for(;F<=255;F++)P.push(9);for(;F<=279;F++)P.push(7);for(;F<=287;F++)P.push(8);se(P,J,288)})();var te=function(){for(var F=fe?new Uint8Array(32768):[],P=0,k=0;P<X.length-1;++P)for(;k<X[P+1];++k)F[k]=P;for(;k<32768;++k)F[k]=29;var L=fe?new Uint8Array(259):[];for(P=0,k=0;P<B.length-1;++P)for(;k<B[P+1];++k)L[k]=P;function V(ve,ue){for(var de=0;de<ve.length;){var me=Math.min(65535,ve.length-de),ge=de+me==ve.length;for(ue.write_shift(1,+ge),ue.write_shift(2,me),ue.write_shift(2,~me&65535);me-- >0;)ue[ue.l++]=ve[de++]}return ue.l}function he(ve,ue){for(var de=0,me=0,ge=fe?new Uint16Array(32768):[];me<ve.length;){var H=Math.min(65535,ve.length-me);if(H<10){for(de=Ve(ue,de,+(me+H==ve.length)),de&7&&(de+=8-(de&7)),ue.l=de/8|0,ue.write_shift(2,H),ue.write_shift(2,~H&65535);H-- >0;)ue[ue.l++]=ve[me++];de=ue.l*8;continue}de=Ve(ue,de,+(me+H==ve.length)+2);for(var ce=0;H-- >0;){var ae=ve[me];ce=(ce<<5^ae)&32767;var Ee=-1,Ge=0;if((Ee=ge[ce])&&(Ee|=me&-32768,Ee>me&&(Ee-=32768),Ee<me))for(;ve[Ee+Ge]==ve[me+Ge]&&Ge<250;)++Ge;if(Ge>2){ae=L[Ge],ae<=22?de=D(ue,de,le[ae+1]>>1)-1:(D(ue,de,3),de+=5,D(ue,de,le[ae-23]>>5),de+=3);var ft=ae<8?0:ae-4>>2;ft>0&&(G(ue,de,Ge-B[ae]),de+=ft),ae=F[me-Ee],de=D(ue,de,le[ae]>>3),de-=3;var lt=ae<4?0:ae-2>>1;lt>0&&(G(ue,de,me-Ee-X[ae]),de+=lt);for(var nr=0;nr<Ge;++nr)ge[ce]=me&32767,ce=(ce<<5^ve[me])&32767,++me;H-=Ge-1}else ae<=143?ae=ae+48:de=M(ue,de,1),de=D(ue,de,le[ae]),ge[ce]=me&32767,++me}de=D(ue,de,0)-1}return ue.l=(de+7)/8|0,ue.l}return function(ue,de){return ue.length<8?V(ue,de):he(ue,de)}}();function Q(_){var F=$r(50+Math.floor(_.length*1.1)),P=te(_,F);return F.slice(0,P)}var ye=fe?new Uint16Array(32768):K(32768),Me=fe?new Uint16Array(32768):K(32768),Pe=fe?new Uint16Array(128):K(128),Je=1,vt=1;function st(_,F){var P=Ie(_,F)+257;F+=5;var k=Ie(_,F)+1;F+=5;var L=Be(_,F)+4;F+=4;for(var V=0,he=fe?new Uint8Array(19):K(19),ve=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ue=1,de=fe?new Uint8Array(8):K(8),me=fe?new Uint8Array(8):K(8),ge=he.length,H=0;H<L;++H)he[b[H]]=V=ie(_,F),ue<V&&(ue=V),de[V]++,F+=3;var ce=0;for(de[0]=0,H=1;H<=ue;++H)me[H]=ce=ce+de[H-1]<<1;for(H=0;H<ge;++H)(ce=he[H])!=0&&(ve[H]=me[ce]++);var ae=0;for(H=0;H<ge;++H)if(ae=he[H],ae!=0){ce=le[ve[H]]>>8-ae;for(var Ee=(1<<7-ae)-1;Ee>=0;--Ee)Pe[ce|Ee<<ae]=ae&7|H<<3}var Ge=[];for(ue=1;Ge.length<P+k;)switch(ce=Pe[xe(_,F)],F+=ce&7,ce>>>=3){case 16:for(V=3+Fe(_,F),F+=2,ce=Ge[Ge.length-1];V-- >0;)Ge.push(ce);break;case 17:for(V=3+ie(_,F),F+=3;V-- >0;)Ge.push(0);break;case 18:for(V=11+xe(_,F),F+=7;V-- >0;)Ge.push(0);break;default:Ge.push(ce),ue<ce&&(ue=ce);break}var ft=Ge.slice(0,P),lt=Ge.slice(P);for(H=P;H<286;++H)ft[H]=0;for(H=k;H<30;++H)lt[H]=0;return Je=se(ft,ye,286),vt=se(lt,Me,30),F}function qe(_,F){if(_[0]==3&&!(_[1]&3))return[cl(F),2];for(var P=0,k=0,L=ER(F||1<<18),V=0,he=L.length>>>0,ve=0,ue=0;!(k&1);){if(k=ie(_,P),P+=3,k>>>1)k>>1==1?(ve=9,ue=5):(P=st(_,P),ve=Je,ue=vt);else{P&7&&(P+=8-(P&7));var de=_[P>>>3]|_[(P>>>3)+1]<<8;if(P+=32,de>0)for(!F&&he<V+de&&(L=re(L,V+de),he=L.length);de-- >0;)L[V++]=_[P>>>3],P+=8;continue}for(;;){!F&&he<V+32767&&(L=re(L,V+32767),he=L.length);var me=Ye(_,P,ve),ge=k>>>1==1?J[me]:ye[me];if(P+=ge&15,ge>>>=4,!(ge>>>8&255))L[V++]=ge;else{if(ge==256)break;ge-=257;var H=ge<8?0:ge-4>>2;H>5&&(H=0);var ce=V+B[ge];H>0&&(ce+=Ye(_,P,H),P+=H),me=Ye(_,P,ue),ge=k>>>1==1?Z[me]:Me[me],P+=ge&15,ge>>>=4;var ae=ge<4?0:ge-2>>1,Ee=X[ge];for(ae>0&&(Ee+=Ye(_,P,ae),P+=ae),!F&&he<ce&&(L=re(L,ce+100),he=L.length);V<ce;)L[V]=L[V-Ee],++V}}}return F?[L,P+7>>>3]:[L.slice(0,V),P+7>>>3]}function Ct(_,F){var P=_.slice(_.l||0),k=qe(P,F);return _.l+=k[1],k[0]}function Gt(_,F){if(_)typeof console<"u"&&console.error(F);else throw new Error(F)}function Ro(_,F){var P=_;nn(P,0);var k=[],L=[],V={FileIndex:k,FullPaths:L};T(V,{root:F.root});for(var he=P.length-4;(P[he]!=80||P[he+1]!=75||P[he+2]!=5||P[he+3]!=6)&&he>=0;)--he;P.l=he+4,P.l+=4;var ve=P.read_shift(2);P.l+=6;var ue=P.read_shift(4);for(P.l=ue,he=0;he<ve;++he){P.l+=20;var de=P.read_shift(4),me=P.read_shift(4),ge=P.read_shift(2),H=P.read_shift(2),ce=P.read_shift(2);P.l+=8;var ae=P.read_shift(4),Ee=a(P.slice(P.l+ge,P.l+ge+H));P.l+=ge+H+ce;var Ge=P.l;P.l=ae+4,ii(P,de,me,V,Ee),P.l=Ge}return V}function ii(_,F,P,k,L){_.l+=2;var V=_.read_shift(2),he=_.read_shift(2),ve=o(_);if(V&8257)throw new Error("Unsupported ZIP encryption");for(var ue=_.read_shift(4),de=_.read_shift(4),me=_.read_shift(4),ge=_.read_shift(2),H=_.read_shift(2),ce="",ae=0;ae<ge;++ae)ce+=String.fromCharCode(_[_.l++]);if(H){var Ee=a(_.slice(_.l,_.l+H));(Ee[21589]||{}).mt&&(ve=Ee[21589].mt),((L||{})[21589]||{}).mt&&(ve=L[21589].mt)}_.l+=H;var Ge=_.slice(_.l,_.l+de);switch(he){case 8:Ge=x(_,me);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+he)}var ft=!1;V&8&&(ue=_.read_shift(4),ue==134695760&&(ue=_.read_shift(4),ft=!0),de=_.read_shift(4),me=_.read_shift(4)),de!=F&&Gt(ft,"Bad compressed size: "+F+" != "+de),me!=P&&Gt(ft,"Bad uncompressed size: "+P+" != "+me),va(k,ce,Ge,{unsafe:!0,mt:ve})}function Sl(_,F){var P=F||{},k=[],L=[],V=$r(1),he=P.compression?8:0,ve=0,ue=0,de=0,me=0,ge=0,H=_.FullPaths[0],ce=H,ae=_.FileIndex[0],Ee=[],Ge=0;for(ue=1;ue<_.FullPaths.length;++ue)if(ce=_.FullPaths[ue].slice(H.length),ae=_.FileIndex[ue],!(!ae.size||!ae.content||ce=="Sh33tJ5")){var ft=me,lt=$r(ce.length);for(de=0;de<ce.length;++de)lt.write_shift(1,ce.charCodeAt(de)&127);lt=lt.slice(0,lt.l),Ee[ge]=dL.buf(ae.content,0);var nr=ae.content;he==8&&(nr=R(nr)),V=$r(30),V.write_shift(4,67324752),V.write_shift(2,20),V.write_shift(2,ve),V.write_shift(2,he),ae.mt?s(V,ae.mt):V.write_shift(4,0),V.write_shift(-4,Ee[ge]),V.write_shift(4,nr.length),V.write_shift(4,ae.content.length),V.write_shift(2,lt.length),V.write_shift(2,0),me+=V.length,k.push(V),me+=lt.length,k.push(lt),me+=nr.length,k.push(nr),V=$r(46),V.write_shift(4,33639248),V.write_shift(2,0),V.write_shift(2,20),V.write_shift(2,ve),V.write_shift(2,he),V.write_shift(4,0),V.write_shift(-4,Ee[ge]),V.write_shift(4,nr.length),V.write_shift(4,ae.content.length),V.write_shift(2,lt.length),V.write_shift(2,0),V.write_shift(2,0),V.write_shift(2,0),V.write_shift(2,0),V.write_shift(4,0),V.write_shift(4,ft),Ge+=V.l,L.push(V),Ge+=lt.length,L.push(lt),++ge}return V=$r(22),V.write_shift(4,101010256),V.write_shift(2,0),V.write_shift(2,0),V.write_shift(2,ge),V.write_shift(2,ge),V.write_shift(4,Ge),V.write_shift(4,me),V.write_shift(2,0),Ya([Ya(k),Ya(L),V])}var en={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function jt(_,F){if(_.ctype)return _.ctype;var P=_.name||"",k=P.match(/\.([^\.]+)$/);return k&&en[k[1]]||F&&(k=(P=F).match(/[\.\\]([^\.\\])+$/),k&&en[k[1]])?en[k[1]]:"application/octet-stream"}function Er(_){for(var F=bR(_),P=[],k=0;k<F.length;k+=76)P.push(F.slice(k,k+76));return P.join(`\r
  2. `)+`\r
  3. `}function Nr(_){var F=_.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,function(de){var me=de.charCodeAt(0).toString(16).toUpperCase();return"="+(me.length==1?"0"+me:me)});F=F.replace(/ $/mg,"=20").replace(/\t$/mg,"=09"),F.charAt(0)==`
  4. `&&(F="=0D"+F.slice(1)),F=F.replace(/\r(?!\n)/mg,"=0D").replace(/\n\n/mg,`
  5. =0A`).replace(/([^\r\n])\n/mg,"$1=0A");for(var P=[],k=F.split(`\r
  6. `),L=0;L<k.length;++L){var V=k[L];if(V.length==0){P.push("");continue}for(var he=0;he<V.length;){var ve=76,ue=V.slice(he,he+ve);ue.charAt(ve-1)=="="?ve--:ue.charAt(ve-2)=="="?ve-=2:ue.charAt(ve-3)=="="&&(ve-=3),ue=V.slice(he,he+ve),he+=ve,he<V.length&&(ue+="="),P.push(ue)}}return P.join(`\r
  7. `)}function Ut(_){for(var F=[],P=0;P<_.length;++P){for(var k=_[P];P<=_.length&&k.charAt(k.length-1)=="=";)k=k.slice(0,k.length-1)+_[++P];F.push(k)}for(var L=0;L<F.length;++L)F[L]=F[L].replace(/[=][0-9A-Fa-f]{2}/g,function(V){return String.fromCharCode(parseInt(V.slice(1),16))});return ps(F.join(`\r
  8. `))}function Rh(_,F,P){for(var k="",L="",V="",he,ve=0;ve<10;++ve){var ue=F[ve];if(!ue||ue.match(/^\s*$/))break;var de=ue.match(/^(.*?):\s*([^\s].*)$/);if(de)switch(de[1].toLowerCase()){case"content-location":k=de[2].trim();break;case"content-type":V=de[2].trim();break;case"content-transfer-encoding":L=de[2].trim();break}}switch(++ve,L.toLowerCase()){case"base64":he=ps(Ci(F.slice(ve).join("")));break;case"quoted-printable":he=Ut(F.slice(ve));break;default:throw new Error("Unsupported Content-Transfer-Encoding "+L)}var me=va(_,k.slice(P.length),he,{unsafe:!0});V&&(me.ctype=V)}function Ag(_,F){if(q(_.slice(0,13)).toLowerCase()!="mime-version:")throw new Error("Unsupported MAD header");var P=F&&F.root||"",k=(yt&&Buffer.isBuffer(_)?_.toString("binary"):q(_)).split(`\r
  9. `),L=0,V="";for(L=0;L<k.length;++L)if(V=k[L],!!/^Content-Location:/i.test(V)&&(V=V.slice(V.indexOf("file")),P||(P=V.slice(0,V.lastIndexOf("/")+1)),V.slice(0,P.length)!=P))for(;P.length>0&&(P=P.slice(0,P.length-1),P=P.slice(0,P.lastIndexOf("/")+1),V.slice(0,P.length)!=P););var he=(k[1]||"").match(/boundary="(.*?)"/);if(!he)throw new Error("MAD cannot find boundary");var ve="--"+(he[1]||""),ue=[],de=[],me={FileIndex:ue,FullPaths:de};T(me);var ge,H=0;for(L=0;L<k.length;++L){var ce=k[L];ce!==ve&&ce!==ve+"--"||(H++&&Rh(me,k.slice(ge,L),P),ge=L)}return me}function Mg(_,F){var P=F||{},k=P.boundary||"SheetJS";k="------="+k;for(var L=["MIME-Version: 1.0",'Content-Type: multipart/related; boundary="'+k.slice(2)+'"',"","",""],V=_.FullPaths[0],he=V,ve=_.FileIndex[0],ue=1;ue<_.FullPaths.length;++ue)if(he=_.FullPaths[ue].slice(V.length),ve=_.FileIndex[ue],!(!ve.size||!ve.content||he=="Sh33tJ5")){he=he.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g,function(Ge){return"_x"+Ge.charCodeAt(0).toString(16)+"_"}).replace(/[\u0080-\uFFFF]/g,function(Ge){return"_u"+Ge.charCodeAt(0).toString(16)+"_"});for(var de=ve.content,me=yt&&Buffer.isBuffer(de)?de.toString("binary"):q(de),ge=0,H=Math.min(1024,me.length),ce=0,ae=0;ae<=H;++ae)(ce=me.charCodeAt(ae))>=32&&ce<128&&++ge;var Ee=ge>=H*4/5;L.push(k),L.push("Content-Location: "+(P.root||"file:///C:/SheetJS/")+he),L.push("Content-Transfer-Encoding: "+(Ee?"quoted-printable":"base64")),L.push("Content-Type: "+jt(ve,he)),L.push(""),L.push(Ee?Nr(me):Er(me))}return L.push(k+`--\r
  10. `),L.join(`\r
  11. `)}function rv(_){var F={};return T(F,_),F}function va(_,F,P,k){var L=k&&k.unsafe;L||T(_);var V=!L&&Et.find(_,F);if(!V){var he=_.FullPaths[0];F.slice(0,he.length)==he?he=F:(he.slice(-1)!="/"&&(he+="/"),he=(he+F).replace("//","/")),V={name:i(F),type:2},_.FileIndex.push(V),_.FullPaths.push(he),L||Et.utils.cfb_gc(_)}return V.content=P,V.size=P?P.length:0,k&&(k.CLSID&&(V.clsid=k.CLSID),k.mt&&(V.mt=k.mt),k.ct&&(V.ct=k.ct)),V}function Th(_,F){T(_);var P=Et.find(_,F);if(P){for(var k=0;k<_.FileIndex.length;++k)if(_.FileIndex[k]==P)return _.FileIndex.splice(k,1),_.FullPaths.splice(k,1),!0}return!1}function nv(_,F,P){T(_);var k=Et.find(_,F);if(k){for(var L=0;L<_.FileIndex.length;++L)if(_.FileIndex[L]==k)return _.FileIndex[L].name=i(P),_.FullPaths[L]=P,!0}return!1}function Yn(_){I(_,!0)}return e.find=z,e.read=O,e.parse=u,e.write=Oe,e.writeFile=Ae,e.utils={cfb_new:rv,cfb_add:va,cfb_del:Th,cfb_mov:nv,cfb_gc:Yn,ReadShift:Vd,CheckField:YO,prep_blob:nn,bconcat:Ya,use_zlib:w,_deflateRaw:Q,_inflateRaw:Ct,consts:Se},e}();function fL(t){if(typeof Deno<"u")return Deno.readFileSync(t);if(typeof $<"u"&&typeof File<"u"&&typeof Folder<"u")try{var e=File(t);e.open("r"),e.encoding="binary";var r=e.read();return e.close(),r}catch(n){if(!n.message||!n.message.match(/onstruct/))throw n}throw new Error("Cannot access file "+t)}function fo(t){for(var e=Object.keys(t),r=[],n=0;n<e.length;++n)Object.prototype.hasOwnProperty.call(t,e[n])&&r.push(e[n]);return r}function gx(t){for(var e=[],r=fo(t),n=0;n!==r.length;++n)e[t[r[n]]]=r[n];return e}var Qm=new Date(1899,11,30,0,0,0);function $n(t,e){var r=t.getTime(),n=Qm.getTime()+(t.getTimezoneOffset()-Qm.getTimezoneOffset())*6e4;return(r-n)/(24*60*60*1e3)}var bO=new Date,gL=Qm.getTime()+(bO.getTimezoneOffset()-Qm.getTimezoneOffset())*6e4,PR=bO.getTimezoneOffset();function Qp(t){var e=new Date;return e.setTime(t*24*60*60*1e3+gL),e.getTimezoneOffset()!==PR&&e.setTime(e.getTime()+(e.getTimezoneOffset()-PR)*6e4),e}function mL(t){var e=0,r=0,n=!1,i=t.match(/P([0-9\.]+Y)?([0-9\.]+M)?([0-9\.]+D)?T([0-9\.]+H)?([0-9\.]+M)?([0-9\.]+S)?/);if(!i)throw new Error("|"+t+"| is not an ISO8601 Duration");for(var s=1;s!=i.length;++s)if(i[s]){switch(r=1,s>3&&(n=!0),i[s].slice(i[s].length-1)){case"Y":throw new Error("Unsupported ISO Duration Field: "+i[s].slice(i[s].length-1));case"D":r*=24;case"H":r*=60;case"M":if(n)r*=60;else throw new Error("Unsupported ISO Duration Field: M")}e+=r*parseInt(i[s],10)}return e}var DR=new Date("2017-02-19T19:06:09.000Z"),EO=isNaN(DR.getFullYear())?new Date("2/19/17"):DR,pL=EO.getFullYear()==2017;function Jr(t,e){var r=new Date(t);if(pL)return e>0?r.setTime(r.getTime()+r.getTimezoneOffset()*60*1e3):e<0&&r.setTime(r.getTime()-r.getTimezoneOffset()*60*1e3),r;if(t instanceof Date)return t;if(EO.getFullYear()==1917&&!isNaN(r.getFullYear())){var n=r.getFullYear();return t.indexOf(""+n)>-1||r.setFullYear(r.getFullYear()+100),r}var i=t.match(/\d+/g)||["2017","2","19","0","0","0"],s=new Date(+i[0],+i[1]-1,+i[2],+i[3]||0,+i[4]||0,+i[5]||0);return t.indexOf("Z")>-1&&(s=new Date(s.getTime()-s.getTimezoneOffset()*60*1e3)),s}function vc(t,e){if(yt&&Buffer.isBuffer(t)){if(e){if(t[0]==255&&t[1]==254)return Nd(t.slice(2).toString("utf16le"));if(t[1]==254&&t[2]==255)return Nd(uO(t.slice(2).toString("binary")))}return t.toString("binary")}if(typeof TextDecoder<"u")try{if(e){if(t[0]==255&&t[1]==254)return Nd(new TextDecoder("utf-16le").decode(t.slice(2)));if(t[0]==254&&t[1]==255)return Nd(new TextDecoder("utf-16be").decode(t.slice(2)))}var r={"€":"€","‚":"‚",ƒ:"ƒ","„":"„","…":"…","†":"†","‡":"‡","ˆ":"ˆ","‰":"‰",Š:"Š","‹":"‹",Œ:"Œ",Ž:"Ž","‘":"‘","’":"’","“":"“","”":"”","•":"•","–":"–","—":"—","˜":"˜","™":"™",š:"š","›":"›",œ:"œ",ž:"ž",Ÿ:"Ÿ"};return Array.isArray(t)&&(t=new Uint8Array(t)),new TextDecoder("latin1").decode(t).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g,function(s){return r[s]||s})}catch{}for(var n=[],i=0;i!=t.length;++i)n.push(String.fromCharCode(t[i]));return n.join("")}function sn(t){if(typeof JSON<"u"&&!Array.isArray(t))return JSON.parse(JSON.stringify(t));if(typeof t!="object"||t==null)return t;if(t instanceof Date)return new Date(t.getTime());var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=sn(t[r]));return e}function xr(t,e){for(var r="";r.length<e;)r+=t;return r}function xs(t){var e=Number(t);if(!isNaN(e))return isFinite(e)?e:NaN;if(!/\d/.test(t))return e;var r=1,n=t.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,function(){return r*=100,""});return!isNaN(e=Number(n))||(n=n.replace(/[(](.*)[)]/,function(i,s){return r=-r,s}),!isNaN(e=Number(n)))?e/r:e}var wL=["january","february","march","april","may","june","july","august","september","october","november","december"];function nh(t){var e=new Date(t),r=new Date(NaN),n=e.getYear(),i=e.getMonth(),s=e.getDate();if(isNaN(s))return r;var o=t.toLowerCase();if(o.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)){if(o=o.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,""),o.length>3&&wL.indexOf(o)==-1)return r}else if(o.match(/[a-z]/))return r;return n<0||n>8099?r:(i>0||s>1)&&n!=101?e:t.match(/[^-0-9:,\/\\]/)?r:e}var vL=function(){var t="abacaba".split(/(:?b)/i).length==5;return function(r,n,i){if(t||typeof n=="string")return r.split(n);for(var s=r.split(n),o=[s[0]],a=1;a<s.length;++a)o.push(i),o.push(s[a]);return o}}();function RO(t){return t?t.content&&t.type?vc(t.content,!0):t.data?Pd(t.data):t.asNodeBuffer&&yt?Pd(t.asNodeBuffer().toString("binary")):t.asBinary?Pd(t.asBinary()):t._data&&t._data.getContent?Pd(vc(Array.prototype.slice.call(t._data.getContent(),0))):null:null}function TO(t){if(!t)return null;if(t.data)return xR(t.data);if(t.asNodeBuffer&&yt)return t.asNodeBuffer();if(t._data&&t._data.getContent){var e=t._data.getContent();return typeof e=="string"?xR(e):Array.prototype.slice.call(e)}return t.content&&t.type?t.content:null}function CL(t){return t&&t.name.slice(-4)===".bin"?TO(t):RO(t)}function Pi(t,e){for(var r=t.FullPaths||fo(t.files),n=e.toLowerCase().replace(/[\/]/g,"\\"),i=n.replace(/\\/g,"/"),s=0;s<r.length;++s){var o=r[s].replace(/^Root Entry[\/]/,"").toLowerCase();if(n==o||i==o)return t.files?t.files[r[s]]:t.FileIndex[s]}return null}function mx(t,e){var r=Pi(t,e);if(r==null)throw new Error("Cannot find file "+e+" in zip");return r}function Pr(t,e,r){if(!r)return CL(mx(t,e));if(!e)return null;try{return Pr(t,e)}catch{return null}}function wi(t,e,r){if(!r)return RO(mx(t,e));if(!e)return null;try{return wi(t,e)}catch{return null}}function SL(t,e,r){return TO(mx(t,e))}function kR(t){for(var e=t.FullPaths||fo(t.files),r=[],n=0;n<e.length;++n)e[n].slice(-1)!="/"&&r.push(e[n].replace(/^Root Entry[\/]/,""));return r.sort()}function xL(t,e,r){if(t.FullPaths){if(typeof r=="string"){var n;return yt?n=Ic(r):n=BF(r),Et.utils.cfb_add(t,e,n)}Et.utils.cfb_add(t,e,r)}else t.file(e,r)}function _O(t,e){switch(e.type){case"base64":return Et.read(t,{type:"base64"});case"binary":return Et.read(t,{type:"binary"});case"buffer":case"array":return Et.read(t,{type:"buffer"})}throw new Error("Unrecognized type "+e.type)}function kd(t,e){if(t.charAt(0)=="/")return t.slice(1);var r=e.split("/");e.slice(-1)!="/"&&r.pop();for(var n=t.split("/");n.length!==0;){var i=n.shift();i===".."?r.pop():i!=="."&&r.push(i)}return r.join("/")}var AO=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
  12. `,yL=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g,NR=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s*[\/\?]?>/mg,bL=/<[^>]*>/g,yn=AO.match(NR)?NR:bL,EL=/<\w*:/,RL=/<(\/?)\w+:/;function Qe(t,e,r){for(var n={},i=0,s=0;i!==t.length&&!((s=t.charCodeAt(i))===32||s===10||s===13);++i);if(e||(n[0]=t.slice(0,i)),i===t.length)return n;var o=t.match(yL),a=0,l="",c=0,u="",h="",d=1;if(o)for(c=0;c!=o.length;++c){for(h=o[c],s=0;s!=h.length&&h.charCodeAt(s)!==61;++s);for(u=h.slice(0,s).trim();h.charCodeAt(s+1)==32;)++s;for(d=(i=h.charCodeAt(s+1))==34||i==39?1:0,l=h.slice(s+1+d,h.length-d),a=0;a!=u.length&&u.charCodeAt(a)!==58;++a);if(a===u.length)u.indexOf("_")>0&&(u=u.slice(0,u.indexOf("_"))),n[u]=l,n[u.toLowerCase()]=l;else{var f=(a===5&&u.slice(0,5)==="xmlns"?"xmlns":"")+u.slice(a+1);if(n[f]&&u.slice(a-3,a)=="ext")continue;n[f]=l,n[f.toLowerCase()]=l}}return n}function wo(t){return t.replace(RL,"<$1")}var MO={"&quot;":'"',"&apos;":"'","&gt;":">","&lt;":"<","&amp;":"&"},TL=gx(MO),At=function(){var t=/&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/ig,e=/_x([\da-fA-F]{4})_/ig;return function r(n){var i=n+"",s=i.indexOf("<![CDATA[");if(s==-1)return i.replace(t,function(a,l){return MO[a]||String.fromCharCode(parseInt(l,a.indexOf("x")>-1?16:10))||a}).replace(e,function(a,l){return String.fromCharCode(parseInt(l,16))});var o=i.indexOf("]]>");return r(i.slice(0,s))+i.slice(s+9,o)+r(i.slice(o+3))}}(),_L=/[&<>'"]/g,AL=/[\u0000-\u001f]/g;function px(t){var e=t+"";return e.replace(_L,function(r){return TL[r]}).replace(/\n/g,"<br/>").replace(AL,function(r){return"&#x"+("000"+r.charCodeAt(0).toString(16)).slice(-4)+";"})}var HR=function(){var t=/&#(\d+);/g;function e(r,n){return String.fromCharCode(parseInt(n,10))}return function(n){return n.replace(t,e)}}();function ar(t){switch(t){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}function ov(t){for(var e="",r=0,n=0,i=0,s=0,o=0,a=0;r<t.length;){if(n=t.charCodeAt(r++),n<128){e+=String.fromCharCode(n);continue}if(i=t.charCodeAt(r++),n>191&&n<224){o=(n&31)<<6,o|=i&63,e+=String.fromCharCode(o);continue}if(s=t.charCodeAt(r++),n<240){e+=String.fromCharCode((n&15)<<12|(i&63)<<6|s&63);continue}o=t.charCodeAt(r++),a=((n&7)<<18|(i&63)<<12|(s&63)<<6|o&63)-65536,e+=String.fromCharCode(55296+(a>>>10&1023)),e+=String.fromCharCode(56320+(a&1023))}return e}function FR(t){var e=cl(2*t.length),r,n,i=1,s=0,o=0,a;for(n=0;n<t.length;n+=i)i=1,(a=t.charCodeAt(n))<128?r=a:a<224?(r=(a&31)*64+(t.charCodeAt(n+1)&63),i=2):a<240?(r=(a&15)*4096+(t.charCodeAt(n+1)&63)*64+(t.charCodeAt(n+2)&63),i=3):(i=4,r=(a&7)*262144+(t.charCodeAt(n+1)&63)*4096+(t.charCodeAt(n+2)&63)*64+(t.charCodeAt(n+3)&63),r-=65536,o=55296+(r>>>10&1023),r=56320+(r&1023)),o!==0&&(e[s++]=o&255,e[s++]=o>>>8,o=0),e[s++]=r%256,e[s++]=r>>>8;return e.slice(0,s).toString("ucs2")}function LR(t){return Ic(t,"binary").toString("utf8")}var Fg="foo bar baz☃🍣",Jt=yt&&(LR(Fg)==ov(Fg)&&LR||FR(Fg)==ov(Fg)&&FR)||ov,Nd=yt?function(t){return Ic(t,"utf8").toString("binary")}:function(t){for(var e=[],r=0,n=0,i=0;r<t.length;)switch(n=t.charCodeAt(r++),!0){case n<128:e.push(String.fromCharCode(n));break;case n<2048:e.push(String.fromCharCode(192+(n>>6))),e.push(String.fromCharCode(128+(n&63)));break;case(n>=55296&&n<57344):n-=55296,i=t.charCodeAt(r++)-56320+(n<<10),e.push(String.fromCharCode(240+(i>>18&7))),e.push(String.fromCharCode(144+(i>>12&63))),e.push(String.fromCharCode(128+(i>>6&63))),e.push(String.fromCharCode(128+(i&63)));break;default:e.push(String.fromCharCode(224+(n>>12))),e.push(String.fromCharCode(128+(n>>6&63))),e.push(String.fromCharCode(128+(n&63)))}return e.join("")},yf=function(){var t={};return function(r,n){var i=r+"|"+(n||"");return t[i]?t[i]:t[i]=new RegExp("<(?:\\w+:)?"+r+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)</(?:\\w+:)?'+r+">",n||"")}}(),IO=function(){var t=[["nbsp"," "],["middot","·"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(e){return[new RegExp("&"+e[0]+";","ig"),e[1]]});return function(r){for(var n=r.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/[\t\n\r ]+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,`
  13. `).replace(/<[^>]*>/g,""),i=0;i<t.length;++i)n=n.replace(t[i][0],t[i][1]);return n}}(),ML=function(){var t={};return function(r){return t[r]!==void 0?t[r]:t[r]=new RegExp("<(?:vt:)?"+r+">([\\s\\S]*?)</(?:vt:)?"+r+">","g")}}(),IL=/<\/?(?:vt:)?variant>/g,OL=/<(?:vt:)([^>]*)>([\s\S]*)</;function $R(t,e){var r=Qe(t),n=t.match(ML(r.baseType))||[],i=[];if(n.length!=r.size){if(e.WTF)throw new Error("unexpected vector length "+n.length+" != "+r.size);return i}return n.forEach(function(s){var o=s.replace(IL,"").match(OL);o&&i.push({v:Jt(o[2]),t:o[1]})}),i}var PL=/(^\s|\s$|\n)/;function DL(t){return fo(t).map(function(e){return" "+e+'="'+t[e]+'"'}).join("")}function kL(t,e,r){return"<"+t+(r!=null?DL(r):"")+(e!=null?(e.match(PL)?' xml:space="preserve"':"")+">"+e+"</"+t:"/")+">"}function wx(t){if(yt&&Buffer.isBuffer(t))return t.toString("utf8");if(typeof t=="string")return t;if(typeof Uint8Array<"u"&&t instanceof Uint8Array)return Jt(Oc(hx(t)));throw new Error("Bad input format: expected Buffer or string")}var bf=/<(\/?)([^\s?><!\/:]*:|)([^\s?<>:\/]+)(?:[\s?:\/][^>]*)?>/mg,NL={CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",CT:"http://schemas.openxmlformats.org/package/2006/content-types",RELS:"http://schemas.openxmlformats.org/package/2006/relationships",TCMNT:"http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",mx:"http://schemas.microsoft.com/office/mac/excel/2008/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",sjs:"http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"},HL=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"];function FL(t,e){for(var r=1-2*(t[e+7]>>>7),n=((t[e+7]&127)<<4)+(t[e+6]>>>4&15),i=t[e+6]&15,s=5;s>=0;--s)i=i*256+t[e+s];return n==2047?i==0?r*(1/0):NaN:(n==0?n=-1022:(n-=1023,i+=Math.pow(2,52)),r*Math.pow(2,n-52)*i)}function LL(t,e,r){var n=(e<0||1/e==-1/0?1:0)<<7,i=0,s=0,o=n?-e:e;isFinite(o)?o==0?i=s=0:(i=Math.floor(Math.log(o)/Math.LN2),s=o*Math.pow(2,52-i),i<=-1023&&(!isFinite(s)||s<Math.pow(2,52))?i=-1022:(s-=Math.pow(2,52),i+=1023)):(i=2047,s=isNaN(e)?26985:0);for(var a=0;a<=5;++a,s/=256)t[r+a]=s&255;t[r+6]=(i&15)<<4|s&15,t[r+7]=i>>4|n}var BR=function(t){for(var e=[],r=10240,n=0;n<t[0].length;++n)if(t[0][n])for(var i=0,s=t[0][n].length;i<s;i+=r)e.push.apply(e,t[0][n].slice(i,i+r));return e},VR=yt?function(t){return t[0].length>0&&Buffer.isBuffer(t[0][0])?Buffer.concat(t[0].map(function(e){return Buffer.isBuffer(e)?e:Ic(e)})):BR(t)}:BR,WR=function(t,e,r){for(var n=[],i=e;i<r;i+=2)n.push(String.fromCharCode(jo(t,i)));return n.join("").replace(Ln,"")},vx=yt?function(t,e,r){return Buffer.isBuffer(t)?t.toString("utf16le",e,r).replace(Ln,""):WR(t,e,r)}:WR,UR=function(t,e,r){for(var n=[],i=e;i<e+r;++i)n.push(("0"+t[i].toString(16)).slice(-2));return n.join("")},OO=yt?function(t,e,r){return Buffer.isBuffer(t)?t.toString("hex",e,e+r):UR(t,e,r)}:UR,YR=function(t,e,r){for(var n=[],i=e;i<r;i++)n.push(String.fromCharCode(Iu(t,i)));return n.join("")},Kf=yt?function(e,r,n){return Buffer.isBuffer(e)?e.toString("utf8",r,n):YR(e,r,n)}:YR,PO=function(t,e){var r=pi(t,e);return r>0?Kf(t,e+4,e+4+r-1):""},DO=PO,kO=function(t,e){var r=pi(t,e);return r>0?Kf(t,e+4,e+4+r-1):""},NO=kO,HO=function(t,e){var r=2*pi(t,e);return r>0?Kf(t,e+4,e+4+r-1):""},FO=HO,LO=function(e,r){var n=pi(e,r);return n>0?vx(e,r+4,r+4+n):""},$O=LO,BO=function(t,e){var r=pi(t,e);return r>0?Kf(t,e+4,e+4+r):""},VO=BO,WO=function(t,e){return FL(t,e)},ep=WO,UO=function(e){return Array.isArray(e)||typeof Uint8Array<"u"&&e instanceof Uint8Array};yt&&(DO=function(e,r){if(!Buffer.isBuffer(e))return PO(e,r);var n=e.readUInt32LE(r);return n>0?e.toString("utf8",r+4,r+4+n-1):""},NO=function(e,r){if(!Buffer.isBuffer(e))return kO(e,r);var n=e.readUInt32LE(r);return n>0?e.toString("utf8",r+4,r+4+n-1):""},FO=function(e,r){if(!Buffer.isBuffer(e))return HO(e,r);var n=2*e.readUInt32LE(r);return e.toString("utf16le",r+4,r+4+n-1)},$O=function(e,r){if(!Buffer.isBuffer(e))return LO(e,r);var n=e.readUInt32LE(r);return e.toString("utf16le",r+4,r+4+n)},VO=function(e,r){if(!Buffer.isBuffer(e))return BO(e,r);var n=e.readUInt32LE(r);return e.toString("utf8",r+4,r+4+n)},ep=function(e,r){return Buffer.isBuffer(e)?e.readDoubleLE(r):WO(e,r)},UO=function(e){return Buffer.isBuffer(e)||Array.isArray(e)||typeof Uint8Array<"u"&&e instanceof Uint8Array});var Iu=function(t,e){return t[e]},jo=function(t,e){return t[e+1]*256+t[e]},$L=function(t,e){var r=t[e+1]*256+t[e];return r<32768?r:(65535-r+1)*-1},pi=function(t,e){return t[e+3]*(1<<24)+(t[e+2]<<16)+(t[e+1]<<8)+t[e]},ic=function(t,e){return t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]},BL=function(t,e){return t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]};function Vd(t,e){var r="",n,i,s=[],o,a,l,c;switch(e){case"dbcs":if(c=this.l,yt&&Buffer.isBuffer(this))r=this.slice(this.l,this.l+2*t).toString("utf16le");else for(l=0;l<t;++l)r+=String.fromCharCode(jo(this,c)),c+=2;t*=2;break;case"utf8":r=Kf(this,this.l,this.l+t);break;case"utf16le":t*=2,r=vx(this,this.l,this.l+t);break;case"wstr":return Vd.call(this,t,"dbcs");case"lpstr-ansi":r=DO(this,this.l),t=4+pi(this,this.l);break;case"lpstr-cp":r=NO(this,this.l),t=4+pi(this,this.l);break;case"lpwstr":r=FO(this,this.l),t=4+2*pi(this,this.l);break;case"lpp4":t=4+pi(this,this.l),r=$O(this,this.l),t&2&&(t+=2);break;case"8lpp4":t=4+pi(this,this.l),r=VO(this,this.l),t&3&&(t+=4-(t&3));break;case"cstr":for(t=0,r="";(o=Iu(this,this.l+t++))!==0;)s.push(Hg(o));r=s.join("");break;case"_wstr":for(t=0,r="";(o=jo(this,this.l+t))!==0;)s.push(Hg(o)),t+=2;t+=2,r=s.join("");break;case"dbcs-cont":for(r="",c=this.l,l=0;l<t;++l){if(this.lens&&this.lens.indexOf(c)!==-1)return o=Iu(this,c),this.l=c+1,a=Vd.call(this,t-l,o?"dbcs-cont":"sbcs-cont"),s.join("")+a;s.push(Hg(jo(this,c))),c+=2}r=s.join(""),t*=2;break;case"cpstr":case"sbcs-cont":for(r="",c=this.l,l=0;l!=t;++l){if(this.lens&&this.lens.indexOf(c)!==-1)return o=Iu(this,c),this.l=c+1,a=Vd.call(this,t-l,o?"dbcs-cont":"sbcs-cont"),s.join("")+a;s.push(Hg(Iu(this,c))),c+=1}r=s.join("");break;default:switch(t){case 1:return n=Iu(this,this.l),this.l++,n;case 2:return n=(e==="i"?$L:jo)(this,this.l),this.l+=2,n;case 4:case-4:return e==="i"||!(this[this.l+3]&128)?(n=(t>0?ic:BL)(this,this.l),this.l+=4,n):(i=pi(this,this.l),this.l+=4,i);case 8:case-8:if(e==="f")return t==8?i=ep(this,this.l):i=ep([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,i;t=8;case 16:r=OO(this,this.l,t);break}}return this.l+=t,r}var VL=function(t,e,r){t[r]=e&255,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24&255},WL=function(t,e,r){t[r]=e&255,t[r+1]=e>>8&255,t[r+2]=e>>16&255,t[r+3]=e>>24&255},UL=function(t,e,r){t[r]=e&255,t[r+1]=e>>>8&255};function YL(t,e,r){var n=0,i=0;if(r==="dbcs"){for(i=0;i!=e.length;++i)UL(this,e.charCodeAt(i),this.l+2*i);n=2*e.length}else if(r==="sbcs"){for(e=e.replace(/[^\x00-\x7F]/g,"_"),i=0;i!=e.length;++i)this[this.l+i]=e.charCodeAt(i)&255;n=e.length}else if(r==="hex"){for(;i<t;++i)this[this.l++]=parseInt(e.slice(2*i,2*i+2),16)||0;return this}else if(r==="utf16le"){var s=Math.min(this.l+t,this.length);for(i=0;i<Math.min(e.length,t);++i){var o=e.charCodeAt(i);this[this.l++]=o&255,this[this.l++]=o>>8}for(;this.l<s;)this[this.l++]=0;return this}else switch(t){case 1:n=1,this[this.l]=e&255;break;case 2:n=2,this[this.l]=e&255,e>>>=8,this[this.l+1]=e&255;break;case 3:n=3,this[this.l]=e&255,e>>>=8,this[this.l+1]=e&255,e>>>=8,this[this.l+2]=e&255;break;case 4:n=4,VL(this,e,this.l);break;case 8:if(n=8,r==="f"){LL(this,e,this.l);break}case 16:break;case-4:n=4,WL(this,e,this.l);break}return this.l+=n,this}function YO(t,e){var r=OO(this,this.l,t.length>>1);if(r!==t)throw new Error(e+"Expected "+t+" saw "+r);this.l+=t.length>>1}function nn(t,e){t.l=e,t.read_shift=Vd,t.chk=YO,t.write_shift=YL}function xn(t,e){t.l+=e}function $r(t){var e=cl(t);return nn(e,0),e}function ca(t,e,r){if(t){var n,i,s;nn(t,t.l||0);for(var o=t.length,a=0,l=0;t.l<o;){a=t.read_shift(1),a&128&&(a=(a&127)+((t.read_shift(1)&127)<<7));var c=op[a]||op[65535];for(n=t.read_shift(1),s=n&127,i=1;i<4&&n&128;++i)s+=((n=t.read_shift(1))&127)<<7*i;l=t.l+s;var u=c.f&&c.f(t,s,r);if(t.l=l,e(u,c,a))return}}}function W1(){var t=[],e=yt?256:2048,r=function(c){var u=$r(c);return nn(u,0),u},n=r(e),i=function(){n&&(n.length>n.l&&(n=n.slice(0,n.l),n.l=n.length),n.length>0&&t.push(n),n=null)},s=function(c){return n&&c<n.length-n.l?n:(i(),n=r(Math.max(c+1,e)))},o=function(){return i(),Ya(t)},a=function(c){i(),n=c,n.l==null&&(n.l=n.length),s(e)};return{next:s,push:a,end:o,_bufs:t}}function Wd(t,e,r){var n=sn(t);if(e.s?(n.cRel&&(n.c+=e.s.c),n.rRel&&(n.r+=e.s.r)):(n.cRel&&(n.c+=e.c),n.rRel&&(n.r+=e.r)),!r||r.biff<12){for(;n.c>=256;)n.c-=256;for(;n.r>=65536;)n.r-=65536}return n}function zR(t,e,r){var n=sn(t);return n.s=Wd(n.s,e.s,r),n.e=Wd(n.e,e.s,r),n}function Ud(t,e){if(t.cRel&&t.c<0)for(t=sn(t);t.c<0;)t.c+=e>8?16384:256;if(t.rRel&&t.r<0)for(t=sn(t);t.r<0;)t.r+=e>8?1048576:e>5?65536:16384;var r=nt(t);return!t.cRel&&t.cRel!=null&&(r=jL(r)),!t.rRel&&t.rRel!=null&&(r=zL(r)),r}function av(t,e){return t.s.r==0&&!t.s.rRel&&t.e.r==(e.biff>=12?1048575:e.biff>=8?65536:16384)&&!t.e.rRel?(t.s.cRel?"":"$")+Br(t.s.c)+":"+(t.e.cRel?"":"$")+Br(t.e.c):t.s.c==0&&!t.s.cRel&&t.e.c==(e.biff>=12?16383:255)&&!t.e.cRel?(t.s.rRel?"":"$")+on(t.s.r)+":"+(t.e.rRel?"":"$")+on(t.e.r):Ud(t.s,e.biff)+":"+Ud(t.e,e.biff)}function Cx(t){return parseInt(GL(t),10)-1}function on(t){return""+(t+1)}function zL(t){return t.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function GL(t){return t.replace(/\$(\d+)$/,"$1")}function Sx(t){for(var e=KL(t),r=0,n=0;n!==e.length;++n)r=26*r+e.charCodeAt(n)-64;return r-1}function Br(t){if(t<0)throw new Error("invalid column "+t);var e="";for(++t;t;t=Math.floor((t-1)/26))e=String.fromCharCode((t-1)%26+65)+e;return e}function jL(t){return t.replace(/^([A-Z])/,"$$$1")}function KL(t){return t.replace(/^\$([A-Z])/,"$1")}function XL(t){return t.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function Fn(t){for(var e=0,r=0,n=0;n<t.length;++n){var i=t.charCodeAt(n);i>=48&&i<=57?e=10*e+(i-48):i>=65&&i<=90&&(r=26*r+(i-64))}return{c:r-1,r:e-1}}function nt(t){for(var e=t.c+1,r="";e;e=(e-1)/26|0)r=String.fromCharCode((e-1)%26+65)+r;return r+(t.r+1)}function hh(t){var e=t.indexOf(":");return e==-1?{s:Fn(t),e:Fn(t)}:{s:Fn(t.slice(0,e)),e:Fn(t.slice(e+1))}}function Rt(t,e){return typeof e>"u"||typeof e=="number"?Rt(t.s,t.e):(typeof t!="string"&&(t=nt(t)),typeof e!="string"&&(e=nt(e)),t==e?t:t+":"+e)}function br(t){var e={s:{c:0,r:0},e:{c:0,r:0}},r=0,n=0,i=0,s=t.length;for(r=0;n<s&&!((i=t.charCodeAt(n)-64)<1||i>26);++n)r=26*r+i;for(e.s.c=--r,r=0;n<s&&!((i=t.charCodeAt(n)-48)<0||i>9);++n)r=10*r+i;if(e.s.r=--r,n===s||i!=10)return e.e.c=e.s.c,e.e.r=e.s.r,e;for(++n,r=0;n!=s&&!((i=t.charCodeAt(n)-64)<1||i>26);++n)r=26*r+i;for(e.e.c=--r,r=0;n!=s&&!((i=t.charCodeAt(n)-48)<0||i>9);++n)r=10*r+i;return e.e.r=--r,e}function GR(t,e){var r=t.t=="d"&&e instanceof Date;if(t.z!=null)try{return t.w=Ui(t.z,r?$n(e):e)}catch{}try{return t.w=Ui((t.XF||{}).numFmtId||(r?14:0),r?$n(e):e)}catch{return""+e}}function sa(t,e,r){return t==null||t.t==null||t.t=="z"?"":t.w!==void 0?t.w:(t.t=="d"&&!t.z&&r&&r.dateNF&&(t.z=r.dateNF),t.t=="e"?kc[t.v]||t.v:e==null?GR(t,t.v):GR(t,e))}function gl(t,e){var r=e&&e.sheet?e.sheet:"Sheet1",n={};return n[r]=t,{SheetNames:[r],Sheets:n}}function zO(t,e,r){var n=r||{},i=t?Array.isArray(t):n.dense,s=t||(i?[]:{}),o=0,a=0;if(s&&n.origin!=null){if(typeof n.origin=="number")o=n.origin;else{var l=typeof n.origin=="string"?Fn(n.origin):n.origin;o=l.r,a=l.c}s["!ref"]||(s["!ref"]="A1:A1")}var c={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(s["!ref"]){var u=br(s["!ref"]);c.s.c=u.s.c,c.s.r=u.s.r,c.e.c=Math.max(c.e.c,u.e.c),c.e.r=Math.max(c.e.r,u.e.r),o==-1&&(c.e.r=o=u.e.r+1)}for(var h=0;h!=e.length;++h)if(e[h]){if(!Array.isArray(e[h]))throw new Error("aoa_to_sheet expects an array of arrays");for(var d=0;d!=e[h].length;++d)if(!(typeof e[h][d]>"u")){var f={v:e[h][d]},g=o+h,m=a+d;if(c.s.r>g&&(c.s.r=g),c.s.c>m&&(c.s.c=m),c.e.r<g&&(c.e.r=g),c.e.c<m&&(c.e.c=m),e[h][d]&&typeof e[h][d]=="object"&&!Array.isArray(e[h][d])&&!(e[h][d]instanceof Date))f=e[h][d];else if(Array.isArray(f.v)&&(f.f=e[h][d][1],f.v=f.v[0]),f.v===null)if(f.f)f.t="n";else if(n.nullError)f.t="e",f.v=0;else if(n.sheetStubs)f.t="z";else continue;else typeof f.v=="number"?f.t="n":typeof f.v=="boolean"?f.t="b":f.v instanceof Date?(f.z=n.dateNF||ot[14],n.cellDates?(f.t="d",f.w=Ui(f.z,$n(f.v))):(f.t="n",f.v=$n(f.v),f.w=Ui(f.z,f.v))):f.t="s";if(i)s[g]||(s[g]=[]),s[g][m]&&s[g][m].z&&(f.z=s[g][m].z),s[g][m]=f;else{var p=nt({c:m,r:g});s[p]&&s[p].z&&(f.z=s[p].z),s[p]=f}}}return c.s.c<1e7&&(s["!ref"]=Rt(c)),s}function dh(t,e){return zO(null,t,e)}function qL(t){return t.read_shift(4,"i")}function Cn(t){var e=t.read_shift(4);return e===0?"":t.read_shift(e,"dbcs")}function ZL(t){return{ich:t.read_shift(2),ifnt:t.read_shift(2)}}function xx(t,e){var r=t.l,n=t.read_shift(1),i=Cn(t),s=[],o={t:i,h:i};if(n&1){for(var a=t.read_shift(4),l=0;l!=a;++l)s.push(ZL(t));o.r=s}else o.r=[{ich:0,ifnt:0}];return t.l=r+e,o}var JL=xx;function Gi(t){var e=t.read_shift(4),r=t.read_shift(2);return r+=t.read_shift(1)<<16,t.l++,{c:e,iStyleRef:r}}function Pc(t){var e=t.read_shift(2);return e+=t.read_shift(1)<<16,t.l++,{c:-1,iStyleRef:e}}var QL=Cn;function yx(t){var e=t.read_shift(4);return e===0||e===4294967295?"":t.read_shift(e,"dbcs")}var e$=Cn,U1=yx;function bx(t){var e=t.slice(t.l,t.l+4),r=e[0]&1,n=e[0]&2;t.l+=4;var i=n===0?ep([0,0,0,0,e[0]&252,e[1],e[2],e[3]],0):ic(e,0)>>2;return r?i/100:i}function GO(t){var e={s:{},e:{}};return e.s.r=t.read_shift(4),e.e.r=t.read_shift(4),e.s.c=t.read_shift(4),e.e.c=t.read_shift(4),e}var Dc=GO;function wn(t){if(t.length-t.l<8)throw"XLS Xnum Buffer underflow";return t.read_shift(8,"f")}function t$(t){var e={},r=t.read_shift(1),n=r>>>1,i=t.read_shift(1),s=t.read_shift(2,"i"),o=t.read_shift(1),a=t.read_shift(1),l=t.read_shift(1);switch(t.l++,n){case 0:e.auto=1;break;case 1:e.index=i;var c=gc[i];c&&(e.rgb=Rf(c));break;case 2:e.rgb=Rf([o,a,l]);break;case 3:e.theme=i;break}return s!=0&&(e.tint=s>0?s/32767:s/32768),e}function r$(t){var e=t.read_shift(1);t.l++;var r={fBold:e&1,fItalic:e&2,fUnderline:e&4,fStrikeout:e&8,fOutline:e&16,fShadow:e&32,fCondense:e&64,fExtend:e&128};return r}function jO(t,e){var r={2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"},n=t.read_shift(4);switch(n){case 0:return"";case 4294967295:case 4294967294:return r[t.read_shift(4)]||""}if(n>400)throw new Error("Unsupported Clipboard: "+n.toString(16));return t.l-=4,t.read_shift(0,e==1?"lpstr":"lpwstr")}function n$(t){return jO(t,1)}function i$(t){return jO(t,2)}var Ex=2,ei=3,Lg=11,jR=12,tp=19,$g=64,s$=65,o$=71,a$=4108,l$=4126,Xr=80,KO=81,c$=[Xr,KO],u$={1:{n:"CodePage",t:Ex},2:{n:"Category",t:Xr},3:{n:"PresentationFormat",t:Xr},4:{n:"ByteCount",t:ei},5:{n:"LineCount",t:ei},6:{n:"ParagraphCount",t:ei},7:{n:"SlideCount",t:ei},8:{n:"NoteCount",t:ei},9:{n:"HiddenCount",t:ei},10:{n:"MultimediaClipCount",t:ei},11:{n:"ScaleCrop",t:Lg},12:{n:"HeadingPairs",t:a$},13:{n:"TitlesOfParts",t:l$},14:{n:"Manager",t:Xr},15:{n:"Company",t:Xr},16:{n:"LinksUpToDate",t:Lg},17:{n:"CharacterCount",t:ei},19:{n:"SharedDoc",t:Lg},22:{n:"HyperlinksChanged",t:Lg},23:{n:"AppVersion",t:ei,p:"version"},24:{n:"DigSig",t:s$},26:{n:"ContentType",t:Xr},27:{n:"ContentStatus",t:Xr},28:{n:"Language",t:Xr},29:{n:"Version",t:Xr},255:{},2147483648:{n:"Locale",t:tp},2147483651:{n:"Behavior",t:tp},1919054434:{}},h$={1:{n:"CodePage",t:Ex},2:{n:"Title",t:Xr},3:{n:"Subject",t:Xr},4:{n:"Author",t:Xr},5:{n:"Keywords",t:Xr},6:{n:"Comments",t:Xr},7:{n:"Template",t:Xr},8:{n:"LastAuthor",t:Xr},9:{n:"RevNumber",t:Xr},10:{n:"EditTime",t:$g},11:{n:"LastPrinted",t:$g},12:{n:"CreatedDate",t:$g},13:{n:"ModifiedDate",t:$g},14:{n:"PageCount",t:ei},15:{n:"WordCount",t:ei},16:{n:"CharCount",t:ei},17:{n:"Thumbnail",t:o$},18:{n:"Application",t:Xr},19:{n:"DocSecurity",t:ei},255:{},2147483648:{n:"Locale",t:tp},2147483651:{n:"Behavior",t:tp},1919054434:{}},KR={1:"US",2:"CA",3:"",7:"RU",20:"EG",30:"GR",31:"NL",32:"BE",33:"FR",34:"ES",36:"HU",39:"IT",41:"CH",43:"AT",44:"GB",45:"DK",46:"SE",47:"NO",48:"PL",49:"DE",52:"MX",55:"BR",61:"AU",64:"NZ",66:"TH",81:"JP",82:"KR",84:"VN",86:"CN",90:"TR",105:"JS",213:"DZ",216:"MA",218:"LY",351:"PT",354:"IS",358:"FI",420:"CZ",886:"TW",961:"LB",962:"JO",963:"SY",964:"IQ",965:"KW",966:"SA",971:"AE",972:"IL",974:"QA",981:"IR",65535:"US"},d$=[null,"solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];function f$(t){return t.map(function(e){return[e>>16&255,e>>8&255,e&255]})}var g$=f$([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),gc=sn(g$),kc={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},XO={"#NULL!":0,"#DIV/0!":7,"#VALUE!":15,"#REF!":23,"#NAME?":29,"#NUM!":36,"#N/A":42,"#GETTING_DATA":43,"#WTF?":255},XR={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"};function m$(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function p$(t){var e=m$();if(!t||!t.match)return e;var r={};if((t.match(yn)||[]).forEach(function(n){var i=Qe(n);switch(i[0].replace(EL,"<")){case"<?xml":break;case"<Types":e.xmlns=i["xmlns"+(i[0].match(/<(\w+):/)||["",""])[1]];break;case"<Default":r[i.Extension]=i.ContentType;break;case"<Override":e[XR[i.ContentType]]!==void 0&&e[XR[i.ContentType]].push(i.PartName);break}}),e.xmlns!==NL.CT)throw new Error("Unknown Namespace: "+e.xmlns);return e.calcchain=e.calcchains.length>0?e.calcchains[0]:"",e.sst=e.strs.length>0?e.strs[0]:"",e.style=e.styles.length>0?e.styles[0]:"",e.defaults=r,delete e.calcchains,e}var Hu={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",CHART:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",CHARTEX:"http://schemas.microsoft.com/office/2014/relationships/chartEx",CS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",MS:"http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",IMG:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function Y1(t){var e=t.lastIndexOf("/");return t.slice(0,e+1)+"_rels/"+t.slice(e+1)+".rels"}function Yd(t,e){var r={"!id":{}};if(!t)return r;e.charAt(0)!=="/"&&(e="/"+e);var n={};return(t.match(yn)||[]).forEach(function(i){var s=Qe(i);if(s[0]==="<Relationship"){var o={};o.Type=s.Type,o.Target=s.Target,o.Id=s.Id,s.TargetMode&&(o.TargetMode=s.TargetMode);var a=s.TargetMode==="External"?s.Target:kd(s.Target,e);r[a]=o,n[s.Id]=o}}),r["!id"]=n,r}var w$="application/vnd.oasis.opendocument.spreadsheet";function v$(t,e){for(var r=wx(t),n,i;n=bf.exec(r);)switch(n[3]){case"manifest":break;case"file-entry":if(i=Qe(n[0],!1),i.path=="/"&&i.type!==w$)throw new Error("This OpenDocument is not a spreadsheet");break;case"encryption-data":case"algorithm":case"start-key-generation":case"key-derivation":throw new Error("Unsupported ODS Encryption");default:if(e&&e.WTF)throw n}}var zd=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]],C$=function(){for(var t=new Array(zd.length),e=0;e<zd.length;++e){var r=zd[e],n="(?:"+r[0].slice(0,r[0].indexOf(":"))+":)"+r[0].slice(r[0].indexOf(":")+1);t[e]=new RegExp("<"+n+"[^>]*>([\\s\\S]*?)</"+n+">")}return t}();function qO(t){var e={};t=Jt(t);for(var r=0;r<zd.length;++r){var n=zd[r],i=t.match(C$[r]);i!=null&&i.length>0&&(e[n[1]]=At(i[1])),n[2]==="date"&&e[n[1]]&&(e[n[1]]=Jr(e[n[1]]))}return e}var S$=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]];function ZO(t,e,r,n){var i=[];if(typeof t=="string")i=$R(t,n);else for(var s=0;s<t.length;++s)i=i.concat(t[s].map(function(u){return{v:u}}));var o=typeof e=="string"?$R(e,n).map(function(u){return u.v}):e,a=0,l=0;if(o.length>0)for(var c=0;c!==i.length;c+=2){switch(l=+i[c+1].v,i[c].v){case"Worksheets":case"工作表":case"Листы":case"أوراق العمل":case"ワークシート":case"גליונות עבודה":case"Arbeitsblätter":case"Çalışma Sayfaları":case"Feuilles de calcul":case"Fogli di lavoro":case"Folhas de cálculo":case"Planilhas":case"Regneark":case"Hojas de cálculo":case"Werkbladen":r.Worksheets=l,r.SheetNames=o.slice(a,a+l);break;case"Named Ranges":case"Rangos con nombre":case"名前付き一覧":case"Benannte Bereiche":case"Navngivne områder":r.NamedRanges=l,r.DefinedNames=o.slice(a,a+l);break;case"Charts":case"Diagramme":r.Chartsheets=l,r.ChartNames=o.slice(a,a+l);break}a+=l}}function x$(t,e,r){var n={};return e||(e={}),t=Jt(t),S$.forEach(function(i){var s=(t.match(yf(i[0]))||[])[1];switch(i[2]){case"string":s&&(e[i[1]]=At(s));break;case"bool":e[i[1]]=s==="true";break;case"raw":var o=t.match(new RegExp("<"+i[0]+"[^>]*>([\\s\\S]*?)</"+i[0]+">"));o&&o.length>0&&(n[i[1]]=o[1]);break}}),n.HeadingPairs&&n.TitlesOfParts&&ZO(n.HeadingPairs,n.TitlesOfParts,e,r),e}var y$=/<[^>]+>[^<]*/g;function b$(t,e){var r={},n="",i=t.match(y$);if(i)for(var s=0;s!=i.length;++s){var o=i[s],a=Qe(o);switch(a[0]){case"<?xml":break;case"<Properties":break;case"<property":n=At(a.name);break;case"</property>":n=null;break;default:if(o.indexOf("<vt:")===0){var l=o.split(">"),c=l[0].slice(4),u=l[1];switch(c){case"lpstr":case"bstr":case"lpwstr":r[n]=At(u);break;case"bool":r[n]=ar(u);break;case"i1":case"i2":case"i4":case"i8":case"int":case"uint":r[n]=parseInt(u,10);break;case"r4":case"r8":case"decimal":r[n]=parseFloat(u);break;case"filetime":case"date":r[n]=Jr(u);break;case"cy":case"error":r[n]=At(u);break;default:if(c.slice(-1)=="/")break;e.WTF&&typeof console<"u"&&console.warn("Unexpected",o,c,l)}}else if(o.slice(0,2)!=="</"){if(e.WTF)throw new Error(o)}}}return r}var E$={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"},lv;function R$(t,e,r){lv||(lv=gx(E$)),e=lv[e]||e,t[e]=r}function Rx(t){var e=t.read_shift(4),r=t.read_shift(4);return new Date((r/1e7*Math.pow(2,32)+e/1e7-11644473600)*1e3).toISOString().replace(/\.000/,"")}function JO(t,e,r){var n=t.l,i=t.read_shift(0,"lpstr-cp");if(r)for(;t.l-n&3;)++t.l;return i}function QO(t,e,r){var n=t.read_shift(0,"lpwstr");return n}function eP(t,e,r){return e===31?QO(t):JO(t,e,r)}function z1(t,e,r){return eP(t,e,r===!1?0:4)}function T$(t,e){if(!e)throw new Error("VtUnalignedString must have positive length");return eP(t,e,0)}function _$(t){for(var e=t.read_shift(4),r=[],n=0;n!=e;++n){var i=t.l;r[n]=t.read_shift(0,"lpwstr").replace(Ln,""),t.l-i&2&&(t.l+=2)}return r}function A$(t){for(var e=t.read_shift(4),r=[],n=0;n!=e;++n)r[n]=t.read_shift(0,"lpstr-cp").replace(Ln,"");return r}function M$(t){var e=t.l,r=rp(t,KO);t[t.l]==0&&t[t.l+1]==0&&t.l-e&2&&(t.l+=2);var n=rp(t,ei);return[r,n]}function I$(t){for(var e=t.read_shift(4),r=[],n=0;n<e/2;++n)r.push(M$(t));return r}function qR(t,e){for(var r=t.read_shift(4),n={},i=0;i!=r;++i){var s=t.read_shift(4),o=t.read_shift(4);n[s]=t.read_shift(o,e===1200?"utf16le":"utf8").replace(Ln,"").replace(Dd,"!"),e===1200&&o%2&&(t.l+=2)}return t.l&3&&(t.l=t.l>>3<<2),n}function tP(t){var e=t.read_shift(4),r=t.slice(t.l,t.l+e);return t.l+=e,(e&3)>0&&(t.l+=4-(e&3)&3),r}function O$(t){var e={};return e.Size=t.read_shift(4),t.l+=e.Size+3-(e.Size-1)%4,e}function rp(t,e,r){var n=t.read_shift(2),i,s=r||{};if(t.l+=2,e!==jR&&n!==e&&c$.indexOf(e)===-1&&!((e&65534)==4126&&(n&65534)==4126))throw new Error("Expected type "+e+" saw "+n);switch(e===jR?n:e){case 2:return i=t.read_shift(2,"i"),s.raw||(t.l+=2),i;case 3:return i=t.read_shift(4,"i"),i;case 11:return t.read_shift(4)!==0;case 19:return i=t.read_shift(4),i;case 30:return JO(t,n,4).replace(Ln,"");case 31:return QO(t);case 64:return Rx(t);case 65:return tP(t);case 71:return O$(t);case 80:return z1(t,n,!s.raw).replace(Ln,"");case 81:return T$(t,n).replace(Ln,"");case 4108:return I$(t);case 4126:case 4127:return n==4127?_$(t):A$(t);default:throw new Error("TypedPropertyValue unrecognized type "+e+" "+n)}}function ZR(t,e){var r=t.l,n=t.read_shift(4),i=t.read_shift(4),s=[],o=0,a=0,l=-1,c={};for(o=0;o!=i;++o){var u=t.read_shift(4),h=t.read_shift(4);s[o]=[u,h+r]}s.sort(function(y,C){return y[1]-C[1]});var d={};for(o=0;o!=i;++o){if(t.l!==s[o][1]){var f=!0;if(o>0&&e)switch(e[s[o-1][0]].t){case 2:t.l+2===s[o][1]&&(t.l+=2,f=!1);break;case 80:t.l<=s[o][1]&&(t.l=s[o][1],f=!1);break;case 4108:t.l<=s[o][1]&&(t.l=s[o][1],f=!1);break}if((!e||o==0)&&t.l<=s[o][1]&&(f=!1,t.l=s[o][1]),f)throw new Error("Read Error: Expected address "+s[o][1]+" at "+t.l+" :"+o)}if(e){var g=e[s[o][0]];if(d[g.n]=rp(t,g.t,{raw:!0}),g.p==="version"&&(d[g.n]=String(d[g.n]>>16)+"."+("0000"+String(d[g.n]&65535)).slice(-4)),g.n=="CodePage")switch(d[g.n]){case 0:d[g.n]=1252;case 874:case 932:case 936:case 949:case 950:case 1250:case 1251:case 1253:case 1254:case 1255:case 1256:case 1257:case 1258:case 1e4:case 1200:case 1201:case 1252:case 65e3:case-536:case 65001:case-535:ws(a=d[g.n]>>>0&65535);break;default:throw new Error("Unsupported CodePage: "+d[g.n])}}else if(s[o][0]===1){if(a=d.CodePage=rp(t,Ex),ws(a),l!==-1){var m=t.l;t.l=s[l][1],c=qR(t,a),t.l=m}}else if(s[o][0]===0){if(a===0){l=o,t.l=s[o+1][1];continue}c=qR(t,a)}else{var p=c[s[o][0]],S;switch(t[t.l]){case 65:t.l+=4,S=tP(t);break;case 30:t.l+=4,S=z1(t,t[t.l-4]).replace(/\u0000+$/,"");break;case 31:t.l+=4,S=z1(t,t[t.l-4]).replace(/\u0000+$/,"");break;case 3:t.l+=4,S=t.read_shift(4,"i");break;case 19:t.l+=4,S=t.read_shift(4);break;case 5:t.l+=4,S=t.read_shift(8,"f");break;case 11:t.l+=4,S=Tr(t,4);break;case 64:t.l+=4,S=Jr(Rx(t));break;default:throw new Error("unparsed value: "+t[t.l])}d[p]=S}}return t.l=r+n,d}function JR(t,e,r){var n=t.content;if(!n)return{};nn(n,0);var i,s,o,a,l=0;n.chk("feff","Byte Order: "),n.read_shift(2);var c=n.read_shift(4),u=n.read_shift(16);if(u!==Et.utils.consts.HEADER_CLSID&&u!==r)throw new Error("Bad PropertySet CLSID "+u);if(i=n.read_shift(4),i!==1&&i!==2)throw new Error("Unrecognized #Sets: "+i);if(s=n.read_shift(16),a=n.read_shift(4),i===1&&a!==n.l)throw new Error("Length mismatch: "+a+" !== "+n.l);i===2&&(o=n.read_shift(16),l=n.read_shift(4));var h=ZR(n,e),d={SystemIdentifier:c};for(var f in h)d[f]=h[f];if(d.FMTID=s,i===1)return d;if(l-n.l==2&&(n.l+=2),n.l!==l)throw new Error("Length mismatch 2: "+n.l+" !== "+l);var g;try{g=ZR(n,null)}catch{}for(f in g)d[f]=g[f];return d.FMTID=[s,o],d}function xa(t,e){return t.read_shift(e),null}function P$(t,e,r){for(var n=[],i=t.l+e;t.l<i;)n.push(r(t,i-t.l));if(i!==t.l)throw new Error("Slurp error");return n}function Tr(t,e){return t.read_shift(e)===1}function Dr(t){return t.read_shift(2,"u")}function rP(t,e){return P$(t,e,Dr)}function D$(t){var e=t.read_shift(1),r=t.read_shift(1);return r===1?e:e===1}function Xf(t,e,r){var n=t.read_shift(r&&r.biff>=12?2:1),i="sbcs-cont";if(r&&r.biff>=8,!r||r.biff==8){var s=t.read_shift(1);s&&(i="dbcs-cont")}else r.biff==12&&(i="wstr");r.biff>=2&&r.biff<=5&&(i="cpstr");var o=n?t.read_shift(n,i):"";return o}function k$(t){var e=t.read_shift(2),r=t.read_shift(1),n=r&4,i=r&8,s=1+(r&1),o=0,a,l={};i&&(o=t.read_shift(2)),n&&(a=t.read_shift(4));var c=s==2?"dbcs-cont":"sbcs-cont",u=e===0?"":t.read_shift(e,c);return i&&(t.l+=4*o),n&&(t.l+=a),l.t=u,i||(l.raw="<t>"+l.t+"</t>",l.r=l.t),l}function Cc(t,e,r){var n;if(r){if(r.biff>=2&&r.biff<=5)return t.read_shift(e,"cpstr");if(r.biff>=12)return t.read_shift(e,"dbcs-cont")}var i=t.read_shift(1);return i===0?n=t.read_shift(e,"sbcs-cont"):n=t.read_shift(e,"dbcs-cont"),n}function qf(t,e,r){var n=t.read_shift(r&&r.biff==2?1:2);return n===0?(t.l++,""):Cc(t,n,r)}function Nc(t,e,r){if(r.biff>5)return qf(t,e,r);var n=t.read_shift(1);return n===0?(t.l++,""):t.read_shift(n,r.biff<=4||!t.lens?"cpstr":"sbcs-cont")}function N$(t){var e=t.read_shift(1);t.l++;var r=t.read_shift(2);return t.l+=2,[e,r]}function H$(t){var e=t.read_shift(4),r=t.l,n=!1;e>24&&(t.l+=e-24,t.read_shift(16)==="795881f43b1d7f48af2c825dc4852763"&&(n=!0),t.l=r);var i=t.read_shift((n?e-24:e)>>1,"utf16le").replace(Ln,"");return n&&(t.l+=24),i}function F$(t){for(var e=t.read_shift(2),r="";e-- >0;)r+="../";var n=t.read_shift(0,"lpstr-ansi");if(t.l+=2,t.read_shift(2)!=57005)throw new Error("Bad FileMoniker");var i=t.read_shift(4);if(i===0)return r+n.replace(/\\/g,"/");var s=t.read_shift(4);if(t.read_shift(2)!=3)throw new Error("Bad FileMoniker");var o=t.read_shift(s>>1,"utf16le").replace(Ln,"");return r+o}function L$(t,e){var r=t.read_shift(16);switch(r){case"e0c9ea79f9bace118c8200aa004ba90b":return H$(t);case"0303000000000000c000000000000046":return F$(t);default:throw new Error("Unsupported Moniker "+r)}}function Bg(t){var e=t.read_shift(4),r=e>0?t.read_shift(e,"utf16le").replace(Ln,""):"";return r}function $$(t,e){var r=t.l+e,n=t.read_shift(4);if(n!==2)throw new Error("Unrecognized streamVersion: "+n);var i=t.read_shift(2);t.l+=2;var s,o,a,l,c="",u,h;i&16&&(s=Bg(t,r-t.l)),i&128&&(o=Bg(t,r-t.l)),(i&257)===257&&(a=Bg(t,r-t.l)),(i&257)===1&&(l=L$(t,r-t.l)),i&8&&(c=Bg(t,r-t.l)),i&32&&(u=t.read_shift(16)),i&64&&(h=Rx(t)),t.l=r;var d=o||a||l||"";d&&c&&(d+="#"+c),d||(d="#"+c),i&2&&d.charAt(0)=="/"&&d.charAt(1)!="/"&&(d="file://"+d);var f={Target:d};return u&&(f.guid=u),h&&(f.time=h),s&&(f.Tooltip=s),f}function nP(t){var e=t.read_shift(1),r=t.read_shift(1),n=t.read_shift(1),i=t.read_shift(1);return[e,r,n,i]}function iP(t,e){var r=nP(t);return r[3]=0,r}function vo(t){var e=t.read_shift(2),r=t.read_shift(2),n=t.read_shift(2);return{r:e,c:r,ixfe:n}}function B$(t){var e=t.read_shift(2),r=t.read_shift(2);return t.l+=8,{type:e,flags:r}}function V$(t,e,r){return e===0?"":Nc(t,e,r)}function W$(t,e,r){var n=r.biff>8?4:2,i=t.read_shift(n),s=t.read_shift(n,"i"),o=t.read_shift(n,"i");return[i,s,o]}function sP(t){var e=t.read_shift(2),r=bx(t);return[e,r]}function U$(t,e,r){t.l+=4,e-=4;var n=t.l+e,i=Xf(t,e,r),s=t.read_shift(2);if(n-=t.l,s!==n)throw new Error("Malformed AddinUdf: padding = "+n+" != "+s);return t.l+=s,i}function ew(t){var e=t.read_shift(2),r=t.read_shift(2),n=t.read_shift(2),i=t.read_shift(2);return{s:{c:n,r:e},e:{c:i,r}}}function oP(t){var e=t.read_shift(2),r=t.read_shift(2),n=t.read_shift(1),i=t.read_shift(1);return{s:{c:n,r:e},e:{c:i,r}}}var Y$=oP;function aP(t){t.l+=4;var e=t.read_shift(2),r=t.read_shift(2),n=t.read_shift(2);return t.l+=12,[r,e,n]}function z$(t){var e={};return t.l+=4,t.l+=16,e.fSharedNote=t.read_shift(2),t.l+=4,e}function G$(t){var e={};return t.l+=4,t.cf=t.read_shift(2),e}function cn(t){t.l+=2,t.l+=t.read_shift(2)}var j$={0:cn,4:cn,5:cn,6:cn,7:G$,8:cn,9:cn,10:cn,11:cn,12:cn,13:z$,14:cn,15:cn,16:cn,17:cn,18:cn,19:cn,20:cn,21:aP};function K$(t,e){for(var r=t.l+e,n=[];t.l<r;){var i=t.read_shift(2);t.l-=2;try{n.push(j$[i](t,r-t.l))}catch{return t.l=r,n}}return t.l!=r&&(t.l=r),n}function Vg(t,e){var r={BIFFVer:0,dt:0};switch(r.BIFFVer=t.read_shift(2),e-=2,e>=2&&(r.dt=t.read_shift(2),t.l-=2),r.BIFFVer){case 1536:case 1280:case 1024:case 768:case 512:case 2:case 7:break;default:if(e>6)throw new Error("Unexpected BIFF Ver "+r.BIFFVer)}return t.read_shift(e),r}function X$(t,e){return e===0||t.read_shift(2),1200}function q$(t,e,r){if(r.enc)return t.l+=e,"";var n=t.l,i=Nc(t,0,r);return t.read_shift(e+n-t.l),i}function Z$(t,e,r){var n=r&&r.biff==8||e==2?t.read_shift(2):(t.l+=e,0);return{fDialog:n&16,fBelow:n&64,fRight:n&128}}function J$(t,e,r){var n=t.read_shift(4),i=t.read_shift(1)&3,s=t.read_shift(1);switch(s){case 0:s="Worksheet";break;case 1:s="Macrosheet";break;case 2:s="Chartsheet";break;case 6:s="VBAModule";break}var o=Xf(t,0,r);return o.length===0&&(o="Sheet1"),{pos:n,hs:i,dt:s,name:o}}function Q$(t,e){for(var r=t.l+e,n=t.read_shift(4),i=t.read_shift(4),s=[],o=0;o!=i&&t.l<r;++o)s.push(k$(t));return s.Count=n,s.Unique=i,s}function eB(t,e){var r={};return r.dsst=t.read_shift(2),t.l+=e-2,r}function tB(t){var e={};e.r=t.read_shift(2),e.c=t.read_shift(2),e.cnt=t.read_shift(2)-e.c;var r=t.read_shift(2);t.l+=4;var n=t.read_shift(1);return t.l+=3,n&7&&(e.level=n&7),n&32&&(e.hidden=!0),n&64&&(e.hpt=r/20),e}function rB(t){var e=B$(t);if(e.type!=2211)throw new Error("Invalid Future Record "+e.type);var r=t.read_shift(4);return r!==0}function nB(t){return t.read_shift(2),t.read_shift(4)}function QR(t,e,r){var n=0;r&&r.biff==2||(n=t.read_shift(2));var i=t.read_shift(2);r&&r.biff==2&&(n=1-(i>>15),i&=32767);var s={Unsynced:n&1,DyZero:(n&2)>>1,ExAsc:(n&4)>>2,ExDsc:(n&8)>>3};return[s,i]}function iB(t){var e=t.read_shift(2),r=t.read_shift(2),n=t.read_shift(2),i=t.read_shift(2),s=t.read_shift(2),o=t.read_shift(2),a=t.read_shift(2),l=t.read_shift(2),c=t.read_shift(2);return{Pos:[e,r],Dim:[n,i],Flags:s,CurTab:o,FirstTab:a,Selected:l,TabRatio:c}}function sB(t,e,r){if(r&&r.biff>=2&&r.biff<5)return{};var n=t.read_shift(2);return{RTL:n&64}}function oB(){}function aB(t,e,r){var n={dyHeight:t.read_shift(2),fl:t.read_shift(2)};switch(r&&r.biff||8){case 2:break;case 3:case 4:t.l+=2;break;default:t.l+=10;break}return n.name=Xf(t,0,r),n}function lB(t){var e=vo(t);return e.isst=t.read_shift(4),e}function cB(t,e,r){r.biffguess&&r.biff==2&&(r.biff=5);var n=t.l+e,i=vo(t);r.biff==2&&t.l++;var s=qf(t,n-t.l,r);return i.val=s,i}function uB(t,e,r){var n=t.read_shift(2),i=Nc(t,0,r);return[n,i]}var hB=Nc;function eT(t,e,r){var n=t.l+e,i=r.biff==8||!r.biff?4:2,s=t.read_shift(i),o=t.read_shift(i),a=t.read_shift(2),l=t.read_shift(2);return t.l=n,{s:{r:s,c:a},e:{r:o,c:l}}}function dB(t){var e=t.read_shift(2),r=t.read_shift(2),n=sP(t);return{r:e,c:r,ixfe:n[0],rknum:n[1]}}function fB(t,e){for(var r=t.l+e-2,n=t.read_shift(2),i=t.read_shift(2),s=[];t.l<r;)s.push(sP(t));if(t.l!==r)throw new Error("MulRK read error");var o=t.read_shift(2);if(s.length!=o-i+1)throw new Error("MulRK length mismatch");return{r:n,c:i,C:o,rkrec:s}}function gB(t,e){for(var r=t.l+e-2,n=t.read_shift(2),i=t.read_shift(2),s=[];t.l<r;)s.push(t.read_shift(2));if(t.l!==r)throw new Error("MulBlank read error");var o=t.read_shift(2);if(s.length!=o-i+1)throw new Error("MulBlank length mismatch");return{r:n,c:i,C:o,ixfe:s}}function mB(t,e,r,n){var i={},s=t.read_shift(4),o=t.read_shift(4),a=t.read_shift(4),l=t.read_shift(2);return i.patternType=d$[a>>26],n.cellStyles&&(i.alc=s&7,i.fWrap=s>>3&1,i.alcV=s>>4&7,i.fJustLast=s>>7&1,i.trot=s>>8&255,i.cIndent=s>>16&15,i.fShrinkToFit=s>>20&1,i.iReadOrder=s>>22&2,i.fAtrNum=s>>26&1,i.fAtrFnt=s>>27&1,i.fAtrAlc=s>>28&1,i.fAtrBdr=s>>29&1,i.fAtrPat=s>>30&1,i.fAtrProt=s>>31&1,i.dgLeft=o&15,i.dgRight=o>>4&15,i.dgTop=o>>8&15,i.dgBottom=o>>12&15,i.icvLeft=o>>16&127,i.icvRight=o>>23&127,i.grbitDiag=o>>30&3,i.icvTop=a&127,i.icvBottom=a>>7&127,i.icvDiag=a>>14&127,i.dgDiag=a>>21&15,i.icvFore=l&127,i.icvBack=l>>7&127,i.fsxButton=l>>14&1),i}function pB(t,e,r){var n={};return n.ifnt=t.read_shift(2),n.numFmtId=t.read_shift(2),n.flags=t.read_shift(2),n.fStyle=n.flags>>2&1,e-=6,n.data=mB(t,e,n.fStyle,r),n}function wB(t){t.l+=4;var e=[t.read_shift(2),t.read_shift(2)];if(e[0]!==0&&e[0]--,e[1]!==0&&e[1]--,e[0]>7||e[1]>7)throw new Error("Bad Gutters: "+e.join("|"));return e}function tT(t,e,r){var n=vo(t);(r.biff==2||e==9)&&++t.l;var i=D$(t);return n.val=i,n.t=i===!0||i===!1?"b":"e",n}function vB(t,e,r){r.biffguess&&r.biff==2&&(r.biff=5);var n=vo(t),i=wn(t);return n.val=i,n}var rT=V$;function CB(t,e,r){var n=t.l+e,i=t.read_shift(2),s=t.read_shift(2);if(r.sbcch=s,s==1025||s==14849)return[s,i];if(s<1||s>255)throw new Error("Unexpected SupBook type: "+s);for(var o=Cc(t,s),a=[];n>t.l;)a.push(qf(t));return[s,i,o,a]}function nT(t,e,r){var n=t.read_shift(2),i,s={fBuiltIn:n&1,fWantAdvise:n>>>1&1,fWantPict:n>>>2&1,fOle:n>>>3&1,fOleLink:n>>>4&1,cf:n>>>5&1023,fIcon:n>>>15&1};return r.sbcch===14849&&(i=U$(t,e-2,r)),s.body=i||t.read_shift(e-2),typeof i=="string"&&(s.Name=i),s}var SB=["_xlnm.Consolidate_Area","_xlnm.Auto_Open","_xlnm.Auto_Close","_xlnm.Extract","_xlnm.Database","_xlnm.Criteria","_xlnm.Print_Area","_xlnm.Print_Titles","_xlnm.Recorder","_xlnm.Data_Form","_xlnm.Auto_Activate","_xlnm.Auto_Deactivate","_xlnm.Sheet_Title","_xlnm._FilterDatabase"];function iT(t,e,r){var n=t.l+e,i=t.read_shift(2),s=t.read_shift(1),o=t.read_shift(1),a=t.read_shift(r&&r.biff==2?1:2),l=0;(!r||r.biff>=5)&&(r.biff!=5&&(t.l+=2),l=t.read_shift(2),r.biff==5&&(t.l+=2),t.l+=4);var c=Cc(t,o,r);i&32&&(c=SB[c.charCodeAt(0)]);var u=n-t.l;r&&r.biff==2&&--u;var h=n==t.l||a===0||!(u>0)?[]:tW(t,u,r,a);return{chKey:s,Name:c,itab:l,rgce:h}}function lP(t,e,r){if(r.biff<8)return xB(t,e,r);for(var n=[],i=t.l+e,s=t.read_shift(r.biff>8?4:2);s--!==0;)n.push(W$(t,r.biff>8?12:6,r));if(t.l!=i)throw new Error("Bad ExternSheet: "+t.l+" != "+i);return n}function xB(t,e,r){t[t.l+1]==3&&t[t.l]++;var n=Xf(t,e,r);return n.charCodeAt(0)==3?n.slice(1):n}function yB(t,e,r){if(r.biff<8){t.l+=e;return}var n=t.read_shift(2),i=t.read_shift(2),s=Cc(t,n,r),o=Cc(t,i,r);return[s,o]}function bB(t,e,r){var n=oP(t);t.l++;var i=t.read_shift(1);return e-=8,[rW(t,e,r),i,n]}function sT(t,e,r){var n=Y$(t);switch(r.biff){case 2:t.l++,e-=7;break;case 3:case 4:t.l+=2,e-=8;break;default:t.l+=6,e-=12}return[n,QV(t,e,r)]}function EB(t){var e=t.read_shift(4)!==0,r=t.read_shift(4)!==0,n=t.read_shift(4);return[e,r,n]}function RB(t,e,r){if(!(r.biff<8)){var n=t.read_shift(2),i=t.read_shift(2),s=t.read_shift(2),o=t.read_shift(2),a=Nc(t,0,r);return r.biff<8&&t.read_shift(1),[{r:n,c:i},a,o,s]}}function TB(t,e,r){return RB(t,e,r)}function _B(t,e){for(var r=[],n=t.read_shift(2);n--;)r.push(ew(t));return r}function AB(t,e,r){if(r&&r.biff<8)return IB(t,e,r);var n=aP(t),i=K$(t,e-22,n[1]);return{cmo:n,ft:i}}var MB={8:function(t,e){var r=t.l+e;t.l+=10;var n=t.read_shift(2);t.l+=4,t.l+=2,t.l+=2,t.l+=2,t.l+=4;var i=t.read_shift(1);return t.l+=i,t.l=r,{fmt:n}}};function IB(t,e,r){t.l+=4;var n=t.read_shift(2),i=t.read_shift(2),s=t.read_shift(2);t.l+=2,t.l+=2,t.l+=2,t.l+=2,t.l+=2,t.l+=2,t.l+=2,t.l+=2,t.l+=2,t.l+=6,e-=36;var o=[];return o.push((MB[n]||xn)(t,e,r)),{cmo:[i,n,s],ft:o}}function OB(t,e,r){var n=t.l,i="";try{t.l+=4;var s=(r.lastobj||{cmo:[0,0]}).cmo[1],o;[0,5,7,11,12,14].indexOf(s)==-1?t.l+=6:o=N$(t,6,r);var a=t.read_shift(2);t.read_shift(2),Dr(t,2);var l=t.read_shift(2);t.l+=l;for(var c=1;c<t.lens.length-1;++c){if(t.l-n!=t.lens[c])throw new Error("TxO: bad continue record");var u=t[t.l],h=Cc(t,t.lens[c+1]-t.lens[c]-1);if(i+=h,i.length>=(u?a:2*a))break}if(i.length!==a&&i.length!==a*2)throw new Error("cchText: "+a+" != "+i.length);return t.l=n+e,{t:i}}catch{return t.l=n+e,{t:i}}}function PB(t,e){var r=ew(t);t.l+=16;var n=$$(t,e-24);return[r,n]}function DB(t,e){t.read_shift(2);var r=ew(t),n=t.read_shift((e-10)/2,"dbcs-cont");return n=n.replace(Ln,""),[r,n]}function kB(t){var e=[0,0],r;return r=t.read_shift(2),e[0]=KR[r]||r,r=t.read_shift(2),e[1]=KR[r]||r,e}function NB(t){for(var e=t.read_shift(2),r=[];e-- >0;)r.push(iP(t));return r}function HB(t){for(var e=t.read_shift(2),r=[];e-- >0;)r.push(iP(t));return r}function FB(t){t.l+=2;var e={cxfs:0,crc:0};return e.cxfs=t.read_shift(2),e.crc=t.read_shift(4),e}function cP(t,e,r){if(!r.cellStyles)return xn(t,e);var n=r&&r.biff>=12?4:2,i=t.read_shift(n),s=t.read_shift(n),o=t.read_shift(n),a=t.read_shift(n),l=t.read_shift(2);n==2&&(t.l+=2);var c={s:i,e:s,w:o,ixfe:a,flags:l};return(r.biff>=5||!r.biff)&&(c.level=l>>8&7),c}function LB(t,e){var r={};return e<32||(t.l+=16,r.header=wn(t),r.footer=wn(t),t.l+=2),r}function $B(t,e,r){var n={area:!1};if(r.biff!=5)return t.l+=e,n;var i=t.read_shift(1);return t.l+=3,i&16&&(n.area=!0),n}var BB=vo,VB=rP,WB=qf;function UB(t){var e=t.read_shift(2),r=t.read_shift(2),n=t.read_shift(4),i={fmt:e,env:r,len:n,data:t.slice(t.l,t.l+n)};return t.l+=n,i}function YB(t,e,r){r.biffguess&&r.biff==5&&(r.biff=2);var n=vo(t);++t.l;var i=Nc(t,e-7,r);return n.t="str",n.val=i,n}function zB(t){var e=vo(t);++t.l;var r=wn(t);return e.t="n",e.val=r,e}function GB(t){var e=vo(t);++t.l;var r=t.read_shift(2);return e.t="n",e.val=r,e}function jB(t){var e=t.read_shift(1);return e===0?(t.l++,""):t.read_shift(e,"sbcs-cont")}function KB(t,e){t.l+=6,t.l+=2,t.l+=1,t.l+=3,t.l+=1,t.l+=e-13}function XB(t,e,r){var n=t.l+e,i=vo(t),s=t.read_shift(2),o=Cc(t,s,r);return t.l=n,i.t="str",i.val=o,i}var qB=[2,3,48,49,131,139,140,245],oT=function(){var t={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,20:850,21:437,22:850,23:865,24:437,25:437,26:850,27:437,28:863,29:850,31:852,34:852,35:852,36:860,37:850,38:866,55:850,64:852,77:936,78:949,79:950,80:874,87:1252,88:1252,89:1252,108:863,134:737,135:852,136:857,204:1257,255:16969},e=gx({1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127});function r(a,l){var c=[],u=cl(1);switch(l.type){case"base64":u=ps(Ci(a));break;case"binary":u=ps(a);break;case"buffer":case"array":u=a;break}nn(u,0);var h=u.read_shift(1),d=!!(h&136),f=!1,g=!1;switch(h){case 2:break;case 3:break;case 48:f=!0,d=!0;break;case 49:f=!0,d=!0;break;case 131:break;case 139:break;case 140:g=!0;break;case 245:break;default:throw new Error("DBF Unsupported Version: "+h.toString(16))}var m=0,p=521;h==2&&(m=u.read_shift(2)),u.l+=3,h!=2&&(m=u.read_shift(4)),m>1048576&&(m=1e6),h!=2&&(p=u.read_shift(2));var S=u.read_shift(2),y=l.codepage||1252;h!=2&&(u.l+=16,u.read_shift(1),u[u.l]!==0&&(y=t[u[u.l]]),u.l+=1,u.l+=2),g&&(u.l+=36);for(var C=[],E={},A=Math.min(u.length,h==2?521:p-10-(f?264:0)),O=g?32:11;u.l<A&&u[u.l]!=13;)switch(E={},E.name=Ua.utils.decode(y,u.slice(u.l,u.l+O)).replace(/[\u0000\r\n].*$/g,""),u.l+=O,E.type=String.fromCharCode(u.read_shift(1)),h!=2&&!g&&(E.offset=u.read_shift(4)),E.len=u.read_shift(1),h==2&&(E.offset=u.read_shift(2)),E.dec=u.read_shift(1),E.name.length&&C.push(E),h!=2&&(u.l+=g?13:14),E.type){case"B":(!f||E.len!=8)&&l.WTF&&console.log("Skipping "+E.name+":"+E.type);break;case"G":case"P":l.WTF&&console.log("Skipping "+E.name+":"+E.type);break;case"+":case"0":case"@":case"C":case"D":case"F":case"I":case"L":case"M":case"N":case"O":case"T":case"Y":break;default:throw new Error("Unknown Field Type: "+E.type)}if(u[u.l]!==13&&(u.l=p-1),u.read_shift(1)!==13)throw new Error("DBF Terminator not found "+u.l+" "+u[u.l]);u.l=p;var T=0,W=0;for(c[0]=[],W=0;W!=C.length;++W)c[0][W]=C[W].name;for(;m-- >0;){if(u[u.l]===42){u.l+=S;continue}for(++u.l,c[++T]=[],W=0,W=0;W!=C.length;++W){var I=u.slice(u.l,u.l+C[W].len);u.l+=C[W].len,nn(I,0);var Y=Ua.utils.decode(y,I);switch(C[W].type){case"C":Y.trim().length&&(c[T][W]=Y.replace(/\s+$/,""));break;case"D":Y.length===8?c[T][W]=new Date(+Y.slice(0,4),+Y.slice(4,6)-1,+Y.slice(6,8)):c[T][W]=Y;break;case"F":c[T][W]=parseFloat(Y.trim());break;case"+":case"I":c[T][W]=g?I.read_shift(-4,"i")^2147483648:I.read_shift(4,"i");break;case"L":switch(Y.trim().toUpperCase()){case"Y":case"T":c[T][W]=!0;break;case"N":case"F":c[T][W]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+Y+"|")}break;case"M":if(!d)throw new Error("DBF Unexpected MEMO for type "+h.toString(16));c[T][W]="##MEMO##"+(g?parseInt(Y.trim(),10):I.read_shift(4));break;case"N":Y=Y.replace(/\u0000/g,"").trim(),Y&&Y!="."&&(c[T][W]=+Y||0);break;case"@":c[T][W]=new Date(I.read_shift(-8,"f")-621356832e5);break;case"T":c[T][W]=new Date((I.read_shift(4)-2440588)*864e5+I.read_shift(4));break;case"Y":c[T][W]=I.read_shift(4,"i")/1e4+I.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":c[T][W]=-I.read_shift(-8,"f");break;case"B":if(f&&C[W].len==8){c[T][W]=I.read_shift(8,"f");break}case"G":case"P":I.l+=C[W].len;break;case"0":if(C[W].name==="_NullFlags")break;default:throw new Error("DBF Unsupported data type "+C[W].type)}}}if(h!=2&&u.l<u.length&&u[u.l++]!=26)throw new Error("DBF EOF Marker missing "+(u.l-1)+" of "+u.length+" "+u[u.l-1].toString(16));return l&&l.sheetRows&&(c=c.slice(0,l.sheetRows)),l.DBF=C,c}function n(a,l){var c=l||{};c.dateNF||(c.dateNF="yyyymmdd");var u=dh(r(a,c),c);return u["!cols"]=c.DBF.map(function(h){return{wch:h.len,DBF:h}}),delete c.DBF,u}function i(a,l){try{return gl(n(a,l),l)}catch(c){if(l&&l.WTF)throw c}return{SheetNames:[],Sheets:{}}}var s={B:8,C:250,L:1,D:8,"?":0,"":0};function o(a,l){var c=l||{};if(+c.codepage>=0&&ws(+c.codepage),c.type=="string")throw new Error("Cannot write DBF to JS string");var u=W1(),h=J1(a,{header:1,raw:!0,cellDates:!0}),d=h[0],f=h.slice(1),g=a["!cols"]||[],m=0,p=0,S=0,y=1;for(m=0;m<d.length;++m){if(((g[m]||{}).DBF||{}).name){d[m]=g[m].DBF.name,++S;continue}if(d[m]!=null){if(++S,typeof d[m]=="number"&&(d[m]=d[m].toString(10)),typeof d[m]!="string")throw new Error("DBF Invalid column name "+d[m]+" |"+typeof d[m]+"|");if(d.indexOf(d[m])!==m){for(p=0;p<1024;++p)if(d.indexOf(d[m]+"_"+p)==-1){d[m]+="_"+p;break}}}}var C=br(a["!ref"]),E=[],A=[],O=[];for(m=0;m<=C.e.c-C.s.c;++m){var T="",W="",I=0,Y=[];for(p=0;p<f.length;++p)f[p][m]!=null&&Y.push(f[p][m]);if(Y.length==0||d[m]==null){E[m]="?";continue}for(p=0;p<Y.length;++p){switch(typeof Y[p]){case"number":W="B";break;case"string":W="C";break;case"boolean":W="L";break;case"object":W=Y[p]instanceof Date?"D":"C";break;default:W="C"}I=Math.max(I,String(Y[p]).length),T=T&&T!=W?"C":W}I>250&&(I=250),W=((g[m]||{}).DBF||{}).type,W=="C"&&g[m].DBF.len>I&&(I=g[m].DBF.len),T=="B"&&W=="N"&&(T="N",O[m]=g[m].DBF.dec,I=g[m].DBF.len),A[m]=T=="C"||W=="N"?I:s[T]||0,y+=A[m],E[m]=T}var z=u.next(32);for(z.write_shift(4,318902576),z.write_shift(4,f.length),z.write_shift(2,296+32*S),z.write_shift(2,y),m=0;m<4;++m)z.write_shift(4,0);for(z.write_shift(4,0|(+e[lO]||3)<<8),m=0,p=0;m<d.length;++m)if(d[m]!=null){var U=u.next(32),oe=(d[m].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11);U.write_shift(1,oe,"sbcs"),U.write_shift(1,E[m]=="?"?"C":E[m],"sbcs"),U.write_shift(4,p),U.write_shift(1,A[m]||s[E[m]]||0),U.write_shift(1,O[m]||0),U.write_shift(1,2),U.write_shift(4,0),U.write_shift(1,0),U.write_shift(4,0),U.write_shift(4,0),p+=A[m]||s[E[m]]||0}var Ce=u.next(264);for(Ce.write_shift(4,13),m=0;m<65;++m)Ce.write_shift(4,0);for(m=0;m<f.length;++m){var pe=u.next(y);for(pe.write_shift(1,0),p=0;p<d.length;++p)if(d[p]!=null)switch(E[p]){case"L":pe.write_shift(1,f[m][p]==null?63:f[m][p]?84:70);break;case"B":pe.write_shift(8,f[m][p]||0,"f");break;case"N":var Te="0";for(typeof f[m][p]=="number"&&(Te=f[m][p].toFixed(O[p]||0)),S=0;S<A[p]-Te.length;++S)pe.write_shift(1,32);pe.write_shift(1,Te,"sbcs");break;case"D":f[m][p]?(pe.write_shift(4,("0000"+f[m][p].getFullYear()).slice(-4),"sbcs"),pe.write_shift(2,("00"+(f[m][p].getMonth()+1)).slice(-2),"sbcs"),pe.write_shift(2,("00"+f[m][p].getDate()).slice(-2),"sbcs")):pe.write_shift(8,"00000000","sbcs");break;case"C":var Se=String(f[m][p]!=null?f[m][p]:"").slice(0,A[p]);for(pe.write_shift(1,Se,"sbcs"),S=0;S<A[p]-Se.length;++S)pe.write_shift(1,32);break}}return u.next(1).write_shift(1,26),u.end()}return{to_workbook:i,to_sheet:n,from_sheet:o}}(),ZB=function(){var t={AA:"À",BA:"Á",CA:"Â",DA:195,HA:"Ä",JA:197,AE:"È",BE:"É",CE:"Ê",HE:"Ë",AI:"Ì",BI:"Í",CI:"Î",HI:"Ï",AO:"Ò",BO:"Ó",CO:"Ô",DO:213,HO:"Ö",AU:"Ù",BU:"Ú",CU:"Û",HU:"Ü",Aa:"à",Ba:"á",Ca:"â",Da:227,Ha:"ä",Ja:229,Ae:"è",Be:"é",Ce:"ê",He:"ë",Ai:"ì",Bi:"í",Ci:"î",Hi:"ï",Ao:"ò",Bo:"ó",Co:"ô",Do:245,Ho:"ö",Au:"ù",Bu:"ú",Cu:"û",Hu:"ü",KC:"Ç",Kc:"ç",q:"æ",z:"œ",a:"Æ",j:"Œ",DN:209,Dn:241,Hy:255,S:169,c:170,R:174,"B ":180,0:176,1:177,2:178,3:179,5:181,6:182,7:183,Q:185,k:186,b:208,i:216,l:222,s:240,y:248,"!":161,'"':162,"#":163,"(":164,"%":165,"'":167,"H ":168,"+":171,";":187,"<":188,"=":189,">":190,"?":191,"{":223},e=new RegExp("\x1BN("+fo(t).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),r=function(d,f){var g=t[f];return typeof g=="number"?yR(g):g},n=function(d,f,g){var m=f.charCodeAt(0)-32<<4|g.charCodeAt(0)-48;return m==59?d:yR(m)};t["|"]=254;function i(d,f){switch(f.type){case"base64":return s(Ci(d),f);case"binary":return s(d,f);case"buffer":return s(yt&&Buffer.isBuffer(d)?d.toString("binary"):Oc(d),f);case"array":return s(vc(d),f)}throw new Error("Unrecognized type "+f.type)}function s(d,f){var g=d.split(/[\n\r]+/),m=-1,p=-1,S=0,y=0,C=[],E=[],A=null,O={},T=[],W=[],I=[],Y=0,z;for(+f.codepage>=0&&ws(+f.codepage);S!==g.length;++S){Y=0;var U=g[S].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,n).replace(e,r),oe=U.replace(/;;/g,"\0").split(";").map(function(b){return b.replace(/\u0000/g,";")}),Ce=oe[0],pe;if(U.length>0)switch(Ce){case"ID":break;case"E":break;case"B":break;case"O":break;case"W":break;case"P":oe[1].charAt(0)=="P"&&E.push(U.slice(3).replace(/;;/g,";"));break;case"C":var Te=!1,Se=!1,Ae=!1,q=!1,Oe=-1,v=-1;for(y=1;y<oe.length;++y)switch(oe[y].charAt(0)){case"A":break;case"X":p=parseInt(oe[y].slice(1))-1,Se=!0;break;case"Y":for(m=parseInt(oe[y].slice(1))-1,Se||(p=0),z=C.length;z<=m;++z)C[z]=[];break;case"K":pe=oe[y].slice(1),pe.charAt(0)==='"'?pe=pe.slice(1,pe.length-1):pe==="TRUE"?pe=!0:pe==="FALSE"?pe=!1:isNaN(xs(pe))?isNaN(nh(pe).getDate())||(pe=Jr(pe)):(pe=xs(pe),A!==null&&uh(A)&&(pe=Qp(pe))),Te=!0;break;case"E":q=!0;var w=Gu(oe[y].slice(1),{r:m,c:p});C[m][p]=[C[m][p],w];break;case"S":Ae=!0,C[m][p]=[C[m][p],"S5S"];break;case"G":break;case"R":Oe=parseInt(oe[y].slice(1))-1;break;case"C":v=parseInt(oe[y].slice(1))-1;break;default:if(f&&f.WTF)throw new Error("SYLK bad record "+U)}if(Te&&(C[m][p]&&C[m][p].length==2?C[m][p][0]=pe:C[m][p]=pe,A=null),Ae){if(q)throw new Error("SYLK shared formula cannot have own formula");var x=Oe>-1&&C[Oe][v];if(!x||!x[1])throw new Error("SYLK shared formula cannot find base");C[m][p][1]=CP(x[1],{r:m-Oe,c:p-v})}break;case"F":var R=0;for(y=1;y<oe.length;++y)switch(oe[y].charAt(0)){case"X":p=parseInt(oe[y].slice(1))-1,++R;break;case"Y":for(m=parseInt(oe[y].slice(1))-1,z=C.length;z<=m;++z)C[z]=[];break;case"M":Y=parseInt(oe[y].slice(1))/20;break;case"F":break;case"G":break;case"P":A=E[parseInt(oe[y].slice(1))];break;case"S":break;case"D":break;case"N":break;case"W":for(I=oe[y].slice(1).split(" "),z=parseInt(I[0],10);z<=parseInt(I[1],10);++z)Y=parseInt(I[2],10),W[z-1]=Y===0?{hidden:!0}:{wch:Y},ih(W[z-1]);break;case"C":p=parseInt(oe[y].slice(1))-1,W[p]||(W[p]={});break;case"R":m=parseInt(oe[y].slice(1))-1,T[m]||(T[m]={}),Y>0?(T[m].hpt=Y,T[m].hpx=Tf(Y)):Y===0&&(T[m].hidden=!0);break;default:if(f&&f.WTF)throw new Error("SYLK bad record "+U)}R<1&&(A=null);break;default:if(f&&f.WTF)throw new Error("SYLK bad record "+U)}}return T.length>0&&(O["!rows"]=T),W.length>0&&(O["!cols"]=W),f&&f.sheetRows&&(C=C.slice(0,f.sheetRows)),[C,O]}function o(d,f){var g=i(d,f),m=g[0],p=g[1],S=dh(m,f);return fo(p).forEach(function(y){S[y]=p[y]}),S}function a(d,f){return gl(o(d,f),f)}function l(d,f,g,m){var p="C;Y"+(g+1)+";X"+(m+1)+";K";switch(d.t){case"n":p+=d.v||0,d.f&&!d.F&&(p+=";E"+F3(d.f,{r:g,c:m}));break;case"b":p+=d.v?"TRUE":"FALSE";break;case"e":p+=d.w||d.v;break;case"d":p+='"'+(d.w||d.v)+'"';break;case"s":p+='"'+d.v.replace(/"/g,"").replace(/;/g,";;")+'"';break}return p}function c(d,f){f.forEach(function(g,m){var p="F;W"+(m+1)+" "+(m+1)+" ";g.hidden?p+="0":(typeof g.width=="number"&&!g.wpx&&(g.wpx=ip(g.width)),typeof g.wpx=="number"&&!g.wch&&(g.wch=sp(g.wpx)),typeof g.wch=="number"&&(p+=Math.round(g.wch))),p.charAt(p.length-1)!=" "&&d.push(p)})}function u(d,f){f.forEach(function(g,m){var p="F;";g.hidden?p+="M0;":g.hpt?p+="M"+20*g.hpt+";":g.hpx&&(p+="M"+20*pP(g.hpx)+";"),p.length>2&&d.push(p+"R"+(m+1))})}function h(d,f){var g=["ID;PWXL;N;E"],m=[],p=br(d["!ref"]),S,y=Array.isArray(d),C=`\r
  14. `;g.push("P;PGeneral"),g.push("F;P0;DG0G8;M255"),d["!cols"]&&c(g,d["!cols"]),d["!rows"]&&u(g,d["!rows"]),g.push("B;Y"+(p.e.r-p.s.r+1)+";X"+(p.e.c-p.s.c+1)+";D"+[p.s.c,p.s.r,p.e.c,p.e.r].join(" "));for(var E=p.s.r;E<=p.e.r;++E)for(var A=p.s.c;A<=p.e.c;++A){var O=nt({r:E,c:A});S=y?(d[E]||[])[A]:d[O],!(!S||S.v==null&&(!S.f||S.F))&&m.push(l(S,d,E,A))}return g.join(C)+C+m.join(C)+C+"E"+C}return{to_workbook:a,to_sheet:o,from_sheet:h}}(),JB=function(){function t(s,o){switch(o.type){case"base64":return e(Ci(s),o);case"binary":return e(s,o);case"buffer":return e(yt&&Buffer.isBuffer(s)?s.toString("binary"):Oc(s),o);case"array":return e(vc(s),o)}throw new Error("Unrecognized type "+o.type)}function e(s,o){for(var a=s.split(`
  15. `),l=-1,c=-1,u=0,h=[];u!==a.length;++u){if(a[u].trim()==="BOT"){h[++l]=[],c=0;continue}if(!(l<0)){var d=a[u].trim().split(","),f=d[0],g=d[1];++u;for(var m=a[u]||"";(m.match(/["]/g)||[]).length&1&&u<a.length-1;)m+=`
  16. `+a[++u];switch(m=m.trim(),+f){case-1:if(m==="BOT"){h[++l]=[],c=0;continue}else if(m!=="EOD")throw new Error("Unrecognized DIF special command "+m);break;case 0:m==="TRUE"?h[l][c]=!0:m==="FALSE"?h[l][c]=!1:isNaN(xs(g))?isNaN(nh(g).getDate())?h[l][c]=g:h[l][c]=Jr(g):h[l][c]=xs(g),++c;break;case 1:m=m.slice(1,m.length-1),m=m.replace(/""/g,'"'),m&&m.match(/^=".*"$/)&&(m=m.slice(2,-1)),h[l][c++]=m!==""?m:null;break}if(m==="EOD")break}}return o&&o.sheetRows&&(h=h.slice(0,o.sheetRows)),h}function r(s,o){return dh(t(s,o),o)}function n(s,o){return gl(r(s,o),o)}var i=function(){var s=function(l,c,u,h,d){l.push(c),l.push(u+","+h),l.push('"'+d.replace(/"/g,'""')+'"')},o=function(l,c,u,h){l.push(c+","+u),l.push(c==1?'"'+h.replace(/"/g,'""')+'"':h)};return function(l){var c=[],u=br(l["!ref"]),h,d=Array.isArray(l);s(c,"TABLE",0,1,"sheetjs"),s(c,"VECTORS",0,u.e.r-u.s.r+1,""),s(c,"TUPLES",0,u.e.c-u.s.c+1,""),s(c,"DATA",0,0,"");for(var f=u.s.r;f<=u.e.r;++f){o(c,-1,0,"BOT");for(var g=u.s.c;g<=u.e.c;++g){var m=nt({r:f,c:g});if(h=d?(l[f]||[])[g]:l[m],!h){o(c,1,0,"");continue}switch(h.t){case"n":var p=h.w;!p&&h.v!=null&&(p=h.v),p==null?h.f&&!h.F?o(c,1,0,"="+h.f):o(c,1,0,""):o(c,0,p,"V");break;case"b":o(c,0,h.v?1:0,h.v?"TRUE":"FALSE");break;case"s":o(c,1,0,isNaN(h.v)?h.v:'="'+h.v+'"');break;case"d":h.w||(h.w=Ui(h.z||ot[14],$n(Jr(h.v)))),o(c,0,h.w,"V");break;default:o(c,1,0,"")}}}o(c,-1,0,"EOD");var S=`\r
  17. `,y=c.join(S);return y}}();return{to_workbook:n,to_sheet:r,from_sheet:i}}(),QB=function(){function t(h){return h.replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,`
  18. `)}function e(h){return h.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function r(h,d){for(var f=h.split(`
  19. `),g=-1,m=-1,p=0,S=[];p!==f.length;++p){var y=f[p].trim().split(":");if(y[0]==="cell"){var C=Fn(y[1]);if(S.length<=C.r)for(g=S.length;g<=C.r;++g)S[g]||(S[g]=[]);switch(g=C.r,m=C.c,y[2]){case"t":S[g][m]=t(y[3]);break;case"v":S[g][m]=+y[3];break;case"vtf":var E=y[y.length-1];case"vtc":switch(y[3]){case"nl":S[g][m]=!!+y[4];break;default:S[g][m]=+y[4];break}y[2]=="vtf"&&(S[g][m]=[S[g][m],E])}}}return d&&d.sheetRows&&(S=S.slice(0,d.sheetRows)),S}function n(h,d){return dh(r(h,d),d)}function i(h,d){return gl(n(h,d),d)}var s=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join(`
  20. `),o=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join(`
  21. `)+`
  22. `,a=["# SocialCalc Spreadsheet Control Save","part:sheet"].join(`
  23. `),l="--SocialCalcSpreadsheetControlSave--";function c(h){if(!h||!h["!ref"])return"";for(var d=[],f=[],g,m="",p=hh(h["!ref"]),S=Array.isArray(h),y=p.s.r;y<=p.e.r;++y)for(var C=p.s.c;C<=p.e.c;++C)if(m=nt({r:y,c:C}),g=S?(h[y]||[])[C]:h[m],!(!g||g.v==null||g.t==="z")){switch(f=["cell",m,"t"],g.t){case"s":case"str":f.push(e(g.v));break;case"n":g.f?(f[2]="vtf",f[3]="n",f[4]=g.v,f[5]=e(g.f)):(f[2]="v",f[3]=g.v);break;case"b":f[2]="vt"+(g.f?"f":"c"),f[3]="nl",f[4]=g.v?"1":"0",f[5]=e(g.f||(g.v?"TRUE":"FALSE"));break;case"d":var E=$n(Jr(g.v));f[2]="vtc",f[3]="nd",f[4]=""+E,f[5]=g.w||Ui(g.z||ot[14],E);break;case"e":continue}d.push(f.join(":"))}return d.push("sheet:c:"+(p.e.c-p.s.c+1)+":r:"+(p.e.r-p.s.r+1)+":tvf:1"),d.push("valueformat:1:text-wiki"),d.join(`
  24. `)}function u(h){return[s,o,a,o,c(h),l].join(`
  25. `)}return{to_workbook:i,to_sheet:n,from_sheet:u}}(),Ef=function(){function t(u,h,d,f,g){g.raw?h[d][f]=u:u===""||(u==="TRUE"?h[d][f]=!0:u==="FALSE"?h[d][f]=!1:isNaN(xs(u))?isNaN(nh(u).getDate())?h[d][f]=u:h[d][f]=Jr(u):h[d][f]=xs(u))}function e(u,h){var d=h||{},f=[];if(!u||u.length===0)return f;for(var g=u.split(/[\r\n]/),m=g.length-1;m>=0&&g[m].length===0;)--m;for(var p=10,S=0,y=0;y<=m;++y)S=g[y].indexOf(" "),S==-1?S=g[y].length:S++,p=Math.max(p,S);for(y=0;y<=m;++y){f[y]=[];var C=0;for(t(g[y].slice(0,p).trim(),f,y,C,d),C=1;C<=(g[y].length-p)/10+1;++C)t(g[y].slice(p+(C-1)*10,p+C*10).trim(),f,y,C,d)}return d.sheetRows&&(f=f.slice(0,d.sheetRows)),f}var r={44:",",9:" ",59:";",124:"|"},n={44:3,9:2,59:1,124:0};function i(u){for(var h={},d=!1,f=0,g=0;f<u.length;++f)(g=u.charCodeAt(f))==34?d=!d:!d&&g in r&&(h[g]=(h[g]||0)+1);g=[];for(f in h)Object.prototype.hasOwnProperty.call(h,f)&&g.push([h[f],f]);if(!g.length){h=n;for(f in h)Object.prototype.hasOwnProperty.call(h,f)&&g.push([h[f],f])}return g.sort(function(m,p){return m[0]-p[0]||n[m[1]]-n[p[1]]}),r[g.pop()[1]]||44}function s(u,h){var d=h||{},f="",g=d.dense?[]:{},m={s:{c:0,r:0},e:{c:0,r:0}};u.slice(0,4)=="sep="?u.charCodeAt(5)==13&&u.charCodeAt(6)==10?(f=u.charAt(4),u=u.slice(7)):u.charCodeAt(5)==13||u.charCodeAt(5)==10?(f=u.charAt(4),u=u.slice(6)):f=i(u.slice(0,1024)):d&&d.FS?f=d.FS:f=i(u.slice(0,1024));var p=0,S=0,y=0,C=0,E=0,A=f.charCodeAt(0),O=!1,T=0,W=u.charCodeAt(0);u=u.replace(/\r\n/mg,`
  26. `);var I=d.dateNF!=null?uL(d.dateNF):null;function Y(){var z=u.slice(C,E),U={};if(z.charAt(0)=='"'&&z.charAt(z.length-1)=='"'&&(z=z.slice(1,-1).replace(/""/g,'"')),z.length===0)U.t="z";else if(d.raw)U.t="s",U.v=z;else if(z.trim().length===0)U.t="s",U.v=z;else if(z.charCodeAt(0)==61)z.charCodeAt(1)==34&&z.charCodeAt(z.length-1)==34?(U.t="s",U.v=z.slice(2,-1).replace(/""/g,'"')):$3(z)?(U.t="n",U.f=z.slice(1)):(U.t="s",U.v=z);else if(z=="TRUE")U.t="b",U.v=!0;else if(z=="FALSE")U.t="b",U.v=!1;else if(!isNaN(y=xs(z)))U.t="n",d.cellText!==!1&&(U.w=z),U.v=y;else if(!isNaN(nh(z).getDate())||I&&z.match(I)){U.z=d.dateNF||ot[14];var oe=0;I&&z.match(I)&&(z=hL(z,d.dateNF,z.match(I)||[]),oe=1),d.cellDates?(U.t="d",U.v=Jr(z,oe)):(U.t="n",U.v=$n(Jr(z,oe))),d.cellText!==!1&&(U.w=Ui(U.z,U.v instanceof Date?$n(U.v):U.v)),d.cellNF||delete U.z}else U.t="s",U.v=z;if(U.t=="z"||(d.dense?(g[p]||(g[p]=[]),g[p][S]=U):g[nt({c:S,r:p})]=U),C=E+1,W=u.charCodeAt(C),m.e.c<S&&(m.e.c=S),m.e.r<p&&(m.e.r=p),T==A)++S;else if(S=0,++p,d.sheetRows&&d.sheetRows<=p)return!0}e:for(;E<u.length;++E)switch(T=u.charCodeAt(E)){case 34:W===34&&(O=!O);break;case A:case 10:case 13:if(!O&&Y())break e;break}return E-C>0&&Y(),g["!ref"]=Rt(m),g}function o(u,h){return!(h&&h.PRN)||h.FS||u.slice(0,4)=="sep="||u.indexOf(" ")>=0||u.indexOf(",")>=0||u.indexOf(";")>=0?s(u,h):dh(e(u,h),h)}function a(u,h){var d="",f=h.type=="string"?[0,0,0,0]:Dx(u,h);switch(h.type){case"base64":d=Ci(u);break;case"binary":d=u;break;case"buffer":h.codepage==65001?d=u.toString("utf8"):h.codepage&&typeof Ua<"u"?d=Ua.utils.decode(h.codepage,u):d=yt&&Buffer.isBuffer(u)?u.toString("binary"):Oc(u);break;case"array":d=vc(u);break;case"string":d=u;break;default:throw new Error("Unrecognized type "+h.type)}return f[0]==239&&f[1]==187&&f[2]==191?d=Jt(d.slice(3)):h.type!="string"&&h.type!="buffer"&&h.codepage==65001?d=Jt(d):h.type=="binary"&&typeof Ua<"u"&&h.codepage&&(d=Ua.utils.decode(h.codepage,Ua.utils.encode(28591,d))),d.slice(0,19)=="socialcalc:version:"?QB.to_sheet(h.type=="string"?d:Jt(d),h):o(d,h)}function l(u,h){return gl(a(u,h),h)}function c(u){for(var h=[],d=br(u["!ref"]),f,g=Array.isArray(u),m=d.s.r;m<=d.e.r;++m){for(var p=[],S=d.s.c;S<=d.e.c;++S){var y=nt({r:m,c:S});if(f=g?(u[m]||[])[S]:u[y],!f||f.v==null){p.push(" ");continue}for(var C=(f.w||(sa(f),f.w)||"").slice(0,10);C.length<10;)C+=" ";p.push(C+(S===0?" ":""))}h.push(p.join(""))}return h.join(`
  27. `)}return{to_workbook:l,to_sheet:a,from_sheet:c}}();function e4(t,e){var r=e||{},n=!!r.WTF;r.WTF=!0;try{var i=ZB.to_workbook(t,r);return r.WTF=n,i}catch(s){if(r.WTF=n,!s.message.match(/SYLK bad record ID/)&&n)throw s;return Ef.to_workbook(t,e)}}var Gd=function(){function t(w,x,R){if(w){nn(w,w.l||0);for(var b=R.Enum||Oe;w.l<w.length;){var B=w.read_shift(2),X=b[B]||b[65535],ne=w.read_shift(2),fe=w.l+ne,le=X.f&&X.f(w,ne,R);if(w.l=fe,x(le,X,B))return}}}function e(w,x){switch(x.type){case"base64":return r(ps(Ci(w)),x);case"binary":return r(ps(w),x);case"buffer":case"array":return r(w,x)}throw"Unsupported type "+x.type}function r(w,x){if(!w)return w;var R=x||{},b=R.dense?[]:{},B="Sheet1",X="",ne=0,fe={},le=[],we=[],N={s:{r:0,c:0},e:{r:0,c:0}},Fe=R.sheetRows||0;if(w[2]==0&&(w[3]==8||w[3]==9)&&w.length>=16&&w[14]==5&&w[15]===108)throw new Error("Unsupported Works 3 for Mac file");if(w[2]==2)R.Enum=Oe,t(w,function(xe,Ye,Ve){switch(Ve){case 0:R.vers=xe,xe>=4096&&(R.qpro=!0);break;case 6:N=xe;break;case 204:xe&&(X=xe);break;case 222:X=xe;break;case 15:case 51:R.qpro||(xe[1].v=xe[1].v.slice(1));case 13:case 14:case 16:Ve==14&&(xe[2]&112)==112&&(xe[2]&15)>1&&(xe[2]&15)<15&&(xe[1].z=R.dateNF||ot[14],R.cellDates&&(xe[1].t="d",xe[1].v=Qp(xe[1].v))),R.qpro&&xe[3]>ne&&(b["!ref"]=Rt(N),fe[B]=b,le.push(B),b=R.dense?[]:{},N={s:{r:0,c:0},e:{r:0,c:0}},ne=xe[3],B=X||"Sheet"+(ne+1),X="");var M=R.dense?(b[xe[0].r]||[])[xe[0].c]:b[nt(xe[0])];if(M){M.t=xe[1].t,M.v=xe[1].v,xe[1].z!=null&&(M.z=xe[1].z),xe[1].f!=null&&(M.f=xe[1].f);break}R.dense?(b[xe[0].r]||(b[xe[0].r]=[]),b[xe[0].r][xe[0].c]=xe[1]):b[nt(xe[0])]=xe[1];break}},R);else if(w[2]==26||w[2]==14)R.Enum=v,w[2]==14&&(R.qpro=!0,w.l=0),t(w,function(xe,Ye,Ve){switch(Ve){case 204:B=xe;break;case 22:xe[1].v=xe[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:if(xe[3]>ne&&(b["!ref"]=Rt(N),fe[B]=b,le.push(B),b=R.dense?[]:{},N={s:{r:0,c:0},e:{r:0,c:0}},ne=xe[3],B="Sheet"+(ne+1)),Fe>0&&xe[0].r>=Fe)break;R.dense?(b[xe[0].r]||(b[xe[0].r]=[]),b[xe[0].r][xe[0].c]=xe[1]):b[nt(xe[0])]=xe[1],N.e.c<xe[0].c&&(N.e.c=xe[0].c),N.e.r<xe[0].r&&(N.e.r=xe[0].r);break;case 27:xe[14e3]&&(we[xe[14e3][0]]=xe[14e3][1]);break;case 1537:we[xe[0]]=xe[1],xe[0]==ne&&(B=xe[1]);break}},R);else throw new Error("Unrecognized LOTUS BOF "+w[2]);if(b["!ref"]=Rt(N),fe[X||B]=b,le.push(X||B),!we.length)return{SheetNames:le,Sheets:fe};for(var ie={},Be=[],Ie=0;Ie<we.length;++Ie)fe[le[Ie]]?(Be.push(we[Ie]||le[Ie]),ie[we[Ie]]=fe[we[Ie]]||fe[le[Ie]]):(Be.push(we[Ie]),ie[we[Ie]]={"!ref":"A1"});return{SheetNames:Be,Sheets:ie}}function n(w,x){var R=x||{};if(+R.codepage>=0&&ws(+R.codepage),R.type=="string")throw new Error("Cannot write WK1 to JS string");var b=W1(),B=br(w["!ref"]),X=Array.isArray(w),ne=[];qi(b,0,s(1030)),qi(b,6,l(B));for(var fe=Math.min(B.e.r,8191),le=B.s.r;le<=fe;++le)for(var we=on(le),N=B.s.c;N<=B.e.c;++N){le===B.s.r&&(ne[N]=Br(N));var Fe=ne[N]+we,ie=X?(w[le]||[])[N]:w[Fe];if(!(!ie||ie.t=="z"))if(ie.t=="n")(ie.v|0)==ie.v&&ie.v>=-32768&&ie.v<=32767?qi(b,13,f(le,N,ie.v)):qi(b,14,m(le,N,ie.v));else{var Be=sa(ie);qi(b,15,h(le,N,Be.slice(0,239)))}}return qi(b,1),b.end()}function i(w,x){var R=x||{};if(+R.codepage>=0&&ws(+R.codepage),R.type=="string")throw new Error("Cannot write WK3 to JS string");var b=W1();qi(b,0,o(w));for(var B=0,X=0;B<w.SheetNames.length;++B)(w.Sheets[w.SheetNames[B]]||{})["!ref"]&&qi(b,27,q(w.SheetNames[B],X++));var ne=0;for(B=0;B<w.SheetNames.length;++B){var fe=w.Sheets[w.SheetNames[B]];if(!(!fe||!fe["!ref"])){for(var le=br(fe["!ref"]),we=Array.isArray(fe),N=[],Fe=Math.min(le.e.r,8191),ie=le.s.r;ie<=Fe;++ie)for(var Be=on(ie),Ie=le.s.c;Ie<=le.e.c;++Ie){ie===le.s.r&&(N[Ie]=Br(Ie));var xe=N[Ie]+Be,Ye=we?(fe[ie]||[])[Ie]:fe[xe];if(!(!Ye||Ye.t=="z"))if(Ye.t=="n")qi(b,23,Y(ie,Ie,ne,Ye.v));else{var Ve=sa(Ye);qi(b,22,T(ie,Ie,ne,Ve.slice(0,239)))}}++ne}}return qi(b,1),b.end()}function s(w){var x=$r(2);return x.write_shift(2,w),x}function o(w){var x=$r(26);x.write_shift(2,4096),x.write_shift(2,4),x.write_shift(4,0);for(var R=0,b=0,B=0,X=0;X<w.SheetNames.length;++X){var ne=w.SheetNames[X],fe=w.Sheets[ne];if(!(!fe||!fe["!ref"])){++B;var le=hh(fe["!ref"]);R<le.e.r&&(R=le.e.r),b<le.e.c&&(b=le.e.c)}}return R>8191&&(R=8191),x.write_shift(2,R),x.write_shift(1,B),x.write_shift(1,b),x.write_shift(2,0),x.write_shift(2,0),x.write_shift(1,1),x.write_shift(1,2),x.write_shift(4,0),x.write_shift(4,0),x}function a(w,x,R){var b={s:{c:0,r:0},e:{c:0,r:0}};return x==8&&R.qpro?(b.s.c=w.read_shift(1),w.l++,b.s.r=w.read_shift(2),b.e.c=w.read_shift(1),w.l++,b.e.r=w.read_shift(2),b):(b.s.c=w.read_shift(2),b.s.r=w.read_shift(2),x==12&&R.qpro&&(w.l+=2),b.e.c=w.read_shift(2),b.e.r=w.read_shift(2),x==12&&R.qpro&&(w.l+=2),b.s.c==65535&&(b.s.c=b.e.c=b.s.r=b.e.r=0),b)}function l(w){var x=$r(8);return x.write_shift(2,w.s.c),x.write_shift(2,w.s.r),x.write_shift(2,w.e.c),x.write_shift(2,w.e.r),x}function c(w,x,R){var b=[{c:0,r:0},{t:"n",v:0},0,0];return R.qpro&&R.vers!=20768?(b[0].c=w.read_shift(1),b[3]=w.read_shift(1),b[0].r=w.read_shift(2),w.l+=2):(b[2]=w.read_shift(1),b[0].c=w.read_shift(2),b[0].r=w.read_shift(2)),b}function u(w,x,R){var b=w.l+x,B=c(w,x,R);if(B[1].t="s",R.vers==20768){w.l++;var X=w.read_shift(1);return B[1].v=w.read_shift(X,"utf8"),B}return R.qpro&&w.l++,B[1].v=w.read_shift(b-w.l,"cstr"),B}function h(w,x,R){var b=$r(7+R.length);b.write_shift(1,255),b.write_shift(2,x),b.write_shift(2,w),b.write_shift(1,39);for(var B=0;B<b.length;++B){var X=R.charCodeAt(B);b.write_shift(1,X>=128?95:X)}return b.write_shift(1,0),b}function d(w,x,R){var b=c(w,x,R);return b[1].v=w.read_shift(2,"i"),b}function f(w,x,R){var b=$r(7);return b.write_shift(1,255),b.write_shift(2,x),b.write_shift(2,w),b.write_shift(2,R,"i"),b}function g(w,x,R){var b=c(w,x,R);return b[1].v=w.read_shift(8,"f"),b}function m(w,x,R){var b=$r(13);return b.write_shift(1,255),b.write_shift(2,x),b.write_shift(2,w),b.write_shift(8,R,"f"),b}function p(w,x,R){var b=w.l+x,B=c(w,x,R);if(B[1].v=w.read_shift(8,"f"),R.qpro)w.l=b;else{var X=w.read_shift(2);E(w.slice(w.l,w.l+X),B),w.l+=X}return B}function S(w,x,R){var b=x&32768;return x&=-32769,x=(b?w:0)+(x>=8192?x-16384:x),(b?"":"$")+(R?Br(x):on(x))}var y={51:["FALSE",0],52:["TRUE",0],70:["LEN",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],111:["T",1]},C=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function E(w,x){nn(w,0);for(var R=[],b=0,B="",X="",ne="",fe="";w.l<w.length;){var le=w[w.l++];switch(le){case 0:R.push(w.read_shift(8,"f"));break;case 1:X=S(x[0].c,w.read_shift(2),!0),B=S(x[0].r,w.read_shift(2),!1),R.push(X+B);break;case 2:{var we=S(x[0].c,w.read_shift(2),!0),N=S(x[0].r,w.read_shift(2),!1);X=S(x[0].c,w.read_shift(2),!0),B=S(x[0].r,w.read_shift(2),!1),R.push(we+N+":"+X+B)}break;case 3:if(w.l<w.length){console.error("WK1 premature formula end");return}break;case 4:R.push("("+R.pop()+")");break;case 5:R.push(w.read_shift(2));break;case 6:{for(var Fe="";le=w[w.l++];)Fe+=String.fromCharCode(le);R.push('"'+Fe.replace(/"/g,'""')+'"')}break;case 8:R.push("-"+R.pop());break;case 23:R.push("+"+R.pop());break;case 22:R.push("NOT("+R.pop()+")");break;case 20:case 21:fe=R.pop(),ne=R.pop(),R.push(["AND","OR"][le-20]+"("+ne+","+fe+")");break;default:if(le<32&&C[le])fe=R.pop(),ne=R.pop(),R.push(ne+C[le]+fe);else if(y[le]){if(b=y[le][1],b==69&&(b=w[w.l++]),b>R.length){console.error("WK1 bad formula parse 0x"+le.toString(16)+":|"+R.join("|")+"|");return}var ie=R.slice(-b);R.length-=b,R.push(y[le][0]+"("+ie.join(",")+")")}else return le<=7?console.error("WK1 invalid opcode "+le.toString(16)):le<=24?console.error("WK1 unsupported op "+le.toString(16)):le<=30?console.error("WK1 invalid opcode "+le.toString(16)):le<=115?console.error("WK1 unsupported function opcode "+le.toString(16)):console.error("WK1 unrecognized opcode "+le.toString(16))}}R.length==1?x[1].f=""+R[0]:console.error("WK1 bad formula parse |"+R.join("|")+"|")}function A(w){var x=[{c:0,r:0},{t:"n",v:0},0];return x[0].r=w.read_shift(2),x[3]=w[w.l++],x[0].c=w[w.l++],x}function O(w,x){var R=A(w);return R[1].t="s",R[1].v=w.read_shift(x-4,"cstr"),R}function T(w,x,R,b){var B=$r(6+b.length);B.write_shift(2,w),B.write_shift(1,R),B.write_shift(1,x),B.write_shift(1,39);for(var X=0;X<b.length;++X){var ne=b.charCodeAt(X);B.write_shift(1,ne>=128?95:ne)}return B.write_shift(1,0),B}function W(w,x){var R=A(w);R[1].v=w.read_shift(2);var b=R[1].v>>1;if(R[1].v&1)switch(b&7){case 0:b=(b>>3)*5e3;break;case 1:b=(b>>3)*500;break;case 2:b=(b>>3)/20;break;case 3:b=(b>>3)/200;break;case 4:b=(b>>3)/2e3;break;case 5:b=(b>>3)/2e4;break;case 6:b=(b>>3)/16;break;case 7:b=(b>>3)/64;break}return R[1].v=b,R}function I(w,x){var R=A(w),b=w.read_shift(4),B=w.read_shift(4),X=w.read_shift(2);if(X==65535)return b===0&&B===3221225472?(R[1].t="e",R[1].v=15):b===0&&B===3489660928?(R[1].t="e",R[1].v=42):R[1].v=0,R;var ne=X&32768;return X=(X&32767)-16446,R[1].v=(1-ne*2)*(B*Math.pow(2,X+32)+b*Math.pow(2,X)),R}function Y(w,x,R,b){var B=$r(14);if(B.write_shift(2,w),B.write_shift(1,R),B.write_shift(1,x),b==0)return B.write_shift(4,0),B.write_shift(4,0),B.write_shift(2,65535),B;var X=0,ne=0,fe=0,le=0;return b<0&&(X=1,b=-b),ne=Math.log2(b)|0,b/=Math.pow(2,ne-31),le=b>>>0,le&2147483648||(b/=2,++ne,le=b>>>0),b-=le,le|=2147483648,le>>>=0,b*=Math.pow(2,32),fe=b>>>0,B.write_shift(4,fe),B.write_shift(4,le),ne+=16383+(X?32768:0),B.write_shift(2,ne),B}function z(w,x){var R=I(w);return w.l+=x-14,R}function U(w,x){var R=A(w),b=w.read_shift(4);return R[1].v=b>>6,R}function oe(w,x){var R=A(w),b=w.read_shift(8,"f");return R[1].v=b,R}function Ce(w,x){var R=oe(w);return w.l+=x-10,R}function pe(w,x){return w[w.l+x-1]==0?w.read_shift(x,"cstr"):""}function Te(w,x){var R=w[w.l++];R>x-1&&(R=x-1);for(var b="";b.length<R;)b+=String.fromCharCode(w[w.l++]);return b}function Se(w,x,R){if(!(!R.qpro||x<21)){var b=w.read_shift(1);w.l+=17,w.l+=1,w.l+=2;var B=w.read_shift(x-21,"cstr");return[b,B]}}function Ae(w,x){for(var R={},b=w.l+x;w.l<b;){var B=w.read_shift(2);if(B==14e3){for(R[B]=[0,""],R[B][0]=w.read_shift(2);w[w.l];)R[B][1]+=String.fromCharCode(w[w.l]),w.l++;w.l++}}return R}function q(w,x){var R=$r(5+w.length);R.write_shift(2,14e3),R.write_shift(2,x);for(var b=0;b<w.length;++b){var B=w.charCodeAt(b);R[R.l++]=B>127?95:B}return R[R.l++]=0,R}var Oe={0:{n:"BOF",f:Dr},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:a},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:d},14:{n:"NUMBER",f:g},15:{n:"LABEL",f:u},16:{n:"FORMULA",f:p},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f:u},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:pe},222:{n:"SHEETNAMELP",f:Te},65535:{n:""}},v={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:O},23:{n:"NUMBER17",f:I},24:{n:"NUMBER18",f:W},25:{n:"FORMULA19",f:z},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:Ae},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:U},38:{n:"??"},39:{n:"NUMBER27",f:oe},40:{n:"FORMULA28",f:Ce},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:pe},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:Se},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};return{sheet_to_wk1:n,book_to_wk3:i,to_workbook:e}}();function t4(t){var e={},r=t.match(yn),n=0,i=!1;if(r)for(;n!=r.length;++n){var s=Qe(r[n]);switch(s[0].replace(/\w*:/g,"")){case"<condense":break;case"<extend":break;case"<shadow":if(!s.val)break;case"<shadow>":case"<shadow/>":e.shadow=1;break;case"</shadow>":break;case"<charset":if(s.val=="1")break;e.cp=cx[parseInt(s.val,10)];break;case"<outline":if(!s.val)break;case"<outline>":case"<outline/>":e.outline=1;break;case"</outline>":break;case"<rFont":e.name=s.val;break;case"<sz":e.sz=s.val;break;case"<strike":if(!s.val)break;case"<strike>":case"<strike/>":e.strike=1;break;case"</strike>":break;case"<u":if(!s.val)break;switch(s.val){case"double":e.uval="double";break;case"singleAccounting":e.uval="single-accounting";break;case"doubleAccounting":e.uval="double-accounting";break}case"<u>":case"<u/>":e.u=1;break;case"</u>":break;case"<b":if(s.val=="0")break;case"<b>":case"<b/>":e.b=1;break;case"</b>":break;case"<i":if(s.val=="0")break;case"<i>":case"<i/>":e.i=1;break;case"</i>":break;case"<color":s.rgb&&(e.color=s.rgb.slice(2,8));break;case"<color>":case"<color/>":case"</color>":break;case"<family":e.family=s.val;break;case"<family>":case"<family/>":case"</family>":break;case"<vertAlign":e.valign=s.val;break;case"<vertAlign>":case"<vertAlign/>":case"</vertAlign>":break;case"<scheme":break;case"<scheme>":case"<scheme/>":case"</scheme>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(s[0].charCodeAt(1)!==47&&!i)throw new Error("Unrecognized rich format "+s[0])}}return e}var r4=function(){var t=yf("t"),e=yf("rPr");function r(s){var o=s.match(t);if(!o)return{t:"s",v:""};var a={t:"s",v:At(o[1])},l=s.match(e);return l&&(a.s=t4(l[1])),a}var n=/<(?:\w+:)?r>/g,i=/<\/(?:\w+:)?r>/;return function(o){return o.replace(n,"").split(i).map(r).filter(function(a){return a.v})}}(),n4=function(){var e=/(\r\n|\n)/g;function r(i,s,o){var a=[];i.u&&a.push("text-decoration: underline;"),i.uval&&a.push("text-underline-style:"+i.uval+";"),i.sz&&a.push("font-size:"+i.sz+"pt;"),i.outline&&a.push("text-effect: outline;"),i.shadow&&a.push("text-shadow: auto;"),s.push('<span style="'+a.join("")+'">'),i.b&&(s.push("<b>"),o.push("</b>")),i.i&&(s.push("<i>"),o.push("</i>")),i.strike&&(s.push("<s>"),o.push("</s>"));var l=i.valign||"";return l=="superscript"||l=="super"?l="sup":l=="subscript"&&(l="sub"),l!=""&&(s.push("<"+l+">"),o.push("</"+l+">")),o.push("</span>"),i}function n(i){var s=[[],i.v,[]];return i.v?(i.s&&r(i.s,s[0],s[2]),s[0].join("")+s[1].replace(e,"<br/>")+s[2].join("")):""}return function(s){return s.map(n).join("")}}(),i4=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,s4=/<(?:\w+:)?r>/,o4=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function Tx(t,e){var r=e?e.cellHTML:!0,n={};return t?(t.match(/^\s*<(?:\w+:)?t[^>]*>/)?(n.t=At(Jt(t.slice(t.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||"")),n.r=Jt(t),r&&(n.h=px(n.t))):t.match(s4)&&(n.r=Jt(t),n.t=At(Jt((t.replace(o4,"").match(i4)||[]).join("").replace(yn,""))),r&&(n.h=n4(r4(n.r)))),n):{t:""}}var a4=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/,l4=/<(?:\w+:)?(?:si|sstItem)>/g,c4=/<\/(?:\w+:)?(?:si|sstItem)>/;function u4(t,e){var r=[],n="";if(!t)return r;var i=t.match(a4);if(i){n=i[2].replace(l4,"").split(c4);for(var s=0;s!=n.length;++s){var o=Tx(n[s].trim(),e);o!=null&&(r[r.length]=o)}i=Qe(i[1]),r.Count=i.count,r.Unique=i.uniqueCount}return r}function h4(t){return[t.read_shift(4),t.read_shift(4)]}function d4(t,e){var r=[],n=!1;return ca(t,function(s,o,a){switch(a){case 159:r.Count=s[0],r.Unique=s[1];break;case 19:r.push(s);break;case 160:return!0;case 35:n=!0;break;case 36:n=!1;break;default:if(o.T,!n||e.WTF)throw new Error("Unexpected record 0x"+a.toString(16))}}),r}function uP(t){for(var e=[],r=t.split(""),n=0;n<r.length;++n)e[n]=r[n].charCodeAt(0);return e}function ra(t,e){var r={};return r.Major=t.read_shift(2),r.Minor=t.read_shift(2),e>=4&&(t.l+=e-4),r}function f4(t){var e={};return e.id=t.read_shift(0,"lpp4"),e.R=ra(t,4),e.U=ra(t,4),e.W=ra(t,4),e}function g4(t){for(var e=t.read_shift(4),r=t.l+e-4,n={},i=t.read_shift(4),s=[];i-- >0;)s.push({t:t.read_shift(4),v:t.read_shift(0,"lpp4")});if(n.name=t.read_shift(0,"lpp4"),n.comps=s,t.l!=r)throw new Error("Bad DataSpaceMapEntry: "+t.l+" != "+r);return n}function m4(t){var e=[];t.l+=4;for(var r=t.read_shift(4);r-- >0;)e.push(g4(t));return e}function p4(t){var e=[];t.l+=4;for(var r=t.read_shift(4);r-- >0;)e.push(t.read_shift(0,"lpp4"));return e}function w4(t){var e={};return t.read_shift(4),t.l+=4,e.id=t.read_shift(0,"lpp4"),e.name=t.read_shift(0,"lpp4"),e.R=ra(t,4),e.U=ra(t,4),e.W=ra(t,4),e}function v4(t){var e=w4(t);if(e.ename=t.read_shift(0,"8lpp4"),e.blksz=t.read_shift(4),e.cmode=t.read_shift(4),t.read_shift(4)!=4)throw new Error("Bad !Primary record");return e}function hP(t,e){var r=t.l+e,n={};n.Flags=t.read_shift(4)&63,t.l+=4,n.AlgID=t.read_shift(4);var i=!1;switch(n.AlgID){case 26126:case 26127:case 26128:i=n.Flags==36;break;case 26625:i=n.Flags==4;break;case 0:i=n.Flags==16||n.Flags==4||n.Flags==36;break;default:throw"Unrecognized encryption algorithm: "+n.AlgID}if(!i)throw new Error("Encryption Flags/AlgID mismatch");return n.AlgIDHash=t.read_shift(4),n.KeySize=t.read_shift(4),n.ProviderType=t.read_shift(4),t.l+=8,n.CSPName=t.read_shift(r-t.l>>1,"utf16le"),t.l=r,n}function dP(t,e){var r={},n=t.l+e;return t.l+=4,r.Salt=t.slice(t.l,t.l+16),t.l+=16,r.Verifier=t.slice(t.l,t.l+16),t.l+=16,t.read_shift(4),r.VerifierHash=t.slice(t.l,n),t.l=n,r}function C4(t){var e=ra(t);switch(e.Minor){case 2:return[e.Minor,S4(t)];case 3:return[e.Minor,x4()];case 4:return[e.Minor,y4(t)]}throw new Error("ECMA-376 Encrypted file unrecognized Version: "+e.Minor)}function S4(t){var e=t.read_shift(4);if((e&63)!=36)throw new Error("EncryptionInfo mismatch");var r=t.read_shift(4),n=hP(t,r),i=dP(t,t.length-t.l);return{t:"Std",h:n,v:i}}function x4(){throw new Error("File is password-protected: ECMA-376 Extensible")}function y4(t){var e=["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"];t.l+=4;var r=t.read_shift(t.length-t.l,"utf8"),n={};return r.replace(yn,function(s){var o=Qe(s);switch(wo(o[0])){case"<?xml":break;case"<encryption":case"</encryption>":break;case"<keyData":e.forEach(function(a){n[a]=o[a]});break;case"<dataIntegrity":n.encryptedHmacKey=o.encryptedHmacKey,n.encryptedHmacValue=o.encryptedHmacValue;break;case"<keyEncryptors>":case"<keyEncryptors":n.encs=[];break;case"</keyEncryptors>":break;case"<keyEncryptor":n.uri=o.uri;break;case"</keyEncryptor>":break;case"<encryptedKey":n.encs.push(o);break;default:throw o[0]}}),n}function b4(t,e){var r={},n=r.EncryptionVersionInfo=ra(t,4);if(e-=4,n.Minor!=2)throw new Error("unrecognized minor version code: "+n.Minor);if(n.Major>4||n.Major<2)throw new Error("unrecognized major version code: "+n.Major);r.Flags=t.read_shift(4),e-=4;var i=t.read_shift(4);return e-=4,r.EncryptionHeader=hP(t,i),e-=i,r.EncryptionVerifier=dP(t,e),r}function E4(t){var e={},r=e.EncryptionVersionInfo=ra(t,4);if(r.Major!=1||r.Minor!=1)throw"unrecognized version code "+r.Major+" : "+r.Minor;return e.Salt=t.read_shift(16),e.EncryptedVerifier=t.read_shift(16),e.EncryptedVerifierHash=t.read_shift(16),e}function R4(t){var e=0,r,n=uP(t),i=n.length+1,s,o,a,l,c;for(r=cl(i),r[0]=n.length,s=1;s!=i;++s)r[s]=n[s-1];for(s=i-1;s>=0;--s)o=r[s],a=e&16384?1:0,l=e<<1&32767,c=a|l,e=c^o;return e^52811}var fP=function(){var t=[187,255,255,186,255,255,185,128,0,190,15,0,191,15,0],e=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],r=[44796,19929,39858,10053,20106,40212,10761,31585,63170,64933,60267,50935,40399,11199,17763,35526,1453,2906,5812,11624,23248,885,1770,3540,7080,14160,28320,56640,55369,41139,20807,41614,21821,43642,17621,28485,56970,44341,19019,38038,14605,29210,60195,50791,40175,10751,21502,43004,24537,18387,36774,3949,7898,15796,31592,63184,47201,24803,49606,37805,14203,28406,56812,17824,35648,1697,3394,6788,13576,27152,43601,17539,35078,557,1114,2228,4456,30388,60776,51953,34243,7079,14158,28316,14128,28256,56512,43425,17251,34502,7597,13105,26210,52420,35241,883,1766,3532,4129,8258,16516,33032,4657,9314,18628],n=function(o){return(o/2|o*128)&255},i=function(o,a){return n(o^a)},s=function(o){for(var a=e[o.length-1],l=104,c=o.length-1;c>=0;--c)for(var u=o[c],h=0;h!=7;++h)u&64&&(a^=r[l]),u*=2,--l;return a};return function(o){for(var a=uP(o),l=s(a),c=a.length,u=cl(16),h=0;h!=16;++h)u[h]=0;var d,f,g;for((c&1)===1&&(d=l>>8,u[c]=i(t[0],d),--c,d=l&255,f=a[a.length-1],u[c]=i(f,d));c>0;)--c,d=l>>8,u[c]=i(a[c],d),--c,d=l&255,u[c]=i(a[c],d);for(c=15,g=15-a.length;g>0;)d=l>>8,u[c]=i(t[g],d),--c,--g,d=l&255,u[c]=i(a[c],d),--c,--g;return u}}(),T4=function(t,e,r,n,i){i||(i=e),n||(n=fP(t));var s,o;for(s=0;s!=e.length;++s)o=e[s],o^=n[r],o=(o>>5|o<<3)&255,i[s]=o,++r;return[i,r,n]},_4=function(t){var e=0,r=fP(t);return function(n){var i=T4("",n,e,r);return e=i[1],i[0]}};function A4(t,e,r,n){var i={key:Dr(t),verificationBytes:Dr(t)};return r.password&&(i.verifier=R4(r.password)),n.valid=i.verificationBytes===i.verifier,n.valid&&(n.insitu=_4(r.password)),i}function M4(t,e,r){var n=r||{};return n.Info=t.read_shift(2),t.l-=2,n.Info===1?n.Data=E4(t):n.Data=b4(t,e),n}function I4(t,e,r){var n={Type:r.biff>=8?t.read_shift(2):0};return n.Type?M4(t,e-2,n):A4(t,r.biff>=8?e:e-2,r,n),n}var O4=function(){function t(i,s){switch(s.type){case"base64":return e(Ci(i),s);case"binary":return e(i,s);case"buffer":return e(yt&&Buffer.isBuffer(i)?i.toString("binary"):Oc(i),s);case"array":return e(vc(i),s)}throw new Error("Unrecognized type "+s.type)}function e(i,s){var o=s||{},a=o.dense?[]:{},l=i.match(/\\trowd.*?\\row\b/g);if(!l.length)throw new Error("RTF missing table");var c={s:{c:0,r:0},e:{c:0,r:l.length-1}};return l.forEach(function(u,h){Array.isArray(a)&&(a[h]=[]);for(var d=/\\\w+\b/g,f=0,g,m=-1;g=d.exec(u);){switch(g[0]){case"\\cell":var p=u.slice(f,d.lastIndex-g[0].length);if(p[0]==" "&&(p=p.slice(1)),++m,p.length){var S={v:p,t:"s"};Array.isArray(a)?a[h][m]=S:a[nt({r:h,c:m})]=S}break}f=d.lastIndex}m>c.e.c&&(c.e.c=m)}),a["!ref"]=Rt(c),a}function r(i,s){return gl(t(i,s),s)}function n(i){for(var s=["{\\rtf1\\ansi"],o=br(i["!ref"]),a,l=Array.isArray(i),c=o.s.r;c<=o.e.r;++c){s.push("\\trowd\\trautofit1");for(var u=o.s.c;u<=o.e.c;++u)s.push("\\cellx"+(u+1));for(s.push("\\pard\\intbl"),u=o.s.c;u<=o.e.c;++u){var h=nt({r:c,c:u});a=l?(i[c]||[])[u]:i[h],!(!a||a.v==null&&(!a.f||a.F))&&(s.push(" "+(a.w||(sa(a),a.w))),s.push("\\cell"))}s.push("\\pard\\intbl\\row")}return s.join("")+"}"}return{to_workbook:r,to_sheet:t,from_sheet:n}}();function P4(t){var e=t.slice(t[0]==="#"?1:0).slice(0,6);return[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)]}function Rf(t){for(var e=0,r=1;e!=3;++e)r=r*256+(t[e]>255?255:t[e]<0?0:t[e]);return r.toString(16).toUpperCase().slice(1)}function D4(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(e,r,n),s=Math.min(e,r,n),o=i-s;if(o===0)return[0,0,e];var a=0,l=0,c=i+s;switch(l=o/(c>1?2-c:c),i){case e:a=((r-n)/o+6)%6;break;case r:a=(n-e)/o+2;break;case n:a=(e-r)/o+4;break}return[a/6,l,c/2]}function k4(t){var e=t[0],r=t[1],n=t[2],i=r*2*(n<.5?n:1-n),s=n-i/2,o=[s,s,s],a=6*e,l;if(r!==0)switch(a|0){case 0:case 6:l=i*a,o[0]+=i,o[1]+=l;break;case 1:l=i*(2-a),o[0]+=l,o[1]+=i;break;case 2:l=i*(a-2),o[1]+=i,o[2]+=l;break;case 3:l=i*(4-a),o[1]+=l,o[2]+=i;break;case 4:l=i*(a-4),o[2]+=i,o[0]+=l;break;case 5:l=i*(6-a),o[2]+=l,o[0]+=i;break}for(var c=0;c!=3;++c)o[c]=Math.round(o[c]*255);return o}function np(t,e){if(e===0)return t;var r=D4(P4(t));return e<0?r[2]=r[2]*(1+e):r[2]=1-(1-r[2])*(1-e),Rf(k4(r))}var gP=6,N4=15,H4=1,Nn=gP;function ip(t){return Math.floor((t+Math.round(128/Nn)/256)*Nn)}function sp(t){return Math.floor((t-5)/Nn*100+.5)/100}function G1(t){return Math.round((t*Nn+5)/Nn*256)/256}function cv(t){return G1(sp(ip(t)))}function _x(t){var e=Math.abs(t-cv(t)),r=Nn;if(e>.005)for(Nn=H4;Nn<N4;++Nn)Math.abs(t-cv(t))<=e&&(e=Math.abs(t-cv(t)),r=Nn);Nn=r}function ih(t){t.width?(t.wpx=ip(t.width),t.wch=sp(t.wpx),t.MDW=Nn):t.wpx?(t.wch=sp(t.wpx),t.width=G1(t.wch),t.MDW=Nn):typeof t.wch=="number"&&(t.width=G1(t.wch),t.wpx=ip(t.width),t.MDW=Nn),t.customWidth&&delete t.customWidth}var F4=96,mP=F4;function pP(t){return t*96/mP}function Tf(t){return t*mP/96}var L4={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinHorzCross:"lightGrid"};function $4(t,e,r,n){e.Borders=[];var i={},s=!1;(t[0].match(yn)||[]).forEach(function(o){var a=Qe(o);switch(wo(a[0])){case"<borders":case"<borders>":case"</borders>":break;case"<border":case"<border>":case"<border/>":i={},a.diagonalUp&&(i.diagonalUp=ar(a.diagonalUp)),a.diagonalDown&&(i.diagonalDown=ar(a.diagonalDown)),e.Borders.push(i);break;case"</border>":break;case"<left/>":break;case"<left":case"<left>":break;case"</left>":break;case"<right/>":break;case"<right":case"<right>":break;case"</right>":break;case"<top/>":break;case"<top":case"<top>":break;case"</top>":break;case"<bottom/>":break;case"<bottom":case"<bottom>":break;case"</bottom>":break;case"<diagonal":case"<diagonal>":case"<diagonal/>":break;case"</diagonal>":break;case"<horizontal":case"<horizontal>":case"<horizontal/>":break;case"</horizontal>":break;case"<vertical":case"<vertical>":case"<vertical/>":break;case"</vertical>":break;case"<start":case"<start>":case"<start/>":break;case"</start>":break;case"<end":case"<end>":case"<end/>":break;case"</end>":break;case"<color":case"<color>":break;case"<color/>":case"</color>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;default:if(n&&n.WTF&&!s)throw new Error("unrecognized "+a[0]+" in borders")}})}function B4(t,e,r,n){e.Fills=[];var i={},s=!1;(t[0].match(yn)||[]).forEach(function(o){var a=Qe(o);switch(wo(a[0])){case"<fills":case"<fills>":case"</fills>":break;case"<fill>":case"<fill":case"<fill/>":i={},e.Fills.push(i);break;case"</fill>":break;case"<gradientFill>":break;case"<gradientFill":case"</gradientFill>":e.Fills.push(i),i={};break;case"<patternFill":case"<patternFill>":a.patternType&&(i.patternType=a.patternType);break;case"<patternFill/>":case"</patternFill>":break;case"<bgColor":i.bgColor||(i.bgColor={}),a.indexed&&(i.bgColor.indexed=parseInt(a.indexed,10)),a.theme&&(i.bgColor.theme=parseInt(a.theme,10)),a.tint&&(i.bgColor.tint=parseFloat(a.tint)),a.rgb&&(i.bgColor.rgb=a.rgb.slice(-6));break;case"<bgColor/>":case"</bgColor>":break;case"<fgColor":i.fgColor||(i.fgColor={}),a.theme&&(i.fgColor.theme=parseInt(a.theme,10)),a.tint&&(i.fgColor.tint=parseFloat(a.tint)),a.rgb!=null&&(i.fgColor.rgb=a.rgb.slice(-6));break;case"<fgColor/>":case"</fgColor>":break;case"<stop":case"<stop/>":break;case"</stop>":break;case"<color":case"<color/>":break;case"</color>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;default:if(n&&n.WTF&&!s)throw new Error("unrecognized "+a[0]+" in fills")}})}function V4(t,e,r,n){e.Fonts=[];var i={},s=!1;(t[0].match(yn)||[]).forEach(function(o){var a=Qe(o);switch(wo(a[0])){case"<fonts":case"<fonts>":case"</fonts>":break;case"<font":case"<font>":break;case"</font>":case"<font/>":e.Fonts.push(i),i={};break;case"<name":a.val&&(i.name=Jt(a.val));break;case"<name/>":case"</name>":break;case"<b":i.bold=a.val?ar(a.val):1;break;case"<b/>":i.bold=1;break;case"<i":i.italic=a.val?ar(a.val):1;break;case"<i/>":i.italic=1;break;case"<u":switch(a.val){case"none":i.underline=0;break;case"single":i.underline=1;break;case"double":i.underline=2;break;case"singleAccounting":i.underline=33;break;case"doubleAccounting":i.underline=34;break}break;case"<u/>":i.underline=1;break;case"<strike":i.strike=a.val?ar(a.val):1;break;case"<strike/>":i.strike=1;break;case"<outline":i.outline=a.val?ar(a.val):1;break;case"<outline/>":i.outline=1;break;case"<shadow":i.shadow=a.val?ar(a.val):1;break;case"<shadow/>":i.shadow=1;break;case"<condense":i.condense=a.val?ar(a.val):1;break;case"<condense/>":i.condense=1;break;case"<extend":i.extend=a.val?ar(a.val):1;break;case"<extend/>":i.extend=1;break;case"<sz":a.val&&(i.sz=+a.val);break;case"<sz/>":case"</sz>":break;case"<vertAlign":a.val&&(i.vertAlign=a.val);break;case"<vertAlign/>":case"</vertAlign>":break;case"<family":a.val&&(i.family=parseInt(a.val,10));break;case"<family/>":case"</family>":break;case"<scheme":a.val&&(i.scheme=a.val);break;case"<scheme/>":case"</scheme>":break;case"<charset":if(a.val=="1")break;a.codepage=cx[parseInt(a.val,10)];break;case"<color":if(i.color||(i.color={}),a.auto&&(i.color.auto=ar(a.auto)),a.rgb)i.color.rgb=a.rgb.slice(-6);else if(a.indexed){i.color.index=parseInt(a.indexed,10);var l=gc[i.color.index];i.color.index==81&&(l=gc[1]),l||(l=gc[1]),i.color.rgb=l[0].toString(16)+l[1].toString(16)+l[2].toString(16)}else a.theme&&(i.color.theme=parseInt(a.theme,10),a.tint&&(i.color.tint=parseFloat(a.tint)),a.theme&&r.themeElements&&r.themeElements.clrScheme&&(i.color.rgb=np(r.themeElements.clrScheme[i.color.theme].rgb,i.color.tint||0)));break;case"<color/>":case"</color>":break;case"<AlternateContent":s=!0;break;case"</AlternateContent>":s=!1;break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;default:if(n&&n.WTF&&!s)throw new Error("unrecognized "+a[0]+" in fonts")}})}function W4(t,e,r){e.NumberFmt=[];for(var n=fo(ot),i=0;i<n.length;++i)e.NumberFmt[n[i]]=ot[n[i]];var s=t[0].match(yn);if(s)for(i=0;i<s.length;++i){var o=Qe(s[i]);switch(wo(o[0])){case"<numFmts":case"</numFmts>":case"<numFmts/>":case"<numFmts>":break;case"<numFmt":{var a=At(Jt(o.formatCode)),l=parseInt(o.numFmtId,10);if(e.NumberFmt[l]=a,l>0){if(l>392){for(l=392;l>60&&e.NumberFmt[l]!=null;--l);e.NumberFmt[l]=a}fc(a,l)}}break;case"</numFmt>":break;default:if(r.WTF)throw new Error("unrecognized "+o[0]+" in numFmts")}}}var Wg=["numFmtId","fillId","fontId","borderId","xfId"],Ug=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"];function U4(t,e,r){e.CellXf=[];var n,i=!1;(t[0].match(yn)||[]).forEach(function(s){var o=Qe(s),a=0;switch(wo(o[0])){case"<cellXfs":case"<cellXfs>":case"<cellXfs/>":case"</cellXfs>":break;case"<xf":case"<xf/>":for(n=o,delete n[0],a=0;a<Wg.length;++a)n[Wg[a]]&&(n[Wg[a]]=parseInt(n[Wg[a]],10));for(a=0;a<Ug.length;++a)n[Ug[a]]&&(n[Ug[a]]=ar(n[Ug[a]]));if(e.NumberFmt&&n.numFmtId>392){for(a=392;a>60;--a)if(e.NumberFmt[n.numFmtId]==e.NumberFmt[a]){n.numFmtId=a;break}}e.CellXf.push(n);break;case"</xf>":break;case"<alignment":case"<alignment/>":var l={};o.vertical&&(l.vertical=o.vertical),o.horizontal&&(l.horizontal=o.horizontal),o.textRotation!=null&&(l.textRotation=o.textRotation),o.indent&&(l.indent=o.indent),o.wrapText&&(l.wrapText=ar(o.wrapText)),n.alignment=l;break;case"</alignment>":break;case"<protection":break;case"</protection>":case"<protection/>":break;case"<AlternateContent":i=!0;break;case"</AlternateContent>":i=!1;break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(r&&r.WTF&&!i)throw new Error("unrecognized "+o[0]+" in cellXfs")}})}var Y4=function(){var e=/<(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?numFmts>/,r=/<(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?cellXfs>/,n=/<(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?fills>/,i=/<(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?fonts>/,s=/<(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?borders>/;return function(a,l,c){var u={};if(!a)return u;a=a.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");var h;return(h=a.match(e))&&W4(h,u,c),(h=a.match(i))&&V4(h,u,l,c),(h=a.match(n))&&B4(h,u,l,c),(h=a.match(s))&&$4(h,u,l,c),(h=a.match(r))&&U4(h,u,c),u}}();function z4(t,e){var r=t.read_shift(2),n=Cn(t);return[r,n]}function G4(t,e,r){var n={};n.sz=t.read_shift(2)/20;var i=r$(t);i.fItalic&&(n.italic=1),i.fCondense&&(n.condense=1),i.fExtend&&(n.extend=1),i.fShadow&&(n.shadow=1),i.fOutline&&(n.outline=1),i.fStrikeout&&(n.strike=1);var s=t.read_shift(2);switch(s===700&&(n.bold=1),t.read_shift(2)){case 1:n.vertAlign="superscript";break;case 2:n.vertAlign="subscript";break}var o=t.read_shift(1);o!=0&&(n.underline=o);var a=t.read_shift(1);a>0&&(n.family=a);var l=t.read_shift(1);switch(l>0&&(n.charset=l),t.l++,n.color=t$(t),t.read_shift(1)){case 1:n.scheme="major";break;case 2:n.scheme="minor";break}return n.name=Cn(t),n}var j4=xn;function K4(t,e){var r=t.l+e,n=t.read_shift(2),i=t.read_shift(2);return t.l=r,{ixfe:n,numFmtId:i}}var X4=xn;function q4(t,e,r){var n={};n.NumberFmt=[];for(var i in ot)n.NumberFmt[i]=ot[i];n.CellXf=[],n.Fonts=[];var s=[],o=!1;return ca(t,function(l,c,u){switch(u){case 44:n.NumberFmt[l[0]]=l[1],fc(l[1],l[0]);break;case 43:n.Fonts.push(l),l.color.theme!=null&&e&&e.themeElements&&e.themeElements.clrScheme&&(l.color.rgb=np(e.themeElements.clrScheme[l.color.theme].rgb,l.color.tint||0));break;case 1025:break;case 45:break;case 46:break;case 47:s[s.length-1]==617&&n.CellXf.push(l);break;case 48:case 507:case 572:case 475:break;case 1171:case 2102:case 1130:case 512:case 2095:case 3072:break;case 35:o=!0;break;case 36:o=!1;break;case 37:s.push(u),o=!0;break;case 38:s.pop(),o=!1;break;default:if(c.T>0)s.push(u);else if(c.T<0)s.pop();else if(!o||r.WTF&&s[s.length-1]!=37)throw new Error("Unexpected record 0x"+u.toString(16))}}),n}var Z4=["</a:lt1>","</a:dk1>","</a:lt2>","</a:dk2>","</a:accent1>","</a:accent2>","</a:accent3>","</a:accent4>","</a:accent5>","</a:accent6>","</a:hlink>","</a:folHlink>"];function J4(t,e,r){e.themeElements.clrScheme=[];var n={};(t[0].match(yn)||[]).forEach(function(i){var s=Qe(i);switch(s[0]){case"<a:clrScheme":case"</a:clrScheme>":break;case"<a:srgbClr":n.rgb=s.val;break;case"<a:sysClr":n.rgb=s.lastClr;break;case"<a:dk1>":case"</a:dk1>":case"<a:lt1>":case"</a:lt1>":case"<a:dk2>":case"</a:dk2>":case"<a:lt2>":case"</a:lt2>":case"<a:accent1>":case"</a:accent1>":case"<a:accent2>":case"</a:accent2>":case"<a:accent3>":case"</a:accent3>":case"<a:accent4>":case"</a:accent4>":case"<a:accent5>":case"</a:accent5>":case"<a:accent6>":case"</a:accent6>":case"<a:hlink>":case"</a:hlink>":case"<a:folHlink>":case"</a:folHlink>":s[0].charAt(1)==="/"?(e.themeElements.clrScheme[Z4.indexOf(s[0])]=n,n={}):n.name=s[0].slice(3,s[0].length-1);break;default:if(r&&r.WTF)throw new Error("Unrecognized "+s[0]+" in clrScheme")}})}function Q4(){}function e3(){}var t3=/<a:clrScheme([^>]*)>[\s\S]*<\/a:clrScheme>/,r3=/<a:fontScheme([^>]*)>[\s\S]*<\/a:fontScheme>/,n3=/<a:fmtScheme([^>]*)>[\s\S]*<\/a:fmtScheme>/;function i3(t,e,r){e.themeElements={};var n;[["clrScheme",t3,J4],["fontScheme",r3,Q4],["fmtScheme",n3,e3]].forEach(function(i){if(!(n=t.match(i[1])))throw new Error(i[0]+" not found in themeElements");i[2](n,e,r)})}var s3=/<a:themeElements([^>]*)>[\s\S]*<\/a:themeElements>/;function wP(t,e){(!t||t.length===0)&&(t=o3());var r,n={};if(!(r=t.match(s3)))throw new Error("themeElements not found in theme");return i3(r[0],n,e),n.raw=t,n}function o3(t,e){var r=[AO];return r[r.length]='<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">',r[r.length]="<a:themeElements>",r[r.length]='<a:clrScheme name="Office">',r[r.length]='<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>',r[r.length]='<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>',r[r.length]='<a:dk2><a:srgbClr val="1F497D"/></a:dk2>',r[r.length]='<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>',r[r.length]='<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>',r[r.length]='<a:accent2><a:srgbClr val="C0504D"/></a:accent2>',r[r.length]='<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>',r[r.length]='<a:accent4><a:srgbClr val="8064A2"/></a:accent4>',r[r.length]='<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>',r[r.length]='<a:accent6><a:srgbClr val="F79646"/></a:accent6>',r[r.length]='<a:hlink><a:srgbClr val="0000FF"/></a:hlink>',r[r.length]='<a:folHlink><a:srgbClr val="800080"/></a:folHlink>',r[r.length]="</a:clrScheme>",r[r.length]='<a:fontScheme name="Office">',r[r.length]="<a:majorFont>",r[r.length]='<a:latin typeface="Cambria"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="MS Pゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Times New Roman"/>',r[r.length]='<a:font script="Hebr" typeface="Times New Roman"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="MoolBoran"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Times New Roman"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:majorFont>",r[r.length]="<a:minorFont>",r[r.length]='<a:latin typeface="Calibri"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="MS Pゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Arial"/>',r[r.length]='<a:font script="Hebr" typeface="Arial"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="DaunPenh"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Arial"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:minorFont>",r[r.length]="</a:fontScheme>",r[r.length]='<a:fmtScheme name="Office">',r[r.length]="<a:fillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="1"/>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="0"/>',r[r.length]="</a:gradFill>",r[r.length]="</a:fillStyleLst>",r[r.length]="<a:lnStyleLst>",r[r.length]='<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]="</a:lnStyleLst>",r[r.length]="<a:effectStyleLst>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]='<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>',r[r.length]='<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>',r[r.length]="</a:effectStyle>",r[r.length]="</a:effectStyleLst>",r[r.length]="<a:bgFillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]="</a:bgFillStyleLst>",r[r.length]="</a:fmtScheme>",r[r.length]="</a:themeElements>",r[r.length]="<a:objectDefaults>",r[r.length]="<a:spDef>",r[r.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>',r[r.length]="</a:spDef>",r[r.length]="<a:lnDef>",r[r.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>',r[r.length]="</a:lnDef>",r[r.length]="</a:objectDefaults>",r[r.length]="<a:extraClrSchemeLst/>",r[r.length]="</a:theme>",r.join("")}function a3(t,e,r){var n=t.l+e,i=t.read_shift(4);if(i!==124226){if(!r.cellStyles){t.l=n;return}var s=t.slice(t.l);t.l=n;var o;try{o=_O(s,{type:"array"})}catch{return}var a=wi(o,"theme/theme/theme1.xml",!0);if(a)return wP(a,r)}}function l3(t){return t.read_shift(4)}function c3(t){var e={};switch(e.xclrType=t.read_shift(2),e.nTintShade=t.read_shift(2),e.xclrType){case 0:t.l+=4;break;case 1:e.xclrValue=u3(t,4);break;case 2:e.xclrValue=nP(t);break;case 3:e.xclrValue=l3(t);break;case 4:t.l+=4;break}return t.l+=8,e}function u3(t,e){return xn(t,e)}function h3(t,e){return xn(t,e)}function d3(t){var e=t.read_shift(2),r=t.read_shift(2)-4,n=[e];switch(e){case 4:case 5:case 7:case 8:case 9:case 10:case 11:case 13:n[1]=c3(t);break;case 6:n[1]=h3(t,r);break;case 14:case 15:n[1]=t.read_shift(r===1?1:2);break;default:throw new Error("Unrecognized ExtProp type: "+e+" "+r)}return n}function f3(t,e){var r=t.l+e;t.l+=2;var n=t.read_shift(2);t.l+=2;for(var i=t.read_shift(2),s=[];i-- >0;)s.push(d3(t,r-t.l));return{ixfe:n,ext:s}}function g3(t,e){e.forEach(function(r){switch(r[0]){}})}function m3(t,e){return{flags:t.read_shift(4),version:t.read_shift(4),name:Cn(t)}}function p3(t){for(var e=[],r=t.read_shift(4);r-- >0;)e.push([t.read_shift(4),t.read_shift(4)]);return e}function w3(t){return t.l+=4,t.read_shift(4)!=0}function v3(t,e,r){var n={Types:[],Cell:[],Value:[]},i=r||{},s=[],o=!1,a=2;return ca(t,function(l,c,u){switch(u){case 335:n.Types.push({name:l.name});break;case 51:l.forEach(function(h){a==1?n.Cell.push({type:n.Types[h[0]-1].name,index:h[1]}):a==0&&n.Value.push({type:n.Types[h[0]-1].name,index:h[1]})});break;case 337:a=l?1:0;break;case 338:a=2;break;case 35:s.push(u),o=!0;break;case 36:s.pop(),o=!1;break;default:if(!c.T){if(!o||i.WTF&&s[s.length-1]!=35)throw new Error("Unexpected record 0x"+u.toString(16))}}}),n}function C3(t,e,r){var n={Types:[],Cell:[],Value:[]};if(!t)return n;var i=!1,s=2,o;return t.replace(yn,function(a){var l=Qe(a);switch(wo(l[0])){case"<?xml":break;case"<metadata":case"</metadata>":break;case"<metadataTypes":case"</metadataTypes>":break;case"<metadataType":n.Types.push({name:l.name});break;case"</metadataType>":break;case"<futureMetadata":for(var c=0;c<n.Types.length;++c)n.Types[c].name==l.name&&(o=n.Types[c]);break;case"</futureMetadata>":break;case"<bk>":break;case"</bk>":break;case"<rc":s==1?n.Cell.push({type:n.Types[l.t-1].name,index:+l.v}):s==0&&n.Value.push({type:n.Types[l.t-1].name,index:+l.v});break;case"</rc>":break;case"<cellMetadata":s=1;break;case"</cellMetadata>":s=2;break;case"<valueMetadata":s=0;break;case"</valueMetadata>":s=2;break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;case"<rvb":if(!o)break;o.offsets||(o.offsets=[]),o.offsets.push(+l.i);break;default:if(!i&&r.WTF)throw new Error("unrecognized "+l[0]+" in metadata")}return a}),n}function S3(t){var e=[];if(!t)return e;var r=1;return(t.match(yn)||[]).forEach(function(n){var i=Qe(n);switch(i[0]){case"<?xml":break;case"<calcChain":case"<calcChain>":case"</calcChain>":break;case"<c":delete i[0],i.i?r=i.i:i.i=r,e.push(i);break}}),e}function x3(t){var e={};e.i=t.read_shift(4);var r={};r.r=t.read_shift(4),r.c=t.read_shift(4),e.r=nt(r);var n=t.read_shift(1);return n&2&&(e.l="1"),n&8&&(e.a="1"),e}function y3(t,e,r){var n=[];return ca(t,function(s,o,a){switch(a){case 63:n.push(s);break;default:if(!o.T)throw new Error("Unexpected record 0x"+a.toString(16))}}),n}function b3(t,e,r,n){if(!t)return t;var i=n||{},s=!1;ca(t,function(a,l,c){switch(c){case 359:case 363:case 364:case 366:case 367:case 368:case 369:case 370:case 371:case 472:case 577:case 578:case 579:case 580:case 581:case 582:case 583:case 584:case 585:case 586:case 587:break;case 35:s=!0;break;case 36:s=!1;break;default:if(!l.T){if(!s||i.WTF)throw new Error("Unexpected record 0x"+c.toString(16))}}},i)}function E3(t,e){if(!t)return"??";var r=(t.match(/<c:chart [^>]*r:id="([^"]*)"/)||["",""])[1];return e["!id"][r].Target}function aT(t,e,r,n){var i=Array.isArray(t),s;e.forEach(function(o){var a=Fn(o.ref);if(i?(t[a.r]||(t[a.r]=[]),s=t[a.r][a.c]):s=t[o.ref],!s){s={t:"z"},i?t[a.r][a.c]=s:t[o.ref]=s;var l=br(t["!ref"]||"BDWGO1000001:A1");l.s.r>a.r&&(l.s.r=a.r),l.e.r<a.r&&(l.e.r=a.r),l.s.c>a.c&&(l.s.c=a.c),l.e.c<a.c&&(l.e.c=a.c);var c=Rt(l);c!==t["!ref"]&&(t["!ref"]=c)}s.c||(s.c=[]);var u={a:o.author,t:o.t,r:o.r,T:r};o.h&&(u.h=o.h);for(var h=s.c.length-1;h>=0;--h){if(!r&&s.c[h].T)return;r&&!s.c[h].T&&s.c.splice(h,1)}if(r&&n){for(h=0;h<n.length;++h)if(u.a==n[h].id){u.a=n[h].name||u.a;break}}s.c.push(u)})}function R3(t,e){if(t.match(/<(?:\w+:)?comments *\/>/))return[];var r=[],n=[],i=t.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/);i&&i[1]&&i[1].split(/<\/\w*:?author>/).forEach(function(o){if(!(o===""||o.trim()==="")){var a=o.match(/<(?:\w+:)?author[^>]*>(.*)/);a&&r.push(a[1])}});var s=t.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/);return s&&s[1]&&s[1].split(/<\/\w*:?comment>/).forEach(function(o){if(!(o===""||o.trim()==="")){var a=o.match(/<(?:\w+:)?comment[^>]*>/);if(a){var l=Qe(a[0]),c={author:l.authorId&&r[l.authorId]||"sheetjsghost",ref:l.ref,guid:l.guid},u=Fn(l.ref);if(!(e.sheetRows&&e.sheetRows<=u.r)){var h=o.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/),d=!!h&&!!h[1]&&Tx(h[1])||{r:"",t:"",h:""};c.r=d.r,d.r=="<t></t>"&&(d.t=d.h=""),c.t=(d.t||"").replace(/\r\n/g,`
  28. `).replace(/\r/g,`
  29. `),e.cellHTML&&(c.h=d.h),n.push(c)}}}}),n}function T3(t,e){var r=[],n=!1,i={},s=0;return t.replace(yn,function(a,l){var c=Qe(a);switch(wo(c[0])){case"<?xml":break;case"<ThreadedComments":break;case"</ThreadedComments>":break;case"<threadedComment":i={author:c.personId,guid:c.id,ref:c.ref,T:1};break;case"</threadedComment>":i.t!=null&&r.push(i);break;case"<text>":case"<text":s=l+a.length;break;case"</text>":i.t=t.slice(s,l).replace(/\r\n/g,`
  30. `).replace(/\r/g,`
  31. `);break;case"<mentions":case"<mentions>":n=!0;break;case"</mentions>":n=!1;break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":n=!0;break;case"</ext>":n=!1;break;default:if(!n&&e.WTF)throw new Error("unrecognized "+c[0]+" in threaded comments")}return a}),r}function _3(t,e){var r=[],n=!1;return t.replace(yn,function(s){var o=Qe(s);switch(wo(o[0])){case"<?xml":break;case"<personList":break;case"</personList>":break;case"<person":r.push({name:o.displayname,id:o.id});break;case"</person>":break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":n=!0;break;case"</ext>":n=!1;break;default:if(!n&&e.WTF)throw new Error("unrecognized "+o[0]+" in threaded comments")}return s}),r}function A3(t){var e={};e.iauthor=t.read_shift(4);var r=Dc(t);return e.rfx=r.s,e.ref=nt(r.s),t.l+=16,e}var M3=Cn;function I3(t,e){var r=[],n=[],i={},s=!1;return ca(t,function(a,l,c){switch(c){case 632:n.push(a);break;case 635:i=a;break;case 637:i.t=a.t,i.h=a.h,i.r=a.r;break;case 636:if(i.author=n[i.iauthor],delete i.iauthor,e.sheetRows&&i.rfx&&e.sheetRows<=i.rfx.r)break;i.t||(i.t=""),delete i.rfx,r.push(i);break;case 3072:break;case 35:s=!0;break;case 36:s=!1;break;case 37:break;case 38:break;default:if(!l.T){if(!s||e.WTF)throw new Error("Unexpected record 0x"+c.toString(16))}}}),r}var O3="application/vnd.ms-office.vbaProject";function P3(t){var e=Et.utils.cfb_new({root:"R"});return t.FullPaths.forEach(function(r,n){if(!(r.slice(-1)==="/"||!r.match(/_VBA_PROJECT_CUR/))){var i=r.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/,"");Et.utils.cfb_add(e,i,t.FileIndex[n].content)}}),Et.write(e)}function D3(){return{"!type":"dialog"}}function k3(){return{"!type":"dialog"}}function N3(){return{"!type":"macro"}}function H3(){return{"!type":"macro"}}var Gu=function(){var t=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,e={r:0,c:0};function r(n,i,s,o){var a=!1,l=!1;s.length==0?l=!0:s.charAt(0)=="["&&(l=!0,s=s.slice(1,-1)),o.length==0?a=!0:o.charAt(0)=="["&&(a=!0,o=o.slice(1,-1));var c=s.length>0?parseInt(s,10)|0:0,u=o.length>0?parseInt(o,10)|0:0;return a?u+=e.c:--u,l?c+=e.r:--c,i+(a?"":"$")+Br(u)+(l?"":"$")+on(c)}return function(i,s){return e=s,i.replace(t,r)}}(),vP=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,F3=function(){return function(e,r){return e.replace(vP,function(n,i,s,o,a,l){var c=Sx(o)-(s?0:r.c),u=Cx(l)-(a?0:r.r),h=u==0?"":a?u+1:"["+u+"]",d=c==0?"":s?c+1:"["+c+"]";return i+"R"+h+"C"+d})}}();function CP(t,e){return t.replace(vP,function(r,n,i,s,o,a){return n+(i=="$"?i+s:Br(Sx(s)+e.c))+(o=="$"?o+a:on(Cx(a)+e.r))})}function L3(t,e,r){var n=hh(e),i=n.s,s=Fn(r),o={r:s.r-i.r,c:s.c-i.c};return CP(t,o)}function $3(t){return t.length!=1}function lT(t){return t.replace(/_xlfn\./g,"")}function Ir(t){t.l+=1}function ul(t,e){var r=t.read_shift(2);return[r&16383,r>>14&1,r>>15&1]}function SP(t,e,r){var n=2;if(r){if(r.biff>=2&&r.biff<=5)return xP(t);r.biff==12&&(n=4)}var i=t.read_shift(n),s=t.read_shift(n),o=ul(t),a=ul(t);return{s:{r:i,c:o[0],cRel:o[1],rRel:o[2]},e:{r:s,c:a[0],cRel:a[1],rRel:a[2]}}}function xP(t){var e=ul(t),r=ul(t),n=t.read_shift(1),i=t.read_shift(1);return{s:{r:e[0],c:n,cRel:e[1],rRel:e[2]},e:{r:r[0],c:i,cRel:r[1],rRel:r[2]}}}function B3(t,e,r){if(r.biff<8)return xP(t);var n=t.read_shift(r.biff==12?4:2),i=t.read_shift(r.biff==12?4:2),s=ul(t),o=ul(t);return{s:{r:n,c:s[0],cRel:s[1],rRel:s[2]},e:{r:i,c:o[0],cRel:o[1],rRel:o[2]}}}function yP(t,e,r){if(r&&r.biff>=2&&r.biff<=5)return V3(t);var n=t.read_shift(r&&r.biff==12?4:2),i=ul(t);return{r:n,c:i[0],cRel:i[1],rRel:i[2]}}function V3(t){var e=ul(t),r=t.read_shift(1);return{r:e[0],c:r,cRel:e[1],rRel:e[2]}}function W3(t){var e=t.read_shift(2),r=t.read_shift(2);return{r:e,c:r&255,fQuoted:!!(r&16384),cRel:r>>15,rRel:r>>15}}function U3(t,e,r){var n=r&&r.biff?r.biff:8;if(n>=2&&n<=5)return Y3(t);var i=t.read_shift(n>=12?4:2),s=t.read_shift(2),o=(s&16384)>>14,a=(s&32768)>>15;if(s&=16383,a==1)for(;i>524287;)i-=1048576;if(o==1)for(;s>8191;)s=s-16384;return{r:i,c:s,cRel:o,rRel:a}}function Y3(t){var e=t.read_shift(2),r=t.read_shift(1),n=(e&32768)>>15,i=(e&16384)>>14;return e&=16383,n==1&&e>=8192&&(e=e-16384),i==1&&r>=128&&(r=r-256),{r:e,c:r,cRel:i,rRel:n}}function z3(t,e,r){var n=(t[t.l++]&96)>>5,i=SP(t,r.biff>=2&&r.biff<=5?6:8,r);return[n,i]}function G3(t,e,r){var n=(t[t.l++]&96)>>5,i=t.read_shift(2,"i"),s=8;if(r)switch(r.biff){case 5:t.l+=12,s=6;break;case 12:s=12;break}var o=SP(t,s,r);return[n,i,o]}function j3(t,e,r){var n=(t[t.l++]&96)>>5;return t.l+=r&&r.biff>8?12:r.biff<8?6:8,[n]}function K3(t,e,r){var n=(t[t.l++]&96)>>5,i=t.read_shift(2),s=8;if(r)switch(r.biff){case 5:t.l+=12,s=6;break;case 12:s=12;break}return t.l+=s,[n,i]}function X3(t,e,r){var n=(t[t.l++]&96)>>5,i=B3(t,e-1,r);return[n,i]}function q3(t,e,r){var n=(t[t.l++]&96)>>5;return t.l+=r.biff==2?6:r.biff==12?14:7,[n]}function cT(t){var e=t[t.l+1]&1,r=1;return t.l+=4,[e,r]}function Z3(t,e,r){t.l+=2;for(var n=t.read_shift(r&&r.biff==2?1:2),i=[],s=0;s<=n;++s)i.push(t.read_shift(r&&r.biff==2?1:2));return i}function J3(t,e,r){var n=t[t.l+1]&255?1:0;return t.l+=2,[n,t.read_shift(r&&r.biff==2?1:2)]}function Q3(t,e,r){var n=t[t.l+1]&255?1:0;return t.l+=2,[n,t.read_shift(r&&r.biff==2?1:2)]}function eV(t){var e=t[t.l+1]&255?1:0;return t.l+=2,[e,t.read_shift(2)]}function tV(t,e,r){var n=t[t.l+1]&255?1:0;return t.l+=r&&r.biff==2?3:4,[n]}function bP(t){var e=t.read_shift(1),r=t.read_shift(1);return[e,r]}function rV(t){return t.read_shift(2),bP(t)}function nV(t){return t.read_shift(2),bP(t)}function iV(t,e,r){var n=(t[t.l]&96)>>5;t.l+=1;var i=yP(t,0,r);return[n,i]}function sV(t,e,r){var n=(t[t.l]&96)>>5;t.l+=1;var i=U3(t,0,r);return[n,i]}function oV(t,e,r){var n=(t[t.l]&96)>>5;t.l+=1;var i=t.read_shift(2);r&&r.biff==5&&(t.l+=12);var s=yP(t,0,r);return[n,i,s]}function aV(t,e,r){var n=(t[t.l]&96)>>5;t.l+=1;var i=t.read_shift(r&&r.biff<=3?1:2);return[lW[i],TP[i],n]}function lV(t,e,r){var n=t[t.l++],i=t.read_shift(1),s=r&&r.biff<=3?[n==88?-1:0,t.read_shift(1)]:cV(t);return[i,(s[0]===0?TP:aW)[s[1]]]}function cV(t){return[t[t.l+1]>>7,t.read_shift(2)&32767]}function uV(t,e,r){t.l+=r&&r.biff==2?3:4}function hV(t,e,r){if(t.l++,r&&r.biff==12)return[t.read_shift(4,"i"),0];var n=t.read_shift(2),i=t.read_shift(r&&r.biff==2?1:2);return[n,i]}function dV(t){return t.l++,kc[t.read_shift(1)]}function fV(t){return t.l++,t.read_shift(2)}function gV(t){return t.l++,t.read_shift(1)!==0}function mV(t){return t.l++,wn(t)}function pV(t,e,r){return t.l++,Xf(t,e-1,r)}function wV(t,e){var r=[t.read_shift(1)];if(e==12)switch(r[0]){case 2:r[0]=4;break;case 4:r[0]=16;break;case 0:r[0]=1;break;case 1:r[0]=2;break}switch(r[0]){case 4:r[1]=Tr(t,1)?"TRUE":"FALSE",e!=12&&(t.l+=7);break;case 37:case 16:r[1]=kc[t[t.l]],t.l+=e==12?4:8;break;case 0:t.l+=8;break;case 1:r[1]=wn(t);break;case 2:r[1]=Nc(t,0,{biff:e>0&&e<8?2:e});break;default:throw new Error("Bad SerAr: "+r[0])}return r}function vV(t,e,r){for(var n=t.read_shift(r.biff==12?4:2),i=[],s=0;s!=n;++s)i.push((r.biff==12?Dc:ew)(t));return i}function CV(t,e,r){var n=0,i=0;r.biff==12?(n=t.read_shift(4),i=t.read_shift(4)):(i=1+t.read_shift(1),n=1+t.read_shift(2)),r.biff>=2&&r.biff<8&&(--n,--i==0&&(i=256));for(var s=0,o=[];s!=n&&(o[s]=[]);++s)for(var a=0;a!=i;++a)o[s][a]=wV(t,r.biff);return o}function SV(t,e,r){var n=t.read_shift(1)>>>5&3,i=!r||r.biff>=8?4:2,s=t.read_shift(i);switch(r.biff){case 2:t.l+=5;break;case 3:case 4:t.l+=8;break;case 5:t.l+=12;break}return[n,0,s]}function xV(t,e,r){if(r.biff==5)return yV(t);var n=t.read_shift(1)>>>5&3,i=t.read_shift(2),s=t.read_shift(4);return[n,i,s]}function yV(t){var e=t.read_shift(1)>>>5&3,r=t.read_shift(2,"i");t.l+=8;var n=t.read_shift(2);return t.l+=12,[e,r,n]}function bV(t,e,r){var n=t.read_shift(1)>>>5&3;t.l+=r&&r.biff==2?3:4;var i=t.read_shift(r&&r.biff==2?1:2);return[n,i]}function EV(t,e,r){var n=t.read_shift(1)>>>5&3,i=t.read_shift(r&&r.biff==2?1:2);return[n,i]}function RV(t,e,r){var n=t.read_shift(1)>>>5&3;return t.l+=4,r.biff<8&&t.l--,r.biff==12&&(t.l+=2),[n]}function TV(t,e,r){var n=(t[t.l++]&96)>>5,i=t.read_shift(2),s=4;if(r)switch(r.biff){case 5:s=15;break;case 12:s=6;break}return t.l+=s,[n,i]}var _V=xn,AV=xn,MV=xn;function Zf(t,e,r){return t.l+=2,[W3(t)]}function Ax(t){return t.l+=6,[]}var IV=Zf,OV=Ax,PV=Ax,DV=Zf;function EP(t){return t.l+=2,[Dr(t),t.read_shift(2)&1]}var kV=Zf,NV=EP,HV=Ax,FV=Zf,LV=Zf,$V=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function BV(t){t.l+=2;var e=t.read_shift(2),r=t.read_shift(2),n=t.read_shift(4),i=t.read_shift(2),s=t.read_shift(2),o=$V[r>>2&31];return{ixti:e,coltype:r&3,rt:o,idx:n,c:i,C:s}}function VV(t){return t.l+=2,[t.read_shift(4)]}function WV(t,e,r){return t.l+=5,t.l+=2,t.l+=r.biff==2?1:4,["PTGSHEET"]}function UV(t,e,r){return t.l+=r.biff==2?4:5,["PTGENDSHEET"]}function YV(t){var e=t.read_shift(1)>>>5&3,r=t.read_shift(2);return[e,r]}function zV(t){var e=t.read_shift(1)>>>5&3,r=t.read_shift(2);return[e,r]}function GV(t){return t.l+=4,[0,0]}var uT={1:{n:"PtgExp",f:hV},2:{n:"PtgTbl",f:MV},3:{n:"PtgAdd",f:Ir},4:{n:"PtgSub",f:Ir},5:{n:"PtgMul",f:Ir},6:{n:"PtgDiv",f:Ir},7:{n:"PtgPower",f:Ir},8:{n:"PtgConcat",f:Ir},9:{n:"PtgLt",f:Ir},10:{n:"PtgLe",f:Ir},11:{n:"PtgEq",f:Ir},12:{n:"PtgGe",f:Ir},13:{n:"PtgGt",f:Ir},14:{n:"PtgNe",f:Ir},15:{n:"PtgIsect",f:Ir},16:{n:"PtgUnion",f:Ir},17:{n:"PtgRange",f:Ir},18:{n:"PtgUplus",f:Ir},19:{n:"PtgUminus",f:Ir},20:{n:"PtgPercent",f:Ir},21:{n:"PtgParen",f:Ir},22:{n:"PtgMissArg",f:Ir},23:{n:"PtgStr",f:pV},26:{n:"PtgSheet",f:WV},27:{n:"PtgEndSheet",f:UV},28:{n:"PtgErr",f:dV},29:{n:"PtgBool",f:gV},30:{n:"PtgInt",f:fV},31:{n:"PtgNum",f:mV},32:{n:"PtgArray",f:q3},33:{n:"PtgFunc",f:aV},34:{n:"PtgFuncVar",f:lV},35:{n:"PtgName",f:SV},36:{n:"PtgRef",f:iV},37:{n:"PtgArea",f:z3},38:{n:"PtgMemArea",f:bV},39:{n:"PtgMemErr",f:_V},40:{n:"PtgMemNoMem",f:AV},41:{n:"PtgMemFunc",f:EV},42:{n:"PtgRefErr",f:RV},43:{n:"PtgAreaErr",f:j3},44:{n:"PtgRefN",f:sV},45:{n:"PtgAreaN",f:X3},46:{n:"PtgMemAreaN",f:YV},47:{n:"PtgMemNoMemN",f:zV},57:{n:"PtgNameX",f:xV},58:{n:"PtgRef3d",f:oV},59:{n:"PtgArea3d",f:G3},60:{n:"PtgRefErr3d",f:TV},61:{n:"PtgAreaErr3d",f:K3},255:{}},jV={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},KV={1:{n:"PtgElfLel",f:EP},2:{n:"PtgElfRw",f:FV},3:{n:"PtgElfCol",f:IV},6:{n:"PtgElfRwV",f:LV},7:{n:"PtgElfColV",f:DV},10:{n:"PtgElfRadical",f:kV},11:{n:"PtgElfRadicalS",f:HV},13:{n:"PtgElfColS",f:OV},15:{n:"PtgElfColSV",f:PV},16:{n:"PtgElfRadicalLel",f:NV},25:{n:"PtgList",f:BV},29:{n:"PtgSxName",f:VV},255:{}},XV={0:{n:"PtgAttrNoop",f:GV},1:{n:"PtgAttrSemi",f:tV},2:{n:"PtgAttrIf",f:Q3},4:{n:"PtgAttrChoose",f:Z3},8:{n:"PtgAttrGoto",f:J3},16:{n:"PtgAttrSum",f:uV},32:{n:"PtgAttrBaxcel",f:cT},33:{n:"PtgAttrBaxcel",f:cT},64:{n:"PtgAttrSpace",f:rV},65:{n:"PtgAttrSpaceSemi",f:nV},128:{n:"PtgAttrIfError",f:eV},255:{}};function Jf(t,e,r,n){if(n.biff<8)return xn(t,e);for(var i=t.l+e,s=[],o=0;o!==r.length;++o)switch(r[o][0]){case"PtgArray":r[o][1]=CV(t,0,n),s.push(r[o][1]);break;case"PtgMemArea":r[o][2]=vV(t,r[o][1],n),s.push(r[o][2]);break;case"PtgExp":n&&n.biff==12&&(r[o][1][1]=t.read_shift(4),s.push(r[o][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+r[o][0]}return e=i-t.l,e!==0&&s.push(xn(t,e)),s}function Qf(t,e,r){for(var n=t.l+e,i,s,o=[];n!=t.l;)e=n-t.l,s=t[t.l],i=uT[s]||uT[jV[s]],(s===24||s===25)&&(i=(s===24?KV:XV)[t[t.l+1]]),!i||!i.f?xn(t,e):o.push([i.n,i.f(t,e,r)]);return o}function qV(t){for(var e=[],r=0;r<t.length;++r){for(var n=t[r],i=[],s=0;s<n.length;++s){var o=n[s];if(o)switch(o[0]){case 2:i.push('"'+o[1].replace(/"/g,'""')+'"');break;default:i.push(o[1])}else i.push("")}e.push(i.join(","))}return e.join(";")}var ZV={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function JV(t,e){if(!t&&!(e&&e.biff<=5&&e.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(t)?"'"+t+"'":t}function RP(t,e,r){if(!t)return"SH33TJSERR0";if(r.biff>8&&(!t.XTI||!t.XTI[e]))return t.SheetNames[e];if(!t.XTI)return"SH33TJSERR6";var n=t.XTI[e];if(r.biff<8)return e>1e4&&(e-=65536),e<0&&(e=-e),e==0?"":t.XTI[e-1];if(!n)return"SH33TJSERR1";var i="";if(r.biff>8)switch(t[n[0]][0]){case 357:return i=n[1]==-1?"#REF":t.SheetNames[n[1]],n[1]==n[2]?i:i+":"+t.SheetNames[n[2]];case 358:return r.SID!=null?t.SheetNames[r.SID]:"SH33TJSSAME"+t[n[0]][0];case 355:default:return"SH33TJSSRC"+t[n[0]][0]}switch(t[n[0]][0][0]){case 1025:return i=n[1]==-1?"#REF":t.SheetNames[n[1]]||"SH33TJSERR3",n[1]==n[2]?i:i+":"+t.SheetNames[n[2]];case 14849:return t[n[0]].slice(1).map(function(s){return s.Name}).join(";;");default:return t[n[0]][0][3]?(i=n[1]==-1?"#REF":t[n[0]][0][3][n[1]]||"SH33TJSERR4",n[1]==n[2]?i:i+":"+t[n[0]][0][3][n[2]]):"SH33TJSERR2"}}function hT(t,e,r){var n=RP(t,e,r);return n=="#REF"?n:JV(n,r)}function gn(t,e,r,n,i){var s=i&&i.biff||8,o={s:{c:0,r:0},e:{c:0,r:0}},a=[],l,c,u,h=0,d=0,f,g="";if(!t[0]||!t[0][0])return"";for(var m=-1,p="",S=0,y=t[0].length;S<y;++S){var C=t[0][S];switch(C[0]){case"PtgUminus":a.push("-"+a.pop());break;case"PtgUplus":a.push("+"+a.pop());break;case"PtgPercent":a.push(a.pop()+"%");break;case"PtgAdd":case"PtgConcat":case"PtgDiv":case"PtgEq":case"PtgGe":case"PtgGt":case"PtgLe":case"PtgLt":case"PtgMul":case"PtgNe":case"PtgPower":case"PtgSub":if(l=a.pop(),c=a.pop(),m>=0){switch(t[0][m][1][0]){case 0:p=xr(" ",t[0][m][1][1]);break;case 1:p=xr("\r",t[0][m][1][1]);break;default:if(p="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+t[0][m][1][0])}c=c+p,m=-1}a.push(c+ZV[C[0]]+l);break;case"PtgIsect":l=a.pop(),c=a.pop(),a.push(c+" "+l);break;case"PtgUnion":l=a.pop(),c=a.pop(),a.push(c+","+l);break;case"PtgRange":l=a.pop(),c=a.pop(),a.push(c+":"+l);break;case"PtgAttrChoose":break;case"PtgAttrGoto":break;case"PtgAttrIf":break;case"PtgAttrIfError":break;case"PtgRef":u=Wd(C[1][1],o,i),a.push(Ud(u,s));break;case"PtgRefN":u=r?Wd(C[1][1],r,i):C[1][1],a.push(Ud(u,s));break;case"PtgRef3d":h=C[1][1],u=Wd(C[1][2],o,i),g=hT(n,h,i),a.push(g+"!"+Ud(u,s));break;case"PtgFunc":case"PtgFuncVar":var E=C[1][0],A=C[1][1];E||(E=0),E&=127;var O=E==0?[]:a.slice(-E);a.length-=E,A==="User"&&(A=O.shift()),a.push(A+"("+O.join(",")+")");break;case"PtgBool":a.push(C[1]?"TRUE":"FALSE");break;case"PtgInt":a.push(C[1]);break;case"PtgNum":a.push(String(C[1]));break;case"PtgStr":a.push('"'+C[1].replace(/"/g,'""')+'"');break;case"PtgErr":a.push(C[1]);break;case"PtgAreaN":f=zR(C[1][1],r?{s:r}:o,i),a.push(av(f,i));break;case"PtgArea":f=zR(C[1][1],o,i),a.push(av(f,i));break;case"PtgArea3d":h=C[1][1],f=C[1][2],g=hT(n,h,i),a.push(g+"!"+av(f,i));break;case"PtgAttrSum":a.push("SUM("+a.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":d=C[1][2];var T=(n.names||[])[d-1]||(n[0]||[])[d],W=T?T.Name:"SH33TJSNAME"+String(d);W&&W.slice(0,6)=="_xlfn."&&!i.xlfn&&(W=W.slice(6)),a.push(W);break;case"PtgNameX":var I=C[1][1];d=C[1][2];var Y;if(i.biff<=5)I<0&&(I=-I),n[I]&&(Y=n[I][d]);else{var z="";if(((n[I]||[])[0]||[])[0]==14849||(((n[I]||[])[0]||[])[0]==1025?n[I][d]&&n[I][d].itab>0&&(z=n.SheetNames[n[I][d].itab-1]+"!"):z=n.SheetNames[d-1]+"!"),n[I]&&n[I][d])z+=n[I][d].Name;else if(n[0]&&n[0][d])z+=n[0][d].Name;else{var U=(RP(n,I,i)||"").split(";;");U[d-1]?z=U[d-1]:z+="SH33TJSERRX"}a.push(z);break}Y||(Y={Name:"SH33TJSERRY"}),a.push(Y.Name);break;case"PtgParen":var oe="(",Ce=")";if(m>=0){switch(p="",t[0][m][1][0]){case 2:oe=xr(" ",t[0][m][1][1])+oe;break;case 3:oe=xr("\r",t[0][m][1][1])+oe;break;case 4:Ce=xr(" ",t[0][m][1][1])+Ce;break;case 5:Ce=xr("\r",t[0][m][1][1])+Ce;break;default:if(i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+t[0][m][1][0])}m=-1}a.push(oe+a.pop()+Ce);break;case"PtgRefErr":a.push("#REF!");break;case"PtgRefErr3d":a.push("#REF!");break;case"PtgExp":u={c:C[1][1],r:C[1][0]};var pe={c:r.c,r:r.r};if(n.sharedf[nt(u)]){var Te=n.sharedf[nt(u)];a.push(gn(Te,o,pe,n,i))}else{var Se=!1;for(l=0;l!=n.arrayf.length;++l)if(c=n.arrayf[l],!(u.c<c[0].s.c||u.c>c[0].e.c)&&!(u.r<c[0].s.r||u.r>c[0].e.r)){a.push(gn(c[1],o,pe,n,i)),Se=!0;break}Se||a.push(C[1])}break;case"PtgArray":a.push("{"+qV(C[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":m=S;break;case"PtgTbl":break;case"PtgMemErr":break;case"PtgMissArg":a.push("");break;case"PtgAreaErr":a.push("#REF!");break;case"PtgAreaErr3d":a.push("#REF!");break;case"PtgList":a.push("Table"+C[1].idx+"[#"+C[1].rt+"]");break;case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":break;case"PtgMemFunc":break;case"PtgMemNoMem":break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");case"PtgSxName":throw new Error("Unrecognized Formula Token: "+String(C));default:throw new Error("Unrecognized Formula Token: "+String(C))}var Ae=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(i.biff!=3&&m>=0&&Ae.indexOf(t[0][S][0])==-1){C=t[0][m];var q=!0;switch(C[1][0]){case 4:q=!1;case 0:p=xr(" ",C[1][1]);break;case 5:q=!1;case 1:p=xr("\r",C[1][1]);break;default:if(p="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+C[1][0])}a.push((q?p:"")+a.pop()+(q?"":p)),m=-1}}if(a.length>1&&i.WTF)throw new Error("bad formula stack");return a[0]}function QV(t,e,r){var n=t.l+e,i=r.biff==2?1:2,s,o=t.read_shift(i);if(o==65535)return[[],xn(t,e-2)];var a=Qf(t,o,r);return e!==o+i&&(s=Jf(t,e-o-i,a,r)),t.l=n,[a,s]}function eW(t,e,r){var n=t.l+e,i=r.biff==2?1:2,s,o=t.read_shift(i);if(o==65535)return[[],xn(t,e-2)];var a=Qf(t,o,r);return e!==o+i&&(s=Jf(t,e-o-i,a,r)),t.l=n,[a,s]}function tW(t,e,r,n){var i=t.l+e,s=Qf(t,n,r),o;return i!==t.l&&(o=Jf(t,i-t.l,s,r)),[s,o]}function rW(t,e,r){var n=t.l+e,i,s=t.read_shift(2),o=Qf(t,s,r);return s==65535?[[],xn(t,e-2)]:(e!==s+2&&(i=Jf(t,n-s-2,o,r)),[o,i])}function nW(t){var e;if(jo(t,t.l+6)!==65535)return[wn(t),"n"];switch(t[t.l]){case 0:return t.l+=8,["String","s"];case 1:return e=t[t.l+2]===1,t.l+=8,[e,"b"];case 2:return e=t[t.l+2],t.l+=8,[e,"e"];case 3:return t.l+=8,["","s"]}return[]}function uv(t,e,r){var n=t.l+e,i=vo(t);r.biff==2&&++t.l;var s=nW(t),o=t.read_shift(1);r.biff!=2&&(t.read_shift(1),r.biff>=5&&t.read_shift(4));var a=eW(t,n-t.l,r);return{cell:i,val:s[0],formula:a,shared:o>>3&1,tt:s[1]}}function tw(t,e,r){var n=t.read_shift(4),i=Qf(t,n,r),s=t.read_shift(4),o=s>0?Jf(t,s,i,r):null;return[i,o]}var iW=tw,rw=tw,sW=tw,oW=tw,aW={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},TP={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},lW={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function dT(t){return t.slice(0,3)=="of:"&&(t=t.slice(3)),t.charCodeAt(0)==61&&(t=t.slice(1),t.charCodeAt(0)==61&&(t=t.slice(1))),t=t.replace(/COM\.MICROSOFT\./g,""),t=t.replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g,function(e,r){return r.replace(/\./g,"")}),t=t.replace(/\[.(#[A-Z]*[?!])\]/g,"$1"),t.replace(/[;~]/g,",").replace(/\|/g,";")}function hv(t){var e=t.split(":"),r=e[0].split(".")[0];return[r,e[0].split(".")[1]+(e.length>1?":"+(e[1].split(".")[1]||e[1].split(".")[0]):"")]}var jd={},ju={};function Kd(t,e){if(t){var r=[.7,.7,.75,.75,.3,.3];e=="xlml"&&(r=[1,1,1,1,.5,.5]),t.left==null&&(t.left=r[0]),t.right==null&&(t.right=r[1]),t.top==null&&(t.top=r[2]),t.bottom==null&&(t.bottom=r[3]),t.header==null&&(t.header=r[4]),t.footer==null&&(t.footer=r[5])}}function _P(t,e,r,n,i,s){try{n.cellNF&&(t.z=ot[e])}catch(a){if(n.WTF)throw a}if(!(t.t==="z"&&!n.cellStyles)){if(t.t==="d"&&typeof t.v=="string"&&(t.v=Jr(t.v)),(!n||n.cellText!==!1)&&t.t!=="z")try{if(ot[e]==null&&fc(cL[e]||"General",e),t.t==="e")t.w=t.w||kc[t.v];else if(e===0)if(t.t==="n")(t.v|0)===t.v?t.w=t.v.toString(10):t.w=xf(t.v);else if(t.t==="d"){var o=$n(t.v);(o|0)===o?t.w=o.toString(10):t.w=xf(o)}else{if(t.v===void 0)return"";t.w=wc(t.v,ju)}else t.t==="d"?t.w=Ui(e,$n(t.v),ju):t.w=Ui(e,t.v,ju)}catch(a){if(n.WTF)throw a}if(n.cellStyles&&r!=null)try{t.s=s.Fills[r],t.s.fgColor&&t.s.fgColor.theme&&!t.s.fgColor.rgb&&(t.s.fgColor.rgb=np(i.themeElements.clrScheme[t.s.fgColor.theme].rgb,t.s.fgColor.tint||0),n.WTF&&(t.s.fgColor.raw_rgb=i.themeElements.clrScheme[t.s.fgColor.theme].rgb)),t.s.bgColor&&t.s.bgColor.theme&&(t.s.bgColor.rgb=np(i.themeElements.clrScheme[t.s.bgColor.theme].rgb,t.s.bgColor.tint||0),n.WTF&&(t.s.bgColor.raw_rgb=i.themeElements.clrScheme[t.s.bgColor.theme].rgb))}catch(a){if(n.WTF&&s.Fills)throw a}}}function cW(t,e){var r=br(e);r.s.r<=r.e.r&&r.s.c<=r.e.c&&r.s.r>=0&&r.s.c>=0&&(t["!ref"]=Rt(r))}var uW=/<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g,hW=/<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/,dW=/<(?:\w:)?hyperlink [^>]*>/mg,fW=/"(\w*:\w*)"/,gW=/<(?:\w:)?col\b[^>]*[\/]?>/g,mW=/<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g,pW=/<(?:\w:)?pageMargins[^>]*\/>/g,AP=/<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/,wW=/<(?:\w:)?sheetPr[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetPr)>/,vW=/<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;function CW(t,e,r,n,i,s,o){if(!t)return t;n||(n={"!id":{}});var a=e.dense?[]:{},l={s:{r:2e6,c:2e6},e:{r:0,c:0}},c="",u="",h=t.match(hW);h?(c=t.slice(0,h.index),u=t.slice(h.index+h[0].length)):c=u=t;var d=c.match(AP);d?Mx(d[0],a,i,r):(d=c.match(wW))&&SW(d[0],d[1]||"",a,i,r);var f=(c.match(/<(?:\w*:)?dimension/)||{index:-1}).index;if(f>0){var g=c.slice(f,f+50).match(fW);g&&cW(a,g[1])}var m=c.match(vW);m&&m[1]&&TW(m[1],i);var p=[];if(e.cellStyles){var S=c.match(gW);S&&bW(p,S)}h&&_W(h[1],a,e,l,s,o);var y=u.match(mW);y&&(a["!autofilter"]=EW(y[0]));var C=[],E=u.match(uW);if(E)for(f=0;f!=E.length;++f)C[f]=br(E[f].slice(E[f].indexOf('"')+1));var A=u.match(dW);A&&xW(a,A,n);var O=u.match(pW);if(O&&(a["!margins"]=yW(Qe(O[0]))),!a["!ref"]&&l.e.c>=l.s.c&&l.e.r>=l.s.r&&(a["!ref"]=Rt(l)),e.sheetRows>0&&a["!ref"]){var T=br(a["!ref"]);e.sheetRows<=+T.e.r&&(T.e.r=e.sheetRows-1,T.e.r>l.e.r&&(T.e.r=l.e.r),T.e.r<T.s.r&&(T.s.r=T.e.r),T.e.c>l.e.c&&(T.e.c=l.e.c),T.e.c<T.s.c&&(T.s.c=T.e.c),a["!fullref"]=a["!ref"],a["!ref"]=Rt(T))}return p.length>0&&(a["!cols"]=p),C.length>0&&(a["!merges"]=C),a}function Mx(t,e,r,n){var i=Qe(t);r.Sheets[n]||(r.Sheets[n]={}),i.codeName&&(r.Sheets[n].CodeName=At(Jt(i.codeName)))}function SW(t,e,r,n,i){Mx(t.slice(0,t.indexOf(">")),r,n,i)}function xW(t,e,r){for(var n=Array.isArray(t),i=0;i!=e.length;++i){var s=Qe(Jt(e[i]),!0);if(!s.ref)return;var o=((r||{})["!id"]||[])[s.id];o?(s.Target=o.Target,s.location&&(s.Target+="#"+At(s.location))):(s.Target="#"+At(s.location),o={Target:s.Target,TargetMode:"Internal"}),s.Rel=o,s.tooltip&&(s.Tooltip=s.tooltip,delete s.tooltip);for(var a=br(s.ref),l=a.s.r;l<=a.e.r;++l)for(var c=a.s.c;c<=a.e.c;++c){var u=nt({c,r:l});n?(t[l]||(t[l]=[]),t[l][c]||(t[l][c]={t:"z",v:void 0}),t[l][c].l=s):(t[u]||(t[u]={t:"z",v:void 0}),t[u].l=s)}}}function yW(t){var e={};return["left","right","top","bottom","header","footer"].forEach(function(r){t[r]&&(e[r]=parseFloat(t[r]))}),e}function bW(t,e){for(var r=!1,n=0;n!=e.length;++n){var i=Qe(e[n],!0);i.hidden&&(i.hidden=ar(i.hidden));var s=parseInt(i.min,10)-1,o=parseInt(i.max,10)-1;for(i.outlineLevel&&(i.level=+i.outlineLevel||0),delete i.min,delete i.max,i.width=+i.width,!r&&i.width&&(r=!0,_x(i.width)),ih(i);s<=o;)t[s++]=sn(i)}}function EW(t){var e={ref:(t.match(/ref="([^"]*)"/)||[])[1]};return e}var RW=/<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/?>/;function TW(t,e){e.Views||(e.Views=[{}]),(t.match(RW)||[]).forEach(function(r,n){var i=Qe(r);e.Views[n]||(e.Views[n]={}),+i.zoomScale&&(e.Views[n].zoom=+i.zoomScale),ar(i.rightToLeft)&&(e.Views[n].RTL=!0)})}var _W=function(){var t=/<(?:\w+:)?c[ \/>]/,e=/<\/(?:\w+:)?row>/,r=/r=["']([^"']*)["']/,n=/<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/,i=/ref=["']([^"']*)["']/,s=yf("v"),o=yf("f");return function(l,c,u,h,d,f){for(var g=0,m="",p=[],S=[],y=0,C=0,E=0,A="",O,T,W=0,I=0,Y,z,U=0,oe=0,Ce=Array.isArray(f.CellXf),pe,Te=[],Se=[],Ae=Array.isArray(c),q=[],Oe={},v=!1,w=!!u.sheetStubs,x=l.split(e),R=0,b=x.length;R!=b;++R){m=x[R].trim();var B=m.length;if(B!==0){var X=0;e:for(g=0;g<B;++g)switch(m[g]){case">":if(m[g-1]!="/"){++g;break e}if(u&&u.cellStyles){if(T=Qe(m.slice(X,g),!0),W=T.r!=null?parseInt(T.r,10):W+1,I=-1,u.sheetRows&&u.sheetRows<W)continue;Oe={},v=!1,T.ht&&(v=!0,Oe.hpt=parseFloat(T.ht),Oe.hpx=Tf(Oe.hpt)),T.hidden=="1"&&(v=!0,Oe.hidden=!0),T.outlineLevel!=null&&(v=!0,Oe.level=+T.outlineLevel),v&&(q[W-1]=Oe)}break;case"<":X=g;break}if(X>=g)break;if(T=Qe(m.slice(X,g),!0),W=T.r!=null?parseInt(T.r,10):W+1,I=-1,!(u.sheetRows&&u.sheetRows<W)){h.s.r>W-1&&(h.s.r=W-1),h.e.r<W-1&&(h.e.r=W-1),u&&u.cellStyles&&(Oe={},v=!1,T.ht&&(v=!0,Oe.hpt=parseFloat(T.ht),Oe.hpx=Tf(Oe.hpt)),T.hidden=="1"&&(v=!0,Oe.hidden=!0),T.outlineLevel!=null&&(v=!0,Oe.level=+T.outlineLevel),v&&(q[W-1]=Oe)),p=m.slice(g).split(t);for(var ne=0;ne!=p.length&&p[ne].trim().charAt(0)=="<";++ne);for(p=p.slice(ne),g=0;g!=p.length;++g)if(m=p[g].trim(),m.length!==0){if(S=m.match(r),y=g,C=0,E=0,m="<c "+(m.slice(0,1)=="<"?">":"")+m,S!=null&&S.length===2){for(y=0,A=S[1],C=0;C!=A.length&&!((E=A.charCodeAt(C)-64)<1||E>26);++C)y=26*y+E;--y,I=y}else++I;for(C=0;C!=m.length&&m.charCodeAt(C)!==62;++C);if(++C,T=Qe(m.slice(0,C),!0),T.r||(T.r=nt({r:W-1,c:I})),A=m.slice(C),O={t:""},(S=A.match(s))!=null&&S[1]!==""&&(O.v=At(S[1])),u.cellFormula){if((S=A.match(o))!=null&&S[1]!==""){if(O.f=At(Jt(S[1])).replace(/\r\n/g,`
  32. `),u.xlfn||(O.f=lT(O.f)),S[0].indexOf('t="array"')>-1)O.F=(A.match(i)||[])[1],O.F.indexOf(":")>-1&&Te.push([br(O.F),O.F]);else if(S[0].indexOf('t="shared"')>-1){z=Qe(S[0]);var fe=At(Jt(S[1]));u.xlfn||(fe=lT(fe)),Se[parseInt(z.si,10)]=[z,fe,T.r]}}else(S=A.match(/<f[^>]*\/>/))&&(z=Qe(S[0]),Se[z.si]&&(O.f=L3(Se[z.si][1],Se[z.si][2],T.r)));var le=Fn(T.r);for(C=0;C<Te.length;++C)le.r>=Te[C][0].s.r&&le.r<=Te[C][0].e.r&&le.c>=Te[C][0].s.c&&le.c<=Te[C][0].e.c&&(O.F=Te[C][1])}if(T.t==null&&O.v===void 0)if(O.f||O.F)O.v=0,O.t="n";else if(w)O.t="z";else continue;else O.t=T.t||"n";switch(h.s.c>I&&(h.s.c=I),h.e.c<I&&(h.e.c=I),O.t){case"n":if(O.v==""||O.v==null){if(!w)continue;O.t="z"}else O.v=parseFloat(O.v);break;case"s":if(typeof O.v>"u"){if(!w)continue;O.t="z"}else Y=jd[parseInt(O.v,10)],O.v=Y.t,O.r=Y.r,u.cellHTML&&(O.h=Y.h);break;case"str":O.t="s",O.v=O.v!=null?Jt(O.v):"",u.cellHTML&&(O.h=px(O.v));break;case"inlineStr":S=A.match(n),O.t="s",S!=null&&(Y=Tx(S[1]))?(O.v=Y.t,u.cellHTML&&(O.h=Y.h)):O.v="";break;case"b":O.v=ar(O.v);break;case"d":u.cellDates?O.v=Jr(O.v,1):(O.v=$n(Jr(O.v,1)),O.t="n");break;case"e":(!u||u.cellText!==!1)&&(O.w=O.v),O.v=XO[O.v];break}if(U=oe=0,pe=null,Ce&&T.s!==void 0&&(pe=f.CellXf[T.s],pe!=null&&(pe.numFmtId!=null&&(U=pe.numFmtId),u.cellStyles&&pe.fillId!=null&&(oe=pe.fillId))),_P(O,U,oe,u,d,f),u.cellDates&&Ce&&O.t=="n"&&uh(ot[U])&&(O.t="d",O.v=Qp(O.v)),T.cm&&u.xlmeta){var we=(u.xlmeta.Cell||[])[+T.cm-1];we&&we.type=="XLDAPR"&&(O.D=!0)}if(Ae){var N=Fn(T.r);c[N.r]||(c[N.r]=[]),c[N.r][N.c]=O}else c[T.r]=O}}}}q.length>0&&(c["!rows"]=q)}}();function AW(t,e){var r={},n=t.l+e;r.r=t.read_shift(4),t.l+=4;var i=t.read_shift(2);t.l+=1;var s=t.read_shift(1);return t.l=n,s&7&&(r.level=s&7),s&16&&(r.hidden=!0),s&32&&(r.hpt=i/20),r}var MW=Dc;function IW(){}function OW(t,e){var r={},n=t[t.l];return++t.l,r.above=!(n&64),r.left=!(n&128),t.l+=18,r.name=QL(t),r}function PW(t){var e=Gi(t);return[e]}function DW(t){var e=Pc(t);return[e]}function kW(t){var e=Gi(t),r=t.read_shift(1);return[e,r,"b"]}function NW(t){var e=Pc(t),r=t.read_shift(1);return[e,r,"b"]}function HW(t){var e=Gi(t),r=t.read_shift(1);return[e,r,"e"]}function FW(t){var e=Pc(t),r=t.read_shift(1);return[e,r,"e"]}function LW(t){var e=Gi(t),r=t.read_shift(4);return[e,r,"s"]}function $W(t){var e=Pc(t),r=t.read_shift(4);return[e,r,"s"]}function BW(t){var e=Gi(t),r=wn(t);return[e,r,"n"]}function MP(t){var e=Pc(t),r=wn(t);return[e,r,"n"]}function VW(t){var e=Gi(t),r=bx(t);return[e,r,"n"]}function WW(t){var e=Pc(t),r=bx(t);return[e,r,"n"]}function UW(t){var e=Gi(t),r=xx(t);return[e,r,"is"]}function YW(t){var e=Gi(t),r=Cn(t);return[e,r,"str"]}function zW(t){var e=Pc(t),r=Cn(t);return[e,r,"str"]}function GW(t,e,r){var n=t.l+e,i=Gi(t);i.r=r["!row"];var s=t.read_shift(1),o=[i,s,"b"];if(r.cellFormula){t.l+=2;var a=rw(t,n-t.l,r);o[3]=gn(a,null,i,r.supbooks,r)}else t.l=n;return o}function jW(t,e,r){var n=t.l+e,i=Gi(t);i.r=r["!row"];var s=t.read_shift(1),o=[i,s,"e"];if(r.cellFormula){t.l+=2;var a=rw(t,n-t.l,r);o[3]=gn(a,null,i,r.supbooks,r)}else t.l=n;return o}function KW(t,e,r){var n=t.l+e,i=Gi(t);i.r=r["!row"];var s=wn(t),o=[i,s,"n"];if(r.cellFormula){t.l+=2;var a=rw(t,n-t.l,r);o[3]=gn(a,null,i,r.supbooks,r)}else t.l=n;return o}function XW(t,e,r){var n=t.l+e,i=Gi(t);i.r=r["!row"];var s=Cn(t),o=[i,s,"str"];if(r.cellFormula){t.l+=2;var a=rw(t,n-t.l,r);o[3]=gn(a,null,i,r.supbooks,r)}else t.l=n;return o}var qW=Dc;function ZW(t,e){var r=t.l+e,n=Dc(t),i=yx(t),s=Cn(t),o=Cn(t),a=Cn(t);t.l=r;var l={rfx:n,relId:i,loc:s,display:a};return o&&(l.Tooltip=o),l}function JW(){}function QW(t,e,r){var n=t.l+e,i=GO(t),s=t.read_shift(1),o=[i];if(o[2]=s,r.cellFormula){var a=iW(t,n-t.l,r);o[1]=a}else t.l=n;return o}function eU(t,e,r){var n=t.l+e,i=Dc(t),s=[i];if(r.cellFormula){var o=oW(t,n-t.l,r);s[1]=o,t.l=n}else t.l=n;return s}var tU=["left","right","top","bottom","header","footer"];function rU(t){var e={};return tU.forEach(function(r){e[r]=wn(t)}),e}function nU(t){var e=t.read_shift(2);return t.l+=28,{RTL:e&32}}function iU(){}function sU(){}function oU(t,e,r,n,i,s,o){if(!t)return t;var a=e||{};n||(n={"!id":{}});var l=a.dense?[]:{},c,u={s:{r:2e6,c:2e6},e:{r:0,c:0}},h=!1,d=!1,f,g,m,p,S,y,C,E,A,O=[];a.biff=12,a["!row"]=0;var T=0,W=!1,I=[],Y={},z=a.supbooks||i.supbooks||[[]];if(z.sharedf=Y,z.arrayf=I,z.SheetNames=i.SheetNames||i.Sheets.map(function(Ae){return Ae.name}),!a.supbooks&&(a.supbooks=z,i.Names))for(var U=0;U<i.Names.length;++U)z[0][U+1]=i.Names[U];var oe=[],Ce=[],pe=!1;op[16]={n:"BrtShortReal",f:MP};var Te;if(ca(t,function(q,Oe,v){if(!d)switch(v){case 148:c=q;break;case 0:f=q,a.sheetRows&&a.sheetRows<=f.r&&(d=!0),E=on(p=f.r),a["!row"]=f.r,(q.hidden||q.hpt||q.level!=null)&&(q.hpt&&(q.hpx=Tf(q.hpt)),Ce[q.r]=q);break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 13:case 14:case 15:case 16:case 17:case 18:case 62:switch(g={t:q[2]},q[2]){case"n":g.v=q[1];break;case"s":C=jd[q[1]],g.v=C.t,g.r=C.r;break;case"b":g.v=!!q[1];break;case"e":g.v=q[1],a.cellText!==!1&&(g.w=kc[g.v]);break;case"str":g.t="s",g.v=q[1];break;case"is":g.t="s",g.v=q[1].t;break}if((m=o.CellXf[q[0].iStyleRef])&&_P(g,m.numFmtId,null,a,s,o),S=q[0].c==-1?S+1:q[0].c,a.dense?(l[p]||(l[p]=[]),l[p][S]=g):l[Br(S)+E]=g,a.cellFormula){for(W=!1,T=0;T<I.length;++T){var w=I[T];f.r>=w[0].s.r&&f.r<=w[0].e.r&&S>=w[0].s.c&&S<=w[0].e.c&&(g.F=Rt(w[0]),W=!0)}!W&&q.length>3&&(g.f=q[3])}if(u.s.r>f.r&&(u.s.r=f.r),u.s.c>S&&(u.s.c=S),u.e.r<f.r&&(u.e.r=f.r),u.e.c<S&&(u.e.c=S),a.cellDates&&m&&g.t=="n"&&uh(ot[m.numFmtId])){var x=oc(g.v);x&&(g.t="d",g.v=new Date(x.y,x.m-1,x.d,x.H,x.M,x.S,x.u))}Te&&(Te.type=="XLDAPR"&&(g.D=!0),Te=void 0);break;case 1:case 12:if(!a.sheetStubs||h)break;g={t:"z",v:void 0},S=q[0].c==-1?S+1:q[0].c,a.dense?(l[p]||(l[p]=[]),l[p][S]=g):l[Br(S)+E]=g,u.s.r>f.r&&(u.s.r=f.r),u.s.c>S&&(u.s.c=S),u.e.r<f.r&&(u.e.r=f.r),u.e.c<S&&(u.e.c=S),Te&&(Te.type=="XLDAPR"&&(g.D=!0),Te=void 0);break;case 176:O.push(q);break;case 49:Te=((a.xlmeta||{}).Cell||[])[q-1];break;case 494:var R=n["!id"][q.relId];for(R?(q.Target=R.Target,q.loc&&(q.Target+="#"+q.loc),q.Rel=R):q.relId==""&&(q.Target="#"+q.loc),p=q.rfx.s.r;p<=q.rfx.e.r;++p)for(S=q.rfx.s.c;S<=q.rfx.e.c;++S)a.dense?(l[p]||(l[p]=[]),l[p][S]||(l[p][S]={t:"z",v:void 0}),l[p][S].l=q):(y=nt({c:S,r:p}),l[y]||(l[y]={t:"z",v:void 0}),l[y].l=q);break;case 426:if(!a.cellFormula)break;I.push(q),A=a.dense?l[p][S]:l[Br(S)+E],A.f=gn(q[1],u,{r:f.r,c:S},z,a),A.F=Rt(q[0]);break;case 427:if(!a.cellFormula)break;Y[nt(q[0].s)]=q[1],A=a.dense?l[p][S]:l[Br(S)+E],A.f=gn(q[1],u,{r:f.r,c:S},z,a);break;case 60:if(!a.cellStyles)break;for(;q.e>=q.s;)oe[q.e--]={width:q.w/256,hidden:!!(q.flags&1),level:q.level},pe||(pe=!0,_x(q.w/256)),ih(oe[q.e+1]);break;case 161:l["!autofilter"]={ref:Rt(q)};break;case 476:l["!margins"]=q;break;case 147:i.Sheets[r]||(i.Sheets[r]={}),q.name&&(i.Sheets[r].CodeName=q.name),(q.above||q.left)&&(l["!outline"]={above:q.above,left:q.left});break;case 137:i.Views||(i.Views=[{}]),i.Views[0]||(i.Views[0]={}),q.RTL&&(i.Views[0].RTL=!0);break;case 485:break;case 64:case 1053:break;case 151:break;case 152:case 175:case 644:case 625:case 562:case 396:case 1112:case 1146:case 471:case 1050:case 649:case 1105:case 589:case 607:case 564:case 1055:case 168:case 174:case 1180:case 499:case 507:case 550:case 171:case 167:case 1177:case 169:case 1181:case 551:case 552:case 661:case 639:case 478:case 537:case 477:case 536:case 1103:case 680:case 1104:case 1024:case 663:case 535:case 678:case 504:case 1043:case 428:case 170:case 3072:case 50:case 2070:case 1045:break;case 35:h=!0;break;case 36:h=!1;break;case 37:h=!0;break;case 38:h=!1;break;default:if(!Oe.T){if(!h||a.WTF)throw new Error("Unexpected record 0x"+v.toString(16))}}},a),delete a.supbooks,delete a["!row"],!l["!ref"]&&(u.s.r<2e6||c&&(c.e.r>0||c.e.c>0||c.s.r>0||c.s.c>0))&&(l["!ref"]=Rt(c||u)),a.sheetRows&&l["!ref"]){var Se=br(l["!ref"]);a.sheetRows<=+Se.e.r&&(Se.e.r=a.sheetRows-1,Se.e.r>u.e.r&&(Se.e.r=u.e.r),Se.e.r<Se.s.r&&(Se.s.r=Se.e.r),Se.e.c>u.e.c&&(Se.e.c=u.e.c),Se.e.c<Se.s.c&&(Se.s.c=Se.e.c),l["!fullref"]=l["!ref"],l["!ref"]=Rt(Se))}return O.length>0&&(l["!merges"]=O),oe.length>0&&(l["!cols"]=oe),Ce.length>0&&(l["!rows"]=Ce),l}function aU(t){var e=[],r=t.match(/^<c:numCache>/),n;(t.match(/<c:pt idx="(\d*)">(.*?)<\/c:pt>/mg)||[]).forEach(function(s){var o=s.match(/<c:pt idx="(\d*?)"><c:v>(.*)<\/c:v><\/c:pt>/);o&&(e[+o[1]]=r?+o[2]:o[2])});var i=At((t.match(/<c:formatCode>([\s\S]*?)<\/c:formatCode>/)||["","General"])[1]);return(t.match(/<c:f>(.*?)<\/c:f>/mg)||[]).forEach(function(s){n=s.replace(/<.*?>/g,"")}),[e,i,n]}function lU(t,e,r,n,i,s){var o=s||{"!type":"chart"};if(!t)return s;var a=0,l=0,c="A",u={s:{r:2e6,c:2e6},e:{r:0,c:0}};return(t.match(/<c:numCache>[\s\S]*?<\/c:numCache>/gm)||[]).forEach(function(h){var d=aU(h);u.s.r=u.s.c=0,u.e.c=a,c=Br(a),d[0].forEach(function(f,g){o[c+on(g)]={t:"n",v:f,z:d[1]},l=g}),u.e.r<l&&(u.e.r=l),++a}),a>0&&(o["!ref"]=Rt(u)),o}function cU(t,e,r,n,i){if(!t)return t;n||(n={"!id":{}});var s={"!type":"chart","!drawel":null,"!rel":""},o,a=t.match(AP);return a&&Mx(a[0],s,i,r),(o=t.match(/drawing r:id="(.*?)"/))&&(s["!rel"]=o[1]),n["!id"][s["!rel"]]&&(s["!drawel"]=n["!id"][s["!rel"]]),s}function uU(t,e){t.l+=10;var r=Cn(t);return{name:r}}function hU(t,e,r,n,i){if(!t)return t;n||(n={"!id":{}});var s={"!type":"chart","!drawel":null,"!rel":""},o=!1;return ca(t,function(l,c,u){switch(u){case 550:s["!rel"]=l;break;case 651:i.Sheets[r]||(i.Sheets[r]={}),l.name&&(i.Sheets[r].CodeName=l.name);break;case 562:case 652:case 669:case 679:case 551:case 552:case 476:case 3072:break;case 35:o=!0;break;case 36:o=!1;break;case 37:break;case 38:break;default:if(!(c.T>0)){if(!(c.T<0)){if(!o||e.WTF)throw new Error("Unexpected record 0x"+u.toString(16))}}}},e),n["!id"][s["!rel"]]&&(s["!drawel"]=n["!id"][s["!rel"]]),s}var IP=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]],dU=[["activeTab",0,"int"],["autoFilterDateGrouping",!0,"bool"],["firstSheet",0,"int"],["minimized",!1,"bool"],["showHorizontalScroll",!0,"bool"],["showSheetTabs",!0,"bool"],["showVerticalScroll",!0,"bool"],["tabRatio",600,"int"],["visibility","visible"]],fU=[],gU=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function fT(t,e){for(var r=0;r!=t.length;++r)for(var n=t[r],i=0;i!=e.length;++i){var s=e[i];if(n[s[0]]==null)n[s[0]]=s[1];else switch(s[2]){case"bool":typeof n[s[0]]=="string"&&(n[s[0]]=ar(n[s[0]]));break;case"int":typeof n[s[0]]=="string"&&(n[s[0]]=parseInt(n[s[0]],10));break}}}function gT(t,e){for(var r=0;r!=e.length;++r){var n=e[r];if(t[n[0]]==null)t[n[0]]=n[1];else switch(n[2]){case"bool":typeof t[n[0]]=="string"&&(t[n[0]]=ar(t[n[0]]));break;case"int":typeof t[n[0]]=="string"&&(t[n[0]]=parseInt(t[n[0]],10));break}}}function OP(t){gT(t.WBProps,IP),gT(t.CalcPr,gU),fT(t.WBView,dU),fT(t.Sheets,fU),ju.date1904=ar(t.WBProps.date1904)}var mU="][*?/\\".split("");function pU(t,e){if(t.length>31)throw new Error("Sheet names cannot exceed 31 chars");var r=!0;return mU.forEach(function(n){if(t.indexOf(n)!=-1)throw new Error("Sheet name cannot contain : \\ / ? * [ ]")}),r}var wU=/<\w+:workbook/;function vU(t,e){if(!t)throw new Error("Could not find file");var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},Names:[],xmlns:""},n=!1,i="xmlns",s={},o=0;if(t.replace(yn,function(l,c){var u=Qe(l);switch(wo(u[0])){case"<?xml":break;case"<workbook":l.match(wU)&&(i="xmlns"+l.match(/<(\w+):/)[1]),r.xmlns=u[i];break;case"</workbook>":break;case"<fileVersion":delete u[0],r.AppVersion=u;break;case"<fileVersion/>":case"</fileVersion>":break;case"<fileSharing":break;case"<fileSharing/>":break;case"<workbookPr":case"<workbookPr/>":IP.forEach(function(h){if(u[h[0]]!=null)switch(h[2]){case"bool":r.WBProps[h[0]]=ar(u[h[0]]);break;case"int":r.WBProps[h[0]]=parseInt(u[h[0]],10);break;default:r.WBProps[h[0]]=u[h[0]]}}),u.codeName&&(r.WBProps.CodeName=Jt(u.codeName));break;case"</workbookPr>":break;case"<workbookProtection":break;case"<workbookProtection/>":break;case"<bookViews":case"<bookViews>":case"</bookViews>":break;case"<workbookView":case"<workbookView/>":delete u[0],r.WBView.push(u);break;case"</workbookView>":break;case"<sheets":case"<sheets>":case"</sheets>":break;case"<sheet":switch(u.state){case"hidden":u.Hidden=1;break;case"veryHidden":u.Hidden=2;break;default:u.Hidden=0}delete u.state,u.name=At(Jt(u.name)),delete u[0],r.Sheets.push(u);break;case"</sheet>":break;case"<functionGroups":case"<functionGroups/>":break;case"<functionGroup":break;case"<externalReferences":case"</externalReferences>":case"<externalReferences>":break;case"<externalReference":break;case"<definedNames/>":break;case"<definedNames>":case"<definedNames":n=!0;break;case"</definedNames>":n=!1;break;case"<definedName":s={},s.Name=Jt(u.name),u.comment&&(s.Comment=u.comment),u.localSheetId&&(s.Sheet=+u.localSheetId),ar(u.hidden||"0")&&(s.Hidden=!0),o=c+l.length;break;case"</definedName>":s.Ref=At(Jt(t.slice(o,c))),r.Names.push(s);break;case"<definedName/>":break;case"<calcPr":delete u[0],r.CalcPr=u;break;case"<calcPr/>":delete u[0],r.CalcPr=u;break;case"</calcPr>":break;case"<oleSize":break;case"<customWorkbookViews>":case"</customWorkbookViews>":case"<customWorkbookViews":break;case"<customWorkbookView":case"</customWorkbookView>":break;case"<pivotCaches>":case"</pivotCaches>":case"<pivotCaches":break;case"<pivotCache":break;case"<smartTagPr":case"<smartTagPr/>":break;case"<smartTagTypes":case"<smartTagTypes>":case"</smartTagTypes>":break;case"<smartTagType":break;case"<webPublishing":case"<webPublishing/>":break;case"<fileRecoveryPr":case"<fileRecoveryPr/>":break;case"<webPublishObjects>":case"<webPublishObjects":case"</webPublishObjects>":break;case"<webPublishObject":break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":n=!0;break;case"</ext>":n=!1;break;case"<ArchID":break;case"<AlternateContent":case"<AlternateContent>":n=!0;break;case"</AlternateContent>":n=!1;break;case"<revisionPtr":break;default:if(!n&&e.WTF)throw new Error("unrecognized "+u[0]+" in workbook")}return l}),HL.indexOf(r.xmlns)===-1)throw new Error("Unknown Namespace: "+r.xmlns);return OP(r),r}function CU(t,e){var r={};return r.Hidden=t.read_shift(4),r.iTabID=t.read_shift(4),r.strRelID=U1(t),r.name=Cn(t),r}function SU(t,e){var r={},n=t.read_shift(4);r.defaultThemeVersion=t.read_shift(4);var i=e>8?Cn(t):"";return i.length>0&&(r.CodeName=i),r.autoCompressPictures=!!(n&65536),r.backupFile=!!(n&64),r.checkCompatibility=!!(n&4096),r.date1904=!!(n&1),r.filterPrivacy=!!(n&8),r.hidePivotFieldList=!!(n&1024),r.promptedSolutions=!!(n&16),r.publishItems=!!(n&2048),r.refreshAllConnections=!!(n&262144),r.saveExternalLinkValues=!!(n&128),r.showBorderUnselectedTables=!!(n&4),r.showInkAnnotation=!!(n&32),r.showObjects=["all","placeholders","none"][n>>13&3],r.showPivotChartFilter=!!(n&32768),r.updateLinks=["userSet","never","always"][n>>8&3],r}function xU(t,e){var r={};return t.read_shift(4),r.ArchID=t.read_shift(4),t.l+=e-8,r}function yU(t,e,r){var n=t.l+e;t.l+=4,t.l+=1;var i=t.read_shift(4),s=e$(t),o=sW(t,0,r),a=yx(t);t.l=n;var l={Name:s,Ptg:o};return i<268435455&&(l.Sheet=i),a&&(l.Comment=a),l}function bU(t,e){var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""},n=[],i=!1;e||(e={}),e.biff=12;var s=[],o=[[]];return o.SheetNames=[],o.XTI=[],op[16]={n:"BrtFRTArchID$",f:xU},ca(t,function(l,c,u){switch(u){case 156:o.SheetNames.push(l.name),r.Sheets.push(l);break;case 153:r.WBProps=l;break;case 39:l.Sheet!=null&&(e.SID=l.Sheet),l.Ref=gn(l.Ptg,null,null,o,e),delete e.SID,delete l.Ptg,s.push(l);break;case 1036:break;case 357:case 358:case 355:case 667:o[0].length?o.push([u,l]):o[0]=[u,l],o[o.length-1].XTI=[];break;case 362:o.length===0&&(o[0]=[],o[0].XTI=[]),o[o.length-1].XTI=o[o.length-1].XTI.concat(l),o.XTI=o.XTI.concat(l);break;case 361:break;case 2071:case 158:case 143:case 664:case 353:break;case 3072:case 3073:case 534:case 677:case 157:case 610:case 2050:case 155:case 548:case 676:case 128:case 665:case 2128:case 2125:case 549:case 2053:case 596:case 2076:case 2075:case 2082:case 397:case 154:case 1117:case 553:case 2091:break;case 35:n.push(u),i=!0;break;case 36:n.pop(),i=!1;break;case 37:n.push(u),i=!0;break;case 38:n.pop(),i=!1;break;case 16:break;default:if(!c.T){if(!i||e.WTF&&n[n.length-1]!=37&&n[n.length-1]!=35)throw new Error("Unexpected record 0x"+u.toString(16))}}},e),OP(r),r.Names=s,r.supbooks=o,r}function EU(t,e,r){return e.slice(-4)===".bin"?bU(t,r):vU(t,r)}function RU(t,e,r,n,i,s,o,a){return e.slice(-4)===".bin"?oU(t,n,r,i,s,o,a):CW(t,n,r,i,s,o,a)}function TU(t,e,r,n,i,s,o,a){return e.slice(-4)===".bin"?hU(t,n,r,i,s):cU(t,n,r,i,s)}function _U(t,e,r,n,i,s,o,a){return e.slice(-4)===".bin"?N3():H3()}function AU(t,e,r,n,i,s,o,a){return e.slice(-4)===".bin"?D3():k3()}function MU(t,e,r,n){return e.slice(-4)===".bin"?q4(t,r,n):Y4(t,r,n)}function IU(t,e,r){return wP(t,r)}function OU(t,e,r){return e.slice(-4)===".bin"?d4(t,r):u4(t,r)}function PU(t,e,r){return e.slice(-4)===".bin"?I3(t,r):R3(t,r)}function DU(t,e,r){return e.slice(-4)===".bin"?y3(t):S3(t)}function kU(t,e,r,n){return r.slice(-4)===".bin"?b3(t,e,r,n):void 0}function NU(t,e,r){return e.slice(-4)===".bin"?v3(t,e,r):C3(t,e,r)}var PP=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g,DP=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/;function Xi(t,e){var r=t.split(/\s+/),n=[];if(n[0]=r[0],r.length===1)return n;var i=t.match(PP),s,o,a,l;if(i)for(l=0;l!=i.length;++l)s=i[l].match(DP),(o=s[1].indexOf(":"))===-1?n[s[1]]=s[2].slice(1,s[2].length-1):(s[1].slice(0,6)==="xmlns:"?a="xmlns"+s[1].slice(6):a=s[1].slice(o+1),n[a]=s[2].slice(1,s[2].length-1));return n}function HU(t){var e=t.split(/\s+/),r={};if(e.length===1)return r;var n=t.match(PP),i,s,o,a;if(n)for(a=0;a!=n.length;++a)i=n[a].match(DP),(s=i[1].indexOf(":"))===-1?r[i[1]]=i[2].slice(1,i[2].length-1):(i[1].slice(0,6)==="xmlns:"?o="xmlns"+i[1].slice(6):o=i[1].slice(s+1),r[o]=i[2].slice(1,i[2].length-1));return r}var Xd;function FU(t,e){var r=Xd[t]||At(t);return r==="General"?wc(e):Ui(r,e)}function LU(t,e,r,n){var i=n;switch((r[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]){case"boolean":i=ar(n);break;case"i2":case"int":i=parseInt(n,10);break;case"r4":case"float":i=parseFloat(n);break;case"date":case"dateTime.tz":i=Jr(n);break;case"i8":case"string":case"fixed":case"uuid":case"bin.base64":break;default:throw new Error("bad custprop:"+r[0])}t[At(e)]=i}function $U(t,e,r){if(t.t!=="z"){if(!r||r.cellText!==!1)try{t.t==="e"?t.w=t.w||kc[t.v]:e==="General"?t.t==="n"?(t.v|0)===t.v?t.w=t.v.toString(10):t.w=xf(t.v):t.w=wc(t.v):t.w=FU(e||"General",t.v)}catch(s){if(r.WTF)throw s}try{var n=Xd[e]||e||"General";if(r.cellNF&&(t.z=n),r.cellDates&&t.t=="n"&&uh(n)){var i=oc(t.v);i&&(t.t="d",t.v=new Date(i.y,i.m-1,i.d,i.H,i.M,i.S,i.u))}}catch(s){if(r.WTF)throw s}}}function BU(t,e,r){if(r.cellStyles&&e.Interior){var n=e.Interior;n.Pattern&&(n.patternType=L4[n.Pattern]||n.Pattern)}t[e.ID]=e}function VU(t,e,r,n,i,s,o,a,l,c){var u="General",h=n.StyleID,d={};c=c||{};var f=[],g=0;for(h===void 0&&a&&(h=a.StyleID),h===void 0&&o&&(h=o.StyleID);s[h]!==void 0&&(s[h].nf&&(u=s[h].nf),s[h].Interior&&f.push(s[h].Interior),!!s[h].Parent);)h=s[h].Parent;switch(r.Type){case"Boolean":n.t="b",n.v=ar(t);break;case"String":n.t="s",n.r=HR(At(t)),n.v=t.indexOf("<")>-1?At(e||t).replace(/<.*?>/g,""):n.r;break;case"DateTime":t.slice(-1)!="Z"&&(t+="Z"),n.v=(Jr(t)-new Date(Date.UTC(1899,11,30)))/(24*60*60*1e3),n.v!==n.v?n.v=At(t):n.v<60&&(n.v=n.v-1),(!u||u=="General")&&(u="yyyy-mm-dd");case"Number":n.v===void 0&&(n.v=+t),n.t||(n.t="n");break;case"Error":n.t="e",n.v=XO[t],c.cellText!==!1&&(n.w=t);break;default:t==""&&e==""?n.t="z":(n.t="s",n.v=HR(e||t));break}if($U(n,u,c),c.cellFormula!==!1)if(n.Formula){var m=At(n.Formula);m.charCodeAt(0)==61&&(m=m.slice(1)),n.f=Gu(m,i),delete n.Formula,n.ArrayRange=="RC"?n.F=Gu("RC:RC",i):n.ArrayRange&&(n.F=Gu(n.ArrayRange,i),l.push([br(n.F),n.F]))}else for(g=0;g<l.length;++g)i.r>=l[g][0].s.r&&i.r<=l[g][0].e.r&&i.c>=l[g][0].s.c&&i.c<=l[g][0].e.c&&(n.F=l[g][1]);c.cellStyles&&(f.forEach(function(p){!d.patternType&&p.patternType&&(d.patternType=p.patternType)}),n.s=d),n.StyleID!==void 0&&(n.ixfe=n.StyleID)}function WU(t){t.t=t.v||"",t.t=t.t.replace(/\r\n/g,`
  33. `).replace(/\r/g,`
  34. `),t.v=t.w=t.ixfe=void 0}function dv(t,e){var r=e||{};xO();var n=Pd(wx(t));(r.type=="binary"||r.type=="array"||r.type=="base64")&&(n=Jt(n));var i=n.slice(0,1024).toLowerCase(),s=!1;if(i=i.replace(/".*?"/g,""),(i.indexOf(">")&1023)>Math.min(i.indexOf(",")&1023,i.indexOf(";")&1023)){var o=sn(r);return o.type="string",Ef.to_workbook(n,o)}if(i.indexOf("<?xml")==-1&&["html","table","head","meta","script","style","div"].forEach(function(Ye){i.indexOf("<"+Ye)>=0&&(s=!0)}),s)return ZU(n,r);Xd={"General Number":"General","General Date":ot[22],"Long Date":"dddd, mmmm dd, yyyy","Medium Date":ot[15],"Short Date":ot[14],"Long Time":ot[19],"Medium Time":ot[18],"Short Time":ot[20],Currency:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',Fixed:ot[2],Standard:ot[4],Percent:ot[10],Scientific:ot[11],"Yes/No":'"Yes";"Yes";"No";@',"True/False":'"True";"True";"False";@',"On/Off":'"Yes";"Yes";"No";@'};var a,l=[],c,u={},h=[],d=r.dense?[]:{},f="",g={},m={},p=Xi('<Data ss:Type="String">'),S=0,y=0,C=0,E={s:{r:2e6,c:2e6},e:{r:0,c:0}},A={},O={},T="",W=0,I=[],Y={},z={},U=0,oe=[],Ce=[],pe={},Te=[],Se,Ae=!1,q=[],Oe=[],v={},w=0,x=0,R={Sheets:[],WBProps:{date1904:!1}},b={};bf.lastIndex=0,n=n.replace(/<!--([\s\S]*?)-->/mg,"");for(var B="";a=bf.exec(n);)switch(a[3]=(B=a[3]).toLowerCase()){case"data":if(B=="data"){if(a[1]==="/"){if((c=l.pop())[0]!==a[3])throw new Error("Bad state: "+c.join("|"))}else a[0].charAt(a[0].length-2)!=="/"&&l.push([a[3],!0]);break}if(l[l.length-1][1])break;a[1]==="/"?VU(n.slice(S,a.index),T,p,l[l.length-1][0]=="comment"?pe:g,{c:y,r:C},A,Te[y],m,q,r):(T="",p=Xi(a[0]),S=a.index+a[0].length);break;case"cell":if(a[1]==="/")if(Ce.length>0&&(g.c=Ce),(!r.sheetRows||r.sheetRows>C)&&g.v!==void 0&&(r.dense?(d[C]||(d[C]=[]),d[C][y]=g):d[Br(y)+on(C)]=g),g.HRef&&(g.l={Target:At(g.HRef)},g.HRefScreenTip&&(g.l.Tooltip=g.HRefScreenTip),delete g.HRef,delete g.HRefScreenTip),(g.MergeAcross||g.MergeDown)&&(w=y+(parseInt(g.MergeAcross,10)|0),x=C+(parseInt(g.MergeDown,10)|0),I.push({s:{c:y,r:C},e:{c:w,r:x}})),!r.sheetStubs)g.MergeAcross?y=w+1:++y;else if(g.MergeAcross||g.MergeDown){for(var X=y;X<=w;++X)for(var ne=C;ne<=x;++ne)(X>y||ne>C)&&(r.dense?(d[ne]||(d[ne]=[]),d[ne][X]={t:"z"}):d[Br(X)+on(ne)]={t:"z"});y=w+1}else++y;else g=HU(a[0]),g.Index&&(y=+g.Index-1),y<E.s.c&&(E.s.c=y),y>E.e.c&&(E.e.c=y),a[0].slice(-2)==="/>"&&++y,Ce=[];break;case"row":a[1]==="/"||a[0].slice(-2)==="/>"?(C<E.s.r&&(E.s.r=C),C>E.e.r&&(E.e.r=C),a[0].slice(-2)==="/>"&&(m=Xi(a[0]),m.Index&&(C=+m.Index-1)),y=0,++C):(m=Xi(a[0]),m.Index&&(C=+m.Index-1),v={},(m.AutoFitHeight=="0"||m.Height)&&(v.hpx=parseInt(m.Height,10),v.hpt=pP(v.hpx),Oe[C]=v),m.Hidden=="1"&&(v.hidden=!0,Oe[C]=v));break;case"worksheet":if(a[1]==="/"){if((c=l.pop())[0]!==a[3])throw new Error("Bad state: "+c.join("|"));h.push(f),E.s.r<=E.e.r&&E.s.c<=E.e.c&&(d["!ref"]=Rt(E),r.sheetRows&&r.sheetRows<=E.e.r&&(d["!fullref"]=d["!ref"],E.e.r=r.sheetRows-1,d["!ref"]=Rt(E))),I.length&&(d["!merges"]=I),Te.length>0&&(d["!cols"]=Te),Oe.length>0&&(d["!rows"]=Oe),u[f]=d}else E={s:{r:2e6,c:2e6},e:{r:0,c:0}},C=y=0,l.push([a[3],!1]),c=Xi(a[0]),f=At(c.Name),d=r.dense?[]:{},I=[],q=[],Oe=[],b={name:f,Hidden:0},R.Sheets.push(b);break;case"table":if(a[1]==="/"){if((c=l.pop())[0]!==a[3])throw new Error("Bad state: "+c.join("|"))}else{if(a[0].slice(-2)=="/>")break;l.push([a[3],!1]),Te=[],Ae=!1}break;case"style":a[1]==="/"?BU(A,O,r):O=Xi(a[0]);break;case"numberformat":O.nf=At(Xi(a[0]).Format||"General"),Xd[O.nf]&&(O.nf=Xd[O.nf]);for(var fe=0;fe!=392&&ot[fe]!=O.nf;++fe);if(fe==392){for(fe=57;fe!=392;++fe)if(ot[fe]==null){fc(O.nf,fe);break}}break;case"column":if(l[l.length-1][0]!=="table")break;if(Se=Xi(a[0]),Se.Hidden&&(Se.hidden=!0,delete Se.Hidden),Se.Width&&(Se.wpx=parseInt(Se.Width,10)),!Ae&&Se.wpx>10){Ae=!0,Nn=gP;for(var le=0;le<Te.length;++le)Te[le]&&ih(Te[le])}Ae&&ih(Se),Te[Se.Index-1||Te.length]=Se;for(var we=0;we<+Se.Span;++we)Te[Te.length]=sn(Se);break;case"namedrange":if(a[1]==="/")break;R.Names||(R.Names=[]);var N=Qe(a[0]),Fe={Name:N.Name,Ref:Gu(N.RefersTo.slice(1),{r:0,c:0})};R.Sheets.length>0&&(Fe.Sheet=R.Sheets.length-1),R.Names.push(Fe);break;case"namedcell":break;case"b":break;case"i":break;case"u":break;case"s":break;case"em":break;case"h2":break;case"h3":break;case"sub":break;case"sup":break;case"span":break;case"alignment":break;case"borders":break;case"border":break;case"font":if(a[0].slice(-2)==="/>")break;a[1]==="/"?T+=n.slice(W,a.index):W=a.index+a[0].length;break;case"interior":if(!r.cellStyles)break;O.Interior=Xi(a[0]);break;case"protection":break;case"author":case"title":case"description":case"created":case"keywords":case"subject":case"category":case"company":case"lastauthor":case"lastsaved":case"lastprinted":case"version":case"revision":case"totaltime":case"hyperlinkbase":case"manager":case"contentstatus":case"identifier":case"language":case"appname":if(a[0].slice(-2)==="/>")break;a[1]==="/"?R$(Y,B,n.slice(U,a.index)):U=a.index+a[0].length;break;case"paragraphs":break;case"styles":case"workbook":if(a[1]==="/"){if((c=l.pop())[0]!==a[3])throw new Error("Bad state: "+c.join("|"))}else l.push([a[3],!1]);break;case"comment":if(a[1]==="/"){if((c=l.pop())[0]!==a[3])throw new Error("Bad state: "+c.join("|"));WU(pe),Ce.push(pe)}else l.push([a[3],!1]),c=Xi(a[0]),pe={a:c.Author};break;case"autofilter":if(a[1]==="/"){if((c=l.pop())[0]!==a[3])throw new Error("Bad state: "+c.join("|"))}else if(a[0].charAt(a[0].length-2)!=="/"){var ie=Xi(a[0]);d["!autofilter"]={ref:Gu(ie.Range).replace(/\$/g,"")},l.push([a[3],!0])}break;case"name":break;case"datavalidation":if(a[1]==="/"){if((c=l.pop())[0]!==a[3])throw new Error("Bad state: "+c.join("|"))}else a[0].charAt(a[0].length-2)!=="/"&&l.push([a[3],!0]);break;case"pixelsperinch":break;case"componentoptions":case"documentproperties":case"customdocumentproperties":case"officedocumentsettings":case"pivottable":case"pivotcache":case"names":case"mapinfo":case"pagebreaks":case"querytable":case"sorting":case"schema":case"conditionalformatting":case"smarttagtype":case"smarttags":case"excelworkbook":case"workbookoptions":case"worksheetoptions":if(a[1]==="/"){if((c=l.pop())[0]!==a[3])throw new Error("Bad state: "+c.join("|"))}else a[0].charAt(a[0].length-2)!=="/"&&l.push([a[3],!0]);break;case"null":break;default:if(l.length==0&&a[3]=="document"||l.length==0&&a[3]=="uof")return ST(n,r);var Be=!0;switch(l[l.length-1][0]){case"officedocumentsettings":switch(a[3]){case"allowpng":break;case"removepersonalinformation":break;case"downloadcomponents":break;case"locationofcomponents":break;case"colors":break;case"color":break;case"index":break;case"rgb":break;case"targetscreensize":break;case"readonlyrecommended":break;default:Be=!1}break;case"componentoptions":switch(a[3]){case"toolbar":break;case"hideofficelogo":break;case"spreadsheetautofit":break;case"label":break;case"caption":break;case"maxheight":break;case"maxwidth":break;case"nextsheetnumber":break;default:Be=!1}break;case"excelworkbook":switch(a[3]){case"date1904":R.WBProps.date1904=!0;break;case"windowheight":break;case"windowwidth":break;case"windowtopx":break;case"windowtopy":break;case"tabratio":break;case"protectstructure":break;case"protectwindow":break;case"protectwindows":break;case"activesheet":break;case"displayinknotes":break;case"firstvisiblesheet":break;case"supbook":break;case"sheetname":break;case"sheetindex":break;case"sheetindexfirst":break;case"sheetindexlast":break;case"dll":break;case"acceptlabelsinformulas":break;case"donotsavelinkvalues":break;case"iteration":break;case"maxiterations":break;case"maxchange":break;case"path":break;case"xct":break;case"count":break;case"selectedsheets":break;case"calculation":break;case"uncalced":break;case"startupprompt":break;case"crn":break;case"externname":break;case"formula":break;case"colfirst":break;case"collast":break;case"wantadvise":break;case"boolean":break;case"error":break;case"text":break;case"ole":break;case"noautorecover":break;case"publishobjects":break;case"donotcalculatebeforesave":break;case"number":break;case"refmoder1c1":break;case"embedsavesmarttags":break;default:Be=!1}break;case"workbookoptions":switch(a[3]){case"owcversion":break;case"height":break;case"width":break;default:Be=!1}break;case"worksheetoptions":switch(a[3]){case"visible":if(a[0].slice(-2)!=="/>")if(a[1]==="/")switch(n.slice(U,a.index)){case"SheetHidden":b.Hidden=1;break;case"SheetVeryHidden":b.Hidden=2;break}else U=a.index+a[0].length;break;case"header":d["!margins"]||Kd(d["!margins"]={},"xlml"),isNaN(+Qe(a[0]).Margin)||(d["!margins"].header=+Qe(a[0]).Margin);break;case"footer":d["!margins"]||Kd(d["!margins"]={},"xlml"),isNaN(+Qe(a[0]).Margin)||(d["!margins"].footer=+Qe(a[0]).Margin);break;case"pagemargins":var Ie=Qe(a[0]);d["!margins"]||Kd(d["!margins"]={},"xlml"),isNaN(+Ie.Top)||(d["!margins"].top=+Ie.Top),isNaN(+Ie.Left)||(d["!margins"].left=+Ie.Left),isNaN(+Ie.Right)||(d["!margins"].right=+Ie.Right),isNaN(+Ie.Bottom)||(d["!margins"].bottom=+Ie.Bottom);break;case"displayrighttoleft":R.Views||(R.Views=[]),R.Views[0]||(R.Views[0]={}),R.Views[0].RTL=!0;break;case"freezepanes":break;case"frozennosplit":break;case"splithorizontal":case"splitvertical":break;case"donotdisplaygridlines":break;case"activerow":break;case"activecol":break;case"toprowbottompane":break;case"leftcolumnrightpane":break;case"unsynced":break;case"print":break;case"printerrors":break;case"panes":break;case"scale":break;case"pane":break;case"number":break;case"layout":break;case"pagesetup":break;case"selected":break;case"protectobjects":break;case"enableselection":break;case"protectscenarios":break;case"validprinterinfo":break;case"horizontalresolution":break;case"verticalresolution":break;case"numberofcopies":break;case"activepane":break;case"toprowvisible":break;case"leftcolumnvisible":break;case"fittopage":break;case"rangeselection":break;case"papersizeindex":break;case"pagelayoutzoom":break;case"pagebreakzoom":break;case"filteron":break;case"fitwidth":break;case"fitheight":break;case"commentslayout":break;case"zoom":break;case"lefttoright":break;case"gridlines":break;case"allowsort":break;case"allowfilter":break;case"allowinsertrows":break;case"allowdeleterows":break;case"allowinsertcols":break;case"allowdeletecols":break;case"allowinserthyperlinks":break;case"allowformatcells":break;case"allowsizecols":break;case"allowsizerows":break;case"nosummaryrowsbelowdetail":d["!outline"]||(d["!outline"]={}),d["!outline"].above=!0;break;case"tabcolorindex":break;case"donotdisplayheadings":break;case"showpagelayoutzoom":break;case"nosummarycolumnsrightdetail":d["!outline"]||(d["!outline"]={}),d["!outline"].left=!0;break;case"blackandwhite":break;case"donotdisplayzeros":break;case"displaypagebreak":break;case"rowcolheadings":break;case"donotdisplayoutline":break;case"noorientation":break;case"allowusepivottables":break;case"zeroheight":break;case"viewablerange":break;case"selection":break;case"protectcontents":break;default:Be=!1}break;case"pivottable":case"pivotcache":switch(a[3]){case"immediateitemsondrop":break;case"showpagemultipleitemlabel":break;case"compactrowindent":break;case"location":break;case"pivotfield":break;case"orientation":break;case"layoutform":break;case"layoutsubtotallocation":break;case"layoutcompactrow":break;case"position":break;case"pivotitem":break;case"datatype":break;case"datafield":break;case"sourcename":break;case"parentfield":break;case"ptlineitems":break;case"ptlineitem":break;case"countofsameitems":break;case"item":break;case"itemtype":break;case"ptsource":break;case"cacheindex":break;case"consolidationreference":break;case"filename":break;case"reference":break;case"nocolumngrand":break;case"norowgrand":break;case"blanklineafteritems":break;case"hidden":break;case"subtotal":break;case"basefield":break;case"mapchilditems":break;case"function":break;case"refreshonfileopen":break;case"printsettitles":break;case"mergelabels":break;case"defaultversion":break;case"refreshname":break;case"refreshdate":break;case"refreshdatecopy":break;case"versionlastrefresh":break;case"versionlastupdate":break;case"versionupdateablemin":break;case"versionrefreshablemin":break;case"calculation":break;default:Be=!1}break;case"pagebreaks":switch(a[3]){case"colbreaks":break;case"colbreak":break;case"rowbreaks":break;case"rowbreak":break;case"colstart":break;case"colend":break;case"rowend":break;default:Be=!1}break;case"autofilter":switch(a[3]){case"autofiltercolumn":break;case"autofiltercondition":break;case"autofilterand":break;case"autofilteror":break;default:Be=!1}break;case"querytable":switch(a[3]){case"id":break;case"autoformatfont":break;case"autoformatpattern":break;case"querysource":break;case"querytype":break;case"enableredirections":break;case"refreshedinxl9":break;case"urlstring":break;case"htmltables":break;case"connection":break;case"commandtext":break;case"refreshinfo":break;case"notitles":break;case"nextid":break;case"columninfo":break;case"overwritecells":break;case"donotpromptforfile":break;case"textwizardsettings":break;case"source":break;case"number":break;case"decimal":break;case"thousandseparator":break;case"trailingminusnumbers":break;case"formatsettings":break;case"fieldtype":break;case"delimiters":break;case"tab":break;case"comma":break;case"autoformatname":break;case"versionlastedit":break;case"versionlastrefresh":break;default:Be=!1}break;case"datavalidation":switch(a[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;case"cellrangelist":break;default:Be=!1}break;case"sorting":case"conditionalformatting":switch(a[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"cellrangelist":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;default:Be=!1}break;case"mapinfo":case"schema":case"data":switch(a[3]){case"map":break;case"entry":break;case"range":break;case"xpath":break;case"field":break;case"xsdtype":break;case"filteron":break;case"aggregate":break;case"elementtype":break;case"attributetype":break;case"schema":case"element":case"complextype":case"datatype":case"all":case"attribute":case"extends":break;case"row":break;default:Be=!1}break;case"smarttags":break;default:Be=!1;break}if(Be||a[3].match(/!\[CDATA/))break;if(!l[l.length-1][1])throw"Unrecognized tag: "+a[3]+"|"+l.join("|");if(l[l.length-1][0]==="customdocumentproperties"){if(a[0].slice(-2)==="/>")break;a[1]==="/"?LU(z,B,oe,n.slice(U,a.index)):(oe=a,U=a.index+a[0].length);break}if(r.WTF)throw"Unrecognized tag: "+a[3]+"|"+l.join("|")}var xe={};return!r.bookSheets&&!r.bookProps&&(xe.Sheets=u),xe.SheetNames=h,xe.Workbook=R,xe.SSF=sn(ot),xe.Props=Y,xe.Custprops=z,xe}function j1(t,e){switch(Px(e=e||{}),e.type||"base64"){case"base64":return dv(Ci(t),e);case"binary":case"buffer":case"file":return dv(t,e);case"array":return dv(Oc(t),e)}}function UU(t){var e={},r=t.content;if(r.l=28,e.AnsiUserType=r.read_shift(0,"lpstr-ansi"),e.AnsiClipboardFormat=n$(r),r.length-r.l<=4)return e;var n=r.read_shift(4);if(n==0||n>40||(r.l-=4,e.Reserved1=r.read_shift(0,"lpstr-ansi"),r.length-r.l<=4)||(n=r.read_shift(4),n!==1907505652)||(e.UnicodeClipboardFormat=i$(r),n=r.read_shift(4),n==0||n>40))return e;r.l-=4,e.Reserved2=r.read_shift(0,"lpwstr")}var YU=[60,1084,2066,2165,2175];function zU(t,e,r,n,i){var s=n,o=[],a=r.slice(r.l,r.l+s);if(i&&i.enc&&i.enc.insitu&&a.length>0)switch(t){case 9:case 521:case 1033:case 2057:case 47:case 405:case 225:case 406:case 312:case 404:case 10:break;case 133:break;default:i.enc.insitu(a)}o.push(a),r.l+=s;for(var l=jo(r,r.l),c=K1[l],u=0;c!=null&&YU.indexOf(l)>-1;)s=jo(r,r.l+2),u=r.l+4,l==2066?u+=4:(l==2165||l==2175)&&(u+=12),a=r.slice(u,r.l+4+s),o.push(a),r.l+=4+s,c=K1[l=jo(r,r.l)];var h=Ya(o);nn(h,0);var d=0;h.lens=[];for(var f=0;f<o.length;++f)h.lens.push(d),d+=o[f].length;if(h.length<n)throw"XLS Record 0x"+t.toString(16)+" Truncated: "+h.length+" < "+n;return e.f(h,h.length,i)}function ks(t,e,r){if(t.t!=="z"&&t.XF){var n=0;try{n=t.z||t.XF.numFmtId||0,e.cellNF&&(t.z=ot[n])}catch(s){if(e.WTF)throw s}if(!e||e.cellText!==!1)try{t.t==="e"?t.w=t.w||kc[t.v]:n===0||n=="General"?t.t==="n"?(t.v|0)===t.v?t.w=t.v.toString(10):t.w=xf(t.v):t.w=wc(t.v):t.w=Ui(n,t.v,{date1904:!!r,dateNF:e&&e.dateNF})}catch(s){if(e.WTF)throw s}if(e.cellDates&&n&&t.t=="n"&&uh(ot[n]||String(n))){var i=oc(t.v);i&&(t.t="d",t.v=new Date(i.y,i.m-1,i.d,i.H,i.M,i.S,i.u))}}}function Yg(t,e,r){return{v:t,ixfe:e,t:r}}function GU(t,e){var r={opts:{}},n={},i=e.dense?[]:{},s={},o={},a=null,l=[],c="",u={},h,d="",f,g,m,p,S={},y=[],C,E,A=[],O=[],T={Sheets:[],WBProps:{date1904:!1},Views:[{}]},W={},I=function(Q){return Q<8?gc[Q]:Q<64&&O[Q-8]||gc[Q]},Y=function(Q,ye,Me){var Pe=ye.XF.data;if(!(!Pe||!Pe.patternType||!Me||!Me.cellStyles)){ye.s={},ye.s.patternType=Pe.patternType;var Je;(Je=Rf(I(Pe.icvFore)))&&(ye.s.fgColor={rgb:Je}),(Je=Rf(I(Pe.icvBack)))&&(ye.s.bgColor={rgb:Je})}},z=function(Q,ye,Me){if(!(v>1)&&!(Me.sheetRows&&Q.r>=Me.sheetRows)){if(Me.cellStyles&&ye.XF&&ye.XF.data&&Y(Q,ye,Me),delete ye.ixfe,delete ye.XF,h=Q,d=nt(Q),(!o||!o.s||!o.e)&&(o={s:{r:0,c:0},e:{r:0,c:0}}),Q.r<o.s.r&&(o.s.r=Q.r),Q.c<o.s.c&&(o.s.c=Q.c),Q.r+1>o.e.r&&(o.e.r=Q.r+1),Q.c+1>o.e.c&&(o.e.c=Q.c+1),Me.cellFormula&&ye.f){for(var Pe=0;Pe<y.length;++Pe)if(!(y[Pe][0].s.c>Q.c||y[Pe][0].s.r>Q.r)&&!(y[Pe][0].e.c<Q.c||y[Pe][0].e.r<Q.r)){ye.F=Rt(y[Pe][0]),(y[Pe][0].s.c!=Q.c||y[Pe][0].s.r!=Q.r)&&delete ye.f,ye.f&&(ye.f=""+gn(y[Pe][1],o,Q,q,U));break}}Me.dense?(i[Q.r]||(i[Q.r]=[]),i[Q.r][Q.c]=ye):i[d]=ye}},U={enc:!1,sbcch:0,snames:[],sharedf:S,arrayf:y,rrtabid:[],lastuser:"",biff:8,codepage:0,winlocked:0,cellStyles:!!e&&!!e.cellStyles,WTF:!!e&&!!e.wtf};e.password&&(U.password=e.password);var oe,Ce=[],pe=[],Te=[],Se=[],Ae=!1,q=[];q.SheetNames=U.snames,q.sharedf=U.sharedf,q.arrayf=U.arrayf,q.names=[],q.XTI=[];var Oe=0,v=0,w=0,x=[],R=[],b;U.codepage=1200,ws(1200);for(var B=!1;t.l<t.length-1;){var X=t.l,ne=t.read_shift(2);if(ne===0&&Oe===10)break;var fe=t.l===t.length?0:t.read_shift(2),le=K1[ne];if(le&&le.f){if(e.bookSheets&&Oe===133&&ne!==133)break;if(Oe=ne,le.r===2||le.r==12){var we=t.read_shift(2);if(fe-=2,!U.enc&&we!==ne&&((we&255)<<8|we>>8)!==ne)throw new Error("rt mismatch: "+we+"!="+ne);le.r==12&&(t.l+=10,fe-=10)}var N={};if(ne===10?N=le.f(t,fe,U):N=zU(ne,le,t,fe,U),v==0&&[9,521,1033,2057].indexOf(Oe)===-1)continue;switch(ne){case 34:r.opts.Date1904=T.WBProps.date1904=N;break;case 134:r.opts.WriteProtect=!0;break;case 47:if(U.enc||(t.l=0),U.enc=N,!e.password)throw new Error("File is password-protected");if(N.valid==null)throw new Error("Encryption scheme unsupported");if(!N.valid)throw new Error("Password is incorrect");break;case 92:U.lastuser=N;break;case 66:var Fe=Number(N);switch(Fe){case 21010:Fe=1200;break;case 32768:Fe=1e4;break;case 32769:Fe=1252;break}ws(U.codepage=Fe),B=!0;break;case 317:U.rrtabid=N;break;case 25:U.winlocked=N;break;case 439:r.opts.RefreshAll=N;break;case 12:r.opts.CalcCount=N;break;case 16:r.opts.CalcDelta=N;break;case 17:r.opts.CalcIter=N;break;case 13:r.opts.CalcMode=N;break;case 14:r.opts.CalcPrecision=N;break;case 95:r.opts.CalcSaveRecalc=N;break;case 15:U.CalcRefMode=N;break;case 2211:r.opts.FullCalc=N;break;case 129:N.fDialog&&(i["!type"]="dialog"),N.fBelow||((i["!outline"]||(i["!outline"]={})).above=!0),N.fRight||((i["!outline"]||(i["!outline"]={})).left=!0);break;case 224:A.push(N);break;case 430:q.push([N]),q[q.length-1].XTI=[];break;case 35:case 547:q[q.length-1].push(N);break;case 24:case 536:b={Name:N.Name,Ref:gn(N.rgce,o,null,q,U)},N.itab>0&&(b.Sheet=N.itab-1),q.names.push(b),q[0]||(q[0]=[],q[0].XTI=[]),q[q.length-1].push(N),N.Name=="_xlnm._FilterDatabase"&&N.itab>0&&N.rgce&&N.rgce[0]&&N.rgce[0][0]&&N.rgce[0][0][0]=="PtgArea3d"&&(R[N.itab-1]={ref:Rt(N.rgce[0][0][1][2])});break;case 22:U.ExternCount=N;break;case 23:q.length==0&&(q[0]=[],q[0].XTI=[]),q[q.length-1].XTI=q[q.length-1].XTI.concat(N),q.XTI=q.XTI.concat(N);break;case 2196:if(U.biff<8)break;b!=null&&(b.Comment=N[1]);break;case 18:i["!protect"]=N;break;case 19:N!==0&&U.WTF&&console.error("Password verifier: "+N);break;case 133:s[N.pos]=N,U.snames.push(N.name);break;case 10:{if(--v)break;if(o.e){if(o.e.r>0&&o.e.c>0){if(o.e.r--,o.e.c--,i["!ref"]=Rt(o),e.sheetRows&&e.sheetRows<=o.e.r){var ie=o.e.r;o.e.r=e.sheetRows-1,i["!fullref"]=i["!ref"],i["!ref"]=Rt(o),o.e.r=ie}o.e.r++,o.e.c++}Ce.length>0&&(i["!merges"]=Ce),pe.length>0&&(i["!objects"]=pe),Te.length>0&&(i["!cols"]=Te),Se.length>0&&(i["!rows"]=Se),T.Sheets.push(W)}c===""?u=i:n[c]=i,i=e.dense?[]:{}}break;case 9:case 521:case 1033:case 2057:{if(U.biff===8&&(U.biff={9:2,521:3,1033:4}[ne]||{512:2,768:3,1024:4,1280:5,1536:8,2:2,7:2}[N.BIFFVer]||8),U.biffguess=N.BIFFVer==0,N.BIFFVer==0&&N.dt==4096&&(U.biff=5,B=!0,ws(U.codepage=28591)),U.biff==8&&N.BIFFVer==0&&N.dt==16&&(U.biff=2),v++)break;if(i=e.dense?[]:{},U.biff<8&&!B&&(B=!0,ws(U.codepage=e.codepage||1252)),U.biff<5||N.BIFFVer==0&&N.dt==4096){c===""&&(c="Sheet1"),o={s:{r:0,c:0},e:{r:0,c:0}};var Be={pos:t.l-fe,name:c};s[Be.pos]=Be,U.snames.push(c)}else c=(s[X]||{name:""}).name;N.dt==32&&(i["!type"]="chart"),N.dt==64&&(i["!type"]="macro"),Ce=[],pe=[],U.arrayf=y=[],Te=[],Se=[],Ae=!1,W={Hidden:(s[X]||{hs:0}).hs,name:c}}break;case 515:case 3:case 2:i["!type"]=="chart"&&(e.dense?(i[N.r]||[])[N.c]:i[nt({c:N.c,r:N.r})])&&++N.c,C={ixfe:N.ixfe,XF:A[N.ixfe]||{},v:N.val,t:"n"},w>0&&(C.z=x[C.ixfe>>8&63]),ks(C,e,r.opts.Date1904),z({c:N.c,r:N.r},C,e);break;case 5:case 517:C={ixfe:N.ixfe,XF:A[N.ixfe],v:N.val,t:N.t},w>0&&(C.z=x[C.ixfe>>8&63]),ks(C,e,r.opts.Date1904),z({c:N.c,r:N.r},C,e);break;case 638:C={ixfe:N.ixfe,XF:A[N.ixfe],v:N.rknum,t:"n"},w>0&&(C.z=x[C.ixfe>>8&63]),ks(C,e,r.opts.Date1904),z({c:N.c,r:N.r},C,e);break;case 189:for(var Ie=N.c;Ie<=N.C;++Ie){var xe=N.rkrec[Ie-N.c][0];C={ixfe:xe,XF:A[xe],v:N.rkrec[Ie-N.c][1],t:"n"},w>0&&(C.z=x[C.ixfe>>8&63]),ks(C,e,r.opts.Date1904),z({c:Ie,r:N.r},C,e)}break;case 6:case 518:case 1030:{if(N.val=="String"){a=N;break}if(C=Yg(N.val,N.cell.ixfe,N.tt),C.XF=A[C.ixfe],e.cellFormula){var Ye=N.formula;if(Ye&&Ye[0]&&Ye[0][0]&&Ye[0][0][0]=="PtgExp"){var Ve=Ye[0][0][1][0],M=Ye[0][0][1][1],D=nt({r:Ve,c:M});S[D]?C.f=""+gn(N.formula,o,N.cell,q,U):C.F=((e.dense?(i[Ve]||[])[M]:i[D])||{}).F}else C.f=""+gn(N.formula,o,N.cell,q,U)}w>0&&(C.z=x[C.ixfe>>8&63]),ks(C,e,r.opts.Date1904),z(N.cell,C,e),a=N}break;case 7:case 519:if(a)a.val=N,C=Yg(N,a.cell.ixfe,"s"),C.XF=A[C.ixfe],e.cellFormula&&(C.f=""+gn(a.formula,o,a.cell,q,U)),w>0&&(C.z=x[C.ixfe>>8&63]),ks(C,e,r.opts.Date1904),z(a.cell,C,e),a=null;else throw new Error("String record expects Formula");break;case 33:case 545:{y.push(N);var G=nt(N[0].s);if(f=e.dense?(i[N[0].s.r]||[])[N[0].s.c]:i[G],e.cellFormula&&f){if(!a||!G||!f)break;f.f=""+gn(N[1],o,N[0],q,U),f.F=Rt(N[0])}}break;case 1212:{if(!e.cellFormula)break;if(d){if(!a)break;S[nt(a.cell)]=N[0],f=e.dense?(i[a.cell.r]||[])[a.cell.c]:i[nt(a.cell)],(f||{}).f=""+gn(N[0],o,h,q,U)}}break;case 253:C=Yg(l[N.isst].t,N.ixfe,"s"),l[N.isst].h&&(C.h=l[N.isst].h),C.XF=A[C.ixfe],w>0&&(C.z=x[C.ixfe>>8&63]),ks(C,e,r.opts.Date1904),z({c:N.c,r:N.r},C,e);break;case 513:e.sheetStubs&&(C={ixfe:N.ixfe,XF:A[N.ixfe],t:"z"},w>0&&(C.z=x[C.ixfe>>8&63]),ks(C,e,r.opts.Date1904),z({c:N.c,r:N.r},C,e));break;case 190:if(e.sheetStubs)for(var re=N.c;re<=N.C;++re){var K=N.ixfe[re-N.c];C={ixfe:K,XF:A[K],t:"z"},w>0&&(C.z=x[C.ixfe>>8&63]),ks(C,e,r.opts.Date1904),z({c:re,r:N.r},C,e)}break;case 214:case 516:case 4:C=Yg(N.val,N.ixfe,"s"),C.XF=A[C.ixfe],w>0&&(C.z=x[C.ixfe>>8&63]),ks(C,e,r.opts.Date1904),z({c:N.c,r:N.r},C,e);break;case 0:case 512:v===1&&(o=N);break;case 252:l=N;break;case 1054:if(U.biff==4){x[w++]=N[1];for(var se=0;se<w+163&&ot[se]!=N[1];++se);se>=163&&fc(N[1],w+163)}else fc(N[1],N[0]);break;case 30:{x[w++]=N;for(var J=0;J<w+163&&ot[J]!=N;++J);J>=163&&fc(N,w+163)}break;case 229:Ce=Ce.concat(N);break;case 93:pe[N.cmo[0]]=U.lastobj=N;break;case 438:U.lastobj.TxO=N;break;case 127:U.lastobj.ImData=N;break;case 440:for(p=N[0].s.r;p<=N[0].e.r;++p)for(m=N[0].s.c;m<=N[0].e.c;++m)f=e.dense?(i[p]||[])[m]:i[nt({c:m,r:p})],f&&(f.l=N[1]);break;case 2048:for(p=N[0].s.r;p<=N[0].e.r;++p)for(m=N[0].s.c;m<=N[0].e.c;++m)f=e.dense?(i[p]||[])[m]:i[nt({c:m,r:p})],f&&f.l&&(f.l.Tooltip=N[1]);break;case 28:{if(U.biff<=5&&U.biff>=2)break;f=e.dense?(i[N[0].r]||[])[N[0].c]:i[nt(N[0])];var Z=pe[N[2]];f||(e.dense?(i[N[0].r]||(i[N[0].r]=[]),f=i[N[0].r][N[0].c]={t:"z"}):f=i[nt(N[0])]={t:"z"},o.e.r=Math.max(o.e.r,N[0].r),o.s.r=Math.min(o.s.r,N[0].r),o.e.c=Math.max(o.e.c,N[0].c),o.s.c=Math.min(o.s.c,N[0].c)),f.c||(f.c=[]),g={a:N[1],t:Z.TxO.t},f.c.push(g)}break;case 2173:g3(A[N.ixfe],N.ext);break;case 125:{if(!U.cellStyles)break;for(;N.e>=N.s;)Te[N.e--]={width:N.w/256,level:N.level||0,hidden:!!(N.flags&1)},Ae||(Ae=!0,_x(N.w/256)),ih(Te[N.e+1])}break;case 520:{var ee={};N.level!=null&&(Se[N.r]=ee,ee.level=N.level),N.hidden&&(Se[N.r]=ee,ee.hidden=!0),N.hpt&&(Se[N.r]=ee,ee.hpt=N.hpt,ee.hpx=Tf(N.hpt))}break;case 38:case 39:case 40:case 41:i["!margins"]||Kd(i["!margins"]={}),i["!margins"][{38:"left",39:"right",40:"top",41:"bottom"}[ne]]=N;break;case 161:i["!margins"]||Kd(i["!margins"]={}),i["!margins"].header=N.header,i["!margins"].footer=N.footer;break;case 574:N.RTL&&(T.Views[0].RTL=!0);break;case 146:O=N;break;case 2198:oe=N;break;case 140:E=N;break;case 442:c?W.CodeName=N||W.name:T.WBProps.CodeName=N||"ThisWorkbook";break}}else le||console.error("Missing Info for XLS Record 0x"+ne.toString(16)),t.l+=fe}return r.SheetNames=fo(s).sort(function(te,Q){return Number(te)-Number(Q)}).map(function(te){return s[te].name}),e.bookSheets||(r.Sheets=n),!r.SheetNames.length&&u["!ref"]?(r.SheetNames.push("Sheet1"),r.Sheets&&(r.Sheets.Sheet1=u)):r.Preamble=u,r.Sheets&&R.forEach(function(te,Q){r.Sheets[r.SheetNames[Q]]["!autofilter"]=te}),r.Strings=l,r.SSF=sn(ot),U.enc&&(r.Encryption=U.enc),oe&&(r.Themes=oe),r.Metadata={},E!==void 0&&(r.Metadata.Country=E),q.names.length>0&&(T.Names=q.names),r.Workbook=T,r}var mT={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function jU(t,e,r){var n=Et.find(t,"/!DocumentSummaryInformation");if(n&&n.size>0)try{var i=JR(n,u$,mT.DSI);for(var s in i)e[s]=i[s]}catch(c){if(r.WTF)throw c}var o=Et.find(t,"/!SummaryInformation");if(o&&o.size>0)try{var a=JR(o,h$,mT.SI);for(var l in a)e[l]==null&&(e[l]=a[l])}catch(c){if(r.WTF)throw c}e.HeadingPairs&&e.TitlesOfParts&&(ZO(e.HeadingPairs,e.TitlesOfParts,e,r),delete e.HeadingPairs,delete e.TitlesOfParts)}function kP(t,e){e||(e={}),Px(e),cO(),e.codepage&&ux(e.codepage);var r,n;if(t.FullPaths){if(Et.find(t,"/encryption"))throw new Error("File is password-protected");r=Et.find(t,"!CompObj"),n=Et.find(t,"/Workbook")||Et.find(t,"/Book")}else{switch(e.type){case"base64":t=ps(Ci(t));break;case"binary":t=ps(t);break;case"buffer":break;case"array":Array.isArray(t)||(t=Array.prototype.slice.call(t));break}nn(t,0),n={content:t}}var i,s;if(r&&UU(r),e.bookProps&&!e.bookSheets)i={};else{var o=yt?"buffer":"array";if(n&&n.content)i=GU(n.content,e);else if((s=Et.find(t,"PerfectOffice_MAIN"))&&s.content)i=Gd.to_workbook(s.content,(e.type=o,e));else if((s=Et.find(t,"NativeContent_MAIN"))&&s.content)i=Gd.to_workbook(s.content,(e.type=o,e));else throw(s=Et.find(t,"MN0"))&&s.content?new Error("Unsupported Works 4 for Mac file"):new Error("Cannot find Workbook stream");e.bookVBA&&t.FullPaths&&Et.find(t,"/_VBA_PROJECT_CUR/VBA/dir")&&(i.vbaraw=P3(t))}var a={};return t.FullPaths&&jU(t,a,e),i.Props=i.Custprops=a,e.bookFiles&&(i.cfb=t),i}var op={0:{f:AW},1:{f:PW},2:{f:VW},3:{f:HW},4:{f:kW},5:{f:BW},6:{f:YW},7:{f:LW},8:{f:XW},9:{f:KW},10:{f:GW},11:{f:jW},12:{f:DW},13:{f:WW},14:{f:FW},15:{f:NW},16:{f:MP},17:{f:zW},18:{f:$W},19:{f:xx},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:yU},40:{},42:{},43:{f:G4},44:{f:z4},45:{f:j4},46:{f:X4},47:{f:K4},48:{},49:{f:qL},50:{},51:{f:p3},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:cP},62:{f:UW},63:{f:x3},64:{f:iU},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:xn,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:nU},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:OW},148:{f:MW,p:16},151:{f:JW},152:{},153:{f:SU},154:{},155:{},156:{f:CU},157:{},158:{},159:{T:1,f:h4},160:{T:-1},161:{T:1,f:Dc},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:qW},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:m3},336:{T:-1},337:{f:w3,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:U1},357:{},358:{},359:{},360:{T:1},361:{},362:{f:lP},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:QW},427:{f:eU},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:rU},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:IW},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:ZW},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:U1},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:M3},633:{T:1},634:{T:-1},635:{T:1,f:A3},636:{T:-1},637:{f:JL},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:uU},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:sU},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}},K1={6:{f:uv},10:{f:xa},12:{f:Dr},13:{f:Dr},14:{f:Tr},15:{f:Tr},16:{f:wn},17:{f:Tr},18:{f:Tr},19:{f:Dr},20:{f:rT},21:{f:rT},23:{f:lP},24:{f:iT},25:{f:Tr},26:{},27:{},28:{f:TB},29:{},34:{f:Tr},35:{f:nT},38:{f:wn},39:{f:wn},40:{f:wn},41:{f:wn},42:{f:Tr},43:{f:Tr},47:{f:I4},49:{f:aB},51:{f:Dr},60:{},61:{f:iB},64:{f:Tr},65:{f:oB},66:{f:Dr},77:{},80:{},81:{},82:{},85:{f:Dr},89:{},90:{},91:{},92:{f:q$},93:{f:AB},94:{},95:{f:Tr},96:{},97:{},99:{f:Tr},125:{f:cP},128:{f:wB},129:{f:Z$},130:{f:Dr},131:{f:Tr},132:{f:Tr},133:{f:J$},134:{},140:{f:kB},141:{f:Dr},144:{},146:{f:HB},151:{},152:{},153:{},154:{},155:{},156:{f:Dr},157:{},158:{},160:{f:VB},161:{f:LB},174:{},175:{},176:{},177:{},178:{},180:{},181:{},182:{},184:{},185:{},189:{f:fB},190:{f:gB},193:{f:xa},197:{},198:{},199:{},200:{},201:{},202:{f:Tr},203:{},204:{},205:{},206:{},207:{},208:{},209:{},210:{},211:{},213:{},215:{},216:{},217:{},218:{f:Dr},220:{},221:{f:Tr},222:{},224:{f:pB},225:{f:X$},226:{f:xa},227:{},229:{f:_B},233:{},235:{},236:{},237:{},239:{},240:{},241:{},242:{},244:{},245:{},246:{},247:{},248:{},249:{},251:{},252:{f:Q$},253:{f:lB},255:{f:eB},256:{},259:{},290:{},311:{},312:{},315:{},317:{f:rP},318:{},319:{},320:{},330:{},331:{},333:{},334:{},335:{},336:{},337:{},338:{},339:{},340:{},351:{},352:{f:Tr},353:{f:xa},401:{},402:{},403:{},404:{},405:{},406:{},407:{},408:{},425:{},426:{},427:{},428:{},429:{},430:{f:CB},431:{f:Tr},432:{},433:{},434:{},437:{},438:{f:OB},439:{f:Tr},440:{f:PB},441:{},442:{f:qf},443:{},444:{f:Dr},445:{},446:{},448:{f:xa},449:{f:nB,r:2},450:{f:xa},512:{f:eT},513:{f:BB},515:{f:vB},516:{f:cB},517:{f:tT},519:{f:WB},520:{f:tB},523:{},545:{f:sT},549:{f:QR},566:{},574:{f:sB},638:{f:dB},659:{},1048:{},1054:{f:uB},1084:{},1212:{f:bB},2048:{f:DB},2049:{},2050:{},2051:{},2052:{},2053:{},2054:{},2055:{},2056:{},2057:{f:Vg},2058:{},2059:{},2060:{},2061:{},2062:{},2063:{},2064:{},2066:{},2067:{},2128:{},2129:{},2130:{},2131:{},2132:{},2133:{},2134:{},2135:{},2136:{},2137:{},2138:{},2146:{},2147:{r:12},2148:{},2149:{},2150:{},2151:{f:xa},2152:{},2154:{},2155:{},2156:{},2161:{},2162:{},2164:{},2165:{},2166:{},2167:{},2168:{},2169:{},2170:{},2171:{},2172:{f:FB,r:12},2173:{f:f3,r:12},2174:{},2175:{},2180:{},2181:{},2182:{},2183:{},2184:{},2185:{},2186:{},2187:{},2188:{f:Tr,r:12},2189:{},2190:{r:12},2191:{},2192:{},2194:{},2195:{},2196:{f:yB,r:12},2197:{},2198:{f:a3,r:12},2199:{},2200:{},2201:{},2202:{f:EB,r:12},2203:{f:xa},2204:{},2205:{},2206:{},2207:{},2211:{f:rB},2212:{},2213:{},2214:{},2215:{},4097:{},4098:{},4099:{},4102:{},4103:{},4105:{},4106:{},4107:{},4108:{},4109:{},4116:{},4117:{},4118:{},4119:{},4120:{},4121:{},4122:{},4123:{},4124:{},4125:{},4126:{},4127:{},4128:{},4129:{},4130:{},4132:{},4133:{},4134:{f:Dr},4135:{},4146:{},4147:{},4148:{},4149:{},4154:{},4156:{},4157:{},4158:{},4159:{},4160:{},4161:{},4163:{},4164:{f:$B},4165:{},4166:{},4168:{},4170:{},4171:{},4174:{},4175:{},4176:{},4177:{},4187:{},4188:{f:NB},4189:{},4191:{},4192:{},4193:{},4194:{},4195:{},4196:{},4197:{},4198:{},4199:{},4200:{},0:{f:eT},1:{},2:{f:GB},3:{f:zB},4:{f:YB},5:{f:tT},7:{f:jB},8:{},9:{f:Vg},11:{},22:{f:Dr},30:{f:hB},31:{},32:{},33:{f:sT},36:{},37:{f:QR},50:{f:KB},62:{},52:{},67:{},68:{f:Dr},69:{},86:{},126:{},127:{f:UB},135:{},136:{},137:{},145:{},148:{},149:{},150:{},169:{},171:{},188:{},191:{},192:{},194:{},195:{},214:{f:XB},223:{},234:{},354:{},421:{},518:{f:uv},521:{f:Vg},536:{f:iT},547:{f:nT},561:{},579:{},1030:{f:uv},1033:{f:Vg},1091:{},2157:{},2163:{},2177:{},2240:{},2241:{},2242:{},2243:{},2244:{},2245:{},2246:{},2247:{},2248:{},2249:{},2250:{},2251:{},2262:{r:12},29282:{}};function qi(t,e,r,n){var i=e;if(!isNaN(i)){var s=(r||[]).length||0,o=t.next(4);o.write_shift(2,i),o.write_shift(2,s),s>0&&UO(r)&&t.push(r)}}function pT(t,e){var r=e||{},n=r.dense?[]:{};t=t.replace(/<!--.*?-->/g,"");var i=t.match(/<table/i);if(!i)throw new Error("Invalid HTML: could not find <table>");var s=t.match(/<\/table/i),o=i.index,a=s&&s.index||t.length,l=vL(t.slice(o,a),/(:?<tr[^>]*>)/i,"<tr>"),c=-1,u=0,h=0,d=0,f={s:{r:1e7,c:1e7},e:{r:0,c:0}},g=[];for(o=0;o<l.length;++o){var m=l[o].trim(),p=m.slice(0,3).toLowerCase();if(p=="<tr"){if(++c,r.sheetRows&&r.sheetRows<=c){--c;break}u=0;continue}if(!(p!="<td"&&p!="<th")){var S=m.split(/<\/t[dh]>/i);for(a=0;a<S.length;++a){var y=S[a].trim();if(y.match(/<t[dh]/i)){for(var C=y,E=0;C.charAt(0)=="<"&&(E=C.indexOf(">"))>-1;)C=C.slice(E+1);for(var A=0;A<g.length;++A){var O=g[A];O.s.c==u&&O.s.r<c&&c<=O.e.r&&(u=O.e.c+1,A=-1)}var T=Qe(y.slice(0,y.indexOf(">")));d=T.colspan?+T.colspan:1,((h=+T.rowspan)>1||d>1)&&g.push({s:{r:c,c:u},e:{r:c+(h||1)-1,c:u+d-1}});var W=T.t||T["data-t"]||"";if(!C.length){u+=d;continue}if(C=IO(C),f.s.r>c&&(f.s.r=c),f.e.r<c&&(f.e.r=c),f.s.c>u&&(f.s.c=u),f.e.c<u&&(f.e.c=u),!C.length){u+=d;continue}var I={t:"s",v:C};r.raw||!C.trim().length||W=="s"||(C==="TRUE"?I={t:"b",v:!0}:C==="FALSE"?I={t:"b",v:!1}:isNaN(xs(C))?isNaN(nh(C).getDate())||(I={t:"d",v:Jr(C)},r.cellDates||(I={t:"n",v:$n(I.v)}),I.z=r.dateNF||ot[14]):I={t:"n",v:xs(C)}),r.dense?(n[c]||(n[c]=[]),n[c][u]=I):n[nt({r:c,c:u})]=I,u+=d}}}}return n["!ref"]=Rt(f),g.length&&(n["!merges"]=g),n}function KU(t,e,r,n){for(var i=t["!merges"]||[],s=[],o=e.s.c;o<=e.e.c;++o){for(var a=0,l=0,c=0;c<i.length;++c)if(!(i[c].s.r>r||i[c].s.c>o)&&!(i[c].e.r<r||i[c].e.c<o)){if(i[c].s.r<r||i[c].s.c<o){a=-1;break}a=i[c].e.r-i[c].s.r+1,l=i[c].e.c-i[c].s.c+1;break}if(!(a<0)){var u=nt({r,c:o}),h=n.dense?(t[r]||[])[o]:t[u],d=h&&h.v!=null&&(h.h||px(h.w||(sa(h),h.w)||""))||"",f={};a>1&&(f.rowspan=a),l>1&&(f.colspan=l),n.editable?d='<span contenteditable="true">'+d+"</span>":h&&(f["data-t"]=h&&h.t||"z",h.v!=null&&(f["data-v"]=h.v),h.z!=null&&(f["data-z"]=h.z),h.l&&(h.l.Target||"#").charAt(0)!="#"&&(d='<a href="'+h.l.Target+'">'+d+"</a>")),f.id=(n.id||"sjs")+"-"+u,s.push(kL("td",d,f))}}var g="<tr>";return g+s.join("")+"</tr>"}var XU='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',qU="</body></html>";function ZU(t,e){var r=t.match(/<table[\s\S]*?>[\s\S]*?<\/table>/gi);if(!r||r.length==0)throw new Error("Invalid HTML: could not find <table>");if(r.length==1)return gl(pT(r[0],e),e);var n=kx();return r.forEach(function(i,s){Nx(n,pT(i,e),"Sheet"+(s+1))}),n}function JU(t,e,r){var n=[];return n.join("")+"<table"+(r&&r.id?' id="'+r.id+'"':"")+">"}function QU(t,e){var r=e||{},n=r.header!=null?r.header:XU,i=r.footer!=null?r.footer:qU,s=[n],o=hh(t["!ref"]);r.dense=Array.isArray(t),s.push(JU(t,o,r));for(var a=o.s.r;a<=o.e.r;++a)s.push(KU(t,o,a,r));return s.push("</table>"+i),s.join("")}function NP(t,e,r){var n=r||{},i=0,s=0;if(n.origin!=null)if(typeof n.origin=="number")i=n.origin;else{var o=typeof n.origin=="string"?Fn(n.origin):n.origin;i=o.r,s=o.c}var a=e.getElementsByTagName("tr"),l=Math.min(n.sheetRows||1e7,a.length),c={s:{r:0,c:0},e:{r:i,c:s}};if(t["!ref"]){var u=hh(t["!ref"]);c.s.r=Math.min(c.s.r,u.s.r),c.s.c=Math.min(c.s.c,u.s.c),c.e.r=Math.max(c.e.r,u.e.r),c.e.c=Math.max(c.e.c,u.e.c),i==-1&&(c.e.r=i=u.e.r+1)}var h=[],d=0,f=t["!rows"]||(t["!rows"]=[]),g=0,m=0,p=0,S=0,y=0,C=0;for(t["!cols"]||(t["!cols"]=[]);g<a.length&&m<l;++g){var E=a[g];if(wT(E)){if(n.display)continue;f[m]={hidden:!0}}var A=E.children;for(p=S=0;p<A.length;++p){var O=A[p];if(!(n.display&&wT(O))){var T=O.hasAttribute("data-v")?O.getAttribute("data-v"):O.hasAttribute("v")?O.getAttribute("v"):IO(O.innerHTML),W=O.getAttribute("data-z")||O.getAttribute("z");for(d=0;d<h.length;++d){var I=h[d];I.s.c==S+s&&I.s.r<m+i&&m+i<=I.e.r&&(S=I.e.c+1-s,d=-1)}C=+O.getAttribute("colspan")||1,((y=+O.getAttribute("rowspan")||1)>1||C>1)&&h.push({s:{r:m+i,c:S+s},e:{r:m+i+(y||1)-1,c:S+s+(C||1)-1}});var Y={t:"s",v:T},z=O.getAttribute("data-t")||O.getAttribute("t")||"";T!=null&&(T.length==0?Y.t=z||"z":n.raw||T.trim().length==0||z=="s"||(T==="TRUE"?Y={t:"b",v:!0}:T==="FALSE"?Y={t:"b",v:!1}:isNaN(xs(T))?isNaN(nh(T).getDate())||(Y={t:"d",v:Jr(T)},n.cellDates||(Y={t:"n",v:$n(Y.v)}),Y.z=n.dateNF||ot[14]):Y={t:"n",v:xs(T)})),Y.z===void 0&&W!=null&&(Y.z=W);var U="",oe=O.getElementsByTagName("A");if(oe&&oe.length)for(var Ce=0;Ce<oe.length&&!(oe[Ce].hasAttribute("href")&&(U=oe[Ce].getAttribute("href"),U.charAt(0)!="#"));++Ce);U&&U.charAt(0)!="#"&&(Y.l={Target:U}),n.dense?(t[m+i]||(t[m+i]=[]),t[m+i][S+s]=Y):t[nt({c:S+s,r:m+i})]=Y,c.e.c<S+s&&(c.e.c=S+s),S+=C}}++m}return h.length&&(t["!merges"]=(t["!merges"]||[]).concat(h)),c.e.r=Math.max(c.e.r,m-1+i),t["!ref"]=Rt(c),m>=l&&(t["!fullref"]=Rt((c.e.r=a.length-g+m-1+i,c))),t}function HP(t,e){var r=e||{},n=r.dense?[]:{};return NP(n,t,e)}function e8(t,e){return gl(HP(t,e),e)}function wT(t){var e="",r=t8(t);return r&&(e=r(t).getPropertyValue("display")),e||(e=t.style&&t.style.display),e==="none"}function t8(t){return t.ownerDocument.defaultView&&typeof t.ownerDocument.defaultView.getComputedStyle=="function"?t.ownerDocument.defaultView.getComputedStyle:typeof getComputedStyle=="function"?getComputedStyle:null}function r8(t){var e=t.replace(/[\t\r\n]/g," ").trim().replace(/ +/g," ").replace(/<text:s\/>/g," ").replace(/<text:s text:c="(\d+)"\/>/g,function(n,i){return Array(parseInt(i,10)+1).join(" ")}).replace(/<text:tab[^>]*\/>/g," ").replace(/<text:line-break\/>/g,`
  35. `),r=At(e.replace(/<[^>]*>/g,""));return[r]}var vT={day:["d","dd"],month:["m","mm"],year:["y","yy"],hours:["h","hh"],minutes:["m","mm"],seconds:["s","ss"],"am-pm":["A/P","AM/PM"],"day-of-week":["ddd","dddd"],era:["e","ee"],quarter:["\\Qm",'m\\"th quarter"']};function FP(t,e){var r=e||{},n=wx(t),i=[],s,o,a={name:""},l="",c=0,u,h,d={},f=[],g=r.dense?[]:{},m,p,S={value:""},y="",C=0,E=[],A=-1,O=-1,T={s:{r:1e6,c:1e7},e:{r:0,c:0}},W=0,I={},Y=[],z={},U=0,oe=0,Ce=[],pe=1,Te=1,Se=[],Ae={Names:[]},q={},Oe=["",""],v=[],w={},x="",R=0,b=!1,B=!1,X=0;for(bf.lastIndex=0,n=n.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");m=bf.exec(n);)switch(m[3]=m[3].replace(/_.*$/,"")){case"table":case"工作表":m[1]==="/"?(T.e.c>=T.s.c&&T.e.r>=T.s.r?g["!ref"]=Rt(T):g["!ref"]="A1:A1",r.sheetRows>0&&r.sheetRows<=T.e.r&&(g["!fullref"]=g["!ref"],T.e.r=r.sheetRows-1,g["!ref"]=Rt(T)),Y.length&&(g["!merges"]=Y),Ce.length&&(g["!rows"]=Ce),u.name=u.名称||u.name,typeof JSON<"u"&&JSON.stringify(u),f.push(u.name),d[u.name]=g,B=!1):m[0].charAt(m[0].length-2)!=="/"&&(u=Qe(m[0],!1),A=O=-1,T.s.r=T.s.c=1e7,T.e.r=T.e.c=0,g=r.dense?[]:{},Y=[],Ce=[],B=!0);break;case"table-row-group":m[1]==="/"?--W:++W;break;case"table-row":case"行":if(m[1]==="/"){A+=pe,pe=1;break}if(h=Qe(m[0],!1),h.行号?A=h.行号-1:A==-1&&(A=0),pe=+h["number-rows-repeated"]||1,pe<10)for(X=0;X<pe;++X)W>0&&(Ce[A+X]={level:W});O=-1;break;case"covered-table-cell":m[1]!=="/"&&++O,r.sheetStubs&&(r.dense?(g[A]||(g[A]=[]),g[A][O]={t:"z"}):g[nt({r:A,c:O})]={t:"z"}),y="",E=[];break;case"table-cell":case"数据":if(m[0].charAt(m[0].length-2)==="/")++O,S=Qe(m[0],!1),Te=parseInt(S["number-columns-repeated"]||"1",10),p={t:"z",v:null},S.formula&&r.cellFormula!=!1&&(p.f=dT(At(S.formula))),(S.数据类型||S["value-type"])=="string"&&(p.t="s",p.v=At(S["string-value"]||""),r.dense?(g[A]||(g[A]=[]),g[A][O]=p):g[nt({r:A,c:O})]=p),O+=Te-1;else if(m[1]!=="/"){++O,y="",C=0,E=[],Te=1;var ne=pe?A+pe-1:A;if(O>T.e.c&&(T.e.c=O),O<T.s.c&&(T.s.c=O),A<T.s.r&&(T.s.r=A),ne>T.e.r&&(T.e.r=ne),S=Qe(m[0],!1),v=[],w={},p={t:S.数据类型||S["value-type"],v:null},r.cellFormula)if(S.formula&&(S.formula=At(S.formula)),S["number-matrix-columns-spanned"]&&S["number-matrix-rows-spanned"]&&(U=parseInt(S["number-matrix-rows-spanned"],10)||0,oe=parseInt(S["number-matrix-columns-spanned"],10)||0,z={s:{r:A,c:O},e:{r:A+U-1,c:O+oe-1}},p.F=Rt(z),Se.push([z,p.F])),S.formula)p.f=dT(S.formula);else for(X=0;X<Se.length;++X)A>=Se[X][0].s.r&&A<=Se[X][0].e.r&&O>=Se[X][0].s.c&&O<=Se[X][0].e.c&&(p.F=Se[X][1]);switch((S["number-columns-spanned"]||S["number-rows-spanned"])&&(U=parseInt(S["number-rows-spanned"],10)||0,oe=parseInt(S["number-columns-spanned"],10)||0,z={s:{r:A,c:O},e:{r:A+U-1,c:O+oe-1}},Y.push(z)),S["number-columns-repeated"]&&(Te=parseInt(S["number-columns-repeated"],10)),p.t){case"boolean":p.t="b",p.v=ar(S["boolean-value"]);break;case"float":p.t="n",p.v=parseFloat(S.value);break;case"percentage":p.t="n",p.v=parseFloat(S.value);break;case"currency":p.t="n",p.v=parseFloat(S.value);break;case"date":p.t="d",p.v=Jr(S["date-value"]),r.cellDates||(p.t="n",p.v=$n(p.v)),p.z="m/d/yy";break;case"time":p.t="n",p.v=mL(S["time-value"])/86400,r.cellDates&&(p.t="d",p.v=Qp(p.v)),p.z="HH:MM:SS";break;case"number":p.t="n",p.v=parseFloat(S.数据数值);break;default:if(p.t==="string"||p.t==="text"||!p.t)p.t="s",S["string-value"]!=null&&(y=At(S["string-value"]),E=[]);else throw new Error("Unsupported value type "+p.t)}}else{if(b=!1,p.t==="s"&&(p.v=y||"",E.length&&(p.R=E),b=C==0),q.Target&&(p.l=q),v.length>0&&(p.c=v,v=[]),y&&r.cellText!==!1&&(p.w=y),b&&(p.t="z",delete p.v),(!b||r.sheetStubs)&&!(r.sheetRows&&r.sheetRows<=A))for(var fe=0;fe<pe;++fe){if(Te=parseInt(S["number-columns-repeated"]||"1",10),r.dense)for(g[A+fe]||(g[A+fe]=[]),g[A+fe][O]=fe==0?p:sn(p);--Te>0;)g[A+fe][O+Te]=sn(p);else for(g[nt({r:A+fe,c:O})]=p;--Te>0;)g[nt({r:A+fe,c:O+Te})]=sn(p);T.e.c<=O&&(T.e.c=O)}Te=parseInt(S["number-columns-repeated"]||"1",10),O+=Te-1,Te=0,p={},y="",E=[]}q={};break;case"document":case"document-content":case"电子表格文档":case"spreadsheet":case"主体":case"scripts":case"styles":case"font-face-decls":case"master-styles":if(m[1]==="/"){if((s=i.pop())[0]!==m[3])throw"Bad state: "+s}else m[0].charAt(m[0].length-2)!=="/"&&i.push([m[3],!0]);break;case"annotation":if(m[1]==="/"){if((s=i.pop())[0]!==m[3])throw"Bad state: "+s;w.t=y,E.length&&(w.R=E),w.a=x,v.push(w)}else m[0].charAt(m[0].length-2)!=="/"&&i.push([m[3],!1]);x="",R=0,y="",C=0,E=[];break;case"creator":m[1]==="/"?x=n.slice(R,m.index):R=m.index+m[0].length;break;case"meta":case"元数据":case"settings":case"config-item-set":case"config-item-map-indexed":case"config-item-map-entry":case"config-item-map-named":case"shapes":case"frame":case"text-box":case"image":case"data-pilot-tables":case"list-style":case"form":case"dde-links":case"event-listeners":case"chart":if(m[1]==="/"){if((s=i.pop())[0]!==m[3])throw"Bad state: "+s}else m[0].charAt(m[0].length-2)!=="/"&&i.push([m[3],!1]);y="",C=0,E=[];break;case"scientific-number":break;case"currency-symbol":break;case"currency-style":break;case"number-style":case"percentage-style":case"date-style":case"time-style":if(m[1]==="/"){if(I[a.name]=l,(s=i.pop())[0]!==m[3])throw"Bad state: "+s}else m[0].charAt(m[0].length-2)!=="/"&&(l="",a=Qe(m[0],!1),i.push([m[3],!0]));break;case"script":break;case"libraries":break;case"automatic-styles":break;case"default-style":case"page-layout":break;case"style":break;case"map":break;case"font-face":break;case"paragraph-properties":break;case"table-properties":break;case"table-column-properties":break;case"table-row-properties":break;case"table-cell-properties":break;case"number":switch(i[i.length-1][0]){case"time-style":case"date-style":o=Qe(m[0],!1),l+=vT[m[3]][o.style==="long"?1:0];break}break;case"fraction":break;case"day":case"month":case"year":case"era":case"day-of-week":case"week-of-year":case"quarter":case"hours":case"minutes":case"seconds":case"am-pm":switch(i[i.length-1][0]){case"time-style":case"date-style":o=Qe(m[0],!1),l+=vT[m[3]][o.style==="long"?1:0];break}break;case"boolean-style":break;case"boolean":break;case"text-style":break;case"text":if(m[0].slice(-2)==="/>")break;if(m[1]==="/")switch(i[i.length-1][0]){case"number-style":case"date-style":case"time-style":l+=n.slice(c,m.index);break}else c=m.index+m[0].length;break;case"named-range":o=Qe(m[0],!1),Oe=hv(o["cell-range-address"]);var le={Name:o.name,Ref:Oe[0]+"!"+Oe[1]};B&&(le.Sheet=f.length),Ae.Names.push(le);break;case"text-content":break;case"text-properties":break;case"embedded-text":break;case"body":case"电子表格":break;case"forms":break;case"table-column":break;case"table-header-rows":break;case"table-rows":break;case"table-column-group":break;case"table-header-columns":break;case"table-columns":break;case"null-date":break;case"graphic-properties":break;case"calculation-settings":break;case"named-expressions":break;case"label-range":break;case"label-ranges":break;case"named-expression":break;case"sort":break;case"sort-by":break;case"sort-groups":break;case"tab":break;case"line-break":break;case"span":break;case"p":case"文本串":if(["master-styles"].indexOf(i[i.length-1][0])>-1)break;if(m[1]==="/"&&(!S||!S["string-value"])){var we=r8(n.slice(C,m.index));y=(y.length>0?y+`
  36. `:"")+we[0]}else Qe(m[0],!1),C=m.index+m[0].length;break;case"s":break;case"database-range":if(m[1]==="/")break;try{Oe=hv(Qe(m[0])["target-range-address"]),d[Oe[0]]["!autofilter"]={ref:Oe[1]}}catch{}break;case"date":break;case"object":break;case"title":case"标题":break;case"desc":break;case"binary-data":break;case"table-source":break;case"scenario":break;case"iteration":break;case"content-validations":break;case"content-validation":break;case"help-message":break;case"error-message":break;case"database-ranges":break;case"filter":break;case"filter-and":break;case"filter-or":break;case"filter-condition":break;case"list-level-style-bullet":break;case"list-level-style-number":break;case"list-level-properties":break;case"sender-firstname":case"sender-lastname":case"sender-initials":case"sender-title":case"sender-position":case"sender-email":case"sender-phone-private":case"sender-fax":case"sender-company":case"sender-phone-work":case"sender-street":case"sender-city":case"sender-postal-code":case"sender-country":case"sender-state-or-province":case"author-name":case"author-initials":case"chapter":case"file-name":case"template-name":case"sheet-name":break;case"event-listener":break;case"initial-creator":case"creation-date":case"print-date":case"generator":case"document-statistic":case"user-defined":case"editing-duration":case"editing-cycles":break;case"config-item":break;case"page-number":break;case"page-count":break;case"time":break;case"cell-range-source":break;case"detective":break;case"operation":break;case"highlighted-range":break;case"data-pilot-table":case"source-cell-range":case"source-service":case"data-pilot-field":case"data-pilot-level":case"data-pilot-subtotals":case"data-pilot-subtotal":case"data-pilot-members":case"data-pilot-member":case"data-pilot-display-info":case"data-pilot-sort-info":case"data-pilot-layout-info":case"data-pilot-field-reference":case"data-pilot-groups":case"data-pilot-group":case"data-pilot-group-member":break;case"rect":break;case"dde-connection-decls":case"dde-connection-decl":case"dde-link":case"dde-source":break;case"properties":break;case"property":break;case"a":if(m[1]!=="/"){if(q=Qe(m[0],!1),!q.href)break;q.Target=At(q.href),delete q.href,q.Target.charAt(0)=="#"&&q.Target.indexOf(".")>-1?(Oe=hv(q.Target.slice(1)),q.Target="#"+Oe[0]+"!"+Oe[1]):q.Target.match(/^\.\.[\\\/]/)&&(q.Target=q.Target.slice(3))}break;case"table-protection":break;case"data-pilot-grand-total":break;case"office-document-common-attrs":break;default:switch(m[2]){case"dc:":case"calcext:":case"loext:":case"ooo:":case"chartooo:":case"draw:":case"style:":case"chart:":case"form:":case"uof:":case"表:":case"字:":break;default:if(r.WTF)throw new Error(m)}}var N={Sheets:d,SheetNames:f,Workbook:Ae};return r.bookSheets&&delete N.Sheets,N}function CT(t,e){e=e||{},Pi(t,"META-INF/manifest.xml")&&v$(Pr(t,"META-INF/manifest.xml"),e);var r=wi(t,"content.xml");if(!r)throw new Error("Missing content.xml in ODS / UOF file");var n=FP(Jt(r),e);return Pi(t,"meta.xml")&&(n.Props=qO(Pr(t,"meta.xml"))),n}function ST(t,e){return FP(t,e)}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function Ix(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function X1(t){return typeof TextDecoder<"u"?new TextDecoder().decode(t):Jt(Oc(t))}function q1(t){var e=t.reduce(function(i,s){return i+s.length},0),r=new Uint8Array(e),n=0;return t.forEach(function(i){r.set(i,n),n+=i.length}),r}function xT(t){return t-=t>>1&1431655765,t=(t&858993459)+(t>>2&858993459),(t+(t>>4)&252645135)*16843009>>>24}function n8(t,e){for(var r=(t[e+15]&127)<<7|t[e+14]>>1,n=t[e+14]&1,i=e+13;i>=e;--i)n=n*256+t[i];return(t[e+15]&128?-n:n)*Math.pow(10,r-6176)}function _f(t,e){var r=e?e[0]:0,n=t[r]&127;e:if(t[r++]>=128&&(n|=(t[r]&127)<<7,t[r++]<128||(n|=(t[r]&127)<<14,t[r++]<128)||(n|=(t[r]&127)<<21,t[r++]<128)||(n+=(t[r]&127)*Math.pow(2,28),++r,t[r++]<128)||(n+=(t[r]&127)*Math.pow(2,35),++r,t[r++]<128)||(n+=(t[r]&127)*Math.pow(2,42),++r,t[r++]<128)))break e;return e&&(e[0]=r),n}function Wr(t){var e=0,r=t[e]&127;e:if(t[e++]>=128){if(r|=(t[e]&127)<<7,t[e++]<128||(r|=(t[e]&127)<<14,t[e++]<128)||(r|=(t[e]&127)<<21,t[e++]<128))break e;r|=(t[e]&127)<<28}return r}function vn(t){for(var e=[],r=[0];r[0]<t.length;){var n=r[0],i=_f(t,r),s=i&7;i=Math.floor(i/8);var o=0,a;if(i==0)break;switch(s){case 0:{for(var l=r[0];t[r[0]++]>=128;);a=t.slice(l,r[0])}break;case 5:o=4,a=t.slice(r[0],r[0]+o),r[0]+=o;break;case 1:o=8,a=t.slice(r[0],r[0]+o),r[0]+=o;break;case 2:o=_f(t,r),a=t.slice(r[0],r[0]+o),r[0]+=o;break;case 3:case 4:default:throw new Error("PB Type ".concat(s," for Field ").concat(i," at offset ").concat(n))}var c={data:a,type:s};e[i]==null?e[i]=[c]:e[i].push(c)}return e}function Ox(t,e){return t?.map(function(r){return e(r.data)})||[]}function i8(t){for(var e,r=[],n=[0];n[0]<t.length;){var i=_f(t,n),s=vn(t.slice(n[0],n[0]+i));n[0]+=i;var o={id:Wr(s[1][0].data),messages:[]};s[2].forEach(function(a){var l=vn(a.data),c=Wr(l[3][0].data);o.messages.push({meta:l,data:t.slice(n[0],n[0]+c)}),n[0]+=c}),(e=s[3])!=null&&e[0]&&(o.merge=Wr(s[3][0].data)>>>0>0),r.push(o)}return r}function s8(t,e){if(t!=0)throw new Error("Unexpected Snappy chunk type ".concat(t));for(var r=[0],n=_f(e,r),i=[];r[0]<e.length;){var s=e[r[0]]&3;if(s==0){var o=e[r[0]++]>>2;if(o<60)++o;else{var a=o-59;o=e[r[0]],a>1&&(o|=e[r[0]+1]<<8),a>2&&(o|=e[r[0]+2]<<16),a>3&&(o|=e[r[0]+3]<<24),o>>>=0,o++,r[0]+=a}i.push(e.slice(r[0],r[0]+o)),r[0]+=o;continue}else{var l=0,c=0;if(s==1?(c=(e[r[0]]>>2&7)+4,l=(e[r[0]++]&224)<<3,l|=e[r[0]++]):(c=(e[r[0]++]>>2)+1,s==2?(l=e[r[0]]|e[r[0]+1]<<8,r[0]+=2):(l=(e[r[0]]|e[r[0]+1]<<8|e[r[0]+2]<<16|e[r[0]+3]<<24)>>>0,r[0]+=4)),i=[q1(i)],l==0)throw new Error("Invalid offset 0");if(l>i[0].length)throw new Error("Invalid offset beyond length");if(c>=l)for(i.push(i[0].slice(-l)),c-=l;c>=i[i.length-1].length;)i.push(i[i.length-1]),c-=i[i.length-1].length;i.push(i[0].slice(-l,-l+c))}}var u=q1(i);if(u.length!=n)throw new Error("Unexpected length: ".concat(u.length," != ").concat(n));return u}function o8(t){for(var e=[],r=0;r<t.length;){var n=t[r++],i=t[r]|t[r+1]<<8|t[r+2]<<16;r+=3,e.push(s8(n,t.slice(r,r+i))),r+=i}if(r!==t.length)throw new Error("data is not a valid framed stream!");return q1(e)}function a8(t,e,r,n){var i=Ix(t),s=i.getUint32(4,!0),o=(n>1?12:8)+xT(s&(n>1?3470:398))*4,a=-1,l=-1,c=NaN,u=new Date(2001,0,1);s&512&&(a=i.getUint32(o,!0),o+=4),o+=xT(s&(n>1?12288:4096))*4,s&16&&(l=i.getUint32(o,!0),o+=4),s&32&&(c=i.getFloat64(o,!0),o+=8),s&64&&(u.setTime(u.getTime()+i.getFloat64(o,!0)*1e3),o+=8);var h;switch(t[2]){case 0:break;case 2:h={t:"n",v:c};break;case 3:h={t:"s",v:e[l]};break;case 5:h={t:"d",v:u};break;case 6:h={t:"b",v:c>0};break;case 7:h={t:"n",v:c/86400};break;case 8:h={t:"e",v:0};break;case 9:if(a>-1)h={t:"s",v:r[a]};else if(l>-1)h={t:"s",v:e[l]};else if(!isNaN(c))h={t:"n",v:c};else throw new Error("Unsupported cell type ".concat(t.slice(0,4)));break;default:throw new Error("Unsupported cell type ".concat(t.slice(0,4)))}return h}function l8(t,e,r){var n=Ix(t),i=n.getUint32(8,!0),s=12,o=-1,a=-1,l=NaN,c=NaN,u=new Date(2001,0,1);i&1&&(l=n8(t,s),s+=16),i&2&&(c=n.getFloat64(s,!0),s+=8),i&4&&(u.setTime(u.getTime()+n.getFloat64(s,!0)*1e3),s+=8),i&8&&(a=n.getUint32(s,!0),s+=4),i&16&&(o=n.getUint32(s,!0),s+=4);var h;switch(t[1]){case 0:break;case 2:h={t:"n",v:l};break;case 3:h={t:"s",v:e[a]};break;case 5:h={t:"d",v:u};break;case 6:h={t:"b",v:c>0};break;case 7:h={t:"n",v:c/86400};break;case 8:h={t:"e",v:0};break;case 9:if(o>-1)h={t:"s",v:r[o]};else throw new Error("Unsupported cell type ".concat(t[1]," : ").concat(i&31," : ").concat(t.slice(0,4)));break;case 10:h={t:"n",v:l};break;default:throw new Error("Unsupported cell type ".concat(t[1]," : ").concat(i&31," : ").concat(t.slice(0,4)))}return h}function c8(t,e,r){switch(t[0]){case 0:case 1:case 2:case 3:return a8(t,e,r,t[0]);case 5:return l8(t,e,r);default:throw new Error("Unsupported payload version ".concat(t[0]))}}function nl(t){var e=vn(t);return _f(e[1][0].data)}function yT(t,e){var r=vn(e.data),n=Wr(r[1][0].data),i=r[3],s=[];return(i||[]).forEach(function(o){var a=vn(o.data),l=Wr(a[1][0].data)>>>0;switch(n){case 1:s[l]=X1(a[3][0].data);break;case 8:{var c=t[nl(a[9][0].data)][0],u=vn(c.data),h=t[nl(u[1][0].data)][0],d=Wr(h.meta[1][0].data);if(d!=2001)throw new Error("2000 unexpected reference to ".concat(d));var f=vn(h.data);s[l]=f[3].map(function(g){return X1(g.data)}).join("")}break}}),s}function u8(t,e){var r,n,i,s,o,a,l,c,u,h,d,f,g,m,p=vn(t),S=Wr(p[1][0].data)>>>0,y=Wr(p[2][0].data)>>>0,C=((n=(r=p[8])==null?void 0:r[0])==null?void 0:n.data)&&Wr(p[8][0].data)>0||!1,E,A;if((s=(i=p[7])==null?void 0:i[0])!=null&&s.data&&e!=0)E=(a=(o=p[7])==null?void 0:o[0])==null?void 0:a.data,A=(c=(l=p[6])==null?void 0:l[0])==null?void 0:c.data;else if((h=(u=p[4])==null?void 0:u[0])!=null&&h.data&&e!=1)E=(f=(d=p[4])==null?void 0:d[0])==null?void 0:f.data,A=(m=(g=p[3])==null?void 0:g[0])==null?void 0:m.data;else throw"NUMBERS Tile missing ".concat(e," cell storage");for(var O=C?4:1,T=Ix(E),W=[],I=0;I<E.length/2;++I){var Y=T.getUint16(I*2,!0);Y<65535&&W.push([I,Y])}if(W.length!=y)throw"Expected ".concat(y," cells, found ").concat(W.length);var z=[];for(I=0;I<W.length-1;++I)z[W[I][0]]=A.subarray(W[I][1]*O,W[I+1][1]*O);return W.length>=1&&(z[W[W.length-1][0]]=A.subarray(W[W.length-1][1]*O)),{R:S,cells:z}}function h8(t,e){var r,n=vn(e.data),i=(r=n?.[7])!=null&&r[0]?Wr(n[7][0].data)>>>0>0?1:0:-1,s=Ox(n[5],function(o){return u8(o,i)});return{nrows:Wr(n[4][0].data)>>>0,data:s.reduce(function(o,a){return o[a.R]||(o[a.R]=[]),a.cells.forEach(function(l,c){if(o[a.R][c])throw new Error("Duplicate cell r=".concat(a.R," c=").concat(c));o[a.R][c]=l}),o},[])}}function d8(t,e,r){var n,i=vn(e.data),s={s:{r:0,c:0},e:{r:0,c:0}};if(s.e.r=(Wr(i[6][0].data)>>>0)-1,s.e.r<0)throw new Error("Invalid row varint ".concat(i[6][0].data));if(s.e.c=(Wr(i[7][0].data)>>>0)-1,s.e.c<0)throw new Error("Invalid col varint ".concat(i[7][0].data));r["!ref"]=Rt(s);var o=vn(i[4][0].data),a=yT(t,t[nl(o[4][0].data)][0]),l=(n=o[17])!=null&&n[0]?yT(t,t[nl(o[17][0].data)][0]):[],c=vn(o[3][0].data),u=0;c[1].forEach(function(h){var d=vn(h.data),f=t[nl(d[2][0].data)][0],g=Wr(f.meta[1][0].data);if(g!=6002)throw new Error("6001 unexpected reference to ".concat(g));var m=h8(t,f);m.data.forEach(function(p,S){p.forEach(function(y,C){var E=nt({r:u+S,c:C}),A=c8(y,a,l);A&&(r[E]=A)})}),u+=m.nrows})}function f8(t,e){var r=vn(e.data),n={"!ref":"A1"},i=t[nl(r[2][0].data)],s=Wr(i[0].meta[1][0].data);if(s!=6001)throw new Error("6000 unexpected reference to ".concat(s));return d8(t,i[0],n),n}function g8(t,e){var r,n=vn(e.data),i={name:(r=n[1])!=null&&r[0]?X1(n[1][0].data):"",sheets:[]},s=Ox(n[2],nl);return s.forEach(function(o){t[o].forEach(function(a){var l=Wr(a.meta[1][0].data);l==6e3&&i.sheets.push(f8(t,a))})}),i}function m8(t,e){var r=kx(),n=vn(e.data),i=Ox(n[1],nl);if(i.forEach(function(s){t[s].forEach(function(o){var a=Wr(o.meta[1][0].data);if(a==2){var l=g8(t,o);l.sheets.forEach(function(c,u){Nx(r,c,u==0?l.name:l.name+"_"+u,!0)})}})}),r.SheetNames.length==0)throw new Error("Empty NUMBERS file");return r}function fv(t){var e,r,n,i,s={},o=[];if(t.FullPaths.forEach(function(l){if(l.match(/\.iwpv2/))throw new Error("Unsupported password protection")}),t.FileIndex.forEach(function(l){if(l.name.match(/\.iwa$/)){var c;try{c=o8(l.content)}catch(h){return console.log("?? "+l.content.length+" "+(h.message||h))}var u;try{u=i8(c)}catch(h){return console.log("## "+(h.message||h))}u.forEach(function(h){s[h.id]=h.messages,o.push(h.id)})}}),!o.length)throw new Error("File has no messages");var a=((i=(n=(r=(e=s?.[1])==null?void 0:e[0])==null?void 0:r.meta)==null?void 0:n[1])==null?void 0:i[0].data)&&Wr(s[1][0].meta[1][0].data)==1&&s[1][0];if(a||o.forEach(function(l){s[l].forEach(function(c){var u=Wr(c.meta[1][0].data)>>>0;if(u==1)if(!a)a=c;else throw new Error("Document has multiple roots")})}),!a)throw new Error("Cannot find Document root");return m8(s,a)}function p8(t){return function(r){for(var n=0;n!=t.length;++n){var i=t[n];r[i[0]]===void 0&&(r[i[0]]=i[1]),i[2]==="n"&&(r[i[0]]=Number(r[i[0]]))}}}function Px(t){p8([["cellNF",!1],["cellHTML",!0],["cellFormula",!0],["cellStyles",!1],["cellText",!0],["cellDates",!1],["sheetStubs",!1],["sheetRows",0,"n"],["bookDeps",!1],["bookSheets",!1],["bookProps",!1],["bookFiles",!1],["bookVBA",!1],["password",""],["WTF",!1]])(t)}function w8(t){return Hu.WS.indexOf(t)>-1?"sheet":t==Hu.CS?"chart":t==Hu.DS?"dialog":t==Hu.MS?"macro":t&&t.length?t:"sheet"}function v8(t,e){if(!t)return 0;try{t=e.map(function(n){return n.id||(n.id=n.strRelID),[n.name,t["!id"][n.id].Target,w8(t["!id"][n.id].Type)]})}catch{return null}return!t||t.length===0?null:t}function C8(t,e,r,n,i,s,o,a,l,c,u,h){try{s[n]=Yd(wi(t,r,!0),e);var d=Pr(t,e),f;switch(a){case"sheet":f=RU(d,e,i,l,s[n],c,u,h);break;case"chart":if(f=TU(d,e,i,l,s[n],c,u,h),!f||!f["!drawel"])break;var g=kd(f["!drawel"].Target,e),m=Y1(g),p=E3(wi(t,g,!0),Yd(wi(t,m,!0),g)),S=kd(p,g),y=Y1(S);f=lU(wi(t,S,!0),S,l,Yd(wi(t,y,!0),S),c,f);break;case"macro":f=_U(d,e,i,l,s[n],c,u,h);break;case"dialog":f=AU(d,e,i,l,s[n],c,u,h);break;default:throw new Error("Unrecognized sheet type "+a)}o[n]=f;var C=[];s&&s[n]&&fo(s[n]).forEach(function(E){var A="";if(s[n][E].Type==Hu.CMNT){A=kd(s[n][E].Target,e);var O=PU(Pr(t,A,!0),A,l);if(!O||!O.length)return;aT(f,O,!1)}s[n][E].Type==Hu.TCMNT&&(A=kd(s[n][E].Target,e),C=C.concat(T3(Pr(t,A,!0),l)))}),C&&C.length&&aT(f,C,!0,l.people||[])}catch(E){if(l.WTF)throw E}}function bi(t){return t.charAt(0)=="/"?t.slice(1):t}function S8(t,e){if(xO(),e=e||{},Px(e),Pi(t,"META-INF/manifest.xml")||Pi(t,"objectdata.xml"))return CT(t,e);if(Pi(t,"Index/Document.iwa")){if(typeof Uint8Array>"u")throw new Error("NUMBERS file parsing requires Uint8Array support");if(typeof fv<"u"){if(t.FileIndex)return fv(t);var r=Et.utils.cfb_new();return kR(t).forEach(function(Ce){xL(r,Ce,SL(t,Ce))}),fv(r)}throw new Error("Unsupported NUMBERS file")}if(!Pi(t,"[Content_Types].xml"))throw Pi(t,"index.xml.gz")?new Error("Unsupported NUMBERS 08 file"):Pi(t,"index.xml")?new Error("Unsupported NUMBERS 09 file"):new Error("Unsupported ZIP file");var n=kR(t),i=p$(wi(t,"[Content_Types].xml")),s=!1,o,a;if(i.workbooks.length===0&&(a="xl/workbook.xml",Pr(t,a,!0)&&i.workbooks.push(a)),i.workbooks.length===0){if(a="xl/workbook.bin",!Pr(t,a,!0))throw new Error("Could not find workbook");i.workbooks.push(a),s=!0}i.workbooks[0].slice(-3)=="bin"&&(s=!0);var l={},c={};if(!e.bookSheets&&!e.bookProps){if(jd=[],i.sst)try{jd=OU(Pr(t,bi(i.sst)),i.sst,e)}catch(Ce){if(e.WTF)throw Ce}e.cellStyles&&i.themes.length&&(l=IU(wi(t,i.themes[0].replace(/^\//,""),!0)||"",i.themes[0],e)),i.style&&(c=MU(Pr(t,bi(i.style)),i.style,l,e))}i.links.map(function(Ce){try{var pe=Yd(wi(t,Y1(bi(Ce))),Ce);return kU(Pr(t,bi(Ce)),pe,Ce,e)}catch{}});var u=EU(Pr(t,bi(i.workbooks[0])),i.workbooks[0],e),h={},d="";i.coreprops.length&&(d=Pr(t,bi(i.coreprops[0]),!0),d&&(h=qO(d)),i.extprops.length!==0&&(d=Pr(t,bi(i.extprops[0]),!0),d&&x$(d,h,e)));var f={};(!e.bookSheets||e.bookProps)&&i.custprops.length!==0&&(d=wi(t,bi(i.custprops[0]),!0),d&&(f=b$(d,e)));var g={};if((e.bookSheets||e.bookProps)&&(u.Sheets?o=u.Sheets.map(function(pe){return pe.name}):h.Worksheets&&h.SheetNames.length>0&&(o=h.SheetNames),e.bookProps&&(g.Props=h,g.Custprops=f),e.bookSheets&&typeof o<"u"&&(g.SheetNames=o),e.bookSheets?g.SheetNames:e.bookProps))return g;o={};var m={};e.bookDeps&&i.calcchain&&(m=DU(Pr(t,bi(i.calcchain)),i.calcchain));var p=0,S={},y,C;{var E=u.Sheets;h.Worksheets=E.length,h.SheetNames=[];for(var A=0;A!=E.length;++A)h.SheetNames[A]=E[A].name}var O=s?"bin":"xml",T=i.workbooks[0].lastIndexOf("/"),W=(i.workbooks[0].slice(0,T+1)+"_rels/"+i.workbooks[0].slice(T+1)+".rels").replace(/^\//,"");Pi(t,W)||(W="xl/_rels/workbook."+O+".rels");var I=Yd(wi(t,W,!0),W.replace(/_rels.*/,"s5s"));(i.metadata||[]).length>=1&&(e.xlmeta=NU(Pr(t,bi(i.metadata[0])),i.metadata[0],e)),(i.people||[]).length>=1&&(e.people=_3(Pr(t,bi(i.people[0])),e)),I&&(I=v8(I,u.Sheets));var Y=Pr(t,"xl/worksheets/sheet.xml",!0)?1:0;e:for(p=0;p!=h.Worksheets;++p){var z="sheet";if(I&&I[p]?(y="xl/"+I[p][1].replace(/[\/]?xl\//,""),Pi(t,y)||(y=I[p][1]),Pi(t,y)||(y=W.replace(/_rels\/.*$/,"")+I[p][1]),z=I[p][2]):(y="xl/worksheets/sheet"+(p+1-Y)+"."+O,y=y.replace(/sheet0\./,"sheet.")),C=y.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels"),e&&e.sheets!=null)switch(typeof e.sheets){case"number":if(p!=e.sheets)continue e;break;case"string":if(h.SheetNames[p].toLowerCase()!=e.sheets.toLowerCase())continue e;break;default:if(Array.isArray&&Array.isArray(e.sheets)){for(var U=!1,oe=0;oe!=e.sheets.length;++oe)typeof e.sheets[oe]=="number"&&e.sheets[oe]==p&&(U=1),typeof e.sheets[oe]=="string"&&e.sheets[oe].toLowerCase()==h.SheetNames[p].toLowerCase()&&(U=1);if(!U)continue e}}C8(t,y,C,h.SheetNames[p],p,S,o,z,e,u,l,c)}return g={Directory:i,Workbook:u,Props:h,Custprops:f,Deps:m,Sheets:o,SheetNames:h.SheetNames,Strings:jd,Styles:c,Themes:l,SSF:sn(ot)},e&&e.bookFiles&&(t.files?(g.keys=n,g.files=t.files):(g.keys=[],g.files={},t.FullPaths.forEach(function(Ce,pe){Ce=Ce.replace(/^Root Entry[\/]/,""),g.keys.push(Ce),g.files[Ce]=t.FileIndex[pe]}))),e&&e.bookVBA&&(i.vba.length>0?g.vbaraw=Pr(t,bi(i.vba[0]),!0):i.defaults&&i.defaults.bin===O3&&(g.vbaraw=Pr(t,"xl/vbaProject.bin",!0))),g}function x8(t,e){var r=e||{},n="Workbook",i=Et.find(t,n);try{if(n="/!DataSpaces/Version",i=Et.find(t,n),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);if(f4(i.content),n="/!DataSpaces/DataSpaceMap",i=Et.find(t,n),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);var s=m4(i.content);if(s.length!==1||s[0].comps.length!==1||s[0].comps[0].t!==0||s[0].name!=="StrongEncryptionDataSpace"||s[0].comps[0].v!=="EncryptedPackage")throw new Error("ECMA-376 Encrypted file bad "+n);if(n="/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace",i=Et.find(t,n),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);var o=p4(i.content);if(o.length!=1||o[0]!="StrongEncryptionTransform")throw new Error("ECMA-376 Encrypted file bad "+n);if(n="/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary",i=Et.find(t,n),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);v4(i.content)}catch{}if(n="/EncryptionInfo",i=Et.find(t,n),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);var a=C4(i.content);if(n="/EncryptedPackage",i=Et.find(t,n),!i||!i.content)throw new Error("ECMA-376 Encrypted file missing "+n);if(a[0]==4&&typeof decrypt_agile<"u")return decrypt_agile(a[1],i.content,r.password||"",r);if(a[0]==2&&typeof decrypt_std76<"u")return decrypt_std76(a[1],i.content,r.password||"",r);throw new Error("File is password-protected")}function Dx(t,e){var r="";switch((e||{}).type||"base64"){case"buffer":return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]];case"base64":r=Ci(t.slice(0,12));break;case"binary":r=t;break;case"array":return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]];default:throw new Error("Unrecognized type "+(e&&e.type||"undefined"))}return[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3),r.charCodeAt(4),r.charCodeAt(5),r.charCodeAt(6),r.charCodeAt(7)]}function y8(t,e){return Et.find(t,"EncryptedPackage")?x8(t,e):kP(t,e)}function b8(t,e){var r,n=t,i=e||{};return i.type||(i.type=yt&&Buffer.isBuffer(t)?"buffer":"base64"),r=_O(n,i),S8(r,i)}function LP(t,e){var r=0;e:for(;r<t.length;)switch(t.charCodeAt(r)){case 10:case 13:case 32:++r;break;case 60:return j1(t.slice(r),e);default:break e}return Ef.to_workbook(t,e)}function E8(t,e){var r="",n=Dx(t,e);switch(e.type){case"base64":r=Ci(t);break;case"binary":r=t;break;case"buffer":r=t.toString("binary");break;case"array":r=vc(t);break;default:throw new Error("Unrecognized type "+e.type)}return n[0]==239&&n[1]==187&&n[2]==191&&(r=Jt(r)),e.type="binary",LP(r,e)}function R8(t,e){var r=t;return e.type=="base64"&&(r=Ci(r)),r=Ua.utils.decode(1200,r.slice(2),"str"),e.type="binary",LP(r,e)}function T8(t){return t.match(/[^\x00-\x7F]/)?Nd(t):t}function gv(t,e,r,n){return n?(r.type="string",Ef.to_workbook(t,r)):Ef.to_workbook(e,r)}function Z1(t,e){cO();var r=e||{};if(typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer)return Z1(new Uint8Array(t),(r=sn(r),r.type="array",r));typeof Uint8Array<"u"&&t instanceof Uint8Array&&!r.type&&(r.type=typeof Deno<"u"?"buffer":"array");var n=t,i=[0,0,0,0],s=!1;if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),ju={},r.dateNF&&(ju.dateNF=r.dateNF),r.type||(r.type=yt&&Buffer.isBuffer(t)?"buffer":"base64"),r.type=="file"&&(r.type=yt?"buffer":"binary",n=fL(t),typeof Uint8Array<"u"&&!yt&&(r.type="array")),r.type=="string"&&(s=!0,r.type="binary",r.codepage=65001,n=T8(t)),r.type=="array"&&typeof Uint8Array<"u"&&t instanceof Uint8Array&&typeof ArrayBuffer<"u"){var o=new ArrayBuffer(3),a=new Uint8Array(o);if(a.foo="bar",!a.foo)return r=sn(r),r.type="array",Z1(hx(n),r)}switch((i=Dx(n,r))[0]){case 208:if(i[1]===207&&i[2]===17&&i[3]===224&&i[4]===161&&i[5]===177&&i[6]===26&&i[7]===225)return y8(Et.read(n,r),r);break;case 9:if(i[1]<=8)return kP(n,r);break;case 60:return j1(n,r);case 73:if(i[1]===73&&i[2]===42&&i[3]===0)throw new Error("TIFF Image File is not a spreadsheet");if(i[1]===68)return e4(n,r);break;case 84:if(i[1]===65&&i[2]===66&&i[3]===76)return JB.to_workbook(n,r);break;case 80:return i[1]===75&&i[2]<9&&i[3]<9?b8(n,r):gv(t,n,r,s);case 239:return i[3]===60?j1(n,r):gv(t,n,r,s);case 255:if(i[1]===254)return R8(n,r);if(i[1]===0&&i[2]===2&&i[3]===0)return Gd.to_workbook(n,r);break;case 0:if(i[1]===0&&(i[2]>=2&&i[3]===0||i[2]===0&&(i[3]===8||i[3]===9)))return Gd.to_workbook(n,r);break;case 3:case 131:case 139:case 140:return oT.to_workbook(n,r);case 123:if(i[1]===92&&i[2]===114&&i[3]===116)return O4.to_workbook(n,r);break;case 10:case 13:case 32:return E8(n,r);case 137:if(i[1]===80&&i[2]===78&&i[3]===71)throw new Error("PNG Image File is not a spreadsheet");break}return qB.indexOf(i[0])>-1&&i[2]<=12&&i[3]<=31?oT.to_workbook(n,r):gv(t,n,r,s)}function _8(t,e,r,n,i,s,o,a){var l=on(r),c=a.defval,u=a.raw||!Object.prototype.hasOwnProperty.call(a,"raw"),h=!0,d=i===1?[]:{};if(i!==1)if(Object.defineProperty)try{Object.defineProperty(d,"__rowNum__",{value:r,enumerable:!1})}catch{d.__rowNum__=r}else d.__rowNum__=r;if(!o||t[r])for(var f=e.s.c;f<=e.e.c;++f){var g=o?t[r][f]:t[n[f]+l];if(g===void 0||g.t===void 0){if(c===void 0)continue;s[f]!=null&&(d[s[f]]=c);continue}var m=g.v;switch(g.t){case"z":if(m==null)break;continue;case"e":m=m==0?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+g.t)}if(s[f]!=null){if(m==null)if(g.t=="e"&&m===null)d[s[f]]=null;else if(c!==void 0)d[s[f]]=c;else if(u&&m===null)d[s[f]]=null;else continue;else d[s[f]]=u&&(g.t!=="n"||g.t==="n"&&a.rawNumbers!==!1)?m:sa(g,m,a);m!=null&&(h=!1)}}return{row:d,isempty:h}}function J1(t,e){if(t==null||t["!ref"]==null)return[];var r={t:"n",v:0},n=0,i=1,s=[],o=0,a="",l={s:{r:0,c:0},e:{r:0,c:0}},c=e||{},u=c.range!=null?c.range:t["!ref"];switch(c.header===1?n=1:c.header==="A"?n=2:Array.isArray(c.header)?n=3:c.header==null&&(n=0),typeof u){case"string":l=br(u);break;case"number":l=br(t["!ref"]),l.s.r=u;break;default:l=u}n>0&&(i=0);var h=on(l.s.r),d=[],f=[],g=0,m=0,p=Array.isArray(t),S=l.s.r,y=0,C={};p&&!t[S]&&(t[S]=[]);var E=c.skipHidden&&t["!cols"]||[],A=c.skipHidden&&t["!rows"]||[];for(y=l.s.c;y<=l.e.c;++y)if(!(E[y]||{}).hidden)switch(d[y]=Br(y),r=p?t[S][y]:t[d[y]+h],n){case 1:s[y]=y-l.s.c;break;case 2:s[y]=d[y];break;case 3:s[y]=c.header[y-l.s.c];break;default:if(r==null&&(r={w:"__EMPTY",t:"s"}),a=o=sa(r,null,c),m=C[o]||0,!m)C[o]=1;else{do a=o+"_"+m++;while(C[a]);C[o]=m,C[a]=1}s[y]=a}for(S=l.s.r+i;S<=l.e.r;++S)if(!(A[S]||{}).hidden){var O=_8(t,l,S,d,n,s,p,c);(O.isempty===!1||(n===1?c.blankrows!==!1:c.blankrows))&&(f[g++]=O.row)}return f.length=g,f}var bT=/"/g;function A8(t,e,r,n,i,s,o,a){for(var l=!0,c=[],u="",h=on(r),d=e.s.c;d<=e.e.c;++d)if(n[d]){var f=a.dense?(t[r]||[])[d]:t[n[d]+h];if(f==null)u="";else if(f.v!=null){l=!1,u=""+(a.rawNumbers&&f.t=="n"?f.v:sa(f,null,a));for(var g=0,m=0;g!==u.length;++g)if((m=u.charCodeAt(g))===i||m===s||m===34||a.forceQuotes){u='"'+u.replace(bT,'""')+'"';break}u=="ID"&&(u='"ID"')}else f.f!=null&&!f.F?(l=!1,u="="+f.f,u.indexOf(",")>=0&&(u='"'+u.replace(bT,'""')+'"')):u="";c.push(u)}return a.blankrows===!1&&l?null:c.join(o)}function $P(t,e){var r=[],n=e??{};if(t==null||t["!ref"]==null)return"";var i=br(t["!ref"]),s=n.FS!==void 0?n.FS:",",o=s.charCodeAt(0),a=n.RS!==void 0?n.RS:`
  37. `,l=a.charCodeAt(0),c=new RegExp((s=="|"?"\\|":s)+"+$"),u="",h=[];n.dense=Array.isArray(t);for(var d=n.skipHidden&&t["!cols"]||[],f=n.skipHidden&&t["!rows"]||[],g=i.s.c;g<=i.e.c;++g)(d[g]||{}).hidden||(h[g]=Br(g));for(var m=0,p=i.s.r;p<=i.e.r;++p)(f[p]||{}).hidden||(u=A8(t,i,p,h,o,l,s,n),u!=null&&(n.strip&&(u=u.replace(c,"")),(u||n.blankrows!==!1)&&r.push((m++?a:"")+u)));return delete n.dense,r.join("")}function M8(t,e){e||(e={}),e.FS=" ",e.RS=`
  38. `;var r=$P(t,e);return r}function I8(t){var e="",r,n="";if(t==null||t["!ref"]==null)return[];var i=br(t["!ref"]),s="",o=[],a,l=[],c=Array.isArray(t);for(a=i.s.c;a<=i.e.c;++a)o[a]=Br(a);for(var u=i.s.r;u<=i.e.r;++u)for(s=on(u),a=i.s.c;a<=i.e.c;++a)if(e=o[a]+s,r=c?(t[u]||[])[a]:t[e],n="",r!==void 0){if(r.F!=null){if(e=r.F,!r.f)continue;n=r.f,e.indexOf(":")==-1&&(e=e+":"+e)}if(r.f!=null)n=r.f;else{if(r.t=="z")continue;if(r.t=="n"&&r.v!=null)n=""+r.v;else if(r.t=="b")n=r.v?"TRUE":"FALSE";else if(r.w!==void 0)n="'"+r.w;else{if(r.v===void 0)continue;r.t=="s"?n="'"+r.v:n=""+r.v}}l[l.length]=e+"="+n}return l}function BP(t,e,r){var n=r||{},i=+!n.skipHeader,s=t||{},o=0,a=0;if(s&&n.origin!=null)if(typeof n.origin=="number")o=n.origin;else{var l=typeof n.origin=="string"?Fn(n.origin):n.origin;o=l.r,a=l.c}var c,u={s:{c:0,r:0},e:{c:a,r:o+e.length-1+i}};if(s["!ref"]){var h=br(s["!ref"]);u.e.c=Math.max(u.e.c,h.e.c),u.e.r=Math.max(u.e.r,h.e.r),o==-1&&(o=h.e.r+1,u.e.r=o+e.length-1+i)}else o==-1&&(o=0,u.e.r=e.length-1+i);var d=n.header||[],f=0;e.forEach(function(m,p){fo(m).forEach(function(S){(f=d.indexOf(S))==-1&&(d[f=d.length]=S);var y=m[S],C="z",E="",A=nt({c:a+f,r:o+p+i});c=Af(s,A),y&&typeof y=="object"&&!(y instanceof Date)?s[A]=y:(typeof y=="number"?C="n":typeof y=="boolean"?C="b":typeof y=="string"?C="s":y instanceof Date?(C="d",n.cellDates||(C="n",y=$n(y)),E=n.dateNF||ot[14]):y===null&&n.nullError&&(C="e",y=0),c?(c.t=C,c.v=y,delete c.w,delete c.R,E&&(c.z=E)):s[A]=c={t:C,v:y},E&&(c.z=E))})}),u.e.c=Math.max(u.e.c,a+d.length-1);var g=on(o);if(i)for(f=0;f<d.length;++f)s[Br(f+a)+g]={t:"s",v:d[f]};return s["!ref"]=Rt(u),s}function O8(t,e){return BP(null,t,e)}function Af(t,e,r){if(typeof e=="string"){if(Array.isArray(t)){var n=Fn(e);return t[n.r]||(t[n.r]=[]),t[n.r][n.c]||(t[n.r][n.c]={t:"z"})}return t[e]||(t[e]={t:"z"})}return typeof e!="number"?Af(t,nt(e)):Af(t,nt({r:e,c:r||0}))}function P8(t,e){if(typeof e=="number"){if(e>=0&&t.SheetNames.length>e)return e;throw new Error("Cannot find sheet # "+e)}else if(typeof e=="string"){var r=t.SheetNames.indexOf(e);if(r>-1)return r;throw new Error("Cannot find sheet name |"+e+"|")}else throw new Error("Cannot find sheet |"+e+"|")}function kx(){return{SheetNames:[],Sheets:{}}}function Nx(t,e,r,n){var i=1;if(!r)for(;i<=65535&&t.SheetNames.indexOf(r="Sheet"+i)!=-1;++i,r=void 0);if(!r||t.SheetNames.length>=65535)throw new Error("Too many worksheets");if(n&&t.SheetNames.indexOf(r)>=0){var s=r.match(/(^.*?)(\d+)$/);i=s&&+s[2]||0;var o=s&&s[1]||r;for(++i;i<=65535&&t.SheetNames.indexOf(r=o+i)!=-1;++i);}if(pU(r),t.SheetNames.indexOf(r)>=0)throw new Error("Worksheet with name |"+r+"| already exists!");return t.SheetNames.push(r),t.Sheets[r]=e,r}function D8(t,e,r){t.Workbook||(t.Workbook={}),t.Workbook.Sheets||(t.Workbook.Sheets=[]);var n=P8(t,e);switch(t.Workbook.Sheets[n]||(t.Workbook.Sheets[n]={}),r){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+r)}t.Workbook.Sheets[n].Hidden=r}function k8(t,e){return t.z=e,t}function VP(t,e,r){return e?(t.l={Target:e},r&&(t.l.Tooltip=r)):delete t.l,t}function N8(t,e,r){return VP(t,"#"+e,r)}function H8(t,e,r){t.c||(t.c=[]),t.c.push({t:e,a:r||"SheetJS"})}function F8(t,e,r,n){for(var i=typeof e!="string"?e:br(e),s=typeof e=="string"?e:Rt(e),o=i.s.r;o<=i.e.r;++o)for(var a=i.s.c;a<=i.e.c;++a){var l=Af(t,o,a);l.t="n",l.F=s,delete l.v,o==i.s.r&&a==i.s.c&&(l.f=r,n&&(l.D=!0))}return t}var L8={encode_col:Br,encode_row:on,encode_cell:nt,encode_range:Rt,decode_col:Sx,decode_row:Cx,split_cell:XL,decode_cell:Fn,decode_range:hh,format_cell:sa,sheet_add_aoa:zO,sheet_add_json:BP,sheet_add_dom:NP,aoa_to_sheet:dh,json_to_sheet:O8,table_to_sheet:HP,table_to_book:e8,sheet_to_csv:$P,sheet_to_txt:M8,sheet_to_json:J1,sheet_to_html:QU,sheet_to_formulae:I8,sheet_to_row_object_array:J1,sheet_get_cell:Af,book_new:kx,book_append_sheet:Nx,book_set_sheet_visibility:D8,cell_set_number_format:k8,cell_set_hyperlink:VP,cell_set_internal_link:N8,cell_add_comment:H8,sheet_set_array_formula:F8,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}},Mh=function(t){return t&&t.Math===Math&&t},bn=Mh(typeof globalThis=="object"&&globalThis)||Mh(typeof window=="object"&&window)||Mh(typeof self=="object"&&self)||Mh(typeof Ig=="object"&&Ig)||Mh(typeof Ig=="object"&&Ig)||function(){return this}()||Function("return this")(),Hx={},xi=function(t){try{return!!t()}catch{return!0}},$8=xi,Ms=!$8(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),B8=xi,nw=!B8(function(){var t=function(){}.bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),V8=nw,zg=Function.prototype.call,Is=V8?zg.bind(zg):function(){return zg.apply(zg,arguments)},WP={},UP={}.propertyIsEnumerable,YP=Object.getOwnPropertyDescriptor,W8=YP&&!UP.call({1:2},1);WP.f=W8?function(e){var r=YP(this,e);return!!r&&r.enumerable}:UP;var iw=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}},zP=nw,GP=Function.prototype,Q1=GP.call,U8=zP&&GP.bind.bind(Q1,Q1),Ur=zP?U8:function(t){return function(){return Q1.apply(t,arguments)}},jP=Ur,Y8=jP({}.toString),z8=jP("".slice),Hc=function(t){return z8(Y8(t),8,-1)},G8=Ur,j8=xi,K8=Hc,mv=Object,X8=G8("".split),q8=j8(function(){return!mv("z").propertyIsEnumerable(0)})?function(t){return K8(t)==="String"?X8(t,""):mv(t)}:mv,sw=function(t){return t==null},Z8=sw,J8=TypeError,ow=function(t){if(Z8(t))throw new J8("Can't call method on "+t);return t},Q8=q8,e6=ow,aw=function(t){return Q8(e6(t))},pv=typeof document=="object"&&document.all,an=typeof pv>"u"&&pv!==void 0?function(t){return typeof t=="function"||t===pv}:function(t){return typeof t=="function"},t6=an,Co=function(t){return typeof t=="object"?t!==null:t6(t)},wv=bn,r6=an,n6=function(t){return r6(t)?t:void 0},fh=function(t,e){return arguments.length<2?n6(wv[t]):wv[t]&&wv[t][e]},i6=Ur,lw=i6({}.isPrototypeOf),Fx=typeof navigator<"u"&&String(navigator.userAgent)||"",KP=bn,vv=Fx,ET=KP.process,RT=KP.Deno,TT=ET&&ET.versions||RT&&RT.version,_T=TT&&TT.v8,ms,ap;_T&&(ms=_T.split("."),ap=ms[0]>0&&ms[0]<4?1:+(ms[0]+ms[1]));!ap&&vv&&(ms=vv.match(/Edge\/(\d+)/),(!ms||ms[1]>=74)&&(ms=vv.match(/Chrome\/(\d+)/),ms&&(ap=+ms[1])));var s6=ap,AT=s6,o6=xi,a6=bn,l6=a6.String,Lx=!!Object.getOwnPropertySymbols&&!o6(function(){var t=Symbol("symbol detection");return!l6(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&AT&&AT<41}),c6=Lx,XP=c6&&!Symbol.sham&&typeof Symbol.iterator=="symbol",u6=fh,h6=an,d6=lw,f6=XP,g6=Object,$x=f6?function(t){return typeof t=="symbol"}:function(t){var e=u6("Symbol");return h6(e)&&d6(e.prototype,g6(t))},m6=String,cw=function(t){try{return m6(t)}catch{return"Object"}},p6=an,w6=cw,v6=TypeError,eg=function(t){if(p6(t))return t;throw new v6(w6(t)+" is not a function")},C6=eg,S6=sw,uw=function(t,e){var r=t[e];return S6(r)?void 0:C6(r)},Cv=Is,Sv=an,xv=Co,x6=TypeError,y6=function(t,e){var r,n;if(e==="string"&&Sv(r=t.toString)&&!xv(n=Cv(r,t))||Sv(r=t.valueOf)&&!xv(n=Cv(r,t))||e!=="string"&&Sv(r=t.toString)&&!xv(n=Cv(r,t)))return n;throw new x6("Can't convert object to primitive value")},qP={exports:{}},MT=bn,b6=Object.defineProperty,Bx=function(t,e){try{b6(MT,t,{value:e,configurable:!0,writable:!0})}catch{MT[t]=e}return e},E6=bn,R6=Bx,IT="__core-js_shared__",OT=qP.exports=E6[IT]||R6(IT,{});(OT.versions||(OT.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 Vx=qP.exports,PT=Vx,ZP=function(t,e){return PT[t]||(PT[t]=e||{})},T6=ow,_6=Object,tg=function(t){return _6(T6(t))},A6=Ur,M6=tg,I6=A6({}.hasOwnProperty),So=Object.hasOwn||function(e,r){return I6(M6(e),r)},O6=Ur,P6=0,D6=Math.random(),k6=O6(1 .toString),JP=function(t){return"Symbol("+(t===void 0?"":t)+")_"+k6(++P6+D6,36)},N6=bn,H6=ZP,DT=So,F6=JP,L6=Lx,$6=XP,Fu=N6.Symbol,yv=H6("wks"),B6=$6?Fu.for||Fu:Fu&&Fu.withoutSetter||F6,ml=function(t){return DT(yv,t)||(yv[t]=L6&&DT(Fu,t)?Fu[t]:B6("Symbol."+t)),yv[t]},V6=Is,kT=Co,NT=$x,W6=uw,U6=y6,Y6=ml,z6=TypeError,G6=Y6("toPrimitive"),j6=function(t,e){if(!kT(t)||NT(t))return t;var r=W6(t,G6),n;if(r){if(e===void 0&&(e="default"),n=V6(r,t,e),!kT(n)||NT(n))return n;throw new z6("Can't convert object to primitive value")}return e===void 0&&(e="number"),U6(t,e)},K6=j6,X6=$x,QP=function(t){var e=K6(t,"string");return X6(e)?e:e+""},q6=bn,HT=Co,eS=q6.document,Z6=HT(eS)&&HT(eS.createElement),Wx=function(t){return Z6?eS.createElement(t):{}},J6=Ms,Q6=xi,e5=Wx,eD=!J6&&!Q6(function(){return Object.defineProperty(e5("div"),"a",{get:function(){return 7}}).a!==7}),t5=Ms,r5=Is,n5=WP,i5=iw,s5=aw,o5=QP,a5=So,l5=eD,FT=Object.getOwnPropertyDescriptor;Hx.f=t5?FT:function(e,r){if(e=s5(e),r=o5(r),l5)try{return FT(e,r)}catch{}if(a5(e,r))return i5(!r5(n5.f,e,r),e[r])};var pl={},c5=Ms,u5=xi,tD=c5&&u5(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),h5=Co,d5=String,f5=TypeError,ua=function(t){if(h5(t))return t;throw new f5(d5(t)+" is not an object")},g5=Ms,m5=eD,p5=tD,Gg=ua,LT=QP,w5=TypeError,bv=Object.defineProperty,v5=Object.getOwnPropertyDescriptor,Ev="enumerable",Rv="configurable",Tv="writable";pl.f=g5?p5?function(e,r,n){if(Gg(e),r=LT(r),Gg(n),typeof e=="function"&&r==="prototype"&&"value"in n&&Tv in n&&!n[Tv]){var i=v5(e,r);i&&i[Tv]&&(e[r]=n.value,n={configurable:Rv in n?n[Rv]:i[Rv],enumerable:Ev in n?n[Ev]:i[Ev],writable:!1})}return bv(e,r,n)}:bv:function(e,r,n){if(Gg(e),r=LT(r),Gg(n),m5)try{return bv(e,r,n)}catch{}if("get"in n||"set"in n)throw new w5("Accessors not supported");return"value"in n&&(e[r]=n.value),e};var C5=Ms,S5=pl,x5=iw,rg=C5?function(t,e,r){return S5.f(t,e,x5(1,r))}:function(t,e,r){return t[e]=r,t},rD={exports:{}},tS=Ms,y5=So,nD=Function.prototype,b5=tS&&Object.getOwnPropertyDescriptor,Ux=y5(nD,"name"),E5=Ux&&function(){}.name==="something",R5=Ux&&(!tS||tS&&b5(nD,"name").configurable),T5={EXISTS:Ux,PROPER:E5,CONFIGURABLE:R5},_5=Ur,A5=an,rS=Vx,M5=_5(Function.toString);A5(rS.inspectSource)||(rS.inspectSource=function(t){return M5(t)});var I5=rS.inspectSource,O5=bn,P5=an,$T=O5.WeakMap,D5=P5($T)&&/native code/.test(String($T)),k5=ZP,N5=JP,BT=k5("keys"),iD=function(t){return BT[t]||(BT[t]=N5(t))},Yx={},H5=D5,sD=bn,F5=Co,L5=rg,_v=So,Av=Vx,$5=iD,B5=Yx,VT="Object already initialized",nS=sD.TypeError,V5=sD.WeakMap,lp,Mf,cp,W5=function(t){return cp(t)?Mf(t):lp(t,{})},U5=function(t){return function(e){var r;if(!F5(e)||(r=Mf(e)).type!==t)throw new nS("Incompatible receiver, "+t+" required");return r}};if(H5||Av.state){var Ns=Av.state||(Av.state=new V5);Ns.get=Ns.get,Ns.has=Ns.has,Ns.set=Ns.set,lp=function(t,e){if(Ns.has(t))throw new nS(VT);return e.facade=t,Ns.set(t,e),e},Mf=function(t){return Ns.get(t)||{}},cp=function(t){return Ns.has(t)}}else{var Gc=$5("state");B5[Gc]=!0,lp=function(t,e){if(_v(t,Gc))throw new nS(VT);return e.facade=t,L5(t,Gc,e),e},Mf=function(t){return _v(t,Gc)?t[Gc]:{}},cp=function(t){return _v(t,Gc)}}var Y5={set:lp,get:Mf,has:cp,enforce:W5,getterFor:U5},zx=Ur,z5=xi,G5=an,jg=So,iS=Ms,j5=T5.CONFIGURABLE,K5=I5,oD=Y5,X5=oD.enforce,q5=oD.get,WT=String,Em=Object.defineProperty,Z5=zx("".slice),J5=zx("".replace),Q5=zx([].join),e9=iS&&!z5(function(){return Em(function(){},"length",{value:8}).length!==8}),t9=String(String).split("String"),r9=rD.exports=function(t,e,r){Z5(WT(e),0,7)==="Symbol("&&(e="["+J5(WT(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!jg(t,"name")||j5&&t.name!==e)&&(iS?Em(t,"name",{value:e,configurable:!0}):t.name=e),e9&&r&&jg(r,"arity")&&t.length!==r.arity&&Em(t,"length",{value:r.arity});try{r&&jg(r,"constructor")&&r.constructor?iS&&Em(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var n=X5(t);return jg(n,"source")||(n.source=Q5(t9,typeof e=="string"?e:"")),t};Function.prototype.toString=r9(function(){return G5(this)&&q5(this).source||K5(this)},"toString");var n9=rD.exports,i9=an,s9=pl,o9=n9,a9=Bx,l9=function(t,e,r,n){n||(n={});var i=n.enumerable,s=n.name!==void 0?n.name:e;if(i9(r)&&o9(r,s,n),n.global)i?t[e]=r:a9(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch{}i?t[e]=r:s9.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},aD={},c9=Math.ceil,u9=Math.floor,h9=Math.trunc||function(e){var r=+e;return(r>0?u9:c9)(r)},d9=h9,hw=function(t){var e=+t;return e!==e||e===0?0:d9(e)},f9=hw,g9=Math.max,m9=Math.min,p9=function(t,e){var r=f9(t);return r<0?g9(r+e,0):m9(r,e)},w9=hw,v9=Math.min,C9=function(t){var e=w9(t);return e>0?v9(e,9007199254740991):0},S9=C9,ng=function(t){return S9(t.length)},x9=aw,y9=p9,b9=ng,UT=function(t){return function(e,r,n){var i=x9(e),s=b9(i);if(s===0)return!t&&-1;var o=y9(n,s),a;if(t&&r!==r){for(;s>o;)if(a=i[o++],a!==a)return!0}else for(;s>o;o++)if((t||o in i)&&i[o]===r)return t||o||0;return!t&&-1}},E9={includes:UT(!0),indexOf:UT(!1)},R9=Ur,Mv=So,T9=aw,_9=E9.indexOf,A9=Yx,YT=R9([].push),lD=function(t,e){var r=T9(t),n=0,i=[],s;for(s in r)!Mv(A9,s)&&Mv(r,s)&&YT(i,s);for(;e.length>n;)Mv(r,s=e[n++])&&(~_9(i,s)||YT(i,s));return i},Gx=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],M9=lD,I9=Gx,O9=I9.concat("length","prototype");aD.f=Object.getOwnPropertyNames||function(e){return M9(e,O9)};var cD={};cD.f=Object.getOwnPropertySymbols;var P9=fh,D9=Ur,k9=aD,N9=cD,H9=ua,F9=D9([].concat),L9=P9("Reflect","ownKeys")||function(e){var r=k9.f(H9(e)),n=N9.f;return n?F9(r,n(e)):r},zT=So,$9=L9,B9=Hx,V9=pl,uD=function(t,e,r){for(var n=$9(e),i=V9.f,s=B9.f,o=0;o<n.length;o++){var a=n[o];!zT(t,a)&&!(r&&zT(r,a))&&i(t,a,s(e,a))}},W9=xi,U9=an,Y9=/#|\.prototype\./,ig=function(t,e){var r=G9[z9(t)];return r===K9?!0:r===j9?!1:U9(e)?W9(e):!!e},z9=ig.normalize=function(t){return String(t).replace(Y9,".").toLowerCase()},G9=ig.data={},j9=ig.NATIVE="N",K9=ig.POLYFILL="P",X9=ig,Kg=bn,q9=Hx.f,Z9=rg,J9=l9,Q9=Bx,e7=uD,t7=X9,En=function(t,e){var r=t.target,n=t.global,i=t.stat,s,o,a,l,c,u;if(n?o=Kg:i?o=Kg[r]||Q9(r,{}):o=Kg[r]&&Kg[r].prototype,o)for(a in e){if(c=e[a],t.dontCallGetSet?(u=q9(o,a),l=u&&u.value):l=o[a],s=t7(n?a:r+(i?".":"#")+a,t.forced),!s&&l!==void 0){if(typeof c==typeof l)continue;e7(c,l)}(t.sham||l&&l.sham)&&Z9(c,"sham",!0),J9(o,a,c,t)}},r7=nw,hD=Function.prototype,GT=hD.apply,jT=hD.call,dw=typeof Reflect=="object"&&Reflect.apply||(r7?jT.bind(GT):function(){return jT.apply(GT,arguments)}),n7=Ur,i7=eg,dD=function(t,e,r){try{return n7(i7(Object.getOwnPropertyDescriptor(t,e)[r]))}catch{}},s7=Co,o7=function(t){return s7(t)||t===null},a7=o7,l7=String,c7=TypeError,u7=function(t){if(a7(t))return t;throw new c7("Can't set "+l7(t)+" as a prototype")},h7=dD,d7=Co,f7=ow,g7=u7,fD=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,e={},r;try{r=h7(Object.prototype,"__proto__","set"),r(e,[]),t=e instanceof Array}catch{}return function(i,s){return f7(i),g7(s),d7(i)&&(t?r(i,s):i.__proto__=s),i}}():void 0),m7=pl.f,p7=function(t,e,r){r in t||m7(t,r,{configurable:!0,get:function(){return e[r]},set:function(n){e[r]=n}})},w7=an,v7=Co,KT=fD,C7=function(t,e,r){var n,i;return KT&&w7(n=e.constructor)&&n!==r&&v7(i=n.prototype)&&i!==r.prototype&&KT(t,i),t},S7=ml,x7=S7("toStringTag"),gD={};gD[x7]="z";var y7=String(gD)==="[object z]",b7=y7,E7=an,Rm=Hc,R7=ml,T7=R7("toStringTag"),_7=Object,A7=Rm(function(){return arguments}())==="Arguments",M7=function(t,e){try{return t[e]}catch{}},mD=b7?Rm:function(t){var e,r,n;return t===void 0?"Undefined":t===null?"Null":typeof(r=M7(e=_7(t),T7))=="string"?r:A7?Rm(e):(n=Rm(e))==="Object"&&E7(e.callee)?"Arguments":n},I7=mD,O7=String,jx=function(t){if(I7(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return O7(t)},P7=jx,D7=function(t,e){return t===void 0?arguments.length<2?"":e:P7(t)},k7=Co,N7=rg,H7=function(t,e){k7(e)&&"cause"in e&&N7(t,"cause",e.cause)},F7=Ur,pD=Error,L7=F7("".replace),$7=function(t){return String(new pD(t).stack)}("zxcasd"),wD=/\n\s*at [^:]*:[^\n]*/,B7=wD.test($7),V7=function(t,e){if(B7&&typeof t=="string"&&!pD.prepareStackTrace)for(;e--;)t=L7(t,wD,"");return t},W7=xi,U7=iw,Y7=!W7(function(){var t=new Error("a");return"stack"in t?(Object.defineProperty(t,"stack",U7(1,7)),t.stack!==7):!0}),z7=rg,G7=V7,j7=Y7,XT=Error.captureStackTrace,K7=function(t,e,r,n){j7&&(XT?XT(t,e):z7(t,"stack",G7(r,n)))},qT=fh,X7=So,ZT=rg,q7=lw,JT=fD,QT=uD,e_=p7,Z7=C7,J7=D7,Q7=H7,eY=K7,tY=Ms,rY=function(t,e,r,n){var i="stackTraceLimit",s=n?2:1,o=t.split("."),a=o[o.length-1],l=qT.apply(null,o);if(l){var c=l.prototype;if(X7(c,"cause")&&delete c.cause,!r)return l;var u=qT("Error"),h=e(function(d,f){var g=J7(n?f:d,void 0),m=n?new l(d):new l;return g!==void 0&&ZT(m,"message",g),eY(m,h,m.stack,2),this&&q7(c,this)&&Z7(m,this,h),arguments.length>s&&Q7(m,arguments[s]),m});h.prototype=c,a!=="Error"?JT?JT(h,u):QT(h,u,{name:!0}):tY&&i in l&&(e_(h,l,i),e_(h,l,"prepareStackTrace")),QT(h,l);try{c.name!==a&&ZT(c,"name",a),c.constructor=h}catch{}return h}},vD=En,nY=bn,xo=dw,CD=rY,sS="WebAssembly",t_=nY[sS],up=new Error("e",{cause:7}).cause!==7,Fc=function(t,e){var r={};r[t]=CD(t,e,up),vD({global:!0,constructor:!0,arity:1,forced:up},r)},Kx=function(t,e){if(t_&&t_[t]){var r={};r[t]=CD(sS+"."+t,e,up),vD({target:sS,stat:!0,constructor:!0,arity:1,forced:up},r)}};Fc("Error",function(t){return function(r){return xo(t,this,arguments)}});Fc("EvalError",function(t){return function(r){return xo(t,this,arguments)}});Fc("RangeError",function(t){return function(r){return xo(t,this,arguments)}});Fc("ReferenceError",function(t){return function(r){return xo(t,this,arguments)}});Fc("SyntaxError",function(t){return function(r){return xo(t,this,arguments)}});Fc("TypeError",function(t){return function(r){return xo(t,this,arguments)}});Fc("URIError",function(t){return function(r){return xo(t,this,arguments)}});Kx("CompileError",function(t){return function(r){return xo(t,this,arguments)}});Kx("LinkError",function(t){return function(r){return xo(t,this,arguments)}});Kx("RuntimeError",function(t){return function(r){return xo(t,this,arguments)}});var iY=Hc,SD=Array.isArray||function(e){return iY(e)==="Array"},sY=Ms,oY=SD,aY=TypeError,lY=Object.getOwnPropertyDescriptor,cY=sY&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}(),xD=cY?function(t,e){if(oY(t)&&!lY(t,"length").writable)throw new aY("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e},uY=TypeError,hY=9007199254740991,yD=function(t){if(t>hY)throw uY("Maximum allowed index exceeded");return t},dY=En,fY=tg,gY=ng,mY=xD,pY=yD,wY=xi,vY=wY(function(){return[].push.call({length:4294967296},1)!==4294967297}),CY=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}},SY=vY||!CY();dY({target:"Array",proto:!0,arity:1,forced:SY},{push:function(e){var r=fY(this),n=gY(r),i=arguments.length;pY(n+i);for(var s=0;s<i;s++)r[n]=arguments[s],n++;return mY(r,n),n}});var Iv=Ur,Xg=Set.prototype,yo={Set,add:Iv(Xg.add),has:Iv(Xg.has),remove:Iv(Xg.delete),proto:Xg},xY=yo.has,Lc=function(t){return xY(t),t},yY=Is,$c=function(t,e,r){for(var n=r?t:t.iterator,i=t.next,s,o;!(s=yY(i,n)).done;)if(o=e(s.value),o!==void 0)return o},bD=Ur,bY=$c,ED=yo,EY=ED.Set,RD=ED.proto,RY=bD(RD.forEach),TD=bD(RD.keys),TY=TD(new EY).next,sg=function(t,e,r){return r?bY({iterator:TD(t),next:TY},e):RY(t,e)},_D=yo,_Y=sg,AY=_D.Set,MY=_D.add,Xx=function(t){var e=new AY;return _Y(t,function(r){MY(e,r)}),e},IY=dD,OY=yo,og=IY(OY.proto,"size","get")||function(t){return t.size},PY=function(t){return{iterator:t,next:t.next,done:!1}},r_=eg,AD=ua,n_=Is,DY=hw,kY=PY,i_="Invalid size",NY=RangeError,HY=TypeError,FY=Math.max,MD=function(t,e){this.set=t,this.size=FY(e,0),this.has=r_(t.has),this.keys=r_(t.keys)};MD.prototype={getIterator:function(){return kY(AD(n_(this.keys,this.set)))},includes:function(t){return n_(this.has,this.set,t)}};var Bc=function(t){AD(t);var e=+t.size;if(e!==e)throw new HY(i_);var r=DY(e);if(r<0)throw new NY(i_);return new MD(t,r)},LY=Lc,ID=yo,$Y=Xx,BY=og,VY=Bc,WY=sg,UY=$c,YY=ID.has,s_=ID.remove,zY=function(e){var r=LY(this),n=VY(e),i=$Y(r);return BY(r)<=n.size?WY(r,function(s){n.includes(s)&&s_(i,s)}):UY(n.getIterator(),function(s){YY(r,s)&&s_(i,s)}),i},GY=fh,o_=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},Vc=function(t){var e=GY("Set");try{new e()[t](o_(0));try{return new e()[t](o_(-1)),!1}catch{return!0}}catch{return!1}},jY=En,KY=zY,XY=Vc;jY({target:"Set",proto:!0,real:!0,forced:!XY("difference")},{difference:KY});var qY=Lc,qx=yo,ZY=og,JY=Bc,QY=sg,ez=$c,tz=qx.Set,a_=qx.add,rz=qx.has,nz=function(e){var r=qY(this),n=JY(e),i=new tz;return ZY(r)>n.size?ez(n.getIterator(),function(s){rz(r,s)&&a_(i,s)}):QY(r,function(s){n.includes(s)&&a_(i,s)}),i},iz=En,sz=xi,oz=nz,az=Vc,lz=!az("intersection")||sz(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});iz({target:"Set",proto:!0,real:!0,forced:lz},{intersection:oz});var cz=Is,l_=ua,uz=uw,Zx=function(t,e,r){var n,i;l_(t);try{if(n=uz(t,"return"),!n){if(e==="throw")throw r;return r}n=cz(n,t)}catch(s){i=!0,n=s}if(e==="throw")throw r;if(i)throw n;return l_(n),r},hz=Lc,dz=yo.has,fz=og,gz=Bc,mz=sg,pz=$c,wz=Zx,vz=function(e){var r=hz(this),n=gz(e);if(fz(r)<=n.size)return mz(r,function(s){if(n.includes(s))return!1},!0)!==!1;var i=n.getIterator();return pz(i,function(s){if(dz(r,s))return wz(i,"normal",!1)})!==!1},Cz=En,Sz=vz,xz=Vc;Cz({target:"Set",proto:!0,real:!0,forced:!xz("isDisjointFrom")},{isDisjointFrom:Sz});var yz=Lc,bz=og,Ez=sg,Rz=Bc,Tz=function(e){var r=yz(this),n=Rz(e);return bz(r)>n.size?!1:Ez(r,function(i){if(!n.includes(i))return!1},!0)!==!1},_z=En,Az=Tz,Mz=Vc;_z({target:"Set",proto:!0,real:!0,forced:!Mz("isSubsetOf")},{isSubsetOf:Az});var Iz=Lc,Oz=yo.has,Pz=og,Dz=Bc,kz=$c,Nz=Zx,Hz=function(e){var r=Iz(this),n=Dz(e);if(Pz(r)<n.size)return!1;var i=n.getIterator();return kz(i,function(s){if(!Oz(r,s))return Nz(i,"normal",!1)})!==!1},Fz=En,Lz=Hz,$z=Vc;Fz({target:"Set",proto:!0,real:!0,forced:!$z("isSupersetOf")},{isSupersetOf:Lz});var Bz=Lc,Jx=yo,Vz=Xx,Wz=Bc,Uz=$c,Yz=Jx.add,zz=Jx.has,Gz=Jx.remove,jz=function(e){var r=Bz(this),n=Wz(e).getIterator(),i=Vz(r);return Uz(n,function(s){zz(r,s)?Gz(i,s):Yz(i,s)}),i},Kz=En,Xz=jz,qz=Vc;Kz({target:"Set",proto:!0,real:!0,forced:!qz("symmetricDifference")},{symmetricDifference:Xz});var Zz=Lc,Jz=yo.add,Qz=Xx,eG=Bc,tG=$c,rG=function(e){var r=Zz(this),n=eG(e).getIterator(),i=Qz(r);return tG(n,function(s){Jz(i,s)}),i},nG=En,iG=rG,sG=Vc;nG({target:"Set",proto:!0,real:!0,forced:!sG("union")},{union:iG});var oG=Hc,aG=Ur,lG=function(t){if(oG(t)==="Function")return aG(t)},c_=lG,cG=eg,uG=nw,hG=c_(c_.bind),OD=function(t,e){return cG(t),e===void 0?t:uG?hG(t,e):function(){return t.apply(e,arguments)}},dG=fh,PD=dG("document","documentElement"),fG=Ur,Qx=fG([].slice),gG=TypeError,DD=function(t,e){if(t<e)throw new gG("Not enough arguments");return t},mG=Fx,pG=/(?:ipad|iphone|ipod).*applewebkit/i.test(mG),wG=bn,vG=Hc,CG=vG(wG.process)==="process",vi=bn,SG=dw,xG=OD,u_=an,yG=So,kD=xi,h_=PD,bG=Qx,d_=Wx,EG=DD,RG=pG,TG=CG,oS=vi.setImmediate,aS=vi.clearImmediate,_G=vi.process,Ov=vi.Dispatch,AG=vi.Function,f_=vi.MessageChannel,MG=vi.String,Pv=0,qd={},g_="onreadystatechange",If,xl,Dv,kv;kD(function(){If=vi.location});var ey=function(t){if(yG(qd,t)){var e=qd[t];delete qd[t],e()}},Nv=function(t){return function(){ey(t)}},m_=function(t){ey(t.data)},p_=function(t){vi.postMessage(MG(t),If.protocol+"//"+If.host)};(!oS||!aS)&&(oS=function(e){EG(arguments.length,1);var r=u_(e)?e:AG(e),n=bG(arguments,1);return qd[++Pv]=function(){SG(r,void 0,n)},xl(Pv),Pv},aS=function(e){delete qd[e]},TG?xl=function(t){_G.nextTick(Nv(t))}:Ov&&Ov.now?xl=function(t){Ov.now(Nv(t))}:f_&&!RG?(Dv=new f_,kv=Dv.port2,Dv.port1.onmessage=m_,xl=xG(kv.postMessage,kv)):vi.addEventListener&&u_(vi.postMessage)&&!vi.importScripts&&If&&If.protocol!=="file:"&&!kD(p_)?(xl=p_,vi.addEventListener("message",m_,!1)):g_ in d_("script")?xl=function(t){h_.appendChild(d_("script"))[g_]=function(){h_.removeChild(this),ey(t)}}:xl=function(t){setTimeout(Nv(t),0)});var ND={set:oS,clear:aS},IG=En,OG=bn,w_=ND.clear;IG({global:!0,bind:!0,enumerable:!0,forced:OG.clearImmediate!==w_},{clearImmediate:w_});var PG=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",HD=bn,DG=dw,kG=an,NG=PG,HG=Fx,FG=Qx,LG=DD,$G=HD.Function,BG=/MSIE .\./.test(HG)||NG&&function(){var t=HD.Bun.version.split(".");return t.length<3||t[0]==="0"&&(t[1]<3||t[1]==="3"&&t[2]==="0")}(),VG=function(t,e){var r=e?2:1;return BG?function(n,i){var s=LG(arguments.length,1)>r,o=kG(n)?n:$G(n),a=s?FG(arguments,r):[],l=s?function(){DG(o,this,a)}:o;return e?t(l,i):t(l)}:t},WG=En,FD=bn,v_=ND.set,UG=VG,C_=FD.setImmediate?UG(v_,!1):v_;WG({global:!0,bind:!0,enumerable:!0,forced:FD.setImmediate!==C_},{setImmediate:C_});/*! @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 za(t){"@babel/helpers - typeof";return za=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},za(t)}function lS(t,e){return lS=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},lS(t,e)}function YG(){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 Tm(t,e,r){return YG()?Tm=Reflect.construct:Tm=function(i,s,o){var a=[null];a.push.apply(a,s);var l=Function.bind.apply(i,a),c=new l;return o&&lS(c,o.prototype),c},Tm.apply(null,arguments)}function as(t){return zG(t)||GG(t)||jG(t)||KG()}function zG(t){if(Array.isArray(t))return cS(t)}function GG(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function jG(t,e){if(t){if(typeof t=="string")return cS(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cS(t,e)}}function cS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function KG(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
  39. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var XG=Object.hasOwnProperty,S_=Object.setPrototypeOf,qG=Object.isFrozen,ZG=Object.getPrototypeOf,JG=Object.getOwnPropertyDescriptor,Bn=Object.freeze,Yi=Object.seal,QG=Object.create,LD=typeof Reflect<"u"&&Reflect,hp=LD.apply,uS=LD.construct;hp||(hp=function(e,r,n){return e.apply(r,n)});Bn||(Bn=function(e){return e});Yi||(Yi=function(e){return e});uS||(uS=function(e,r){return Tm(e,as(r))});var ej=zi(Array.prototype.forEach),x_=zi(Array.prototype.pop),Ih=zi(Array.prototype.push),_m=zi(String.prototype.toLowerCase),Hv=zi(String.prototype.toString),y_=zi(String.prototype.match),Zi=zi(String.prototype.replace),tj=zi(String.prototype.indexOf),rj=zi(String.prototype.trim),tn=zi(RegExp.prototype.test),Fv=nj(TypeError);function zi(t){return function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return hp(t,e,n)}}function nj(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return uS(t,r)}}function gt(t,e,r){var n;r=(n=r)!==null&&n!==void 0?n:_m,S_&&S_(t,null);for(var i=e.length;i--;){var s=e[i];if(typeof s=="string"){var o=r(s);o!==s&&(qG(e)||(e[i]=o),s=o)}t[s]=!0}return t}function yl(t){var e=QG(null),r;for(r in t)hp(XG,t,[r])===!0&&(e[r]=t[r]);return e}function qg(t,e){for(;t!==null;){var r=JG(t,e);if(r){if(r.get)return zi(r.get);if(typeof r.value=="function")return zi(r.value)}t=ZG(t)}function n(i){return console.warn("fallback value for",i),null}return n}var b_=Bn(["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"]),Lv=Bn(["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"]),$v=Bn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ij=Bn(["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"]),Bv=Bn(["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"]),sj=Bn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),E_=Bn(["#text"]),R_=Bn(["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"]),Vv=Bn(["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"]),T_=Bn(["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"]),Zg=Bn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),oj=Yi(/\{\{[\w\W]*|[\w\W]*\}\}/gm),aj=Yi(/<%[\w\W]*|[\w\W]*%>/gm),lj=Yi(/\${[\w\W]*}/gm),cj=Yi(/^data-[\-\w.\u00B7-\uFFFF]/),uj=Yi(/^aria-[\-\w]+$/),hj=Yi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),dj=Yi(/^(?:\w+script|data):/i),fj=Yi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),gj=Yi(/^html$/i),mj=Yi(/^[a-z][.\w]*(-[.\w]+)+$/i),pj=function(){return typeof window>"u"?null:window},wj=function(e,r){if(za(e)!=="object"||typeof e.createPolicy!="function")return null;var n=null,i="data-tt-policy-suffix";r.currentScript&&r.currentScript.hasAttribute(i)&&(n=r.currentScript.getAttribute(i));var s="dompurify"+(n?"#"+n:"");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 $D(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pj(),e=function(H){return $D(H)};if(e.version="2.5.5",e.removed=[],!t||!t.document||t.document.nodeType!==9)return e.isSupported=!1,e;var r=t.document,n=t.document,i=t.DocumentFragment,s=t.HTMLTemplateElement,o=t.Node,a=t.Element,l=t.NodeFilter,c=t.NamedNodeMap,u=c===void 0?t.NamedNodeMap||t.MozNamedAttrMap:c,h=t.HTMLFormElement,d=t.DOMParser,f=t.trustedTypes,g=a.prototype,m=qg(g,"cloneNode"),p=qg(g,"nextSibling"),S=qg(g,"childNodes"),y=qg(g,"parentNode");if(typeof s=="function"){var C=n.createElement("template");C.content&&C.content.ownerDocument&&(n=C.content.ownerDocument)}var E=wj(f,r),A=E?E.createHTML(""):"",O=n,T=O.implementation,W=O.createNodeIterator,I=O.createDocumentFragment,Y=O.getElementsByTagName,z=r.importNode,U={};try{U=yl(n).documentMode?n.documentMode:{}}catch{}var oe={};e.isSupported=typeof y=="function"&&T&&T.createHTMLDocument!==void 0&&U!==9;var Ce=oj,pe=aj,Te=lj,Se=cj,Ae=uj,q=dj,Oe=fj,v=mj,w=hj,x=null,R=gt({},[].concat(as(b_),as(Lv),as($v),as(Bv),as(E_))),b=null,B=gt({},[].concat(as(R_),as(Vv),as(T_),as(Zg))),X=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}})),ne=null,fe=null,le=!0,we=!0,N=!1,Fe=!0,ie=!1,Be=!0,Ie=!1,xe=!1,Ye=!1,Ve=!1,M=!1,D=!1,G=!0,re=!1,K="user-content-",se=!0,J=!1,Z={},ee=null,te=gt({},["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"]),Q=null,ye=gt({},["audio","video","img","source","image","track"]),Me=null,Pe=gt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Je="http://www.w3.org/1998/Math/MathML",vt="http://www.w3.org/2000/svg",st="http://www.w3.org/1999/xhtml",qe=st,Ct=!1,Gt=null,Ro=gt({},[Je,vt,st],Hv),ii,Sl=["application/xhtml+xml","text/html"],en="text/html",jt,Er=null,Nr=n.createElement("form"),Ut=function(H){return H instanceof RegExp||H instanceof Function},Rh=function(H){Er&&Er===H||((!H||za(H)!=="object")&&(H={}),H=yl(H),ii=Sl.indexOf(H.PARSER_MEDIA_TYPE)===-1?ii=en:ii=H.PARSER_MEDIA_TYPE,jt=ii==="application/xhtml+xml"?Hv:_m,x="ALLOWED_TAGS"in H?gt({},H.ALLOWED_TAGS,jt):R,b="ALLOWED_ATTR"in H?gt({},H.ALLOWED_ATTR,jt):B,Gt="ALLOWED_NAMESPACES"in H?gt({},H.ALLOWED_NAMESPACES,Hv):Ro,Me="ADD_URI_SAFE_ATTR"in H?gt(yl(Pe),H.ADD_URI_SAFE_ATTR,jt):Pe,Q="ADD_DATA_URI_TAGS"in H?gt(yl(ye),H.ADD_DATA_URI_TAGS,jt):ye,ee="FORBID_CONTENTS"in H?gt({},H.FORBID_CONTENTS,jt):te,ne="FORBID_TAGS"in H?gt({},H.FORBID_TAGS,jt):{},fe="FORBID_ATTR"in H?gt({},H.FORBID_ATTR,jt):{},Z="USE_PROFILES"in H?H.USE_PROFILES:!1,le=H.ALLOW_ARIA_ATTR!==!1,we=H.ALLOW_DATA_ATTR!==!1,N=H.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=H.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ie=H.SAFE_FOR_TEMPLATES||!1,Be=H.SAFE_FOR_XML!==!1,Ie=H.WHOLE_DOCUMENT||!1,Ve=H.RETURN_DOM||!1,M=H.RETURN_DOM_FRAGMENT||!1,D=H.RETURN_TRUSTED_TYPE||!1,Ye=H.FORCE_BODY||!1,G=H.SANITIZE_DOM!==!1,re=H.SANITIZE_NAMED_PROPS||!1,se=H.KEEP_CONTENT!==!1,J=H.IN_PLACE||!1,w=H.ALLOWED_URI_REGEXP||w,qe=H.NAMESPACE||st,X=H.CUSTOM_ELEMENT_HANDLING||{},H.CUSTOM_ELEMENT_HANDLING&&Ut(H.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(X.tagNameCheck=H.CUSTOM_ELEMENT_HANDLING.tagNameCheck),H.CUSTOM_ELEMENT_HANDLING&&Ut(H.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(X.attributeNameCheck=H.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),H.CUSTOM_ELEMENT_HANDLING&&typeof H.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=H.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ie&&(we=!1),M&&(Ve=!0),Z&&(x=gt({},as(E_)),b=[],Z.html===!0&&(gt(x,b_),gt(b,R_)),Z.svg===!0&&(gt(x,Lv),gt(b,Vv),gt(b,Zg)),Z.svgFilters===!0&&(gt(x,$v),gt(b,Vv),gt(b,Zg)),Z.mathMl===!0&&(gt(x,Bv),gt(b,T_),gt(b,Zg))),H.ADD_TAGS&&(x===R&&(x=yl(x)),gt(x,H.ADD_TAGS,jt)),H.ADD_ATTR&&(b===B&&(b=yl(b)),gt(b,H.ADD_ATTR,jt)),H.ADD_URI_SAFE_ATTR&&gt(Me,H.ADD_URI_SAFE_ATTR,jt),H.FORBID_CONTENTS&&(ee===te&&(ee=yl(ee)),gt(ee,H.FORBID_CONTENTS,jt)),se&&(x["#text"]=!0),Ie&&gt(x,["html","head","body"]),x.table&&(gt(x,["tbody"]),delete ne.tbody),Bn&&Bn(H),Er=H)},Ag=gt({},["mi","mo","mn","ms","mtext"]),Mg=gt({},["foreignobject","annotation-xml"]),rv=gt({},["title","style","font","a","script"]),va=gt({},Lv);gt(va,$v),gt(va,ij);var Th=gt({},Bv);gt(Th,sj);var nv=function(H){var ce=y(H);(!ce||!ce.tagName)&&(ce={namespaceURI:qe,tagName:"template"});var ae=_m(H.tagName),Ee=_m(ce.tagName);return Gt[H.namespaceURI]?H.namespaceURI===vt?ce.namespaceURI===st?ae==="svg":ce.namespaceURI===Je?ae==="svg"&&(Ee==="annotation-xml"||Ag[Ee]):!!va[ae]:H.namespaceURI===Je?ce.namespaceURI===st?ae==="math":ce.namespaceURI===vt?ae==="math"&&Mg[Ee]:!!Th[ae]:H.namespaceURI===st?ce.namespaceURI===vt&&!Mg[Ee]||ce.namespaceURI===Je&&!Ag[Ee]?!1:!Th[ae]&&(rv[ae]||!va[ae]):!!(ii==="application/xhtml+xml"&&Gt[H.namespaceURI]):!1},Yn=function(H){Ih(e.removed,{element:H});try{H.parentNode.removeChild(H)}catch{try{H.outerHTML=A}catch{H.remove()}}},_=function(H,ce){try{Ih(e.removed,{attribute:ce.getAttributeNode(H),from:ce})}catch{Ih(e.removed,{attribute:null,from:ce})}if(ce.removeAttribute(H),H==="is"&&!b[H])if(Ve||M)try{Yn(ce)}catch{}else try{ce.setAttribute(H,"")}catch{}},F=function(H){var ce,ae;if(Ye)H="<remove></remove>"+H;else{var Ee=y_(H,/^[\r\n\t ]+/);ae=Ee&&Ee[0]}ii==="application/xhtml+xml"&&qe===st&&(H='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+H+"</body></html>");var Ge=E?E.createHTML(H):H;if(qe===st)try{ce=new d().parseFromString(Ge,ii)}catch{}if(!ce||!ce.documentElement){ce=T.createDocument(qe,"template",null);try{ce.documentElement.innerHTML=Ct?A:Ge}catch{}}var ft=ce.body||ce.documentElement;return H&&ae&&ft.insertBefore(n.createTextNode(ae),ft.childNodes[0]||null),qe===st?Y.call(ce,Ie?"html":"body")[0]:Ie?ce.documentElement:ft},P=function(H){return W.call(H.ownerDocument||H,H,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null,!1)},k=function(H){return H instanceof h&&(typeof H.nodeName!="string"||typeof H.textContent!="string"||typeof H.removeChild!="function"||!(H.attributes instanceof u)||typeof H.removeAttribute!="function"||typeof H.setAttribute!="function"||typeof H.namespaceURI!="string"||typeof H.insertBefore!="function"||typeof H.hasChildNodes!="function")},L=function(H){return za(o)==="object"?H instanceof o:H&&za(H)==="object"&&typeof H.nodeType=="number"&&typeof H.nodeName=="string"},V=function(H,ce,ae){oe[H]&&ej(oe[H],function(Ee){Ee.call(e,ce,ae,Er)})},he=function(H){var ce;if(V("beforeSanitizeElements",H,null),k(H)||tn(/[\u0080-\uFFFF]/,H.nodeName))return Yn(H),!0;var ae=jt(H.nodeName);if(V("uponSanitizeElement",H,{tagName:ae,allowedTags:x}),H.hasChildNodes()&&!L(H.firstElementChild)&&(!L(H.content)||!L(H.content.firstElementChild))&&tn(/<[/\w]/g,H.innerHTML)&&tn(/<[/\w]/g,H.textContent)||ae==="select"&&tn(/<template/i,H.innerHTML)||H.nodeType===7||Be&&H.nodeType===8&&tn(/<[/\w]/g,H.data))return Yn(H),!0;if(!x[ae]||ne[ae]){if(!ne[ae]&&ue(ae)&&(X.tagNameCheck instanceof RegExp&&tn(X.tagNameCheck,ae)||X.tagNameCheck instanceof Function&&X.tagNameCheck(ae)))return!1;if(se&&!ee[ae]){var Ee=y(H)||H.parentNode,Ge=S(H)||H.childNodes;if(Ge&&Ee)for(var ft=Ge.length,lt=ft-1;lt>=0;--lt){var nr=m(Ge[lt],!0);nr.__removalCount=(H.__removalCount||0)+1,Ee.insertBefore(nr,p(H))}}return Yn(H),!0}return H instanceof a&&!nv(H)||(ae==="noscript"||ae==="noembed"||ae==="noframes")&&tn(/<\/no(script|embed|frames)/i,H.innerHTML)?(Yn(H),!0):(ie&&H.nodeType===3&&(ce=H.textContent,ce=Zi(ce,Ce," "),ce=Zi(ce,pe," "),ce=Zi(ce,Te," "),H.textContent!==ce&&(Ih(e.removed,{element:H.cloneNode()}),H.textContent=ce)),V("afterSanitizeElements",H,null),!1)},ve=function(H,ce,ae){if(G&&(ce==="id"||ce==="name")&&(ae in n||ae in Nr))return!1;if(!(we&&!fe[ce]&&tn(Se,ce))){if(!(le&&tn(Ae,ce))){if(!b[ce]||fe[ce]){if(!(ue(H)&&(X.tagNameCheck instanceof RegExp&&tn(X.tagNameCheck,H)||X.tagNameCheck instanceof Function&&X.tagNameCheck(H))&&(X.attributeNameCheck instanceof RegExp&&tn(X.attributeNameCheck,ce)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(ce))||ce==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&tn(X.tagNameCheck,ae)||X.tagNameCheck instanceof Function&&X.tagNameCheck(ae))))return!1}else if(!Me[ce]){if(!tn(w,Zi(ae,Oe,""))){if(!((ce==="src"||ce==="xlink:href"||ce==="href")&&H!=="script"&&tj(ae,"data:")===0&&Q[H])){if(!(N&&!tn(q,Zi(ae,Oe,"")))){if(ae)return!1}}}}}}return!0},ue=function(H){return H!=="annotation-xml"&&y_(H,v)},de=function(H){var ce,ae,Ee,Ge;V("beforeSanitizeAttributes",H,null);var ft=H.attributes;if(ft){var lt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:b};for(Ge=ft.length;Ge--;){ce=ft[Ge];var nr=ce,Qt=nr.name,To=nr.namespaceURI;if(ae=Qt==="value"?ce.value:rj(ce.value),Ee=jt(Qt),lt.attrName=Ee,lt.attrValue=ae,lt.keepAttr=!0,lt.forceKeepAttr=void 0,V("uponSanitizeAttribute",H,lt),ae=lt.attrValue,!lt.forceKeepAttr&&(_(Qt,H),!!lt.keepAttr)){if(!Fe&&tn(/\/>/i,ae)){_(Qt,H);continue}if(Be&&tn(/((--!?|])>)|<\/(style|title)/i,ae)){_(Qt,H);continue}ie&&(ae=Zi(ae,Ce," "),ae=Zi(ae,pe," "),ae=Zi(ae,Te," "));var Ca=jt(H.nodeName);if(ve(Ca,Ee,ae)){if(re&&(Ee==="id"||Ee==="name")&&(_(Qt,H),ae=K+ae),E&&za(f)==="object"&&typeof f.getAttributeType=="function"&&!To)switch(f.getAttributeType(Ca,Ee)){case"TrustedHTML":{ae=E.createHTML(ae);break}case"TrustedScriptURL":{ae=E.createScriptURL(ae);break}}try{To?H.setAttributeNS(To,Qt,ae):H.setAttribute(Qt,ae),k(H)?Yn(H):x_(e.removed)}catch{}}}}V("afterSanitizeAttributes",H,null)}},me=function ge(H){var ce,ae=P(H);for(V("beforeSanitizeShadowDOM",H,null);ce=ae.nextNode();)V("uponSanitizeShadowNode",ce,null),!he(ce)&&(ce.content instanceof i&&ge(ce.content),de(ce));V("afterSanitizeShadowDOM",H,null)};return e.sanitize=function(ge){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ce,ae,Ee,Ge,ft;if(Ct=!ge,Ct&&(ge="<!-->"),typeof ge!="string"&&!L(ge))if(typeof ge.toString=="function"){if(ge=ge.toString(),typeof ge!="string")throw Fv("dirty is not a string, aborting")}else throw Fv("toString is not a function");if(!e.isSupported){if(za(t.toStaticHTML)==="object"||typeof t.toStaticHTML=="function"){if(typeof ge=="string")return t.toStaticHTML(ge);if(L(ge))return t.toStaticHTML(ge.outerHTML)}return ge}if(xe||Rh(H),e.removed=[],typeof ge=="string"&&(J=!1),J){if(ge.nodeName){var lt=jt(ge.nodeName);if(!x[lt]||ne[lt])throw Fv("root node is forbidden and cannot be sanitized in-place")}}else if(ge instanceof o)ce=F("<!---->"),ae=ce.ownerDocument.importNode(ge,!0),ae.nodeType===1&&ae.nodeName==="BODY"||ae.nodeName==="HTML"?ce=ae:ce.appendChild(ae);else{if(!Ve&&!ie&&!Ie&&ge.indexOf("<")===-1)return E&&D?E.createHTML(ge):ge;if(ce=F(ge),!ce)return Ve?null:D?A:""}ce&&Ye&&Yn(ce.firstChild);for(var nr=P(J?ge:ce);Ee=nr.nextNode();)Ee.nodeType===3&&Ee===Ge||he(Ee)||(Ee.content instanceof i&&me(Ee.content),de(Ee),Ge=Ee);if(Ge=null,J)return ge;if(Ve){if(M)for(ft=I.call(ce.ownerDocument);ce.firstChild;)ft.appendChild(ce.firstChild);else ft=ce;return(b.shadowroot||b.shadowrootmod)&&(ft=z.call(r,ft,!0)),ft}var Qt=Ie?ce.outerHTML:ce.innerHTML;return Ie&&x["!doctype"]&&ce.ownerDocument&&ce.ownerDocument.doctype&&ce.ownerDocument.doctype.name&&tn(gj,ce.ownerDocument.doctype.name)&&(Qt="<!DOCTYPE "+ce.ownerDocument.doctype.name+`>
  40. `+Qt),ie&&(Qt=Zi(Qt,Ce," "),Qt=Zi(Qt,pe," "),Qt=Zi(Qt,Te," ")),E&&D?E.createHTML(Qt):Qt},e.setConfig=function(ge){Rh(ge),xe=!0},e.clearConfig=function(){Er=null,xe=!1},e.isValidAttribute=function(ge,H,ce){Er||Rh({});var ae=jt(ge),Ee=jt(H);return ve(ae,Ee,ce)},e.addHook=function(ge,H){typeof H=="function"&&(oe[ge]=oe[ge]||[],Ih(oe[ge],H))},e.removeHook=function(ge){if(oe[ge])return x_(oe[ge])},e.removeHooks=function(ge){oe[ge]&&(oe[ge]=[])},e.removeAllHooks=function(){oe={}},e}var vj=$D();//! moment.js
  41. //! version : 2.30.1
  42. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  43. //! license : MIT
  44. //! momentjs.com
  45. var BD;function be(){return BD.apply(null,arguments)}function Cj(t){BD=t}function bs(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function mc(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function Mt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ty(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(Mt(t,e))return!1;return!0}function Zn(t){return t===void 0}function oa(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function ag(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function VD(t,e){var r=[],n,i=t.length;for(n=0;n<i;++n)r.push(e(t[n],n));return r}function Za(t,e){for(var r in e)Mt(e,r)&&(t[r]=e[r]);return Mt(e,"toString")&&(t.toString=e.toString),Mt(e,"valueOf")&&(t.valueOf=e.valueOf),t}function bo(t,e,r,n){return uk(t,e,r,n,!0).utc()}function Sj(){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 ut(t){return t._pf==null&&(t._pf=Sj()),t._pf}var hS;Array.prototype.some?hS=Array.prototype.some:hS=function(t){var e=Object(this),r=e.length>>>0,n;for(n=0;n<r;n++)if(n in e&&t.call(this,e[n],n,e))return!0;return!1};function ry(t){var e=null,r=!1,n=t._d&&!isNaN(t._d.getTime());if(n&&(e=ut(t),r=hS.call(e.parsedDateParts,function(i){return i!=null}),n=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&r),t._strict&&(n=n&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=n;else return n;return t._isValid}function fw(t){var e=bo(NaN);return t!=null?Za(ut(e),t):ut(e).userInvalidated=!0,e}var __=be.momentProperties=[],Wv=!1;function ny(t,e){var r,n,i,s=__.length;if(Zn(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),Zn(e._i)||(t._i=e._i),Zn(e._f)||(t._f=e._f),Zn(e._l)||(t._l=e._l),Zn(e._strict)||(t._strict=e._strict),Zn(e._tzm)||(t._tzm=e._tzm),Zn(e._isUTC)||(t._isUTC=e._isUTC),Zn(e._offset)||(t._offset=e._offset),Zn(e._pf)||(t._pf=ut(e)),Zn(e._locale)||(t._locale=e._locale),s>0)for(r=0;r<s;r++)n=__[r],i=e[n],Zn(i)||(t[n]=i);return t}function lg(t){ny(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Wv===!1&&(Wv=!0,be.updateOffset(this),Wv=!1)}function Es(t){return t instanceof lg||t!=null&&t._isAMomentObject!=null}function WD(t){be.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function ji(t,e){var r=!0;return Za(function(){if(be.deprecationHandler!=null&&be.deprecationHandler(null,t),r){var n=[],i,s,o,a=arguments.length;for(s=0;s<a;s++){if(i="",typeof arguments[s]=="object"){i+=`
  46. [`+s+"] ";for(o in arguments[0])Mt(arguments[0],o)&&(i+=o+": "+arguments[0][o]+", ");i=i.slice(0,-2)}else i=arguments[s];n.push(i)}WD(t+`
  47. Arguments: `+Array.prototype.slice.call(n).join("")+`
  48. `+new Error().stack),r=!1}return e.apply(this,arguments)},e)}var A_={};function UD(t,e){be.deprecationHandler!=null&&be.deprecationHandler(t,e),A_[t]||(WD(e),A_[t]=!0)}be.suppressDeprecationWarnings=!1;be.deprecationHandler=null;function Eo(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function xj(t){var e,r;for(r in t)Mt(t,r)&&(e=t[r],Eo(e)?this[r]=e:this["_"+r]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function dS(t,e){var r=Za({},t),n;for(n in e)Mt(e,n)&&(mc(t[n])&&mc(e[n])?(r[n]={},Za(r[n],t[n]),Za(r[n],e[n])):e[n]!=null?r[n]=e[n]:delete r[n]);for(n in t)Mt(t,n)&&!Mt(e,n)&&mc(t[n])&&(r[n]=Za({},r[n]));return r}function iy(t){t!=null&&this.set(t)}var fS;Object.keys?fS=Object.keys:fS=function(t){var e,r=[];for(e in t)Mt(t,e)&&r.push(e);return r};var yj={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function bj(t,e,r){var n=this._calendar[t]||this._calendar.sameElse;return Eo(n)?n.call(e,r):n}function go(t,e,r){var n=""+Math.abs(t),i=e-n.length,s=t>=0;return(s?r?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var sy=/(\[[^\[]*\])|(\\)?([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,Jg=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Uv={},Ku={};function Ke(t,e,r,n){var i=n;typeof n=="string"&&(i=function(){return this[n]()}),t&&(Ku[t]=i),e&&(Ku[e[0]]=function(){return go(i.apply(this,arguments),e[1],e[2])}),r&&(Ku[r]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function Ej(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function Rj(t){var e=t.match(sy),r,n;for(r=0,n=e.length;r<n;r++)Ku[e[r]]?e[r]=Ku[e[r]]:e[r]=Ej(e[r]);return function(i){var s="",o;for(o=0;o<n;o++)s+=Eo(e[o])?e[o].call(i,t):e[o];return s}}function Am(t,e){return t.isValid()?(e=YD(e,t.localeData()),Uv[e]=Uv[e]||Rj(e),Uv[e](t)):t.localeData().invalidDate()}function YD(t,e){var r=5;function n(i){return e.longDateFormat(i)||i}for(Jg.lastIndex=0;r>=0&&Jg.test(t);)t=t.replace(Jg,n),Jg.lastIndex=0,r-=1;return t}var Tj={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 _j(t){var e=this._longDateFormat[t],r=this._longDateFormat[t.toUpperCase()];return e||!r?e:(this._longDateFormat[t]=r.match(sy).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[t])}var Aj="Invalid date";function Mj(){return this._invalidDate}var Ij="%d",Oj=/\d{1,2}/;function Pj(t){return this._ordinal.replace("%d",t)}var Dj={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 kj(t,e,r,n){var i=this._relativeTime[r];return Eo(i)?i(t,e,r,n):i.replace(/%d/i,t)}function Nj(t,e){var r=this._relativeTime[t>0?"future":"past"];return Eo(r)?r(e):r.replace(/%s/i,e)}var M_={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 Ki(t){return typeof t=="string"?M_[t]||M_[t.toLowerCase()]:void 0}function oy(t){var e={},r,n;for(n in t)Mt(t,n)&&(r=Ki(n),r&&(e[r]=t[n]));return e}var Hj={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 Fj(t){var e=[],r;for(r in t)Mt(t,r)&&e.push({unit:r,priority:Hj[r]});return e.sort(function(n,i){return n.priority-i.priority}),e}var zD=/\d/,yi=/\d\d/,GD=/\d{3}/,ay=/\d{4}/,gw=/[+-]?\d{6}/,rr=/\d\d?/,jD=/\d\d\d\d?/,KD=/\d\d\d\d\d\d?/,mw=/\d{1,3}/,ly=/\d{1,4}/,pw=/[+-]?\d{1,6}/,gh=/\d+/,ww=/[+-]?\d+/,Lj=/Z|[+-]\d\d:?\d\d/gi,vw=/Z|[+-]\d\d(?::?\d\d)?/gi,$j=/[+-]?\d+(\.\d{1,3})?/,cg=/[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,mh=/^[1-9]\d?/,cy=/^([1-9]\d|\d)/,dp;dp={};function $e(t,e,r){dp[t]=Eo(e)?e:function(n,i){return n&&r?r:e}}function Bj(t,e){return Mt(dp,t)?dp[t](e._strict,e._locale):new RegExp(Vj(t))}function Vj(t){return na(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,r,n,i,s){return r||n||i||s}))}function na(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $i(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function St(t){var e=+t,r=0;return e!==0&&isFinite(e)&&(r=$i(e)),r}var gS={};function Wt(t,e){var r,n=e,i;for(typeof t=="string"&&(t=[t]),oa(e)&&(n=function(s,o){o[e]=St(s)}),i=t.length,r=0;r<i;r++)gS[t[r]]=n}function ug(t,e){Wt(t,function(r,n,i,s){i._w=i._w||{},e(r,i._w,i,s)})}function Wj(t,e,r){e!=null&&Mt(gS,t)&&gS[t](e,r._a,r,t)}function Cw(t){return t%4===0&&t%100!==0||t%400===0}var Sn=0,Ko=1,so=2,Vr=3,Cs=4,Xo=5,ac=6,Uj=7,Yj=8;Ke("Y",0,0,function(){var t=this.year();return t<=9999?go(t,4):"+"+t});Ke(0,["YY",2],0,function(){return this.year()%100});Ke(0,["YYYY",4],0,"year");Ke(0,["YYYYY",5],0,"year");Ke(0,["YYYYYY",6,!0],0,"year");$e("Y",ww);$e("YY",rr,yi);$e("YYYY",ly,ay);$e("YYYYY",pw,gw);$e("YYYYYY",pw,gw);Wt(["YYYYY","YYYYYY"],Sn);Wt("YYYY",function(t,e){e[Sn]=t.length===2?be.parseTwoDigitYear(t):St(t)});Wt("YY",function(t,e){e[Sn]=be.parseTwoDigitYear(t)});Wt("Y",function(t,e){e[Sn]=parseInt(t,10)});function Zd(t){return Cw(t)?366:365}be.parseTwoDigitYear=function(t){return St(t)+(St(t)>68?1900:2e3)};var XD=ph("FullYear",!0);function zj(){return Cw(this.year())}function ph(t,e){return function(r){return r!=null?(qD(this,t,r),be.updateOffset(this,e),this):Of(this,t)}}function Of(t,e){if(!t.isValid())return NaN;var r=t._d,n=t._isUTC;switch(e){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function qD(t,e,r){var n,i,s,o,a;if(!(!t.isValid()||isNaN(r))){switch(n=t._d,i=t._isUTC,e){case"Milliseconds":return void(i?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(i?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(i?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(i?n.setUTCHours(r):n.setHours(r));case"Date":return void(i?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}s=r,o=t.month(),a=t.date(),a=a===29&&o===1&&!Cw(s)?28:a,i?n.setUTCFullYear(s,o,a):n.setFullYear(s,o,a)}}function Gj(t){return t=Ki(t),Eo(this[t])?this[t]():this}function jj(t,e){if(typeof t=="object"){t=oy(t);var r=Fj(t),n,i=r.length;for(n=0;n<i;n++)this[r[n].unit](t[r[n].unit])}else if(t=Ki(t),Eo(this[t]))return this[t](e);return this}function Kj(t,e){return(t%e+e)%e}var _r;Array.prototype.indexOf?_r=Array.prototype.indexOf:_r=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function uy(t,e){if(isNaN(t)||isNaN(e))return NaN;var r=Kj(e,12);return t+=(e-r)/12,r===1?Cw(t)?29:28:31-r%7%2}Ke("M",["MM",2],"Mo",function(){return this.month()+1});Ke("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)});Ke("MMMM",0,0,function(t){return this.localeData().months(this,t)});$e("M",rr,mh);$e("MM",rr,yi);$e("MMM",function(t,e){return e.monthsShortRegex(t)});$e("MMMM",function(t,e){return e.monthsRegex(t)});Wt(["M","MM"],function(t,e){e[Ko]=St(t)-1});Wt(["MMM","MMMM"],function(t,e,r,n){var i=r._locale.monthsParse(t,n,r._strict);i!=null?e[Ko]=i:ut(r).invalidMonth=t});var Xj="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ZD="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),JD=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,qj=cg,Zj=cg;function Jj(t,e){return t?bs(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||JD).test(e)?"format":"standalone"][t.month()]:bs(this._months)?this._months:this._months.standalone}function Qj(t,e){return t?bs(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[JD.test(e)?"format":"standalone"][t.month()]:bs(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function eK(t,e,r){var n,i,s,o=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)s=bo([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(s,"").toLocaleLowerCase();return r?e==="MMM"?(i=_r.call(this._shortMonthsParse,o),i!==-1?i:null):(i=_r.call(this._longMonthsParse,o),i!==-1?i:null):e==="MMM"?(i=_r.call(this._shortMonthsParse,o),i!==-1?i:(i=_r.call(this._longMonthsParse,o),i!==-1?i:null)):(i=_r.call(this._longMonthsParse,o),i!==-1?i:(i=_r.call(this._shortMonthsParse,o),i!==-1?i:null))}function tK(t,e,r){var n,i,s;if(this._monthsParseExact)return eK.call(this,t,e,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=bo([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!r&&!this._monthsParse[n]&&(s="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(s.replace(".",""),"i")),r&&e==="MMMM"&&this._longMonthsParse[n].test(t))return n;if(r&&e==="MMM"&&this._shortMonthsParse[n].test(t))return n;if(!r&&this._monthsParse[n].test(t))return n}}function QD(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=St(e);else if(e=t.localeData().monthsParse(e),!oa(e))return t}var r=e,n=t.date();return n=n<29?n:Math.min(n,uy(t.year(),r)),t._isUTC?t._d.setUTCMonth(r,n):t._d.setMonth(r,n),t}function ek(t){return t!=null?(QD(this,t),be.updateOffset(this,!0),this):Of(this,"Month")}function rK(){return uy(this.year(),this.month())}function nK(t){return this._monthsParseExact?(Mt(this,"_monthsRegex")||tk.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(Mt(this,"_monthsShortRegex")||(this._monthsShortRegex=qj),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function iK(t){return this._monthsParseExact?(Mt(this,"_monthsRegex")||tk.call(this),t?this._monthsStrictRegex:this._monthsRegex):(Mt(this,"_monthsRegex")||(this._monthsRegex=Zj),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function tk(){function t(l,c){return c.length-l.length}var e=[],r=[],n=[],i,s,o,a;for(i=0;i<12;i++)s=bo([2e3,i]),o=na(this.monthsShort(s,"")),a=na(this.months(s,"")),e.push(o),r.push(a),n.push(a),n.push(o);e.sort(t),r.sort(t),n.sort(t),this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function sK(t,e,r,n,i,s,o){var a;return t<100&&t>=0?(a=new Date(t+400,e,r,n,i,s,o),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,r,n,i,s,o),a}function Pf(t){var e,r;return t<100&&t>=0?(r=Array.prototype.slice.call(arguments),r[0]=t+400,e=new Date(Date.UTC.apply(null,r)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function fp(t,e,r){var n=7+e-r,i=(7+Pf(t,0,n).getUTCDay()-e)%7;return-i+n-1}function rk(t,e,r,n,i){var s=(7+r-n)%7,o=fp(t,n,i),a=1+7*(e-1)+s+o,l,c;return a<=0?(l=t-1,c=Zd(l)+a):a>Zd(t)?(l=t+1,c=a-Zd(t)):(l=t,c=a),{year:l,dayOfYear:c}}function Df(t,e,r){var n=fp(t.year(),e,r),i=Math.floor((t.dayOfYear()-n-1)/7)+1,s,o;return i<1?(o=t.year()-1,s=i+ia(o,e,r)):i>ia(t.year(),e,r)?(s=i-ia(t.year(),e,r),o=t.year()+1):(o=t.year(),s=i),{week:s,year:o}}function ia(t,e,r){var n=fp(t,e,r),i=fp(t+1,e,r);return(Zd(t)-n+i)/7}Ke("w",["ww",2],"wo","week");Ke("W",["WW",2],"Wo","isoWeek");$e("w",rr,mh);$e("ww",rr,yi);$e("W",rr,mh);$e("WW",rr,yi);ug(["w","ww","W","WW"],function(t,e,r,n){e[n.substr(0,1)]=St(t)});function oK(t){return Df(t,this._week.dow,this._week.doy).week}var aK={dow:0,doy:6};function lK(){return this._week.dow}function cK(){return this._week.doy}function uK(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function hK(t){var e=Df(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}Ke("d",0,"do","day");Ke("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)});Ke("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)});Ke("dddd",0,0,function(t){return this.localeData().weekdays(this,t)});Ke("e",0,0,"weekday");Ke("E",0,0,"isoWeekday");$e("d",rr);$e("e",rr);$e("E",rr);$e("dd",function(t,e){return e.weekdaysMinRegex(t)});$e("ddd",function(t,e){return e.weekdaysShortRegex(t)});$e("dddd",function(t,e){return e.weekdaysRegex(t)});ug(["dd","ddd","dddd"],function(t,e,r,n){var i=r._locale.weekdaysParse(t,n,r._strict);i!=null?e.d=i:ut(r).invalidWeekday=t});ug(["d","e","E"],function(t,e,r,n){e[n]=St(t)});function dK(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function fK(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function hy(t,e){return t.slice(e,7).concat(t.slice(0,e))}var gK="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),nk="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),mK="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),pK=cg,wK=cg,vK=cg;function CK(t,e){var r=bs(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?hy(r,this._week.dow):t?r[t.day()]:r}function SK(t){return t===!0?hy(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function xK(t){return t===!0?hy(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function yK(t,e,r){var n,i,s,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)s=bo([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(s,"").toLocaleLowerCase();return r?e==="dddd"?(i=_r.call(this._weekdaysParse,o),i!==-1?i:null):e==="ddd"?(i=_r.call(this._shortWeekdaysParse,o),i!==-1?i:null):(i=_r.call(this._minWeekdaysParse,o),i!==-1?i:null):e==="dddd"?(i=_r.call(this._weekdaysParse,o),i!==-1||(i=_r.call(this._shortWeekdaysParse,o),i!==-1)?i:(i=_r.call(this._minWeekdaysParse,o),i!==-1?i:null)):e==="ddd"?(i=_r.call(this._shortWeekdaysParse,o),i!==-1||(i=_r.call(this._weekdaysParse,o),i!==-1)?i:(i=_r.call(this._minWeekdaysParse,o),i!==-1?i:null)):(i=_r.call(this._minWeekdaysParse,o),i!==-1||(i=_r.call(this._weekdaysParse,o),i!==-1)?i:(i=_r.call(this._shortWeekdaysParse,o),i!==-1?i:null))}function bK(t,e,r){var n,i,s;if(this._weekdaysParseExact)return yK.call(this,t,e,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=bo([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(s="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(s.replace(".",""),"i")),r&&e==="dddd"&&this._fullWeekdaysParse[n].test(t))return n;if(r&&e==="ddd"&&this._shortWeekdaysParse[n].test(t))return n;if(r&&e==="dd"&&this._minWeekdaysParse[n].test(t))return n;if(!r&&this._weekdaysParse[n].test(t))return n}}function EK(t){if(!this.isValid())return t!=null?this:NaN;var e=Of(this,"Day");return t!=null?(t=dK(t,this.localeData()),this.add(t-e,"d")):e}function RK(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 TK(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=fK(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function _K(t){return this._weekdaysParseExact?(Mt(this,"_weekdaysRegex")||dy.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(Mt(this,"_weekdaysRegex")||(this._weekdaysRegex=pK),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function AK(t){return this._weekdaysParseExact?(Mt(this,"_weekdaysRegex")||dy.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Mt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=wK),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function MK(t){return this._weekdaysParseExact?(Mt(this,"_weekdaysRegex")||dy.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Mt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=vK),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function dy(){function t(u,h){return h.length-u.length}var e=[],r=[],n=[],i=[],s,o,a,l,c;for(s=0;s<7;s++)o=bo([2e3,1]).day(s),a=na(this.weekdaysMin(o,"")),l=na(this.weekdaysShort(o,"")),c=na(this.weekdays(o,"")),e.push(a),r.push(l),n.push(c),i.push(a),i.push(l),i.push(c);e.sort(t),r.sort(t),n.sort(t),i.sort(t),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function fy(){return this.hours()%12||12}function IK(){return this.hours()||24}Ke("H",["HH",2],0,"hour");Ke("h",["hh",2],0,fy);Ke("k",["kk",2],0,IK);Ke("hmm",0,0,function(){return""+fy.apply(this)+go(this.minutes(),2)});Ke("hmmss",0,0,function(){return""+fy.apply(this)+go(this.minutes(),2)+go(this.seconds(),2)});Ke("Hmm",0,0,function(){return""+this.hours()+go(this.minutes(),2)});Ke("Hmmss",0,0,function(){return""+this.hours()+go(this.minutes(),2)+go(this.seconds(),2)});function ik(t,e){Ke(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}ik("a",!0);ik("A",!1);function sk(t,e){return e._meridiemParse}$e("a",sk);$e("A",sk);$e("H",rr,cy);$e("h",rr,mh);$e("k",rr,mh);$e("HH",rr,yi);$e("hh",rr,yi);$e("kk",rr,yi);$e("hmm",jD);$e("hmmss",KD);$e("Hmm",jD);$e("Hmmss",KD);Wt(["H","HH"],Vr);Wt(["k","kk"],function(t,e,r){var n=St(t);e[Vr]=n===24?0:n});Wt(["a","A"],function(t,e,r){r._isPm=r._locale.isPM(t),r._meridiem=t});Wt(["h","hh"],function(t,e,r){e[Vr]=St(t),ut(r).bigHour=!0});Wt("hmm",function(t,e,r){var n=t.length-2;e[Vr]=St(t.substr(0,n)),e[Cs]=St(t.substr(n)),ut(r).bigHour=!0});Wt("hmmss",function(t,e,r){var n=t.length-4,i=t.length-2;e[Vr]=St(t.substr(0,n)),e[Cs]=St(t.substr(n,2)),e[Xo]=St(t.substr(i)),ut(r).bigHour=!0});Wt("Hmm",function(t,e,r){var n=t.length-2;e[Vr]=St(t.substr(0,n)),e[Cs]=St(t.substr(n))});Wt("Hmmss",function(t,e,r){var n=t.length-4,i=t.length-2;e[Vr]=St(t.substr(0,n)),e[Cs]=St(t.substr(n,2)),e[Xo]=St(t.substr(i))});function OK(t){return(t+"").toLowerCase().charAt(0)==="p"}var PK=/[ap]\.?m?\.?/i,DK=ph("Hours",!0);function kK(t,e,r){return t>11?r?"pm":"PM":r?"am":"AM"}var ok={calendar:yj,longDateFormat:Tj,invalidDate:Aj,ordinal:Ij,dayOfMonthOrdinalParse:Oj,relativeTime:Dj,months:Xj,monthsShort:ZD,week:aK,weekdays:gK,weekdaysMin:mK,weekdaysShort:nk,meridiemParse:PK},or={},Oh={},kf;function NK(t,e){var r,n=Math.min(t.length,e.length);for(r=0;r<n;r+=1)if(t[r]!==e[r])return r;return n}function I_(t){return t&&t.toLowerCase().replace("_","-")}function HK(t){for(var e=0,r,n,i,s;e<t.length;){for(s=I_(t[e]).split("-"),r=s.length,n=I_(t[e+1]),n=n?n.split("-"):null;r>0;){if(i=Sw(s.slice(0,r).join("-")),i)return i;if(n&&n.length>=r&&NK(s,n)>=r-1)break;r--}e++}return kf}function FK(t){return!!(t&&t.match("^[^/\\\\]*$"))}function Sw(t){var e=null,r;if(or[t]===void 0&&typeof module<"u"&&module&&module.exports&&FK(t))try{e=kf._abbr,r=Od,r("./locale/"+t),il(e)}catch{or[t]=null}return or[t]}function il(t,e){var r;return t&&(Zn(e)?r=ha(t):r=gy(t,e),r?kf=r:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),kf._abbr}function gy(t,e){if(e!==null){var r,n=ok;if(e.abbr=t,or[t]!=null)UD("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."),n=or[t]._config;else if(e.parentLocale!=null)if(or[e.parentLocale]!=null)n=or[e.parentLocale]._config;else if(r=Sw(e.parentLocale),r!=null)n=r._config;else return Oh[e.parentLocale]||(Oh[e.parentLocale]=[]),Oh[e.parentLocale].push({name:t,config:e}),null;return or[t]=new iy(dS(n,e)),Oh[t]&&Oh[t].forEach(function(i){gy(i.name,i.config)}),il(t),or[t]}else return delete or[t],null}function LK(t,e){if(e!=null){var r,n,i=ok;or[t]!=null&&or[t].parentLocale!=null?or[t].set(dS(or[t]._config,e)):(n=Sw(t),n!=null&&(i=n._config),e=dS(i,e),n==null&&(e.abbr=t),r=new iy(e),r.parentLocale=or[t],or[t]=r),il(t)}else or[t]!=null&&(or[t].parentLocale!=null?(or[t]=or[t].parentLocale,t===il()&&il(t)):or[t]!=null&&delete or[t]);return or[t]}function ha(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return kf;if(!bs(t)){if(e=Sw(t),e)return e;t=[t]}return HK(t)}function $K(){return fS(or)}function my(t){var e,r=t._a;return r&&ut(t).overflow===-2&&(e=r[Ko]<0||r[Ko]>11?Ko:r[so]<1||r[so]>uy(r[Sn],r[Ko])?so:r[Vr]<0||r[Vr]>24||r[Vr]===24&&(r[Cs]!==0||r[Xo]!==0||r[ac]!==0)?Vr:r[Cs]<0||r[Cs]>59?Cs:r[Xo]<0||r[Xo]>59?Xo:r[ac]<0||r[ac]>999?ac:-1,ut(t)._overflowDayOfYear&&(e<Sn||e>so)&&(e=so),ut(t)._overflowWeeks&&e===-1&&(e=Uj),ut(t)._overflowWeekday&&e===-1&&(e=Yj),ut(t).overflow=e),t}var BK=/^\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)?)?$/,VK=/^\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)?)?$/,WK=/Z|[+-]\d\d(?::?\d\d)?/,Qg=[["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]],Yv=[["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/]],UK=/^\/?Date\((-?\d+)/i,YK=/^(?:(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}))$/,zK={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 ak(t){var e,r,n=t._i,i=BK.exec(n)||VK.exec(n),s,o,a,l,c=Qg.length,u=Yv.length;if(i){for(ut(t).iso=!0,e=0,r=c;e<r;e++)if(Qg[e][1].exec(i[1])){o=Qg[e][0],s=Qg[e][2]!==!1;break}if(o==null){t._isValid=!1;return}if(i[3]){for(e=0,r=u;e<r;e++)if(Yv[e][1].exec(i[3])){a=(i[2]||" ")+Yv[e][0];break}if(a==null){t._isValid=!1;return}}if(!s&&a!=null){t._isValid=!1;return}if(i[4])if(WK.exec(i[4]))l="Z";else{t._isValid=!1;return}t._f=o+(a||"")+(l||""),wy(t)}else t._isValid=!1}function GK(t,e,r,n,i,s){var o=[jK(t),ZD.indexOf(e),parseInt(r,10),parseInt(n,10),parseInt(i,10)];return s&&o.push(parseInt(s,10)),o}function jK(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function KK(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function XK(t,e,r){if(t){var n=nk.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(n!==i)return ut(r).weekdayMismatch=!0,r._isValid=!1,!1}return!0}function qK(t,e,r){if(t)return zK[t];if(e)return 0;var n=parseInt(r,10),i=n%100,s=(n-i)/100;return s*60+i}function lk(t){var e=YK.exec(KK(t._i)),r;if(e){if(r=GK(e[4],e[3],e[2],e[5],e[6],e[7]),!XK(e[1],r,t))return;t._a=r,t._tzm=qK(e[8],e[9],e[10]),t._d=Pf.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),ut(t).rfc2822=!0}else t._isValid=!1}function ZK(t){var e=UK.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(ak(t),t._isValid===!1)delete t._isValid;else return;if(lk(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:be.createFromInputFallback(t)}be.createFromInputFallback=ji("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 Ou(t,e,r){return t??e??r}function JK(t){var e=new Date(be.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function py(t){var e,r,n=[],i,s,o;if(!t._d){for(i=JK(t),t._w&&t._a[so]==null&&t._a[Ko]==null&&QK(t),t._dayOfYear!=null&&(o=Ou(t._a[Sn],i[Sn]),(t._dayOfYear>Zd(o)||t._dayOfYear===0)&&(ut(t)._overflowDayOfYear=!0),r=Pf(o,0,t._dayOfYear),t._a[Ko]=r.getUTCMonth(),t._a[so]=r.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=n[e]=i[e];for(;e<7;e++)t._a[e]=n[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[Vr]===24&&t._a[Cs]===0&&t._a[Xo]===0&&t._a[ac]===0&&(t._nextDay=!0,t._a[Vr]=0),t._d=(t._useUTC?Pf:sK).apply(null,n),s=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Vr]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==s&&(ut(t).weekdayMismatch=!0)}}function QK(t){var e,r,n,i,s,o,a,l,c;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(s=1,o=4,r=Ou(e.GG,t._a[Sn],Df(tr(),1,4).year),n=Ou(e.W,1),i=Ou(e.E,1),(i<1||i>7)&&(l=!0)):(s=t._locale._week.dow,o=t._locale._week.doy,c=Df(tr(),s,o),r=Ou(e.gg,t._a[Sn],c.year),n=Ou(e.w,c.week),e.d!=null?(i=e.d,(i<0||i>6)&&(l=!0)):e.e!=null?(i=e.e+s,(e.e<0||e.e>6)&&(l=!0)):i=s),n<1||n>ia(r,s,o)?ut(t)._overflowWeeks=!0:l!=null?ut(t)._overflowWeekday=!0:(a=rk(r,n,i,s,o),t._a[Sn]=a.year,t._dayOfYear=a.dayOfYear)}be.ISO_8601=function(){};be.RFC_2822=function(){};function wy(t){if(t._f===be.ISO_8601){ak(t);return}if(t._f===be.RFC_2822){lk(t);return}t._a=[],ut(t).empty=!0;var e=""+t._i,r,n,i,s,o,a=e.length,l=0,c,u;for(i=YD(t._f,t._locale).match(sy)||[],u=i.length,r=0;r<u;r++)s=i[r],n=(e.match(Bj(s,t))||[])[0],n&&(o=e.substr(0,e.indexOf(n)),o.length>0&&ut(t).unusedInput.push(o),e=e.slice(e.indexOf(n)+n.length),l+=n.length),Ku[s]?(n?ut(t).empty=!1:ut(t).unusedTokens.push(s),Wj(s,n,t)):t._strict&&!n&&ut(t).unusedTokens.push(s);ut(t).charsLeftOver=a-l,e.length>0&&ut(t).unusedInput.push(e),t._a[Vr]<=12&&ut(t).bigHour===!0&&t._a[Vr]>0&&(ut(t).bigHour=void 0),ut(t).parsedDateParts=t._a.slice(0),ut(t).meridiem=t._meridiem,t._a[Vr]=eX(t._locale,t._a[Vr],t._meridiem),c=ut(t).era,c!==null&&(t._a[Sn]=t._locale.erasConvertYear(c,t._a[Sn])),py(t),my(t)}function eX(t,e,r){var n;return r==null?e:t.meridiemHour!=null?t.meridiemHour(e,r):(t.isPM!=null&&(n=t.isPM(r),n&&e<12&&(e+=12),!n&&e===12&&(e=0)),e)}function tX(t){var e,r,n,i,s,o,a=!1,l=t._f.length;if(l===0){ut(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<l;i++)s=0,o=!1,e=ny({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],wy(e),ry(e)&&(o=!0),s+=ut(e).charsLeftOver,s+=ut(e).unusedTokens.length*10,ut(e).score=s,a?s<n&&(n=s,r=e):(n==null||s<n||o)&&(n=s,r=e,o&&(a=!0));Za(t,r||e)}function rX(t){if(!t._d){var e=oy(t._i),r=e.day===void 0?e.date:e.day;t._a=VD([e.year,e.month,r,e.hour,e.minute,e.second,e.millisecond],function(n){return n&&parseInt(n,10)}),py(t)}}function nX(t){var e=new lg(my(ck(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function ck(t){var e=t._i,r=t._f;return t._locale=t._locale||ha(t._l),e===null||r===void 0&&e===""?fw({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),Es(e)?new lg(my(e)):(ag(e)?t._d=e:bs(r)?tX(t):r?wy(t):iX(t),ry(t)||(t._d=null),t))}function iX(t){var e=t._i;Zn(e)?t._d=new Date(be.now()):ag(e)?t._d=new Date(e.valueOf()):typeof e=="string"?ZK(t):bs(e)?(t._a=VD(e.slice(0),function(r){return parseInt(r,10)}),py(t)):mc(e)?rX(t):oa(e)?t._d=new Date(e):be.createFromInputFallback(t)}function uk(t,e,r,n,i){var s={};return(e===!0||e===!1)&&(n=e,e=void 0),(r===!0||r===!1)&&(n=r,r=void 0),(mc(t)&&ty(t)||bs(t)&&t.length===0)&&(t=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=i,s._l=r,s._i=t,s._f=e,s._strict=n,nX(s)}function tr(t,e,r,n){return uk(t,e,r,n,!1)}var sX=ji("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=tr.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:fw()}),oX=ji("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=tr.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:fw()});function hk(t,e){var r,n;if(e.length===1&&bs(e[0])&&(e=e[0]),!e.length)return tr();for(r=e[0],n=1;n<e.length;++n)(!e[n].isValid()||e[n][t](r))&&(r=e[n]);return r}function aX(){var t=[].slice.call(arguments,0);return hk("isBefore",t)}function lX(){var t=[].slice.call(arguments,0);return hk("isAfter",t)}var cX=function(){return Date.now?Date.now():+new Date},Ph=["year","quarter","month","week","day","hour","minute","second","millisecond"];function uX(t){var e,r=!1,n,i=Ph.length;for(e in t)if(Mt(t,e)&&!(_r.call(Ph,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(n=0;n<i;++n)if(t[Ph[n]]){if(r)return!1;parseFloat(t[Ph[n]])!==St(t[Ph[n]])&&(r=!0)}return!0}function hX(){return this._isValid}function dX(){return Os(NaN)}function xw(t){var e=oy(t),r=e.year||0,n=e.quarter||0,i=e.month||0,s=e.week||e.isoWeek||0,o=e.day||0,a=e.hour||0,l=e.minute||0,c=e.second||0,u=e.millisecond||0;this._isValid=uX(e),this._milliseconds=+u+c*1e3+l*6e4+a*1e3*60*60,this._days=+o+s*7,this._months=+i+n*3+r*12,this._data={},this._locale=ha(),this._bubble()}function Mm(t){return t instanceof xw}function mS(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function fX(t,e,r){var n=Math.min(t.length,e.length),i=Math.abs(t.length-e.length),s=0,o;for(o=0;o<n;o++)St(t[o])!==St(e[o])&&s++;return s+i}function dk(t,e){Ke(t,0,0,function(){var r=this.utcOffset(),n="+";return r<0&&(r=-r,n="-"),n+go(~~(r/60),2)+e+go(~~r%60,2)})}dk("Z",":");dk("ZZ","");$e("Z",vw);$e("ZZ",vw);Wt(["Z","ZZ"],function(t,e,r){r._useUTC=!0,r._tzm=vy(vw,t)});var gX=/([\+\-]|\d\d)/gi;function vy(t,e){var r=(e||"").match(t),n,i,s;return r===null?null:(n=r[r.length-1]||[],i=(n+"").match(gX)||["-",0,0],s=+(i[1]*60)+St(i[2]),s===0?0:i[0]==="+"?s:-s)}function Cy(t,e){var r,n;return e._isUTC?(r=e.clone(),n=(Es(t)||ag(t)?t.valueOf():tr(t).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+n),be.updateOffset(r,!1),r):tr(t).local()}function pS(t){return-Math.round(t._d.getTimezoneOffset())}be.updateOffset=function(){};function mX(t,e,r){var n=this._offset||0,i;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=vy(vw,t),t===null)return this}else Math.abs(t)<16&&!r&&(t=t*60);return!this._isUTC&&e&&(i=pS(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),n!==t&&(!e||this._changeInProgress?mk(this,Os(t-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,be.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?n:pS(this)}function pX(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function wX(t){return this.utcOffset(0,t)}function vX(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(pS(this),"m")),this}function CX(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=vy(Lj,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function SX(t){return this.isValid()?(t=t?tr(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function xX(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function yX(){if(!Zn(this._isDSTShifted))return this._isDSTShifted;var t={},e;return ny(t,this),t=ck(t),t._a?(e=t._isUTC?bo(t._a):tr(t._a),this._isDSTShifted=this.isValid()&&fX(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function bX(){return this.isValid()?!this._isUTC:!1}function EX(){return this.isValid()?this._isUTC:!1}function fk(){return this.isValid()?this._isUTC&&this._offset===0:!1}var RX=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,TX=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Os(t,e){var r=t,n=null,i,s,o;return Mm(t)?r={ms:t._milliseconds,d:t._days,M:t._months}:oa(t)||!isNaN(+t)?(r={},e?r[e]=+t:r.milliseconds=+t):(n=RX.exec(t))?(i=n[1]==="-"?-1:1,r={y:0,d:St(n[so])*i,h:St(n[Vr])*i,m:St(n[Cs])*i,s:St(n[Xo])*i,ms:St(mS(n[ac]*1e3))*i}):(n=TX.exec(t))?(i=n[1]==="-"?-1:1,r={y:bl(n[2],i),M:bl(n[3],i),w:bl(n[4],i),d:bl(n[5],i),h:bl(n[6],i),m:bl(n[7],i),s:bl(n[8],i)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(o=_X(tr(r.from),tr(r.to)),r={},r.ms=o.milliseconds,r.M=o.months),s=new xw(r),Mm(t)&&Mt(t,"_locale")&&(s._locale=t._locale),Mm(t)&&Mt(t,"_isValid")&&(s._isValid=t._isValid),s}Os.fn=xw.prototype;Os.invalid=dX;function bl(t,e){var r=t&&parseFloat(t.replace(",","."));return(isNaN(r)?0:r)*e}function O_(t,e){var r={};return r.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(r.months,"M").isAfter(e)&&--r.months,r.milliseconds=+e-+t.clone().add(r.months,"M"),r}function _X(t,e){var r;return t.isValid()&&e.isValid()?(e=Cy(e,t),t.isBefore(e)?r=O_(t,e):(r=O_(e,t),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function gk(t,e){return function(r,n){var i,s;return n!==null&&!isNaN(+n)&&(UD(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=r,r=n,n=s),i=Os(r,n),mk(this,i,t),this}}function mk(t,e,r,n){var i=e._milliseconds,s=mS(e._days),o=mS(e._months);t.isValid()&&(n=n??!0,o&&QD(t,Of(t,"Month")+o*r),s&&qD(t,"Date",Of(t,"Date")+s*r),i&&t._d.setTime(t._d.valueOf()+i*r),n&&be.updateOffset(t,s||o))}var AX=gk(1,"add"),MX=gk(-1,"subtract");function pk(t){return typeof t=="string"||t instanceof String}function IX(t){return Es(t)||ag(t)||pk(t)||oa(t)||PX(t)||OX(t)||t===null||t===void 0}function OX(t){var e=mc(t)&&!ty(t),r=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,s,o=n.length;for(i=0;i<o;i+=1)s=n[i],r=r||Mt(t,s);return e&&r}function PX(t){var e=bs(t),r=!1;return e&&(r=t.filter(function(n){return!oa(n)&&pk(t)}).length===0),e&&r}function DX(t){var e=mc(t)&&!ty(t),r=!1,n=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,s;for(i=0;i<n.length;i+=1)s=n[i],r=r||Mt(t,s);return e&&r}function kX(t,e){var r=t.diff(e,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"}function NX(t,e){arguments.length===1&&(arguments[0]?IX(arguments[0])?(t=arguments[0],e=void 0):DX(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var r=t||tr(),n=Cy(r,this).startOf("day"),i=be.calendarFormat(this,n)||"sameElse",s=e&&(Eo(e[i])?e[i].call(this,r):e[i]);return this.format(s||this.localeData().calendar(i,this,tr(r)))}function HX(){return new lg(this)}function FX(t,e){var r=Es(t)?t:tr(t);return this.isValid()&&r.isValid()?(e=Ki(e)||"millisecond",e==="millisecond"?this.valueOf()>r.valueOf():r.valueOf()<this.clone().startOf(e).valueOf()):!1}function LX(t,e){var r=Es(t)?t:tr(t);return this.isValid()&&r.isValid()?(e=Ki(e)||"millisecond",e==="millisecond"?this.valueOf()<r.valueOf():this.clone().endOf(e).valueOf()<r.valueOf()):!1}function $X(t,e,r,n){var i=Es(t)?t:tr(t),s=Es(e)?e:tr(e);return this.isValid()&&i.isValid()&&s.isValid()?(n=n||"()",(n[0]==="("?this.isAfter(i,r):!this.isBefore(i,r))&&(n[1]===")"?this.isBefore(s,r):!this.isAfter(s,r))):!1}function BX(t,e){var r=Es(t)?t:tr(t),n;return this.isValid()&&r.isValid()?(e=Ki(e)||"millisecond",e==="millisecond"?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(e).valueOf()<=n&&n<=this.clone().endOf(e).valueOf())):!1}function VX(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function WX(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function UX(t,e,r){var n,i,s;if(!this.isValid())return NaN;if(n=Cy(t,this),!n.isValid())return NaN;switch(i=(n.utcOffset()-this.utcOffset())*6e4,e=Ki(e),e){case"year":s=Im(this,n)/12;break;case"month":s=Im(this,n);break;case"quarter":s=Im(this,n)/3;break;case"second":s=(this-n)/1e3;break;case"minute":s=(this-n)/6e4;break;case"hour":s=(this-n)/36e5;break;case"day":s=(this-n-i)/864e5;break;case"week":s=(this-n-i)/6048e5;break;default:s=this-n}return r?s:$i(s)}function Im(t,e){if(t.date()<e.date())return-Im(e,t);var r=(e.year()-t.year())*12+(e.month()-t.month()),n=t.clone().add(r,"months"),i,s;return e-n<0?(i=t.clone().add(r-1,"months"),s=(e-n)/(n-i)):(i=t.clone().add(r+1,"months"),s=(e-n)/(i-n)),-(r+s)||0}be.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";be.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function YX(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function zX(t){if(!this.isValid())return null;var e=t!==!0,r=e?this.clone().utc():this;return r.year()<0||r.year()>9999?Am(r,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Eo(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Am(r,"Z")):Am(r,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function GX(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",r,n,i,s;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),r="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",s=e+'[")]',this.format(r+n+i+s)}function jX(t){t||(t=this.isUtc()?be.defaultFormatUtc:be.defaultFormat);var e=Am(this,t);return this.localeData().postformat(e)}function KX(t,e){return this.isValid()&&(Es(t)&&t.isValid()||tr(t).isValid())?Os({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function XX(t){return this.from(tr(),t)}function qX(t,e){return this.isValid()&&(Es(t)&&t.isValid()||tr(t).isValid())?Os({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function ZX(t){return this.to(tr(),t)}function wk(t){var e;return t===void 0?this._locale._abbr:(e=ha(t),e!=null&&(this._locale=e),this)}var vk=ji("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 Ck(){return this._locale}var gp=1e3,Xu=60*gp,mp=60*Xu,Sk=(365*400+97)*24*mp;function qu(t,e){return(t%e+e)%e}function xk(t,e,r){return t<100&&t>=0?new Date(t+400,e,r)-Sk:new Date(t,e,r).valueOf()}function yk(t,e,r){return t<100&&t>=0?Date.UTC(t+400,e,r)-Sk:Date.UTC(t,e,r)}function JX(t){var e,r;if(t=Ki(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?yk:xk,t){case"year":e=r(this.year(),0,1);break;case"quarter":e=r(this.year(),this.month()-this.month()%3,1);break;case"month":e=r(this.year(),this.month(),1);break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=r(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=qu(e+(this._isUTC?0:this.utcOffset()*Xu),mp);break;case"minute":e=this._d.valueOf(),e-=qu(e,Xu);break;case"second":e=this._d.valueOf(),e-=qu(e,gp);break}return this._d.setTime(e),be.updateOffset(this,!0),this}function QX(t){var e,r;if(t=Ki(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?yk:xk,t){case"year":e=r(this.year()+1,0,1)-1;break;case"quarter":e=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=r(this.year(),this.month()+1,1)-1;break;case"week":e=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=mp-qu(e+(this._isUTC?0:this.utcOffset()*Xu),mp)-1;break;case"minute":e=this._d.valueOf(),e+=Xu-qu(e,Xu)-1;break;case"second":e=this._d.valueOf(),e+=gp-qu(e,gp)-1;break}return this._d.setTime(e),be.updateOffset(this,!0),this}function eq(){return this._d.valueOf()-(this._offset||0)*6e4}function tq(){return Math.floor(this.valueOf()/1e3)}function rq(){return new Date(this.valueOf())}function nq(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function iq(){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 sq(){return this.isValid()?this.toISOString():null}function oq(){return ry(this)}function aq(){return Za({},ut(this))}function lq(){return ut(this).overflow}function cq(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Ke("N",0,0,"eraAbbr");Ke("NN",0,0,"eraAbbr");Ke("NNN",0,0,"eraAbbr");Ke("NNNN",0,0,"eraName");Ke("NNNNN",0,0,"eraNarrow");Ke("y",["y",1],"yo","eraYear");Ke("y",["yy",2],0,"eraYear");Ke("y",["yyy",3],0,"eraYear");Ke("y",["yyyy",4],0,"eraYear");$e("N",Sy);$e("NN",Sy);$e("NNN",Sy);$e("NNNN",Sq);$e("NNNNN",xq);Wt(["N","NN","NNN","NNNN","NNNNN"],function(t,e,r,n){var i=r._locale.erasParse(t,n,r._strict);i?ut(r).era=i:ut(r).invalidEra=t});$e("y",gh);$e("yy",gh);$e("yyy",gh);$e("yyyy",gh);$e("yo",yq);Wt(["y","yy","yyy","yyyy"],Sn);Wt(["yo"],function(t,e,r,n){var i;r._locale._eraYearOrdinalRegex&&(i=t.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?e[Sn]=r._locale.eraYearOrdinalParse(t,i):e[Sn]=parseInt(t,10)});function uq(t,e){var r,n,i,s=this._eras||ha("en")._eras;for(r=0,n=s.length;r<n;++r){switch(typeof s[r].since){case"string":i=be(s[r].since).startOf("day"),s[r].since=i.valueOf();break}switch(typeof s[r].until){case"undefined":s[r].until=1/0;break;case"string":i=be(s[r].until).startOf("day").valueOf(),s[r].until=i.valueOf();break}}return s}function hq(t,e,r){var n,i,s=this.eras(),o,a,l;for(t=t.toUpperCase(),n=0,i=s.length;n<i;++n)if(o=s[n].name.toUpperCase(),a=s[n].abbr.toUpperCase(),l=s[n].narrow.toUpperCase(),r)switch(e){case"N":case"NN":case"NNN":if(a===t)return s[n];break;case"NNNN":if(o===t)return s[n];break;case"NNNNN":if(l===t)return s[n];break}else if([o,a,l].indexOf(t)>=0)return s[n]}function dq(t,e){var r=t.since<=t.until?1:-1;return e===void 0?be(t.since).year():be(t.since).year()+(e-t.offset)*r}function fq(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t)if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until||n[t].until<=r&&r<=n[t].since)return n[t].name;return""}function gq(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t)if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until||n[t].until<=r&&r<=n[t].since)return n[t].narrow;return""}function mq(){var t,e,r,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t)if(r=this.clone().startOf("day").valueOf(),n[t].since<=r&&r<=n[t].until||n[t].until<=r&&r<=n[t].since)return n[t].abbr;return""}function pq(){var t,e,r,n,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(r=i[t].since<=i[t].until?1:-1,n=this.clone().startOf("day").valueOf(),i[t].since<=n&&n<=i[t].until||i[t].until<=n&&n<=i[t].since)return(this.year()-be(i[t].since).year())*r+i[t].offset;return this.year()}function wq(t){return Mt(this,"_erasNameRegex")||xy.call(this),t?this._erasNameRegex:this._erasRegex}function vq(t){return Mt(this,"_erasAbbrRegex")||xy.call(this),t?this._erasAbbrRegex:this._erasRegex}function Cq(t){return Mt(this,"_erasNarrowRegex")||xy.call(this),t?this._erasNarrowRegex:this._erasRegex}function Sy(t,e){return e.erasAbbrRegex(t)}function Sq(t,e){return e.erasNameRegex(t)}function xq(t,e){return e.erasNarrowRegex(t)}function yq(t,e){return e._eraYearOrdinalRegex||gh}function xy(){var t=[],e=[],r=[],n=[],i,s,o,a,l,c=this.eras();for(i=0,s=c.length;i<s;++i)o=na(c[i].name),a=na(c[i].abbr),l=na(c[i].narrow),e.push(o),t.push(a),r.push(l),n.push(o),n.push(a),n.push(l);this._erasRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+r.join("|")+")","i")}Ke(0,["gg",2],0,function(){return this.weekYear()%100});Ke(0,["GG",2],0,function(){return this.isoWeekYear()%100});function yw(t,e){Ke(0,[t,t.length],0,e)}yw("gggg","weekYear");yw("ggggg","weekYear");yw("GGGG","isoWeekYear");yw("GGGGG","isoWeekYear");$e("G",ww);$e("g",ww);$e("GG",rr,yi);$e("gg",rr,yi);$e("GGGG",ly,ay);$e("gggg",ly,ay);$e("GGGGG",pw,gw);$e("ggggg",pw,gw);ug(["gggg","ggggg","GGGG","GGGGG"],function(t,e,r,n){e[n.substr(0,2)]=St(t)});ug(["gg","GG"],function(t,e,r,n){e[n]=be.parseTwoDigitYear(t)});function bq(t){return bk.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Eq(t){return bk.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Rq(){return ia(this.year(),1,4)}function Tq(){return ia(this.isoWeekYear(),1,4)}function _q(){var t=this.localeData()._week;return ia(this.year(),t.dow,t.doy)}function Aq(){var t=this.localeData()._week;return ia(this.weekYear(),t.dow,t.doy)}function bk(t,e,r,n,i){var s;return t==null?Df(this,n,i).year:(s=ia(t,n,i),e>s&&(e=s),Mq.call(this,t,e,r,n,i))}function Mq(t,e,r,n,i){var s=rk(t,e,r,n,i),o=Pf(s.year,0,s.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}Ke("Q",0,"Qo","quarter");$e("Q",zD);Wt("Q",function(t,e){e[Ko]=(St(t)-1)*3});function Iq(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}Ke("D",["DD",2],"Do","date");$e("D",rr,mh);$e("DD",rr,yi);$e("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});Wt(["D","DD"],so);Wt("Do",function(t,e){e[so]=St(t.match(rr)[0])});var Ek=ph("Date",!0);Ke("DDD",["DDDD",3],"DDDo","dayOfYear");$e("DDD",mw);$e("DDDD",GD);Wt(["DDD","DDDD"],function(t,e,r){r._dayOfYear=St(t)});function Oq(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}Ke("m",["mm",2],0,"minute");$e("m",rr,cy);$e("mm",rr,yi);Wt(["m","mm"],Cs);var Pq=ph("Minutes",!1);Ke("s",["ss",2],0,"second");$e("s",rr,cy);$e("ss",rr,yi);Wt(["s","ss"],Xo);var Dq=ph("Seconds",!1);Ke("S",0,0,function(){return~~(this.millisecond()/100)});Ke(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Ke(0,["SSS",3],0,"millisecond");Ke(0,["SSSS",4],0,function(){return this.millisecond()*10});Ke(0,["SSSSS",5],0,function(){return this.millisecond()*100});Ke(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Ke(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Ke(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Ke(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});$e("S",mw,zD);$e("SS",mw,yi);$e("SSS",mw,GD);var Ja,Rk;for(Ja="SSSS";Ja.length<=9;Ja+="S")$e(Ja,gh);function kq(t,e){e[ac]=St(("0."+t)*1e3)}for(Ja="S";Ja.length<=9;Ja+="S")Wt(Ja,kq);Rk=ph("Milliseconds",!1);Ke("z",0,0,"zoneAbbr");Ke("zz",0,0,"zoneName");function Nq(){return this._isUTC?"UTC":""}function Hq(){return this._isUTC?"Coordinated Universal Time":""}var _e=lg.prototype;_e.add=AX;_e.calendar=NX;_e.clone=HX;_e.diff=UX;_e.endOf=QX;_e.format=jX;_e.from=KX;_e.fromNow=XX;_e.to=qX;_e.toNow=ZX;_e.get=Gj;_e.invalidAt=lq;_e.isAfter=FX;_e.isBefore=LX;_e.isBetween=$X;_e.isSame=BX;_e.isSameOrAfter=VX;_e.isSameOrBefore=WX;_e.isValid=oq;_e.lang=vk;_e.locale=wk;_e.localeData=Ck;_e.max=oX;_e.min=sX;_e.parsingFlags=aq;_e.set=jj;_e.startOf=JX;_e.subtract=MX;_e.toArray=nq;_e.toObject=iq;_e.toDate=rq;_e.toISOString=zX;_e.inspect=GX;typeof Symbol<"u"&&Symbol.for!=null&&(_e[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});_e.toJSON=sq;_e.toString=YX;_e.unix=tq;_e.valueOf=eq;_e.creationData=cq;_e.eraName=fq;_e.eraNarrow=gq;_e.eraAbbr=mq;_e.eraYear=pq;_e.year=XD;_e.isLeapYear=zj;_e.weekYear=bq;_e.isoWeekYear=Eq;_e.quarter=_e.quarters=Iq;_e.month=ek;_e.daysInMonth=rK;_e.week=_e.weeks=uK;_e.isoWeek=_e.isoWeeks=hK;_e.weeksInYear=_q;_e.weeksInWeekYear=Aq;_e.isoWeeksInYear=Rq;_e.isoWeeksInISOWeekYear=Tq;_e.date=Ek;_e.day=_e.days=EK;_e.weekday=RK;_e.isoWeekday=TK;_e.dayOfYear=Oq;_e.hour=_e.hours=DK;_e.minute=_e.minutes=Pq;_e.second=_e.seconds=Dq;_e.millisecond=_e.milliseconds=Rk;_e.utcOffset=mX;_e.utc=wX;_e.local=vX;_e.parseZone=CX;_e.hasAlignedHourOffset=SX;_e.isDST=xX;_e.isLocal=bX;_e.isUtcOffset=EX;_e.isUtc=fk;_e.isUTC=fk;_e.zoneAbbr=Nq;_e.zoneName=Hq;_e.dates=ji("dates accessor is deprecated. Use date instead.",Ek);_e.months=ji("months accessor is deprecated. Use month instead",ek);_e.years=ji("years accessor is deprecated. Use year instead",XD);_e.zone=ji("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",pX);_e.isDSTShifted=ji("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",yX);function Fq(t){return tr(t*1e3)}function Lq(){return tr.apply(null,arguments).parseZone()}function Tk(t){return t}var It=iy.prototype;It.calendar=bj;It.longDateFormat=_j;It.invalidDate=Mj;It.ordinal=Pj;It.preparse=Tk;It.postformat=Tk;It.relativeTime=kj;It.pastFuture=Nj;It.set=xj;It.eras=uq;It.erasParse=hq;It.erasConvertYear=dq;It.erasAbbrRegex=vq;It.erasNameRegex=wq;It.erasNarrowRegex=Cq;It.months=Jj;It.monthsShort=Qj;It.monthsParse=tK;It.monthsRegex=iK;It.monthsShortRegex=nK;It.week=oK;It.firstDayOfYear=cK;It.firstDayOfWeek=lK;It.weekdays=CK;It.weekdaysMin=xK;It.weekdaysShort=SK;It.weekdaysParse=bK;It.weekdaysRegex=_K;It.weekdaysShortRegex=AK;It.weekdaysMinRegex=MK;It.isPM=OK;It.meridiem=kK;function pp(t,e,r,n){var i=ha(),s=bo().set(n,e);return i[r](s,t)}function _k(t,e,r){if(oa(t)&&(e=t,t=void 0),t=t||"",e!=null)return pp(t,e,r,"month");var n,i=[];for(n=0;n<12;n++)i[n]=pp(t,n,r,"month");return i}function yy(t,e,r,n){typeof t=="boolean"?(oa(e)&&(r=e,e=void 0),e=e||""):(e=t,r=e,t=!1,oa(e)&&(r=e,e=void 0),e=e||"");var i=ha(),s=t?i._week.dow:0,o,a=[];if(r!=null)return pp(e,(r+s)%7,n,"day");for(o=0;o<7;o++)a[o]=pp(e,(o+s)%7,n,"day");return a}function $q(t,e){return _k(t,e,"months")}function Bq(t,e){return _k(t,e,"monthsShort")}function Vq(t,e,r){return yy(t,e,r,"weekdays")}function Wq(t,e,r){return yy(t,e,r,"weekdaysShort")}function Uq(t,e,r){return yy(t,e,r,"weekdaysMin")}il("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,r=St(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+r}});be.lang=ji("moment.lang is deprecated. Use moment.locale instead.",il);be.langData=ji("moment.langData is deprecated. Use moment.localeData instead.",ha);var Mo=Math.abs;function Yq(){var t=this._data;return this._milliseconds=Mo(this._milliseconds),this._days=Mo(this._days),this._months=Mo(this._months),t.milliseconds=Mo(t.milliseconds),t.seconds=Mo(t.seconds),t.minutes=Mo(t.minutes),t.hours=Mo(t.hours),t.months=Mo(t.months),t.years=Mo(t.years),this}function Ak(t,e,r,n){var i=Os(e,r);return t._milliseconds+=n*i._milliseconds,t._days+=n*i._days,t._months+=n*i._months,t._bubble()}function zq(t,e){return Ak(this,t,e,1)}function Gq(t,e){return Ak(this,t,e,-1)}function P_(t){return t<0?Math.floor(t):Math.ceil(t)}function jq(){var t=this._milliseconds,e=this._days,r=this._months,n=this._data,i,s,o,a,l;return t>=0&&e>=0&&r>=0||t<=0&&e<=0&&r<=0||(t+=P_(wS(r)+e)*864e5,e=0,r=0),n.milliseconds=t%1e3,i=$i(t/1e3),n.seconds=i%60,s=$i(i/60),n.minutes=s%60,o=$i(s/60),n.hours=o%24,e+=$i(o/24),l=$i(Mk(e)),r+=l,e-=P_(wS(l)),a=$i(r/12),r%=12,n.days=e,n.months=r,n.years=a,this}function Mk(t){return t*4800/146097}function wS(t){return t*146097/4800}function Kq(t){if(!this.isValid())return NaN;var e,r,n=this._milliseconds;if(t=Ki(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+n/864e5,r=this._months+Mk(e),t){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(e=this._days+Math.round(wS(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return e*24+n/36e5;case"minute":return e*1440+n/6e4;case"second":return e*86400+n/1e3;case"millisecond":return Math.floor(e*864e5)+n;default:throw new Error("Unknown unit "+t)}}function da(t){return function(){return this.as(t)}}var Ik=da("ms"),Xq=da("s"),qq=da("m"),Zq=da("h"),Jq=da("d"),Qq=da("w"),eZ=da("M"),tZ=da("Q"),rZ=da("y"),nZ=Ik;function iZ(){return Os(this)}function sZ(t){return t=Ki(t),this.isValid()?this[t+"s"]():NaN}function Wc(t){return function(){return this.isValid()?this._data[t]:NaN}}var oZ=Wc("milliseconds"),aZ=Wc("seconds"),lZ=Wc("minutes"),cZ=Wc("hours"),uZ=Wc("days"),hZ=Wc("months"),dZ=Wc("years");function fZ(){return $i(this.days()/7)}var Bo=Math.round,Lu={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function gZ(t,e,r,n,i){return i.relativeTime(e||1,!!r,t,n)}function mZ(t,e,r,n){var i=Os(t).abs(),s=Bo(i.as("s")),o=Bo(i.as("m")),a=Bo(i.as("h")),l=Bo(i.as("d")),c=Bo(i.as("M")),u=Bo(i.as("w")),h=Bo(i.as("y")),d=s<=r.ss&&["s",s]||s<r.s&&["ss",s]||o<=1&&["m"]||o<r.m&&["mm",o]||a<=1&&["h"]||a<r.h&&["hh",a]||l<=1&&["d"]||l<r.d&&["dd",l];return r.w!=null&&(d=d||u<=1&&["w"]||u<r.w&&["ww",u]),d=d||c<=1&&["M"]||c<r.M&&["MM",c]||h<=1&&["y"]||["yy",h],d[2]=e,d[3]=+t>0,d[4]=n,gZ.apply(null,d)}function pZ(t){return t===void 0?Bo:typeof t=="function"?(Bo=t,!0):!1}function wZ(t,e){return Lu[t]===void 0?!1:e===void 0?Lu[t]:(Lu[t]=e,t==="s"&&(Lu.ss=e-1),!0)}function vZ(t,e){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=Lu,i,s;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(r=t),typeof e=="object"&&(n=Object.assign({},Lu,e),e.s!=null&&e.ss==null&&(n.ss=e.s-1)),i=this.localeData(),s=mZ(this,!r,n,i),r&&(s=i.pastFuture(+this,s)),i.postformat(s)}var zv=Math.abs;function jc(t){return(t>0)-(t<0)||+t}function bw(){if(!this.isValid())return this.localeData().invalidDate();var t=zv(this._milliseconds)/1e3,e=zv(this._days),r=zv(this._months),n,i,s,o,a=this.asSeconds(),l,c,u,h;return a?(n=$i(t/60),i=$i(n/60),t%=60,n%=60,s=$i(r/12),r%=12,o=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",c=jc(this._months)!==jc(a)?"-":"",u=jc(this._days)!==jc(a)?"-":"",h=jc(this._milliseconds)!==jc(a)?"-":"",l+"P"+(s?c+s+"Y":"")+(r?c+r+"M":"")+(e?u+e+"D":"")+(i||n||t?"T":"")+(i?h+i+"H":"")+(n?h+n+"M":"")+(t?h+o+"S":"")):"P0D"}var Tt=xw.prototype;Tt.isValid=hX;Tt.abs=Yq;Tt.add=zq;Tt.subtract=Gq;Tt.as=Kq;Tt.asMilliseconds=Ik;Tt.asSeconds=Xq;Tt.asMinutes=qq;Tt.asHours=Zq;Tt.asDays=Jq;Tt.asWeeks=Qq;Tt.asMonths=eZ;Tt.asQuarters=tZ;Tt.asYears=rZ;Tt.valueOf=nZ;Tt._bubble=jq;Tt.clone=iZ;Tt.get=sZ;Tt.milliseconds=oZ;Tt.seconds=aZ;Tt.minutes=lZ;Tt.hours=cZ;Tt.days=uZ;Tt.weeks=fZ;Tt.months=hZ;Tt.years=dZ;Tt.humanize=vZ;Tt.toISOString=bw;Tt.toString=bw;Tt.toJSON=bw;Tt.locale=wk;Tt.localeData=Ck;Tt.toIsoString=ji("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",bw);Tt.lang=vk;Ke("X",0,0,"unix");Ke("x",0,0,"valueOf");$e("x",ww);$e("X",$j);Wt("X",function(t,e,r){r._d=new Date(parseFloat(t)*1e3)});Wt("x",function(t,e,r){r._d=new Date(St(t))});//! moment.js
  49. be.version="2.30.1";Cj(tr);be.fn=_e;be.min=aX;be.max=lX;be.now=cX;be.utc=bo;be.unix=Fq;be.months=$q;be.isDate=ag;be.locale=il;be.invalid=fw;be.duration=Os;be.isMoment=Es;be.weekdays=Vq;be.parseZone=Lq;be.localeData=ha;be.isDuration=Mm;be.monthsShort=Bq;be.weekdaysMin=Uq;be.defineLocale=gy;be.updateLocale=LK;be.locales=$K;be.weekdaysShort=Wq;be.normalizeUnits=Ki;be.relativeTimeRounding=pZ;be.relativeTimeThreshold=wZ;be.calendarFormat=kX;be.prototype=_e;be.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 CZ(t){const e=t.length;let r=0;for(;r<e;)t[r]=[t[r]],r+=1}function D_(t,e){const r=e.length;let n=0;for(;n<r;)t.push(e[n]),n+=1}function Om(t){const e=[];if(!t||t.length===0||!t[0]||t[0].length===0)return e;const r=t.length,n=t[0].length;for(let i=0;i<r;i++)for(let s=0;s<n;s++)e[s]||(e[s]=[]),e[s][i]=t[i][s];return e}function Rn(t,e,r,n){let i=-1,s=t,o=r;Array.isArray(t)||(s=Array.from(t));const a=s.length;for(i+=1;i<a;)o=e(o,s[i],i,s),i+=1;return o}function Rs(t,e){let r=0,n=t;Array.isArray(t)||(n=Array.from(t));const i=n.length,s=[];let o=-1;for(;r<i;){const a=n[r];e(a,r,n)&&(o+=1,s[o]=a),r+=1}return s}function wt(t,e){let r=0,n=t;Array.isArray(t)||(n=Array.from(t));const i=n.length,s=[];let o=-1;for(;r<i;){const a=n[r];o+=1,s[o]=e(a,r,n),r+=1}return s}function j(t,e){let r=0,n=t;Array.isArray(t)||(n=Array.from(t));const i=n.length;for(;r<i&&e(n[r],r,n)!==!1;)r+=1;return t}function Ok(t){const e=[];return j(t,r=>{e.indexOf(r)===-1&&e.push(r)}),e}function k_(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];const[n,...i]=[...e];let s=n;return j(i,o=>{s=s.filter(a=>!o.includes(a))}),s}function N_(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ";return t.split(e)}function Dt(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return Rn(t,(s,o,a)=>{const l=o.replace(/\r?\n\s*/g,""),c=r[a]?r[a]:"";return s+l+c},"").trim()}function Ar(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 Le(t){return typeof t<"u"}function Zt(t){return typeof t>"u"}function yr(t){return t===null||t===""||Zt(t)}function SZ(t){return Object.prototype.toString.call(t)==="[object RegExp]"}const Hd="length",Jd=t=>parseInt(t,16),H_=t=>parseInt(t,10),wp=(t,e,r)=>t.substr(e,r),Qd=t=>t.codePointAt(0)-65,vS=t=>`${t}`.replace(/\-/g,""),xZ=t=>Jd(wp(vS(t),Jd("12"),Qd("F")))/(Jd(wp(vS(t),Qd("B"),~~![][Hd]))||9),yZ=()=>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 F_=!1;const L_={invalid:()=>Dt`
  50. The license key for Handsontable is invalid.\x20
  51. If you need any help, contact us at support@handsontable.com.`,expired:t=>{let{keyValidityDate:e,hotVersion:r}=t;return Dt`
  52. The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
  53. version ${r}. Renew your license key at handsontable.com or downgrade to a version released prior\x20
  54. to ${e}. If you need any help, contact us at sales@handsontable.com.`},missing:()=>Dt`
  55. The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
  56. Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
  57. passing the key: 'non-commercial-and-evaluation'. If you need any help, contact\x20
  58. us at support@handsontable.com.`,non_commercial:()=>""},$_={invalid:()=>Dt`
  59. The license key for Handsontable is invalid.\x20
  60. <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> on how to\x20
  61. install it properly or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,expired:t=>{let{keyValidityDate:e,hotVersion:r}=t;return Dt`
  62. The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
  63. version ${r}. <a href="https://handsontable.com/pricing" target="_blank">Renew</a> your\x20
  64. license key or downgrade to a version released prior to ${e}. If you need any\x20
  65. help, contact us at <a href="mailto:sales@handsontable.com">sales@handsontable.com</a>.`},missing:()=>Dt`
  66. The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
  67. Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
  68. passing the key: 'non-commercial-and-evaluation'.\x20
  69. <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> about it in\x20
  70. the documentation or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,non_commercial:()=>""};function bZ(t,e){const r=!yr(t),n=typeof t=="string"&&t.toLowerCase()==="non-commercial-and-evaluation",i="14.4.0";let s,o="invalid",a="invalid";t=vS(t||"");const l=EZ(t);if(r||n||l)if(l){const c=be("11/06/2024","DD/MM/YYYY"),u=Math.floor(c.toDate().getTime()/864e5),h=xZ(t);s=be((h+1)*864e5,"x").format("MMMM DD, YYYY"),u>h?(o="expired",a="expired"):(o="valid",a="valid")}else n?(o="non_commercial",a="valid"):(o="invalid",a="invalid");else o="missing",a="missing";if(yZ()&&(o="valid",a="valid"),!F_&&o!=="valid"&&(L_[o]({keyValidityDate:s,hotVersion:i})&&console[o==="non_commercial"?"info":"warn"](L_[o]({keyValidityDate:s,hotVersion:i})),F_=!0),a!=="valid"&&e.parentNode&&$_[a]({keyValidityDate:s,hotVersion:i})){const u=document.createElement("div");u.className="hot-display-license-info",u.innerHTML=$_[a]({keyValidityDate:s,hotVersion:i}),e.parentNode.insertBefore(u,e.nextSibling)}}function EZ(t){let e=[][Hd],r=e;if(t[Hd]!==Qd("Z"))return!1;for(let n="",i="B<H4P+".split(""),s=Qd(i.shift());s;s=Qd(i.shift()||"A"))--s<""[Hd]?r=r|(H_(`${H_(Jd(n)+(Jd(wp(t,Math.abs(s),2))+[]).padStart(2,"0"))}`)%97||2)>>1:n=wp(t,s,s?i[Hd]===1?9:8:6);return r===e}function Ts(t){return t[0].toUpperCase()+t.substr(1)}function Pk(){function t(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return t()+t()+t()+t()}function Dk(t){return/^([0-9][0-9]?%$)|(^100%$)/.test(t)}function kk(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return`${t}`.replace(/(?:\\)?\[([^[\]]+)]/g,(r,n)=>r.charAt(0)==="\\"?r.substr(1,r.length-1):e[n]===void 0?"":e[n])}function B_(t){return by(`${t}`,{ALLOWED_TAGS:[]})}function by(t,e){return vj.sanitize(t,e)}const wh=t=>["tabindex",t],RZ=()=>["role","treegrid"],co=()=>["role","presentation"],TZ=()=>["role","gridcell"],_Z=()=>["role","rowheader"],Nk=()=>["role","rowgroup"],AZ=()=>["role","columnheader"],CS=()=>["role","row"],MZ=()=>["role","menu"],IZ=()=>["role","menuitem"],OZ=()=>["role","combobox"],Hk=()=>["role","listbox"],PZ=()=>["role","option"],DZ=()=>["role","checkbox"],kZ=()=>["scope","col"],NZ=()=>["scope","row"],HZ=()=>["type","text"],Ey=t=>["aria-label",t],fa=()=>["aria-hidden","true"],FZ=()=>["aria-disabled","true"],LZ=()=>["aria-multiselectable","true"],Fk=t=>["aria-haspopup",t],Lk=t=>["aria-rowcount",t],Ew=t=>["aria-colcount",t],$k=t=>["aria-rowindex",t],Ry=t=>["aria-colindex",t],Wi=t=>["aria-expanded",t],$Z=t=>["aria-sort",t],V_=()=>["aria-readonly","true"],W_=()=>["aria-invalid","true"],BZ=t=>["aria-checked",t],Ty=()=>["aria-selected","true"],VZ=()=>["aria-autocomplete","list"],WZ=t=>["aria-controls",t],UZ=t=>["aria-activedescendant",t],YZ=t=>["aria-live",t],zZ=t=>["aria-relevant",t],GZ=t=>["aria-setsize",t],jZ=t=>["aria-posinset",t];function KZ(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=null,i=t;for(;i!==null;){if(r===e){n=i;break}i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:(r+=1,i=i.parentNode)}return n}function XZ(t,e){const r=t.closest(".handsontable");return!!r&&(r.parentNode===e||r===e)}function qZ(t){return Object.getPrototypeOf(t.parent)&&t.frameElement}function sh(t){return qZ(t)&&t.parent}function Sc(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const{ELEMENT_NODE:n,DOCUMENT_FRAGMENT_NODE:i}=Node;let s=t;for(;s!=null&&s!==r;){const{nodeType:o,nodeName:a}=s;if(o===n&&(e.includes(a)||e.includes(s)))return s;const{host:l}=s;l&&o===i?s=l:s=s.parentNode}return null}function e0(t,e,r){const n=[];let i=t;for(;i&&(i=Sc(i,e,r),!(!i||r&&!r.contains(i)));)n.push(i),i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:i=i.parentNode;const s=n.length;return s?n[s-1]:null}function pc(t,e){let r=t.parentNode,n=[];for(typeof e=="string"?t.defaultView?n=Array.prototype.slice.call(t.querySelectorAll(e),0):n=Array.prototype.slice.call(t.ownerDocument.querySelectorAll(e),0):n.push(e);r!==null;){if(n.indexOf(r)>-1)return!0;r=r.parentNode}return!1}function ZZ(t){let e=0,r=t;if(r.previousSibling)for(;r=r.previousSibling;)e+=1;return e}function El(t,e,r){const n=r.parentElement.querySelector(`.ht_clone_${t}`);return n?n.contains(e):null}function Bk(t){return!t||!t.length?[]:t.filter(e=>!!e)}function Vk(t,e){if(!t||!t.length)return{regexFree:[],regexes:[]};const r=[],n=[];return n.push(...t.filter(i=>{const s=i instanceof RegExp;return s&&e&&r.push(i),!s})),{regexFree:n,regexes:r}}function Ze(t,e){return t.classList===void 0||typeof e!="string"||e===""?!1:t.classList.contains(e)}function Re(t,e){typeof e=="string"&&(e=e.split(" ")),e=Bk(e),e.length>0&&t.classList.add(...e)}function rt(t,e){typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);let{regexFree:r,regexes:n}=Vk(e,!0);r=Bk(r),r.length>0&&t.classList.remove(...r),n.forEach(i=>{t.classList.forEach(s=>{i.test(s)&&t.classList.remove(s)})})}function Xe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;Array.isArray(e)||(e=[[e,r]]),e.forEach(n=>{Array.isArray(n)&&n[0]!==""&&t.setAttribute(...n)})}function vh(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:r,regexes:n}=Vk(e,!0);r.forEach(i=>{i!==""&&t.removeAttribute(i)}),n.forEach(i=>{t.getAttributeNames().forEach(s=>{i.test(s)&&t.removeAttribute(s)})})}function Wk(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 r=e.length-1;r>=0;r--)Wk(e[r])}}function mo(t){let e;for(;e=t.lastChild;)t.removeChild(e)}const JZ=/(<(.*)>|&(.*);)/;function Ch(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;JZ.test(e)?t.innerHTML=r?by(e):e:xc(t,e)}function xc(t,e){const r=t.firstChild;r&&r.nodeType===3&&r.nextSibling===null?r.textContent=e:(mo(t),t.appendChild(t.ownerDocument.createTextNode(e)))}function yc(t){const e=t.ownerDocument.documentElement;let r=t;for(;r!==e;){if(r===null)return!1;if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE)if(r.host){if(r.host.impl)return yc(r.host.impl);if(r.host)return yc(r.host);throw new Error("Lost in Web Components world")}else return!1;else if(hl(r).display==="none")return!1;r=r.parentNode}return!0}function Zr(t){const e=t.ownerDocument,r=e.defaultView,n=e.documentElement;let i=t,s,o,a;for(s=i.offsetLeft,o=i.offsetTop,a=i;(i=i.offsetParent)&&!(i===e.body||!("offsetLeft"in i));)s+=i.offsetLeft,o+=i.offsetTop,a=i;return a&&a.style.position==="fixed"&&(s+=r.pageXOffset||n.scrollLeft,o+=r.pageYOffset||n.scrollTop),{left:s,top:o}}function Uk(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollY}function _y(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollX}function Ay(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?Uk(e):t.scrollTop}function Yk(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?_y(e):t.scrollLeft}function vp(t){let e=t.ownerDocument,r=e?e.defaultView:void 0;e||(e=t.document?t.document:t,r=e.defaultView);const n=["auto","scroll"];let i=t.parentNode;for(;i&&i.style&&e.body!==i;){let{overflow:s,overflowX:o,overflowY:a}=i.style;if([s,o,a].includes("scroll"))return i;if({overflow:s,overflowX:o,overflowY:a}=r.getComputedStyle(i),n.includes(s)||n.includes(o)||n.includes(a)||i.clientHeight<=i.scrollHeight+1&&(n.includes(a)||n.includes(s))||i.clientWidth<=i.scrollWidth+1&&(n.includes(o)||n.includes(s)))return i;i=i.parentNode}return r}function QZ(t){return t.scrollHeight-t.clientHeight}function eJ(t){return t.scrollWidth-t.clientWidth}function oh(t){const e=t.ownerDocument,r=e.defaultView;let n=t.parentNode;for(;n&&n.style&&e.body!==n;){if(n.style.overflow!=="visible"&&n.style.overflow!=="")return n;const i=hl(n,r),s=["scroll","hidden","auto"],o=i.getPropertyValue("overflow"),a=i.getPropertyValue("overflow-y"),l=i.getPropertyValue("overflow-x");if(s.includes(o)||s.includes(a)||s.includes(l))return n;n=n.parentNode}return r}function Nf(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window;if(t){if(t===r)return e==="width"?`${r.innerWidth}px`:e==="height"?`${r.innerHeight}px`:void 0}else return;const n=t.style[e];if(n!==""&&n!==void 0)return n;const i=hl(t,r);if(i[e]!==""&&i[e]!==void 0)return i[e]}function hl(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t.currentStyle||e.getComputedStyle(t)}function Bt(t){return t.offsetWidth}function pr(t){return t.offsetHeight}function $u(t){return t.clientHeight||t.innerHeight}function zk(t){return t.clientWidth||t.innerWidth}function Gk(t){return t.selectionStart?t.selectionStart:0}function tJ(t){return t.selectionEnd?t.selectionEnd:0}function U_(){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 Rw(t,e,r){if(r===void 0&&(r=e),t.setSelectionRange){t.focus();try{t.setSelectionRange(e,r)}catch{const i=t.parentNode,s=i.style.display;i.style.display="block",t.setSelectionRange(e,r),i.style.display=s}}}let Gv;function rJ(){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 r=t.createElement("div");r.style.boxSizing="content-box",r.style.height="150px",r.style.left="0px",r.style.overflow="hidden",r.style.position="absolute",r.style.top="0px",r.style.width="200px",r.style.visibility="hidden",r.appendChild(e),(t.body||t.documentElement).appendChild(r);const n=e.offsetWidth;r.style.overflow="scroll";let i=e.offsetWidth;return n===i&&(i=r.clientWidth),(t.body||t.documentElement).removeChild(r),n-i}function Qr(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return Gv===void 0&&(Gv=rJ(t)),Gv}function nJ(t){return t.offsetWidth!==t.clientWidth}function iJ(t){return t.offsetHeight!==t.clientHeight}function My(t,e,r){t.style.transform=`translate3d(${e},${r},0)`}function Tw(t){t.style.transform&&t.style.transform!==""&&(t.style.transform="")}function Pm(t){return t&&(["INPUT","SELECT","TEXTAREA"].indexOf(t.nodeName)>-1||t.contentEditable==="true")}function jk(t){return Pm(t)&&t.hasAttribute("data-hot-input")===!1}function Kk(t){return!t.parentNode}function sJ(t,e){new IntersectionObserver((n,i)=>{n.forEach(s=>{s.isIntersecting&&t.offsetParent!==null&&(e(),i.unobserve(t))})},{root:t.ownerDocument.body}).observe(t)}function Xk(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const n=t.ownerDocument,i=n.createRange(),s=n.defaultView.getSelection();Xe(t,"contenteditable",!0),r&&Xe(t,...fa()),e&&Re(t,"invisibleSelection"),i.selectNodeContents(t),s.removeAllRanges(),s.addRange(i)}function qk(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const r=t.ownerDocument.defaultView.getSelection();t.hasAttribute("aria-hidden")&&t.removeAttribute("aria-hidden"),r.removeAllRanges(),e&&rt(t,"invisibleSelection"),t.removeAttribute("contenteditable")}function oJ(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;Xk(t,r),e(),qk(t,r)}function Xt(t){return typeof t=="function"}function Iy(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200,r=null,n;function i(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return r&&clearTimeout(r),r=setTimeout(()=>{n=t.apply(this,o)},e),n}return i}function Zk(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return t.apply(this,r.concat(o))}}function aJ(t){const e=t.length;function r(n){return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];const l=n.concat(o);let c;return l.length>=e?c=t.apply(this,l):c=r(l),c}}return r([])}function SS(t,e,r,n,i,s,o,a){return Le(a)?t.call(e,r,n,i,s,o,a):Le(o)?t.call(e,r,n,i,s,o):Le(s)?t.call(e,r,n,i,s):Le(i)?t.call(e,r,n,i):Le(n)?t.call(e,r,n):Le(r)?t.call(e,r):t.call(e)}var lJ=Ur,Y_=SD,cJ=an,z_=Hc,uJ=jx,G_=lJ([].push),hJ=function(t){if(cJ(t))return t;if(Y_(t)){for(var e=t.length,r=[],n=0;n<e;n++){var i=t[n];typeof i=="string"?G_(r,i):(typeof i=="number"||z_(i)==="Number"||z_(i)==="String")&&G_(r,uJ(i))}var s=r.length,o=!0;return function(a,l){if(o)return o=!1,l;if(Y_(this))return l;for(var c=0;c<s;c++)if(r[c]===a)return l}}},dJ=En,Jk=fh,Qk=dw,fJ=Is,hg=Ur,eN=xi,j_=an,K_=$x,tN=Qx,gJ=hJ,mJ=Lx,pJ=String,sl=Jk("JSON","stringify"),t0=hg(/./.exec),X_=hg("".charAt),wJ=hg("".charCodeAt),vJ=hg("".replace),CJ=hg(1 .toString),SJ=/[\uD800-\uDFFF]/g,q_=/^[\uD800-\uDBFF]$/,Z_=/^[\uDC00-\uDFFF]$/,J_=!mJ||eN(function(){var t=Jk("Symbol")("stringify detection");return sl([t])!=="[null]"||sl({a:t})!=="{}"||sl(Object(t))!=="{}"}),Q_=eN(function(){return sl("\uDF06\uD834")!=='"\\udf06\\ud834"'||sl("\uDEAD")!=='"\\udead"'}),xJ=function(t,e){var r=tN(arguments),n=gJ(e);if(!(!j_(n)&&(t===void 0||K_(t))))return r[1]=function(i,s){if(j_(n)&&(s=fJ(n,this,pJ(i),s)),!K_(s))return s},Qk(sl,null,r)},yJ=function(t,e,r){var n=X_(r,e-1),i=X_(r,e+1);return t0(q_,t)&&!t0(Z_,i)||t0(Z_,t)&&!t0(q_,n)?"\\u"+CJ(wJ(t,0),16):t};sl&&dJ({target:"JSON",stat:!0,arity:3,forced:J_||Q_},{stringify:function(e,r,n){var i=tN(arguments),s=Qk(J_?xJ:sl,null,i);return Q_&&typeof s=="string"?vJ(s,SJ,yJ):s}});function Hf(t){let e;return Array.isArray(t)?e=t.length?new Array(t.length).fill(null):[]:(e={},dt(t,(r,n)=>{n!=="__children"&&(r&&typeof r=="object"&&!Array.isArray(r)?e[n]=Hf(r):Array.isArray(r)?r.length&&typeof r[0]=="object"&&!Array.isArray(r[0])?e[n]=[Hf(r[0])]:e[n]=[]:e[n]=null)})),e}function ga(t,e){return e.prototype.constructor=e,t.prototype=new e,t.prototype.constructor=t,t}function kr(t,e,r){const n=Array.isArray(r);return dt(e,(i,s)=>{(n===!1||r.includes(s))&&(t[s]=i)}),t}function _w(t,e){dt(e,(r,n)=>{e[n]&&typeof e[n]=="object"?(t[n]||(Array.isArray(e[n])?t[n]=[]:Object.prototype.toString.call(e[n])==="[object Date]"?t[n]=e[n]:t[n]={}),_w(t[n],e[n])):t[n]=e[n]})}function Vn(t){return typeof t=="object"?JSON.parse(JSON.stringify(t)):t}function _s(t){const e={};return dt(t,(r,n)=>{e[n]=r}),e}function zt(t){t.MIXINS||(t.MIXINS=[]);for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return j(r,i=>{t.MIXINS.push(i.MIXIN_NAME),dt(i,(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(u,h){const d=`_${u}`,f=g=>{let m=g;return(Array.isArray(m)||at(m))&&(m=Vn(m)),m};return function(){return this[d]===void 0&&(this[d]=f(h)),this[d]}},l=function(u){const h=`_${u}`;return function(d){this[h]=d}};Object.defineProperty(t.prototype,o,{get:a(o,s),set:l(o),configurable:!0})}})}),t}function Oy(t,e){return JSON.stringify(t)===JSON.stringify(e)}function at(t){return Object.prototype.toString.call(t)==="[object Object]"}function ma(t,e,r,n){n.value=r,n.writable=n.writable!==!1,n.enumerable=n.enumerable!==!1,n.configurable=n.configurable!==!1,Object.defineProperty(t,e,n)}function dt(t,e){for(const r in t)if((!t.hasOwnProperty||t.hasOwnProperty&&Object.prototype.hasOwnProperty.call(t,r))&&e(t[r],r,t)===!1)break;return t}function bJ(t,e){const r=e.split(".");let n=t;return dt(r,i=>{if(n=n[i],n===void 0)return n=void 0,!1}),n}function jv(t,e,r){const n=e.split(".");let i=t;n.forEach((s,o)=>{o!==n.length-1?(mr(i,s)||(i[s]={}),i=i[s]):i[s]=r})}function Py(t){if(!at(t))return 0;const e=function(r){let n=0;return at(r)?dt(r,(i,s)=>{s!=="__children"&&(n+=e(i))}):n+=1,n};return e(t)}function Ss(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"value";const r=`_${e}`,n={_touched:!1,[r]:t,isTouched(){return this._touched}};return Object.defineProperty(n,e,{get(){return this[r]},set(i){this._touched=!0,this[r]=i},enumerable:!0,configurable:!0}),n}function mr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Dy(t){return window.requestAnimationFrame(t)}function Cp(t){window.cancelAnimationFrame(t)}function rN(){return"ontouchstart"in window}function EJ(){return typeof window<"u"}let Kc;function RJ(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Kc||(typeof Intl=="object"?Kc=new Intl.Collator(t,e).compare:typeof String.prototype.localeCompare=="function"?Kc=(r,n)=>`${r}`.localeCompare(n):Kc=(r,n)=>r===n?0:r>n?-1:1,Kc)}const ki=t=>{const e={value:!1};return e.test=(r,n)=>{e.value=t(r,n)},e},wl={chrome:ki((t,e)=>/Chrome/.test(t)&&/Google/.test(e)),chromeWebKit:ki(t=>/CriOS/.test(t)),edge:ki(t=>/Edge/.test(t)),edgeWebKit:ki(t=>/EdgiOS/.test(t)),firefox:ki(t=>/Firefox/.test(t)),firefoxWebKit:ki(t=>/FxiOS/.test(t)),mobile:ki(t=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t)),safari:ki((t,e)=>/Safari/.test(t)&&/Apple Computer/.test(e))},dg={mac:ki(t=>/^Mac/.test(t)),win:ki(t=>/^Win/.test(t)),linux:ki(t=>/^Linux/.test(t)),ios:ki(t=>/iPhone|iPad|iPod/i.test(t))};function TJ(){let{userAgent:t=navigator.userAgent,vendor:e=navigator.vendor}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(wl,r=>{let{test:n}=r;return void n(t,e)})}function _J(){let{platform:t=navigator.platform}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dt(dg,e=>{let{test:r}=e;return void r(t)})}EJ()&&(TJ(),_J());function nN(){return wl.chrome.value}function AJ(){return wl.chromeWebKit.value}function Kv(){return wl.firefox.value}function MJ(){return wl.firefoxWebKit.value}function iN(){return wl.safari.value}function IJ(){return wl.edge.value}function Qa(){return wl.mobile.value}function sN(){return dg.ios.value}function oN(){let{maxTouchPoints:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:navigator;return t>2&&dg.mac.value}function eA(){return dg.win.value}function xS(){return dg.mac.value}const je={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:Kv()?182:174,AUDIO_MUTE:Kv()?181:173,AUDIO_UP:Kv()?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},OJ=[je.ALT,je.ARROW_DOWN,je.ARROW_LEFT,je.ARROW_RIGHT,je.ARROW_UP,je.AUDIO_DOWN,je.AUDIO_MUTE,je.AUDIO_UP,je.BACKSPACE,je.CAPS_LOCK,je.DELETE,je.END,je.ENTER,je.ESCAPE,je.F1,je.F2,je.F3,je.F4,je.F5,je.F6,je.F7,je.F8,je.F9,je.F10,je.F11,je.F12,je.F13,je.F14,je.F15,je.F16,je.F17,je.F18,je.F19,je.HOME,je.INSERT,je.MEDIA_NEXT,je.MEDIA_PLAY_PAUSE,je.MEDIA_PREV,je.MEDIA_STOP,je.NULL,je.NUM_LOCK,je.PAGE_DOWN,je.PAGE_UP,je.PAUSE,je.SCROLL_LOCK,je.SHIFT,je.TAB];function PJ(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 aN(t){return OJ.includes(t)}function DJ(t){return[je.CONTROL,je.COMMAND_LEFT,je.COMMAND_RIGHT,je.COMMAND_FIREFOX].includes(t)}function fg(t,e){const r=e.split("|");let n=!1;return j(r,i=>{if(t===je[i])return n=!0,!1}),n}function Ps(t){t.isImmediatePropagationEnabled=!1,t.cancelBubble=!0}function sc(t){return t.isImmediatePropagationEnabled===!1}function bc(t){return t.button===2}function ky(t){return t.button===0}function kJ(t,e){const r={x:t.offsetX,y:t.offsetY};let n=t.target;if(!(e instanceof HTMLElement)||n!==e&&n.contains(e))return r;for(;n!==e;)r.x+=n.offsetLeft,r.y+=n.offsetTop,n=n.offsetParent;return r}var lN={},NJ=lD,HJ=Gx,FJ=Object.keys||function(e){return NJ(e,HJ)},LJ=Ms,$J=tD,BJ=pl,VJ=ua,WJ=aw,UJ=FJ;lN.f=LJ&&!$J?Object.defineProperties:function(e,r){VJ(e);for(var n=WJ(r),i=UJ(r),s=i.length,o=0,a;s>o;)BJ.f(e,a=i[o++],n[a]);return e};var YJ=ua,zJ=lN,tA=Gx,GJ=Yx,jJ=PD,KJ=Wx,XJ=iD,rA=">",nA="<",yS="prototype",bS="script",cN=XJ("IE_PROTO"),Xv=function(){},uN=function(t){return nA+bS+rA+t+nA+"/"+bS+rA},iA=function(t){t.write(uN("")),t.close();var e=t.parentWindow.Object;return t=null,e},qJ=function(){var t=KJ("iframe"),e="java"+bS+":",r;return t.style.display="none",jJ.appendChild(t),t.src=String(e),r=t.contentWindow.document,r.open(),r.write(uN("document.F=Object")),r.close(),r.F},r0,Dm=function(){try{r0=new ActiveXObject("htmlfile")}catch{}Dm=typeof document<"u"?document.domain&&r0?iA(r0):qJ():iA(r0);for(var t=tA.length;t--;)delete Dm[yS][tA[t]];return Dm()};GJ[cN]=!0;var ZJ=Object.create||function(e,r){var n;return e!==null?(Xv[yS]=YJ(e),n=new Xv,Xv[yS]=null,n[cN]=e):n=Dm(),r===void 0?n:zJ.f(n,r)},JJ=ml,QJ=ZJ,eQ=pl.f,ES=JJ("unscopables"),RS=Array.prototype;RS[ES]===void 0&&eQ(RS,ES,{configurable:!0,value:QJ(null)});var Ny=function(t){RS[ES][t]=!0},tQ=Ny;tQ("flatMap");function Vt(){Le(console)&&console.warn(...arguments)}function Hy(){Le(console)&&console.error(...arguments)}function rQ(t,e,r){return e=nQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,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 r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Xc=["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"],sQ=Dt`The plugin hook "[hookName]" was removed in Handsontable [removedInVersion].\x20
  71. Please consult release notes https://github.com/handsontable/handsontable/releases/tag/[removedInVersion] to\x20
  72. learn about the migration path.`,qv=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"]]),Zv=new Map([[]]),n0=new WeakMap;class He{static getSingleton(){return aQ()}constructor(){rQ(this,"globalBucket",void 0),this.globalBucket=this.createEmptyBucket()}createEmptyBucket(){const e=Object.create(null);return j(Xc,r=>{e[r]=[],this.initOrderMap(e,r)}),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,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;if(Array.isArray(r))j(r,s=>this.add(e,s,n));else{qv.has(e)&&Vt(kk(sQ,{hookName:e,removedInVersion:qv.get(e)})),Zv.has(e)&&Vt(Zv.get(e));const s=this.getBucket(n);if(typeof s[e]>"u"&&(this.register(e),s[e]=[],this.initOrderMap(s,e)),r.skip=!1,s[e].indexOf(r)===-1){let o=!1;r.initialHook&&j(s[e],(a,l)=>{if(a.initialHook)return s[e][l]=r,o=!0,!1}),o||s[e].push(r)}this.setCallbackOrderIndex(s,e,r,i),this.orderBucketByOrderIndex(s,e)}return this}once(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;Array.isArray(r)?j(r,s=>this.once(e,s,n)):(r.runOnce=!0,this.add(e,r,n,i))}remove(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;const i=this.getBucket(n);return typeof i[e]<"u"&&i[e].indexOf(r)>=0?(r.skip=!0,!0):!1}has(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const n=this.getBucket(r);return!!(n[e]!==void 0&&n[e].length)}run(e,r,n,i,s,o,a,l){{const c=this.globalBucket[r],u=c?c.length:0;let h=0;if(u)for(;h<u;){if(!c[h]||c[h].skip){h+=1;continue}const d=SS(c[h],e,n,i,s,o,a,l);d!==void 0&&(n=d),c[h]&&c[h].runOnce&&this.remove(r,c[h]),h+=1}}{const c=this.getBucket(e)[r],u=c?c.length:0;let h=0;if(u)for(;h<u;){if(!c[h]||c[h].skip){h+=1;continue}const d=SS(c[h],e,n,i,s,o,a,l);d!==void 0&&(n=d),c[h]&&c[h].runOnce&&this.remove(r,c[h],e),h+=1}}return n}destroy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;dt(this.getBucket(e),(r,n,i)=>i[n].length=0)}register(e){this.isRegistered(e)||Xc.push(e)}deregister(e){this.isRegistered(e)&&Xc.splice(Xc.indexOf(e),1)}isDeprecated(e){return Zv.has(e)||qv.has(e)}isRegistered(e){return Xc.indexOf(e)>=0}getRegistered(){return Xc}setCallbackOrderIndex(e,r,n,i){const s=Number.isInteger(i)?i:0,o=this.getCallbackOrderMap(e,r);o.set(s,[...o.get(s)||[],n])}orderBucketByOrderIndex(e,r){const n=this.getCallbackOrderMap(e,r);n===void 0||n.size===0||n.size===1&&n.has(0)||(e[r]=[...n].sort((i,s)=>i[0]-s[0]).flatMap(i=>{let[,s]=i;return s}))}initOrderMap(e,r){n0.has(e)||n0.set(e,[]),n0.get(e)[r]=new Map}getCallbackOrderMap(e,r){return n0.get(e)[r]}}const oQ=new He;function aQ(){return oQ}const Jv=new Map;function Ds(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"common";Jv.has(t)||Jv.set(t,new Map);const e=Jv.get(t);function r(a,l){e.set(a,l)}function n(a){return e.get(a)}function i(a){return e.has(a)}function s(){return[...e.keys()]}function o(){return[...e.values()]}return{register:r,getItem:n,hasItem:i,getNames:s,getValues:o}}const TS=new WeakMap,{register:lQ,getItem:hN,hasItem:dN,getNames:J1e,getValues:Q1e}=Ds("editors");function cQ(t){const e={},r=t;this.getConstructor=function(){return t},this.getInstance=function(n){return n.guid in e||(e[n.guid]=new r(n)),e[n.guid]},He.getSingleton().add("afterDestroy",function(){e[this.guid]=null})}function fN(t,e){let r;if(typeof t=="function")TS.get(t)||li(null,t),r=TS.get(t);else if(typeof t=="string")r=hN(t);else throw Error('Only strings and functions can be passed as "editor" parameter');if(!r)throw Error(`No editor registered under name "${t}"`);return r.getInstance(e)}function sA(t){if(typeof t=="function")return t;if(!dN(t))throw Error(`No registered editor found under "${t}" name`);return hN(t).getConstructor()}function li(t,e){t&&typeof t!="string"&&(e=t,t=e.EDITOR_TYPE);const r=new cQ(e);typeof t=="string"&&lQ(t,r),TS.set(e,r)}function uQ(t,e,r){return e=hQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hQ(t){var e=dQ(t,"string");return typeof e=="symbol"?e:e+""}function dQ(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class As{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;uQ(this,"context",void 0),this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])}addEventListener(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;function s(o){n.call(this,fQ(o))}return this.context.eventListeners.push({element:e,event:r,callback:n,callbackProxy:s,options:i,eventManager:this}),e.addEventListener(r,s,i),()=>{this.removeEventListener(e,r,n)}}removeEventListener(e,r,n){let i=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===r&&o.element===e){if(n&&n!==o.callback||i&&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 r=this.context.eventListeners.length;for(;r;){r-=1;const n=this.context.eventListeners[r];e&&n.eventManager!==this||(this.context.eventListeners.splice(r,1),n.element.removeEventListener(n.event,n.callbackProxy,n.options))}}clear(){this.clearEvents()}destroy(){this.clearEvents(),this.context=null}destroyWithOwnEventsOnly(){this.clearEvents(!0),this.context=null}fireEvent(e,r){let n=e.document,i=e;n||(n=e.ownerDocument?e.ownerDocument:e,i=n.defaultView);const s={bubbles:!0,cancelable:r!=="mousemove",view:i,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;n.createEvent?(o=n.createEvent("MouseEvents"),o.initMouseEvent(r,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,n.body.parentNode)):o=n.createEventObject(),e.dispatchEvent?e.dispatchEvent(o):e.fireEvent(`on${r}`,o)}}function fQ(t){const e=t.stopImmediatePropagation;return t.stopImmediatePropagation=function(){e.apply(this),Ps(this)},t}function gQ(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 Rl(t,e,r){return e=pQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pQ(t){var e=wQ(t,"string");return typeof e=="symbol"?e:e+""}function wQ(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function oA(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Qv=new WeakSet;class _S{constructor(e,r,n){gQ(this,Qv),Rl(this,"hot",void 0),Rl(this,"tableMeta",void 0),Rl(this,"selection",void 0),Rl(this,"eventManager",void 0),Rl(this,"destroyed",!1),Rl(this,"activeEditor",void 0),Rl(this,"cellProperties",void 0),this.hot=e,this.tableMeta=r,this.selection=n,this.eventManager=new As(e),this.hot.addHook("afterDocumentKeyDown",i=>oA(Qv,this,vQ).call(this,i)),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"compositionstart",i=>{!this.destroyed&&this.hot.isListening()&&this.openEditor("",i)}),this.hot.view._wt.update("onCellDblClick",(i,s,o)=>oA(Qv,this,CQ).call(this,i,s,o))}getActiveEditor(){return this.activeEditor}prepareEditor(){var e;if(this.activeEditor&&this.activeEditor.isWaiting()){this.closeEditor(!1,!1,c=>{c&&this.prepareEditor()});return}const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!r||r.isHeader())return;const{row:n,col:i}=r,s=this.hot.runHooks("modifyGetCellCoords",n,i);let o=n,a=i;if(Array.isArray(s)&&([o,a]=s),this.cellProperties=this.hot.getCellMeta(o,a),!this.isCellEditable()){this.clearActiveEditor();return}const l=this.hot.getCell(n,i,!0);if(l){const c=this.hot.getCellEditor(this.cellProperties),u=this.hot.colToProp(a),h=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(o),a);this.activeEditor=fN(c,this.hot),this.activeEditor.prepare(n,i,u,l,h,this.cellProperties)}}isEditorOpened(){return this.activeEditor&&this.activeEditor.isOpened()}openEditor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(!this.isCellEditable()){this.clearActiveEditor();return}const i=this.hot.getSelectedRangeLast();let s=this.hot.runHooks("beforeBeginEditing",i.highlight.row,i.highlight.col,e,r,n);if(r instanceof MouseEvent&&typeof s!="boolean"&&(s=this.hot.selection.getLayerLevel()===0&&i.isSingle()),s===!1){this.clearActiveEditor();return}this.activeEditor||(this.hot.scrollToFocusedCell(),this.prepareEditor()),this.activeEditor&&(n&&this.activeEditor.enableFullEditMode(),this.activeEditor.beginEditing(e,r))}closeEditor(e,r,n){this.activeEditor?this.activeEditor.finishEditing(e,r,n):n&&n(!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 r=this.hot.getCellEditor(this.cellProperties),{row:n,col:i}=e.highlight,{rowIndexMapper:s,columnIndexMapper:o}=this.hot,a=s.isHidden(this.hot.toPhysicalRow(n))||o.isHidden(this.hot.toPhysicalColumn(i));return!(this.cellProperties.readOnly||!r||a)}moveSelectionAfterEnter(e){const r={...typeof this.tableMeta.enterMoves=="function"?this.tableMeta.enterMoves(e):this.tableMeta.enterMoves};e.shiftKey&&(r.row=-r.row,r.col=-r.col),this.hot.selection.isMultiple()?this.selection.transformFocus(r.row,r.col):this.selection.transformStart(r.row,r.col,!0)}destroy(){this.destroyed=!0,this.eventManager.destroy()}}function vQ(t){const e=this.hot.getSelectedRangeLast();if(!this.hot.isListening()||!e||e.highlight.isHeader()||sc(t))return;const{keyCode:r}=t,n=(t.ctrlKey||t.metaKey)&&!t.altKey;(!this.activeEditor||this.activeEditor&&!this.activeEditor.isWaiting())&&!aN(r)&&!DJ(r)&&!n&&!this.isEditorOpened()&&this.openEditor("",t)}function CQ(t,e){e.isCell()&&this.openEditor(null,t,!0)}const aA=new WeakMap;_S.getInstance=function(t,e,r){let n=aA.get(t);return n||(n=new _S(t,e,r),aA.set(t,n)),n};function SQ(t,e){gN(t,e),e.add(t)}function Dh(t,e,r){gN(t,e),e.set(t,r)}function gN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ir(t,e){return t.get(Go(t,e))}function kh(t,e,r){return t.set(Go(t,e),r),r}function Go(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Zu=Object.freeze({CELL:"cell",MIXED:"mixed"});var Kr=new WeakMap,i0=new WeakMap,s0=new WeakMap,o0=new WeakMap,a0=new WeakMap,Fa=new WeakSet;class xQ{constructor(e){var r=this;SQ(this,Fa),Dh(this,Kr,void 0),Dh(this,i0,void 0),Dh(this,s0,1),Dh(this,o0,null),Dh(this,a0,new Map);const n=e.getSettings();kh(Kr,this,e),kh(i0,this,n.imeFastEdit?Zu.MIXED:Zu.CELL),ir(Kr,this).addHook("afterUpdateSettings",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return Go(Fa,r,bQ).call(r,...s)}),ir(Kr,this).addHook("afterSelection",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return Go(Fa,r,lA).call(r,...s)}),ir(Kr,this).addHook("afterSelectionFocusSet",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return Go(Fa,r,lA).call(r,...s)}),ir(Kr,this).addHook("afterSelectionEnd",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return Go(Fa,r,yQ).call(r,...s)})}getFocusMode(){return ir(i0,this)}setFocusMode(e){Object.values(Zu).includes(e)?kh(i0,this,e):Vt(`"${e}" is not a valid focus mode.`)}getRefocusDelay(){return ir(s0,this)}setRefocusDelay(e){kh(s0,this,e)}setRefocusElementGetter(e){kh(o0,this,e)}getRefocusElement(){if(typeof ir(o0,this)=="function")return ir(o0,this).call(this);var e;return(e=ir(Kr,this).getActiveEditor())===null||e===void 0?void 0:e.TEXTAREA}focusOnHighlightedCell(e){const r=n=>{var i,s;const o=(i=ir(Kr,this).getSelectedRangeLast())===null||i===void 0?void 0:i.highlight;if(!o)return;let a=ir(Kr,this).runHooks("modifyFocusedElement",o.row,o.col,n);a instanceof HTMLElement||(a=n),a&&!((s=ir(Kr,this).getActiveEditor())!==null&&s!==void 0&&s.isOpened())&&a.focus({preventScroll:!0})};e?r(e):Go(Fa,this,Fy).call(this,n=>r(n))}refocusToEditorTextarea(){var e;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ir(s0,this);const n=this.getRefocusElement();ir(Kr,this).getSettings().imeFastEdit&&!((e=ir(Kr,this).getActiveEditor())!==null&&e!==void 0&&e.isOpened())&&n&&(ir(a0,this).has(r)||ir(a0,this).set(r,Iy(()=>{n.select()},r)),ir(a0,this).get(r)())}}function Fy(t){var e;const r=(e=ir(Kr,this).getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!r||!ir(Kr,this).selection.isCellVisible(r)){t(null);return}const n=ir(Kr,this).getCell(r.row,r.col,!0);n===null?ir(Kr,this).addHookOnce("afterScroll",()=>{t(ir(Kr,this).getCell(r.row,r.col,!0))}):t(n)}function lA(){Go(Fa,this,Fy).call(this,t=>{const{activeElement:e}=ir(Kr,this).rootDocument;e&&jk(e)&&e.blur(),this.focusOnHighlightedCell(t)})}function yQ(){Go(Fa,this,Fy).call(this,t=>{this.getFocusMode()===Zu.MIXED&&t.nodeName==="TD"&&this.refocusToEditorTextarea()})}function bQ(t){typeof t.imeFastEdit=="boolean"&&this.setFocusMode(t.imeFastEdit?Zu.MIXED:Zu.CELL)}var EQ=Co,RQ=Hc,TQ=ml,_Q=TQ("match"),AQ=function(t){var e;return EQ(t)&&((e=t[_Q])!==void 0?!!e:RQ(t)==="RegExp")},MQ=ua,IQ=function(){var t=MQ(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},OQ=Is,PQ=So,DQ=lw,kQ=IQ,cA=RegExp.prototype,NQ=function(t){var e=t.flags;return e===void 0&&!("flags"in cA)&&!PQ(t,"flags")&&DQ(cA,t)?OQ(kQ,t):e},Ly=Ur,HQ=tg,FQ=Math.floor,eC=Ly("".charAt),LQ=Ly("".replace),tC=Ly("".slice),$Q=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,BQ=/\$([$&'`]|\d{1,2})/g,VQ=function(t,e,r,n,i,s){var o=r+t.length,a=n.length,l=BQ;return i!==void 0&&(i=HQ(i),l=$Q),LQ(s,l,function(c,u){var h;switch(eC(u,0)){case"$":return"$";case"&":return t;case"`":return tC(e,0,r);case"'":return tC(e,o);case"<":h=i[tC(u,1,-1)];break;default:var d=+u;if(d===0)return c;if(d>a){var f=FQ(d/10);return f===0?c:f<=a?n[f-1]===void 0?eC(u,1):n[f-1]+eC(u,1):c}h=n[d-1]}return h===void 0?"":h})},WQ=En,UQ=Is,$y=Ur,uA=ow,YQ=an,zQ=sw,GQ=AQ,Nh=jx,jQ=uw,KQ=NQ,XQ=VQ,qQ=ml,ZQ=qQ("replace"),JQ=TypeError,rC=$y("".indexOf);$y("".replace);var hA=$y("".slice),QQ=Math.max;WQ({target:"String",proto:!0},{replaceAll:function(e,r){var n=uA(this),i,s,o,a,l,c,u,h,d,f=0,g=0,m="";if(!zQ(e)){if(i=GQ(e),i&&(s=Nh(uA(KQ(e))),!~rC(s,"g")))throw new JQ("`.replaceAll` does not allow non-global regexes");if(o=jQ(e,ZQ),o)return UQ(o,e,n,r)}for(a=Nh(n),l=Nh(e),c=YQ(r),c||(r=Nh(r)),u=l.length,h=QQ(1,u),f=rC(a,l);f!==-1;)d=c?Nh(r(l,f,a)):XQ(l,a,f,[],void 0,r),m+=hA(a,g,f)+d,g=f+u,f=f+h>a.length?-1:rC(a,l,f+h);return g<a.length&&(m+=hA(a,g)),m}});const mN={"&nbsp;":" ","&amp;":"&","&lt;":"<","&gt;":">"},eee=new RegExp(Object.keys(mN).map(t=>`(${t})`).join("|"),"gi");function tee(t){return(t&&t.nodeName||"")==="TABLE"}function dA(t){const e=t.hasColHeaders(),r=t.hasRowHeaders(),n=[e?-1:0,r?-1:0,t.countRows()-1,t.countCols()-1],i=t.getData(...n),s=i.length,o=s>0?i[0].length:0,a=["<table>","</table>"],l=e?["<thead>","</thead>"]:[],c=["<tbody>","</tbody>"],u=r?1:0,h=e?1:0;for(let d=0;d<s;d+=1){const f=e&&d===0,g=[];for(let p=0;p<o;p+=1){const S=!f&&r&&p===0;let y="";if(f)y=`<th>${t.getColHeader(p-u)}</th>`;else if(S)y=`<th>${t.getRowHeader(d-h)}</th>`;else{const C=i[d][p],{hidden:E,rowspan:A,colspan:O}=t.getCellMeta(d-h,p-u);if(!E){const T=[];if(A&&T.push(`rowspan="${A}"`),O&&T.push(`colspan="${O}"`),yr(C))y=`<td ${T.join(" ")}></td>`;else{const W=C.toString().replace("<","&lt;").replace(">","&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
  73. `).replace(/\x20/gi,"&nbsp;").replace(/\t/gi,"&#9;");y=`<td ${T.join(" ")}>${W}</td>`}}}g.push(y)}const m=["<tr>",...g,"</tr>"].join("");f?l.splice(1,0,m):c.splice(-1,0,m)}return a.splice(1,0,l.join(""),c.join("")),a.join("")}function fA(t){const e=t.length,r=["<table>"];for(let n=0;n<e;n+=1){const i=t[n],s=i.length,o=[];n===0&&r.push("<tbody>");for(let a=0;a<s;a+=1){const l=i[a],c=yr(l)?"":l.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
  74. `).replace(/\x20{2,}/gi,u=>`<span style="mso-spacerun: yes">${"&nbsp;".repeat(u.length-1)} </span>`).replace(/\t/gi,"&#9;");o.push(`<td>${c}</td>`)}r.push("<tr>",...o,"</tr>"),n+1===e&&r.push("</tbody>")}return r.push("</table>"),r.join("")}function ree(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;const r={},n=e.createDocumentFragment(),i=e.createElement("div");n.appendChild(i);let s=t;if(typeof s=="string"){const C=s.replace(/<td\b[^>]*?>([\s\S]*?)<\/\s*td>/g,E=>{const A=E.match(/<td\b[^>]*?>/g)[0],O=/<p.*?>/g,T=E.substring(A.length,E.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(O,`
  75. `).replace(`
  76. `,"").replaceAll(/<\/(.*)>\s+$/mg,"</$1>").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^&nbsp;$/mg,"");return`${A}${T}</td>`});i.insertAdjacentHTML("afterbegin",`${C}`),s=i.querySelector("table")}if(!s||!tee(s))return;const o=i.querySelector('meta[name$="enerator"]'),a=s.querySelector("tbody th")!==null,l=s.querySelector("tr"),c=l?Array.from(l.cells).reduce((C,E)=>C+E.colSpan,0)-(a?1:0):0,u=s.tFoot&&Array.from(s.tFoot.rows)||[],h=[];let d=!1,f=0,g=0;if(s.tHead){const C=Array.from(s.tHead.rows).filter(E=>{const A=E.querySelector("td")!==null;return A&&h.push(E),!A});f=C.length,d=f>0,f>1?r.nestedHeaders=Array.from(C).reduce((E,A)=>{const O=Array.from(A.cells).reduce((T,W,I)=>{if(a&&I===0)return T;const{colSpan:Y,innerHTML:z}=W,U=Y>1?{label:z,colspan:Y}:z;return T.push(U),T},[]);return E.push(O),E},[]):d&&(r.colHeaders=Array.from(C[0].children).reduce((E,A,O)=>(a&&O===0||E.push(A.innerHTML),E),[]))}h.length&&(r.fixedRowsTop=h.length),u.length&&(r.fixedRowsBottom=u.length);const m=[...h,...Array.from(s.tBodies).reduce((C,E)=>(C.push(...Array.from(E.rows)),C),[]),...u];g=m.length;const p=new Array(g);for(let C=0;C<g;C++)p[C]=new Array(c);const S=[],y=[];for(let C=0;C<g;C++){const E=m[C],A=Array.from(E.cells),O=A.length;for(let T=0;T<O;T++){const W=A[T],{nodeName:I,innerHTML:Y,rowSpan:z,colSpan:U}=W,oe=p[C].findIndex(Ce=>Ce===void 0);if(I==="TD"){if(z>1||U>1){for(let Se=C;Se<C+z;Se++)if(Se<g)for(let Ae=oe;Ae<oe+U;Ae++)p[Se][Ae]=null;const pe=W.getAttribute("style");pe&&pe.includes("mso-ignore:colspan")||S.push({col:oe,row:C,rowspan:z,colspan:U})}let Ce="";o&&/excel/gi.test(o.content)?Ce=Y.replace(/[\r\n][\x20]{0,2}/g," ").replace(/<br(\s*|\/)>[\r\n]?[\x20]{0,3}/gim,`\r
  77. `):Ce=Y.replace(/<br(\s*|\/)>[\r\n]?/gim,`\r
  78. `),p[C][oe]=Ce.replace(eee,pe=>mN[pe])}else y.push(Y)}}return S.length&&(r.mergeCells=S),y.length&&(r.rowHeaders=y),p.length&&(r.data=p),r}function Hn(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=typeof t;if(r==="number")return!isNaN(t)&&isFinite(t);if(r==="string"){if(t.length===0)return!1;if(t.length===1)return/\d/.test(t);const n=Array.from(new Set([".",...e])).map(i=>`\\${i}`).join("|");return new RegExp(`^[+-]?(((${n})?\\d+((${n})\\d+)?(e[+-]?\\d+)?)|(0x[a-f\\d]+))$`,"i").test(t.trim())}else if(r==="object")return!!t&&typeof t.valueOf()=="number"&&!(t instanceof Date);return!1}function nee(t){return Hn(t,[","])}function Ue(t,e,r){let n=-1;for(typeof e=="function"?(r=e,e=t):n=t-1;++n<=e&&r(n)!==!1;);}function AS(t,e,r){let n=t+1;for(typeof e=="function"&&(r=e,e=0);--n>=e&&r(n)!==!1;);}function pN(t,e){return e=parseInt(e.toString().replace("%",""),10),e=isNaN(e)?0:e,parseInt(t*e/100,10)}function Ht(t,e,r){return Math.min(t,e)===t?e:Math.max(t,r)===t?r:t}const MS="asc",iee="desc",gA=new Map([[MS,[-1,1]],[iee,[1,-1]]]),see=t=>`The priority '${t}' is already declared in a map.`,oee=t=>`The priority '${t}' is not a number.`;function aee(){let{errorPriorityExists:t,errorPriorityNaN:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=new Map;t=Xt(t)?t:see,e=Xt(e)?e:oee;function n(s,o){if(!Hn(s))throw new Error(e(s));if(r.has(s))throw new Error(t(s));r.set(s,o)}function i(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:MS;const[o,a]=gA.get(s)||gA.get(MS);return[...r].sort((l,c)=>l[0]<c[0]?o:a).map(l=>l[1])}return{addItem:n,getItems:i}}const lee=t=>`The id '${t}' is already declared in a map.`;function Aw(){let{errorIdExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Map;t=Xt(t)?t:lee;function r(c,u){if(l(c))throw new Error(t(c));e.set(c,u)}function n(c){return e.delete(c)}function i(){e.clear()}function s(c){const[u]=a().find(h=>{let[d,f]=h;return c===f?d:!1})||[null];return u}function o(c){return e.get(c)}function a(){return[...e]}function l(c){return e.has(c)}return{addItem:r,clear:i,getId:s,getItem:o,getItems:a,hasItem:l,removeItem:n}}const cee=t=>`'${t}' value is already declared in a unique set.`;function uee(){let{errorItemExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Set;t=Xt(t)?t:cee;function r(s){if(e.has(s))throw new Error(t(s));e.add(s)}function n(){return[...e]}function i(){e.clear()}return{addItem:r,clear:i,getItems:n}}const By=t=>`There is already registered "${t}" plugin.`,hee=t=>`There is already registered plugin on priority "${t}".`,dee=t=>`The priority "${t}" is not a number.`,wN=aee({errorPriorityExists:hee,errorPriorityNaN:dee}),vN=uee({errorItemExists:By}),IS=Aw({errorIdExists:By});function CN(){return[...wN.getItems(),...vN.getItems()]}function Vy(t){const e=Ts(t);return IS.getItem(e)}function fee(t){return!!Vy(t)}function _t(t,e,r){[t,e,r]=mee(t,e,r),Vy(t)===void 0&&gee(t,e,r)}function gee(t,e,r){const n=Ts(t);if(IS.hasItem(n))throw new Error(By(n));r===void 0?vN.addItem(n):wN.addItem(r,n),IS.addItem(n,e)}function mee(t,e,r){return typeof t=="function"&&(e=t,t=e.PLUGIN_KEY,r=e.PLUGIN_PRIORITY),[t,e,r]}const{register:pee,getItem:wee,hasItem:SN,getNames:eSe,getValues:tSe}=Ds("renderers");function mA(t){if(typeof t=="function")return t;if(!SN(t))throw Error(`No registered renderer found under "${t}" name`);return wee(t)}function Ii(t,e){typeof t!="string"&&(e=t,t=e.RENDERER_TYPE),pee(t,e)}const{register:vee,getItem:Cee,hasItem:xN,getNames:rSe,getValues:nSe}=Ds("validators");function See(t){if(typeof t=="function")return t;if(!xN(t))throw Error(`No registered validator found under "${t}" name`);return Cee(t)}function Pu(t,e){typeof t!="string"&&(e=t,t=e.VALIDATOR_TYPE),vee(t,e)}function l0(t,e,r){return e=xee(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xee(t){var e=yee(t,"string");return typeof e=="symbol"?e:e+""}function yee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bee{constructor(e){l0(this,"count",0),l0(this,"startColumn",0),l0(this,"endColumn",0),l0(this,"startPosition",0),this.count=e.totalColumns,this.endColumn=this.count-1}}function c0(t,e,r){return e=Eee(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Eee(t){var e=Ree(t,"string");return typeof e=="symbol"?e:e+""}function Ree(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Tee{constructor(e){c0(this,"count",0),c0(this,"startRow",0),c0(this,"endRow",0),c0(this,"startPosition",0),this.count=e.totalRows,this.endRow=this.count-1}}var _ee=En,Aee=tg,Mee=ng,Iee=hw,Oee=Ny;_ee({target:"Array",proto:!0},{at:function(e){var r=Aee(this),n=Mee(r),i=Iee(e),s=i>=0?i:n+i;return s<0||s>=n?void 0:r[s]}});Oee("at");const La=1,mn=2,pA=3;function Pee(t,e,r){Dee(t,e),e.set(t,r)}function Dee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Hh(t,e,r){return e=kee(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kee(t){var e=Nee(t,"string");return typeof e=="symbol"?e:e+""}function Nee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qc(t,e){return t.get(yN(t,e))}function Hee(t,e,r){return t.set(yN(t,e),r),r}function yN(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var ya=new WeakMap;class gg{static get DEFAULT_WIDTH(){return 50}constructor(e){Hh(this,"count",0),Hh(this,"startColumn",null),Hh(this,"endColumn",null),Hh(this,"startPosition",null),Hh(this,"isVisibleInTrimmingContainer",!1),Pee(this,ya,void 0),Hee(ya,this,e),this.calculate()}calculate(){const{calculationType:e,overrideFn:r,scrollOffset:n,totalColumns:i,viewportWidth:s}=qc(ya,this),o=Math.max(qc(ya,this).scrollOffset,0),a=o>0?s+1:s;let l=0,c=!0;const u=[];let h,d=0,f=0;for(let S=0;S<i;S++)if(h=this._getColumnWidth(S),l<=o&&e!==mn&&(this.startColumn=S,d=h),l>=o&&l+(e===mn?h:0)<=o+a&&((this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=S,d=h),this.endColumn=S),u.push(l),l+=h,f=h,e!==mn&&(this.endColumn=S),l>=o+s){c=!1;break}const g=n+s-a,m=e===mn?0:f,p=e===mn?d:0;if(g<-1*qc(ya,this).inlineStartOffset||n>u.at(-1)+m||-1*qc(ya,this).scrollOffset-qc(ya,this).viewportWidth>-1*p?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,this.endColumn===i-1&&c)for(this.startColumn=this.endColumn;this.startColumn>0;){const S=u[this.endColumn]+h-u[this.startColumn-1];if((S<=s||e!==mn)&&(this.startColumn-=1),S>s)break}e===La&&this.startColumn!==null&&r&&r(this),this.startPosition=u[this.startColumn],this.startPosition===void 0&&(this.startPosition=null),i<this.endColumn&&(this.endColumn=i-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}_getColumnWidth(e){let r=qc(ya,this).columnWidthFn(e);return isNaN(r)&&(r=gg.DEFAULT_WIDTH),r}}function Fee(t,e,r){Lee(t,e),e.set(t,r)}function Lee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fh(t,e,r){return e=$ee(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $ee(t){var e=Bee(t,"string");return typeof e=="symbol"?e:e+""}function Bee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nC(t,e){return t.get(bN(t,e))}function Vee(t,e,r){return t.set(bN(t,e),r),r}function bN(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Lh=new WeakMap;class Mw{static get DEFAULT_HEIGHT(){return 23}constructor(e){Fh(this,"count",0),Fh(this,"startRow",null),Fh(this,"endRow",null),Fh(this,"startPosition",null),Fh(this,"isVisibleInTrimmingContainer",!1),Fee(this,Lh,void 0),Vee(Lh,this,e),this.calculate()}calculate(){const{calculationType:e,overrideFn:r,rowHeightFn:n,scrollOffset:i,totalRows:s,viewportHeight:o}=nC(Lh,this),a=Math.max(nC(Lh,this).scrollOffset,0),l=nC(Lh,this).horizontalScrollbarHeight||0,c=a+o-l;let u=0,h=!0;const d=[];let f,g=0,m=0;for(let C=0;C<s;C++)if(f=n(C),isNaN(f)&&(f=Mw.DEFAULT_HEIGHT),u<=a&&e!==mn&&(this.startRow=C,g=f),u>=a&&u+(e===mn?f:0)<=c&&(this.startRow===null&&(this.startRow=C,g=f),this.endRow=C),d.push(u),u+=f,m=f,e!==mn&&(this.endRow=C),u>=c){h=!1;break}const p=i+o-l,S=e===mn?g:0,y=e===mn?0:m;if(p<S||i>d.at(-1)+y?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,this.endRow===s-1&&h)for(this.startRow=this.endRow;this.startRow>0;){const C=d[this.endRow]+f-d[this.startRow-1];if((C<=o-l||e!==mn)&&(this.startRow-=1),C>=o-l)break}e===La&&this.startRow!==null&&r&&r(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 Wee(t,e,r){Uee(t,e),e.set(t,r)}function Uee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wA(t,e,r){return e=Yee(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yee(t){var e=zee(t,"string");return typeof e=="symbol"?e:e+""}function zee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zc(t,e){return t.get(EN(t,e))}function vA(t,e,r){return t.set(EN(t,e),r),r}function EN(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Io=new WeakMap;class Ec{constructor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;wA(this,"row",null),wA(this,"col",null),Wee(this,Io,!1),vA(Io,this,n),typeof e<"u"&&typeof r<"u"&&(this.row=e,this.col=r)}isValid(e){const{countRows:r,countCols:n,countRowHeaders:i,countColHeaders:s}={countRows:0,countCols:0,countRowHeaders:0,countColHeaders:0,...e};return!(!Number.isInteger(this.row)||!Number.isInteger(this.col)||this.row<-s||this.col<-i||this.row>=r||this.col>=n)}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 Zc(Io,this)}isSouthEastOf(e){return this.row>=e.row&&(Zc(Io,this)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(Zc(Io,this)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(Zc(Io,this)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(Zc(Io,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 Ec&&vA(Io,this,e.isRtl()),this}clone(){return new Ec(this.row,this.col,Zc(Io,this))}toObject(){return{row:this.row,col:this.col}}}function Gee(t,e,r){jee(t,e),e.set(t,r)}function jee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function iC(t,e,r){return e=Kee(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Kee(t){var e=Xee(t,"string");return typeof e=="symbol"?e:e+""}function Xee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ei(t,e){return t.get(RN(t,e))}function qee(t,e,r){return t.set(RN(t,e),r),r}function RN(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var zn=new WeakMap;class mg{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;iC(this,"highlight",null),iC(this,"from",null),iC(this,"to",null),Gee(this,zn,!1),this.highlight=e.clone(),this.from=r.clone(),this.to=n.clone(),qee(zn,this,i)}setHighlight(e){return this.highlight=e.clone(),this}setFrom(e){return this.from=e.clone(),this}setTo(e){return this.to=e.clone(),this}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),r=Math.max(this.to.row,0);return Math.max(e,r)-Math.min(e,r)+1}getWidth(){if(this.from.col<0&&this.to.col<0)return 0;const e=Math.max(this.from.col,0),r=Math.max(this.to.col,0);return Math.max(e,r)-Math.min(e,r)+1}getCellsCount(){return this.getWidth()*this.getHeight()}includes(e){const{row:r,col:n}=e,i=this.getOuterTopStartCorner(),s=this.getOuterBottomEndCorner();return i.row<=r&&s.row>=r&&i.col<=n&&s.col>=n}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 r=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner();return e.row<r.row||e.col<r.col||e.row>n.row||e.col>n.col?(this.from=this._createCellCoords(Math.min(r.row,e.row),Math.min(r.col,e.col)),this.to=this._createCellCoords(Math.max(n.row,e.row),Math.max(n.col,e.col)),!0):!1}expandByRange(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(this.includesRange(e)||!this.overlaps(e))return!1;const n=this.getOuterTopStartCorner(),i=this.getOuterBottomEndCorner(),s=this.getDirection(),o=e.getOuterTopStartCorner(),a=e.getOuterBottomEndCorner(),l=Math.min(n.row,o.row),c=Math.min(n.col,o.col),u=Math.max(i.row,a.row),h=Math.max(i.col,a.col),d=this._createCellCoords(l,c),f=this._createCellCoords(u,h);return this.from=d,this.to=f,this.setDirection(s),r&&(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 Ei(zn,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 Ei(zn,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 Ei(zn,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 Ei(zn,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 Ei(zn,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 Ei(zn,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 Ei(zn,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 Ei(zn,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 Ec))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 r={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)},n={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},i=[];return r.top===n.top&&i.push("top"),r.right===n.right&&i.push(Ei(zn,this)?"left":"right"),r.bottom===n.bottom&&i.push("bottom"),r.left===n.left&&i.push(Ei(zn,this)?"right":"left"),i}getInner(){const e=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner(),n=[];for(let i=e.row;i<=r.row;i++)for(let s=e.col;s<=r.col;s++)!(this.from.row===i&&this.from.col===s)&&!(this.to.row===i&&this.to.col===s)&&n.push(this._createCellCoords(i,s));return n}getAll(){const e=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner(),n=[];for(let i=e.row;i<=r.row;i++)for(let s=e.col;s<=r.col;s++)e.row===i&&e.col===s?n.push(e):r.row===i&&r.col===s?n.push(r):n.push(this._createCellCoords(i,s));return n}forAll(e){const r=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner();for(let i=r.row;i<=n.row;i++)for(let s=r.col;s<=n.col;s++)if(e(i,s)===!1)return}clone(){return new mg(this.highlight,this.from,this.to,Ei(zn,this))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,r){return new Ec(e,r,Ei(zn,this))}}function Hs(t,e,r){Zee(t,e),e.set(t,r)}function Zee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ze(t,e){return t.get(TN(t,e))}function ba(t,e,r){return t.set(TN(t,e),r),r}function TN(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Ri=new WeakMap,sC=new WeakMap,Yr=new WeakMap,Jc=new WeakMap,u0=new WeakMap,Ji=new WeakMap,oC=new WeakMap,$h=new WeakMap,Tl=new WeakMap,Fs=new WeakMap;let _N=class{constructor(e,r,n,i,s,o){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null;Hs(this,Ri,void 0),Hs(this,sC,void 0),Hs(this,Yr,void 0),Hs(this,Jc,void 0),Hs(this,u0,void 0),Hs(this,Ji,void 0),Hs(this,oC,void 0),Hs(this,$h,void 0),Hs(this,Tl,[null,null]),Hs(this,Fs,[null,null]),ba(Ri,this,n),ba(sC,this,r),ba(Yr,this,s),ba(Jc,this,o),ba(u0,this,a),ba(Ji,this,i),ba(oC,this,e),this.registerEvents()}registerEvents(){ze(Ji,this).addEventListener(ze(Yr,this).holder,"contextmenu",n=>this.onContextMenu(n)),ze(Ji,this).addEventListener(ze(Yr,this).TABLE,"mouseover",n=>this.onMouseOver(n)),ze(Ji,this).addEventListener(ze(Yr,this).TABLE,"mouseout",n=>this.onMouseOut(n));const e=()=>{ze(Ji,this).addEventListener(ze(Yr,this).holder,"touchstart",n=>this.onTouchStart(n)),ze(Ji,this).addEventListener(ze(Yr,this).holder,"touchend",n=>this.onTouchEnd(n)),this.momentumScrolling||(this.momentumScrolling={}),ze(Ji,this).addEventListener(ze(Yr,this).holder,"scroll",()=>{clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||ze(Ri,this).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout(()=>{this.touchApplied||(this.momentumScrolling.ongoing=!1,ze(Ri,this).getSetting("onAfterMomentumScroll"))},200)})},r=()=>{ze(Ji,this).addEventListener(ze(Yr,this).holder,"mouseup",n=>this.onMouseUp(n)),ze(Ji,this).addEventListener(ze(Yr,this).holder,"mousedown",n=>this.onMouseDown(n))};Qa()?e():(rN()&&e(),r())}selectedCellWasTouched(e){const n=this.parentCell(e).coords;if(ze($h,this)&&n){const[i,s]=[n.row,ze($h,this).from.row],[o,a]=[n.col,ze($h,this).from.col];return i===s&&o===a}return!1}parentCell(e){const r={},n=ze(Yr,this).TABLE,i=e0(e,["TD","TH"],n);return i?(r.coords=ze(Yr,this).getCoords(i),r.TD=i):Ze(e,"wtBorder")&&Ze(e,"current")?(r.coords=ze(Jc,this).getFocusSelection().cellRange.highlight,r.TD=ze(Yr,this).getCell(r.coords)):Ze(e,"wtBorder")&&Ze(e,"area")&&ze(Jc,this).getAreaSelection().cellRange&&(r.coords=ze(Jc,this).getAreaSelection().cellRange.to,r.TD=ze(Yr,this).getCell(r.coords)),r}onMouseDown(e){const r=ze(sC,this).rootDocument.activeElement,n=Zk(KZ,e.target),i=e.target;if(!["TD","TH"].includes(r.nodeName)&&(i===r||n(0)===r||n(1)===r))return;const s=this.parentCell(i);Ze(i,"corner")?ze(Ri,this).getSetting("onCellCornerMouseDown",e,i):s.TD&&ze(Ri,this).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,s.coords,s.TD),(e.button===0||this.touchApplied)&&s.TD&&(ze(Fs,this)[0]=s.TD,clearTimeout(ze(Tl,this)[0]),ze(Tl,this)[0]=setTimeout(()=>{ze(Fs,this)[0]=null},1e3))}onContextMenu(e){if(ze(Ri,this).has("onCellContextMenu")){const r=this.parentCell(e.target);r.TD&&this.callListener("onCellContextMenu",e,r.coords,r.TD)}}onMouseOver(e){if(!ze(Ri,this).has("onCellMouseOver"))return;const r=ze(Yr,this).TABLE,n=e0(e.target,["TD","TH"],r),i=ze(u0,this)||this;n&&n!==i.lastMouseOver&&pc(n,r)&&(i.lastMouseOver=n,this.callListener("onCellMouseOver",e,ze(Yr,this).getCoords(n),n))}onMouseOut(e){if(!ze(Ri,this).has("onCellMouseOut"))return;const r=ze(Yr,this).TABLE,n=e0(e.target,["TD","TH"],r),i=e0(e.relatedTarget,["TD","TH"],r),s=ze(u0,this)||this;n&&n!==i&&pc(n,r)&&(this.callListener("onCellMouseOut",e,ze(Yr,this).getCoords(n),n),i===null&&(s.lastMouseOver=null))}onMouseUp(e){const r=this.parentCell(e.target);r.TD&&ze(Ri,this).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,r.coords,r.TD),!(e.button!==0&&!this.touchApplied)&&(r.TD===ze(Fs,this)[0]&&r.TD===ze(Fs,this)[1]?(Ze(e.target,"corner")?this.callListener("onCellCornerDblClick",e,r.coords,r.TD):this.callListener("onCellDblClick",e,r.coords,r.TD),ze(Fs,this)[0]=null,ze(Fs,this)[1]=null):r.TD===ze(Fs,this)[0]&&(ze(Fs,this)[1]=r.TD,clearTimeout(ze(Tl,this)[1]),ze(Tl,this)[1]=setTimeout(()=>{ze(Fs,this)[1]=null},500)))}onTouchStart(e){ba($h,this,ze(Jc,this).getFocusSelection().cellRange),this.touchApplied=!0,this.onMouseDown(e)}onTouchEnd(e){var r;const n=e.target,i=(r=this.parentCell(n))===null||r===void 0?void 0:r.coords,s=Le(i)&&i.row>=0&&i.col>=0;if(e.cancelable&&s&&ze(Ri,this).getSetting("isDataViewInstance")){const a=["A","BUTTON","INPUT"];sN()&&(AJ()||MJ())&&this.selectedCellWasTouched(n)&&!a.includes(n.tagName)?e.preventDefault():this.selectedCellWasTouched(n)||e.preventDefault()}this.onMouseUp(e),this.touchApplied=!1}callListener(e,r,n,i){const s=ze(Ri,this).getSettingPure(e);s&&s(r,n,i,ze(oC,this).call(this))}destroy(){clearTimeout(ze(Tl,this)[0]),clearTimeout(ze(Tl,this)[1]),ze(Ji,this).destroy()}};function aC(t,e,r){return e=Jee(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jee(t){var e=Qee(t,"string");return typeof e=="symbol"?e:e+""}function Qee(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ete{constructor(e,r,n){aC(this,"offset",void 0),aC(this,"total",void 0),aC(this,"countTH",void 0),this.offset=e,this.total=r,this.countTH=n}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 lC(t,e,r){return e=tte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tte(t){var e=rte(t,"string");return typeof e=="symbol"?e:e+""}function rte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class nte{constructor(e,r,n){lC(this,"offset",void 0),lC(this,"total",void 0),lC(this,"countTH",void 0),this.offset=e,this.total=r,this.countTH=n}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 ite=0,Sp=1,xp=2;function h0(t,e,r){return e=ste(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ste(t){var e=ote(t,"string");return typeof e=="symbol"?e:e+""}function ote(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class CA{constructor(){h0(this,"currentSize",0),h0(this,"nextSize",0),h0(this,"currentOffset",0),h0(this,"nextOffset",0)}setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}}function cC(t,e,r){return e=ate(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ate(t){var e=lte(t,"string");return typeof e=="symbol"?e:e+""}function lte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class cte{constructor(){cC(this,"size",new CA),cC(this,"workingSpace",ite),cC(this,"sharedSize",null)}setSize(e){this.size.setSize(e)}setOffset(e){this.size.setOffset(e)}getViewSize(){return this.size}isShared(){return this.sharedSize instanceof CA}isPlaceOn(e){return this.workingSpace===e}append(e){this.workingSpace=Sp,e.workingSpace=xp,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=xp,e.workingSpace=Sp,this.sharedSize=e.getViewSize()}}function Qc(t,e,r){return e=ute(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ute(t){var e=hte(t,"string");return typeof e=="symbol"?e:e+""}function hte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class AN{constructor(e,r,n){Qc(this,"rootNode",void 0),Qc(this,"nodesPool",void 0),Qc(this,"sizeSet",new cte),Qc(this,"childNodeType",void 0),Qc(this,"visualIndex",0),Qc(this,"collectedNodes",[]),this.rootNode=e,this.nodesPool=r,this.childNodeType=n.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:r}=this;let n=0;if(this.isSharedViewSet()){let i=e.firstElementChild;for(;i;){if(i.tagName===this.childNodeType)n+=1;else if(r.isPlaceOn(Sp))break;i=i.nextElementSibling}}else n=e.childElementCount;return n}start(){this.collectedNodes.length=0,this.visualIndex=0;const{rootNode:e,sizeSet:r}=this,n=this.isSharedViewSet(),{nextSize:i}=r.getViewSize();let s=this.getRenderedChildCount();for(;s<i;){const a=this.nodesPool();!n||n&&r.isPlaceOn(xp)?e.appendChild(a):e.insertBefore(a,e.firstChild),s+=1}const o=n&&r.isPlaceOn(Sp);for(;s>i;)e.removeChild(o?e.firstChild:e.lastChild),s-=1}render(){const{rootNode:e,sizeSet:r}=this;let n=this.visualIndex;this.isSharedViewSet()&&r.isPlaceOn(xp)&&(n+=r.sharedSize.nextSize);let i=e.childNodes[n];if(i.tagName!==this.childNodeType){const s=this.nodesPool();e.replaceChild(s,i),i=s}this.collectedNodes.push(i),this.visualIndex+=1}end(){}}class MN extends AN{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 dte(t,e,r){return e=fte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fte(t){var e=gte(t,"string");return typeof e=="symbol"?e:e+""}function gte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class mte{constructor(e){dte(this,"nodeType",void 0),this.nodeType=e.toUpperCase()}setRootDocument(e){this.rootDocument=e}obtain(){return this.rootDocument.createElement(this.nodeType)}}function Bh(t,e,r){return e=pte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pte(t){var e=wte(t,"string");return typeof e=="symbol"?e:e+""}function wte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class pg{constructor(e,r){Bh(this,"nodesPool",null),Bh(this,"nodeType",void 0),Bh(this,"rootNode",void 0),Bh(this,"table",null),Bh(this,"renderedNodes",0),this.nodesPool=typeof e=="string"?new mte(e):null,this.nodeType=e,this.rootNode=r}setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}adjust(){}render(){}}function SA(t,e,r){return e=vte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vte(t){var e=Cte(t,"string");return typeof e=="symbol"?e:e+""}function Cte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Ste extends pg{constructor(){super("TH"),SA(this,"orderViews",new WeakMap),SA(this,"sourceRowIndex",0)}obtainOrderView(e){let r;return this.orderViews.has(e)?r=this.orderViews.get(e):(r=new MN(e,n=>this.nodesPool.obtain(this.sourceRowIndex,n),this.nodeType),this.orderViews.set(e,r)),r}render(){const{rowsToRender:e,rowHeaderFunctions:r,rowHeadersCount:n,rows:i,cells:s}=this.table;for(let o=0;o<e;o++){const a=this.table.renderedRowToSource(o),l=i.getRenderedNode(o);this.sourceRowIndex=a;const c=this.obtainOrderView(l),u=s.obtainOrderView(l);c.appendView(u).setSize(n).setOffset(this.table.renderedColumnToSource(0)).start();for(let h=0;h<n;h++){c.render();const d=c.getCurrentNode();d.className="",d.removeAttribute("style"),vh(d,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Xe(d,[_Z(),NZ(),Ry(h+1),wh(-1)]),r[h](a,d,h)}c.end()}}}class xte extends pg{constructor(e){super(null,e)}adjust(){const{columnHeadersCount:e,rowHeadersCount:r}=this.table;let n=this.rootNode.firstChild;if(e){const{columnsToRender:i}=this.table,s=i+r;for(let a=0,l=e;a<l;a++){for(n=this.rootNode.childNodes[a],n||(n=this.table.rootDocument.createElement("tr"),this.rootNode.appendChild(n)),this.renderedNodes=n.childNodes.length;this.renderedNodes<s;)n.appendChild(this.table.rootDocument.createElement("th")),this.renderedNodes+=1;for(;this.renderedNodes>s;)n.removeChild(n.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 n&&mo(n)}render(){const{columnHeadersCount:e}=this.table;this.table.isAriaEnabled()&&Xe(this.rootNode,[Nk()]);for(let r=0;r<e;r+=1){const{columnHeaderFunctions:n,columnsToRender:i,rowHeadersCount:s}=this.table,o=this.rootNode.childNodes[r];this.table.isAriaEnabled()&&Xe(o,[CS(),$k(r+1)]);for(let a=-1*s;a<i;a+=1){const l=this.table.renderedColumnToSource(a),c=o.childNodes[a+s];c.className="",c.removeAttribute("style"),vh(c,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Xe(c,[Ry(a+1+this.table.rowHeadersCount),wh(-1),AZ(),...a>=0?[kZ()]:[CS()]]),n[r](l,c,r)}}}}let xA=!1;class yte extends pg{constructor(e){super(null,e)}adjust(){const{columnsToRender:e,rowHeadersCount:r}=this.table,n=e+r;for(;this.renderedNodes<n;)this.rootNode.appendChild(this.table.rootDocument.createElement("col")),this.renderedNodes+=1;for(;this.renderedNodes>n;)this.rootNode.removeChild(this.rootNode.lastChild),this.renderedNodes-=1}render(){this.adjust();const{columnsToRender:e,rowHeadersCount:r}=this.table;!xA&&e>1e3&&(xA=!0,Vt(Dt`Performance tip: Handsontable rendered more than 1000 visible columns.\x20
  79. Consider limiting the number of rendered columns by specifying the table width and/or\x20
  80. turning off the "renderAllColumns" option.`));for(let i=0;i<r;i++){const s=this.table.renderedColumnToSource(i),o=this.table.columnUtils.getHeaderWidth(s);this.rootNode.childNodes[i].style.width=`${o}px`}for(let i=0;i<e;i++){const s=this.table.renderedColumnToSource(i),o=this.table.columnUtils.getStretchedColumnWidth(s);this.rootNode.childNodes[i+r].style.width=`${o}px`}const n=this.rootNode.firstChild;n&&Re(n,"rowHeader")}}function bte(t,e,r){return e=Ete(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ete(t){var e=Rte(t,"string");return typeof e=="symbol"?e:e+""}function Rte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}let yA=!1;class Tte extends pg{constructor(e){super("TR",e),bte(this,"orderView",void 0),this.orderView=new AN(e,r=>this.nodesPool.obtain(r),this.nodeType)}getRenderedNode(e){return this.orderView.getNode(e)}render(){const{rowsToRender:e}=this.table;!yA&&e>1e3&&(yA=!0,Vt(Dt`Performance tip: Handsontable rendered more than 1000 visible rows.\x20
  81. Consider limiting the number of rendered rows by specifying the table height and/or\x20
  82. turning off the "renderAllRows" option.`)),this.table.isAriaEnabled()&&Xe(this.rootNode,[Nk()]),this.orderView.setSize(e).setOffset(this.table.renderedRowToSource(0)).start();for(let i=0;i<e;i++){this.orderView.render();const s=this.orderView.getCurrentNode(),o=this.table.renderedRowToSource(i);if(this.table.isAriaEnabled()){var r,n;Xe(s,[CS(),$k(o+((r=(n=this.table.rowUtils)===null||n===void 0||(n=n.dataAccessObject)===null||n===void 0?void 0:n.columnHeaders.length)!==null&&r!==void 0?r:0)+1)])}}this.orderView.end()}}function bA(t,e,r){return e=_te(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _te(t){var e=Ate(t,"string");return typeof e=="symbol"?e:e+""}function Ate(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Mte extends pg{constructor(){super("TD"),bA(this,"orderViews",new WeakMap),bA(this,"sourceRowIndex",0)}obtainOrderView(e){let r;return this.orderViews.has(e)?r=this.orderViews.get(e):(r=new MN(e,n=>this.nodesPool.obtain(this.sourceRowIndex,n),this.nodeType),this.orderViews.set(e,r)),r}render(){const{rowsToRender:e,columnsToRender:r,rows:n,rowHeaders:i}=this.table;for(let a=0;a<e;a++){const l=this.table.renderedRowToSource(a),c=n.getRenderedNode(a);this.sourceRowIndex=l;const u=this.obtainOrderView(c),h=i.obtainOrderView(c);u.prependView(h).setSize(r).setOffset(this.table.renderedColumnToSource(0)).start();for(let d=0;d<r;d++){u.render();const f=u.getCurrentNode(),g=this.table.renderedColumnToSource(d);if(Ze(f,"hide")||(f.className=""),f.removeAttribute("style"),f.removeAttribute("dir"),vh(f,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.cellRenderer(l,g,f),this.table.isAriaEnabled()){var s,o;Xe(f,[...f.hasAttribute("role")?[]:[TZ()],wh(-1),Ry(g+((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)])}}u.end()}}}function zr(t,e,r){return e=Ite(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ite(t){var e=Ote(t,"string");return typeof e=="symbol"?e:e+""}function Ote(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Pte{constructor(e){let{cellRenderer:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};zr(this,"rootNode",void 0),zr(this,"rootDocument",void 0),zr(this,"rowHeaders",null),zr(this,"columnHeaders",null),zr(this,"colGroup",null),zr(this,"rows",null),zr(this,"cells",null),zr(this,"rowFilter",null),zr(this,"columnFilter",null),zr(this,"rowUtils",null),zr(this,"columnUtils",null),zr(this,"rowsToRender",0),zr(this,"columnsToRender",0),zr(this,"rowHeaderFunctions",[]),zr(this,"rowHeadersCount",0),zr(this,"columnHeaderFunctions",[]),zr(this,"columnHeadersCount",0),zr(this,"cellRenderer",void 0),this.rootNode=e,this.rootDocument=this.rootNode.ownerDocument,this.cellRenderer=r}setAxisUtils(e,r){this.rowUtils=e,this.columnUtils=r}setViewportSize(e,r){this.rowsToRender=e,this.columnsToRender=r}setFilters(e,r){this.rowFilter=e,this.columnFilter=r}setHeaderContentRenderers(e,r){this.rowHeaderFunctions=e,this.rowHeadersCount=e.length,this.columnHeaderFunctions=r,this.columnHeadersCount=r.length}setRenderers(){let{rowHeaders:e,columnHeaders:r,colGroup:n,rows:i,cells:s}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.setTable(this),r.setTable(this),n.setTable(this),i.setTable(this),s.setTable(this),this.rowHeaders=e,this.columnHeaders=r,this.colGroup=n,this.rows=i,this.cells=s}renderedRowToSource(e){return this.rowFilter.renderedToSource(e)}renderedColumnToSource(e){return this.columnFilter.renderedToSource(e)}isAriaEnabled(){return this.rowUtils.wtSettings.getSetting("ariaTags")}render(){this.colGroup.adjust(),this.columnHeaders.adjust(),this.rows.adjust(),this.rowHeaders.adjust(),this.columnHeaders.render(),this.rows.render(),this.rowHeaders.render(),this.cells.render(),this.columnUtils.calculateWidths(),this.colGroup.render();const{rowsToRender:e,rows:r}=this;for(let n=0;n<e;n++){const i=r.getRenderedNode(n);if(i.firstChild){const s=this.renderedRowToSource(n),o=this.rowUtils.getHeight(s);o?i.firstChild.style.height=`${o-1}px`:i.firstChild.style.height=""}}}}class Dte{constructor(){let{TABLE:e,THEAD:r,COLGROUP:n,TBODY:i,rowUtils:s,columnUtils:o,cellRenderer:a}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.renderer=new Pte(e,{cellRenderer:a}),this.renderer.setRenderers({rowHeaders:new Ste,columnHeaders:new xte(r),colGroup:new yte(n),rows:new Tte(i),cells:new Mte}),this.renderer.setAxisUtils(s,o)}setFilters(e,r){return this.renderer.setFilters(e,r),this}setViewportSize(e,r){return this.renderer.setViewportSize(e,r),this}setHeaderContentRenderers(e,r){return this.renderer.setHeaderContentRenderers(e,r),this}adjust(){this.renderer.adjust()}render(){this.renderer.render()}}function Vh(t,e,r){kte(t,e),e.set(t,r)}function kte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function d0(t,e,r){return e=Nte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nte(t){var e=Hte(t,"string");return typeof e=="symbol"?e:e+""}function Hte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function un(t,e){return t.get(IN(t,e))}function Wh(t,e,r){return t.set(IN(t,e),r),r}function IN(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var f0=new WeakMap,eu=new WeakMap,Uh=new WeakMap,g0=new WeakMap,_l=new WeakMap;class Wy{static get DEFAULT_WIDTH(){return 50}constructor(e){let{totalColumns:r,stretchMode:n,stretchingColumnWidthFn:i,columnWidthFn:s}=e;d0(this,"stretchAllRatio",0),d0(this,"stretchLastWidth",0),d0(this,"stretchAllColumnsWidth",[]),Vh(this,f0,0),d0(this,"needVerifyLastColumnWidth",!0),Vh(this,eu,()=>0),Vh(this,Uh,o=>o),Vh(this,g0,o=>o),Vh(this,_l,()=>"none"),Wh(eu,this,r),Wh(_l,this,n),Wh(Uh,this,i??un(Uh,this)),Wh(g0,this,s??un(g0,this))}refreshStretching(e){if(un(_l,this).call(this)==="none")return;this.stretchAllRatio=0,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0,this.stretchLastWidth=0,Wh(f0,this,e);let r=0;for(let i=0;i<un(eu,this).call(this);i++){const s=this._getColumnWidth(i),o=un(Uh,this).call(this,void 0,i);typeof o=="number"?e-=o:r+=s}const n=e-r;if(un(_l,this).call(this)==="all"&&n>0)this.stretchAllRatio=e/r,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0;else if(un(_l,this).call(this)==="last"&&e!==1/0){const i=this._getColumnWidth(un(eu,this).call(this)-1),s=n+i;this.stretchLastWidth=s>=0?s:i}}getStretchedColumnWidth(e,r){let n=null;return un(_l,this).call(this)==="all"&&this.stretchAllRatio!==0?n=this._getStretchedAllColumnWidth(e,r):un(_l,this).call(this)==="last"&&this.stretchLastWidth!==0&&(n=this._getStretchedLastColumnWidth(e)),n}_getStretchedAllColumnWidth(e,r){let n=0;if(!this.stretchAllColumnsWidth[e]){const i=Math.round(r*this.stretchAllRatio),s=un(Uh,this).call(this,i,e);s===void 0?this.stretchAllColumnsWidth[e]=i:this.stretchAllColumnsWidth[e]=isNaN(s)?this._getColumnWidth(e):s}if(this.stretchAllColumnsWidth.length===un(eu,this).call(this)&&this.needVerifyLastColumnWidth){this.needVerifyLastColumnWidth=!1;for(let i=0;i<this.stretchAllColumnsWidth.length;i++)n+=this.stretchAllColumnsWidth[i];n!==un(f0,this)&&(this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length-1]+=un(f0,this)-n)}return this.stretchAllColumnsWidth[e]}_getStretchedLastColumnWidth(e){return e===un(eu,this).call(this)-1?this.stretchLastWidth:null}_getColumnWidth(e){let r=un(g0,this).call(this,e);return isNaN(r)&&(r=Wy.DEFAULT_WIDTH),r}}function m0(t,e,r){return e=Fte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fte(t){var e=Lte(t,"string");return typeof e=="symbol"?e:e+""}function Lte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class $te{constructor(e,r){m0(this,"dataAccessObject",void 0),m0(this,"wtSettings",void 0),m0(this,"headerWidths",new Map),m0(this,"stretching",void 0),this.dataAccessObject=e,this.wtSettings=r,this.stretching=new Wy({totalColumns:()=>this.wtSettings.getSetting("totalColumns"),stretchMode:()=>this.wtSettings.getSetting("stretchH"),stretchingColumnWidthFn:(n,i)=>this.wtSettings.getSetting("onBeforeStretchingColumnWidth",n,i),columnWidthFn:n=>this.dataAccessObject.wtTable.getColumnWidth(n)})}getWidth(e){return this.wtSettings.getSetting("columnWidth",e)||this.wtSettings.getSetting("defaultColumnWidth")}getStretchedColumnWidth(e){let r=this.getWidth(e);const n=this.stretching.getStretchedColumnWidth(e,r);return n&&(r=n),r}getHeaderHeight(e){let r=this.wtSettings.getSetting("defaultRowHeight");const n=this.dataAccessObject.wtViewport.oversizedColumnHeaders[e];return n!==void 0&&(r=r?Math.max(r,n):n),r}getHeaderWidth(e){return this.headerWidths.get(this.dataAccessObject.wtTable.columnFilter.sourceToRendered(e))}refreshStretching(){const{wtTable:e,wtViewport:r,cloneSource:n}=this.dataAccessObject,i=n?n.wtTable.holder:e.holder,s=i.offsetHeight<i.scrollHeight?Qr():0;this.stretching.refreshStretching(r.getViewportWidth()-s)}calculateWidths(){const{wtSettings:e}=this;let r=e.getSetting("rowHeaderWidth");if(this.refreshStretching(),r=e.getSetting("onModifyRowHeaderWidth",r),r!=null){const n=e.getSetting("rowHeaders").length,i=e.getSetting("defaultColumnWidth");for(let s=0;s<n;s++){let o=Array.isArray(r)?r[s]:r;o=o??i,this.headerWidths.set(s,o)}}}}function EA(t,e,r){return e=Bte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bte(t){var e=Vte(t,"string");return typeof e=="symbol"?e:e+""}function Vte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Wte{constructor(e,r){EA(this,"dataAccessObject",void 0),EA(this,"wtSettings",void 0),this.dataAccessObject=e,this.wtSettings=r}getHeight(e){let r=this.wtSettings.getSetting("rowHeight",e);const n=this.dataAccessObject.wtViewport.oversizedRows[e];return n!==void 0&&(r=r===void 0?n:Math.max(r,n)),r}}function Ls(t,e,r){return e=Ute(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,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 r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Sh{constructor(e,r,n,i,s){Ls(this,"wtSettings",null),Ls(this,"domBindings",void 0),Ls(this,"TBODY",null),Ls(this,"THEAD",null),Ls(this,"COLGROUP",null),Ls(this,"hasTableHeight",!0),Ls(this,"hasTableWidth",!0),Ls(this,"isTableVisible",!1),Ls(this,"tableOffset",0),Ls(this,"holderOffset",0),this.domBindings=n,this.isMaster=s==="master",this.name=s,this.dataAccessObject=e,this.facadeGetter=r,this.wtSettings=i,this.instance=this.dataAccessObject.wot,this.wot=this.dataAccessObject.wot,this.TABLE=n.rootTable,Wk(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 Wte(this.dataAccessObject,this.wtSettings),this.columnUtils=new $te(this.dataAccessObject,this.wtSettings),this.tableRenderer=new Dte({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 r=e.parentNode;let n;return(!r||r.nodeType!==Node.ELEMENT_NODE||!Ze(r,"wtHolder"))&&(n=this.domBindings.rootDocument.createElement("div"),n.className="wtSpreader",r&&r.insertBefore(n,e),n.appendChild(e)),n.style.position="relative",this.wtSettings.getSetting("ariaTags")&&Xe(n,[co()]),n}createHider(e){const r=e.parentNode;let n;return(!r||r.nodeType!==Node.ELEMENT_NODE||!Ze(r,"wtHolder"))&&(n=this.domBindings.rootDocument.createElement("div"),n.className="wtHider",r&&r.insertBefore(n,e),n.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Xe(n,[co()]),n}createHolder(e){const r=e.parentNode;let n;return(!r||r.nodeType!==Node.ELEMENT_NODE||!Ze(r,"wtHolder"))&&(n=this.domBindings.rootDocument.createElement("div"),n.style.position="relative",n.className="wtHolder",r&&r.insertBefore(n,e),this.isMaster&&(n.parentNode.className+="ht_master handsontable",n.parentNode.setAttribute("dir",this.wtSettings.getSettingPure("rtlMode")?"rtl":"ltr"),this.wtSettings.getSetting("ariaTags")&&Xe(n.parentNode,[co()])),n.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Xe(n,[co()]),n}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:r}=this,{wtOverlays:n,wtViewport:i}=this.dataAccessObject,s=r.getSetting("totalRows"),o=r.getSetting("totalColumns"),a=r.getSetting("rowHeaders"),l=a.length,c=r.getSetting("columnHeaders"),u=c.length;let h=e;if(this.isMaster&&(this.holderOffset=Zr(this.holder),h=i.createRenderCalculators(h),l&&!r.getSetting("fixedColumnsStart"))){const f=n.inlineStartOverlay.getScrollPosition(),g=this.correctHeaderWidth;this.correctHeaderWidth=f!==0,g!==this.correctHeaderWidth&&(h=!1)}if(this.isMaster&&n.beforeDraw(),h)this.isMaster&&(i.createVisibleCalculators(),i.createPartiallyVisibleCalculators()),n&&n.refresh(!0);else{this.isMaster?this.tableOffset=Zr(this.TABLE):this.tableOffset=this.dataAccessObject.parentTableOffset;const f=s>0?this.getFirstRenderedRow():0,g=o>0?this.getFirstRenderedColumn():0;this.rowFilter=new nte(f,s,u),this.columnFilter=new ete(g,o,l);let m=!0;if(this.isMaster){this.alignOverlaysWithTrimmingContainer();const p={};this.wtSettings.getSetting("beforeDraw",!0,p),m=p.skipRender!==!0}if(m){this.tableRenderer.setHeaderContentRenderers(a,c),(this.is(oo)||this.is(ol))&&this.tableRenderer.setHeaderContentRenderers(a,[]),this.resetOversizedRows(),this.tableRenderer.setViewportSize(this.getRenderedRowsCount(),this.getRenderedColumnsCount()).setFilters(this.rowFilter,this.columnFilter).render();let p;if(this.isMaster&&(p=this.dataAccessObject.workspaceWidth,i.containerWidth=null,this.markOversizedColumnHeaders()),this.adjustColumnHeaderHeights(),(this.isMaster||this.is(oo))&&this.markOversizedRows(),this.isMaster){i.createVisibleCalculators(),i.createPartiallyVisibleCalculators(),n.refresh(!1),n.applyToDOM();const S=Bt(this.hider),y=Bt(this.TABLE);S!==0&&y!==S&&(this.columnUtils.calculateWidths(),this.tableRenderer.renderer.colGroup.render()),p!==i.getWorkspaceWidth()&&(i.containerWidth=null,this.columnUtils.calculateWidths(),this.tableRenderer.renderer.colGroup.render()),this.wtSettings.getSetting("onDraw",!0)}else this.is(oo)&&this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize()}}let d=!1;return this.isMaster&&(d=n.topOverlay.resetFixedPosition(),n.bottomOverlay.clone&&(d=n.bottomOverlay.resetFixedPosition()||d),d=n.inlineStartOverlay.resetFixedPosition()||d,n.topInlineStartCornerOverlay&&n.topInlineStartCornerOverlay.resetFixedPosition(),n.bottomInlineStartCornerOverlay&&n.bottomInlineStartCornerOverlay.clone&&n.bottomInlineStartCornerOverlay.resetFixedPosition()),d?(n.refreshAll(),n.adjustElementsSize()):this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(h),this.isMaster&&n.afterDraw(),this.dataAccessObject.drawn=!0,this}markIfOversizedColumnHeader(e){const r=this.columnFilter.renderedToSource(e);let n=this.wtSettings.getSetting("columnHeaders").length;const i=this.wtSettings.getSetting("defaultRowHeight");let s,o,a;const l=this.wtSettings.getSetting("columnHeaderHeight")||[];for(;n;)n-=1,s=this.getColumnHeaderHeight(n),o=this.getColumnHeader(r,n),o&&(a=$u(o),(!s&&i<a||s<a)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=a),Array.isArray(l)?l[n]!==null&&l[n]!==void 0&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=l[n]):isNaN(l)||(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=l),this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]<(l[n]||l)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=l[n]||l))}adjustColumnHeaderHeights(){const{wtSettings:e}=this,r=this.THEAD.childNodes,n=this.dataAccessObject.wtViewport.oversizedColumnHeaders,i=e.getSetting("columnHeaders");for(let s=0,o=i.length;s<o;s++)if(n[s]){if(!r[s]||r[s].childNodes.length===0)return;r[s].childNodes[0].style.height=`${n[s]}px`}}resetOversizedRows(){const{wtSettings:e}=this,{wtViewport:r}=this.dataAccessObject;if(!(!this.isMaster&&!this.is(oo))&&!e.getSetting("externalRowCalculator")){const n=this.getRenderedRowsCount();for(let i=0;i<n;i++){const s=this.rowFilter.renderedToSource(i);r.oversizedRows&&r.oversizedRows[s]&&(r.oversizedRows[s]=void 0)}}}getCell(e){let r=e.row,n=e.col;const i=this.wtSettings.getSetting("onModifyGetCellCoords",r,n);if(i&&Array.isArray(i)&&([r,n]=i),this.isRowBeforeRenderedRows(r))return-1;if(this.isRowAfterRenderedRows(r))return-2;if(this.isColumnBeforeRenderedColumns(n))return-3;if(this.isColumnAfterRenderedColumns(n))return-4;const s=this.getRow(r);if(!s&&r>=0)throw new Error("TR was expected to be rendered but is not");const o=s.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(n)];if(!o&&n>=0)throw new Error("TD or TH was expected to be rendered but is not");return o}getRow(e){let r=null,n=null;if(e<0){var i;r=(i=this.rowFilter)===null||i===void 0?void 0:i.sourceRowToVisibleColHeadedRow(e),n=this.THEAD}else{var s;r=(s=this.rowFilter)===null||s===void 0?void 0:s.sourceToRendered(e),n=this.TBODY}return r!==void 0&&n!==void 0?n.childNodes.length<r+1?!1:n.childNodes[r]:!1}getColumnHeader(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const n=this.THEAD.childNodes[r];return n?.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]}getColumnHeaders(e){const r=[],n=this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e);return this.THEAD.childNodes.forEach(i=>{const s=i.childNodes[n];s&&r.push(s)}),r}getRowHeader(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const n=this.wtSettings.getSetting("rowHeaders").length;if(r>=n)return;const i=this.rowFilter.sourceToRendered(e),s=i<0?this.rowFilter.sourceRowToVisibleColHeadedRow(e):i,a=(i<0?this.THEAD:this.TBODY).childNodes[s];return a?.childNodes[r]}getRowHeaders(e){const r=[],n=this.wtSettings.getSetting("rowHeaders").length;for(let i=0;i<n;i++){const s=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)],o=s?.childNodes[i];o&&r.push(o)}return r}getCoords(e){let r=e;if(r.nodeName!=="TD"&&r.nodeName!=="TH"&&(r=Sc(r,["TD","TH"])),r===null)return null;const n=r.parentNode,i=n.parentNode;let s=ZZ(n),o=r.cellIndex;return El(_c,r,this.wtRootElement)||El(Rc,r,this.wtRootElement)?i.nodeName==="THEAD"&&(s-=i.childNodes.length):El(ol,r,this.wtRootElement)||El(oo,r,this.wtRootElement)?s=this.wtSettings.getSetting("totalRows")-i.childNodes.length+s:i===this.THEAD?s=this.rowFilter.visibleColHeadedRowToSourceRow(s):s=this.rowFilter.renderedToSource(s),El(_c,r,this.wtRootElement)||El(Tc,r,this.wtRootElement)||El(ol,r,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 r=e*this.wtSettings.getSetting("defaultRowHeight"),n=$u(this.TBODY)-1;let i,s,o,a,l;if(!(r===n&&!this.wtSettings.getSetting("fixedRowsBottom")))for(;e;)e-=1,o=this.rowFilter.renderedToSource(e),i=this.getRowHeight(o),a=this.getTrForRow(o),l=a.querySelector("th"),l?s=$u(l):s=$u(a)-1,(!i&&this.wtSettings.getSetting("defaultRowHeight")<s||i<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 n=this.wtSettings.getSetting("rowHeaders").length;return Math.abs(e)<=n}isRowHeaderRendered(e){if(e>=0)return!1;const n=this.wtSettings.getSetting("columnHeaders").length;return Math.abs(e)<=n}isRowBeforeRenderedRows(e){const r=this.getFirstRenderedRow();return e<0&&r<=0?!this.isRowHeaderRendered(e):e<r}isRowAfterRenderedRows(e){return e>this.getLastRenderedRow()}isColumnBeforeRenderedColumns(e){const r=this.getFirstRenderedColumn();return e<0&&r<=0?!this.isColumnHeaderRendered(e):e<r}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 Bt(this.TABLE)}getHeight(){return pr(this.TABLE)}getTotalWidth(){const e=Bt(this.hider);return e!==0?e:this.getWidth()}getTotalHeight(){const e=pr(this.hider);return e!==0?e:this.getHeight()}isVisible(){return yc(this.TABLE)}_modifyRowHeaderWidth(e){let r=Xt(e)?e():null;return Array.isArray(r)?(r=[...r],r[r.length-1]=this._correctRowHeaderWidth(r[r.length-1])):r=this._correctRowHeaderWidth(r),r}_correctRowHeaderWidth(e){let r=e;return typeof e!="number"&&(r=this.wtSettings.getSetting("defaultColumnWidth")),this.correctHeaderWidth&&(r+=1),r}}const zte="stickyRowsBottom",Uy={getFirstRenderedRow(){const t=this.wtSettings.getSetting("totalRows"),e=this.wtSettings.getSetting("fixedRowsBottom"),r=t-e;return t===0||e===0?-1:r<0?0:r},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}};ma(Uy,"MIXIN_NAME",zte,{writable:!1,enumerable:!1});const Gte="stickyColumnsStart",Iw={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}};ma(Iw,"MIXIN_NAME",Gte,{writable:!1,enumerable:!1});class Yy extends Sh{constructor(e,r,n,i){super(e,r,n,i,ol)}}zt(Yy,Uy);zt(Yy,Iw);const Rc="top",oo="bottom",Tc="inline_start",_c="top_inline_start_corner",ol="bottom_inline_start_corner",jte=[Rc,oo,Tc,_c,ol],Kte=new Map([[Rc,`ht_clone_${Rc}`],[oo,`ht_clone_${oo}`],[Tc,`ht_clone_${Tc} ht_clone_left`],[_c,`ht_clone_${_c} ht_clone_top_left_corner`],[ol,`ht_clone_${ol} ht_clone_bottom_left_corner`]]);function Xte(t,e){qte(t,e),e.add(t)}function qte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zte(t,e,r){return e=Jte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jte(t){var e=Qte(t,"string");return typeof e=="symbol"?e:e+""}function Qte(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function p0(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Yh=new WeakSet;class ere{constructor(e){Xte(this,Yh),Zte(this,"dataAccessObject",void 0),this.dataAccessObject=e}scrollViewport(e,r,n,i,s){const o=this.scrollViewportHorizontally(e.col,n,s),a=this.scrollViewportVertically(e.row,r,i);return o||a}scrollViewportHorizontally(e,r,n){const{drawn:i,totalColumns:s}=this.dataAccessObject;if(!i||!Number.isInteger(e)||e<0||e>s)return!1;const o=r===void 0&&n===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 c=this.getFirstVisibleColumn(),u=this.getLastVisibleColumn();let h=!1;return(o&&(e<c||e>u)||!o)&&(h=l.scrollTo(e,o?e>=this.getLastPartiallyVisibleColumn():r)),h}scrollViewportVertically(e,r,n){const{drawn:i,totalRows:s}=this.dataAccessObject;if(!i||!Number.isInteger(e)||e<0||e>s)return!1;const o=r===void 0&&n===void 0,{fixedRowsBottom:a,fixedRowsTop:l,topOverlay:c}=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 u=this.getFirstVisibleRow(),h=this.getLastVisibleRow();let d=!1;return(o&&(e<u||e>h)||!o)&&(d=c.scrollTo(e,o?e>=this.getLastPartiallyVisibleRow():n)),d}getFirstVisibleRow(){return this.dataAccessObject.wtTable.getFirstVisibleRow()}getLastVisibleRow(){return p0(Yh,this,TA).call(this,this.dataAccessObject.wtTable.getLastVisibleRow())}getFirstPartiallyVisibleRow(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow()}getLastPartiallyVisibleRow(){return p0(Yh,this,TA).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleRow())}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){return p0(Yh,this,RA).call(this,this.dataAccessObject.wtTable.getLastVisibleColumn())}getFirstPartiallyVisibleColumn(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn()}getLastPartiallyVisibleColumn(){return p0(Yh,this,RA).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn())}}function RA(t){const{wtSettings:e,inlineStartOverlay:r,wtTable:n,wtViewport:i,totalColumns:s,rootWindow:o}=this.dataAccessObject;if(r.mainTableScrollableElement===o){const a=e.getSetting("rtlMode");let l=null;if(a){const u=n.TABLE.getBoundingClientRect(),d=this.dataAccessObject.rootWindow.document.documentElement.offsetWidth;l=Math.abs(u.right-d)}else l=Zr(n.wtRootElement).left;const c=Math.abs(Yk(o,o));if(l>c){const u=zk(o);let h=i.getRowHeaderWidth();for(let d=1;d<=s;d++)if(h+=r.sumCellSizes(d-1,d),l+h-c>=u){t=d-2;break}}}return t}function TA(t){const{topOverlay:e,wtTable:r,wtViewport:n,totalRows:i,rootWindow:s}=this.dataAccessObject;if(e.mainTableScrollableElement===s){const o=Zr(r.wtRootElement),a=Ay(s,s);if(o.top>a){const l=$u(s);let c=n.getColumnHeaderHeight();for(let u=1;u<=i;u++)if(c+=e.sumCellSizes(u-1,u),o.top+c-a>=l){t=u-2;break}}}return t}function Qi(t,e,r){return e=tre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tre(t){var e=rre(t,"string");return typeof e=="symbol"?e:e+""}function rre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class zy{get eventManager(){return new As(this)}constructor(e,r){Qi(this,"wtTable",void 0),Qi(this,"wtScroll",void 0),Qi(this,"wtViewport",void 0),Qi(this,"wtOverlays",void 0),Qi(this,"selectionManager",void 0),Qi(this,"wtEvent",void 0),Qi(this,"guid",`wt_${Pk()}`),Qi(this,"drawInterrupted",!1),Qi(this,"drawn",!1),Qi(this,"domBindings",void 0),Qi(this,"wtSettings",void 0),this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView},this.wtSettings=r,this.wtScroll=new ere(this.createScrollDao())}findOriginalHeaders(){const e=[];if(this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(let r=0,n=this.wtTable.THEAD.childNodes[0].childNodes.length;r<n;r++)e.push(this.wtTable.THEAD.childNodes[0].childNodes[r].innerHTML);this.wtSettings.getSetting("columnHeaders").length||this.wtSettings.update("columnHeaders",[function(r,n){xc(n,e[r])}])}}createCellCoords(e,r){return new Ec(e,r,this.wtSettings.getSetting("rtlMode"))}createCellRange(e,r,n){return new mg(e,r,n,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 n=this.wtSettings.getSetting("totalRows"),i=this.wtSettings.getSetting("fixedRowsTop"),s=this.wtSettings.getSetting("fixedRowsBottom"),o=this.wtSettings.getSetting("fixedColumnsStart");if(e.row<i&&e.col<o)return this.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.getCell(e);if(e.row<i)return this.wtOverlays.topOverlay.clone.wtTable.getCell(e);if(e.col<o&&e.row>=n-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<n&&e.row>=n-s&&this.wtOverlays.bottomOverlay&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)}scrollViewport(e,r,n,i,s){return e.col<0||e.row<0?!1:this.wtScroll.scrollViewport(e,r,n,i,s)}scrollViewportHorizontally(e,r,n){return e<0?!1:this.wtScroll.scrollViewportHorizontally(e,r,n)}scrollViewportVertically(e,r,n){return e<0?!1:this.wtScroll.scrollViewportVertically(e,r,n)}getViewport(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]}destroy(){this.wtOverlays.destroy(),this.wtEvent.destroy()}createScrollDao(){const e=this;return{get drawn(){return e.drawn},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get wtTable(){return e.wtTable},get wtViewport(){return e.wtViewport},get wtSettings(){return e.wtSettings},get rootWindow(){return e.domBindings.rootWindow},get totalRows(){return e.wtSettings.getSetting("totalRows")},get totalColumns(){return e.wtSettings.getSetting("totalColumns")},get fixedRowsTop(){return e.wtSettings.getSetting("fixedRowsTop")},get fixedRowsBottom(){return e.wtSettings.getSetting("fixedRowsBottom")},get fixedColumnsStart(){return e.wtSettings.getSetting("fixedColumnsStart")}}}getTableDao(){const e=this;return{get wot(){return e},get parentTableOffset(){return e.cloneSource.wtTable.tableOffset},get cloneSource(){return e.cloneSource},get workspaceWidth(){return e.wtViewport.getWorkspaceWidth()},get wtViewport(){return e.wtViewport},get wtOverlays(){return e.wtOverlays},get selectionManager(){return e.selectionManager},get drawn(){return e.drawn},set drawn(r){e.drawn=r},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 _A(t,e,r){return e=nre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nre(t){var e=ire(t,"string");return typeof e=="symbol"?e:e+""}function ire(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sre extends zy{constructor(e,r,n){super(e,r),_A(this,"cloneSource",void 0),_A(this,"cloneOverlay",void 0);const i=this.wtSettings.getSetting("facade",this);this.cloneSource=n.source,this.cloneOverlay=n.overlay,this.wtTable=this.cloneOverlay.createTable(this.getTableDao(),i,this.domBindings,this.wtSettings),this.wtViewport=n.viewport,this.selectionManager=n.selectionManager,this.wtEvent=new _N(i,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,n.event),this.findOriginalHeaders()}}function ore(t,e,r){return e=are(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function are(t){var e=lre(t,"string");return typeof e=="symbol"?e:e+""}function lre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class wg{constructor(e,r,n,i,s){ore(this,"wtSettings",null),ma(this,"wot",e,{writable:!1}),this.domBindings=s,this.facadeGetter=r,this.wtSettings=i;const{TABLE:o,hider:a,spreader:l,holder:c,wtRootElement:u}=this.wot.wtTable;this.instance=this.wot,this.type=n,this.mainTableScrollableElement=null,this.TABLE=o,this.hider=a,this.spreader=l,this.holder=c,this.wtRootElement=u,this.trimmingContainer=oh(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=oh(this.hider.parentNode.parentNode)}updateMainScrollableElement(){const{wtTable:e}=this.wot,{rootWindow:r}=this.domBindings;r.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=this.wot.wtTable.holder:this.mainTableScrollableElement=vp(e.TABLE)}getRelativeCellPosition(e,r,n){if(this.clone.wtTable.holder.contains(e)===!1){Vt(`The provided element is not a child of the ${this.type} overlay`);return}const i=this.mainTableScrollableElement===this.domBindings.rootWindow,s=n<this.wtSettings.getSetting("fixedColumnsStart"),o=r<this.wtSettings.getSetting("fixedRowsTop"),a=r>=this.wtSettings.getSetting("totalRows")-this.wtSettings.getSetting("fixedRowsBottom"),l=this.clone.wtTable.spreader,c={start:this.getRelativeStartPosition(l),top:l.offsetTop},u={start:this.getRelativeStartPosition(e),top:e.offsetTop};let h=null;return i?h=this.getRelativeCellPositionWithinWindow(o,s,u,c):h=this.getRelativeCellPositionWithinHolder(o,a,s,u,c),h}getRelativeStartPosition(e){return this.isRtl()?e.offsetParent.offsetWidth-e.offsetLeft-e.offsetWidth:e.offsetLeft}getRelativeCellPositionWithinWindow(e,r,n,i){const s=this.wot.wtTable.wtRootElement.getBoundingClientRect();let o=0,a=0;if(!r)o=i.start;else{let l=s.left;this.isRtl()&&(l=this.domBindings.rootWindow.innerWidth-(s.left+s.width+Qr())),o=l<=0?-1*l:0}return e?a=this.clone.wtTable.TABLE.getBoundingClientRect().top-s.top:a=i.top,{start:n.start+o,top:n.top+a}}getRelativeCellPositionWithinHolder(e,r,n,i,s){const o={horizontal:this.wot.wtOverlays.inlineStartOverlay.getScrollPosition(),vertical:this.wot.wtOverlays.topOverlay.getScrollPosition()};let a=0,l=0;if(n||(a=o.horizontal-s.start),r){const c=this.wot.wtTable.wtRootElement.getBoundingClientRect();l=this.clone.wtTable.TABLE.getBoundingClientRect().top*-1+c.top}else e||(l=o.vertical-s.top);return{start:i.start-a,top:i.top-l}}makeClone(){if(jte.indexOf(this.type)===-1)throw new Error(`Clone type "${this.type}" is not supported.`);const{wtTable:e,wtSettings:r}=this.wot,{rootDocument:n,rootWindow:i}=this.domBindings,s=n.createElement("div"),o=n.createElement("table"),a=e.wtRootElement.parentNode;s.className=`${Kte.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,r.getSetting("ariaTags")&&Xe(s,[co()]),o.className=e.TABLE.className,e.TABLE.getAttribute("role")&&o.setAttribute("role",e.TABLE.getAttribute("role")),s.appendChild(o),a.appendChild(s);const c=this.wtSettings.getSetting("preventOverflow");return c===!0||c==="horizontal"&&this.type===Rc||c==="vertical"&&this.type===Tc?this.mainTableScrollableElement=i:i.getComputedStyle(a).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=vp(e.TABLE),new sre(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,r=this.clone.wtTable.hider,n=e.style,i=r.style,s=e.parentNode.style;[n,i,s].forEach(o=>{o.width="",o.height=""})}isRtl(){return this.wtSettings.getSetting("rtlMode")}destroy(){this.clone.eventManager.destroy()}}class cre extends wg{constructor(e,r,n,i,s,o){super(e,r,ol,n,i),this.bottomOverlay=s,this.inlineStartOverlay=o}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new Yy(...r)}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 r=this.clone.wtTable.holder.parentNode;if(r.style.top="",this.trimmingContainer===this.domBindings.rootWindow){const s=this.inlineStartOverlay.getOverlayOffset(),o=this.bottomOverlay.getOverlayOffset();r.style[this.isRtl()?"right":"left"]=`${s}px`,r.style.bottom=`${o}px`}else Tw(r),this.repositionOverlay();let n=pr(this.clone.wtTable.TABLE);const i=Bt(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(n=0),r.style.height=`${n}px`,r.style.width=`${i}px`,!1}repositionOverlay(){const{wtTable:e,wtViewport:r}=this.wot,{rootDocument:n}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let s=0;r.hasVerticalScroll()||(s+=r.getWorkspaceHeight()-e.getTotalHeight()),r.hasVerticalScroll()&&r.hasHorizontalScroll()&&(s+=Qr(n)),i.style.bottom=`${s}px`}}const ure="calculatedColumns",Ow={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}};ma(Ow,"MIXIN_NAME",ure,{writable:!1,enumerable:!1});class Gy extends Sh{constructor(e,r,n,i){super(e,r,n,i,oo)}}zt(Gy,Uy);zt(Gy,Ow);function hre(t,e,r){return e=dre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dre(t){var e=fre(t,"string");return typeof e=="symbol"?e:e+""}function fre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gre extends wg{constructor(e,r,n,i){super(e,r,oo,n,i),hre(this,"cachedFixedRowsBottom",-1),this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom")}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new Gy(...r)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const{rootWindow:e}=this.domBindings,r=this.clone.wtTable.holder.parentNode;r.style.top="";let n=0;const i=this.wtSettings.getSetting("preventOverflow");this.trimmingContainer===e&&(!i||i!=="vertical")?(n=this.getOverlayOffset(),r.style.bottom=`${n}px`):(n=this.getScrollPosition(),this.repositionOverlay());const s=this.adjustHeaderBordersPosition(n);return this.adjustElementsSize(),s}repositionOverlay(){const{wtTable:e,wtViewport:r}=this.wot,{rootDocument:n}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let s=0;r.hasVerticalScroll()||(s+=r.getWorkspaceHeight()-e.getTotalHeight()),r.hasVerticalScroll()&&r.hasHorizontalScroll()&&(s+=Qr(n)),i.style.bottom=`${s}px`}setScrollPosition(e){const{rootWindow:r}=this.domBindings;let n=!1;return this.mainTableScrollableElement===r?(r.scrollTo(_y(r),e),n=!0):this.mainTableScrollableElement.scrollTop!==e&&(this.mainTableScrollableElement.scrollTop=e,n=!0),n}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,r){const{wtTable:n,wtSettings:i}=this.wot,s=i.getSetting("defaultRowHeight");let o=e,a=0;for(;o<r;){const l=n.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:r}=this.wot,{rootDocument:n,rootWindow:i}=this.domBindings,s=Qr(n),a=this.clone.wtTable.holder.parentNode.style,l=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||l==="horizontal"){let u=r.getWorkspaceWidth();this.wot.wtOverlays.hasScrollbarRight&&(u-=s),u=Math.min(u,e.wtRootElement.scrollWidth),a.width=`${u}px`}else a.width="";this.clone.wtTable.holder.style.width=a.width;let c=pr(this.clone.wtTable.TABLE);this.wot.wtTable.hasDefinedSize()||(c=0),a.height=`${c}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:r}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?r.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:r.style[e]=""}scrollTo(e,r){let n=this.getTableParentOffset();const s=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder;let o=0;r&&s.offsetHeight!==s.clientHeight&&(o=Qr(this.domBindings.rootDocument)),r?(n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportHeight(),n+=1):n+=this.sumCellSizes(this.wtSettings.getSetting("fixedRowsBottom"),e),n+=o,this.setScrollPosition(n)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return Ay(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow");let n=0;if(this.trimmingContainer===e&&(!r||r!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),s=this.clone.wtTable.getTotalHeight(),o=i-s,a=this.domBindings.rootDocument.documentElement.clientHeight;n=Math.max(this.getTableParentOffset()-this.getScrollPosition()-a+i,0),n>o&&(n=0)}return n}adjustHeaderBordersPosition(e){const r=this.wtSettings.getSetting("fixedRowsBottom"),n=this.cachedFixedRowsBottom!==r,i=this.wtSettings.getSetting("columnHeaders");let s=!1;if((n||r===0)&&i.length>0){const o=this.wot.wtTable.holder.parentNode,a=Ze(o,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||this.wtSettings.getSetting("totalRows")===0?(Re(o,"innerBorderBottom"),s=!a):(rt(o,"innerBorderBottom"),s=a)}return s}}const mre="calculatedRows",jy={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}};ma(jy,"MIXIN_NAME",mre,{writable:!1,enumerable:!1});class Ky extends Sh{constructor(e,r,n,i){super(e,r,n,i,Tc)}}zt(Ky,jy);zt(Ky,Iw);const pre="localHooks",Wn={_localHooks:Object.create(null),addLocalHook(t,e){return this._localHooks[t]||(this._localHooks[t]=[]),this._localHooks[t].push(e),this},runLocalHooks(t,e,r,n,i,s,o){if(this._localHooks[t]){const a=this._localHooks[t].length;for(let l=0;l<a;l++)SS(this._localHooks[t][l],this,e,r,n,i,s,o)}},clearLocalHooks(){return this._localHooks={},this}};ma(Wn,"MIXIN_NAME",pre,{writable:!1,enumerable:!1});let ON=class{constructor(e,r){this.settings=e,this.cellRange=r||null}isEmpty(){return this.cellRange===null}add(e){return this.isEmpty()?this.cellRange=this.settings.createCellRange(e):this.cellRange.expand(e),this}replace(e,r){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=r,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=r,!0}return!1}clear(){return this.cellRange=null,this}getCorners(){const e=this.cellRange.getOuterTopStartCorner(),r=this.cellRange.getOuterBottomEndCorner();return[e.row,e.col,r.row,r.col]}destroy(){this.runLocalHooks("destroy")}};zt(ON,Wn);const PN="active-header",Xy="header",qy="area",Zy="focus",wre="fill",vre="row",Cre="column",Sre="custom-selection",Jy=Object.freeze({width:"6px",height:"6px",borderWidth:"1px",borderStyle:"solid",borderColor:"#FFF"});var xre=Ny;xre("flat");function yre(t,e){DN(t,e),e.add(t)}function AA(t,e,r){DN(t,e),e.set(t,r)}function DN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Rr(t,e){return t.get(ef(t,e))}function MA(t,e,r){return t.set(ef(t,e),r),r}function ef(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var es=new WeakMap,Xn=new WeakMap,w0=new WeakSet;class bre{constructor(){yre(this,w0),AA(this,es,void 0),AA(this,Xn,void 0)}setActiveOverlay(e){return MA(Xn,this,e),this}setActiveSelection(e){return MA(es,this,e),this}scan(){const e=Rr(es,this).settings.selectionType,r=new Set;return e==="active-header"?(this.scanColumnsInHeadersRange(n=>r.add(n)),this.scanRowsInHeadersRange(n=>r.add(n))):e==="area"?this.scanCellsRange(n=>r.add(n)):e==="focus"?(this.scanColumnsInHeadersRange(n=>r.add(n)),this.scanRowsInHeadersRange(n=>r.add(n)),this.scanCellsRange(n=>r.add(n))):e==="fill"?this.scanCellsRange(n=>r.add(n)):e==="header"?(this.scanColumnsInHeadersRange(n=>r.add(n)),this.scanRowsInHeadersRange(n=>r.add(n))):e==="row"?(this.scanRowsInHeadersRange(n=>r.add(n)),this.scanRowsInCellsRange(n=>r.add(n))):e==="column"&&(this.scanColumnsInHeadersRange(n=>r.add(n)),this.scanColumnsInCellsRange(n=>r.add(n))),r}scanColumnsInHeadersRange(e){const[r,n,i,s]=Rr(es,this).getCorners(),{wtTable:o}=Rr(Xn,this),a=o.getRenderedColumnsCount(),l=o.getColumnHeadersCount();let c=0;for(let u=-o.getRowHeadersCount();u<a;u++){const h=o.columnFilter.renderedToSource(u);if(!(h<n||h>s)){for(let d=-l;d<0;d++){if(d<r||d>i)continue;const f=d+l;let g=o.getColumnHeader(h,f);const m=Rr(Xn,this).getSetting("onBeforeHighlightingColumnHeader",h,f,{selectionType:Rr(es,this).settings.selectionType,columnCursor:c,selectionWidth:s-n+1});m!==null&&(m!==h&&(g=o.getColumnHeader(m,f)),e(g))}c+=1}}}scanRowsInHeadersRange(e){const[r,n,i,s]=Rr(es,this).getCorners(),{wtTable:o}=Rr(Xn,this),a=o.getRenderedRowsCount(),l=o.getRowHeadersCount();let c=0;for(let u=-o.getColumnHeadersCount();u<a;u++){const h=o.rowFilter.renderedToSource(u);if(!(h<r||h>i)){for(let d=-l;d<0;d++){if(d<n||d>s)continue;const f=d+l;let g=o.getRowHeader(h,f);const m=Rr(Xn,this).getSetting("onBeforeHighlightingRowHeader",h,f,{selectionType:Rr(es,this).settings.selectionType,rowCursor:c,selectionHeight:i-r+1});m!==null&&(m!==h&&(g=o.getRowHeader(m,f)),e(g))}c+=1}}}scanCellsRange(e){const[r,n,i,s]=Rr(es,this).getCorners(),{wtTable:o}=Rr(Xn,this);ef(w0,this,uC).call(this,(a,l)=>{if(a>=r&&a<=i&&l>=n&&l<=s){const c=o.getCell(Rr(Xn,this).createCellCoords(a,l)),u=Rr(Xn,this).getSetting("onAfterDrawSelection",a,l,Rr(es,this).settings.layerLevel);typeof u=="string"&&Re(c,u),e(c)}})}scanRowsInCellsRange(e){const[r,,n]=Rr(es,this).getCorners(),{wtTable:i}=Rr(Xn,this);ef(w0,this,uC).call(this,(s,o)=>{if(s>=r&&s<=n){const a=i.getCell(Rr(Xn,this).createCellCoords(s,o));e(a)}})}scanColumnsInCellsRange(e){const[,r,,n]=Rr(es,this).getCorners(),{wtTable:i}=Rr(Xn,this);ef(w0,this,uC).call(this,(s,o)=>{if(o>=r&&o<=n){const a=i.getCell(Rr(Xn,this).createCellCoords(s,o));e(a)}})}}function uC(t){const{wtTable:e}=Rr(Xn,this),r=e.getRenderedRowsCount(),n=e.getRenderedColumnsCount();for(let i=0;i<r;i+=1){const s=e.rowFilter.renderedToSource(i);for(let o=0;o<n;o+=1)t(s,e.columnFilter.renderedToSource(o))}}class IA{constructor(e,r){r&&(this.eventManager=e.eventManager,this.instance=e,this.wot=e,this.settings=r,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=Jy,this.cornerCenterPointOffset=-(parseInt(this.cornerDefaultStyle.width,10)/2),this.corner=null,this.cornerStyle=null,this.createBorders(r),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 r=0,n=this.main.childNodes.length;r<n;r++){const i=this.main.childNodes[r];this.eventManager.addEventListener(i,"mouseenter",s=>this.onMouseEnter(s,this.main.childNodes[r]))}}onMouseDown(){this.mouseDown=!0}onMouseUp(){this.mouseDown=!1}onMouseEnter(e,r){if(!this.mouseDown||!this.wot.getSetting("hideBorderOnMouseDownOver"))return;e.preventDefault(),Ps(e);const n=this,i=this.wot.rootDocument.body,s=r.getBoundingClientRect();r.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)&&(n.eventManager.removeEventListener(i,"mousemove",a),r.style.display="block")}this.eventManager.addEventListener(i,"mousemove",a)}createBorders(e){const{rootDocument:r}=this.wot;this.main=r.createElement("div");const n=["top","start","bottom","end","corner"];let i=this.main.style;i.position="absolute",i.top=0,i.left=0;for(let a=0;a<5;a++){const l=n[a],c=r.createElement("div");c.className=`wtBorder ${this.settings.className||""}`,this.settings[l]&&this.settings[l].hide&&(c.className+=" hidden"),i=c.style,i.backgroundColor=this.settings[l]&&this.settings[l].color?this.settings[l].color:e.border.color,i.height=this.settings[l]&&this.settings[l].width?`${this.settings[l].width}px`:`${e.border.width}px`,i.width=this.settings[l]&&this.settings[l].width?`${this.settings[l].width}px`:`${e.border.width}px`,this.main.appendChild(c)}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(" "),Qa()&&this.instance.getSetting("isDataViewInstance")&&this.createMultipleSelectorHandles(),this.disappear();const{wtTable:s}=this.wot;let o=s.bordersHolder;o||(o=r.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 r=10,n=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 i={position:"absolute",height:`${n}px`,width:`${n}px`,"border-radius":`${parseInt(n/1.5,10)}px`};dt(i,(o,a)=>{this.selectionHandles.styles.bottomHitArea[a]=o,this.selectionHandles.styles.topHitArea[a]=o});const s={position:"absolute",height:`${r}px`,width:`${r}px`,"border-radius":`${parseInt(r/1.5,10)}px`,background:"#F5F5FF",border:"1px solid #4285c8"};dt(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,r){const n=this.wot.selectionManager.getAreaSelection();return!!(n.cellRange&&(e!==n.cellRange.to.row||r!==n.cellRange.to.col))}updateMultipleSelectionHandlesPosition(e,r,n,i,s,o){const l=this.wot.wtSettings.getSetting("rtlMode")?"right":"left",{top:c,topHitArea:u,bottom:h,bottomHitArea:d}=this.selectionHandles.styles,f=parseInt(c.borderWidth,10),g=parseInt(c.width,10),m=parseInt(u.width,10),p=this.wot.wtTable.getWidth(),S=this.wot.wtTable.getHeight();c.top=`${parseInt(n-g-1,10)}px`,c[l]=`${parseInt(i-g-1,10)}px`,u.top=`${parseInt(n-m/4*3,10)}px`,u[l]=`${parseInt(i-m/4*3,10)}px`;const y=Math.min(parseInt(i+s,10),p-g-f*2),C=Math.min(parseInt(i+s-m/4,10),p-m-f*2);h[l]=`${y}px`,d[l]=`${C}px`;const E=Math.min(parseInt(n+o,10),S-g-f*2),A=Math.min(parseInt(n+o-m/4,10),S-m-f*2);h.top=`${E}px`,d.top=`${A}px`,this.settings.border.cornerVisible&&this.settings.border.cornerVisible()?(c.display="block",u.display="block",this.isPartRange(e,r)?(h.display="none",d.display="none"):(h.display="block",d.display="block")):(c.display="none",h.display="none",u.display="none",d.display="none"),e===this.wot.wtSettings.getSetting("fixedRowsTop")||r===this.wot.wtSettings.getSetting("fixedColumnsStart")?(c.zIndex="9999",u.zIndex="9999"):(c.zIndex="",u.zIndex="")}appear(e){if(this.disabled)return;const{wtTable:r,rootDocument:n,rootWindow:i}=this.wot;let s,o,a,l,c,u;const h=r.getRenderedRowsCount();for(let Ae=0;Ae<h;Ae+=1){const q=r.rowFilter.renderedToSource(Ae);if(q>=e[0]&&q<=e[2]){s=q,c=e[0];break}}for(let Ae=h-1;Ae>=0;Ae-=1){const q=r.rowFilter.renderedToSource(Ae);if(q>=e[0]&&q<=e[2]){o=q;break}}const d=r.getRenderedColumnsCount();for(let Ae=0;Ae<d;Ae+=1){const q=r.columnFilter.renderedToSource(Ae);if(q>=e[1]&&q<=e[3]){a=q,u=e[1];break}}for(let Ae=d-1;Ae>=0;Ae-=1){const q=r.columnFilter.renderedToSource(Ae);if(q>=e[1]&&q<=e[3]){l=q;break}}if(s===void 0||a===void 0){this.disappear();return}let f=r.getCell(this.wot.createCellCoords(s,a));const g=s!==o||a!==l,m=g?r.getCell(this.wot.createCellCoords(o,l)):f,p=Zr(f),S=g?Zr(m):p,y=Zr(r.TABLE),C=Bt(r.TABLE),E=p.top,A=p.left,O=this.wot.wtSettings.getSetting("rtlMode");let T=0,W=0;if(O){const Ae=Bt(f),q=i.innerWidth-y.left-C;W=A+Ae-S.left,T=i.innerWidth-A-Ae-q-1}else W=S.left+Bt(m)-A,T=A-y.left-1;if(this.isEntireColumnSelected(s,o)){const Ae=this.getDimensionsFromHeader("columns",a,l,c,y);let q=null;Ae&&([q,T,W]=Ae),q&&(f=q)}let I=E-y.top-1,Y=S.top+pr(m)-E;if(this.isEntireRowSelected(a,l)){const Ae=this.getDimensionsFromHeader("rows",s,o,u,y);let q=null;Ae&&([q,I,Y]=Ae),q&&(f=q)}const z=hl(f,i);parseInt(z.borderTopWidth,10)>0&&(I+=1,Y=Y>0?Y-1:0),parseInt(z[O?"borderRightWidth":"borderLeftWidth"],10)>0&&(T+=1,W=W>0?W-1:0);const U=O?"right":"left";this.topStyle.top=`${I}px`,this.topStyle[U]=`${T}px`,this.topStyle.width=`${W}px`,this.topStyle.display="block",this.startStyle.top=`${I}px`,this.startStyle[U]=`${T}px`,this.startStyle.height=`${Y}px`,this.startStyle.display="block";const oe=Math.floor(this.settings.border.width/2);this.bottomStyle.top=`${I+Y-oe}px`,this.bottomStyle[U]=`${T}px`,this.bottomStyle.width=`${W}px`,this.bottomStyle.display="block",this.endStyle.top=`${I}px`,this.endStyle[U]=`${T+W-oe}px`,this.endStyle.height=`${Y+1}px`,this.endStyle.display="block";let Ce=this.settings.border.cornerVisible;Ce=typeof Ce=="function"?Ce(this.settings.layerLevel):Ce;const pe=this.wot.getSetting("onModifyGetCellCoords",o,l);let[Te,Se]=[o,l];if(pe&&Array.isArray(pe)&&([,,Te,Se]=pe),Qa()||!Ce||this.isPartRange(Te,Se))this.cornerStyle.display="none";else{this.cornerStyle.top=`${I+Y+this.cornerCenterPointOffset-1}px`,this.cornerStyle[U]=`${T+W+this.cornerCenterPointOffset-1}px`,this.cornerStyle.borderRightWidth=this.cornerDefaultStyle.borderWidth,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="none";let Ae=oh(r.TABLE);const q=Ae===i;q&&(Ae=n.documentElement);const Oe=parseInt(this.cornerDefaultStyle.width,10)/2,v=parseInt(this.cornerDefaultStyle.height,10)/2;if(l===this.wot.getSetting("totalColumns")-1){const w=q?m.getBoundingClientRect().left:m.offsetLeft;let x=!1,R=0;O?(R=w-parseInt(this.cornerDefaultStyle.width,10)/2,x=R<0):(R=w+Bt(m)+parseInt(this.cornerDefaultStyle.width,10)/2,x=R>=zk(Ae)),x&&(this.cornerStyle[U]=`${Math.floor(T+W+this.cornerCenterPointOffset-Oe)}px`,this.cornerStyle[O?"borderLeftWidth":"borderRightWidth"]=0)}o===this.wot.getSetting("totalRows")-1&&(q?m.getBoundingClientRect().top:m.offsetTop)+pr(m)+parseInt(this.cornerDefaultStyle.height,10)/2>=$u(Ae)&&(this.cornerStyle.top=`${Math.floor(I+Y+this.cornerCenterPointOffset-v)}px`,this.cornerStyle.borderBottomWidth=0),this.cornerStyle.display="block"}Qa()&&this.instance.getSetting("isDataViewInstance")&&this.updateMultipleSelectionHandlesPosition(o,l,I,T,W,Y)}isEntireColumnSelected(e,r){return e===this.wot.wtTable.getFirstRenderedRow()&&r===this.wot.wtTable.getLastRenderedRow()}isEntireRowSelected(e,r){return e===this.wot.wtTable.getFirstRenderedColumn()&&r===this.wot.wtTable.getLastRenderedColumn()}getDimensionsFromHeader(e,r,n,i,s){const{wtTable:o}=this.wot,a=o.wtRootElement.parentNode;let l=null,c=null,u=null,h=null,d=null,f=null,g=null,m=null;switch(e){case"rows":l=function(){return o.getRowHeader(...arguments)},c=function(){return pr(...arguments)},u="ht__selection--rows",f="top";break;case"columns":l=function(){return o.getColumnHeader(...arguments)},c=function(){return Bt(...arguments)},u="ht__selection--columns",f="left";break}if(a.classList.contains(u)){const p=this.wot.getSetting("columnHeaders").length;if(g=l(r,p-i),m=l(n,p-i),!g||!m)return!1;const S=Zr(g),y=Zr(m);return g&&m&&(h=S[f]-s[f]-1,d=y[f]+c(m)-S[f]),[g,h,d]}return!1}changeBorderStyle(e,r){const n=this[e].style,i=r[e];!i||i.hide?Re(this[e],"hidden"):(Ze(this[e],"hidden")&&rt(this[e],"hidden"),n.backgroundColor=i.color,(e==="top"||e==="bottom")&&(n.height=`${i.width}px`),(e==="start"||e==="end")&&(n.width=`${i.width}px`))}changeBorderToDefaultStyle(e){const r={width:1,color:"#000"},n=this[e].style;n.backgroundColor=r.color,n.width=`${r.width}px`,n.height=`${r.width}px`}toggleHiddenClass(e,r){this.changeBorderToDefaultStyle(e),r?Re(this[e],"hidden"):rt(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",Qa()&&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 Ere(t,e){kN(t,e),e.add(t)}function tu(t,e,r){kN(t,e),e.set(t,r)}function kN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function pt(t,e){return t.get(Qy(t,e))}function OA(t,e,r){return t.set(Qy(t,e),r),r}function Qy(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var fn=new WeakMap,Jn=new WeakMap,hC=new WeakMap,Fd=new WeakMap,dC=new WeakMap,Al=new WeakMap,PA=new WeakSet;class Rre{constructor(e){Ere(this,PA),tu(this,fn,void 0),tu(this,Jn,void 0),tu(this,hC,new bre),tu(this,Fd,new WeakMap),tu(this,dC,new WeakSet),tu(this,Al,new Map),OA(Jn,this,e)}setActiveOverlay(e){return OA(fn,this,e),pt(hC,this).setActiveOverlay(pt(fn,this)),pt(Fd,this).has(pt(fn,this))||pt(Fd,this).set(pt(fn,this),new Set),this}getFocusSelection(){return pt(Jn,this)!==null?pt(Jn,this).getFocus():null}getAreaSelection(){return pt(Jn,this)!==null?pt(Jn,this).createLayeredArea():null}getBorderInstance(e){if(!e.settings.border)return null;if(pt(Al,this).has(e)){const n=pt(Al,this).get(e);if(n.has(pt(fn,this)))return n.get(pt(fn,this));const i=new IA(pt(fn,this),e.settings);return n.set(pt(fn,this),i),i}const r=new IA(pt(fn,this),e.settings);return pt(Al,this).set(e,new Map([[pt(fn,this),r]])),r}getBorderInstances(e){var r,n;return Array.from((r=(n=pt(Al,this).get(e))===null||n===void 0?void 0:n.values())!==null&&r!==void 0?r:[])}destroyBorders(e){pt(Al,this).get(e).forEach(r=>r.destroy()),pt(Al,this).delete(e)}render(e){if(pt(Jn,this)===null)return;e&&Qy(PA,this,Tre).call(this);const r=Array.from(pt(Jn,this)),n=new Map,i=new Map;for(let s=0;s<r.length;s++){const o=r[s],{className:a,headerAttributes:l,createLayers:c,selectionType:u}=o.settings;pt(dC,this).has(o)||(pt(dC,this).add(o),o.addLocalHook("destroy",()=>this.destroyBorders(o)));const h=this.getBorderInstance(o);if(o.isEmpty()){h?.disappear();continue}a&&pt(hC,this).setActiveSelection(o).scan().forEach(g=>{if(n.has(g)){const m=n.get(g);m.has(a)&&c===!0?m.set(a,m.get(a)+1):m.set(a,1)}else n.set(g,new Map([[a,1]]));l&&(i.has(g)||i.set(g,[]),g.nodeName==="TH"&&i.get(g).push(...l))});const d=o.getCorners();pt(fn,this).getSetting("onBeforeDrawBorders",d,u),h?.appear(d)}n.forEach((s,o)=>{var a;const l=Array.from(s).map(c=>{let[u,h]=c;return h===1?u:[u,...Array.from({length:h-1},(d,f)=>`${u}-${f+1}`)]}).flat();l.forEach(c=>pt(Fd,this).get(pt(fn,this)).add(c)),Re(o,l),o.nodeName==="TD"&&Array.isArray((a=pt(Jn,this).options)===null||a===void 0?void 0:a.cellAttributes)&&Xe(o,pt(Jn,this).options.cellAttributes)}),Array.from(i.keys()).forEach(s=>{Xe(s,[...i.get(s)])})}}function Tre(){const t=pt(Fd,this).get(pt(fn,this)),e=pt(fn,this).wtSettings.getSetting("onBeforeRemoveCellClassNames");if(Array.isArray(e))for(let r=0;r<e.length;r++)t.add(e[r]);t.forEach(r=>{var n,i;const s=pt(fn,this).wtTable.TABLE.querySelectorAll(`.${r}`);let o=[];Array.isArray((n=pt(Jn,this).options)===null||n===void 0?void 0:n.cellAttributes)&&(o=pt(Jn,this).options.cellAttributes.map(a=>a[0])),Array.isArray((i=pt(Jn,this).options)===null||i===void 0?void 0:i.headerAttributes)&&(o=[...o,...pt(Jn,this).options.headerAttributes.map(a=>a[0])]);for(let a=0,l=s.length;a<l;a++)rt(s[a],r),vh(s[a],o)}),t.clear()}class _re extends wg{constructor(e,r,n,i){super(e,r,Tc,n,i)}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new Ky(...r)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wtTable:e}=this.wot;if(!this.needFullRender||!this.shouldBeRendered()||!e.holder.parentNode)return!1;const{rootWindow:r}=this.domBindings,n=this.clone.wtTable.holder.parentNode,i=this.wtSettings.getSetting("preventOverflow");let s=0;this.trimmingContainer===r&&(!i||i!=="horizontal")?(s=this.getOverlayOffset()*(this.isRtl()?-1:1),My(n,`${s}px`,"0px")):(s=this.getScrollPosition(),Tw(n));const o=this.adjustHeaderBordersPosition(s);return this.adjustElementsSize(),o}setScrollPosition(e){const{rootWindow:r}=this.domBindings;let n=!1;return this.isRtl()&&(e=-e),this.mainTableScrollableElement===r&&r.scrollX!==e?(r.scrollTo(e,Uk(r)),n=!0):this.mainTableScrollableElement.scrollLeft!==e&&(this.mainTableScrollableElement.scrollLeft=e,n=!0),n}onScroll(){this.wtSettings.getSetting("onScrollVertically")}sumCellSizes(e,r){const n=this.wtSettings.getSetting("defaultColumnWidth");let i=e,s=0;for(;i<r;)s+=this.wot.wtTable.getStretchedColumnWidth(i)||n,i+=1;return s}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e}=this.wot,{rootDocument:r,rootWindow:n}=this.domBindings,i=Qr(r),o=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==n||a==="vertical"){let c=this.wot.wtViewport.getWorkspaceHeight();this.wot.wtOverlays.hasScrollbarBottom&&(c-=i),c=Math.min(c,e.wtRootElement.scrollHeight),o.height=`${c}px`}else o.height="";this.clone.wtTable.holder.style.height=o.height;const l=Bt(this.clone.wtTable.TABLE);o.width=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,r=this.wot.selectionManager.getFocusSelection()?parseInt(Jy.width,10)/2:0;this.clone.wtTable.hider.style.height=this.hider.style.height,e.style.height=e.parentNode.style.height,e.style.width=`${parseInt(e.parentNode.style.width,10)+r}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalColumns"),r=this.isRtl()?"right":"left";if(typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number")this.spreader.style[r]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style[r]="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,r){const{wtSettings:n}=this,i=n.getSetting("rowHeaders"),s=n.getSetting("fixedColumnsStart"),a=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder,l=s===0&&i.length>0&&!Ze(a.parentNode,"innerBorderInlineStart")?1:0;let c=this.getTableParentOffset(),u=0;if(r){const h=this.wot.wtTable.getColumnWidth(e),d=this.wot.wtViewport.getViewportWidth();h>d&&(r=!1)}return r&&a.offsetWidth!==a.clientWidth&&(u=Qr(this.domBindings.rootDocument)),r?(c+=this.sumCellSizes(0,e+1),c-=this.wot.wtViewport.getViewportWidth(),c+=l):c+=this.sumCellSizes(this.wtSettings.getSetting("fixedColumnsStart"),e),c+=u,eJ(this.mainTableScrollableElement)===c-l&&l>0&&this.wot.wtOverlays.expandHiderHorizontallyBy(l),this.setScrollPosition(c)}getTableParentOffset(){const e=this.wtSettings.getSetting("preventOverflow");let r=0;return!e&&this.trimmingContainer===this.domBindings.rootWindow&&(r=this.wot.wtTable.holderOffset.left),r}getScrollPosition(){return Math.abs(Yk(this.mainTableScrollableElement,this.domBindings.rootWindow))}getOverlayOffset(){const{rootWindow:e}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow");let n=0;if(this.trimmingContainer===e&&(!r||r!=="horizontal")){this.isRtl()?n=Math.abs(Math.min(this.getTableParentOffset()-this.getScrollPosition(),0)):n=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0);const i=this.wot.wtTable.getTotalWidth(),s=this.clone.wtTable.getTotalWidth(),o=i-s;n>o&&(n=0)}return n}adjustHeaderBordersPosition(e){const{wtSettings:r}=this,n=this.wot.wtTable.holder.parentNode,i=r.getSetting("rowHeaders"),s=r.getSetting("fixedColumnsStart"),o=r.getSetting("totalRows"),a=r.getSetting("preventOverflow")==="vertical";o?rt(n,"emptyRows"):Re(n,"emptyRows");let l=!1;if(!a){if(s&&!i.length)Re(n,"innerBorderLeft innerBorderInlineStart");else if(!s&&i.length){const c=Ze(n,"innerBorderInlineStart");e?(Re(n,"innerBorderLeft innerBorderInlineStart"),l=!c):(rt(n,"innerBorderLeft innerBorderInlineStart"),l=c)}}return l}}const Are="stickyRowsTop",eb={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}};ma(eb,"MIXIN_NAME",Are,{writable:!1,enumerable:!1});class tb extends Sh{constructor(e,r,n,i){super(e,r,n,i,_c)}}zt(tb,eb);zt(tb,Iw);function DA(t,e,r){return e=Mre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mre(t){var e=Ire(t,"string");return typeof e=="symbol"?e:e+""}function Ire(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Ore extends wg{constructor(e,r,n,i,s,o){super(e,r,_c,n,i),DA(this,"topOverlay",void 0),DA(this,"inlineStartOverlay",void 0),this.topOverlay=s,this.inlineStartOverlay=o}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new tb(...r)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){if(this.updateTrimmingContainer(),!this.wot.wtTable.holder.parentNode)return!1;const e=this.clone.wtTable.holder.parentNode;if(this.trimmingContainer===this.domBindings.rootWindow){const i=this.inlineStartOverlay.getOverlayOffset()*(this.isRtl()?-1:1),s=this.topOverlay.getOverlayOffset();My(e,`${i}px`,`${s}px`)}else Tw(e);let r=pr(this.clone.wtTable.TABLE);const n=Bt(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(r=0),e.style.height=`${r}px`,e.style.width=`${n}px`,!1}}class rb extends Sh{constructor(e,r,n,i){super(e,r,n,i,Rc)}}zt(rb,eb);zt(rb,Ow);function Pre(t,e,r){return e=Dre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Dre(t){var e=kre(t,"string");return typeof e=="symbol"?e:e+""}function kre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Nre extends wg{constructor(e,r,n,i){super(e,r,Rc,n,i),Pre(this,"cachedFixedRowsTop",-1),this.cachedFixedRowsTop=this.wtSettings.getSetting("fixedRowsTop")}createTable(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return new rb(...r)}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:r}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let i=0,s=!1;if(this.trimmingContainer===r&&(!n||n!=="vertical")){const{wtTable:a}=this.wot,l=a.hider.getBoundingClientRect(),c=Math.ceil(l.bottom),u=e.offsetHeight;s=c===u,i=this.getOverlayOffset(),My(e,"0px",`${i}px`)}else i=this.getScrollPosition(),Tw(e);const o=this.adjustHeaderBordersPosition(i,s);return this.adjustElementsSize(),o}setScrollPosition(e){const r=this.domBindings.rootWindow;let n=!1;return this.mainTableScrollableElement===r&&r.scrollY!==e?(r.scrollTo(_y(r),e),n=!0):this.mainTableScrollableElement.scrollTop!==e&&(this.mainTableScrollableElement.scrollTop=e,n=!0),n}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,r){const n=this.wtSettings.getSetting("defaultRowHeight");let i=e,s=0;for(;i<r;){const o=this.wot.wtTable.getRowHeight(i);s+=o===void 0?n:o,i+=1}return s}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e}=this.wot,{rootDocument:r,rootWindow:n}=this.domBindings,i=Qr(r),o=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==n||a==="horizontal"){let c=this.wot.wtViewport.getWorkspaceWidth();this.wot.wtOverlays.hasScrollbarRight&&(c-=i),c=Math.min(c,e.wtRootElement.scrollWidth),o.width=`${c}px`}else o.width="";this.clone.wtTable.holder.style.width=o.width;let l=pr(this.clone.wtTable.TABLE);this.wot.wtTable.hasDefinedSize()||(l=0),o.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,r=this.wot.selectionManager.getFocusSelection()?parseInt(Jy.height,10)/2:0;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=`${parseInt(e.parentNode.style.height,10)+r}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");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:r}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?r.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:r.style[e]=""}scrollTo(e,r){const{wot:n,wtSettings:i}=this,o=(n.cloneSource?n.cloneSource:n).wtTable.holder,a=i.getSetting("columnHeaders"),c=i.getSetting("fixedRowsTop")===0&&a.length>0&&!Ze(o.parentNode,"innerBorderTop")?1:0;let u=this.getTableParentOffset(),h=0;if(r){const d=this.wot.wtTable.getRowHeight(e),f=this.wot.wtViewport.getViewportHeight();d>f&&(r=!1)}if(r&&o.offsetHeight!==o.clientHeight&&(h=Qr(this.domBindings.rootDocument)),r){const d=i.getSetting("fixedRowsBottom"),f=i.getSetting("totalRows");u+=this.sumCellSizes(0,e+1),u-=n.wtViewport.getViewportHeight()-this.sumCellSizes(f-d,f),u+=1,u+=c}else u+=this.sumCellSizes(i.getSetting("fixedRowsTop"),e);return u+=h,QZ(this.mainTableScrollableElement)===u-c&&c>0&&this.wot.wtOverlays.expandHiderVerticallyBy(c),this.setScrollPosition(u)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return Ay(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow");let n=0;if(this.trimmingContainer===e&&(!r||r!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),s=this.clone.wtTable.getTotalHeight(),o=i-s;n=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0),n>o&&(n=0)}return n}adjustHeaderBordersPosition(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{wtSettings:n}=this,i=this.wot.wtTable.holder.parentNode,s=n.getSetting("totalColumns"),o=n.getSetting("preventOverflow")==="horizontal";s?rt(i,"emptyColumns"):Re(i,"emptyColumns");let a=!1;if(!r&&!o){const l=n.getSetting("fixedRowsTop"),c=this.cachedFixedRowsTop!==l,u=n.getSetting("columnHeaders");if((c||l===0)&&u.length>0){const h=Ze(i,"innerBorderTop");this.cachedFixedRowsTop=n.getSetting("fixedRowsTop"),e||n.getSetting("totalRows")===0?(Re(i,"innerBorderTop"),a=!h):(rt(i,"innerBorderTop"),a=h)}}return a}}function kA(t,e,r){Hre(t,e),e.set(t,r)}function Hre(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Oo(t,e,r){return e=Fre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fre(t){var e=Lre(t,"string");return typeof e=="symbol"?e:e+""}function Lre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fC(t,e,r){return t.set(NN(t,e),r),r}function zh(t,e){return t.get(NN(t,e))}function NN(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var ru=new WeakMap,v0=new WeakMap;class $re{constructor(e,r,n,i,s,o){Oo(this,"wot",null),kA(this,ru,[]),Oo(this,"topOverlay",null),Oo(this,"bottomOverlay",null),Oo(this,"inlineStartOverlay",null),Oo(this,"topInlineStartCornerOverlay",null),Oo(this,"bottomInlineStartCornerOverlay",null),Oo(this,"browserLineHeight",void 0),Oo(this,"wtSettings",null),kA(this,v0,!1),Oo(this,"resizeObserver",new ResizeObserver(u=>{Dy(()=>{!Array.isArray(u)||!u.length||this.wtSettings.getSetting("onContainerElementResize")})})),this.wot=e,this.wtSettings=i,this.domBindings=n,this.facadeGetter=r,this.wtTable=o;const{rootDocument:a,rootWindow:l}=this.domBindings;this.instance=this.wot,this.eventManager=s,this.scrollbarSize=Qr(a);const c=l.getComputedStyle(o.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden";this.scrollableElement=c?o.holder:vp(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 r=[...zh(ru,this)];return e&&r.push(this.wtTable),r}initBrowserLineHeight(){const{rootWindow:e,rootDocument:r}=this.domBindings,n=e.getComputedStyle(r.body),i=parseInt(n.lineHeight,10),s=parseInt(n.fontSize,10)*1.2;this.browserLineHeight=i||s}initOverlays(){const e=[this.wot,this.facadeGetter,this.wtSettings,this.domBindings];this.topOverlay=new Nre(...e),this.bottomOverlay=new gre(...e),this.inlineStartOverlay=new _re(...e),this.topInlineStartCornerOverlay=new Ore(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new cre(...e,this.bottomOverlay,this.inlineStartOverlay),fC(ru,this,[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay])}beforeDraw(){fC(v0,this,zh(ru,this).reduce((e,r)=>r.hasRenderingStateChanged()||e,!1)),zh(ru,this).forEach(e=>e.updateStateOfRendering("before"))}afterDraw(){this.syncScrollWithMaster(),zh(ru,this).forEach(e=>{const r=e.hasRenderingStateChanged();e.updateStateOfRendering("after"),r&&!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:r}=this.domBindings,{mainTableScrollableElement:n}=this.topOverlay,{mainTableScrollableElement:i}=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(n,"scroll",h=>this.onTableScroll(h),{passive:!0}),n!==i&&this.eventManager.addEventListener(i,"scroll",h=>this.onTableScroll(h),{passive:!0});const s=r.devicePixelRatio&&r.devicePixelRatio>1,o=this.scrollableElement===r,a=this.wtSettings.getSetting("preventWheel"),l={passive:o};(a||s||!nN())&&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",f=>this.onCloneWheel(f,a),l)}});let u;this.eventManager.addEventListener(r,"resize",()=>{clearTimeout(u),u=setTimeout(()=>{this.wtSettings.getSetting("onWindowResize")},200)}),o||this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement)}deregisterListeners(){this.eventManager.clearEvents(!0)}onTableScroll(e){const r=this.domBindings.rootWindow,n=this.inlineStartOverlay.mainTableScrollableElement,i=this.topOverlay.mainTableScrollableElement,s=e.target;this.keyPressed&&(i!==r&&s!==r&&!e.target.contains(i)||n!==r&&s!==r&&!e.target.contains(n))||this.syncScrollPositions(e)}onCloneWheel(e,r){const{rootWindow:n}=this.domBindings,i=this.inlineStartOverlay.mainTableScrollableElement,s=this.topOverlay.mainTableScrollableElement,o=e.target,a=s!==n&&o!==n&&!o.contains(s),l=i!==n&&o!==n&&!o.contains(i);if(this.keyPressed&&(a||l))return;const c=this.translateMouseWheelToScroll(e);(r||this.scrollableElement!==n&&c)&&e.preventDefault()}onKeyDown(e){this.keyPressed=fg(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")}onKeyUp(){this.keyPressed=!1}translateMouseWheelToScroll(e){let r=isNaN(e.deltaY)?-1*e.wheelDeltaY:e.deltaY,n=isNaN(e.deltaX)?-1*e.wheelDeltaX:e.deltaX;e.deltaMode===1&&(n+=n*this.browserLineHeight,r+=r*this.browserLineHeight);const i=this.scrollVertically(r),s=this.scrollHorizontally(n);return i||s}scrollVertically(e){const r=this.scrollableElement.scrollTop;return this.scrollableElement.scrollTop+=e,r!==this.scrollableElement.scrollTop}scrollHorizontally(e){const r=this.scrollableElement.scrollLeft;return this.scrollableElement.scrollLeft+=e,r!==this.scrollableElement.scrollLeft}syncScrollPositions(){if(this.destroyed)return;const{rootWindow:e}=this.domBindings,r=this.topOverlay.clone.wtTable.holder,n=this.inlineStartOverlay.clone.wtTable.holder,[i,s]=[this.scrollableElement.scrollLeft,this.scrollableElement.scrollTop];if(this.horizontalScrolling=r.scrollLeft!==i||this.lastScrollX!==e.scrollX,this.verticalScrolling=n.scrollTop!==s||this.lastScrollY!==e.scrollY,this.lastScrollX=e.scrollX,this.lastScrollY=e.scrollY,this.horizontalScrolling){r.scrollLeft=i;const o=this.bottomOverlay.needFullRender?this.bottomOverlay.clone.wtTable.holder:null;o&&(o.scrollLeft=i)}this.verticalScrolling&&(n.scrollTop=s),this.refreshAll()}syncScrollWithMaster(){if(!zh(v0,this))return;const e=this.topOverlay.mainTableScrollableElement,{scrollLeft:r,scrollTop:n}=e;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=r),this.bottomOverlay.needFullRender&&(this.bottomOverlay.clone.wtTable.holder.scrollLeft=r),this.inlineStartOverlay.needFullRender&&(this.inlineStartOverlay.clone.wtTable.holder.scrollTop=n),fC(v0,this,!1)}updateMainScrollableElements(){this.deregisterListeners(),this.inlineStartOverlay.updateMainScrollableElement(),this.topOverlay.updateMainScrollableElement(),this.bottomOverlay.needFullRender&&this.bottomOverlay.updateMainScrollableElement();const{wtTable:e}=this,{rootWindow:r}=this.domBindings;r.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.scrollableElement=e.holder:this.scrollableElement=vp(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,r=e.clientWidth,n=e.clientHeight,i=r!==this.spreaderLastSize.width||n!==this.spreaderLastSize.height;return i&&(this.spreaderLastSize.width=r,this.spreaderLastSize.height=n),i}adjustElementsSize(){const{wtViewport:e}=this.wot,{wtTable:r}=this,{rootWindow:n}=this.domBindings,i=this.scrollableElement===n,s=this.wtSettings.getSetting("totalColumns"),o=this.wtSettings.getSetting("totalRows"),a=e.getRowHeaderWidth(),c=e.getColumnHeaderHeight()+this.topOverlay.sumCellSizes(0,o)+1,u=a+this.inlineStartOverlay.sumCellSizes(0,s),d=r.hider.style,f=()=>i?!1:this.scrollableElement.scrollTop>Math.max(0,c-r.holder.clientHeight),g=()=>i?!1:this.scrollableElement.scrollLeft>Math.max(0,u-r.holder.clientWidth),m=f()?1:0,p=g()?1:0;if(d.width=`${u+p}px`,d.height=`${c+m}px`,this.scrollbarSize>0){const{scrollHeight:S,scrollWidth:y}=r.wtRootElement,{scrollHeight:C,scrollWidth:E}=r.holder;this.hasScrollbarRight=S<C,this.hasScrollbarBottom=y<E,this.hasScrollbarRight&&r.hider.scrollWidth+this.scrollbarSize>y?this.hasScrollbarBottom=!0:this.hasScrollbarBottom&&r.hider.scrollHeight+this.scrollbarSize>S&&(this.hasScrollbarRight=!0)}this.topOverlay.adjustElementsSize(),this.inlineStartOverlay.adjustElementsSize(),this.bottomOverlay.adjustElementsSize()}expandHiderVerticallyBy(e){const{wtTable:r}=this;r.hider.style.height=`${parseInt(r.hider.style.height,10)+e}px`}expandHiderHorizontallyBy(e){const{wtTable:r}=this;r.hider.style.width=`${parseInt(r.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 r=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];let n=null;return j(r,i=>{i&&i.clone&&i.clone.wtTable.TABLE.contains(e)&&(n=i.clone)}),n}syncOverlayTableClassNames(){const e=this.wtTable.TABLE,r=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];j(r,n=>{n&&(n.clone.wtTable.TABLE.className=e.className)})}}function NA(t,e,r){return e=Bre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bre(t){var e=Vre(t,"string");return typeof e=="symbol"?e:e+""}function Vre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Wre{constructor(e){NA(this,"settings",{}),NA(this,"defaults",Object.freeze(this.getDefaults())),dt(this.defaults,(r,n)=>{if(e[n]!==void 0)this.settings[n]=e[n];else{if(r===void 0)throw new Error(`A required setting "${n}" was not provided`);this.settings[n]=r}})}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,r,n)=>{const i=this.getSetting("data",e,r);xc(n,i??"")},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,r){return r===void 0?dt(e,(n,i)=>{this.settings[i]=n}):this.settings[e]=r,this}getSetting(e,r,n,i,s){return typeof this.settings[e]=="function"?this.settings[e](r,n,i,s):r!==void 0&&Array.isArray(this.settings[e])?this.settings[e][r]:this.settings[e]}getSettingPure(e){return this.settings[e]}has(e){return!!this.settings[e]}}class nb extends Sh{constructor(e,r,n,i){super(e,r,n,i,"master")}alignOverlaysWithTrimmingContainer(){const e=oh(this.wtRootElement),{rootWindow:r}=this.domBindings;if(e===r)this.wtSettings.getSetting("preventOverflow")||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible");else{const n=e.parentElement,i=Nf(e,"height",r),s=Nf(e,"overflow",r),o=this.holder.style,{scrollWidth:a,scrollHeight:l}=e;let c=e.offsetWidth,u=e.offsetHeight;if(n&&["auto","hidden","scroll"].includes(s)){const d=e.cloneNode(!1);d.style.overflow="auto",d.style.position="absolute",e.nextElementSibling?n.insertBefore(d,e.nextElementSibling):n.appendChild(d);const f=parseInt(hl(d,r).height,10);n.removeChild(d),f===0&&(u=0)}u=Math.min(u,l),o.height=i==="auto"?"auto":`${u}px`,c=Math.min(c,a),o.width=`${c}px`,o.overflow="",this.hasTableHeight=o.height==="auto"?!0:u>0,this.hasTableWidth=c>0}this.isTableVisible=yc(this.TABLE)}markOversizedColumnHeaders(){const{wtSettings:e}=this,{wtViewport:r}=this.dataAccessObject,n="master",s=e.getSetting("columnHeaders").length;if(s&&!r.hasOversizedColumnHeadersMarked[n]){const a=e.getSetting("rowHeaders").length,l=this.getRenderedColumnsCount();for(let c=0;c<s;c++)for(let u=-1*a;u<l;u++)this.markIfOversizedColumnHeader(u);r.hasOversizedColumnHeadersMarked[n]=!0}}}zt(nb,jy);zt(nb,Ow);class Ure{constructor(e,r,n,i,s){this.dataAccessObject=e,this.wot=e.wot,this.instance=this.wot,this.domBindings=r,this.wtSettings=n,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=i,this.eventManager.addEventListener(this.domBindings.rootWindow,"resize",()=>{this.clientHeight=this.getWorkspaceHeight()})}getWorkspaceHeight(){const e=this.domBindings.rootDocument,r=this.dataAccessObject.topOverlayTrimmingContainer;let n=0;return r===this.domBindings.rootWindow?n=e.documentElement.clientHeight:n=pr(r)>0&&r.clientHeight>0?r.clientHeight:1/0,n}getWorkspaceWidth(){const{wtSettings:e}=this,{rootDocument:r,rootWindow:n}=this.domBindings,i=this.dataAccessObject.inlineStartOverlayTrimmingContainer,s=r.documentElement.offsetWidth,o=e.getSetting("totalColumns"),a=e.getSetting("preventOverflow"),l=e.getSetting("rtlMode"),c=this.wtTable.TABLE.getBoundingClientRect(),u=l?c.right-s:c.left,h=s-u;let d,f;if(a)return Bt(this.wtTable.wtRootElement);if(e.getSetting("freezeOverlays")?d=Math.min(h,s):d=Math.min(this.getContainerFillWidth(),h,s),i===n&&o>0&&this.sumColumnWidths(0,o-1)>d)return r.documentElement.clientWidth;if(i!==n&&(f=Nf(this.dataAccessObject.inlineStartOverlayTrimmingContainer,"overflow",n),f==="scroll"||f==="hidden"||f==="auto"))return Math.max(d,i.clientWidth);const g=e.getSetting("stretchH");return g==="none"||!g?Math.max(d,Bt(this.wtTable.TABLE)):d}hasVerticalScroll(){return this.wtTable.hider.offsetHeight>this.getWorkspaceHeight()}hasHorizontalScroll(){return this.wtTable.hider.offsetWidth>this.getWorkspaceWidth()}sumColumnWidths(e,r){let n=0,i=e;for(;i<r;)n+=this.wtTable.getColumnWidth(i),i+=1;return n}getContainerFillWidth(){if(this.containerWidth)return this.containerWidth;const e=this.wtTable.holder,r=this.domBindings.rootDocument.createElement("div");r.style.width="100%",r.style.height="1px",e.appendChild(r);const n=r.offsetWidth;return this.containerWidth=n,e.removeChild(r),n}getWorkspaceOffset(){return Zr(this.wtTable.TABLE)}getColumnHeaderHeight(){return this.wtSettings.getSetting("columnHeaders").length?isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=pr(this.wtTable.THEAD)):this.columnHeaderHeight=0,this.columnHeaderHeight}getViewportHeight(){let e=this.getWorkspaceHeight();if(e===1/0)return e;const r=this.getColumnHeaderHeight();return r>0&&(e-=r),e}getRowHeaderWidth(){const e=this.wtSettings.getSetting("rowHeaderWidth"),r=this.wtSettings.getSetting("rowHeaders");if(e){this.rowHeaderWidth=0;for(let n=0,i=r.length;n<i;n++)this.rowHeaderWidth+=e[n]||e}if(isNaN(this.rowHeaderWidth))if(r.length){let n=this.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(let i=0,s=r.length;i<s;i++)n?(this.rowHeaderWidth+=Bt(n),n=n.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 r=this.getRowHeaderWidth();return r>0?e-r:e}createRowsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:La;const{wtSettings:r,wtTable:n}=this;if(r.getSetting("renderAllRows")&&e===La)return new Tee({totalRows:r.getSetting("totalRows")});let i=this.getViewportHeight(),s,o;this.rowHeaderWidth=NaN;let a=this.dataAccessObject.topScrollPosition-this.dataAccessObject.topParentOffset;const l=r.getSetting("fixedRowsTop"),c=r.getSetting("fixedRowsBottom"),u=r.getSetting("totalRows");return l&&a>=0&&(o=this.dataAccessObject.topOverlay.sumCellSizes(0,l),a+=o,i-=o),c&&this.dataAccessObject.bottomOverlay.clone&&(o=this.dataAccessObject.bottomOverlay.sumCellSizes(u-c,u),i-=o),n.holder.clientHeight===n.holder.offsetHeight?s=0:s=Qr(this.domBindings.rootDocument),new Mw({viewportHeight:i,scrollOffset:a,totalRows:r.getSetting("totalRows"),rowHeightFn:h=>n.getRowHeight(h),overrideFn:r.getSettingPure("viewportRowCalculatorOverride"),calculationType:e,horizontalScrollbarHeight:s})}createColumnsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:La;const{wtSettings:r,wtTable:n}=this;if(r.getSetting("renderAllColumns")&&e===La)return new bee({totalColumns:r.getSetting("totalColumns")});let i=this.getViewportWidth(),s=Math.abs(this.dataAccessObject.inlineStartScrollPosition)-this.dataAccessObject.inlineStartParentOffset;this.columnHeaderHeight=NaN;const o=r.getSetting("fixedColumnsStart");if(o&&s>=0){const a=this.dataAccessObject.inlineStartOverlay.sumCellSizes(0,o);s+=a,i-=a}return n.holder.clientWidth!==n.holder.offsetWidth&&(i-=Qr(this.domBindings.rootDocument)),new gg({viewportWidth:i,scrollOffset:s,totalColumns:r.getSetting("totalColumns"),columnWidthFn:a=>n.getColumnWidth(a),overrideFn:r.getSettingPure("viewportColumnCalculatorOverride"),calculationType:e,inlineStartOffset:this.dataAccessObject.inlineStartParentOffset})}createRenderCalculators(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:r}=this;if(e&&!r.getSetting("renderAllRows")){const n=this.createRowsCalculator(mn);e=this.areAllProposedVisibleRowsAlreadyRendered(n)}if(e&&!r.getSetting("renderAllColumns")){const n=this.createColumnsCalculator(mn);e=this.areAllProposedVisibleColumnsAlreadyRendered(n)}return e||(this.rowsRenderCalculator=this.createRowsCalculator(La),this.columnsRenderCalculator=this.createColumnsCalculator(La)),this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,e}createVisibleCalculators(){this.rowsVisibleCalculator=this.createRowsCalculator(mn),this.columnsVisibleCalculator=this.createColumnsCalculator(mn)}createPartiallyVisibleCalculators(){this.rowsPartiallyVisibleCalculator=this.createRowsCalculator(pA),this.columnsPartiallyVisibleCalculator=this.createColumnsCalculator(pA)}areAllProposedVisibleRowsAlreadyRendered(e){if(!this.rowsVisibleCalculator)return!1;let{startRow:r,endRow:n}=e;if(r===null&&n===null){if(!e.isVisibleInTrimmingContainer)return!0;r=this.rowsPartiallyVisibleCalculator.startRow,n=this.rowsPartiallyVisibleCalculator.endRow}const{startRow:i,endRow:s}=this.rowsRenderCalculator;return r<i||r===i&&r>0?!1:!(n>s||n===s&&n<this.wtSettings.getSetting("totalRows")-1)}areAllProposedVisibleColumnsAlreadyRendered(e){if(!this.columnsVisibleCalculator)return!1;let{startColumn:r,endColumn:n}=e;if(r===null&&n===null){if(!e.isVisibleInTrimmingContainer)return!0;r=this.columnsPartiallyVisibleCalculator.startColumn,n=this.columnsPartiallyVisibleCalculator.endColumn}const{startColumn:i,endColumn:s}=this.columnsRenderCalculator;return r<i||r===i&&r>0?!1:!(n>s||n===s&&n<this.wtSettings.getSetting("totalColumns")-1)}resetHasOversizedColumnHeadersMarked(){dt(this.hasOversizedColumnHeadersMarked,(e,r,n)=>{n[r]=void 0})}}class Yre extends zy{constructor(e,r){super(e,new Wre(r));const n=this.wtSettings.getSetting("facade",this);this.wtTable=new nb(this.getTableDao(),n,this.domBindings,this.wtSettings),this.wtViewport=new Ure(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new Rre(this.wtSettings.getSetting("selections")),this.wtEvent=new _N(n,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new $re(this,n,this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.exportSettingsAsClassNames(),this.findOriginalHeaders()}exportSettingsAsClassNames(){const e={rowHeaders:"htRowHeaders",columnHeaders:"htColumnHeaders"},r=[],n=[];dt(e,(i,s)=>{this.wtSettings.getSetting(s).length&&n.push(i),r.push(i)}),rt(this.wtTable.wtRootElement.parentNode,r),Re(this.wtTable.wtRootElement.parentNode,n)}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 ib{constructor(e){e instanceof zy?this._wot=e:this._initFromSettings(e)}_initFromSettings(e){e.facade=r=>{const n=new ib(r);return()=>n},this._wot=new Yre(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,r){return this._wot.createCellCoords(e,r)}createCellRange(e,r,n){return this._wot.createCellRange(e,r,n)}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this._wot.draw(e),this}getCell(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this._wot.getCell(e,r)}scrollViewport(e,r,n,i,s){return this._wot.scrollViewport(e,r,n,i,s)}scrollViewportHorizontally(e,r,n){return this._wot.scrollViewportHorizontally(e,r,n)}scrollViewportVertically(e,r,n){return this._wot.scrollViewportVertically(e,r,n)}getViewport(){return this._wot.getViewport()}getOverlayName(){return this._wot.cloneOverlay?this._wot.cloneOverlay.type:"master"}exportSettingsAsClassNames(){return this._wot.exportSettingsAsClassNames()}update(e,r){return this._wot.wtSettings.update(e,r),this}getSetting(e,r,n,i,s){return this._wot.wtSettings.getSetting(e,r,n,i,s)}hasSetting(e){return this._wot.wtSettings.hasSetting(e)}destroy(){this._wot.destroy()}}function HA(t){let{isShiftKey:e,isLeftClick:r,isRightClick:n,coords:i,selection:s,controller:o,cellCoordsFactory:a}=t;const l=s.isSelected()?s.getSelectedRange().current():null,c=s.isSelectedByCorner(),u=s.isSelectedByRowHeader();if(s.markSource("mouse"),e&&l)i.row>=0&&i.col>=0&&!o.cell?s.setRangeEnd(i):(c||u)&&i.row>=0&&i.col>=0&&!o.cell?s.setRangeEnd(a(i.row,i.col)):c&&i.row<0&&!o.column?s.setRangeEnd(a(l.to.row,i.col)):u&&i.col<0&&!o.row?s.setRangeEnd(a(i.row,l.to.col)):(!c&&!u&&i.col<0||c&&i.col<0)&&!o.row?s.selectRows(Math.max(l.from.row,0),i.row,i.col):(!c&&!u&&i.row<0||u&&i.row<0)&&!o.column&&s.selectColumns(Math.max(l.from.col,0),i.col,i.row);else{const h=!s.inInSelection(i),d=r||n&&h;i.row<0&&i.col>=0&&!o.column?d&&s.selectColumns(i.col,i.col,i.row):i.col<0&&i.row>=0&&!o.row?d&&s.selectRows(i.row,i.row,i.col):i.col>=0&&i.row>=0&&!o.cell?d&&s.setRangeStart(i):i.col<0&&i.row<0&&s.selectAll(!0,!0,{disableHeadersHighlight:!0,focusPosition:{row:0,col:0}})}s.markEndSource()}function zre(t){let{isLeftClick:e,coords:r,selection:n,controller:i,cellCoordsFactory:s}=t;if(!e)return;const o=n.isSelectedByRowHeader(),a=n.isSelectedByColumnHeader(),l=n.tableProps.countCols(),c=n.tableProps.countRows();n.markSource("mouse"),a&&!i.column?n.setRangeEnd(s(c-1,r.col)):o&&!i.row?n.setRangeEnd(s(r.row,l-1)):i.cell||n.setRangeEnd(r),n.markEndSource()}const Gre=new Map([["mousedown",HA],["mouseover",zre],["touchstart",HA]]);function FA(t,e){let{coords:r,selection:n,controller:i,cellCoordsFactory:s}=e;Gre.get(t.type)({coords:r,selection:n,controller:i,cellCoordsFactory:s,isShiftKey:t.shiftKey,isLeftClick:ky(t)||t.type==="touchstart",isRightClick:bc(t)})}const HN=new WeakMap,sb=Symbol("rootInstance");function jre(t){HN.set(t,!0)}function Kre(t){return t===sb}function km(t){return HN.has(t)}function Xre(t,e){FN(t,e),e.add(t)}function Ml(t,e,r){FN(t,e),e.set(t,r)}function FN(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ea(t,e,r){return e=qre(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qre(t){var e=Zre(t,"string");return typeof e=="symbol"?e:e+""}function Zre(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Gr(t,e){return t.get(Ff(t,e))}function Ti(t,e,r){return t.set(Ff(t,e),r),r}function Ff(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var gC=new WeakMap,C0=new WeakMap,S0=new WeakMap,Po=new WeakMap,ts=new WeakMap,mC=new WeakMap,pC=new WeakMap,Nm=new WeakSet;class Jre{constructor(e){Xre(this,Nm),Ea(this,"hot",void 0),Ea(this,"eventManager",void 0),Ea(this,"settings",void 0),Ea(this,"THEAD",void 0),Ea(this,"TBODY",void 0),Ea(this,"_wt",void 0),Ea(this,"activeWt",void 0),Ml(this,gC,0),Ml(this,C0,0),Ea(this,"postponedAdjustElementsSize",!1),Ml(this,S0,!1),Ml(this,Po,void 0),Ml(this,ts,void 0),Ml(this,mC,0),Ml(this,pC,0),this.hot=e,this.eventManager=new As(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,r){const n=this._wt.getCell(e,r);return n<0?null:n}scrollViewport(e,r,n,i,s){return this._wt.scrollViewport(e,r,n,i,s)}scrollViewportHorizontally(e,r,n){return this._wt.scrollViewportHorizontally(e,r,n)}scrollViewportVertically(e,r,n){return this._wt.scrollViewportVertically(e,r,n)}createElements(){const{rootElement:e,rootDocument:r}=this.hot,n=e.getAttribute("style");n&&e.setAttribute("data-originalstyle",n),Re(e,"handsontable"),Ti(ts,this,r.createElement("TABLE")),Re(Gr(ts,this),"htCore"),this.hot.getSettings().tableClassName&&Re(Gr(ts,this),this.hot.getSettings().tableClassName),this.settings.ariaTags&&(Xe(Gr(ts,this),[co()]),Xe(e,[RZ(),Lk(-1),Ew(this.hot.countCols()),LZ()])),this.THEAD=r.createElement("THEAD"),Gr(ts,this).appendChild(this.THEAD),this.TBODY=r.createElement("TBODY"),Gr(ts,this).appendChild(this.TBODY),this.hot.table=Gr(ts,this),this.hot.container.insertBefore(Gr(ts,this),this.hot.container.firstChild)}registerEvents(){const{rootElement:e,rootDocument:r,selection:n,rootWindow:i}=this.hot,s=r.documentElement;this.eventManager.addEventListener(e,"mousedown",a=>{Ti(S0,this,!0),this.isTextSelectionAllowed(a.target)||(U_(i),a.preventDefault(),i.focus())}),this.eventManager.addEventListener(e,"mouseup",()=>{Ti(S0,this,!1)}),this.eventManager.addEventListener(e,"mousemove",a=>{Gr(S0,this)&&!this.isTextSelectionAllowed(a.target)&&(this.settings.fragmentSelection&&U_(i),a.preventDefault())}),this.eventManager.addEventListener(s,"keyup",a=>{n.isInProgress()&&!a.shiftKey&&n.finish()}),this.eventManager.addEventListener(s,"mouseup",a=>{n.isInProgress()&&ky(a)&&n.finish(),Ti(Po,this,!1);const l=jk(r.activeElement);Pm(r.activeElement)&&!l||(l||!n.isSelected()&&!n.isSelectedByAnyHeader()&&!e.contains(a.target)&&!bc(a))&&this.hot.unlisten()}),this.eventManager.addEventListener(s,"contextmenu",a=>{n.isInProgress()&&bc(a)&&(n.finish(),Ti(Po,this,!1))}),this.eventManager.addEventListener(s,"touchend",()=>{n.isInProgress()&&n.finish(),Ti(Po,this,!1)}),this.eventManager.addEventListener(s,"mousedown",a=>{const l=a.target,c=a.x||a.clientX,u=a.y||a.clientY;let h=a.target;if(Gr(Po,this)||!e||!this.hot.view)return;const{holder:d}=this.hot.view._wt.wtTable;if(h===d){const g=Qr(r);if(r.elementFromPoint(c+g,u)!==d||r.elementFromPoint(c,u+g)!==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=sh(i);for(;o!==null;)this.eventManager.addEventListener(o.document.documentElement,"click",()=>{this.hot.unlisten()}),o=sh(o);this.eventManager.addEventListener(Gr(ts,this),"selectstart",a=>{this.settings.fragmentSelection||Pm(a.target)||a.preventDefault()})}translateFromRenderableToVisualCoords(e){let{row:r,col:n}=e;return this.hot._createCellCoords(...this.translateFromRenderableToVisualIndex(r,n))}translateFromRenderableToVisualIndex(e,r){let n=e>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(e):e,i=r>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(r):r;return n===null&&(n=e),i===null&&(i=r),[n,i]}countRenderableIndexes(e,r){const n=Math.min(e.getNotTrimmedIndexesLength(),r),i=e.getNearestNotHiddenIndex(n-1,-1);return i===null?0:e.getRenderableFromVisualIndex(i)+1}countRenderableColumns(){return this.countRenderableIndexes(this.hot.columnIndexMapper,this.settings.maxCols)}countRenderableRows(){return this.countRenderableIndexes(this.hot.rowIndexMapper,this.settings.maxRows)}countNotHiddenRowIndexes(e,r){return this.countNotHiddenIndexes(e,r,this.hot.rowIndexMapper,this.countRenderableRows())}countNotHiddenColumnIndexes(e,r){return this.countNotHiddenIndexes(e,r,this.hot.columnIndexMapper,this.countRenderableColumns())}countNotHiddenIndexes(e,r,n,i){if(isNaN(e)||e<0)return 0;const s=n.getNearestNotHiddenIndex(e,r),o=n.getRenderableFromVisualIndex(s);if(!Number.isInteger(o))return 0;let a=0;return r<0?a=o+1:r>0&&(a=i-o),a}countNotHiddenFixedColumnsStart(){const e=this.hot.countCols(),r=Math.min(parseInt(this.settings.fixedColumnsStart,10),e)-1;return this.countNotHiddenColumnIndexes(r,-1)}countNotHiddenFixedRowsTop(){const e=this.hot.countRows(),r=Math.min(parseInt(this.settings.fixedRowsTop,10),e)-1;return this.countNotHiddenRowIndexes(r,-1)}countNotHiddenFixedRowsBottom(){const e=this.hot.countRows(),r=Math.max(e-parseInt(this.settings.fixedRowsBottom,10),0);return this.countNotHiddenRowIndexes(r,1)}countRenderableColumnsInRange(e,r){let n=0;for(let i=e;i<=r;i++)this.hot.columnIndexMapper.getRenderableFromVisualIndex(i)!==null&&(n+=1);return n}countRenderableRowsInRange(e,r){let n=0;for(let i=e;i<=r;i++)this.hot.rowIndexMapper.getRenderableFromVisualIndex(i)!==null&&(n+=1);return n}isMainTableNotFullyCoveredByOverlays(){const e=this.countNotHiddenFixedRowsTop()+this.countNotHiddenFixedRowsBottom(),r=this.countNotHiddenFixedColumnsStart();return this.hot.countRenderedRows()>e&&this.hot.countRenderedCols()>r}initializeWalkontable(){const e={ariaTags:this.settings.ariaTags,rtlMode:this.hot.isRtl(),externalRowCalculator:this.hot.getPlugin("autoRowSize")&&this.hot.getPlugin("autoRowSize").isEnabled(),table:Gr(ts,this),isDataViewInstance:()=>km(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),Ti(C0,this,s.length),this.hot.getSettings().ariaTags&&Ff(Nm,this,LN).call(this)===this.hot.countCols()&&Ff(Nm,this,Qre).call(this,Gr(C0,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),Ti(gC,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,c]=this.translateFromRenderableToVisualIndex(s,o),u=this.hot.runHooks("modifyGetCellCoords",l,c);let h=l,d=c;Array.isArray(u)&&([h,d]=u);const f=this.hot.getCellMeta(h,d),g=this.hot.colToProp(d);let m=this.hot.getDataAtRowProp(h,g);this.hot.hasHook("beforeValueRender")&&(m=this.hot.runHooks("beforeValueRender",m,f)),this.hot.runHooks("beforeRenderer",a,l,c,g,m,f),this.hot.getCellRenderer(f)(this.hot,a,l,c,g,m,f),this.hot.runHooks("afterRenderer",a,l,c,g,m,f)},selections:this.hot.selection.highlight,hideBorderOnMouseDownOver:()=>this.settings.fragmentSelection,onWindowResize:()=>{this.hot&&!this.hot.isDestroyed&&this.hot.refreshDimensions()},onContainerElementResize:()=>{this.hot&&!this.hot.isDestroyed&&yc(this.hot.rootElement)&&this.hot.refreshDimensions()},onCellMouseDown:(s,o,a,l)=>{const c=this.translateFromRenderableToVisualCoords(o),u={row:!1,column:!1,cell:!1};this.hot.listen(),this.activeWt=l,Ti(Po,this,!0),this.hot.runHooks("beforeOnCellMouseDown",s,c,a,u),!sc(s)&&(FA(s,{coords:c,selection:this.hot.selection,controller:u,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseDown",s,c,a),this.activeWt=this._wt)},onCellContextMenu:(s,o,a,l)=>{const c=this.translateFromRenderableToVisualCoords(o);this.activeWt=l,Ti(Po,this,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",s,c,a),!sc(s)&&(this.hot.runHooks("afterOnCellContextMenu",s,c,a),this.activeWt=this._wt)},onCellMouseOut:(s,o,a,l)=>{const c=this.translateFromRenderableToVisualCoords(o);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOut",s,c,a),!sc(s)&&(this.hot.runHooks("afterOnCellMouseOut",s,c,a),this.activeWt=this._wt)},onCellMouseOver:(s,o,a,l)=>{const c=this.translateFromRenderableToVisualCoords(o),u={row:!1,column:!1,cell:!1};this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOver",s,c,a,u),!sc(s)&&(Gr(Po,this)&&FA(s,{coords:c,selection:this.hot.selection,controller:u,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseOver",s,c,a),this.activeWt=this._wt)},onCellMouseUp:(s,o,a,l)=>{const c=this.translateFromRenderableToVisualCoords(o);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseUp",s,c,a),!(sc(s)||this.hot.isDestroyed)&&(this.hot.runHooks("afterOnCellMouseUp",s,c,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,c=s<0;let u=s;c||(u=l.getVisualFromRenderableIndex(s));const h=this.hot.runHooks("beforeHighlightingRowHeader",u,o,a);return c?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onBeforeHighlightingColumnHeader:(s,o,a)=>{const l=this.hot.columnIndexMapper,c=s<0;let u=s;c||(u=l.getVisualFromRenderableIndex(s));const h=this.hot.runHooks("beforeHighlightingColumnHeader",u,o,a);return c?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onAfterDrawSelection:(s,o,a)=>{let l;const[c,u]=this.translateFromRenderableToVisualIndex(s,o),h=this.hot.selection.getSelectedRange();if(h.size()>0){const f=h.peekByIndex(a??0);l=[f.from.row,f.from.col,f.to.row,f.to.col]}return this.hot.runHooks("afterDrawSelection",c,u,l,a)},onBeforeDrawBorders:(s,o)=>{const[a,l,c,u]=s,h=[this.hot.rowIndexMapper.getVisualFromRenderableIndex(a),this.hot.columnIndexMapper.getVisualFromRenderableIndex(l),this.hot.rowIndexMapper.getVisualFromRenderableIndex(c),this.hot.columnIndexMapper.getVisualFromRenderableIndex(u)];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,c=this.hot.columnIndexMapper,u=o>=0?c.getVisualFromRenderableIndex(o):o,h=s>=0?l.getVisualFromRenderableIndex(s):s,d=this.hot.runHooks("modifyGetCellCoords",h,u,a);if(Array.isArray(d)){const[f,g,m,p]=d;return[f>=0?l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(f,1)):f,g>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(g,1)):g,m>=0?l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(m,-1)):m,p>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(p,-1)):p]}},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,c=s.endRow;if(typeof o=="number")s.startRow=Math.max(l-o,0),s.endRow=Math.min(c+o,a-1);else if(o==="auto"){const u=Math.ceil(c/a*12);s.startRow=Math.max(l-u,0),s.endRow=Math.min(c+u,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,c=s.endColumn;if(typeof o=="number"&&(s.startColumn=Math.max(l-o,0),s.endColumn=Math.min(c+o,a-1)),o==="auto"){const u=Math.ceil(c/a*6);s.startColumn=Math.max(l-u,0),s.endColumn=Math.min(c+u,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 ib(e),this.activeWt=this._wt;const r=this._wt.wtTable.spreader,{width:n,height:i}=this.hot.rootElement.getBoundingClientRect();this.setLastSize(n,i),this.eventManager.addEventListener(r,"mousedown",s=>{s.target===r&&s.which===3&&s.stopPropagation()}),this.eventManager.addEventListener(r,"contextmenu",s=>{s.target===r&&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(Pm(e))return!0;const r=pc(e,this.hot.view._wt.wtTable.spreader);return!!(this.settings.fragmentSelection===!0&&r||this.settings.fragmentSelection==="cell"&&this.isSelectedOnlyCell()&&r||!this.settings.fragmentSelection&&this.isCellEdited()&&this.isSelectedOnlyCell())}isMouseDown(){return Gr(Po,this)}isSelectedOnlyCell(){var e,r;return(e=(r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.isSingleCell())!==null&&e!==void 0?e:!1}isCellEdited(){const e=this.hot.getActiveEditor();return e&&e.isOpened()}beforeRender(e,r){e&&this.hot.runHooks("beforeViewRender",this.hot.forceFullRender,r)}afterRender(e){e&&this.hot.runHooks("afterViewRender",this.hot.forceFullRender)}appendRowHeader(e,r){if(r.firstChild){const n=r.firstChild;if(!Ze(n,"relative")){mo(r),this.appendRowHeader(e,r);return}this.updateCellHeader(n.querySelector(".rowHeader"),e,this.hot.getRowHeader)}else{const{rootDocument:n,getRowHeader:i}=this.hot,s=n.createElement("div"),o=n.createElement("span");s.className="relative",o.className="rowHeader",this.updateCellHeader(o,e,i),s.appendChild(o),r.appendChild(s)}this.hot.runHooks("afterGetRowHeader",e,r)}appendColHeader(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hot.getColHeader,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(r.firstChild){const s=r.firstChild;Ze(s,"relative")?this.updateCellHeader(s.querySelector(".colHeader"),e,n,i):(mo(r),this.appendColHeader(e,r,n,i))}else{const{rootDocument:s}=this.hot,o=s.createElement("div"),a=s.createElement("span");o.className="relative",a.className="colHeader",this.settings.ariaTags&&(Xe(o,...co()),Xe(a,...co())),this.updateCellHeader(a,e,n,i),o.appendChild(a),r.appendChild(o)}this.hot.runHooks("afterGetColHeader",e,r,i)}updateCellHeader(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=r;const o=this._wt.wtOverlays.getParentOverlay(e)||this._wt;e.parentNode&&(Ze(e,"colHeader")?s=o.wtTable.columnFilter.sourceToRendered(r):Ze(e,"rowHeader")&&(s=o.wtTable.rowFilter.sourceToRendered(r))),s>-1?Ch(e,n(r,i)):(xc(e," "),Re(e,"cornerHeader"))}maximumVisibleElementWidth(e){const n=this._wt.wtViewport.getWorkspaceWidth()-e;return n>0?n:0}maximumVisibleElementHeight(e){const n=this._wt.wtViewport.getWorkspaceHeight()-e;return n>0?n:0}setLastSize(e,r){Ti(mC,this,e),Ti(pC,this,r)}getLastSize(){return{width:Gr(mC,this),height:Gr(pC,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 Gr(gC,this)}getRowHeadersCount(){return Gr(C0,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 LN(){return parseInt(this.hot.rootElement.getAttribute(Ew()[0]),10)}function Qre(t){const e=Ff(Nm,this,LN).call(this)+t;Xe(this.hot.rootElement,...Ew(e))}const ene="ABCDEFGHIJKLMNOPQRSTUVWXYZ",LA=ene.length;function tne(t){let e=t+1,r="",n;for(;e>0;)n=(e-1)%LA,r=String.fromCharCode(65+n)+r,e=parseInt((e-n)/LA,10);return r}function $N(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=t;const n=[];return(!Array.isArray(t)||!Array.isArray(t[0]))&&(r=[t]),r.forEach((i,s)=>{Array.isArray(i)?i.forEach((o,a)=>{n.push([s+e,a,o])}):Object.keys(i).forEach(o=>{n.push([s+e,o,i[o]])})}),n}function BN(t){let e=0;return Array.isArray(t)&&(t[0]&&Array.isArray(t[0])?e=t[0].length:t[0]&&at(t[0])&&(e=Py(t[0]))),e}function rne(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>Array.isArray(e)))}function nne(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object"&&!Array.isArray(e)&&e!==null))}function Gh(t,e,r){return e=ine(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ine(t){var e=sne(t,"string");return typeof e=="symbol"?e:e+""}function sne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class one{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];Gh(this,"hot",void 0),Gh(this,"data",void 0),Gh(this,"dataType","array"),Gh(this,"colToProp",()=>{}),Gh(this,"propToCol",()=>{}),this.hot=e,this.data=r}modifyRowData(e){let r;return this.hot.hasHook("modifyRowData")&&(r=this.hot.runHooks("modifyRowData",e)),r!==void 0&&!Number.isInteger(r)?r: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 r=[];return j(this.data,(n,i)=>{const s=this.getAtCell(i,e);r.push(s)}),r}getAtRow(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const s=r===void 0&&n===void 0,{dataDotNotation:o}=this.hot.getSettings();let a=null,l=null;if(a=this.modifyRowData(e),Array.isArray(a))l=[],s?a.forEach((c,u)=>{l[u]=this.getAtPhysicalCell(e,u,a)}):Ue(r,n,c=>{l[c-r]=this.getAtPhysicalCell(e,c,a)});else if(at(a)||Xt(a))if(i?l=[]:l={},!s||i){const u=this.countFirstRowKeys()-1;Ue(0,u,h=>{const d=this.colToProp(h);if(h>=(r||0)&&h<=(n||u)&&!Number.isInteger(d)){const f=this.getAtPhysicalCell(e,d,a);i?l.push(f):o?jv(l,d,f):l[d]=f}})}else dt(a,(c,u)=>{const h=this.getAtPhysicalCell(e,u,a);o?jv(l,u,h):l[u]=h});return l}setAtCell(e,r,n){if(!(e>=this.countRows()||r>=this.countFirstRowKeys())){if(this.hot.hasHook("modifySourceData")){const i=Ss(n);this.hot.runHooks("modifySourceData",e,r,i,"set"),i.isTouched()&&(n=i.value)}Number.isInteger(r)?this.data[e][r]=n:jv(this.data[e],r,n)}}getAtPhysicalCell(e,r,n){let i=null;if(n)if(typeof r=="string"){const{dataDotNotation:s}=this.hot.getSettings();i=s?bJ(n,r):n[r]}else typeof r=="function"?i=r(n):i=n[r];if(this.hot.hasHook("modifySourceData")){const s=Ss(i);this.hot.runHooks("modifySourceData",e,r,s,"get"),s.isTouched()&&(i=s.value)}return i}getAtCell(e,r){const n=this.modifyRowData(e);return this.getAtPhysicalCell(e,this.colToProp(r),n)}getByRange(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=!1,s=null,o=null,a=null,l=null;e===null||r===null?(i=!0,s=0,a=this.countRows()-1):(s=Math.min(e.row,r.row),o=Math.min(e.col,r.col),a=Math.max(e.row,r.row),l=Math.max(e.col,r.col));const c=[];return Ue(s,a,u=>{c.push(i?this.getAtRow(u,void 0,void 0,n):this.getAtRow(u,o,l,n))}),c}countRows(){if(this.hot.hasHook("modifySourceLength")){const e=this.hot.runHooks("modifySourceLength");if(Number.isInteger(e))return e}return this.data.length}countFirstRowKeys(){return BN(this.data)}destroy(){this.data=null,this.hot=null}}function $A(t,e,r){return e=ane(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ane(t){var e=lne(t,"string");return typeof e=="symbol"?e:e+""}function lne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Uc{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;$A(this,"indexedValues",[]),$A(this,"initValueOrFn",void 0),this.initValueOrFn=e}getValues(){return this.indexedValues}getValueAtIndex(e){const r=this.indexedValues;if(e<r.length)return r[e]}setValues(e){this.indexedValues=e.slice(),this.runLocalHooks("change")}setValueAtIndex(e,r){return e<this.indexedValues.length?(this.indexedValues[e]=r,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,Xt(this.initValueOrFn)?Ue(e-1,r=>this.indexedValues.push(this.initValueOrFn(r))):Ue(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}}zt(Uc,Wn);function ob(t,e,r,n){const i=r.length?r[0]:void 0;return[...t.slice(0,i),...r.map((s,o)=>Xt(n)?n(s,o):n),...i===void 0?[]:t.slice(i)]}function ab(t,e){return Rs(t,(r,n)=>e.includes(n)===!1)}class vl extends Uc{insert(e,r){this.indexedValues=ob(this.indexedValues,e,r,this.initValueOrFn),super.insert(e,r)}remove(e){this.indexedValues=ab(this.indexedValues,e),super.remove(e)}}class Pw extends vl{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getHiddenIndexes(){return Rn(this.getValues(),(e,r,n)=>(r&&e.push(n),e),[])}}function lb(t,e,r){return[...t.slice(0,e),...r,...t.slice(e)]}function Lf(t,e){return Rs(t,r=>e.includes(r)===!1)}function cb(t,e){return wt(t,r=>r-e.filter(n=>n<r).length)}function ub(t,e){const r=e[0],n=e.length;return wt(t,i=>i>=r?i+n:i)}function cne(t,e,r){return e=une(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function une(t){var e=hne(t,"string");return typeof e=="symbol"?e:e+""}function hne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Dw extends Uc{constructor(){super(...arguments),cne(this,"orderOfIndexes",[])}getValues(){return this.orderOfIndexes.map(e=>this.indexedValues[e])}setValues(e){this.orderOfIndexes=[...Array(e.length).keys()],super.setValues(e)}setValueAtIndex(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.orderOfIndexes.length;return e<this.indexedValues.length?(this.indexedValues[e]=r,this.orderOfIndexes.includes(e)===!1&&this.orderOfIndexes.splice(n,0,e),this.runLocalHooks("change"),!0):!1}clearValue(e){this.orderOfIndexes=Lf(this.orderOfIndexes,[e]),Xt(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,r){this.indexedValues=ob(this.indexedValues,e,r,this.initValueOrFn),this.orderOfIndexes=ub(this.orderOfIndexes,r),super.insert(e,r)}remove(e){this.indexedValues=ab(this.indexedValues,e),this.orderOfIndexes=Lf(this.orderOfIndexes,e),this.orderOfIndexes=cb(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map(e=>[e,this.getValueAtIndex(e)])}}class vg extends vl{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getTrimmedIndexes(){return Rn(this.getValues(),(e,r,n)=>(r&&e.push(n),e),[])}}const BA=new Map([["indexesSequence",{getListWithInsertedItems:lb,getListWithRemovedItems:Lf}],["physicallyIndexed",{getListWithInsertedItems:ob,getListWithRemovedItems:ab}]]),VN=t=>{if(BA.has(t)===!1)throw new Error(`Alter strategy with ID '${t}' does not exist.`);return BA.get(t)};class WN extends Uc{constructor(){super(e=>e)}insert(e,r){const n=ub(this.indexedValues,r);this.indexedValues=lb(n,e,r),super.insert(e,r)}remove(e){const r=Lf(this.indexedValues,e);this.indexedValues=cb(r,e),super.remove(e)}}const VA=new Map([["hiding",Pw],["index",Uc],["linkedPhysicalIndexToValue",Dw],["physicalIndexToValue",vl],["trimming",vg]]);function dne(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!VA.has(t))throw new Error(`The provided map type ("${t}") does not exist.`);return new(VA.get(t))(e)}function fne(t,e,r){return e=gne(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gne(t){var e=mne(t,"string");return typeof e=="symbol"?e:e+""}function mne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class hb{constructor(){fne(this,"collection",new Map)}register(e,r){this.collection.has(e)===!1&&(this.collection.set(e,r),r.addLocalHook("change",()=>this.runLocalHooks("change",r)))}unregister(e){const r=this.collection.get(e);Le(r)&&(r.destroy(),this.collection.delete(e),this.runLocalHooks("change",r))}unregisterAll(){this.collection.forEach((e,r)=>this.unregister(r)),this.collection.clear()}get(e){return Zt(e)?Array.from(this.collection.values()):this.collection.get(e)}getLength(){return this.collection.size}removeFromEvery(e){this.collection.forEach(r=>{r.remove(e)})}insertToEvery(e,r){this.collection.forEach(n=>{n.insert(e,r)})}initEvery(e){this.collection.forEach(r=>{r.init(e)})}}zt(hb,Wn);function wC(t,e,r){return e=pne(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pne(t){var e=wne(t,"string");return typeof e=="symbol"?e:e+""}function wne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class WA extends hb{constructor(e,r){super(),wC(this,"mergedValuesCache",[]),wC(this,"aggregationFunction",void 0),wC(this,"fallbackValue",void 0),this.aggregationFunction=e,this.fallbackValue=r}getMergedValues(){if((arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0)return this.mergedValuesCache;if(this.getLength()===0)return[];const r=wt(this.get(),s=>s.getValues()),n=[],i=Le(r[0])&&r[0].length||0;for(let s=0;s<i;s+=1){const o=[];for(let a=0;a<this.getLength();a+=1)o.push(r[a][s]);n.push(o)}return wt(n,this.aggregationFunction)}getMergedValueAtIndex(e,r){const n=this.getMergedValues(r)[e];return Le(n)?n:this.fallbackValue}updateCache(){this.mergedValuesCache=this.getMergedValues(!1)}}function vne(t,e,r){Cne(t,e),e.set(t,r)}function Cne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Sne(t,e,r){return t.set(UN(t,e),r),r}function xne(t,e){return t.get(UN(t,e))}function UN(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var vC=new WeakMap;class YN{constructor(){vne(this,vC,[])}subscribe(e){return this.addLocalHook("change",e),this._write(xne(vC,this)),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){Sne(vC,this,e)}}zt(YN,Wn);function UA(t,e){const r=[];let n=0,i=0;for(;n<t.length&&i<e.length;n++,i++)t[n]!==e[i]&&r.push({op:"replace",index:i,oldValue:t[n],newValue:e[i]});for(;n<e.length;n++)r.push({op:"insert",index:n,oldValue:void 0,newValue:e[n]});for(;i<t.length;i++)r.push({op:"remove",index:i,oldValue:t[i],newValue:void 0});return r}function jh(t,e,r){yne(t,e),e.set(t,r)}function yne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _i(t,e){return t.get(zN(t,e))}function x0(t,e,r){return t.set(zN(t,e),r),r}function zN(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var y0=new WeakMap,Kh=new WeakMap,b0=new WeakMap,E0=new WeakMap,R0=new WeakMap;class bne{constructor(){let{initialIndexValue:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};jh(this,y0,new Set),jh(this,Kh,[]),jh(this,b0,[]),jh(this,E0,!1),jh(this,R0,!1),x0(R0,this,e??!1)}createObserver(){const e=new YN;return _i(y0,this).add(e),e.addLocalHook("unsubscribe",()=>{_i(y0,this).delete(e)}),e._writeInitialChanges(UA(_i(Kh,this),_i(b0,this))),e}emit(e){let r=_i(b0,this);(!_i(E0,this)||_i(Kh,this).length!==e.length)&&(e.length===0?e=new Array(r.length).fill(_i(R0,this)):x0(Kh,this,new Array(e.length).fill(_i(R0,this))),_i(E0,this)||(x0(E0,this,!0),r=_i(Kh,this)));const n=UA(r,e);_i(y0,this).forEach(i=>i._write(n)),x0(b0,this,e)}}function Tn(t,e,r){return e=Ene(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ene(t){var e=Rne(t,"string");return typeof e=="symbol"?e:e+""}function Rne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class OS{constructor(){Tn(this,"indexesSequence",new WN),Tn(this,"trimmingMapsCollection",new WA(e=>e.some(r=>r===!0),!1)),Tn(this,"hidingMapsCollection",new WA(e=>e.some(r=>r===!0),!1)),Tn(this,"variousMapsCollection",new hb),Tn(this,"hidingChangesObservable",new bne({initialIndexValue:!1})),Tn(this,"notTrimmedIndexesCache",[]),Tn(this,"notHiddenIndexesCache",[]),Tn(this,"isBatched",!1),Tn(this,"indexesSequenceChanged",!1),Tn(this,"indexesChangeSource",void 0),Tn(this,"trimmedIndexesChanged",!1),Tn(this,"hiddenIndexesChanged",!1),Tn(this,"renderablePhysicalIndexesCache",[]),Tn(this,"fromPhysicalToVisualIndexesCache",new Map),Tn(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,r,n){return this.registerMap(e,dne(r,n))}registerMap(e,r){if(this.trimmingMapsCollection.get(e)||this.hidingMapsCollection.get(e)||this.variousMapsCollection.get(e))throw Error(`Map with name "${e}" has been already registered.`);r instanceof vg?this.trimmingMapsCollection.register(e,r):r instanceof Pw?this.hidingMapsCollection.register(e,r):this.variousMapsCollection.register(e,r);const n=this.getNumberOfIndexes();return n>0&&r.init(n),r}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 r=this.notTrimmedIndexesCache[e];return Le(r)?r:null}getPhysicalFromRenderableIndex(e){const r=this.renderablePhysicalIndexesCache[e];return Le(r)?r:null}getVisualFromPhysicalIndex(e){const r=this.fromPhysicalToVisualIndexesCache.get(e);return Le(r)?r:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){const r=this.fromVisualToRenderableIndexesCache.get(e);return Le(r)?r:null}getNearestNotHiddenIndex(e,r){let n=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 r>0?o=s.findIndex(a=>a>e):o=s.reverse().findIndex(a=>a<e),o===-1?n?this.getNearestNotHiddenIndex(e,-r,!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 r=this.getNumberOfIndexes();if(e<r){const n=[...Array(this.getNumberOfIndexes()-e).keys()].map(i=>i+e);this.removeIndexes(n)}else this.insertIndexes(r,e-r)}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(n=>this.isTrimmed(n)===!1)}getNotTrimmedIndexesLength(){return this.getNotTrimmedIndexes().length}getNotHiddenIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notHiddenIndexesCache:this.getIndexesSequence().filter(n=>this.isHidden(n)===!1)}getNotHiddenIndexesLength(){return this.getNotHiddenIndexes().length}getRenderableIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.renderablePhysicalIndexesCache:this.getNotTrimmedIndexes().filter(n=>this.isHidden(n)===!1)}getRenderableIndexesLength(){return this.getRenderableIndexes().length}getNumberOfIndexes(){return this.getIndexesSequence().length}moveIndexes(e,r){typeof e=="number"&&(e=[e]);const n=wt(e,c=>this.getPhysicalFromVisualIndex(c)),i=this.getNotTrimmedIndexesLength(),s=e.length,o=Lf(this.getIndexesSequence(),n),a=o.filter(c=>this.isTrimmed(c)===!1);let l=o.indexOf(a[a.length-1])+1;if(r+s<i){const c=a[r];l=o.indexOf(c)}this.indexesChangeSource="move",this.setIndexesSequence(lb(o,l,n)),this.indexesChangeSource=void 0}isTrimmed(e){return this.trimmingMapsCollection.getMergedValueAtIndex(e)}isHidden(e){return this.hidingMapsCollection.getMergedValueAtIndex(e)}insertIndexes(e,r){const n=this.getNotTrimmedIndexes()[e],i=Le(n)?n:this.getNumberOfIndexes(),s=this.getIndexesSequence().includes(n)?this.getIndexesSequence().indexOf(n):this.getNumberOfIndexes(),o=wt(new Array(r).fill(i),(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 r=this.indexesSequenceChanged||this.trimmedIndexesChanged||this.hiddenIndexesChanged;(e===!0||this.isBatched===!1&&r===!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 r=0;r<e;r+=1){const n=this.getPhysicalFromVisualIndex(r);this.fromPhysicalToVisualIndexesCache.set(n,r)}}cacheFromVisualToRenderableIndexes(){const e=this.getRenderableIndexesLength();this.fromVisualToRenderableIndexesCache.clear();for(let r=0;r<e;r+=1){const n=this.getPhysicalFromRenderableIndex(r),i=this.getVisualFromPhysicalIndex(n);this.fromVisualToRenderableIndexesCache.set(i,r)}}}zt(OS,Wn);function Tne(t,e){return dt(e,(r,n)=>{Zt(t[n])&&(t[n]=r)}),t}function GN(t){const r=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/.exec(t);return r?`${r[1].toLowerCase()}-${r[2].toUpperCase()}`:t}function jN(t){Le(t)&&Hy(Dt`Language with code "${t}" was not found. You should register particular language\x20
  83. before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.`)}function _ne(t,e){return Array.isArray(t)&&Number.isInteger(e)?t[e]:t}const{register:Ane,getValues:Mne}=Ds("phraseFormatters");function Ine(t,e){Ane(t,e)}function One(){return Mne()}Ine("pluralize",_ne);const KN="ContextMenu:items",it=KN,db=`${it}.noItems`,fb=`${it}.insertRowAbove`,gb=`${it}.insertRowBelow`,mb=`${it}.insertColumnOnTheLeft`,pb=`${it}.insertColumnOnTheRight`,wb=`${it}.removeRow`,vb=`${it}.removeColumn`,Cb=`${it}.undo`,Sb=`${it}.redo`,xb=`${it}.readOnly`,yb=`${it}.clearColumn`,bb=`${it}.copy`,Eb=`${it}.copyWithHeaders`,Rb=`${it}.copyWithGroupHeaders`,Tb=`${it}.copyHeadersOnly`,_b=`${it}.cut`,Ab=`${it}.freezeColumn`,Mb=`${it}.unfreezeColumn`,Ib=`${it}.mergeCells`,Ob=`${it}.unmergeCells`,Pb=`${it}.addComment`,Db=`${it}.editComment`,kb=`${it}.removeComment`,Nb=`${it}.readOnlyComment`,Hb=`${it}.align`,Fb=`${it}.align.left`,Lb=`${it}.align.center`,$b=`${it}.align.right`,Bb=`${it}.align.justify`,Vb=`${it}.align.top`,Wb=`${it}.align.middle`,Ub=`${it}.align.bottom`,Yb=`${it}.borders`,zb=`${it}.borders.top`,Gb=`${it}.borders.right`,jb=`${it}.borders.bottom`,Kb=`${it}.borders.left`,Xb=`${it}.borders.remove`,qb=`${it}.nestedHeaders.insertChildRow`,Zb=`${it}.nestedHeaders.detachFromParent`,Jb=`${it}.hideColumn`,Qb=`${it}.showColumn`,eE=`${it}.hideRow`,tE=`${it}.showRow`,Un="Filters:",wr=`${Un}conditions`,kw=`${wr}.none`,rE=`${wr}.isEmpty`,nE=`${wr}.isNotEmpty`,iE=`${wr}.isEqualTo`,sE=`${wr}.isNotEqualTo`,oE=`${wr}.beginsWith`,aE=`${wr}.endsWith`,lE=`${wr}.contains`,cE=`${wr}.doesNotContain`,Pne=`${wr}.byValue`,uE=`${wr}.greaterThan`,hE=`${wr}.greaterThanOrEqualTo`,dE=`${wr}.lessThan`,fE=`${wr}.lessThanOrEqualTo`,gE=`${wr}.isBetween`,mE=`${wr}.isNotBetween`,pE=`${wr}.after`,wE=`${wr}.before`,vE=`${wr}.today`,CE=`${wr}.tomorrow`,SE=`${wr}.yesterday`,xE=`${Un}labels.filterByCondition`,yE=`${Un}labels.filterByValue`,bE=`${Un}labels.conjunction`,Nw=`${Un}labels.disjunction`,yp=`${Un}values.blankCells`,EE=`${Un}buttons.selectAll`,RE=`${Un}buttons.clear`,TE=`${Un}buttons.ok`,_E=`${Un}buttons.cancel`,AE=`${Un}buttons.placeholder.search`,ME=`${Un}buttons.placeholder.value`,IE=`${Un}buttons.placeholder.secondValue`,OE="CheckboxRenderer:",PE=`${OE}checked`,DE=`${OE}unchecked`,Dne=Object.freeze(Object.defineProperty({__proto__:null,CHECKBOX_CHECKED:PE,CHECKBOX_RENDERER_NAMESPACE:OE,CHECKBOX_UNCHECKED:DE,CONTEXTMENU_ITEMS_ADD_COMMENT:Pb,CONTEXTMENU_ITEMS_ALIGNMENT:Hb,CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM:Ub,CONTEXTMENU_ITEMS_ALIGNMENT_CENTER:Lb,CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY:Bb,CONTEXTMENU_ITEMS_ALIGNMENT_LEFT:Fb,CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE:Wb,CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT:$b,CONTEXTMENU_ITEMS_ALIGNMENT_TOP:Vb,CONTEXTMENU_ITEMS_BORDERS:Yb,CONTEXTMENU_ITEMS_BORDERS_BOTTOM:jb,CONTEXTMENU_ITEMS_BORDERS_LEFT:Kb,CONTEXTMENU_ITEMS_BORDERS_RIGHT:Gb,CONTEXTMENU_ITEMS_BORDERS_TOP:zb,CONTEXTMENU_ITEMS_CLEAR_COLUMN:yb,CONTEXTMENU_ITEMS_COPY:bb,CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY:Tb,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS:Rb,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS:Eb,CONTEXTMENU_ITEMS_CUT:_b,CONTEXTMENU_ITEMS_EDIT_COMMENT:Db,CONTEXTMENU_ITEMS_FREEZE_COLUMN:Ab,CONTEXTMENU_ITEMS_HIDE_COLUMN:Jb,CONTEXTMENU_ITEMS_HIDE_ROW:eE,CONTEXTMENU_ITEMS_INSERT_LEFT:mb,CONTEXTMENU_ITEMS_INSERT_RIGHT:pb,CONTEXTMENU_ITEMS_MERGE_CELLS:Ib,CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD:Zb,CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD:qb,CONTEXTMENU_ITEMS_NO_ITEMS:db,CONTEXTMENU_ITEMS_READ_ONLY:xb,CONTEXTMENU_ITEMS_READ_ONLY_COMMENT:Nb,CONTEXTMENU_ITEMS_REDO:Sb,CONTEXTMENU_ITEMS_REMOVE_BORDERS:Xb,CONTEXTMENU_ITEMS_REMOVE_COLUMN:vb,CONTEXTMENU_ITEMS_REMOVE_COMMENT:kb,CONTEXTMENU_ITEMS_REMOVE_ROW:wb,CONTEXTMENU_ITEMS_ROW_ABOVE:fb,CONTEXTMENU_ITEMS_ROW_BELOW:gb,CONTEXTMENU_ITEMS_SHOW_COLUMN:Qb,CONTEXTMENU_ITEMS_SHOW_ROW:tE,CONTEXTMENU_ITEMS_UNDO:Cb,CONTEXTMENU_ITEMS_UNFREEZE_COLUMN:Mb,CONTEXTMENU_ITEMS_UNMERGE_CELLS:Ob,CONTEXT_MENU_ITEMS_NAMESPACE:KN,FILTERS_BUTTONS_CANCEL:_E,FILTERS_BUTTONS_CLEAR:RE,FILTERS_BUTTONS_OK:TE,FILTERS_BUTTONS_PLACEHOLDER_SEARCH:AE,FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE:IE,FILTERS_BUTTONS_PLACEHOLDER_VALUE:ME,FILTERS_BUTTONS_SELECT_ALL:EE,FILTERS_CONDITIONS_AFTER:pE,FILTERS_CONDITIONS_BEFORE:wE,FILTERS_CONDITIONS_BEGINS_WITH:oE,FILTERS_CONDITIONS_BETWEEN:gE,FILTERS_CONDITIONS_BY_VALUE:Pne,FILTERS_CONDITIONS_CONTAINS:lE,FILTERS_CONDITIONS_EMPTY:rE,FILTERS_CONDITIONS_ENDS_WITH:aE,FILTERS_CONDITIONS_EQUAL:iE,FILTERS_CONDITIONS_GREATER_THAN:uE,FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL:hE,FILTERS_CONDITIONS_LESS_THAN:dE,FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL:fE,FILTERS_CONDITIONS_NAMESPACE:wr,FILTERS_CONDITIONS_NONE:kw,FILTERS_CONDITIONS_NOT_BETWEEN:mE,FILTERS_CONDITIONS_NOT_CONTAIN:cE,FILTERS_CONDITIONS_NOT_EMPTY:nE,FILTERS_CONDITIONS_NOT_EQUAL:sE,FILTERS_CONDITIONS_TODAY:vE,FILTERS_CONDITIONS_TOMORROW:CE,FILTERS_CONDITIONS_YESTERDAY:SE,FILTERS_DIVS_FILTER_BY_CONDITION:xE,FILTERS_DIVS_FILTER_BY_VALUE:yE,FILTERS_LABELS_CONJUNCTION:bE,FILTERS_LABELS_DISJUNCTION:Nw,FILTERS_NAMESPACE:Un,FILTERS_VALUES_BLANK_CELLS:yp},Symbol.toStringTag,{value:"Module"}));/**
  84. * @preserve
  85. * Authors: Handsoncode
  86. * Last updated: Nov 15, 2017
  87. *
  88. * Description: Definition file for English - United States language-country.
  89. */const XN={languageCode:"en-US",[db]:"No available options",[fb]:"Insert row above",[gb]:"Insert row below",[mb]:"Insert column left",[pb]:"Insert column right",[wb]:["Remove row","Remove rows"],[vb]:["Remove column","Remove columns"],[Cb]:"Undo",[Sb]:"Redo",[xb]:"Read only",[yb]:"Clear column",[Hb]:"Alignment",[Fb]:"Left",[Lb]:"Center",[$b]:"Right",[Bb]:"Justify",[Vb]:"Top",[Wb]:"Middle",[Ub]:"Bottom",[Ab]:"Freeze column",[Mb]:"Unfreeze column",[Yb]:"Borders",[zb]:"Top",[Gb]:"Right",[jb]:"Bottom",[Kb]:"Left",[Xb]:"Remove border(s)",[Pb]:"Add comment",[Db]:"Edit comment",[kb]:"Delete comment",[Nb]:"Read-only comment",[Ib]:"Merge cells",[Ob]:"Unmerge cells",[bb]:"Copy",[Eb]:["Copy with header","Copy with headers"],[Rb]:["Copy with group header","Copy with group headers"],[Tb]:["Copy header only","Copy headers only"],[_b]:"Cut",[qb]:"Insert child row",[Zb]:"Detach from parent",[Jb]:["Hide column","Hide columns"],[Qb]:["Show column","Show columns"],[eE]:["Hide row","Hide rows"],[tE]:["Show row","Show rows"],[kw]:"None",[rE]:"Is empty",[nE]:"Is not empty",[iE]:"Is equal to",[sE]:"Is not equal to",[oE]:"Begins with",[aE]:"Ends with",[lE]:"Contains",[cE]:"Does not contain",[uE]:"Greater than",[hE]:"Greater than or equal to",[dE]:"Less than",[fE]:"Less than or equal to",[gE]:"Is between",[mE]:"Is not between",[pE]:"After",[wE]:"Before",[vE]:"Today",[CE]:"Tomorrow",[SE]:"Yesterday",[yp]:"Blank cells",[xE]:"Filter by condition",[yE]:"Filter by value",[bE]:"And",[Nw]:"Or",[EE]:"Select all",[RE]:"Clear",[TE]:"OK",[_E]:"Cancel",[AE]:"Search",[ME]:"Value",[IE]:"Second value",[PE]:"Checked",[DE]:"Unchecked"},kne=Dne,PS=XN.languageCode,{register:Nne,getItem:qN,hasItem:Hne,getValues:Fne}=Ds("languagesDictionaries");ZN(XN);function ZN(t,e){let r=t,n=e;return at(t)&&(n=t,r=n.languageCode),Lne(r,n),Nne(r,Vn(n)),Vn(n)}function Lne(t,e){t!==PS&&Tne(e,qN(PS))}function JN(t){return kE(t)?Vn(qN(t)):null}function kE(t){return Hne(t)}function $ne(){return Fne()}function QN(t,e,r){const n=JN(t);if(n===null)return null;const i=n[e];if(Zt(i))return null;const s=Bne(i,r);return Array.isArray(s)?s[0]:s}function Bne(t,e){let r=t;return j(One(),n=>{r=n(t,e)}),r}function Vne(t){let e=GN(t);return kE(e)||(e=PS,jN(t)),e}function Wne(t,e,r){return e=Une(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Une(t){var e=Yne(t,"string");return typeof e=="symbol"?e:e+""}function Yne(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class pa extends ON{constructor(e,r){super(e,null),Wne(this,"visualCellRange",null),this.visualCellRange=r||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:r,to:n}=e,i=this.getNearestNotHiddenCoords(r,1),s=this.getNearestNotHiddenCoords(n,-1);return i===null||s===null?null:((i.row>s.row||i.col>s.col)&&(i=r,s=n),this.settings.createCellRange(i,i,s))}getNearestNotHiddenCoords(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r;const i=this.getNearestNotHiddenIndex(this.settings.rowIndexMapper,e.row,r);if(i===null)return null;const s=this.getNearestNotHiddenIndex(this.settings.columnIndexMapper,e.col,n);return s===null?null:this.settings.createCellCoords(i,s)}getNearestNotHiddenIndex(e,r,n){return r<0?r:e.getNearestNotHiddenIndex(r,n)}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 r=e.from.clone().normalize(),n=e.getVerticalDirection()==="N-S"?1:-1,i=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(r,n,i)),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:r}=this.cellRange;return[Math.min(e.row,r.row),Math.min(e.col,r.col),Math.max(e.row,r.row),Math.max(e.col,r.col)]}getVisualCorners(){const e=this.settings.renderableToVisualCoords(this.cellRange.getTopStartCorner()),r=this.settings.renderableToVisualCoords(this.cellRange.getBottomEndCorner());return[e.row,e.col,r.row,r.col]}createRenderableCellRange(e,r){const n=this.settings.visualToRenderableCoords(e),i=this.settings.visualToRenderableCoords(r);return n.row===null||n.col===null||i.row===null||i.col===null?null:this.settings.createCellRange(n,n,i)}}function CC(t){let{activeHeaderClassName:e,...r}=t;return new pa({className:e,...r,selectionType:PN})}function zne(t){let{areaCornerVisible:e,...r}=t;return new pa({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:e},...r,selectionType:qy})}function Gne(t){let{...e}=t;return new pa({className:"highlight",...e,selectionType:qy})}function jne(t){let{columnClassName:e,...r}=t;return new pa({className:e,...r,selectionType:Cre})}function Kne(t){let{cellCornerVisible:e,...r}=t;return new pa({className:"current",headerAttributes:[Ty()],border:{width:2,color:"#4b89ff",cornerVisible:e},...r,selectionType:Zy})}function Xne(t){let{border:e,visualCellRange:r,...n}=t;return new pa({...e,...n,selectionType:Sre},r)}function qne(t){let{...e}=t;return new pa({className:"fill",border:{width:1,color:"#ff0000"},...e,selectionType:wre})}function YA(t){let{headerClassName:e,...r}=t;return new pa({className:e,...r,selectionType:Xy})}function Zne(t){let{rowClassName:e,...r}=t;return new pa({className:e,...r,selectionType:vre})}function Jne(t,e){Qne(t,e),e.add(t)}function Qne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gn(t,e,r){return e=eie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function eie(t){var e=tie(t,"string");return typeof e=="symbol"?e:e+""}function tie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Do(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var $s=new WeakSet;class rie{constructor(e){Jne(this,$s),Gn(this,"options",void 0),Gn(this,"layerLevel",0),Gn(this,"focus",void 0),Gn(this,"fill",void 0),Gn(this,"layeredAreas",new Map),Gn(this,"areas",new Map),Gn(this,"rowHeaders",new Map),Gn(this,"columnHeaders",new Map),Gn(this,"activeRowHeaders",new Map),Gn(this,"activeColumnHeaders",new Map),Gn(this,"activeCornerHeaders",new Map),Gn(this,"rowHighlights",new Map),Gn(this,"columnHighlights",new Map),Gn(this,"customSelections",[]),this.options=e,this.focus=Kne(e),this.fill=qne(e)}isEnabledFor(e,r){let n=e;e===Zy&&(n="current");let i=this.options.disabledCellSelection(r.row,r.col);return typeof i=="string"&&(i=[i]),i===!1||Array.isArray(i)&&!i.includes(n)}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 Do($s,this,ko).call(this,this.layeredAreas,zne)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return Do($s,this,ko).call(this,this.areas,Gne)}getAreas(){return[...this.areas.values()]}createRowHeader(){return Do($s,this,ko).call(this,this.rowHeaders,YA)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return Do($s,this,ko).call(this,this.columnHeaders,YA)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return Do($s,this,ko).call(this,this.activeRowHeaders,CC)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return Do($s,this,ko).call(this,this.activeColumnHeaders,CC)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return Do($s,this,ko).call(this,this.activeCornerHeaders,CC)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return Do($s,this,ko).call(this,this.rowHighlights,Zne)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return Do($s,this,ko).call(this,this.columnHighlights,jne)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push(Xne({...this.options,...e}))}clear(){this.focus.clear(),this.fill.clear(),j(this.areas.values(),e=>void e.clear()),j(this.layeredAreas.values(),e=>void e.clear()),j(this.rowHeaders.values(),e=>void e.clear()),j(this.columnHeaders.values(),e=>void e.clear()),j(this.activeRowHeaders.values(),e=>void e.clear()),j(this.activeColumnHeaders.values(),e=>void e.clear()),j(this.activeCornerHeaders.values(),e=>void e.clear()),j(this.rowHighlights.values(),e=>void e.clear()),j(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 ko(t,e){const r=this.layerLevel;if(t.has(r))return t.get(r);const n=e({layerLevel:r,...this.options});return t.set(r,n),n}function zA(t,e,r){return e=nie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nie(t){var e=iie(t,"string");return typeof e=="symbol"?e:e+""}function iie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sie{constructor(e){zA(this,"ranges",[]),zA(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(r=>r.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,r;return e>=0&&e<this.size()&&(r=this.ranges[e]),r}[Symbol.iterator](){return this.ranges[Symbol.iterator]()}}function oie(t,e){e2(t,e),e.add(t)}function SC(t,e,r){e2(t,e),e.set(t,r)}function e2(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bt(t,e){return t.get(Or(t,e))}function xC(t,e,r){return t.set(Or(t,e),r),r}function Or(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var T0=new WeakMap,Kt=new WeakMap,po=new WeakMap,Fr=new WeakSet;class DS{constructor(e,r){oie(this,Fr),SC(this,T0,void 0),SC(this,Kt,void 0),SC(this,po,{x:0,y:0}),xC(T0,this,e),xC(Kt,this,r)}transformStart(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=bt(Kt,this).createCellCoords(e,r);let s=bt(T0,this).current().highlight;const o=bt(Kt,this).visualToRenderableCoords(s);let a=0,l=0;if(this.runLocalHooks("beforeTransformStart",i),o.row!==null&&o.col!==null){const{width:c,height:u}=Or(Fr,this,t2).call(this),{row:h,col:d}=Or(Fr,this,jA).call(this,s),f=bt(Kt,this).fixedRowsBottom(),g=bt(Kt,this).minSpareRows(),m=bt(Kt,this).minSpareCols(),p=bt(Kt,this).autoWrapRow(),S=bt(Kt,this).autoWrapCol(),y=bt(Kt,this).createCellCoords(h+i.row,d+i.col);if(y.row>=u){const A=Ss(n&&g>0&&f===0),O=y.col+1,T=bt(Kt,this).createCellCoords(y.row-u,O>=c?O-c:O);this.runLocalHooks("beforeColumnWrap",A,Or(Fr,this,nu).call(this,T),O>=c),A.value?this.runLocalHooks("insertRowRequire",bt(Kt,this).countRenderableRows()):S&&y.assign(T)}else if(y.row<0){const A=Ss(S),O=y.col-1,T=bt(Kt,this).createCellCoords(u+y.row,O<0?c+O:O);this.runLocalHooks("beforeColumnWrap",A,Or(Fr,this,nu).call(this,T),O<0),S&&y.assign(T)}if(y.col>=c){const A=Ss(n&&m>0),O=y.row+1,T=bt(Kt,this).createCellCoords(O>=u?O-u:O,y.col-c);this.runLocalHooks("beforeRowWrap",A,Or(Fr,this,nu).call(this,T),O>=u),A.value?this.runLocalHooks("insertColRequire",bt(Kt,this).countRenderableColumns()):p&&y.assign(T)}else if(y.col<0){const A=Ss(p),O=y.row-1,T=bt(Kt,this).createCellCoords(O<0?u+O:O,c+y.col);this.runLocalHooks("beforeRowWrap",A,Or(Fr,this,nu).call(this,T),O<0),p&&y.assign(T)}const{rowDir:C,colDir:E}=Or(Fr,this,GA).call(this,y);a=C,l=E,s=Or(Fr,this,nu).call(this,y)}return this.runLocalHooks("afterTransformStart",s,a,l),s}transformEnd(e,r){const n=bt(Kt,this).createCellCoords(e,r),i=bt(T0,this).current(),s=bt(Kt,this).visualToRenderableCoords(i.highlight),o=Or(Fr,this,yC).call(this,i.to.row,i.from.row),a=Or(Fr,this,bC).call(this,i.to.col,i.from.col),l=i.to.clone();let c=0,u=0;if(this.runLocalHooks("beforeTransformEnd",n),s.row!==null&&s.col!==null&&o!==null&&a!==null){const{row:h,col:d}=Or(Fr,this,jA).call(this,i.highlight),f=bt(Kt,this).createCellCoords(o+n.row,a+n.col),g=i.getTopStartCorner(),m=i.getTopEndCorner(),p=i.getBottomEndCorner();if(n.col<0&&a>=d&&f.col<d){const E=f.col-d;f.col=Or(Fr,this,bC).call(this,g.col,m.col)+E}else if(n.col>0&&a<=d&&f.col>d){const E=Or(Fr,this,bC).call(this,m.col,g.col),A=Math.max(f.col-E,1);f.col=E+A}if(n.row<0&&o>=h&&f.row<h){const E=f.row-h;f.row=Or(Fr,this,yC).call(this,g.row,p.row)+E}else if(n.row>0&&o<=h&&f.row>h){const E=Or(Fr,this,yC).call(this,p.row,g.row),A=Math.max(f.row-E,1);f.row=E+A}const{rowDir:S,colDir:y}=Or(Fr,this,GA).call(this,f);c=S,u=y;const C=Or(Fr,this,nu).call(this,f);n.row===0&&n.col!==0?l.col=C.col:n.row!==0&&n.col===0?l.row=C.row:(l.row=C.row,l.col=C.col)}return this.runLocalHooks("afterTransformEnd",l,c,u),l}setOffsetSize(e){let{x:r,y:n}=e;xC(po,this,{x:r,y:n})}}function GA(t){const{width:e,height:r}=Or(Fr,this,t2).call(this);let n=0,i=0;return t.row<0?(n=-1,t.row=0):t.row>0&&t.row>=r&&(n=1,t.row=r-1),t.col<0?(i=-1,t.col=0):t.col>0&&t.col>=e&&(i=1,t.col=e-1),{rowDir:n,colDir:i}}function t2(){return{width:bt(po,this).x+bt(Kt,this).countRenderableColumns(),height:bt(po,this).y+bt(Kt,this).countRenderableRows()}}function yC(t,e){const r=bt(Kt,this).findFirstNonHiddenRenderableRow(t,e);return r===null?null:bt(po,this).y+r}function bC(t,e){const r=bt(Kt,this).findFirstNonHiddenRenderableColumn(t,e);return r===null?null:bt(po,this).x+r}function jA(t){const{row:e,col:r}=bt(Kt,this).visualToRenderableCoords(t);if(e===null||r===null)throw new Error("Renderable coords are not visible.");return bt(Kt,this).createCellCoords(bt(po,this).y+e,bt(po,this).x+r)}function nu(t){const e=t.clone();return e.col=t.col-bt(po,this).x,e.row=t.row-bt(po,this).y,bt(Kt,this).renderableToVisualCoords(e)}zt(DS,Wn);const Hw=0,Fw=1,r2=2,NE=3,aie=[NE,r2],lie=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],EC=Symbol("root"),KA=Symbol("child");function ah(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:EC;if(e!==EC&&e!==KA)throw new Error("The second argument is used internally only and cannot be overwritten.");const r=Array.isArray(t),n=e===EC;let i=Hw;if(r){const s=t[0];t.length===0?i=Fw:n&&s instanceof mg?i=NE:n&&Array.isArray(s)?i=ah(s,KA):t.length>=2&&t.length<=4&&!t.some((a,l)=>!lie[l].includes(typeof a))&&(i=r2)}return i}function $f(t){let{createCellCoords:e,createCellRange:r,keepDirection:n=!1,propToCol:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!aie.includes(t))throw new Error("Unsupported selection ranges schema type was provided.");return function(s){const o=t===NE;let a=o?s.from.row:s[0],l=o?s.from.col:s[1],c=o?s.to.row:s[2],u=o?s.to.col:s[3];if(typeof i=="function"&&(typeof l=="string"&&(l=i(l)),typeof u=="string"&&(u=i(u))),Zt(c)&&(c=a),Zt(u)&&(u=l),!n){const f=a,g=l,m=c,p=u;a=Math.min(f,m),l=Math.min(g,p),c=Math.max(f,m),u=Math.max(g,p)}const h=e(a,l),d=e(c,u);return r(h,h,d)}}function cie(t){const e=ah(t.getSelected());if(e===Hw||e===Fw)return[];const r=$f(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),n=new Set;j(t.getSelected(),o=>{const{from:a,to:l}=r(o),c=Math.max(a.col,0),u=l.col-c+1;j(Array.from(new Array(u),(h,d)=>c+d),h=>{n.has(h)||n.add(h)})});const i=Array.from(n).sort((o,a)=>o-a);return Rn(i,(o,a,l,c)=>(l!==0&&a===c[l-1]+1?o[o.length-1][1]+=1:o.push([a,1]),o),[])}function uie(t){const e=ah(t.getSelected());if(e===Hw||e===Fw)return[];const r=$f(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),n=new Set;j(t.getSelected(),o=>{const{from:a,to:l}=r(o),c=Math.max(a.row,0),u=l.row-c+1;j(Array.from(new Array(u),(h,d)=>c+d),h=>{n.has(h)||n.add(h)})});const i=Array.from(n).sort((o,a)=>o-a);return Rn(i,(o,a,l,c)=>(l!==0&&a===c[l-1]+1?o[o.length-1][1]+=1:o.push([a,1]),o),[])}function iu(t,e,r){hie(t,e),e.set(t,r)}function hie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Il(t,e,r){return e=die(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function die(t){var e=fie(t,"string");return typeof e=="symbol"?e:e+""}function fie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function lr(t,e){return t.get(n2(t,e))}function Bs(t,e,r){return t.set(n2(t,e),r),r}function n2(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var jn=new WeakMap,Ol=new WeakMap,_0=new WeakMap,Xh=new WeakMap,A0=new WeakMap,qh=new WeakMap;class i2{constructor(e,r){var n=this;Il(this,"settings",void 0),Il(this,"tableProps",void 0),Il(this,"inProgress",!1),Il(this,"selectedRange",new sie((i,s,o)=>this.tableProps.createCellRange(i,s,o))),Il(this,"highlight",void 0),iu(this,jn,void 0),iu(this,Ol,void 0),Il(this,"selectedByRowHeader",new Set),Il(this,"selectedByColumnHeader",new Set),iu(this,_0,!1),iu(this,Xh,!1),iu(this,A0,"unknown"),iu(this,qh,-1),this.settings=e,this.tableProps=r,this.highlight=new rie({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[Ty()],rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,disabledCellSelection:(i,s)=>this.tableProps.isDisabledCellSelection(i,s),cellCornerVisible:function(){return n.isCellCornerVisible(...arguments)},areaCornerVisible:function(){return n.isAreaCornerVisible(...arguments)},visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),createCellCoords:(i,s)=>this.tableProps.createCellCoords(i,s),createCellRange:(i,s,o)=>this.tableProps.createCellRange(i,s,o)}),Bs(jn,this,new DS(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>this.tableProps.countRenderableRows(),countRenderableColumns:()=>this.tableProps.countRenderableColumns(),visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),findFirstNonHiddenRenderableRow:function(){return n.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return n.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(i,s)=>this.tableProps.createCellCoords(i,s),fixedRowsBottom:()=>e.fixedRowsBottom,minSpareRows:()=>e.minSpareRows,minSpareCols:()=>e.minSpareCols,autoWrapRow:()=>e.autoWrapRow,autoWrapCol:()=>e.autoWrapCol})),Bs(Ol,this,new DS(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>{const i=this.selectedRange.current();return this.tableProps.countRenderableRowsInRange(0,i.getOuterBottomEndCorner().row)},countRenderableColumns:()=>{const i=this.selectedRange.current();return this.tableProps.countRenderableColumnsInRange(0,i.getOuterBottomEndCorner().col)},visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),findFirstNonHiddenRenderableRow:function(){return n.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return n.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(i,s)=>this.tableProps.createCellCoords(i,s),fixedRowsBottom:()=>0,minSpareRows:()=>0,minSpareCols:()=>0,autoWrapRow:()=>!0,autoWrapCol:()=>!0})),lr(jn,this).addLocalHook("beforeTransformStart",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("beforeModifyTransformStart",...s)}),lr(jn,this).addLocalHook("afterTransformStart",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("afterModifyTransformStart",...s)}),lr(jn,this).addLocalHook("beforeTransformEnd",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("beforeModifyTransformEnd",...s)}),lr(jn,this).addLocalHook("afterTransformEnd",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("afterModifyTransformEnd",...s)}),lr(jn,this).addLocalHook("insertRowRequire",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("insertRowRequire",...s)}),lr(jn,this).addLocalHook("insertColRequire",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("insertColRequire",...s)}),lr(jn,this).addLocalHook("beforeRowWrap",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("beforeRowWrap",...s)}),lr(jn,this).addLocalHook("beforeColumnWrap",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("beforeColumnWrap",...s)}),lr(Ol,this).addLocalHook("beforeTransformStart",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("beforeModifyTransformFocus",...s)}),lr(Ol,this).addLocalHook("afterTransformStart",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.runLocalHooks("afterModifyTransformFocus",...s)})}getSelectedRange(){return this.selectedRange}markSource(e){Bs(A0,this,e)}markEndSource(){Bs(A0,this,"unknown")}getSelectionSource(){return lr(A0,this)}setExpectedLayers(e){Bs(qh,this,e)}begin(){this.inProgress=!0}finish(){this.runLocalHooks("afterSelectionFinished",Array.from(this.selectedRange)),this.inProgress=!1,Bs(qh,this,-1)}isInProgress(){return this.inProgress}setRangeStart(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e;const s=this.settings.selectionMode==="multiple",o=Zt(r)?this.tableProps.getShortcutManager().isCtrlPressed():r,a=e.clone();Bs(_0,this,!1),this.runLocalHooks(`beforeSetRangeStart${n?"Only":""}`,a),(!s||s&&!o&&Zt(r))&&this.selectedRange.clear(),this.selectedRange.add(a).current().setHighlight(i.clone()),this.getLayerLevel()===0&&(this.selectedByRowHeader.clear(),this.selectedByColumnHeader.clear()),n||this.setRangeEnd(e)}setRangeStartOnly(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e;this.setRangeStart(e,r,!0,n)}setRangeEnd(e){if(this.selectedRange.isEmpty())return;const r=e.clone(),n=this.tableProps.countRows(),i=this.tableProps.countCols(),s=this.selectedRange.current().clone().setTo(e).isSingleHeader();if((n>0||i>0)&&(n===0&&r.col<0&&!s||i===0&&r.row<0&&!s))return;this.runLocalHooks("beforeSetRangeEnd",r),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(),c=o.getVerticalDirection(),u=this.isMultiple();o.setTo(r),u&&(l!==o.getHorizontalDirection()||o.getWidth()===1&&!o.includes(o.highlight))&&o.from.assign({col:o.highlight.col}),u&&(c!==o.getVerticalDirection()||o.getHeight()===1&&!o.includes(o.highlight))&&o.from.assign({row:o.highlight.row})}n>0&&i>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=lr(qh,this)===-1||this.selectedRange.size()===lr(qh,this);this.runLocalHooks("afterSetRangeEnd",e,a)}applyAndCommit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.selectedRange.current(),r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLayerLevel();const n=this.tableProps.countRows(),i=this.tableProps.countCols();r<this.highlight.layerLevel&&(j(this.highlight.getAreas(),g=>void g.clear()),j(this.highlight.getLayeredAreas(),g=>void g.clear()),j(this.highlight.getRowHeaders(),g=>void g.clear()),j(this.highlight.getColumnHeaders(),g=>void g.clear()),j(this.highlight.getActiveRowHeaders(),g=>void g.clear()),j(this.highlight.getActiveColumnHeaders(),g=>void g.clear()),j(this.highlight.getActiveCornerHeaders(),g=>void g.clear()),j(this.highlight.getRowHighlights(),g=>void g.clear()),j(this.highlight.getColumnHighlights(),g=>void g.clear())),this.highlight.useLayerLevel(r);const s=this.highlight.createArea(),o=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),c=this.highlight.createActiveRowHeader(),u=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();if(s.clear(),o.clear(),a.clear(),l.clear(),c.clear(),u.clear(),h.clear(),d.clear(),f.clear(),this.highlight.isEnabledFor(qy,e.highlight)&&(this.isMultiple()||r>=1)&&(s.add(e.from).add(e.to).commit(),o.add(e.from).add(e.to).commit(),r===1)){const g=this.selectedRange.previous();this.highlight.useLayerLevel(r-1),this.highlight.createArea().add(g.from).commit().syncWith(g),this.highlight.createLayeredArea().add(g.from).commit().syncWith(g),this.highlight.useLayerLevel(r)}if(this.highlight.isEnabledFor(Xy,e.highlight)){if(!e.isSingleHeader()){const p=this.tableProps.createCellCoords(Math.max(e.from.row,0),-1),S=this.tableProps.createCellCoords(e.to.row,-1),y=this.tableProps.createCellCoords(-1,Math.max(e.from.col,0)),C=this.tableProps.createCellCoords(-1,e.to.col);this.settings.selectionMode==="single"?(a.add(p).commit(),l.add(y).commit(),d.add(p).commit(),f.add(y).commit()):(a.add(p).add(S).commit(),l.add(y).add(C).commit(),d.add(p).add(S).commit(),f.add(y).add(C).commit())}const g=!lr(Xh,this)&&this.isEntireRowSelected()&&(i>0&&i===e.getWidth()||i===0&&this.isSelectedByRowHeader()),m=!lr(Xh,this)&&this.isEntireColumnSelected()&&(n>0&&n===e.getHeight()||n===0&&this.isSelectedByColumnHeader());g&&c.add(this.tableProps.createCellCoords(Math.max(e.from.row,0),Math.min(-this.tableProps.countRowHeaders(),-1))).add(this.tableProps.createCellCoords(Math.max(e.to.row,0),-1)).commit(),m&&u.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(),g&&m&&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 r=this.selectedRange.current();this.inProgress||this.runLocalHooks("beforeSetFocus",e);const n=this.highlight.getFocus();n.clear(),r.setHighlight(e),this.inProgress||this.runLocalHooks("beforeHighlightSet"),this.highlight.isEnabledFor(Zy,r.highlight)&&n.add(r.highlight).commit().syncWith(r),this.inProgress||(Bs(_0,this,!0),this.runLocalHooks("afterSetFocus",r.highlight))}transformStart(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.settings.navigableHeaders&&lr(jn,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}),this.setRangeStart(lr(jn,this).transformStart(e,r,n))}transformEnd(e,r){this.settings.navigableHeaders&&lr(jn,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}),this.setRangeEnd(lr(jn,this).transformEnd(e,r))}transformFocus(e,r){const n=this.selectedRange.current(),{row:i,col:s}=n.getOuterTopStartCorner(),o=this.tableProps.countRenderableColumnsInRange(0,s-1),a=this.tableProps.countRenderableRowsInRange(0,i-1);n.highlight.isHeader()?lr(Ol,this).setOffsetSize({x:s<0?Math.abs(s):-o,y:i<0?Math.abs(i):-a}):lr(Ol,this).setOffsetSize({x:s<0?0:-o,y:i<0?0:-a});const l=lr(Ol,this).transformStart(e,r);this.setRangeFocus(l.normalize())}shiftRows(e,r){if(!this.isSelected())return;const n=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByColumnHeader()||n.getOuterTopStartCorner().row>=e){const{from:i,to:s,highlight:o}=n,a=this.tableProps.countRows(),l=this.isSelectedByRowHeader(),c=this.isSelectedByColumnHeader(),u=c?-1:0,h=c?0:r;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(Ht(i.row+h,u,a-1),i.col),f=this.tableProps.createCellCoords(Ht(s.row+r,u,a-1),s.col);this.markSource("shift"),o.row>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(Ht(o.row+r,0,a-1),o.col)):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),c&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}shiftColumns(e,r){if(!this.isSelected())return;const n=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByRowHeader()||n.getOuterTopStartCorner().col>=e){const{from:i,to:s,highlight:o}=n,a=this.tableProps.countCols(),l=this.isSelectedByRowHeader(),c=this.isSelectedByColumnHeader(),u=l?-1:0,h=l?0:r;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(i.row,Ht(i.col+h,u,a-1)),f=this.tableProps.createCellCoords(s.row,Ht(s.col+r,u,a-1));this.markSource("shift"),o.col>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(o.row,Ht(o.col+r,0,a-1))):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),c&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}getLayerLevel(){return this.selectedRange.size()-1}isSelected(){return!this.selectedRange.isEmpty()}isMultiple(){if(!this.isSelected())return!1;const e=Ss(!this.selectedRange.current().isSingle());return this.runLocalHooks("afterIsMultipleSelection",e),e.value}isFocusSelectionChanged(){return this.isSelected()&&lr(_0,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 r=i=>{const{col:s}=i.getOuterTopStartCorner(),o=this.tableProps.countRowHeaders(),a=this.tableProps.countCols();return(o>0&&s<0||o===0)&&i.getWidth()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>r(i));const n=this.selectedRange.peekByIndex(e);return n?r(n):!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 r=i=>{const{row:s}=i.getOuterTopStartCorner(),o=this.tableProps.countColHeaders(),a=this.tableProps.countRows();return(o>0&&s<0||o===0)&&i.getHeight()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>r(i));const n=this.selectedRange.peekByIndex(e);return n?r(n):!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 r=this.tableProps.visualToRenderableCoords(e);return r.row!==null&&r.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 r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{focusPosition:!1,disableHeadersHighlight:!1};const s=this.tableProps.countRows(),o=this.tableProps.countCols(),a=this.tableProps.countRowHeaders(),l=this.tableProps.countColHeaders(),c=n?-l:0,u=r?-a:0;if(c===0&&u===0&&(s===0||o===0))return;let h=(e=this.getSelectedRange().current())===null||e===void 0?void 0:e.highlight;const{focusPosition:d,disableHeadersHighlight:f}=i;Bs(Xh,this,f),d&&Number.isInteger(d?.row)&&Number.isInteger(d?.col)&&(h=this.tableProps.createCellCoords(Ht(d.row,c,s-1),Ht(d.col,u,o-1)));const g=this.tableProps.createCellCoords(c,u),m=this.tableProps.createCellCoords(s-1,o-1);this.clear(),this.setRangeStartOnly(g,void 0,h),u<0&&this.selectedByRowHeader.add(this.getLayerLevel()),c<0&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(m),this.finish(),Bs(Xh,this,!1)}selectCells(e){var r=this;const n=ah(e);if(n===Fw)return!1;if(n===Hw)throw new Error(Dt`Unsupported format of the selection ranges was passed. To select cells pass\x20
  90. the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\x20
  91. columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);const i=$f(n,{createCellCoords:function(){return r.tableProps.createCellCoords(...arguments)},createCellRange:function(){return r.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 c=i(l),u=c.isValid(o);return!(u&&!c.containsHeaders()||u&&c.containsHeaders()&&c.isSingleHeader())});return a&&(this.clear(),this.setExpectedLayers(e.length),j(e,l=>{const{from:c,to:u}=i(l);this.setRangeStartOnly(c.clone(),!1),this.setRangeEnd(u.clone())}),this.finish()),a}selectColumns(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=typeof e=="string"?this.tableProps.propToCol(e):e,s=typeof r=="string"?this.tableProps.propToCol(r):r,o=this.tableProps.countRows(),a=this.tableProps.countCols(),l=this.tableProps.countColHeaders(),c=l===0?0:-l,u=this.tableProps.createCellCoords(c,i),h=this.tableProps.createCellCoords(o-1,s),d=this.tableProps.createCellRange(u,u,h).isValid({countRows:o,countCols:a,countRowHeaders:0,countColHeaders:l});if(d){let f=0,g=0;Number.isInteger(n?.row)&&Number.isInteger(n?.col)?(f=Ht(n.row,c,o-1),g=Ht(n.col,Math.min(i,s),Math.max(i,s))):(f=Ht(n,c,o-1),g=i);const m=this.tableProps.createCellCoords(f,g),p=l===0?0:Ht(m.row,c,-1),S=o-1,y=this.tableProps.createCellCoords(p,i),C=this.tableProps.createCellCoords(S,s);this.runLocalHooks("beforeSelectColumns",y,C,m),y.row=p,C.row=S,this.setRangeStartOnly(y,void 0,m),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(C),this.runLocalHooks("afterSelectColumns",y,C,m),this.finish()}return d}selectRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=this.tableProps.countRows(),s=this.tableProps.countCols(),o=this.tableProps.countRowHeaders(),a=o===0?0:-o,l=this.tableProps.createCellCoords(e,a),c=this.tableProps.createCellCoords(r,s-1),u=this.tableProps.createCellRange(l,l,c).isValid({countRows:i,countCols:s,countRowHeaders:o,countColHeaders:0});if(u){let h=0,d=0;Number.isInteger(n?.row)&&Number.isInteger(n?.col)?(h=Ht(n.row,Math.min(e,r),Math.max(e,r)),d=Ht(n.col,a,s-1)):(h=e,d=Ht(n,a,s-1));const f=this.tableProps.createCellCoords(h,d),g=o===0?0:Ht(f.col,a,-1),m=s-1,p=this.tableProps.createCellCoords(e,g),S=this.tableProps.createCellCoords(r,m);this.runLocalHooks("beforeSelectRows",p,S,f),p.col=g,S.col=m,this.setRangeStartOnly(p,void 0,f),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(S),this.runLocalHooks("afterSelectRows",p,S,f),this.finish()}return u}refresh(){if(!this.isSelected())return;const e=this.tableProps.countRows(),r=this.tableProps.countCols();if(e===0||r===0){this.deselect();return}const n=this.selectedRange.peekByIndex(this.selectedRange.size()-1),{from:i,to:s,highlight:o}=n;this.clear(),o.assign({row:Ht(o.row,-1/0,e-1),col:Ht(o.col,-1/0,r-1)}),i.assign({row:Ht(i.row,-1/0,e-1),col:Ht(i.col,-1/0,r-1)}),s.assign({row:Ht(s.row,0,e-1),col:Ht(s.col,0,r-1)}),this.selectedRange.ranges.push(n),this.highlight.getFocus().add(o).commit().syncWith(n),this.applyAndCommit(n)}commit(){if(this.highlight.getCustomSelections().forEach(i=>{i.commit()}),!this.isSelected())return;const r=this.highlight.getFocus(),n=this.getLayerLevel();r.commit().syncWith(this.selectedRange.current());for(let i=0;i<this.selectedRange.size();i+=1){this.highlight.useLayerLevel(i);const s=this.highlight.createArea(),o=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),c=this.highlight.createActiveRowHeader(),u=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();s.commit(),o.commit(),a.commit(),l.commit(),c.commit(),u.commit(),h.commit(),d.commit(),f.commit()}this.highlight.useLayerLevel(n)}}zt(i2,Wn);const XA=/^(\r\n|\n\r|\r|\n)/,gie=/^[^\t\r\n]+/,qA=/^\t/;function mie(t){const e=[[""]];if(t.length===0)return e;let r=0,n=0,i;for(;t.length>0&&i!==t.length;)if(i=t.length,t.match(qA))t=t.replace(qA,""),r+=1,e[n][r]="";else if(t.match(XA))t=t.replace(XA,""),r=0,n+=1,e[n]=[""];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(gie);s=o?o[0]:"",t=t.slice(s.length)}e[n][r]=s}return e}function tf(t){let e,r,n,i,s="",o;for(e=0,r=t.length;e<r;e+=1){for(i=t[e].length,n=0;n<i;n+=1)n>0&&(s+=" "),o=t[e][n],typeof o=="string"?o.indexOf(`
  92. `)>-1?s+=`"${o.replace(/"/g,'""')}"`:s+=o:o==null?s+="":s+=o;e!==r-1&&(s+=`
  93. `)}return s}function Pl(t,e,r){return e=pie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pie(t){var e=wie(t,"string");return typeof e=="symbol"?e:e+""}function wie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Bu{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}constructor(e,r,n){Pl(this,"hot",void 0),Pl(this,"metaManager",void 0),Pl(this,"tableMeta",void 0),Pl(this,"dataSource",void 0),Pl(this,"duckSchema",void 0),Pl(this,"colToPropCache",void 0),Pl(this,"propToColCache",void 0),this.hot=e,this.metaManager=n,this.tableMeta=n.getTableMeta(),this.dataSource=r,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 r=this.tableMeta.columns;let n;if(this.colToPropCache=[],this.propToColCache=new Map,r){let i=0,s=0,o=!1;if(typeof r=="function"){const a=Py(e);i=a>0?a:this.countFirstRowKeys(),o=!0}else{const a=this.tableMeta.maxCols;i=Math.min(a,r.length)}for(n=0;n<i;n++){const a=o?r(n):r[n];if(at(a)){if(typeof a.data<"u"){const l=o?s:n;this.colToPropCache[l]=a.data,this.propToColCache.set(a.data,l)}s+=1}}}else this.recursiveDuckColumns(e)}countFirstRowKeys(){return BN(this.dataSource)}recursiveDuckColumns(e,r,n){let i=r,s=n,o;return typeof i>"u"&&(i=0,s=""),typeof e=="object"&&!Array.isArray(e)&&dt(e,(a,l)=>{a===null?(o=s+l,this.colToPropCache.push(o),this.propToColCache.set(o,i),i+=1):i=this.recursiveDuckColumns(a,i,`${l}.`)}),i}colToProp(e){if(Number.isInteger(e)===!1)return e;const r=this.hot.toPhysicalColumn(e);return r===null?e:this.colToPropCache&&Le(this.colToPropCache[r])?this.colToPropCache[r]:r}propToCol(e){const r=this.propToColCache.get(e);if(Le(r))return this.hot.toVisualColumn(r);const n=this.hot.toVisualColumn(e);return n===null?e:n}getSchema(){const e=this.tableMeta.dataSchema;return e?typeof e=="function"?e():e:this.duckSchema}createDuckSchema(){return this.dataSource&&this.dataSource[0]?Hf(this.dataSource[0]):{}}refreshDuckSchema(){this.duckSchema=this.createDuckSchema()}createRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:n,mode:i="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,r,n)===!1||o===null)return{delta:0};const u=this.tableMeta.maxRows,h=this.getSchema().length,d=[];for(;a<r&&s+a<u;){let g=null;this.hot.dataType==="array"?this.tableMeta.dataSchema?g=Vn(this.getSchema()):(g=[],Ue(h-1,()=>g.push(null))):this.hot.dataType==="function"?g=this.tableMeta.dataSchema(l+a):(g={},_w(g,this.getSchema())),d.push(g),a+=1}this.hot.rowIndexMapper.insertIndexes(l,a),i==="below"&&(o=Math.min(o+1,s)),this.spliceData(o,0,d);const f=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):n!=="auto"&&this.metaManager.createRow(o,r)),this.hot.runHooks("afterCreateRow",f,a,n),this.hot.forceFullRender=!0,{delta:a,startPhysicalIndex:o}}createCol(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:n,mode:i="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,r,n)===!1)return{delta:0};let u=a;l<this.hot.countCols()&&(u=this.hot.toPhysicalColumn(l));const h=this.hot.countSourceRows();let d=this.hot.countCols(),f=0,g=u;i==="end"&&(g=Math.min(g+1,a));const m=g;for(;f<r&&d<o;){if(typeof l!="number"||l>=d)if(h>0)for(let S=0;S<h;S+=1)typeof s[S]>"u"&&(s[S]=[]),s[S].push(null);else s.push([null]);else for(let S=0;S<h;S++)s[S].splice(g,0,null);f+=1,g+=1,d+=1}this.hot.columnIndexMapper.insertIndexes(l,f),f>0&&(e==null?this.metaManager.createColumn(null,f):n!=="auto"&&this.metaManager.createColumn(m,r));const p=this.hot.toVisualColumn(m);return this.hot.runHooks("afterCreateCol",p,f,n),this.hot.forceFullRender=!0,this.refreshDuckSchema(),{delta:f,startPhysicalIndex:m}}removeRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0,i=Number.isInteger(e)?e:-r;const s=this.visualRowsToPhysical(i,r),o=this.hot.countSourceRows();if(i=(o+i)%o,this.hot.runHooks("beforeRemoveRow",i,s.length,s,n)===!1)return!1;const l=s.length;if(this.filterData(i,l,s),i<this.hot.countRows()){this.hot.rowIndexMapper.removeIndexes(s);const u=Le(this.tableMeta.columns)||Le(this.tableMeta.dataSchema);this.hot.rowIndexMapper.getNotTrimmedIndexesLength()===0&&u===!1&&this.hot.columnIndexMapper.setIndexesSequence([])}return s.slice(0).sort((u,h)=>h-u).forEach(u=>{this.metaManager.removeRow(u,1)}),this.hot.runHooks("afterRemoveRow",i,l,s,n),this.hot.forceFullRender=!0,!0}removeCol(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=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 i=typeof e!="number"?-r:e;i=(this.hot.countCols()+i)%this.hot.countCols();const s=this.visualColumnsToPhysical(i,r),o=s.slice(0).sort((h,d)=>d-h);if(this.hot.runHooks("beforeRemoveCol",i,r,s,n)===!1)return!1;let l=!0;const c=o.length,u=this.dataSource;for(let h=0;h<c;h++)l&&s[0]!==s[h]-h&&(l=!1);if(l)for(let h=0,d=this.hot.countSourceRows();h<d;h++)u[h].splice(s[0],r),h===0&&this.metaManager.removeColumn(s[0],r);else for(let h=0,d=this.hot.countSourceRows();h<d;h++)for(let f=0;f<c;f++)u[h].splice(o[f],1),h===0&&this.metaManager.removeColumn(o[f],1);return i<this.hot.countCols()&&(this.hot.columnIndexMapper.removeIndexes(s),this.hot.columnIndexMapper.getNotTrimmedIndexesLength()===0&&this.hot.rowIndexMapper.setIndexesSequence([])),this.hot.runHooks("afterRemoveCol",i,r,s,n),this.hot.forceFullRender=!0,this.refreshDuckSchema(),!0}spliceCol(e,r,n){const i=this.hot.getDataAtCol(e),s=i.slice(r,r+n),o=i.slice(r+n);for(var a=arguments.length,l=new Array(a>3?a-3:0),c=3;c<a;c++)l[c-3]=arguments[c];D_(l,o);let u=0;for(;u<n;)l.push(null),u+=1;return CZ(l),this.hot.populateFromArray(r,e,l,null,null,"spliceCol"),s}spliceRow(e,r,n){const i=this.hot.getSourceDataAtRow(e),s=i.slice(r,r+n),o=i.slice(r+n);for(var a=arguments.length,l=new Array(a>3?a-3:0),c=3;c<a;c++)l[c-3]=arguments[c];D_(l,o);let u=0;for(;u<n;)l.push(null),u+=1;return this.hot.populateFromArray(e,r,[l],null,null,"spliceRow"),s}spliceData(e,r,n){if(this.hot.runHooks("beforeDataSplice",e,r,n)!==!1){const s=[...this.dataSource.slice(0,e),...n,...this.dataSource.slice(e)];this.dataSource.length=0,s.forEach(o=>this.dataSource.push(o))}}filterData(e,r,n){let i=this.hot.runHooks("filterData",e,r,n);Array.isArray(i)===!1&&(i=this.dataSource.filter((s,o)=>n.indexOf(o)===-1)),this.dataSource.length=0,Array.prototype.push.apply(this.dataSource,i)}get(e,r){const n=this.hot.toPhysicalRow(e);let i=this.dataSource[n];const s=this.hot.runHooks("modifyRowData",n);i=isNaN(s)?s:i;const{dataDotNotation:o}=this.hot.getSettings();let a=null;if(i&&i.hasOwnProperty&&mr(i,r))a=i[r];else if(o&&typeof r=="string"&&r.indexOf(".")>-1){let l=i;if(!l)return null;const c=r.split(".");for(let u=0,h=c.length;u<h;u++)if(l=l[c[u]],typeof l>"u")return null;a=l}else typeof r=="function"&&(a=r(this.dataSource.slice(n,n+1)[0]));if(this.hot.hasHook("modifyData")){const l=Ss(a);this.hot.runHooks("modifyData",n,this.propToCol(r),l,"get"),l.isTouched()&&(a=l.value)}return a}getCopyable(e,r){return this.hot.getCellMeta(e,this.propToCol(r)).copyable?this.get(e,r):""}set(e,r,n){const i=this.hot.toPhysicalRow(e);let s=n,o=this.dataSource[i];const a=this.hot.runHooks("modifyRowData",i);if(o=isNaN(a)?a:o,this.hot.hasHook("modifyData")){const c=Ss(s);this.hot.runHooks("modifyData",i,this.propToCol(r),c,"set"),c.isTouched()&&(s=c.value)}const{dataDotNotation:l}=this.hot.getSettings();if(o&&o.hasOwnProperty&&mr(o,r))o[r]=s;else if(l&&typeof r=="string"&&r.indexOf(".")>-1){let c=o,u=0,h;const d=r.split(".");for(u=0,h=d.length-1;u<h;u++)typeof c[d[u]]>"u"&&(c[d[u]]={}),c=c[d[u]];c[d[u]]=s}else typeof r=="function"?r(this.dataSource.slice(i,i+1)[0],s):o[r]=s}visualRowsToPhysical(e,r){const n=this.hot.countSourceRows(),i=[];let s=(n+e)%n,o=r,a;for(;s<n&&o;)a=this.hot.toPhysicalRow(s),i.push(a),o-=1,s+=1;return i}visualColumnsToPhysical(e,r){const n=this.hot.countCols(),i=[];let s=(n+e)%n,o=r;for(;s<n&&o;){const a=this.hot.toPhysicalColumn(s);i.push(a),o-=1,s+=1}return i}clear(){for(let e=0;e<this.hot.countSourceRows();e++)for(let r=0;r<this.hot.countCols();r++)this.set(e,this.colToProp(r),"")}getLength(){const e=this.tableMeta.maxRows;let r;e<0||e===0?r=0:r=e||1/0;const n=this.hot.rowIndexMapper.getNotTrimmedIndexesLength();return Math.min(n,r)}getAll(){const e={row:0,col:0},r={row:Math.max(this.hot.countRows()-1,0),col:Math.max(this.hot.countCols()-1,0)};return e.row-r.row===0&&!this.hot.countSourceRows()?[]:this.getRange(e,r,Bu.DESTINATION_RENDERER)}countCachedColumns(){return this.colToPropCache.length}getRange(e,r,n){const i=[];let s,o,a;const l=this.tableMeta.maxRows,c=this.tableMeta.maxCols;if(l===0||c===0)return[];const u=n===Bu.DESTINATION_CLIPBOARD_GENERATOR?this.getCopyable:this.get,h=Math.min(Math.max(l-1,0),Math.max(e.row,r.row)),d=Math.min(Math.max(c-1,0),Math.max(e.col,r.col));for(s=Math.min(e.row,r.row);s<=h;s++){a=[];const f=s>=0?this.hot.toPhysicalRow(s):s;for(o=Math.min(e.col,r.col);o<=d&&f!==null;o++)a.push(u.call(this,s,this.colToProp(o)));f!==null&&i.push(a)}return i}getText(e,r){return tf(this.getRange(e,r,Bu.DESTINATION_RENDERER))}getCopyableText(e,r){return tf(this.getRange(e,r,Bu.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:vie,getItem:Cie,hasItem:s2,getNames:oSe,getValues:aSe}=Ds("cellTypes");function Sie(t){if(!s2(t))throw Error(`You declared cell type "${t}" as a string that is not mapped to a known object.
  94. Cell type must be an object or a string mapped to an object registered by
  95. "Handsontable.cellTypes.registerCellType" method`);return Cie(t)}function ls(t,e){typeof t!="string"&&(e=t,t=e.CELL_TYPE);const{editor:r,renderer:n,validator:i}=e;r&&li(t,r),n&&Ii(t,n),i&&Pu(t,i),vie(t,e)}function xie(t,e){var r;return t==="CELL_TYPE"?!1:((r=e._automaticallyAssignedMetaProps)===null||r===void 0?void 0:r.has(t))||!mr(e,t)}function Lw(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;const n=typeof e.type=="string"?Sie(e.type):e.type;if(t._automaticallyAssignedMetaProps&&dt(e,(s,o)=>void t._automaticallyAssignedMetaProps.delete(o)),!at(n))return;r===t&&!t._automaticallyAssignedMetaProps&&(t._automaticallyAssignedMetaProps=new Set);const i={};dt(n,(s,o)=>{if(xie(o,r)){var a;i[o]=s,(a=t._automaticallyAssignedMetaProps)===null||a===void 0||a.add(o)}}),kr(t,i)}function yie(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];function r(){}ga(r,t);for(let n=0;n<e.length;n++)r.prototype[e[n]]=void 0;return r}function Hm(t){return Number.isInteger(t)&&t>=0}function Fm(t,e){if(!t())throw new Error(`Assertion failed: ${e}`)}function M0(t){return t==null}const o2=()=>({_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,r,n;for(e=0,r=this.countRows();e<r;e++)if(n=this.getDataAtCell(e,t),yr(n)===!1)return!1;return!0},isEmptyRow(t){let e,r,n,i;for(e=0,r=this.countCols();e<r;e++)if(n=this.getDataAtCell(t,e),yr(n)===!1)return typeof n=="object"?(i=this.getCellMeta(t,e),Oy(this.getSchema()[i.prop],n)):!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 ZA(t,e,r){return e=bie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bie(t){var e=Eie(t,"string");return typeof e=="symbol"?e:e+""}function Eie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Rie(){return class{}}class Tie{constructor(e){ZA(this,"metaCtor",Rie()),ZA(this,"meta",void 0),this.meta=this.metaCtor.prototype,kr(this.meta,o2()),this.meta.instance=e}getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){var r;kr(this.meta,e),Lw(this.meta,{...e,type:(r=e.type)!==null&&r!==void 0?r:this.meta.type},e)}}function _ie(t,e,r){return e=Aie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Aie(t){var e=Mie(t,"string");return typeof e=="symbol"?e:e+""}function Mie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Iie{constructor(e){_ie(this,"meta",void 0);const r=e.getMetaConstructor();this.meta=new r}getMeta(){return this.meta}updateMeta(e){kr(this.meta,e),Lw(this.meta,e,e)}}function I0(t,e,r){return e=Oie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Oie(t){var e=Pie(t,"string");return typeof e=="symbol"?e:e+""}function Pie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bp{constructor(e){I0(this,"valueFactory",void 0),I0(this,"data",[]),I0(this,"index",[]),I0(this,"holes",new Set),this.valueFactory=e}obtain(e){Fm(()=>Hm(e),"Expecting an unsigned number.");const r=this._getStorageIndexByKey(e);let n;if(r>=0)n=this.data[r],n===void 0&&(n=this.valueFactory(e),this.data[r]=n);else if(n=this.valueFactory(e),this.holes.size>0){const i=this.holes.values().next().value;this.holes.delete(i),this.data[i]=n,this.index[e]=i}else this.data.push(n),this.index[e]=this.data.length-1;return n}insert(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Fm(()=>Hm(e)||M0(e),"Expecting an unsigned number or null/undefined argument.");const n=[],i=this.data.length;for(let o=0;o<r;o++)n.push(i+o),this.data.push(void 0);const s=M0(e)?this.index.length:e;this.index=[...this.index.slice(0,s),...n,...this.index.slice(s)]}remove(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Fm(()=>Hm(e)||M0(e),"Expecting an unsigned number or null/undefined argument.");const n=this.index.splice(M0(e)?this.index.length-r:e,r);for(let i=0;i<n.length;i++){const s=n[i];typeof s=="number"&&this.holes.add(s)}}size(){return this.data.length-this.holes.size}values(){return Rs(this.data,(e,r)=>!this.holes.has(r))[Symbol.iterator]()}entries(){const e=[];for(let n=0;n<this.data.length;n++){const i=this._getKeyByStorageIndex(n);i!==-1&&e.push([i,this.data[n]])}let r=0;return{next:()=>{if(r<e.length){const n=e[r];return r+=1,{value:n,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 JA(t,e,r){return e=Die(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Die(t){var e=kie(t,"string");return typeof e=="symbol"?e:e+""}function kie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Nie=["data","width"];class Hie{constructor(e){JA(this,"globalMeta",void 0),JA(this,"metas",new bp(()=>this._createMeta())),this.globalMeta=e,this.metas=new bp(()=>this._createMeta())}updateMeta(e,r){const n=this.getMeta(e);kr(n,r),Lw(n,r)}createColumn(e,r){this.metas.insert(e,r)}removeColumn(e,r){this.metas.remove(e,r)}getMeta(e){return this.metas.obtain(e)}getMetaConstructor(e){return this.metas.obtain(e).constructor}clearCache(){this.metas.clear()}_createMeta(){return yie(this.globalMeta.getMetaConstructor(),Nie).prototype}}function QA(t,e,r){return e=Fie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fie(t){var e=Lie(t,"string");return typeof e=="symbol"?e:e+""}function Lie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class $ie{constructor(e){QA(this,"columnMeta",void 0),QA(this,"metas",new bp(()=>this._createRow())),this.columnMeta=e}updateMeta(e,r,n){const i=this.getMeta(e,r);kr(i,n),Lw(i,n)}createRow(e,r){this.metas.insert(e,r)}createColumn(e,r){for(let n=0;n<this.metas.size();n++)this.metas.obtain(n).insert(e,r)}removeRow(e,r){this.metas.remove(e,r)}removeColumn(e,r){for(let n=0;n<this.metas.size();n++)this.metas.obtain(n).remove(e,r)}getMeta(e,r,n){const i=this.metas.obtain(e).obtain(r);return n===void 0?i:i[n]}setMeta(e,r,n,i){var s;const o=this.metas.obtain(e).obtain(r);(s=o._automaticallyAssignedMetaProps)===null||s===void 0||s.delete(n),o[n]=i}removeMeta(e,r,n){const i=this.metas.obtain(e).obtain(r);delete i[n]}getMetas(){const e=[],r=Array.from(this.metas.values());for(let n=0;n<r.length;n++)Le(r[n])&&e.push(...r[n].values());return e}getMetasAtRow(e){Fm(()=>Hm(e),"Expecting an unsigned number.");const r=new Map(this.metas);return r.has(e)?Array.from(r.get(e).values()):[]}clearCache(){this.metas.clear()}_createRow(){return new bp(e=>this._createMeta(e))}_createMeta(e){const r=this.columnMeta.getMetaConstructor(e);return new r}}class a2{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];this.hot=e,this.globalMeta=new Tie(e),this.tableMeta=new Iie(this.globalMeta),this.columnMeta=new Hie(this.globalMeta),this.cellMeta=new $ie(this.columnMeta),n.forEach(i=>new i(this)),this.globalMeta.updateMeta(r)}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,r){this.columnMeta.updateMeta(e,r)}getCellMeta(e,r,n){let{visualRow:i,visualColumn:s}=n;const o=this.cellMeta.getMeta(e,r);return o.visualRow=i,o.visualCol=s,o.row=e,o.col=r,this.runLocalHooks("afterGetCellMeta",o),o}getCellMetaKeyValue(e,r,n){if(typeof n!="string")throw new Error("The passed cell meta object key is not a string");return this.cellMeta.getMeta(e,r,n)}setCellMeta(e,r,n,i){this.cellMeta.setMeta(e,r,n,i)}updateCellMeta(e,r,n){this.cellMeta.updateMeta(e,r,n)}removeCellMeta(e,r,n){this.cellMeta.removeMeta(e,r,n)}getCellsMeta(){return this.cellMeta.getMetas()}getCellsMetaAtRow(e){return this.cellMeta.getMetasAtRow(e)}createRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createRow(e,r)}removeRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeRow(e,r)}createColumn(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createColumn(e,r),this.columnMeta.createColumn(e,r)}removeColumn(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeColumn(e,r),this.columnMeta.removeColumn(e,r)}clearCellsCache(){this.cellMeta.clearCache()}clearCache(){this.cellMeta.clearCache(),this.columnMeta.clearCache()}}zt(a2,Wn);function eM(t,e,r,n){const{hotInstance:i,dataMap:s,dataSource:o,internalSource:a,source:l,metaManager:c,firstRun:u}=n,h=Ts(a),d=i.getSettings();Array.isArray(d.dataSchema)?i.dataType="array":Xt(d.dataSchema)?i.dataType="function":i.dataType="object",s&&s.destroy(),t=i.runHooks(`before${h}`,t,u,l);const f=new Bu(i,t,c);if(e(f),typeof t=="object"&&t!==null)t.push&&t.splice||(t=[t]);else if(t===null){const g=f.getSchema();t=[];let m,p=0,S=0;for(p=0,S=d.startRows;p<S;p++)if((i.dataType==="object"||i.dataType==="function")&&d.dataSchema)m=Vn(g),t.push(m);else if(i.dataType==="array")m=Vn(g[0]),t.push(m);else{m=[];for(let y=0,C=d.startCols;y<C;y++)m.push(null);t.push(m)}}else throw new Error(`${a} only accepts array of objects or array of arrays (${typeof t} given)`);Array.isArray(t[0])&&(i.dataType="array"),d.data=t,f.dataSource=t,o.data=t,o.dataType=i.dataType,o.colToProp=f.colToProp.bind(f),o.propToCol=f.propToCol.bind(f),o.countCachedColumns=f.countCachedColumns.bind(f),r(f),i.runHooks(`after${h}`,t,u,l),u||(i.runHooks("afterChange",null,a),i.render()),i.getSettings().ariaTags&&Xe(i.rootElement,[Lk(-1),Ew(i.countCols()+(i.view?i.countRowHeaders():0))])}function tM(t,e,r){return e=Bie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bie(t){var e=Vie(t,"string");return typeof e=="symbol"?e:e+""}function Vie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Wie{constructor(e){tM(this,"metaManager",void 0),tM(this,"metaSyncMemo",new Map),this.metaManager=e,e.addLocalHook("afterGetCellMeta",r=>this.extendCellMeta(r)),He.getSingleton().add("beforeRender",r=>{r&&this.metaSyncMemo.clear()},this.metaManager.hot)}extendCellMeta(e){var r;const{row:n,col:i}=e;if((r=this.metaSyncMemo.get(n))!==null&&r!==void 0&&r.has(i))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 c=mr(e,"type")?e.type:null;let u=Xt(e.cells)?e.cells(n,i,l):null;if(c)if(u){var h;u.type=(h=u.type)!==null&&h!==void 0?h:c}else u={type:c};u&&this.metaManager.updateCellMeta(n,i,u),a.runHooks("afterGetCellMeta",s,o,e),this.metaSyncMemo.has(n)||this.metaSyncMemo.set(n,new Set),this.metaSyncMemo.get(n).add(i)}}function Uie(t,e,r){Yie(t,e),e.set(t,r)}function Yie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function RC(t,e,r){return e=zie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zie(t){var e=Gie(t,"string");return typeof e=="symbol"?e:e+""}function Gie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jie(t,e){return t.get(Kie(t,e))}function Kie(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var rM=new WeakMap;class Xie{constructor(e){RC(this,"metaManager",void 0),RC(this,"usageTracker",new Set),RC(this,"propDescriptors",new Map([["ariaTags",{initOnly:!0}],["fixedColumnsLeft",{target:"fixedColumnsStart",onChange(r){if(this.metaManager.hot.isRtl()&&r==="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}]])),Uie(this,rM,(r,n,i)=>{if(!i)throw new Error(`The \`${r}\` option can not be updated after the Handsontable is initialized.`)}),this.metaManager=e,this.extendMetaProps()}extendMetaProps(){this.propDescriptors.forEach((e,r)=>{const{initOnly:n,target:i,onChange:s}=e,o=typeof i=="string",a=o?i:r,l=`_${a}`;this.metaManager.globalMeta.meta[l]=this.metaManager.globalMeta.meta[a],s?(this.installPropWatcher(r,l,s),o&&this.installPropWatcher(i,l,s)):n&&(this.installPropWatcher(r,l,jie(rM,this)),this.metaManager.globalMeta.meta._initOnlySettings||(this.metaManager.globalMeta.meta._initOnlySettings=[]),this.metaManager.globalMeta.meta._initOnlySettings.push(r))})}installPropWatcher(e,r,n){const i=this;Object.defineProperty(this.metaManager.globalMeta.meta,e,{get(){return this[r]},set(s){const o=!i.usageTracker.has(e);i.usageTracker.add(e),n.call(i,e,s,o),this[r]=s},enumerable:!0,configurable:!0})}}const l2="gridDefault",Cl="editorManager.handlingEditor",qie={name:"editorCloseAndSave",callback(t){t._getEditorManager().closeEditorAndSaveChanges()}},Zie="hooksRefRegisterer",c2={_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){j(this._hooksStorage[t]||[],e=>{this.hot.removeHook(t,e)})},clearHooks(){dt(this._hooksStorage,(t,e)=>this.removeHooksByKey(e)),this._hooksStorage={}}};ma(c2,"MIXIN_NAME",Zie,{writable:!1,enumerable:!1});function rs(t,e,r){return e=Jie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jie(t){var e=Qie(t,"string");return typeof e=="symbol"?e:e+""}function Qie(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const ese="base",Cr=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"});class xh{static get EDITOR_TYPE(){return ese}constructor(e){rs(this,"hot",void 0),rs(this,"state",Cr.VIRGIN),rs(this,"_opened",!1),rs(this,"_fullEditMode",!1),rs(this,"_closeCallback",null),rs(this,"TD",null),rs(this,"row",null),rs(this,"col",null),rs(this,"prop",null),rs(this,"originalValue",null),rs(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,r,n,i,s,o){this.TD=i,this.row=e,this.col=r,this.prop=n,this.originalValue=s,this.cellProperties=o,this.state=this.isOpened()?this.state:Cr.VIRGIN}extend(){return class extends this.constructor{}}saveValue(e,r){let n,i,s,o;if(r){const l=this.hot.getSelectedLast();n=Math.max(Math.min(l[0],l[2]),0),i=Math.max(Math.min(l[1],l[3]),0),s=Math.max(l[0],l[2]),o=Math.max(l[1],l[3])}else[n,i,s,o]=[this.row,this.col,null,null];const a=this.hot.runHooks("modifyGetCellCoords",n,i);Array.isArray(a)&&([n,i]=a),this.hot.populateFromArray(n,i,e,s,o,"edit")}beginEditing(e,r){if(this.state!==Cr.VIRGIN)return;const n=this.hot,i=n.rowIndexMapper.getRenderableFromVisualIndex(this.row),s=n.columnIndexMapper.getRenderableFromVisualIndex(this.col);if(n.view.scrollViewport(n._createCellCoords(i,s)),this.state=Cr.EDITING,this.isInFullEditMode()){const o=typeof e=="string"?e:Ar(this.originalValue);this.setValue(o)}this.open(r),this._opened=!0,this.focus(),n.view.render(),n.runHooks("afterBeginEditing",this.row,this.col)}finishEditing(e,r,n){let i;if(n){const s=this._closeCallback;this._closeCallback=o=>{s&&s(o),n(o),this.hot.view.render()}}if(!this.isWaiting()){if(this.state===Cr.VIRGIN){this.hot._registerTimeout(()=>{this._fireCallbacks(!0)});return}if(this.state===Cr.EDITING){if(e){this.cancelChanges(),this.hot.view.render();return}const s=this.getValue();this.cellProperties.trimWhitespace?i=[[typeof s=="string"?String.prototype.trim.call(s||""):s]]:i=[[s]],this.state=Cr.WAITING,this.saveValue(i,r),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",o=>{this.state=Cr.FINISHED,this.discardEditor(o)}):(this.state=Cr.FINISHED,this.discardEditor(!0))}}}cancelChanges(){this.state=Cr.FINISHED,this.discardEditor()}discardEditor(e){this.state===Cr.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.hot.selectCell(this.row,this.col),this.focus(),this.state=Cr.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Cr.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===Cr.WAITING}getEditedCellRect(){var e;const r=this.getEditedCell();if(!r)return;const{wtOverlays:n,wtViewport:i}=this.hot.view._wt,s=this.hot.rootWindow,o=Zr(r),a=Bt(r),l=Zr(this.hot.rootElement),c=Bt(this.hot.rootElement),u=n.topOverlay.holder,h=n.inlineStartOverlay.holder,d=u!==s?u.scrollTop:0,f=h!==s?h.scrollLeft:0,g=s.innerWidth-l.left-c,{wtTable:m}=(e=n.getParentOverlay(r))!==null&&e!==void 0?e:this.hot.view._wt,p=m.name,S=["master","inline_start"].includes(p)?d:0,y=["master","top","bottom"].includes(p)?f:0,C=o.top===l.top?0:1;let E=o.top-l.top-C-S,A=0;this.hot.isRtl()?A=s.innerWidth-o.left-a-g-1+y:A=o.left-l.left-1-y,["top","top_inline_start_corner"].includes(p)&&(E+=n.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(p)&&(A+=Math.abs(n.inlineStartOverlay.getOverlayOffset()));const O=this.hot.hasColHeaders(),T=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),W=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),Y=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(O&&T<=0||T===Y)&&(E+=1),W<=0&&(A+=1);const z=i.rowsRenderCalculator.startPosition,U=i.columnsRenderCalculator.startPosition,oe=Math.abs(n.inlineStartOverlay.getScrollPosition()),Ce=n.topOverlay.getScrollPosition(),pe=Qr(this.hot.rootDocument);let Te=r.offsetTop;if(["inline_start","master"].includes(p)&&(Te+=z-Ce),["bottom","bottom_inline_start_corner"].includes(p)){const{wtViewport:ne,wtTable:fe}=n.bottomOverlay.clone;Te+=ne.getWorkspaceHeight()-fe.getHeight()-pe}let Se=r.offsetLeft;this.hot.isRtl()?(Se>=0?Se=m.getWidth()-r.offsetLeft:Se=Math.abs(Se),Se+=U-oe-a):["top","master","bottom"].includes(p)&&(Se+=U-oe);const Ae=hl(this.TD,this.hot.rootWindow),q=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",Oe=parseInt(Ae[q],10)>0?0:1,v=parseInt(Ae.borderTopWidth,10)>0?0:1,w=Bt(r)+Oe,x=pr(r)+v,R=nJ(u)?pe:0,b=iJ(h)?pe:0,B=this.hot.view.maximumVisibleElementWidth(Se)-R+Oe,X=Math.max(this.hot.view.maximumVisibleElementHeight(Te)-b+v,23);return{top:E,start:A,height:x,maxHeight:X,width:w,maxWidth:B}}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 r="";return this.row<this.hot.getSettings().fixedRowsTop?this.col<this.hot.getSettings().fixedColumnsStart?r="top-inline-start-corner":r="top":this.hot.getSettings().fixedRowsBottom&&this.row>=e-this.hot.getSettings().fixedRowsBottom?this.col<this.hot.getSettings().fixedColumnsStart?r="bottom-inline-start-corner":r="bottom":this.col<this.hot.getSettings().fixedColumnsStart&&(r="inline-start"),r}}zt(xh,c2);const tse={name:"editorCloseAndSaveByArrowKeys",callback(t,e,r){const n=t._getEditorManager(),i=n.getActiveEditor();i.isInFullEditMode()&&i.state===Cr.EDITING||(n.closeEditorAndSaveChanges(),t.getSelected()&&(r.includes("arrowdown")?t.selection.transformStart(1,0):r.includes("arrowup")?t.selection.transformStart(-1,0):r.includes("arrowleft")?t.selection.transformStart(0,-1*t.getDirectionFactor()):r.includes("arrowright")&&t.selection.transformStart(0,t.getDirectionFactor())),e.preventDefault())}},rse={name:"editorCloseAndSaveByEnter",callback(t,e){const r=t._getEditorManager();r.closeEditorAndSaveChanges(e.ctrlKey||e.metaKey),r.moveSelectionAfterEnter(e)}},nse={name:"editorCloseWithoutSaving",callback(t){const e=t._getEditorManager();e.closeEditorAndRestoreOriginalValue(t.getShortcutManager().isCtrlPressed()),e.activeEditor.focus()}},ise={name:"editorFastOpen",callback(t,e){const{highlight:r}=t.getSelectedRangeLast();r.isHeader()||t._getEditorManager().openEditor(null,e,!0)}},sse={name:"editorOpen",callback(t,e,r){const n=t._getEditorManager(),i=t.getSelectedRangeLast(),{highlight:s}=i;if(t.selection.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0){const o=t.getSettings(),a=typeof o.enterMoves=="function"?o.enterMoves(e):o.enterMoves;r.includes("shift")?t.selection.transformFocus(-a.row,-a.col):t.selection.transformFocus(a.row,a.col);return}s.isHeader()||(t.getSettings().enterBeginsEditing?n.cellProperties.readOnly?n.moveSelectionAfterEnter(e):n.openEditor(null,e,!0):n.moveSelectionAfterEnter(e),Ps(e))}};function ose(){return[qie,tse,rse,nse,ise,sse]}const ase={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)}},lse={name:"extendCellsSelectionDownByViewportHeight",callback(t){const{to:e}=t.getSelectedRangeLast(),r=Math.min(e.row+t.countVisibleRows(),t.countRows()-1),n=t.rowIndexMapper.getNearestNotHiddenIndex(r,-1);if(n!==null){const i=t._createCellCoords(n,e.col),s=e.row-t.view.getFirstFullyVisibleRow(),o=Math.min(i.row-s,t.countRows()-1);t.selection.setRangeEnd(i),t.scrollViewportTo({row:o,verticalSnap:"top",horizontalSnap:"start"})}}},cse={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())}},use={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())}},hse={name:"extendCellsSelectionToColumns",callback(t){const{highlight:e,from:r,to:n}=t.getSelectedRangeLast();t.selection.isSelectedByRowHeader()?t.selection.selectAll(!0,!0):t.selectColumns(r.col,n.col,e)}},dse={name:"extendCellsSelectionToMostBottom",callback(t){const{selection:e,rowIndexMapper:r}=t,{highlight:n,from:i,to:s}=t.getSelectedRangeLast(),o=n.isHeader()&&t.selection.isSelectedByRowHeader();if(n.isCell()||o){const a=r.getNearestNotHiddenIndex(t.countRows()-1,-1),l=i.clone();l.row=n.row,e.setRangeStart(l,void 0,!1,n.clone()),o&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,s.col))}}},fse={name:"extendCellsSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:r}=t,{highlight:n,from:i,to:s}=t.getSelectedRangeLast();if(!t.selection.isSelectedByRowHeader()&&!t.selection.isSelectedByCorner()&&n.isCell()){const o=r.getNearestNotHiddenIndex(t.countCols()-1,-1),a=i.clone();a.col=n.col,e.setRangeStart(a,void 0,!1,n.clone()),e.setRangeEnd(t._createCellCoords(s.row,o))}}},gse={name:"extendCellsSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:r}=t,{highlight:n,from:i,to:s}=t.getSelectedRangeLast();if(!t.selection.isSelectedByRowHeader()&&!t.selection.isSelectedByCorner()&&n.isCell()){const o=parseInt(t.getSettings().fixedColumnsStart,10),a=r.getNearestNotHiddenIndex(o,1),l=i.clone();l.col=n.col,e.setRangeStart(l,void 0,!1,n.clone()),e.setRangeEnd(t._createCellCoords(s.row,a))}}},mse={name:"extendCellsSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:r}=t,{highlight:n,from:i,to:s}=t.getSelectedRangeLast(),o=n.isHeader()&&t.selection.isSelectedByColumnHeader();if(n.isCell()||o){const a=r.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]),l=i.clone();l.col=n.col,e.setRangeStart(l,void 0,!1,n.clone()),o&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(s.row,a))}}},pse={name:"extendCellsSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:r}=t,{highlight:n,from:i,to:s}=t.getSelectedRangeLast(),o=n.isHeader()&&t.selection.isSelectedByColumnHeader();if(n.isCell()||o){const a=r.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]),l=i.clone();l.col=n.col,e.setRangeStart(l,void 0,!1,n.clone()),o&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(s.row,a))}}},wse={name:"extendCellsSelectionToMostTop",callback(t){const{selection:e,rowIndexMapper:r}=t,{highlight:n,from:i,to:s}=t.getSelectedRangeLast(),o=n.isHeader()&&t.selection.isSelectedByRowHeader();if(n.isCell()||o){const a=r.getNearestNotHiddenIndex(0,1),l=i.clone();l.row=n.row,e.setRangeStart(l,void 0,!1,n.clone()),o&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,s.col))}}},vse={name:"extendCellsSelectionToRows",callback(t){const{highlight:e,from:r,to:n}=t.getSelectedRangeLast();t.selection.isSelectedByColumnHeader()?t.selection.selectAll(!0,!0):t.selectRows(r.row,n.row,e)}},Cse={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)}},Sse={name:"extendCellsSelectionUpByViewportHeight",callback(t){const{to:e}=t.getSelectedRangeLast(),r=Math.max(e.row-t.countVisibleRows(),0),n=t.rowIndexMapper.getNearestNotHiddenIndex(r,1);if(n!==null){const i=t._createCellCoords(n,e.col),s=e.row-t.view.getFirstFullyVisibleRow(),o=Math.max(i.row-s,0);t.selection.setRangeEnd(i),t.scrollViewportTo({row:o,verticalSnap:"top",horizontalSnap:"start"})}}};function xse(){return[ase,lse,cse,use,hse,dse,fse,gse,mse,pse,wse,vse,Cse,Sse]}const yse={name:"moveCellSelectionDown",callback(t){let{selection:e}=t;e.transformStart(1,0)}},bse={name:"moveCellSelectionDownByViewportHeight",callback(t){const{navigableHeaders:e}=t.getSettings(),r=e?t.countColHeaders():0,{row:n}=t.getSelectedRangeLast().highlight;let i=t.countVisibleRows()+r;n===t.countRows()-1?i=1:n+i>t.countRows()&&(i=t.countRows()-n-1),t.selection.transformStart(i,0),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}},Ese={name:"moveCellSelectionInlineEnd",callback(t,e){const r=t.getSettings(),n=t.getSelectedRangeLast(),i=typeof r.tabMoves=="function"?r.tabMoves(e):r.tabMoves;t.selection.isMultiple()&&!n.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?t.selection.transformFocus(-i.row,-i.col):t.selection.transformStart(-i.row,-i.col)}},Rse={name:"moveCellSelectionInlineStart",callback(t,e){const r=t.getSettings(),n=t.getSelectedRangeLast(),i=typeof r.tabMoves=="function"?r.tabMoves(e):r.tabMoves;t.selection.isMultiple()&&!n.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?t.selection.transformFocus(i.row,i.col):t.selection.transformStart(i.row,i.col)}},Tse={name:"moveCellSelectionLeft",callback(t){t.selection.transformStart(0,-1*t.getDirectionFactor())}},_se={name:"moveCellSelectionRight",callback(t){t.selection.transformStart(0,t.getDirectionFactor())}},Ase={name:"moveCellSelectionToMostBottom",callback(t){const{col:e}=t.getSelectedRangeLast().highlight;let r=t.rowIndexMapper.getNearestNotHiddenIndex(t.countRows()-1,-1);r===null&&(r=-1),t.selection.setRangeStart(t._createCellCoords(r,e))}},Mse={name:"moveCellSelectionToMostBottomInlineEnd",callback(t){const{selection:e,rowIndexMapper:r,columnIndexMapper:n}=t,i=parseInt(t.getSettings().fixedRowsBottom,10),s=r.getNearestNotHiddenIndex(t.countRows()-i-1,-1),o=n.getNearestNotHiddenIndex(t.countCols()-1,-1);e.setRangeStart(t._createCellCoords(s,o))}},Ise={name:"moveCellSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:r}=t;e.setRangeStart(t._createCellCoords(t.getSelectedRangeLast().highlight.row,r.getNearestNotHiddenIndex(t.countCols()-1,-1)))}},Ose={name:"moveCellSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:r}=t,n=parseInt(t.getSettings().fixedColumnsStart,10),i=t.getSelectedRangeLast().highlight.row,s=r.getNearestNotHiddenIndex(n,1);e.setRangeStart(t._createCellCoords(i,s))}},Pse={name:"moveCellSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:r}=t,n=t.getSelectedRangeLast().highlight.row;let i=r.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]);i===null&&(i=t.isRtl()?-1:-t.countRowHeaders()),e.setRangeStart(t._createCellCoords(n,i))}},Dse={name:"moveCellSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:r}=t,{row:n}=t.getSelectedRangeLast().highlight;let i=r.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]);i===null&&(i=t.isRtl()?-t.countRowHeaders():-1),e.setRangeStart(t._createCellCoords(n,i))}},kse={name:"moveCellSelectionToMostTop",callback(t){const{col:e}=t.getSelectedRangeLast().highlight;let r=t.rowIndexMapper.getNearestNotHiddenIndex(0,1);r===null&&(r=-t.countColHeaders()),t.selection.setRangeStart(t._createCellCoords(r,e))}},Nse={name:"moveCellSelectionToMostTopInlineStart",callback(t){const{selection:e,rowIndexMapper:r,columnIndexMapper:n}=t,i=parseInt(t.getSettings().fixedRowsTop,10),s=parseInt(t.getSettings().fixedColumnsStart,10),o=r.getNearestNotHiddenIndex(i,1),a=n.getNearestNotHiddenIndex(s,1);e.setRangeStart(t._createCellCoords(o,a))}},Hse={name:"moveCellSelectionUp",callback(t){let{selection:e}=t;e.transformStart(-1,0)}},Fse={name:"moveCellSelectionUpByViewportHight",callback(t){const{navigableHeaders:e}=t.getSettings(),r=e?t.countColHeaders():0,{row:n}=t.getSelectedRangeLast().highlight;let i=-(t.countVisibleRows()+r);n===-r?i=-1:n+i<r&&(i=-(n+r)),t.selection.transformStart(i,0),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}};function Lse(){return[yse,bse,Ese,Rse,Tse,_se,Ase,Mse,Ise,Ose,Pse,Dse,kse,Nse,Hse,Fse]}const $se={name:"emptySelectedCells",callback(t){t.emptySelectedCells(),t._getEditorManager().prepareEditor()}},Bse={name:"scrollToFocusedCell",callback(t){const{highlight:e}=t.getSelectedRangeLast(),r=t.view.getFirstFullyVisibleRow()-1,n=t.view.getFirstFullyVisibleColumn()-1,i=t.view.getLastFullyVisibleRow()+1,s=t.view.getLastFullyVisibleColumn()+1,o=t._createCellCoords(r,n),a=t._createCellCoords(i,s);if(!t._createCellRange(o,o,a).includes(e)&&(e.row>=0||e.col>=0)){const c={};if(e.col>=0){const u=Math.floor(t.countVisibleCols()/2);c.col=Math.max(e.col-u,0)}if(e.row>=0){const u=Math.floor(t.countVisibleRows()/2);c.row=Math.max(e.row-u,0)}t.scrollViewportTo({...c,verticalSnap:"top",horizontalSnap:"start"})}}},Vse={name:"selectAllCells",callback(t){t.selection.selectAll(!0,!0,{disableHeadersHighlight:!0})}},Wse={name:"selectAllCellsAndHeaders",callback(t){t.selection.selectAll(!0,!0,{disableHeadersHighlight:!1})}},Use={name:"populateSelectedCellsData",callback(t){const e=t.getSelectedRange(),{row:r,col:n}=e[e.length-1].highlight.normalize(),i=t.getDataAtCell(r,n),s=new Map;for(let o=0;o<e.length;o++)e[o].forAll((a,l)=>{if(a>=0&&l>=0&&(a!==r||l!==n)){const{readOnly:c}=t.getCellMeta(a,l);c||s.set(`${a}x${l}`,[a,l,i])}});t.setDataAtCell(Array.from(s.values()))}},Yse=[...ose(),...xse(),...Lse(),$se,Bse,Vse,Wse,Use];function u2(t){const e={};return Yse.forEach(r=>{let{name:n,callback:i}=r;e[n]=function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return i(t,...o)}}),e}function zse(t){const e=t.getShortcutManager().addContext("editor"),r=u2(t),n={group:Cl};e.addShortcuts([{keys:[["Enter"],["Enter","Shift"]],callback:(i,s)=>r.editorCloseAndSaveByEnter(i,s)},{keys:[["Enter","Control/Meta"],["Enter","Control/Meta","Shift"]],captureCtrl:!0,callback:(i,s)=>r.editorCloseAndSaveByEnter(i,s)},{keys:[["Tab"],["Tab","Shift"],["PageDown"],["PageUp"]],forwardToContext:t.getShortcutManager().getContext("grid"),callback:(i,s)=>r.editorCloseAndSave(i,s)},{keys:[["ArrowDown"],["ArrowUp"],["ArrowLeft"],["ArrowRight"]],preventDefault:!1,callback:(i,s)=>r.editorCloseAndSaveByArrowKeys(i,s)},{keys:[["Escape"],["Escape","Control/Meta"]],callback:()=>r.editorCloseWithoutSaving()}],n)}function Gse(t){const e=t.getShortcutManager().addContext("grid"),r=u2(t),n={runOnlyIf:()=>{const{navigableHeaders:i}=t.getSettings();return Le(t.getSelected())&&(i||!i&&t.countRenderedRows()>0&&t.countRenderedCols()>0)},group:l2};e.addShortcuts([{keys:[["F2"]],callback:i=>r.editorFastOpen(i)},{keys:[["Enter"],["Enter","Shift"]],callback:(i,s)=>r.editorOpen(i,s)},{keys:[["Backspace"],["Delete"]],callback:()=>r.emptySelectedCells()}],{group:Cl,runOnlyIf:()=>Le(t.getSelected())}),e.addShortcuts([{keys:[["Control/Meta","A"]],callback:()=>r.selectAllCells(),runOnlyIf:()=>!t.getSelectedRangeLast().highlight.isHeader()},{keys:[["Control/Meta","A"]],callback:()=>{},runOnlyIf:()=>t.getSelectedRangeLast().highlight.isHeader(),preventDefault:!0},{keys:[["Control/Meta","Shift","Space"]],callback:()=>r.selectAllCellsAndHeaders()},{keys:[["Control/Meta","Enter"]],callback:()=>r.populateSelectedCellsData(),runOnlyIf:()=>!t.getSelectedRangeLast().highlight.isHeader()&&t.getSelectedRangeLast().getCellsCount()>1},{keys:[["Control","Space"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToColumns()},{keys:[["Shift","Space"]],stopPropagation:!0,callback:()=>r.extendCellsSelectionToRows()},{keys:[["ArrowUp"]],callback:()=>r.moveCellSelectionUp()},{keys:[["ArrowUp","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostTop()},{keys:[["ArrowUp","Shift"]],callback:()=>r.extendCellsSelectionUp()},{keys:[["ArrowUp","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostTop(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowDown"]],callback:()=>r.moveCellSelectionDown()},{keys:[["ArrowDown","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostBottom()},{keys:[["ArrowDown","Shift"]],callback:()=>r.extendCellsSelectionDown()},{keys:[["ArrowDown","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostBottom(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowLeft"]],callback:()=>r.moveCellSelectionLeft()},{keys:[["ArrowLeft","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostLeft()},{keys:[["ArrowLeft","Shift"]],callback:()=>r.extendCellsSelectionLeft()},{keys:[["ArrowLeft","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostLeft(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["ArrowRight"]],callback:()=>r.moveCellSelectionRight()},{keys:[["ArrowRight","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostRight()},{keys:[["ArrowRight","Shift"]],callback:()=>r.extendCellsSelectionRight()},{keys:[["ArrowRight","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>r.extendCellsSelectionToMostRight(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["Home"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["Home","Shift"]],callback:()=>r.extendCellsSelectionToMostInlineStart()},{keys:[["Home","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostTopInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostInlineEnd(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End","Shift"]],callback:()=>r.extendCellsSelectionToMostInlineEnd()},{keys:[["End","Control/Meta"]],captureCtrl:!0,callback:()=>r.moveCellSelectionToMostBottomInlineEnd(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["PageUp"]],callback:()=>r.moveCellSelectionUpByViewportHight()},{keys:[["PageUp","Shift"]],callback:()=>r.extendCellsSelectionUpByViewportHeight()},{keys:[["PageDown"]],callback:()=>r.moveCellSelectionDownByViewportHeight()},{keys:[["PageDown","Shift"]],callback:()=>r.extendCellsSelectionDownByViewportHeight()},{keys:[["Tab"]],preventDefault:!1,callback:i=>r.moveCellSelectionInlineStart(i)},{keys:[["Shift","Tab"]],preventDefault:!1,callback:i=>r.moveCellSelectionInlineEnd(i)},{keys:[["Control/Meta","Backspace"]],callback:()=>r.scrollToFocusedCell()}],n)}function jse(t){[Gse,zse].forEach(e=>e(t))}function Kse(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=t.rootElement,n=nM(t),i=nM(t);return n.addEventListener("focus",()=>e?.onFocusFromTop()),i.addEventListener("focus",()=>e?.onFocusFromBottom()),r.firstChild.before(n),r.lastChild.after(i),{activate(){t._registerTimeout(()=>{n.tabIndex=0,i.tabIndex=0},10)},deactivate(){t._registerTimeout(()=>{n.tabIndex=-1,i.tabIndex=-1},10)}}}function nM(t){const r=t.rootDocument.createElement("input");return r.type="text",r.classList.add("htFocusCatcher"),t.getSettings().ariaTags&&Xe(r,[co(),fa()]),r}function Xse(t){const e=qse(t);let r;const{activate:n,deactivate:i}=Kse(t,{onFocusFromTop(){var h;const d=(h=e(r))!==null&&h!==void 0?h:kS(t);d&&(t.runHooks("modifyFocusOnTabNavigation","from_above",d),t.selectCell(d.row,d.col)),t.listen()},onFocusFromBottom(){var h;const d=(h=e(r))!==null&&h!==void 0?h:NS(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",()=>i()),t.addHook("afterUnlisten",()=>n()),t.addHook("afterSelection",(h,d,f,g,m)=>{if(a&&(s.wrapped&&s.flipped||l)&&(l=!1,m.value=!0),o){var p;r=(p=t.getSelectedRangeLast())===null||p===void 0?void 0:p.highlight}}),t.addHook("beforeRowWrap",(h,d,f)=>{s.wrapped=!0,s.flipped=f});function c(){s.wrapped=!1,s.flipped=!1,t.deselectCell(),t.unlisten()}const u={keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:l2,group:"focusCatcher"};t.getShortcutManager().getContext("grid").addShortcuts([{...u,callback:()=>{const{tabNavigation:h}=t.getSettings();a=!0,t.getSelectedRangeLast()&&!h&&(o=!1),h||(l=!0)},position:"before"},{...u,callback:h=>{const{tabNavigation:d,autoWrapRow:f}=t.getSettings();if(a=!1,o=!0,!d||!t.selection.isSelected()||f&&s.wrapped&&s.flipped||!f&&s.wrapped)return f&&s.wrapped&&s.flipped&&(r=h.shiftKey?kS(t):NS(t)),c(),!1;h.preventDefault()},position:"after"}])}function kS(t){const{rowIndexMapper:e,columnIndexMapper:r}=t,{navigableHeaders:n}=t.getSettings();let i=n&&t.countColHeaders()>0?-t.countColHeaders():0,s=n&&t.countRowHeaders()>0?-t.countRowHeaders():0;return i===0&&(i=e.getVisualFromRenderableIndex(i)),s===0&&(s=r.getVisualFromRenderableIndex(s)),i===null||s===null?null:t._createCellCoords(i,s)}function NS(t){var e,r;const{rowIndexMapper:n,columnIndexMapper:i}=t,{navigableHeaders:s}=t.getSettings();let o=n.getRenderableIndexesLength()-1,a=i.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=n.getVisualFromRenderableIndex(o))!==null&&e!==void 0?e:o,(r=i.getVisualFromRenderableIndex(a))!==null&&r!==void 0?r:a)}function qse(t){return e=>{if(!e)return null;const r=kS(t),n=NS(t);return e.col<r.col&&(e.col=r.col),e.col>n.col&&(e.col=n.col),e.row<r.row&&(e.row=r.row),e.row>n.row&&(e.row=n.row),e}}function Zse(t){return e=>{let{col:r}=e;t.scrollViewportTo({col:r})}}function Jse(){return()=>{}}function Qse(t){return e=>{t.scrollViewportTo(e.toObject())}}function eoe(t){return e=>{t.scrollViewportTo(e.toObject())}}function toe(t){return e=>{t.scrollViewportTo(e.toObject())}}function roe(t){return e=>{let{row:r}=e;t.scrollViewportTo({row:r})}}function noe(t){return e=>{const r=t.selection.getSelectionSource(),{row:n,col:i}=e;if(n<0&&i>=0)t.scrollViewportTo({col:i});else if(i<0&&n>=0)t.scrollViewportTo({row:n});else{if(r==="mouse"&&(i===t.view.getLastPartiallyVisibleColumn()||n===t.view.getLastPartiallyVisibleRow()))return;t.scrollViewportTo({row:n,col:i})}}}function ioe(t){const{selection:e}=t;let r=!1,n=!1;return{resume(){n=!1},suspend(){n=!0},skipNextScrollCycle(){r=!0},scrollTo(i){var s;if(r||n){r=!1;return}let o;e.isFocusSelectionChanged()?o=Qse(t):e.isSelectedByCorner()?o=Jse():e.isSelectedByRowHeader()?o=roe(t):e.isSelectedByColumnHeader()?o=Zse(t):e.getSelectedRange().size()===1&&e.isMultiple()?o=eoe(t):e.getSelectedRange().size()===1&&!e.isMultiple()?o=noe(t):e.getSelectedRange().size()>1&&(o=toe(t)),(s=o)===null||s===void 0||s(i)}}}const iM=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"]]),O0=t=>t.map(e=>{const r=e.toLowerCase();return iM.has(r)?iM.get(r):r}).sort().join("+"),soe=t=>t.split("+"),sM=new RegExp("^(?:Key|Digit)([A-Z0-9])$"),ooe=new Set(["Backquote","Minus","Equal","BracketLeft","BracketRight","Backslash","Semicolon","Quote","Comma","Period","Slash"]),TC=t=>{let{key:e,code:r}=t,n=e;return sM.test(r)?n=r.replace(sM,"$1"):ooe.has(r)&&(n=r),n.toLowerCase()},h2=Symbol("shortcut-context");function d2(t){return at(t)&&t.__kindOf===h2}const aoe=t=>{const e=Aw({errorIdExists:l=>`The "${l}" shortcut is already registered in the "${t}" context.`}),r=function(){let{keys:l,callback:c,group:u,runOnlyIf:h=()=>!0,captureCtrl:d=!1,preventDefault:f=!0,stopPropagation:g=!1,relativeToGroup:m,position:p,forwardToContext:S}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Zt(u))throw new Error("You need to define the shortcut's group.");if(Xt(c)===!1)throw new Error("The shortcut's callback needs to be a function.");if(Array.isArray(l)===!1)throw new Error(Dt`Pass the shortcut\'s keys as an array of arrays,\x20
  96. using the KeyboardEvent.key properties:\x20
  97. https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.`);const y={callback:c,group:u,runOnlyIf:h,captureCtrl:d,preventDefault:f,stopPropagation:g};Le(m)&&(y.relativeToGroup=m,y.position=p),d2(S)&&(y.forwardToContext=S),l.forEach(C=>{const E=O0(C);if(e.hasItem(E)){const O=e.getItem(E);let T=O.findIndex(W=>W.group===m);T!==-1?p==="before"?T-=1:T+=1:T=O.length,O.splice(T,0,y)}else e.addItem(E,[y])})},n=function(l){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l.forEach(u=>{dt(c,(h,d)=>{Object.prototype.hasOwnProperty.call(u,d)===!1&&(u[d]=c[d])}),r(u)})},i=l=>{const c=O0(l);e.removeItem(c)};return{__kindOf:h2,addShortcut:r,addShortcuts:n,getShortcuts:l=>{const c=O0(l),u=e.getItem(c);return Le(u)?u.slice():[]},hasShortcut:l=>{const c=O0(l);return e.hasItem(c)},removeShortcutsByKeys:i,removeShortcutsByGroup:l=>{e.getItems().forEach(u=>{let[h,d]=u;const f=d.filter(g=>g.group!==l);f.length===0?i(soe(h)):(d.length=0,d.push(...f))})}}};function loe(){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 coe=["meta","alt","shift","control"],Zh=loe(),Jh=[];let P0=0;function uoe(t,e,r,n,i){const s=f=>coe.includes(f),o=function(f){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const m=[];return f.altKey&&m.push("alt"),g&&(f.ctrlKey||f.metaKey)?m.push("control/meta"):(f.ctrlKey&&m.push("control"),f.metaKey&&m.push("meta")),f.shiftKey&&m.push("shift"),m},a=f=>{if(e(f)===!1)return;const g=r(f);if(f.keyCode===229||g===!1||sc(f))return;const m=TC(f);let p=[];s(m)||(p=o(f));const S=[m].concat(p);!i(f,S)&&(xS()&&p.includes("meta")||!xS()&&p.includes("control"))&&i(f,[m].concat(o(f,!0))),n(f)},l=f=>{if(f.key){const g=TC(f);s(g)&&Zh.press(g)}},c=f=>{if(f.key){const g=TC(f);s(g)&&Zh.release(g)}},u=()=>{Zh.releaseAll()};return{mount:()=>{let f=t;for(P0+=1;f;)P0===1&&(f.document.documentElement.addEventListener("keydown",l),Jh.push({event:"keydown",listener:l}),f.document.documentElement.addEventListener("keyup",c),Jh.push({event:"keyup",listener:c})),f.document.documentElement.addEventListener("keydown",a),f.document.documentElement.addEventListener("blur",u),f=sh(f)},unmount:()=>{let f=t;for(P0-=1;f;){if(P0===0){for(let g=0;g<Jh.length;g++){const{event:m,listener:p}=Jh[g];f.document.documentElement.removeEventListener(m,p)}Jh.length=0}f.document.documentElement.removeEventListener("keydown",a),f.document.documentElement.removeEventListener("blur",u),f=sh(f)}},isPressed:f=>Zh.isPressed(f),releasePressedKeys:()=>Zh.releaseAll()}}const hoe=t=>{let{ownerWindow:e,handleEvent:r,beforeKeyDown:n,afterKeyDown:i}=t;const s=Aw({errorIdExists:g=>`The "${g}" context name is already registered.`});let o="grid";const a=g=>{const m=aoe(g);return s.addItem(g,m),m},l=()=>o,c=g=>s.getItem(g),u=g=>{if(!s.hasItem(g))throw new Error(Dt`You've tried to activate the "${g}" shortcut context\x20
  98. that does not exist. Before activation, register the context using the "addContext" method.`);o=g};let h=!1;const d=function(g,m){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l();const S=d2(p)?p:c(p);let y=!1;if(!S.hasShortcut(m))return y;const C=S.getShortcuts(m);for(let E=0;E<C.length;E++){const{callback:A,runOnlyIf:O,preventDefault:T,stopPropagation:W,captureCtrl:I,forwardToContext:Y}=C[E];if(O(g)===!0){if(h=I,y=A(g,m)===!1,h=!1,T&&g.preventDefault(),W&&(Ps(g),g.stopPropagation()),y)break;Y&&d(g,m,Y)}}return y},f=uoe(e,r,n,i,d);return f.mount(),{addContext:a,getActiveContextName:l,getContext:c,setActiveContextName:u,isCtrlPressed:()=>!h&&(f.isPressed("control")||f.isPressed("meta")),releasePressedKeys:()=>f.releasePressedKeys(),destroy:()=>f.unmount()}};let _C=null;const AC=new Map;function f2(t,e){var r,n=this;let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=this;const o=new As(s);let a,l,c,u,h,d,f=!0;Kre(i)&&jre(this),this.rootElement=t,this.rootDocument=t.ownerDocument,this.rootWindow=this.rootDocument.defaultView,this.isDestroyed=!1,this.renderSuspendedCounter=0,this.executionSuspendedCounter=0;const g=(r=e?.layoutDirection)!==null&&r!==void 0?r:"inherit",m=["rtl","ltr"].includes(g)?g:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",m),this.isRtl=function(){return m==="rtl"},this.isLtr=function(){return!s.isRtl()},this.getDirectionFactor=function(){return s.isLtr()?1:-1},e.language=Vne(e.language);const p=new a2(s,e,[Wie,Xie]),S=p.getTableMeta(),y=p.getGlobalMeta(),C=Aw();this.container=this.rootDocument.createElement("div"),this.renderCall=!1,t.insertBefore(this.container,t.firstChild),km(this)&&bZ(e.licenseKey,t),this.guid=`ht_${Pk()}`,AC.set(this.guid,this),this.columnIndexMapper=new OS,this.rowIndexMapper=new OS,this.columnIndexMapper.addLocalHook("indexesSequenceChange",v=>{s.runHooks("afterColumnSequenceChange",v)}),this.rowIndexMapper.addLocalHook("indexesSequenceChange",v=>{s.runHooks("afterRowSequenceChange",v)}),l=new one(s),(!this.rootElement.id||this.rootElement.id.substring(0,3)==="ht_")&&(this.rootElement.id=this.guid);const E=v=>{const{row:w,col:x}=v;return s._createCellCoords(w>=0?s.rowIndexMapper.getRenderableFromVisualIndex(w):w,x>=0?s.columnIndexMapper.getRenderableFromVisualIndex(x):x)},A=v=>{const{row:w,col:x}=v;return s._createCellCoords(w>=0?s.rowIndexMapper.getVisualFromRenderableIndex(w):w,x>=0?s.columnIndexMapper.getVisualFromRenderableIndex(x):x)},O=(v,w)=>{const x=w>v?1:-1,R=Math.min(v,w),b=Math.max(v,w),B=s.rowIndexMapper.getNearestNotHiddenIndex(v,x);return B===null||x===1&&B>b||x===-1&&B<R?null:B>=0?s.rowIndexMapper.getRenderableFromVisualIndex(B):B},T=(v,w)=>{const x=w>v?1:-1,R=Math.min(v,w),b=Math.max(v,w),B=s.columnIndexMapper.getNearestNotHiddenIndex(v,x);return B===null||x===1&&B>b||x===-1&&B<R?null:B>=0?s.columnIndexMapper.getRenderableFromVisualIndex(B):B};let W=new i2(S,{rowIndexMapper:s.rowIndexMapper,columnIndexMapper:s.columnIndexMapper,countCols:()=>s.countCols(),countRows:()=>s.countRows(),propToCol:v=>a.propToCol(v),isEditorOpened:()=>s.getActiveEditor()?s.getActiveEditor().isOpened():!1,countRenderableColumns:()=>this.view.countRenderableColumns(),countRenderableRows:()=>this.view.countRenderableRows(),countRowHeaders:()=>this.countRowHeaders(),countColHeaders:()=>this.countColHeaders(),countRenderableRowsInRange:function(){return n.view.countRenderableRowsInRange(...arguments)},countRenderableColumnsInRange:function(){return n.view.countRenderableColumnsInRange(...arguments)},getShortcutManager:()=>s.getShortcutManager(),createCellCoords:(v,w)=>s._createCellCoords(v,w),createCellRange:(v,w,x)=>s._createCellRange(v,w,x),visualToRenderableCoords:E,renderableToVisualCoords:A,findFirstNonHiddenRenderableRow:O,findFirstNonHiddenRenderableColumn:T,isDisabledCellSelection:(v,w)=>v<0||w<0?s.getSettings().disableVisualSelection:s.getCellMeta(v,w).disableVisualSelection});this.selection=W;const I=v=>{let{hiddenIndexesChanged:w}=v;w&&this.selection.commit()};this.columnIndexMapper.addLocalHook("cacheUpdated",I),this.rowIndexMapper.addLocalHook("cacheUpdated",I),this.selection.addLocalHook("afterSetRangeEnd",(v,w)=>{const x=Ss(!1),R=this.selection.getSelectedRange(),{from:b,to:B}=R.current(),X=R.size()-1;this.runHooks("afterSelection",b.row,b.col,B.row,B.col,x,X),this.runHooks("afterSelectionByProp",b.row,s.colToProp(b.col),B.row,s.colToProp(B.col),x,X),w&&(!x.isTouched()||x.isTouched()&&!x.value)&&d.scrollTo(v);const ne=W.isSelectedByRowHeader(),fe=W.isSelectedByColumnHeader();ne&&fe?Re(this.rootElement,["ht__selection--rows","ht__selection--columns"]):ne?(rt(this.rootElement,"ht__selection--columns"),Re(this.rootElement,"ht__selection--rows")):fe?(rt(this.rootElement,"ht__selection--rows"),Re(this.rootElement,"ht__selection--columns")):rt(this.rootElement,["ht__selection--rows","ht__selection--columns"]),W.getSelectionSource()!=="shift"&&u.closeEditor(null),s.view.render(),u.prepareEditor()}),this.selection.addLocalHook("beforeSetFocus",v=>{this.runHooks("beforeSelectionFocusSet",v.row,v.col)}),this.selection.addLocalHook("afterSetFocus",v=>{const w=Ss(!1);this.runHooks("afterSelectionFocusSet",v.row,v.col,w),(!w.isTouched()||w.isTouched()&&!w.value)&&d.scrollTo(v),u.closeEditor(),s.view.render(),u.prepareEditor()}),this.selection.addLocalHook("afterSelectionFinished",v=>{const w=v.length-1,{from:x,to:R}=v[w];this.runHooks("afterSelectionEnd",x.row,x.col,R.row,R.col,w),this.runHooks("afterSelectionEndByProp",x.row,s.colToProp(x.col),R.row,s.colToProp(R.col),w)}),this.selection.addLocalHook("afterIsMultipleSelection",v=>{const w=this.runHooks("afterIsMultipleSelection",v.value);v.value&&(v.value=w)}),this.selection.addLocalHook("afterDeselect",()=>{u.closeEditor(),s.view.render(),rt(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this.runHooks("afterDeselect")}),this.selection.addLocalHook("beforeHighlightSet",()=>this.runHooks("beforeSelectionHighlightSet")).addLocalHook("beforeSetRangeStart",function(){for(var v=arguments.length,w=new Array(v),x=0;x<v;x++)w[x]=arguments[x];return n.runHooks("beforeSetRangeStart",...w)}).addLocalHook("beforeSetRangeStartOnly",function(){for(var v=arguments.length,w=new Array(v),x=0;x<v;x++)w[x]=arguments[x];return n.runHooks("beforeSetRangeStartOnly",...w)}).addLocalHook("beforeSetRangeEnd",function(){for(var v=arguments.length,w=new Array(v),x=0;x<v;x++)w[x]=arguments[x];return n.runHooks("beforeSetRangeEnd",...w)}).addLocalHook("beforeSelectColumns",function(){for(var v=arguments.length,w=new Array(v),x=0;x<v;x++)w[x]=arguments[x];return n.runHooks("beforeSelectColumns",...w)}).addLocalHook("afterSelectColumns",function(){for(var v=arguments.length,w=new Array(v),x=0;x<v;x++)w[x]=arguments[x];return n.runHooks("afterSelectColumns",...w)}).addLocalHook("beforeSelectRows",function(){for(var v=arguments.length,w=new Array(v),x=0;x<v;x++)w[x]=arguments[x];return n.runHooks("beforeSelectRows",...w)}).addLocalHook("afterSelectRows",function(){for(var v=arguments.length,w=new Array(v),x=0;x<v;x++)w[x]=arguments[x];return n.runHooks("afterSelectRows",...w)}).addLocalHook("beforeModifyTransformStart",function(){for(var v=arguments.length,w=new Array(v),x=0;x<v;x++)w[x]=arguments[x];return n.runHooks("modifyTransformStart",...w)}).addLocalHook("afterModifyTransformStart",function(){for(var v=arguments.length,w=new Array(v),x=0;x<v;x++)w[x]=arguments[x];return n.runHooks("afterModifyTransformStart",...w)}).addLocalHook("beforeModifyTransformFocus",function(){for(var v=arguments.length,w=new Array(v),x=0;x<v;x++)w[x]=arguments[x];return n.runHooks("modifyTransformFocus",...w)}).addLocalHook("afterModifyTransformFocus",function(){for(var v=arguments.length,w=new Array(v),x=0;x<v;x++)w[x]=arguments[x];return n.runHooks("afterModifyTransformFocus",...w)}).addLocalHook("beforeModifyTransformEnd",function(){for(var v=arguments.length,w=new Array(v),x=0;x<v;x++)w[x]=arguments[x];return n.runHooks("modifyTransformEnd",...w)}).addLocalHook("afterModifyTransformEnd",function(){for(var v=arguments.length,w=new Array(v),x=0;x<v;x++)w[x]=arguments[x];return n.runHooks("afterModifyTransformEnd",...w)}).addLocalHook("beforeRowWrap",function(){for(var v=arguments.length,w=new Array(v),x=0;x<v;x++)w[x]=arguments[x];return n.runHooks("beforeRowWrap",...w)}).addLocalHook("beforeColumnWrap",function(){for(var v=arguments.length,w=new Array(v),x=0;x<v;x++)w[x]=arguments[x];return n.runHooks("beforeColumnWrap",...w)}).addLocalHook("insertRowRequire",v=>this.alter("insert_row_above",v,1,"auto")).addLocalHook("insertColRequire",v=>this.alter("insert_col_start",v,1,"auto")),c={alter(v,w){var x,R;let b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,B=arguments.length>3?arguments[3]:void 0,X=arguments.length>4?arguments[4]:void 0;const ne=fe=>{if(fe.length===0)return[];const le=[...fe];return le.sort((N,Fe)=>{let[ie]=N,[Be]=Fe;return ie===Be?0:ie>Be?1:-1}),Rn(le,(N,Fe)=>{let[ie,Be]=Fe;const Ie=N[N.length-1],[xe,Ye]=Ie,Ve=xe+Ye;if(ie<=Ve){const M=Math.max(Be-(Ve-ie),0);Ie[1]+=M}else N.push([ie,Be]);return N},[le[0]])};switch(v){case"insert_row_below":case"insert_row_above":const fe=s.countSourceRows();if(S.maxRows===fe)return;const le=v==="insert_row_below"?"below":"above";w=(x=w)!==null&&x!==void 0?x:le==="below"?fe:0;const{delta:we,startPhysicalIndex:N}=a.createRow(w,b,{source:B,mode:le});W.shiftRows(s.toVisualRow(N),we);break;case"insert_col_start":case"insert_col_end":const Fe=v==="insert_col_end"?"end":"start";w=(R=w)!==null&&R!==void 0?R:Fe==="end"?s.countSourceCols():0;const{delta:ie,startPhysicalIndex:Be}=a.createCol(w,b,{source:B,mode:Fe});if(ie){if(Array.isArray(S.colHeaders)){const Ye=[s.toVisualColumn(Be),0];Ye.length+=ie,Array.prototype.splice.apply(S.colHeaders,Ye)}W.shiftColumns(s.toVisualColumn(Be),ie)}break;case"remove_row":const Ie=Ye=>{let Ve=0;j(Ye,M=>{let[D,G]=M;const re=yr(D)?s.countRows()-1:Math.max(D-Ve,0);if(Number.isInteger(D)&&(D=Math.max(D-Ve,0)),!a.removeRow(D,G,B))return;if(W.isSelected()){const{row:ee}=s.getSelectedRangeLast().highlight;ee>=D&&ee<=D+G-1&&u.closeEditor(!0)}const se=s.countRows();se===0?W.deselect():B==="ContextMenu.removeRow"?W.refresh():W.shiftRows(D,-G);const J=S.fixedRowsTop;J>=re+1&&(S.fixedRowsTop-=Math.min(G,J-re));const Z=S.fixedRowsBottom;Z&&re>=se-Z&&(S.fixedRowsBottom-=Math.min(G,Z)),Ve+=G})};Array.isArray(w)?Ie(ne(w)):Ie([[w,b]]);break;case"remove_col":const xe=Ye=>{let Ve=0;j(Ye,M=>{let[D,G]=M;const re=yr(D)?s.countCols()-1:Math.max(D-Ve,0);let K=s.toPhysicalColumn(re);if(Number.isInteger(D)&&(D=Math.max(D-Ve,0)),!a.removeCol(D,G,B))return;if(W.isSelected()){const{col:ee}=s.getSelectedRangeLast().highlight;ee>=D&&ee<=D+G-1&&u.closeEditor(!0)}s.countCols()===0?W.deselect():B==="ContextMenu.removeColumn"?W.refresh():W.shiftColumns(D,-G);const Z=S.fixedColumnsStart;Z>=re+1&&(S.fixedColumnsStart-=Math.min(G,Z-re)),Array.isArray(S.colHeaders)&&(typeof K>"u"&&(K=-1),S.colHeaders.splice(K,G)),Ve+=G})};Array.isArray(w)?xe(ne(w)):xe([[w,b]]);break;default:throw new Error(`There is no such action "${v}"`)}s.view.render(),X||c.adjustRowsAndCols()},adjustRowsAndCols(){const v=S.minRows,w=S.minSpareRows,x=S.minCols,R=S.minSpareCols;if(v){const b=s.countRows();b<v&&a.createRow(b,v-b,{source:"auto"})}if(w){const b=s.countEmptyRows(!0);if(b<w){const B=w-b,X=Math.min(B,S.maxRows-s.countSourceRows());a.createRow(s.countRows(),X,{source:"auto"})}}{let b;(x||R)&&(b=s.countEmptyCols(!0));let B=s.countCols();if(x&&!S.columns&&B<x){const X=x-B;b+=X,a.createCol(B,X,{source:"auto"})}if(R&&!S.columns&&s.dataType==="array"&&b<R){B=s.countCols();const X=R-b,ne=Math.min(X,S.maxCols-B);a.createCol(B,ne,{source:"auto"})}}s.view&&s.view.adjustElementsSize()},populateFromArray(v,w,x,R,b){let B,X,ne,fe;const le=[],we={},N=[],Fe=v.row,ie=v.col;if(X=w.length,X===0)return!1;let Be=0,Ie=0;switch(at(x)&&(Be=x.col-ie+1,Ie=x.row-Fe+1),b){case"shift_down":const xe=Om(w),Ye=xe.length,Ve=Math.max(Ye,Be),M=s.getData().slice(Fe),D=Om(M).slice(ie,ie+Ve);for(ne=0;ne<Ve;ne+=1)if(ne<Ye){for(B=0,X=xe[ne].length;B<Ie-X;B+=1)xe[ne].push(xe[ne][B%X]);ne<D.length?N.push(xe[ne].concat(D[ne])):N.push(xe[ne].concat(new Array(M.length).fill(null)))}else N.push(xe[ne%Ye].concat(D[ne]));s.populateFromArray(Fe,ie,Om(N));break;case"shift_right":const G=w.length,re=Math.max(G,Ie),K=s.getData().slice(Fe).map(Me=>Me.slice(ie));for(B=0;B<re;B+=1)if(B<G){for(ne=0,fe=w[B].length;ne<Be-fe;ne+=1)w[B].push(w[B][ne%fe]);if(B<K.length)for(let Me=0;Me<K[B].length;Me+=1)w[B].push(K[B][Me]);else w[B].push(...new Array(K[0].length).fill(null))}else w.push(w[B%X].slice(0,re).concat(K[B]));s.populateFromArray(Fe,ie,w);break;case"overwrite":default:we.row=v.row,we.col=v.col;let se=0,J=0,Z=!0,ee;const te=function(Pe){let Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const vt=w[Pe%w.length];return Je!==null?vt[Je%vt.length]:vt},Q=w.length,ye=x?x.row-v.row+1:0;for(x?X=ye:X=Math.max(Q,ye),B=0;B<X&&!(x&&we.row>x.row&&ye>Q||!S.allowInsertRow&&we.row>s.countRows()-1||we.row>=S.maxRows);B++){const Me=B-se,Pe=te(Me).length,Je=x?x.col-v.col+1:0;if(x?fe=Je:fe=Math.max(Pe,Je),we.col=v.col,ee=s.getCellMeta(we.row,we.col),(R==="CopyPaste.paste"||R==="Autofill.fill")&&ee.skipRowOnPaste){se+=1,we.row+=1,X+=1;continue}for(J=0,ne=0;ne<fe&&!(x&&we.col>x.col&&Je>Pe||!S.allowInsertColumn&&we.col>s.countCols()-1||we.col>=S.maxCols);ne++){if(ee=s.getCellMeta(we.row,we.col),(R==="CopyPaste.paste"||R==="Autofill.fill")&&ee.skipColumnOnPaste){J+=1,we.col+=1,fe+=1;continue}if(ee.readOnly&&R!=="UndoRedo.undo"){we.col+=1;continue}const vt=ne-J;let st=te(Me,vt),qe=s.getDataAtCell(we.row,we.col);if(st!==null&&typeof st=="object")if(Array.isArray(st)&&qe===null&&(qe=[]),qe===null||typeof qe!="object")Z=!1;else{const Ct=Hf(Array.isArray(qe)?qe:qe[0]||qe),Gt=Hf(Array.isArray(st)?st:st[0]||st);Oy(Ct,Gt)||Array.isArray(Ct)&&Array.isArray(Gt)?st=Vn(st):Z=!1}else qe!==null&&typeof qe=="object"&&(Z=!1);Z&&le.push([we.row,we.col,st]),Z=!0,we.col+=1}we.row+=1}s.setDataAtCell(le,null,null,R||"populateFromArray");break}}};function Y(v){const w=GN(v);kE(w)?(s.runHooks("beforeLanguageChange",w),y.language=w,s.runHooks("afterLanguageChange",w)):jN(v)}function z(v,w){const x=v==="className"?s.rootElement:s.table;if(f)Re(x,w);else{let R=[],b=[];y[v]&&(R=Array.isArray(y[v])?y[v]:N_(y[v])),w&&(b=Array.isArray(w)?w:N_(w));const B=k_(R,b),X=k_(b,R);B.length&&rt(x,B),X.length&&Re(x,X)}y[v]=w}this.init=function(){l.setData(S.data),s.runHooks("beforeInit"),(Qa()||oN())&&Re(s.rootElement,"mobile"),this.updateSettings(S,!0),this.view=new Jre(this),u=_S.getInstance(s,S,W),d=ioe(s),h=new xQ(s),km(this)&&Xse(s),s.runHooks("init"),this.forceFullRender=!0,this.view.render(),f&&s.rootElement.offsetParent===null&&sJ(s.rootElement,()=>{s.view._wt.wtOverlays.updateLastSpreaderSize(),s.render(),s.view.adjustElementsSize()}),typeof f=="object"&&(s.runHooks("afterChange",f[0],f[1]),f=!1),s.runHooks("afterInit")};function U(){let v=!1;return{validatorsInQueue:0,valid:!0,addValidatorToQueue(){this.validatorsInQueue+=1,v=!1},removeValidatorFormQueue(){this.validatorsInQueue=this.validatorsInQueue-1<0?0:this.validatorsInQueue-1,this.checkIfQueueIsEmpty()},onQueueEmpty(){},checkIfQueueIsEmpty(){this.validatorsInQueue===0&&v===!1&&(v=!0,this.onQueueEmpty(this.valid))}}}function oe(v){const w=v.replace(",",".");return isNaN(parseFloat(w))===!1?parseFloat(w):v}function Ce(v,w,x){if(!v.length)return;const R=s.getActiveEditor(),b=new U;let B=!0;b.onQueueEmpty=X=>{R&&B&&R.cancelChanges(),x(X)};for(let X=v.length-1;X>=0;X--){const[ne,fe,,le]=v[X],we=a.propToCol(fe);let N;Number.isInteger(we)?N=s.getCellMeta(ne,we):N={...Object.getPrototypeOf(S),...S},N.type==="numeric"&&typeof le=="string"&&nee(le)&&(v[X][3]=oe(le)),s.getCellValidator(N)&&(b.addValidatorToQueue(),s.validateCell(v[X][3],N,function(Fe,ie){return function(Be){if(typeof Be!="boolean")throw new Error("Validation error: result is not boolean");if(Be===!1&&ie.allowInvalid===!1){B=!1,v.splice(Fe,1),ie.valid=!0;const Ie=s.getCell(ie.visualRow,ie.visualCol);Ie!==null&&rt(Ie,S.invalidCellClassName)}b.removeValidatorFormQueue()}}(X,N),w))}b.checkIfQueueIsEmpty()}function pe(v,w){let x=v.length-1;if(x<0)return;for(;x>=0;x--){let b=!1;if(v[x]===null){v.splice(x,1);continue}if(!((v[x][2]===null||v[x][2]===void 0)&&(v[x][3]===null||v[x][3]===void 0))){if(S.allowInsertRow)for(;v[x][0]>s.countRows()-1;){const{delta:B}=a.createRow(void 0,void 0,{source:w});if(B===0){b=!0;break}}if(s.dataType==="array"&&(!S.columns||S.columns.length===0)&&S.allowInsertColumn)for(;a.propToCol(v[x][1])>s.countCols()-1;){const{delta:B}=a.createCol(void 0,void 0,{source:w});if(B===0){b=!0;break}}b||a.set(v[x][0],v[x][1],v[x][3])}}s.forceFullRender=!0,c.adjustRowsAndCols(),s.runHooks("beforeChangeRender",v,w),u.closeEditor(),s.view.render(),u.prepareEditor(),s.view.adjustElementsSize(),s.runHooks("afterChange",v,w||"edit");const R=s.getActiveEditor();R&&Le(R.refreshValue)&&R.refreshValue()}this._createCellCoords=function(v,w){return s.view._wt.createCellCoords(v,w)},this._createCellRange=function(v,w,x){return s.view._wt.createCellRange(v,w,x)},this.validateCell=function(v,w,x,R){let b=s.getCellValidator(w);function B(X){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)||w.hidden===!0){x(X);return}const fe=w.visualCol,le=w.visualRow,we=s.getCell(le,fe,!0);if(we&&we.nodeName!=="TH"){const N=s.rowIndexMapper.getRenderableFromVisualIndex(le),Fe=s.columnIndexMapper.getRenderableFromVisualIndex(fe);s.view._wt.getSetting("cellRenderer",N,Fe,we)}x(X)}SZ(b)&&(b=function(X){return function(ne,fe){fe(X.test(ne))}}(b)),Xt(b)?(v=s.runHooks("beforeValidate",v,w.visualRow,w.prop,R),s._registerImmediate(()=>{b.call(w,v,X=>{s&&(X=s.runHooks("afterValidate",X,v,w.visualRow,w.prop,R),w.valid=X,B(X),s.runHooks("postAfterValidate",X,v,w.visualRow,w.prop,R))})})):s._registerImmediate(()=>{w.valid=!0,B(w.valid,!1)})};function Te(v,w,x){return Array.isArray(v)?v:[[v,w,x]]}function Se(v,w){const x=s.getActiveEditor(),R=s.runHooks("beforeChange",v,w||"edit"),b=v.filter(B=>B!==null);return R===!1||b.length===0?(x&&x.cancelChanges(),[]):b}this.setDataAtCell=function(v,w,x,R){const b=Te(v,w,x),B=[];let X=R,ne,fe,le;for(ne=0,fe=b.length;ne<fe;ne++){if(typeof b[ne]!="object")throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if(typeof b[ne][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`");b[ne][1]>=this.countCols()?le=b[ne][1]:le=a.colToProp(b[ne][1]),B.push([b[ne][0],le,l.getAtCell(this.toPhysicalRow(b[ne][0]),b[ne][1]),b[ne][2]])}!X&&typeof v=="object"&&(X=w);const we=Se(B,R);s.runHooks("afterSetDataAtCell",we,X),Ce(we,X,()=>{pe(we,X)})},this.setDataAtRowProp=function(v,w,x,R){const b=Te(v,w,x),B=[];let X=R,ne,fe;for(ne=0,fe=b.length;ne<fe;ne++)B.push([b[ne][0],b[ne][1],l.getAtCell(this.toPhysicalRow(b[ne][0]),b[ne][1]),b[ne][2]]);!X&&typeof v=="object"&&(X=w);const le=Se(B,R);s.runHooks("afterSetDataAtRowProp",le,X),Ce(le,X,()=>{pe(le,X)})},this.listen=function(){s&&!s.isListening()&&(AC.forEach(v=>{s!==v&&v.unlisten()}),_C=s.guid,s.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(_C=null,s.runHooks("afterUnlisten"))},this.isListening=function(){return _C===s.guid},this.destroyEditor=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;u.closeEditor(v),s.view.render(),w&&W.isSelected()&&u.prepareEditor()},this.populateFromArray=function(v,w,x,R,b,B,X){if(!(typeof x=="object"&&typeof x[0]=="object"))throw new Error("populateFromArray parameter `input` must be an array of arrays");const ne=typeof R=="number"?s._createCellCoords(R,b):null;return c.populateFromArray(s._createCellCoords(v,w),x,ne,B,X)},this.spliceCol=function(v,w,x){for(var R=arguments.length,b=new Array(R>3?R-3:0),B=3;B<R;B++)b[B-3]=arguments[B];return a.spliceCol(v,w,x,...b)},this.spliceRow=function(v,w,x){for(var R=arguments.length,b=new Array(R>3?R-3:0),B=3;B<R;B++)b[B-3]=arguments[B];return a.spliceRow(v,w,x,...b)},this.getSelected=function(){if(W.isSelected())return wt(W.getSelectedRange(),v=>{let{from:w,to:x}=v;return[w.row,w.col,x.row,x.col]})},this.getSelectedLast=function(){const v=this.getSelected();let w;return v&&v.length>0&&(w=v[v.length-1]),w},this.getSelectedRange=function(){if(W.isSelected())return Array.from(W.getSelectedRange())},this.getSelectedRangeLast=function(){const v=this.getSelectedRange();let w;return v&&v.length>0&&(w=v[v.length-1]),w},this.emptySelectedCells=function(v){if(!W.isSelected()||this.countRows()===0||this.countCols()===0)return;const w=[];j(W.getSelectedRange(),x=>{if(x.isSingleHeader())return;const R=x.getTopStartCorner(),b=x.getBottomEndCorner();Ue(R.row,b.row,B=>{Ue(R.col,b.col,X=>{this.getCellMeta(B,X).readOnly||w.push([B,X,null])})})}),w.length>0&&this.setDataAtCell(w,v)},this.isRenderSuspended=function(){return this.renderSuspendedCounter>0},this.suspendRender=function(){this.renderSuspendedCounter+=1},this.resumeRender=function(){const v=this.renderSuspendedCounter-1;this.renderSuspendedCounter=Math.max(v,0),!this.isRenderSuspended()&&v===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(v){this.suspendRender();const w=v();return this.resumeRender(),w},this.isExecutionSuspended=function(){return this.executionSuspendedCounter>0},this.suspendExecution=function(){this.executionSuspendedCounter+=1,this.columnIndexMapper.suspendOperations(),this.rowIndexMapper.suspendOperations()},this.resumeExecution=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const w=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(w,0),(!this.isExecutionSuspended()&&w===this.executionSuspendedCounter||v)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(v){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.suspendExecution();const x=v();return this.resumeExecution(w),x},this.batch=function(v){this.suspendRender(),this.suspendExecution();const w=v();return this.resumeExecution(),this.resumeRender(),w},this.refreshDimensions=function(){if(!s.view)return;const{width:v,height:w}=s.view.getLastSize(),{width:x,height:R}=s.rootElement.getBoundingClientRect(),b=x!==v||R!==w;s.runHooks("beforeRefreshDimensions",{width:v,height:w},{width:x,height:R},b)!==!1&&((b||s.view._wt.wtOverlays.scrollableElement===s.rootWindow)&&(s.view.setLastSize(x,R),s.render()),s.runHooks("afterRefreshDimensions",{width:v,height:w},{width:x,height:R},b))},this.updateData=function(v,w){eM(v,x=>{a=x},x=>{a=x,s.columnIndexMapper.fitToLength(this.getInitialColumnCount()),s.rowIndexMapper.fitToLength(this.countSourceRows()),c.adjustRowsAndCols(),W.refresh()},{hotInstance:s,dataMap:a,dataSource:l,internalSource:"updateData",source:w,metaManager:p,firstRun:f})},this.loadData=function(v,w){eM(v,x=>{a=x},()=>{p.clearCellsCache(),s.initIndexMappers(),c.adjustRowsAndCols(),W.refresh(),f&&(f=[null,"loadData"])},{hotInstance:s,dataMap:a,dataSource:l,internalSource:"loadData",source:w,metaManager:p,firstRun:f})},this.getInitialColumnCount=function(){const v=S.columns;let w=0;if(Array.isArray(v))w=v.length;else if(Xt(v))if(s.dataType==="array"){const x=this.countSourceCols();for(let R=0;R<x;R+=1)v(R)&&(w+=1)}else(s.dataType==="object"||s.dataType==="function")&&(w=a.colToPropCache.length);else if(Le(S.dataSchema)){const x=a.getSchema();w=Array.isArray(x)?x.length:Py(x)}else w=this.countSourceCols();return w},this.initIndexMappers=function(){this.columnIndexMapper.initToLength(this.getInitialColumnCount()),this.rowIndexMapper.initToLength(this.countSourceRows())},this.getData=function(v,w,x,R){return Zt(v)?a.getAll():a.getRange(s._createCellCoords(v,w),s._createCellCoords(x,R),a.DESTINATION_RENDERER)},this.getCopyableText=function(v,w,x,R){return a.getCopyableText(s._createCellCoords(v,w),s._createCellCoords(x,R))},this.getCopyableData=function(v,w){return a.getCopyable(v,a.colToProp(w))},this.getSchema=function(){return a.getSchema()},this.updateSettings=function(v){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const x=(f?s.loadData:s.updateData).bind(this);let R=!1,b,B;if(Le(v.rows))throw new Error('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?');if(Le(v.cols))throw new Error('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?');if(Le(v.ganttChart))throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');for(b in v)b==="data"||(b==="language"?Y(v.language):b==="className"?z("className",v.className):b==="tableClassName"&&s.table?(z("tableClassName",v.tableClassName),s.view._wt.wtOverlays.syncOverlayTableClassNames()):He.getSingleton().isRegistered(b)||He.getSingleton().isDeprecated(b)?(Xt(v[b])||Array.isArray(v[b]))&&(v[b].initialHook=!0,s.addHook(b,v[b])):!w&&mr(v,b)&&(y[b]=v[b]));v.data===void 0&&S.data===void 0?x(null,"updateSettings"):v.data!==void 0?x(v.data,"updateSettings"):v.columns!==void 0&&(a.createMap(),s.initIndexMappers());const X=s.countCols(),ne=S.columns;if(ne&&Xt(ne)&&(R=!0),(v.cell!==void 0||v.cells!==void 0||v.columns!==void 0)&&p.clearCache(),X>0)for(b=0,B=0;b<X;b++){if(ne){const we=R?ne(b):ne[B];we&&p.updateColumnMeta(B,we)}B+=1}Le(v.cell)&&dt(v.cell,we=>{s.setCellMetaObject(we.row,we.col,we)}),s.runHooks("afterCellMetaReset");let fe=s.rootElement.style.height;fe!==""&&(fe=parseInt(s.rootElement.style.height,10));let le=v.height;if(Xt(le)&&(le=le()),w&&s.rootElement.getAttribute("style")&&s.rootElement.setAttribute("data-initialstyle",s.rootElement.getAttribute("style")),le===null){const we=s.rootElement.getAttribute("data-initialstyle");we&&(we.indexOf("height")>-1||we.indexOf("overflow")>-1)?s.rootElement.setAttribute("style",we):(s.rootElement.style.height="",s.rootElement.style.overflow="")}else le!==void 0&&(s.rootElement.style.height=isNaN(le)?`${le}`:`${le}px`,s.rootElement.style.overflow="hidden");if(typeof v.width<"u"){let we=v.width;Xt(we)&&(we=we()),s.rootElement.style.width=isNaN(we)?`${we}`:`${we}px`}w||(s.view&&(s.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),s.view._wt.exportSettingsAsClassNames()),s.runHooks("afterUpdateSettings",v)),c.adjustRowsAndCols(),s.view&&!f&&(s.forceFullRender=!0,s.view.render(),s.view._wt.wtOverlays.adjustElementsSize()),!w&&s.view&&(fe===""||le===""||le===void 0)&&fe!==le&&s.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const v=s.getSelectedLast();if(S.getValue){if(Xt(S.getValue))return S.getValue.call(s);if(v)return s.getData()[v[0][0]][S.getValue]}else if(v)return s.getDataAtCell(v[0],v[1])},this.getSettings=function(){return S},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(v,w,x,R,b){c.alter(v,w,x,R,b)},this.getCell=function(v,w){let x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,R=w,b=v;if(w>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(w)))return null;R=this.columnIndexMapper.getRenderableFromVisualIndex(w)}if(v>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(v)))return null;b=this.rowIndexMapper.getRenderableFromVisualIndex(v)}return b===null||R===null||b===void 0||R===void 0?null:s.view.getCellAtCoords(s._createCellCoords(b,R),x)},this.getCoords=function(v){const w=this.view._wt.wtTable.getCoords(v);if(w===null)return null;const{row:x,col:R}=w;let b=x,B=R;return x>=0&&(b=this.rowIndexMapper.getVisualFromRenderableIndex(x)),R>=0&&(B=this.columnIndexMapper.getVisualFromRenderableIndex(R)),s._createCellCoords(b,B)},this.colToProp=function(v){return a.colToProp(v)},this.propToCol=function(v){return a.propToCol(v)},this.toVisualRow=v=>this.rowIndexMapper.getVisualFromPhysicalIndex(v),this.toVisualColumn=v=>this.columnIndexMapper.getVisualFromPhysicalIndex(v),this.toPhysicalRow=v=>this.rowIndexMapper.getPhysicalFromVisualIndex(v),this.toPhysicalColumn=v=>this.columnIndexMapper.getPhysicalFromVisualIndex(v),this.getDataAtCell=function(v,w){return a.get(v,a.colToProp(w))},this.getDataAtRowProp=function(v,w){return a.get(v,w)},this.getDataAtCol=function(v){const w=[],x=a.getRange(s._createCellCoords(0,v),s._createCellCoords(S.data.length-1,v),a.DESTINATION_RENDERER);for(let R=0;R<x.length;R+=1)for(let b=0;b<x[R].length;b+=1)w.push(x[R][b]);return w},this.getDataAtProp=function(v){const w=[],x=a.getRange(s._createCellCoords(0,a.propToCol(v)),s._createCellCoords(S.data.length-1,a.propToCol(v)),a.DESTINATION_RENDERER);for(let R=0;R<x.length;R+=1)for(let b=0;b<x[R].length;b+=1)w.push(x[R][b]);return w},this.getSourceData=function(v,w,x,R){let b;return v===void 0?b=l.getData():b=l.getByRange(s._createCellCoords(v,w),s._createCellCoords(x,R)),b},this.getSourceDataArray=function(v,w,x,R){let b;return v===void 0?b=l.getData(!0):b=l.getByRange(s._createCellCoords(v,w),s._createCellCoords(x,R),!0),b},this.getSourceDataAtCol=function(v){return l.getAtColumn(v)},this.setSourceDataAtCell=function(v,w,x,R){const b=Te(v,w,x),B=this.hasHook("afterSetSourceDataAtCell"),X=[];B&&j(b,fe=>{let[le,we,N]=fe;X.push([le,we,l.getAtCell(le,we),N])}),j(b,fe=>{let[le,we,N]=fe;l.setAtCell(le,we,N)}),B&&this.runHooks("afterSetSourceDataAtCell",X,R),this.render();const ne=s.getActiveEditor();ne&&Le(ne.refreshValue)&&ne.refreshValue()},this.getSourceDataAtRow=function(v){return l.getAtRow(v)},this.getSourceDataAtCell=function(v,w){return l.getAtCell(v,w)},this.getDataAtRow=function(v){return a.getRange(s._createCellCoords(v,0),s._createCellCoords(v,this.countCols()-1),a.DESTINATION_RENDERER)[0]||[]},this.getDataType=function(v,w,x,R){const b=v===void 0?[0,0,this.countRows(),this.countCols()]:[v,w,x,R],[B,X]=b;let[,,ne,fe]=b,le=null,we=null;ne===void 0&&(ne=B),fe===void 0&&(fe=X);let N="mixed";return Ue(Math.max(Math.min(B,ne),0),Math.max(B,ne),Fe=>{let ie=!0;return Ue(Math.max(Math.min(X,fe),0),Math.max(X,fe),Be=>(we=this.getCellMeta(Fe,Be).type,le?ie=le===we:le=we,ie)),N=ie?we:"mixed",ie}),N},this.removeCellMeta=function(v,w,x){const[R,b]=[this.toPhysicalRow(v),this.toPhysicalColumn(w)];let B=p.getCellMetaKeyValue(R,b,x);s.runHooks("beforeRemoveCellMeta",v,w,x,B)!==!1&&(p.removeCellMeta(R,b,x),s.runHooks("afterRemoveCellMeta",v,w,x,B)),B=null},this.spliceCellsMeta=function(v){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;for(var x=arguments.length,R=new Array(x>2?x-2:0),b=2;b<x;b++)R[b-2]=arguments[b];if(R.length>0&&!Array.isArray(R[0]))throw new Error("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.");w>0&&p.removeRow(this.toPhysicalRow(v),w),R.length>0&&j(R.reverse(),B=>{p.createRow(this.toPhysicalRow(v)),j(B,(X,ne)=>this.setCellMetaObject(v,ne,X))}),s.render()},this.setCellMetaObject=function(v,w,x){typeof x=="object"&&dt(x,(R,b)=>{this.setCellMeta(v,w,b,R)})},this.setCellMeta=function(v,w,x,R){if(s.runHooks("beforeSetCellMeta",v,w,x,R)===!1)return;let B=v,X=w;v<this.countRows()&&(B=this.toPhysicalRow(v)),w<this.countCols()&&(X=this.toPhysicalColumn(w)),p.setCellMeta(B,X,x,R),s.runHooks("afterSetCellMeta",v,w,x,R)},this.getCellsMeta=function(){return p.getCellsMeta()},this.getCellMeta=function(v,w){let x=this.toPhysicalRow(v),R=this.toPhysicalColumn(w);return x===null&&(x=v),R===null&&(R=w),p.getCellMeta(x,R,{visualRow:v,visualColumn:w})},this.getCellMetaAtRow=function(v){return p.getCellsMetaAtRow(v)},this.isColumnModificationAllowed=function(){return!(s.dataType==="object"||S.columns)},this.getCellRenderer=function(v,w){const x=typeof v=="number"?s.getCellMeta(v,w).renderer:v.renderer;return typeof x=="string"?mA(x):Zt(x)?mA("text"):x},this.getCellEditor=function(v,w){const x=typeof v=="number"?s.getCellMeta(v,w).editor:v.editor;return typeof x=="string"?sA(x):Zt(x)?sA("text"):x},this.getCellValidator=function(v,w){const x=typeof v=="number"?s.getCellMeta(v,w).validator:v.validator;return typeof x=="string"?See(x):x},this.validateCells=function(v){this._validateCells(v)},this.validateRows=function(v,w){if(!Array.isArray(v))throw new Error("validateRows parameter `rows` must be an array");this._validateCells(w,v)},this.validateColumns=function(v,w){if(!Array.isArray(v))throw new Error("validateColumns parameter `columns` must be an array");this._validateCells(w,void 0,v)},this._validateCells=function(v,w,x){const R=new U;v&&(R.onQueueEmpty=v);let b=s.countRows()-1;for(;b>=0;){if(w!==void 0&&w.indexOf(b)===-1){b-=1;continue}let B=s.countCols()-1;for(;B>=0;){if(x!==void 0&&x.indexOf(B)===-1){B-=1;continue}R.addValidatorToQueue(),s.validateCell(s.getDataAtCell(b,B),s.getCellMeta(b,B),X=>{if(typeof X!="boolean")throw new Error("Validation error: result is not boolean");X===!1&&(R.valid=!1),R.removeValidatorFormQueue()},"validateCells"),B-=1}b-=1}R.checkIfQueueIsEmpty()},this.getRowHeader=function(v){let w=S.rowHeaders,x=v;return x!==void 0&&(x=s.runHooks("modifyRowHeader",x)),x===void 0?(w=[],Ue(s.countRows()-1,R=>{w.push(s.getRowHeader(R))})):Array.isArray(w)&&w[x]!==void 0?w=w[x]:Xt(w)?w=w(x):w&&typeof w!="string"&&typeof w!="number"&&(w=x+1),w},this.hasRowHeaders=function(){return!!S.rowHeaders},this.hasColHeaders=function(){if(S.colHeaders!==void 0&&S.colHeaders!==null)return!!S.colHeaders;for(let v=0,w=s.countCols();v<w;v++)if(s.getColHeader(v))return!0;return!1},this.getColHeader=function(v){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;const x=s.runHooks("modifyColHeader",v);if(x===void 0){const ne=[],fe=s.countCols();for(let le=0;le<fe;le++)ne.push(s.getColHeader(le));return ne}let R=S.colHeaders;const b=function(ne){const fe=[],le=s.countCols();let we=0;for(;we<le;we++)Xt(S.columns)&&S.columns(we)&&fe.push(we);return fe[ne]},B=s.toPhysicalColumn(x),X=b(B);return S.colHeaders===!1?R=null:S.columns&&Xt(S.columns)&&S.columns(X)&&S.columns(X).title?R=S.columns(X).title:S.columns&&S.columns[B]&&S.columns[B].title?R=S.columns[B].title:Array.isArray(S.colHeaders)&&S.colHeaders[B]!==void 0?R=S.colHeaders[B]:Xt(S.colHeaders)?R=S.colHeaders(B):S.colHeaders&&typeof S.colHeaders!="string"&&typeof S.colHeaders!="number"&&(R=tne(x)),R=s.runHooks("modifyColumnHeaderValue",R,v,w),R},this._getColWidthFromSettings=function(v){let w;if(v>=0&&(w=s.getCellMeta(0,v).width),(w===void 0||w===S.width)&&(w=S.colWidths),w!=null){switch(typeof w){case"object":w=w[v];break;case"function":w=w(v);break}typeof w=="string"&&(w=parseInt(w,10))}return w},this.getColWidth=function(v){let w=s._getColWidthFromSettings(v);return w=s.runHooks("modifyColWidth",w,v),w===void 0&&(w=gg.DEFAULT_WIDTH),w},this._getRowHeightFromSettings=function(v){let w=S.rowHeights;if(w!=null){switch(typeof w){case"object":w=w[v];break;case"function":w=w(v);break}typeof w=="string"&&(w=parseInt(w,10))}return w},this.getRowHeight=function(v){let w=s._getRowHeightFromSettings(v);return w=s.runHooks("modifyRowHeight",w,v),w},this.countSourceRows=function(){return l.countRows()},this.countSourceCols=function(){return l.countFirstRowKeys()},this.countRows=function(){return a.getLength()},this.countCols=function(){const v=S.maxCols,w=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(v,w)},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 v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=0;return AS(s.countRows()-1,x=>{if(s.isEmptyRow(x))w+=1;else if(v===!0)return!1}),w},this.countEmptyCols=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=0;return AS(s.countCols()-1,x=>{if(s.isEmptyCol(x))w+=1;else if(v===!0)return!1}),w},this.isEmptyRow=function(v){return S.isEmptyRow.call(s,v)},this.isEmptyCol=function(v){return S.isEmptyCol.call(s,v)},this.selectCell=function(v,w,x,R){let b=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,B=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;return Zt(v)||Zt(w)?!1:this.selectCells([[v,w,x,R]],b,B)},this.selectCells=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[[]],w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;w===!1&&d.suspend();const R=W.selectCells(v);return R&&x&&s.listen(),d.resume(),R},this.selectColumns=function(v){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v,x=arguments.length>2?arguments[2]:void 0;return W.selectColumns(v,w,x)},this.selectRows=function(v){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v,x=arguments.length>2?arguments[2]:void 0;return W.selectRows(v,w,x)},this.deselectCell=function(){W.deselect()},this.selectAll=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v,x=arguments.length>2?arguments[2]:void 0;d.skipNextScrollCycle(),W.selectAll(v,w,x)};const Ae=(v,w)=>v.getNearestNotHiddenIndex(w,1,!0);this.scrollViewportTo=function(v){var w;if(typeof v=="number"){var x;v={row:arguments[0],col:arguments[1],verticalSnap:arguments[2]?"bottom":"top",horizontalSnap:arguments[3]?"end":"start",considerHiddenIndexes:(x=arguments[4])!==null&&x!==void 0?x:!0}}const{row:R,col:b,verticalSnap:B,horizontalSnap:X,considerHiddenIndexes:ne}=(w=v)!==null&&w!==void 0?w:{};let fe,le,we,N;B!==void 0&&(fe=B==="top",le=!fe),X!==void 0&&(we=X==="start",N=!we);let Fe=R,ie=b;if(ne===void 0||ne){const xe=Number.isInteger(R)&&R>=0,Ye=Number.isInteger(b)&&b>=0,Ve=xe?Ae(this.rowIndexMapper,R):void 0,M=Ye?Ae(this.columnIndexMapper,b):void 0;if(Ve===null||M===null)return!1;Fe=xe?s.rowIndexMapper.getRenderableFromVisualIndex(Ve):R,ie=Ye?s.columnIndexMapper.getRenderableFromVisualIndex(M):b}const Be=Number.isInteger(Fe),Ie=Number.isInteger(ie);return Be&&Fe>=0&&Ie&&ie>=0?s.view.scrollViewport(s._createCellCoords(Fe,ie),fe,N,le,we):Be&&Fe>=0&&(Ie&&ie<0||!Ie)?s.view.scrollViewportVertically(Fe,fe,le):Ie&&ie>=0&&(Be&&Fe<0||!Be)?s.view.scrollViewportHorizontally(ie,N,we):!1},this.scrollToFocusedCell=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:()=>{};if(!this.selection.isSelected())return;this.addHookOnce("afterScroll",v);const{highlight:w}=this.getSelectedRangeLast();this.scrollViewportTo(w.toObject())?this.view.render():(this.removeHook("afterScroll",v),this._registerImmediate(()=>v()))},this.destroy=function(){if(s._clearTimeouts(),s._clearImmediates(),s.view&&s.view.destroy(),l&&l.destroy(),l=null,this.getShortcutManager().destroy(),p.clearCache(),AC.delete(this.guid),km(s)){const v=this.rootDocument.querySelector(".hot-display-license-info");v&&v.parentNode.removeChild(v)}mo(s.rootElement),o.destroy(),u&&u.destroy(),s.batchExecution(()=>{s.rowIndexMapper.unregisterAll(),s.columnIndexMapper.unregisterAll(),C.getItems().forEach(v=>{let[,w]=v;w.destroy()}),C.clear(),s.runHooks("afterDestroy")},!0),He.getSingleton().destroy(s),dt(s,(v,w,x)=>{Xt(v)?x[w]=q(w):w!=="guid"&&(x[w]=null)}),s.isDestroyed=!0,a&&a.destroy(),a=null,c=null,W=null,u=null,s=null};function q(v){return()=>{throw new Error(`The "${v}" method cannot be called because this Handsontable instance has been destroyed`)}}this.getActiveEditor=function(){return u.getActiveEditor()},this.getPlugin=function(v){const w=Ts(v);return w==="UndoRedo"?this.undoRedo:C.getItem(w)},this.getPluginName=function(v){return v===this.undoRedo?this.undoRedo.constructor.PLUGIN_KEY:C.getId(v)},this.getInstance=function(){return s},this.addHook=function(v,w,x){He.getSingleton().add(v,w,s,x)},this.hasHook=function(v){return He.getSingleton().has(v,s)||He.getSingleton().has(v)},this.addHookOnce=function(v,w,x){He.getSingleton().once(v,w,s,x)},this.removeHook=function(v,w){He.getSingleton().remove(v,w,s)},this.runHooks=function(v,w,x,R,b,B,X){return He.getSingleton().run(s,v,w,x,R,b,B,X)},this.getTranslatedPhrase=function(v,w){return QN(S.language,v,w)},this.toHTML=()=>dA(this),this.toTableElement=()=>{const v=this.rootDocument.createElement("div");return v.insertAdjacentHTML("afterbegin",dA(this)),v.firstElementChild},this.timeouts=[],this._registerTimeout=function(v){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,x=v;typeof x=="function"&&(x=setTimeout(x,w)),this.timeouts.push(x)},this._clearTimeouts=function(){j(this.timeouts,v=>{clearTimeout(v)})},this.immediates=[],this._registerImmediate=function(v){this.immediates.push(setImmediate(v))},this._clearImmediates=function(){j(this.immediates,v=>{clearImmediate(v)})},this._getEditorManager=function(){return u},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 Oe=hoe({handleEvent(){return s.isListening()},beforeKeyDown:v=>this.runHooks("beforeKeyDown",v),afterKeyDown:v=>{this.isDestroyed||s.runHooks("afterDocumentKeyDown",v)},ownerWindow:this.rootWindow});this.addHook("beforeOnCellMouseDown",v=>{v.ctrlKey===!1&&v.metaKey===!1&&Oe.releasePressedKeys()}),this.getShortcutManager=function(){return Oe},this.getFocusManager=function(){return h},CN().forEach(v=>{const w=Vy(v);C.addItem(v,new w(this))}),jse(s),Oe.setActiveContextName("grid"),He.getSingleton().run(s,"construct")}function oM(t,e,r){t.addEventListener(e,r,!1)}function aM(t,e,r){t.removeEventListener(e,r,!1)}function lM(t){return t.ownerDocument.defaultView.getComputedStyle(t)}function doe(t){const e={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},r=t.body,n=t.createTextNode(""),i=t.createElement("span");let s;function o(){n.textContent=s.value,i.style.position="absolute",i.style.fontSize=lM(s).fontSize,i.style.fontFamily=lM(s).fontFamily,i.style.whiteSpace="pre",r.appendChild(i);const u=i.clientWidth+2;r.removeChild(i);const h=s.style;h.height=`${e.minHeight}px`,e.minWidth>u?h.width=`${e.minWidth}px`:u>e.maxWidth?h.width=`${e.maxWidth}px`:h.width=`${u}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(u){if(u&&u.minHeight)if(u.minHeight==="inherit")e.minHeight=s.clientHeight;else{const h=parseInt(u.minHeight,10);isNaN(h)||(e.minHeight=h)}if(u&&u.maxHeight)if(u.maxHeight==="inherit")e.maxHeight=s.clientHeight;else{const h=parseInt(u.maxHeight,10);isNaN(h)||(e.maxHeight=h)}if(u&&u.minWidth)if(u.minWidth==="inherit")e.minWidth=s.clientWidth;else{const h=parseInt(u.minWidth,10);isNaN(h)||(e.minWidth=h)}if(u&&u.maxWidth)if(u.maxWidth==="inherit")e.maxWidth=s.clientWidth;else{const h=parseInt(u.maxWidth,10);isNaN(h)||(e.maxWidth=h)}i.firstChild||(i.className="autoResize",i.style.display="inline-block",i.appendChild(n))}function c(u,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s=u,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&&(oM(s,"input",o),oM(s,"keydown",a)),o()}return{init:c,resize:o,unObserve(){aM(s,"input",o),aM(s,"keydown",a)}}}function cM(t,e){const r=Gk(e),n=e.value.split(`
  99. `);let i=r,s=0;for(let o=0;o<n.length;o++){const a=n[o];o!==0&&(s+=n[o-1].length+1);const l=s+a.length;if(t==="home"?i=s:t==="end"&&(i=l),r<=l)break}Rw(e,i)}function Dl(t,e,r){return e=foe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function foe(t){var e=goe(t,"string");return typeof e=="symbol"?e:e+""}function goe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const moe="ht_editor_visible",D0="ht_editor_hidden",uM="textEditor",poe="text";class Yc extends xh{static get EDITOR_TYPE(){return poe}constructor(e){super(e),Dl(this,"eventManager",new As(this)),Dl(this,"autoResize",doe(this.hot.rootDocument)),Dl(this,"TEXTAREA",void 0),Dl(this,"textareaStyle",void 0),Dl(this,"TEXTAREA_PARENT",void 0),Dl(this,"textareaParentStyle",void 0),Dl(this,"layerClass",void 0),this.eventManager=new As(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(),XZ(this.hot.rootDocument.activeElement,this.hot.rootElement)&&this.hot.listen(),this.hideEditableElement(),this.unregisterShortcuts()}prepare(e,r,n,i,s,o){const a=this.state;if(super.prepare(e,r,n,i,s,o),!o.readOnly){this.refreshDimensions(!0);const{allowInvalid:l}=o;l&&!this.isOpened()&&(this.TEXTAREA.value=""),a!==Cr.FINISHED&&!this.isOpened()&&this.hideEditableElement()}}beginEditing(e,r){this.state===Cr.VIRGIN&&(this.TEXTAREA.value="",super.beginEditing(e,r))}focus(){this.TEXTAREA.select(),Rw(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(){const{rootDocument:e}=this.hot;this.TEXTAREA=e.createElement("TEXTAREA"),Xe(this.TEXTAREA,[["data-hot-input",""],wh(-1)]),this.hot.getSettings().ariaTags&&Xe(this.TEXTAREA,[fa()]),Re(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"),Re(this.TEXTAREA_PARENT,"handsontableInputHolder"),Ze(this.TEXTAREA_PARENT,this.layerClass)&&rt(this.TEXTAREA_PARENT,this.layerClass),Re(this.TEXTAREA_PARENT,D0),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){IJ()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",rt(this.TEXTAREA_PARENT,this.layerClass),Re(this.TEXTAREA_PARENT,D0)}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 r=!1;Ue(e.length-1,n=>{const i=e[n];if(Ze(i,"handsontableEditor"))return r=!0,!1}),Ze(this.TEXTAREA_PARENT,D0)&&rt(this.TEXTAREA_PARENT,D0),r?(this.layerClass=moe,Re(this.TEXTAREA_PARENT,this.layerClass)):(this.layerClass=this.getEditedCellsLayerClass(),Re(this.TEXTAREA_PARENT,this.layerClass))}refreshValue(){const e=this.hot.toPhysicalRow(this.row),r=this.hot.getSourceDataAtCell(e,this.col);this.originalValue=r,this.setValue(r),this.refreshDimensions()}refreshDimensions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.state!==Cr.EDITING&&!e)return;if(this.TD=this.getEditedCell(),!this.TD){e||this.close();return}const{top:r,start:n,width:i,maxWidth:s,height:o,maxHeight:a}=this.getEditedCellRect();this.textareaParentStyle.top=`${r}px`,this.textareaParentStyle[this.hot.isRtl()?"right":"left"]=`${n}px`,this.showEditableElement();const l=hl(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 c=hl(this.TEXTAREA),u=parseInt(c.paddingLeft,10)+parseInt(c.paddingRight,10),h=parseInt(c.paddingTop,10)+parseInt(c.paddingBottom,10),d=i-u,f=o-h,g=s-u,m=a-h;this.autoResize.init(this.TEXTAREA,{minWidth:Math.min(d,g),minHeight:Math.min(f,m),maxWidth:g,maxHeight:m},!0)}bindEvents(){sN()&&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===Cr.EDITING&&this.focus()}),this.addHook("afterRowResize",()=>{this.refreshDimensions(),this.state===Cr.EDITING&&this.focus()})}allowKeyEventPropagation(){}destroy(){this.eventManager.destroy(),this.clearHooks()}registerShortcuts(){const r=this.hot.getShortcutManager().getContext("editor"),n={runOnlyIf:()=>Le(this.hot.getSelected()),group:uM},i=()=>{this.hot.rootDocument.execCommand("insertText",!1,`
  100. `)};r.addShortcuts([{keys:[["Control","Enter"]],callback:()=>(i(),!1),runOnlyIf:s=>!this.hot.selection.isMultiple()&&!s.altKey},{keys:[["Meta","Enter"]],callback:()=>(i(),!1),runOnlyIf:()=>!this.hot.selection.isMultiple()},{keys:[["Alt","Enter"]],callback:()=>(i(),!1)},{keys:[["Home"]],callback:(s,o)=>{let[a]=o;cM(a,this.TEXTAREA)}},{keys:[["End"]],callback:(s,o)=>{let[a]=o;cM(a,this.TEXTAREA)}}],n)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(uM)}}const woe="base";function Cg(t,e,r,n,i,s,o){const a=o.ariaTags,l=[],c=[],u=[],h=[];o.className&&Re(e,o.className),o.readOnly?(l.push(o.readOnlyCellClassName),a&&h.push(V_())):a&&u.push(V_()[0]),o.valid===!1&&o.invalidCellClassName?(l.push(o.invalidCellClassName),a&&h.push(W_())):(c.push(o.invalidCellClassName),a&&u.push(W_()[0])),o.wordWrap===!1&&o.noWordWrapClassName&&l.push(o.noWordWrapClassName),!s&&o.placeholder&&l.push(o.placeholderCellClassName),rt(e,c),Re(e,l),vh(e,u),Xe(e,h)}Cg.RENDERER_TYPE=woe;const voe="text";function wa(t,e,r,n,i,s,o){Cg.apply(this,[t,e,r,n,i,s,o]);let a=s;if(!a&&o.placeholder&&(a=o.placeholder),a=Ar(a),o.trimWhitespace&&(a=a.trim()),o.rendererTemplate){mo(e);const l=t.rootDocument.createElement("TEMPLATE");l.setAttribute("bind","{{}}"),l.innerHTML=o.rendererTemplate,HTMLTemplateElement.decorate(l),l.model=t.getSourceDataAtRow(r),e.appendChild(l)}else xc(e,a)}wa.RENDERER_TYPE=voe;const Coe="text",g2={CELL_TYPE:Coe,editor:Yc,renderer:wa};ls(g2);Si.editors={BaseEditor:xh};function Si(t,e){const r=new f2(t,e||{},sb);return r.init(),r}Si.Core=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new f2(t,e,sb)};Si.DefaultSettings=o2();Si.hooks=He.getSingleton();Si.CellCoords=Ec;Si.CellRange=mg;Si.packageName="handsontable";Si.buildDate="11/06/2024 09:51:42";Si.version="14.4.0";Si.languages={dictionaryKeys:kne,getLanguageDictionary:JN,getLanguagesDictionaries:$ne,registerLanguageDictionary:ZN,getTranslatedPhrase:QN};function hM(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Soe(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?hM(Object(r),!0).forEach(function(n){boe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hM(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function xoe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yoe(t){var e=xoe(t,"string");return typeof e=="symbol"?e:e+""}function rf(t){"@babel/helpers - typeof";return rf=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},rf(t)}function boe(t,e,r){return e=yoe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ju=Symbol("unassigned"),Eoe="The Handsontable instance bound to this component was destroyed and cannot be used properly.";function Ep(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function m2(t){var e=Si.hooks.getRegistered(),r={};Object.assign(r,Si.DefaultSettings);for(var n in r)r[n]={default:Ju};for(var i=0;i<e.length;i++)r[e[i]]={default:Ju};return r.settings={default:Ju},t==="HotTable"&&(r.id={type:String,default:"hot-".concat(Math.random().toString(36).substring(5))}),r}function p2(t){var e={},r=t.settings;if(r!==Ju)for(var n in r)Ep(r,n)&&r[n]!==Ju&&(e[n]=r[n]);for(var i in t)Ep(t,i)&&i!=="settings"&&t[i]!==Ju&&(e[i]=t[i]);return e}function dM(t,e){var r=p2(t),n=t.settings?t.settings:r,i=t.settings?r:null,s={};for(var o in n)Ep(n,o)&&n[o]!==void 0&&(!(e&&o!=="data")||!fM(e[o],n[o]))&&(s[o]=n[o]);for(var a in i)Ep(i,a)&&a!=="id"&&a!=="settings"&&i[a]!==void 0&&(!(e&&a!=="data")||!fM(e[a],i[a]))&&(s[a]=i[a]);return s}function fM(t,e){var r=function(i){var s=function(){var o=new WeakSet;return function(a,l){if(rf(l)==="object"&&l!==null){if(o.has(l))return;o.add(l)}return l}}();return JSON.stringify(i,s)};return typeof t=="function"&&typeof e=="function"?t.toString()===e.toString():rf(t)!==rf(e)?!1:r(t)===r(e)}var Roe="14.4.0",HE=lx({name:"HotTable",props:m2("HotTable"),provide:function(){return{columnsCache:this.columnsCache}},watch:{$props:{handler:function(e){var r=dM(e,this.hotInstance?this.hotInstance.getSettings():void 0);!this.hotInstance||r===void 0||(r.data&&(this.hotInstance.isColumnModificationAllowed()||!this.hotInstance.isColumnModificationAllowed()&&this.hotInstance.countSourceCols()===this.miscCache.currentSourceColumns)&&(this.matchHotMappersSize(),delete r.data),Object.keys(r).length?this.hotInstance.updateSettings(r):this.hotInstance.render(),this.miscCache.currentSourceColumns=this.hotInstance.countSourceCols())},deep:!0,immediate:!0}},data:function(){return{__hotInstance:null,miscCache:{currentSourceColumns:null},columnSettings:null,columnsCache:new Map,get hotInstance(){return!this.__hotInstance||this.__hotInstance&&!this.__hotInstance.isDestroyed?this.__hotInstance:(console.warn(Eoe),null)},set hotInstance(e){this.__hotInstance=e}}},methods:{hotInit:function(){var e=dM(this.$props);e.columns=this.columnSettings?this.columnSettings:e.columns,this.hotInstance=SF(new Si.Core(this.$el,e)),this.hotInstance.init(),this.miscCache.currentSourceColumns=this.hotInstance.countSourceCols()},matchHotMappersSize:function(){var e=this;if(this.hotInstance){var r=this.hotInstance.getSourceData(),n=[],i=[],s=this.hotInstance.rowIndexMapper.getNumberOfIndexes(),o=this.hotInstance.isColumnModificationAllowed(),a=0;if(r&&r.length!==s&&r.length<s)for(var l=r.length;l<s;l++)n.push(l);if(o){var c;if(a=this.hotInstance.columnIndexMapper.getNumberOfIndexes(),r&&r[0]&&((c=r[0])===null||c===void 0?void 0:c.length)!==a&&r[0].length<a)for(var u=r[0].length;u<a;u++)i.push(u)}this.hotInstance.batch(function(){n.length>0?e.hotInstance.rowIndexMapper.removeIndexes(n):e.hotInstance.rowIndexMapper.insertIndexes(s-1,r.length-s),o&&r.length!==0&&(i.length>0?e.hotInstance.columnIndexMapper.removeIndexes(i):e.hotInstance.columnIndexMapper.insertIndexes(a-1,r[0].length-a))})}},getColumnSettings:function(){var e=Array.from(this.columnsCache.values());return e.length?e:void 0}},mounted:function(){this.columnSettings=this.getColumnSettings(),this.hotInit()},beforeUnmount:function(){this.hotInstance&&this.hotInstance.destroy()},version:Roe}),Toe=["id"];function _oe(t,e,r,n,i,s){return oO(),xF("div",{id:t.id},[yF(t.$slots,"default")],8,Toe)}HE.render=_oe;HE.__file="src/HotTable.vue";var Aoe=lx({name:"HotColumn",props:m2("HotColumn"),inject:["columnsCache"],methods:{createColumnSettings:function(){var e=p2(this.$props),r=Soe({},e);e.renderer&&(r.renderer=e.renderer),e.editor&&(r.editor=e.editor),this.columnsCache.set(this,r)}},mounted:function(){this.createColumnSettings()},unmounted:function(){this.columnsCache.delete(this)},render:function(){return null}});Aoe.__file="src/HotColumn.vue";const gM="handsontableEditor",Moe="handsontable";class FE extends Yc{static get EDITOR_TYPE(){return Moe}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(),Rw(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,r,n,i,s,o){super.prepare(e,r,n,i,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(c,u){const h=this.getSourceData(u.row,u.col);h!==void 0&&a.setValue(h),a.hot.destroyEditor()},preventWheel:!0,layoutDirection:this.hot.isRtl()?"rtl":"ltr"};this.cellProperties.handsontable&&kr(l,o.handsontable),this.htOptions=l}beginEditing(e,r){const n=this.hot.getSettings().onBeginEditing;n&&n()===!1||super.beginEditing(e,r)}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,r,n){if(this.htEditor&&this.htEditor.isListening()&&this.hot.listen(),this.htEditor&&this.htEditor.getSelectedLast()){const i=this.htEditor.getValue();i!==void 0&&this.setValue(i)}super.finishEditing(e,r,n)}assignHooks(){this.hot.addHook("afterDestroy",()=>{this.htEditor&&this.htEditor.destroy()})}registerShortcuts(){const r=this.hot.getShortcutManager().getContext("editor");super.registerShortcuts();const n={group:gM,relativeToGroup:Cl,position:"before"},i=(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(),Ps(o),this.hot.listen(),this.TEXTAREA.focus(),!1};r.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)),i(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 c=o.countRows()-1;l=o.getSelectedLast()[0],a=Math.min(c,l+1)}}return i(a,s)},preventDefault:!1}],n)}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(gM)}}function Ioe(t,e,r){Ooe(t,e),e.set(t,r)}function Ooe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function k0(t,e,r){return e=Poe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Poe(t){var e=Doe(t,"string");return typeof e=="symbol"?e:e+""}function Doe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mM(t,e){return t.get(koe(t,e))}function koe(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Noe="autocomplete";var MC=new WeakMap;class LE extends FE{constructor(){super(...arguments),k0(this,"query",null),k0(this,"strippedChoices",[]),k0(this,"rawChoices",[]),Ioe(this,MC,this.hot.guid.slice(0,9)),k0(this,"sortByRelevance",function(e,r,n){const i=[],s=[],o=e.length;let a=r.length,l,c,u,h;if(o===0){for(u=0;u<a;u++)s.push(u);return s}for(u=0;u<a;u++){if(c=B_(Ar(r[u])),n)h=c.indexOf(e);else{const d=this.cellProperties.locale;h=c.toLocaleLowerCase(d).indexOf(e.toLocaleLowerCase(d))}h!==-1&&(l=c.length-h-o,i.push({baseIndex:u,index:h,charsLeft:l,value:c}))}for(i.sort((d,f)=>{if(f.index===-1)return-1;if(d.index===-1)return 1;if(d.index<f.index)return-1;if(f.index<d.index)return 1;if(d.index===f.index){if(d.charsLeft<f.charsLeft)return-1;if(d.charsLeft>f.charsLeft)return 1}return 0}),u=0,a=i.length;u<a;u++)s.push(i[u].baseIndex);return s})}static get EDITOR_TYPE(){return Noe}getValue(){const e=this.rawChoices.find(r=>this.stripValueIfNeeded(r)===this.TEXTAREA.value);return Le(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),Re(this.htContainer,"autocompleteEditor"),Re(this.htContainer,this.hot.rootWindow.navigator.platform.indexOf("Mac")===-1?"":"htMacScroll"),this.hot.getSettings().ariaTags&&Xe(this.TEXTAREA,[HZ(),OZ(),Fk("listbox"),VZ()])}prepare(e,r,n,i,s,o){super.prepare(e,r,n,i,s,o),this.hot.getSettings().ariaTags&&Xe(this.TEXTAREA,[Wi("false"),WZ(`${mM(MC,this)}-listbox-${e}-${r}`)])}open(){super.open();const e=this.cellProperties.trimDropdown===void 0?!0:this.cellProperties.trimDropdown,r=this.hot.getSettings().ariaTags,n=Array.isArray(this.cellProperties.source)?this.cellProperties.source:null,i=n?.length,{row:s,col:o}=this;this.showEditableElement(),this.focus();let a=Qr();a===0&&xS()&&(a+=15),this.addHook("beforeKeyDown",l=>this.onBeforeKeyDown(l)),this.htEditor.updateSettings({colWidths:e?[Bt(this.TEXTAREA)-2]:void 0,width:e?Bt(this.TEXTAREA)+a:void 0,autoColumnSize:!0,renderer:(l,c,u,h,d,f,g)=>{wa(l,c,u,h,d,f,g);const{filteringCaseSensitive:m,allowHtml:p,locale:S}=this.cellProperties,y=this.query;let C=Ar(f),E,A;C&&!p&&(E=m===!0?C.indexOf(y):C.toLocaleLowerCase(S).indexOf(y.toLocaleLowerCase(S)),E!==-1&&(A=C.substr(E,y.length),C=C.replace(A,`<strong>${A}</strong>`))),r&&Xe(c,[PZ(),...n?[GZ(i)]:[],...n?[jZ(n.indexOf(f)+1)]:[],["id",`${this.htEditor.rootElement.id}_${u}-${h}`]]),c.innerHTML=C},afterSelectionEnd:(l,c)=>{if(r){const u=this.htEditor.getCell(l,c,!0);Xe(u,[Ty()]),Xe(this.TEXTAREA,...UZ(u.id))}}}),r&&(Xe(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...co()),Xe(this.htEditor.rootElement,[Hk(),YZ("polite"),zZ("text"),["id",`${mM(MC,this)}-listbox-${s}-${o}`]]),Xe(this.TEXTAREA,...Wi("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&Xe(this.TEXTAREA,[Wi("false")])}discardEditor(e){super.discardEditor(e),this.hot.view.render()}queryChoices(e){const r=this.cellProperties.source;this.query=e,typeof r=="function"?r.call(this.cellProperties,e,n=>{this.rawChoices=n,this.updateChoicesList(this.stripValuesIfNeeded(n))}):Array.isArray(r)?(this.rawChoices=r,this.updateChoicesList(this.stripValuesIfNeeded(r))):this.updateChoicesList([])}updateChoicesList(e){const r=Gk(this.TEXTAREA),n=tJ(this.TEXTAREA),i=this.cellProperties.sortByRelevance,s=this.cellProperties.filter;let o=null,a=null,l=e;i&&(o=this.sortByRelevance(this.stripValueIfNeeded(this.getValue()),l,this.cellProperties.filteringCaseSensitive));const c=Array.isArray(o)?o.length:0;if(s===!1)c&&(a=o[0]);else{const u=[];for(let h=0,d=l.length;h<d&&!(i&&c<=h);h++)c?u.push(l[o[h]]):u.push(l[h]);a=0,l=u}this.strippedChoices=l,l.length===0?this.htEditor.rootElement.style.display="none":this.htEditor.rootElement.style.display="",this.htEditor.loadData(Om([l])),l.length>0&&(this.updateDropdownDimensions(),this.flipDropdownIfNeeded(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(a)),this.hot.listen(),Rw(this.TEXTAREA,r,r===n?void 0:n)}flipDropdownIfNeeded(){const e=oh(this.hot.view._wt.wtTable.TABLE),r=e===this.hot.rootWindow,n=this.cellProperties.preventOverflow;if(r||!r&&(n||n==="horizontal"))return!1;const i=Zr(this.TEXTAREA),s=pr(this.TEXTAREA),o=this.getDropdownHeight(),a=e.scrollTop,l=pr(this.hot.view._wt.wtTable.THEAD),c=Zr(e),u=i.top-c.top-l+a,h=e.scrollHeight-u-l-s,d=o>h&&u>h;return d?this.flipDropdown(o):this.unflipDropdown(),this.limitDropdownIfNeeded(d?u:h,o),d}limitDropdownIfNeeded(e,r){if(r>e){let n=0,i=0,s=0,o=null;do s=this.htEditor.getRowHeight(i)||this.htEditor.view._wt.getSetting("defaultRowHeight"),n+=s,i+=1;while(n<e);o=n-s,this.htEditor.flipped&&(this.htEditor.rootElement.style.top=`${parseInt(this.htEditor.rootElement.style.top,10)+r-o}px`),this.setDropdownHeight(n-s)}}flipDropdown(e){const r=this.htEditor.rootElement.style;r.position="absolute",r.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)+Qr(this.hot.rootDocument)+2,r=this.cellProperties.trimDropdown;this.htEditor.updateSettings({height:this.getDropdownHeight(),width:r?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,r=this.cellProperties.visibleRows;return this.strippedChoices.length>=r?r*e:this.strippedChoices.length*e+8}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:r}=this.cellProperties,n=wt(e,s=>Ar(s));return wt(n,s=>r?s:B_(s))}allowKeyEventPropagation(e){const r=this.htEditor.getSelectedRangeLast(),n={row:r?r.from.row:-1};let i=!1;return e===je.ARROW_DOWN&&n.row>0&&n.row<this.htEditor.countRows()-1&&(i=!0),e===je.ARROW_UP&&n.row>-1&&(i=!0),i}onBeforeKeyDown(e){if(PJ(e.keyCode)||e.keyCode===je.BACKSPACE||e.keyCode===je.DELETE||e.keyCode===je.INSERT){let r=10;if(e.keyCode===je.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(r+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},r)}}}const Hoe="checkbox";class w2 extends xh{static get EDITOR_TYPE(){return Hoe}beginEditing(e,r){if(r&&r.type==="mouseup"&&r.target.nodeName==="TD"){const n=this.TD.querySelector('input[type="checkbox"]');Ze(n,"htBadValue")||n.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}/*!
  101. * Pikaday
  102. *
  103. * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday
  104. */const el=()=>window,Fi=()=>window.document,HS=(t,e)=>window.setTimeout(t,e),Qs=function(t,e,r,n){t.addEventListener(e,r,!!n)},No=function(t,e,r,n){t.removeEventListener(e,r,!!n)},Foe=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},ai=function(t,e){return(" "+t.className+" ").indexOf(" "+e+" ")!==-1},IC=function(t,e){ai(t,e)||(t.className=t.className===""?e:t.className+" "+e)},OC=function(t,e){t.className=Foe((" "+t.className+" ").replace(" "+e+" "," "))},$E=function(t){return/Array/.test(Object.prototype.toString.call(t))},hi=function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())},Loe=function(t){let e=t.getDay();return e===0||e===6},$oe=function(t){return t%4===0&&t%100!==0||t%400===0},pM=function(t,e){return[31,$oe(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},N0=function(t){hi(t)&&t.setHours(0,0,0,0)},H0=function(t,e){return t.getTime()===e.getTime()},Rp=function(t,e,r){let n,i;for(n in e)i=t[n]!==void 0,i&&typeof e[n]=="object"&&e[n]!==null&&e[n].nodeName===void 0?hi(e[n])?r&&(t[n]=new Date(e[n].getTime())):$E(e[n])?r&&(t[n]=e[n].slice(0)):t[n]=Rp({},e[n],r):(r||!i)&&(t[n]=e[n]);return t},wM=function(t,e,r){let n=Fi().createEvent("HTMLEvents");n.initEvent(e,!0,!1),n=Rp(n,r),t.dispatchEvent(n)},vM=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},Vs={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},CM=function(t,e,r){for(e+=t.firstDay;e>=7;)e-=7;return r?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},Boe=function(t){let e=[],r="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"),r="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="'+r+'"><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>"},Voe=function(t,e){t.setHours(0,0,0,0);let r=t.getDate(),n=t.getDay(),i=e,s=i-1,o=7,a=function(d){return(d+o-1)%o};t.setDate(r+s-a(n));let l=new Date(t.getFullYear(),0,i),c=24*60*60*1e3,u=(t.getTime()-l.getTime())/c;return 1+Math.round((u-s+a(l.getDay()))/o)},Woe=function(t,e,r,n,i){let s=new Date(n,r,e);return'<td class="pika-week">'+(t.hasMoment?t.moment(s).isoWeek():Voe(s,i))+"</td>"},Uoe=function(t,e,r,n){return'<tr class="pika-row'+(r?" pick-whole-week":"")+(n?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"},Yoe=function(t){return"<tbody>"+t.join("")+"</tbody>"},zoe=function(t){let e,r=[];for(t.showWeekNumber&&r.push("<th></th>"),e=0;e<7;e++)r.push('<th scope="col"><abbr title="'+CM(t,e)+'">'+CM(t,e,!0)+"</abbr></th>");return"<thead><tr>"+(t.isRTL?r.reverse():r).join("")+"</tr></thead>"},Goe=function(t,e,r,n,i,s){let o,a,l,c=t._o,u=r===c.minYear,h=r===c.maxYear,d='<div id="'+s+'" class="pika-title" role="heading" aria-live="polite">',f,g,m=!0,p=!0;for(l=[],o=0;o<12;o++)l.push('<option value="'+(r===i?o-e:12+o-e)+'"'+(o===n?' selected="selected"':"")+(u&&o<c.minMonth||h&&o>c.maxMonth?' disabled="disabled"':"")+">"+c.i18n.months[o]+"</option>");for(f='<div class="pika-label">'+c.i18n.months[n]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",$E(c.yearRange)?(o=c.yearRange[0],a=c.yearRange[1]+1):(o=r-c.yearRange,a=1+r+c.yearRange),l=[];o<a&&o<=c.maxYear;o++)o>=c.minYear&&l.push('<option value="'+o+'"'+(o===r?' selected="selected"':"")+">"+o+"</option>");return g='<div class="pika-label">'+r+c.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",c.showMonthAfterYear?d+=g+f:d+=f+g,u&&(n===0||c.minMonth>=n)&&(m=!1),h&&(n===11||c.maxMonth<=n)&&(p=!1),e===0&&(d+='<button class="pika-prev'+(m?"":" is-disabled")+'" type="button">'+c.i18n.previousMonth+"</button>"),e===t._o.numberOfMonths-1&&(d+='<button class="pika-next'+(p?"":" is-disabled")+'" type="button">'+c.i18n.nextMonth+"</button>"),d+="</div>"},joe=function(t,e,r){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+r+'">'+zoe(t)+Yoe(e)+"</table>"};function FS(t){let e=this,r=e.config(t);e._onMouseDown=function(i){if(!e._v)return;i=i||el().event;let s=i.target||i.srcElement;if(s)if(ai(s,"is-disabled")||(ai(s,"pika-button")&&!ai(s,"is-empty")&&!ai(s.parentNode,"is-disabled")?(e.setDate(new Date(s.getAttribute("data-pika-year"),s.getAttribute("data-pika-month"),s.getAttribute("data-pika-day"))),r.bound&&HS(function(){e.hide(),r.blurFieldOnSelect&&r.field&&r.field.blur()},100)):ai(s,"pika-prev")?e.prevMonth():ai(s,"pika-next")&&e.nextMonth()),ai(s,"pika-select"))e._c=!0;else if(i.preventDefault)i.preventDefault();else return i.returnValue=!1,!1},e._onChange=function(i){i=i||el().event;let s=i.target||i.srcElement;s&&(ai(s,"pika-select-month")?e.gotoMonth(s.value):ai(s,"pika-select-year")&&e.gotoYear(s.value))},e._onKeyChange=function(i){if(i=i||el().event,e.isVisible())switch(i.keyCode){case 13:case 27:r.field&&r.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(r.parse)return r.parse(r.field.value,r.format);if(this.hasMoment){let i=this.moment(r.field.value,r.format,r.formatStrict);return i&&i.isValid()?i.toDate():null}else return new Date(Date.parse(r.field.value))},e._onInputChange=function(i){let s;i.firedBy!==e&&(s=e._parseFieldValue(),hi(s)&&e.setDate(s),e._v||e.show())},e._onInputFocus=function(){e.show()},e._onInputClick=function(){e.show()},e._onInputBlur=function(){let i=Fi().activeElement;do if(ai(i,"pika-single"))return;while(i=i.parentNode);e._c||(e._b=HS(function(){e.hide()},50)),e._c=!1},e._onClick=function(i){i=i||el().event;let s=i.target||i.srcElement,o=s;if(s){!hasEventListeners&&ai(s,"pika-select")&&(s.onchange||(s.setAttribute("onchange","return;"),Qs(s,"change",e._onChange)));do if(ai(o,"pika-single")||o===r.trigger)return;while(o=o.parentNode);e._v&&s!==r.trigger&&o!==r.trigger&&e.hide()}},e.el=Fi().createElement("div"),e.el.className="pika-single"+(r.isRTL?" is-rtl":"")+(r.theme?" "+r.theme:""),Qs(e.el,"mousedown",e._onMouseDown,!0),Qs(e.el,"touchend",e._onMouseDown,!0),Qs(e.el,"change",e._onChange),r.keyboardInput&&Qs(Fi(),"keydown",e._onKeyChange),r.field&&(r.container?r.container.appendChild(e.el):r.bound?Fi().body.appendChild(e.el):r.field.parentNode.insertBefore(e.el,r.field.nextSibling),Qs(r.field,"change",e._onInputChange),r.defaultDate||(r.defaultDate=e._parseFieldValue(),r.setDefaultDate=!0));let n=r.defaultDate;hi(n)?r.setDefaultDate?e.setDate(n,!0):e.gotoDate(n):e.gotoDate(new Date),r.bound?(this.hide(),e.el.className+=" is-bound",Qs(r.trigger,"click",e._onInputClick),Qs(r.trigger,"focus",e._onInputFocus),Qs(r.trigger,"blur",e._onInputBlur)):this.show()}FS.prototype={config:function(t){this._o||(this._o=Rp({},Vs,!0));let e=Rp(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 r=parseInt(e.numberOfMonths,10)||1;if(e.numberOfMonths=r>4?4:r,hi(e.minDate)||(e.minDate=!1),hi(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),$E(e.yearRange)){let n=new Date().getFullYear()-10;e.yearRange[0]=parseInt(e.yearRange[0],10)||n,e.yearRange[1]=parseInt(e.yearRange[1],10)||n}else e.yearRange=Math.abs(parseInt(e.yearRange,10))||Vs.yearRange,e.yearRange>100&&(e.yearRange=100);return e},toString:function(t){return t=t||this._o.format,hi(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 hi(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="",wM(this._o.field,"change",{firedBy:this})),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!hi(t))return;let r=this._o.minDate,n=this._o.maxDate;hi(r)&&t<r?t=r:hi(n)&&t>n&&(t=n),this._d=new Date(t.getTime()),N0(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),wM(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(hi(t)){if(this.calendars){let r=new Date(this.calendars[0].year,this.calendars[0].month,1),n=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),i=t.getTime();n.setMonth(n.getMonth()+1),n.setDate(n.getDate()-1),e=i<r.getTime()||n.getTime()<i}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}],this._o.mainCalendar==="right"&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(t,e){let r=this.getDate()||new Date,n=parseInt(e)*24*60*60*1e3,i;t==="add"?i=new Date(r.valueOf()+n):t==="subtract"&&(i=new Date(r.valueOf()-n)),this.setDate(i)},adjustCalendars:function(){this.calendars[0]=vM(this.calendars[0]);for(let t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=vM({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?(N0(t),this._o.minDate=t,this._o.minYear=t.getFullYear(),this._o.minMonth=t.getMonth()):(this._o.minDate=Vs.minDate,this._o.minYear=Vs.minYear,this._o.minMonth=Vs.minMonth,this._o.startRange=Vs.startRange),this.draw()},setMaxDate:function(t){t instanceof Date?(N0(t),this._o.maxDate=t,this._o.maxYear=t.getFullYear(),this._o.maxMonth=t.getMonth()):(this._o.maxDate=Vs.maxDate,this._o.maxYear=Vs.maxYear,this._o.maxMonth=Vs.maxMonth,this._o.endRange=Vs.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,r=e.minYear,n=e.maxYear,i=e.minMonth,s=e.maxMonth,o="",a;this._y<=r&&(this._y=r,!isNaN(i)&&this._m<i&&(this._m=i)),this._y>=n&&(this._y=n,!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">'+Goe(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"&&HS(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,r,n,i,s,o,a,l,c,u;this._o.container||(this.el.style.position="absolute",t=this._o.trigger,e=this.el.offsetWidth,r=this.el.offsetHeight,n=el().innerWidth||Fi().documentElement.clientWidth,i=el().innerHeight||Fi().documentElement.clientHeight,s=Fi().body.scrollTop||Fi().documentElement.scrollTop,c=!0,u=!0,l=t.getBoundingClientRect(),o=l.left+el().pageXOffset,a=l.bottom+el().pageYOffset,(this._o.reposition&&o+e>n||this._o.position.indexOf("right")>-1&&o-e+t.offsetWidth>0)&&(o=o-e+t.offsetWidth,c=!1),(this._o.reposition&&a+r>i+s||this._o.position.indexOf("top")>-1&&a-r-t.offsetHeight>0)&&(a=a-r-t.offsetHeight,u=!1),o<0&&(o=0),a<0&&(a=0),this.el.style.left=o+"px",this.el.style.top=a+"px",IC(this.el,c?"left-aligned":"right-aligned"),IC(this.el,u?"bottom-aligned":"top-aligned"),OC(this.el,c?"right-aligned":"left-aligned"),OC(this.el,u?"top-aligned":"bottom-aligned"))},render:function(t,e,r){let n=this._o,i=new Date,s=pM(t,e),o=new Date(t,e,1).getDay(),a=[],l=[];N0(i),n.firstDay>0&&(o-=n.firstDay,o<0&&(o+=7));let c=e===0?11:e-1,u=e===11?0:e+1,h=e===0?t-1:t,d=e===11?t+1:t,f=pM(h,c),g=s+o,m=g;for(;m>7;)m-=7;g+=7-m;let p=!1;for(let S=0,y=0;S<g;S++){let C=new Date(t,e,1+(S-o)),E=hi(this._d)?H0(C,this._d):!1,A=H0(C,i),O=n.events.indexOf(C.toDateString())!==-1,T=S<o||S>=s+o,W=1+(S-o),I=e,Y=t,z=n.startRange&&H0(n.startRange,C),U=n.endRange&&H0(n.endRange,C),oe=n.startRange&&n.endRange&&n.startRange<C&&C<n.endRange,Ce=n.minDate&&C<n.minDate||n.maxDate&&C>n.maxDate||n.disableWeekends&&Loe(C)||n.disableDayFn&&n.disableDayFn(C);T&&(S<o?(W=f+W,I=c,Y=h):(W=W-s,I=u,Y=d));let pe={day:W,month:I,year:Y,hasEvent:O,isSelected:E,isToday:A,isDisabled:Ce,isEmpty:T,isStartRange:z,isEndRange:U,isInRange:oe,showDaysInNextAndPreviousMonths:n.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:n.enableSelectionDaysInNextAndPreviousMonths};n.pickWholeWeek&&E&&(p=!0),l.push(Boe(pe)),++y===7&&(n.showWeekNumber&&l.unshift(Woe(this,S-o,e,t,n.firstWeekOfYearMinDays)),a.push(Uoe(l,n.isRTL,n.pickWholeWeek,p)),l=[],y=0,p=!1)}return joe(n,a,r)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),OC(this.el,"is-hidden"),this._o.bound&&(Qs(Fi(),"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&&No(Fi(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),IC(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(),No(this.el,"mousedown",this._onMouseDown,!0),No(this.el,"touchend",this._onMouseDown,!0),No(this.el,"change",this._onChange),t.keyboardInput&&No(Fi(),"keydown",this._onKeyChange),t.field&&(No(t.field,"change",this._onInputChange),t.bound&&(No(t.trigger,"click",this._onInputClick),No(t.trigger,"focus",this._onInputFocus),No(t.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};function PC(t,e,r){return e=Koe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Koe(t){var e=Xoe(t,"string");return typeof e=="symbol"?e:e+""}function Xoe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const v2="date",SM="dateEditor";class C2 extends Yc{constructor(){super(...arguments),PC(this,"defaultDateFormat","DD/MM/YYYY"),PC(this,"parentDestroyed",!1),PC(this,"$datePicker",null)}static get EDITOR_TYPE(){return v2}init(){if(typeof be!="function")throw new Error("You need to include moment.js to your project.");if(typeof FS!="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"),Re(this.datePicker,"htDatepickerHolder"),this.hot.rootDocument.body.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",e=>{Ze(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,r,n,i,s,o){super.prepare(e,r,n,i,s,o)}open(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const n=this.hot.getShortcutManager().getContext("editor");this.showDatepicker(e),super.open(),n.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:SM})}close(){var e;this._opened=!1,(e=this.$datePicker)!==null&&e!==void 0&&e.destroy&&this.$datePicker.destroy(),this.hot._registerTimeout(()=>{const i=this.hot._getEditorManager();i.closeEditor(),this.hot.view.render(),i.prepareEditor()}),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(SM),super.close()}finishEditing(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.finishEditing(e,r)}showDatepicker(e){const r=this.cellProperties.dateFormat||this.defaultDateFormat,n=this.hot.view.isMouseDown(),i=e?aN(e.keyCode):!1;let s;this.datePicker.style.display="block",this.$datePicker=new FS(this.getDatePickerConfig()),typeof this.$datePicker.useMoment=="function"&&this.$datePicker.useMoment(be),this.$datePicker._onInputFocus=function(){},this.originalValue?(s=this.originalValue,be(s,r,!0).isValid()&&this.$datePicker.setMoment(be(s,r),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),!i&&!n&&this.setValue("")):this.cellProperties.defaultDate?(s=this.cellProperties.defaultDate,be(s,r,!0).isValid()&&this.$datePicker.setMoment(be(s,r),!0),!i&&!n&&this.setValue("")):this.$datePicker.gotoToday()}hideDatepicker(){this.datePickerStyle.display="none",this.$datePicker.hide()}getDatePickerConfig(){const e=this.TEXTAREA,r={};this.cellProperties&&this.cellProperties.datePickerConfig&&_w(r,this.cellProperties.datePickerConfig);const n=r.onSelect,i=r.onClose;return r.field=e,r.trigger=e,r.container=this.datePicker,r.bound=!1,r.keyboardInput=!1,r.format=r.format||this.defaultDateFormat,r.reposition=r.reposition||!1,r.isRTL=!1,r.onSelect=s=>{let o=s;isNaN(o.getTime())||(o=be(o).format(this.cellProperties.dateFormat||this.defaultDateFormat)),this.setValue(o),n&&n()},r.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),i&&i()},r}refreshDimensions(e){var r;if(super.refreshDimensions(e),this.state!==Cr.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.hideDatepicker();return}const{rowIndexMapper:n,columnIndexMapper:i}=this.hot,{wtOverlays:s}=this.hot.view._wt,{wtTable:o}=(r=s.getParentOverlay(this.TD))!==null&&r!==void 0?r:this.hot.view._wt,a=n.getVisualFromRenderableIndex(o.getFirstPartiallyVisibleRow()),l=n.getVisualFromRenderableIndex(o.getLastPartiallyVisibleRow()),c=i.getVisualFromRenderableIndex(o.getFirstPartiallyVisibleColumn()),u=i.getVisualFromRenderableIndex(o.getLastPartiallyVisibleColumn());if(this.row>=a&&this.row<=l&&this.col>=c&&this.col<=u){const h=this.TD.getBoundingClientRect();this.datePickerStyle.top=`${this.hot.rootWindow.pageYOffset+h.top+pr(this.TD)}px`;let d=this.hot.rootWindow.pageXOffset;this.hot.isRtl()?d+=h.right-Bt(this.datePicker):d+=h.left,this.datePickerStyle.left=`${d}px`}else this.hideDatepicker()}}const qoe="dropdown";class BE extends LE{static get EDITOR_TYPE(){return qoe}prepare(e,r,n,i,s,o){super.prepare(e,r,n,i,s,o),this.cellProperties.filter=!1,this.cellProperties.strict=!0}}He.getSingleton().add("beforeValidate",function(t,e,r){const n=this.propToCol(r);if(Number.isInteger(n)){const i=this.getCellMeta(e,n);i.editor===BE&&i.strict===void 0&&(i.filter=!1,i.strict=!0)}});const Zoe="numeric";class S2 extends Yc{static get EDITOR_TYPE(){return Zoe}}const Joe="password";class x2 extends Yc{static get EDITOR_TYPE(){return Joe}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&&Xe(this.TEXTAREA,[fa()]),mo(this.TEXTAREA_PARENT),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}const DC="ht_editor_visible",xM="selectEditor",Qoe="select";class y2 extends xh{static get EDITOR_TYPE(){return Qoe}init(){this.select=this.hot.rootDocument.createElement("select"),this.select.setAttribute("data-hot-input","true"),this.select.style.display="none",Re(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",Ze(this.select,DC)&&rt(this.select,DC),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,r,n,i,s,o){super.prepare(e,r,n,i,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),mo(this.select),dt(l,(c,u)=>{const h=this.hot.rootDocument.createElement("OPTION");h.value=u,Ch(h,c),this.select.appendChild(h)})}prepareOptions(e){let r={};if(Array.isArray(e))for(let n=0,i=e.length;n<i;n++)r[e[n]]=e[n];else typeof e=="object"&&(r=e);return r}refreshValue(){const e=this.hot.getSourceDataAtCell(this.row,this.prop);this.originalValue=e,this.setValue(e),this.refreshDimensions()}refreshDimensions(){if(this.state!==Cr.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.close();return}const{top:e,start:r,width:n,height:i}=this.getEditedCellRect(),s=this.select.style;s.height=`${i}px`,s.width=`${n}px`,s.top=`${e}px`,s[this.hot.isRtl()?"right":"left"]=`${r}px`,s.margin="0px",Re(this.select,DC)}registerShortcuts(){const r=this.hot.getShortcutManager().getContext("editor"),n={group:xM};this.isInFullEditMode()&&r.addShortcuts([{keys:[["ArrowUp"]],callback:()=>{const i=this.select.selectedIndex-1;i>=0&&(this.select[i].selected=!0)}},{keys:[["ArrowDown"]],callback:()=>{const i=this.select.selectedIndex+1;i<=this.select.length-1&&(this.select[i].selected=!0)}}],n)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(xM)}}const eae="time";class b2 extends Yc{static get EDITOR_TYPE(){return eae}prepare(e,r,n,i,s,o){super.prepare(e,r,n,i,s,o),this.TEXTAREA.dir="ltr"}}function tae(){li(xh),li(LE),li(w2),li(C2),li(BE),li(FE),li(S2),li(x2),li(y2),li(Yc),li(b2)}const rae="html";function VE(t,e,r,n,i,s,o){Cg.apply(this,[t,e,r,n,i,s,o]),Ch(e,s??"",!1)}VE.RENDERER_TYPE=rae;const nae="autocomplete";function yh(t,e,r,n,i,s,o){const{rootDocument:a}=t,l=o.allowHtml?VE:wa,c=a.createElement("DIV"),u=t.getSettings().ariaTags;if(c.className="htAutocompleteArrow",u&&c.setAttribute(...fa()),c.appendChild(a.createTextNode("▼")),l.apply(this,[t,e,r,n,i,s,o]),e.firstChild||e.appendChild(a.createTextNode(" ")),e.insertBefore(c,e.firstChild),Re(e,"htAutocomplete"),!t.acArrowListener){const h=new As(t);t.acArrowListener=function(d){Ze(d.target,"htAutocompleteArrow")&&t.view._wt.getSetting("onCellDblClick",null,t._createCellCoords(r,n),e)},h.addEventListener(t.rootElement,"mousedown",t.acArrowListener),t.addHookOnce("afterDestroy",()=>{h.destroy()})}}yh.RENDERER_TYPE=nae;const iae="dropdown";function WE(t,e,r,n,i,s,o){yh.apply(this,[t,e,r,n,i,s,o])}WE.RENDERER_TYPE=iae;const yM=new WeakMap,bM=new WeakMap,sae="htBadValue",lh="data-row",ch="data-col",oae="checkboxRenderer",E2="checkbox";He.getSingleton().add("modifyAutoColumnSizeSeed",function(t,e,r){const{label:n,type:i,row:s,column:o,prop:a}=e;if(i===E2){if(n){const{value:l,property:c}=n;let u=r;if(l)u=typeof l=="function"?l(s,o,a,r):l;else if(c){const h=this.getDataAtRowProp(s,c);u=h!==null?h:r}t=u}return t}});function UE(t,e,r,n,i,s,o){const{rootDocument:a}=t,l=t.getSettings().ariaTags;Cg.apply(this,[t,e,r,n,i,s,o]),aae(t);let c=lae(a);const u=o.label;let h=!1;if(typeof o.checkedTemplate>"u"&&(o.checkedTemplate=!0),typeof o.uncheckedTemplate>"u"&&(o.uncheckedTemplate=!1),mo(e),s===o.checkedTemplate||Ar(s).toLocaleLowerCase(o.locale)===Ar(o.checkedTemplate).toLocaleLowerCase(o.locale)?c.checked=!0:s===o.uncheckedTemplate||Ar(s).toLocaleLowerCase(o.locale)===Ar(o.uncheckedTemplate).toLocaleLowerCase(o.locale)?c.checked=!1:yr(s)?Re(c,"noValue"):(c.style.display="none",Re(c,sae),h=!0),Xe(c,[[lh,r],[ch,n]]),l&&Xe(c,[Ey(c.checked?t.getTranslatedPhrase(PE):t.getTranslatedPhrase(DE)),BZ(c.checked),DZ()]),!h&&u){let m="";if(u.value)m=typeof u.value=="function"?u.value.call(this,r,n,i,s):u.value;else if(u.property){const S=t.getDataAtRowProp(r,u.property);m=S!==null?S:""}const p=cae(a,m,u.separated!==!0);u.position==="before"?u.separated?(e.appendChild(p),e.appendChild(c)):(p.appendChild(c),c=p):(!u.position||u.position==="after")&&(u.separated?(e.appendChild(c),e.appendChild(p)):(p.insertBefore(c,p.firstChild),c=p))}(!u||u&&!u.separated)&&e.appendChild(c),h&&e.appendChild(a.createTextNode("#bad-value#")),yM.has(t)||(yM.set(t,!0),d());function d(){const p=t.getShortcutManager().getContext("grid"),S={group:oae,relativeToGroup:Cl,position:"before"};p.addShortcuts([{keys:[["space"]],callback:()=>(f(),!g()),runOnlyIf:()=>{var y;return(y=t.getSelectedRangeLast())===null||y===void 0?void 0:y.highlight.isCell()}},{keys:[["enter"]],callback:()=>(f(),!g()),runOnlyIf:()=>{const y=t.getSelectedRangeLast();return t.getSettings().enterBeginsEditing&&y?.isSingle()&&y.highlight.isCell()}},{keys:[["delete"],["backspace"]],callback:()=>(f(!0),!g()),runOnlyIf:()=>{var y;return(y=t.getSelectedRangeLast())===null||y===void 0?void 0:y.highlight.isCell()}}],S)}function f(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const p=t.getSelectedRange(),S=[];let y=[],C=0;if(p){for(let E=0;E<p.length;E++){const{row:A,col:O}=p[E].getTopStartCorner(),{row:T,col:W}=p[E].getBottomEndCorner();for(let I=A;I<=T;I+=1)for(let Y=O;Y<=W;Y+=1){const z=t.getCellMeta(I,Y),U={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 oe=t.getDataAtCell(I,Y);m===!1?[z.checkedTemplate,z.checkedTemplate.toString()].includes(oe)?y.push([I,Y,z.uncheckedTemplate,U]):[z.uncheckedTemplate,z.uncheckedTemplate.toString(),null,void 0].includes(oe)&&y.push([I,Y,z.checkedTemplate,U]):y.push([I,Y,z.uncheckedTemplate,U]),C+=1}S.push(C),C=0}y.every(E=>{let[,,A]=E;return A===y[0][2]})?y=y.map(E=>{let[A,O,T]=E;return[A,O,T]}):y=y.map(E=>{let[A,O,,T]=E;return[A,O,T.checkedTemplate]}),y.length>0&&S.forEach(E=>{const A=y.splice(0,E);t.setDataAtCell(A)})}}function g(){const m=t.getSelectedRange();if(m){for(let p=0;p<m.length;p++){const S=m[p].getTopStartCorner(),y=m[p].getBottomEndCorner();for(let C=S.row;C<=y.row;C++)for(let E=S.col;E<=y.col;E++){const A=t.getCellMeta(C,E);if(A.type!=="checkbox")return!1;const O=t.getCell(C,E);if(O==null)return!0;if(O.querySelectorAll("input[type=checkbox]").length>0&&!A.readOnly)return!0}}return!1}}}UE.RENDERER_TYPE=E2;function aae(t){let e=bM.get(t);if(!e){const{rootElement:r}=t;e=new As(t),e.addEventListener(r,"click",n=>hae(n,t)),e.addEventListener(r,"mouseup",n=>uae(n,t)),e.addEventListener(r,"change",n=>dae(n,t)),bM.set(t,e)}return e}function lae(t){const e=t.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("tabindex","-1"),e.cloneNode(!1)}function cae(t,e,r){const n=t.createElement("label");return n.className=`htCheckboxRendererLabel ${r?"fullWidth":""}`,n.appendChild(t.createTextNode(e)),n.cloneNode(!0)}function uae(t,e){const{target:r}=t;YE(r)&&(!r.hasAttribute(lh)||!r.hasAttribute(ch)||setTimeout(e.listen,10))}function hae(t,e){const{target:r}=t;if(!YE(r)||!r.hasAttribute(lh)||!r.hasAttribute(ch))return;const n=parseInt(r.getAttribute(lh),10),i=parseInt(r.getAttribute(ch),10);e.getCellMeta(n,i).readOnly&&t.preventDefault()}function dae(t,e){const{target:r}=t;if(!YE(r)||!r.hasAttribute(lh)||!r.hasAttribute(ch))return;const n=parseInt(r.getAttribute(lh),10),i=parseInt(r.getAttribute(ch),10),s=e.getCellMeta(n,i);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(n,i,o)}}function YE(t){return t.tagName==="INPUT"&&t.getAttribute("type")==="checkbox"}const fae="handsontable";function zE(t,e,r,n,i,s,o){yh.apply(this,[t,e,r,n,i,s,o])}zE.RENDERER_TYPE=fae;var R2={exports:{}};(function(t,e){(function(r){t.exports=r()})(function(){return function r(n,i,s){function o(c,u){if(!i[c]){if(!n[c]){var h=typeof Od=="function"&&Od;if(!u&&h)return h(c,!0);if(a)return a(c,!0);var d=new Error("Cannot find module '"+c+"'");throw d.code="MODULE_NOT_FOUND",d}var f=i[c]={exports:{}};n[c][0].call(f.exports,function(g){return o(n[c][1][g]||g)},f,f.exports,r,n,i,s)}return i[c].exports}for(var a=typeof Od=="function"&&Od,l=0;l<s.length;l++)o(s[l]);return o}({1:[function(r,n,i){(function(s){var o,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,l=Math.ceil,c=Math.floor,u="[BigNumber Error] ",h=u+"Number primitive has more than 15 significant digits: ",d=1e14,f=14,g=9007199254740991,m=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],p=1e7,S=1e9;function y(I){var Y=0|I;return 0<I||I===Y?Y:Y-1}function C(I){for(var Y,z,U=1,oe=I.length,Ce=I[0]+"";U<oe;){for(Y=I[U++]+"",z=f-Y.length;z--;Y="0"+Y);Ce+=Y}for(oe=Ce.length;Ce.charCodeAt(--oe)===48;);return Ce.slice(0,oe+1||1)}function E(I,Y){var z,U,oe=I.c,Ce=Y.c,pe=I.s,Te=Y.s,Se=I.e,Ae=Y.e;if(!pe||!Te)return null;if(z=oe&&!oe[0],U=Ce&&!Ce[0],z||U)return z?U?0:-Te:pe;if(pe!=Te)return pe;if(z=pe<0,U=Se==Ae,!oe||!Ce)return U?0:!oe^z?1:-1;if(!U)return Ae<Se^z?1:-1;for(Te=(Se=oe.length)<(Ae=Ce.length)?Se:Ae,pe=0;pe<Te;pe++)if(oe[pe]!=Ce[pe])return oe[pe]>Ce[pe]^z?1:-1;return Se==Ae?0:Ae<Se^z?1:-1}function A(I,Y,z,U){if(I<Y||z<I||I!==(I<0?l(I):c(I)))throw Error(u+(U||"Argument")+(typeof I=="number"?I<Y||z<I?" out of range: ":" not an integer: ":" not a primitive number: ")+String(I))}function O(I){var Y=I.c.length-1;return y(I.e/f)==Y&&I.c[Y]%2!=0}function T(I,Y){return(1<I.length?I.charAt(0)+"."+I.slice(1):I)+(Y<0?"e":"e+")+Y}function W(I,Y,z){var U,oe;if(Y<0){for(oe=z+".";++Y;oe+=z);I=oe+I}else if(++Y>(U=I.length)){for(oe=z,Y-=U;--Y;oe+=z);I+=oe}else Y<U&&(I=I.slice(0,Y)+"."+I.slice(Y));return I}(o=function I(Y){var z,U,oe,Ce,pe,Te,Se,Ae,q,Oe,v=ie.prototype={constructor:ie,toString:null,valueOf:null},w=new ie(1),x=20,R=4,b=-7,B=21,X=-1e7,ne=1e7,fe=!1,le=1,we=0,N={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},Fe="0123456789abcdefghijklmnopqrstuvwxyz";function ie(M,D){var G,re,K,se,J,Z,ee,te,Q=this;if(!(Q instanceof ie))return new ie(M,D);if(D==null){if(M instanceof ie)return Q.s=M.s,Q.e=M.e,void(Q.c=(M=M.c)?M.slice():M);if((Z=typeof M=="number")&&0*M==0){if(Q.s=1/M<0?(M=-M,-1):1,M===~~M){for(se=0,J=M;10<=J;J/=10,se++);return Q.e=se,void(Q.c=[M])}te=String(M)}else{if(te=String(M),!a.test(te))return oe(Q,te,Z);Q.s=te.charCodeAt(0)==45?(te=te.slice(1),-1):1}-1<(se=te.indexOf("."))&&(te=te.replace(".","")),0<(J=te.search(/e/i))?(se<0&&(se=J),se+=+te.slice(J+1),te=te.substring(0,J)):se<0&&(se=te.length)}else{if(A(D,2,Fe.length,"Base"),te=String(M),D==10)return Ye(Q=new ie(M instanceof ie?M:te),x+Q.e+1,R);if(Z=typeof M=="number"){if(0*M!=0)return oe(Q,te,Z,D);if(Q.s=1/M<0?(te=te.slice(1),-1):1,ie.DEBUG&&15<te.replace(/^0\.0*|\./,"").length)throw Error(h+M);Z=!1}else Q.s=te.charCodeAt(0)===45?(te=te.slice(1),-1):1;for(G=Fe.slice(0,D),se=J=0,ee=te.length;J<ee;J++)if(G.indexOf(re=te.charAt(J))<0){if(re=="."){if(se<J){se=ee;continue}}else if(!K&&(te==te.toUpperCase()&&(te=te.toLowerCase())||te==te.toLowerCase()&&(te=te.toUpperCase()))){K=!0,J=-1,se=0;continue}return oe(Q,String(M),Z,D)}-1<(se=(te=U(te,D,10,Q.s)).indexOf("."))?te=te.replace(".",""):se=te.length}for(J=0;te.charCodeAt(J)===48;J++);for(ee=te.length;te.charCodeAt(--ee)===48;);if(te=te.slice(J,++ee)){if(ee-=J,Z&&ie.DEBUG&&15<ee&&(g<M||M!==c(M)))throw Error(h+Q.s*M);if(ne<(se=se-J-1))Q.c=Q.e=null;else if(se<X)Q.c=[Q.e=0];else{if(Q.e=se,Q.c=[],J=(se+1)%f,se<0&&(J+=f),J<ee){for(J&&Q.c.push(+te.slice(0,J)),ee-=f;J<ee;)Q.c.push(+te.slice(J,J+=f));te=te.slice(J),J=f-te.length}else J-=ee;for(;J--;te+="0");Q.c.push(+te)}}else Q.c=[Q.e=0]}function Be(M,D,G,re){var K,se,J,Z,ee;if(G==null?G=R:A(G,0,8),!M.c)return M.toString();if(K=M.c[0],J=M.e,D==null)ee=C(M.c),ee=re==1||re==2&&(J<=b||B<=J)?T(ee,J):W(ee,J,"0");else if(se=(M=Ye(new ie(M),D,G)).e,Z=(ee=C(M.c)).length,re==1||re==2&&(D<=se||se<=b)){for(;Z<D;ee+="0",Z++);ee=T(ee,se)}else if(D-=J,ee=W(ee,se,"0"),Z<se+1){if(0<--D)for(ee+=".";D--;ee+="0");}else if(0<(D+=se-Z))for(se+1==Z&&(ee+=".");D--;ee+="0");return M.s<0&&K?"-"+ee:ee}function Ie(M,D){for(var G,re=1,K=new ie(M[0]);re<M.length;re++){if(!(G=new ie(M[re])).s){K=G;break}D.call(K,G)&&(K=G)}return K}function xe(M,D,G){for(var re=1,K=D.length;!D[--K];D.pop());for(K=D[0];10<=K;K/=10,re++);return(G=re+G*f-1)>ne?M.c=M.e=null:M.c=G<X?[M.e=0]:(M.e=G,D),M}function Ye(M,D,G,re){var K,se,J,Z,ee,te,Q,ye=M.c,Me=m;if(ye){e:{for(K=1,Z=ye[0];10<=Z;Z/=10,K++);if((se=D-K)<0)se+=f,J=D,Q=(ee=ye[te=0])/Me[K-J-1]%10|0;else if((te=l((se+1)/f))>=ye.length){if(!re)break e;for(;ye.length<=te;ye.push(0));ee=Q=0,J=(se%=f)-f+(K=1)}else{for(ee=Z=ye[te],K=1;10<=Z;Z/=10,K++);Q=(J=(se%=f)-f+K)<0?0:ee/Me[K-J-1]%10|0}if(re=re||D<0||ye[te+1]!=null||(J<0?ee:ee%Me[K-J-1]),re=G<4?(Q||re)&&(G==0||G==(M.s<0?3:2)):5<Q||Q==5&&(G==4||re||G==6&&(0<se?0<J?ee/Me[K-J]:0:ye[te-1])%10&1||G==(M.s<0?8:7)),D<1||!ye[0])return ye.length=0,re?(D-=M.e+1,ye[0]=Me[(f-D%f)%f],M.e=-D||0):ye[0]=M.e=0,M;if(se==0?(ye.length=te,Z=1,te--):(ye.length=te+1,Z=Me[f-se],ye[te]=0<J?c(ee/Me[K-J]%Me[J])*Z:0),re)for(;;){if(te==0){for(se=1,J=ye[0];10<=J;J/=10,se++);for(J=ye[0]+=Z,Z=1;10<=J;J/=10,Z++);se!=Z&&(M.e++,ye[0]==d&&(ye[0]=1));break}if(ye[te]+=Z,ye[te]!=d)break;ye[te--]=0,Z=1}for(se=ye.length;ye[--se]===0;ye.pop());}M.e>ne?M.c=M.e=null:M.e<X&&(M.c=[M.e=0])}return M}function Ve(M){var D,G=M.e;return G===null?M.toString():(D=C(M.c),D=G<=b||B<=G?T(D,G):W(D,G,"0"),M.s<0?"-"+D:D)}return ie.clone=I,ie.ROUND_UP=0,ie.ROUND_DOWN=1,ie.ROUND_CEIL=2,ie.ROUND_FLOOR=3,ie.ROUND_HALF_UP=4,ie.ROUND_HALF_DOWN=5,ie.ROUND_HALF_EVEN=6,ie.ROUND_HALF_CEIL=7,ie.ROUND_HALF_FLOOR=8,ie.EUCLID=9,ie.config=ie.set=function(M){var D,G;if(M!=null){if(typeof M!="object")throw Error(u+"Object expected: "+M);if(M.hasOwnProperty(D="DECIMAL_PLACES")&&(A(G=M[D],0,S,D),x=G),M.hasOwnProperty(D="ROUNDING_MODE")&&(A(G=M[D],0,8,D),R=G),M.hasOwnProperty(D="EXPONENTIAL_AT")&&((G=M[D])&&G.pop?(A(G[0],-S,0,D),A(G[1],0,S,D),b=G[0],B=G[1]):(A(G,-S,S,D),b=-(B=G<0?-G:G))),M.hasOwnProperty(D="RANGE"))if((G=M[D])&&G.pop)A(G[0],-S,-1,D),A(G[1],1,S,D),X=G[0],ne=G[1];else{if(A(G,-S,S,D),!G)throw Error(u+D+" cannot be zero: "+G);X=-(ne=G<0?-G:G)}if(M.hasOwnProperty(D="CRYPTO")){if((G=M[D])!==!!G)throw Error(u+D+" not true or false: "+G);if(G){if(typeof crypto>"u"||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw fe=!G,Error(u+"crypto unavailable");fe=G}else fe=G}if(M.hasOwnProperty(D="MODULO_MODE")&&(A(G=M[D],0,9,D),le=G),M.hasOwnProperty(D="POW_PRECISION")&&(A(G=M[D],0,S,D),we=G),M.hasOwnProperty(D="FORMAT")){if(typeof(G=M[D])!="object")throw Error(u+D+" not an object: "+G);N=G}if(M.hasOwnProperty(D="ALPHABET")){if(typeof(G=M[D])!="string"||/^.$|[+-.\s]|(.).*\1/.test(G))throw Error(u+D+" invalid: "+G);Fe=G}}return{DECIMAL_PLACES:x,ROUNDING_MODE:R,EXPONENTIAL_AT:[b,B],RANGE:[X,ne],CRYPTO:fe,MODULO_MODE:le,POW_PRECISION:we,FORMAT:N,ALPHABET:Fe}},ie.isBigNumber=function(M){return M instanceof ie||M&&M._isBigNumber===!0||!1},ie.maximum=ie.max=function(){return Ie(arguments,v.lt)},ie.minimum=ie.min=function(){return Ie(arguments,v.gt)},ie.random=(Ce=9007199254740992,pe=Math.random()*Ce&2097151?function(){return c(Math.random()*Ce)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(M){var D,G,re,K,se,J=0,Z=[],ee=new ie(w);if(M==null?M=x:A(M,0,S),K=l(M/f),fe)if(crypto.getRandomValues){for(D=crypto.getRandomValues(new Uint32Array(K*=2));J<K;)9e15<=(se=131072*D[J]+(D[J+1]>>>11))?(G=crypto.getRandomValues(new Uint32Array(2)),D[J]=G[0],D[J+1]=G[1]):(Z.push(se%1e14),J+=2);J=K/2}else{if(!crypto.randomBytes)throw fe=!1,Error(u+"crypto unavailable");for(D=crypto.randomBytes(K*=7);J<K;)9e15<=(se=281474976710656*(31&D[J])+1099511627776*D[J+1]+4294967296*D[J+2]+16777216*D[J+3]+(D[J+4]<<16)+(D[J+5]<<8)+D[J+6])?crypto.randomBytes(7).copy(D,J):(Z.push(se%1e14),J+=7);J=K/7}if(!fe)for(;J<K;)(se=pe())<9e15&&(Z[J++]=se%1e14);for(K=Z[--J],M%=f,K&&M&&(se=m[f-M],Z[J]=c(K/se)*se);Z[J]===0;Z.pop(),J--);if(J<0)Z=[re=0];else{for(re=-1;Z[0]===0;Z.splice(0,1),re-=f);for(J=1,se=Z[0];10<=se;se/=10,J++);J<f&&(re-=f-J)}return ee.e=re,ee.c=Z,ee}),ie.sum=function(){for(var M=1,D=arguments,G=new ie(D[0]);M<D.length;)G=G.plus(D[M++]);return G},U=function(){var M="0123456789";function D(G,re,K,se){for(var J,Z,ee=[0],te=0,Q=G.length;te<Q;){for(Z=ee.length;Z--;ee[Z]*=re);for(ee[0]+=se.indexOf(G.charAt(te++)),J=0;J<ee.length;J++)ee[J]>K-1&&(ee[J+1]==null&&(ee[J+1]=0),ee[J+1]+=ee[J]/K|0,ee[J]%=K)}return ee.reverse()}return function(G,re,K,se,J){var Z,ee,te,Q,ye,Me,Pe,Je,vt=G.indexOf("."),st=x,qe=R;for(0<=vt&&(Q=we,we=0,G=G.replace(".",""),Me=(Je=new ie(re)).pow(G.length-vt),we=Q,Je.c=D(W(C(Me.c),Me.e,"0"),10,K,M),Je.e=Je.c.length),te=Q=(Pe=D(G,re,K,J?(Z=Fe,M):(Z=M,Fe))).length;Pe[--Q]==0;Pe.pop());if(!Pe[0])return Z.charAt(0);if(vt<0?--te:(Me.c=Pe,Me.e=te,Me.s=se,Pe=(Me=z(Me,Je,st,qe,K)).c,ye=Me.r,te=Me.e),vt=Pe[ee=te+st+1],Q=K/2,ye=ye||ee<0||Pe[ee+1]!=null,ye=qe<4?(vt!=null||ye)&&(qe==0||qe==(Me.s<0?3:2)):Q<vt||vt==Q&&(qe==4||ye||qe==6&&1&Pe[ee-1]||qe==(Me.s<0?8:7)),ee<1||!Pe[0])G=ye?W(Z.charAt(1),-st,Z.charAt(0)):Z.charAt(0);else{if(Pe.length=ee,ye)for(--K;++Pe[--ee]>K;)Pe[ee]=0,ee||(++te,Pe=[1].concat(Pe));for(Q=Pe.length;!Pe[--Q];);for(vt=0,G="";vt<=Q;G+=Z.charAt(Pe[vt++]));G=W(G,te,Z.charAt(0))}return G}}(),z=function(){function M(re,K,se){var J,Z,ee,te,Q=0,ye=re.length,Me=K%p,Pe=K/p|0;for(re=re.slice();ye--;)Q=((Z=Me*(ee=re[ye]%p)+(J=Pe*ee+(te=re[ye]/p|0)*Me)%p*p+Q)/se|0)+(J/p|0)+Pe*te,re[ye]=Z%se;return Q&&(re=[Q].concat(re)),re}function D(re,K,se,J){var Z,ee;if(se!=J)ee=J<se?1:-1;else for(Z=ee=0;Z<se;Z++)if(re[Z]!=K[Z]){ee=re[Z]>K[Z]?1:-1;break}return ee}function G(re,K,se,J){for(var Z=0;se--;)re[se]-=Z,Z=re[se]<K[se]?1:0,re[se]=Z*J+re[se]-K[se];for(;!re[0]&&1<re.length;re.splice(0,1));}return function(re,K,se,J,Z){var ee,te,Q,ye,Me,Pe,Je,vt,st,qe,Ct,Gt,Ro,ii,Sl,en,jt,Er=re.s==K.s?1:-1,Nr=re.c,Ut=K.c;if(!(Nr&&Nr[0]&&Ut&&Ut[0]))return new ie(re.s&&K.s&&(Nr?!Ut||Nr[0]!=Ut[0]:Ut)?Nr&&Nr[0]==0||!Ut?0*Er:Er/0:NaN);for(st=(vt=new ie(Er)).c=[],Er=se+(te=re.e-K.e)+1,Z||(Z=d,te=y(re.e/f)-y(K.e/f),Er=Er/f|0),Q=0;Ut[Q]==(Nr[Q]||0);Q++);if(Ut[Q]>(Nr[Q]||0)&&te--,Er<0)st.push(1),ye=!0;else{for(ii=Nr.length,en=Ut.length,Er+=2,1<(Me=c(Z/(Ut[Q=0]+1)))&&(Ut=M(Ut,Me,Z),Nr=M(Nr,Me,Z),en=Ut.length,ii=Nr.length),Ro=en,Ct=(qe=Nr.slice(0,en)).length;Ct<en;qe[Ct++]=0);jt=Ut.slice(),jt=[0].concat(jt),Sl=Ut[0],Ut[1]>=Z/2&&Sl++;do{if(Me=0,(ee=D(Ut,qe,en,Ct))<0){if(Gt=qe[0],en!=Ct&&(Gt=Gt*Z+(qe[1]||0)),1<(Me=c(Gt/Sl)))for(Z<=Me&&(Me=Z-1),Je=(Pe=M(Ut,Me,Z)).length,Ct=qe.length;D(Pe,qe,Je,Ct)==1;)Me--,G(Pe,en<Je?jt:Ut,Je,Z),Je=Pe.length,ee=1;else Me==0&&(ee=Me=1),Je=(Pe=Ut.slice()).length;if(Je<Ct&&(Pe=[0].concat(Pe)),G(qe,Pe,Ct,Z),Ct=qe.length,ee==-1)for(;D(Ut,qe,en,Ct)<1;)Me++,G(qe,en<Ct?jt:Ut,Ct,Z),Ct=qe.length}else ee===0&&(Me++,qe=[0]);st[Q++]=Me,qe[0]?qe[Ct++]=Nr[Ro]||0:(qe=[Nr[Ro]],Ct=1)}while((Ro++<ii||qe[0]!=null)&&Er--);ye=qe[0]!=null,st[0]||st.splice(0,1)}if(Z==d){for(Q=1,Er=st[0];10<=Er;Er/=10,Q++);Ye(vt,se+(vt.e=Q+te*f-1)+1,J,ye)}else vt.e=te,vt.r=+ye;return vt}}(),Te=/^(-?)0([xbo])(?=\w[\w.]*$)/i,Se=/^([^.]+)\.$/,Ae=/^\.([^.]+)$/,q=/^-?(Infinity|NaN)$/,Oe=/^\s*\+(?=[\w.])|^\s+|\s+$/g,oe=function(M,D,G,re){var K,se=G?D:D.replace(Oe,"");if(q.test(se))M.s=isNaN(se)?null:se<0?-1:1,M.c=M.e=null;else{if(!G&&(se=se.replace(Te,function(J,Z,ee){return K=(ee=ee.toLowerCase())=="x"?16:ee=="b"?2:8,re&&re!=K?J:Z}),re&&(K=re,se=se.replace(Se,"$1").replace(Ae,"0.$1")),D!=se))return new ie(se,K);if(ie.DEBUG)throw Error(u+"Not a"+(re?" base "+re:"")+" number: "+D);M.c=M.e=M.s=null}},v.absoluteValue=v.abs=function(){var M=new ie(this);return M.s<0&&(M.s=1),M},v.comparedTo=function(M,D){return E(this,new ie(M,D))},v.decimalPlaces=v.dp=function(M,D){var G,re,K;if(M!=null)return A(M,0,S),D==null?D=R:A(D,0,8),Ye(new ie(this),M+this.e+1,D);if(!(G=this.c))return null;if(re=((K=G.length-1)-y(this.e/f))*f,K=G[K])for(;K%10==0;K/=10,re--);return re<0&&(re=0),re},v.dividedBy=v.div=function(M,D){return z(this,new ie(M,D),x,R)},v.dividedToIntegerBy=v.idiv=function(M,D){return z(this,new ie(M,D),0,1)},v.exponentiatedBy=v.pow=function(M,D){var G,re,K,se,J,Z,ee,te,Q=this;if((M=new ie(M)).c&&!M.isInteger())throw Error(u+"Exponent not an integer: "+Ve(M));if(D!=null&&(D=new ie(D)),J=14<M.e,!Q.c||!Q.c[0]||Q.c[0]==1&&!Q.e&&Q.c.length==1||!M.c||!M.c[0])return te=new ie(Math.pow(+Ve(Q),J?2-O(M):+Ve(M))),D?te.mod(D):te;if(Z=M.s<0,D){if(D.c?!D.c[0]:!D.s)return new ie(NaN);(re=!Z&&Q.isInteger()&&D.isInteger())&&(Q=Q.mod(D))}else{if(9<M.e&&(0<Q.e||Q.e<-1||(Q.e==0?1<Q.c[0]||J&&24e7<=Q.c[1]:Q.c[0]<8e13||J&&Q.c[0]<=9999975e7)))return se=Q.s<0&&O(M)?-0:0,-1<Q.e&&(se=1/se),new ie(Z?1/se:se);we&&(se=l(we/f+2))}for(ee=J?(G=new ie(.5),Z&&(M.s=1),O(M)):(K=Math.abs(+Ve(M)))%2,te=new ie(w);;){if(ee){if(!(te=te.times(Q)).c)break;se?te.c.length>se&&(te.c.length=se):re&&(te=te.mod(D))}if(K){if((K=c(K/2))===0)break;ee=K%2}else if(Ye(M=M.times(G),M.e+1,1),14<M.e)ee=O(M);else{if((K=+Ve(M))==0)break;ee=K%2}Q=Q.times(Q),se?Q.c&&Q.c.length>se&&(Q.c.length=se):re&&(Q=Q.mod(D))}return re?te:(Z&&(te=w.div(te)),D?te.mod(D):se?Ye(te,we,R,void 0):te)},v.integerValue=function(M){var D=new ie(this);return M==null?M=R:A(M,0,8),Ye(D,D.e+1,M)},v.isEqualTo=v.eq=function(M,D){return E(this,new ie(M,D))===0},v.isFinite=function(){return!!this.c},v.isGreaterThan=v.gt=function(M,D){return 0<E(this,new ie(M,D))},v.isGreaterThanOrEqualTo=v.gte=function(M,D){return(D=E(this,new ie(M,D)))===1||D===0},v.isInteger=function(){return!!this.c&&y(this.e/f)>this.c.length-2},v.isLessThan=v.lt=function(M,D){return E(this,new ie(M,D))<0},v.isLessThanOrEqualTo=v.lte=function(M,D){return(D=E(this,new ie(M,D)))===-1||D===0},v.isNaN=function(){return!this.s},v.isNegative=function(){return this.s<0},v.isPositive=function(){return 0<this.s},v.isZero=function(){return!!this.c&&this.c[0]==0},v.minus=function(M,D){var G,re,K,se,J=this,Z=J.s;if(D=(M=new ie(M,D)).s,!Z||!D)return new ie(NaN);if(Z!=D)return M.s=-D,J.plus(M);var ee=J.e/f,te=M.e/f,Q=J.c,ye=M.c;if(!ee||!te){if(!Q||!ye)return Q?(M.s=-D,M):new ie(ye?J:NaN);if(!Q[0]||!ye[0])return ye[0]?(M.s=-D,M):new ie(Q[0]?J:R==3?-0:0)}if(ee=y(ee),te=y(te),Q=Q.slice(),Z=ee-te){for((K=(se=Z<0)?(Z=-Z,Q):(te=ee,ye)).reverse(),D=Z;D--;K.push(0));K.reverse()}else for(re=(se=(Z=Q.length)<(D=ye.length))?Z:D,Z=D=0;D<re;D++)if(Q[D]!=ye[D]){se=Q[D]<ye[D];break}if(se&&(K=Q,Q=ye,ye=K,M.s=-M.s),0<(D=(re=ye.length)-(G=Q.length)))for(;D--;Q[G++]=0);for(D=d-1;Z<re;){if(Q[--re]<ye[re]){for(G=re;G&&!Q[--G];Q[G]=D);--Q[G],Q[re]+=d}Q[re]-=ye[re]}for(;Q[0]==0;Q.splice(0,1),--te);return Q[0]?xe(M,Q,te):(M.s=R==3?-1:1,M.c=[M.e=0],M)},v.modulo=v.mod=function(M,D){var G,re,K=this;return M=new ie(M,D),!K.c||!M.s||M.c&&!M.c[0]?new ie(NaN):!M.c||K.c&&!K.c[0]?new ie(K):(le==9?(re=M.s,M.s=1,G=z(K,M,0,3),M.s=re,G.s*=re):G=z(K,M,0,le),(M=K.minus(G.times(M))).c[0]||le!=1||(M.s=K.s),M)},v.multipliedBy=v.times=function(M,D){var G,re,K,se,J,Z,ee,te,Q,ye,Me,Pe,Je,vt,st,qe=this,Ct=qe.c,Gt=(M=new ie(M,D)).c;if(!(Ct&&Gt&&Ct[0]&&Gt[0]))return!qe.s||!M.s||Ct&&!Ct[0]&&!Gt||Gt&&!Gt[0]&&!Ct?M.c=M.e=M.s=null:(M.s*=qe.s,Ct&&Gt?(M.c=[0],M.e=0):M.c=M.e=null),M;for(re=y(qe.e/f)+y(M.e/f),M.s*=qe.s,(ee=Ct.length)<(ye=Gt.length)&&(Je=Ct,Ct=Gt,Gt=Je,K=ee,ee=ye,ye=K),K=ee+ye,Je=[];K--;Je.push(0));for(vt=d,st=p,K=ye;0<=--K;){for(G=0,Me=Gt[K]%st,Pe=Gt[K]/st|0,se=K+(J=ee);K<se;)G=((te=Me*(te=Ct[--J]%st)+(Z=Pe*te+(Q=Ct[J]/st|0)*Me)%st*st+Je[se]+G)/vt|0)+(Z/st|0)+Pe*Q,Je[se--]=te%vt;Je[se]=G}return G?++re:Je.splice(0,1),xe(M,Je,re)},v.negated=function(){var M=new ie(this);return M.s=-M.s||null,M},v.plus=function(M,D){var G,re=this,K=re.s;if(D=(M=new ie(M,D)).s,!K||!D)return new ie(NaN);if(K!=D)return M.s=-D,re.minus(M);var se=re.e/f,J=M.e/f,Z=re.c,ee=M.c;if(!se||!J){if(!Z||!ee)return new ie(K/0);if(!Z[0]||!ee[0])return ee[0]?M:new ie(Z[0]?re:0*K)}if(se=y(se),J=y(J),Z=Z.slice(),K=se-J){for((G=0<K?(J=se,ee):(K=-K,Z)).reverse();K--;G.push(0));G.reverse()}for((K=Z.length)-(D=ee.length)<0&&(G=ee,ee=Z,Z=G,D=K),K=0;D;)K=(Z[--D]=Z[D]+ee[D]+K)/d|0,Z[D]=d===Z[D]?0:Z[D]%d;return K&&(Z=[K].concat(Z),++J),xe(M,Z,J)},v.precision=v.sd=function(M,D){var G,re,K;if(M!=null&&M!==!!M)return A(M,1,S),D==null?D=R:A(D,0,8),Ye(new ie(this),M,D);if(!(G=this.c))return null;if(re=(K=G.length-1)*f+1,K=G[K]){for(;K%10==0;K/=10,re--);for(K=G[0];10<=K;K/=10,re++);}return M&&this.e+1>re&&(re=this.e+1),re},v.shiftedBy=function(M){return A(M,-g,g),this.times("1e"+M)},v.squareRoot=v.sqrt=function(){var M,D,G,re,K,se=this,J=se.c,Z=se.s,ee=se.e,te=x+4,Q=new ie("0.5");if(Z!==1||!J||!J[0])return new ie(!Z||Z<0&&(!J||J[0])?NaN:J?se:1/0);if((G=(Z=Math.sqrt(+Ve(se)))==0||Z==1/0?(((D=C(J)).length+ee)%2==0&&(D+="0"),Z=Math.sqrt(+D),ee=y((ee+1)/2)-(ee<0||ee%2),new ie(D=Z==1/0?"1e"+ee:(D=Z.toExponential()).slice(0,D.indexOf("e")+1)+ee)):new ie(Z+"")).c[0]){for((Z=(ee=G.e)+te)<3&&(Z=0);;)if(K=G,G=Q.times(K.plus(z(se,K,te,1))),C(K.c).slice(0,Z)===(D=C(G.c)).slice(0,Z)){if(G.e<ee&&--Z,(D=D.slice(Z-3,Z+1))!="9999"&&(re||D!="4999")){+D&&(+D.slice(1)||D.charAt(0)!="5")||(Ye(G,G.e+x+2,1),M=!G.times(G).eq(se));break}if(!re&&(Ye(K,K.e+x+2,0),K.times(K).eq(se))){G=K;break}te+=4,Z+=4,re=1}}return Ye(G,G.e+x+1,R,M)},v.toExponential=function(M,D){return M!=null&&(A(M,0,S),M++),Be(this,M,D,1)},v.toFixed=function(M,D){return M!=null&&(A(M,0,S),M=M+this.e+1),Be(this,M,D)},v.toFormat=function(M,D,G){var re;if(G==null)M!=null&&D&&typeof D=="object"?(G=D,D=null):M&&typeof M=="object"?(G=M,M=D=null):G=N;else if(typeof G!="object")throw Error(u+"Argument not an object: "+G);if(re=this.toFixed(M,D),this.c){var K,se=re.split("."),J=+G.groupSize,Z=+G.secondaryGroupSize,ee=G.groupSeparator||"",te=se[0],Q=se[1],ye=this.s<0,Me=ye?te.slice(1):te,Pe=Me.length;if(Z&&(K=J,J=Z,Pe-=Z=K),0<J&&0<Pe){for(K=Pe%J||J,te=Me.substr(0,K);K<Pe;K+=J)te+=ee+Me.substr(K,J);0<Z&&(te+=ee+Me.slice(K)),ye&&(te="-"+te)}re=Q?te+(G.decimalSeparator||"")+((Z=+G.fractionGroupSize)?Q.replace(new RegExp("\\d{"+Z+"}\\B","g"),"$&"+(G.fractionGroupSeparator||"")):Q):te}return(G.prefix||"")+re+(G.suffix||"")},v.toFraction=function(M){var D,G,re,K,se,J,Z,ee,te,Q,ye,Me,Pe=this,Je=Pe.c;if(M!=null&&(!(Z=new ie(M)).isInteger()&&(Z.c||Z.s!==1)||Z.lt(w)))throw Error(u+"Argument "+(Z.isInteger()?"out of range: ":"not an integer: ")+Ve(Z));if(!Je)return new ie(Pe);for(D=new ie(w),te=G=new ie(w),re=ee=new ie(w),Me=C(Je),se=D.e=Me.length-Pe.e-1,D.c[0]=m[(J=se%f)<0?f+J:J],M=!M||0<Z.comparedTo(D)?0<se?D:te:Z,J=ne,ne=1/0,Z=new ie(Me),ee.c[0]=0;Q=z(Z,D,0,1),(K=G.plus(Q.times(re))).comparedTo(M)!=1;)G=re,re=K,te=ee.plus(Q.times(K=te)),ee=K,D=Z.minus(Q.times(K=D)),Z=K;return K=z(M.minus(G),re,0,1),ee=ee.plus(K.times(te)),G=G.plus(K.times(re)),ee.s=te.s=Pe.s,ye=z(te,re,se*=2,R).minus(Pe).abs().comparedTo(z(ee,G,se,R).minus(Pe).abs())<1?[te,re]:[ee,G],ne=J,ye},v.toNumber=function(){return+Ve(this)},v.toPrecision=function(M,D){return M!=null&&A(M,1,S),Be(this,M,D,2)},v.toString=function(M){var D,G=this,re=G.s,K=G.e;return K===null?re?(D="Infinity",re<0&&(D="-"+D)):D="NaN":(D=M==null?K<=b||B<=K?T(C(G.c),K):W(C(G.c),K,"0"):M===10?W(C((G=Ye(new ie(G),x+K+1,R)).c),G.e,"0"):(A(M,2,Fe.length,"Base"),U(W(C(G.c),K,"0"),10,M,re,!0)),re<0&&G.c[0]&&(D="-"+D)),D},v.valueOf=v.toJSON=function(){return Ve(this)},v._isBigNumber=!0,typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"&&(v[Symbol.toStringTag]="BigNumber",v[Symbol.for("nodejs.util.inspect.custom")]=v.valueOf),Y!=null&&ie.set(Y),ie}()).default=o.BigNumber=o,n!==void 0&&n.exports?n.exports=o:(s||(s=typeof self<"u"&&self?self:window),s.BigNumber=o)})(this)},{}],2:[function(r,n,i){n.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(r,n,i){function s(y,C){return function(E){if(Array.isArray(E))return E}(y)||function(E,A){var O=[],T=!0,W=!1,I=void 0;try{for(var Y,z=E[Symbol.iterator]();!(T=(Y=z.next()).done)&&(O.push(Y.value),!A||O.length!==A);T=!0);}catch(U){W=!0,I=U}finally{try{T||z.return==null||z.return()}finally{if(W)throw I}}return O}(y,C)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var o=r("./globalState"),a=r("./validating"),l=r("./parsing"),c=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],u={general:{scale:1024,suffixes:c,marker:"bd"},binary:{scale:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],marker:"b"},decimal:{scale:1e3,suffixes:c,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(y){var C=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},E=2<arguments.length?arguments[2]:void 0;if(typeof C=="string"&&(C=l.parseFormat(C)),!a.validateFormat(C))return"ERROR: invalid format";var A=C.prefix||"",O=C.postfix||"",T=function(W,I,Y){switch(I.output){case"currency":return I=S(I,o.currentCurrencyDefaultFormat()),function(Fe,ie,Be){var Ie=Be.currentCurrency(),xe=Object.assign({},h,ie),Ye=void 0,Ve="",M=!!xe.totalLength||!!xe.forceAverage||xe.average,D=ie.currencyPosition||Ie.position,G=ie.currencySymbol||Ie.symbol;xe.spaceSeparated&&(Ve=" "),D==="infix"&&(Ye=Ve+G+Ve);var re=p({instance:Fe,providedFormat:ie,state:Be,decimalSeparator:Ye});return D==="prefix"&&(re=Fe._value<0&&xe.negative==="sign"?"-".concat(Ve).concat(G).concat(re.slice(1)):G+Ve+re),D&&D!=="postfix"||(re=re+(Ve=M?"":Ve)+G),re}(W,I,o);case"percent":return I=S(I,o.currentPercentageDefaultFormat()),function(Fe,ie,Be,Ie){var xe=ie.prefixSymbol,Ye=p({instance:Ie(100*Fe._value),providedFormat:ie,state:Be}),Ve=Object.assign({},h,ie);return xe?"%".concat(Ve.spaceSeparated?" ":"").concat(Ye):"".concat(Ye).concat(Ve.spaceSeparated?" ":"","%")}(W,I,o,Y);case"byte":return I=S(I,o.currentByteDefaultFormat()),w=W,R=o,b=Y,B=(x=I).base||"binary",X=u[B],ne=f(w._value,X.suffixes,X.scale),fe=ne.value,le=ne.suffix,we=p({instance:b(fe),providedFormat:x,state:R,defaults:R.currentByteDefaultFormat()}),N=R.currentAbbreviations(),"".concat(we).concat(N.spaced?" ":"").concat(le);case"time":return I=S(I,o.currentTimeDefaultFormat()),Ae=W,q=Math.floor(Ae._value/60/60),Oe=Math.floor((Ae._value-60*q*60)/60),v=Math.round(Ae._value-60*q*60-60*Oe),"".concat(q,":").concat(Oe<10?"0":"").concat(Oe,":").concat(v<10?"0":"").concat(v);case"ordinal":return I=S(I,o.currentOrdinalDefaultFormat()),z=W,U=I,Ce=(oe=o).currentOrdinal(),pe=Object.assign({},h,U),Te=p({instance:z,providedFormat:U,state:oe}),Se=Ce(z._value),"".concat(Te).concat(pe.spaceSeparated?" ":"").concat(Se);case"number":default:return p({instance:W,providedFormat:I,numbro:Y})}var z,U,oe,Ce,pe,Te,Se,Ae,q,Oe,v,w,x,R,b,B,X,ne,fe,le,we,N}(y,C,E);return T=(T=A+T)+O}function f(y,C,E){var A=C[0],O=Math.abs(y);if(E<=O){for(var T=1;T<C.length;++T){var W=Math.pow(E,T),I=Math.pow(E,T+1);if(W<=O&&O<I){A=C[T],y/=W;break}}A===C[0]&&(y/=Math.pow(E,C.length-1),A=C[C.length-1])}return{value:y,suffix:A}}function g(y){for(var C="",E=0;E<y;E++)C+="0";return C}function m(y,C){return y.toString().indexOf("e")!==-1?function(E,A){var O=E.toString(),T=s(O.split("e"),2),W=T[0],I=T[1],Y=s(W.split("."),2),z=Y[0],U=Y[1],oe=U===void 0?"":U;if(0<+I)O=z+oe+g(I-oe.length);else{var Ce=".";Ce=+z<0?"-0".concat(Ce):"0".concat(Ce);var pe=(g(-I-1)+Math.abs(z)+oe).substr(0,A);pe.length<A&&(pe+=g(A-pe.length)),O=Ce+pe}return 0<+I&&0<A&&(O+=".".concat(g(A))),O}(y,C):(Math.round(+"".concat(y,"e+").concat(C))/Math.pow(10,C)).toFixed(C)}function p(y){var C=y.instance,E=y.providedFormat,A=y.state,O=A===void 0?o:A,T=y.decimalSeparator,W=y.defaults,I=W===void 0?O.currentDefaults():W,Y=C._value;if(Y===0&&O.hasZeroFormat())return O.getZeroFormat();if(!isFinite(Y))return Y.toString();var z,U,oe,Ce,pe,Te,Se,Ae,q=Object.assign({},h,I,E),Oe=q.totalLength,v=Oe?0:q.characteristic,w=q.optionalCharacteristic,x=q.forceAverage,R=!!Oe||!!x||q.average,b=Oe?-1:R&&E.mantissa===void 0?0:q.mantissa,B=!Oe&&(E.optionalMantissa===void 0?b===-1:q.optionalMantissa),X=q.trimMantissa,ne=q.thousandSeparated,fe=q.spaceSeparated,le=q.negative,we=q.forceSign,N=q.exponential,Fe="";if(R){var ie=function(M){var D=M.value,G=M.forceAverage,re=M.abbreviations,K=M.spaceSeparated,se=K!==void 0&&K,J=M.totalLength,Z=J===void 0?0:J,ee="",te=Math.abs(D),Q=-1;if(te>=Math.pow(10,12)&&!G||G==="trillion"?(ee=re.trillion,D/=Math.pow(10,12)):te<Math.pow(10,12)&&te>=Math.pow(10,9)&&!G||G==="billion"?(ee=re.billion,D/=Math.pow(10,9)):te<Math.pow(10,9)&&te>=Math.pow(10,6)&&!G||G==="million"?(ee=re.million,D/=Math.pow(10,6)):(te<Math.pow(10,6)&&te>=Math.pow(10,3)&&!G||G==="thousand")&&(ee=re.thousand,D/=Math.pow(10,3)),ee&&(ee=(se?" ":"")+ee),Z){var ye=D.toString().split(".")[0];Q=Math.max(Z-ye.length,0)}return{value:D,abbreviation:ee,mantissaPrecision:Q}}({value:Y,forceAverage:x,abbreviations:O.currentAbbreviations(),spaceSeparated:fe,totalLength:Oe});Y=ie.value,Fe+=ie.abbreviation,Oe&&(b=ie.mantissaPrecision)}if(N){var Be=(U=(z={value:Y,characteristicPrecision:v}).value,oe=z.characteristicPrecision,Ce=oe===void 0?0:oe,pe=s(U.toExponential().split("e"),2),Te=pe[0],Se=pe[1],Ae=+Te,Ce&&1<Ce&&(Ae*=Math.pow(10,Ce-1),Se=0<=(Se=+Se-(Ce-1))?"+".concat(Se):Se),{value:Ae,abbreviation:"e".concat(Se)});Y=Be.value,Fe=Be.abbreviation+Fe}var Ie,xe,Ye,Ve=function(M,D,G,re,K){if(re===-1)return M;var se=m(D,re),J=s(se.toString().split("."),2),Z=J[0],ee=J[1],te=ee===void 0?"":ee;if(te.match(/^0+$/)&&(G||K))return Z;var Q=te.match(/0+$/);return K&&Q?"".concat(Z,".").concat(te.toString().slice(0,Q.index)):se.toString()}(Y.toString(),Y,B,b,X);return Ve=function(M,D,G,re,K){var se=re.currentDelimiters(),J=se.thousands;K=K||se.decimal;var Z=se.thousandsSize||3,ee=M.toString(),te=ee.split(".")[0],Q=ee.split(".")[1];return G&&(D<0&&(te=te.slice(1)),function(ye,Me){for(var Pe=[],Je=0,vt=ye;0<vt;vt--)Je===Me&&(Pe.unshift(vt),Je=0),Je++;return Pe}(te.length,Z).forEach(function(ye,Me){te=te.slice(0,ye+Me)+J+te.slice(ye+Me)}),D<0&&(te="-".concat(te))),ee=Q?te+K+Q:te}(Ve=function(M,D,G,re){var K=M,se=s(K.toString().split("."),2),J=se[0],Z=se[1];if(J.match(/^-?0$/)&&G)return Z?"".concat(J.replace("0",""),".").concat(Z):J.replace("0","");if(J.length<re)for(var ee=re-J.length,te=0;te<ee;te++)K="0".concat(K);return K.toString()}(Ve,0,w,v),Y,ne,O,T),(R||N)&&(Ve=Ve+Fe),(we||Y<0)&&(Ie=Ve,Ye=le,Ve=(xe=Y)===0?Ie:+Ie==0?Ie.replace("-",""):0<xe?"+".concat(Ie):Ye==="sign"?Ie:"(".concat(Ie.replace("-",""),")")),Ve}function S(y,C){if(!y)return C;var E=Object.keys(y);return E.length===1&&E[0]==="output"?C:y}n.exports=function(y){return{format:function(){for(var C=arguments.length,E=new Array(C),A=0;A<C;A++)E[A]=arguments[A];return d.apply(void 0,E.concat([y]))},getByteUnit:function(){for(var C=arguments.length,E=new Array(C),A=0;A<C;A++)E[A]=arguments[A];return function(O){var T=u.general;return f(O._value,T.suffixes,T.scale).suffix}.apply(void 0,E.concat([y]))},getBinaryByteUnit:function(){for(var C=arguments.length,E=new Array(C),A=0;A<C;A++)E[A]=arguments[A];return function(O){var T=u.binary;return f(O._value,T.suffixes,T.scale).suffix}.apply(void 0,E.concat([y]))},getDecimalByteUnit:function(){for(var C=arguments.length,E=new Array(C),A=0;A<C;A++)E[A]=arguments[A];return function(O){var T=u.decimal;return f(O._value,T.suffixes,T.scale).suffix}.apply(void 0,E.concat([y]))},formatOrDefault:S}}},{"./globalState":4,"./parsing":8,"./validating":10}],4:[function(r,n,i){var s=r("./en-US"),o=r("./validating"),a=r("./parsing"),l={},c=void 0,u={},h=null,d={};function f(m){c=m}function g(){return u[c]}l.languages=function(){return Object.assign({},u)},l.currentLanguage=function(){return c},l.currentCurrency=function(){return g().currency},l.currentAbbreviations=function(){return g().abbreviations},l.currentDelimiters=function(){return g().delimiters},l.currentOrdinal=function(){return g().ordinal},l.currentDefaults=function(){return Object.assign({},g().defaults,d)},l.currentOrdinalDefaultFormat=function(){return Object.assign({},l.currentDefaults(),g().ordinalFormat)},l.currentByteDefaultFormat=function(){return Object.assign({},l.currentDefaults(),g().byteFormat)},l.currentPercentageDefaultFormat=function(){return Object.assign({},l.currentDefaults(),g().percentageFormat)},l.currentCurrencyDefaultFormat=function(){return Object.assign({},l.currentDefaults(),g().currencyFormat)},l.currentTimeDefaultFormat=function(){return Object.assign({},l.currentDefaults(),g().timeFormat)},l.setDefaults=function(m){m=a.parseFormat(m),o.validateFormat(m)&&(d=m)},l.getZeroFormat=function(){return h},l.setZeroFormat=function(m){return h=typeof m=="string"?m:null},l.hasZeroFormat=function(){return h!==null},l.languageData=function(m){if(m){if(u[m])return u[m];throw new Error('Unknown tag "'.concat(m,'"'))}return g()},l.registerLanguage=function(m){var p=1<arguments.length&&arguments[1]!==void 0&&arguments[1];if(!o.validateLanguage(m))throw new Error("Invalid language data");u[m.languageTag]=m,p&&f(m.languageTag)},l.setLanguage=function(m){var p=1<arguments.length&&arguments[1]!==void 0?arguments[1]:s.languageTag;if(!u[m]){var S=m.split("-")[0],y=Object.keys(u).find(function(C){return C.split("-")[0]===S});return u[y]?void f(y):void f(p)}f(m)},l.registerLanguage(s),c=s.languageTag,n.exports=l},{"./en-US":2,"./parsing":8,"./validating":10}],5:[function(r,n,i){n.exports=function(s){return{loadLanguagesInNode:function(o){return a=s,void o.forEach(function(l){var c=void 0;try{c=r("../languages/".concat(l))}catch{console.error('Unable to load "'.concat(l,'". No matching language file found.'))}c&&a.registerLanguage(c)});var a}}}},{}],6:[function(r,n,i){var s=r("bignumber.js");function o(a,l,c){var u=new s(a._value),h=l;return c.isNumbro(l)&&(h=l._value),h=new s(h),a._value=u.minus(h).toNumber(),a}n.exports=function(a){return{add:function(l,c){return h=c,d=a,f=new s((u=l)._value),g=h,d.isNumbro(h)&&(g=h._value),g=new s(g),u._value=f.plus(g).toNumber(),u;var u,h,d,f,g},subtract:function(l,c){return o(l,c,a)},multiply:function(l,c){return h=c,d=a,f=new s((u=l)._value),g=h,d.isNumbro(h)&&(g=h._value),g=new s(g),u._value=f.times(g).toNumber(),u;var u,h,d,f,g},divide:function(l,c){return h=c,d=a,f=new s((u=l)._value),g=h,d.isNumbro(h)&&(g=h._value),g=new s(g),u._value=f.dividedBy(g).toNumber(),u;var u,h,d,f,g},set:function(l,c){return u=l,d=h=c,a.isNumbro(h)&&(d=h._value),u._value=d,u;var u,h,d},difference:function(l,c){return u=c,o(d=(h=a)(l._value),u,h),Math.abs(d._value);var u,h,d}}}},{"bignumber.js":1}],7:[function(r,n,i){function s(p,S){for(var y=0;y<S.length;y++){var C=S[y];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(p,C.key,C)}}var o=r("./globalState"),a=r("./validating"),l=r("./loading")(m),c=r("./unformatting"),u=r("./formatting")(m),h=r("./manipulating")(m),d=r("./parsing"),f=function(){function p(C){(function(E,A){if(!(E instanceof A))throw new TypeError("Cannot call a class as a function")})(this,p),this._value=C}var S,y;return S=p,(y=[{key:"clone",value:function(){return m(this._value)}},{key:"format",value:function(){var C=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return u.format(this,C)}},{key:"formatCurrency",value:function(C){return typeof C=="string"&&(C=d.parseFormat(C)),(C=u.formatOrDefault(C,o.currentCurrencyDefaultFormat())).output="currency",u.format(this,C)}},{key:"formatTime",value:function(){var C=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return C.output="time",u.format(this,C)}},{key:"binaryByteUnits",value:function(){return u.getBinaryByteUnit(this)}},{key:"decimalByteUnits",value:function(){return u.getDecimalByteUnit(this)}},{key:"byteUnits",value:function(){return u.getByteUnit(this)}},{key:"difference",value:function(C){return h.difference(this,C)}},{key:"add",value:function(C){return h.add(this,C)}},{key:"subtract",value:function(C){return h.subtract(this,C)}},{key:"multiply",value:function(C){return h.multiply(this,C)}},{key:"divide",value:function(C){return h.divide(this,C)}},{key:"set",value:function(C){return h.set(this,g(C))}},{key:"value",value:function(){return this._value}},{key:"valueOf",value:function(){return this._value}}])&&s(S.prototype,y),p}();function g(p){var S=p;return m.isNumbro(p)?S=p._value:typeof p=="string"?S=m.unformat(p):isNaN(p)&&(S=NaN),S}function m(p){return new f(g(p))}m.version="2.1.2",m.isNumbro=function(p){return p instanceof f},m.language=o.currentLanguage,m.registerLanguage=o.registerLanguage,m.setLanguage=o.setLanguage,m.languages=o.languages,m.languageData=o.languageData,m.zeroFormat=o.setZeroFormat,m.defaultFormat=o.currentDefaults,m.setDefaults=o.setDefaults,m.defaultCurrencyFormat=o.currentCurrencyDefaultFormat,m.validate=a.validate,m.loadLanguagesInNode=l.loadLanguagesInNode,m.unformat=c.unformat,n.exports=m},{"./formatting":3,"./globalState":4,"./loading":5,"./manipulating":6,"./parsing":8,"./unformatting":9,"./validating":10}],8:[function(r,n,i){n.exports={parseFormat:function(s){var o,a,l,c,u,h,d,f,g,m,p,S,y,C,E,A,O,T,W,I,Y=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return typeof s!="string"?s:(a=Y,s=(l=(o=s).match(/^{([^}]*)}/))?(a.prefix=l[1],o.slice(l[0].length)):o,u=Y,function(z,U){if(z.indexOf("$")===-1){if(z.indexOf("%")===-1)return z.indexOf("bd")!==-1?(U.output="byte",U.base="general"):z.indexOf("b")!==-1?(U.output="byte",U.base="binary"):z.indexOf("d")!==-1?(U.output="byte",U.base="decimal"):z.indexOf(":")===-1?z.indexOf("o")!==-1&&(U.output="ordinal"):U.output="time";U.output="percent"}else U.output="currency"}(s=(h=(c=s).match(/{([^}]*)}$/))?(u.postfix=h[1],c.slice(0,-h[0].length)):c,Y),d=Y,(f=s.match(/[1-9]+[0-9]*/))&&(d.totalLength=+f[0]),g=Y,(m=s.split(".")[0].match(/0+/))&&(g.characteristic=m[0].length),function(z,U){if(z.indexOf(".")!==-1){var oe=z.split(".")[0];U.optionalCharacteristic=oe.indexOf("0")===-1}}(s,Y),p=Y,s.indexOf("a")!==-1&&(p.average=!0),y=Y,(S=s).indexOf("K")!==-1?y.forceAverage="thousand":S.indexOf("M")!==-1?y.forceAverage="million":S.indexOf("B")!==-1?y.forceAverage="billion":S.indexOf("T")!==-1&&(y.forceAverage="trillion"),function(z,U){var oe=z.split(".")[1];if(oe){var Ce=oe.match(/0+/);Ce&&(U.mantissa=Ce[0].length)}}(s,Y),E=Y,(C=s).match(/\[\.]/)?E.optionalMantissa=!0:C.match(/\./)&&(E.optionalMantissa=!1),A=Y,s.indexOf(",")!==-1&&(A.thousandSeparated=!0),O=Y,s.indexOf(" ")!==-1&&(O.spaceSeparated=!0),W=Y,(T=s).match(/^\+?\([^)]*\)$/)&&(W.negative="parenthesis"),T.match(/^\+?-/)&&(W.negative="sign"),I=Y,s.match(/^\+/)&&(I.forceSign=!0),Y)}}},{}],9:[function(r,n,i){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,c){var u=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,f=5<arguments.length?arguments[5]:void 0,g=6<arguments.length?arguments[6]:void 0;if(l!=="")return l===d?0:function m(p,S){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:"",C=3<arguments.length?arguments[3]:void 0,E=4<arguments.length?arguments[4]:void 0,A=5<arguments.length?arguments[5]:void 0,O=6<arguments.length?arguments[6]:void 0;if(!isNaN(+p))return+p;var T="",W=p.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(W!==p)return-1*m(W,S,y,C,E,A,O);for(var I=0;I<s.length;I++){var Y=s[I];if((T=p.replace(Y.key,""))!==p)return m(T,S,y,C,E,A,O)*Y.factor}if((T=p.replace("%",""))!==p)return m(T,S,y,C,E,A,O)/100;var z=parseFloat(p);if(!isNaN(z)){var U=C(z);if(U&&U!=="."&&(T=p.replace(new RegExp("".concat(o(U),"$")),""))!==p)return m(T,S,y,C,E,A,O);var oe={};Object.keys(A).forEach(function(Oe){oe[A[Oe]]=Oe});for(var Ce=Object.keys(oe).sort().reverse(),pe=Ce.length,Te=0;Te<pe;Te++){var Se=Ce[Te],Ae=oe[Se];if((T=p.replace(Se,""))!==p){var q=void 0;switch(Ae){case"thousand":q=Math.pow(10,3);break;case"million":q=Math.pow(10,6);break;case"billion":q=Math.pow(10,9);break;case"trillion":q=Math.pow(10,12)}return m(T,S,y,C,E,A,O)*q}}}}(function(m,p){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:"",y=m.replace(S,"");return y=(y=y.replace(new RegExp("([0-9])".concat(o(p.thousands),"([0-9])"),"g"),"$1$2")).replace(p.decimal,".")}(l,c,u),c,u,h,d,f,g)}n.exports={unformat:function(l,c){var u,h,d,f=r("./globalState"),g=f.currentDelimiters(),m=f.currentCurrency().symbol,p=f.currentOrdinal(),S=f.getZeroFormat(),y=f.currentAbbreviations(),C=void 0;if(typeof l=="string")C=function(E,A){if(!E.indexOf(":")||A.thousands===":")return!1;var O=E.split(":");if(O.length!==3)return!1;var T=+O[0],W=+O[1],I=+O[2];return!isNaN(T)&&!isNaN(W)&&!isNaN(I)}(l,g)?(u=l.split(":"),h=+u[0],d=+u[1],+u[2]+60*d+3600*h):a(l,g,m,p,S,y,c);else{if(typeof l!="number")return;C=l}if(C!==void 0)return C}}},{"./globalState":4}],10:[function(r,n,i){function s(g){return function(m){if(Array.isArray(m)){for(var p=0,S=new Array(m.length);p<m.length;p++)S[p]=m[p];return S}}(g)||function(m){if(Symbol.iterator in Object(m)||Object.prototype.toString.call(m)==="[object Arguments]")return Array.from(m)}(g)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function o(g){return(o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m})(g)}var a=r("./unformatting"),l=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,c={output:{type:"string",validValues:["currency","percent","byte","time","ordinal","number"]},base:{type:"string",validValues:["decimal","binary","general"],restriction:function(g,m){return m.output==="byte"},message:"`base` must be provided only when the output is `byte`",mandatory:function(g){return g.output==="byte"}},characteristic:{type:"number",restriction:function(g){return 0<=g},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(g){return 0<=g},message:"value must be positive"},{restriction:function(g,m){return!m.exponential},message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:function(g){return 0<=g},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(g,m){return m.output==="percent"},message:"`prefixSymbol` can be provided only when the output is `percent`"}},u={languageTag:{type:"string",mandatory:!0,restriction:function(g){return g.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(g){return!!a.unformat(g)}function d(g,m,p){var S=3<arguments.length&&arguments[3]!==void 0&&arguments[3],y=Object.keys(g).map(function(C){if(!m[C])return console.error("".concat(p," Invalid key: ").concat(C)),!1;var E=g[C],A=m[C];if(typeof A=="string"&&(A={type:A}),A.type==="format"){if(!d(E,c,"[Validate ".concat(C,"]"),!0))return!1}else if(o(E)!==A.type)return console.error("".concat(p," ").concat(C,' type mismatched: "').concat(A.type,'" expected, "').concat(o(E),'" provided')),!1;if(A.restrictions&&A.restrictions.length)for(var O=A.restrictions.length,T=0;T<O;T++){var W=A.restrictions[T],I=W.restriction,Y=W.message;if(!I(E,g))return console.error("".concat(p," ").concat(C," invalid value: ").concat(Y)),!1}return A.restriction&&!A.restriction(E,g)?(console.error("".concat(p," ").concat(C," invalid value: ").concat(A.message)),!1):A.validValues&&A.validValues.indexOf(E)===-1?(console.error("".concat(p," ").concat(C," invalid value: must be among ").concat(JSON.stringify(A.validValues),', "').concat(E,'" provided')),!1):!(A.children&&!d(E,A.children,"[Validate ".concat(C,"]")))});return S||y.push.apply(y,s(Object.keys(m).map(function(C){var E=m[C];if(typeof E=="string"&&(E={type:E}),E.mandatory){var A=E.mandatory;if(typeof A=="function"&&(A=A(g)),A&&g[C]===void 0)return console.error("".concat(p,' Missing mandatory key "').concat(C,'"')),!1}return!0}))),y.reduce(function(C,E){return C&&E},!0)}function f(g){return d(g,c,"[Validate format]")}n.exports={validate:function(g,m){var p=h(g),S=f(m);return p&&S},validateFormat:f,validateInput:h,validateLanguage:function(g){return d(g,u,"[Validate language]")}}},{"./unformatting":9}]},{},[7])(7)})})(R2);var gae=R2.exports;const kl=bF(gae),mae="numeric";function T2(t,e){if(Hn(t)){const r=e.numericFormat,n=r&&r.culture||"-",i=r&&r.pattern;if(typeof n<"u"&&!kl.languages()[n]){const s=n.replace("-",""),o=kl.allLanguages?kl.allLanguages[n]:kl[s];o&&kl.registerLanguage(o)}kl.setLanguage(n),t=kl(t).format(i||"0")}return t}function GE(t,e,r,n,i,s,o){let a=s;if(Hn(a)){const l=o.className||"",c=l.length?l.split(" "):[];a=T2(a,o),c.indexOf("htLeft")<0&&c.indexOf("htCenter")<0&&c.indexOf("htRight")<0&&c.indexOf("htJustify")<0&&c.push("htRight"),c.indexOf("htNumeric")<0&&c.push("htNumeric"),o.className=c.join(" "),e.dir="ltr"}wa(t,e,r,n,i,a,o)}GE.RENDERER_TYPE=mae;const pae="password";function jE(t,e,r,n,i,s,o){wa.apply(this,[t,e,r,n,i,s,o]);const a=o.hashLength||e.innerHTML.length,l=o.hashSymbol||"*";let c="";Ue(a-1,()=>{c+=l}),Ch(e,c)}jE.RENDERER_TYPE=pae;const wae="select";function KE(t,e,r,n,i,s,o){wa.apply(this,[t,e,r,n,i,s,o])}KE.RENDERER_TYPE=wae;const vae="time";function XE(t,e,r,n,i,s,o){wa.apply(this,[t,e,r,n,i,s,o]),e.dir="ltr"}XE.RENDERER_TYPE=vae;function Cae(){Ii(yh),Ii(Cg),Ii(UE),Ii(WE),Ii(zE),Ii(VE),Ii(GE),Ii(jE),Ii(KE),Ii(wa),Ii(XE)}const Sae="autocomplete";function $w(t,e){let r=t;if(r==null&&(r=""),this.allowEmpty&&r===""){e(!0);return}this.strict&&this.source?typeof this.source=="function"?this.source(r,EM(r,e)):EM(r,e)(this.source):e(!0)}$w.VALIDATOR_TYPE=Sae;function EM(t,e){const r=t;return function(n){let i=!1;for(let s=0,o=n.length;s<o;s++)if(r===n[s]){i=!0;break}e(i)}}function xae(t){const e=new Date(t);return isNaN(new Date(`${t}T00:00`).getDate())?e:new Date(e.getTime()+e.getTimezoneOffset()*6e4)}const yae="date";function qE(t,e){const r=fN(v2,this.instance);let n=t,i=!0;n==null&&(n="");let s=be(n,this.dateFormat||r.defaultDateFormat,!0).isValid(),o=be(new Date(n)).isValid()||s;if(this.allowEmpty&&n===""&&(o=!0,s=!0),o||(i=!1),!o&&s&&(i=!0),o&&!s)if(this.correctFormat===!0){const a=bae(n,this.dateFormat);this.instance.setDataAtCell(this.visualRow,this.visualCol,a,"dateValidator"),i=!0}else i=!1;e(i)}qE.VALIDATOR_TYPE=yae;function bae(t,e){const r=be(xae(t)),n=be(t,e),i=t.search(/[A-z]/g)>-1;let s;return r.isValid()&&r.format("x")===n.format("x")||!n.isValid()||i?s=r:s=n,s.format(e)}const Eae="dropdown";function ZE(t,e){$w.apply(this,[t,e])}ZE.VALIDATOR_TYPE=Eae;const Rae="numeric";function JE(t,e){let r=t;r==null&&(r=""),this.allowEmpty&&r===""?e(!0):e(r===""?!1:Hn(t))}JE.VALIDATOR_TYPE=Rae;const Tae=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],_ae="time";function QE(t,e){const r=this.timeFormat||"h:mm:ss a";let n=!0,i=t;i===null&&(i=""),i=/^\d{3,}$/.test(i)?parseInt(i,10):i;const s=/^\d{1,2}$/.test(i);s&&(i+=":00");const o=be(i,Tae,!0).isValid()?be(i):be(i,r);let a=o.isValid(),l=be(i,r,!0).isValid()&&!s;if(this.allowEmpty&&i===""&&(a=!0,l=!0),a||(n=!1),!a&&l&&(n=!0),a&&!l)if(this.correctFormat===!0){const c=o.format(r);this.instance.setDataAtCell(this.visualRow,this.visualCol,c,"timeValidator"),n=!0}else n=!1;e(n)}QE.VALIDATOR_TYPE=_ae;function Aae(){Pu($w),Pu(ZE),Pu(qE),Pu(JE),Pu(QE)}const Mae="autocomplete",Iae={CELL_TYPE:Mae,editor:LE,renderer:yh,validator:$w},Oae="checkbox",Pae={CELL_TYPE:Oae,editor:w2,renderer:UE},Dae="date";function _2(t,e,r,n,i,s,o){yh.apply(this,[t,e,r,n,i,s,o])}_2.RENDERER_TYPE=Dae;const kae="date",Nae={CELL_TYPE:kae,editor:C2,renderer:_2,validator:qE},Hae="dropdown",Fae={CELL_TYPE:Hae,editor:BE,renderer:WE,validator:ZE},Lae="handsontable",$ae={CELL_TYPE:Lae,editor:FE,renderer:zE},Bae="numeric",Vae={CELL_TYPE:Bae,editor:S2,renderer:GE,validator:JE,dataType:"number"},Wae="password",Uae={CELL_TYPE:Wae,editor:x2,renderer:jE,copyable:!1},Yae="select",zae={CELL_TYPE:Yae,editor:y2,renderer:KE},Gae="time",jae={CELL_TYPE:Gae,editor:b2,renderer:XE,validator:QE};function Kae(){ls(Iae),ls(Pae),ls(Nae),ls(Fae),ls($ae),ls(Vae),ls(Uae),ls(zae),ls(g2),ls(jae)}function Xae(t,e){A2(t,e),e.add(t)}function qae(t,e,r){A2(t,e),e.set(t,r)}function A2(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function su(t,e,r){return e=Zae(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zae(t){var e=Jae(t,"string");return typeof e=="symbol"?e:e+""}function Jae(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ou(t,e){return t.get(M2(t,e))}function M2(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const RM=new Map([["plugin",fee],["cell-type",s2],["editor",dN],["renderer",SN],["validator",xN]]),Qae="base",kC=[];let Ws=null;var Nl=new WeakMap,TM=new WeakSet;class Pt{static get PLUGIN_KEY(){return Qae}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}constructor(e){Xae(this,TM),su(this,"eventManager",new As(this)),su(this,"pluginName",null),su(this,"pluginsInitializedCallbacks",[]),su(this,"isPluginsReady",!1),su(this,"enabled",!1),su(this,"initialized",!1),qae(this,Nl,{}),ma(this,"hot",e,{writable:!1}),Ws=null,this.hot.addHook("afterPluginsInitialized",()=>this.onAfterPluginsInitialized()),this.hot.addHook("afterUpdateSettings",r=>this.onUpdateSettings(r)),this.hot.addHook("beforeInit",()=>this.init())}init(){this.pluginName=this.hot.getPluginName(this);const e=this.constructor.PLUGIN_DEPS,r=Array.isArray(e)?e:[];if(r.length>0){const i=[];if(r.forEach(s=>{const[o,a]=s.split(":");if(!RM.has(o))throw new Error(`Unknown plugin dependency type "${o}" was found.`);RM.get(o)(a)||i.push(` - ${a} (${o})`)}),i.length>0){const s=[`The ${this.pluginName} plugin requires the following modules:
  105. `,`${i.join(`
  106. `)}
  107. `].join("");kC.push(s)}}if(Ws||(Ws=CN()),Ws.indexOf("UndoRedo")>=0&&Ws.splice(Ws.indexOf("UndoRedo"),1),Ws.indexOf(this.pluginName)>=0&&Ws.splice(Ws.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()}),Ws.length===0){if(kC.length>0){const i=[`${kC.join(`
  108. `)}
  109. `,"You have to import and register them manually."].join("");throw new Error(i)}this.hot.runHooks("afterPluginsInitialized")}this.initialized=!0}enablePlugin(){this.enabled=!0}disablePlugin(){var e;(e=this.eventManager)===null||e===void 0||e.clear(),this.clearHooks(),this.enabled=!1}addHook(e,r,n){ou(Nl,this)[e]=ou(Nl,this)[e]||[];const i=ou(Nl,this)[e];this.hot.addHook(e,r,n),i.push(r),ou(Nl,this)[e]=i}removeHooks(e){j(ou(Nl,this)[e]||[],r=>{this.hot.removeHook(e,r)})}clearHooks(){const e=ou(Nl,this);dt(e,(r,n)=>this.removeHooks(n)),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){j(this.pluginsInitializedCallbacks,e=>e()),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){const r=M2(TM,this,ele).call(this,e);this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&r&&this.updatePlugin(e))}updatePlugin(){}destroy(){var e;(e=this.eventManager)===null||e===void 0||e.destroy(),this.clearHooks(),dt(this,(r,n)=>{n!=="hot"&&(this[n]=null)}),delete this.t,delete this.hot}}function ele(t){if(!t)return!1;const e=this.constructor.SETTING_KEYS;if(typeof e=="boolean")return e;for(let r=0;r<e.length;r++)if(t[e[r]]!==void 0)return!0;return!1}function Hl(t,e,r){return e=tle(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tle(t){var e=rle(t,"string");return typeof e=="symbol"?e:e+""}function rle(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}let I2=class{constructor(e){Hl(this,"hot",null),Hl(this,"container",null),Hl(this,"injected",!1),Hl(this,"rows",[]),Hl(this,"columns",[]),Hl(this,"samples",null),Hl(this,"settings",{useHeaders:!0}),this.hot=e}addRow(e,r){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 n={row:e};this.rows.push(n),this.samples=r,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),n.table=this.table.table}addColumnHeadersRow(e){const r=this.hot.getColHeader(0);if(r!=null){const n={row:-1};this.rows.push(n),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),n.table=this.table.table}}addColumn(e,r){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 n={col:e};this.columns.push(n),this.samples=r,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),n.table=this.table.table}getHeights(e){this.injected||this.injectTable(),j(this.rows,r=>{e(r.row,pr(r.table)-1)})}getWidths(e){this.injected||this.injectTable(),j(this.columns,r=>{const{width:n}=r.table.getBoundingClientRect();e(r.col,Math.ceil(n))})}setSettings(e){this.settings=e}setSetting(e,r){this.settings||(this.settings={}),this.settings[e]=r}getSettings(){return this.settings}getSetting(e){return this.settings?this.settings[e]:null}createColGroupsCol(e){const r=this.hot.rootDocument.createDocumentFragment();return this.hot.hasRowHeaders()&&r.appendChild(this.createColElement(-1,-1)),this.samples.forEach(n=>{j(n.strings,i=>{r.appendChild(this.createColElement(i.col,e))})}),r}createRow(e){const{rootDocument:r}=this.hot,n=r.createDocumentFragment(),i=r.createElement("th");return this.hot.hasRowHeaders()&&(this.hot.view.appendRowHeader(e,i),n.appendChild(i)),this.samples.forEach(s=>{j(s.strings,o=>{const a=o.col,l=this.hot.getCellMeta(e,a),c=this.hot.getCellRenderer(l),u=r.createElement("td");u.setAttribute("ghost-table",1),c(this.hot,u,e,a,this.hot.colToProp(a),o.value,l),n.appendChild(u)})}),n}appendColumnHeadersRow(){const{rootDocument:e}=this.hot,r=e.createDocumentFragment(),n=[];if(this.hot.hasRowHeaders()){const i=e.createElement("th");n.push([-1,i]),r.appendChild(i)}this.samples.forEach(i=>{j(i.strings,s=>{const o=s.col,a=e.createElement("th");n.push([o,a]),r.appendChild(a)})}),this.table.tHead.appendChild(r),j(n,i=>{const[s,o]=i;this.hot.view.appendColHeader(s,o)})}createCol(e){const{rootDocument:r}=this.hot,n=r.createDocumentFragment();return this.samples.forEach(i=>{j(i.strings,s=>{const o=s.row,a=this.hot.getCellMeta(o,e),l=this.hot.getCellRenderer(a),c=r.createElement("td"),u=r.createElement("tr");c.setAttribute("ghost-table",1),l(this.hot,c,o,e,this.hot.colToProp(e),s.value,a),u.appendChild(c),n.appendChild(u)})}),n}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,r){const n=this.hot.rootDocument.createElement("col");let i=0;r>=0&&e>=0&&(i=this.hot.getCellMeta(r,e).colspan);let s=this.hot.getColWidth(e);if(i>1)for(let o=e+1;o<e+i;o++)s+=this.hot.getColWidth(o);return n.style.width=`${s}px`,n}createTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:r}=this.hot,n=r.createDocumentFragment(),i=r.createElement("table"),s=r.createElement("thead"),o=r.createElement("tbody"),a=r.createElement("colgroup"),l=r.createElement("tr"),c=r.createElement("th");return this.isVertical()&&i.appendChild(a),this.isHorizontal()&&(l.appendChild(c),s.appendChild(l),i.style.tableLayout="auto",i.style.width="auto"),i.appendChild(s),this.isVertical()&&o.appendChild(l),i.appendChild(o),Re(i,e),n.appendChild(i),{fragment:n,table:i,tHead:s,tBody:o,colGroup:a,tr:l,th:c}}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:r}=this.hot,n=r.createDocumentFragment(),i=r.createElement("div"),s=`htGhostTable htAutoSize ${e.trim()}`;return Re(i,s),n.appendChild(i),{fragment:n,container:i}}isVertical(){return!!(this.rows.length&&!this.columns.length)}isHorizontal(){return!!(this.columns.length&&!this.rows.length)}};function F0(t,e,r){return e=nle(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nle(t){var e=ile(t,"string");return typeof e=="symbol"?e:e+""}function ile(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Bw{static get SAMPLE_COUNT(){return 3}constructor(e){F0(this,"samples",null),F0(this,"dataFactory",null),F0(this,"customSampleCount",null),F0(this,"allowDuplicates",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:Bw.SAMPLE_COUNT}setSampleCount(e){this.customSampleCount=e}setAllowDuplicates(e){this.allowDuplicates=e}generateRowSamples(e,r){return this.generateSamples("row",r,e)}generateColumnSamples(e,r){return this.generateSamples("col",r,e)}generateSamples(e,r,n){const i=new Map,{from:s,to:o}=typeof n=="number"?{from:n,to:n}:n;return Ue(s,o,a=>{const l=this.generateSample(e,r,a);i.set(a,l)}),i}generateSample(e,r,n){if(e!=="row"&&e!=="col")throw new Error("Unsupported sample type");const i=new Map,s=e==="row"?"col":"row",o=[];return Ue(r.from,r.to,a=>{const l=e==="row"?this.dataFactory(n,a):this.dataFactory(a,n);if(l===!1)return;const{value:c,bundleSeed:u}=l,h=typeof u=="string"&&u.length>0;let d;h?d=u:at(c)?d=`${Object.keys(c).length}`:Array.isArray(c)?d=`${c.length}`:d=`${Ar(c).length}`,i.has(d)||i.set(d,{needed:this.getSampleCount(),strings:[]});const f=i.get(d);f.needed&&(!(o.indexOf(c)>-1)||this.allowDuplicates||h)&&(f.strings.push({value:c,[s]:a}),o.push(c),f.needed-=1)}),i}}function sle(t,e){O2(t,e),e.add(t)}function ole(t,e,r){O2(t,e),e.set(t,r)}function O2(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function au(t,e,r){return e=ale(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ale(t){var e=lle(t,"string");return typeof e=="symbol"?e:e+""}function lle(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cle(t,e,r){return t.set(Vo(t,e),r),r}function L0(t,e){return t.get(Vo(t,e))}function Vo(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}He.getSingleton().register("modifyAutoColumnSizeSeed");const Qh="autoColumnSize",ule=10,hle="autoColumnSize";var Du=new WeakMap,Ra=new WeakSet;class nf extends Pt{static get PLUGIN_KEY(){return Qh}static get PLUGIN_PRIORITY(){return ule}static get SETTING_KEYS(){return!0}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 50}constructor(e){super(e),sle(this,Ra),au(this,"ghostTable",new I2(this.hot)),au(this,"samplesGenerator",new Bw((r,n)=>{const i=this.hot.toPhysicalRow(r),s=this.hot.toPhysicalColumn(n);if(this.hot.rowIndexMapper.isHidden(i)||this.hot.columnIndexMapper.isHidden(s))return!1;const o=this.hot.getCellMeta(r,n);let a="";o.spanned||(a=this.hot.getDataAtCell(r,n));let l="";return this.hot.hasHook("modifyAutoColumnSizeSeed")&&(l=this.hot.runHooks("modifyAutoColumnSizeSeed",l,o,a)),{value:a,bundleSeed:l}})),au(this,"firstCalculation",!0),au(this,"inProgress",!1),au(this,"measuredColumns",0),au(this,"columnWidthsMap",new vl),ole(this,Du,[]),this.hot.columnIndexMapper.registerMap(hle,this.columnWidthsMap),this.addHook("beforeColumnResize",(r,n,i)=>Vo(Ra,this,_M).call(this,r,n,i))}isEnabled(){return this.hot.getSettings()[Qh]!==!1&&!this.hot.getSettings().colWidths}enablePlugin(){var e=this;if(this.enabled)return;const r=this.hot.getSettings()[Qh];r&&r.useHeaders!==null&&r.useHeaders!==void 0&&this.ghostTable.setSetting("useHeaders",r.useHeaders),this.setSamplingOptions(),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Vo(Ra,e,fle).call(e,...i)}),this.addHook("beforeChangeRender",n=>Vo(Ra,this,gle).call(this,n)),this.addHook("afterFormulasValuesUpdate",n=>Vo(Ra,this,ple).call(this,n)),this.addHook("beforeViewRender",n=>Vo(Ra,this,dle).call(this,n)),this.addHook("modifyColWidth",(n,i)=>this.getColumnWidth(i,n)),this.addHook("afterInit",()=>Vo(Ra,this,mle).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,r,n)=>Vo(Ra,this,_M).call(this,e,r,n))}calculateVisibleColumnsWidth(){if(!this.hot.countRows())return;const r=this.hot.renderCall,n=this.getFirstVisibleColumn(),i=this.getLastVisibleColumn();n===-1||i===-1||this.calculateColumnsWidth({from:n,to:i},void 0,r)}calculateColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countRows()-1},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,s=typeof r=="number"?{from:r,to:r}:r;Ue(i.from,i.to,o=>{let a=this.hot.toPhysicalColumn(o);if(a===null&&(a=o),n||this.columnWidthsMap.getValueAtIndex(a)===null&&!this.hot._getColWidthFromSettings(a)){const l=this.samplesGenerator.generateColumnSamples(o,s);j(l,c=>{let[u,h]=c;return this.ghostTable.addColumn(u,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=i.to+1,this.ghostTable.clean())}calculateAllColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},r=0;const n=this.hot.countCols()-1;let i=null;this.inProgress=!0;const s=()=>{if(!this.hot){Cp(i),this.inProgress=!1;return}this.calculateColumnsWidth({from:r,to:Math.min(r+nf.CALCULATION_STEP,n)},e),r=r+nf.CALCULATION_STEP+1,r<n?i=Dy(s):(Cp(i),this.inProgress=!1,this.hot.view.adjustElementsSize())},o=this.getSyncCalculationLimit();this.firstCalculation&&o>=0&&(this.calculateColumnsWidth({from:0,to:o},e),this.firstCalculation=!1,r=o+1),r<n?s():this.inProgress=!1}setSamplingOptions(){const e=this.hot.getSettings()[Qh],r=e&&mr(e,"samplingRatio")?e.samplingRatio:void 0,n=e&&mr(e,"allowSampleDuplicates")?e.allowSampleDuplicates:void 0;r&&!isNaN(r)&&this.samplesGenerator.setSampleCount(parseInt(r,10)),n&&this.samplesGenerator.setAllowDuplicates(n)}recalculateAllColumnsWidth(){this.hot.view&&this.hot.view._wt.wtTable.isVisible()&&(this.clearCache(),this.calculateAllColumnsWidth())}getSyncCalculationLimit(){const e=this.hot.getSettings()[Qh];let r=nf.SYNC_CALCULATION_LIMIT;const n=this.hot.countCols()-1;return at(e)&&(r=e.syncLimit,Dk(r)?r=pN(n,r):r>>=0),Math.min(r,n)}getColumnWidth(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=r;return i===void 0&&(i=this.columnWidthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e)),n&&typeof i=="number"&&(i=Math.max(i,gg.DEFAULT_WIDTH))),i}getFirstVisibleColumn(){const e=this.hot.view._wt;if(e.wtViewport.columnsVisibleCalculator){const r=e.wtTable.getFirstVisibleColumn();if(r!==-1)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(r)}if(e.wtViewport.columnsRenderCalculator){const r=e.wtTable.getFirstRenderedColumn();if(r!==-1)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(r)}return-1}getLastVisibleColumn(){const e=this.hot.view._wt;if(e.wtViewport.columnsVisibleCalculator){const r=e.wtTable.getLastVisibleColumn();if(r!==-1)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(r)}if(e.wtViewport.columnsRenderCalculator){const r=e.wtTable.getLastRenderedColumn();if(r!==-1)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(r)}return-1}findColumnsWhereHeaderWasChanged(){const e=this.hot.getColHeader();return Rn(e,(n,i,s)=>{const o=L0(Du,this).length;return(o-1<s||L0(Du,this)[s]!==i)&&n.push(s),o-1<s?L0(Du,this).push(i):L0(Du,this)[s]=i,n},[])}clearCache(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];e.length?this.hot.batchExecution(()=>{j(e,r=>{this.columnWidthsMap.setValueAtIndex(r,null)})},!0):this.columnWidthsMap.clear()}isNeedRecalculate(){return!!Rs(this.columnWidthsMap.getValues().slice(0,this.measuredColumns),e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function dle(){this.calculateVisibleColumnsWidth(),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllColumnsWidth()}function fle(){this.hot.view?this.recalculateAllColumnsWidth():setTimeout(()=>{this.hot&&this.recalculateAllColumnsWidth()},0)}function gle(t){const e=wt(t,r=>{let[,n]=r;return this.hot.toPhysicalColumn(this.hot.propToCol(n))});this.clearCache(Array.from(new Set(e)))}function _M(t,e,r){let n=t;return r&&(this.calculateColumnsWidth(e,void 0,!0),n=this.getColumnWidth(e,void 0,!1)),n}function mle(){cle(Du,this,this.hot.getColHeader())}function ple(t){const e=Rs(t,n=>{var i;return Le((i=n.address)===null||i===void 0?void 0:i.col)}),r=wt(e,n=>n.address.col);this.clearCache(Array.from(new Set(r)))}const lc={horizontal:"horizontal",vertical:"vertical"};function wle(t,e,r){let n,i,s;return e[0]===t[0]&&e[1]<t[1]?(s="left",n=r(e[0],e[1]),i=r(e[2],t[1]-1)):e[2]===t[2]&&e[0]===t[0]&&e[3]>t[3]?(s="right",n=r(e[0],t[3]+1),i=r(e[2],e[3])):e[0]<t[0]&&e[1]===t[1]?(s="up",n=r(e[0],e[1]),i=r(t[0]-1,e[3])):e[2]>t[2]&&e[1]===t[1]&&(s="down",n=r(t[2]+1,e[1]),i=r(e[2],e[3])),n&&n.normalize(),i&&i.normalize(),{directionOfDrag:s,startOfDragCoords:n,endOfDragCoords:i}}function vle(t){const e={};return t===!0?(e.directions=Object.keys(lc),e.autoInsertRow=!0):at(t)?(Le(t.autoInsertRow)?t.direction===lc.horizontal?e.autoInsertRow=!1:e.autoInsertRow=t.autoInsertRow:e.autoInsertRow=!1,Le(t.direction)?e.directions=[t.direction]:e.directions=Object.keys(lc)):typeof t=="string"?(e.directions=[t],e.autoInsertRow=!0):(e.directions=[],e.autoInsertRow=!1),e}function Cle(t,e){Sle(t,e),e.add(t)}function Sle(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lu(t,e,r){return e=xle(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xle(t){var e=yle(t,"string");return typeof e=="symbol"?e:e+""}function yle(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ed(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}He.getSingleton().register("modifyAutofillRange");He.getSingleton().register("beforeAutofill");He.getSingleton().register("afterAutofill");const AM="autofill",ble=20,Ele=["fillHandle"],Rle="insert_row_below",Tle=200;var cu=new WeakSet;class _le extends Pt{constructor(){super(...arguments),Cle(this,cu),lu(this,"addingStarted",!1),lu(this,"mouseDownOnCellCorner",!1),lu(this,"mouseDragOutside",!1),lu(this,"handleDraggedCells",0),lu(this,"directions",[]),lu(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return AM}static get PLUGIN_PRIORITY(){return ble}static get SETTING_KEYS(){return[AM,...Ele]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",e=>ed(cu,this,Mle).call(this,e)),this.addHook("afterOnCellCornerDblClick",e=>ed(cu,this,Ale).call(this,e)),this.addHook("beforeOnCellMouseOver",(e,r)=>ed(cu,this,Ile).call(this,r)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.clearMappedSettings(),super.disablePlugin()}getSelectionData(){const e=this.hot.getSelectedRangeLast(),{row:r,col:n}=e.getTopStartCorner(),{row:i,col:s}=e.getBottomEndCorner(),o=this.hot.runHooks("modifyCopyableRange",[{startRow:r,startCol:n,endRow:i,endCol:s}]),a=[],l=[],c=[];return j(o,u=>{for(let h=u.startRow;h<=u.endRow;h+=1)a.indexOf(h)===-1&&a.push(h);for(let h=u.startCol;h<=u.endCol;h+=1)l.indexOf(h)===-1&&l.push(h)}),j(a,u=>{const h=[];j(l,d=>{h.push(this.hot.getCopyableData(u,d))}),c.push(h)}),c}fillIn(){if(this.hot.selection.highlight.getFill().isEmpty())return!1;const[e,r,n,i]=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],c=this.hot.runHooks("modifyAutofillRange",[Math.min(o.row,e),Math.min(o.col,r),Math.max(a.row,n),Math.max(a.col,i)],l),{directionOfDrag:u,startOfDragCoords:h,endOfDragCoords:d}=wle(l,c,(f,g)=>this.hot._createCellCoords(f,g));if(h&&h.row>-1&&h.col>-1){const f=this.getSelectionData(),g=s.clone(),m=this.hot._createCellRange(h,h,d),p=this.hot.runHooks("beforeAutofill",f,g,m,u);if(p===!1)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let S=p;const y=p;if(["up","left"].indexOf(u)>-1&&!(y.length===1&&y[0].length===0))if(S=[],u==="up"){const C=d.row-h.row+1,E=C%y.length;for(let A=0;A<C;A++)S.push(y[(A+(y.length-E))%y.length])}else{const C=d.col-h.col+1,E=C%y[0].length;for(let A=0;A<y.length;A++){S.push([]);for(let O=0;O<C;O++)S[A].push(y[A][(O+(y[A].length-E))%y[A].length])}}this.hot.populateFromArray(h.row,h.col,S,d.row,d.col,`${this.pluginName}.fill`,null),this.setSelection(c),this.hot.runHooks("afterAutofill",S,g,m,u),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 r=this.hot.getSelectedRangeLast(),n=r.getBottomEndCorner();let i=e;if(this.directions.includes(lc.vertical)&&this.directions.includes(lc.horizontal)){const s=r.getTopStartCorner();(n.col<=e.col||s.col>=e.col)&&(i=this.hot._createCellCoords(n.row,e.col)),(n.row<e.row||s.row>e.row)&&(i=this.hot._createCellCoords(e.row,n.col))}else if(this.directions.includes(lc.vertical))i=this.hot._createCellCoords(e.row,n.col);else if(this.directions.includes(lc.horizontal))i=this.hot._createCellCoords(n.row,e.col);else return;return this.reduceSelectionAreaIfNeeded(i)}showBorder(e){const r=this.getCoordsOfDragAndDropBorders(e);r&&this.redrawBorders(r)}addRow(){this.hot._registerTimeout(()=>{this.hot.alter(Rle,void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1},Tle)}addNewRowIfNeeded(){if(!this.hot.selection.highlight.getFill().isEmpty()&&this.addingStarted===!1&&this.autoInsertRow){const e=this.hot.getSelectedLast(),r=this.hot.selection.highlight.getFill().getVisualCorners(),n=this.hot.countRows();e[2]<n-1&&r[2]===n-1&&(this.addingStarted=!0,this.addRow())}}getIndexOfLastAdjacentFilledInRow(e){const r=this.hot.getData(),n=this.hot.countRows();let i;for(let s=e[2]+1;s<n;s++){for(let l=e[1];l<=e[3];l++){const c=r[s][l];if(!yr(c))return-1}const o=r[s][e[1]-1],a=r[s][e[3]+1];(!yr(o)||!yr(a))&&(i=s)}return i}addSelectionFromStartAreaToSpecificRowIndex(e,r){this.hot.selection.highlight.getFill().clear().add(this.hot._createCellCoords(e[0],e[1])).add(this.hot._createCellCoords(r,e[3])).commit()}setSelection(e){this.hot.selectCell(...wt(e,r=>Math.max(r,0)),!1,!1)}selectAdjacent(){const e=this.hot.getSelectedLast(),r=this.getIndexOfLastAdjacentFilledInRow(e);return r===-1||r===void 0?!1:(this.addSelectionFromStartAreaToSpecificRowIndex(e,r),!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:r}=this.hot.rootDocument,n=Zr(this.hot.table).top-(this.hot.rootWindow.pageYOffset||r.scrollTop)+pr(this.hot.table),i=Zr(this.hot.table).left-(this.hot.rootWindow.pageXOffset||r.scrollLeft)+Bt(this.hot.table);return e.clientY>n&&e.clientX<=i}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",()=>ed(cu,this,Ole).call(this)),this.eventManager.addEventListener(e,"mousemove",r=>ed(cu,this,Ple).call(this,r))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){const e=vle(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}}function Ale(){this.selectAdjacent()&&this.fillIn()}function Mle(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function Ile(t){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(t),this.addNewRowIfNeeded())}function Ole(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function Ple(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 Dle(t,e){kle(t,e),e.add(t)}function kle(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fl(t,e,r){return e=Nle(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nle(t){var e=Hle(t,"string");return typeof e=="symbol"?e:e+""}function Hle(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function td(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const $0="autoRowSize",Fle=40,Lle="autoRowSize";var uu=new WeakSet;class sf extends Pt{static get PLUGIN_KEY(){return $0}static get PLUGIN_PRIORITY(){return Fle}static get SETTING_KEYS(){return!0}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 500}constructor(e){super(e),Dle(this,uu),Fl(this,"headerHeight",null),Fl(this,"ghostTable",new I2(this.hot)),Fl(this,"samplesGenerator",new Bw((r,n)=>{const i=this.hot.toPhysicalRow(r),s=this.hot.toPhysicalColumn(n);if(this.hot.rowIndexMapper.isHidden(i)||this.hot.columnIndexMapper.isHidden(s)||r>=0&&n>=0&&this.hot.getCellMeta(r,n).hidden)return!1;let o;return r>=0?o=this.hot.getDataAtCell(r,n):r===-1&&(o=this.hot.getColHeader(n)),{value:o}})),Fl(this,"firstCalculation",!0),Fl(this,"inProgress",!1),Fl(this,"measuredRows",0),Fl(this,"rowHeightsMap",new vl),this.hot.rowIndexMapper.registerMap(Lle,this.rowHeightsMap),this.addHook("beforeRowResize",(r,n,i)=>td(uu,this,MM).call(this,r,n,i))}isEnabled(){const e=this.hot.getSettings()[$0];return e===!0||at(e)}enablePlugin(){var e=this;this.enabled||(this.setSamplingOptions(),this.addHook("afterLoadData",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return td(uu,e,Ble).call(e,...n)}),this.addHook("beforeChangeRender",r=>td(uu,this,Vle).call(this,r)),this.addHook("beforeColumnResize",()=>this.recalculateAllRowsHeight()),this.addHook("beforeViewRender",r=>td(uu,this,$le).call(this,r)),this.addHook("modifyRowHeight",(r,n)=>this.getRowHeight(n,r)),this.addHook("modifyColumnHeaderHeight",()=>this.getColumnHeaderHeight()),super.enablePlugin())}disablePlugin(){this.headerHeight=null,super.disablePlugin(),this.addHook("beforeRowResize",(e,r,n)=>td(uu,this,MM).call(this,e,r,n))}calculateRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countCols()-1},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,s=typeof r=="number"?{from:r,to:r}:r;if(this.hot.getColHeader(0)!==null){const o=this.samplesGenerator.generateRowSamples(-1,s);this.ghostTable.addColumnHeadersRow(o.get(-1))}Ue(i.from,i.to,o=>{if(n||this.rowHeightsMap.getValueAtIndex(o)===null){const a=this.samplesGenerator.generateRowSamples(o,s);j(a,l=>{let[c,u]=l;return this.ghostTable.addRow(c,u)})}}),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=i.to+1,this.ghostTable.clean())}calculateAllRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},r=0;const n=this.hot.countRows()-1;let i=null;this.inProgress=!0;const s=()=>{if(!this.hot){Cp(i),this.inProgress=!1;return}this.calculateRowsHeight({from:r,to:Math.min(r+sf.CALCULATION_STEP,n)},e),r=r+sf.CALCULATION_STEP+1,r<n?i=Dy(s):(Cp(i),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,r=o+1),r<n?s():(this.inProgress=!1,this.hot.view.adjustElementsSize())}setSamplingOptions(){const e=this.hot.getSettings()[$0],r=e&&mr(e,"samplingRatio")?e.samplingRatio:void 0,n=e&&mr(e,"allowSampleDuplicates")?e.allowSampleDuplicates:void 0;r&&!isNaN(r)&&this.samplesGenerator.setSampleCount(parseInt(r,10)),n&&this.samplesGenerator.setAllowDuplicates(n)}recalculateAllRowsHeight(){yc(this.hot.view._wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllRowsHeight())}getSyncCalculationLimit(){const e=this.hot.getSettings()[$0];let r=sf.SYNC_CALCULATION_LIMIT;const n=this.hot.countRows()-1;return at(e)&&(r=e.syncLimit,Dk(r)?r=pN(n,r):r>>=0),Math.min(r,n)}getRowHeight(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;const n=e<0?this.headerHeight:this.rowHeightsMap.getValueAtIndex(this.hot.toPhysicalRow(e));let i=r;return n!==null&&n>(r||0)&&(i=n),i}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:r,to:n}=typeof e=="number"?{from:e,to:e}:e;this.hot.batchExecution(()=>{Ue(Math.min(r,n),Math.max(r,n),i=>{this.rowHeightsMap.setValueAtIndex(i,null)})},!0)}isNeedRecalculate(){return!!Rs(this.rowHeightsMap.getValues().slice(0,this.measuredRows),e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function $le(){const t=this.hot.renderCall,e=this.hot.getSettings().fixedRowsBottom,r=this.getFirstVisibleRow(),n=this.getLastVisibleRow();if(!(r===-1||n===-1)){if(this.calculateRowsHeight({from:r,to:n},void 0,t),e){const i=this.hot.countRows()-1;this.calculateRowsHeight({from:i-e,to:i})}this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllRowsHeight()}}function MM(t,e,r){let n=t;return r&&(this.calculateRowsHeight(e,void 0,!0),n=this.getRowHeight(e)),n}function Ble(){this.hot.view?this.recalculateAllRowsHeight():this.hot._registerTimeout(()=>{this.hot&&this.recalculateAllRowsHeight()})}function Vle(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:Wle,getListWithRemovedItems:Ule}=VN("physicallyIndexed");class Yle extends Uc{constructor(){super(e=>e)}insert(e,r){const n=ub(this.indexedValues,r);this.indexedValues=Wle(n,e,r,this.initValueOrFn),super.insert(e,r)}remove(e){const r=Ule(this.indexedValues,e);this.indexedValues=cb(r,e),super.remove(e)}}const{getListWithInsertedItems:zle,getListWithRemovedItems:Gle}=VN("physicallyIndexed");class jle extends Uc{constructor(){super(e=>e)}insert(e,r){this.indexedValues=zle(this.indexedValues,e,r,(n,i)=>this.getNextValue(i)),super.insert(e,r)}remove(e){this.indexedValues=Gle(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}function Kle(t,e){Xle(t,e),e.add(t)}function Xle(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qle(t,e,r){return e=Zle(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zle(t){var e=Jle(t,"string");return typeof e=="symbol"?e:e+""}function Jle(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Qle(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const NC="bindRowsWithHeaders",ece=210,tce="loose",rce=new Map([["loose",Yle],["strict",jle]]);var IM=new WeakSet;class nce extends Pt{constructor(){super(...arguments),Kle(this,IM),qle(this,"headerIndexes",null)}static get PLUGIN_KEY(){return NC}static get PLUGIN_PRIORITY(){return ece}isEnabled(){return!!this.hot.getSettings()[NC]}enablePlugin(){if(this.enabled)return;let e=this.hot.getSettings()[NC];typeof e!="string"&&(e=tce);const r=rce.get(e);this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new r),this.addHook("modifyRowHeader",n=>Qle(IM,this,ice).call(this,n)),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function ice(t){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(t))}function sce(t,e){P2(t,e),e.add(t)}function oce(t,e,r){P2(t,e),e.set(t,r)}function P2(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function OM(t,e,r){return e=ace(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ace(t){var e=lce(t,"string");return typeof e=="symbol"?e:e+""}function lce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function PM(t,e){return t.get(Vu(t,e))}function HC(t,e,r){return t.set(Vu(t,e),r),r}function Vu(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Lm="collapsibleColumns",cce=290,uce=["nestedHeaders"],Qu="collapsibleIndicator",DM=Lm,kM=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var hu=new WeakMap,rd=new WeakSet;class hce extends Pt{constructor(){super(...arguments),sce(this,rd),OM(this,"nestedHeadersPlugin",null),OM(this,"headerStateManager",null),oce(this,hu,null)}static get PLUGIN_KEY(){return Lm}static get PLUGIN_PRIORITY(){return cce}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[Lm,...uce]}isEnabled(){return!!this.hot.getSettings()[Lm]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:r}=this.hot.getSettings();r||Vt("You need to configure the Nested Headers plugin in order to use collapsible headers."),HC(hu,this,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",()=>Vu(rd,this,gce).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Vu(rd,e,mce).call(e,...i)}),this.addHook("afterGetColHeader",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Vu(rd,e,dce).call(e,...i)}),this.addHook("beforeOnCellMouseDown",(n,i,s)=>Vu(rd,this,fce).call(this,n,i,s)),this.registerShortcuts(),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(this.hot.view){if(!this.nestedHeadersPlugin.detectedOverlappedHeaders){const{collapsibleColumns:e}=this.hot.getSettings();typeof e=="boolean"?this.headerStateManager.mapState(r=>({collapsible:r.origColspan>1})):Array.isArray(e)&&(this.headerStateManager.mapState(()=>({collapsible:!1})),this.headerStateManager.mergeStateWith(e))}super.updatePlugin()}}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),HC(hu,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:r,col:n}=this.hot.getSelectedRangeLast().highlight,{collapsible:i,isCollapsed:s,columnIndex:o}=(e=this.headerStateManager.getHeaderTreeNodeData(r,n))!==null&&e!==void 0?e:{};if(i)return s?this.expandSection({row:r,col:o}):this.collapseSection({row:r,col:o}),!1},runOnlyIf:()=>{var e,r;return((e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.isSingle())&&((r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.highlight.isHeader())},group:DM,relativeToGroup:Cl,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(DM)}clearButtons(){if(!this.hot.view)return;const e=this.hot.view._wt.getSetting("columnHeaders").length,r=this.hot.view._wt.wtTable.THEAD,n=this.hot.view._wt.wtOverlays.topOverlay.clone.wtTable.THEAD,i=this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay?this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null,s=function(o){o&&o.parentNode.removeChild(o)};Ue(0,e-1,o=>{const a=r.childNodes[o],l=n.childNodes[o],c=i?i.childNodes[o]:null;Ue(0,a.childNodes.length-1,u=>{let h=a.childNodes[u].querySelector(`.${Qu}`);s(h),l&&l.childNodes[u]&&(h=l.childNodes[u].querySelector(`.${Qu}`),s(h)),i&&c&&c.childNodes[u]&&(h=c.childNodes[u].querySelector(`.${Qu}`),s(h))})})}expandSection(e){this.toggleCollapsibleSection([e],"expand")}collapseSection(e){this.toggleCollapsibleSection([e],"collapse")}toggleAllCollapsibleSections(e){const r=this.headerStateManager.mapNodes(n=>{const{collapsible:i,origColspan:s,headerLevel:o,columnIndex:a,isCollapsed:l}=n;if(i===!0&&s>1&&(l&&e==="expand"||!l&&e==="collapse"))return{row:this.headerStateManager.levelToRowCoords(o),col:a}});this.toggleCollapsibleSection(r,e)}collapseAll(){this.toggleAllCollapsibleSections("collapse")}expandAll(){this.toggleAllCollapsibleSections("expand")}toggleCollapsibleSection(e,r){if(!kM.has(r))throw new Error(`Unsupported action is passed (${r}).`);if(!Array.isArray(e))return;const n=Rs(e,f=>{let{row:g}=f;return g<0});let i=n.length>0;j(n,f=>{var g;let{row:m,col:p}=f;const{collapsible:S,isCollapsed:y}=(g=this.headerStateManager.getHeaderSettings(m,p))!==null&&g!==void 0?g:{};if(!S||y&&r==="collapse"||!y&&r==="expand")return i=!1,!1});const s=[],o=[];i&&j(n,f=>{let{row:g,col:m}=f;const{colspanCompensation:p,affectedColumns:S,rollbackModification:y}=this.headerStateManager.triggerNodeModification(r,g,m);p>0&&(o.push(...S),s.push(y))});const a=this.getCollapsedColumns();let l=[];r==="collapse"?l=Ok([...a,...o]):r==="expand"&&(l=Rs(a,f=>!o.includes(f)));const c=kM.get(r);if(this.hot.runHooks(c.beforeHook,a,l,i)===!1){j(s,f=>{f()});return}this.hot.batchExecution(()=>{j(o,f=>{PM(hu,this).setValueAtIndex(this.hot.toPhysicalColumn(f),c.hideColumn)})},!0);const h=this.getCollapsedColumns().length!==a.length,d=this.hot.getSelectedRangeLast();if(r==="collapse"&&h&&d){const{row:f,col:g}=d.highlight;if((this.hot.rowIndexMapper.isHidden(f)||this.hot.columnIndexMapper.isHidden(g))&&o.includes(g)){const p=f>=0?this.hot.rowIndexMapper.getNearestNotHiddenIndex(f,1,!0):f,S=g>=0?this.hot.columnIndexMapper.getNearestNotHiddenIndex(g,1,!0):g;p!==null&&S!==null&&this.hot.selectCell(p,S)}}this.hot.runHooks(c.afterHook,a,l,i,h),this.hot.render(),this.hot.view.adjustElementsSize()}getCollapsedColumns(){return PM(hu,this).getHiddenIndexes()}destroy(){HC(hu,this,null),super.destroy()}}function dce(t,e,r){var n;const{collapsible:i,origColspan:s,isCollapsed:o}=(n=this.headerStateManager.getHeaderSettings(r,t))!==null&&n!==void 0?n:{},a=i&&s>1&&t>=this.hot.getSettings().fixedColumnsStart,l=this.hot.getSettings().ariaTags;let c=e.querySelector(`.${Qu}`);if(vh(e,[Wi("")[0]]),a)c||(c=this.hot.rootDocument.createElement("div"),Re(c,Qu),e.querySelector("div:first-child").appendChild(c)),rt(c,["collapsed","expanded"]),o?(Re(c,"collapsed"),xc(c,"+"),l&&Xe(e,...Wi(!1))):(Re(c,"expanded"),xc(c,"-"),l&&Xe(e,...Wi(!0))),l&&Xe(c,...fa());else{var u;(u=c)===null||u===void 0||u.remove()}}function fce(t,e){Ze(t.target,Qu)&&(Ze(t.target,"expanded")?(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"collapse")):Ze(t.target,"collapsed")&&(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"expand")),Ps(t))}function gce(){this.updatePlugin()}function mce(t,e){e||this.updatePlugin()}function Ll(t,e,r){return e=pce(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pce(t){var e=wce(t,"string");return typeof e=="symbol"?e:e+""}function wce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const vce=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"],Cce=!1,Sce=!0,xce=!0;class yce{constructor(e,r){Ll(this,"hot",void 0),Ll(this,"sortingStates",new Dw),Ll(this,"sortEmptyCells",Cce),Ll(this,"indicator",Sce),Ll(this,"headerAction",xce),Ll(this,"compareFunctionFactory",void 0),Ll(this,"mapName",void 0),this.hot=e,this.mapName=r,this.hot.columnIndexMapper.registerMap(r,this.sortingStates)}updateAllColumnsProperties(e){at(e)&&dt(e,(r,n)=>{vce.includes(n)&&(this[n]=r)})}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 r;return(r=this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))===null||r===void 0?void 0:r.sortOrder}getIndexOfColumnInSortQueue(e){return e=this.hot.toPhysicalColumn(e),this.sortingStates.getEntries().findIndex(r=>{let[n]=r;return n===e})}getNumberOfSortedColumns(){return this.sortingStates.getLength()}isListOfSortedColumnsEmpty(){return this.getNumberOfSortedColumns()===0}isColumnSorted(e){return at(this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))}getSortStates(){return this.sortingStates===null?[]:this.sortingStates.getEntries().map(r=>{let[n,i]=r;return{column:this.hot.toVisualColumn(n),...i}})}getColumnSortState(e){const r=this.getSortOrderOfColumn(e);if(Le(r))return{column:e,sortOrder:r}}setSortStates(e){this.sortingStates.clear();for(let r=0;r<e.length;r+=1)this.sortingStates.setValueAtIndex(this.hot.toPhysicalColumn(e[r].column),{sortOrder:e[r].sortOrder})}destroy(){this.hot.columnIndexMapper.unregisterMap(this.mapName),this.sortingStates=null}}function D2(t,e,r){const n=e.locale;return function(i,s){const{sortEmptyCells:o}=r;return typeof i=="string"&&(i=i.toLocaleLowerCase(n)),typeof s=="string"&&(s=s.toLocaleLowerCase(n)),i===s?ho:yr(i)?yr(s)?ho:o&&t==="asc"?fr:gr:yr(s)?o&&t==="asc"?gr:fr:isNaN(i)&&!isNaN(s)?t==="asc"?gr:fr:!isNaN(i)&&isNaN(s)||(isNaN(i)||isNaN(s)||(i=parseFloat(i),s=parseFloat(s)),i<s)?t==="asc"?fr:gr:i>s?t==="asc"?gr:fr:ho}}const k2="default";function bce(t,e,r){return function(n,i){const s=parseFloat(n),o=parseFloat(i),{sortEmptyCells:a}=r;if(s===o||isNaN(s)&&isNaN(o))return ho;if(a){if(yr(n))return t==="asc"?fr:gr;if(yr(i))return t==="asc"?gr:fr}return isNaN(s)?gr:isNaN(o)?fr:s<o?t==="asc"?fr:gr:s>o?t==="asc"?gr:fr:ho}}const Ece="numeric";function Rce(t,e,r){const n=e.checkedTemplate,i=e.uncheckedTemplate,{sortEmptyCells:s}=r;return function(o,a){const l=yr(o),c=yr(a),u=l?i:o,h=c?i:a,d=u===i||u===n,f=h===i||h===n;if(s===!1){if(l&&c===!1)return gr;if(l===!1&&c)return fr}return d===!1&&f?t==="asc"?fr:gr:d&&f===!1?t==="asc"?gr:fr:d===!1&&f===!1?D2(t,e,r)(o,a):u===i&&h===n?t==="asc"?fr:gr:u===n&&h===i?t==="asc"?gr:fr:ho}}const Tce="checkbox";function _ce(t,e,r){return B2(t,e.dateFormat,r)}const Ace="date";function Mce(t,e,r){return B2(t,e.timeFormat,r)}const Ice="time",{register:Sg,getItem:NM,hasItem:Oce}=Ds("sorting.compareFunctionFactory"),{register:N2,getItem:Pce}=Ds("sorting.mainSortComparator");function H2(t){return Oce(t)?NM(t):NM(k2)}Sg(Tce,Rce);Sg(Ace,_ce);Sg(k2,D2);Sg(Ece,bce);Sg(Ice,Mce);const ho=0,fr=-1,gr=1;function Dce(t,e){const r=Pce(e);for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];t.sort(r(...i))}const Tp="asc",_p="desc",F2="colHeader";function kce(t){if(at(t)===!1)return!1;const{column:e,sortOrder:r}=t;return Number.isInteger(e)&&[Tp,_p].includes(r)}function Nce(t){if(t.some(r=>kce(r)===!1))return!1;const e=t.map(r=>{let{column:n}=r;return n});return new Set(e).size===e.length}function HM(t){if(t!==_p)return t===Tp?_p:Tp}function L2(t){return t.querySelector(`.${F2}`)}function $2(t,e){if(t<0||!e.parentNode)return!1;const r=e.parentNode.parentNode.childNodes;return Array.from(r).indexOf(e.parentNode)-r.length===-1}function eR(t,e,r){return t===-1&&e>=0&&bc(r)===!1}function B2(t,e,r){return function(n,i){const{sortEmptyCells:s}=r;if(n===i)return ho;if(yr(n))return yr(i)?ho:s&&t==="asc"?fr:gr;if(yr(i))return s&&t==="asc"?gr:fr;const o=be(n,e),a=be(i,e);return o.isValid()?a.isValid()?a.isAfter(o)?t==="asc"?fr:gr:a.isBefore(o)?t==="asc"?gr:fr:ho:fr:gr}}const Hce="ascending",Fce="descending",V2="indicatorDisabled",W2="columnSorting",U2="sortAction",Y2=new Map([[Tp,Hce],[_p,Fce]]);function Lce(t,e,r,n){const i=[W2];if(n&&i.push(U2),r===!1)return i.push(V2),i;const s=t.getSortOrderOfColumn(e);return Le(s)&&i.push(Y2.get(s)),i}function $ce(){return Array.from(Y2.values()).concat(U2,V2,W2)}function Bce(t,e){return function(r,n){const[,...i]=r,[,...s]=n;return function(a){const l=t[a],c=e[a],u=i[a],h=s[a],d=c.columnSorting;return(d.compareFunctionFactory?d.compareFunctionFactory:H2(c.type))(l,c,d)(u,h)}(0)}}function Vce(t,e){Wce(t,e),e.add(t)}function Wce(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function B0(t,e,r){return e=Uce(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Uce(t){var e=Yce(t,"string");return typeof e=="symbol"?e:e+""}function Yce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ku(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Ap="columnSorting",zce=50,Mp="append",Gce="replace",FM=Ap;N2(Ap,Bce);He.getSingleton().register("beforeColumnSort");He.getSingleton().register("afterColumnSort");var rc=new WeakSet;class z2 extends Pt{constructor(){super(...arguments),Vce(this,rc),B0(this,"columnStatesManager",null),B0(this,"columnMetaCache",null),B0(this,"pluginKey",Ap),B0(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return Ap}static get PLUGIN_PRIORITY(){return zce}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e=this;this.enabled||(this.columnStatesManager=new yce(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new vl(r=>{let n=this.hot.toVisualColumn(r);return n===null&&(n=r),this.getMergedPluginSettings(n)}),this.hot.columnIndexMapper.registerMap(`${this.pluginKey}.columnMeta`,this.columnMetaCache),this.addHook("afterGetColHeader",(r,n)=>ku(rc,this,jce).call(this,r,n)),this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ku(rc,e,Xce).call(e,...n)}),this.addHook("afterOnCellMouseDown",(r,n)=>this.onAfterOnCellMouseDown(r,n)),this.addHook("afterInit",()=>ku(rc,this,LS).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return ku(rc,e,Kce).call(e,...n)}),this.hot.view&&ku(rc,this,LS).call(this),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){const e=(r,n)=>{const i=L2(n);$2(r,n)===!1||i===null||this.updateHeaderClasses(i)};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,r;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n&&((r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.isSingle())&&this.hot.selection.isCellVisible(n)&&n.row===-1&&n.col>=0},relativeToGroup:Cl,position:"before",group:FM})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(FM)}sort(e){const r=this.getSortConfig(),n=this.getNormalizedSortConfigs(e),i=this.areValidSortConfigs(n);this.hot.runHooks("beforeColumnSort",r,n,i)!==!1&&(r.length===0&&this.indexesSequenceCache===null&&(this.indexesSequenceCache=this.hot.rowIndexMapper.registerMap(this.pluginKey,new WN),this.indexesSequenceCache.setValues(this.hot.rowIndexMapper.getIndexesSequence())),i&&(this.columnStatesManager.setSortStates(n),this.sortByPresetSortStates(n),this.saveAllSortSettings(n)),this.hot.runHooks("afterColumnSort",r,i?n:r,i),i&&(this.hot.render(),this.hot.forceFullRender=!1,this.hot.view.render()))}clearSort(){this.sort([])}isSorted(){return this.enabled&&!this.columnStatesManager.isListOfSortedColumnsEmpty()}getSortConfig(e){return Le(e)?this.columnStatesManager.getColumnSortState(e):this.columnStatesManager.getSortStates()}setSortConfig(e){const r=this.getNormalizedSortConfigs(e);this.areValidSortConfigs(r)&&this.columnStatesManager.setSortStates(r)}getNormalizedSortConfigs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Array.isArray(e)?e.slice(0,1):[e]}areValidSortConfigs(e){const r=this.hot.countCols();return Nce(e)&&e.every(n=>{let{column:i}=n;return i<=r&&i>=0})}saveAllSortSettings(e){const r=this.columnStatesManager.getAllColumnsProperties(),n=i=>{let{column:s,...o}=i;return{column:this.hot.toPhysicalColumn(s),...o}};r.initialConfig=wt(e,n),this.hot.runHooks("persistentStateSave","columnSorting",r)}getAllSavedSortSettings(){const e={};this.hot.runHooks("persistentStateLoad","columnSorting",e);const r=e.value,n=i=>{let{column:s,...o}=i;return{column:this.hot.toVisualColumn(s),...o}};return Le(r)&&Array.isArray(r.initialConfig)&&(r.initialConfig=wt(r.initialConfig,n)),r}getColumnNextConfig(e){const r=this.columnStatesManager.getSortOrderOfColumn(e);if(Le(r)){const i=HM(r);return Le(i)?{column:e,sortOrder:i}:void 0}const n=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e<n)return{column:e,sortOrder:HM()}}getNextSortConfig(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Mp;const n=this.columnStatesManager.getIndexOfColumnInSortQueue(e),i=n!==-1,s=this.getSortConfig(),o=this.getColumnNextConfig(e);if(i){if(Zt(o))return[...s.slice(0,n),...s.slice(n+1)];if(r===Mp)return[...s.slice(0,n),...s.slice(n+1),o];if(r===Gce)return[...s.slice(0,n),o,...s.slice(n+1)]}return Le(o)?s.concat(o):s}getPluginColumnConfig(e){if(at(e)){const r=e[this.pluginKey];if(at(r))return r}return{}}getMergedPluginSettings(e){const r=this.hot.getSettings()[this.pluginKey],n=this.columnStatesManager.getAllColumnsProperties(),i=this.hot.getCellMeta(0,e),s=Object.getPrototypeOf(i);return Array.isArray(s.columns)?Object.assign(n,r,this.getPluginColumnConfig(s.columns[e])):Xt(s.columns)?Object.assign(n,r,this.getPluginColumnConfig(s.columns(e))):Object.assign(n,r)}getFirstCellSettings(e){const r=this.hot.getCellMeta(0,e),n=Object.create(r);return n[this.pluginKey]=this.columnMetaCache.getValueAtIndex(this.hot.toPhysicalColumn(e)),n}getNumberOfRowsToSort(e){const r=this.hot.getSettings();return r.maxRows<=e?r.maxRows:e-r.minSpareRows}sortByPresetSortStates(e){if(e.length===0){this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues());return}const r=[],n=this.hot.countRows(),i=c=>wt(e,u=>this.hot.getDataAtCell(c,u.column));for(let c=0;c<this.getNumberOfRowsToSort(n);c+=1)r.push([this.hot.toPhysicalRow(c)].concat(i(c)));const s=wt(r,c=>c[0]);Dce(r,this.pluginKey,wt(e,c=>c.sortOrder),wt(e,c=>this.getFirstCellSettings(c.column)));for(let c=r.length;c<n;c+=1)r.push([c].concat(i(c)));const o=wt(r,c=>c[0]),a=new Map(wt(s,(c,u)=>[c,o[u]])),l=wt(this.hot.rowIndexMapper.getIndexesSequence(),c=>a.has(c)?a.get(c):c);this.hot.rowIndexMapper.setIndexesSequence(l)}sortBySettings(e){if(at(e)){this.columnStatesManager.updateAllColumnsProperties(e);const r=e.initialConfig;(Array.isArray(r)||at(r))&&this.sort(r)}else this.hot.render()}updateHeaderClasses(e){if(rt(e,$ce()),this.enabled!==!1){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];Re(e,Lce(...n))}}onUpdateSettings(e){super.onUpdateSettings(),this.columnMetaCache!==null&&this.columnMetaCache.init(this.hot.columnIndexMapper.getNumberOfIndexes()),Le(e[this.pluginKey])&&this.sortBySettings(e[this.pluginKey])}wasClickableHeaderClicked(e,r){return this.getFirstCellSettings(r)[this.pluginKey].headerAction&&Ze(e.target,F2)}onAfterOnCellMouseDown(e,r){eR(r.row,r.col,e)!==!1&&this.wasClickableHeaderClicked(e,r.col)&&(this.hot.getShortcutManager().isCtrlPressed()&&(this.hot.deselectCell(),this.hot.selectColumns(r.col)),this.sort(this.getColumnNextConfig(r.col)))}destroy(){var e;(e=this.columnStatesManager)===null||e===void 0||e.destroy(),super.destroy()}}function LS(){const t=this.getAllSavedSortSettings();if(at(t))this.sortBySettings(t);else{const e=this.hot.getSettings()[this.pluginKey];this.sortBySettings(e)}}function jce(t,e){const r=L2(e);if($2(t,e)===!1||r===null)return;const n=this.getFirstCellSettings(t)[this.pluginKey],i=n.indicator,s=n.headerAction;if(this.updateHeaderClasses(r,this.columnStatesManager,t,i,s),this.hot.getSettings().ariaTags){const o=this.columnStatesManager.getSortOrderOfColumn(t);Xe(e,...$Z(o?`${o}ending`:"none"))}}function Kce(t){t===!0&&this.hot.view&&ku(rc,this,LS).call(this)}function Xce(t,e,r,n){eR(e.row,e.col,t)!==!1&&this.wasClickableHeaderClicked(t,e.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(n.column=!0)}function $l(t,e,r){return e=qce(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qce(t){var e=Zce(t,"string");return typeof e=="symbol"?e:e+""}function Zce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Jce{constructor(e,r){$l(this,"plugin",void 0),$l(this,"hot",void 0),$l(this,"endpoints",[]),$l(this,"settings",void 0),$l(this,"settingsType","array"),$l(this,"currentEndpoint",null),$l(this,"cellsToSetCache",[]),this.plugin=e,this.hot=this.plugin.hot,this.settings=r}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 r=[];let n=e;if(!n&&typeof this.settings=="function"){this.settingsType="function";return}return n||(n=this.settings),j(n,i=>{const s={};this.assignSetting(i,s,"ranges",[[0,this.hot.countRows()-1]]),this.assignSetting(i,s,"reversedRowCoords",!1),this.assignSetting(i,s,"destinationRow",new Error(`
  110. You must provide a destination row for the Column Summary plugin in order to work properly!
  111. `)),this.assignSetting(i,s,"destinationColumn",new Error(`
  112. You must provide a destination column for the Column Summary plugin in order to work properly!
  113. `)),this.assignSetting(i,s,"sourceColumn",i.destinationColumn),this.assignSetting(i,s,"type","sum"),this.assignSetting(i,s,"forceNumeric",!1),this.assignSetting(i,s,"suppressDataTypeErrors",!0),this.assignSetting(i,s,"customFunction",null),this.assignSetting(i,s,"readOnly",!0),this.assignSetting(i,s,"roundFloat",!1),r.push(s)}),r}assignSetting(e,r,n,i){if(n==="ranges"&&e[n]===void 0){r[n]=i;return}else if(n==="ranges"&&e[n].length===0)return;if(e[n]===void 0){if(i instanceof Error)throw i;r[n]=i}else n==="destinationRow"&&r.reversedRowCoords?r[n]=this.hot.countRows()-e[n]-1:r[n]=e[n]}resetSetupBeforeStructureAlteration(e,r,n){if(this.settingsType!=="function")return;const i=e.indexOf("row")>-1?"row":"col",s=this.getAllEndpoints();j(s,o=>{i==="row"&&o.destinationRow>=r&&(e==="insert_row"?o.alterRowOffset=n:e==="remove_row"&&(o.alterRowOffset=-1*n)),i==="col"&&o.destinationColumn>=r&&(e==="insert_col"?o.alterColumnOffset=n:e==="remove_col"&&(o.alterColumnOffset=-1*n))}),this.resetAllEndpoints(s,!1)}resetSetupAfterStructureAlteration(e,r,n,i,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,c=this.getAllEndpoints(),u=e.indexOf("move_row")===0,h=r;j(c,d=>{a==="row"&&d.destinationRow>=h&&(d.alterRowOffset=l*n),a==="col"&&d.destinationColumn>=h&&(d.alterColumnOffset=l*n)}),this.resetAllEndpoints(c,!u),u?j(c,d=>{this.extendEndpointRanges(d,h,i[0],i.length),this.recreatePhysicalRanges(d),this.clearOffsetInformation(d)}):j(c,d=>{this.shiftEndpointCoordinates(d,h)}),o&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,r,n,i){j(e.ranges,s=>{s[1]&&(r>=s[0]&&r<=s[1]?n>s[1]?s[1]+=i:n<s[0]&&(s[0]-=i):n>=s[0]&&n<=s[1]&&(s[1]-=i,r<=s[0]&&(s[0]+=1,s[1]+=1)))})}recreatePhysicalRanges(e){const r=e.ranges,n=[],i=[];j(r,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]));i.push(o)}),j(i,s=>{let o=[];j(s,(a,l)=>{l===0?o.push(a):s[l]!==s[l-1]+1&&(o.push(s[l-1]),n.push(o),o=[],o.push(a)),l===s.length-1&&(o.push(a),n.push(o))})}),e.ranges=n}shiftEndpointCoordinates(e,r){e.alterRowOffset&&e.alterRowOffset!==0?(e.destinationRow+=e.alterRowOffset||0,j(e.ranges,n=>{j(n,(i,s)=>{i>=r&&(n[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(),r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e.some(i=>{const s=i.alterRowOffset||0,o=i.alterColumnOffset||0;return i.destinationRow+s>=this.hot.countRows()||i.destinationColumn+o>=this.hot.countCols()})||(this.cellsToSetCache=[],j(e,i=>{this.resetEndpointValue(i,r)}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],j(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 r=[];this.cellsToSetCache=[],j(e,(n,i,s)=>{`${n[2]||""}`!=`${n[3]}`&&j(this.getAllEndpoints(),(o,a)=>{this.hot.propToCol(s[i][1])===o.sourceColumn&&r.indexOf(a)===-1&&r.push(a)})}),j(r,n=>{this.refreshEndpoint(this.getEndpoint(n))}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshCellMetas(){this.endpoints.forEach(e=>{const r=this.hot.toVisualRow(e.destinationRow);if(r!==null){const n=this.hot.getCellMeta(r,e.destinationColumn);n.readOnly=e.readOnly,n.className="columnSummaryResult"}})}refreshEndpoint(e){this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e),this.currentEndpoint=null}resetEndpointValue(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const n=e.alterRowOffset||0,i=e.alterColumnOffset||0;this.cellsToSetCache.push([this.hot.toVisualRow(e.destinationRow+(r?n:0)),this.hot.toVisualColumn(e.destinationColumn+(r?i:0)),""])}setEndpointValue(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=this.hot.toVisualRow(e.destinationRow);if(e.destinationRow>=this.hot.countRows()||e.destinationColumn>=this.hot.countCols()){this.throwOutOfBoundsWarning();return}const s=this.hot.toVisualRow(e.destinationRow);if(s!==null){const o=this.hot.getCellMeta(s,e.destinationColumn);(r==="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)}n?this.hot.setDataAtCell(i,e.destinationColumn,e.result,"ColumnSummary.set"):this.cellsToSetCache.push([i,e.destinationColumn,e.result]),e.alterRowOffset=void 0,e.alterColumnOffset=void 0}throwOutOfBoundsWarning(){Vt("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}}function FC(t){return t==null||isNaN(t)}function Qce(t,e){eue(t,e),e.add(t)}function eue(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tue(t,e,r){return e=rue(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rue(t){var e=nue(t,"string");return typeof e=="symbol"?e:e+""}function nue(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function V0(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const LC="columnSummary",iue=220;var nd=new WeakSet;class sue extends Pt{constructor(){super(...arguments),Qce(this,nd),tue(this,"endpoints",null)}static get PLUGIN_KEY(){return LC}static get PLUGIN_PRIORITY(){return iue}isEnabled(){return!!this.hot.getSettings()[LC]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[LC],this.endpoints=new Jce(this,this.settings),this.addHook("afterInit",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return V0(nd,e,oue).call(e,...n)}),this.addHook("afterChange",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return V0(nd,e,lue).call(e,...n)}),this.addHook("afterUpdateSettings",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return V0(nd,e,aue).call(e,...n)}),this.addHook("beforeCreateRow",(r,n,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_row",r,n,null,i)),this.addHook("beforeCreateCol",(r,n,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_col",r,n,null,i)),this.addHook("beforeRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_row",...n)}),this.addHook("beforeRemoveCol",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_col",...n)}),this.addHook("afterCreateRow",(r,n,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_row",r,n,null,i)),this.addHook("afterCreateCol",(r,n,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_col",r,n,null,i)),this.addHook("afterRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_row",...n)}),this.addHook("afterRemoveCol",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_col",...n)}),this.addHook("afterRowMove",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return V0(nd,e,cue).call(e,...n)}),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 r=0;return dt(e.ranges,n=>{r+=this.getPartialSum(n,e.sourceColumn)}),r}getPartialSum(e,r){let n=0,i=e[1]||e[0],s=null,o=0;do{if(s=this.getCellValue(i,r),s=FC(s)?null:s,s!==null){const a=(`${s}`.split(".")[1]||[]).length||1;a>o&&(o=a)}n+=s||0,i-=1}while(i>=e[0]);return Math.round(n*10**o)/10**o}calculateMinMax(e,r){let n=null;return dt(e.ranges,i=>{const s=this.getPartialMinMax(i,e.sourceColumn,r);if(n===null&&s!==null&&(n=s),s!==null)switch(r){case"min":n=Math.min(n,s);break;case"max":n=Math.max(n,s);break}}),n===null?"Not enough data":n}getPartialMinMax(e,r,n){let i=null,s=e[1]||e[0],o;do{if(o=this.getCellValue(s,r),o=FC(o)?null:o,i===null)i=o;else if(o!==null)switch(n){case"min":i=Math.min(i,o);break;case"max":i=Math.max(i,o);break}s-=1}while(s>=e[0]);return i}countEmpty(e,r){let n,i=0,s=e[1]||e[0];do n=this.getCellValue(s,r),n=FC(n)?null:n,n===null&&(i+=1),s-=1;while(s>=e[0]);return i}countEntries(e){let r=0;const n=e.ranges;return dt(n,i=>{const s=i[1]===void 0?1:i[1]-i[0]+1,o=this.countEmpty(i,e.sourceColumn);r+=s,r-=o}),r}calculateAverage(e){const r=this.calculateSum(e),n=this.countEntries(e);return r/n}getCellValue(e,r){const n=this.hot.toVisualRow(e),i=this.hot.toVisualColumn(r);let s=this.hot.getSourceDataAtCell(e,r),o="";if(n!==null&&i!==null&&(o=this.hot.getCellMeta(n,i).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(Dt`ColumnSummary plugin: cell at (${e}, ${r}) is not in a\x20
  114. numeric format. Cannot do the calculation.`);return s}}function oue(){this.endpoints.initEndpoints()}function aue(t){t.columns!==void 0&&this.endpoints.refreshCellMetas()}function lue(t,e){t&&e!=="ColumnSummary.reset"&&e!=="ColumnSummary.set"&&e!=="loadData"&&this.endpoints.refreshChangedEndpoints(t)}function cue(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 du(t,e,r){return e=uue(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uue(t){var e=hue(t,"string");return typeof e=="symbol"?e:e+""}function hue(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Wu{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,r){du(this,"rootDocument",void 0),du(this,"isRtl",!1),du(this,"container",null),du(this,"editor",void 0),du(this,"editorStyle",void 0),du(this,"hidden",!0),this.rootDocument=e,this.isRtl=r,this.editor=this.createEditor(),this.editorStyle=this.editor.style,this.hide()}setPosition(e,r){this.editorStyle.left=`${e}px`,this.editorStyle.top=`${r}px`}setSize(e,r){if(e&&r){const n=this.getInputElement();n.style.width=`${e}px`,n.style.height=`${r}px`}}getSize(){return{width:Bt(this.getInputElement()),height:pr(this.getInputElement())}}resetSize(){const e=this.getInputElement();e.style.width="",e.style.height=""}setReadOnlyState(e){const r=this.getInputElement();r.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 r=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"")||"";this.getInputElement().value=r}getValue(){return this.getInputElement().value}isFocused(){return this.rootDocument.activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=this.rootDocument.createElement("div"),r=this.rootDocument.createElement("textarea");return e.style.display="none",this.container=this.rootDocument.createElement("div"),this.container.setAttribute("dir",this.isRtl?"rtl":"ltr"),Re(this.container,Wu.CLASS_EDITOR_CONTAINER),this.rootDocument.body.appendChild(this.container),Re(e,Wu.CLASS_EDITOR),Re(r,Wu.CLASS_INPUT),r.setAttribute("data-hot-input",!0),e.appendChild(r),this.container.appendChild(e),e}getInputElement(){return this.editor.querySelector(`.${Wu.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 $C(t,e,r){return e=due(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function due(t){var e=fue(t,"string");return typeof e=="symbol"?e:e+""}function fue(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const gue=250,mue=250;class G2{constructor(e){$C(this,"wasLastActionShow",!0),$C(this,"showDebounced",null),$C(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout(()=>{this.wasLastActionShow===!1&&this.runLocalHooks("hide")},mue)}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]:gue;this.showDebounced=Iy(r=>{this.wasLastActionShow&&this.runLocalHooks("show",r.from.row,r.from.col)},e)}destroy(){this.clearLocalHooks()}}zt(G2,Wn);function pue(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")} ${e}`}function wue(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")} ${e}`}function Bl(t,e){const r={};return j(t,n=>{n.forAll((i,s)=>{i>=0&&s>=0&&(r[i]||(r[i]=[]),r[i][s]=e(i,s))})}),r}function Ha(t,e,r,n,i){j(t,s=>{s.forAll((o,a)=>{o>=0&&a>=0&&vue(o,a,e,r,n,i)})})}function vue(t,e,r,n,i,s){const o=i(t,e);let a=n;o.className&&(r==="vertical"?a=pue(o.className,n):a=wue(o.className,n)),s(t,e,"className",a)}function Wo(t){return`<span class="selected">✓</span>${t}`}function no(t,e){let r=!1;return Array.isArray(t)&&j(t,n=>(n.forAll((i,s)=>{if(i>=0&&s>=0&&e(i,s))return r=!0,!1}),r)),r}function Vw(t,e){const r={top:0,left:0};if(e!==t.ownerDocument){const{frameElement:n}=e.defaultView,{top:i,left:s}=n.getBoundingClientRect();r.top=i,r.left=s}return r}const ht="---------";function Cue(){return{name:ht}}const Ni="alignment";function Sue(){return{key:Ni,name(){return this.getTranslatedPhrase(Hb)},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:`${Ni}:left`,name(){let t=this.getTranslatedPhrase(Fb);return no(this.getSelectedRange(),(r,n)=>{const i=this.getCellMeta(r,n).className;if(i&&i.indexOf("htLeft")!==-1)return!0})&&(t=Wo(t)),t},callback(){const t=this.getSelectedRange(),e=Bl(t,(i,s)=>this.getCellMeta(i,s).className),r="horizontal",n="htLeft";this.runHooks("beforeCellAlignment",e,t,r,n),Ha(t,r,n,(i,s)=>this.getCellMeta(i,s),(i,s,o,a)=>this.setCellMeta(i,s,o,a)),this.render()},disabled:!1},{key:`${Ni}:center`,name(){let t=this.getTranslatedPhrase(Lb);return no(this.getSelectedRange(),(r,n)=>{const i=this.getCellMeta(r,n).className;if(i&&i.indexOf("htCenter")!==-1)return!0})&&(t=Wo(t)),t},callback(){const t=this.getSelectedRange(),e=Bl(t,(i,s)=>this.getCellMeta(i,s).className),r="horizontal",n="htCenter";this.runHooks("beforeCellAlignment",e,t,r,n),Ha(t,r,n,(i,s)=>this.getCellMeta(i,s),(i,s,o,a)=>this.setCellMeta(i,s,o,a)),this.render()},disabled:!1},{key:`${Ni}:right`,name(){let t=this.getTranslatedPhrase($b);return no(this.getSelectedRange(),(r,n)=>{const i=this.getCellMeta(r,n).className;if(i&&i.indexOf("htRight")!==-1)return!0})&&(t=Wo(t)),t},callback(){const t=this.getSelectedRange(),e=Bl(t,(i,s)=>this.getCellMeta(i,s).className),r="horizontal",n="htRight";this.runHooks("beforeCellAlignment",e,t,r,n),Ha(t,r,n,(i,s)=>this.getCellMeta(i,s),(i,s,o,a)=>this.setCellMeta(i,s,o,a)),this.render()},disabled:!1},{key:`${Ni}:justify`,name(){let t=this.getTranslatedPhrase(Bb);return no(this.getSelectedRange(),(r,n)=>{const i=this.getCellMeta(r,n).className;if(i&&i.indexOf("htJustify")!==-1)return!0})&&(t=Wo(t)),t},callback(){const t=this.getSelectedRange(),e=Bl(t,(i,s)=>this.getCellMeta(i,s).className),r="horizontal",n="htJustify";this.runHooks("beforeCellAlignment",e,t,r,n),Ha(t,r,n,(i,s)=>this.getCellMeta(i,s),(i,s,o,a)=>this.setCellMeta(i,s,o,a)),this.render()},disabled:!1},{name:ht},{key:`${Ni}:top`,name(){let t=this.getTranslatedPhrase(Vb);return no(this.getSelectedRange(),(r,n)=>{const i=this.getCellMeta(r,n).className;if(i&&i.indexOf("htTop")!==-1)return!0})&&(t=Wo(t)),t},callback(){const t=this.getSelectedRange(),e=Bl(t,(i,s)=>this.getCellMeta(i,s).className),r="vertical",n="htTop";this.runHooks("beforeCellAlignment",e,t,r,n),Ha(t,r,n,(i,s)=>this.getCellMeta(i,s),(i,s,o,a)=>this.setCellMeta(i,s,o,a)),this.render()},disabled:!1},{key:`${Ni}:middle`,name(){let t=this.getTranslatedPhrase(Wb);return no(this.getSelectedRange(),(r,n)=>{const i=this.getCellMeta(r,n).className;if(i&&i.indexOf("htMiddle")!==-1)return!0})&&(t=Wo(t)),t},callback(){const t=this.getSelectedRange(),e=Bl(t,(i,s)=>this.getCellMeta(i,s).className),r="vertical",n="htMiddle";this.runHooks("beforeCellAlignment",e,t,r,n),Ha(t,r,n,(i,s)=>this.getCellMeta(i,s),(i,s,o,a)=>this.setCellMeta(i,s,o,a)),this.render()},disabled:!1},{key:`${Ni}:bottom`,name(){let t=this.getTranslatedPhrase(Ub);return no(this.getSelectedRange(),(r,n)=>{const i=this.getCellMeta(r,n).className;if(i&&i.indexOf("htBottom")!==-1)return!0})&&(t=Wo(t)),t},callback(){const t=this.getSelectedRange(),e=Bl(t,(i,s)=>this.getCellMeta(i,s).className),r="vertical",n="htBottom";this.runHooks("beforeCellAlignment",e,t,r,n),Ha(t,r,n,(i,s)=>this.getCellMeta(i,s),(i,s,o,a)=>this.setCellMeta(i,s,o,a)),this.render()},disabled:!1}]}}}const Ww="clear_column";function xue(){return{key:Ww,name(){return this.getTranslatedPhrase(yb)},callback(t,e){const r=e[0].start.col,n=e[0].end.col;this.countRows()&&this.populateFromArray(0,r,[[null]],Math.max(e[0].start.row,e[0].end.row),n,"ContextMenu.clearColumn")},disabled(){const t=this.getSelectedRangeLast();return!t||t.isSingleHeader()&&t.highlight.col<0?!0:!this.selection.isSelectedByColumnHeader()}}}const xg="col_left";function yue(){return{key:xg,name(){return this.getTranslatedPhrase(mb)},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 yg="col_right";function bue(){return{key:yg,name(){return this.getTranslatedPhrase(pb)},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 bg="make_read_only";function Eue(){return{key:bg,name(){let t=this.getTranslatedPhrase(xb);return no(this.getSelectedRange(),(r,n)=>this.getCellMeta(r,n).readOnly)&&(t=Wo(t)),t},callback(){const t=this.getSelectedRange(),e=no(t,(r,n)=>this.getCellMeta(r,n).readOnly);j(t,r=>{r.forAll((n,i)=>{n>=0&&i>=0&&this.setCellMeta(n,i,"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 Uw="redo";function Rue(){return{key:Uw,name(){return this.getTranslatedPhrase(Sb)},callback(){this.redo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}}const Eg="remove_col";function Tue(){return{key:Eg,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[,r,,n]=t[0];r-n!==0&&(e=1)}return this.getTranslatedPhrase(vb,e)},callback(){this.alter("remove_col",cie(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 Yw="remove_row";function _ue(){return{key:Yw,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[r,,n]=t[0];r-n!==0&&(e=1)}return this.getTranslatedPhrase(wb,e)},callback(){this.alter("remove_row",uie(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 zw="row_above";function Aue(){return{key:zw,name(){return this.getTranslatedPhrase(fb)},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 Gw="row_below";function Mue(){return{key:Gw,name(){return this.getTranslatedPhrase(gb)},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 Bf="no_items";function Iue(){return{key:Bf,name(){return this.getTranslatedPhrase(db)},disabled:!0,isCommand:!1}}const jw="undo";function Oue(){return{key:jw,name(){return this.getTranslatedPhrase(Cb)},callback(){this.undo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}}const Pue=[zw,Gw,xg,yg,Ww,Yw,Eg,jw,Uw,bg,Ni,ht,Bf],Due={[ht]:Cue,[Bf]:Iue,[zw]:Aue,[Gw]:Mue,[xg]:yue,[yg]:bue,[Ww]:xue,[Yw]:_ue,[Eg]:Tue,[jw]:Oue,[Uw]:Rue,[bg]:Eue,[Ni]:Sue};function j2(){const t={};return dt(Due,(e,r)=>{t[r]=e()}),t}function kue(t){return{key:"commentsAddEdit",name(){var e;const r=(e=this.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r!=null&&r.isCell()&&t.getCommentAtCell(r.row,r.col)?this.getTranslatedPhrase(Db):this.getTranslatedPhrase(Pb)},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 Nue(t){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(kb)},callback(){this.getSelectedRangeLast().forAll((r,n)=>{r>=0&&n>=0&&t.removeCommentAtCell(r,n,!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 Hue(t){return{key:"commentsReadOnly",name(){const e=this.getTranslatedPhrase(Nb);return no(this.getSelectedRange(),(n,i)=>t.getCommentMeta(n,i,$m))?Wo(e):e},callback(){this.getSelectedRangeLast().forAll((r,n)=>{if(r>=0&&n>=0){const i=!!t.getCommentMeta(r,n,$m);t.updateCommentMeta(r,n,{[$m]:!i})}})},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 Fue(t,e){K2(t,e),e.add(t)}function Vl(t,e,r){K2(t,e),e.set(t,r)}function K2(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Lue(t,e,r){return e=$ue(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $ue(t){var e=Bue(t,"string");return typeof e=="symbol"?e:e+""}function Bue(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qo(t,e,r){return t.set(Oi(t,e),r),r}function ct(t,e){return t.get(Oi(t,e))}function Oi(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const of="comments",Vue=60,Uo="comment",Ld="value",X2="style",$m="readOnly",W0=of,$S=`plugin:${of}`;var Yt=new WeakMap,us=new WeakMap,Kw=new WeakMap,Bm=new WeakMap,Ip=new WeakMap,BS=new WeakMap,Op=new WeakMap,ns=new WeakSet;class Wue extends Pt{constructor(){super(...arguments),Fue(this,ns),Lue(this,"range",{}),Vl(this,Yt,null),Vl(this,us,null),Vl(this,Kw,!1),Vl(this,Bm,!1),Vl(this,Ip,{}),Vl(this,BS,null),Vl(this,Op,"")}static get PLUGIN_KEY(){return of}static get PLUGIN_PRIORITY(){return Vue}isEnabled(){return!!this.hot.getSettings()[of]}enablePlugin(){this.enabled||(ct(Yt,this)||qo(Yt,this,new Wu(this.hot.rootDocument,this.hot.isRtl())),ct(us,this)||qo(us,this,new G2(this.getDisplayDelaySetting())),this.addHook("afterContextMenuDefaultOptions",e=>this.addToContextMenu(e)),this.addHook("afterRenderer",(e,r,n,i,s,o)=>Oi(ns,this,Gue).call(this,e,o)),this.addHook("afterScroll",()=>Oi(ns,this,Jue).call(this)),this.addHook("afterBeginEditing",()=>this.hide()),this.addHook("afterDocumentKeyDown",e=>Oi(ns,this,Zue).call(this,e)),ct(us,this).addLocalHook("hide",()=>this.hide()),ct(us,this).addLocalHook("show",(e,r)=>this.showAtCell(e,r)),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){ct(us,this).updateDelay(this.getDisplayDelaySetting()),super.updatePlugin()}disablePlugin(){this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager(),r=e.getContext("grid"),n=e.addContext($S);r.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const i=this.hot.getSelectedRangeLast();qo(Bm,this,!0),this.hot.scrollToFocusedCell(()=>{this.setRange(i),this.show(),this.focusEditor(),e.setActiveContextName($S),this.hot._registerTimeout(()=>{qo(Bm,this,!1)})})},stopPropagation:!0,runOnlyIf:()=>{var i;return((i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isCell())&&!ct(Yt,this).isVisible()},group:W0}),n.addShortcut({keys:[["Escape"]],callback:()=>{ct(Yt,this).setValue(ct(Op,this)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>ct(Yt,this).isVisible()&&ct(Yt,this).isFocused(),group:W0}),n.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>ct(Yt,this).isVisible()&&ct(Yt,this).isFocused(),group:W0})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(W0)}registerListeners(){const{rootDocument:e}=this.hot,r=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",n=>Oi(ns,this,Yue).call(this,n)),this.eventManager.addEventListener(e,"mousedown",n=>Oi(ns,this,Uue).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>Oi(ns,this,zue).call(this)),this.eventManager.addEventListener(r,"focus",()=>Oi(ns,this,Kue).call(this)),this.eventManager.addEventListener(r,"blur",()=>Oi(ns,this,jue).call(this)),this.eventManager.addEventListener(r,"mousedown",n=>Oi(ns,this,Xue).call(this,n)),this.eventManager.addEventListener(r,"mouseup",n=>Oi(ns,this,que).call(this,n))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const r=Sc(e.target,"TD","TBODY");return!!(r&&Ze(r,"htCommentCell")&&Sc(r,[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 r=ct(Yt,this).getValue();let n="";e!=null?n=e:r!=null&&(n=r);const i=this.range.from.row,s=this.range.from.col;this.updateCommentMeta(i,s,{[Ld]:n}),this.hot.render()}setCommentAtCell(e,r,n){this.setRange({from:this.hot._createCellCoords(e,r)}),this.setComment(n)}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,Uo),e&&this.hot.render(),this.hide()}removeCommentAtCell(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;this.setRange({from:this.hot._createCellCoords(e,r)}),this.removeComment(n)}getComment(){const e=this.range.from.row,r=this.range.from.col;return this.getCommentMeta(e,r,Ld)}getCommentAtCell(e,r){return this.getCommentMeta(e,r,Ld)}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:r,col:n}}=this.range;if(r<0||r>this.hot.countSourceRows()-1||n<0||n>this.hot.countSourceCols()-1)return!1;const i=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return ct(us,this).cancelHiding(),ct(Yt,this).setValue((e=i[Uo]?i[Uo][Ld]:null)!==null&&e!==void 0?e:""),ct(Yt,this).show(),this.refreshEditor(!0),!0}showAtCell(e,r){return this.setRange({from:this.hot._createCellCoords(e,r)}),this.show()}hide(){ct(Yt,this).hide()}refreshEditor(){var e,r;if(!(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&(!this.range.from||!ct(Yt,this).isVisible()))return;const{rowIndexMapper:i,columnIndexMapper:s}=this.hot,{row:o,col:a}=this.range.from;let l=i.getRenderableFromVisualIndex(o),c=s.getRenderableFromVisualIndex(a);const u=l===null;ct(Yt,this).setPosition(0,0),l===null&&(l=i.getRenderableFromVisualIndex(i.getNearestNotHiddenIndex(o,-1))),c===null&&(c=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(a,-1)));const h=l===null,d=c===null;l=(e=l)!==null&&e!==void 0?e:0,c=(r=c)!==null&&r!==void 0?r:0;const{rootWindow:f,view:{_wt:g}}=this.hot,{wtTable:m}=g,p=g.getCell({row:l,col:c},!0),S=this.getCommentMeta(o,a,X2);S?ct(Yt,this).setSize(S.width,S.height):ct(Yt,this).resetSize();const y=d?0:m.getStretchedColumnWidth(c),C=u&&!h?pr(p):0,{left:E,top:A,width:O,height:T}=p.getBoundingClientRect(),{width:W,height:I}=ct(Yt,this).getSize(),{innerWidth:Y,innerHeight:z}=this.hot.rootWindow,U=this.hot.rootDocument.documentElement;let oe=E+f.scrollX+y,Ce=A+f.scrollY+C;this.hot.isRtl()&&(oe-=W+y),this.hot.isLtr()&&E+O+W>Y?oe=E+f.scrollX-W-1:this.hot.isRtl()&&oe<-(U.scrollWidth-U.clientWidth)&&(oe=E+f.scrollX+y+1),A+I>z&&(Ce-=I-T+1),ct(Yt,this).setPosition(oe,Ce),ct(Yt,this).setReadOnlyState(this.getCommentMeta(o,a,$m))}focusEditor(){ct(Yt,this).focus()}updateCommentMeta(e,r,n){const i=this.hot.getCellMeta(e,r)[Uo];let s;i?(s=Vn(i),_w(s,n)):s=n,this.hot.setCellMeta(e,r,Uo,s)}getCommentMeta(e,r,n){const i=this.hot.getCellMeta(e,r);if(i[Uo])return i[Uo][n]}addToContextMenu(e){e.items.push({name:ht},kue(this),Nue(this),Hue(this))}getDisplayDelaySetting(){const e=this.hot.getSettings()[of];if(at(e))return e.displayDelay}getEditorInputElement(){return ct(Yt,this).getInputElement()}destroy(){ct(Yt,this)&&ct(Yt,this).destroy(),ct(us,this)&&ct(us,this).destroy(),super.destroy()}}function Uue(t){if(!(!this.hot.view||!this.hot.view._wt)&&!ct(Kw,this)&&!this.targetIsCommentTextArea(t)){const e=Sc(t.target,"TD","TBODY");let r=null;e&&(r=this.hot.getCoords(e)),(!e||this.range.from&&r&&(this.range.from.row!==r.row||this.range.from.col!==r.col))&&this.hide()}}function Yue(t){const{rootDocument:e}=this.hot;if(!(ct(Kw,this)||ct(Yt,this).isFocused()||Ze(t.target,"wtBorder")||ct(BS,this)===t.target||!ct(Yt,this)))if(qo(BS,this,e.elementFromPoint(t.clientX,t.clientY)),this.targetIsCellWithComment(t)){const r=this.hot._createCellRange(this.hot.getCoords(t.target));ct(us,this).show(r)}else pc(t.target,e)&&!this.targetIsCommentTextArea(t)&&ct(us,this).hide()}function zue(){qo(Kw,this,!1)}function Gue(t,e){e[Uo]&&e[Uo][Ld]&&Re(t,e.commentedCellClassName)}function jue(){qo(Op,this,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function Kue(){qo(Op,this,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName($S)}function Xue(t){qo(Ip,this,{width:Bt(t.target),height:pr(t.target)})}function que(t){const e=Bt(t.target),r=pr(t.target);(e!==ct(Ip,this).width+1||r!==ct(Ip,this).height+2)&&this.updateCommentMeta(this.range.from.row,this.range.from.col,{[X2]:{width:e,height:r}})}function Zue(t){ct(Yt,this).isVisible()&&Ps(t)}function Jue(){ct(Bm,this)||this.hide()}var LM=cw,Que=TypeError,ehe=function(t,e){if(!delete t[e])throw new Que("Cannot delete property "+LM(e)+" of "+LM(t))},the=En,rhe=tg,nhe=ng,ihe=xD,she=ehe,ohe=yD,ahe=[].unshift(0)!==1,lhe=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(t){return t instanceof TypeError}},che=ahe||!lhe();the({target:"Array",proto:!0,arity:1,forced:che},{unshift:function(e){var r=rhe(this),n=nhe(r),i=arguments.length;if(i){ohe(n+i);for(var s=n;s--;){var o=s+i;s in r?r[o]=r[s]:she(r,o)}for(var a=0;a<i;a++)r[a]=arguments[a]}return ihe(r,n+i)}});function BC(t,e,r){return e=uhe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uhe(t){var e=hhe(t,"string");return typeof e=="symbol"?e:e+""}function hhe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class q2{constructor(e){BC(this,"hot",void 0),BC(this,"commands",{}),BC(this,"commonCallback",null),this.hot=e}registerCommand(e,r){this.commands[e]=r}setCommonCallback(e){this.commonCallback=e}execute(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];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=dhe(a,l.submenu.items)),l.disabled===!0||typeof l.disabled=="function"&&l.disabled.call(this.hot)===!0||mr(l,"submenu"))return;const c=[];typeof l.callback=="function"&&c.push(l.callback),typeof this.commonCallback=="function"&&c.push(this.commonCallback),n.unshift(s.join(":")),j(c,u=>u.apply(this.hot,n))}}function dhe(t,e){let r;return j(e,n=>{const i=n.key?n.key.split(":"):null;if(Array.isArray(i)&&i[1]===t)return r=n,!1}),r}function VC(t,e,r){return e=fhe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fhe(t){var e=ghe(t,"string");return typeof e=="symbol"?e:e+""}function ghe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Z2{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;VC(this,"hot",void 0),VC(this,"predefinedItems",j2()),VC(this,"defaultOrderPattern",void 0),this.hot=e,this.defaultOrderPattern=r}setPredefinedItems(e){const r={};this.defaultOrderPattern.length=0,dt(e,(n,i)=>{let s="";n.name===ht?(r[ht]=n,s=ht):isNaN(parseInt(i,10))?(n.key=n.key===void 0?i:n.key,r[i]=n,s=n.key):(r[n.key]=n,s=n.key),this.defaultOrderPattern.push(s)}),this.predefinedItems=r}getItems(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return mhe(e,this.defaultOrderPattern,this.predefinedItems)}}function mhe(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=[];let i=t;return i&&i.items?i=i.items:Array.isArray(i)||(i=e),at(i)?dt(i,(s,o)=>{let a=r[typeof s=="string"?s:o];a||(a=s),at(s)?kr(a,s):typeof a=="string"&&(a={name:a}),a.key===void 0&&(a.key=o),n.push(a)}):j(i,(s,o)=>{let a=r[s];!a&&Pue.indexOf(s)>=0||(a||(a={name:s,key:`${o}`}),at(s)&&kr(a,s),a.key===void 0&&(a.key=o),n.push(a))}),n}function Ta(t,e,r){return e=phe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function phe(t){var e=whe(t,"string");return typeof e=="symbol"?e:e+""}function whe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class vhe{constructor(e,r){Ta(this,"top",void 0),Ta(this,"topRelative",void 0),Ta(this,"left",void 0),Ta(this,"leftRelative",void 0),Ta(this,"scrollTop",void 0),Ta(this,"scrollLeft",void 0),Ta(this,"cellHeight",void 0),Ta(this,"cellWidth",void 0);const n=r.scrollY,i=r.scrollX;let s,o,a,l,c,u;this.rootWindow=r,this.type=this.getSourceType(e),this.type==="literal"?(s=parseInt(e.top,10),a=parseInt(e.left,10),c=e.height||0,u=e.width||0,o=s,l=a,s+=n,a+=i):this.type==="event"&&(s=parseInt(e.pageY,10),a=parseInt(e.pageX,10),c=e.target.clientHeight,u=e.target.clientWidth,o=s-n,l=a-i),this.top=s,this.topRelative=o,this.left=a,this.leftRelative=l,this.scrollTop=n,this.scrollLeft=i,this.cellHeight=c,this.cellWidth=u}getSourceType(e){let r="literal";return e instanceof Event&&(r="event"),r}fitsAbove(e){return this.topRelative>=e.offsetHeight}fitsBelow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.innerHeight;return this.topRelative+e.offsetHeight<=r}fitsOnRight(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=r}fitsOnLeft(e){return this.leftRelative>=e.offsetWidth}}function id(t,e,r){Che(t,e),e.set(t,r)}function Che(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mt(t,e){return t.get(J2(t,e))}function U0(t,e,r){return t.set(J2(t,e),r),r}function J2(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var _n=new WeakMap,_a=new WeakMap,rn=new WeakMap,WC=new WeakMap,fu=new WeakMap;class She{constructor(e){id(this,_n,void 0),id(this,_a,void 0),id(this,rn,void 0),id(this,WC,!1),id(this,fu,{above:0,below:0,left:0,right:0}),U0(WC,this,e)}setOffset(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return mt(fu,this)[e]=r,this}setElement(e){return U0(_n,this,e),this}setParentElement(e){return U0(_a,this,e),this}updatePosition(e){U0(rn,this,new vhe(e,mt(_n,this).ownerDocument.defaultView)),mt(WC,this)?(mt(rn,this).fitsBelow(mt(_n,this))?this.setPositionBelowCursor():mt(rn,this).fitsAbove(mt(_n,this))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){mt(_n,this).dir==="rtl"?mt(rn,this).fitsOnLeft(mt(_n,this))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():mt(rn,this).fitsOnRight(mt(_n,this))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=mt(fu,this).above+mt(rn,this).top-mt(_n,this).offsetHeight;mt(_a,this)&&(e=mt(rn,this).top+mt(rn,this).cellHeight-mt(_n,this).offsetHeight+3),mt(_n,this).style.top=`${e}px`}setPositionBelowCursor(){let e=mt(fu,this).below+mt(rn,this).top+1;mt(_a,this)&&(e=mt(rn,this).top-1),mt(_n,this).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=mt(rn,this).left;if(mt(_a,this)){const{right:r}=mt(_a,this).getBoundingClientRect();e+=mt(rn,this).cellWidth+r-(mt(rn,this).left+mt(rn,this).cellWidth)}else e+=mt(fu,this).right;mt(_n,this).style.left=`${e}px`}setPositionOnLeftOfCursor(){let e=mt(fu,this).left+mt(rn,this).left-mt(_n,this).offsetWidth;if(mt(_a,this)){const{left:r}=mt(_a,this).getBoundingClientRect();e-=mt(rn,this).left-r}mt(_n,this).style.left=`${e}px`}}function Q2(t){let{initialPage:e=-1,size:r=()=>0,onItemSelect:n=()=>{},onClear:i=()=>{}}=t;const s=new Set;let o=Ht(e,-1,g()-1);function a(p,S){const y=g()-1;return p<0&&(p=y),p>y&&(p=0),s.has(p)?-1:(s.add(p),n(p,!1)===!1&&(p=a(S===1?++p:--p,S)),p)}function l(p){p>-1&&p<g()&&n(p,!0)!==!1&&(o=p)}function c(){return o}function u(){g()>0&&(s.clear(),o=a(0,1))}function h(){g()>0&&(s.clear(),o=a(g()-1,-1))}function d(){g()>0&&(s.clear(),o=a(++o,1))}function f(){g()>0&&(s.clear(),o=a(--o,-1))}function g(){return Math.max(r(),0)}function m(){s.clear(),o=e,i()}return{setCurrentPage:l,getCurrentPage:c,toFirstItem:u,toLastItem:h,toNextItem:d,toPreviousItem:f,getSize:g,clear:m}}function xhe(t){return wt(t,e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()}))}function VS(t){return mr(t,"submenu")}function WS(t){return new RegExp(ht,"i").test(t.name)}function Vm(t,e){return t.disabled===!0||typeof t.disabled=="function"&&t.disabled.call(e)===!0}function $M(t){return mr(t,"disableSelection")}function yhe(t){return Ze(t,"htSeparator")}function bhe(t){return Ze(t,"htSubmenu")}function Ehe(t){return Ze(t,"htDisabled")}function Rhe(t){return Ze(t,"htSelectionDisabled")}function The(t,e){return!t.hidden||!(typeof t.hidden=="function"&&t.hidden.call(e))}function eH(t,e){const r=t.slice(0);for(let n=0;n<r.length&&r[n].name===e;)r.shift();return r}function _he(t,e){let r=t.slice(0);return r.reverse(),r=eH(r,e),r.reverse(),r}function Ahe(t){const e=[];return j(t,(r,n)=>{n>0?e[e.length-1].name!==r.name&&e.push(r):e.push(r)}),e}function Mhe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ht,r=t.slice(0);return r=eH(r,e),r=_he(r,e),r=Ahe(r),r}function Ihe(t){return Q2({size:()=>t.countRows(),onItemSelect(e,r){const n=t.getCell(e,0);if(!n||yhe(n)||Ehe(n)||Rhe(n))return!1;t.selectCell(e,0,...r?[e,0,!1,!1]:[])},onClear(){t.deselectCell()}})}function Ohe(t){const{hot:e,hotMenu:r}=t;return[{keys:[["Control/Meta","A"]],forwardToContext:e.getShortcutManager().getContext("grid"),callback:()=>t.close(!0)},{keys:[["Tab"],["Shift","Tab"]],callback:(n,i)=>{const s=e.getSettings(),o=typeof s.tabMoves=="function"?s.tabMoves(n):s.tabMoves;i.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 n=r.getSelectedLast();if(n){const i=t.openSubMenu(n[0]);i&&i.getNavigator().toFirstItem()}}},{keys:[["ArrowLeft"]],callback:()=>{r.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:n=>{const i=r.getSelectedLast();i&&(r.getSourceDataAtRow(i[0]).submenu?t.openSubMenu(i[0]).getNavigator().toFirstItem():(t.executeCommand(n),t.close(!0)))}},{keys:[["PageUp"]],callback:()=>{r.getSelectedLast()?r.selection.transformStart(-r.countVisibleRows(),0):t.getNavigator().toFirstItem()}},{keys:[["PageDown"]],callback:()=>{r.getSelectedLast()?r.selection.transformStart(r.countVisibleRows(),0):t.getNavigator().toLastItem()}}]}const tH="menu",BM=tH;function Phe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=[];n(Ohe(t)),e.forEach(c=>{let{shortcuts:u,contextName:h}=c;i(u,h)});function n(c,u){a(u).addShortcuts(c,{group:tH})}function i(c,u){const h=a(u);c.forEach(d=>{let{keys:f}=d;f.forEach(g=>h.removeShortcutsByKeys(g))}),r.push({shortcuts:c,contextName:u}),n(c,u)}function s(){return[...r]}function o(c){return c?`${BM}:${c}`:BM}function a(c){var u;const h=t.hotMenu.getShortcutManager(),d=o(c);return(u=h.getContext(d))!==null&&u!==void 0?u:h.addContext(d)}function l(c){t.hotMenu.getShortcutManager().setActiveContextName(o(c))}return{addCustomShortcuts:i,getCustomShortcuts:s,getContext:a,listen:l}}function Dhe(t){return(e,r,n,i,s,o)=>{if(r.hasAttribute("ghost-table"))return;const a=e.getSourceDataAtRow(n),l=t.rootDocument.createElement("div"),c=typeof o=="function"?o.call(t):o;if(mo(r),Re(l,"htItemWrapper"),t.getSettings().ariaTags){const u=!Vm(a,t)&&!$M(a)&&!WS(a);Xe(r,[IZ(),Ey(c),...u?[wh(-1)]:[],...Vm(a,t)?[FZ()]:[],...VS(a)?[Wi(!1)]:[]])}r.className="",r.appendChild(l),WS(a)?Re(r,"htSeparator"):typeof a.renderer=="function"?(Re(r,"htCustomMenuRenderer"),r.appendChild(a.renderer(e,l,n,i,s,c))):Ch(l,c),Vm(a,t)?Re(r,"htDisabled"):$M(a)?Re(r,"htSelectionDisabled"):VS(a)&&Re(r,"htSubmenu")}}function VM(t,e,r){khe(t,e),e.set(t,r)}function khe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Us(t,e,r){return e=Nhe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nhe(t){var e=Hhe(t,"string");return typeof e=="symbol"?e:e+""}function Hhe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function WM(t,e,r){return t.set(rH(t,e),r),r}function sd(t,e){return t.get(rH(t,e))}function rH(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const UM=215;var od=new WeakMap,Y0=new WeakMap;class bh{constructor(e,r){var n=this;Us(this,"hot",void 0),Us(this,"options",void 0),Us(this,"eventManager",new As(this)),Us(this,"container",void 0),Us(this,"positioner",void 0),Us(this,"hotMenu",null),Us(this,"hotSubMenus",{}),Us(this,"parentMenu",void 0),Us(this,"menuItems",null),Us(this,"origOutsideClickDeselects",null),VM(this,od,void 0),VM(this,Y0,void 0),this.hot=e,this.options=r||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:UM,container:this.hot.rootDocument.documentElement},this.container=this.createContainer(this.options.name),this.positioner=new She(this.options.keepInViewport),this.parentMenu=this.options.parent||null,this.registerEvents(),this.isSubMenu()&&this.addLocalHook("afterSelectionChange",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return n.parentMenu.runLocalHooks("afterSelectionChange",...s)})}registerEvents(){let e=this.hot.rootWindow;for(;e;)this.eventManager.addEventListener(e.document,"mousedown",r=>this.onDocumentMouseDown(r)),this.eventManager.addEventListener(e.document,"contextmenu",r=>this.onDocumentContextMenu(r)),e=sh(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return sd(od,this)}getKeyboardShortcutsCtrl(){return sd(Y0,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=Iy(a=>this.openSubMenu(a),300),r=this.options.minWidth||UM;let n=!1,i=Rs(this.menuItems,a=>(a.key===Bf&&(n=!0),The(a,this.hot)));if(i.length<1&&!n)i.push(j2()[Bf]);else if(i.length===0)return;i=Mhe(i,ht);let s=!1;const o={data:i,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth(a){return Le(a)&&a<r?r:a},autoRowSize:!1,readOnly:!0,editor:!1,copyPaste:!1,hiddenRows:!0,maxCols:1,columns:[{data:"name",renderer:Dhe(this.hot)}],renderAllRows:!0,fragmentSelection:!1,outsideClickDeselects:!1,disableVisualSelection:"area",layoutDirection:this.hot.isRtl()?"rtl":"ltr",ariaTags:!1,beforeOnCellMouseOver:(a,l)=>{sd(od,this).setCurrentPage(l.row)},afterOnCellMouseOver:(a,l)=>{this.isAllSubMenusClosed()?e(l.row):this.openSubMenu(l.row)},rowHeights:a=>i[a].name===ht?1:23,afterOnCellContextMenu:a=>{a.preventDefault(),eA()&&s&&this.hasSelectedItem()&&this.close(!0)},afterSelection:(a,l,c,u,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=>{(!eA()||!bc(a))&&s&&this.hasSelectedItem()&&(Qa()||oN()?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(),WM(od,this,Ihe(this.hotMenu)),WM(Y0,this,Phe(this)),sd(Y0,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(sd(od,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 r=this.parentMenu.hotMenu.getSelectedLast();if(r){const n=this.parentMenu.hotMenu.getCell(r[0],0);Xe(n,[Wi(!1)])}}this.parentMenu.hotMenu.listen()}}}openSubMenu(e){if(!this.hotMenu)return!1;const r=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!r||!bhe(r))return!1;const n=this.hotMenu.getSourceDataAtRow(e),i=new bh(this.hot,{parent:this,name:n.name,className:this.options.className,keepInViewport:!0,container:this.options.container});return i.setMenuItems(n.submenu.items),i.open(),i.setPosition(r.getBoundingClientRect()),this.hotSubMenus[n.key]=i,this.hot.getSettings().ariaTags&&Xe(r,[Wi(!0)]),i}closeSubMenu(e){const r=this.hotMenu.getSourceDataAtRow(e),n=this.hotSubMenus[r.key];if(n){n.destroy(),delete this.hotSubMenus[r.key];const i=this.hotMenu.getCell(e,0);this.hot.getSettings().ariaTags&&Xe(i,[Wi(!1)])}}closeAllSubMenus(){j(this.hotMenu.getData(),(e,r)=>this.closeSubMenu(r))}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 r=this.getSelectedItem();if(this.runLocalHooks("select",r,e),this.isCommandPassive(r))return;const n=this.hot.getSelectedRange(),i=n?xhe(n):[];this.runLocalHooks("executeCommand",r.key,i,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",r.key,i,e)}isCommandPassive(e){return e.isCommand===!1||WS(e)||Vm(e,this.hot)||VS(e)}setOffset(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.positioner.setOffset(e,r)}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 r=this.options.container.ownerDocument;let n=e,i;return n&&(Xt(n)&&(n=n.call(this.hot),n===null||Zt(n)?n="":n=n.toString()),n=n.replace(/[^A-z0-9]/g,"_"),n=`${this.options.className}Sub_${n}`,i=r.querySelector(`.${this.options.className}.${n}`)),i||(i=r.createElement("div"),Re(i,`htMenu ${this.options.className}`),n&&Re(i,n),this.options.container.appendChild(i)),i}onAfterInit(){const{wtTable:e}=this.hotMenu.view._wt,r=this.hotMenu.getSettings().data,n=e.hider.style,i=e.holder.style,s=parseInt(n.width,10),o=Rn(r,(a,l)=>a+(l.name===ht?1:26),0);i.width=`${s+3}px`,i.height=`${o+3}px`,n.height=i.height,this.hot.getSettings().ariaTags&&Xe(this.hotMenu.rootElement,[MZ(),wh(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!pc(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!pc(e.target,".htMenu")&&this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&Ze(e.target,"htCore")&&pc(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}zt(bh,Wn);function Fhe(t,e){Lhe(t,e),e.add(t)}function Lhe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function UC(t,e,r){return e=$he(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $he(t){var e=Bhe(t,"string");return typeof e=="symbol"?e:e+""}function Bhe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function z0(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const $d="contextMenu",Vhe=70,YM=$d;He.getSingleton().register("afterContextMenuDefaultOptions");He.getSingleton().register("beforeContextMenuShow");He.getSingleton().register("afterContextMenuShow");He.getSingleton().register("afterContextMenuHide");He.getSingleton().register("afterContextMenuExecute");var ad=new WeakSet;class Xw extends Pt{constructor(){super(...arguments),Fhe(this,ad),UC(this,"commandExecutor",new q2(this.hot)),UC(this,"itemsFactory",null),UC(this,"menu",null)}static get PLUGIN_KEY(){return $d}static get PLUGIN_PRIORITY(){return Vhe}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[zw,Gw,ht,xg,yg,ht,Yw,Eg,ht,jw,Uw,ht,bg,ht,Ni]}isEnabled(){return!!this.hot.getSettings()[$d]}enablePlugin(){var e=this;if(this.enabled)return;const r=this.hot.getSettings()[$d];typeof r.callback=="function"&&this.commandExecutor.setCommonCallback(r.callback),this.menu=new bh(this.hot,{className:"htContextMenu",keepInViewport:!0,container:r.uiContainer||this.hot.rootDocument.body}),this.menu.addLocalHook("beforeOpen",()=>z0(ad,this,Uhe).call(this)),this.menu.addLocalHook("afterOpen",()=>z0(ad,this,Yhe).call(this)),this.menu.addLocalHook("afterClose",()=>z0(ad,this,zhe).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return e.executeCommand.call(e,...i)}),this.addHook("afterOnCellContextMenu",n=>z0(ad,this,Whe).call(this,n)),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 r=this.hot.getCell(e.row,e.col,!0).getBoundingClientRect(),n=Vw(this.menu.container,this.hot.rootDocument);this.open({left:r.left+n.left,top:r.top+n.top-1+r.height},{left:r.width,above:-r.height}),this.menu.getNavigator().toFirstItem()},runOnlyIf:()=>{var e;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&this.hot.selection.isCellVisible(r)&&!this.menu.isOpened()},group:YM})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(YM)}open(e){var r;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};(r=this.menu)!==null&&r!==void 0&&r.isOpened()||(this.prepareMenuItems(),this.menu.open(),dt(n,(i,s)=>{this.menu.setOffset(s,i)}),this.menu.setPosition(e))}close(){var e;(e=this.menu)===null||e===void 0||e.close(),this.itemsFactory=null}executeCommand(e){this.itemsFactory===null&&this.prepareMenuItems();for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.commandExecutor.execute(e,...n)}prepareMenuItems(){this.itemsFactory=new Z2(this.hot,Xw.DEFAULT_ITEMS);const e=this.hot.getSettings()[$d],r={items:this.itemsFactory.getItems(e)};this.hot.runHooks("afterContextMenuDefaultOptions",r),this.itemsFactory.setPredefinedItems(r.items);const n=this.itemsFactory.getItems(e);this.hot.runHooks("beforeContextMenuSetItems",n),this.menu.setMenuItems(n),j(n,i=>this.commandExecutor.registerCommand(i.key,i))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function Whe(t){const e=this.hot.getSettings(),r=e.rowHeaders,n=e.colHeaders;function i(a){return a.nodeName==="TD"||a.parentNode.nodeName==="TD"}const s=t.target;if(this.close(),Ze(s,"handsontableInput")||(t.preventDefault(),t.stopPropagation(),!(r||n)&&!i(s)&&!(Ze(s,"current")&&Ze(s,"wtBorder"))))return;const o=Vw(this.menu.container,this.hot.rootDocument);this.open({top:t.clientY+o.top,left:t.clientX+o.left})}function Uhe(){this.hot.runHooks("beforeContextMenuShow",this)}function Yhe(){this.hot.runHooks("afterContextMenuShow",this)}function zhe(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}Xw.SEPARATOR={name:ht};function Ghe(t){return{key:"copy",name(){return this.getTranslatedPhrase(bb)},callback(){t.copyCellsOnly()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}function jhe(t){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeLast(),r=e?Ht(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Tb,r)},callback(){t.copyColumnHeadersOnly()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}function Khe(t){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeLast(),r=e?Ht(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Rb,r)},callback(){t.copyWithAllColumnHeaders()},disabled(){if(!this.hasColHeaders()||!this.getSettings().nestedHeaders)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}function Xhe(t){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeLast(),r=e?Ht(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(Eb,r)},callback(){t.copyWithColumnHeaders()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}function qhe(t){return{key:"cut",name(){return this.getTranslatedPhrase(_b)},callback(){t.cut()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const r=this.getSelected();return!r||r.length>1},hidden:!1}}class Zhe{constructor(){this.data={}}setData(e,r){this.data[e]=r}getData(e){return this.data[e]||void 0}}class Jhe{constructor(){this.clipboardData=new Zhe}preventDefault(){}}function Qhe(t,e){nH(t,e),e.add(t)}function gu(t,e,r){nH(t,e),e.set(t,r)}function nH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function In(t,e){return t.get(Uu(t,e))}function mu(t,e,r){return t.set(Uu(t,e),r),r}function Uu(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Aa=new WeakMap,YC=new WeakMap,ld=new WeakMap,US=new WeakMap,YS=new WeakMap,cd=new WeakMap,ud=new WeakSet;class ede{constructor(e){let{countRows:r,countColumns:n,rowsLimit:i,columnsLimit:s,countColumnHeaders:o}=e;Qhe(this,ud),gu(this,Aa,void 0),gu(this,YC,void 0),gu(this,ld,void 0),gu(this,US,void 0),gu(this,YS,void 0),gu(this,cd,void 0),mu(YC,this,r),mu(ld,this,n),mu(US,this,i),mu(YS,this,s),mu(cd,this,o)}setSelectedRange(e){mu(Aa,this,e)}getCellsRange(){if(In(YC,this).call(this)===0||In(ld,this).call(this)===0)return null;const{row:e,col:r}=In(Aa,this).getTopStartCorner(),{row:n,col:i}=In(Aa,this).getBottomEndCorner(),s=Uu(ud,this,tde).call(this,e,n),o=Uu(ud,this,zC).call(this,r,i);return{isRangeTrimmed:n!==s||i!==o,startRow:e,startCol:r,endRow:s,endCol:o}}getMostBottomColumnHeadersRange(){if(In(ld,this).call(this)===0||In(cd,this).call(this)===0)return null;const{col:e}=In(Aa,this).getTopStartCorner(),{col:r}=In(Aa,this).getBottomEndCorner(),n=Uu(ud,this,zC).call(this,e,r);return{isRangeTrimmed:r!==n,startRow:-1,startCol:e,endRow:-1,endCol:n}}getAllColumnHeadersRange(){if(In(ld,this).call(this)===0||In(cd,this).call(this)===0)return null;const{col:e}=In(Aa,this).getTopStartCorner(),{col:r}=In(Aa,this).getBottomEndCorner(),n=Uu(ud,this,zC).call(this,e,r);return{isRangeTrimmed:r!==n,startRow:-In(cd,this).call(this),startCol:e,endRow:-1,endCol:n}}}function zC(t,e){return Math.min(e,Math.max(t+In(YS,this).call(this)-1,t))}function tde(t,e){return Math.min(e,Math.max(t+In(US,this).call(this)-1,t))}function iH(t){const e=[],r=[];return j(t,n=>{const i=Math.min(n.startRow,n.endRow),s=Math.max(n.startRow,n.endRow);Ue(i,s,l=>{e.indexOf(l)===-1&&e.push(l)});const o=Math.min(n.startCol,n.endCol),a=Math.max(n.startCol,n.endCol);Ue(o,a,l=>{r.indexOf(l)===-1&&r.push(l)})}),{rows:e,columns:r}}function rde(t,e){sH(t,e),e.add(t)}function Ma(t,e,r){sH(t,e),e.set(t,r)}function sH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hd(t,e,r){return e=nde(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nde(t){var e=ide(t,"string");return typeof e=="symbol"?e:e+""}function ide(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Qn(t,e){return t.get(ti(t,e))}function cs(t,e,r){return t.set(ti(t,e),r),r}function ti(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}He.getSingleton().register("afterCopyLimit");He.getSingleton().register("modifyCopyableRange");He.getSingleton().register("beforeCut");He.getSingleton().register("afterCut");He.getSingleton().register("beforePaste");He.getSingleton().register("afterPaste");He.getSingleton().register("beforeCopy");He.getSingleton().register("afterCopy");const G0="copyPaste",sde=80,ode=["fragmentSelection"],zM=['<meta name="generator" content="Handsontable"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join("");var zS=new WeakMap,GS=new WeakMap,jS=new WeakMap,pu=new WeakMap,j0=new WeakMap,K0=new WeakMap,wu=new WeakMap,Pp=new WeakMap,ui=new WeakSet;class ade extends Pt{constructor(){super(...arguments),rde(this,ui),hd(this,"columnsLimit",1/0),hd(this,"rowsLimit",1/0),hd(this,"pasteMode","overwrite"),hd(this,"uiContainer",this.hot.rootDocument.body),Ma(this,zS,!1),Ma(this,GS,!1),Ma(this,jS,!1),Ma(this,pu,"cells-only"),Ma(this,j0,!1),Ma(this,K0,!1),Ma(this,wu,new ede({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),Ma(this,Pp,!1),hd(this,"copyableRanges",[])}static get PLUGIN_KEY(){return G0}static get SETTING_KEYS(){return[G0,...ode]}static get PLUGIN_PRIORITY(){return sde}isEnabled(){return!!this.hot.getSettings()[G0]}enablePlugin(){var e=this;if(this.enabled)return;const{[G0]:r}=this.hot.getSettings();if(typeof r=="object"){var n,i;this.pasteMode=(n=r.pasteMode)!==null&&n!==void 0?n:this.pasteMode,this.rowsLimit=isNaN(r.rowsLimit)?this.rowsLimit:r.rowsLimit,this.columnsLimit=isNaN(r.columnsLimit)?this.columnsLimit:r.columnsLimit,cs(zS,this,!!r.copyColumnHeaders),cs(GS,this,!!r.copyColumnGroupHeaders),cs(jS,this,!!r.copyColumnHeadersOnly),this.uiContainer=(i=r.uiContainer)!==null&&i!==void 0?i:this.uiContainer}this.addHook("afterContextMenuDefaultOptions",s=>ti(ui,this,ude).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 ti(ui,e,hde).call(e,...o)}),this.addHook("afterSelectionEnd",()=>ti(ui,this,dde).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)}),iN()&&(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 ti(ui,e,fde).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 ti(ui,e,gde).call(e,...o)}),this.addHook("afterSelection",()=>ti(ui,this,mde).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";cs(pu,this,e),cs(j0,this,!0),ti(ui,this,GM).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(){cs(K0,this,!0),ti(ui,this,GM).call(this,"cut")}getRangedCopyableData(e){return tf(this.getRangedData(e))}getRangedData(e){const r=[],{rows:n,columns:i}=iH(e);return j(n,s=>{const o=[];j(i,a=>{s<0?o.push(this.hot.getColHeader(a,s)):o.push(this.hot.getCopyableData(s,a))}),r.push(o)}),r}paste(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;if(!e&&!r)return;const n=new Jhe;e&&n.clipboardData.setData("text/plain",e),r&&n.clipboardData.setData("text/html",r),this.onPaste(n)}setCopyableText(){const e=this.hot.getSelectedRangeLast();if(!e)return;if(e.isSingleHeader()){this.copyableRanges=[];return}Qn(wu,this).setSelectedRange(e);const r=new Map([["headers",null],["cells",null]]);Qn(pu,this)==="column-headers-only"?r.set("headers",Qn(wu,this).getMostBottomColumnHeadersRange()):(Qn(pu,this)==="with-column-headers"?r.set("headers",Qn(wu,this).getMostBottomColumnHeadersRange()):Qn(pu,this)==="with-column-group-headers"&&r.set("headers",Qn(wu,this).getAllColumnHeadersRange()),r.set("cells",Qn(wu,this).getCellsRange())),this.copyableRanges=Array.from(r.values()).filter(i=>i!==null).map(i=>{let{startRow:s,startCol:o,endRow:a,endCol:l}=i;return{startRow:s,startCol:o,endRow:a,endCol:l}}),this.copyableRanges=this.hot.runHooks("modifyCopyableRange",this.copyableRanges);const n=r.get("cells");if(n!==null&&n.isRangeTrimmed){const{startRow:i,startCol:s,endRow:o,endCol:a}=n;this.hot.runHooks("afterCopyLimit",o-i+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 r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.hot.getSelectedRangeLast();if(!e.length)return;const n=e.length,i=e[0].length,s=[],{row:o,col:a}=r.getTopStartCorner(),{row:l,col:c}=r.getBottomEndCorner();let u=o,h=a,d=o,f=a;for(;s.length<n||u<=l;){const{skipRowOnPaste:g,visualRow:m}=this.hot.getCellMeta(u,a);if(u=m+1,g===!0)continue;d=m,h=a;const p=[],S=s.length%n;for(;p.length<i||h<=c;){const{skipColumnOnPaste:y,visualCol:C}=this.hot.getCellMeta(o,h);if(h=C+1,y===!0)continue;f=C;const E=p.length%i;p.push(e[S][E])}s.push(p)}return cs(Pp,this,!0),this.hot.populateFromArray(o,a,s,void 0,void 0,"CopyPaste.paste",this.pasteMode),[o,a,d,f]}onCopy(e){if(!this.hot.isListening()&&!Qn(j0,this)||this.isEditorOpened()||!this.hot.getSettings().outsideClickDeselects&&e.target!==this.hot.rootDocument.body)return;this.setCopyableText(),cs(j0,this,!1);const r=this.getRangedData(this.copyableRanges),n=ti(ui,this,lde).call(this,this.copyableRanges);if(!!this.hot.runHooks("beforeCopy",r,this.copyableRanges,n)){const s=tf(r);if(e&&e.clipboardData){const o=fA(r,this.hot.rootDocument);e.clipboardData.setData("text/plain",s),e.clipboardData.setData("text/html",[zM,o].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",s);this.hot.runHooks("afterCopy",r,this.copyableRanges,n)}cs(pu,this,"cells-only"),e.preventDefault()}onCut(e){if(!this.hot.isListening()&&!Qn(K0,this)||this.isEditorOpened()||!this.hot.getSettings().outsideClickDeselects&&e.target!==this.hot.rootDocument.body)return;this.setCopyableText(),cs(K0,this,!1);const r=this.getRangedData(this.copyableRanges);if(!!this.hot.runHooks("beforeCut",r,this.copyableRanges)){const i=tf(r);if(e&&e.clipboardData){const s=fA(r,this.hot.rootDocument);e.clipboardData.setData("text/plain",i),e.clipboardData.setData("text/html",[zM,s].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",i);this.hot.emptySelectedCells("CopyPaste.cut"),this.hot.runHooks("afterCut",r,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 r;if(e&&typeof e.clipboardData<"u"){const a=by(e.clipboardData.getData("text/html"),{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0});a&&/(<table)|(<TABLE)/g.test(a)?r=ree(a,this.hot.rootDocument).data:r=e.clipboardData.getData("text/plain")}else typeof ClipboardEvent>"u"&&typeof this.hot.rootWindow.clipboardData<"u"&&(r=this.hot.rootWindow.clipboardData.getData("Text"));if(typeof r=="string"&&(r=mie(r)),r===void 0||r&&r.length===0||this.hot.runHooks("beforePaste",r,this.copyableRanges)===!1)return;const[n,i,s,o]=this.populateValues(r);this.hot.selectCell(n,i,Math.min(this.hot.countRows()-1,s),Math.min(this.hot.countCols()-1,o)),this.hot.runHooks("afterPaste",r,this.copyableRanges)}destroy(){super.destroy()}}function GM(t){if(iN()){const e=this.hot.getSelectedRangeLast();if(e){const{row:r,col:n}=e.highlight,i=this.hot.getCell(r,n,!0);i&&oJ(i,()=>{this.hot.rootDocument.execCommand(t)})}}else this.hot.rootDocument.execCommand(t)}function lde(t){const{rows:e}=iH(t);let r=0;for(let n=0;n<e.length&&!(e[n]>=0);n++)r+=1;return{columnHeadersCount:r}}function cde(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:r}=t.highlight,n=this.hot.getCell(e,r,!0);n&&Xk(n)}}}function oH(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:r}=t.highlight,n=this.hot.getCell(e,r,!0);n!=null&&n.hasAttribute("contenteditable")&&qk(n)}}}function ude(t){t.items.push({name:"---------"},Ghe(this)),Qn(zS,this)&&t.items.push(Xhe(this)),Qn(GS,this)&&t.items.push(Khe(this)),Qn(jS,this)&&t.items.push(jhe(this)),t.items.push(qhe(this))}function hde(t,e,r,n,i){Qn(Pp,this)&&(i.value=!0),cs(Pp,this,!1)}function dde(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function fde(){ti(ui,this,oH).call(this)}function gde(){ti(ui,this,cde).call(this)}function mde(){ti(ui,this,oH).call(this)}function aH(t,e){return`border_row${t}col${e}`}function Bd(){return{width:1,color:"#000"}}function Zo(){return{hide:!0}}function pde(){return{width:1,color:"#000",cornerVisible:!1}}function GC(t){if(Le(t.start)||Le(t.left)){var e;t.start=(e=t.start)!==null&&e!==void 0?e:t.left}if(Le(t.end)||Le(t.right)){var r;t.end=(r=t.end)!==null&&r!==void 0?r:t.right}return delete t.left,delete t.right,t}function dd(t){return Le(t.start)&&(t.left=t.start),Le(t.end)&&(t.right=t.end),t}function jC(t,e){return{id:aH(t,e),border:pde(),row:t,col:e,top:Zo(),bottom:Zo(),start:Zo(),end:Zo()}}function wde(t,e){return mr(e,"border")&&e.border&&(t.border=e.border),mr(e,"top")&&Le(e.top)&&(e.top?(at(e.top)||(e.top=Bd()),t.top=e.top):(e.top=Zo(),t.top=e.top)),mr(e,"bottom")&&Le(e.bottom)&&(e.bottom?(at(e.bottom)||(e.bottom=Bd()),t.bottom=e.bottom):(e.bottom=Zo(),t.bottom=e.bottom)),mr(e,"start")&&Le(e.start)&&(e.start?(at(e.start)||(e.start=Bd()),t.start=e.start):(e.start=Zo(),t.start=e.start)),mr(e,"end")&&Le(e.end)&&(e.end?(at(e.end)||(e.end=Bd()),t.end=e.end):(e.end=Zo(),t.end=e.end)),t}function aa(t,e){let r=!1;return j(t.getSelectedRange(),n=>{n.forAll((i,s)=>{if(i<0||s<0)return;const o=t.getCellMeta(i,s).borders;if(o)if(e){if(!mr(o[e],"hide")||o[e].hide===!1)return r=!0,!1}else return r=!0,!1})}),r}function qw(t){return`<span class="selected">✓</span>${t}`}function vde(t){return t.some(e=>Le(e.left)||Le(e.right))}function Cde(t){return t.some(e=>Le(e.start)||Le(e.end))}const Sde=new Map([["left","start"],["right","end"]]);function xde(t){var e;return(e=Sde.get(t))!==null&&e!==void 0?e:t}function yde(t){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(jb);return aa(this,"bottom")&&(e=qw(e)),e},callback(e,r){const n=aa(this,"bottom");t.prepareBorder(r,"bottom",n)}}}function bde(t){const e=t.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let r=this.getTranslatedPhrase(Kb);return aa(this,e)&&(r=qw(r)),r},callback(r,n){const i=aa(this,e);t.prepareBorder(n,e,i)}}}function Ede(t){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(Xb)},callback(e,r){t.prepareBorder(r,"noBorders")},disabled(){return!aa(this)}}}function Rde(t){const e=t.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let r=this.getTranslatedPhrase(Gb);return aa(this,e)&&(r=qw(r)),r},callback(r,n){const i=aa(this,e);t.prepareBorder(n,e,i)}}}function Tde(t){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(zb);return aa(this,"top")&&(e=qw(e)),e},callback(e,r){const n=aa(this,"top");t.prepareBorder(r,"top",n)}}}function _de(t,e){Ade(t,e),e.add(t)}function Ade(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Mde(t,e,r){return e=Ide(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ide(t){var e=Ode(t,"string");return typeof e=="symbol"?e:e+""}function Ode(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jM(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Wm="customBorders",Pde=90;var KC=new WeakSet;class Dde extends Pt{constructor(){super(...arguments),_de(this,KC),Mde(this,"savedBorders",[])}static get PLUGIN_KEY(){return Wm}static get PLUGIN_PRIORITY(){return Pde}isEnabled(){return!!this.hot.getSettings()[Wm]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>jM(KC,this,kde).call(this,e)),this.addHook("init",()=>jM(KC,this,Nde).call(this)),super.enablePlugin())}disablePlugin(){this.hideBorders(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.changeBorderSettings(),super.updatePlugin()}setBorders(e,r){let n=["top","bottom","start","end"],i=null;r&&(this.checkSettingsCohesion([r]),n=Object.keys(r),i=GC(r));const s=ah(e),o=$f(s,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});j(e,a=>{o(a).forAll((l,c)=>{j(n,u=>{this.prepareBorderFromCustomAdded(l,c,i,xde(u))})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const r=ah(e),n=$f(r,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),i=[];return j(e,s=>{n(s).forAll((o,a)=>{j(this.savedBorders,l=>{l.row===o&&l.col===a&&i.push(dd(l))})})}),i}clearBorders(e){e?this.setBorders(e):(j(this.savedBorders,r=>{this.clearBordersFromSelectionSettings(r.id),this.clearNullCellRange(),this.hot.removeCellMeta(r.row,r.col,"borders")}),this.savedBorders.length=0)}insertBorderIntoSettings(e,r){this.checkSavedBorders(e)||this.savedBorders.push(e);const i=this.hot._createCellRange(this.hot._createCellCoords(e.row,e.col));this.checkCustomSelections(e,i,r)||this.hot.selection.highlight.addCustomSelection({border:e,visualCellRange:i})}prepareBorderFromCustomAdded(e,r,n,i){const s=this.hot.countRows(),o=this.hot.countCols();if(e>=s||r>=o)return;let a=jC(e,r);n&&(a=wde(a,n),j(this.hot.selection.highlight.customSelections,l=>{if(a.id===l.settings.id)return Object.assign(l.settings,n),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,r,"borders",dd(a)),this.insertBorderIntoSettings(a,i)}prepareBorderFromCustomAddedRange(e,r){const n=Math.min(e.to.row,this.hot.countRows()-1),i=Math.min(e.to.col,this.hot.countCols()-1);Ue(e.from.row,n,s=>{Ue(e.from.col,i,o=>{const a=jC(s,o);let l=0;s===e.from.row&&mr(r,"top")&&(l+=1,a.top=r.top),s===e.to.row&&mr(r,"bottom")&&(l+=1,a.bottom=r.bottom),o===e.from.col&&mr(r,"start")&&(l+=1,a.start=r.start),o===e.to.col&&mr(r,"end")&&(l+=1,a.end=r.end),l>0&&(this.hot.setCellMeta(s,o,"borders",dd(a)),this.insertBorderIntoSettings(a))})})}removeAllBorders(e,r){const n=aH(e,r);this.spliceBorder(n),this.clearBordersFromSelectionSettings(n),this.clearNullCellRange(),this.hot.removeCellMeta(e,r,"borders")}setBorder(e,r,n,i){let s=this.hot.getCellMeta(e,r).borders;!s||s.border===void 0?s=jC(e,r):s=GC(s),i?(s[n]=Zo(),this.countHide(s)===4?this.removeAllBorders(e,r):(this.checkCustomSelectionsFromContextMenu(s,n,i)||this.insertBorderIntoSettings(s),this.hot.setCellMeta(e,r,"borders",dd(s)))):(s[n]=Bd(),this.checkCustomSelectionsFromContextMenu(s,n,i)||this.insertBorderIntoSettings(s),this.hot.setCellMeta(e,r,"borders",dd(s)))}prepareBorder(e,r,n){j(e,i=>{let{start:s,end:o}=i;if(s.row===o.row&&s.col===o.col)r==="noBorders"?this.removeAllBorders(s.row,s.col):this.setBorder(s.row,s.col,r,n);else switch(r){case"noBorders":Ue(s.col,o.col,a=>{Ue(s.row,o.row,l=>{this.removeAllBorders(l,a)})});break;case"top":Ue(s.col,o.col,a=>{this.setBorder(s.row,a,r,n)});break;case"bottom":Ue(s.col,o.col,a=>{this.setBorder(o.row,a,r,n)});break;case"start":Ue(s.row,o.row,a=>{this.setBorder(a,s.col,r,n)});break;case"end":Ue(s.row,o.row,a=>{this.setBorder(a,o.col,r,n)});break}})}createCustomBorders(e){j(e,r=>{const n=GC(r);r.range?this.prepareBorderFromCustomAddedRange(r.range,n):this.prepareBorderFromCustomAdded(r.row,r.col,n)})}countHide(e){const{top:r,bottom:n,start:i,end:s}=e;return Rn([r,n,i,s],(a,l)=>{let c=a;return l&&l.hide&&(c+=1),c},0)}clearBordersFromSelectionSettings(e){const r=wt(this.hot.selection.highlight.customSelections,n=>n.settings.id).indexOf(e);r>-1&&this.hot.selection.highlight.customSelections[r].clear()}clearNullCellRange(){j(this.hot.selection.highlight.customSelections,(e,r)=>{if(e.cellRange===null)return this.hot.selection.highlight.customSelections[r].destroy(),this.hot.selection.highlight.customSelections.splice(r,1),!1})}hideBorders(){j(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()})}spliceBorder(e){const r=wt(this.savedBorders,n=>n.id).indexOf(e);r>-1&&this.savedBorders.splice(r,1)}checkSavedBorders(e){let r=!1;return this.countHide(e)===4?(this.spliceBorder(e.id),r=!0):j(this.savedBorders,(i,s)=>{if(e.id===i.id)return this.savedBorders[s]=e,r=!0,!1}),r}checkCustomSelectionsFromContextMenu(e,r,n){let i=!1;return j(this.hot.selection.highlight.customSelections,s=>{if(e.id===s.settings.id){const o=this.hot.view._wt.selectionManager.getBorderInstances(s);return j(o,a=>{a.toggleHiddenClass(r,n)}),i=!0,!1}}),i}checkCustomSelections(e,r,n){const i=this.countHide(e);let s=!1;return i===4?(this.removeAllBorders(e.row,e.col),s=!0):j(this.hot.selection.highlight.customSelections,o=>{if(e.id===o.settings.id){if(o.visualCellRange=r,o.commit(),n){const a=this.hot.view._wt.selectionManager.getBorderInstances(o);j(a,l=>{l.changeBorderStyle(n,e)})}return s=!0,!1}}),s}changeBorderSettings(){const e=this.hot.getSettings()[Wm];if(Array.isArray(e)){const r=Vn(e);this.checkSettingsCohesion(r),r.length||(this.savedBorders=r),this.createCustomBorders(r)}else e!==void 0&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const r=vde(e),n=Cde(e);if(r&&n)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()&&r)throw new Error('The "left"/"right" properties are not supported for RTL. Please use option "start"/"end".')}destroy(){super.destroy()}}function kde(t){this.hot.getSettings()[Wm]&&t.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(Yb)},disabled(){const e=this.getSelectedRangeLast();return!e||e.isSingleHeader()?!0:this.selection.isSelectedByCorner()},submenu:{items:[Tde(this),Rde(this),yde(this),bde(this),Ede(this)]}})}function Nde(){this.changeBorderSettings()}function Hde(t,e){Fde(t,e),e.add(t)}function Fde(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function XC(t,e,r){return e=Lde(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lde(t){var e=$de(t,"string");return typeof e=="symbol"?e:e+""}function $de(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function KM(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const XM="dragToScroll",Bde=100;var qC=new WeakSet;class Vde extends Pt{constructor(){super(...arguments),Hde(this,qC),XC(this,"boundaries",null),XC(this,"callback",null),XC(this,"listening",!1)}static get PLUGIN_KEY(){return XM}static get PLUGIN_PRIORITY(){return Bde}isEnabled(){return!!this.hot.getSettings()[XM]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>KM(qC,this,qM).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>KM(qC,this,qM).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,r){let n=0,i=0;r<this.boundaries.top?i=r-this.boundaries.top:r>this.boundaries.bottom&&(i=r-this.boundaries.bottom),e<this.boundaries.left?n=e-this.boundaries.left:e>this.boundaries.right&&(n=e-this.boundaries.right),this.callback(n,i)}listen(){this.listening=!0}unlisten(){this.listening=!1}isListening(){return this.listening}registerEvents(){const{rootWindow:e}=this.hot;let r=e;for(;r;)this.eventManager.addEventListener(r.document,"contextmenu",()=>this.unlisten()),this.eventManager.addEventListener(r.document,"mouseup",()=>this.unlisten()),this.eventManager.addEventListener(r.document,"mousemove",n=>this.onMouseMove(n)),r=sh(r)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function qM(t){if(bc(t))return;const e=this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;this.setBoundaries(e!==this.hot.rootWindow?e.getBoundingClientRect():void 0),this.setCallback((r,n)=>{var i,s;const o=(i=e.scrollLeft)!==null&&i!==void 0?i:e.scrollX,a=(s=e.scrollTop)!==null&&s!==void 0?s:e.scrollY;e.scroll(o+Math.sign(r)*50,a+Math.sign(n)*20)}),this.listen()}function Wde(t,e){lH(t,e),e.add(t)}function Ude(t,e,r){lH(t,e),e.set(t,r)}function lH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ZC(t,e,r){return e=Yde(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yde(t){var e=zde(t,"string");return typeof e=="symbol"?e:e+""}function zde(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Gde(t,e){return t.get(Hi(t,e))}function cH(t,e,r){return t.set(Hi(t,e),r),r}function Hi(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}He.getSingleton().register("afterDropdownMenuDefaultOptions");He.getSingleton().register("beforeDropdownMenuShow");He.getSingleton().register("afterDropdownMenuShow");He.getSingleton().register("afterDropdownMenuHide");He.getSingleton().register("afterDropdownMenuExecute");const Um="dropdownMenu",jde=230,Dp="changeType",JC=Um;var Zw=new WeakMap,hs=new WeakSet;class Jw extends Pt{static get PLUGIN_KEY(){return Um}static get PLUGIN_PRIORITY(){return jde}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[xg,yg,ht,Eg,ht,Ww,ht,bg,ht,Ni]}constructor(e){super(e),Wde(this,hs),ZC(this,"commandExecutor",new q2(this.hot)),ZC(this,"itemsFactory",null),ZC(this,"menu",null),Ude(this,Zw,!1),this.hot.addHook("afterGetColHeader",(r,n)=>Hi(hs,this,Xde).call(this,r,n))}isEnabled(){return this.hot.getSettings()[Um]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new Z2(this.hot,Jw.DEFAULT_ITEMS),this.addHook("beforeOnCellMouseDown",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return Hi(hs,e,tfe).call(e,...s)}),this.addHook("beforeViewportScrollHorizontally",function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return Hi(hs,e,efe).call(e,...s)});const r=this.hot.getSettings()[Um],n={items:this.itemsFactory.getItems(r)};this.registerEvents(),typeof r.callback=="function"&&this.commandExecutor.setCommonCallback(r.callback),this.registerShortcuts(),super.enablePlugin(),this.callOnPluginsReady(()=>{this.hot.runHooks("afterDropdownMenuDefaultOptions",n),this.itemsFactory.setPredefinedItems(n.items);const i=this.itemsFactory.getItems(r);this.menu&&this.menu.destroy(),this.menu=new bh(this.hot,{className:"htDropdownMenu",keepInViewport:!0,container:r.uiContainer||this.hot.rootDocument.body}),this.hot.runHooks("beforeDropdownMenuSetItems",i),this.menu.setMenuItems(i),this.menu.addLocalHook("beforeOpen",()=>Hi(hs,this,qde).call(this)),this.menu.addLocalHook("afterOpen",()=>Hi(hs,this,Zde).call(this)),this.menu.addLocalHook("afterSubmenuOpen",s=>Hi(hs,this,Jde).call(this,s)),this.menu.addLocalHook("afterClose",()=>Hi(hs,this,Qde).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)}),j(i,s=>this.commandExecutor.registerCommand(s.key,s))})}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&this.menu.destroy(),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager().getContext("grid"),r=()=>{const{highlight:n}=this.hot.getSelectedRangeLast();if((n.isHeader()&&n.row===-1||n.isCell())&&n.col>=0){this.hot.selectColumns(n.col,n.col,-1);const{from:i}=this.hot.getSelectedRangeLast(),s=Vw(this.menu.container,this.hot.rootDocument),o=this.hot.getCell(-1,i.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:r,runOnlyIf:()=>{var n;const i=(n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isHeader()&&!this.menu.isOpened()},captureCtrl:!0,group:JC},{keys:[["Shift","Alt","ArrowDown"]],callback:r,runOnlyIf:()=>{var n;const i=(n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isCell()&&!this.menu.isOpened()},group:JC}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(JC)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>Hi(hs,this,Kde).call(this,e))}open(e){var r;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};(r=this.menu)!==null&&r!==void 0&&r.isOpened()||(this.menu.open(),dt(n,(i,s)=>{this.menu.setOffset(s,i)}),this.menu.setPosition(e))}close(){var e;(e=this.menu)===null||e===void 0||e.close()}executeCommand(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.commandExecutor.execute(e,...n)}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 uH(t){t.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function Kde(t){if(Ze(t.target,Dp)){const e=Vw(this.menu.container,this.hot.rootDocument),r=t.target.getBoundingClientRect();t.stopPropagation(),cH(Zw,this,!1),this.open({left:r.left+e.left,top:r.top+t.target.offsetHeight+3+e.top},{left:r.width})}}function Xde(t,e){const r=e.parentNode;if(!r)return;const n=r.parentNode.childNodes,i=Array.prototype.indexOf.call(n,r);if(t<0||i!==n.length-1)return;const s=e.querySelector(`.${Dp}`);if(this.enabled&&s)return;if(!this.enabled){s&&s.parentNode.removeChild(s);return}const o=this.hot.rootDocument.createElement("button");o.className=Dp,o.type="button",o.tabIndex=-1,this.hot.getSettings().ariaTags&&(Xe(o,[fa(),Ey(" ")]),Xe(e,[Fk("menu")])),o.onclick=function(){return!1},e.firstChild.insertBefore(o,e.firstChild.firstChild)}function qde(){this.hot.runHooks("beforeDropdownMenuShow",this)}function Zde(){this.hot.runHooks("afterDropdownMenuShow",this),Hi(hs,this,uH).call(this,this.menu)}function Jde(t){Hi(hs,this,uH).call(this,t)}function Qde(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function efe(t){return Gde(Zw,this)?null:t}function tfe(t){Ze(t.target,Dp)&&cH(Zw,this,!0)}Jw.SEPARATOR={name:ht};function ZM(t,e,r){return e=rfe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rfe(t){var e=nfe(t,"string");return typeof e=="symbol"?e:e+""}function nfe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ife{constructor(e){ZM(this,"hot",void 0),ZM(this,"options",{}),this.hot=e}setOptions(e){this.options=e}getData(){const{startRow:e,startCol:r,endRow:n,endCol:i}=this._getDataRange(),s=this.options,o=[];return Ue(e,n,a=>{const l=[];!s.exportHiddenRows&&this._isHiddenRow(a)||(Ue(r,i,c=>{!s.exportHiddenColumns&&this._isHiddenColumn(c)||l.push(this.hot.getDataAtCell(a,c))}),o.push(l))}),o}getRowHeaders(){const e=[];if(this.options.rowHeaders){const{startRow:r,endRow:n}=this._getDataRange(),i=this.hot.getRowHeader();Ue(r,n,s=>{!this.options.exportHiddenRows&&this._isHiddenRow(s)||e.push(i[s])})}return e}getColumnHeaders(){const e=[];if(this.options.columnHeaders){const{startCol:r,endCol:n}=this._getDataRange(),i=this.hot.getColHeader();Ue(r,n,s=>{!this.options.exportHiddenColumns&&this._isHiddenColumn(s)||e.push(i[s])})}return e}_getDataRange(){const e=this.hot.countCols()-1,r=this.hot.countRows()-1;let[n=0,i=0,s=r,o=e]=this.options.range;return n=Math.max(n,0),i=Math.max(i,0),s=Math.min(s,r),o=Math.min(o,e),{startRow:n,startCol:i,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 JM(t,e,r){return e=sfe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sfe(t){var e=ofe(t,"string");return typeof e=="symbol"?e:e+""}function ofe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class tR{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,r){JM(this,"dataProvider",void 0),JM(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(r),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let r=_s(this.constructor.DEFAULT_OPTIONS);const n=new Date;return r=kr(_s(tR.DEFAULT_OPTIONS),r),r=kr(r,e),r.filename=kk(r.filename,{YYYY:n.getFullYear(),MM:`${n.getMonth()+1}`.padStart(2,"0"),DD:`${n.getDate()}`.padStart(2,"0")}),r}}const afe="\r",lfe='"',cfe=`
  115. `;class ufe extends tR{static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:`\r
  116. `}}export(){const e=this.options,r=this.dataProvider.getData();let n=this.dataProvider.getColumnHeaders();const i=n.length>0,s=this.dataProvider.getRowHeaders(),o=s.length>0;let a=e.bom?"\uFEFF":"";return i&&(n=wt(n,l=>this._escapeCell(l,!0)),o&&(a+=e.columnDelimiter),a+=n.join(e.columnDelimiter),a+=e.rowDelimiter),j(r,(l,c)=>{c>0&&(a+=e.rowDelimiter),o&&(a+=this._escapeCell(s[c])+e.columnDelimiter),a+=l.map(u=>this._escapeCell(u)).join(e.columnDelimiter)}),a}_escapeCell(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=Ar(e);return n!==""&&(r||n.indexOf(afe)>=0||n.indexOf(lfe)>=0||n.indexOf(cfe)>=0||n.indexOf(this.options.columnDelimiter)>=0)&&(n=n.replace(new RegExp('"',"g"),'""'),n=`"${n}"`),n}}const hfe="csv",KS={[hfe]:ufe};function dfe(t,e,r){return typeof KS[t]=="function"?new KS[t](e,r):null}const ffe="exportFile",gfe=240;class mfe extends Pt{static get PLUGIN_KEY(){return ffe}static get PLUGIN_PRIORITY(){return gfe}isEnabled(){return!0}exportAsString(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createTypeFormatter(e,r).export()}exportAsBlob(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createBlob(this._createTypeFormatter(e,r))}downloadFile(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{rootDocument:n,rootWindow:i}=this.hot,s=this._createTypeFormatter(e,r),o=this._createBlob(s),a=i.URL||i.webkitURL,l=n.createElement("a"),c=`${s.options.filename}.${s.options.fileExtension}`;if(l.download!==void 0){const u=a.createObjectURL(o);l.style.display="none",l.setAttribute("href",u),l.setAttribute("download",c),n.body.appendChild(l),l.dispatchEvent(new MouseEvent("click")),n.body.removeChild(l),setTimeout(()=>{a.revokeObjectURL(u)},100)}else navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob(o,c)}_createTypeFormatter(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!KS[e])throw new Error(`Export format type "${e}" is not supported.`);return dfe(e,new ife(this.hot),r)}_createBlob(e){let r=null;return typeof Blob<"u"&&(r=new Blob([e.export()],{type:`${e.options.mimeType};charset=${e.options.encoding}`})),r}}function vu(t,e,r){return e=pfe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pfe(t){var e=wfe(t,"string");return typeof e=="symbol"?e:e+""}function wfe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Rg{constructor(e,r){let{id:n,stateless:i=!0}=r;vu(this,"hot",void 0),vu(this,"id",void 0),vu(this,"elements",[]),vu(this,"hidden",!1),vu(this,"stateId",""),vu(this,"state",void 0),this.hot=e,this.id=n,this.stateId=`Filters.component.${this.id}`,this.state=i?null:this.hot.columnIndexMapper.registerMap(this.stateId,new Dw)}getElements(){return this.elements}reset(){j(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(),j(this.elements,e=>e.destroy()),this.state=null,this.elements=null,this.hot=null}}zt(Rg,Wn);const Vf={};function dl(t,e){if(!Vf[t])throw Error(`Filter condition "${t}" does not exist.`);const{condition:r,descriptor:n}=Vf[t];let i=e;return n.inputValuesDecorator&&(i=n.inputValuesDecorator(i)),function(s){return r.apply(s.meta.instance,[].concat([s],[i]))}}function cc(t){if(!Vf[t])throw Error(`Filter condition "${t}" does not exist.`);return Vf[t].descriptor}function Mr(t,e,r){r.key=t,Vf[t]={condition:e,descriptor:r}}const qr="none";function vfe(){return!0}Mr(qr,vfe,{name:kw,inputsCount:0,showOperators:!1});const af="empty";function Cfe(t){return yr(t.value)}Mr(af,Cfe,{name:rE,inputsCount:0,showOperators:!0});const Ym="not_empty";function Sfe(t,e){return!dl(af,e)(t)}Mr(Ym,Sfe,{name:nE,inputsCount:0,showOperators:!0});const lf="eq";function xfe(t,e){let[r]=e;return Ar(t.value).toLocaleLowerCase(t.meta.locale)===Ar(r)}Mr(lf,xfe,{name:iE,inputsCount:1,showOperators:!0});const zm="neq";function yfe(t,e){return!dl(lf,e)(t)}Mr(zm,yfe,{name:sE,inputsCount:1,showOperators:!0});const hH="gt";function bfe(t,e){let[r]=e,n=r;return t.meta.type==="numeric"&&(n=parseFloat(n,10)),t.value>n}Mr(hH,bfe,{name:uE,inputsCount:1,showOperators:!0});const dH="gte";function Efe(t,e){let[r]=e,n=r;return t.meta.type==="numeric"&&(n=parseFloat(n,10)),t.value>=n}Mr(dH,Efe,{name:hE,inputsCount:1,showOperators:!0});const fH="lt";function Rfe(t,e){let[r]=e,n=r;return t.meta.type==="numeric"&&(n=parseFloat(n,10)),t.value<n}Mr(fH,Rfe,{name:dE,inputsCount:1,showOperators:!0});const gH="lte";function Tfe(t,e){let[r]=e,n=r;return t.meta.type==="numeric"&&(n=parseFloat(n,10)),t.value<=n}Mr(gH,Tfe,{name:fE,inputsCount:1,showOperators:!0});const rR="date_after";function _fe(t,e){let[r]=e;const n=be(t.value,t.meta.dateFormat),i=be(r,t.meta.dateFormat);return!n.isValid()||!i.isValid()?!1:n.diff(i)>=0}Mr(rR,_fe,{name:pE,inputsCount:1,showOperators:!0});const nR="date_before";function Afe(t,e){let[r]=e;const n=be(t.value,t.meta.dateFormat),i=be(r,t.meta.dateFormat);return!n.isValid()||!i.isValid()?!1:n.diff(i)<=0}Mr(nR,Afe,{name:wE,inputsCount:1,showOperators:!0});const kp="between";function Mfe(t,e){let[r,n]=e,i=r,s=n;if(t.meta.type==="numeric"){const o=parseFloat(i,10),a=parseFloat(s,10);i=Math.min(o,a),s=Math.max(o,a)}else if(t.meta.type==="date"){const o=dl(nR,[s]),a=dl(rR,[i]);return o(t)&&a(t)}return t.value>=i&&t.value<=s}Mr(kp,Mfe,{name:gE,inputsCount:2,showOperators:!0});const mH="not_between";function Ife(t,e){return!dl(kp,e)(t)}Mr(mH,Ife,{name:mE,inputsCount:2,showOperators:!0});const pH="begins_with";function Ofe(t,e){let[r]=e;return Ar(t.value).toLocaleLowerCase(t.meta.locale).startsWith(Ar(r))}Mr(pH,Ofe,{name:oE,inputsCount:1,showOperators:!0});const wH="ends_with";function Pfe(t,e){let[r]=e;return Ar(t.value).toLocaleLowerCase(t.meta.locale).endsWith(Ar(r))}Mr(wH,Pfe,{name:aE,inputsCount:1,showOperators:!0});const iR="contains";function Dfe(t,e){let[r]=e;return Ar(t.value).toLocaleLowerCase(t.meta.locale).indexOf(Ar(r))>=0}Mr(iR,Dfe,{name:lE,inputsCount:1,showOperators:!0});const vH="not_contains";function kfe(t,e){return!dl(iR,e)(t)}Mr(vH,kfe,{name:cE,inputsCount:1,showOperators:!0});const CH="date_tomorrow";function Nfe(t){const e=be(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(be().subtract(-1,"days").startOf("day"),"d"):!1}Mr(CH,Nfe,{name:CE,inputsCount:0});const SH="date_today";function Hfe(t){const e=be(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(be().startOf("day"),"d"):!1}Mr(SH,Hfe,{name:vE,inputsCount:0});const xH="date_yesterday";function Ffe(t){const e=be(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(be().subtract(1,"days").startOf("day"),"d"):!1}Mr(xH,Ffe,{name:SE,inputsCount:0});RJ();function Lfe(t,e){let r=t;return r===""&&(r=`(${e})`),r}const XS=new Set([1]).has(1),$fe=XS&&typeof Array.from=="function";function Tg(t){let e=t;return XS&&(e=new Set(e)),function(r){let n;return XS?n=e.has(r):n=!!~e.indexOf(r),n}}function yH(t){return t??""}function qS(t){let e=t;return $fe?e=Array.from(new Set(e)):e=Ok(e),e=e.sort((r,n)=>typeof r=="number"&&typeof n=="number"?r-n:r===n?0:r>n?1:-1),e}function QM(t,e,r,n){const i=[],s=t===e;let o;return s||(o=Tg(e)),j(t,a=>{let l=!1;(s||o(a))&&(l=!0);const c={checked:l,value:a,visualValue:Lfe(a,r)};n&&n(c),i.push(c)}),i}const uc="by_value";function Bfe(t,e){let[r]=e;return r(t.value)}Mr(uc,Bfe,{name:"By value",inputsCount:0,inputValuesDecorator(t){let[e]=t;return[Tg(e)]},showOperators:!1});const Wf={};function Vfe(t){if(!Wf[t])throw Error(`Operation with id "${t}" does not exist.`);const e=Wf[t].func;return function(r,n){return e(r,n)}}function Wfe(t){return Wf[t].name}function sR(t,e,r){Wf[t]={name:e,func:r}}const al="conjunction",Ufe=bE;function Yfe(t,e){return t.every(r=>r.func(e))}sR(al,Ufe,Yfe);const Np="disjunction",zfe=Nw;function Gfe(t,e){return t.some(r=>r.func(e))}sR(Np,zfe,Gfe);const oR="disjunctionWithExtraCondition",jfe=Nw;function Kfe(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(r=>r.func(e))&&t[t.length-1].func(e)}sR(oR,jfe,Kfe);const Xfe="numeric",bH="text",qfe="date",eI={[Xfe]:[qr,ht,af,Ym,ht,lf,zm,ht,hH,dH,fH,gH,kp,mH],[bH]:[qr,ht,af,Ym,ht,lf,zm,ht,pH,wH,ht,iR,vH],[qfe]:[qr,ht,af,Ym,ht,lf,zm,ht,nR,rR,kp,ht,CH,SH,xH]};function Zfe(t){const e=[];let r=t;return eI[r]||(r=bH),j(eI[r],n=>{let i;n===ht?i={name:ht}:i=_s(cc(n)),e.push(i)}),e}function fd(t,e,r){return e=Jfe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jfe(t){var e=Qfe(t,"string");return typeof e=="symbol"?e:e+""}function Qfe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const QC="built",e1="building",tI=["click","input","keydown","keypress","keyup","focus","blur","change"];let ys=class EH{static get DEFAULTS(){return _s({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,r){fd(this,"hot",void 0),fd(this,"eventManager",new As(this)),fd(this,"options",void 0),fd(this,"_element",void 0),fd(this,"buildState",void 0),this.hot=e,this.options=kr(EH.DEFAULTS,r),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===e1?this._element:this.buildState===QC?(this.update(),this._element):(this.buildState=e1,this.build(),this.buildState=QC,this._element)}isBuilt(){return this.buildState===QC}translateIfPossible(e){return typeof e=="string"&&e.startsWith(Un)?this.hot.getTranslatedPhrase(e):e}build(){const e=(r,n)=>{this.eventManager.addEventListener(r,n,i=>this.runLocalHooks(n,i,this))};if(this.buildState||(this.buildState=e1),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&&Re(this._element,this.options.className),this.options.children.length)j(this.options.children,r=>this._element.appendChild(r.element));else if(this.options.wrapIt){const r=this.hot.rootDocument.createElement(this.options.tagName);r.setAttribute("data-hot-input",!0),dt(this.options,(n,i)=>{r[i]!==void 0&&i!=="className"&&i!=="tagName"&&i!=="children"&&(r[i]=this.translateIfPossible(n))}),this._element.appendChild(r),j(tI,n=>e(r,n))}else j(tI,r=>e(this._element,r))}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}};zt(ys,Wn);function ege(t,e){RH(t,e),e.add(t)}function tge(t,e,r){RH(t,e),e.set(t,r)}function RH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function X0(t,e){return t.get(aR(t,e))}function rge(t,e,r){return t.set(aR(t,e),r),r}function aR(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Cu=new WeakMap,rI=new WeakSet;class ll extends ys{static get DEFAULTS(){return _s({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,r){super(e,kr(ll.DEFAULTS,r)),ege(this,rI),tge(this,Cu,void 0),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",e=>aR(rI,this,nge).call(this,e))}build(){super.build();const e=this.hot.rootDocument.createElement("div");rge(Cu,this,this._element.firstChild),Re(this._element,"htUIInput"),Re(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(X0(Cu,this).type=this.options.type,X0(Cu,this).placeholder=this.translateIfPossible(this.options.placeholder),X0(Cu,this).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&X0(Cu,this).focus()}}function nge(t){this.options.value=t.target.value}function ige(t,e){TH(t,e),e.add(t)}function gd(t,e,r){TH(t,e),e.set(t,r)}function TH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Su(t,e,r){return t.set(cf(t,e),r),r}function cr(t,e){return t.get(cf(t,e))}function cf(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Hr=new WeakMap,q0=new WeakMap,Z0=new WeakMap,t1=new WeakMap,J0=new WeakMap,Q0=new WeakSet;class Uf extends ys{static get DEFAULTS(){return _s({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,r){super(e,kr(Uf.DEFAULTS,r)),ige(this,Q0),gd(this,Hr,null),gd(this,q0,[]),gd(this,Z0,void 0),gd(this,t1,void 0),gd(this,J0,void 0),this.registerHooks()}getMenu(){return cr(Hr,this)}registerHooks(){this.addLocalHook("click",()=>cf(Q0,this,age).call(this))}setItems(e){Su(q0,this,this.translateNames(e)),cr(Hr,this)&&cr(Hr,this).setMenuItems(cr(q0,this))}translateNames(e){return j(e,r=>{r.name=this.translateIfPossible(r.name)}),e}build(){super.build(),Su(Hr,this,new bh(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),cr(Hr,this).setMenuItems(cr(q0,this));const e=new ys(this.hot,{className:"htUISelectCaption"}),r=new ys(this.hot,{className:"htUISelectDropdown"});Su(Z0,this,e),Su(t1,this,e.element),Su(J0,this,r),this.hot.getSettings().ariaTags&&(Xe(r.element,[fa()]),Xe(this._element,[Hk()])),j([e,r],n=>this._element.appendChild(n.element)),cr(Hr,this).addLocalHook("select",n=>cf(Q0,this,sge).call(this,n)),cr(Hr,this).addLocalHook("afterClose",()=>cf(Q0,this,oge).call(this)),this.update()}update(){if(!this.isBuilt())return;let e;this.options.value?e=this.options.value.name:e=cr(Hr,this).hot.getTranslatedPhrase(kw),cr(t1,this).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();cr(Hr,this)&&(cr(Hr,this).open(),cr(Hr,this).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),cr(Hr,this).getNavigator().toFirstItem(),cr(Hr,this).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:r=>{this.closeOptions(),this.runLocalHooks("tabKeydown",r)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){cr(Hr,this)&&cr(Hr,this).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){cr(Hr,this)&&(cr(Hr,this).destroy(),Su(Hr,this,null)),cr(Z0,this)&&cr(Z0,this).destroy(),cr(J0,this)&&cr(J0,this).destroy(),super.destroy()}}function sge(t){t.name!==ht&&(this.options.value=t,this.update(),this.runLocalHooks("select",this.options.value))}function oge(){this.runLocalHooks("afterClose")}function age(){this.openOptions()}function lge(t,e){cge(t,e),e.add(t)}function cge(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nI(t,e,r){return e=uge(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uge(t){var e=hge(t,"string");return typeof e=="symbol"?e:e+""}function hge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function iI(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var r1=new WeakSet;class ZS extends Rg{constructor(e,r){super(e,{id:r.id,stateless:!1}),lge(this,r1),nI(this,"name",""),nI(this,"addSeparator",!1),this.name=r.name,this.addSeparator=r.addSeparator,this.elements.push(new Uf(this.hot,{menuContainer:r.menuContainer})),this.elements.push(new ll(this.hot,{placeholder:ME})),this.elements.push(new ll(this.hot,{placeholder:IE})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",e=>iI(r1,this,dge).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),j(this.getInputElements(),e=>{e.addLocalHook("keydown",r=>iI(r1,this,fge).call(this,r))})}setState(e){if(this.reset(),!e)return;const r=_s(e.command);r.name.startsWith(wr)&&(r.name=this.hot.getTranslatedPhrase(r.name)),this.getSelectElement().setValue(r),j(e.args,(n,i)=>{if(i>r.inputsCount-1)return!1;const s=this.getInputElement(i);s.setValue(n),s[r.inputsCount>i?"show":"hide"](),i||this.hot._registerTimeout(()=>s.focus(),10)})}getState(){const e=this.getSelectElement().getValue()||cc(qr),r=[];return j(this.getInputElements(),(n,i)=>{e.inputsCount>i&&r.push(n.getValue())}),{command:e,args:r}}updateState(e,r){const n=cc(e?e.name:qr);this.state.setValueAtIndex(r,{command:n,args:e?e.args:[]}),e||j(this.getInputElements(),i=>i.setValue(null))}getSelectElement(){return this.elements.filter(e=>e instanceof Uf)[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 ll)}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,r,n,i,s,o)=>{Re(r.parentNode,"htFiltersMenuCondition"),this.addSeparator&&Re(r.parentNode,"border");const a=this.hot.rootDocument.createElement("div");return Re(a,"htFiltersMenuLabel"),a.textContent=o,r.appendChild(a),j(this.elements,l=>r.appendChild(l.element)),r}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let r=[cc(qr)];if(e!==null){const{visualIndex:n}=e;r=Zfe(this.hot.getDataType(0,n,this.hot.countRows(),n))}j(this.getInputElements(),n=>n.hide()),this.getSelectElement().setItems(r),super.reset(),this.getSelectElement().setValue(r[0])}}function dge(t){j(this.getInputElements(),(e,r)=>{e[t.inputsCount>r?"show":"hide"](),r===0&&this.hot._registerTimeout(()=>e.focus(),10)}),this.runLocalHooks("change",t)}function fge(t){fg(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),Ps(t))}function sI(t,e,r){gge(t,e),e.set(t,r)}function gge(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function md(t,e){return t.get(_H(t,e))}function oI(t,e,r){return t.set(_H(t,e),r),r}function _H(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var xu=new WeakMap,n1=new WeakMap;class Hp extends ys{static get DEFAULTS(){return _s({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,r){super(e,kr(Hp.DEFAULTS,r)),sI(this,xu,void 0),sI(this,n1,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),oI(n1,this,e),oI(xu,this,this._element.firstChild),md(xu,this).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(md(n1,this).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return this.isBuilt()?md(xu,this).checked:!1}setChecked(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isBuilt()&&(md(xu,this).checked=e)}focus(){this.isBuilt()&&md(xu,this).focus()}}function mge(t,e){pge(t,e),e.add(t)}function pge(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wge(t,e,r){return e=vge(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vge(t){var e=Cge(t,"string");return typeof e=="symbol"?e:e+""}function Cge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Sge(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const aI=0;var lI=new WeakSet;class xge extends Rg{constructor(e,r){super(e,{id:r.id,stateless:!1}),mge(this,lI),wge(this,"name",""),this.name=r.name,this.buildOperatorsElement()}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,r)=>(Re(r.parentNode,"htFiltersMenuOperators"),j(this.elements,n=>r.appendChild(n.element)),r)}}buildOperatorsElement(){const e=[al,Np];j(e,r=>{const n=new Hp(this.hot,{name:"operator",label:{htmlFor:r,textContent:Wfe(r)},value:r,checked:r===e[aI],id:r});n.addLocalHook("change",i=>Sge(lI,this,yge).call(this,i)),this.elements.push(n)})}setChecked(e){if(this.elements.length<e)throw Error(Dt`Radio button with index ${e} doesn't exist.`);j(this.elements,(r,n)=>{r.setChecked(n===e)})}getActiveOperationId(){const e=this.elements.find(r=>r instanceof Hp&&r.isChecked());return e?e.getValue():al}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&j(this.elements,r=>{r.setChecked(r.getValue()===e)})}updateState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:al,r=arguments.length>1?arguments[1]:void 0,n=e;n===oR&&(n=Np),this.state.setValueAtIndex(r,n)}reset(){this.setChecked(aI)}}function yge(t){this.setState(t.target.value)}function bge(t,e,r){Ege(t,e),e.set(t,r)}function Ege(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function i1(t,e){return t.get(AH(t,e))}function Rge(t,e,r){return t.set(AH(t,e),r),r}function AH(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var pd=new WeakMap;class Yf extends ys{static get DEFAULTS(){return _s({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,r){super(e,kr(Yf.DEFAULTS,r)),bge(this,pd,void 0)}build(){super.build(),Rge(pd,this,this._element.firstChild)}update(){this.isBuilt()&&(i1(pd,this).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&i1(pd,this).focus()}activate(){i1(pd,this).click()}}function Tge(t,e){MH(t,e),e.add(t)}function yu(t,e,r){MH(t,e),e.set(t,r)}function MH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function et(t,e){return t.get(Yu(t,e))}function is(t,e,r){return t.set(Yu(t,e),r),r}function Yu(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const cI="multipleSelect.itemBox";var ds=new WeakMap,sr=new WeakMap,s1=new WeakMap,Ho=new WeakMap,Ia=new WeakMap,Oa=new WeakMap,wd=new WeakSet;class zf extends ys{static get DEFAULTS(){return _s({className:"htUIMultipleSelect",value:[]})}constructor(e,r){super(e,kr(zf.DEFAULTS,r)),Tge(this,wd),yu(this,ds,[]),yu(this,sr,void 0),yu(this,s1,void 0),yu(this,Ho,void 0),yu(this,Ia,void 0),yu(this,Oa,void 0),is(Ho,this,new ll(this.hot,{placeholder:AE,className:"htUIMultipleSelectSearch"})),is(Ia,this,new Yf(this.hot,{textContent:EE,className:"htUISelectAll"})),is(Oa,this,new Yf(this.hot,{textContent:RE,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return et(sr,this)}registerHooks(){et(Ho,this).addLocalHook("keydown",e=>Yu(wd,this,Age).call(this,e)),et(Ho,this).addLocalHook("input",e=>Yu(wd,this,_ge).call(this,e)),et(Ia,this).addLocalHook("click",e=>Yu(wd,this,Mge).call(this,e)),et(Oa,this).addLocalHook("click",e=>Yu(wd,this,Ige).call(this,e))}setItems(e){is(ds,this,e),et(sr,this)&&et(sr,this).loadData(et(ds,this))}setLocale(e){is(s1,this,e)}getLocale(){return et(s1,this)}getItems(){return[...et(ds,this)]}getValue(){return Pge(et(ds,this))}getSearchInputElement(){return et(Ho,this)}getSelectAllElement(){return et(Ia,this)}getClearAllElement(){return et(Oa,this)}isSelectedAllValues(){return et(ds,this).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,r=e.createElement("div"),n=new ys(this.hot,{className:"htUISelectionControls",children:[et(Ia,this),et(Oa,this)]});this._element.appendChild(et(Ho,this).element),this._element.appendChild(n.element),this._element.appendChild(r);const i=s=>{if(!this._element)return;et(sr,this)&&et(sr,this).destroy(),Re(s,"htUIMultipleSelectHot"),is(sr,this,new this.hot.constructor(s,{data:et(ds,this),columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(l,c,u,h,d,f)=>{l.title=f.instance.getDataAtRowProp(c,f.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{et(sr,this).listen()},colWidths:()=>et(sr,this).container.scrollWidth-Qr(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"})),et(sr,this).init();const a=et(sr,this).getShortcutManager().getContext("grid");a.removeShortcutsByKeys(["Tab"]),a.removeShortcutsByKeys(["Shift","Tab"]),a.addShortcut({keys:[["Escape"]],callback:l=>{this.runLocalHooks("keydown",l,this)},group:cI}),a.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:l=>{et(sr,this).deselectCell(),this.runLocalHooks("keydown",l,this),this.runLocalHooks("listTabKeydown",l,this)},group:cI})};i(r),this.hot._registerTimeout(()=>i(r),100)}focus(){this.isBuilt()&&et(sr,this).listen()}reset(){et(Ho,this).reset(),et(Ia,this).reset(),et(Oa,this).reset()}update(){this.isBuilt()&&(et(sr,this).loadData(Oge(et(ds,this),this.options.value)),super.update())}destroy(){et(sr,this)&&et(sr,this).destroy(),et(Ho,this).destroy(),et(Oa,this).destroy(),et(Ia,this).destroy(),is(Ho,this,null),is(Oa,this,null),is(Ia,this,null),is(sr,this,null),is(ds,this,null),super.destroy()}}function _ge(t){const e=t.target.value.toLocaleLowerCase(this.getLocale());let r;e===""?r=[...et(ds,this)]:r=et(ds,this).filter(n=>`${n.value}`.toLocaleLowerCase(this.getLocale()).indexOf(e)>=0),et(sr,this).loadData(r)}function Age(t){this.runLocalHooks("keydown",t,this),Zk(fg,t.keyCode)("ARROW_DOWN")&&(t.preventDefault(),Ps(t),et(sr,this).listen(),et(sr,this).selectCell(0,0))}function Mge(t){const e=[];t.preventDefault(),et(sr,this).getSourceData().forEach((r,n)=>{r.checked=!0,e.push($N(r,n)[0])}),et(sr,this).setSourceDataAtCell(e)}function Ige(t){const e=[];t.preventDefault(),et(sr,this).getSourceData().forEach((r,n)=>{r.checked=!1,e.push($N(r,n)[0])}),et(sr,this).setSourceDataAtCell(e)}function Oge(t,e){const r=Tg(e);return t.map(n=>(n.checked=r(n.value),n))}function Pge(t){const e=[];return t.forEach(r=>{r.checked&&e.push(r.value)}),e}function Dge(t,e){kge(t,e),e.add(t)}function kge(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Nge(t,e,r){return e=Hge(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Hge(t){var e=Fge(t,"string");return typeof e=="symbol"?e:e+""}function Fge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function em(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var vd=new WeakSet;class Lge extends Rg{constructor(e,r){super(e,{id:r.id,stateless:!1}),Dge(this,vd),Nge(this,"name",""),this.name=r.name,this.elements.push(new zf(this.hot)),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>em(vd,this,$ge).call(this,e)).addLocalHook("listTabKeydown",e=>this.runLocalHooks("listTabKeydown",e)),this.hot.addHook("modifyFiltersMultiSelectValue",(e,r)=>em(vd,this,Bge).call(this,e,r))}getElements(){const e=this.getMultipleSelectElement();return[e.getSearchInputElement(),e.getSelectAllElement(),e.getClearAllElement(),this.getMultipleSelectElement()]}setState(e){if(this.reset(),e&&e.command.key===uc){const r=this.getMultipleSelectElement();r.setItems(e.itemsSnapshot),r.setValue(e.args[0]),r.setLocale(e.locale)}}getState(){const e=this.getMultipleSelectElement(),r=e.getItems();return{command:{key:e.isSelectedAllValues()||!r.length?qr:uc},args:[e.getValue()],itemsSnapshot:r}}updateState(e){const r=(n,i,s,o,a)=>{const[l]=Rs(i,h=>h.name===uc),c={},u=this.hot.getTranslatedPhrase(yp);if(l){const h=o(n,a),d=wt(h,y=>y.value),f=new Map(h.map(y=>[y.value,this.hot.getCellMeta(y.meta.visualRow,y.meta.visualCol)])),g=qS(d);s&&(l.args[0]=s);const m=[],p=QM(g,l.args[0],u,y=>{y.checked&&m.push(y.value),em(vd,this,uI).call(this,y,f)}),S=e.editedConditionStack.column;c.locale=this.hot.getCellMeta(0,S).locale,c.args=[m],c.command=cc(uc),c.itemsSnapshot=p}else c.args=[],c.command=cc(qr);this.state.setValueAtIndex(n,c)};r(e.editedConditionStack.column,e.editedConditionStack.conditions,e.conditionArgsChange,e.filteredRowsFactory),e.dependentConditionStacks.length&&r(e.dependentConditionStacks[0].column,e.dependentConditionStacks[0].conditions,e.conditionArgsChange,e.filteredRowsFactory,e.editedConditionStack)}getMultipleSelectElement(){return this.elements.filter(e=>e instanceof zf)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,r,n,i,s,o)=>{Re(r.parentNode,"htFiltersMenuValue");const a=this.hot.rootDocument.createElement("div");return Re(a,"htFiltersMenuLabel"),a.textContent=o,r.appendChild(a),j(this.elements,l=>r.appendChild(l.element)),r}}}reset(){const e=this.hot.getTranslatedPhrase(yp),r=this._getColumnVisibleValues(),n=r.map(l=>l.value),i=new Map(r.map(l=>[l.value,l.meta])),s=qS(n),o=QM(s,s,e,l=>{em(vd,this,uI).call(this,l,i)});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?[]:wt(this.hot.getDataAtCol(e.visualIndex),(r,n)=>({value:yH(r),meta:this.hot.getCellMeta(n,e.visualIndex)}))}}function $ge(t){fg(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),Ps(t))}function uI(t,e){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(t.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",t.visualValue,e.get(t.value)))}function Bge(t,e){switch(e.type){case"numeric":return T2(t,e);default:return t}}var IH;function Vge(t,e){Wge(t,e),e.add(t)}function Wge(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Uge(t,e,r){return e=Yge(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yge(t){var e=zge(t,"string");return typeof e=="symbol"?e:e+""}function zge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Gge(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var hI=new WeakSet;class Gf extends Rg{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,r){super(e,{id:r.id,stateless:!0}),Vge(this,hI),Uge(this,"name",""),this.name=r.name,this.elements.push(new ll(this.hot,{type:"button",value:TE,className:"htUIButton htUIButtonOK",identifier:Gf.BUTTON_OK})),this.elements.push(new ll(this.hot,{type:"button",value:_E,className:"htUIButton htUIButtonCancel",identifier:Gf.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){j(this.elements,e=>{e.addLocalHook("click",(r,n)=>Gge(hI,this,jge).call(this,r,n))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,r)=>(Re(r.parentNode,"htFiltersMenuActionBar"),j(this.elements,n=>r.appendChild(n.element)),r)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}IH=Gf;function jge(t,e){e.options.identifier===IH.BUTTON_OK?this.accept():this.cancel()}function o1(t,e,r){return e=Kge(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Kge(t){var e=Xge(t,"string");return typeof e=="symbol"?e:e+""}function Xge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const dI="ConditionCollection.filteringStates";class lR{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;o1(this,"hot",void 0),o1(this,"isMapRegistrable",void 0),o1(this,"filteringStates",new Dw),this.hot=e,this.isMapRegistrable=r,this.isMapRegistrable===!0?this.hot.columnIndexMapper.registerMap(dI,this.filteringStates):this.filteringStates.init(this.hot.columnIndexMapper.getNumberOfIndexes())}isEmpty(){return this.getFilteredColumns().length===0}isMatch(e,r){var n;const i=this.filteringStates.getValueAtIndex(r),s=(n=i?.conditions)!==null&&n!==void 0?n:[],o=i?.operation;return this.isMatchInConditions(s,e,o)}isMatchInConditions(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:al;return e.length?Vfe(n)(e,r):!0}addCondition(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:al,i=arguments.length>3?arguments[3]:void 0;const s=this.hot.getCellMeta(0,e).locale,o=wt(r.args,u=>typeof u=="string"?u.toLocaleLowerCase(s):u),a=r.name||r.command.key;this.runLocalHooks("beforeAdd",e);const l=this.getOperation(e);if(l){if(l!==n)throw Error(Dt`The column of index ${e} has been already applied with a \`${l}\`\x20
  117. filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20
  118. Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20
  119. use it consequently for a particular column).`)}else if(Zt(Wf[n]))throw new Error(Dt`Unexpected operation named \`${n}\`. Possible ones are\x20
  120. \`disjunction\` and \`conjunction\`.`);const c=this.getConditions(e);c.length===0?this.filteringStates.setValueAtIndex(e,{operation:n,conditions:[{name:a,args:o,func:dl(a,o)}]},i):c.push({name:a,args:o,func:dl(a,o)}),this.runLocalHooks("afterAdd",e)}getConditions(e){var r,n;return(r=(n=this.filteringStates.getValueAtIndex(e))===null||n===void 0?void 0:n.conditions)!==null&&r!==void 0?r:[]}getOperation(e){var r;return(r=this.filteringStates.getValueAtIndex(e))===null||r===void 0?void 0:r.operation}getFilteredColumns(){return this.filteringStates.getEntries().map(e=>{let[r]=e;return r})}getColumnStackPosition(e){return this.getFilteredColumns().indexOf(e)}exportAllConditions(){return Rn(this.filteringStates.getEntries(),(e,r)=>{let[n,{operation:i,conditions:s}]=r;return e.push({column:n,operation:i,conditions:wt(s,o=>{let{name:a,args:l}=o;return{name:a,args:l}})}),e},[])}importAllConditions(e){this.clean(),j(e,r=>{j(r.conditions,n=>this.addCondition(r.column,n))})}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,r){const n=this.getConditions(e);return r?n.some(i=>i.name===r):n.length>0}destroy(){this.isMapRegistrable&&this.hot.columnIndexMapper.unregisterMap(dI),this.filteringStates=null,this.clearLocalHooks()}}zt(lR,Wn);function fI(t,e,r){return e=qge(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qge(t){var e=Zge(t,"string");return typeof e=="symbol"?e:e+""}function Zge(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class OH{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>[];fI(this,"conditionCollection",void 0),fI(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=r}filter(){let e=[];return j(this.conditionCollection.getFilteredColumns(),(r,n)=>{let i=this.columnDataFactory(r);n&&(i=this._getIntersectData(i,e)),e=this.filterByColumn(r,i)}),e}filterByColumn(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=[];return j(r,i=>{i!==void 0&&this.conditionCollection.isMatch(i,e)&&n.push(i)}),n}_getIntersectData(e,r){const n=[];return j(r,i=>{const s=i.meta.visualRow;e[s]!==void 0&&(n[s]=e[s])}),n}}function Jge(t,e){Qge(t,e),e.add(t)}function Qge(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wl(t,e,r){return e=e0e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function e0e(t){var e=t0e(t,"string");return typeof e=="symbol"?e:e+""}function t0e(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function a1(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var tm=new WeakSet;class PH{constructor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:()=>[];Jge(this,tm),Wl(this,"hot",void 0),Wl(this,"conditionCollection",void 0),Wl(this,"columnDataFactory",void 0),Wl(this,"changes",[]),Wl(this,"grouping",!1),Wl(this,"latestEditedColumnPosition",-1),Wl(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=r,this.columnDataFactory=n,this.conditionCollection.addLocalHook("beforeRemove",i=>a1(tm,this,r0e).call(this,i)),this.conditionCollection.addLocalHook("afterRemove",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("afterAdd",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("beforeClean",()=>a1(tm,this,n0e).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>a1(tm,this,i0e).call(this))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,j(this.changes,e=>{this.updateStatesAtColumn(e)}),this.changes.length=0}updateStatesAtColumn(e,r){var n=this;if(this.grouping){this.changes.indexOf(e)===-1&&this.changes.push(e);return}const i=this.conditionCollection.exportAllConditions();let s=this.conditionCollection.getColumnStackPosition(e);s===-1&&(s=this.latestEditedColumnPosition);const o=i.slice(0,s),a=i.slice(s);a.length&&a[0].column===e&&a.shift();const l=aJ(function(u,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const f=new lR(n.hot,!1),g=[].concat(u,d);f.importAllConditions(g);const m=n.columnDataFactory(h);let p;f.isEmpty()?p=m:p=new OH(f,y=>n.columnDataFactory(y)).filter(),p=wt(p,y=>y.meta.visualRow);const S=Tg(p);return f.destroy(),Rs(m,y=>S(y.meta.visualRow))})(o),c=[].concat(this.conditionCollection.getConditions(e));this.runLocalHooks("update",{editedConditionStack:{column:e,conditions:c},dependentConditionStacks:a,filteredRowsFactory:l,conditionArgsChange:r})}destroy(){this.clearLocalHooks(),dt(this,(e,r)=>{this[r]=null})}}function r0e(t){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(t)}function n0e(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function i0e(){j(this.latestOrderStack,t=>{this.updateStatesAtColumn(t)})}zt(PH,Wn);function s0e(t){return Q2({initialPage:0,size:()=>t.length,onItemSelect:(r,n)=>{const i=t[r];if(i instanceof zf)return n;if(i.element&&!yc(i.element))return!1;i.focus()}})}const Cd="filters";function o0e(t,e){let r=-1;const n=s0e(e),i=l=>()=>{t.isOpened()&&t.getKeyboardShortcutsCtrl().listen(Cd),n.setCurrentPage(e.indexOf(l))};e.forEach(l=>{l instanceof ys&&(l.addLocalHook("click",i(l)),l.addLocalHook("focus",i(l)),l.addLocalHook("afterClose",i(l)))}),t.addLocalHook("afterSelectionChange",l=>{l.key.startsWith("filter_")||n.clear()});function s(l){const c=t.getKeyboardShortcutsCtrl(),u=l.getKeyboardShortcutsCtrl();n.clear(),u.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:c.getContext(Cd),callback:()=>{l.isSubMenu()&&l.close(),c.listen(Cd)}}]),!l.isSubMenu()&&c.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:h=>{const d=t.getNavigator();d.getCurrentPage()>-1&&(r=d.getCurrentPage()),d.clear(),h.shiftKey?n.toPreviousItem():n.toNextItem()}},{keys:[["Escape"]],callback:()=>{t.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:h=>{const d=e[n.getCurrentPage()];d instanceof Uf&&(d.openOptions(),h.preventDefault()),d instanceof Yf&&(d.activate(),h.preventDefault()),d instanceof ys||h.preventDefault()}}],Cd)}t.addLocalHook("afterSubmenuOpen",s),t.addLocalHook("afterOpen",s);function o(){t.focus(),t.getKeyboardShortcutsCtrl().listen(Cd)}function a(){return r}return{...n,listen:o,getLastMenuPage:a}}function a0e(t,e){DH(t,e),e.add(t)}function l0e(t,e,r){DH(t,e),e.set(t,r)}function DH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Sd(t,e,r){return e=c0e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function c0e(t){var e=u0e(t,"string");return typeof e=="symbol"?e:e+""}function u0e(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function h0e(t,e,r){return t.set(ci(t,e),r),r}function xd(t,e){return t.get(ci(t,e))}function ci(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const JS="filters",d0e=250,gI=JS;var Ul=new WeakMap,Ai=new WeakSet;class f0e extends Pt{static get PLUGIN_KEY(){return JS}static get PLUGIN_PRIORITY(){return d0e}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){super(e),a0e(this,Ai),Sd(this,"dropdownMenuPlugin",null),Sd(this,"conditionCollection",null),Sd(this,"conditionUpdateObserver",null),Sd(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),Sd(this,"filtersRowsMap",null),l0e(this,Ul,void 0),this.hot.addHook("afterGetColHeader",(r,n)=>ci(Ai,this,C0e).call(this,r,n))}isEnabled(){return!!this.hot.getSettings()[JS]}enablePlugin(){if(this.enabled)return;this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new vg),this.dropdownMenuPlugin=this.hot.getPlugin("dropdownMenu");const e=this.hot.getSettings().dropdownMenu,r=e&&e.uiContainer||this.hot.rootDocument.body,n=o=>(o.addLocalHook("accept",()=>ci(Ai,this,mI).call(this,"accept")),o.addLocalHook("cancel",()=>ci(Ai,this,mI).call(this,"cancel")),o.addLocalHook("change",a=>ci(Ai,this,v0e).call(this,o,a)),o),i=()=>`${this.hot.getTranslatedPhrase(xE)}:`,s=()=>`${this.hot.getTranslatedPhrase(yE)}:`;if(!this.components.get("filter_by_condition")){const o=new ZS(this.hot,{id:"filter_by_condition",name:i,addSeparator:!1,menuContainer:r});o.addLocalHook("afterClose",()=>ci(Ai,this,pI).call(this)),this.components.set("filter_by_condition",n(o))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new xge(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const o=new ZS(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:r});o.addLocalHook("afterClose",()=>ci(Ai,this,pI).call(this)),this.components.set("filter_by_condition2",n(o))}if(this.components.get("filter_by_value")||this.components.set("filter_by_value",n(new Lge(this.hot,{id:"filter_by_value",name:s}))),this.components.get("filter_action_bar")||this.components.set("filter_action_bar",n(new Gf(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new lR(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new PH(this.hot,this.conditionCollection,o=>this.getDataMapAtColumn(o)),this.conditionUpdateObserver.addLocalHook("update",o=>ci(Ai,this,S0e).call(this,o))),this.components.forEach(o=>o.show()),this.addHook("afterDropdownMenuDefaultOptions",o=>ci(Ai,this,w0e).call(this,o)),this.addHook("afterDropdownMenuShow",()=>ci(Ai,this,m0e).call(this)),this.addHook("afterDropdownMenuHide",()=>ci(Ai,this,p0e).call(this)),this.addHook("afterChange",o=>ci(Ai,this,g0e).call(this,o)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!xd(Ul,this)&&this.dropdownMenuPlugin.enabled){const o=this.dropdownMenuPlugin.menu,a=[{focus:()=>{const c=o.getNavigator(),u=xd(Ul,this).getLastMenuPage();o.focus(),u>0?c.setCurrentPage(u):c.toFirstItem()}},...Array.from(this.components).map(c=>{let[,u]=c;return u.getElements()}).flat()];h0e(Ul,this,o0e(o,a));const l=c=>{xd(Ul,this).listen(),c.preventDefault(),fg(c.keyCode,"TAB")&&(c.shiftKey?xd(Ul,this).toPreviousItem():xd(Ul,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((r,n)=>{r.destroy(),this.components.set(n,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:gI})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(gI)}addCondition(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:al;const s=this.hot.toPhysicalColumn(e);this.conditionCollection.addCondition(s,{command:{key:r},args:n},i)}removeConditions(e){const r=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(r)}clearConditions(e){if(e===void 0)this.conditionCollection.clean();else{const r=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(r)}}filter(){const{navigableHeaders:e}=this.hot.getSettings(),r=this._createDataFilter(),n=!this.conditionCollection.isEmpty();let i=[];const s=this.conditionCollection.exportAllConditions();if(this.hot.runHooks("beforeFilter",s)!==!1)if(n){const a=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear(),i=wt(r.filter(),c=>c.meta.visualRow);const l=Tg(i);Ue(this.hot.countSourceRows()-1,c=>{l(c)||a.push(c)}),j(a,c=>{this.filtersRowsMap.setValueAtIndex(c,!0)})},!0),!e&&!i.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 r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r?{visualIndex:r.col,physicalIndex:this.hot.toPhysicalColumn(r.col)}:null}getDataMapAtColumn(e){const r=this.hot.toVisualColumn(e),n=[];return j(this.hot.getSourceDataAtCol(r),(i,s)=>{var o;const{row:a,col:l,visualCol:c,visualRow:u,type:h,instance:d,dateFormat:f,locale:g}=this.hot.getCellMeta(s,r),m=(o=this.hot.getDataAtCell(this.hot.toVisualRow(s),r))!==null&&o!==void 0?o:i;n.push({meta:{row:a,col:l,visualCol:c,visualRow:u,type:h,instance:d,dateFormat:f,locale:g},value:yH(m)})}),n}updateValueComponentCondition(e){const r=this.hot.getDataAtCol(e),n=qS(r);this.conditionUpdateObserver.updateStatesAtColumn(e,n)}restoreComponents(e){var r;const n=(r=this.getSelectedColumn())===null||r===void 0?void 0:r.physicalIndex;e.forEach(i=>{i.isHidden()||i.restoreState(n)}),this.updateDependentComponentsVisibility()}getOperationBasedOnArguments(e,r,n,i){let s=e;return s===Np&&r.command.key!==qr&&n.command.key!==qr&&i.command.key!==qr?s=oR:i.command.key!==qr&&(r.command.key===qr||n.command.key===qr)&&(s=al),s}setListeningDropdownMenu(){this.dropdownMenuPlugin&&this.dropdownMenuPlugin.setListening()}updateDependentComponentsVisibility(){const e=this.components.get("filter_by_condition"),{command:r}=e.getState(),n=[this.components.get("filter_by_condition2"),this.components.get("filter_operators")];r.showOperators?this.showComponents(...n):this.hideComponents(...n)}_createDataFilter(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.conditionCollection;return new OH(e,r=>this.getDataMapAtColumn(r))}getIndexesOfComponents(){const e=[];if(!this.dropdownMenuPlugin)return e;const r=this.dropdownMenuPlugin.menu;for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return j(i,o=>{j(r.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 n=this.dropdownMenuPlugin.menu.hotMenu,i=n.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?i.showRows(l):i.hideRows(l),n.render()}hideComponents(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.changeComponentsVisibility(!1,...r)}showComponents(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.changeComponentsVisibility(!0,...r)}destroy(){this.enabled&&(this.components.forEach((e,r)=>{e!==null&&(e.destroy(),this.components.set(r,null))}),this.conditionCollection.destroy(),this.conditionUpdateObserver.destroy(),this.hot.rowIndexMapper.unregisterMap(this.pluginName)),super.destroy()}}function g0e(t){t&&j(t,e=>{const[,r]=e,n=this.hot.propToCol(r);this.conditionCollection.hasConditions(n)&&this.updateValueComponentCondition(n)})}function m0e(){this.restoreComponents(Array.from(this.components.values()))}function p0e(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function w0e(t){t.items.push({name:ht}),this.components.forEach(e=>{t.items.push(e.getMenuItemDescriptor())})}function mI(t){var e;if(t==="accept"){const n=this.getSelectedColumn();if(n===null){var r;(r=this.dropdownMenuPlugin)===null||r===void 0||r.close();return}const{physicalIndex:i}=n,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 c=this.conditionCollection.getColumnStackPosition(i);c===-1&&(c=void 0),this.conditionCollection.removeConditions(i),s.command.key!==qr&&(this.conditionCollection.addCondition(i,s,l,c),o.command.key!==qr&&this.conditionCollection.addCondition(i,o,l,c)),a.command.key!==qr&&this.conditionCollection.addCondition(i,a,l,c),this.conditionUpdateObserver.flush(),this.components.forEach(u=>u.saveState(i)),this.filtersRowsMap.clear(),this.filter()}(e=this.dropdownMenuPlugin)===null||e===void 0||e.close()}function v0e(t,e){this.updateDependentComponentsVisibility(),t.constructor===ZS&&!e.inputsCount&&this.setListeningDropdownMenu()}function pI(){this.setListeningDropdownMenu()}function C0e(t,e){const r=this.hot.toPhysicalColumn(t);this.enabled&&this.conditionCollection.hasConditions(r)?Re(e,"htFiltersActive"):rt(e,"htFiltersActive")}function S0e(t){var e;if(!((e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled))return;const{editedConditionStack:{conditions:r,column:n}}=t,i=r.filter(o=>o.name===uc),s=r.filter(o=>o.name!==uc);if(i.length>=2||s.length>=3)Vt(Dt`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20
  121. The overall amount of conditions exceed the capability of the dropdown menu.\x20
  122. For more details see the documentation.`);else{const o=this.conditionCollection.getOperation(n);this.components.get("filter_by_condition").updateState(s[0],n),this.components.get("filter_by_condition2").updateState(s[1],n),this.components.get("filter_operators").updateState(o,n),this.components.get("filter_by_value").updateState(t)}}const kH="internal-use-in-handsontable",QS={licenseKey:kH,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 NH(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 HH(t){return Object.keys(t).reduce((e,r)=>(r!=="hyperformula"&&(e[r]=t[r]),e),{})}function x0e(t){var e;const r=t[pn],n=HH(r!=null&&(e=r.engine)!==null&&e!==void 0&&e.hyperformula?r.engine:{}),i=NH(t);return{...QS,...n,...i}}function y0e(t){var e;const r=t[pn],n=HH(r!=null&&(e=r.engine)!==null&&e!==void 0&&e.hyperformula?r.engine:{}),i=NH(t);return{...n,...i}}function b0e(t,e){return Object.keys(e).some(r=>e[r]!==void 0&&e[r]!==t[r])}function Qw(){const t="engine_relationship",e=Ds(pn);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function cR(){const t="shared_engine_usage",e=Ds(pn);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function E0e(t){const e=t.getSettings(),r=e[pn],n=r?.engine;if(r===!0||Zt(n))return null;if(typeof n.hyperformula=="function"||typeof n=="function"){var i;return R0e((i=n.hyperformula)!==null&&i!==void 0?i:n,e,t)}else if(typeof n=="object"&&Zt(n.hyperformula)){const s=Qw(),o=cR().get(n);return s.has(n)||s.set(n,[]),s.get(n).push(t),o&&o.push(t.guid),n.getConfig().licenseKey||n.updateConfig({licenseKey:kH}),(n.getConfig().leapYear1900!==QS.leapYear1900||Oy(n.getConfig().nullDate,QS.nullDate)===!1)&&Vt(Dt`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\`
  123. settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),n}return null}function R0e(t,e,r){const n=e[pn],i=x0e(e),s=Qw(),o=cR();T0e(t,n.functions),_0e(t,n.language);const a=t.buildEmpty(i);return s.set(a,[r]),o.set(a,[r.guid]),A0e(a,n.namedExpressions),a.on("sheetAdded",()=>{a.rebuildAndRecalculate()}),a.on("sheetRemoved",()=>{a.rebuildAndRecalculate()}),a}function wI(t){var e;const r=Qw(),n=r.size===0?[]:Array.from((e=r.get(t))!==null&&e!==void 0?e:[]);return new Map(n.map(i=>[i.getPlugin("formulas").sheetId,i]))}function vI(t,e){if(t){const r=Qw(),n=r.get(t),i=cR(),s=i.get(t);n&&n.includes(e)&&(n.splice(n.indexOf(e),1),n.length===0&&r.delete(t)),s&&s.includes(e.guid)&&(s.splice(s.indexOf(e.guid),1),s.length===0&&(i.delete(t),t.destroy()))}}function T0e(t,e){e&&e.forEach(r=>{const{name:n,plugin:i,translations:s}=r;try{t.registerFunction(n,i,s)}catch(o){Vt(o.message)}})}function _0e(t,e){if(e){const{langCode:r}=e;try{t.registerLanguage(r,e)}catch(n){Vt(n.message)}}}function A0e(t,e){e&&(t.suspendEvaluation(),e.forEach(r=>{const{name:n,expression:i,scope:s,options:o}=r;try{t.addNamedExpression(n,i,s,o)}catch(a){Vt(a.message)}}),t.resumeEvaluation())}function M0e(t,e){return(Zt(e)||!t.doesSheetExist(e))&&(e=t.addSheet(e)),e}const FH="DD/MM/YYYY";function LH(t){return typeof t=="string"&&t.charAt(0)==="'"&&t.charAt(1)==="="}function I0e(t){return LH(t)?t.substr(1):t}function O0e(t){return typeof t=="string"&&t.startsWith("=")}function uR(t,e){return typeof t=="string"&&e==="date"}function $H(t,e){return be(t,e,!0).isValid()}function BH(t,e){return be(t,e,!0).format(FH)}function P0e(t,e){return be(t,FH,!0).format(e)}function VH(t,e){const n=new Date(Date.UTC(0,0,t+-1));return be(n).format(e)}function D0e(t,e,r){const n=Array.from(Array(r).keys()).filter(s=>t.includes(s)===!1);if(e===0){var i;return(i=n[e])!==null&&i!==void 0?i:0}return n[e-1]+1}function k0e(t,e){const r=[];return t.forEach(n=>{const i={from:n,to:e};r.forEach(s=>{const o=s.from>s.to,a=s.to<=i.from;s.from>i.from&&a&&o&&(i.from+=1)}),i.from>=e&&(e+=1),r.push(i)}),r}function N0e(t){return t.forEach((e,r)=>{t.slice(r+1).forEach(i=>{const s=i.from<i.to;i.from>e.from&&s&&(i.from-=1)})}),t}function hR(t,e,r){const n=k0e(t,D0e(t,e,r));return N0e(n)}function Yl(t,e,r){H0e(t,e),e.set(t,r)}function H0e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function er(t,e){return t.get(WH(t,e))}function Pa(t,e,r){return t.set(WH(t,e),r),r}function WH(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var yd=new WeakMap,Da=new WeakMap,si=new WeakMap,rm=new WeakMap,l1=new WeakMap,c1=new WeakMap,nm=new WeakMap;class CI{constructor(e,r,n){Yl(this,yd,void 0),Yl(this,Da,void 0),Yl(this,si,void 0),Yl(this,rm,[]),Yl(this,l1,[]),Yl(this,c1,void 0),Yl(this,nm,[]),Pa(yd,this,e),Pa(Da,this,r),Pa(si,this,n)}setRemovedHfIndexes(e){return Pa(nm,this,e.map(r=>{const n=er(Da,this).getVisualFromPhysicalIndex(r);return this.getHfIndexFromVisualIndex(n)})),er(nm,this)}getRemovedHfIndexes(){return er(nm,this)}getHfIndexFromVisualIndex(e){const r=er(Da,this).getIndexesSequence(),n=er(Da,this).getNotTrimmedIndexes();return r.indexOf(n[e])}syncMoves(e){const n=`move${Ts(er(yd,this))}s`;er(si,this).getEngine().batch(()=>{e.forEach(i=>{const s=i.from!==i.to,o=i.from+1!==i.to;s&&o&&er(si,this).getEngine()[n](er(si,this).getSheetId(),i.from,1,i.to)})})}storeMovesInformation(e,r,n){n!==!1&&(Pa(l1,this,e.map(i=>this.getHfIndexFromVisualIndex(i))),Pa(c1,this,this.getHfIndexFromVisualIndex(r)))}calculateAndSyncMoves(e,r){if(er(si,this).isPerformingUndoRedo()||e===!1||r===!1)return;const n=hR(er(l1,this),er(c1,this),er(Da,this).getNumberOfIndexes());er(si,this).getSheetId()===null?er(si,this).getPostponeAction(()=>this.syncMoves(n)):this.syncMoves(n)}getIndexesChangeSyncMethod(){const e=`set${Ts(er(yd,this))}Order`;return r=>{if(er(si,this).isPerformingUndoRedo())return;const n=er(Da,this).getIndexesSequence();if(r==="update"&&n.length>0){const i=er(rm,this).map(l=>n.indexOf(l)),s=er(si,this).getEngine().getSheetDimensions(er(si,this).getSheetId());let o;er(yd,this)==="row"?o=s.height:o=s.width;const a=i.length;for(let l=a;l<o;l+=1)i.push(l);er(si,this).getEngine()[e](er(si,this).getSheetId(),i)}Pa(rm,this,n)}}init(){Pa(rm,this,er(Da,this).getIndexesSequence())}}function zl(t,e,r){F0e(t,e),e.set(t,r)}function F0e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fo(t,e){return t.get(UH(t,e))}function Gl(t,e,r){return t.set(UH(t,e),r),r}function UH(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var im=new WeakMap,sm=new WeakMap,u1=new WeakMap,h1=new WeakMap,d1=new WeakMap,f1=new WeakMap,g1=new WeakMap;class L0e{constructor(e,r,n){zl(this,im,void 0),zl(this,sm,void 0),zl(this,u1,void 0),zl(this,h1,!1),zl(this,d1,!1),zl(this,f1,null),zl(this,g1,null),Gl(im,this,new CI("row",e,this)),Gl(sm,this,new CI("column",r,this)),Gl(u1,this,n)}getForAxis(e){return e==="row"?Fo(im,this):Fo(sm,this)}setPerformUndo(e){Gl(h1,this,e)}setPerformRedo(e){Gl(d1,this,e)}isPerformingUndoRedo(){return Fo(h1,this)||Fo(d1,this)}getSheetId(){return Fo(g1,this)}getEngine(){return Fo(f1,this)}getPostponeAction(){return Fo(u1,this)}setupSyncEndpoint(e,r){Gl(f1,this,e),Gl(g1,this,r),Fo(im,this).init(),Fo(sm,this).init()}}function $0e(t,e){YH(t,e),e.add(t)}function bu(t,e,r){return e=B0e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function B0e(t){var e=V0e(t,"string");return typeof e=="symbol"?e:e+""}function V0e(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function m1(t,e,r){YH(t,e),e.set(t,r)}function YH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fl(t,e,r){return t.set(kt(t,e),r),r}function eh(t,e){return t.get(kt(t,e))}function kt(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const pn="formulas",W0e=["maxRows","maxColumns","language"],U0e=260;He.getSingleton().register("afterNamedExpressionAdded");He.getSingleton().register("afterNamedExpressionRemoved");He.getSingleton().register("afterSheetAdded");He.getSingleton().register("afterSheetRemoved");He.getSingleton().register("afterSheetRenamed");He.getSingleton().register("afterFormulasValuesUpdate");const Eh=t=>t==="UndoRedo.undo"||t==="UndoRedo.redo"||t==="auto";var la=new WeakMap,dR=new WeakMap,bd=new WeakMap,Lt=new WeakSet;class Y0e extends Pt{constructor(){var e;super(...arguments),e=this,$0e(this,Lt),m1(this,la,!1),m1(this,dR,!1),m1(this,bd,[["valuesUpdated",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return kt(Lt,e,ome).call(e,...n)}],["namedExpressionAdded",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return kt(Lt,e,ame).call(e,...n)}],["namedExpressionRemoved",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return kt(Lt,e,lme).call(e,...n)}],["sheetAdded",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return kt(Lt,e,cme).call(e,...n)}],["sheetRenamed",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return kt(Lt,e,ume).call(e,...n)}],["sheetRemoved",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return kt(Lt,e,hme).call(e,...n)}]]),bu(this,"staticRegister",Ds("formulas")),bu(this,"engine",null),bu(this,"sheetName",null),bu(this,"indexSyncer",null),bu(this,"rowAxisSyncer",null),bu(this,"columnAxisSyncer",null)}static get PLUGIN_KEY(){return pn}static get PLUGIN_PRIORITY(){return U0e}static get SETTING_KEYS(){return[pn,...W0e]}get sheetId(){return this.sheetName===null?null:this.engine.getSheetId(this.sheetName)}isEnabled(){return!!this.hot.getSettings()[pn]}enablePlugin(){var e,r=this;if(!this.enabled){if(this.engine=(e=E0e(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 n=this.addSheet(this.sheetName,this.hot.getSourceDataArray());n!==!1&&(this.sheetName=n)}this.addHook("beforeLoadData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,SI).call(r,...i)}),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,xI).call(r,...i)}),this.addHook("beforeUpdateData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,SI).call(r,...i)}),this.addHook("afterUpdateData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,xI).call(r,...i)}),this.addHook("modifyData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,K0e).call(r,...i)}),this.addHook("modifySourceData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,X0e).call(r,...i)}),this.addHook("beforeValidate",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,z0e).call(r,...i)}),this.addHook("afterSetSourceDataAtCell",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,q0e).call(r,...i)}),this.addHook("afterSetDataAtCell",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,yI).call(r,...i)}),this.addHook("afterSetDataAtRowProp",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,yI).call(r,...i)}),this.addHook("beforeCreateRow",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,Z0e).call(r,...i)}),this.addHook("beforeCreateCol",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,J0e).call(r,...i)}),this.addHook("afterCreateRow",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,tme).call(r,...i)}),this.addHook("afterCreateCol",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,rme).call(r,...i)}),this.addHook("beforeRemoveRow",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,Q0e).call(r,...i)}),this.addHook("beforeRemoveCol",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,eme).call(r,...i)}),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,nme).call(r,...i)}),this.addHook("afterRemoveCol",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,ime).call(r,...i)}),this.indexSyncer=new L0e(this.hot.rowIndexMapper,this.hot.columnIndexMapper,n=>{this.hot.addHookOnce("init",()=>{n()})}),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",(n,i,s,o)=>{this.rowAxisSyncer.storeMovesInformation(n,i,o)}),this.hot.addHook("beforeColumnMove",(n,i,s,o)=>{this.columnAxisSyncer.storeMovesInformation(n,i,o)}),this.hot.addHook("afterRowMove",(n,i,s,o,a)=>{this.rowAxisSyncer.calculateAndSyncMoves(o,a)}),this.hot.addHook("afterColumnMove",(n,i,s,o,a)=>{this.columnAxisSyncer.calculateAndSyncMoves(o,a)}),this.hot.addHook("beforeColumnFreeze",(n,i)=>{this.columnAxisSyncer.storeMovesInformation([n],this.hot.getSettings().fixedColumnsStart,i)}),this.hot.addHook("afterColumnFreeze",(n,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.hot.addHook("beforeColumnUnfreeze",(n,i)=>{this.columnAxisSyncer.storeMovesInformation([n],this.hot.getSettings().fixedColumnsStart-1,i)}),this.hot.addHook("afterColumnUnfreeze",(n,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.addHook("afterCellMetaReset",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,j0e).call(r,...i)}),this.addHook("beforeUndo",()=>{this.indexSyncer.setPerformUndo(!0),this.engine.undo()}),this.addHook("beforeRedo",()=>{this.indexSyncer.setPerformRedo(!0),this.engine.redo()}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformUndo(!1)}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformRedo(!1)}),this.addHook("afterDetachChild",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,sme).call(r,...i)}),this.addHook("beforeAutofill",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return kt(Lt,r,G0e).call(r,...i)}),eh(bd,this).forEach(n=>{let[i,s]=n;return this.engine.on(i,s)}),super.enablePlugin()}}disablePlugin(){eh(bd,this).forEach(e=>{let[r,n]=e;return this.engine.off(r,n)}),vI(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const r=y0e(this.hot.getSettings());b0e(this.engine.getConfig(),r)&&this.engine.updateConfig(r);const n=this.hot.getSettings()[pn];if(Le(n)&&Le(n.sheetName)&&n.sheetName!==this.sheetName&&this.switchSheet(n.sheetName),!e.data&&this.sheetName===null){const i=this.hot.getSettings()[pn].sheetName;i&&this.engine.doesSheetExist(i)?this.switchSheet(this.sheetName):this.sheetName=this.addSheet(i??void 0,this.hot.getSourceDataArray())}super.updatePlugin(e)}destroy(){eh(bd,this).forEach(e=>{var r;let[n,i]=e;return(r=this.engine)===null||r===void 0?void 0:r.off(n,i)}),fl(bd,this,null),vI(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,r){if(Le(r)&&!rne(r))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 n=this.engine.addSheet(e??void 0);return r&&this.engine.setSheetContent(this.engine.getSheetId(n),r),n}catch(n){return Vt(n.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e)){Hy(`The sheet named \`${e}\` does not exist, switch aborted.`);return}this.sheetName=e;const r=this.engine.getSheetSerialized(this.sheetId);r.length>0&&this.hot.loadData(r,`${Ts(pn)}.switchSheet`)}getCellType(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;const i=this.hot.toPhysicalRow(e),s=this.hot.toPhysicalColumn(r);return i!==null&&s!==null?this.engine.getCellType({sheet:n,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r)}):"EMPTY"}isFormulaCellType(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;return this.engine.doesCellHaveFormula({sheet:n,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r)})}renderDependentSheets(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=new Set;e.forEach(i=>{var s;const o=i==null||(s=i.address)===null||s===void 0?void 0:s.sheet;o!==void 0&&(n.has(o)||n.add(o))}),wI(this.engine).forEach((i,s)=>{if((r||s!==this.sheetId)&&n.has(s)){var o;i.render(),(o=i.view)===null||o===void 0||o.adjustElementsSize()}})}validateDependentCells(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=s=>{var o;const{row:a,col:l,sheet:c}=(o=s?.address)!==null&&o!==void 0?o:{};return Le(c)?`${c}:${a}x${l}`:""},i=new Set(r.map(s=>n(s)));e.forEach(s=>{var o,a;const{row:l,col:c}=(o=s.address)!==null&&o!==void 0?o:{};if(Le(l)===!1||Le(c)===!1||l>=this.hot.countRows()||c>=this.hot.countCols())return;const u=s==null||(a=s.address)===null||a===void 0?void 0:a.sheet,h=n(s);if(u!==void 0&&!i.has(h)){const d=wI(this.engine).get(u);if(!d)return;d.validateCell(d.getDataAtCell(l,c),d.getCellMeta(l,c),()=>{})}})}syncChangeWithEngine(e,r,n){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(i)){Vt(`Not possible to set cell data at ${JSON.stringify(i)}`);return}const s=this.hot.getCellMeta(e,r);return uR(n,s.type)&&($H(n,s.dateFormat)?n=BH(n,s.dateFormat):O0e(n)===!1&&(n=`'${n}`)),this.engine.setCellContents(i,n)}}function z0e(t,e,r){const n=this.hot.propToCol(r);if(this.isFormulaCellType(e,n)){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n),sheet:this.sheetId},s=this.hot.getCellMeta(e,n);let o=this.engine.getCellValue(i);return s.type==="date"&&Hn(o)&&(o=VH(o,s.dateFormat)),typeof o=="object"&&o!==null?o.value:o}return t}function G0e(t,e,r){const{row:n,col:i}=e.getTopStartCorner(),{row:s,col:o}=e.getBottomEndCorner(),{row:a,col:l}=r.getTopStartCorner(),{row:c,col:u}=r.getBottomEndCorner(),h={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(n),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(i),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(c),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(u),sheet:this.sheetId}};if(this.engine.isItPossibleToSetCellContents(d)===!1)return!1;const f=this.engine.getFillRangeData(h,d),{row:g,col:m}=h.start,{row:p,col:S}=h.end,y=p-g+1,C=S-m+1;for(let E=0;E<f.length;E+=1)for(let A=0;A<f[E].length;A+=1){const O=f[E][A],T=E%y,W=A%C,I=this.hot.getCellMeta(T,W);uR(O,I.type)&&(O.startsWith("'")?f[E][A]=O.slice(1):this.isFormulaCellType(T,W,this.sheetId)===!1&&(f[E][A]=P0e(O,I.dateFormat)))}return f}function SI(t,e){(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes(Ts(pn))||fl(dR,this,Zt(this.hot.getSettings().data))}function j0e(){const t=this.hot.getSourceDataArray();let e=!1;t.forEach((r,n)=>{r.forEach((i,s)=>{const o=this.hot.getCellMeta(n,s),a=o.dateFormat;uR(i,o.type)&&(e=!0,$H(i,a)?t[n][s]=BH(i,a):this.isFormulaCellType(n,s)===!1&&(t[n][s]=`'${i}`))})}),e===!0&&(fl(la,this,!0),this.engine.setSheetContent(this.sheetId,t),fl(la,this,!1))}function xI(t,e){if(!(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes(Ts(pn)))if(this.sheetName=M0e(this.engine,this.hot.getSettings()[pn].sheetName),eh(dR,this))this.switchSheet(this.sheetName);else{const n=this.hot.getSourceDataArray();if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,n)){fl(la,this,!0);const i=this.engine.setSheetContent(this.sheetId,n);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(i),fl(la,this,!1)}}}function K0e(t,e,r,n){if(n!=="get"||eh(la,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t);if(i===null||e===null)return;if(!this.isFormulaCellType(i,e)&&this.getCellType(i,e)!=="ARRAY"){LH(r.value)&&(r.value=I0e(r.value));return}const o={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(e),sheet:this.sheetId};let a=this.engine.getCellValue(o),l=this.hot.getCellsMeta().find(u=>u.visualRow===i&&u.visualCol===e);l===void 0&&(l={}),l.type==="date"&&Hn(a)&&(a=VH(a,l.dateFormat));const c=typeof a=="object"&&a!==null?a.value:a;r.value=c}function X0e(t,e,r,n){if(n!=="get"||eh(la,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t),s=this.hot.propToCol(e);if(i===null||s===null||!this.isFormulaCellType(i,s)&&this.getCellType(i,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(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),sheet:this.sheetId};r.value=this.engine.getCellSerialized(l)}function yI(t,e){if(Eh(e))return;const r=[],n=[],i=this.engine.batch(()=>{t.forEach(s=>{let[o,a,,l]=s;const c=this.hot.propToCol(a),u=this.hot.toPhysicalRow(o),h=this.hot.toPhysicalColumn(c),d={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(c),sheet:this.sheetId};u!==null&&h!==null?this.syncChangeWithEngine(o,c,l):r.push([o,c,l]),n.push({address:d})})});r.length&&this.hot.addHookOnce("afterChange",()=>{const s=this.engine.batch(()=>{r.forEach(o=>{let[a,l,c]=o;this.syncChangeWithEngine(a,l,c)})});this.renderDependentSheets(s,!0)}),this.renderDependentSheets(i),this.validateDependentCells(i,n)}function q0e(t,e){if(Eh(e))return;const r=[],n=[];t.forEach(i=>{let[s,o,,a]=i;const l=this.hot.propToCol(o);if(!Hn(l))return;const c={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(s),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(c)){Vt(`Not possible to set source cell data at ${JSON.stringify(c)}`);return}n.push({address:c}),r.push(...this.engine.setCellContents(c,a))}),this.renderDependentSheets(r),this.validateDependentCells(r,n)}function Z0e(t,e){let r=this.rowAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countRows()&&(r=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddRows(this.sheetId,[r,e]))return!1}function J0e(t,e){let r=this.columnAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countCols()&&(r=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddColumns(this.sheetId,[r,e]))return!1}function Q0e(t,e,r){return this.rowAxisSyncer.setRemovedHfIndexes(r).every(s=>this.engine.isItPossibleToRemoveRows(this.sheetId,[s,1]))===!1?!1:void 0}function eme(t,e,r){return this.columnAxisSyncer.setRemovedHfIndexes(r).every(s=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[s,1]))===!1?!1:void 0}function tme(t,e,r){if(Eh(r))return;const n=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(n)}function rme(t,e,r){if(Eh(r))return;const n=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(n)}function nme(t,e,r,n){if(Eh(n))return;const i=this.rowAxisSyncer.getRemovedHfIndexes().sort((o,a)=>a-o),s=this.engine.batch(()=>{i.forEach(o=>{this.engine.removeRows(this.sheetId,[o,1])})});this.renderDependentSheets(s)}function ime(t,e,r,n){if(Eh(n))return;const i=this.columnAxisSyncer.getRemovedHfIndexes().sort((o,a)=>a-o),s=this.engine.batch(()=>{i.forEach(o=>{this.engine.removeColumns(this.sheetId,[o,1])})});this.renderDependentSheets(s)}function sme(t,e,r){var n;fl(la,this,!0);const i=this.hot.getSourceDataArray(r,0,r+(((n=e.__children)===null||n===void 0?void 0:n.length)||0),this.hot.countSourceCols());fl(la,this,!1),i.forEach((s,o)=>{s.forEach((a,l)=>{this.engine.setCellContents({col:l,row:r+o,sheet:this.sheetId},[[a]])})})}function ome(t){this.hot.runHooks("afterFormulasValuesUpdate",t)}function ame(t,e){this.hot.runHooks("afterNamedExpressionAdded",t,e)}function lme(t,e){this.hot.runHooks("afterNamedExpressionRemoved",t,e)}function cme(t){this.hot.runHooks("afterSheetAdded",t)}function ume(t,e){this.sheetName=e,this.hot.runHooks("afterSheetRenamed",t,e)}function hme(t,e){this.hot.runHooks("afterSheetRemoved",t,e)}function dme(t){return{key:"hidden_columns_hide",name(){const e=this.getSelectedLast();let r=0;if(Array.isArray(e)){const[,n,,i]=e;n-i!==0&&(r=1)}return this.getTranslatedPhrase(Jb,r)},callback(){const{from:e,to:r}=this.getSelectedRangeLast(),n=Math.max(Math.min(e.col,r.col),0),i=Math.max(e.col,r.col),s=[];for(let l=n;l<=i;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 fme(t){const e=[];return{key:"hidden_columns_show",name(){const r=e.length>1?1:0;return this.getTranslatedPhrase(Qb,r)},callback(){var r,n;if(e.length===0)return;let i=e[0],s=e[e.length-1];i=(r=this.columnIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&r!==void 0?r:0,s=(n=this.columnIndexMapper.getNearestNotHiddenIndex(s+1,1))!==null&&n!==void 0?n:this.countCols()-1,t.showColumns(e),this.render(),this.view.adjustElementsSize(),s-i+1===this.countCols()||this.selectColumns(i,s)},disabled:!1,hidden(){const r=wt(t.getHiddenColumns(),h=>this.toPhysicalColumn(h));if(!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())||r.length<1)return!0;e.length=0;const n=this.getSelectedRangeLast(),i=n.getTopStartCorner().col,s=n.getBottomEndCorner().col,o=this.columnIndexMapper,a=o.getRenderableFromVisualIndex(i),l=o.getRenderableFromVisualIndex(s),c=o.getNotTrimmedIndexes(),u=[];if(i!==s){const h=s-i+1,d=l-a+1;if(h>d){const f=c.slice(i,s+1);u.push(...f.filter(g=>r.includes(g)))}}else if(a===0&&a<i)u.push(...c.slice(0,i));else if(a===null)u.push(...c.slice(0,this.countCols()));else{const h=this.countCols()-1,d=o.getRenderableFromVisualIndex(o.getNearestNotHiddenIndex(h,-1));l===d&&h>s&&u.push(...c.slice(s+1))}return j(u,h=>{e.push(this.toVisualColumn(h))}),e.length===0}}}function gme(t,e){zH(t,e),e.add(t)}function bI(t,e,r){zH(t,e),e.set(t,r)}function zH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mi(t,e){return t.get($a(t,e))}function Ed(t,e,r){return t.set($a(t,e),r),r}function $a(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}He.getSingleton().register("beforeHideColumns");He.getSingleton().register("afterHideColumns");He.getSingleton().register("beforeUnhideColumns");He.getSingleton().register("afterUnhideColumns");const p1="hiddenColumns",mme=310;var uo=new WeakMap,Ys=new WeakMap,jl=new WeakSet;class pme extends Pt{constructor(){super(...arguments),gme(this,jl),bI(this,uo,{}),bI(this,Ys,null)}static get PLUGIN_KEY(){return p1}static get PLUGIN_PRIORITY(){return mme}isEnabled(){return!!this.hot.getSettings()[p1]}enablePlugin(){var e=this;if(this.enabled)return;const r=this.hot.getSettings()[p1];at(r)&&(Ed(uo,this,r),Zt(r.copyPasteEnabled)&&(r.copyPasteEnabled=!0)),Ed(Ys,this,new Pw),mi(Ys,this).addLocalHook("init",()=>$a(jl,this,yme).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,mi(Ys,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return $a(jl,e,xme).call(e,...i)}),this.addHook("afterGetCellMeta",(n,i,s)=>$a(jl,this,vme).call(this,n,i,s)),this.addHook("modifyColWidth",(n,i)=>$a(jl,this,wme).call(this,n,i),2),this.addHook("afterGetColHeader",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return $a(jl,e,Sme).call(e,...i)}),this.addHook("modifyCopyableRange",n=>$a(jl,this,Cme).call(this,n)),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),Ed(uo,this,{}),super.disablePlugin(),this.resetCellsMeta()}showColumns(e){const r=this.getHiddenColumns(),n=this.isValidConfig(e);let i=r;const s=mi(Ys,this).getValues().slice(),o=e.length>0;if(n&&o){const l=e.map(c=>this.hot.toPhysicalColumn(c));j(l,c=>{s[c]=!1}),i=Rn(s,(c,u,h)=>(u&&c.push(this.hot.toVisualColumn(h)),c),[])}this.hot.runHooks("beforeUnhideColumns",r,i,n&&o)!==!1&&(n&&o&&mi(Ys,this).setValues(s),this.hot.view.adjustElementsSize(),this.hot.runHooks("afterUnhideColumns",r,i,n&&o,n&&i.length<r.length))}showColumn(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.showColumns(r)}hideColumns(e){const r=this.getHiddenColumns(),n=this.isValidConfig(e);let i=r;n&&(i=Array.from(new Set(r.concat(e)))),this.hot.runHooks("beforeHideColumns",r,i,n)!==!1&&(n&&this.hot.batchExecution(()=>{j(e,o=>{mi(Ys,this).setValueAtIndex(this.hot.toPhysicalColumn(o),!0)})},!0),this.hot.runHooks("afterHideColumns",r,i,n,n&&i.length>r.length))}hideColumn(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.hideColumns(r)}getHiddenColumns(){return wt(mi(Ys,this).getHiddenIndexes(),e=>this.hot.toVisualColumn(e))}isHidden(e){return mi(Ys,this).getValueAtIndex(this.hot.toPhysicalColumn(e))||!1}isValidConfig(e){const r=this.hot.countCols();return Array.isArray(e)&&e.length>0?e.every(n=>Number.isInteger(n)&&n>=0&&n<r):!1}resetCellsMeta(){j(this.hot.getCellsMeta(),e=>{e&&(e.skipColumnOnPaste=!1)})}destroy(){Ed(uo,this,null),Ed(Ys,this,null),super.destroy()}}function wme(t,e){if(this.isHidden(e))return 0;if(mi(uo,this).indicators&&(this.isHidden(e+1)||this.isHidden(e-1))&&typeof t=="number"&&this.hot.hasColHeaders())return t+15}function vme(t,e,r){if(mi(uo,this).copyPasteEnabled===!1&&this.isHidden(e)&&(r.skipColumnOnPaste=!0),this.isHidden(e-1))r.className=r.className||"",r.className.indexOf("afterHiddenColumn")===-1&&(r.className+=" afterHiddenColumn");else if(r.className){const n=r.className.split(" ");if(n.length>0){const i=n.indexOf("afterHiddenColumn");i>-1&&n.splice(i,1),r.className=n.join(" ")}}}function Cme(t){if(mi(uo,this).copyPasteEnabled)return t;const e=[],r=(n,i,s,o)=>{e.push({startRow:n,endRow:i,startCol:s,endCol:o})};return j(t,n=>{let i=!0,s=0;Ue(n.startCol,n.endCol,o=>{this.isHidden(o)?(i||r(n.startRow,n.endRow,s,o-1),i=!0):(i&&(s=o),o===n.endCol&&r(n.startRow,n.endRow,s,o),i=!1)})}),e}function Sme(t,e){if(!mi(uo,this).indicators||t<0)return;const r=[];t>=1&&this.isHidden(t-1)&&r.push("afterHiddenColumn"),t<this.hot.countCols()-1&&this.isHidden(t+1)&&r.push("beforeHiddenColumn"),Re(e,r)}function xme(t){t.items.push({name:ht},dme(this),fme(this))}function yme(){Array.isArray(mi(uo,this).columns)&&this.hideColumns(mi(uo,this).columns)}function bme(t){return{key:"hidden_rows_hide",name(){const e=this.getSelectedLast();let r=0;if(Array.isArray(e)){const[n,,i]=e;n-i!==0&&(r=1)}return this.getTranslatedPhrase(eE,r)},callback(){const{from:e,to:r}=this.getSelectedRangeLast(),n=Math.max(Math.min(e.row,r.row),0),i=Math.max(e.row,r.row),s=[];for(let l=n;l<=i;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 Eme(t){const e=[];return{key:"hidden_rows_show",name(){const r=e.length>1?1:0;return this.getTranslatedPhrase(tE,r)},callback(){var r,n;if(e.length===0)return;let i=e[0],s=e[e.length-1];i=(r=this.rowIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&r!==void 0?r:0,s=(n=this.rowIndexMapper.getNearestNotHiddenIndex(s+1,1))!==null&&n!==void 0?n:this.countRows()-1,t.showRows(e),this.render(),this.view.adjustElementsSize(),s-i+1===this.countRows()||this.selectRows(i,s)},disabled:!1,hidden(){const r=wt(t.getHiddenRows(),h=>this.toPhysicalRow(h));if(!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())||r.length<1)return!0;e.length=0;const n=this.getSelectedRangeLast(),i=n.getTopStartCorner().row,s=n.getBottomEndCorner().row,o=this.rowIndexMapper,a=o.getRenderableFromVisualIndex(i),l=o.getRenderableFromVisualIndex(s),c=o.getNotTrimmedIndexes(),u=[];if(i!==s){const h=s-i+1,d=l-a+1;if(h>d){const f=c.slice(i,s+1);u.push(...f.filter(g=>r.includes(g)))}}else if(a===0&&a<i)u.push(...c.slice(0,i));else if(a===null)u.push(...c.slice(0,this.countRows()));else{const h=this.countRows()-1,d=o.getRenderableFromVisualIndex(o.getNearestNotHiddenIndex(h,-1));l===d&&h>s&&u.push(...c.slice(s+1))}return j(u,h=>{e.push(this.toVisualRow(h))}),e.length===0}}}function Rme(t,e){GH(t,e),e.add(t)}function EI(t,e,r){GH(t,e),e.set(t,r)}function GH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Li(t,e){return t.get(Ba(t,e))}function Rd(t,e,r){return t.set(Ba(t,e),r),r}function Ba(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}He.getSingleton().register("beforeHideRows");He.getSingleton().register("afterHideRows");He.getSingleton().register("beforeUnhideRows");He.getSingleton().register("afterUnhideRows");const w1="hiddenRows",Tme=320;var Jo=new WeakMap,zs=new WeakMap,Kl=new WeakSet;class _me extends Pt{constructor(){super(...arguments),Rme(this,Kl),EI(this,Jo,{}),EI(this,zs,null)}static get PLUGIN_KEY(){return w1}static get PLUGIN_PRIORITY(){return Tme}isEnabled(){return!!this.hot.getSettings()[w1]}enablePlugin(){var e=this;if(this.enabled)return;const r=this.hot.getSettings()[w1];at(r)&&(Rd(Jo,this,r),Zt(r.copyPasteEnabled)&&(r.copyPasteEnabled=!0)),Rd(zs,this,new Pw),Li(zs,this).addLocalHook("init",()=>Ba(Kl,this,Dme).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,Li(zs,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Ba(Kl,e,Pme).call(e,...i)}),this.addHook("afterGetCellMeta",(n,i,s)=>Ba(Kl,this,Mme).call(this,n,i,s)),this.addHook("modifyRowHeight",(n,i)=>Ba(Kl,this,Ame).call(this,n,i)),this.addHook("afterGetRowHeader",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Ba(Kl,e,Ome).call(e,...i)}),this.addHook("modifyCopyableRange",n=>Ba(Kl,this,Ime).call(this,n)),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap(this.pluginName),Rd(Jo,this,{}),super.disablePlugin(),this.resetCellsMeta()}showRows(e){const r=this.getHiddenRows(),n=this.isValidConfig(e);let i=r;const s=Li(zs,this).getValues().slice(),o=e.length>0;if(n&&o){const l=e.map(c=>this.hot.toPhysicalRow(c));j(l,c=>{s[c]=!1}),i=Rn(s,(c,u,h)=>(u&&c.push(this.hot.toVisualRow(h)),c),[])}this.hot.runHooks("beforeUnhideRows",r,i,n&&o)!==!1&&(n&&o&&Li(zs,this).setValues(s),this.hot.runHooks("afterUnhideRows",r,i,n&&o,n&&i.length<r.length))}showRow(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.showRows(r)}hideRows(e){const r=this.getHiddenRows(),n=this.isValidConfig(e);let i=r;n&&(i=Array.from(new Set(r.concat(e)))),this.hot.runHooks("beforeHideRows",r,i,n)!==!1&&(n&&this.hot.batchExecution(()=>{j(e,o=>{Li(zs,this).setValueAtIndex(this.hot.toPhysicalRow(o),!0)})},!0),this.hot.runHooks("afterHideRows",r,i,n,n&&i.length>r.length))}hideRow(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.hideRows(r)}getHiddenRows(){return wt(Li(zs,this).getHiddenIndexes(),e=>this.hot.toVisualRow(e))}isHidden(e){return Li(zs,this).getValueAtIndex(this.hot.toPhysicalRow(e))||!1}isValidConfig(e){const r=this.hot.countRows();return Array.isArray(e)&&e.length>0?e.every(n=>Number.isInteger(n)&&n>=0&&n<r):!1}resetCellsMeta(){j(this.hot.getCellsMeta(),e=>{e&&(e.skipRowOnPaste=!1)})}destroy(){Rd(Jo,this,null),Rd(zs,this,null),super.destroy()}}function Ame(t,e){return this.isHidden(e)?0:t}function Mme(t,e,r){if(Li(Jo,this).copyPasteEnabled===!1&&this.isHidden(t)&&(r.skipRowOnPaste=!0),this.isHidden(t-1))r.className=r.className||"",r.className.indexOf("afterHiddenRow")===-1&&(r.className+=" afterHiddenRow");else if(r.className){const n=r.className.split(" ");if(n.length>0){const i=n.indexOf("afterHiddenRow");i>-1&&n.splice(i,1),r.className=n.join(" ")}}}function Ime(t){if(Li(Jo,this).copyPasteEnabled)return t;const e=[],r=(n,i,s,o)=>{e.push({startRow:n,endRow:i,startCol:s,endCol:o})};return j(t,n=>{let i=!0,s=0;Ue(n.startRow,n.endRow,o=>{this.isHidden(o)?(i||r(s,o-1,n.startCol,n.endCol),i=!0):(i&&(s=o),o===n.endRow&&r(s,o,n.startCol,n.endCol),i=!1)})}),e}function Ome(t,e){if(!Li(Jo,this).indicators||t<0)return;const r=[];t>=1&&this.isHidden(t-1)&&r.push("afterHiddenRow"),t<this.hot.countRows()-1&&this.isHidden(t+1)&&r.push("beforeHiddenRow"),Re(e,r)}function Pme(t){t.items.push({name:ht},bme(this),Eme(this))}function Dme(){Array.isArray(Li(Jo,this).rows)&&this.hideRows(Li(Jo,this).rows)}function kme(t){return{key:"freeze_column",name(){return this.getTranslatedPhrase(Ab)},callback(e,r){const[{start:{col:n}}]=r;t.freezeColumn(n),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let r=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col<=this.getSettings().fixedColumnsStart-1)&&(r=!0),r}}}function Nme(t){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(Mb)},callback(e,r){const[{start:{col:n}}]=r;t.unfreezeColumn(n),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let r=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col>=this.getSettings().fixedColumnsStart)&&(r=!0),r}}}function Hme(t,e){jH(t,e),e.add(t)}function Fme(t,e,r){jH(t,e),e.set(t,r)}function jH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ex(t,e){return t.get(Fp(t,e))}function v1(t,e,r){return t.set(Fp(t,e),r),r}function Fp(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}He.getSingleton().register("beforeColumnFreeze");He.getSingleton().register("afterColumnFreeze");He.getSingleton().register("beforeColumnUnfreeze");He.getSingleton().register("afterColumnUnfreeze");const RI="manualColumnFreeze",Lme=110;var nc=new WeakMap,C1=new WeakSet;class $me extends Pt{constructor(){super(...arguments),Hme(this,C1),Fme(this,nc,!1)}static get PLUGIN_KEY(){return RI}static get PLUGIN_PRIORITY(){return Lme}isEnabled(){return!!this.hot.getSettings()[RI]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>Fp(C1,this,Bme).call(this,e)),this.addHook("beforeColumnMove",(e,r)=>Fp(C1,this,Vme).call(this,e,r)),super.enablePlugin())}disablePlugin(){v1(nc,this,!1),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}freezeColumn(e){const r=this.hot.getSettings(),n=r.fixedColumnsStart<this.hot.countCols()&&e>r.fixedColumnsStart-1;ex(nc,this)||v1(nc,this,!0),this.hot.runHooks("beforeColumnFreeze",e,n)!==!1&&(n&&(this.hot.columnIndexMapper.moveIndexes(e,r.fixedColumnsStart),r._fixedColumnsStart+=1),this.hot.runHooks("afterColumnFreeze",e,n))}unfreezeColumn(e){const r=this.hot.getSettings(),n=r.fixedColumnsStart>0&&e<=r.fixedColumnsStart-1;ex(nc,this)||v1(nc,this,!0),this.hot.runHooks("beforeColumnUnfreeze",e,n)!==!1&&(n&&(r._fixedColumnsStart-=1,this.hot.columnIndexMapper.moveIndexes(e,r.fixedColumnsStart)),this.hot.runHooks("afterColumnUnfreeze",e,n))}}function Bme(t){t.items.push({name:"---------"},kme(this),Nme(this))}function Vme(t,e){if(ex(nc,this)){const r=this.hot.getSettings().fixedColumnsStart;if(e<r||t.some(n=>n<r))return!1}}function om(t,e,r){return e=Wme(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wme(t){var e=Ume(t,"string");return typeof e=="symbol"?e:e+""}function Ume(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const S1=0,TI=1,_I=2,Eu="px";let KH=class{constructor(e){om(this,"hot",void 0),om(this,"_element",null),om(this,"state",S1),om(this,"inlineProperty",void 0),this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}appendTo(e){e.appendChild(this._element),this.state=_I}build(){this.state===S1&&(this._element=this.hot.rootDocument.createElement("div"),this.state=TI)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=S1}isAppended(){return this.state===_I}isBuilt(){return this.state>=TI}setPosition(e,r){Hn(e)&&(this._element.style.top=e+Eu),Hn(r)&&(this._element.style[this.inlineProperty]=r+Eu)}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,r){Hn(e)&&(this._element.style.width=e+Eu),Hn(r)&&(this._element.style.height=r+Eu)}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,r){Hn(e)&&(this._element.style.marginTop=e+Eu),Hn(r)&&(this._element.style[`margin${Ts(this.inlineProperty)}`]=r+Eu)}getOffset(){const e=this._element.style,r=`margin${Ts(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[r]?parseInt(e[r],10):0}}};const Yme="ht__manualColumnMove--backlight";let zme=class extends KH{build(){super.build(),Re(this._element,Yme)}};const Gme="ht__manualColumnMove--guideline";let jme=class extends KH{build(){super.build(),Re(this._element,Gme)}};function Kme(t,e){XH(t,e),e.add(t)}function ss(t,e,r){XH(t,e),e.set(t,r)}function XH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ri(t,e,r){return t.set(Va(t,e),r),r}function We(t,e){return t.get(Va(t,e))}function Va(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}He.getSingleton().register("beforeColumnMove");He.getSingleton().register("afterColumnMove");const x1="manualColumnMove",Xme=120,AI="ht__manualColumnMove",Lp="show-ui",tx="on-moving--columns",rx="after-selection--columns";var Dn=new WeakMap,Ga=new WeakMap,Qo=new WeakMap,Gm=new WeakMap,tl=new WeakMap,On=new WeakMap,am=new WeakMap,Di=new WeakMap,Nu=new WeakMap,$p=new WeakMap,uf=new WeakMap,Xl=new WeakSet;class qme extends Pt{constructor(){super(...arguments),Kme(this,Xl),ss(this,Dn,new zme(this.hot)),ss(this,Ga,new jme(this.hot)),ss(this,Qo,[]),ss(this,Gm,0),ss(this,tl,!1),ss(this,On,{}),ss(this,am,void 0),ss(this,Di,void 0),ss(this,Nu,void 0),ss(this,$p,void 0),ss(this,uf,void 0)}static get PLUGIN_KEY(){return x1}static get PLUGIN_PRIORITY(){return Xme}isEnabled(){return!!this.hot.getSettings()[x1]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Va(Xl,e,Zme).call(e,...n)}),this.addHook("beforeOnCellMouseOver",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Va(Xl,e,Qme).call(e,...n)}),this.addHook("afterScrollVertically",()=>Va(Xl,this,tpe).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Va(Xl,e,rpe).call(e,...n)}),this.buildPluginUI(),this.registerEvents(),Re(this.hot.rootElement,AI),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){rt(this.hot.rootElement,AI),this.unregisterEvents(),We(Dn,this).destroy(),We(Ga,this).destroy(),super.disablePlugin()}moveColumn(e,r){return this.moveColumns([e],r)}moveColumns(e,r){const n=We(am,this),i=this.isMovePossible(e,r),s=this.hot.runHooks("beforeColumnMove",e,r,n,i);if(ri(am,this,void 0),s===!1)return;i&&this.hot.columnIndexMapper.moveIndexes(e,r);const o=i&&this.isColumnOrderChanged(e,r);return this.hot.runHooks("afterColumnMove",e,r,n,i,o),o}dragColumn(e,r){return this.dragColumns([e],r)}dragColumns(e,r){const n=this.countFinalIndex(e,r);return ri(am,this,r),this.moveColumns(e,n)}isMovePossible(e,r){const n=this.hot.columnIndexMapper.getNotTrimmedIndexesLength(),i=e.length+r>n,s=r<0,o=e.some(l=>l<0),a=e.some(l=>l>=n);return!(i||s||o||a)}isColumnOrderChanged(e,r){return e.some((n,i)=>n-i!==r)}countFinalIndex(e,r){const n=Rn(e,(i,s)=>(s<r&&(i+=1),i),0);return r-n}getColumnsWidth(e,r){const n=this.hot.columnIndexMapper;let i=0;for(let s=e;s<=r;s+=1){const o=n.getRenderableFromVisualIndex(s);s<0?i+=this.hot.view._wt.wtViewport.getRowHeaderWidth()||0:o!==null&&(i+=this.hot.view._wt.wtTable.getStretchedColumnWidth(o)||0)}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[x1];if(Array.isArray(e))this.moveColumns(e,0);else if(e!==void 0){const r=this.persistentStateLoad();r.length&&this.moveColumns(r,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,r){const n=[];return Ue(e,r,i=>{n.push(i)}),n}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(We(Di,this))&&e>0&&this.hot.scrollViewportTo({col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(e-1,-1)});const r=this.hot.view._wt.wtTable,n=this.hot.view._wt.wtOverlays.scrollableElement,i=typeof n.scrollX=="number"?n.scrollX:n.scrollLeft;let s=this.hot.view.THEAD.offsetLeft+this.getColumnsWidth(0,We(Di,this)-1);const o=r.hider.offsetWidth,a=r.TBODY.offsetLeft,l=We(Dn,this).getOffset().start,c=We(Dn,this).getSize().width;let u=0,h=0;if(this.hot.isRtl()){const g=this.hot.rootWindow,m=Bt(this.hot.rootElement),p=g.innerWidth-We(Nu,this)-m;h=g.innerWidth-We(On,this).eventPageX-p-(n.scrollX===void 0?i:0)}else h=We(On,this).eventPageX-(We(Nu,this)-(n.scrollX===void 0?i:0));if(We($p,this)&&(u=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(We(Di,this))&&(s+=i),s+=u,We(Di,this)<0)We(uf,this)>0?We(On,this).col=0:We(On,this).col=e>0?e-1:e;else if(We(On,this).TD.offsetWidth/2+s<=h){const g=We(Di,this)>=We(Gm,this)?We(Gm,this)-1:We(Di,this);We(On,this).col=g+1,s+=We(On,this).TD.offsetWidth}else We(On,this).col=We(Di,this);let d=h,f=s;h+c+l>=o?d=o-c-l:h+l<a+u&&(d=a+u+Math.abs(l)),s>=o-1?f=o-1:f===0?f=1:n.scrollX!==void 0&&We(Di,this)<We(uf,this)&&(f-=We(Nu,this)<=n.scrollX?We(Nu,this):0),We(Dn,this).setPosition(null,d),We(Ga,this).setPosition(null,f)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",r=>Va(Xl,this,Jme).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>Va(Xl,this,epe).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){We(Dn,this).build(),We(Ga,this).build()}destroy(){We(Dn,this).destroy(),We(Ga,this).destroy(),super.destroy()}}function Zme(t,e,r,n){const i=this.hot.view._wt.wtTable,s=this.hot.selection.isSelectedByColumnHeader(),o=this.hot.getSelectedRangeLast(),a=Ze(t.target,"sortAction");if(!o||!s||We(tl,this)||t.button!==0||a){ri(tl,this,!1),We(Qo,this).length=0,rt(this.hot.rootElement,[tx,Lp]);return}const l=We(Ga,this).isBuilt()&&!We(Ga,this).isAppended(),c=We(Dn,this).isBuilt()&&!We(Dn,this).isAppended();l&&c&&(We(Ga,this).appendTo(i.hider),We(Dn,this).appendTo(i.hider));const{from:u,to:h}=o,d=Math.min(u.col,h.col),f=Math.max(u.col,h.col);if(e.row<0&&e.col>=d&&e.col<=f){n.column=!0,ri(tl,this,!0);const g=r.firstChild?kJ(t,r.firstChild).x:t.offsetX;We(On,this).eventPageX=t.pageX,ri(Di,this,e.col),We(On,this).TD=r,We(On,this).col=e.col,ri(Qo,this,this.prepareColumnsToMoving(d,f)),ri($p,this,!!this.hot.getSettings().rowHeaders),ri(Gm,this,this.hot.countCols()),ri(uf,this,this.hot.getSettings().fixedColumnsStart),ri(Nu,this,Zr(this.hot.rootElement).left);const m=We($p,this)?-1:0,p=i.holder.scrollTop+i.getColumnHeaderHeight(0)+1,S=e.col<We(uf,this),y=this.hot.view._wt.wtOverlays.inlineStartOverlay.getOverlayOffset(),C=Math.abs(g-(this.hot.isRtl()?r.offsetWidth:0)),E=this.getColumnsWidth(d,e.col-1)+C,A=this.getColumnsWidth(m,d-1)+(S?y:0)+E;We(Dn,this).setPosition(p,A),We(Dn,this).setSize(this.getColumnsWidth(d,f),i.hider.offsetHeight-p),We(Dn,this).setOffset(null,-E),Re(this.hot.rootElement,tx)}else rt(this.hot.rootElement,rx),ri(tl,this,!1),We(Qo,this).length=0}function Jme(t){We(tl,this)&&(We(On,this).eventPageX=t.pageX,this.refreshPositions())}function Qme(t,e,r,n){!this.hot.getSelectedRangeLast()||!We(tl,this)||(We(Qo,this).indexOf(e.col)>-1?rt(this.hot.rootElement,Lp):Re(this.hot.rootElement,Lp),n.row=!0,n.column=!0,n.cell=!0,ri(Di,this,e.col),We(On,this).TD=r)}function epe(){const t=We(On,this).col,e=We(Qo,this).length;if(ri(Di,this,void 0),ri(tl,this,!1),rt(this.hot.rootElement,[tx,Lp,rx]),this.hot.selection.isSelectedByColumnHeader()&&Re(this.hot.rootElement,rx),e<1||t===void 0)return;const r=We(Qo,this)[0],n=this.hot.toPhysicalColumn(r),i=this.dragColumns(We(Qo,this),t);if(We(Qo,this).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const s=this.hot.toVisualColumn(n),o=s+e-1;this.hot.selectColumns(s,o)}}function tpe(){const t=this.hot.view._wt.wtTable,e=t.getColumnHeaderHeight(0)+1,r=t.holder.scrollTop,n=e+r;We(Dn,this).setPosition(n),We(Dn,this).setSize(null,t.hider.offsetHeight-n)}function rpe(){this.moveBySettingsOrLoad()}function npe(t,e){qH(t,e),e.add(t)}function hn(t,e,r){qH(t,e),e.set(t,r)}function qH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Sr(t,e,r){return t.set(fs(t,e),r),r}function Ne(t,e){return t.get(fs(t,e))}function fs(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Bp="manualColumnResize",ipe=130,MI="manualColumnWidths";var Yo=new WeakMap,lm=new WeakMap,di=new WeakMap,Vp=new WeakMap,ao=new WeakMap,spe=new WeakMap,th=new WeakMap,cm=new WeakMap,qn=new WeakMap,$o=new WeakMap,Ac=new WeakMap,Wp=new WeakMap,hf=new WeakMap,df=new WeakMap,gi=new WeakMap,ff=new WeakMap,Gs=new WeakSet;class ope extends Pt{static get PLUGIN_KEY(){return Bp}static get PLUGIN_PRIORITY(){return ipe}constructor(e){super(e),npe(this,Gs),hn(this,Yo,null),hn(this,lm,null),hn(this,di,[]),hn(this,Vp,null),hn(this,ao,null),hn(this,spe,null),hn(this,th,null),hn(this,cm,null),hn(this,qn,this.hot.rootDocument.createElement("DIV")),hn(this,$o,this.hot.rootDocument.createElement("DIV")),hn(this,Ac,null),hn(this,Wp,!1),hn(this,hf,0),hn(this,df,null),hn(this,gi,void 0),hn(this,ff,void 0),Re(Ne(qn,this),"manualColumnResizer"),Re(Ne($o,this),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Bp]}enablePlugin(){this.enabled||(Sr(gi,this,new vl),Ne(gi,this).addLocalHook("init",()=>fs(Gs,this,ape).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,Ne(gi,this)),this.addHook("modifyColWidth",(e,r)=>fs(Gs,this,fpe).call(this,e,r),1),this.addHook("beforeStretchingColumnWidth",(e,r)=>fs(Gs,this,gpe).call(this,e,r)),this.addHook("beforeColumnResize",(e,r,n)=>fs(Gs,this,mpe).call(this,e,r,n)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){Sr(ff,this,Ne(gi,this).getValues()),this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualColumnWidths(){this.hot.runHooks("persistentStateSave",MI,Ne(gi,this).getValues())}loadManualColumnWidths(){const e={};return this.hot.runHooks("persistentStateLoad",MI,e),e.value}setManualSize(e,r){const n=Math.max(r,20),i=this.hot.toPhysicalColumn(e);return Ne(gi,this).setValueAtIndex(i,n),n}clearManualSize(e){const r=this.hot.toPhysicalColumn(e);Ne(gi,this).setValueAtIndex(r,null)}setupHandlePosition(e){if(!e.parentNode)return;Sr(Yo,this,e);const{_wt:r}=this.hot.view,n=r.wtTable.getCoords(Ne(Yo,this)),i=n.col;if(i<0)return;const s=pr(Ne(Yo,this)),o=Ne(Yo,this).getBoundingClientRect(),a=i<r.getSetting("fixedColumnsStart");let l;a&&(l=r.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(Ne(Yo,this),n.row,n.col)),l||(l=r.wtOverlays.topOverlay.getRelativeCellPosition(Ne(Yo,this),n.row,n.col)),Sr(lm,this,this.hot.columnIndexMapper.getVisualFromRenderableIndex(i)),Sr(di,this,[]);const c=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByColumnHeader();if(this.hot.selection.isSelected()&&c){const u=this.hot.getSelectedRange();j(u,h=>{const d=h.getTopStartCorner().col,f=h.getBottomEndCorner().col;Ue(d,f,g=>{Ne(di,this).includes(g)||Ne(di,this).push(g)})})}Ne(di,this).includes(Ne(lm,this))||Sr(di,this,[Ne(lm,this)]),Sr(cm,this,l.start-6),Sr(th,this,parseInt(o.width,10)),Ne(qn,this).style.top=`${l.top}px`,Ne(qn,this).style[this.inlineDir]=`${Ne(cm,this)+Ne(th,this)}px`,Ne(qn,this).style.height=`${s}px`,this.hot.rootElement.appendChild(Ne(qn,this))}refreshHandlePosition(){Ne(qn,this).style[this.inlineDir]=`${Ne(cm,this)+Ne(Vp,this)}px`}setupGuidePosition(){const e=parseInt(pr(Ne(qn,this)),10),r=parseInt(Ne(qn,this).style.top,10)+e,n=parseInt(this.hot.view.maximumVisibleElementHeight(0),10);Re(Ne(qn,this),"active"),Re(Ne($o,this),"active"),Ne($o,this).style.top=`${r}px`,this.refreshGuidePosition(),Ne($o,this).style.height=`${n-e}px`,this.hot.rootElement.appendChild(Ne($o,this))}refreshGuidePosition(){Ne($o,this).style[this.inlineDir]=Ne(qn,this).style[this.inlineDir]}hideHandleAndGuide(){rt(Ne(qn,this),"active"),rt(Ne($o,this),"active")}checkIfColumnHeader(e){const r=Sc(e,["THEAD"],this.hot.rootElement),{topOverlay:n,topInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;return[n.clone.wtTable.THEAD,i.clone.wtTable.THEAD].includes(r)}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()},r=(n,i)=>{const s=this.hot.runHooks("beforeColumnResize",Ne(ao,this),n,!0);s!==void 0&&Sr(ao,this,s),this.hot.getSettings().stretchH==="all"?this.clearManualSize(n):this.setManualSize(n,Ne(ao,this)),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",Ne(ao,this),n,!0),i&&e()};Ne(hf,this)>=2&&(Ne(di,this).length>1?(j(Ne(di,this),i=>{r(i)}),e()):j(Ne(di,this),i=>{r(i,!0)})),Sr(hf,this,0),Sr(df,this,null)}bindEvents(){const{rootWindow:e,rootElement:r}=this.hot;this.eventManager.addEventListener(r,"mouseover",n=>fs(Gs,this,lpe).call(this,n)),this.eventManager.addEventListener(r,"mousedown",n=>fs(Gs,this,cpe).call(this,n)),this.eventManager.addEventListener(e,"mousemove",n=>fs(Gs,this,upe).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>fs(Gs,this,hpe).call(this)),this.eventManager.addEventListener(Ne(qn,this),"contextmenu",()=>fs(Gs,this,dpe).call(this))}destroy(){super.destroy()}}function ape(){const t=this.hot.getSettings()[Bp],e=this.loadManualColumnWidths();typeof e<"u"?this.hot.batchExecution(()=>{e.forEach((r,n)=>{Ne(gi,this).setValueAtIndex(n,r)})},!0):Array.isArray(t)?(this.hot.batchExecution(()=>{t.forEach((r,n)=>{Ne(gi,this).setValueAtIndex(n,r)})},!0),Sr(ff,this,t)):t===!0&&Array.isArray(Ne(ff,this))&&this.hot.batchExecution(()=>{Ne(ff,this).forEach((r,n)=>{Ne(gi,this).setValueAtIndex(n,r)})},!0)}function lpe(t){if(!Kk(t.target)&&Ne(Wp,this)!==!0&&this.checkIfColumnHeader(t.target)){const e=this.getClosestTHParent(t.target);if(!e)return;const r=e.getAttribute("colspan");e&&(r===null||r==="1")&&(Ne(Ac,this)||this.setupHandlePosition(e))}}function cpe(t){t.target.parentNode===this.hot.rootElement&&Ze(t.target,"manualColumnResizer")&&(this.setupHandlePosition(Ne(Yo,this)),this.setupGuidePosition(),Sr(Ac,this,!0),Ne(df,this)===null&&(Sr(df,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(Ne(df,this))),Sr(hf,this,Ne(hf,this)+1),this.startX=t.pageX,Sr(ao,this,Ne(th,this)))}function upe(t){if(Ne(Ac,this)){const e=(t.pageX-this.startX)*this.hot.getDirectionFactor();Sr(Vp,this,Ne(th,this)+e),j(Ne(di,this),r=>{Sr(ao,this,this.setManualSize(r,Ne(Vp,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function hpe(){const t=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize()},e=(r,n)=>{this.hot.runHooks("beforeColumnResize",Ne(ao,this),r,!1),n&&t(),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",Ne(ao,this),r,!1)};Ne(Ac,this)&&(this.hideHandleAndGuide(),Sr(Ac,this,!1),Ne(ao,this)!==Ne(th,this)&&(Ne(di,this).length>1?(j(Ne(di,this),n=>{e(n)}),t()):j(Ne(di,this),n=>{e(n,!0)})),this.setupHandlePosition(Ne(Yo,this)))}function dpe(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(Ne(qn,this)),this.hot.rootElement.removeChild(Ne($o,this)),Sr(Ac,this,!1),Sr(Wp,this,!0),this.hot._registerImmediate(()=>{Sr(Wp,this,!1)})}function fpe(t,e){let r=t;if(this.enabled){const n=this.hot.toPhysicalColumn(e),i=Ne(gi,this).getValueAtIndex(n);this.hot.getSettings()[Bp]&&i&&(r=i)}return r}function gpe(t,e){let r=Ne(gi,this).getValueAtIndex(e);return r===null&&(r=t),r}function mpe(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}function y1(t,e,r){return e=ppe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ppe(t){var e=wpe(t,"string");return typeof e=="symbol"?e:e+""}function wpe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const b1=0,II=1,OI=2,Ru="px";let ZH=class{constructor(e){y1(this,"hot",void 0),y1(this,"_element",null),y1(this,"state",b1),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=OI}build(){this.state===b1&&(this._element=this.hot.rootDocument.createElement("div"),this.state=II)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=b1}isAppended(){return this.state===OI}isBuilt(){return this.state>=II}setPosition(e,r){e!==void 0&&(this._element.style.top=e+Ru),r!==void 0&&(this._element.style.left=r+Ru)}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,r){e&&(this._element.style.width=e+Ru),r&&(this._element.style.height=r+Ru)}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,r){e&&(this._element.style.marginTop=e+Ru),r&&(this._element.style.marginLeft=r+Ru)}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 vpe="ht__manualRowMove--backlight";class Cpe extends ZH{build(){super.build(),Re(this._element,vpe)}}const Spe="ht__manualRowMove--guideline";class xpe extends ZH{build(){super.build(),Re(this._element,Spe)}}function ype(t,e){JH(t,e),e.add(t)}function Tu(t,e,r){JH(t,e),e.set(t,r)}function JH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hc(t,e,r){return t.set(Wa(t,e),r),r}function tt(t,e){return t.get(Wa(t,e))}function Wa(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}He.getSingleton().register("beforeRowMove");He.getSingleton().register("afterRowMove");const E1="manualRowMove",bpe=140,PI="ht__manualRowMove",Up="show-ui",nx="on-moving--rows",ix="after-selection--rows";var kn=new WeakMap,ja=new WeakMap,ea=new WeakMap,rl=new WeakMap,ni=new WeakMap,um=new WeakMap,ql=new WeakSet;class Epe extends Pt{constructor(){super(...arguments),ype(this,ql),Tu(this,kn,new Cpe(this.hot)),Tu(this,ja,new xpe(this.hot)),Tu(this,ea,[]),Tu(this,rl,void 0),Tu(this,ni,{}),Tu(this,um,void 0)}static get PLUGIN_KEY(){return E1}static get PLUGIN_PRIORITY(){return bpe}isEnabled(){return!!this.hot.getSettings()[E1]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Wa(ql,e,Rpe).call(e,...n)}),this.addHook("beforeOnCellMouseOver",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Wa(ql,e,_pe).call(e,...n)}),this.addHook("afterScrollHorizontally",()=>Wa(ql,this,Mpe).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Wa(ql,e,Ipe).call(e,...n)}),this.buildPluginUI(),this.registerEvents(),Re(this.hot.rootElement,PI),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){rt(this.hot.rootElement,PI),this.unregisterEvents(),tt(kn,this).destroy(),tt(ja,this).destroy(),super.disablePlugin()}moveRow(e,r){return this.moveRows([e],r)}moveRows(e,r){const n=tt(um,this),i=this.isMovePossible(e,r),s=this.hot.runHooks("beforeRowMove",e,r,n,i);if(hc(um,this,void 0),s===!1)return;i&&this.hot.rowIndexMapper.moveIndexes(e,r);const o=i&&this.isRowOrderChanged(e,r);return this.hot.runHooks("afterRowMove",e,r,n,i,o),o}dragRow(e,r){return this.dragRows([e],r)}dragRows(e,r){const n=this.countFinalIndex(e,r);return hc(um,this,r),this.moveRows(e,n)}isMovePossible(e,r){const n=this.hot.rowIndexMapper.getNotTrimmedIndexesLength(),i=e.length+r>n,s=r<0,o=e.some(l=>l<0),a=e.some(l=>l>=n);return!(i||s||o||a)}isRowOrderChanged(e,r){return e.some((n,i)=>n-i!==r)}countFinalIndex(e,r){const n=Rn(e,(i,s)=>(s<r&&(i+=1),i),0);return r-n}getRowsHeight(e,r){const n=this.hot.rowIndexMapper;let i=0;for(let s=e;s<=r;s++){const o=n.getRenderableFromVisualIndex(s);o!==null&&(i+=this.hot.view._wt.wtTable.getRowHeight(o)||23)}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[E1];if(Array.isArray(e))this.moveRows(e,0);else if(e!==void 0){const r=this.persistentStateLoad();r.length&&this.moveRows(r,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(),r=[];if(!e)return r;const{from:n,to:i}=e,s=Math.min(n.row,i.row),o=Math.max(n.row,i.row);return Ue(s,o,a=>{r.push(a)}),r}refreshPositions(){const e=tt(ni,this).coords,r=this.hot.view.getFirstFullyVisibleRow(),n=this.hot.view.getLastFullyVisibleRow(),i=this.hot.countRows();this.isFixedRowTop(e.row)&&r>0&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(r-1,-1)),this.isFixedRowBottom(e.row)&&n<i&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(n+1,1),void 0,!0);const s=this.hot.view._wt.wtTable,o=tt(ni,this).TD,a=this.hot.rootElement,l=Zr(a),c=oh(a),u=s.holder.scrollTop,h=this.hot.rootWindow!==c?c.scrollTop:0,d=l.top-h,f=tt(ni,this).eventPageY-d+u,g=s.hider.offsetHeight,m=s.TBODY.offsetTop,p=tt(kn,this).getOffset().top,S=tt(kn,this).getSize().height,y=o.offsetHeight/2,C=o.offsetHeight;let E=this.hot.view.THEAD.offsetHeight+this.getRowsHeight(0,e.row-1);const A=f>=E+y;this.isFixedRowTop(e.row)&&(E+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?tt(ni,this).row=r>0?r-1:r:A?(tt(ni,this).row=e.row+1,E+=e.row===0?C-1:C):tt(ni,this).row=e.row;let O=f,T=E;f+S+p>=g?O=g-S-p:f+p<m&&(O=m+Math.abs(p)),E>=g-1&&(T=g-1),tt(kn,this).setPosition(O),tt(ja,this).setPosition(T)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",r=>Wa(ql,this,Tpe).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>Wa(ql,this,Ape).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){tt(kn,this).build(),tt(ja,this).build()}destroy(){tt(kn,this).destroy(),tt(ja,this).destroy(),super.destroy()}}function Rpe(t,e,r,n){const{wtTable:i,wtViewport:s}=this.hot.view._wt,o=this.hot.selection.isSelectedByRowHeader(),a=this.hot.getSelectedRangeLast();if(!a||!o||tt(rl,this)||t.button!==0){hc(rl,this,!1),tt(ea,this).length=0,rt(this.hot.rootElement,[nx,Up]);return}const l=tt(ja,this).isBuilt()&&!tt(ja,this).isAppended(),c=tt(kn,this).isBuilt()&&!tt(kn,this).isAppended();l&&c&&(tt(ja,this).appendTo(i.hider),tt(kn,this).appendTo(i.hider));const{from:u,to:h}=a,d=Math.min(u.row,h.row),f=Math.max(u.row,h.row);if(e.col<0&&e.row>=d&&e.row<=f){n.row=!0,hc(rl,this,!0),tt(ni,this).eventPageY=t.pageY,tt(ni,this).coords=e,tt(ni,this).TD=r,hc(ea,this,this.prepareRowsToMoving());const g=i.holder.scrollLeft+s.getRowHeaderWidth(),m=this.getRowsHeight(d,e.row-1)+t.offsetY;tt(kn,this).setPosition(null,g),tt(kn,this).setSize(i.hider.offsetWidth-g,this.getRowsHeight(d,f)),tt(kn,this).setOffset(-m,null),Re(this.hot.rootElement,nx),this.refreshPositions()}else rt(this.hot.rootElement,ix),hc(rl,this,!1),tt(ea,this).length=0}function Tpe(t){tt(rl,this)&&(tt(ni,this).eventPageY=t.pageY,this.refreshPositions())}function _pe(t,e,r,n){!this.hot.getSelectedRangeLast()||!tt(rl,this)||(tt(ea,this).indexOf(e.row)>-1?rt(this.hot.rootElement,Up):Re(this.hot.rootElement,Up),n.row=!0,n.column=!0,n.cell=!0,tt(ni,this).coords=e,tt(ni,this).TD=r)}function Ape(){const t=tt(ni,this).row,e=tt(ea,this).length;if(hc(rl,this,!1),rt(this.hot.rootElement,[nx,Up,ix]),this.hot.selection.isSelectedByRowHeader()&&Re(this.hot.rootElement,ix),e<1||t===void 0)return;const r=tt(ea,this)[0],n=this.hot.toPhysicalRow(r),i=this.dragRows(tt(ea,this),t);if(tt(ea,this).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const s=this.hot.toVisualRow(n),o=s+e-1;this.hot.selectRows(s,o)}}function Mpe(){const t=this.hot.view._wt.wtTable,e=this.hot.view._wt.wtViewport.getRowHeaderWidth(),r=t.holder.scrollLeft,n=e+r;tt(kn,this).setPosition(null,n),tt(kn,this).setSize(t.hider.offsetWidth-n)}function Ipe(){this.moveBySettingsOrLoad()}function Ope(t,e){QH(t,e),e.add(t)}function dn(t,e,r){QH(t,e),e.set(t,r)}function QH(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dr(t,e,r){return t.set(zo(t,e),r),r}function ke(t,e){return t.get(zo(t,e))}function zo(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Yp="manualRowResize",Ppe=30,DI="manualRowHeights";var to=new WeakMap,hm=new WeakMap,fi=new WeakMap,gf=new WeakMap,Ka=new WeakMap,fR=new WeakMap,rh=new WeakMap,dm=new WeakMap,Mn=new WeakMap,eo=new WeakMap,Mc=new WeakMap,zp=new WeakMap,mf=new WeakMap,pf=new WeakMap,gs=new WeakMap,wf=new WeakMap,ka=new WeakSet;class Dpe extends Pt{static get PLUGIN_KEY(){return Yp}static get PLUGIN_PRIORITY(){return Ppe}constructor(e){super(e),Ope(this,ka),dn(this,to,null),dn(this,hm,null),dn(this,fi,[]),dn(this,gf,null),dn(this,Ka,null),dn(this,fR,null),dn(this,rh,null),dn(this,dm,null),dn(this,Mn,this.hot.rootDocument.createElement("DIV")),dn(this,eo,this.hot.rootDocument.createElement("DIV")),dn(this,Mc,!1),dn(this,zp,!1),dn(this,mf,0),dn(this,pf,null),dn(this,gs,void 0),dn(this,wf,void 0),Re(ke(Mn,this),"manualRowResizer"),Re(ke(eo,this),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Yp]}enablePlugin(){this.enabled||(dr(gs,this,new vl),ke(gs,this).addLocalHook("init",()=>zo(ka,this,Bpe).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,ke(gs,this)),this.addHook("modifyRowHeight",(e,r)=>zo(ka,this,$pe).call(this,e,r)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){dr(wf,this,ke(gs,this).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualRowHeights(){this.hot.runHooks("persistentStateSave",DI,ke(gs,this).getValues())}loadManualRowHeights(){const e={};return this.hot.runHooks("persistentStateLoad",DI,e),e.value}setManualSize(e,r){const n=this.hot.toPhysicalRow(e),i=Math.max(r,Mw.DEFAULT_HEIGHT);return ke(gs,this).setValueAtIndex(n,i),i}getLastDesiredRowHeight(){return ke(gf,this)}setupHandlePosition(e){dr(to,this,e);const{view:r}=this.hot,{_wt:n}=r,i=n.wtTable.getCoords(ke(to,this)),s=i.row;if(s<0)return;const o=Bt(ke(to,this)),a=ke(to,this).getBoundingClientRect(),l=s<n.getSetting("fixedRowsTop"),c=s>=r.countNotHiddenRowIndexes(0,1)-n.getSetting("fixedRowsBottom");let u;l?u=n.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(ke(to,this),i.row,i.col):c&&(u=n.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(ke(to,this),i.row,i.col)),u||(u=n.wtOverlays.inlineStartOverlay.getRelativeCellPosition(ke(to,this),i.row,i.col)),dr(hm,this,this.hot.rowIndexMapper.getVisualFromRenderableIndex(s)),dr(fi,this,[]);const h=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&h){const d=this.hot.getSelectedRange();j(d,f=>{const g=f.getTopStartCorner().row,m=f.getBottomStartCorner().row;Ue(g,m,p=>{ke(fi,this).includes(p)||ke(fi,this).push(p)})})}ke(fi,this).includes(ke(hm,this))||dr(fi,this,[ke(hm,this)]),dr(dm,this,u.top-6),dr(rh,this,parseInt(a.height,10)),ke(Mn,this).style.top=`${ke(dm,this)+ke(rh,this)}px`,ke(Mn,this).style[this.inlineDir]=`${u.start}px`,ke(Mn,this).style.width=`${o}px`,this.hot.rootElement.appendChild(ke(Mn,this))}refreshHandlePosition(){ke(Mn,this).style.top=`${ke(dm,this)+ke(gf,this)}px`}setupGuidePosition(){const e=parseInt(Bt(ke(Mn,this)),10),r=parseInt(ke(Mn,this).style[this.inlineDir],10)+e,n=parseInt(this.hot.view.maximumVisibleElementWidth(0),10);Re(ke(Mn,this),"active"),Re(ke(eo,this),"active"),ke(eo,this).style.top=ke(Mn,this).style.top,ke(eo,this).style[this.inlineDir]=`${r}px`,ke(eo,this).style.width=`${n-e}px`,this.hot.rootElement.appendChild(ke(eo,this))}refreshGuidePosition(){ke(eo,this).style.top=ke(Mn,this).style.top}hideHandleAndGuide(){rt(ke(Mn,this),"active"),rt(ke(eo,this),"active")}checkIfRowHeader(e){const r=Sc(e,["TBODY"],this.hot.rootElement),{inlineStartOverlay:n,topInlineStartCornerOverlay:i,bottomInlineStartCornerOverlay:s}=this.hot.view._wt.wtOverlays;return[n.clone.wtTable.TBODY,i.clone.wtTable.TBODY,s.clone.wtTable.TBODY].includes(r)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}getActualRowHeight(e){const r=this.hot.view._wt.wtTable.getRowHeight(e);return r!==void 0&&ke(Ka,this)<r?r:ke(Ka,this)}afterMouseDownTimeout(){const e=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize()},r=(n,i)=>{const s=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(n),n,!0);s!==void 0&&dr(Ka,this,s),this.setManualSize(n,ke(Ka,this)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(n),n,!0),i&&e()};ke(mf,this)>=2&&(ke(fi,this).length>1?(j(ke(fi,this),i=>{r(i)}),e()):j(ke(fi,this),i=>{r(i,!0)})),dr(mf,this,0),dr(pf,this,null)}bindEvents(){const{rootElement:e,rootWindow:r}=this.hot;this.eventManager.addEventListener(e,"mouseover",n=>zo(ka,this,kpe).call(this,n)),this.eventManager.addEventListener(e,"mousedown",n=>zo(ka,this,Npe).call(this,n)),this.eventManager.addEventListener(r,"mousemove",n=>zo(ka,this,Hpe).call(this,n)),this.eventManager.addEventListener(r,"mouseup",()=>zo(ka,this,Fpe).call(this)),this.eventManager.addEventListener(ke(Mn,this),"contextmenu",()=>zo(ka,this,Lpe).call(this))}destroy(){super.destroy()}}function kpe(t){if(!Kk(t.target)&&ke(zp,this)!==!0&&this.checkIfRowHeader(t.target)){const e=this.getClosestTHParent(t.target);e&&(ke(Mc,this)||this.setupHandlePosition(e))}}function Npe(t){Ze(t.target,"manualRowResizer")&&(this.setupHandlePosition(ke(to,this)),this.setupGuidePosition(),dr(Mc,this,!0),ke(pf,this)===null&&(dr(pf,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(ke(pf,this))),dr(mf,this,ke(mf,this)+1),dr(fR,this,t.pageY),dr(Ka,this,ke(rh,this)))}function Hpe(t){ke(Mc,this)&&(dr(gf,this,ke(rh,this)+(t.pageY-ke(fR,this))),j(ke(fi,this),e=>{dr(Ka,this,this.setManualSize(e,ke(gf,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition())}function Fpe(){const t=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize()},e=(r,n)=>{this.hot.runHooks("beforeRowResize",this.getActualRowHeight(r),r,!1),n&&t(),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.getActualRowHeight(r),r,!1)};ke(Mc,this)&&(this.hideHandleAndGuide(),dr(Mc,this,!1),ke(Ka,this)!==ke(rh,this)&&(ke(fi,this).length>1?(j(ke(fi,this),n=>{e(n)}),t()):j(ke(fi,this),n=>{e(n,!0)})),this.setupHandlePosition(ke(to,this)))}function Lpe(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(ke(Mn,this)),this.hot.rootElement.removeChild(ke(eo,this)),dr(Mc,this,!1),dr(zp,this,!0),this.hot._registerImmediate(()=>{dr(zp,this,!1)})}function $pe(t,e){let r=t;if(this.enabled){const n=this.hot.toPhysicalRow(e),i=ke(gs,this).getValueAtIndex(n);this.hot.getSettings()[Yp]&&i&&(r=i)}return r}function Bpe(){const t=this.hot.getSettings()[Yp],e=this.loadManualRowHeights();this.hot.batchExecution(()=>{typeof e<"u"?e.forEach((r,n)=>{ke(gs,this).setValueAtIndex(n,r)}):Array.isArray(t)?(t.forEach((r,n)=>{ke(gs,this).setValueAtIndex(n,r)}),dr(wf,this,t)):t===!0&&Array.isArray(ke(wf,this))&&ke(wf,this).forEach((r,n)=>{ke(gs,this).setValueAtIndex(n,r)})},!0)}function Zl(t,e,r){return e=Vpe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Vpe(t){var e=Wpe(t,"string");return typeof e=="symbol"?e:e+""}function Wpe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ro{constructor(e,r,n,i,s,o){Zl(this,"row",void 0),Zl(this,"col",void 0),Zl(this,"rowspan",void 0),Zl(this,"colspan",void 0),Zl(this,"removed",!1),Zl(this,"cellCoordsFactory",void 0),Zl(this,"cellRangeFactory",void 0),this.row=e,this.col=r,this.rowspan=n,this.colspan=i,this.cellCoordsFactory=s,this.cellRangeFactory=o}static NEGATIVE_VALUES_WARNING(e){return Dt`The merged cell declared with {row: ${e.row}, col: ${e.col},\x20
  124. rowspan: ${e.rowspan}, colspan: ${e.colspan}} contains negative values, which is\x20
  125. not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING(e){return Dt`The merged cell declared at [${e.row}, ${e.col}] is positioned\x20
  126. (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 Dt`The merged cell declared at [${e.row}, ${e.col}] has both "rowspan"\x20
  127. and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.`}static ZERO_SPAN_WARNING(e){return Dt`The merged cell declared at [${e.row}, ${e.col}] has "rowspan"\x20
  128. 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,r,n){return e.row<0||e.col<0||e.row>=r||e.row+e.rowspan-1>=r||e.col>=n||e.col+e.colspan-1>=n}normalize(e){const r=e.countRows(),n=e.countCols();this.row<0?this.row=0:this.row>r-1&&(this.row=r-1),this.col<0?this.col=0:this.col>n-1&&(this.col=n-1),this.row+this.rowspan>r-1&&(this.rowspan=r-this.row),this.col+this.colspan>n-1&&(this.colspan=n-this.col)}includes(e,r){return this.row<=e&&this.col<=r&&this.row+this.rowspan-1>=e&&this.col+this.colspan-1>=r}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,r){const n=e[0]||e[1],i=r+Math.abs(e[0]||e[1])-1,s=e[0]?"colspan":"rowspan",o=e[0]?"col":"row",a=Math.min(r,i),l=Math.max(r,i),c=this[o],u=this[o]+this[s]-1;if(c>=r&&(this[o]+=n),n>0)r<=u&&r>c&&(this[s]+=n);else if(n<0){if(a<=c&&l>=u)return this.removed=!0,!1;if(c>=a&&c<=l){const h=l-c+1,d=Math.abs(n)-h;this[o]-=d+n,this[s]-=h}else if(c<=a&&u>=l)this[s]+=n;else if(c<=a&&u>=a&&u<l){const h=u-a+1;this[s]-=h}}return!0}isFarther(e,r){return e?r==="down"?e.row+e.rowspan-1<this.row+this.rowspan-1:r==="up"?e.row>this.row:r==="right"?e.col+e.colspan-1<this.col+this.colspan-1:r==="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 sx(t,e,r,n){e?e.row===r&&e.col===n?(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 Upe(t,e){Ype(t,e),e.add(t)}function Ype(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function R1(t,e,r){return e=zpe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zpe(t){var e=Gpe(t,"string");return typeof e=="symbol"?e:e+""}function Gpe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fm(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Td=new WeakSet;class gR{constructor(e){Upe(this,Td),R1(this,"plugin",void 0),R1(this,"mergedCells",[]),R1(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){return Dt`The merged cell declared at [${e.row}, ${e.col}], overlaps\x20
  129. with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20
  130. fix your setup.`}get(e,r){const n=this.mergedCells;let i=!1;return j(n,s=>s.row<=e&&s.row+s.rowspan-1>=e&&s.col<=r&&s.col+s.colspan-1>=r?(i=s,!1):!0),i}getByRange(e){const r=this.mergedCells;let n=!1;return j(r,i=>i.row<=e.from.row&&i.row+i.rowspan-1>=e.to.row&&i.col<=e.from.col&&i.col+i.colspan-1>=e.to.col?(n=i,n):!0),n}getWithinRange(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=this.mergedCells,i=[];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 j(n,o=>{const a=this.hot._createCellCoords(o.row,o.col),l=this.hot._createCellCoords(o.row+o.rowspan-1,o.col+o.colspan-1),c=this.hot._createCellRange(a,a,l);r?s.overlaps(c)&&i.push(o):s.includesRange(c)&&i.push(o)}),i.length?i:!1}add(e){const r=this.mergedCells,n=e.row,i=e.col,s=e.rowspan,o=e.colspan,a=new ro(n,i,s,o,this.hot._createCellCoords,this.hot._createCellRange),l=this.get(n,i),c=this.isOverlapping(a);return!l&&!c?(this.hot&&a.normalize(this.hot),r.push(a),a):(Vt(gR.IS_OVERLAPPING_WARNING(a)),!1)}remove(e,r){const n=this.mergedCells,i=this.get(e,r),s=i?this.mergedCells.indexOf(i):-1;return i&&s!==-1?(n.splice(s,1),i):!1}clear(){const e=this.mergedCells,r=[],n=[];j(e,i=>{const s=this.hot.getCell(i.row,i.col);s&&r.push([s,this.get(i.row,i.col),i.row,i.col])}),this.mergedCells.length=0,j(r,(i,s)=>{Ue(0,i.rowspan-1,o=>{Ue(0,i.colspan-1,a=>{if(a!==0||o!==0){const l=this.hot.getCell(i.row+o,i.col+a);l&&n.push([l,null,null,null])}})}),r[s][1]=null}),j(r,i=>{sx(...i)}),j(n,i=>{sx(...i)})}isOverlapping(e){const r=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 n=!1;return j(this.mergedCells,i=>this.hot._createCellRange(this.hot._createCellCoords(0,0),this.hot._createCellCoords(i.row,i.col),this.hot._createCellCoords(i.row+i.rowspan-1,i.col+i.colspan-1)).overlaps(r)?(n=!0,!1):!0),n}isFirstRenderableMergedCell(e,r){const n=this.get(e,r);return n&&this.hot.rowIndexMapper.getNearestNotHiddenIndex(n.row,1)===e&&this.hot.columnIndexMapper.getNearestNotHiddenIndex(n.col,1)===r}getFirstRenderableCoords(e,r){const n=this.get(e,r);if(!n||this.isFirstRenderableMergedCell(e,r))return this.hot._createCellCoords(e,r);const i=this.hot.rowIndexMapper.getNearestNotHiddenIndex(n.row,1),s=this.hot.columnIndexMapper.getNearestNotHiddenIndex(n.col,1);return this.hot._createCellCoords(i,s)}getStartMostColumnIndex(e,r){const n=fm(Td,this,gm).call(this,e,"col",-1);let i=r;for(let s=0;s<n.length;s++)if(n[s]<=r){i=n[s];break}return i}getEndMostColumnIndex(e,r){const n=fm(Td,this,gm).call(this,e,"col",1);let i=r;for(let s=0;s<n.length;s++)if(n[s]>=r){i=n[s];break}return i}getTopMostRowIndex(e,r){const n=fm(Td,this,gm).call(this,e,"row",-1);let i=r;for(let s=0;s<n.length;s++)if(n[s]<=r){i=n[s];break}return i}getBottomMostRowIndex(e,r){const n=fm(Td,this,gm).call(this,e,"row",1);let i=r;for(let s=0;s<n.length;s++)if(n[s]>=r){i=n[s];break}return i}shiftCollections(e,r,n){const i=[0,0];switch(e){case"right":i[0]+=n;break;case"left":i[0]-=n;break;case"down":i[1]+=n;break;case"up":i[1]-=n;break}j(this.mergedCells,s=>{s.shift(i,r)}),AS(this.mergedCells.length-1,0,s=>{const o=this.mergedCells[s];o&&o.removed&&this.mergedCells.splice(this.mergedCells.indexOf(o),1)})}}function gm(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const n=new Map,i=r===1?t.getTopStartCorner():t.getBottomEndCorner(),s=r===1?t.getBottomEndCorner():t.getTopStartCorner();for(let o=i.row;r===1?o<=s.row:o>=s.row;o+=r)for(let a=i.col;r===1?a<=s.col:a>=s.col;a+=r){const l=e==="row"?o:a,c=this.get(o,a);let u=l;c&&(u=r===1?c[e]+c[`${e}span`]-1:c[e]),n.has(l)||n.set(l,new Set),n.get(l).add(u)}return Array.from(new Set(Array.from(n.entries()).filter(o=>{let[,a]=o;return a.size===1}).flatMap(o=>{let[,a]=o;return Array.from(a)})))}function T1(t,e,r){return e=jpe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jpe(t){var e=Kpe(t,"string");return typeof e=="symbol"?e:e+""}function Kpe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Xpe{constructor(e){T1(this,"plugin",void 0),T1(this,"mergedCellsCollection",void 0),T1(this,"currentFillData",null),this.plugin=e,this.mergedCellsCollection=this.plugin.mergedCellsCollection}correctSelectionAreaSize(e){if(e[0]===e[2]&&e[1]===e[3]){const r=this.mergedCellsCollection.get(e[0],e[1]);r&&(e[2]=e[0]+r.rowspan-1,e[3]=e[1]+r.colspan-1)}}getDirection(e,r){let n=null;return r[0]===e[0]&&r[1]===e[1]&&r[3]===e[3]?n="down":r[2]===e[2]&&r[1]===e[1]&&r[3]===e[3]?n="up":r[1]===e[1]&&r[2]===e[2]?n="right":n="left",n}snapDragArea(e,r,n,i){const s=r.slice(0),o=this.getAutofillSize(e,r,n),[a,l,c,u]=e,d=["up","down"].indexOf(n)>-1?c-a+1:u-l+1,f=Math.floor(o/d)*d,g=o-f,m=this.getFarthestCollection(e,r,n,i);if(m){if(n==="down"){const p=m.row+m.rowspan-a-g;s[2]+p>=this.plugin.hot.countRows()?s[2]-=g:s[2]+=g?p:0}else if(n==="right"){const p=m.col+m.colspan-l-g;s[3]+p>=this.plugin.hot.countCols()?s[3]-=g:s[3]+=g?p:0}else if(n==="up"){const p=c-g-m.row+1;s[0]+p<0?s[0]+=g:s[0]-=g?p:0}else if(n==="left"){const p=u-g-m.col+1;s[1]+p<0?s[1]+=g:s[1]-=g?p:0}}return this.updateCurrentFillCache({baseArea:e,dragDirection:n,foundMergedCells:i,fillSize:o,dragArea:s,cycleLength:d}),s}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),kr(this.currentFillData,e)}getAutofillSize(e,r,n){const[i,s,o,a]=e,[l,c,u,h]=r;switch(n){case"up":return i-l;case"down":return u-o;case"left":return s-c;case"right":return h-a;default:return null}}getDragArea(e,r,n){const[i,s,o,a]=e,[l,c,u,h]=r;switch(n){case"up":return[l,c,i-1,a];case"down":return[o+1,s,u,a];case"left":return[l,c,o,s-1];case"right":return[i,a+1,u,h];default:return null}}getFarthestCollection(e,r,n,i){const[s,o,a,l]=e,c=["up","down"].indexOf(n)>-1,u=c?a:l,h=c?s:o,d=this.getAutofillSize(e,r,n),f=c?a-s+1:l-o+1,g=Math.floor(d/f)*f,m=d-g;let p=null,S=null,y=null;switch(n){case"up":p="includesVertically",y=u-m+1;break;case"left":p="includesHorizontally",y=u-m+1;break;case"down":p="includesVertically",y=h+m-1;break;case"right":p="includesHorizontally",y=h+m-1;break}return j(i,C=>{C[p](y)&&C.isFarther(S,n)&&(S=C)}),S}recreateAfterDataPopulation(e){if(!this.currentFillData)return;const r=this.getRangeFromChanges(e),n=this.currentFillData.foundMergedCells,i=this.currentFillData.dragDirection,s=(c,u)=>{switch(i){case"up":return c.row-u>=r.from.row;case"down":return c.row+c.rowspan-1+u<=r.to.row;case"left":return c.col-u>=r.from.column;case"right":return c.col+c.colspan-1+u<=r.to.column;default:return null}};let o=0,a=null,l=1;do for(let c=0;c<n.length;c+=1){if(a=n[c],o=l*this.currentFillData.cycleLength,s(a,o))switch(i){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}c===n.length-1&&(l+=1)}while(s(a,o));this.currentFillData=null,this.plugin.hot.render(),n.length>0&&this.plugin.ifChromeForceRepaint()}getRangeFromChanges(e){const r={min:null,max:null},n={min:null,max:null};return j(e,i=>{const s=i[0],o=this.plugin.hot.propToCol(i[1]);(r.min===null||s<r.min)&&(r.min=s),(r.max===null||s>r.max)&&(r.max=s),(n.min===null||o<n.min)&&(n.min=o),(n.max===null||o>n.max)&&(n.max=o)}),{from:{row:r.min,column:n.min},to:{row:r.max,column:n.max}}}dragAreaOverlapsCollections(e,r,n){const i=this.getDragArea(e,r,n),[s,o,a,l]=i,c=this.plugin.hot._createCellCoords(s,o),u=this.plugin.hot._createCellCoords(a,l),h=this.plugin.hot._createCellRange(c,c,u);return!!this.mergedCellsCollection.getWithinRange(h,!0)}}function _1(t,e,r){return e=qpe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qpe(t){var e=Zpe(t,"string");return typeof e=="symbol"?e:e+""}function Zpe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Jpe{constructor(e){_1(this,"plugin",void 0),_1(this,"hot",void 0),_1(this,"fullySelectedMergedCellClassName","fullySelectedMergedCell"),this.plugin=e,this.hot=e.hot}getSelectedMergedCellClassName(e,r,n,i){const s=Math.min(n[0],n[2]),o=Math.min(n[1],n[3]),a=Math.max(n[0],n[2]),l=Math.max(n[1],n[3]);if(i===void 0||!this.plugin.mergedCellsCollection.isFirstRenderableMergedCell(e,r))return;const u=this.plugin.mergedCellsCollection.get(e,r);if(!u)return;const h=u.getLastRow(),d=u.getLastColumn();if(s<=u.row&&o<=u.col&&a>=h&&l>=d)return`${this.fullySelectedMergedCellClassName}-${i}`;if(this.isMergeCellFullySelected(u,this.plugin.hot.getSelectedRange()))return`${this.fullySelectedMergedCellClassName}-multiple`}isMergeCellFullySelected(e,r){const n=[];if(!r||!e)return!1;for(let i=0;i<e.rowspan;i+=1)for(let s=0;s<e.colspan;s+=1)n.push(this.hot._createCellCoords(e.row+i,e.col+s));for(let i=0;i<n.length;i+=1){const s=[];for(let o=0;o<r.length;o+=1)s[o]=r[o].includes(n[i]);if(!s.includes(!0))return!1}return!0}getSelectedMergedCellClassNameToRemove(){const e=[];for(let r=0;r<=7;r+=1)e.push(`${this.fullySelectedMergedCellClassName}-${r}`);return e.push(`${this.fullySelectedMergedCellClassName}-multiple`),e}}function Qpe(t){return{key:"mergeCells",name(){const e=this.getSelectedLast();if(e){const r=t.mergedCellsCollection.get(e[0],e[1]);if(r.row===e[0]&&r.col===e[1]&&r.row+r.rowspan-1===e[2]&&r.col+r.colspan-1===e[3])return this.getTranslatedPhrase(Ob)}return this.getTranslatedPhrase(Ib)},callback(){const e=this.getSelectedRangeLast();if(!e)return;e.setDirection(this.isRtl()?"NE-SW":"NW-SE");const{from:r,to:n}=e;t.toggleMerge(e),this.selectCell(r.row,r.col,n.row,n.col,!1)},disabled(){const e=this.getSelectedLast();return e?ro.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 vf(t,e,r){return e=ewe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ewe(t){var e=twe(t,"string");return typeof e=="symbol"?e:e+""}function twe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class kI{constructor(e){vf(this,"data",void 0),vf(this,"next",null),vf(this,"prev",null),this.data=e}}class mm{constructor(){vf(this,"first",null),vf(this,"last",null)}push(e){const r=new kI(e);if(this.first===null)this.first=r,this.last=r;else{const n=this.last;this.last=r,r.prev=n,n.next=r}return r}unshift(e){const r=new kI(e);if(this.first===null)this.first=r,this.last=r;else{const n=this.first;this.first=r,r.next=n,n.prev=r}}inorder(e){let r=this.first;for(;r;){const n=e(r);if(r===this.last||n===!0)break;r=r.next}}remove(e){if(this.first===null)return!1;let r=this.first,n,i;for(;r;){if(r.data===e)return n=r.next,i=r.prev,n&&(n.prev=i),i&&(i.next=n),r===this.first&&(this.first=n),r===this.last&&(this.last=i),!0;r=r.next}return!1}hasCycle(){let e=this.first,r=this.first;for(;;){if(e===null||(e=e.next,e===null))return!1;if(e=e.next,r=r.next,e===r)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(n,i){i&&(e(i,i.next),i.next=n)}if(!this.first)return;e(this.first,this.first.next),this.first.next=null;const r=this.first;this.first=this.last,this.last=r}reverse(){if(!this.first||!this.first.next)return;let e=this.first.next,r=this.first,n;for(;e;)n=e.next,e.next=r,r.prev=e,r=e,e=n;this.first.next=null,this.last.prev=null,n=this.first,this.first=r,this.last=n}}function rwe(t,e){eF(t,e),e.add(t)}function Jl(t,e,r){eF(t,e),e.set(t,r)}function eF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ot(t,e){return t.get(Gp(t,e))}function oi(t,e,r){return t.set(Gp(t,e),r),r}function Gp(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var js=new WeakMap,Ks=new WeakMap,Xs=new WeakMap,qs=new WeakMap,ox=new WeakMap,pm=new WeakMap,wm=new WeakMap,A1=new WeakSet;class nwe{constructor(e){let{mergedCellsGetter:r,rowIndexMapper:n,columnIndexMapper:i}=e;rwe(this,A1),Jl(this,js,new mm),Jl(this,Ks,new mm),Jl(this,Xs,null),Jl(this,qs,null),Jl(this,ox,null),Jl(this,pm,null),Jl(this,wm,null),oi(ox,this,r),oi(pm,this,n),oi(wm,this,i)}getCurrentVerticalNode(){return Ot(qs,this).data}getFirstVerticalNode(){return Ot(Ks,this).first.data}getNextVerticalNode(){return Ot(qs,this).next.data}getPrevVerticalNode(){return Ot(qs,this).prev.data}getCurrentHorizontalNode(){return Ot(Xs,this).data}getFirstHorizontalNode(){return Ot(js,this).first.data}getNextHorizontalNode(){return Ot(Xs,this).next.data}getPrevHorizontalNode(){return Ot(Xs,this).prev.data}setPrevNodeAsActive(){oi(qs,this,Ot(qs,this).prev),oi(Xs,this,Ot(Xs,this).prev)}setNextNodeAsActive(){oi(qs,this,Ot(qs,this).next),oi(Xs,this,Ot(Xs,this).next)}buildFocusOrder(e){const r=e.getTopStartCorner(),n=e.getBottomEndCorner(),i=new WeakSet;oi(js,this,new mm);for(let o=r.row;o<=n.row;o++)if(!Ot(pm,this).isHidden(o))for(let a=r.col;a<=n.col;a++){if(Ot(wm,this).isHidden(a))continue;const l=Gp(A1,this,NI).call(this,e,Ot(js,this),i,o,a);l&&oi(Xs,this,l)}Ot(js,this).first&&(Ot(js,this).first.prev=Ot(js,this).last,Ot(js,this).last.next=Ot(js,this).first);const s=new WeakSet;oi(Ks,this,new mm);for(let o=r.col;o<=n.col;o++)if(!Ot(wm,this).isHidden(o))for(let a=r.row;a<=n.row;a++){if(Ot(pm,this).isHidden(a))continue;const l=Gp(A1,this,NI).call(this,e,Ot(Ks,this),s,a,o);l&&oi(qs,this,l)}Ot(Ks,this).first&&(Ot(Ks,this).first.prev=Ot(Ks,this).last,Ot(Ks,this).last.next=Ot(Ks,this).first)}setActiveNode(e,r){return Ot(js,this).inorder(n=>{const{rowStart:i,rowEnd:s,colStart:o,colEnd:a}=n.data;if(e>=i&&e<=s&&r>=o&&r<=a)return oi(Xs,this,n),!1}),Ot(Ks,this).inorder(n=>{const{rowStart:i,rowEnd:s,colStart:o,colEnd:a}=n.data;if(e>=i&&e<=s&&r>=o&&r<=a)return oi(qs,this,n),!1}),this}}function NI(t,e,r,n,i){const s=t.getTopStartCorner(),o=t.getBottomEndCorner(),a=t.highlight.clone().normalize(),l=Ot(ox,this).call(this,n,i);if(l&&r.has(l))return null;const c={colStart:i,colEnd:i,rowStart:n,rowEnd:n};if(l){if(r.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;c.colStart=l.col,c.colEnd=l.col+l.colspan-1,c.rowStart=l.row,c.rowEnd=l.row+l.rowspan-1}const u=e.push(c);return n===a.row&&i===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?u:null}function iwe(t,e){tF(t,e),e.add(t)}function M1(t,e,r){tF(t,e),e.set(t,r)}function tF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function I1(t,e,r){return e=swe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function swe(t){var e=owe(t,"string");return typeof e=="symbol"?e:e+""}function owe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jf(t,e,r){return t.set(Nt(t,e),r),r}function qt(t,e){return t.get(Nt(t,e))}function Nt(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}He.getSingleton().register("beforeMergeCells");He.getSingleton().register("afterMergeCells");He.getSingleton().register("beforeUnmergeCells");He.getSingleton().register("afterUnmergeCells");const Cf="mergeCells",awe=150,HI=Cf;var Bi=new WeakMap,Vi=new WeakMap,lo=new WeakMap,$t=new WeakSet;class lwe extends Pt{constructor(){super(...arguments),iwe(this,$t),I1(this,"mergedCellsCollection",null),I1(this,"autofillCalculations",null),I1(this,"selectionCalculations",null),M1(this,Bi,null),M1(this,Vi,{row:0,col:0}),M1(this,lo,new nwe({mergedCellsGetter:(e,r)=>this.mergedCellsCollection.get(e,r),rowIndexMapper:this.hot.rowIndexMapper,columnIndexMapper:this.hot.columnIndexMapper}))}static get PLUGIN_KEY(){return Cf}static get PLUGIN_PRIORITY(){return awe}isEnabled(){return!!this.hot.getSettings()[Cf]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new gR(this),this.autofillCalculations=new Xpe(this),this.selectionCalculations=new Jpe(this),this.addHook("afterInit",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,cwe).call(e,...n)}),this.addHook("modifyTransformFocus",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,hwe).call(e,...n)}),this.addHook("modifyTransformStart",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,dwe).call(e,...n)}),this.addHook("modifyTransformEnd",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,fwe).call(e,...n)}),this.addHook("beforeSelectionHighlightSet",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,gwe).call(e,...n)}),this.addHook("beforeSetRangeStart",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,FI).call(e,...n)}),this.addHook("beforeSetRangeStartOnly",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,FI).call(e,...n)}),this.addHook("beforeSelectionFocusSet",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,vwe).call(e,...n)}),this.addHook("afterSelectionFocusSet",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,Cwe).call(e,...n)}),this.addHook("afterSelectionEnd",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,Swe).call(e,...n)}),this.addHook("modifyGetCellCoords",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,mwe).call(e,...n)}),this.addHook("afterIsMultipleSelection",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,uwe).call(e,...n)}),this.addHook("afterRenderer",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,wwe).call(e,...n)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,pwe).call(e,...n)}),this.addHook("afterGetCellMeta",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,xwe).call(e,...n)}),this.addHook("afterViewportRowCalculatorOverride",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,ywe).call(e,...n)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,bwe).call(e,...n)}),this.addHook("modifyAutofillRange",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,Ewe).call(e,...n)}),this.addHook("afterCreateCol",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,Rwe).call(e,...n)}),this.addHook("afterRemoveCol",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,Twe).call(e,...n)}),this.addHook("afterCreateRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,_we).call(e,...n)}),this.addHook("afterRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,Awe).call(e,...n)}),this.addHook("afterChange",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,Mwe).call(e,...n)}),this.addHook("beforeDrawBorders",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,Iwe).call(e,...n)}),this.addHook("afterDrawSelection",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,Owe).call(e,...n)}),this.addHook("beforeRemoveCellClassNames",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,Pwe).call(e,...n)}),this.addHook("beforeBeginEditing",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Nt($t,e,Dwe).call(e,...n)}),this.addHook("beforeUndoStackChange",(r,n)=>{if(n==="MergeCells")return!1}),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.clearCollections(),this.unregisterShortcuts(),this.hot.render(),super.disablePlugin()}updatePlugin(){const e=this.hot.getSettings()[Cf];this.disablePlugin(),this.enablePlugin(),this.generateFromSettings(e),super.updatePlugin()}ifChromeForceRepaint(){if(!nN())return;const e=[];let r=[];this.mergedCellsCollection.mergedCells.forEach(n=>{const{row:i,rowspan:s}=n;for(let o=i+1;o<i+s;o++)r.push(o)}),r=[...new Set(r)],r.forEach(n=>{const i=this.hot.rowIndexMapper.getRenderableFromVisualIndex(n);this.hot.view._wt.wtOverlays.getOverlays(!0).map(s=>s?.name==="master"?s:s.clone.wtTable).forEach(s=>{const o=s.getRow(i);o&&(o.style.background=Nf(o,"backgroundColor").replace(")",", 0.99)"),e.push(o))})}),this.hot._registerTimeout(()=>{e.forEach(n=>{n.style.background=Nf(n,"backgroundColor").replace(", 0.99)",")")})},1)}validateSetting(e){let r=!0;return e?(ro.containsNegativeValues(e)?(Vt(ro.NEGATIVE_VALUES_WARNING(e)),r=!1):ro.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?(Vt(ro.IS_OUT_OF_BOUNDS_WARNING(e)),r=!1):ro.isSingleCell(e)?(Vt(ro.IS_SINGLE_CELL(e)),r=!1):ro.containsZeroSpan(e)&&(Vt(ro.ZERO_SPAN_WARNING(e)),r=!1),r):!1}generateFromSettings(e){if(Array.isArray(e)){const r=[];if(j(e,n=>{if(!this.validateSetting(n))return;const i=this.hot._createCellCoords(n.row,n.col),s=this.hot._createCellCoords(n.row+n.rowspan-1,n.col+n.colspan-1),o=this.hot._createCellRange(i,i,s);this.mergeRange(o,!0,!0),Ue(n.row,n.row+n.rowspan-1,a=>{Ue(n.col,n.col+n.colspan-1,l=>{a===n.row&&l===n.col||r.push([a,l,null])})})}),r.length===0)return;this.hot.setDataAtCell(r,void 0,void 0,this.pluginName)}}clearCollections(){this.mergedCellsCollection.clear()}canMergeRange(e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)?!0:this.validateSetting(e)}mergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;e.setDirection(this.hot.isRtl()?"NE-SW":"NW-SE");const{from:r,to:n}=e;this.unmergeRange(e,!0),this.mergeRange(e),this.hot.selectCell(r.row,r.col,n.row,n.col,!1)}unmergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;const{from:r,to:n}=e;this.unmergeRange(e,!0),this.hot.selectCell(r.row,r.col,n.row,n.col,!1)}mergeRange(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=e.getTopStartCorner(),s=e.getBottomEndCorner(),o={row:i.row,col:i.col,rowspan:s.row-i.row+1,colspan:s.col-i.col+1},a=[];let l=null;return this.canMergeRange(o,r)?(this.hot.runHooks("beforeMergeCells",e,r),Ue(0,o.rowspan-1,u=>{Ue(0,o.colspan-1,h=>{let d=null;a[u]||(a[u]=[]),u===0&&h===0?d=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(o.row),this.hot.toPhysicalColumn(o.col)):this.hot.setCellMeta(o.row+u,o.col+h,"hidden",!0),a[u][h]=d})}),this.hot.setCellMeta(o.row,o.col,"spanned",!0),this.mergedCellsCollection.add(o)?(n?l=[o.row,o.col,a]:this.hot.populateFromArray(o.row,o.col,a,void 0,void 0,this.pluginName),r||this.ifChromeForceRepaint(),this.hot.runHooks("afterMergeCells",e,o,r),l):!0):!1}unmergeRange(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=this.mergedCellsCollection.getWithinRange(e);n&&(this.hot.runHooks("beforeUnmergeCells",e,r),j(n,i=>{this.mergedCellsCollection.remove(i.row,i.col),Ue(0,i.rowspan-1,s=>{Ue(0,i.colspan-1,o=>{this.hot.removeCellMeta(i.row+s,i.col+o,"hidden"),this.hot.removeCellMeta(i.row+s,i.col+o,"copyable")})}),this.hot.removeCellMeta(i.row,i.col,"spanned")}),this.hot.runHooks("afterUnmergeCells",e,r),this.hot.render())}toggleMerge(e){const r=this.mergedCellsCollection.get(e.from.row,e.from.col);r.row===e.from.row&&r.col===e.from.col&&r.row+r.rowspan-1===e.to.row&&r.col+r.colspan-1===e.to.col?this.unmergeRange(e):this.mergeSelection(e)}merge(e,r,n,i){const s=this.hot._createCellCoords(e,r),o=this.hot._createCellCoords(n,i);this.mergeRange(this.hot._createCellRange(s,s,o))}unmerge(e,r,n,i){const s=this.hot._createCellCoords(e,r),o=this.hot._createCellCoords(n,i);this.unmergeRange(this.hot._createCellRange(s,s,o))}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control","m"]],callback:()=>{const n=this.hot.getSelectedRangeLast();n&&!n.isSingleHeader()&&(this.toggleMerge(n),this.hot.render())},runOnlyIf:n=>!n.altKey,group:HI})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(HI)}modifyViewportRowStart(e,r){const n=this.hot.rowIndexMapper,i=n.getVisualFromRenderableIndex(e.startRow);for(let s=0;s<r;s+=1){const o=this.mergedCellsCollection.get(i,s);if(at(o)){const a=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(o.row,1));if(a<e.startRow){e.startRow=a,this.modifyViewportRowStart(e,r);return}}}}modifyViewportRowEnd(e,r){const n=this.hot.rowIndexMapper,i=n.getVisualFromRenderableIndex(e.endRow);for(let s=0;s<r;s+=1){const o=this.mergedCellsCollection.get(i,s);if(at(o)){const a=o.row+o.rowspan-1,l=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(a,-1));if(l>e.endRow){e.endRow=l,this.modifyViewportRowEnd(e,r);return}}}}modifyViewportColumnStart(e,r){const n=this.hot.columnIndexMapper,i=n.getVisualFromRenderableIndex(e.startColumn);for(let s=0;s<r;s+=1){const o=this.mergedCellsCollection.get(s,i);if(at(o)){const a=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(o.col,1));if(a<e.startColumn){e.startColumn=a,this.modifyViewportColumnStart(e,r);return}}}}modifyViewportColumnEnd(e,r){const n=this.hot.columnIndexMapper,i=n.getVisualFromRenderableIndex(e.endColumn);for(let s=0;s<r;s+=1){const o=this.mergedCellsCollection.get(s,i);if(at(o)){const a=o.col+o.colspan-1,l=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(a,-1));if(l>e.endColumn){e.endColumn=l,this.modifyViewportColumnEnd(e,r);return}}}}translateMergedCellToRenderable(e,r,n,i){const{rowIndexMapper:s,columnIndexMapper:o}=this.hot;let a,l;r===0?a=s.getNearestNotHiddenIndex(e,1):a=s.getNearestNotHiddenIndex(e+r-1,-1),i===0?l=o.getNearestNotHiddenIndex(n,1):l=o.getNearestNotHiddenIndex(n+i-1,-1);const c=e>=0?s.getRenderableFromVisualIndex(a):e,u=n>=0?o.getRenderableFromVisualIndex(l):n;return[c,u]}}function cwe(){this.generateFromSettings(this.hot.getSettings()[Cf]),this.hot.render()}function uwe(t){if(t){const e=this.mergedCellsCollection.mergedCells,r=this.hot.getSelectedRangeLast(),n=r.getTopStartCorner(),i=r.getBottomEndCorner();for(let s=0;s<e.length;s+=1)if(n.row===e[s].row&&n.col===e[s].col&&i.row===e[s].row+e[s].rowspan-1&&i.col===e[s].col+e[s].colspan-1)return!1}return t}function hwe(t){qt(Vi,this).row=t.row,qt(Vi,this).col=t.col}function dwe(t){const e=this.hot.getSelectedRangeLast(),{highlight:r}=e,{columnIndexMapper:n,rowIndexMapper:i}=this.hot;qt(Bi,this)&&(i.getRenderableFromVisualIndex(qt(Bi,this).row)!==null&&(r.row=qt(Bi,this).row),n.getRenderableFromVisualIndex(qt(Bi,this).col)!==null&&(r.col=qt(Bi,this).col),jf(Bi,this,null));const s=this.mergedCellsCollection.get(r.row,r.col);if(!s)return;const o=s.col,a=s.col+s.colspan-1;if(t.col<0){const u=r.col>=o&&r.col<=a?o-1:a,h=n.getNearestNotHiddenIndex(u,-1);h===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,r.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(h,r.col)-1,1)}else if(t.col>0){const u=r.col>=o&&r.col<=a?a+1:o,h=n.getNearestNotHiddenIndex(u,1);h===null?t.col=this.hot.view.countRenderableColumnsInRange(r.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(r.col,h)-1,1)}const l=s.row,c=s.row+s.rowspan-1;if(t.row<0){const u=r.row>=l&&r.row<=c?l-1:c,h=i.getNearestNotHiddenIndex(u,-1);h===null?t.row=-this.hot.view.countRenderableRowsInRange(0,r.row):t.row=-Math.max(this.hot.view.countRenderableRowsInRange(h,r.row)-1,1)}else if(t.row>0){const u=r.row>=l&&r.row<=c?c+1:l,h=i.getNearestNotHiddenIndex(u,1);h===null?t.row=this.hot.view.countRenderableRowsInRange(r.row,this.hot.countRows()):t.row=Math.max(this.hot.view.countRenderableRowsInRange(r.row,h)-1,1)}}function fwe(t){const e=this.hot.getSelectedRangeLast(),r=e.clone(),{to:n}=e,{columnIndexMapper:i,rowIndexMapper:s}=this.hot,o=(a,l)=>{r.expand(this.hot._createCellCoords(a,l));for(let c=0;c<this.mergedCellsCollection.mergedCells.length;c+=1)r.expandByRange(this.mergedCellsCollection.mergedCells[c].getRange())};if(t.col<0){let a=this.mergedCellsCollection.getStartMostColumnIndex(e,n.col)+t.col;o(n.row,a),e.getHorizontalDirection()==="E-W"&&r.getHorizontalDirection()==="E-W"&&(a=r.getTopStartCorner().col);const l=i.getNearestNotHiddenIndex(a,1);l!==null&&(t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(l,n.col)-1,1))}else if(t.col>0){let a=this.mergedCellsCollection.getEndMostColumnIndex(e,n.col)+t.col;o(n.row,a),e.getHorizontalDirection()==="W-E"&&r.getHorizontalDirection()==="W-E"&&(a=r.getBottomEndCorner().col);const l=i.getNearestNotHiddenIndex(a,-1);l!==null&&(t.col=Math.max(this.hot.view.countRenderableColumnsInRange(n.col,l)-1,1))}if(t.row<0){let a=this.mergedCellsCollection.getTopMostRowIndex(e,n.row)+t.row;o(a,n.col),e.getVerticalDirection()==="S-N"&&r.getVerticalDirection()==="S-N"&&(a=r.getTopStartCorner().row);const l=s.getNearestNotHiddenIndex(a,1);l!==null&&(t.row=-Math.max(this.hot.view.countRenderableRowsInRange(l,n.row)-1,1))}else if(t.row>0){let a=this.mergedCellsCollection.getBottomMostRowIndex(e,n.row)+t.row;o(a,n.col),e.getVerticalDirection()==="N-S"&&r.getVerticalDirection()==="N-S"&&(a=r.getBottomStartCorner().row);const l=s.getNearestNotHiddenIndex(a,-1);l!==null&&(t.row=Math.max(this.hot.view.countRenderableRowsInRange(n.row,l)-1,1))}}function gwe(){const t=this.hot.getSelectedRangeLast(),{highlight:e}=t;if(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader()){jf(Bi,this,e.clone());return}for(let n=0;n<this.mergedCellsCollection.mergedCells.length;n+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[n].getRange(),!1);for(let n=0;n<this.mergedCellsCollection.mergedCells.length;n+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[n].getRange(),!1);const r=this.mergedCellsCollection.get(e.row,e.col);jf(Bi,this,e.clone()),r&&e.assign(r)}function mwe(t,e){if(t<0||e<0)return;const r=this.mergedCellsCollection.get(t,e);if(!r)return;const{row:n,col:i,colspan:s,rowspan:o}=r;return[n,i,n+o-1,i+s-1]}function pwe(t){t.items.push({name:"---------"},Qpe(this))}function wwe(t,e,r){const n=this.mergedCellsCollection.get(e,r),i=at(n)?_s(n):void 0;if(at(i)){const{rowIndexMapper:s,columnIndexMapper:o}=this.hot,{row:a,col:l,colspan:c,rowspan:u}=i,[h,d]=this.translateMergedCellToRenderable(a,u,l,c),f=s.getRenderableFromVisualIndex(e),g=o.getRenderableFromVisualIndex(r),m=h-f+1,p=d-g+1;i.row=s.getNearestNotHiddenIndex(i.row,1),i.col=o.getNearestNotHiddenIndex(i.col,1),i.rowspan=Math.min(i.rowspan,m),i.colspan=Math.min(i.colspan,p)}sx(t,i,e,r)}function FI(){jf(Bi,this,null)}function vwe(){if(qt(Bi,this).isCell())return;const t=this.hot.getSelectedRangeLast(),e=t.getVerticalDirection(),r=t.getHorizontalDirection(),n=qt(Bi,this).clone().normalize();qt(lo,this).setActiveNode(n.row,n.col),qt(Vi,this).row>0||qt(Vi,this).col>0?qt(lo,this).setPrevNodeAsActive():(r==="E-W"&&qt(Vi,this).col<0||e==="S-N"&&qt(Vi,this).row<0)&&qt(lo,this).setNextNodeAsActive()}function Cwe(t,e){const r=this.hot.getSelectedRangeLast(),{columnIndexMapper:n,rowIndexMapper:i}=this.hot;let s=null,o=null;if(qt(Vi,this).col<0){const{rowEnd:a,colEnd:l}=qt(lo,this).getPrevHorizontalNode();o=n.getNearestNotHiddenIndex(l,-1),s=i.getNearestNotHiddenIndex(a,-1)}else if(qt(Vi,this).col>0){const{rowStart:a,colStart:l}=qt(lo,this).getNextHorizontalNode();o=n.getNearestNotHiddenIndex(l,1),s=i.getNearestNotHiddenIndex(a,1)}else if(qt(Vi,this).row<0){const{rowEnd:a,colEnd:l}=qt(lo,this).getPrevVerticalNode();o=n.getNearestNotHiddenIndex(l,-1),s=i.getNearestNotHiddenIndex(a,-1)}else if(qt(Vi,this).row>0){const{rowStart:a,colStart:l}=qt(lo,this).getNextVerticalNode();o=n.getNearestNotHiddenIndex(l,1),s=i.getNearestNotHiddenIndex(a,1)}if(s!==null||o!==null){const a=this.hot._createCellCoords(s,o),l=this.mergedCellsCollection.get(a.row,a.col),c=this.hot.selection.highlight.getFocus();t=a.row,e=a.col,l?r.highlight.assign({row:this.hot.rowIndexMapper.getNearestNotHiddenIndex(l.row,1),col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(l.col,1)}):r.highlight.assign(a),c.clear(),c.add(a).commit()}qt(lo,this).setActiveNode(t,e),jf(Vi,this,{row:0,col:0})}function Swe(){this.hot.getSelectedRangeLast().isHeader()||qt(lo,this).buildFocusOrder(this.hot.getSelectedRangeLast())}function xwe(t,e,r){const n=this.mergedCellsCollection.get(t,e);n&&(n.row!==t||n.col!==e?r.copyable=!1:(r.rowspan=n.rowspan,r.colspan=n.colspan))}function ywe(t){const e=this.hot.countCols();this.modifyViewportRowStart(t,e),this.modifyViewportRowEnd(t,e)}function bwe(t){const e=this.hot.countRows();this.modifyViewportColumnStart(t,e),this.modifyViewportColumnEnd(t,e)}function Ewe(t,e){this.autofillCalculations.correctSelectionAreaSize(e);const r=this.autofillCalculations.getDirection(e,t);let n=t;if(this.autofillCalculations.dragAreaOverlapsCollections(e,n,r))return n=e,n;const i=this.mergedCellsCollection.getWithinRange({from:{row:e[0],col:e[1]},to:{row:e[2],col:e[3]}});return i&&(n=this.autofillCalculations.snapDragArea(e,n,r,i)),n}function Rwe(t,e){this.mergedCellsCollection.shiftCollections("right",t,e)}function Twe(t,e){this.mergedCellsCollection.shiftCollections("left",t,e)}function _we(t,e,r){r!=="auto"&&this.mergedCellsCollection.shiftCollections("down",t,e)}function Awe(t,e){this.mergedCellsCollection.shiftCollections("up",t,e)}function Mwe(t,e){e==="Autofill.fill"&&this.autofillCalculations.recreateAfterDataPopulation(t)}function Iwe(t,e){if(e&&e==="area"){const r=this.hot.getSelectedRangeLast(),n=this.mergedCellsCollection.getWithinRange(r);j(n,i=>{r.getBottomEndCorner().row===i.getLastRow()&&r.getBottomEndCorner().col===i.getLastColumn()&&(t[2]=i.row,t[3]=i.col)})}}function Owe(t,e,r,n){if(r)return this.selectionCalculations.getSelectedMergedCellClassName(t,e,r,n)}function Pwe(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function Dwe(t,e,r,n){if(!(n instanceof MouseEvent))return;const i=this.hot.getSelectedRangeLast(),s=this.mergedCellsCollection.getByRange(i);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&&i.isEqual(this.hot._createCellRange(o,o,a))}function kwe(t,e){return function(r,n){const[,...i]=r,[,...s]=n;return function o(a){const l=t[a],c=e[a],u=i[a],h=s[a],d=c.multiColumnSorting,g=(d.compareFunctionFactory?d.compareFunctionFactory:H2(c.type))(l,c,d)(u,h);if(g===ho){const m=a+1;if(typeof e[m]<"u")return o(m)}return g}(0)}}function LI(){Vt(Dt`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously.
  131. Only \`multiColumnSorting\` will work.`)}const rF="sort";function Nwe(t,e,r){const n=[];return r===!1||t.isColumnSorted(e)&&t.getNumberOfSortedColumns()>1&&n.push(`${rF}-${t.getIndexOfColumnInSortQueue(e)+1}`),n}function Hwe(t){const e=t.className.split(" "),r=new RegExp(`^${rF}-[0-9]{1,2}$`);return e.filter(n=>r.test(n))}function Fwe(t,e,r){return e=Lwe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lwe(t){var e=$we(t,"string");return typeof e=="symbol"?e:e+""}function $we(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const jp="multiColumnSorting",Bwe=170,$I="columnSorting",BI=jp;N2(jp,kwe);class Vwe extends z2{constructor(){super(...arguments),Fwe(this,"pluginKey",jp)}static get PLUGIN_KEY(){return jp}static get PLUGIN_PRIORITY(){return Bwe}isEnabled(){return super.isEnabled()}enablePlugin(){!this.enabled&&this.hot.getSettings()[this.pluginKey]&&this.hot.getSettings()[$I]&&LI(),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,Mp)),!1},runOnlyIf:()=>{var e,r;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n&&((r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.isSingle())&&this.hot.selection.isCellVisible(n)&&n.isHeader()},relativeToGroup:Cl,position:"before",group:BI})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(BI)}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 r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];super.updateHeaderClasses(e,...n),rt(e,Hwe(e)),this.enabled!==!1&&Re(e,Nwe(...n))}onUpdateSettings(e){this.hot.getSettings()[this.pluginKey]&&this.hot.getSettings()[$I]&&LI(),super.onUpdateSettings(e)}onAfterOnCellMouseDown(e,r){eR(r.row,r.col,e)!==!1&&this.wasClickableHeaderClicked(e,r.col)&&(this.hot.getShortcutManager().isCtrlPressed()?(this.hot.deselectCell(),this.hot.selectColumns(r.col),this.sort(this.getNextSortConfig(r.col,Mp))):this.sort(this.getColumnNextConfig(r.col)))}}function VI(t,e,r){return e=Wwe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wwe(t){var e=Uwe(t,"string");return typeof e=="symbol"?e:e+""}function Uwe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Ywe="multipleSelectionHandles",zwe=160;class Gwe extends Pt{constructor(){super(...arguments),VI(this,"dragged",[]),VI(this,"lastSetCell",null)}static get PLUGIN_KEY(){return Ywe}static get PLUGIN_PRIORITY(){return zwe}isEnabled(){return Qa()}enablePlugin(){this.enabled||(this.registerListeners(),super.enablePlugin())}registerListeners(){const e=this,{rootElement:r}=this.hot;function n(i){if(e.dragged.length===1)return e.dragged.splice(0,e.dragged.length),!0;const s=e.dragged.indexOf(i);if(s===-1)return!1;s===0?e.dragged=e.dragged.slice(0,1):s===1&&(e.dragged=e.dragged.slice(-1))}this.eventManager.addEventListener(r,"touchstart",i=>{let s;if(Ze(i.target,"topSelectionHandle-HitArea"))return s=e.hot.getSelectedRangeLast(),e.dragged.push("top"),e.touchStartRange={width:s.getWidth(),height:s.getHeight(),direction:s.getDirection()},i.preventDefault(),!1;if(Ze(i.target,"bottomSelectionHandle-HitArea"))return s=e.hot.getSelectedRangeLast(),e.dragged.push("bottom"),e.touchStartRange={width:s.getWidth(),height:s.getHeight(),direction:s.getDirection()},i.preventDefault(),!1}),this.eventManager.addEventListener(r,"touchend",i=>{if(Ze(i.target,"topSelectionHandle-HitArea"))return n.call(e,"top"),e.touchStartRange=void 0,i.preventDefault(),!1;if(Ze(i.target,"bottomSelectionHandle-HitArea"))return n.call(e,"bottom"),e.touchStartRange=void 0,i.preventDefault(),!1}),this.eventManager.addEventListener(r,"touchmove",i=>{const{rootDocument:s}=this.hot;let o,a,l,c,u,h;if(e.dragged.length===0)return;const d=s.elementFromPoint(i.touches[0].clientX,i.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(),c=a.getHeight(),u=a.getDirection(),l===1&&c===1&&e.hot.selection.setRangeEnd(o),h=e.getCurrentRangeCoords(a,o,e.touchStartRange.direction,u,e.dragged[0]),h.start!==null&&e.hot.selection.setRangeStart(h.start),e.hot.selection.setRangeEnd(h.end),e.lastSetCell=d),i.preventDefault())})}getCurrentRangeCoords(e,r,n,i,s){const o=e.getTopStartCorner(),a=e.getBottomEndCorner(),l=e.getBottomStartCorner(),c=e.getTopEndCorner();let u={start:null,end:null};switch(n){case"NE-SW":switch(i){case"NE-SW":case"NW-SE":s==="top"?u={start:this.hot._createCellCoords(r.row,e.highlight.col),end:this.hot._createCellCoords(l.row,r.col)}:u={start:this.hot._createCellCoords(e.highlight.row,r.col),end:this.hot._createCellCoords(r.row,o.col)};break;case"SE-NW":s==="bottom"&&(u={start:this.hot._createCellCoords(a.row,r.col),end:this.hot._createCellCoords(r.row,o.col)});break}break;case"NW-SE":switch(i){case"NE-SW":s==="top"?u={start:r,end:l}:u.end=r;break;case"NW-SE":s==="top"?u={start:r,end:a}:u.end=r;break;case"SE-NW":s==="top"?u={start:r,end:o}:u.end=r;break;case"SW-NE":s==="top"?u={start:r,end:c}:u.end=r;break}break;case"SW-NE":switch(i){case"NW-SE":s==="bottom"?u={start:this.hot._createCellCoords(r.row,o.col),end:this.hot._createCellCoords(l.row,r.col)}:u={start:this.hot._createCellCoords(o.row,r.col),end:this.hot._createCellCoords(r.row,a.col)};break;case"SW-NE":s==="top"?u={start:this.hot._createCellCoords(e.highlight.row,r.col),end:this.hot._createCellCoords(r.row,a.col)}:u={start:this.hot._createCellCoords(r.row,o.col),end:this.hot._createCellCoords(o.row,r.col)};break;case"SE-NW":s==="bottom"?u={start:this.hot._createCellCoords(r.row,c.col),end:this.hot._createCellCoords(o.row,r.col)}:s==="top"&&(u={start:l,end:r});break}break;case"SE-NW":switch(i){case"NW-SE":case"NE-SW":case"SW-NE":s==="top"&&(u.end=r);break;case"SE-NW":s==="top"?u.end=r:u={start:r,end:o};break}break}return u}isDragged(){return this.dragged.length>0}}function ax(){let{label:t="",colspan:e=1,origColspan:r=1,collapsible:n=!1,crossHiddenColumns:i=[],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:r,collapsible:n,isCollapsed:s,crossHiddenColumns:i,isHidden:o,isRoot:a,isPlaceholder:l}}function nF(){return{label:"",isPlaceholder:!0}}function jwe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0;const r=[];if(e===0)return r;j(t,i=>{const s=[];let o=0;r.push(s),j(i,a=>{const l=ax();if(at(a)){const{label:u,colspan:h}=a;l.label=Ar(u),typeof h=="number"&&h>1&&(l.colspan=h,l.origColspan=h)}else l.label=Ar(a);o+=l.origColspan;let c=!1;if(o>=e&&(l.colspan=l.origColspan-(o-e),l.origColspan=l.colspan,c=!0),s.push(l),l.colspan>1)for(let u=0;u<l.colspan-1;u++)s.push(nF());return!c})});const n=Math.max(...wt(r,i=>i.length));return j(r,i=>{if(i.length<n){const s=wt(new Array(n-i.length),()=>ax());i.splice(i.length,0,...s)}}),r}function O1(t,e,r){Kwe(t,e),e.set(t,r)}function Kwe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function os(t,e){return t.get(iF(t,e))}function _d(t,e,r){return t.set(iF(t,e),r),r}function iF(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const WI=["label","collapsible"];var Lo=new WeakMap,Ql=new WeakMap,P1=new WeakMap;class Xwe{constructor(){O1(this,Lo,[]),O1(this,Ql,0),O1(this,P1,1/0)}setColumnsLimit(e){_d(P1,this,e)}setData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];_d(Lo,this,jwe(e,os(P1,this))),_d(Ql,this,os(Lo,this).length)}getData(){return os(Lo,this)}mergeWith(e){j(e,r=>{let{row:n,col:i,...s}=r;const o=this.getHeaderSettings(n,i);o!==null&&kr(o,s,WI)})}map(e){j(os(Lo,this),r=>{j(r,n=>{const i=e({...n});at(i)&&kr(n,i,WI)})})}getHeaderSettings(e,r){var n;if(e>=os(Ql,this)||e<0)return null;const i=os(Lo,this)[e];return Array.isArray(i)===!1||r>=i.length?null:(n=i[r])!==null&&n!==void 0?n:null}getHeadersSettings(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const i=[];if(e>=os(Ql,this)||e<0)return i;const s=os(Lo,this)[e];let o=0;for(let a=r;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,i.push(l),l.colspan>1&&(a+=l.colspan-1),o===n)break;if(o>n)throw new Error("The last column settings cannot overlap the other header layers")}return i}getLayersCount(){return os(Ql,this)}getColumnsCount(){return os(Ql,this)>0?os(Lo,this)[0].length:0}clear(){_d(Lo,this,[]),_d(Ql,this,0)}}function D1(t,e,r){return e=qwe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qwe(t){var e=Zwe(t,"string");return typeof e=="symbol"?e:e+""}function Zwe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const sF="DF-pre-order";function oF(t,e){let r=t.call(e,this);for(let n=0;n<this.childs.length;n++){if(r===!1)return!1;r=oF.call(this.childs[n],t,e)}return r}const Jwe="DF-post-order";function aF(t,e){for(let r=0;r<this.childs.length;r++)if(aF.call(this.childs[r],t,e)===!1)return!1;return t.call(e,this)}const lF="BF";function Qwe(t,e){const r=[this];function n(){if(r.length===0)return;const i=r.shift();r.push(...i.childs),t.call(e,i)!==!1&&n()}n()}const eve=lF,UI=new Map([[sF,oF],[Jwe,aF],[lF,Qwe]]);class Kp{constructor(e){D1(this,"data",{}),D1(this,"parent",null),D1(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 r=new Kp({...e.data});for(let n=0;n<e.childs.length;n++)r.addChild(this.cloneTree(e.childs[n]));return r}replaceTreeWith(e){this.data={...e.data},this.childs=[];for(let r=0;r<e.childs.length;r++)this.addChild(e.childs[r])}walkDown(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:eve;if(!UI.has(r))throw new Error(`Traversal strategy "${r}" does not exist`);UI.get(r).call(this,e,this)}walkUp(e){const r=this,n=i=>{e.call(r,i)!==!1&&i.parent!==null&&n(i.parent)};n(this)}}function k1(t,e,r){tve(t,e),e.set(t,r)}function tve(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function An(t,e){return t.get(cF(t,e))}function rve(t,e,r){return t.set(cF(t,e),r),r}function cF(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var _u=new WeakMap,ec=new WeakMap,Au=new WeakMap;class nve{constructor(e){k1(this,_u,new Map),k1(this,ec,new Map),k1(this,Au,null),rve(Au,this,e)}getRoots(){return Array.from(An(_u,this).values())}getRootByColumn(e){let r;return An(ec,this).has(e)&&(r=An(_u,this).get(An(ec,this).get(e))),r}getNode(e,r){const n=this.getRootByColumn(r);if(!n)return;const i=r-An(ec,this).get(r);let s=0,o;return n.walkDown(a=>{const{data:{origColspan:l,headerLevel:c}}=a;if(e===c){if(i>=s&&i<=s+l-1)return o=a,o.data.isRoot=r===o.data.columnIndex,!1;s+=l}}),o}rebuildTreeIndex(){let e=0;An(ec,this).clear(),j(An(_u,this),r=>{let[,{data:{colspan:n}}]=r;for(let i=e;i<e+n;i++)An(ec,this).set(i,e);e+=n})}buildTree(){this.clear();const e=An(Au,this).getColumnsCount();let r=0;for(;r<e;){const n=An(Au,this).getHeaderSettings(0,r),i=new Kp;An(_u,this).set(r,i),this.buildLeaves(i,r,0,n.origColspan),r+=n.origColspan}this.rebuildTreeIndex()}buildLeaves(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;const s=An(Au,this).getHeadersSettings(n,r,i);n+=1,j(s,o=>{const a={...o,headerLevel:n-1,columnIndex:r};let l;n===1?(e.data=a,l=e):(l=new Kp(a),e.addChild(l)),n<An(Au,this).getLayersCount()&&this.buildLeaves(l,r,n,o.origColspan),r+=o.origColspan})}clear(){An(_u,this).clear(),An(ec,this).clear()}}function uF(t,e){t.walkDown(r=>{let{data:n,childs:i}=r;if(!n.isHidden&&(e(n.columnIndex),i.length===0))for(let s=1;s<n.colspan;s++)e(n.columnIndex+s)})}function Xp(t,e){let{childs:r}=t;if(r.length!==0)return r[0].data[e]}function qp(t){return Xp(t,"origColspan")===t.data.origColspan}function mR(t){const{data:e,childs:r}=t;if(!e.isCollapsed||e.isHidden||e.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(qp(t))return mR(r[0]);e.isCollapsed=!1;const i=r.slice(1),s=new Set;let o=0;if(i.length>0)j(i,a=>{a.replaceTreeWith(a.data.clonedTree),a.data.clonedTree=null;const l=a.data;o+=l.colspan,uF(a,c=>{s.add(c)})});else{const{colspan:a,origColspan:l,columnIndex:c}=e;o=l-a;for(let u=1;u<l;u++)s.add(c+u)}return t.walkUp(a=>{const{data:l}=a;l.colspan+=o,l.colspan>=l.origColspan?(l.colspan=l.origColspan,l.isCollapsed=!1):qp(a)&&(l.isCollapsed=Xp(a,"isCollapsed"))}),{rollbackModification:()=>pR(t),affectedColumns:Array.from(s),colspanCompensation:o}}function pR(t){var e;const{data:r,childs:n}=t;if(r.isCollapsed||r.isHidden||r.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(qp(t))return pR(n[0]);r.isCollapsed=!0;const s=n.slice(1),o=new Set;if(s.length>0)j(s,l=>{uF(l,c=>{o.add(c)}),l.data.clonedTree=l.cloneTree(),l.walkDown(c=>{let{data:u}=c;u.isHidden=!0})});else{const{origColspan:l,columnIndex:c}=r;for(let u=1;u<l;u++){const h=c+u;o.add(h)}}const a=r.colspan-((e=Xp(t,"colspan"))!==null&&e!==void 0?e:1);return t.walkUp(l=>{const{data:c}=l;c.colspan-=a,c.colspan<=1?(c.colspan=1,c.isCollapsed=!0):qp(l)&&(c.isCollapsed=Xp(l,"isCollapsed"))}),{rollbackModification:()=>mR(t),affectedColumns:Array.from(o),colspanCompensation:a}}function ive(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(Dt`The passed node is not the last node on the tree. Only for\x20
  132. the last node, the hide column modification can be applied.`);const{crossHiddenColumns:r}=t.data;if(r.includes(e))return;let n=!1;t.walkUp(i=>{const{data:{collapsible:s}}=i;if(s)return n=!0,!1}),!n&&t.walkUp(i=>{const{data:s}=i;s.crossHiddenColumns.push(e),s.colspan>1?s.colspan-=1:s.isHidden=!0})}function sve(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(Dt`The passed node is not the last node on the tree. Only for\x20
  133. the last node, the show column modification can be applied.`);const{crossHiddenColumns:r}=t.data;if(!r.includes(e))return;let n=!1;t.walkUp(i=>{const{data:{collapsible:s}}=i;if(s)return n=!0,!1}),!n&&t.walkUp(i=>{const{data:s}=i;s.crossHiddenColumns.splice(s.crossHiddenColumns.indexOf(e),1),!s.isHidden&&s.colspan<s.origColspan&&(s.colspan+=1),s.isHidden=!1})}const YI=new Map([["collapse",pR],["expand",mR],["hide-column",ive],["show-column",sve]]);function ove(t,e,r){if(!YI.has(t))throw new Error(`The node modifier action ("${t}") does not exist.`);return YI.get(t)(e,r)}function vm(t){const e=[];return j(t,r=>{r.walkDown(n=>{const i=n.data,{origColspan:s,columnIndex:o,headerLevel:a,crossHiddenColumns:l}=i,c=lve(e,a);let u=!1;for(let h=o;h<o+s;h++)if(l.includes(h)||u)c.push(nF());else{const f=ave(i);f.isRoot=!0,c.push(f),u=!0}})}),e}function ave(t){const{crossHiddenColumns:e,...r}=ax(t);return r}function lve(t,e){let r;return Array.isArray(t[e])?r=t[e]:(r=[],t[e]=r),r}function N1(t,e,r){cve(t,e),e.set(t,r)}function cve(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ad(t,e,r){return t.set(hF(t,e),r),r}function ur(t,e){return t.get(hF(t,e))}function hF(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var Zs=new WeakMap,Kn=new WeakMap,tc=new WeakMap;class uve{constructor(){N1(this,Zs,new Xwe),N1(this,Kn,new nve(ur(Zs,this))),N1(this,tc,[[]])}setState(e){ur(Zs,this).setData(e);let r=!1;try{ur(Kn,this).buildTree()}catch{ur(Kn,this).clear(),ur(Zs,this).clear(),r=!0}return Ad(tc,this,vm(ur(Kn,this).getRoots())),r}setColumnsLimit(e){ur(Zs,this).setColumnsLimit(e)}mergeStateWith(e){const r=wt(e,n=>{let{row:i,...s}=n;return{row:i<0?this.rowCoordsToLevel(i):i,...s}});ur(Zs,this).mergeWith(r),ur(Kn,this).buildTree(),Ad(tc,this,vm(ur(Kn,this).getRoots()))}mapState(e){ur(Zs,this).map(e),ur(Kn,this).buildTree(),Ad(tc,this,vm(ur(Kn,this).getRoots()))}mapNodes(e){return Rn(ur(Kn,this).getRoots(),(r,n)=>(n.walkDown(i=>{const s=e(i.data);s!==void 0&&r.push(s)}),r),[])}triggerNodeModification(e,r,n){r<0&&(r=this.rowCoordsToLevel(r));const i=ur(Kn,this).getNode(r,n);let s;return i&&(s=ove(e,i,n),Ad(tc,this,vm(ur(Kn,this).getRoots()))),s}triggerColumnModification(e,r){return this.triggerNodeModification(e,-1,r)}rowCoordsToLevel(e){if(e>=0)return null;const r=e+Math.max(this.getLayersCount(),1);return r<0?null:r}levelToRowCoords(e){if(e<0)return null;const r=e-Math.max(this.getLayersCount(),1);return r>=0?null:r}getHeaderSettings(e,r){var n,i;return e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount()?null:(n=(i=ur(tc,this)[e])===null||i===void 0?void 0:i[r])!==null&&n!==void 0?n:null}getHeaderTreeNodeData(e,r){const n=this.getHeaderTreeNode(e,r);return n?{...n.data}:null}getHeaderTreeNode(e,r){if(e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount())return null;const n=ur(Kn,this).getNode(e,r);return n||null}findTopMostEntireHeaderLevel(e){var r;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;const i=n-e+1;let s=!1,o=null;for(let a=e;a<=n;a++){const l=ur(Kn,this).getRootByColumn(a);if(!l)break;s=!0,l.walkDown(c=>{const{columnIndex:u,headerLevel:h,origColspan:d,isHidden:f}=c.data;f||d<=i&&u>=e&&u+d-1<=n&&(o===null||h<o)&&(o=h)},sF)}return s&&o===null?-1:this.levelToRowCoords((r=o)!==null&&r!==void 0?r:0)}findLeftMostColumnIndex(e,r){var n;const{isRoot:i}=(n=this.getHeaderSettings(e,r))!==null&&n!==void 0?n:{isRoot:!0};if(i)return r;let s=r-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,r){var n;const{isRoot:i,origColspan:s}=(n=this.getHeaderSettings(e,r))!==null&&n!==void 0?n:{isRoot:!0,origColspan:1};if(i)return r+s-1;let o=r+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 ur(Zs,this).getLayersCount()}getColumnsCount(){return ur(Zs,this).getColumnsCount()}clear(){Ad(tc,this,[]),ur(Zs,this).clear(),ur(Kn,this).clear()}}function Md(t,e,r){return e=hve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hve(t){var e=dve(t,"string");return typeof e=="symbol"?e:e+""}function dve(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class fve{constructor(e,r){Md(this,"hot",void 0),Md(this,"nestedHeaderSettingsGetter",void 0),Md(this,"layersCount",0),Md(this,"container",void 0),Md(this,"widthsMap",void 0),this.hot=e,this.nestedHeaderSettingsGetter=r,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"),r=e.length;this.widthsMap.clear();for(let n=0;n<r;n++){const i=this.hot.columnIndexMapper.getVisualFromRenderableIndex(n),s=this.hot.toPhysicalColumn(i);this.widthsMap.setValueAtIndex(s,e[n].offsetWidth)}this.container.parentNode.removeChild(this.container),this.container=null}_buildGhostTable(e){const{rootDocument:r,columnIndexMapper:n}=this.hot,i=r.createDocumentFragment(),s=r.createElement("table"),o=!!this.hot.getSettings().dropdownMenu,a=n.getRenderableIndexesLength();for(let l=0;l<this.layersCount;l++){const c=r.createElement("tr");for(let u=0;u<a;u++){let h=n.getVisualFromRenderableIndex(u);h===null&&(h=u);const d=r.createElement("th"),f=this.nestedHeaderSettingsGetter(l,h);if(f&&(!f.isPlaceholder||f.isHidden)){let g=f.label;o&&(g+='<button class="changeType"></button>'),Ch(d,g),d.colSpan=f.colspan,c.appendChild(d)}}s.appendChild(c)}i.appendChild(s),e.appendChild(i)}clear(){this.widthsMap.clear(),this.container=null}}function gve(t,e){dF(t,e),e.add(t)}function zI(t,e,r){return e=mve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mve(t){var e=pve(t,"string");return typeof e=="symbol"?e:e+""}function pve(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Cm(t,e,r){dF(t,e),e.set(t,r)}function dF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dc(t,e,r){return t.set(hr(t,e),r),r}function xt(t,e){return t.get(hr(t,e))}function hr(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const GI="nestedHeaders",wve=280;var Ft=new WeakMap,Na=new WeakMap,Sf=new WeakMap,ev=new WeakMap,vr=new WeakSet;class vve extends Pt{constructor(){super(...arguments),gve(this,vr),Cm(this,Ft,new uve),Cm(this,Na,null),Cm(this,Sf,null),Cm(this,ev,!1),zI(this,"ghostTable",new fve(this.hot,(e,r)=>this.getHeaderSettings(e,r))),zI(this,"detectedOverlappedHeaders",!1)}static get PLUGIN_KEY(){return GI}static get PLUGIN_PRIORITY(){return wve}isEnabled(){return!!this.hot.getSettings()[GI]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:r}=this.hot.getSettings();(!Array.isArray(r)||!Array.isArray(r[0]))&&Vt(Dt`Your Nested Headers plugin configuration is invalid. The settings has to be\x20
  134. passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",()=>hr(vr,this,kve).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return hr(vr,e,Nve).call(e,...i)}),this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return hr(vr,e,yve).call(e,...i)}),this.addHook("afterOnCellMouseDown",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return hr(vr,e,bve).call(e,...i)}),this.addHook("beforeOnCellMouseOver",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return hr(vr,e,Eve).call(e,...i)}),this.addHook("beforeOnCellMouseUp",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return hr(vr,e,Rve).call(e,...i)}),this.addHook("beforeSelectionHighlightSet",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return hr(vr,e,Tve).call(e,...i)}),this.addHook("modifyTransformStart",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return hr(vr,e,_ve).call(e,...i)}),this.addHook("afterSelection",()=>hr(vr,this,Sm).call(this)),this.addHook("afterSelectionFocusSet",()=>hr(vr,this,Sm).call(this)),this.addHook("beforeViewportScrollHorizontally",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return hr(vr,e,Cve).call(e,...i)}),this.addHook("afterGetColumnHeaderRenderers",n=>hr(vr,this,Mve).call(this,n)),this.addHook("modifyColWidth",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return hr(vr,e,Ove).call(e,...i)}),this.addHook("modifyColumnHeaderValue",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return hr(vr,e,Pve).call(e,...i)}),this.addHook("beforeHighlightingColumnHeader",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return hr(vr,e,Sve).call(e,...i)}),this.addHook("beforeCopy",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return hr(vr,e,xve).call(e,...i)}),this.addHook("beforeSelectColumns",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return hr(vr,e,Ave).call(e,...i)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return hr(vr,e,Ive).call(e,...i)}),this.addHook("modifyFocusedElement",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return hr(vr,e,Dve).call(e,...i)}),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",()=>hr(vr,this,Sm).call(this)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",()=>hr(vr,this,Sm).call(this)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();xt(Ft,this).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=xt(Ft,this).setState(e)),this.detectedOverlappedHeaders&&Vt(Dt`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
  135. is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((r,n)=>{const i=r===!0?"hide-column":"show-column";xt(Ft,this).triggerColumnModification(i,n)}),!xt(Na,this)&&this.enabled&&dc(Na,this,this.hot.columnIndexMapper.createChangesObserver("hiding").subscribe(r=>{r.forEach(n=>{let{op:i,index:s,newValue:o}=n;if(i==="replace"){const a=o===!0?"hide-column":"show-column";xt(Ft,this).triggerColumnModification(a,s)}}),this.ghostTable.buildWidthsMap()})),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.clearColspans(),xt(Ft,this).clear(),xt(Na,this).unsubscribe(),dc(Na,this,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return xt(Ft,this)}getLayersCount(){return xt(Ft,this).getLayersCount()}getHeaderSettings(e,r){return xt(Ft,this).getHeaderSettings(e,r)}clearColspans(){if(!this.hot.view)return;const{_wt:e}=this.hot.view,r=e.getSetting("columnHeaders").length,n=e.wtTable.THEAD,i=e.wtOverlays.topOverlay.clone.wtTable.THEAD,s=e.wtOverlays.topInlineStartCornerOverlay?e.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null;for(let o=0;o<r;o++){const a=n.childNodes[o];if(!a)break;const l=i.childNodes[o],c=s?s.childNodes[o]:null;for(let u=0,h=a.childNodes.length;u<h;u++)a.childNodes[u].removeAttribute("colspan"),rt(a.childNodes[u],"hiddenHeader"),l&&l.childNodes[u]&&(l.childNodes[u].removeAttribute("colspan"),rt(l.childNodes[u],"hiddenHeader")),s&&c&&c.childNodes[u]&&(c.childNodes[u].removeAttribute("colspan"),rt(c.childNodes[u],"hiddenHeader"))}}headerRendererFactory(e){var r=this;const n=this.hot.view._wt.getSetting("fixedColumnsStart");return(i,s)=>{var o;const{columnIndexMapper:a,view:l}=this.hot;let c=a.getVisualFromRenderableIndex(i);c===null&&(c=i),s.removeAttribute("colspan"),rt(s,"hiddenHeader");const{colspan:u,isHidden:h,isPlaceholder:d}=(o=xt(Ft,this).getHeaderSettings(e,c))!==null&&o!==void 0?o:{label:""};if(d||h)Re(s,"hiddenHeader");else if(u>1){var f,g;const{wtOverlays:m}=l._wt,p=(f=m.topInlineStartCornerOverlay)===null||f===void 0?void 0:f.clone.wtTable.THEAD.contains(s),S=(g=m.inlineStartOverlay)===null||g===void 0?void 0:g.clone.wtTable.THEAD.contains(s),y=p||S?Math.min(u,n-i):u;y>1&&s.setAttribute("colspan",y)}this.hot.view.appendColHeader(c,s,function(){return r.getColumnHeaderValue(...arguments)},e)}}getColumnHeaderValue(e,r){var n;const{isHidden:i,isPlaceholder:s}=(n=xt(Ft,this).getHeaderSettings(r,e))!==null&&n!==void 0?n:{};return s||i?"":this.hot.getColHeader(e,r)}destroy(){dc(Ft,this,null),xt(Na,this)!==null&&(xt(Na,this).unsubscribe(),dc(Na,this,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return xt(Ft,this).getHeaderTreeNodeData(e.row,e.col)}}function Sm(){var t;const e=(t=this.hot)===null||t===void 0?void 0:t.getSelectedRangeLast();if(!e)return;const{highlight:r}=e;if(r.isHeader()&&r.col>=0){const i=xt(Ft,this).findLeftMostColumnIndex(r.row,r.col),s=this.hot.selection.highlight.getFocus();s.visualCellRange.highlight.col=i,s.visualCellRange.from.col=i,s.visualCellRange.to.col=i,s.commit()}}function Cve(t){const e=this.hot.getSelectedRangeLast();if(!e)return t;const{highlight:r}=e;if(!(r.isHeader()&&r.col>=0))return t;const i=this.hot.view.getFirstFullyVisibleColumn(),s=this.hot.view.getLastFullyVisibleColumn(),o=xt(Ft,this).findLeftMostColumnIndex(r.row,r.col),a=xt(Ft,this).findRightMostColumnIndex(r.row,r.col);return o<i&&a>s?t:o<i?o:a}function Sve(t,e,r){const n=xt(Ft,this).getHeaderTreeNodeData(e,t);if(!n)return t;const{columnCursor:i,selectionType:s,selectionWidth:o}=r,{isRoot:a,colspan:l}=xt(Ft,this).getHeaderSettings(e,t);if(s===Xy){if(!a)return n.columnIndex}else if(s===PN&&(l>o-i||!a))return null;return t}function xve(t,e,r){let{columnHeadersCount:n}=r;if(n!==0)for(let s=0;s<e.length;s++){const{startRow:o,startCol:a,endRow:l,endCol:c}=e[s],u=l-o+1,h=a-c+1;if(o>=0||h===1)break;for(let d=a;d<=c;d++)for(let f=o;f<=l;f++){var i;const g=u+f,m=d-a;if(m===0)continue;((i=xt(Ft,this).getHeaderTreeNodeData(f,d))===null||i===void 0?void 0:i.isRoot)===!1&&(t[g][m]="")}}}function yve(t,e,r,n){this._getHeaderTreeNodeDataByCoords(e)&&(n.column=!0)}function bve(t,e){const r=this._getHeaderTreeNodeDataByCoords(e);if(!r)return;dc(Sf,this,e.clone()),dc(ev,this,!0);const{selection:n}=this.hot,i=n.isSelected()?n.getSelectedRange().current():null,s=[],{columnIndex:o,origColspan:a}=r,l=!n.inInSelection(e);t.shiftKey&&i?e.col<i.from.col?s.push(i.getTopEndCorner().col,o,e.row):e.col>i.from.col?s.push(i.getTopStartCorner().col,o+a-1,e.row):s.push(o,o+a-1,e.row):(ky(t)||bc(t)&&l)&&s.push(o,o+a-1,e.row),n.selectColumns(...s)}function Eve(t,e,r,n){if(!this.hot.view.isMouseDown())return;const i=this._getHeaderTreeNodeDataByCoords(e);if(!i)return;const{columnIndex:s,origColspan:o}=i,a=this.hot.getSelectedRangeLast(),l=a.getTopStartCorner(),c=a.getBottomEndCorner(),{from:u}=a;n.column=!0,n.cell=!0;const h=[],d=Ht(e.row,-1/0,-1);e.col<u.col?h.push(c.col,s,d):e.col>u.col?h.push(l.col,s+o-1,d):h.push(s,s+o-1,d),this.hot.selection.selectColumns(...h)}function Rve(){dc(ev,this,!1)}function Tve(){const{navigableHeaders:t}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!xt(ev,this)||!t)return;const e=this.hot.getSelectedRangeLast(),r=e.getTopStartCorner().col,n=e.getBottomEndCorner().col,{columnIndex:i,origColspan:s}=xt(Ft,this).getHeaderTreeNodeData(xt(Sf,this).row,xt(Sf,this).col);if(e.setHighlight(xt(Sf,this)),s>e.getWidth()||i<r||i+s-1>n){const o=xt(Ft,this).findTopMostEntireHeaderLevel(Ht(r,i,i+s-1),Ht(n,i,i+s-1));e.highlight.row=o,e.highlight.col=e.from.col}}function _ve(t){const{highlight:e}=this.hot.getSelectedRangeLast(),r=this.hot._createCellCoords(e.row+t.row,e.col+t.col);if(!(r.isHeader()&&r.col>=0))return;const i=xt(Ft,this).findLeftMostColumnIndex(r.row,r.col),s=xt(Ft,this).findRightMostColumnIndex(r.row,r.col);if(t.col<0){const o=e.col>=i&&e.col<=s?i-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>=i&&e.col<=s?s+1:i,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 Ave(t,e){const r=t.row,n=this._getHeaderTreeNodeDataByCoords({row:r,col:t.col}),i=this._getHeaderTreeNodeDataByCoords({row:r,col:e.col});e.col<t.col?(n&&(t.col=n.columnIndex+n.origColspan-1),i&&(e.col=i.columnIndex)):e.col>=t.col&&(n&&(t.col=n.columnIndex),i&&(e.col=i.columnIndex+i.origColspan-1))}function Mve(t){t.length=0;for(let e=0;e<xt(Ft,this).getLayersCount();e++)t.push(this.headerRendererFactory(e))}function Ive(t){const e=xt(Ft,this).getLayersCount();let r=t.startColumn,n=!!e;for(let i=0;i<e;i++){const s=xt(Ft,this).findLeftMostColumnIndex(i,t.startColumn),o=this.hot.columnIndexMapper.getRenderableFromVisualIndex(s);if(s>=0&&(n=!1),Hn(o)&&o<t.startColumn){r=o;break}}t.startColumn=n?xt(Ft,this).getHeaderTreeNodeData(0,r).columnIndex:r}function Ove(t,e){const r=this.ghostTable.getWidth(e);return t>r?t:r}function Pve(t,e,r){var n;const{label:i}=(n=xt(Ft,this).getHeaderTreeNodeData(r,e))!==null&&n!==void 0?n:{label:""};return i}function Dve(t,e){if(t<0)return this.hot.getCell(t,xt(Ft,this).findLeftMostColumnIndex(t,e),!0)}function kve(){this.updatePlugin()}function Nve(t,e){e||this.updatePlugin()}function Id(t,e,r){return e=Hve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Hve(t){var e=Fve(t,"string");return typeof e=="symbol"?e:e+""}function Fve(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Lve{constructor(e,r){Id(this,"hot",void 0),Id(this,"data",null),Id(this,"plugin",void 0),Id(this,"parentReference",new WeakMap),Id(this,"cache",{levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap}),this.hot=r,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},Ue(0,this.data.length-1,e=>{this.cacheNode(this.data[e],0,null)})}cacheNode(e,r,n){this.cache.levels[r]||(this.cache.levels[r]=[],this.cache.levelCount+=1),this.cache.levels[r].push(e),this.cache.rows.push(e),this.cache.nodeInfo.set(e,{parent:n,row:this.cache.rows.length-1,level:r}),this.hasChildren(e)&&j(e.__children,i=>{this.cacheNode(i,r+1,e)})}getDataObject(e){return e==null?null:this.cache.rows[e]}readTreeNodes(e,r,n,i){let s=!1,o=r;if(isNaN(o)&&o.end)return o;let a=e;return a||(a={__children:this.data},s=!0,o-=1),n!=null&&o===n?{result:a,end:!0}:i!=null&&a===i?{result:o,end:!0}:(o+=1,a.__children&&j(a.__children,l=>{if(this.parentReference.set(l,s?null:a),o=this.readTreeNodes(l,o,n,i),isNaN(o)&&o.end)return!1}),o)}mockParent(){const e=this.mockNode();return e.__children=this.data,e}mockNode(){const e={};return dt(this.data[0],(r,n)=>{e[n]=null}),e}getRowIndex(e){return e==null?null:this.cache.nodeInfo.get(e).row}getRowIndexWithinParent(e){let r=null;isNaN(e)?r=e:r=this.getDataObject(e);const n=this.getRowParent(e);return n==null?this.data.indexOf(r):n.__children.indexOf(r)}countAllRows(){const e={__children:this.data};return this.countChildren(e)}countChildren(e){let r=0,n=e;return isNaN(n)||(n=this.getDataObject(n)),!n||!n.__children?0:(j(n.__children,i=>{r+=1,i.__children&&(r+=this.countChildren(i))}),r)}getRowParent(e){let r;return isNaN(e)?r=e:r=this.getDataObject(e),this.getRowObjectParent(r)}getRowObjectParent(e){return!e||typeof e!="object"?null:this.cache.nodeInfo.get(e).parent}getRowLevel(e){let r=null;return isNaN(e)?r=e:r=this.getDataObject(e),r?this.getRowObjectLevel(r):null}getRowObjectLevel(e){return e==null?null:this.cache.nodeInfo.get(e).level}hasChildren(e){let r=e;return isNaN(r)||(r=this.getDataObject(r)),!!(r.__children&&r.__children.length)}isChild(e){return this.getRowParent(e)!==null}getChild(e,r){var n;return((n=e.__children)===null||n===void 0?void 0:n[r])||null}isRowHighestLevel(e){return!this.isChild(e)}isParent(e){var r;let n=e;return isNaN(n)||(n=this.getDataObject(n)),n&&!!n.__children&&((r=n.__children)===null||r===void 0?void 0:r.length)!==0}addChild(e,r){let n=r;this.hot.runHooks("beforeAddChild",e,n);let i=null;e&&(i=this.getRowIndex(e)),this.hot.runHooks("beforeCreateRow",i+this.countChildren(e)+1,1);let s=e;e||(s=this.mockParent()),s.__children||(s.__children=[]),n||(n=this.mockNode()),s.__children.push(n),this.rewriteCache();const o=this.getRowIndex(n);this.hot.rowIndexMapper.insertIndexes(o,1),this.hot.runHooks("afterCreateRow",o,1),this.hot.runHooks("afterAddChild",e,n)}addChildAtIndex(e,r,n){let i=n,s;if(i||(i=this.mockNode()),this.hot.runHooks("beforeAddChild",e,i,r),e){const a=this.getRowIndex(e)+r+1;this.hot.runHooks("beforeCreateRow",a,1),e.__children.splice(r,null,i),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",r,1,"NestedRows.addChildAtIndex"),this.plugin.enableCoreAPIModifiers(),s=this.getRowIndex(this.data[r]);i=this.getDataObject(s),this.hot.runHooks("afterAddChild",e,i,r)}addSibling(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"below";const n=this.translateTrimmedRow(e),i=this.getRowParent(n),s=this.getRowIndexWithinParent(n);switch(r){case"below":this.addChildAtIndex(i,s+1,null);break;case"above":this.addChildAtIndex(i,s,null);break}}detachFromParent(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=null;const i=[];Array.isArray(e)?(Ue(e[0],e[2],d=>{const f=this.translateTrimmedRow(d);i.push(this.getDataObject(f))}),Ue(0,i.length-2,d=>{this.detachFromParent(i[d],!1)}),n=i[i.length-1]):n=e;const s=this.getRowIndex(n),o=this.countChildren(n),a=this.getRowIndexWithinParent(n),l=this.getRowParent(n),c=this.getRowParent(l),u=this.getRowIndex(c);let h=null;if(this.hot.runHooks("beforeDetachChild",l,n),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),c){h=u+this.countChildren(c);const f=this.getChild(c,this.countChildren(c)-1),g=this.getRowIndex(f);this.hot.runHooks("beforeCreateRow",g+1,o+1,this.plugin.pluginName),c.__children.push(n)}else h=this.hot.countRows()+1,this.hot.runHooks("beforeCreateRow",h-2,o+1,this.plugin.pluginName),this.data.push(n)}this.rewriteCache(),this.hot.runHooks("afterCreateRow",h-2,o+1,this.plugin.pluginName),this.hot.runHooks("afterDetachChild",l,n,this.getRowIndex(n)),r&&this.hot.render()}filterData(e,r,n){const i=[];j(n,s=>{i.push(this.getDataObject(s))}),j(i,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,r,n){const i=this.getDataObject(e-1);let s=null,o=e;i&&i.__children&&i.__children.length===0?(s=i,o=0):e<this.countAllRows()&&(s=this.getRowParent(e),o=this.getRowIndexWithinParent(e)),s?n?s.__children.splice(o,r,...n):s.__children.splice(o,r):n?this.data.splice(o,r,...n):this.data.splice(o,r),this.rewriteCache()}syncRowWithRawSource(e){let r=e,n=null;do n=this.getRowParent(n),n!==null&&(r=n);while(n!==null);this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndex(r),"__children",r.__children,"NestedRows.syncRowWithRawSource"),this.plugin.enableCoreAPIModifiers()}moveRow(e,r,n,i){const s=r===this.hot.countRows(),o=this.getRowParent(e),a=this.getRowIndexWithinParent(e),l=o.__children.slice(a,a+1),c=e>r;let u=s?this.getRowParent(r-1):this.getRowParent(r);u==null&&(u=this.getRowParent(r-1)),u==null&&(u=this.getDataObject(r-1)),u?u.__children||(u.__children=[]):(u=this.getDataObject(r),u.__children=[]);const h=s||n||i?u.__children.length:this.getRowIndexWithinParent(r),d=o===u;u.__children.splice(h,0,l[0]),o.__children.splice(a+(c&&d?1:0),1),this.syncRowWithRawSource(o),d||this.syncRowWithRawSource(u)}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 jI(t,e,r){return e=$ve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $ve(t){var e=Bve(t,"string");return typeof e=="symbol"?e:e+""}function Bve(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class wR{constructor(e,r){jI(this,"hot",void 0),jI(this,"plugin",void 0),this.hot=r,this.plugin=e}}class io extends wR{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,r){super(e,r),this.dataManager=this.plugin.dataManager,this.collapsingUI=this.plugin.collapsingUI,this.rowHeaderWidthCache=null}appendLevelIndicators(e,r){const n=this.hot.toPhysicalRow(e),i=this.dataManager.getRowLevel(n),s=this.dataManager.getDataObject(n),o=r.getElementsByTagName("DIV")[0],a=o.querySelector("span.rowHeader"),l=o.querySelectorAll('[class^="ht_nesting"]'),c=this.hot.getSettings().ariaTags;if(j(l,u=>{u&&o.removeChild(u)}),Re(r,io.CSS_CLASSES.indicatorContainer),i){const{rootDocument:u}=this.hot,h=a.cloneNode(!0);o.innerHTML="",Ue(0,i-1,()=>{const d=u.createElement("SPAN");Re(d,io.CSS_CLASSES.emptyIndicator),o.appendChild(d)}),o.appendChild(h)}if(this.dataManager.hasChildren(s)){const u=this.hot.rootDocument.createElement("DIV");c&&Xe(u,[fa()]),Re(r,io.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(n)?(Re(u,`${io.CSS_CLASSES.button} ${io.CSS_CLASSES.expandButton}`),c&&Xe(r,[Wi(!1)])):(Re(u,`${io.CSS_CLASSES.button} ${io.CSS_CLASSES.collapseButton}`),c&&Xe(r,[Wi(!0)])),o.appendChild(u)}}updateRowHeaderWidth(e){let r=e;r||(r=this.dataManager.cache.levelCount),this.rowHeaderWidthCache=Math.max(50,11+10*r+25),this.hot.render()}}class Vve extends wR{constructor(e,r){var n;super(e,r),n=this,this.dataManager=this.plugin.dataManager,this.collapsedRows=[],this.collapsedRowsStash={stash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;n.lastCollapsedRows=n.collapsedRows.slice(0),n.expandMultipleChildren(n.lastCollapsedRows,i)},shiftStash:function(i,s){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;s==null&&(s=1/0),j(n.lastCollapsedRows,(a,l)=>{a>=i&&a<s&&(n.lastCollapsedRows[l]=a+o)})},applyStash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;n.collapseMultipleChildren(n.lastCollapsedRows,i),n.lastCollapsedRows=void 0},trimStash:(i,s)=>{Ue(i,i+s-1,o=>{const a=this.lastCollapsedRows.indexOf(o);a>-1&&this.lastCollapsedRows.splice(a,1)})}}}collapseChildren(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];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)&&j(s.__children,l=>{i.push(this.dataManager.getRowIndex(l))}),a=this.collapseRows(i,!0,!1),n&&this.trimRows(a),r&&this.renderAndAdjust(),this.collapsedRows.indexOf(o)===-1&&this.collapsedRows.push(o),a}collapseMultipleChildren(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];j(e,s=>{i.push(...this.collapseChildren(s,!1,!1))}),n&&this.trimRows(i),r&&this.renderAndAdjust()}collapseRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.collapseRows([e],r)}collapseRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return j(e,s=>{i.push(s),r&&this.collapseChildRows(s,i)}),n&&this.trimRows(i),i}collapseChildRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);j(i.__children,s=>{const o=this.dataManager.getRowIndex(s);r.push(o),this.collapseChildRows(o,r)})}n&&this.trimRows(r)}expandRow(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.expandRows([e],r)}expandRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return j(e,s=>{i.push(s),r&&this.expandChildRows(s,i)}),n&&this.untrimRows(i),i}expandChildRows(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);j(i.__children,s=>{if(!this.isAnyParentCollapsed(s)){const o=this.dataManager.getRowIndex(s);r.push(o),this.expandChildRows(o,r)}})}n&&this.untrimRows(r)}expandChildren(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];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)&&j(s.__children,l=>{const c=this.dataManager.getRowIndex(l);i.push(c)}),a=this.expandRows(i,!0,!1),n&&this.untrimRows(a),r&&this.renderAndAdjust(),a}expandMultipleChildren(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];j(e,s=>{i.push(...this.expandChildren(s,!1,!1))}),n&&this.untrimRows(i),r&&this.renderAndAdjust()}collapseAll(){const e=this.dataManager.getData(),r=[];j(e,n=>{this.dataManager.hasChildren(n)&&r.push(n)}),this.collapseMultipleChildren(r),this.renderAndAdjust()}expandAll(){const e=this.dataManager.getData(),r=[];j(e,n=>{this.dataManager.hasChildren(n)&&r.push(n)}),this.expandMultipleChildren(r),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution(()=>{j(e,r=>{this.plugin.collapsedRowsMap.setValueAtIndex(r,!0)})},!0)}untrimRows(e){this.hot.batchExecution(()=>{j(e,r=>{this.plugin.collapsedRowsMap.setValueAtIndex(r,!1)})},!0)}areChildrenCollapsed(e){let r=isNaN(e)?e:this.dataManager.getDataObject(e),n=!0;return r===null&&(r={__children:this.dataManager.data}),this.dataManager.hasChildren(r)&&j(r.__children,i=>{const s=this.dataManager.getRowIndex(i);if(!this.plugin.collapsedRowsMap.getValueAtIndex(s))return n=!1,!1}),n}isAnyParentCollapsed(e){let r=e;for(;r!==null;){r=this.dataManager.getRowParent(r);const n=this.dataManager.getRowIndex(r);if(this.collapsedRows.indexOf(n)>-1)return!0}return!1}toggleState(e,r){if(r.col>=0)return;const n=this.translateTrimmedRow(r.row);Ze(e.target,io.CSS_CLASSES.button)&&(this.areChildrenCollapsed(n)?this.expandChildren(n):this.collapseChildren(n),Ps(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.render(),this.hot.view.adjustElementsSize()}}function Wve(t,e,r){Uve(t,e),e.set(t,r)}function Uve(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Yve(t,e,r){return e=zve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zve(t){var e=Gve(t,"string");return typeof e=="symbol"?e:e+""}function Gve(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jve(t,e){return t.get(Kve(t,e))}function Kve(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var KI=new WeakMap;class Xve extends wR{constructor(){super(...arguments),Yve(this,"dataManager",this.plugin.dataManager),Wve(this,KI,{row_above:(e,r)=>{const n=r[r.length-1];this.dataManager.addSibling(n.start.row,"above")},row_below:(e,r)=>{const n=r[r.length-1];this.dataManager.addSibling(n.start.row,"below")}})}appendOptions(e){const r=[{key:"add_child",name(){return this.getTranslatedPhrase(qb)},callback:()=>{const n=this.dataManager.translateTrimmedRow(this.hot.getSelectedLast()[0]),i=this.dataManager.getDataObject(n);this.dataManager.addChild(i)},disabled:()=>{const n=this.hot.getSelectedLast();return!n||n[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{key:"detach_from_parent",name(){return this.getTranslatedPhrase(Zb)},callback:()=>{this.dataManager.detachFromParent(this.hot.getSelectedLast())},disabled:()=>{const n=this.hot.getSelectedLast(),i=this.dataManager.translateTrimmedRow(n[0]);return!this.dataManager.getRowParent(i)||!n||n[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{name:"---------"}];return Ue(0,e.items.length-1,n=>{if(n===0)return j(r,(i,s)=>{e.items.splice(n+s,0,i)}),!1}),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return Ue(0,e.items.length-1,r=>{const n=jve(KI,this)[e.items[r].key];n!=null&&(e.items[r].callback=n)}),e}}function xm(t,e,r){return e=qve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qve(t){var e=Zve(t,"string");return typeof e=="symbol"?e:e+""}function Zve(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Jve{constructor(e){xm(this,"plugin",void 0),xm(this,"hot",void 0),xm(this,"dataManager",void 0),xm(this,"collapsingUI",void 0),this.plugin=e,this.hot=e.hot,this.dataManager=e.dataManager,this.collapsingUI=e.collapsingUI}onBeforeRowMove(e,r,n,i){if(this.displayAPICompatibilityWarning({rows:e,finalIndex:r,dropIndex:n,movePossible:i}))return!1;this.movedToCollapsed=!1;const o=n===this.hot.countRows(),a=o?this.hot.countSourceRows():this.dataManager.translateTrimmedRow(n);let l=!0;const c=e.map(g=>{if(!l)return!1;const m=this.dataManager.translateTrimmedRow(g);return l=this.shouldAllowMoving(m,a),m}),u=c.indexOf(a)===-1;if(!l||!u)return!1;const h=this.getBaseParent(c),d=this.getTargetParent(o,a),f=h===d;return this.movedToCollapsed=this.collapsingUI.areChildrenCollapsed(d),this.collapsingUI.collapsedRowsStash.stash(),this.shiftCollapsibleParentsLocations(c,a,f),this.moveRows(c,a,d),this.dataManager.rewriteCache(),this.moveCellsMeta(c,a),this.collapsingUI.collapsedRowsStash.applyStash(!1),this.hot.runHooks("afterRowMove",e,r,n,i,i&&this.isRowOrderChanged(e,r)),this.hot.render(),this.selectCells(e,n),!1}displayAPICompatibilityWarning(e){const{rows:r,finalIndex:n,dropIndex:i,movePossible:s}=e;let o=!1;return Zt(i)&&(Vt(Dt`Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\x20
  136. when the NestedRows plugin is enabled. Please use the 'dragRows' method instead.`),this.hot.runHooks("afterRowMove",r,n,i,s,!1),o=!0),o}shouldAllowMoving(e,r){return!(this.dataManager.isParent(e)||this.dataManager.isRowHighestLevel(e)||e===r||r===0)}getBaseParent(e){return this.dataManager.getRowParent(e[0])}getTargetParent(e,r){let n=this.dataManager.getRowParent(e?r-1:r);return n==null&&(n=this.dataManager.getRowParent(r-1)),n}shiftCollapsibleParentsLocations(e,r,n){n||(Math.max(...e)<=r?this.collapsingUI.collapsedRowsStash.shiftStash(e[0],r,-1*e.length):this.collapsingUI.collapsedRowsStash.shiftStash(r,e[0],e.length))}moveRows(e,r,n){const i=r===this.dataManager.getRowIndex(n)+this.dataManager.countChildren(n)+1;this.hot.batchRender(()=>{e.forEach(s=>{this.dataManager.moveRow(s,r,this.movedToCollapsed,i)})})}moveCellsMeta(e,r){const n=[],i=Math.max(...e)<r;e.forEach(s=>{n.push(this.hot.getCellMetaAtRow(s))}),this.hot.spliceCellsMeta(e[0],e.length),this.hot.spliceCellsMeta(r-(i?n.length:0),0,...n)}selectCells(e,r){const n=e.length;let i=0,s=0,o=null,a=null;if(this.movedToCollapsed){let l=null;e[n-1]<r?l=this.dataManager.translateTrimmedRow(r-n):l=this.dataManager.translateTrimmedRow(r);const c=this.dataManager.getRowParent(l===null?this.hot.countSourceRows()-1:l-1),u=this.dataManager.getRowIndex(c);i=this.dataManager.untranslateTrimmedRow(u),s=i}else e[n-1]<r?(s=r-1,i=s-n+1):(i=r,s=i+n-1);o=this.hot.selection,a=this.hot.countCols()-1,o.setRangeStart(this.hot._createCellCoords(i,0)),o.setRangeEnd(this.hot._createCellCoords(s,a),!0)}isRowOrderChanged(e,r){return e.some((n,i)=>n-i!==r)}}function Qve(t,e){fF(t,e),e.add(t)}function XI(t,e,r){fF(t,e),e.set(t,r)}function fF(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function H1(t,e,r){return e=eCe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function eCe(t){var e=tCe(t,"string");return typeof e=="symbol"?e:e+""}function tCe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jm(t,e){return t.get(Lr(t,e))}function Zp(t,e,r){return t.set(Lr(t,e),r),r}function Lr(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Jp="nestedRows",rCe=300,qI=Jp,nCe="The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled.";var tv=new WeakMap,Mu=new WeakMap,jr=new WeakSet;class iCe extends Pt{constructor(){super(...arguments),Qve(this,jr),H1(this,"dataManager",null),H1(this,"headersUI",null),H1(this,"collapsedRowsMap",null),XI(this,tv,!1),XI(this,Mu,!1)}static get PLUGIN_KEY(){return Jp}static get PLUGIN_PRIORITY(){return rCe}isEnabled(){return!!this.hot.getSettings()[Jp]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new vg),this.dataManager=new Lve(this,this.hot),this.collapsingUI=new Vve(this,this.hot),this.headersUI=new io(this,this.hot),this.contextMenuUI=new Xve(this,this.hot),this.rowMoveController=new Jve(this),this.addHook("afterInit",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Lr(jr,e,vCe).call(e,...n)}),this.addHook("beforeViewRender",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Lr(jr,e,CCe).call(e,...n)}),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 r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Lr(jr,e,aCe).call(e,...n)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Lr(jr,e,lCe).call(e,...n)}),this.addHook("afterGetRowHeader",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Lr(jr,e,cCe).call(e,...n)}),this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Lr(jr,e,oCe).call(e,...n)}),this.addHook("beforeRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Lr(jr,e,dCe).call(e,...n)}),this.addHook("afterRemoveRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Lr(jr,e,hCe).call(e,...n)}),this.addHook("beforeAddChild",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Lr(jr,e,fCe).call(e,...n)}),this.addHook("afterAddChild",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Lr(jr,e,gCe).call(e,...n)}),this.addHook("beforeDetachChild",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Lr(jr,e,mCe).call(e,...n)}),this.addHook("afterDetachChild",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Lr(jr,e,pCe).call(e,...n)}),this.addHook("modifyRowHeaderWidth",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Lr(jr,e,uCe).call(e,...n)}),this.addHook("afterCreateRow",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Lr(jr,e,wCe).call(e,...n)}),this.addHook("beforeRowMove",function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Lr(jr,e,sCe).call(e,...n)}),this.addHook("beforeLoadData",r=>Lr(jr,this,ZI).call(this,r)),this.addHook("beforeUpdateData",r=>Lr(jr,this,ZI).call(this,r)),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(),r=this.collapsingUI.translateTrimmedRow(e.row);return this.collapsingUI.areChildrenCollapsed(r)?this.collapsingUI.expandChildren(r):this.collapsingUI.collapseChildren(r),!1},runOnlyIf:()=>{var e,r;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n&&((r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.isSingle())&&this.hot.selection.isCellVisible(n)&&n.col===-1&&n.row>=0},group:qI,relativeToGroup:Cl,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(qI)}disableCoreAPIModifiers(){Zp(Mu,this,!0)}enableCoreAPIModifiers(){Zp(Mu,this,!1)}onModifyRowData(e){if(!jm(Mu,this))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!jm(Mu,this))return this.dataManager.countAllRows()}onBeforeDataSplice(e,r,n){return jm(Mu,this)||this.dataManager.isRowHighestLevel(e)?!0:(this.dataManager.spliceData(e,r,n),!1)}destroy(){super.destroy()}}function sCe(t,e,r,n){return this.rowMoveController.onBeforeRowMove(t,e,r,n)}function oCe(t,e,r){this.collapsingUI.toggleState(t,e,r)}function aCe(t,e,r){return this.collapsingUI.collapsedRowsStash.stash(),this.collapsingUI.collapsedRowsStash.trimStash(r[0],e),this.collapsingUI.collapsedRowsStash.shiftStash(r[0],null,-1*e),this.dataManager.filterData(t,e,r),Zp(tv,this,!0),this.dataManager.getData().slice()}function lCe(t){return this.contextMenuUI.appendOptions(t)}function cCe(t,e){this.headersUI.appendLevelIndicators(t,e)}function uCe(t){return Math.max(this.headersUI.rowHeaderWidthCache,t)}function hCe(t,e,r,n){n!==this.pluginName&&this.hot._registerTimeout(()=>{Zp(tv,this,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()})}function dCe(t,e,r){const n=Array.from(r.reduce((i,s)=>{if(this.dataManager.isParent(s)){const o=this.dataManager.getDataObject(s).__children;return i.add(s),Array.isArray(o)&&o.forEach(a=>i.add(this.dataManager.getRowIndex(a))),i}return i.add(s)},new Set));r.length=0,r.push(...n)}function fCe(){this.collapsingUI.collapsedRowsStash.stash()}function gCe(t,e){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(e)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function mCe(){this.collapsingUI.collapsedRowsStash.stash()}function pCe(t,e,r){this.collapsingUI.collapsedRowsStash.shiftStash(r,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function wCe(){this.dataManager.rewriteCache()}function vCe(){this.headersUI.updateRowHeaderWidth()}function CCe(t,e){jm(tv,this)&&(e.skipRender=!0)}function ZI(t){if(!nne(t)){Hy(nCe),this.hot.getSettings()[Jp]=!1,this.disablePlugin();return}this.dataManager.setData(t),this.dataManager.rewriteCache()}function F1(t,e,r){return e=SCe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function SCe(t){var e=xCe(t,"string");return typeof e=="symbol"?e:e+""}function xCe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class yCe{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;F1(this,"rootWindow",void 0),F1(this,"prefix",void 0),F1(this,"savedKeys",[]),this.rootWindow=r,this.prefix=e,this.loadSavedKeys()}saveValue(e,r){this.rootWindow.localStorage.setItem(`${this.prefix}_${e}`,JSON.stringify(r)),this.savedKeys.indexOf(e)===-1&&(this.savedKeys.push(e),this.saveSavedKeys())}loadValue(e,r){const n=typeof e>"u"?r:e,i=this.rootWindow.localStorage.getItem(`${this.prefix}_${n}`);return i===null?void 0:JSON.parse(i)}reset(e){this.rootWindow.localStorage.removeItem(`${this.prefix}_${e}`)}resetAll(){j(this.savedKeys,(e,r)=>{this.rootWindow.localStorage.removeItem(`${this.prefix}_${this.savedKeys[r]}`)}),this.clearSavedKeys()}loadSavedKeys(){const e=this.rootWindow.localStorage.getItem(`${this.prefix}__persistentStateKeys`),r=typeof e=="string"?JSON.parse(e):void 0;this.savedKeys=r||[]}saveSavedKeys(){this.rootWindow.localStorage.setItem(`${this.prefix}__persistentStateKeys`,JSON.stringify(this.savedKeys))}clearSavedKeys(){this.savedKeys.length=0,this.saveSavedKeys()}}function bCe(t,e,r){return e=ECe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ECe(t){var e=RCe(t,"string");return typeof e=="symbol"?e:e+""}function RCe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}He.getSingleton().register("persistentStateSave");He.getSingleton().register("persistentStateLoad");He.getSingleton().register("persistentStateReset");const JI="persistentState",TCe=0;class _Ce extends Pt{constructor(){super(...arguments),bCe(this,"storage",void 0)}static get PLUGIN_KEY(){return JI}static get PLUGIN_PRIORITY(){return TCe}isEnabled(){return!!this.hot.getSettings()[JI]}enablePlugin(){this.enabled||(this.storage||(this.storage=new yCe(this.hot.rootElement.id,this.hot.rootWindow)),this.addHook("persistentStateSave",(e,r)=>this.saveValue(e,r)),this.addHook("persistentStateLoad",(e,r)=>this.loadValue(e,r)),this.addHook("persistentStateReset",()=>this.resetValue()),super.enablePlugin())}disablePlugin(){this.storage=void 0,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}loadValue(e,r){r.value=this.storage.loadValue(e)}saveValue(e,r){this.storage.saveValue(e,r)}resetValue(e){typeof e>"u"?this.storage.resetAll():this.storage.reset(e)}destroy(){super.destroy()}}function ACe(t,e){MCe(t,e),e.add(t)}function MCe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function L1(t,e,r){return e=ICe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ICe(t){var e=OCe(t,"string");return typeof e=="symbol"?e:e+""}function OCe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function QI(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const $1="search",PCe=190,DCe="htSearchResult",kCe=function(t,e,r,n,i){t.getCellMeta(e,r).isSearchResult=i},NCe=function(t,e,r){return Zt(t)||t===null||!t.toLocaleLowerCase||t.length===0||Zt(e)||e===null?!1:e.toString().toLocaleLowerCase(r.locale).indexOf(t.toLocaleLowerCase(r.locale))!==-1};var B1=new WeakSet;class HCe extends Pt{constructor(){super(...arguments),ACe(this,B1),L1(this,"callback",kCe),L1(this,"queryMethod",NCe),L1(this,"searchResultClass",DCe)}static get PLUGIN_KEY(){return $1}static get PLUGIN_PRIORITY(){return PCe}isEnabled(){return this.hot.getSettings()[$1]}enablePlugin(){var e=this;if(this.enabled)return;const r=this.hot.getSettings()[$1];this.updatePluginSettings(r),this.addHook("beforeRenderer",function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return QI(B1,e,eO).call(e,...i)}),super.enablePlugin()}disablePlugin(){var e=this;const r=function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return QI(B1,e,eO).call(e,...i)};this.hot.addHook("beforeRenderer",r),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("beforeRenderer",r)}),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}query(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getCallback(),n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.getQueryMethod();const i=this.hot.countRows(),s=this.hot.countCols(),o=[],a=this.hot;return Ue(0,i-1,l=>{Ue(0,s-1,c=>{const u=this.hot.getDataAtCell(l,c),h=this.hot.getCellMeta(l,c),d=h.search.callback||r,g=(h.search.queryMethod||n)(e,u,h);if(g){const m={row:l,col:c,data:u};o.push(m)}d&&d(a,l,c,u,g)})}),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){at(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}}function eO(t,e,r,n,i,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 FCe(t,e){LCe(t,e),e.add(t)}function LCe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ym(t,e,r){return e=$Ce(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $Ce(t){var e=BCe(t,"string");return typeof e=="symbol"?e:e+""}function BCe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function V1(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const VCe="touchScroll",WCe=200;var bm=new WeakSet;class UCe extends Pt{constructor(){super(...arguments),FCe(this,bm),ym(this,"scrollbars",[]),ym(this,"clones",[]),ym(this,"lockedCollection",!1),ym(this,"freezeOverlays",!1)}static get PLUGIN_KEY(){return VCe}static get PLUGIN_PRIORITY(){return WCe}static get SETTING_KEYS(){return!0}isEnabled(){return rN()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",()=>V1(bm,this,YCe).call(this)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",()=>V1(bm,this,zCe).call(this)),this.addHook("afterMomentumScroll",()=>V1(bm,this,GCe).call(this))}}function YCe(){if(this.lockedCollection)return;const{topOverlay:t,bottomOverlay:e,inlineStartOverlay:r,topInlineStartCornerOverlay:n,bottomInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;this.lockedCollection=!0,this.scrollbars.length=0,this.scrollbars.push(t),e.clone&&this.scrollbars.push(e),this.scrollbars.push(r),n&&this.scrollbars.push(n),i&&i.clone&&this.scrollbars.push(i),this.clones=[],t.needFullRender&&this.clones.push(t.clone.wtTable.holder.parentNode),e.needFullRender&&this.clones.push(e.clone.wtTable.holder.parentNode),r.needFullRender&&this.clones.push(r.clone.wtTable.holder.parentNode),n&&this.clones.push(n.clone.wtTable.holder.parentNode),i&&i.clone&&this.clones.push(i.clone.wtTable.holder.parentNode)}function zCe(){this.freezeOverlays=!0,j(this.clones,t=>{Re(t,"hide-tween")})}function GCe(){this.freezeOverlays=!1,j(this.clones,t=>{rt(t,"hide-tween"),Re(t,"show-tween")}),this.hot._registerTimeout(()=>{j(this.clones,t=>{rt(t,"show-tween")})},400),j(this.scrollbars,t=>{t.refresh(),t.resetFixedPosition()}),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}function jCe(t,e){KCe(t,e),e.add(t)}function KCe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function XCe(t,e,r){return e=qCe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qCe(t){var e=ZCe(t,"string");return typeof e=="symbol"?e:e+""}function ZCe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function JCe(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}const Km="trimRows",QCe=330;var tO=new WeakSet;class e1e extends Pt{constructor(){super(...arguments),jCe(this,tO),XCe(this,"trimmedRowsMap",null)}static get PLUGIN_KEY(){return Km}static get PLUGIN_PRIORITY(){return QCe}isEnabled(){return!!this.hot.getSettings()[Km]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new vg),this.trimmedRowsMap.addLocalHook("init",()=>JCe(tO,this,t1e).call(this)),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[Km];Array.isArray(e)&&this.hot.batchExecution(()=>{this.trimmedRowsMap.clear(),j(e,r=>{this.trimmedRowsMap.setValueAtIndex(r,!0)})},!0),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("trimRows"),super.disablePlugin()}getTrimmedRows(){return this.trimmedRowsMap.getTrimmedIndexes()}trimRows(e){const r=this.getTrimmedRows(),n=this.isValidConfig(e);let i=r;n&&(i=Array.from(new Set(r.concat(e)))),this.hot.runHooks("beforeTrimRow",r,i,n)!==!1&&(n&&this.hot.batchExecution(()=>{j(e,o=>{this.trimmedRowsMap.setValueAtIndex(o,!0)})},!0),this.hot.runHooks("afterTrimRow",r,i,n,n&&i.length>r.length))}trimRow(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.trimRows(r)}untrimRows(e){const r=this.getTrimmedRows(),n=this.isValidConfig(e);let i=r;const s=this.trimmedRowsMap.getValues().slice(),o=e.length>0;n&&o&&(j(e,l=>{s[l]=!1}),i=Rn(s,(l,c,u)=>(c&&l.push(u),l),[])),this.hot.runHooks("beforeUntrimRow",r,i,n&&o)!==!1&&(n&&o&&this.trimmedRowsMap.setValues(s),this.hot.runHooks("afterUntrimRow",r,i,n&&o,n&&i.length<r.length))}untrimRow(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];this.untrimRows(r)}isTrimmed(e){return this.trimmedRowsMap.getValueAtIndex(e)||!1}untrimAll(){this.untrimRows(this.getTrimmedRows())}isValidConfig(e){const r=this.hot.countSourceRows();return e.every(n=>Number.isInteger(n)&&n>=0&&n<r)}destroy(){super.destroy()}}function t1e(){const t=this.hot.getSettings()[Km];Array.isArray(t)&&this.hot.batchExecution(()=>{j(t,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0)}var gF={},r1e=ml,n1e=gF,i1e=r1e("iterator"),s1e=Array.prototype,o1e=function(t){return t!==void 0&&(n1e.Array===t||s1e[i1e]===t)},a1e=mD,rO=uw,l1e=sw,c1e=gF,u1e=ml,h1e=u1e("iterator"),mF=function(t){if(!l1e(t))return rO(t,h1e)||rO(t,"@@iterator")||c1e[a1e(t)]},d1e=Is,f1e=eg,g1e=ua,m1e=cw,p1e=mF,w1e=TypeError,v1e=function(t,e){var r=arguments.length<2?p1e(t):e;if(f1e(r))return g1e(d1e(r,t));throw new w1e(m1e(t)+" is not iterable")},C1e=OD,S1e=Is,x1e=ua,y1e=cw,b1e=o1e,E1e=ng,nO=lw,R1e=v1e,T1e=mF,iO=Zx,_1e=TypeError,Xm=function(t,e){this.stopped=t,this.result=e},sO=Xm.prototype,A1e=function(t,e,r){var n=r&&r.that,i=!!(r&&r.AS_ENTRIES),s=!!(r&&r.IS_RECORD),o=!!(r&&r.IS_ITERATOR),a=!!(r&&r.INTERRUPTED),l=C1e(e,n),c,u,h,d,f,g,m,p=function(y){return c&&iO(c,"normal",y),new Xm(!0,y)},S=function(y){return i?(x1e(y),a?l(y[0],y[1],p):l(y[0],y[1])):a?l(y,p):l(y)};if(s)c=t.iterator;else if(o)c=t;else{if(u=T1e(t),!u)throw new _1e(y1e(t)+" is not iterable");if(b1e(u)){for(h=0,d=E1e(t);d>h;h++)if(f=S(t[h]),f&&nO(sO,f))return f;return new Xm(!1)}c=R1e(t,u)}for(g=s?t.next:c.next;!(m=S1e(g,c)).done;){try{f=S(m.value)}catch(y){iO(c,"throw",y)}if(typeof f=="object"&&f&&nO(sO,f))return f}return new Xm(!1)},M1e=Ms,I1e=pl,O1e=iw,P1e=function(t,e,r){M1e?I1e.f(t,e,O1e(0,r)):t[e]=r},D1e=En,k1e=A1e,N1e=P1e;D1e({target:"Object",stat:!0},{fromEntries:function(e){var r={};return k1e(e,function(n,i){N1e(r,n,i)},{AS_ENTRIES:!0}),r}});const pF="undoRedo",H1e="undoRedo";function De(t){const e=this;this.instance=t,this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,this.enabled=!1,t.addHook("afterChange",function(n,i){const s=n&&n.length;if(!s||!n.find(l=>{const[,,c,u]=l;return c!==u}))return;const a=()=>{const l=n.reduce((u,h)=>(u.push([...h]),u),[]);j(l,u=>{u[1]=t.propToCol(u[1])});const c=s>1?this.getSelected():[[l[0][0],l[0][1]]];return new De.ChangeAction(l,c)};e.done(a,i)}),t.addHook("afterCreateRow",(n,i,s)=>{e.done(()=>new De.CreateRowAction(n,i),s)});const r=(n,i,s,o)=>{const a=["visualRow","visualCol","row","col","prop"],l=a.length,c=[];return Ue(s,o,u=>{Ue(n,i,h=>{const d=t.getCellMeta(h,u);if(Object.keys(d).length!==l){const f=Object.fromEntries(Object.entries(d).filter(g=>{let[m]=g;return a.includes(m)===!1}));c.push([d.visualRow,d.visualCol,f])}})}),c};t.addHook("beforeRemoveRow",(n,i,s,o)=>{const a=()=>{const l=t.toPhysicalRow(n),c=l+i-1,u=Vn(e.instance.getSourceData(l,0,l+i-1,e.instance.countSourceCols()-1));return new De.RemoveRowAction(l,u,t.getSettings().fixedRowsBottom,t.getSettings().fixedRowsTop,t.rowIndexMapper.getIndexesSequence(),r(l,c,0,t.countCols()-1))};e.done(a,o)}),t.addHook("afterCreateCol",(n,i,s)=>{e.done(()=>new De.CreateColumnAction(n,i),s)}),t.addHook("beforeRemoveCol",(n,i,s,o)=>{const a=()=>{const l=e.instance.getSourceDataArray(),c=(e.instance.countCols()+n)%e.instance.countCols(),u=c+i-1,h=[],d=[],f=[];Ue(l.length-1,p=>{const S=[],y=l[p];Ue(c,u,C=>{S.push(y[t.toPhysicalColumn(C)])}),h.push(S)}),Ue(i-1,p=>{f.push(t.toPhysicalColumn(c+p))}),Array.isArray(t.getSettings().colHeaders)&&Ue(i-1,p=>{d.push(t.getSettings().colHeaders[t.toPhysicalColumn(c+p)]||null)});const g=t.columnIndexMapper.getIndexesSequence(),m=t.rowIndexMapper.getIndexesSequence();return new De.RemoveColumnAction(c,f,h,d,g,m,t.getSettings().fixedColumnsStart,r(0,t.countRows(),c,u))};e.done(a,o)}),t.addHook("beforeCellAlignment",(n,i,s,o)=>{e.done(()=>new De.CellAlignmentAction(n,i,s,o))}),t.addHook("beforeFilter",n=>{e.done(()=>new De.FiltersAction(n))}),t.addHook("beforeRowMove",(n,i)=>{n!==!1&&e.done(()=>new De.RowMoveAction(n,i))}),t.addHook("beforeColumnMove",(n,i)=>{n!==!1&&e.done(()=>new De.ColumnMoveAction(n,i))}),t.addHook("beforeMergeCells",(n,i)=>{i||e.done(()=>new De.MergeCellsAction(t,n))}),t.addHook("afterUnmergeCells",(n,i)=>{i||e.done(()=>new De.UnmergeCellsAction(t,n))}),t.addHook("afterInit",()=>{e.init()})}De.prototype.done=function(t,e){if(this.ignoreNewActions||e==="UndoRedo.undo"||e==="UndoRedo.redo"||e==="auto")return;const n=this.doneActions.slice();if(this.instance.runHooks("beforeUndoStackChange",n,e)===!1)return;const s=t(),o=this.undoneActions.slice();this.doneActions.push(s),this.instance.runHooks("afterUndoStackChange",n,this.doneActions.slice()),this.instance.runHooks("beforeRedoStackChange",o),this.undoneActions.length=0,this.instance.runHooks("afterRedoStackChange",o,this.undoneActions.slice())};De.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 r=Vn(e);if(this.instance.runHooks("beforeUndo",r)===!1)return;this.ignoreNewActions=!0;const i=this,s=this.undoneActions.slice();this.instance.runHooks("beforeRedoStackChange",s),e.undo(this.instance,()=>{i.ignoreNewActions=!1,i.undoneActions.push(e)}),this.instance.runHooks("afterRedoStackChange",s,this.undoneActions.slice()),this.instance.runHooks("afterUndo",r)}};De.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 r=Vn(e);if(this.instance.runHooks("beforeRedo",r)===!1)return;this.ignoreNewActions=!0;const i=this,s=this.doneActions.slice();this.instance.runHooks("beforeUndoStackChange",s),e.redo(this.instance,()=>{i.ignoreNewActions=!1,i.doneActions.push(e)}),this.instance.runHooks("afterUndoStackChange",s,this.doneActions.slice()),this.instance.runHooks("afterRedo",r)}};De.prototype.isUndoAvailable=function(){return this.doneActions.length>0};De.prototype.isRedoAvailable=function(){return this.undoneActions.length>0};De.prototype.clear=function(){this.doneActions.length=0,this.undoneActions.length=0};De.prototype.isEnabled=function(){return this.enabled};De.prototype.enable=function(){if(this.isEnabled())return;const t=this.instance;this.enabled=!0,$1e(t),this.registerShortcuts(),t.addHook("afterChange",wF)};De.prototype.disable=function(){if(!this.isEnabled())return;const t=this.instance;this.enabled=!1,B1e(t),this.unregisterShortcuts(),t.removeHook("afterChange",wF)};De.prototype.destroy=function(){this.clear(),this.instance=null,this.doneActions=null,this.undoneActions=null};De.Action=function(){};De.Action.prototype.undo=function(){};De.Action.prototype.redo=function(){};De.ChangeAction=function(t,e){this.changes=t,this.selected=e,this.actionType="change"};ga(De.ChangeAction,De.Action);De.ChangeAction.prototype.undo=function(t,e){const r=Vn(this.changes),n=t.countEmptyRows(!0),i=t.countEmptyCols(!0);for(let o=0,a=r.length;o<a;o++)r[o].splice(3,1);t.addHookOnce("afterChange",e),t.setDataAtCell(r,null,null,"UndoRedo.undo");for(let o=0,a=r.length;o<a;o++){const[l,c]=r[o];t.getSettings().minSpareRows&&l+1+t.getSettings().minSpareRows===t.countRows()&&n===t.getSettings().minSpareRows&&(t.alter("remove_row",parseInt(l+1,10),t.getSettings().minSpareRows),t.undoRedo.doneActions.pop()),t.getSettings().minSpareCols&&c+1+t.getSettings().minSpareCols===t.countCols()&&i===t.getSettings().minSpareCols&&(t.alter("remove_col",parseInt(c+1,10),t.getSettings().minSpareCols),t.undoRedo.doneActions.pop())}const s=t.getSelectedLast();if(s!==void 0){const[o,a]=r[0],[l,c]=s,u=t.view.getFirstFullyVisibleRow(),h=t.view.getFirstFullyVisibleColumn(),d=o>=u,f=a>=h;if((d&&f)===!1&&(l!==o||c!==a)===!0){const p={row:o,col:a};d===!1&&(p.verticalSnap="top"),f===!1&&(p.horizontalSnap="start"),t.scrollViewportTo(p)}}t.selectCells(this.selected,!1,!1)};De.ChangeAction.prototype.redo=function(t,e){const r=Vn(this.changes);for(let n=0,i=r.length;n<i;n++)r[n].splice(2,1);t.addHookOnce("afterChange",e),t.setDataAtCell(r,null,null,"UndoRedo.redo"),this.selected&&t.selectCells(this.selected,!1,!1)};De.CreateRowAction=function(t,e){this.index=t,this.amount=e,this.actionType="insert_row"};ga(De.CreateRowAction,De.Action);De.CreateRowAction.prototype.undo=function(t,e){const r=t.countRows(),n=t.getSettings().minSpareRows;this.index>=r&&this.index-n<r&&(this.index-=n),t.addHookOnce("afterRemoveRow",e),t.alter("remove_row",this.index,this.amount,"UndoRedo.undo")};De.CreateRowAction.prototype.redo=function(t,e){t.addHookOnce("afterCreateRow",e),t.alter("insert_row_above",this.index,this.amount,"UndoRedo.redo")};De.RemoveRowAction=function(t,e,r,n,i,s){this.index=t,this.data=e,this.actionType="remove_row",this.fixedRowsBottom=r,this.fixedRowsTop=n,this.rowIndexesSequence=i,this.removedCellMetas=s};ga(De.RemoveRowAction,De.Action);De.RemoveRowAction.prototype.undo=function(t,e){const r=t.getSettings(),n=[];r.fixedRowsBottom=this.fixedRowsBottom,r.fixedRowsTop=this.fixedRowsTop,this.data.forEach((i,s)=>{Object.keys(i).forEach(o=>{const a=parseInt(o,10);n.push([this.index+s,isNaN(a)?o:a,i[o]])})}),t.alter("insert_row_above",this.index,this.data.length,"UndoRedo.undo"),this.removedCellMetas.forEach(i=>{let[s,o,a]=i;t.setCellMetaObject(s,o,a)}),t.addHookOnce("afterViewRender",e),t.setSourceDataAtCell(n,null,null,"UndoRedo.undo"),t.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence)};De.RemoveRowAction.prototype.redo=function(t,e){t.addHookOnce("afterRemoveRow",e),t.alter("remove_row",this.index,this.data.length,"UndoRedo.redo")};De.CreateColumnAction=function(t,e){this.index=t,this.amount=e,this.actionType="insert_col"};ga(De.CreateColumnAction,De.Action);De.CreateColumnAction.prototype.undo=function(t,e){t.addHookOnce("afterRemoveCol",e),t.alter("remove_col",this.index,this.amount,"UndoRedo.undo")};De.CreateColumnAction.prototype.redo=function(t,e){t.addHookOnce("afterCreateCol",e),t.alter("insert_col_start",this.index,this.amount,"UndoRedo.redo")};De.RemoveColumnAction=function(t,e,r,n,i,s,o,a){this.index=t,this.indexes=e,this.data=r,this.amount=this.data[0].length,this.headers=n,this.columnPositions=i.slice(0),this.rowPositions=s.slice(0),this.actionType="remove_col",this.fixedColumnsStart=o,this.removedCellMetas=a};ga(De.RemoveColumnAction,De.Action);De.RemoveColumnAction.prototype.undo=function(t,e){const r=t.getSettings();r.fixedColumnsStart=this.fixedColumnsStart;const n=this.indexes.slice(0).sort(),i=(c,u,h)=>h[this.indexes.indexOf(n[u])],s=this.data.length,o=[];for(let c=0;c<s;c++)o.push(wt(this.data[c],i));const a=wt(this.headers,i),l=[];t.alter("insert_col_start",this.indexes[0],this.indexes.length,"UndoRedo.undo"),j(t.getSourceDataArray(),(c,u)=>{j(n,(h,d)=>{c[h]=o[u][d],l.push([u,h,c[h]])})}),t.setSourceDataAtCell(l,void 0,void 0,"UndoRedo.undo"),typeof this.headers<"u"&&j(a,(c,u)=>{t.getSettings().colHeaders[n[u]]=c}),this.removedCellMetas.forEach(c=>{let[u,h,d]=c;t.setCellMetaObject(u,h,d)}),t.batchExecution(()=>{t.rowIndexMapper.setIndexesSequence(this.rowPositions),t.columnIndexMapper.setIndexesSequence(this.columnPositions)},!0),t.addHookOnce("afterViewRender",e),t.render()};De.RemoveColumnAction.prototype.redo=function(t,e){t.addHookOnce("afterRemoveCol",e),t.alter("remove_col",this.index,this.amount,"UndoRedo.redo")};De.CellAlignmentAction=function(t,e,r,n){this.stateBefore=t,this.range=e,this.type=r,this.alignment=n};De.CellAlignmentAction.prototype.undo=function(t,e){j(this.range,r=>{r.forAll((n,i)=>{n>=0&&i>=0&&t.setCellMeta(n,i,"className",this.stateBefore[n][i]||" htLeft")})}),t.addHookOnce("afterViewRender",e),t.render()};De.CellAlignmentAction.prototype.redo=function(t,e){Ha(this.range,this.type,this.alignment,(r,n)=>t.getCellMeta(r,n),(r,n,i,s)=>t.setCellMeta(r,n,i,s)),t.addHookOnce("afterViewRender",e),t.render()};De.FiltersAction=function(t){this.conditionsStack=t,this.actionType="filter"};ga(De.FiltersAction,De.Action);De.FiltersAction.prototype.undo=function(t,e){const r=t.getPlugin("filters");t.addHookOnce("afterViewRender",e),r.conditionCollection.importAllConditions(this.conditionsStack.slice(0,this.conditionsStack.length-1)),r.filter()};De.FiltersAction.prototype.redo=function(t,e){const r=t.getPlugin("filters");t.addHookOnce("afterViewRender",e),r.conditionCollection.importAllConditions(this.conditionsStack),r.filter()};class F1e extends De.Action{constructor(e,r){super(),this.cellRange=r;const n=this.cellRange.getTopStartCorner(),i=this.cellRange.getBottomEndCorner();this.rangeData=e.getData(n.row,n.col,i.row,i.col)}undo(e,r){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",r),n.unmergeRange(this.cellRange,!0);const i=this.cellRange.getTopStartCorner();e.populateFromArray(i.row,i.col,this.rangeData,void 0,void 0,"MergeCells")}redo(e,r){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",r),n.mergeRange(this.cellRange)}}De.MergeCellsAction=F1e;class L1e extends De.Action{constructor(e,r){super(),this.cellRange=r}undo(e,r){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",r),n.mergeRange(this.cellRange,!0)}redo(e,r){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",r),n.unmergeRange(this.cellRange,!0),e.render()}}De.UnmergeCellsAction=L1e;De.RowMoveAction=function(t,e){this.rows=t.slice(),this.finalRowIndex=e,this.actionType="row_move"};ga(De.RowMoveAction,De.Action);De.RowMoveAction.prototype.undo=function(t,e){const r=t.getPlugin("manualRowMove");t.addHookOnce("afterViewRender",e),hR(this.rows,this.finalRowIndex,t.rowIndexMapper.getNumberOfIndexes()).reverse().forEach(i=>{let{from:s,to:o}=i;s<o&&(o-=1),r.moveRow(o,s)}),t.render(),t.deselectCell(),t.selectRows(this.rows[0],this.rows[0]+this.rows.length-1)};De.RowMoveAction.prototype.redo=function(t,e){const r=t.getPlugin("manualRowMove");t.addHookOnce("afterViewRender",e),r.moveRows(this.rows.slice(),this.finalRowIndex),t.render(),t.deselectCell(),t.selectRows(this.finalRowIndex,this.finalRowIndex+this.rows.length-1)};De.ColumnMoveAction=function(t,e){this.columns=t.slice(),this.finalColumnIndex=e,this.actionType="col_move"};ga(De.ColumnMoveAction,De.Action);De.ColumnMoveAction.prototype.undo=function(t,e){const r=t.getPlugin("manualColumnMove");t.addHookOnce("afterViewRender",e),hR(this.columns,this.finalColumnIndex,t.columnIndexMapper.getNumberOfIndexes()).reverse().forEach(i=>{let{from:s,to:o}=i;s<o&&(o-=1),r.moveColumn(o,s)}),t.render(),t.deselectCell(),t.selectColumns(this.columns[0],this.columns[0]+this.columns.length-1)};De.ColumnMoveAction.prototype.redo=function(t,e){const r=t.getPlugin("manualColumnMove");t.addHookOnce("afterViewRender",e),r.moveColumns(this.columns.slice(),this.finalColumnIndex),t.render(),t.deselectCell(),t.selectColumns(this.finalColumnIndex,this.finalColumnIndex+this.columns.length-1)};De.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()};De.prototype.registerShortcuts=function(){const e=this.instance.getShortcutManager().getContext("grid"),n={runOnlyIf:i=>!i.altKey,group:pF};e.addShortcuts([{keys:[["Control/Meta","z"]],callback:()=>{this.undo()}},{keys:[["Control/Meta","y"],["Control/Meta","Shift","z"]],callback:()=>{this.redo()}}],n)};De.prototype.unregisterShortcuts=function(){this.instance.getShortcutManager().getContext("grid").removeShortcutsByGroup(pF)};function wF(t,e){const r=this;if(e==="loadData")return r.undoRedo.clear()}function $1e(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 B1e(t){delete t.undo,delete t.redo,delete t.isUndoAvailable,delete t.isRedoAvailable,delete t.clearUndo}const _g=He.getSingleton();_g.add("afterUpdateSettings",function(){var t;(t=this.getPlugin("undoRedo"))===null||t===void 0||t.init()});_g.register("beforeUndo");_g.register("afterUndo");_g.register("beforeRedo");_g.register("afterRedo");De.PLUGIN_KEY=H1e;De.SETTING_KEYS=!0;function V1e(){_t(nf),_t(_le),_t(sf),_t(nce),_t(hce),_t(z2),_t(sue),_t(Wue),_t(Xw),_t(ade),_t(Dde),_t(Vde),_t(Jw),_t(mfe),_t(f0e),_t(Y0e),_t(pme),_t(_me),_t($me),_t(qme),_t(ope),_t(Epe),_t(Dpe),_t(lwe),_t(Vwe),_t(Gwe),_t(vve),_t(iCe),_t(_Ce),_t(HCe),_t(UCe),_t(e1e),_t(De)}function W1e(){tae(),Cae(),Aae(),Kae(),V1e()}class U1e{constructor(){ln(this,"m_aryColumn",[]);ln(this,"m_allData",[]);ln(this,"m_rowHeights",[]);ln(this,"m_dColumnHeight",28);ln(this,"m_dRowHeight",25);ln(this,"m_mates",[]);ln(this,"m_dRowLineWdith",0);ln(this,"m_dColumnLineWidth",.5);ln(this,"m_dRowTextHeight",13);ln(this,"m_dColumnTextHeight",13)}addColumn(e,r){this.m_aryColumn.push({name:e,w:r})}addRow(e,r){this.m_allData.push(e),this.m_rowHeights.push(r)}}function Y1e(t,e,r){typeof e=="string"&&(e=parseFloat(e));const n=document.createElement("canvas"),i=n.getContext("2d");if(!i)return;i.font=e+"px "+r;let o=i.measureText(t).width,l=e*1.2;return n.remove(),o=Math.ceil(o),l=Math.ceil(l),{width:o,height:l}}class z1e{constructor(){ln(this,"data",new U1e);ln(this,"pt",new EF);ln(this,"dScale",1);ln(this,"mxcad",RF.getCurrentMxCAD());ln(this,"isDrawTableHead",!1)}draw(e,r){return this.pt=e,this.dScale=r,this.data.m_aryColumn.length==0||this.data.m_allData.length==0?!1:(this.DrawTableHead(),this.DrawContent(),!0)}DrawTableHead(){if(!this.isDrawTableHead)return;let e=this.data,r=this.pt.clone(),n=this.pt.clone(),i=new Og(0,1,0).mult(this.Scale(this.data.m_dColumnHeight)),s=this.Scale(this.data.m_dColumnLineWidth),o=0,a=new Og(1,0,0);for(let l=0;l<e.m_aryColumn.length;l++){let c=e.m_aryColumn[l];this.DrawLine(n,n.clone().subvec(i),s),this.DrawMCText(n.clone().addvec(a.clone().mult(this.Scale(c.w)*.5)).subvec(i.clone().mult(.5)),c.name,this.Scale(e.m_dColumnTextHeight),c.w),n.addvec(a.clone().mult(this.Scale(c.w))),o+=this.Scale(c.w)}return this.DrawLine(n,n.clone().subvec(i),s),this.DrawLine(r,r.clone().addvec(a.clone().mult(o)),s),this.DrawLine(r.clone().subvec(i),r.addvec(a.clone().mult(o)).subvec(i),s),!0}DrawContent(){let e=this.data,r=this.pt,n=0;for(let u=0;u<e.m_aryColumn.length;u++)n+=this.Scale(e.m_aryColumn[u].w);let i=this.Scale(this.data.m_dRowLineWdith),s=new Og(1,0,0),o=new Og(0,1,0),a=r.clone().subvec(o.clone().mult(this.Scale(e.m_dColumnHeight))),l=[],c=[];for(let u=0;u<e.m_allData.length;u++){const h=e.m_rowHeights[u];let d=a.clone(),f=o.clone().mult(this.Scale(h||e.m_dRowHeight));for(let g=0;g<e.m_aryColumn.length;g++){let m=e.m_aryColumn[g],{hidden:p,rowspan:S,colspan:y}=e.m_mates[u][g]||{};if(p||(this.DrawLine(d,d.clone().subvec(f),i),this.DrawMCText(d.clone().addvec(s.clone().mult(this.Scale(m.w*0))).subvec(f.clone().mult(.25)),e.m_allData[u][g],this.Scale(e.m_dRowTextHeight),m.w)),typeof S=="number"&&S>0&&typeof y=="number"&&y>0)for(let A=1;A<S;A++){l.push([u+A,g]);for(let O=0;O<y;O++)c.push([u+A,g+O])}const C=l.some(([A,O])=>u===A&&g===O),E=c.some(([A,O])=>u===A&&g===O);if(C&&this.DrawLine(d,d.clone().subvec(f),i),d.addvec(s.clone().mult(this.Scale(m.w))),E||this.DrawLine(d,d.clone().subvec(s.clone().mult(this.Scale(m.w))),i),u===e.m_allData.length-1){const A=d.clone().subvec(o.clone().mult(this.Scale(h||e.m_dRowHeight)));this.DrawLine(A,A.clone().subvec(s.clone().mult(this.Scale(m.w))),i)}g===e.m_aryColumn.length-1&&this.DrawLine(d,d.clone().subvec(f),i)}a.subvec(f)}return!0}DrawLine(e,r,n){this.mxcad.drawLineWidth=n,this.mxcad.drawLine(e.x,e.y,r.x,r.y)}splitStringEvenly(e,r){if(r<=0||!e)return[];const n=e.length,i=Math.ceil(n/r);let s=[];for(let o=0;o<r;o++){let a=o*i,l=a+i;l=l>n?n:l,s.push(e.substring(a,l))}return s}DrawMCText(e,r,n,i){if(!r)return;const s=new TF,a=(Y1e(r,aO.docCoordLong2Screen(n)+"px","微软雅黑")?.width||r.length*16)/i;r=this.splitStringEvenly(r,a).join("\\P"),s.textHeight=n,s.contents=r.replaceAll(`
  137. `,"\\P"),s.attachment=_F.AttachmentPoint.kTopLeft,s.lineweight=n,s.location=e,this.mxcad.drawEntity(s)}Scale(e){return e*this.dScale}}const G1e={class:"d-flex align-center justify-space-between my-2"},j1e={for:"exportTableInputId"},K1e={class:"d-flex"},mSe=lx({__name:"index",setup(t){W1e();const{isShow:e,showDialog:r}=AF(!1,"Mx_InsertTable");vR(e,d=>{PF.value=!d});const n=Pg({width:"auto",height:"300",rowHeaders:!0,colHeaders:!0,autoWrapRow:!0,autoRowSize:!0,autoWrapCol:!0,startRows:10,startCols:10,licenseKey:"non-commercial-and-evaluation",dropdownMenu:!1,comments:!0,manualRowMove:!0,manualColumnFreeze:!0,manualColumnMove:!0,manualRowResize:!0,manualColumnResize:!0,mergeCells:[],contextMenu:{items:{row_above:{name:Ao("上面插入一行")},row_below:{name:Ao("下面插入一行")},col_left:{name:Ao("左侧插入一列")},col_right:{name:Ao("右侧插入一列")},remove_row:{name:Ao("移除本行")},remove_col:{name:Ao("移除本列")},clear_custom:{name:Ao("清空所有单元格数据"),callback:function(){this.clear()}},mergeCells:{name:Ao("合并单元格")}}}});vR(e,()=>{n.value.mergeCells=[]});const i=[{name:"确定",fun:async()=>{r(!1);let d=new z1e;const f=(s.value?.hotInstance).getData(),g=(s.value?.hotInstance).getColHeader();(s.value?.hotInstance).getRowHeader(),g.forEach((C,E)=>{const A=(s.value?.hotInstance).getColWidth(E);d.data.addColumn(C.toString(),A)}),f.map((C,E)=>{d.data.addRow([...C],(s.value?.hotInstance).getRowHeight(E))});const m=[];(s.value?.hotInstance).getCellsMeta().map(C=>{const{hidden:E,row:A,col:O,rowspan:T,colspan:W}=C;m[A]?m[A][O]={hidden:!!E,rowspan:T,colspan:W}:m[A]=[{hidden:!!E,rowspan:T,colspan:W}]}),d.data.m_mates=m;let p=new OF;p.setMessage(`
  138. `+Ao("指定表格插入点")+":");let S=await p.go();if(!S)return;let y=aO.viewCoordLong2Cad(1);d.draw(S,y)},primary:!0},{name:"关闭",fun:()=>r(!1)}],s=Pg();let o=!1;const a=d=>{const f=d.target;if(f.files){const g=f.files[0],m=new FileReader;m.onload=function(p){const S=p.target?.result,y=Z1(S,{type:"binary"}),C=y.Sheets[y.SheetNames[0]],E=L8.sheet_to_csv(y.Sheets[y.SheetNames[0]],{blankrows:!0}),A=C["!merges"];A&&(n.value.mergeCells=A.map(I=>({row:I.s.r,col:I.s.c,rowspan:I.e.r-I.s.r+1,colspan:I.e.c-I.s.c+1})));const O=E.split(`
  139. `);let T=0;const W=O.map(function(I){const Y=I.split(",");return T=Math.max(T,Y.length),Y});W.forEach(I=>{for(;I.length<T;)I.push("")}),(s.value?.hotInstance).loadData(W)},m.readAsBinaryString(g)}},l=()=>{o=NF(),window.addEventListener("focus",()=>{setTimeout(()=>{o&&kF("MxFullscreen")},100)},{once:!0})},c=Pg(4),u=Pg(4),h=()=>{const d=[];for(let f=0;f<u.value;f++){let g=[];for(let m=0;m<c.value;m++)g.push("");d.push(g)}n.value.mergeCells=[],(s.value?.hotInstance).loadData(d)};return(d,f)=>(oO(),MF(HF,{title:d.t("283"),"max-width":"600",modelValue:CR(e),"onUpdate:modelValue":f[2]||(f[2]=g=>IF(e)?e.value=g:null),footerBtnList:i},{default:Dg(()=>[kg("div",G1e,[kg("label",j1e,[_h(Ah(d.t("711"))+": ",1),kg("input",{id:"exportTableInputId",class:"mb-1",style:{width:"150px"},accept:".xls,.xlsx,.xlsm,.csv,.xlsb",onClick:l,type:"file",onChange:a},null,32)]),kg("div",K1e,[Ng(SR,{modelValue:u.value,"onUpdate:modelValue":f[0]||(f[0]=g=>u.value=g),type:"number",class:"pa-0 ml-1",style:{"max-width":"80px"}},{prepend:Dg(()=>[_h(Ah(d.t("712"))+":",1)]),_:1},8,["modelValue"]),Ng(SR,{modelValue:c.value,"onUpdate:modelValue":f[1]||(f[1]=g=>c.value=g),type:"number",class:"pa-0",style:{"max-width":"80px"}},{prepend:Dg(()=>[_h(Ah(d.t("713"))+":",1)]),_:1},8,["modelValue"])]),Ng(DF,{class:"ml-2",onClick:h},{default:Dg(()=>[_h(Ah(d.t("714")),1)]),_:1})]),_h(" "+Ah(d.t("715"))+": ",1),Ng(CR(HE),{settings:n.value,ref_key:"hotTable",ref:s},null,8,["settings"])]),_:1},8,["title","modelValue"]))}});export{mSe as default};