(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-319a1820"],{"00fd4":function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));n("d06e");var r=n("9f10"),i=n("81ea");class o extends r["a"]{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(e)}getTrimmedIndexes(){return Object(i["arrayReduce"])(this.getValues(),(e,t,n)=>(t&&e.push(n),e),[])}}},"01b5":function(e,t,n){"use strict";var r=n("73fa"),i=n("8793"),o=n("7c2b");e.exports=function(e,t,n){var s,a;return o&&r(s=t.constructor)&&s!==n&&i(a=s.prototype)&&a!==n.prototype&&o(e,a),e}},"0204":function(e,t,n){"use strict";var r=n("48ab"),i=Function.prototype,o=i.apply,s=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?s.bind(o):function(){return s.apply(o,arguments)})},"0227":function(e,t,n){"use strict";var r=n("f2e8"),i=n("73fa"),o=function(e){return i(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(r[e]):r[e]&&r[e][t]}},"022b":function(e,t,n){"use strict";e.exports=function(e){return null===e||void 0===e}},"0283":function(e,t,n){"use strict";n.r(t),n.d(t,"CONTEXT_MENU_ITEMS_NAMESPACE",(function(){return r})),n.d(t,"CONTEXTMENU_ITEMS_NO_ITEMS",(function(){return o})),n.d(t,"CONTEXTMENU_ITEMS_ROW_ABOVE",(function(){return s})),n.d(t,"CONTEXTMENU_ITEMS_ROW_BELOW",(function(){return a})),n.d(t,"CONTEXTMENU_ITEMS_INSERT_LEFT",(function(){return l})),n.d(t,"CONTEXTMENU_ITEMS_INSERT_RIGHT",(function(){return c})),n.d(t,"CONTEXTMENU_ITEMS_REMOVE_ROW",(function(){return h})),n.d(t,"CONTEXTMENU_ITEMS_REMOVE_COLUMN",(function(){return u})),n.d(t,"CONTEXTMENU_ITEMS_UNDO",(function(){return d})),n.d(t,"CONTEXTMENU_ITEMS_REDO",(function(){return p})),n.d(t,"CONTEXTMENU_ITEMS_READ_ONLY",(function(){return f})),n.d(t,"CONTEXTMENU_ITEMS_CLEAR_COLUMN",(function(){return g})),n.d(t,"CONTEXTMENU_ITEMS_COPY",(function(){return m})),n.d(t,"CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS",(function(){return y})),n.d(t,"CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS",(function(){return w})),n.d(t,"CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY",(function(){return b})),n.d(t,"CONTEXTMENU_ITEMS_CUT",(function(){return v})),n.d(t,"CONTEXTMENU_ITEMS_FREEZE_COLUMN",(function(){return E})),n.d(t,"CONTEXTMENU_ITEMS_UNFREEZE_COLUMN",(function(){return C})),n.d(t,"CONTEXTMENU_ITEMS_MERGE_CELLS",(function(){return S})),n.d(t,"CONTEXTMENU_ITEMS_UNMERGE_CELLS",(function(){return R})),n.d(t,"CONTEXTMENU_ITEMS_ADD_COMMENT",(function(){return T})),n.d(t,"CONTEXTMENU_ITEMS_EDIT_COMMENT",(function(){return O})),n.d(t,"CONTEXTMENU_ITEMS_REMOVE_COMMENT",(function(){return N})),n.d(t,"CONTEXTMENU_ITEMS_READ_ONLY_COMMENT",(function(){return A})),n.d(t,"CONTEXTMENU_ITEMS_ALIGNMENT",(function(){return I})),n.d(t,"CONTEXTMENU_ITEMS_ALIGNMENT_LEFT",(function(){return M})),n.d(t,"CONTEXTMENU_ITEMS_ALIGNMENT_CENTER",(function(){return x})),n.d(t,"CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT",(function(){return _})),n.d(t,"CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY",(function(){return L})),n.d(t,"CONTEXTMENU_ITEMS_ALIGNMENT_TOP",(function(){return P})),n.d(t,"CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE",(function(){return k})),n.d(t,"CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM",(function(){return j})),n.d(t,"CONTEXTMENU_ITEMS_BORDERS",(function(){return H})),n.d(t,"CONTEXTMENU_ITEMS_BORDERS_TOP",(function(){return D})),n.d(t,"CONTEXTMENU_ITEMS_BORDERS_RIGHT",(function(){return F})),n.d(t,"CONTEXTMENU_ITEMS_BORDERS_BOTTOM",(function(){return U})),n.d(t,"CONTEXTMENU_ITEMS_BORDERS_LEFT",(function(){return V})),n.d(t,"CONTEXTMENU_ITEMS_REMOVE_BORDERS",(function(){return B})),n.d(t,"CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD",(function(){return W})),n.d(t,"CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD",(function(){return G})),n.d(t,"CONTEXTMENU_ITEMS_HIDE_COLUMN",(function(){return z})),n.d(t,"CONTEXTMENU_ITEMS_SHOW_COLUMN",(function(){return Y})),n.d(t,"CONTEXTMENU_ITEMS_HIDE_ROW",(function(){return X})),n.d(t,"CONTEXTMENU_ITEMS_SHOW_ROW",(function(){return K})),n.d(t,"FILTERS_NAMESPACE",(function(){return $})),n.d(t,"FILTERS_CONDITIONS_NAMESPACE",(function(){return q})),n.d(t,"FILTERS_CONDITIONS_NONE",(function(){return Q})),n.d(t,"FILTERS_CONDITIONS_EMPTY",(function(){return Z})),n.d(t,"FILTERS_CONDITIONS_NOT_EMPTY",(function(){return J})),n.d(t,"FILTERS_CONDITIONS_EQUAL",(function(){return ee})),n.d(t,"FILTERS_CONDITIONS_NOT_EQUAL",(function(){return te})),n.d(t,"FILTERS_CONDITIONS_BEGINS_WITH",(function(){return ne})),n.d(t,"FILTERS_CONDITIONS_ENDS_WITH",(function(){return re})),n.d(t,"FILTERS_CONDITIONS_CONTAINS",(function(){return ie})),n.d(t,"FILTERS_CONDITIONS_NOT_CONTAIN",(function(){return oe})),n.d(t,"FILTERS_CONDITIONS_BY_VALUE",(function(){return se})),n.d(t,"FILTERS_CONDITIONS_GREATER_THAN",(function(){return ae})),n.d(t,"FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL",(function(){return le})),n.d(t,"FILTERS_CONDITIONS_LESS_THAN",(function(){return ce})),n.d(t,"FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL",(function(){return he})),n.d(t,"FILTERS_CONDITIONS_BETWEEN",(function(){return ue})),n.d(t,"FILTERS_CONDITIONS_NOT_BETWEEN",(function(){return de})),n.d(t,"FILTERS_CONDITIONS_AFTER",(function(){return pe})),n.d(t,"FILTERS_CONDITIONS_BEFORE",(function(){return fe})),n.d(t,"FILTERS_CONDITIONS_TODAY",(function(){return ge})),n.d(t,"FILTERS_CONDITIONS_TOMORROW",(function(){return me})),n.d(t,"FILTERS_CONDITIONS_YESTERDAY",(function(){return ye})),n.d(t,"FILTERS_DIVS_FILTER_BY_CONDITION",(function(){return we})),n.d(t,"FILTERS_DIVS_FILTER_BY_VALUE",(function(){return be})),n.d(t,"FILTERS_LABELS_CONJUNCTION",(function(){return ve})),n.d(t,"FILTERS_LABELS_DISJUNCTION",(function(){return Ee})),n.d(t,"FILTERS_VALUES_BLANK_CELLS",(function(){return Ce})),n.d(t,"FILTERS_BUTTONS_SELECT_ALL",(function(){return Se})),n.d(t,"FILTERS_BUTTONS_CLEAR",(function(){return Re})),n.d(t,"FILTERS_BUTTONS_OK",(function(){return Te})),n.d(t,"FILTERS_BUTTONS_CANCEL",(function(){return Oe})),n.d(t,"FILTERS_BUTTONS_PLACEHOLDER_SEARCH",(function(){return Ne})),n.d(t,"FILTERS_BUTTONS_PLACEHOLDER_VALUE",(function(){return Ae})),n.d(t,"FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE",(function(){return Ie})),n.d(t,"CHECKBOX_RENDERER_NAMESPACE",(function(){return Me})),n.d(t,"CHECKBOX_CHECKED",(function(){return xe})),n.d(t,"CHECKBOX_UNCHECKED",(function(){return _e}));const r="ContextMenu:items",i=r,o=i+".noItems",s=i+".insertRowAbove",a=i+".insertRowBelow",l=i+".insertColumnOnTheLeft",c=i+".insertColumnOnTheRight",h=i+".removeRow",u=i+".removeColumn",d=i+".undo",p=i+".redo",f=i+".readOnly",g=i+".clearColumn",m=i+".copy",y=i+".copyWithHeaders",w=i+".copyWithGroupHeaders",b=i+".copyHeadersOnly",v=i+".cut",E=i+".freezeColumn",C=i+".unfreezeColumn",S=i+".mergeCells",R=i+".unmergeCells",T=i+".addComment",O=i+".editComment",N=i+".removeComment",A=i+".readOnlyComment",I=i+".align",M=i+".align.left",x=i+".align.center",_=i+".align.right",L=i+".align.justify",P=i+".align.top",k=i+".align.middle",j=i+".align.bottom",H=i+".borders",D=i+".borders.top",F=i+".borders.right",U=i+".borders.bottom",V=i+".borders.left",B=i+".borders.remove",W=i+".nestedHeaders.insertChildRow",G=i+".nestedHeaders.detachFromParent",z=i+".hideColumn",Y=i+".showColumn",X=i+".hideRow",K=i+".showRow",$="Filters:",q=$+"conditions",Q=q+".none",Z=q+".isEmpty",J=q+".isNotEmpty",ee=q+".isEqualTo",te=q+".isNotEqualTo",ne=q+".beginsWith",re=q+".endsWith",ie=q+".contains",oe=q+".doesNotContain",se=q+".byValue",ae=q+".greaterThan",le=q+".greaterThanOrEqualTo",ce=q+".lessThan",he=q+".lessThanOrEqualTo",ue=q+".isBetween",de=q+".isNotBetween",pe=q+".after",fe=q+".before",ge=q+".today",me=q+".tomorrow",ye=q+".yesterday",we=$+"labels.filterByCondition",be=$+"labels.filterByValue",ve=$+"labels.conjunction",Ee=$+"labels.disjunction",Ce=$+"values.blankCells",Se=$+"buttons.selectAll",Re=$+"buttons.clear",Te=$+"buttons.ok",Oe=$+"buttons.cancel",Ne=$+"buttons.placeholder.search",Ae=$+"buttons.placeholder.value",Ie=$+"buttons.placeholder.secondValue",Me="CheckboxRenderer:",xe=Me+"checked",_e=Me+"unchecked"},"03529":function(e,t,n){"use strict";n.d(t,"a",(function(){return S}));n("7a89");var r=n("13e1"),i=n("87d6"),o=n("63d8"),s=n("5d7f"),a=n("ffec");function l(e,t,n){e.addEventListener(t,n,!1)}function c(e,t,n){e.removeEventListener(t,n,!1)}function h(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function u(e){const t={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300},n=e.body,r=e.createTextNode(""),i=e.createElement("span");let o;function s(){r.textContent=o.value,i.style.position="absolute",i.style.fontSize=h(o).fontSize,i.style.fontFamily=h(o).fontFamily,i.style.whiteSpace="pre",n.appendChild(i);const e=i.clientWidth+2;n.removeChild(i);const s=o.style;s.height=t.minHeight+"px",t.minWidth>e?s.width=t.minWidth+"px":e>t.maxWidth?s.width=t.maxWidth+"px":s.width=e+"px";const a=o.scrollHeight?o.scrollHeight-1:0;t.minHeight>a?s.height=t.minHeight+"px":t.maxHeight2&&void 0!==arguments[2]&&arguments[2];o=e,u(n),"TEXTAREA"===o.nodeName&&(o.style.resize="none",o.style.height=t.minHeight+"px",o.style.minWidth=t.minWidth+"px",o.style.maxWidth=t.maxWidth+"px",o.style.overflowY="hidden"),r&&(l(o,"input",s),l(o,"keydown",a)),s()}return{init:d,resize:s,unObserve(){c(o,"input",s),c(o,"keydown",a)}}}var d=n("7b9c"),p=n("c5c4");function f(e,t){const n=Object(s["getCaretPosition"])(t),r=t.value.split("\n");let i=n,o=0;for(let s=0;sthis.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(),Object(s["isThisHotChild"])(this.hot.rootDocument.activeElement,this.hot.rootElement)&&this.hot.listen(),this.hideEditableElement(),this.unregisterShortcuts()}prepare(e,t,n,i,o,s){const a=this.state;if(super.prepare(e,t,n,i,o,s),!s.readOnly){this.refreshDimensions(!0);const{allowInvalid:e}=s;e&&(this.TEXTAREA.value=""),a!==r["b"].FINISHED&&this.hideEditableElement()}}beginEditing(e,t){this.state===r["b"].VIRGIN&&(this.TEXTAREA.value="",super.beginEditing(e,t))}focus(){this.TEXTAREA.select(),Object(s["setCaretPosition"])(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(){const{rootDocument:e}=this.hot;this.TEXTAREA=e.createElement("TEXTAREA"),Object(s["setAttribute"])(this.TEXTAREA,[["data-hot-input",""],Object(g["K"])(-1)]),this.hot.getSettings().ariaTags&&Object(s["setAttribute"])(this.TEXTAREA,[Object(g["n"])()]),Object(s["addClass"])(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"),Object(s["addClass"])(this.TEXTAREA_PARENT,"handsontableInputHolder"),Object(s["hasClass"])(this.TEXTAREA_PARENT,this.layerClass)&&Object(s["removeClass"])(this.TEXTAREA_PARENT,this.layerClass),Object(s["addClass"])(this.TEXTAREA_PARENT,v),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){Object(o["isEdge"])()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",Object(s["removeClass"])(this.TEXTAREA_PARENT,this.layerClass),Object(s["addClass"])(this.TEXTAREA_PARENT,v)}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 t=!1;Object(a["rangeEach"])(e.length-1,n=>{const r=e[n];if(Object(s["hasClass"])(r,"handsontableEditor"))return t=!0,!1}),Object(s["hasClass"])(this.TEXTAREA_PARENT,v)&&Object(s["removeClass"])(this.TEXTAREA_PARENT,v),t?(this.layerClass=b,Object(s["addClass"])(this.TEXTAREA_PARENT,this.layerClass)):(this.layerClass=this.getEditedCellsLayerClass(),Object(s["addClass"])(this.TEXTAREA_PARENT,this.layerClass))}refreshValue(){const e=this.hot.toPhysicalRow(this.row),t=this.hot.getSourceDataAtCell(e,this.col);this.originalValue=t,this.setValue(t),this.refreshDimensions()}refreshDimensions(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.state!==r["b"].EDITING&&!e)return;if(this.TD=this.getEditedCell(),!this.TD)return void(e||this.close());const{top:t,start:n,width:i,maxWidth:o,height:a,maxHeight:l}=this.getEditedCellRect();this.textareaParentStyle.top=t+"px",this.textareaParentStyle[this.hot.isRtl()?"right":"left"]=n+"px",this.showEditableElement();const c=Object(s["getComputedStyle"])(this.TD,this.hot.rootWindow);this.TEXTAREA.style.fontSize=c.fontSize,this.TEXTAREA.style.fontFamily=c.fontFamily,this.TEXTAREA.style.backgroundColor=this.TD.style.backgroundColor;const h=Object(s["getComputedStyle"])(this.TEXTAREA),u=parseInt(h.paddingLeft,10)+parseInt(h.paddingRight,10),d=parseInt(h.paddingTop,10)+parseInt(h.paddingBottom,10),p=i-u,f=a-d,g=o-u,m=l-d;this.autoResize.init(this.TEXTAREA,{minWidth:Math.min(p,g),minHeight:Math.min(f,m),maxWidth:g,maxHeight:m},!0)}bindEvents(){Object(o["isIOS"])()&&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===r["b"].EDITING&&this.focus()}),this.addHook("afterRowResize",()=>{this.refreshDimensions(),this.state===r["b"].EDITING&&this.focus()})}allowKeyEventPropagation(){}destroy(){this.eventManager.destroy(),this.clearHooks()}registerShortcuts(){const e=this.hot.getShortcutManager(),t=e.getContext("editor"),n=e.getContext("grid"),r={runOnlyIf:()=>Object(d["isDefined"])(this.hot.getSelected()),group:E},i=()=>{this.hot.rootDocument.execCommand("insertText",!1,"\n")};t.addShortcuts([{keys:[["Tab"],["Shift","Tab"],["PageUp"],["PageDown"]],forwardToContext:n,callback:()=>{}},{keys:[["Control","Enter"]],callback:()=>(i(),!1),runOnlyIf:e=>!this.hot.selection.isMultiple()&&!e.altKey},{keys:[["Meta","Enter"]],callback:()=>(i(),!1),runOnlyIf:()=>!this.hot.selection.isMultiple()},{keys:[["Alt","Enter"]],callback:()=>(i(),!1)},{keys:[["Home"]],callback:(e,t)=>{let[n]=t;f(n,this.TEXTAREA)}},{keys:[["End"]],callback:(e,t)=>{let[n]=t;f(n,this.TEXTAREA)}}],r)}unregisterShortcuts(){const e=this.hot.getShortcutManager(),t=e.getContext("editor");t.removeShortcutsByGroup(p["a"]),t.removeShortcutsByGroup(E),t.removeShortcutsByGroup(r["c"])}}},"0716":function(e,t,n){"use strict";n("7a89");function r(e,t,n){i(e,t),t.set(e,n)}function i(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function o(e,t,n){return t=s(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){var t=a(e,"string");return"symbol"==typeof t?t:t+""}function a(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function l(e,t){return e.get(h(e,t))}function c(e,t,n){return e.set(h(e,t),n),n}function h(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var u=new WeakMap;class d{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o(this,"row",null),o(this,"col",null),r(this,u,!1),c(u,this,n),"undefined"!==typeof e&&"undefined"!==typeof t&&(this.row=e,this.col=t)}isValid(e){const{countRows:t,countCols:n,countRowHeaders:r,countColHeaders:i}={countRows:0,countCols:0,countRowHeaders:0,countColHeaders:0,...e};return!(!Number.isInteger(this.row)||!Number.isInteger(this.col))&&(!(this.row<-i||this.col<-r)&&!(this.row>=t||this.col>=n))}isEqual(e){return e===this||this.row===e.row&&this.col===e.col}isHeader(){return!this.isCell()}isCell(){return this.row>=0&&this.col>=0}isRtl(){return l(u,this)}isSouthEastOf(e){return this.row>=e.row&&(l(u,this)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(l(u,this)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(l(u,this)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(l(u,this)?this.col<=e.col:this.col>=e.col)}normalize(){return this.row=null===this.row?this.row:Math.max(this.row,0),this.col=null===this.col?this.col:Math.max(this.col,0),this}assign(e){return Number.isInteger(null===e||void 0===e?void 0:e.row)&&(this.row=e.row),Number.isInteger(null===e||void 0===e?void 0:e.col)&&(this.col=e.col),e instanceof d&&c(u,this,e.isRtl()),this}clone(){return new d(this.row,this.col,l(u,this))}toObject(){return{row:this.row,col:this.col}}}t["a"]=d},"07ac":function(e,t,n){var r=n("23e7"),i=n("6f53").values;r({target:"Object",stat:!0},{values:function(e){return i(e)}})},"088f":function(e,t,n){"use strict";var r=n("8793"),i=String,o=TypeError;e.exports=function(e){if(r(e))return e;throw new o(i(e)+" is not an object")}},"0a73":function(e,t,n){"use strict";var r=n("d128"),i=n("69ba"),o=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,a=i(o,"name"),l=a&&"something"===function(){}.name,c=a&&(!r||r&&s(o,"name").configurable);e.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},"0ad8":function(e,t,n){"use strict";var r,i=n("088f"),o=n("fdba"),s=n("e1c6"),a=n("861e"),l=n("f808"),c=n("2179"),h=n("ab25"),u=">",d="<",p="prototype",f="script",g=h("IE_PROTO"),m=function(){},y=function(e){return d+f+u+e+d+"/"+f+u},w=function(e){e.write(y("")),e.close();var t=e.parentWindow.Object;return e=null,t},b=function(){var e,t=c("iframe"),n="java"+f+":";return t.style.display="none",l.appendChild(t),t.src=String(n),e=t.contentWindow.document,e.open(),e.write(y("document.F=Object")),e.close(),e.F},v=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}v="undefined"!=typeof document?document.domain&&r?w(r):b():w(r);var e=s.length;while(e--)delete v[p][s[e]];return v()};a[g]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(m[p]=i(e),n=new m,m[p]=null,n[g]=e):n=v(),void 0===t?n:o.f(n,t)}},"0c0f":function(e,t,n){"use strict";var r=n("b343"),i=n("73fa"),o=/#|\.prototype\./,s=function(e,t){var n=l[a(e)];return n===h||n!==c&&(i(t)?r(t):!!t)},a=s.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=s.data={},c=s.NATIVE="N",h=s.POLYFILL="P";e.exports=s},"0e87":function(e,t,n){"use strict";var r=n("73fa"),i=n("a60d"),o=n("b384"),s=n("3df8");e.exports=function(e,t,n,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:t;if(r(n)&&o(n,c,a),a.global)l?e[t]=n:s(t,n);else{try{a.unsafe?e[t]&&(l=!0):delete e[t]}catch(h){}l?e[t]=n:i.f(e,t,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},"0eec":function(e,t,n){"use strict";var r=n("ac4f"),i=n("f2e8"),o=n("d2e4").clear;r({global:!0,bind:!0,enumerable:!0,forced:i.clearImmediate!==o},{clearImmediate:o})},1004:function(e,t,n){"use strict";n("7a89"),n("d06e");var r=n("81ea"),i=n("351d"),o=n("29b0"),s=n("bd5e"),a=n("67a87"),l=n("97b9");function c(e,t,n){return t=h(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){var t=u(e,"string");return"symbol"==typeof t?t:t+""}function u(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}const d=["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"],p=a["a"]`The plugin hook "[hookName]" was removed in Handsontable [removedInVersion].\x20 Please consult release notes https://github.com/handsontable/handsontable/releases/tag/[removedInVersion] to\x20 learn about the migration path.`,f=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"]]),g=new Map([[]]);class m{static getSingleton(){return w()}constructor(){c(this,"globalBucket",void 0),this.globalBucket=this.createEmptyBucket()}createEmptyBucket(){const e=Object.create(null);return Object(r["arrayEach"])(d,t=>e[t]=[]),e}getBucket(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?(e.pluginHookBucket||(e.pluginHookBucket=this.createEmptyBucket()),e.pluginHookBucket):this.globalBucket}add(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(Array.isArray(t))Object(r["arrayEach"])(t,t=>this.add(e,t,n));else{f.has(e)&&Object(s["b"])(Object(o["substitute"])(p,{hookName:e,removedInVersion:f.get(e)})),g.has(e)&&Object(s["b"])(g.get(e));const i=this.getBucket(n);if("undefined"===typeof i[e]&&(this.register(e),i[e]=[]),t.skip=!1,-1===i[e].indexOf(t)){let n=!1;t.initialHook&&Object(r["arrayEach"])(i[e],(r,o)=>{if(r.initialHook)return i[e][o]=t,n=!0,!1}),n||i[e].push(t)}}return this}once(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Array.isArray(t)?Object(r["arrayEach"])(t,t=>this.once(e,t,n)):(t.runOnce=!0,this.add(e,t,n))}remove(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=this.getBucket(n);return"undefined"!==typeof r[e]&&r[e].indexOf(t)>=0&&(t.skip=!0,!0)}has(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=this.getBucket(t);return!(void 0===n[e]||!n[e].length)}run(e,t,n,r,i,o,s,a){{const c=this.globalBucket[t],h=c?c.length:0;let u=0;if(h)while(u0&&void 0!==arguments[0]?arguments[0]:null;Object(i["objectEach"])(this.getBucket(e),(e,t,n)=>n[t].length=0)}register(e){this.isRegistered(e)||d.push(e)}deregister(e){this.isRegistered(e)&&d.splice(d.indexOf(e),1)}isDeprecated(e){return g.has(e)||f.has(e)}isRegistered(e){return d.indexOf(e)>=0}getRegistered(){return d}}const y=new m;function w(){return y}t["a"]=m},1096:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));n("7a89"),n("d06e");var r=n("ffec"),i=n("351d"),o=n("97b9"),s=n("7ae0");function a(e,t,n){return t=l(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){var t=c(e,"string");return"symbol"==typeof t?t:t+""}function c(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class h{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a(this,"indexedValues",[]),a(this,"initValueOrFn",void 0),this.initValueOrFn=e}getValues(){return this.indexedValues}getValueAtIndex(e){const t=this.indexedValues;if(e0&&void 0!==arguments[0]?arguments[0]:this.indexedValues.length;this.indexedValues.length=0,Object(o["isFunction"])(this.initValueOrFn)?Object(r["rangeEach"])(e-1,e=>this.indexedValues.push(this.initValueOrFn(e))):Object(r["rangeEach"])(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}}Object(i["mixin"])(h,s["a"])},"11b3":function(e,t,n){"use strict";var r=n("8793"),i=n("939b"),o=n("80dd"),s=o("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[s])?!!t:"RegExp"===i(e))}},"12e9":function(e,t,n){"use strict";var r=n("80dd"),i=r("toStringTag"),o={};o[i]="z",e.exports="[object z]"===String(o)},"13e1":function(e,t,n){"use strict";n.d(t,"b",(function(){return g})),n.d(t,"c",(function(){return m})),n.d(t,"a",(function(){return y}));n("7a89");var r=n("7b9c"),i=n("351d"),o=n("c5c4"),s=(n("d06e"),n("81ea"));const a="hooksRefRegisterer",l={_hooksStorage:Object.create(null),addHook(e,t){return this._hooksStorage[e]||(this._hooksStorage[e]=[]),this.hot.addHook(e,t),this._hooksStorage[e].push(t),this},removeHooksByKey(e){Object(s["arrayEach"])(this._hooksStorage[e]||[],t=>{this.hot.removeHook(e,t)})},clearHooks(){Object(i["objectEach"])(this._hooksStorage,(e,t)=>this.removeHooksByKey(t)),this._hooksStorage={}}};Object(i["defineGetter"])(l,"MIXIN_NAME",a,{writable:!1,enumerable:!1});var c=l,h=n("5d7f");function u(e,t,n){return t=d(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){var t=p(e,"string");return"symbol"==typeof t?t:t+""}function p(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}const f="base",g=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"}),m="baseEditor";class y{static get EDITOR_TYPE(){return f}constructor(e){u(this,"hot",void 0),u(this,"state",g.VIRGIN),u(this,"_opened",!1),u(this,"_fullEditMode",!1),u(this,"_closeCallback",null),u(this,"TD",null),u(this,"row",null),u(this,"col",null),u(this,"prop",null),u(this,"originalValue",null),u(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,t,n,r,i,o){this.TD=r,this.row=e,this.col=t,this.prop=n,this.originalValue=i,this.cellProperties=o,this.state=g.VIRGIN}extend(){return class extends this.constructor{}}saveValue(e,t){let n,i,o,s;if(t){const e=this.hot.getSelectedLast();n=Math.max(Math.min(e[0],e[2]),0),i=Math.max(Math.min(e[1],e[3]),0),o=Math.max(e[0],e[2]),s=Math.max(e[1],e[3])}else[n,i,o,s]=[this.row,this.col,null,null];const a=this.hot.runHooks("modifyGetCellCoords",n,i);Array.isArray(a)&&([n,i]=a);const l=this.hot.getShortcutManager(),c=l.getContext("editor"),h={runOnlyIf:()=>Object(r["isDefined"])(this.hot.getSelected()),group:m};this.isInFullEditMode()&&c.addShortcuts([{keys:[["ArrowUp"]],callback:()=>{this.hot.selection.transformStart(-1,0)}},{keys:[["ArrowDown"]],callback:()=>{this.hot.selection.transformStart(1,0)}},{keys:[["ArrowLeft"]],callback:()=>{this.hot.selection.transformStart(0,-1*this.hot.getDirectionFactor())}},{keys:[["ArrowRight"]],callback:()=>{this.hot.selection.transformStart(0,this.hot.getDirectionFactor())}}],h),this.hot.populateFromArray(n,i,e,o,s,"edit")}beginEditing(e,t){if(this.state!==g.VIRGIN)return;const n=this.hot,i=n.rowIndexMapper.getRenderableFromVisualIndex(this.row),o=n.columnIndexMapper.getRenderableFromVisualIndex(this.col);if(n.view.scrollViewport(n._createCellCoords(i,o)),this.state=g.EDITING,this.isInFullEditMode()){const t="string"===typeof e?e:Object(r["stringify"])(this.originalValue);this.setValue(t)}this.open(t),this._opened=!0,this.focus(),n.view.render(),n.runHooks("afterBeginEditing",this.row,this.col)}finishEditing(e,t,n){let r;if(n){const e=this._closeCallback;this._closeCallback=t=>{e&&e(t),n(t),this.hot.view.render()}}if(this.isWaiting())return;const i=this.hot.getShortcutManager(),s=i.getContext("editor");if(s.removeShortcutsByGroup(m),s.removeShortcutsByGroup(o["a"]),this.state!==g.VIRGIN){if(this.state===g.EDITING){if(e)return this.cancelChanges(),void this.hot.view.render();const n=this.getValue();r=this.cellProperties.trimWhitespace?[["string"===typeof n?String.prototype.trim.call(n||""):n]]:[[n]],this.state=g.WAITING,this.saveValue(r,t),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",e=>{this.state=g.FINISHED,this.discardEditor(e)}):(this.state=g.FINISHED,this.discardEditor(!0))}}else this.hot._registerTimeout(()=>{this._fireCallbacks(!0)})}cancelChanges(){this.state=g.FINISHED,this.discardEditor()}discardEditor(e){if(this.state===g.FINISHED)if(!1===e&&!0!==this.cellProperties.allowInvalid)this.hot.selectCell(this.row,this.col),this.focus(),this.state=g.EDITING,this._fireCallbacks(!1);else{this.close(),this._opened=!1,this._fullEditMode=!1,this.state=g.VIRGIN,this._fireCallbacks(!0);const e=this.hot.getShortcutManager();e.setActiveContextName("grid")}}enableFullEditMode(){this._fullEditMode=!0}isInFullEditMode(){return this._fullEditMode}isOpened(){return this._opened}isWaiting(){return this.state===g.WAITING}getEditedCellRect(){var e;const t=this.getEditedCell();if(!t)return;const{wtOverlays:n,wtViewport:r}=this.hot.view._wt,i=this.hot.rootWindow,o=Object(h["offset"])(t),s=Object(h["outerWidth"])(t),a=Object(h["offset"])(this.hot.rootElement),l=Object(h["outerWidth"])(this.hot.rootElement),c=n.topOverlay.holder,u=n.inlineStartOverlay.holder,d=c!==i?c.scrollTop:0,p=u!==i?u.scrollLeft:0,f=i.innerWidth-a.left-l,{wtTable:g}=null!==(e=n.getParentOverlay(t))&&void 0!==e?e:this.hot.view._wt,m=g.name,y=["master","inline_start"].includes(m)?d:0,w=["master","top","bottom"].includes(m)?p:0,b=o.top===a.top?0:1;let v=o.top-a.top-b-y,E=0;E=this.hot.isRtl()?i.innerWidth-o.left-s-f-1+w:o.left-a.left-1-w,["top","top_inline_start_corner"].includes(m)&&(v+=n.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(m)&&(E+=Math.abs(n.inlineStartOverlay.getOverlayOffset()));const C=this.hot.hasColHeaders(),S=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),R=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),T=this.hot.rowIndexMapper.getRenderableIndexesLength(),O=T-this.hot.view._wt.getSetting("fixedRowsBottom");(C&&S<=0||S===O)&&(v+=1),R<=0&&(E+=1);const N=r.rowsRenderCalculator.startPosition,A=r.columnsRenderCalculator.startPosition,I=Math.abs(n.inlineStartOverlay.getScrollPosition()),M=n.topOverlay.getScrollPosition(),x=Object(h["getScrollbarWidth"])(this.hot.rootDocument);let _=t.offsetTop;if(["inline_start","master"].includes(m)&&(_+=N-M),["bottom","bottom_inline_start_corner"].includes(m)){const{wtViewport:e,wtTable:t}=n.bottomOverlay.clone;_+=e.getWorkspaceHeight()-t.getHeight()-x}let L=t.offsetLeft;this.hot.isRtl()?(L=L>=0?g.getWidth()-t.offsetLeft:Math.abs(L),L+=A-I-s):["top","master","bottom"].includes(m)&&(L+=A-I);const P=Object(h["getComputedStyle"])(this.TD,this.hot.rootWindow),k=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",j=parseInt(P[k],10)>0?0:1,H=parseInt(P.borderTopWidth,10)>0?0:1,D=Object(h["outerWidth"])(t)+j,F=Object(h["outerHeight"])(t)+H,U=Object(h["hasVerticalScrollbar"])(c)?x:0,V=Object(h["hasHorizontalScrollbar"])(u)?x:0,B=this.hot.view.maximumVisibleElementWidth(L)-U+j,W=Math.max(this.hot.view.maximumVisibleElementHeight(_)-V+H,23);return{top:v,start:E,height:F,maxHeight:W,width:D,maxWidth:B}}getEditedCellsLayerClass(){const e=this.checkEditorSection();switch(e){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 t="";return this.row=e-this.hot.getSettings().fixedRowsBottom?t=this.colw&&d(r,arguments[w]),r}));if(R.prototype=C,"Error"!==v?a?a(R,S):l(R,S,{name:!0}):f&&y in E&&(c(R,E,y),c(R,E,"prepareStackTrace")),l(R,E),!g)try{C.name!==v&&o(C,"name",v),C.constructor=R}catch(T){}return R}}},"1b1a":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n("1096"),i=n("3d57"),o=n("a73f");class s extends r["a"]{constructor(){super(e=>e)}insert(e,t){const n=Object(o["b"])(this.indexedValues,t);this.indexedValues=Object(i["a"])(n,e,t),super.insert(e,t)}remove(e){const t=Object(i["b"])(this.indexedValues,e);this.indexedValues=Object(o["a"])(t,e),super.remove(e)}}},"1caf":function(e,t,n){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"1d07":function(e,t,n){"use strict";var r=n("69ba"),i=n("fb46"),o=n("485c6"),s=n("a60d");e.exports=function(e,t,n){for(var a=i(t),l=s.f,c=o.f,h=0;h0&&e.countRenderedRows()>0){const r=e.getSettings(),i="function"===typeof r.enterMoves?r.enterMoves(t):r.enterMoves;n.includes("shift")?e.selection.transformFocus(-i.row,-i.col):e.selection.transformFocus(i.row,i.col)}else o.isHeader()||(e.getSettings().enterBeginsEditing?r.cellProperties.readOnly?r.moveSelectionAfterEnter(t):r.openEditor(null,t,!0):r.moveSelectionAfterEnter(t),Object(a["stopImmediatePropagation"])(t))}};function c(){return[i,o,s,l]}const h={name:"extendCellsSelectionDown",callback(e){const{highlight:t}=e.getSelectedRangeLast();e.selection.isSelectedByColumnHeader()||e.selection.isSelectedByCorner()||!(t.isCell()||t.isHeader()&&e.selection.isSelectedByRowHeader())||e.selection.transformEnd(1,0)}},u={name:"extendCellsSelectionDownByViewportHeight",callback(e){const{to:t}=e.getSelectedRangeLast(),n=Math.min(t.row+e.countVisibleRows(),e.countRows()-1),r=e.rowIndexMapper.getNearestNotHiddenIndex(n,-1);if(null!==r){const n=e._createCellCoords(r,t.col),i=t.row-e.view.getFirstFullyVisibleRow(),o=Math.min(n.row-i,e.countRows()-1);e.selection.setRangeEnd(n),e.scrollViewportTo({row:o,verticalSnap:"top",horizontalSnap:"start"})}}},d={name:"extendCellsSelectionLeft",callback(e){const{highlight:t}=e.getSelectedRangeLast();e.selection.isSelectedByRowHeader()||e.selection.isSelectedByCorner()||!(t.isCell()||t.isHeader()&&e.selection.isSelectedByColumnHeader())||e.selection.transformEnd(0,-1*e.getDirectionFactor())}},p={name:"extendCellsSelectionRight",callback(e){const{highlight:t}=e.getSelectedRangeLast();e.selection.isSelectedByRowHeader()||e.selection.isSelectedByCorner()||!(t.isCell()||t.isHeader()&&e.selection.isSelectedByColumnHeader())||e.selection.transformEnd(0,e.getDirectionFactor())}},f={name:"extendCellsSelectionToColumns",callback(e){const{highlight:t,from:n,to:r}=e.getSelectedRangeLast();e.selection.isSelectedByRowHeader()?e.selection.selectAll(!0,!0):e.selectColumns(n.col,r.col,t)}},g={name:"extendCellsSelectionToMostBottom",callback(e){const{selection:t,rowIndexMapper:n}=e,{highlight:r,from:i,to:o}=e.getSelectedRangeLast(),s=r.isHeader()&&e.selection.isSelectedByRowHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(e.countRows()-1,-1),l=i.clone();l.row=r.row,t.setRangeStart(l,void 0,!1,r.clone()),s&&t.selectedByRowHeader.add(t.getLayerLevel()),t.setRangeEnd(e._createCellCoords(a,o.col))}}},m={name:"extendCellsSelectionToMostInlineEnd",callback(e){const{selection:t,columnIndexMapper:n}=e,{highlight:r,from:i,to:o}=e.getSelectedRangeLast();if(!e.selection.isSelectedByRowHeader()&&!e.selection.isSelectedByCorner()&&r.isCell()){const s=n.getNearestNotHiddenIndex(e.countCols()-1,-1),a=i.clone();a.col=r.col,t.setRangeStart(a,void 0,!1,r.clone()),t.setRangeEnd(e._createCellCoords(o.row,s))}}},y={name:"extendCellsSelectionToMostInlineStart",callback(e){const{selection:t,columnIndexMapper:n}=e,{highlight:r,from:i,to:o}=e.getSelectedRangeLast();if(!e.selection.isSelectedByRowHeader()&&!e.selection.isSelectedByCorner()&&r.isCell()){const s=parseInt(e.getSettings().fixedColumnsStart,10),a=n.getNearestNotHiddenIndex(s,1),l=i.clone();l.col=r.col,t.setRangeStart(l,void 0,!1,r.clone()),t.setRangeEnd(e._createCellCoords(o.row,a))}}},w={name:"extendCellsSelectionToMostLeft",callback(e){const{selection:t,columnIndexMapper:n}=e,{highlight:r,from:i,to:o}=e.getSelectedRangeLast(),s=r.isHeader()&&e.selection.isSelectedByColumnHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(...e.isRtl()?[e.countCols()-1,-1]:[0,1]),l=i.clone();l.col=r.col,t.setRangeStart(l,void 0,!1,r.clone()),s&&t.selectedByColumnHeader.add(t.getLayerLevel()),t.setRangeEnd(e._createCellCoords(o.row,a))}}},b={name:"extendCellsSelectionToMostRight",callback(e){const{selection:t,columnIndexMapper:n}=e,{highlight:r,from:i,to:o}=e.getSelectedRangeLast(),s=r.isHeader()&&e.selection.isSelectedByColumnHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(...e.isRtl()?[0,1]:[e.countCols()-1,-1]),l=i.clone();l.col=r.col,t.setRangeStart(l,void 0,!1,r.clone()),s&&t.selectedByColumnHeader.add(t.getLayerLevel()),t.setRangeEnd(e._createCellCoords(o.row,a))}}},v={name:"extendCellsSelectionToMostTop",callback(e){const{selection:t,rowIndexMapper:n}=e,{highlight:r,from:i,to:o}=e.getSelectedRangeLast(),s=r.isHeader()&&e.selection.isSelectedByRowHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(0,1),l=i.clone();l.row=r.row,t.setRangeStart(l,void 0,!1,r.clone()),s&&t.selectedByRowHeader.add(t.getLayerLevel()),t.setRangeEnd(e._createCellCoords(a,o.col))}}},E={name:"extendCellsSelectionToRows",callback(e){const{highlight:t,from:n,to:r}=e.getSelectedRangeLast();e.selection.isSelectedByColumnHeader()?e.selection.selectAll(!0,!0):e.selectRows(n.row,r.row,t)}},C={name:"extendCellsSelectionUp",callback(e){const{highlight:t}=e.getSelectedRangeLast();e.selection.isSelectedByColumnHeader()||e.selection.isSelectedByCorner()||!(t.isCell()||t.isHeader()&&e.selection.isSelectedByRowHeader())||e.selection.transformEnd(-1,0)}},S={name:"extendCellsSelectionUpByViewportHeight",callback(e){const{to:t}=e.getSelectedRangeLast(),n=Math.max(t.row-e.countVisibleRows(),0),r=e.rowIndexMapper.getNearestNotHiddenIndex(n,1);if(null!==r){const n=e._createCellCoords(r,t.col),i=t.row-e.view.getFirstFullyVisibleRow(),o=Math.max(n.row-i,0);e.selection.setRangeEnd(n),e.scrollViewportTo({row:o,verticalSnap:"top",horizontalSnap:"start"})}}};function R(){return[h,u,d,p,f,g,m,y,w,b,v,E,C,S]}const T={name:"moveCellSelectionDown",callback(e){let{selection:t}=e;t.transformStart(1,0)}},O={name:"moveCellSelectionDownByViewportHeight",callback(e){const{navigableHeaders:t}=e.getSettings(),n=t?e.countColHeaders():0,{row:r}=e.getSelectedRangeLast().highlight;let i=e.countVisibleRows()+n;r===e.countRows()-1?i=1:r+i>e.countRows()&&(i=e.countRows()-r-1),e.selection.transformStart(i,0),e.getSelectedRangeLast().highlight.row<0&&e.scrollViewportTo({row:0})}},N={name:"moveCellSelectionInlineEnd",callback(e,t){const n=e.getSettings(),r=e.getSelectedRangeLast(),i="function"===typeof n.tabMoves?n.tabMoves(t):n.tabMoves;e.selection.isMultiple()&&!r.isHeader()&&e.countRenderedCols()>0&&e.countRenderedRows()>0?e.selection.transformFocus(-i.row,-i.col):e.selection.transformStart(-i.row,-i.col)}},A={name:"moveCellSelectionInlineStart",callback(e,t){const n=e.getSettings(),r=e.getSelectedRangeLast(),i="function"===typeof n.tabMoves?n.tabMoves(t):n.tabMoves;e.selection.isMultiple()&&!r.isHeader()&&e.countRenderedCols()>0&&e.countRenderedRows()>0?e.selection.transformFocus(i.row,i.col):e.selection.transformStart(i.row,i.col)}},I={name:"moveCellSelectionLeft",callback(e){e.selection.transformStart(0,-1*e.getDirectionFactor())}},M={name:"moveCellSelectionRight",callback(e){e.selection.transformStart(0,e.getDirectionFactor())}},x={name:"moveCellSelectionToMostBottom",callback(e){const{col:t}=e.getSelectedRangeLast().highlight;let n=e.rowIndexMapper.getNearestNotHiddenIndex(e.countRows()-1,-1);null===n&&(n=-1),e.selection.setRangeStart(e._createCellCoords(n,t))}},_={name:"moveCellSelectionToMostBottomInlineEnd",callback(e){const{selection:t,rowIndexMapper:n,columnIndexMapper:r}=e,i=parseInt(e.getSettings().fixedRowsBottom,10),o=n.getNearestNotHiddenIndex(e.countRows()-i-1,-1),s=r.getNearestNotHiddenIndex(e.countCols()-1,-1);t.setRangeStart(e._createCellCoords(o,s))}},L={name:"moveCellSelectionToMostInlineEnd",callback(e){const{selection:t,columnIndexMapper:n}=e;t.setRangeStart(e._createCellCoords(e.getSelectedRangeLast().highlight.row,n.getNearestNotHiddenIndex(e.countCols()-1,-1)))}},P={name:"moveCellSelectionToMostInlineStart",callback(e){const{selection:t,columnIndexMapper:n}=e,r=parseInt(e.getSettings().fixedColumnsStart,10),i=e.getSelectedRangeLast().highlight.row,o=n.getNearestNotHiddenIndex(r,1);t.setRangeStart(e._createCellCoords(i,o))}},k={name:"moveCellSelectionToMostLeft",callback(e){const{selection:t,columnIndexMapper:n}=e,r=e.getSelectedRangeLast().highlight.row;let i=n.getNearestNotHiddenIndex(...e.isRtl()?[e.countCols()-1,-1]:[0,1]);null===i&&(i=e.isRtl()?-1:-e.countRowHeaders()),t.setRangeStart(e._createCellCoords(r,i))}},j={name:"moveCellSelectionToMostRight",callback(e){const{selection:t,columnIndexMapper:n}=e,{row:r}=e.getSelectedRangeLast().highlight;let i=n.getNearestNotHiddenIndex(...e.isRtl()?[0,1]:[e.countCols()-1,-1]);null===i&&(i=e.isRtl()?-e.countRowHeaders():-1),t.setRangeStart(e._createCellCoords(r,i))}},H={name:"moveCellSelectionToMostTop",callback(e){const{col:t}=e.getSelectedRangeLast().highlight;let n=e.rowIndexMapper.getNearestNotHiddenIndex(0,1);null===n&&(n=-e.countColHeaders()),e.selection.setRangeStart(e._createCellCoords(n,t))}},D={name:"moveCellSelectionToMostTopInlineStart",callback(e){const{selection:t,rowIndexMapper:n,columnIndexMapper:r}=e,i=parseInt(e.getSettings().fixedRowsTop,10),o=parseInt(e.getSettings().fixedColumnsStart,10),s=n.getNearestNotHiddenIndex(i,1),a=r.getNearestNotHiddenIndex(o,1);t.setRangeStart(e._createCellCoords(s,a))}},F={name:"moveCellSelectionUp",callback(e){let{selection:t}=e;t.transformStart(-1,0)}},U={name:"moveCellSelectionUpByViewportHight",callback(e){const{navigableHeaders:t}=e.getSettings(),n=t?e.countColHeaders():0,{row:r}=e.getSelectedRangeLast().highlight;let i=-(e.countVisibleRows()+n);r===-n?i=-1:r+i=0||t.col>=0)){const n={};if(t.col>=0){const r=Math.floor(e.countVisibleCols()/2);n.col=Math.max(t.col-r,0)}if(t.row>=0){const r=Math.floor(e.countVisibleRows()/2);n.row=Math.max(t.row-r,0)}e.scrollViewportTo({...n,verticalSnap:"top",horizontalSnap:"start"})}}},G={name:"selectAllCells",callback(e){e.selection.selectAll(!0,!0,{disableHeadersHighlight:!0})}},z={name:"selectAllCellsAndHeaders",callback(e){e.selection.selectAll(!0,!0,{disableHeadersHighlight:!1})}},Y={name:"populateSelectedCellsData",callback(e){const t=e.getSelectedRange(),{row:n,col:r}=t[t.length-1].highlight.normalize(),i=e.getDataAtCell(n,r),o=new Map;for(let s=0;s{if(t>=0&&s>=0&&(t!==n||s!==r)){const{readOnly:n}=e.getCellMeta(t,s);n||o.set(`${t}x${s}`,[t,s,i])}});e.setDataAtCell(Array.from(o.values()))}},X=[...c(),...R(),...V(),B,W,G,z,Y];function K(e){const t={};return X.forEach(n=>{let{name:r,callback:i}=n;t[r]=function(){for(var t=arguments.length,n=new Array(t),r=0;rn.editorCloseAndSave(e,t)},{keys:[["Enter","Control/Meta"],["Enter","Control/Meta","Shift"]],captureCtrl:!0,callback:(e,t)=>n.editorCloseAndSave(e,t)},{keys:[["Escape"],["Escape","Control/Meta"]],callback:()=>n.editorCloseWithoutSaving()}],i)}var q=n("7b9c");function Q(e){const t=e.getShortcutManager().addContext("grid"),n=K(e),i={runOnlyIf:()=>{const{navigableHeaders:t}=e.getSettings();return Object(q["isDefined"])(e.getSelected())&&(t||!t&&e.countRenderedRows()>0&&e.countRenderedCols()>0)},group:r["b"]};t.addShortcuts([{keys:[["F2"]],callback:e=>n.editorFastOpen(e)},{keys:[["Enter"],["Enter","Shift"]],callback:(e,t)=>n.editorOpen(e,t)},{keys:[["Backspace"],["Delete"]],callback:()=>n.emptySelectedCells()}],{group:r["a"],runOnlyIf:()=>Object(q["isDefined"])(e.getSelected())}),t.addShortcuts([{keys:[["Control/Meta","A"]],callback:()=>n.selectAllCells(),runOnlyIf:()=>!e.getSelectedRangeLast().highlight.isHeader()},{keys:[["Control/Meta","A"]],callback:()=>{},runOnlyIf:()=>e.getSelectedRangeLast().highlight.isHeader(),preventDefault:!0},{keys:[["Control/Meta","Shift","Space"]],callback:()=>n.selectAllCellsAndHeaders()},{keys:[["Control/Meta","Enter"]],callback:()=>n.populateSelectedCellsData(),runOnlyIf:()=>!e.getSelectedRangeLast().highlight.isHeader()&&e.getSelectedRangeLast().getCellsCount()>1},{keys:[["Control","Space"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToColumns()},{keys:[["Shift","Space"]],stopPropagation:!0,callback:()=>n.extendCellsSelectionToRows()},{keys:[["ArrowUp"]],callback:()=>n.moveCellSelectionUp()},{keys:[["ArrowUp","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostTop()},{keys:[["ArrowUp","Shift"]],callback:()=>n.extendCellsSelectionUp()},{keys:[["ArrowUp","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostTop(),runOnlyIf:()=>!(e.selection.isSelectedByCorner()||e.selection.isSelectedByColumnHeader())},{keys:[["ArrowDown"]],callback:()=>n.moveCellSelectionDown()},{keys:[["ArrowDown","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostBottom()},{keys:[["ArrowDown","Shift"]],callback:()=>n.extendCellsSelectionDown()},{keys:[["ArrowDown","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostBottom(),runOnlyIf:()=>!(e.selection.isSelectedByCorner()||e.selection.isSelectedByColumnHeader())},{keys:[["ArrowLeft"]],callback:()=>n.moveCellSelectionLeft()},{keys:[["ArrowLeft","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostLeft()},{keys:[["ArrowLeft","Shift"]],callback:()=>n.extendCellsSelectionLeft()},{keys:[["ArrowLeft","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostLeft(),runOnlyIf:()=>!(e.selection.isSelectedByCorner()||e.selection.isSelectedByRowHeader())},{keys:[["ArrowRight"]],callback:()=>n.moveCellSelectionRight()},{keys:[["ArrowRight","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostRight()},{keys:[["ArrowRight","Shift"]],callback:()=>n.extendCellsSelectionRight()},{keys:[["ArrowRight","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostRight(),runOnlyIf:()=>!(e.selection.isSelectedByCorner()||e.selection.isSelectedByRowHeader())},{keys:[["Home"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostInlineStart(),runOnlyIf:()=>e.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["Home","Shift"]],callback:()=>n.extendCellsSelectionToMostInlineStart()},{keys:[["Home","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostTopInlineStart(),runOnlyIf:()=>e.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostInlineEnd(),runOnlyIf:()=>e.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End","Shift"]],callback:()=>n.extendCellsSelectionToMostInlineEnd()},{keys:[["End","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostBottomInlineEnd(),runOnlyIf:()=>e.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["PageUp"]],callback:()=>n.moveCellSelectionUpByViewportHight()},{keys:[["PageUp","Shift"]],callback:()=>n.extendCellsSelectionUpByViewportHeight()},{keys:[["PageDown"]],callback:()=>n.moveCellSelectionDownByViewportHeight()},{keys:[["PageDown","Shift"]],callback:()=>n.extendCellsSelectionDownByViewportHeight()},{keys:[["Tab"]],preventDefault:!1,callback:e=>n.moveCellSelectionInlineStart(e)},{keys:[["Shift","Tab"]],preventDefault:!1,callback:e=>n.moveCellSelectionInlineEnd(e)},{keys:[["Control/Meta","Backspace"]],callback:()=>n.scrollToFocusedCell()}],i)}function Z(e){[$,Q].forEach(t=>t(e))}},"1e92":function(e,t,n){"use strict";var r=n("fd18");e.exports=r({}.isPrototypeOf)},2179:function(e,t,n){"use strict";var r=n("f2e8"),i=n("8793"),o=r.document,s=i(o)&&i(o.createElement);e.exports=function(e){return s?o.createElement(e):{}}},"220a":function(e,t,n){"use strict";n("7a89"),n("d06e");var r=n("5d7f"),i=n("81ea");function o(e,t,n){return t=s(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){var t=a(e,"string");return"symbol"==typeof t?t:t+""}function a(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class l{constructor(e){o(this,"hot",null),o(this,"container",null),o(this,"injected",!1),o(this,"rows",[]),o(this,"columns",[]),o(this,"samples",null),o(this,"settings",{useHeaders:!0}),this.hot=e}addRow(e,t){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=t,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 t=this.hot.getColHeader(0);if(null!==t&&void 0!==t){const t={row:-1};this.rows.push(t),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),t.table=this.table.table}}addColumn(e,t){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=t,this.table=this.createTable(this.hot.table.className),this.getSetting("useHeaders")&&null!==this.hot.getColHeader(e)&&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(),Object(i["arrayEach"])(this.rows,t=>{e(t.row,Object(r["outerHeight"])(t.table)-1)})}getWidths(e){this.injected||this.injectTable(),Object(i["arrayEach"])(this.columns,t=>{const{width:n}=t.table.getBoundingClientRect();e(t.col,Math.ceil(n))})}setSettings(e){this.settings=e}setSetting(e,t){this.settings||(this.settings={}),this.settings[e]=t}getSettings(){return this.settings}getSetting(e){return this.settings?this.settings[e]:null}createColGroupsCol(e){const t=this.hot.rootDocument.createDocumentFragment();return this.hot.hasRowHeaders()&&t.appendChild(this.createColElement(-1,-1)),this.samples.forEach(n=>{Object(i["arrayEach"])(n.strings,n=>{t.appendChild(this.createColElement(n.col,e))})}),t}createRow(e){const{rootDocument:t}=this.hot,n=t.createDocumentFragment(),r=t.createElement("th");return this.hot.hasRowHeaders()&&(this.hot.view.appendRowHeader(e,r),n.appendChild(r)),this.samples.forEach(r=>{Object(i["arrayEach"])(r.strings,r=>{const i=r.col,o=this.hot.getCellMeta(e,i);o.col=i,o.row=e;const s=this.hot.getCellRenderer(o),a=t.createElement("td");a.setAttribute("ghost-table",1),s(this.hot,a,e,i,this.hot.colToProp(i),r.value,o),n.appendChild(a)})}),n}appendColumnHeadersRow(){const{rootDocument:e}=this.hot,t=e.createDocumentFragment(),n=[];if(this.hot.hasRowHeaders()){const r=e.createElement("th");n.push([-1,r]),t.appendChild(r)}this.samples.forEach(r=>{Object(i["arrayEach"])(r.strings,r=>{const i=r.col,o=e.createElement("th");n.push([i,o]),t.appendChild(o)})}),this.table.tHead.appendChild(t),Object(i["arrayEach"])(n,e=>{const[t,n]=e;this.hot.view.appendColHeader(t,n)})}createCol(e){const{rootDocument:t}=this.hot,n=t.createDocumentFragment();return this.samples.forEach(r=>{Object(i["arrayEach"])(r.strings,r=>{const i=r.row,o=this.hot.getCellMeta(i,e);o.col=e,o.row=i;const s=this.hot.getCellRenderer(o),a=t.createElement("td"),l=t.createElement("tr");a.setAttribute("ghost-table",1),s(this.hot,a,i,e,this.hot.colToProp(e),r.value,o),l.appendChild(a),n.appendChild(l)})}),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&&void 0!==arguments[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,t){const n=this.hot.rootDocument.createElement("col");let r=0;t>=0&&e>=0&&(r=this.hot.getCellMeta(t,e).colspan);let i=this.hot.getColWidth(e);if(r>1)for(let o=e+1;o0&&void 0!==arguments[0]?arguments[0]:"";const{rootDocument:t}=this.hot,n=t.createDocumentFragment(),i=t.createElement("table"),o=t.createElement("thead"),s=t.createElement("tbody"),a=t.createElement("colgroup"),l=t.createElement("tr"),c=t.createElement("th");return this.isVertical()&&i.appendChild(a),this.isHorizontal()&&(l.appendChild(c),o.appendChild(l),i.style.tableLayout="auto",i.style.width="auto"),i.appendChild(o),this.isVertical()&&s.appendChild(l),i.appendChild(s),Object(r["addClass"])(i,e),n.appendChild(i),{fragment:n,table:i,tHead:o,tBody:s,colGroup:a,tr:l,th:c}}createContainer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{rootDocument:t}=this.hot,n=t.createDocumentFragment(),i=t.createElement("div"),o="htGhostTable htAutoSize "+e.trim();return Object(r["addClass"])(i,o),n.appendChild(i),{fragment:n,container:i}}isVertical(){return!(!this.rows.length||this.columns.length)}isHorizontal(){return!(!this.columns.length||this.rows.length)}}t["a"]=l},2349:function(e,t,n){"use strict";var r=n("d128"),i=n("bdfe"),o=TypeError,s=Object.getOwnPropertyDescriptor,a=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=a?function(e,t){if(i(e)&&!s(e,"length").writable)throw new o("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},2408:function(e,t,n){"use strict";var r=n("e156"),i=String;e.exports=function(e){if("Symbol"===r(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}},2471:function(e,t,n){"use strict";var r=n("2aac"),i=n("022b");e.exports=function(e,t){var n=e[t];return i(n)?void 0:r(n)}},"24b5":function(e,t,n){"use strict";n.d(t,"b",(function(){return E})),n.d(t,"a",(function(){return C})),n.d(t,"c",(function(){return S})),n.d(t,"d",(function(){return R}));n("7a89");var r=n("29b0"),i=n("ffec"),o=n("97b9");const s="asc",a="desc",l=new Map([[s,[-1,1]],[a,[1,-1]]]),c=e=>`The priority '${e}' is already declared in a map.`,h=e=>`The priority '${e}' is not a number.`;function u(){let{errorPriorityExists:e,errorPriorityNaN:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=new Map;function r(r,o){if(!Object(i["isNumeric"])(r))throw new Error(t(r));if(n.has(r))throw new Error(e(r));n.set(r,o)}function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;const[t,r]=l.get(e)||l.get(s);return[...n].sort((e,n)=>e[0]e[1])}return e=Object(o["isFunction"])(e)?e:c,t=Object(o["isFunction"])(t)?t:h,{addItem:r,getItems:a}}var d=n("6906");const p=e=>`'${e}' value is already declared in a unique set.`;function f(){let{errorItemExists:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=new Set;function n(n){if(t.has(n))throw new Error(e(n));t.add(n)}function r(){return[...t]}function i(){t.clear()}return e=Object(o["isFunction"])(e)?e:p,{addItem:n,clear:i,getItems:r}}const g=e=>`There is already registered "${e}" plugin.`,m=e=>`There is already registered plugin on priority "${e}".`,y=e=>`The priority "${e}" is not a number.`,w=u({errorPriorityExists:m,errorPriorityNaN:y}),b=f({errorItemExists:g}),v=Object(d["a"])({errorIdExists:g});function E(){return[...w.getItems(),...b.getItems()]}function C(e){const t=Object(r["toUpperCaseFirst"])(e);return v.getItem(t)}function S(e){return!!C(e)}function R(e,t,n){[e,t,n]=O(e,t,n),void 0===C(e)&&T(e,t,n)}function T(e,t,n){const i=Object(r["toUpperCaseFirst"])(e);if(v.hasItem(i))throw new Error(g(i));void 0===n?b.addItem(i):w.addItem(n,i),v.addItem(i,t)}function O(e,t,n){return"function"===typeof e&&(t=e,e=t.PLUGIN_KEY,n=t.PLUGIN_PRIORITY),[e,t,n]}},"24b9e":function(e,t,n){"use strict";var r=n("f41c");r("flat")},"24d5":function(e,t,n){"use strict";var r=n("84d8"),i=n("4c54");e.exports=function(e){var t=r(e,"string");return i(t)?t:t+""}},"27dc":function(e,t,n){"use strict";var r=n("9394"),i=n("6b27"),o=n("7dcf4"),s=function(e){return function(t,n,s){var a=r(t),l=o(a);if(0===l)return!e&&-1;var c,h=i(s,l);if(e&&n!==n){while(l>h)if(c=a[h++],c!==c)return!0}else for(;l>h;h++)if((e||h in a)&&a[h]===n)return e||h||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},"29b0":function(e,t,n){"use strict";n.r(t),n.d(t,"toUpperCaseFirst",(function(){return o})),n.d(t,"equalsIgnoreCase",(function(){return s})),n.d(t,"randomString",(function(){return a})),n.d(t,"isPercentValue",(function(){return l})),n.d(t,"substitute",(function(){return c})),n.d(t,"stripTags",(function(){return h})),n.d(t,"sanitize",(function(){return u}));n("d06e");var r=n("c0c4"),i=n("7b9c");function o(e){return e[0].toUpperCase()+e.substr(1)}function s(){const e=[];for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return(""+e).replace(/(?:\\)?\[([^[\]]+)]/g,(e,n)=>"\\"===e.charAt(0)?e.substr(1,e.length-1):void 0===t[n]?"":t[n])}function h(e){return u(""+e,{ALLOWED_TAGS:[]})}function u(e,t){return r.sanitize(e,t)}},"2aac":function(e,t,n){"use strict";var r=n("73fa"),i=n("71ca"),o=TypeError;e.exports=function(e){if(r(e))return e;throw new o(i(e)+" is not a function")}},"2b75":function(e,t,n){"use strict";var r=n("d128"),i=n("b343");e.exports=r&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},"2c35":function(e,t,n){"use strict";var r=n("a60d").f;e.exports=function(e,t,n){n in e||r(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})}},"2cb8":function(e,t,n){"use strict";var r=n("7b69"),i=n("69ba"),o=n("1e92"),s=n("97dc"),a=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in a||i(e,"flags")||!o(a,e)?t:r(s,e)}},"2d2d":function(e,t,n){"use strict";var r=n("d128"),i=n("a60d"),o=n("1caf");e.exports=r?function(e,t,n){return i.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},"2daa":function(e,t,n){"use strict";var r=n("2d2d"),i=n("78e9"),o=n("cf36"),s=Error.captureStackTrace;e.exports=function(e,t,n,a){o&&(s?s(e,t):r(e,"stack",i(n,a)))}},3037:function(e,t,n){"use strict";var r=n("fd18"),i=n("bdfe"),o=n("73fa"),s=n("939b"),a=n("2408"),l=r([].push);e.exports=function(e){if(o(e))return e;if(i(e)){for(var t=e.length,n=[],r=0;r{"__children"!==n&&(e&&"object"===typeof e&&!Array.isArray(e)?t[n]=i(e):Array.isArray(e)?e.length&&"object"===typeof e[0]&&!Array.isArray(e[0])?t[n]=[i(e[0])]:t[n]=[]:t[n]=null)})),t}function o(e,t){return t.prototype.constructor=t,e.prototype=new t,e.prototype.constructor=e,e}function s(e,t,n){const r=Array.isArray(n);return f(t,(t,i)=>{(!1===r||n.includes(i))&&(e[i]=t)}),e}function a(e,t){f(t,(n,r)=>{t[r]&&"object"===typeof t[r]?(e[r]||(Array.isArray(t[r])?e[r]=[]:"[object Date]"===Object.prototype.toString.call(t[r])?e[r]=t[r]:e[r]={}),a(e[r],t[r])):e[r]=t[r]})}function l(e){return"object"===typeof e?JSON.parse(JSON.stringify(e)):e}function c(e){const t={};return f(e,(e,n)=>{t[n]=e}),t}function h(e){e.MIXINS||(e.MIXINS=[]);for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i{e.MIXINS.push(t.MIXIN_NAME),f(t,(t,n)=>{if(void 0!==e.prototype[n])throw new Error(`Mixin conflict. Property '${n}' already exist and cannot be overwritten.`);if("function"===typeof t)e.prototype[n]=t;else{const r=function(e,t){const n="_"+e,r=e=>{let t=e;return(Array.isArray(t)||d(t))&&(t=l(t)),t};return function(){return void 0===this[n]&&(this[n]=r(t)),this[n]}},i=function(e){const t="_"+e;return function(e){this[t]=e}};Object.defineProperty(e.prototype,n,{get:r(n,t),set:i(n),configurable:!0})}})}),e}function u(e,t){return JSON.stringify(e)===JSON.stringify(t)}function d(e){return"[object Object]"===Object.prototype.toString.call(e)}function p(e,t,n,r){r.value=n,r.writable=!1!==r.writable,r.enumerable=!1!==r.enumerable,r.configurable=!1!==r.configurable,Object.defineProperty(e,t,r)}function f(e,t){for(const n in e)if((!e.hasOwnProperty||e.hasOwnProperty&&Object.prototype.hasOwnProperty.call(e,n))&&!1===t(e[n],n,e))break;return e}function g(e,t){const n=t.split(".");let r=e;return f(n,e=>{if(r=r[e],void 0===r)return r=void 0,!1}),r}function m(e,t,n){const r=t.split(".");let i=e;r.forEach((e,t)=>{t!==r.length-1?(b(i,e)||(i[e]={}),i=i[e]):i[e]=n})}function y(e){if(!d(e))return 0;const t=function(e){let n=0;return d(e)?f(e,(e,r)=>{"__children"!==r&&(n+=t(e))}):n+=1,n};return t(e)}function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"value";const n="_"+t,r={_touched:!1,[n]:e,isTouched(){return this._touched}};return Object.defineProperty(r,t,{get(){return this[n]},set(e){this._touched=!0,this[n]=e},enumerable:!0,configurable:!0}),r}function b(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},"3bc4":function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return a}));const r=/^(\r\n|\n\r|\r|\n)/,i=/^[^\t\r\n]+/,o=/^\t/;function s(e){const t=[[""]];if(0===e.length)return t;let n,s=0,a=0;while(e.length>0){if(n===e.length)break;if(n=e.length,e.match(o))e=e.replace(o,""),s+=1,t[a][s]="";else if(e.match(r))e=e.replace(r,""),s=0,a+=1,t[a]=[""];else{let n="";if(e.startsWith('"')){let t=0,r=!0;while(r){const i=e.slice(0,1);'"'===i&&(t+=1),n+=i,e=e.slice(1),(0===e.length||e.match(/^[\t\r\n]/)&&t%2===0)&&(r=!1)}n=n.replace(/^"/,"").replace(/"$/,"").replace(/["]*/g,e=>new Array(Math.floor(e.length/2)).fill('"').join(""))}else{const t=e.match(i);n=t?t[0]:"",e=e.slice(n.length)}t[a][s]=n}}return t}function a(e){let t,n,r,i,o,s="";for(t=0,n=e.length;t0&&(s+="\t"),o=e[t][r],"string"===typeof o?o.indexOf("\n")>-1?s+=`"${o.replace(/"/g,'""')}"`:s+=o:s+=null===o||void 0===o?"":o;t!==n-1&&(s+="\n")}return s}},"3d57":function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var r=n("81ea");function i(e,t,n){return[...e.slice(0,t),...n,...e.slice(t)]}function o(e,t){return Object(r["arrayFilter"])(e,e=>!1===t.includes(e))}},"3d76":function(e,t,n){"use strict";n.d(t,"d",(function(){return h})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return a}));n("7a89");var r=n("9acd");const{register:i,getItem:o,hasItem:s,getNames:a,getValues:l}=Object(r["a"])("renderers");function c(e){if("function"===typeof e)return e;if(!s(e))throw Error(`No registered renderer found under "${e}" name`);return o(e)}function h(e,t){"string"!==typeof e&&(t=e,e=t.RENDERER_TYPE),i(e,t)}},"3df8":function(e,t,n){"use strict";var r=n("f2e8"),i=Object.defineProperty;e.exports=function(e,t){try{i(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},"3eb5":function(e,t,n){"use strict";function r(e){const t=new Date(e);return isNaN(new Date(e+"T00:00").getDate())?t:new Date(t.getTime()+6e4*t.getTimezoneOffset())}n.r(t),n.d(t,"getNormalizedDate",(function(){return r}))},"44d0":function(e,t,n){"use strict";var r,i,o=n("f2e8"),s=n("65c6"),a=o.process,l=o.Deno,c=a&&a.versions||l&&l.version,h=c&&c.v8;h&&(r=h.split("."),i=r[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&s&&(r=s.match(/Edge\/(\d+)/),(!r||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/),r&&(i=+r[1]))),e.exports=i},"480c":function(e,t,n){"use strict";n.r(t),n.d(t,"spreadsheetColumnLabel",(function(){return s})),n.d(t,"spreadsheetColumnIndex",(function(){return a})),n.d(t,"createSpreadsheetData",(function(){return l})),n.d(t,"createSpreadsheetObjectData",(function(){return c})),n.d(t,"createEmptySpreadsheetData",(function(){return h})),n.d(t,"dataRowToChangesArray",(function(){return u})),n.d(t,"countFirstRowKeys",(function(){return d})),n.d(t,"isArrayOfArrays",(function(){return p})),n.d(t,"isArrayOfObjects",(function(){return f}));n("d06e");var r=n("351d");const i="ABCDEFGHIJKLMNOPQRSTUVWXYZ",o=i.length;function s(e){let t,n=e+1,r="";while(n>0)t=(n-1)%o,r=String.fromCharCode(65+t)+r,n=parseInt((n-t)/o,10);return r}function a(e){let t=0;if(e)for(let n=0,r=e.length-1;n0&&void 0!==arguments[0]?arguments[0]:100,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;const n=[];let r,i;for(r=0;r0&&void 0!==arguments[0]?arguments[0]:100,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;const n=[];let r,i;for(r=0;r1&&void 0!==arguments[1]?arguments[1]:0,n=e;const r=[];return Array.isArray(e)&&Array.isArray(e[0])||(n=[e]),n.forEach((e,n)=>{Array.isArray(e)?e.forEach((e,i)=>{r.push([n+t,i,e])}):Object.keys(e).forEach(i=>{r.push([n+t,i,e[i]])})}),r}function d(e){let t=0;return Array.isArray(e)&&(e[0]&&Array.isArray(e[0])?t=e[0].length:e[0]&&Object(r["isObject"])(e[0])&&(t=Object(r["deepObjectSize"])(e[0]))),t}function p(e){return!!(Array.isArray(e)&&e.length&&e.every(e=>Array.isArray(e)))}function f(e){return!!(Array.isArray(e)&&e.length&&e.every(e=>"object"===typeof e&&!Array.isArray(e)&&null!==e))}},"485c6":function(e,t,n){"use strict";var r=n("d128"),i=n("7b69"),o=n("ba51"),s=n("1caf"),a=n("9394"),l=n("24d5"),c=n("69ba"),h=n("d435"),u=Object.getOwnPropertyDescriptor;t.f=r?u:function(e,t){if(e=a(e),t=l(t),h)try{return u(e,t)}catch(n){}if(c(e,t))return s(!i(o.f,e,t),e[t])}},"48ab":function(e,t,n){"use strict";var r=n("b343");e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},"491c":function(e,t,n){"use strict";n.d(t,"e",(function(){return f})),n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return d})),n.d(t,"d",(function(){return l})),n.d(t,"c",(function(){return c}));n("7a89");var r=n("1004"),i=n("9acd");const o=new WeakMap,{register:s,getItem:a,hasItem:l,getNames:c,getValues:h}=Object(i["a"])("editors");function u(e){const t={},n=e;this.getConstructor=function(){return e},this.getInstance=function(e){return e.guid in t||(t[e.guid]=new n(e)),t[e.guid]},r["a"].getSingleton().add("afterDestroy",(function(){t[this.guid]=null}))}function d(e,t){let n;if("function"===typeof e)o.get(e)||f(null,e),n=o.get(e);else{if("string"!==typeof e)throw Error('Only strings and functions can be passed as "editor" parameter');n=a(e)}if(!n)throw Error(`No editor registered under name "${e}"`);return n.getInstance(t)}function p(e){if("function"===typeof e)return e;if(!l(e))throw Error(`No registered editor found under "${e}" name`);return a(e).getConstructor()}function f(e,t){e&&"string"!==typeof e&&(t=e,e=t.EDITOR_TYPE);const n=new u(t);"string"===typeof e&&s(e,n),o.set(t,n)}},"4aa5":function(e,t,n){"use strict";t.f=Object.getOwnPropertySymbols},"4c54":function(e,t,n){"use strict";var r=n("0227"),i=n("73fa"),o=n("1e92"),s=n("9c76"),a=Object;e.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return i(t)&&o(t.prototype,a(e))}},"4cd6":function(e,t,n){"use strict";var r=n("f41c");r("flatMap")},"4ec9":function(e,t,n){"use strict";var r=n("6d61"),i=n("6566");e.exports=r("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),i)},"54d7":function(e,t,n){"use strict";var r=n("d62b"),i=n("f2e8"),o=n("3df8"),s="__core-js_shared__",a=e.exports=i[s]||o(s,{});(a.versions||(a.versions=[])).push({version:"3.37.1",mode:r?"pure":"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"})},"592a":function(e,t,n){"use strict";var r=n("fd18"),i=0,o=Math.random(),s=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++i+o,36)}},"59a2":function(e,t,n){"use strict";var r=n("ac4f"),i=n("f2e8"),o=n("d2e4").set,s=n("f6cb"),a=i.setImmediate?s(o,!1):o;r({global:!0,bind:!0,enumerable:!0,forced:i.setImmediate!==a},{setImmediate:a})},"5b82":function(e,t,n){"use strict";var r=n("ac4f"),i=n("0227"),o=n("0204"),s=n("7b69"),a=n("fd18"),l=n("b343"),c=n("73fa"),h=n("4c54"),u=n("9674"),d=n("3037"),p=n("7b7f"),f=String,g=i("JSON","stringify"),m=a(/./.exec),y=a("".charAt),w=a("".charCodeAt),b=a("".replace),v=a(1..toString),E=/[\uD800-\uDFFF]/g,C=/^[\uD800-\uDBFF]$/,S=/^[\uDC00-\uDFFF]$/,R=!p||l((function(){var e=i("Symbol")("stringify detection");return"[null]"!==g([e])||"{}"!==g({a:e})||"{}"!==g(Object(e))})),T=l((function(){return'"\\udf06\\ud834"'!==g("\udf06\ud834")||'"\\udead"'!==g("\udead")})),O=function(e,t){var n=u(arguments),r=d(t);if(c(r)||void 0!==e&&!h(e))return n[1]=function(e,t){if(c(r)&&(t=s(r,this,f(e),t)),!h(t))return t},o(g,null,n)},N=function(e,t,n){var r=y(n,t-1),i=y(n,t+1);return m(C,e)&&!m(S,i)||m(S,e)&&!m(C,r)?"\\u"+v(w(e,0),16):e};g&&r({target:"JSON",stat:!0,arity:3,forced:R||T},{stringify:function(e,t,n){var r=u(arguments),i=o(R?O:g,null,r);return T&&"string"==typeof i?b(i,E,N):i}})},"5bc5":function(e,t,n){"use strict";var r=n("f2e8"),i=n("939b");e.exports="process"===i(r.process)},"5d7f":function(e,t,n){"use strict";n.r(t),n.d(t,"getParent",(function(){return o})),n.d(t,"isThisHotChild",(function(){return s})),n.d(t,"getFrameElement",(function(){return a})),n.d(t,"getParentWindow",(function(){return l})),n.d(t,"hasAccessToParentWindow",(function(){return c})),n.d(t,"closest",(function(){return h})),n.d(t,"closestDown",(function(){return u})),n.d(t,"isChildOf",(function(){return d})),n.d(t,"index",(function(){return p})),n.d(t,"overlayContainsElement",(function(){return f})),n.d(t,"hasClass",(function(){return y})),n.d(t,"addClass",(function(){return w})),n.d(t,"removeClass",(function(){return b})),n.d(t,"setAttribute",(function(){return v})),n.d(t,"removeAttribute",(function(){return E})),n.d(t,"removeTextNodes",(function(){return C})),n.d(t,"empty",(function(){return S})),n.d(t,"HTML_CHARACTERS",(function(){return R})),n.d(t,"fastInnerHTML",(function(){return T})),n.d(t,"fastInnerText",(function(){return O})),n.d(t,"isVisible",(function(){return N})),n.d(t,"offset",(function(){return A})),n.d(t,"getWindowScrollTop",(function(){return I})),n.d(t,"getWindowScrollLeft",(function(){return M})),n.d(t,"getScrollTop",(function(){return x})),n.d(t,"getScrollLeft",(function(){return _})),n.d(t,"getScrollableElement",(function(){return L})),n.d(t,"getMaximumScrollTop",(function(){return P})),n.d(t,"getMaximumScrollLeft",(function(){return k})),n.d(t,"getTrimmingContainer",(function(){return j})),n.d(t,"getStyle",(function(){return H})),n.d(t,"matchesCSSRules",(function(){return D})),n.d(t,"getComputedStyle",(function(){return F})),n.d(t,"outerWidth",(function(){return U})),n.d(t,"outerHeight",(function(){return V})),n.d(t,"innerHeight",(function(){return B})),n.d(t,"innerWidth",(function(){return W})),n.d(t,"addEvent",(function(){return G})),n.d(t,"removeEvent",(function(){return z})),n.d(t,"getCaretPosition",(function(){return Y})),n.d(t,"getSelectionEndPosition",(function(){return X})),n.d(t,"getSelectionText",(function(){return K})),n.d(t,"clearTextSelection",(function(){return $})),n.d(t,"setCaretPosition",(function(){return q})),n.d(t,"getScrollbarWidth",(function(){return J})),n.d(t,"hasVerticalScrollbar",(function(){return ee})),n.d(t,"hasHorizontalScrollbar",(function(){return te})),n.d(t,"setOverlayPosition",(function(){return ne})),n.d(t,"getCssTransform",(function(){return re})),n.d(t,"resetCssTransform",(function(){return ie})),n.d(t,"isInput",(function(){return oe})),n.d(t,"isOutsideInput",(function(){return se})),n.d(t,"selectElementIfAllowed",(function(){return ae})),n.d(t,"isDetached",(function(){return le})),n.d(t,"observeVisibilityChangeOnce",(function(){return ce})),n.d(t,"makeElementContentEditableAndSelectItsContent",(function(){return he})),n.d(t,"removeContentEditableFromElementAndDeselect",(function(){return ue})),n.d(t,"runWithSelectedContendEditableElement",(function(){return de}));n("7a89"),n("d06e");var r=n("29b0"),i=n("8828");function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=-1,r=null,i=e;while(null!==i){if(n===t){r=i;break}i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:(n+=1,i=i.parentNode)}return r}function s(e,t){const n=e.closest(".handsontable");return!!n&&(n.parentNode===t||n===t)}function a(e){return Object.getPrototypeOf(e.parent)&&e.frameElement}function l(e){return a(e)&&e.parent}function c(e){return!!Object.getPrototypeOf(e.parent)}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;const{ELEMENT_NODE:r,DOCUMENT_FRAGMENT_NODE:i}=Node;let o=e;while(null!==o&&void 0!==o&&o!==n){const{nodeType:e,nodeName:n}=o;if(e===r&&(t.includes(n)||t.includes(o)))return o;const{host:s}=o;o=s&&e===i?s:o.parentNode}return null}function u(e,t,n){const r=[];let i=e;while(i){if(i=h(i,t,n),!i||n&&!n.contains(i))break;r.push(i),i=i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i.host:i.parentNode}const o=r.length;return o?r[o-1]:null}function d(e,t){let n=e.parentNode,r=[];"string"===typeof t?r=e.defaultView?Array.prototype.slice.call(e.querySelectorAll(t),0):Array.prototype.slice.call(e.ownerDocument.querySelectorAll(t),0):r.push(t);while(null!==n){if(r.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function p(e){let t=0,n=e;if(n.previousSibling)while(n=n.previousSibling)t+=1;return t}function f(e,t,n){const r=n.parentElement.querySelector(".ht_clone_"+e);return r?r.contains(t):null}function g(e){return e&&e.length?e.filter(e=>!!e):[]}function m(e,t){if(!e||!e.length)return t?{regexFree:[],regexes:[]}:[];const n=[],r=[];return r.push(...e.filter(e=>{const r=e instanceof RegExp;return r&&t&&n.push(e),!r})),t?{regexFree:r,regexes:n}:r}function y(e,t){return void 0!==e.classList&&"string"===typeof t&&""!==t&&e.classList.contains(t)}function w(e,t){"string"===typeof t&&(t=t.split(" ")),t=g(t),t.length>0&&e.classList.add(...t)}function b(e,t){"string"===typeof t?t=t.split(" "):t instanceof RegExp&&(t=[t]);let{regexFree:n,regexes:r}=m(t,!0);n=g(n),n.length>0&&e.classList.remove(...n),r.forEach(t=>{e.classList.forEach(n=>{t.test(n)&&e.classList.remove(n)})})}function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;Array.isArray(t)||(t=[[t,n]]),t.forEach(t=>{Array.isArray(t)&&""!==t[0]&&e.setAttribute(...t)})}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];"string"===typeof t?t=t.split(" "):t instanceof RegExp&&(t=[t]);const{regexFree:n,regexes:r}=m(t,!0);n.forEach(t=>{""!==t&&e.removeAttribute(t)}),r.forEach(t=>{e.getAttributeNames().forEach(n=>{t.test(n)&&e.removeAttribute(n)})})}function C(e){if(3===e.nodeType)e.parentNode.removeChild(e);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(e.nodeName)>-1){const t=e.childNodes;for(let e=t.length-1;e>=0;e--)C(t[e])}}function S(e){let t;while(t=e.lastChild)e.removeChild(t)}const R=/(<(.*)>|&(.*);)/;function T(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];R.test(t)?e.innerHTML=n?Object(r["sanitize"])(t):t:O(e,t)}function O(e,t){const n=e.firstChild;n&&3===n.nodeType&&null===n.nextSibling?n.textContent=t:(S(e),e.appendChild(e.ownerDocument.createTextNode(t)))}function N(e){const t=e.ownerDocument.documentElement;let n=e;while(n!==t){if(null===n)return!1;if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){if(n.host){if(n.host.impl)return N(n.host.impl);if(n.host)return N(n.host);throw new Error("Lost in Web Components world")}return!1}if("none"===F(n).display)return!1;n=n.parentNode}return!0}function A(e){const t=e.ownerDocument,n=t.defaultView,r=t.documentElement;let i,o,s,a=e;i=a.offsetLeft,o=a.offsetTop,s=a;while(a=a.offsetParent){if(a===t.body)break;if(!("offsetLeft"in a))break;i+=a.offsetLeft,o+=a.offsetTop,s=a}return s&&"fixed"===s.style.position&&(i+=n.pageXOffset||r.scrollLeft,o+=n.pageYOffset||r.scrollTop),{left:i,top:o}}function I(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;return e.scrollY}function M(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;return e.scrollX}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;return e===t?I(t):e.scrollTop}function _(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;return e===t?M(t):e.scrollLeft}function L(e){let t=e.ownerDocument,n=t?t.defaultView:void 0;t||(t=e.document?e.document:e,n=t.defaultView);const r=["auto","scroll"];let i=e.parentNode;while(i&&i.style&&t.body!==i){let{overflow:e,overflowX:t,overflowY:o}=i.style;if([e,t,o].includes("scroll"))return i;if(({overflow:e,overflowX:t,overflowY:o}=n.getComputedStyle(i)),r.includes(e)||r.includes(t)||r.includes(o))return i;if(i.clientHeight<=i.scrollHeight+1&&(r.includes(o)||r.includes(e)))return i;if(i.clientWidth<=i.scrollWidth+1&&(r.includes(t)||r.includes(e)))return i;i=i.parentNode}return n}function P(e){return e.scrollHeight-e.clientHeight}function k(e){return e.scrollWidth-e.clientWidth}function j(e){const t=e.ownerDocument,n=t.defaultView;let r=e.parentNode;while(r&&r.style&&t.body!==r){if("visible"!==r.style.overflow&&""!==r.style.overflow)return r;const e=F(r,n),t=["scroll","hidden","auto"],i=e.getPropertyValue("overflow"),o=e.getPropertyValue("overflow-y"),s=e.getPropertyValue("overflow-x");if(t.includes(i)||t.includes(o)||t.includes(s))return r;r=r.parentNode}return n}function H(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window;if(!e)return;if(e===n)return"width"===t?n.innerWidth+"px":"height"===t?n.innerHeight+"px":void 0;const r=e.style[t];if(""!==r&&void 0!==r)return r;const i=F(e,n);return""!==i[t]&&void 0!==i[t]?i[t]:void 0}function D(e,t){const{selectorText:n}=t;let r=!1;return t.type===CSSRule.STYLE_RULE&&n&&(e.msMatchesSelector?r=e.msMatchesSelector(n):e.matches&&(r=e.matches(n))),r}function F(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;return e.currentStyle||t.getComputedStyle(e)}function U(e){return e.offsetWidth}function V(e){return e.offsetHeight}function B(e){return e.clientHeight||e.innerHeight}function W(e){return e.clientWidth||e.innerWidth}function G(e,t,n){e.addEventListener(t,n,!1)}function z(e,t,n){e.removeEventListener(t,n,!1)}function Y(e){return e.selectionStart?e.selectionStart:0}function X(e){return e.selectionEnd?e.selectionEnd:0}function K(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const t=e.document;let n="";return e.getSelection?n=e.getSelection().toString():t.selection&&"Control"!==t.selection.type&&(n=t.selection.createRange().text),n}function $(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;e.getSelection&&(e.getSelection().empty?e.getSelection().empty():e.getSelection().removeAllRanges&&e.getSelection().removeAllRanges())}function q(e,t,n){if(void 0===n&&(n=t),e.setSelectionRange){e.focus();try{e.setSelectionRange(t,n)}catch(r){const i=e.parentNode,o=i.style.display;i.style.display="block",e.setSelectionRange(t,n),i.style.display=o}}}let Q;function Z(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;const t=e.createElement("div");t.style.height="200px",t.style.width="100%";const n=e.createElement("div");n.style.boxSizing="content-box",n.style.height="150px",n.style.left="0px",n.style.overflow="hidden",n.style.position="absolute",n.style.top="0px",n.style.width="200px",n.style.visibility="hidden",n.appendChild(t),(e.body||e.documentElement).appendChild(n);const r=t.offsetWidth;n.style.overflow="scroll";let i=t.offsetWidth;return r===i&&(i=n.clientWidth),(e.body||e.documentElement).removeChild(n),r-i}function J(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;return void 0===Q&&(Q=Z(e)),Q}function ee(e){return e.offsetWidth!==e.clientWidth}function te(e){return e.offsetHeight!==e.clientHeight}function ne(e,t,n){e.style.transform=`translate3d(${t},${n},0)`}function re(e){let t;return e.style.transform&&""!==(t=e.style.transform)?["transform",t]:-1}function ie(e){e.style.transform&&""!==e.style.transform&&(e.style.transform="")}function oe(e){const t=["INPUT","SELECT","TEXTAREA"];return e&&(t.indexOf(e.nodeName)>-1||"true"===e.contentEditable)}function se(e){return oe(e)&&!1===e.hasAttribute("data-hot-input")}function ae(e){const t=e.ownerDocument.activeElement;se(t)||e.select()}function le(e){return!e.parentNode}function ce(e,t){const n=new IntersectionObserver((n,r)=>{n.forEach(n=>{n.isIntersecting&&null!==e.offsetParent&&(t(),r.unobserve(e))})},{root:e.ownerDocument.body});n.observe(e)}function he(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=e.ownerDocument,o=r.createRange(),s=r.defaultView.getSelection();v(e,"contenteditable",!0),n&&v(e,...Object(i["n"])()),t&&w(e,"invisibleSelection"),o.selectNodeContents(e),s.removeAllRanges(),s.addRange(o)}function ue(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=e.ownerDocument.defaultView.getSelection();e.hasAttribute("aria-hidden")&&e.removeAttribute("aria-hidden"),n.removeAllRanges(),t&&b(e,"invisibleSelection"),e.removeAttribute("contenteditable")}function de(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];he(e,n),t(),ue(e,n)}},6038:function(e,t,n){"use strict";var r=TypeError;e.exports=function(e,t){if(e{const t={value:!1,test:(n,r)=>{t.value=e(n,r)}};return t},s={chrome:o((e,t)=>/Chrome/.test(e)&&/Google/.test(t)),chromeWebKit:o(e=>/CriOS/.test(e)),edge:o(e=>/Edge/.test(e)),edgeWebKit:o(e=>/EdgiOS/.test(e)),firefox:o(e=>/Firefox/.test(e)),firefoxWebKit:o(e=>/FxiOS/.test(e)),mobile:o(e=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)),safari:o((e,t)=>/Safari/.test(e)&&/Apple Computer/.test(t))},a={mac:o(e=>/^Mac/.test(e)),win:o(e=>/^Win/.test(e)),linux:o(e=>/^Linux/.test(e)),ios:o(e=>/iPhone|iPad|iPod/i.test(e))};function l(){let{userAgent:e=navigator.userAgent,vendor:t=navigator.vendor}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r["objectEach"])(s,n=>{let{test:r}=n;r(e,t)})}function c(){let{platform:e=navigator.platform}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(r["objectEach"])(a,t=>{let{test:n}=t;n(e)})}function h(){return s.chrome.value}function u(){return s.chromeWebKit.value}function d(){return s.firefox.value}function p(){return s.firefoxWebKit.value}function f(){return s.safari.value}function g(){return s.edge.value}function m(){return s.edgeWebKit.value}function y(){return s.mobile.value}function w(){return a.ios.value}function b(){let{maxTouchPoints:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:navigator;return e>2&&a.mac.value}function v(){return a.win.value}function E(){return a.mac.value}function C(){return a.linux.value}Object(i["isCSR"])()&&(l(),c())},"652d":function(e,t,n){"use strict";var r=n("fd18"),i=n("69ba"),o=n("9394"),s=n("27dc").indexOf,a=n("861e"),l=r([].push);e.exports=function(e,t){var n,r=o(e),c=0,h=[];for(n in r)!i(a,n)&&i(r,n)&&l(h,n);while(t.length>c)i(r,n=t[c++])&&(~s(h,n)||l(h,n));return h}},"65c6":function(e,t,n){"use strict";e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},"67a87":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("81ea");function i(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i{const i=t.replace(/\r?\n\s*/g,""),o=n[r]?n[r]:"";return e+i+o},"");return o.trim()}},6906:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));n("7a89");var r=n("97b9");const i=e=>`The id '${e}' is already declared in a map.`;function o(){let{errorIdExists:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=new Map;function n(n,r){if(h(n))throw new Error(e(n));t.set(n,r)}function o(e){return t.delete(e)}function s(){t.clear()}function a(e){const[t]=c().find(t=>{let[n,r]=t;return e===r&&n})||[null];return t}function l(e){return t.get(e)}function c(){return[...t]}function h(e){return t.has(e)}return e=Object(r["isFunction"])(e)?e:i,{addItem:n,clear:s,getId:a,getItem:l,getItems:c,hasItem:h,removeItem:o}}},"69ba":function(e,t,n){"use strict";var r=n("fd18"),i=n("fc2d"),o=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(i(e),t)}},"6b27":function(e,t,n){"use strict";var r=n("9e75"),i=Math.max,o=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):o(n,t)}},"6f53":function(e,t,n){var r=n("83ab"),i=n("df75"),o=n("fc6a"),s=n("d1e7").f,a=function(e){return function(t){var n,a=o(t),l=i(a),c=l.length,h=0,u=[];while(c>h)n=l[h++],r&&!s.call(a,n)||u.push(e?[n,a[n]]:a[n]);return u}};e.exports={entries:a(!0),values:a(!1)}},"70f9":function(e,t,n){"use strict";var r=n("ac4f"),i=n("7b69"),o=n("fd18"),s=n("bf78"),a=n("73fa"),l=n("022b"),c=n("11b3"),h=n("2408"),u=n("2471"),d=n("2cb8"),p=n("aa44"),f=n("80dd"),g=n("d62b"),m=f("replace"),y=TypeError,w=o("".indexOf),b=o("".replace),v=o("".slice),E=Math.max;r({target:"String",proto:!0},{replaceAll:function(e,t){var n,r,o,f,C,S,R,T,O,N=s(this),A=0,I=0,M="";if(!l(e)){if(n=c(e),n&&(r=h(s(d(e))),!~w(r,"g")))throw new y("`.replaceAll` does not allow non-global regexes");if(o=u(e,m),o)return i(o,e,N,t);if(g&&n)return b(h(N),e,t)}f=h(N),C=h(e),S=a(t),S||(t=h(t)),R=C.length,T=E(1,R),A=w(f,C);while(-1!==A)O=S?h(t(C,A,f)):p(C,f,A,[],void 0,t),M+=v(f,I,A)+O,I=A+R,A=A+T>f.length?-1:w(f,C,A+T);return IparseInt(e,16),d=e=>parseInt(e,10),p=(e,t,n)=>e["substr"](t,n),f=e=>e["codePointAt"](0)-65,g=e=>(""+e).replace(/\-/g,""),m=e=>u(p(g(e),u("12"),f("F")))/(u(p(g(e),f("B"),~~![][h]))||9),y=()=>"undefined"!==typeof location&&/^([a-z0-9\-]+\.)?\x68\x61\x6E\x64\x73\x6F\x6E\x74\x61\x62\x6C\x65\x2E\x63\x6F\x6D$/i.test(location.host);let w=!1;const b={invalid:()=>i["a"]` The license key for Handsontable is invalid.\x20 If you need any help, contact us at support@handsontable.com.`,expired:e=>{let{keyValidityDate:t,hotVersion:n}=e;return i["a"]` The license key for Handsontable expired on ${t}, and is not valid for the installed\x20 version ${n}. Renew your license key at handsontable.com or downgrade to a version released prior\x20 to ${t}. If you need any help, contact us at sales@handsontable.com.`},missing:()=>i["a"]` The license key for Handsontable is missing. Use your purchased key to activate the product.\x20 Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20 passing the key: 'non-commercial-and-evaluation'. If you need any help, contact\x20 us at support@handsontable.com.`,non_commercial:()=>""},v={invalid:()=>i["a"]` The license key for Handsontable is invalid.\x20 Read more on how to\x20 install it properly or contact us at support@handsontable.com.`,expired:e=>{let{keyValidityDate:t,hotVersion:n}=e;return i["a"]` The license key for Handsontable expired on ${t}, and is not valid for the installed\x20 version ${n}. Renew your\x20 license key or downgrade to a version released prior to ${t}. If you need any\x20 help, contact us at sales@handsontable.com.`},missing:()=>i["a"]` The license key for Handsontable is missing. Use your purchased key to activate the product.\x20 Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20 passing the key: 'non-commercial-and-evaluation'.\x20 Read more about it in\x20 the documentation or contact us at support@handsontable.com.`,non_commercial:()=>""};function E(e,t){const n=!l(e),i="string"===typeof e&&"non-commercial-and-evaluation"===e.toLowerCase(),o="14.3.0";let s,a="invalid",c="invalid";e=g(e||"");const h=C(e);if(n||i||h)if(h){const t=r("16/04/2024","DD/MM/YYYY"),n=Math.floor(t.toDate().getTime()/864e5),i=m(e);s=r(864e5*(i+1),"x").format("MMMM DD, YYYY"),n>i?(a="expired",c="expired"):(a="valid",c="valid")}else i?(a="non_commercial",c="valid"):(a="invalid",c="invalid");else a="missing",c="missing";if(y()&&(a="valid",c="valid"),!w&&"valid"!==a){const e=b[a]({keyValidityDate:s,hotVersion:o});e&&console["non_commercial"===a?"info":"warn"](b[a]({keyValidityDate:s,hotVersion:o})),w=!0}if("valid"!==c&&t.parentNode){const e=v[c]({keyValidityDate:s,hotVersion:o});if(e){const e=document.createElement("div");e.className="hot-display-license-info",e.innerHTML=v[c]({keyValidityDate:s,hotVersion:o}),t.parentNode.insertBefore(e,t.nextSibling)}}}function C(e){let t=[][h],n=t;if(e[h]!==f("Z"))return!1;for(let r="",i="B>1:r=p(e,o,o?1===i[h]?9:8:6);return n===t}},"7c2b":function(e,t,n){"use strict";var r=n("624b"),i=n("8793"),o=n("bf78"),s=n("73d9");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{e=r(Object.prototype,"__proto__","set"),e(n,[]),t=n instanceof Array}catch(a){}return function(n,r){return o(n),s(r),i(n)?(t?e(n,r):n.__proto__=r,n):n}}():void 0)},"7d61":function(e,t,n){"use strict";var r=n("9046"),i=n("2aac"),o=n("48ab"),s=r(r.bind);e.exports=function(e,t){return i(e),void 0===t?e:o?s(e,t):function(){return e.apply(t,arguments)}}},"7dcf4":function(e,t,n){"use strict";var r=n("c5ae");e.exports=function(e){return r(e.length)}},"7dd09":function(e,t,n){"use strict";function r(e){return window.requestAnimationFrame(e)}function i(e){window.cancelAnimationFrame(e)}function o(){return"ontouchstart"in window}function s(){return"undefined"!==typeof window}let a;function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a||(a="object"===typeof Intl?new Intl.Collator(e,t).compare:"function"===typeof String.prototype.localeCompare?(e,t)=>(""+e).localeCompare(t):(e,t)=>e===t?0:e>t?-1:1,a)}n.r(t),n.d(t,"requestAnimationFrame",(function(){return r})),n.d(t,"cancelAnimationFrame",(function(){return i})),n.d(t,"isTouchSupported",(function(){return o})),n.d(t,"isCSR",(function(){return s})),n.d(t,"getComparisonFunction",(function(){return l}))},8033:function(e,t,n){},"80dd":function(e,t,n){"use strict";var r=n("f2e8"),i=n("de26"),o=n("69ba"),s=n("592a"),a=n("7b7f"),l=n("9c76"),c=r.Symbol,h=i("wks"),u=l?c["for"]||c:c&&c.withoutSetter||s;e.exports=function(e){return o(h,e)||(h[e]=a&&o(c,e)?c[e]:u("Symbol."+e)),h[e]}},"81b7":function(e,t,n){"use strict";var r=n("fd18"),i=n("b343"),o=n("939b"),s=Object,a=r("".split);e.exports=i((function(){return!s("z").propertyIsEnumerable(0)}))?function(e){return"String"===o(e)?a(e,""):s(e)}:s},"81ea":function(e,t,n){"use strict";n.r(t),n.d(t,"to2dArray",(function(){return r})),n.d(t,"extendArray",(function(){return i})),n.d(t,"pivot",(function(){return o})),n.d(t,"arrayReduce",(function(){return s})),n.d(t,"arrayFilter",(function(){return a})),n.d(t,"arrayMap",(function(){return l})),n.d(t,"arrayEach",(function(){return c})),n.d(t,"arraySum",(function(){return h})),n.d(t,"arrayMax",(function(){return u})),n.d(t,"arrayMin",(function(){return d})),n.d(t,"arrayAvg",(function(){return p})),n.d(t,"arrayFlatten",(function(){return f})),n.d(t,"arrayUnique",(function(){return g})),n.d(t,"getDifferenceOfArrays",(function(){return m})),n.d(t,"getIntersectionOfArrays",(function(){return y})),n.d(t,"getUnionOfArrays",(function(){return w})),n.d(t,"stringToArray",(function(){return b}));n("d06e");function r(e){const t=e.length;let n=0;while(ne+t,0)}function u(e){return s(e,(e,t)=>e>t?e:t,Array.isArray(e)?e[0]:void 0)}function d(e){return s(e,(e,t)=>ee.concat(Array.isArray(t)?f(t):t),[])}function g(e){const t=[];return c(e,e=>{-1===t.indexOf(e)&&t.push(e)}),t}function m(){for(var e=arguments.length,t=new Array(e),n=0;n{o=o.filter(t=>!e.includes(t))}),o}function y(){for(var e=arguments.length,t=new Array(e),n=0;n{o=o.filter(t=>e.includes(t))}),o}function w(){for(var e=arguments.length,t=new Array(e),n=0;n{c(e,e=>{o.has(e)||o.add(e)})}),Array.from(o)}function b(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";return e.split(t)}},"84d8":function(e,t,n){"use strict";var r=n("7b69"),i=n("8793"),o=n("4c54"),s=n("2471"),a=n("86d6"),l=n("80dd"),c=TypeError,h=l("toPrimitive");e.exports=function(e,t){if(!i(e)||o(e))return e;var n,l=s(e,h);if(l){if(void 0===t&&(t="default"),n=r(l,e,t),!i(n)||o(n))return n;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},"861dd":function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));n("7a89"),n("b879"),n("d06e");var r=n("a6de");function i(e,t,n){o(e,t),t.set(e,n)}function o(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function s(e,t,n){return t=a(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=l(e,"string");return"symbol"==typeof t?t:t+""}function l(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function c(e,t){return e.get(u(e,t))}function h(e,t,n){return e.set(u(e,t),n),n}function u(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var d=new WeakMap;class p{static get DEFAULT_WIDTH(){return 50}constructor(e){s(this,"count",0),s(this,"startColumn",null),s(this,"endColumn",null),s(this,"startPosition",null),s(this,"isVisibleInTrimmingContainer",!1),i(this,d,void 0),h(d,this,e),this.calculate()}calculate(){const{calculationType:e,overrideFn:t,scrollOffset:n,totalColumns:i,viewportWidth:o}=c(d,this),s=Math.max(c(d,this).scrollOffset,0),a=s>0?o+1:o;let l=0,h=!0;const u=[];let p,f=0,g=0;for(let c=0;c=s&&l+(e===r["a"]?p:0)<=s+a&&(null!==this.startColumn&&void 0!==this.startColumn||(this.startColumn=c,f=p),this.endColumn=c),u.push(l),l+=p,g=p,e!==r["a"]&&(this.endColumn=c),l>=s+o){h=!1;break}const m=n+o-a,y=e===r["a"]?0:g,w=e===r["a"]?f:0;if(m<-1*c(d,this).inlineStartOffset||n>u.at(-1)+y||-1*c(d,this).scrollOffset-c(d,this).viewportWidth>-1*w?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,this.endColumn===i-1&&h){this.startColumn=this.endColumn;while(this.startColumn>0){const t=u[this.endColumn]+p-u[this.startColumn-1];if((t<=o||e!==r["a"])&&(this.startColumn-=1),t>o)break}}e===r["c"]&&null!==this.startColumn&&t&&t(this),this.startPosition=u[this.startColumn],void 0===this.startPosition&&(this.startPosition=null),io[s]^n?1:-1;return l==c?0:c(r=e.length)){for(i=n,t-=r;--t;i+=n);e+=i}else tH?e.c=e.e=null:e.c=n=m.length){if(!r)break e;for(;m.length<=f;m.push(0));p=g=0,h=(a%=c)-c+(s=1)}else{for(p=d=m[f],s=1;10<=d;d/=10,s++);g=(h=(a%=c)-c+s)<0?0:p/y[s-h-1]%10|0}if(r=r||t<0||null!=m[f+1]||(h<0?p:p%y[s-h-1]),r=n<4?(g||r)&&(0==n||n==(e.s<0?3:2)):5H?e.c=e.e=null:e.e>>11))?(n=crypto.getRandomValues(new Uint32Array(2)),t[h]=n[0],t[h+1]=n[1]):(d.push(l%1e14),h+=2);h=a/2}else{if(!crypto.randomBytes)throw D=!1,Error(s+"crypto unavailable");for(t=crypto.randomBytes(a*=7);hn-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/n|0,s[i]%=n)}return s.reverse()}return function(r,i,o,s,a){var l,c,h,u,d,p,f,m,y=r.indexOf("."),w=_,b=L;for(0<=y&&(u=U,U=0,r=r.replace(".",""),p=(m=new W(i)).pow(r.length-y),U=u,m.c=t(v(g(p.c),p.e,"0"),10,o,e),m.e=m.c.length),h=u=(f=t(r,i,o,a?(l=B,e):(l=e,B))).length;0==f[--u];f.pop());if(!f[0])return l.charAt(0);if(y<0?--h:(p.c=f,p.e=h,p.s=s,f=(p=n(p,m,w,b,o)).c,d=p.r,h=p.e),y=f[c=h+w+1],u=o/2,d=d||c<0||null!=f[c+1],d=b<4?(null!=y||d)&&(0==b||b==(p.s<0?3:2)):uo;)f[c]=0,c||(++h,f=[1].concat(f));for(u=f.length;!f[--u];);for(y=0,r="";y<=u;r+=l.charAt(f[y++]));r=v(r,h,l.charAt(0))}return r}}(),n=function(){function e(e,t,n){var r,i,o,s,a=0,l=e.length,c=t%d,h=t/d|0;for(e=e.slice();l--;)a=((i=c*(o=e[l]%d)+(r=h*o+(s=e[l]/d|0)*c)%d*d+a)/n|0)+(r/d|0)+h*s,e[l]=i%n;return a&&(e=[a].concat(e)),e}function t(e,t,n,r){var i,o;if(n!=r)o=rt[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n](M[p]||0)&&d--,I<0)v.push(1),g=!0;else{for(T=M.length,N=x.length,I+=2,1<(m=o(h/(x[p=0]+1)))&&(x=e(x,m,h),M=e(M,m,h),N=x.length,T=M.length),R=N,C=(E=M.slice(0,N)).length;C=h/2&&O++;do{if(m=0,(u=t(x,E,N,C))<0){if(S=E[0],N!=C&&(S=S*h+(E[1]||0)),1<(m=o(S/O)))for(h<=m&&(m=h-1),w=(y=e(x,m,h)).length,C=E.length;1==t(y,E,w,C);)m--,n(y,Nl&&(p.c.length=l):r&&(p=p.mod(t))}if(a){if(0===(a=o(a/2)))break;d=a%2}else if(X(e=e.times(n),e.e+1,1),14l&&(f.c.length=l):r&&(f=f.mod(t))}return r?p:(u&&(p=x.div(p)),t?p.mod(t):l?X(p,U,L,void 0):p)},M.integerValue=function(e){var t=new W(this);return null==e?e=L:y(e,0,8),X(t,t.e+1,e)},M.isEqualTo=M.eq=function(e,t){return 0===m(this,new W(e,t))},M.isFinite=function(){return!!this.c},M.isGreaterThan=M.gt=function(e,t){return 0this.c.length-2},M.isLessThan=M.lt=function(e,t){return m(this,new W(e,t))<0},M.isLessThanOrEqualTo=M.lte=function(e,t){return-1===(t=m(this,new W(e,t)))||0===t},M.isNaN=function(){return!this.s},M.isNegative=function(){return this.s<0},M.isPositive=function(){return 0r&&(r=this.e+1),r},M.shiftedBy=function(e){return y(e,-h,h),this.times("1e"+e)},M.squareRoot=M.sqrt=function(){var e,t,r,i,o,s=this,a=s.c,l=s.s,c=s.e,h=_+4,u=new W("0.5");if(1!==l||!a||!a[0])return new W(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);if((r=0==(l=Math.sqrt(+K(s)))||l==1/0?(((t=g(a)).length+c)%2==0&&(t+="0"),l=Math.sqrt(+t),c=f((c+1)/2)-(c<0||c%2),new W(t=l==1/0?"1e"+c:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+c)):new W(l+"")).c[0])for((l=(c=r.e)+h)<3&&(l=0);;)if(o=r,r=u.times(o.plus(n(s,o,h,1))),g(o.c).slice(0,l)===(t=g(r.c)).slice(0,l)){if(r.e=Math.pow(10,12)&&!n||"trillion"===n?(l=r.trillion,t/=Math.pow(10,12)):c=Math.pow(10,9)&&!n||"billion"===n?(l=r.billion,t/=Math.pow(10,9)):c=Math.pow(10,6)&&!n||"million"===n?(l=r.million,t/=Math.pow(10,6)):(c=Math.pow(10,3)&&!n||"thousand"===n)&&(l=r.thousand,t/=Math.pow(10,3)),l&&(l=(o?" ":"")+l),a){var u=t.toString().split(".")[0];h=Math.max(a-u.length,0)}return{value:t,abbreviation:l,mantissaPrecision:h}}({value:u,forceAverage:T,abbreviations:s.currentAbbreviations(),spaceSeparated:x,totalLength:C});u=j.value,k+=j.abbreviation,C&&(N=j.mantissaPrecision)}if(P){var H=(f=(d={value:u,characteristicPrecision:S}).value,g=d.characteristicPrecision,m=void 0===g?0:g,y=r(f.toExponential().split("e"),2),w=y[0],b=y[1],v=+w,m&&10&&void 0!==arguments[0]?arguments[0]:null;i(this,"context",void 0),this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])}addEventListener(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];function i(e){n.call(this,c(e))}return this.context.eventListeners.push({element:e,event:t,callback:n,callbackProxy:i,options:r,eventManager:this}),e.addEventListener(t,i,r),a+=1,()=>{this.removeEventListener(e,t,n)}}removeEventListener(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=this.context.eventListeners.length;while(o)if(o-=1,r=this.context.eventListeners[o],r.event===t&&r.element===e){if(n&&n!==r.callback)continue;if(i&&r.eventManager!==this)continue;this.context.eventListeners.splice(o,1),r.element.removeEventListener(r.event,r.callbackProxy,r.options),a-=1}}clearEvents(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.context)return;let t=this.context.eventListeners.length;while(t){t-=1;const n=this.context.eventListeners[t];e&&n.eventManager!==this||(this.context.eventListeners.splice(t,1),n.element.removeEventListener(n.event,n.callbackProxy,n.options),a-=1)}}clear(){this.clearEvents()}destroy(){this.clearEvents(),this.context=null}destroyWithOwnEventsOnly(){this.clearEvents(!0),this.context=null}fireEvent(e,t){let n=e.document,r=e;n||(n=e.ownerDocument?e.ownerDocument:e,r=n.defaultView);const i={bubbles:!0,cancelable:"mousemove"!==t,view:r,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:void 0};let o;n.createEvent?(o=n.createEvent("MouseEvents"),o.initMouseEvent(t,i.bubbles,i.cancelable,i.view,i.detail,i.screenX,i.screenY,i.clientX,i.clientY,i.ctrlKey,i.altKey,i.shiftKey,i.metaKey,i.button,i.relatedTarget||n.body.parentNode)):o=n.createEventObject(),e.dispatchEvent?e.dispatchEvent(o):e.fireEvent("on"+t,o)}}function c(e){const t=e.stopImmediatePropagation;return e.stopImmediatePropagation=function(){t.apply(this),Object(r["stopImmediatePropagation"])(this)},e}function h(){return a}t["a"]=l},8828:function(e,t,n){"use strict";n.d(t,"K",(function(){return r})),n.d(t,"M",(function(){return i})),n.d(t,"x",(function(){return o})),n.d(t,"l",(function(){return s})),n.d(t,"D",(function(){return a})),n.d(t,"C",(function(){return l})),n.d(t,"g",(function(){return c})),n.d(t,"A",(function(){return h})),n.d(t,"s",(function(){return u})),n.d(t,"t",(function(){return d})),n.d(t,"h",(function(){return p})),n.d(t,"q",(function(){return f})),n.d(t,"v",(function(){return g})),n.d(t,"c",(function(){return m})),n.d(t,"F",(function(){return y})),n.d(t,"G",(function(){return w})),n.d(t,"L",(function(){return b})),n.d(t,"p",(function(){return v})),n.d(t,"n",(function(){return E})),n.d(t,"j",(function(){return C})),n.d(t,"u",(function(){return S})),n.d(t,"m",(function(){return R})),n.d(t,"B",(function(){return T})),n.d(t,"e",(function(){return O})),n.d(t,"E",(function(){return N})),n.d(t,"f",(function(){return A})),n.d(t,"k",(function(){return I})),n.d(t,"J",(function(){return M})),n.d(t,"y",(function(){return x})),n.d(t,"o",(function(){return _})),n.d(t,"d",(function(){return L})),n.d(t,"H",(function(){return P})),n.d(t,"b",(function(){return k})),n.d(t,"i",(function(){return j})),n.d(t,"a",(function(){return H})),n.d(t,"r",(function(){return D})),n.d(t,"z",(function(){return F})),n.d(t,"I",(function(){return U})),n.d(t,"w",(function(){return V}));const r=e=>["tabindex",e],i=()=>["role","treegrid"],o=()=>["role","presentation"],s=()=>["role","gridcell"],a=()=>["role","rowheader"],l=()=>["role","rowgroup"],c=()=>["role","columnheader"],h=()=>["role","row"],u=()=>["role","menu"],d=()=>["role","menuitem"],p=()=>["role","combobox"],f=()=>["role","listbox"],g=()=>["role","option"],m=()=>["role","checkbox"],y=()=>["scope","col"],w=()=>["scope","row"],b=()=>["type","text"],v=e=>["aria-label",e],E=()=>["aria-hidden","true"],C=()=>["aria-disabled","true"],S=()=>["aria-multiselectable","true"],R=e=>["aria-haspopup",e],T=e=>["aria-rowcount",e],O=e=>["aria-colcount",e],N=e=>["aria-rowindex",e],A=e=>["aria-colindex",e],I=e=>["aria-expanded",e],M=e=>["aria-sort",e],x=()=>["aria-readonly","true"],_=()=>["aria-invalid","true"],L=e=>["aria-checked",e],P=()=>["aria-selected","true"],k=()=>["aria-autocomplete","list"],j=e=>["aria-controls",e],H=e=>["aria-activedescendant",e],D=e=>["aria-live",e],F=e=>["aria-relevant",e],U=e=>["aria-setsize",e],V=e=>["aria-posinset",e]},"890f":function(e,t,n){var r,i,o;(function(n,s){i=[],r=s,o="function"===typeof r?r.apply(t,i):r,void 0===o||(e.exports=o)})("undefined"!==typeof self&&self,(function(){function e(){}e.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},e.prototype.restoreState=function(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx},e.prototype.pattern=function(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");var t=this.disjunction();this.consumeChar("/");var n={type:"Flags",global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};while(this.isRegExpFlag())switch(this.popChar()){case"g":a(n,"global");break;case"i":a(n,"ignoreCase");break;case"m":a(n,"multiLine");break;case"u":a(n,"unicode");break;case"y":a(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t}},e.prototype.disjunction=function(){var e=[];e.push(this.alternative());while("|"===this.peekChar())this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e}},e.prototype.alternative=function(){var e=[];while(this.isTerm())e.push(this.term());return{type:"Alternative",value:e}},e.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},e.prototype.assertion=function(){switch(this.popChar()){case"^":return{type:"StartAnchor"};case"$":return{type:"EndAnchor"};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary"};case"B":return{type:"NonWordBoundary"}}throw Error("Invalid Assertion Escape");case"(":var e;switch(this.consumeChar("?"),this.popChar()){case"=":e="Lookahead";break;case"!":e="NegativeLookahead";break}l(e);var t=this.disjunction();return this.consumeChar(")"),{type:e,value:t}}c()},e.prototype.quantifier=function(e){var t;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":var n=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:n,atMost:n};break;case",":var r;this.isDigit()?(r=this.integerIncludingZero(),t={atLeast:n,atMost:r}):t={atLeast:n,atMost:1/0},this.consumeChar("}");break}if(!0===e&&void 0===t)return;l(t);break}if(!0!==e||void 0!==t)return l(t),"?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t},e.prototype.atom=function(){var e;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}return void 0===e&&this.isPatternCharacter()&&(e=this.patternCharacter()),l(e),this.isQuantifier()&&(e.quantifier=this.quantifier()),e},e.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[o("\n"),o("\r"),o("\u2028"),o("\u2029")]}},e.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},e.prototype.decimalEscapeAtom=function(){var e=this.positiveInteger();return{type:"GroupBackReference",value:e}},e.prototype.characterClassEscape=function(){var e,t=!1;switch(this.popChar()){case"d":e=h;break;case"D":e=h,t=!0;break;case"s":e=d;break;case"S":e=d,t=!0;break;case"w":e=u;break;case"W":e=u,t=!0;break}return l(e),{type:"Set",value:e,complement:t}},e.prototype.controlEscapeAtom=function(){var e;switch(this.popChar()){case"f":e=o("\f");break;case"n":e=o("\n");break;case"r":e=o("\r");break;case"t":e=o("\t");break;case"v":e=o("\v");break}return l(e),{type:"Character",value:e}},e.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error("Invalid ");var t=e.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:t}},e.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:o("\0")}},e.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},e.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},e.prototype.identityEscapeAtom=function(){var e=this.popChar();return{type:"Character",value:o(e)}},e.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var e=this.popChar();return{type:"Character",value:o(e)}}},e.prototype.characterClass=function(){var e=[],t=!1;this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),t=!0);while(this.isClassAtom()){var n=this.classAtom(),r="Character"===n.type;if(r&&this.isRangeDash()){this.consumeChar("-");var i=this.classAtom(),a="Character"===i.type;if(a){if(i.value=this.input.length)throw Error("Unexpected end of input");this.idx++};var t,n=/[0-9a-fA-F]/,r=/[0-9]/,i=/[1-9]/;function o(e){return e.charCodeAt(0)}function s(e,t){void 0!==e.length?e.forEach((function(e){t.push(e)})):t.push(e)}function a(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t]=!0}function l(e){if(void 0===e)throw Error("Internal Error - Should never get here!")}function c(){throw Error("Internal Error - Should never get here!")}var h=[];for(t=o("0");t<=o("9");t++)h.push(t);var u=[o("_")].concat(h);for(t=o("a");t<=o("z");t++)u.push(t);for(t=o("A");t<=o("Z");t++)u.push(t);var d=[o(" "),o("\f"),o("\n"),o("\r"),o("\t"),o("\v"),o("\t"),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o(" "),o("\u2028"),o("\u2029"),o(" "),o(" "),o(" "),o("\ufeff")];function p(){}return p.prototype.visitChildren=function(e){for(var t in e){var n=e[t];e.hasOwnProperty(t)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach((function(e){this.visit(e)}),this))}},p.prototype.visit=function(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)},p.prototype.visitPattern=function(e){},p.prototype.visitFlags=function(e){},p.prototype.visitDisjunction=function(e){},p.prototype.visitAlternative=function(e){},p.prototype.visitStartAnchor=function(e){},p.prototype.visitEndAnchor=function(e){},p.prototype.visitWordBoundary=function(e){},p.prototype.visitNonWordBoundary=function(e){},p.prototype.visitLookahead=function(e){},p.prototype.visitNegativeLookahead=function(e){},p.prototype.visitCharacter=function(e){},p.prototype.visitSet=function(e){},p.prototype.visitGroup=function(e){},p.prototype.visitGroupBackReference=function(e){},p.prototype.visitQuantifier=function(e){},{RegExpParser:e,BaseRegExpVisitor:p,VERSION:"0.4.0"}}))},"8c7e":function(e,t,n){"use strict";n.d(t,"a",(function(){return BN}));n("7a89"),n("d06e");var r=n("03529"),i=n("5d7f"),o=n("de3b"),s=n("351d"),a=n("c5c4");const l="handsontableEditor",c="handsontable";class h extends r["a"]{static get EDITOR_TYPE(){return c}open(){super.open(),this.htEditor&&this.htEditor.destroy(),"none"===this.htContainer.style.display&&(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(),Object(i["setCaretPosition"])(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,t,n,r,i,o){super.prepare(e,t,n,r,i,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(e,t){const n=this.getSourceData(t.row,t.col);void 0!==n&&a.setValue(n),a.hot.destroyEditor()},preventWheel:!0,layoutDirection:this.hot.isRtl()?"rtl":"ltr"};this.cellProperties.handsontable&&Object(s["extend"])(l,o.handsontable),this.htOptions=l}beginEditing(e,t){const n=this.hot.getSettings().onBeginEditing;n&&!1===n()||super.beginEditing(e,t)}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,t,n){if(this.htEditor&&this.htEditor.isListening()&&this.hot.listen(),this.htEditor&&this.htEditor.getSelectedLast()){const e=this.htEditor.getValue();void 0!==e&&this.setValue(e)}super.finishEditing(e,t,n)}assignHooks(){this.hot.addHook("afterDestroy",()=>{this.htEditor&&this.htEditor.destroy()})}registerShortcuts(){const e=this.hot.getShortcutManager(),t=e.getContext("editor");super.registerShortcuts();const n={group:l,relativeToGroup:a["a"],position:"before"},r=(e,t)=>{const n=this.htEditor;if(void 0!==e&&(e<0||n.flipped&&e>n.countRows()-1?n.deselectCell():n.selectCell(e,0),n.getData().length))return t.preventDefault(),Object(o["stopImmediatePropagation"])(t),this.hot.listen(),this.TEXTAREA.focus(),!1};t.addShortcuts([{keys:[["ArrowUp"]],callback:e=>{const t=this.htEditor;let n,i;return!t.getSelectedLast()&&t.flipped?n=t.countRows()-1:t.getSelectedLast()&&(t.flipped?(i=t.getSelectedLast()[0],n=Math.max(0,i-1)):(i=t.getSelectedLast()[0],n=i-1)),r(n,e)},preventDefault:!1},{keys:[["ArrowDown"]],callback:e=>{const t=this.htEditor;let n,i;if(t.getSelectedLast()||t.flipped){if(t.getSelectedLast())if(t.flipped)n=t.getSelectedLast()[0]+1;else if(!t.flipped){const e=t.countRows()-1;i=t.getSelectedLast()[0],n=Math.min(e,i+1)}}else n=0;return r(n,e)},preventDefault:!1}],n)}unregisterShortcuts(){super.unregisterShortcuts();const e=this.hot.getShortcutManager(),t=e.getContext("editor");t.removeShortcutsByGroup(l)}}var u=n("81ea"),d=n("7b9c"),p=n("29b0"),f=n("f938"),g=n("63d8"),m=n("dd49"),y=n("8828");function w(e,t,n){b(e,t),t.set(e,n)}function b(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function v(e,t,n){return t=E(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e){var t=C(e,"string");return"symbol"==typeof t?t:t+""}function C(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function S(e,t){return e.get(R(e,t))}function R(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const T="autocomplete";var O=new WeakMap;class N extends h{constructor(){super(...arguments),v(this,"query",null),v(this,"strippedChoices",[]),v(this,"rawChoices",[]),w(this,O,this.hot.guid.slice(0,9)),v(this,"sortByRelevance",(function(e,t,n){const r=[],i=[],o=e.length;let s,a,l,c,h=t.length;if(0===o){for(l=0;l{if(-1===t.index)return-1;if(-1===e.index)return 1;if(e.indext.charsLeft)return 1}return 0}),l=0,h=r.length;l{const t=this.stripValueIfNeeded(e);return t===this.TEXTAREA.value});return Object(d["isDefined"])(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),Object(i["addClass"])(this.htContainer,"autocompleteEditor"),Object(i["addClass"])(this.htContainer,-1===this.hot.rootWindow.navigator.platform.indexOf("Mac")?"":"htMacScroll"),this.hot.getSettings().ariaTags&&Object(i["setAttribute"])(this.TEXTAREA,[Object(y["L"])(),Object(y["h"])(),Object(y["m"])("listbox"),Object(y["b"])()])}prepare(e,t,n,r,o,s){super.prepare(e,t,n,r,o,s),this.hot.getSettings().ariaTags&&Object(i["setAttribute"])(this.TEXTAREA,[Object(y["k"])("false"),Object(y["i"])(`${S(O,this)}-listbox-${e}-${t}`)])}open(){super.open();const e=void 0===this.cellProperties.trimDropdown||this.cellProperties.trimDropdown,t=this.hot.getSettings().ariaTags,n=Array.isArray(this.cellProperties.source)?this.cellProperties.source:null,r=null===n||void 0===n?void 0:n.length,{row:o,col:s}=this;this.showEditableElement(),this.focus();let a=Object(i["getScrollbarWidth"])();0===a&&Object(g["isMacOS"])()&&(a+=15),this.addHook("beforeKeyDown",e=>this.onBeforeKeyDown(e)),this.htEditor.updateSettings({colWidths:e?[Object(i["outerWidth"])(this.TEXTAREA)-2]:void 0,width:e?Object(i["outerWidth"])(this.TEXTAREA)+a:void 0,autoColumnSize:!0,renderer:(e,o,s,a,l,c,h)=>{Object(m["a"])(e,o,s,a,l,c,h);const{filteringCaseSensitive:u,allowHtml:p,locale:f}=this.cellProperties,g=this.query;let w,b,v=Object(d["stringify"])(c);v&&!p&&(w=!0===u?v.indexOf(g):v.toLocaleLowerCase(f).indexOf(g.toLocaleLowerCase(f)),-1!==w&&(b=v.substr(w,g.length),v=v.replace(b,`${b}`))),t&&Object(i["setAttribute"])(o,[Object(y["v"])(),...n?[Object(y["I"])(r)]:[],...n?[Object(y["w"])(n.indexOf(c)+1)]:[],["id",`${this.htEditor.rootElement.id}_${s}-${a}`]]),o.innerHTML=v},afterSelectionEnd:(e,n)=>{if(t){const t=this.htEditor.getCell(e,n,!0);Object(i["setAttribute"])(t,[Object(y["H"])()]),Object(i["setAttribute"])(this.TEXTAREA,...Object(y["a"])(t.id))}}}),t&&(Object(i["setAttribute"])(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...Object(y["x"])()),Object(i["setAttribute"])(this.htEditor.rootElement,[Object(y["q"])(),Object(y["r"])("polite"),Object(y["z"])("text"),["id",`${S(O,this)}-listbox-${o}-${s}`]]),Object(i["setAttribute"])(this.TEXTAREA,...Object(y["k"])("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&Object(i["setAttribute"])(this.TEXTAREA,[Object(y["k"])("false")])}discardEditor(e){super.discardEditor(e),this.hot.view.render()}queryChoices(e){const t=this.cellProperties.source;this.query=e,"function"===typeof t?t.call(this.cellProperties,e,e=>{this.rawChoices=e,this.updateChoicesList(this.stripValuesIfNeeded(e))}):Array.isArray(t)?(this.rawChoices=t,this.updateChoicesList(this.stripValuesIfNeeded(t))):this.updateChoicesList([])}updateChoicesList(e){const t=Object(i["getCaretPosition"])(this.TEXTAREA),n=Object(i["getSelectionEndPosition"])(this.TEXTAREA),r=this.cellProperties.sortByRelevance,o=this.cellProperties.filter;let s=null,a=null,l=e;r&&(s=this.sortByRelevance(this.stripValueIfNeeded(this.getValue()),l,this.cellProperties.filteringCaseSensitive));const c=Array.isArray(s)?s.length:0;if(!1===o)c&&(a=s[0]);else{const e=[];for(let t=0,n=l.length;tu&&h>u;return d?this.flipDropdown(s):this.unflipDropdown(),this.limitDropdownIfNeeded(d?h:u,s),d}limitDropdownIfNeeded(e,t){if(t>e){let n=0,r=0,i=0,o=null;do{i=this.htEditor.getRowHeight(r)||this.htEditor.view._wt.getSetting("defaultRowHeight"),n+=i,r+=1}while(n=t?t*e:this.strippedChoices.length*e+8}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:t}=this.cellProperties,n=Object(u["arrayMap"])(e,e=>Object(d["stringify"])(e)),r=Object(u["arrayMap"])(n,e=>t?e:Object(p["stripTags"])(e));return r}allowKeyEventPropagation(e){const t=this.htEditor.getSelectedRangeLast(),n={row:t?t.from.row:-1};let r=!1;return e===f["KEY_CODES"].ARROW_DOWN&&n.row>0&&n.row-1&&(r=!0),r}onBeforeKeyDown(e){if(Object(f["isPrintableChar"])(e.keyCode)||e.keyCode===f["KEY_CODES"].BACKSPACE||e.keyCode===f["KEY_CODES"].DELETE||e.keyCode===f["KEY_CODES"].INSERT){let t=10;if(e.keyCode===f["KEY_CODES"].C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(t+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},t)}}}var A=n("13e1");const I="checkbox";class M extends A["a"]{static get EDITOR_TYPE(){return I}beginEditing(e,t){if(t&&"mouseup"===t.type&&"TD"===t.target.nodeName){const e=this.TD.querySelector('input[type="checkbox"]');Object(i["hasClass"])(e,"htBadValue")||e.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}var x=n("c1df"); /*! * Pikaday * * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday */const _=()=>window,L=()=>window.document,P=(e,t)=>window.setTimeout(e,t),k=function(e,t,n,r){e.addEventListener(t,n,!!r)},j=function(e,t,n,r){e.removeEventListener(t,n,!!r)},H=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},D=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},F=function(e,t){D(e,t)||(e.className=""===e.className?t:e.className+" "+t)},U=function(e,t){e.className=H((" "+e.className+" ").replace(" "+t+" "," "))},V=function(e){return/Array/.test(Object.prototype.toString.call(e))},B=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},W=function(e){let t=e.getDay();return 0===t||6===t},G=function(e){return e%4===0&&e%100!==0||e%400===0},z=function(e,t){return[31,G(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},Y=function(e){B(e)&&e.setHours(0,0,0,0)},X=function(e,t){return e.getTime()===t.getTime()},K=function(e,t,n){let r,i;for(r in t)i=void 0!==e[r],i&&"object"===typeof t[r]&&null!==t[r]&&void 0===t[r].nodeName?B(t[r])?n&&(e[r]=new Date(t[r].getTime())):V(t[r])?n&&(e[r]=t[r].slice(0)):e[r]=K({},t[r],n):!n&&i||(e[r]=t[r]);return e},$=function(e,t,n){let r=L().createEvent("HTMLEvents");r.initEvent(t,!0,!1),r=K(r,n),e.dispatchEvent(r)},q=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},Q={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},Z=function(e,t,n){t+=e.firstDay;while(t>=7)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},J=function(e){let t=[],n="false";if(e.isEmpty){if(!e.showDaysInNextAndPreviousMonths)return'';t.push("is-outside-current-month"),e.enableSelectionDaysInNextAndPreviousMonths||t.push("is-selection-disabled")}return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&(t.push("is-selected"),n="true"),e.hasEvent&&t.push("has-event"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'"},ee=function(e,t){e.setHours(0,0,0,0);let n=e.getDate(),r=e.getDay(),i=t,o=i-1,s=7,a=function(e){return(e+s-1)%s};e.setDate(n+o-a(r));let l=new Date(e.getFullYear(),0,i),c=864e5,h=(e.getTime()-l.getTime())/c,u=1+Math.round((h-o+a(l.getDay()))/s);return u},te=function(e,t,n,r,i){let o=new Date(r,n,t),s=e.hasMoment?e.moment(o).isoWeek():ee(o,i);return''+s+""},ne=function(e,t,n,r){return''+(t?e.reverse():e).join("")+""},re=function(e){return""+e.join("")+""},ie=function(e){let t,n=[];for(e.showWeekNumber&&n.push(""),t=0;t<7;t++)n.push(''+Z(e,t,!0)+"");return""+(e.isRTL?n.reverse():n).join("")+""},oe=function(e,t,n,r,i,o){let s,a,l,c,h,u=e._o,d=n===u.minYear,p=n===u.maxYear,f='
',g=!0,m=!0;for(l=[],s=0;s<12;s++)l.push('");for(c='
'+u.i18n.months[r]+'
",V(u.yearRange)?(s=u.yearRange[0],a=u.yearRange[1]+1):(s=n-u.yearRange,a=1+n+u.yearRange),l=[];s=u.minYear&&l.push('");return h='
'+n+u.yearSuffix+'
",u.showMonthAfterYear?f+=h+c:f+=c+h,d&&(0===r||u.minMonth>=r)&&(g=!1),p&&(11===r||u.maxMonth<=r)&&(m=!1),0===t&&(f+='"),t===e._o.numberOfMonths-1&&(f+='"),f+"
"},se=function(e,t,n){return''+ie(e)+re(t)+"
"};function ae(e){let t=this,n=t.config(e);t._onMouseDown=function(e){if(!t._v)return;e=e||_().event;let r=e.target||e.srcElement;if(r)if(D(r,"is-disabled")||(!D(r,"pika-button")||D(r,"is-empty")||D(r.parentNode,"is-disabled")?D(r,"pika-prev")?t.prevMonth():D(r,"pika-next")&&t.nextMonth():(t.setDate(new Date(r.getAttribute("data-pika-year"),r.getAttribute("data-pika-month"),r.getAttribute("data-pika-day"))),n.bound&&P((function(){t.hide(),n.blurFieldOnSelect&&n.field&&n.field.blur()}),100))),D(r,"pika-select"))t._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}},t._onChange=function(e){e=e||_().event;let n=e.target||e.srcElement;n&&(D(n,"pika-select-month")?t.gotoMonth(n.value):D(n,"pika-select-year")&&t.gotoYear(n.value))},t._onKeyChange=function(e){if(e=e||_().event,t.isVisible())switch(e.keyCode){case 13:case 27:n.field&&n.field.blur();break;case 37:t.adjustDate("subtract",1);break;case 38:t.adjustDate("subtract",7);break;case 39:t.adjustDate("add",1);break;case 40:t.adjustDate("add",7);break;case 8:case 46:t.setDate(null);break}},t._parseFieldValue=function(){if(n.parse)return n.parse(n.field.value,n.format);if(this.hasMoment){let e=this.moment(n.field.value,n.format,n.formatStrict);return e&&e.isValid()?e.toDate():null}return new Date(Date.parse(n.field.value))},t._onInputChange=function(e){let n;e.firedBy!==t&&(n=t._parseFieldValue(),B(n)&&t.setDate(n),t._v||t.show())},t._onInputFocus=function(){t.show()},t._onInputClick=function(){t.show()},t._onInputBlur=function(){let e=L().activeElement;do{if(D(e,"pika-single"))return}while(e=e.parentNode);t._c||(t._b=P((function(){t.hide()}),50)),t._c=!1},t._onClick=function(e){e=e||_().event;let r=e.target||e.srcElement,i=r;if(r){!hasEventListeners&&D(r,"pika-select")&&(r.onchange||(r.setAttribute("onchange","return;"),k(r,"change",t._onChange)));do{if(D(i,"pika-single")||i===n.trigger)return}while(i=i.parentNode);t._v&&r!==n.trigger&&i!==n.trigger&&t.hide()}},t.el=L().createElement("div"),t.el.className="pika-single"+(n.isRTL?" is-rtl":"")+(n.theme?" "+n.theme:""),k(t.el,"mousedown",t._onMouseDown,!0),k(t.el,"touchend",t._onMouseDown,!0),k(t.el,"change",t._onChange),n.keyboardInput&&k(L(),"keydown",t._onKeyChange),n.field&&(n.container?n.container.appendChild(t.el):n.bound?L().body.appendChild(t.el):n.field.parentNode.insertBefore(t.el,n.field.nextSibling),k(n.field,"change",t._onInputChange),n.defaultDate||(n.defaultDate=t._parseFieldValue(),n.setDefaultDate=!0));let r=n.defaultDate;B(r)?n.setDefaultDate?t.setDate(r,!0):t.gotoDate(r):t.gotoDate(new Date),n.bound?(this.hide(),t.el.className+=" is-bound",k(n.trigger,"click",t._onInputClick),k(n.trigger,"focus",t._onInputFocus),k(n.trigger,"blur",t._onInputBlur)):this.show()}function le(e,t,n){return t=ce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ce(e){var t=he(e,"string");return"symbol"==typeof t?t:t+""}function he(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}ae.prototype={config:function(e){this._o||(this._o=K({},Q,!0));let t=K(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"===typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"===typeof t.disableDayFn?t.disableDayFn:null;let n=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=n>4?4:n,B(t.minDate)||(t.minDate=!1),B(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate100&&(t.yearRange=100);return t},toString:function(e){return e=e||this._o.format,B(this._d)?this._o.toString?this._o.toString(this._d,e):this.hasMoment?this.moment(this._d).format(e):this._d.toDateString():""},getMoment:function(){return this.hasMoment?this.moment(this._d):null},setMoment:function(e,t){this.hasMoment&&this.moment.isMoment(e)&&this.setDate(e.toDate(),t)},useMoment:function(e){this.hasMoment=!0,this.moment=e},getDate:function(){return B(this._d)?new Date(this._d.getTime()):null},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",$(this._o.field,"change",{firedBy:this})),this.draw();if("string"===typeof e&&(e=new Date(Date.parse(e))),!B(e))return;let n=this._o.minDate,r=this._o.maxDate;B(n)&&er&&(e=r),this._d=new Date(e.getTime()),Y(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),$(this._o.field,"change",{firedBy:this})),t||"function"!==typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())},clear:function(){this.setDate(null)},gotoDate:function(e){let t=!0;if(B(e)){if(this.calendars){let n=new Date(this.calendars[0].year,this.calendars[0].month,1),r=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),i=e.getTime();r.setMonth(r.getMonth()+1),r.setDate(r.getDate()-1),t=i=i&&(this._y=i,!isNaN(s)&&this._m>s&&(this._m=s));for(let l=0;l";this.el.innerHTML=a,n.bound&&"hidden"!==n.field.type&&P((function(){n.trigger.focus()}),1),"function"===typeof this._o.onDraw&&this._o.onDraw(this),n.bound&&n.field.setAttribute("aria-label",n.ariaLabel)},adjustPosition:function(){let e,t,n,r,i,o,s,a,l,c,h;this._o.container||(this.el.style.position="absolute",e=this._o.trigger,t=this.el.offsetWidth,n=this.el.offsetHeight,r=_().innerWidth||L().documentElement.clientWidth,i=_().innerHeight||L().documentElement.clientHeight,o=L().body.scrollTop||L().documentElement.scrollTop,c=!0,h=!0,l=e.getBoundingClientRect(),s=l.left+_().pageXOffset,a=l.bottom+_().pageYOffset,(this._o.reposition&&s+t>r||this._o.position.indexOf("right")>-1&&s-t+e.offsetWidth>0)&&(s=s-t+e.offsetWidth,c=!1),(this._o.reposition&&a+n>i+o||this._o.position.indexOf("top")>-1&&a-n-e.offsetHeight>0)&&(a=a-n-e.offsetHeight,h=!1),s<0&&(s=0),a<0&&(a=0),this.el.style.left=s+"px",this.el.style.top=a+"px",F(this.el,c?"left-aligned":"right-aligned"),F(this.el,h?"bottom-aligned":"top-aligned"),U(this.el,c?"right-aligned":"left-aligned"),U(this.el,h?"top-aligned":"bottom-aligned"))},render:function(e,t,n){let r=this._o,i=new Date,o=z(e,t),s=new Date(e,t,1).getDay(),a=[],l=[];Y(i),r.firstDay>0&&(s-=r.firstDay,s<0&&(s+=7));let c=0===t?11:t-1,h=11===t?0:t+1,u=0===t?e-1:e,d=11===t?e+1:e,p=z(u,c),f=o+s,g=f;while(g>7)g-=7;f+=7-g;let m=!1;for(let y=0,w=0;y=o+s,E=y-s+1,C=t,S=e,R=r.startRange&&X(r.startRange,n),T=r.endRange&&X(r.endRange,n),O=r.startRange&&r.endRange&&r.startRanger.maxDate||r.disableWeekends&&W(n)||r.disableDayFn&&r.disableDayFn(n);v&&(y{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"),Object(i["addClass"])(this.datePicker,"htDatepickerHolder"),this.hot.rootDocument.body.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",e=>{Object(i["hasClass"])(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,t,n,r,i,o){super.prepare(e,t,n,r,i,o)}open(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=this.hot.getShortcutManager(),n=t.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:de})}close(){var e;this._opened=!1,null!==(e=this.$datePicker)&&void 0!==e&&e.destroy&&this.$datePicker.destroy(),this.hot._registerTimeout(()=>{this.hot._refreshBorders()});const t=this.hot.getShortcutManager(),n=t.getContext("editor");n.removeShortcutsByGroup(de),super.close()}finishEditing(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super.finishEditing(e,t)}showDatepicker(e){const t=this.cellProperties.dateFormat||this.defaultDateFormat,n=this.hot.view.isMouseDown(),r=!!e&&Object(f["isFunctionKey"])(e.keyCode);let i;this.datePicker.style.display="block",this.$datePicker=new ae(this.getDatePickerConfig()),"function"===typeof this.$datePicker.useMoment&&this.$datePicker.useMoment(x),this.$datePicker._onInputFocus=function(){},this.originalValue?(i=this.originalValue,x(i,t,!0).isValid()&&this.$datePicker.setMoment(x(i,t),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),r||n||this.setValue("")):this.cellProperties.defaultDate?(i=this.cellProperties.defaultDate,x(i,t,!0).isValid()&&this.$datePicker.setMoment(x(i,t),!0),r||n||this.setValue("")):this.$datePicker.gotoToday()}hideDatepicker(){this.datePickerStyle.display="none",this.$datePicker.hide()}getDatePickerConfig(){const e=this.TEXTAREA,t={};this.cellProperties&&this.cellProperties.datePickerConfig&&Object(s["deepExtend"])(t,this.cellProperties.datePickerConfig);const n=t.onSelect,r=t.onClose;return t.field=e,t.trigger=e,t.container=this.datePicker,t.bound=!1,t.keyboardInput=!1,t.format=t.format||this.defaultDateFormat,t.reposition=t.reposition||!1,t.isRTL=!1,t.onSelect=e=>{let t=e;isNaN(t.getTime())||(t=x(t).format(this.cellProperties.dateFormat||this.defaultDateFormat)),this.setValue(t),n&&n()},t.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),r&&r()},t}refreshDimensions(e){var t;if(super.refreshDimensions(e),this.state!==A["b"].EDITING)return;if(this.TD=this.getEditedCell(),!this.TD)return void this.hideDatepicker();const{rowIndexMapper:n,columnIndexMapper:r}=this.hot,{wtOverlays:o}=this.hot.view._wt,{wtTable:s}=null!==(t=o.getParentOverlay(this.TD))&&void 0!==t?t:this.hot.view._wt,a=n.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleRow()),l=n.getVisualFromRenderableIndex(s.getLastPartiallyVisibleRow()),c=r.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleColumn()),h=r.getVisualFromRenderableIndex(s.getLastPartiallyVisibleColumn());if(this.row>=a&&this.row<=l&&this.col>=c&&this.col<=h){const e=this.TD.getBoundingClientRect();this.datePickerStyle.top=this.hot.rootWindow.pageYOffset+e.top+Object(i["outerHeight"])(this.TD)+"px";let t=this.hot.rootWindow.pageXOffset;this.hot.isRtl()?t+=e.right-Object(i["outerWidth"])(this.datePicker):t+=e.left,this.datePickerStyle.left=t+"px"}else this.hideDatepicker()}}var fe=n("1004");const ge="dropdown";class me extends N{static get EDITOR_TYPE(){return ge}prepare(e,t,n,r,i,o){super.prepare(e,t,n,r,i,o),this.cellProperties.filter=!1,this.cellProperties.strict=!0}}fe["a"].getSingleton().add("beforeValidate",(function(e,t,n){const r=this.getCellMeta(t,this.propToCol(n));r.editor===me&&void 0===r.strict&&(r.filter=!1,r.strict=!0)}));const ye="numeric";class we extends r["a"]{static get EDITOR_TYPE(){return ye}}const be="password";class ve extends r["a"]{static get EDITOR_TYPE(){return be}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&&Object(i["setAttribute"])(this.TEXTAREA,[Object(y["n"])()]),Object(i["empty"])(this.TEXTAREA_PARENT),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}const Ee="ht_editor_visible",Ce="selectEditor",Se="select";class Re extends A["a"]{static get EDITOR_TYPE(){return Se}init(){this.select=this.hot.rootDocument.createElement("select"),this.select.setAttribute("data-hot-input","true"),this.select.style.display="none",Object(i["addClass"])(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="";const e=this.hot.getShortcutManager();e.setActiveContextName("editor"),this.registerShortcuts()}close(){this._opened=!1,this.select.style.display="none",Object(i["hasClass"])(this.select,Ee)&&Object(i["removeClass"])(this.select,Ee),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,t,n,r,o,a){super.prepare(e,t,n,r,o,a);const l=this.cellProperties.selectOptions;let c;c="function"===typeof l?this.prepareOptions(l(this.row,this.col,this.prop)):this.prepareOptions(l),Object(i["empty"])(this.select),Object(s["objectEach"])(c,(e,t)=>{const n=this.hot.rootDocument.createElement("OPTION");n.value=t,Object(i["fastInnerHTML"])(n,e),this.select.appendChild(n)})}prepareOptions(e){let t={};if(Array.isArray(e))for(let n=0,r=e.length;n{}}],r),!0===this.isInFullEditMode()&&t.addShortcuts([{keys:[["ArrowUp"]],callback:()=>{const e=this.select.selectedIndex-1;e>=0&&(this.select[e].selected=!0)}},{keys:[["ArrowDown"]],callback:()=>{const e=this.select.selectedIndex+1;e<=this.select.length-1&&(this.select[e].selected=!0)}}],r)}unregisterShortcuts(){const e=this.hot.getShortcutManager(),t=e.getContext("editor");t.removeShortcutsByGroup(Ce)}}const Te="time";class Oe extends r["a"]{static get EDITOR_TYPE(){return Te}prepare(e,t,n,r,i,o){super.prepare(e,t,n,r,i,o),this.TEXTAREA.dir="ltr"}}var Ne=n("491c");function Ae(){Object(Ne["e"])(A["a"]),Object(Ne["e"])(N),Object(Ne["e"])(M),Object(Ne["e"])(pe),Object(Ne["e"])(me),Object(Ne["e"])(h),Object(Ne["e"])(we),Object(Ne["e"])(ve),Object(Ne["e"])(Re),Object(Ne["e"])(r["a"]),Object(Ne["e"])(Oe)}var Ie=n("a357c");const Me="html";function xe(e,t,n,r,o,s,a){Ie["a"].apply(this,[e,t,n,r,o,s,a]),Object(i["fastInnerHTML"])(t,null===s||void 0===s?"":s,!1)}xe.RENDERER_TYPE=Me;var _e=n("87d6");const Le="autocomplete";function Pe(e,t,n,r,o,s,a){const{rootDocument:l}=e,c=a.allowHtml?xe:m["a"],h=l.createElement("DIV"),u=e.getSettings().ariaTags;if(h.className="htAutocompleteArrow",u&&h.setAttribute(...Object(y["n"])()),h.appendChild(l.createTextNode(String.fromCharCode(9660))),c.apply(this,[e,t,n,r,o,s,a]),t.firstChild||t.appendChild(l.createTextNode(String.fromCharCode(160))),t.insertBefore(h,t.firstChild),Object(i["addClass"])(t,"htAutocomplete"),!e.acArrowListener){const o=new _e["a"](e);e.acArrowListener=function(o){Object(i["hasClass"])(o.target,"htAutocompleteArrow")&&e.view._wt.getSetting("onCellDblClick",null,e._createCellCoords(n,r),t)},o.addEventListener(e.rootElement,"mousedown",e.acArrowListener),e.addHookOnce("afterDestroy",()=>{o.destroy()})}}Pe.RENDERER_TYPE=Le;const ke="dropdown";function je(e,t,n,r,i,o,s){Pe.apply(this,[e,t,n,r,i,o,s])}je.RENDERER_TYPE=ke;var He=n("c4fa"),De=n("0283");const Fe=new WeakMap,Ue=new WeakMap,Ve="htBadValue",Be="data-row",We="data-col",Ge="checkboxRenderer",ze="checkbox";function Ye(e,t,n,r,o,s,a){const{rootDocument:l}=e,c=e.getSettings().ariaTags;Ie["a"].apply(this,[e,t,n,r,o,s,a]),Xe(e);let h=Ke(l);const u=a.label;let p=!1;if("undefined"===typeof a.checkedTemplate&&(a.checkedTemplate=!0),"undefined"===typeof a.uncheckedTemplate&&(a.uncheckedTemplate=!1),Object(i["empty"])(t),s===a.checkedTemplate||Object(d["stringify"])(s).toLocaleLowerCase(a.locale)===Object(d["stringify"])(a.checkedTemplate).toLocaleLowerCase(a.locale)?h.checked=!0:s===a.uncheckedTemplate||Object(d["stringify"])(s).toLocaleLowerCase(a.locale)===Object(d["stringify"])(a.uncheckedTemplate).toLocaleLowerCase(a.locale)?h.checked=!1:Object(d["isEmpty"])(s)?Object(i["addClass"])(h,"noValue"):(h.style.display="none",Object(i["addClass"])(h,Ve),p=!0),Object(i["setAttribute"])(h,[[Be,n],[We,r]]),c&&Object(i["setAttribute"])(h,[Object(y["p"])(h.checked?e.getTranslatedPhrase(De["CHECKBOX_CHECKED"]):e.getTranslatedPhrase(De["CHECKBOX_UNCHECKED"])),Object(y["d"])(h.checked),Object(y["c"])()]),!p&&u){let i="";if(u.value)i="function"===typeof u.value?u.value.call(this,n,r,o,s):u.value;else if(u.property){const t=e.getDataAtRowProp(n,u.property);i=null!==t?t:""}const a=$e(l,i,!0!==u.separated);"before"===u.position?u.separated?(t.appendChild(a),t.appendChild(h)):(a.appendChild(h),h=a):u.position&&"after"!==u.position||(u.separated?(t.appendChild(h),t.appendChild(a)):(a.insertBefore(h,a.firstChild),h=a))}function f(){const t=e.getShortcutManager(),n=t.getContext("grid"),r={group:Ge,relativeToGroup:He["a"],position:"before"};n.addShortcuts([{keys:[["space"]],callback:()=>(g(),!m())},{keys:[["enter"]],callback:()=>(g(),!m()),runOnlyIf:()=>{var t;return e.getSettings().enterBeginsEditing&&(null===(t=e.getSelectedRangeLast())||void 0===t?void 0:t.isSingle())}},{keys:[["delete"],["backspace"]],callback:()=>(g(!0),!m())}],r)}function g(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const n=e.getSelectedRange(),r=[];let i=[],o=0;if(n){for(let s=0;s{let[,,t]=e;return t===i[0][2]})?i.map(e=>{let[t,n,r]=e;return[t,n,r]}):i.map(e=>{let[t,n,,r]=e;return[t,n,r.checkedTemplate]}),i.length>0&&r.forEach(t=>{const n=i.splice(0,t);e.setDataAtCell(n)})}}function m(){const t=e.getSelectedRange();if(t){for(let n=0;n0&&!r.readOnly)return!0}}}return!1}}(!u||u&&!u.separated)&&t.appendChild(h),p&&t.appendChild(l.createTextNode("#bad-value#")),Fe.has(e)||(Fe.set(e,!0),f())}function Xe(e){let t=Ue.get(e);if(!t){const{rootElement:n}=e;t=new _e["a"](e),t.addEventListener(n,"click",t=>Qe(t,e)),t.addEventListener(n,"mouseup",t=>qe(t,e)),t.addEventListener(n,"change",t=>Ze(t,e)),Ue.set(e,t)}return t}function Ke(e){const t=e.createElement("input");return t.className="htCheckboxRendererInput",t.type="checkbox",t.setAttribute("tabindex","-1"),t.cloneNode(!1)}function $e(e,t,n){const r=e.createElement("label");return r.className="htCheckboxRendererLabel "+(n?"fullWidth":""),r.appendChild(e.createTextNode(t)),r.cloneNode(!0)}function qe(e,t){const{target:n}=e;Je(n)&&n.hasAttribute(Be)&&n.hasAttribute(We)&&setTimeout(t.listen,10)}function Qe(e,t){const{target:n}=e;if(!Je(n))return;if(!n.hasAttribute(Be)||!n.hasAttribute(We))return;const r=parseInt(n.getAttribute(Be),10),i=parseInt(n.getAttribute(We),10),o=t.getCellMeta(r,i);o.readOnly&&e.preventDefault()}function Ze(e,t){const{target:n}=e;if(!Je(n))return;if(!n.hasAttribute(Be)||!n.hasAttribute(We))return;const r=parseInt(n.getAttribute(Be),10),i=parseInt(n.getAttribute(We),10),o=t.getCellMeta(r,i);if(!o.readOnly){let n=null;n=e.target.checked?void 0===o.uncheckedTemplate||o.checkedTemplate:void 0!==o.uncheckedTemplate&&o.uncheckedTemplate,t.setDataAtCell(r,i,n)}}function Je(e){return"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}fe["a"].getSingleton().add("modifyAutoColumnSizeSeed",(function(e,t,n){const{label:r,type:i,row:o,column:s,prop:a}=t;if(i===ze){if(r){const{value:t,property:i}=r;let l=n;if(t)l="function"===typeof t?t(o,s,a,n):t;else if(i){const e=this.getDataAtRowProp(o,i);l=null!==e?e:n}e=l}return e}})),Ye.RENDERER_TYPE=ze;const et="handsontable";function tt(e,t,n,r,i,o,s){Pe.apply(this,[e,t,n,r,i,o,s])}tt.RENDERER_TYPE=et;var nt=n("8722d"),rt=n("ffec");const it="numeric";function ot(e,t){if(Object(rt["isNumeric"])(e)){const n=t.numericFormat,r=n&&n.culture||"-",i=n&&n.pattern;if("undefined"!==typeof r&&!nt.languages()[r]){const e=r.replace("-",""),t=nt.allLanguages?nt.allLanguages[r]:nt[e];t&&nt.registerLanguage(t)}nt.setLanguage(r),e=nt(e).format(i||"0")}return e}function st(e,t,n,r,i,o,s){let a=o;if(Object(rt["isNumeric"])(a)){const e=s.className||"",n=e.length?e.split(" "):[];a=ot(a,s),n.indexOf("htLeft")<0&&n.indexOf("htCenter")<0&&n.indexOf("htRight")<0&&n.indexOf("htJustify")<0&&n.push("htRight"),n.indexOf("htNumeric")<0&&n.push("htNumeric"),s.className=n.join(" "),t.dir="ltr"}Object(m["a"])(e,t,n,r,i,a,s)}st.RENDERER_TYPE=it;const at="password";function lt(e,t,n,r,o,s,a){m["a"].apply(this,[e,t,n,r,o,s,a]);const l=a.hashLength||t.innerHTML.length,c=a.hashSymbol||"*";let h="";Object(rt["rangeEach"])(l-1,()=>{h+=c}),Object(i["fastInnerHTML"])(t,h)}lt.RENDERER_TYPE=at;const ct="select";function ht(e,t,n,r,i,o,s){m["a"].apply(this,[e,t,n,r,i,o,s])}ht.RENDERER_TYPE=ct;const ut="time";function dt(e,t,n,r,i,o,s){m["a"].apply(this,[e,t,n,r,i,o,s]),t.dir="ltr"}dt.RENDERER_TYPE=ut;var pt=n("3d76");function ft(){Object(pt["d"])(Pe),Object(pt["d"])(Ie["a"]),Object(pt["d"])(Ye),Object(pt["d"])(je),Object(pt["d"])(tt),Object(pt["d"])(xe),Object(pt["d"])(st),Object(pt["d"])(lt),Object(pt["d"])(ht),Object(pt["d"])(m["a"]),Object(pt["d"])(dt)}const gt="autocomplete";function mt(e,t){let n=e;null!==n&&void 0!==n||(n=""),this.allowEmpty&&""===n?t(!0):this.strict&&this.source?"function"===typeof this.source?this.source(n,yt(n,t)):yt(n,t)(this.source):t(!0)}function yt(e,t){const n=e;return function(e){let r=!1;for(let t=0,i=e.length;t-1;let o;return o=n.isValid()&&n.format("x")===r.format("x")||!r.isValid()||i?n:r,o.format(t)}vt.VALIDATOR_TYPE=bt;const Ct="dropdown";function St(e,t){mt.apply(this,[e,t])}St.VALIDATOR_TYPE=Ct;const Rt="numeric";function Tt(e,t){let n=e;null!==n&&void 0!==n||(n=""),this.allowEmpty&&""===n?t(!0):t(""!==n&&Object(rt["isNumeric"])(e))}Tt.VALIDATOR_TYPE=Rt;const Ot=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],Nt="time";function At(e,t){const n=this.timeFormat||"h:mm:ss a";let r=!0,i=e;null===i&&(i=""),i=/^\d{3,}$/.test(i)?parseInt(i,10):i;const o=/^\d{1,2}$/.test(i);o&&(i+=":00");const s=x(i,Ot,!0).isValid()?x(i):x(i,n);let a=s.isValid(),l=x(i,n,!0).isValid()&&!o;if(this.allowEmpty&&""===i&&(a=!0,l=!0),a||(r=!1),!a&&l&&(r=!0),a&&!l)if(!0===this.correctFormat){const e=s.format(n),t=this.instance.toVisualRow(this.row),i=this.instance.toVisualColumn(this.col);this.instance.setDataAtCell(t,i,e,"timeValidator"),r=!0}else r=!1;t(r)}At.VALIDATOR_TYPE=Nt;var It=n("169f");function Mt(){Object(It["d"])(mt),Object(It["d"])(St),Object(It["d"])(vt),Object(It["d"])(Tt),Object(It["d"])(At)}const xt="autocomplete",_t={CELL_TYPE:xt,editor:N,renderer:Pe,validator:mt},Lt="checkbox",Pt={CELL_TYPE:Lt,editor:M,renderer:Ye},kt="date";function jt(e,t,n,r,i,o,s){Pe.apply(this,[e,t,n,r,i,o,s])}jt.RENDERER_TYPE=kt;const Ht="date",Dt={CELL_TYPE:Ht,editor:pe,renderer:jt,validator:vt},Ft="dropdown",Ut={CELL_TYPE:Ft,editor:me,renderer:je,validator:St},Vt="handsontable",Bt={CELL_TYPE:Vt,editor:h,renderer:tt},Wt="numeric",Gt={CELL_TYPE:Wt,editor:we,renderer:st,validator:Tt,dataType:"number"},zt="password",Yt={CELL_TYPE:zt,editor:ve,renderer:lt,copyable:!1},Xt="select",Kt={CELL_TYPE:Xt,editor:Re,renderer:ht};var $t=n("ef07");const qt="time",Qt={CELL_TYPE:qt,editor:Oe,renderer:dt,validator:At};var Zt=n("76ab");function Jt(){Object(Zt["d"])(_t),Object(Zt["d"])(Pt),Object(Zt["d"])(Dt),Object(Zt["d"])(Ut),Object(Zt["d"])(Bt),Object(Zt["d"])(Gt),Object(Zt["d"])(Yt),Object(Zt["d"])(Kt),Object(Zt["d"])($t["a"]),Object(Zt["d"])(Qt)}var en=n("d3c5"),tn=n("7dd09"),nn=n("220a");function rn(e,t,n){return t=on(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function on(e){var t=sn(e,"string");return"symbol"==typeof t?t:t+""}function sn(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class an{static get SAMPLE_COUNT(){return 3}constructor(e){rn(this,"samples",null),rn(this,"dataFactory",null),rn(this,"customSampleCount",null),rn(this,"allowDuplicates",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:an.SAMPLE_COUNT}setSampleCount(e){this.customSampleCount=e}setAllowDuplicates(e){this.allowDuplicates=e}generateRowSamples(e,t){return this.generateSamples("row",t,e)}generateColumnSamples(e,t){return this.generateSamples("col",t,e)}generateSamples(e,t,n){const r=new Map,{from:i,to:o}="number"===typeof n?{from:n,to:n}:n;return Object(rt["rangeEach"])(i,o,n=>{const i=this.generateSample(e,t,n);r.set(n,i)}),r}generateSample(e,t,n){if("row"!==e&&"col"!==e)throw new Error("Unsupported sample type");const r=new Map,i="row"===e?"col":"row",o=[];return Object(rt["rangeEach"])(t.from,t.to,t=>{const a="row"===e?this.dataFactory(n,t):this.dataFactory(t,n);if(!1===a)return;const{value:l,bundleSeed:c}=a,h="string"===typeof c&&c.length>0;let u;u=h?c:Object(s["isObject"])(l)?""+Object.keys(l).length:Array.isArray(l)?""+l.length:""+Object(d["stringify"])(l).length,r.has(u)||r.set(u,{needed:this.getSampleCount(),strings:[]});const p=r.get(u);if(p.needed){const e=o.indexOf(l)>-1;(!e||this.allowDuplicates||h)&&(p.strings.push({value:l,[i]:t}),o.push(l),p.needed-=1)}}),r}}var ln=an,cn=n("861dd"),hn=n("9f10");function un(e,t){pn(e,t),t.add(e)}function dn(e,t,n){pn(e,t),t.set(e,n)}function pn(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fn(e,t,n){return t=gn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gn(e){var t=mn(e,"string");return"symbol"==typeof t?t:t+""}function mn(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function yn(e,t,n){return e.set(bn(e,t),n),n}function wn(e,t){return e.get(bn(e,t))}function bn(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}fe["a"].getSingleton().register("modifyAutoColumnSizeSeed");const vn="autoColumnSize",En=10,Cn="autoColumnSize";var Sn=new WeakMap,Rn=new WeakSet;class Tn extends en["a"]{static get PLUGIN_KEY(){return vn}static get PLUGIN_PRIORITY(){return En}static get SETTING_KEYS(){return!0}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 50}constructor(e){super(e),un(this,Rn),fn(this,"ghostTable",new nn["a"](this.hot)),fn(this,"samplesGenerator",new ln((e,t)=>{const n=this.hot.toPhysicalRow(e),r=this.hot.toPhysicalColumn(t);if(this.hot.rowIndexMapper.isHidden(n)||this.hot.columnIndexMapper.isHidden(r))return!1;const i=this.hot.getCellMeta(e,t);let o="";i.spanned||(o=this.hot.getDataAtCell(e,t));let s="";return this.hot.hasHook("modifyAutoColumnSizeSeed")&&(s=this.hot.runHooks("modifyAutoColumnSizeSeed",s,i,o)),{value:o,bundleSeed:s}})),fn(this,"firstCalculation",!0),fn(this,"inProgress",!1),fn(this,"measuredColumns",0),fn(this,"columnWidthsMap",new hn["a"]),dn(this,Sn,[]),this.hot.columnIndexMapper.registerMap(Cn,this.columnWidthsMap),this.addHook("beforeColumnResize",(e,t,n)=>bn(Rn,this,In).call(this,e,t,n))}isEnabled(){return!1!==this.hot.getSettings()[vn]&&!this.hot.getSettings().colWidths}enablePlugin(){var e=this;if(this.enabled)return;const t=this.hot.getSettings()[vn];t&&null!==t.useHeaders&&void 0!==t.useHeaders&&this.ghostTable.setSetting("useHeaders",t.useHeaders),this.setSamplingOptions(),this.addHook("afterLoadData",(function(){for(var t=arguments.length,n=new Array(t),r=0;rbn(Rn,this,An).call(this,e)),this.addHook("afterFormulasValuesUpdate",e=>bn(Rn,this,xn).call(this,e)),this.addHook("beforeViewRender",e=>bn(Rn,this,On).call(this,e)),this.addHook("modifyColWidth",(e,t)=>this.getColumnWidth(t,e)),this.addHook("afterInit",()=>bn(Rn,this,Mn).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,t,n)=>bn(Rn,this,In).call(this,e,t,n))}calculateVisibleColumnsWidth(){const e=this.hot.countRows();if(!e)return;const t=this.hot.renderCall,n=this.getFirstVisibleColumn(),r=this.getLastVisibleColumn();-1!==n&&-1!==r&&this.calculateColumnsWidth({from:n,to:r},void 0,t)}calculateColumnsWidth(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countRows()-1},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r="number"===typeof e?{from:e,to:e}:e,i="number"===typeof t?{from:t,to:t}:t;Object(rt["rangeEach"])(r.from,r.to,e=>{let t=this.hot.toPhysicalColumn(e);if(null===t&&(t=e),n||null===this.columnWidthsMap.getValueAtIndex(t)&&!this.hot._getColWidthFromSettings(t)){const t=this.samplesGenerator.generateColumnSamples(e,i);Object(u["arrayEach"])(t,e=>{let[t,n]=e;return this.ghostTable.addColumn(t,n)})}}),this.ghostTable.columns.length&&(this.hot.batchExecution(()=>{this.ghostTable.getWidths((e,t)=>{const n=this.hot.toPhysicalColumn(e);this.columnWidthsMap.setValueAtIndex(n,t)})},!0),this.measuredColumns=r.to+1,this.ghostTable.clean())}calculateAllColumnsWidth(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=0;const n=this.hot.countCols()-1;let r=null;this.inProgress=!0;const i=()=>{if(!this.hot)return Object(tn["cancelAnimationFrame"])(r),void(this.inProgress=!1);this.calculateColumnsWidth({from:t,to:Math.min(t+Tn.CALCULATION_STEP,n)},e),t=t+Tn.CALCULATION_STEP+1,t=0&&(this.calculateColumnsWidth({from:0,to:o},e),this.firstCalculation=!1,t=o+1),t>=0),Math.min(t,n)}getColumnWidth(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t;return void 0===r&&(r=this.columnWidthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e)),n&&"number"===typeof r&&(r=Math.max(r,cn["a"].DEFAULT_WIDTH))),r}getFirstVisibleColumn(){const e=this.hot.view._wt;if(e.wtViewport.columnsVisibleCalculator){const t=e.wtTable.getFirstVisibleColumn();if(-1!==t)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(t)}if(e.wtViewport.columnsRenderCalculator){const t=e.wtTable.getFirstRenderedColumn();if(-1!==t)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(t)}return-1}getLastVisibleColumn(){const e=this.hot.view._wt;if(e.wtViewport.columnsVisibleCalculator){const t=e.wtTable.getLastVisibleColumn();if(-1!==t)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(t)}if(e.wtViewport.columnsRenderCalculator){const t=e.wtTable.getLastRenderedColumn();if(-1!==t)return this.hot.columnIndexMapper.getVisualFromRenderableIndex(t)}return-1}findColumnsWhereHeaderWasChanged(){const e=this.hot.getColHeader(),t=Object(u["arrayReduce"])(e,(e,t,n)=>{const r=wn(Sn,this).length;return(r-10&&void 0!==arguments[0]?arguments[0]:[];e.length?this.hot.batchExecution(()=>{Object(u["arrayEach"])(e,e=>{this.columnWidthsMap.setValueAtIndex(e,null)})},!0):this.columnWidthsMap.clear()}isNeedRecalculate(){return!!Object(u["arrayFilter"])(this.columnWidthsMap.getValues().slice(0,this.measuredColumns),e=>null===e).length}destroy(){this.ghostTable.clean(),super.destroy()}}function On(){this.calculateVisibleColumnsWidth(),this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllColumnsWidth()}function Nn(){this.hot.view?this.recalculateAllColumnsWidth():setTimeout(()=>{this.hot&&this.recalculateAllColumnsWidth()},0)}function An(e){const t=Object(u["arrayMap"])(e,e=>{let[,t]=e;return this.hot.toPhysicalColumn(this.hot.propToCol(t))});this.clearCache(Array.from(new Set(t)))}function In(e,t,n){let r=e;return n&&(this.calculateColumnsWidth(t,void 0,!0),r=this.getColumnWidth(t,void 0,!1)),r}function Mn(){yn(Sn,this,this.hot.getColHeader())}function xn(e){const t=Object(u["arrayFilter"])(e,e=>{var t;return Object(d["isDefined"])(null===(t=e.address)||void 0===t?void 0:t.col)}),n=Object(u["arrayMap"])(t,e=>e.address.col);this.clearCache(Array.from(new Set(n)))}const _n={horizontal:"horizontal",vertical:"vertical"};function Ln(e,t,n){let r,i,o;return t[0]===e[0]&&t[1]e[3]?(o="right",r=n(t[0],e[3]+1),i=n(t[2],t[3])):t[0]e[2]&&t[1]===e[1]&&(o="down",r=n(e[2]+1,t[1]),i=n(t[2],t[3])),r&&r.normalize(),i&&i.normalize(),{directionOfDrag:o,startOfDragCoords:r,endOfDragCoords:i}}function Pn(e){const t={};return!0===e?(t.directions=Object.keys(_n),t.autoInsertRow=!0):Object(s["isObject"])(e)?(Object(d["isDefined"])(e.autoInsertRow)?e.direction===_n.horizontal?t.autoInsertRow=!1:t.autoInsertRow=e.autoInsertRow:t.autoInsertRow=!1,Object(d["isDefined"])(e.direction)?t.directions=[e.direction]:t.directions=Object.keys(_n)):"string"===typeof e?(t.directions=[e],t.autoInsertRow=!0):(t.directions=[],t.autoInsertRow=!1),t}function kn(e,t){jn(e,t),t.add(e)}function jn(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Hn(e,t,n){return t=Dn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dn(e){var t=Fn(e,"string");return"symbol"==typeof t?t:t+""}function Fn(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function Un(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}fe["a"].getSingleton().register("modifyAutofillRange"),fe["a"].getSingleton().register("beforeAutofill"),fe["a"].getSingleton().register("afterAutofill");const Vn="autofill",Bn=20,Wn=["fillHandle"],Gn="insert_row_below",zn=200;var Yn=new WeakSet;class Xn extends en["a"]{constructor(){super(...arguments),kn(this,Yn),Hn(this,"addingStarted",!1),Hn(this,"mouseDownOnCellCorner",!1),Hn(this,"mouseDragOutside",!1),Hn(this,"handleDraggedCells",0),Hn(this,"directions",[]),Hn(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return Vn}static get PLUGIN_PRIORITY(){return Bn}static get SETTING_KEYS(){return[Vn,...Wn]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",e=>Un(Yn,this,$n).call(this,e)),this.addHook("afterOnCellCornerDblClick",e=>Un(Yn,this,Kn).call(this,e)),this.addHook("beforeOnCellMouseOver",(e,t)=>Un(Yn,this,qn).call(this,t)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.clearMappedSettings(),super.disablePlugin()}getSelectionData(){const e=this.hot.getSelectedRangeLast(),{row:t,col:n}=e.getTopStartCorner(),{row:r,col:i}=e.getBottomEndCorner(),o=this.hot.runHooks("modifyCopyableRange",[{startRow:t,startCol:n,endRow:r,endCol:i}]),s=[],a=[],l=[];return Object(u["arrayEach"])(o,e=>{for(let t=e.startRow;t<=e.endRow;t+=1)-1===s.indexOf(t)&&s.push(t);for(let t=e.startCol;t<=e.endCol;t+=1)-1===a.indexOf(t)&&a.push(t)}),Object(u["arrayEach"])(s,e=>{const t=[];Object(u["arrayEach"])(a,n=>{t.push(this.hot.getCopyableData(e,n))}),l.push(t)}),l}fillIn(){if(this.hot.selection.highlight.getFill().isEmpty())return!1;const[e,t,n,r]=this.hot.selection.highlight.getFill().getVisualCorners(),i=this.hot.getSelectedRangeLast(),o=i.getTopStartCorner(),s=i.getBottomEndCorner();this.resetSelectionOfDraggedArea();const a=[o.row,o.col,s.row,s.col],l=this.hot.runHooks("modifyAutofillRange",[Math.min(o.row,e),Math.min(o.col,t),Math.max(s.row,n),Math.max(s.col,r)],a),{directionOfDrag:c,startOfDragCoords:h,endOfDragCoords:u}=Ln(a,l,(e,t)=>this.hot._createCellCoords(e,t));if(h&&h.row>-1&&h.col>-1){const e=this.getSelectionData(),t=i.clone(),n=this.hot._createCellRange(h,h,u),r=this.hot.runHooks("beforeAutofill",e,t,n,c);if(!1===r)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let o=r;const s=r;if(["up","left"].indexOf(c)>-1&&(1!==s.length||0!==s[0].length))if(o=[],"up"===c){const e=u.row-h.row+1,t=e%s.length;for(let n=0;n=e.col)&&(r=this.hot._createCellCoords(n.row,e.col)),(n.rowe.row)&&(r=this.hot._createCellCoords(e.row,n.col))}else if(this.directions.includes(_n.vertical))r=this.hot._createCellCoords(e.row,n.col);else{if(!this.directions.includes(_n.horizontal))return;r=this.hot._createCellCoords(n.row,e.col)}return this.reduceSelectionAreaIfNeeded(r)}showBorder(e){const t=this.getCoordsOfDragAndDropBorders(e);t&&this.redrawBorders(t)}addRow(){this.hot._registerTimeout(()=>{this.hot.alter(Gn,void 0,1,this.pluginName+".fill"),this.addingStarted=!1},zn)}addNewRowIfNeeded(){if(!this.hot.selection.highlight.getFill().isEmpty()&&!1===this.addingStarted&&this.autoInsertRow){const e=this.hot.getSelectedLast(),t=this.hot.selection.highlight.getFill().getVisualCorners(),n=this.hot.countRows();e[2]Math.max(e,0)),!1,!1)}selectAdjacent(){const e=this.hot.getSelectedLast(),t=this.getIndexOfLastAdjacentFilledInRow(e);return-1!==t&&void 0!==t&&(this.addSelectionFromStartAreaToSpecificRowIndex(e,t),!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:t}=this.hot.rootDocument,n=Object(i["offset"])(this.hot.table).top-(this.hot.rootWindow.pageYOffset||t.scrollTop)+Object(i["outerHeight"])(this.hot.table),r=Object(i["offset"])(this.hot.table).left-(this.hot.rootWindow.pageXOffset||t.scrollLeft)+Object(i["outerWidth"])(this.hot.table);return e.clientY>n&&e.clientX<=r}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",()=>Un(Yn,this,Qn).call(this)),this.eventManager.addEventListener(e,"mousemove",e=>Un(Yn,this,Zn).call(this,e))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){const e=Pn(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}}function Kn(){const e=this.selectAdjacent();e&&this.fillIn()}function $n(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function qn(e){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(e),this.addNewRowIfNeeded())}function Qn(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function Zn(e){const t=this.getIfMouseWasDraggedOutside(e);!1===this.addingStarted&&this.handleDraggedCells>0&&t?(this.mouseDragOutside=!0,this.addingStarted=!0):this.mouseDragOutside=!1,this.mouseDragOutside&&this.autoInsertRow&&this.addRow()}function Jn(e,t){er(e,t),t.add(e)}function er(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tr(e,t,n){return t=nr(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nr(e){var t=rr(e,"string");return"symbol"==typeof t?t:t+""}function rr(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function ir(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const or="autoRowSize",sr=40,ar="autoRowSize";var lr=new WeakSet;class cr extends en["a"]{static get PLUGIN_KEY(){return or}static get PLUGIN_PRIORITY(){return sr}static get SETTING_KEYS(){return!0}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 500}constructor(e){super(e),Jn(this,lr),tr(this,"headerHeight",null),tr(this,"ghostTable",new nn["a"](this.hot)),tr(this,"samplesGenerator",new ln((e,t)=>{const n=this.hot.toPhysicalRow(e),r=this.hot.toPhysicalColumn(t);if(this.hot.rowIndexMapper.isHidden(n)||this.hot.columnIndexMapper.isHidden(r))return!1;if(e>=0&&t>=0){const n=this.hot.getCellMeta(e,t);if(n.hidden)return!1}let i;return e>=0?i=this.hot.getDataAtCell(e,t):-1===e&&(i=this.hot.getColHeader(t)),{value:i}})),tr(this,"firstCalculation",!0),tr(this,"inProgress",!1),tr(this,"measuredRows",0),tr(this,"rowHeightsMap",new hn["a"]),this.hot.rowIndexMapper.registerMap(ar,this.rowHeightsMap),this.addHook("beforeRowResize",(e,t,n)=>ir(lr,this,ur).call(this,e,t,n))}isEnabled(){const e=this.hot.getSettings()[or];return!0===e||Object(s["isObject"])(e)}enablePlugin(){var e=this;this.enabled||(this.setSamplingOptions(),this.addHook("afterLoadData",(function(){for(var t=arguments.length,n=new Array(t),r=0;rir(lr,this,pr).call(this,e)),this.addHook("beforeColumnResize",()=>this.recalculateAllRowsHeight()),this.addHook("beforeViewRender",e=>ir(lr,this,hr).call(this,e)),this.addHook("modifyRowHeight",(e,t)=>this.getRowHeight(t,e)),this.addHook("modifyColumnHeaderHeight",()=>this.getColumnHeaderHeight()),super.enablePlugin())}disablePlugin(){this.headerHeight=null,super.disablePlugin(),this.addHook("beforeRowResize",(e,t,n)=>ir(lr,this,ur).call(this,e,t,n))}calculateRowsHeight(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countRows()-1},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{from:0,to:this.hot.countCols()-1},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r="number"===typeof e?{from:e,to:e}:e,i="number"===typeof t?{from:t,to:t}:t;if(null!==this.hot.getColHeader(0)){const e=this.samplesGenerator.generateRowSamples(-1,i);this.ghostTable.addColumnHeadersRow(e.get(-1))}Object(rt["rangeEach"])(r.from,r.to,e=>{if(n||null===this.rowHeightsMap.getValueAtIndex(e)){const t=this.samplesGenerator.generateRowSamples(e,i);Object(u["arrayEach"])(t,e=>{let[t,n]=e;return this.ghostTable.addRow(t,n)})}}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((e,t)=>{e<0?this.headerHeight=t:this.rowHeightsMap.setValueAtIndex(this.hot.toPhysicalRow(e),t)})},!0),this.measuredRows=r.to+1,this.ghostTable.clean())}calculateAllRowsHeight(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{from:0,to:this.hot.countCols()-1},t=0;const n=this.hot.countRows()-1;let r=null;this.inProgress=!0;const i=()=>{if(!this.hot)return Object(tn["cancelAnimationFrame"])(r),void(this.inProgress=!1);this.calculateRowsHeight({from:t,to:Math.min(t+cr.CALCULATION_STEP,n)},e),t=t+cr.CALCULATION_STEP+1,t=0&&(this.calculateRowsHeight({from:0,to:o},e),this.firstCalculation=!1,t=o+1),t>=0),Math.min(t,n)}getRowHeight(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;const n=e<0?this.headerHeight:this.rowHeightsMap.getValueAtIndex(this.hot.toPhysicalRow(e));let r=t;return null!==n&&n>(t||0)&&(r=n),r}getColumnHeaderHeight(){return this.headerHeight}getFirstVisibleRow(){const e=this.hot.view._wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getFirstVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getFirstRenderedRow():-1}getLastVisibleRow(){const e=this.hot.view._wt;return e.wtViewport.rowsVisibleCalculator?e.wtTable.getLastVisibleRow():e.wtViewport.rowsRenderCalculator?e.wtTable.getLastRenderedRow():-1}clearCache(){this.headerHeight=null,this.rowHeightsMap.init()}clearCacheByRange(e){const{from:t,to:n}="number"===typeof e?{from:e,to:e}:e;this.hot.batchExecution(()=>{Object(rt["rangeEach"])(Math.min(t,n),Math.max(t,n),e=>{this.rowHeightsMap.setValueAtIndex(e,null)})},!0)}isNeedRecalculate(){return!!Object(u["arrayFilter"])(this.rowHeightsMap.getValues().slice(0,this.measuredRows),e=>null===e).length}destroy(){this.ghostTable.clean(),super.destroy()}}function hr(){const e=this.hot.renderCall,t=this.hot.getSettings().fixedRowsBottom,n=this.getFirstVisibleRow(),r=this.getLastVisibleRow();if(-1!==n&&-1!==r){if(this.calculateRowsHeight({from:n,to:r},void 0,e),t){const e=this.hot.countRows()-1;this.calculateRowsHeight({from:e-t,to:e})}this.isNeedRecalculate()&&!this.inProgress&&this.calculateAllRowsHeight()}}function ur(e,t,n){let r=e;return n&&(this.calculateRowsHeight(t,void 0,!0),r=this.getRowHeight(t)),r}function dr(){this.hot.view?this.recalculateAllRowsHeight():this.hot._registerTimeout(()=>{this.hot&&this.recalculateAllRowsHeight()})}function pr(e){let t=null;1===e.length?t=e[0][0]:e.length>1&&(t={from:e[0][0],to:e[e.length-1][0]}),null!==t&&this.clearCacheByRange(t)}var fr=n("bdd7"),gr=n("1096"),mr=n("a73f");const{getListWithInsertedItems:yr,getListWithRemovedItems:wr}=Object(fr["a"])("physicallyIndexed");class br extends gr["a"]{constructor(){super(e=>e)}insert(e,t){const n=Object(mr["b"])(this.indexedValues,t);this.indexedValues=yr(n,e,t,this.initValueOrFn),super.insert(e,t)}remove(e){const t=wr(this.indexedValues,e);this.indexedValues=Object(mr["a"])(t,e),super.remove(e)}}var vr=br;const{getListWithInsertedItems:Er,getListWithRemovedItems:Cr}=Object(fr["a"])("physicallyIndexed");class Sr extends gr["a"]{constructor(){super(e=>e)}insert(e,t){this.indexedValues=Er(this.indexedValues,e,t,(e,t)=>this.getNextValue(t)),super.insert(e,t)}remove(e){this.indexedValues=Cr(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}var Rr=Sr;function Tr(e,t){Or(e,t),t.add(e)}function Or(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Nr(e,t,n){return t=Ar(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ar(e){var t=Ir(e,"string");return"symbol"==typeof t?t:t+""}function Ir(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function Mr(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const xr="bindRowsWithHeaders",_r=210,Lr="loose",Pr=new Map([["loose",vr],["strict",Rr]]);var kr=new WeakSet;class jr extends en["a"]{constructor(){super(...arguments),Tr(this,kr),Nr(this,"headerIndexes",null)}static get PLUGIN_KEY(){return xr}static get PLUGIN_PRIORITY(){return _r}isEnabled(){return!!this.hot.getSettings()[xr]}enablePlugin(){if(this.enabled)return;let e=this.hot.getSettings()[xr];"string"!==typeof e&&(e=Lr);const t=Pr.get(e);this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new t),this.addHook("modifyRowHeader",e=>Mr(kr,this,Hr).call(this,e)),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function Hr(e){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(e))}var Dr=n("bd5e");function Fr(e,t){Vr(e,t),t.add(e)}function Ur(e,t,n){Vr(e,t),t.set(e,n)}function Vr(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Br(e,t,n){return t=Wr(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wr(e){var t=Gr(e,"string");return"symbol"==typeof t?t:t+""}function Gr(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function zr(e,t){return e.get(Xr(e,t))}function Yr(e,t,n){return e.set(Xr(e,t),n),n}function Xr(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const Kr="collapsibleColumns",$r=290,qr=["nestedHeaders"],Qr="collapsibleIndicator",Zr=Kr,Jr=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var ei=new WeakMap,ti=new WeakSet;class ni extends en["a"]{constructor(){super(...arguments),Fr(this,ti),Br(this,"nestedHeadersPlugin",null),Br(this,"headerStateManager",null),Ur(this,ei,null)}static get PLUGIN_KEY(){return Kr}static get PLUGIN_PRIORITY(){return $r}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[Kr,...qr]}isEnabled(){return!!this.hot.getSettings()[Kr]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:t}=this.hot.getSettings();t||Object(Dr["b"])("You need to configure the Nested Headers plugin in order to use collapsible headers."),Yr(ei,this,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",()=>Xr(ti,this,oi).call(this)),this.addHook("afterLoadData",(function(){for(var t=arguments.length,n=new Array(t),r=0;rXr(ti,this,ii).call(this,e,t,n)),this.registerShortcuts(),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(this.hot.view){if(!this.nestedHeadersPlugin.detectedOverlappedHeaders){const{collapsibleColumns:e}=this.hot.getSettings();"boolean"===typeof e?this.headerStateManager.mapState(e=>({collapsible:e.origColspan>1})):Array.isArray(e)&&(this.headerStateManager.mapState(()=>({collapsible:!1})),this.headerStateManager.mergeStateWith(e))}super.updatePlugin()}}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),Yr(ei,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:t,col:n}=this.hot.getSelectedRangeLast().highlight,{collapsible:r,isCollapsed:i,columnIndex:o}=null!==(e=this.headerStateManager.getHeaderTreeNodeData(t,n))&&void 0!==e?e:{};if(r)return i?this.expandSection({row:t,col:o}):this.collapseSection({row:t,col:o}),!1},runOnlyIf:()=>{var e,t;return(null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.isSingle())&&(null===(t=this.hot.getSelectedRangeLast())||void 0===t?void 0:t.highlight.isHeader())},group:Zr,relativeToGroup:He["a"],position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Zr)}clearButtons(){if(!this.hot.view)return;const e=this.hot.view._wt.getSetting("columnHeaders").length,t=this.hot.view._wt.wtTable.THEAD,n=this.hot.view._wt.wtOverlays.topOverlay.clone.wtTable.THEAD,r=this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay?this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null,i=function(e){e&&e.parentNode.removeChild(e)};Object(rt["rangeEach"])(0,e-1,e=>{const o=t.childNodes[e],s=n.childNodes[e],a=r?r.childNodes[e]:null;Object(rt["rangeEach"])(0,o.childNodes.length-1,e=>{let t=o.childNodes[e].querySelector("."+Qr);i(t),s&&s.childNodes[e]&&(t=s.childNodes[e].querySelector("."+Qr),i(t)),r&&a&&a.childNodes[e]&&(t=a.childNodes[e].querySelector("."+Qr),i(t))})},!0)}expandSection(e){this.toggleCollapsibleSection([e],"expand")}collapseSection(e){this.toggleCollapsibleSection([e],"collapse")}toggleAllCollapsibleSections(e){const t=this.headerStateManager.mapNodes(t=>{const{collapsible:n,origColspan:r,headerLevel:i,columnIndex:o,isCollapsed:s}=t;if(!0===n&&r>1&&(s&&"expand"===e||!s&&"collapse"===e))return{row:this.headerStateManager.levelToRowCoords(i),col:o}});this.toggleCollapsibleSection(t,e)}collapseAll(){this.toggleAllCollapsibleSections("collapse")}expandAll(){this.toggleAllCollapsibleSections("expand")}toggleCollapsibleSection(e,t){if(!Jr.has(t))throw new Error(`Unsupported action is passed (${t}).`);if(!Array.isArray(e))return;const n=Object(u["arrayFilter"])(e,e=>{let{row:t}=e;return t<0});let r=n.length>0;Object(u["arrayEach"])(n,e=>{var n;let{row:i,col:o}=e;const{collapsible:s,isCollapsed:a}=null!==(n=this.headerStateManager.getHeaderSettings(i,o))&&void 0!==n?n:{};if(!s||a&&"collapse"===t||!a&&"expand"===t)return r=!1,!1});const i=[],o=[];r&&Object(u["arrayEach"])(n,e=>{let{row:n,col:r}=e;const{colspanCompensation:s,affectedColumns:a,rollbackModification:l}=this.headerStateManager.triggerNodeModification(t,n,r);s>0&&(o.push(...a),i.push(l))});const s=this.getCollapsedColumns();let a=[];"collapse"===t?a=Object(u["arrayUnique"])([...s,...o]):"expand"===t&&(a=Object(u["arrayFilter"])(s,e=>!o.includes(e)));const l=Jr.get(t),c=this.hot.runHooks(l.beforeHook,s,a,r);if(!1===c)return void Object(u["arrayEach"])(i,e=>{e()});this.hot.batchExecution(()=>{Object(u["arrayEach"])(o,e=>{zr(ei,this).setValueAtIndex(this.hot.toPhysicalColumn(e),l.hideColumn)})},!0);const h=this.getCollapsedColumns().length!==s.length,d=this.hot.getSelectedRangeLast();if("collapse"===t&&h&&d){const{row:e,col:t}=d.highlight,n=this.hot.rowIndexMapper.isHidden(e)||this.hot.columnIndexMapper.isHidden(t);if(n&&o.includes(t)){const n=e>=0?this.hot.rowIndexMapper.getNearestNotHiddenIndex(e,1,!0):e,r=t>=0?this.hot.columnIndexMapper.getNearestNotHiddenIndex(t,1,!0):t;null!==n&&null!==r&&this.hot.selectCell(n,r)}}this.hot.runHooks(l.afterHook,s,a,r,h),this.hot.render(),this.hot.view.adjustElementsSize(!0)}getCollapsedColumns(){return zr(ei,this).getHiddenIndexes()}destroy(){Yr(ei,this,null),super.destroy()}}function ri(e,t,n){var r;const{collapsible:o,origColspan:s,isCollapsed:a}=null!==(r=this.headerStateManager.getHeaderSettings(n,e))&&void 0!==r?r:{},l=o&&s>1&&e>=this.hot.getSettings().fixedColumnsStart,c=this.hot.getSettings().ariaTags;let h=t.querySelector("."+Qr);var u;(Object(i["removeAttribute"])(t,[Object(y["k"])("")[0]]),l)?(h||(h=this.hot.rootDocument.createElement("div"),Object(i["addClass"])(h,Qr),t.querySelector("div:first-child").appendChild(h)),Object(i["removeClass"])(h,["collapsed","expanded"]),a?(Object(i["addClass"])(h,"collapsed"),Object(i["fastInnerText"])(h,"+"),c&&Object(i["setAttribute"])(t,...Object(y["k"])(!1))):(Object(i["addClass"])(h,"expanded"),Object(i["fastInnerText"])(h,"-"),c&&Object(i["setAttribute"])(t,...Object(y["k"])(!0))),c&&Object(i["setAttribute"])(h,...Object(y["n"])())):null===(u=h)||void 0===u||u.remove()}function ii(e,t){Object(i["hasClass"])(e.target,Qr)&&(Object(i["hasClass"])(e.target,"expanded")?(this.eventManager.fireEvent(e.target,"mouseup"),this.toggleCollapsibleSection([t],"collapse")):Object(i["hasClass"])(e.target,"collapsed")&&(this.eventManager.fireEvent(e.target,"mouseup"),this.toggleCollapsibleSection([t],"expand")),Object(o["stopImmediatePropagation"])(e))}function oi(){this.updatePlugin()}function si(e,t){t||this.updatePlugin()}var ai=n("97b9"),li=n("1b1a"),ci=n("9056");function hi(e,t,n){return t=ui(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ui(e){var t=di(e,"string");return"symbol"==typeof t?t:t+""}function di(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}const pi=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"],fi=!1,gi=!0,mi=!0;class yi{constructor(e,t){hi(this,"hot",void 0),hi(this,"sortingStates",new ci["a"]),hi(this,"sortEmptyCells",fi),hi(this,"indicator",gi),hi(this,"headerAction",mi),hi(this,"compareFunctionFactory",void 0),hi(this,"mapName",void 0),this.hot=e,this.mapName=t,this.hot.columnIndexMapper.registerMap(t,this.sortingStates)}updateAllColumnsProperties(e){Object(s["isObject"])(e)&&Object(s["objectEach"])(e,(e,t)=>{pi.includes(t)&&(this[t]=e)})}getAllColumnsProperties(){const e={sortEmptyCells:this.sortEmptyCells,indicator:this.indicator,headerAction:this.headerAction};return"function"===typeof this.compareFunctionFactory&&(e.compareFunctionFactory=this.compareFunctionFactory),e}getSortOrderOfColumn(e){var t;return null===(t=this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))||void 0===t?void 0:t.sortOrder}getIndexOfColumnInSortQueue(e){return e=this.hot.toPhysicalColumn(e),this.sortingStates.getEntries().findIndex(t=>{let[n]=t;return n===e})}getNumberOfSortedColumns(){return this.sortingStates.getLength()}isListOfSortedColumnsEmpty(){return 0===this.getNumberOfSortedColumns()}isColumnSorted(e){return Object(s["isObject"])(this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))}getSortStates(){if(null===this.sortingStates)return[];const e=this.sortingStates.getEntries();return e.map(e=>{let[t,n]=e;return{column:this.hot.toVisualColumn(t),...n}})}getColumnSortState(e){const t=this.getSortOrderOfColumn(e);if(Object(d["isDefined"])(t))return{column:e,sortOrder:t}}setSortStates(e){this.sortingStates.clear();for(let t=0;t!1===Ei(e)))return!1;const t=e.map(e=>{let{column:t}=e;return t});return new Set(t).size===t.length}function Si(e){if(e!==bi)return e===wi?bi:wi}function Ri(e){const t=e.querySelector("."+vi);return t}function Ti(e,t){if(e<0||!t.parentNode)return!1;const n=t.parentNode.parentNode.childNodes,r=Array.from(n).indexOf(t.parentNode)-n.length;return-1===r}function Oi(e,t,n){return-1===e&&t>=0&&!1===Object(o["isRightClick"])(n)}const Ni="ascending",Ai="descending",Ii="indicatorDisabled",Mi="columnSorting",xi="sortAction",_i=new Map([[wi,Ni],[bi,Ai]]);function Li(e,t,n,r){const i=[Mi];if(r&&i.push(xi),!1===n)return i.push(Ii),i;const o=e.getSortOrderOfColumn(t);return Object(d["isDefined"])(o)&&i.push(_i.get(o)),i}function Pi(){return Array.from(_i.values()).concat(xi,Ii,Mi)}const ki=0,ji=-1,Hi=1;function Di(e,t){const n=Zi(t);for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;oi?"asc"===e?Hi:ji:ki)}}const Ui="default";function Vi(e,t,n){return function(t,r){const i=parseFloat(t),o=parseFloat(r),{sortEmptyCells:s}=n;if(i===o||isNaN(i)&&isNaN(o))return ki;if(s){if(Object(d["isEmpty"])(t))return"asc"===e?ji:Hi;if(Object(d["isEmpty"])(r))return"asc"===e?Hi:ji}return isNaN(i)?Hi:isNaN(o)?ji:io?"asc"===e?Hi:ji:ki}}const Bi="numeric";function Wi(e,t,n){const r=t.checkedTemplate,i=t.uncheckedTemplate,{sortEmptyCells:o}=n;return function(s,a){const l=Object(d["isEmpty"])(s),c=Object(d["isEmpty"])(a),h=l?i:s,u=c?i:a,p=h===i||h===r,f=u===i||u===r;if(!1===o){if(l&&!1===c)return Hi;if(!1===l&&c)return ji}return!1===p&&f?"asc"===e?ji:Hi:p&&!1===f?"asc"===e?Hi:ji:!1===p&&!1===f?Fi(e,t,n)(s,a):h===i&&u===r?"asc"===e?ji:Hi:h===r&&u===i?"asc"===e?Hi:ji:ki}}const Gi="checkbox";function zi(e,t,n){return function(r,i){const{sortEmptyCells:o}=n;if(r===i)return ki;if(Object(d["isEmpty"])(r))return Object(d["isEmpty"])(i)?ki:o&&"asc"===e?ji:Hi;if(Object(d["isEmpty"])(i))return o&&"asc"===e?Hi:ji;const s=t.dateFormat,a=x(r,s),l=x(i,s);return a.isValid()?l.isValid()?l.isAfter(a)?"asc"===e?ji:Hi:l.isBefore(a)?"asc"===e?Hi:ji:ki:ji:Hi}}const Yi="date";var Xi=n("9acd");const{register:Ki,getItem:$i,hasItem:qi}=Object(Xi["a"])("sorting.compareFunctionFactory"),{register:Qi,getItem:Zi}=Object(Xi["a"])("sorting.mainSortComparator");function Ji(e){return qi(e)?$i(e):$i(Ui)}function eo(e,t){return function(n,r){const[,...i]=n,[,...o]=r;return function(n){const r=e[n],s=t[n],a=i[n],l=o[n],c=s.columnSorting,h=c.compareFunctionFactory?c.compareFunctionFactory:Ji(s.type),u=h(r,s,c)(a,l);return u}(0)}}function to(e,t){no(e,t),t.add(e)}function no(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ro(e,t,n){return t=io(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function io(e){var t=oo(e,"string");return"symbol"==typeof t?t:t+""}function oo(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function so(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}Ki(Bi,Vi),Ki(Gi,Wi),Ki(Yi,zi),Ki(Ui,Fi);const ao="columnSorting",lo=50,co="append",ho="replace",uo=ao;Qi(ao,eo),fe["a"].getSingleton().register("beforeColumnSort"),fe["a"].getSingleton().register("afterColumnSort");var po=new WeakSet;class fo extends en["a"]{constructor(){super(...arguments),to(this,po),ro(this,"columnStatesManager",null),ro(this,"columnMetaCache",null),ro(this,"pluginKey",ao),ro(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return ao}static get PLUGIN_PRIORITY(){return lo}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e=this;this.enabled||(this.columnStatesManager=new yi(this.hot,this.pluginKey+".sortingStates"),this.columnMetaCache=new hn["a"](e=>{let t=this.hot.toVisualColumn(e);return null===t&&(t=e),this.getMergedPluginSettings(t)}),this.hot.columnIndexMapper.registerMap(this.pluginKey+".columnMeta",this.columnMetaCache),this.addHook("afterGetColHeader",(e,t)=>so(po,this,mo).call(this,e,t)),this.addHook("beforeOnCellMouseDown",(function(){for(var t=arguments.length,n=new Array(t),r=0;rthis.onAfterOnCellMouseDown(e,t)),this.addHook("afterInit",()=>so(po,this,go).call(this)),this.addHook("afterLoadData",(function(){for(var t=arguments.length,n=new Array(t),r=0;r{const n=Ri(t);!1!==Ti(e,t)&&null!==n&&this.updateHeaderClasses(n)};this.hot.addHook("afterGetColHeader",e),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("afterGetColHeader",e)}),this.hot.batchExecution(()=>{null!==this.indexesSequenceCache&&(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,t;const n=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return n&&(null===(t=this.hot.getSelectedRangeLast())||void 0===t?void 0:t.isSingle())&&this.hot.selection.isCellVisible(n)&&-1===n.row&&n.col>=0},relativeToGroup:He["a"],position:"before",group:uo})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(uo)}sort(e){const t=this.getSortConfig(),n=this.getNormalizedSortConfigs(e),r=this.areValidSortConfigs(n),i=this.hot.runHooks("beforeColumnSort",t,n,r);!1!==i&&(0===t.length&&null===this.indexesSequenceCache&&(this.indexesSequenceCache=this.hot.rowIndexMapper.registerMap(this.pluginKey,new li["a"]),this.indexesSequenceCache.setValues(this.hot.rowIndexMapper.getIndexesSequence())),r&&(this.columnStatesManager.setSortStates(n),this.sortByPresetSortStates(n),this.saveAllSortSettings(n)),this.hot.runHooks("afterColumnSort",t,r?n:t,r),r&&(this.hot.render(),this.hot.forceFullRender=!1,this.hot.view.render()))}clearSort(){this.sort([])}isSorted(){return this.enabled&&!this.columnStatesManager.isListOfSortedColumnsEmpty()}getSortConfig(e){return Object(d["isDefined"])(e)?this.columnStatesManager.getColumnSortState(e):this.columnStatesManager.getSortStates()}setSortConfig(e){const t=this.getNormalizedSortConfigs(e);this.areValidSortConfigs(t)&&this.columnStatesManager.setSortStates(t)}getNormalizedSortConfigs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e.slice(0,1):[e]}areValidSortConfigs(e){const t=this.hot.countCols();return Ci(e)&&e.every(e=>{let{column:n}=e;return n<=t&&n>=0})}saveAllSortSettings(e){const t=this.columnStatesManager.getAllColumnsProperties(),n=e=>{let{column:t,...n}=e;return{column:this.hot.toPhysicalColumn(t),...n}};t.initialConfig=Object(u["arrayMap"])(e,n),this.hot.runHooks("persistentStateSave","columnSorting",t)}getAllSavedSortSettings(){const e={};this.hot.runHooks("persistentStateLoad","columnSorting",e);const t=e.value,n=e=>{let{column:t,...n}=e;return{column:this.hot.toVisualColumn(t),...n}};return Object(d["isDefined"])(t)&&Array.isArray(t.initialConfig)&&(t.initialConfig=Object(u["arrayMap"])(t.initialConfig,n)),t}getColumnNextConfig(e){const t=this.columnStatesManager.getSortOrderOfColumn(e);if(Object(d["isDefined"])(t)){const n=Si(t);return Object(d["isDefined"])(n)?{column:e,sortOrder:n}:void 0}const n=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e1&&void 0!==arguments[1]?arguments[1]:co;const n=this.columnStatesManager.getIndexOfColumnInSortQueue(e),r=-1!==n,i=this.getSortConfig(),o=this.getColumnNextConfig(e);if(r){if(Object(d["isUndefined"])(o))return[...i.slice(0,n),...i.slice(n+1)];if(t===co)return[...i.slice(0,n),...i.slice(n+1),o];if(t===ho)return[...i.slice(0,n),o,...i.slice(n+1)]}return Object(d["isDefined"])(o)?i.concat(o):i}getPluginColumnConfig(e){if(Object(s["isObject"])(e)){const t=e[this.pluginKey];if(Object(s["isObject"])(t))return t}return{}}getMergedPluginSettings(e){const t=this.hot.getSettings()[this.pluginKey],n=this.columnStatesManager.getAllColumnsProperties(),r=this.hot.getCellMeta(0,e),i=Object.getPrototypeOf(r);return Array.isArray(i.columns)?Object.assign(n,t,this.getPluginColumnConfig(i.columns[e])):Object(ai["isFunction"])(i.columns)?Object.assign(n,t,this.getPluginColumnConfig(i.columns(e))):Object.assign(n,t)}getFirstCellSettings(e){const t=this.hot.getCellMeta(0,e),n=Object.create(t);return n[this.pluginKey]=this.columnMetaCache.getValueAtIndex(this.hot.toPhysicalColumn(e)),n}getNumberOfRowsToSort(e){const t=this.hot.getSettings();return t.maxRows<=e?t.maxRows:e-t.minSpareRows}sortByPresetSortStates(e){if(0===e.length)return void this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues());const t=[],n=this.hot.countRows(),r=t=>Object(u["arrayMap"])(e,e=>this.hot.getDataAtCell(t,e.column));for(let l=0;le[0]);Di(t,this.pluginKey,Object(u["arrayMap"])(e,e=>e.sortOrder),Object(u["arrayMap"])(e,e=>this.getFirstCellSettings(e.column)));for(let l=t.length;le[0]),s=new Map(Object(u["arrayMap"])(i,(e,t)=>[e,o[t]])),a=Object(u["arrayMap"])(this.hot.rowIndexMapper.getIndexesSequence(),e=>s.has(e)?s.get(e):e);this.hot.rowIndexMapper.setIndexesSequence(a)}sortBySettings(e){if(Object(s["isObject"])(e)){this.columnStatesManager.updateAllColumnsProperties(e);const t=e.initialConfig;(Array.isArray(t)||Object(s["isObject"])(t))&&this.sort(t)}else this.hot.render()}updateHeaderClasses(e){if(Object(i["removeClass"])(e,Pi(e)),!1!==this.enabled){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{const n={};this.assignSetting(e,n,"ranges",[[0,this.hot.countRows()-1]]),this.assignSetting(e,n,"reversedRowCoords",!1),this.assignSetting(e,n,"destinationRow",new Error("\n You must provide a destination row for the Column Summary plugin in order to work properly!\n ")),this.assignSetting(e,n,"destinationColumn",new Error("\n You must provide a destination column for the Column Summary plugin in order to work properly!\n ")),this.assignSetting(e,n,"sourceColumn",e.destinationColumn),this.assignSetting(e,n,"type","sum"),this.assignSetting(e,n,"forceNumeric",!1),this.assignSetting(e,n,"suppressDataTypeErrors",!0),this.assignSetting(e,n,"customFunction",null),this.assignSetting(e,n,"readOnly",!0),this.assignSetting(e,n,"roundFloat",!1),t.push(n)}),t;this.settingsType="function"}assignSetting(e,t,n,r){if("ranges"!==n||void 0!==e[n]){if("ranges"!==n||0!==e[n].length)if(void 0===e[n]){if(r instanceof Error)throw r;t[n]=r}else"destinationRow"===n&&t.reversedRowCoords?t[n]=this.hot.countRows()-e[n]-1:t[n]=e[n]}else t[n]=r}resetSetupBeforeStructureAlteration(e,t,n){if("function"!==this.settingsType)return;const r=e.indexOf("row")>-1?"row":"col",i=this.getAllEndpoints();Object(u["arrayEach"])(i,i=>{"row"===r&&i.destinationRow>=t&&("insert_row"===e?i.alterRowOffset=n:"remove_row"===e&&(i.alterRowOffset=-1*n)),"col"===r&&i.destinationColumn>=t&&("insert_col"===e?i.alterColumnOffset=n:"remove_col"===e&&(i.alterColumnOffset=-1*n))}),this.resetAllEndpoints(i,!1)}resetSetupAfterStructureAlteration(e,t,n,r,i){let o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if("function"===this.settingsType){const e=()=>(this.hot.removeHook("beforeViewRender",e),this.refreshAllEndpoints());return void this.hot.addHookOnce("beforeViewRender",e)}const s=e.indexOf("row")>-1?"row":"col",a=e.indexOf("remove")>-1?-1:1,l=this.getAllEndpoints(),c=0===e.indexOf("move_row"),h=t;Object(u["arrayEach"])(l,e=>{"row"===s&&e.destinationRow>=h&&(e.alterRowOffset=a*n),"col"===s&&e.destinationColumn>=h&&(e.alterColumnOffset=a*n)}),this.resetAllEndpoints(l,!c),c?Object(u["arrayEach"])(l,e=>{this.extendEndpointRanges(e,h,r[0],r.length),this.recreatePhysicalRanges(e),this.clearOffsetInformation(e)}):Object(u["arrayEach"])(l,e=>{this.shiftEndpointCoordinates(e,h)}),o&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,t,n,r){Object(u["arrayEach"])(e.ranges,e=>{e[1]&&(t>=e[0]&&t<=e[1]?n>e[1]?e[1]+=r:n=e[0]&&n<=e[1]&&(e[1]-=r,t<=e[0]&&(e[0]+=1,e[1]+=1)))})}recreatePhysicalRanges(e){const t=e.ranges,n=[],r=[];Object(u["arrayEach"])(t,e=>{const t=[];if(e[1])for(let n=e[0];n<=e[1];n++)t.push(this.hot.toPhysicalRow(n));else t.push(this.hot.toPhysicalRow(e[0]));r.push(t)}),Object(u["arrayEach"])(r,e=>{let t=[];Object(u["arrayEach"])(e,(r,i)=>{0===i?t.push(r):e[i]!==e[i-1]+1&&(t.push(e[i-1]),n.push(t),t=[],t.push(r)),i===e.length-1&&(t.push(r),n.push(t))})}),e.ranges=n}shiftEndpointCoordinates(e,t){e.alterRowOffset&&0!==e.alterRowOffset?(e.destinationRow+=e.alterRowOffset||0,Object(u["arrayEach"])(e.ranges,n=>{Object(u["arrayEach"])(n,(r,i)=>{r>=t&&(n[i]+=e.alterRowOffset||0)})})):e.alterColumnOffset&&0!==e.alterColumnOffset&&(e.destinationColumn+=e.alterColumnOffset||0,e.sourceColumn+=e.alterColumnOffset||0)}resetAllEndpoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getAllEndpoints(),t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=e.some(e=>{const t=e.alterRowOffset||0,n=e.alterColumnOffset||0;return e.destinationRow+t>=this.hot.countRows()||e.destinationColumn+n>=this.hot.countCols()});n||(this.cellsToSetCache=[],Object(u["arrayEach"])(e,e=>{this.resetEndpointValue(e,t)}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],Object(u["arrayEach"])(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 t=[];this.cellsToSetCache=[],Object(u["arrayEach"])(e,(e,n,r)=>{""+(e[2]||"")!==""+e[3]&&Object(u["arrayEach"])(this.getAllEndpoints(),(e,i)=>{this.hot.propToCol(r[n][1])===e.sourceColumn&&-1===t.indexOf(i)&&t.push(i)})}),Object(u["arrayEach"])(t,e=>{this.refreshEndpoint(this.getEndpoint(e))}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshEndpoint(e){this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e),this.currentEndpoint=null}resetEndpointValue(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=e.alterRowOffset||0,r=e.alterColumnOffset||0;this.cellsToSetCache.push([this.hot.toVisualRow(e.destinationRow+(t?n:0)),this.hot.toVisualColumn(e.destinationColumn+(t?r:0)),""])}setEndpointValue(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=this.hot.toVisualRow(e.destinationRow);if(e.destinationRow>=this.hot.countRows()||e.destinationColumn>=this.hot.countCols())return void this.throwOutOfBoundsWarning();const i=this.hot.toVisualRow(e.destinationRow);if(null!==i){const n=this.hot.getCellMeta(i,e.destinationColumn);"init"!==t&&n.readOnly===e.readOnly||(n.readOnly=e.readOnly,n.className="columnSummaryResult")}if((!0===e.roundFloat||Number.isInteger(e.roundFloat))&&!isNaN(e.result)){const t=e.roundFloat;let n=0;Number.isInteger(t)&&(n=Math.min(Math.max(0,t),100)),e.result=e.result.toFixed(n)}n?this.hot.setDataAtCell(r,e.destinationColumn,e.result,"ColumnSummary.set"):this.cellsToSetCache.push([r,e.destinationColumn,e.result]),e.alterRowOffset=void 0,e.alterColumnOffset=void 0}throwOutOfBoundsWarning(){Object(Dr["b"])("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}}var So=Co,Ro=n("67a87");function To(e){return null===e||void 0===e||isNaN(e)}function Oo(e,t){No(e,t),t.add(e)}function No(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ao(e,t,n){return t=Io(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Io(e){var t=Mo(e,"string");return"symbol"==typeof t?t:t+""}function Mo(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function xo(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const _o="columnSummary",Lo=220;var Po=new WeakSet;class ko extends en["a"]{constructor(){super(...arguments),Oo(this,Po),Ao(this,"endpoints",null)}static get PLUGIN_KEY(){return _o}static get PLUGIN_PRIORITY(){return Lo}isEnabled(){return!!this.hot.getSettings()[_o]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[_o],this.endpoints=new So(this,this.settings),this.addHook("afterInit",(function(){for(var t=arguments.length,n=new Array(t),r=0;rthis.endpoints.resetSetupBeforeStructureAlteration("insert_row",e,t,null,n)),this.addHook("beforeCreateCol",(e,t,n)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_col",e,t,null,n)),this.addHook("beforeRemoveRow",(function(){for(var t=arguments.length,n=new Array(t),r=0;rthis.endpoints.resetSetupAfterStructureAlteration("insert_row",e,t,null,n)),this.addHook("afterCreateCol",(e,t,n)=>this.endpoints.resetSetupAfterStructureAlteration("insert_col",e,t,null,n)),this.addHook("afterRemoveRow",(function(){for(var t=arguments.length,n=new Array(t),r=0;r{t+=this.getPartialSum(n,e.sourceColumn)}),t}getPartialSum(e,t){let n=0,r=e[1]||e[0],i=null,o=0;do{if(i=this.getCellValue(r,t),i=To(i)?null:i,null!==i){const e=((""+i).split(".")[1]||[]).length||1;e>o&&(o=e)}n+=i||0,r-=1}while(r>=e[0]);return Math.round(n*10**o)/10**o}calculateMinMax(e,t){let n=null;return Object(s["objectEach"])(e.ranges,r=>{const i=this.getPartialMinMax(r,e.sourceColumn,t);if(null===n&&null!==i&&(n=i),null!==i)switch(t){case"min":n=Math.min(n,i);break;case"max":n=Math.max(n,i);break;default:break}}),null===n?"Not enough data":n}getPartialMinMax(e,t,n){let r,i=null,o=e[1]||e[0];do{if(r=this.getCellValue(o,t),r=To(r)?null:r,null===i)i=r;else if(null!==r)switch(n){case"min":i=Math.min(i,r);break;case"max":i=Math.max(i,r);break;default:break}o-=1}while(o>=e[0]);return i}countEmpty(e,t){let n,r=0,i=e[1]||e[0];do{n=this.getCellValue(i,t),n=To(n)?null:n,null===n&&(r+=1),i-=1}while(i>=e[0]);return r}countEntries(e){let t=0;const n=e.ranges;return Object(s["objectEach"])(n,n=>{const r=void 0===n[1]?1:n[1]-n[0]+1,i=this.countEmpty(n,e.sourceColumn);t+=r,t-=i}),t}calculateAverage(e){const t=this.calculateSum(e),n=this.countEntries(e);return t/n}getCellValue(e,t){const n=this.hot.toVisualRow(e),r=this.hot.toVisualColumn(t);let i=this.hot.getSourceDataAtCell(e,t),o="";if(null!==n&&null!==r&&(o=this.hot.getCellMeta(n,r).className||""),o.indexOf("columnSummaryResult")>-1)return null;if(this.endpoints.currentEndpoint.forceNumeric&&("string"===typeof i&&(i=i.replace(/,/,".")),i=parseFloat(i)),isNaN(i)&&!this.endpoints.currentEndpoint.suppressDataTypeErrors)throw new Error(Ro["a"]`ColumnSummary plugin: cell at (${e}, ${t}) is not in a\x20 numeric format. Cannot do the calculation.`);return i}}function jo(){this.endpoints.initEndpoints()}function Ho(e,t){e&&"ColumnSummary.reset"!==t&&"ColumnSummary.set"!==t&&"loadData"!==t&&this.endpoints.refreshChangedEndpoints(e)}function Do(e,t){this.endpoints.resetSetupBeforeStructureAlteration("move_row",e[0],e.length,e,this.pluginName),this.endpoints.resetSetupAfterStructureAlteration("move_row",t,e.length,e,this.pluginName)}function Fo(e,t,n){return t=Uo(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uo(e){var t=Vo(e,"string");return"symbol"==typeof t?t:t+""}function Vo(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class Bo{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,t){Fo(this,"rootDocument",void 0),Fo(this,"isRtl",!1),Fo(this,"container",null),Fo(this,"editor",void 0),Fo(this,"editorStyle",void 0),Fo(this,"hidden",!0),this.rootDocument=e,this.isRtl=t,this.editor=this.createEditor(),this.editorStyle=this.editor.style,this.hide()}setPosition(e,t){this.editorStyle.left=e+"px",this.editorStyle.top=t+"px"}setSize(e,t){if(e&&t){const n=this.getInputElement();n.style.width=e+"px",n.style.height=t+"px"}}getSize(){return{width:Object(i["outerWidth"])(this.getInputElement()),height:Object(i["outerHeight"])(this.getInputElement())}}resetSize(){const e=this.getInputElement();e.style.width="",e.style.height=""}setReadOnlyState(e){const t=this.getInputElement();t.readOnly=e}show(){this.editorStyle.display="block",this.hidden=!1}hide(){this.hidden||(this.editorStyle.display="none"),this.hidden=!0}isVisible(){return"block"===this.editorStyle.display}setValue(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=e||"";this.getInputElement().value=t}getValue(){return this.getInputElement().value}isFocused(){return this.rootDocument.activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=this.rootDocument.createElement("div"),t=this.rootDocument.createElement("textarea");return e.style.display="none",this.container=this.rootDocument.createElement("div"),this.container.setAttribute("dir",this.isRtl?"rtl":"ltr"),Object(i["addClass"])(this.container,Bo.CLASS_EDITOR_CONTAINER),this.rootDocument.body.appendChild(this.container),Object(i["addClass"])(e,Bo.CLASS_EDITOR),Object(i["addClass"])(t,Bo.CLASS_INPUT),t.setAttribute("data-hot-input",!0),e.appendChild(t),this.container.appendChild(e),e}getInputElement(){return this.editor.querySelector("."+Bo.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)}}var Wo=Bo,Go=n("7ae0");function zo(e,t,n){return t=Yo(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yo(e){var t=Xo(e,"string");return"symbol"==typeof t?t:t+""}function Xo(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}const Ko=250,$o=250;class qo{constructor(e){zo(this,"wasLastActionShow",!0),zo(this,"showDebounced",null),zo(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout(()=>{!1===this.wasLastActionShow&&this.runLocalHooks("hide")},$o)}show(e){this.wasLastActionShow=!0,this.showDebounced(e)}cancelHiding(){this.wasLastActionShow=!0,clearTimeout(this.hidingTimer),this.hidingTimer=null}updateDelay(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ko;this.showDebounced=Object(ai["debounce"])(e=>{this.wasLastActionShow&&this.runLocalHooks("show",e.from.row,e.from.col)},e)}destroy(){this.clearLocalHooks()}}Object(s["mixin"])(qo,Go["a"]);var Qo=qo;const Zo="---------";function Jo(){return{name:Zo}}function es(e){return{key:"commentsAddEdit",name(){var t;const n=null===(t=this.getSelectedRangeLast())||void 0===t?void 0:t.highlight;return null!==n&&void 0!==n&&n.isCell()&&e.getCommentAtCell(n.row,n.col)?this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_EDIT_COMMENT"]):this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_ADD_COMMENT"])},callback(){const t=this.getSelectedRangeLast();this.deselectCell(),e.setRange(t),e.show(),e.focusEditor()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||0===this.countRenderedRows()||0===this.countRenderedCols())}}}function ts(e){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_REMOVE_COMMENT"])},callback(){const t=this.getSelectedRangeLast();t.forAll((t,n)=>{t>=0&&n>=0&&e.removeCommentAtCell(t,n,!1)}),this.render()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||0===this.countRenderedRows()||0===this.countRenderedCols())}}}function ns(e,t){if(-1!==e.indexOf(t))return e;const n=e.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","");return`${n} ${t}`}function rs(e,t){if(-1!==e.indexOf(t))return e;const n=e.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","");return`${n} ${t}`}function is(e,t){const n={};return Object(u["arrayEach"])(e,e=>{e.forAll((e,r)=>{e>=0&&r>=0&&(n[e]||(n[e]=[]),n[e][r]=t(e,r))})}),n}function os(e,t,n,r,i){Object(u["arrayEach"])(e,e=>{e.forAll((e,o)=>{e>=0&&o>=0&&ss(e,o,t,n,r,i)})})}function ss(e,t,n,r,i,o){const s=i(e,t);let a=r;s.className&&(a="vertical"===n?ns(s.className,r):rs(s.className,r)),o(e,t,"className",a)}function as(e){return`${String.fromCharCode(10003)}${e}`}function ls(e,t){let n=!1;return Array.isArray(e)&&Object(u["arrayEach"])(e,e=>(e.forAll((e,r)=>{if(e>=0&&r>=0&&t(e,r))return n=!0,!1}),n)),n}function cs(e,t){const n={top:0,left:0};if(t!==e.ownerDocument){const{frameElement:e}=t.defaultView,{top:r,left:i}=e.getBoundingClientRect();n.top=r,n.left=i}return n}function hs(e){return{key:"commentsReadOnly",name(){const t=this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_READ_ONLY_COMMENT"]),n=ls(this.getSelectedRange(),(t,n)=>e.getCommentMeta(t,n,Ts));return n?as(t):t},callback(){const t=this.getSelectedRangeLast();t.forAll((t,n)=>{if(t>=0&&n>=0){const r=!!e.getCommentMeta(t,n,Ts);e.updateCommentMeta(t,n,{[Ts]:!r})}})},disabled(){const t=this.getSelectedRangeLast();return!!(!t||t.highlight.isHeader()||!e.getCommentAtCell(t.highlight.row,t.highlight.col)||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||0===this.countRenderedRows()||0===this.countRenderedCols())}}}function us(e,t){ps(e,t),t.add(e)}function ds(e,t,n){ps(e,t),t.set(e,n)}function ps(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fs(e,t,n){return t=gs(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gs(e){var t=ms(e,"string");return"symbol"==typeof t?t:t+""}function ms(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function ys(e,t,n){return e.set(bs(e,t),n),n}function ws(e,t){return e.get(bs(e,t))}function bs(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const vs="comments",Es=60,Cs="comment",Ss="value",Rs="style",Ts="readOnly",Os=vs,Ns="plugin:"+vs;var As=new WeakMap,Is=new WeakMap,Ms=new WeakMap,xs=new WeakMap,_s=new WeakMap,Ls=new WeakMap,Ps=new WeakMap,ks=new WeakSet;class js extends en["a"]{constructor(){super(...arguments),us(this,ks),fs(this,"range",{}),ds(this,As,null),ds(this,Is,null),ds(this,Ms,!1),ds(this,xs,!1),ds(this,_s,{}),ds(this,Ls,null),ds(this,Ps,"")}static get PLUGIN_KEY(){return vs}static get PLUGIN_PRIORITY(){return Es}isEnabled(){return!!this.hot.getSettings()[vs]}enablePlugin(){this.enabled||(ws(As,this)||ys(As,this,new Wo(this.hot.rootDocument,this.hot.isRtl())),ws(Is,this)||ys(Is,this,new Qo(this.getDisplayDelaySetting())),this.addHook("afterContextMenuDefaultOptions",e=>this.addToContextMenu(e)),this.addHook("afterRenderer",(e,t,n,r,i,o)=>bs(ks,this,Us).call(this,e,o)),this.addHook("afterScroll",()=>bs(ks,this,Ys).call(this)),this.addHook("afterBeginEditing",()=>this.hide()),this.addHook("afterDocumentKeyDown",e=>bs(ks,this,zs).call(this,e)),ws(Is,this).addLocalHook("hide",()=>this.hide()),ws(Is,this).addLocalHook("show",(e,t)=>this.showAtCell(e,t)),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){ws(Is,this).updateDelay(this.getDisplayDelaySetting()),super.updatePlugin()}disablePlugin(){this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager(),t=e.getContext("grid"),n=e.addContext(Ns);t.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const t=this.hot.getSelectedRangeLast();ys(xs,this,!0),this.hot.scrollToFocusedCell(()=>{this.setRange(t),this.show(),this.focusEditor(),e.setActiveContextName(Ns),this.hot._registerTimeout(()=>{ys(xs,this,!1)})})},stopPropagation:!0,runOnlyIf:()=>{var e;return(null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight.isCell())&&!ws(As,this).isVisible()},group:Os}),n.addShortcut({keys:[["Escape"]],callback:()=>{ws(As,this).setValue(ws(Ps,this)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>{var e;return(null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight.isCell())&&ws(As,this).isVisible()},group:Os}),n.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>{var e;return(null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight.isCell())&&ws(As,this).isVisible()},group:Os})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Os)}registerListeners(){const{rootDocument:e}=this.hot,t=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",e=>bs(ks,this,Ds).call(this,e)),this.eventManager.addEventListener(e,"mousedown",e=>bs(ks,this,Hs).call(this,e)),this.eventManager.addEventListener(e,"mouseup",()=>bs(ks,this,Fs).call(this)),this.eventManager.addEventListener(t,"focus",()=>bs(ks,this,Bs).call(this)),this.eventManager.addEventListener(t,"blur",()=>bs(ks,this,Vs).call(this)),this.eventManager.addEventListener(t,"mousedown",e=>bs(ks,this,Ws).call(this,e)),this.eventManager.addEventListener(t,"mouseup",e=>bs(ks,this,Gs).call(this,e))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const t=Object(i["closest"])(e.target,"TD","TBODY");return!!(t&&Object(i["hasClass"])(t,"htCommentCell")&&Object(i["closest"])(t,[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 t=ws(As,this).getValue();let n="";null!==e&&void 0!==e?n=e:null!==t&&void 0!==t&&(n=t);const r=this.range.from.row,i=this.range.from.col;this.updateCommentMeta(r,i,{[Ss]:n}),this.hot.render()}setCommentAtCell(e,t,n){this.setRange({from:this.hot._createCellCoords(e,t)}),this.setComment(n)}removeComment(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[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,Cs),e&&this.hot.render(),this.hide()}removeCommentAtCell(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.setRange({from:this.hot._createCellCoords(e,t)}),this.removeComment(n)}getComment(){const e=this.range.from.row,t=this.range.from.col;return this.getCommentMeta(e,t,Ss)}getCommentAtCell(e,t){return this.getCommentMeta(e,t,Ss)}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:t,col:n}}=this.range;if(t<0||t>this.hot.countSourceRows()-1||n<0||n>this.hot.countSourceCols()-1)return!1;const r=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return ws(Is,this).cancelHiding(),ws(As,this).setValue(null!==(e=r[Cs]?r[Cs][Ss]:null)&&void 0!==e?e:""),ws(As,this).show(),this.refreshEditor(!0),!0}showAtCell(e,t){return this.setRange({from:this.hot._createCellCoords(e,t)}),this.show()}hide(){ws(As,this).hide()}refreshEditor(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!n&&(!this.range.from||!ws(As,this).isVisible()))return;const{rowIndexMapper:r,columnIndexMapper:o}=this.hot,{row:s,col:a}=this.range.from;let l=r.getRenderableFromVisualIndex(s),c=o.getRenderableFromVisualIndex(a);const h=null===l;ws(As,this).setPosition(0,0),null===l&&(l=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(s,-1))),null===c&&(c=o.getRenderableFromVisualIndex(o.getNearestNotHiddenIndex(a,-1)));const u=null===l,d=null===c;l=null!==(e=l)&&void 0!==e?e:0,c=null!==(t=c)&&void 0!==t?t:0;const{rootWindow:p,view:{_wt:f}}=this.hot,{wtTable:g}=f,m=f.getCell({row:l,col:c},!0),y=this.getCommentMeta(s,a,Rs);y?ws(As,this).setSize(y.width,y.height):ws(As,this).resetSize();const w=d?0:g.getStretchedColumnWidth(c),b=h&&!u?Object(i["outerHeight"])(m):0,{left:v,top:E,width:C,height:S}=m.getBoundingClientRect(),{width:R,height:T}=ws(As,this).getSize(),{innerWidth:O,innerHeight:N}=this.hot.rootWindow,A=this.hot.rootDocument.documentElement;let I=v+p.scrollX+w,M=E+p.scrollY+b;this.hot.isRtl()&&(I-=R+w),this.hot.isLtr()&&v+C+R>O?I=v+p.scrollX-R-1:this.hot.isRtl()&&I<-(A.scrollWidth-A.clientWidth)&&(I=v+p.scrollX+w+1),E+T>N&&(M-=T-S+1),ws(As,this).setPosition(I,M),ws(As,this).setReadOnlyState(this.getCommentMeta(s,a,Ts))}focusEditor(){ws(As,this).focus()}updateCommentMeta(e,t,n){const r=this.hot.getCellMeta(e,t)[Cs];let i;r?(i=Object(s["deepClone"])(r),Object(s["deepExtend"])(i,n)):i=n,this.hot.setCellMeta(e,t,Cs,i)}getCommentMeta(e,t,n){const r=this.hot.getCellMeta(e,t);if(r[Cs])return r[Cs][n]}addToContextMenu(e){e.items.push({name:Zo},es(this),ts(this),hs(this))}getDisplayDelaySetting(){const e=this.hot.getSettings()[vs];if(Object(s["isObject"])(e))return e.displayDelay}getEditorInputElement(){return ws(As,this).getInputElement()}destroy(){ws(As,this)&&ws(As,this).destroy(),ws(Is,this)&&ws(Is,this).destroy(),super.destroy()}}function Hs(e){if(this.hot.view&&this.hot.view._wt&&!ws(Ms,this)&&!this.targetIsCommentTextArea(e)){const t=Object(i["closest"])(e.target,"TD","TBODY");let n=null;t&&(n=this.hot.getCoords(t)),(!t||this.range.from&&n&&(this.range.from.row!==n.row||this.range.from.col!==n.col))&&this.hide()}}function Ds(e){const{rootDocument:t}=this.hot;if(!(ws(Ms,this)||ws(As,this).isFocused()||Object(i["hasClass"])(e.target,"wtBorder")||ws(Ls,this)===e.target)&&ws(As,this))if(ys(Ls,this,t.elementFromPoint(e.clientX,e.clientY)),this.targetIsCellWithComment(e)){const t=this.hot._createCellRange(this.hot.getCoords(e.target));ws(Is,this).show(t)}else Object(i["isChildOf"])(e.target,t)&&!this.targetIsCommentTextArea(e)&&ws(Is,this).hide()}function Fs(){ys(Ms,this,!1)}function Us(e,t){t[Cs]&&t[Cs][Ss]&&Object(i["addClass"])(e,t.commentedCellClassName)}function Vs(){ys(Ps,this,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function Bs(){ys(Ps,this,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(Ns)}function Ws(e){ys(_s,this,{width:Object(i["outerWidth"])(e.target),height:Object(i["outerHeight"])(e.target)})}function Gs(e){const t=Object(i["outerWidth"])(e.target),n=Object(i["outerHeight"])(e.target);t===ws(_s,this).width+1&&n===ws(_s,this).height+2||this.updateCommentMeta(this.range.from.row,this.range.from.col,{[Rs]:{width:t,height:n}})}function zs(e){ws(As,this).isVisible()&&Object(o["stopImmediatePropagation"])(e)}function Ys(){ws(xs,this)||this.hide()}n("956b");function Xs(e,t,n){return t=Ks(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ks(e){var t=$s(e,"string");return"symbol"==typeof t?t:t+""}function $s(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class qs{constructor(e){Xs(this,"hot",void 0),Xs(this,"commands",{}),Xs(this,"commonCallback",null),this.hot=e}registerCommand(e,t){this.commands[e]=t}setCommonCallback(e){this.commonCallback=e}execute(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;re.apply(this.hot,n))}}function Qs(e,t){let n;return Object(u["arrayEach"])(t,t=>{const r=t.key?t.key.split(":"):null;if(Array.isArray(r)&&r[1]===e)return n=t,!1}),n}const Zs="alignment";function Js(){return{key:Zs,name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_ALIGNMENT"])},disabled(){if(0===this.countRows()||0===this.countCols())return!0;const e=this.getSelectedRangeLast();return!e||(!!e.isSingleHeader()||!(this.getSelectedRange()&&!this.selection.isSelectedByCorner()))},submenu:{items:[{key:Zs+":left",name(){let e=this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_ALIGNMENT_LEFT"]);const t=ls(this.getSelectedRange(),(e,t)=>{const n=this.getCellMeta(e,t).className;if(n&&-1!==n.indexOf("htLeft"))return!0});return t&&(e=as(e)),e},callback(){const e=this.getSelectedRange(),t=is(e,(e,t)=>this.getCellMeta(e,t).className),n="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",t,e,n,r),os(e,n,r,(e,t)=>this.getCellMeta(e,t),(e,t,n,r)=>this.setCellMeta(e,t,n,r)),this.render()},disabled:!1},{key:Zs+":center",name(){let e=this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_ALIGNMENT_CENTER"]);const t=ls(this.getSelectedRange(),(e,t)=>{const n=this.getCellMeta(e,t).className;if(n&&-1!==n.indexOf("htCenter"))return!0});return t&&(e=as(e)),e},callback(){const e=this.getSelectedRange(),t=is(e,(e,t)=>this.getCellMeta(e,t).className),n="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",t,e,n,r),os(e,n,r,(e,t)=>this.getCellMeta(e,t),(e,t,n,r)=>this.setCellMeta(e,t,n,r)),this.render()},disabled:!1},{key:Zs+":right",name(){let e=this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT"]);const t=ls(this.getSelectedRange(),(e,t)=>{const n=this.getCellMeta(e,t).className;if(n&&-1!==n.indexOf("htRight"))return!0});return t&&(e=as(e)),e},callback(){const e=this.getSelectedRange(),t=is(e,(e,t)=>this.getCellMeta(e,t).className),n="horizontal",r="htRight";this.runHooks("beforeCellAlignment",t,e,n,r),os(e,n,r,(e,t)=>this.getCellMeta(e,t),(e,t,n,r)=>this.setCellMeta(e,t,n,r)),this.render()},disabled:!1},{key:Zs+":justify",name(){let e=this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY"]);const t=ls(this.getSelectedRange(),(e,t)=>{const n=this.getCellMeta(e,t).className;if(n&&-1!==n.indexOf("htJustify"))return!0});return t&&(e=as(e)),e},callback(){const e=this.getSelectedRange(),t=is(e,(e,t)=>this.getCellMeta(e,t).className),n="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",t,e,n,r),os(e,n,r,(e,t)=>this.getCellMeta(e,t),(e,t,n,r)=>this.setCellMeta(e,t,n,r)),this.render()},disabled:!1},{name:Zo},{key:Zs+":top",name(){let e=this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_ALIGNMENT_TOP"]);const t=ls(this.getSelectedRange(),(e,t)=>{const n=this.getCellMeta(e,t).className;if(n&&-1!==n.indexOf("htTop"))return!0});return t&&(e=as(e)),e},callback(){const e=this.getSelectedRange(),t=is(e,(e,t)=>this.getCellMeta(e,t).className),n="vertical",r="htTop";this.runHooks("beforeCellAlignment",t,e,n,r),os(e,n,r,(e,t)=>this.getCellMeta(e,t),(e,t,n,r)=>this.setCellMeta(e,t,n,r)),this.render()},disabled:!1},{key:Zs+":middle",name(){let e=this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE"]);const t=ls(this.getSelectedRange(),(e,t)=>{const n=this.getCellMeta(e,t).className;if(n&&-1!==n.indexOf("htMiddle"))return!0});return t&&(e=as(e)),e},callback(){const e=this.getSelectedRange(),t=is(e,(e,t)=>this.getCellMeta(e,t).className),n="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",t,e,n,r),os(e,n,r,(e,t)=>this.getCellMeta(e,t),(e,t,n,r)=>this.setCellMeta(e,t,n,r)),this.render()},disabled:!1},{key:Zs+":bottom",name(){let e=this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM"]);const t=ls(this.getSelectedRange(),(e,t)=>{const n=this.getCellMeta(e,t).className;if(n&&-1!==n.indexOf("htBottom"))return!0});return t&&(e=as(e)),e},callback(){const e=this.getSelectedRange(),t=is(e,(e,t)=>this.getCellMeta(e,t).className),n="vertical",r="htBottom";this.runHooks("beforeCellAlignment",t,e,n,r),os(e,n,r,(e,t)=>this.getCellMeta(e,t),(e,t,n,r)=>this.setCellMeta(e,t,n,r)),this.render()},disabled:!1}]}}}const ea="clear_column";function ta(){return{key:ea,name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_CLEAR_COLUMN"])},callback(e,t){const n=t[0].start.col,r=t[0].end.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(t[0].start.row,t[0].end.row),r,"ContextMenu.clearColumn")},disabled(){const e=this.getSelectedRangeLast();return!e||(!!(e.isSingleHeader()&&e.highlight.col<0)||!this.selection.isSelectedByColumnHeader())}}}const na="col_left";function ra(){return{key:na,name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_INSERT_LEFT"])},callback(){const e=this.getSelectedRangeLast().getTopLeftCorner(),t=this.isRtl()?"insert_col_end":"insert_col_start";this.alter(t,e.col,1,"ContextMenu.columnLeft")},disabled(){if(!this.isColumnModificationAllowed())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader()&&e.highlight.col<0)return!0;if(this.selection.isSelectedByCorner()){const e=this.countCols();return 0===e}return this.selection.isSelectedByRowHeader()||this.countCols()>=this.getSettings().maxCols},hidden(){return!this.getSettings().allowInsertColumn}}}const ia="col_right";function oa(){return{key:ia,name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_INSERT_RIGHT"])},callback(){const e=this.getSelectedRangeLast().getTopRightCorner(),t=this.isRtl()?"insert_col_start":"insert_col_end";this.alter(t,e.col,1,"ContextMenu.columnRight")},disabled(){if(!this.isColumnModificationAllowed())return!0;const e=this.getSelectedRangeLast();return!e||(!!(e.isSingleHeader()&&e.highlight.col<0)||!this.selection.isSelectedByCorner()&&(this.selection.isSelectedByRowHeader()||this.countCols()>=this.getSettings().maxCols))},hidden(){return!this.getSettings().allowInsertColumn}}}const sa="make_read_only";function aa(){return{key:sa,name(){let e=this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_READ_ONLY"]);const t=ls(this.getSelectedRange(),(e,t)=>this.getCellMeta(e,t).readOnly);return t&&(e=as(e)),e},callback(){const e=this.getSelectedRange(),t=ls(e,(e,t)=>this.getCellMeta(e,t).readOnly);Object(u["arrayEach"])(e,e=>{e.forAll((e,n)=>{e>=0&&n>=0&&this.setCellMeta(e,n,"readOnly",!t)})}),this.render()},disabled(){const e=this.getSelectedRangeLast();return!e||(!!e.isSingleHeader()||(!!this.selection.isSelectedByCorner()||(0===this.countRows()||0===this.countCols()||(!this.getSelectedRange()||0===this.getSelectedRange().length))))}}}const la="redo";function ca(){return{key:la,name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_REDO"])},callback(){this.redo()},hidden(){const e=this.getPlugin("undoRedo");return!e||!e.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}}var ha=n("a952");const ua="remove_col";function da(){return{key:ua,name(){const e=this.getSelected();let t=0;if(e)if(e.length>1)t=1;else{const[,n,,r]=e[0];n-r!==0&&(t=1)}return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_REMOVE_COLUMN"],t)},callback(){this.alter("remove_col",Object(ha["e"])(this),null,"ContextMenu.removeColumn")},disabled(){if(!this.isColumnModificationAllowed())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader()&&e.highlight.col<0)return!0;const t=this.countCols();return this.selection.isSelectedByCorner()?0===t:this.selection.isSelectedByRowHeader()||0===t},hidden(){return!this.getSettings().allowRemoveColumn}}}const pa="remove_row";function fa(){return{key:pa,name(){const e=this.getSelected();let t=0;if(e)if(e.length>1)t=1;else{const[n,,r]=e[0];n-r!==0&&(t=1)}return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_REMOVE_ROW"],t)},callback(){this.alter("remove_row",Object(ha["f"])(this),1,"ContextMenu.removeRow")},disabled(){const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader()&&e.highlight.row<0)return!0;const t=this.countRows();return this.selection.isSelectedByCorner()?0===t:this.selection.isSelectedByColumnHeader()||0===t},hidden(){return!this.getSettings().allowRemoveRow}}}const ga="row_above";function ma(){return{key:ga,name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_ROW_ABOVE"])},callback(){const e=this.getSelectedRangeLast().getTopLeftCorner();this.alter("insert_row_above",e.row,1,"ContextMenu.rowAbove")},disabled(){const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader()&&e.highlight.row<0)return!0;if(this.selection.isSelectedByCorner()){const e=this.countRows();return 0===e}return this.selection.isSelectedByColumnHeader()||this.countRows()>=this.getSettings().maxRows},hidden(){return!this.getSettings().allowInsertRow}}}const ya="row_below";function wa(){return{key:ya,name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_ROW_BELOW"])},callback(){const e=this.getSelectedRangeLast().getBottomRightCorner();this.alter("insert_row_below",e.row,1,"ContextMenu.rowBelow")},disabled(){const e=this.getSelectedRangeLast();return!e||(!!(e.isSingleHeader()&&e.highlight.row<0)||!this.selection.isSelectedByCorner()&&(this.selection.isSelectedByColumnHeader()||this.countRows()>=this.getSettings().maxRows))},hidden(){return!this.getSettings().allowInsertRow}}}const ba="no_items";function va(){return{key:ba,name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_NO_ITEMS"])},disabled:!0,isCommand:!1}}const Ea="undo";function Ca(){return{key:Ea,name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_UNDO"])},callback(){this.undo()},hidden(){const e=this.getPlugin("undoRedo");return!e||!e.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}}const Sa=[ga,ya,na,ia,ea,pa,ua,Ea,la,sa,Zs,Zo,ba],Ra={[Zo]:Jo,[ba]:va,[ga]:ma,[ya]:wa,[na]:ra,[ia]:oa,[ea]:ta,[pa]:fa,[ua]:da,[Ea]:Ca,[la]:ca,[sa]:aa,[Zs]:Js};function Ta(){const e={};return Object(s["objectEach"])(Ra,(t,n)=>{e[n]=t()}),e}function Oa(e,t,n){return t=Na(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Na(e){var t=Aa(e,"string");return"symbol"==typeof t?t:t+""}function Aa(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class Ia{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Oa(this,"hot",void 0),Oa(this,"predefinedItems",Ta()),Oa(this,"defaultOrderPattern",void 0),this.hot=e,this.defaultOrderPattern=t}setPredefinedItems(e){const t={};this.defaultOrderPattern.length=0,Object(s["objectEach"])(e,(e,n)=>{let r="";e.name===Zo?(t[Zo]=e,r=Zo):isNaN(parseInt(n,10))?(e.key=void 0===e.key?n:e.key,t[n]=e,r=e.key):(t[e.key]=e,r=e.key),this.defaultOrderPattern.push(r)}),this.predefinedItems=t}getItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Ma(e,this.defaultOrderPattern,this.predefinedItems)}}function Ma(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=[];let i=e;return i&&i.items?i=i.items:Array.isArray(i)||(i=t),Object(s["isObject"])(i)?Object(s["objectEach"])(i,(e,t)=>{let i=n["string"===typeof e?e:t];i||(i=e),Object(s["isObject"])(e)?Object(s["extend"])(i,e):"string"===typeof i&&(i={name:i}),void 0===i.key&&(i.key=t),r.push(i)}):Object(u["arrayEach"])(i,(e,t)=>{let i=n[e];!i&&Sa.indexOf(e)>=0||(i||(i={name:e,key:""+t}),Object(s["isObject"])(e)&&Object(s["extend"])(i,e),void 0===i.key&&(i.key=t),r.push(i))}),r}function xa(e,t,n){return t=_a(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _a(e){var t=La(e,"string");return"symbol"==typeof t?t:t+""}function La(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class Pa{constructor(e,t){xa(this,"top",void 0),xa(this,"topRelative",void 0),xa(this,"left",void 0),xa(this,"leftRelative",void 0),xa(this,"scrollTop",void 0),xa(this,"scrollLeft",void 0),xa(this,"cellHeight",void 0),xa(this,"cellWidth",void 0);const n=t.scrollY,r=t.scrollX;let i,o,s,a,l,c;this.rootWindow=t,this.type=this.getSourceType(e),"literal"===this.type?(i=parseInt(e.top,10),s=parseInt(e.left,10),l=e.height||0,c=e.width||0,o=i,a=s,i+=n,s+=r):"event"===this.type&&(i=parseInt(e.pageY,10),s=parseInt(e.pageX,10),l=e.target.clientHeight,c=e.target.clientWidth,o=i-n,a=s-r),this.top=i,this.topRelative=o,this.left=s,this.leftRelative=a,this.scrollTop=n,this.scrollLeft=r,this.cellHeight=l,this.cellWidth=c}getSourceType(e){let t="literal";return e instanceof Event&&(t="event"),t}fitsAbove(e){return this.topRelative>=e.offsetHeight}fitsBelow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.rootWindow.innerHeight;return this.topRelative+e.offsetHeight<=t}fitsOnRight(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.rootWindow.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=t}fitsOnLeft(e){return this.leftRelative>=e.offsetWidth}}function ka(e,t,n){ja(e,t),t.set(e,n)}function ja(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ha(e,t){return e.get(Fa(e,t))}function Da(e,t,n){return e.set(Fa(e,t),n),n}function Fa(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var Ua=new WeakMap,Va=new WeakMap,Ba=new WeakMap,Wa=new WeakMap,Ga=new WeakMap;class za{constructor(e){ka(this,Ua,void 0),ka(this,Va,void 0),ka(this,Ba,void 0),ka(this,Wa,!1),ka(this,Ga,{above:0,below:0,left:0,right:0}),Da(Wa,this,e)}setOffset(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Ha(Ga,this)[e]=t,this}setElement(e){return Da(Ua,this,e),this}setParentElement(e){return Da(Va,this,e),this}updatePosition(e){Da(Ba,this,new Pa(e,Ha(Ua,this).ownerDocument.defaultView)),Ha(Wa,this)?(Ha(Ba,this).fitsBelow(Ha(Ua,this))?this.setPositionBelowCursor():Ha(Ba,this).fitsAbove(Ha(Ua,this))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){"rtl"===Ha(Ua,this).dir?Ha(Ba,this).fitsOnLeft(Ha(Ua,this))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():Ha(Ba,this).fitsOnRight(Ha(Ua,this))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=Ha(Ga,this).above+Ha(Ba,this).top-Ha(Ua,this).offsetHeight;Ha(Va,this)&&(e=Ha(Ba,this).top+Ha(Ba,this).cellHeight-Ha(Ua,this).offsetHeight+3),Ha(Ua,this).style.top=e+"px"}setPositionBelowCursor(){let e=Ha(Ga,this).below+Ha(Ba,this).top+1;Ha(Va,this)&&(e=Ha(Ba,this).top-1),Ha(Ua,this).style.top=e+"px"}setPositionOnRightOfCursor(){let e=Ha(Ba,this).left;if(Ha(Va,this)){const{right:t}=Ha(Va,this).getBoundingClientRect();e+=Ha(Ba,this).cellWidth+t-(Ha(Ba,this).left+Ha(Ba,this).cellWidth)}else e+=Ha(Ga,this).right;Ha(Ua,this).style.left=e+"px"}setPositionOnLeftOfCursor(){let e=Ha(Ga,this).left+Ha(Ba,this).left-Ha(Ua,this).offsetWidth;if(Ha(Va,this)){const{left:t}=Ha(Va,this).getBoundingClientRect();e-=Ha(Ba,this).left-t}Ha(Ua,this).style.left=e+"px"}}function Ya(e){let{initialPage:t=-1,size:n=(()=>0),onItemSelect:r=(()=>{}),onClear:i=(()=>{})}=e;const o=new Set;let s=Object(rt["clamp"])(t,-1,f()-1);function a(e,t){const n=f()-1;if(e<0&&(e=n),e>n&&(e=0),o.has(e))return-1;o.add(e);const i=r(e,!1);return!1===i&&(e=a(1===t?++e:--e,t)),e}function l(e){e>-1&&e0&&(o.clear(),s=a(0,1))}function u(){f()>0&&(o.clear(),s=a(f()-1,-1))}function d(){f()>0&&(o.clear(),s=a(++s,1))}function p(){f()>0&&(o.clear(),s=a(--s,-1))}function f(){return Math.max(n(),0)}function g(){o.clear(),s=t,i()}return{setCurrentPage:l,getCurrentPage:c,toFirstItem:h,toLastItem:u,toNextItem:d,toPreviousItem:p,getSize:f,clear:g}}function Xa(e){return Object(u["arrayMap"])(e,e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()}))}function Ka(e){return Object(s["hasOwnProperty"])(e,"submenu")}function $a(e){return new RegExp(Zo,"i").test(e.name)}function qa(e,t){return!0===e.disabled||"function"===typeof e.disabled&&!0===e.disabled.call(t)}function Qa(e){return Object(s["hasOwnProperty"])(e,"disableSelection")}function Za(e){return Object(i["hasClass"])(e,"htSeparator")}function Ja(e){return Object(i["hasClass"])(e,"htSubmenu")}function el(e){return Object(i["hasClass"])(e,"htDisabled")}function tl(e){return Object(i["hasClass"])(e,"htSelectionDisabled")}function nl(e,t){return!e.hidden||!("function"===typeof e.hidden&&e.hidden.call(t))}function rl(e,t){const n=e.slice(0);for(let r=0;r{n>0?t[t.length-1].name!==e.name&&t.push(e):t.push(e)}),t}function sl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zo,n=e.slice(0);return n=rl(n,t),n=il(n,t),n=ol(n),n}function al(e){return Ya({size:()=>e.countRows(),onItemSelect(t,n){const r=e.getCell(t,0);if(!r||Za(r)||el(r)||tl(r))return!1;e.selectCell(t,0,...n?[t,0,!1,!1]:[])},onClear(){e.deselectCell()}})}function ll(e){const{hot:t,hotMenu:n}=e;return[{keys:[["Control/Meta","A"]],forwardToContext:t.getShortcutManager().getContext("grid"),callback:()=>e.close(!0)},{keys:[["Tab"],["Shift","Tab"]],callback:(n,r)=>{const i=t.getSettings(),o="function"===typeof i.tabMoves?i.tabMoves(n):i.tabMoves;r.includes("shift")?t.selection.transformStart(-o.row,-o.col):t.selection.transformStart(o.row,o.col),e.close(!0)}},{keys:[["Escape"]],callback:()=>e.close()},{keys:[["ArrowDown"]],callback:()=>e.getNavigator().toNextItem()},{keys:[["ArrowUp"]],callback:()=>e.getNavigator().toPreviousItem()},{keys:[["ArrowRight"]],callback:()=>{const t=n.getSelectedLast();if(t){const n=e.openSubMenu(t[0]);n&&n.getNavigator().toFirstItem()}}},{keys:[["ArrowLeft"]],callback:()=>{const t=n.getSelectedLast();t&&e.isSubMenu()&&(e.close(),e.isSubMenu()&&e.parentMenu.hotMenu.listen())}},{keys:[["Control/Meta","ArrowUp"],["Home"]],callback:()=>e.getNavigator().toFirstItem()},{keys:[["Control/Meta","ArrowDown"],["End"]],callback:()=>e.getNavigator().toLastItem()},{keys:[["Enter"],["Space"]],callback:t=>{const r=n.getSelectedLast();r&&(n.getSourceDataAtRow(r[0]).submenu?e.openSubMenu(r[0]).getNavigator().toFirstItem():(e.executeCommand(t),e.close(!0)))}},{keys:[["PageUp"]],callback:()=>{const t=n.getSelectedLast();t?n.selection.transformStart(-n.countVisibleRows(),0):e.getNavigator().toFirstItem()}},{keys:[["PageDown"]],callback:()=>{const t=n.getSelectedLast();t?n.selection.transformStart(n.countVisibleRows(),0):e.getNavigator().toLastItem()}}]}const cl="menu",hl=cl;function ul(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=[];function r(e,t){a(t).addShortcuts(e,{group:cl})}function i(e,t){const i=a(t);e.forEach(e=>{let{keys:t}=e;t.forEach(e=>i.removeShortcutsByKeys(e))}),n.push({shortcuts:e,contextName:t}),r(e,t)}function o(){return[...n]}function s(e){return e?`${hl}:${e}`:hl}function a(t){var n;const r=e.hotMenu.getShortcutManager(),i=s(t);return null!==(n=r.getContext(i))&&void 0!==n?n:r.addContext(i)}function l(t){e.hotMenu.getShortcutManager().setActiveContextName(s(t))}return r(ll(e)),t.forEach(e=>{let{shortcuts:t,contextName:n}=e;i(t,n)}),{addCustomShortcuts:i,getCustomShortcuts:o,getContext:a,listen:l}}function dl(e){return(t,n,r,o,s,a)=>{if(n.hasAttribute("ghost-table"))return;const l=t.getSourceDataAtRow(r),c=e.rootDocument.createElement("div"),h="function"===typeof a?a.call(e):a;if(Object(i["empty"])(n),Object(i["addClass"])(c,"htItemWrapper"),e.getSettings().ariaTags){const t=!qa(l,e)&&!Qa(l)&&!$a(l);Object(i["setAttribute"])(n,[Object(y["t"])(),Object(y["p"])(h),...t?[Object(y["K"])(-1)]:[],...qa(l,e)?[Object(y["j"])()]:[],...Ka(l)?[Object(y["k"])(!1)]:[]])}n.className="",n.appendChild(c),$a(l)?Object(i["addClass"])(n,"htSeparator"):"function"===typeof l.renderer?(Object(i["addClass"])(n,"htCustomMenuRenderer"),n.appendChild(l.renderer(t,c,r,o,s,h))):Object(i["fastInnerHTML"])(c,h),qa(l,e)?Object(i["addClass"])(n,"htDisabled"):Qa(l)?Object(i["addClass"])(n,"htSelectionDisabled"):Ka(l)&&Object(i["addClass"])(n,"htSubmenu")}}function pl(e,t,n){fl(e,t),t.set(e,n)}function fl(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gl(e,t,n){return t=ml(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ml(e){var t=yl(e,"string");return"symbol"==typeof t?t:t+""}function yl(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function wl(e,t,n){return e.set(vl(e,t),n),n}function bl(e,t){return e.get(vl(e,t))}function vl(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const El=215;var Cl=new WeakMap,Sl=new WeakMap;class Rl{constructor(e,t){var n=this;gl(this,"hot",void 0),gl(this,"options",void 0),gl(this,"eventManager",new _e["a"](this)),gl(this,"container",void 0),gl(this,"positioner",void 0),gl(this,"hotMenu",null),gl(this,"hotSubMenus",{}),gl(this,"parentMenu",void 0),gl(this,"menuItems",null),gl(this,"origOutsideClickDeselects",null),pl(this,Cl,void 0),pl(this,Sl,void 0),this.hot=e,this.options=t||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:El,container:this.hot.rootDocument.documentElement},this.container=this.createContainer(this.options.name),this.positioner=new za(this.options.keepInViewport),this.parentMenu=this.options.parent||null,this.registerEvents(),this.isSubMenu()&&this.addLocalHook("afterSelectionChange",(function(){for(var e=arguments.length,t=new Array(e),r=0;rthis.onDocumentMouseDown(e)),this.eventManager.addEventListener(e.document,"contextmenu",e=>this.onDocumentContextMenu(e)),e=Object(i["getParentWindow"])(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return bl(Cl,this)}getKeyboardShortcutsCtrl(){return bl(Sl,this)}getSelectedItem(){return this.hasSelectedItem()?this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelectedLast()[0]):null}hasSelectedItem(){return Array.isArray(this.hotMenu.getSelectedLast())}isSubMenu(){return null!==this.parentMenu}open(){this.runLocalHooks("beforeOpen"),this.container.removeAttribute("style"),this.container.style.display="block";const e=Object(ai["debounce"])(e=>this.openSubMenu(e),300),t=this.options.minWidth||El;let n=!1,r=Object(u["arrayFilter"])(this.menuItems,e=>(e.key===ba&&(n=!0),nl(e,this.hot)));if(r.length<1&&!n)r.push(Ta()[ba]);else if(0===r.length)return;r=sl(r,Zo);let i=!1;const s={data:r,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth(e){return Object(d["isDefined"])(e)&&e{bl(Cl,this).setCurrentPage(t.row)},afterOnCellMouseOver:(t,n)=>{this.isAllSubMenusClosed()?e(n.row):this.openSubMenu(n.row)},rowHeights:e=>r[e].name===Zo?1:23,afterOnCellContextMenu:e=>{e.preventDefault(),Object(g["isWindowsOS"])()&&i&&this.hasSelectedItem()&&this.close(!0)},afterSelection:(e,t,n,r,i)=>{this.hotMenu.view.isMouseDown()&&(i.value=!0),this.runLocalHooks("afterSelectionChange",this.getSelectedItem())},beforeOnCellMouseUp:e=>{this.hasSelectedItem()&&(i=!this.isCommandPassive(this.getSelectedItem()),this.executeCommand(e))},afterOnCellMouseUp:e=>{Object(g["isWindowsOS"])()&&Object(o["isRightClick"])(e)||!i||!this.hasSelectedItem()||(Object(g["isMobileBrowser"])()||Object(g["isIpadOS"])()?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,s),this.hotMenu.addHook("afterInit",()=>this.onAfterInit()),this.hotMenu.init(),wl(Cl,this,al(this.hotMenu)),wl(Sl,this,ul(this)),bl(Sl,this).listen(),this.focus(),this.isSubMenu()&&this.addLocalHook("afterOpen",()=>this.parentMenu.runLocalHooks("afterSubmenuOpen",this)),this.runLocalHooks("afterOpen",this)}close(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isOpened())if(e&&this.isSubMenu())this.parentMenu.close();else if(bl(Cl,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 e=this.parentMenu.hotMenu.getSelectedLast();if(e){const t=this.parentMenu.hotMenu.getCell(e[0],0);Object(i["setAttribute"])(t,[Object(y["k"])(!1)])}}this.parentMenu.hotMenu.listen()}}openSubMenu(e){if(!this.hotMenu)return!1;const t=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!t||!Ja(t))return!1;const n=this.hotMenu.getSourceDataAtRow(e),r=new Rl(this.hot,{parent:this,name:n.name,className:this.options.className,keepInViewport:!0,container:this.options.container});return r.setMenuItems(n.submenu.items),r.open(),r.setPosition(t.getBoundingClientRect()),this.hotSubMenus[n.key]=r,this.hot.getSettings().ariaTags&&Object(i["setAttribute"])(t,[Object(y["k"])(!0)]),r}closeSubMenu(e){const t=this.hotMenu.getSourceDataAtRow(e),n=this.hotSubMenus[t.key];if(n){n.destroy(),delete this.hotSubMenus[t.key];const r=this.hotMenu.getCell(e,0);this.hot.getSettings().ariaTags&&Object(i["setAttribute"])(r,[Object(y["k"])(!1)])}}closeAllSubMenus(){Object(u["arrayEach"])(this.hotMenu.getData(),(e,t)=>this.closeSubMenu(t))}isAllSubMenusClosed(){return 0===Object.keys(this.hotSubMenus).length}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 null!==this.hotMenu}executeCommand(e){if(!this.isOpened()||!this.hasSelectedItem())return;const t=this.getSelectedItem();if(this.runLocalHooks("select",t,e),this.isCommandPassive(t))return;const n=this.hot.getSelectedRange(),r=n?Xa(n):[];this.runLocalHooks("executeCommand",t.key,r,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",t.key,r,e)}isCommandPassive(e){return!1===e.isCommand||$a(e)||qa(e,this.hot)||Ka(e)}setOffset(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.positioner.setOffset(e,t)}setPosition(e){this.isSubMenu()&&this.positioner.setParentElement(this.parentMenu.container),this.positioner.setElement(this.container).updatePosition(e)}createContainer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=this.options.container.ownerDocument;let n,r=e;return r&&(Object(ai["isFunction"])(r)&&(r=r.call(this.hot),r=null===r||Object(d["isUndefined"])(r)?"":r.toString()),r=r.replace(/[^A-z0-9]/g,"_"),r=`${this.options.className}Sub_${r}`,n=t.querySelector(`.${this.options.className}.${r}`)),n||(n=t.createElement("div"),Object(i["addClass"])(n,"htMenu "+this.options.className),r&&Object(i["addClass"])(n,r),this.options.container.appendChild(n)),n}onAfterInit(){const{wtTable:e}=this.hotMenu.view._wt,t=this.hotMenu.getSettings().data,n=e.hider.style,r=e.holder.style,o=parseInt(n.width,10),s=Object(u["arrayReduce"])(t,(e,t)=>e+(t.name===Zo?1:26),0);r.width=o+3+"px",r.height=s+3+"px",n.height=r.height,this.hot.getSettings().ariaTags&&Object(i["setAttribute"])(this.hotMenu.rootElement,[Object(y["s"])(),Object(y["K"])(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!Object(i["isChildOf"])(e.target,this.hotMenu.rootElement)?this.close(!0):!this.isAllSubMenusClosed()&&!this.isSubMenu()||Object(i["isChildOf"])(e.target,".htMenu")||this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&Object(i["hasClass"])(e.target,"htCore")&&Object(i["isChildOf"])(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}function Tl(e,t){Ol(e,t),t.add(e)}function Ol(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Nl(e,t,n){return t=Al(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Al(e){var t=Il(e,"string");return"symbol"==typeof t?t:t+""}function Il(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function Ml(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}Object(s["mixin"])(Rl,Go["a"]);const xl="contextMenu",_l=70,Ll=xl;fe["a"].getSingleton().register("afterContextMenuDefaultOptions"),fe["a"].getSingleton().register("beforeContextMenuShow"),fe["a"].getSingleton().register("afterContextMenuShow"),fe["a"].getSingleton().register("afterContextMenuHide"),fe["a"].getSingleton().register("afterContextMenuExecute");var Pl=new WeakSet;class kl extends en["a"]{constructor(){super(...arguments),Tl(this,Pl),Nl(this,"commandExecutor",new qs(this.hot)),Nl(this,"itemsFactory",null),Nl(this,"menu",null)}static get PLUGIN_KEY(){return xl}static get PLUGIN_PRIORITY(){return _l}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[ga,ya,Zo,na,ia,Zo,pa,ua,Zo,Ea,la,Zo,sa,Zo,Zs]}isEnabled(){return!!this.hot.getSettings()[xl]}enablePlugin(){var e=this;if(this.enabled)return;const t=this.hot.getSettings()[xl];"function"===typeof t.callback&&this.commandExecutor.setCommonCallback(t.callback),this.menu=new Rl(this.hot,{className:"htContextMenu",keepInViewport:!0,container:t.uiContainer||this.hot.rootDocument.body}),this.menu.addLocalHook("beforeOpen",()=>Ml(Pl,this,Hl).call(this)),this.menu.addLocalHook("afterOpen",()=>Ml(Pl,this,Dl).call(this)),this.menu.addLocalHook("afterClose",()=>Ml(Pl,this,Fl).call(this)),this.menu.addLocalHook("executeCommand",(function(){for(var t=arguments.length,n=new Array(t),r=0;rMl(Pl,this,jl).call(this,e)),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 t=this.hot.getCell(e.row,e.col,!0).getBoundingClientRect(),n=cs(this.menu.container,this.hot.rootDocument);this.open({left:t.left+n.left,top:t.top+n.top-1+t.height},{left:t.width,above:-t.height}),this.menu.getNavigator().toFirstItem()},runOnlyIf:()=>{var e;const t=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return t&&this.hot.selection.isCellVisible(t)&&!this.menu.isOpened()},group:Ll})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Ll)}open(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{above:0,below:0,left:0,right:0};null!==(t=this.menu)&&void 0!==t&&t.isOpened()||(this.prepareMenuItems(),this.menu.open(),Object(s["objectEach"])(n,(e,t)=>{this.menu.setOffset(t,e)}),this.menu.setPosition(e))}close(){var e;null===(e=this.menu)||void 0===e||e.close(),this.itemsFactory=null}executeCommand(e){null===this.itemsFactory&&this.prepareMenuItems();for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;rthis.commandExecutor.registerCommand(e.key,e))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function jl(e){const t=this.hot.getSettings(),n=t.rowHeaders,r=t.colHeaders;function o(e){return"TD"===e.nodeName||"TD"===e.parentNode.nodeName}const s=e.target;if(this.close(),Object(i["hasClass"])(s,"handsontableInput"))return;if(e.preventDefault(),e.stopPropagation(),!n&&!r&&!o(s)&&(!Object(i["hasClass"])(s,"current")||!Object(i["hasClass"])(s,"wtBorder")))return;const a=cs(this.menu.container,this.hot.rootDocument);this.open({top:e.clientY+a.top,left:e.clientX+a.left})}function Hl(){this.hot.runHooks("beforeContextMenuShow",this)}function Dl(){this.hot.runHooks("afterContextMenuShow",this)}function Fl(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}kl.SEPARATOR={name:Zo};var Ul=n("3bc4");function Vl(e){return{key:"copy",name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_COPY"])},callback(){e.copyCellsOnly()},disabled(){if(0===this.countRows()||0===this.countCols())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}}function Bl(e){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeLast(),t=e?Object(rt["clamp"])(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY"],t)},callback(){e.copyColumnHeadersOnly()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}}function Wl(e){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeLast(),t=e?Object(rt["clamp"])(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS"],t)},callback(){e.copyWithAllColumnHeaders()},disabled(){if(!this.hasColHeaders()||!this.getSettings().nestedHeaders)return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}}function Gl(e){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeLast(),t=e?Object(rt["clamp"])(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS"],t)},callback(){e.copyWithColumnHeaders()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}}function zl(e){return{key:"cut",name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_CUT"])},callback(){e.cut()},disabled(){if(0===this.countRows()||0===this.countCols())return!0;const e=this.getSelectedRangeLast();if(!e)return!0;if(e.isSingleHeader())return!0;const t=this.getSelected();return!t||t.length>1},hidden:!1}}class Yl{constructor(){this.data={}}setData(e,t){this.data[e]=t}getData(e){return this.data[e]||void 0}}class Xl{constructor(){this.clipboardData=new Yl}}function Kl(e,t){ql(e,t),t.add(e)}function $l(e,t,n){ql(e,t),t.set(e,n)}function ql(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ql(e,t){return e.get(Jl(e,t))}function Zl(e,t,n){return e.set(Jl(e,t),n),n}function Jl(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var ec=new WeakMap,tc=new WeakMap,nc=new WeakMap,rc=new WeakMap,ic=new WeakMap,oc=new WeakMap,sc=new WeakSet;class ac{constructor(e){let{countRows:t,countColumns:n,rowsLimit:r,columnsLimit:i,countColumnHeaders:o}=e;Kl(this,sc),$l(this,ec,void 0),$l(this,tc,void 0),$l(this,nc,void 0),$l(this,rc,void 0),$l(this,ic,void 0),$l(this,oc,void 0),Zl(tc,this,t),Zl(nc,this,n),Zl(rc,this,r),Zl(ic,this,i),Zl(oc,this,o)}setSelectedRange(e){Zl(ec,this,e)}getCellsRange(){if(0===Ql(tc,this).call(this)||0===Ql(nc,this).call(this))return null;const{row:e,col:t}=Ql(ec,this).getTopStartCorner(),{row:n,col:r}=Ql(ec,this).getBottomEndCorner(),i=Jl(sc,this,cc).call(this,e,n),o=Jl(sc,this,lc).call(this,t,r),s=n!==i||r!==o;return{isRangeTrimmed:s,startRow:e,startCol:t,endRow:i,endCol:o}}getMostBottomColumnHeadersRange(){if(0===Ql(nc,this).call(this)||0===Ql(oc,this).call(this))return null;const{col:e}=Ql(ec,this).getTopStartCorner(),{col:t}=Ql(ec,this).getBottomEndCorner(),n=Jl(sc,this,lc).call(this,e,t),r=t!==n;return{isRangeTrimmed:r,startRow:-1,startCol:e,endRow:-1,endCol:n}}getAllColumnHeadersRange(){if(0===Ql(nc,this).call(this)||0===Ql(oc,this).call(this))return null;const{col:e}=Ql(ec,this).getTopStartCorner(),{col:t}=Ql(ec,this).getBottomEndCorner(),n=Jl(sc,this,lc).call(this,e,t),r=t!==n;return{isRangeTrimmed:r,startRow:-Ql(oc,this).call(this),startCol:e,endRow:-1,endCol:n}}}function lc(e,t){return Math.min(t,Math.max(e+Ql(ic,this).call(this)-1,e))}function cc(e,t){return Math.min(t,Math.max(e+Ql(rc,this).call(this)-1,e))}function hc(e){const t=[],n=[];return Object(u["arrayEach"])(e,e=>{const r=Math.min(e.startRow,e.endRow),i=Math.max(e.startRow,e.endRow);Object(rt["rangeEach"])(r,i,e=>{-1===t.indexOf(e)&&t.push(e)});const o=Math.min(e.startCol,e.endCol),s=Math.max(e.startCol,e.endCol);Object(rt["rangeEach"])(o,s,e=>{-1===n.indexOf(e)&&n.push(e)})}),{rows:t,columns:n}}var uc=n("a776");function dc(e,t){fc(e,t),t.add(e)}function pc(e,t,n){fc(e,t),t.set(e,n)}function fc(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gc(e,t,n){return t=mc(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mc(e){var t=yc(e,"string");return"symbol"==typeof t?t:t+""}function yc(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function wc(e,t){return e.get(vc(e,t))}function bc(e,t,n){return e.set(vc(e,t),n),n}function vc(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}fe["a"].getSingleton().register("afterCopyLimit"),fe["a"].getSingleton().register("modifyCopyableRange"),fe["a"].getSingleton().register("beforeCut"),fe["a"].getSingleton().register("afterCut"),fe["a"].getSingleton().register("beforePaste"),fe["a"].getSingleton().register("afterPaste"),fe["a"].getSingleton().register("beforeCopy"),fe["a"].getSingleton().register("afterCopy");const Ec="copyPaste",Cc=80,Sc=["fragmentSelection"],Rc=['',''].join("");var Tc=new WeakMap,Oc=new WeakMap,Nc=new WeakMap,Ac=new WeakMap,Ic=new WeakMap,Mc=new WeakMap,xc=new WeakMap,_c=new WeakMap,Lc=new WeakSet;class Pc extends en["a"]{constructor(){super(...arguments),dc(this,Lc),gc(this,"columnsLimit",1/0),gc(this,"rowsLimit",1/0),gc(this,"pasteMode","overwrite"),gc(this,"uiContainer",this.hot.rootDocument.body),pc(this,Tc,!1),pc(this,Oc,!1),pc(this,Nc,!1),pc(this,Ac,"cells-only"),pc(this,Ic,!1),pc(this,Mc,!1),pc(this,xc,new ac({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),pc(this,_c,!1),gc(this,"copyableRanges",[])}static get PLUGIN_KEY(){return Ec}static get SETTING_KEYS(){return[Ec,...Sc]}static get PLUGIN_PRIORITY(){return Cc}isEnabled(){return!!this.hot.getSettings()[Ec]}enablePlugin(){var e=this;if(this.enabled)return;const{[Ec]:t}=this.hot.getSettings();var n,r;"object"===typeof t&&(this.pasteMode=null!==(n=t.pasteMode)&&void 0!==n?n:this.pasteMode,this.rowsLimit=isNaN(t.rowsLimit)?this.rowsLimit:t.rowsLimit,this.columnsLimit=isNaN(t.columnsLimit)?this.columnsLimit:t.columnsLimit,bc(Tc,this,!!t.copyColumnHeaders),bc(Oc,this,!!t.copyColumnGroupHeaders),bc(Nc,this,!!t.copyColumnHeadersOnly),this.uiContainer=null!==(r=t.uiContainer)&&void 0!==r?r:this.uiContainer);this.addHook("afterContextMenuDefaultOptions",e=>vc(Lc,this,Fc).call(this,e)),this.addHook("afterSelection",(function(){for(var t=arguments.length,n=new Array(t),r=0;rvc(Lc,this,Vc).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)})),Object(g["isSafari"])()&&(this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseenter",(function(){for(var t=arguments.length,n=new Array(t),r=0;rvc(Lc,this,Gc).call(this))),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin()}copy(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"cells-only";bc(Ac,this,e),bc(Ic,this,!0),vc(Lc,this,kc).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(){bc(Mc,this,!0),vc(Lc,this,kc).call(this,"cut")}getRangedCopyableData(e){return Object(Ul["b"])(this.getRangedData(e))}getRangedData(e){const t=[],{rows:n,columns:r}=hc(e);return Object(u["arrayEach"])(n,e=>{const n=[];Object(u["arrayEach"])(r,t=>{e<0?n.push(this.hot.getColHeader(t,e)):n.push(this.hot.getCopyableData(e,t))}),t.push(n)}),t}paste(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(!e&&!t)return;const n=new Xl;e&&n.clipboardData.setData("text/plain",e),t&&n.clipboardData.setData("text/html",t),this.onPaste(n)}setCopyableText(){const e=this.hot.getSelectedRangeLast();if(!e)return;if(e.isSingleHeader())return void(this.copyableRanges=[]);wc(xc,this).setSelectedRange(e);const t=new Map([["headers",null],["cells",null]]);"column-headers-only"===wc(Ac,this)?t.set("headers",wc(xc,this).getMostBottomColumnHeadersRange()):("with-column-headers"===wc(Ac,this)?t.set("headers",wc(xc,this).getMostBottomColumnHeadersRange()):"with-column-group-headers"===wc(Ac,this)&&t.set("headers",wc(xc,this).getAllColumnHeadersRange()),t.set("cells",wc(xc,this).getCellsRange())),this.copyableRanges=Array.from(t.values()).filter(e=>null!==e).map(e=>{let{startRow:t,startCol:n,endRow:r,endCol:i}=e;return{startRow:t,startCol:n,endRow:r,endCol:i}}),this.copyableRanges=this.hot.runHooks("modifyCopyableRange",this.copyableRanges);const n=t.get("cells");if(null!==n&&n.isRangeTrimmed){const{startRow:e,startCol:t,endRow:r,endCol:i}=n;this.hot.runHooks("afterCopyLimit",r-e+1,i-t+1,this.rowsLimit,this.columnsLimit)}}isEditorOpened(){var e;return null===(e=this.hot.getActiveEditor())||void 0===e?void 0:e.isOpened()}populateValues(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.hot.getSelectedRangeLast();if(!e.length)return;const n=e.length,r=e[0].length,i=[],{row:o,col:s}=t.getTopStartCorner(),{row:a,col:l}=t.getBottomEndCorner();let c=o,h=s,u=o,d=s;while(i.length{this.hot.rootDocument.execCommand(e)})}}else this.hot.rootDocument.execCommand(e)}function jc(e){const{rows:t}=hc(e);let n=0;for(let r=0;r=0)break;n+=1}return{columnHeadersCount:n}}function Hc(){if(this.hot.isListening()){const e=this.hot.getSelectedRangeLast();if(e){const{row:t,col:n}=e.highlight,r=this.hot.getCell(t,n,!0);r&&Object(i["makeElementContentEditableAndSelectItsContent"])(r)}}}function Dc(){if(this.hot.isListening()){const e=this.hot.getSelectedRangeLast();if(e){const{row:t,col:n}=e.highlight,r=this.hot.getCell(t,n,!0);null!==r&&void 0!==r&&r.hasAttribute("contenteditable")&&Object(i["removeContentEditableFromElementAndDeselect"])(r)}}}function Fc(e){e.items.push({name:"---------"},Vl(this)),wc(Tc,this)&&e.items.push(Gl(this)),wc(Oc,this)&&e.items.push(Wl(this)),wc(Nc,this)&&e.items.push(Bl(this)),e.items.push(zl(this))}function Uc(e,t,n,r,i){wc(_c,this)&&(i.value=!0),bc(_c,this,!1)}function Vc(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function Bc(){vc(Lc,this,Dc).call(this)}function Wc(){vc(Lc,this,Hc).call(this)}function Gc(){vc(Lc,this,Dc).call(this)}function zc(e,t){return`border_row${e}col${t}`}function Yc(){return{width:1,color:"#000"}}function Xc(){return{hide:!0}}function Kc(){return{width:1,color:"#000",cornerVisible:!1}}function $c(e){var t,n;(Object(d["isDefined"])(e.start)||Object(d["isDefined"])(e.left))&&(e.start=null!==(t=e.start)&&void 0!==t?t:e.left);(Object(d["isDefined"])(e.end)||Object(d["isDefined"])(e.right))&&(e.end=null!==(n=e.end)&&void 0!==n?n:e.right);return delete e.left,delete e.right,e}function qc(e){return Object(d["isDefined"])(e.start)&&(e.left=e.start),Object(d["isDefined"])(e.end)&&(e.right=e.end),e}function Qc(e,t){return{id:zc(e,t),border:Kc(),row:e,col:t,top:Xc(),bottom:Xc(),start:Xc(),end:Xc()}}function Zc(e,t){return Object(s["hasOwnProperty"])(t,"border")&&t.border&&(e.border=t.border),Object(s["hasOwnProperty"])(t,"top")&&Object(d["isDefined"])(t.top)&&(t.top?(Object(s["isObject"])(t.top)||(t.top=Yc()),e.top=t.top):(t.top=Xc(),e.top=t.top)),Object(s["hasOwnProperty"])(t,"bottom")&&Object(d["isDefined"])(t.bottom)&&(t.bottom?(Object(s["isObject"])(t.bottom)||(t.bottom=Yc()),e.bottom=t.bottom):(t.bottom=Xc(),e.bottom=t.bottom)),Object(s["hasOwnProperty"])(t,"start")&&Object(d["isDefined"])(t.start)&&(t.start?(Object(s["isObject"])(t.start)||(t.start=Yc()),e.start=t.start):(t.start=Xc(),e.start=t.start)),Object(s["hasOwnProperty"])(t,"end")&&Object(d["isDefined"])(t.end)&&(t.end?(Object(s["isObject"])(t.end)||(t.end=Yc()),e.end=t.end):(t.end=Xc(),e.end=t.end)),e}function Jc(e,t){let n=!1;return Object(u["arrayEach"])(e.getSelectedRange(),r=>{r.forAll((r,i)=>{if(r<0||i<0)return;const o=e.getCellMeta(r,i).borders;if(o){if(!t)return n=!0,!1;if(!Object(s["hasOwnProperty"])(o[t],"hide")||!1===o[t].hide)return n=!0,!1}})}),n}function eh(e){return`${String.fromCharCode(10003)}${e}`}function th(e){return e.some(e=>Object(d["isDefined"])(e.left)||Object(d["isDefined"])(e.right))}function nh(e){return e.some(e=>Object(d["isDefined"])(e.start)||Object(d["isDefined"])(e.end))}const rh=new Map([["left","start"],["right","end"]]);function ih(e){var t;return null!==(t=rh.get(e))&&void 0!==t?t:e}function oh(e){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_BORDERS_TOP"]);const t=Jc(this,"top");return t&&(e=eh(e)),e},callback(t,n){const r=Jc(this,"top");e.prepareBorder(n,"top",r)}}}function sh(e){const t=e.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let e=this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_BORDERS_RIGHT"]);const n=Jc(this,t);return n&&(e=eh(e)),e},callback(n,r){const i=Jc(this,t);e.prepareBorder(r,t,i)}}}function ah(e){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_BORDERS_BOTTOM"]);const t=Jc(this,"bottom");return t&&(e=eh(e)),e},callback(t,n){const r=Jc(this,"bottom");e.prepareBorder(n,"bottom",r)}}}function lh(e){const t=e.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let e=this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_BORDERS_LEFT"]);const n=Jc(this,t);return n&&(e=eh(e)),e},callback(n,r){const i=Jc(this,t);e.prepareBorder(r,t,i)}}}function ch(e){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_REMOVE_BORDERS"])},callback(t,n){e.prepareBorder(n,"noBorders")},disabled(){return!Jc(this)}}}function hh(e,t){uh(e,t),t.add(e)}function uh(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dh(e,t,n){return t=ph(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ph(e){var t=fh(e,"string");return"symbol"==typeof t?t:t+""}function fh(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function gh(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const mh="customBorders",yh=90;var wh=new WeakSet;class bh extends en["a"]{constructor(){super(...arguments),hh(this,wh),dh(this,"savedBorders",[])}static get PLUGIN_KEY(){return mh}static get PLUGIN_PRIORITY(){return yh}isEnabled(){return!!this.hot.getSettings()[mh]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>gh(wh,this,vh).call(this,e)),this.addHook("init",()=>gh(wh,this,Eh).call(this)),super.enablePlugin())}disablePlugin(){this.hideBorders(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.changeBorderSettings(),super.updatePlugin()}setBorders(e,t){let n=["top","bottom","start","end"],r=null;t&&(this.checkSettingsCohesion([t]),n=Object.keys(t),r=$c(t));const i=Object(ha["c"])(e),o=Object(ha["d"])(i,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});Object(u["arrayEach"])(e,e=>{o(e).forAll((e,t)=>{Object(u["arrayEach"])(n,n=>{this.prepareBorderFromCustomAdded(e,t,r,ih(n))})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const t=Object(ha["c"])(e),n=Object(ha["d"])(t,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),r=[];return Object(u["arrayEach"])(e,e=>{n(e).forAll((e,t)=>{Object(u["arrayEach"])(this.savedBorders,n=>{n.row===e&&n.col===t&&r.push(qc(n))})})}),r}clearBorders(e){e?this.setBorders(e):(Object(u["arrayEach"])(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange(),this.hot.removeCellMeta(e.row,e.col,"borders")}),this.savedBorders.length=0)}insertBorderIntoSettings(e,t){const n=this.checkSavedBorders(e);n||this.savedBorders.push(e);const r=this.hot._createCellRange(this.hot._createCellCoords(e.row,e.col)),i=this.checkCustomSelections(e,r,t);i||this.hot.selection.highlight.addCustomSelection({border:e,visualCellRange:r})}prepareBorderFromCustomAdded(e,t,n,r){const i=this.hot.countRows(),o=this.hot.countCols();if(e>=i||t>=o)return;let s=Qc(e,t);n&&(s=Zc(s,n),Object(u["arrayEach"])(this.hot.selection.highlight.customSelections,e=>{if(s.id===e.settings.id)return Object.assign(e.settings,n),s.id=e.settings.id,s.top=e.settings.top,s.bottom=e.settings.bottom,s.start=e.settings.start,s.end=e.settings.end,!1})),this.hot.setCellMeta(e,t,"borders",qc(s)),this.insertBorderIntoSettings(s,r)}prepareBorderFromCustomAddedRange(e,t){const n=Math.min(e.to.row,this.hot.countRows()-1),r=Math.min(e.to.col,this.hot.countCols()-1);Object(rt["rangeEach"])(e.from.row,n,n=>{Object(rt["rangeEach"])(e.from.col,r,r=>{const i=Qc(n,r);let o=0;n===e.from.row&&Object(s["hasOwnProperty"])(t,"top")&&(o+=1,i.top=t.top),n===e.to.row&&Object(s["hasOwnProperty"])(t,"bottom")&&(o+=1,i.bottom=t.bottom),r===e.from.col&&Object(s["hasOwnProperty"])(t,"start")&&(o+=1,i.start=t.start),r===e.to.col&&Object(s["hasOwnProperty"])(t,"end")&&(o+=1,i.end=t.end),o>0&&(this.hot.setCellMeta(n,r,"borders",qc(i)),this.insertBorderIntoSettings(i))})})}removeAllBorders(e,t){const n=zc(e,t);this.spliceBorder(n),this.clearBordersFromSelectionSettings(n),this.clearNullCellRange(),this.hot.removeCellMeta(e,t,"borders")}setBorder(e,t,n,r){let i=this.hot.getCellMeta(e,t).borders;if(i=i&&void 0!==i.border?$c(i):Qc(e,t),r){i[n]=Xc();const o=this.countHide(i);if(4===o)this.removeAllBorders(e,t);else{const o=this.checkCustomSelectionsFromContextMenu(i,n,r);o||this.insertBorderIntoSettings(i),this.hot.setCellMeta(e,t,"borders",qc(i))}}else{i[n]=Yc();const o=this.checkCustomSelectionsFromContextMenu(i,n,r);o||this.insertBorderIntoSettings(i),this.hot.setCellMeta(e,t,"borders",qc(i))}}prepareBorder(e,t,n){Object(u["arrayEach"])(e,e=>{let{start:r,end:i}=e;if(r.row===i.row&&r.col===i.col)"noBorders"===t?this.removeAllBorders(r.row,r.col):this.setBorder(r.row,r.col,t,n);else switch(t){case"noBorders":Object(rt["rangeEach"])(r.col,i.col,e=>{Object(rt["rangeEach"])(r.row,i.row,t=>{this.removeAllBorders(t,e)})});break;case"top":Object(rt["rangeEach"])(r.col,i.col,e=>{this.setBorder(r.row,e,t,n)});break;case"bottom":Object(rt["rangeEach"])(r.col,i.col,e=>{this.setBorder(i.row,e,t,n)});break;case"start":Object(rt["rangeEach"])(r.row,i.row,e=>{this.setBorder(e,r.col,t,n)});break;case"end":Object(rt["rangeEach"])(r.row,i.row,e=>{this.setBorder(e,i.col,t,n)});break;default:break}})}createCustomBorders(e){Object(u["arrayEach"])(e,e=>{const t=$c(e);e.range?this.prepareBorderFromCustomAddedRange(e.range,t):this.prepareBorderFromCustomAdded(e.row,e.col,t)})}countHide(e){const{top:t,bottom:n,start:r,end:i}=e,o=[t,n,r,i];return Object(u["arrayReduce"])(o,(e,t)=>{let n=e;return t&&t.hide&&(n+=1),n},0)}clearBordersFromSelectionSettings(e){const t=Object(u["arrayMap"])(this.hot.selection.highlight.customSelections,e=>e.settings.id).indexOf(e);t>-1&&this.hot.selection.highlight.customSelections[t].clear()}clearNullCellRange(){Object(u["arrayEach"])(this.hot.selection.highlight.customSelections,(e,t)=>{if(null===e.cellRange)return this.hot.selection.highlight.customSelections[t].destroy(),this.hot.selection.highlight.customSelections.splice(t,1),!1})}hideBorders(){Object(u["arrayEach"])(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()})}spliceBorder(e){const t=Object(u["arrayMap"])(this.savedBorders,e=>e.id).indexOf(e);t>-1&&this.savedBorders.splice(t,1)}checkSavedBorders(e){let t=!1;const n=this.countHide(e);return 4===n?(this.spliceBorder(e.id),t=!0):Object(u["arrayEach"])(this.savedBorders,(n,r)=>{if(e.id===n.id)return this.savedBorders[r]=e,t=!0,!1}),t}checkCustomSelectionsFromContextMenu(e,t,n){let r=!1;return Object(u["arrayEach"])(this.hot.selection.highlight.customSelections,i=>{if(e.id===i.settings.id){const e=this.hot.view._wt.selectionManager.getBorderInstances(i);return Object(u["arrayEach"])(e,e=>{e.toggleHiddenClass(t,n)}),r=!0,!1}}),r}checkCustomSelections(e,t,n){const r=this.countHide(e);let i=!1;return 4===r?(this.removeAllBorders(e.row,e.col),i=!0):Object(u["arrayEach"])(this.hot.selection.highlight.customSelections,r=>{if(e.id===r.settings.id){if(r.visualCellRange=t,r.commit(),n){const t=this.hot.view._wt.selectionManager.getBorderInstances(r);Object(u["arrayEach"])(t,t=>{t.changeBorderStyle(n,e)})}return i=!0,!1}}),i}changeBorderSettings(){const e=this.hot.getSettings()[mh];if(Array.isArray(e)){const t=Object(s["deepClone"])(e);this.checkSettingsCohesion(t),t.length||(this.savedBorders=t),this.createCustomBorders(t)}else void 0!==e&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const t=th(e),n=nh(e);if(t&&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()&&t)throw new Error('The "left"/"right" properties are not supported for RTL. Please use option "start"/"end".')}destroy(){super.destroy()}}function vh(e){this.hot.getSettings()[mh]&&e.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_BORDERS"])},disabled(){const e=this.getSelectedRangeLast();return!e||(!!e.isSingleHeader()||this.selection.isSelectedByCorner())},submenu:{items:[oh(this),sh(this),ah(this),lh(this),ch(this)]}})}function Eh(){this.changeBorderSettings()}function Ch(e,t){Sh(e,t),t.add(e)}function Sh(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Rh(e,t,n){return t=Th(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Th(e){var t=Oh(e,"string");return"symbol"==typeof t?t:t+""}function Oh(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function Nh(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const Ah="dragToScroll",Ih=100;var Mh=new WeakSet;class xh extends en["a"]{constructor(){super(...arguments),Ch(this,Mh),Rh(this,"boundaries",null),Rh(this,"callback",null),Rh(this,"listening",!1)}static get PLUGIN_KEY(){return Ah}static get PLUGIN_PRIORITY(){return Ih}isEnabled(){return!!this.hot.getSettings()[Ah]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>Nh(Mh,this,_h).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>Nh(Mh,this,_h).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&&void 0!==arguments[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,t){let n=0,r=0;tthis.boundaries.bottom&&(r=t-this.boundaries.bottom),ethis.boundaries.right&&(n=e-this.boundaries.right),this.callback(n,r)}listen(){this.listening=!0}unlisten(){this.listening=!1}isListening(){return this.listening}registerEvents(){const{rootWindow:e}=this.hot;let t=e;while(t)this.eventManager.addEventListener(t.document,"contextmenu",()=>this.unlisten()),this.eventManager.addEventListener(t.document,"mouseup",()=>this.unlisten()),this.eventManager.addEventListener(t.document,"mousemove",e=>this.onMouseMove(e)),t=Object(i["getParentWindow"])(t)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function _h(e){if(Object(o["isRightClick"])(e))return;const t=this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;this.setBoundaries(t!==this.hot.rootWindow?t.getBoundingClientRect():void 0),this.setCallback((e,n)=>{var r,i;const o=null!==(r=t.scrollLeft)&&void 0!==r?r:t.scrollX,s=null!==(i=t.scrollTop)&&void 0!==i?i:t.scrollY;t.scroll(o+50*Math.sign(e),s+20*Math.sign(n))}),this.listen()}function Lh(e,t){kh(e,t),t.add(e)}function Ph(e,t,n){kh(e,t),t.set(e,n)}function kh(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jh(e,t,n){return t=Hh(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hh(e){var t=Dh(e,"string");return"symbol"==typeof t?t:t+""}function Dh(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function Fh(e,t){return e.get(Vh(e,t))}function Uh(e,t,n){return e.set(Vh(e,t),n),n}function Vh(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}fe["a"].getSingleton().register("afterDropdownMenuDefaultOptions"),fe["a"].getSingleton().register("beforeDropdownMenuShow"),fe["a"].getSingleton().register("afterDropdownMenuShow"),fe["a"].getSingleton().register("afterDropdownMenuHide"),fe["a"].getSingleton().register("afterDropdownMenuExecute");const Bh="dropdownMenu",Wh=230,Gh="changeType",zh=Bh;var Yh=new WeakMap,Xh=new WeakSet;class Kh extends en["a"]{static get PLUGIN_KEY(){return Bh}static get PLUGIN_PRIORITY(){return Wh}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[na,ia,Zo,ua,Zo,ea,Zo,sa,Zo,Zs]}constructor(e){super(e),Lh(this,Xh),jh(this,"commandExecutor",new qs(this.hot)),jh(this,"itemsFactory",null),jh(this,"menu",null),Ph(this,Yh,!1),this.hot.addHook("afterGetColHeader",(e,t)=>Vh(Xh,this,Qh).call(this,e,t))}isEnabled(){return this.hot.getSettings()[Bh]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new Ia(this.hot,Kh.DEFAULT_ITEMS),this.addHook("beforeOnCellMouseDown",(function(){for(var t=arguments.length,n=new Array(t),r=0;r{this.hot.runHooks("afterDropdownMenuDefaultOptions",n),this.itemsFactory.setPredefinedItems(n.items);const r=this.itemsFactory.getItems(t);this.menu&&this.menu.destroy(),this.menu=new Rl(this.hot,{className:"htDropdownMenu",keepInViewport:!0,container:t.uiContainer||this.hot.rootDocument.body}),this.hot.runHooks("beforeDropdownMenuSetItems",r),this.menu.setMenuItems(r),this.menu.addLocalHook("beforeOpen",()=>Vh(Xh,this,Zh).call(this)),this.menu.addLocalHook("afterOpen",()=>Vh(Xh,this,Jh).call(this)),this.menu.addLocalHook("afterSubmenuOpen",e=>Vh(Xh,this,eu).call(this,e)),this.menu.addLocalHook("afterClose",()=>Vh(Xh,this,tu).call(this)),this.menu.addLocalHook("executeCommand",(function(){for(var t=arguments.length,n=new Array(t),r=0;rthis.commandExecutor.registerCommand(e.key,e))})}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"),t=()=>{const{highlight:e}=this.hot.getSelectedRangeLast();if((e.isHeader()&&-1===e.row||e.isCell())&&e.col>=0){this.hot.selectColumns(e.col,e.col,-1);const{from:t}=this.hot.getSelectedRangeLast(),n=cs(this.menu.container,this.hot.rootDocument),r=this.hot.getCell(-1,t.col,!0),i=r.getBoundingClientRect();this.open({left:i.left+n.left,top:i.top+r.offsetHeight+n.top},{left:i.width}),this.menu.getNavigator().toFirstItem()}};e.addShortcuts([{keys:[["Shift","Alt","ArrowDown"],["Control/Meta","Enter"]],callback:t,runOnlyIf:()=>{var e;const t=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return t&&this.hot.selection.isCellVisible(t)&&t.isHeader()&&!this.menu.isOpened()},captureCtrl:!0,group:zh},{keys:[["Shift","Alt","ArrowDown"]],callback:t,runOnlyIf:()=>{var e;const t=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return t&&this.hot.selection.isCellVisible(t)&&t.isCell()&&!this.menu.isOpened()},group:zh}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(zh)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>Vh(Xh,this,qh).call(this,e))}open(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{above:0,below:0,left:0,right:0};null!==(t=this.menu)&&void 0!==t&&t.isOpened()||(this.menu.open(),Object(s["objectEach"])(n,(e,t)=>{this.menu.setOffset(t,e)}),this.menu.setPosition(e))}close(){var e;null===(e=this.menu)||void 0===e||e.close()}executeCommand(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&void 0!==arguments[0])||arguments[0];this.menu.isOpened()&&(e?this.menu.hotMenu.listen():this.menu.hotMenu.unlisten())}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function $h(e){e.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function qh(e){if(Object(i["hasClass"])(e.target,Gh)){const t=cs(this.menu.container,this.hot.rootDocument),n=e.target.getBoundingClientRect();e.stopPropagation(),Uh(Yh,this,!1),this.open({left:n.left+t.left,top:n.top+e.target.offsetHeight+3+t.top},{left:n.width})}}function Qh(e,t){const n=t.parentNode;if(!n)return;const r=n.parentNode.childNodes,o=Array.prototype.indexOf.call(r,n);if(e<0||o!==r.length-1)return;const s=t.querySelector("."+Gh);if(this.enabled&&s)return;if(!this.enabled)return void(s&&s.parentNode.removeChild(s));const a=this.hot.rootDocument.createElement("button");a.className=Gh,a.type="button",a.tabIndex=-1,this.hot.getSettings().ariaTags&&(Object(i["setAttribute"])(a,[Object(y["n"])(),Object(y["p"])(" ")]),Object(i["setAttribute"])(t,[Object(y["m"])("menu")])),a.onclick=function(){return!1},t.firstChild.insertBefore(a,t.firstChild.firstChild)}function Zh(){this.hot.runHooks("beforeDropdownMenuShow",this)}function Jh(){this.hot.runHooks("afterDropdownMenuShow",this),Vh(Xh,this,$h).call(this,this.menu)}function eu(e){Vh(Xh,this,$h).call(this,e)}function tu(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function nu(e){return Fh(Yh,this)?null:e}function ru(e){Object(i["hasClass"])(e.target,Gh)&&Uh(Yh,this,!0)}function iu(e,t,n){return t=ou(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ou(e){var t=su(e,"string");return"symbol"==typeof t?t:t+""}function su(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Kh.SEPARATOR={name:Zo};class au{constructor(e){iu(this,"hot",void 0),iu(this,"options",{}),this.hot=e}setOptions(e){this.options=e}getData(){const{startRow:e,startCol:t,endRow:n,endCol:r}=this._getDataRange(),i=this.options,o=[];return Object(rt["rangeEach"])(e,n,e=>{const n=[];!i.exportHiddenRows&&this._isHiddenRow(e)||(Object(rt["rangeEach"])(t,r,t=>{!i.exportHiddenColumns&&this._isHiddenColumn(t)||n.push(this.hot.getDataAtCell(e,t))}),o.push(n))}),o}getRowHeaders(){const e=[];if(this.options.rowHeaders){const{startRow:t,endRow:n}=this._getDataRange(),r=this.hot.getRowHeader();Object(rt["rangeEach"])(t,n,t=>{!this.options.exportHiddenRows&&this._isHiddenRow(t)||e.push(r[t])})}return e}getColumnHeaders(){const e=[];if(this.options.columnHeaders){const{startCol:t,endCol:n}=this._getDataRange(),r=this.hot.getColHeader();Object(rt["rangeEach"])(t,n,t=>{!this.options.exportHiddenColumns&&this._isHiddenColumn(t)||e.push(r[t])})}return e}_getDataRange(){const e=this.hot.countCols()-1,t=this.hot.countRows()-1;let[n=0,r=0,i=t,o=e]=this.options.range;return n=Math.max(n,0),r=Math.max(r,0),i=Math.min(i,t),o=Math.min(o,e),{startRow:n,startCol:r,endRow:i,endCol:o}}_isHiddenRow(e){return this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(e))}_isHiddenColumn(e){return this.hot.columnIndexMapper.isHidden(this.hot.toPhysicalColumn(e))}}var lu=au;function cu(e,t,n){return t=hu(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hu(e){var t=uu(e,"string");return"symbol"==typeof t?t:t+""}function uu(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class du{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,t){cu(this,"dataProvider",void 0),cu(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(t),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let t=Object(s["clone"])(this.constructor.DEFAULT_OPTIONS);const n=new Date;return t=Object(s["extend"])(Object(s["clone"])(du.DEFAULT_OPTIONS),t),t=Object(s["extend"])(t,e),t.filename=Object(p["substitute"])(t.filename,{YYYY:n.getFullYear(),MM:(""+(n.getMonth()+1)).padStart(2,"0"),DD:(""+n.getDate()).padStart(2,"0")}),t}}var pu=du;const fu=String.fromCharCode(13),gu=String.fromCharCode(34),mu=String.fromCharCode(10);class yu extends pu{static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:"\r\n"}}export(){const e=this.options,t=this.dataProvider.getData();let n=this.dataProvider.getColumnHeaders();const r=n.length>0,i=this.dataProvider.getRowHeaders(),o=i.length>0;let s=e.bom?String.fromCharCode(65279):"";return r&&(n=Object(u["arrayMap"])(n,e=>this._escapeCell(e,!0)),o&&(s+=e.columnDelimiter),s+=n.join(e.columnDelimiter),s+=e.rowDelimiter),Object(u["arrayEach"])(t,(t,n)=>{n>0&&(s+=e.rowDelimiter),o&&(s+=this._escapeCell(i[n])+e.columnDelimiter),s+=t.map(e=>this._escapeCell(e)).join(e.columnDelimiter)}),s}_escapeCell(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Object(d["stringify"])(e);return""!==n&&(t||n.indexOf(fu)>=0||n.indexOf(gu)>=0||n.indexOf(mu)>=0||n.indexOf(this.options.columnDelimiter)>=0)&&(n=n.replace(new RegExp('"',"g"),'""'),n=`"${n}"`),n}}var wu=yu;const bu="csv",vu={[bu]:wu};function Eu(e,t,n){return"function"===typeof vu[e]?new vu[e](t,n):null}const Cu="exportFile",Su=240;class Ru extends en["a"]{static get PLUGIN_KEY(){return Cu}static get PLUGIN_PRIORITY(){return Su}isEnabled(){return!0}exportAsString(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._createTypeFormatter(e,t).export()}exportAsBlob(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._createBlob(this._createTypeFormatter(e,t))}downloadFile(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{rootDocument:n,rootWindow:r}=this.hot,i=this._createTypeFormatter(e,t),o=this._createBlob(i),s=r.URL||r.webkitURL,a=n.createElement("a"),l=`${i.options.filename}.${i.options.fileExtension}`;if(void 0!==a.download){const e=s.createObjectURL(o);a.style.display="none",a.setAttribute("href",e),a.setAttribute("download",l),n.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),n.body.removeChild(a),setTimeout(()=>{s.revokeObjectURL(e)},100)}else navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob(o,l)}_createTypeFormatter(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!vu[e])throw new Error(`Export format type "${e}" is not supported.`);return Eu(e,new lu(this.hot),t)}_createBlob(e){let t=null;return"undefined"!==typeof Blob&&(t=new Blob([e.export()],{type:`${e.options.mimeType};charset=${e.options.encoding}`})),t}}n("24b9e");function Tu(e,t,n){return t=Ou(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ou(e){var t=Nu(e,"string");return"symbol"==typeof t?t:t+""}function Nu(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class Au{constructor(e,t){let{id:n,stateless:r=!0}=t;Tu(this,"hot",void 0),Tu(this,"id",void 0),Tu(this,"elements",[]),Tu(this,"hidden",!1),Tu(this,"stateId",""),Tu(this,"state",void 0),this.hot=e,this.id=n,this.stateId="Filters.component."+this.id,this.state=r?null:this.hot.columnIndexMapper.registerMap(this.stateId,new ci["a"])}getElements(){return this.elements}reset(){Object(u["arrayEach"])(this.elements,e=>e.reset())}hide(){this.hidden=!0}show(){this.hidden=!1}isHidden(){return null===this.hot||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(),Object(u["arrayEach"])(this.elements,e=>e.destroy()),this.state=null,this.elements=null,this.hot=null}}Object(s["mixin"])(Au,Go["a"]);const Iu={};function Mu(e,t){if(!Iu[e])throw Error(`Filter condition "${e}" does not exist.`);const{condition:n,descriptor:r}=Iu[e];let i=t;return r.inputValuesDecorator&&(i=r.inputValuesDecorator(i)),function(e){return n.apply(e.meta.instance,[].concat([e],[i]))}}function xu(e){if(!Iu[e])throw Error(`Filter condition "${e}" does not exist.`);return Iu[e].descriptor}function _u(e,t,n){n.key=e,Iu[e]={condition:t,descriptor:n}}const Lu="none";function Pu(){return!0}_u(Lu,Pu,{name:De["FILTERS_CONDITIONS_NONE"],inputsCount:0,showOperators:!1});const ku="empty";function ju(e){return Object(d["isEmpty"])(e.value)}_u(ku,ju,{name:De["FILTERS_CONDITIONS_EMPTY"],inputsCount:0,showOperators:!0});const Hu="not_empty";function Du(e,t){return!Mu(ku,t)(e)}_u(Hu,Du,{name:De["FILTERS_CONDITIONS_NOT_EMPTY"],inputsCount:0,showOperators:!0});const Fu="eq";function Uu(e,t){let[n]=t;return Object(d["stringify"])(e.value).toLocaleLowerCase(e.meta.locale)===Object(d["stringify"])(n)}_u(Fu,Uu,{name:De["FILTERS_CONDITIONS_EQUAL"],inputsCount:1,showOperators:!0});const Vu="neq";function Bu(e,t){return!Mu(Fu,t)(e)}_u(Vu,Bu,{name:De["FILTERS_CONDITIONS_NOT_EQUAL"],inputsCount:1,showOperators:!0});const Wu="gt";function Gu(e,t){let[n]=t,r=n;return"numeric"===e.meta.type&&(r=parseFloat(r,10)),e.value>r}_u(Wu,Gu,{name:De["FILTERS_CONDITIONS_GREATER_THAN"],inputsCount:1,showOperators:!0});const zu="gte";function Yu(e,t){let[n]=t,r=n;return"numeric"===e.meta.type&&(r=parseFloat(r,10)),e.value>=r}_u(zu,Yu,{name:De["FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL"],inputsCount:1,showOperators:!0});const Xu="lt";function Ku(e,t){let[n]=t,r=n;return"numeric"===e.meta.type&&(r=parseFloat(r,10)),e.value=0}_u(Qu,Zu,{name:De["FILTERS_CONDITIONS_AFTER"],inputsCount:1,showOperators:!0});const Ju="date_before";function ed(e,t){let[n]=t;const r=x(e.value,e.meta.dateFormat),i=x(n,e.meta.dateFormat);return!(!r.isValid()||!i.isValid())&&r.diff(i)<=0}_u(Ju,ed,{name:De["FILTERS_CONDITIONS_BEFORE"],inputsCount:1,showOperators:!0});const td="between";function nd(e,t){let[n,r]=t,i=n,o=r;if("numeric"===e.meta.type){const e=parseFloat(i,10),t=parseFloat(o,10);i=Math.min(e,t),o=Math.max(e,t)}else if("date"===e.meta.type){const t=Mu(Ju,[o]),n=Mu(Qu,[i]);return t(e)&&n(e)}return e.value>=i&&e.value<=o}_u(td,nd,{name:De["FILTERS_CONDITIONS_BETWEEN"],inputsCount:2,showOperators:!0});const rd="not_between";function id(e,t){return!Mu(td,t)(e)}_u(rd,id,{name:De["FILTERS_CONDITIONS_NOT_BETWEEN"],inputsCount:2,showOperators:!0});const od="begins_with";function sd(e,t){let[n]=t;return Object(d["stringify"])(e.value).toLocaleLowerCase(e.meta.locale).startsWith(Object(d["stringify"])(n))}_u(od,sd,{name:De["FILTERS_CONDITIONS_BEGINS_WITH"],inputsCount:1,showOperators:!0});const ad="ends_with";function ld(e,t){let[n]=t;return Object(d["stringify"])(e.value).toLocaleLowerCase(e.meta.locale).endsWith(Object(d["stringify"])(n))}_u(ad,ld,{name:De["FILTERS_CONDITIONS_ENDS_WITH"],inputsCount:1,showOperators:!0});const cd="contains";function hd(e,t){let[n]=t;return Object(d["stringify"])(e.value).toLocaleLowerCase(e.meta.locale).indexOf(Object(d["stringify"])(n))>=0}_u(cd,hd,{name:De["FILTERS_CONDITIONS_CONTAINS"],inputsCount:1,showOperators:!0});const ud="not_contains";function dd(e,t){return!Mu(cd,t)(e)}_u(ud,dd,{name:De["FILTERS_CONDITIONS_NOT_CONTAIN"],inputsCount:1,showOperators:!0});const pd="date_tomorrow";function fd(e){const t=x(e.value,e.meta.dateFormat);return!!t.isValid()&&t.isSame(x().subtract(-1,"days").startOf("day"),"d")}_u(pd,fd,{name:De["FILTERS_CONDITIONS_TOMORROW"],inputsCount:0});const gd="date_today";function md(e){const t=x(e.value,e.meta.dateFormat);return!!t.isValid()&&t.isSame(x().startOf("day"),"d")}_u(gd,md,{name:De["FILTERS_CONDITIONS_TODAY"],inputsCount:0});const yd="date_yesterday";function wd(e){const t=x(e.value,e.meta.dateFormat);return!!t.isValid()&&t.isSame(x().subtract(1,"days").startOf("day"),"d")}_u(yd,wd,{name:De["FILTERS_CONDITIONS_YESTERDAY"],inputsCount:0});const bd="numeric",vd="text",Ed="date",Cd={[bd]:[Lu,Zo,ku,Hu,Zo,Fu,Vu,Zo,Wu,zu,Xu,$u,td,rd],[vd]:[Lu,Zo,ku,Hu,Zo,Fu,Vu,Zo,od,ad,Zo,cd,ud],[Ed]:[Lu,Zo,ku,Hu,Zo,Fu,Vu,Zo,Ju,Qu,td,Zo,pd,gd,yd]};function Sd(e){const t=[];let n=e;return Cd[n]||(n=vd),Object(u["arrayEach"])(Cd[n],e=>{let n;n=e===Zo?{name:Zo}:Object(s["clone"])(xu(e)),t.push(n)}),t}function Rd(e,t,n){return t=Td(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Td(e){var t=Od(e,"string");return"symbol"==typeof t?t:t+""}function Od(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}const Nd="built",Ad="building",Id=["click","input","keydown","keypress","keyup","focus","blur","change"];class Md{static get DEFAULTS(){return Object(s["clone"])({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,t){Rd(this,"hot",void 0),Rd(this,"eventManager",new _e["a"](this)),Rd(this,"options",void 0),Rd(this,"_element",void 0),Rd(this,"buildState",void 0),this.hot=e,this.options=Object(s["extend"])(Md.DEFAULTS,t),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===Ad?this._element:this.buildState===Nd?(this.update(),this._element):(this.buildState=Ad,this.build(),this.buildState=Nd,this._element)}isBuilt(){return this.buildState===Nd}translateIfPossible(e){return"string"===typeof e&&e.startsWith(De["FILTERS_NAMESPACE"])?this.hot.getTranslatedPhrase(e):e}build(){const e=(e,t)=>{this.eventManager.addEventListener(e,t,e=>this.runLocalHooks(t,e,this))};if(this.buildState||(this.buildState=Ad),this._element.setAttribute("data-hot-input",!0),void 0!==this.options.tabIndex&&this._element.setAttribute("tabindex",this.options.tabIndex),void 0!==this.options.role&&this._element.setAttribute("role",this.options.role),this.options.className&&Object(i["addClass"])(this._element,this.options.className),this.options.children.length)Object(u["arrayEach"])(this.options.children,e=>this._element.appendChild(e.element));else if(this.options.wrapIt){const t=this.hot.rootDocument.createElement(this.options.tagName);t.setAttribute("data-hot-input",!0),Object(s["objectEach"])(this.options,(e,n)=>{void 0!==t[n]&&"className"!==n&&"tagName"!==n&&"children"!==n&&(t[n]=this.translateIfPossible(e))}),this._element.appendChild(t),Object(u["arrayEach"])(Id,n=>e(t,n))}else Object(u["arrayEach"])(Id,t=>e(this._element,t))}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}}function xd(e,t){Ld(e,t),t.add(e)}function _d(e,t,n){Ld(e,t),t.set(e,n)}function Ld(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pd(e,t){return e.get(jd(e,t))}function kd(e,t,n){return e.set(jd(e,t),n),n}function jd(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}Object(s["mixin"])(Md,Go["a"]);var Hd=new WeakMap,Dd=new WeakSet;class Fd extends Md{static get DEFAULTS(){return Object(s["clone"])({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,t){super(e,Object(s["extend"])(Fd.DEFAULTS,t)),xd(this,Dd),_d(this,Hd,void 0),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",e=>jd(Dd,this,Ud).call(this,e))}build(){super.build();const e=this.hot.rootDocument.createElement("div");kd(Hd,this,this._element.firstChild),Object(i["addClass"])(this._element,"htUIInput"),Object(i["addClass"])(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(Pd(Hd,this).type=this.options.type,Pd(Hd,this).placeholder=this.translateIfPossible(this.options.placeholder),Pd(Hd,this).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&Pd(Hd,this).focus()}}function Ud(e){this.options.value=e.target.value}function Vd(e,t){Wd(e,t),t.add(e)}function Bd(e,t,n){Wd(e,t),t.set(e,n)}function Wd(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gd(e,t,n){return e.set(Yd(e,t),n),n}function zd(e,t){return e.get(Yd(e,t))}function Yd(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var Xd=new WeakMap,Kd=new WeakMap,$d=new WeakMap,qd=new WeakMap,Qd=new WeakMap,Zd=new WeakSet;class Jd extends Md{static get DEFAULTS(){return Object(s["clone"])({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,t){super(e,Object(s["extend"])(Jd.DEFAULTS,t)),Vd(this,Zd),Bd(this,Xd,null),Bd(this,Kd,[]),Bd(this,$d,void 0),Bd(this,qd,void 0),Bd(this,Qd,void 0),this.registerHooks()}getMenu(){return zd(Xd,this)}registerHooks(){this.addLocalHook("click",()=>Yd(Zd,this,np).call(this))}setItems(e){Gd(Kd,this,this.translateNames(e)),zd(Xd,this)&&zd(Xd,this).setMenuItems(zd(Kd,this))}translateNames(e){return Object(u["arrayEach"])(e,e=>{e.name=this.translateIfPossible(e.name)}),e}build(){super.build(),Gd(Xd,this,new Rl(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),zd(Xd,this).setMenuItems(zd(Kd,this));const e=new Md(this.hot,{className:"htUISelectCaption"}),t=new Md(this.hot,{className:"htUISelectDropdown"});Gd($d,this,e),Gd(qd,this,e.element),Gd(Qd,this,t),this.hot.getSettings().ariaTags&&(Object(i["setAttribute"])(t.element,[Object(y["n"])()]),Object(i["setAttribute"])(this._element,[Object(y["q"])()])),Object(u["arrayEach"])([e,t],e=>this._element.appendChild(e.element)),zd(Xd,this).addLocalHook("select",e=>Yd(Zd,this,ep).call(this,e)),zd(Xd,this).addLocalHook("afterClose",()=>Yd(Zd,this,tp).call(this)),this.update()}update(){if(!this.isBuilt())return;let e;e=this.options.value?this.options.value.name:zd(Xd,this).hot.getTranslatedPhrase(De["FILTERS_CONDITIONS_NONE"]),zd(qd,this).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();zd(Xd,this)&&(zd(Xd,this).open(),zd(Xd,this).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),zd(Xd,this).getNavigator().toFirstItem(),zd(Xd,this).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:e=>{this.closeOptions(),this.runLocalHooks("tabKeydown",e)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){zd(Xd,this)&&zd(Xd,this).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){zd(Xd,this)&&(zd(Xd,this).destroy(),Gd(Xd,this,null)),zd($d,this)&&zd($d,this).destroy(),zd(Qd,this)&&zd(Qd,this).destroy(),super.destroy()}}function ep(e){e.name!==Zo&&(this.options.value=e,this.update(),this.runLocalHooks("select",this.options.value))}function tp(){this.runLocalHooks("afterClose")}function np(){this.openOptions()}function rp(e,t){ip(e,t),t.add(e)}function ip(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function op(e,t,n){return t=sp(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sp(e){var t=ap(e,"string");return"symbol"==typeof t?t:t+""}function ap(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function lp(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var cp=new WeakSet;class hp extends Au{constructor(e,t){super(e,{id:t.id,stateless:!1}),rp(this,cp),op(this,"name",""),op(this,"addSeparator",!1),this.name=t.name,this.addSeparator=t.addSeparator,this.elements.push(new Jd(this.hot,{menuContainer:t.menuContainer})),this.elements.push(new Fd(this.hot,{placeholder:De["FILTERS_BUTTONS_PLACEHOLDER_VALUE"]})),this.elements.push(new Fd(this.hot,{placeholder:De["FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE"]})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",e=>lp(cp,this,up).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),Object(u["arrayEach"])(this.getInputElements(),e=>{e.addLocalHook("keydown",e=>lp(cp,this,dp).call(this,e))})}setState(e){if(this.reset(),!e)return;const t=Object(s["clone"])(e.command);t.name.startsWith(De["FILTERS_CONDITIONS_NAMESPACE"])&&(t.name=this.hot.getTranslatedPhrase(t.name)),this.getSelectElement().setValue(t),Object(u["arrayEach"])(e.args,(e,n)=>{if(n>t.inputsCount-1)return!1;const r=this.getInputElement(n);r.setValue(e),r[t.inputsCount>n?"show":"hide"](),n||this.hot._registerTimeout(()=>r.focus(),10)})}getState(){const e=this.getSelectElement().getValue()||xu(Lu),t=[];return Object(u["arrayEach"])(this.getInputElements(),(n,r)=>{e.inputsCount>r&&t.push(n.getValue())}),{command:e,args:t}}updateState(e,t){const n=xu(e?e.name:Lu);this.state.setValueAtIndex(t,{command:n,args:e?e.args:[]}),e||Object(u["arrayEach"])(this.getInputElements(),e=>e.setValue(null))}getSelectElement(){return this.elements.filter(e=>e instanceof Jd)[0]}getInputElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.getInputElements()[e]}getInputElements(){return this.elements.filter(e=>e instanceof Fd)}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t,n,r,o,s)=>{Object(i["addClass"])(t.parentNode,"htFiltersMenuCondition"),this.addSeparator&&Object(i["addClass"])(t.parentNode,"border");const a=this.hot.rootDocument.createElement("div");return Object(i["addClass"])(a,"htFiltersMenuLabel"),a.textContent=s,t.appendChild(a),Object(u["arrayEach"])(this.elements,e=>t.appendChild(e.element)),t}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let t=[xu(Lu)];if(null!==e){const{visualIndex:n}=e;t=Sd(this.hot.getDataType(0,n,this.hot.countRows(),n))}Object(u["arrayEach"])(this.getInputElements(),e=>e.hide()),this.getSelectElement().setItems(t),super.reset(),this.getSelectElement().setValue(t[0])}}function up(e){Object(u["arrayEach"])(this.getInputElements(),(t,n)=>{t[e.inputsCount>n?"show":"hide"](),0===n&&this.hot._registerTimeout(()=>t.focus(),10)}),this.runLocalHooks("change",e)}function dp(e){Object(f["isKey"])(e.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),Object(o["stopImmediatePropagation"])(e))}const pp={};function fp(e){if(!pp[e])throw Error(`Operation with id "${e}" does not exist.`);const t=pp[e].func;return function(e,n){return t(e,n)}}function gp(e){return pp[e].name}function mp(e,t,n){pp[e]={name:t,func:n}}const yp="conjunction",wp=De["FILTERS_LABELS_CONJUNCTION"];function bp(e,t){return e.every(e=>e.func(t))}mp(yp,wp,bp);const vp="disjunction",Ep=De["FILTERS_LABELS_DISJUNCTION"];function Cp(e,t){return e.some(e=>e.func(t))}mp(vp,Ep,Cp);const Sp="disjunctionWithExtraCondition",Rp=De["FILTERS_LABELS_DISJUNCTION"];function Tp(e,t){if(e.length<3)throw Error("Operation doesn't work on less then three conditions.");return e.slice(0,e.length-1).some(e=>e.func(t))&&e[e.length-1].func(t)}function Op(e,t,n){Np(e,t),t.set(e,n)}function Np(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ap(e,t){return e.get(Mp(e,t))}function Ip(e,t,n){return e.set(Mp(e,t),n),n}function Mp(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}mp(Sp,Rp,Tp);var xp=new WeakMap,_p=new WeakMap;class Lp extends Md{static get DEFAULTS(){return Object(s["clone"])({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,t){super(e,Object(s["extend"])(Lp.DEFAULTS,t)),Op(this,xp,void 0),Op(this,_p,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),Ip(_p,this,e),Ip(xp,this,this._element.firstChild),Ap(xp,this).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(Ap(_p,this).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return!!this.isBuilt()&&Ap(xp,this).checked}setChecked(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.isBuilt()&&(Ap(xp,this).checked=e)}focus(){this.isBuilt()&&Ap(xp,this).focus()}}function Pp(e,t){kp(e,t),t.add(e)}function kp(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jp(e,t,n){return t=Hp(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hp(e){var t=Dp(e,"string");return"symbol"==typeof t?t:t+""}function Dp(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function Fp(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const Up=0;var Vp=new WeakSet;class Bp extends Au{constructor(e,t){super(e,{id:t.id,stateless:!1}),Pp(this,Vp),jp(this,"name",""),this.name=t.name,this.buildOperatorsElement()}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t)=>(Object(i["addClass"])(t.parentNode,"htFiltersMenuOperators"),Object(u["arrayEach"])(this.elements,e=>t.appendChild(e.element)),t)}}buildOperatorsElement(){const e=[yp,vp];Object(u["arrayEach"])(e,t=>{const n=new Lp(this.hot,{name:"operator",label:{htmlFor:t,textContent:gp(t)},value:t,checked:t===e[Up],id:t});n.addLocalHook("change",e=>Fp(Vp,this,Wp).call(this,e)),this.elements.push(n)})}setChecked(e){if(this.elements.length{t.setChecked(n===e)})}getActiveOperationId(){const e=this.elements.find(e=>e instanceof Lp&&e.isChecked());return e?e.getValue():yp}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&Object(u["arrayEach"])(this.elements,t=>{t.setChecked(t.getValue()===e)})}updateState(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:yp,t=arguments.length>1?arguments[1]:void 0,n=e;n===Sp&&(n=vp),this.state.setValueAtIndex(t,n)}reset(){this.setChecked(Up)}}function Wp(e){this.setState(e.target.value)}Object(tn["getComparisonFunction"])();function Gp(e,t){let n=e;return""===n&&(n=`(${t})`),n}const zp=new Set([1]).has(1),Yp=zp&&"function"===typeof Array.from;function Xp(e){let t=e;return zp&&(t=new Set(t)),function(e){let n;return n=zp?t.has(e):!!~t.indexOf(e),n}}function Kp(e){return null===e||void 0===e?"":e}function $p(e){let t=e;return t=Yp?Array.from(new Set(t)):Object(u["arrayUnique"])(t),t=t.sort((e,t)=>"number"===typeof e&&"number"===typeof t?e-t:e===t?0:e>t?1:-1),t}function qp(e,t,n,r){const i=[],o=e===t;let s;return o||(s=Xp(t)),Object(u["arrayEach"])(e,e=>{let t=!1;(o||s(e))&&(t=!0);const a={checked:t,value:e,visualValue:Gp(e,n)};r&&r(a),i.push(a)}),i}var Qp=n("480c");function Zp(e,t,n){Jp(e,t),t.set(e,n)}function Jp(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ef(e,t){return e.get(nf(e,t))}function tf(e,t,n){return e.set(nf(e,t),n),n}function nf(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var rf=new WeakMap;class of extends Md{static get DEFAULTS(){return Object(s["clone"])({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,t){super(e,Object(s["extend"])(of.DEFAULTS,t)),Zp(this,rf,void 0)}build(){super.build(),tf(rf,this,this._element.firstChild)}update(){this.isBuilt()&&(ef(rf,this).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&ef(rf,this).focus()}activate(){ef(rf,this).click()}}function sf(e,t){lf(e,t),t.add(e)}function af(e,t,n){lf(e,t),t.set(e,n)}function lf(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function cf(e,t){return e.get(uf(e,t))}function hf(e,t,n){return e.set(uf(e,t),n),n}function uf(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const df="multipleSelect.itemBox";var pf=new WeakMap,ff=new WeakMap,gf=new WeakMap,mf=new WeakMap,yf=new WeakMap,wf=new WeakMap,bf=new WeakSet;class vf extends Md{static get DEFAULTS(){return Object(s["clone"])({className:"htUIMultipleSelect",value:[]})}constructor(e,t){super(e,Object(s["extend"])(vf.DEFAULTS,t)),sf(this,bf),af(this,pf,[]),af(this,ff,void 0),af(this,gf,void 0),af(this,mf,void 0),af(this,yf,void 0),af(this,wf,void 0),hf(mf,this,new Fd(this.hot,{placeholder:De["FILTERS_BUTTONS_PLACEHOLDER_SEARCH"],className:"htUIMultipleSelectSearch"})),hf(yf,this,new of(this.hot,{textContent:De["FILTERS_BUTTONS_SELECT_ALL"],className:"htUISelectAll"})),hf(wf,this,new of(this.hot,{textContent:De["FILTERS_BUTTONS_CLEAR"],className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return cf(ff,this)}registerHooks(){cf(mf,this).addLocalHook("keydown",e=>uf(bf,this,Cf).call(this,e)),cf(mf,this).addLocalHook("input",e=>uf(bf,this,Ef).call(this,e)),cf(yf,this).addLocalHook("click",e=>uf(bf,this,Sf).call(this,e)),cf(wf,this).addLocalHook("click",e=>uf(bf,this,Rf).call(this,e))}setItems(e){hf(pf,this,e),cf(ff,this)&&cf(ff,this).loadData(cf(pf,this))}setLocale(e){hf(gf,this,e)}getLocale(){return cf(gf,this)}getItems(){return[...cf(pf,this)]}getValue(){return Of(cf(pf,this))}getSearchInputElement(){return cf(mf,this)}getSelectAllElement(){return cf(yf,this)}getClearAllElement(){return cf(wf,this)}isSelectedAllValues(){return cf(pf,this).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,t=e.createElement("div"),n=new Md(this.hot,{className:"htUISelectionControls",children:[cf(yf,this),cf(wf,this)]});this._element.appendChild(cf(mf,this).element),this._element.appendChild(n.element),this._element.appendChild(t);const r=t=>{if(!this._element)return;cf(ff,this)&&cf(ff,this).destroy(),Object(i["addClass"])(t,"htUIMultipleSelectHot"),hf(ff,this,new this.hot.constructor(t,{data:cf(pf,this),columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(e,t,n,r,i,o)=>{e.title=o.instance.getDataAtRowProp(t,o.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{cf(ff,this).listen()},maxCols:1,autoWrapCol:!0,height:110,colWidths:()=>cf(ff,this).container.scrollWidth-Object(i["getScrollbarWidth"])(e),copyPaste:!1,disableVisualSelection:"area",fillHandle:!1,fragmentSelection:"cell",tabMoves:{row:1,col:0},layoutDirection:this.hot.isRtl()?"rtl":"ltr"})),cf(ff,this).init();const n=cf(ff,this).getShortcutManager(),r=n.getContext("grid");r.removeShortcutsByKeys(["Tab"]),r.removeShortcutsByKeys(["Shift","Tab"]),r.addShortcut({keys:[["Escape"]],callback:e=>{this.runLocalHooks("keydown",e,this)},group:df}),r.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:e=>{cf(ff,this).deselectCell(),this.runLocalHooks("keydown",e,this),this.runLocalHooks("listTabKeydown",e,this)},group:df})};r(t),this.hot._registerTimeout(()=>r(t),100)}focus(){this.isBuilt()&&cf(ff,this).listen()}reset(){cf(mf,this).reset(),cf(yf,this).reset(),cf(wf,this).reset()}update(){this.isBuilt()&&(cf(ff,this).loadData(Tf(cf(pf,this),this.options.value)),super.update())}destroy(){cf(ff,this)&&cf(ff,this).destroy(),cf(mf,this).destroy(),cf(wf,this).destroy(),cf(yf,this).destroy(),hf(mf,this,null),hf(wf,this,null),hf(yf,this,null),hf(ff,this,null),hf(pf,this,null),super.destroy()}}function Ef(e){const t=e.target.value.toLocaleLowerCase(this.getLocale());let n;n=""===t?[...cf(pf,this)]:Object(u["arrayFilter"])(cf(pf,this),e=>(""+e.value).toLocaleLowerCase(this.getLocale()).indexOf(t)>=0),cf(ff,this).loadData(n)}function Cf(e){this.runLocalHooks("keydown",e,this);const t=Object(ai["partial"])(f["isKey"],e.keyCode);t("ARROW_DOWN")&&(e.preventDefault(),Object(o["stopImmediatePropagation"])(e),cf(ff,this).listen(),cf(ff,this).selectCell(0,0))}function Sf(e){const t=[];e.preventDefault(),Object(u["arrayEach"])(cf(ff,this).getSourceData(),(e,n)=>{e.checked=!0,t.push(Object(Qp["dataRowToChangesArray"])(e,n)[0])}),cf(ff,this).setSourceDataAtCell(t)}function Rf(e){const t=[];e.preventDefault(),Object(u["arrayEach"])(cf(ff,this).getSourceData(),(e,n)=>{e.checked=!1,t.push(Object(Qp["dataRowToChangesArray"])(e,n)[0])}),cf(ff,this).setSourceDataAtCell(t)}function Tf(e,t){const n=Xp(t);return Object(u["arrayMap"])(e,e=>(e.checked=n(e.value),e))}function Of(e){const t=[];return Object(u["arrayEach"])(e,e=>{e.checked&&t.push(e.value)}),t}const Nf="by_value";function Af(e,t){let[n]=t;return n(e.value)}function If(e,t){Mf(e,t),t.add(e)}function Mf(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xf(e,t,n){return t=_f(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _f(e){var t=Lf(e,"string");return"symbol"==typeof t?t:t+""}function Lf(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function Pf(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}_u(Nf,Af,{name:"By value",inputsCount:0,inputValuesDecorator(e){let[t]=e;return[Xp(t)]},showOperators:!1});var kf,jf=new WeakSet;class Hf extends Au{constructor(e,t){super(e,{id:t.id,stateless:!1}),If(this,jf),xf(this,"name",""),this.name=t.name,this.elements.push(new vf(this.hot)),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>Pf(jf,this,Df).call(this,e)).addLocalHook("listTabKeydown",e=>this.runLocalHooks("listTabKeydown",e)),this.hot.addHook("modifyFiltersMultiSelectValue",(e,t)=>Pf(jf,this,Uf).call(this,e,t))}getElements(){const e=this.getMultipleSelectElement();return[e.getSearchInputElement(),e.getSelectAllElement(),e.getClearAllElement(),this.getMultipleSelectElement()]}setState(e){if(this.reset(),e&&e.command.key===Nf){const t=this.getMultipleSelectElement();t.setItems(e.itemsSnapshot),t.setValue(e.args[0]),t.setLocale(e.locale)}}getState(){const e=this.getMultipleSelectElement(),t=e.getItems();return{command:{key:e.isSelectedAllValues()||!t.length?Lu:Nf},args:[e.getValue()],itemsSnapshot:t}}updateState(e){const t=(t,n,r,i,o)=>{const[s]=Object(u["arrayFilter"])(n,e=>e.name===Nf),a={},l=this.hot.getTranslatedPhrase(De["FILTERS_VALUES_BLANK_CELLS"]);if(s){const n=i(t,o),c=Object(u["arrayMap"])(n,e=>e.value),h=new Map(n.map(e=>[e.value,this.hot.getCellMeta(e.meta.visualRow,e.meta.visualCol)])),d=$p(c);r&&(s.args[0]=r);const p=[],f=qp(d,s.args[0],l,e=>{e.checked&&p.push(e.value),Pf(jf,this,Ff).call(this,e,h)}),g=e.editedConditionStack.column;a.locale=this.hot.getCellMeta(0,g).locale,a.args=[p],a.command=xu(Nf),a.itemsSnapshot=f}else a.args=[],a.command=xu(Lu);this.state.setValueAtIndex(t,a)};t(e.editedConditionStack.column,e.editedConditionStack.conditions,e.conditionArgsChange,e.filteredRowsFactory),e.dependentConditionStacks.length&&t(e.dependentConditionStacks[0].column,e.dependentConditionStacks[0].conditions,e.conditionArgsChange,e.filteredRowsFactory,e.editedConditionStack)}getMultipleSelectElement(){return this.elements.filter(e=>e instanceof vf)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t,n,r,o,s)=>{Object(i["addClass"])(t.parentNode,"htFiltersMenuValue");const a=this.hot.rootDocument.createElement("div");return Object(i["addClass"])(a,"htFiltersMenuLabel"),a.textContent=s,t.appendChild(a),Object(u["arrayEach"])(this.elements,e=>t.appendChild(e.element)),t}}}reset(){const e=this.hot.getTranslatedPhrase(De["FILTERS_VALUES_BLANK_CELLS"]),t=this._getColumnVisibleValues(),n=t.map(e=>e.value),r=new Map(t.map(e=>[e.value,e.meta])),i=$p(n),o=qp(i,i,e,e=>{Pf(jf,this,Ff).call(this,e,r)});this.getMultipleSelectElement().setItems(o),super.reset(),this.getMultipleSelectElement().setValue(i);const s=this.hot.getPlugin("filters").getSelectedColumn();null!==s&&this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0,s.visualIndex).locale)}_getColumnVisibleValues(){const e=this.hot.getPlugin("filters").getSelectedColumn();return null===e?[]:Object(u["arrayMap"])(this.hot.getDataAtCol(e.visualIndex),(t,n)=>({value:Kp(t),meta:this.hot.getCellMeta(n,e.visualIndex)}))}}function Df(e){Object(f["isKey"])(e.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),Object(o["stopImmediatePropagation"])(e))}function Ff(e,t){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(e.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",e.visualValue,t.get(e.value)))}function Uf(e,t){switch(t.type){case"numeric":return ot(e,t);default:return e}}function Vf(e,t){Bf(e,t),t.add(e)}function Bf(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wf(e,t,n){return t=Gf(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gf(e){var t=zf(e,"string");return"symbol"==typeof t?t:t+""}function zf(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function Yf(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var Xf=new WeakSet;class Kf extends Au{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,t){super(e,{id:t.id,stateless:!0}),Vf(this,Xf),Wf(this,"name",""),this.name=t.name,this.elements.push(new Fd(this.hot,{type:"button",value:De["FILTERS_BUTTONS_OK"],className:"htUIButton htUIButtonOK",identifier:Kf.BUTTON_OK})),this.elements.push(new Fd(this.hot,{type:"button",value:De["FILTERS_BUTTONS_CANCEL"],className:"htUIButton htUIButtonCancel",identifier:Kf.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){Object(u["arrayEach"])(this.elements,e=>{e.addLocalHook("click",(e,t)=>Yf(Xf,this,$f).call(this,e,t))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,t)=>(Object(i["addClass"])(t.parentNode,"htFiltersMenuActionBar"),Object(u["arrayEach"])(this.elements,e=>t.appendChild(e.element)),t)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}function $f(e,t){t.options.identifier===kf.BUTTON_OK?this.accept():this.cancel()}function qf(e,t,n){return t=Qf(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qf(e){var t=Zf(e,"string");return"symbol"==typeof t?t:t+""}function Zf(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}kf=Kf;const Jf="ConditionCollection.filteringStates";class eg{constructor(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];qf(this,"hot",void 0),qf(this,"isMapRegistrable",void 0),qf(this,"filteringStates",new ci["a"]),this.hot=e,this.isMapRegistrable=t,!0===this.isMapRegistrable?this.hot.columnIndexMapper.registerMap(Jf,this.filteringStates):this.filteringStates.init(this.hot.columnIndexMapper.getNumberOfIndexes())}isEmpty(){return 0===this.getFilteredColumns().length}isMatch(e,t){var n;const r=this.filteringStates.getValueAtIndex(t),i=null!==(n=null===r||void 0===r?void 0:r.conditions)&&void 0!==n?n:[],o=null===r||void 0===r?void 0:r.operation;return this.isMatchInConditions(i,e,o)}isMatchInConditions(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:yp;return!e.length||fp(n)(e,t)}addCondition(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:yp,r=arguments.length>3?arguments[3]:void 0;const i=this.hot.getCellMeta(0,e).locale,o=Object(u["arrayMap"])(t.args,e=>"string"===typeof e?e.toLocaleLowerCase(i):e),s=t.name||t.command.key;this.runLocalHooks("beforeAdd",e);const a=this.getOperation(e);if(a){if(a!==n)throw Error(Ro["a"]`The column of index ${e} has been already applied with a \`${a}\`\x20 filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20 Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20 use it consequently for a particular column).`)}else if(Object(d["isUndefined"])(pp[n]))throw new Error(Ro["a"]`Unexpected operation named \`${n}\`. Possible ones are\x20 \`disjunction\` and \`conjunction\`.`);const l=this.getConditions(e);0===l.length?this.filteringStates.setValueAtIndex(e,{operation:n,conditions:[{name:s,args:o,func:Mu(s,o)}]},r):l.push({name:s,args:o,func:Mu(s,o)}),this.runLocalHooks("afterAdd",e)}getConditions(e){var t,n;return null!==(t=null===(n=this.filteringStates.getValueAtIndex(e))||void 0===n?void 0:n.conditions)&&void 0!==t?t:[]}getOperation(e){var t;return null===(t=this.filteringStates.getValueAtIndex(e))||void 0===t?void 0:t.operation}getFilteredColumns(){return this.filteringStates.getEntries().map(e=>{let[t]=e;return t})}getColumnStackPosition(e){return this.getFilteredColumns().indexOf(e)}exportAllConditions(){return Object(u["arrayReduce"])(this.filteringStates.getEntries(),(e,t)=>{let[n,{operation:r,conditions:i}]=t;return e.push({column:n,operation:r,conditions:Object(u["arrayMap"])(i,e=>{let{name:t,args:n}=e;return{name:t,args:n}})}),e},[])}importAllConditions(e){this.clean(),Object(u["arrayEach"])(e,e=>{Object(u["arrayEach"])(e.conditions,t=>this.addCondition(e.column,t))})}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,t){const n=this.getConditions(e);return t?n.some(e=>e.name===t):n.length>0}destroy(){this.isMapRegistrable&&this.hot.columnIndexMapper.unregisterMap(Jf),this.filteringStates=null,this.clearLocalHooks()}}Object(s["mixin"])(eg,Go["a"]);var tg=eg;function ng(e,t,n){return t=rg(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rg(e){var t=ig(e,"string");return"symbol"==typeof t?t:t+""}function ig(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class og{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>[];ng(this,"conditionCollection",void 0),ng(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=t}filter(){let e=[];return Object(u["arrayEach"])(this.conditionCollection.getFilteredColumns(),(t,n)=>{let r=this.columnDataFactory(t);n&&(r=this._getIntersectData(r,e)),e=this.filterByColumn(t,r)}),e}filterByColumn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=[];return Object(u["arrayEach"])(t,t=>{void 0!==t&&this.conditionCollection.isMatch(t,e)&&n.push(t)}),n}_getIntersectData(e,t){const n=[];return Object(u["arrayEach"])(t,t=>{const r=t.meta.visualRow;void 0!==e[r]&&(n[r]=e[r])}),n}}var sg=og;function ag(e,t){lg(e,t),t.add(e)}function lg(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function cg(e,t,n){return t=hg(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hg(e){var t=ug(e,"string");return"symbol"==typeof t?t:t+""}function ug(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function dg(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var pg=new WeakSet;class fg{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>[];ag(this,pg),cg(this,"hot",void 0),cg(this,"conditionCollection",void 0),cg(this,"columnDataFactory",void 0),cg(this,"changes",[]),cg(this,"grouping",!1),cg(this,"latestEditedColumnPosition",-1),cg(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=t,this.columnDataFactory=n,this.conditionCollection.addLocalHook("beforeRemove",e=>dg(pg,this,gg).call(this,e)),this.conditionCollection.addLocalHook("afterRemove",e=>this.updateStatesAtColumn(e)),this.conditionCollection.addLocalHook("afterAdd",e=>this.updateStatesAtColumn(e)),this.conditionCollection.addLocalHook("beforeClean",()=>dg(pg,this,mg).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>dg(pg,this,yg).call(this))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,Object(u["arrayEach"])(this.changes,e=>{this.updateStatesAtColumn(e)}),this.changes.length=0}updateStatesAtColumn(e,t){var n=this;if(this.grouping)return void(-1===this.changes.indexOf(e)&&this.changes.push(e));const r=this.conditionCollection.exportAllConditions();let i=this.conditionCollection.getColumnStackPosition(e);-1===i&&(i=this.latestEditedColumnPosition);const o=r.slice(0,i),s=r.slice(i);s.length&&s[0].column===e&&s.shift();const a=Object(ai["curry"])((function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const i=new tg(n.hot,!1),o=[].concat(e,r);i.importAllConditions(o);const s=n.columnDataFactory(t);let a;a=i.isEmpty()?s:new sg(i,e=>n.columnDataFactory(e)).filter(),a=Object(u["arrayMap"])(a,e=>e.meta.visualRow);const l=Xp(a);return i.destroy(),Object(u["arrayFilter"])(s,e=>l(e.meta.visualRow))}))(o),l=[].concat(this.conditionCollection.getConditions(e));this.runLocalHooks("update",{editedConditionStack:{column:e,conditions:l},dependentConditionStacks:s,filteredRowsFactory:a,conditionArgsChange:t})}destroy(){this.clearLocalHooks(),Object(s["objectEach"])(this,(e,t)=>{this[t]=null})}}function gg(e){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(e)}function mg(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function yg(){Object(u["arrayEach"])(this.latestOrderStack,e=>{this.updateStatesAtColumn(e)})}Object(s["mixin"])(fg,Go["a"]);var wg=fg;function bg(e){const t=Ya({initialPage:0,size:()=>e.length,onItemSelect:(t,n)=>{const r=e[t];return r instanceof vf?n:!(r.element&&!Object(i["isVisible"])(r.element))&&void r.focus()}});return t}const vg="filters";function Eg(e,t){let n=-1;const r=bg(t),i=n=>()=>{e.isOpened()&&e.getKeyboardShortcutsCtrl().listen(vg),r.setCurrentPage(t.indexOf(n))};function o(i){const o=e.getKeyboardShortcutsCtrl(),s=i.getKeyboardShortcutsCtrl();r.clear(),s.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:o.getContext(vg),callback:()=>{i.isSubMenu()&&i.close(),o.listen(vg)}}]),i.isSubMenu()||o.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:t=>{const i=e.getNavigator();i.getCurrentPage()>-1&&(n=i.getCurrentPage()),i.clear(),t.shiftKey?r.toPreviousItem():r.toNextItem()}},{keys:[["Escape"]],callback:()=>{e.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:e=>{const n=t[r.getCurrentPage()];n instanceof Jd&&(n.openOptions(),e.preventDefault()),n instanceof of&&(n.activate(),e.preventDefault()),n instanceof Md||e.preventDefault()}}],vg)}function s(){e.focus(),e.getKeyboardShortcutsCtrl().listen(vg)}function a(){return n}return t.forEach(e=>{e instanceof Md&&(e.addLocalHook("click",i(e)),e.addLocalHook("focus",i(e)),e.addLocalHook("afterClose",i(e)))}),e.addLocalHook("afterSelectionChange",e=>{e.key.startsWith("filter_")||r.clear()}),e.addLocalHook("afterSubmenuOpen",o),e.addLocalHook("afterOpen",o),{...r,listen:s,getLastMenuPage:a}}var Cg=n("00fd4");function Sg(e,t){Tg(e,t),t.add(e)}function Rg(e,t,n){Tg(e,t),t.set(e,n)}function Tg(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Og(e,t,n){return t=Ng(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ng(e){var t=Ag(e,"string");return"symbol"==typeof t?t:t+""}function Ag(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function Ig(e,t,n){return e.set(xg(e,t),n),n}function Mg(e,t){return e.get(xg(e,t))}function xg(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const _g="filters",Lg=250,Pg=_g;var kg=new WeakMap,jg=new WeakSet;class Hg extends en["a"]{static get PLUGIN_KEY(){return _g}static get PLUGIN_PRIORITY(){return Lg}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){super(e),Sg(this,jg),Og(this,"dropdownMenuPlugin",null),Og(this,"conditionCollection",null),Og(this,"conditionUpdateObserver",null),Og(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),Og(this,"filtersRowsMap",null),Rg(this,kg,void 0),this.hot.addHook("afterGetColHeader",(e,t)=>xg(jg,this,zg).call(this,e,t))}isEnabled(){return!!this.hot.getSettings()[_g]}enablePlugin(){if(this.enabled)return;this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new Cg["a"]),this.dropdownMenuPlugin=this.hot.getPlugin("dropdownMenu");const e=this.hot.getSettings().dropdownMenu,t=e&&e.uiContainer||this.hot.rootDocument.body,n=e=>(e.addLocalHook("accept",()=>xg(jg,this,Bg).call(this,"accept")),e.addLocalHook("cancel",()=>xg(jg,this,Bg).call(this,"cancel")),e.addLocalHook("change",t=>xg(jg,this,Wg).call(this,e,t)),e),r=()=>this.hot.getTranslatedPhrase(De["FILTERS_DIVS_FILTER_BY_CONDITION"])+":",i=()=>this.hot.getTranslatedPhrase(De["FILTERS_DIVS_FILTER_BY_VALUE"])+":";if(!this.components.get("filter_by_condition")){const e=new hp(this.hot,{id:"filter_by_condition",name:r,addSeparator:!1,menuContainer:t});e.addLocalHook("afterClose",()=>xg(jg,this,Gg).call(this)),this.components.set("filter_by_condition",n(e))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new Bp(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const e=new hp(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:t});e.addLocalHook("afterClose",()=>xg(jg,this,Gg).call(this)),this.components.set("filter_by_condition2",n(e))}if(this.components.get("filter_by_value")||this.components.set("filter_by_value",n(new Hf(this.hot,{id:"filter_by_value",name:i}))),this.components.get("filter_action_bar")||this.components.set("filter_action_bar",n(new Kf(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new tg(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new wg(this.hot,this.conditionCollection,e=>this.getDataMapAtColumn(e)),this.conditionUpdateObserver.addLocalHook("update",e=>xg(jg,this,Yg).call(this,e))),this.components.forEach(e=>e.show()),this.addHook("afterDropdownMenuDefaultOptions",e=>xg(jg,this,Vg).call(this,e)),this.addHook("afterDropdownMenuShow",()=>xg(jg,this,Fg).call(this)),this.addHook("afterDropdownMenuHide",()=>xg(jg,this,Ug).call(this)),this.addHook("afterChange",e=>xg(jg,this,Dg).call(this,e)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!Mg(kg,this)&&this.dropdownMenuPlugin.enabled){const e=this.dropdownMenuPlugin.menu,t=[{focus:()=>{const t=e.getNavigator(),n=Mg(kg,this).getLastMenuPage();e.focus(),n>0?t.setCurrentPage(n):t.toFirstItem()}},...Array.from(this.components).map(e=>{let[,t]=e;return t.getElements()}).flat()];Ig(kg,this,Eg(e,t));const n=e=>{Mg(kg,this).listen(),e.preventDefault(),Object(f["isKey"])(e.keyCode,"TAB")&&(e.shiftKey?Mg(kg,this).toPreviousItem():Mg(kg,this).toNextItem())};this.components.get("filter_by_value").addLocalHook("listTabKeydown",n),this.components.get("filter_by_condition").addLocalHook("selectTabKeydown",n)}this.registerShortcuts(),super.enablePlugin()}disablePlugin(){var e;this.enabled&&(null!==(e=this.dropdownMenuPlugin)&&void 0!==e&&e.enabled&&this.dropdownMenuPlugin.menu.clearLocalHooks(),this.components.forEach((e,t)=>{e.destroy(),this.components.set(t,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:Pg})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(Pg)}addCondition(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:yp;const i=this.hot.toPhysicalColumn(e);this.conditionCollection.addCondition(i,{command:{key:t},args:n},r)}removeConditions(e){const t=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(t)}clearConditions(e){if(void 0===e)this.conditionCollection.clean();else{const t=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(t)}}filter(){const{navigableHeaders:e}=this.hot.getSettings(),t=this._createDataFilter(),n=!this.conditionCollection.isEmpty();let r=[];const i=this.conditionCollection.exportAllConditions(),o=this.hot.runHooks("beforeFilter",i);if(!1!==o)if(n){const n=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear(),r=Object(u["arrayMap"])(t.filter(),e=>e.meta.visualRow);const e=Xp(r);Object(rt["rangeEach"])(this.hot.countSourceRows()-1,t=>{e(t)||n.push(t)}),Object(u["arrayEach"])(n,e=>{this.filtersRowsMap.setValueAtIndex(e,!0)})},!0),e||r.length||this.hot.deselectCell()}else this.filtersRowsMap.clear();this.hot.runHooks("afterFilter",i),this.hot.view.adjustElementsSize(!0),this.hot.render(),this.hot.selection.isSelected()&&this.hot.selectCell(e?-1:0,this.hot.getSelectedRangeLast().highlight.col)}getSelectedColumn(){var e;const t=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return t?{visualIndex:t.col,physicalIndex:this.hot.toPhysicalColumn(t.col)}:null}getDataMapAtColumn(e){const t=this.hot.toVisualColumn(e),n=[];return Object(u["arrayEach"])(this.hot.getSourceDataAtCol(t),(e,r)=>{var i;const{row:o,col:s,visualCol:a,visualRow:l,type:c,instance:h,dateFormat:u,locale:d}=this.hot.getCellMeta(r,t),p=null!==(i=this.hot.getDataAtCell(this.hot.toVisualRow(r),t))&&void 0!==i?i:e;n.push({meta:{row:o,col:s,visualCol:a,visualRow:l,type:c,instance:h,dateFormat:u,locale:d},value:Kp(p)})}),n}updateValueComponentCondition(e){const t=this.hot.getDataAtCol(e),n=$p(t);this.conditionUpdateObserver.updateStatesAtColumn(e,n)}restoreComponents(e){var t;const n=null===(t=this.getSelectedColumn())||void 0===t?void 0:t.physicalIndex;e.forEach(e=>{e.isHidden()||e.restoreState(n)}),this.updateDependentComponentsVisibility()}getOperationBasedOnArguments(e,t,n,r){let i=e;return i===vp&&t.command.key!==Lu&&n.command.key!==Lu&&r.command.key!==Lu?i=Sp:r.command.key!==Lu&&(t.command.key!==Lu&&n.command.key!==Lu||(i=yp)),i}setListeningDropdownMenu(){this.dropdownMenuPlugin&&this.dropdownMenuPlugin.setListening()}updateDependentComponentsVisibility(){const e=this.components.get("filter_by_condition"),{command:t}=e.getState(),n=[this.components.get("filter_by_condition2"),this.components.get("filter_operators")];t.showOperators?this.showComponents(...n):this.hideComponents(...n)}_createDataFilter(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.conditionCollection;return new sg(e,e=>this.getDataMapAtColumn(e))}getIndexesOfComponents(){const e=[];if(!this.dropdownMenuPlugin)return e;const t=this.dropdownMenuPlugin.menu;for(var n=arguments.length,r=new Array(n),i=0;i{Object(u["arrayEach"])(t.menuItems,(t,r)=>{t.key===n.getMenuItemDescriptor().key&&e.push(r)})}),e}changeComponentsVisibility(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!this.dropdownMenuPlugin)return;const t=this.dropdownMenuPlugin.menu,n=t.hotMenu,r=n.getPlugin("hiddenRows");for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s{null!==e&&(e.destroy(),this.components.set(t,null))}),this.conditionCollection.destroy(),this.conditionUpdateObserver.destroy(),this.hot.rowIndexMapper.unregisterMap(this.pluginName)),super.destroy()}}function Dg(e){e&&Object(u["arrayEach"])(e,e=>{const[,t]=e,n=this.hot.propToCol(t);this.conditionCollection.hasConditions(n)&&this.updateValueComponentCondition(n)})}function Fg(){this.restoreComponents(Array.from(this.components.values()))}function Ug(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function Vg(e){e.items.push({name:Zo}),this.components.forEach(t=>{e.items.push(t.getMenuItemDescriptor())})}function Bg(e){var t;if("accept"===e){const e=this.getSelectedColumn();var n;if(null===e)return void(null===(n=this.dropdownMenuPlugin)||void 0===n||n.close());const{physicalIndex:t}=e,r=this.components.get("filter_by_condition").getState(),i=this.components.get("filter_by_condition2").getState(),o=this.components.get("filter_by_value").getState(),s=this.getOperationBasedOnArguments(this.components.get("filter_operators").getActiveOperationId(),r,i,o);this.conditionUpdateObserver.groupChanges();let a=this.conditionCollection.getColumnStackPosition(t);-1===a&&(a=void 0),this.conditionCollection.removeConditions(t),r.command.key!==Lu&&(this.conditionCollection.addCondition(t,r,s,a),i.command.key!==Lu&&this.conditionCollection.addCondition(t,i,s,a)),o.command.key!==Lu&&this.conditionCollection.addCondition(t,o,s,a),this.conditionUpdateObserver.flush(),this.components.forEach(e=>e.saveState(t)),this.filtersRowsMap.clear(),this.filter()}null===(t=this.dropdownMenuPlugin)||void 0===t||t.close()}function Wg(e,t){this.updateDependentComponentsVisibility(),e.constructor!==hp||t.inputsCount||this.setListeningDropdownMenu()}function Gg(){this.setListeningDropdownMenu()}function zg(e,t){const n=this.hot.toPhysicalColumn(e);this.enabled&&this.conditionCollection.hasConditions(n)?Object(i["addClass"])(t,"htFiltersActive"):Object(i["removeClass"])(t,"htFiltersActive")}function Yg(e){var t;if(null===(t=this.dropdownMenuPlugin)||void 0===t||!t.enabled)return;const{editedConditionStack:{conditions:n,column:r}}=e,i=n.filter(e=>e.name===Nf),o=n.filter(e=>e.name!==Nf);if(i.length>=2||o.length>=3)Object(Dr["b"])(Ro["a"]`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20 The overall amount of conditions exceed the capability of the dropdown menu.\x20 For more details see the documentation.`);else{const t=this.conditionCollection.getOperation(r);this.components.get("filter_by_condition").updateState(o[0],r),this.components.get("filter_by_condition2").updateState(o[1],r),this.components.get("filter_operators").updateState(t,r),this.components.get("filter_by_value").updateState(e)}}n("5b82");const Xg="internal-use-in-handsontable",Kg={licenseKey:Xg,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 $g(e){var t;return{maxColumns:e.maxColumns,maxRows:e.maxRows,language:null===(t=e[sy])||void 0===t||null===(t=t.language)||void 0===t?void 0:t.langCode}}function qg(e){return Object.keys(e).reduce((t,n)=>("hyperformula"!==n&&(t[n]=e[n]),t),{})}function Qg(e){var t;const n=e[sy],r=qg(null!==n&&void 0!==n&&null!==(t=n.engine)&&void 0!==t&&t.hyperformula?n.engine:{}),i=$g(e);return{...Kg,...r,...i}}function Zg(e){var t;const n=e[sy],r=qg(null!==n&&void 0!==n&&null!==(t=n.engine)&&void 0!==t&&t.hyperformula?n.engine:{}),i=$g(e);return{...r,...i}}function Jg(e,t){return Object.keys(t).some(n=>void 0!==t[n]&&t[n]!==e[n])}function em(){const e="engine_relationship",t=Object(Xi["a"])(sy);return t.hasItem(e)||t.register(e,new Map),t.getItem(e)}function tm(){const e="shared_engine_usage",t=Object(Xi["a"])(sy);return t.hasItem(e)||t.register(e,new Map),t.getItem(e)}function nm(e){const t=e.getSettings(),n=t[sy],r=null===n||void 0===n?void 0:n.engine;if(!0===n)return null;if(Object(d["isUndefined"])(r))return null;var i;if("function"===typeof r.hyperformula||"function"===typeof r)return rm(null!==(i=r.hyperformula)&&void 0!==i?i:r,t,e);if("object"===typeof r&&Object(d["isUndefined"])(r.hyperformula)){const t=em(),n=tm().get(r);return t.has(r)||t.set(r,[]),t.get(r).push(e),n&&n.push(e.guid),r.getConfig().licenseKey||r.updateConfig({licenseKey:Xg}),r.getConfig().leapYear1900===Kg.leapYear1900&&!1!==Object(s["isObjectEqual"])(r.getConfig().nullDate,Kg.nullDate)||Object(Dr["b"])(Ro["a"]`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\` settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),r}return null}function rm(e,t,n){const r=t[sy],i=Qg(t),o=em(),s=tm();sm(e,r.functions),am(e,r.language);const a=e.buildEmpty(i);return o.set(a,[n]),s.set(a,[n.guid]),lm(a,r.namedExpressions),a.on("sheetAdded",()=>{a.rebuildAndRecalculate()}),a.on("sheetRemoved",()=>{a.rebuildAndRecalculate()}),a}function im(e){var t;const n=em(),r=0===n.size?[]:Array.from(null!==(t=n.get(e))&&void 0!==t?t:[]);return new Map(r.map(e=>[e.getPlugin("formulas").sheetId,e]))}function om(e,t){if(e){const n=em(),r=n.get(e),i=tm(),o=i.get(e);r&&r.includes(t)&&(r.splice(r.indexOf(t),1),0===r.length&&n.delete(e)),o&&o.includes(t.guid)&&(o.splice(o.indexOf(t.guid),1),0===o.length&&(i.delete(e),e.destroy()))}}function sm(e,t){t&&t.forEach(t=>{const{name:n,plugin:r,translations:i}=t;try{e.registerFunction(n,r,i)}catch(o){Object(Dr["b"])(o.message)}})}function am(e,t){if(t){const{langCode:r}=t;try{e.registerLanguage(r,t)}catch(n){Object(Dr["b"])(n.message)}}}function lm(e,t){t&&(e.suspendEvaluation(),t.forEach(t=>{const{name:n,expression:r,scope:i,options:o}=t;try{e.addNamedExpression(n,r,i,o)}catch(s){Object(Dr["b"])(s.message)}}),e.resumeEvaluation())}function cm(e,t){return!Object(d["isUndefined"])(t)&&e.doesSheetExist(t)||(t=e.addSheet(t)),t}const hm="DD/MM/YYYY";function um(e){return"string"===typeof e&&"'"===e.charAt(0)&&"="===e.charAt(1)}function dm(e){return um(e)?e.substr(1):e}function pm(e){return"string"===typeof e&&e.startsWith("=")}function fm(e,t){return"string"===typeof e&&"date"===t}function gm(e,t){return x(e,t,!0).isValid()}function mm(e,t){return x(e,t,!0).format(hm)}function ym(e,t){return x(e,hm,!0).format(t)}function wm(e,t){const n=-1,r=new Date(Date.UTC(0,0,e+n));return x(r).format(t)}function bm(e,t,n){const r=Array.from(Array(n).keys()).filter(t=>!1===e.includes(t));var i;return 0===t?null!==(i=r[t])&&void 0!==i?i:0:r[t-1]+1}function vm(e,t){const n=[];return e.forEach(e=>{const r={from:e,to:t};n.forEach(e=>{const t=e.from>e.to,n=e.to<=r.from,i=e.from>r.from;i&&n&&t&&(r.from+=1)}),r.from>=t&&(t+=1),n.push(r)}),n}function Em(e){return e.forEach((t,n)=>{const r=e.slice(n+1);r.forEach(e=>{const n=e.fromt.from&&n&&(e.from-=1)})}),e}function Cm(e,t,n){const r=vm(e,bm(e,t,n));return Em(r)}function Sm(e,t,n){Rm(e,t),t.set(e,n)}function Rm(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Tm(e,t){return e.get(Nm(e,t))}function Om(e,t,n){return e.set(Nm(e,t),n),n}function Nm(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var Am=new WeakMap,Im=new WeakMap,Mm=new WeakMap,xm=new WeakMap,_m=new WeakMap,Lm=new WeakMap,Pm=new WeakMap;class km{constructor(e,t,n){Sm(this,Am,void 0),Sm(this,Im,void 0),Sm(this,Mm,void 0),Sm(this,xm,[]),Sm(this,_m,[]),Sm(this,Lm,void 0),Sm(this,Pm,[]),Om(Am,this,e),Om(Im,this,t),Om(Mm,this,n)}setRemovedHfIndexes(e){return Om(Pm,this,e.map(e=>{const t=Tm(Im,this).getVisualFromPhysicalIndex(e);return this.getHfIndexFromVisualIndex(t)})),Tm(Pm,this)}getRemovedHfIndexes(){return Tm(Pm,this)}getHfIndexFromVisualIndex(e){const t=Tm(Im,this).getIndexesSequence(),n=Tm(Im,this).getNotTrimmedIndexes();return t.indexOf(n[e])}syncMoves(e){const t=1,n=`move${Object(p["toUpperCaseFirst"])(Tm(Am,this))}s`;Tm(Mm,this).getEngine().batch(()=>{e.forEach(e=>{const r=e.from!==e.to,i=e.from+1!==e.to;r&&i&&Tm(Mm,this).getEngine()[n](Tm(Mm,this).getSheetId(),e.from,t,e.to)})})}storeMovesInformation(e,t,n){!1!==n&&(Om(_m,this,e.map(e=>this.getHfIndexFromVisualIndex(e))),Om(Lm,this,this.getHfIndexFromVisualIndex(t)))}calculateAndSyncMoves(e,t){if(Tm(Mm,this).isPerformingUndoRedo())return;if(!1===e||!1===t)return;const n=Cm(Tm(_m,this),Tm(Lm,this),Tm(Im,this).getNumberOfIndexes());null===Tm(Mm,this).getSheetId()?Tm(Mm,this).getPostponeAction(()=>this.syncMoves(n)):this.syncMoves(n)}getIndexesChangeSyncMethod(){const e=`set${Object(p["toUpperCaseFirst"])(Tm(Am,this))}Order`;return t=>{if(Tm(Mm,this).isPerformingUndoRedo())return;const n=Tm(Im,this).getIndexesSequence();if("update"===t&&n.length>0){const t=Tm(xm,this).map(e=>n.indexOf(e)),r=Tm(Mm,this).getEngine().getSheetDimensions(Tm(Mm,this).getSheetId());let i;i="row"===Tm(Am,this)?r.height:r.width;const o=t.length;for(let e=o;e"UndoRedo.undo"===e||"UndoRedo.redo"===e||"auto"===e;var hy=new WeakMap,uy=new WeakMap,dy=new WeakMap,py=new WeakSet;class fy extends en["a"]{constructor(){var e;super(...arguments),e=this,Qm(this,py),ty(this,hy,!1),ty(this,uy,!1),ty(this,dy,[["valuesUpdated",function(){for(var t=arguments.length,n=new Array(t),r=0;r{this.hot.addHookOnce("init",()=>{e()})}),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",(e,t,n,r)=>{this.rowAxisSyncer.storeMovesInformation(e,t,r)}),this.hot.addHook("beforeColumnMove",(e,t,n,r)=>{this.columnAxisSyncer.storeMovesInformation(e,t,r)}),this.hot.addHook("afterRowMove",(e,t,n,r,i)=>{this.rowAxisSyncer.calculateAndSyncMoves(r,i)}),this.hot.addHook("afterColumnMove",(e,t,n,r,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(r,i)}),this.hot.addHook("beforeColumnFreeze",(e,t)=>{this.columnAxisSyncer.storeMovesInformation([e],this.hot.getSettings().fixedColumnsStart,t)}),this.hot.addHook("afterColumnFreeze",(e,t)=>{this.columnAxisSyncer.calculateAndSyncMoves(t,t)}),this.hot.addHook("beforeColumnUnfreeze",(e,t)=>{this.columnAxisSyncer.storeMovesInformation([e],this.hot.getSettings().fixedColumnsStart-1,t)}),this.hot.addHook("afterColumnUnfreeze",(e,t)=>{this.columnAxisSyncer.calculateAndSyncMoves(t,t)}),this.addHook("afterCellMetaReset",(function(){for(var e=arguments.length,n=new Array(e),r=0;r{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 e=arguments.length,n=new Array(e),r=0;r{let[t,n]=e;return this.engine.on(t,n)}),super.enablePlugin()}else Object(Dr["b"])("Missing the required `engine` key in the Formulas settings. Please fill it with either an engine class or an engine instance.")}disablePlugin(){iy(dy,this).forEach(e=>{let[t,n]=e;return this.engine.off(t,n)}),om(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const t=Zg(this.hot.getSettings());Jg(this.engine.getConfig(),t)&&this.engine.updateConfig(t);const n=this.hot.getSettings()[sy];if(Object(d["isDefined"])(n)&&Object(d["isDefined"])(n.sheetName)&&n.sheetName!==this.sheetName&&this.switchSheet(n.sheetName),!e.data&&null===this.sheetName){const e=this.hot.getSettings()[sy].sheetName;e&&this.engine.doesSheetExist(e)?this.switchSheet(this.sheetName):this.sheetName=this.addSheet(null!==e&&void 0!==e?e:void 0,this.hot.getSourceDataArray())}super.updatePlugin(e)}destroy(){iy(dy,this).forEach(e=>{var t;let[n,r]=e;return null===(t=this.engine)||void 0===t?void 0:t.off(n,r)}),ry(dy,this,null),om(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,t){if(Object(d["isDefined"])(t)&&!Object(Qp["isArrayOfArrays"])(t))return Object(Dr["b"])("The provided data should be an array of arrays."),!1;if(void 0!==e&&null!==e&&this.engine.doesSheetExist(e))return Object(Dr["b"])("Sheet with the provided name already exists."),!1;try{const n=this.engine.addSheet(null!==e&&void 0!==e?e:void 0);return t&&this.engine.setSheetContent(this.engine.getSheetId(n),t),n}catch(n){return Object(Dr["b"])(n.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e))return void Object(Dr["a"])(`The sheet named \`${e}\` does not exist, switch aborted.`);this.sheetName=e;const t=this.engine.getSheetSerialized(this.sheetId);t.length>0&&this.hot.loadData(t,Object(p["toUpperCaseFirst"])(sy)+".switchSheet")}getCellType(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.sheetId;const r=this.hot.toPhysicalRow(e),i=this.hot.toPhysicalColumn(t);return null!==r&&null!==i?this.engine.getCellType({sheet:n,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t)}):"EMPTY"}isFormulaCellType(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.sheetId;return this.engine.doesCellHaveFormula({sheet:n,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t)})}renderDependentSheets(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=new Set;e.forEach(e=>{var t;const r=null===e||void 0===e||null===(t=e.address)||void 0===t?void 0:t.sheet;void 0!==r&&(n.has(r)||n.add(r))}),im(this.engine).forEach((e,r)=>{var i;(t||r!==this.sheetId)&&n.has(r)&&(e.render(),null===(i=e.view)||void 0===i||i.adjustElementsSize())})}validateDependentCells(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=e=>{var t;const{row:n,col:r,sheet:i}=null!==(t=null===e||void 0===e?void 0:e.address)&&void 0!==t?t:{};return Object(d["isDefined"])(i)?`${i}:${n}x${r}`:""},r=new Set(t.map(e=>n(e)));e.forEach(e=>{var t,i;const{row:o,col:s}=null!==(t=e.address)&&void 0!==t?t:{};if(!1===Object(d["isDefined"])(o)||!1===Object(d["isDefined"])(s)||o>=this.hot.countRows()||s>=this.hot.countCols())return;const a=null===e||void 0===e||null===(i=e.address)||void 0===i?void 0:i.sheet,l=n(e);if(void 0!==a&&!r.has(l)){const e=im(this.engine).get(a);if(!e)return;e.validateCell(e.getDataAtCell(o,s),e.getCellMeta(o,s),()=>{})}})}syncChangeWithEngine(e,t,n){const r={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(r))return void Object(Dr["b"])("Not possible to set cell data at "+JSON.stringify(r));const i=this.hot.getCellMeta(e,t);return fm(n,i.type)&&(gm(n,i.dateFormat)?n=mm(n,i.dateFormat):!1===pm(n)&&(n="'"+n)),this.engine.setCellContents(r,n)}}function gy(e,t,n){const r=this.hot.propToCol(n);if(this.isFormulaCellType(t,r)){const e={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(t),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r),sheet:this.sheetId},n=this.hot.getCellMeta(t,r);let i=this.engine.getCellValue(e);return"date"===n.type&&Object(rt["isNumeric"])(i)&&(i=wm(i,n.dateFormat)),"object"===typeof i&&null!==i?i.value:i}return e}function my(e,t,n){const{row:r,col:i}=t.getTopStartCorner(),{row:o,col:s}=t.getBottomEndCorner(),{row:a,col:l}=n.getTopStartCorner(),{row:c,col:h}=n.getBottomEndCorner(),u={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(r),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(i),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),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(h),sheet:this.sheetId}};if(!1===this.engine.isItPossibleToSetCellContents(d))return!1;const p=this.engine.getFillRangeData(u,d),{row:f,col:g}=u.start,{row:m,col:y}=u.end,w=m-f+1,b=y-g+1;for(let v=0;v2&&void 0!==arguments[2]?arguments[2]:"";n.includes(Object(p["toUpperCaseFirst"])(sy))||ry(uy,this,Object(d["isUndefined"])(this.hot.getSettings().data))}function wy(){const e=this.hot.getSourceDataArray();let t=!1;e.forEach((n,r)=>{n.forEach((n,i)=>{const o=this.hot.getCellMeta(r,i),s=o.dateFormat;fm(n,o.type)&&(t=!0,gm(n,s)?e[r][i]=mm(n,s):!1===this.isFormulaCellType(r,i)&&(e[r][i]="'"+n))})}),!0===t&&(ry(hy,this,!0),this.engine.setSheetContent(this.sheetId,e),ry(hy,this,!1))}function by(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(!n.includes(Object(p["toUpperCaseFirst"])(sy)))if(this.sheetName=cm(this.engine,this.hot.getSettings()[sy].sheetName),iy(uy,this))this.switchSheet(this.sheetName);else{const e=this.hot.getSourceDataArray();if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,e)){ry(hy,this,!0);const t=this.engine.setSheetContent(this.sheetId,e);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(t),ry(hy,this,!1)}}}function vy(e,t,n,r){if("get"!==r||iy(hy,this)||null===this.sheetName||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(e);if(null===i||null===t)return;const o=this.isFormulaCellType(i,t);if(!o){const e=this.getCellType(i,t);if("ARRAY"!==e)return void(um(n.value)&&(n.value=dm(n.value)))}const s={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(t),sheet:this.sheetId};let a=this.engine.getCellValue(s),l=this.hot.getCellsMeta().find(e=>e.visualRow===i&&e.visualCol===t);void 0===l&&(l={}),"date"===l.type&&Object(rt["isNumeric"])(a)&&(a=wm(a,l.dateFormat));const c="object"===typeof a&&null!==a?a.value:a;n.value=c}function Ey(e,t,n,r){if("get"!==r||iy(hy,this)||null===this.sheetName||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(e),o=this.hot.propToCol(t);if(null===i||null===o)return;const s=this.isFormulaCellType(i,o);if(!s){const e=this.getCellType(i,o);if("ARRAY"!==e)return}const a=this.engine.getSheetDimensions(this.engine.getSheetId(this.sheetName));if(0===a.width&&0===a.height)return;const l={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(o),sheet:this.sheetId};n.value=this.engine.getCellSerialized(l)}function Cy(e,t){if(cy(t))return;const n=[],r=[],i=this.engine.batch(()=>{e.forEach(e=>{let[t,i,,o]=e;const s=this.hot.propToCol(i),a=this.hot.toPhysicalRow(t),l=this.hot.toPhysicalColumn(s),c={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(t),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),sheet:this.sheetId};null!==a&&null!==l?this.syncChangeWithEngine(t,s,o):n.push([t,s,o]),r.push({address:c})})});n.length&&this.hot.addHookOnce("afterChange",()=>{const e=this.engine.batch(()=>{n.forEach(e=>{let[t,n,r]=e;this.syncChangeWithEngine(t,n,r)})});this.renderDependentSheets(e,!0)}),this.renderDependentSheets(i),this.validateDependentCells(i,r)}function Sy(e,t){if(cy(t))return;const n=[],r=[];e.forEach(e=>{let[t,i,,o]=e;const s=this.hot.propToCol(i);if(!Object(rt["isNumeric"])(s))return;const a={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(t),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),sheet:this.sheetId};this.engine.isItPossibleToSetCellContents(a)?(r.push({address:a}),n.push(...this.engine.setCellContents(a,o))):Object(Dr["b"])("Not possible to set source cell data at "+JSON.stringify(a))}),this.renderDependentSheets(n),this.validateDependentCells(n,r)}function Ry(e,t){let n=this.rowAxisSyncer.getHfIndexFromVisualIndex(e);if(e>=this.hot.countRows()&&(n=e),null===this.sheetId||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddRows(this.sheetId,[n,t]))return!1}function Ty(e,t){let n=this.columnAxisSyncer.getHfIndexFromVisualIndex(e);if(e>=this.hot.countCols()&&(n=e),null===this.sheetId||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddColumns(this.sheetId,[n,t]))return!1}function Oy(e,t,n){const r=this.rowAxisSyncer.setRemovedHfIndexes(n),i=r.every(e=>this.engine.isItPossibleToRemoveRows(this.sheetId,[e,1]));return!1!==i&&void 0}function Ny(e,t,n){const r=this.columnAxisSyncer.setRemovedHfIndexes(n),i=r.every(e=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[e,1]));return!1!==i&&void 0}function Ay(e,t,n){if(cy(n))return;const r=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(e),t]);this.renderDependentSheets(r)}function Iy(e,t,n){if(cy(n))return;const r=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(e),t]);this.renderDependentSheets(r)}function My(e,t,n,r){if(cy(r))return;const i=this.rowAxisSyncer.getRemovedHfIndexes().sort().reverse(),o=this.engine.batch(()=>{i.forEach(e=>{this.engine.removeRows(this.sheetId,[e,1])})});this.renderDependentSheets(o)}function xy(e,t,n,r){if(cy(r))return;const i=this.columnAxisSyncer.getRemovedHfIndexes().sort().reverse(),o=this.engine.batch(()=>{i.forEach(e=>{this.engine.removeColumns(this.sheetId,[e,1])})});this.renderDependentSheets(o)}function _y(e,t,n){var r;ry(hy,this,!0);const i=this.hot.getSourceDataArray(n,0,n+((null===(r=t.__children)||void 0===r?void 0:r.length)||0),this.hot.countSourceCols());ry(hy,this,!1),i.forEach((e,t)=>{e.forEach((e,r)=>{this.engine.setCellContents({col:r,row:n+t,sheet:this.sheetId},[[e]])})})}function Ly(e){this.hot.runHooks("afterFormulasValuesUpdate",e)}function Py(e,t){this.hot.runHooks("afterNamedExpressionAdded",e,t)}function ky(e,t){this.hot.runHooks("afterNamedExpressionRemoved",e,t)}function jy(e){this.hot.runHooks("afterSheetAdded",e)}function Hy(e,t){this.sheetName=t,this.hot.runHooks("afterSheetRenamed",e,t)}function Dy(e,t){this.hot.runHooks("afterSheetRemoved",e,t)}function Fy(e){return{key:"hidden_columns_hide",name(){const e=this.getSelectedLast();let t=0;if(Array.isArray(e)){const[,n,,r]=e;n-r!==0&&(t=1)}return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_HIDE_COLUMN"],t)},callback(){const{from:t,to:n}=this.getSelectedRangeLast(),r=Math.max(Math.min(t.col,n.col),0),i=Math.max(t.col,n.col),o=[];for(let e=r;e<=i;e+=1)o.push(e);e.hideColumns(o);const s=o[o.length-1],a=this.columnIndexMapper.getNearestNotHiddenIndex(s,1,!0);Number.isInteger(a)&&a>=0?this.selectColumns(a):this.deselectCell(),this.render(),this.view.adjustElementsSize(!0)},disabled:!1,hidden(){return!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())}}}function Uy(e){const t=[];return{key:"hidden_columns_show",name(){const e=t.length>1?1:0;return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_SHOW_COLUMN"],e)},callback(){var n,r;if(0===t.length)return;let i=t[0],o=t[t.length-1];i=null!==(n=this.columnIndexMapper.getNearestNotHiddenIndex(i-1,-1))&&void 0!==n?n:0,o=null!==(r=this.columnIndexMapper.getNearestNotHiddenIndex(o+1,1))&&void 0!==r?r:this.countCols()-1,e.showColumns(t),this.render(),this.view.adjustElementsSize(!0);const s=o-i+1===this.countCols();s||this.selectColumns(i,o)},disabled:!1,hidden(){const n=Object(u["arrayMap"])(e.getHiddenColumns(),e=>this.toPhysicalColumn(e));if(!this.selection.isSelectedByColumnHeader()&&!this.selection.isSelectedByCorner()||n.length<1)return!0;t.length=0;const r=this.getSelectedRangeLast(),i=r.getTopStartCorner().col,o=r.getBottomEndCorner().col,s=this.columnIndexMapper,a=s.getRenderableFromVisualIndex(i),l=s.getRenderableFromVisualIndex(o),c=s.getNotTrimmedIndexes(),h=[];if(i!==o){const e=o-i+1,t=l-a+1;if(e>t){const e=c.slice(i,o+1);h.push(...e.filter(e=>n.includes(e)))}}else if(0===a&&ao&&h.push(...c.slice(o+1))}return Object(u["arrayEach"])(h,e=>{t.push(this.toVisualColumn(e))}),0===t.length}}}var Vy=n("cef7");function By(e,t){Gy(e,t),t.add(e)}function Wy(e,t,n){Gy(e,t),t.set(e,n)}function Gy(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zy(e,t){return e.get(Xy(e,t))}function Yy(e,t,n){return e.set(Xy(e,t),n),n}function Xy(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}fe["a"].getSingleton().register("beforeHideColumns"),fe["a"].getSingleton().register("afterHideColumns"),fe["a"].getSingleton().register("beforeUnhideColumns"),fe["a"].getSingleton().register("afterUnhideColumns");const Ky="hiddenColumns",$y=310;var qy=new WeakMap,Qy=new WeakMap,Zy=new WeakSet;class Jy extends en["a"]{constructor(){super(...arguments),By(this,Zy),Wy(this,qy,{}),Wy(this,Qy,null)}static get PLUGIN_KEY(){return Ky}static get PLUGIN_PRIORITY(){return $y}isEnabled(){return!!this.hot.getSettings()[Ky]}enablePlugin(){var e=this;if(this.enabled)return;const t=this.hot.getSettings()[Ky];Object(s["isObject"])(t)&&(Yy(qy,this,t),Object(d["isUndefined"])(t.copyPasteEnabled)&&(t.copyPasteEnabled=!0)),Yy(Qy,this,new Vy["a"]),zy(Qy,this).addLocalHook("init",()=>Xy(Zy,this,ow).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,zy(Qy,this)),this.addHook("afterContextMenuDefaultOptions",(function(){for(var t=arguments.length,n=new Array(t),r=0;rXy(Zy,this,tw).call(this,e,t,n)),this.addHook("modifyColWidth",(e,t)=>Xy(Zy,this,ew).call(this,e,t)),this.addHook("afterGetColHeader",(function(){for(var t=arguments.length,n=new Array(t),r=0;rXy(Zy,this,nw).call(this,e)),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),Yy(qy,this,{}),super.disablePlugin(),this.resetCellsMeta()}showColumns(e){const t=this.getHiddenColumns(),n=this.isValidConfig(e);let r=t;const i=zy(Qy,this).getValues().slice(),o=e.length>0;if(n&&o){const t=e.map(e=>this.hot.toPhysicalColumn(e));Object(u["arrayEach"])(t,e=>{i[e]=!1}),r=Object(u["arrayReduce"])(i,(e,t,n)=>(t&&e.push(this.hot.toVisualColumn(n)),e),[])}const s=this.hot.runHooks("beforeUnhideColumns",t,r,n&&o);!1!==s&&(n&&o&&zy(Qy,this).setValues(i),this.hot.view.adjustElementsSize(),this.hot.runHooks("afterUnhideColumns",t,r,n&&o,n&&r.length{Object(u["arrayEach"])(e,e=>{zy(Qy,this).setValueAtIndex(this.hot.toPhysicalColumn(e),!0)})},!0),this.hot.runHooks("afterHideColumns",t,r,n,n&&r.length>t.length))}hideColumn(){for(var e=arguments.length,t=new Array(e),n=0;nthis.hot.toVisualColumn(e))}isHidden(e){return zy(Qy,this).getValueAtIndex(this.hot.toPhysicalColumn(e))||!1}isValidConfig(e){const t=this.hot.countCols();return!!(Array.isArray(e)&&e.length>0)&&e.every(e=>Number.isInteger(e)&&e>=0&&e{e&&(e.skipColumnOnPaste=!1)})}destroy(){Yy(qy,this,null),Yy(Qy,this,null),super.destroy()}}function ew(e,t){return this.isHidden(t)?0:zy(qy,this).indicators&&(this.isHidden(t+1)||this.isHidden(t-1))&&"number"===typeof e&&this.hot.hasColHeaders()?e+15:void 0}function tw(e,t,n){if(!1===zy(qy,this).copyPasteEnabled&&this.isHidden(t)&&(n.skipColumnOnPaste=!0),this.isHidden(t-1))n.className=n.className||"",-1===n.className.indexOf("afterHiddenColumn")&&(n.className+=" afterHiddenColumn");else if(n.className){const e=n.className.split(" ");if(e.length>0){const t=e.indexOf("afterHiddenColumn");t>-1&&e.splice(t,1),n.className=e.join(" ")}}}function nw(e){if(zy(qy,this).copyPasteEnabled)return e;const t=[],n=(e,n,r,i)=>{t.push({startRow:e,endRow:n,startCol:r,endCol:i})};return Object(u["arrayEach"])(e,e=>{let t=!0,r=0;Object(rt["rangeEach"])(e.startCol,e.endCol,i=>{this.isHidden(i)?(t||n(e.startRow,e.endRow,r,i-1),t=!0):(t&&(r=i),i===e.endCol&&n(e.startRow,e.endRow,r,i),t=!1)})}),t}function rw(e,t){if(!zy(qy,this).indicators||e<0)return;const n=[];e>=1&&this.isHidden(e-1)&&n.push("afterHiddenColumn"),e=0?this.selectRows(a):this.deselectCell(),this.render(),this.view.adjustElementsSize(!0)},disabled:!1,hidden(){return!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())}}}function aw(e){const t=[];return{key:"hidden_rows_show",name(){const e=t.length>1?1:0;return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_SHOW_ROW"],e)},callback(){var n,r;if(0===t.length)return;let i=t[0],o=t[t.length-1];i=null!==(n=this.rowIndexMapper.getNearestNotHiddenIndex(i-1,-1))&&void 0!==n?n:0,o=null!==(r=this.rowIndexMapper.getNearestNotHiddenIndex(o+1,1))&&void 0!==r?r:this.countRows()-1,e.showRows(t),this.render(),this.view.adjustElementsSize(!0);const s=o-i+1===this.countRows();s||this.selectRows(i,o)},disabled:!1,hidden(){const n=Object(u["arrayMap"])(e.getHiddenRows(),e=>this.toPhysicalRow(e));if(!this.selection.isSelectedByRowHeader()&&!this.selection.isSelectedByCorner()||n.length<1)return!0;t.length=0;const r=this.getSelectedRangeLast(),i=r.getTopStartCorner().row,o=r.getBottomEndCorner().row,s=this.rowIndexMapper,a=s.getRenderableFromVisualIndex(i),l=s.getRenderableFromVisualIndex(o),c=s.getNotTrimmedIndexes(),h=[];if(i!==o){const e=o-i+1,t=l-a+1;if(e>t){const e=c.slice(i,o+1);h.push(...e.filter(e=>n.includes(e)))}}else if(0===a&&ao&&h.push(...c.slice(o+1))}return Object(u["arrayEach"])(h,e=>{t.push(this.toVisualRow(e))}),0===t.length}}}function lw(e,t){hw(e,t),t.add(e)}function cw(e,t,n){hw(e,t),t.set(e,n)}function hw(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function uw(e,t){return e.get(pw(e,t))}function dw(e,t,n){return e.set(pw(e,t),n),n}function pw(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}fe["a"].getSingleton().register("beforeHideRows"),fe["a"].getSingleton().register("afterHideRows"),fe["a"].getSingleton().register("beforeUnhideRows"),fe["a"].getSingleton().register("afterUnhideRows");const fw="hiddenRows",gw=320;var mw=new WeakMap,yw=new WeakMap,ww=new WeakSet;class bw extends en["a"]{constructor(){super(...arguments),lw(this,ww),cw(this,mw,{}),cw(this,yw,null)}static get PLUGIN_KEY(){return fw}static get PLUGIN_PRIORITY(){return gw}isEnabled(){return!!this.hot.getSettings()[fw]}enablePlugin(){var e=this;if(this.enabled)return;const t=this.hot.getSettings()[fw];Object(s["isObject"])(t)&&(dw(mw,this,t),Object(d["isUndefined"])(t.copyPasteEnabled)&&(t.copyPasteEnabled=!0)),dw(yw,this,new Vy["a"]),uw(yw,this).addLocalHook("init",()=>pw(ww,this,Tw).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,uw(yw,this)),this.addHook("afterContextMenuDefaultOptions",(function(){for(var t=arguments.length,n=new Array(t),r=0;rpw(ww,this,Ew).call(this,e,t,n)),this.addHook("modifyRowHeight",(e,t)=>pw(ww,this,vw).call(this,e,t)),this.addHook("afterGetRowHeader",(function(){for(var t=arguments.length,n=new Array(t),r=0;rpw(ww,this,Cw).call(this,e)),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap(this.pluginName),dw(mw,this,{}),super.disablePlugin(),this.resetCellsMeta()}showRows(e){const t=this.getHiddenRows(),n=this.isValidConfig(e);let r=t;const i=uw(yw,this).getValues().slice(),o=e.length>0;if(n&&o){const t=e.map(e=>this.hot.toPhysicalRow(e));Object(u["arrayEach"])(t,e=>{i[e]=!1}),r=Object(u["arrayReduce"])(i,(e,t,n)=>(t&&e.push(this.hot.toVisualRow(n)),e),[])}const s=this.hot.runHooks("beforeUnhideRows",t,r,n&&o);!1!==s&&(n&&o&&uw(yw,this).setValues(i),this.hot.runHooks("afterUnhideRows",t,r,n&&o,n&&r.length{Object(u["arrayEach"])(e,e=>{uw(yw,this).setValueAtIndex(this.hot.toPhysicalRow(e),!0)})},!0),this.hot.runHooks("afterHideRows",t,r,n,n&&r.length>t.length))}hideRow(){for(var e=arguments.length,t=new Array(e),n=0;nthis.hot.toVisualRow(e))}isHidden(e){return uw(yw,this).getValueAtIndex(this.hot.toPhysicalRow(e))||!1}isValidConfig(e){const t=this.hot.countRows();return!!(Array.isArray(e)&&e.length>0)&&e.every(e=>Number.isInteger(e)&&e>=0&&e{e&&(e.skipRowOnPaste=!1)})}destroy(){dw(mw,this,null),dw(yw,this,null),super.destroy()}}function vw(e,t){return this.isHidden(t)?0:e}function Ew(e,t,n){if(!1===uw(mw,this).copyPasteEnabled&&this.isHidden(e)&&(n.skipRowOnPaste=!0),this.isHidden(e-1))n.className=n.className||"",-1===n.className.indexOf("afterHiddenRow")&&(n.className+=" afterHiddenRow");else if(n.className){const e=n.className.split(" ");if(e.length>0){const t=e.indexOf("afterHiddenRow");t>-1&&e.splice(t,1),n.className=e.join(" ")}}}function Cw(e){if(uw(mw,this).copyPasteEnabled)return e;const t=[],n=(e,n,r,i)=>{t.push({startRow:e,endRow:n,startCol:r,endCol:i})};return Object(u["arrayEach"])(e,e=>{let t=!0,r=0;Object(rt["rangeEach"])(e.startRow,e.endRow,i=>{this.isHidden(i)?(t||n(r,i-1,e.startCol,e.endCol),t=!0):(t&&(r=i),i===e.endRow&&n(r,i,e.startCol,e.endCol),t=!1)})}),t}function Sw(e,t){if(!uw(mw,this).indicators||e<0)return;const n=[];e>=1&&this.isHidden(e-1)&&n.push("afterHiddenRow"),e1||e[0].from.col!==e[0].to.col||e[0].from.col<=this.getSettings().fixedColumnsStart-1)&&(t=!0),t}}}function Nw(e){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_UNFREEZE_COLUMN"])},callback(t,n){const[{start:{col:r}}]=n;e.unfreezeColumn(r),this.render(),this.view.adjustElementsSize(!0)},hidden(){const e=this.getSelectedRange();let t=!1;return(void 0===e||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col>=this.getSettings().fixedColumnsStart)&&(t=!0),t}}}function Aw(e,t){Mw(e,t),t.add(e)}function Iw(e,t,n){Mw(e,t),t.set(e,n)}function Mw(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xw(e,t){return e.get(Lw(e,t))}function _w(e,t,n){return e.set(Lw(e,t),n),n}function Lw(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}fe["a"].getSingleton().register("beforeColumnFreeze"),fe["a"].getSingleton().register("afterColumnFreeze"),fe["a"].getSingleton().register("beforeColumnUnfreeze"),fe["a"].getSingleton().register("afterColumnUnfreeze");const Pw="manualColumnFreeze",kw=110;var jw=new WeakMap,Hw=new WeakSet;class Dw extends en["a"]{constructor(){super(...arguments),Aw(this,Hw),Iw(this,jw,!1)}static get PLUGIN_KEY(){return Pw}static get PLUGIN_PRIORITY(){return kw}isEnabled(){return!!this.hot.getSettings()[Pw]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>Lw(Hw,this,Fw).call(this,e)),this.addHook("beforeColumnMove",(e,t)=>Lw(Hw,this,Uw).call(this,e,t)),super.enablePlugin())}disablePlugin(){_w(jw,this,!1),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}freezeColumn(e){const t=this.hot.getSettings(),n=t.fixedColumnsStartt.fixedColumnsStart-1;xw(jw,this)||_w(jw,this,!0);const r=this.hot.runHooks("beforeColumnFreeze",e,n);!1!==r&&(n&&(this.hot.columnIndexMapper.moveIndexes(e,t.fixedColumnsStart),t._fixedColumnsStart+=1),this.hot.runHooks("afterColumnFreeze",e,n))}unfreezeColumn(e){const t=this.hot.getSettings(),n=t.fixedColumnsStart>0&&e<=t.fixedColumnsStart-1;xw(jw,this)||_w(jw,this,!0);const r=this.hot.runHooks("beforeColumnUnfreeze",e,n);!1!==r&&(n&&(t._fixedColumnsStart-=1,this.hot.columnIndexMapper.moveIndexes(e,t.fixedColumnsStart)),this.hot.runHooks("afterColumnUnfreeze",e,n))}}function Fw(e){e.items.push({name:"---------"},Ow(this),Nw(this))}function Uw(e,t){if(xw(jw,this)){const n=this.hot.getSettings().fixedColumnsStart;if(te=zw}setPosition(e,t){Object(rt["isNumeric"])(e)&&(this._element.style.top=e+Xw),Object(rt["isNumeric"])(t)&&(this._element.style[this.inlineProperty]=t+Xw)}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,t){Object(rt["isNumeric"])(e)&&(this._element.style.width=e+Xw),Object(rt["isNumeric"])(t)&&(this._element.style.height=t+Xw)}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,t){Object(rt["isNumeric"])(e)&&(this._element.style.marginTop=e+Xw),Object(rt["isNumeric"])(t)&&(this._element.style["margin"+Object(p["toUpperCaseFirst"])(this.inlineProperty)]=t+Xw)}getOffset(){const e=this._element.style,t="margin"+Object(p["toUpperCaseFirst"])(this.inlineProperty);return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[t]?parseInt(e[t],10):0}}}var $w=Kw;const qw="ht__manualColumnMove--backlight";class Qw extends $w{build(){super.build(),Object(i["addClass"])(this._element,qw)}}var Zw=Qw;const Jw="ht__manualColumnMove--guideline";class eb extends $w{build(){super.build(),Object(i["addClass"])(this._element,Jw)}}var tb=eb;function nb(e,t){ib(e,t),t.add(e)}function rb(e,t,n){ib(e,t),t.set(e,n)}function ib(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ob(e,t,n){return e.set(ab(e,t),n),n}function sb(e,t){return e.get(ab(e,t))}function ab(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}fe["a"].getSingleton().register("beforeColumnMove"),fe["a"].getSingleton().register("afterColumnMove");const lb="manualColumnMove",cb=120,hb="ht__manualColumnMove",ub="show-ui",db="on-moving--columns",pb="after-selection--columns";var fb=new WeakMap,gb=new WeakMap,mb=new WeakMap,yb=new WeakMap,wb=new WeakMap,bb=new WeakMap,vb=new WeakMap,Eb=new WeakMap,Cb=new WeakMap,Sb=new WeakMap,Rb=new WeakMap,Tb=new WeakSet;class Ob extends en["a"]{constructor(){super(...arguments),nb(this,Tb),rb(this,fb,new Zw(this.hot)),rb(this,gb,new tb(this.hot)),rb(this,mb,[]),rb(this,yb,0),rb(this,wb,!1),rb(this,bb,{}),rb(this,vb,void 0),rb(this,Eb,void 0),rb(this,Cb,void 0),rb(this,Sb,void 0),rb(this,Rb,void 0)}static get PLUGIN_KEY(){return lb}static get PLUGIN_PRIORITY(){return cb}isEnabled(){return!!this.hot.getSettings()[lb]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",(function(){for(var t=arguments.length,n=new Array(t),r=0;rab(Tb,this,xb).call(this)),this.addHook("afterLoadData",(function(){for(var t=arguments.length,n=new Array(t),r=0;rn,i=t<0,o=e.some(e=>e<0),s=e.some(e=>e>=n);return!(r||i||o||s)}isColumnOrderChanged(e,t){return e.some((e,n)=>e-n!==t)}countFinalIndex(e,t){const n=Object(u["arrayReduce"])(e,(e,n)=>(n{n.push(e)}),n}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(sb(Eb,this))&&e>0&&this.hot.scrollViewportTo({col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(e-1,-1)});const t=this.hot.view._wt.wtTable,n=this.hot.view._wt.wtOverlays.scrollableElement,r="number"===typeof n.scrollX?n.scrollX:n.scrollLeft;let o=this.hot.view.THEAD.offsetLeft+this.getColumnsWidth(0,sb(Eb,this)-1);const s=t.hider.offsetWidth,a=t.TBODY.offsetLeft,l=sb(fb,this).getOffset().start,c=sb(fb,this).getSize().width;let h=0,u=0;if(this.hot.isRtl()){const e=this.hot.rootWindow,t=Object(i["outerWidth"])(this.hot.rootElement),o=e.innerWidth-sb(Cb,this)-t;u=e.innerWidth-sb(bb,this).eventPageX-o-(void 0===n.scrollX?r:0)}else u=sb(bb,this).eventPageX-(sb(Cb,this)-(void 0===n.scrollX?r:0));if(sb(Sb,this)&&(h=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(sb(Eb,this))&&(o+=r),o+=h,sb(Eb,this)<0)sb(Rb,this)>0?sb(bb,this).col=0:sb(bb,this).col=e>0?e-1:e;else if(sb(bb,this).TD.offsetWidth/2+o<=u){const e=sb(Eb,this)>=sb(yb,this)?sb(yb,this)-1:sb(Eb,this);sb(bb,this).col=e+1,o+=sb(bb,this).TD.offsetWidth}else sb(bb,this).col=sb(Eb,this);let d=u,p=o;u+c+l>=s?d=s-c-l:u+l=s-1?p=s-1:0===p?p=1:void 0!==n.scrollX&&sb(Eb,this)ab(Tb,this,Ab).call(this,e)),this.eventManager.addEventListener(e,"mouseup",()=>ab(Tb,this,Mb).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){sb(fb,this).build(),sb(gb,this).build()}destroy(){sb(fb,this).destroy(),sb(gb,this).destroy(),super.destroy()}}function Nb(e,t,n,r){const s=this.hot.view._wt.wtTable,a=this.hot.selection.isSelectedByColumnHeader(),l=this.hot.getSelectedRangeLast(),c=Object(i["hasClass"])(e.target,"sortAction");if(!l||!a||sb(wb,this)||0!==e.button||c)return ob(wb,this,!1),sb(mb,this).length=0,void Object(i["removeClass"])(this.hot.rootElement,[db,ub]);const h=sb(gb,this).isBuilt()&&!sb(gb,this).isAppended(),u=sb(fb,this).isBuilt()&&!sb(fb,this).isAppended();h&&u&&(sb(gb,this).appendTo(s.hider),sb(fb,this).appendTo(s.hider));const{from:d,to:p}=l,f=Math.min(d.col,p.col),g=Math.max(d.col,p.col);if(t.row<0&&t.col>=f&&t.col<=g){r.column=!0,ob(wb,this,!0);const a=n.firstChild?Object(o["offsetRelativeTo"])(e,n.firstChild).x:e.offsetX;sb(bb,this).eventPageX=e.pageX,ob(Eb,this,t.col),sb(bb,this).TD=n,sb(bb,this).col=t.col,ob(mb,this,this.prepareColumnsToMoving(f,g)),ob(Sb,this,!!this.hot.getSettings().rowHeaders),ob(yb,this,this.hot.countCols()),ob(Rb,this,this.hot.getSettings().fixedColumnsStart),ob(Cb,this,Object(i["offset"])(this.hot.rootElement).left);const l=sb(Sb,this)?-1:0,c=s.holder.scrollTop+s.getColumnHeaderHeight(0)+1,h=t.col-1?Object(i["removeClass"])(this.hot.rootElement,ub):Object(i["addClass"])(this.hot.rootElement,ub),r.row=!0,r.column=!0,r.cell=!0,ob(Eb,this,t.col),sb(bb,this).TD=n)}function Mb(){const e=sb(bb,this).col,t=sb(mb,this).length;if(ob(Eb,this,void 0),ob(wb,this,!1),Object(i["removeClass"])(this.hot.rootElement,[db,ub,pb]),this.hot.selection.isSelectedByColumnHeader()&&Object(i["addClass"])(this.hot.rootElement,pb),t<1||void 0===e)return;const n=sb(mb,this)[0],r=this.hot.toPhysicalColumn(n),o=this.dragColumns(sb(mb,this),e);if(sb(mb,this).length=0,!0===o){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize(!0);const e=this.hot.toVisualColumn(r),n=e+t-1;this.hot.selectColumns(e,n)}}function xb(){const e=this.hot.view._wt.wtTable,t=e.getColumnHeaderHeight(0)+1,n=e.holder.scrollTop,r=t+n;sb(fb,this).setPosition(r),sb(fb,this).setSize(null,e.hider.offsetHeight-r)}function _b(){this.moveBySettingsOrLoad()}function Lb(e,t){kb(e,t),t.add(e)}function Pb(e,t,n){kb(e,t),t.set(e,n)}function kb(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jb(e,t,n){return e.set(Db(e,t),n),n}function Hb(e,t){return e.get(Db(e,t))}function Db(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const Fb="manualColumnResize",Ub=130,Vb="manualColumnWidths";var Bb=new WeakMap,Wb=new WeakMap,Gb=new WeakMap,zb=new WeakMap,Yb=new WeakMap,Xb=new WeakMap,Kb=new WeakMap,$b=new WeakMap,qb=new WeakMap,Qb=new WeakMap,Zb=new WeakMap,Jb=new WeakMap,ev=new WeakMap,tv=new WeakMap,nv=new WeakMap,rv=new WeakMap,iv=new WeakSet;class ov extends en["a"]{static get PLUGIN_KEY(){return Fb}static get PLUGIN_PRIORITY(){return Ub}constructor(e){super(e),Lb(this,iv),Pb(this,Bb,null),Pb(this,Wb,null),Pb(this,Gb,[]),Pb(this,zb,null),Pb(this,Yb,null),Pb(this,Xb,null),Pb(this,Kb,null),Pb(this,$b,null),Pb(this,qb,this.hot.rootDocument.createElement("DIV")),Pb(this,Qb,this.hot.rootDocument.createElement("DIV")),Pb(this,Zb,null),Pb(this,Jb,!1),Pb(this,ev,0),Pb(this,tv,null),Pb(this,nv,void 0),Pb(this,rv,void 0),Object(i["addClass"])(Hb(qb,this),"manualColumnResizer"),Object(i["addClass"])(Hb(Qb,this),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Fb]}enablePlugin(){this.enabled||(jb(nv,this,new hn["a"]),Hb(nv,this).addLocalHook("init",()=>Db(iv,this,sv).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,Hb(nv,this)),this.addHook("modifyColWidth",(e,t)=>Db(iv,this,dv).call(this,e,t)),this.addHook("beforeStretchingColumnWidth",(e,t)=>Db(iv,this,pv).call(this,e,t)),this.addHook("beforeColumnResize",(e,t,n)=>Db(iv,this,fv).call(this,e,t,n)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){jb(rv,this,Hb(nv,this).getValues()),this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualColumnWidths(){this.hot.runHooks("persistentStateSave",Vb,Hb(nv,this).getValues())}loadManualColumnWidths(){const e={};return this.hot.runHooks("persistentStateLoad",Vb,e),e.value}setManualSize(e,t){const n=Math.max(t,20),r=this.hot.toPhysicalColumn(e);return Hb(nv,this).setValueAtIndex(r,n),n}clearManualSize(e){const t=this.hot.toPhysicalColumn(e);Hb(nv,this).setValueAtIndex(t,null)}setupHandlePosition(e){if(!e.parentNode)return;jb(Bb,this,e);const{_wt:t}=this.hot.view,n=t.wtTable.getCoords(Hb(Bb,this)),r=n.col;if(r<0)return;const o=Object(i["outerHeight"])(Hb(Bb,this)),s=Hb(Bb,this).getBoundingClientRect(),a=r{const t=e.getTopStartCorner().col,n=e.getBottomEndCorner().col;Object(rt["rangeEach"])(t,n,e=>{Hb(Gb,this).includes(e)||Hb(Gb,this).push(e)})})}Hb(Gb,this).includes(Hb(Wb,this))||jb(Gb,this,[Hb(Wb,this)]),jb($b,this,l.start-6),jb(Kb,this,parseInt(s.width,10)),Hb(qb,this).style.top=l.top+"px",Hb(qb,this).style[this.inlineDir]=Hb($b,this)+Hb(Kb,this)+"px",Hb(qb,this).style.height=o+"px",this.hot.rootElement.appendChild(Hb(qb,this))}refreshHandlePosition(){Hb(qb,this).style[this.inlineDir]=Hb($b,this)+Hb(zb,this)+"px"}setupGuidePosition(){const e=parseInt(Object(i["outerHeight"])(Hb(qb,this)),10),t=parseInt(Hb(qb,this).style.top,10)+e,n=parseInt(this.hot.view.maximumVisibleElementHeight(0),10);Object(i["addClass"])(Hb(qb,this),"active"),Object(i["addClass"])(Hb(Qb,this),"active"),Hb(Qb,this).style.top=t+"px",this.refreshGuidePosition(),Hb(Qb,this).style.height=n-e+"px",this.hot.rootElement.appendChild(Hb(Qb,this))}refreshGuidePosition(){Hb(Qb,this).style[this.inlineDir]=Hb(qb,this).style[this.inlineDir]}hideHandleAndGuide(){Object(i["removeClass"])(Hb(qb,this),"active"),Object(i["removeClass"])(Hb(Qb,this),"active")}checkIfColumnHeader(e){const t=Object(i["closest"])(e,["THEAD"],this.hot.rootElement),{topOverlay:n,topInlineStartCornerOverlay:r}=this.hot.view._wt.wtOverlays;return[n.clone.wtTable.THEAD,r.clone.wtTable.THEAD].includes(t)}getClosestTHParent(e){return"TABLE"!==e.tagName?"TH"===e.tagName?e:this.getClosestTHParent(e.parentNode):null}afterMouseDownTimeout(){const e=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize(!0)},t=(t,n)=>{const r=this.hot.runHooks("beforeColumnResize",Hb(Yb,this),t,!0);void 0!==r&&jb(Yb,this,r),"all"===this.hot.getSettings().stretchH?this.clearManualSize(t):this.setManualSize(t,Hb(Yb,this)),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",Hb(Yb,this),t,!0),n&&e()};if(Hb(ev,this)>=2){const n=Hb(Gb,this).length;n>1?(Object(u["arrayEach"])(Hb(Gb,this),e=>{t(e)}),e()):Object(u["arrayEach"])(Hb(Gb,this),e=>{t(e,!0)})}jb(ev,this,0),jb(tv,this,null)}bindEvents(){const{rootWindow:e,rootElement:t}=this.hot;this.eventManager.addEventListener(t,"mouseover",e=>Db(iv,this,av).call(this,e)),this.eventManager.addEventListener(t,"mousedown",e=>Db(iv,this,lv).call(this,e)),this.eventManager.addEventListener(e,"mousemove",e=>Db(iv,this,cv).call(this,e)),this.eventManager.addEventListener(e,"mouseup",()=>Db(iv,this,hv).call(this)),this.eventManager.addEventListener(Hb(qb,this),"contextmenu",()=>Db(iv,this,uv).call(this))}destroy(){super.destroy()}}function sv(){const e=this.hot.getSettings()[Fb],t=this.loadManualColumnWidths();"undefined"!==typeof t?this.hot.batchExecution(()=>{t.forEach((e,t)=>{Hb(nv,this).setValueAtIndex(t,e)})},!0):Array.isArray(e)?(this.hot.batchExecution(()=>{e.forEach((e,t)=>{Hb(nv,this).setValueAtIndex(t,e)})},!0),jb(rv,this,e)):!0===e&&Array.isArray(Hb(rv,this))&&this.hot.batchExecution(()=>{Hb(rv,this).forEach((e,t)=>{Hb(nv,this).setValueAtIndex(t,e)})},!0)}function av(e){if(!Object(i["isDetached"])(e.target)&&!0!==Hb(Jb,this)&&this.checkIfColumnHeader(e.target)){const t=this.getClosestTHParent(e.target);if(!t)return;const n=t.getAttribute("colspan");!t||null!==n&&"1"!==n||Hb(Zb,this)||this.setupHandlePosition(t)}}function lv(e){e.target.parentNode===this.hot.rootElement&&Object(i["hasClass"])(e.target,"manualColumnResizer")&&(this.setupHandlePosition(Hb(Bb,this)),this.setupGuidePosition(),jb(Zb,this,!0),null===Hb(tv,this)&&(jb(tv,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(Hb(tv,this))),jb(ev,this,Hb(ev,this)+1),this.startX=e.pageX,jb(Yb,this,Hb(Kb,this)))}function cv(e){if(Hb(Zb,this)){const t=(e.pageX-this.startX)*this.hot.getDirectionFactor();jb(zb,this,Hb(Kb,this)+t),Object(u["arrayEach"])(Hb(Gb,this),e=>{jb(Yb,this,this.setManualSize(e,Hb(zb,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function hv(){const e=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize(!0)},t=(t,n)=>{this.hot.runHooks("beforeColumnResize",Hb(Yb,this),t,!1),n&&e(),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",Hb(Yb,this),t,!1)};if(Hb(Zb,this)){if(this.hideHandleAndGuide(),jb(Zb,this,!1),Hb(Yb,this)!==Hb(Kb,this)){const n=Hb(Gb,this).length;n>1?(Object(u["arrayEach"])(Hb(Gb,this),e=>{t(e)}),e()):Object(u["arrayEach"])(Hb(Gb,this),e=>{t(e,!0)})}this.setupHandlePosition(Hb(Bb,this))}}function uv(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(Hb(qb,this)),this.hot.rootElement.removeChild(Hb(Qb,this)),jb(Zb,this,!1),jb(Jb,this,!0),this.hot._registerImmediate(()=>{jb(Jb,this,!1)})}function dv(e,t){let n=e;if(this.enabled){const e=this.hot.toPhysicalColumn(t),r=Hb(nv,this).getValueAtIndex(e);this.hot.getSettings()[Fb]&&r&&(n=r)}return n}function pv(e,t){let n=Hb(nv,this).getValueAtIndex(t);return null===n&&(n=e),n}function fv(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}function gv(e,t,n){return t=mv(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mv(e){var t=yv(e,"string");return"symbol"==typeof t?t:t+""}function yv(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}const wv=0,bv=1,vv=2,Ev="px";class Cv{constructor(e){gv(this,"hot",void 0),gv(this,"_element",null),gv(this,"state",wv),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=vv}build(){this.state===wv&&(this._element=this.hot.rootDocument.createElement("div"),this.state=bv)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=wv}isAppended(){return this.state===vv}isBuilt(){return this.state>=bv}setPosition(e,t){void 0!==e&&(this._element.style.top=e+Ev),void 0!==t&&(this._element.style.left=t+Ev)}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,t){e&&(this._element.style.width=e+Ev),t&&(this._element.style.height=t+Ev)}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,t){e&&(this._element.style.marginTop=e+Ev),t&&(this._element.style.marginLeft=t+Ev)}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}}}var Sv=Cv;const Rv="ht__manualRowMove--backlight";class Tv extends Sv{build(){super.build(),Object(i["addClass"])(this._element,Rv)}}var Ov=Tv;const Nv="ht__manualRowMove--guideline";class Av extends Sv{build(){super.build(),Object(i["addClass"])(this._element,Nv)}}var Iv=Av;function Mv(e,t){_v(e,t),t.add(e)}function xv(e,t,n){_v(e,t),t.set(e,n)}function _v(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Lv(e,t,n){return e.set(kv(e,t),n),n}function Pv(e,t){return e.get(kv(e,t))}function kv(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}fe["a"].getSingleton().register("beforeRowMove"),fe["a"].getSingleton().register("afterRowMove");const jv="manualRowMove",Hv=140,Dv="ht__manualRowMove",Fv="show-ui",Uv="on-moving--rows",Vv="after-selection--rows";var Bv=new WeakMap,Wv=new WeakMap,Gv=new WeakMap,zv=new WeakMap,Yv=new WeakMap,Xv=new WeakMap,Kv=new WeakSet;class $v extends en["a"]{constructor(){super(...arguments),Mv(this,Kv),xv(this,Bv,new Ov(this.hot)),xv(this,Wv,new Iv(this.hot)),xv(this,Gv,[]),xv(this,zv,void 0),xv(this,Yv,{}),xv(this,Xv,void 0)}static get PLUGIN_KEY(){return jv}static get PLUGIN_PRIORITY(){return Hv}isEnabled(){return!!this.hot.getSettings()[jv]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",(function(){for(var t=arguments.length,n=new Array(t),r=0;rkv(Kv,this,eE).call(this)),this.addHook("afterLoadData",(function(){for(var t=arguments.length,n=new Array(t),r=0;rn,i=t<0,o=e.some(e=>e<0),s=e.some(e=>e>=n);return!(r||i||o||s)}isRowOrderChanged(e,t){return e.some((e,n)=>e-n!==t)}countFinalIndex(e,t){const n=Object(u["arrayReduce"])(e,(e,n)=>(nthis.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(),t=[];if(!e)return t;const{from:n,to:r}=e,i=Math.min(n.row,r.row),o=Math.max(n.row,r.row);return Object(rt["rangeEach"])(i,o,e=>{t.push(e)}),t}refreshPositions(){const e=Pv(Yv,this).coords,t=this.hot.view.getFirstFullyVisibleRow(),n=this.hot.view.getLastFullyVisibleRow(),r=this.hot.countRows();this.isFixedRowTop(e.row)&&t>0&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(t-1,-1)),this.isFixedRowBottom(e.row)&&n=v+w;this.isFixedRowTop(e.row)&&(v+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?Pv(Yv,this).row=t>0?t-1:t:E?(Pv(Yv,this).row=e.row+1,v+=0===e.row?b-1:b):Pv(Yv,this).row=e.row;let C=p,S=v;p+y+m>=f?C=f-y-m:p+m=f-1&&(S=f-1),Pv(Bv,this).setPosition(C),Pv(Wv,this).setPosition(S)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",e=>kv(Kv,this,Qv).call(this,e)),this.eventManager.addEventListener(e,"mouseup",()=>kv(Kv,this,Jv).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){Pv(Bv,this).build(),Pv(Wv,this).build()}destroy(){Pv(Bv,this).destroy(),Pv(Wv,this).destroy(),super.destroy()}}function qv(e,t,n,r){const{wtTable:o,wtViewport:s}=this.hot.view._wt,a=this.hot.selection.isSelectedByRowHeader(),l=this.hot.getSelectedRangeLast();if(!l||!a||Pv(zv,this)||0!==e.button)return Lv(zv,this,!1),Pv(Gv,this).length=0,void Object(i["removeClass"])(this.hot.rootElement,[Uv,Fv]);const c=Pv(Wv,this).isBuilt()&&!Pv(Wv,this).isAppended(),h=Pv(Bv,this).isBuilt()&&!Pv(Bv,this).isAppended();c&&h&&(Pv(Wv,this).appendTo(o.hider),Pv(Bv,this).appendTo(o.hider));const{from:u,to:d}=l,p=Math.min(u.row,d.row),f=Math.max(u.row,d.row);if(t.col<0&&t.row>=p&&t.row<=f){r.row=!0,Lv(zv,this,!0),Pv(Yv,this).eventPageY=e.pageY,Pv(Yv,this).coords=t,Pv(Yv,this).TD=n,Lv(Gv,this,this.prepareRowsToMoving());const a=o.holder.scrollLeft+s.getRowHeaderWidth(),l=this.getRowsHeight(p,t.row-1)+e.offsetY;Pv(Bv,this).setPosition(null,a),Pv(Bv,this).setSize(o.hider.offsetWidth-a,this.getRowsHeight(p,f)),Pv(Bv,this).setOffset(-l,null),Object(i["addClass"])(this.hot.rootElement,Uv),this.refreshPositions()}else Object(i["removeClass"])(this.hot.rootElement,Vv),Lv(zv,this,!1),Pv(Gv,this).length=0}function Qv(e){Pv(zv,this)&&(Pv(Yv,this).eventPageY=e.pageY,this.refreshPositions())}function Zv(e,t,n,r){const o=this.hot.getSelectedRangeLast();o&&Pv(zv,this)&&(Pv(Gv,this).indexOf(t.row)>-1?Object(i["removeClass"])(this.hot.rootElement,Fv):Object(i["addClass"])(this.hot.rootElement,Fv),r.row=!0,r.column=!0,r.cell=!0,Pv(Yv,this).coords=t,Pv(Yv,this).TD=n)}function Jv(){const e=Pv(Yv,this).row,t=Pv(Gv,this).length;if(Lv(zv,this,!1),Object(i["removeClass"])(this.hot.rootElement,[Uv,Fv,Vv]),this.hot.selection.isSelectedByRowHeader()&&Object(i["addClass"])(this.hot.rootElement,Vv),t<1||void 0===e)return;const n=Pv(Gv,this)[0],r=this.hot.toPhysicalRow(n),o=this.dragRows(Pv(Gv,this),e);if(Pv(Gv,this).length=0,!0===o){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize(!0);const e=this.hot.toVisualRow(r),n=e+t-1;this.hot.selectRows(e,n)}}function eE(){const e=this.hot.view._wt.wtTable,t=this.hot.view._wt.wtViewport.getRowHeaderWidth(),n=e.holder.scrollLeft,r=t+n;Pv(Bv,this).setPosition(null,r),Pv(Bv,this).setSize(e.hider.offsetWidth-r)}function tE(){this.moveBySettingsOrLoad()}var nE=n("eb36");function rE(e,t){oE(e,t),t.add(e)}function iE(e,t,n){oE(e,t),t.set(e,n)}function oE(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function sE(e,t,n){return e.set(lE(e,t),n),n}function aE(e,t){return e.get(lE(e,t))}function lE(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const cE="manualRowResize",hE=30,uE="manualRowHeights";var dE=new WeakMap,pE=new WeakMap,fE=new WeakMap,gE=new WeakMap,mE=new WeakMap,yE=new WeakMap,wE=new WeakMap,bE=new WeakMap,vE=new WeakMap,EE=new WeakMap,CE=new WeakMap,SE=new WeakMap,RE=new WeakMap,TE=new WeakMap,OE=new WeakMap,NE=new WeakMap,AE=new WeakSet;class IE extends en["a"]{static get PLUGIN_KEY(){return cE}static get PLUGIN_PRIORITY(){return hE}constructor(e){super(e),rE(this,AE),iE(this,dE,null),iE(this,pE,null),iE(this,fE,[]),iE(this,gE,null),iE(this,mE,null),iE(this,yE,null),iE(this,wE,null),iE(this,bE,null),iE(this,vE,this.hot.rootDocument.createElement("DIV")),iE(this,EE,this.hot.rootDocument.createElement("DIV")),iE(this,CE,!1),iE(this,SE,!1),iE(this,RE,0),iE(this,TE,null),iE(this,OE,void 0),iE(this,NE,void 0),Object(i["addClass"])(aE(vE,this),"manualRowResizer"),Object(i["addClass"])(aE(EE,this),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[cE]}enablePlugin(){this.enabled||(sE(OE,this,new hn["a"]),aE(OE,this).addLocalHook("init",()=>lE(AE,this,jE).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,aE(OE,this)),this.addHook("modifyRowHeight",(e,t)=>lE(AE,this,kE).call(this,e,t)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){sE(NE,this,aE(OE,this).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualRowHeights(){this.hot.runHooks("persistentStateSave",uE,aE(OE,this).getValues())}loadManualRowHeights(){const e={};return this.hot.runHooks("persistentStateLoad",uE,e),e.value}setManualSize(e,t){const n=this.hot.toPhysicalRow(e),r=Math.max(t,nE["a"].DEFAULT_HEIGHT);return aE(OE,this).setValueAtIndex(n,r),r}setupHandlePosition(e){sE(dE,this,e);const{view:t}=this.hot,{_wt:n}=t,r=n.wtTable.getCoords(aE(dE,this)),o=r.row;if(o<0)return;const s=Object(i["outerWidth"])(aE(dE,this)),a=aE(dE,this).getBoundingClientRect(),l=o=t.countNotHiddenRowIndexes(0,1)-n.getSetting("fixedRowsBottom");let h;l?h=n.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(aE(dE,this),r.row,r.col):c&&(h=n.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(aE(dE,this),r.row,r.col)),h||(h=n.wtOverlays.inlineStartOverlay.getRelativeCellPosition(aE(dE,this),r.row,r.col)),sE(pE,this,this.hot.rowIndexMapper.getVisualFromRenderableIndex(o)),sE(fE,this,[]);const d=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&d){const e=this.hot.getSelectedRange();Object(u["arrayEach"])(e,e=>{const t=e.getTopStartCorner().row,n=e.getBottomStartCorner().row;Object(rt["rangeEach"])(t,n,e=>{aE(fE,this).includes(e)||aE(fE,this).push(e)})})}aE(fE,this).includes(aE(pE,this))||sE(fE,this,[aE(pE,this)]),sE(bE,this,h.top-6),sE(wE,this,parseInt(a.height,10)),aE(vE,this).style.top=aE(bE,this)+aE(wE,this)+"px",aE(vE,this).style[this.inlineDir]=h.start+"px",aE(vE,this).style.width=s+"px",this.hot.rootElement.appendChild(aE(vE,this))}refreshHandlePosition(){aE(vE,this).style.top=aE(bE,this)+aE(gE,this)+"px"}setupGuidePosition(){const e=parseInt(Object(i["outerWidth"])(aE(vE,this)),10),t=parseInt(aE(vE,this).style[this.inlineDir],10)+e,n=parseInt(this.hot.view.maximumVisibleElementWidth(0),10);Object(i["addClass"])(aE(vE,this),"active"),Object(i["addClass"])(aE(EE,this),"active"),aE(EE,this).style.top=aE(vE,this).style.top,aE(EE,this).style[this.inlineDir]=t+"px",aE(EE,this).style.width=n-e+"px",this.hot.rootElement.appendChild(aE(EE,this))}refreshGuidePosition(){aE(EE,this).style.top=aE(vE,this).style.top}hideHandleAndGuide(){Object(i["removeClass"])(aE(vE,this),"active"),Object(i["removeClass"])(aE(EE,this),"active")}checkIfRowHeader(e){const t=Object(i["closest"])(e,["TBODY"],this.hot.rootElement),{inlineStartOverlay:n,topInlineStartCornerOverlay:r,bottomInlineStartCornerOverlay:o}=this.hot.view._wt.wtOverlays;return[n.clone.wtTable.TBODY,r.clone.wtTable.TBODY,o.clone.wtTable.TBODY].includes(t)}getClosestTHParent(e){return"TABLE"!==e.tagName?"TH"===e.tagName?e:this.getClosestTHParent(e.parentNode):null}getActualRowHeight(e){const t=this.hot.view._wt.wtTable.getRowHeight(e);return void 0!==t&&aE(mE,this){this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize(!0)},t=(t,n)=>{const r=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(t),t,!0);void 0!==r&&sE(mE,this,r),this.setManualSize(t,aE(mE,this)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(t),t,!0),n&&e()};if(aE(RE,this)>=2){const n=aE(fE,this).length;n>1?(Object(u["arrayEach"])(aE(fE,this),e=>{t(e)}),e()):Object(u["arrayEach"])(aE(fE,this),e=>{t(e,!0)})}sE(RE,this,0),sE(TE,this,null)}bindEvents(){const{rootElement:e,rootWindow:t}=this.hot;this.eventManager.addEventListener(e,"mouseover",e=>lE(AE,this,ME).call(this,e)),this.eventManager.addEventListener(e,"mousedown",e=>lE(AE,this,xE).call(this,e)),this.eventManager.addEventListener(t,"mousemove",e=>lE(AE,this,_E).call(this,e)),this.eventManager.addEventListener(t,"mouseup",()=>lE(AE,this,LE).call(this)),this.eventManager.addEventListener(aE(vE,this),"contextmenu",()=>lE(AE,this,PE).call(this))}destroy(){super.destroy()}}function ME(e){if(!Object(i["isDetached"])(e.target)&&!0!==aE(SE,this)&&this.checkIfRowHeader(e.target)){const t=this.getClosestTHParent(e.target);t&&(aE(CE,this)||this.setupHandlePosition(t))}}function xE(e){Object(i["hasClass"])(e.target,"manualRowResizer")&&(this.setupHandlePosition(aE(dE,this)),this.setupGuidePosition(),sE(CE,this,!0),null===aE(TE,this)&&(sE(TE,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(aE(TE,this))),sE(RE,this,aE(RE,this)+1),sE(yE,this,e.pageY),sE(mE,this,aE(wE,this)))}function _E(e){aE(CE,this)&&(sE(gE,this,aE(wE,this)+(e.pageY-aE(yE,this))),Object(u["arrayEach"])(aE(fE,this),e=>{sE(mE,this,this.setManualSize(e,aE(gE,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition())}function LE(){const e=()=>{this.hot.forceFullRender=!0,this.hot.view.render(),this.hot.view.adjustElementsSize(!0)},t=(t,n)=>{this.hot.runHooks("beforeRowResize",this.getActualRowHeight(t),t,!1),n&&e(),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.getActualRowHeight(t),t,!1)};if(aE(CE,this)){if(this.hideHandleAndGuide(),sE(CE,this,!1),aE(mE,this)!==aE(wE,this)){const n=aE(fE,this).length;n>1?(Object(u["arrayEach"])(aE(fE,this),e=>{t(e)}),e()):Object(u["arrayEach"])(aE(fE,this),e=>{t(e,!0)})}this.setupHandlePosition(aE(dE,this))}}function PE(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(aE(vE,this)),this.hot.rootElement.removeChild(aE(EE,this)),sE(CE,this,!1),sE(SE,this,!0),this.hot._registerImmediate(()=>{sE(SE,this,!1)})}function kE(e,t){let n=e;if(this.enabled){const e=this.hot.toPhysicalRow(t),r=aE(OE,this).getValueAtIndex(e);this.hot.getSettings()[cE]&&r&&(n=r)}return n}function jE(){const e=this.hot.getSettings()[cE],t=this.loadManualRowHeights();this.hot.batchExecution(()=>{"undefined"!==typeof t?t.forEach((e,t)=>{aE(OE,this).setValueAtIndex(t,e)}):Array.isArray(e)?(e.forEach((e,t)=>{aE(OE,this).setValueAtIndex(t,e)}),sE(NE,this,e)):!0===e&&Array.isArray(aE(NE,this))&&aE(NE,this).forEach((e,t)=>{aE(OE,this).setValueAtIndex(t,e)})},!0)}n("4cd6");function HE(e,t,n){return t=DE(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DE(e){var t=FE(e,"string");return"symbol"==typeof t?t:t+""}function FE(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class UE{constructor(e,t,n,r,i,o){HE(this,"row",void 0),HE(this,"col",void 0),HE(this,"rowspan",void 0),HE(this,"colspan",void 0),HE(this,"removed",!1),HE(this,"cellCoordsFactory",void 0),HE(this,"cellRangeFactory",void 0),this.row=e,this.col=t,this.rowspan=n,this.colspan=r,this.cellCoordsFactory=i,this.cellRangeFactory=o}static NEGATIVE_VALUES_WARNING(e){return Ro["a"]`The merged cell declared with {row: ${e.row}, col: ${e.col},\x20 rowspan: ${e.rowspan}, colspan: ${e.colspan}} contains negative values, which is\x20 not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING(e){return Ro["a"]`The merged cell declared at [${e.row}, ${e.col}] is positioned\x20 (or positioned partially) outside of the table range. It was not added to the table, please fix your setup.`}static IS_SINGLE_CELL(e){return Ro["a"]`The merged cell declared at [${e.row}, ${e.col}] has both "rowspan"\x20 and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.`}static ZERO_SPAN_WARNING(e){return Ro["a"]`The merged cell declared at [${e.row}, ${e.col}] has "rowspan"\x20 or "colspan" declared as "0", which is not supported. It cannot be added to the collection.`}static containsNegativeValues(e){return e.row<0||e.col<0||e.rowspan<0||e.colspan<0}static isSingleCell(e){return 1===e.colspan&&1===e.rowspan}static containsZeroSpan(e){return 0===e.colspan||0===e.rowspan}static isOutOfBounds(e,t,n){return e.row<0||e.col<0||e.row>=t||e.row+e.rowspan-1>=t||e.col>=n||e.col+e.colspan-1>=n}normalize(e){const t=e.countRows(),n=e.countCols();this.row<0?this.row=0:this.row>t-1&&(this.row=t-1),this.col<0?this.col=0:this.col>n-1&&(this.col=n-1),this.row+this.rowspan>t-1&&(this.rowspan=t-this.row),this.col+this.colspan>n-1&&(this.colspan=n-this.col)}includes(e,t){return this.row<=e&&this.col<=t&&this.row+this.rowspan-1>=e&&this.col+this.colspan-1>=t}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,t){const n=e[0]||e[1],r=t+Math.abs(e[0]||e[1])-1,i=e[0]?"colspan":"rowspan",o=e[0]?"col":"row",s=Math.min(t,r),a=Math.max(t,r),l=this[o],c=this[o]+this[i]-1;if(l>=t&&(this[o]+=n),n>0)t<=c&&t>l&&(this[i]+=n);else if(n<0){if(s<=l&&a>=c)return this.removed=!0,!1;if(l>=s&&l<=a){const e=a-l+1,t=Math.abs(n)-e;this[o]-=t+n,this[i]-=e}else if(l<=s&&c>=a)this[i]+=n;else if(l<=s&&c>=s&&cthis.row:"right"===t?e.col+e.colspan-1this.col:null)}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()))}}var VE=UE;function BE(e,t,n,r){t?t.row===n&&t.col===r?(e.setAttribute("rowspan",t.rowspan.toString()),e.setAttribute("colspan",t.colspan.toString())):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"),e.style.display="none"):(e.removeAttribute("rowspan"),e.removeAttribute("colspan"),e.style.display="")}function WE(e,t){GE(e,t),t.add(e)}function GE(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zE(e,t,n){return t=YE(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YE(e){var t=XE(e,"string");return"symbol"==typeof t?t:t+""}function XE(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function KE(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var $E=new WeakSet;class qE{constructor(e){WE(this,$E),zE(this,"plugin",void 0),zE(this,"mergedCells",[]),zE(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){return Ro["a"]`The merged cell declared at [${e.row}, ${e.col}], overlaps\x20 with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20 fix your setup.`}get(e,t){const n=this.mergedCells;let r=!1;return Object(u["arrayEach"])(n,n=>!(n.row<=e&&n.row+n.rowspan-1>=e&&n.col<=t&&n.col+n.colspan-1>=t)||(r=n,!1)),r}getByRange(e){const t=this.mergedCells;let n=!1;return Object(u["arrayEach"])(t,t=>!(t.row<=e.from.row&&t.row+t.rowspan-1>=e.to.row&&t.col<=e.from.col&&t.col+t.colspan-1>=e.to.col)||(n=t,n)),n}getWithinRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.mergedCells,r=[];let i=e;if(!i.includesRange){const e=this.hot._createCellCoords(i.from.row,i.from.col),t=this.hot._createCellCoords(i.to.row,i.to.col);i=this.hot._createCellRange(e,e,t)}return Object(u["arrayEach"])(n,e=>{const n=this.hot._createCellCoords(e.row,e.col),o=this.hot._createCellCoords(e.row+e.rowspan-1,e.col+e.colspan-1),s=this.hot._createCellRange(n,n,o);t?i.overlaps(s)&&r.push(e):i.includesRange(s)&&r.push(e)}),!!r.length&&r}add(e){const t=this.mergedCells,n=e.row,r=e.col,i=e.rowspan,o=e.colspan,s=new VE(n,r,i,o,this.hot._createCellCoords,this.hot._createCellRange),a=this.get(n,r),l=this.isOverlapping(s);return a||l?(Object(Dr["b"])(qE.IS_OVERLAPPING_WARNING(s)),!1):(this.hot&&s.normalize(this.hot),t.push(s),s)}remove(e,t){const n=this.mergedCells,r=this.get(e,t),i=r?this.mergedCells.indexOf(r):-1;return!(!r||-1===i)&&(n.splice(i,1),r)}clear(){const e=this.mergedCells,t=[],n=[];Object(u["arrayEach"])(e,e=>{const n=this.hot.getCell(e.row,e.col);n&&t.push([n,this.get(e.row,e.col),e.row,e.col])}),this.mergedCells.length=0,Object(u["arrayEach"])(t,(e,r)=>{Object(rt["rangeEach"])(0,e.rowspan-1,t=>{Object(rt["rangeEach"])(0,e.colspan-1,r=>{if(0!==r||0!==t){const i=this.hot.getCell(e.row+t,e.col+r);i&&n.push([i,null,null,null])}})}),t[r][1]=null}),Object(u["arrayEach"])(t,e=>{BE(...e)}),Object(u["arrayEach"])(n,e=>{BE(...e)})}isOverlapping(e){const t=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 Object(u["arrayEach"])(this.mergedCells,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));return!r.overlaps(t)||(n=!0,!1)}),n}isFirstRenderableMergedCell(e,t){const n=this.get(e,t);return n&&this.hot.rowIndexMapper.getNearestNotHiddenIndex(n.row,1)===e&&this.hot.columnIndexMapper.getNearestNotHiddenIndex(n.col,1)===t}getFirstRenderableCoords(e,t){const n=this.get(e,t);if(!n||this.isFirstRenderableMergedCell(e,t))return this.hot._createCellCoords(e,t);const r=this.hot.rowIndexMapper.getNearestNotHiddenIndex(n.row,1),i=this.hot.columnIndexMapper.getNearestNotHiddenIndex(n.col,1);return this.hot._createCellCoords(r,i)}getStartMostColumnIndex(e,t){const n=KE($E,this,QE).call(this,e,"col",-1);let r=t;for(let i=0;i=t){r=n[i];break}return r}getTopMostRowIndex(e,t){const n=KE($E,this,QE).call(this,e,"row",-1);let r=t;for(let i=0;i=t){r=n[i];break}return r}shiftCollections(e,t,n){const r=[0,0];switch(e){case"right":r[0]+=n;break;case"left":r[0]-=n;break;case"down":r[1]+=n;break;case"up":r[1]-=n;break;default:}Object(u["arrayEach"])(this.mergedCells,e=>{e.shift(r,t)}),Object(rt["rangeEachReverse"])(this.mergedCells.length-1,0,e=>{const t=this.mergedCells[e];t&&t.removed&&this.mergedCells.splice(this.mergedCells.indexOf(t),1)})}}function QE(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const r=new Map,i=1===n?e.getTopStartCorner():e.getBottomEndCorner(),o=1===n?e.getBottomEndCorner():e.getTopStartCorner();for(let s=i.row;1===n?s<=o.row:s>=o.row;s+=n)for(let e=i.col;1===n?e<=o.col:e>=o.col;e+=n){const i="row"===t?s:e,o=this.get(s,e);let a=i;o&&(a=1===n?o[t]+o[t+"span"]-1:o[t]),r.has(i)||r.set(i,new Set),r.get(i).add(a)}return Array.from(new Set(Array.from(r.entries()).filter(e=>{let[,t]=e;return 1===t.size}).flatMap(e=>{let[,t]=e;return Array.from(t)})))}var ZE=qE;function JE(e,t,n){return t=eC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eC(e){var t=tC(e,"string");return"symbol"==typeof t?t:t+""}function tC(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class nC{constructor(e){JE(this,"plugin",void 0),JE(this,"mergedCellsCollection",void 0),JE(this,"currentFillData",null),this.plugin=e,this.mergedCellsCollection=this.plugin.mergedCellsCollection}correctSelectionAreaSize(e){if(e[0]===e[2]&&e[1]===e[3]){const t=this.mergedCellsCollection.get(e[0],e[1]);t&&(e[2]=e[0]+t.rowspan-1,e[3]=e[1]+t.colspan-1)}}getDirection(e,t){let n=null;return n=t[0]===e[0]&&t[1]===e[1]&&t[3]===e[3]?"down":t[2]===e[2]&&t[1]===e[1]&&t[3]===e[3]?"up":t[1]===e[1]&&t[2]===e[2]?"right":"left",n}snapDragArea(e,t,n,r){const i=t.slice(0),o=this.getAutofillSize(e,t,n),[s,a,l,c]=e,h=["up","down"].indexOf(n)>-1,u=h?l-s+1:c-a+1,d=Math.floor(o/u)*u,p=o-d,f=this.getFarthestCollection(e,t,n,r);if(f)if("down"===n){const e=f.row+f.rowspan-s-p,t=i[2]+e;t>=this.plugin.hot.countRows()?i[2]-=p:i[2]+=p?e:0}else if("right"===n){const e=f.col+f.colspan-a-p,t=i[3]+e;t>=this.plugin.hot.countCols()?i[3]-=p:i[3]+=p?e:0}else if("up"===n){const e=l-p-f.row+1,t=i[0]+e;t<0?i[0]+=p:i[0]-=p?e:0}else if("left"===n){const e=c-p-f.col+1,t=i[1]+e;t<0?i[1]+=p:i[1]-=p?e:0}return this.updateCurrentFillCache({baseArea:e,dragDirection:n,foundMergedCells:r,fillSize:o,dragArea:i,cycleLength:u}),i}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),Object(s["extend"])(this.currentFillData,e)}getAutofillSize(e,t,n){const[r,i,o,s]=e,[a,l,c,h]=t;switch(n){case"up":return r-a;case"down":return c-o;case"left":return i-l;case"right":return h-s;default:return null}}getDragArea(e,t,n){const[r,i,o,s]=e,[a,l,c,h]=t;switch(n){case"up":return[a,l,r-1,s];case"down":return[o+1,i,c,s];case"left":return[a,l,o,i-1];case"right":return[r,s+1,c,h];default:return null}}getFarthestCollection(e,t,n,r){const[i,o,s,a]=e,l=["up","down"].indexOf(n)>-1,c=l?s:a,h=l?i:o,d=this.getAutofillSize(e,t,n),p=l?s-i+1:a-o+1,f=Math.floor(d/p)*p,g=d-f;let m=null,y=null,w=null;switch(n){case"up":m="includesVertically",w=c-g+1;break;case"left":m="includesHorizontally",w=c-g+1;break;case"down":m="includesVertically",w=h+g-1;break;case"right":m="includesHorizontally",w=h+g-1;break;default:}return Object(u["arrayEach"])(r,e=>{e[m](w)&&e.isFarther(y,n)&&(y=e)}),y}recreateAfterDataPopulation(e){if(!this.currentFillData)return;const t=this.getRangeFromChanges(e),n=this.currentFillData.foundMergedCells,r=this.currentFillData.dragDirection,i=(e,n)=>{switch(r){case"up":return e.row-n>=t.from.row;case"down":return e.row+e.rowspan-1+n<=t.to.row;case"left":return e.col-n>=t.from.column;case"right":return e.col+e.colspan-1+n<=t.to.column;default:return null}};let o=0,s=null,a=1;do{for(let e=0;e0&&this.plugin.ifChromeForceRepaint()}getRangeFromChanges(e){const t={min:null,max:null},n={min:null,max:null};return Object(u["arrayEach"])(e,e=>{const r=e[0],i=this.plugin.hot.propToCol(e[1]);(null===t.min||rt.max)&&(t.max=r),(null===n.min||in.max)&&(n.max=i)}),{from:{row:t.min,column:n.min},to:{row:t.max,column:n.max}}}dragAreaOverlapsCollections(e,t,n){const r=this.getDragArea(e,t,n),[i,o,s,a]=r,l=this.plugin.hot._createCellCoords(i,o),c=this.plugin.hot._createCellCoords(s,a),h=this.plugin.hot._createCellRange(l,l,c);return!!this.mergedCellsCollection.getWithinRange(h,!0)}}var rC=nC;function iC(e,t,n){return t=oC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oC(e){var t=sC(e,"string");return"symbol"==typeof t?t:t+""}function sC(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class aC{constructor(e){iC(this,"plugin",void 0),iC(this,"hot",void 0),iC(this,"fullySelectedMergedCellClassName","fullySelectedMergedCell"),this.plugin=e,this.hot=e.hot}getSelectedMergedCellClassName(e,t,n,r){const i=Math.min(n[0],n[2]),o=Math.min(n[1],n[3]),s=Math.max(n[0],n[2]),a=Math.max(n[1],n[3]);if(void 0===r)return;const l=this.plugin.mergedCellsCollection.isFirstRenderableMergedCell(e,t);if(!l)return;const c=this.plugin.mergedCellsCollection.get(e,t);if(!c)return;const h=c.getLastRow(),u=c.getLastColumn(),d=i<=c.row&&o<=c.col&&s>=h&&a>=u;return d?`${this.fullySelectedMergedCellClassName}-${r}`:this.isMergeCellFullySelected(c,this.plugin.hot.getSelectedRange())?this.fullySelectedMergedCellClassName+"-multiple":void 0}isMergeCellFullySelected(e,t){const n=[];if(!t||!e)return!1;for(let r=0;r{const{rowStart:r,rowEnd:i,colStart:o,colEnd:s}=n.data;if(e>=r&&e<=i&&t>=o&&t<=s)return vC(RC,this,n),!1}),bC(SC,this).inorder(n=>{const{rowStart:r,rowEnd:i,colStart:o,colEnd:s}=n.data;if(e>=r&&e<=i&&t>=o&&t<=s)return vC(TC,this,n),!1}),this}}function xC(e,t,n,r,i){const o=e.getTopStartCorner(),s=e.getBottomEndCorner(),a=e.highlight.clone().normalize(),l=bC(OC,this).call(this,r,i);if(l&&n.has(l))return null;const c={colStart:i,colEnd:i,rowStart:r,rowEnd:r};if(l){if(n.add(l),l.rows.row||l.cols.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 h=t.push(c);return r===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?h:null}function _C(e,t){PC(e,t),t.add(e)}function LC(e,t,n){PC(e,t),t.set(e,n)}function PC(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kC(e,t,n){return t=jC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jC(e){var t=HC(e,"string");return"symbol"==typeof t?t:t+""}function HC(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function DC(e,t,n){return e.set(UC(e,t),n),n}function FC(e,t){return e.get(UC(e,t))}function UC(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}fe["a"].getSingleton().register("beforeMergeCells"),fe["a"].getSingleton().register("afterMergeCells"),fe["a"].getSingleton().register("beforeUnmergeCells"),fe["a"].getSingleton().register("afterUnmergeCells");const VC="mergeCells",BC=150,WC=VC;var GC=new WeakMap,zC=new WeakMap,YC=new WeakMap,XC=new WeakSet;class KC extends en["a"]{constructor(){super(...arguments),_C(this,XC),kC(this,"mergedCellsCollection",null),kC(this,"autofillCalculations",null),kC(this,"selectionCalculations",null),LC(this,GC,null),LC(this,zC,{row:0,col:0}),LC(this,YC,new MC({mergedCellsGetter:(e,t)=>this.mergedCellsCollection.get(e,t),rowIndexMapper:this.hot.rowIndexMapper,columnIndexMapper:this.hot.columnIndexMapper}))}static get PLUGIN_KEY(){return VC}static get PLUGIN_PRIORITY(){return BC}isEnabled(){return!!this.hot.getSettings()[VC]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new ZE(this),this.autofillCalculations=new rC(this),this.selectionCalculations=new lC(this),this.addHook("afterInit",(function(){for(var t=arguments.length,n=new Array(t),r=0;r{if("MergeCells"===t)return!1}),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.clearCollections(),this.unregisterShortcuts(),this.hot.render(),super.disablePlugin()}updatePlugin(){const e=this.hot.getSettings()[VC];this.disablePlugin(),this.enablePlugin(),this.generateFromSettings(e),super.updatePlugin()}ifChromeForceRepaint(){if(!Object(g["isChrome"])())return;const e=[];let t=[];this.mergedCellsCollection.mergedCells.forEach(e=>{const{row:n,rowspan:r}=e;for(let i=n+1;i{const n=this.hot.rowIndexMapper.getRenderableFromVisualIndex(t);this.hot.view._wt.wtOverlays.getOverlays(!0).map(e=>"master"===(null===e||void 0===e?void 0:e.name)?e:e.clone.wtTable).forEach(t=>{const r=t.getRow(n);r&&(r.style.background=Object(i["getStyle"])(r,"backgroundColor").replace(")",", 0.99)"),e.push(r))})}),this.hot._registerTimeout(()=>{e.forEach(e=>{e.style.background=Object(i["getStyle"])(e,"backgroundColor").replace(", 0.99)",")")})},1)}validateSetting(e){let t=!0;return!!e&&(VE.containsNegativeValues(e)?(Object(Dr["b"])(VE.NEGATIVE_VALUES_WARNING(e)),t=!1):VE.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?(Object(Dr["b"])(VE.IS_OUT_OF_BOUNDS_WARNING(e)),t=!1):VE.isSingleCell(e)?(Object(Dr["b"])(VE.IS_SINGLE_CELL(e)),t=!1):VE.containsZeroSpan(e)&&(Object(Dr["b"])(VE.ZERO_SPAN_WARNING(e)),t=!1),t)}generateFromSettings(e){if(Array.isArray(e)){const t=[];if(Object(u["arrayEach"])(e,e=>{if(!this.validateSetting(e))return;const n=this.hot._createCellCoords(e.row,e.col),r=this.hot._createCellCoords(e.row+e.rowspan-1,e.col+e.colspan-1),i=this.hot._createCellRange(n,n,r);this.mergeRange(i,!0,!0),Object(rt["rangeEach"])(e.row,e.row+e.rowspan-1,n=>{Object(rt["rangeEach"])(e.col,e.col+e.colspan-1,r=>{!1===(n===e.row&&r===e.col)&&t.push([n,r,null])})})}),0===t.length)return;this.hot.setDataAtCell(t,void 0,void 0,this.pluginName)}}clearCollections(){this.mergedCellsCollection.clear()}canMergeRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!!t||this.validateSetting(e)}mergeSelection(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;e.setDirection(this.hot.isRtl()?"NE-SW":"NW-SE");const{from:t,to:n}=e;this.unmergeRange(e,!0),this.mergeRange(e),this.hot.selectCell(t.row,t.col,n.row,n.col,!1)}unmergeSelection(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;const{from:t,to:n}=e;this.unmergeRange(e,!0),this.hot.selectCell(t.row,t.col,n.row,n.col,!1)}mergeRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=e.getTopStartCorner(),i=e.getBottomEndCorner(),o={row:r.row,col:r.col,rowspan:i.row-r.row+1,colspan:i.col-r.col+1},s=[];let a=null;if(!this.canMergeRange(o,t))return!1;this.hot.runHooks("beforeMergeCells",e,t),Object(rt["rangeEach"])(0,o.rowspan-1,e=>{Object(rt["rangeEach"])(0,o.colspan-1,t=>{let n=null;s[e]||(s[e]=[]),0===e&&0===t?n=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(o.row),this.hot.toPhysicalColumn(o.col)):this.hot.setCellMeta(o.row+e,o.col+t,"hidden",!0),s[e][t]=n})}),this.hot.setCellMeta(o.row,o.col,"spanned",!0);const l=this.mergedCellsCollection.add(o);return!l||(n?a=[o.row,o.col,s]:this.hot.populateFromArray(o.row,o.col,s,void 0,void 0,this.pluginName),t||this.ifChromeForceRepaint(),this.hot.runHooks("afterMergeCells",e,o,t),a)}unmergeRange(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.mergedCellsCollection.getWithinRange(e);n&&(this.hot.runHooks("beforeUnmergeCells",e,t),Object(u["arrayEach"])(n,e=>{this.mergedCellsCollection.remove(e.row,e.col),Object(rt["rangeEach"])(0,e.rowspan-1,t=>{Object(rt["rangeEach"])(0,e.colspan-1,n=>{this.hot.removeCellMeta(e.row+t,e.col+n,"hidden"),this.hot.removeCellMeta(e.row+t,e.col+n,"copyable")})}),this.hot.removeCellMeta(e.row,e.col,"spanned")}),this.hot.runHooks("afterUnmergeCells",e,t),this.hot.render())}toggleMerge(e){const t=this.mergedCellsCollection.get(e.from.row,e.from.col),n=t.row===e.from.row&&t.col===e.from.col&&t.row+t.rowspan-1===e.to.row&&t.col+t.colspan-1===e.to.col;n?this.unmergeRange(e):this.mergeSelection(e)}merge(e,t,n,r){const i=this.hot._createCellCoords(e,t),o=this.hot._createCellCoords(n,r);this.mergeRange(this.hot._createCellRange(i,i,o))}unmerge(e,t,n,r){const i=this.hot._createCellCoords(e,t),o=this.hot._createCellCoords(n,r);this.unmergeRange(this.hot._createCellRange(i,i,o))}registerShortcuts(){const e=this.hot.getShortcutManager(),t=e.getContext("grid");t.addShortcut({keys:[["Control","m"]],callback:()=>{const e=this.hot.getSelectedRangeLast();e&&!e.isSingleHeader()&&(this.toggleMerge(e),this.hot.render())},runOnlyIf:e=>!e.altKey,group:WC})}unregisterShortcuts(){const e=this.hot.getShortcutManager(),t=e.getContext("grid");t.removeShortcutsByGroup(WC)}modifyViewportRowStart(e,t){const n=this.hot.rowIndexMapper,r=n.getVisualFromRenderableIndex(e.startRow);for(let i=0;ie.endRow)return e.endRow=i,void this.modifyViewportRowEnd(e,t)}}}modifyViewportColumnStart(e,t){const n=this.hot.columnIndexMapper,r=n.getVisualFromRenderableIndex(e.startColumn);for(let i=0;ie.endColumn)return e.endColumn=i,void this.modifyViewportColumnEnd(e,t)}}}translateMergedCellToRenderable(e,t,n,r){const{rowIndexMapper:i,columnIndexMapper:o}=this.hot;let s,a;s=0===t?i.getNearestNotHiddenIndex(e,1):i.getNearestNotHiddenIndex(e+t-1,-1),a=0===r?o.getNearestNotHiddenIndex(n,1):o.getNearestNotHiddenIndex(n+r-1,-1);const l=e>=0?i.getRenderableFromVisualIndex(s):e,c=n>=0?o.getRenderableFromVisualIndex(a):n;return[l,c]}}function $C(){this.generateFromSettings(this.hot.getSettings()[VC]),this.hot.render()}function qC(e){if(e){const e=this.mergedCellsCollection.mergedCells,t=this.hot.getSelectedRangeLast(),n=t.getTopStartCorner(),r=t.getBottomEndCorner();for(let i=0;i=s&&n.col<=a?s-1:a,i=r.getNearestNotHiddenIndex(t,-1);e.col=null===i?-this.hot.view.countRenderableColumnsInRange(0,n.col):-Math.max(this.hot.view.countRenderableColumnsInRange(i,n.col)-1,1)}else if(e.col>0){const t=n.col>=s&&n.col<=a?a+1:s,i=r.getNearestNotHiddenIndex(t,1);e.col=null===i?this.hot.view.countRenderableColumnsInRange(n.col,this.hot.countCols()):Math.max(this.hot.view.countRenderableColumnsInRange(n.col,i)-1,1)}const l=o.row,c=o.row+o.rowspan-1;if(e.row<0){const t=n.row>=l&&n.row<=c?l-1:c,r=i.getNearestNotHiddenIndex(t,-1);e.row=null===r?-this.hot.view.countRenderableRowsInRange(0,n.row):-Math.max(this.hot.view.countRenderableRowsInRange(r,n.row)-1,1)}else if(e.row>0){const t=n.row>=l&&n.row<=c?c+1:l,r=i.getNearestNotHiddenIndex(t,1);e.row=null===r?this.hot.view.countRenderableRowsInRange(n.row,this.hot.countRows()):Math.max(this.hot.view.countRenderableRowsInRange(n.row,r)-1,1)}}function JC(e){const t=this.hot.getSelectedRangeLast(),n=t.clone(),{to:r}=t,{columnIndexMapper:i,rowIndexMapper:o}=this.hot,s=(e,t)=>{n.expand(this.hot._createCellCoords(e,t));for(let r=0;r0){let o=this.mergedCellsCollection.getEndMostColumnIndex(t,r.col)+e.col;s(r.row,o),"W-E"===t.getHorizontalDirection()&&"W-E"===n.getHorizontalDirection()&&(o=n.getBottomEndCorner().col);const a=i.getNearestNotHiddenIndex(o,-1);null!==a&&(e.col=Math.max(this.hot.view.countRenderableColumnsInRange(r.col,a)-1,1))}if(e.row<0){let i=this.mergedCellsCollection.getTopMostRowIndex(t,r.row)+e.row;s(i,r.col),"S-N"===t.getVerticalDirection()&&"S-N"===n.getVerticalDirection()&&(i=n.getTopStartCorner().row);const a=o.getNearestNotHiddenIndex(i,1);null!==a&&(e.row=-Math.max(this.hot.view.countRenderableRowsInRange(a,r.row)-1,1))}else if(e.row>0){let i=this.mergedCellsCollection.getBottomMostRowIndex(t,r.row)+e.row;s(i,r.col),"N-S"===t.getVerticalDirection()&&"N-S"===n.getVerticalDirection()&&(i=n.getBottomStartCorner().row);const a=o.getNearestNotHiddenIndex(i,-1);null!==a&&(e.row=Math.max(this.hot.view.countRenderableRowsInRange(r.row,a)-1,1))}}function eS(){const e=this.hot.getSelectedRangeLast(),{highlight:t}=e;if(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader())return void DC(GC,this,t.clone());for(let r=0;r0||FC(zC,this).col>0?FC(YC,this).setPrevNodeAsActive():("E-W"===n&&FC(zC,this).col<0||"S-N"===t&&FC(zC,this).row<0)&&FC(YC,this).setNextNodeAsActive()}function sS(e,t){const n=this.hot.getSelectedRangeLast(),{columnIndexMapper:r,rowIndexMapper:i}=this.hot;let o=null,s=null;if(FC(zC,this).col<0){const{rowEnd:e,colEnd:t}=FC(YC,this).getPrevHorizontalNode();s=r.getNearestNotHiddenIndex(t,-1),o=i.getNearestNotHiddenIndex(e,-1)}else if(FC(zC,this).col>0){const{rowStart:e,colStart:t}=FC(YC,this).getNextHorizontalNode();s=r.getNearestNotHiddenIndex(t,1),o=i.getNearestNotHiddenIndex(e,1)}else if(FC(zC,this).row<0){const{rowEnd:e,colEnd:t}=FC(YC,this).getPrevVerticalNode();s=r.getNearestNotHiddenIndex(t,-1),o=i.getNearestNotHiddenIndex(e,-1)}else if(FC(zC,this).row>0){const{rowStart:e,colStart:t}=FC(YC,this).getNextVerticalNode();s=r.getNearestNotHiddenIndex(t,1),o=i.getNearestNotHiddenIndex(e,1)}if(null!==o||null!==s){const r=this.hot._createCellCoords(o,s),i=this.mergedCellsCollection.get(r.row,r.col),a=this.hot.selection.highlight.getFocus();e=r.row,t=r.col,i?n.highlight.assign({row:this.hot.rowIndexMapper.getNearestNotHiddenIndex(i.row,1),col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(i.col,1)}):n.highlight.assign(r),a.clear(),a.add(r).commit()}FC(YC,this).setActiveNode(e,t),DC(zC,this,{row:0,col:0})}function aS(){const e=this.hot.getSelectedRangeLast();e.isHeader()||FC(YC,this).buildFocusOrder(this.hot.getSelectedRangeLast())}function lS(e,t,n){const r=this.mergedCellsCollection.get(e,t);r&&(r.row!==e||r.col!==t?n.copyable=!1:(n.rowspan=r.rowspan,n.colspan=r.colspan))}function cS(e){const t=this.hot.countCols();this.modifyViewportRowStart(e,t),this.modifyViewportRowEnd(e,t)}function hS(e){const t=this.hot.countRows();this.modifyViewportColumnStart(e,t),this.modifyViewportColumnEnd(e,t)}function uS(e,t){this.autofillCalculations.correctSelectionAreaSize(t);const n=this.autofillCalculations.getDirection(t,e);let r=e;if(this.autofillCalculations.dragAreaOverlapsCollections(t,r,n))return r=t,r;const i=this.mergedCellsCollection.getWithinRange({from:{row:t[0],col:t[1]},to:{row:t[2],col:t[3]}});return i?(r=this.autofillCalculations.snapDragArea(t,r,n,i),r):r}function dS(e,t){this.mergedCellsCollection.shiftCollections("right",e,t)}function pS(e,t){this.mergedCellsCollection.shiftCollections("left",e,t)}function fS(e,t,n){"auto"!==n&&this.mergedCellsCollection.shiftCollections("down",e,t)}function gS(e,t){this.mergedCellsCollection.shiftCollections("up",e,t)}function mS(e,t){"Autofill.fill"===t&&this.autofillCalculations.recreateAfterDataPopulation(e)}function yS(e,t){if(t&&"area"===t){const t=this.hot.getSelectedRangeLast(),n=this.mergedCellsCollection.getWithinRange(t);Object(u["arrayEach"])(n,n=>{t.getBottomEndCorner().row===n.getLastRow()&&t.getBottomEndCorner().col===n.getLastColumn()&&(e[2]=n.row,e[3]=n.col)})}}function wS(e,t,n,r){if(n)return this.selectionCalculations.getSelectedMergedCellClassName(e,t,n,r)}function bS(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function vS(e,t,n,r){if(!(r instanceof MouseEvent))return;const i=this.hot.getSelectedRangeLast(),o=this.mergedCellsCollection.getByRange(i);if(!o)return;const s=this.hot._createCellCoords(o.row,o.col),a=this.hot._createCellCoords(o.row+o.rowspan-1,o.col+o.colspan-1);return 0===this.hot.selection.getLayerLevel()&&i.isEqual(this.hot._createCellRange(s,s,a))}function ES(e,t){return function(n,r){const[,...i]=n,[,...o]=r;return function n(r){const s=e[r],a=t[r],l=i[r],c=o[r],h=a.multiColumnSorting,u=h.compareFunctionFactory?h.compareFunctionFactory:Ji(a.type),d=u(s,a,h)(l,c);if(d===ki){const e=r+1;if("undefined"!==typeof t[e])return n(e)}return d}(0)}}function CS(){Object(Dr["b"])(Ro["a"]`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously. Only \`multiColumnSorting\` will work.`)}const SS="sort";function RS(e,t,n){const r=[];return!1===n||e.isColumnSorted(t)&&e.getNumberOfSortedColumns()>1&&r.push(`${SS}-${e.getIndexOfColumnInSortQueue(t)+1}`),r}function TS(e){const t=e.className.split(" "),n=new RegExp(`^${SS}-[0-9]{1,2}$`);return t.filter(e=>n.test(e))}function OS(e,t,n){return t=NS(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NS(e){var t=AS(e,"string");return"symbol"==typeof t?t:t+""}function AS(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}const IS="multiColumnSorting",MS=170,xS="columnSorting",_S=IS;Qi(IS,ES);class LS extends fo{constructor(){super(...arguments),OS(this,"pluginKey",IS)}static get PLUGIN_KEY(){return IS}static get PLUGIN_PRIORITY(){return MS}isEnabled(){return super.isEnabled()}enablePlugin(){!this.enabled&&this.hot.getSettings()[this.pluginKey]&&this.hot.getSettings()[xS]&&CS(),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-1===e.row&&e.col>=0&&this.sort(this.getNextSortConfig(e.col,co)),!1},runOnlyIf:()=>{var e,t;const n=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return n&&(null===(t=this.hot.getSelectedRangeLast())||void 0===t?void 0:t.isSingle())&&this.hot.selection.isCellVisible(n)&&n.isHeader()},relativeToGroup:He["a"],position:"before",group:_S})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(_S)}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&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e:[e]}updateHeaderClasses(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{let n;return Object(i["hasClass"])(t.target,"topSelectionHandle-HitArea")?(n=e.hot.getSelectedRangeLast(),e.dragged.push("top"),e.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},t.preventDefault(),!1):Object(i["hasClass"])(t.target,"bottomSelectionHandle-HitArea")?(n=e.hot.getSelectedRangeLast(),e.dragged.push("bottom"),e.touchStartRange={width:n.getWidth(),height:n.getHeight(),direction:n.getDirection()},t.preventDefault(),!1):void 0}),this.eventManager.addEventListener(t,"touchend",t=>Object(i["hasClass"])(t.target,"topSelectionHandle-HitArea")?(n.call(e,"top"),e.touchStartRange=void 0,t.preventDefault(),!1):Object(i["hasClass"])(t.target,"bottomSelectionHandle-HitArea")?(n.call(e,"bottom"),e.touchStartRange=void 0,t.preventDefault(),!1):void 0),this.eventManager.addEventListener(t,"touchmove",t=>{const{rootDocument:n}=this.hot;let r,i,o,s,a,l;if(0===e.dragged.length)return;const c=n.elementFromPoint(t.touches[0].clientX,t.touches[0].clientY);c&&c!==e.lastSetCell&&("TD"!==c.nodeName&&"TH"!==c.nodeName||(r=e.hot.getCoords(c),-1===r.col&&(r.col=0),i=e.hot.getSelectedRangeLast(),o=i.getWidth(),s=i.getHeight(),a=i.getDirection(),1===o&&1===s&&e.hot.selection.setRangeEnd(r),l=e.getCurrentRangeCoords(i,r,e.touchStartRange.direction,a,e.dragged[0]),null!==l.start&&e.hot.selection.setRangeStart(l.start),e.hot.selection.setRangeEnd(l.end),e.lastSetCell=c),t.preventDefault())})}getCurrentRangeCoords(e,t,n,r,i){const o=e.getTopStartCorner(),s=e.getBottomEndCorner(),a=e.getBottomStartCorner(),l=e.getTopEndCorner();let c={start:null,end:null};switch(n){case"NE-SW":switch(r){case"NE-SW":case"NW-SE":c="top"===i?{start:this.hot._createCellCoords(t.row,e.highlight.col),end:this.hot._createCellCoords(a.row,t.col)}:{start:this.hot._createCellCoords(e.highlight.row,t.col),end:this.hot._createCellCoords(t.row,o.col)};break;case"SE-NW":"bottom"===i&&(c={start:this.hot._createCellCoords(s.row,t.col),end:this.hot._createCellCoords(t.row,o.col)});break;default:break}break;case"NW-SE":switch(r){case"NE-SW":"top"===i?c={start:t,end:a}:c.end=t;break;case"NW-SE":"top"===i?c={start:t,end:s}:c.end=t;break;case"SE-NW":"top"===i?c={start:t,end:o}:c.end=t;break;case"SW-NE":"top"===i?c={start:t,end:l}:c.end=t;break;default:break}break;case"SW-NE":switch(r){case"NW-SE":c="bottom"===i?{start:this.hot._createCellCoords(t.row,o.col),end:this.hot._createCellCoords(a.row,t.col)}:{start:this.hot._createCellCoords(o.row,t.col),end:this.hot._createCellCoords(t.row,s.col)};break;case"SW-NE":c="top"===i?{start:this.hot._createCellCoords(e.highlight.row,t.col),end:this.hot._createCellCoords(t.row,s.col)}:{start:this.hot._createCellCoords(t.row,o.col),end:this.hot._createCellCoords(o.row,t.col)};break;case"SE-NW":"bottom"===i?c={start:this.hot._createCellCoords(t.row,l.col),end:this.hot._createCellCoords(o.row,t.col)}:"top"===i&&(c={start:a,end:t});break;default:break}break;case"SE-NW":switch(r){case"NW-SE":case"NE-SW":case"SW-NE":"top"===i&&(c.end=t);break;case"SE-NW":"top"===i?c.end=t:c={start:t,end:o};break;default:break}break;default:break}return c}isDragged(){return this.dragged.length>0}}var US=n("a309");function VS(){let{label:e="",colspan:t=1,origColspan:n=1,collapsible:r=!1,crossHiddenColumns:i=[],isCollapsed:o=!1,isHidden:s=!1,isRoot:a=!1,isPlaceholder:l=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{label:e,colspan:t,origColspan:n,collapsible:r,isCollapsed:o,crossHiddenColumns:i,isHidden:s,isRoot:a,isPlaceholder:l}}function BS(){return{label:"",isPlaceholder:!0}}function WS(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0;const n=[];if(0===t)return n;Object(u["arrayEach"])(e,e=>{const r=[];let i=0;n.push(r),Object(u["arrayEach"])(e,e=>{const n=VS();if(Object(s["isObject"])(e)){const{label:t,colspan:r}=e;n.label=Object(d["stringify"])(t),"number"===typeof r&&r>1&&(n.colspan=r,n.origColspan=r)}else n.label=Object(d["stringify"])(e);i+=n.origColspan;let o=!1;if(i>=t&&(n.colspan=n.origColspan-(i-t),n.origColspan=n.colspan,o=!0),r.push(n),n.colspan>1)for(let t=0;te.length));return Object(u["arrayEach"])(n,e=>{if(e.lengthVS());e.splice(e.length,0,...t)}}),n}function GS(e,t,n){zS(e,t),t.set(e,n)}function zS(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function YS(e,t){return e.get(KS(e,t))}function XS(e,t,n){return e.set(KS(e,t),n),n}function KS(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const $S=["label","collapsible"];var qS=new WeakMap,QS=new WeakMap,ZS=new WeakMap;class JS{constructor(){GS(this,qS,[]),GS(this,QS,0),GS(this,ZS,1/0)}setColumnsLimit(e){XS(ZS,this,e)}setData(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];XS(qS,this,WS(e,YS(ZS,this))),XS(QS,this,YS(qS,this).length)}getData(){return YS(qS,this)}mergeWith(e){Object(u["arrayEach"])(e,e=>{let{row:t,col:n,...r}=e;const i=this.getHeaderSettings(t,n);null!==i&&Object(s["extend"])(i,r,$S)})}map(e){Object(u["arrayEach"])(YS(qS,this),t=>{Object(u["arrayEach"])(t,t=>{const n=e({...t});Object(s["isObject"])(n)&&Object(s["extend"])(t,n,$S)})})}getHeaderSettings(e,t){var n;if(e>=YS(QS,this)||e<0)return null;const r=YS(qS,this)[e];return!1===Array.isArray(r)||t>=r.length?null:null!==(n=r[t])&&void 0!==n?n:null}getHeadersSettings(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const r=[];if(e>=YS(QS,this)||e<0)return r;const i=YS(qS,this)[e];let o=0;for(let s=t;s1&&(s+=e.colspan-1),o===n)break;if(o>n)throw new Error("The last column settings cannot overlap the other header layers")}return r}getLayersCount(){return YS(QS,this)}getColumnsCount(){return YS(QS,this)>0?YS(qS,this)[0].length:0}clear(){XS(qS,this,[]),XS(QS,this,0)}}function eR(e,t,n){return t=tR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tR(e){var t=nR(e,"string");return"symbol"==typeof t?t:t+""}function nR(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}const rR="DF-pre-order";function iR(e,t){let n=e.call(t,this);for(let r=0;r0&&void 0!==arguments[0]?arguments[0]:this;const t=new uR({...e.data});for(let n=0;n1&&void 0!==arguments[1]?arguments[1]:cR;if(!hR.has(t))throw new Error(`Traversal strategy "${t}" does not exist`);hR.get(t).call(this,e,this)}walkUp(e){const t=this,n=r=>{const i=e.call(t,r);!1!==i&&null!==r.parent&&n(r.parent)};n(this)}}function dR(e,t,n){pR(e,t),t.set(e,n)}function pR(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fR(e,t){return e.get(mR(e,t))}function gR(e,t,n){return e.set(mR(e,t),n),n}function mR(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var yR=new WeakMap,wR=new WeakMap,bR=new WeakMap;class vR{constructor(e){dR(this,yR,new Map),dR(this,wR,new Map),dR(this,bR,null),gR(bR,this,e)}getRoots(){return Array.from(fR(yR,this).values())}getRootByColumn(e){let t;return fR(wR,this).has(e)&&(t=fR(yR,this).get(fR(wR,this).get(e))),t}getNode(e,t){const n=this.getRootByColumn(t);if(!n)return;const r=t-fR(wR,this).get(t);let i,o=0;return n.walkDown(n=>{const{data:{origColspan:s,headerLevel:a}}=n;if(e===a){if(r>=o&&r<=o+s-1)return i=n,i.data.isRoot=t===i.data.columnIndex,!1;o+=s}}),i}rebuildTreeIndex(){let e=0;fR(wR,this).clear(),Object(u["arrayEach"])(fR(yR,this),t=>{let[,{data:{colspan:n}}]=t;for(let r=e;r3&&void 0!==arguments[3]?arguments[3]:1;const i=fR(bR,this).getHeadersSettings(n,t,r);n+=1,Object(u["arrayEach"])(i,r=>{const i={...r,headerLevel:n-1,columnIndex:t};let o;1===n?(e.data=i,o=e):(o=new uR(i),e.addChild(o)),n{let{data:n,childs:r}=e;if(!n.isHidden&&(t(n.columnIndex),0===r.length))for(let i=1;i{},affectedColumns:[],colspanCompensation:0};const r=SR(e);if(r)return RR(n[0]);t.isCollapsed=!1;const i=n.slice(1),o=new Set;let s=0;if(i.length>0)Object(u["arrayEach"])(i,e=>{e.replaceTreeWith(e.data.clonedTree),e.data.clonedTree=null;const t=e.data;s+=t.colspan,ER(e,e=>{o.add(e)})});else{const{colspan:e,origColspan:n,columnIndex:r}=t;s=n-e;for(let t=1;t{const{data:t}=e;t.colspan+=s,t.colspan>=t.origColspan?(t.colspan=t.origColspan,t.isCollapsed=!1):SR(e)&&(t.isCollapsed=CR(e,"isCollapsed"))}),{rollbackModification:()=>TR(e),affectedColumns:Array.from(o),colspanCompensation:s}}function TR(e){var t;const{data:n,childs:r}=e;if(n.isCollapsed||n.isHidden||n.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};const i=SR(e);if(i)return TR(r[0]);n.isCollapsed=!0;const o=r.slice(1),s=new Set;if(o.length>0)Object(u["arrayEach"])(o,e=>{ER(e,e=>{s.add(e)}),e.data.clonedTree=e.cloneTree(),e.walkDown(e=>{let{data:t}=e;t.isHidden=!0})});else{const{origColspan:e,columnIndex:t}=n;for(let n=1;n{const{data:t}=e;t.colspan-=a,t.colspan<=1?(t.colspan=1,t.isCollapsed=!0):SR(e)&&(t.isCollapsed=CR(e,"isCollapsed"))}),{rollbackModification:()=>RR(e),affectedColumns:Array.from(s),colspanCompensation:a}}function OR(e,t){if(!Number.isInteger(t))throw new Error("The passed gridColumnIndex argument has invalid type.");if(e.childs.length>0)throw new Error(Ro["a"]`The passed node is not the last node on the tree. Only for\x20 the last node, the hide column modification can be applied.`);const{crossHiddenColumns:n}=e.data;if(n.includes(t))return;let r=!1;e.walkUp(e=>{const{data:{collapsible:t}}=e;if(t)return r=!0,!1}),r||e.walkUp(e=>{const{data:n}=e;n.crossHiddenColumns.push(t),n.colspan>1?n.colspan-=1:n.isHidden=!0})}function NR(e,t){if(!Number.isInteger(t))throw new Error("The passed gridColumnIndex argument has invalid type.");if(e.childs.length>0)throw new Error(Ro["a"]`The passed node is not the last node on the tree. Only for\x20 the last node, the show column modification can be applied.`);const{crossHiddenColumns:n}=e.data;if(!n.includes(t))return;let r=!1;e.walkUp(e=>{const{data:{collapsible:t}}=e;if(t)return r=!0,!1}),r||e.walkUp(e=>{const{data:n}=e;n.crossHiddenColumns.splice(n.crossHiddenColumns.indexOf(t),1),!n.isHidden&&n.colspan{e.walkDown(e=>{const n=e.data,{origColspan:r,columnIndex:i,headerLevel:o,crossHiddenColumns:s}=n,a=_R(t,o);let l=!1;for(let t=i;t{let{row:t,...n}=e;return{row:t<0?this.rowCoordsToLevel(t):t,...n}});jR(DR,this).mergeWith(t),jR(FR,this).buildTree(),kR(UR,this,MR(jR(FR,this).getRoots()))}mapState(e){jR(DR,this).map(e),jR(FR,this).buildTree(),kR(UR,this,MR(jR(FR,this).getRoots()))}mapNodes(e){return Object(u["arrayReduce"])(jR(FR,this).getRoots(),(t,n)=>(n.walkDown(n=>{const r=e(n.data);void 0!==r&&t.push(r)}),t),[])}triggerNodeModification(e,t,n){t<0&&(t=this.rowCoordsToLevel(t));const r=jR(FR,this).getNode(t,n);let i;return r&&(i=IR(e,r,n),kR(UR,this,MR(jR(FR,this).getRoots()))),i}triggerColumnModification(e,t){return this.triggerNodeModification(e,-1,t)}rowCoordsToLevel(e){if(e>=0)return null;const t=e+Math.max(this.getLayersCount(),1);return t<0?null:t}levelToRowCoords(e){if(e<0)return null;const t=e-Math.max(this.getLayersCount(),1);return t>=0?null:t}getHeaderSettings(e,t){var n,r;return e<0&&(e=this.rowCoordsToLevel(e)),null===e||e>=this.getLayersCount()?null:null!==(n=null===(r=jR(UR,this)[e])||void 0===r?void 0:r[t])&&void 0!==n?n:null}getHeaderTreeNodeData(e,t){const n=this.getHeaderTreeNode(e,t);return n?{...n.data}:null}getHeaderTreeNode(e,t){if(e<0&&(e=this.rowCoordsToLevel(e)),null===e||e>=this.getLayersCount())return null;const n=jR(FR,this).getNode(e,t);return n||null}findTopMostEntireHeaderLevel(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const r=n-e+1;let i=!1,o=null;for(let s=e;s<=n;s++){const t=jR(FR,this).getRootByColumn(s);if(!t)break;i=!0,t.walkDown(t=>{const{columnIndex:i,headerLevel:s,origColspan:a,isHidden:l}=t.data;l||a<=r&&i>=e&&i+a-1<=n&&(null===o||s=0){var o;const{isRoot:t}=null!==(o=this.getHeaderSettings(e,i))&&void 0!==o?o:{isRoot:!0};if(t)break;i-=1}return i}findRightMostColumnIndex(e,t){var n;const{isRoot:r,origColspan:i}=null!==(n=this.getHeaderSettings(e,t))&&void 0!==n?n:{isRoot:!0,origColspan:1};if(r)return t+i-1;let o=t+1;while(o'),Object(i["fastInnerHTML"])(a,t),a.colSpan=c.colspan,e.appendChild(a)}}o.appendChild(e)}r.appendChild(o),e.appendChild(r)}clear(){this.widthsMap.clear(),this.container=null}}var YR=zR;function XR(e,t){ZR(e,t),t.add(e)}function KR(e,t,n){return t=$R(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $R(e){var t=qR(e,"string");return"symbol"==typeof t?t:t+""}function qR(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function QR(e,t,n){ZR(e,t),t.set(e,n)}function ZR(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function JR(e,t,n){return e.set(tT(e,t),n),n}function eT(e,t){return e.get(tT(e,t))}function tT(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const nT="nestedHeaders",rT=280;var iT=new WeakMap,oT=new WeakMap,sT=new WeakMap,aT=new WeakMap,lT=new WeakSet;class cT extends en["a"]{constructor(){super(...arguments),XR(this,lT),QR(this,iT,new VR),QR(this,oT,null),QR(this,sT,null),QR(this,aT,!1),KR(this,"ghostTable",new YR(this.hot,(e,t)=>this.getHeaderSettings(e,t))),KR(this,"detectedOverlappedHeaders",!1)}static get PLUGIN_KEY(){return nT}static get PLUGIN_PRIORITY(){return rT}isEnabled(){return!!this.hot.getSettings()[nT]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:t}=this.hot.getSettings();Array.isArray(t)&&Array.isArray(t[0])||Object(Dr["b"])(Ro["a"]`Your Nested Headers plugin configuration is invalid. The settings has to be\x20 passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",()=>tT(lT,this,OT).call(this)),this.addHook("afterLoadData",(function(){for(var t=arguments.length,n=new Array(t),r=0;rtT(lT,this,hT).call(this)),this.addHook("afterSelectionFocusSet",()=>tT(lT,this,hT).call(this)),this.addHook("beforeViewportScrollHorizontally",(function(){for(var t=arguments.length,n=new Array(t),r=0;rtT(lT,this,ET).call(this,e)),this.addHook("modifyColWidth",(function(){for(var t=arguments.length,n=new Array(t),r=0;rtT(lT,this,hT).call(this)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",()=>tT(lT,this,hT).call(this)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();eT(iT,this).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=eT(iT,this).setState(e)),this.detectedOverlappedHeaders&&Object(Dr["b"])(Ro["a"]`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20 is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((e,t)=>{const n=!0===e?"hide-column":"show-column";eT(iT,this).triggerColumnModification(n,t)}),!eT(oT,this)&&this.enabled&&JR(oT,this,this.hot.columnIndexMapper.createChangesObserver("hiding").subscribe(e=>{e.forEach(e=>{let{op:t,index:n,newValue:r}=e;if("replace"===t){const e=!0===r?"hide-column":"show-column";eT(iT,this).triggerColumnModification(e,n)}}),this.ghostTable.buildWidthsMap()})),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.clearColspans(),eT(iT,this).clear(),eT(oT,this).unsubscribe(),JR(oT,this,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return eT(iT,this)}getLayersCount(){return eT(iT,this).getLayersCount()}getHeaderSettings(e,t){return eT(iT,this).getHeaderSettings(e,t)}clearColspans(){if(!this.hot.view)return;const{_wt:e}=this.hot.view,t=e.getSetting("columnHeaders").length,n=e.wtTable.THEAD,r=e.wtOverlays.topOverlay.clone.wtTable.THEAD,o=e.wtOverlays.topInlineStartCornerOverlay?e.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null;for(let s=0;s{var s;const{columnIndexMapper:a,view:l}=this.hot;let c=a.getVisualFromRenderableIndex(r);null===c&&(c=r),o.removeAttribute("colspan"),Object(i["removeClass"])(o,"hiddenHeader");const{colspan:h,isHidden:u,isPlaceholder:d}=null!==(s=eT(iT,this).getHeaderSettings(e,c))&&void 0!==s?s:{label:""};if(d||u)Object(i["addClass"])(o,"hiddenHeader");else if(h>1){var p,f;const{wtOverlays:e}=l._wt,t=null===(p=e.topInlineStartCornerOverlay)||void 0===p?void 0:p.clone.wtTable.THEAD.contains(o),i=null===(f=e.inlineStartOverlay)||void 0===f?void 0:f.clone.wtTable.THEAD.contains(o),s=t||i?Math.min(h,n-r):h;s>1&&o.setAttribute("colspan",s)}this.hot.view.appendColHeader(c,o,(function(){return t.getColumnHeaderValue(...arguments)}),e)}}getColumnHeaderValue(e,t){var n;const{isHidden:r,isPlaceholder:i}=null!==(n=eT(iT,this).getHeaderSettings(t,e))&&void 0!==n?n:{};return i||r?"":this.hot.getColHeader(e,t)}destroy(){JR(iT,this,null),null!==eT(oT,this)&&(eT(oT,this).unsubscribe(),JR(oT,this,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return eT(iT,this).getHeaderTreeNodeData(e.row,e.col)}}function hT(){var e;const t=null===(e=this.hot)||void 0===e?void 0:e.getSelectedRangeLast();if(!t)return;const{highlight:n}=t,r=n.isHeader()&&n.col>=0;if(r){const e=eT(iT,this).findLeftMostColumnIndex(n.row,n.col),t=this.hot.selection.highlight.getFocus();t.visualCellRange.highlight.col=e,t.visualCellRange.from.col=e,t.visualCellRange.to.col=e,t.commit()}}function uT(e){const t=this.hot.getSelectedRangeLast();if(!t)return e;const{highlight:n}=t,r=n.isHeader()&&n.col>=0;if(!r)return e;const i=this.hot.view.getFirstFullyVisibleColumn(),o=this.hot.view.getLastFullyVisibleColumn(),s=eT(iT,this).findLeftMostColumnIndex(n.row,n.col),a=eT(iT,this).findRightMostColumnIndex(n.row,n.col);return so?e:ss-i||!a))return null;return e}function pT(e,t,n){let{columnHeadersCount:r}=n;if(0!==r)for(let o=0;o=0||1===c)break;for(let t=r;t<=a;t++)for(let o=n;o<=s;o++){var i;const n=l+o,s=t-r;if(0===s)continue;const a=null===(i=eT(iT,this).getHeaderTreeNodeData(o,t))||void 0===i?void 0:i.isRoot;!1===a&&(e[n][s]="")}}}function fT(e,t,n,r){const i=this._getHeaderTreeNodeDataByCoords(t);i&&(r.column=!0)}function gT(e,t){const n=this._getHeaderTreeNodeDataByCoords(t);if(!n)return;JR(sT,this,t.clone()),JR(aT,this,!0);const{selection:r}=this.hot,i=r.isSelected()?r.getSelectedRange().current():null,s=[],{columnIndex:a,origColspan:l}=n,c=!r.inInSelection(t);e.shiftKey&&i?t.coli.from.col?s.push(i.getTopStartCorner().col,a+l-1,t.row):s.push(a,a+l-1,t.row):(Object(o["isLeftClick"])(e)||Object(o["isRightClick"])(e)&&c)&&s.push(a,a+l-1,t.row),r.selectColumns(...s)}function mT(e,t,n,r){if(!this.hot.view.isMouseDown())return;const i=this._getHeaderTreeNodeDataByCoords(t);if(!i)return;const{columnIndex:o,origColspan:s}=i,a=this.hot.getSelectedRangeLast(),l=a.getTopStartCorner(),c=a.getBottomEndCorner(),{from:h}=a;r.column=!0,r.cell=!0;const u=[],d=Object(rt["clamp"])(t.row,-1/0,-1);t.colh.col?u.push(l.col,o+s-1,d):u.push(o,o+s-1,d),this.hot.selection.selectColumns(...u)}function yT(){JR(aT,this,!1)}function wT(){const{navigableHeaders:e}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!eT(aT,this)||!e)return;const t=this.hot.getSelectedRangeLast(),n=t.getTopStartCorner().col,r=t.getBottomEndCorner().col,{columnIndex:i,origColspan:o}=eT(iT,this).getHeaderTreeNodeData(eT(sT,this).row,eT(sT,this).col);if(t.setHighlight(eT(sT,this)),o>t.getWidth()||ir){const e=eT(iT,this).findTopMostEntireHeaderLevel(Object(rt["clamp"])(n,i,i+o-1),Object(rt["clamp"])(r,i,i+o-1));t.highlight.row=e,t.highlight.col=t.from.col}}function bT(e){const{highlight:t}=this.hot.getSelectedRangeLast(),n=this.hot._createCellCoords(t.row+e.row,t.col+e.col),r=n.isHeader()&&n.col>=0;if(!r)return;const i=eT(iT,this).findLeftMostColumnIndex(n.row,n.col),o=eT(iT,this).findRightMostColumnIndex(n.row,n.col);if(e.col<0){const n=t.col>=i&&t.col<=o?i-1:o,r=this.hot.columnIndexMapper.getNearestNotHiddenIndex(n,-1);e.col=null===r?-this.hot.view.countRenderableColumnsInRange(0,t.col):-Math.max(this.hot.view.countRenderableColumnsInRange(r,t.col)-1,1)}else if(e.col>0){const n=t.col>=i&&t.col<=o?o+1:i,r=this.hot.columnIndexMapper.getNearestNotHiddenIndex(n,1);e.col=null===r?this.hot.view.countRenderableColumnsInRange(t.col,this.hot.countCols()):Math.max(this.hot.view.countRenderableColumnsInRange(t.col,r)-1,1)}}function vT(e,t){const n=e.row,r=this._getHeaderTreeNodeDataByCoords({row:n,col:e.col}),i=this._getHeaderTreeNodeDataByCoords({row:n,col:t.col});t.col=e.col&&(r&&(e.col=r.columnIndex),i&&(t.col=i.columnIndex+i.origColspan-1))}function ET(e){e.length=0;for(let t=0;t=0&&(r=!1),Object(rt["isNumeric"])(o)&&on?e:n}function RT(e,t,n){var r;const{label:i}=null!==(r=eT(iT,this).getHeaderTreeNodeData(n,t))&&void 0!==r?r:{label:""};return i}function TT(e,t){if(e<0)return this.hot.getCell(e,eT(iT,this).findLeftMostColumnIndex(e,t),!0)}function OT(){this.updatePlugin()}function NT(e,t){t||this.updatePlugin()}function AT(e,t,n){return t=IT(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IT(e){var t=MT(e,"string");return"symbol"==typeof t?t:t+""}function MT(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class xT{constructor(e,t){AT(this,"hot",void 0),AT(this,"data",null),AT(this,"plugin",void 0),AT(this,"parentReference",new WeakMap),AT(this,"cache",{levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap}),this.hot=t,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},Object(rt["rangeEach"])(0,this.data.length-1,e=>{this.cacheNode(this.data[e],0,null)})}cacheNode(e,t,n){this.cache.levels[t]||(this.cache.levels[t]=[],this.cache.levelCount+=1),this.cache.levels[t].push(e),this.cache.rows.push(e),this.cache.nodeInfo.set(e,{parent:n,row:this.cache.rows.length-1,level:t}),this.hasChildren(e)&&Object(u["arrayEach"])(e.__children,n=>{this.cacheNode(n,t+1,e)})}getDataObject(e){return null===e||void 0===e?null:this.cache.rows[e]}readTreeNodes(e,t,n,r){let i=!1,o=t;if(isNaN(o)&&o.end)return o;let s=e;return s||(s={__children:this.data},i=!0,o-=1),null!==n&&void 0!==n&&o===n?{result:s,end:!0}:null!==r&&void 0!==r&&s===r?{result:o,end:!0}:(o+=1,s.__children&&Object(u["arrayEach"])(s.__children,e=>{if(this.parentReference.set(e,i?null:s),o=this.readTreeNodes(e,o,n,r),isNaN(o)&&o.end)return!1}),o)}mockParent(){const e=this.mockNode();return e.__children=this.data,e}mockNode(){const e={};return Object(s["objectEach"])(this.data[0],(t,n)=>{e[n]=null}),e}getRowIndex(e){return null===e||void 0===e?null:this.cache.nodeInfo.get(e).row}getRowIndexWithinParent(e){let t=null;t=isNaN(e)?e:this.getDataObject(e);const n=this.getRowParent(e);return null===n||void 0===n?this.data.indexOf(t):n.__children.indexOf(t)}countAllRows(){const e={__children:this.data};return this.countChildren(e)}countChildren(e){let t=0,n=e;return isNaN(n)||(n=this.getDataObject(n)),n&&n.__children?(Object(u["arrayEach"])(n.__children,e=>{t+=1,e.__children&&(t+=this.countChildren(e))}),t):0}getRowParent(e){let t;return t=isNaN(e)?e:this.getDataObject(e),this.getRowObjectParent(t)}getRowObjectParent(e){return e&&"object"===typeof e?this.cache.nodeInfo.get(e).parent:null}getRowLevel(e){let t=null;return t=isNaN(e)?e:this.getDataObject(e),t?this.getRowObjectLevel(t):null}getRowObjectLevel(e){return null===e||void 0===e?null:this.cache.nodeInfo.get(e).level}hasChildren(e){let t=e;return isNaN(t)||(t=this.getDataObject(t)),!(!t.__children||!t.__children.length)}isChild(e){return null!==this.getRowParent(e)}getChild(e,t){var n;return(null===(n=e.__children)||void 0===n?void 0:n[t])||null}isRowHighestLevel(e){return!this.isChild(e)}isParent(e){var t;let n=e;return isNaN(n)||(n=this.getDataObject(n)),n&&!!n.__children&&0!==(null===(t=n.__children)||void 0===t?void 0:t.length)}addChild(e,t){let n=t;this.hot.runHooks("beforeAddChild",e,n);let r=null;e&&(r=this.getRowIndex(e)),this.hot.runHooks("beforeCreateRow",r+this.countChildren(e)+1,1);let i=e;e||(i=this.mockParent()),i.__children||(i.__children=[]),n||(n=this.mockNode()),i.__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,t,n){let r,i=n;if(i||(i=this.mockNode()),this.hot.runHooks("beforeAddChild",e,i,t),e){const n=this.getRowIndex(e),o=n+t+1;this.hot.runHooks("beforeCreateRow",o,1),e.__children.splice(t,null,i),this.rewriteCache(),this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(e),"__children",e.__children,"NestedRows.addChildAtIndex"),this.hot.rowIndexMapper.insertIndexes(o,1),this.plugin.enableCoreAPIModifiers(),this.hot.runHooks("afterCreateRow",o,1),r=o}else this.plugin.disableCoreAPIModifiers(),this.hot.alter("insert_row_above",t,1,"NestedRows.addChildAtIndex"),this.plugin.enableCoreAPIModifiers(),r=this.getRowIndex(this.data[t]);i=this.getDataObject(r),this.hot.runHooks("afterAddChild",e,i,t)}addSibling(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"below";const n=this.translateTrimmedRow(e),r=this.getRowParent(n),i=this.getRowIndexWithinParent(n);switch(t){case"below":this.addChildAtIndex(r,i+1,null);break;case"above":this.addChildAtIndex(r,i,null);break;default:break}}detachFromParent(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=null;const r=[];Array.isArray(e)?(Object(rt["rangeEach"])(e[0],e[2],e=>{const t=this.translateTrimmedRow(e);r.push(this.getDataObject(t))}),Object(rt["rangeEach"])(0,r.length-2,e=>{this.detachFromParent(r[e],!1)}),n=r[r.length-1]):n=e;const i=this.getRowIndex(n),o=this.countChildren(n),s=this.getRowIndexWithinParent(n),a=this.getRowParent(n),l=this.getRowParent(a),c=this.getRowIndex(l);let h=null;if(this.hot.runHooks("beforeDetachChild",a,n),null!==s&&void 0!==s){const e=Array.from(new Array(i+o+1).keys()).splice(-1*(o+1));if(this.hot.runHooks("beforeRemoveRow",i,o+1,e,this.plugin.pluginName),a.__children.splice(s,1),this.rewriteCache(),this.hot.runHooks("afterRemoveRow",i,o+1,e,this.plugin.pluginName),l){h=c+this.countChildren(l);const e=this.getChild(l,this.countChildren(l)-1),t=this.getRowIndex(e);this.hot.runHooks("beforeCreateRow",t+1,o+1,this.plugin.pluginName),l.__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",a,n,this.getRowIndex(n)),t&&this.hot.render()}filterData(e,t,n){const r=[];Object(u["arrayEach"])(n,e=>{r.push(this.getDataObject(e))}),Object(u["arrayEach"])(r,e=>{const t=this.getRowIndexWithinParent(e),n=this.getRowParent(e);null===n?this.data.splice(t,1):n.__children.splice(t,1)}),this.rewriteCache()}spliceData(e,t,n){const r=this.getDataObject(e-1);let i=null,o=e;r&&r.__children&&0===r.__children.length?(i=r,o=0):et;let c=i?this.getRowParent(t-1):this.getRowParent(t);null!==c&&void 0!==c||(c=this.getRowParent(t-1)),null!==c&&void 0!==c||(c=this.getDataObject(t-1)),c?c.__children||(c.__children=[]):(c=this.getDataObject(t),c.__children=[]);const h=i||n||r?c.__children.length:this.getRowIndexWithinParent(t),u=o===c;c.__children.splice(h,0,a[0]),o.__children.splice(s+(l&&u?1:0),1),this.syncRowWithRawSource(o),u||this.syncRowWithRawSource(c)}translateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.translateTrimmedRow(e):e}untranslateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.untranslateTrimmedRow(e):e}}var _T=xT;function LT(e,t,n){return t=PT(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PT(e){var t=kT(e,"string");return"symbol"==typeof t?t:t+""}function kT(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class jT{constructor(e,t){LT(this,"hot",void 0),LT(this,"plugin",void 0),this.hot=t,this.plugin=e}}var HT=jT;class DT extends HT{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,t){super(e,t),this.dataManager=this.plugin.dataManager,this.collapsingUI=this.plugin.collapsingUI,this.rowHeaderWidthCache=null}appendLevelIndicators(e,t){const n=this.hot.toPhysicalRow(e),r=this.dataManager.getRowLevel(n),o=this.dataManager.getDataObject(n),s=t.getElementsByTagName("DIV")[0],a=s.querySelector("span.rowHeader"),l=s.querySelectorAll('[class^="ht_nesting"]'),c=this.hot.getSettings().ariaTags;if(Object(u["arrayEach"])(l,e=>{e&&s.removeChild(e)}),Object(i["addClass"])(t,DT.CSS_CLASSES.indicatorContainer),r){const{rootDocument:e}=this.hot,t=a.cloneNode(!0);s.innerHTML="",Object(rt["rangeEach"])(0,r-1,()=>{const t=e.createElement("SPAN");Object(i["addClass"])(t,DT.CSS_CLASSES.emptyIndicator),s.appendChild(t)}),s.appendChild(t)}if(this.dataManager.hasChildren(o)){const e=this.hot.rootDocument.createElement("DIV");c&&Object(i["setAttribute"])(e,[Object(y["n"])()]),Object(i["addClass"])(t,DT.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(n)?(Object(i["addClass"])(e,`${DT.CSS_CLASSES.button} ${DT.CSS_CLASSES.expandButton}`),c&&Object(i["setAttribute"])(t,[Object(y["k"])(!1)])):(Object(i["addClass"])(e,`${DT.CSS_CLASSES.button} ${DT.CSS_CLASSES.collapseButton}`),c&&Object(i["setAttribute"])(t,[Object(y["k"])(!0)])),s.appendChild(e)}}updateRowHeaderWidth(e){let t=e;t||(t=this.dataManager.cache.levelCount),this.rowHeaderWidthCache=Math.max(50,11+10*t+25),this.hot.render()}}var FT=DT;class UT extends HT{constructor(e,t){var n;super(e,t),n=this,this.dataManager=this.plugin.dataManager,this.collapsedRows=[],this.collapsedRowsStash={stash:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n.lastCollapsedRows=n.collapsedRows.slice(0),n.expandMultipleChildren(n.lastCollapsedRows,e)},shiftStash:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;null!==t&&void 0!==t||(t=1/0),Object(u["arrayEach"])(n.lastCollapsedRows,(i,o)=>{i>=e&&i0&&void 0!==arguments[0])||arguments[0];n.collapseMultipleChildren(n.lastCollapsedRows,e),n.lastCollapsedRows=void 0},trimStash:(e,t)=>{Object(rt["rangeEach"])(e,e+t-1,e=>{const t=this.lastCollapsedRows.indexOf(e);t>-1&&this.lastCollapsedRows.splice(t,1)})}}}collapseChildren(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=[];let i=null,o=null,s=null;return isNaN(e)?(i=e,o=this.dataManager.getRowIndex(i)):(i=this.dataManager.getDataObject(e),o=e),this.dataManager.hasChildren(i)&&Object(u["arrayEach"])(i.__children,e=>{r.push(this.dataManager.getRowIndex(e))}),s=this.collapseRows(r,!0,!1),n&&this.trimRows(s),t&&this.renderAndAdjust(),-1===this.collapsedRows.indexOf(o)&&this.collapsedRows.push(o),s}collapseMultipleChildren(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=[];Object(u["arrayEach"])(e,e=>{r.push(...this.collapseChildren(e,!1,!1))}),n&&this.trimRows(r),t&&this.renderAndAdjust()}collapseRow(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.collapseRows([e],t)}collapseRows(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[];return Object(u["arrayEach"])(e,e=>{r.push(e),t&&this.collapseChildRows(e,r)}),n&&this.trimRows(r),r}collapseChildRows(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.dataManager.hasChildren(e)){const n=this.dataManager.getDataObject(e);Object(u["arrayEach"])(n.__children,e=>{const n=this.dataManager.getRowIndex(e);t.push(n),this.collapseChildRows(n,t)})}n&&this.trimRows(t)}expandRow(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.expandRows([e],t)}expandRows(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[];return Object(u["arrayEach"])(e,e=>{r.push(e),t&&this.expandChildRows(e,r)}),n&&this.untrimRows(r),r}expandChildRows(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(this.dataManager.hasChildren(e)){const n=this.dataManager.getDataObject(e);Object(u["arrayEach"])(n.__children,e=>{if(!this.isAnyParentCollapsed(e)){const n=this.dataManager.getRowIndex(e);t.push(n),this.expandChildRows(n,t)}})}n&&this.untrimRows(t)}expandChildren(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=[];let i=null,o=null,s=null;return isNaN(e)?(i=e,o=this.dataManager.getRowIndex(e)):(i=this.dataManager.getDataObject(e),o=e),this.collapsedRows.splice(this.collapsedRows.indexOf(o),1),this.dataManager.hasChildren(i)&&Object(u["arrayEach"])(i.__children,e=>{const t=this.dataManager.getRowIndex(e);r.push(t)}),s=this.expandRows(r,!0,!1),n&&this.untrimRows(s),t&&this.renderAndAdjust(),s}expandMultipleChildren(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=[];Object(u["arrayEach"])(e,e=>{r.push(...this.expandChildren(e,!1,!1))}),n&&this.untrimRows(r),t&&this.renderAndAdjust()}collapseAll(){const e=this.dataManager.getData(),t=[];Object(u["arrayEach"])(e,e=>{this.dataManager.hasChildren(e)&&t.push(e)}),this.collapseMultipleChildren(t),this.renderAndAdjust()}expandAll(){const e=this.dataManager.getData(),t=[];Object(u["arrayEach"])(e,e=>{this.dataManager.hasChildren(e)&&t.push(e)}),this.expandMultipleChildren(t),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution(()=>{Object(u["arrayEach"])(e,e=>{this.plugin.collapsedRowsMap.setValueAtIndex(e,!0)})},!0)}untrimRows(e){this.hot.batchExecution(()=>{Object(u["arrayEach"])(e,e=>{this.plugin.collapsedRowsMap.setValueAtIndex(e,!1)})},!0)}areChildrenCollapsed(e){let t=isNaN(e)?e:this.dataManager.getDataObject(e),n=!0;return null===t&&(t={__children:this.dataManager.data}),this.dataManager.hasChildren(t)&&Object(u["arrayEach"])(t.__children,e=>{const t=this.dataManager.getRowIndex(e);if(!this.plugin.collapsedRowsMap.getValueAtIndex(t))return n=!1,!1}),n}isAnyParentCollapsed(e){let t=e;while(null!==t){t=this.dataManager.getRowParent(t);const e=this.dataManager.getRowIndex(t);if(this.collapsedRows.indexOf(e)>-1)return!0}return!1}toggleState(e,t){if(t.col>=0)return;const n=this.translateTrimmedRow(t.row);Object(i["hasClass"])(e.target,FT.CSS_CLASSES.button)&&(this.areChildrenCollapsed(n)?this.expandChildren(n):this.collapseChildren(n),Object(o["stopImmediatePropagation"])(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.render(),this.hot.view.adjustElementsSize()}}var VT=UT;function BT(e,t,n){WT(e,t),t.set(e,n)}function WT(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function GT(e,t,n){return t=zT(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zT(e){var t=YT(e,"string");return"symbol"==typeof t?t:t+""}function YT(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function XT(e,t){return e.get(KT(e,t))}function KT(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var $T=new WeakMap;class qT extends HT{constructor(){super(...arguments),GT(this,"dataManager",this.plugin.dataManager),BT(this,$T,{row_above:(e,t)=>{const n=t[t.length-1];this.dataManager.addSibling(n.start.row,"above")},row_below:(e,t)=>{const n=t[t.length-1];this.dataManager.addSibling(n.start.row,"below")}})}appendOptions(e){const t=[{key:"add_child",name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD"])},callback:()=>{const e=this.dataManager.translateTrimmedRow(this.hot.getSelectedLast()[0]),t=this.dataManager.getDataObject(e);this.dataManager.addChild(t)},disabled:()=>{const e=this.hot.getSelectedLast();return!e||e[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{key:"detach_from_parent",name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD"])},callback:()=>{this.dataManager.detachFromParent(this.hot.getSelectedLast())},disabled:()=>{const e=this.hot.getSelectedLast(),t=this.dataManager.translateTrimmedRow(e[0]),n=this.dataManager.getRowParent(t);return!n||!e||e[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{name:"---------"}];return Object(rt["rangeEach"])(0,e.items.length-1,n=>{if(0===n)return Object(u["arrayEach"])(t,(t,r)=>{e.items.splice(n+r,0,t)}),!1}),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return Object(rt["rangeEach"])(0,e.items.length-1,t=>{const n=XT($T,this)[e.items[t].key];null!==n&&void 0!==n&&(e.items[t].callback=n)}),e}}var QT=qT;function ZT(e,t,n){return t=JT(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JT(e){var t=eO(e,"string");return"symbol"==typeof t?t:t+""}function eO(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class tO{constructor(e){ZT(this,"plugin",void 0),ZT(this,"hot",void 0),ZT(this,"dataManager",void 0),ZT(this,"collapsingUI",void 0),this.plugin=e,this.hot=e.hot,this.dataManager=e.dataManager,this.collapsingUI=e.collapsingUI}onBeforeRowMove(e,t,n,r){const i=this.displayAPICompatibilityWarning({rows:e,finalIndex:t,dropIndex:n,movePossible:r});if(i)return!1;this.movedToCollapsed=!1;const o=n===this.hot.countRows(),s=o?this.hot.countSourceRows():this.dataManager.translateTrimmedRow(n);let a=!0;const l=e.map(e=>{if(!a)return!1;const t=this.dataManager.translateTrimmedRow(e);return a=this.shouldAllowMoving(t,s),t}),c=-1===l.indexOf(s);if(!a||!c)return!1;const h=this.getBaseParent(l),u=this.getTargetParent(o,s),d=h===u;return this.movedToCollapsed=this.collapsingUI.areChildrenCollapsed(u),this.collapsingUI.collapsedRowsStash.stash(),this.shiftCollapsibleParentsLocations(l,s,d),this.moveRows(l,s,u),this.dataManager.rewriteCache(),this.moveCellsMeta(l,s),this.collapsingUI.collapsedRowsStash.applyStash(!1),this.hot.runHooks("afterRowMove",e,t,n,r,r&&this.isRowOrderChanged(e,t)),this.hot.render(),this.selectCells(e,n),!1}displayAPICompatibilityWarning(e){const{rows:t,finalIndex:n,dropIndex:r,movePossible:i}=e;let o=!1;return Object(d["isUndefined"])(r)&&(Object(Dr["b"])(Ro["a"]`Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\x20 when the NestedRows plugin is enabled. Please use the 'dragRows' method instead.`),this.hot.runHooks("afterRowMove",t,n,r,i,!1),o=!0),o}shouldAllowMoving(e,t){return!(this.dataManager.isParent(e)||this.dataManager.isRowHighestLevel(e)||e===t||0===t)}getBaseParent(e){return this.dataManager.getRowParent(e[0])}getTargetParent(e,t){let n=this.dataManager.getRowParent(e?t-1:t);return null!==n&&void 0!==n||(n=this.dataManager.getRowParent(t-1)),n}shiftCollapsibleParentsLocations(e,t,n){n||(Math.max(...e)<=t?this.collapsingUI.collapsedRowsStash.shiftStash(e[0],t,-1*e.length):this.collapsingUI.collapsedRowsStash.shiftStash(t,e[0],e.length))}moveRows(e,t,n){const r=t===this.dataManager.getRowIndex(n)+this.dataManager.countChildren(n)+1;this.hot.batchRender(()=>{e.forEach(e=>{this.dataManager.moveRow(e,t,this.movedToCollapsed,r)})})}moveCellsMeta(e,t){const n=[],r=Math.max(...e){n.push(this.hot.getCellMetaAtRow(e))}),this.hot.spliceCellsMeta(e[0],e.length),this.hot.spliceCellsMeta(t-(r?n.length:0),0,...n)}selectCells(e,t){const n=e.length;let r=0,i=0,o=null,s=null;if(this.movedToCollapsed){let o=null;o=e[n-1]e-n!==t)}}function nO(e,t){iO(e,t),t.add(e)}function rO(e,t,n){iO(e,t),t.set(e,n)}function iO(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function oO(e,t,n){return t=sO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sO(e){var t=aO(e,"string");return"symbol"==typeof t?t:t+""}function aO(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function lO(e,t){return e.get(hO(e,t))}function cO(e,t,n){return e.set(hO(e,t),n),n}function hO(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const uO="nestedRows",dO=300,pO=uO,fO="The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled.";var gO=new WeakMap,mO=new WeakMap,yO=new WeakSet;class wO extends en["a"]{constructor(){super(...arguments),nO(this,yO),oO(this,"dataManager",null),oO(this,"headersUI",null),oO(this,"collapsedRowsMap",null),rO(this,gO,!1),rO(this,mO,!1)}static get PLUGIN_KEY(){return uO}static get PLUGIN_PRIORITY(){return dO}isEnabled(){return!!this.hot.getSettings()[uO]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new Cg["a"]),this.dataManager=new _T(this,this.hot),this.collapsingUI=new VT(this,this.hot),this.headersUI=new FT(this,this.hot),this.contextMenuUI=new QT(this,this.hot),this.rowMoveController=new tO(this),this.addHook("afterInit",(function(){for(var t=arguments.length,n=new Array(t),r=0;rhO(yO,this,PO).call(this,e)),this.addHook("beforeUpdateData",e=>hO(yO,this,PO).call(this,e)),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(),t=this.collapsingUI.translateTrimmedRow(e.row);return this.collapsingUI.areChildrenCollapsed(t)?this.collapsingUI.expandChildren(t):this.collapsingUI.collapseChildren(t),!1},runOnlyIf:()=>{var e,t;const n=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;return n&&(null===(t=this.hot.getSelectedRangeLast())||void 0===t?void 0:t.isSingle())&&this.hot.selection.isCellVisible(n)&&-1===n.col&&n.row>=0},group:pO,relativeToGroup:He["a"],position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(pO)}disableCoreAPIModifiers(){cO(mO,this,!0)}enableCoreAPIModifiers(){cO(mO,this,!1)}onModifyRowData(e){if(!lO(mO,this))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!lO(mO,this))return this.dataManager.countAllRows()}onBeforeDataSplice(e,t,n){return!(!lO(mO,this)&&!this.dataManager.isRowHighestLevel(e))||(this.dataManager.spliceData(e,t,n),!1)}destroy(){super.destroy()}}function bO(e,t,n,r){return this.rowMoveController.onBeforeRowMove(e,t,n,r)}function vO(e,t,n){this.collapsingUI.toggleState(e,t,n)}function EO(e,t,n){return this.collapsingUI.collapsedRowsStash.stash(),this.collapsingUI.collapsedRowsStash.trimStash(n[0],t),this.collapsingUI.collapsedRowsStash.shiftStash(n[0],null,-1*t),this.dataManager.filterData(e,t,n),cO(gO,this,!0),this.dataManager.getData().slice()}function CO(e){return this.contextMenuUI.appendOptions(e)}function SO(e,t){this.headersUI.appendLevelIndicators(e,t)}function RO(e){return Math.max(this.headersUI.rowHeaderWidthCache,e)}function TO(e,t,n,r){r!==this.pluginName&&this.hot._registerTimeout(()=>{cO(gO,this,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()})}function OO(e,t,n){const r=Array.from(n.reduce((e,t)=>{if(this.dataManager.isParent(t)){const n=this.dataManager.getDataObject(t).__children;return e.add(t),Array.isArray(n)&&n.forEach(t=>e.add(this.dataManager.getRowIndex(t))),e}return e.add(t)},new Set));n.length=0,n.push(...r)}function NO(){this.collapsingUI.collapsedRowsStash.stash()}function AO(e,t){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(t)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function IO(){this.collapsingUI.collapsedRowsStash.stash()}function MO(e,t,n){this.collapsingUI.collapsedRowsStash.shiftStash(n,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function xO(){this.dataManager.rewriteCache()}function _O(){this.headersUI.updateRowHeaderWidth()}function LO(e,t){lO(gO,this)&&(t.skipRender=!0)}function PO(e){if(!Object(Qp["isArrayOfObjects"])(e))return Object(Dr["a"])(fO),this.hot.getSettings()[uO]=!1,void this.disablePlugin();this.dataManager.setData(e),this.dataManager.rewriteCache()}function kO(e,t,n){return t=jO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jO(e){var t=HO(e,"string");return"symbol"==typeof t?t:t+""}function HO(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class DO{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;kO(this,"rootWindow",void 0),kO(this,"prefix",void 0),kO(this,"savedKeys",[]),this.rootWindow=t,this.prefix=e,this.loadSavedKeys()}saveValue(e,t){this.rootWindow.localStorage.setItem(`${this.prefix}_${e}`,JSON.stringify(t)),-1===this.savedKeys.indexOf(e)&&(this.savedKeys.push(e),this.saveSavedKeys())}loadValue(e,t){const n="undefined"===typeof e?t:e,r=this.rootWindow.localStorage.getItem(`${this.prefix}_${n}`);return null===r?void 0:JSON.parse(r)}reset(e){this.rootWindow.localStorage.removeItem(`${this.prefix}_${e}`)}resetAll(){Object(u["arrayEach"])(this.savedKeys,(e,t)=>{this.rootWindow.localStorage.removeItem(`${this.prefix}_${this.savedKeys[t]}`)}),this.clearSavedKeys()}loadSavedKeys(){const e=this.rootWindow.localStorage.getItem(this.prefix+"__persistentStateKeys"),t="string"===typeof e?JSON.parse(e):void 0;this.savedKeys=t||[]}saveSavedKeys(){this.rootWindow.localStorage.setItem(this.prefix+"__persistentStateKeys",JSON.stringify(this.savedKeys))}clearSavedKeys(){this.savedKeys.length=0,this.saveSavedKeys()}}var FO=DO;function UO(e,t,n){return t=VO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VO(e){var t=BO(e,"string");return"symbol"==typeof t?t:t+""}function BO(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}fe["a"].getSingleton().register("persistentStateSave"),fe["a"].getSingleton().register("persistentStateLoad"),fe["a"].getSingleton().register("persistentStateReset");const WO="persistentState",GO=0;class zO extends en["a"]{constructor(){super(...arguments),UO(this,"storage",void 0)}static get PLUGIN_KEY(){return WO}static get PLUGIN_PRIORITY(){return GO}isEnabled(){return!!this.hot.getSettings()[WO]}enablePlugin(){this.enabled||(this.storage||(this.storage=new FO(this.hot.rootElement.id,this.hot.rootWindow)),this.addHook("persistentStateSave",(e,t)=>this.saveValue(e,t)),this.addHook("persistentStateLoad",(e,t)=>this.loadValue(e,t)),this.addHook("persistentStateReset",()=>this.resetValue()),super.enablePlugin())}disablePlugin(){this.storage=void 0,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}loadValue(e,t){t.value=this.storage.loadValue(e)}saveValue(e,t){this.storage.saveValue(e,t)}resetValue(e){"undefined"===typeof e?this.storage.resetAll():this.storage.reset(e)}destroy(){super.destroy()}}function YO(e,t){XO(e,t),t.add(e)}function XO(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function KO(e,t,n){return t=$O(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $O(e){var t=qO(e,"string");return"symbol"==typeof t?t:t+""}function qO(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function QO(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const ZO="search",JO=190,eN="htSearchResult",tN=function(e,t,n,r,i){e.getCellMeta(t,n).isSearchResult=i},nN=function(e,t,n){return!(Object(d["isUndefined"])(e)||null===e||!e.toLocaleLowerCase||0===e.length)&&(!Object(d["isUndefined"])(t)&&null!==t&&-1!==t.toString().toLocaleLowerCase(n.locale).indexOf(e.toLocaleLowerCase(n.locale)))};var rN=new WeakSet;class iN extends en["a"]{constructor(){super(...arguments),YO(this,rN),KO(this,"callback",tN),KO(this,"queryMethod",nN),KO(this,"searchResultClass",eN)}static get PLUGIN_KEY(){return ZO}static get PLUGIN_PRIORITY(){return JO}isEnabled(){return this.hot.getSettings()[ZO]}enablePlugin(){var e=this;if(this.enabled)return;const t=this.hot.getSettings()[ZO];this.updatePluginSettings(t),this.addHook("beforeRenderer",(function(){for(var t=arguments.length,n=new Array(t),r=0;r{this.hot.removeHook("beforeRenderer",t)}),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}query(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getCallback(),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getQueryMethod();const r=this.hot.countRows(),i=this.hot.countCols(),o=[],s=this.hot;return Object(rt["rangeEach"])(0,r-1,r=>{Object(rt["rangeEach"])(0,i-1,i=>{const a=this.hot.getDataAtCell(r,i),l=this.hot.getCellMeta(r,i),c=l.search.callback||t,h=l.search.queryMethod||n,u=h(e,a,l);if(u){const e={row:r,col:i,data:a};o.push(e)}c&&c(s,r,i,a,u)})}),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){Object(s["isObject"])(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}}function oN(e,t,n,r,i,o){const s=o.className||[];let a=[];"string"===typeof s?a=s.split(" "):a.push(...s),this.isEnabled()&&o.isSearchResult?a.includes(this.searchResultClass)||a.push(""+this.searchResultClass):a.includes(this.searchResultClass)&&a.splice(a.indexOf(this.searchResultClass),1),o.className=a.join(" ")}function sN(e,t){aN(e,t),t.add(e)}function aN(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lN(e,t,n){return t=cN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cN(e){var t=hN(e,"string");return"symbol"==typeof t?t:t+""}function hN(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function uN(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const dN="touchScroll",pN=200;var fN=new WeakSet;class gN extends en["a"]{constructor(){super(...arguments),sN(this,fN),lN(this,"scrollbars",[]),lN(this,"clones",[]),lN(this,"lockedCollection",!1),lN(this,"freezeOverlays",!1)}static get PLUGIN_KEY(){return dN}static get PLUGIN_PRIORITY(){return pN}static get SETTING_KEYS(){return!0}isEnabled(){return Object(tn["isTouchSupported"])()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",()=>uN(fN,this,mN).call(this)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",()=>uN(fN,this,yN).call(this)),this.addHook("afterMomentumScroll",()=>uN(fN,this,wN).call(this))}}function mN(){if(this.lockedCollection)return;const{topOverlay:e,bottomOverlay:t,inlineStartOverlay:n,topInlineStartCornerOverlay:r,bottomInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;this.lockedCollection=!0,this.scrollbars.length=0,this.scrollbars.push(e),t.clone&&this.scrollbars.push(t),this.scrollbars.push(n),r&&this.scrollbars.push(r),i&&i.clone&&this.scrollbars.push(i),this.clones=[],e.needFullRender&&this.clones.push(e.clone.wtTable.holder.parentNode),t.needFullRender&&this.clones.push(t.clone.wtTable.holder.parentNode),n.needFullRender&&this.clones.push(n.clone.wtTable.holder.parentNode),r&&this.clones.push(r.clone.wtTable.holder.parentNode),i&&i.clone&&this.clones.push(i.clone.wtTable.holder.parentNode)}function yN(){this.freezeOverlays=!0,Object(u["arrayEach"])(this.clones,e=>{Object(i["addClass"])(e,"hide-tween")})}function wN(){this.freezeOverlays=!1,Object(u["arrayEach"])(this.clones,e=>{Object(i["removeClass"])(e,"hide-tween"),Object(i["addClass"])(e,"show-tween")}),this.hot._registerTimeout(()=>{Object(u["arrayEach"])(this.clones,e=>{Object(i["removeClass"])(e,"show-tween")})},400),Object(u["arrayEach"])(this.scrollbars,e=>{e.refresh(),e.resetFixedPosition()}),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}function bN(e,t){vN(e,t),t.add(e)}function vN(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function EN(e,t,n){return t=CN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CN(e){var t=SN(e,"string");return"symbol"==typeof t?t:t+""}function SN(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function RN(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}const TN="trimRows",ON=330;var NN=new WeakSet;class AN extends en["a"]{constructor(){super(...arguments),bN(this,NN),EN(this,"trimmedRowsMap",null)}static get PLUGIN_KEY(){return TN}static get PLUGIN_PRIORITY(){return ON}isEnabled(){return!!this.hot.getSettings()[TN]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new Cg["a"]),this.trimmedRowsMap.addLocalHook("init",()=>RN(NN,this,IN).call(this)),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[TN];Array.isArray(e)&&this.hot.batchExecution(()=>{this.trimmedRowsMap.clear(),Object(u["arrayEach"])(e,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("trimRows"),super.disablePlugin()}getTrimmedRows(){return this.trimmedRowsMap.getTrimmedIndexes()}trimRows(e){const t=this.getTrimmedRows(),n=this.isValidConfig(e);let r=t;n&&(r=Array.from(new Set(t.concat(e))));const i=this.hot.runHooks("beforeTrimRow",t,r,n);!1!==i&&(n&&this.hot.batchExecution(()=>{Object(u["arrayEach"])(e,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0),this.hot.runHooks("afterTrimRow",t,r,n,n&&r.length>t.length))}trimRow(){for(var e=arguments.length,t=new Array(e),n=0;n0;n&&o&&(Object(u["arrayEach"])(e,e=>{i[e]=!1}),r=Object(u["arrayReduce"])(i,(e,t,n)=>(t&&e.push(n),e),[]));const s=this.hot.runHooks("beforeUntrimRow",t,r,n&&o);!1!==s&&(n&&o&&this.trimmedRowsMap.setValues(i),this.hot.runHooks("afterUntrimRow",t,r,n&&o,n&&r.lengthNumber.isInteger(e)&&e>=0&&e{Object(u["arrayEach"])(e,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0)}n("8e39");const MN="undoRedo",xN="undoRedo";function _N(e){const t=this;this.instance=e,this.doneActions=[],this.undoneActions=[],this.ignoreNewActions=!1,this.enabled=!1,e.addHook("afterChange",(function(n,r){const i=n&&n.length;if(!i)return;const o=n.find(e=>{const[,,t,n]=e;return t!==n});if(!o)return;const s=()=>{const t=n.reduce((e,t)=>(e.push([...t]),e),[]);Object(u["arrayEach"])(t,t=>{t[1]=e.propToCol(t[1])});const r=i>1?this.getSelected():[[t[0][0],t[0][1]]];return new _N.ChangeAction(t,r)};t.done(s,r)})),e.addHook("afterCreateRow",(e,n,r)=>{t.done(()=>new _N.CreateRowAction(e,n),r)});const n=(t,n,r,i)=>{const o=["visualRow","visualCol","row","col","prop"],s=o.length,a=[];return Object(rt["rangeEach"])(r,i,r=>{Object(rt["rangeEach"])(t,n,t=>{const n=e.getCellMeta(t,r);if(Object.keys(n).length!==s){const e=Object.fromEntries(Object.entries(n).filter(e=>{let[t]=e;return!1===o.includes(t)}));a.push([n.visualRow,n.visualCol,e])}})}),a};e.addHook("beforeRemoveRow",(r,i,o,a)=>{const l=()=>{const o=e.toPhysicalRow(r),a=o+i-1,l=Object(s["deepClone"])(t.instance.getSourceData(o,0,o+i-1,t.instance.countSourceCols()-1));return new _N.RemoveRowAction(o,l,e.getSettings().fixedRowsBottom,e.getSettings().fixedRowsTop,e.rowIndexMapper.getIndexesSequence(),n(o,a,0,e.countCols()-1))};t.done(l,a)}),e.addHook("afterCreateCol",(e,n,r)=>{t.done(()=>new _N.CreateColumnAction(e,n),r)}),e.addHook("beforeRemoveCol",(r,i,o,s)=>{const a=()=>{const o=t.instance.getSourceDataArray(),s=(t.instance.countCols()+r)%t.instance.countCols(),a=s+i-1,l=[],c=[],h=[];Object(rt["rangeEach"])(o.length-1,t=>{const n=[],r=o[t];Object(rt["rangeEach"])(s,a,t=>{n.push(r[e.toPhysicalColumn(t)])}),l.push(n)}),Object(rt["rangeEach"])(i-1,t=>{h.push(e.toPhysicalColumn(s+t))}),Array.isArray(e.getSettings().colHeaders)&&Object(rt["rangeEach"])(i-1,t=>{c.push(e.getSettings().colHeaders[e.toPhysicalColumn(s+t)]||null)});const u=e.columnIndexMapper.getIndexesSequence(),d=e.rowIndexMapper.getIndexesSequence();return new _N.RemoveColumnAction(s,h,l,c,u,d,e.getSettings().fixedColumnsStart,n(0,e.countRows(),s,a))};t.done(a,s)}),e.addHook("beforeCellAlignment",(e,n,r,i)=>{t.done(()=>new _N.CellAlignmentAction(e,n,r,i))}),e.addHook("beforeFilter",e=>{t.done(()=>new _N.FiltersAction(e))}),e.addHook("beforeRowMove",(e,n)=>{!1!==e&&t.done(()=>new _N.RowMoveAction(e,n))}),e.addHook("beforeColumnMove",(e,n)=>{!1!==e&&t.done(()=>new _N.ColumnMoveAction(e,n))}),e.addHook("beforeMergeCells",(n,r)=>{r||t.done(()=>new _N.MergeCellsAction(e,n))}),e.addHook("afterUnmergeCells",(n,r)=>{r||t.done(()=>new _N.UnmergeCellsAction(e,n))}),e.addHook("afterInit",()=>{t.init()})}_N.prototype.done=function(e,t){if(this.ignoreNewActions)return;const n="UndoRedo.undo"===t||"UndoRedo.redo"===t||"auto"===t;if(n)return;const r=this.doneActions.slice(),i=this.instance.runHooks("beforeUndoStackChange",r,t);if(!1===i)return;const o=e(),s=this.undoneActions.slice();this.doneActions.push(o),this.instance.runHooks("afterUndoStackChange",r,this.doneActions.slice()),this.instance.runHooks("beforeRedoStackChange",s),this.undoneActions.length=0,this.instance.runHooks("afterRedoStackChange",s,this.undoneActions.slice())},_N.prototype.undo=function(){if(this.isUndoAvailable()){const e=this.doneActions.slice();this.instance.runHooks("beforeUndoStackChange",e);const t=this.doneActions.pop();this.instance.runHooks("afterUndoStackChange",e,this.doneActions.slice());const n=Object(s["deepClone"])(t),r=this.instance.runHooks("beforeUndo",n);if(!1===r)return;this.ignoreNewActions=!0;const i=this,o=this.undoneActions.slice();this.instance.runHooks("beforeRedoStackChange",o),t.undo(this.instance,()=>{i.ignoreNewActions=!1,i.undoneActions.push(t)}),this.instance.runHooks("afterRedoStackChange",o,this.undoneActions.slice()),this.instance.runHooks("afterUndo",n)}},_N.prototype.redo=function(){if(this.isRedoAvailable()){const e=this.undoneActions.slice();this.instance.runHooks("beforeRedoStackChange",e);const t=this.undoneActions.pop();this.instance.runHooks("afterRedoStackChange",e,this.undoneActions.slice());const n=Object(s["deepClone"])(t),r=this.instance.runHooks("beforeRedo",n);if(!1===r)return;this.ignoreNewActions=!0;const i=this,o=this.doneActions.slice();this.instance.runHooks("beforeUndoStackChange",o),t.redo(this.instance,()=>{i.ignoreNewActions=!1,i.doneActions.push(t)}),this.instance.runHooks("afterUndoStackChange",o,this.doneActions.slice()),this.instance.runHooks("afterRedo",n)}},_N.prototype.isUndoAvailable=function(){return this.doneActions.length>0},_N.prototype.isRedoAvailable=function(){return this.undoneActions.length>0},_N.prototype.clear=function(){this.doneActions.length=0,this.undoneActions.length=0},_N.prototype.isEnabled=function(){return this.enabled},_N.prototype.enable=function(){if(this.isEnabled())return;const e=this.instance;this.enabled=!0,jN(e),this.registerShortcuts(),e.addHook("afterChange",kN)},_N.prototype.disable=function(){if(!this.isEnabled())return;const e=this.instance;this.enabled=!1,HN(e),this.unregisterShortcuts(),e.removeHook("afterChange",kN)},_N.prototype.destroy=function(){this.clear(),this.instance=null,this.doneActions=null,this.undoneActions=null},_N.Action=function(){},_N.Action.prototype.undo=function(){},_N.Action.prototype.redo=function(){},_N.ChangeAction=function(e,t){this.changes=e,this.selected=t,this.actionType="change"},Object(s["inherit"])(_N.ChangeAction,_N.Action),_N.ChangeAction.prototype.undo=function(e,t){const n=Object(s["deepClone"])(this.changes),r=e.countEmptyRows(!0),i=e.countEmptyCols(!0);for(let s=0,a=n.length;s=a,h=r>=l,u=c&&h,d=i!==t||s!==r;if(!1===u&&!0===d){const n={row:t,col:r};!1===c&&(n.verticalSnap="top"),!1===h&&(n.horizontalSnap="start"),e.scrollViewportTo(n)}}e.selectCells(this.selected,!1,!1)},_N.ChangeAction.prototype.redo=function(e,t){const n=Object(s["deepClone"])(this.changes);for(let r=0,i=n.length;r=n&&this.index-r{Object.keys(e).forEach(n=>{const i=parseInt(n,10);r.push([this.index+t,isNaN(i)?n:i,e[n]])})}),e.alter("insert_row_above",this.index,this.data.length,"UndoRedo.undo"),this.removedCellMetas.forEach(t=>{let[n,r,i]=t;e.setCellMetaObject(n,r,i)}),e.addHookOnce("afterViewRender",t),e.setSourceDataAtCell(r,null,null,"UndoRedo.undo"),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence)},_N.RemoveRowAction.prototype.redo=function(e,t){e.addHookOnce("afterRemoveRow",t),e.alter("remove_row",this.index,this.data.length,"UndoRedo.redo")},_N.CreateColumnAction=function(e,t){this.index=e,this.amount=t,this.actionType="insert_col"},Object(s["inherit"])(_N.CreateColumnAction,_N.Action),_N.CreateColumnAction.prototype.undo=function(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount,"UndoRedo.undo")},_N.CreateColumnAction.prototype.redo=function(e,t){e.addHookOnce("afterCreateCol",t),e.alter("insert_col_start",this.index,this.amount,"UndoRedo.redo")},_N.RemoveColumnAction=function(e,t,n,r,i,o,s,a){this.index=e,this.indexes=t,this.data=n,this.amount=this.data[0].length,this.headers=r,this.columnPositions=i.slice(0),this.rowPositions=o.slice(0),this.actionType="remove_col",this.fixedColumnsStart=s,this.removedCellMetas=a},Object(s["inherit"])(_N.RemoveColumnAction,_N.Action),_N.RemoveColumnAction.prototype.undo=function(e,t){const n=e.getSettings();n.fixedColumnsStart=this.fixedColumnsStart;const r=this.indexes.slice(0).sort(),i=(e,t,n)=>n[this.indexes.indexOf(r[t])],o=this.data.length,s=[];for(let c=0;c{Object(u["arrayEach"])(r,(n,r)=>{e[n]=s[t][r],l.push([t,n,e[n]])})}),e.setSourceDataAtCell(l,void 0,void 0,"UndoRedo.undo"),"undefined"!==typeof this.headers&&Object(u["arrayEach"])(a,(t,n)=>{e.getSettings().colHeaders[r[n]]=t}),this.removedCellMetas.forEach(t=>{let[n,r,i]=t;e.setCellMetaObject(n,r,i)}),e.batchExecution(()=>{e.rowIndexMapper.setIndexesSequence(this.rowPositions),e.columnIndexMapper.setIndexesSequence(this.columnPositions)},!0),e.addHookOnce("afterViewRender",t),e.render()},_N.RemoveColumnAction.prototype.redo=function(e,t){e.addHookOnce("afterRemoveCol",t),e.alter("remove_col",this.index,this.amount,"UndoRedo.redo")},_N.CellAlignmentAction=function(e,t,n,r){this.stateBefore=e,this.range=t,this.type=n,this.alignment=r},_N.CellAlignmentAction.prototype.undo=function(e,t){Object(u["arrayEach"])(this.range,t=>{t.forAll((t,n)=>{t>=0&&n>=0&&e.setCellMeta(t,n,"className",this.stateBefore[t][n]||" htLeft")})}),e.addHookOnce("afterViewRender",t),e.render()},_N.CellAlignmentAction.prototype.redo=function(e,t){os(this.range,this.type,this.alignment,(t,n)=>e.getCellMeta(t,n),(t,n,r,i)=>e.setCellMeta(t,n,r,i)),e.addHookOnce("afterViewRender",t),e.render()},_N.FiltersAction=function(e){this.conditionsStack=e,this.actionType="filter"},Object(s["inherit"])(_N.FiltersAction,_N.Action),_N.FiltersAction.prototype.undo=function(e,t){const n=e.getPlugin("filters");e.addHookOnce("afterViewRender",t),n.conditionCollection.importAllConditions(this.conditionsStack.slice(0,this.conditionsStack.length-1)),n.filter()},_N.FiltersAction.prototype.redo=function(e,t){const n=e.getPlugin("filters");e.addHookOnce("afterViewRender",t),n.conditionCollection.importAllConditions(this.conditionsStack),n.filter()};class LN extends _N.Action{constructor(e,t){super(),this.cellRange=t;const n=this.cellRange.getTopStartCorner(),r=this.cellRange.getBottomEndCorner();this.rangeData=e.getData(n.row,n.col,r.row,r.col)}undo(e,t){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),n.unmergeRange(this.cellRange,!0);const r=this.cellRange.getTopStartCorner();e.populateFromArray(r.row,r.col,this.rangeData,void 0,void 0,"MergeCells")}redo(e,t){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),n.mergeRange(this.cellRange)}}_N.MergeCellsAction=LN;class PN extends _N.Action{constructor(e,t){super(),this.cellRange=t}undo(e,t){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),n.mergeRange(this.cellRange,!0)}redo(e,t){const n=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",t),n.unmergeRange(this.cellRange,!0),e.render()}}function kN(e,t){const n=this;if("loadData"===t)return n.undoRedo.clear()}function jN(e){e.undo=function(){return e.undoRedo.undo()},e.redo=function(){return e.undoRedo.redo()},e.isUndoAvailable=function(){return e.undoRedo.isUndoAvailable()},e.isRedoAvailable=function(){return e.undoRedo.isRedoAvailable()},e.clearUndo=function(){return e.undoRedo.clear()}}function HN(e){delete e.undo,delete e.redo,delete e.isUndoAvailable,delete e.isRedoAvailable,delete e.clearUndo}_N.UnmergeCellsAction=PN,_N.RowMoveAction=function(e,t){this.rows=e.slice(),this.finalRowIndex=t,this.actionType="row_move"},Object(s["inherit"])(_N.RowMoveAction,_N.Action),_N.RowMoveAction.prototype.undo=function(e,t){const n=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",t);const r=Cm(this.rows,this.finalRowIndex,e.rowIndexMapper.getNumberOfIndexes());r.reverse().forEach(e=>{let{from:t,to:r}=e;t{let{from:t,to:r}=e;t!e.altKey,r={runOnlyIf:n,group:MN};t.addShortcuts([{keys:[["Control/Meta","z"]],callback:()=>{this.undo()}},{keys:[["Control/Meta","y"],["Control/Meta","Shift","z"]],callback:()=>{this.redo()}}],r)},_N.prototype.unregisterShortcuts=function(){const e=this.instance.getShortcutManager(),t=e.getContext("grid");t.removeShortcutsByGroup(MN)};const DN=fe["a"].getSingleton();DN.add("afterUpdateSettings",(function(){var e;null===(e=this.getPlugin("undoRedo"))||void 0===e||e.init()})),DN.register("beforeUndo"),DN.register("afterUndo"),DN.register("beforeRedo"),DN.register("afterRedo"),_N.PLUGIN_KEY=xN,_N.SETTING_KEYS=!0;var FN=_N,UN=n("24b5");function VN(){Object(UN["d"])(Tn),Object(UN["d"])(Xn),Object(UN["d"])(cr),Object(UN["d"])(jr),Object(UN["d"])(ni),Object(UN["d"])(fo),Object(UN["d"])(ko),Object(UN["d"])(js),Object(UN["d"])(kl),Object(UN["d"])(Pc),Object(UN["d"])(bh),Object(UN["d"])(xh),Object(UN["d"])(Kh),Object(UN["d"])(Ru),Object(UN["d"])(Hg),Object(UN["d"])(fy),Object(UN["d"])(Jy),Object(UN["d"])(bw),Object(UN["d"])(Dw),Object(UN["d"])(Ob),Object(UN["d"])(ov),Object(UN["d"])($v),Object(UN["d"])(IE),Object(UN["d"])(KC),Object(UN["d"])(LS),Object(UN["d"])(FS),Object(UN["d"])(cT),Object(UN["d"])(wO),Object(UN["d"])(zO),Object(UN["d"])(iN),Object(UN["d"])(gN),Object(UN["d"])(AN),Object(UN["d"])(FN)}function BN(){Ae(),ft(),Mt(),Jt(),VN()}},"8e39":function(e,t,n){"use strict";var r=n("ac4f"),i=n("d3e6"),o=n("cac7");r({target:"Object",stat:!0},{fromEntries:function(e){var t={};return i(e,(function(e,n){o(t,e,n)}),{AS_ENTRIES:!0}),t}})},9046:function(e,t,n){"use strict";var r=n("939b"),i=n("fd18");e.exports=function(e){if("Function"===r(e))return i(e)}},9056:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));n("7a89");var r=n("1096"),i=n("e90f"),o=n("3d57"),s=n("a73f"),a=n("97b9");function l(e,t,n){return t=c(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){var t=h(e,"string");return"symbol"==typeof t?t:t+""}function h(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}class u extends r["a"]{constructor(){super(...arguments),l(this,"orderOfIndexes",[])}getValues(){return this.orderOfIndexes.map(e=>this.indexedValues[e])}setValues(e){this.orderOfIndexes=[...Array(e.length).keys()],super.setValues(e)}setValueAtIndex(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.orderOfIndexes.length;return e0&&void 0!==arguments[0]?arguments[0]:this.indexedValues.length;this.orderOfIndexes.length=0,super.setDefaultValues(e)}insert(e,t){this.indexedValues=Object(i["a"])(this.indexedValues,e,t,this.initValueOrFn),this.orderOfIndexes=Object(s["b"])(this.orderOfIndexes,t),super.insert(e,t)}remove(e){this.indexedValues=Object(i["b"])(this.indexedValues,e),this.orderOfIndexes=Object(o["b"])(this.orderOfIndexes,e),this.orderOfIndexes=Object(s["a"])(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map(e=>[e,this.getValueAtIndex(e)])}}},9394:function(e,t,n){"use strict";var r=n("81b7"),i=n("bf78");e.exports=function(e){return r(i(e))}},"939b":function(e,t,n){"use strict";var r=n("fd18"),i=r({}.toString),o=r("".slice);e.exports=function(e){return o(i(e),8,-1)}},"956b":function(e,t,n){"use strict";var r=n("ac4f"),i=n("fc2d"),o=n("7dcf4"),s=n("2349"),a=n("bf80"),l=n("ae20"),c=1!==[].unshift(0),h=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(e){return e instanceof TypeError}},u=c||!h();r({target:"Array",proto:!0,arity:1,forced:u},{unshift:function(e){var t=i(this),n=o(t),r=arguments.length;if(r){l(n+r);var c=n;while(c--){var h=c+r;c in t?t[h]=t[c]:a(t,h)}for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:200,n=0;const r={lastCallThrottled:!0};let i=null;function o(){for(var o=arguments.length,s=new Array(o),a=0;a{r.lastCallThrottled=!1,e.apply(this,s),n=0,i=void 0},h)),r}return o}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;const r=s(e,t);let i=n;function o(){i=n}function a(){for(var t=arguments.length,n=new Array(t),o=0;o1&&void 0!==arguments[1]?arguments[1]:200,r=null;function i(){for(var i=arguments.length,o=new Array(i),s=0;s{t=e.apply(this,o)},n),t}return i}function c(){for(var e=arguments.length,t=new Array(e),n=0;nt(e),i.apply(this,t))}}function h(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=t?e.apply(this,a):n(a),l}}return n([])}function d(e){const t=e.length;function n(r){return function(){for(var i=arguments.length,o=new Array(i),s=0;s=t?e.apply(this,a):n(a),l}}return n([])}function p(e,t,n,r,o,s,a,l){return Object(i["isDefined"])(l)?e.call(t,n,r,o,s,a,l):Object(i["isDefined"])(a)?e.call(t,n,r,o,s,a):Object(i["isDefined"])(s)?e.call(t,n,r,o,s):Object(i["isDefined"])(o)?e.call(t,n,r,o):Object(i["isDefined"])(r)?e.call(t,n,r):Object(i["isDefined"])(n)?e.call(t,n):e.call(t)}},"97dc":function(e,t,n){"use strict";var r=n("088f");e.exports=function(){var e=r(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},"9acd":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));const r=new Map;function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"common";r.has(e)||r.set(e,new Map);const t=r.get(e);function n(e,n){t.set(e,n)}function i(e){return t.get(e)}function o(e){return t.has(e)}function s(){return[...t.keys()]}function a(){return[...t.values()]}return{register:n,getItem:i,hasItem:o,getNames:s,getValues:a}}},"9c76":function(e,t,n){"use strict";var r=n("7b7f");e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},"9e75":function(e,t,n){"use strict";var r=n("b2ae");e.exports=function(e){var t=+e;return t!==t||0===t?0:r(t)}},"9f10":function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n("1096"),i=n("e90f");class o extends r["a"]{insert(e,t){this.indexedValues=Object(i["a"])(this.indexedValues,e,t,this.initValueOrFn),super.insert(e,t)}remove(e){this.indexedValues=Object(i["b"])(this.indexedValues,e),super.remove(e)}}},a309:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"g",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"f",(function(){return s})),n.d(t,"e",(function(){return a})),n.d(t,"h",(function(){return l})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return h}));const r="active-header",i="header",o="area",s="focus",a="fill",l="row",c="column",h="custom-selection"},a357c:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));n("d06e");var r=n("5d7f"),i=n("8828");const o="base";function s(e,t,n,o,s,a,l){const c=l.ariaTags,h=[],u=[],d=[],p=[];l.className&&Object(r["addClass"])(t,l.className),l.readOnly?(h.push(l.readOnlyCellClassName),c&&p.push(Object(i["y"])())):c&&d.push(Object(i["y"])()[0]),!1===l.valid&&l.invalidCellClassName?(h.push(l.invalidCellClassName),c&&p.push(Object(i["o"])())):(u.push(l.invalidCellClassName),c&&d.push(Object(i["o"])()[0])),!1===l.wordWrap&&l.noWordWrapClassName&&h.push(l.noWordWrapClassName),!a&&l.placeholder&&h.push(l.placeholderCellClassName),Object(r["removeClass"])(t,u),Object(r["addClass"])(t,h),Object(r["removeAttribute"])(t,d),Object(r["setAttribute"])(t,p)}s.RENDERER_TYPE=o},a45f:function(e,t,n){"use strict";var r=n("2408");e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:r(e)}},a60d:function(e,t,n){"use strict";var r=n("d128"),i=n("d435"),o=n("2b75"),s=n("088f"),a=n("24d5"),l=TypeError,c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,u="enumerable",d="configurable",p="writable";t.f=r?o?function(e,t,n){if(s(e),t=a(t),s(n),"function"===typeof e&&"prototype"===t&&"value"in n&&p in n&&!n[p]){var r=h(e,t);r&&r[p]&&(e[t]=n.value,n={configurable:d in n?n[d]:r[d],enumerable:u in n?n[u]:r[u],writable:!1})}return c(e,t,n)}:c:function(e,t,n){if(s(e),t=a(t),s(n),i)try{return c(e,t,n)}catch(r){}if("get"in n||"set"in n)throw new l("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},a68d:function(e,t,n){"use strict";var r,i,o,s=n("bbc8"),a=n("f2e8"),l=n("8793"),c=n("2d2d"),h=n("69ba"),u=n("54d7"),d=n("ab25"),p=n("861e"),f="Object already initialized",g=a.TypeError,m=a.WeakMap,y=function(e){return o(e)?i(e):r(e,{})},w=function(e){return function(t){var n;if(!l(t)||(n=i(t)).type!==e)throw new g("Incompatible receiver, "+e+" required");return n}};if(s||u.state){var b=u.state||(u.state=new m);b.get=b.get,b.has=b.has,b.set=b.set,r=function(e,t){if(b.has(e))throw new g(f);return t.facade=e,b.set(e,t),t},i=function(e){return b.get(e)||{}},o=function(e){return b.has(e)}}else{var v=d("state");p[v]=!0,r=function(e,t){if(h(e,v))throw new g(f);return t.facade=e,c(e,v,t),t},i=function(e){return h(e,v)?e[v]:{}},o=function(e){return h(e,v)}}e.exports={set:r,get:i,has:o,enforce:y,getterFor:w}},a6de:function(e,t,n){"use strict";n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));const r=1,i=2,o=3},a73f:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var r=n("81ea");function i(e,t){return Object(r["arrayMap"])(e,e=>e-t.filter(t=>te>=n?e+i:e)}},a776:function(e,t,n){"use strict";n.r(t),n.d(t,"instanceToHTML",(function(){return a})),n.d(t,"_dataToHTML",(function(){return l})),n.d(t,"htmlToGridSettings",(function(){return c}));n("d06e"),n("70f9");var r=n("7b9c");const i={" ":" ","&":"&","<":"<",">":">"},o=new RegExp(Object.keys(i).map(e=>`(${e})`).join("|"),"gi");function s(e){return"TABLE"===(e&&e.nodeName||"")}function a(e){const t=e.hasColHeaders(),n=e.hasRowHeaders(),i=[t?-1:0,n?-1:0,e.countRows()-1,e.countCols()-1],o=e.getData(...i),s=o.length,a=s>0?o[0].length:0,l=["","
"],c=t?["",""]:[],h=["",""],u=n?1:0,d=t?1:0;for(let p=0;p${e.getColHeader(t-u)}`;else if(a)l=`${e.getRowHeader(p-d)}`;else{const n=o[p][t],{hidden:i,rowspan:s,colspan:a}=e.getCellMeta(p-d,t-u);if(!i){const e=[];if(s&&e.push(`rowspan="${s}"`),a&&e.push(`colspan="${a}"`),Object(r["isEmpty"])(n))l=``;else{const t=n.toString().replace("<","<").replace(">",">").replace(/((\r\n|\n)?|\r\n|\n)/g,"
\r\n").replace(/\x20/gi," ").replace(/\t/gi," ");l=`${t}`}}}s.push(l)}const l=["",...s,""].join("");i?c.splice(1,0,l):h.splice(-1,0,l)}return l.splice(1,0,c.join(""),h.join("")),l.join("")}function l(e){const t=e.length,n=[""];for(let i=0;i");for(let e=0;e/g,">").replace(/((\r\n|\n)?|\r\n|\n)/g,"
\r\n").replace(/\x20{2,}/gi,e=>`${" ".repeat(e.length-1)} `).replace(/\t/gi," ");a.push(`
`)}n.push("",...a,""),i+1===t&&n.push("")}return n.push("
${n}
"),n.join("")}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;const n={},r=t.createDocumentFragment(),a=t.createElement("div");r.appendChild(a);let l=e;if("string"===typeof l){const e=l.replace(/]*?>([\s\S]*?)<\/\s*td>/g,e=>{const t=e.match(/]*?>/g)[0],n=//g,r=e.substring(t.length,e.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(n,"\n").replace("\n","").replaceAll(/<\/(.*)>\s+$/gm,"").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^ $/gm,""),i="";return`${t}${r}${i}`});a.insertAdjacentHTML("afterbegin",""+e),l=a.querySelector("table")}if(!l||!s(l))return;const c=a.querySelector('meta[name$="enerator"]'),h=null!==l.querySelector("tbody th"),u=l.querySelector("tr"),d=u?Array.from(u.cells).reduce((e,t)=>e+t.colSpan,0)-(h?1:0):0,p=l.tFoot&&Array.from(l.tFoot.rows)||[],f=[];let g=!1,m=0,y=0;if(l.tHead){const e=Array.from(l.tHead.rows).filter(e=>{const t=null!==e.querySelector("td");return t&&f.push(e),!t});m=e.length,g=m>0,m>1?n.nestedHeaders=Array.from(e).reduce((e,t)=>{const n=Array.from(t.cells).reduce((e,t,n)=>{if(h&&0===n)return e;const{colSpan:r,innerHTML:i}=t,o=r>1?{label:i,colspan:r}:i;return e.push(o),e},[]);return e.push(n),e},[]):g&&(n.colHeaders=Array.from(e[0].children).reduce((e,t,n)=>(h&&0===n||e.push(t.innerHTML),e),[]))}f.length&&(n.fixedRowsTop=f.length),p.length&&(n.fixedRowsBottom=p.length);const w=[...f,...Array.from(l.tBodies).reduce((e,t)=>(e.push(...Array.from(t.rows)),e),[]),...p];y=w.length;const b=new Array(y);for(let i=0;ivoid 0===e);if("TD"===n){if(l>1||h>1){for(let e=s;e[\r\n]?[\x20]{0,3}/gim,"\r\n"):a.replace(/[\r\n]?/gim,"\r\n"),b[s][u]=t.replace(o,e=>i[e])}else E.push(a)}}return v.length&&(n.mergeCells=v),E.length&&(n.rowHeaders=E),b.length&&(n.data=b),n}},a952:function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return f})),n.d(t,"d",(function(){return g})),n.d(t,"e",(function(){return m})),n.d(t,"f",(function(){return y}));n("7a89"),n("d06e");var r=n("d852"),i=n("81ea"),o=n("7b9c");const s=0,a=1,l=2,c=3,h=[c,l],u=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],d=Symbol("root"),p=Symbol("child");function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;if(t!==d&&t!==p)throw new Error("The second argument is used internally only and cannot be overwritten.");const n=Array.isArray(e),i=t===d;let o=s;if(n){const t=e[0];if(0===e.length)o=a;else if(i&&t instanceof r["a"])o=c;else if(i&&Array.isArray(t))o=f(t,p);else if(e.length>=2&&e.length<=4){const t=!e.some((e,t)=>!u[t].includes(typeof e));t&&(o=l)}}return o}function g(e){let{createCellCoords:t,createCellRange:n,keepDirection:r=!1,propToCol:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!h.includes(e))throw new Error("Unsupported selection ranges schema type was provided.");return function(s){const a=e===c;let l=a?s.from.row:s[0],h=a?s.from.col:s[1],u=a?s.to.row:s[2],d=a?s.to.col:s[3];if("function"===typeof i&&("string"===typeof h&&(h=i(h)),"string"===typeof d&&(d=i(d))),Object(o["isUndefined"])(u)&&(u=l),Object(o["isUndefined"])(d)&&(d=h),!r){const e=l,t=h,n=u,r=d;l=Math.min(e,n),h=Math.min(t,r),u=Math.max(e,n),d=Math.max(t,r)}const p=t(l,h),f=t(u,d);return n(p,p,f)}}function m(e){const t=f(e.getSelected());if(t===s||t===a)return[];const n=g(t,{createCellCoords:e._createCellCoords.bind(e),createCellRange:e._createCellRange.bind(e)}),r=new Set;Object(i["arrayEach"])(e.getSelected(),e=>{const{from:t,to:o}=n(e),s=Math.max(t.col,0),a=o.col-s+1;Object(i["arrayEach"])(Array.from(new Array(a),(e,t)=>s+t),e=>{r.has(e)||r.add(e)})});const o=Array.from(r).sort((e,t)=>e-t),l=Object(i["arrayReduce"])(o,(e,t,n,r)=>(0!==n&&t===r[n-1]+1?e[e.length-1][1]+=1:e.push([t,1]),e),[]);return l}function y(e){const t=f(e.getSelected());if(t===s||t===a)return[];const n=g(t,{createCellCoords:e._createCellCoords.bind(e),createCellRange:e._createCellRange.bind(e)}),r=new Set;Object(i["arrayEach"])(e.getSelected(),e=>{const{from:t,to:o}=n(e),s=Math.max(t.row,0),a=o.row-s+1;Object(i["arrayEach"])(Array.from(new Array(a),(e,t)=>s+t),e=>{r.has(e)||r.add(e)})});const o=Array.from(r).sort((e,t)=>e-t),l=Object(i["arrayReduce"])(o,(e,t,n,r)=>(0!==n&&t===r[n-1]+1?e[e.length-1][1]+=1:e.push([t,1]),e),[]);return l}},aa44:function(e,t,n){"use strict";var r=n("fd18"),i=n("fc2d"),o=Math.floor,s=r("".charAt),a=r("".replace),l=r("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,h=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,r,u,d){var p=n+e.length,f=r.length,g=h;return void 0!==u&&(u=i(u),g=c),a(d,g,(function(i,a){var c;switch(s(a,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,n);case"'":return l(t,p);case"<":c=u[l(a,1,-1)];break;default:var h=+a;if(0===h)return i;if(h>f){var d=o(h/10);return 0===d?i:d<=f?void 0===r[d-1]?s(a,1):r[d-1]+s(a,1):i}c=r[h-1]}return void 0===c?"":c}))}},ab25:function(e,t,n){"use strict";var r=n("de26"),i=n("592a"),o=r("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},ac4f:function(e,t,n){"use strict";var r=n("f2e8"),i=n("485c6").f,o=n("2d2d"),s=n("0e87"),a=n("3df8"),l=n("1d07"),c=n("0c0f");e.exports=function(e,t){var n,h,u,d,p,f,g=e.target,m=e.global,y=e.stat;if(h=m?r:y?r[g]||a(g,{}):r[g]&&r[g].prototype,h)for(u in t){if(p=t[u],e.dontCallGetSet?(f=i(h,u),d=f&&f.value):d=h[u],n=c(m?u:g+(y?".":"#")+u,e.forced),!n&&void 0!==d){if(typeof p==typeof d)continue;l(p,d)}(e.sham||d&&d.sham)&&o(p,"sham",!0),s(h,u,p,e)}}},ae20:function(e,t,n){"use strict";var r=TypeError,i=9007199254740991;e.exports=function(e){if(e>i)throw r("Maximum allowed index exceeded");return e}},b2ae:function(e,t,n){"use strict";var r=Math.ceil,i=Math.floor;e.exports=Math.trunc||function(e){var t=+e;return(t>0?i:r)(t)}},b2c9:function(e,t,n){"use strict";var r=n("8793");e.exports=function(e){return r(e)||null===e}},b343:function(e,t,n){"use strict";e.exports=function(e){try{return!!e()}catch(t){return!0}}},b384:function(e,t,n){"use strict";var r=n("fd18"),i=n("b343"),o=n("73fa"),s=n("69ba"),a=n("d128"),l=n("0a73").CONFIGURABLE,c=n("f072"),h=n("a68d"),u=h.enforce,d=h.get,p=String,f=Object.defineProperty,g=r("".slice),m=r("".replace),y=r([].join),w=a&&!i((function(){return 8!==f((function(){}),"length",{value:8}).length})),b=String(String).split("String"),v=e.exports=function(e,t,n){"Symbol("===g(p(t),0,7)&&(t="["+m(p(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!s(e,"name")||l&&e.name!==t)&&(a?f(e,"name",{value:t,configurable:!0}):e.name=t),w&&n&&s(n,"arity")&&e.length!==n.arity&&f(e,"length",{value:n.arity});try{n&&s(n,"constructor")&&n.constructor?a&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(i){}var r=u(e);return s(r,"source")||(r.source=y(b,"string"==typeof t?t:"")),e};Function.prototype.toString=v((function(){return o(this)&&d(this).source||c(this)}),"toString")},b46a:function(e,t,n){"use strict";e.exports="function"==typeof Bun&&Bun&&"string"==typeof Bun.version},b879:function(e,t,n){"use strict";var r=n("ac4f"),i=n("fc2d"),o=n("7dcf4"),s=n("9e75"),a=n("f41c");r({target:"Array",proto:!0},{at:function(e){var t=i(this),n=o(t),r=s(e),a=r>=0?r:n+r;return a<0||a>=n?void 0:t[a]}}),a("at")},ba51:function(e,t,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!r.call({1:2},1);t.f=o?function(e){var t=i(this,e);return!!t&&t.enumerable}:r},bb2a:function(e,t,n){"use strict";var r=n("7b69"),i=n("2aac"),o=n("088f"),s=n("71ca"),a=n("9582"),l=TypeError;e.exports=function(e,t){var n=arguments.length<2?a(e):t;if(i(n))return o(r(n,e));throw new l(s(e)+" is not iterable")}},bbc8:function(e,t,n){"use strict";var r=n("f2e8"),i=n("73fa"),o=r.WeakMap;e.exports=i(o)&&/native code/.test(String(o))},bd5e:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}));var r=n("7b9c");function i(){Object(r["isDefined"])(console)&&console.warn(...arguments)}function o(){Object(r["isDefined"])(console)&&console.error(...arguments)}},bdd7:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));n("7a89");var r=n("3d57"),i=n("e90f");const o=new Map([["indexesSequence",{getListWithInsertedItems:r["a"],getListWithRemovedItems:r["b"]}],["physicallyIndexed",{getListWithInsertedItems:i["a"],getListWithRemovedItems:i["b"]}]]),s=e=>{if(!1===o.has(e))throw new Error(`Alter strategy with ID '${e}' does not exist.`);return o.get(e)}},bdfe:function(e,t,n){"use strict";var r=n("939b");e.exports=Array.isArray||function(e){return"Array"===r(e)}},bef1:function(e,t,n){"use strict";var r=n("652d"),i=n("e1c6"),o=i.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},bf78:function(e,t,n){"use strict";var r=n("022b"),i=TypeError;e.exports=function(e){if(r(e))throw new i("Can't call method on "+e);return e}},bf80:function(e,t,n){"use strict";var r=n("71ca"),i=TypeError;e.exports=function(e,t){if(!delete e[t])throw new i("Cannot delete property "+r(t)+" of "+r(e))}},c041:function(e,t,n){"use strict";var r=n("652d"),i=n("e1c6");e.exports=Object.keys||function(e){return r(e,i)}},c0c4:function(e,t,n){ /*! @license DOMPurify 2.5.3 | (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.3/LICENSE */ (function(t,n){e.exports=n()})(0,(function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function r(e,i,o){return r=n()?Reflect.construct:function(e,n,r){var i=[null];i.push.apply(i,n);var o=Function.bind.apply(e,i),s=new o;return r&&t(s,r.prototype),s},r.apply(null,arguments)}function i(e){return o(e)||s(e)||a(e)||c()}function o(e){if(Array.isArray(e))return l(e)}function s(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(e,t){if(e){if("string"===typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?n-1:0),i=1;i/gm),Q=m(/\${[\w\W]*}/gm),Z=m(/^data-[\-\w.\u00B7-\uFFFF]/),J=m(/^aria-[\-\w]+$/),ee=m(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),te=m(/^(?:\w+script|data):/i),ne=m(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),re=m(/^html$/i),ie=m(/^[a-z][.\w]*(-[.\w]+)+$/i),oe=function(){return"undefined"===typeof window?null:window},se=function(t,n){if("object"!==e(t)||"function"!==typeof t.createPolicy)return null;var r=null,i="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(i)&&(r=n.currentScript.getAttribute(i));var o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(s){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function ae(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe(),n=function(e){return ae(e)};if(n.version="2.5.3",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,s=t.DocumentFragment,a=t.HTMLTemplateElement,l=t.Node,c=t.Element,h=t.NodeFilter,u=t.NamedNodeMap,d=void 0===u?t.NamedNodeMap||t.MozNamedAttrMap:u,p=t.HTMLFormElement,f=t.DOMParser,m=t.trustedTypes,y=c.prototype,w=H(y,"cloneNode"),b=H(y,"nextSibling"),v=H(y,"childNodes"),L=H(y,"parentNode");if("function"===typeof a){var P=o.createElement("template");P.content&&P.content.ownerDocument&&(o=P.content.ownerDocument)}var le=se(m,r),ce=le?le.createHTML(""):"",he=o,ue=he.implementation,de=he.createNodeIterator,pe=he.createDocumentFragment,fe=he.getElementsByTagName,ge=r.importNode,me={};try{me=j(o).documentMode?o.documentMode:{}}catch(Dt){}var ye={};n.isSupported="function"===typeof L&&ue&&void 0!==ue.createHTMLDocument&&9!==me;var we,be,ve=$,Ee=q,Ce=Q,Se=Z,Re=J,Te=te,Oe=ne,Ne=ie,Ae=ee,Ie=null,Me=k({},[].concat(i(D),i(F),i(U),i(B),i(G))),xe=null,_e=k({},[].concat(i(z),i(Y),i(X),i(K))),Le=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}})),Pe=null,ke=null,je=!0,He=!0,De=!1,Fe=!0,Ue=!1,Ve=!0,Be=!1,We=!1,Ge=!1,ze=!1,Ye=!1,Xe=!1,Ke=!0,$e=!1,qe="user-content-",Qe=!0,Ze=!1,Je={},et=null,tt=k({},["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"]),nt=null,rt=k({},["audio","video","img","source","image","track"]),it=null,ot=k({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),st="http://www.w3.org/1998/Math/MathML",at="http://www.w3.org/2000/svg",lt="http://www.w3.org/1999/xhtml",ct=lt,ht=!1,ut=null,dt=k({},[st,at,lt],T),pt=["application/xhtml+xml","text/html"],ft="text/html",gt=null,mt=255,yt=o.createElement("form"),wt=function(e){return e instanceof RegExp||e instanceof Function},bt=function(t){gt&>===t||(t&&"object"===e(t)||(t={}),t=j(t),we=we=-1===pt.indexOf(t.PARSER_MEDIA_TYPE)?ft:t.PARSER_MEDIA_TYPE,be="application/xhtml+xml"===we?T:R,Ie="ALLOWED_TAGS"in t?k({},t.ALLOWED_TAGS,be):Me,xe="ALLOWED_ATTR"in t?k({},t.ALLOWED_ATTR,be):_e,ut="ALLOWED_NAMESPACES"in t?k({},t.ALLOWED_NAMESPACES,T):dt,it="ADD_URI_SAFE_ATTR"in t?k(j(ot),t.ADD_URI_SAFE_ATTR,be):ot,nt="ADD_DATA_URI_TAGS"in t?k(j(rt),t.ADD_DATA_URI_TAGS,be):rt,et="FORBID_CONTENTS"in t?k({},t.FORBID_CONTENTS,be):tt,Pe="FORBID_TAGS"in t?k({},t.FORBID_TAGS,be):{},ke="FORBID_ATTR"in t?k({},t.FORBID_ATTR,be):{},Je="USE_PROFILES"in t&&t.USE_PROFILES,je=!1!==t.ALLOW_ARIA_ATTR,He=!1!==t.ALLOW_DATA_ATTR,De=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Ue=t.SAFE_FOR_TEMPLATES||!1,Ve=!1!==t.SAFE_FOR_XML,Be=t.WHOLE_DOCUMENT||!1,ze=t.RETURN_DOM||!1,Ye=t.RETURN_DOM_FRAGMENT||!1,Xe=t.RETURN_TRUSTED_TYPE||!1,Ge=t.FORCE_BODY||!1,Ke=!1!==t.SANITIZE_DOM,$e=t.SANITIZE_NAMED_PROPS||!1,Qe=!1!==t.KEEP_CONTENT,Ze=t.IN_PLACE||!1,Ae=t.ALLOWED_URI_REGEXP||Ae,ct=t.NAMESPACE||lt,Le=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&wt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Le.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&wt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Le.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"===typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Le.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ue&&(He=!1),Ye&&(ze=!0),Je&&(Ie=k({},i(G)),xe=[],!0===Je.html&&(k(Ie,D),k(xe,z)),!0===Je.svg&&(k(Ie,F),k(xe,Y),k(xe,K)),!0===Je.svgFilters&&(k(Ie,U),k(xe,Y),k(xe,K)),!0===Je.mathMl&&(k(Ie,B),k(xe,X),k(xe,K))),t.ADD_TAGS&&(Ie===Me&&(Ie=j(Ie)),k(Ie,t.ADD_TAGS,be)),t.ADD_ATTR&&(xe===_e&&(xe=j(xe)),k(xe,t.ADD_ATTR,be)),t.ADD_URI_SAFE_ATTR&&k(it,t.ADD_URI_SAFE_ATTR,be),t.FORBID_CONTENTS&&(et===tt&&(et=j(et)),k(et,t.FORBID_CONTENTS,be)),Qe&&(Ie["#text"]=!0),Be&&k(Ie,["html","head","body"]),Ie.table&&(k(Ie,["tbody"]),delete Pe.tbody),g&&g(t),gt=t)},vt=k({},["mi","mo","mn","ms","mtext"]),Et=k({},["foreignobject","annotation-xml"]),Ct=k({},["title","style","font","a","script"]),St=k({},F);k(St,U),k(St,V);var Rt=k({},B);k(Rt,W);var Tt=function(e){var t=L(e);t&&t.tagName||(t={namespaceURI:ct,tagName:"template"});var n=R(e.tagName),r=R(t.tagName);return!!ut[e.namespaceURI]&&(e.namespaceURI===at?t.namespaceURI===lt?"svg"===n:t.namespaceURI===st?"svg"===n&&("annotation-xml"===r||vt[r]):Boolean(St[n]):e.namespaceURI===st?t.namespaceURI===lt?"math"===n:t.namespaceURI===at?"math"===n&&Et[r]:Boolean(Rt[n]):e.namespaceURI===lt?!(t.namespaceURI===at&&!Et[r])&&(!(t.namespaceURI===st&&!vt[r])&&(!Rt[n]&&(Ct[n]||!St[n]))):!("application/xhtml+xml"!==we||!ut[e.namespaceURI]))},Ot=function(e){S(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(Dt){try{e.outerHTML=ce}catch(Dt){e.remove()}}},Nt=function(e,t){try{S(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(Dt){S(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!xe[e])if(ze||Ye)try{Ot(t)}catch(Dt){}else try{t.setAttribute(e,"")}catch(Dt){}},At=function(e){var t,n;if(Ge)e=""+e;else{var r=O(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===we&&ct===lt&&(e=''+e+"");var i=le?le.createHTML(e):e;if(ct===lt)try{t=(new f).parseFromString(i,we)}catch(Dt){}if(!t||!t.documentElement){t=ue.createDocument(ct,"template",null);try{t.documentElement.innerHTML=ht?ce:i}catch(Dt){}}var s=t.body||t.documentElement;return e&&n&&s.insertBefore(o.createTextNode(n),s.childNodes[0]||null),ct===lt?fe.call(t,Be?"html":"body")[0]:Be?t.documentElement:s},It=function(e){return de.call(e.ownerDocument||e,e,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null,!1)},Mt=function(e){return e instanceof p&&("undefined"!==typeof e.__depth&&"number"!==typeof e.__depth||"undefined"!==typeof e.__removalCount&&"number"!==typeof e.__removalCount||"string"!==typeof e.nodeName||"string"!==typeof e.textContent||"function"!==typeof e.removeChild||!(e.attributes instanceof d)||"function"!==typeof e.removeAttribute||"function"!==typeof e.setAttribute||"string"!==typeof e.namespaceURI||"function"!==typeof e.insertBefore||"function"!==typeof e.hasChildNodes)},xt=function(t){return"object"===e(l)?t instanceof l:t&&"object"===e(t)&&"number"===typeof t.nodeType&&"string"===typeof t.nodeName},_t=function(e,t,r){ye[e]&&E(ye[e],(function(e){e.call(n,t,r,gt)}))},Lt=function(e){var t;if(_t("beforeSanitizeElements",e,null),Mt(e))return Ot(e),!0;if(M(/[\u0080-\uFFFF]/,e.nodeName))return Ot(e),!0;var r=be(e.nodeName);if(_t("uponSanitizeElement",e,{tagName:r,allowedTags:Ie}),e.hasChildNodes()&&!xt(e.firstElementChild)&&(!xt(e.content)||!xt(e.content.firstElementChild))&&M(/<[/\w]/g,e.innerHTML)&&M(/<[/\w]/g,e.textContent))return Ot(e),!0;if("select"===r&&M(/