123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948 |
- (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.maxHeight<a?(s.height=t.maxHeight+"px",s.overflowY="visible"):s.height=a+"px"}function a(){e.defaultView.setTimeout(s,0)}function u(e){if(e&&e.minHeight)if("inherit"===e.minHeight)t.minHeight=o.clientHeight;else{const n=parseInt(e.minHeight,10);isNaN(n)||(t.minHeight=n)}if(e&&e.maxHeight)if("inherit"===e.maxHeight)t.maxHeight=o.clientHeight;else{const n=parseInt(e.maxHeight,10);isNaN(n)||(t.maxHeight=n)}if(e&&e.minWidth)if("inherit"===e.minWidth)t.minWidth=o.clientWidth;else{const n=parseInt(e.minWidth,10);isNaN(n)||(t.minWidth=n)}if(e&&e.maxWidth)if("inherit"===e.maxWidth)t.maxWidth=o.clientWidth;else{const n=parseInt(e.maxWidth,10);isNaN(n)||(t.maxWidth=n)}i.firstChild||(i.className="autoResize",i.style.display="inline-block",i.appendChild(r))}function d(e,n){let r=arguments.length>2&&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;s<r.length;s++){const t=r[s];0!==s&&(o+=r[s-1].length+1);const a=o+t.length;if("home"===e?i=o:"end"===e&&(i=a),n<=a)break}Object(s["setCaretPosition"])(t,i)}var g=n("8828");function m(e,t,n){return t=y(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e){var t=w(e,"string");return"symbol"==typeof t?t:t+""}function w(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 b="ht_editor_visible",v="ht_editor_hidden",E="textEditor",C="text";class S extends r["a"]{static get EDITOR_TYPE(){return C}constructor(e){super(e),m(this,"eventManager",new i["a"](this)),m(this,"autoResize",u(this.hot.rootDocument)),m(this,"TEXTAREA",void 0),m(this,"textareaStyle",void 0),m(this,"TEXTAREA_PARENT",void 0),m(this,"textareaParentStyle",void 0),m(this,"layerClass",void 0),this.eventManager=new i["a"](this),this.createElements(),this.bindEvents(),this.hot.addHookOnce("afterDestroy",()=>this.destroy())}getValue(){return this.TEXTAREA.value}setValue(e){this.TEXTAREA.value=e}open(){this.refreshDimensions(),this.showEditableElement(),this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this.autoResize.unObserve(),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(u<h){if(!c[u]||c[u].skip){u+=1;continue}const h=Object(l["fastCall"])(c[u],e,n,r,i,o,s,a);void 0!==h&&(n=h),c[u]&&c[u].runOnce&&this.remove(t,c[u]),u+=1}}{const c=this.getBucket(e)[t],h=c?c.length:0;let u=0;if(h)while(u<h){if(!c[u]||c[u].skip){u+=1;continue}const h=Object(l["fastCall"])(c[u],e,n,r,i,o,s,a);void 0!==h&&(n=h),c[u]&&c[u].runOnce&&this.remove(t,c[u],e),u+=1}}return n}destroy(){let e=arguments.length>0&&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(e<t.length)return t[e]}setValues(e){this.indexedValues=e.slice(),this.runLocalHooks("change")}setValueAtIndex(e,t){return e<this.indexedValues.length&&(this.indexedValues[e]=t,this.runLocalHooks("change"),!0)}clear(){this.setDefaultValues()}getLength(){return this.getValues().length}setDefaultValues(){let e=arguments.length>0&&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<this.hot.getSettings().fixedRowsTop?t=this.col<this.hot.getSettings().fixedColumnsStart?"top-inline-start-corner":"top":this.hot.getSettings().fixedRowsBottom&&this.row>=e-this.hot.getSettings().fixedRowsBottom?t=this.col<this.hot.getSettings().fixedColumnsStart?"bottom-inline-start-corner":"bottom":this.col<this.hot.getSettings().fixedColumnsStart&&(t="inline-start"),t}}Object(i["mixin"])(y,c)},"142d":function(e,t,n){"use strict";var r=n("7b69"),i=n("088f"),o=n("2471");e.exports=function(e,t,n){var s,a;i(e);try{if(s=o(e,"return"),!s){if("throw"===t)throw n;return n}s=r(s,e)}catch(l){a=!0,s=l}if("throw"===t)throw n;if(a)throw s;return i(s),n}},"169f":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"])("validators");function c(e){if("function"===typeof e)return e;if(!s(e))throw Error(`No registered validator found under "${e}" name`);return o(e)}function h(e,t){"string"!==typeof e&&(t=e,e=t.VALIDATOR_TYPE),i(e,t)}},"170e":function(e,t,n){"use strict";var r=n("0227"),i=n("69ba"),o=n("2d2d"),s=n("1e92"),a=n("7c2b"),l=n("1d07"),c=n("2c35"),h=n("01b5"),u=n("a45f"),d=n("9718"),p=n("2daa"),f=n("d128"),g=n("d62b");e.exports=function(e,t,n,m){var y="stackTraceLimit",w=m?2:1,b=e.split("."),v=b[b.length-1],E=r.apply(null,b);if(E){var C=E.prototype;if(!g&&i(C,"cause")&&delete C.cause,!n)return E;var S=r("Error"),R=t((function(e,t){var n=u(m?t:e,void 0),r=m?new E(e):new E;return void 0!==n&&o(r,"message",n),p(r,R,r.stack,2),this&&s(C,this)&&h(r,this,R),arguments.length>w&&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;h<a.length;h++){var u=a[h];r(e,u)||n&&r(n,u)||l(e,u,c(t,u))}}},"1e8c":function(e,t,n){"use strict";n.d(t,"a",(function(){return Z}));var r=n("c4fa");const i={name:"editorCloseAndSave",callback(e,t){const n=e._getEditorManager();n.closeEditorAndSaveChanges(t.ctrlKey||t.metaKey),n.moveSelectionAfterEnter(t)}},o={name:"editorCloseWithoutSaving",callback(e){const t=e._getEditorManager();t.closeEditorAndRestoreOriginalValue(e.getShortcutManager().isCtrlPressed()),t.activeEditor.focus()}},s={name:"editorFastOpen",callback(e,t){const{highlight:n}=e.getSelectedRangeLast();n.isHeader()||e._getEditorManager().openEditor(null,t,!0)}};var a=n("de3b");const l={name:"editorOpen",callback(e,t,n){const r=e._getEditorManager(),i=e.getSelectedRangeLast(),{highlight:o}=i;if(e.selection.isMultiple()&&!i.isHeader()&&e.countRenderedCols()>0&&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<n&&(i=-(r+n)),e.selection.transformStart(i,0),e.getSelectedRangeLast().highlight.row<0&&e.scrollViewportTo({row:0})}};function V(){return[T,O,N,A,I,M,x,_,L,P,k,j,H,D,F,U]}const B={name:"emptySelectedCells",callback(e){e.emptySelectedCells(),e._getEditorManager().prepareEditor()}},W={name:"scrollToFocusedCell",callback(e){const{highlight:t}=e.getSelectedRangeLast(),n=e.view.getFirstFullyVisibleRow()-1,r=e.view.getFirstFullyVisibleColumn()-1,i=e.view.getLastFullyVisibleRow()+1,o=e.view.getLastFullyVisibleColumn()+1,s=e._createCellCoords(n,r),a=e._createCellCoords(i,o),l=e._createCellRange(s,s,a);if(!l.includes(t)&&(t.row>=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<t.length;s++)t[s].forAll((t,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;r<t;r++)n[r]=arguments[r];return i(e,...n)}}),t}function $(e){const t=e.getShortcutManager().addContext("editor"),n=K(e),i={group:r["a"]};t.addShortcuts([{keys:[["Enter"],["Enter","Shift"]],callback:(e,t)=>n.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;o<e+r;o++)i+=this.hot.getColWidth(o);return n.style.width=i+"px",n}createTable(){let e=arguments.length>0&&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]<n[0]?t:r).map(e=>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;r<t;r++)n[r]=arguments[r];let o=n.length;while(o){o-=1;const t=Object(i["stringify"])(n[o]).toLowerCase();-1===e.indexOf(t)&&e.push(t)}return 1===e.length}function a(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()}function l(e){return/^([0-9][0-9]?%$)|(^100%$)/.test(e)}function c(e){let t=arguments.length>1&&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<t;r++){var c=e[r];"string"==typeof c?l(n,c):"number"!=typeof c&&"Number"!==s(c)&&"String"!==s(c)||l(n,a(c))}var h=n.length,u=!0;return function(e,t){if(u)return u=!1,t;if(i(this))return t;for(var r=0;r<h;r++)if(n[r]===e)return t}}}},"351d":function(e,t,n){"use strict";n.r(t),n.d(t,"duckSchema",(function(){return i})),n.d(t,"inherit",(function(){return o})),n.d(t,"extend",(function(){return s})),n.d(t,"deepExtend",(function(){return a})),n.d(t,"deepClone",(function(){return l})),n.d(t,"clone",(function(){return c})),n.d(t,"mixin",(function(){return h})),n.d(t,"isObjectEqual",(function(){return u})),n.d(t,"isObject",(function(){return d})),n.d(t,"defineGetter",(function(){return p})),n.d(t,"objectEach",(function(){return f})),n.d(t,"getProperty",(function(){return g})),n.d(t,"setProperty",(function(){return m})),n.d(t,"deepObjectSize",(function(){return y})),n.d(t,"createObjectPropListener",(function(){return w})),n.d(t,"hasOwnProperty",(function(){return b}));n("7a89"),n("d06e"),n("5b82");var r=n("81ea");function i(e){let t;return Array.isArray(e)?t=e.length?new Array(e.length).fill(null):[]:(t={},f(e,(e,n)=>{"__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<t;i++)n[i-1]=arguments[i];return Object(r["arrayEach"])(n,t=>{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;t<n;t+=1){for(i=e[t].length,r=0;r<i;r+=1)r>0&&(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;n<e.length;n+=1,r-=1)t+=o**r*(i.indexOf(e[n])+1);return t-=1,t}function l(){let e=arguments.length>0&&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;r<e;r++){const e=[];for(i=0;i<t;i++)e.push(s(i)+(r+1));n.push(e)}return n}function c(){let e=arguments.length>0&&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;r<e;r++){const e={};for(i=0;i<t;i++)e["prop"+i]=s(i)+(r+1);n.push(e)}return n}function h(e,t){const n=[];let r;for(let i=0;i<e;i++){r=[];for(let e=0;e<t;e++)r.push("");n.push(r)}return n}function u(e){let t=arguments.length>1&&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<t)throw new r("Not enough arguments");return e}},"624b":function(e,t,n){"use strict";var r=n("fd18"),i=n("2aac");e.exports=function(e,t,n){try{return r(i(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(o){}}},"63d8":function(e,t,n){"use strict";n.r(t),n.d(t,"setBrowserMeta",(function(){return l})),n.d(t,"setPlatformMeta",(function(){return c})),n.d(t,"isChrome",(function(){return h})),n.d(t,"isChromeWebKit",(function(){return u})),n.d(t,"isFirefox",(function(){return d})),n.d(t,"isFirefoxWebKit",(function(){return p})),n.d(t,"isSafari",(function(){return f})),n.d(t,"isEdge",(function(){return g})),n.d(t,"isEdgeWebKit",(function(){return m})),n.d(t,"isMobileBrowser",(function(){return y})),n.d(t,"isIOS",(function(){return w})),n.d(t,"isIpadOS",(function(){return b})),n.d(t,"isWindowsOS",(function(){return v})),n.d(t,"isMacOS",(function(){return E})),n.d(t,"isLinuxOS",(function(){return C}));var r=n("351d"),i=n("7dd09");const o=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<t;i++)n[i-1]=arguments[i];const o=Object(r["arrayReduce"])(e,(e,t,r)=>{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 I<f.length&&(M+=v(f,I)),M}})},"71ca":function(e,t,n){"use strict";var r=String;e.exports=function(e){try{return r(e)}catch(t){return"Object"}}},"73d9":function(e,t,n){"use strict";var r=n("b2c9"),i=String,o=TypeError;e.exports=function(e){if(r(e))return e;throw new o("Can't set "+i(e)+" as a prototype")}},"73fa":function(e,t,n){"use strict";var r="object"==typeof document&&document.all;e.exports="undefined"==typeof r&&void 0!==r?function(e){return"function"==typeof e||e===r}:function(e){return"function"==typeof e}},"76ab":function(e,t,n){"use strict";n.d(t,"d",(function(){return p})),n.d(t,"a",(function(){return d})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return h}));n("7a89");var r=n("9acd"),i=n("491c"),o=n("3d76"),s=n("169f");const{register:a,getItem:l,hasItem:c,getNames:h,getValues:u}=Object(r["a"])("cellTypes");function d(e){if(!c(e))throw Error(`You declared cell type "${e}" as a string that is not mapped to a known object.\n Cell type must be an object or a string mapped to an object registered by\n "Handsontable.cellTypes.registerCellType" method`);return l(e)}function p(e,t){"string"!==typeof e&&(t=e,e=t.CELL_TYPE);const{editor:n,renderer:r,validator:l}=t;n&&Object(i["e"])(e,n),r&&Object(o["d"])(e,r),l&&Object(s["d"])(e,l),a(e,t)}},"77aa":function(e,t,n){"use strict";function r(e){return e&&0===e.length}function i(e){return void 0===e||null===e?[]:Object.keys(e)}function o(e){for(var t=[],n=Object.keys(e),r=0;r<n.length;r++)t.push(e[n[r]]);return t}function s(e,t){for(var n=[],r=i(e),o=0;o<r.length;o++){var s=r[o];n.push(t.call(null,e[s],s))}return n}function a(e,t){for(var n=[],r=0;r<e.length;r++)n.push(t.call(null,e[r],r));return n}function l(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];Array.isArray(r)?t=t.concat(l(r)):t.push(r)}return t}function c(e){return r(e)?void 0:e[0]}function h(e){var t=e&&e.length;return t?e[t-1]:void 0}function u(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)t.call(null,e[n],n);else{if(!_(e))throw Error("non exhaustive match");var r=i(e);for(n=0;n<r.length;n++){var o=r[n],s=e[o];t.call(null,s,o)}}}function d(e){return"string"===typeof e}function p(e){return void 0===e}function f(e){return e instanceof Function}function g(e,t){return void 0===t&&(t=1),e.slice(t,e.length)}function m(e,t){return void 0===t&&(t=1),e.slice(0,e.length-t)}function y(e,t){var n=[];if(Array.isArray(e))for(var r=0;r<e.length;r++){var i=e[r];t.call(null,i)&&n.push(i)}return n}function w(e,t){return y(e,(function(e){return!t(e)}))}function b(e,t){for(var n=Object.keys(e),r={},i=0;i<n.length;i++){var o=n[i],s=e[o];t(s)&&(r[o]=s)}return r}function v(e,t){return!!_(e)&&e.hasOwnProperty(t)}function E(e,t){return void 0!==R(e,(function(e){return e===t}))}function C(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t}function S(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function R(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(t.call(null,r))return r}}function T(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];t.call(null,i)&&n.push(i)}return n}function O(e,t,n){for(var r=Array.isArray(e),s=r?e:o(e),a=r?[]:i(e),l=n,c=0;c<s.length;c++)l=t.call(null,l,s[c],r?c:a[c]);return l}function N(e){return w(e,(function(e){return null===e||void 0===e}))}function A(e,t){void 0===t&&(t=function(e){return e});var n=[];return O(e,(function(e,r){var i=t(r);return E(n,i)?e:(n.push(i),e.concat(r))}),[])}function I(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=[null],i=r.concat(t);return Function.bind.apply(e,i)}function M(e){return Array.isArray(e)}function x(e){return e instanceof RegExp}function _(e){return e instanceof Object}function L(e,t){for(var n=0;n<e.length;n++)if(!t(e[n],n))return!1;return!0}function P(e,t){return w(e,(function(e){return E(t,e)}))}function k(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return!0;return!1}function j(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}function H(e,t){var n=C(e);return n.sort((function(e,n){return t(e)-t(n)})),n}function D(e,t){if(e.length!==t.length)throw Error("can't zipObject with different number of keys and values!");for(var n={},r=0;r<e.length;r++)n[e[r]]=t[r];return n}function F(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++)for(var o=t[r],s=i(o),a=0;a<s.length;a++){var l=s[a];e[l]=o[l]}return e}function U(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++){var o=t[r];if(!p(o))for(var s=i(o),a=0;a<s.length;a++){var l=s[a];v(e,l)||(e[l]=o[l])}}return e}function V(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return U.apply(null,[{}].concat(e))}function B(e,t){var n={};return u(e,(function(e){var r=t(e),i=n[r];i?i.push(e):n[r]=[e]})),n}function W(e,t){for(var n=S(e),r=i(t),o=0;o<r.length;o++){var s=r[o],a=t[s];n[s]=a}return n}function G(){}function z(e){return e}function Y(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(void 0!==r?r:void 0)}return t}function X(e){console&&console.error&&console.error("Error: "+e)}function K(e){console&&console.warn&&console.warn("Warning: "+e)}function $(){return"function"===typeof Map}function q(e,t){t.forEach((function(t){var n=t.prototype;Object.getOwnPropertyNames(n).forEach((function(r){if("constructor"!==r){var i=Object.getOwnPropertyDescriptor(n,r);i&&(i.get||i.set)?Object.defineProperty(e.prototype,r,i):e.prototype[r]=t.prototype[r]}}))}))}function Q(e){function t(){}t.prototype=e;var n=new t;function r(){return typeof n.bar}return r(),r(),e}function Z(e){return e[e.length-1]}function J(e){var t=(new Date).getTime(),n=e(),r=(new Date).getTime(),i=r-t;return{time:i,value:n}}n.d(t,"A",(function(){return r})),n.d(t,"G",(function(){return i})),n.d(t,"U",(function(){return o})),n.d(t,"J",(function(){return s})),n.d(t,"I",(function(){return a})),n.d(t,"t",(function(){return l})),n.d(t,"s",(function(){return c})),n.d(t,"H",(function(){return h})),n.d(t,"u",(function(){return u})),n.d(t,"E",(function(){return d})),n.d(t,"F",(function(){return p})),n.d(t,"B",(function(){return f})),n.d(t,"m",(function(){return g})),n.d(t,"n",(function(){return m})),n.d(t,"p",(function(){return y})),n.d(t,"P",(function(){return w})),n.d(t,"N",(function(){return b})),n.d(t,"w",(function(){return v})),n.d(t,"j",(function(){return E})),n.d(t,"g",(function(){return C})),n.d(t,"h",(function(){return S})),n.d(t,"q",(function(){return R})),n.d(t,"r",(function(){return T})),n.d(t,"O",(function(){return O})),n.d(t,"i",(function(){return N})),n.d(t,"T",(function(){return A})),n.d(t,"y",(function(){return M})),n.d(t,"D",(function(){return x})),n.d(t,"C",(function(){return _})),n.d(t,"o",(function(){return L})),n.d(t,"l",(function(){return P})),n.d(t,"Q",(function(){return k})),n.d(t,"x",(function(){return j})),n.d(t,"f",(function(){return F})),n.d(t,"k",(function(){return V})),n.d(t,"v",(function(){return B})),n.d(t,"K",(function(){return W})),n.d(t,"b",(function(){return G})),n.d(t,"a",(function(){return z})),n.d(t,"L",(function(){return Y})),n.d(t,"c",(function(){return X})),n.d(t,"d",(function(){return K})),n.d(t,"z",(function(){return $})),n.d(t,"e",(function(){return q})),n.d(t,"S",(function(){return Q})),n.d(t,"M",(function(){return Z})),n.d(t,"R",(function(){return J}))},"78e9":function(e,t,n){"use strict";var r=n("fd18"),i=Error,o=r("".replace),s=function(e){return String(new i(e).stack)}("zxcasd"),a=/\n\s*at [^:]*:[^\n]*/,l=a.test(s);e.exports=function(e,t){if(l&&"string"==typeof e&&!i.prepareStackTrace)while(t--)e=o(e,a,"");return e}},"7a89":function(e,t,n){"use strict";var r=n("ac4f"),i=n("f2e8"),o=n("0204"),s=n("170e"),a="WebAssembly",l=i[a],c=7!==new Error("e",{cause:7}).cause,h=function(e,t){var n={};n[e]=s(e,t,c),r({global:!0,constructor:!0,arity:1,forced:c},n)},u=function(e,t){if(l&&l[e]){var n={};n[e]=s(a+"."+e,t,c),r({target:a,stat:!0,constructor:!0,arity:1,forced:c},n)}};h("Error",(function(e){return function(t){return o(e,this,arguments)}})),h("EvalError",(function(e){return function(t){return o(e,this,arguments)}})),h("RangeError",(function(e){return function(t){return o(e,this,arguments)}})),h("ReferenceError",(function(e){return function(t){return o(e,this,arguments)}})),h("SyntaxError",(function(e){return function(t){return o(e,this,arguments)}})),h("TypeError",(function(e){return function(t){return o(e,this,arguments)}})),h("URIError",(function(e){return function(t){return o(e,this,arguments)}})),u("CompileError",(function(e){return function(t){return o(e,this,arguments)}})),u("LinkError",(function(e){return function(t){return o(e,this,arguments)}})),u("RuntimeError",(function(e){return function(t){return o(e,this,arguments)}}))},"7ae0":function(e,t,n){"use strict";n("d06e");var r=n("351d"),i=n("97b9");const o="localHooks",s={_localHooks:Object.create(null),addLocalHook(e,t){return this._localHooks[e]||(this._localHooks[e]=[]),this._localHooks[e].push(t),this},runLocalHooks(e,t,n,r,o,s,a){if(this._localHooks[e]){const l=this._localHooks[e].length;for(let c=0;c<l;c++)Object(i["fastCall"])(this._localHooks[e][c],this,t,n,r,o,s,a)}},clearLocalHooks(){return this._localHooks={},this}};Object(r["defineGetter"])(s,"MIXIN_NAME",o,{writable:!1,enumerable:!1}),t["a"]=s},"7b69":function(e,t,n){"use strict";var r=n("48ab"),i=Function.prototype.call;e.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},"7b7f":function(e,t,n){"use strict";var r=n("44d0"),i=n("b343"),o=n("f2e8"),s=o.String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol("symbol detection");return!s(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},"7b9c":function(e,t,n){"use strict";n.r(t),n.d(t,"stringify",(function(){return o})),n.d(t,"isDefined",(function(){return s})),n.d(t,"isUndefined",(function(){return a})),n.d(t,"isEmpty",(function(){return l})),n.d(t,"isRegExp",(function(){return c})),n.d(t,"_injectProductInfo",(function(){return E}));var r=n("c1df"),i=n("67a87");function o(e){let t;switch(typeof e){case"string":case"number":t=""+e;break;case"object":t=null===e?"":e.toString();break;case"undefined":t="";break;default:t=e.toString();break}return t}function s(e){return"undefined"!==typeof e}function a(e){return"undefined"===typeof e}function l(e){return null===e||""===e||a(e)}function c(e){return"[object RegExp]"===Object.prototype.toString.call(e)}const h="length",u=e=>parseInt(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
- <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> on how to\x20
- install it properly or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,expired: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}. <a href="https://handsontable.com/pricing" target="_blank">Renew</a> your\x20
- license key or downgrade to a version released prior to ${t}. If you need any\x20
- help, contact us at <a href="mailto:sales@handsontable.com">sales@handsontable.com</a>.`},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
- <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> about it in\x20
- the documentation or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,non_commercial:()=>""};function 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<H4P+".split(""),o=f(i.shift());o;o=f(i.shift()||"A"))--o<""[h]?n|=(d(""+d(u(r)+(u(p(e,Math.abs(o),2))+[]).padStart(2,"0")))%97||2)>>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(n<t)e[n]=[e[n]],n+=1}function i(e,t){const n=t.length;let r=0;while(r<n)e.push(t[r]),r+=1}function o(e){const t=[];if(!e||0===e.length||!e[0]||0===e[0].length)return t;const n=e.length,r=e[0].length;for(let i=0;i<n;i++)for(let n=0;n<r;n++)t[n]||(t[n]=[]),t[n][i]=e[i][n];return t}function s(e,t,n,r){let i=-1,o=e,s=n;Array.isArray(e)||(o=Array.from(e));const a=o.length;r&&a&&(i+=1,s=o[i]),i+=1;while(i<a)s=t(s,o[i],i,o),i+=1;return s}function a(e,t){let n=0,r=e;Array.isArray(e)||(r=Array.from(e));const i=r.length,o=[];let s=-1;while(n<i){const e=r[n];t(e,n,r)&&(s+=1,o[s]=e),n+=1}return o}function l(e,t){let n=0,r=e;Array.isArray(e)||(r=Array.from(e));const i=r.length,o=[];let s=-1;while(n<i){const e=r[n];s+=1,o[s]=t(e,n,r),n+=1}return o}function c(e,t){let n=0,r=e;Array.isArray(e)||(r=Array.from(e));const i=r.length;while(n<i){if(!1===t(r[n],n,r))break;n+=1}return e}function h(e){return s(e,(e,t)=>e+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)=>e<t?e:t,Array.isArray(e)?e[0]:void 0)}function p(e){return e.length?h(e)/e.length:0}function f(e){return s(e,(e,t)=>e.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<e;n++)t[n]=arguments[n];const[r,...i]=[...t];let o=r;return c(i,e=>{o=o.filter(t=>!e.includes(t))}),o}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const[r,...i]=[...t];let o=r;return c(i,e=>{o=o.filter(t=>e.includes(t))}),o}function w(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const[r,...i]=[...t],o=new Set(r);return c(i,e=>{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<i;c++)if(p=this._getColumnWidth(c),l<=s&&e!==r["a"]&&(this.startColumn=c,f=p),l>=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),i<this.endColumn&&(this.endColumn=i-1),null!==this.startColumn&&(this.count=this.endColumn-this.startColumn+1)}_getColumnWidth(e){let t=c(d,this).columnWidthFn(e);return isNaN(t)&&(t=p.DEFAULT_WIDTH),t}}},"861e":function(e,t,n){"use strict";e.exports={}},"86d6":function(e,t,n){"use strict";var r=n("7b69"),i=n("73fa"),o=n("8793"),s=TypeError;e.exports=function(e,t){var n,a;if("string"===t&&i(n=e.toString)&&!o(a=r(n,e)))return a;if(i(n=e.valueOf)&&!o(a=r(n,e)))return a;if("string"!==t&&i(n=e.toString)&&!o(a=r(n,e)))return a;throw new s("Can't convert object to primitive value")}},"8722d":function(e,t,n){var r;!function(t){e.exports=t()}((function(){return function e(t,n,i){function o(a,l){if(!n[a]){if(!t[a]){var c="function"==typeof r&&r;if(!l&&c)return r(a,!0);if(s)return s(a,!0);var h=new Error("Cannot find module '"+a+"'");throw h.code="MODULE_NOT_FOUND",h}var u=n[a]={exports:{}};t[a][0].call(u.exports,(function(e){return o(t[a][1][e]||e)}),u,u.exports,e,t,n,i)}return n[a].exports}for(var s="function"==typeof r&&r,a=0;a<i.length;a++)o(i[a]);return o}({1:[function(e,t,n){!function(e){"use strict";var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,o=Math.floor,s="[BigNumber Error] ",a=s+"Number primitive has more than 15 significant digits: ",l=1e14,c=14,h=9007199254740991,u=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e7,p=1e9;function f(e){var t=0|e;return 0<e||e===t?t:t-1}function g(e){for(var t,n,r=1,i=e.length,o=e[0]+"";r<i;){for(t=e[r++]+"",n=c-t.length;n--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function m(e,t){var n,r,i=e.c,o=t.c,s=e.s,a=t.s,l=e.e,c=t.e;if(!s||!a)return null;if(n=i&&!i[0],r=o&&!o[0],n||r)return n?r?0:-a:s;if(s!=a)return s;if(n=s<0,r=l==c,!i||!o)return r?0:!i^n?1:-1;if(!r)return c<l^n?1:-1;for(a=(l=i.length)<(c=o.length)?l:c,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^n?1:-1;return l==c?0:c<l^n?1:-1}function y(e,t,n,r){if(e<t||n<e||e!==(e<0?i(e):o(e)))throw Error(s+(r||"Argument")+("number"==typeof e?e<t||n<e?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function w(e){var t=e.c.length-1;return f(e.e/c)==t&&e.c[t]%2!=0}function b(e,t){return(1<e.length?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function v(e,t,n){var r,i;if(t<0){for(i=n+".";++t;i+=n);e=i+e}else if(++t>(r=e.length)){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}(n=function e(t){var n,E,C,S,R,T,O,N,A,I,M=W.prototype={constructor:W,toString:null,valueOf:null},x=new W(1),_=20,L=4,P=-7,k=21,j=-1e7,H=1e7,D=!1,F=1,U=0,V={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},B="0123456789abcdefghijklmnopqrstuvwxyz";function W(e,t){var n,i,s,l,u,d,p,f,g=this;if(!(g instanceof W))return new W(e,t);if(null==t){if(e instanceof W)return g.s=e.s,g.e=e.e,void(g.c=(e=e.c)?e.slice():e);if((d="number"==typeof e)&&0*e==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,u=e;10<=u;u/=10,l++);return g.e=l,void(g.c=[e])}f=String(e)}else{if(f=String(e),!r.test(f))return C(g,f,d);g.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}-1<(l=f.indexOf("."))&&(f=f.replace(".","")),0<(u=f.search(/e/i))?(l<0&&(l=u),l+=+f.slice(u+1),f=f.substring(0,u)):l<0&&(l=f.length)}else{if(y(t,2,B.length,"Base"),f=String(e),10==t)return X(g=new W(e instanceof W?e:f),_+g.e+1,L);if(d="number"==typeof e){if(0*e!=0)return C(g,f,d,t);if(g.s=1/e<0?(f=f.slice(1),-1):1,W.DEBUG&&15<f.replace(/^0\.0*|\./,"").length)throw Error(a+e);d=!1}else g.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(n=B.slice(0,t),l=u=0,p=f.length;u<p;u++)if(n.indexOf(i=f.charAt(u))<0){if("."==i){if(l<u){l=p;continue}}else if(!s&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){s=!0,u=-1,l=0;continue}return C(g,String(e),d,t)}-1<(l=(f=E(f,t,10,g.s)).indexOf("."))?f=f.replace(".",""):l=f.length}for(u=0;48===f.charCodeAt(u);u++);for(p=f.length;48===f.charCodeAt(--p););if(f=f.slice(u,++p)){if(p-=u,d&&W.DEBUG&&15<p&&(h<e||e!==o(e)))throw Error(a+g.s*e);if(H<(l=l-u-1))g.c=g.e=null;else if(l<j)g.c=[g.e=0];else{if(g.e=l,g.c=[],u=(l+1)%c,l<0&&(u+=c),u<p){for(u&&g.c.push(+f.slice(0,u)),p-=c;u<p;)g.c.push(+f.slice(u,u+=c));f=f.slice(u),u=c-f.length}else u-=p;for(;u--;f+="0");g.c.push(+f)}}else g.c=[g.e=0]}function G(e,t,n,r){var i,o,s,a,l;if(null==n?n=L:y(n,0,8),!e.c)return e.toString();if(i=e.c[0],s=e.e,null==t)l=g(e.c),l=1==r||2==r&&(s<=P||k<=s)?b(l,s):v(l,s,"0");else if(o=(e=X(new W(e),t,n)).e,a=(l=g(e.c)).length,1==r||2==r&&(t<=o||o<=P)){for(;a<t;l+="0",a++);l=b(l,o)}else if(t-=s,l=v(l,o,"0"),a<o+1){if(0<--t)for(l+=".";t--;l+="0");}else if(0<(t+=o-a))for(o+1==a&&(l+=".");t--;l+="0");return e.s<0&&i?"-"+l:l}function z(e,t){for(var n,r=1,i=new W(e[0]);r<e.length;r++){if(!(n=new W(e[r])).s){i=n;break}t.call(i,n)&&(i=n)}return i}function Y(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];10<=i;i/=10,r++);return(n=r+n*c-1)>H?e.c=e.e=null:e.c=n<j?[e.e=0]:(e.e=n,t),e}function X(e,t,n,r){var s,a,h,d,p,f,g,m=e.c,y=u;if(m){e:{for(s=1,d=m[0];10<=d;d/=10,s++);if((a=t-s)<0)a+=c,h=t,g=(p=m[f=0])/y[s-h-1]%10|0;else if((f=i((a+1)/c))>=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)):5<g||5==g&&(4==n||r||6==n&&(0<a?0<h?p/y[s-h]:0:m[f-1])%10&1||n==(e.s<0?8:7)),t<1||!m[0])return m.length=0,r?(t-=e.e+1,m[0]=y[(c-t%c)%c],e.e=-t||0):m[0]=e.e=0,e;if(0==a?(m.length=f,d=1,f--):(m.length=f+1,d=y[c-a],m[f]=0<h?o(p/y[s-h]%y[h])*d:0),r)for(;;){if(0==f){for(a=1,h=m[0];10<=h;h/=10,a++);for(h=m[0]+=d,d=1;10<=h;h/=10,d++);a!=d&&(e.e++,m[0]==l&&(m[0]=1));break}if(m[f]+=d,m[f]!=l)break;m[f--]=0,d=1}for(a=m.length;0===m[--a];m.pop());}e.e>H?e.c=e.e=null:e.e<j&&(e.c=[e.e=0])}return e}function K(e){var t,n=e.e;return null===n?e.toString():(t=g(e.c),t=n<=P||k<=n?b(t,n):v(t,n,"0"),e.s<0?"-"+t:t)}return W.clone=e,W.ROUND_UP=0,W.ROUND_DOWN=1,W.ROUND_CEIL=2,W.ROUND_FLOOR=3,W.ROUND_HALF_UP=4,W.ROUND_HALF_DOWN=5,W.ROUND_HALF_EVEN=6,W.ROUND_HALF_CEIL=7,W.ROUND_HALF_FLOOR=8,W.EUCLID=9,W.config=W.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(s+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(y(n=e[t],0,p,t),_=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(y(n=e[t],0,8,t),L=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(y(n[0],-p,0,t),y(n[1],0,p,t),P=n[0],k=n[1]):(y(n,-p,p,t),P=-(k=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)y(n[0],-p,-1,t),y(n[1],1,p,t),j=n[0],H=n[1];else{if(y(n,-p,p,t),!n)throw Error(s+t+" cannot be zero: "+n);j=-(H=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(s+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw D=!n,Error(s+"crypto unavailable");D=n}else D=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(y(n=e[t],0,9,t),F=n),e.hasOwnProperty(t="POW_PRECISION")&&(y(n=e[t],0,p,t),U=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(s+t+" not an object: "+n);V=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.$|[+-.\s]|(.).*\1/.test(n))throw Error(s+t+" invalid: "+n);B=n}}return{DECIMAL_PLACES:_,ROUNDING_MODE:L,EXPONENTIAL_AT:[P,k],RANGE:[j,H],CRYPTO:D,MODULO_MODE:F,POW_PRECISION:U,FORMAT:V,ALPHABET:B}},W.isBigNumber=function(e){return e instanceof W||e&&!0===e._isBigNumber||!1},W.maximum=W.max=function(){return z(arguments,M.lt)},W.minimum=W.min=function(){return z(arguments,M.gt)},W.random=(S=9007199254740992,R=Math.random()*S&2097151?function(){return o(Math.random()*S)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,r,a,l,h=0,d=[],f=new W(x);if(null==e?e=_:y(e,0,p),a=i(e/c),D)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(a*=2));h<a;)9e15<=(l=131072*t[h]+(t[h+1]>>>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);h<a;)9e15<=(l=281474976710656*(31&t[h])+1099511627776*t[h+1]+4294967296*t[h+2]+16777216*t[h+3]+(t[h+4]<<16)+(t[h+5]<<8)+t[h+6])?crypto.randomBytes(7).copy(t,h):(d.push(l%1e14),h+=7);h=a/7}if(!D)for(;h<a;)(l=R())<9e15&&(d[h++]=l%1e14);for(a=d[--h],e%=c,a&&e&&(l=u[c-e],d[h]=o(a/l)*l);0===d[h];d.pop(),h--);if(h<0)d=[r=0];else{for(r=-1;0===d[0];d.splice(0,1),r-=c);for(h=1,l=d[0];10<=l;l/=10,h++);h<c&&(r-=c-h)}return f.e=r,f.c=d,f}),W.sum=function(){for(var e=1,t=arguments,n=new W(t[0]);e<t.length;)n=n.plus(t[e++]);return n},E=function(){var e="0123456789";function t(e,t,n,r){for(var i,o,s=[0],a=0,l=e.length;a<l;){for(o=s.length;o--;s[o]*=t);for(s[0]+=r.indexOf(e.charAt(a++)),i=0;i<s.length;i++)s[i]>n-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)):u<y||y==u&&(4==b||d||6==b&&1&f[c-1]||b==(p.s<0?8:7)),c<1||!f[0])r=d?v(l.charAt(1),-w,l.charAt(0)):l.charAt(0);else{if(f.length=c,d)for(--o;++f[--c]>o;)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=r<n?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&1<e.length;e.splice(0,1));}return function(r,i,s,a,h){var u,d,p,g,m,y,w,b,v,E,C,S,R,T,O,N,A,I=r.s==i.s?1:-1,M=r.c,x=i.c;if(!(M&&M[0]&&x&&x[0]))return new W(r.s&&i.s&&(M?!x||M[0]!=x[0]:x)?M&&0==M[0]||!x?0*I:I/0:NaN);for(v=(b=new W(I)).c=[],I=s+(d=r.e-i.e)+1,h||(h=l,d=f(r.e/c)-f(i.e/c),I=I/c|0),p=0;x[p]==(M[p]||0);p++);if(x[p]>(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<N;E[C++]=0);A=x.slice(),A=[0].concat(A),O=x[0],x[1]>=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,N<w?A:x,w,h),w=y.length,u=1;else 0==m&&(u=m=1),w=(y=x.slice()).length;if(w<C&&(y=[0].concat(y)),n(E,y,C,h),C=E.length,-1==u)for(;t(x,E,N,C)<1;)m++,n(E,N<C?A:x,C,h),C=E.length}else 0===u&&(m++,E=[0]);v[p++]=m,E[0]?E[C++]=M[R]||0:(E=[M[R]],C=1)}while((R++<T||null!=E[0])&&I--);g=null!=E[0],v[0]||v.splice(0,1)}if(h==l){for(p=1,I=v[0];10<=I;I/=10,p++);X(b,s+(b.e=p+d*c-1)+1,a,g)}else b.e=d,b.r=+g;return b}}(),T=/^(-?)0([xbo])(?=\w[\w.]*$)/i,O=/^([^.]+)\.$/,N=/^\.([^.]+)$/,A=/^-?(Infinity|NaN)$/,I=/^\s*\+(?=[\w.])|^\s+|\s+$/g,C=function(e,t,n,r){var i,o=n?t:t.replace(I,"");if(A.test(o))e.s=isNaN(o)?null:o<0?-1:1,e.c=e.e=null;else{if(!n&&(o=o.replace(T,(function(e,t,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=i?e:t})),r&&(i=r,o=o.replace(O,"$1").replace(N,"0.$1")),t!=o))return new W(o,i);if(W.DEBUG)throw Error(s+"Not a"+(r?" base "+r:"")+" number: "+t);e.c=e.e=e.s=null}},M.absoluteValue=M.abs=function(){var e=new W(this);return e.s<0&&(e.s=1),e},M.comparedTo=function(e,t){return m(this,new W(e,t))},M.decimalPlaces=M.dp=function(e,t){var n,r,i;if(null!=e)return y(e,0,p),null==t?t=L:y(t,0,8),X(new W(this),e+this.e+1,t);if(!(n=this.c))return null;if(r=((i=n.length-1)-f(this.e/c))*c,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},M.dividedBy=M.div=function(e,t){return n(this,new W(e,t),_,L)},M.dividedToIntegerBy=M.idiv=function(e,t){return n(this,new W(e,t),0,1)},M.exponentiatedBy=M.pow=function(e,t){var n,r,a,l,h,u,d,p,f=this;if((e=new W(e)).c&&!e.isInteger())throw Error(s+"Exponent not an integer: "+K(e));if(null!=t&&(t=new W(t)),h=14<e.e,!f.c||!f.c[0]||1==f.c[0]&&!f.e&&1==f.c.length||!e.c||!e.c[0])return p=new W(Math.pow(+K(f),h?2-w(e):+K(e))),t?p.mod(t):p;if(u=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new W(NaN);(r=!u&&f.isInteger()&&t.isInteger())&&(f=f.mod(t))}else{if(9<e.e&&(0<f.e||f.e<-1||(0==f.e?1<f.c[0]||h&&24e7<=f.c[1]:f.c[0]<8e13||h&&f.c[0]<=9999975e7)))return l=f.s<0&&w(e)?-0:0,-1<f.e&&(l=1/l),new W(u?1/l:l);U&&(l=i(U/c+2))}for(d=h?(n=new W(.5),u&&(e.s=1),w(e)):(a=Math.abs(+K(e)))%2,p=new W(x);;){if(d){if(!(p=p.times(f)).c)break;l?p.c.length>l&&(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),14<e.e)d=w(e);else{if(0==(a=+K(e)))break;d=a%2}f=f.times(f),l?f.c&&f.c.length>l&&(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 0<m(this,new W(e,t))},M.isGreaterThanOrEqualTo=M.gte=function(e,t){return 1===(t=m(this,new W(e,t)))||0===t},M.isInteger=function(){return!!this.c&&f(this.e/c)>this.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 0<this.s},M.isZero=function(){return!!this.c&&0==this.c[0]},M.minus=function(e,t){var n,r,i,o,s=this,a=s.s;if(t=(e=new W(e,t)).s,!a||!t)return new W(NaN);if(a!=t)return e.s=-t,s.plus(e);var h=s.e/c,u=e.e/c,d=s.c,p=e.c;if(!h||!u){if(!d||!p)return d?(e.s=-t,e):new W(p?s:NaN);if(!d[0]||!p[0])return p[0]?(e.s=-t,e):new W(d[0]?s:3==L?-0:0)}if(h=f(h),u=f(u),d=d.slice(),a=h-u){for((i=(o=a<0)?(a=-a,d):(u=h,p)).reverse(),t=a;t--;i.push(0));i.reverse()}else for(r=(o=(a=d.length)<(t=p.length))?a:t,a=t=0;t<r;t++)if(d[t]!=p[t]){o=d[t]<p[t];break}if(o&&(i=d,d=p,p=i,e.s=-e.s),0<(t=(r=p.length)-(n=d.length)))for(;t--;d[n++]=0);for(t=l-1;a<r;){if(d[--r]<p[r]){for(n=r;n&&!d[--n];d[n]=t);--d[n],d[r]+=l}d[r]-=p[r]}for(;0==d[0];d.splice(0,1),--u);return d[0]?Y(e,d,u):(e.s=3==L?-1:1,e.c=[e.e=0],e)},M.modulo=M.mod=function(e,t){var r,i,o=this;return e=new W(e,t),!o.c||!e.s||e.c&&!e.c[0]?new W(NaN):!e.c||o.c&&!o.c[0]?new W(o):(9==F?(i=e.s,e.s=1,r=n(o,e,0,3),e.s=i,r.s*=i):r=n(o,e,0,F),(e=o.minus(r.times(e))).c[0]||1!=F||(e.s=o.s),e)},M.multipliedBy=M.times=function(e,t){var n,r,i,o,s,a,h,u,p,g,m,y,w,b,v,E=this,C=E.c,S=(e=new W(e,t)).c;if(!(C&&S&&C[0]&&S[0]))return!E.s||!e.s||C&&!C[0]&&!S||S&&!S[0]&&!C?e.c=e.e=e.s=null:(e.s*=E.s,C&&S?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=f(E.e/c)+f(e.e/c),e.s*=E.s,(h=C.length)<(g=S.length)&&(w=C,C=S,S=w,i=h,h=g,g=i),i=h+g,w=[];i--;w.push(0));for(b=l,v=d,i=g;0<=--i;){for(n=0,m=S[i]%v,y=S[i]/v|0,o=i+(s=h);i<o;)n=((u=m*(u=C[--s]%v)+(a=y*u+(p=C[s]/v|0)*m)%v*v+w[o]+n)/b|0)+(a/v|0)+y*p,w[o--]=u%b;w[o]=n}return n?++r:w.splice(0,1),Y(e,w,r)},M.negated=function(){var e=new W(this);return e.s=-e.s||null,e},M.plus=function(e,t){var n,r=this,i=r.s;if(t=(e=new W(e,t)).s,!i||!t)return new W(NaN);if(i!=t)return e.s=-t,r.minus(e);var o=r.e/c,s=e.e/c,a=r.c,h=e.c;if(!o||!s){if(!a||!h)return new W(i/0);if(!a[0]||!h[0])return h[0]?e:new W(a[0]?r:0*i)}if(o=f(o),s=f(s),a=a.slice(),i=o-s){for((n=0<i?(s=o,h):(i=-i,a)).reverse();i--;n.push(0));n.reverse()}for((i=a.length)-(t=h.length)<0&&(n=h,h=a,a=n,t=i),i=0;t;)i=(a[--t]=a[t]+h[t]+i)/l|0,a[t]=l===a[t]?0:a[t]%l;return i&&(a=[i].concat(a),++s),Y(e,a,s)},M.precision=M.sd=function(e,t){var n,r,i;if(null!=e&&e!==!!e)return y(e,1,p),null==t?t=L:y(t,0,8),X(new W(this),e,t);if(!(n=this.c))return null;if(r=(i=n.length-1)*c+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];10<=i;i/=10,r++);}return e&&this.e+1>r&&(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<c&&--l,"9999"!=(t=t.slice(l-3,l+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(X(r,r.e+_+2,1),e=!r.times(r).eq(s));break}if(!i&&(X(o,o.e+_+2,0),o.times(o).eq(s))){r=o;break}h+=4,l+=4,i=1}return X(r,r.e+_+1,L,e)},M.toExponential=function(e,t){return null!=e&&(y(e,0,p),e++),G(this,e,t,1)},M.toFixed=function(e,t){return null!=e&&(y(e,0,p),e=e+this.e+1),G(this,e,t)},M.toFormat=function(e,t,n){var r;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=V;else if("object"!=typeof n)throw Error(s+"Argument not an object: "+n);if(r=this.toFixed(e,t),this.c){var i,o=r.split("."),a=+n.groupSize,l=+n.secondaryGroupSize,c=n.groupSeparator||"",h=o[0],u=o[1],d=this.s<0,p=d?h.slice(1):h,f=p.length;if(l&&(i=a,a=l,f-=l=i),0<a&&0<f){for(i=f%a||a,h=p.substr(0,i);i<f;i+=a)h+=c+p.substr(i,a);0<l&&(h+=c+p.slice(i)),d&&(h="-"+h)}r=u?h+(n.decimalSeparator||"")+((l=+n.fractionGroupSize)?u.replace(new RegExp("\\d{"+l+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):u):h}return(n.prefix||"")+r+(n.suffix||"")},M.toFraction=function(e){var t,r,i,o,a,l,h,d,p,f,m,y,w=this,b=w.c;if(null!=e&&(!(h=new W(e)).isInteger()&&(h.c||1!==h.s)||h.lt(x)))throw Error(s+"Argument "+(h.isInteger()?"out of range: ":"not an integer: ")+K(h));if(!b)return new W(w);for(t=new W(x),p=r=new W(x),i=d=new W(x),y=g(b),a=t.e=y.length-w.e-1,t.c[0]=u[(l=a%c)<0?c+l:l],e=!e||0<h.comparedTo(t)?0<a?t:p:h,l=H,H=1/0,h=new W(y),d.c[0]=0;f=n(h,t,0,1),1!=(o=r.plus(f.times(i))).comparedTo(e);)r=i,i=o,p=d.plus(f.times(o=p)),d=o,t=h.minus(f.times(o=t)),h=o;return o=n(e.minus(r),i,0,1),d=d.plus(o.times(p)),r=r.plus(o.times(i)),d.s=p.s=w.s,m=n(p,i,a*=2,L).minus(w).abs().comparedTo(n(d,r,a,L).minus(w).abs())<1?[p,i]:[d,r],H=l,m},M.toNumber=function(){return+K(this)},M.toPrecision=function(e,t){return null!=e&&y(e,1,p),G(this,e,t,2)},M.toString=function(e){var t,n=this,r=n.s,i=n.e;return null===i?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=null==e?i<=P||k<=i?b(g(n.c),i):v(g(n.c),i,"0"):10===e?v(g((n=X(new W(n),_+i+1,L)).c),n.e,"0"):(y(e,2,B.length,"Base"),E(v(g(n.c),i,"0"),10,e,r,!0)),r<0&&n.c[0]&&(t="-"+t)),t},M.valueOf=M.toJSON=function(){return K(this)},M._isBigNumber=!0,"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(M[Symbol.toStringTag]="BigNumber",M[Symbol.for("nodejs.util.inspect.custom")]=M.valueOf),null!=t&&W.set(t),W}()).default=n.BigNumber=n,void 0!==t&&t.exports?t.exports=n:(e||(e="undefined"!=typeof self&&self?self:window),e.BigNumber=n)}(this)},{}],2:[function(e,t,n){"use strict";t.exports={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(e){var t=e%10;return 1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}},{}],3:[function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==a.return||a.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var i=e("./globalState"),o=e("./validating"),s=e("./parsing"),a=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],l={general:{scale:1024,suffixes:a,marker:"bd"},binary:{scale:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],marker:"b"},decimal:{scale:1e3,suffixes:a,marker:"d"}},c={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1};function h(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length?arguments[2]:void 0;if("string"==typeof t&&(t=s.parseFormat(t)),!o.validateFormat(t))return"ERROR: invalid format";var r=t.prefix||"",a=t.postfix||"",h=function(e,t,n){switch(t.output){case"currency":return t=g(t,i.currentCurrencyDefaultFormat()),function(e,t,n){var r=n.currentCurrency(),i=Object.assign({},c,t),o=void 0,s="",a=!!i.totalLength||!!i.forceAverage||i.average,l=t.currencyPosition||r.position,h=t.currencySymbol||r.symbol;i.spaceSeparated&&(s=" "),"infix"===l&&(o=s+h+s);var u=f({instance:e,providedFormat:t,state:n,decimalSeparator:o});return"prefix"===l&&(u=e._value<0&&"sign"===i.negative?"-".concat(s).concat(h).concat(u.slice(1)):h+s+u),l&&"postfix"!==l||(u=u+(s=a?"":s)+h),u}(e,t,i);case"percent":return t=g(t,i.currentPercentageDefaultFormat()),function(e,t,n,r){var i=t.prefixSymbol,o=f({instance:r(100*e._value),providedFormat:t,state:n}),s=Object.assign({},c,t);return i?"%".concat(s.spaceSeparated?" ":"").concat(o):"".concat(o).concat(s.spaceSeparated?" ":"","%")}(e,t,i,n);case"byte":return t=g(t,i.currentByteDefaultFormat()),v=e,C=i,S=n,R=(E=t).base||"binary",T=l[R],O=u(v._value,T.suffixes,T.scale),N=O.value,A=O.suffix,I=f({instance:S(N),providedFormat:E,state:C,defaults:C.currentByteDefaultFormat()}),M=C.currentAbbreviations(),"".concat(I).concat(M.spaced?" ":"").concat(A);case"time":return t=g(t,i.currentTimeDefaultFormat()),m=e,y=Math.floor(m._value/60/60),w=Math.floor((m._value-60*y*60)/60),b=Math.round(m._value-60*y*60-60*w),"".concat(y,":").concat(w<10?"0":"").concat(w,":").concat(b<10?"0":"").concat(b);case"ordinal":return t=g(t,i.currentOrdinalDefaultFormat()),r=e,o=t,a=(s=i).currentOrdinal(),h=Object.assign({},c,o),d=f({instance:r,providedFormat:o,state:s}),p=a(r._value),"".concat(d).concat(h.spaceSeparated?" ":"").concat(p);case"number":default:return f({instance:e,providedFormat:t,numbro:n})}var r,o,s,a,h,d,p,m,y,w,b,v,E,C,S,R,T,O,N,A,I,M}(e,t,n);return(h=r+h)+a}function u(e,t,n){var r=t[0],i=Math.abs(e);if(n<=i){for(var o=1;o<t.length;++o){var s=Math.pow(n,o),a=Math.pow(n,o+1);if(s<=i&&i<a){r=t[o],e/=s;break}}r===t[0]&&(e/=Math.pow(n,t.length-1),r=t[t.length-1])}return{value:e,suffix:r}}function d(e){for(var t="",n=0;n<e;n++)t+="0";return t}function p(e,t){return-1!==e.toString().indexOf("e")?function(e,t){var n=e.toString(),i=r(n.split("e"),2),o=i[0],s=i[1],a=r(o.split("."),2),l=a[0],c=a[1],h=void 0===c?"":c;if(0<+s)n=l+h+d(s-h.length);else{var u=".";u=+l<0?"-0".concat(u):"0".concat(u);var p=(d(-s-1)+Math.abs(l)+h).substr(0,t);p.length<t&&(p+=d(t-p.length)),n=u+p}return 0<+s&&0<t&&(n+=".".concat(d(t))),n}(e,t):(Math.round(+"".concat(e,"e+").concat(t))/Math.pow(10,t)).toFixed(t)}function f(e){var t=e.instance,n=e.providedFormat,o=e.state,s=void 0===o?i:o,a=e.decimalSeparator,l=e.defaults,h=void 0===l?s.currentDefaults():l,u=t._value;if(0===u&&s.hasZeroFormat())return s.getZeroFormat();if(!isFinite(u))return u.toString();var d,f,g,m,y,w,b,v,E=Object.assign({},c,h,n),C=E.totalLength,S=C?0:E.characteristic,R=E.optionalCharacteristic,T=E.forceAverage,O=!!C||!!T||E.average,N=C?-1:O&&void 0===n.mantissa?0:E.mantissa,A=!C&&(void 0===n.optionalMantissa?-1===N:E.optionalMantissa),I=E.trimMantissa,M=E.thousandSeparated,x=E.spaceSeparated,_=E.negative,L=E.forceSign,P=E.exponential,k="";if(O){var j=function(e){var t=e.value,n=e.forceAverage,r=e.abbreviations,i=e.spaceSeparated,o=void 0!==i&&i,s=e.totalLength,a=void 0===s?0:s,l="",c=Math.abs(t),h=-1;if(c>=Math.pow(10,12)&&!n||"trillion"===n?(l=r.trillion,t/=Math.pow(10,12)):c<Math.pow(10,12)&&c>=Math.pow(10,9)&&!n||"billion"===n?(l=r.billion,t/=Math.pow(10,9)):c<Math.pow(10,9)&&c>=Math.pow(10,6)&&!n||"million"===n?(l=r.million,t/=Math.pow(10,6)):(c<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&&1<m&&(v*=Math.pow(10,m-1),b=0<=(b=+b-(m-1))?"+".concat(b):b),{value:v,abbreviation:"e".concat(b)});u=H.value,k=H.abbreviation+k}var D,F,U,V=function(e,t,n,i,o){if(-1===i)return e;var s=p(t,i),a=r(s.toString().split("."),2),l=a[0],c=a[1],h=void 0===c?"":c;if(h.match(/^0+$/)&&(n||o))return l;var u=h.match(/0+$/);return o&&u?"".concat(l,".").concat(h.toString().slice(0,u.index)):s.toString()}(u.toString(),u,A,N,I);return V=function(e,t,n,r,i){var o=r.currentDelimiters(),s=o.thousands;i=i||o.decimal;var a=o.thousandsSize||3,l=e.toString(),c=l.split(".")[0],h=l.split(".")[1];return n&&(t<0&&(c=c.slice(1)),function(e,t){for(var n=[],r=0,i=e;0<i;i--)r===t&&(n.unshift(i),r=0),r++;return n}(c.length,a).forEach((function(e,t){c=c.slice(0,e+t)+s+c.slice(e+t)})),t<0&&(c="-".concat(c))),h?c+i+h:c}(V=function(e,t,n,i){var o=e,s=r(o.toString().split("."),2),a=s[0],l=s[1];if(a.match(/^-?0$/)&&n)return l?"".concat(a.replace("0",""),".").concat(l):a.replace("0","");if(a.length<i)for(var c=i-a.length,h=0;h<c;h++)o="0".concat(o);return o.toString()}(V,0,R,S),u,M,s,a),(O||P)&&(V+=k),(L||u<0)&&(D=V,U=_,V=0===(F=u)?D:0==+D?D.replace("-",""):0<F?"+".concat(D):"sign"===U?D:"(".concat(D.replace("-",""),")")),V}function g(e,t){if(!e)return t;var n=Object.keys(e);return 1===n.length&&"output"===n[0]?t:e}t.exports=function(e){return{format:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return h.apply(void 0,n.concat([e]))},getByteUnit:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=l.general;return u(e._value,t.suffixes,t.scale).suffix}.apply(void 0,n.concat([e]))},getBinaryByteUnit:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=l.binary;return u(e._value,t.suffixes,t.scale).suffix}.apply(void 0,n.concat([e]))},getDecimalByteUnit:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=l.decimal;return u(e._value,t.suffixes,t.scale).suffix}.apply(void 0,n.concat([e]))},formatOrDefault:g}}},{"./globalState":4,"./parsing":8,"./validating":10}],4:[function(e,t,n){"use strict";var r=e("./en-US"),i=e("./validating"),o=e("./parsing"),s={},a=void 0,l={},c=null,h={};function u(e){a=e}function d(){return l[a]}s.languages=function(){return Object.assign({},l)},s.currentLanguage=function(){return a},s.currentCurrency=function(){return d().currency},s.currentAbbreviations=function(){return d().abbreviations},s.currentDelimiters=function(){return d().delimiters},s.currentOrdinal=function(){return d().ordinal},s.currentDefaults=function(){return Object.assign({},d().defaults,h)},s.currentOrdinalDefaultFormat=function(){return Object.assign({},s.currentDefaults(),d().ordinalFormat)},s.currentByteDefaultFormat=function(){return Object.assign({},s.currentDefaults(),d().byteFormat)},s.currentPercentageDefaultFormat=function(){return Object.assign({},s.currentDefaults(),d().percentageFormat)},s.currentCurrencyDefaultFormat=function(){return Object.assign({},s.currentDefaults(),d().currencyFormat)},s.currentTimeDefaultFormat=function(){return Object.assign({},s.currentDefaults(),d().timeFormat)},s.setDefaults=function(e){e=o.parseFormat(e),i.validateFormat(e)&&(h=e)},s.getZeroFormat=function(){return c},s.setZeroFormat=function(e){return c="string"==typeof e?e:null},s.hasZeroFormat=function(){return null!==c},s.languageData=function(e){if(e){if(l[e])return l[e];throw new Error('Unknown tag "'.concat(e,'"'))}return d()},s.registerLanguage=function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if(!i.validateLanguage(e))throw new Error("Invalid language data");l[e.languageTag]=e,t&&u(e.languageTag)},s.setLanguage=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:r.languageTag;if(!l[e]){var n=e.split("-")[0],i=Object.keys(l).find((function(e){return e.split("-")[0]===n}));return l[i]?void u(i):void u(t)}u(e)},s.registerLanguage(r),a=r.languageTag,t.exports=s},{"./en-US":2,"./parsing":8,"./validating":10}],5:[function(e,t,n){"use strict";t.exports=function(t){return{loadLanguagesInNode:function(n){return r=t,void n.forEach((function(t){var n=void 0;try{n=e("../languages/".concat(t))}catch(n){console.error('Unable to load "'.concat(t,'". No matching language file found.'))}n&&r.registerLanguage(n)}));var r}}}},{}],6:[function(e,t,n){"use strict";var r=e("bignumber.js");function i(e,t,n){var i=new r(e._value),o=t;return n.isNumbro(t)&&(o=t._value),o=new r(o),e._value=i.minus(o).toNumber(),e}t.exports=function(e){return{add:function(t,n){return o=n,s=e,a=new r((i=t)._value),l=o,s.isNumbro(o)&&(l=o._value),l=new r(l),i._value=a.plus(l).toNumber(),i;var i,o,s,a,l},subtract:function(t,n){return i(t,n,e)},multiply:function(t,n){return o=n,s=e,a=new r((i=t)._value),l=o,s.isNumbro(o)&&(l=o._value),l=new r(l),i._value=a.times(l).toNumber(),i;var i,o,s,a,l},divide:function(t,n){return o=n,s=e,a=new r((i=t)._value),l=o,s.isNumbro(o)&&(l=o._value),l=new r(l),i._value=a.dividedBy(l).toNumber(),i;var i,o,s,a,l},set:function(t,n){return r=t,o=i=n,e.isNumbro(i)&&(o=i._value),r._value=o,r;var r,i,o},difference:function(t,n){return r=n,i(s=(o=e)(t._value),r,o),Math.abs(s._value);var r,o,s}}}},{"bignumber.js":1}],7:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=e("./globalState"),o=e("./validating"),s=e("./loading")(p),a=e("./unformatting"),l=e("./formatting")(p),c=e("./manipulating")(p),h=e("./parsing"),u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._value=t}var t,n,o;return t=e,(n=[{key:"clone",value:function(){return p(this._value)}},{key:"format",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return l.format(this,e)}},{key:"formatCurrency",value:function(e){return"string"==typeof e&&(e=h.parseFormat(e)),(e=l.formatOrDefault(e,i.currentCurrencyDefaultFormat())).output="currency",l.format(this,e)}},{key:"formatTime",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return e.output="time",l.format(this,e)}},{key:"binaryByteUnits",value:function(){return l.getBinaryByteUnit(this)}},{key:"decimalByteUnits",value:function(){return l.getDecimalByteUnit(this)}},{key:"byteUnits",value:function(){return l.getByteUnit(this)}},{key:"difference",value:function(e){return c.difference(this,e)}},{key:"add",value:function(e){return c.add(this,e)}},{key:"subtract",value:function(e){return c.subtract(this,e)}},{key:"multiply",value:function(e){return c.multiply(this,e)}},{key:"divide",value:function(e){return c.divide(this,e)}},{key:"set",value:function(e){return c.set(this,d(e))}},{key:"value",value:function(){return this._value}},{key:"valueOf",value:function(){return this._value}}])&&r(t.prototype,n),o&&r(t,o),e}();function d(e){var t=e;return p.isNumbro(e)?t=e._value:"string"==typeof e?t=p.unformat(e):isNaN(e)&&(t=NaN),t}function p(e){return new u(d(e))}p.version="2.1.2",p.isNumbro=function(e){return e instanceof u},p.language=i.currentLanguage,p.registerLanguage=i.registerLanguage,p.setLanguage=i.setLanguage,p.languages=i.languages,p.languageData=i.languageData,p.zeroFormat=i.setZeroFormat,p.defaultFormat=i.currentDefaults,p.setDefaults=i.setDefaults,p.defaultCurrencyFormat=i.currentCurrencyDefaultFormat,p.validate=o.validate,p.loadLanguagesInNode=s.loadLanguagesInNode,p.unformat=a.unformat,t.exports=p},{"./formatting":3,"./globalState":4,"./loading":5,"./manipulating":6,"./parsing":8,"./unformatting":9,"./validating":10}],8:[function(e,t,n){"use strict";t.exports={parseFormat:function(e){var t,n,r,i,o,s,a,l,c,h,u,d,p,f,g,m,y,w,b,v,E=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return"string"!=typeof e?e:(n=E,e=(r=(t=e).match(/^{([^}]*)}/))?(n.prefix=r[1],t.slice(r[0].length)):t,o=E,function(e,t){if(-1===e.indexOf("$")){if(-1===e.indexOf("%"))return-1!==e.indexOf("bd")?(t.output="byte",t.base="general"):-1!==e.indexOf("b")?(t.output="byte",t.base="binary"):-1!==e.indexOf("d")?(t.output="byte",t.base="decimal"):-1===e.indexOf(":")?-1!==e.indexOf("o")&&(t.output="ordinal"):t.output="time";t.output="percent"}else t.output="currency"}(e=(s=(i=e).match(/{([^}]*)}$/))?(o.postfix=s[1],i.slice(0,-s[0].length)):i,E),a=E,(l=e.match(/[1-9]+[0-9]*/))&&(a.totalLength=+l[0]),c=E,(h=e.split(".")[0].match(/0+/))&&(c.characteristic=h[0].length),function(e,t){if(-1!==e.indexOf(".")){var n=e.split(".")[0];t.optionalCharacteristic=-1===n.indexOf("0")}}(e,E),u=E,-1!==e.indexOf("a")&&(u.average=!0),p=E,-1!==(d=e).indexOf("K")?p.forceAverage="thousand":-1!==d.indexOf("M")?p.forceAverage="million":-1!==d.indexOf("B")?p.forceAverage="billion":-1!==d.indexOf("T")&&(p.forceAverage="trillion"),function(e,t){var n=e.split(".")[1];if(n){var r=n.match(/0+/);r&&(t.mantissa=r[0].length)}}(e,E),g=E,(f=e).match(/\[\.]/)?g.optionalMantissa=!0:f.match(/\./)&&(g.optionalMantissa=!1),m=E,-1!==e.indexOf(",")&&(m.thousandSeparated=!0),y=E,-1!==e.indexOf(" ")&&(y.spaceSeparated=!0),b=E,(w=e).match(/^\+?\([^)]*\)$/)&&(b.negative="parenthesis"),w.match(/^\+?-/)&&(b.negative="sign"),v=E,e.match(/^\+/)&&(v.forceSign=!0),E)}}},{}],9:[function(e,t,n){"use strict";var r=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function i(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function o(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",o=3<arguments.length?arguments[3]:void 0,s=4<arguments.length?arguments[4]:void 0,a=5<arguments.length?arguments[5]:void 0,l=6<arguments.length?arguments[6]:void 0;if(""!==e)return e===s?0:function e(t,n){var o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",s=3<arguments.length?arguments[3]:void 0,a=4<arguments.length?arguments[4]:void 0,l=5<arguments.length?arguments[5]:void 0,c=6<arguments.length?arguments[6]:void 0;if(!isNaN(+t))return+t;var h="",u=t.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(u!==t)return-1*e(u,n,o,s,a,l,c);for(var d=0;d<r.length;d++){var p=r[d];if((h=t.replace(p.key,""))!==t)return e(h,n,o,s,a,l,c)*p.factor}if((h=t.replace("%",""))!==t)return e(h,n,o,s,a,l,c)/100;var f=parseFloat(t);if(!isNaN(f)){var g=s(f);if(g&&"."!==g&&(h=t.replace(new RegExp("".concat(i(g),"$")),""))!==t)return e(h,n,o,s,a,l,c);var m={};Object.keys(l).forEach((function(e){m[l[e]]=e}));for(var y=Object.keys(m).sort().reverse(),w=y.length,b=0;b<w;b++){var v=y[b],E=m[v];if((h=t.replace(v,""))!==t){var C=void 0;switch(E){case"thousand":C=Math.pow(10,3);break;case"million":C=Math.pow(10,6);break;case"billion":C=Math.pow(10,9);break;case"trillion":C=Math.pow(10,12)}return e(h,n,o,s,a,l,c)*C}}}}(function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",r=e.replace(n,"");return(r=r.replace(new RegExp("([0-9])".concat(i(t.thousands),"([0-9])"),"g"),"$1$2")).replace(t.decimal,".")}(e,t,n),t,n,o,s,a,l)}t.exports={unformat:function(t,n){var r,i,s,a=e("./globalState"),l=a.currentDelimiters(),c=a.currentCurrency().symbol,h=a.currentOrdinal(),u=a.getZeroFormat(),d=a.currentAbbreviations(),p=void 0;if("string"==typeof t)p=function(e,t){if(!e.indexOf(":")||":"===t.thousands)return!1;var n=e.split(":");if(3!==n.length)return!1;var r=+n[0],i=+n[1],o=+n[2];return!isNaN(r)&&!isNaN(i)&&!isNaN(o)}(t,l)?(r=t.split(":"),i=+r[0],s=+r[1],+r[2]+60*s+3600*i):o(t,l,c,h,u,d,n);else{if("number"!=typeof t)return;p=t}if(void 0!==p)return p}}},{"./globalState":4}],10:[function(e,t,n){"use strict";function r(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(e){return(i="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)}var o=e("./unformatting"),s=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,a={output:{type:"string",validValues:["currency","percent","byte","time","ordinal","number"]},base:{type:"string",validValues:["decimal","binary","general"],restriction:function(e,t){return"byte"===t.output},message:"`base` must be provided only when the output is `byte`",mandatory:function(e){return"byte"===e.output}},characteristic:{type:"number",restriction:function(e){return 0<=e},message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:["trillion","billion","million","thousand"]},average:"boolean",currencyPosition:{type:"string",validValues:["prefix","infix","postfix"]},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:function(e){return 0<=e},message:"value must be positive"},{restriction:function(e,t){return!t.exponential},message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:function(e){return 0<=e},message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:["sign","parenthesis"]},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:function(e,t){return"percent"===t.output},message:"`prefixSymbol` can be provided only when the output is `percent`"}},l={languageTag:{type:"string",mandatory:!0,restriction:function(e){return e.match(s)},message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:{type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},spaceSeparated:"boolean",ordinal:{type:"function",mandatory:!0},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function c(e){return!!o.unformat(e)}function h(e,t,n){var o=3<arguments.length&&void 0!==arguments[3]&&arguments[3],s=Object.keys(e).map((function(r){if(!t[r])return console.error("".concat(n," Invalid key: ").concat(r)),!1;var o=e[r],s=t[r];if("string"==typeof s&&(s={type:s}),"format"===s.type){if(!h(o,a,"[Validate ".concat(r,"]"),!0))return!1}else if(i(o)!==s.type)return console.error("".concat(n," ").concat(r,' type mismatched: "').concat(s.type,'" expected, "').concat(i(o),'" provided')),!1;if(s.restrictions&&s.restrictions.length)for(var l=s.restrictions.length,c=0;c<l;c++){var u=s.restrictions[c],d=u.restriction,p=u.message;if(!d(o,e))return console.error("".concat(n," ").concat(r," invalid value: ").concat(p)),!1}return s.restriction&&!s.restriction(o,e)?(console.error("".concat(n," ").concat(r," invalid value: ").concat(s.message)),!1):s.validValues&&-1===s.validValues.indexOf(o)?(console.error("".concat(n," ").concat(r," invalid value: must be among ").concat(JSON.stringify(s.validValues),', "').concat(o,'" provided')),!1):!(s.children&&!h(o,s.children,"[Validate ".concat(r,"]")))}));return o||s.push.apply(s,r(Object.keys(t).map((function(r){var i=t[r];if("string"==typeof i&&(i={type:i}),i.mandatory){var o=i.mandatory;if("function"==typeof o&&(o=o(e)),o&&void 0===e[r])return console.error("".concat(n,' Missing mandatory key "').concat(r,'"')),!1}return!0})))),s.reduce((function(e,t){return e&&t}),!0)}function u(e){return h(e,a,"[Validate format]")}t.exports={validate:function(e,t){var n=c(e),r=u(t);return n&&r},validateFormat:u,validateInput:c,validateLanguage:function(e){return h(e,l,"[Validate language]")}}},{"./unformatting":9}]},{},[7])(7)}))},8793:function(e,t,n){"use strict";var r=n("73fa");e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},"87d6":function(e,t,n){"use strict";n.d(t,"b",(function(){return h}));n("7a89"),n("d06e");var r=n("de3b");function i(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=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)}let a=0;class l{constructor(){let e=arguments.length>0&&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<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:i.value})}else s(n.value,e),e.push(o("-")),s(i.value,e)}else s(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:t,value:e}},e.prototype.classAtom=function(){switch(this.peekChar()){case"]":case"\n":case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}},e.prototype.classEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:o("\b")};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.group=function(){var e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}var t=this.disjunction();this.consumeChar(")");var n={type:"Group",capturing:e,value:t};return e&&(n.idx=this.groupIdx),n},e.prototype.positiveInteger=function(){var e=this.popChar();if(!1===i.test(e))throw Error("Expecting a positive integer");while(r.test(this.peekChar(0)))e+=this.popChar();return parseInt(e,10)},e.prototype.integerIncludingZero=function(){var e=this.popChar();if(!1===r.test(e))throw Error("Expecting an integer");while(r.test(this.peekChar(0)))e+=this.popChar();return parseInt(e,10)},e.prototype.patternCharacter=function(){var e=this.popChar();switch(e){case"\n":case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:o(e)}}},e.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}},e.prototype.isRangeDash=function(){return"-"===this.peekChar()&&this.isClassAtom(1)},e.prototype.isDigit=function(){return r.test(this.peekChar(0))},e.prototype.isClassAtom=function(e){switch(void 0===e&&(e=0),this.peekChar(e)){case"]":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},e.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},e.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}},e.prototype.isAssertion=function(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return"?"===this.peekChar(1)&&("="===this.peekChar(2)||"!"===this.peekChar(2));default:return!1}},e.prototype.isQuantifier=function(){var e=this.saveState();try{return void 0!==this.quantifier(!0)}catch(t){return!1}finally{this.restoreState(e)}},e.prototype.isPatternCharacter=function(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},e.prototype.parseHexDigits=function(e){for(var t="",r=0;r<e;r++){var i=this.popChar();if(!1===n.test(i))throw Error("Expecting a HexDecimal digits");t+=i}var o=parseInt(t,16);return{type:"Character",value:o}},e.prototype.peekChar=function(e){return void 0===e&&(e=0),this.input[this.idx+e]},e.prototype.popChar=function(){var e=this.peekChar(0);return this.consumeChar(),e},e.prototype.consumeChar=function(e){if(void 0!==e&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=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<h;l++)i.push(l);return i}for(l=0;l<h;l++){if(a=Object(p["stripTags"])(Object(d["stringify"])(t[l])),n)c=a.indexOf(e);else{const t=this.cellProperties.locale;c=a.toLocaleLowerCase(t).indexOf(e.toLocaleLowerCase(t))}-1!==c&&(s=a.length-c-o,r.push({baseIndex:l,index:c,charsLeft:s,value:a}))}for(r.sort((e,t)=>{if(-1===t.index)return-1;if(-1===e.index)return 1;if(e.index<t.index)return-1;if(t.index<e.index)return 1;if(e.index===t.index){if(e.charsLeft<t.charsLeft)return-1;if(e.charsLeft>t.charsLeft)return 1}return 0}),l=0,h=r.length;l<h;l++)i.push(r[l].baseIndex);return i}))}static get EDITOR_TYPE(){return T}getValue(){const e=this.rawChoices.find(e=>{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,`<strong>${b}</strong>`))),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;t<n;t++){if(r&&c<=t)break;c?e.push(l[s[t]]):e.push(l[t])}a=0,l=e}this.strippedChoices=l,this.htEditor.loadData(Object(u["pivot"])([l])),0===l.length?this.htEditor.rootElement.style.display="none":(this.htEditor.rootElement.style.display="",this.updateDropdownHeight(),this.flipDropdownIfNeeded(),!0===this.cellProperties.strict&&this.highlightBestMatchingChoice(a)),this.hot.listen(),Object(i["setCaretPosition"])(this.TEXTAREA,t,t===n?void 0:n)}flipDropdownIfNeeded(){const e=Object(i["getTrimmingContainer"])(this.hot.view._wt.wtTable.TABLE),t=e===this.hot.rootWindow,n=this.cellProperties.preventOverflow;if(t||!t&&(n||"horizontal"===n))return!1;const r=Object(i["offset"])(this.TEXTAREA),o=Object(i["outerHeight"])(this.TEXTAREA),s=this.getDropdownHeight(),a=e.scrollTop,l=Object(i["outerHeight"])(this.hot.view._wt.wtTable.THEAD),c=Object(i["offset"])(e),h=r.top-c.top-l+a,u=e.scrollHeight-h-l-o,d=s>u&&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<e);o=n-i,this.htEditor.flipped&&(this.htEditor.rootElement.style.top=parseInt(this.htEditor.rootElement.style.top,10)+t-o+"px"),this.setDropdownHeight(n-i)}}flipDropdown(e){const t=this.htEditor.rootElement.style;t.position="absolute",t.top=-e+"px",this.htEditor.flipped=!0}unflipDropdown(){const e=this.htEditor.rootElement.style;e.position="absolute",e.top="",this.htEditor.flipped=void 0}updateDropdownHeight(){const e=this.htEditor.getColWidth(0)+Object(i["getScrollbarWidth"])(this.hot.rootDocument)+2,t=this.cellProperties.trimDropdown;this.htEditor.updateSettings({height:this.getDropdownHeight(),width:t?void 0:e}),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}setDropdownHeight(e){this.htEditor.updateSettings({height:e})}highlightBestMatchingChoice(e){"number"===typeof e?this.htEditor.selectCell(e,0,void 0,void 0,void 0,!1):this.htEditor.deselectCell()}getDropdownHeight(){const e=this.htEditor.getRowHeight(0)||23,t=this.cellProperties.visibleRows;return this.strippedChoices.length>=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<this.htEditor.countRows()-1&&(r=!0),e===f["KEY_CODES"].ARROW_UP&&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'<td class="is-empty"></td>';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"),'<td data-day="'+e.day+'" class="'+t.join(" ")+'" aria-selected="'+n+'"><button class="pika-button pika-day" type="button" data-pika-year="'+e.year+'" data-pika-month="'+e.month+'" data-pika-day="'+e.day+'">'+e.day+"</button></td>"},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'<td class="pika-week">'+s+"</td>"},ne=function(e,t,n,r){return'<tr class="pika-row'+(n?" pick-whole-week":"")+(r?" is-selected":"")+'">'+(t?e.reverse():e).join("")+"</tr>"},re=function(e){return"<tbody>"+e.join("")+"</tbody>"},ie=function(e){let t,n=[];for(e.showWeekNumber&&n.push("<th></th>"),t=0;t<7;t++)n.push('<th scope="col"><abbr title="'+Z(e,t)+'">'+Z(e,t,!0)+"</abbr></th>");return"<thead><tr>"+(e.isRTL?n.reverse():n).join("")+"</tr></thead>"},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='<div id="'+o+'" class="pika-title" role="heading" aria-live="polite">',g=!0,m=!0;for(l=[],s=0;s<12;s++)l.push('<option value="'+(n===i?s-t:12+s-t)+'"'+(s===r?' selected="selected"':"")+(d&&s<u.minMonth||p&&s>u.maxMonth?' disabled="disabled"':"")+">"+u.i18n.months[s]+"</option>");for(c='<div class="pika-label">'+u.i18n.months[r]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",V(u.yearRange)?(s=u.yearRange[0],a=u.yearRange[1]+1):(s=n-u.yearRange,a=1+n+u.yearRange),l=[];s<a&&s<=u.maxYear;s++)s>=u.minYear&&l.push('<option value="'+s+'"'+(s===n?' selected="selected"':"")+">"+s+"</option>");return h='<div class="pika-label">'+n+u.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",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+='<button class="pika-prev'+(g?"":" is-disabled")+'" type="button">'+u.i18n.previousMonth+"</button>"),t===e._o.numberOfMonths-1&&(f+='<button class="pika-next'+(m?"":" is-disabled")+'" type="button">'+u.i18n.nextMonth+"</button>"),f+"</div>"},se=function(e,t,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+ie(e)+re(t)+"</table>"};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.maxDate<t.minDate&&(t.maxDate=t.minDate=!1),t.minDate&&this.setMinDate(t.minDate),t.maxDate&&this.setMaxDate(t.maxDate),V(t.yearRange)){let e=(new Date).getFullYear()-10;t.yearRange[0]=parseInt(t.yearRange[0],10)||e,t.yearRange[1]=parseInt(t.yearRange[1],10)||e}else t.yearRange=Math.abs(parseInt(t.yearRange,10))||Q.yearRange,t.yearRange>100&&(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)&&e<n?e=n:B(r)&&e>r&&(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<n.getTime()||r.getTime()<i}t&&(this.calendars=[{month:e.getMonth(),year:e.getFullYear()}],"right"===this._o.mainCalendar&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(e,t){let n,r=this.getDate()||new Date,i=24*parseInt(t)*60*60*1e3;"add"===e?n=new Date(r.valueOf()+i):"subtract"===e&&(n=new Date(r.valueOf()-i)),this.setDate(n)},adjustCalendars:function(){this.calendars[0]=q(this.calendars[0]);for(let e=1;e<this._o.numberOfMonths;e++)this.calendars[e]=q({month:this.calendars[0].month+e,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(e){isNaN(e)||(this.calendars[0].month=parseInt(e,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(e){isNaN(e)||(this.calendars[0].year=parseInt(e,10),this.adjustCalendars())},setMinDate:function(e){e instanceof Date?(Y(e),this._o.minDate=e,this._o.minYear=e.getFullYear(),this._o.minMonth=e.getMonth()):(this._o.minDate=Q.minDate,this._o.minYear=Q.minYear,this._o.minMonth=Q.minMonth,this._o.startRange=Q.startRange),this.draw()},setMaxDate:function(e){e instanceof Date?(Y(e),this._o.maxDate=e,this._o.maxYear=e.getFullYear(),this._o.maxMonth=e.getMonth()):(this._o.maxDate=Q.maxDate,this._o.maxYear=Q.maxYear,this._o.maxMonth=Q.maxMonth,this._o.endRange=Q.endRange),this.draw()},setStartRange:function(e){this._o.startRange=e},setEndRange:function(e){this._o.endRange=e},draw:function(e){if(!this._v&&!e)return;let t,n=this._o,r=n.minYear,i=n.maxYear,o=n.minMonth,s=n.maxMonth,a="";this._y<=r&&(this._y=r,!isNaN(o)&&this._m<o&&(this._m=o)),this._y>=i&&(this._y=i,!isNaN(s)&&this._m>s&&(this._m=s));for(let l=0;l<n.numberOfMonths;l++)t="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2),a+='<div class="pika-lendar">'+oe(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year,t)+this.render(this.calendars[l].year,this.calendars[l].month,t)+"</div>";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<f;y++){let n=new Date(e,t,y-s+1),f=!!B(this._d)&&X(n,this._d),g=X(n,i),b=-1!==r.events.indexOf(n.toDateString()),v=y<s||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.startRange<n&&n<r.endRange,N=r.minDate&&n<r.minDate||r.maxDate&&n>r.maxDate||r.disableWeekends&&W(n)||r.disableDayFn&&r.disableDayFn(n);v&&(y<s?(E=p+E,C=c,S=u):(E-=o,C=h,S=d));let A={day:E,month:C,year:S,hasEvent:b,isSelected:f,isToday:g,isDisabled:N,isEmpty:v,isStartRange:R,isEndRange:T,isInRange:O,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:r.enableSelectionDaysInNextAndPreviousMonths};r.pickWholeWeek&&f&&(m=!0),l.push(J(A)),7===++w&&(r.showWeekNumber&&l.unshift(te(this,y-s,t,e,r.firstWeekOfYearMinDays)),a.push(ne(l,r.isRTL,r.pickWholeWeek,m)),l=[],w=0,m=!1)}return se(r,a,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),U(this.el,"is-hidden"),this._o.bound&&(k(L(),"click",this._onClick),this.adjustPosition()),"function"===typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){let e=this._v;!1!==e&&(this._o.bound&&j(L(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),F(this.el,"is-hidden"),this._v=!1,void 0!==e&&"function"===typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){let e=this._o;this.hide(),j(this.el,"mousedown",this._onMouseDown,!0),j(this.el,"touchend",this._onMouseDown,!0),j(this.el,"change",this._onChange),e.keyboardInput&&j(L(),"keydown",this._onKeyChange),e.field&&(j(e.field,"change",this._onInputChange),e.bound&&(j(e.trigger,"click",this._onInputClick),j(e.trigger,"focus",this._onInputFocus),j(e.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};const ue="date",de="dateEditor";class pe extends r["a"]{constructor(){super(...arguments),le(this,"defaultDateFormat","DD/MM/YYYY"),le(this,"parentDestroyed",!1),le(this,"$datePicker",null)}static get EDITOR_TYPE(){return ue}init(){if("function"!==typeof x)throw new Error("You need to include moment.js to your project.");if("function"!==typeof ae)throw new Error("You need to include Pikaday to your project.");super.init(),this.hot.addHook("afterDestroy",()=>{this.parentDestroyed=!0,this.destroyElements()})}createElements(){super.createElements(),this.datePicker=this.hot.rootDocument.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,this.datePicker.setAttribute("dir",this.hot.isRtl()?"rtl":"ltr"),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;n++)t[e[n]]=e[n];else"object"===typeof e&&(t=e);return t}refreshValue(){const e=this.hot.getSourceDataAtCell(this.row,this.prop);this.originalValue=e,this.setValue(e),this.refreshDimensions()}refreshDimensions(){if(this.state!==A["b"].EDITING)return;if(this.TD=this.getEditedCell(),!this.TD)return void this.close();const{top:e,start:t,width:n,height:r}=this.getEditedCellRect(),o=this.select.style;o.height=r+"px",o.width=n+"px",o.top=e+"px",o[this.hot.isRtl()?"right":"left"]=t+"px",o.margin="0px",Object(i["addClass"])(this.select,Ee)}registerShortcuts(){const e=this.hot.getShortcutManager(),t=e.getContext("editor"),n=e.getContext("grid"),r={group:Ce};t.addShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:n,callback:()=>{}}],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<n.length;s++){const{row:a,col:l}=n[s].getTopStartCorner(),{row:c,col:h}=n[s].getBottomEndCorner();for(let n=a;n<=c;n+=1)for(let r=l;r<=h;r+=1){const s=e.getCellMeta(n,r),a={checkedTemplate:s.checkedTemplate,uncheckedTemplate:s.uncheckedTemplate};if("checkbox"!==s.type)return;if(!0===s.readOnly)continue;"undefined"===typeof s.checkedTemplate&&(s.checkedTemplate=!0),"undefined"===typeof s.uncheckedTemplate&&(s.uncheckedTemplate=!1);const l=e.getDataAtCell(n,r);!1===t?[s.checkedTemplate,s.checkedTemplate.toString()].includes(l)?i.push([n,r,s.uncheckedTemplate,a]):[s.uncheckedTemplate,s.uncheckedTemplate.toString(),null,void 0].includes(l)&&i.push([n,r,s.checkedTemplate,a]):i.push([n,r,s.uncheckedTemplate,a]),o+=1}r.push(o),o=0}i=i.every(e=>{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;n<t.length;n++){const r=t[n].getTopStartCorner(),i=t[n].getBottomEndCorner();for(let t=r.row;t<=i.row;t++)for(let n=r.col;n<=i.col;n++){const r=e.getCellMeta(t,n);if("checkbox"!==r.type)return!1;const i=e.getCell(t,n);if(null===i||void 0===i)return!0;{const e=i.querySelectorAll("input[type=checkbox]");if(e.length>0&&!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<i;t++)if(n===e[t]){r=!0;break}t(r)}}mt.VALIDATOR_TYPE=gt;var wt=n("3eb5");const bt="date";function vt(e,t){const n=Object(Ne["b"])(ue,this.instance);let r=e,i=!0;null!==r&&void 0!==r||(r="");let o=x(r,this.dateFormat||n.defaultDateFormat,!0).isValid(),s=x(new Date(r)).isValid()||o;if(this.allowEmpty&&""===r&&(s=!0,o=!0),s||(i=!1),!s&&o&&(i=!0),s&&!o)if(!0===this.correctFormat){const e=Et(r,this.dateFormat),t=this.instance.toVisualRow(this.row),n=this.instance.toVisualColumn(this.col);this.instance.setDataAtCell(t,n,e,"dateValidator"),i=!0}else i=!1;t(i)}function Et(e,t){const n=x(Object(wt["getNormalizedDate"])(e)),r=x(e,t),i=e.search(/[A-z]/g)>-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;r<t;r++)n[r]=arguments[r];return bn(Rn,e,Nn).call(e,...n)})),this.addHook("beforeChangeRender",e=>bn(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<n?r=Object(tn["requestAnimationFrame"])(i):(Object(tn["cancelAnimationFrame"])(r),this.inProgress=!1,this.hot.view.adjustElementsSize())},o=this.getSyncCalculationLimit();this.firstCalculation&&o>=0&&(this.calculateColumnsWidth({from:0,to:o},e),this.firstCalculation=!1,t=o+1),t<n?i():this.inProgress=!1}setSamplingOptions(){const e=this.hot.getSettings()[vn],t=e&&Object(s["hasOwnProperty"])(e,"samplingRatio")?e.samplingRatio:void 0,n=e&&Object(s["hasOwnProperty"])(e,"allowSampleDuplicates")?e.allowSampleDuplicates:void 0;t&&!isNaN(t)&&this.samplesGenerator.setSampleCount(parseInt(t,10)),n&&this.samplesGenerator.setAllowDuplicates(n)}recalculateAllColumnsWidth(){this.hot.view&&this.hot.view._wt.wtTable.isVisible()&&(this.clearCache(),this.calculateAllColumnsWidth())}getSyncCalculationLimit(){const e=this.hot.getSettings()[vn];let t=Tn.SYNC_CALCULATION_LIMIT;const n=this.hot.countCols()-1;return Object(s["isObject"])(e)&&(t=e.syncLimit,Object(p["isPercentValue"])(t)?t=Object(rt["valueAccordingPercent"])(n,t):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-1<n||wn(Sn,this)[n]!==t)&&e.push(n),r-1<n?wn(Sn,this).push(t):wn(Sn,this)[n]=t,e},[]);return t}clearCache(){let e=arguments.length>0&&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[1]?(o="left",r=n(t[0],t[1]),i=n(t[2],e[1]-1)):t[2]===e[2]&&t[0]===e[0]&&t[3]>e[3]?(o="right",r=n(t[0],e[3]+1),i=n(t[2],t[3])):t[0]<e[0]&&t[1]===e[1]?(o="up",r=n(t[0],t[1]),i=n(e[0]-1,t[3])):t[2]>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;n++)o.push(s[(n+(s.length-t))%s.length])}else{const e=u.col-h.col+1,t=e%s[0].length;for(let n=0;n<s.length;n++){o.push([]);for(let r=0;r<e;r++)o[n].push(s[n][(r+(s[n].length-t))%s[n].length])}}this.hot.populateFromArray(h.row,h.col,o,u.row,u.col,this.pluginName+".fill",null),this.setSelection(l),this.hot.runHooks("afterAutofill",o,t,n,c),this.hot.render()}else this.hot._refreshBorders();return!0}reduceSelectionAreaIfNeeded(e){return e.row<0&&(e.row=0),e.col<0&&(e.col=0),e}getCoordsOfDragAndDropBorders(e){const t=this.hot.getSelectedRangeLast(),n=t.getBottomEndCorner();let r=e;if(this.directions.includes(_n.vertical)&&this.directions.includes(_n.horizontal)){const i=t.getTopStartCorner();(n.col<=e.col||i.col>=e.col)&&(r=this.hot._createCellCoords(n.row,e.col)),(n.row<e.row||i.row>e.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]<n-1&&t[2]===n-1&&(this.addingStarted=!0,this.addRow())}}getIndexOfLastAdjacentFilledInRow(e){const t=this.hot.getData(),n=this.hot.countRows();let r;for(let i=e[2]+1;i<n;i++){for(let r=e[1];r<=e[3];r++){const e=t[i][r];if(!Object(d["isEmpty"])(e))return-1}const n=t[i][e[1]-1],o=t[i][e[3]+1];Object(d["isEmpty"])(n)&&Object(d["isEmpty"])(o)||(r=i)}return r}addSelectionFromStartAreaToSpecificRowIndex(e,t){this.hot.selection.highlight.getFill().clear().add(this.hot._createCellCoords(e[0],e[1])).add(this.hot._createCellCoords(t,e[3])).commit()}setSelection(e){this.hot.selectCell(...Object(u["arrayMap"])(e,e=>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;r<t;r++)n[r]=arguments[r];return ir(lr,e,dr).call(e,...n)})),this.addHook("beforeChangeRender",e=>ir(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<n?r=Object(tn["requestAnimationFrame"])(i):(Object(tn["cancelAnimationFrame"])(r),this.inProgress=!1,this.hot.view.adjustElementsSize(!0),this.hot.view._wt.wtOverlays.inlineStartOverlay.needFullRender&&this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.draw())},o=this.getSyncCalculationLimit();this.firstCalculation&&o>=0&&(this.calculateRowsHeight({from:0,to:o},e),this.firstCalculation=!1,t=o+1),t<n?i():(this.inProgress=!1,this.hot.view.adjustElementsSize(!1))}setSamplingOptions(){const e=this.hot.getSettings()[or],t=e&&Object(s["hasOwnProperty"])(e,"samplingRatio")?e.samplingRatio:void 0,n=e&&Object(s["hasOwnProperty"])(e,"allowSampleDuplicates")?e.allowSampleDuplicates:void 0;t&&!isNaN(t)&&this.samplesGenerator.setSampleCount(parseInt(t,10)),n&&this.samplesGenerator.setAllowDuplicates(n)}recalculateAllRowsHeight(){Object(i["isVisible"])(this.hot.view._wt.wtTable.TABLE)&&(this.clearCache(),this.calculateAllRowsHeight())}getSyncCalculationLimit(){const e=this.hot.getSettings()[or];let t=cr.SYNC_CALCULATION_LIMIT;const n=this.hot.countRows()-1;return Object(s["isObject"])(e)&&(t=e.syncLimit,Object(p["isPercentValue"])(t)?t=Object(rt["valueAccordingPercent"])(n,t):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;r<t;r++)n[r]=arguments[r];return Xr(ti,e,si).call(e,...n)})),this.addHook("afterGetColHeader",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Xr(ti,e,ri).call(e,...n)})),this.addHook("beforeOnCellMouseDown",(e,t,n)=>Xr(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<e.length;t+=1)this.sortingStates.setValueAtIndex(this.hot.toPhysicalColumn(e[t].column),{sortOrder:e[t].sortOrder})}destroy(){this.hot.columnIndexMapper.unregisterMap(this.mapName),this.sortingStates=null}}const wi="asc",bi="desc",vi="colHeader";function Ei(e){if(!1===Object(s["isObject"])(e))return!1;const{column:t,sortOrder:n}=e;return Number.isInteger(t)&&[wi,bi].includes(n)}function Ci(e){if(e.some(e=>!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;o<r;o++)i[o-2]=arguments[o];e.sort(n(...i))}function Fi(e,t,n){const r=t.locale;return function(t,i){const{sortEmptyCells:o}=n;return"string"===typeof t&&(t=t.toLocaleLowerCase(r)),"string"===typeof i&&(i=i.toLocaleLowerCase(r)),t===i?ki:Object(d["isEmpty"])(t)?Object(d["isEmpty"])(i)?ki:o&&"asc"===e?ji:Hi:Object(d["isEmpty"])(i)?o&&"asc"===e?Hi:ji:isNaN(t)&&!isNaN(i)?"asc"===e?Hi:ji:!isNaN(t)&&isNaN(i)?"asc"===e?ji:Hi:(isNaN(t)||isNaN(i)||(t=parseFloat(t),i=parseFloat(i)),t<i?"asc"===e?ji:Hi:t>i?"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:i<o?"asc"===e?ji:Hi:i>o?"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;r<t;r++)n[r]=arguments[r];return so(po,e,wo).call(e,...n)})),this.addHook("afterOnCellMouseDown",(e,t)=>this.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<t;r++)n[r]=arguments[r];return so(po,e,yo).call(e,...n)})),this.hot.view&&so(po,this,go).call(this),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){const e=(e,t)=>{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&&e<n)return{column:e,sortOrder:Si()}}getNextSortConfig(e){let t=arguments.length>1&&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;l<this.getNumberOfRowsToSort(n);l+=1)t.push([this.hot.toPhysicalRow(l)].concat(r(l)));const i=Object(u["arrayMap"])(t,e=>e[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;l<n;l+=1)t.push([l].concat(r(l)));const o=Object(u["arrayMap"])(t,e=>e[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<t;r++)n[r-1]=arguments[r];Object(i["addClass"])(e,Li(...n))}}onUpdateSettings(e){super.onUpdateSettings(),null!==this.columnMetaCache&&this.columnMetaCache.init(this.hot.columnIndexMapper.getNumberOfIndexes()),Object(d["isDefined"])(e[this.pluginKey])&&this.sortBySettings(e[this.pluginKey])}wasClickableHeaderClicked(e,t){const n=this.getFirstCellSettings(t)[this.pluginKey],r=n.headerAction;return r&&Object(i["hasClass"])(e.target,vi)}onAfterOnCellMouseDown(e,t){!1!==Oi(t.row,t.col,e)&&this.wasClickableHeaderClicked(e,t.col)&&(this.hot.getShortcutManager().isCtrlPressed()&&(this.hot.deselectCell(),this.hot.selectColumns(t.col)),this.sort(this.getColumnNextConfig(t.col)))}destroy(){var e;null===(e=this.columnStatesManager)||void 0===e||e.destroy(),super.destroy()}}function go(){const e=this.getAllSavedSortSettings();if(Object(s["isObject"])(e))this.sortBySettings(e);else{const e=this.hot.getSettings()[this.pluginKey];this.sortBySettings(e)}}function mo(e,t){const n=Ri(t);if(!1===Ti(e,t)||null===n)return;const r=this.getFirstCellSettings(e)[this.pluginKey],o=r.indicator,s=r.headerAction;if(this.updateHeaderClasses(n,this.columnStatesManager,e,o,s),this.hot.getSettings().ariaTags){const n=this.columnStatesManager.getSortOrderOfColumn(e);Object(i["setAttribute"])(t,...Object(y["J"])(n?n+"ending":"none"))}}function yo(e){!0===e&&this.hot.view&&so(po,this,go).call(this)}function wo(e,t,n,r){!1!==Oi(t.row,t.col,e)&&this.wasClickableHeaderClicked(e,t.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(r.column=!0)}function bo(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=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 Co{constructor(e,t){bo(this,"plugin",void 0),bo(this,"hot",void 0),bo(this,"endpoints",[]),bo(this,"settings",void 0),bo(this,"settingsType","array"),bo(this,"currentEndpoint",null),bo(this,"cellsToSetCache",[]),this.plugin=e,this.hot=this.plugin.hot,this.settings=t}initEndpoints(){this.endpoints=this.parseSettings(),this.refreshAllEndpoints()}getEndpoint(e){return"function"===this.settingsType?this.fillMissingEndpointData(this.settings)[e]:this.endpoints[e]}getAllEndpoints(){return"function"===this.settingsType?this.fillMissingEndpointData(this.settings):this.endpoints}fillMissingEndpointData(e){return this.parseSettings(e.call(this))}parseSettings(e){const t=[];let n=e;if(n||"function"!==typeof this.settings)return n||(n=this.settings),Object(u["arrayEach"])(n,e=>{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]&&(e[0]-=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;r<t;r++)n[r]=arguments[r];return xo(Po,e,jo).call(e,...n)})),this.addHook("afterChange",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return xo(Po,e,Ho).call(e,...n)})),this.addHook("beforeCreateRow",(e,t,n)=>this.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;r<t;r++)n[r]=arguments[r];return e.endpoints.resetSetupBeforeStructureAlteration("remove_row",...n)})),this.addHook("beforeRemoveCol",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.endpoints.resetSetupBeforeStructureAlteration("remove_col",...n)})),this.addHook("afterCreateRow",(e,t,n)=>this.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;r++)n[r]=arguments[r];return e.endpoints.resetSetupAfterStructureAlteration("remove_row",...n)})),this.addHook("afterRemoveCol",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.endpoints.resetSetupAfterStructureAlteration("remove_col",...n)})),this.addHook("afterRowMove",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return xo(Po,e,Do).call(e,...n)})),super.enablePlugin())}disablePlugin(){this.endpoints=null,this.settings=null,this.currentEndpoint=null,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.endpoints.initEndpoints(),super.updatePlugin()}calculate(e){switch(e.type.toLowerCase()){case"sum":e.result=this.calculateSum(e);break;case"min":e.result=this.calculateMinMax(e,e.type);break;case"max":e.result=this.calculateMinMax(e,e.type);break;case"count":e.result=this.countEntries(e);break;case"average":e.result=this.calculateAverage(e);break;case"custom":e.result=e.customFunction.call(this,e);break;default:break}}calculateSum(e){let t=0;return Object(s["objectEach"])(e.ranges,n=>{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`<span class="selected">${String.fromCharCode(10003)}</span>${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;r<t;r++)n[r-1]=arguments[r];const i=e.split(":"),o=i[0],a=2===i.length?i[1]:null;let l=this.commands[o];if(!l)throw new Error(`Menu command '${o}' not exists.`);if(a&&l.submenu&&(l=Qs(a,l.submenu.items)),!0===l.disabled)return;if("function"===typeof l.disabled&&!0===l.disabled.call(this.hot))return;if(Object(s["hasOwnProperty"])(l,"submenu"))return;const c=[];"function"===typeof l.callback&&c.push(l.callback),"function"===typeof this.commonCallback&&c.push(this.commonCallback),n.unshift(i.join(":")),Object(u["arrayEach"])(c,e=>e.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&&e<f()&&!1!==r(e,!0)&&(s=e)}function c(){return s}function h(){f()>0&&(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.length;){if(n[r].name!==t)break;n.shift()}return n}function il(e,t){let n=e.slice(0);return n.reverse(),n=rl(n,t),n.reverse(),n}function ol(e){const t=[];return Object(u["arrayEach"])(e,(e,n)=>{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;r<e;r++)t[r]=arguments[r];return n.parentMenu.runLocalHooks("afterSelectionChange",...t)}))}registerEvents(){let e=this.hot.rootWindow;while(e)this.eventManager.addEventListener(e.document,"mousedown",e=>this.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<t?t:e},autoRowSize:!1,readOnly:!0,editor:!1,copyPaste:!1,hiddenRows:!0,maxCols:1,columns:[{data:"name",renderer:dl(this.hot)}],renderAllRows:!0,fragmentSelection:!1,outsideClickDeselects:!1,disableVisualSelection:"area",layoutDirection:this.hot.isRtl()?"rtl":"ltr",ariaTags:!1,beforeOnCellMouseOver:(e,t)=>{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;r<t;r++)n[r]=arguments[r];return e.executeCommand.call(e,...n)})),this.addHook("afterOnCellContextMenu",e=>Ml(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;r<t;r++)n[r-1]=arguments[r];this.commandExecutor.execute(e,...n)}prepareMenuItems(){this.itemsFactory=new Ia(this.hot,kl.DEFAULT_ITEMS);const e=this.hot.getSettings()[xl],t={items:this.itemsFactory.getItems(e)};this.hot.runHooks("afterContextMenuDefaultOptions",t),this.itemsFactory.setPredefinedItems(t.items);const n=this.itemsFactory.getItems(e);this.hot.runHooks("beforeContextMenuSetItems",n),this.menu.setMenuItems(n),Object(u["arrayEach"])(n,e=>this.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=['<meta name="generator" content="Handsontable"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].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;r<t;r++)n[r]=arguments[r];return vc(Lc,e,Uc).call(e,...n)})),this.addHook("afterSelectionEnd",()=>vc(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;r<t;r++)n[r]=arguments[r];return vc(Lc,e,Bc).call(e,...n)})),this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseleave",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return vc(Lc,e,Wc).call(e,...n)})),this.addHook("afterSelection",()=>vc(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<n||c<=a){const{skipRowOnPaste:t,visualRow:a}=this.hot.getCellMeta(c,s);if(c=a+1,!0===t)continue;u=a,h=s;const p=[],f=i.length%n;while(p.length<r||h<=l){const{skipColumnOnPaste:t,visualCol:n}=this.hot.getCellMeta(o,h);if(h=n+1,!0===t)continue;d=n;const i=p.length%r;p.push(e[f][i])}i.push(p)}return bc(_c,this,!0),this.hot.populateFromArray(o,s,i,void 0,void 0,"CopyPaste.paste",this.pasteMode),[o,s,u,d]}onCopy(e){if(!this.hot.isListening()&&!wc(Ic,this)||this.isEditorOpened())return;this.setCopyableText(),bc(Ic,this,!1);const t=this.getRangedData(this.copyableRanges),n=vc(Lc,this,jc).call(this,this.copyableRanges),r=!!this.hot.runHooks("beforeCopy",t,this.copyableRanges,n);if(r){const r=Object(Ul["b"])(t);if(e&&e.clipboardData){const n=Object(uc["_dataToHTML"])(t,this.hot.rootDocument);e.clipboardData.setData("text/plain",r),e.clipboardData.setData("text/html",[Rc,n].join(""))}else"undefined"===typeof ClipboardEvent&&this.hot.rootWindow.clipboardData.setData("Text",r);this.hot.runHooks("afterCopy",t,this.copyableRanges,n)}bc(Ac,this,"cells-only"),e.preventDefault()}onCut(e){if(!this.hot.isListening()&&!wc(Mc,this)||this.isEditorOpened())return;this.setCopyableText(),bc(Mc,this,!1);const t=this.getRangedData(this.copyableRanges),n=!!this.hot.runHooks("beforeCut",t,this.copyableRanges);if(n){const n=Object(Ul["b"])(t);if(e&&e.clipboardData){const r=Object(uc["_dataToHTML"])(t,this.hot.rootDocument);e.clipboardData.setData("text/plain",n),e.clipboardData.setData("text/html",[Rc,r].join(""))}else"undefined"===typeof ClipboardEvent&&this.hot.rootWindow.clipboardData.setData("Text",n);this.hot.emptySelectedCells("CopyPaste.cut"),this.hot.runHooks("afterCut",t,this.copyableRanges)}e.preventDefault()}onPaste(e){if(!this.hot.isListening()||this.isEditorOpened()||!this.hot.getSelected())return;let t;if(e&&e.preventDefault&&e.preventDefault(),e&&"undefined"!==typeof e.clipboardData){const n=Object(p["sanitize"])(e.clipboardData.getData("text/html"),{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0});if(n&&/(<table)|(<TABLE)/g.test(n)){const e=Object(uc["htmlToGridSettings"])(n,this.hot.rootDocument);t=e.data}else t=e.clipboardData.getData("text/plain")}else"undefined"===typeof ClipboardEvent&&"undefined"!==typeof this.hot.rootWindow.clipboardData&&(t=this.hot.rootWindow.clipboardData.getData("Text"));if("string"===typeof t&&(t=Object(Ul["a"])(t)),void 0===t||t&&0===t.length)return;if(!1===this.hot.runHooks("beforePaste",t,this.copyableRanges))return;const[n,r,i,o]=this.populateValues(t);this.hot.selectCell(n,r,Math.min(this.hot.countRows()-1,i),Math.min(this.hot.countCols()-1,o)),this.hot.runHooks("afterPaste",t,this.copyableRanges)}destroy(){super.destroy()}}function kc(e){if(Object(g["isSafari"])()){const t=this.hot.getSelectedRangeLast();if(t){const{row:n,col:r}=t.highlight,o=this.hot.getCell(n,r,!0);o&&Object(i["runWithSelectedContendEditableElement"])(o,()=>{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<t.length;r++){if(t[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`<span class="selected">${String.fromCharCode(10003)}</span>${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;t<this.boundaries.top?r=t-this.boundaries.top:t>this.boundaries.bottom&&(r=t-this.boundaries.bottom),e<this.boundaries.left?n=e-this.boundaries.left:e>this.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<t;r++)n[r]=arguments[r];return Vh(Xh,e,ru).call(e,...n)})),this.addHook("beforeViewportScrollHorizontally",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Vh(Xh,e,nu).call(e,...n)}));const t=this.hot.getSettings()[Bh],n={items:this.itemsFactory.getItems(t)};this.registerEvents(),"function"===typeof t.callback&&this.commandExecutor.setCommonCallback(t.callback),this.registerShortcuts(),super.enablePlugin(),this.callOnPluginsReady(()=>{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;r<t;r++)n[r]=arguments[r];return e.executeCommand.call(e,...n)})),Object(u["arrayEach"])(r,e=>this.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;r<t;r++)n[r-1]=arguments[r];this.commandExecutor.execute(e,...n)}setListening(){let e=!(arguments.length>0&&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<r}_u(Xu,Ku,{name:De["FILTERS_CONDITIONS_LESS_THAN"],inputsCount:1,showOperators:!0});const $u="lte";function qu(e,t){let[n]=t,r=n;return"numeric"===e.meta.type&&(r=parseFloat(r,10)),e.value<=r}_u($u,qu,{name:De["FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL"],inputsCount:1,showOperators:!0});const Qu="date_after";function Zu(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(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<e)throw Error(Ro["a"]`Radio button with index ${e} doesn't exist.`);Object(u["arrayEach"])(this.elements,(t,n)=>{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<n;i++)r[i]=arguments[i];return Object(u["arrayEach"])(r,n=>{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<i;s++)o[s-1]=arguments[s];const a=this.getIndexesOfComponents(...o);e?r.showRows(a):r.hideRows(a),n.render()}hideComponents(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.changeComponentsVisibility(!1,...t)}showComponents(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.changeComponentsVisibility(!0,...t)}destroy(){this.enabled&&(this.components.forEach((e,t)=>{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.from<e.to;e.from>t.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<i;e+=1)t.push(e);Tm(Mm,this).getEngine()[e](Tm(Mm,this).getSheetId(),t)}Om(xm,this,n)}}init(){Om(xm,this,Tm(Im,this).getIndexesSequence())}}var jm=km;function Hm(e,t,n){Dm(e,t),t.set(e,n)}function Dm(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fm(e,t){return e.get(Vm(e,t))}function Um(e,t,n){return e.set(Vm(e,t),n),n}function Vm(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 Bm=new WeakMap,Wm=new WeakMap,Gm=new WeakMap,zm=new WeakMap,Ym=new WeakMap,Xm=new WeakMap,Km=new WeakMap;class $m{constructor(e,t,n){Hm(this,Bm,void 0),Hm(this,Wm,void 0),Hm(this,Gm,void 0),Hm(this,zm,!1),Hm(this,Ym,!1),Hm(this,Xm,null),Hm(this,Km,null),Um(Bm,this,new jm("row",e,this)),Um(Wm,this,new jm("column",t,this)),Um(Gm,this,n)}getForAxis(e){return Fm("row"===e?Bm:Wm,this)}setPerformUndo(e){Um(zm,this,e)}setPerformRedo(e){Um(Ym,this,e)}isPerformingUndoRedo(){return Fm(zm,this)||Fm(Ym,this)}getSheetId(){return Fm(Km,this)}getEngine(){return Fm(Xm,this)}getPostponeAction(){return Fm(Gm,this)}setupSyncEndpoint(e,t){Um(Xm,this,e),Um(Km,this,t),Fm(Bm,this).init(),Fm(Wm,this).init()}}var qm=$m;function Qm(e,t){ny(e,t),t.add(e)}function Zm(e,t,n){return t=Jm(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jm(e){var t=ey(e,"string");return"symbol"==typeof t?t:t+""}function ey(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 ty(e,t,n){ny(e,t),t.set(e,n)}function ny(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ry(e,t,n){return e.set(oy(e,t),n),n}function iy(e,t){return e.get(oy(e,t))}function oy(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 sy="formulas",ay=["maxRows","maxColumns","language"],ly=260;fe["a"].getSingleton().register("afterNamedExpressionAdded"),fe["a"].getSingleton().register("afterNamedExpressionRemoved"),fe["a"].getSingleton().register("afterSheetAdded"),fe["a"].getSingleton().register("afterSheetRemoved"),fe["a"].getSingleton().register("afterSheetRenamed"),fe["a"].getSingleton().register("afterFormulasValuesUpdate");const cy=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<t;r++)n[r]=arguments[r];return oy(py,e,Ly).call(e,...n)}],["namedExpressionAdded",function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return oy(py,e,Py).call(e,...n)}],["namedExpressionRemoved",function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return oy(py,e,ky).call(e,...n)}],["sheetAdded",function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return oy(py,e,jy).call(e,...n)}],["sheetRenamed",function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return oy(py,e,Hy).call(e,...n)}],["sheetRemoved",function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return oy(py,e,Dy).call(e,...n)}]]),Zm(this,"staticRegister",Object(Xi["a"])("formulas")),Zm(this,"engine",null),Zm(this,"sheetName",null),Zm(this,"indexSyncer",null),Zm(this,"rowAxisSyncer",null),Zm(this,"columnAxisSyncer",null)}static get PLUGIN_KEY(){return sy}static get PLUGIN_PRIORITY(){return ly}static get SETTING_KEYS(){return[sy,...ay]}get sheetId(){return null===this.sheetName?null:this.engine.getSheetId(this.sheetName)}isEnabled(){return!!this.hot.getSettings()[sy]}enablePlugin(){var e,t=this;if(!this.enabled)if(this.engine=null!==(e=nm(this.hot))&&void 0!==e?e:this.engine,this.engine){if(null!==this.sheetName&&!this.engine.doesSheetExist(this.sheetName)){const e=this.addSheet(this.sheetName,this.hot.getSourceDataArray());!1!==e&&(this.sheetName=e)}this.addHook("beforeLoadData",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,yy).call(t,...n)})),this.addHook("afterLoadData",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,by).call(t,...n)})),this.addHook("beforeUpdateData",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,yy).call(t,...n)})),this.addHook("afterUpdateData",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,by).call(t,...n)})),this.addHook("modifyData",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,vy).call(t,...n)})),this.addHook("modifySourceData",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,Ey).call(t,...n)})),this.addHook("beforeValidate",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,gy).call(t,...n)})),this.addHook("afterSetSourceDataAtCell",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,Sy).call(t,...n)})),this.addHook("afterSetDataAtCell",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,Cy).call(t,...n)})),this.addHook("afterSetDataAtRowProp",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,Cy).call(t,...n)})),this.addHook("beforeCreateRow",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,Ry).call(t,...n)})),this.addHook("beforeCreateCol",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,Ty).call(t,...n)})),this.addHook("afterCreateRow",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,Ay).call(t,...n)})),this.addHook("afterCreateCol",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,Iy).call(t,...n)})),this.addHook("beforeRemoveRow",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,Oy).call(t,...n)})),this.addHook("beforeRemoveCol",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,Ny).call(t,...n)})),this.addHook("afterRemoveRow",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,My).call(t,...n)})),this.addHook("afterRemoveCol",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,xy).call(t,...n)})),this.indexSyncer=new qm(this.hot.rowIndexMapper,this.hot.columnIndexMapper,e=>{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<e;r++)n[r]=arguments[r];return oy(py,t,wy).call(t,...n)})),this.addHook("beforeUndo",()=>{this.indexSyncer.setPerformUndo(!0),this.engine.undo()}),this.addHook("beforeRedo",()=>{this.indexSyncer.setPerformRedo(!0),this.engine.redo()}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformUndo(!1)}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformRedo(!1)}),this.addHook("afterDetachChild",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,_y).call(t,...n)})),this.addHook("beforeAutofill",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return oy(py,t,my).call(t,...n)})),iy(dy,this).forEach(e=>{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;v<p.length;v+=1)for(let e=0;e<p[v].length;e+=1){const t=p[v][e],n=v%w,r=e%b,i=this.hot.getCellMeta(n,r);fm(t,i.type)&&(t.startsWith("'")?p[v][e]=t.slice(1):!1===this.isFormulaCellType(n,r,this.sheetId)&&(p[v][e]=ym(t,i.dateFormat)))}return p}function yy(e,t){let n=arguments.length>2&&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&&a<i)h.push(...c.slice(0,i));else if(null===a)h.push(...c.slice(0,this.countCols()));else{const e=this.countCols()-1,t=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(e,-1));l===t&&e>o&&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;r<t;r++)n[r]=arguments[r];return Xy(Zy,e,iw).call(e,...n)})),this.addHook("afterGetCellMeta",(e,t,n)=>Xy(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;r<t;r++)n[r]=arguments[r];return Xy(Zy,e,rw).call(e,...n)})),this.addHook("modifyCopyableRange",e=>Xy(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<t.length))}showColumn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.showColumns(t)}hideColumns(e){const t=this.getHiddenColumns(),n=this.isValidConfig(e);let r=t;n&&(r=Array.from(new Set(t.concat(e))));const i=this.hot.runHooks("beforeHideColumns",t,r,n);!1!==i&&(n&&this.hot.batchExecution(()=>{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;n<e;n++)t[n]=arguments[n];this.hideColumns(t)}getHiddenColumns(){return Object(u["arrayMap"])(zy(Qy,this).getHiddenIndexes(),e=>this.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<t)}resetCellsMeta(){Object(u["arrayEach"])(this.hot.getCellsMeta(),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<this.hot.countCols()-1&&this.isHidden(e+1)&&n.push("beforeHiddenColumn"),Object(i["addClass"])(t,n)}function iw(e){e.items.push({name:Zo},Fy(this),Uy(this))}function ow(){Array.isArray(zy(qy,this).columns)&&this.hideColumns(zy(qy,this).columns)}function sw(e){return{key:"hidden_rows_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_ROW"],t)},callback(){const{from:t,to:n}=this.getSelectedRangeLast(),r=Math.max(Math.min(t.row,n.row),0),i=Math.max(t.row,n.row),o=[];for(let e=r;e<=i;e+=1)o.push(e);e.hideRows(o);const s=o[o.length-1],a=this.rowIndexMapper.getNearestNotHiddenIndex(s,1,!0);Number.isInteger(a)&&a>=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&&a<i)h.push(...c.slice(0,i));else if(null===a)h.push(...c.slice(0,this.countRows()));else{const e=this.countRows()-1,t=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(e,-1));l===t&&e>o&&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;r<t;r++)n[r]=arguments[r];return pw(ww,e,Rw).call(e,...n)})),this.addHook("afterGetCellMeta",(e,t,n)=>pw(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;r<t;r++)n[r]=arguments[r];return pw(ww,e,Sw).call(e,...n)})),this.addHook("modifyCopyableRange",e=>pw(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<t.length))}showRow(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.showRows(t)}hideRows(e){const t=this.getHiddenRows(),n=this.isValidConfig(e);let r=t;n&&(r=Array.from(new Set(t.concat(e))));const i=this.hot.runHooks("beforeHideRows",t,r,n);!1!==i&&(n&&this.hot.batchExecution(()=>{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;n<e;n++)t[n]=arguments[n];this.hideRows(t)}getHiddenRows(){return Object(u["arrayMap"])(uw(yw,this).getHiddenIndexes(),e=>this.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<t)}resetCellsMeta(){Object(u["arrayEach"])(this.hot.getCellsMeta(),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"),e<this.hot.countRows()-1&&this.isHidden(e+1)&&n.push("beforeHiddenRow"),Object(i["addClass"])(t,n)}function Rw(e){e.items.push({name:Zo},sw(this),aw(this))}function Tw(){Array.isArray(uw(mw,this).rows)&&this.hideRows(uw(mw,this).rows)}function Ow(e){return{key:"freeze_column",name(){return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_FREEZE_COLUMN"])},callback(t,n){const[{start:{col:r}}]=n;e.freezeColumn(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-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.fixedColumnsStart<this.hot.countCols()&&e>t.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(t<n)return!1;if(e.some(e=>e<n))return!1}}function Vw(e,t,n){return t=Bw(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bw(e){var t=Ww(e,"string");return"symbol"==typeof t?t:t+""}function Ww(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 Gw=0,zw=1,Yw=2,Xw="px";class Kw{constructor(e){Vw(this,"hot",void 0),Vw(this,"_element",null),Vw(this,"state",Gw),Vw(this,"inlineProperty",void 0),this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}appendTo(e){e.appendChild(this._element),this.state=Yw}build(){this.state===Gw&&(this._element=this.hot.rootDocument.createElement("div"),this.state=zw)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=Gw}isAppended(){return this.state===Yw}isBuilt(){return this.state>=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;r<t;r++)n[r]=arguments[r];return ab(Tb,e,Nb).call(e,...n)})),this.addHook("beforeOnCellMouseOver",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ab(Tb,e,Ib).call(e,...n)})),this.addHook("afterScrollVertically",()=>ab(Tb,this,xb).call(this)),this.addHook("afterLoadData",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ab(Tb,e,_b).call(e,...n)})),this.buildPluginUI(),this.registerEvents(),Object(i["addClass"])(this.hot.rootElement,hb),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){Object(i["removeClass"])(this.hot.rootElement,hb),this.unregisterEvents(),sb(fb,this).destroy(),sb(gb,this).destroy(),super.disablePlugin()}moveColumn(e,t){return this.moveColumns([e],t)}moveColumns(e,t){const n=sb(vb,this),r=this.isMovePossible(e,t),i=this.hot.runHooks("beforeColumnMove",e,t,n,r);if(ob(vb,this,void 0),!1===i)return;r&&this.hot.columnIndexMapper.moveIndexes(e,t);const o=r&&this.isColumnOrderChanged(e,t);return this.hot.runHooks("afterColumnMove",e,t,n,r,o),o}dragColumn(e,t){return this.dragColumns([e],t)}dragColumns(e,t){const n=this.countFinalIndex(e,t);return ob(vb,this,t),this.moveColumns(e,n)}isMovePossible(e,t){const n=this.hot.columnIndexMapper.getNotTrimmedIndexesLength(),r=e.length+t>n,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<t&&(e+=1),e),0);return t-n}getColumnsWidth(e,t){const n=this.hot.columnIndexMapper;let r=0;for(let i=e;i<=t;i+=1){const e=n.getRenderableFromVisualIndex(i);i<0?r+=this.hot.view._wt.wtViewport.getRowHeaderWidth()||0:null!==e&&(r+=this.hot.view._wt.wtTable.getStretchedColumnWidth(e)||0)}return r}moveBySettingsOrLoad(){const e=this.hot.getSettings()[lb];if(Array.isArray(e))this.moveColumns(e,0);else if(void 0!==e){const e=this.persistentStateLoad();e.length&&this.moveColumns(e,0)}}isFixedColumnsStart(e){return e<this.hot.getSettings().fixedColumnsStart}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualColumnMove",this.hot.columnIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualColumnMove",e),e.value?e.value:[]}prepareColumnsToMoving(e,t){const n=[];return Object(rt["rangeEach"])(e,t,e=>{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<a+h&&(d=a+h+Math.abs(l)),o>=s-1?p=s-1:0===p?p=1:void 0!==n.scrollX&&sb(Eb,this)<sb(Rb,this)&&(p-=sb(Cb,this)<=n.scrollX?sb(Cb,this):0),sb(fb,this).setPosition(null,d),sb(gb,this).setPosition(null,p)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",e=>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<sb(Rb,this),u=this.hot.view._wt.wtOverlays.inlineStartOverlay.getOverlayOffset(),d=Math.abs(a-(this.hot.isRtl()?n.offsetWidth:0)),p=this.getColumnsWidth(f,t.col-1)+d,m=this.getColumnsWidth(l,f-1)+(h?u:0)+p;sb(fb,this).setPosition(c,m),sb(fb,this).setSize(this.getColumnsWidth(f,g),s.hider.offsetHeight-c),sb(fb,this).setOffset(null,-p),Object(i["addClass"])(this.hot.rootElement,db)}else Object(i["removeClass"])(this.hot.rootElement,pb),ob(wb,this,!1),sb(mb,this).length=0}function Ab(e){sb(wb,this)&&(sb(bb,this).eventPageX=e.pageX,this.refreshPositions())}function Ib(e,t,n,r){const o=this.hot.getSelectedRangeLast();o&&sb(wb,this)&&(sb(mb,this).indexOf(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<t.getSetting("fixedColumnsStart");let l;a&&(l=t.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(Hb(Bb,this),n.row,n.col)),l||(l=t.wtOverlays.topOverlay.getRelativeCellPosition(Hb(Bb,this),n.row,n.col)),jb(Wb,this,this.hot.columnIndexMapper.getVisualFromRenderableIndex(r)),jb(Gb,this,[]);const c=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByColumnHeader();if(this.hot.selection.isSelected()&&c){const e=this.hot.getSelectedRange();Object(u["arrayEach"])(e,e=>{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;r<t;r++)n[r]=arguments[r];return kv(Kv,e,qv).call(e,...n)})),this.addHook("beforeOnCellMouseOver",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return kv(Kv,e,Zv).call(e,...n)})),this.addHook("afterScrollHorizontally",()=>kv(Kv,this,eE).call(this)),this.addHook("afterLoadData",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return kv(Kv,e,tE).call(e,...n)})),this.buildPluginUI(),this.registerEvents(),Object(i["addClass"])(this.hot.rootElement,Dv),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){Object(i["removeClass"])(this.hot.rootElement,Dv),this.unregisterEvents(),Pv(Bv,this).destroy(),Pv(Wv,this).destroy(),super.disablePlugin()}moveRow(e,t){return this.moveRows([e],t)}moveRows(e,t){const n=Pv(Xv,this),r=this.isMovePossible(e,t),i=this.hot.runHooks("beforeRowMove",e,t,n,r);if(Lv(Xv,this,void 0),!1===i)return;r&&this.hot.rowIndexMapper.moveIndexes(e,t);const o=r&&this.isRowOrderChanged(e,t);return this.hot.runHooks("afterRowMove",e,t,n,r,o),o}dragRow(e,t){return this.dragRows([e],t)}dragRows(e,t){const n=this.countFinalIndex(e,t);return Lv(Xv,this,t),this.moveRows(e,n)}isMovePossible(e,t){const n=this.hot.rowIndexMapper.getNotTrimmedIndexesLength(),r=e.length+t>n,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)=>(n<t&&(e+=1),e),0);return t-n}getRowsHeight(e,t){const n=this.hot.rowIndexMapper;let r=0;for(let i=e;i<=t;i++){const e=n.getRenderableFromVisualIndex(i);null!==e&&(r+=this.hot.view._wt.wtTable.getRowHeight(e)||23)}return r}moveBySettingsOrLoad(){const e=this.hot.getSettings()[jv];if(Array.isArray(e))this.moveRows(e,0);else if(void 0!==e){const e=this.persistentStateLoad();e.length&&this.moveRows(e,0)}}isFixedRowTop(e){return e<this.hot.getSettings().fixedRowsTop}isFixedRowBottom(e){return e>this.hot.countRows()-1-this.hot.getSettings().fixedRowsBottom}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualRowMove",this.hot.rowIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualRowMove",e),e.value?e.value:[]}prepareRowsToMoving(){const e=this.hot.getSelectedRangeLast(),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<r&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(n+1,1),void 0,!0);const o=this.hot.view._wt.wtTable,s=Pv(Yv,this).TD,a=this.hot.rootElement,l=Object(i["offset"])(a),c=Object(i["getTrimmingContainer"])(a),h=o.holder.scrollTop,u=this.hot.rootWindow!==c?c.scrollTop:0,d=l.top-u,p=Pv(Yv,this).eventPageY-d+h,f=o.hider.offsetHeight,g=o.TBODY.offsetTop,m=Pv(Bv,this).getOffset().top,y=Pv(Bv,this).getSize().height,w=s.offsetHeight/2,b=s.offsetHeight;let v=this.hot.view.THEAD.offsetHeight+this.getRowsHeight(0,e.row-1);const E=p>=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<g&&(C=g+Math.abs(m)),v>=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<n.getSetting("fixedRowsTop"),c=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)<t?t:aE(mE,this)}afterMouseDownTimeout(){const e=()=>{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&&c<a){const e=c-s+1;this[i]-=e}}return!0}isFarther(e,t){return!e||("down"===t?e.row+e.rowspan-1<this.row+this.rowspan-1:"up"===t?e.row>this.row:"right"===t?e.col+e.colspan-1<this.col+this.colspan-1:"left"===t?e.col>this.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<n.length;i++)if(n[i]<=t){r=n[i];break}return r}getEndMostColumnIndex(e,t){const n=KE($E,this,QE).call(this,e,"col",1);let r=t;for(let i=0;i<n.length;i++)if(n[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<n.length;i++)if(n[i]<=t){r=n[i];break}return r}getBottomMostRowIndex(e,t){const n=KE($E,this,QE).call(this,e,"row",1);let r=t;for(let i=0;i<n.length;i++)if(n[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;e<n.length;e+=1){if(s=n[e],o=a*this.currentFillData.cycleLength,i(s,o))switch(r){case"up":this.plugin.mergedCellsCollection.add({row:s.row-o,rowspan:s.rowspan,col:s.col,colspan:s.colspan});break;case"down":this.plugin.mergedCellsCollection.add({row:s.row+o,rowspan:s.rowspan,col:s.col,colspan:s.colspan});break;case"left":this.plugin.mergedCellsCollection.add({row:s.row,rowspan:s.rowspan,col:s.col-o,colspan:s.colspan});break;case"right":this.plugin.mergedCellsCollection.add({row:s.row,rowspan:s.rowspan,col:s.col+o,colspan:s.colspan});break;default:}e===n.length-1&&(a+=1)}}while(i(s,o));this.currentFillData=null,this.plugin.hot.render(),n.length>0&&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||r<t.min)&&(t.min=r),(null===t.max||r>t.max)&&(t.max=r),(null===n.min||i<n.min)&&(n.min=i),(null===n.max||i>n.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<e.rowspan;r+=1)for(let t=0;t<e.colspan;t+=1)n.push(this.hot._createCellCoords(e.row+r,e.col+t));for(let r=0;r<n.length;r+=1){const e=[];for(let i=0;i<t.length;i+=1)e[i]=t[i].includes(n[r]);if(!e.includes(!0))return!1}return!0}getSelectedMergedCellClassNameToRemove(){const e=[];for(let t=0;t<=7;t+=1)e.push(`${this.fullySelectedMergedCellClassName}-${t}`);return e.push(this.fullySelectedMergedCellClassName+"-multiple"),e}}var lC=aC;function cC(e){return{key:"mergeCells",name(){const t=this.getSelectedLast();if(t){const n=e.mergedCellsCollection.get(t[0],t[1]);if(n.row===t[0]&&n.col===t[1]&&n.row+n.rowspan-1===t[2]&&n.col+n.colspan-1===t[3])return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_UNMERGE_CELLS"])}return this.getTranslatedPhrase(De["CONTEXTMENU_ITEMS_MERGE_CELLS"])},callback(){const t=this.getSelectedRangeLast();if(!t)return;t.setDirection(this.isRtl()?"NE-SW":"NW-SE");const{from:n,to:r}=t;e.toggleMerge(t),this.selectCell(n.row,n.col,r.row,r.col,!1)},disabled(){const e=this.getSelectedLast();if(!e)return!0;const t=VE.isSingleCell({row:e[0],col:e[1],rowspan:e[2]-e[0]+1,colspan:e[3]-e[1]+1});return t||this.selection.isSelectedByCorner()},hidden:!1}}function hC(e,t,n){return t=uC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uC(e){var t=dC(e,"string");return"symbol"==typeof t?t:t+""}function dC(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 pC{constructor(e){hC(this,"data",void 0),hC(this,"next",null),hC(this,"prev",null),this.data=e}}class fC{constructor(){hC(this,"first",null),hC(this,"last",null)}push(e){const t=new pC(e);if(null===this.first)this.first=t,this.last=t;else{const e=this.last;this.last=t,t.prev=e,e.next=t}return t}unshift(e){const t=new pC(e);if(null===this.first)this.first=t,this.last=t;else{const e=this.first;this.first=t,t.next=e,e.prev=t}}inorder(e){let t=this.first;while(t){const n=e(t);if(t===this.last||!0===n)break;t=t.next}}remove(e){if(null===this.first)return!1;let t,n,r=this.first;while(r){if(r.data===e)return t=r.next,n=r.prev,t&&(t.prev=n),n&&(n.next=t),r===this.first&&(this.first=t),r===this.last&&(this.last=n),!0;r=r.next}return!1}hasCycle(){let e=this.first,t=this.first;while(1){if(null===e)return!1;if(e=e.next,null===e)return!1;if(e=e.next,t=t.next,e===t)return!0}}pop(){if(null===this.last)return null;const e=this.last;return this.last=this.last.prev,e}shift(){if(null===this.first)return null;const e=this.first;return this.first=this.first.next,e}recursiveReverse(){function e(t,n){n&&(e(n,n.next),n.next=t)}if(!this.first)return;e(this.first,this.first.next),this.first.next=null;const t=this.first;this.first=this.last,this.last=t}reverse(){if(!this.first||!this.first.next)return;let e,t=this.first.next,n=this.first;while(t)e=t.next,t.next=n,n.prev=t,n=t,t=e;this.first.next=null,this.last.prev=null,e=this.first,this.first=n,this.last=e}}var gC=fC;function mC(e,t){wC(e,t),t.add(e)}function yC(e,t,n){wC(e,t),t.set(e,n)}function wC(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bC(e,t){return e.get(EC(e,t))}function vC(e,t,n){return e.set(EC(e,t),n),n}function EC(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 CC=new WeakMap,SC=new WeakMap,RC=new WeakMap,TC=new WeakMap,OC=new WeakMap,NC=new WeakMap,AC=new WeakMap,IC=new WeakSet;class MC{constructor(e){let{mergedCellsGetter:t,rowIndexMapper:n,columnIndexMapper:r}=e;mC(this,IC),yC(this,CC,new gC),yC(this,SC,new gC),yC(this,RC,null),yC(this,TC,null),yC(this,OC,null),yC(this,NC,null),yC(this,AC,null),vC(OC,this,t),vC(NC,this,n),vC(AC,this,r)}getCurrentVerticalNode(){return bC(TC,this).data}getFirstVerticalNode(){return bC(SC,this).first.data}getNextVerticalNode(){return bC(TC,this).next.data}getPrevVerticalNode(){return bC(TC,this).prev.data}getCurrentHorizontalNode(){return bC(RC,this).data}getFirstHorizontalNode(){return bC(CC,this).first.data}getNextHorizontalNode(){return bC(RC,this).next.data}getPrevHorizontalNode(){return bC(RC,this).prev.data}setPrevNodeAsActive(){vC(TC,this,bC(TC,this).prev),vC(RC,this,bC(RC,this).prev)}setNextNodeAsActive(){vC(TC,this,bC(TC,this).next),vC(RC,this,bC(RC,this).next)}buildFocusOrder(e){const t=e.getTopStartCorner(),n=e.getBottomEndCorner(),r=new WeakSet;vC(CC,this,new gC);for(let o=t.row;o<=n.row;o++)if(!bC(NC,this).isHidden(o))for(let i=t.col;i<=n.col;i++){if(bC(AC,this).isHidden(i))continue;const t=EC(IC,this,xC).call(this,e,bC(CC,this),r,o,i);t&&vC(RC,this,t)}bC(CC,this).first&&(bC(CC,this).first.prev=bC(CC,this).last,bC(CC,this).last.next=bC(CC,this).first);const i=new WeakSet;vC(SC,this,new gC);for(let o=t.col;o<=n.col;o++)if(!bC(AC,this).isHidden(o))for(let r=t.row;r<=n.row;r++){if(bC(NC,this).isHidden(r))continue;const t=EC(IC,this,xC).call(this,e,bC(SC,this),i,r,o);t&&vC(TC,this,t)}bC(SC,this).first&&(bC(SC,this).first.prev=bC(SC,this).last,bC(SC,this).last.next=bC(SC,this).first)}setActiveNode(e,t){return bC(CC,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(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.row<o.row||l.row+l.rowspan-1>s.row||l.col<o.col||l.col+l.colspan-1>s.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<t;r++)n[r]=arguments[r];return UC(XC,e,$C).call(e,...n)})),this.addHook("modifyTransformFocus",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,QC).call(e,...n)})),this.addHook("modifyTransformStart",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,ZC).call(e,...n)})),this.addHook("modifyTransformEnd",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,JC).call(e,...n)})),this.addHook("beforeSelectionHighlightSet",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,eS).call(e,...n)})),this.addHook("beforeSetRangeStart",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,iS).call(e,...n)})),this.addHook("beforeSetRangeStartOnly",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,iS).call(e,...n)})),this.addHook("beforeSelectionFocusSet",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,oS).call(e,...n)})),this.addHook("afterSelectionFocusSet",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,sS).call(e,...n)})),this.addHook("afterSelectionEnd",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,aS).call(e,...n)})),this.addHook("modifyGetCellCoords",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,tS).call(e,...n)})),this.addHook("afterIsMultipleSelection",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,qC).call(e,...n)})),this.addHook("afterRenderer",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,rS).call(e,...n)})),this.addHook("afterContextMenuDefaultOptions",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,nS).call(e,...n)})),this.addHook("afterGetCellMeta",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,lS).call(e,...n)})),this.addHook("afterViewportRowCalculatorOverride",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,cS).call(e,...n)})),this.addHook("afterViewportColumnCalculatorOverride",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,hS).call(e,...n)})),this.addHook("modifyAutofillRange",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,uS).call(e,...n)})),this.addHook("afterCreateCol",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,dS).call(e,...n)})),this.addHook("afterRemoveCol",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,pS).call(e,...n)})),this.addHook("afterCreateRow",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,fS).call(e,...n)})),this.addHook("afterRemoveRow",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,gS).call(e,...n)})),this.addHook("afterChange",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,mS).call(e,...n)})),this.addHook("beforeDrawBorders",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,yS).call(e,...n)})),this.addHook("afterDrawSelection",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,wS).call(e,...n)})),this.addHook("beforeRemoveCellClassNames",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,bS).call(e,...n)})),this.addHook("beforeBeginEditing",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return UC(XC,e,vS).call(e,...n)})),this.addHook("beforeUndoStackChange",(e,t)=>{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<n+r;i++)t.push(i)}),t=[...new Set(t)],t.forEach(t=>{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;i<t;i+=1){const o=this.mergedCellsCollection.get(r,i);if(Object(s["isObject"])(o)){const r=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(o.row,1));if(r<e.startRow)return e.startRow=r,void this.modifyViewportRowStart(e,t)}}}modifyViewportRowEnd(e,t){const n=this.hot.rowIndexMapper,r=n.getVisualFromRenderableIndex(e.endRow);for(let i=0;i<t;i+=1){const o=this.mergedCellsCollection.get(r,i);if(Object(s["isObject"])(o)){const r=o.row+o.rowspan-1,i=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(r,-1));if(i>e.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;i<t;i+=1){const o=this.mergedCellsCollection.get(i,r);if(Object(s["isObject"])(o)){const r=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(o.col,1));if(r<e.startColumn)return e.startColumn=r,void this.modifyViewportColumnStart(e,t)}}}modifyViewportColumnEnd(e,t){const n=this.hot.columnIndexMapper,r=n.getVisualFromRenderableIndex(e.endColumn);for(let i=0;i<t;i+=1){const o=this.mergedCellsCollection.get(i,r);if(Object(s["isObject"])(o)){const r=o.col+o.colspan-1,i=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(r,-1));if(i>e.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<e.length;i+=1)if(n.row===e[i].row&&n.col===e[i].col&&r.row===e[i].row+e[i].rowspan-1&&r.col===e[i].col+e[i].colspan-1)return!1}return e}function QC(e){FC(zC,this).row=e.row,FC(zC,this).col=e.col}function ZC(e){const t=this.hot.getSelectedRangeLast(),{highlight:n}=t,{columnIndexMapper:r,rowIndexMapper:i}=this.hot;FC(GC,this)&&(null!==i.getRenderableFromVisualIndex(FC(GC,this).row)&&(n.row=FC(GC,this).row),null!==r.getRenderableFromVisualIndex(FC(GC,this).col)&&(n.col=FC(GC,this).col),DC(GC,this,null));const o=this.mergedCellsCollection.get(n.row,n.col);if(!o)return;const s=o.col,a=o.col+o.colspan-1;if(e.col<0){const t=n.col>=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;r<this.mergedCellsCollection.mergedCells.length;r+=1)n.expandByRange(this.mergedCellsCollection.mergedCells[r].getRange())};if(e.col<0){let o=this.mergedCellsCollection.getStartMostColumnIndex(t,r.col)+e.col;s(r.row,o),"E-W"===t.getHorizontalDirection()&&"E-W"===n.getHorizontalDirection()&&(o=n.getTopStartCorner().col);const a=i.getNearestNotHiddenIndex(o,1);null!==a&&(e.col=-Math.max(this.hot.view.countRenderableColumnsInRange(a,r.col)-1,1))}else if(e.col>0){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;r<this.mergedCellsCollection.mergedCells.length;r+=1)e.expandByRange(this.mergedCellsCollection.mergedCells[r].getRange(),!1);for(let r=0;r<this.mergedCellsCollection.mergedCells.length;r+=1)e.expandByRange(this.mergedCellsCollection.mergedCells[r].getRange(),!1);const n=this.mergedCellsCollection.get(t.row,t.col);DC(GC,this,t.clone()),n&&t.assign(n)}function tS(e,t){if(e<0||t<0)return;const n=this.mergedCellsCollection.get(e,t);if(!n)return;const{row:r,col:i,colspan:o,rowspan:s}=n;return[r,i,r+s-1,i+o-1]}function nS(e){e.items.push({name:"---------"},cC(this))}function rS(e,t,n){const r=this.mergedCellsCollection.get(t,n),i=Object(s["isObject"])(r)?Object(s["clone"])(r):void 0;if(Object(s["isObject"])(i)){const{rowIndexMapper:e,columnIndexMapper:r}=this.hot,{row:o,col:s,colspan:a,rowspan:l}=i,[c,h]=this.translateMergedCellToRenderable(o,l,s,a),u=e.getRenderableFromVisualIndex(t),d=r.getRenderableFromVisualIndex(n),p=c-u+1,f=h-d+1;i.row=e.getNearestNotHiddenIndex(i.row,1),i.col=r.getNearestNotHiddenIndex(i.col,1),i.rowspan=Math.min(i.rowspan,p),i.colspan=Math.min(i.colspan,f)}BE(e,i,t,n)}function iS(){DC(GC,this,null)}function oS(){if(FC(GC,this).isCell())return;const e=this.hot.getSelectedRangeLast(),t=e.getVerticalDirection(),n=e.getHorizontalDirection(),r=FC(GC,this).clone().normalize();FC(YC,this).setActiveNode(r.row,r.col),FC(zC,this).row>0||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<t;r++)n[r-1]=arguments[r];super.updateHeaderClasses(e,...n),Object(i["removeClass"])(e,TS(e)),!1!==this.enabled&&Object(i["addClass"])(e,RS(...n))}onUpdateSettings(e){this.hot.getSettings()[this.pluginKey]&&this.hot.getSettings()[xS]&&CS(),super.onUpdateSettings(e)}onAfterOnCellMouseDown(e,t){!1!==Oi(t.row,t.col,e)&&this.wasClickableHeaderClicked(e,t.col)&&(this.hot.getShortcutManager().isCtrlPressed()?(this.hot.deselectCell(),this.hot.selectColumns(t.col),this.sort(this.getNextSortConfig(t.col,co))):this.sort(this.getColumnNextConfig(t.col)))}}function PS(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=jS(e,"string");return"symbol"==typeof t?t:t+""}function jS(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 HS="multipleSelectionHandles",DS=160;class FS extends en["a"]{constructor(){super(...arguments),PS(this,"dragged",[]),PS(this,"lastSetCell",null)}static get PLUGIN_KEY(){return HS}static get PLUGIN_PRIORITY(){return DS}isEnabled(){return Object(g["isMobileBrowser"])()}enablePlugin(){this.enabled||(this.registerListeners(),super.enablePlugin())}registerListeners(){const e=this,{rootElement:t}=this.hot;function n(t){if(1===e.dragged.length)return e.dragged.splice(0,e.dragged.length),!0;const n=e.dragged.indexOf(t);if(-1===n)return!1;0===n?e.dragged=e.dragged.slice(0,1):1===n&&(e.dragged=e.dragged.slice(-1))}this.eventManager.addEventListener(t,"touchstart",t=>{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;t<n.colspan-1;t++)r.push(BS());return!o})});const r=Math.max(...Object(u["arrayMap"])(n,e=>e.length));return Object(u["arrayEach"])(n,e=>{if(e.length<r){const t=Object(u["arrayMap"])(new Array(r-e.length),()=>VS());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;s<i.length;s++){const e=i[s];if(e.isPlaceholder)throw new Error("The first column settings cannot overlap the other header layers");if(o+=e.colspan,r.push(e),e.colspan>1&&(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;r<this.childs.length;r++){if(!1===n)return!1;n=iR.call(this.childs[r],e,t)}return n}const oR="DF-post-order";function sR(e,t){for(let n=0;n<this.childs.length;n++){const r=sR.call(this.childs[n],e,t);if(!1===r)return!1}return e.call(t,this)}const aR="BF";function lR(e,t){const n=[this];function r(){if(0===n.length)return;const i=n.shift();n.push(...i.childs),!1!==e.call(t,i)&&r()}r()}const cR=aR,hR=new Map([[rR,iR],[oR,sR],[aR,lR]]);class uR{constructor(e){eR(this,"data",{}),eR(this,"parent",null),eR(this,"childs",[]),this.data=e}addChild(e){e.parent=this,this.childs.push(e)}cloneTree(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;const t=new uR({...e.data});for(let n=0;n<e.childs.length;n++)t.addChild(this.cloneTree(e.childs[n]));return t}replaceTreeWith(e){this.data={...e.data},this.childs=[];for(let t=0;t<e.childs.length;t++)this.addChild(e.childs[t])}walkDown(e){let t=arguments.length>1&&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;r<e+n;r++)fR(wR,this).set(r,e);e+=n})}buildTree(){this.clear();const e=fR(bR,this).getColumnsCount();let t=0;while(t<e){const e=fR(bR,this).getHeaderSettings(0,t),n=new uR;fR(yR,this).set(t,n),this.buildLeaves(n,t,0,e.origColspan),t+=e.origColspan}this.rebuildTreeIndex()}buildLeaves(e,t,n){let r=arguments.length>3&&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<fR(bR,this).getLayersCount()&&this.buildLeaves(o,t,n,r.origColspan),t+=r.origColspan})}clear(){fR(yR,this).clear(),fR(wR,this).clear()}}function ER(e,t){e.walkDown(e=>{let{data:n,childs:r}=e;if(!n.isHidden&&(t(n.columnIndex),0===r.length))for(let i=1;i<n.colspan;i++)t(n.columnIndex+i)})}function CR(e,t){let{childs:n}=e;if(0!==n.length)return n[0].data[t]}function SR(e){return CR(e,"origColspan")===e.data.origColspan}function RR(e){const{data:t,childs:n}=e;if(!t.isCollapsed||t.isHidden||t.origColspan<=1)return{rollbackModification:()=>{},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<n;t++)o.add(r+t)}return e.walkUp(e=>{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<e;n++){const e=t+n;s.add(e)}}const a=n.colspan-(null!==(t=CR(e,"colspan"))&&void 0!==t?t:1);return e.walkUp(e=>{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<n.origColspan&&(n.colspan+=1),n.isHidden=!1})}const AR=new Map([["collapse",TR],["expand",RR],["hide-column",OR],["show-column",NR]]);function IR(e,t,n){if(!AR.has(e))throw new Error(`The node modifier action ("${e}") does not exist.`);return AR.get(e)(t,n)}function MR(e){const t=[];return Object(u["arrayEach"])(e,e=>{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<i+r;t++){const e=s.includes(t);if(e||l)a.push(BS(n));else{const e=xR(n);e.isRoot=!0,a.push(e),l=!0}}})}),t}function xR(e){const{crossHiddenColumns:t,...n}=VS(e);return n}function _R(e,t){let n;return Array.isArray(e[t])?n=e[t]:(n=[],e[t]=n),n}function LR(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 kR(e,t,n){return e.set(HR(e,t),n),n}function jR(e,t){return e.get(HR(e,t))}function HR(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 DR=new WeakMap,FR=new WeakMap,UR=new WeakMap;class VR{constructor(){LR(this,DR,new JS),LR(this,FR,new vR(jR(DR,this))),LR(this,UR,[[]])}setState(e){jR(DR,this).setData(e);let t=!1;try{jR(FR,this).buildTree()}catch(n){jR(FR,this).clear(),jR(DR,this).clear(),t=!0}return kR(UR,this,MR(jR(FR,this).getRoots())),t}setColumnsLimit(e){jR(DR,this).setColumnsLimit(e)}mergeStateWith(e){const t=Object(u["arrayMap"])(e,e=>{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<o)&&(o=s)},rR)}return i&&null===o?-1:this.levelToRowCoords(null!==(t=o)&&void 0!==t?t:0)}findLeftMostColumnIndex(e,t){var n;const{isRoot:r}=null!==(n=this.getHeaderSettings(e,t))&&void 0!==n?n:{isRoot:!0};if(r)return t;let i=t-1;while(i>=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<this.getColumnsCount()){var s;const{isRoot:t}=null!==(s=this.getHeaderSettings(e,o))&&void 0!==s?s:{isRoot:!0};if(t)break;o+=1}return o-1}getLayersCount(){return jR(DR,this).getLayersCount()}getColumnsCount(){return jR(DR,this).getColumnsCount()}clear(){kR(UR,this,[]),jR(DR,this).clear(),jR(FR,this).clear()}}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)}class zR{constructor(e,t){BR(this,"hot",void 0),BR(this,"nestedHeaderSettingsGetter",void 0),BR(this,"layersCount",0),BR(this,"container",void 0),BR(this,"widthsMap",void 0),this.hot=e,this.nestedHeaderSettingsGetter=t,this.widthsMap=this.hot.columnIndexMapper.createAndRegisterIndexMap("nestedHeaders.widthsMap","physicalIndexToValue")}setLayersCount(e){return this.layersCount=e,this}getWidth(e){return this.widthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e))}buildWidthsMap(){this.container=this.hot.rootDocument.createElement("div"),this.container.classList.add("handsontable","htGhostTable","htAutoSize"),this._buildGhostTable(this.container),this.hot.rootDocument.body.appendChild(this.container);const e=this.container.querySelectorAll("tr:last-of-type th"),t=e.length;this.widthsMap.clear();for(let n=0;n<t;n++){const t=this.hot.columnIndexMapper.getVisualFromRenderableIndex(n),r=this.hot.toPhysicalColumn(t);this.widthsMap.setValueAtIndex(r,e[n].offsetWidth)}this.container.parentNode.removeChild(this.container),this.container=null}_buildGhostTable(e){const{rootDocument:t,columnIndexMapper:n}=this.hot,r=t.createDocumentFragment(),o=t.createElement("table"),s=!!this.hot.getSettings().dropdownMenu,a=n.getRenderableIndexesLength();for(let l=0;l<this.layersCount;l++){const e=t.createElement("tr");for(let r=0;r<a;r++){let o=n.getVisualFromRenderableIndex(r);null===o&&(o=r);const a=t.createElement("th"),c=this.nestedHeaderSettingsGetter(l,o);if(c&&(!c.isPlaceholder||c.isHidden)){let t=c.label;s&&(t+='<button class="changeType"></button>'),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;r<t;r++)n[r]=arguments[r];return tT(lT,e,NT).call(e,...n)})),this.addHook("beforeOnCellMouseDown",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return tT(lT,e,fT).call(e,...n)})),this.addHook("afterOnCellMouseDown",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return tT(lT,e,gT).call(e,...n)})),this.addHook("beforeOnCellMouseOver",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return tT(lT,e,mT).call(e,...n)})),this.addHook("beforeOnCellMouseUp",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return tT(lT,e,yT).call(e,...n)})),this.addHook("beforeSelectionHighlightSet",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return tT(lT,e,wT).call(e,...n)})),this.addHook("modifyTransformStart",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return tT(lT,e,bT).call(e,...n)})),this.addHook("afterSelection",()=>tT(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;r<t;r++)n[r]=arguments[r];return tT(lT,e,uT).call(e,...n)})),this.addHook("afterGetColumnHeaderRenderers",e=>tT(lT,this,ET).call(this,e)),this.addHook("modifyColWidth",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return tT(lT,e,ST).call(e,...n)})),this.addHook("modifyColumnHeaderValue",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return tT(lT,e,RT).call(e,...n)})),this.addHook("beforeHighlightingColumnHeader",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return tT(lT,e,dT).call(e,...n)})),this.addHook("beforeCopy",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return tT(lT,e,pT).call(e,...n)})),this.addHook("beforeSelectColumns",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return tT(lT,e,vT).call(e,...n)})),this.addHook("afterViewportColumnCalculatorOverride",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return tT(lT,e,CT).call(e,...n)})),this.addHook("modifyFocusedElement",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return tT(lT,e,TT).call(e,...n)})),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",()=>tT(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<t;s++){const e=n.childNodes[s];if(!e)break;const t=r.childNodes[s],a=o?o.childNodes[s]:null;for(let n=0,r=e.childNodes.length;n<r;n++)e.childNodes[n].removeAttribute("colspan"),Object(i["removeClass"])(e.childNodes[n],"hiddenHeader"),t&&t.childNodes[n]&&(t.childNodes[n].removeAttribute("colspan"),Object(i["removeClass"])(t.childNodes[n],"hiddenHeader")),o&&a&&a.childNodes[n]&&(a.childNodes[n].removeAttribute("colspan"),Object(i["removeClass"])(a.childNodes[n],"hiddenHeader"))}}headerRendererFactory(e){var t=this;const n=this.hot.view._wt.getSetting("fixedColumnsStart");return(r,o)=>{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 s<i&&a>o?e:s<i?s:a}function dT(e,t,n){const r=eT(iT,this).getHeaderTreeNodeData(t,e);if(!r)return e;const{columnCursor:i,selectionType:o,selectionWidth:s}=n,{isRoot:a,colspan:l}=eT(iT,this).getHeaderSettings(t,e);if(o===US["g"]){if(!a)return r.columnIndex}else if(o===US["a"]&&(l>s-i||!a))return null;return e}function pT(e,t,n){let{columnHeadersCount:r}=n;if(0!==r)for(let o=0;o<t.length;o++){const{startRow:n,startCol:r,endRow:s,endCol:a}=t[o],l=s-n+1,c=r-a+1;if(n>=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.col<i.from.col?s.push(i.getTopEndCorner().col,a,t.row):t.col>i.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.col<h.col?u.push(c.col,o,d):t.col>h.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()||i<n||i+o-1>r){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+r.origColspan-1),i&&(t.col=i.columnIndex)):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<eT(iT,this).getLayersCount();t++)e.push(this.headerRendererFactory(t))}function CT(e){const t=eT(iT,this).getLayersCount();let n=e.startColumn,r=!!t;for(let i=0;i<t;i++){const t=eT(iT,this).findLeftMostColumnIndex(i,e.startColumn),o=this.hot.columnIndexMapper.getRenderableFromVisualIndex(t);if(t>=0&&(r=!1),Object(rt["isNumeric"])(o)&&o<e.startColumn){n=o;break}}e.startColumn=r?eT(iT,this).getHeaderTreeNodeData(0,n).columnIndex:n}function ST(e,t){const n=this.ghostTable.getWidth(t);return e>n?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):e<this.countAllRows()&&(i=this.getRowParent(e),o=this.getRowIndexWithinParent(e)),i?n?i.__children.splice(o,t,...n):i.__children.splice(o,t):n?this.data.splice(o,t,...n):this.data.splice(o,t),this.rewriteCache()}syncRowWithRawSource(e){let t=e,n=null;do{n=this.getRowParent(n),null!==n&&(t=n)}while(null!==n);this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndex(t),"__children",t.__children,"NestedRows.syncRowWithRawSource"),this.plugin.enableCoreAPIModifiers()}moveRow(e,t,n,r){const i=t===this.hot.countRows(),o=this.getRowParent(e),s=this.getRowIndexWithinParent(e),a=o.__children.slice(s,s+1),l=e>t;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&&i<t&&(n.lastCollapsedRows[o]=i+r)})},applyStash:function(){let e=!(arguments.length>0&&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)<t;e.forEach(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]<t?this.dataManager.translateTrimmedRow(t-n):this.dataManager.translateTrimmedRow(t);const s=this.dataManager.getRowParent(null===o?this.hot.countSourceRows()-1:o-1),a=this.dataManager.getRowIndex(s);r=this.dataManager.untranslateTrimmedRow(a),i=r}else e[n-1]<t?(i=t-1,r=i-n+1):(r=t,i=r+n-1);o=this.hot.selection,s=this.hot.countCols()-1,o.setRangeStart(this.hot._createCellCoords(r,0)),o.setRangeEnd(this.hot._createCellCoords(i,s),!0)}isRowOrderChanged(e,t){return e.some((e,n)=>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;r<t;r++)n[r]=arguments[r];return hO(yO,e,_O).call(e,...n)})),this.addHook("beforeViewRender",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return hO(yO,e,LO).call(e,...n)})),this.addHook("modifyRowData",(function(){return e.onModifyRowData(...arguments)})),this.addHook("modifySourceLength",(function(){return e.onModifySourceLength(...arguments)})),this.addHook("beforeDataSplice",(function(){return e.onBeforeDataSplice(...arguments)})),this.addHook("filterData",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return hO(yO,e,EO).call(e,...n)})),this.addHook("afterContextMenuDefaultOptions",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return hO(yO,e,CO).call(e,...n)})),this.addHook("afterGetRowHeader",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return hO(yO,e,SO).call(e,...n)})),this.addHook("beforeOnCellMouseDown",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return hO(yO,e,vO).call(e,...n)})),this.addHook("beforeRemoveRow",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return hO(yO,e,OO).call(e,...n)})),this.addHook("afterRemoveRow",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return hO(yO,e,TO).call(e,...n)})),this.addHook("beforeAddChild",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return hO(yO,e,NO).call(e,...n)})),this.addHook("afterAddChild",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return hO(yO,e,AO).call(e,...n)})),this.addHook("beforeDetachChild",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return hO(yO,e,IO).call(e,...n)})),this.addHook("afterDetachChild",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return hO(yO,e,MO).call(e,...n)})),this.addHook("modifyRowHeaderWidth",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return hO(yO,e,RO).call(e,...n)})),this.addHook("afterCreateRow",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return hO(yO,e,xO).call(e,...n)})),this.addHook("beforeRowMove",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return hO(yO,e,bO).call(e,...n)})),this.addHook("beforeLoadData",e=>hO(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<t;r++)n[r]=arguments[r];return QO(rN,e,oN).call(e,...n)})),super.enablePlugin()}disablePlugin(){var e=this;const t=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return QO(rN,e,oN).call(e,...n)};this.hot.addHook("beforeRenderer",t),this.hot.addHookOnce("afterViewRender",()=>{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;n<e;n++)t[n]=arguments[n];this.trimRows(t)}untrimRows(e){const t=this.getTrimmedRows(),n=this.isValidConfig(e);let r=t;const i=this.trimmedRowsMap.getValues().slice(),o=e.length>0;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.length<t.length))}untrimRow(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.untrimRows(t)}isTrimmed(e){return this.trimmedRowsMap.getValueAtIndex(e)||!1}untrimAll(){this.untrimRows(this.getTrimmedRows())}isValidConfig(e){const t=this.hot.countSourceRows();return e.every(e=>Number.isInteger(e)&&e>=0&&e<t)}destroy(){super.destroy()}}function IN(){const e=this.hot.getSettings()[TN];Array.isArray(e)&&this.hot.batchExecution(()=>{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;s++)n[s].splice(3,1);e.addHookOnce("afterChange",t),e.setDataAtCell(n,null,null,"UndoRedo.undo");for(let s=0,a=n.length;s<a;s++){const[t,o]=n[s];e.getSettings().minSpareRows&&t+1+e.getSettings().minSpareRows===e.countRows()&&r===e.getSettings().minSpareRows&&(e.alter("remove_row",parseInt(t+1,10),e.getSettings().minSpareRows),e.undoRedo.doneActions.pop()),e.getSettings().minSpareCols&&o+1+e.getSettings().minSpareCols===e.countCols()&&i===e.getSettings().minSpareCols&&(e.alter("remove_col",parseInt(o+1,10),e.getSettings().minSpareCols),e.undoRedo.doneActions.pop())}const o=e.getSelectedLast();if(void 0!==o){const[t,r]=n[0],[i,s]=o,a=e.view.getFirstFullyVisibleRow(),l=e.view.getFirstFullyVisibleColumn(),c=t>=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<i;r++)n[r].splice(2,1);e.addHookOnce("afterChange",t),e.setDataAtCell(n,null,null,"UndoRedo.redo"),this.selected&&e.selectCells(this.selected,!1,!1)},_N.CreateRowAction=function(e,t){this.index=e,this.amount=t,this.actionType="insert_row"},Object(s["inherit"])(_N.CreateRowAction,_N.Action),_N.CreateRowAction.prototype.undo=function(e,t){const n=e.countRows(),r=e.getSettings().minSpareRows;this.index>=n&&this.index-r<n&&(this.index-=r),e.addHookOnce("afterRemoveRow",t),e.alter("remove_row",this.index,this.amount,"UndoRedo.undo")},_N.CreateRowAction.prototype.redo=function(e,t){e.addHookOnce("afterCreateRow",t),e.alter("insert_row_above",this.index,this.amount,"UndoRedo.redo")},_N.RemoveRowAction=function(e,t,n,r,i,o){this.index=e,this.data=t,this.actionType="remove_row",this.fixedRowsBottom=n,this.fixedRowsTop=r,this.rowIndexesSequence=i,this.removedCellMetas=o},Object(s["inherit"])(_N.RemoveRowAction,_N.Action),_N.RemoveRowAction.prototype.undo=function(e,t){const n=e.getSettings(),r=[];n.fixedRowsBottom=this.fixedRowsBottom,n.fixedRowsTop=this.fixedRowsTop,this.data.forEach((e,t)=>{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<o;c++)s.push(Object(u["arrayMap"])(this.data[c],i));const a=Object(u["arrayMap"])(this.headers,i),l=[];e.alter("insert_col_start",this.indexes[0],this.indexes.length,"UndoRedo.undo"),Object(u["arrayEach"])(e.getSourceDataArray(),(e,t)=>{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<r&&(r-=1),n.moveRow(r,t)}),e.render(),e.deselectCell(),e.selectRows(this.rows[0],this.rows[0]+this.rows.length-1)},_N.RowMoveAction.prototype.redo=function(e,t){const n=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",t),n.moveRows(this.rows.slice(),this.finalRowIndex),e.render(),e.deselectCell(),e.selectRows(this.finalRowIndex,this.finalRowIndex+this.rows.length-1)},_N.ColumnMoveAction=function(e,t){this.columns=e.slice(),this.finalColumnIndex=t,this.actionType="col_move"},Object(s["inherit"])(_N.ColumnMoveAction,_N.Action),_N.ColumnMoveAction.prototype.undo=function(e,t){const n=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",t);const r=Cm(this.columns,this.finalColumnIndex,e.columnIndexMapper.getNumberOfIndexes());r.reverse().forEach(e=>{let{from:t,to:r}=e;t<r&&(r-=1),n.moveColumn(r,t)}),e.render(),e.deselectCell(),e.selectColumns(this.columns[0],this.columns[0]+this.columns.length-1)},_N.ColumnMoveAction.prototype.redo=function(e,t){const n=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",t),n.moveColumns(this.columns.slice(),this.finalColumnIndex),e.render(),e.deselectCell(),e.selectColumns(this.finalColumnIndex,this.finalColumnIndex+this.columns.length-1)},_N.prototype.init=function(){const e=this.instance.getSettings().undo,t="undefined"===typeof e||e;this.instance.undoRedo||(this.instance.undoRedo=this),t?this.instance.undoRedo.enable():this.instance.undoRedo.disable()},_N.prototype.registerShortcuts=function(){const e=this.instance.getShortcutManager(),t=e.getContext("grid"),n=e=>!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 e<this.indexedValues.length&&(this.indexedValues[e]=t,!1===this.orderOfIndexes.includes(e)&&this.orderOfIndexes.splice(n,0,e),this.runLocalHooks("change"),!0)}clearValue(e){this.orderOfIndexes=Object(o["b"])(this.orderOfIndexes,[e]),Object(a["isFunction"])(this.initValueOrFn)?super.setValueAtIndex(e,this.initValueOrFn(e)):super.setValueAtIndex(e,this.initValueOrFn)}getLength(){return this.orderOfIndexes.length}setDefaultValues(){let e=arguments.length>0&&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;u<r;u++)t[u]=arguments[u]}return s(t,n+r)}})},9582:function(e,t,n){"use strict";var r=n("e156"),i=n("2471"),o=n("022b"),s=n("c272"),a=n("80dd"),l=a("iterator");e.exports=function(e){if(!o(e))return i(e,l)||i(e,"@@iterator")||s[r(e)]}},9674:function(e,t,n){"use strict";var r=n("fd18");e.exports=r([].slice)},9718:function(e,t,n){"use strict";var r=n("8793"),i=n("2d2d");e.exports=function(e,t){r(t)&&"cause"in t&&i(e,"cause",t.cause)}},"97b9":function(e,t,n){"use strict";n.r(t),n.d(t,"isFunction",(function(){return o})),n.d(t,"throttle",(function(){return s})),n.d(t,"throttleAfterHits",(function(){return a})),n.d(t,"debounce",(function(){return l})),n.d(t,"pipe",(function(){return c})),n.d(t,"partial",(function(){return h})),n.d(t,"curry",(function(){return u})),n.d(t,"curryRight",(function(){return d})),n.d(t,"fastCall",(function(){return p}));var r=n("81ea"),i=n("7b9c");function o(e){return"function"===typeof e}function s(e){let t=arguments.length>1&&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<o;a++)s[a]=arguments[a];const l=Date.now();let c=!1;r.lastCallThrottled=!0,n||(n=l,c=!0);const h=t-(l-n);return c?(r.lastCallThrottled=!1,e.apply(this,s)):(i&&clearTimeout(i),i=setTimeout(()=>{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;o<t;o++)n[o]=arguments[o];return i?(i-=1,e.apply(this,n)):r.apply(this,n)}return a.clearHits=o,a}function l(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,r=null;function i(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r&&clearTimeout(r),r=setTimeout(()=>{t=e.apply(this,o)},n),t}return i}function c(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const[i,...o]=t;return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Object(r["arrayReduce"])(o,(e,t)=>t(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;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.apply(this,n.concat(r))}}function u(e){const t=e.length;function n(r){return function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];const a=r.concat(o);let l;return l=a.length>=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<i;s++)o[s]=arguments[s];const a=r.concat(o.reverse());let l;return l=a.length>=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=>t<e).length)}function o(e,t){const n=t[0],i=t.length;return Object(r["arrayMap"])(e,e=>e>=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=["<table>","</table>"],c=t?["<thead>","</thead>"]:[],h=["<tbody>","</tbody>"],u=n?1:0,d=t?1:0;for(let p=0;p<s;p+=1){const i=t&&0===p,s=[];for(let t=0;t<a;t+=1){const a=!i&&n&&0===t;let l="";if(i)l=`<th>${e.getColHeader(t-u)}</th>`;else if(a)l=`<th>${e.getRowHeader(p-d)}</th>`;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=`<td ${e.join(" ")}></td>`;else{const t=n.toString().replace("<","<").replace(">",">").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,"<br>\r\n").replace(/\x20/gi," ").replace(/\t/gi,"	");l=`<td ${e.join(" ")}>${t}</td>`}}}s.push(l)}const l=["<tr>",...s,"</tr>"].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=["<table>"];for(let i=0;i<t;i+=1){const o=e[i],s=o.length,a=[];0===i&&n.push("<tbody>");for(let e=0;e<s;e+=1){const t=o[e],n=Object(r["isEmpty"])(t)?"":t.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,"<br>\r\n").replace(/\x20{2,}/gi,e=>`<span style="mso-spacerun: yes">${" ".repeat(e.length-1)} </span>`).replace(/\t/gi,"	");a.push(`<td>${n}</td>`)}n.push("<tr>",...a,"</tr>"),i+1===t&&n.push("</tbody>")}return n.push("</table>"),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(/<td\b[^>]*?>([\s\S]*?)<\/\s*td>/g,e=>{const t=e.match(/<td\b[^>]*?>/g)[0],n=/<p.*?>/g,r=e.substring(t.length,e.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(n,"\n").replace("\n","").replaceAll(/<\/(.*)>\s+$/gm,"</$1>").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^ $/gm,""),i="</td>";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;i<y;i++)b[i]=new Array(d);const v=[],E=[];for(let s=0;s<y;s++){const e=w[s],t=Array.from(e.cells),n=t.length;for(let r=0;r<n;r++){const e=t[r],{nodeName:n,innerHTML:a,rowSpan:l,colSpan:h}=e,u=b[s].findIndex(e=>void 0===e);if("TD"===n){if(l>1||h>1){for(let e=s;e<s+l;e++)if(e<y)for(let t=u;t<u+h;t++)b[e][t]=null;const t=e.getAttribute("style"),n=t&&t.includes("mso-ignore:colspan");n||v.push({col:u,row:s,rowspan:l,colspan:h})}let t="";t=c&&/excel/gi.test(c.content)?a.replace(/[\r\n][\x20]{0,2}/g," ").replace(/<br(\s*|\/)>[\r\n]?[\x20]{0,3}/gim,"\r\n"):a.replace(/<br(\s*|\/)>[\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);n<t;n++)r[n]=e[n];return r}function c(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var h=Object.hasOwnProperty,u=Object.setPrototypeOf,d=Object.isFrozen,p=Object.getPrototypeOf,f=Object.getOwnPropertyDescriptor,g=Object.freeze,m=Object.seal,y=Object.create,w="undefined"!==typeof Reflect&&Reflect,b=w.apply,v=w.construct;b||(b=function(e,t,n){return e.apply(t,n)}),g||(g=function(e){return e}),m||(m=function(e){return e}),v||(v=function(e,t){return r(e,i(t))});var E=L(Array.prototype.forEach),C=L(Array.prototype.pop),S=L(Array.prototype.push),R=L(String.prototype.toLowerCase),T=L(String.prototype.toString),O=L(String.prototype.match),N=L(String.prototype.replace),A=L(String.prototype.indexOf),I=L(String.prototype.trim),M=L(RegExp.prototype.test),x=P(TypeError),_=L(Number.isNaN);function L(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return b(e,t,r)}}function P(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return v(e,n)}}function k(e,t,n){var r;n=null!==(r=n)&&void 0!==r?r:R,u&&u(e,null);var i=t.length;while(i--){var o=t[i];if("string"===typeof o){var s=n(o);s!==o&&(d(t)||(t[i]=s),o=s)}e[o]=!0}return e}function j(e){var t,n=y(null);for(t in e)!0===b(h,e,[t])&&(n[t]=e[t]);return n}function H(e,t){while(null!==e){var n=f(e,t);if(n){if(n.get)return L(n.get);if("function"===typeof n.value)return L(n.value)}e=p(e)}function r(e){return console.warn("fallback value for",e),null}return r}var D=g(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),F=g(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),U=g(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),V=g(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),B=g(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),W=g(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),G=g(["#text"]),z=g(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Y=g(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),X=g(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),K=g(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$=m(/\{\{[\w\W]*|[\w\W]*\}\}/gm),q=m(/<%[\w\W]*|[\w\W]*%>/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="<remove></remove>"+e;else{var r=O(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===we&&ct===lt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");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(/<template/i,e.innerHTML))return Ot(e),!0;if(7===e.nodeType)return Ot(e),!0;if(Ve&&8===e.nodeType&&M(/<[/\w]/g,e.data))return Ot(e),!0;if(!Ie[r]||Pe[r]){if(!Pe[r]&&kt(r)){if(Le.tagNameCheck instanceof RegExp&&M(Le.tagNameCheck,r))return!1;if(Le.tagNameCheck instanceof Function&&Le.tagNameCheck(r))return!1}if(Qe&&!et[r]){var i=L(e)||e.parentNode,o=v(e)||e.childNodes;if(o&&i)for(var s=o.length,a=s-1;a>=0;--a){var l=w(o[a],!0);l.__removalCount=(e.__removalCount||0)+1,i.insertBefore(l,b(e))}}return Ot(e),!0}return e instanceof c&&!Tt(e)?(Ot(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!M(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ue&&3===e.nodeType&&(t=e.textContent,t=N(t,ve," "),t=N(t,Ee," "),t=N(t,Ce," "),e.textContent!==t&&(S(n.removed,{element:e.cloneNode()}),e.textContent=t)),_t("afterSanitizeElements",e,null),!1):(Ot(e),!0)},Pt=function(e,t,n){if(Ke&&("id"===t||"name"===t)&&(n in o||n in yt||"__depth"===n||"__removalCount"===n))return!1;if(He&&!ke[t]&&M(Se,t));else if(je&&M(Re,t));else if(!xe[t]||ke[t]){if(!(kt(e)&&(Le.tagNameCheck instanceof RegExp&&M(Le.tagNameCheck,e)||Le.tagNameCheck instanceof Function&&Le.tagNameCheck(e))&&(Le.attributeNameCheck instanceof RegExp&&M(Le.attributeNameCheck,t)||Le.attributeNameCheck instanceof Function&&Le.attributeNameCheck(t))||"is"===t&&Le.allowCustomizedBuiltInElements&&(Le.tagNameCheck instanceof RegExp&&M(Le.tagNameCheck,n)||Le.tagNameCheck instanceof Function&&Le.tagNameCheck(n))))return!1}else if(it[t]);else if(M(Ae,N(n,Oe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==A(n,"data:")||!nt[e]){if(De&&!M(Te,N(n,Oe,"")));else if(n)return!1}else;return!0},kt=function(e){return"annotation-xml"!==e&&O(e,Ne)},jt=function(t){var r,i,o,s;_t("beforeSanitizeAttributes",t,null);var a=t.attributes;if(a){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe};s=a.length;while(s--){r=a[s];var c=r,h=c.name,u=c.namespaceURI;if(i="value"===h?r.value:I(r.value),o=be(h),l.attrName=o,l.attrValue=i,l.keepAttr=!0,l.forceKeepAttr=void 0,_t("uponSanitizeAttribute",t,l),i=l.attrValue,!l.forceKeepAttr&&(Nt(h,t),l.keepAttr))if(Fe||!M(/\/>/i,i))if(Ve&&M(/((--!?|])>)|<\/(style|title)/i,i))Nt(h,t);else{Ue&&(i=N(i,ve," "),i=N(i,Ee," "),i=N(i,Ce," "));var d=be(t.nodeName);if(Pt(d,o,i)){if(!$e||"id"!==o&&"name"!==o||(Nt(h,t),i=qe+i),le&&"object"===e(m)&&"function"===typeof m.getAttributeType)if(u);else switch(m.getAttributeType(d,o)){case"TrustedHTML":i=le.createHTML(i);break;case"TrustedScriptURL":i=le.createScriptURL(i);break}try{u?t.setAttributeNS(u,h,i):t.setAttribute(h,i),Mt(t)?Ot(t):C(n.removed)}catch(Dt){}}}else Nt(h,t)}_t("afterSanitizeAttributes",t,null)}},Ht=function e(t){var n,r=It(t);_t("beforeSanitizeShadowDOM",t,null);while(n=r.nextNode())if(_t("uponSanitizeShadowNode",n,null),!Lt(n)){var i=L(n);1===n.nodeType&&(i&&i.__depth?n.__depth=(n.__removalCount||0)+i.__depth+1:n.__depth=1),(n.__depth>=mt||_(n.__depth))&&Ot(n),n.content instanceof s&&(n.content.__depth=n.__depth,e(n.content)),jt(n)}_t("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(i){var o,a,c,h,u,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(ht=!i,ht&&(i="\x3c!--\x3e"),"string"!==typeof i&&!xt(i)){if("function"!==typeof i.toString)throw x("toString is not a function");if(i=i.toString(),"string"!==typeof i)throw x("dirty is not a string, aborting")}if(!n.isSupported){if("object"===e(t.toStaticHTML)||"function"===typeof t.toStaticHTML){if("string"===typeof i)return t.toStaticHTML(i);if(xt(i))return t.toStaticHTML(i.outerHTML)}return i}if(We||bt(d),n.removed=[],"string"===typeof i&&(Ze=!1),Ze){if(i.nodeName){var p=be(i.nodeName);if(!Ie[p]||Pe[p])throw x("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof l)o=At("\x3c!----\x3e"),a=o.ownerDocument.importNode(i,!0),1===a.nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?o=a:o.appendChild(a);else{if(!ze&&!Ue&&!Be&&-1===i.indexOf("<"))return le&&Xe?le.createHTML(i):i;if(o=At(i),!o)return ze?null:Xe?ce:""}o&&Ge&&Ot(o.firstChild);var f=It(Ze?i:o);while(c=f.nextNode())if((3!==c.nodeType||c!==h)&&!Lt(c)){var g=L(c);1===c.nodeType&&(g&&g.__depth?c.__depth=(c.__removalCount||0)+g.__depth+1:c.__depth=1),(c.__depth>=mt||_(c.__depth))&&Ot(c),c.content instanceof s&&(c.content.__depth=c.__depth,Ht(c.content)),jt(c),h=c}if(h=null,Ze)return i;if(ze){if(Ye){u=pe.call(o.ownerDocument);while(o.firstChild)u.appendChild(o.firstChild)}else u=o;return(xe.shadowroot||xe.shadowrootmod)&&(u=ge.call(r,u,!0)),u}var m=Be?o.outerHTML:o.innerHTML;return Be&&Ie["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&M(re,o.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+m),Ue&&(m=N(m,ve," "),m=N(m,Ee," "),m=N(m,Ce," ")),le&&Xe?le.createHTML(m):m},n.setConfig=function(e){bt(e),We=!0},n.clearConfig=function(){gt=null,We=!1},n.isValidAttribute=function(e,t,n){gt||bt({});var r=be(e),i=be(t);return Pt(r,i,n)},n.addHook=function(e,t){"function"===typeof t&&(ye[e]=ye[e]||[],S(ye[e],t))},n.removeHook=function(e){if(ye[e])return C(ye[e])},n.removeHooks=function(e){ye[e]&&(ye[e]=[])},n.removeAllHooks=function(){ye={}},n}var le=ae();return le}))},c0d8:function(e,t,n){"use strict";n("7a89"),n("d06e"),n("f4db");var r=n("5d7f"),i=n("97b9"),o=n("7b9c"),s=n("63d8"),a=n("c5c4"),l=n("87d6"),c=n("351d"),h=n("bd5e");function u(e,t){p(e,t),t.add(e)}function d(e,t,n){p(e,t),t.set(e,n)}function p(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function f(e,t){return e.get(m(e,t))}function g(e,t,n){return e.set(m(e,t),n),n}function m(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 y=Object.freeze({CELL:"cell",MIXED:"mixed"});var w=new WeakMap,b=new WeakMap,v=new WeakMap,E=new WeakMap,C=new WeakMap,S=new WeakSet;class R{constructor(e){var t=this;u(this,S),d(this,w,void 0),d(this,b,void 0),d(this,v,50),d(this,E,null),d(this,C,new Map);const n=e.getSettings();g(w,this,e),g(b,this,n.imeFastEdit?y.MIXED:y.CELL),f(w,this).addHook("afterUpdateSettings",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return m(S,t,A).call(t,...n)})),f(w,this).addHook("afterSelection",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return m(S,t,O).call(t,...n)})),f(w,this).addHook("afterSelectionFocusSet",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return m(S,t,O).call(t,...n)})),f(w,this).addHook("afterSelectionEnd",(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return m(S,t,N).call(t,...n)}))}getFocusMode(){return f(b,this)}setFocusMode(e){Object.values(y).includes(e)?g(b,this,e):Object(h["b"])(`"${e}" is not a valid focus mode.`)}getRefocusDelay(){return f(v,this)}setRefocusDelay(e){g(v,this,e)}setRefocusElementGetter(e){g(E,this,e)}getRefocusElement(){return"function"===typeof f(E,this)?f(E,this).call(this):null===(e=f(w,this).getActiveEditor())||void 0===e?void 0:e.TEXTAREA;var e}focusOnHighlightedCell(e){const t=e=>{var t,n;const r=null===(t=f(w,this).getSelectedRangeLast())||void 0===t?void 0:t.highlight;if(!r)return;let i=f(w,this).runHooks("modifyFocusedElement",r.row,r.col,e);i instanceof HTMLElement||(i=e),!i||null!==(n=f(w,this).getActiveEditor())&&void 0!==n&&n.isOpened()||i.focus({preventScroll:!0})};e?t(e):m(S,this,T).call(this,e=>t(e))}refocusToEditorTextarea(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f(v,this);const n=this.getRefocusElement();!f(w,this).getSettings().imeFastEdit||null!==(e=f(w,this).getActiveEditor())&&void 0!==e&&e.isOpened()||!n||(f(C,this).has(t)||f(C,this).set(t,Object(i["debounce"])(()=>{n.select()},t)),f(C,this).get(t)())}}function T(e){var t;const n=null===(t=f(w,this).getSelectedRangeLast())||void 0===t?void 0:t.highlight;if(!n||!f(w,this).selection.isCellVisible(n))return void e(null);const r=f(w,this).getCell(n.row,n.col,!0);null===r?f(w,this).addHookOnce("afterScroll",()=>{e(f(w,this).getCell(n.row,n.col,!0))}):e(r)}function O(){m(S,this,T).call(this,e=>{const{activeElement:t}=f(w,this).rootDocument;t&&Object(r["isOutsideInput"])(t)&&t.blur(),this.focusOnHighlightedCell(e)})}function N(){m(S,this,T).call(this,e=>{this.getFocusMode()===y.MIXED&&"TD"===e.nodeName&&this.refocusToEditorTextarea()})}function A(e){e.imeFastEdit&&this.getFocusMode()!==y.MIXED?this.setFocusMode(y.MIXED):e.imeFastEdit||this.getFocusMode()===y.CELL||this.setFocusMode(y.CELL)}var I=n("81ea"),M=n("a776"),x=n("24b5"),_=n("3d76"),L=n("491c"),P=n("169f"),k=n("29b0"),j=n("ffec"),H=n("de3b"),D=n("7dd09");function F(e,t,n){U(e,t),t.set(e,n)}function U(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function V(e,t){return e.get(W(e,t))}function B(e,t,n){return e.set(W(e,t),n),n}function W(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 G=new WeakMap,z=new WeakMap,Y=new WeakMap,X=new WeakMap,K=new WeakMap,$=new WeakMap,q=new WeakMap,Q=new WeakMap,Z=new WeakMap,J=new WeakMap;class ee{constructor(e,t,n,r,i,o){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;F(this,G,void 0),F(this,z,void 0),F(this,Y,void 0),F(this,X,void 0),F(this,K,void 0),F(this,$,void 0),F(this,q,void 0),F(this,Q,void 0),F(this,Z,[null,null]),F(this,J,[null,null]),B(G,this,n),B(z,this,t),B(Y,this,i),B(X,this,o),B(K,this,s),B($,this,r),B(q,this,e),this.registerEvents()}registerEvents(){V($,this).addEventListener(V(Y,this).holder,"contextmenu",e=>this.onContextMenu(e)),V($,this).addEventListener(V(Y,this).TABLE,"mouseover",e=>this.onMouseOver(e)),V($,this).addEventListener(V(Y,this).TABLE,"mouseout",e=>this.onMouseOut(e));const e=()=>{V($,this).addEventListener(V(Y,this).holder,"touchstart",e=>this.onTouchStart(e)),V($,this).addEventListener(V(Y,this).holder,"touchend",e=>this.onTouchEnd(e)),this.momentumScrolling||(this.momentumScrolling={}),V($,this).addEventListener(V(Y,this).holder,"scroll",()=>{clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||V(G,this).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout(()=>{this.touchApplied||(this.momentumScrolling.ongoing=!1,V(G,this).getSetting("onAfterMomentumScroll"))},200)})},t=()=>{V($,this).addEventListener(V(Y,this).holder,"mouseup",e=>this.onMouseUp(e)),V($,this).addEventListener(V(Y,this).holder,"mousedown",e=>this.onMouseDown(e))};Object(s["isMobileBrowser"])()?e():(Object(D["isTouchSupported"])()&&e(),t())}selectedCellWasTouched(e){const t=this.parentCell(e),n=t.coords;if(V(Q,this)&&n){const[e,t]=[n.row,V(Q,this).from.row],[r,i]=[n.col,V(Q,this).from.col];return e===t&&r===i}return!1}parentCell(e){const t={},n=V(Y,this).TABLE,i=Object(r["closestDown"])(e,["TD","TH"],n);return i?(t.coords=V(Y,this).getCoords(i),t.TD=i):Object(r["hasClass"])(e,"wtBorder")&&Object(r["hasClass"])(e,"current")?(t.coords=V(X,this).getFocusSelection().cellRange.highlight,t.TD=V(Y,this).getCell(t.coords)):Object(r["hasClass"])(e,"wtBorder")&&Object(r["hasClass"])(e,"area")&&V(X,this).getAreaSelection().cellRange&&(t.coords=V(X,this).getAreaSelection().cellRange.to,t.TD=V(Y,this).getCell(t.coords)),t}onMouseDown(e){const t=V(z,this).rootDocument.activeElement,n=Object(i["partial"])(r["getParent"],e.target),o=e.target;if(!["TD","TH"].includes(t.nodeName)&&(o===t||n(0)===t||n(1)===t))return;const s=this.parentCell(o);Object(r["hasClass"])(o,"corner")?V(G,this).getSetting("onCellCornerMouseDown",e,o):s.TD&&V(G,this).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,s.coords,s.TD),(0===e.button||this.touchApplied)&&s.TD&&(V(J,this)[0]=s.TD,clearTimeout(V(Z,this)[0]),V(Z,this)[0]=setTimeout(()=>{V(J,this)[0]=null},1e3))}onContextMenu(e){if(V(G,this).has("onCellContextMenu")){const t=this.parentCell(e.target);t.TD&&this.callListener("onCellContextMenu",e,t.coords,t.TD)}}onMouseOver(e){if(!V(G,this).has("onCellMouseOver"))return;const t=V(Y,this).TABLE,n=Object(r["closestDown"])(e.target,["TD","TH"],t),i=V(K,this)||this;n&&n!==i.lastMouseOver&&Object(r["isChildOf"])(n,t)&&(i.lastMouseOver=n,this.callListener("onCellMouseOver",e,V(Y,this).getCoords(n),n))}onMouseOut(e){if(!V(G,this).has("onCellMouseOut"))return;const t=V(Y,this).TABLE,n=Object(r["closestDown"])(e.target,["TD","TH"],t),i=Object(r["closestDown"])(e.relatedTarget,["TD","TH"],t),o=V(K,this)||this;n&&n!==i&&Object(r["isChildOf"])(n,t)&&(this.callListener("onCellMouseOut",e,V(Y,this).getCoords(n),n),null===i&&(o.lastMouseOver=null))}onMouseUp(e){const t=this.parentCell(e.target);t.TD&&V(G,this).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,t.coords,t.TD),(0===e.button||this.touchApplied)&&(t.TD===V(J,this)[0]&&t.TD===V(J,this)[1]?(Object(r["hasClass"])(e.target,"corner")?this.callListener("onCellCornerDblClick",e,t.coords,t.TD):this.callListener("onCellDblClick",e,t.coords,t.TD),V(J,this)[0]=null,V(J,this)[1]=null):t.TD===V(J,this)[0]&&(V(J,this)[1]=t.TD,clearTimeout(V(Z,this)[1]),V(Z,this)[1]=setTimeout(()=>{V(J,this)[1]=null},500)))}onTouchStart(e){B(Q,this,V(X,this).getFocusSelection().cellRange),this.touchApplied=!0,this.onMouseDown(e)}onTouchEnd(e){var t;const n=e.target,r=null===(t=this.parentCell(n))||void 0===t?void 0:t.coords,i=Object(o["isDefined"])(r)&&r.row>=0&&r.col>=0,a=e.cancelable&&i&&V(G,this).getSetting("isDataViewInstance");if(a){const t=["A","BUTTON","INPUT"];Object(s["isIOS"])()&&(Object(s["isChromeWebKit"])()||Object(s["isFirefoxWebKit"])())&&this.selectedCellWasTouched(n)&&!t.includes(n.tagName)?e.preventDefault():this.selectedCellWasTouched(n)||e.preventDefault()}this.onMouseUp(e),this.touchApplied=!1}callListener(e,t,n,r){const i=V(G,this).getSettingPure(e);i&&i(t,n,r,V(q,this).call(this))}destroy(){clearTimeout(V(Z,this)[0]),clearTimeout(V(Z,this)[1]),V($,this).destroy()}}var te=ee,ne=n("f938");function re(e,t,n){return t=ie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ie(e){var t=oe(e,"string");return"symbol"==typeof t?t:t+""}function oe(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 se{constructor(e,t,n){re(this,"offset",void 0),re(this,"total",void 0),re(this,"countTH",void 0),this.offset=e,this.total=t,this.countTH=n}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleRowHeadedColumnToSourceColumn(e){return this.renderedToSource(this.offsettedTH(e))}sourceColumnToVisibleRowHeadedColumn(e){return this.unOffsettedTH(this.sourceToRendered(e))}}var ae=se;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)}class ue{constructor(e,t,n){le(this,"offset",void 0),le(this,"total",void 0),le(this,"countTH",void 0),this.offset=e,this.total=t,this.countTH=n}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleColHeadedRowToSourceRow(e){return this.renderedToSource(this.offsettedTH(e))}sourceRowToVisibleColHeadedRow(e){return this.unOffsettedTH(this.sourceToRendered(e))}}var de=ue;const pe=0,fe=1,ge=2;function me(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=we(e,"string");return"symbol"==typeof t?t:t+""}function we(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 be{constructor(){me(this,"currentSize",0),me(this,"nextSize",0),me(this,"currentOffset",0),me(this,"nextOffset",0)}setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}}function ve(e,t,n){return t=Ee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ee(e){var t=Ce(e,"string");return"symbol"==typeof t?t:t+""}function Ce(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 Se{constructor(){ve(this,"size",new be),ve(this,"workingSpace",pe),ve(this,"sharedSize",null)}setSize(e){this.size.setSize(e)}setOffset(e){this.size.setOffset(e)}getViewSize(){return this.size}isShared(){return this.sharedSize instanceof be}isPlaceOn(e){return this.workingSpace===e}append(e){this.workingSpace=fe,e.workingSpace=ge,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=ge,e.workingSpace=fe,this.sharedSize=e.getViewSize()}}function Re(e,t,n){return t=Te(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Te(e){var t=Oe(e,"string");return"symbol"==typeof t?t:t+""}function Oe(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 Ne{constructor(e,t,n){Re(this,"rootNode",void 0),Re(this,"nodesPool",void 0),Re(this,"sizeSet",new Se),Re(this,"childNodeType",void 0),Re(this,"visualIndex",0),Re(this,"collectedNodes",[]),this.rootNode=e,this.nodesPool=t,this.childNodeType=n.toUpperCase()}setSize(e){return this.sizeSet.setSize(e),this}setOffset(e){return this.sizeSet.setOffset(e),this}isSharedViewSet(){return this.sizeSet.isShared()}getNode(e){return e<this.collectedNodes.length?this.collectedNodes[e]:null}getCurrentNode(){const e=this.collectedNodes.length;return e>0?this.collectedNodes[e-1]:null}getRenderedChildCount(){const{rootNode:e,sizeSet:t}=this;let n=0;if(this.isSharedViewSet()){let r=e.firstElementChild;while(r){if(r.tagName===this.childNodeType)n+=1;else if(t.isPlaceOn(fe))break;r=r.nextElementSibling}}else n=e.childElementCount;return n}start(){this.collectedNodes.length=0,this.visualIndex=0;const{rootNode:e,sizeSet:t}=this,n=this.isSharedViewSet(),{nextSize:r}=t.getViewSize();let i=this.getRenderedChildCount();while(i<r){const r=this.nodesPool();!n||n&&t.isPlaceOn(ge)?e.appendChild(r):e.insertBefore(r,e.firstChild),i+=1}const o=n&&t.isPlaceOn(fe);while(i>r)e.removeChild(o?e.firstChild:e.lastChild),i-=1}render(){const{rootNode:e,sizeSet:t}=this;let n=this.visualIndex;this.isSharedViewSet()&&t.isPlaceOn(ge)&&(n+=t.sharedSize.nextSize);let r=e.childNodes[n];if(r.tagName!==this.childNodeType){const t=this.nodesPool();e.replaceChild(t,r),r=t}this.collectedNodes.push(r),this.visualIndex+=1}end(){}}class Ae extends Ne{prependView(e){return this.sizeSet.prepend(e.sizeSet),e.sizeSet.append(this.sizeSet),this}appendView(e){return this.sizeSet.append(e.sizeSet),e.sizeSet.prepend(this.sizeSet),this}}function Ie(e,t,n){return t=Me(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Me(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)}class _e{constructor(e){Ie(this,"nodeType",void 0),this.nodeType=e.toUpperCase()}setRootDocument(e){this.rootDocument=e}obtain(){return this.rootDocument.createElement(this.nodeType)}}function Le(e,t,n){return t=Pe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pe(e){var t=ke(e,"string");return"symbol"==typeof t?t:t+""}function ke(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 je{constructor(e,t){Le(this,"nodesPool",null),Le(this,"nodeType",void 0),Le(this,"rootNode",void 0),Le(this,"table",null),Le(this,"renderedNodes",0),this.nodesPool="string"===typeof e?new _e(e):null,this.nodeType=e,this.rootNode=t}setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}adjust(){}render(){}}var He=n("8828");function De(e,t,n){return t=Fe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fe(e){var t=Ue(e,"string");return"symbol"==typeof t?t:t+""}function Ue(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 Ve extends je{constructor(){super("TH"),De(this,"orderViews",new WeakMap),De(this,"sourceRowIndex",0)}obtainOrderView(e){let t;return this.orderViews.has(e)?t=this.orderViews.get(e):(t=new Ae(e,e=>this.nodesPool.obtain(this.sourceRowIndex,e),this.nodeType),this.orderViews.set(e,t)),t}render(){const{rowsToRender:e,rowHeaderFunctions:t,rowHeadersCount:n,rows:i,cells:o}=this.table;for(let s=0;s<e;s++){const e=this.table.renderedRowToSource(s),a=i.getRenderedNode(s);this.sourceRowIndex=e;const l=this.obtainOrderView(a),c=o.obtainOrderView(a);l.appendView(c).setSize(n).setOffset(this.table.renderedColumnToSource(0)).start();for(let i=0;i<n;i++){l.render();const n=l.getCurrentNode();n.className="",n.removeAttribute("style"),Object(r["removeAttribute"])(n,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Object(r["setAttribute"])(n,[Object(He["D"])(),Object(He["G"])(),Object(He["f"])(i+1),Object(He["K"])(-1)]),t[i](e,n,i)}l.end()}}}class Be extends je{constructor(e){super(null,e)}adjust(){const{columnHeadersCount:e,rowHeadersCount:t}=this.table;let n=this.rootNode.firstChild;if(e){const{columnsToRender:r}=this.table,i=r+t;for(let t=0,s=e;t<s;t++){n=this.rootNode.childNodes[t],n||(n=this.table.rootDocument.createElement("tr"),this.rootNode.appendChild(n)),this.renderedNodes=n.childNodes.length;while(this.renderedNodes<i)n.appendChild(this.table.rootDocument.createElement("th")),this.renderedNodes+=1;while(this.renderedNodes>i)n.removeChild(n.lastChild),this.renderedNodes-=1}const o=this.rootNode.childNodes.length;if(o>e)for(let t=e;t<o;t++)this.rootNode.removeChild(this.rootNode.lastChild)}else n&&Object(r["empty"])(n)}render(){const{columnHeadersCount:e}=this.table;this.table.isAriaEnabled()&&Object(r["setAttribute"])(this.rootNode,[Object(He["C"])()]);for(let t=0;t<e;t+=1){const{columnHeaderFunctions:e,columnsToRender:n,rowHeadersCount:i}=this.table,o=this.rootNode.childNodes[t];this.table.isAriaEnabled()&&Object(r["setAttribute"])(o,[Object(He["A"])(),Object(He["E"])(t+1)]);for(let s=-1*i;s<n;s+=1){const n=this.table.renderedColumnToSource(s),a=o.childNodes[s+i];a.className="",a.removeAttribute("style"),Object(r["removeAttribute"])(a,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&Object(r["setAttribute"])(a,[Object(He["f"])(s+1+this.table.rowHeadersCount),Object(He["K"])(-1),Object(He["g"])(),...s>=0?[Object(He["F"])()]:[Object(He["A"])()]]),e[t](n,a,t)}}}}var We=n("67a87");let Ge=!1;class ze extends je{constructor(e){super(null,e)}adjust(){const{columnsToRender:e,rowHeadersCount:t}=this.table,n=e+t;while(this.renderedNodes<n)this.rootNode.appendChild(this.table.rootDocument.createElement("col")),this.renderedNodes+=1;while(this.renderedNodes>n)this.rootNode.removeChild(this.rootNode.lastChild),this.renderedNodes-=1}render(){this.adjust();const{columnsToRender:e,rowHeadersCount:t}=this.table;!Ge&&e>1e3&&(Ge=!0,Object(h["b"])(We["a"]`Performance tip: Handsontable rendered more than 1000 visible columns.\x20
- Consider limiting the number of rendered columns by specifying the table width and/or\x20
- turning off the "renderAllColumns" option.`));for(let r=0;r<t;r++){const e=this.table.renderedColumnToSource(r),t=this.table.columnUtils.getHeaderWidth(e);this.rootNode.childNodes[r].style.width=t+"px"}for(let r=0;r<e;r++){const e=this.table.renderedColumnToSource(r),n=this.table.columnUtils.getStretchedColumnWidth(e);this.rootNode.childNodes[r+t].style.width=n+"px"}const n=this.rootNode.firstChild;n&&Object(r["addClass"])(n,"rowHeader")}}function Ye(e,t,n){return t=Xe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xe(e){var t=Ke(e,"string");return"symbol"==typeof t?t:t+""}function Ke(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)}let $e=!1;class qe extends je{constructor(e){super("TR",e),Ye(this,"orderView",void 0),this.orderView=new Ne(e,e=>this.nodesPool.obtain(e),this.nodeType)}getRenderedNode(e){return this.orderView.getNode(e)}render(){const{rowsToRender:e}=this.table;!$e&&e>1e3&&($e=!0,Object(h["b"])(We["a"]`Performance tip: Handsontable rendered more than 1000 visible rows.\x20
- Consider limiting the number of rendered rows by specifying the table height and/or\x20
- turning off the "renderAllRows" option.`)),this.table.isAriaEnabled()&&Object(r["setAttribute"])(this.rootNode,[Object(He["C"])()]),this.orderView.setSize(e).setOffset(this.table.renderedRowToSource(0)).start();for(let i=0;i<e;i++){this.orderView.render();const e=this.orderView.getCurrentNode(),o=this.table.renderedRowToSource(i);var t,n;if(this.table.isAriaEnabled())Object(r["setAttribute"])(e,[Object(He["A"])(),Object(He["E"])(o+(null!==(t=null===(n=this.table.rowUtils)||void 0===n||null===(n=n.dataAccessObject)||void 0===n?void 0:n.columnHeaders.length)&&void 0!==t?t:0)+1)])}this.orderView.end()}}function Qe(e,t,n){return t=Ze(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ze(e){var t=Je(e,"string");return"symbol"==typeof t?t:t+""}function Je(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 et extends je{constructor(){super("TD"),Qe(this,"orderViews",new WeakMap),Qe(this,"sourceRowIndex",0)}obtainOrderView(e){let t;return this.orderViews.has(e)?t=this.orderViews.get(e):(t=new Ae(e,e=>this.nodesPool.obtain(this.sourceRowIndex,e),this.nodeType),this.orderViews.set(e,t)),t}render(){const{rowsToRender:e,columnsToRender:t,rows:n,rowHeaders:i}=this.table;for(let a=0;a<e;a++){const e=this.table.renderedRowToSource(a),l=n.getRenderedNode(a);this.sourceRowIndex=e;const c=this.obtainOrderView(l),h=i.obtainOrderView(l);c.prependView(h).setSize(t).setOffset(this.table.renderedColumnToSource(0)).start();for(let n=0;n<t;n++){c.render();const t=c.getCurrentNode(),i=this.table.renderedColumnToSource(n);var o,s;if(Object(r["hasClass"])(t,"hide")||(t.className=""),t.removeAttribute("style"),t.removeAttribute("dir"),Object(r["removeAttribute"])(t,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.cellRenderer(e,i,t),this.table.isAriaEnabled())Object(r["setAttribute"])(t,[...t.hasAttribute("role")?[]:[Object(He["l"])()],Object(He["K"])(-1),Object(He["f"])(i+(null!==(o=null===(s=this.table.rowUtils)||void 0===s||null===(s=s.dataAccessObject)||void 0===s?void 0:s.rowHeaders.length)&&void 0!==o?o:0)+1)])}c.end()}}}function tt(e,t,n){return t=nt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nt(e){var t=rt(e,"string");return"symbol"==typeof t?t:t+""}function rt(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 it{constructor(e){let{cellRenderer:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};tt(this,"rootNode",void 0),tt(this,"rootDocument",void 0),tt(this,"rowHeaders",null),tt(this,"columnHeaders",null),tt(this,"colGroup",null),tt(this,"rows",null),tt(this,"cells",null),tt(this,"rowFilter",null),tt(this,"columnFilter",null),tt(this,"rowUtils",null),tt(this,"columnUtils",null),tt(this,"rowsToRender",0),tt(this,"columnsToRender",0),tt(this,"rowHeaderFunctions",[]),tt(this,"rowHeadersCount",0),tt(this,"columnHeaderFunctions",[]),tt(this,"columnHeadersCount",0),tt(this,"cellRenderer",void 0),this.rootNode=e,this.rootDocument=this.rootNode.ownerDocument,this.cellRenderer=t}setAxisUtils(e,t){this.rowUtils=e,this.columnUtils=t}setViewportSize(e,t){this.rowsToRender=e,this.columnsToRender=t}setFilters(e,t){this.rowFilter=e,this.columnFilter=t}setHeaderContentRenderers(e,t){this.rowHeaderFunctions=e,this.rowHeadersCount=e.length,this.columnHeaderFunctions=t,this.columnHeadersCount=t.length}setRenderers(){let{rowHeaders:e,columnHeaders:t,colGroup:n,rows:r,cells:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.setTable(this),t.setTable(this),n.setTable(this),r.setTable(this),i.setTable(this),this.rowHeaders=e,this.columnHeaders=t,this.colGroup=n,this.rows=r,this.cells=i}renderedRowToSource(e){return this.rowFilter.renderedToSource(e)}renderedColumnToSource(e){return this.columnFilter.renderedToSource(e)}isAriaEnabled(){return this.rowUtils.wtSettings.getSetting("ariaTags")}render(){this.colGroup.adjust(),this.columnHeaders.adjust(),this.rows.adjust(),this.rowHeaders.adjust(),this.columnHeaders.render(),this.rows.render(),this.rowHeaders.render(),this.cells.render(),this.columnUtils.calculateWidths(),this.colGroup.render();const{rowsToRender:e,rows:t}=this;for(let n=0;n<e;n++){const e=t.getRenderedNode(n);if(e.firstChild){const t=this.renderedRowToSource(n),r=this.rowUtils.getHeight(t);e.firstChild.style.height=r?r-1+"px":""}}}}class ot{constructor(){let{TABLE:e,THEAD:t,COLGROUP:n,TBODY:r,rowUtils:i,columnUtils:o,cellRenderer:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.renderer=new it(e,{cellRenderer:s}),this.renderer.setRenderers({rowHeaders:new Ve,columnHeaders:new Be(t),colGroup:new ze(n),rows:new qe(r),cells:new et}),this.renderer.setAxisUtils(i,o)}setFilters(e,t){return this.renderer.setFilters(e,t),this}setViewportSize(e,t){return this.renderer.setViewportSize(e,t),this}setHeaderContentRenderers(e,t){return this.renderer.setHeaderContentRenderers(e,t),this}adjust(){this.renderer.adjust()}render(){this.renderer.render()}}function st(e,t,n){at(e,t),t.set(e,n)}function at(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function lt(e,t,n){return t=ct(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ct(e){var t=ht(e,"string");return"symbol"==typeof t?t:t+""}function ht(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 ut(e,t){return e.get(pt(e,t))}function dt(e,t,n){return e.set(pt(e,t),n),n}function pt(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 ft=new WeakMap,gt=new WeakMap,mt=new WeakMap,yt=new WeakMap,wt=new WeakMap;class bt{static get DEFAULT_WIDTH(){return 50}constructor(e){let{totalColumns:t,stretchMode:n,stretchingColumnWidthFn:r,columnWidthFn:i}=e;lt(this,"stretchAllRatio",0),lt(this,"stretchLastWidth",0),lt(this,"stretchAllColumnsWidth",[]),st(this,ft,0),lt(this,"needVerifyLastColumnWidth",!0),st(this,gt,()=>0),st(this,mt,e=>e),st(this,yt,e=>e),st(this,wt,()=>"none"),dt(gt,this,t),dt(wt,this,n),dt(mt,this,null!==r&&void 0!==r?r:ut(mt,this)),dt(yt,this,null!==i&&void 0!==i?i:ut(yt,this))}refreshStretching(e){if("none"===ut(wt,this).call(this))return;dt(ft,this,e);let t=0;for(let r=0;r<ut(gt,this).call(this);r++){const n=this._getColumnWidth(r),i=ut(mt,this).call(this,void 0,r);"number"===typeof i?e-=i:t+=n}const n=e-t;if("all"===ut(wt,this).call(this)&&n>0)this.stretchAllRatio=e/t,this.stretchAllColumnsWidth=[],this.needVerifyLastColumnWidth=!0;else if("last"===ut(wt,this).call(this)&&e!==1/0){const e=this._getColumnWidth(ut(gt,this).call(this)-1),t=n+e;this.stretchLastWidth=t>=0?t:e}}getStretchedColumnWidth(e,t){let n=null;return"all"===ut(wt,this).call(this)&&0!==this.stretchAllRatio?n=this._getStretchedAllColumnWidth(e,t):"last"===ut(wt,this).call(this)&&0!==this.stretchLastWidth&&(n=this._getStretchedLastColumnWidth(e)),n}_getStretchedAllColumnWidth(e,t){let n=0;if(!this.stretchAllColumnsWidth[e]){const n=Math.round(t*this.stretchAllRatio),r=ut(mt,this).call(this,n,e);this.stretchAllColumnsWidth[e]=void 0===r?n:isNaN(r)?this._getColumnWidth(e):r}if(this.stretchAllColumnsWidth.length===ut(gt,this).call(this)&&this.needVerifyLastColumnWidth){this.needVerifyLastColumnWidth=!1;for(let e=0;e<this.stretchAllColumnsWidth.length;e++)n+=this.stretchAllColumnsWidth[e];n!==ut(ft,this)&&(this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length-1]+=ut(ft,this)-n)}return this.stretchAllColumnsWidth[e]}_getStretchedLastColumnWidth(e){return e===ut(gt,this).call(this)-1?this.stretchLastWidth:null}_getColumnWidth(e){let t=ut(yt,this).call(this,e);return isNaN(t)&&(t=bt.DEFAULT_WIDTH),t}}function vt(e,t,n){return t=Et(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Et(e){var t=Ct(e,"string");return"symbol"==typeof t?t:t+""}function Ct(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 St{constructor(e,t){vt(this,"dataAccessObject",void 0),vt(this,"wtSettings",void 0),vt(this,"headerWidths",new Map),vt(this,"stretching",void 0),this.dataAccessObject=e,this.wtSettings=t,this.stretching=new bt({totalColumns:()=>this.wtSettings.getSetting("totalColumns"),stretchMode:()=>this.wtSettings.getSetting("stretchH"),stretchingColumnWidthFn:(e,t)=>this.wtSettings.getSetting("onBeforeStretchingColumnWidth",e,t),columnWidthFn:e=>this.dataAccessObject.wtTable.getColumnWidth(e)})}getWidth(e){return this.wtSettings.getSetting("columnWidth",e)||this.wtSettings.getSetting("defaultColumnWidth")}getStretchedColumnWidth(e){let t=this.getWidth(e);const n=this.stretching.getStretchedColumnWidth(e,t);return n&&(t=n),t}getHeaderHeight(e){let t=this.wtSettings.getSetting("defaultRowHeight");const n=this.dataAccessObject.wtViewport.oversizedColumnHeaders[e];return void 0!==n&&(t=t?Math.max(t,n):n),t}getHeaderWidth(e){return this.headerWidths.get(this.dataAccessObject.wtTable.columnFilter.sourceToRendered(e))}refreshStretching(){const{wtTable:e,wtViewport:t,cloneSource:n}=this.dataAccessObject,i=n?n.wtTable.holder:e.holder,o=i.offsetHeight<i.scrollHeight?Object(r["getScrollbarWidth"])():0;this.stretching.refreshStretching(t.getViewportWidth()-o)}calculateWidths(){const{wtSettings:e}=this;let t=e.getSetting("rowHeaderWidth");if(this.refreshStretching(),t=e.getSetting("onModifyRowHeaderWidth",t),null!==t&&void 0!==t){const n=e.getSetting("rowHeaders").length,r=e.getSetting("defaultColumnWidth");for(let e=0;e<n;e++){let n=Array.isArray(t)?t[e]:t;n=null===n||void 0===n?r:n,this.headerWidths.set(e,n)}}}}function Rt(e,t,n){return t=Tt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tt(e){var t=Ot(e,"string");return"symbol"==typeof t?t:t+""}function Ot(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 Nt{constructor(e,t){Rt(this,"dataAccessObject",void 0),Rt(this,"wtSettings",void 0),this.dataAccessObject=e,this.wtSettings=t}getHeight(e){let t=this.wtSettings.getSetting("rowHeight",e);const n=this.dataAccessObject.wtViewport.oversizedRows[e];return void 0!==n&&(t=void 0===t?n:Math.max(t,n)),t}}const At="top",It="bottom",Mt="inline_start",xt="top_inline_start_corner",_t="bottom_inline_start_corner",Lt=[At,It,Mt,xt,_t],Pt=new Map([[At,"ht_clone_"+At],[It,"ht_clone_"+It],[Mt,`ht_clone_${Mt} ht_clone_left`],[xt,`ht_clone_${xt} ht_clone_top_left_corner`],[_t,`ht_clone_${_t} ht_clone_bottom_left_corner`]]);function kt(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=Ht(e,"string");return"symbol"==typeof t?t:t+""}function Ht(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 Dt{constructor(e,t,n,i,o){kt(this,"wtSettings",null),kt(this,"domBindings",void 0),kt(this,"TBODY",null),kt(this,"THEAD",null),kt(this,"COLGROUP",null),kt(this,"hasTableHeight",!0),kt(this,"hasTableWidth",!0),kt(this,"isTableVisible",!1),kt(this,"tableOffset",0),kt(this,"holderOffset",0),this.domBindings=n,this.isMaster="master"===o,this.name=o,this.dataAccessObject=e,this.facadeGetter=t,this.wtSettings=i,this.instance=this.dataAccessObject.wot,this.wot=this.dataAccessObject.wot,this.TABLE=n.rootTable,Object(r["removeTextNodes"])(this.TABLE),this.spreader=this.createSpreader(this.TABLE),this.hider=this.createHider(this.spreader),this.holder=this.createHolder(this.hider),this.wtRootElement=this.holder.parentNode,this.isMaster&&this.alignOverlaysWithTrimmingContainer(),this.fixTableDomTree(),this.rowFilter=null,this.columnFilter=null,this.correctHeaderWidth=!1;const s=this.wtSettings.getSettingPure("rowHeaderWidth");this.wtSettings.update("rowHeaderWidth",()=>this._modifyRowHeaderWidth(s)),this.rowUtils=new Nt(this.dataAccessObject,this.wtSettings),this.columnUtils=new St(this.dataAccessObject,this.wtSettings),this.tableRenderer=new ot({TABLE:this.TABLE,THEAD:this.THEAD,COLGROUP:this.COLGROUP,TBODY:this.TBODY,rowUtils:this.rowUtils,columnUtils:this.columnUtils,cellRenderer:this.wtSettings.getSettingPure("cellRenderer")})}is(e){return this.name===e}fixTableDomTree(){const e=this.domBindings.rootDocument;this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=e.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=e.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=e.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD))}createSpreader(e){const t=e.parentNode;let n;return t&&t.nodeType===Node.ELEMENT_NODE&&Object(r["hasClass"])(t,"wtHolder")||(n=this.domBindings.rootDocument.createElement("div"),n.className="wtSpreader",t&&t.insertBefore(n,e),n.appendChild(e)),n.style.position="relative",this.wtSettings.getSetting("ariaTags")&&Object(r["setAttribute"])(n,[Object(He["x"])()]),n}createHider(e){const t=e.parentNode;let n;return t&&t.nodeType===Node.ELEMENT_NODE&&Object(r["hasClass"])(t,"wtHolder")||(n=this.domBindings.rootDocument.createElement("div"),n.className="wtHider",t&&t.insertBefore(n,e),n.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Object(r["setAttribute"])(n,[Object(He["x"])()]),n}createHolder(e){const t=e.parentNode;let n;return t&&t.nodeType===Node.ELEMENT_NODE&&Object(r["hasClass"])(t,"wtHolder")||(n=this.domBindings.rootDocument.createElement("div"),n.style.position="relative",n.className="wtHolder",t&&t.insertBefore(n,e),this.isMaster&&(n.parentNode.className+="ht_master handsontable",n.parentNode.setAttribute("dir",this.wtSettings.getSettingPure("rtlMode")?"rtl":"ltr"),this.wtSettings.getSetting("ariaTags")&&Object(r["setAttribute"])(n.parentNode,[Object(He["x"])()])),n.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&Object(r["setAttribute"])(n,[Object(He["x"])()]),n}draw(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{wtSettings:t}=this,{wtOverlays:n,wtViewport:i}=this.dataAccessObject,o=t.getSetting("totalRows"),s=t.getSetting("totalColumns"),a=t.getSetting("rowHeaders"),l=a.length,c=t.getSetting("columnHeaders"),h=c.length;let u=!1,d=e;if(this.isMaster&&(this.holderOffset=Object(r["offset"])(this.holder),d=i.createRenderCalculators(d),l&&!t.getSetting("fixedColumnsStart"))){const e=n.inlineStartOverlay.getScrollPosition(),t=this.correctHeaderWidth;this.correctHeaderWidth=0!==e,t!==this.correctHeaderWidth&&(d=!1)}if(this.isMaster&&(u=n.updateStateOfRendering()),d)this.isMaster&&(i.createVisibleCalculators(),i.createPartiallyVisibleCalculators()),n&&n.refresh(!0);else{this.isMaster?this.tableOffset=Object(r["offset"])(this.TABLE):this.tableOffset=this.dataAccessObject.parentTableOffset;const e=o>0?this.getFirstRenderedRow():0,t=s>0?this.getFirstRenderedColumn():0;this.rowFilter=new de(e,o,h),this.columnFilter=new ae(t,s,l);let n=!0;if(this.isMaster){this.alignOverlaysWithTrimmingContainer();const e={};this.wtSettings.getSetting("beforeDraw",!0,e),n=!0!==e.skipRender}if(n){let e;if(this.tableRenderer.setHeaderContentRenderers(a,c),(this.is(It)||this.is(_t))&&this.tableRenderer.setHeaderContentRenderers(a,[]),this.resetOversizedRows(),this.tableRenderer.setViewportSize(this.getRenderedRowsCount(),this.getRenderedColumnsCount()).setFilters(this.rowFilter,this.columnFilter).render(),this.isMaster&&(e=this.dataAccessObject.workspaceWidth,this.dataAccessObject.wtViewport.containerWidth=null,this.markOversizedColumnHeaders()),this.adjustColumnHeaderHeights(),(this.isMaster||this.is(It))&&this.markOversizedRows(),this.isMaster){this.dataAccessObject.wtViewport.createVisibleCalculators(),this.dataAccessObject.wtViewport.createPartiallyVisibleCalculators(),this.dataAccessObject.wtOverlays.refresh(!1),this.dataAccessObject.wtOverlays.applyToDOM();const t=Object(r["outerWidth"])(this.hider),n=Object(r["outerWidth"])(this.TABLE);0!==t&&n!==t&&(this.columnUtils.calculateWidths(),this.tableRenderer.renderer.colGroup.render()),e!==this.dataAccessObject.wtViewport.getWorkspaceWidth()&&(this.dataAccessObject.wtViewport.containerWidth=null,this.columnUtils.calculateWidths(),this.tableRenderer.renderer.colGroup.render()),this.wtSettings.getSetting("onDraw",!0)}else this.is(It)&&this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize()}}let p=!1;return this.isMaster&&(p=n.topOverlay.resetFixedPosition(),n.bottomOverlay.clone&&(p=n.bottomOverlay.resetFixedPosition()||p),p=n.inlineStartOverlay.resetFixedPosition()||p,n.topInlineStartCornerOverlay&&n.topInlineStartCornerOverlay.resetFixedPosition(),n.bottomInlineStartCornerOverlay&&n.bottomInlineStartCornerOverlay.clone&&n.bottomInlineStartCornerOverlay.resetFixedPosition()),p?(n.refreshAll(),n.adjustElementsSize()):this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(d),u&&n.syncScrollWithMaster(),this.dataAccessObject.drawn=!0,this}markIfOversizedColumnHeader(e){const t=this.columnFilter.renderedToSource(e);let n=this.wtSettings.getSetting("columnHeaders").length;const i=this.wtSettings.getSetting("defaultRowHeight");let o,s,a;const l=this.wtSettings.getSetting("columnHeaderHeight")||[];while(n)n-=1,o=this.getColumnHeaderHeight(n),s=this.getColumnHeader(t,n),s&&(a=Object(r["innerHeight"])(s),(!o&&i<a||o<a)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=a),Array.isArray(l)?null!==l[n]&&void 0!==l[n]&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=l[n]):isNaN(l)||(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=l),this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]<(l[n]||l)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[n]=l[n]||l))}adjustColumnHeaderHeights(){const{wtSettings:e}=this,t=this.THEAD.childNodes,n=this.dataAccessObject.wtViewport.oversizedColumnHeaders,r=e.getSetting("columnHeaders");for(let i=0,o=r.length;i<o;i++)if(n[i]){if(!t[i]||0===t[i].childNodes.length)return;t[i].childNodes[0].style.height=n[i]+"px"}}resetOversizedRows(){const{wtSettings:e}=this,{wtViewport:t}=this.dataAccessObject;if((this.isMaster||this.is(It))&&!e.getSetting("externalRowCalculator")){const e=this.getRenderedRowsCount();for(let n=0;n<e;n++){const e=this.rowFilter.renderedToSource(n);t.oversizedRows&&t.oversizedRows[e]&&(t.oversizedRows[e]=void 0)}}}getCell(e){let t=e.row,n=e.col;const r=this.wtSettings.getSetting("onModifyGetCellCoords",t,n);if(r&&Array.isArray(r)&&([t,n]=r),this.isRowBeforeRenderedRows(t))return-1;if(this.isRowAfterRenderedRows(t))return-2;if(this.isColumnBeforeRenderedColumns(n))return-3;if(this.isColumnAfterRenderedColumns(n))return-4;const i=this.getRow(t);if(!i&&t>=0)throw new Error("TR was expected to be rendered but is not");const o=i.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(n)];if(!o&&n>=0)throw new Error("TD or TH was expected to be rendered but is not");return o}getRow(e){let t=null,n=null;var r,i;e<0?(t=null===(r=this.rowFilter)||void 0===r?void 0:r.sourceRowToVisibleColHeadedRow(e),n=this.THEAD):(t=null===(i=this.rowFilter)||void 0===i?void 0:i.sourceToRendered(e),n=this.TBODY);return void 0!==t&&void 0!==n&&(!(n.childNodes.length<t+1)&&n.childNodes[t])}getColumnHeader(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.THEAD.childNodes[t];return null===n||void 0===n?void 0:n.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]}getColumnHeaders(e){const t=[],n=this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e);return this.THEAD.childNodes.forEach(e=>{const r=e.childNodes[n];r&&t.push(r)}),t}getRowHeader(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.wtSettings.getSetting("rowHeaders").length;if(t>=n)return;const r=this.rowFilter.sourceToRendered(e),i=r<0?this.rowFilter.sourceRowToVisibleColHeadedRow(e):r,o=r<0?this.THEAD:this.TBODY,s=o.childNodes[i];return null===s||void 0===s?void 0:s.childNodes[t]}getRowHeaders(e){const t=[],n=this.wtSettings.getSetting("rowHeaders").length;for(let r=0;r<n;r++){const n=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)],i=null===n||void 0===n?void 0:n.childNodes[r];i&&t.push(i)}return t}getCoords(e){let t=e;if("TD"!==t.nodeName&&"TH"!==t.nodeName&&(t=Object(r["closest"])(t,["TD","TH"])),null===t)return null;const n=t.parentNode,i=n.parentNode;let o=Object(r["index"])(n),s=t.cellIndex;if(Object(r["overlayContainsElement"])(xt,t,this.wtRootElement)||Object(r["overlayContainsElement"])(At,t,this.wtRootElement))"THEAD"===i.nodeName&&(o-=i.childNodes.length);else if(Object(r["overlayContainsElement"])(_t,t,this.wtRootElement)||Object(r["overlayContainsElement"])(It,t,this.wtRootElement)){const e=this.wtSettings.getSetting("totalRows");o=e-i.childNodes.length+o}else o=i===this.THEAD?this.rowFilter.visibleColHeadedRowToSourceRow(o):this.rowFilter.renderedToSource(o);return s=Object(r["overlayContainsElement"])(xt,t,this.wtRootElement)||Object(r["overlayContainsElement"])(Mt,t,this.wtRootElement)||Object(r["overlayContainsElement"])(_t,t,this.wtRootElement)?this.columnFilter.offsettedTH(s):this.columnFilter.visibleRowHeadedColumnToSourceColumn(s),this.wot.createCellCoords(o,s)}markOversizedRows(){if(this.wtSettings.getSetting("externalRowCalculator"))return;let e=this.TBODY.childNodes.length;const t=e*this.wtSettings.getSetting("defaultRowHeight"),n=Object(r["innerHeight"])(this.TBODY)-1;let i,o,s,a,l;if(t!==n||this.wtSettings.getSetting("fixedRowsBottom"))while(e)e-=1,s=this.rowFilter.renderedToSource(e),i=this.getRowHeight(s),a=this.getTrForRow(s),l=a.querySelector("th"),o=l?Object(r["innerHeight"])(l):Object(r["innerHeight"])(a)-1,(!i&&this.wtSettings.getSetting("defaultRowHeight")<o||i<o)&&(o+=1,this.dataAccessObject.wtViewport.oversizedRows[s]=o)}getTrForRow(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]}isColumnHeaderRendered(e){if(e>=0)return!1;const t=this.wtSettings.getSetting("rowHeaders"),n=t.length;return Math.abs(e)<=n}isRowHeaderRendered(e){if(e>=0)return!1;const t=this.wtSettings.getSetting("columnHeaders"),n=t.length;return Math.abs(e)<=n}isRowBeforeRenderedRows(e){const t=this.getFirstRenderedRow();return e<0&&t<=0?!this.isRowHeaderRendered(e):e<t}isRowAfterRenderedRows(e){return e>this.getLastRenderedRow()}isColumnBeforeRenderedColumns(e){const t=this.getFirstRenderedColumn();return e<0&&t<=0?!this.isColumnHeaderRendered(e):e<t}isColumnAfterRenderedColumns(e){return this.columnFilter&&e>this.getLastRenderedColumn()}isColumnAfterViewport(e){return this.columnFilter&&e>this.getLastVisibleColumn()}isRowAfterViewport(e){return this.rowFilter&&e>this.getLastVisibleRow()}isColumnBeforeViewport(e){return this.columnFilter&&this.columnFilter.sourceToRendered(e)<0&&e>=0}isLastRowFullyVisible(){return this.getLastVisibleRow()===this.getLastRenderedRow()}isLastColumnFullyVisible(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()}allRowsInViewport(){return this.wtSettings.getSetting("totalRows")===this.getVisibleRowsCount()}allColumnsInViewport(){return this.wtSettings.getSetting("totalColumns")===this.getVisibleColumnsCount()}getRowHeight(e){return this.rowUtils.getHeight(e)}getColumnHeaderHeight(e){return this.columnUtils.getHeaderHeight(e)}getColumnWidth(e){return this.columnUtils.getWidth(e)}getStretchedColumnWidth(e){return this.columnUtils.getStretchedColumnWidth(e)}hasDefinedSize(){return this.hasTableHeight&&this.hasTableWidth}getWidth(){return Object(r["outerWidth"])(this.TABLE)}getHeight(){return Object(r["outerHeight"])(this.TABLE)}getTotalWidth(){const e=Object(r["outerWidth"])(this.hider);return 0!==e?e:this.getWidth()}getTotalHeight(){const e=Object(r["outerHeight"])(this.hider);return 0!==e?e:this.getHeight()}isVisible(){return Object(r["isVisible"])(this.TABLE)}_modifyRowHeaderWidth(e){let t=Object(i["isFunction"])(e)?e():null;return Array.isArray(t)?(t=[...t],t[t.length-1]=this._correctRowHeaderWidth(t[t.length-1])):t=this._correctRowHeaderWidth(t),t}_correctRowHeaderWidth(e){let t=e;return"number"!==typeof e&&(t=this.wtSettings.getSetting("defaultColumnWidth")),this.correctHeaderWidth&&(t+=1),t}}var Ft=Dt;const Ut="stickyRowsTop",Vt={getFirstRenderedRow(){const e=this.wtSettings.getSetting("totalRows");return 0===e?-1:0},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){const e=this.wtSettings.getSetting("totalRows");return Math.min(this.wtSettings.getSetting("fixedRowsTop"),e)},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};Object(c["defineGetter"])(Vt,"MIXIN_NAME",Ut,{writable:!1,enumerable:!1});var Bt=Vt;const Wt="calculatedColumns",Gt={getFirstRenderedColumn(){const e=this.dataAccessObject.startColumnRendered;return null===e?-1:e},getFirstVisibleColumn(){const e=this.dataAccessObject.startColumnVisible;return null===e?-1:e},getFirstPartiallyVisibleColumn(){const e=this.dataAccessObject.startColumnPartiallyVisible;return null===e?-1:e},getLastRenderedColumn(){const e=this.dataAccessObject.endColumnRendered;return null===e?-1:e},getLastVisibleColumn(){const e=this.dataAccessObject.endColumnVisible;return null===e?-1:e},getLastPartiallyVisibleColumn(){const e=this.dataAccessObject.endColumnPartiallyVisible;return null===e?-1:e},getRenderedColumnsCount(){return this.dataAccessObject.countColumnsRendered},getVisibleColumnsCount(){return this.dataAccessObject.countColumnsVisible},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};Object(c["defineGetter"])(Gt,"MIXIN_NAME",Wt,{writable:!1,enumerable:!1});var zt=Gt;class Yt extends Ft{constructor(e,t,n,r){super(e,t,n,r,At)}}Object(c["mixin"])(Yt,Bt),Object(c["mixin"])(Yt,zt);var Xt=Yt;function Kt(e,t){$t(e,t),t.add(e)}function $t(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qt(e,t,n){return t=Qt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qt(e){var t=Zt(e,"string");return"symbol"==typeof t?t:t+""}function Zt(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 Jt(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 en=new WeakSet;class tn{constructor(e){Kt(this,en),qt(this,"dataAccessObject",void 0),this.dataAccessObject=e}scrollViewport(e,t,n,r,i){const o=this.scrollViewportHorizontally(e.col,n,i),s=this.scrollViewportVertically(e.row,t,r);return o||s}scrollViewportHorizontally(e,t,n){const{drawn:r,totalColumns:i}=this.dataAccessObject;if(!r||!Number.isInteger(e)||e<0||e>i)return!1;const o=void 0===t&&void 0===n,{fixedColumnsStart:s,inlineStartOverlay:a}=this.dataAccessObject;if(o&&e<s)return!1;if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollHorizontally",e),!Number.isInteger(e)||e<0||e>i)return!1;const l=this.getFirstVisibleColumn(),c=this.getLastVisibleColumn();let h=!1;return(o&&(e<l||e>c)||!o)&&(h=a.scrollTo(e,o?e>=this.getLastPartiallyVisibleColumn():t)),h}scrollViewportVertically(e,t,n){const{drawn:r,totalRows:i}=this.dataAccessObject;if(!r||!Number.isInteger(e)||e<0||e>i)return!1;const o=void 0===t&&void 0===n,{fixedRowsBottom:s,fixedRowsTop:a,topOverlay:l}=this.dataAccessObject;if(o&&(e<a||e>i-s-1))return!1;if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollVertically",e),!Number.isInteger(e)||e<0||e>i)return!1;const c=this.getFirstVisibleRow(),h=this.getLastVisibleRow();let u=!1;return(o&&(e<c||e>h)||!o)&&(u=l.scrollTo(e,o?e>=this.getLastPartiallyVisibleRow():n)),u}getFirstVisibleRow(){return this.dataAccessObject.wtTable.getFirstVisibleRow()}getLastVisibleRow(){return Jt(en,this,rn).call(this,this.dataAccessObject.wtTable.getLastVisibleRow())}getFirstPartiallyVisibleRow(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow()}getLastPartiallyVisibleRow(){return Jt(en,this,rn).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleRow())}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){return Jt(en,this,nn).call(this,this.dataAccessObject.wtTable.getLastVisibleColumn())}getFirstPartiallyVisibleColumn(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn()}getLastPartiallyVisibleColumn(){return Jt(en,this,nn).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn())}}function nn(e){const{wtSettings:t,inlineStartOverlay:n,wtTable:i,wtViewport:o,totalColumns:s,rootWindow:a}=this.dataAccessObject;if(n.mainTableScrollableElement===a){const l=t.getSetting("rtlMode");let c=null;if(l){const e=i.TABLE.getBoundingClientRect(),t=this.dataAccessObject.rootWindow.document,n=t.documentElement.offsetWidth;c=Math.abs(e.right-n)}else{const e=Object(r["offset"])(i.wtRootElement);c=e.left}const h=Math.abs(Object(r["getScrollLeft"])(a,a));if(c>h){const t=Object(r["innerWidth"])(a);let i=o.getRowHeaderWidth();for(let r=1;r<=s;r++)if(i+=n.sumCellSizes(r-1,r),c+i-h>=t){e=r-2;break}}}return e}function rn(e){const{topOverlay:t,wtTable:n,wtViewport:i,totalRows:o,rootWindow:s}=this.dataAccessObject;if(t.mainTableScrollableElement===s){const a=Object(r["offset"])(n.wtRootElement),l=Object(r["getScrollTop"])(s,s);if(a.top>l){const n=Object(r["innerHeight"])(s);let c=i.getColumnHeaderHeight();for(let r=1;r<=o;r++)if(c+=t.sumCellSizes(r-1,r),a.top+c-l>=n){e=r-2;break}}}return e}var on=tn,sn=n("0716"),an=n("d852");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)}class un{get eventManager(){return new l["a"](this)}constructor(e,t){ln(this,"wtTable",void 0),ln(this,"wtScroll",void 0),ln(this,"wtViewport",void 0),ln(this,"wtOverlays",void 0),ln(this,"selectionManager",void 0),ln(this,"wtEvent",void 0),ln(this,"guid","wt_"+Object(k["randomString"])()),ln(this,"drawInterrupted",!1),ln(this,"drawn",!1),ln(this,"domBindings",void 0),ln(this,"wtSettings",void 0),this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView},this.wtSettings=t,this.wtScroll=new on(this.createScrollDao())}findOriginalHeaders(){const e=[];if(this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(let t=0,n=this.wtTable.THEAD.childNodes[0].childNodes.length;t<n;t++)e.push(this.wtTable.THEAD.childNodes[0].childNodes[t].innerHTML);this.wtSettings.getSetting("columnHeaders").length||this.wtSettings.update("columnHeaders",[function(t,n){Object(r["fastInnerText"])(n,e[t])}])}}createCellCoords(e,t){return new sn["a"](e,t,this.wtSettings.getSetting("rtlMode"))}createCellRange(e,t,n){return new an["a"](e,t,n,this.wtSettings.getSetting("rtlMode"))}draw(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.drawInterrupted=!1,e||this.wtTable.isVisible()?this.wtTable.draw(e):this.drawInterrupted=!0,this}getCell(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)return this.wtTable.getCell(e);const n=this.wtSettings.getSetting("totalRows"),r=this.wtSettings.getSetting("fixedRowsTop"),i=this.wtSettings.getSetting("fixedRowsBottom"),o=this.wtSettings.getSetting("fixedColumnsStart");if(e.row<r&&e.col<o)return this.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.getCell(e);if(e.row<r)return this.wtOverlays.topOverlay.clone.wtTable.getCell(e);if(e.col<o&&e.row>=n-i){if(this.wtOverlays.bottomInlineStartCornerOverlay&&this.wtOverlays.bottomInlineStartCornerOverlay.clone)return this.wtOverlays.bottomInlineStartCornerOverlay.clone.wtTable.getCell(e)}else{if(e.col<o)return this.wtOverlays.inlineStartOverlay.clone.wtTable.getCell(e);if(e.row<n&&e.row>=n-i&&this.wtOverlays.bottomOverlay&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)}scrollViewport(e,t,n,r,i){return!(e.col<0||e.row<0)&&this.wtScroll.scrollViewport(e,t,n,r,i)}scrollViewportHorizontally(e,t,n){return!(e<0)&&this.wtScroll.scrollViewportHorizontally(e,t,n)}scrollViewportVertically(e,t,n){return!(e<0)&&this.wtScroll.scrollViewportVertically(e,t,n)}getViewport(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]}destroy(){this.wtOverlays.destroy(),this.wtEvent.destroy()}createScrollDao(){const e=this;return{get drawn(){return e.drawn},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get wtTable(){return e.wtTable},get wtViewport(){return e.wtViewport},get wtSettings(){return e.wtSettings},get rootWindow(){return e.domBindings.rootWindow},get totalRows(){return e.wtSettings.getSetting("totalRows")},get totalColumns(){return e.wtSettings.getSetting("totalColumns")},get fixedRowsTop(){return e.wtSettings.getSetting("fixedRowsTop")},get fixedRowsBottom(){return e.wtSettings.getSetting("fixedRowsBottom")},get fixedColumnsStart(){return e.wtSettings.getSetting("fixedColumnsStart")}}}getTableDao(){const e=this;return{get wot(){return e},get parentTableOffset(){return e.cloneSource.wtTable.tableOffset},get cloneSource(){return e.cloneSource},get workspaceWidth(){return e.wtViewport.getWorkspaceWidth()},get wtViewport(){return e.wtViewport},get wtOverlays(){return e.wtOverlays},get selectionManager(){return e.selectionManager},get drawn(){return e.drawn},set drawn(t){e.drawn=t},get wtTable(){return e.wtTable},get startColumnRendered(){return e.wtViewport.columnsRenderCalculator.startColumn},get startColumnVisible(){return e.wtViewport.columnsVisibleCalculator.startColumn},get startColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.startColumn},get endColumnRendered(){return e.wtViewport.columnsRenderCalculator.endColumn},get endColumnVisible(){return e.wtViewport.columnsVisibleCalculator.endColumn},get endColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.endColumn},get countColumnsRendered(){return e.wtViewport.columnsRenderCalculator.count},get countColumnsVisible(){return e.wtViewport.columnsVisibleCalculator.count},get startRowRendered(){return e.wtViewport.rowsRenderCalculator.startRow},get startRowVisible(){return e.wtViewport.rowsVisibleCalculator.startRow},get startRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.startRow},get endRowRendered(){return e.wtViewport.rowsRenderCalculator.endRow},get endRowVisible(){return e.wtViewport.rowsVisibleCalculator.endRow},get endRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.endRow},get countRowsRendered(){return e.wtViewport.rowsRenderCalculator.count},get countRowsVisible(){return e.wtViewport.rowsVisibleCalculator.count},get columnHeaders(){return e.wtSettings.getSetting("columnHeaders")},get rowHeaders(){return e.wtSettings.getSetting("rowHeaders")}}}}function dn(e,t,n){return t=pn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pn(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)}class gn extends un{constructor(e,t,n){super(e,t),dn(this,"cloneSource",void 0),dn(this,"cloneOverlay",void 0);const r=this.wtSettings.getSetting("facade",this);this.cloneSource=n.source,this.cloneOverlay=n.overlay,this.wtTable=this.cloneOverlay.createTable(this.getTableDao(),r,this.domBindings,this.wtSettings),this.wtViewport=n.viewport,this.selectionManager=n.selectionManager,this.wtEvent=new te(r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,n.event),this.findOriginalHeaders()}}function mn(e,t,n){return t=yn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yn(e){var t=wn(e,"string");return"symbol"==typeof t?t:t+""}function wn(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 bn{constructor(e,t,n,i,o){mn(this,"wtSettings",null),Object(c["defineGetter"])(this,"wot",e,{writable:!1}),this.domBindings=o,this.facadeGetter=t,this.wtSettings=i;const{TABLE:s,hider:a,spreader:l,holder:h,wtRootElement:u}=this.wot.wtTable;this.instance=this.wot,this.type=n,this.mainTableScrollableElement=null,this.TABLE=s,this.hider=a,this.spreader=l,this.holder=h,this.wtRootElement=u,this.trimmingContainer=Object(r["getTrimmingContainer"])(this.hider.parentNode.parentNode),this.updateStateOfRendering(),this.clone=this.makeClone()}updateStateOfRendering(){const e=this.needFullRender;this.needFullRender=this.shouldBeRendered();const t=e!==this.needFullRender;return t&&!this.needFullRender&&this.reset(),t}shouldBeRendered(){return!0}updateTrimmingContainer(){this.trimmingContainer=Object(r["getTrimmingContainer"])(this.hider.parentNode.parentNode)}updateMainScrollableElement(){const{wtTable:e}=this.wot,{rootWindow:t}=this.domBindings;"hidden"===t.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")?this.mainTableScrollableElement=this.wot.wtTable.holder:this.mainTableScrollableElement=Object(r["getScrollableElement"])(e.TABLE)}getRelativeCellPosition(e,t,n){if(!1===this.clone.wtTable.holder.contains(e))return void Object(h["b"])(`The provided element is not a child of the ${this.type} overlay`);const r=this.mainTableScrollableElement===this.domBindings.rootWindow,i=n<this.wtSettings.getSetting("fixedColumnsStart"),o=t<this.wtSettings.getSetting("fixedRowsTop"),s=t>=this.wtSettings.getSetting("totalRows")-this.wtSettings.getSetting("fixedRowsBottom"),a=this.clone.wtTable.spreader,l={start:this.getRelativeStartPosition(a),top:a.offsetTop},c={start:this.getRelativeStartPosition(e),top:e.offsetTop};let u=null;return u=r?this.getRelativeCellPositionWithinWindow(o,i,c,l):this.getRelativeCellPositionWithinHolder(o,s,i,c,l),u}getRelativeStartPosition(e){return this.isRtl()?e.offsetParent.offsetWidth-e.offsetLeft-e.offsetWidth:e.offsetLeft}getRelativeCellPositionWithinWindow(e,t,n,i){const o=this.wot.wtTable.wtRootElement.getBoundingClientRect();let s=0,a=0;if(t){let e=o.left;this.isRtl()&&(e=this.domBindings.rootWindow.innerWidth-(o.left+o.width+Object(r["getScrollbarWidth"])())),s=e<=0?-1*e:0}else s=i.start;if(e){const e=this.clone.wtTable.TABLE.getBoundingClientRect();a=e.top-o.top}else a=i.top;return{start:n.start+s,top:n.top+a}}getRelativeCellPositionWithinHolder(e,t,n,r,i){const o={horizontal:this.wot.wtOverlays.inlineStartOverlay.getScrollPosition(),vertical:this.wot.wtOverlays.topOverlay.getScrollPosition()};let s=0,a=0;if(n||(s=o.horizontal-i.start),t){const e=this.wot.wtTable.wtRootElement.getBoundingClientRect(),t=this.clone.wtTable.TABLE.getBoundingClientRect();a=-1*t.top+e.top}else e||(a=o.vertical-i.top);return{start:r.start-s,top:r.top-a}}makeClone(){if(-1===Lt.indexOf(this.type))throw new Error(`Clone type "${this.type}" is not supported.`);const{wtTable:e,wtSettings:t}=this.wot,{rootDocument:n,rootWindow:i}=this.domBindings,o=n.createElement("div"),s=n.createElement("table"),a=e.wtRootElement.parentNode;o.className=Pt.get(this.type)+" handsontable",o.setAttribute("dir",this.isRtl()?"rtl":"ltr"),o.style.position="absolute",o.style.top=0,o.style.overflow="visible",this.isRtl()?o.style.right=0:o.style.left=0,t.getSetting("ariaTags")&&Object(r["setAttribute"])(o,[Object(He["x"])()]),s.className=e.TABLE.className;const l=e.TABLE.getAttribute("role");l&&s.setAttribute("role",e.TABLE.getAttribute("role")),o.appendChild(s),a.appendChild(o);const c=this.wtSettings.getSetting("preventOverflow");return!0===c||"horizontal"===c&&this.type===At||"vertical"===c&&this.type===Mt?this.mainTableScrollableElement=i:"hidden"===i.getComputedStyle(a).getPropertyValue("overflow")?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=Object(r["getScrollableElement"])(e.TABLE),new gn(s,this.wtSettings,{source:this.wot,overlay:this,viewport:this.wot.wtViewport,event:this.wot.wtEvent,selectionManager:this.wot.selectionManager})}refresh(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=this.shouldBeRendered();this.clone&&(this.needFullRender||t)&&this.clone.draw(e),this.needFullRender=t}reset(){if(!this.clone)return;const e=this.clone.wtTable.holder,t=this.clone.wtTable.hider,n=e.style,r=t.style,i=e.parentNode.style;Object(I["arrayEach"])([n,r,i],e=>{e.width="",e.height=""})}isRtl(){return this.wtSettings.getSetting("rtlMode")}destroy(){this.clone.eventManager.destroy()}}const vn=Object.freeze({width:"6px",height:"6px",borderWidth:"1px",borderStyle:"solid",borderColor:"#FFF"});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)}class Rn extends bn{constructor(e,t,n,r){super(e,t,At,n,r),En(this,"cachedFixedRowsTop",-1),this.cachedFixedRowsTop=this.wtSettings.getSetting("fixedRowsTop")}createTable(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Xt(...t)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.wot.wtTable.holder.parentNode)return!1;const e=this.clone.wtTable.holder.parentNode,{rootWindow:t}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let i=0,o=!1;if(this.trimmingContainer!==t||n&&"vertical"===n)i=this.getScrollPosition(),Object(r["resetCssTransform"])(e);else{const{wtTable:t}=this.wot,n=t.hider.getBoundingClientRect(),s=Math.ceil(n.bottom),a=e.offsetHeight;o=s===a,i=this.getOverlayOffset(),Object(r["setOverlayPosition"])(e,"0px",i+"px")}const s=this.adjustHeaderBordersPosition(i,o);return this.adjustElementsSize(),s}setScrollPosition(e){const t=this.domBindings.rootWindow;let n=!1;return this.mainTableScrollableElement===t&&t.scrollY!==e?(t.scrollTo(Object(r["getWindowScrollLeft"])(t),e),n=!0):this.mainTableScrollableElement.scrollTop!==e&&(this.mainTableScrollableElement.scrollTop=e,n=!0),n}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,t){const n=this.wtSettings.getSetting("defaultRowHeight");let r=e,i=0;while(r<t){const e=this.wot.wtTable.getRowHeight(r);i+=void 0===e?n:e,r+=1}return i}adjustElementsSize(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.updateTrimmingContainer(),(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e}=this.wot,{rootDocument:t,rootWindow:n}=this.domBindings,i=Object(r["getScrollbarWidth"])(t),o=this.clone.wtTable.holder.parentNode,s=o.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==n||"horizontal"===a){let t=this.wot.wtViewport.getWorkspaceWidth();this.wot.wtOverlays.hasScrollbarRight&&(t-=i),t=Math.min(t,e.wtRootElement.scrollWidth),s.width=t+"px"}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=Object(r["outerHeight"])(this.clone.wtTable.TABLE);this.wot.wtTable.hasDefinedSize()||(l=0),s.height=l+"px"}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,t=this.wot.selectionManager.getFocusSelection()?parseInt(vn.height,10)/2:0;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=parseInt(e.parentNode.style.height,10)+t+"px"}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");if("number"===typeof this.wot.wtViewport.rowsRenderCalculator.startPosition)this.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.top="0"}this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:t}=this.clone.wtTable;"number"===typeof this.wot.wtViewport.columnsRenderCalculator.startPosition?t.style[e]=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px":t.style[e]=""}scrollTo(e,t){const{wot:n,wtSettings:i}=this,o=n.cloneSource?n.cloneSource:n,s=o.wtTable.holder,a=i.getSetting("columnHeaders"),l=i.getSetting("fixedRowsTop"),c=0===l&&a.length>0&&!Object(r["hasClass"])(s.parentNode,"innerBorderTop")?1:0;let h=this.getTableParentOffset(),u=0;if(t){const n=this.wot.wtTable.getRowHeight(e),r=this.wot.wtViewport.getViewportHeight();n>r&&(t=!1)}if(t&&s.offsetHeight!==s.clientHeight&&(u=Object(r["getScrollbarWidth"])(this.domBindings.rootDocument)),t){const t=i.getSetting("fixedRowsBottom"),r=i.getSetting("totalRows");h+=this.sumCellSizes(0,e+1),h-=n.wtViewport.getViewportHeight()-this.sumCellSizes(r-t,r),h+=1,h+=c}else h+=this.sumCellSizes(i.getSetting("fixedRowsTop"),e);return h+=u,Object(r["getMaximumScrollTop"])(this.mainTableScrollableElement)===h-c&&c>0&&this.wot.wtOverlays.expandHiderVerticallyBy(c),this.setScrollPosition(h)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return Object(r["getScrollTop"])(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,t=this.wtSettings.getSetting("preventOverflow");let n=0;if(this.trimmingContainer===e&&(!t||"vertical"!==t)){const e=this.wot.wtTable.getTotalHeight(),t=this.clone.wtTable.getTotalHeight(),r=e-t;n=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0),n>r&&(n=0)}return n}adjustHeaderBordersPosition(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.wot.wtTable.holder.parentNode,i=this.wtSettings.getSetting("totalColumns");i?Object(r["removeClass"])(n,"emptyColumns"):Object(r["addClass"])(n,"emptyColumns");let o=!1;if(!t){const t=this.wtSettings.getSetting("fixedRowsTop"),i=this.cachedFixedRowsTop!==t,s=this.wtSettings.getSetting("columnHeaders");if((i||0===t)&&s.length>0){const t=Object(r["hasClass"])(n,"innerBorderTop");this.cachedFixedRowsTop=this.wtSettings.getSetting("fixedRowsTop"),e||0===this.wtSettings.getSetting("totalRows")?(Object(r["addClass"])(n,"innerBorderTop"),o=!t):(Object(r["removeClass"])(n,"innerBorderTop"),o=t)}}return o}}const Tn="stickyRowsBottom",On={getFirstRenderedRow(){const e=this.wtSettings.getSetting("totalRows"),t=this.wtSettings.getSetting("fixedRowsBottom"),n=e-t;return 0===e||0===t?-1:n<0?0:n},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.wtSettings.getSetting("totalRows")-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){const e=this.wtSettings.getSetting("totalRows");return Math.min(this.wtSettings.getSetting("fixedRowsBottom"),e)},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return 0}};Object(c["defineGetter"])(On,"MIXIN_NAME",Tn,{writable:!1,enumerable:!1});var Nn=On;class An extends Ft{constructor(e,t,n,r){super(e,t,n,r,It)}}Object(c["mixin"])(An,Nn),Object(c["mixin"])(An,zt);var In=An;function Mn(e,t,n){return t=xn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xn(e){var t=_n(e,"string");return"symbol"==typeof t?t:t+""}function _n(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 Ln extends bn{constructor(e,t,n,r){super(e,t,It,n,r),Mn(this,"cachedFixedRowsBottom",-1),this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom")}createTable(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new In(...t)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.wot.wtTable.holder.parentNode)return!1;const{rootWindow:e}=this.domBindings,t=this.clone.wtTable.holder.parentNode;t.style.top="";let n=0;const r=this.wtSettings.getSetting("preventOverflow");this.trimmingContainer!==e||r&&"vertical"===r?(n=this.getScrollPosition(),this.repositionOverlay()):(n=this.getOverlayOffset(),t.style.bottom=n+"px");const i=this.adjustHeaderBordersPosition(n);return this.adjustElementsSize(),i}repositionOverlay(){const{wtTable:e,wtViewport:t}=this.wot,{rootDocument:n}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let o=0;t.hasVerticalScroll()||(o+=t.getWorkspaceHeight()-e.getTotalHeight()),t.hasVerticalScroll()&&t.hasHorizontalScroll()&&(o+=Object(r["getScrollbarWidth"])(n)),i.style.bottom=o+"px"}setScrollPosition(e){const{rootWindow:t}=this.domBindings;let n=!1;return this.mainTableScrollableElement===t?(t.scrollTo(Object(r["getWindowScrollLeft"])(t),e),n=!0):this.mainTableScrollableElement.scrollTop!==e&&(this.mainTableScrollableElement.scrollTop=e,n=!0),n}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,t){const{wtTable:n,wtSettings:r}=this.wot,i=r.getSetting("defaultRowHeight");let o=e,s=0;while(o<t){const e=n.getRowHeight(o);s+=void 0===e?i:e,o+=1}return s}adjustElementsSize(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.updateTrimmingContainer(),(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:t}=this.wot,{rootDocument:n,rootWindow:i}=this.domBindings,o=Object(r["getScrollbarWidth"])(n),s=this.clone.wtTable.holder.parentNode,a=s.style,l=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||"horizontal"===l){let n=t.getWorkspaceWidth();this.wot.wtOverlays.hasScrollbarRight&&(n-=o),n=Math.min(n,e.wtRootElement.scrollWidth),a.width=n+"px"}else a.width="";this.clone.wtTable.holder.style.width=a.width;let c=Object(r["outerHeight"])(this.clone.wtTable.TABLE);this.wot.wtTable.hasDefinedSize()||(c=0),a.height=c+"px"}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=e.parentNode.style.height}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");if("number"===typeof this.wot.wtViewport.rowsRenderCalculator.startPosition)this.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.top="0"}this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:t}=this.clone.wtTable;"number"===typeof this.wot.wtViewport.columnsRenderCalculator.startPosition?t.style[e]=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px":t.style[e]=""}scrollTo(e,t){let n=this.getTableParentOffset();const i=this.wot.cloneSource?this.wot.cloneSource:this.wot,o=i.wtTable.holder;let s=0;t&&o.offsetHeight!==o.clientHeight&&(s=Object(r["getScrollbarWidth"])(this.domBindings.rootDocument)),t?(n+=this.sumCellSizes(0,e+1),n-=this.wot.wtViewport.getViewportHeight(),n+=1):n+=this.sumCellSizes(this.wtSettings.getSetting("fixedRowsBottom"),e),n+=s,this.setScrollPosition(n)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return Object(r["getScrollTop"])(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,t=this.wtSettings.getSetting("preventOverflow");let n=0;if(this.trimmingContainer===e&&(!t||"vertical"!==t)){const e=this.wot.wtTable.getTotalHeight(),t=this.clone.wtTable.getTotalHeight(),r=e-t,i=this.domBindings.rootDocument.documentElement.clientHeight;n=Math.max(this.getTableParentOffset()-this.getScrollPosition()-i+e,0),n>r&&(n=0)}return n}adjustHeaderBordersPosition(e){const t=this.wtSettings.getSetting("fixedRowsBottom"),n=this.cachedFixedRowsBottom!==t,i=this.wtSettings.getSetting("columnHeaders");let o=!1;if((n||0===t)&&i.length>0){const t=this.wot.wtTable.holder.parentNode,n=Object(r["hasClass"])(t,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||0===this.wtSettings.getSetting("totalRows")?(Object(r["addClass"])(t,"innerBorderBottom"),o=!n):(Object(r["removeClass"])(t,"innerBorderBottom"),o=n)}return o}}const Pn="calculatedRows",kn={getFirstRenderedRow(){const e=this.dataAccessObject.startRowRendered;return null===e?-1:e},getFirstVisibleRow(){const e=this.dataAccessObject.startRowVisible;return null===e?-1:e},getFirstPartiallyVisibleRow(){const e=this.dataAccessObject.startRowPartiallyVisible;return null===e?-1:e},getLastRenderedRow(){const e=this.dataAccessObject.endRowRendered;return null===e?-1:e},getLastVisibleRow(){const e=this.dataAccessObject.endRowVisible;return null===e?-1:e},getLastPartiallyVisibleRow(){const e=this.dataAccessObject.endRowPartiallyVisible;return null===e?-1:e},getRenderedRowsCount(){return this.dataAccessObject.countRowsRendered},getVisibleRowsCount(){return this.dataAccessObject.countRowsVisible},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};Object(c["defineGetter"])(kn,"MIXIN_NAME",Pn,{writable:!1,enumerable:!1});var jn=kn;const Hn="stickyColumnsStart",Dn={getFirstRenderedColumn(){const e=this.wtSettings.getSetting("totalColumns");return 0===e?-1:0},getFirstVisibleColumn(){return this.getFirstRenderedColumn()},getFirstPartiallyVisibleColumn(){return this.getFirstRenderedColumn()},getLastRenderedColumn(){return this.getRenderedColumnsCount()-1},getLastVisibleColumn(){return this.getLastRenderedColumn()},getLastPartiallyVisibleColumn(){return this.getLastRenderedColumn()},getRenderedColumnsCount(){const e=this.wtSettings.getSetting("totalColumns");return Math.min(this.wtSettings.getSetting("fixedColumnsStart"),e)},getVisibleColumnsCount(){return this.getRenderedColumnsCount()},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};Object(c["defineGetter"])(Dn,"MIXIN_NAME",Hn,{writable:!1,enumerable:!1});var Fn=Dn;class Un extends Ft{constructor(e,t,n,r){super(e,t,n,r,Mt)}}Object(c["mixin"])(Un,jn),Object(c["mixin"])(Un,Fn);var Vn=Un;class Bn extends bn{constructor(e,t,n,r){super(e,t,Mt,n,r)}createTable(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Vn(...t)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wtTable:e}=this.wot;if(!this.needFullRender||!e.holder.parentNode)return!1;const{rootWindow:t}=this.domBindings,n=this.clone.wtTable.holder.parentNode,i=this.wtSettings.getSetting("preventOverflow");let o=0;this.trimmingContainer!==t||i&&"horizontal"===i?(o=this.getScrollPosition(),Object(r["resetCssTransform"])(n)):(o=this.getOverlayOffset()*(this.isRtl()?-1:1),Object(r["setOverlayPosition"])(n,o+"px","0px"));const s=this.adjustHeaderBordersPosition(o);return this.adjustElementsSize(),s}setScrollPosition(e){const{rootWindow:t}=this.domBindings;let n=!1;return this.isRtl()&&(e=-e),this.mainTableScrollableElement===t&&t.scrollX!==e?(t.scrollTo(e,Object(r["getWindowScrollTop"])(t)),n=!0):this.mainTableScrollableElement.scrollLeft!==e&&(this.mainTableScrollableElement.scrollLeft=e,n=!0),n}onScroll(){this.wtSettings.getSetting("onScrollVertically")}sumCellSizes(e,t){const n=this.wtSettings.getSetting("defaultColumnWidth");let r=e,i=0;while(r<t)i+=this.wot.wtTable.getStretchedColumnWidth(r)||n,r+=1;return i}adjustElementsSize(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.updateTrimmingContainer(),(this.needFullRender||e)&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e}=this.wot,{rootDocument:t,rootWindow:n}=this.domBindings,i=Object(r["getScrollbarWidth"])(t),o=this.clone.wtTable.holder.parentNode,s=o.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==n||"vertical"===a){let t=this.wot.wtViewport.getWorkspaceHeight();this.wot.wtOverlays.hasScrollbarBottom&&(t-=i),t=Math.min(t,e.wtRootElement.scrollHeight),s.height=t+"px"}else s.height="";this.clone.wtTable.holder.style.height=s.height;const l=Object(r["outerWidth"])(this.clone.wtTable.TABLE);s.width=l+"px"}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,t=this.wot.selectionManager.getFocusSelection()?parseInt(vn.width,10)/2:0;this.clone.wtTable.hider.style.height=this.hider.style.height,e.style.height=e.parentNode.style.height,e.style.width=parseInt(e.parentNode.style.width,10)+t+"px"}applyToDOM(){const e=this.wtSettings.getSetting("totalColumns"),t=this.isRtl()?"right":"left";if("number"===typeof this.wot.wtViewport.columnsRenderCalculator.startPosition)this.spreader.style[t]=this.wot.wtViewport.columnsRenderCalculator.startPosition+"px";else{if(0!==e)throw new Error("Incorrect value of the columnsRenderCalculator");this.spreader.style[t]="0"}this.isRtl()?this.spreader.style.left="":this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){"number"===typeof this.wot.wtViewport.rowsRenderCalculator.startPosition?this.clone.wtTable.spreader.style.top=this.wot.wtViewport.rowsRenderCalculator.startPosition+"px":this.clone.wtTable.spreader.style.top=""}scrollTo(e,t){const{wtSettings:n}=this,i=n.getSetting("rowHeaders"),o=n.getSetting("fixedColumnsStart"),s=this.wot.cloneSource?this.wot.cloneSource:this.wot,a=s.wtTable.holder,l=0===o&&i.length>0&&!Object(r["hasClass"])(a.parentNode,"innerBorderInlineStart")?1:0;let c=this.getTableParentOffset(),h=0;if(t){const n=this.wot.wtTable.getColumnWidth(e),r=this.wot.wtViewport.getViewportWidth();n>r&&(t=!1)}return t&&a.offsetWidth!==a.clientWidth&&(h=Object(r["getScrollbarWidth"])(this.domBindings.rootDocument)),t?(c+=this.sumCellSizes(0,e+1),c-=this.wot.wtViewport.getViewportWidth(),c+=l):c+=this.sumCellSizes(this.wtSettings.getSetting("fixedColumnsStart"),e),c+=h,Object(r["getMaximumScrollLeft"])(this.mainTableScrollableElement)===c-l&&l>0&&this.wot.wtOverlays.expandHiderHorizontallyBy(l),this.setScrollPosition(c)}getTableParentOffset(){const e=this.wtSettings.getSetting("preventOverflow");let t=0;return e||this.trimmingContainer!==this.domBindings.rootWindow||(t=this.wot.wtTable.holderOffset.left),t}getScrollPosition(){return Math.abs(Object(r["getScrollLeft"])(this.mainTableScrollableElement,this.domBindings.rootWindow))}getOverlayOffset(){const{rootWindow:e}=this.domBindings,t=this.wtSettings.getSetting("preventOverflow");let n=0;if(this.trimmingContainer===e&&(!t||"horizontal"!==t)){n=this.isRtl()?Math.abs(Math.min(this.getTableParentOffset()-this.getScrollPosition(),0)):Math.max(this.getScrollPosition()-this.getTableParentOffset(),0);const e=this.wot.wtTable.getTotalWidth(),t=this.clone.wtTable.getTotalWidth(),r=e-t;n>r&&(n=0)}return n}adjustHeaderBordersPosition(e){const t=this.wot.wtTable.holder.parentNode,n=this.wtSettings.getSetting("rowHeaders"),i=this.wtSettings.getSetting("fixedColumnsStart"),o=this.wtSettings.getSetting("totalRows");o?Object(r["removeClass"])(t,"emptyRows"):Object(r["addClass"])(t,"emptyRows");let s=!1;if(i&&!n.length)Object(r["addClass"])(t,"innerBorderLeft innerBorderInlineStart");else if(!i&&n.length){const n=Object(r["hasClass"])(t,"innerBorderInlineStart");e?(Object(r["addClass"])(t,"innerBorderLeft innerBorderInlineStart"),s=!n):(Object(r["removeClass"])(t,"innerBorderLeft innerBorderInlineStart"),s=n)}return s}}class Wn extends Ft{constructor(e,t,n,r){super(e,t,n,r,xt)}}Object(c["mixin"])(Wn,Bt),Object(c["mixin"])(Wn,Fn);var Gn=Wn;function zn(e,t,n){return t=Yn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yn(e){var t=Xn(e,"string");return"symbol"==typeof t?t:t+""}function Xn(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 Kn extends bn{constructor(e,t,n,r,i,o){super(e,t,xt,n,r),zn(this,"topOverlay",void 0),zn(this,"inlineStartOverlay",void 0),this.topOverlay=i,this.inlineStartOverlay=o}createTable(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Gn(...t)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){if(this.updateTrimmingContainer(),!this.wot.wtTable.holder.parentNode)return!1;const e=this.clone.wtTable.holder.parentNode;if(this.trimmingContainer===this.domBindings.rootWindow){const t=this.inlineStartOverlay.getOverlayOffset()*(this.isRtl()?-1:1),n=this.topOverlay.getOverlayOffset();Object(r["setOverlayPosition"])(e,t+"px",n+"px")}else Object(r["resetCssTransform"])(e);let t=Object(r["outerHeight"])(this.clone.wtTable.TABLE);const n=Object(r["outerWidth"])(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(t=0),e.style.height=t+"px",e.style.width=n+"px",!1}}class $n extends Ft{constructor(e,t,n,r){super(e,t,n,r,_t)}}Object(c["mixin"])($n,Nn),Object(c["mixin"])($n,Fn);var qn=$n;class Qn extends bn{constructor(e,t,n,r,i,o){super(e,t,_t,n,r),this.bottomOverlay=i,this.inlineStartOverlay=o}createTable(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new qn(...t)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wot:e}=this;if(this.updateTrimmingContainer(),!e.wtTable.holder.parentNode)return!1;const t=this.clone.wtTable.holder.parentNode;if(t.style.top="",this.trimmingContainer===this.domBindings.rootWindow){const e=this.inlineStartOverlay.getOverlayOffset(),n=this.bottomOverlay.getOverlayOffset();t.style[this.isRtl()?"right":"left"]=e+"px",t.style.bottom=n+"px"}else Object(r["resetCssTransform"])(t),this.repositionOverlay();let n=Object(r["outerHeight"])(this.clone.wtTable.TABLE);const i=Object(r["outerWidth"])(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(n=0),t.style.height=n+"px",t.style.width=i+"px",!1}repositionOverlay(){const{wtTable:e,wtViewport:t}=this.wot,{rootDocument:n}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let o=0;t.hasVerticalScroll()||(o+=t.getWorkspaceHeight()-e.getTotalHeight()),t.hasVerticalScroll()&&t.hasHorizontalScroll()&&(o+=Object(r["getScrollbarWidth"])(n)),i.style.bottom=o+"px"}}function Zn(e,t,n){return t=Jn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jn(e){var t=er(e,"string");return"symbol"==typeof t?t:t+""}function er(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 tr{constructor(e,t,n,i,o,s){Zn(this,"wot",null),Zn(this,"topOverlay",null),Zn(this,"bottomOverlay",null),Zn(this,"inlineStartOverlay",null),Zn(this,"topInlineStartCornerOverlay",null),Zn(this,"bottomInlineStartCornerOverlay",null),Zn(this,"browserLineHeight",void 0),Zn(this,"wtSettings",null),Zn(this,"resizeObserver",new ResizeObserver(e=>{Object(D["requestAnimationFrame"])(()=>{Array.isArray(e)&&e.length&&this.wtSettings.getSetting("onContainerElementResize")})})),this.wot=e,this.wtSettings=i,this.domBindings=n,this.facadeGetter=t,this.wtTable=s;const{rootDocument:a,rootWindow:l}=this.domBindings;this.instance=this.wot,this.eventManager=o,this.scrollbarSize=Object(r["getScrollbarWidth"])(a);const c="hidden"===l.getComputedStyle(s.wtRootElement.parentNode).getPropertyValue("overflow");this.scrollableElement=c?s.holder:Object(r["getScrollableElement"])(s.TABLE),this.initOverlays(),this.hasScrollbarBottom=!1,this.hasScrollbarRight=!1,this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.initBrowserLineHeight(),this.registerListeners(),this.lastScrollX=l.scrollX,this.lastScrollY=l.scrollY}getOverlays(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=[this.topOverlay,this.topInlineStartCornerOverlay,this.inlineStartOverlay,this.bottomOverlay,this.bottomInlineStartCornerOverlay];return e&&t.push(this.wtTable),t}initBrowserLineHeight(){const{rootWindow:e,rootDocument:t}=this.domBindings,n=e.getComputedStyle(t.body),r=parseInt(n.lineHeight,10),i=1.2*parseInt(n.fontSize,10);this.browserLineHeight=r||i}initOverlays(){const e=[this.wot,this.facadeGetter,this.wtSettings,this.domBindings];this.topOverlay=new Rn(...e),this.bottomOverlay=new Ln(...e),this.inlineStartOverlay=new Bn(...e),this.topInlineStartCornerOverlay=new Kn(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new Qn(...e,this.bottomOverlay,this.inlineStartOverlay)}updateStateOfRendering(){let e=this.topOverlay.updateStateOfRendering();return e=this.bottomOverlay.updateStateOfRendering()||e,e=this.inlineStartOverlay.updateStateOfRendering()||e,this.inlineStartOverlay.needFullRender&&(this.topOverlay.needFullRender&&(e=this.topInlineStartCornerOverlay.updateStateOfRendering()||e),this.bottomOverlay.needFullRender&&(e=this.bottomInlineStartCornerOverlay.updateStateOfRendering()||e)),e}refreshAll(){this.wot.drawn&&(this.wtTable.holder.parentNode?(this.wot.draw(!0),this.verticalScrolling&&this.inlineStartOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1):this.destroy())}registerListeners(){const{rootDocument:e,rootWindow:t}=this.domBindings,{mainTableScrollableElement:n}=this.topOverlay,{mainTableScrollableElement:r}=this.inlineStartOverlay;this.eventManager.addEventListener(e.documentElement,"keydown",e=>this.onKeyDown(e)),this.eventManager.addEventListener(e.documentElement,"keyup",()=>this.onKeyUp()),this.eventManager.addEventListener(e,"visibilitychange",()=>this.onKeyUp()),this.eventManager.addEventListener(n,"scroll",e=>this.onTableScroll(e),{passive:!0}),n!==r&&this.eventManager.addEventListener(r,"scroll",e=>this.onTableScroll(e),{passive:!0});const i=t.devicePixelRatio&&t.devicePixelRatio>1,o=this.scrollableElement===t,a=this.wtSettings.getSetting("preventWheel"),l={passive:o};(a||i||!Object(s["isChrome"])())&&this.eventManager.addEventListener(this.wtTable.wtRootElement,"wheel",e=>this.onCloneWheel(e,a),l);const c=[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];let h;c.forEach(e=>{if(e&&e.needFullRender){const{holder:t}=e.clone.wtTable;this.eventManager.addEventListener(t,"wheel",e=>this.onCloneWheel(e,a),l)}}),this.eventManager.addEventListener(t,"resize",()=>{clearTimeout(h),h=setTimeout(()=>{this.wtSettings.getSetting("onWindowResize")},200)}),o||this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement)}deregisterListeners(){this.eventManager.clearEvents(!0)}onTableScroll(e){const t=this.domBindings.rootWindow,n=this.inlineStartOverlay.mainTableScrollableElement,r=this.topOverlay.mainTableScrollableElement,i=e.target;this.keyPressed&&(r!==t&&i!==t&&!e.target.contains(r)||n!==t&&i!==t&&!e.target.contains(n))||this.syncScrollPositions(e)}onCloneWheel(e,t){const{rootWindow:n}=this.domBindings,r=this.inlineStartOverlay.mainTableScrollableElement,i=this.topOverlay.mainTableScrollableElement,o=e.target,s=i!==n&&o!==n&&!o.contains(i),a=r!==n&&o!==n&&!o.contains(r);if(this.keyPressed&&(s||a))return;const l=this.translateMouseWheelToScroll(e);(t||this.scrollableElement!==n&&l)&&e.preventDefault()}onKeyDown(e){this.keyPressed=Object(ne["isKey"])(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")}onKeyUp(){this.keyPressed=!1}translateMouseWheelToScroll(e){let t=isNaN(e.deltaY)?-1*e.wheelDeltaY:e.deltaY,n=isNaN(e.deltaX)?-1*e.wheelDeltaX:e.deltaX;1===e.deltaMode&&(n+=n*this.browserLineHeight,t+=t*this.browserLineHeight);const r=this.scrollVertically(t),i=this.scrollHorizontally(n);return r||i}scrollVertically(e){const t=this.scrollableElement.scrollTop;return this.scrollableElement.scrollTop+=e,t!==this.scrollableElement.scrollTop}scrollHorizontally(e){const t=this.scrollableElement.scrollLeft;return this.scrollableElement.scrollLeft+=e,t!==this.scrollableElement.scrollLeft}syncScrollPositions(){if(this.destroyed)return;const{rootWindow:e}=this.domBindings,t=this.topOverlay.clone.wtTable.holder,n=this.inlineStartOverlay.clone.wtTable.holder,[r,i]=[this.scrollableElement.scrollLeft,this.scrollableElement.scrollTop];if(this.horizontalScrolling=t.scrollLeft!==r||this.lastScrollX!==e.scrollX,this.verticalScrolling=n.scrollTop!==i||this.lastScrollY!==e.scrollY,this.lastScrollX=e.scrollX,this.lastScrollY=e.scrollY,this.horizontalScrolling){t.scrollLeft=r;const e=this.bottomOverlay.needFullRender?this.bottomOverlay.clone.wtTable.holder:null;e&&(e.scrollLeft=r)}this.verticalScrolling&&(n.scrollTop=i),this.refreshAll()}syncScrollWithMaster(){const e=this.topOverlay.mainTableScrollableElement,{scrollLeft:t,scrollTop:n}=e;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=t),this.bottomOverlay.needFullRender&&(this.bottomOverlay.clone.wtTable.holder.scrollLeft=t),this.inlineStartOverlay.needFullRender&&(this.inlineStartOverlay.clone.wtTable.holder.scrollTop=n)}updateMainScrollableElements(){this.deregisterListeners(),this.inlineStartOverlay.updateMainScrollableElement(),this.topOverlay.updateMainScrollableElement(),this.bottomOverlay.needFullRender&&this.bottomOverlay.updateMainScrollableElement();const{wtTable:e}=this,{rootWindow:t}=this.domBindings;"hidden"===t.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")?this.scrollableElement=e.holder:this.scrollableElement=Object(r["getScrollableElement"])(e.TABLE),this.registerListeners()}destroy(){this.resizeObserver.disconnect(),this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.inlineStartOverlay.destroy(),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.destroy(),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.destroy(),this.destroyed=!0}refresh(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=this.updateLastSpreaderSize();t&&this.adjustElementsSize(),this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.inlineStartOverlay.refresh(e),this.topOverlay.refresh(e),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.refresh(e),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.refresh(e)}updateLastSpreaderSize(){const e=this.wtTable.spreader,t=e.clientWidth,n=e.clientHeight,r=t!==this.spreaderLastSize.width||n!==this.spreaderLastSize.height;return r&&(this.spreaderLastSize.width=t,this.spreaderLastSize.height=n),r}adjustElementsSize(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{wtViewport:t}=this.wot,{wtTable:n}=this,{rootWindow:r}=this.domBindings,i=this.scrollableElement===r,o=this.wtSettings.getSetting("totalColumns"),s=this.wtSettings.getSetting("totalRows"),a=t.getRowHeaderWidth(),l=t.getColumnHeaderHeight(),c=l+this.topOverlay.sumCellSizes(0,s)+1,h=a+this.inlineStartOverlay.sumCellSizes(0,o),u=n.hider,d=u.style,p=()=>!i&&this.scrollableElement.scrollTop>Math.max(0,c-n.holder.clientHeight),f=()=>!i&&this.scrollableElement.scrollLeft>Math.max(0,h-n.holder.clientWidth),g=p()?1:0,m=f()?1:0;if(d.width=h+m+"px",d.height=c+g+"px",this.scrollbarSize>0){const{scrollHeight:e,scrollWidth:t}=n.wtRootElement,{scrollHeight:r,scrollWidth:i}=n.holder;this.hasScrollbarRight=e<r,this.hasScrollbarBottom=t<i,this.hasScrollbarRight&&n.hider.scrollWidth+this.scrollbarSize>t?this.hasScrollbarBottom=!0:this.hasScrollbarBottom&&n.hider.scrollHeight+this.scrollbarSize>e&&(this.hasScrollbarRight=!0)}this.topOverlay.adjustElementsSize(e),this.inlineStartOverlay.adjustElementsSize(e),this.bottomOverlay.adjustElementsSize(e)}expandHiderVerticallyBy(e){const{wtTable:t}=this;t.hider.style.height=parseInt(t.hider.style.height,10)+e+"px"}expandHiderHorizontallyBy(e){const{wtTable:t}=this;t.hider.style.width=parseInt(t.hider.style.width,10)+e+"px"}applyToDOM(){this.wtTable.isVisible()&&(this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.inlineStartOverlay.applyToDOM())}getParentOverlay(e){if(!e)return null;const t=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];let n=null;return Object(I["arrayEach"])(t,t=>{t&&t.clone&&t.clone.wtTable.TABLE.contains(e)&&(n=t.clone)}),n}syncOverlayTableClassNames(){const e=this.wtTable.TABLE,t=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];Object(I["arrayEach"])(t,t=>{t&&(t.clone.wtTable.TABLE.className=e.className)})}}var nr=tr;function rr(e,t,n){return t=ir(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ir(e){var t=or(e,"string");return"symbol"==typeof t?t:t+""}function or(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 sr{constructor(e){rr(this,"settings",{}),rr(this,"defaults",Object.freeze(this.getDefaults())),Object(c["objectEach"])(this.defaults,(t,n)=>{if(void 0!==e[n])this.settings[n]=e[n];else{if(void 0===t)throw new Error(`A required setting "${n}" was not provided`);this.settings[n]=t}})}getDefaults(){return{facade:void 0,table:void 0,isDataViewInstance:!0,externalRowCalculator:!1,stretchH:"none",currentRowClassName:null,currentColumnClassName:null,preventOverflow(){return!1},preventWheel:!1,data:void 0,freezeOverlays:!1,fixedColumnsStart:0,fixedRowsTop:0,fixedRowsBottom:0,shouldRenderInlineStartOverlay:()=>this.getSetting("fixedColumnsStart")>0||this.getSetting("rowHeaders").length>0,shouldRenderTopOverlay:()=>this.getSetting("fixedRowsTop")>0||this.getSetting("columnHeaders").length>0,shouldRenderBottomOverlay:()=>this.getSetting("fixedRowsBottom")>0,minSpareRows:0,rowHeaders(){return[]},columnHeaders(){return[]},totalRows:void 0,totalColumns:void 0,cellRenderer:(e,t,n)=>{const i=this.getSetting("data",e,t);Object(r["fastInnerText"])(n,void 0===i||null===i?"":i)},columnWidth(){},rowHeight(){},defaultRowHeight:23,defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride:null,onCellMouseDown:null,onCellContextMenu:null,onCellMouseOver:null,onCellMouseOut:null,onCellMouseUp:null,onCellDblClick:null,onCellCornerMouseDown:null,onCellCornerDblClick:null,beforeDraw:null,onDraw:null,onBeforeRemoveCellClassNames:null,onAfterDrawSelection:null,onBeforeDrawBorders:null,onBeforeViewportScrollHorizontally:e=>e,onBeforeViewportScrollVertically:e=>e,onScrollHorizontally:null,onScrollVertically:null,onBeforeTouchScroll:null,onAfterMomentumScroll:null,onBeforeStretchingColumnWidth:e=>e,onModifyRowHeaderWidth:null,onModifyGetCellCoords:null,onBeforeHighlightingRowHeader:e=>e,onBeforeHighlightingColumnHeader:e=>e,onWindowResize:null,onContainerElementResize:null,renderAllColumns:!1,renderAllRows:!1,groups:!1,rowHeaderWidth:null,columnHeaderHeight:null,headerClassName:null,rtlMode:!1,ariaTags:!0}}update(e,t){return void 0===t?Object(c["objectEach"])(e,(e,t)=>{this.settings[t]=e}):this.settings[e]=t,this}getSetting(e,t,n,r,i){return"function"===typeof this.settings[e]?this.settings[e](t,n,r,i):void 0!==t&&Array.isArray(this.settings[e])?this.settings[e][t]:this.settings[e]}getSettingPure(e){return this.settings[e]}has(e){return!!this.settings[e]}}class ar extends Ft{constructor(e,t,n,r){super(e,t,n,r,"master")}alignOverlaysWithTrimmingContainer(){const e=Object(r["getTrimmingContainer"])(this.wtRootElement),{rootWindow:t}=this.domBindings;if(e===t){const e=this.wtSettings.getSetting("preventOverflow");e||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible")}else{const n=e.parentElement,i=Object(r["getStyle"])(e,"height",t),o=Object(r["getStyle"])(e,"overflow",t),s=this.holder.style,{scrollWidth:a,scrollHeight:l}=e;let c=e.offsetWidth,h=e.offsetHeight;const u=["auto","hidden","scroll"];if(n&&u.includes(o)){const i=e.cloneNode(!1);i.style.overflow="auto",i.style.position="absolute",e.nextElementSibling?n.insertBefore(i,e.nextElementSibling):n.appendChild(i);const o=parseInt(Object(r["getComputedStyle"])(i,t).height,10);n.removeChild(i),0===o&&(h=0)}h=Math.min(h,l),s.height="auto"===i?"auto":h+"px",c=Math.min(c,a),s.width=c+"px",s.overflow="",this.hasTableHeight="auto"===s.height||h>0,this.hasTableWidth=c>0}this.isTableVisible=Object(r["isVisible"])(this.TABLE)}markOversizedColumnHeaders(){const{wtSettings:e}=this,{wtViewport:t}=this.dataAccessObject,n="master",r=e.getSetting("columnHeaders"),i=r.length;if(i&&!t.hasOversizedColumnHeadersMarked[n]){const r=e.getSetting("rowHeaders"),o=r.length,s=this.getRenderedColumnsCount();for(let e=0;e<i;e++)for(let t=-1*o;t<s;t++)this.markIfOversizedColumnHeader(t);t.hasOversizedColumnHeadersMarked[n]=!0}}}Object(c["mixin"])(ar,jn),Object(c["mixin"])(ar,zt);var lr=ar,cr=n("a6de");function hr(e,t,n){return t=ur(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ur(e){var t=dr(e,"string");return"symbol"==typeof t?t:t+""}function dr(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 pr{constructor(e){hr(this,"count",0),hr(this,"startRow",0),hr(this,"endRow",0),hr(this,"startPosition",0),this.count=e.totalRows,this.endRow=this.count-1}}var fr=n("eb36");function gr(e,t,n){return t=mr(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mr(e){var t=yr(e,"string");return"symbol"==typeof t?t:t+""}function yr(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 wr{constructor(e){gr(this,"count",0),gr(this,"startColumn",0),gr(this,"endColumn",0),gr(this,"startPosition",0),this.count=e.totalColumns,this.endColumn=this.count-1}}var br=n("861dd");class vr{constructor(e,t,n,r,i){this.dataAccessObject=e,this.wot=e.wot,this.instance=this.wot,this.domBindings=t,this.wtSettings=n,this.wtTable=i,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.hasOversizedColumnHeadersMarked={},this.clientHeight=0,this.containerWidth=NaN,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.eventManager=r,this.eventManager.addEventListener(this.domBindings.rootWindow,"resize",()=>{this.clientHeight=this.getWorkspaceHeight()})}getWorkspaceHeight(){const e=this.domBindings.rootDocument,t=this.dataAccessObject.topOverlayTrimmingContainer;let n=0;if(t===this.domBindings.rootWindow)n=e.documentElement.clientHeight;else{const e=Object(r["outerHeight"])(t);n=e>0&&t.clientHeight>0?t.clientHeight:1/0}return n}getWorkspaceWidth(){const{wtSettings:e}=this,{rootDocument:t,rootWindow:n}=this.domBindings,i=this.dataAccessObject.inlineStartOverlayTrimmingContainer,o=t.documentElement.offsetWidth,s=e.getSetting("totalColumns"),a=e.getSetting("preventOverflow"),l=e.getSetting("rtlMode"),c=this.wtTable.TABLE.getBoundingClientRect(),h=l?c.right-o:c.left,u=o-h;let d,p;if(a)return Object(r["outerWidth"])(this.wtTable.wtRootElement);if(d=e.getSetting("freezeOverlays")?Math.min(u,o):Math.min(this.getContainerFillWidth(),u,o),i===n&&s>0&&this.sumColumnWidths(0,s-1)>d)return t.documentElement.clientWidth;if(i!==n&&(p=Object(r["getStyle"])(this.dataAccessObject.inlineStartOverlayTrimmingContainer,"overflow",n),"scroll"===p||"hidden"===p||"auto"===p))return Math.max(d,i.clientWidth);const f=e.getSetting("stretchH");return"none"!==f&&f?d:Math.max(d,Object(r["outerWidth"])(this.wtTable.TABLE))}hasVerticalScroll(){return this.wtTable.hider.offsetHeight>this.getWorkspaceHeight()}hasHorizontalScroll(){return this.wtTable.hider.offsetWidth>this.getWorkspaceWidth()}sumColumnWidths(e,t){let n=0,r=e;while(r<t)n+=this.wtTable.getColumnWidth(r),r+=1;return n}getContainerFillWidth(){if(this.containerWidth)return this.containerWidth;const e=this.wtTable.holder,t=this.domBindings.rootDocument.createElement("div");t.style.width="100%",t.style.height="1px",e.appendChild(t);const n=t.offsetWidth;return this.containerWidth=n,e.removeChild(t),n}getWorkspaceOffset(){return Object(r["offset"])(this.wtTable.TABLE)}getColumnHeaderHeight(){const e=this.wtSettings.getSetting("columnHeaders");return e.length?isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=Object(r["outerHeight"])(this.wtTable.THEAD)):this.columnHeaderHeight=0,this.columnHeaderHeight}getViewportHeight(){let e=this.getWorkspaceHeight();if(e===1/0)return e;const t=this.getColumnHeaderHeight();return t>0&&(e-=t),e}getRowHeaderWidth(){const e=this.wtSettings.getSetting("rowHeaderWidth"),t=this.wtSettings.getSetting("rowHeaders");if(e){this.rowHeaderWidth=0;for(let n=0,r=t.length;n<r;n++)this.rowHeaderWidth+=e[n]||e}if(isNaN(this.rowHeaderWidth))if(t.length){let e=this.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(let n=0,i=t.length;n<i;n++)e?(this.rowHeaderWidth+=Object(r["outerWidth"])(e),e=e.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0;return this.rowHeaderWidth=this.wtSettings.getSetting("onModifyRowHeaderWidth",this.rowHeaderWidth)||this.rowHeaderWidth,this.rowHeaderWidth}getViewportWidth(){const e=this.getWorkspaceWidth();if(e===1/0)return e;const t=this.getRowHeaderWidth();return t>0?e-t:e}createRowsCalculator(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:cr["c"];const{wtSettings:t,wtTable:n}=this;if(t.getSetting("renderAllRows")&&e===cr["c"])return new pr({totalRows:t.getSetting("totalRows")});let i,o,s=this.getViewportHeight();this.rowHeaderWidth=NaN;let a=this.dataAccessObject.topScrollPosition-this.dataAccessObject.topParentOffset;const l=t.getSetting("fixedRowsTop"),c=t.getSetting("fixedRowsBottom"),h=t.getSetting("totalRows");return l&&a>=0&&(o=this.dataAccessObject.topOverlay.sumCellSizes(0,l),a+=o,s-=o),c&&this.dataAccessObject.bottomOverlay.clone&&(o=this.dataAccessObject.bottomOverlay.sumCellSizes(h-c,h),s-=o),i=n.holder.clientHeight===n.holder.offsetHeight?0:Object(r["getScrollbarWidth"])(this.domBindings.rootDocument),new fr["a"]({viewportHeight:s,scrollOffset:a,totalRows:t.getSetting("totalRows"),rowHeightFn:e=>n.getRowHeight(e),overrideFn:t.getSettingPure("viewportRowCalculatorOverride"),calculationType:e,horizontalScrollbarHeight:i})}createColumnsCalculator(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:cr["c"];const{wtSettings:t,wtTable:n}=this;if(t.getSetting("renderAllColumns")&&e===cr["c"])return new wr({totalColumns:t.getSetting("totalColumns")});let i=this.getViewportWidth(),o=Math.abs(this.dataAccessObject.inlineStartScrollPosition)-this.dataAccessObject.inlineStartParentOffset;this.columnHeaderHeight=NaN;const s=t.getSetting("fixedColumnsStart");if(s&&o>=0){const e=this.dataAccessObject.inlineStartOverlay.sumCellSizes(0,s);o+=e,i-=e}return n.holder.clientWidth!==n.holder.offsetWidth&&(i-=Object(r["getScrollbarWidth"])(this.domBindings.rootDocument)),new br["a"]({viewportWidth:i,scrollOffset:o,totalColumns:t.getSetting("totalColumns"),columnWidthFn:e=>n.getColumnWidth(e),overrideFn:t.getSettingPure("viewportColumnCalculatorOverride"),calculationType:e,inlineStartOffset:this.dataAccessObject.inlineStartParentOffset})}createRenderCalculators(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{wtSettings:t}=this;if(e&&!t.getSetting("renderAllRows")){const t=this.createRowsCalculator(cr["a"]);e=this.areAllProposedVisibleRowsAlreadyRendered(t)}if(e&&!t.getSetting("renderAllColumns")){const t=this.createColumnsCalculator(cr["a"]);e=this.areAllProposedVisibleColumnsAlreadyRendered(t)}return e||(this.rowsRenderCalculator=this.createRowsCalculator(cr["c"]),this.columnsRenderCalculator=this.createColumnsCalculator(cr["c"])),this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,e}createVisibleCalculators(){this.rowsVisibleCalculator=this.createRowsCalculator(cr["a"]),this.columnsVisibleCalculator=this.createColumnsCalculator(cr["a"])}createPartiallyVisibleCalculators(){this.rowsPartiallyVisibleCalculator=this.createRowsCalculator(cr["b"]),this.columnsPartiallyVisibleCalculator=this.createColumnsCalculator(cr["b"])}areAllProposedVisibleRowsAlreadyRendered(e){if(!this.rowsVisibleCalculator)return!1;const{startRow:t,endRow:n,isVisibleInTrimmingContainer:r}=e;if(null===t&&null===n)return!r;const{startRow:i,endRow:o}=this.rowsRenderCalculator;return!(t<i||t===i&&t>0)&&!(n>o||n===o&&n<this.wtSettings.getSetting("totalRows")-1)}areAllProposedVisibleColumnsAlreadyRendered(e){if(!this.columnsVisibleCalculator)return!1;const{startColumn:t,endColumn:n,isVisibleInTrimmingContainer:r}=e;if(null===t&&null===n)return!r;const{startColumn:i,endColumn:o}=this.columnsRenderCalculator;return!(t<i||t===i&&t>0)&&!(n>o||n===o&&n<this.wtSettings.getSetting("totalColumns")-1)}resetHasOversizedColumnHeadersMarked(){Object(c["objectEach"])(this.hasOversizedColumnHeadersMarked,(e,t,n)=>{n[t]=void 0})}}var Er=vr;n("24b9e");function Cr(e,t){Rr(e,t),t.add(e)}function Sr(e,t,n){Rr(e,t),t.set(e,n)}function Rr(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Tr(e,t){return e.get(Nr(e,t))}function Or(e,t,n){return e.set(Nr(e,t),n),n}function Nr(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 Ar=new WeakMap,Ir=new WeakMap,Mr=new WeakSet;class xr{constructor(){Cr(this,Mr),Sr(this,Ar,void 0),Sr(this,Ir,void 0)}setActiveOverlay(e){return Or(Ir,this,e),this}setActiveSelection(e){return Or(Ar,this,e),this}scan(){const e=Tr(Ar,this).settings.selectionType,t=new Set;return"active-header"===e?(this.scanColumnsInHeadersRange(e=>t.add(e)),this.scanRowsInHeadersRange(e=>t.add(e))):"area"===e?this.scanCellsRange(e=>t.add(e)):"focus"===e?(this.scanColumnsInHeadersRange(e=>t.add(e)),this.scanRowsInHeadersRange(e=>t.add(e)),this.scanCellsRange(e=>t.add(e))):"fill"===e?this.scanCellsRange(e=>t.add(e)):"header"===e?(this.scanColumnsInHeadersRange(e=>t.add(e)),this.scanRowsInHeadersRange(e=>t.add(e))):"row"===e?(this.scanRowsInHeadersRange(e=>t.add(e)),this.scanRowsInCellsRange(e=>t.add(e))):"column"===e&&(this.scanColumnsInHeadersRange(e=>t.add(e)),this.scanColumnsInCellsRange(e=>t.add(e))),t}scanColumnsInHeadersRange(e){const[t,n,r,i]=Tr(Ar,this).getCorners(),{wtTable:o}=Tr(Ir,this),s=o.getRenderedColumnsCount(),a=o.getColumnHeadersCount();let l=0;for(let c=-o.getRowHeadersCount();c<s;c++){const s=o.columnFilter.renderedToSource(c);if(!(s<n||s>i)){for(let c=-a;c<0;c++){if(c<t||c>r)continue;const h=c+a;let u=o.getColumnHeader(s,h);const d=Tr(Ir,this).getSetting("onBeforeHighlightingColumnHeader",s,h,{selectionType:Tr(Ar,this).settings.selectionType,columnCursor:l,selectionWidth:i-n+1});null!==d&&(d!==s&&(u=o.getColumnHeader(d,h)),e(u))}l+=1}}}scanRowsInHeadersRange(e){const[t,n,r,i]=Tr(Ar,this).getCorners(),{wtTable:o}=Tr(Ir,this),s=o.getRenderedRowsCount(),a=o.getRowHeadersCount();let l=0;for(let c=-o.getColumnHeadersCount();c<s;c++){const s=o.rowFilter.renderedToSource(c);if(!(s<t||s>r)){for(let c=-a;c<0;c++){if(c<n||c>i)continue;const h=c+a;let u=o.getRowHeader(s,h);const d=Tr(Ir,this).getSetting("onBeforeHighlightingRowHeader",s,h,{selectionType:Tr(Ar,this).settings.selectionType,rowCursor:l,selectionHeight:r-t+1});null!==d&&(d!==s&&(u=o.getRowHeader(d,h)),e(u))}l+=1}}}scanCellsRange(e){const[t,n,i,o]=Tr(Ar,this).getCorners(),{wtTable:s}=Tr(Ir,this);Nr(Mr,this,_r).call(this,(a,l)=>{if(a>=t&&a<=i&&l>=n&&l<=o){const t=s.getCell(Tr(Ir,this).createCellCoords(a,l)),n=Tr(Ir,this).getSetting("onAfterDrawSelection",a,l,Tr(Ar,this).settings.layerLevel);"string"===typeof n&&Object(r["addClass"])(t,n),e(t)}})}scanRowsInCellsRange(e){const[t,,n]=Tr(Ar,this).getCorners(),{wtTable:r}=Tr(Ir,this);Nr(Mr,this,_r).call(this,(i,o)=>{if(i>=t&&i<=n){const t=r.getCell(Tr(Ir,this).createCellCoords(i,o));e(t)}})}scanColumnsInCellsRange(e){const[,t,,n]=Tr(Ar,this).getCorners(),{wtTable:r}=Tr(Ir,this);Nr(Mr,this,_r).call(this,(i,o)=>{if(o>=t&&o<=n){const t=r.getCell(Tr(Ir,this).createCellCoords(i,o));e(t)}})}}function _r(e){const{wtTable:t}=Tr(Ir,this),n=t.getRenderedRowsCount(),r=t.getRenderedColumnsCount();for(let i=0;i<n;i+=1){const n=t.rowFilter.renderedToSource(i);for(let i=0;i<r;i+=1)e(n,t.columnFilter.renderedToSource(i))}}class Lr{constructor(e,t){t&&(this.eventManager=e.eventManager,this.instance=e,this.wot=e,this.settings=t,this.mouseDown=!1,this.main=null,this.top=null,this.bottom=null,this.start=null,this.end=null,this.topStyle=null,this.bottomStyle=null,this.startStyle=null,this.endStyle=null,this.cornerDefaultStyle=vn,this.cornerCenterPointOffset=-parseInt(this.cornerDefaultStyle.width,10)/2,this.corner=null,this.cornerStyle=null,this.createBorders(t),this.registerListeners())}registerListeners(){const e=this.wot.rootDocument.body;this.eventManager.addEventListener(e,"mousedown",()=>this.onMouseDown()),this.eventManager.addEventListener(e,"mouseup",()=>this.onMouseUp());for(let t=0,n=this.main.childNodes.length;t<n;t++){const e=this.main.childNodes[t];this.eventManager.addEventListener(e,"mouseenter",e=>this.onMouseEnter(e,this.main.childNodes[t]))}}onMouseDown(){this.mouseDown=!0}onMouseUp(){this.mouseDown=!1}onMouseEnter(e,t){if(!this.mouseDown||!this.wot.getSetting("hideBorderOnMouseDownOver"))return;e.preventDefault(),Object(H["stopImmediatePropagation"])(e);const n=this,r=this.wot.rootDocument.body,i=t.getBoundingClientRect();function o(e){return e.clientY<Math.floor(i.top)||(e.clientY>Math.ceil(i.top+i.height)||(e.clientX<Math.floor(i.left)||(e.clientX>Math.ceil(i.left+i.width)||void 0)))}function s(e){o(e)&&(n.eventManager.removeEventListener(r,"mousemove",s),t.style.display="block")}t.style.display="none",this.eventManager.addEventListener(r,"mousemove",s)}createBorders(e){const{rootDocument:t}=this.wot;this.main=t.createElement("div");const n=["top","start","bottom","end","corner"];let r=this.main.style;r.position="absolute",r.top=0,r.left=0;for(let s=0;s<5;s++){const i=n[s],o=t.createElement("div");o.className="wtBorder "+(this.settings.className||""),this.settings[i]&&this.settings[i].hide&&(o.className+=" hidden"),r=o.style,r.backgroundColor=this.settings[i]&&this.settings[i].color?this.settings[i].color:e.border.color,r.height=this.settings[i]&&this.settings[i].width?this.settings[i].width+"px":e.border.width+"px",r.width=this.settings[i]&&this.settings[i].width?this.settings[i].width+"px":e.border.width+"px",this.main.appendChild(o)}this.top=this.main.childNodes[0],this.start=this.main.childNodes[1],this.bottom=this.main.childNodes[2],this.end=this.main.childNodes[3],this.topStyle=this.top.style,this.startStyle=this.start.style,this.bottomStyle=this.bottom.style,this.endStyle=this.end.style,this.corner=this.main.childNodes[4],this.corner.className+=" corner",this.cornerStyle=this.corner.style,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.height=this.cornerDefaultStyle.height,this.cornerStyle.border=[this.cornerDefaultStyle.borderWidth,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),Object(s["isMobileBrowser"])()&&this.instance.getSetting("isDataViewInstance")&&this.createMultipleSelectorHandles(),this.disappear();const{wtTable:i}=this.wot;let o=i.bordersHolder;o||(o=t.createElement("div"),o.className="htBorders",i.bordersHolder=o,i.spreader.appendChild(o)),o.appendChild(this.main)}createMultipleSelectorHandles(){const{rootDocument:e}=this.wot;this.selectionHandles={top:e.createElement("DIV"),topHitArea:e.createElement("DIV"),bottom:e.createElement("DIV"),bottomHitArea:e.createElement("DIV")};const t=10,n=40;this.selectionHandles.top.className="topSelectionHandle topLeftSelectionHandle",this.selectionHandles.topHitArea.className="topSelectionHandle-HitArea topLeftSelectionHandle-HitArea",this.selectionHandles.bottom.className="bottomSelectionHandle bottomRightSelectionHandle",this.selectionHandles.bottomHitArea.className="bottomSelectionHandle-HitArea bottomRightSelectionHandle-HitArea",this.selectionHandles.styles={top:this.selectionHandles.top.style,topHitArea:this.selectionHandles.topHitArea.style,bottom:this.selectionHandles.bottom.style,bottomHitArea:this.selectionHandles.bottomHitArea.style};const r={position:"absolute",height:n+"px",width:n+"px","border-radius":parseInt(n/1.5,10)+"px"};Object(c["objectEach"])(r,(e,t)=>{this.selectionHandles.styles.bottomHitArea[t]=e,this.selectionHandles.styles.topHitArea[t]=e});const i={position:"absolute",height:t+"px",width:t+"px","border-radius":parseInt(t/1.5,10)+"px",background:"#F5F5FF",border:"1px solid #4285c8"};Object(c["objectEach"])(i,(e,t)=>{this.selectionHandles.styles.bottom[t]=e,this.selectionHandles.styles.top[t]=e}),this.main.appendChild(this.selectionHandles.top),this.main.appendChild(this.selectionHandles.bottom),this.main.appendChild(this.selectionHandles.topHitArea),this.main.appendChild(this.selectionHandles.bottomHitArea)}isPartRange(e,t){const n=this.wot.selectionManager.getAreaSelection();return!(!n.cellRange||e===n.cellRange.to.row&&t===n.cellRange.to.col)}updateMultipleSelectionHandlesPosition(e,t,n,r,i,o){const s=this.wot.wtSettings.getSetting("rtlMode"),a=s?"right":"left",{top:l,topHitArea:c,bottom:h,bottomHitArea:u}=this.selectionHandles.styles,d=parseInt(l.borderWidth,10),p=parseInt(l.width,10),f=parseInt(c.width,10),g=this.wot.wtTable.getWidth(),m=this.wot.wtTable.getHeight();l.top=parseInt(n-p-1,10)+"px",l[a]=parseInt(r-p-1,10)+"px",c.top=parseInt(n-f/4*3,10)+"px",c[a]=parseInt(r-f/4*3,10)+"px";const y=Math.min(parseInt(r+i,10),g-p-2*d),w=Math.min(parseInt(r+i-f/4,10),g-f-2*d);h[a]=y+"px",u[a]=w+"px";const b=Math.min(parseInt(n+o,10),m-p-2*d),v=Math.min(parseInt(n+o-f/4,10),m-f-2*d);h.top=b+"px",u.top=v+"px",this.settings.border.cornerVisible&&this.settings.border.cornerVisible()?(l.display="block",c.display="block",this.isPartRange(e,t)?(h.display="none",u.display="none"):(h.display="block",u.display="block")):(l.display="none",h.display="none",c.display="none",u.display="none"),e===this.wot.wtSettings.getSetting("fixedRowsTop")||t===this.wot.wtSettings.getSetting("fixedColumnsStart")?(l.zIndex="9999",c.zIndex="9999"):(l.zIndex="",c.zIndex="")}appear(e){if(this.disabled)return;const{wtTable:t,rootDocument:n,rootWindow:i}=this.wot;let o,a,l,c,h,u;const d=t.getRenderedRowsCount();for(let r=0;r<d;r+=1){const n=t.rowFilter.renderedToSource(r);if(n>=e[0]&&n<=e[2]){o=n,h=e[0];break}}for(let r=d-1;r>=0;r-=1){const n=t.rowFilter.renderedToSource(r);if(n>=e[0]&&n<=e[2]){a=n;break}}const p=t.getRenderedColumnsCount();for(let r=0;r<p;r+=1){const n=t.columnFilter.renderedToSource(r);if(n>=e[1]&&n<=e[3]){l=n,u=e[1];break}}for(let r=p-1;r>=0;r-=1){const n=t.columnFilter.renderedToSource(r);if(n>=e[1]&&n<=e[3]){c=n;break}}if(void 0===o||void 0===l)return void this.disappear();let f=t.getCell(this.wot.createCellCoords(o,l));const g=o!==a||l!==c,m=g?t.getCell(this.wot.createCellCoords(a,c)):f,y=Object(r["offset"])(f),w=g?Object(r["offset"])(m):y,b=Object(r["offset"])(t.TABLE),v=Object(r["outerWidth"])(t.TABLE),E=y.top,C=y.left,S=this.wot.wtSettings.getSetting("rtlMode");let R=0,T=0;if(S){const e=Object(r["outerWidth"])(f),t=i.innerWidth-b.left-v;T=C+e-w.left,R=i.innerWidth-C-e-t-1}else T=w.left+Object(r["outerWidth"])(m)-C,R=C-b.left-1;if(this.isEntireColumnSelected(o,a)){const e=this.getDimensionsFromHeader("columns",l,c,h,b);let t=null;e&&([t,R,T]=e),t&&(f=t)}let O=E-b.top-1,N=w.top+Object(r["outerHeight"])(m)-E;if(this.isEntireRowSelected(l,c)){const e=this.getDimensionsFromHeader("rows",o,a,u,b);let t=null;e&&([t,O,N]=e),t&&(f=t)}const A=Object(r["getComputedStyle"])(f,i);parseInt(A.borderTopWidth,10)>0&&(O+=1,N=N>0?N-1:0),parseInt(A[S?"borderRightWidth":"borderLeftWidth"],10)>0&&(R+=1,T=T>0?T-1:0);const I=S?"right":"left";this.topStyle.top=O+"px",this.topStyle[I]=R+"px",this.topStyle.width=T+"px",this.topStyle.display="block",this.startStyle.top=O+"px",this.startStyle[I]=R+"px",this.startStyle.height=N+"px",this.startStyle.display="block";const M=Math.floor(this.settings.border.width/2);this.bottomStyle.top=O+N-M+"px",this.bottomStyle[I]=R+"px",this.bottomStyle.width=T+"px",this.bottomStyle.display="block",this.endStyle.top=O+"px",this.endStyle[I]=R+T-M+"px",this.endStyle.height=N+1+"px",this.endStyle.display="block";let x=this.settings.border.cornerVisible;x="function"===typeof x?x(this.settings.layerLevel):x;const _=this.wot.getSetting("onModifyGetCellCoords",a,c);let[L,P]=[a,c];if(_&&Array.isArray(_)&&([,,L,P]=_),Object(s["isMobileBrowser"])()||!x||this.isPartRange(L,P))this.cornerStyle.display="none";else{this.cornerStyle.top=O+N+this.cornerCenterPointOffset-1+"px",this.cornerStyle[I]=R+T+this.cornerCenterPointOffset-1+"px",this.cornerStyle.borderRightWidth=this.cornerDefaultStyle.borderWidth,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="none";let e=Object(r["getTrimmingContainer"])(t.TABLE);const o=e===i;o&&(e=n.documentElement);const s=parseInt(this.cornerDefaultStyle.width,10)/2,l=parseInt(this.cornerDefaultStyle.height,10)/2;if(c===this.wot.getSetting("totalColumns")-1){const t=o?m.getBoundingClientRect().left:m.offsetLeft;let n=!1,i=0;S?(i=t-parseInt(this.cornerDefaultStyle.width,10)/2,n=i<0):(i=t+Object(r["outerWidth"])(m)+parseInt(this.cornerDefaultStyle.width,10)/2,n=i>=Object(r["innerWidth"])(e)),n&&(this.cornerStyle[I]=Math.floor(R+T+this.cornerCenterPointOffset-s)+"px",this.cornerStyle[S?"borderLeftWidth":"borderRightWidth"]=0)}if(a===this.wot.getSetting("totalRows")-1){const t=o?m.getBoundingClientRect().top:m.offsetTop,n=t+Object(r["outerHeight"])(m)+parseInt(this.cornerDefaultStyle.height,10)/2,i=n>=Object(r["innerHeight"])(e);i&&(this.cornerStyle.top=Math.floor(O+N+this.cornerCenterPointOffset-l)+"px",this.cornerStyle.borderBottomWidth=0)}this.cornerStyle.display="block"}Object(s["isMobileBrowser"])()&&this.instance.getSetting("isDataViewInstance")&&this.updateMultipleSelectionHandlesPosition(a,c,O,R,T,N)}isEntireColumnSelected(e,t){return e===this.wot.wtTable.getFirstRenderedRow()&&t===this.wot.wtTable.getLastRenderedRow()}isEntireRowSelected(e,t){return e===this.wot.wtTable.getFirstRenderedColumn()&&t===this.wot.wtTable.getLastRenderedColumn()}getDimensionsFromHeader(e,t,n,i,o){const{wtTable:s}=this.wot,a=s.wtRootElement.parentNode;let l=null,c=null,h=null,u=null,d=null,p=null,f=null,g=null;switch(e){case"rows":l=function(){return s.getRowHeader(...arguments)},c=function(){return Object(r["outerHeight"])(...arguments)},h="ht__selection--rows",p="top";break;case"columns":l=function(){return s.getColumnHeader(...arguments)},c=function(){return Object(r["outerWidth"])(...arguments)},h="ht__selection--columns",p="left";break;default:}if(a.classList.contains(h)){const e=this.wot.getSetting("columnHeaders").length;if(f=l(t,e-i),g=l(n,e-i),!f||!g)return!1;const s=Object(r["offset"])(f),a=Object(r["offset"])(g);return f&&g&&(u=s[p]-o[p]-1,d=a[p]+c(g)-s[p]),[f,u,d]}return!1}changeBorderStyle(e,t){const n=this[e].style,i=t[e];!i||i.hide?Object(r["addClass"])(this[e],"hidden"):(Object(r["hasClass"])(this[e],"hidden")&&Object(r["removeClass"])(this[e],"hidden"),n.backgroundColor=i.color,"top"!==e&&"bottom"!==e||(n.height=i.width+"px"),"start"!==e&&"end"!==e||(n.width=i.width+"px"))}changeBorderToDefaultStyle(e){const t={width:1,color:"#000"},n=this[e].style;n.backgroundColor=t.color,n.width=t.width+"px",n.height=t.width+"px"}toggleHiddenClass(e,t){this.changeBorderToDefaultStyle(e),t?Object(r["addClass"])(this[e],"hidden"):Object(r["removeClass"])(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",Object(s["isMobileBrowser"])()&&this.instance.getSetting("isDataViewInstance")&&(this.selectionHandles.styles.top.display="none",this.selectionHandles.styles.topHitArea.display="none",this.selectionHandles.styles.bottom.display="none",this.selectionHandles.styles.bottomHitArea.display="none")}destroy(){this.eventManager.destroyWithOwnEventsOnly(),this.main.parentNode.removeChild(this.main)}}var Pr=Lr;function kr(e,t){Hr(e,t),t.add(e)}function jr(e,t,n){Hr(e,t),t.set(e,n)}function Hr(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Dr(e,t){return e.get(Ur(e,t))}function Fr(e,t,n){return e.set(Ur(e,t),n),n}function Ur(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 Vr=new WeakMap,Br=new WeakMap,Wr=new WeakMap,Gr=new WeakMap,zr=new WeakMap,Yr=new WeakMap,Xr=new WeakSet;class Kr{constructor(e){kr(this,Xr),jr(this,Vr,void 0),jr(this,Br,void 0),jr(this,Wr,new xr),jr(this,Gr,new WeakMap),jr(this,zr,new WeakSet),jr(this,Yr,new Map),Fr(Br,this,e)}setActiveOverlay(e){return Fr(Vr,this,e),Dr(Wr,this).setActiveOverlay(Dr(Vr,this)),Dr(Gr,this).has(Dr(Vr,this))||Dr(Gr,this).set(Dr(Vr,this),new Set),this}getFocusSelection(){return null!==Dr(Br,this)?Dr(Br,this).getFocus():null}getAreaSelection(){return null!==Dr(Br,this)?Dr(Br,this).createLayeredArea():null}getBorderInstance(e){if(!e.settings.border)return null;if(Dr(Yr,this).has(e)){const t=Dr(Yr,this).get(e);if(t.has(Dr(Vr,this)))return t.get(Dr(Vr,this));const n=new Pr(Dr(Vr,this),e.settings);return t.set(Dr(Vr,this),n),n}const t=new Pr(Dr(Vr,this),e.settings);return Dr(Yr,this).set(e,new Map([[Dr(Vr,this),t]])),t}getBorderInstances(e){var t,n;return Array.from(null!==(t=null===(n=Dr(Yr,this).get(e))||void 0===n?void 0:n.values())&&void 0!==t?t:[])}destroyBorders(e){Dr(Yr,this).get(e).forEach(e=>e.destroy()),Dr(Yr,this).delete(e)}render(e){if(null===Dr(Br,this))return;e&&Ur(Xr,this,$r).call(this);const t=Array.from(Dr(Br,this)),n=new Map,i=new Map;for(let r=0;r<t.length;r++){const e=t[r],{className:o,headerAttributes:s,createLayers:a,selectionType:l}=e.settings;Dr(zr,this).has(e)||(Dr(zr,this).add(e),e.addLocalHook("destroy",()=>this.destroyBorders(e)));const c=this.getBorderInstance(e);if(e.isEmpty()){null===c||void 0===c||c.disappear();continue}if(o){const t=Dr(Wr,this).setActiveSelection(e).scan();t.forEach(e=>{if(n.has(e)){const t=n.get(e);t.has(o)&&!0===a?t.set(o,t.get(o)+1):t.set(o,1)}else n.set(e,new Map([[o,1]]));s&&(i.has(e)||i.set(e,[]),"TH"===e.nodeName&&i.get(e).push(...s))})}const h=e.getCorners();Dr(Vr,this).getSetting("onBeforeDrawBorders",h,l),null===c||void 0===c||c.appear(h)}n.forEach((e,t)=>{var n;const i=Array.from(e).map(e=>{let[t,n]=e;return 1===n?t:[t,...Array.from({length:n-1},(e,n)=>`${t}-${n+1}`)]}).flat();i.forEach(e=>Dr(Gr,this).get(Dr(Vr,this)).add(e)),Object(r["addClass"])(t,i),"TD"===t.nodeName&&Array.isArray(null===(n=Dr(Br,this).options)||void 0===n?void 0:n.cellAttributes)&&Object(r["setAttribute"])(t,Dr(Br,this).options.cellAttributes)}),Array.from(i.keys()).forEach(e=>{Object(r["setAttribute"])(e,[...i.get(e)])})}}function $r(){const e=Dr(Gr,this).get(Dr(Vr,this)),t=Dr(Vr,this).wtSettings.getSetting("onBeforeRemoveCellClassNames");if(Array.isArray(t))for(let n=0;n<t.length;n++)e.add(t[n]);e.forEach(e=>{var t,n;const i=Dr(Vr,this).wtTable.TABLE.querySelectorAll("."+e);let o=[];Array.isArray(null===(t=Dr(Br,this).options)||void 0===t?void 0:t.cellAttributes)&&(o=Dr(Br,this).options.cellAttributes.map(e=>e[0])),Array.isArray(null===(n=Dr(Br,this).options)||void 0===n?void 0:n.headerAttributes)&&(o=[...o,...Dr(Br,this).options.headerAttributes.map(e=>e[0])]);for(let s=0,a=i.length;s<a;s++)Object(r["removeClass"])(i[s],e),Object(r["removeAttribute"])(i[s],o)}),e.clear()}class qr extends un{constructor(e,t){super(e,new sr(t));const n=this.wtSettings.getSetting("facade",this);this.wtTable=new lr(this.getTableDao(),n,this.domBindings,this.wtSettings),this.wtViewport=new Er(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new Kr(this.wtSettings.getSetting("selections")),this.wtEvent=new te(n,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new nr(this,n,this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.exportSettingsAsClassNames(),this.findOriginalHeaders()}exportSettingsAsClassNames(){const e={rowHeaders:"htRowHeaders",columnHeaders:"htColumnHeaders"},t=[],n=[];Object(c["objectEach"])(e,(e,r)=>{this.wtSettings.getSetting(r).length&&n.push(e),t.push(e)}),Object(r["removeClass"])(this.wtTable.wtRootElement.parentNode,t),Object(r["addClass"])(this.wtTable.wtRootElement.parentNode,n)}getViewportDao(){const e=this;return{get wot(){return e},get topOverlayTrimmingContainer(){return e.wtOverlays.topOverlay.trimmingContainer},get inlineStartOverlayTrimmingContainer(){return e.wtOverlays.inlineStartOverlay.trimmingContainer},get topScrollPosition(){return e.wtOverlays.topOverlay.getScrollPosition()},get topParentOffset(){return e.wtOverlays.topOverlay.getTableParentOffset()},get inlineStartScrollPosition(){return e.wtOverlays.inlineStartOverlay.getScrollPosition()},get inlineStartParentOffset(){return e.wtOverlays.inlineStartOverlay.getTableParentOffset()},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get bottomOverlay(){return e.wtOverlays.bottomOverlay}}}}class Qr{constructor(e){e instanceof un?this._wot=e:this._initFromSettings(e)}_initFromSettings(e){e.facade=e=>{const t=new Qr(e);return()=>t},this._wot=new qr(e.table,e)}get guid(){return this._wot.guid}get rootDocument(){return this._wot.domBindings.rootDocument}get rootWindow(){return this._wot.domBindings.rootWindow}get wtSettings(){return this._wot.wtSettings}get cloneSource(){return this._wot.cloneSource}get cloneOverlay(){return this._wot.cloneOverlay}get selectionManager(){return this._wot.selectionManager}get wtViewport(){return this._wot.wtViewport}get wtOverlays(){return this._wot.wtOverlays}get wtTable(){return this._wot.wtTable}get wtEvent(){return this._wot.wtEvent}get wtScroll(){return this._wot.wtScroll}get drawn(){return this._wot.drawn}set drawn(e){this._wot.drawn=e}get drawInterrupted(){return this._wot.drawInterrupted}set drawInterrupted(e){this._wot.drawInterrupted=e}get lastMouseOver(){return this._wot.lastMouseOver}set lastMouseOver(e){this._wot.lastMouseOver=e}get momentumScrolling(){return this._wot.momentumScrolling}set momentumScrolling(e){this._wot.momentumScrolling=e}get touchApplied(){return this._wot.touchApplied}set touchApplied(e){this._wot.touchApplied=e}get domBindings(){return this._wot.domBindings}get eventListeners(){return this._wot.eventListeners}set eventListeners(e){this._wot.eventListeners=e}get eventManager(){return this._wot.eventManager}createCellCoords(e,t){return this._wot.createCellCoords(e,t)}createCellRange(e,t,n){return this._wot.createCellRange(e,t,n)}draw(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._wot.draw(e),this}getCell(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._wot.getCell(e,t)}scrollViewport(e,t,n,r,i){return this._wot.scrollViewport(e,t,n,r,i)}scrollViewportHorizontally(e,t,n){return this._wot.scrollViewportHorizontally(e,t,n)}scrollViewportVertically(e,t,n){return this._wot.scrollViewportVertically(e,t,n)}getViewport(){return this._wot.getViewport()}getOverlayName(){return this._wot.cloneOverlay?this._wot.cloneOverlay.type:"master"}exportSettingsAsClassNames(){return this._wot.exportSettingsAsClassNames()}update(e,t){return this._wot.wtSettings.update(e,t),this}getSetting(e,t,n,r,i){return this._wot.wtSettings.getSetting(e,t,n,r,i)}hasSetting(e){return this._wot.wtSettings.hasSetting(e)}destroy(){this._wot.destroy()}}function Zr(e){let{isShiftKey:t,isLeftClick:n,isRightClick:r,coords:i,selection:o,controller:s,cellCoordsFactory:a}=e;const l=o.isSelected()?o.getSelectedRange().current():null,c=o.isSelectedByCorner(),h=o.isSelectedByRowHeader();if(o.markSource("mouse"),t&&l)i.row>=0&&i.col>=0&&!s.cell?o.setRangeEnd(i):(c||h)&&i.row>=0&&i.col>=0&&!s.cell?o.setRangeEnd(a(i.row,i.col)):c&&i.row<0&&!s.column?o.setRangeEnd(a(l.to.row,i.col)):h&&i.col<0&&!s.row?o.setRangeEnd(a(i.row,l.to.col)):(!c&&!h&&i.col<0||c&&i.col<0)&&!s.row?o.selectRows(Math.max(l.from.row,0),i.row,i.col):(!c&&!h&&i.row<0||h&&i.row<0)&&!s.column&&o.selectColumns(Math.max(l.from.col,0),i.col,i.row);else{const e=!o.inInSelection(i),t=n||r&&e;i.row<0&&i.col>=0&&!s.column?t&&o.selectColumns(i.col,i.col,i.row):i.col<0&&i.row>=0&&!s.row?t&&o.selectRows(i.row,i.row,i.col):i.col>=0&&i.row>=0&&!s.cell?t&&o.setRangeStart(i):i.col<0&&i.row<0&&o.selectAll(!0,!0,{disableHeadersHighlight:!0,focusPosition:{row:0,col:0}})}o.markEndSource()}function Jr(e){let{isLeftClick:t,coords:n,selection:r,controller:i,cellCoordsFactory:o}=e;if(!t)return;const s=r.isSelectedByRowHeader(),a=r.isSelectedByColumnHeader(),l=r.tableProps.countCols(),c=r.tableProps.countRows();r.markSource("mouse"),a&&!i.column?r.setRangeEnd(o(c-1,n.col)):s&&!i.row?r.setRangeEnd(o(n.row,l-1)):i.cell||r.setRangeEnd(n),r.markEndSource()}const ei=new Map([["mousedown",Zr],["mouseover",Jr],["touchstart",Zr]]);function ti(e,t){let{coords:n,selection:r,controller:i,cellCoordsFactory:o}=t;ei.get(e.type)({coords:n,selection:r,controller:i,cellCoordsFactory:o,isShiftKey:e.shiftKey,isLeftClick:Object(H["isLeftClick"])(e)||"touchstart"===e.type,isRightClick:Object(H["isRightClick"])(e)})}const ni=new WeakMap,ri=Symbol("rootInstance");function ii(e){ni.set(e,!0)}function oi(e){return e===ri}function si(e){return ni.has(e)}function ai(e,t){ci(e,t),t.add(e)}function li(e,t,n){ci(e,t),t.set(e,n)}function ci(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}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)}function pi(e,t){return e.get(gi(e,t))}function fi(e,t,n){return e.set(gi(e,t),n),n}function gi(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 mi=new WeakMap,yi=new WeakMap,wi=new WeakMap,bi=new WeakMap,vi=new WeakMap,Ei=new WeakMap,Ci=new WeakMap,Si=new WeakSet;class Ri{constructor(e){ai(this,Si),hi(this,"hot",void 0),hi(this,"eventManager",void 0),hi(this,"settings",void 0),hi(this,"THEAD",void 0),hi(this,"TBODY",void 0),hi(this,"_wt",void 0),hi(this,"activeWt",void 0),li(this,mi,0),li(this,yi,0),hi(this,"postponedAdjustElementsSize",!1),li(this,wi,!1),li(this,bi,void 0),li(this,vi,void 0),li(this,Ei,0),li(this,Ci,0),this.hot=e,this.eventManager=new l["a"](this.hot),this.settings=this.hot.getSettings(),this.createElements(),this.registerEvents(),this.initializeWalkontable()}render(){this.hot.isRenderSuspended()||(this.hot.runHooks("beforeRender",this.hot.forceFullRender),this.postponedAdjustElementsSize&&(this.postponedAdjustElementsSize=!1,this.adjustElementsSize(!0)),this._wt.draw(!this.hot.forceFullRender),this.hot.runHooks("afterRender",this.hot.forceFullRender),this.hot.forceFullRender=!1,this.hot.renderCall=!1)}adjustElementsSize(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.hot.isRenderSuspended()?this.postponedAdjustElementsSize=!0:this._wt.wtOverlays.adjustElementsSize(e)}getCellAtCoords(e,t){const n=this._wt.getCell(e,t);return n<0?null:n}scrollViewport(e,t,n,r,i){return this._wt.scrollViewport(e,t,n,r,i)}scrollViewportHorizontally(e,t,n){return this._wt.scrollViewportHorizontally(e,t,n)}scrollViewportVertically(e,t,n){return this._wt.scrollViewportVertically(e,t,n)}createElements(){const{rootElement:e,rootDocument:t}=this.hot,n=e.getAttribute("style");n&&e.setAttribute("data-originalstyle",n),Object(r["addClass"])(e,"handsontable"),fi(vi,this,t.createElement("TABLE")),Object(r["addClass"])(pi(vi,this),"htCore"),this.hot.getSettings().tableClassName&&Object(r["addClass"])(pi(vi,this),this.hot.getSettings().tableClassName),this.settings.ariaTags&&(Object(r["setAttribute"])(pi(vi,this),[Object(He["x"])()]),Object(r["setAttribute"])(e,[Object(He["M"])(),Object(He["B"])(-1),Object(He["e"])(this.hot.countCols()),Object(He["u"])()])),this.THEAD=t.createElement("THEAD"),pi(vi,this).appendChild(this.THEAD),this.TBODY=t.createElement("TBODY"),pi(vi,this).appendChild(this.TBODY),this.hot.table=pi(vi,this),this.hot.container.insertBefore(pi(vi,this),this.hot.container.firstChild)}registerEvents(){const{rootElement:e,rootDocument:t,selection:n,rootWindow:i}=this.hot,o=t.documentElement;this.eventManager.addEventListener(e,"mousedown",e=>{fi(wi,this,!0),this.isTextSelectionAllowed(e.target)||(Object(r["clearTextSelection"])(i),e.preventDefault(),i.focus())}),this.eventManager.addEventListener(e,"mouseup",()=>{fi(wi,this,!1)}),this.eventManager.addEventListener(e,"mousemove",e=>{pi(wi,this)&&!this.isTextSelectionAllowed(e.target)&&(this.settings.fragmentSelection&&Object(r["clearTextSelection"])(i),e.preventDefault())}),this.eventManager.addEventListener(o,"keyup",e=>{n.isInProgress()&&!e.shiftKey&&n.finish()}),this.eventManager.addEventListener(o,"mouseup",i=>{n.isInProgress()&&Object(H["isLeftClick"])(i)&&n.finish(),fi(bi,this,!1);const o=Object(r["isOutsideInput"])(t.activeElement);Object(r["isInput"])(t.activeElement)&&!o||!o&&(n.isSelected()||n.isSelectedByAnyHeader()||e.contains(i.target)||Object(H["isRightClick"])(i))||this.hot.unlisten()}),this.eventManager.addEventListener(o,"contextmenu",e=>{n.isInProgress()&&Object(H["isRightClick"])(e)&&(n.finish(),fi(bi,this,!1))}),this.eventManager.addEventListener(o,"touchend",()=>{n.isInProgress()&&n.finish(),fi(bi,this,!1)}),this.eventManager.addEventListener(o,"mousedown",n=>{const i=n.target,s=n.x||n.clientX,a=n.y||n.clientY;let l=n.target;if(pi(bi,this)||!e||!this.hot.view)return;const{holder:c}=this.hot.view._wt.wtTable;if(l===c){const e=Object(r["getScrollbarWidth"])(t);if(t.elementFromPoint(s+e,a)!==c||t.elementFromPoint(s,a+e)!==c)return}else while(l!==o){if(null===l){if(n.isTargetWebComponent)break;return}if(l===e)return;l=l.parentNode}const h="function"===typeof this.settings.outsideClickDeselects?this.settings.outsideClickDeselects(i):this.settings.outsideClickDeselects;h?this.hot.deselectCell():this.hot.destroyEditor(!1,!1)});let s=Object(r["getParentWindow"])(i);while(null!==s)this.eventManager.addEventListener(s.document.documentElement,"click",()=>{this.hot.unlisten()}),s=Object(r["getParentWindow"])(s);this.eventManager.addEventListener(pi(vi,this),"selectstart",e=>{this.settings.fragmentSelection||Object(r["isInput"])(e.target)||e.preventDefault()})}translateFromRenderableToVisualCoords(e){let{row:t,col:n}=e;return this.hot._createCellCoords(...this.translateFromRenderableToVisualIndex(t,n))}translateFromRenderableToVisualIndex(e,t){let n=e>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(e):e,r=t>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(t):t;return null===n&&(n=e),null===r&&(r=t),[n,r]}countRenderableIndexes(e,t){const n=Math.min(e.getNotTrimmedIndexesLength(),t),r=e.getNearestNotHiddenIndex(n-1,-1);return null===r?0:e.getRenderableFromVisualIndex(r)+1}countRenderableColumns(){return this.countRenderableIndexes(this.hot.columnIndexMapper,this.settings.maxCols)}countRenderableRows(){return this.countRenderableIndexes(this.hot.rowIndexMapper,this.settings.maxRows)}countNotHiddenRowIndexes(e,t){return this.countNotHiddenIndexes(e,t,this.hot.rowIndexMapper,this.countRenderableRows())}countNotHiddenColumnIndexes(e,t){return this.countNotHiddenIndexes(e,t,this.hot.columnIndexMapper,this.countRenderableColumns())}countNotHiddenIndexes(e,t,n,r){if(isNaN(e)||e<0)return 0;const i=n.getNearestNotHiddenIndex(e,t),o=n.getRenderableFromVisualIndex(i);if(!Number.isInteger(o))return 0;let s=0;return t<0?s=o+1:t>0&&(s=r-o),s}countNotHiddenFixedColumnsStart(){const e=this.hot.countCols(),t=Math.min(parseInt(this.settings.fixedColumnsStart,10),e)-1;return this.countNotHiddenColumnIndexes(t,-1)}countNotHiddenFixedRowsTop(){const e=this.hot.countRows(),t=Math.min(parseInt(this.settings.fixedRowsTop,10),e)-1;return this.countNotHiddenRowIndexes(t,-1)}countNotHiddenFixedRowsBottom(){const e=this.hot.countRows(),t=Math.max(e-parseInt(this.settings.fixedRowsBottom,10),0);return this.countNotHiddenRowIndexes(t,1)}countRenderableColumnsInRange(e,t){let n=0;for(let r=e;r<=t;r++)null!==this.hot.columnIndexMapper.getRenderableFromVisualIndex(r)&&(n+=1);return n}countRenderableRowsInRange(e,t){let n=0;for(let r=e;r<=t;r++)null!==this.hot.rowIndexMapper.getRenderableFromVisualIndex(r)&&(n+=1);return n}isMainTableNotFullyCoveredByOverlays(){const e=this.countNotHiddenFixedRowsTop()+this.countNotHiddenFixedRowsBottom(),t=this.countNotHiddenFixedColumnsStart();return this.hot.countRenderedRows()>e&&this.hot.countRenderedCols()>t}initializeWalkontable(){const e={ariaTags:this.settings.ariaTags,rtlMode:this.hot.isRtl(),externalRowCalculator:this.hot.getPlugin("autoRowSize")&&this.hot.getPlugin("autoRowSize").isEnabled(),table:pi(vi,this),isDataViewInstance:()=>si(this.hot),preventOverflow:()=>this.settings.preventOverflow,preventWheel:()=>this.settings.preventWheel,stretchH:()=>this.settings.stretchH,data:(e,t)=>this.hot.getDataAtCell(...this.translateFromRenderableToVisualIndex(e,t)),totalRows:()=>this.countRenderableRows(),totalColumns:()=>this.countRenderableColumns(),fixedColumnsStart:()=>this.countNotHiddenFixedColumnsStart(),fixedRowsTop:()=>this.countNotHiddenFixedRowsTop(),fixedRowsBottom:()=>this.countNotHiddenFixedRowsBottom(),shouldRenderInlineStartOverlay:()=>this.settings.fixedColumnsStart>0||e.rowHeaders().length>0,shouldRenderTopOverlay:()=>this.settings.fixedRowsTop>0||e.columnHeaders().length>0,shouldRenderBottomOverlay:()=>this.settings.fixedRowsBottom>0,minSpareRows:()=>this.settings.minSpareRows,renderAllRows:this.settings.renderAllRows,renderAllColumns:this.settings.renderAllColumns,rowHeaders:()=>{const e=[];return this.hot.hasRowHeaders()&&e.push((e,t)=>{const n=e>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(e):e;this.appendRowHeader(n,t)}),this.hot.runHooks("afterGetRowHeaderRenderers",e),fi(yi,this,e.length),this.hot.getSettings().ariaTags&&gi(Si,this,Ti).call(this)===this.hot.countCols()&&gi(Si,this,Oi).call(this,pi(yi,this)),e},columnHeaders:()=>{const e=[];return this.hot.hasColHeaders()&&e.push((e,t)=>{const n=e>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(e):e;this.appendColHeader(n,t)}),this.hot.runHooks("afterGetColumnHeaderRenderers",e),fi(mi,this,e.length),e},columnWidth:e=>{const t=this.hot.columnIndexMapper.getVisualFromRenderableIndex(e);return this.hot.getColWidth(null===t?e:t)},rowHeight:e=>{const t=this.hot.rowIndexMapper.getVisualFromRenderableIndex(e);return this.hot.getRowHeight(null===t?e:t)},cellRenderer:(e,t,n)=>{const[r,i]=this.translateFromRenderableToVisualIndex(e,t),o=this.hot.runHooks("modifyGetCellCoords",r,i);let s=r,a=i;Array.isArray(o)&&([s,a]=o);const l=this.hot.getCellMeta(s,a),c=this.hot.colToProp(a);let h=this.hot.getDataAtRowProp(s,c);this.hot.hasHook("beforeValueRender")&&(h=this.hot.runHooks("beforeValueRender",h,l)),this.hot.runHooks("beforeRenderer",n,r,i,c,h,l),this.hot.getCellRenderer(l)(this.hot,n,r,i,c,h,l),this.hot.runHooks("afterRenderer",n,r,i,c,h,l)},selections:this.hot.selection.highlight,hideBorderOnMouseDownOver:()=>this.settings.fragmentSelection,onWindowResize:()=>{this.hot&&!this.hot.isDestroyed&&this.hot.refreshDimensions()},onContainerElementResize:()=>{this.hot&&!this.hot.isDestroyed&&Object(r["isVisible"])(this.hot.rootElement)&&this.hot.refreshDimensions()},onCellMouseDown:(e,t,n,r)=>{const i=this.translateFromRenderableToVisualCoords(t),o={row:!1,column:!1,cell:!1};this.hot.listen(),this.activeWt=r,fi(bi,this,!0),this.hot.runHooks("beforeOnCellMouseDown",e,i,n,o),Object(H["isImmediatePropagationStopped"])(e)||(ti(e,{coords:i,selection:this.hot.selection,controller:o,cellCoordsFactory:(e,t)=>this.hot._createCellCoords(e,t)}),this.hot.runHooks("afterOnCellMouseDown",e,i,n),this.activeWt=this._wt)},onCellContextMenu:(e,t,n,r)=>{const i=this.translateFromRenderableToVisualCoords(t);this.activeWt=r,fi(bi,this,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",e,i,n),Object(H["isImmediatePropagationStopped"])(e)||(this.hot.runHooks("afterOnCellContextMenu",e,i,n),this.activeWt=this._wt)},onCellMouseOut:(e,t,n,r)=>{const i=this.translateFromRenderableToVisualCoords(t);this.activeWt=r,this.hot.runHooks("beforeOnCellMouseOut",e,i,n),Object(H["isImmediatePropagationStopped"])(e)||(this.hot.runHooks("afterOnCellMouseOut",e,i,n),this.activeWt=this._wt)},onCellMouseOver:(e,t,n,r)=>{const i=this.translateFromRenderableToVisualCoords(t),o={row:!1,column:!1,cell:!1};this.activeWt=r,this.hot.runHooks("beforeOnCellMouseOver",e,i,n,o),Object(H["isImmediatePropagationStopped"])(e)||(pi(bi,this)&&ti(e,{coords:i,selection:this.hot.selection,controller:o,cellCoordsFactory:(e,t)=>this.hot._createCellCoords(e,t)}),this.hot.runHooks("afterOnCellMouseOver",e,i,n),this.activeWt=this._wt)},onCellMouseUp:(e,t,n,r)=>{const i=this.translateFromRenderableToVisualCoords(t);this.activeWt=r,this.hot.runHooks("beforeOnCellMouseUp",e,i,n),Object(H["isImmediatePropagationStopped"])(e)||this.hot.isDestroyed||(this.hot.runHooks("afterOnCellMouseUp",e,i,n),this.activeWt=this._wt)},onCellCornerMouseDown:e=>{e.preventDefault(),this.hot.runHooks("afterOnCellCornerMouseDown",e)},onCellCornerDblClick:e=>{e.preventDefault(),this.hot.runHooks("afterOnCellCornerDblClick",e)},beforeDraw:(e,t)=>this.beforeRender(e,t),onDraw:e=>this.afterRender(e),onBeforeViewportScrollVertically:e=>{const t=this.hot.rowIndexMapper,n=e<0;let r=e;return n||(r=t.getVisualFromRenderableIndex(e),null!==r)?(r=this.hot.runHooks("beforeViewportScrollVertically",r),this.hot.runHooks("beforeViewportScroll"),n?r:t.getRenderableFromVisualIndex(r)):e},onBeforeViewportScrollHorizontally:e=>{const t=this.hot.columnIndexMapper,n=e<0;let r=e;return n||(r=t.getVisualFromRenderableIndex(e),null!==r)?(r=this.hot.runHooks("beforeViewportScrollHorizontally",r),this.hot.runHooks("beforeViewportScroll"),n?r:t.getRenderableFromVisualIndex(r)):e},onScrollVertically:()=>{this.hot.runHooks("afterScrollVertically"),this.hot.runHooks("afterScroll")},onScrollHorizontally:()=>{this.hot.runHooks("afterScrollHorizontally"),this.hot.runHooks("afterScroll")},onBeforeRemoveCellClassNames:()=>this.hot.runHooks("beforeRemoveCellClassNames"),onBeforeHighlightingRowHeader:(e,t,n)=>{const r=this.hot.rowIndexMapper,i=e<0;let o=e;i||(o=r.getVisualFromRenderableIndex(e));const s=this.hot.runHooks("beforeHighlightingRowHeader",o,t,n);return i?s:r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(s,1))},onBeforeHighlightingColumnHeader:(e,t,n)=>{const r=this.hot.columnIndexMapper,i=e<0;let o=e;i||(o=r.getVisualFromRenderableIndex(e));const s=this.hot.runHooks("beforeHighlightingColumnHeader",o,t,n);return i?s:r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(s,1))},onAfterDrawSelection:(e,t,n)=>{let r;const[i,o]=this.translateFromRenderableToVisualIndex(e,t),s=this.hot.selection.getSelectedRange(),a=s.size();if(a>0){const e=s.peekByIndex(null!==n&&void 0!==n?n:0);r=[e.from.row,e.from.col,e.to.row,e.to.col]}return this.hot.runHooks("afterDrawSelection",i,o,r,n)},onBeforeDrawBorders:(e,t)=>{const[n,r,i,o]=e,s=[this.hot.rowIndexMapper.getVisualFromRenderableIndex(n),this.hot.columnIndexMapper.getVisualFromRenderableIndex(r),this.hot.rowIndexMapper.getVisualFromRenderableIndex(i),this.hot.columnIndexMapper.getVisualFromRenderableIndex(o)];return this.hot.runHooks("beforeDrawBorders",s,t)},onBeforeTouchScroll:()=>this.hot.runHooks("beforeTouchScroll"),onAfterMomentumScroll:()=>this.hot.runHooks("afterMomentumScroll"),onBeforeStretchingColumnWidth:(e,t)=>{const n=this.hot.columnIndexMapper.getVisualFromRenderableIndex(t);return this.hot.runHooks("beforeStretchingColumnWidth",e,n)},onModifyRowHeaderWidth:e=>this.hot.runHooks("modifyRowHeaderWidth",e),onModifyGetCellCoords:(e,t,n)=>{const r=this.hot.rowIndexMapper,i=this.hot.columnIndexMapper,o=t>=0?i.getVisualFromRenderableIndex(t):t,s=e>=0?r.getVisualFromRenderableIndex(e):e,a=this.hot.runHooks("modifyGetCellCoords",s,o,n);if(Array.isArray(a)){const[e,t,n,o]=a;return[e>=0?r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(e,1)):e,t>=0?i.getRenderableFromVisualIndex(i.getNearestNotHiddenIndex(t,1)):t,n>=0?r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(n,-1)):n,o>=0?i.getRenderableFromVisualIndex(i.getNearestNotHiddenIndex(o,-1)):o]}},viewportRowCalculatorOverride:e=>{let t=this.settings.viewportRowRenderingOffset;if("auto"===t&&this.settings.fixedRowsTop&&(t=10),t>0||"auto"===t){const n=this.countRenderableRows(),r=e.startRow,i=e.endRow;if("number"===typeof t)e.startRow=Math.max(r-t,0),e.endRow=Math.min(i+t,n-1);else if("auto"===t){const t=Math.ceil(i/n*12);e.startRow=Math.max(r-t,0),e.endRow=Math.min(i+t,n-1)}}this.hot.runHooks("afterViewportRowCalculatorOverride",e)},viewportColumnCalculatorOverride:e=>{let t=this.settings.viewportColumnRenderingOffset;if("auto"===t&&this.settings.fixedColumnsStart&&(t=10),t>0||"auto"===t){const n=this.countRenderableColumns(),r=e.startColumn,i=e.endColumn;if("number"===typeof t&&(e.startColumn=Math.max(r-t,0),e.endColumn=Math.min(i+t,n-1)),"auto"===t){const t=Math.ceil(i/n*6);e.startColumn=Math.max(r-t,0),e.endColumn=Math.min(i+t,n-1)}}this.hot.runHooks("afterViewportColumnCalculatorOverride",e)},rowHeaderWidth:()=>this.settings.rowHeaderWidth,columnHeaderHeight:()=>{const e=this.hot.runHooks("modifyColumnHeaderHeight");return this.settings.columnHeaderHeight||e}};this.hot.runHooks("beforeInitWalkontable",e),this._wt=new Qr(e),this.activeWt=this._wt;const t=this._wt.wtTable.spreader,{width:n,height:i}=this.hot.rootElement.getBoundingClientRect();this.setLastSize(n,i),this.eventManager.addEventListener(t,"mousedown",e=>{e.target===t&&3===e.which&&e.stopPropagation()}),this.eventManager.addEventListener(t,"contextmenu",e=>{e.target===t&&3===e.which&&e.stopPropagation()}),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"click",()=>{this.settings.observeDOMVisibility&&this._wt.drawInterrupted&&(this.hot.forceFullRender=!0,this.render())})}isTextSelectionAllowed(e){if(Object(r["isInput"])(e))return!0;const t=Object(r["isChildOf"])(e,this.hot.view._wt.wtTable.spreader);return!(!0!==this.settings.fragmentSelection||!t)||(!("cell"!==this.settings.fragmentSelection||!this.isSelectedOnlyCell()||!t)||!(this.settings.fragmentSelection||!this.isCellEdited()||!this.isSelectedOnlyCell()))}isMouseDown(){return pi(bi,this)}isSelectedOnlyCell(){var e,t;return null!==(e=null===(t=this.hot.getSelectedRangeLast())||void 0===t?void 0:t.isSingleCell())&&void 0!==e&&e}isCellEdited(){const e=this.hot.getActiveEditor();return e&&e.isOpened()}beforeRender(e,t){e&&this.hot.runHooks("beforeViewRender",this.hot.forceFullRender,t)}afterRender(e){e&&this.hot.runHooks("afterViewRender",this.hot.forceFullRender)}appendRowHeader(e,t){if(t.firstChild){const n=t.firstChild;if(!Object(r["hasClass"])(n,"relative"))return Object(r["empty"])(t),void this.appendRowHeader(e,t);this.updateCellHeader(n.querySelector(".rowHeader"),e,this.hot.getRowHeader)}else{const{rootDocument:n,getRowHeader:r}=this.hot,i=n.createElement("div"),o=n.createElement("span");i.className="relative",o.className="rowHeader",this.updateCellHeader(o,e,r),i.appendChild(o),t.appendChild(i)}this.hot.runHooks("afterGetRowHeader",e,t)}appendColHeader(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hot.getColHeader,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(t.firstChild){const o=t.firstChild;Object(r["hasClass"])(o,"relative")?this.updateCellHeader(o.querySelector(".colHeader"),e,n,i):(Object(r["empty"])(t),this.appendColHeader(e,t,n,i))}else{const{rootDocument:o}=this.hot,s=o.createElement("div"),a=o.createElement("span");s.className="relative",a.className="colHeader",this.settings.ariaTags&&(Object(r["setAttribute"])(s,...Object(He["x"])()),Object(r["setAttribute"])(a,...Object(He["x"])())),this.updateCellHeader(a,e,n,i),s.appendChild(a),t.appendChild(s)}this.hot.runHooks("afterGetColHeader",e,t,i)}updateCellHeader(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=t;const s=this._wt.wtOverlays.getParentOverlay(e)||this._wt;e.parentNode&&(Object(r["hasClass"])(e,"colHeader")?o=s.wtTable.columnFilter.sourceToRendered(t):Object(r["hasClass"])(e,"rowHeader")&&(o=s.wtTable.rowFilter.sourceToRendered(t))),o>-1?Object(r["fastInnerHTML"])(e,n(t,i)):(Object(r["fastInnerText"])(e,String.fromCharCode(160)),Object(r["addClass"])(e,"cornerHeader"))}maximumVisibleElementWidth(e){const t=this._wt.wtViewport.getWorkspaceWidth(),n=t-e;return n>0?n:0}maximumVisibleElementHeight(e){const t=this._wt.wtViewport.getWorkspaceHeight(),n=t-e;return n>0?n:0}setLastSize(e,t){fi(Ei,this,e),fi(Ci,this,t)}getLastSize(){return{width:pi(Ei,this),height:pi(Ci,this)}}getFirstFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstVisibleRow())}getLastFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastVisibleRow())}getFirstFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstVisibleColumn())}getLastFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastVisibleColumn())}getFirstPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstPartiallyVisibleRow())}getLastPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastPartiallyVisibleRow())}getFirstPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstPartiallyVisibleColumn())}getLastPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastPartiallyVisibleColumn())}getColumnHeadersCount(){return pi(mi,this)}getRowHeadersCount(){return pi(yi,this)}getViewportWidth(){return this.hot.view._wt.wtViewport.getViewportWidth()}getWorkspaceWidth(){return this.hot.view._wt.wtViewport.getWorkspaceWidth()}getViewportHeight(){return this.hot.view._wt.wtViewport.getViewportHeight()}getWorkspaceHeight(){return this.hot.view._wt.wtViewport.getWorkspaceHeight()}destroy(){this._wt.destroy(),this.eventManager.destroy()}}function Ti(){return parseInt(this.hot.rootElement.getAttribute(Object(He["e"])()[0]),10)}function Oi(e){const t=gi(Si,this,Ti).call(this)+e;Object(r["setAttribute"])(this.hot.rootElement,...Object(He["e"])(t))}var Ni=Ri,Ai=n("480c");function Ii(e,t,n){return t=Mi(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mi(e){var t=xi(e,"string");return"symbol"==typeof t?t:t+""}function xi(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 _i{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];Ii(this,"hot",void 0),Ii(this,"data",void 0),Ii(this,"dataType","array"),Ii(this,"colToProp",()=>{}),Ii(this,"propToCol",()=>{}),this.hot=e,this.data=t}modifyRowData(e){let t;return this.hot.hasHook("modifyRowData")&&(t=this.hot.runHooks("modifyRowData",e)),void 0===t||Number.isInteger(t)?this.data[e]:t}getData(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.data&&0!==this.data.length?this.getByRange(null,null,e):this.data}setData(e){this.data=e}getAtColumn(e){const t=[];return Object(I["arrayEach"])(this.data,(n,r)=>{const i=this.getAtCell(r,e);t.push(i)}),t}getAtRow(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=void 0===t&&void 0===n;let s=null,a=null;if(s=this.modifyRowData(e),Array.isArray(s))a=[],o?s.forEach((t,n)=>{a[n]=this.getAtPhysicalCell(e,n,s)}):Object(j["rangeEach"])(t,n,n=>{a[n-t]=this.getAtPhysicalCell(e,n,s)});else if(Object(c["isObject"])(s)||Object(i["isFunction"])(s))if(a=r?[]:{},!o||r){const i=0,o=this.countFirstRowKeys()-1;Object(j["rangeEach"])(i,o,l=>{const h=this.colToProp(l);if(l>=(t||i)&&l<=(n||o)&&!Number.isInteger(h)){const t=this.getAtPhysicalCell(e,h,s);r?a.push(t):Object(c["setProperty"])(a,h,t)}})}else Object(c["objectEach"])(s,(t,n)=>{Object(c["setProperty"])(a,n,this.getAtPhysicalCell(e,n,s))});return a}setAtCell(e,t,n){if(!(e>=this.countRows()||t>=this.countFirstRowKeys())){if(this.hot.hasHook("modifySourceData")){const r=Object(c["createObjectPropListener"])(n);this.hot.runHooks("modifySourceData",e,t,r,"set"),r.isTouched()&&(n=r.value)}Number.isInteger(t)?this.data[e][t]=n:Object(c["setProperty"])(this.data[e],t,n)}}getAtPhysicalCell(e,t,n){let r=null;if(n&&(r="string"===typeof t?Object(c["getProperty"])(n,t):"function"===typeof t?t(n):n[t]),this.hot.hasHook("modifySourceData")){const n=Object(c["createObjectPropListener"])(r);this.hot.runHooks("modifySourceData",e,t,n,"get"),n.isTouched()&&(r=n.value)}return r}getAtCell(e,t){const n=this.modifyRowData(e);return this.getAtPhysicalCell(e,this.colToProp(t),n)}getByRange(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!1,i=null,o=null,s=null,a=null;null===e||null===t?(r=!0,i=0,s=this.countRows()-1):(i=Math.min(e.row,t.row),o=Math.min(e.col,t.col),s=Math.max(e.row,t.row),a=Math.max(e.col,t.col));const l=[];return Object(j["rangeEach"])(i,s,e=>{l.push(r?this.getAtRow(e,void 0,void 0,n):this.getAtRow(e,o,a,n))}),l}countRows(){if(this.hot.hasHook("modifySourceLength")){const e=this.hot.runHooks("modifySourceLength");if(Number.isInteger(e))return e}return this.data.length}countFirstRowKeys(){return Object(Ai["countFirstRowKeys"])(this.data)}destroy(){this.data=null,this.hot=null}}var Li=_i,Pi=n("1b1a"),ki=n("cef7"),ji=n("1096"),Hi=n("9056"),Di=n("9f10"),Fi=n("00fd4");const Ui=new Map([["hiding",ki["a"]],["index",ji["a"]],["linkedPhysicalIndexToValue",Hi["a"]],["physicalIndexToValue",Di["a"]],["trimming",Fi["a"]]]);function Vi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!Ui.has(e))throw new Error(`The provided map type ("${e}") does not exist.`);return new(Ui.get(e))(t)}var Bi=n("3d57"),Wi=n("c5cd");function Gi(e,t,n){return t=zi(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zi(e){var t=Yi(e,"string");return"symbol"==typeof t?t:t+""}function Yi(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 Xi extends Wi["a"]{constructor(e,t){super(),Gi(this,"mergedValuesCache",[]),Gi(this,"aggregationFunction",void 0),Gi(this,"fallbackValue",void 0),this.aggregationFunction=e,this.fallbackValue=t}getMergedValues(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!0===e)return this.mergedValuesCache;if(0===this.getLength())return[];const t=Object(I["arrayMap"])(this.get(),e=>e.getValues()),n=[],r=Object(o["isDefined"])(t[0])&&t[0].length||0;for(let i=0;i<r;i+=1){const e=[];for(let n=0;n<this.getLength();n+=1)e.push(t[n][i]);n.push(e)}return Object(I["arrayMap"])(n,this.aggregationFunction)}getMergedValueAtIndex(e,t){const n=this.getMergedValues(t)[e];return Object(o["isDefined"])(n)?n:this.fallbackValue}updateCache(){this.mergedValuesCache=this.getMergedValues(!1)}}var Ki=n("7ae0");function $i(e,t,n){qi(e,t),t.set(e,n)}function qi(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qi(e,t,n){return e.set(Ji(e,t),n),n}function Zi(e,t){return e.get(Ji(e,t))}function Ji(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 eo=new WeakMap;class to{constructor(){$i(this,eo,[])}subscribe(e){return this.addLocalHook("change",e),this._write(Zi(eo,this)),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){Qi(eo,this,e)}}function no(e,t){const n=[];let r=0,i=0;for(;r<e.length&&i<t.length;r++,i++)e[r]!==t[i]&&n.push({op:"replace",index:i,oldValue:e[r],newValue:t[i]});for(;r<t.length;r++)n.push({op:"insert",index:r,oldValue:void 0,newValue:t[r]});for(;i<e.length;i++)n.push({op:"remove",index:i,oldValue:e[i],newValue:void 0});return n}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){return e.get(ao(e,t))}function so(e,t,n){return e.set(ao(e,t),n),n}function ao(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(c["mixin"])(to,Ki["a"]);var lo=new WeakMap,co=new WeakMap,ho=new WeakMap,uo=new WeakMap,po=new WeakMap;class fo{constructor(){let{initialIndexValue:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ro(this,lo,new Set),ro(this,co,[]),ro(this,ho,[]),ro(this,uo,!1),ro(this,po,!1),so(po,this,null!==e&&void 0!==e&&e)}createObserver(){const e=new to;return oo(lo,this).add(e),e.addLocalHook("unsubscribe",()=>{oo(lo,this).delete(e)}),e._writeInitialChanges(no(oo(co,this),oo(ho,this))),e}emit(e){let t=oo(ho,this);oo(uo,this)&&oo(co,this).length===e.length||(0===e.length?e=new Array(t.length).fill(oo(po,this)):so(co,this,new Array(e.length).fill(oo(po,this))),oo(uo,this)||(so(uo,this,!0),t=oo(co,this)));const n=no(t,e);oo(lo,this).forEach(e=>e._write(n)),so(ho,this,e)}}function go(e,t,n){return t=mo(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mo(e){var t=yo(e,"string");return"symbol"==typeof t?t:t+""}function yo(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)}new Set;class wo{constructor(){go(this,"indexesSequence",new Pi["a"]),go(this,"trimmingMapsCollection",new Xi(e=>e.some(e=>!0===e),!1)),go(this,"hidingMapsCollection",new Xi(e=>e.some(e=>!0===e),!1)),go(this,"variousMapsCollection",new Wi["a"]),go(this,"hidingChangesObservable",new fo({initialIndexValue:!1})),go(this,"notTrimmedIndexesCache",[]),go(this,"notHiddenIndexesCache",[]),go(this,"isBatched",!1),go(this,"indexesSequenceChanged",!1),go(this,"indexesChangeSource",void 0),go(this,"trimmedIndexesChanged",!1),go(this,"hiddenIndexesChanged",!1),go(this,"renderablePhysicalIndexesCache",[]),go(this,"fromPhysicalToVisualIndexesCache",new Map),go(this,"fromVisualToRenderableIndexesCache",new Map),this.indexesSequence.addLocalHook("change",()=>{this.indexesSequenceChanged=!0,this.updateCache(),this.runLocalHooks("indexesSequenceChange",this.indexesChangeSource),this.runLocalHooks("change",this.indexesSequence,null)}),this.trimmingMapsCollection.addLocalHook("change",e=>{this.trimmedIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.trimmingMapsCollection)}),this.hidingMapsCollection.addLocalHook("change",e=>{this.hiddenIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.hidingMapsCollection)}),this.variousMapsCollection.addLocalHook("change",e=>{this.runLocalHooks("change",e,this.variousMapsCollection)})}suspendOperations(){this.isBatched=!0}resumeOperations(){this.isBatched=!1,this.updateCache()}createChangesObserver(e){if("hiding"!==e)throw new Error(`Unsupported index map type "${e}".`);return this.hidingChangesObservable.createObserver()}createAndRegisterIndexMap(e,t,n){return this.registerMap(e,Vi(t,n))}registerMap(e,t){if(this.trimmingMapsCollection.get(e)||this.hidingMapsCollection.get(e)||this.variousMapsCollection.get(e))throw Error(`Map with name "${e}" has been already registered.`);t instanceof Fi["a"]?this.trimmingMapsCollection.register(e,t):t instanceof ki["a"]?this.hidingMapsCollection.register(e,t):this.variousMapsCollection.register(e,t);const n=this.getNumberOfIndexes();return n>0&&t.init(n),t}unregisterMap(e){this.trimmingMapsCollection.unregister(e),this.hidingMapsCollection.unregister(e),this.variousMapsCollection.unregister(e)}unregisterAll(){this.trimmingMapsCollection.unregisterAll(),this.hidingMapsCollection.unregisterAll(),this.variousMapsCollection.unregisterAll()}getPhysicalFromVisualIndex(e){const t=this.notTrimmedIndexesCache[e];return Object(o["isDefined"])(t)?t:null}getPhysicalFromRenderableIndex(e){const t=this.renderablePhysicalIndexesCache[e];return Object(o["isDefined"])(t)?t:null}getVisualFromPhysicalIndex(e){const t=this.fromPhysicalToVisualIndexesCache.get(e);return Object(o["isDefined"])(t)?t:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){const t=this.fromVisualToRenderableIndexesCache.get(e);return Object(o["isDefined"])(t)?t:null}getNearestNotHiddenIndex(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=this.getPhysicalFromVisualIndex(e);if(null===r)return null;if(this.fromVisualToRenderableIndexesCache.has(e))return e;const i=Array.from(this.fromVisualToRenderableIndexesCache.keys());let o=-1;return o=t>0?i.findIndex(t=>t>e):i.reverse().findIndex(t=>t<e),-1===o?n?this.getNearestNotHiddenIndex(e,-t,!1):null:i[o]}initToLength(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getNumberOfIndexes();this.notTrimmedIndexesCache=[...new Array(e).keys()],this.notHiddenIndexesCache=[...new Array(e).keys()],this.suspendOperations(),this.indexesChangeSource="init",this.indexesSequence.init(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.initEvery(e),this.resumeOperations(),this.suspendOperations(),this.hidingMapsCollection.initEvery(e),this.variousMapsCollection.initEvery(e),this.resumeOperations(),this.runLocalHooks("init")}fitToLength(e){const t=this.getNumberOfIndexes();if(e<t){const t=[...Array(this.getNumberOfIndexes()-e).keys()].map(t=>t+e);this.removeIndexes(t)}else this.insertIndexes(t,e-t)}getIndexesSequence(){return this.indexesSequence.getValues()}setIndexesSequence(e){void 0===this.indexesChangeSource&&(this.indexesChangeSource="update"),this.indexesSequence.setValues(e),"update"===this.indexesChangeSource&&(this.indexesChangeSource=void 0)}getNotTrimmedIndexes(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!0===e)return this.notTrimmedIndexesCache;const t=this.getIndexesSequence();return t.filter(e=>!1===this.isTrimmed(e))}getNotTrimmedIndexesLength(){return this.getNotTrimmedIndexes().length}getNotHiddenIndexes(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!0===e)return this.notHiddenIndexesCache;const t=this.getIndexesSequence();return t.filter(e=>!1===this.isHidden(e))}getNotHiddenIndexesLength(){return this.getNotHiddenIndexes().length}getRenderableIndexes(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(!0===e)return this.renderablePhysicalIndexesCache;const t=this.getNotTrimmedIndexes();return t.filter(e=>!1===this.isHidden(e))}getRenderableIndexesLength(){return this.getRenderableIndexes().length}getNumberOfIndexes(){return this.getIndexesSequence().length}moveIndexes(e,t){"number"===typeof e&&(e=[e]);const n=Object(I["arrayMap"])(e,e=>this.getPhysicalFromVisualIndex(e)),r=this.getNotTrimmedIndexesLength(),i=e.length,o=Object(Bi["b"])(this.getIndexesSequence(),n),s=o.filter(e=>!1===this.isTrimmed(e));let a=o.indexOf(s[s.length-1])+1;if(t+i<r){const e=s[t];a=o.indexOf(e)}this.indexesChangeSource="move",this.setIndexesSequence(Object(Bi["a"])(o,a,n)),this.indexesChangeSource=void 0}isTrimmed(e){return this.trimmingMapsCollection.getMergedValueAtIndex(e)}isHidden(e){return this.hidingMapsCollection.getMergedValueAtIndex(e)}insertIndexes(e,t){const n=this.getNotTrimmedIndexes()[e],r=Object(o["isDefined"])(n)?n:this.getNumberOfIndexes(),i=this.getIndexesSequence().includes(n)?this.getIndexesSequence().indexOf(n):this.getNumberOfIndexes(),s=Object(I["arrayMap"])(new Array(t).fill(r),(e,t)=>e+t);this.suspendOperations(),this.indexesChangeSource="insert",this.indexesSequence.insert(i,s),this.indexesChangeSource=void 0,this.trimmingMapsCollection.insertToEvery(i,s),this.hidingMapsCollection.insertToEvery(i,s),this.variousMapsCollection.insertToEvery(i,s),this.resumeOperations()}removeIndexes(e){this.suspendOperations(),this.indexesChangeSource="remove",this.indexesSequence.remove(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.removeFromEvery(e),this.hidingMapsCollection.removeFromEvery(e),this.variousMapsCollection.removeFromEvery(e),this.resumeOperations()}updateCache(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=this.indexesSequenceChanged||this.trimmedIndexesChanged||this.hiddenIndexesChanged;(!0===e||!1===this.isBatched&&!0===t)&&(this.trimmingMapsCollection.updateCache(),this.hidingMapsCollection.updateCache(),this.notTrimmedIndexesCache=this.getNotTrimmedIndexes(!1),this.notHiddenIndexesCache=this.getNotHiddenIndexes(!1),this.renderablePhysicalIndexesCache=this.getRenderableIndexes(!1),this.cacheFromPhysicalToVisualIndexes(),this.cacheFromVisualToRenderableIndexes(),this.hiddenIndexesChanged&&this.hidingChangesObservable.emit(this.hidingMapsCollection.getMergedValues()),this.runLocalHooks("cacheUpdated",{indexesSequenceChanged:this.indexesSequenceChanged,trimmedIndexesChanged:this.trimmedIndexesChanged,hiddenIndexesChanged:this.hiddenIndexesChanged}),this.indexesSequenceChanged=!1,this.trimmedIndexesChanged=!1,this.hiddenIndexesChanged=!1)}cacheFromPhysicalToVisualIndexes(){const e=this.getNotTrimmedIndexesLength();this.fromPhysicalToVisualIndexesCache.clear();for(let t=0;t<e;t+=1){const e=this.getPhysicalFromVisualIndex(t);this.fromPhysicalToVisualIndexesCache.set(e,t)}}cacheFromVisualToRenderableIndexes(){const e=this.getRenderableIndexesLength();this.fromVisualToRenderableIndexesCache.clear();for(let t=0;t<e;t+=1){const e=this.getPhysicalFromRenderableIndex(t),n=this.getVisualFromPhysicalIndex(e);this.fromVisualToRenderableIndexesCache.set(n,t)}}}Object(c["mixin"])(wo,Ki["a"]);var bo=n("1004");function vo(e,t){return Object(c["objectEach"])(t,(t,n)=>{Object(o["isUndefined"])(e[n])&&(e[n]=t)}),e}function Eo(e){const t=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/,n=t.exec(e);return n?`${n[1].toLowerCase()}-${n[2].toUpperCase()}`:e}function Co(e){Object(o["isDefined"])(e)&&Object(h["a"])(We["a"]`Language with code "${e}" was not found. You should register particular language\x20
- before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.`)}var So=n("9acd");function Ro(e,t){const n=Array.isArray(e)&&Number.isInteger(t);return n?e[t]:e}const{register:To,getValues:Oo}=Object(So["a"])("phraseFormatters");function No(e,t){To(e,t)}function Ao(){return Oo()}No("pluralize",Ro);var Io=n("0283");
- /**
- * @preserve
- * Authors: Handsoncode
- * Last updated: Nov 15, 2017
- *
- * Description: Definition file for English - United States language-country.
- */const Mo={languageCode:"en-US",[Io["CONTEXTMENU_ITEMS_NO_ITEMS"]]:"No available options",[Io["CONTEXTMENU_ITEMS_ROW_ABOVE"]]:"Insert row above",[Io["CONTEXTMENU_ITEMS_ROW_BELOW"]]:"Insert row below",[Io["CONTEXTMENU_ITEMS_INSERT_LEFT"]]:"Insert column left",[Io["CONTEXTMENU_ITEMS_INSERT_RIGHT"]]:"Insert column right",[Io["CONTEXTMENU_ITEMS_REMOVE_ROW"]]:["Remove row","Remove rows"],[Io["CONTEXTMENU_ITEMS_REMOVE_COLUMN"]]:["Remove column","Remove columns"],[Io["CONTEXTMENU_ITEMS_UNDO"]]:"Undo",[Io["CONTEXTMENU_ITEMS_REDO"]]:"Redo",[Io["CONTEXTMENU_ITEMS_READ_ONLY"]]:"Read only",[Io["CONTEXTMENU_ITEMS_CLEAR_COLUMN"]]:"Clear column",[Io["CONTEXTMENU_ITEMS_ALIGNMENT"]]:"Alignment",[Io["CONTEXTMENU_ITEMS_ALIGNMENT_LEFT"]]:"Left",[Io["CONTEXTMENU_ITEMS_ALIGNMENT_CENTER"]]:"Center",[Io["CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT"]]:"Right",[Io["CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY"]]:"Justify",[Io["CONTEXTMENU_ITEMS_ALIGNMENT_TOP"]]:"Top",[Io["CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE"]]:"Middle",[Io["CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM"]]:"Bottom",[Io["CONTEXTMENU_ITEMS_FREEZE_COLUMN"]]:"Freeze column",[Io["CONTEXTMENU_ITEMS_UNFREEZE_COLUMN"]]:"Unfreeze column",[Io["CONTEXTMENU_ITEMS_BORDERS"]]:"Borders",[Io["CONTEXTMENU_ITEMS_BORDERS_TOP"]]:"Top",[Io["CONTEXTMENU_ITEMS_BORDERS_RIGHT"]]:"Right",[Io["CONTEXTMENU_ITEMS_BORDERS_BOTTOM"]]:"Bottom",[Io["CONTEXTMENU_ITEMS_BORDERS_LEFT"]]:"Left",[Io["CONTEXTMENU_ITEMS_REMOVE_BORDERS"]]:"Remove border(s)",[Io["CONTEXTMENU_ITEMS_ADD_COMMENT"]]:"Add comment",[Io["CONTEXTMENU_ITEMS_EDIT_COMMENT"]]:"Edit comment",[Io["CONTEXTMENU_ITEMS_REMOVE_COMMENT"]]:"Delete comment",[Io["CONTEXTMENU_ITEMS_READ_ONLY_COMMENT"]]:"Read-only comment",[Io["CONTEXTMENU_ITEMS_MERGE_CELLS"]]:"Merge cells",[Io["CONTEXTMENU_ITEMS_UNMERGE_CELLS"]]:"Unmerge cells",[Io["CONTEXTMENU_ITEMS_COPY"]]:"Copy",[Io["CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS"]]:["Copy with header","Copy with headers"],[Io["CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS"]]:["Copy with group header","Copy with group headers"],[Io["CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY"]]:["Copy header only","Copy headers only"],[Io["CONTEXTMENU_ITEMS_CUT"]]:"Cut",[Io["CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD"]]:"Insert child row",[Io["CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD"]]:"Detach from parent",[Io["CONTEXTMENU_ITEMS_HIDE_COLUMN"]]:["Hide column","Hide columns"],[Io["CONTEXTMENU_ITEMS_SHOW_COLUMN"]]:["Show column","Show columns"],[Io["CONTEXTMENU_ITEMS_HIDE_ROW"]]:["Hide row","Hide rows"],[Io["CONTEXTMENU_ITEMS_SHOW_ROW"]]:["Show row","Show rows"],[Io["FILTERS_CONDITIONS_NONE"]]:"None",[Io["FILTERS_CONDITIONS_EMPTY"]]:"Is empty",[Io["FILTERS_CONDITIONS_NOT_EMPTY"]]:"Is not empty",[Io["FILTERS_CONDITIONS_EQUAL"]]:"Is equal to",[Io["FILTERS_CONDITIONS_NOT_EQUAL"]]:"Is not equal to",[Io["FILTERS_CONDITIONS_BEGINS_WITH"]]:"Begins with",[Io["FILTERS_CONDITIONS_ENDS_WITH"]]:"Ends with",[Io["FILTERS_CONDITIONS_CONTAINS"]]:"Contains",[Io["FILTERS_CONDITIONS_NOT_CONTAIN"]]:"Does not contain",[Io["FILTERS_CONDITIONS_GREATER_THAN"]]:"Greater than",[Io["FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL"]]:"Greater than or equal to",[Io["FILTERS_CONDITIONS_LESS_THAN"]]:"Less than",[Io["FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL"]]:"Less than or equal to",[Io["FILTERS_CONDITIONS_BETWEEN"]]:"Is between",[Io["FILTERS_CONDITIONS_NOT_BETWEEN"]]:"Is not between",[Io["FILTERS_CONDITIONS_AFTER"]]:"After",[Io["FILTERS_CONDITIONS_BEFORE"]]:"Before",[Io["FILTERS_CONDITIONS_TODAY"]]:"Today",[Io["FILTERS_CONDITIONS_TOMORROW"]]:"Tomorrow",[Io["FILTERS_CONDITIONS_YESTERDAY"]]:"Yesterday",[Io["FILTERS_VALUES_BLANK_CELLS"]]:"Blank cells",[Io["FILTERS_DIVS_FILTER_BY_CONDITION"]]:"Filter by condition",[Io["FILTERS_DIVS_FILTER_BY_VALUE"]]:"Filter by value",[Io["FILTERS_LABELS_CONJUNCTION"]]:"And",[Io["FILTERS_LABELS_DISJUNCTION"]]:"Or",[Io["FILTERS_BUTTONS_SELECT_ALL"]]:"Select all",[Io["FILTERS_BUTTONS_CLEAR"]]:"Clear",[Io["FILTERS_BUTTONS_OK"]]:"OK",[Io["FILTERS_BUTTONS_CANCEL"]]:"Cancel",[Io["FILTERS_BUTTONS_PLACEHOLDER_SEARCH"]]:"Search",[Io["FILTERS_BUTTONS_PLACEHOLDER_VALUE"]]:"Value",[Io["FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE"]]:"Second value",[Io["CHECKBOX_CHECKED"]]:"Checked",[Io["CHECKBOX_UNCHECKED"]]:"Unchecked"};var xo=Mo;const _o=Io,Lo=xo.languageCode,{register:Po,getItem:ko,hasItem:jo,getValues:Ho}=Object(So["a"])("languagesDictionaries");function Do(e,t){let n=e,r=t;return Object(c["isObject"])(e)&&(r=e,n=r.languageCode),Fo(n,r),Po(n,Object(c["deepClone"])(r)),Object(c["deepClone"])(r)}function Fo(e,t){e!==Lo&&vo(t,ko(Lo))}function Uo(e){return Vo(e)?Object(c["deepClone"])(ko(e)):null}function Vo(e){return jo(e)}function Bo(){return Ho()}function Wo(e,t,n){const r=Uo(e);if(null===r)return null;const i=r[t];if(Object(o["isUndefined"])(i))return null;const s=Go(i,n);return Array.isArray(s)?s[0]:s}function Go(e,t){let n=e;return Object(I["arrayEach"])(Ao(),r=>{n=r(e,t)}),n}function zo(e){let t=Eo(e);return Vo(t)||(t=Lo,Co(e)),t}Do(xo);var Yo=n("a309");class Xo{constructor(e,t){this.settings=e,this.cellRange=t||null}isEmpty(){return null===this.cellRange}add(e){return this.isEmpty()?this.cellRange=this.settings.createCellRange(e):this.cellRange.expand(e),this}replace(e,t){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=t,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=t,!0}return!1}clear(){return this.cellRange=null,this}getCorners(){const e=this.cellRange.getOuterTopStartCorner(),t=this.cellRange.getOuterBottomEndCorner();return[e.row,e.col,t.row,t.col]}destroy(){this.runLocalHooks("destroy")}}Object(c["mixin"])(Xo,Ki["a"]);var Ko=Xo;function $o(e,t,n){return t=qo(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qo(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)}class Zo extends Ko{constructor(e,t){super(e,null),$o(this,"visualCellRange",null),this.visualCellRange=t||null,this.commit()}add(e){return null===this.visualCellRange?this.visualCellRange=this.settings.createCellRange(e):this.visualCellRange.expand(e),this}clear(){return this.visualCellRange=null,super.clear()}trimToVisibleCellsRangeOnly(e){let{from:t,to:n}=e,r=this.getNearestNotHiddenCoords(t,1),i=this.getNearestNotHiddenCoords(n,-1);return null===r||null===i?null:((r.row>i.row||r.col>i.col)&&(r=t,i=n),this.settings.createCellRange(r,r,i))}getNearestNotHiddenCoords(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;const r=this.getNearestNotHiddenIndex(this.settings.rowIndexMapper,e.row,t);if(null===r)return null;const i=this.getNearestNotHiddenIndex(this.settings.columnIndexMapper,e.col,n);return null===i?null:this.settings.createCellCoords(r,i)}getNearestNotHiddenIndex(e,t,n){return t<0?t:e.getNearestNotHiddenIndex(t,n)}commit(){if(null===this.visualCellRange)return this;const e=this.trimToVisibleCellsRangeOnly(this.visualCellRange);return this.cellRange=null===e?null:this.createRenderableCellRange(e.from,e.to),this}syncWith(e){const t=e.from.clone().normalize(),n="N-S"===e.getVerticalDirection()?1:-1,r="W-E"===e.getHorizontalDirection()?1:-1,i=this.settings.visualToRenderableCoords(this.visualCellRange.highlight);let o=null;if(null!==i&&null!==i.col&&null!==i.row||(o=this.getNearestNotHiddenCoords(t,n,r)),null!==o&&e.overlaps(o)){const t=e.highlight.clone();if(t.row>=0&&(t.row=o.row),t.col>=0&&(t.col=o.col),null===this.cellRange){const e=this.settings.visualToRenderableCoords(t);this.cellRange=this.settings.createCellRange(e)}e.setHighlight(t)}return"focus"===this.settings.selectionType&&null!==i&&null===o&&e.setHighlight(this.visualCellRange.highlight),this}getCorners(){const{from:e,to:t}=this.cellRange;return[Math.min(e.row,t.row),Math.min(e.col,t.col),Math.max(e.row,t.row),Math.max(e.col,t.col)]}getVisualCorners(){const e=this.settings.renderableToVisualCoords(this.cellRange.getTopStartCorner()),t=this.settings.renderableToVisualCoords(this.cellRange.getBottomEndCorner());return[e.row,e.col,t.row,t.col]}createRenderableCellRange(e,t){const n=this.settings.visualToRenderableCoords(e),r=this.settings.visualToRenderableCoords(t);return null===n.row||null===n.col||null===r.row||null===r.col?null:this.settings.createCellRange(n,n,r)}}var Jo=Zo;function es(e){let{activeHeaderClassName:t,...n}=e;return new Jo({className:t,...n,selectionType:Yo["a"]})}function ts(e){let{areaCornerVisible:t,...n}=e;return new Jo({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:t},...n,selectionType:Yo["b"]})}function ns(e){let{...t}=e;return new Jo({className:"highlight",...t,selectionType:Yo["b"]})}function rs(e){let{columnClassName:t,...n}=e;return new Jo({className:t,...n,selectionType:Yo["c"]})}function is(e){let{cellCornerVisible:t,...n}=e;return new Jo({className:"current",headerAttributes:[Object(He["H"])()],border:{width:2,color:"#4b89ff",cornerVisible:t},...n,selectionType:Yo["f"]})}function os(e){let{border:t,visualCellRange:n,...r}=e;return new Jo({...t,...r,selectionType:Yo["d"]},n)}function ss(e){let{...t}=e;return new Jo({className:"fill",border:{width:1,color:"#ff0000"},...t,selectionType:Yo["e"]})}function as(e){let{headerClassName:t,...n}=e;return new Jo({className:t,...n,selectionType:Yo["g"]})}function ls(e){let{rowClassName:t,...n}=e;return new Jo({className:t,...n,selectionType:Yo["h"]})}function cs(e,t){hs(e,t),t.add(e)}function hs(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function us(e,t,n){return t=ds(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ds(e){var t=ps(e,"string");return"symbol"==typeof t?t:t+""}function ps(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 fs(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 gs=new WeakSet;class ms{constructor(e){cs(this,gs),us(this,"options",void 0),us(this,"layerLevel",0),us(this,"focus",void 0),us(this,"fill",void 0),us(this,"layeredAreas",new Map),us(this,"areas",new Map),us(this,"rowHeaders",new Map),us(this,"columnHeaders",new Map),us(this,"activeRowHeaders",new Map),us(this,"activeColumnHeaders",new Map),us(this,"activeCornerHeaders",new Map),us(this,"rowHighlights",new Map),us(this,"columnHighlights",new Map),us(this,"customSelections",[]),this.options=e,this.focus=is(e),this.fill=ss(e)}isEnabledFor(e,t){let n=e;e===Yo["f"]&&(n="current");let r=this.options.disabledCellSelection(t.row,t.col);return"string"===typeof r&&(r=[r]),!1===r||Array.isArray(r)&&!r.includes(n)}useLayerLevel(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.layerLevel=e,this}getFocus(){return this.focus}getFill(){return this.fill}createLayeredArea(){return fs(gs,this,ys).call(this,this.layeredAreas,ts)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return fs(gs,this,ys).call(this,this.areas,ns)}getAreas(){return[...this.areas.values()]}createRowHeader(){return fs(gs,this,ys).call(this,this.rowHeaders,as)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return fs(gs,this,ys).call(this,this.columnHeaders,as)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return fs(gs,this,ys).call(this,this.activeRowHeaders,es)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return fs(gs,this,ys).call(this,this.activeColumnHeaders,es)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return fs(gs,this,ys).call(this,this.activeCornerHeaders,es)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return fs(gs,this,ys).call(this,this.rowHighlights,ls)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return fs(gs,this,ys).call(this,this.columnHighlights,rs)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push(os({...this.options,...e}))}clear(){this.focus.clear(),this.fill.clear(),Object(I["arrayEach"])(this.areas.values(),e=>{e.clear()}),Object(I["arrayEach"])(this.layeredAreas.values(),e=>{e.clear()}),Object(I["arrayEach"])(this.rowHeaders.values(),e=>{e.clear()}),Object(I["arrayEach"])(this.columnHeaders.values(),e=>{e.clear()}),Object(I["arrayEach"])(this.activeRowHeaders.values(),e=>{e.clear()}),Object(I["arrayEach"])(this.activeColumnHeaders.values(),e=>{e.clear()}),Object(I["arrayEach"])(this.activeCornerHeaders.values(),e=>{e.clear()}),Object(I["arrayEach"])(this.rowHighlights.values(),e=>{e.clear()}),Object(I["arrayEach"])(this.columnHighlights.values(),e=>{e.clear()})}[Symbol.iterator](){return[this.focus,this.fill,...this.areas.values(),...this.layeredAreas.values(),...this.rowHeaders.values(),...this.columnHeaders.values(),...this.activeRowHeaders.values(),...this.activeColumnHeaders.values(),...this.activeCornerHeaders.values(),...this.rowHighlights.values(),...this.columnHighlights.values(),...this.customSelections][Symbol.iterator]()}}function ys(e,t){const n=this.layerLevel;if(e.has(n))return e.get(n);const r=t({layerLevel:n,...this.options});return e.set(n,r),r}var ws=ms;function bs(e,t,n){return t=vs(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vs(e){var t=Es(e,"string");return"symbol"==typeof t?t:t+""}function Es(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 Cs{constructor(e){bs(this,"ranges",[]),bs(this,"createCellRange",void 0),this.createCellRange=e}isEmpty(){return 0===this.size()}set(e){return this.clear(),this.ranges.push(this.createCellRange(e)),this}add(e){return this.ranges.push(this.createCellRange(e)),this}pop(){return this.ranges.pop(),this}current(){return this.peekByIndex(this.size()-1)}previous(){return this.peekByIndex(this.size()-2)}includes(e){return this.ranges.some(t=>t.includes(e))}clear(){return this.ranges.length=0,this}size(){return this.ranges.length}peekByIndex(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t>=0&&t<this.size()&&(e=this.ranges[t]),e}[Symbol.iterator](){return this.ranges[Symbol.iterator]()}}var Ss=Cs;function Rs(e,t){Os(e,t),t.add(e)}function Ts(e,t,n){Os(e,t),t.set(e,n)}function Os(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ns(e,t){return e.get(Is(e,t))}function As(e,t,n){return e.set(Is(e,t),n),n}function Is(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 Ms=new WeakMap,xs=new WeakMap,_s=new WeakMap,Ls=new WeakSet;class Ps{constructor(e,t){Rs(this,Ls),Ts(this,Ms,void 0),Ts(this,xs,void 0),Ts(this,_s,{x:0,y:0}),As(Ms,this,e),As(xs,this,t)}transformStart(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=Ns(xs,this).createCellCoords(e,t);let i=Ns(Ms,this).current().highlight;const o=Ns(xs,this).visualToRenderableCoords(i);let s=0,a=0;if(this.runLocalHooks("beforeTransformStart",r),null!==o.row&&null!==o.col){const{width:e,height:t}=Is(Ls,this,js).call(this),{row:o,col:l}=Is(Ls,this,Fs).call(this,i),h=Ns(xs,this).fixedRowsBottom(),u=Ns(xs,this).minSpareRows(),d=Ns(xs,this).minSpareCols(),p=Ns(xs,this).autoWrapRow(),f=Ns(xs,this).autoWrapCol(),g=Ns(xs,this).createCellCoords(o+r.row,l+r.col);if(g.row>=t){const r=Object(c["createObjectPropListener"])(n&&u>0&&0===h),i=g.col+1,o=Ns(xs,this).createCellCoords(g.row-t,i>=e?i-e:i);this.runLocalHooks("beforeColumnWrap",r,Is(Ls,this,Us).call(this,o),i>=e),r.value?this.runLocalHooks("insertRowRequire",Ns(xs,this).countRenderableRows()):f&&g.assign(o)}else if(g.row<0){const n=Object(c["createObjectPropListener"])(f),r=g.col-1,i=Ns(xs,this).createCellCoords(t+g.row,r<0?e+r:r);this.runLocalHooks("beforeColumnWrap",n,Is(Ls,this,Us).call(this,i),r<0),f&&g.assign(i)}if(g.col>=e){const r=Object(c["createObjectPropListener"])(n&&d>0),i=g.row+1,o=Ns(xs,this).createCellCoords(i>=t?i-t:i,g.col-e);this.runLocalHooks("beforeRowWrap",r,Is(Ls,this,Us).call(this,o),i>=t),r.value?this.runLocalHooks("insertColRequire",Ns(xs,this).countRenderableColumns()):p&&g.assign(o)}else if(g.col<0){const n=Object(c["createObjectPropListener"])(p),r=g.row-1,i=Ns(xs,this).createCellCoords(r<0?t+r:r,e+g.col);this.runLocalHooks("beforeRowWrap",n,Is(Ls,this,Us).call(this,i),r<0),p&&g.assign(i)}const{rowDir:m,colDir:y}=Is(Ls,this,ks).call(this,g);s=m,a=y,i=Is(Ls,this,Us).call(this,g)}return this.runLocalHooks("afterTransformStart",i,s,a),i}transformEnd(e,t){const n=Ns(xs,this).createCellCoords(e,t),r=Ns(Ms,this).current(),i=Ns(xs,this).visualToRenderableCoords(r.highlight),o=Is(Ls,this,Hs).call(this,r.to.row,r.from.row),s=Is(Ls,this,Ds).call(this,r.to.col,r.from.col),a=r.to.clone();let l=0,c=0;if(this.runLocalHooks("beforeTransformEnd",n),null!==i.row&&null!==i.col&&null!==o&&null!==s){const{row:e,col:t}=Is(Ls,this,Fs).call(this,r.highlight),i=Ns(xs,this).createCellCoords(o+n.row,s+n.col),h=r.getTopStartCorner(),u=r.getTopEndCorner(),d=r.getBottomEndCorner(),p={row:i.row-e,col:i.col-t};n.col<0?s>=t&&i.col<t&&(i.col=Is(Ls,this,Ds).call(this,h.col,u.col)+p.col):n.col>0&&s<=t&&i.col>t&&(i.col=Is(Ls,this,Ds).call(this,u.col,h.col)+p.col),n.row<0?o>=e&&i.row<e&&(i.row=Is(Ls,this,Hs).call(this,h.row,d.row)+p.row):n.row>0&&o<=e&&i.row>e&&(i.row=Is(Ls,this,Hs).call(this,d.row,h.row)+p.row);const{rowDir:f,colDir:g}=Is(Ls,this,ks).call(this,i);l=f,c=g;const m=Is(Ls,this,Us).call(this,i);0===n.row&&0!==n.col?a.col=m.col:0!==n.row&&0===n.col?a.row=m.row:(a.row=m.row,a.col=m.col)}return this.runLocalHooks("afterTransformEnd",a,l,c),a}setOffsetSize(e){let{x:t,y:n}=e;As(_s,this,{x:t,y:n})}}function ks(e){const{width:t,height:n}=Is(Ls,this,js).call(this);let r=0,i=0;return e.row<0?(r=-1,e.row=0):e.row>0&&e.row>=n&&(r=1,e.row=n-1),e.col<0?(i=-1,e.col=0):e.col>0&&e.col>=t&&(i=1,e.col=t-1),{rowDir:r,colDir:i}}function js(){return{width:Ns(_s,this).x+Ns(xs,this).countRenderableColumns(),height:Ns(_s,this).y+Ns(xs,this).countRenderableRows()}}function Hs(e,t){const n=Ns(xs,this).findFirstNonHiddenRenderableRow(e,t);return null===n?null:Ns(_s,this).y+n}function Ds(e,t){const n=Ns(xs,this).findFirstNonHiddenRenderableColumn(e,t);return null===n?null:Ns(_s,this).x+n}function Fs(e){const{row:t,col:n}=Ns(xs,this).visualToRenderableCoords(e);if(null===t||null===n)throw new Error("Renderable coords are not visible.");return Ns(xs,this).createCellCoords(Ns(_s,this).y+t,Ns(_s,this).x+n)}function Us(e){const t=e.clone();return t.col=e.col-Ns(_s,this).x,t.row=e.row-Ns(_s,this).y,Ns(xs,this).renderableToVisualCoords(t)}Object(c["mixin"])(Ps,Ki["a"]);var Vs=Ps,Bs=n("a952");function Ws(e,t,n){Gs(e,t),t.set(e,n)}function Gs(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zs(e,t,n){return t=Ys(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ys(e){var t=Xs(e,"string");return"symbol"==typeof t?t:t+""}function Xs(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 Ks(e,t){return e.get(qs(e,t))}function $s(e,t,n){return e.set(qs(e,t),n),n}function qs(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 Qs=new WeakMap,Zs=new WeakMap,Js=new WeakMap,ea=new WeakMap,ta=new WeakMap,na=new WeakMap;class ra{constructor(e,t){var n=this;zs(this,"settings",void 0),zs(this,"tableProps",void 0),zs(this,"inProgress",!1),zs(this,"selectedRange",new Ss((e,t,n)=>this.tableProps.createCellRange(e,t,n))),zs(this,"highlight",void 0),Ws(this,Qs,void 0),Ws(this,Zs,void 0),zs(this,"selectedByRowHeader",new Set),zs(this,"selectedByColumnHeader",new Set),Ws(this,Js,!1),Ws(this,ea,!1),Ws(this,ta,"unknown"),Ws(this,na,-1),this.settings=e,this.tableProps=t,this.highlight=new ws({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[Object(He["H"])()],rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,disabledCellSelection:(e,t)=>this.tableProps.isDisabledCellSelection(e,t),cellCornerVisible:function(){return n.isCellCornerVisible(...arguments)},areaCornerVisible:function(){return n.isAreaCornerVisible(...arguments)},visualToRenderableCoords:e=>this.tableProps.visualToRenderableCoords(e),renderableToVisualCoords:e=>this.tableProps.renderableToVisualCoords(e),createCellCoords:(e,t)=>this.tableProps.createCellCoords(e,t),createCellRange:(e,t,n)=>this.tableProps.createCellRange(e,t,n)}),$s(Qs,this,new Vs(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>this.tableProps.countRenderableRows(),countRenderableColumns:()=>this.tableProps.countRenderableColumns(),visualToRenderableCoords:e=>this.tableProps.visualToRenderableCoords(e),renderableToVisualCoords:e=>this.tableProps.renderableToVisualCoords(e),findFirstNonHiddenRenderableRow:function(){return n.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return n.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(e,t)=>this.tableProps.createCellCoords(e,t),fixedRowsBottom:()=>e.fixedRowsBottom,minSpareRows:()=>e.minSpareRows,minSpareCols:()=>e.minSpareCols,autoWrapRow:()=>e.autoWrapRow,autoWrapCol:()=>e.autoWrapCol})),$s(Zs,this,new Vs(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>{const e=this.selectedRange.current();return this.tableProps.countRenderableRowsInRange(0,e.getOuterBottomEndCorner().row)},countRenderableColumns:()=>{const e=this.selectedRange.current();return this.tableProps.countRenderableColumnsInRange(0,e.getOuterBottomEndCorner().col)},visualToRenderableCoords:e=>this.tableProps.visualToRenderableCoords(e),renderableToVisualCoords:e=>this.tableProps.renderableToVisualCoords(e),findFirstNonHiddenRenderableRow:function(){return n.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return n.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(e,t)=>this.tableProps.createCellCoords(e,t),fixedRowsBottom:()=>0,minSpareRows:()=>0,minSpareCols:()=>0,autoWrapRow:()=>!0,autoWrapCol:()=>!0})),Ks(Qs,this).addLocalHook("beforeTransformStart",(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.runLocalHooks("beforeModifyTransformStart",...t)})),Ks(Qs,this).addLocalHook("afterTransformStart",(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.runLocalHooks("afterModifyTransformStart",...t)})),Ks(Qs,this).addLocalHook("beforeTransformEnd",(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.runLocalHooks("beforeModifyTransformEnd",...t)})),Ks(Qs,this).addLocalHook("afterTransformEnd",(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.runLocalHooks("afterModifyTransformEnd",...t)})),Ks(Qs,this).addLocalHook("insertRowRequire",(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.runLocalHooks("insertRowRequire",...t)})),Ks(Qs,this).addLocalHook("insertColRequire",(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.runLocalHooks("insertColRequire",...t)})),Ks(Qs,this).addLocalHook("beforeRowWrap",(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.runLocalHooks("beforeRowWrap",...t)})),Ks(Qs,this).addLocalHook("beforeColumnWrap",(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.runLocalHooks("beforeColumnWrap",...t)})),Ks(Zs,this).addLocalHook("beforeTransformStart",(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.runLocalHooks("beforeModifyTransformFocus",...t)})),Ks(Zs,this).addLocalHook("afterTransformStart",(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.runLocalHooks("afterModifyTransformFocus",...t)}))}getSelectedRange(){return this.selectedRange}markSource(e){$s(ta,this,e)}markEndSource(){$s(ta,this,"unknown")}getSelectionSource(){return Ks(ta,this)}setExpectedLayers(e){$s(na,this,e)}begin(){this.inProgress=!0}finish(){this.runLocalHooks("afterSelectionFinished",Array.from(this.selectedRange)),this.inProgress=!1,$s(na,this,-1)}isInProgress(){return this.inProgress}setRangeStart(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e;const i="multiple"===this.settings.selectionMode,s=Object(o["isUndefined"])(t)?this.tableProps.getShortcutManager().isCtrlPressed():t,a=e.clone();$s(Js,this,!1),this.runLocalHooks("beforeSetRangeStart"+(n?"Only":""),a),(!i||i&&!s&&Object(o["isUndefined"])(t))&&this.selectedRange.clear(),this.selectedRange.add(a).current().setHighlight(r.clone()),0===this.getLayerLevel()&&(this.selectedByRowHeader.clear(),this.selectedByColumnHeader.clear()),n||this.setRangeEnd(e)}setRangeStartOnly(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;this.setRangeStart(e,t,!0,n)}setRangeEnd(e){if(this.selectedRange.isEmpty())return;const t=e.clone(),n=this.tableProps.countRows(),r=this.tableProps.countCols(),i=this.selectedRange.current().clone().setTo(e).isSingleHeader();if((n>0||r>0)&&(0===n&&t.col<0&&!i||0===r&&t.row<0&&!i))return;this.runLocalHooks("beforeSetRangeEnd",t),this.begin();const o=this.selectedRange.current();if(this.settings.navigableHeaders||o.highlight.normalize(),"single"===this.settings.selectionMode)o.setFrom(o.highlight),o.setTo(o.highlight);else{const e=o.getHorizontalDirection(),n=o.getVerticalDirection(),r=this.isMultiple();o.setTo(t),r&&(e!==o.getHorizontalDirection()||1===o.getWidth()&&!o.includes(o.highlight))&&o.from.assign({col:o.highlight.col}),r&&(n!==o.getVerticalDirection()||1===o.getHeight()&&!o.includes(o.highlight))&&o.from.assign({row:o.highlight.row})}n>0&&r>0&&(!this.settings.navigableHeaders||this.settings.navigableHeaders&&!o.isSingleHeader())&&o.to.normalize(),this.runLocalHooks("beforeHighlightSet"),this.setRangeFocus(this.selectedRange.current().highlight);const s=this.getLayerLevel();s<this.highlight.layerLevel&&(Object(I["arrayEach"])(this.highlight.getAreas(),e=>{e.clear()}),Object(I["arrayEach"])(this.highlight.getLayeredAreas(),e=>{e.clear()}),Object(I["arrayEach"])(this.highlight.getRowHeaders(),e=>{e.clear()}),Object(I["arrayEach"])(this.highlight.getColumnHeaders(),e=>{e.clear()}),Object(I["arrayEach"])(this.highlight.getActiveRowHeaders(),e=>{e.clear()}),Object(I["arrayEach"])(this.highlight.getActiveColumnHeaders(),e=>{e.clear()}),Object(I["arrayEach"])(this.highlight.getActiveCornerHeaders(),e=>{e.clear()}),Object(I["arrayEach"])(this.highlight.getRowHighlights(),e=>{e.clear()}),Object(I["arrayEach"])(this.highlight.getColumnHighlights(),e=>{e.clear()})),this.highlight.useLayerLevel(s);const a=this.highlight.createArea(),l=this.highlight.createLayeredArea(),c=this.highlight.createRowHeader(),h=this.highlight.createColumnHeader(),u=this.highlight.createActiveRowHeader(),d=this.highlight.createActiveColumnHeader(),p=this.highlight.createActiveCornerHeader(),f=this.highlight.createRowHighlight(),g=this.highlight.createColumnHighlight();if(a.clear(),l.clear(),c.clear(),h.clear(),u.clear(),d.clear(),p.clear(),f.clear(),g.clear(),this.highlight.isEnabledFor(Yo["b"],o.highlight)&&(this.isMultiple()||s>=1)&&(a.add(o.from).add(o.to).commit(),l.add(o.from).add(o.to).commit(),1===s)){const e=this.selectedRange.previous();this.highlight.useLayerLevel(s-1),this.highlight.createArea().add(e.from).commit().syncWith(e),this.highlight.createLayeredArea().add(e.from).commit().syncWith(e),this.highlight.useLayerLevel(s)}if(this.highlight.isEnabledFor(Yo["g"],o.highlight)){if(!o.isSingleHeader()){const e=this.tableProps.createCellCoords(Math.max(o.from.row,0),-1),t=this.tableProps.createCellCoords(o.to.row,-1),n=this.tableProps.createCellCoords(-1,Math.max(o.from.col,0)),r=this.tableProps.createCellCoords(-1,o.to.col);"single"===this.settings.selectionMode?(c.add(e).commit(),h.add(n).commit(),f.add(e).commit(),g.add(n).commit()):(c.add(e).add(t).commit(),h.add(n).add(r).commit(),f.add(e).add(t).commit(),g.add(n).add(r).commit())}const e=!Ks(ea,this)&&this.isEntireRowSelected()&&(r>0&&r===o.getWidth()||0===r&&this.isSelectedByRowHeader()),t=!Ks(ea,this)&&this.isEntireColumnSelected()&&(n>0&&n===o.getHeight()||0===n&&this.isSelectedByColumnHeader());e&&u.add(this.tableProps.createCellCoords(Math.max(o.from.row,0),Math.min(-this.tableProps.countRowHeaders(),-1))).add(this.tableProps.createCellCoords(Math.max(o.to.row,0),-1)).commit(),t&&d.add(this.tableProps.createCellCoords(Math.min(-this.tableProps.countColHeaders(),-1),Math.max(o.from.col,0))).add(this.tableProps.createCellCoords(-1,Math.max(o.to.col,0))).commit(),e&&t&&p.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(),-this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1,-1)).commit()}const m=-1===Ks(na,this)||this.selectedRange.size()===Ks(na,this);this.runLocalHooks("afterSetRangeEnd",e,m)}setRangeFocus(e){if(this.selectedRange.isEmpty())return;const t=this.selectedRange.current();this.inProgress||this.runLocalHooks("beforeSetFocus",e);const n=this.highlight.getFocus();n.clear(),t.setHighlight(e),this.inProgress||this.runLocalHooks("beforeHighlightSet"),this.highlight.isEnabledFor(Yo["f"],t.highlight)&&n.add(t.highlight).commit().syncWith(t),this.inProgress||($s(Js,this,!0),this.runLocalHooks("afterSetFocus",t.highlight))}transformStart(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.settings.navigableHeaders&&Ks(Qs,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}),this.setRangeStart(Ks(Qs,this).transformStart(e,t,n))}transformEnd(e,t){this.settings.navigableHeaders&&Ks(Qs,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}),this.setRangeEnd(Ks(Qs,this).transformEnd(e,t))}transformFocus(e,t){const n=this.selectedRange.current(),{row:r,col:i}=n.getOuterTopStartCorner(),o=this.tableProps.countRenderableColumnsInRange(0,i-1),s=this.tableProps.countRenderableRowsInRange(0,r-1);n.highlight.isHeader()?Ks(Zs,this).setOffsetSize({x:i<0?Math.abs(i):-o,y:r<0?Math.abs(r):-s}):Ks(Zs,this).setOffsetSize({x:i<0?0:-o,y:r<0?0:-s});const a=Ks(Zs,this).transformStart(e,t);this.setRangeFocus(a.normalize())}getLayerLevel(){return this.selectedRange.size()-1}isSelected(){return!this.selectedRange.isEmpty()}isMultiple(){if(!this.isSelected())return!1;const e=Object(c["createObjectPropListener"])(!this.selectedRange.current().isSingle());return this.runLocalHooks("afterIsMultipleSelection",e),e.value}isFocusSelectionChanged(){return this.isSelected()&&Ks(Js,this)}isSelectedByRowHeader(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner(e)&&(-1===e?this.selectedByRowHeader.size>0:this.selectedByRowHeader.has(e))}isEntireRowSelected(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getLayerLevel();const t=e=>{const{col:t}=e.getOuterTopStartCorner(),n=this.tableProps.countRowHeaders(),r=this.tableProps.countCols();return(n>0&&t<0||0===n)&&e.getWidth()===r};if(-1===e)return Array.from(this.selectedRange).some(e=>t(e));const n=this.selectedRange.peekByIndex(e);return!!n&&t(n)}isSelectedByColumnHeader(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner()&&(-1===e?this.selectedByColumnHeader.size>0:this.selectedByColumnHeader.has(e))}isEntireColumnSelected(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getLayerLevel();const t=e=>{const{row:t}=e.getOuterTopStartCorner(),n=this.tableProps.countColHeaders(),r=this.tableProps.countRows();return(n>0&&t<0||0===n)&&e.getHeight()===r};if(-1===e)return Array.from(this.selectedRange).some(e=>t(e));const n=this.selectedRange.peekByIndex(e);return!!n&&t(n)}isSelectedByAnyHeader(){return this.isSelectedByRowHeader(-1)||this.isSelectedByColumnHeader(-1)||this.isSelectedByCorner()}isSelectedByCorner(){return this.selectedByColumnHeader.has(this.getLayerLevel())&&this.selectedByRowHeader.has(this.getLayerLevel())}inInSelection(e){return this.selectedRange.includes(e)}isCellCornerVisible(){return this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&!this.isMultiple()}isCellVisible(e){const t=this.tableProps.visualToRenderableCoords(e);return null!==t.row&&null!==t.col}isAreaCornerVisible(e){return(!Number.isInteger(e)||e===this.getLayerLevel())&&(this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&this.isMultiple())}clear(){this.selectedRange.clear(),this.highlight.clear()}deselect(){this.isSelected()&&(this.inProgress=!1,this.clear(),this.runLocalHooks("afterDeselect"))}selectAll(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{focusPosition:!1,disableHeadersHighlight:!1};const i=this.tableProps.countRows(),o=this.tableProps.countCols(),s=this.tableProps.countRowHeaders(),a=this.tableProps.countColHeaders(),l=n?-a:0,c=t?-s:0;if(0===l&&0===c&&(0===i||0===o))return;let h=null===(e=this.getSelectedRange().current())||void 0===e?void 0:e.highlight;const{focusPosition:u,disableHeadersHighlight:d}=r;$s(ea,this,d),u&&Number.isInteger(null===u||void 0===u?void 0:u.row)&&Number.isInteger(null===u||void 0===u?void 0:u.col)&&(h=this.tableProps.createCellCoords(Object(j["clamp"])(u.row,l,i-1),Object(j["clamp"])(u.col,c,o-1)));const p=this.tableProps.createCellCoords(l,c),f=this.tableProps.createCellCoords(i-1,o-1);this.clear(),this.setRangeStartOnly(p,void 0,h),c<0&&this.selectedByRowHeader.add(this.getLayerLevel()),l<0&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.finish(),$s(ea,this,!1)}selectCells(e){var t=this;const n=Object(Bs["c"])(e);if(n===Bs["a"])return!1;if(n===Bs["b"])throw new Error(We["a"]`Unsupported format of the selection ranges was passed. To select cells pass\x20
- the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\x20
- columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);const r=Object(Bs["d"])(n,{createCellCoords:function(){return t.tableProps.createCellCoords(...arguments)},createCellRange:function(){return t.tableProps.createCellRange(...arguments)},propToCol:e=>this.tableProps.propToCol(e),keepDirection:!0}),i=this.settings.navigableHeaders,o={countRows:this.tableProps.countRows(),countCols:this.tableProps.countCols(),countRowHeaders:i?this.tableProps.countRowHeaders():0,countColHeaders:i?this.tableProps.countColHeaders():0},s=!e.some(e=>{const t=r(e),n=t.isValid(o);return!(n&&!t.containsHeaders()||n&&t.containsHeaders()&&t.isSingleHeader())});return s&&(this.clear(),this.setExpectedLayers(e.length),Object(I["arrayEach"])(e,e=>{const{from:t,to:n}=r(e);this.setRangeStartOnly(t.clone(),!1),this.setRangeEnd(n.clone())}),this.finish()),s}selectColumns(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r="string"===typeof e?this.tableProps.propToCol(e):e,i="string"===typeof t?this.tableProps.propToCol(t):t,o=this.tableProps.countRows(),s=this.tableProps.countCols(),a=this.tableProps.countColHeaders(),l=0===a?0:-a,c=this.tableProps.createCellCoords(l,r),h=this.tableProps.createCellCoords(o-1,i),u=this.tableProps.createCellRange(c,c,h).isValid({countRows:o,countCols:s,countRowHeaders:0,countColHeaders:a});if(u){let e=0,t=0;Number.isInteger(null===n||void 0===n?void 0:n.row)&&Number.isInteger(null===n||void 0===n?void 0:n.col)?(e=Object(j["clamp"])(n.row,l,o-1),t=Object(j["clamp"])(n.col,Math.min(r,i),Math.max(r,i))):(e=Object(j["clamp"])(n,l,o-1),t=r);const s=this.tableProps.createCellCoords(e,t),c=0===a?0:Object(j["clamp"])(s.row,l,-1),h=o-1,u=this.tableProps.createCellCoords(c,r),d=this.tableProps.createCellCoords(h,i);this.runLocalHooks("beforeSelectColumns",u,d,s),u.row=c,d.row=h,this.setRangeStartOnly(u,void 0,s),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(d),this.runLocalHooks("afterSelectColumns",u,d,s),this.finish()}return u}selectRows(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=this.tableProps.countRows(),i=this.tableProps.countCols(),o=this.tableProps.countRowHeaders(),s=0===o?0:-o,a=this.tableProps.createCellCoords(e,s),l=this.tableProps.createCellCoords(t,i-1),c=this.tableProps.createCellRange(a,a,l).isValid({countRows:r,countCols:i,countRowHeaders:o,countColHeaders:0});if(c){let r=0,a=0;Number.isInteger(null===n||void 0===n?void 0:n.row)&&Number.isInteger(null===n||void 0===n?void 0:n.col)?(r=Object(j["clamp"])(n.row,Math.min(e,t),Math.max(e,t)),a=Object(j["clamp"])(n.col,s,i-1)):(r=e,a=Object(j["clamp"])(n,s,i-1));const l=this.tableProps.createCellCoords(r,a),c=0===o?0:Object(j["clamp"])(l.col,s,-1),h=i-1,u=this.tableProps.createCellCoords(e,c),d=this.tableProps.createCellCoords(t,h);this.runLocalHooks("beforeSelectRows",u,d,l),u.col=c,d.col=h,this.setRangeStartOnly(u,void 0,l),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(d),this.runLocalHooks("afterSelectRows",u,d,l),this.finish()}return c}refresh(){const e=this.highlight.getCustomSelections();if(e.forEach(e=>{e.commit()}),!this.isSelected())return;const t=this.highlight.getFocus(),n=this.getLayerLevel();t.commit().syncWith(this.selectedRange.current());for(let r=0;r<this.selectedRange.size();r+=1){this.highlight.useLayerLevel(r);const e=this.highlight.createArea(),t=this.highlight.createLayeredArea(),n=this.highlight.createRowHeader(),i=this.highlight.createColumnHeader(),o=this.highlight.createActiveRowHeader(),s=this.highlight.createActiveColumnHeader(),a=this.highlight.createActiveCornerHeader(),l=this.highlight.createRowHighlight(),c=this.highlight.createColumnHighlight();e.commit(),t.commit(),n.commit(),i.commit(),o.commit(),s.commit(),a.commit(),l.commit(),c.commit()}this.highlight.useLayerLevel(n)}}Object(c["mixin"])(ra,Ki["a"]);var ia=ra,oa=n("76ab");function sa(e,t){var n;return"CELL_TYPE"!==e&&((null===(n=t._automaticallyAssignedMetaProps)||void 0===n?void 0:n.has(e))||!Object(c["hasOwnProperty"])(t,e))}function aa(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;const r="string"===typeof t.type?Object(oa["a"])(t.type):t.type;if(e._automaticallyAssignedMetaProps&&Object(c["objectEach"])(t,(t,n)=>{e._automaticallyAssignedMetaProps.delete(n)}),!Object(c["isObject"])(r))return;n!==e||e._automaticallyAssignedMetaProps||(e._automaticallyAssignedMetaProps=new Set);const i={};Object(c["objectEach"])(r,(t,r)=>{var o;sa(r,n)&&(i[r]=t,null===(o=e._automaticallyAssignedMetaProps)||void 0===o||o.add(r))}),Object(c["extend"])(e,i)}function la(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];function n(){}Object(c["inherit"])(n,e);for(let r=0;r<t.length;r++)n.prototype[t[r]]=void 0;return n}function ca(e){return Number.isInteger(e)&&e>=0}function ha(e,t){if(!e())throw new Error("Assertion failed: "+t)}function ua(e){return null===e||void 0===e}var da=()=>({_automaticallyAssignedMetaProps:void 0,activeHeaderClassName:"ht__active_highlight",allowEmpty:!0,allowHtml:!1,allowInsertColumn:!0,allowInsertRow:!0,allowInvalid:!0,allowRemoveColumn:!0,allowRemoveRow:!0,ariaTags:!0,autoColumnSize:void 0,autoRowSize:void 0,autoWrapCol:!1,autoWrapRow:!1,bindRowsWithHeaders:void 0,cell:[],cells:void 0,checkedTemplate:void 0,className:void 0,colHeaders:null,collapsibleColumns:void 0,columnHeaderHeight:void 0,columns:void 0,columnSorting:void 0,columnSummary:void 0,colWidths:void 0,commentedCellClassName:"htCommentCell",comments:!1,contextMenu:void 0,copyable:!0,copyPaste:!0,correctFormat:!1,currentColClassName:void 0,currentHeaderClassName:"ht__highlight",currentRowClassName:void 0,customBorders:!1,data:void 0,dataSchema:void 0,dateFormat:"DD/MM/YYYY",datePickerConfig:void 0,defaultDate:void 0,disableVisualSelection:!1,dragToScroll:!0,dropdownMenu:void 0,editor:void 0,enterBeginsEditing:!0,enterMoves:{col:0,row:1},fillHandle:{autoInsertRow:!1},filter:!0,filteringCaseSensitive:!1,filters:void 0,fixedColumnsLeft:0,fixedColumnsStart:0,fixedRowsBottom:0,fixedRowsTop:0,formulas:void 0,fragmentSelection:!1,height:void 0,hiddenColumns:void 0,hiddenRows:void 0,invalidCellClassName:"htInvalid",imeFastEdit:!1,isEmptyCol(e){let t,n,r;for(t=0,n=this.countRows();t<n;t++)if(r=this.getDataAtCell(t,e),!1===Object(o["isEmpty"])(r))return!1;return!0},isEmptyRow(e){let t,n,r,i;for(t=0,n=this.countCols();t<n;t++)if(r=this.getDataAtCell(e,t),!1===Object(o["isEmpty"])(r))return"object"===typeof r&&(i=this.getCellMeta(e,t),Object(c["isObjectEqual"])(this.getSchema()[i.prop],r));return!0},label:void 0,language:"en-US",layoutDirection:"inherit",licenseKey:void 0,locale:"en-US",manualColumnFreeze:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,maxCols:1/0,maxRows:1/0,mergeCells:!1,minCols:0,minRows:0,minSpareCols:0,minSpareRows:0,multiColumnSorting:void 0,navigableHeaders:!1,tabNavigation:!0,nestedHeaders:void 0,nestedRows:void 0,noWordWrapClassName:"htNoWrap",numericFormat:void 0,observeDOMVisibility:!0,outsideClickDeselects:!0,persistentState:void 0,placeholder:void 0,placeholderCellClassName:"htPlaceholder",preventOverflow:!1,preventWheel:!1,readOnly:!1,readOnlyCellClassName:"htDimmed",renderAllRows:!1,renderAllColumns:!1,renderer:void 0,rowHeaders:void 0,rowHeaderWidth:void 0,rowHeights:void 0,search:!1,selectionMode:"multiple",selectOptions:void 0,skipColumnOnPaste:!1,skipRowOnPaste:!1,sortByRelevance:!0,source:void 0,startCols:5,startRows:5,stretchH:"none",strict:void 0,tableClassName:void 0,tabMoves:{row:0,col:1},title:void 0,trimDropdown:!0,trimRows:void 0,trimWhitespace:!0,type:"text",uncheckedTemplate:void 0,undo:void 0,validator:void 0,viewportColumnRenderingOffset:"auto",viewportRowRenderingOffset:"auto",visibleRows:10,width:void 0,wordWrap:!0});function pa(e,t,n){return t=fa(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fa(e){var t=ga(e,"string");return"symbol"==typeof t?t:t+""}function ga(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 ma(){return class{}}class ya{constructor(e){pa(this,"metaCtor",ma()),pa(this,"meta",void 0),this.meta=this.metaCtor.prototype,Object(c["extend"])(this.meta,da()),this.meta.instance=e}getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){var t;Object(c["extend"])(this.meta,e),aa(this.meta,{...e,type:null!==(t=e.type)&&void 0!==t?t:this.meta.type},e)}}function wa(e,t,n){return t=ba(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ba(e){var t=va(e,"string");return"symbol"==typeof t?t:t+""}function va(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 Ea{constructor(e){wa(this,"meta",void 0);const t=e.getMetaConstructor();this.meta=new t}getMeta(){return this.meta}updateMeta(e){Object(c["extend"])(this.meta,e),aa(this.meta,e,e)}}function Ca(e,t,n){return t=Sa(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sa(e){var t=Ra(e,"string");return"symbol"==typeof t?t:t+""}function Ra(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 Ta{constructor(e){Ca(this,"valueFactory",void 0),Ca(this,"data",[]),Ca(this,"index",[]),Ca(this,"holes",new Set),this.valueFactory=e}obtain(e){ha(()=>ca(e),"Expecting an unsigned number.");const t=this._getStorageIndexByKey(e);let n;if(t>=0)n=this.data[t],void 0===n&&(n=this.valueFactory(e),this.data[t]=n);else if(n=this.valueFactory(e),this.holes.size>0){const t=this.holes.values().next().value;this.holes.delete(t),this.data[t]=n,this.index[e]=t}else this.data.push(n),this.index[e]=this.data.length-1;return n}insert(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;ha(()=>ca(e)||ua(e),"Expecting an unsigned number or null/undefined argument.");const n=[],r=this.data.length;for(let o=0;o<t;o++)n.push(r+o),this.data.push(void 0);const i=ua(e)?this.index.length:e;this.index=[...this.index.slice(0,i),...n,...this.index.slice(i)]}remove(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;ha(()=>ca(e)||ua(e),"Expecting an unsigned number or null/undefined argument.");const n=this.index.splice(ua(e)?this.index.length-t:e,t);for(let r=0;r<n.length;r++){const e=n[r];"number"===typeof e&&this.holes.add(e)}}size(){return this.data.length-this.holes.size}values(){return Object(I["arrayFilter"])(this.data,(e,t)=>!this.holes.has(t))[Symbol.iterator]()}entries(){const e=[];for(let n=0;n<this.data.length;n++){const t=this._getKeyByStorageIndex(n);-1!==t&&e.push([t,this.data[n]])}let t=0;return{next:()=>{if(t<e.length){const n=e[t];return t+=1,{value:n,done:!1}}return{done:!0}}}}clear(){this.data=[],this.index=[],this.holes.clear()}_getStorageIndexByKey(e){return this.index.length>e?this.index[e]:-1}_getKeyByStorageIndex(e){return this.index.indexOf(e)}[Symbol.iterator](){return this.entries()}}function 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)}const Ia=["data","width"];class Ma{constructor(e){Oa(this,"globalMeta",void 0),Oa(this,"metas",new Ta(()=>this._createMeta())),this.globalMeta=e,this.metas=new Ta(()=>this._createMeta())}updateMeta(e,t){const n=this.getMeta(e);Object(c["extend"])(n,t),aa(n,t)}createColumn(e,t){this.metas.insert(e,t)}removeColumn(e,t){this.metas.remove(e,t)}getMeta(e){return this.metas.obtain(e)}getMetaConstructor(e){return this.metas.obtain(e).constructor}clearCache(){this.metas.clear()}_createMeta(){return la(this.globalMeta.getMetaConstructor(),Ia).prototype}}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){xa(this,"columnMeta",void 0),xa(this,"metas",new Ta(()=>this._createRow())),this.columnMeta=e}updateMeta(e,t,n){const r=this.getMeta(e,t);Object(c["extend"])(r,n),aa(r,n)}createRow(e,t){this.metas.insert(e,t)}createColumn(e,t){for(let n=0;n<this.metas.size();n++)this.metas.obtain(n).insert(e,t)}removeRow(e,t){this.metas.remove(e,t)}removeColumn(e,t){for(let n=0;n<this.metas.size();n++)this.metas.obtain(n).remove(e,t)}getMeta(e,t,n){const r=this.metas.obtain(e).obtain(t);return void 0===n?r:r[n]}setMeta(e,t,n,r){var i;const o=this.metas.obtain(e).obtain(t);null===(i=o._automaticallyAssignedMetaProps)||void 0===i||i.delete(n),o[n]=r}removeMeta(e,t,n){const r=this.metas.obtain(e).obtain(t);delete r[n]}getMetas(){const e=[],t=Array.from(this.metas.values());for(let n=0;n<t.length;n++)Object(o["isDefined"])(t[n])&&e.push(...t[n].values());return e}getMetasAtRow(e){ha(()=>ca(e),"Expecting an unsigned number.");const t=new Map(this.metas);return t.has(e)?Array.from(t.get(e).values()):[]}clearCache(){this.metas.clear()}_createRow(){return new Ta(e=>this._createMeta(e))}_createMeta(e){const t=this.columnMeta.getMetaConstructor(e);return new t}}class ka{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this.hot=e,this.globalMeta=new ya(e),this.tableMeta=new Ea(this.globalMeta),this.columnMeta=new Ma(this.globalMeta),this.cellMeta=new Pa(this.columnMeta),n.forEach(e=>new e(this)),this.globalMeta.updateMeta(t)}getGlobalMeta(){return this.globalMeta.getMeta()}updateGlobalMeta(e){this.globalMeta.updateMeta(e)}getTableMeta(){return this.tableMeta.getMeta()}updateTableMeta(e){this.tableMeta.updateMeta(e)}getColumnMeta(e){return this.columnMeta.getMeta(e)}updateColumnMeta(e,t){this.columnMeta.updateMeta(e,t)}getCellMeta(e,t,n){let{visualRow:r,visualColumn:i}=n;const o=this.cellMeta.getMeta(e,t);return o.visualRow=r,o.visualCol=i,o.row=e,o.col=t,this.runLocalHooks("afterGetCellMeta",o),o}getCellMetaKeyValue(e,t,n){if("string"!==typeof n)throw new Error("The passed cell meta object key is not a string");return this.cellMeta.getMeta(e,t,n)}setCellMeta(e,t,n,r){this.cellMeta.setMeta(e,t,n,r)}updateCellMeta(e,t,n){this.cellMeta.updateMeta(e,t,n)}removeCellMeta(e,t,n){this.cellMeta.removeMeta(e,t,n)}getCellsMeta(){return this.cellMeta.getMetas()}getCellsMetaAtRow(e){return this.cellMeta.getMetasAtRow(e)}createRow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cellMeta.createRow(e,t)}removeRow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cellMeta.removeRow(e,t)}createColumn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cellMeta.createColumn(e,t),this.columnMeta.createColumn(e,t)}removeColumn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.cellMeta.removeColumn(e,t),this.columnMeta.removeColumn(e,t)}clearCellsCache(){this.cellMeta.clearCache()}clearCache(){this.cellMeta.clearCache(),this.columnMeta.clearCache()}}function ja(e,t,n){return t=Ha(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ha(e){var t=Da(e,"string");return"symbol"==typeof t?t:t+""}function Da(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)}Object(c["mixin"])(ka,Ki["a"]);class Fa{constructor(e){ja(this,"metaManager",void 0),ja(this,"metaSyncMemo",new Map),this.metaManager=e,e.addLocalHook("afterGetCellMeta",e=>this.extendCellMeta(e)),bo["a"].getSingleton().add("beforeRender",e=>{e&&this.metaSyncMemo.clear()},this.metaManager.hot)}extendCellMeta(e){var t;const{row:n,col:r}=e;if(null!==(t=this.metaSyncMemo.get(n))&&void 0!==t&&t.has(r))return;const{visualRow:o,visualCol:s}=e,a=this.metaManager.hot,l=a.colToProp(s);e.prop=l,a.runHooks("beforeGetCellMeta",o,s,e);const h=Object(c["hasOwnProperty"])(e,"type")?e.type:null;let u=Object(i["isFunction"])(e.cells)?e.cells(n,r,l):null;var d;h&&(u?u.type=null!==(d=u.type)&&void 0!==d?d:h:u={type:h});u&&this.metaManager.updateCellMeta(n,r,u),a.runHooks("afterGetCellMeta",o,s,e),this.metaSyncMemo.has(n)||this.metaSyncMemo.set(n,new Set),this.metaSyncMemo.get(n).add(r)}}function Ua(e,t,n){return t=Va(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Va(e){var t=Ba(e,"string");return"symbol"==typeof t?t:t+""}function Ba(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 Wa{constructor(e){Ua(this,"metaManager",void 0),Ua(this,"usageTracker",new Set),Ua(this,"propDescriptors",new Map([["ariaTags",{onChange(e,t,n){if(!n)throw new Error(`The \`${e}\` option can not be updated after the Handsontable instance was initialized.`)}}],["fixedColumnsLeft",{target:"fixedColumnsStart",onChange(e){const t=this.metaManager.hot.isRtl();if(t&&"fixedColumnsLeft"===e)throw new Error("The `fixedColumnsLeft` is not supported for RTL. Please use option `fixedColumnsStart`.");if(this.usageTracker.has("fixedColumnsLeft")&&this.usageTracker.has("fixedColumnsStart"))throw new Error("The `fixedColumnsLeft` and `fixedColumnsStart` should not be used together. Please use only the option `fixedColumnsStart`.")}}],["layoutDirection",{onChange(e,t,n){if(!n)throw new Error(`The \`${e}\` option can not be updated after the Handsontable is initialized.`)}}]])),this.metaManager=e,this.extendMetaProps()}extendMetaProps(){this.propDescriptors.forEach((e,t)=>{const{target:n,onChange:r=(()=>{})}=e,i="string"===typeof n,o=i?n:t,s="_"+o;this.metaManager.globalMeta.meta[s]=this.metaManager.globalMeta.meta[o],this.installPropWatcher(t,s,r),i&&this.installPropWatcher(n,s,r)})}installPropWatcher(e,t,n){const r=this;Object.defineProperty(this.metaManager.globalMeta.meta,e,{get(){return this[t]},set(i){const o=!r.usageTracker.has(e);r.usageTracker.add(e),n.call(r,e,i,o),this[t]=i},enumerable:!0,configurable:!0})}}var Ga=n("3bc4");function za(e,t,n){return t=Ya(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ya(e){var t=Xa(e,"string");return"symbol"==typeof t?t:t+""}function Xa(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 Ka{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}constructor(e,t,n){za(this,"hot",void 0),za(this,"metaManager",void 0),za(this,"tableMeta",void 0),za(this,"dataSource",void 0),za(this,"duckSchema",void 0),za(this,"colToPropCache",void 0),za(this,"propToColCache",void 0),this.hot=e,this.metaManager=n,this.tableMeta=n.getTableMeta(),this.dataSource=t,this.duckSchema=this.createDuckSchema(),this.createMap()}createMap(){const e=this.getSchema();if("undefined"===typeof e)throw new Error("trying to create `columns` definition but you didn't provide `schema` nor `data`");const t=this.tableMeta.columns;let n;if(this.colToPropCache=[],this.propToColCache=new Map,t){let r=0,i=0,o=!1;if("function"===typeof t){const t=Object(c["deepObjectSize"])(e);r=t>0?t:this.countFirstRowKeys(),o=!0}else{const e=this.tableMeta.maxCols;r=Math.min(e,t.length)}for(n=0;n<r;n++){const e=o?t(n):t[n];if(Object(c["isObject"])(e)){if("undefined"!==typeof e.data){const t=o?i:n;this.colToPropCache[t]=e.data,this.propToColCache.set(e.data,t)}i+=1}}}else this.recursiveDuckColumns(e)}countFirstRowKeys(){return Object(Ai["countFirstRowKeys"])(this.dataSource)}recursiveDuckColumns(e,t,n){let r,i=t,o=n;return"undefined"===typeof i&&(i=0,o=""),"object"!==typeof e||Array.isArray(e)||Object(c["objectEach"])(e,(e,t)=>{null===e?(r=o+t,this.colToPropCache.push(r),this.propToColCache.set(r,i),i+=1):i=this.recursiveDuckColumns(e,i,t+".")}),i}colToProp(e){if(!1===Number.isInteger(e))return e;const t=this.hot.toPhysicalColumn(e);return null===t?e:this.colToPropCache&&Object(o["isDefined"])(this.colToPropCache[t])?this.colToPropCache[t]:t}propToCol(e){const t=this.propToColCache.get(e);if(Object(o["isDefined"])(t))return this.hot.toVisualColumn(t);const n=this.hot.toVisualColumn(e);return null===n?e:n}getSchema(){const e=this.tableMeta.dataSchema;return e?"function"===typeof e?e():e:this.duckSchema}createDuckSchema(){return this.dataSource&&this.dataSource[0]?Object(c["duckSchema"])(this.dataSource[0]):{}}refreshDuckSchema(){this.duckSchema=this.createDuckSchema()}createRow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,{source:n,mode:r="above"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=this.hot.countSourceRows();let o=i,s=0,a=e;("number"!==typeof a||a>=i)&&(a=i),a<this.hot.countRows()&&(o=this.hot.toPhysicalRow(a));const l=this.hot.runHooks("beforeCreateRow",a,t,n);if(!1===l||null===o)return{delta:0};const h=this.tableMeta.maxRows,u=this.getSchema().length,d=[];while(s<t&&i+s<h){let e=null;"array"===this.hot.dataType?this.tableMeta.dataSchema?e=Object(c["deepClone"])(this.getSchema()):(e=[],Object(j["rangeEach"])(u-1,()=>e.push(null))):"function"===this.hot.dataType?e=this.tableMeta.dataSchema(a+s):(e={},Object(c["deepExtend"])(e,this.getSchema())),d.push(e),s+=1}this.hot.rowIndexMapper.insertIndexes(a,s),"below"===r&&(o=Math.min(o+1,i)),this.spliceData(o,0,d);const p=this.hot.toVisualRow(o);return this.hot.countSourceRows()===d.length&&this.hot.columnIndexMapper.initToLength(this.hot.getInitialColumnCount()),s>0&&(void 0===e||null===e?this.metaManager.createRow(null,s):"auto"!==n&&this.metaManager.createRow(o,t)),this.hot.runHooks("afterCreateRow",p,s,n),this.hot.forceFullRender=!0,{delta:s,startPhysicalIndex:o}}createCol(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,{source:n,mode:r="start"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!this.hot.isColumnModificationAllowed())throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource.");const i=this.dataSource,o=this.tableMeta.maxCols,s=this.hot.countSourceCols();let a=e;("number"!==typeof a||a>=s)&&(a=s);const l=this.hot.runHooks("beforeCreateCol",a,t,n);if(!1===l)return{delta:0};let c=s;a<this.hot.countCols()&&(c=this.hot.toPhysicalColumn(a));const h=this.hot.countSourceRows();let u=this.hot.countCols(),d=0,p=c;"end"===r&&(p=Math.min(p+1,s));const f=p;while(d<t&&u<o){if("number"!==typeof a||a>=u)if(h>0)for(let e=0;e<h;e+=1)"undefined"===typeof i[e]&&(i[e]=[]),i[e].push(null);else i.push([null]);else for(let e=0;e<h;e++)i[e].splice(p,0,null);d+=1,p+=1,u+=1}this.hot.columnIndexMapper.insertIndexes(a,d),d>0&&(void 0===e||null===e?this.metaManager.createColumn(null,d):"auto"!==n&&this.metaManager.createColumn(f,t));const g=this.hot.toVisualColumn(f);return this.hot.runHooks("afterCreateCol",g,d,n),this.hot.forceFullRender=!0,this.refreshDuckSchema(),{delta:d,startPhysicalIndex:f}}removeRow(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0,r=Number.isInteger(e)?e:-t;const i=this.visualRowsToPhysical(r,t),s=this.hot.countSourceRows();r=(s+r)%s;const a=this.hot.runHooks("beforeRemoveRow",r,i.length,i,n);if(!1===a)return!1;const l=i.length;if(this.filterData(r,l,i),r<this.hot.countRows()){this.hot.rowIndexMapper.removeIndexes(i);const e=Object(o["isDefined"])(this.tableMeta.columns)||Object(o["isDefined"])(this.tableMeta.dataSchema);0===this.hot.rowIndexMapper.getNotTrimmedIndexesLength()&&!1===e&&this.hot.columnIndexMapper.setIndexesSequence([])}const c=i.slice(0).sort((e,t)=>t-e);return c.forEach(e=>{this.metaManager.removeRow(e,1)}),this.hot.runHooks("afterRemoveRow",r,l,i,n),this.hot.forceFullRender=!0,!0}removeCol(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0;if("object"===this.hot.dataType||this.tableMeta.columns)throw new Error("cannot remove column with object data source or columns option specified");let r="number"!==typeof e?-t:e;r=(this.hot.countCols()+r)%this.hot.countCols();const i=this.visualColumnsToPhysical(r,t),o=i.slice(0).sort((e,t)=>t-e),s=this.hot.runHooks("beforeRemoveCol",r,t,i,n);if(!1===s)return!1;let a=!0;const l=o.length,c=this.dataSource;for(let h=0;h<l;h++)a&&i[0]!==i[h]-h&&(a=!1);if(a)for(let h=0,u=this.hot.countSourceRows();h<u;h++)c[h].splice(i[0],t),0===h&&this.metaManager.removeColumn(i[0],t);else for(let h=0,u=this.hot.countSourceRows();h<u;h++)for(let e=0;e<l;e++)c[h].splice(o[e],1),0===h&&this.metaManager.removeColumn(o[e],1);return r<this.hot.countCols()&&(this.hot.columnIndexMapper.removeIndexes(i),0===this.hot.columnIndexMapper.getNotTrimmedIndexesLength()&&this.hot.rowIndexMapper.setIndexesSequence([])),this.hot.runHooks("afterRemoveCol",r,t,i,n),this.hot.forceFullRender=!0,this.refreshDuckSchema(),!0}spliceCol(e,t,n){const r=this.hot.getDataAtCol(e),i=r.slice(t,t+n),o=r.slice(t+n);for(var s=arguments.length,a=new Array(s>3?s-3:0),l=3;l<s;l++)a[l-3]=arguments[l];Object(I["extendArray"])(a,o);let c=0;while(c<n)a.push(null),c+=1;return Object(I["to2dArray"])(a),this.hot.populateFromArray(t,e,a,null,null,"spliceCol"),i}spliceRow(e,t,n){const r=this.hot.getSourceDataAtRow(e),i=r.slice(t,t+n),o=r.slice(t+n);for(var s=arguments.length,a=new Array(s>3?s-3:0),l=3;l<s;l++)a[l-3]=arguments[l];Object(I["extendArray"])(a,o);let c=0;while(c<n)a.push(null),c+=1;return this.hot.populateFromArray(e,t,[a],null,null,"spliceRow"),i}spliceData(e,t,n){const r=this.hot.runHooks("beforeDataSplice",e,t,n);if(!1!==r){const t=[...this.dataSource.slice(0,e),...n,...this.dataSource.slice(e)];this.dataSource.length=0,t.forEach(e=>this.dataSource.push(e))}}filterData(e,t,n){let r=this.hot.runHooks("filterData",e,t,n);!1===Array.isArray(r)&&(r=this.dataSource.filter((e,t)=>-1===n.indexOf(t))),this.dataSource.length=0,Array.prototype.push.apply(this.dataSource,r)}get(e,t){const n=this.hot.toPhysicalRow(e);let r=this.dataSource[n];const i=this.hot.runHooks("modifyRowData",n);r=isNaN(i)?i:r;let o=null;if(r&&r.hasOwnProperty&&Object(c["hasOwnProperty"])(r,t))o=r[t];else if("string"===typeof t&&t.indexOf(".")>-1){const e=t.split(".");let n=r;if(!n)return null;for(let t=0,r=e.length;t<r;t++)if(n=n[e[t]],"undefined"===typeof n)return null;o=n}else"function"===typeof t&&(o=t(this.dataSource.slice(n,n+1)[0]));if(this.hot.hasHook("modifyData")){const e=Object(c["createObjectPropListener"])(o);this.hot.runHooks("modifyData",n,this.propToCol(t),e,"get"),e.isTouched()&&(o=e.value)}return o}getCopyable(e,t){return this.hot.getCellMeta(e,this.propToCol(t)).copyable?this.get(e,t):""}set(e,t,n){const r=this.hot.toPhysicalRow(e);let i=n,o=this.dataSource[r];const s=this.hot.runHooks("modifyRowData",r);if(o=isNaN(s)?s:o,this.hot.hasHook("modifyData")){const e=Object(c["createObjectPropListener"])(i);this.hot.runHooks("modifyData",r,this.propToCol(t),e,"set"),e.isTouched()&&(i=e.value)}if(o&&o.hasOwnProperty&&Object(c["hasOwnProperty"])(o,t))o[t]=i;else if("string"===typeof t&&t.indexOf(".")>-1){const e=t.split(".");let n,r=o,s=0;for(s=0,n=e.length-1;s<n;s++)"undefined"===typeof r[e[s]]&&(r[e[s]]={}),r=r[e[s]];r[e[s]]=i}else"function"===typeof t?t(this.dataSource.slice(r,r+1)[0],i):o[t]=i}visualRowsToPhysical(e,t){const n=this.hot.countSourceRows(),r=[];let i,o=(n+e)%n,s=t;while(o<n&&s)i=this.hot.toPhysicalRow(o),r.push(i),s-=1,o+=1;return r}visualColumnsToPhysical(e,t){const n=this.hot.countCols(),r=[];let i=(n+e)%n,o=t;while(i<n&&o){const e=this.hot.toPhysicalColumn(i);r.push(e),o-=1,i+=1}return r}clear(){for(let e=0;e<this.hot.countSourceRows();e++)for(let t=0;t<this.hot.countCols();t++)this.set(e,this.colToProp(t),"")}getLength(){const e=this.tableMeta.maxRows;let t;t=e<0||0===e?0:e||1/0;const n=this.hot.rowIndexMapper.getNotTrimmedIndexesLength();return Math.min(n,t)}getAll(){const e={row:0,col:0},t={row:Math.max(this.hot.countRows()-1,0),col:Math.max(this.hot.countCols()-1,0)};return e.row-t.row!==0||this.hot.countSourceRows()?this.getRange(e,t,Ka.DESTINATION_RENDERER):[]}countCachedColumns(){return this.colToPropCache.length}getRange(e,t,n){const r=[];let i,o,s;const a=this.tableMeta.maxRows,l=this.tableMeta.maxCols;if(0===a||0===l)return[];const c=n===Ka.DESTINATION_CLIPBOARD_GENERATOR?this.getCopyable:this.get,h=Math.min(Math.max(a-1,0),Math.max(e.row,t.row)),u=Math.min(Math.max(l-1,0),Math.max(e.col,t.col));for(i=Math.min(e.row,t.row);i<=h;i++){s=[];const n=i>=0?this.hot.toPhysicalRow(i):i;for(o=Math.min(e.col,t.col);o<=u;o++){if(null===n)break;s.push(c.call(this,i,this.colToProp(o)))}null!==n&&r.push(s)}return r}getText(e,t){return Object(Ga["b"])(this.getRange(e,t,Ka.DESTINATION_RENDERER))}getCopyableText(e,t){return Object(Ga["b"])(this.getRange(e,t,Ka.DESTINATION_CLIPBOARD_GENERATOR))}destroy(){this.hot=null,this.metaManager=null,this.dataSource=null,this.duckSchema=null,this.colToPropCache.length=0,this.propToColCache.clear(),this.propToColCache=void 0}}var $a=Ka;function qa(e,t,n,o){const{hotInstance:s,dataMap:a,dataSource:l,internalSource:h,source:u,metaManager:d,firstRun:p}=o,f=Object(k["toUpperCaseFirst"])(h),g=s.getSettings();Array.isArray(g.dataSchema)?s.dataType="array":Object(i["isFunction"])(g.dataSchema)?s.dataType="function":s.dataType="object",a&&a.destroy(),e=s.runHooks("before"+f,e,p,u);const m=new $a(s,e,d);if(t(m),"object"===typeof e&&null!==e)e.push&&e.splice||(e=[e]);else{if(null!==e)throw new Error(`${h} only accepts array of objects or array of arrays (${typeof e} given)`);{const t=m.getSchema();let n;e=[];let r=0,i=0;for(r=0,i=g.startRows;r<i;r++)if("object"!==s.dataType&&"function"!==s.dataType||!g.dataSchema)if("array"===s.dataType)n=Object(c["deepClone"])(t[0]),e.push(n);else{n=[];for(let e=0,t=g.startCols;e<t;e++)n.push(null);e.push(n)}else n=Object(c["deepClone"])(t),e.push(n)}}Array.isArray(e[0])&&(s.dataType="array"),g.data=e,m.dataSource=e,l.data=e,l.dataType=s.dataType,l.colToProp=m.colToProp.bind(m),l.propToCol=m.propToCol.bind(m),l.countCachedColumns=m.countCachedColumns.bind(m),n(m),s.runHooks("after"+f,e,p,u),p||(s.runHooks("afterChange",null,h),s.render()),s.getSettings().ariaTags&&Object(r["setAttribute"])(s.rootElement,[Object(He["B"])(-1),Object(He["e"])(s.countCols()+(s.view?s.countRowHeaders():0))])}function Qa(e){return t=>{let{col:n}=t;e.scrollViewportTo({col:n})}}function Za(){return()=>{}}function Ja(e){return t=>{e.scrollViewportTo(t.toObject())}}function el(e){return t=>{e.scrollViewportTo(t.toObject())}}function tl(e){return t=>{e.scrollViewportTo(t.toObject())}}function nl(e){return t=>{let{row:n}=t;e.scrollViewportTo({row:n})}}function rl(e){return t=>{const n=e.selection.getSelectionSource(),{row:r,col:i}=t;if(r<0&&i>=0)e.scrollViewportTo({col:i});else if(i<0&&r>=0)e.scrollViewportTo({row:r});else{if("mouse"===n&&(i===e.view.getLastPartiallyVisibleColumn()||r===e.view.getLastPartiallyVisibleRow()))return;e.scrollViewportTo({row:r,col:i})}}}function il(e){const{selection:t}=e;let n=!1,r=!1;return{resume(){r=!1},suspend(){r=!0},skipNextScrollCycle(){n=!0},scrollTo(i){var o;if(n||r)return void(n=!1);let s;t.isFocusSelectionChanged()?s=Ja(e):t.isSelectedByCorner()?s=Za(e):t.isSelectedByRowHeader()?s=nl(e):t.isSelectedByColumnHeader()?s=Qa(e):1===t.getSelectedRange().size()&&t.isMultiple()?s=el(e):1!==t.getSelectedRange().size()||t.isMultiple()?t.getSelectedRange().size()>1&&(s=tl(e)):s=rl(e),null===(o=s)||void 0===o||o(i)}}}var ol=n("c4fa");function sl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.rootElement,r=al(e),i=al(e);return r.addEventListener("focus",()=>null===t||void 0===t?void 0:t.onFocusFromTop()),i.addEventListener("focus",()=>null===t||void 0===t?void 0:t.onFocusFromBottom()),n.firstChild.before(r),n.lastChild.after(i),{activate(){e._registerTimeout(()=>{r.tabIndex=0,i.tabIndex=0},10)},deactivate(){e._registerTimeout(()=>{r.tabIndex=-1,i.tabIndex=-1},10)}}}function al(e){const t=e.rootDocument,n=t.createElement("input");return n.type="text",n.classList.add("htFocusCatcher"),e.getSettings().ariaTags&&Object(r["setAttribute"])(n,[Object(He["x"])(),Object(He["n"])()]),n}function ll(e){const t=ul(e);let n;const{activate:r,deactivate:i}=sl(e,{onFocusFromTop(){var r;const i=null!==(r=t(n))&&void 0!==r?r:cl(e);i&&(e.runHooks("modifyFocusOnTabNavigation","from_above",i),e.selectCell(i.row,i.col)),e.listen()},onFocusFromBottom(){var r;const i=null!==(r=t(n))&&void 0!==r?r:hl(e);i&&(e.runHooks("modifyFocusOnTabNavigation","from_below",i),e.selectCell(i.row,i.col)),e.listen()}}),o={wrapped:!1,flipped:!1};let s=!0,a=!1,l=!1;function c(){o.wrapped=!1,o.flipped=!1,e.deselectCell(),e.unlisten()}e.addHook("afterListen",()=>i()),e.addHook("afterUnlisten",()=>r()),e.addHook("afterSelection",(t,r,i,c,h)=>{var u;(a&&(o.wrapped&&o.flipped||l)&&(l=!1,h.value=!0),s)&&(n=null===(u=e.getSelectedRangeLast())||void 0===u?void 0:u.highlight)}),e.addHook("beforeRowWrap",(e,t,n)=>{o.wrapped=!0,o.flipped=n});const h={keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:ol["b"],group:"focusCatcher"};e.getShortcutManager().getContext("grid").addShortcuts([{...h,callback:()=>{const{tabNavigation:t}=e.getSettings();a=!0,e.getSelectedRangeLast()&&!t&&(s=!1),t||(l=!0)},position:"before"},{...h,callback:t=>{const{tabNavigation:r,autoWrapRow:i}=e.getSettings();if(a=!1,s=!0,!r||!e.selection.isSelected()||i&&o.wrapped&&o.flipped||!i&&o.wrapped)return i&&o.wrapped&&o.flipped&&(n=t.shiftKey?cl(e):hl(e)),c(),!1;t.preventDefault()},position:"after"}])}function cl(e){const{rowIndexMapper:t,columnIndexMapper:n}=e,{navigableHeaders:r}=e.getSettings();let i=r&&e.countColHeaders()>0?-e.countColHeaders():0,o=r&&e.countRowHeaders()>0?-e.countRowHeaders():0;return 0===i&&(i=t.getVisualFromRenderableIndex(i)),0===o&&(o=n.getVisualFromRenderableIndex(o)),null===i||null===o?null:e._createCellCoords(i,o)}function hl(e){var t,n;const{rowIndexMapper:r,columnIndexMapper:i}=e,{navigableHeaders:o}=e.getSettings();let s=r.getRenderableIndexesLength()-1,a=i.getRenderableIndexesLength()-1;if(s<0){if(!o||0===e.countColHeaders())return null;s=-1}if(a<0){if(!o||0===e.countColHeaders())return null;a=-1}return e._createCellCoords(null!==(t=r.getVisualFromRenderableIndex(s))&&void 0!==t?t:s,null!==(n=i.getVisualFromRenderableIndex(a))&&void 0!==n?n:a)}function ul(e){return t=>{if(!t)return null;const n=cl(e),r=hl(e);return t.col<n.col&&(t.col=n.col),t.col>r.col&&(t.col=r.col),t.row<n.row&&(t.row=n.row),t.row>r.row&&(t.row=r.row),t}}var dl=n("6906");const pl=new Map([[" ","space"],["spacebar","space"],["scroll","scrolllock"],["del","delete"],["esc","escape"],["medianexttrack","mediatracknext"],["mediaprevioustrack","mediatrackprevious"],["volumeup","audiovolumeup"],["volumedown","audiovolumedown"],["volumemute","audiovolumemute"],["multiply","*"],["add","+"],["divide","/"],["subtract","-"],["left","arrowleft"],["right","arrowright"],["up","arrowup"],["down","arrowdown"]]),fl=e=>e.map(e=>{const t=e.toLowerCase();return pl.has(t)?pl.get(t):t}).sort().join("+"),gl=e=>e.split("+"),ml=new RegExp("^(?:Key|Digit)([A-Z0-9])$"),yl=new Set(["Backquote","Minus","Equal","BracketLeft","BracketRight","Backslash","Semicolon","Quote","Comma","Period","Slash"]),wl=e=>{let{key:t,code:n}=e,r=t;return ml.test(n)?r=n.replace(ml,"$1"):yl.has(n)&&(r=n),r.toLowerCase()},bl=Symbol("shortcut-context");function vl(e){return Object(c["isObject"])(e)&&e.__kindOf===bl}const El=e=>{const t=Object(dl["a"])({errorIdExists:t=>`The "${t}" shortcut is already registered in the "${e}" context.`}),n=function(){let{keys:e,callback:n,group:r,runOnlyIf:s=(()=>!0),captureCtrl:a=!1,preventDefault:l=!0,stopPropagation:c=!1,relativeToGroup:h,position:u,forwardToContext:d}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(o["isUndefined"])(r))throw new Error("You need to define the shortcut's group.");if(!1===Object(i["isFunction"])(n))throw new Error("The shortcut's callback needs to be a function.");if(!1===Array.isArray(e))throw new Error(We["a"]`Pass the shortcut\'s keys as an array of arrays,\x20
- using the KeyboardEvent.key properties:\x20
- https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.`);const p={callback:n,group:r,runOnlyIf:s,captureCtrl:a,preventDefault:l,stopPropagation:c};Object(o["isDefined"])(h)&&(p.relativeToGroup=h,p.position=u),vl(d)&&(p.forwardToContext=d),e.forEach(e=>{const n=fl(e),r=t.hasItem(n);if(r){const e=t.getItem(n);let r=e.findIndex(e=>e.group===h);-1!==r?"before"===u?r-=1:r+=1:r=e.length,e.splice(r,0,p)}else t.addItem(n,[p])})},r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.forEach(e=>{Object(c["objectEach"])(t,(n,r)=>{!1===Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=t[r])}),n(e)})},s=e=>{const n=fl(e);t.removeItem(n)},a=e=>{const n=t.getItems();n.forEach(t=>{let[n,r]=t;const i=r.filter(t=>t.group!==e);0===i.length?s(gl(n)):(r.length=0,r.push(...i))})},l=e=>{const n=fl(e),r=t.getItem(n);return Object(o["isDefined"])(r)?r.slice():[]},h=e=>{const n=fl(e);return t.hasItem(n)};return{__kindOf:bl,addShortcut:n,addShortcuts:r,getShortcuts:l,hasShortcut:h,removeShortcutsByKeys:s,removeShortcutsByGroup:a}};function Cl(){const e=new Set;return{press(t){e.add(t)},release(t){e.delete(t)},releaseAll(){e.clear()},isPressed(t){return e.has(t)}}}const Sl=["meta","alt","shift","control"],Rl=Cl(),Tl=[];let Ol=0;function Nl(e,t,n,i,o){const a=e=>Sl.includes(e),l=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=[];return e.altKey&&n.push("alt"),t&&(e.ctrlKey||e.metaKey)?n.push("control/meta"):(e.ctrlKey&&n.push("control"),e.metaKey&&n.push("meta")),e.shiftKey&&n.push("shift"),n},c=e=>{if(!1===t(e))return;const r=n(e);if(229===e.keyCode||!1===r||Object(H["isImmediatePropagationStopped"])(e))return;const c=wl(e);let h=[];a(c)||(h=l(e));const u=[c].concat(h),d=o(e,u);!d&&(Object(s["isMacOS"])()&&h.includes("meta")||!Object(s["isMacOS"])()&&h.includes("control"))&&o(e,[c].concat(l(e,!0))),i(e)},h=e=>{if(e.key){const t=wl(e);a(t)&&Rl.press(t)}},u=e=>{if(e.key){const t=wl(e);a(t)&&Rl.release(t)}},d=()=>{Rl.releaseAll()},p=()=>{let t=e;Ol+=1;while(t)1===Ol&&(t.document.documentElement.addEventListener("keydown",h),Tl.push({event:"keydown",listener:h}),t.document.documentElement.addEventListener("keyup",u),Tl.push({event:"keyup",listener:u})),t.document.documentElement.addEventListener("keydown",c),t.document.documentElement.addEventListener("blur",d),t=Object(r["getParentWindow"])(t)},f=()=>{let t=e;Ol-=1;while(t){if(0===Ol){for(let e=0;e<Tl.length;e++){const{event:n,listener:r}=Tl[e];t.document.documentElement.removeEventListener(n,r)}Tl.length=0}t.document.documentElement.removeEventListener("keydown",c),t.document.documentElement.removeEventListener("blur",d),t=Object(r["getParentWindow"])(t)}};return{mount:p,unmount:f,isPressed:e=>Rl.isPressed(e),releasePressedKeys:()=>Rl.releaseAll()}}const Al=e=>{let{ownerWindow:t,handleEvent:n,beforeKeyDown:r,afterKeyDown:i}=e;const o=Object(dl["a"])({errorIdExists:e=>`The "${e}" context name is already registered.`});let s="grid";const a=e=>{const t=El(e);return o.addItem(e,t),t},l=()=>s,c=e=>o.getItem(e),h=e=>{if(!o.hasItem(e))throw new Error(We["a"]`You've tried to activate the "${e}" shortcut context\x20
- that does not exist. Before activation, register the context using the "addContext" method.`);s=e};let u=!1;const d=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l();const r=vl(n)?n:c(n);let i=!1;if(!r.hasShortcut(t))return i;const o=r.getShortcuts(t);for(let s=0;s<o.length;s++){const{callback:n,runOnlyIf:r,preventDefault:a,stopPropagation:l,captureCtrl:c,forwardToContext:h}=o[s];if(!0===r(e)){if(u=c,i=!1===n(e,t),u=!1,a&&e.preventDefault(),l&&(Object(H["stopImmediatePropagation"])(e),e.stopPropagation()),i)break;h&&d(e,t,h)}}return i},p=Nl(t,n,r,i,d);return p.mount(),{addContext:a,getActiveContextName:l,getContext:c,setActiveContextName:h,isCtrlPressed:()=>!u&&(p.isPressed("control")||p.isPressed("meta")),releasePressedKeys:()=>p.releasePressedKeys(),destroy:()=>p.unmount()}};var Il=n("1e8c");let Ml=null;const xl=new Map;new Set;function _l(e,t){var n,h=this;let u=arguments.length>2&&void 0!==arguments[2]&&arguments[2],d=this;const p=new l["a"](d);let f,g,m,y,w,b,v=!0;oi(u)&&ii(this),this.rootElement=e,this.rootDocument=e.ownerDocument,this.rootWindow=this.rootDocument.defaultView,this.isDestroyed=!1,this.renderSuspendedCounter=0,this.executionSuspendedCounter=0;const E=null!==(n=null===t||void 0===t?void 0:t.layoutDirection)&&void 0!==n?n:"inherit",C=["rtl","ltr"].includes(E)?E:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",C),this.isRtl=function(){return"rtl"===C},this.isLtr=function(){return!d.isRtl()},this.getDirectionFactor=function(){return d.isLtr()?1:-1},t.language=zo(t.language);const S=new ka(d,t,[Fa,Wa]),T=S.getTableMeta(),O=S.getGlobalMeta(),N=Object(dl["a"])();this.container=this.rootDocument.createElement("div"),this.renderCall=!1,e.insertBefore(this.container,e.firstChild),si(this)&&Object(o["_injectProductInfo"])(t.licenseKey,e),this.guid="ht_"+Object(k["randomString"])(),xl.set(this.guid,this),this.columnIndexMapper=new wo,this.rowIndexMapper=new wo,this.columnIndexMapper.addLocalHook("indexesSequenceChange",e=>{d.runHooks("afterColumnSequenceChange",e)}),this.rowIndexMapper.addLocalHook("indexesSequenceChange",e=>{d.runHooks("afterRowSequenceChange",e)}),g=new Li(d),this.rootElement.id&&"ht_"!==this.rootElement.id.substring(0,3)||(this.rootElement.id=this.guid);const A=e=>{const{row:t,col:n}=e;return d._createCellCoords(t>=0?d.rowIndexMapper.getRenderableFromVisualIndex(t):t,n>=0?d.columnIndexMapper.getRenderableFromVisualIndex(n):n)},H=e=>{const{row:t,col:n}=e;return d._createCellCoords(t>=0?d.rowIndexMapper.getVisualFromRenderableIndex(t):t,n>=0?d.columnIndexMapper.getVisualFromRenderableIndex(n):n)},D=(e,t)=>{const n=t>e?1:-1,r=Math.min(e,t),i=Math.max(e,t),o=d.rowIndexMapper.getNearestNotHiddenIndex(e,n);return null===o||1===n&&o>i||-1===n&&o<r?null:o>=0?d.rowIndexMapper.getRenderableFromVisualIndex(o):o},F=(e,t)=>{const n=t>e?1:-1,r=Math.min(e,t),i=Math.max(e,t),o=d.columnIndexMapper.getNearestNotHiddenIndex(e,n);return null===o||1===n&&o>i||-1===n&&o<r?null:o>=0?d.columnIndexMapper.getRenderableFromVisualIndex(o):o};let U=new ia(T,{rowIndexMapper:d.rowIndexMapper,columnIndexMapper:d.columnIndexMapper,countCols:()=>d.countCols(),countRows:()=>d.countRows(),propToCol:e=>f.propToCol(e),isEditorOpened:()=>!!d.getActiveEditor()&&d.getActiveEditor().isOpened(),countRenderableColumns:()=>this.view.countRenderableColumns(),countRenderableRows:()=>this.view.countRenderableRows(),countRowHeaders:()=>this.countRowHeaders(),countColHeaders:()=>this.countColHeaders(),countRenderableRowsInRange:function(){return h.view.countRenderableRowsInRange(...arguments)},countRenderableColumnsInRange:function(){return h.view.countRenderableColumnsInRange(...arguments)},getShortcutManager:()=>d.getShortcutManager(),createCellCoords:(e,t)=>d._createCellCoords(e,t),createCellRange:(e,t,n)=>d._createCellRange(e,t,n),visualToRenderableCoords:A,renderableToVisualCoords:H,findFirstNonHiddenRenderableRow:D,findFirstNonHiddenRenderableColumn:F,isDisabledCellSelection:(e,t)=>e<0||t<0?d.getSettings().disableVisualSelection:d.getCellMeta(e,t).disableVisualSelection});this.selection=U;const V=e=>{let{hiddenIndexesChanged:t}=e;t&&this.selection.refresh()};function B(e){const t=Eo(e);Vo(t)?(d.runHooks("beforeLanguageChange",t),O.language=t,d.runHooks("afterLanguageChange",t)):Co(e)}function W(e,t){const n="className"===e?d.rootElement:d.table;if(v)Object(r["addClass"])(n,t);else{let i=[],o=[];O[e]&&(i=Array.isArray(O[e])?O[e]:Object(I["stringToArray"])(O[e])),t&&(o=Array.isArray(t)?t:Object(I["stringToArray"])(t));const s=Object(I["getDifferenceOfArrays"])(i,o),a=Object(I["getDifferenceOfArrays"])(o,i);s.length&&Object(r["removeClass"])(n,s),a.length&&Object(r["addClass"])(n,a)}O[e]=t}function G(){let e=!1;return{validatorsInQueue:0,valid:!0,addValidatorToQueue(){this.validatorsInQueue+=1,e=!1},removeValidatorFormQueue(){this.validatorsInQueue=this.validatorsInQueue-1<0?0:this.validatorsInQueue-1,this.checkIfQueueIsEmpty()},onQueueEmpty(){},checkIfQueueIsEmpty(){0===this.validatorsInQueue&&!1===e&&(e=!0,this.onQueueEmpty(this.valid))}}}function z(e){const t=e.replace(",",".");return!1===isNaN(parseFloat(t))?parseFloat(t):e}function Y(e,t,n){if(!e.length)return;const i=d.getActiveEditor(),o=new G;let s=!0;o.onQueueEmpty=e=>{i&&s&&i.cancelChanges(),n(e)};for(let a=e.length-1;a>=0;a--){const[n,i,,l]=e[a],c=f.propToCol(i),h=d.getCellMeta(n,c);"numeric"===h.type&&"string"===typeof l&&Object(j["isNumericLike"])(l)&&(e[a][3]=z(l)),d.getCellValidator(h)&&(o.addValidatorToQueue(),d.validateCell(e[a][3],h,function(t,n){return function(i){if("boolean"!==typeof i)throw new Error("Validation error: result is not boolean");if(!1===i&&!1===n.allowInvalid){s=!1,e.splice(t,1),n.valid=!0;const i=d.getCell(n.visualRow,n.visualCol);null!==i&&Object(r["removeClass"])(i,T.invalidCellClassName)}o.removeValidatorFormQueue()}}(a,h),t))}o.checkIfQueueIsEmpty()}function X(e,t){let n=e.length-1;if(n<0)return;for(;n>=0;n--){let r=!1;if(null!==e[n]){if(null!==e[n][2]&&void 0!==e[n][2]||null!==e[n][3]&&void 0!==e[n][3]){if(T.allowInsertRow)while(e[n][0]>d.countRows()-1){const{delta:e}=f.createRow(void 0,void 0,{source:t});if(0===e){r=!0;break}}if("array"===d.dataType&&(!T.columns||0===T.columns.length)&&T.allowInsertColumn)while(f.propToCol(e[n][1])>d.countCols()-1){const{delta:e}=f.createCol(void 0,void 0,{source:t});if(0===e){r=!0;break}}r||f.set(e[n][0],e[n][1],e[n][3])}}else e.splice(n,1)}d.forceFullRender=!0,m.adjustRowsAndCols(),d.runHooks("beforeChangeRender",e,t),y.lockEditor(),d._refreshBorders(null),y.unlockEditor(),d.view.adjustElementsSize(),d.runHooks("afterChange",e,t||"edit");const r=d.getActiveEditor();r&&Object(o["isDefined"])(r.refreshValue)&&r.refreshValue()}function K(e,t,n){return Array.isArray(e)?e:[[e,t,n]]}function $(e,t){const n=d.getActiveEditor(),r=d.runHooks("beforeChange",e,t||"edit"),i=e.filter(e=>null!==e);return!1===r||0===i.length?(n&&n.cancelChanges(),[]):i}this.columnIndexMapper.addLocalHook("cacheUpdated",V),this.rowIndexMapper.addLocalHook("cacheUpdated",V),this.selection.addLocalHook("afterSetRangeEnd",(e,t)=>{const n=Object(c["createObjectPropListener"])(!1),i=this.selection.getSelectedRange(),{from:o,to:s}=i.current(),a=i.size()-1;this.runHooks("afterSelection",o.row,o.col,s.row,s.col,n,a),this.runHooks("afterSelectionByProp",o.row,d.colToProp(o.col),s.row,d.colToProp(s.col),n,a),t&&(!n.isTouched()||n.isTouched()&&!n.value)&&b.scrollTo(e);const l=U.isSelectedByRowHeader(),h=U.isSelectedByColumnHeader();l&&h?Object(r["addClass"])(this.rootElement,["ht__selection--rows","ht__selection--columns"]):l?(Object(r["removeClass"])(this.rootElement,"ht__selection--columns"),Object(r["addClass"])(this.rootElement,"ht__selection--rows")):h?(Object(r["removeClass"])(this.rootElement,"ht__selection--rows"),Object(r["addClass"])(this.rootElement,"ht__selection--columns")):Object(r["removeClass"])(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this._refreshBorders(null)}),this.selection.addLocalHook("beforeSetFocus",e=>{this.runHooks("beforeSelectionFocusSet",e.row,e.col)}),this.selection.addLocalHook("afterSetFocus",e=>{const t=Object(c["createObjectPropListener"])(!1);this.runHooks("afterSelectionFocusSet",e.row,e.col,t),(!t.isTouched()||t.isTouched()&&!t.value)&&b.scrollTo(e),this._refreshBorders(null)}),this.selection.addLocalHook("afterSelectionFinished",e=>{const t=e.length-1,{from:n,to:r}=e[t];this.runHooks("afterSelectionEnd",n.row,n.col,r.row,r.col,t),this.runHooks("afterSelectionEndByProp",n.row,d.colToProp(n.col),r.row,d.colToProp(r.col),t)}),this.selection.addLocalHook("afterIsMultipleSelection",e=>{const t=this.runHooks("afterIsMultipleSelection",e.value);e.value&&(e.value=t)}),this.selection.addLocalHook("afterDeselect",()=>{y.destroyEditor(),this._refreshBorders(),Object(r["removeClass"])(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this.runHooks("afterDeselect")}),this.selection.addLocalHook("beforeHighlightSet",()=>this.runHooks("beforeSelectionHighlightSet")).addLocalHook("beforeSetRangeStart",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.runHooks("beforeSetRangeStart",...t)})).addLocalHook("beforeSetRangeStartOnly",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.runHooks("beforeSetRangeStartOnly",...t)})).addLocalHook("beforeSetRangeEnd",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.runHooks("beforeSetRangeEnd",...t)})).addLocalHook("beforeSelectColumns",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.runHooks("beforeSelectColumns",...t)})).addLocalHook("afterSelectColumns",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.runHooks("afterSelectColumns",...t)})).addLocalHook("beforeSelectRows",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.runHooks("beforeSelectRows",...t)})).addLocalHook("afterSelectRows",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.runHooks("afterSelectRows",...t)})).addLocalHook("beforeModifyTransformStart",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.runHooks("modifyTransformStart",...t)})).addLocalHook("afterModifyTransformStart",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.runHooks("afterModifyTransformStart",...t)})).addLocalHook("beforeModifyTransformFocus",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.runHooks("modifyTransformFocus",...t)})).addLocalHook("afterModifyTransformFocus",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.runHooks("afterModifyTransformFocus",...t)})).addLocalHook("beforeModifyTransformEnd",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.runHooks("modifyTransformEnd",...t)})).addLocalHook("afterModifyTransformEnd",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.runHooks("afterModifyTransformEnd",...t)})).addLocalHook("beforeRowWrap",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.runHooks("beforeRowWrap",...t)})).addLocalHook("beforeColumnWrap",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.runHooks("beforeColumnWrap",...t)})).addLocalHook("insertRowRequire",e=>this.alter("insert_row_above",e,1,"auto")).addLocalHook("insertColRequire",e=>this.alter("insert_col_start",e,1,"auto")),m={alter(e,t){var n,r;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;const l=e=>{if(0===e.length)return[];const t=[...e];t.sort((e,t)=>{let[n]=e,[r]=t;return n===r?0:n>r?1:-1});const n=Object(I["arrayReduce"])(t,(e,t)=>{let[n,r]=t;const i=e[e.length-1],[o,s]=i,a=o+s;if(n<=a){const e=Math.max(r-(a-n),0);i[1]+=e}else e.push([n,r]);return e},[t[0]]);return n};switch(e){case"insert_row_below":case"insert_row_above":const a=d.countSourceRows();if(T.maxRows===a)return;const c="insert_row_below"===e?"below":"above";t=null!==(n=t)&&void 0!==n?n:"below"===c?a:0;const{delta:h,startPhysicalIndex:u}=f.createRow(t,i,{source:s,mode:c});if(h){const e=U.selectedRange.current(),t=null===e||void 0===e?void 0:e.from,n=null===t||void 0===t?void 0:t.row,r=d.toVisualRow(u);if(U.isSelectedByCorner())U.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(Object(o["isDefined"])(n)&&n>=r){const{row:r,col:i}=e.to;let o=t.col;U.isSelectedByRowHeader()&&(o=-1),U.getSelectedRange().pop(),U.setRangeStartOnly(d._createCellCoords(n+h,o),!0),U.setRangeEnd(d._createCellCoords(r+h,i))}else d._refreshBorders()}break;case"insert_col_start":case"insert_col_end":const p="insert_col_end"===e?"end":"start";t=null!==(r=t)&&void 0!==r?r:"end"===p?d.countSourceCols():0;const{delta:g,startPhysicalIndex:y}=f.createCol(t,i,{source:s,mode:p});if(g){if(Array.isArray(T.colHeaders)){const e=[d.toVisualColumn(y),0];e.length+=g,Array.prototype.splice.apply(T.colHeaders,e)}const e=U.selectedRange.current(),t=null===e||void 0===e?void 0:e.from,n=null===t||void 0===t?void 0:t.col,r=d.toVisualColumn(y);if(U.isSelectedByCorner())U.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(Object(o["isDefined"])(n)&&n>=r){const{row:r,col:i}=e.to;let o=t.row;U.isSelectedByColumnHeader()&&(o=-1),U.getSelectedRange().pop(),U.setRangeStartOnly(d._createCellCoords(o,n+g),!0),U.setRangeEnd(d._createCellCoords(r,i+g))}else d._refreshBorders()}break;case"remove_row":const w=e=>{let t=0;Object(I["arrayEach"])(e,e=>{let[n,r]=e;const i=Object(o["isEmpty"])(n)?d.countRows()-1:Math.max(n-t,0);Number.isInteger(n)&&(n=Math.max(n-t,0));const a=f.removeRow(n,r,s);if(!a)return;const l=d.countRows(),c=T.fixedRowsTop;c>=i+1&&(T.fixedRowsTop-=Math.min(r,c-i));const h=T.fixedRowsBottom;h&&i>=l-h&&(T.fixedRowsBottom-=Math.min(r,h)),t+=r})};Array.isArray(t)?w(l(t)):w([[t,i]]),m.adjustRowsAndCols(),d._refreshBorders();break;case"remove_col":const b=e=>{let t=0;Object(I["arrayEach"])(e,e=>{let[n,r]=e;const i=Object(o["isEmpty"])(n)?d.countCols()-1:Math.max(n-t,0);let a=d.toPhysicalColumn(i);Number.isInteger(n)&&(n=Math.max(n-t,0));const l=f.removeCol(n,r,s);if(!l)return;const c=T.fixedColumnsStart;c>=i+1&&(T.fixedColumnsStart-=Math.min(r,c-i)),Array.isArray(T.colHeaders)&&("undefined"===typeof a&&(a=-1),T.colHeaders.splice(a,r)),t+=r})};Array.isArray(t)?b(l(t)):b([[t,i]]),m.adjustRowsAndCols(),d._refreshBorders();break;default:throw new Error(`There is no such action "${e}"`)}a||m.adjustRowsAndCols()},adjustRowsAndCols(){const e=T.minRows,t=T.minSpareRows,n=T.minCols,r=T.minSpareCols;if(0===d.countRows()&&0===d.countCols()&&U.deselect(),e){const t=d.countRows();t<e&&f.createRow(t,e-t,{source:"auto"})}if(t){const e=d.countEmptyRows(!0);if(e<t){const n=t-e,r=Math.min(n,T.maxRows-d.countSourceRows());f.createRow(d.countRows(),r,{source:"auto"})}}{let e;(n||r)&&(e=d.countEmptyCols(!0));let t=d.countCols();if(n&&!T.columns&&t<n){const r=n-t;e+=r,f.createCol(t,r,{source:"auto"})}if(r&&!T.columns&&"array"===d.dataType&&e<r){t=d.countCols();const n=r-e,i=Math.min(n,T.maxCols-t);f.createCol(t,i,{source:"auto"})}}if(U.isSelected()){const e=d.countRows(),t=d.countCols();Object(I["arrayEach"])(U.selectedRange,n=>{let r=!1,i=n.from.row,o=n.from.col,s=n.to.row,a=n.to.col;i>e-1?(i=e-1,r=!0,s>i&&(s=i)):s>e-1&&(s=e-1,r=!0,i>s&&(i=s)),o>t-1?(o=t-1,r=!0,a>o&&(a=o)):a>t-1&&(a=t-1,r=!0,o>a&&(o=a)),r&&(o<0?d.selectRows(i,s,o):i<0?d.selectColumns(o,a,i):d.selectCell(i,o,s,a))})}d.view&&d.view.adjustElementsSize()},populateFromArray(e,t,n,r,i){let o,s,a,l;const h=[],u={},p=[],f=e.row,g=e.col;if(s=t.length,0===s)return!1;let m=0,y=0;switch(Object(c["isObject"])(n)&&(m=n.col-g+1,y=n.row-f+1),i){case"shift_down":const i=Object(I["pivot"])(t),w=i.length,b=Math.max(w,m),v=d.getData().slice(f),E=Object(I["pivot"])(v).slice(g,g+b);for(a=0;a<b;a+=1)if(a<w){for(o=0,s=i[a].length;o<y-s;o+=1)i[a].push(i[a][o%s]);a<E.length?p.push(i[a].concat(E[a])):p.push(i[a].concat(new Array(v.length).fill(null)))}else p.push(i[a%w].concat(E[a]));d.populateFromArray(f,g,Object(I["pivot"])(p));break;case"shift_right":const C=t.length,S=Math.max(C,y),R=d.getData().slice(f).map(e=>e.slice(g));for(o=0;o<S;o+=1)if(o<C){for(a=0,l=t[o].length;a<m-l;a+=1)t[o].push(t[o][a%l]);if(o<R.length)for(let e=0;e<R[o].length;e+=1)t[o].push(R[o][e]);else t[o].push(...new Array(R[0].length).fill(null))}else t.push(t[o%s].slice(0,S).concat(R[o]));d.populateFromArray(f,g,t);break;case"overwrite":default:u.row=e.row,u.col=e.col;let O,N=0,A=0,M=!0;const x=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=t[e%t.length];return null!==n?r[n%r.length]:r},_=t.length,L=n?n.row-e.row+1:0;for(s=n?L:Math.max(_,L),o=0;o<s;o++){if(n&&u.row>n.row&&L>_||!T.allowInsertRow&&u.row>d.countRows()-1||u.row>=T.maxRows)break;const t=o-N,i=x(t).length,p=n?n.col-e.col+1:0;if(l=n?p:Math.max(i,p),u.col=e.col,O=d.getCellMeta(u.row,u.col),"CopyPaste.paste"!==r&&"Autofill.fill"!==r||!O.skipRowOnPaste){for(A=0,a=0;a<l;a++){if(n&&u.col>n.col&&p>i||!T.allowInsertColumn&&u.col>d.countCols()-1||u.col>=T.maxCols)break;if(O=d.getCellMeta(u.row,u.col),("CopyPaste.paste"===r||"Autofill.fill"===r)&&O.skipColumnOnPaste){A+=1,u.col+=1,l+=1;continue}if(O.readOnly&&"UndoRedo.undo"!==r){u.col+=1;continue}const e=a-A;let o=x(t,e),s=d.getDataAtCell(u.row,u.col);if(null!==o&&"object"===typeof o)if(Array.isArray(o)&&null===s&&(s=[]),null===s||"object"!==typeof s)M=!1;else{const e=Object(c["duckSchema"])(Array.isArray(s)?s:s[0]||s),t=Object(c["duckSchema"])(Array.isArray(o)?o:o[0]||o);Object(c["isObjectEqual"])(e,t)||Array.isArray(e)&&Array.isArray(t)?o=Object(c["deepClone"])(o):M=!1}else null!==s&&"object"===typeof s&&(M=!1);M&&h.push([u.row,u.col,o]),M=!0,u.col+=1}u.row+=1}else N+=1,u.row+=1,s+=1}d.setDataAtCell(h,null,null,r||"populateFromArray");break}}},this.init=function(){g.setData(T.data),d.runHooks("beforeInit"),(Object(s["isMobileBrowser"])()||Object(s["isIpadOS"])())&&Object(r["addClass"])(d.rootElement,"mobile"),this.updateSettings(T,!0),this.view=new Ni(this),y=a["b"].getInstance(d,T,U),b=il(d),w=new R(d),si(this)&&ll(d),d.runHooks("init"),this.forceFullRender=!0,this.view.render(),v&&null===d.rootElement.offsetParent&&Object(r["observeVisibilityChangeOnce"])(d.rootElement,()=>{d.view._wt.wtOverlays.updateLastSpreaderSize(),d.render(),d.view.adjustElementsSize()}),"object"===typeof v&&(d.runHooks("afterChange",v[0],v[1]),v=!1),d.runHooks("afterInit")},this._createCellCoords=function(e,t){return d.view._wt.createCellCoords(e,t)},this._createCellRange=function(e,t,n){return d.view._wt.createCellRange(e,t,n)},this.validateCell=function(e,t,n,r){let s=d.getCellValidator(t);function a(e){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!r||!0===t.hidden)return void n(e);const i=t.visualCol,o=t.visualRow,s=d.getCell(o,i,!0);if(s&&"TH"!==s.nodeName){const e=d.rowIndexMapper.getRenderableFromVisualIndex(o),t=d.columnIndexMapper.getRenderableFromVisualIndex(i);d.view._wt.getSetting("cellRenderer",e,t,s)}n(e)}Object(o["isRegExp"])(s)&&(s=function(e){return function(t,n){n(e.test(t))}}(s)),Object(i["isFunction"])(s)?(e=d.runHooks("beforeValidate",e,t.visualRow,t.prop,r),d._registerImmediate(()=>{s.call(t,e,n=>{d&&(n=d.runHooks("afterValidate",n,e,t.visualRow,t.prop,r),t.valid=n,a(n),d.runHooks("postAfterValidate",n,e,t.visualRow,t.prop,r))})})):d._registerImmediate(()=>{t.valid=!0,a(t.valid,!1)})},this.setDataAtCell=function(e,t,n,r){const i=K(e,t,n),o=[];let s,a,l,c=r;for(s=0,a=i.length;s<a;s++){if("object"!==typeof i[s])throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if("number"!==typeof i[s][1])throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");l=i[s][1]>=this.countCols()?i[s][1]:f.colToProp(i[s][1]),o.push([i[s][0],l,g.getAtCell(this.toPhysicalRow(i[s][0]),i[s][1]),i[s][2]])}c||"object"!==typeof e||(c=t);const h=$(o,r);d.runHooks("afterSetDataAtCell",h,c),Y(h,c,()=>{X(h,c)})},this.setDataAtRowProp=function(e,t,n,r){const i=K(e,t,n),o=[];let s,a,l=r;for(s=0,a=i.length;s<a;s++)o.push([i[s][0],i[s][1],g.getAtCell(this.toPhysicalRow(i[s][0]),i[s][1]),i[s][2]]);l||"object"!==typeof e||(l=t);const c=$(o,r);d.runHooks("afterSetDataAtRowProp",c,l),Y(c,l,()=>{X(c,l)})},this.listen=function(){d&&!d.isListening()&&(xl.forEach(e=>{d!==e&&e.unlisten()}),Ml=d.guid,d.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(Ml=null,d.runHooks("afterUnlisten"))},this.isListening=function(){return Ml===d.guid},this.destroyEditor=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];d._refreshBorders(e,t)},this.populateFromArray=function(e,t,n,r,i,o,s){if("object"!==typeof n||"object"!==typeof n[0])throw new Error("populateFromArray parameter `input` must be an array of arrays");const a="number"===typeof r?d._createCellCoords(r,i):null;return m.populateFromArray(d._createCellCoords(e,t),n,a,o,s)},this.spliceCol=function(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];return f.spliceCol(e,t,n,...i)},this.spliceRow=function(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];return f.spliceRow(e,t,n,...i)},this.getSelected=function(){if(U.isSelected())return Object(I["arrayMap"])(U.getSelectedRange(),e=>{let{from:t,to:n}=e;return[t.row,t.col,n.row,n.col]})},this.getSelectedLast=function(){const e=this.getSelected();let t;return e&&e.length>0&&(t=e[e.length-1]),t},this.getSelectedRange=function(){if(U.isSelected())return Array.from(U.getSelectedRange())},this.getSelectedRangeLast=function(){const e=this.getSelectedRange();let t;return e&&e.length>0&&(t=e[e.length-1]),t},this.emptySelectedCells=function(e){if(!U.isSelected()||0===this.countRows()||0===this.countCols())return;const t=[];Object(I["arrayEach"])(U.getSelectedRange(),e=>{if(e.isSingleHeader())return;const n=e.getTopStartCorner(),r=e.getBottomEndCorner();Object(j["rangeEach"])(n.row,r.row,e=>{Object(j["rangeEach"])(n.col,r.col,n=>{this.getCellMeta(e,n).readOnly||t.push([e,n,null])})})}),t.length>0&&this.setDataAtCell(t,e)},this.isRenderSuspended=function(){return this.renderSuspendedCounter>0},this.suspendRender=function(){this.renderSuspendedCounter+=1},this.resumeRender=function(){const e=this.renderSuspendedCounter-1;this.renderSuspendedCounter=Math.max(e,0),this.isRenderSuspended()||e!==this.renderSuspendedCounter||(this.renderCall?this.render():this._refreshBorders(null))},this.render=function(){this.view&&(this.renderCall=!0,this.forceFullRender=!0,this.isRenderSuspended()||(y.lockEditor(),this._refreshBorders(null),y.unlockEditor()))},this.batchRender=function(e){this.suspendRender();const t=e();return this.resumeRender(),t},this.isExecutionSuspended=function(){return this.executionSuspendedCounter>0},this.suspendExecution=function(){this.executionSuspendedCounter+=1,this.columnIndexMapper.suspendOperations(),this.rowIndexMapper.suspendOperations()},this.resumeExecution=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(t,0),(!this.isExecutionSuspended()&&t===this.executionSuspendedCounter||e)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.suspendExecution();const n=e();return this.resumeExecution(t),n},this.batch=function(e){this.suspendRender(),this.suspendExecution();const t=e();return this.resumeExecution(),this.resumeRender(),t},this.refreshDimensions=function(){if(!d.view)return;const{width:e,height:t}=d.view.getLastSize(),{width:n,height:r}=d.rootElement.getBoundingClientRect(),i=n!==e||r!==t,o=!1===d.runHooks("beforeRefreshDimensions",{width:e,height:t},{width:n,height:r},i);o||((i||d.view._wt.wtOverlays.scrollableElement===d.rootWindow)&&(d.view.setLastSize(n,r),d.render()),d.runHooks("afterRefreshDimensions",{width:e,height:t},{width:n,height:r},i))},this.updateData=function(e,t){qa(e,e=>{f=e},e=>{f=e,d.columnIndexMapper.fitToLength(this.getInitialColumnCount()),d.rowIndexMapper.fitToLength(this.countSourceRows()),m.adjustRowsAndCols()},{hotInstance:d,dataMap:f,dataSource:g,internalSource:"updateData",source:t,metaManager:S,firstRun:v})},this.loadData=function(e,t){qa(e,e=>{f=e},()=>{S.clearCellsCache(),d.initIndexMappers(),m.adjustRowsAndCols(),v&&(v=[null,"loadData"])},{hotInstance:d,dataMap:f,dataSource:g,internalSource:"loadData",source:t,metaManager:S,firstRun:v})},this.getInitialColumnCount=function(){const e=T.columns;let t=0;if(Array.isArray(e))t=e.length;else if(Object(i["isFunction"])(e))if("array"===d.dataType){const n=this.countSourceCols();for(let r=0;r<n;r+=1)e(r)&&(t+=1)}else"object"!==d.dataType&&"function"!==d.dataType||(t=f.colToPropCache.length);else if(Object(o["isDefined"])(T.dataSchema)){const e=f.getSchema();t=Array.isArray(e)?e.length:Object(c["deepObjectSize"])(e)}else t=this.countSourceCols();return t},this.initIndexMappers=function(){this.columnIndexMapper.initToLength(this.getInitialColumnCount()),this.rowIndexMapper.initToLength(this.countSourceRows())},this.getData=function(e,t,n,r){return Object(o["isUndefined"])(e)?f.getAll():f.getRange(d._createCellCoords(e,t),d._createCellCoords(n,r),f.DESTINATION_RENDERER)},this.getCopyableText=function(e,t,n,r){return f.getCopyableText(d._createCellCoords(e,t),d._createCellCoords(n,r))},this.getCopyableData=function(e,t){return f.getCopyable(e,f.colToProp(t))},this.getSchema=function(){return f.getSchema()},this.updateSettings=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=(v?d.loadData:d.updateData).bind(this);let r,s,a=!1;if(Object(o["isDefined"])(e.rows))throw new Error('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?');if(Object(o["isDefined"])(e.cols))throw new Error('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?');if(Object(o["isDefined"])(e.ganttChart))throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');for(r in e)"data"===r||("language"===r?B(e.language):"className"===r?W("className",e.className):"tableClassName"===r&&d.table?(W("tableClassName",e.tableClassName),d.view._wt.wtOverlays.syncOverlayTableClassNames()):bo["a"].getSingleton().isRegistered(r)||bo["a"].getSingleton().isDeprecated(r)?(Object(i["isFunction"])(e[r])||Array.isArray(e[r]))&&(e[r].initialHook=!0,d.addHook(r,e[r])):!t&&Object(c["hasOwnProperty"])(e,r)&&(O[r]=e[r]));void 0===e.data&&void 0===T.data?n(null,"updateSettings"):void 0!==e.data?n(e.data,"updateSettings"):void 0!==e.columns&&(f.createMap(),d.initIndexMappers());const l=d.countCols(),h=T.columns;if(h&&Object(i["isFunction"])(h)&&(a=!0),void 0===e.cell&&void 0===e.cells&&void 0===e.columns||S.clearCache(),l>0)for(r=0,s=0;r<l;r++){if(h){const e=a?h(r):h[s];e&&S.updateColumnMeta(s,e)}s+=1}Object(o["isDefined"])(e.cell)&&Object(c["objectEach"])(e.cell,e=>{d.setCellMetaObject(e.row,e.col,e)}),d.runHooks("afterCellMetaReset");let u=d.rootElement.style.height;""!==u&&(u=parseInt(d.rootElement.style.height,10));let p=e.height;if(Object(i["isFunction"])(p)&&(p=p()),t){const e=d.rootElement.getAttribute("style");e&&d.rootElement.setAttribute("data-initialstyle",d.rootElement.getAttribute("style"))}if(null===p){const e=d.rootElement.getAttribute("data-initialstyle");e&&(e.indexOf("height")>-1||e.indexOf("overflow")>-1)?d.rootElement.setAttribute("style",e):(d.rootElement.style.height="",d.rootElement.style.overflow="")}else void 0!==p&&(d.rootElement.style.height=isNaN(p)?""+p:p+"px",d.rootElement.style.overflow="hidden");if("undefined"!==typeof e.width){let t=e.width;Object(i["isFunction"])(t)&&(t=t()),d.rootElement.style.width=isNaN(t)?""+t:t+"px"}t||(d.view&&(d.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),d.view._wt.exportSettingsAsClassNames()),d.runHooks("afterUpdateSettings",e)),m.adjustRowsAndCols(),d.view&&!v&&(d.forceFullRender=!0,y.lockEditor(),d._refreshBorders(null),d.view._wt.wtOverlays.adjustElementsSize(),y.unlockEditor()),t||!d.view||""!==u&&""!==p&&void 0!==p||u===p||d.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const e=d.getSelectedLast();if(T.getValue){if(Object(i["isFunction"])(T.getValue))return T.getValue.call(d);if(e)return d.getData()[e[0][0]][T.getValue]}else if(e)return d.getDataAtCell(e[0],e[1])},this.getSettings=function(){return T},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(e,t,n,r,i){m.alter(e,t,n,r,i)},this.getCell=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t,i=e;if(t>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(t)))return null;r=this.columnIndexMapper.getRenderableFromVisualIndex(t)}if(e>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(e)))return null;i=this.rowIndexMapper.getRenderableFromVisualIndex(e)}return null===i||null===r?null:d.view.getCellAtCoords(d._createCellCoords(i,r),n)},this.getCoords=function(e){const t=this.view._wt.wtTable.getCoords(e);if(null===t)return null;const{row:n,col:r}=t;let i=n,o=r;return n>=0&&(i=this.rowIndexMapper.getVisualFromRenderableIndex(n)),r>=0&&(o=this.columnIndexMapper.getVisualFromRenderableIndex(r)),d._createCellCoords(i,o)},this.colToProp=function(e){return f.colToProp(e)},this.propToCol=function(e){return f.propToCol(e)},this.toVisualRow=e=>this.rowIndexMapper.getVisualFromPhysicalIndex(e),this.toVisualColumn=e=>this.columnIndexMapper.getVisualFromPhysicalIndex(e),this.toPhysicalRow=e=>this.rowIndexMapper.getPhysicalFromVisualIndex(e),this.toPhysicalColumn=e=>this.columnIndexMapper.getPhysicalFromVisualIndex(e),this.getDataAtCell=function(e,t){return f.get(e,f.colToProp(t))},this.getDataAtRowProp=function(e,t){return f.get(e,t)},this.getDataAtCol=function(e){const t=[],n=f.getRange(d._createCellCoords(0,e),d._createCellCoords(T.data.length-1,e),f.DESTINATION_RENDERER);for(let r=0;r<n.length;r+=1)for(let e=0;e<n[r].length;e+=1)t.push(n[r][e]);return t},this.getDataAtProp=function(e){const t=[],n=f.getRange(d._createCellCoords(0,f.propToCol(e)),d._createCellCoords(T.data.length-1,f.propToCol(e)),f.DESTINATION_RENDERER);for(let r=0;r<n.length;r+=1)for(let e=0;e<n[r].length;e+=1)t.push(n[r][e]);return t},this.getSourceData=function(e,t,n,r){let i;return i=void 0===e?g.getData():g.getByRange(d._createCellCoords(e,t),d._createCellCoords(n,r)),i},this.getSourceDataArray=function(e,t,n,r){let i;return i=void 0===e?g.getData(!0):g.getByRange(d._createCellCoords(e,t),d._createCellCoords(n,r),!0),i},this.getSourceDataAtCol=function(e){return g.getAtColumn(e)},this.setSourceDataAtCell=function(e,t,n,r){const i=K(e,t,n),s=this.hasHook("afterSetSourceDataAtCell"),a=[];s&&Object(I["arrayEach"])(i,e=>{let[t,n,r]=e;a.push([t,n,g.getAtCell(t,n),r])}),Object(I["arrayEach"])(i,e=>{let[t,n,r]=e;g.setAtCell(t,n,r)}),s&&this.runHooks("afterSetSourceDataAtCell",a,r),this.render();const l=d.getActiveEditor();l&&Object(o["isDefined"])(l.refreshValue)&&l.refreshValue()},this.getSourceDataAtRow=function(e){return g.getAtRow(e)},this.getSourceDataAtCell=function(e,t){return g.getAtCell(e,t)},this.getDataAtRow=function(e){const t=f.getRange(d._createCellCoords(e,0),d._createCellCoords(e,this.countCols()-1),f.DESTINATION_RENDERER);return t[0]||[]},this.getDataType=function(e,t,n,r){const i=void 0===e?[0,0,this.countRows(),this.countCols()]:[e,t,n,r],[o,s]=i;let[,,a,l]=i,c=null,h=null;void 0===a&&(a=o),void 0===l&&(l=s);let u="mixed";return Object(j["rangeEach"])(Math.max(Math.min(o,a),0),Math.max(o,a),e=>{let t=!0;return Object(j["rangeEach"])(Math.max(Math.min(s,l),0),Math.max(s,l),n=>{const r=this.getCellMeta(e,n);return h=r.type,c?t=c===h:c=h,t}),u=t?h:"mixed",t}),u},this.removeCellMeta=function(e,t,n){const[r,i]=[this.toPhysicalRow(e),this.toPhysicalColumn(t)];let o=S.getCellMetaKeyValue(r,i,n);const s=d.runHooks("beforeRemoveCellMeta",e,t,n,o);!1!==s&&(S.removeCellMeta(r,i,n),d.runHooks("afterRemoveCellMeta",e,t,n,o)),o=null},this.spliceCellsMeta=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];if(r.length>0&&!Array.isArray(r[0]))throw new Error("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.");t>0&&S.removeRow(this.toPhysicalRow(e),t),r.length>0&&Object(I["arrayEach"])(r.reverse(),t=>{S.createRow(this.toPhysicalRow(e)),Object(I["arrayEach"])(t,(t,n)=>this.setCellMetaObject(e,n,t))}),d.render()},this.setCellMetaObject=function(e,t,n){"object"===typeof n&&Object(c["objectEach"])(n,(n,r)=>{this.setCellMeta(e,t,r,n)})},this.setCellMeta=function(e,t,n,r){const i=d.runHooks("beforeSetCellMeta",e,t,n,r);if(!1===i)return;let o=e,s=t;e<this.countRows()&&(o=this.toPhysicalRow(e)),t<this.countCols()&&(s=this.toPhysicalColumn(t)),S.setCellMeta(o,s,n,r),d.runHooks("afterSetCellMeta",e,t,n,r)},this.getCellsMeta=function(){return S.getCellsMeta()},this.getCellMeta=function(e,t){let n=this.toPhysicalRow(e),r=this.toPhysicalColumn(t);return null===n&&(n=e),null===r&&(r=t),S.getCellMeta(n,r,{visualRow:e,visualColumn:t})},this.getCellMetaAtRow=function(e){return S.getCellsMetaAtRow(e)},this.isColumnModificationAllowed=function(){return!("object"===d.dataType||T.columns)},this.getCellRenderer=function(e,t){const n="number"===typeof e?d.getCellMeta(e,t).renderer:e.renderer;return"string"===typeof n?Object(_["b"])(n):Object(o["isUndefined"])(n)?Object(_["b"])("text"):n},this.getCellEditor=function(e,t){const n="number"===typeof e?d.getCellMeta(e,t).editor:e.editor;return"string"===typeof n?Object(L["a"])(n):Object(o["isUndefined"])(n)?Object(L["a"])("text"):n},this.getCellValidator=function(e,t){const n="number"===typeof e?d.getCellMeta(e,t).validator:e.validator;return"string"===typeof n?Object(P["b"])(n):n},this.validateCells=function(e){this._validateCells(e)},this.validateRows=function(e,t){if(!Array.isArray(e))throw new Error("validateRows parameter `rows` must be an array");this._validateCells(t,e)},this.validateColumns=function(e,t){if(!Array.isArray(e))throw new Error("validateColumns parameter `columns` must be an array");this._validateCells(t,void 0,e)},this._validateCells=function(e,t,n){const r=new G;e&&(r.onQueueEmpty=e);let i=d.countRows()-1;while(i>=0){if(void 0!==t&&-1===t.indexOf(i)){i-=1;continue}let e=d.countCols()-1;while(e>=0)void 0===n||-1!==n.indexOf(e)?(r.addValidatorToQueue(),d.validateCell(d.getDataAtCell(i,e),d.getCellMeta(i,e),e=>{if("boolean"!==typeof e)throw new Error("Validation error: result is not boolean");!1===e&&(r.valid=!1),r.removeValidatorFormQueue()},"validateCells"),e-=1):e-=1;i-=1}r.checkIfQueueIsEmpty()},this.getRowHeader=function(e){let t=T.rowHeaders,n=e;return void 0!==n&&(n=d.runHooks("modifyRowHeader",n)),void 0===n?(t=[],Object(j["rangeEach"])(d.countRows()-1,e=>{t.push(d.getRowHeader(e))})):Array.isArray(t)&&void 0!==t[n]?t=t[n]:Object(i["isFunction"])(t)?t=t(n):t&&"string"!==typeof t&&"number"!==typeof t&&(t=n+1),t},this.hasRowHeaders=function(){return!!T.rowHeaders},this.hasColHeaders=function(){if(void 0!==T.colHeaders&&null!==T.colHeaders)return!!T.colHeaders;for(let e=0,t=d.countCols();e<t;e++)if(d.getColHeader(e))return!0;return!1},this.getColHeader=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;const n=d.runHooks("modifyColHeader",e);if(void 0===n){const e=[],t=d.countCols();for(let n=0;n<t;n++)e.push(d.getColHeader(n));return e}let r=T.colHeaders;const o=function(e){const t=[],n=d.countCols();let r=0;for(;r<n;r++)Object(i["isFunction"])(T.columns)&&T.columns(r)&&t.push(r);return t[e]},s=d.toPhysicalColumn(n),a=o(s);return!1===T.colHeaders?r=null:T.columns&&Object(i["isFunction"])(T.columns)&&T.columns(a)&&T.columns(a).title?r=T.columns(a).title:T.columns&&T.columns[s]&&T.columns[s].title?r=T.columns[s].title:Array.isArray(T.colHeaders)&&void 0!==T.colHeaders[s]?r=T.colHeaders[s]:Object(i["isFunction"])(T.colHeaders)?r=T.colHeaders(s):T.colHeaders&&"string"!==typeof T.colHeaders&&"number"!==typeof T.colHeaders&&(r=Object(Ai["spreadsheetColumnLabel"])(n)),r=d.runHooks("modifyColumnHeaderValue",r,e,t),r},this._getColWidthFromSettings=function(e){let t;if(e>=0){const n=d.getCellMeta(0,e);t=n.width}if(void 0!==t&&t!==T.width||(t=T.colWidths),void 0!==t&&null!==t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e);break;default:break}"string"===typeof t&&(t=parseInt(t,10))}return t},this.getColWidth=function(e){let t=d._getColWidthFromSettings(e);return t=d.runHooks("modifyColWidth",t,e),void 0===t&&(t=br["a"].DEFAULT_WIDTH),t},this._getRowHeightFromSettings=function(e){let t=T.rowHeights;if(void 0!==t&&null!==t){switch(typeof t){case"object":t=t[e];break;case"function":t=t(e);break;default:break}"string"===typeof t&&(t=parseInt(t,10))}return t},this.getRowHeight=function(e){let t=d._getRowHeightFromSettings(e);return t=d.runHooks("modifyRowHeight",t,e),t},this.countSourceRows=function(){return g.countRows()},this.countSourceCols=function(){return g.countFirstRowKeys()},this.countRows=function(){return f.getLength()},this.countCols=function(){const e=T.maxCols,t=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(e,t)},this.countRenderedRows=function(){return d.view._wt.drawn?d.view._wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return d.view._wt.drawn?d.view._wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return d.view._wt.drawn?d.view._wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return d.view._wt.drawn?d.view._wt.wtTable.getVisibleColumnsCount():-1},this.countRowHeaders=function(){return this.view.getRowHeadersCount()},this.countColHeaders=function(){return this.view.getColumnHeadersCount()},this.countEmptyRows=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=0;return Object(j["rangeEachReverse"])(d.countRows()-1,n=>{if(d.isEmptyRow(n))t+=1;else if(!0===e)return!1}),t},this.countEmptyCols=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=0;return Object(j["rangeEachReverse"])(d.countCols()-1,n=>{if(d.isEmptyCol(n))t+=1;else if(!0===e)return!1}),t},this.isEmptyRow=function(e){return T.isEmptyRow.call(d,e)},this.isEmptyCol=function(e){return T.isEmptyCol.call(d,e)},this.selectCell=function(e,t,n,r){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];return!Object(o["isUndefined"])(e)&&!Object(o["isUndefined"])(t)&&this.selectCells([[e,t,n,r]],i,s)},this.selectCells=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[[]],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];!1===t&&b.suspend();const r=U.selectCells(e);return r&&n&&d.listen(),b.resume(),r},this.selectColumns=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2?arguments[2]:void 0;return U.selectColumns(e,t,n)},this.selectRows=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2?arguments[2]:void 0;return U.selectRows(e,t,n)},this.deselectCell=function(){U.deselect()},this.selectAll=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2?arguments[2]:void 0;b.skipNextScrollCycle(),U.selectAll(e,t,n)};const q=(e,t)=>e.getNearestNotHiddenIndex(t,1,!0);function Q(e){return()=>{throw new Error(`The "${e}" method cannot be called because this Handsontable instance has been destroyed`)}}this.scrollViewportTo=function(e){var t,n;"number"===typeof e&&(e={row:arguments[0],col:arguments[1],verticalSnap:arguments[2]?"bottom":"top",horizontalSnap:arguments[3]?"end":"start",considerHiddenIndexes:null===(n=arguments[4])||void 0===n||n});const{row:r,col:i,verticalSnap:o,horizontalSnap:s,considerHiddenIndexes:a}=null!==(t=e)&&void 0!==t?t:{};let l,c,h,u;void 0!==o&&(l="top"===o,c=!l),void 0!==s&&(h="start"===s,u=!h);let p=r,f=i;if(void 0===a||a){const e=Number.isInteger(r)&&r>=0,t=Number.isInteger(i)&&i>=0,n=e?q(this.rowIndexMapper,r):void 0,o=t?q(this.columnIndexMapper,i):void 0;if(null===n||null===o)return!1;p=e?d.rowIndexMapper.getRenderableFromVisualIndex(n):r,f=t?d.columnIndexMapper.getRenderableFromVisualIndex(o):i}const g=Number.isInteger(p),m=Number.isInteger(f);return g&&p>=0&&m&&f>=0?d.view.scrollViewport(d._createCellCoords(p,f),l,u,c,h):g&&p>=0&&(m&&f<0||!m)?d.view.scrollViewportVertically(p,l,c):!!(m&&f>=0&&(g&&p<0||!g))&&d.view.scrollViewportHorizontally(f,u,h)},this.scrollToFocusedCell=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{};if(!this.selection.isSelected())return;this.addHookOnce("afterScroll",e);const{highlight:t}=this.getSelectedRangeLast(),n=this.scrollViewportTo(t.toObject());n?this.view.render():(this.removeHook("afterScroll",e),this._registerImmediate(()=>e()))},this.destroy=function(){if(d._clearTimeouts(),d._clearImmediates(),d.view&&d.view.destroy(),g&&g.destroy(),g=null,this.getShortcutManager().destroy(),S.clearCache(),xl.delete(this.guid),si(d)){const e=this.rootDocument.querySelector(".hot-display-license-info");e&&e.parentNode.removeChild(e)}Object(r["empty"])(d.rootElement),p.destroy(),y&&y.destroy(),d.batchExecution(()=>{d.rowIndexMapper.unregisterAll(),d.columnIndexMapper.unregisterAll(),N.getItems().forEach(e=>{let[,t]=e;t.destroy()}),N.clear(),d.runHooks("afterDestroy")},!0),bo["a"].getSingleton().destroy(d),Object(c["objectEach"])(d,(e,t,n)=>{Object(i["isFunction"])(e)?n[t]=Q(t):"guid"!==t&&(n[t]=null)}),d.isDestroyed=!0,f&&f.destroy(),f=null,m=null,U=null,y=null,d=null},this.getActiveEditor=function(){return y.getActiveEditor()},this.getPlugin=function(e){const t=Object(k["toUpperCaseFirst"])(e);return"UndoRedo"===t?this.undoRedo:N.getItem(t)},this.getPluginName=function(e){return e===this.undoRedo?this.undoRedo.constructor.PLUGIN_KEY:N.getId(e)},this.getInstance=function(){return d},this.addHook=function(e,t){bo["a"].getSingleton().add(e,t,d)},this.hasHook=function(e){return bo["a"].getSingleton().has(e,d)||bo["a"].getSingleton().has(e)},this.addHookOnce=function(e,t){bo["a"].getSingleton().once(e,t,d)},this.removeHook=function(e,t){bo["a"].getSingleton().remove(e,t,d)},this.runHooks=function(e,t,n,r,i,o,s){return bo["a"].getSingleton().run(d,e,t,n,r,i,o,s)},this.getTranslatedPhrase=function(e,t){return Wo(T.language,e,t)},this.toHTML=()=>Object(M["instanceToHTML"])(this),this.toTableElement=()=>{const e=this.rootDocument.createElement("div");return e.insertAdjacentHTML("afterbegin",Object(M["instanceToHTML"])(this)),e.firstElementChild},this.timeouts=[],this._registerTimeout=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e;"function"===typeof n&&(n=setTimeout(n,t)),this.timeouts.push(n)},this._clearTimeouts=function(){Object(I["arrayEach"])(this.timeouts,e=>{clearTimeout(e)})},this.immediates=[],this._registerImmediate=function(e){this.immediates.push(setImmediate(e))},this._clearImmediates=function(){Object(I["arrayEach"])(this.immediates,e=>{clearImmediate(e)})},this._refreshBorders=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];y.destroyEditor(e),d.view.render(),t&&U.isSelected()&&y.prepareEditor()},this._getEditorManager=function(){return y},this.isRtl=function(){return"rtl"===d.rootWindow.getComputedStyle(d.rootElement).direction},this.isLtr=function(){return!d.isRtl()},this.getDirectionFactor=function(){return d.isLtr()?1:-1};const Z=Al({handleEvent(){return d.isListening()},beforeKeyDown:e=>this.runHooks("beforeKeyDown",e),afterKeyDown:e=>{this.isDestroyed||d.runHooks("afterDocumentKeyDown",e)},ownerWindow:this.rootWindow});this.addHook("beforeOnCellMouseDown",e=>{!1===e.ctrlKey&&!1===e.metaKey&&Z.releasePressedKeys()}),this.getShortcutManager=function(){return Z},this.getFocusManager=function(){return w},Object(x["b"])().forEach(e=>{const t=Object(x["a"])(e);N.addItem(e,new t(this))}),Object(Il["a"])(d),Z.setActiveContextName("grid"),bo["a"].getSingleton().run(d,"construct")}var Ll=n("ef07"),Pl=n("13e1");function kl(e,t){const n=new _l(e,t||{},ri);return n.init(),n}Object(oa["d"])(Ll["a"]),kl.editors={BaseEditor:Pl["a"]},kl.Core=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new _l(e,t,ri)},kl.DefaultSettings=da(),kl.hooks=bo["a"].getSingleton(),kl.CellCoords=sn["a"],kl.CellRange=an["a"],kl.packageName="handsontable",kl.buildDate="16/04/2024 10:23:22",kl.version="14.3.0",kl.languages={dictionaryKeys:_o,getLanguageDictionary:Uo,getLanguagesDictionaries:Bo,registerLanguageDictionary:Do,getTranslatedPhrase:Wo};t["a"]=kl},c0e2:function(e,t){function n(){}n.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function i(){r.off(e,i),t.apply(n,arguments)}return i._=t,this.on(e,i,n)},emit:function(e){var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,i=n.length;for(r;r<i;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],i=[];if(r&&t)for(var o=0,s=r.length;o<s;o++)r[o].fn!==t&&r[o].fn._!==t&&i.push(r[o]);return i.length?n[e]=i:delete n[e],this}},e.exports=n,e.exports.TinyEmitter=n},c1cf:function(e,t,n){"use strict";var r=n("e437");
- /**
- * @preserve
- * Authors: soakit, HChenZi
- * Last updated: Mar 09, 2023
- *
- * Description: Definition file for Chinese - China language-country.
- */const i=r["a"].languages.dictionaryKeys,o={languageCode:"zh-CN",[i.CONTEXTMENU_ITEMS_ROW_ABOVE]:"上方插入行",[i.CONTEXTMENU_ITEMS_ROW_BELOW]:"下方插入行",[i.CONTEXTMENU_ITEMS_INSERT_LEFT]:"左方插入列",[i.CONTEXTMENU_ITEMS_INSERT_RIGHT]:"右方插入列",[i.CONTEXTMENU_ITEMS_REMOVE_ROW]:["移除该行","移除多行"],[i.CONTEXTMENU_ITEMS_REMOVE_COLUMN]:["移除该列","移除多列"],[i.CONTEXTMENU_ITEMS_UNDO]:"撤销",[i.CONTEXTMENU_ITEMS_REDO]:"恢复",[i.CONTEXTMENU_ITEMS_READ_ONLY]:"只读",[i.CONTEXTMENU_ITEMS_CLEAR_COLUMN]:"清空该列",[i.CONTEXTMENU_ITEMS_ALIGNMENT]:"对齐",[i.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT]:"左对齐",[i.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER]:"水平居中",[i.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT]:"右对齐",[i.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY]:"两端对齐",[i.CONTEXTMENU_ITEMS_ALIGNMENT_TOP]:"顶端对齐",[i.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE]:"垂直居中",[i.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM]:"底端对齐",[i.CONTEXTMENU_ITEMS_FREEZE_COLUMN]:"冻结该列",[i.CONTEXTMENU_ITEMS_UNFREEZE_COLUMN]:"取消冻结",[i.CONTEXTMENU_ITEMS_BORDERS]:"边框",[i.CONTEXTMENU_ITEMS_BORDERS_TOP]:"上",[i.CONTEXTMENU_ITEMS_BORDERS_RIGHT]:"右",[i.CONTEXTMENU_ITEMS_BORDERS_BOTTOM]:"下",[i.CONTEXTMENU_ITEMS_BORDERS_LEFT]:"左",[i.CONTEXTMENU_ITEMS_REMOVE_BORDERS]:"移除边框",[i.CONTEXTMENU_ITEMS_ADD_COMMENT]:"插入批注",[i.CONTEXTMENU_ITEMS_EDIT_COMMENT]:"编辑批注",[i.CONTEXTMENU_ITEMS_REMOVE_COMMENT]:"删除批注",[i.CONTEXTMENU_ITEMS_READ_ONLY_COMMENT]:"只读批注",[i.CONTEXTMENU_ITEMS_MERGE_CELLS]:"合并",[i.CONTEXTMENU_ITEMS_UNMERGE_CELLS]:"取消合并",[i.CONTEXTMENU_ITEMS_COPY]:"复制",[i.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS]:"带标题的复制",[i.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS]:"带标题组的复制",[i.CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY]:"仅复制标题",[i.CONTEXTMENU_ITEMS_CUT]:"剪切",[i.CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD]:"插入子行",[i.CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD]:"与母行分离",[i.CONTEXTMENU_ITEMS_HIDE_COLUMN]:["隐藏该列","隐藏多列"],[i.CONTEXTMENU_ITEMS_SHOW_COLUMN]:["显示该列","显示多列"],[i.CONTEXTMENU_ITEMS_HIDE_ROW]:["隐藏该行","隐藏多行"],[i.CONTEXTMENU_ITEMS_SHOW_ROW]:["显示该行","显示多行"],[i.FILTERS_CONDITIONS_NONE]:"无",[i.FILTERS_CONDITIONS_EMPTY]:"为空",[i.FILTERS_CONDITIONS_NOT_EMPTY]:"不为空",[i.FILTERS_CONDITIONS_EQUAL]:"等于",[i.FILTERS_CONDITIONS_NOT_EQUAL]:"不等于",[i.FILTERS_CONDITIONS_BEGINS_WITH]:"开头是",[i.FILTERS_CONDITIONS_ENDS_WITH]:"结尾是",[i.FILTERS_CONDITIONS_CONTAINS]:"包含",[i.FILTERS_CONDITIONS_NOT_CONTAIN]:"不包含",[i.FILTERS_CONDITIONS_GREATER_THAN]:"大于",[i.FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL]:"大于或等于",[i.FILTERS_CONDITIONS_LESS_THAN]:"小于",[i.FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL]:"小于或等于",[i.FILTERS_CONDITIONS_BETWEEN]:"在此范围",[i.FILTERS_CONDITIONS_NOT_BETWEEN]:"不在此范围",[i.FILTERS_CONDITIONS_AFTER]:"之后",[i.FILTERS_CONDITIONS_BEFORE]:"之前",[i.FILTERS_CONDITIONS_TODAY]:"今天",[i.FILTERS_CONDITIONS_TOMORROW]:"明天",[i.FILTERS_CONDITIONS_YESTERDAY]:"昨天",[i.FILTERS_VALUES_BLANK_CELLS]:"空白单元格",[i.FILTERS_DIVS_FILTER_BY_CONDITION]:"按条件过滤",[i.FILTERS_DIVS_FILTER_BY_VALUE]:"按值过滤",[i.FILTERS_LABELS_CONJUNCTION]:"且",[i.FILTERS_LABELS_DISJUNCTION]:"或",[i.FILTERS_BUTTONS_SELECT_ALL]:"全选",[i.FILTERS_BUTTONS_CLEAR]:"清除",[i.FILTERS_BUTTONS_OK]:"确认",[i.FILTERS_BUTTONS_CANCEL]:"取消",[i.FILTERS_BUTTONS_PLACEHOLDER_SEARCH]:"搜索",[i.FILTERS_BUTTONS_PLACEHOLDER_VALUE]:"值",[i.FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE]:"第二值"};r["a"].languages.registerLanguageDictionary(o)},c24d:function(e,t,n){"use strict";n.d(t,"a",(function(){return z}));var r=n("c0d8"),i=n("2b0e");function o(e,t,n){return t=y(t),v(e,s()?Reflect.construct(t,n||[],y(e).constructor):t.apply(e,n))}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(s=function(){return!!e})()}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}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 h(e){var t=c(e,"string");return"symbol"==typeof t?t:t+""}function u(e){return u="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},u(e)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,h(r.key),r)}}function f(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function g(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 m(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&w(e,t)}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function w(e,t){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},w(e,t)}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return b(e)}var E=Symbol("unassigned"),C=null,S="The Handsontable instance bound to this component was destroyed and cannot be used properly.";function R(e){e.hotInstance&&(e.hotInstance.addHook("beforeChange",(function(){e.__internalEdit=!0})),e.hotInstance.addHook("beforeCreateRow",(function(){e.__internalEdit=!0})),e.hotInstance.addHook("beforeCreateCol",(function(){e.__internalEdit=!0})),e.hotInstance.addHook("beforeRemoveRow",(function(){e.__internalEdit=!0})),e.hotInstance.addHook("beforeRemoveCol",(function(){e.__internalEdit=!0})))}function T(e){var t=r["a"].hooks.getRegistered(),n={};for(var i in Object.assign(n,r["a"].DefaultSettings),n)n[i]={default:E};for(var o=0;o<t.length;o++)n[t[o]]={default:E};return n.settings={default:E},"HotTable"===e&&(n.id={type:String,default:"hot-"+Math.random().toString(36).substring(5)},n.wrapperRendererCacheSize={type:Number,default:3e3}),n}function O(e){var t={},n=e["settings"];if(n!==E)for(var r in n)n.hasOwnProperty(r)&&n[r]!==E&&(t[r]=n[r]);for(var i in e)e.hasOwnProperty(i)&&"settings"!==i&&e[i]!==E&&(t[i]=e[i]);return t}function N(e,t){var n=O(e),r=e.settings?e.settings:n,i=e.settings?n:null,o={};for(var s in r)!r.hasOwnProperty(s)||void 0===r[s]||t&&"data"!==s&&x(t[s],r[s])||(o[s]=r[s]);for(var a in i)!i.hasOwnProperty(a)||"id"===a||"settings"===a||"wrapperRendererCacheSize"===a||void 0===i[a]||t&&"data"!==a&&x(t[a],i[a])||(o[a]=i[a]);return o}function A(e,t){var n=null;return e.every((function(e,r){return!e.data||!e.data.attrs||void 0===e.data.attrs[t]||(n=e,!1)})),n}function I(e){return e.filter((function(e){return"HotColumn"===e.$options.name}))}function M(e,t,n,r){var i=t.$el?t.$el.ownerDocument:document,o={propsData:n,parent:t,data:r};C||(C=i.createElement("DIV"),C.id="vueHotComponents",i.body.appendChild(C));var s=i.createElement("DIV");return C.appendChild(s),new e.componentOptions.Ctor(o).$mount(s)}function x(e,t){var n=function(e){var t=function(){var e=new WeakSet;return function(t,n){if("object"===u(n)&&null!==n){if(e.has(n))return;e.add(n)}return n}}();return JSON.stringify(e,t)};return"function"===typeof e&&"function"===typeof t?e.toString()===t.toString():u(e)===u(t)&&n(e)===n(t)}var _="14.3.0";"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self&&self;function L(e,t){return t={exports:{}},e(t,t.exports),t.exports}var P=L((function(e,t){(function(e,n){var r=t;n(r)})(0,(function(e){var t=Symbol("newer"),n=Symbol("older");function r(e,t){"number"!==typeof e&&(t=e,e=0),this.size=0,this.limit=e,this.oldest=this.newest=void 0,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}function i(e,r){this.key=e,this.value=r,this[t]=void 0,this[n]=void 0}e.LRUMap=r,r.prototype._markEntryAsUsed=function(e){e!==this.newest&&(e[t]&&(e===this.oldest&&(this.oldest=e[t]),e[t][n]=e[n]),e[n]&&(e[n][t]=e[t]),e[t]=void 0,e[n]=this.newest,this.newest&&(this.newest[t]=e),this.newest=e)},r.prototype.assign=function(e){var r,o=this.limit||Number.MAX_VALUE;this._keymap.clear();for(var s=e[Symbol.iterator](),a=s.next();!a.done;a=s.next()){var l=new i(a.value[0],a.value[1]);if(this._keymap.set(l.key,l),r?(r[t]=l,l[n]=r):this.oldest=l,r=l,0==o--)throw new Error("overflow")}this.newest=r,this.size=this._keymap.size},r.prototype.get=function(e){var t=this._keymap.get(e);if(t)return this._markEntryAsUsed(t),t.value},r.prototype.set=function(e,r){var o=this._keymap.get(e);return o?(o.value=r,this._markEntryAsUsed(o),this):(this._keymap.set(e,o=new i(e,r)),this.newest?(this.newest[t]=o,o[n]=this.newest):this.oldest=o,this.newest=o,++this.size,this.size>this.limit&&this.shift(),this)},r.prototype.shift=function(){var e=this.oldest;if(e)return this.oldest[t]?(this.oldest=this.oldest[t],this.oldest[n]=void 0):(this.oldest=void 0,this.newest=void 0),e[t]=e[n]=void 0,this._keymap["delete"](e.key),--this.size,[e.key,e.value]},r.prototype.has=function(e){return this._keymap.has(e)}}))})),k=P.LRUMap,j={name:"HotTable",props:T("HotTable"),watch:{mergedHotSettings:function(e){this.hotInstance&&void 0!==e&&(e.data&&(this.hotInstance.isColumnModificationAllowed()||!this.hotInstance.isColumnModificationAllowed()&&this.hotInstance.countSourceCols()===this.miscCache.currentSourceColumns)&&(this.matchHotMappersSize(),delete e.data),Object.keys(e).length?this.hotInstance.updateSettings(e):this.hotInstance.render(),this.miscCache.currentSourceColumns=this.hotInstance.countSourceCols())}},data:function(){var e=this,t=new k(this.wrapperRendererCacheSize);return t.shift=function(){var e=k.prototype.shift.call(this);return e[1].component.$destroy(),e},{__internalEdit:!1,miscCache:{currentSourceColumns:null},__hotInstance:null,columnSettings:null,rendererCache:t,editorCache:new Map,get hotInstance(){return!e.__hotInstance||e.__hotInstance&&!e.__hotInstance.isDestroyed?e.__hotInstance:(console.warn(S),null)},set hotInstance(t){e.__hotInstance=t}}},computed:{mergedHotSettings:function(){return N(this.$props,this.hotInstance?this.hotInstance.getSettings():void 0)}},methods:{hotInit:function(){var e=this.getGlobalRendererVNode(),t=this.getGlobalEditorVNode(),n=N(this.$props);n.columns=this.columnSettings?this.columnSettings:n.columns,t&&(n.editor=this.getEditorClass(t,this),t.child.$destroy()),e&&(n.renderer=this.getRendererWrapper(e,this),e.child.$destroy()),this.hotInstance=new r["a"].Core(this.$el,n),this.hotInstance.init(),R(this),this.miscCache.currentSourceColumns=this.hotInstance.countSourceCols()},matchHotMappersSize:function(){var e=this;if(this.hotInstance){var t,n=this.hotInstance.getSourceData(),r=[],i=[],o=this.hotInstance.rowIndexMapper.getNumberOfIndexes(),s=this.hotInstance.isColumnModificationAllowed(),a=0;if(n&&n.length!==o&&n.length<o)for(var l=n.length;l<o;l++)r.push(l);if(s)if(a=this.hotInstance.columnIndexMapper.getNumberOfIndexes(),n&&n[0]&&(null===(t=n[0])||void 0===t?void 0:t.length)!==a&&n[0].length<a)for(var c=n[0].length;c<a;c++)i.push(c);this.hotInstance.batch((function(){r.length>0?e.hotInstance.rowIndexMapper.removeIndexes(r):e.hotInstance.rowIndexMapper.insertIndexes(o-1,n.length-o),s&&0!==n.length&&(i.length>0?e.hotInstance.columnIndexMapper.removeIndexes(i):e.hotInstance.columnIndexMapper.insertIndexes(a-1,n[0].length-a))}))}},getGlobalRendererVNode:function(){var e=this.$slots["default"]||[];return A(e,"hot-renderer")},getGlobalEditorVNode:function(){var e=this.$slots["default"]||[];return A(e,"hot-editor")},getColumnSettings:function(){var e=I(this.$children),t=!1,n=e.map((function(e){return e.usesRendererComponent&&(t=!0),l({},e.columnSettings)}));return t&&this.settings&&(!1!==this.settings.autoColumnSize||this.settings.autoRowSize)&&(!1!==this.autoColumnSize||this.autoRowSize)&&console.warn("Your `hot-table` configuration includes both `hot-column` and `autoRowSize`/`autoColumnSize`, which are not compatible with each other in this version of `@handsontable/vue`. Disable `autoRowSize` and `autoColumnSize` to prevent row and column misalignment."),n.length?n:void 0},getRendererWrapper:function(e,t){var n=this;return function(r,i,o,s,a,l,c){if(i&&!i.getAttribute("ghost-table")){var h=n.rendererCache,u={hotInstance:r,TD:i,row:o,col:s,prop:a,value:l,cellProperties:c,isRenderer:!0};if(h&&!h.has("".concat(o,"-").concat(s))){var d=M(e,t,e.componentOptions.propsData,u);h.set("".concat(o,"-").concat(s),{component:d,lastUsedTD:null})}var p=h.get("".concat(o,"-").concat(s)),f=p.component,g=p.lastUsedTD;if(Object.assign(f.$data,u),!f.$el.parentElement||g!==i){while(i.firstChild)i.removeChild(i.firstChild);i.appendChild(f.$el),p.lastUsedTD=i}}return i}},getEditorClass:function(e,t){var n=e.key?e.key.toString():null,r=e.componentOptions.Ctor.options.name,i=n?"".concat(r,":").concat(n):r,o=this.editorCache,s=null;return o.has(i)?s=o.get(i):(s=M(e,t,e.componentOptions.propsData,{isEditor:!0}),o.set(i,s)),s.$data.hotCustomEditorClass}},mounted:function(){return this.columnSettings=this.getColumnSettings(),this.hotInit()},beforeDestroy:function(){this.hotInstance&&this.hotInstance.destroy()},version:_};function H(e,t,n,r,i,o,s,a,l,c){"boolean"!==typeof s&&(l=a,a=s,s=!1);const h="function"===typeof n?n.options:n;let u;if(e&&e.render&&(h.render=e.render,h.staticRenderFns=e.staticRenderFns,h._compiled=!0,i&&(h.functional=!0)),r&&(h._scopeId=r),o?(u=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},h._ssrRegister=u):t&&(u=s?function(e){t.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,a(e))}),u)if(h.functional){const e=h.render;h.render=function(t,n){return u.call(n),e(t,n)}}else{const e=h.beforeCreate;h.beforeCreate=e?[].concat(e,u):[u]}return n}var D=j,F=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:e.id}},[e._t("default")],2)},U=[],V=void 0,B=void 0,W=void 0,G=!1,z=H({render:F,staticRenderFns:U},V,D,B,G,W,!1,void 0,void 0,void 0);T("HotColumn");
- /*! *****************************************************************************
- Copyright (c) Microsoft Corporation. All rights reserved.
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of the
- License at http://www.apache.org/licenses/LICENSE-2.0
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
- MERCHANTABLITY OR NON-INFRINGEMENT.
- See the Apache Version 2.0 License for specific language governing permissions
- and limitations under the License.
- ***************************************************************************** */
- function Y(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function X(e){return X="function"===typeof Symbol&&"symbol"===u(Symbol.iterator)?function(e){return u(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":u(e)},X(e)}function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $(e){return q(e)||Q(e)||Z()}function q(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function Q(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function Z(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function J(){return"undefined"!==typeof Reflect&&Reflect.defineMetadata&&Reflect.getOwnMetadataKeys}function ee(e,t){te(e,t),Object.getOwnPropertyNames(t.prototype).forEach((function(n){te(e.prototype,t.prototype,n)})),Object.getOwnPropertyNames(t).forEach((function(n){te(e,t,n)}))}function te(e,t,n){var r=n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t);r.forEach((function(r){var i=n?Reflect.getOwnMetadata(r,t,n):Reflect.getOwnMetadata(r,t);n?Reflect.defineMetadata(r,i,e,n):Reflect.defineMetadata(r,i,e)}))}var ne={__proto__:[]},re=ne instanceof Array;function ie(e){var t=X(e);return null==e||"object"!==t&&"function"!==t}function oe(e,t){var n=t.prototype._init;t.prototype._init=function(){var t=this,n=Object.getOwnPropertyNames(e);if(e.$options.props)for(var r in e.$options.props)e.hasOwnProperty(r)||n.push(r);n.forEach((function(n){Object.defineProperty(t,n,{get:function(){return e[n]},set:function(t){e[n]=t},configurable:!0})}))};var r=new t;t.prototype._init=n;var i={};return Object.keys(r).forEach((function(e){void 0!==r[e]&&(i[e]=r[e])})),i}var se=["data","beforeCreate","created","beforeMount","mounted","beforeDestroy","destroyed","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"];function ae(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.name=t.name||e._componentTag||e.name;var n=e.prototype;Object.getOwnPropertyNames(n).forEach((function(e){if("constructor"!==e)if(se.indexOf(e)>-1)t[e]=n[e];else{var r=Object.getOwnPropertyDescriptor(n,e);void 0!==r.value?"function"===typeof r.value?(t.methods||(t.methods={}))[e]=r.value:(t.mixins||(t.mixins=[])).push({data:function(){return K({},e,r.value)}}):(r.get||r.set)&&((t.computed||(t.computed={}))[e]={get:r.get,set:r.set})}})),(t.mixins||(t.mixins=[])).push({data:function(){return oe(this,e)}});var r=e.__decorators__;r&&(r.forEach((function(e){return e(t)})),delete e.__decorators__);var o=Object.getPrototypeOf(e.prototype),s=o instanceof i["default"]?o.constructor:i["default"],a=s.extend(t);return ce(a,e,s),J()&&ee(a,e),a}var le={prototype:!0,arguments:!0,callee:!0,caller:!0};function ce(e,t,n){Object.getOwnPropertyNames(t).forEach((function(r){if(!le[r]){var i=Object.getOwnPropertyDescriptor(e,r);if(!i||i.configurable){var o=Object.getOwnPropertyDescriptor(t,r);if(!re){if("cid"===r)return;var s=Object.getOwnPropertyDescriptor(n,r);if(!ie(o.value)&&s&&s.value===o.value)return}Object.defineProperty(e,r,o)}}}))}function he(e){return"function"===typeof e?ae(e):function(t){return ae(t,e)}}he.registerHooks=function(e){se.push.apply(se,$(e))};var ue=function(e){function t(){var e;return d(this,t),e=o(this,t,arguments),e.name="BaseEditorComponent",e.instance=null,e.row=null,e.col=null,e.prop=null,e.TD=null,e.originalValue=null,e.cellProperties=null,e.state=null,e.hot=null,e}return m(t,e),f(t,[{key:"mounted",value:function(){var e=this;this.$data.hotCustomEditorClass=function(){var t=function(t){function n(t){var r;return d(this,n),r=o(this,n,[t]),e.$data.hotCustomEditorInstance=r,r}return m(n,t),f(n,[{key:"focus",value:function(){}},{key:"getValue",value:function(){}},{key:"setValue",value:function(){}},{key:"open",value:function(){}},{key:"close",value:function(){}}])}(r["a"].editors.BaseEditor);return Object.getOwnPropertyNames(r["a"].editors.BaseEditor.prototype).forEach((function(n){"constructor"!==n&&(t.prototype[n]=function(){for(var t,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(t=e[n]).call.apply(t,[this].concat(i))})})),t}()}},{key:"_fireCallbacks",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];(e=r["a"].editors.BaseEditor.prototype._fireCallbacks).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"beginEditing",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.beginEditing).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"cancelChanges",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.cancelChanges).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"checkEditorSection",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.checkEditorSection).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"close",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.close).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"discardEditor",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.discardEditor).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"enableFullEditMode",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.enableFullEditMode).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"extend",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.extend).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"finishEditing",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.finishEditing).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"focus",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.focus).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"getValue",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.getValue).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"init",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.init).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"isInFullEditMode",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.isInFullEditMode).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"isOpened",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.isOpened).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"isWaiting",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.isWaiting).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"open",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.open).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"prepare",value:function(e,t,n,i,o,s){return this.$data.hotInstance=s.instance,this.$data.row=e,this.$data.col=t,this.$data.prop=n,this.$data.TD=i,this.$data.originalValue=o,this.$data.cellProperties=s,r["a"].editors.BaseEditor.prototype.prepare.call(this.$data.hotCustomEditorInstance,e,t,n,i,o,s)}},{key:"saveValue",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.saveValue).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"setValue",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.setValue).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"addHook",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.addHook).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"removeHooksByKey",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.removeHooksByKey).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"clearHooks",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.clearHooks).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"getEditedCell",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.getEditedCell).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"getEditedCellRect",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.getEditedCellRect).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"getEditedCellsZIndex",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.getEditedCellsZIndex).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}},{key:"getEditedCellsLayerClass",value:function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r["a"].editors.BaseEditor.prototype.getEditedCellsLayerClass).call.apply(e,[this.$data.hotCustomEditorInstance].concat(n))}}])}(i["default"]);ue=Y([he({})],ue)},c272:function(e,t,n){"use strict";e.exports={}},c4fa:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}));const r="gridDefault",i="editorManager.handlingEditor"},c5ae:function(e,t,n){"use strict";var r=n("9e75"),i=Math.min;e.exports=function(e){var t=r(e);return t>0?i(t,9007199254740991):0}},c5c4:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));n("7a89");var r=n("f938"),i=n("de3b"),o=n("491c"),s=n("87d6"),a=n("7b9c");function l(e,t){c(e,t),t.add(e)}function c(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function h(e,t,n){return t=u(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){var t=d(e,"string");return"symbol"==typeof t?t:t+""}function d(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 p(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 f="editorManager.navigation";var g=new WeakSet;class m{constructor(e,t,n){l(this,g),h(this,"hot",void 0),h(this,"tableMeta",void 0),h(this,"selection",void 0),h(this,"eventManager",void 0),h(this,"destroyed",!1),h(this,"lock",!1),h(this,"activeEditor",void 0),h(this,"cellProperties",void 0),this.hot=e,this.tableMeta=t,this.selection=n,this.eventManager=new s["a"](e),this.hot.addHook("afterDocumentKeyDown",e=>p(g,this,y).call(this,e)),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"compositionstart",e=>{!this.destroyed&&this.hot.isListening()&&this.openEditor("",e)}),this.hot.view._wt.update("onCellDblClick",(e,t,n)=>p(g,this,w).call(this,e,t,n))}lockEditor(){this.lock=!0}unlockEditor(){this.lock=!1}destroyEditor(e){this.lock||this.closeEditor(e)}getActiveEditor(){return this.activeEditor}prepareEditor(){var e;if(this.lock)return;if(this.activeEditor&&this.activeEditor.isWaiting())return void this.closeEditor(!1,!1,e=>{e&&this.prepareEditor()});const t=null===(e=this.hot.getSelectedRangeLast())||void 0===e?void 0:e.highlight;if(!t||t.isHeader())return;const{row:n,col:r}=t,i=this.hot.runHooks("modifyGetCellCoords",n,r);let s=n,a=r;if(Array.isArray(i)&&([s,a]=i),this.cellProperties=this.hot.getCellMeta(s,a),!this.isCellEditable())return void this.clearActiveEditor();const l=this.hot.getCell(n,r,!0);if(l){const e=this.hot.getCellEditor(this.cellProperties),t=this.hot.colToProp(a),i=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(s),a);this.activeEditor=Object(o["b"])(e,this.hot),this.activeEditor.prepare(n,r,t,l,i,this.cellProperties)}}isEditorOpened(){return this.activeEditor&&this.activeEditor.isOpened()}openEditor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.isCellEditable())return void this.clearActiveEditor();const r=this.hot.getSelectedRangeLast();let i=this.hot.runHooks("beforeBeginEditing",r.highlight.row,r.highlight.col,e,t,n);t instanceof MouseEvent&&"boolean"!==typeof i&&(i=0===this.hot.selection.getLayerLevel()&&r.isSingle()),!1!==i?(this.activeEditor||(this.hot.scrollToFocusedCell(),this.prepareEditor()),this.activeEditor&&(n&&this.activeEditor.enableFullEditMode(),this.activeEditor.beginEditing(e,t))):this.clearActiveEditor()}closeEditor(e,t,n){this.activeEditor?this.activeEditor.finishEditing(e,t,n):n&&n(!1)}closeEditorAndSaveChanges(e){this.closeEditor(!1,e)}closeEditorAndRestoreOriginalValue(e){this.closeEditor(!0,e)}clearActiveEditor(){this.activeEditor=void 0}isCellEditable(){const e=this.hot.getSelectedRangeLast();if(!e)return!1;const t=this.hot.getCellEditor(this.cellProperties),{row:n,col:r}=e.highlight,{rowIndexMapper:i,columnIndexMapper:o}=this.hot,s=i.isHidden(this.hot.toPhysicalRow(n))||o.isHidden(this.hot.toPhysicalColumn(r));return!(this.cellProperties.readOnly||!t||s)}moveSelectionAfterEnter(e){const t={..."function"===typeof this.tableMeta.enterMoves?this.tableMeta.enterMoves(e):this.tableMeta.enterMoves};e.shiftKey&&(t.row=-t.row,t.col=-t.col),this.hot.selection.isMultiple()?this.selection.transformFocus(t.row,t.col):this.selection.transformStart(t.row,t.col,!0)}destroy(){this.destroyed=!0,this.eventManager.destroy()}}function y(e){const t=this.hot.getSelectedRangeLast();if(!this.hot.isListening()||!t||t.highlight.isHeader()||Object(i["isImmediatePropagationStopped"])(e))return;const{keyCode:n}=e,o=(e.ctrlKey||e.metaKey)&&!e.altKey;if((!this.activeEditor||this.activeEditor&&!this.activeEditor.isWaiting())&&!Object(r["isFunctionKey"])(n)&&!Object(r["isCtrlMetaKey"])(n)&&!o&&!this.isEditorOpened()){const t=this.hot.getShortcutManager(),n=t.getContext("editor"),r={runOnlyIf:()=>Object(a["isDefined"])(this.hot.getSelected()),group:f};n.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())}}],r),this.openEditor("",e)}}function w(e,t){t.isCell()&&this.openEditor(null,e,!0)}const b=new WeakMap;m.getInstance=function(e,t,n){let r=b.get(e);return r||(r=new m(e,t,n),b.set(e,r)),r},t["b"]=m},c5cd:function(e,t,n){"use strict";n.d(t,"a",(function(){return h})),n.d(t,"b",(function(){return u}));n("7a89");var r=n("7b9c"),i=n("351d"),o=n("7ae0");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)}let c=0;class h{constructor(){s(this,"collection",new Map)}register(e,t){!1===this.collection.has(e)&&(this.collection.set(e,t),t.addLocalHook("change",()=>this.runLocalHooks("change",t)),c+=1)}unregister(e){const t=this.collection.get(e);Object(r["isDefined"])(t)&&(t.destroy(),this.collection.delete(e),this.runLocalHooks("change",t),c-=1)}unregisterAll(){this.collection.forEach((e,t)=>this.unregister(t)),this.collection.clear()}get(e){return Object(r["isUndefined"])(e)?Array.from(this.collection.values()):this.collection.get(e)}getLength(){return this.collection.size}removeFromEvery(e){this.collection.forEach(t=>{t.remove(e)})}insertToEvery(e,t){this.collection.forEach(n=>{n.insert(e,t)})}initEvery(e){this.collection.forEach(t=>{t.init(e)})}}function u(){return c}Object(i["mixin"])(h,o["a"])},cac7:function(e,t,n){"use strict";var r=n("d128"),i=n("a60d"),o=n("1caf");e.exports=function(e,t,n){r?i.f(e,t,o(0,n)):e[t]=n}},cbf2:function(e,t,n){"use strict";var r=n("80dd"),i=n("c272"),o=r("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||s[o]===e)}},cc6f:function(e,t,n){"use strict";n.d(t,"a",(function(){return ua})),n.d(t,"b",(function(){return Bt}));var r,i,o={};n.r(o),n.d(o,"AddressPlugin",(function(){return ba})),n.d(o,"ArrayPlugin",(function(){return va})),n.d(o,"AbsPlugin",(function(){return Ea})),n.d(o,"BitShiftPlugin",(function(){return Ta})),n.d(o,"BitwiseLogicOperationsPlugin",(function(){return Ia})),n.d(o,"BooleanPlugin",(function(){return Ma})),n.d(o,"CharPlugin",(function(){return xa})),n.d(o,"CodePlugin",(function(){return _a})),n.d(o,"CountBlankPlugin",(function(){return La})),n.d(o,"CountUniquePlugin",(function(){return Pa})),n.d(o,"DateTimePlugin",(function(){return ka})),n.d(o,"DegreesPlugin",(function(){return Ua})),n.d(o,"DeltaPlugin",(function(){return Va})),n.d(o,"ExpPlugin",(function(){return Ba})),n.d(o,"FinancialPlugin",(function(){return Wa})),n.d(o,"FormulaTextPlugin",(function(){return $a})),n.d(o,"HyperlinkPlugin",(function(){return qa})),n.d(o,"InformationPlugin",(function(){return Qa})),n.d(o,"IsEvenPlugin",(function(){return Za})),n.d(o,"IsOddPlugin",(function(){return Ja})),n.d(o,"LogarithmPlugin",(function(){return el})),n.d(o,"MathConstantsPlugin",(function(){return nl})),n.d(o,"MatrixPlugin",(function(){return ol})),n.d(o,"MedianPlugin",(function(){return sl})),n.d(o,"ModuloPlugin",(function(){return al})),n.d(o,"NumericAggregationPlugin",(function(){return hl})),n.d(o,"PowerPlugin",(function(){return pl})),n.d(o,"RadiansPlugin",(function(){return fl})),n.d(o,"RadixConversionPlugin",(function(){return vl})),n.d(o,"RandomPlugin",(function(){return Al})),n.d(o,"RoundingPlugin",(function(){return xl})),n.d(o,"SqrtPlugin",(function(){return _l})),n.d(o,"ConditionalAggregationPlugin",(function(){return zl})),n.d(o,"SumprodPlugin",(function(){return Yl})),n.d(o,"TextPlugin",(function(){return Xl})),n.d(o,"TrigonometryPlugin",(function(){return Kl})),n.d(o,"LookupPlugin",(function(){return ql})),n.d(o,"RomanPlugin",(function(){return Ql})),n.d(o,"SimpleArithmerticPlugin",(function(){return tc})),n.d(o,"StatisticalPlugin",(function(){return Qc})),n.d(o,"MathPlugin",(function(){return Zc})),n.d(o,"ComplexPlugin",(function(){return nh})),n.d(o,"StatisticalAggregationPlugin",(function(){return gh})),function(e){e["RELATIVE"]="RELATIVE",e["ABSOLUTE"]="ABSOLUTE"}(r||(r={}));class s{constructor(e,t,n){this.type=e,this.col=t,this.sheet=n}static absolute(e,t){return new s(r.ABSOLUTE,e,t)}static relative(e,t){return new s(r.RELATIVE,e,t)}static compareByAbsoluteAddress(e){return(t,n)=>t.toSimpleColumnAddress(e).col-n.toSimpleColumnAddress(e).col}isColumnAbsolute(){return this.type===r.ABSOLUTE}isColumnRelative(){return this.type===r.RELATIVE}isAbsolute(){return this.type===r.ABSOLUTE&&void 0!==this.sheet}moved(e,t,n){const r=void 0===this.sheet?void 0:e;return new s(this.type,this.col+t,r)}shiftedByColumns(e){return new s(this.type,this.col+e,this.sheet)}toSimpleColumnAddress(e){const t=wr(this,e);let n=this.col;return this.isColumnRelative()&&(n=e.col+this.col),ur(t,n)}shiftRelativeDimensions(e,t){const n=this.isColumnRelative()?this.col+e:this.col;return new s(this.type,n,this.sheet)}shiftAbsoluteDimensions(e,t){const n=this.isColumnAbsolute()?this.col+e:this.col;return new s(this.type,n,this.sheet)}withSheet(e){return new s(this.type,this.col,e)}isInvalid(e){return this.toSimpleColumnAddress(e).col<0}hash(e){const t=e&&void 0!==this.sheet?"#"+this.sheet:"";switch(this.type){case r.RELATIVE:return`${t}#COLR${this.col}`;case r.ABSOLUTE:return`${t}#COLA${this.col}`}}unparse(e){const t=this.toSimpleColumnAddress(e);if(dr(t))return;const n=D(t.col),i=this.type===r.ABSOLUTE?"$":"";return`${i}${n}`}exceedsSheetSizeLimits(e){return this.col>=e}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class a{constructor(e,t,n){this.type=e,this.row=t,this.sheet=n}static absolute(e,t){return new a(r.ABSOLUTE,e,t)}static relative(e,t){return new a(r.RELATIVE,e,t)}static compareByAbsoluteAddress(e){return(t,n)=>t.toSimpleRowAddress(e).row-n.toSimpleRowAddress(e).row}isRowAbsolute(){return this.type===r.ABSOLUTE}isRowRelative(){return this.type===r.RELATIVE}isAbsolute(){return this.type===r.ABSOLUTE&&void 0!==this.sheet}moved(e,t,n){const r=void 0===this.sheet?void 0:e;return new a(this.type,this.row+n,r)}shiftedByRows(e){return new a(this.type,this.row+e,this.sheet)}toSimpleRowAddress(e){const t=wr(this,e);let n=this.row;return this.isRowRelative()&&(n=e.row+this.row),cr(t,n)}shiftRelativeDimensions(e,t){const n=this.isRowRelative()?this.row+t:this.row;return new a(this.type,n,this.sheet)}shiftAbsoluteDimensions(e,t){const n=this.isRowAbsolute()?this.row+t:this.row;return new a(this.type,n,this.sheet)}withSheet(e){return new a(this.type,this.row,e)}isInvalid(e){return this.toSimpleRowAddress(e).row<0}hash(e){const t=e&&void 0!==this.sheet?"#"+this.sheet:"";switch(this.type){case r.RELATIVE:return`${t}#ROWR${this.row}`;case r.ABSOLUTE:return`${t}#ROWA${this.row}`}}unparse(e){const t=this.toSimpleRowAddress(e);if(hr(t))return;const n=this.type===r.ABSOLUTE?"$":"";return`${n}${t.row+1}`}exceedsSheetSizeLimits(e){return this.row>=e}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */(function(e){e["CELL_REFERENCE_RELATIVE"]="CELL_REFERENCE",e["CELL_REFERENCE_ABSOLUTE"]="CELL_REFERENCE_ABSOLUTE",e["CELL_REFERENCE_ABSOLUTE_COL"]="CELL_REFERENCE_ABSOLUTE_COL",e["CELL_REFERENCE_ABSOLUTE_ROW"]="CELL_REFERENCE_ABSOLUTE_ROW"})(i||(i={}));class l{constructor(e,t,n,r){this.col=e,this.row=t,this.type=n,this.sheet=r}static fromColAndRow(e,t,n){const r=e.isColumnAbsolute()&&t.isRowAbsolute()?l.absolute.bind(this):e.isColumnAbsolute()?l.absoluteCol.bind(this):t.isRowAbsolute()?l.absoluteRow.bind(this):l.relative.bind(this);return r(e.col,t.row,n)}static relative(e,t,n){return new l(e,t,i.CELL_REFERENCE_RELATIVE,n)}static absolute(e,t,n){return new l(e,t,i.CELL_REFERENCE_ABSOLUTE,n)}static absoluteCol(e,t,n){return new l(e,t,i.CELL_REFERENCE_ABSOLUTE_COL,n)}static absoluteRow(e,t,n){return new l(e,t,i.CELL_REFERENCE_ABSOLUTE_ROW,n)}toSimpleCellAddress(e){const t=wr(this,e);return this.type===i.CELL_REFERENCE_ABSOLUTE?pr(t,this.col,this.row):this.type===i.CELL_REFERENCE_ABSOLUTE_ROW?pr(t,e.col+this.col,this.row):this.type===i.CELL_REFERENCE_ABSOLUTE_COL?pr(t,this.col,e.row+this.row):pr(t,e.col+this.col,e.row+this.row)}toColumnAddress(){const e=this.isColumnRelative()?r.RELATIVE:r.ABSOLUTE;return new s(e,this.col,this.sheet)}toRowAddress(){const e=this.isRowRelative()?r.RELATIVE:r.ABSOLUTE;return new a(e,this.row,this.sheet)}toSimpleColumnAddress(e){const t=wr(this,e);let n=this.col;return this.isColumnRelative()&&(n+=e.col),ur(t,n)}toSimpleRowAddress(e){const t=wr(this,e);let n=this.row;return this.isRowRelative()&&(n+=e.row),cr(t,n)}isRowAbsolute(){return this.type===i.CELL_REFERENCE_ABSOLUTE||this.type===i.CELL_REFERENCE_ABSOLUTE_ROW}isColumnAbsolute(){return this.type===i.CELL_REFERENCE_ABSOLUTE||this.type===i.CELL_REFERENCE_ABSOLUTE_COL}isColumnRelative(){return this.type===i.CELL_REFERENCE_RELATIVE||this.type===i.CELL_REFERENCE_ABSOLUTE_ROW}isRowRelative(){return this.type===i.CELL_REFERENCE_RELATIVE||this.type===i.CELL_REFERENCE_ABSOLUTE_COL}isAbsolute(){return this.type===i.CELL_REFERENCE_ABSOLUTE&&void 0!==this.sheet}shiftedByRows(e){return new l(this.col,this.row+e,this.type,this.sheet)}shiftedByColumns(e){return new l(this.col+e,this.row,this.type,this.sheet)}moved(e,t,n){const r=void 0===this.sheet?void 0:e;return new l(this.col+t,this.row+n,this.type,r)}withSheet(e){return new l(this.col,this.row,this.type,e)}isInvalid(e){return fr(this.toSimpleCellAddress(e))}shiftRelativeDimensions(e,t){const n=this.isColumnAbsolute()?this.col:this.col+e,r=this.isRowAbsolute()?this.row:this.row+t;return new l(n,r,this.type,this.sheet)}shiftAbsoluteDimensions(e,t){const n=this.isColumnRelative()?this.col:this.col+e,r=this.isRowRelative()?this.row:this.row+t;return new l(n,r,this.type,this.sheet)}hash(e){const t=e&&void 0!==this.sheet?"#"+this.sheet:"";switch(this.type){case i.CELL_REFERENCE_RELATIVE:return`${t}#${this.row}R${this.col}`;case i.CELL_REFERENCE_ABSOLUTE:return`${t}#${this.row}A${this.col}`;case i.CELL_REFERENCE_ABSOLUTE_COL:return`${t}#${this.row}AC${this.col}`;case i.CELL_REFERENCE_ABSOLUTE_ROW:return`${t}#${this.row}AR${this.col}`}}unparse(e){const t=this.toSimpleCellAddress(e);if(fr(t))return;const n=D(t.col),r=this.type===i.CELL_REFERENCE_ABSOLUTE||this.type===i.CELL_REFERENCE_ABSOLUTE_ROW?"$":"",o=this.type===i.CELL_REFERENCE_ABSOLUTE||this.type===i.CELL_REFERENCE_ABSOLUTE_COL?"$":"";return`${o}${n}${r}${t.row+1}`}exceedsSheetSizeLimits(e,t){return this.row>=t||this.col>=e}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */const c=":",h="$",u="\\s+",d="[ \\t\\n\\r]+",p="A-Za-zÀ-ʯ",f=p+"0-9_.",g=`[${p}0-9_]+`,m="'(((?!').|'')*)'",y=`(${g}|${m})!`,w=`(${y})?\\${h}?[A-Za-z]+\\${h}?[0-9]+`,b=`(${y})?\\${h}?[A-Za-z]+`,v=`(${y})?\\${h}?[0-9]+`,E="[rR][0-9]*[cC][0-9]*",C=`(${w})[^${f}]`,S=`[${p}_][${f}]*`,R=["0","1","2","3","4","5","6","7","8","9"],T=[...Array.from(Array(26)).map((e,t)=>t+"A".charCodeAt(0)),...Array.from(Array(26)).map((e,t)=>t+"a".charCodeAt(0)),...Array.from(Array(496)).map((e,t)=>t+192)].map(e=>String.fromCharCode(e)),O=new RegExp(`^(${y})?(\\${h}?)([A-Za-z]+)(\\${h}?)([0-9]+)$`),N=new RegExp(`^(${y})?(\\${h}?)([A-Za-z]+)$`),A=new RegExp(`^(${y})?(\\${h}?)([0-9]+)$`),I=new RegExp(`^${g}$`),M=(e,t,n)=>{const r=O.exec(t),i=H(r[6]);let o=U(r,e);if(void 0===o)return;null===o&&(o=void 0);const s=Number(r[8])-1;return r[5]===h&&r[7]===h?l.absolute(i,s,o):r[5]===h?l.absoluteCol(i,s-n.row,o):r[7]===h?l.absoluteRow(i-n.col,s,o):l.relative(i-n.col,s-n.row,o)},x=(e,t,n)=>{const r=N.exec(t);let i=U(r,e);if(void 0===i)return;null===i&&(i=void 0);const o=H(r[6]);return r[5]===h?s.absolute(o,i):s.relative(o-n.col,i)},_=(e,t,n)=>{const r=A.exec(t);let i=U(r,e);if(void 0===i)return;null===i&&(i=void 0);const o=Number(r[6])-1;return r[5]===h?a.absolute(o,i):a.relative(o-n.row,i)},L=(e,t,n)=>{const r=O.exec(t);if(!r)return;const i=H(r[6]);let o=U(r,e);if(void 0===o)return;null===o&&(o=n);const s=Number(r[8])-1;return pr(o,i,s)},P=(e,t,n)=>{const r=t.split(c);if(2!==r.length)return;const[i,o]=r,s=L(e,i,n);if(void 0===s)return;const a=L(e,o,s.sheet);return void 0!==a&&s.sheet===a.sheet?Cr(s,a):void 0},k=(e,t,n)=>{const r=D(t.col),i=F(t.sheet,e);if(void 0!==i)return n!==t.sheet?`${i}!${r}${t.row+1}`:`${r}${t.row+1}`},j=(e,t,n)=>{const r=k(e,t.start,n),i=k(e,t.end,t.start.sheet);return void 0===r||void 0===i?void 0:`${r}${c}${i}`};function H(e){return 1===e.length?e.toUpperCase().charCodeAt(0)-65:e.split("").reduce((e,t)=>26*e+(t.toUpperCase().charCodeAt(0)-64),0)-1}function D(e){let t="";while(e>=0)t=String.fromCharCode(e%26+97)+t,e=Math.floor(e/26)-1;return t.toUpperCase()}function F(e,t){let n=t(e);if(void 0!==n)return I.test(n)?n:(n=n.replace(/'/g,"''"),`'${n}'`)}function U(e,t){var n;let r=null!==(n=e[3])&&void 0!==n?n:e[2];return r?(r=r.replace(/''/g,"'"),t(r)):null}var V=n("fa83");
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */const B=(e,t)=>({type:e,message:t});var W,G,z;(function(e){e["LexingError"]="LexingError",e["ParserError"]="ParsingError",e["StaticOffsetError"]="StaticOffsetError",e["StaticOffsetOutOfRangeError"]="StaticOffsetOutOfRangeError",e["RangeOffsetNotAllowed"]="RangeOffsetNotAllowed",e["InvalidRangeSize"]="InvalidRangeSize"})(W||(W={})),function(e){e["EMPTY"]="EMPTY",e["NUMBER"]="NUMBER",e["STRING"]="STRING",e["MINUS_UNARY_OP"]="MINUS_UNARY_OP",e["PLUS_UNARY_OP"]="PLUS_UNARY_OP",e["PERCENT_OP"]="PERCENT_OP",e["CONCATENATE_OP"]="CONCATENATE_OP",e["EQUALS_OP"]="EQUALS_OP",e["NOT_EQUAL_OP"]="NOT_EQUAL_OP",e["GREATER_THAN_OP"]="GREATER_THAN_OP",e["LESS_THAN_OP"]="LESS_THAN_OP",e["GREATER_THAN_OR_EQUAL_OP"]="GREATER_THAN_OR_EQUAL_OP",e["LESS_THAN_OR_EQUAL_OP"]="LESS_THAN_OR_EQUAL_OP",e["PLUS_OP"]="PLUS_OP",e["MINUS_OP"]="MINUS_OP",e["TIMES_OP"]="TIMES_OP",e["DIV_OP"]="DIV_OP",e["POWER_OP"]="POWER_OP",e["FUNCTION_CALL"]="FUNCTION_CALL",e["NAMED_EXPRESSION"]="NAMED_EXPRESSION",e["PARENTHESIS"]="PARENTHESES",e["CELL_REFERENCE"]="CELL_REFERENCE",e["CELL_RANGE"]="CELL_RANGE",e["COLUMN_RANGE"]="COLUMN_RANGE",e["ROW_RANGE"]="ROW_RANGE",e["ERROR"]="ERROR",e["ERROR_WITH_RAW_INPUT"]="ERROR_WITH_RAW_INPUT",e["ARRAY"]="ARRAY"}(G||(G={})),function(e){e[e["RELATIVE"]=0]="RELATIVE",e[e["START_ABSOLUTE"]=1]="START_ABSOLUTE",e[e["BOTH_ABSOLUTE"]=2]="BOTH_ABSOLUTE"}(z||(z={}));const Y=e=>({type:G.EMPTY,leadingWhitespace:null===e||void 0===e?void 0:e.image}),X=(e,t)=>({type:G.NUMBER,value:e,leadingWhitespace:null===t||void 0===t?void 0:t.image}),K=e=>{var t;return{type:G.STRING,value:e.image.slice(1,-1),leadingWhitespace:null===(t=e.leadingWhitespace)||void 0===t?void 0:t.image}},$=(e,t)=>({type:G.CELL_REFERENCE,reference:e,leadingWhitespace:null===t||void 0===t?void 0:t.image}),q=(e,t,n,r)=>(Ee(e,t,n),{type:G.CELL_RANGE,start:e,end:t,sheetReferenceType:n,leadingWhitespace:r}),Q=(e,t,n,r)=>(Ee(e,t,n),{type:G.COLUMN_RANGE,start:e,end:t,sheetReferenceType:n,leadingWhitespace:null===r||void 0===r?void 0:r.image}),Z=(e,t,n,r)=>(Ee(e,t,n),{type:G.ROW_RANGE,start:e,end:t,sheetReferenceType:n,leadingWhitespace:null===r||void 0===r?void 0:r.image}),J=(e,t,n)=>({type:G.CONCATENATE_OP,left:e,right:t,leadingWhitespace:null===n||void 0===n?void 0:n.image}),ee=(e,t,n)=>({type:G.EQUALS_OP,left:e,right:t,leadingWhitespace:null===n||void 0===n?void 0:n.image}),te=(e,t,n)=>({type:G.NOT_EQUAL_OP,left:e,right:t,leadingWhitespace:null===n||void 0===n?void 0:n.image}),ne=(e,t,n)=>({type:G.GREATER_THAN_OP,left:e,right:t,leadingWhitespace:null===n||void 0===n?void 0:n.image}),re=(e,t,n)=>({type:G.LESS_THAN_OP,left:e,right:t,leadingWhitespace:null===n||void 0===n?void 0:n.image}),ie=(e,t,n)=>({type:G.GREATER_THAN_OR_EQUAL_OP,left:e,right:t,leadingWhitespace:null===n||void 0===n?void 0:n.image}),oe=(e,t,n)=>({type:G.LESS_THAN_OR_EQUAL_OP,left:e,right:t,leadingWhitespace:null===n||void 0===n?void 0:n.image}),se=(e,t,n)=>({type:G.PLUS_OP,left:e,right:t,leadingWhitespace:null===n||void 0===n?void 0:n.image}),ae=(e,t,n)=>({type:G.MINUS_OP,left:e,right:t,leadingWhitespace:null===n||void 0===n?void 0:n.image}),le=(e,t,n)=>({type:G.TIMES_OP,left:e,right:t,leadingWhitespace:null===n||void 0===n?void 0:n.image}),ce=(e,t,n)=>({type:G.DIV_OP,left:e,right:t,leadingWhitespace:null===n||void 0===n?void 0:n.image}),he=(e,t,n)=>({type:G.POWER_OP,left:e,right:t,leadingWhitespace:null===n||void 0===n?void 0:n.image}),ue=(e,t)=>({type:G.MINUS_UNARY_OP,value:e,leadingWhitespace:null===t||void 0===t?void 0:t.image}),de=(e,t)=>({type:G.PLUS_UNARY_OP,value:e,leadingWhitespace:null===t||void 0===t?void 0:t.image}),pe=(e,t)=>({type:G.PERCENT_OP,value:e,leadingWhitespace:null===t||void 0===t?void 0:t.image}),fe=(e,t,n,r,i)=>({type:G.FUNCTION_CALL,procedureName:e,args:t,leadingWhitespace:null===n||void 0===n?void 0:n.image,internalWhitespace:null===r||void 0===r?void 0:r.image,hyperlink:i}),ge=(e,t,n)=>({type:G.ARRAY,args:e,leadingWhitespace:null===t||void 0===t?void 0:t.image,internalWhitespace:null===n||void 0===n?void 0:n.image}),me=(e,t)=>({type:G.NAMED_EXPRESSION,expressionName:e,leadingWhitespace:null===t||void 0===t?void 0:t.image}),ye=(e,t,n)=>({type:G.PARENTHESIS,expression:e,leadingWhitespace:null===t||void 0===t?void 0:t.image,internalWhitespace:null===n||void 0===n?void 0:n.image}),we=(e,t)=>({type:G.ERROR,error:e,leadingWhitespace:null===t||void 0===t?void 0:t.image}),be=(e,t,n)=>({type:G.ERROR_WITH_RAW_INPUT,error:t,rawInput:e,leadingWhitespace:null===n||void 0===n?void 0:n.image}),ve=()=>({type:G.ERROR,error:lr.parsingError()});function Ee(e,t,n){if(void 0!==e.sheet&&void 0===t.sheet||void 0===e.sheet&&void 0!==t.sheet)throw new Error("Start address inconsistent with end address");if(void 0===e.sheet&&n!==z.RELATIVE||void 0!==e.sheet&&n===z.RELATIVE)throw new Error("Sheet address inconsistent with sheet reference type")}function Ce(e,t){return(null!==t&&void 0!==t?t:"")+e}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */const Se={[G.PLUS_OP]:"+",[G.MINUS_OP]:"-",[G.TIMES_OP]:"*",[G.DIV_OP]:"/",[G.CONCATENATE_OP]:"&",[G.POWER_OP]:"^",[G.EQUALS_OP]:"=",[G.NOT_EQUAL_OP]:"<>",[G.GREATER_THAN_OP]:">",[G.GREATER_THAN_OR_EQUAL_OP]:">=",[G.LESS_THAN_OP]:"<",[G.LESS_THAN_OR_EQUAL_OP]:"<="},Re=(e,t,n,r)=>({ast:e,relativeDependencies:t,hasVolatileFunction:n,hasStructuralChangeFunction:r});
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Te{constructor(e){this.functionRegistry=e,this.cache=new Map}set(e,t){const n=pt(t,this.functionRegistry),r=Re(t,n,Oe(t,this.functionRegistry.isFunctionVolatile),Oe(t,this.functionRegistry.isFunctionDependentOnSheetStructureChange));return this.cache.set(e,r),r}get(e){return this.cache.get(e)}maybeSetAndThenGet(e,t){const n=this.cache.get(e);return void 0!==n?n.ast:(this.set(e,t),t)}}const Oe=(e,t)=>{switch(e.type){case G.EMPTY:case G.NUMBER:case G.STRING:case G.ERROR:case G.ERROR_WITH_RAW_INPUT:case G.CELL_REFERENCE:case G.CELL_RANGE:case G.COLUMN_RANGE:case G.ROW_RANGE:case G.NAMED_EXPRESSION:return!1;case G.PERCENT_OP:case G.PLUS_UNARY_OP:case G.MINUS_UNARY_OP:return Oe(e.value,t);case G.CONCATENATE_OP:case G.EQUALS_OP:case G.NOT_EQUAL_OP:case G.LESS_THAN_OP:case G.GREATER_THAN_OP:case G.LESS_THAN_OR_EQUAL_OP:case G.GREATER_THAN_OR_EQUAL_OP:case G.MINUS_OP:case G.PLUS_OP:case G.TIMES_OP:case G.DIV_OP:case G.POWER_OP:return Oe(e.left,t)||Oe(e.right,t);case G.PARENTHESIS:return Oe(e.expression,t);case G.FUNCTION_CALL:return!!t(e.procedureName)||e.args.some(e=>Oe(e,t));case G.ARRAY:return e.args.some(e=>e.some(e=>Oe(e,t)))}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Ne{}Ne.DistinctSigns="Distinct signs.",Ne.WrongArgNumber="Wrong number of arguments.",Ne.EmptyArg="Empty function argument.",Ne.EmptyArray="Empty array not allowed.",Ne.ArrayDimensions="Array dimensions are not compatible.",Ne.NoSpaceForArrayResult="No space for array result.",Ne.ValueSmall="Value too small.",Ne.ValueLarge="Value too large.",Ne.BadCriterion="Incorrect criterion.",Ne.RangeManySheets="Range spans more than one sheet.",Ne.CellRangeExpected="Cell range expected.",Ne.WrongDimension="Wrong range dimension.",Ne.ScalarExpected="Cell range not allowed.",Ne.NumberCoercion="Value cannot be coerced to number.",Ne.NumberExpected="Number argument expected.",Ne.IntegerExpected="Value needs to be an integer.",Ne.BadMode="Mode not recognized.",Ne.DateBounds="Date outside of bounds.",Ne.OutOfSheet="Resulting reference is out of the sheet.",Ne.WrongType="Wrong type of argument.",Ne.NaN="NaN or infinite value encountered.",Ne.EqualLength="Ranges need to be of equal length.",Ne.Negative="Value cannot be negative.",Ne.NotBinary="String does not represent a binary number.",Ne.NotOctal="String does not represent an octal number.",Ne.NotHex="String does not represent a hexadecimal number.",Ne.EndStartPeriod="End period needs to be at least start period.",Ne.CellRefExpected="Cell reference expected.",Ne.EmptyRange="Empty range not allowed.",Ne.BadRef="Address is not correct.",Ne.NumberRange="Number-only range expected.",Ne.ValueNotFound="Value not found.",Ne.ValueBaseLarge="Value in base too large.",Ne.ValueBaseSmall="Value in base too small.",Ne.ValueBaseLong="Value in base too long.",Ne.NegativeLength="Length cannot be negative.",Ne.PatternNotFound="Pattern not found.",Ne.OneValue="Needs at least one value.",Ne.TwoValues="Range needs to contain at least two elements.",Ne.ThreeValues="Range needs to contain at least three elements.",Ne.IndexBounds="Index out of bounds.",Ne.IndexLarge="Index too large.",Ne.Formula="Expected formula.",Ne.NegativeCount="Count cannot be negative.",Ne.ParseError="Parsing error.",Ne.SheetRef="Sheet does not exist.",Ne.PeriodLong="Period number cannot exceed life length.",Ne.InvalidDate="Invalid date.",Ne.BitshiftLong="Result of bitshift is too long.",Ne.EmptyString="Empty-string argument not allowed.",Ne.LengthBounds="Length out of bounds.",Ne.NegativeTime="Time cannot be negative.",Ne.NoDefault="No default option.",Ne.NoConditionMet="None of the conditions were met.",Ne.Selector="Selector cannot exceed the number of arguments.",Ne.StartEndDate="Start date needs to be earlier than end date.",Ne.IncorrectDateTime="String does not represent correct DateTime.",Ne.CharacterCodeBounds="Character code out of bounds.",Ne.NonZero="Argument cannot be 0.",Ne.LessThanOne="Argument cannot be less than 1.",Ne.WeekendString="Incorrect weekend bitmask string.",Ne.InvalidRoman="Invalid roman numeral.",Ne.WrongOrder="Wrong order of values.",Ne.ComplexNumberExpected="Complex number expected.",Ne.ShouldBeIorJ="Should be 'i' or 'j'.",Ne.SizeMismatch="Array dimensions mismatched.",Ne.FunctionName=e=>`Function name ${e} not recognized.`,Ne.NamedExpressionName=e=>`Named expression ${e} not recognized.`,Ne.LicenseKey=e=>`License key is ${e}.`
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */;class Ae{constructor(){this.POSSIBLE_START_CHARACTERS=[...T,...R,h,"'","_"],this.cellReferenceRegexp=new RegExp(C,"y")}match(e,t){this.cellReferenceRegexp.lastIndex=t;const n=this.cellReferenceRegexp.exec(e+"@");return null==n||null==n[1]?null:(n[0]=n[1],n)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Ie{constructor(){this.POSSIBLE_START_CHARACTERS=[...T,"_"],this.namedExpressionRegexp=new RegExp(S,"y"),this.r1c1CellRefRegexp=new RegExp(`^${E}$`)}match(e,t){this.namedExpressionRegexp.lastIndex=t;const n=this.namedExpressionRegexp.exec(e);return null==n||null==n[0]||this.r1c1CellRefRegexp.test(n[0])?null:n}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */const Me=Object(V["createToken"])({name:"AdditionOp",pattern:V["Lexer"].NA}),xe=Object(V["createToken"])({name:"PlusOp",pattern:/\+/,categories:Me}),_e=Object(V["createToken"])({name:"MinusOp",pattern:/-/,categories:Me}),Le=Object(V["createToken"])({name:"MultiplicationOp",pattern:V["Lexer"].NA}),Pe=Object(V["createToken"])({name:"TimesOp",pattern:/\*/,categories:Le}),ke=Object(V["createToken"])({name:"DivOp",pattern:/\//,categories:Le}),je=Object(V["createToken"])({name:"PowerOp",pattern:/\^/}),He=Object(V["createToken"])({name:"PercentOp",pattern:/%/}),De=Object(V["createToken"])({name:"BooleanOp",pattern:V["Lexer"].NA}),Fe=Object(V["createToken"])({name:"EqualsOp",pattern:/=/,categories:De}),Ue=Object(V["createToken"])({name:"NotEqualOp",pattern:/<>/,categories:De}),Ve=Object(V["createToken"])({name:"GreaterThanOp",pattern:/>/,categories:De}),Be=Object(V["createToken"])({name:"LessThanOp",pattern:/</,categories:De}),We=Object(V["createToken"])({name:"GreaterThanOrEqualOp",pattern:/>=/,categories:De}),Ge=Object(V["createToken"])({name:"LessThanOrEqualOp",pattern:/<=/,categories:De}),ze=Object(V["createToken"])({name:"ConcatenateOp",pattern:/&/}),Ye=Object(V["createToken"])({name:"LParen",pattern:/\(/}),Xe=Object(V["createToken"])({name:"RParen",pattern:/\)/}),Ke=Object(V["createToken"])({name:"ArrayLParen",pattern:/{/}),$e=Object(V["createToken"])({name:"ArrayRParen",pattern:/}/}),qe=Object(V["createToken"])({name:"StringLiteral",pattern:/"([^"\\]*(\\.[^"\\]*)*)"/}),Qe=Object(V["createToken"])({name:"ErrorLiteral",pattern:/#[A-Za-z0-9\/]+[?!]?/}),Ze=Object(V["createToken"])({name:"RangeSeparator",pattern:new RegExp(c)}),Je=Object(V["createToken"])({name:"ColumnRange",pattern:new RegExp(`${b}${c}${b}`)}),et=Object(V["createToken"])({name:"RowRange",pattern:new RegExp(`${v}${c}${v}`)}),tt=Object(V["createToken"])({name:"ProcedureName",pattern:new RegExp(`([${p}][${f}]*)\\(`)}),nt=new Ae,rt=Object(V["createToken"])({name:"CellReference",pattern:nt.match.bind(nt),start_chars_hint:nt.POSSIBLE_START_CHARACTERS,line_breaks:!1}),it=new Ie,ot=Object(V["createToken"])({name:"NamedExpression",pattern:it.match.bind(it),start_chars_hint:it.POSSIBLE_START_CHARACTERS,line_breaks:!1}),st=e=>{const t=e.translationPackage.getFunctionTranslation("OFFSET"),n=e.errorMapping,r=e.translationPackage.buildFunctionMapping(),i=new RegExp("standard"===e.ignoreWhiteSpace?d:u),o=Object(V["createToken"])({name:"WhiteSpace",pattern:i}),s=Object(V["createToken"])({name:"ArrayRowSep",pattern:e.arrayRowSeparator}),a=Object(V["createToken"])({name:"ArrayColSep",pattern:e.arrayColumnSeparator}),l=Object(V["createToken"])({name:"NumberLiteral",pattern:new RegExp(`(([${e.decimalSeparator}]\\d+)|(\\d+([${e.decimalSeparator}]\\d*)?))(e[+-]?\\d+)?`)}),c=Object(V["createToken"])({name:"OffsetProcedureName",pattern:new RegExp(t,"i")});let h,p;e.functionArgSeparator===e.arrayColumnSeparator?(h=a,p=[]):e.functionArgSeparator===e.arrayRowSeparator?(h=s,p=[]):(h=Object(V["createToken"])({name:"ArgSeparator",pattern:e.functionArgSeparator}),p=[h]);const f=[o,xe,_e,Pe,ke,je,Fe,Ue,He,We,Ge,Ve,Be,Ye,Xe,Ke,$e,c,tt,Ze,...p,Je,et,l,qe,Qe,ze,De,Me,Le,rt,ot,s,a];return{ArgSeparator:h,NumberLiteral:l,OffsetProcedureName:c,ArrayRowSeparator:s,ArrayColSeparator:a,WhiteSpace:o,allTokens:f,errorMapping:n,functionMapping:r,decimalSeparator:e.decimalSeparator,maxColumns:e.maxColumns,maxRows:e.maxRows}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class at extends V["EmbeddedActionsParser"]{constructor(e,t){super(e.allTokens,{outputCst:!1,maxLookahead:7}),this.booleanExpressionOrEmpty=this.RULE("booleanExpressionOrEmpty",()=>this.OR([{ALT:()=>this.SUBRULE(this.booleanExpression)},{ALT:Object(V["EMPTY_ALT"])(Y())}])),this.procedureExpression=this.RULE("procedureExpression",()=>{var e;const t=this.CONSUME(tt),n=t.image.toUpperCase().slice(0,-1),r=null!==(e=this.lexerConfig.functionMapping[n])&&void 0!==e?e:n,i=[];let o=this.SUBRULE(this.booleanExpressionOrEmpty);this.MANY(()=>{var e;const t=this.CONSUME(this.lexerConfig.ArgSeparator);o.type===G.EMPTY&&(o.leadingWhitespace=null===(e=t.leadingWhitespace)||void 0===e?void 0:e.image),i.push(o),o=this.SUBRULE2(this.booleanExpressionOrEmpty)}),i.push(o),1===i.length&&i[0].type===G.EMPTY&&(i.length=0);const s=this.CONSUME(Xe);return fe(r,i,t.leadingWhitespace,s.leadingWhitespace)}),this.namedExpressionExpression=this.RULE("namedExpressionExpression",()=>{const e=this.CONSUME(ot);return me(e.image,e.leadingWhitespace)}),this.offsetProcedureExpression=this.RULE("offsetProcedureExpression",()=>{const e=[];return this.CONSUME(this.lexerConfig.OffsetProcedureName),this.CONSUME(Ye),this.MANY_SEP({SEP:this.lexerConfig.ArgSeparator,DEF:()=>{e.push(this.SUBRULE(this.booleanExpression))}}),this.CONSUME(Xe),this.handleOffsetHeuristic(e)}),this.columnRangeExpression=this.RULE("columnRangeExpression",()=>{const e=this.CONSUME(Je),[t,n]=e.image.split(":"),r=this.ACTION(()=>x(this.sheetMapping,t,this.formulaAddress)),i=this.ACTION(()=>x(this.sheetMapping,n,this.formulaAddress));if(void 0===r||void 0===i)return we(new lr(Bn.REF));if(r.exceedsSheetSizeLimits(this.lexerConfig.maxColumns)||i.exceedsSheetSizeLimits(this.lexerConfig.maxColumns))return be(e.image,new lr(Bn.NAME),e.leadingWhitespace);if(void 0===r.sheet&&void 0!==i.sheet)return this.parsingError(W.ParserError,"Malformed range expression");const{firstEnd:o,secondEnd:s,sheetRefType:a}=at.fixSheetIdsForRangeEnds(r,i);return Q(o,s,a,e.leadingWhitespace)}),this.rowRangeExpression=this.RULE("rowRangeExpression",()=>{const e=this.CONSUME(et),[t,n]=e.image.split(":"),r=this.ACTION(()=>_(this.sheetMapping,t,this.formulaAddress)),i=this.ACTION(()=>_(this.sheetMapping,n,this.formulaAddress));if(void 0===r||void 0===i)return we(new lr(Bn.REF));if(r.exceedsSheetSizeLimits(this.lexerConfig.maxRows)||i.exceedsSheetSizeLimits(this.lexerConfig.maxRows))return be(e.image,new lr(Bn.NAME),e.leadingWhitespace);if(void 0===r.sheet&&void 0!==i.sheet)return this.parsingError(W.ParserError,"Malformed range expression");const{firstEnd:o,secondEnd:s,sheetRefType:a}=at.fixSheetIdsForRangeEnds(r,i);return Z(o,s,a,e.leadingWhitespace)}),this.cellReference=this.RULE("cellReference",()=>{const e=this.CONSUME(rt),t=this.ACTION(()=>M(this.sheetMapping,e.image,this.formulaAddress));return void 0===t?be(e.image,new lr(Bn.REF),e.leadingWhitespace):t.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)?be(e.image,new lr(Bn.NAME),e.leadingWhitespace):$(t,e.leadingWhitespace)}),this.endRangeReference=this.RULE("endRangeReference",e=>{var t;const n=this.CONSUME(rt),r=this.ACTION(()=>M(this.sheetMapping,e.image,this.formulaAddress)),i=this.ACTION(()=>M(this.sheetMapping,n.image,this.formulaAddress));return void 0===r||void 0===i?this.ACTION(()=>be(`${e.image}:${n.image}`,new lr(Bn.REF),e.leadingWhitespace)):r.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)||i.exceedsSheetSizeLimits(this.lexerConfig.maxColumns,this.lexerConfig.maxRows)?this.ACTION(()=>be(`${e.image}:${n.image}`,new lr(Bn.NAME),e.leadingWhitespace)):this.buildCellRange(r,i,null===(t=e.leadingWhitespace)||void 0===t?void 0:t.image)}),this.endOfRangeExpression=this.RULE("endOfRangeExpression",e=>this.OR([{ALT:()=>this.SUBRULE(this.endRangeReference,{ARGS:[e]})},{ALT:()=>{var t;const n=this.SUBRULE(this.offsetProcedureExpression),r=this.ACTION(()=>M(this.sheetMapping,e.image,this.formulaAddress));return void 0===r?we(new lr(Bn.REF)):n.type===G.CELL_REFERENCE?this.buildCellRange(r,n.reference,null===(t=e.leadingWhitespace)||void 0===t?void 0:t.image):this.parsingError(W.RangeOffsetNotAllowed,"Range offset not allowed here")}}])),this.cellRangeExpression=this.RULE("cellRangeExpression",()=>{const e=this.CONSUME(rt);return this.CONSUME2(Ze),this.SUBRULE(this.endOfRangeExpression,{ARGS:[e]})}),this.endRangeWithOffsetStartReference=this.RULE("endRangeWithOffsetStartReference",e=>{const t=this.CONSUME(rt),n=this.ACTION(()=>M(this.sheetMapping,t.image,this.formulaAddress));return void 0===n?this.ACTION(()=>we(new lr(Bn.REF))):this.buildCellRange(e.reference,n,e.leadingWhitespace)}),this.endOfRangeWithOffsetStartExpression=this.RULE("endOfRangeWithOffsetStartExpression",e=>this.OR([{ALT:()=>this.SUBRULE(this.endRangeWithOffsetStartReference,{ARGS:[e]})},{ALT:()=>{const t=this.SUBRULE(this.offsetProcedureExpression);return t.type===G.CELL_REFERENCE?this.buildCellRange(e.reference,t.reference,e.leadingWhitespace):this.parsingError(W.RangeOffsetNotAllowed,"Range offset not allowed here")}}])),this.offsetExpression=this.RULE("offsetExpression",()=>{const e=this.SUBRULE(this.offsetProcedureExpression);let t;return this.OPTION(()=>{this.CONSUME(Ze),t=e.type===G.CELL_RANGE?this.parsingError(W.RangeOffsetNotAllowed,"Range offset not allowed here"):this.SUBRULE(this.endOfRangeWithOffsetStartExpression,{ARGS:[e]})}),void 0!==t?t:e}),this.insideArrayExpression=this.RULE("insideArrayExpression",()=>{const e=[[]];return e[e.length-1].push(this.SUBRULE(this.booleanExpression)),this.MANY(()=>{this.OR([{ALT:()=>{this.CONSUME(this.lexerConfig.ArrayColSeparator),e[e.length-1].push(this.SUBRULE2(this.booleanExpression))}},{ALT:()=>{this.CONSUME(this.lexerConfig.ArrayRowSeparator),e.push([]),e[e.length-1].push(this.SUBRULE3(this.booleanExpression))}}])}),ge(e)}),this.parenthesisExpression=this.RULE("parenthesisExpression",()=>{const e=this.CONSUME(Ye),t=this.SUBRULE(this.booleanExpression),n=this.CONSUME(Xe);return ye(t,e.leadingWhitespace,n.leadingWhitespace)}),this.arrayExpression=this.RULE("arrayExpression",()=>this.OR([{ALT:()=>{const e=this.CONSUME(Ke),t=this.SUBRULE(this.insideArrayExpression),n=this.CONSUME($e);return ge(t.args,e.leadingWhitespace,n.leadingWhitespace)}},{ALT:()=>this.SUBRULE(this.parenthesisExpression)}])),this.numericStringToNumber=e=>{const t=e.replace(this.lexerConfig.decimalSeparator,".");return Number(t)},this.positiveAtomicExpression=this.RULE("positiveAtomicExpression",()=>{var e;return this.OR(null!==(e=this.atomicExpCache)&&void 0!==e?e:this.atomicExpCache=[{ALT:()=>this.SUBRULE(this.arrayExpression)},{ALT:()=>this.SUBRULE(this.cellRangeExpression)},{ALT:()=>this.SUBRULE(this.columnRangeExpression)},{ALT:()=>this.SUBRULE(this.rowRangeExpression)},{ALT:()=>this.SUBRULE(this.offsetExpression)},{ALT:()=>this.SUBRULE(this.cellReference)},{ALT:()=>this.SUBRULE(this.procedureExpression)},{ALT:()=>this.SUBRULE(this.namedExpressionExpression)},{ALT:()=>{const e=this.CONSUME(this.lexerConfig.NumberLiteral);return X(this.numericStringToNumber(e.image),e.leadingWhitespace)}},{ALT:()=>{const e=this.CONSUME(qe);return K(e)}},{ALT:()=>{const e=this.CONSUME(Qe),t=e.image.toUpperCase(),n=this.lexerConfig.errorMapping[t];return n?we(new lr(n),e.leadingWhitespace):this.parsingError(W.ParserError,"Unknown error literal")}}])}),this.rightUnaryOpAtomicExpression=this.RULE("rightUnaryOpAtomicExpression",()=>{const e=this.SUBRULE(this.positiveAtomicExpression),t=this.OPTION(()=>this.CONSUME(He));return t?pe(e,t.leadingWhitespace):e}),this.atomicExpression=this.RULE("atomicExpression",()=>this.OR([{ALT:()=>{const e=this.CONSUME(Me),t=this.SUBRULE(this.atomicExpression);return Object(V["tokenMatcher"])(e,xe)?de(t,e.leadingWhitespace):Object(V["tokenMatcher"])(e,_e)?ue(t,e.leadingWhitespace):(this.customParsingError=B(W.ParserError,"Mismatched token type"),this.customParsingError)}},{ALT:()=>this.SUBRULE2(this.rightUnaryOpAtomicExpression)}])),this.powerExpression=this.RULE("powerExpression",()=>{let e=this.SUBRULE(this.atomicExpression);return this.MANY(()=>{const t=this.CONSUME(je),n=this.SUBRULE2(this.atomicExpression);Object(V["tokenMatcher"])(t,je)?e=he(e,n,t.leadingWhitespace):this.ACTION(()=>{throw Error("Operator not supported")})}),e}),this.multiplicationExpression=this.RULE("multiplicationExpression",()=>{let e=this.SUBRULE(this.powerExpression);return this.MANY(()=>{const t=this.CONSUME(Le),n=this.SUBRULE2(this.powerExpression);Object(V["tokenMatcher"])(t,Pe)?e=le(e,n,t.leadingWhitespace):Object(V["tokenMatcher"])(t,ke)?e=ce(e,n,t.leadingWhitespace):this.ACTION(()=>{throw Error("Operator not supported")})}),e}),this.additionExpression=this.RULE("additionExpression",()=>{let e=this.SUBRULE(this.multiplicationExpression);return this.MANY(()=>{const t=this.CONSUME(Me),n=this.SUBRULE2(this.multiplicationExpression);Object(V["tokenMatcher"])(t,xe)?e=se(e,n,t.leadingWhitespace):Object(V["tokenMatcher"])(t,_e)?e=ae(e,n,t.leadingWhitespace):this.ACTION(()=>{throw Error("Operator not supported")})}),e}),this.concatenateExpression=this.RULE("concatenateExpression",()=>{let e=this.SUBRULE(this.additionExpression);return this.MANY(()=>{const t=this.CONSUME(ze),n=this.SUBRULE2(this.additionExpression);e=J(e,n,t.leadingWhitespace)}),e}),this.booleanExpression=this.RULE("booleanExpression",()=>{let e=this.SUBRULE(this.concatenateExpression);return this.MANY(()=>{const t=this.CONSUME(De),n=this.SUBRULE2(this.concatenateExpression);Object(V["tokenMatcher"])(t,Fe)?e=ee(e,n,t.leadingWhitespace):Object(V["tokenMatcher"])(t,Ue)?e=te(e,n,t.leadingWhitespace):Object(V["tokenMatcher"])(t,Ve)?e=ne(e,n,t.leadingWhitespace):Object(V["tokenMatcher"])(t,Be)?e=re(e,n,t.leadingWhitespace):Object(V["tokenMatcher"])(t,We)?e=ie(e,n,t.leadingWhitespace):Object(V["tokenMatcher"])(t,Ge)?e=oe(e,n,t.leadingWhitespace):this.ACTION(()=>{throw Error("Operator not supported")})}),e}),this.formula=this.RULE("formula",()=>(this.CONSUME(Fe),this.SUBRULE(this.booleanExpression))),this.lexerConfig=e,this.sheetMapping=t,this.formulaAddress=pr(0,0,0),this.performSelfAnalysis()}parseFromTokens(e,t){this.input=e;let n=this.formulaWithContext(t),r=[];return this.customParsingError&&r.push(this.customParsingError),r=r.concat(this.errors.map(e=>({type:W.ParserError,message:e.message}))),r.length>0&&(n=ve()),{ast:n,errors:r}}reset(){super.reset(),this.customParsingError=void 0}formulaWithContext(e){return this.formulaAddress=e,this.formula()}buildCellRange(e,t,n){if(void 0===e.sheet&&void 0!==t.sheet)return this.parsingError(W.ParserError,"Malformed range expression");const{firstEnd:r,secondEnd:i,sheetRefType:o}=at.fixSheetIdsForRangeEnds(e,t);return q(r,i,o,n)}static fixSheetIdsForRangeEnds(e,t){const n=at.rangeSheetReferenceType(e.sheet,t.sheet),r=void 0!==e.sheet&&void 0===t.sheet?t.withSheet(e.sheet):t;return{firstEnd:e,secondEnd:r,sheetRefType:n}}handleOffsetHeuristic(e){const t=e[0];if(t.type!==G.CELL_REFERENCE)return this.parsingError(W.StaticOffsetError,"First argument to OFFSET is not a reference");const n=e[1];let r;if(n.type===G.NUMBER&&Number.isInteger(n.value))r=n.value;else if(n.type===G.PLUS_UNARY_OP&&n.value.type===G.NUMBER&&Number.isInteger(n.value.value))r=n.value.value;else{if(n.type!==G.MINUS_UNARY_OP||n.value.type!==G.NUMBER||!Number.isInteger(n.value.value))return this.parsingError(W.StaticOffsetError,"Second argument to OFFSET is not a static number");r=-n.value.value}const o=e[2];let s;if(o.type===G.NUMBER&&Number.isInteger(o.value))s=o.value;else if(o.type===G.PLUS_UNARY_OP&&o.value.type===G.NUMBER&&Number.isInteger(o.value.value))s=o.value.value;else{if(o.type!==G.MINUS_UNARY_OP||o.value.type!==G.NUMBER||!Number.isInteger(o.value.value))return this.parsingError(W.StaticOffsetError,"Third argument to OFFSET is not a static number");s=-o.value.value}const a=e[3];let c;if(void 0===a)c=1;else{if(a.type!==G.NUMBER)return this.parsingError(W.StaticOffsetError,"Fourth argument to OFFSET is not a static number");if(c=a.value,c<1)return this.parsingError(W.StaticOffsetError,"Fourth argument to OFFSET is too small number");if(!Number.isInteger(c))return this.parsingError(W.StaticOffsetError,"Fourth argument to OFFSET is not integer")}const h=e[4];let u;if(void 0===h)u=1;else{if(h.type!==G.NUMBER)return this.parsingError(W.StaticOffsetError,"Fifth argument to OFFSET is not a static number");if(u=h.value,u<1)return this.parsingError(W.StaticOffsetError,"Fifth argument to OFFSET is too small number");if(!Number.isInteger(u))return this.parsingError(W.StaticOffsetError,"Fifth argument to OFFSET is not integer")}const d=new l(t.reference.col+s,t.reference.row+r,t.reference.type);let p=d.col,f=d.row;if(t.reference.type!==i.CELL_REFERENCE_RELATIVE&&t.reference.type!==i.CELL_REFERENCE_ABSOLUTE_COL||(f+=this.formulaAddress.row),t.reference.type!==i.CELL_REFERENCE_RELATIVE&&t.reference.type!==i.CELL_REFERENCE_ABSOLUTE_ROW||(p+=this.formulaAddress.col),p<0||f<0)return we(new lr(Bn.REF,Ne.OutOfSheet));if(1===u&&1===c)return $(d);{const e=new l(d.col+u-1,d.row+c-1,d.type);return q(d,e,z.RELATIVE)}}parsingError(e,t){return this.customParsingError=B(e,t),ve()}static rangeSheetReferenceType(e,t){return void 0===e?z.RELATIVE:void 0===t?z.START_ABSOLUTE:z.BOTH_ABSOLUTE}}class lt{constructor(e){this.lexerConfig=e,this.lexer=new V["Lexer"](e.allTokens,{ensureOptimizations:!0})}tokenizeFormula(e){const t=this.lexer.tokenize(e);let n=t.tokens;return n=this.trimTrailingWhitespaces(n),n=this.skipWhitespacesInsideRanges(n),n=this.skipWhitespacesBeforeArgSeparators(n),t.tokens=n,t}skipWhitespacesInsideRanges(e){return lt.filterTokensByNeighbors(e,(e,t,n)=>(Object(V["tokenMatcher"])(e,rt)||Object(V["tokenMatcher"])(e,Ze))&&Object(V["tokenMatcher"])(t,this.lexerConfig.WhiteSpace)&&(Object(V["tokenMatcher"])(n,rt)||Object(V["tokenMatcher"])(n,Ze)))}skipWhitespacesBeforeArgSeparators(e){return lt.filterTokensByNeighbors(e,(e,t,n)=>!Object(V["tokenMatcher"])(e,this.lexerConfig.ArgSeparator)&&Object(V["tokenMatcher"])(t,this.lexerConfig.WhiteSpace)&&Object(V["tokenMatcher"])(n,this.lexerConfig.ArgSeparator))}static filterTokensByNeighbors(e,t){if(e.length<3)return e;let n=0;const r=[e[n++]];while(n<e.length-1)t(e[n-1],e[n],e[n+1])||r.push(e[n]),++n;return r.push(e[n]),r}trimTrailingWhitespaces(e){return e.length>0&&Object(V["tokenMatcher"])(e[e.length-1],this.lexerConfig.WhiteSpace)&&e.pop(),e}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class ct{constructor(e,t,n,r){this.config=e,this.lexerConfig=t,this.sheetMappingFn=n,this.namedExpressions=r}unparse(e,t){return"="+this.unparseAst(e,t)}unparseAst(e,t){var n,r;switch(e.type){case G.EMPTY:return Ce("",e.leadingWhitespace);case G.NUMBER:return Ce(ht(e.value,this.config.decimalSeparator),e.leadingWhitespace);case G.STRING:return Ce('"'+e.value+'"',e.leadingWhitespace);case G.FUNCTION_CALL:{const n=e.args.map(e=>void 0!==e?this.unparseAst(e,t):"").join(this.config.functionArgSeparator),r=this.config.translationPackage.isFunctionTranslated(e.procedureName)?this.config.translationPackage.getFunctionTranslation(e.procedureName):e.procedureName,i=r+"("+n+Ce(")",e.internalWhitespace);return Ce(i,e.leadingWhitespace)}case G.NAMED_EXPRESSION:{const r=null===(n=this.namedExpressions.nearestNamedExpression(e.expressionName,t.sheet))||void 0===n?void 0:n.displayName;return Ce(r||e.expressionName,e.leadingWhitespace)}case G.CELL_REFERENCE:{let n;return n=void 0!==e.reference.sheet?this.unparseSheetName(e.reference.sheet)+"!":"",n+=null!==(r=e.reference.unparse(t))&&void 0!==r?r:this.config.translationPackage.getErrorTranslation(Bn.REF),Ce(n,e.leadingWhitespace)}case G.COLUMN_RANGE:case G.ROW_RANGE:case G.CELL_RANGE:return Ce(this.formatRange(e,t),e.leadingWhitespace);case G.PLUS_UNARY_OP:{const n=this.unparseAst(e.value,t);return Ce("+",e.leadingWhitespace)+n}case G.MINUS_UNARY_OP:{const n=this.unparseAst(e.value,t);return Ce("-",e.leadingWhitespace)+n}case G.PERCENT_OP:return this.unparseAst(e.value,t)+Ce("%",e.leadingWhitespace);case G.ERROR:{const t=this.config.translationPackage.getErrorTranslation(e.error?e.error.type:Bn.ERROR);return Ce(t,e.leadingWhitespace)}case G.ERROR_WITH_RAW_INPUT:return Ce(e.rawInput,e.leadingWhitespace);case G.PARENTHESIS:{const n=this.unparseAst(e.expression,t),r="("+n+Ce(")",e.internalWhitespace);return Ce(r,e.leadingWhitespace)}case G.ARRAY:{const n="{"+e.args.map(e=>e.map(e=>this.unparseAst(e,t)).join(this.config.arrayColumnSeparator)).join(this.config.arrayRowSeparator)+Ce("}",e.internalWhitespace);return Ce(n,e.leadingWhitespace)}default:{const n=this.unparseAst(e.left,t),r=this.unparseAst(e.right,t);return n+Ce(Se[e.type],e.leadingWhitespace)+r}}}unparseSheetName(e){const t=F(e,this.sheetMappingFn);if(void 0===t)throw new Bt(e);return t}formatRange(e,t){let n="",r="";void 0!==e.start.sheet&&e.sheetReferenceType!==z.RELATIVE&&(n=this.unparseSheetName(e.start.sheet)+"!"),void 0!==e.end.sheet&&e.sheetReferenceType===z.BOTH_ABSOLUTE&&(r=this.unparseSheetName(e.end.sheet)+"!");const i=e.start.unparse(t),o=e.end.unparse(t);return void 0===i||void 0===o?this.config.translationPackage.getErrorTranslation(Bn.REF):`${n}${i}:${r}${o}`}}function ht(e,t){const n=e.toString();return n.replace(".",t)}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class ut{constructor(e,t,n){this.config=e,this.functionRegistry=t,this.sheetMapping=n,this.statsCacheUsed=0,this.lexerConfig=st(e),this.lexer=new lt(this.lexerConfig),this.formulaParser=new at(this.lexerConfig,this.sheetMapping),this.cache=new Te(this.functionRegistry)}parse(e,t){this.formulaAddress=t;const n=this.tokenizeFormula(e);if(n.errors.length>0){const e=n.errors.map(e=>({type:W.LexingError,message:e.message}));return{ast:ve(),errors:e,hasVolatileFunction:!1,hasStructuralChangeFunction:!1,dependencies:[]}}const r=this.computeHashFromTokens(n.tokens,t);let i=this.cache.get(r);if(void 0!==i)++this.statsCacheUsed;else{const e=this.bindWhitespacesToTokens(n.tokens),o=this.formulaParser.parseFromTokens(e,t);if(o.errors.length>0)return Object.assign(Object.assign({},o),{hasVolatileFunction:!1,hasStructuralChangeFunction:!1,dependencies:[]});i=this.cache.set(r,o.ast)}const{ast:o,hasVolatileFunction:s,hasStructuralChangeFunction:a}=i,l=this.convertReversedRangesToRegularRanges(o),c=pt(l,this.functionRegistry);return{ast:l,errors:[],hasVolatileFunction:s,hasStructuralChangeFunction:a,dependencies:c}}convertReversedRangesToRegularRanges(e){switch(e.type){case G.EMPTY:case G.NUMBER:case G.STRING:case G.ERROR:case G.ERROR_WITH_RAW_INPUT:case G.CELL_REFERENCE:case G.NAMED_EXPRESSION:return e;case G.CELL_RANGE:{const{start:t,end:n}=e,r=this.orderCellRangeEnds(t,n);return Object.assign(Object.assign({},e),{start:r.start,end:r.end})}case G.COLUMN_RANGE:{const{start:t,end:n}=e,r=this.orderColumnRangeEnds(t,n);return Object.assign(Object.assign({},e),{start:r.start,end:r.end})}case G.ROW_RANGE:{const{start:t,end:n}=e,r=this.orderRowRangeEnds(t,n);return Object.assign(Object.assign({},e),{start:r.start,end:r.end})}case G.PERCENT_OP:case G.PLUS_UNARY_OP:case G.MINUS_UNARY_OP:{const t=this.convertReversedRangesToRegularRanges(e.value);return Object.assign(Object.assign({},e),{value:t})}case G.CONCATENATE_OP:case G.EQUALS_OP:case G.NOT_EQUAL_OP:case G.LESS_THAN_OP:case G.GREATER_THAN_OP:case G.LESS_THAN_OR_EQUAL_OP:case G.GREATER_THAN_OR_EQUAL_OP:case G.MINUS_OP:case G.PLUS_OP:case G.TIMES_OP:case G.DIV_OP:case G.POWER_OP:{const t=this.convertReversedRangesToRegularRanges(e.left),n=this.convertReversedRangesToRegularRanges(e.right);return Object.assign(Object.assign({},e),{left:t,right:n})}case G.PARENTHESIS:{const t=this.convertReversedRangesToRegularRanges(e.expression);return Object.assign(Object.assign({},e),{expression:t})}case G.FUNCTION_CALL:{const t=e.args.map(e=>this.convertReversedRangesToRegularRanges(e));return Object.assign(Object.assign({},e),{args:t})}case G.ARRAY:{const t=e.args.map(e=>e.map(e=>this.convertReversedRangesToRegularRanges(e)));return Object.assign(Object.assign({},e),{args:t})}}}orderCellRangeEnds(e,t){const n=[e,t],[r,i]=n.map(e=>e.toColumnAddress()).sort(s.compareByAbsoluteAddress(this.formulaAddress)),[o,c]=n.map(e=>e.toRowAddress()).sort(a.compareByAbsoluteAddress(this.formulaAddress)),[h,u]=n.map(e=>e.sheet).sort(ut.compareSheetIds.bind(this));return{start:l.fromColAndRow(r,o,h),end:l.fromColAndRow(i,c,u)}}orderColumnRangeEnds(e,t){const n=[e,t],[r,i]=n.sort(s.compareByAbsoluteAddress(this.formulaAddress)),[o,a]=n.map(e=>e.sheet).sort(ut.compareSheetIds.bind(this));return{start:new s(r.type,r.col,o),end:new s(i.type,i.col,a)}}orderRowRangeEnds(e,t){const n=[e,t],[r,i]=n.sort(a.compareByAbsoluteAddress(this.formulaAddress)),[o,s]=n.map(e=>e.sheet).sort(ut.compareSheetIds.bind(this));return{start:new a(r.type,r.row,o),end:new a(i.type,i.row,s)}}static compareSheetIds(e,t){return e=null!=e?e:1/0,t=null!=t?t:1/0,e-t}fetchCachedResultForAst(e){const t=this.computeHashFromAst(e);return this.fetchCachedResult(t)}fetchCachedResult(e){const t=this.cache.get(e);if(void 0===t)throw new Error("There is no AST with such key in the cache");{const{ast:e,hasVolatileFunction:n,hasStructuralChangeFunction:r,relativeDependencies:i}=t;return{ast:e,errors:[],hasVolatileFunction:n,hasStructuralChangeFunction:r,dependencies:i}}}computeHashFromTokens(e,t){var n;let r="",i=0;while(i<e.length){const o=e[i];if(Object(V["tokenMatcher"])(o,rt)){const e=M(this.sheetMapping,o.image,t);r=void 0===e?r.concat(o.image):r.concat(e.hash(!0))}else if(Object(V["tokenMatcher"])(o,tt)){const e=o.image.toUpperCase().slice(0,-1),t=null!==(n=this.lexerConfig.functionMapping[e])&&void 0!==n?n:e;r=r.concat(t,"(")}else if(Object(V["tokenMatcher"])(o,Je)){const[e,n]=o.image.split(":"),i=x(this.sheetMapping,e,t),s=x(this.sheetMapping,n,t);r=void 0===i||void 0===s?r.concat("!REF"):r.concat(i.hash(!0),":",s.hash(!0))}else if(Object(V["tokenMatcher"])(o,et)){const[e,n]=o.image.split(":"),i=_(this.sheetMapping,e,t),s=_(this.sheetMapping,n,t);r=void 0===i||void 0===s?r.concat("!REF"):r.concat(i.hash(!0),":",s.hash(!0))}else r=r.concat(o.image);i++}return r}rememberNewAst(e){const t=this.computeHashFromAst(e);return this.cache.maybeSetAndThenGet(t,e)}computeHashFromAst(e){return"="+this.computeHashOfAstNode(e)}computeHashOfAstNode(e){switch(e.type){case G.EMPTY:return e.leadingWhitespace||"";case G.NUMBER:return Ce(ht(e.value,this.config.decimalSeparator),e.leadingWhitespace);case G.STRING:return Ce('"'+e.value+'"',e.leadingWhitespace);case G.NAMED_EXPRESSION:return Ce(e.expressionName,e.leadingWhitespace);case G.FUNCTION_CALL:{const t=e.args.map(e=>this.computeHashOfAstNode(e)).join(this.config.functionArgSeparator),n=e.procedureName+"("+t+Ce(")",e.internalWhitespace);return Ce(n,e.leadingWhitespace)}case G.CELL_REFERENCE:return Ce(e.reference.hash(!0),e.leadingWhitespace);case G.COLUMN_RANGE:case G.ROW_RANGE:case G.CELL_RANGE:{const t=e.start.hash(e.sheetReferenceType!==z.RELATIVE),n=e.end.hash(e.sheetReferenceType===z.BOTH_ABSOLUTE);return Ce(t+":"+n,e.leadingWhitespace)}case G.MINUS_UNARY_OP:return Ce("-"+this.computeHashOfAstNode(e.value),e.leadingWhitespace);case G.PLUS_UNARY_OP:return Ce("+"+this.computeHashOfAstNode(e.value),e.leadingWhitespace);case G.PERCENT_OP:return this.computeHashOfAstNode(e.value)+Ce("%",e.leadingWhitespace);case G.ERROR:{const t=this.config.translationPackage.getErrorTranslation(e.error?e.error.type:Bn.ERROR);return Ce(t,e.leadingWhitespace)}case G.ERROR_WITH_RAW_INPUT:return Ce(e.rawInput,e.leadingWhitespace);case G.ARRAY:{const t=e.args.map(e=>e.map(e=>this.computeHashOfAstNode(e)).join(",")).join(";");return Ce("{"+t+Ce("}",e.internalWhitespace),e.leadingWhitespace)}case G.PARENTHESIS:{const t=this.computeHashOfAstNode(e.expression),n="("+t+Ce(")",e.internalWhitespace);return Ce(n,e.leadingWhitespace)}default:return this.computeHashOfAstNode(e.left)+Ce(Se[e.type],e.leadingWhitespace)+this.computeHashOfAstNode(e.right)}}bindWhitespacesToTokens(e){const t=[],n=e[0];Object(V["tokenMatcher"])(n,this.lexerConfig.WhiteSpace)||t.push(n);for(let r=1;r<e.length;++r){const n=e[r];if(Object(V["tokenMatcher"])(n,this.lexerConfig.WhiteSpace))continue;const i=e[r-1];Object(V["tokenMatcher"])(i,this.lexerConfig.WhiteSpace)&&(n.leadingWhitespace=i),t.push(n)}return t}tokenizeFormula(e){return this.lexer.tokenizeFormula(e)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */const dt=(e,t,n,r)=>{switch(e.type){case G.EMPTY:case G.NUMBER:case G.STRING:case G.ERROR:return;case G.NAMED_EXPRESSION:return void(r&&n.push(new wt(e.expressionName)));case G.CELL_REFERENCE:return void(r&&n.push(new ft(e.reference)));case G.CELL_RANGE:return void(r&&e.start.sheet===e.end.sheet&&n.push(new gt(e.start,e.end)));case G.COLUMN_RANGE:return void(r&&e.start.sheet===e.end.sheet&&n.push(new mt(e.start,e.end)));case G.ROW_RANGE:return void(r&&e.start.sheet===e.end.sheet&&n.push(new yt(e.start,e.end)));case G.PERCENT_OP:case G.PLUS_UNARY_OP:case G.MINUS_UNARY_OP:return void dt(e.value,t,n,!0);case G.CONCATENATE_OP:case G.EQUALS_OP:case G.NOT_EQUAL_OP:case G.LESS_THAN_OP:case G.GREATER_THAN_OP:case G.LESS_THAN_OR_EQUAL_OP:case G.GREATER_THAN_OR_EQUAL_OP:case G.MINUS_OP:case G.PLUS_OP:case G.TIMES_OP:case G.DIV_OP:case G.POWER_OP:return dt(e.left,t,n,!0),void dt(e.right,t,n,!0);case G.PARENTHESIS:return void dt(e.expression,t,n,r);case G.FUNCTION_CALL:{const r=!t.doesFunctionNeedArgumentToBeComputed(e.procedureName);return void e.args.forEach(e=>dt(e,t,n,r))}}},pt=(e,t)=>{const n=new Array;return dt(e,t,n,!0),n};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class ft{constructor(e){this.dependency=e}absolutize(e){return this.dependency.toSimpleCellAddress(e)}}class gt{constructor(e,t){this.start=e,this.end=t}absolutize(e){return new Sr(this.start.toSimpleCellAddress(e),this.end.toSimpleCellAddress(e))}}class mt{constructor(e,t){this.start=e,this.end=t}absolutize(e){const t=this.start.toSimpleColumnAddress(e),n=this.end.toSimpleColumnAddress(e);return new Rr(t.sheet,t.col,n.col)}}class yt{constructor(e,t){this.start=e,this.end=t}absolutize(e){const t=this.start.toSimpleRowAddress(e),n=this.end.toSimpleRowAddress(e);return new Tr(t.sheet,t.row,n.row)}}class wt{constructor(e){this.name=e}absolutize(e){return this}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */const bt=(e,t)=>e.map(e=>e.absolutize(t)),vt=e=>e.filter(e=>e instanceof wt||(e instanceof Sr?!(fr(e.start)||fr(e.end)):!fr(e))),Et=Symbol("Empty value");function Ct(e){return e instanceof St?e.val:e}class St{constructor(e,t){this.val=e,this.format=t}fromNumber(e){return new this.constructor(e)}}function Rt(e,t){if("number"===typeof e)return t;{const n=e.fromNumber(t);return n.format=e.format,n}}class Tt extends St{getDetailedType(){return xt.NUMBER_DATE}}class Ot extends St{getDetailedType(){return xt.NUMBER_CURRENCY}}class Nt extends St{getDetailedType(){return xt.NUMBER_TIME}}class At extends St{getDetailedType(){return xt.NUMBER_DATETIME}}class It extends St{getDetailedType(){return xt.NUMBER_PERCENT}}function Mt(e){return"number"===typeof e||e instanceof St}var xt,_t;function Lt(e){return e instanceof St?e.getDetailedType():xt.NUMBER_RAW}function Pt(e){return e instanceof St?e.format:void 0}function kt(e){return e instanceof St?{type:e.getDetailedType(),format:e.format}:{type:xt.NUMBER_RAW}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */(function(e){e["NUMBER_RAW"]="NUMBER_RAW",e["NUMBER_DATE"]="NUMBER_DATE",e["NUMBER_TIME"]="NUMBER_TIME",e["NUMBER_DATETIME"]="NUMBER_DATETIME",e["NUMBER_CURRENCY"]="NUMBER_CURRENCY",e["NUMBER_PERCENT"]="NUMBER_PERCENT"})(xt||(xt={}));class jt{constructor(e,t,n,r){this._data=e,this.range=t,this.dependencyGraph=n,this._hasOnlyNumbers=r,this.size=void 0===e?new ei(t.effectiveWidth(n),t.effectiveHeight(n)):new ei(e[0].length,e.length)}get data(){return this.ensureThatComputed(),this._data}static fromRange(e,t,n){return new jt(e,t,n,!0)}static onlyNumbers(e){return new jt(e,void 0,void 0,!0)}static onlyValues(e){return new jt(e,void 0,void 0,void 0)}static onlyRange(e,t){return new jt(void 0,e,t,void 0)}static fromScalar(e){return new jt([[e]],void 0,void 0,void 0)}isAdHoc(){return void 0===this.range}width(){return this.size.width}height(){return this.size.height}valuesFromTopLeftCorner(){this.ensureThatComputed();const e=[];for(let t=0;t<this._data.length;t++)for(let n=0;n<this._data[0].length;n++)e.push(this._data[t][n]);return e}*effectiveAddressesFromData(e){for(let t=0;t<this.data.length;++t){const n=this.data[t];for(let r=0;r<n.length;++r)yield pr(e.sheet,e.col+r,e.row+t)}}*entriesFromTopLeftCorner(e){this.ensureThatComputed();for(let t=0;t<this.size.height;++t)for(let n=0;n<this.size.width;++n)yield[this._data[t][n],pr(e.sheet,e.col+n,e.row+t)]}*iterateValuesFromTopLeftCorner(){yield*this.valuesFromTopLeftCorner()}numberOfElements(){return this.size.width*this.size.height}hasOnlyNumbers(){if(void 0===this._hasOnlyNumbers){this._hasOnlyNumbers=!0;for(const e of this.data)for(const t of e)if("number"!==typeof t)return this._hasOnlyNumbers=!1,!1}return this._hasOnlyNumbers}rawNumbers(){return this._data}rawData(){var e;return this.ensureThatComputed(),null!==(e=this._data)&&void 0!==e?e:[]}sameDimensionsAs(e){return this.width()===e.width()&&this.height()===e.height()}ensureThatComputed(){void 0===this._data&&(this._hasOnlyNumbers=!0,this._data=this.range.addressesArrayMap(this.dependencyGraph,e=>{const t=this.dependencyGraph.getCellValue(e);return t instanceof jt?(this._hasOnlyNumbers=!1,new lr(Bn.VALUE,Ne.ScalarExpected)):(Mt(t)||(this._hasOnlyNumbers=!1),t)}))}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Ht{constructor(){this.changes=new Map}static empty(){return new Ht}addAll(e){for(const t of e.changes.values())this.add(t.address,t);return this}addChange(e,t,n){this.addInterpreterValue(e,t,n)}exportChanges(e){let t=[];return this.changes.forEach(n=>{const r=e.exportChange(n);Array.isArray(r)?t=t.concat(r):t.push(r)}),t}getChanges(){return Array.from(this.changes.values())}isEmpty(){return 0===this.changes.size}add(e,t){const n=t.value;if(n instanceof jt)for(const r of n.effectiveAddressesFromData(e))this.changes.delete(mr(r));this.changes.set(mr(e),t)}addInterpreterValue(e,t,n){this.add(t,{address:t,value:e,oldValue:n})}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Dt{constructor(e,t,n){if(this.sheet=e,this.rowStart=t,this.rowEnd=n,t<0)throw Error("Starting row cant be less than 0");if(n<t)throw Error("Row span cant end before start")}get numberOfRows(){return this.rowEnd-this.rowStart+1}get start(){return this.rowStart}get end(){return this.rowEnd}static fromNumberOfRows(e,t,n){return new Dt(e,t,t+n-1)}static fromRowStartAndEnd(e,t,n){return new Dt(e,t,n)}*rows(){for(let e=this.rowStart;e<=this.rowEnd;++e)yield e}intersect(e){if(this.sheet!==e.sheet)throw Error("Can't intersect spans from different sheets");const t=Math.max(this.rowStart,e.rowStart),n=Math.min(this.rowEnd,e.rowEnd);return t>n?null:new Dt(this.sheet,t,n)}firstRow(){return new Dt(this.sheet,this.rowStart,this.rowStart)}}class Ft{constructor(e,t,n){if(this.sheet=e,this.columnStart=t,this.columnEnd=n,t<0)throw Error("Starting column cant be less than 0");if(n<t)throw Error("Column span cant end before start")}get numberOfColumns(){return this.columnEnd-this.columnStart+1}get start(){return this.columnStart}get end(){return this.columnEnd}static fromNumberOfColumns(e,t,n){return new Ft(e,t,t+n-1)}static fromColumnStartAndEnd(e,t,n){return new Ft(e,t,n)}*columns(){for(let e=this.columnStart;e<=this.columnEnd;++e)yield e}intersect(e){if(this.sheet!==e.sheet)throw Error("Can't intersect spans from different sheets");const t=Math.max(this.columnStart,e.columnStart),n=Math.min(this.columnEnd,e.columnEnd);return t>n?null:new Ft(this.sheet,t,n)}firstColumn(){return new Ft(this.sheet,this.columnStart,this.columnStart)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */(function(e){e["BUILD_ENGINE_TOTAL"]="BUILD_ENGINE_TOTAL",e["PARSER"]="PARSER",e["GRAPH_BUILD"]="GRAPH_BUILD",e["COLLECT_DEPENDENCIES"]="COLLECT_DEPENDENCIES",e["PROCESS_DEPENDENCIES"]="PROCESS_DEPENDENCIES",e["TOP_SORT"]="TOP_SORT",e["BUILD_COLUMN_INDEX"]="BUILD_COLUMN_INDEX",e["EVALUATION"]="EVALUATION",e["VLOOKUP"]="VLOOKUP",e["TRANSFORM_ASTS"]="TRANSFORM_ASTS",e["TRANSFORM_ASTS_POSTPONED"]="TRANSFORM_ASTS_POSTPONED",e["ADJUSTING_ADDRESS_MAPPING"]="ADJUSTING_ADDRESS_MAPPING",e["ADJUSTING_ARRAY_MAPPING"]="ADJUSTING_ARRAY_MAPPING",e["ADJUSTING_RANGES"]="ADJUSTING_RANGES",e["ADJUSTING_GRAPH"]="ADJUSTING_GRAPH",e["CRITERION_FUNCTION_FULL_CACHE_USED"]="CRITERION_FUNCTION_FULL_CACHE_USED",e["CRITERION_FUNCTION_PARTIAL_CACHE_USED"]="CRITERION_FUNCTION_PARTIAL_CACHE_USED"})(_t||(_t={}));
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class Ut{constructor(){this.stats=new Map([[_t.CRITERION_FUNCTION_FULL_CACHE_USED,0],[_t.CRITERION_FUNCTION_PARTIAL_CACHE_USED,0]]),this.startTimes=new Map}incrementCriterionFunctionFullCacheUsed(){var e;const t=(null!==(e=this.stats.get(_t.CRITERION_FUNCTION_FULL_CACHE_USED))&&void 0!==e?e:0)+1;this.stats.set(_t.CRITERION_FUNCTION_FULL_CACHE_USED,t)}incrementCriterionFunctionPartialCacheUsed(){var e;const t=(null!==(e=this.stats.get(_t.CRITERION_FUNCTION_PARTIAL_CACHE_USED))&&void 0!==e?e:0)+1;this.stats.set(_t.CRITERION_FUNCTION_PARTIAL_CACHE_USED,t)}reset(){this.stats.clear(),this.startTimes.clear(),this.stats.set(_t.CRITERION_FUNCTION_FULL_CACHE_USED,0),this.stats.set(_t.CRITERION_FUNCTION_PARTIAL_CACHE_USED,0)}start(e){if(this.startTimes.get(e))throw Error(`Statistics ${e} already started`);this.startTimes.set(e,Date.now())}end(e){var t;const n=Date.now(),r=this.startTimes.get(e);if(!r)throw Error(`Statistics ${e} not started`);{let i=null!==(t=this.stats.get(e))&&void 0!==t?t:0;i+=n-r,this.stats.set(e,i),this.startTimes.delete(e)}}measure(e,t){this.start(e);const n=t();return this.end(e),n}snapshot(){return new Map(this.stats)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Vt extends Ut{incrementCriterionFunctionFullCacheUsed(){}incrementCriterionFunctionPartialCacheUsed(){}start(e){}end(e){}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Bt extends Error{constructor(e){super("There's no sheet with id = "+e)}}class Wt extends Error{constructor(e){super(`There's no sheet with name '${e}'`)}}class Gt extends Error{constructor(e){super(`Sheet with name ${e} already exists`)}}class zt extends Error{constructor(){super("Sheet size limit exceeded")}}class Yt extends Error{constructor(){super("This is not a formula")}}class Xt extends Error{constructor(e){super(`Address (row = ${e.row}, col = ${e.col}) is invalid`)}}class Kt extends Error{constructor(e){super("Invalid arguments, expected "+e)}}class $t extends Error{constructor(e,t){super(`Sheets ${e} and ${t} are not equal.`)}}class qt extends Error{constructor(e){super(`Name of Named Expression '${e}' is already present`)}}class Qt extends Error{constructor(e){super(`Name of Named Expression '${e}' is invalid`)}}class Zt extends Error{constructor(e){super(`Named Expression '${e}' does not exist`)}}class Jt extends Error{constructor(){super("There is no operation to undo")}}class en extends Error{constructor(){super("There is no operation to redo")}}class tn extends Error{constructor(){super("There is nothing to paste")}}function nn(e,t){switch(typeof t){case"function":case"symbol":return t.toString();case"bigint":return"BigInt("+t.toString()+")";default:return t instanceof RegExp?"RegExp("+t.toString()+")":t}}class rn extends Error{constructor(e){super("Unable to parse value: "+JSON.stringify(e,nn,4))}}class on extends Error{constructor(e,t){super(`Expected value of type: ${e} for config parameter: ${t}`)}}class sn extends Error{constructor(e){super(`Config parameter ${e} cannot be empty.`)}}class an extends Error{constructor(e,t){super(`Config parameter ${e} should be at least ${t}`)}}class ln extends Error{constructor(e,t){super(`Config parameter ${e} should be at most ${t}`)}}class cn extends Error{constructor(e,t){super(`Expected one of ${e} for config parameter: ${t}`)}}class hn extends Error{constructor(){super("Computations are suspended")}}class un extends Error{constructor(e){super(`Translation for ${e} is missing in the translation package you're using.`)}}class dn extends Error{constructor(e){super("Cannot register translation for function with id: "+e)}}class pn extends Error{constructor(){super("Language not registered.")}}class fn extends Error{constructor(){super("Language already registered.")}}class gn extends Error{static functionNotDeclaredInPlugin(e,t){return new gn(`Function with id ${e} not declared in plugin ${t}`)}static functionMethodNotFound(e,t){return new gn(`Function method ${e} not found in plugin ${t}`)}}class mn extends Error{static cannotRegisterFunctionWithId(e){return new mn("Cannot register function with id "+e)}static cannotUnregisterFunctionWithId(e){return new mn("Cannot unregister function with id "+e)}static cannotUnregisterProtectedPlugin(){return new mn("Cannot unregister protected plugin")}}class yn extends Error{constructor(){super("Cannot perform this operation, source location has an array inside.")}}class wn extends Error{constructor(){super("Cannot perform this operation, target location has an array inside.")}}class bn extends Error{constructor(){super("Relative addresses not allowed in named expressions.")}}class vn extends Error{constructor(e,t){super(`Alias id ${e} in plugin ${t} already defined as a function or alias.`)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class En{constructor(e){this.policy=e,this.mapping=new Map}getCell(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new Bt(e.sheet);return t.getCell(e)}fetchCell(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new Bt(e.sheet);const n=t.getCell(e);if(!n)throw Error("Vertex for address missing in AddressMapping");return n}strategyFor(e){const t=this.mapping.get(e);if(void 0===t)throw new Bt(e);return t}addSheet(e,t){if(this.mapping.has(e))throw Error("Sheet already added");this.mapping.set(e,t)}autoAddSheet(e,t){const{height:n,width:r,fill:i}=t,o=this.policy.call(i);this.addSheet(e,new o(r,n))}getCellValue(e){const t=this.getCell(e);return void 0===t?Et:t instanceof Nn?t.getArrayCellValue(e):t.getCellValue()}getRawValue(e){const t=this.getCell(e);return t instanceof $n?t.getValues().rawValue:t instanceof Nn?t.getArrayCellRawValue(e):null}setCell(e,t){const n=this.mapping.get(e.sheet);if(!n)throw Error("Sheet not initialized");n.setCell(e,t)}moveCell(e,t){const n=this.mapping.get(e.sheet);if(!n)throw Error("Sheet not initialized.");if(e.sheet!==t.sheet)throw Error("Cannot move cells between sheets.");if(n.has(t))throw new Error("Cannot move cell. Destination already occupied.");const r=n.getCell(e);if(void 0===r)throw new Error("Cannot move cell. No cell with such address.");this.setCell(t,r),this.removeCell(e)}removeCell(e){const t=this.mapping.get(e.sheet);if(!t)throw Error("Sheet not initialized");t.removeCell(e)}has(e){const t=this.mapping.get(e.sheet);return void 0!==t&&t.has(e)}getHeight(e){const t=this.mapping.get(e);if(void 0===t)throw new Bt(e);return t.getHeight()}getWidth(e){const t=this.mapping.get(e);if(!t)throw new Bt(e);return t.getWidth()}addRows(e,t,n){const r=this.mapping.get(e);if(void 0===r)throw new Bt(e);r.addRows(t,n)}removeRows(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new Bt(e.sheet);t.removeRows(e)}removeSheet(e){this.mapping.delete(e)}addColumns(e,t,n){const r=this.mapping.get(e);if(void 0===r)throw new Bt(e);r.addColumns(t,n)}removeColumns(e){const t=this.mapping.get(e.sheet);if(void 0===t)throw new Bt(e.sheet);t.removeColumns(e)}*verticesFromRowsSpan(e){yield*this.mapping.get(e.sheet).verticesFromRowsSpan(e)}*verticesFromColumnsSpan(e){yield*this.mapping.get(e.sheet).verticesFromColumnsSpan(e)}*entriesFromRowsSpan(e){yield*this.mapping.get(e.sheet).entriesFromRowsSpan(e)}*entriesFromColumnsSpan(e){yield*this.mapping.get(e.sheet).entriesFromColumnsSpan(e)}*entries(){for(const[e,t]of this.mapping.entries())yield*t.getEntries(e)}*sheetEntries(e){const t=this.mapping.get(e);if(void 0===t)throw new Bt(e);yield*t.getEntries(e)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Cn{constructor(){this.arrayMapping=new Map}getArray(e){const t=this.getArrayByCorner(e.start);if(null===t||void 0===t?void 0:t.getRange().sameAs(e))return t}getArrayByCorner(e){return this.arrayMapping.get(mr(e))}setArray(e,t){this.arrayMapping.set(mr(e.start),t)}removeArray(e){"string"===typeof e?this.arrayMapping.delete(e):this.arrayMapping.delete(mr(e.start))}count(){return this.arrayMapping.size}*arraysInRows(e){for(const[t,n]of this.arrayMapping.entries())n.spansThroughSheetRows(e.sheet,e.rowStart,e.rowEnd)&&(yield[t,n])}*arraysInCols(e){for(const[t,n]of this.arrayMapping.entries())n.spansThroughSheetColumn(e.sheet,e.columnStart,e.columnEnd)&&(yield[t,n])}isFormulaArrayInRow(e,t){for(const n of this.arrayMapping.values())if(n.spansThroughSheetRows(e,t))return!0;return!1}isFormulaArrayInAllRows(e){let t=!0;for(const n of e.rows())this.isFormulaArrayInRow(e.sheet,n)||(t=!1);return t}isFormulaArrayInColumn(e,t){for(const n of this.arrayMapping.values())if(n.spansThroughSheetColumn(e,t))return!0;return!1}isFormulaArrayInAllColumns(e){let t=!0;for(const n of e.columns())this.isFormulaArrayInColumn(e.sheet,n)||(t=!1);return t}isFormulaArrayInRange(e){for(const t of this.arrayMapping.values())if(t.getRange().doesOverlap(e))return!0;return!1}isFormulaArrayAtAddress(e){for(const t of this.arrayMapping.values())if(t.getRange().addressInRange(e))return!0;return!1}moveArrayVerticesAfterRowByRows(e,t,n){this.updateArrayVerticesInSheet(e,(e,r)=>{const i=r.getRange();return t<=i.start.row?[i.shifted(0,n),r]:void 0})}moveArrayVerticesAfterColumnByColumns(e,t,n){this.updateArrayVerticesInSheet(e,(e,r)=>{const i=r.getRange();return t<=i.start.col?[i.shifted(n,0),r]:void 0})}updateArrayVerticesInSheet(e,t){const n=Array();for(const[r,i]of this.arrayMapping.entries()){if(i.sheet!==e)continue;const o=t(r,i);void 0!==o&&(this.removeArray(r),n.push(o))}n.forEach(([e,t])=>{this.setArray(e,t)})}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Sn{constructor(e){this.size=e}width(){return this.size.width}height(){return this.size.height}get(e,t){throw Error("Array not computed yet.")}simpleRangeValue(){throw Error("Array not computed yet.")}}class Rn{constructor(e){if(this.size=new ei(e.length>0?e[0].length:0,e.length),this.array=e,this.size.width<=0||this.size.height<=0)throw Error("Incorrect array size")}static fromInterpreterValue(e){return new Rn(e instanceof jt?e.data:[[e]])}simpleRangeValue(){return jt.onlyValues(this.array)}addRows(e,t){this.array.splice(e,0,...this.nullArrays(t,this.width())),this.size.height+=t}addColumns(e,t){for(let n=0;n<this.height();n++)this.array[n].splice(e,0,...new Array(t).fill(Et));this.size.width+=t}removeRows(e,t){if(this.outOfBound(0,e)||this.outOfBound(0,t))throw Error("Array index out of bound");const n=t-e+1;this.array.splice(e,n),this.size.height-=n}removeColumns(e,t){if(this.outOfBound(e,0)||this.outOfBound(t,0))throw Error("Array index out of bound");const n=t-e+1;for(const r of this.array)r.splice(e,n);this.size.width-=n}nullArrays(e,t){const n=[];for(let r=0;r<e;++r)n.push(new Array(t).fill(Et));return n}get(e,t){if(this.outOfBound(e,t))throw Error("Array index out of bound");return this.array[t][e]}set(e,t,n){if(this.outOfBound(e,t))throw Error("Array index out of bound");this.array[t][e]=n}width(){return this.size.width}height(){return this.size.height}raw(){return this.array}resize(e){if(this.height()<e.height&&isFinite(e.height)&&this.addRows(this.height(),e.height-this.height()),this.height()>e.height)throw Error("Resizing to smaller array");if(this.width()<e.width&&isFinite(e.width)&&this.addColumns(this.width(),e.width-this.width()),this.width()>e.width)throw Error("Resizing to smaller array")}outOfBound(e,t){return e<0||t<0||t>this.size.height-1||e>this.size.width-1}}class Tn{constructor(e,t){this.error=e,this.size=t}get(e,t){return this.error}width(){return this.size.width}height(){return this.size.height}simpleRangeValue(){return this.error}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class On{constructor(e,t,n){this.formula=e,this.cellAddress=t,this.version=n}get width(){return 1}get height(){return 1}static fromAst(e,t,n,r){return n.isScalar()?new An(e,t,r):new Nn(e,t,n,r)}getFormula(e){return this.ensureRecentData(e),this.formula}ensureRecentData(e){if(this.version!=e.version()){const[t,n,r]=e.applyTransformations(this.formula,this.cellAddress,this.version);this.formula=t,this.cellAddress=n,this.version=r}}getAddress(e){return this.ensureRecentData(e),this.cellAddress}}class Nn extends On{constructor(e,t,n,r=0){super(e,t,r),n.isRef?this.array=new Tn(new lr(Bn.REF,Ne.NoSpaceForArrayResult),ei.error()):this.array=new Sn(n)}get width(){return this.array.width()}get height(){return this.array.height()}get sheet(){return this.cellAddress.sheet}get leftCorner(){return this.cellAddress}setCellValue(e){if(e instanceof lr)return this.setErrorValue(e),e;const t=Rn.fromInterpreterValue(e);return t.resize(this.array.size),this.array=t,e}getCellValue(){if(this.array instanceof Sn)throw Error("Array not computed yet.");return this.array.simpleRangeValue()}valueOrUndef(){if(!(this.array instanceof Sn))return this.array.simpleRangeValue()}getArrayCellValue(e){const t=e.col-this.cellAddress.col,n=e.row-this.cellAddress.row;try{return this.array.get(t,n)}catch(r){return new lr(Bn.REF)}}getArrayCellRawValue(e){const t=this.getArrayCellValue(e);return t instanceof lr||t===Et?void 0:Ct(t)}setArrayCellValue(e,t){const n=e.col-this.cellAddress.col,r=e.row-this.cellAddress.row;this.array instanceof Rn&&this.array.set(n,r,t)}setNoSpace(){return this.array=new Tn(new lr(Bn.SPILL,Ne.NoSpaceForArrayResult),ei.error()),this.getCellValue()}getRange(){return Sr.spanFrom(this.cellAddress,this.width,this.height)}getRangeOrUndef(){return Sr.spanFromOrUndef(this.cellAddress,this.width,this.height)}setAddress(e){this.cellAddress=e}setFormula(e){this.formula=e}spansThroughSheetRows(e,t,n=t){return this.cellAddress.sheet===e&&this.cellAddress.row<=n&&t<this.cellAddress.row+this.height}spansThroughSheetColumn(e,t,n=t){return this.cellAddress.sheet===e&&this.cellAddress.col<=n&&t<this.cellAddress.col+this.width}isComputed(){return!(this.array instanceof Sn)}columnsFromArray(){return Ft.fromNumberOfColumns(this.cellAddress.sheet,this.cellAddress.col,this.width)}rowsFromArray(){return Dt.fromNumberOfRows(this.cellAddress.sheet,this.cellAddress.row,this.height)}ensureRecentData(e){}isLeftCorner(e){return br(this.cellAddress,e)}setErrorValue(e){this.array=new Tn(e,this.array.size)}}class An extends On{constructor(e,t,n){super(e,t,n)}valueOrUndef(){return this.cachedCellValue}setCellValue(e){return this.cachedCellValue=e,this.cachedCellValue}getCellValue(){if(void 0!==this.cachedCellValue)return this.cachedCellValue;throw Error("Value of the formula cell is not computed.")}isComputed(){return void 0!==this.cachedCellValue}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class In{constructor(e){this.range=e,this.functionCache=new Map,this.criterionFunctionCache=new Map,this.dependentCacheRanges=new Set,this.bruteForce=!1}get start(){return this.range.start}get end(){return this.range.end}get sheet(){return this.range.start.sheet}getFunctionValue(e){return this.functionCache.get(e)}setFunctionValue(e,t){this.functionCache.set(e,t)}getCriterionFunctionValue(e,t){var n;return null===(n=this.getCriterionFunctionValues(e).get(t))||void 0===n?void 0:n[0]}getCriterionFunctionValues(e){var t;return null!==(t=this.criterionFunctionCache.get(e))&&void 0!==t?t:new Map}setCriterionFunctionValues(e,t){this.criterionFunctionCache.set(e,t)}addDependentCacheRange(e){e!==this&&this.dependentCacheRanges.add(e)}clearCache(){this.functionCache.clear(),this.criterionFunctionCache.clear(),this.dependentCacheRanges.forEach(e=>e.criterionFunctionCache.clear()),this.dependentCacheRanges.clear()}getStart(){return this.start}getEnd(){return this.end}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */const Mn=(e,t,n,r,i)=>{if(t instanceof In){const e=t.range.intersectionWith(n);return void 0!==e?Array.from(e.addresses(i)):[]}let o,s;return t instanceof On?(o=t.getFormula(r),s=t.getAddress(r),pt(o,e).filter(e=>e instanceof ft).map(e=>e.dependency.toSimpleCellAddress(s)).filter(e=>n.addressInRange(e))):[]};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */var xn;(function(e){e[e["ON_STACK"]=0]="ON_STACK",e[e["PROCESSED"]=1]="PROCESSED",e[e["POPPED"]=2]="POPPED"})(xn||(xn={}));class _n{constructor(e=[],t=[]){this.nodesSparseArray=e,this.edgesSparseArray=t,this.entranceTime=[],this.low=[],this.parent=[],this.inSCC=[],this.nodeStatus=[],this.order=[],this.sccNonSingletons=[],this.timeCounter=0}getTopSortedWithSccSubgraphFrom(e,t,n){const r=e.reverse();return r.forEach(e=>this.runDFS(e)),this.postprocess(r,n,t)}getAdjacentNodeIds(e){return this.edgesSparseArray[e].filter(e=>void 0!==e&&this.nodesSparseArray[e])}runDFS(e){if(void 0!==this.nodeStatus[e])return;this.nodeStatus[e]=xn.ON_STACK;const t=[e],n=[];while(t.length>0){const e=t[t.length-1];switch(this.nodeStatus[e]){case xn.ON_STACK:this.handleOnStack(e,n,t);break;case xn.PROCESSED:this.handleProcessed(e,n,t);break;case xn.POPPED:t.pop();break}}}handleOnStack(e,t,n){this.entranceTime[e]=this.timeCounter,this.low[e]=this.timeCounter,this.timeCounter++,t.push(e),this.getAdjacentNodeIds(e).forEach(t=>{void 0===this.entranceTime[t]&&(n.push(t),this.parent[t]=e,this.nodeStatus[t]=xn.ON_STACK)}),this.nodeStatus[e]=xn.PROCESSED}handleProcessed(e,t,n){let r=this.entranceTime[e];if(this.getAdjacentNodeIds(e).forEach(t=>{this.inSCC[t]||(r=this.parent[t]===e?Math.min(r,this.low[t]):Math.min(r,this.entranceTime[t]))}),this.low[e]=r,r===this.entranceTime[e]){const n=[];do{n.push(t[t.length-1]),t.pop()}while(n[n.length-1]!==e);n.forEach(e=>{this.inSCC[e]=!0}),this.order.push(...n),n.length>1&&n.forEach(e=>{this.sccNonSingletons[e]=!0})}n.pop(),this.nodeStatus[e]=xn.POPPED}postprocess(e,t,n){const r=[];e.forEach(e=>{r[e]=!0});const i=[],o=[];return this.order.reverse(),this.order.forEach(e=>{const s=this.getAdjacentNodeIds(e);this.sccNonSingletons[e]||s.includes(e)?(o.push(this.nodesSparseArray[e]),t(this.nodesSparseArray[e]),s.forEach(e=>r[e]=!0)):(i.push(this.nodesSparseArray[e]),r[e]&&n(this.nodesSparseArray[e])&&s.forEach(e=>r[e]=!0))}),{sorted:i,cycled:o}}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Ln{constructor(e,t){this.rawValue=e,this.processFn=t,this.processedValue=null}getProcessedValue(){return null===this.processedValue&&(this.processedValue=this.processFn(this.rawValue)),this.processedValue}markAsModified(){this.processedValue=null}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Pn{constructor(e){this.dependencyQuery=e,this.nodesSparseArray=[],this.edgesSparseArray=[],this.nodesIds=new Map,this.dirtyAndVolatileNodeIds=new Ln({dirty:[],volatile:[]},e=>this.processDirtyAndVolatileNodeIds(e)),this.infiniteRangeIds=new Set,this.changingWithStructureNodeIds=[],this.nextId=0}getNodes(){return this.nodesSparseArray.filter(e=>void 0!==e)}hasNode(e){return this.nodesIds.has(e)}existsEdge(e,t){const n=this.getNodeId(e),r=this.getNodeId(t);return void 0!==n&&void 0!==r&&this.edgesSparseArray[n].includes(r)}adjacentNodes(e){const t=this.getNodeId(e);if(void 0===t)throw this.missingNodeError(e);return new Set(this.edgesSparseArray[t].filter(e=>void 0!==e).map(e=>this.nodesSparseArray[e]))}adjacentNodesCount(e){const t=this.getNodeId(e);if(void 0===t)throw this.missingNodeError(e);return this.fixEdgesArrayForNode(t).length}addNodeAndReturnId(e){const t=this.nodesIds.get(e);if(void 0!==t)return t;const n=this.nextId;return this.nextId++,this.nodesSparseArray[n]=e,this.edgesSparseArray[n]=[],this.nodesIds.set(e,n),n}addEdge(e,t){const n=this.getNodeIdIfNotNumber(e),r=this.getNodeIdIfNotNumber(t);if(void 0===n)throw this.missingNodeError(e);if(void 0===r)throw this.missingNodeError(t);this.edgesSparseArray[n].includes(r)||this.edgesSparseArray[n].push(r)}removeNode(e){const t=this.getNodeId(e);if(void 0===t)throw this.missingNodeError(e);this.edgesSparseArray[t].length>0&&(this.edgesSparseArray[t].forEach(e=>this.dirtyAndVolatileNodeIds.rawValue.dirty.push(e)),this.dirtyAndVolatileNodeIds.markAsModified());const n=this.removeDependencies(e);return delete this.nodesSparseArray[t],delete this.edgesSparseArray[t],this.infiniteRangeIds.delete(t),this.nodesIds.delete(e),n}removeEdge(e,t){const n=this.getNodeIdIfNotNumber(e),r=this.getNodeIdIfNotNumber(t);if(void 0===n)throw this.missingNodeError(e);if(void 0===r)throw this.missingNodeError(t);const i=this.edgesSparseArray[n].indexOf(r);if(-1===i)throw new Error("Edge does not exist");delete this.edgesSparseArray[n][i]}removeEdgeIfExists(e,t){const n=this.getNodeId(e),r=this.getNodeId(t);if(void 0===n)return;if(void 0===r)return;const i=this.edgesSparseArray[n].indexOf(r);-1!==i&&delete this.edgesSparseArray[n][i]}topSortWithScc(){return this.getTopSortedWithSccSubgraphFrom(this.getNodes(),()=>!0,()=>{})}getTopSortedWithSccSubgraphFrom(e,t,n){const r=new _n(this.nodesSparseArray,this.edgesSparseArray),i=e.map(e=>this.getNodeId(e)).filter(e=>void 0!==e);return r.getTopSortedWithSccSubgraphFrom(i,t,n)}markNodeAsVolatile(e){const t=this.getNodeId(e);void 0!==t&&(this.dirtyAndVolatileNodeIds.rawValue.volatile.push(t),this.dirtyAndVolatileNodeIds.markAsModified())}markNodeAsDirty(e){const t=this.getNodeId(e);void 0!==t&&(this.dirtyAndVolatileNodeIds.rawValue.dirty.push(t),this.dirtyAndVolatileNodeIds.markAsModified())}getDirtyAndVolatileNodes(){return this.dirtyAndVolatileNodeIds.getProcessedValue()}clearDirtyNodes(){this.dirtyAndVolatileNodeIds.rawValue.dirty=[],this.dirtyAndVolatileNodeIds.markAsModified()}markNodeAsChangingWithStructure(e){const t=this.getNodeId(e);void 0!==t&&this.changingWithStructureNodeIds.push(t)}markChangingWithStructureNodesAsDirty(){this.changingWithStructureNodeIds.length<=0||(this.dirtyAndVolatileNodeIds.rawValue.dirty=[...this.dirtyAndVolatileNodeIds.rawValue.dirty,...this.changingWithStructureNodeIds],this.dirtyAndVolatileNodeIds.markAsModified())}markNodeAsInfiniteRange(e){const t=this.getNodeIdIfNotNumber(e);void 0!==t&&this.infiniteRangeIds.add(t)}getInfiniteRanges(){return[...this.infiniteRangeIds].map(e=>({node:this.nodesSparseArray[e],id:e}))}getNodeId(e){return this.nodesIds.get(e)}getNodeIdIfNotNumber(e){return"number"===typeof e?e:this.nodesIds.get(e)}fixEdgesArrayForNode(e){const t=this.edgesSparseArray[e];return this.edgesSparseArray[e]=t.filter(e=>void 0!==e&&this.nodesSparseArray[e]),this.edgesSparseArray[e]}removeDependencies(e){const t=this.dependencyQuery(e);return t.forEach(([t,n])=>{this.removeEdgeIfExists(n,e)}),t}processDirtyAndVolatileNodeIds({dirty:e,volatile:t}){return[...new Set([...e,...t])].map(e=>this.nodesSparseArray[e]).filter(e=>void 0!==e)}missingNodeError(e){return new Error("Unknown node "+e)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class kn{constructor(){this.rangeMapping=new Map}getMappingSize(e){var t,n;return null!==(n=null===(t=this.rangeMapping.get(e))||void 0===t?void 0:t.size)&&void 0!==n?n:0}setRange(e){let t=this.rangeMapping.get(e.getStart().sheet);void 0===t&&(t=new Map,this.rangeMapping.set(e.getStart().sheet,t));const n=jn(e.getStart(),e.getEnd());t.set(n,e)}removeRange(e){const t=e.getStart().sheet,n=this.rangeMapping.get(t);if(void 0===n)return;const r=jn(e.getStart(),e.getEnd());n.delete(r),0===n.size&&this.rangeMapping.delete(t)}getRange(e,t){const n=this.rangeMapping.get(e.sheet),r=jn(e,t);return null===n||void 0===n?void 0:n.get(r)}fetchRange(e,t){const n=this.getRange(e,t);if(!n)throw Error("Range does not exist");return n}truncateRanges(e,t){const n=Array(),r=Array(),i=Array(),o=e.sheet;for(const[a,l]of this.entriesFromSheet(e.sheet)){const s=l.range;e.start<=t(l.range.end)&&(s.removeSpan(e),s.shouldBeRemoved()?(this.removeByKey(o,a),n.push(l)):r.push([a,l]),i.push(l))}const s=[];r.sort((e,n)=>Dn(e[1],n[1],t));for(const[a,l]of r){const e=Hn(l.range);if(e===a)continue;const t=this.getByKey(o,e);this.removeByKey(o,a),void 0!==t&&l!=t?s.push([t,l]):this.setRange(l)}return{verticesToRemove:n,verticesToMerge:s,verticesWithChangedSize:i}}moveAllRangesInSheetAfterRowByRows(e,t,n){return this.updateVerticesFromSheet(e,(e,r)=>t<=r.start.row?(r.range.shiftByRows(n),{changedSize:!1,vertex:r}):t>r.start.row&&t<=r.end.row?(r.range.expandByRows(n),{changedSize:!0,vertex:r}):void 0)}moveAllRangesInSheetAfterColumnByColumns(e,t,n){return this.updateVerticesFromSheet(e,(e,r)=>t<=r.start.col?(r.range.shiftByColumns(n),{changedSize:!1,vertex:r}):t>r.start.col&&t<=r.end.col?(r.range.expandByColumns(n),{changedSize:!0,vertex:r}):void 0)}moveRangesInsideSourceRange(e,t,n,r){this.updateVerticesFromSheet(e.sheet,(i,o)=>e.containsRange(o.range)?(o.range.shiftByColumns(t),o.range.shiftByRows(n),o.range.moveToSheet(r),{changedSize:!1,vertex:o}):void 0)}removeRangesInSheet(e){if(this.rangeMapping.has(e)){const t=this.rangeMapping.get(e).values();return this.rangeMapping.delete(e),t}return[][Symbol.iterator]()}*rangesInSheet(e){const t=this.rangeMapping.get(e);t&&(yield*t.values())}*rangeVerticesContainedInRange(e){for(const t of this.rangesInSheet(e.sheet))e.containsRange(t.range)&&(yield t)}findSmallerRange(e){if(e.height()>1&&Number.isFinite(e.height())){const t=pr(e.end.sheet,e.end.col,e.end.row-1),n=this.getRange(e.start,t);if(void 0!==n){const t=Sr.fromSimpleCellAddresses(pr(e.start.sheet,e.start.col,e.end.row),e.end);return{smallerRangeVertex:n,restRange:t}}}return{restRange:e}}*entriesFromSheet(e){const t=this.rangeMapping.get(e);t&&(yield*t.entries())}removeByKey(e,t){this.rangeMapping.get(e).delete(t)}getByKey(e,t){var n;return null===(n=this.rangeMapping.get(e))||void 0===n?void 0:n.get(t)}updateVerticesFromSheet(e,t){const n=Array();for(const[r,i]of this.entriesFromSheet(e)){const o=t(r,i);void 0!==o&&(this.removeByKey(e,r),n.push(o))}return n.forEach(e=>{this.setRange(e.vertex)}),{verticesWithChangedSize:n.filter(e=>e.changedSize).map(e=>e.vertex)}}}function jn(e,t){return`${e.col},${e.row},${t.col},${t.row}`}function Hn(e){return jn(e.start,e.end)}const Dn=(e,t,n)=>{const r=n(e.range.start),i=n(e.range.start);if(r===i){const r=n(e.range.end),i=n(t.range.end);return r-i}return r-i};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Fn{constructor(e,t,n){this.functions=e,this.errors=t,this.ui=n,this._protectedTranslations={VERSION:"VERSION"},this.checkUI(),this.checkErrors(),this.checkFunctionTranslations(this.functions),Object.assign(this.functions,this._protectedTranslations)}extendFunctions(e){this.checkFunctionTranslations(e),Object.assign(this.functions,e)}buildFunctionMapping(){return Object.keys(this.functions).reduce((e,t)=>(e[this.functions[t]]=t,e),{})}buildErrorMapping(){return Object.keys(this.errors).reduce((e,t)=>(e[this.errors[t]]=t,e),{})}isFunctionTranslated(e){return void 0!==this.functions[e]}getFunctionTranslations(e){const t=[];for(const n of e)this.isFunctionTranslated(n)&&t.push(this.functions[n]);return t}getFunctionTranslation(e){const t=this.functions[e];if(void 0===t)throw new un("functions."+e);return t}getMaybeFunctionTranslation(e){return this.functions[e]}getErrorTranslation(e){if(e===Bn.LIC)return`#${Bn.LIC}!`;const t=this.errors[e];if(void 0===t)throw new un("errors."+e);return t}getUITranslation(e){const t=this.ui[e];if(void 0===t)throw new un("ui."+e);return t}checkUI(){for(const e of Object.values(Vn))if(!(e in this.ui))throw new un("ui."+e)}checkErrors(){for(const e of Object.values(Bn))if(!(e in this.errors)&&e!==Bn.LIC)throw new un("errors."+e)}checkFunctionTranslations(e){const t=new Set(Object.getOwnPropertyNames(e));for(const n of Object.getOwnPropertyNames(this._protectedTranslations))if(t.has(n))throw new dn(n)}}function Un(e){return new Fn(Object.assign({},e.functions),Object.assign({},e.errors),Object.assign({},e.ui))}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */var Vn,Bn,Wn;
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- function Gn(e){return e.toLowerCase()}(function(e){e["NEW_SHEET_PREFIX"]="NEW_SHEET_PREFIX"})(Vn||(Vn={}));class zn{constructor(e,t){this.id=e,this.displayName=t}get canonicalName(){return Gn(this.displayName)}}class Yn{constructor(e){this.languages=e,this.mappingFromCanonicalName=new Map,this.mappingFromId=new Map,this.lastSheetId=-1,this.fetch=e=>{const t=this.mappingFromCanonicalName.get(Gn(e));if(void 0===t)throw new Wt(e);return t.id},this.get=e=>{var t;return null===(t=this.mappingFromCanonicalName.get(Gn(e)))||void 0===t?void 0:t.id},this.fetchDisplayName=e=>this.fetchSheetById(e).displayName,this.sheetNamePrefix=e.getUITranslation(Vn.NEW_SHEET_PREFIX)}addSheet(e=`${this.sheetNamePrefix}${this.lastSheetId+2}`){const t=Gn(e);if(this.mappingFromCanonicalName.has(t))throw new Gt(e);this.lastSheetId++;const n=new zn(this.lastSheetId,e);return this.store(n),n.id}removeSheet(e){const t=this.fetchSheetById(e);e==this.lastSheetId&&--this.lastSheetId,this.mappingFromCanonicalName.delete(t.canonicalName),this.mappingFromId.delete(t.id)}getDisplayName(e){var t;return null===(t=this.mappingFromId.get(e))||void 0===t?void 0:t.displayName}*displayNames(){for(const e of this.mappingFromCanonicalName.values())yield e.displayName}numberOfSheets(){return this.mappingFromCanonicalName.size}hasSheetWithId(e){return this.mappingFromId.has(e)}hasSheetWithName(e){return this.mappingFromCanonicalName.has(Gn(e))}renameSheet(e,t){const n=this.fetchSheetById(e),r=n.displayName;if(r===t)return;const i=this.mappingFromCanonicalName.get(Gn(t));if(void 0!==i&&i.id!==n.id)throw new Gt(t);const o=n.canonicalName;return this.mappingFromCanonicalName.delete(o),n.displayName=t,this.store(n),r}sheetNames(){return Array.from(this.mappingFromId.values()).map(e=>e.displayName)}store(e){this.mappingFromId.set(e.id,e),this.mappingFromCanonicalName.set(e.canonicalName,e)}fetchSheetById(e){const t=this.mappingFromId.get(e);if(void 0===t)throw new Bt(e);return t}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Xn{constructor(e,t,n,r,i,o,s,a){this.addressMapping=e,this.rangeMapping=t,this.sheetMapping=n,this.arrayMapping=r,this.stats=i,this.lazilyTransformingAstService=o,this.functionRegistry=s,this.namedExpressions=a,this.changes=Ht.empty(),this.dependencyQueryAddresses=e=>{if(e instanceof In)return this.rangeDependencyQuery(e).map(([e,t])=>e);{const t=this.formulaDependencyQuery(e);if(void 0!==t){const[e,n]=t;return n.map(t=>t instanceof wt?this.namedExpressions.namedExpressionOrPlaceholder(t.name,e.sheet).address:yr(t)?t:Cr(t.start,t.end))}return[]}},this.dependencyQueryVertices=e=>{if(e instanceof In)return this.rangeDependencyQuery(e);{const t=this.formulaDependencyQuery(e);if(void 0!==t){const[e,n]=t;return n.map(t=>{if(t instanceof Sr)return[t.start,this.rangeMapping.fetchRange(t.start,t.end)];if(t instanceof wt){const n=this.namedExpressions.namedExpressionOrPlaceholder(t.name,e.sheet);return[n.address,this.addressMapping.fetchCell(n.address)]}return[t,this.addressMapping.fetchCell(t)]})}return[]}},this.rangeDependencyQuery=e=>{const t=[],{smallerRangeVertex:n,restRange:r}=this.rangeMapping.findSmallerRange(e.range);let i;void 0!==n&&this.graph.adjacentNodes(n).has(e)?(i=r,t.push([new Sr(n.start,n.end),n])):i=e.range;for(const o of i.addresses(this)){const e=this.addressMapping.getCell(o);void 0!==e&&t.push([o,e])}return t},this.formulaDependencyQuery=e=>{let t,n;if(!(e instanceof On))return;n=e.getAddress(this.lazilyTransformingAstService),t=e.getFormula(this.lazilyTransformingAstService);const r=pt(t,this.functionRegistry);return[n,bt(r,n)]},this.graph=new Pn(this.dependencyQueryVertices)}static buildEmpty(e,t,n,r,i){return new Xn(new En(t.chooseAddressMappingPolicy),new kn,new Yn(t.translationPackage),new Cn,i,e,n,r)}setFormulaToCell(e,t,n,r,i,o){const s=On.fromAst(t,e,r,this.lazilyTransformingAstService.version());return this.exchangeOrAddFormulaVertex(s),this.processCellDependencies(n,s),this.graph.markNodeAsDirty(s),i&&this.markAsVolatile(s),o&&this.markAsDependentOnStructureChange(s),this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setParsingErrorToCell(e,t){const n=this.shrinkPossibleArrayAndGetCell(e);return this.exchangeOrAddGraphNode(n,t),this.addressMapping.setCell(e,t),this.graph.markNodeAsDirty(t),this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setValueToCell(e,t){const n=this.shrinkPossibleArrayAndGetCell(e);if(n instanceof Nn&&this.arrayMapping.removeArray(n.getRange()),n instanceof $n){const e=n.getValues();e.rawValue!==t.rawValue&&(n.setValues(t),this.graph.markNodeAsDirty(n))}else{const r=new $n(t.parsedValue,t.rawValue);this.exchangeOrAddGraphNode(n,r),this.addressMapping.setCell(e,r),this.graph.markNodeAsDirty(r)}return this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setCellEmpty(e){const t=this.shrinkPossibleArrayAndGetCell(e);if(void 0===t)return Ht.empty();if(this.graph.adjacentNodes(t).size>0){const n=new Kn;this.exchangeGraphNode(t,n),0===this.graph.adjacentNodesCount(n)?(this.removeVertex(n),this.addressMapping.removeCell(e)):(this.graph.markNodeAsDirty(n),this.addressMapping.setCell(e,n))}else this.removeVertex(t),this.addressMapping.removeCell(e);return this.getAndClearContentChanges()}clearDirtyVertices(){this.graph.clearDirtyNodes()}verticesToRecompute(){return this.graph.getDirtyAndVolatileNodes()}processCellDependencies(e,t){const n=this.graph.getNodeId(t);e.forEach(e=>{if(e instanceof Sr){const t=e;let r=this.getRange(t.start,t.end);void 0===r&&(r=new In(t),this.rangeMapping.setRange(r)),this.graph.addNodeAndReturnId(r);const i=this.graph.getNodeId(r);t.isFinite()||this.graph.markNodeAsInfiniteRange(i);const{smallerRangeVertex:o,restRange:s}=this.rangeMapping.findSmallerRange(t);if(void 0!==o){if(this.graph.addEdge(o,i),r.bruteForce){r.bruteForce=!1;for(const e of t.addresses(this))this.graph.removeEdge(this.fetchCell(e),i)}}else r.bruteForce=!0;const a=this.arrayMapping.getArray(s);if(void 0!==a)this.graph.addEdge(a,i);else for(const e of s.addresses(this)){const{vertex:t,id:n}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!==n&&void 0!==n?n:t,i)}this.graph.addEdge(i,n),t.isFinite()&&this.correctInfiniteRangesDependenciesByRangeVertex(r)}else if(e instanceof wt){const r=t.getAddress(this.lazilyTransformingAstService).sheet,{vertex:i,id:o}=this.fetchNamedExpressionVertex(e.name,r);this.graph.addEdge(null!==o&&void 0!==o?o:i,n)}else{const{vertex:t,id:r}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!==r&&void 0!==r?r:t,n)}})}fetchNamedExpressionVertex(e,t){const n=this.namedExpressions.namedExpressionOrPlaceholder(e,t);return this.fetchCellOrCreateEmpty(n.address)}exchangeNode(e,t){const n=this.fetchCellOrCreateEmpty(e).vertex,r=this.fetchCellOrCreateEmpty(t).vertex;this.addressMapping.removeCell(e),this.exchangeGraphNode(n,r)}fetchCellOrCreateEmpty(e){const t=this.addressMapping.getCell(e);if(void 0!==t)return{vertex:t,id:void 0};const n=new Kn,r=this.graph.addNodeAndReturnId(n);return this.addressMapping.setCell(e,n),{vertex:n,id:r}}removeRows(e){this.stats.measure(_t.ADJUSTING_GRAPH,()=>{for(const[t,n]of this.addressMapping.entriesFromRowsSpan(e)){for(const e of this.graph.adjacentNodes(n))this.graph.markNodeAsDirty(e);if(n instanceof Nn){if(!n.isLeftCorner(t))continue;this.shrinkArrayToCorner(n),this.arrayMapping.removeArray(n.getRange())}this.removeVertex(n)}}),this.stats.measure(_t.ADJUSTING_ADDRESS_MAPPING,()=>{this.addressMapping.removeRows(e)});const t=this.stats.measure(_t.ADJUSTING_RANGES,()=>{const t=this.truncateRanges(e,e=>e.row);return this.getArrayVerticesRelatedToRanges(t)});return this.stats.measure(_t.ADJUSTING_ARRAY_MAPPING,()=>{this.fixArraysAfterRemovingRows(e.sheet,e.rowStart,e.numberOfRows)}),this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}removeSheet(e){this.clearSheet(e);for(const[t,n]of this.addressMapping.sheetEntries(e)){for(const e of this.graph.adjacentNodes(n))this.graph.markNodeAsDirty(e);this.removeVertex(n),this.addressMapping.removeCell(t)}this.stats.measure(_t.ADJUSTING_RANGES,()=>{const t=this.rangeMapping.removeRangesInSheet(e);for(const e of t)this.removeVertex(e);this.stats.measure(_t.ADJUSTING_ADDRESS_MAPPING,()=>{this.addressMapping.removeSheet(e)})})}clearSheet(e){const t=new Set;for(const[n,r]of this.addressMapping.sheetEntries(e))r instanceof Nn?t.add(r):this.setCellEmpty(n);for(const n of t.values())this.setArrayEmpty(n);this.addStructuralNodesToChangeSet()}removeColumns(e){this.stats.measure(_t.ADJUSTING_GRAPH,()=>{for(const[t,n]of this.addressMapping.entriesFromColumnsSpan(e)){for(const e of this.graph.adjacentNodes(n))this.graph.markNodeAsDirty(e);if(n instanceof Nn){if(!n.isLeftCorner(t))continue;this.shrinkArrayToCorner(n),this.arrayMapping.removeArray(n.getRange())}this.removeVertex(n)}}),this.stats.measure(_t.ADJUSTING_ADDRESS_MAPPING,()=>{this.addressMapping.removeColumns(e)});const t=this.stats.measure(_t.ADJUSTING_RANGES,()=>{const t=this.truncateRanges(e,e=>e.col);return this.getArrayVerticesRelatedToRanges(t)});return this.stats.measure(_t.ADJUSTING_ARRAY_MAPPING,()=>this.fixArraysAfterRemovingColumns(e.sheet,e.columnStart,e.numberOfColumns)),this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}addRows(e){this.stats.measure(_t.ADJUSTING_ADDRESS_MAPPING,()=>{this.addressMapping.addRows(e.sheet,e.rowStart,e.numberOfRows)});const t=this.stats.measure(_t.ADJUSTING_RANGES,()=>{const t=this.rangeMapping.moveAllRangesInSheetAfterRowByRows(e.sheet,e.rowStart,e.numberOfRows);return this.fixRangesWhenAddingRows(e.sheet,e.rowStart,e.numberOfRows),this.getArrayVerticesRelatedToRanges(t.verticesWithChangedSize)});this.stats.measure(_t.ADJUSTING_ARRAY_MAPPING,()=>{this.fixArraysAfterAddingRow(e.sheet,e.rowStart,e.numberOfRows)});for(const n of this.addressMapping.verticesFromRowsSpan(e))this.graph.markNodeAsDirty(n);return this.addStructuralNodesToChangeSet(),{affectedArrays:t}}addColumns(e){this.stats.measure(_t.ADJUSTING_ADDRESS_MAPPING,()=>{this.addressMapping.addColumns(e.sheet,e.columnStart,e.numberOfColumns)});const t=this.stats.measure(_t.ADJUSTING_RANGES,()=>{const t=this.rangeMapping.moveAllRangesInSheetAfterColumnByColumns(e.sheet,e.columnStart,e.numberOfColumns);return this.fixRangesWhenAddingColumns(e.sheet,e.columnStart,e.numberOfColumns),this.getArrayVerticesRelatedToRanges(t.verticesWithChangedSize)});this.stats.measure(_t.ADJUSTING_ARRAY_MAPPING,()=>this.fixArraysAfterAddingColumn(e.sheet,e.columnStart,e.numberOfColumns));for(const n of this.addressMapping.verticesFromColumnsSpan(e))this.graph.markNodeAsDirty(n);return this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}isThereSpaceForArray(e){const t=e.getRangeOrUndef();if(void 0===t)return!1;for(const n of t.addresses(this)){const t=this.addressMapping.getCell(n);if(void 0!==t&&!(t instanceof Kn)&&t!==e)return!1}return!0}moveCells(e,t,n,r){for(const i of e.addressesWithDirection(t,n,this)){const o=pr(r,i.col+t,i.row+n);let s=this.addressMapping.getCell(i);const a=this.addressMapping.getCell(o);if(this.addressMapping.removeCell(i),void 0!==s){this.graph.markNodeAsDirty(s),this.addressMapping.setCell(o,s);let t=void 0;for(const n of this.graph.adjacentNodes(s))n instanceof In&&!e.containsRange(n.range)&&(t=null!==t&&void 0!==t?t:this.fetchCellOrCreateEmpty(i).vertex,this.graph.addEdge(t,n),this.graph.removeEdge(s,n));t&&(this.graph.markNodeAsDirty(t),this.addressMapping.setCell(i,t))}if(void 0!==a){void 0===s&&this.addressMapping.removeCell(o);for(const e of this.graph.adjacentNodes(a))s=null!==s&&void 0!==s?s:this.fetchCellOrCreateEmpty(o).vertex,this.graph.addEdge(s,e),this.graph.markNodeAsDirty(s);this.removeVertex(a)}}for(const i of this.rangeMapping.rangeVerticesContainedInRange(e))for(const t of this.graph.adjacentNodes(i))if(t instanceof In&&!e.containsRange(t.range)){this.graph.removeEdge(i,t);for(const e of i.range.addresses(this)){const{vertex:n,id:r}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!==r&&void 0!==r?r:n,t),this.addressMapping.setCell(e,n),this.graph.markNodeAsDirty(n)}}this.rangeMapping.moveRangesInsideSourceRange(e,t,n,r)}setArrayEmpty(e){const t=Sr.spanFrom(e.getAddress(this.lazilyTransformingAstService),e.width,e.height),n=this.graph.adjacentNodes(e);for(const r of t.addresses(this))this.addressMapping.removeCell(r);for(const r of n.values()){const t=Mn(this.functionRegistry,r,e.getRange(),this.lazilyTransformingAstService,this);for(const e of t){const{vertex:t,id:n}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!==n&&void 0!==n?n:t,r)}t.length>0&&this.graph.markNodeAsDirty(r)}this.removeVertex(e),this.arrayMapping.removeArray(e.getRange())}addVertex(e,t){this.graph.addNodeAndReturnId(t),this.addressMapping.setCell(e,t)}addArrayVertex(e,t){this.graph.addNodeAndReturnId(t),this.setAddressMappingForArrayVertex(t,e)}*arrayFormulaNodes(){for(const e of this.graph.getNodes())e instanceof Nn&&(yield e)}*entriesFromRowsSpan(e){yield*this.addressMapping.entriesFromRowsSpan(e)}*entriesFromColumnsSpan(e){yield*this.addressMapping.entriesFromColumnsSpan(e)}fetchCell(e){return this.addressMapping.fetchCell(e)}getCell(e){return this.addressMapping.getCell(e)}getCellValue(e){return this.addressMapping.getCellValue(e)}getRawValue(e){return this.addressMapping.getRawValue(e)}getScalarValue(e){const t=this.addressMapping.getCellValue(e);return t instanceof jt?new lr(Bn.VALUE,Ne.ScalarExpected):t}existsEdge(e,t){return this.graph.existsEdge(e,t)}getSheetId(e){return this.sheetMapping.fetch(e)}getSheetHeight(e){return this.addressMapping.getHeight(e)}getSheetWidth(e){return this.addressMapping.getWidth(e)}getArray(e){return this.arrayMapping.getArray(e)}getRange(e,t){return this.rangeMapping.getRange(e,t)}topSortWithScc(){return this.graph.topSortWithScc()}markAsVolatile(e){this.graph.markNodeAsVolatile(e)}markAsDependentOnStructureChange(e){this.graph.markNodeAsChangingWithStructure(e)}forceApplyPostponedTransformations(){for(const e of this.graph.getNodes())e instanceof An&&e.ensureRecentData(this.lazilyTransformingAstService)}*rawValuesFromRange(e){for(const t of e.addresses(this)){const e=this.getScalarValue(t);e!==Et&&(yield[Ct(e),t])}}computeListOfValuesInRange(e){const t=[];for(const n of e.addresses(this)){const e=this.getScalarValue(n);t.push(e)}return t}shrinkArrayToCorner(e){this.cleanAddressMappingUnderArray(e);for(const t of this.adjacentArrayVertices(e)){let n;n=t instanceof On?this.formulaDirectDependenciesToArray(t,e):this.rangeDirectDependenciesToArray(t,e);let r=!1;for(const[i,o]of n)e.isLeftCorner(i)&&(r=!0),this.graph.addEdge(o,t),this.graph.markNodeAsDirty(o);r||this.graph.removeEdge(e,t)}this.graph.markNodeAsDirty(e)}isArrayInternalCell(e){const t=this.getCell(e);return t instanceof Nn&&!t.isLeftCorner(e)}getAndClearContentChanges(){const e=this.changes;return this.changes=Ht.empty(),e}getAdjacentNodesAddresses(e){const t=this.graph.adjacentNodes(e),n=[];return t.forEach(e=>{const t=e;t instanceof In?n.push(Cr(t.start,t.end)):n.push(t.getAddress(this.lazilyTransformingAstService))}),n}exchangeGraphNode(e,t){this.graph.addNodeAndReturnId(t);const n=this.graph.adjacentNodes(e);this.removeVertex(e),n.forEach(e=>{this.graph.hasNode(e)&&this.graph.addEdge(t,e)})}setArray(e,t){this.arrayMapping.setArray(e,t)}correctInfiniteRangesDependency(e){const t=this.graph.getInfiniteRanges().filter(({node:t})=>t.range.addressInRange(e));if(t.length<=0)return;const{vertex:n,id:r}=this.fetchCellOrCreateEmpty(e),i=null!==r&&void 0!==r?r:this.graph.getNodeId(n);t.forEach(({id:e})=>{this.graph.addEdge(i,e)})}exchangeOrAddGraphNode(e,t){e?this.exchangeGraphNode(e,t):this.graph.addNodeAndReturnId(t)}getArrayVerticesRelatedToRanges(e){const t=new Set;return e.forEach(e=>{this.graph.hasNode(e)&&this.graph.adjacentNodes(e).forEach(e=>{e instanceof Nn&&t.add(e)})}),t}correctInfiniteRangesDependenciesByRangeVertex(e){this.graph.getInfiniteRanges().forEach(({id:t,node:n})=>{const r=e.range.intersectionWith(n.range);void 0!==r&&r.addresses(this).forEach(e=>{const{vertex:n,id:r}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!==r&&void 0!==r?r:n,t)})})}cleanAddressMappingUnderArray(e){const t=e.getRange();for(const n of t.addresses(this)){const t=e.getArrayCellValue(n);this.getCell(n)===e?e.isLeftCorner(n)?this.changes.addChange(new lr(Bn.REF),n,t):(this.addressMapping.removeCell(n),this.changes.addChange(Et,n,t)):this.changes.addChange(Et,n,t)}}*formulaDirectDependenciesToArray(e,t){var n;const[,r]=null!==(n=this.formulaDependencyQuery(e))&&void 0!==n?n:[];if(void 0!==r)for(const i of r)if(!(i instanceof wt||i instanceof Sr)&&t.getRange().addressInRange(i)){const e=this.fetchCellOrCreateEmpty(i).vertex;yield[i,e]}}*rangeDirectDependenciesToArray(e,t){const{restRange:n}=this.rangeMapping.findSmallerRange(e.range);for(const r of n.addresses(this))if(t.getRange().addressInRange(r)){const e=this.fetchCellOrCreateEmpty(r).vertex;yield[r,e]}}*adjacentArrayVertices(e){const t=this.graph.adjacentNodes(e);for(const n of t)(n instanceof On||n instanceof In)&&(yield n)}addStructuralNodesToChangeSet(){this.graph.markChangingWithStructureNodesAsDirty()}fixRangesWhenAddingRows(e,t,n){const r=Array.from(this.rangeMapping.rangesInSheet(e));for(const i of r)if(i.range.includesRow(t+n))if(i.bruteForce){const e=i.range.rangeWithSameWidth(t,n);for(const t of e.addresses(this)){const{vertex:e,id:n}=this.fetchCellOrCreateEmpty(t);this.graph.addEdge(null!==n&&void 0!==n?n:e,i)}}else{let e=i,t=this.rangeMapping.findSmallerRange(e.range);if(void 0!==t.smallerRangeVertex)continue;while(void 0===t.smallerRangeVertex){const n=new In(Sr.spanFrom(e.range.start,e.range.width(),e.range.height()-1));this.rangeMapping.setRange(n),this.graph.addNodeAndReturnId(n);const r=new Sr(pr(e.range.start.sheet,e.range.start.col,e.range.end.row),e.range.end);this.addAllFromRange(r,e),this.graph.addEdge(n,e),e=n,t=this.rangeMapping.findSmallerRange(e.range)}this.graph.addEdge(t.smallerRangeVertex,e),this.addAllFromRange(t.restRange,e),this.graph.removeEdge(t.smallerRangeVertex,i)}}addAllFromRange(e,t){for(const n of e.addresses(this)){const{vertex:e,id:r}=this.fetchCellOrCreateEmpty(n);this.graph.addEdge(null!==r&&void 0!==r?r:e,t)}}fixRangesWhenAddingColumns(e,t,n){for(const r of this.rangeMapping.rangesInSheet(e))if(r.range.includesColumn(t+n)){let i;i=r.bruteForce?r.range.rangeWithSameHeight(t,n):Sr.spanFrom(pr(e,t,r.range.end.row),n,1);for(const e of i.addresses(this)){const{vertex:t,id:n}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!==n&&void 0!==n?n:t,r)}}}exchangeOrAddFormulaVertex(e){const t=e.getAddress(this.lazilyTransformingAstService),n=Sr.spanFrom(t,e.width,e.height),r=this.shrinkPossibleArrayAndGetCell(t);if(e instanceof Nn&&this.setArray(n,e),this.exchangeOrAddGraphNode(r,e),this.addressMapping.setCell(t,e),e instanceof Nn){if(!this.isThereSpaceForArray(e))return;for(const t of n.addresses(this)){if(e.isLeftCorner(t))continue;const n=this.getCell(t);this.exchangeOrAddGraphNode(n,e)}}for(const i of n.addresses(this))this.addressMapping.setCell(i,e)}setAddressMappingForArrayVertex(e,t){if(this.addressMapping.setCell(t,e),!(e instanceof Nn))return;const n=Sr.spanFromOrUndef(t,e.width,e.height);if(void 0!==n&&(this.setArray(n,e),this.isThereSpaceForArray(e)))for(const r of n.addresses(this))this.addressMapping.setCell(r,e)}truncateRanges(e,t){const{verticesToRemove:n,verticesToMerge:r,verticesWithChangedSize:i}=this.rangeMapping.truncateRanges(e,t);for(const[o,s]of r)this.mergeRangeVertices(o,s);for(const o of n)this.removeVertexAndCleanupDependencies(o);return i}fixArraysAfterAddingRow(e,t,n){if(this.arrayMapping.moveArrayVerticesAfterRowByRows(e,t,n),!(t<=0))for(const[,r]of this.arrayMapping.arraysInRows(Dt.fromRowStartAndEnd(e,t-1,t-1))){const i=r.getRange();for(let o=i.start.col;o<=i.end.col;++o)for(let s=t;s<=i.end.row;++s){const t=pr(e,o,s),i=pr(e,o,s+n),a=r.getArrayCellValue(t);this.addressMapping.moveCell(i,t),this.changes.addChange(Et,i,a)}}}fixArraysAfterRemovingRows(e,t,n){if(this.arrayMapping.moveArrayVerticesAfterRowByRows(e,t,-n),!(t<=0))for(const[,r]of this.arrayMapping.arraysInRows(Dt.fromRowStartAndEnd(e,t-1,t-1)))if(this.isThereSpaceForArray(r))for(const e of r.getRange().addresses(this))this.addressMapping.setCell(e,r);else this.setNoSpaceIfArray(r)}fixArraysAfterAddingColumn(e,t,n){if(this.arrayMapping.moveArrayVerticesAfterColumnByColumns(e,t,n),!(t<=0))for(const[,r]of this.arrayMapping.arraysInCols(Ft.fromColumnStartAndEnd(e,t-1,t-1))){const i=r.getRange();for(let o=i.start.row;o<=i.end.row;++o)for(let s=t;s<=i.end.col;++s){const t=pr(e,s,o),i=pr(e,s+n,o),a=r.getArrayCellValue(t);this.addressMapping.moveCell(i,t),this.changes.addChange(Et,i,a)}}}fixArraysAfterRemovingColumns(e,t,n){if(this.arrayMapping.moveArrayVerticesAfterColumnByColumns(e,t,-n),!(t<=0))for(const[,r]of this.arrayMapping.arraysInCols(Ft.fromColumnStartAndEnd(e,t-1,t-1)))if(this.isThereSpaceForArray(r))for(const e of r.getRange().addresses(this))this.addressMapping.setCell(e,r);else this.setNoSpaceIfArray(r)}shrinkPossibleArrayAndGetCell(e){const t=this.getCell(e);return t instanceof Nn?(this.setNoSpaceIfArray(t),this.getCell(e)):t}setNoSpaceIfArray(e){e instanceof Nn&&(this.shrinkArrayToCorner(e),e.setNoSpace())}removeVertex(e){this.removeVertexAndCleanupDependencies(e),e instanceof In&&this.rangeMapping.removeRange(e)}mergeRangeVertices(e,t){const n=this.graph.adjacentNodes(t);this.removeVertexAndCleanupDependencies(t),this.graph.removeEdgeIfExists(e,t),n.forEach(t=>{this.graph.hasNode(t)&&this.graph.addEdge(e,t)})}removeVertexAndCleanupDependencies(e){const t=new Set(this.graph.removeNode(e));while(t.size>0){const e=t.values().next().value;t.delete(e);const[n,r]=e;this.graph.hasNode(r)&&0===this.graph.adjacentNodesCount(r)&&((r instanceof In||r instanceof Kn)&&this.graph.removeNode(r).forEach(e=>t.add(e)),r instanceof In?this.rangeMapping.removeRange(r):r instanceof Kn&&this.addressMapping.removeCell(n))}}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Kn{constructor(){}getCellValue(){return Et}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class $n{constructor(e,t){this.parsedValue=e,this.rawValue=t}getValues(){return{parsedValue:this.parsedValue,rawValue:this.rawValue}}setValues(e){this.parsedValue=e.parsedValue,this.rawValue=e.rawValue}getCellValue(){return this.parsedValue}setCellValue(e){throw Error("SetCellValue is deprecated for ValueCellVertex")}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class qn{constructor(e,t){this.errors=e,this.rawInput=t}getCellValue(){const e=this.errors.map(e=>e.message).find(e=>e);return lr.parsingError(e)}getFormula(){return this.rawInput}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Qn{constructor(e,t){this.width=e,this.height=t,this.mapping=new Map}getCell(e){var t;return null===(t=this.mapping.get(e.col))||void 0===t?void 0:t.get(e.row)}setCell(e,t){this.width=Math.max(this.width,e.col+1),this.height=Math.max(this.height,e.row+1);let n=this.mapping.get(e.col);n||(n=new Map,this.mapping.set(e.col,n)),n.set(e.row,t)}has(e){var t;return!!(null===(t=this.mapping.get(e.col))||void 0===t?void 0:t.get(e.row))}getHeight(){return this.height}getWidth(){return this.width}removeCell(e){var t;null===(t=this.mapping.get(e.col))||void 0===t||t.delete(e.row)}addRows(e,t){this.mapping.forEach(n=>{const r=new Map;n.forEach((i,o)=>{o>=e&&(r.set(o+t,i),n.delete(o))}),r.forEach((e,t)=>{n.set(t,e)})}),this.height+=t}addColumns(e,t){const n=new Map;this.mapping.forEach((r,i)=>{i>=e&&(n.set(i+t,r),this.mapping.delete(i))}),n.forEach((e,t)=>{this.mapping.set(t,e)}),this.width+=t}removeRows(e){this.mapping.forEach(t=>{const n=new Map;t.forEach((r,i)=>{i>=e.rowStart&&(t.delete(i),i>e.rowEnd&&n.set(i-e.numberOfRows,r))}),n.forEach((e,n)=>{t.set(n,e)})});const t=Math.min(this.height-1,e.rowEnd),n=Math.max(0,t-e.rowStart+1);this.height=Math.max(0,this.height-n)}removeColumns(e){const t=new Map;this.mapping.forEach((n,r)=>{r>=e.columnStart&&(this.mapping.delete(r),r>e.columnEnd&&t.set(r-e.numberOfColumns,n))}),t.forEach((e,t)=>{this.mapping.set(t,e)});const n=Math.min(this.width-1,e.columnEnd),r=Math.max(0,n-e.columnStart+1);this.width=Math.max(0,this.width-r)}*getEntries(e){for(const[t,n]of this.mapping)for(const[r,i]of n)yield[pr(e,t,r),i]}*verticesFromColumn(e){const t=this.mapping.get(e);if(void 0!==t)for(const[n,r]of t)yield r}*verticesFromRow(e){for(const t of this.mapping.values()){const n=t.get(e);void 0!==n&&(yield n)}}*verticesFromColumnsSpan(e){for(const t of e.columns()){const e=this.mapping.get(t);if(void 0!==e)for(const[t,n]of e)yield n}}*verticesFromRowsSpan(e){for(const t of this.mapping.values())for(const n of e.rows()){const e=t.get(n);void 0!==e&&(yield e)}}*entriesFromRowsSpan(e){for(const[t,n]of this.mapping.entries())for(const r of e.rows()){const i=n.get(r);void 0!==i&&(yield[pr(e.sheet,t,r),i])}}*entriesFromColumnsSpan(e){for(const t of e.columns()){const n=this.mapping.get(t);if(void 0!==n)for(const[r,i]of n.entries())yield[pr(e.sheet,t,r),i]}}*vertices(){for(const[e,t]of this.mapping)for(const[n,r]of t)void 0!==r&&(yield r)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Zn{constructor(e,t){this.width=e,this.height=t,this.mapping=new Array(t);for(let n=0;n<t;n++)this.mapping[n]=new Array(e)}getCell(e){return this.getCellVertex(e.col,e.row)}setCell(e,t){this.width=Math.max(this.width,e.col+1),this.height=Math.max(this.height,e.row+1);const n=this.mapping[e.row];n||(this.mapping[e.row]=new Array(this.width)),this.mapping[e.row][e.col]=t}has(e){const t=this.mapping[e.row];return!!t&&!!t[e.col]}getHeight(){return this.height}getWidth(){return this.width}removeCell(e){void 0!==this.mapping[e.row]&&delete this.mapping[e.row][e.col]}addRows(e,t){const n=[];for(let r=0;r<t;r++)n.push(new Array(this.width));this.mapping.splice(e,0,...n),this.height+=t}addColumns(e,t){for(let n=0;n<this.height;n++)this.mapping[n].splice(e,0,...new Array(t));this.width+=t}removeRows(e){this.mapping.splice(e.rowStart,e.numberOfRows);const t=Math.min(this.height-1,e.rowEnd),n=Math.max(0,t-e.rowStart+1);this.height=Math.max(0,this.height-n)}removeColumns(e){for(let r=0;r<this.height;r++)this.mapping[r].splice(e.columnStart,e.numberOfColumns);const t=Math.min(this.width-1,e.columnEnd),n=Math.max(0,t-e.columnStart+1);this.width=Math.max(0,this.width-n)}*getEntries(e){for(let t=0;t<this.height;++t)for(let n=0;n<this.width;++n){const r=this.getCellVertex(n,t);r&&(yield[pr(e,n,t),r])}}*verticesFromColumn(e){for(let t=0;t<this.height;++t){const n=this.getCellVertex(e,t);n&&(yield n)}}*verticesFromRow(e){for(let t=0;t<this.width;++t){const n=this.getCellVertex(t,e);n&&(yield n)}}*verticesFromColumnsSpan(e){for(let t=e.columnStart;t<=e.columnEnd;++t)for(let e=0;e<this.height;++e){const n=this.getCellVertex(t,e);n&&(yield n)}}*verticesFromRowsSpan(e){for(let t=0;t<this.width;++t)for(let n=e.rowStart;n<=e.rowEnd;++n){const e=this.getCellVertex(t,n);e&&(yield e)}}*entriesFromRowsSpan(e){for(let t=0;t<this.width;++t)for(let n=e.rowStart;n<=e.rowEnd;++n){const r=this.getCellVertex(t,n);r&&(yield[pr(e.sheet,t,n),r])}}*entriesFromColumnsSpan(e){for(let t=e.columnStart;t<=e.columnEnd;++t)for(let n=0;n<this.height;++n){const r=this.getCellVertex(t,n);r&&(yield[pr(e.sheet,t,n),r])}}*vertices(){for(let e=0;e<this.height;++e)for(let t=0;t<this.width;++t){const n=this.getCellVertex(t,e);n&&(yield n)}}getCellVertex(e,t){var n;return null===(n=this.mapping[t])||void 0===n?void 0:n[e]}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */(function(e){e["DIV_BY_ZERO"]="DIV_BY_ZERO",e["NAME"]="NAME",e["VALUE"]="VALUE",e["NUM"]="NUM",e["NA"]="NA",e["CYCLE"]="CYCLE",e["REF"]="REF",e["SPILL"]="SPILL",e["LIC"]="LIC",e["ERROR"]="ERROR"})(Bn||(Bn={})),function(e){e["FORMULA"]="FORMULA",e["VALUE"]="VALUE",e["ARRAY"]="ARRAY",e["EMPTY"]="EMPTY",e["ARRAYFORMULA"]="ARRAYFORMULA"}(Wn||(Wn={}));const Jn=(e,t)=>e instanceof Nn?e.isLeftCorner(t)?Wn.ARRAYFORMULA:Wn.ARRAY:e instanceof An||e instanceof qn?Wn.FORMULA:e instanceof $n?Wn.VALUE:Wn.EMPTY;var er,tr;(function(e){e["EMPTY"]="EMPTY",e["NUMBER"]="NUMBER",e["STRING"]="STRING",e["BOOLEAN"]="BOOLEAN",e["ERROR"]="ERROR"})(er||(er={})),function(e){e["NUMBER"]="NUMBER"}(tr||(tr={}));const nr=Object.assign(Object.assign({},er),tr),rr=Object.assign(Object.assign({},er),xt),ir=e=>{switch(e){case nr.EMPTY:return 0;case nr.NUMBER:return 1;case nr.STRING:return 2;case nr.BOOLEAN:return 3;case nr.ERROR:return 4}throw new Error("Cell value not computed")},or=e=>{if(e===Et)return nr.EMPTY;if(e instanceof lr||e instanceof jt)return nr.ERROR;if("string"===typeof e)return nr.STRING;if(Mt(e))return nr.NUMBER;if("boolean"===typeof e)return nr.BOOLEAN;throw new Error("Cell value not computed")},sr=e=>Mt(e)?Lt(e):or(e),ar=e=>Mt(e)?Pt(e):void 0;class lr{constructor(e,t,n){this.type=e,this.message=t,this.root=n}static parsingError(e){return new lr(Bn.ERROR,`${Ne.ParseError}${e?" "+e:""}`)}attachRootVertex(e){return void 0===this.root?new lr(this.type,this.message,e):this}}const cr=(e,t)=>({sheet:e,row:t}),hr=e=>e.row<0,ur=(e,t)=>({sheet:e,col:t}),dr=e=>e.col<0,pr=(e,t,n)=>({sheet:e,col:t,row:n}),fr=e=>e.col<0||e.row<0,gr=(e,t,n,r)=>pr(t,e.col+n,e.row+r),mr=e=>`${e.sheet},${e.row},${e.col}`;function yr(e){var t,n,r;return e&&("object"===typeof e||"function"===typeof e)&&"number"===typeof(null===(t=e)||void 0===t?void 0:t.sheet)&&"number"===typeof(null===(n=e)||void 0===n?void 0:n.col)&&"number"===typeof(null===(r=e)||void 0===r?void 0:r.row)}const wr=(e,t)=>{var n;return null!==(n=e.sheet)&&void 0!==n?n:t.sheet},br=(e,t)=>e.sheet===t.sheet&&e.col===t.col&&e.row===t.row,vr="AbsoluteCellRange: Wrong range size";function Er(e){return!(!e||"object"!==typeof e&&"function"!==typeof e)&&("start"in e&&yr(e.start)&&"end"in e&&yr(e.end))}const Cr=(e,t)=>({start:e,end:t});class Sr{constructor(e,t){if(e.sheet!==t.sheet)throw new $t(e.sheet,t.sheet);this.start=pr(e.sheet,e.col,e.row),this.end=pr(t.sheet,t.col,t.row)}get sheet(){return this.start.sheet}static fromSimpleCellAddresses(e,t){if(e.sheet!==t.sheet)throw new $t(e.sheet,t.sheet);const n=t.col-e.col,r=t.row-e.row;return Number.isFinite(r)&&Number.isFinite(n)?new Sr(e,t):Number.isFinite(r)?new Tr(e.sheet,e.row,t.row):new Rr(e.sheet,e.col,t.col)}static fromAst(e,t){return e.type===G.CELL_RANGE?Sr.fromCellRange(e,t):e.type===G.COLUMN_RANGE?Rr.fromColumnRange(e,t):Tr.fromRowRangeAst(e,t)}static fromAstOrUndef(e,t){try{return Sr.fromAst(e,t)}catch(n){return}}static fromCellRange(e,t){return new Sr(e.start.toSimpleCellAddress(t),e.end.toSimpleCellAddress(t))}static spanFrom(e,t,n){const r=Sr.spanFromOrUndef(e,t,n);if(void 0===r)throw new Error(vr);return r}static spanFromOrUndef(e,t,n){if(!Number.isFinite(t)&&Number.isFinite(n)){if(0!==e.col)return;return new Tr(e.sheet,e.row,e.row+n-1)}if(!Number.isFinite(n)&&Number.isFinite(t)){if(0!==e.row)return;return new Rr(e.sheet,e.col,e.col+t-1)}if(Number.isFinite(n)&&Number.isFinite(t))return new Sr(e,pr(e.sheet,e.col+t-1,e.row+n-1))}static fromCoordinates(e,t,n,r,i){return new Sr(pr(e,t,n),pr(e,r,i))}isFinite(){return Number.isFinite(this.size())}doesOverlap(e){return this.start.sheet==e.start.sheet&&(!(this.end.row<e.start.row||this.start.row>e.end.row)&&!(this.end.col<e.start.col||this.start.col>e.end.col))}addressInRange(e){return this.sheet===e.sheet&&(this.start.row<=e.row&&this.end.row>=e.row&&this.start.col<=e.col&&this.end.col>=e.col)}columnInRange(e){return this.sheet===e.sheet&&(this.start.col<=e.col&&this.end.col>=e.col)}rowInRange(e){return this.sheet===e.sheet&&(this.start.row<=e.row&&this.end.row>=e.row)}containsRange(e){return this.addressInRange(e.start)&&this.addressInRange(e.end)}intersectionWith(e){if(this.sheet!==e.start.sheet)return;const t=Math.max(this.start.row,e.start.row),n=Math.min(this.end.row,e.end.row),r=Math.max(this.start.col,e.start.col),i=Math.min(this.end.col,e.end.col);return t>n||r>i?void 0:new Sr(pr(this.sheet,r,t),pr(this.sheet,i,n))}includesRow(e){return this.start.row<e&&this.end.row>=e}includesColumn(e){return this.start.col<e&&this.end.col>=e}shiftByRows(e){this.start.row+=e,this.end.row+=e}expandByRows(e){this.end.row+=e}shiftByColumns(e){this.start.col+=e,this.end.col+=e}shifted(e,t){return Sr.spanFrom(pr(this.sheet,this.start.col+e,this.start.row+t),this.width(),this.height())}expandByColumns(e){this.end.col+=e}moveToSheet(e){this.start.sheet=e,this.end.sheet=e}removeSpan(e){e instanceof Dt?this.removeRows(e.start,e.end):this.removeColumns(e.start,e.end)}shouldBeRemoved(){return this.width()<=0||this.height()<=0}rangeWithSameWidth(e,t){return Sr.spanFrom(pr(this.sheet,this.start.col,e),this.width(),t)}rangeWithSameHeight(e,t){return Sr.spanFrom(pr(this.sheet,e,this.start.row),t,this.height())}toString(){return`${this.start.sheet},${this.start.col},${this.start.row},${this.end.col},${this.end.row}`}width(){return this.end.col-this.start.col+1}height(){return this.end.row-this.start.row+1}size(){return this.height()*this.width()}arrayOfAddressesInRange(){const e=[];for(let t=0;t<this.height();++t){e[t]=[];for(let n=0;n<this.width();++n){const r=pr(this.sheet,this.start.col+n,this.start.row+t);e[t].push(r)}}return e}withStart(e){return new Sr(e,this.end)}sameDimensionsAs(e){return this.width()===e.width()&&this.height()===e.height()}sameAs(e){return br(this.start,e.start)&&br(this.end,e.end)}addressesArrayMap(e,t){const n=[];let r=this.start.row;while(r<=this.effectiveEndRow(e)){let i=this.start.col;const o=[];while(i<=this.effectiveEndColumn(e))o.push(t(pr(this.start.sheet,i,r))),i++;n.push(o),r++}return n}addresses(e){const t=[];let n=this.start.row;const r=this.effectiveEndRow(e),i=this.effectiveEndColumn(e);while(n<=r){let e=this.start.col;while(e<=i)t.push(pr(this.start.sheet,e,n)),e++;n++}return t}*addressesWithDirection(e,t,n){if(e>0)if(t>0){let e=this.effectiveEndRow(n);while(e>=this.start.row){let t=this.effectiveEndColumn(n);while(t>=this.start.col)yield pr(this.start.sheet,t,e),t-=1;e-=1}}else{let e=this.start.row;while(e<=this.effectiveEndRow(n)){let t=this.effectiveEndColumn(n);while(t>=this.start.col)yield pr(this.start.sheet,t,e),t-=1;e+=1}}else if(t>0){let e=this.effectiveEndRow(n);while(e>=this.start.row){let t=this.start.col;while(t<=this.effectiveEndColumn(n))yield pr(this.start.sheet,t,e),t+=1;e-=1}}else{let e=this.start.row;while(e<=this.effectiveEndRow(n)){let t=this.start.col;while(t<=this.effectiveEndColumn(n))yield pr(this.start.sheet,t,e),t+=1;e+=1}}}getAddress(e,t){if(e<0||t<0||t>this.height()-1||e>this.width()-1)throw Error("Index out of bound");return pr(this.start.sheet,this.start.col+e,this.start.row+t)}exceedsSheetSizeLimits(e,t){return this.end.col>=e||this.end.row>=t}effectiveEndColumn(e){return this.end.col}effectiveEndRow(e){return this.end.row}effectiveWidth(e){return this.width()}effectiveHeight(e){return this.height()}removeRows(e,t){if(!(e>this.end.row)){if(t<this.start.row){const n=t-e+1;return this.shiftByRows(-n)}e<=this.start.row&&(this.start.row=e),this.end.row-=Math.min(t,this.end.row)-e+1}}removeColumns(e,t){if(!(e>this.end.col)){if(t<this.start.col){const n=t-e+1;return this.shiftByColumns(-n)}e<=this.start.col&&(this.start.col=e),this.end.col-=Math.min(t,this.end.col)-e+1}}}class Rr extends Sr{constructor(e,t,n){super(pr(e,t,0),pr(e,n,Number.POSITIVE_INFINITY))}static fromColumnRange(e,t){const n=e.start.toSimpleColumnAddress(t),r=e.end.toSimpleColumnAddress(t);if(n.sheet!==r.sheet)throw new $t(n.sheet,r.sheet);return new Rr(n.sheet,n.col,r.col)}shouldBeRemoved(){return this.width()<=0}shiftByRows(e){}expandByRows(e){}shifted(e,t){return new Rr(this.sheet,this.start.col+e,this.end.col+e)}rangeWithSameHeight(e,t){return new Rr(this.sheet,e,e+t-1)}exceedsSheetSizeLimits(e,t){return this.end.col>=e}effectiveEndRow(e){return this.effectiveHeight(e)-1}effectiveHeight(e){return e.getSheetHeight(this.sheet)}removeRows(e,t){}}class Tr extends Sr{constructor(e,t,n){super(pr(e,0,t),pr(e,Number.POSITIVE_INFINITY,n))}static fromRowRangeAst(e,t){const n=e.start.toSimpleRowAddress(t),r=e.end.toSimpleRowAddress(t);if(n.sheet!==r.sheet)throw new $t(n.sheet,r.sheet);return new Tr(n.sheet,n.row,r.row)}shouldBeRemoved(){return this.height()<=0}shiftByColumns(e){}expandByColumns(e){}shifted(e,t){return new Tr(this.sheet,this.start.row+t,this.end.row+t)}rangeWithSameWidth(e,t){return new Tr(this.sheet,e,e+t-1)}exceedsSheetSizeLimits(e,t){return this.end.row>=t}effectiveEndColumn(e){return this.effectiveWidth(e)-1}effectiveWidth(e){return e.getSheetWidth(this.sheet)}removeColumns(e,t){}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Or{constructor(e,t,n){this.formulaAddress=e,this.arraysFlag=t,this.formulaVertex=n}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */function Nr(e){const t=e.caseSensitive?e.accentSensitive?"variant":"case":e.accentSensitive?"accent":"base",n=e.caseFirst,r=e.ignorePunctuation;return new Intl.Collator(e.localeLang,{sensitivity:t,caseFirst:n,ignorePunctuation:r})}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */const Ar="i",Ir=/^\s*([+-]?)\s*(([\d\.,]+(e[+-]?\d+)?)\s*([ij]?)|([ij]))\s*(([+-])\s*([+-]?)\s*(([\d\.,]+(e[+-]?\d+)?)\s*([ij]?)|([ij])))?$/;class Mr{constructor(e,t,n){this.config=e,this.dateTimeHelper=t,this.numberLiteralsHelper=n,this.lt=(e,t)=>this.compare(e,t)<0,this.leq=(e,t)=>this.compare(e,t)<=0,this.gt=(e,t)=>this.compare(e,t)>0,this.geq=(e,t)=>this.compare(e,t)>=0,this.eq=(e,t)=>0===this.compare(e,t),this.neq=(e,t)=>0!==this.compare(e,t),this.pow=(e,t)=>Math.pow(Ct(e),Ct(t)),this.addWithEpsilonRaw=(e,t)=>{const n=e+t;return Math.abs(n)<this.actualEps*Math.abs(e)?0:n},this.addWithEpsilon=(e,t)=>{const n=Xr(e,t);return this.ExtendedNumberFactory(this.addWithEpsilonRaw(Ct(e),Ct(t)),n)},this.unaryMinus=e=>Rt(e,-Ct(e)),this.unaryPlus=e=>e,this.unaryPercent=e=>new It(Ct(e)/100),this.concat=(e,t)=>e.concat(t),this.nonstrictadd=(e,t)=>e instanceof lr?e:t instanceof lr?t:"number"===typeof e?"number"===typeof t?this.addWithEpsilonRaw(e,t):e:"number"===typeof t?t:0,this.subtract=(e,t)=>{const n=Xr(e,t),r=Ct(e),i=Ct(t);let o=r-i;return Math.abs(o)<this.actualEps*Math.abs(r)&&(o=0),this.ExtendedNumberFactory(o,n)},this.divide=(e,t)=>{const n=Ct(e),r=Ct(t);if(0===r)return new lr(Bn.DIV_BY_ZERO);{const i=Kr(e,t);return this.ExtendedNumberFactory(n/r,i)}},this.multiply=(e,t)=>{const n=Kr(e,t);return this.ExtendedNumberFactory(Ct(e)*Ct(t),n)},this.manyToExactComplex=e=>{const t=[];for(const n of e){if(n instanceof lr)return n;if(Mt(n)||"string"===typeof n){const e=this.coerceScalarToComplex(n);e instanceof lr||t.push(e)}}return t},this.coerceNumbersExactRanges=e=>this.manyToNumbers(e,this.manyToExactNumbers),this.coerceNumbersCoerceRangesDropNulls=e=>this.manyToNumbers(e,this.manyToCoercedNumbersDropNulls),this.manyToExactNumbers=e=>{const t=[];for(const n of e){if(n instanceof lr)return n;Mt(n)&&t.push(Ct(n))}return t},this.manyToOnlyNumbersDropNulls=e=>{const t=[];for(const n of e){if(n instanceof lr)return n;if(Mt(n))t.push(Ct(n));else if(n!==Et)return new lr(Bn.VALUE,Ne.NumberExpected)}return t},this.manyToCoercedNumbersDropNulls=e=>{const t=[];for(const n of e){if(n instanceof lr)return n;if(n===Et)continue;const e=this.coerceScalarToNumberOrError(n);Mt(e)&&t.push(Ct(e))}return t},this.collator=Nr(e),this.actualEps=e.smartRounding?e.precisionEpsilon:0}eqMatcherFunction(e){const t=this.buildRegex(e);return e=>"string"===typeof e&&t.test(this.normalizeString(e))}neqMatcherFunction(e){const t=this.buildRegex(e);return e=>!("string"===typeof e)||!t.test(this.normalizeString(e))}searchString(e,t){var n;const r=this.buildRegex(e,!1),i=r.exec(t);return null!==(n=null===i||void 0===i?void 0:i.index)&&void 0!==n?n:-1}requiresRegex(e){if(!this.config.useRegularExpressions&&!this.config.useWildcards)return!this.config.matchWholeCell;for(let t=0;t<e.length;t++){const n=e.charAt(t);if(Vr(n)||this.config.useRegularExpressions&&Wr(n))return!0}return!1}floatCmp(e,t){const n=Ct(e),r=Ct(t),i=1+this.actualEps;return r>=0&&n*i>=r&&n<=r*i||r<=0&&n*i<=r&&n>=r*i?0:n>r?1:-1}coerceScalarToNumberOrError(e){var t;return e instanceof lr?e:null!==(t=this.coerceToMaybeNumber(e))&&void 0!==t?t:new lr(Bn.VALUE,Ne.NumberCoercion)}coerceToMaybeNumber(e){var t;return null!==(t=this.coerceNonDateScalarToMaybeNumber(e))&&void 0!==t?t:"string"===typeof e?this.dateTimeHelper.dateStringToDateNumber(e):void 0}coerceNonDateScalarToMaybeNumber(e){if(e===Et)return 0;if("string"===typeof e){if(""===e)return 0;const t=this.coerceStringToMaybePercentNumber(e);if(void 0!==t)return t;const n=this.coerceStringToMaybeCurrencyNumber(e);return void 0!==n?n:this.numberLiteralsHelper.numericStringToMaybeNumber(e.trim())}return Mt(e)?e:"boolean"===typeof e?Number(e):void 0}coerceStringToMaybePercentNumber(e){const t=e.trim();if(t.endsWith("%")){const e=t.slice(0,t.length-1).trim(),n=this.numberLiteralsHelper.numericStringToMaybeNumber(e);if(void 0!==n)return new It(n/100)}}coerceStringToMaybeCurrencyNumber(e){const t=this.currencyMatcher(e.trim());if(void 0!==t){const[e,n]=t,r=this.numberLiteralsHelper.numericStringToMaybeNumber(n);if(void 0!==r)return new Ot(r,e)}}currencyMatcher(e){for(const t of this.config.currencySymbol){if(e.startsWith(t))return[t,e.slice(t.length).trim()];if(e.endsWith(t))return[t,e.slice(0,e.length-t.length).trim()]}}coerceComplexExactRanges(e){const t=[];for(const r of e)if(r instanceof jt)t.push(r);else if(r!==Et){const e=this.coerceScalarToComplex(r);if(e instanceof lr)return e;t.push(e)}const n=[];for(const r of t)if(r instanceof jt){const e=this.manyToExactComplex(r.valuesFromTopLeftCorner());if(e instanceof lr)return e;n.push(...e)}else n.push(r);return n}coerceScalarToComplex(e){return e instanceof lr?e:e===Et?[0,0]:Mt(e)?[Ct(e),0]:"string"===typeof e?this.coerceStringToComplex(e):new lr(Bn.NUM,Ne.ComplexNumberExpected)}ExtendedNumberFactory(e,t){const{type:n,format:r}=t;switch(n){case xt.NUMBER_RAW:return e;case xt.NUMBER_CURRENCY:return new Ot(e,null!==r&&void 0!==r?r:this.config.currencySymbol[0]);case xt.NUMBER_DATE:return new Tt(e,r);case xt.NUMBER_DATETIME:return new At(e,r);case xt.NUMBER_TIME:return new Nt(e,r);case xt.NUMBER_PERCENT:return new It(e,r)}}buildRegex(e,t=!0){let n;e=this.normalizeString(e);let r=this.config.useWildcards,i=this.config.useRegularExpressions;if(i)try{RegExp(e)}catch(o){i=!1,r=!1}return n=i?Yr(e,this.config.caseSensitive):r?Gr(e,this.config.caseSensitive):zr(e,this.config.caseSensitive),this.config.matchWholeCell&&t?RegExp("^("+n+")$"):RegExp(n)}normalizeString(e){return this.config.caseSensitive||(e=e.toLowerCase()),this.config.accentSensitive||(e=Qr(e,"nfd").replace(/[\u0300-\u036f]/g,"")),e}compare(e,t){if("string"===typeof e||"string"===typeof t){const n="string"===typeof e?this.dateTimeHelper.dateStringToDateNumber(e):e,r="string"===typeof t?this.dateTimeHelper.dateStringToDateNumber(t):t;if(Mt(n)&&Mt(r))return this.floatCmp(n,r)}return e===Et?e=Pr(t):t===Et&&(t=Pr(e)),"string"===typeof e&&"string"===typeof t?this.stringCmp(e,t):"boolean"===typeof e&&"boolean"===typeof t?Dr(Lr(e),Lr(t)):Mt(e)&&Mt(t)?this.floatCmp(e,t):e===Et&&t===Et?0:Dr(ir(or(e)),ir(or(t)))}stringCmp(e,t){return this.collator.compare(e,t)}manyToNumbers(e,t){const n=[];for(const i of e)if(i instanceof jt)n.push(i);else{const e=Ct(this.coerceScalarToNumberOrError(i));if(e instanceof lr)return e;n.push(e)}const r=[];for(const i of n)if(i instanceof jt){const e=t(i.valuesFromTopLeftCorner());if(e instanceof lr)return e;r.push(...e)}else r.push(i);return r}coerceStringToComplex(e){const t=Ir.exec(e);if(null===t)return new lr(Bn.NUM,Ne.ComplexNumberExpected);let n,r;return n=void 0!==t[6]?"-"===t[1]?[0,-1]:[0,1]:this.parseComplexToken(t[1]+t[3],t[5]),n instanceof lr||void 0===t[8]?n:(r=void 0!==t[14]?"-"===t[9]?[0,-1]:[0,1]:this.parseComplexToken(t[9]+t[11],t[13]),r instanceof lr?r:""!==t[5]||""===t[13]?new lr(Bn.NUM,Ne.ComplexNumberExpected):"+"===t[8]?[n[0]+r[0],n[1]+r[1]]:[n[0]-r[0],n[1]-r[1]])}parseComplexToken(e,t){const n=Ct(this.coerceNonDateScalarToMaybeNumber(e));return void 0===n?new lr(Bn.NUM,Ne.ComplexNumberExpected):""===t?[n,0]:[0,n]}}function xr([e,t],n){if(!isFinite(e)||!isFinite(t))return new lr(Bn.NUM,Ne.NaN);if(n=null!==n&&void 0!==n?n:Ar,0===t)return""+e;const r=`${-1===t||1===t?"":Math.abs(t)}${n}`;return 0===e?`${t<0?"-":""}${r}`:`${e}${t<0?"-":"+"}${r}`}function _r(e){return e instanceof jt?e:jt.fromScalar(e)}function Lr(e){return Number(e)}function Pr(e){return"string"===typeof e?"":Mt(e)?0:"boolean"!==typeof e&&Et}function kr(e){if(e instanceof lr||"boolean"===typeof e)return e;if(e===Et)return!1;if(Mt(e))return 0!==Ct(e);{const t=e.toUpperCase();return"TRUE"===t||"FALSE"!==t&&(""!==t&&void 0)}}function jr(e){return e instanceof lr||"string"===typeof e?e:e===Et?"":Mt(e)?Ct(e).toString():e?"TRUE":"FALSE"}function Hr(e){return e===Et?0:e}function Dr(e,t){const n=Ct(e),r=Ct(t);return n>r?1:n<r?-1:0}function Fr(e){return isNaN(e)||e===1/0||e===-1/0}function Ur(e){return 0===e?0:e}function Vr(e){return["*","?"].includes(e)}const Br=["{","}","[","]","(",")","<",">","=",".","+","-",",","\\","$","^","!"];function Wr(e){return Br.includes(e)}function Gr(e,t){let n="";for(let r=0;r<e.length;r++){const i=e.charAt(r);if("~"===i){if(r==e.length-1){n+="~";continue}const t=e.charAt(r+1);Vr(t)||Wr(t)?(n+="\\"+t,r++):(n+=t,r++)}else Vr(i)?n+="."+i:Wr(i)?n+="\\"+i:n+=t?i:i.toLowerCase()}return n}function zr(e,t){let n="";for(let r=0;r<e.length;r++){const i=e.charAt(r);Vr(i)||Wr(i)?n+="\\"+i:n+=t?i:i.toLowerCase()}return n}function Yr(e,t){let n="";for(let r=0;r<e.length;r++){const i=e.charAt(r);Vr(i)||Wr(i)?n+=i:n+=t?i:i.toLowerCase()}return n}function Xr(e,t){const{type:n,format:r}=kt(e),{type:i,format:o}=kt(t);if(n===xt.NUMBER_RAW)return{type:i,format:o};if(i===xt.NUMBER_RAW)return{type:n,format:r};if((n===xt.NUMBER_DATETIME||n===xt.NUMBER_DATE)&&(i===xt.NUMBER_DATETIME||i===xt.NUMBER_DATE))return{type:xt.NUMBER_RAW};if(n===xt.NUMBER_TIME){if(i===xt.NUMBER_DATE)return{type:xt.NUMBER_DATETIME,format:`${o} ${r}`};if(i===xt.NUMBER_DATETIME)return{type:xt.NUMBER_DATETIME,format:o}}if(i===xt.NUMBER_TIME){if(n===xt.NUMBER_DATE)return{type:xt.NUMBER_DATETIME,format:`${r} ${o}`};if(n===xt.NUMBER_DATETIME)return{type:xt.NUMBER_DATETIME,format:r}}return{type:n,format:r}}function Kr(e,t){let{type:n,format:r}=kt(e),{type:i,format:o}=kt(t);return n===xt.NUMBER_PERCENT&&(n=xt.NUMBER_RAW,r=void 0),i===xt.NUMBER_PERCENT&&(i=xt.NUMBER_RAW,o=void 0),n===xt.NUMBER_RAW?{type:i,format:o}:i===xt.NUMBER_RAW?{type:n,format:r}:{type:xt.NUMBER_RAW}}function $r(e){return Qr(e.toLowerCase(),"nfd").replace(/[\u0300-\u036f]/g,"")}function qr(e,t){var n;if(e.isAdHoc())return null===(n=e.data[0])||void 0===n?void 0:n[0];const r=e.range;if(t.formulaAddress.sheet===r.sheet)if(1===r.width()){const n=t.formulaAddress.row-r.start.row;if(n>=0&&n<r.height())return e.data[n][0]}else if(1===r.height()){const n=t.formulaAddress.col-r.start.col;if(n>=0&&n<r.width())return e.data[0][n]}}function Qr(e,t){return e.normalize(t.toUpperCase())}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */var Zr;(function(e){e["STRING"]="STRING",e["NUMBER"]="NUMBER",e["BOOLEAN"]="BOOLEAN",e["SCALAR"]="SCALAR",e["NOERROR"]="NOERROR",e["RANGE"]="RANGE",e["INTEGER"]="INTEGER",e["COMPLEX"]="COMPLEX",e["ANY"]="ANY"})(Zr||(Zr={}));class Jr{constructor(e){this.coerceScalarToNumberOrError=e=>this.arithmeticHelper.coerceScalarToNumberOrError(e),this.runFunction=(e,t,n,r)=>{const i=this.evaluateArguments(e,t,n),o=i.map(([e,t])=>e),s=i.map(([e,t])=>t),a=this.buildMetadataForEachArgumentValue(o.length,n),l=t.arraysFlag&&!n.vectorizationForbidden;if(!this.isNumberOfArgumentValuesValid(a,o.length))return new lr(Bn.NA,Ne.WrongArgNumber);const[c,h]=l?this.calculateSizeOfVectorizedResultArray(o,a):[1,1];if(1===c&&1===h){const e=this.vectorizeAndBroadcastArgumentsIfNecessary(l,o,a,0,0);return this.calculateSingleCellOfResultArray(t,e,a,s,r,n.returnNumberType)}const u=[...Array(c).keys()].map(e=>[...Array(h).keys()].map(i=>{const c=this.vectorizeAndBroadcastArgumentsIfNecessary(l,o,a,e,i),h=this.calculateSingleCellOfResultArray(t,c,a,s,r,n.returnNumberType);if(h instanceof jt)throw new Error("Function returning array cannot be vectorized.");return h}));return jt.onlyValues(u)},this.runFunctionWithReferenceArgument=(e,t,n,r,i,o=(()=>new lr(Bn.NA,Ne.CellRefExpected)))=>{if(0===e.length)return this.returnNumberWrapper(r(),n.returnNumberType);if(e.length>1)return new lr(Bn.NA,Ne.WrongArgNumber);let s,a=e[0];while(a.type===G.PARENTHESIS)a=a.expression;if(a.type===G.CELL_REFERENCE)s=a.reference.toSimpleCellAddress(t.formulaAddress);else if(a.type===G.CELL_RANGE||a.type===G.COLUMN_RANGE||a.type===G.ROW_RANGE)try{s=Sr.fromAst(a,t.formulaAddress).start}catch(l){return new lr(Bn.REF,Ne.CellRefExpected)}return void 0!==s?this.returnNumberWrapper(i(s),n.returnNumberType):this.runFunction(e,t,n,o)},this.interpreter=e,this.dependencyGraph=e.dependencyGraph,this.columnSearch=e.columnSearch,this.config=e.config,this.serialization=e.serialization,this.arraySizePredictor=e.arraySizePredictor,this.dateTimeHelper=e.dateTimeHelper,this.arithmeticHelper=e.arithmeticHelper}evaluateAst(e,t){return this.interpreter.evaluateAst(e,t)}arraySizeForAst(e,t){return this.arraySizePredictor.checkArraySizeForAst(e,t)}listOfScalarValues(e,t){const n=[];for(const r of e){const e=this.evaluateAst(r,t);if(e instanceof jt)for(const t of e.valuesFromTopLeftCorner())n.push([t,!0]);else n.push([e,!1])}return n}coerceToType(e,t,n){let r;if(e instanceof jt)switch(t.argumentType){case Zr.RANGE:case Zr.ANY:r=e;break;default:{const t=qr(e,n);if(void 0===t)return;e=t}}if(!(e instanceof jt))switch(t.argumentType){case Zr.INTEGER:case Zr.NUMBER:const n=this.coerceScalarToNumberOrError(e);if(!Mt(n)){r=n;break}const i=Ct(n);if(void 0!==t.maxValue&&i>t.maxValue)return new lr(Bn.NUM,Ne.ValueLarge);if(void 0!==t.minValue&&i<t.minValue)return new lr(Bn.NUM,Ne.ValueSmall);if(void 0!==t.lessThan&&i>=t.lessThan)return new lr(Bn.NUM,Ne.ValueLarge);if(void 0!==t.greaterThan&&i<=t.greaterThan)return new lr(Bn.NUM,Ne.ValueSmall);if(t.argumentType===Zr.INTEGER&&!Number.isInteger(i))return new lr(Bn.NUM,Ne.IntegerExpected);r=n;break;case Zr.STRING:r=jr(e);break;case Zr.BOOLEAN:r=kr(e);break;case Zr.SCALAR:case Zr.NOERROR:case Zr.ANY:r=e;break;case Zr.RANGE:if(e instanceof lr)return e;r=_r(e);break;case Zr.COMPLEX:return this.arithmeticHelper.coerceScalarToComplex(Ct(e))}return t.passSubtype||void 0===r?r:Ct(r)}calculateSingleCellOfResultArray(e,t,n,r,i,o){const s=this.coerceArgumentsToRequiredTypes(e,t,n,r);if(s instanceof lr)return s;const a=i(...s);return this.returnNumberWrapper(a,o)}coerceArgumentsToRequiredTypes(e,t,n,r){const i=[];for(let o=0;o<n.length;o++){const s=n[o],a=void 0!==t[o]?t[o]:null===s||void 0===s?void 0:s.defaultValue;if(void 0===a){i.push(void 0);continue}const l=this.coerceToType(a,s,e);if(void 0===l&&!r[o])return new lr(Bn.VALUE,Ne.WrongType);if(l instanceof lr&&s.argumentType!==Zr.SCALAR)return l;i.push(l)}return i}vectorizeAndBroadcastArgumentsIfNecessary(e,t,n,r,i){return t.map((t,o)=>e&&this.isRangePassedAsAScalarArgument(t,n[o])?this.vectorizeAndBroadcastRangeArgument(t,r,i):t)}vectorizeAndBroadcastRangeArgument(e,t,n){var r;const i=1===e.height()?0:t,o=1===e.width()?0:n;return null===(r=e.data[i])||void 0===r?void 0:r[o]}evaluateArguments(e,t,n){return n.expandRanges?this.listOfScalarValues(e,t):e.map(e=>[this.evaluateAst(e,t),!1])}buildMetadataForEachArgumentValue(e,t){const n=t.parameters?[...t.parameters]:[],r=void 0!==t.repeatLastArgs&&Number.isInteger(t.repeatLastArgs)&&t.repeatLastArgs>0;if(r)while(e>n.length)n.push(...n.slice(n.length-t.repeatLastArgs));return n}isNumberOfArgumentValuesValid(e,t){if(t>e.length)return!1;if(t<e.length){const n=e.slice(t),r=n.every(e=>(null===e||void 0===e?void 0:e.optionalArg)||void 0!==(null===e||void 0===e?void 0:e.defaultValue));return r}return!0}calculateSizeOfVectorizedResultArray(e,t){const n=e.filter((e,n)=>this.isRangePassedAsAScalarArgument(e,t[n])),r=Math.max(1,...n.map(e=>e.height())),i=Math.max(1,...n.map(e=>e.width()));return[r,i]}isRangePassedAsAScalarArgument(e,t){return null!=e&&null!=t&&(e instanceof jt&&![Zr.RANGE,Zr.ANY].includes(t.argumentType))}metadata(e){const t=this.constructor.implementedFunctions[e];if(void 0!==t)return t;throw new Error(`No metadata for function ${e}.`)}returnNumberWrapper(e,t,n){return void 0!==t&&Mt(e)?this.arithmeticHelper.ExtendedNumberFactory(Ct(e),{type:t,format:n}):e}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class ei{constructor(e,t,n=!1){this.width=e,this.height=t,this.isRef=n}static error(){return new ei(1,1,!0)}static scalar(){return new ei(1,1,!1)}isScalar(){return 1===this.width&&1===this.height||this.isRef}}function ti(e,t){return new ei(Math.max(e.width,t.width),Math.max(e.height,t.height))}function ni(e){return new ei(e.width,e.height)}class ri{constructor(e,t){this.config=e,this.functionRegistry=t}checkArraySize(e,t){return this.checkArraySizeForAst(e,{formulaAddress:t,arraysFlag:this.config.useArrayArithmetic})}checkArraySizeForAst(e,t){switch(e.type){case G.FUNCTION_CALL:return this.checkArraySizeForFunction(e,t);case G.COLUMN_RANGE:case G.ROW_RANGE:case G.CELL_RANGE:{const n=Sr.fromAstOrUndef(e,t.formulaAddress);return void 0===n?ei.error():new ei(n.width(),n.height(),!0)}case G.ARRAY:{const n=[],r=[];for(const s of e.args){const e=s.map(e=>this.checkArraySizeForAst(e,t)),i=Math.min(...e.map(e=>e.height)),o=e.reduce((e,t)=>e+t.width,0);n.push(i),r.push(o)}const i=n.reduce((e,t)=>e+t,0),o=Math.min(...r);return new ei(o,i)}case G.STRING:case G.NUMBER:return ei.scalar();case G.CELL_REFERENCE:return new ei(1,1,!0);case G.DIV_OP:case G.CONCATENATE_OP:case G.EQUALS_OP:case G.GREATER_THAN_OP:case G.GREATER_THAN_OR_EQUAL_OP:case G.LESS_THAN_OP:case G.LESS_THAN_OR_EQUAL_OP:case G.MINUS_OP:case G.NOT_EQUAL_OP:case G.PLUS_OP:case G.POWER_OP:case G.TIMES_OP:{const n=this.checkArraySizeForAst(e.left,t),r=this.checkArraySizeForAst(e.right,t);return!t.arraysFlag&&(n.height>1||n.width>1||r.height>1||r.width>1)?ei.error():ti(n,r)}case G.MINUS_UNARY_OP:case G.PLUS_UNARY_OP:case G.PERCENT_OP:{const n=this.checkArraySizeForAst(e.value,t);return!t.arraysFlag&&(n.height>1||n.width>1)?ei.error():ni(n)}case G.PARENTHESIS:return this.checkArraySizeForAst(e.expression,t);case G.EMPTY:return ei.error();default:return ei.error()}}checkArraySizeForFunction(e,t){const n=this.functionRegistry.getArraySizeFunction(e.procedureName);if(void 0!==n)return n(e,t);const r=this.functionRegistry.getMetadata(e.procedureName);if(void 0===r||r.expandRanges||!t.arraysFlag||r.vectorizationForbidden||void 0===r.parameters)return new ei(1,1);const i=e.args.map(e=>{var n;return this.checkArraySizeForAst(e,new Or(t.formulaAddress,t.arraysFlag||null!==(n=null===r||void 0===r?void 0:r.arrayFunction)&&void 0!==n&&n))}),o=[...r.parameters];if(void 0!==r.repeatLastArgs&&o.length<i.length&&(i.length-o.length)%r.repeatLastArgs!==0)return ei.error();while(o.length<i.length){if(void 0===r.repeatLastArgs)return ei.error();o.push(...o.slice(o.length-r.repeatLastArgs))}let s=1,a=1;for(let l=0;l<i.length;l++)o[l].argumentType!==Zr.RANGE&&o[l].argumentType!==Zr.ANY&&(a=Math.max(a,i[l].height),s=Math.max(s,i[l].width));return new ei(s,a)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class ii{constructor(e,t,n){var r;this.value=t,this.address=n,this.type=e.type,this.message=null!==(r=e.message)&&void 0!==r?r:""}toString(){return this.value}valueOf(){return this.value}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */function oi(e,t,n){if("undefined"===typeof e)return pa.defaultConfig[n];if("string"===typeof t){if(typeof e===t)return e;throw new on(t,n)}if(t.includes(e))return e;throw new cn(t.map(e=>`'${e}'`).join(" "),n)}function si(e,t,n){if(e<n)throw new an(t,n)}function ai(e,t,n){if(e>n)throw new ln(t,n)}function li(e,t,n,r){if(t(e))return e;if("undefined"===typeof e)return pa.defaultConfig[r];throw new on(n,r)}function ci(...e){const t=new Map;e.forEach(e=>{const n=t.get(e.value)||[];n.push(e.name),t.set(e.value,n)});const n=[];for(const r of t.values())r.length>1&&n.push(r);if(n.length>0){n.forEach(e=>e.sort());const e=n.map(e=>`[${e}]`).join("; ");throw new Error("Config initialization failed. Parameters in conflict: "+e)}}function hi(e,t,n){if(typeof e!==t)throw new on(t,n)}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */const ui=new RegExp("^ss(\\.(s+|0+))?$"),di=new RegExp("^[0-9/.\\-: ]+[ap]?m?$"),pi=new RegExp("\\s+"),fi=new RegExp("[ /.-]"),gi=":",mi=1e3,yi=Ti(Ci),wi=Ti(Si);function bi(e,t,n){if(void 0===t&&void 0===n)return;let r=e.replace(pi," ").trim().toLowerCase();if(!Ri(r))return;let i=r.substring(r.length-2);"am"===i||"pm"===i?r=r.substring(0,r.length-2).trim():(i=r.substring(r.length-1),"a"===i||"p"===i?r=r.substring(0,r.length-1).trim():i=void 0);const o=r.split(fi);o.length>=2&&o[o.length-2].includes(gi)&&(o[o.length-2]=o[o.length-2]+"."+o[o.length-1],o.pop());const s=o[o.length-1].split(gi);if(void 0!==i&&s.push(i),1===o.length)return vi(s,n);if(1===s.length)return Ei(o,t);const a=Ei(o.slice(0,o.length-1),t),l=vi(s,n);return void 0===a||void 0===l?void 0:Object.assign(Object.assign({},a),l)}function vi(e,t){var n,r,i;if(void 0===t)return;const{itemsCount:o,hourItem:s,minuteItem:a,secondItem:l}=yi(t);let c=void 0;if("am"===e[e.length-1]||"a"===e[e.length-1]?(c=!1,e.pop()):"pm"!==e[e.length-1]&&"p"!==e[e.length-1]||(c=!0,e.pop()),e.length!==o)return;const h=Number(null!==(n=e[l])&&void 0!==n?n:"0");if(!Number.isFinite(h))return;const u=Math.round(h*mi)/mi,d=Number(null!==(r=e[a])&&void 0!==r?r:"0");if(!Number.isFinite(d)||!Number.isInteger(d))return;const p=Number(null!==(i=e[s])&&void 0!==i?i:"0");if(!Number.isFinite(p)||!Number.isInteger(p))return;if(void 0!==c&&(p<0||p>12))return;const f=void 0!==c?p%12+(c?12:0):p;return{hours:f,minutes:d,seconds:u}}function Ei(e,t){var n;if(void 0===t)return;const{itemsCount:r,dayItem:i,monthItem:o,shortYearItem:s,longYearItem:a}=wi(t);if(e.length!==r)return;const l=Number(e[i]);if(!Number.isFinite(l)||!Number.isInteger(l))return;const c=Number(e[o]);if(!Number.isFinite(c)||!Number.isInteger(c))return;if(e[a]&&e[s])return;const h=Number(null!==(n=e[a])&&void 0!==n?n:e[s]);return!Number.isFinite(h)||!Number.isInteger(h)||e[a]&&(h<1e3||h>9999)||e[s]&&(h<0||h>99)?void 0:{year:h,month:c,day:l}}function Ci(e){const t=e.toLowerCase().trim(),n=t.endsWith("am/pm")?t.substring(0,t.length-5):t.endsWith("a/p")?t.substring(0,e.length-3):t,r=n.trim().split(gi);return{itemsCount:r.length,hourItem:r.indexOf("hh"),minuteItem:r.indexOf("mm"),secondItem:r.findIndex(e=>ui.test(e))}}function Si(e){const t=e.toLowerCase().trim().split(fi);return{itemsCount:t.length,dayItem:t.indexOf("dd"),monthItem:t.indexOf("mm"),shortYearItem:t.indexOf("yy"),longYearItem:t.indexOf("yyyy")}}function Ri(e){return di.test(e)}function Ti(e){const t={};return n=>{const r=t[n];if(void 0!==r)return r;const i=e(n);return t[n]=i,i}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */const Oi=[31,28,31,30,31,30,31,31,30,31,30,31],Ni=[0,31,59,90,120,151,181,212,243,273,304,334],Ai=60,Ii=60,Mi=24;function xi(e){return!(!e||"object"!==typeof e&&"function"!==typeof e)&&("year"in e&&"number"===typeof e.year&&"month"in e&&"number"===typeof e.month&&"day"in e&&"number"===typeof e.day)}function _i(e){return!(!e||"object"!==typeof e&&"function"!==typeof e)&&("hours"in e&&"number"===typeof e.hours&&"minutes"in e&&"number"===typeof e.minutes&&"seconds"in e&&"number"===typeof e.seconds)}const Li={year:9999,month:12,day:31};class Pi{constructor(e){this.config=e,this.minDateAbsoluteValue=this.dateToNumberFromZero(e.nullDate),this.maxDateValue=this.dateToNumber(Li),this.leapYear1900=e.leapYear1900,!this.leapYear1900&&0<=this.dateToNumber({year:1900,month:2,day:28})?this.epochYearZero=this.numberToSimpleDate(2).year:this.epochYearZero=this.numberToSimpleDate(1).year,this.parseDateTime=e.parseDateTime}getWithinBounds(e){return e<=this.maxDateValue&&e>=0?e:void 0}dateStringToDateNumber(e){const{dateTime:t,dateFormat:n="",timeFormat:r=""}=this.parseDateTimeFromConfigFormats(e);if(void 0!==t)return _i(t)?xi(t)?new At(Vi(t)+this.dateToNumber(t),n+" "+r):new Nt(Vi(t),r):xi(t)?new Tt(this.dateToNumber(t),n):0}parseDateTimeFromConfigFormats(e){return this.parseDateTimeFromFormats(e,this.config.dateFormats,this.config.timeFormats)}getNullYear(){return this.config.nullYear}getEpochYearZero(){return this.epochYearZero}isValidDate(e){return!(isNaN(e.year)||isNaN(e.month)||isNaN(e.day))&&(e.day===Math.round(e.day)&&e.month===Math.round(e.month)&&e.year===Math.round(e.year)&&(!(e.year<1582)&&(!(e.month<1||e.month>12)&&(!(e.day<1)&&(this.isLeapYear(e.year)&&2===e.month?e.day<=29:e.day<=Oi[e.month-1])))))}dateToNumber(e){return this.dateToNumberFromZero(e)-this.minDateAbsoluteValue}relativeNumberToAbsoluteNumber(e){return e+this.minDateAbsoluteValue-(this.leapYear1900?1:0)}numberToSimpleDate(e){const t=Math.floor(e)+this.minDateAbsoluteValue;let n=Math.floor(t/365.2425);this.dateToNumberFromZero({year:n+1,month:1,day:1})<=t?n++:this.dateToNumberFromZero({year:n-1,month:1,day:1})>t&&n--;const r=t-this.dateToNumberFromZero({year:n,month:1,day:1}),i=ki(r-(this.isLeapYear(n)&&r>=59?1:0)),o=r-Ni[i]-(this.isLeapYear(n)&&i>1?1:0);return{year:n,month:i+1,day:o+1}}numberToSimpleDateTime(e){const t=Ui(e%1),n=Math.floor(t.hours/Mi);t.hours=t.hours%Mi;const r=this.numberToSimpleDate(Math.floor(e)+n);return Object.assign(Object.assign({},r),t)}leapYearsCount(e){return Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400)+(this.config.leapYear1900&&e>=1900?1:0)}daysInMonth(e,t){return this.isLeapYear(e)&&2===t?29:Oi[t-1]}endOfMonth(e){return{year:e.year,month:e.month,day:this.daysInMonth(e.year,e.month)}}toBasisUS(e,t){return 31===e.day&&(e.day=30),30===e.day&&31===t.day&&(t.day=30),2===e.month&&e.day===this.daysInMonth(e.year,e.month)&&(e.day=30,2===t.month&&t.day===this.daysInMonth(t.year,t.month)&&(t.day=30)),[e,t]}yearLengthForBasis(e,t){return e.year!==t.year?e.year+1!==t.year||e.month<t.month||e.month===t.month&&e.day<t.day?(this.leapYearsCount(t.year)-this.leapYearsCount(e.year-1))/(t.year-e.year+1)+365:this.countLeapDays(t)!==this.countLeapDays({year:e.year,month:e.month,day:e.day-1})?366:365:this.isLeapYear(e.year)?366:365}parseSingleFormat(e,t,n){const r=this.parseDateTime(e,t,n);if(!xi(r)||(r.year>=0&&r.year<100&&(r.year<this.getNullYear()?r.year+=2e3:r.year+=1900),this.isValidDate(r)))return r}parseDateTimeFromFormats(e,t,n){const r=0===t.length?[void 0]:t,i=0===n.length?[void 0]:n;for(const o of r)for(const t of i){const n=this.parseSingleFormat(e,o,t);if(void 0!==n)return{dateTime:n,timeFormat:t,dateFormat:o}}return{}}countLeapDays(e){return e.month>2||2===e.month&&e.day>=29?this.leapYearsCount(e.year):this.leapYearsCount(e.year-1)}dateToNumberFromZero(e){return 365*e.year+Ni[e.month-1]+e.day-1+(e.month<=2?this.leapYearsCount(e.year-1):this.leapYearsCount(e.year))}isLeapYear(e){return!(e%4)&&(!!(e%100)||(!(e%400)||1900===e&&this.config.leapYear1900))}}function ki(e){let t=0;return Ni[t+6]<=e&&(t+=6),Ni[t+3]<=e&&(t+=3),Ni[t+2]<=e?t+=2:Ni[t+1]<=e&&(t+=1),t}function ji(e,t){const n=12*e.year+e.month-1+t;return{year:Math.floor(n/12),month:n%12+1,day:e.day}}function Hi(e){return{year:e.year,month:e.month,day:Math.min(e.day,Oi[e.month-1])}}function Di(e){return Math.round(3600*e*24)/86400}function Fi(e,t=1){return Math.round(e*t)/t}function Ui(e){const t=e*Mi*Ii*Ai,n=Fi(t%Ai,1e5)%Ai,r=(t-n)/Ai,i=Math.round(r%Ii)%Ii,o=(r-i)/Ii,s=Math.round(o);return{hours:s,minutes:i,seconds:n}}function Vi(e){return((e.seconds/60+e.minutes)/60+e.hours)/24}function Bi(e){return{year:e.year,month:e.month,day:Math.min(30,e.day)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Wi{call(){return Zn}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */const Gi=/(\\.|dd|DD|d|D|mm|MM|m|M|YYYY|YY|yyyy|yy|HH|hh|H|h|ss(\.(0+|s+))?|s|AM\/PM|am\/pm|A\/P|a\/p|\[mm]|\[MM]|\[hh]|\[HH])/g,zi=/(\\.|[#0]+(\.[#0]*)?)/g;var Yi,Xi;function Ki(e,t){return{type:e,value:t}}function $i(e){Gi.lastIndex=0;const t=[];let n;do{n=Gi.exec(e),null!==n&&t.push(n)}while(n);return t}function qi(e){zi.lastIndex=0;const t=zi.exec(e);return null!==t?[t]:[]}function Qi(e,t){const n=[];let r=0;for(let o=0;o<e.length;++o){const i=e[o];if(i.index!==r){const e=t.substr(r,i.index-r);n.push(Ki(Yi.FREE_TEXT,e))}i[0].startsWith("\\")?n.push(Ki(Yi.FREE_TEXT,i[0])):n.push(Ki(Yi.FORMAT,i[0])),r=i.index+i[0].length}const i=e[e.length-1];if(i.index+i[0].length<t.length){const e=t.substr(i.index+i[0].length,t.length);n.push(Ki(Yi.FREE_TEXT,e))}return n}function Zi(e){const t=$i(e);return t.every(e=>eo(e))?void 0:{type:Xi.DATE,tokens:Qi(t,e)}}function Ji(e){const t=qi(e);return t.every(e=>eo(e))?void 0:{type:Xi.NUMBER,tokens:Qi(t,e)}}function eo(e){return e[0].startsWith("\\")}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */function to(e,t,n,r){const i=n.stringifyDateTime(r.numberToSimpleDateTime(e),t);if(void 0!==i)return i;const o=n.stringifyDuration(Ui(e),t);if(void 0!==o)return o;const s=Ji(t);return void 0!==s?oo(s.tokens,e):t}function no(e,t){let n=""+e;while(n.length<t)n="0"+n;return n}function ro(e,t){let n=""+e;while(n.length<t)n+="0";return n}function io(e,t){return e.split(t).length-1}function oo(e,t){let n="";for(let r=0;r<e.length;++r){const i=e[r];if(i.type===Yi.FREE_TEXT){n+=i.value;continue}const o=i.value.split("."),s=o[0],a=o[1]||"",l=o[1]?".":"",c=Number(t.toFixed(a.length)).toString().split(".");let h=c[0]||"",u=c[1]||"";if(s.length>h.length){const e=io(s.substr(0,s.length-h.length),"0");h=no(h,e+h.length)}const d=io(a.substr(u.length,a.length-u.length),"0");u=ro(u,d+u.length),n+=h+l+u}return n}function so(e,t){const n=Zi(t);if(void 0===n)return;const r=n.tokens;let i="";for(const o of r)if(o.type!==Yi.FREE_TEXT)switch(o.value.toLowerCase()){case"h":case"hh":i+=no(e.hours,o.value.length),e.hours=0;break;case"[hh]":i+=no(e.hours,o.value.length-2),e.hours=0;break;case"m":case"mm":i+=no(e.minutes,o.value.length),e.minutes=0;break;case"[mm]":i+=no(e.minutes+60*e.hours,o.value.length-2),e.minutes=0,e.hours=0;break;case"s":case"ss":i+=no(Math.floor(e.seconds),o.value.length);break;default:if(ui.test(o.value)){const t=Math.max(o.value.length-3,0);i+=`${e.seconds<10?"0":""}${Math.floor(e.seconds*Math.pow(10,t))/Math.pow(10,t)}`;continue}return}else i+=o.value;return i}function ao(e,t){const n=Zi(t);if(void 0===n)return;const r=n.tokens;let i="",o=!1;const s=r.some(e=>e.type===Yi.FORMAT&&("a/p"===e.value||"A/P"===e.value||"am/pm"===e.value||"AM/PM"===e.value));for(let a=0;a<r.length;a++){const t=r[a];if(t.type!==Yi.FREE_TEXT)switch(t.value.toLowerCase()){case"h":case"hh":o=!0,i+=no(s?(e.hours+11)%12+1:e.hours,t.value.length);break;case"d":case"dd":i+=no(e.day,t.value.length);break;case"s":case"ss":i+=no(Math.floor(e.seconds),t.value.length);break;case"m":case"mm":a+1<r.length&&r[a+1].value.startsWith(":")&&(o=!0),i+=no(o?e.minutes:e.month,t.value.length),o=!0;break;case"yy":i+=no(e.year%100,t.value.length);break;case"yyyy":i+=e.year;break;case"am/pm":case"a/p":{const[n,r]=t.value.split("/");i+=e.hours<12?n:r;break}default:if(ui.test(t.value)){const n=t.value.length-3;i+=`${e.seconds<10?"0":""}${Math.floor(e.seconds*Math.pow(10,n))/Math.pow(10,n)}`;continue}return}else i+=t.value}return i}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */(function(e){e["FORMAT"]="FORMAT",e["FREE_TEXT"]="FREE_TEXT"})(Yi||(Yi={})),function(e){e["DATE"]="DATE",e["NUMBER"]="NUMBER",e["STRING"]="STRING"}(Xi||(Xi={}));const lo="length",co=e=>parseInt(e,16),ho=e=>parseInt(e,10),uo=e=>(e+"").replace(/\-/g,""),po=(e,t,n)=>e["substr"](t,n),fo=e=>e["codePointAt"](0)-65;function go(e){return 25===uo(e)[lo]?co(po(uo(e),co("12"),fo("F")))/(co(po(uo(e),fo("C"),fo("Y")>>4))||1+(~~![][lo]<<3)):0}function mo(e){if(e=(e+"").replace(/\-/g,""),e[lo]!==fo("Z"))return!1;let t=0;return[[0,fo("G")+1],[fo("H"),fo("H")-1],[fo("G")+fo("H"),fo("G")]].reduce((n,[r,i],o)=>(n|=(ho(""+ho(co(po(e,t+r-(0===o?0:2),i+(o?2:0)))+(co(po(e,t+r+i,2))+[]).padStart(2,"0")))%97||2)>>1,t+=2,n),fo("A"))===[]+1>>1}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */const yo={invalid:()=>"The license key for HyperFormula is invalid.",expired:({keyValidityDate:e})=>`The license key for HyperFormula expired on ${e}, and is not valid for the installed version.`,missing:()=>"The license key for HyperFormula is missing."};let wo=!1;function bo(e){const t={template:"missing",vars:{}};if("gpl-v3"===e||"internal-use-in-handsontable"===e)t.template="valid";else if("string"===typeof e&&mo(e)){const[n,r,i]="10/04/2024".split("/"),o=Math.floor(new Date(`${r}/${n}/${i}`).getTime()/864e5),s=go(e);t.vars.keyValidityDate=vo(new Date(864e5*(s+1))),t.template=o>s?"expired":"valid"}else""!==e&&(t.template="invalid");return wo||"valid"===t.template||(console.warn(yo[t.template](t.vars)),wo=!0),t.template}function vo(e){const t=["January","February","March","April","May","June","July","August","September","October","November","December"],n=t[e.getMonth()],r=e.getDate(),i=e.getFullYear();return`${n} ${r}, ${i}`}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */var Eo,Co,So;function Ro(e){return e.startsWith("=")}function To(e){const t=e.toLowerCase();return"true"===t||"false"===t}function Oo(e,t){const n=e.toUpperCase(),r=/#[A-Za-z0-9\/]+[?!]?/;return r.test(n)&&Object.prototype.hasOwnProperty.call(t,n)}(function(e){class t{constructor(e){this.value=e,this.value=Rt(this.value,Ur(Ct(this.value)))}}e.Number=t;class n{constructor(e){this.value=e}}e.String=n;class r{constructor(e){this.value=e}}e.Boolean=r;class i{static getSingletonInstance(){return i.instance||(i.instance=new i),i.instance}}e.Empty=i;class o{constructor(e){this.formula=e}}e.Formula=o;class s{constructor(e,t){this.value=new lr(e,t)}}e.Error=s})(Eo||(Eo={}));class No{constructor(e,t,n){this.config=e,this.dateHelper=t,this.numberLiteralsHelper=n}parse(e){if(void 0===e||null===e)return Eo.Empty.getSingletonInstance();if("number"===typeof e)return Fr(e)?new Eo.Error(Bn.NUM,Ne.ValueLarge):new Eo.Number(e);if("boolean"===typeof e)return new Eo.Boolean(e);if(e instanceof Date){const t=this.dateHelper.dateToNumber({day:e.getDate(),month:e.getMonth()+1,year:e.getFullYear()}),n=Vi({hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()+e.getMilliseconds()/1e3}),r=t+n;return r<0?new Eo.Error(Bn.NUM,Ne.DateBounds):r%1===0?new Eo.Number(new Tt(r,"Date()")):r<1?new Eo.Number(new Nt(r,"Date()")):new Eo.Number(new At(r,"Date()"))}if("string"===typeof e){if(To(e))return new Eo.Boolean("true"===e.toLowerCase());if(Ro(e))return new Eo.Formula(e);if(Oo(e,this.config.errorMapping))return new Eo.Error(this.config.errorMapping[e.toUpperCase()]);{let t,n=e.trim(),r=0;if(n.endsWith("%"))r=1,n=n.slice(0,n.length-1);else{const e=this.currencyMatcher(n);void 0!==e&&(r=2,[t,n]=e)}const i=this.numberLiteralsHelper.numericStringToMaybeNumber(n);if(void 0!==i){let e;return e=1===r?new It(i/100):2===r?new Ot(i,t):i,new Eo.Number(e)}const o=this.dateHelper.dateStringToDateNumber(n);return void 0!==o?new Eo.Number(o):new Eo.String(e.startsWith("'")?e.slice(1):e)}}throw new rn(e)}currencyMatcher(e){for(const t of this.config.currencySymbol){if(e.startsWith(t))return[t,e.slice(t.length)];if(e.endsWith(t))return[t,e.slice(0,e.length-t.length)]}}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */(function(e){e[e["COPY"]=0]="COPY",e[e["CUT"]=1]="CUT"})(Co||(Co={})),function(e){e[e["VALUE"]=0]="VALUE",e[e["EMPTY"]=1]="EMPTY",e[e["FORMULA"]=2]="FORMULA",e[e["PARSING_ERROR"]=3]="PARSING_ERROR"}(So||(So={}));class Ao{constructor(e,t,n,r,i){this.sourceLeftCorner=e,this.width=t,this.height=n,this.type=r,this.content=i}*getContent(e){if(void 0!==this.content)for(let t=0;t<this.height;++t)for(let n=0;n<this.width;++n)yield[pr(e.sheet,e.col+n,e.row+t),this.content[t][n]]}}class Io{constructor(e,t,n){this.dependencyGraph=t,this.operations=n,this.maxRows=e.maxRows,this.maxColumns=e.maxColumns}cut(e,t,n){this.clipboard=new Ao(e,t,n,Co.CUT)}copy(e,t,n){const r=[];for(let i=0;i<n;++i){r[i]=[];for(let n=0;n<t;++n){const t=this.operations.getClipboardCell(pr(e.sheet,e.col+n,e.row+i));r[i].push(t)}}this.clipboard=new Ao(e,t,n,Co.COPY,r)}abortCut(){this.clipboard&&this.clipboard.type===Co.CUT&&this.clear()}clear(){this.clipboard=void 0}ensureItIsPossibleToCopyPaste(e){if(void 0===this.clipboard)return;if(fr(e)||!this.dependencyGraph.sheetMapping.hasSheetWithId(e.sheet))throw new Kt("a valid target address.");const t=Sr.spanFrom(e,this.clipboard.width,this.clipboard.height);if(t.exceedsSheetSizeLimits(this.maxColumns,this.maxRows))throw new zt;if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(t))throw new Error("It is not possible to paste onto an array")}isCutClipboard(){return void 0!==this.clipboard&&this.clipboard.type===Co.CUT}isCopyClipboard(){return void 0!==this.clipboard&&this.clipboard.type===Co.COPY}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Mo{constructor(e,t,n,r){this.displayName=e,this.address=t,this.added=n,this.options=r}normalizeExpressionName(){return this.displayName.toLowerCase()}copy(){return new Mo(this.displayName,this.address,this.added,this.options)}}class xo{constructor(){this.mapping=new Map}has(e){return this.mapping.has(this.normalizeExpressionName(e))}isNameAvailable(e){const t=this.normalizeExpressionName(e),n=this.mapping.get(t);return!(n&&n.added)}add(e){this.mapping.set(e.normalizeExpressionName(),e)}get(e){return this.mapping.get(this.normalizeExpressionName(e))}getExisting(e){const t=this.mapping.get(this.normalizeExpressionName(e));return t&&t.added?t:void 0}remove(e){const t=this.normalizeExpressionName(e),n=this.mapping.get(t);n&&(n.added=!1)}getAllNamedExpressions(){return Array.from(this.mapping.values()).filter(e=>e.added)}normalizeExpressionName(e){return e.toLowerCase()}}class _o{constructor(){this.mapping=new Map}add(e){this.mapping.set(this.normalizeExpressionName(e.displayName),e)}get(e){return this.mapping.get(this.normalizeExpressionName(e))}has(e){return this.mapping.has(this.normalizeExpressionName(e))}getAllNamedExpressions(){return Array.from(this.mapping.values()).filter(e=>e.added)}isNameAvailable(e){const t=this.normalizeExpressionName(e);return!this.mapping.has(t)}remove(e){const t=this.normalizeExpressionName(e),n=this.mapping.get(t);n&&this.mapping.delete(t)}normalizeExpressionName(e){return e.toLowerCase()}}class Lo{constructor(){this.nextNamedExpressionRow=0,this.workbookStore=new xo,this.worksheetStores=new Map,this.addressCache=new Map}isNameAvailable(e,t){var n,r;return void 0===t?this.workbookStore.isNameAvailable(e):null===(r=null===(n=this.worksheetStore(t))||void 0===n?void 0:n.isNameAvailable(e))||void 0===r||r}namedExpressionInAddress(e){const t=this.addressCache.get(e);return t&&t.added?t:void 0}namedExpressionForScope(e,t){var n;return void 0===t?this.workbookStore.getExisting(e):null===(n=this.worksheetStore(t))||void 0===n?void 0:n.get(e)}nearestNamedExpression(e,t){var n,r;return null!==(r=null===(n=this.worksheetStore(t))||void 0===n?void 0:n.get(e))&&void 0!==r?r:this.workbookStore.getExisting(e)}isExpressionInScope(e,t){var n,r;return null!==(r=null===(n=this.worksheetStore(t))||void 0===n?void 0:n.has(e))&&void 0!==r&&r}isNameValid(e){const t=new RegExp(`^${w}$`),n=new RegExp(`^${E}$`),r=new RegExp(`^${S}$`);return!t.test(e)&&!n.test(e)&&r.test(e)}addNamedExpression(e,t,n){const r=void 0===t?this.workbookStore:this.worksheetStoreOrCreate(t);let i=r.get(e);return void 0!==i?(i.added=!0,i.displayName=e,i.options=n):(i=new Mo(e,this.nextAddress(),!0,n),r.add(i)),this.addressCache.set(i.address.row,i),i}restoreNamedExpression(e,t){const n=void 0===t?this.workbookStore:this.worksheetStoreOrCreate(t);return e.added=!0,n.add(e),this.addressCache.set(e.address.row,e),e}namedExpressionOrPlaceholder(e,t){var n;return null!==(n=this.worksheetStoreOrCreate(t).get(e))&&void 0!==n?n:this.workbookNamedExpressionOrPlaceholder(e)}workbookNamedExpressionOrPlaceholder(e){let t=this.workbookStore.get(e);return void 0===t&&(t=new Mo(e,this.nextAddress(),!1),this.workbookStore.add(t)),t}remove(e,t){let n;n=void 0===t?this.workbookStore:this.worksheetStore(t);const r=null===n||void 0===n?void 0:n.get(e);if(void 0===n||void 0===r||!r.added)throw Error("Named expression does not exist");n.remove(e),n instanceof _o&&0===n.mapping.size&&this.worksheetStores.delete(t),this.addressCache.delete(r.address.row)}getAllNamedExpressionsNamesInScope(e){return this.getAllNamedExpressions().filter(({scope:t})=>t===e).map(e=>e.expression.displayName)}getAllNamedExpressionsNames(){return this.getAllNamedExpressions().map(e=>e.expression.displayName)}getAllNamedExpressions(){const e=[];return this.workbookStore.getAllNamedExpressions().forEach(t=>{e.push({expression:t,scope:void 0})}),this.worksheetStores.forEach((t,n)=>{t.getAllNamedExpressions().forEach(t=>{e.push({expression:t,scope:n})})}),e}getAllNamedExpressionsForScope(e){var t,n;return void 0===e?this.workbookStore.getAllNamedExpressions():null!==(n=null===(t=this.worksheetStores.get(e))||void 0===t?void 0:t.getAllNamedExpressions())&&void 0!==n?n:[]}worksheetStoreOrCreate(e){let t=this.worksheetStores.get(e);return t||(t=new _o,this.worksheetStores.set(e,t)),t}worksheetStore(e){return this.worksheetStores.get(e)}nextAddress(){return pr(Lo.SHEET_FOR_WORKBOOK_EXPRESSIONS,0,this.nextNamedExpressionRow++)}}Lo.SHEET_FOR_WORKBOOK_EXPRESSIONS=-1;const Po=e=>{switch(e.type){case G.EMPTY:case G.NUMBER:case G.STRING:case G.ERROR:case G.ERROR_WITH_RAW_INPUT:return!1;case G.CELL_REFERENCE:return!e.reference.isAbsolute();case G.CELL_RANGE:case G.COLUMN_RANGE:case G.ROW_RANGE:return!e.start.isAbsolute();case G.NAMED_EXPRESSION:return!1;case G.PERCENT_OP:case G.PLUS_UNARY_OP:case G.MINUS_UNARY_OP:return Po(e.value);case G.CONCATENATE_OP:case G.EQUALS_OP:case G.NOT_EQUAL_OP:case G.LESS_THAN_OP:case G.GREATER_THAN_OP:case G.LESS_THAN_OR_EQUAL_OP:case G.GREATER_THAN_OR_EQUAL_OP:case G.MINUS_OP:case G.PLUS_OP:case G.TIMES_OP:case G.DIV_OP:case G.POWER_OP:return Po(e.left)||Po(e.right);case G.PARENTHESIS:return Po(e.expression);case G.FUNCTION_CALL:return e.args.some(e=>Po(e));case G.ARRAY:return e.args.some(e=>e.some(e=>Po(e)))}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class ko{performEagerTransformations(e,t){for(const n of e.arrayFormulaNodes()){const[r,i]=this.transformSingleAst(n.getFormula(e.lazilyTransformingAstService),n.getAddress(e.lazilyTransformingAstService)),o=t.rememberNewAst(r);n.setFormula(o),n.setAddress(i)}}transformSingleAst(e,t){const n=this.transformAst(e,t),r=this.fixNodeAddress(t);return[n,r]}transformAst(e,t){switch(e.type){case G.CELL_REFERENCE:return this.transformCellReferenceAst(e,t);case G.CELL_RANGE:return this.transformCellRangeAst(e,t);case G.COLUMN_RANGE:return this.transformColumnRangeAst(e,t);case G.ROW_RANGE:return this.transformRowRangeAst(e,t);case G.EMPTY:case G.ERROR:case G.NUMBER:case G.NAMED_EXPRESSION:case G.ERROR_WITH_RAW_INPUT:case G.STRING:return e;case G.PERCENT_OP:case G.MINUS_UNARY_OP:case G.PLUS_UNARY_OP:return Object.assign(Object.assign({},e),{value:this.transformAst(e.value,t)});case G.FUNCTION_CALL:return Object.assign(Object.assign({},e),{procedureName:e.procedureName,args:e.args.map(e=>this.transformAst(e,t))});case G.PARENTHESIS:return Object.assign(Object.assign({},e),{expression:this.transformAst(e.expression,t)});case G.ARRAY:return Object.assign(Object.assign({},e),{args:e.args.map(e=>e.map(e=>this.transformAst(e,t)))});default:return Object.assign(Object.assign({},e),{left:this.transformAst(e.left,t),right:this.transformAst(e.right,t)})}}transformCellReferenceAst(e,t){const n=this.transformCellAddress(e.reference,t);return n instanceof l?Object.assign(Object.assign({},e),{reference:n}):n===Bn.REF?we(new lr(Bn.REF)):e}transformCellRangeAst(e,t){const n=this.transformCellRange(e.start,e.end,t);return Array.isArray(n)?Object.assign(Object.assign({},e),{start:n[0],end:n[1]}):n===Bn.REF?we(new lr(Bn.REF)):e}transformColumnRangeAst(e,t){const n=this.transformColumnRange(e.start,e.end,t);return Array.isArray(n)?Object.assign(Object.assign({},e),{start:n[0],end:n[1]}):n===Bn.REF?we(new lr(Bn.REF)):e}transformRowRangeAst(e,t){const n=this.transformRowRange(e.start,e.end,t);return Array.isArray(n)?Object.assign(Object.assign({},e),{start:n[0],end:n[1]}):n===Bn.REF?we(new lr(Bn.REF)):e}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class jo extends ko{constructor(e){super(),this.columnsSpan=e}get sheet(){return this.columnsSpan.sheet}isIrreversible(){return!1}transformRowRangeAst(e,t){return e}transformCellRange(e,t,n){return this.transformRange(e,t,n)}transformRowRange(e,t,n){throw Error("Not implemented")}transformColumnRange(e,t,n){return this.transformRange(e,t,n)}transformCellAddress(e,t){const n=wr(e,t);if(n!==this.columnsSpan.sheet&&t.sheet!==this.columnsSpan.sheet)return!1;const r=e.toSimpleColumnAddress(t);if(n===this.columnsSpan.sheet&&t.sheet!==this.columnsSpan.sheet)return this.columnsSpan.columnStart<=r.col&&e.shiftedByColumns(this.columnsSpan.numberOfColumns);if(t.sheet===this.columnsSpan.sheet&&n!==this.columnsSpan.sheet)return!e.isColumnAbsolute()&&(!(t.col<this.columnsSpan.columnStart)&&e.shiftedByColumns(-this.columnsSpan.numberOfColumns));if(e.isColumnAbsolute())return!(e.col<this.columnsSpan.columnStart)&&e.shiftedByColumns(this.columnsSpan.numberOfColumns);{const n=e.toSimpleColumnAddress(t);return n.col<this.columnsSpan.columnStart?!(t.col<this.columnsSpan.columnStart)&&e.shiftedByColumns(-this.columnsSpan.numberOfColumns):t.col<this.columnsSpan.columnStart&&e.shiftedByColumns(this.columnsSpan.numberOfColumns)}}fixNodeAddress(e){return this.columnsSpan.sheet===e.sheet&&this.columnsSpan.columnStart<=e.col?Object.assign(Object.assign({},e),{col:e.col+this.columnsSpan.numberOfColumns}):e}transformRange(e,t,n){const r=this.transformCellAddress(e,n),i=this.transformCellAddress(t,n);return r===Bn.REF||i===Bn.REF?Bn.REF:!(!r&&!i)&&[r||e,i||t]}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Ho extends ko{constructor(e){super(),this.rowsSpan=e}get sheet(){return this.rowsSpan.sheet}isIrreversible(){return!1}transformColumnRangeAst(e,t){return e}transformCellRange(e,t,n){return this.transformRange(e,t,n)}transformRowRange(e,t,n){return this.transformRange(e,t,n)}transformColumnRange(e,t,n){throw Error("Not implemented")}transformCellAddress(e,t){const n=wr(e,t);if(n!==this.rowsSpan.sheet&&t.sheet!==this.rowsSpan.sheet)return!1;const r=e.toSimpleRowAddress(t);return n===this.rowsSpan.sheet&&t.sheet!==this.rowsSpan.sheet?this.rowsSpan.rowStart<=r.row&&e.shiftedByRows(this.rowsSpan.numberOfRows):t.sheet===this.rowsSpan.sheet&&n!==this.rowsSpan.sheet?!e.isRowAbsolute()&&(!(t.row<this.rowsSpan.rowStart)&&e.shiftedByRows(-this.rowsSpan.numberOfRows)):e.isRowAbsolute()?!(e.row<this.rowsSpan.rowStart)&&e.shiftedByRows(this.rowsSpan.numberOfRows):r.row<this.rowsSpan.rowStart?!(t.row<this.rowsSpan.rowStart)&&e.shiftedByRows(-this.rowsSpan.numberOfRows):t.row<this.rowsSpan.rowStart&&e.shiftedByRows(this.rowsSpan.numberOfRows)}fixNodeAddress(e){return this.rowsSpan.sheet===e.sheet&&this.rowsSpan.rowStart<=e.row?Object.assign(Object.assign({},e),{row:e.row+this.rowsSpan.numberOfRows}):e}transformRange(e,t,n){const r=this.transformCellAddress(e,n),i=this.transformCellAddress(t,n);return r===Bn.REF||i===Bn.REF?Bn.REF:!(!r&&!i)&&[r||e,i||t]}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Do extends ko{constructor(e){super(),this.sheet=e}isIrreversible(){return!0}fixNodeAddress(e){return e}transformCellAddress(e,t){return!!e.isInvalid(t)&&Bn.REF}transformCellRange(e,t,n){return!(!e.isInvalid(n)&&!t.isInvalid(n))&&Bn.REF}transformColumnRange(e,t,n){return!(!e.isInvalid(n)&&!t.isInvalid(n))&&Bn.REF}transformRowRange(e,t,n){return!(!e.isInvalid(n)&&!t.isInvalid(n))&&Bn.REF}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Fo extends ko{constructor(e,t,n,r){super(),this.sourceRange=e,this.toRight=t,this.toBottom=n,this.toSheet=r,this.dependentFormulaTransformer=new Uo(e,t,n,r)}get sheet(){return this.sourceRange.sheet}isIrreversible(){return!0}transformSingleAst(e,t){if(this.sourceRange.addressInRange(t)){const n=this.transformAst(e,t);return[n,this.fixNodeAddress(t)]}return this.dependentFormulaTransformer.transformSingleAst(e,t)}fixNodeAddress(e){return pr(this.toSheet,e.col+this.toRight,e.row+this.toBottom)}transformCellAddress(e,t){return this.transformAddress(e,t)}transformCellRange(e,t,n){return this.transformRange(e,t,n)}transformColumnRange(e,t,n){return this.transformRange(e,t,n)}transformRowRange(e,t,n){return this.transformRange(e,t,n)}transformAddress(e,t){const n=this.sourceRange;if(e instanceof l){const r=e.toSimpleCellAddress(t);if(n.addressInRange(r))return e.shiftAbsoluteDimensions(this.toRight,this.toBottom)}return e.shiftRelativeDimensions(-this.toRight,-this.toBottom)}transformRange(e,t,n){const r=this.sourceRange;if(e instanceof l&&t instanceof l){const i=e.toSimpleCellAddress(n),o=t.toSimpleCellAddress(n);if(r.addressInRange(i)&&r.addressInRange(o))return[e.shiftAbsoluteDimensions(this.toRight,this.toBottom),t.shiftAbsoluteDimensions(this.toRight,this.toBottom)]}return[e.shiftRelativeDimensions(-this.toRight,-this.toBottom),t.shiftRelativeDimensions(-this.toRight,-this.toBottom)]}}class Uo extends ko{constructor(e,t,n,r){super(),this.sourceRange=e,this.toRight=t,this.toBottom=n,this.toSheet=r}get sheet(){return this.sourceRange.sheet}isIrreversible(){return!0}fixNodeAddress(e){return e}transformCellAddress(e,t){return!!this.shouldMove(e,t)&&e.moved(this.toSheet,this.toRight,this.toBottom)}transformCellRange(e,t,n){return this.transformRange(e,t,n)}transformColumnRange(e,t,n){return this.transformRange(e,t,n)}transformRowRange(e,t,n){return this.transformRange(e,t,n)}shouldMove(e,t){return e instanceof l?this.sourceRange.addressInRange(e.toSimpleCellAddress(t)):e instanceof a?this.sourceRange.rowInRange(e.toSimpleRowAddress(t))&&!this.sourceRange.isFinite():this.sourceRange.columnInRange(e.toSimpleColumnAddress(t))&&!this.sourceRange.isFinite()}transformRange(e,t,n){const r=this.transformCellAddress(e,n),i=this.transformCellAddress(t,n);return!(!r||!i)&&[r,i]}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Vo extends ko{constructor(e){super(),this.columnsSpan=e}get sheet(){return this.columnsSpan.sheet}isIrreversible(){return!0}transformRowRangeAst(e,t){return e}transformCellRange(e,t,n){return this.transformRange(e,t,n)}transformRowRange(e,t,n){throw Error("Not implemented")}transformColumnRange(e,t,n){return this.transformRange(e,t,n)}transformCellAddress(e,t){const n=wr(e,t);if(this.columnsSpan.sheet!==t.sheet&&this.columnsSpan.sheet!==n)return!1;if(this.columnsSpan.sheet!==t.sheet&&this.columnsSpan.sheet===n){const n=e.toSimpleColumnAddress(t);if(n.col<this.columnsSpan.columnStart)return!1;if(n.col>this.columnsSpan.columnEnd)return e.shiftedByColumns(-this.columnsSpan.numberOfColumns)}if(this.columnsSpan.sheet===t.sheet&&this.columnsSpan.sheet!==n){if(e.isColumnAbsolute())return!1;if(t.col<this.columnsSpan.columnStart)return!1;if(t.col>this.columnsSpan.columnEnd)return e.shiftedByColumns(this.columnsSpan.numberOfColumns)}if(this.columnsSpan.sheet===t.sheet&&this.columnsSpan.sheet===n)if(e.isColumnAbsolute()){if(e.col<this.columnsSpan.columnStart)return!1;if(e.col>this.columnsSpan.columnEnd)return e.shiftedByColumns(-this.columnsSpan.numberOfColumns)}else{const n=e.toSimpleColumnAddress(t);if(n.col<this.columnsSpan.columnStart){if(t.col<this.columnsSpan.columnStart)return!1;if(t.col>this.columnsSpan.columnEnd)return e.shiftedByColumns(this.columnsSpan.numberOfColumns)}else if(n.col>this.columnsSpan.columnEnd){if(t.col<this.columnsSpan.columnStart)return e.shiftedByColumns(-this.columnsSpan.numberOfColumns);if(t.col>this.columnsSpan.columnEnd)return!1}}return Bn.REF}fixNodeAddress(e){return this.columnsSpan.sheet===e.sheet&&this.columnsSpan.columnStart<=e.col?Object.assign(Object.assign({},e),{col:e.col-this.columnsSpan.numberOfColumns}):e}transformRange(e,t,n){const r=wr(e,n);let i=e,o=t;if(this.columnsSpan.sheet===r){const r=e.toSimpleColumnAddress(n),s=t.toSimpleColumnAddress(n);if(this.columnsSpan.columnStart<=r.col&&this.columnsSpan.columnEnd>=s.col)return Bn.REF;r.col>=this.columnsSpan.columnStart&&r.col<=this.columnsSpan.columnEnd&&(i=e.shiftedByColumns(this.columnsSpan.columnEnd-r.col+1)),s.col>=this.columnsSpan.columnStart&&s.col<=this.columnsSpan.columnEnd&&(o=t.shiftedByColumns(-(s.col-this.columnsSpan.columnStart+1)))}const s=this.transformCellAddress(i,n),a=this.transformCellAddress(o,n);if(!1===s&&!1===a)return[i,o];if(s===Bn.REF||a===Bn.REF)throw Error("Cannot happen");return[s||i,a||o]}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Bo extends ko{constructor(e){super(),this.rowsSpan=e}get sheet(){return this.rowsSpan.sheet}isIrreversible(){return!0}transformColumnRangeAst(e,t){return e}transformCellAddress(e,t){const n=wr(e,t);if(this.rowsSpan.sheet!==t.sheet&&this.rowsSpan.sheet!==n)return!1;if(this.rowsSpan.sheet!==t.sheet&&this.rowsSpan.sheet===n){const n=e.toSimpleRowAddress(t);if(n.row<this.rowsSpan.rowStart)return!1;if(n.row>this.rowsSpan.rowEnd)return e.shiftedByRows(-this.rowsSpan.numberOfRows)}if(this.rowsSpan.sheet===t.sheet&&this.rowsSpan.sheet!==n){if(e.isRowAbsolute())return!1;if(t.row<this.rowsSpan.rowStart)return!1;if(t.row>this.rowsSpan.rowEnd)return e.shiftedByRows(this.rowsSpan.numberOfRows)}if(this.rowsSpan.sheet===t.sheet&&this.rowsSpan.sheet===n)if(e.isRowAbsolute()){if(e.row<this.rowsSpan.rowStart)return!1;if(e.row>this.rowsSpan.rowEnd)return e.shiftedByRows(-this.rowsSpan.numberOfRows)}else{const n=e.toSimpleRowAddress(t);if(n.row<this.rowsSpan.rowStart){if(t.row<this.rowsSpan.rowStart)return!1;if(t.row>this.rowsSpan.rowEnd)return e.shiftedByRows(this.rowsSpan.numberOfRows)}else if(n.row>this.rowsSpan.rowEnd){if(t.row<this.rowsSpan.rowStart)return e.shiftedByRows(-this.rowsSpan.numberOfRows);if(t.row>this.rowsSpan.rowEnd)return!1}}return Bn.REF}transformCellRange(e,t,n){return this.transformRange(e,t,n)}transformRowRange(e,t,n){return this.transformRange(e,t,n)}transformColumnRange(e,t,n){throw Error("Not implemented")}fixNodeAddress(e){return this.rowsSpan.sheet===e.sheet&&this.rowsSpan.rowStart<=e.row?Object.assign(Object.assign({},e),{row:e.row-this.rowsSpan.numberOfRows}):e}transformRange(e,t,n){const r=wr(e,n);let i=e,o=t;if(this.rowsSpan.sheet===r){const r=e.toSimpleRowAddress(n),s=t.toSimpleRowAddress(n);if(this.rowsSpan.rowStart<=r.row&&this.rowsSpan.rowEnd>=s.row)return Bn.REF;r.row>=this.rowsSpan.rowStart&&r.row<=this.rowsSpan.rowEnd&&(i=e.shiftedByRows(this.rowsSpan.rowEnd-r.row+1)),s.row>=this.rowsSpan.rowStart&&s.row<=this.rowsSpan.rowEnd&&(o=t.shiftedByRows(-(s.row-this.rowsSpan.rowStart+1)))}const s=this.transformCellAddress(i,n),a=this.transformCellAddress(o,n);return!1===s&&!1===a?[i,o]:s===Bn.REF||a===Bn.REF?Bn.REF:[s||i,a||o]}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Wo extends ko{constructor(e){super(),this.sheet=e}isIrreversible(){return!0}performEagerTransformations(e,t){for(const n of e.arrayFormulaNodes()){const[t]=this.transformSingleAst(n.getFormula(e.lazilyTransformingAstService),n.getAddress(e.lazilyTransformingAstService));n.setFormula(t)}}fixNodeAddress(e){return e}transformCellAddress(e,t){return this.transformAddress(e)}transformCellRange(e,t,n){return this.transformAddress(e)}transformColumnRange(e,t,n){return this.transformAddress(e)}transformRowRange(e,t,n){return this.transformAddress(e)}transformAddress(e){return e.sheet===this.sheet&&Bn.REF}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */function Go(e){if(!Array.isArray(e))throw new Kt("an array of arrays.");for(let t=0;t<e.length;t++)if(!Array.isArray(e[t]))throw new Kt("an array of arrays.")}function zo(e){let t=0,n=0,r=0;for(let o=0;o<e.length;o++){let i=0;for(let t=0;t<e[o].length;t++){const n=e[o][t];void 0!==n&&null!==n&&(i=t+1,++r)}t=Math.max(t,i),i>0&&(n=o+1)}const i=t*n;return{height:n,width:t,fill:0===i?0:r/i}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Yo{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return Qo(this.indexes)}rowsSpans(){return this.normalizedIndexes().map(e=>Dt.fromNumberOfRows(this.sheet,e[0],e[1]))}}class Xo{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return Zo(this.indexes)}rowsSpans(){return this.normalizedIndexes().map(e=>Dt.fromNumberOfRows(this.sheet,e[0],e[1]))}}class Ko{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return Zo(this.indexes)}columnsSpans(){return this.normalizedIndexes().map(e=>Ft.fromNumberOfColumns(this.sheet,e[0],e[1]))}}class $o{constructor(e,t){this.sheet=e,this.indexes=t}normalizedIndexes(){return Qo(this.indexes)}columnsSpans(){return this.normalizedIndexes().map(e=>Ft.fromNumberOfColumns(this.sheet,e[0],e[1]))}}class qo{constructor(e,t,n,r,i,o,s,a,l){this.dependencyGraph=t,this.columnSearch=n,this.cellContentParser=r,this.parser=i,this.stats=o,this.lazilyTransformingAstService=s,this.namedExpressions=a,this.arraySizePredictor=l,this.changes=Ht.empty(),this.allocateNamedExpressionAddressSpace(),this.maxColumns=e.maxColumns,this.maxRows=e.maxRows}get sheetMapping(){return this.dependencyGraph.sheetMapping}get addressMapping(){return this.dependencyGraph.addressMapping}removeRows(e){const t=[];for(const n of e.rowsSpans()){const e=this.doRemoveRows(n);e&&t.push(e)}return t}addRows(e){for(const t of e.rowsSpans())this.doAddRows(t)}addColumns(e){for(const t of e.columnsSpans())this.doAddColumns(t)}removeColumns(e){const t=[];for(const n of e.columnsSpans()){const e=this.doRemoveColumns(n);e&&t.push(e)}return t}removeSheet(e){this.dependencyGraph.removeSheet(e);let t=0;this.stats.measure(_t.TRANSFORM_ASTS,()=>{const n=new Wo(e);n.performEagerTransformations(this.dependencyGraph,this.parser),t=this.lazilyTransformingAstService.addTransformation(n)}),this.sheetMapping.removeSheet(e),this.columnSearch.removeSheet(e);const n=this.namedExpressions.getAllNamedExpressionsForScope(e).map(t=>this.removeNamedExpression(t.normalizeExpressionName(),e));return{version:t,scopedNamedExpressions:n}}removeSheetByName(e){const t=this.sheetMapping.fetch(e);return this.removeSheet(t)}clearSheet(e){this.dependencyGraph.clearSheet(e),this.columnSearch.removeSheet(e)}addSheet(e){const t=this.sheetMapping.addSheet(e),n=[];return this.dependencyGraph.addressMapping.autoAddSheet(t,zo(n)),this.sheetMapping.fetchDisplayName(t)}renameSheet(e,t){return this.sheetMapping.renameSheet(e,t)}moveRows(e,t,n,r){const i=Dt.fromNumberOfRows(e,r,n);this.lazilyTransformingAstService.beginCombinedMode(e),this.doAddRows(i),r<t&&(t+=n);const o=pr(e,0,t),s=pr(e,0,r);this.moveCells(o,Number.POSITIVE_INFINITY,n,s);const a=Dt.fromNumberOfRows(e,t,n);return this.doRemoveRows(a),this.lazilyTransformingAstService.commitCombinedMode()}moveColumns(e,t,n,r){const i=Ft.fromNumberOfColumns(e,r,n);this.lazilyTransformingAstService.beginCombinedMode(e),this.doAddColumns(i),r<t&&(t+=n);const o=pr(e,t,0),s=pr(e,r,0);this.moveCells(o,n,Number.POSITIVE_INFINITY,s);const a=Ft.fromNumberOfColumns(e,t,n);return this.doRemoveColumns(a),this.lazilyTransformingAstService.commitCombinedMode()}moveCells(e,t,n,r){this.ensureItIsPossibleToMoveCells(e,t,n,r);const i=Sr.spanFrom(e,t,n),o=Sr.spanFrom(r,t,n),s=r.col-e.col,a=r.row-e.row,l=r.sheet,c=this.getRangeClipboardCells(o),h=this.dependencyGraph.rawValuesFromRange(o);this.columnSearch.removeValues(h);const u=this.dependencyGraph.rawValuesFromRange(i);this.columnSearch.moveValues(u,s,a,l);let d=0;this.stats.measure(_t.TRANSFORM_ASTS,()=>{const e=new Fo(i,s,a,l);e.performEagerTransformations(this.dependencyGraph,this.parser),d=this.lazilyTransformingAstService.addTransformation(e)}),this.dependencyGraph.moveCells(i,s,a,l);const p=this.updateNamedExpressionsForMovedCells(e,t,n,r);return{version:d,overwrittenCellsData:c,addedGlobalNamedExpressions:p}}setRowOrder(e,t){const n=[];let r=[];for(const[i,o]of t)if(i!==o){const t=Sr.spanFrom({sheet:e,col:0,row:i},1/0,1),s=this.getRangeClipboardCells(t);r=r.concat(s),n.push(s.map(([{sheet:e,col:t},n])=>[{sheet:e,col:t,row:o},n]))}return n.forEach(t=>this.restoreClipboardCells(e,t.values())),r}setColumnOrder(e,t){const n=[];let r=[];for(const[i,o]of t)if(i!==o){const t=Sr.spanFrom({sheet:e,col:i,row:0},1,1/0),s=this.getRangeClipboardCells(t);r=r.concat(s),n.push(s.map(([{sheet:e,col:t,row:n},r])=>[{sheet:e,col:o,row:n},r]))}return n.forEach(t=>this.restoreClipboardCells(e,t.values())),r}addNamedExpression(e,t,n,r){const i=this.namedExpressions.addNamedExpression(e,n,r);this.storeNamedExpressionInCell(i.address,t),this.adjustNamedExpressionEdges(i,e,n)}restoreNamedExpression(e,t,n){const r=e.displayName;this.restoreCell(e.address,t);const i=this.namedExpressions.restoreNamedExpression(e,n);this.adjustNamedExpressionEdges(i,r,n)}changeNamedExpressionExpression(e,t,n,r){const i=this.namedExpressions.namedExpressionForScope(e,n);if(!i)throw new Zt(e);const o=i.copy();i.options=r;const s=this.getClipboardCell(i.address);return this.storeNamedExpressionInCell(i.address,t),[o,s]}removeNamedExpression(e,t){const n=this.namedExpressions.namedExpressionForScope(e,t);if(!n)throw new Zt(e);this.namedExpressions.remove(n.displayName,t);const r=this.getClipboardCell(n.address);if(void 0!==t){const t=this.namedExpressions.workbookNamedExpressionOrPlaceholder(e);this.dependencyGraph.exchangeNode(n.address,t.address)}else this.dependencyGraph.setCellEmpty(n.address);return[n,r]}ensureItIsPossibleToMoveCells(e,t,n,r){if(fr(e)||!(Jo(t)&&Jo(n)||es(e,t,n))||fr(r)||!this.sheetMapping.hasSheetWithId(e.sheet)||!this.sheetMapping.hasSheetWithId(r.sheet))throw new Kt("a valid range of cells to move.");const i=Sr.spanFrom(e,t,n),o=Sr.spanFrom(r,t,n);if(o.exceedsSheetSizeLimits(this.maxColumns,this.maxRows))throw new zt;if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(i))throw new yn;if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(o))throw new wn}restoreClipboardCells(e,t){const n=[];for(const[r,i]of t)if(this.restoreCell(r,i),i.type===So.FORMULA){const{dependencies:t}=this.parser.fetchCachedResult(i.hash);n.push(...this.updateNamedExpressionsForTargetAddress(e,r,t))}return n}restoreCell(e,t){switch(t.type){case So.VALUE:this.setValueToCell(t,e);break;case So.FORMULA:this.setFormulaToCellFromCache(t.hash,e);break;case So.EMPTY:this.setCellEmpty(e);break;case So.PARSING_ERROR:this.setParsingErrorToCell(t.rawInput,t.errors,e);break}}getOldContent(e){const t=this.dependencyGraph.getCell(e);if(void 0===t||t instanceof Kn)return[e,{type:So.EMPTY}];if(t instanceof $n)return[e,Object.assign({type:So.VALUE},t.getValues())];if(t instanceof On)return[t.getAddress(this.lazilyTransformingAstService),{type:So.FORMULA,hash:this.parser.computeHashFromAst(t.getFormula(this.lazilyTransformingAstService))}];if(t instanceof qn)return[e,{type:So.PARSING_ERROR,rawInput:t.rawInput,errors:t.errors}];throw Error("Trying to copy unsupported type")}getClipboardCell(e){const t=this.dependencyGraph.getCell(e);if(void 0===t||t instanceof Kn)return{type:So.EMPTY};if(t instanceof $n)return Object.assign({type:So.VALUE},t.getValues());if(t instanceof Nn){const n=t.getArrayCellValue(e);return n===Et?{type:So.EMPTY}:{type:So.VALUE,parsedValue:n,rawValue:t.getArrayCellRawValue(e)}}if(t instanceof An)return{type:So.FORMULA,hash:this.parser.computeHashFromAst(t.getFormula(this.lazilyTransformingAstService))};if(t instanceof qn)return{type:So.PARSING_ERROR,rawInput:t.rawInput,errors:t.errors};throw Error("Trying to copy unsupported type")}getSheetClipboardCells(e){const t=this.dependencyGraph.getSheetHeight(e),n=this.dependencyGraph.getSheetWidth(e),r=new Array(t);for(let i=0;i<t;i++){r[i]=new Array(n);for(let t=0;t<n;t++){const n=pr(e,t,i);r[i][t]=this.getClipboardCell(n)}}return r}getRangeClipboardCells(e){const t=[];for(const n of e.addresses(this.dependencyGraph))t.push([n,this.getClipboardCell(n)]);return t}setCellContent(e,t){const n=this.cellContentParser.parse(t),r=this.getOldContent(e);if(n instanceof Eo.Formula){const t=this.parser.parse(n.formula,e),{ast:r,errors:o}=t;if(o.length>0)this.setParsingErrorToCell(n.formula,o,e);else try{const n=this.arraySizePredictor.checkArraySize(r,e);if(n.width<=0||n.height<=0)throw Error("Incorrect array size");this.setFormulaToCell(e,n,t)}catch(i){if(!i.message)throw i;const t={type:W.InvalidRangeSize,message:"Invalid range size."};this.setParsingErrorToCell(n.formula,[t],e)}}else n instanceof Eo.Empty?this.setCellEmpty(e):this.setValueToCell({parsedValue:n.value,rawValue:t},e);return r}setSheetContent(e,t){this.clearSheet(e);for(let n=0;n<t.length;n++)for(let r=0;r<t[n].length;r++){const i=pr(e,r,n);this.setCellContent(i,t[n][r])}}setParsingErrorToCell(e,t,n){const r=this.dependencyGraph.getCellValue(n),i=new qn(t,e),o=this.dependencyGraph.setParsingErrorToCell(n,i);this.columnSearch.remove(Ct(r),n),this.columnSearch.applyChanges(o.getChanges()),this.changes.addAll(o),this.changes.addChange(i.getCellValue(),n)}setFormulaToCell(e,t,{ast:n,hasVolatileFunction:r,hasStructuralChangeFunction:i,dependencies:o}){const s=this.dependencyGraph.getCellValue(e),a=this.dependencyGraph.setFormulaToCell(e,n,bt(o,e),t,r,i);this.columnSearch.remove(Ct(s),e),this.columnSearch.applyChanges(a.getChanges()),this.changes.addAll(a)}setValueToCell(e,t){const n=this.dependencyGraph.getCellValue(t),r=this.dependencyGraph.setValueToCell(t,e);this.columnSearch.change(Ct(n),Ct(e.parsedValue),t),this.columnSearch.applyChanges(r.getChanges().filter(e=>!br(e.address,t))),this.changes.addAll(r),this.changes.addChange(e.parsedValue,t)}setCellEmpty(e){if(this.dependencyGraph.isArrayInternalCell(e))return;const t=this.dependencyGraph.getCellValue(e),n=this.dependencyGraph.setCellEmpty(e);this.columnSearch.remove(Ct(t),e),this.columnSearch.applyChanges(n.getChanges()),this.changes.addAll(n),this.changes.addChange(Et,e)}setFormulaToCellFromCache(e,t){const{ast:n,hasVolatileFunction:r,hasStructuralChangeFunction:i,dependencies:o}=this.parser.fetchCachedResult(e),s=bt(o,t),[a]=new Do(t.sheet).transformSingleAst(n,t);this.parser.rememberNewAst(a);const l=vt(s),c=this.arraySizePredictor.checkArraySize(n,t);this.dependencyGraph.setFormulaToCell(t,a,l,c,r,i)}rowEffectivelyNotInSheet(e,t){const n=this.dependencyGraph.addressMapping.getHeight(t);return e>=n}getAndClearContentChanges(){const e=this.changes;return this.changes=Ht.empty(),e}forceApplyPostponedTransformations(){this.dependencyGraph.forceApplyPostponedTransformations()}doRemoveRows(e){if(this.rowEffectivelyNotInSheet(e.rowStart,e.sheet))return;const t=[];for(const[o]of this.dependencyGraph.entriesFromRowsSpan(e))t.push({address:o,cellType:this.getClipboardCell(o)});const{affectedArrays:n,contentChanges:r}=this.dependencyGraph.removeRows(e);this.columnSearch.applyChanges(r.getChanges());let i=0;return this.stats.measure(_t.TRANSFORM_ASTS,()=>{const t=new Bo(e);t.performEagerTransformations(this.dependencyGraph,this.parser),i=this.lazilyTransformingAstService.addTransformation(t)}),this.rewriteAffectedArrays(n),{version:i,removedCells:t,rowFrom:e.rowStart,rowCount:e.numberOfRows}}doRemoveColumns(e){if(this.columnEffectivelyNotInSheet(e.columnStart,e.sheet))return;const t=[];for(const[o]of this.dependencyGraph.entriesFromColumnsSpan(e))t.push({address:o,cellType:this.getClipboardCell(o)});const{affectedArrays:n,contentChanges:r}=this.dependencyGraph.removeColumns(e);this.columnSearch.applyChanges(r.getChanges()),this.columnSearch.removeColumns(e);let i=0;return this.stats.measure(_t.TRANSFORM_ASTS,()=>{const t=new Vo(e);t.performEagerTransformations(this.dependencyGraph,this.parser),i=this.lazilyTransformingAstService.addTransformation(t)}),this.rewriteAffectedArrays(n),{version:i,removedCells:t,columnFrom:e.columnStart,columnCount:e.numberOfColumns}}doAddRows(e){if(this.rowEffectivelyNotInSheet(e.rowStart,e.sheet))return;const{affectedArrays:t}=this.dependencyGraph.addRows(e);this.stats.measure(_t.TRANSFORM_ASTS,()=>{const t=new Ho(e);t.performEagerTransformations(this.dependencyGraph,this.parser),this.lazilyTransformingAstService.addTransformation(t)}),this.rewriteAffectedArrays(t)}rewriteAffectedArrays(e){for(const t of e.values()){if(t.array.size.isRef)continue;const e=t.getFormula(this.lazilyTransformingAstService),n=t.getAddress(this.lazilyTransformingAstService),r=this.parser.computeHashFromAst(e);this.setFormulaToCellFromCache(r,n)}}doAddColumns(e){if(this.columnEffectivelyNotInSheet(e.columnStart,e.sheet))return;const{affectedArrays:t,contentChanges:n}=this.dependencyGraph.addColumns(e);this.columnSearch.addColumns(e),this.columnSearch.applyChanges(n.getChanges()),this.stats.measure(_t.TRANSFORM_ASTS,()=>{const t=new jo(e);t.performEagerTransformations(this.dependencyGraph,this.parser),this.lazilyTransformingAstService.addTransformation(t)}),this.rewriteAffectedArrays(t)}columnEffectivelyNotInSheet(e,t){const n=this.dependencyGraph.addressMapping.getWidth(t);return e>=n}adjustNamedExpressionEdges(e,t,n){if(void 0===n)return;const{vertex:r,id:i}=this.dependencyGraph.fetchCellOrCreateEmpty(e.address),o=null!==i&&void 0!==i?i:this.dependencyGraph.graph.getNodeId(r),s=this.namedExpressions.workbookNamedExpressionOrPlaceholder(t),{vertex:a,id:l}=this.dependencyGraph.fetchCellOrCreateEmpty(s.address),c=null!==l&&void 0!==l?l:this.dependencyGraph.graph.getNodeId(a);for(const h of this.dependencyGraph.graph.adjacentNodes(a))if(h instanceof An&&h.getAddress(this.lazilyTransformingAstService).sheet===n){const t=h.getFormula(this.lazilyTransformingAstService),n=h.getAddress(this.lazilyTransformingAstService),{dependencies:r}=this.parser.fetchCachedResultForAst(t);for(const i of bt(r,n))i instanceof wt&&i.name.toLowerCase()===e.displayName.toLowerCase()&&(this.dependencyGraph.graph.removeEdge(c,h),this.dependencyGraph.graph.addEdge(o,h))}}storeNamedExpressionInCell(e,t){const n=this.cellContentParser.parse(t);if(n instanceof Eo.Formula){const t=this.parser.parse(n.formula,pr(-1,0,0));if(Po(t.ast))throw new bn;const{ast:r,hasVolatileFunction:i,hasStructuralChangeFunction:o,dependencies:s}=t;this.dependencyGraph.setFormulaToCell(e,r,bt(s,e),ei.scalar(),i,o)}else n instanceof Eo.Empty?this.setCellEmpty(e):this.setValueToCell({parsedValue:n.value,rawValue:t},e)}updateNamedExpressionsForMovedCells(e,t,n,r){if(e.sheet===r.sheet)return[];const i=[],o=Sr.spanFrom(r,t,n);for(const s of o.addresses(this.dependencyGraph)){const t=this.addressMapping.fetchCell(s);if(t instanceof An&&s.sheet!==e.sheet){const n=t.getFormula(this.lazilyTransformingAstService),{dependencies:r}=this.parser.fetchCachedResultForAst(n);i.push(...this.updateNamedExpressionsForTargetAddress(e.sheet,s,r))}}return i}updateNamedExpressionsForTargetAddress(e,t,n){if(e===t.sheet)return[];const r=[],i=this.addressMapping.fetchCell(t);for(const o of bt(n,t)){if(!(o instanceof wt))continue;const n=o.name,s=this.dependencyGraph.fetchNamedExpressionVertex(n,e).vertex,a=this.namedExpressions.isExpressionInScope(n,t.sheet),l=a?this.dependencyGraph.fetchNamedExpressionVertex(n,t.sheet).vertex:this.copyOrFetchGlobalNamedExpressionVertex(n,s,r);l!==s&&(this.dependencyGraph.graph.removeEdgeIfExists(s,i),this.dependencyGraph.graph.addEdge(l,i))}return r}allocateNamedExpressionAddressSpace(){this.dependencyGraph.addressMapping.addSheet(Lo.SHEET_FOR_WORKBOOK_EXPRESSIONS,new Qn(0,0))}copyOrFetchGlobalNamedExpressionVertex(e,t,n){let r=this.namedExpressions.namedExpressionForScope(e);if(void 0===r)if(r=this.namedExpressions.addNamedExpression(e),n.push(r.normalizeExpressionName()),t instanceof An){const e=this.parser.fetchCachedResultForAst(t.getFormula(this.lazilyTransformingAstService)),{ast:n,hasVolatileFunction:i,hasStructuralChangeFunction:o,dependencies:s}=e;this.dependencyGraph.setFormulaToCell(r.address,n,bt(s,r.address),ei.scalar(),i,o)}else t instanceof Kn?this.setCellEmpty(r.address):t instanceof $n&&this.setValueToCell(t.getValues(),r.address);return this.dependencyGraph.fetchCellOrCreateEmpty(r.address).vertex}}function Qo(e){if(e.length<=1)return e;const t=[...e].sort(([e],[t])=>e-t),n=t.reduce((e,[t,n])=>{const r=e[e.length-1],i=r[0]+r[1];return t<=i?r[1]+=Math.max(0,n-(i-t)):e.push([t,n]),e},[t[0]]);let r=0;for(let i=0;i<n.length;++i)n[i][0]-=r,r+=n[i][1];return n}function Zo(e){if(e.length<=1)return e;const t=[...e].sort(([e],[t])=>e-t),n=t.reduce((e,[t,n])=>{const r=e[e.length-1];return t===r[0]?r[1]=Math.max(r[1],n):e.push([t,n]),e},[t[0]]);let r=0;for(let i=0;i<n.length;++i)n[i][0]+=r,r+=n[i][1];return n}function Jo(e){return Number.isInteger(e)&&e>0}function es(e,t,n){return 0===e.row&&Jo(t)&&n===Number.POSITIVE_INFINITY||0===e.col&&Jo(n)&&t===Number.POSITIVE_INFINITY}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class ts{}class ns extends ts{constructor(e,t){super(),this.command=e,this.rowsRemovals=t}doUndo(e){e.undoRemoveRows(this)}doRedo(e){e.redoRemoveRows(this)}}class rs extends ts{constructor(e,t,n,r,i,o,s){super(),this.sourceLeftCorner=e,this.width=t,this.height=n,this.destinationLeftCorner=r,this.overwrittenCellsData=i,this.addedGlobalNamedExpressions=o,this.version=s}doUndo(e){e.undoMoveCells(this)}doRedo(e){e.redoMoveCells(this)}}class is extends ts{constructor(e){super(),this.command=e}doUndo(e){e.undoAddRows(this)}doRedo(e){e.redoAddRows(this)}}class os extends ts{constructor(e,t,n){super(),this.sheetId=e,this.rowMapping=t,this.oldContent=n}doUndo(e){e.undoSetRowOrder(this)}doRedo(e){e.redoSetRowOrder(this)}}class ss extends ts{constructor(e,t,n){super(),this.sheetId=e,this.columnMapping=t,this.oldContent=n}doUndo(e){e.undoSetColumnOrder(this)}doRedo(e){e.redoSetColumnOrder(this)}}class as extends ts{constructor(e,t,n){super(),this.sheetId=e,this.oldSheetContent=t,this.newSheetContent=n}doUndo(e){e.undoSetSheetContent(this)}doRedo(e){e.redoSetSheetContent(this)}}class ls extends ts{constructor(e,t,n,r,i){super(),this.sheet=e,this.startRow=t,this.numberOfRows=n,this.targetRow=r,this.version=i,this.undoStart=this.startRow<this.targetRow?this.targetRow-this.numberOfRows:this.targetRow,this.undoEnd=this.startRow>this.targetRow?this.startRow+this.numberOfRows:this.startRow}doUndo(e){e.undoMoveRows(this)}doRedo(e){e.redoMoveRows(this)}}class cs extends ts{constructor(e,t,n,r,i){super(),this.sheet=e,this.startColumn=t,this.numberOfColumns=n,this.targetColumn=r,this.version=i,this.undoStart=this.startColumn<this.targetColumn?this.targetColumn-this.numberOfColumns:this.targetColumn,this.undoEnd=this.startColumn>this.targetColumn?this.startColumn+this.numberOfColumns:this.startColumn}doUndo(e){e.undoMoveColumns(this)}doRedo(e){e.redoMoveColumns(this)}}class hs extends ts{constructor(e){super(),this.command=e}doUndo(e){e.undoAddColumns(this)}doRedo(e){e.redoAddColumns(this)}}class us extends ts{constructor(e,t){super(),this.command=e,this.columnsRemovals=t}doUndo(e){e.undoRemoveColumns(this)}doRedo(e){e.redoRemoveColumns(this)}}class ds extends ts{constructor(e){super(),this.sheetName=e}doUndo(e){e.undoAddSheet(this)}doRedo(e){e.redoAddSheet(this)}}class ps extends ts{constructor(e,t,n,r,i){super(),this.sheetName=e,this.sheetId=t,this.oldSheetContent=n,this.scopedNamedExpressions=r,this.version=i}doUndo(e){e.undoRemoveSheet(this)}doRedo(e){e.redoRemoveSheet(this)}}class fs extends ts{constructor(e,t,n){super(),this.sheetId=e,this.oldName=t,this.newName=n}doUndo(e){e.undoRenameSheet(this)}doRedo(e){e.redoRenameSheet(this)}}class gs extends ts{constructor(e,t){super(),this.sheetId=e,this.oldSheetContent=t}doUndo(e){e.undoClearSheet(this)}doRedo(e){e.redoClearSheet(this)}}class ms extends ts{constructor(e){super(),this.cellContents=e}doUndo(e){e.undoSetCellContents(this)}doRedo(e){e.redoSetCellContents(this)}}class ys extends ts{constructor(e,t,n,r){super(),this.targetLeftCorner=e,this.oldContent=t,this.newContent=n,this.addedGlobalNamedExpressions=r}doUndo(e){e.undoPaste(this)}doRedo(e){e.redoPaste(this)}}class ws extends ts{constructor(e,t,n,r){super(),this.name=e,this.newContent=t,this.scope=n,this.options=r}doUndo(e){e.undoAddNamedExpression(this)}doRedo(e){e.redoAddNamedExpression(this)}}class bs extends ts{constructor(e,t,n){super(),this.namedExpression=e,this.content=t,this.scope=n}doUndo(e){e.undoRemoveNamedExpression(this)}doRedo(e){e.redoRemoveNamedExpression(this)}}class vs extends ts{constructor(e,t,n,r,i){super(),this.namedExpression=e,this.newContent=t,this.oldContent=n,this.scope=r,this.options=i}doUndo(e){e.undoChangeNamedExpression(this)}doRedo(e){e.redoChangeNamedExpression(this)}}class Es extends ts{constructor(){super(...arguments),this.operations=[]}add(e){this.operations.push(e)}*reversedOperations(){for(let e=this.operations.length-1;e>=0;e--)yield this.operations[e]}doUndo(e){e.undoBatch(this)}doRedo(e){e.redoBatch(this)}}class Cs{constructor(e,t){this.operations=t,this.oldData=new Map,this.undoStack=[],this.redoStack=[],this.undoLimit=e.undoLimit}saveOperation(e){void 0!==this.batchUndoEntry?this.batchUndoEntry.add(e):this.addUndoEntry(e)}beginBatchMode(){this.batchUndoEntry=new Es}commitBatchMode(){if(void 0===this.batchUndoEntry)throw Error("Batch mode wasn't started");this.addUndoEntry(this.batchUndoEntry),this.batchUndoEntry=void 0}storeDataForVersion(e,t,n){this.oldData.has(e)||this.oldData.set(e,[]);const r=this.oldData.get(e);r.push([t,n])}clearRedoStack(){this.redoStack=[]}clearUndoStack(){this.undoStack=[]}isUndoStackEmpty(){return 0===this.undoStack.length}isRedoStackEmpty(){return 0===this.redoStack.length}undo(){const e=this.undoStack.pop();if(!e)throw Error("Attempted to undo without operation on stack");this.undoEntry(e),this.redoStack.push(e)}undoBatch(e){for(const t of e.reversedOperations())this.undoEntry(t)}undoRemoveRows(e){this.operations.forceApplyPostponedTransformations();const{command:{sheet:t},rowsRemovals:n}=e;for(let r=n.length-1;r>=0;--r){const e=n[r];this.operations.addRows(new Xo(t,[[e.rowFrom,e.rowCount]]));for(const{address:t,cellType:n}of e.removedCells)this.operations.restoreCell(t,n);this.restoreOldDataFromVersion(e.version-1)}}undoRemoveColumns(e){this.operations.forceApplyPostponedTransformations();const{command:{sheet:t},columnsRemovals:n}=e;for(let r=n.length-1;r>=0;--r){const e=n[r];this.operations.addColumns(new Ko(t,[[e.columnFrom,e.columnCount]]));for(const{address:t,cellType:n}of e.removedCells)this.operations.restoreCell(t,n);this.restoreOldDataFromVersion(e.version-1)}}undoAddRows(e){const t=e.command.rowsSpans();for(let n=t.length-1;n>=0;--n){const r=t[n];this.operations.removeRows(new Yo(e.command.sheet,[[r.rowStart,r.numberOfRows]]))}}undoAddColumns(e){const t=e.command.columnsSpans();for(let n=t.length-1;n>=0;--n){const r=t[n];this.operations.removeColumns(new $o(e.command.sheet,[[r.columnStart,r.numberOfColumns]]))}}undoSetCellContents(e){for(const t of e.cellContents){const e=t.address,[n,r]=t.oldContent;br(e,n)||this.operations.setCellEmpty(e),this.operations.restoreCell(n,r)}}undoPaste(e){this.restoreOperationOldContent(e.oldContent);for(const t of e.addedGlobalNamedExpressions)this.operations.removeNamedExpression(t)}undoMoveRows(e){const{sheet:t}=e;this.operations.moveRows(t,e.undoStart,e.numberOfRows,e.undoEnd),this.restoreOldDataFromVersion(e.version-1)}undoMoveColumns(e){const{sheet:t}=e;this.operations.moveColumns(t,e.undoStart,e.numberOfColumns,e.undoEnd),this.restoreOldDataFromVersion(e.version-1)}undoMoveCells(e){this.operations.forceApplyPostponedTransformations(),this.operations.moveCells(e.destinationLeftCorner,e.width,e.height,e.sourceLeftCorner),this.restoreOperationOldContent(e.overwrittenCellsData),this.restoreOldDataFromVersion(e.version-1);for(const t of e.addedGlobalNamedExpressions)this.operations.removeNamedExpression(t)}undoAddSheet(e){const{sheetName:t}=e;this.operations.removeSheetByName(t)}undoRemoveSheet(e){this.operations.forceApplyPostponedTransformations();const{oldSheetContent:t,sheetId:n}=e;this.operations.addSheet(e.sheetName);for(let r=0;r<t.length;r++){const e=t[r];for(let t=0;t<e.length;t++){const i=e[t],o=pr(n,t,r);this.operations.restoreCell(o,i)}}for(const[r,i]of e.scopedNamedExpressions)this.operations.restoreNamedExpression(r,i,n);this.restoreOldDataFromVersion(e.version-1)}undoRenameSheet(e){this.operations.renameSheet(e.sheetId,e.oldName)}undoClearSheet(e){const{oldSheetContent:t,sheetId:n}=e;for(let r=0;r<t.length;r++){const e=t[r];for(let t=0;t<e.length;t++){const i=e[t],o=pr(n,t,r);this.operations.restoreCell(o,i)}}}undoSetSheetContent(e){const{oldSheetContent:t,sheetId:n}=e;this.operations.clearSheet(n);for(let r=0;r<t.length;r++){const e=t[r];for(let t=0;t<e.length;t++){const i=e[t],o=pr(n,t,r);this.operations.restoreCell(o,i)}}}undoAddNamedExpression(e){this.operations.removeNamedExpression(e.name,e.scope)}undoRemoveNamedExpression(e){this.operations.restoreNamedExpression(e.namedExpression,e.content,e.scope)}undoChangeNamedExpression(e){this.operations.restoreNamedExpression(e.namedExpression,e.oldContent,e.scope)}undoSetRowOrder(e){this.restoreOperationOldContent(e.oldContent)}undoSetColumnOrder(e){this.restoreOperationOldContent(e.oldContent)}redo(){const e=this.redoStack.pop();if(!e)throw Error("Attempted to redo without operation on stack");this.redoEntry(e),this.undoStack.push(e)}redoBatch(e){for(const t of e.operations)this.redoEntry(t)}redoRemoveRows(e){this.operations.removeRows(e.command)}redoMoveCells(e){this.operations.moveCells(e.sourceLeftCorner,e.width,e.height,e.destinationLeftCorner)}redoRemoveColumns(e){this.operations.removeColumns(e.command)}redoPaste(e){const{targetLeftCorner:t,newContent:n}=e,r=n.length,i=n[0].length;for(let o=0;o<r;++o)for(let e=0;e<i;++e){const r=pr(t.sheet,t.col+e,t.row+o);this.operations.restoreCell(r,n[o][e])}}redoSetCellContents(e){for(const t of e.cellContents)this.operations.setCellContent(t.address,t.newContent)}redoAddRows(e){this.operations.addRows(e.command)}redoAddColumns(e){this.operations.addColumns(e.command)}redoRemoveSheet(e){this.operations.removeSheetByName(e.sheetName)}redoAddSheet(e){this.operations.addSheet(e.sheetName)}redoRenameSheet(e){this.operations.renameSheet(e.sheetId,e.newName)}redoMoveRows(e){this.operations.moveRows(e.sheet,e.startRow,e.numberOfRows,e.targetRow)}redoMoveColumns(e){this.operations.moveColumns(e.sheet,e.startColumn,e.numberOfColumns,e.targetColumn)}redoClearSheet(e){this.operations.clearSheet(e.sheetId)}redoSetSheetContent(e){const{sheetId:t,newSheetContent:n}=e;this.operations.setSheetContent(t,n)}redoAddNamedExpression(e){this.operations.addNamedExpression(e.name,e.newContent,e.scope,e.options)}redoRemoveNamedExpression(e){this.operations.removeNamedExpression(e.namedExpression.displayName,e.scope)}redoChangeNamedExpression(e){this.operations.changeNamedExpressionExpression(e.namedExpression.displayName,e.newContent,e.scope,e.options)}redoSetRowOrder(e){this.operations.setRowOrder(e.sheetId,e.rowMapping)}redoSetColumnOrder(e){this.operations.setColumnOrder(e.sheetId,e.columnMapping)}addUndoEntry(e){this.undoStack.push(e),this.undoStack.splice(0,Math.max(0,this.undoStack.length-this.undoLimit))}undoEntry(e){e.doUndo(this)}restoreOperationOldContent(e){for(const[t,n]of e)this.operations.restoreCell(t,n)}redoEntry(e){e.doRedo(this)}restoreOldDataFromVersion(e){const t=this.oldData.get(e)||[];for(const n of t){const[e,t]=n;this.operations.setFormulaToCellFromCache(t,e)}}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Ss{constructor(e,t,n,r,i,o,s,a,l,c){this.operations=t,this.undoRedo=n,this.clipboardOperations=r,this.dependencyGraph=i,this.columnSearch=o,this.parser=s,this.cellContentParser=a,this.lazilyTransformingAstService=l,this.namedExpressions=c,this.maxRows=e.maxRows,this.maxColumns=e.maxColumns}get sheetMapping(){return this.dependencyGraph.sheetMapping}addRows(e,...t){const n=new Xo(e,t);this.ensureItIsPossibleToAddRows(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.operations.addRows(n),this.undoRedo.saveOperation(new is(n))}removeRows(e,...t){const n=new Yo(e,t);this.ensureItIsPossibleToRemoveRows(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const r=this.operations.removeRows(n);this.undoRedo.saveOperation(new ns(n,r))}addColumns(e,...t){const n=new Ko(e,t);this.ensureItIsPossibleToAddColumns(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.operations.addColumns(n),this.undoRedo.saveOperation(new hs(n))}removeColumns(e,...t){const n=new $o(e,t);this.ensureItIsPossibleToRemoveColumns(e,...t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const r=this.operations.removeColumns(n);this.undoRedo.saveOperation(new us(n,r))}moveCells(e,t,n,r){this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const{version:i,overwrittenCellsData:o,addedGlobalNamedExpressions:s}=this.operations.moveCells(e,t,n,r);this.undoRedo.saveOperation(new rs(e,t,n,r,o,s,i))}moveRows(e,t,n,r){this.ensureItIsPossibleToMoveRows(e,t,n,r),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const i=this.operations.moveRows(e,t,n,r);this.undoRedo.saveOperation(new ls(e,t,n,r,i))}moveColumns(e,t,n,r){this.ensureItIsPossibleToMoveColumns(e,t,n,r),this.undoRedo.clearRedoStack();const i=this.operations.moveColumns(e,t,n,r);this.undoRedo.saveOperation(new cs(e,t,n,r,i))}cut(e,t,n){this.clipboardOperations.cut(e,t,n)}ensureItIsPossibleToCopy(e,t,n){if(!Rs(t))throw new Kt("width to be positive integer.");if(!Rs(n))throw new Kt("height to be positive integer.")}copy(e,t,n){this.ensureItIsPossibleToCopy(e,t,n),this.clipboardOperations.copy(e,t,n)}paste(e){const t=this.clipboardOperations.clipboard;if(void 0===t)throw new tn;if(this.clipboardOperations.isCutClipboard())this.moveCells(t.sourceLeftCorner,t.width,t.height,e);else if(this.clipboardOperations.isCopyClipboard()){this.clipboardOperations.ensureItIsPossibleToCopyPaste(e);const n=Sr.spanFrom(e,t.width,t.height),r=this.operations.getRangeClipboardCells(n);this.undoRedo.clearRedoStack();const i=this.operations.restoreClipboardCells(t.sourceLeftCorner.sheet,t.getContent(e));this.undoRedo.saveOperation(new ys(e,r,t.content,i))}}beginUndoRedoBatchMode(){this.undoRedo.beginBatchMode()}commitUndoRedoBatchMode(){this.undoRedo.commitBatchMode()}isClipboardEmpty(){return void 0===this.clipboardOperations.clipboard}clearClipboard(){this.clipboardOperations.clear()}addSheet(e){void 0!==e&&this.ensureItIsPossibleToAddSheet(e),this.undoRedo.clearRedoStack();const t=this.operations.addSheet(e);return this.undoRedo.saveOperation(new ds(t)),t}removeSheet(e){this.ensureScopeIdIsValid(e),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const t=this.sheetMapping.fetchDisplayName(e),n=this.operations.getSheetClipboardCells(e),{version:r,scopedNamedExpressions:i}=this.operations.removeSheet(e);this.undoRedo.saveOperation(new ps(t,e,n,i,r))}renameSheet(e,t){this.ensureItIsPossibleToRenameSheet(e,t);const n=this.operations.renameSheet(e,t);return void 0!==n&&(this.undoRedo.clearRedoStack(),this.undoRedo.saveOperation(new fs(e,n,t))),n}clearSheet(e){this.ensureScopeIdIsValid(e),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const t=this.operations.getSheetClipboardCells(e);this.operations.clearSheet(e),this.undoRedo.saveOperation(new gs(e,t))}setCellContents(e,t){if(t instanceof Array){for(let r=0;r<t.length;r++)if(!(t[r]instanceof Array))throw new Kt("an array of arrays or a raw cell value.")}else t=[[t]];this.ensureItIsPossibleToChangeCellContents(e,t),this.undoRedo.clearRedoStack();const n=[];for(let r=0;r<t.length;r++)for(let i=0;i<t[r].length;i++){const o={sheet:e.sheet,row:e.row+r,col:e.col+i},s=t[r][i];this.clipboardOperations.abortCut();const a=this.operations.setCellContent(o,s);n.push({address:o,newContent:s,oldContent:a})}this.undoRedo.saveOperation(new ms(n))}setSheetContent(e,t){this.ensureScopeIdIsValid(e),this.ensureItIsPossibleToChangeSheetContents(e,t),Go(t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const n=this.operations.getSheetClipboardCells(e);this.operations.setSheetContent(e,t),this.undoRedo.saveOperation(new as(e,n,t))}setRowOrder(e,t){this.validateSwapRowIndexes(e,t),this.testRowOrderForArrays(e,t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const n=this.operations.setRowOrder(e,t);this.undoRedo.saveOperation(new os(e,t,n))}validateSwapRowIndexes(e,t){if(!this.sheetMapping.hasSheetWithId(e))throw new Bt(e);this.validateRowOrColumnMapping(e,t,"row")}testColumnOrderForArrays(e,t){for(const[n,r]of t)if(n!==r){const t=Sr.spanFrom({sheet:e,col:n,row:0},1,1/0);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(t))throw new yn}}setColumnOrder(e,t){this.validateSwapColumnIndexes(e,t),this.testColumnOrderForArrays(e,t),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut();const n=this.operations.setColumnOrder(e,t);this.undoRedo.saveOperation(new ss(e,t,n))}validateSwapColumnIndexes(e,t){if(!this.sheetMapping.hasSheetWithId(e))throw new Bt(e);this.validateRowOrColumnMapping(e,t,"column")}testRowOrderForArrays(e,t){for(const[n,r]of t)if(n!==r){const t=Sr.spanFrom({sheet:e,col:0,row:n},1/0,1);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(t))throw new yn}}mappingFromOrder(e,t,n){if(!this.sheetMapping.hasSheetWithId(e))throw new Bt(e);const r="row"===n?this.dependencyGraph.getSheetHeight(e):this.dependencyGraph.getSheetWidth(e);if(t.length!==r)throw new Kt(`number of ${n}s provided to be sheet ${"row"===n?"height":"width"}.`);const i=[];for(let o=0;o<r;o++)t[o]!==o&&i.push([o,t[o]]);return i}undo(){if(this.undoRedo.isUndoStackEmpty())throw new Jt;this.clipboardOperations.abortCut(),this.undoRedo.undo()}redo(){if(this.undoRedo.isRedoStackEmpty())throw new en;this.clipboardOperations.abortCut(),this.undoRedo.redo()}addNamedExpression(e,t,n,r){this.ensureItIsPossibleToAddNamedExpression(e,t,n),this.operations.addNamedExpression(e,t,n,r),this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.undoRedo.saveOperation(new ws(e,t,n,r))}changeNamedExpressionExpression(e,t,n,r){this.ensureItIsPossibleToChangeNamedExpression(e,n,t);const[i,o]=this.operations.changeNamedExpressionExpression(e,n,t,r);this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.undoRedo.saveOperation(new vs(i,n,o,t,r))}removeNamedExpression(e,t){this.ensureScopeIdIsValid(t);const[n,r]=this.operations.removeNamedExpression(e,t);return this.undoRedo.clearRedoStack(),this.clipboardOperations.abortCut(),this.undoRedo.saveOperation(new bs(n,r,t)),n}ensureItIsPossibleToAddNamedExpression(e,t,n){this.ensureScopeIdIsValid(n),this.ensureNamedExpressionNameIsValid(e,n),this.ensureNamedExpressionIsValid(t)}ensureItIsPossibleToChangeNamedExpression(e,t,n){if(this.ensureScopeIdIsValid(n),void 0===this.namedExpressions.namedExpressionForScope(e,n))throw new Zt(e);this.ensureNamedExpressionIsValid(t)}isItPossibleToRemoveNamedExpression(e,t){if(this.ensureScopeIdIsValid(t),void 0===this.namedExpressions.namedExpressionForScope(e,t))throw new Zt(e)}ensureItIsPossibleToAddRows(e,...t){if(!this.sheetMapping.hasSheetWithId(e))throw new Bt(e);const n=this.dependencyGraph.getSheetHeight(e),r=t.map(e=>e[1]).reduce((e,t)=>e+t,0);if(n+r>this.maxRows)throw new zt;for(const[i,o]of t)if(!Ts(i)||!Rs(o))throw new Kt("row number to be nonnegative and number of rows to add to be positive.")}ensureItIsPossibleToRemoveRows(e,...t){for(const[n,r]of t){const t=n+r-1;if(!Ts(n)||!Ts(t))throw new Kt("starting and ending row to be nonnegative.");if(t<n)throw new Kt("starting row to be smaller than the ending row.");if(!this.sheetMapping.hasSheetWithId(e))throw new Bt(e)}}ensureItIsPossibleToAddColumns(e,...t){if(!this.sheetMapping.hasSheetWithId(e))throw new Bt(e);const n=this.dependencyGraph.getSheetWidth(e),r=t.map(e=>e[1]).reduce((e,t)=>e+t,0);if(n+r>this.maxColumns)throw new zt;for(const[i,o]of t)if(!Ts(i)||!Rs(o))throw new Kt("column number to be nonnegative and number of columns to add to be positive.")}ensureItIsPossibleToRemoveColumns(e,...t){for(const[n,r]of t){const t=n+r-1;if(!Ts(n)||!Ts(t))throw new Kt("starting and ending column to be nonnegative.");if(t<n)throw new Kt("starting column to be smaller than the ending column.");if(!this.sheetMapping.hasSheetWithId(e))throw new Bt(e)}}ensureItIsPossibleToMoveRows(e,t,n,r){this.ensureItIsPossibleToAddRows(e,[r,n]);const i=pr(e,0,t),o=pr(e,0,r);if(!this.sheetMapping.hasSheetWithId(e)||fr(i)||fr(o)||!Rs(n)||r<=t+n&&r>=t)throw new Kt("a valid range of rows to move.");const s=this.dependencyGraph.getSheetWidth(e),a=Sr.spanFrom(i,s,n);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(a))throw new yn;if(r>0&&this.dependencyGraph.arrayMapping.isFormulaArrayInAllRows(Dt.fromNumberOfRows(e,r-1,2)))throw new wn}ensureItIsPossibleToMoveColumns(e,t,n,r){this.ensureItIsPossibleToAddColumns(e,[r,n]);const i=pr(e,t,0),o=pr(e,r,0);if(!this.sheetMapping.hasSheetWithId(e)||fr(i)||fr(o)||!Rs(n)||r<=t+n&&r>=t)throw new Kt("a valid range of columns to move.");const s=this.dependencyGraph.getSheetHeight(e),a=Sr.spanFrom(i,n,s);if(this.dependencyGraph.arrayMapping.isFormulaArrayInRange(a))throw new yn;if(r>0&&this.dependencyGraph.arrayMapping.isFormulaArrayInAllColumns(Ft.fromNumberOfColumns(e,r-1,2)))throw new wn}ensureItIsPossibleToAddSheet(e){if(this.sheetMapping.hasSheetWithName(e))throw new Gt(e)}ensureItIsPossibleToRenameSheet(e,t){if(!this.sheetMapping.hasSheetWithId(e))throw new Bt(e);const n=this.sheetMapping.get(t);if(void 0!==n&&n!==e)throw new Gt(t)}ensureItIsPossibleToChangeContent(e){if(fr(e))throw new Xt(e);if(!this.sheetMapping.hasSheetWithId(e.sheet))throw new Bt(e.sheet)}ensureItIsPossibleToChangeCellContents(e,t){const n=zo(t),r=Sr.spanFrom(e,n.width,n.height);this.ensureRangeInSizeLimits(r);for(const i of r.addresses(this.dependencyGraph))this.ensureItIsPossibleToChangeContent(i)}ensureItIsPossibleToChangeSheetContents(e,t){const n=zo(t),r=Sr.spanFrom(pr(e,0,0),n.width,n.height);this.ensureRangeInSizeLimits(r)}ensureRangeInSizeLimits(e){if(e.exceedsSheetSizeLimits(this.maxColumns,this.maxRows))throw new zt}isThereSomethingToUndo(){return!this.undoRedo.isUndoStackEmpty()}isThereSomethingToRedo(){return!this.undoRedo.isRedoStackEmpty()}getAndClearContentChanges(){return this.operations.getAndClearContentChanges()}ensureScopeIdIsValid(e){if(void 0!==e&&!this.sheetMapping.hasSheetWithId(e))throw new Bt(e)}validateRowOrColumnMapping(e,t,n){const r="row"===n?this.dependencyGraph.getSheetHeight(e):this.dependencyGraph.getSheetWidth(e),i=t.map(([e,t])=>e).sort((e,t)=>e-t),o=t.map(([e,t])=>t).sort((e,t)=>e-t);for(let s=0;s<i.length;s++){if(!Ts(i[s])||i[s]>=r)throw new Kt(`${n} numbers to be nonnegative integers and less than sheet ${"row"===n?"height":"width"}.`);if(i[s]===i[s+1])throw new Kt(`source ${n} numbers to be unique.`);if(i[s]!==o[s])throw new Kt(`target ${n} numbers to be permutation of source ${n} numbers.`)}}ensureNamedExpressionNameIsValid(e,t){if(!this.namedExpressions.isNameValid(e))throw new Qt(e);if(!this.namedExpressions.isNameAvailable(e,t))throw new qt(e)}ensureNamedExpressionIsValid(e){const t=this.cellContentParser.parse(e);if(t instanceof Eo.Formula){const e=this.parser.parse(t.formula,pr(-1,0,0));if(Po(e.ast))throw new bn}}}function Rs(e){return Number.isInteger(e)&&e>0}function Ts(e){return Number.isInteger(e)&&e>=0}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Os{constructor(e,t,n,r,i,o){this.config=e,this.stats=t,this.interpreter=n,this.lazilyTransformingAstService=r,this.dependencyGraph=i,this.columnSearch=o}run(){this.stats.start(_t.TOP_SORT);const{sorted:e,cycled:t}=this.dependencyGraph.topSortWithScc();this.stats.end(_t.TOP_SORT),this.stats.measure(_t.EVALUATION,()=>{this.recomputeFormulas(t,e)})}partialRun(e){const t=Ht.empty();return this.stats.measure(_t.EVALUATION,()=>{this.dependencyGraph.graph.getTopSortedWithSccSubgraphFrom(e,e=>{if(e instanceof On){const n=e.isComputed()?e.getCellValue():void 0,r=this.recomputeFormulaVertexValue(e);if(r!==n){const i=e.getAddress(this.lazilyTransformingAstService);return t.addChange(r,i),this.columnSearch.change(Ct(n),Ct(r),i),!0}return!1}return!(e instanceof In)||(e.clearCache(),!0)},e=>{if(e instanceof In)e.clearCache();else if(e instanceof On){const n=e.getAddress(this.lazilyTransformingAstService);this.columnSearch.remove(Ct(e.valueOrUndef()),n);const r=new lr(Bn.CYCLE,void 0,e);e.setCellValue(r),t.addChange(r,n)}})}),t}runAndForget(e,t,n){const r=[];for(const o of bt(n,t))if(o instanceof Sr){const e=o;if(void 0===this.dependencyGraph.getRange(e.start,e.end)){const t=new In(e);this.dependencyGraph.rangeMapping.setRange(t),r.push(t)}}const i=this.evaluateAstToCellValue(e,new Or(t,this.config.useArrayArithmetic));return r.forEach(e=>{this.dependencyGraph.rangeMapping.removeRange(e)}),i}recomputeFormulas(e,t){e.forEach(e=>{e instanceof On&&e.setCellValue(new lr(Bn.CYCLE,void 0,e))}),t.forEach(e=>{if(e instanceof On){const t=this.recomputeFormulaVertexValue(e),n=e.getAddress(this.lazilyTransformingAstService);this.columnSearch.add(Ct(t),n)}else e instanceof In&&e.clearCache()})}recomputeFormulaVertexValue(e){const t=e.getAddress(this.lazilyTransformingAstService);if(e instanceof Nn&&(e.array.size.isRef||!this.dependencyGraph.isThereSpaceForArray(e)))return e.setNoSpace();{const n=e.getFormula(this.lazilyTransformingAstService),r=this.evaluateAstToCellValue(n,new Or(t,this.config.useArrayArithmetic,e));return e.setCellValue(r)}}evaluateAstToCellValue(e,t){const n=this.interpreter.evaluateAst(e,t);return n instanceof jt?n:n===Et&&this.config.evaluateNullToZero?0:n}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Ns{constructor(e,t){this.address=e,this.newValue=t}get col(){return this.address.col}get row(){return this.address.row}get sheet(){return this.address.sheet}get value(){return this.newValue}}class As{constructor(e,t){this.name=e,this.newValue=t}}class Is{constructor(e,t,n,r){this.config=e,this.namedExpressions=t,this.sheetIndexMapping=n,this.lazilyTransformingService=r}exportChange(e){const t=e.value,n=e.address;if(n.sheet===Lo.SHEET_FOR_WORKBOOK_EXPRESSIONS){const e=this.namedExpressions.namedExpressionInAddress(n.row);if(!e)throw new Error("Missing named expression");return new As(e.displayName,this.exportScalarOrRange(t))}if(t instanceof jt){const e=[];for(const[r,i]of t.entriesFromTopLeftCorner(n))e.push(new Ns(i,this.exportValue(r)));return e}return new Ns(n,this.exportValue(t))}exportValue(e){return e instanceof jt?this.detailedError(new lr(Bn.VALUE,Ne.ScalarExpected)):this.config.smartRounding&&Mt(e)?this.cellValueRounding(Ct(e)):e instanceof lr?this.detailedError(e):e===Et?null:Ct(e)}exportScalarOrRange(e){return e instanceof jt?e.rawData().map(e=>e.map(e=>this.exportValue(e))):this.exportValue(e)}detailedError(e){var t,n;let r=void 0;const i=null===(t=e.root)||void 0===t?void 0:t.getAddress(this.lazilyTransformingService);return void 0!==i&&(r=i.sheet===Lo.SHEET_FOR_WORKBOOK_EXPRESSIONS?null===(n=this.namedExpressions.namedExpressionInAddress(i.row))||void 0===n?void 0:n.displayName:k(this.sheetIndexMapping,i,-1)),new ii(e,this.config.translationPackage.getErrorTranslation(e.type),r)}cellValueRounding(e){if(0===e)return e;const t=Math.floor(Math.log10(Math.abs(e))),n=Math.pow(10,this.config.precisionRounding-t);return e<0?-Math.round(-e*n)/n:Math.round(e*n)/n}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Ms{constructor(e,t,n,r,i,o){this.dependencyGraph=e,this.columnSearch=t,this.parser=n,this.cellContentParser=r,this.stats=i,this.arraySizePredictor=o,this.buildStrategy=new xs(e,t,n,i,r,o)}buildGraph(e,t){const n=t.measure(_t.COLLECT_DEPENDENCIES,()=>this.buildStrategy.run(e));this.dependencyGraph.getAndClearContentChanges(),t.measure(_t.PROCESS_DEPENDENCIES,()=>this.processDependencies(n))}processDependencies(e){e.forEach((e,t)=>{this.dependencyGraph.processCellDependencies(e,t)})}}class xs{constructor(e,t,n,r,i,o){this.dependencyGraph=e,this.columnIndex=t,this.parser=n,this.stats=r,this.cellContentParser=i,this.arraySizePredictor=o}run(e){const t=new Map;for(const n in e){const r=this.dependencyGraph.getSheetId(n),i=e[n];for(let e=0;e<i.length;++e){const n=i[e];for(let i=0;i<n.length;++i){const o=n[i],s=pr(r,i,e),a=this.cellContentParser.parse(o);if(a instanceof Eo.Formula){const e=this.stats.measure(_t.PARSER,()=>this.parser.parse(a.formula,s));if(e.errors.length>0){this.shrinkArrayIfNeeded(s);const t=new qn(e.errors,a.formula);this.dependencyGraph.addVertex(s,t)}else{this.shrinkArrayIfNeeded(s);const n=this.arraySizePredictor.checkArraySize(e.ast,s);if(n.isScalar()){const n=new An(e.ast,s,0);t.set(n,bt(e.dependencies,s)),this.dependencyGraph.addVertex(s,n),e.hasVolatileFunction&&this.dependencyGraph.markAsVolatile(n),e.hasStructuralChangeFunction&&this.dependencyGraph.markAsDependentOnStructureChange(n)}else{const r=new Nn(e.ast,s,new ei(n.width,n.height));t.set(r,bt(e.dependencies,s)),this.dependencyGraph.addArrayVertex(s,r)}}}else if(a instanceof Eo.Empty);else{this.shrinkArrayIfNeeded(s);const e=new $n(a.value,o);this.columnIndex.add(Ct(a.value),s),this.dependencyGraph.addVertex(s,e)}}}}return t}shrinkArrayIfNeeded(e){const t=this.dependencyGraph.getCell(e);t instanceof Nn&&this.dependencyGraph.shrinkArrayToCorner(t)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */const _s=new Map([["gpl-v3",1],["missing",2],["invalid",3],["expired",4]]);class Ls extends Jr{version(e,t){return this.runFunction(e.args,t,this.metadata("VERSION"),()=>{const{licenseKeyValidityState:e,licenseKey:t}=this.config;let n;return _s.has(t)?n=_s.get(t):_s.has(e)?n=_s.get(e):"valid"===e&&(n=t.slice(-5)),`HyperFormula v${ua.version}, ${n}`})}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- function Ps(e,t){var n;let r=t.implementedFunctions[e];const i=null===(n=t.aliases)||void 0===n?void 0:n[e];if(void 0!==i){if(void 0!==r)throw new vn(e,t.name);r=t.implementedFunctions[i]}if(void 0===r)throw gn.functionNotDeclaredInPlugin(e,t.name);return r}Ls.implementedFunctions={VERSION:{method:"version",parameters:[]}};class ks{constructor(e){if(this.config=e,this.functions=new Map,this.arraySizeFunctions=new Map,this.volatileFunctions=new Set,this.arrayFunctions=new Set,this.structuralChangeFunctions=new Set,this.functionsWhichDoesNotNeedArgumentsToBeComputed=new Set,this.functionsMetadata=new Map,this.doesFunctionNeedArgumentToBeComputed=e=>this.functionsWhichDoesNotNeedArgumentsToBeComputed.has(e),this.isFunctionVolatile=e=>this.volatileFunctions.has(e),this.isArrayFunction=e=>this.arrayFunctions.has(e),this.isFunctionDependentOnSheetStructureChange=e=>this.structuralChangeFunctions.has(e),e.functionPlugins.length>0){this.instancePlugins=new Map;for(const t of e.functionPlugins)ks.loadPluginFunctions(t,this.instancePlugins)}else this.instancePlugins=new Map(ks.plugins);for(const[t,n]of ks.protectedFunctions())ks.loadFunctionUnprotected(n,t,this.instancePlugins);for(const[t,n]of this.instancePlugins.entries())this.categorizeFunction(t,Ps(t,n))}static registerFunctionPlugin(e,t){this.loadPluginFunctions(e,this.plugins),void 0!==t&&this.loadTranslations(t)}static registerFunction(e,t,n){this.loadPluginFunction(t,e,this.plugins),void 0!==n&&this.loadTranslations(n)}static unregisterFunction(e){if(this.functionIsProtected(e))throw mn.cannotUnregisterFunctionWithId(e);this.plugins.delete(e)}static unregisterFunctionPlugin(e){for(const t of this.protectedPlugins())if(t===e)throw mn.cannotUnregisterProtectedPlugin();for(const[t,n]of this.plugins.entries())n===e&&this.plugins.delete(t)}static unregisterAll(){this.plugins.clear()}static getRegisteredFunctionIds(){return[...Array.from(this.plugins.keys()),...Array.from(this._protectedPlugins.keys())]}static getPlugins(){return Array.from(new Set(this.plugins.values()).values())}static getFunctionPlugin(e){return this.functionIsProtected(e)?void 0:this.plugins.get(e)}static functionIsProtected(e){return this._protectedPlugins.has(e)}static loadTranslations(e){const t=new Set(ua.getRegisteredLanguagesCodes());Object.keys(e).forEach(n=>{t.has(n)&&ua.getLanguage(n).extendFunctions(e[n])})}static loadPluginFunctions(e,t){Object.keys(e.implementedFunctions).forEach(n=>{this.loadPluginFunction(e,n,t)}),void 0!==e.aliases&&Object.keys(e.aliases).forEach(n=>{this.loadPluginFunction(e,n,t)})}static loadPluginFunction(e,t,n){if(this.functionIsProtected(t))throw mn.cannotRegisterFunctionWithId(t);this.loadFunctionUnprotected(e,t,n)}static loadFunctionUnprotected(e,t,n){const r=Ps(t,e).method;if(!Object.prototype.hasOwnProperty.call(e.prototype,r))throw gn.functionMethodNotFound(r,e.name);n.set(t,e)}static*protectedFunctions(){for(const[e,t]of this._protectedPlugins)void 0!==t&&(yield[e,t])}static*protectedPlugins(){for(const[,e]of this._protectedPlugins)void 0!==e&&(yield e)}initializePlugins(e){const t=[];for(const[n,r]of this.instancePlugins.entries()){let i=t.find(e=>e instanceof r);void 0===i&&(i=new r(e),t.push(i));const o=Ps(n,r),s=o.method;this.functions.set(n,[s,i]);const a=o.arraySizeMethod;void 0!==a&&this.arraySizeFunctions.set(n,[a,i])}}getFunctionPlugin(e){if(!ks.functionIsProtected(e))return this.instancePlugins.get(e)}getFunction(e){const t=this.functions.get(e);if(void 0!==t&&this.config.translationPackage.isFunctionTranslated(e)){const[e,n]=t;return(t,r)=>n[e](t,r)}}getArraySizeFunction(e){const t=this.arraySizeFunctions.get(e);if(void 0!==t&&this.config.translationPackage.isFunctionTranslated(e)){const[e,n]=t;return(t,r)=>n[e](t,r)}}getMetadata(e){return this.functionsMetadata.get(e)}getPlugins(){const e=new Set;for(const[t,n]of this.instancePlugins)ks.functionIsProtected(t)||e.add(n);return Array.from(e)}getRegisteredFunctionIds(){return Array.from(this.functions.keys())}categorizeFunction(e,t){t.isVolatile&&this.volatileFunctions.add(e),t.arrayFunction&&this.arrayFunctions.add(e),t.doesNotNeedArgumentsToBeComputed&&this.functionsWhichDoesNotNeedArgumentsToBeComputed.add(e),t.isDependentOnSheetStructureChange&&this.structuralChangeFunctions.add(e),this.functionsMetadata.set(e,t)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- var js;ks.plugins=new Map,ks._protectedPlugins=new Map([["VERSION",Ls],["OFFSET",void 0]]),function(e){e["GREATER_THAN"]="GREATER_THAN",e["GREATER_THAN_OR_EQUAL"]="GREATER_THAN_OR_EQUAL",e["LESS_THAN"]="LESS_THAN",e["LESS_THAN_OR_EQUAL"]="LESS_THAN_OR_EQUAL",e["NOT_EQUAL"]="NOT_EQUAL",e["EQUAL"]="EQUAL"}(js||(js={}));const Hs=(e,t)=>({operator:e,value:t});class Ds{constructor(e){var t,n,r,i;this.trueString=null!==(n=null===(t=e.translationPackage.getMaybeFunctionTranslation("TRUE"))||void 0===t?void 0:t.toLowerCase())&&void 0!==n?n:"true",this.falseString=null!==(i=null===(r=e.translationPackage.getMaybeFunctionTranslation("FALSE"))||void 0===r?void 0:r.toLowerCase())&&void 0!==i?i:"false"}fromCellValue(e,t){if("string"!==typeof e&&"boolean"!==typeof e&&"number"!==typeof e)return;const n=this.parseCriterion(e,t);return void 0!==n?{raw:e,lambda:Vs(n,t)}:void 0}parseCriterion(e,t){if("number"===typeof e||"boolean"===typeof e)return Hs(js.EQUAL,e);if("string"===typeof e){const n=Fs.exec(e);let r,i;n?(i=Us(n[1]),r=n[2]):(i=js.EQUAL,r=e);const o=t.coerceToMaybeNumber(r),s=r.toLowerCase()===this.trueString||r.toLowerCase()!==this.falseString&&void 0;if(void 0===i)return;if(""===r)return Hs(i,null);if(void 0!==o)return Hs(i,Ct(o));if(i===js.EQUAL||i===js.NOT_EQUAL)return Hs(i,null!==s&&void 0!==s?s:r)}}}const Fs=/([<>=]+)(.*)/;function Us(e){switch(e){case">":return js.GREATER_THAN;case">=":return js.GREATER_THAN_OR_EQUAL;case"<":return js.LESS_THAN;case"<=":return js.LESS_THAN_OR_EQUAL;case"<>":return js.NOT_EQUAL;case"=":return js.EQUAL;default:return}}const Vs=(e,t)=>{switch(e.operator){case js.GREATER_THAN:return"number"===typeof e.value?n=>"number"===typeof n&&t.floatCmp(n,e.value)>0:e=>!1;case js.GREATER_THAN_OR_EQUAL:return"number"===typeof e.value?n=>"number"===typeof n&&t.floatCmp(n,e.value)>=0:e=>!1;case js.LESS_THAN:return"number"===typeof e.value?n=>"number"===typeof n&&t.floatCmp(n,e.value)<0:e=>!1;case js.LESS_THAN_OR_EQUAL:return"number"===typeof e.value?n=>"number"===typeof n&&t.floatCmp(n,e.value)<=0:e=>!1;case js.EQUAL:return"number"===typeof e.value?n=>{if("number"===typeof n)return 0===t.floatCmp(n,e.value);if("string"===typeof n){if(""===n)return!1;const r=t.coerceToMaybeNumber(n);return void 0!==r&&0===t.floatCmp(r,e.value)}return!1}:"string"===typeof e.value?t.eqMatcherFunction(e.value):"boolean"===typeof e.value?t=>"boolean"===typeof t&&t===e.value:e=>e===Et;case js.NOT_EQUAL:return"number"===typeof e.value?n=>{if("number"===typeof n)return 0!==t.floatCmp(n,e.value);if("string"===typeof n){if(""===n)return!0;const r=t.coerceToMaybeNumber(n);return void 0===r||0!==t.floatCmp(r,e.value)}return!0}:"string"===typeof e.value?t.neqMatcherFunction(e.value):"boolean"===typeof e.value?t=>"boolean"!==typeof t||t!==e.value:e=>e!==Et}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Bs{constructor(e,t,n,r,i,o,s,a,l,c){this.config=e,this.dependencyGraph=t,this.columnSearch=n,this.stats=r,this.arithmeticHelper=i,this.functionRegistry=o,this.namedExpressions=s,this.serialization=a,this.arraySizePredictor=l,this.dateTimeHelper=c,this.equalOp=(e,t)=>Gs(this.arithmeticHelper.eq,e,t),this.notEqualOp=(e,t)=>Gs(this.arithmeticHelper.neq,e,t),this.greaterThanOp=(e,t)=>Gs(this.arithmeticHelper.gt,e,t),this.lessThanOp=(e,t)=>Gs(this.arithmeticHelper.lt,e,t),this.greaterThanOrEqualOp=(e,t)=>Gs(this.arithmeticHelper.geq,e,t),this.lessThanOrEqualOp=(e,t)=>Gs(this.arithmeticHelper.leq,e,t),this.concatOp=(e,t)=>Gs(this.arithmeticHelper.concat,jr(e),jr(t)),this.plusOp=(e,t)=>Gs(this.arithmeticHelper.addWithEpsilon,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.minusOp=(e,t)=>Gs(this.arithmeticHelper.subtract,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.timesOp=(e,t)=>Gs(this.arithmeticHelper.multiply,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.powerOp=(e,t)=>Gs(this.arithmeticHelper.pow,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.divOp=(e,t)=>Gs(this.arithmeticHelper.divide,this.arithmeticHelper.coerceScalarToNumberOrError(e),this.arithmeticHelper.coerceScalarToNumberOrError(t)),this.unaryMinusOp=e=>Ws(this.arithmeticHelper.unaryMinus,this.arithmeticHelper.coerceScalarToNumberOrError(e)),this.percentOp=e=>Ws(this.arithmeticHelper.unaryPercent,this.arithmeticHelper.coerceScalarToNumberOrError(e)),this.unaryPlusOp=e=>this.arithmeticHelper.unaryPlus(e),this.functionRegistry.initializePlugins(this),this.criterionBuilder=new Ds(e)}evaluateAst(e,t){let n=this.evaluateAstWithoutPostprocessing(e,t);if(Mt(n)){if(Fr(Ct(n)))return new lr(Bn.NUM,Ne.NaN);n=Rt(n,Ur(Ct(n)))}return n instanceof jt&&1===n.height()&&1===n.width()&&([[n]]=n.data),zs(n,t.formulaVertex)}evaluateAstWithoutPostprocessing(e,t){switch(e.type){case G.EMPTY:return Et;case G.CELL_REFERENCE:{const n=e.reference.toSimpleCellAddress(t.formulaAddress);return fr(n)?new lr(Bn.REF,Ne.BadRef):this.dependencyGraph.getCellValue(n)}case G.NUMBER:case G.STRING:return e.value;case G.CONCATENATE_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.concatOp,n,r,t)}case G.EQUALS_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.equalOp,n,r,t)}case G.NOT_EQUAL_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.notEqualOp,n,r,t)}case G.GREATER_THAN_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.greaterThanOp,n,r,t)}case G.LESS_THAN_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.lessThanOp,n,r,t)}case G.GREATER_THAN_OR_EQUAL_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.greaterThanOrEqualOp,n,r,t)}case G.LESS_THAN_OR_EQUAL_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.lessThanOrEqualOp,n,r,t)}case G.PLUS_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.plusOp,n,r,t)}case G.MINUS_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.minusOp,n,r,t)}case G.TIMES_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.timesOp,n,r,t)}case G.POWER_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.powerOp,n,r,t)}case G.DIV_OP:{const n=this.evaluateAst(e.left,t),r=this.evaluateAst(e.right,t);return this.binaryRangeWrapper(this.divOp,n,r,t)}case G.PLUS_UNARY_OP:{const n=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.unaryPlusOp,n,t)}case G.MINUS_UNARY_OP:{const n=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.unaryMinusOp,n,t)}case G.PERCENT_OP:{const n=this.evaluateAst(e.value,t);return this.unaryRangeWrapper(this.percentOp,n,t)}case G.FUNCTION_CALL:{if("valid"!==this.config.licenseKeyValidityState&&!ks.functionIsProtected(e.procedureName))return new lr(Bn.LIC,Ne.LicenseKey(this.config.licenseKeyValidityState));const n=this.functionRegistry.getFunction(e.procedureName);return void 0!==n?n(e,new Or(t.formulaAddress,t.arraysFlag||this.functionRegistry.isArrayFunction(e.procedureName),t.formulaVertex)):new lr(Bn.NAME,Ne.FunctionName(e.procedureName))}case G.NAMED_EXPRESSION:{const n=this.namedExpressions.nearestNamedExpression(e.expressionName,t.formulaAddress.sheet);return n?this.dependencyGraph.getCellValue(n.address):new lr(Bn.NAME,Ne.NamedExpressionName(e.expressionName))}case G.CELL_RANGE:{if(!this.rangeSpansOneSheet(e))return new lr(Bn.REF,Ne.RangeManySheets);const n=Sr.fromCellRange(e,t.formulaAddress),r=this.dependencyGraph.getArray(n);if(r){const e=r.array;if(e instanceof Sn)throw new Error("Array should be already computed");if(e instanceof lr)return e;if(e instanceof Rn)return jt.fromRange(e.raw(),n,this.dependencyGraph);throw new Error("Unknown array")}return jt.onlyRange(n,this.dependencyGraph)}case G.COLUMN_RANGE:{if(!this.rangeSpansOneSheet(e))return new lr(Bn.REF,Ne.RangeManySheets);const n=Rr.fromColumnRange(e,t.formulaAddress);return jt.onlyRange(n,this.dependencyGraph)}case G.ROW_RANGE:{if(!this.rangeSpansOneSheet(e))return new lr(Bn.REF,Ne.RangeManySheets);const n=Tr.fromRowRangeAst(e,t.formulaAddress);return jt.onlyRange(n,this.dependencyGraph)}case G.PARENTHESIS:return this.evaluateAst(e.expression,t);case G.ARRAY:{let n=void 0;const r=[];for(const i of e.args){let e=void 0;const o=[];for(const n of i){const r=_r(this.evaluateAst(n,t)),i=r.height();if(void 0===e)e=i,o.push(...r.data);else{if(e!==i)return new lr(Bn.REF,Ne.SizeMismatch);for(let e=0;e<i;e++)o[e].push(...r.data[e])}}const s=o[0].length;if(void 0===n)n=s,r.push(...o);else{if(n!==s)return new lr(Bn.REF,Ne.SizeMismatch);r.push(...o)}}return jt.onlyValues(r)}case G.ERROR_WITH_RAW_INPUT:case G.ERROR:return e.error}}rangeSpansOneSheet(e){return e.start.sheet===e.end.sheet}unaryRangeWrapper(e,t,n){var r;if(t instanceof jt&&!n.arraysFlag&&(t=null!==(r=qr(t,n))&&void 0!==r?r:new lr(Bn.VALUE,Ne.ScalarExpected)),t instanceof lr)return t;if(t instanceof jt){const n=t.data.map(t=>t.map(e));return jt.onlyValues(n)}return e(t)}binaryRangeWrapper(e,t,n,r){var i,o;if(t instanceof jt&&!r.arraysFlag&&(t=null!==(i=qr(t,r))&&void 0!==i?i:new lr(Bn.VALUE,Ne.ScalarExpected)),t instanceof lr)return t;if(n instanceof jt&&!r.arraysFlag&&(n=null!==(o=qr(n,r))&&void 0!==o?o:new lr(Bn.VALUE,Ne.ScalarExpected)),n instanceof lr)return n;if(t instanceof jt||n instanceof jt){if(!(t instanceof jt)){if(n.isAdHoc()){const r=n.data;for(let n=0;n<r.length;n++)for(let i=0;i<r[0].length;i++)r[n][i]=e(t,r[n][i]);return jt.onlyValues(r)}t=jt.fromScalar(t)}if(!(n instanceof jt)){if(t.isAdHoc()){const r=t.data;for(let t=0;t<r.length;t++)for(let i=0;i<r[0].length;i++)r[t][i]=e(r[t][i],n);return jt.onlyValues(r)}n=jt.fromScalar(n)}if(t.width()===n.width()&&t.height()===n.height()){if(t.isAdHoc()){const r=t.data,i=n.data;for(let t=0;t<r.length;t++)for(let n=0;n<r[0].length;n++)r[t][n]=e(r[t][n],i[t][n]);return jt.onlyValues(r)}if(n.isAdHoc()){const r=t.data,i=n.data;for(let t=0;t<r.length;t++)for(let n=0;n<r[0].length;n++)i[t][n]=e(r[t][n],i[t][n]);return jt.onlyValues(i)}}const r=Math.max(t.width(),n.width()),i=Math.max(t.height(),n.height()),o=Array(i);for(let e=0;e<i;e++)o[e]=Array(r);for(let s=0;s<i;s++){const i=1!==t.height()?s:0,a=1!==n.height()?s:0;for(let l=0;l<r;l++){const r=1!==t.width()?l:0,c=1!==n.width()?l:0;i<t.height()&&a<n.height()&&r<t.width()&&c<n.width()?o[s][l]=e(t.data[i][r],n.data[a][c]):o[s][l]=new lr(Bn.NA)}}return jt.onlyValues(o)}return e(t,n)}}function Ws(e,t){return t instanceof lr?t:e(t)}function Gs(e,t,n){return t instanceof lr?t:n instanceof lr?n:e(t,n)}function zs(e,t){return e instanceof lr&&void 0!==t?e.attachRootVertex(t):e}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Ys{constructor(e){this.sheet=e,this.transformations=[]}add(e){this.transformations.push(e)}performEagerTransformations(e,t){this.transformations.forEach(n=>n.performEagerTransformations(e,t))}transformSingleAst(e,t){let[n,r]=[e,t];return this.transformations.forEach(e=>{[n,r]=e.transformSingleAst(n,r)}),[n,r]}isIrreversible(){return!0}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Xs{constructor(e){this.stats=e,this.transformations=[]}version(){return this.transformations.length}addTransformation(e){return void 0!==this.combinedTransformer?this.combinedTransformer.add(e):this.transformations.push(e),this.version()}beginCombinedMode(e){this.combinedTransformer=new Ys(e)}commitCombinedMode(){if(void 0===this.combinedTransformer)throw Error("Combined mode wasn't started");return this.transformations.push(this.combinedTransformer),this.combinedTransformer=void 0,this.version()}applyTransformations(e,t,n){this.stats.start(_t.TRANSFORM_ASTS_POSTPONED);for(let i=n;i<this.transformations.length;i++){const n=this.transformations[i];n.isIrreversible()&&(this.undoRedo.storeDataForVersion(i,t,this.parser.computeHashFromAst(e)),this.parser.rememberNewAst(e));const[r,o]=n.transformSingleAst(e,t);e=r,t=o}const r=this.parser.rememberNewAst(e);return this.stats.end(_t.TRANSFORM_ASTS_POSTPONED),[r,t,this.transformations.length]}*getTransformationsFrom(e,t){for(let n=e;n<this.transformations.length;n++){const e=this.transformations[n];t&&!t(e)||(yield e)}}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */const Ks=-1;function $s(e,t,{searchCoordinate:n,orderingDirection:r,matchExactly:i},o){const s=t.start[n],a="col"===n?t.effectiveEndColumn(o):t.effectiveEndRow(o),l="col"===n?e=>Ct(o.getCellValue(pr(t.sheet,e,t.start.row))):e=>Ct(o.getCellValue(pr(t.sheet,t.start.col,e))),c="asc"===r?(e,t)=>Qs(e,t):(e,t)=>-Qs(e,t),h=qs(t=>c(e,l(t))>=0,s,a),u=l(h);return h===Ks||typeof u!==typeof e||i&&u!==e?Ks:h-s}function qs(e,t,n){let r=t,i=n;while(r<i){const t=Math.ceil((r+i)/2);e(t)?r=t:i=t-1}return r===i&&e(r)?r:Ks}function Qs(e,t){return typeof e===typeof t?e===Et?0:e<t?-1:e>t?1:0:e===Et?-1:t===Et?1:t instanceof lr||"number"===typeof e&&"string"===typeof t||"number"===typeof e&&"boolean"===typeof t?-1:"string"===typeof e&&"number"===typeof t?1:"string"===typeof e&&"boolean"===typeof t?-1:1}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Zs{constructor(e){this.dependencyGraph=e}advancedFind(e,t){let n;const r=t.range;n=void 0===r?t.valuesFromTopLeftCorner():this.dependencyGraph.computeListOfValuesInRange(r);for(let i=0;i<n.length;i++)if(e(Ct(n[i])))return i;return-1}basicFind(e,t,n,{ordering:r,matchExactly:i}){const o="string"===typeof e?$r(e):e,s=t.range;return void 0===s?this.findNormalizedValue(o,t.valuesFromTopLeftCorner()):"none"===r?this.findNormalizedValue(o,this.dependencyGraph.computeListOfValuesInRange(s)):$s(o,s,{searchCoordinate:n,orderingDirection:r,matchExactly:i},this.dependencyGraph)}findNormalizedValue(e,t){return t.map(Ct).map(e=>"string"===typeof e?$r(e):e).indexOf(e)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Js extends Zs{constructor(e){super(e),this.dependencyGraph=e}add(e,t){}remove(e,t){}change(e,t,n){}applyChanges(e){}addColumns(e){}removeColumns(e){}removeSheet(e){}moveValues(e,t,n,r){}removeValues(e){}find(e,t,n){return this.basicFind(e,t,"row",n)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class ea{constructor(e,t,n){this.dependencyGraph=e,this.config=t,this.stats=n,this.index=new Map,this.transformingService=this.dependencyGraph.lazilyTransformingAstService,this.binarySearchStrategy=new Js(e)}add(e,t){if(!(e===Et||e instanceof lr))if(e instanceof jt)for(const[n,r]of e.entriesFromTopLeftCorner(t))this.addSingleCellValue(Ct(n),r);else this.addSingleCellValue(e,t)}remove(e,t){if(void 0!==e)if(e instanceof jt)for(const[n,r]of e.entriesFromTopLeftCorner(t))this.removeSingleValue(Ct(n),r);else this.removeSingleValue(e,t)}change(e,t,n){e!==t&&(this.remove(e,n),this.add(t,n))}applyChanges(e){for(const t of e)void 0!==t.oldValue&&this.change(Ct(t.oldValue),Ct(t.value),t.address)}moveValues(e,t,n,r){for(const[i,o]of e){const e=gr(o,r,t,n);this.remove(i,o),this.add(i,e)}}removeValues(e){for(const[t,n]of e)this.remove(t,n)}find(e,t,{ordering:n,matchExactly:r}){const i=!0===r?"findFirst":"findLast",o=this.findUsingColumnIndex(e,t,i);return void 0!==o?o:this.binarySearchStrategy.find(e,t,{ordering:n,matchExactly:r})}findUsingColumnIndex(e,t,n){const r=t.range;if(void 0===r)return;this.ensureRecentData(r.sheet,r.start.col,e);const i=this.getColumnMap(r.sheet,r.start.col);if(!i)return-1;const o="string"===typeof e?$r(e):e,s=i.get(o);if(!s||!s.index||0===s.index.length)return;const a=ea.findRowBelongingToRange(s,r,n);return void 0!==a?a-r.start.row:void 0}static findRowBelongingToRange(e,t,n){const r=t.start.row,i=t.end.row,o="findFirst"===n?ta(r,e.index,"upperBound"):ta(i,e.index,"lowerBound");if(-1===o)return;const s=e.index[o],a=s>=r&&s<=i;return a?s:void 0}advancedFind(e,t){return this.binarySearchStrategy.advancedFind(e,t)}addColumns(e){const t=this.index.get(e.sheet);t&&t.splice(e.columnStart,0,...Array(e.numberOfColumns))}removeColumns(e){const t=this.index.get(e.sheet);t&&t.splice(e.columnStart,e.numberOfColumns)}removeSheet(e){this.index.delete(e)}getColumnMap(e,t){this.index.has(e)||this.index.set(e,[]);const n=this.index.get(e);let r=n[t];return r||(r=new Map,n[t]=r),r}getValueIndex(e,t,n){const r=this.getColumnMap(e,t);let i=this.getColumnMap(e,t).get(n);return i||(i={version:this.transformingService.version(),index:[]},r.set(n,i)),i}ensureRecentData(e,t,n){const r=this.getValueIndex(e,t,n),i=this.transformingService.version();if(r.version===i)return;const o=this.transformingService.getTransformationsFrom(r.version,t=>t.sheet===e&&(t instanceof Ho||t instanceof Bo));for(const s of o)s instanceof Ho?this.addRows(t,s.rowsSpan,n):s instanceof Bo&&this.removeRows(t,s.rowsSpan,n);r.version=i}addSingleCellValue(e,t){this.stats.measure(_t.BUILD_COLUMN_INDEX,()=>{this.ensureRecentData(t.sheet,t.col,e),"string"===typeof e&&(e=$r(e));const n=this.getValueIndex(t.sheet,t.col,e);ea.addValue(n,t.row)})}removeSingleValue(e,t){this.stats.measure(_t.BUILD_COLUMN_INDEX,()=>{this.ensureRecentData(t.sheet,t.col,e);const n=this.getColumnMap(t.sheet,t.col);"string"===typeof e&&(e=$r(e));const r=n.get(e);if(!r)return;const i=ta(t.row,r.index);i>-1&&r.index.splice(i,1),0===r.index.length&&n.delete(e),0===n.size&&delete this.index.get(t.sheet)[t.col]})}addRows(e,t,n){const r=this.getValueIndex(t.sheet,e,n);ea.shiftRows(r,t.rowStart,t.numberOfRows)}removeRows(e,t,n){const r=this.getValueIndex(t.sheet,e,n);ea.removeRowsFromValues(r,t),ea.shiftRows(r,t.rowEnd+1,-t.numberOfRows)}static addValue(e,t){const n=ta(t,e.index,"lowerBound"),r=e.index[n]===t;r||e.index.splice(n+1,0,t)}static removeRowsFromValues(e,t){const n=ta(t.rowStart,e.index,"upperBound"),r=ta(t.rowEnd,e.index,"lowerBound"),i=n>-1&&r>-1&&n<=r&&e.index[n]<=t.rowEnd;i&&e.index.splice(n,r-n+1)}static shiftRows(e,t,n){const r=ta(t,e.index,"upperBound");if(-1!==r)for(let i=r;i<e.index.length;++i)e.index[i]+=n}}function ta(e,t,n="upperBound"){let r=0,i=t.length-1;while(r<=i){const n=Math.floor((r+i)/2);if(e>t[n])r=n+1;else{if(!(e<t[n]))return n;i=n-1}}const o="lowerBound"===n?i:r,s=o>=0&&o<=t.length;return s?o:-1}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */function na(e,t,n){return t.useColumnIndex?new ea(e,t,n):new Js(e)}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class ra{constructor(e){this.config=e;const t="."===this.config.thousandSeparator?"\\"+this.config.thousandSeparator:this.config.thousandSeparator,n="."===this.config.decimalSeparator?"\\"+this.config.decimalSeparator:this.config.decimalSeparator;this.numberPattern=new RegExp(`^([+-]?((${n}\\d+)|(\\d+(${t}\\d{3,})*(${n}\\d*)?)))(e[+-]?\\d+)?$`),this.allThousandSeparatorsRegex=new RegExp(""+t,"g")}numericStringToMaybeNumber(e){if(this.numberPattern.test(e)){const t=this.numericStringToNumber(e);if(isNaN(t))return;return t}}numericStringToNumber(e){const t=e.replace(this.allThousandSeparatorsRegex,"").replace(this.config.decimalSeparator,".");return Number(t)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class ia{constructor(e,t,n){this.dependencyGraph=e,this.unparser=t,this.exporter=n}getCellHyperlink(e){const t=this.dependencyGraph.getCell(e);if(t instanceof An){const e=t.getFormula(this.dependencyGraph.lazilyTransformingAstService);if("HYPERLINK"===e.procedureName)return e.hyperlink}}getCellFormula(e,t){const n=this.dependencyGraph.getCell(e);if(n instanceof An){const r=n.getFormula(this.dependencyGraph.lazilyTransformingAstService);return t=null!==t&&void 0!==t?t:e,this.unparser.unparse(r,t)}if(n instanceof Nn){const r=n.getAddress(this.dependencyGraph.lazilyTransformingAstService);if(r.row!==e.row||r.col!==e.col||r.sheet!==e.sheet)return;t=null!==t&&void 0!==t?t:e;const i=n.getFormula(this.dependencyGraph.lazilyTransformingAstService);if(void 0!==i)return this.unparser.unparse(i,t)}else if(n instanceof qn)return n.getFormula()}getCellSerialized(e,t){var n;return null!==(n=this.getCellFormula(e,t))&&void 0!==n?n:this.getRawValue(e)}getCellValue(e){return this.exporter.exportValue(this.dependencyGraph.getScalarValue(e))}getRawValue(e){return this.dependencyGraph.getRawValue(e)}getSheetValues(e){return this.genericSheetGetter(e,e=>this.getCellValue(e))}getSheetFormulas(e){return this.genericSheetGetter(e,e=>this.getCellFormula(e))}genericSheetGetter(e,t){const n=this.dependencyGraph.getSheetHeight(e),r=this.dependencyGraph.getSheetWidth(e),i=new Array(n);for(let o=0;o<n;o++){i[o]=new Array(r);for(let n=0;n<r;n++){const r=pr(e,n,o);i[o][n]=t(r)}for(let e=r-1;e>=0;e--){if(null!==i[o][e]&&void 0!==i[o][e])break;i[o].pop()}}for(let o=n-1;o>=0;o--){if(0!==i[o].length)break;i.pop()}return i}genericAllSheetsGetter(e){const t={};for(const n of this.dependencyGraph.sheetMapping.displayNames()){const r=this.dependencyGraph.sheetMapping.fetch(n);t[n]=e(r)}return t}getSheetSerialized(e){return this.genericSheetGetter(e,e=>this.getCellSerialized(e))}getAllSheetsValues(){return this.genericAllSheetsGetter(e=>this.getSheetValues(e))}getAllSheetsFormulas(){return this.genericAllSheetsGetter(e=>this.getSheetFormulas(e))}getAllSheetsSerialized(){return this.genericAllSheetsGetter(e=>this.getSheetSerialized(e))}getAllNamedExpressionsSerialized(){const e=[];let t=0;for(const n of this.dependencyGraph.sheetMapping.displayNames()){const r=this.dependencyGraph.sheetMapping.fetch(n);e[r]=t,t++}return this.dependencyGraph.namedExpressions.getAllNamedExpressions().map(t=>({name:t.expression.displayName,expression:this.getCellSerialized(t.expression.address),scope:void 0!==t.scope?e[t.scope]:void 0,options:t.expression.options}))}withNewConfig(e,t){const n=new ct(e,st(e),this.dependencyGraph.sheetMapping.fetchDisplayName,t);return new ia(this.dependencyGraph,n,this.exporter)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class oa{static buildFromSheets(e,t={},n=[]){const r=new pa(t);return this.buildEngine(r,e,n)}static buildFromSheet(e,t={},n=[]){const r=new pa(t),i=r.translationPackage.getUITranslation(Vn.NEW_SHEET_PREFIX)+"1";return this.buildEngine(r,{[i]:e},n)}static buildEmpty(e={},t=[]){return this.buildEngine(new pa(e),{},t)}static rebuildWithConfig(e,t,n,r){return this.buildEngine(e,t,n,r)}static buildEngine(e,t={},n=[],r=(e.useStats?new Ut:new Vt)){r.start(_t.BUILD_ENGINE_TOTAL);const i=new Lo,o=new ks(e),s=new Xs(r),a=Xn.buildEmpty(s,e,o,i,r),l=na(a,e,r),c=a.sheetMapping,h=a.addressMapping;for(const O in t)if(Object.prototype.hasOwnProperty.call(t,O)){const n=t[O];Go(n);const r=zo(n);if(r.height>e.maxRows||r.width>e.maxColumns)throw new zt;const i=c.addSheet(O);h.autoAddSheet(i,r)}const u=new ut(e,o,c.get);s.parser=u;const d=new ct(e,st(e),c.fetchDisplayName,i),p=new Pi(e),f=new ra(e),g=new Mr(e,p,f),m=new No(e,p,f),y=new ri(e,o),w=new qo(e,a,l,m,u,r,s,i,y),b=new Cs(e,w);s.undoRedo=b;const v=new Io(e,a,w),E=new Ss(e,w,b,v,a,l,u,m,s,i);n.forEach(e=>{E.ensureItIsPossibleToAddNamedExpression(e.name,e.expression,e.scope),E.operations.addNamedExpression(e.name,e.expression,e.scope,e.options)});const C=new Is(e,i,c.fetchDisplayName,s),S=new ia(a,d,C),R=new Bs(e,a,l,r,g,o,i,S,y,p);r.measure(_t.GRAPH_BUILD,()=>{const e=new Ms(a,l,u,m,r,y);e.buildGraph(t,r)});const T=new Os(e,r,R,s,a,l);return T.run(),r.end(_t.BUILD_ENGINE_TOTAL),{config:e,stats:r,dependencyGraph:a,columnSearch:l,parser:u,unparser:d,cellContentParser:m,evaluator:T,lazilyTransformingAstService:s,crudOperations:E,exporter:C,namedExpressions:i,serialization:S,functionRegistry:o}}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */function sa(e){for(const[t,n]of Object.entries(e))n instanceof Function?e[t]=aa(n):delete e[t]}function aa(e){return()=>{throw new Error(`The "${e}" method cannot be called because this HyperFormula instance has been destroyed`)}}var la,ca=n("c0e2");
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */(function(e){e["SheetAdded"]="sheetAdded",e["SheetRemoved"]="sheetRemoved",e["SheetRenamed"]="sheetRenamed",e["NamedExpressionAdded"]="namedExpressionAdded",e["NamedExpressionRemoved"]="namedExpressionRemoved",e["ValuesUpdated"]="valuesUpdated",e["EvaluationSuspended"]="evaluationSuspended",e["EvaluationResumed"]="evaluationResumed"})(la||(la={}));class ha extends ca["TinyEmitter"]{emit(e,...t){return super.emit(e,...t),this}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class ua{constructor(e,t,n,r,i,o,s,a,l,c,h,u,d,p){this._config=e,this._stats=t,this._dependencyGraph=n,this._columnSearch=r,this._parser=i,this._unparser=o,this._cellContentParser=s,this._evaluator=a,this._lazilyTransformingAstService=l,this._crudOperations=c,this._exporter=h,this._namedExpressions=u,this._serialization=d,this._functionRegistry=p,this._emitter=new ha,this._evaluationSuspended=!1}static get defaultConfig(){return ga()}get graph(){return this.dependencyGraph.graph}get rangeMapping(){return this.dependencyGraph.rangeMapping}get arrayMapping(){return this.dependencyGraph.arrayMapping}get sheetMapping(){return this.dependencyGraph.sheetMapping}get addressMapping(){return this.dependencyGraph.addressMapping}get dependencyGraph(){return this._dependencyGraph}get evaluator(){return this._evaluator}get columnSearch(){return this._columnSearch}get lazilyTransformingAstService(){return this._lazilyTransformingAstService}get licenseKeyValidityState(){return this._config.licenseKeyValidityState}static buildFromArray(e,t={},n=[]){return this.buildFromEngineState(oa.buildFromSheet(e,t,n))}static buildFromSheets(e,t={},n=[]){return this.buildFromEngineState(oa.buildFromSheets(e,t,n))}static buildEmpty(e={},t=[]){return this.buildFromEngineState(oa.buildEmpty(e,t))}static getLanguage(e){hi(e,"string","languageCode");const t=this.registeredLanguages.get(e);if(void 0===t)throw new pn;return t}static registerLanguage(e,t){if(hi(e,"string","languageCode"),this.registeredLanguages.has(e))throw new fn;this.registeredLanguages.set(e,Un(t))}static unregisterLanguage(e){if(hi(e,"string","languageCode"),!this.registeredLanguages.has(e))throw new pn;this.registeredLanguages.delete(e)}static getRegisteredLanguagesCodes(){return Array.from(this.registeredLanguages.keys())}static registerFunctionPlugin(e,t){ks.registerFunctionPlugin(e,t)}static unregisterFunctionPlugin(e){ks.unregisterFunctionPlugin(e)}static registerFunction(e,t,n){hi(e,"string","functionId"),ks.registerFunction(e,t,n)}static unregisterFunction(e){hi(e,"string","functionId"),ks.unregisterFunction(e)}static unregisterAllFunctions(){ks.unregisterAll()}static getRegisteredFunctionNames(e){hi(e,"string","code");const t=ks.getRegisteredFunctionIds(),n=this.getLanguage(e);return n.getFunctionTranslations(t)}static getFunctionPlugin(e){return hi(e,"string","functionId"),ks.getFunctionPlugin(e)}static getAllFunctionPlugins(){return ks.getPlugins()}static buildFromEngineState(e){return new ua(e.config,e.stats,e.dependencyGraph,e.columnSearch,e.parser,e.unparser,e.cellContentParser,e.evaluator,e.lazilyTransformingAstService,e.crudOperations,e.exporter,e.namedExpressions,e.serialization,e.functionRegistry)}getCellValue(e){if(!yr(e))throw new on("SimpleCellAddress","cellAddress");return this.ensureEvaluationIsNotSuspended(),this._serialization.getCellValue(e)}getCellFormula(e){if(!yr(e))throw new on("SimpleCellAddress","cellAddress");return this._serialization.getCellFormula(e)}getCellHyperlink(e){if(!yr(e))throw new on("SimpleCellAddress","cellAddress");return this.ensureEvaluationIsNotSuspended(),this._serialization.getCellHyperlink(e)}getCellSerialized(e){if(!yr(e))throw new on("SimpleCellAddress","cellAddress");return this.ensureEvaluationIsNotSuspended(),this._serialization.getCellSerialized(e)}getSheetValues(e){return hi(e,"number","sheetId"),this.ensureEvaluationIsNotSuspended(),this._serialization.getSheetValues(e)}getSheetFormulas(e){return hi(e,"number","sheetId"),this._serialization.getSheetFormulas(e)}getSheetSerialized(e){return hi(e,"number","sheetId"),this.ensureEvaluationIsNotSuspended(),this._serialization.getSheetSerialized(e)}getAllSheetsDimensions(){return this._serialization.genericAllSheetsGetter(e=>this.getSheetDimensions(e))}getSheetDimensions(e){return hi(e,"number","sheetId"),{width:this.dependencyGraph.getSheetWidth(e),height:this.dependencyGraph.getSheetHeight(e)}}getAllSheetsValues(){return this.ensureEvaluationIsNotSuspended(),this._serialization.getAllSheetsValues()}getAllSheetsFormulas(){return this._serialization.getAllSheetsFormulas()}getAllSheetsSerialized(){return this.ensureEvaluationIsNotSuspended(),this._serialization.getAllSheetsSerialized()}updateConfig(e){const t=Object.entries(e).every(([e,t])=>this._config[e]===t);t||this.rebuildWithConfig(e)}getConfig(){return this._config.getConfig()}rebuildAndRecalculate(){this.rebuildWithConfig({})}getStats(){return this._stats.snapshot()}undo(){return this._crudOperations.undo(),this.recomputeIfDependencyGraphNeedsIt()}redo(){return this._crudOperations.redo(),this.recomputeIfDependencyGraphNeedsIt()}isThereSomethingToUndo(){return this._crudOperations.isThereSomethingToUndo()}isThereSomethingToRedo(){return this._crudOperations.isThereSomethingToRedo()}isItPossibleToSetCellContents(e){let t;if(yr(e))t=new Sr(e,e);else{if(!Er(e))throw new on("SimpleCellAddress | SimpleCellRange","address");t=new Sr(e.start,e.end)}try{this._crudOperations.ensureRangeInSizeLimits(t);for(const e of t.addresses(this._dependencyGraph))this._crudOperations.ensureItIsPossibleToChangeContent(e)}catch(n){return!1}return!0}setCellContents(e,t){return this._crudOperations.setCellContents(e,t),this.recomputeIfDependencyGraphNeedsIt()}swapRowIndexes(e,t){return hi(e,"number","sheetId"),this._crudOperations.setRowOrder(e,t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToSwapRowIndexes(e,t){hi(e,"number","sheetId");try{return this._crudOperations.validateSwapRowIndexes(e,t),this._crudOperations.testRowOrderForArrays(e,t),!0}catch(n){return!1}}setRowOrder(e,t){hi(e,"number","sheetId");const n=this._crudOperations.mappingFromOrder(e,t,"row");return this.swapRowIndexes(e,n)}isItPossibleToSetRowOrder(e,t){hi(e,"number","sheetId");try{const n=this._crudOperations.mappingFromOrder(e,t,"row");return this._crudOperations.validateSwapRowIndexes(e,n),this._crudOperations.testRowOrderForArrays(e,n),!0}catch(n){return!1}}swapColumnIndexes(e,t){return hi(e,"number","sheetId"),this._crudOperations.setColumnOrder(e,t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToSwapColumnIndexes(e,t){hi(e,"number","sheetId");try{return this._crudOperations.validateSwapColumnIndexes(e,t),this._crudOperations.testColumnOrderForArrays(e,t),!0}catch(n){return!1}}setColumnOrder(e,t){hi(e,"number","sheetId");const n=this._crudOperations.mappingFromOrder(e,t,"column");return this.swapColumnIndexes(e,n)}isItPossibleToSetColumnOrder(e,t){hi(e,"number","sheetId");try{const n=this._crudOperations.mappingFromOrder(e,t,"column");return this._crudOperations.validateSwapColumnIndexes(e,n),this._crudOperations.testColumnOrderForArrays(e,n),!0}catch(n){return!1}}isItPossibleToAddRows(e,...t){hi(e,"number","sheetId");const n=Zo(t);try{return this._crudOperations.ensureItIsPossibleToAddRows(e,...n),!0}catch(r){return!1}}addRows(e,...t){return hi(e,"number","sheetId"),this._crudOperations.addRows(e,...t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToRemoveRows(e,...t){hi(e,"number","sheetId");const n=Qo(t);try{return this._crudOperations.ensureItIsPossibleToRemoveRows(e,...n),!0}catch(r){return!1}}removeRows(e,...t){return hi(e,"number","sheetId"),this._crudOperations.removeRows(e,...t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToAddColumns(e,...t){hi(e,"number","sheetId");const n=Zo(t);try{return this._crudOperations.ensureItIsPossibleToAddColumns(e,...n),!0}catch(r){return!1}}addColumns(e,...t){return hi(e,"number","sheetId"),this._crudOperations.addColumns(e,...t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToRemoveColumns(e,...t){hi(e,"number","sheetId");const n=Qo(t);try{return this._crudOperations.ensureItIsPossibleToRemoveColumns(e,...n),!0}catch(r){return!1}}removeColumns(e,...t){return hi(e,"number","sheetId"),this._crudOperations.removeColumns(e,...t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToMoveCells(e,t){if(!yr(t))throw new on("SimpleCellAddress","destinationLeftCorner");if(!Er(e))throw new on("SimpleCellRange","source");try{const n=new Sr(e.start,e.end);return this._crudOperations.operations.ensureItIsPossibleToMoveCells(n.start,n.width(),n.height(),t),!0}catch(n){return!1}}moveCells(e,t){if(!yr(t))throw new on("SimpleCellAddress","destinationLeftCorner");if(!Er(e))throw new on("SimpleCellRange","source");const n=new Sr(e.start,e.end);return this._crudOperations.moveCells(n.start,n.width(),n.height(),t),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToMoveRows(e,t,n,r){hi(e,"number","sheetId"),hi(t,"number","startRow"),hi(n,"number","numberOfRows"),hi(r,"number","targetRow");try{return this._crudOperations.ensureItIsPossibleToMoveRows(e,t,n,r),!0}catch(i){return!1}}moveRows(e,t,n,r){return hi(e,"number","sheetId"),hi(t,"number","startRow"),hi(n,"number","numberOfRows"),hi(r,"number","targetRow"),this._crudOperations.moveRows(e,t,n,r),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToMoveColumns(e,t,n,r){hi(e,"number","sheetId"),hi(t,"number","startColumn"),hi(n,"number","numberOfColumns"),hi(r,"number","targetColumn");try{return this._crudOperations.ensureItIsPossibleToMoveColumns(e,t,n,r),!0}catch(i){return!1}}moveColumns(e,t,n,r){return hi(e,"number","sheetId"),hi(t,"number","startColumn"),hi(n,"number","numberOfColumns"),hi(r,"number","targetColumn"),this._crudOperations.moveColumns(e,t,n,r),this.recomputeIfDependencyGraphNeedsIt()}copy(e){if(!Er(e))throw new on("SimpleCellRange","source");const t=new Sr(e.start,e.end);return this._crudOperations.copy(t.start,t.width(),t.height()),this.getRangeValues(e)}cut(e){if(!Er(e))throw new on("SimpleCellRange","source");const t=new Sr(e.start,e.end);return this._crudOperations.cut(t.start,t.width(),t.height()),this.getRangeValues(e)}paste(e){if(!yr(e))throw new on("SimpleCellAddress","targetLeftCorner");return this.ensureEvaluationIsNotSuspended(),this._crudOperations.paste(e),this.recomputeIfDependencyGraphNeedsIt()}isClipboardEmpty(){return this._crudOperations.isClipboardEmpty()}clearClipboard(){this._crudOperations.clearClipboard()}clearRedoStack(){this._crudOperations.undoRedo.clearRedoStack()}clearUndoStack(){this._crudOperations.undoRedo.clearUndoStack()}getRangeValues(e){if(!Er(e))throw new on("SimpleCellRange","source");const t=new Sr(e.start,e.end);return t.arrayOfAddressesInRange().map(e=>e.map(e=>this.getCellValue(e)))}getRangeFormulas(e){if(!Er(e))throw new on("SimpleCellRange","source");const t=new Sr(e.start,e.end);return t.arrayOfAddressesInRange().map(e=>e.map(e=>this.getCellFormula(e)))}getRangeSerialized(e){if(!Er(e))throw new on("SimpleCellRange","source");const t=new Sr(e.start,e.end);return t.arrayOfAddressesInRange().map(e=>e.map(e=>this.getCellSerialized(e)))}getFillRangeData(e,t,n=!1){if(!Er(e))throw new on("SimpleCellRange","source");if(!Er(t))throw new on("SimpleCellRange","target");const r=new Sr(e.start,e.end),i=new Sr(t.start,t.end);return this.ensureEvaluationIsNotSuspended(),i.arrayOfAddressesInRange().map(i=>i.map(i=>{const o=((i.row-(n?t:e).start.row)%r.height()+r.height())%r.height()+e.start.row,s=((i.col-(n?t:e).start.col)%r.width()+r.width())%r.width()+e.start.col;return this._serialization.getCellSerialized({row:o,col:s,sheet:r.sheet},i)}))}isItPossibleToAddSheet(e){hi(e,"string","sheetName");try{return this._crudOperations.ensureItIsPossibleToAddSheet(e),!0}catch(t){return!1}}addSheet(e){void 0!==e&&hi(e,"string","sheetName");const t=this._crudOperations.addSheet(e);return this._emitter.emit(la.SheetAdded,t),t}isItPossibleToRemoveSheet(e){hi(e,"number","sheetId");try{return this._crudOperations.ensureScopeIdIsValid(e),!0}catch(t){return!1}}removeSheet(e){hi(e,"number","sheetId");const t=this.sheetMapping.getDisplayName(e);this._crudOperations.removeSheet(e);const n=this.recomputeIfDependencyGraphNeedsIt();return this._emitter.emit(la.SheetRemoved,t,n),n}isItPossibleToClearSheet(e){hi(e,"number","sheetId");try{return this._crudOperations.ensureScopeIdIsValid(e),!0}catch(t){return!1}}clearSheet(e){return hi(e,"number","sheetId"),this._crudOperations.clearSheet(e),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToReplaceSheetContent(e,t){hi(e,"number","sheetId");try{return this._crudOperations.ensureScopeIdIsValid(e),this._crudOperations.ensureItIsPossibleToChangeSheetContents(e,t),!0}catch(n){return!1}}setSheetContent(e,t){return hi(e,"number","sheetId"),this._crudOperations.setSheetContent(e,t),this.recomputeIfDependencyGraphNeedsIt()}simpleCellAddressFromString(e,t){return hi(e,"string","cellAddress"),hi(t,"number","sheetId"),L(this.sheetMapping.get,e,t)}simpleCellRangeFromString(e,t){return hi(e,"string","cellRange"),hi(t,"number","sheetId"),P(this.sheetMapping.get,e,t)}simpleCellAddressToString(e,t){if(!yr(e))throw new on("SimpleCellAddress","cellAddress");return hi(t,"number","sheetId"),k(this.sheetMapping.fetchDisplayName,e,t)}simpleCellRangeToString(e,t){if(!Er(e))throw new on("SimpleCellRange","cellRange");return hi(t,"number","sheetId"),j(this.sheetMapping.fetchDisplayName,e,t)}getCellDependents(e){let t;if(yr(e))t=this._dependencyGraph.addressMapping.getCell(e);else{if(!Er(e))throw new on("SimpleCellAddress | SimpleCellRange",e);t=this._dependencyGraph.rangeMapping.getRange(e.start,e.end)}return void 0===t?[]:this._dependencyGraph.getAdjacentNodesAddresses(t)}getCellPrecedents(e){let t;if(yr(e))t=this._dependencyGraph.addressMapping.getCell(e);else{if(!Er(e))throw new on("SimpleCellAddress | SimpleCellRange",e);t=this._dependencyGraph.rangeMapping.getRange(e.start,e.end)}return void 0===t?[]:this._dependencyGraph.dependencyQueryAddresses(t)}getSheetName(e){return hi(e,"number","sheetId"),this.sheetMapping.getDisplayName(e)}getSheetNames(){return this.sheetMapping.sheetNames()}getSheetId(e){return hi(e,"string","sheetName"),this.sheetMapping.get(e)}doesSheetExist(e){return hi(e,"string","sheetName"),this.sheetMapping.hasSheetWithName(e)}getCellType(e){if(!yr(e))throw new on("SimpleCellAddress","cellAddress");const t=this.dependencyGraph.getCell(e);return Jn(t,e)}doesCellHaveSimpleValue(e){if(!yr(e))throw new on("SimpleCellAddress","cellAddress");return this.getCellType(e)===Wn.VALUE}doesCellHaveFormula(e){if(!yr(e))throw new on("SimpleCellAddress","cellAddress");const t=this.getCellType(e);return t===Wn.FORMULA||t===Wn.ARRAYFORMULA}isCellEmpty(e){if(!yr(e))throw new on("SimpleCellAddress","cellAddress");return this.getCellType(e)===Wn.EMPTY}isCellPartOfArray(e){if(!yr(e))throw new on("SimpleCellAddress","cellAddress");const t=this.getCellType(e);return t===Wn.ARRAY||t===Wn.ARRAYFORMULA}getCellValueType(e){if(!yr(e))throw new on("SimpleCellAddress","cellAddress");this.ensureEvaluationIsNotSuspended();const t=this.dependencyGraph.getCellValue(e);return or(t)}getCellValueDetailedType(e){if(!yr(e))throw new on("SimpleCellAddress","cellAddress");this.ensureEvaluationIsNotSuspended();const t=this.dependencyGraph.getCellValue(e);return sr(t)}getCellValueFormat(e){if(!yr(e))throw new on("SimpleCellAddress","cellAddress");this.ensureEvaluationIsNotSuspended();const t=this.dependencyGraph.getCellValue(e);return ar(t)}countSheets(){return this.sheetMapping.numberOfSheets()}isItPossibleToRenameSheet(e,t){hi(e,"number","sheetId"),hi(t,"string","newName");try{return this._crudOperations.ensureItIsPossibleToRenameSheet(e,t),!0}catch(n){return!1}}renameSheet(e,t){hi(e,"number","sheetId"),hi(t,"string","newName");const n=this._crudOperations.renameSheet(e,t);void 0!==n&&this._emitter.emit(la.SheetRenamed,n,t)}batch(e){this.suspendEvaluation(),this._crudOperations.beginUndoRedoBatchMode();try{e()}catch(t){throw this._crudOperations.commitUndoRedoBatchMode(),this.resumeEvaluation(),t}return this._crudOperations.commitUndoRedoBatchMode(),this.resumeEvaluation()}suspendEvaluation(){this._evaluationSuspended=!0,this._emitter.emit(la.EvaluationSuspended)}resumeEvaluation(){this._evaluationSuspended=!1;const e=this.recomputeIfDependencyGraphNeedsIt();return this._emitter.emit(la.EvaluationResumed,e),e}isEvaluationSuspended(){return this._evaluationSuspended}isItPossibleToAddNamedExpression(e,t,n){hi(e,"string","expressionName"),void 0!==n&&hi(n,"number","scope");try{return this._crudOperations.ensureItIsPossibleToAddNamedExpression(e,t,n),!0}catch(r){return!1}}addNamedExpression(e,t,n,r){hi(e,"string","expressionName"),void 0!==n&&hi(n,"number","scope"),this._crudOperations.addNamedExpression(e,t,n,r);const i=this.recomputeIfDependencyGraphNeedsIt();return this._emitter.emit(la.NamedExpressionAdded,e,i),i}getNamedExpressionValue(e,t){hi(e,"string","expressionName"),void 0!==t&&hi(t,"number","scope"),this.ensureEvaluationIsNotSuspended(),this._crudOperations.ensureScopeIdIsValid(t);const n=this._namedExpressions.namedExpressionForScope(e,t);return n?this._serialization.getCellValue(n.address):void 0}getNamedExpressionFormula(e,t){hi(e,"string","expressionName"),void 0!==t&&hi(t,"number","scope"),this._crudOperations.ensureScopeIdIsValid(t);const n=this._namedExpressions.namedExpressionForScope(e,t);return void 0===n?void 0:this._serialization.getCellFormula(n.address)}getNamedExpression(e,t){hi(e,"string","expressionName"),void 0!==t&&hi(t,"number","scope");const n=this._namedExpressions.namedExpressionForScope(e,t);if(void 0===n)return;const r=this._serialization.getCellFormula(n.address);return{name:e,scope:t,expression:r,options:n.options}}isItPossibleToChangeNamedExpression(e,t,n){hi(e,"string","expressionName"),void 0!==n&&hi(n,"number","scope");try{return this._crudOperations.ensureItIsPossibleToChangeNamedExpression(e,t,n),!0}catch(r){return!1}}changeNamedExpression(e,t,n,r){return hi(e,"string","expressionName"),void 0!==n&&hi(n,"number","scope"),this._crudOperations.changeNamedExpressionExpression(e,n,t,r),this.recomputeIfDependencyGraphNeedsIt()}isItPossibleToRemoveNamedExpression(e,t){hi(e,"string","expressionName"),void 0!==t&&hi(t,"number","scope");try{return this._crudOperations.isItPossibleToRemoveNamedExpression(e,t),!0}catch(n){return!1}}removeNamedExpression(e,t){hi(e,"string","expressionName"),void 0!==t&&hi(t,"number","scope");const n=this._crudOperations.removeNamedExpression(e,t);if(n){const e=this.recomputeIfDependencyGraphNeedsIt();return this._emitter.emit(la.NamedExpressionRemoved,n.displayName,e),e}return[]}listNamedExpressions(e){return void 0!==e&&hi(e,"number","scope"),this._crudOperations.ensureScopeIdIsValid(e),this._namedExpressions.getAllNamedExpressionsNamesInScope(e)}getAllNamedExpressionsSerialized(){return this._serialization.getAllNamedExpressionsSerialized()}normalizeFormula(e){hi(e,"string","formulaString");const{ast:t,address:n}=this.extractTemporaryFormula(e);if(void 0===t)throw new Yt;return this._unparser.unparse(t,n)}calculateFormula(e,t){hi(e,"string","formulaString"),hi(t,"number","sheetId"),this._crudOperations.ensureScopeIdIsValid(t);const{ast:n,address:r,dependencies:i}=this.extractTemporaryFormula(e,t);if(void 0===n)throw new Yt;const o=this.evaluator.runAndForget(n,r,i);return this._exporter.exportScalarOrRange(o)}getNamedExpressionsFromFormula(e){hi(e,"string","formulaString");const{ast:t,dependencies:n}=this.extractTemporaryFormula(e);if(void 0===t)throw new Yt;const r=n.filter(e=>e instanceof wt).map(e=>e.name),i=[...new Set(r)];return i}validateFormula(e){hi(e,"string","formulaString");const{ast:t}=this.extractTemporaryFormula(e);return void 0!==t}getRegisteredFunctionNames(){const e=ua.getLanguage(this._config.language);return e.getFunctionTranslations(this._functionRegistry.getRegisteredFunctionIds())}getFunctionPlugin(e){return hi(e,"string","functionId"),this._functionRegistry.getFunctionPlugin(e)}getAllFunctionPlugins(){return this._functionRegistry.getPlugins()}numberToDateTime(e){return hi(e,"number","val"),this._evaluator.interpreter.dateTimeHelper.numberToSimpleDateTime(e)}numberToDate(e){return hi(e,"number","val"),this._evaluator.interpreter.dateTimeHelper.numberToSimpleDate(e)}numberToTime(e){return hi(e,"number","val"),Ui(e)}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}destroy(){sa(this)}ensureEvaluationIsNotSuspended(){if(this._evaluationSuspended)throw new hn}extractTemporaryFormula(e,t=1){const n=this._cellContentParser.parse(e),r={sheet:t,col:0,row:0};if(!(n instanceof Eo.Formula))return{address:r,dependencies:[]};const{ast:i,errors:o,dependencies:s}=this._parser.parse(n.formula,r);return o.length>0?{address:r,dependencies:[]}:{ast:i,address:r,dependencies:s}}rebuildWithConfig(e){const t=this._config.mergeConfig(e),n=this._config.mergeConfig({language:e.language}),r=this._serialization.withNewConfig(n,this._namedExpressions).getAllSheetsSerialized(),i=this._serialization.getAllNamedExpressionsSerialized(),o=oa.rebuildWithConfig(t,r,i,this._stats);this._config=o.config,this._stats=o.stats,this._dependencyGraph=o.dependencyGraph,this._columnSearch=o.columnSearch,this._parser=o.parser,this._unparser=o.unparser,this._cellContentParser=o.cellContentParser,this._evaluator=o.evaluator,this._lazilyTransformingAstService=o.lazilyTransformingAstService,this._crudOperations=o.crudOperations,this._exporter=o.exporter,this._namedExpressions=o.namedExpressions,this._serialization=o.serialization,this._functionRegistry=o.functionRegistry}recomputeIfDependencyGraphNeedsIt(){if(this._evaluationSuspended)return[];{const e=this._crudOperations.getAndClearContentChanges(),t=this.dependencyGraph.verticesToRecompute();this.dependencyGraph.clearDirtyVertices(),t.length>0&&e.addAll(this.evaluator.partialRun(t));const n=e.exportChanges(this._exporter);return e.isEmpty()||this._emitter.emit(la.ValuesUpdated,n),n}}}ua.version="2.7.0",ua.buildDate="10/04/2024 11:28:07",ua.releaseDate="10/04/2024",ua.languages={},ua.registeredLanguages=new Map;
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- const da=new WeakMap;class pa{constructor(e={},t=!0){const{accentSensitive:n,binarySearchThreshold:r,caseSensitive:i,caseFirst:o,chooseAddressMappingPolicy:s,context:a,currencySymbol:l,dateFormats:c,decimalSeparator:h,evaluateNullToZero:u,functionArgSeparator:d,functionPlugins:p,ignorePunctuation:f,leapYear1900:g,localeLang:m,language:y,ignoreWhiteSpace:w,licenseKey:b,matchWholeCell:v,arrayColumnSeparator:E,arrayRowSeparator:C,maxRows:S,maxColumns:R,nullYear:T,nullDate:O,parseDateTime:N,precisionEpsilon:A,precisionRounding:I,stringifyDateTime:M,stringifyDuration:x,smartRounding:_,timeFormats:L,thousandSeparator:P,useArrayArithmetic:k,useStats:j,undoLimit:H,useColumnIndex:D,useRegularExpressions:F,useWildcards:U}=e;t&&pa.warnDeprecatedOptions(e),this.useArrayArithmetic=oi(k,"boolean","useArrayArithmetic"),this.accentSensitive=oi(n,"boolean","accentSensitive"),this.caseSensitive=oi(i,"boolean","caseSensitive"),this.caseFirst=oi(o,["upper","lower","false"],"caseFirst"),this.ignorePunctuation=oi(f,"boolean","ignorePunctuation"),this.chooseAddressMappingPolicy=null!==s&&void 0!==s?s:pa.defaultConfig.chooseAddressMappingPolicy,this.dateFormats=[...li(c,Array.isArray,"array","dateFormats")],this.timeFormats=[...li(L,Array.isArray,"array","timeFormats")],this.functionArgSeparator=oi(d,"string","functionArgSeparator"),this.decimalSeparator=oi(h,[".",","],"decimalSeparator"),this.language=oi(y,"string","language"),this.ignoreWhiteSpace=oi(w,["standard","any"],"ignoreWhiteSpace"),this.licenseKey=oi(b,"string","licenseKey"),this.thousandSeparator=oi(P,["",","," ","."],"thousandSeparator"),this.arrayColumnSeparator=oi(E,[",",";"],"arrayColumnSeparator"),this.arrayRowSeparator=oi(C,[";","|"],"arrayRowSeparator"),this.localeLang=oi(m,"string","localeLang"),this.functionPlugins=[...null!==p&&void 0!==p?p:pa.defaultConfig.functionPlugins],this.smartRounding=oi(_,"boolean","smartRounding"),this.evaluateNullToZero=oi(u,"boolean","evaluateNullToZero"),this.nullYear=oi(T,"number","nullYear"),si(this.nullYear,"nullYear",0),ai(this.nullYear,"nullYear",100),this.precisionRounding=oi(I,"number","precisionRounding"),si(this.precisionRounding,"precisionRounding",0),this.precisionEpsilon=oi(A,"number","precisionEpsilon"),si(this.precisionEpsilon,"precisionEpsilon",0),this.useColumnIndex=oi(D,"boolean","useColumnIndex"),this.useStats=oi(j,"boolean","useStats"),this.binarySearchThreshold=null!==r&&void 0!==r?r:pa.defaultConfig.binarySearchThreshold,this.parseDateTime=oi(N,"function","parseDateTime"),this.stringifyDateTime=oi(M,"function","stringifyDateTime"),this.stringifyDuration=oi(x,"function","stringifyDuration"),this.translationPackage=ua.getLanguage(this.language),this.errorMapping=this.translationPackage.buildErrorMapping(),this.nullDate=li(O,xi,"IDate","nullDate"),this.leapYear1900=oi(g,"boolean","leapYear1900"),this.undoLimit=oi(H,"number","undoLimit"),this.useRegularExpressions=oi(F,"boolean","useRegularExpressions"),this.useWildcards=oi(U,"boolean","useWildcards"),this.matchWholeCell=oi(v,"boolean","matchWholeCell"),si(this.undoLimit,"undoLimit",0),this.maxRows=oi(S,"number","maxRows"),si(this.maxRows,"maxRows",1),this.maxColumns=oi(R,"number","maxColumns"),this.currencySymbol=this.setupCurrencySymbol(l),si(this.maxColumns,"maxColumns",1),this.context=a,da.set(this,{licenseKeyValidityState:bo(this.licenseKey)}),ci({value:this.decimalSeparator,name:"decimalSeparator"},{value:this.functionArgSeparator,name:"functionArgSeparator"},{value:this.thousandSeparator,name:"thousandSeparator"}),ci({value:this.arrayRowSeparator,name:"arrayRowSeparator"},{value:this.arrayColumnSeparator,name:"arrayColumnSeparator"})}setupCurrencySymbol(e){const t=[...li(e,Array.isArray,"array","currencySymbol")];return t.forEach(e=>{if("string"!==typeof e)throw new on("string[]","currencySymbol");if(""===e)throw new sn("currencySymbol")}),t}get licenseKeyValidityState(){return da.get(this).licenseKeyValidityState}getConfig(){return fa(this)}mergeConfig(e){const t=Object.assign({},this.getConfig(),e);return pa.warnDeprecatedOptions(e),new pa(t,!1)}static warnDeprecatedOptions(e){pa.warnDeprecatedIfUsed(e.binarySearchThreshold,"binarySearchThreshold","1.1")}static warnDeprecatedIfUsed(e,t,n,r){void 0!==e&&(void 0===r?console.warn(`${t} option is deprecated since ${n}`):console.warn(`${t} option is deprecated since ${n}, please use ${r}`))}}function fa(e){var t;const n={};for(const r in pa.defaultConfig){const i=null!==(t=e[r])&&void 0!==t?t:pa.defaultConfig[r];Array.isArray(i)?n[r]=[...i]:n[r]=i}return n}function ga(){return fa({})}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */pa.defaultConfig={accentSensitive:!1,binarySearchThreshold:20,currencySymbol:["$"],caseSensitive:!1,caseFirst:"lower",context:void 0,chooseAddressMappingPolicy:new Wi,dateFormats:["DD/MM/YYYY","DD/MM/YY"],decimalSeparator:".",evaluateNullToZero:!1,functionArgSeparator:",",functionPlugins:[],ignorePunctuation:!1,language:"enGB",ignoreWhiteSpace:"standard",licenseKey:"",leapYear1900:!1,localeLang:"en",matchWholeCell:!0,arrayColumnSeparator:",",arrayRowSeparator:";",maxRows:4e4,maxColumns:18278,nullYear:30,nullDate:{year:1899,month:12,day:30},parseDateTime:bi,precisionEpsilon:1e-13,precisionRounding:14,smartRounding:!0,stringifyDateTime:ao,stringifyDuration:so,timeFormats:["hh:mm","hh:mm:ss.sss"],thousandSeparator:"",undoLimit:20,useRegularExpressions:!1,useWildcards:!0,useColumnIndex:!1,useStats:!1,useArrayArithmetic:!1};const ma={errors:{CYCLE:"#CYCLE!",DIV_BY_ZERO:"#DIV/0!",ERROR:"#ERROR!",NA:"#N/A",NAME:"#NAME?",NUM:"#NUM!",REF:"#REF!",SPILL:"#SPILL!",VALUE:"#VALUE!"},functions:{FILTER:"FILTER",ADDRESS:"ADDRESS",ARRAY_CONSTRAIN:"ARRAY_CONSTRAIN",ARRAYFORMULA:"ARRAYFORMULA",ABS:"ABS",ACOS:"ACOS",ACOSH:"ACOSH",ACOT:"ACOT",ACOTH:"ACOTH",AND:"AND",ARABIC:"ARABIC",ASIN:"ASIN",ASINH:"ASINH",ATAN2:"ATAN2",ATAN:"ATAN",ATANH:"ATANH",AVERAGE:"AVERAGE",AVERAGEA:"AVERAGEA",AVERAGEIF:"AVERAGEIF",BASE:"BASE",BIN2DEC:"BIN2DEC",BIN2HEX:"BIN2HEX",BIN2OCT:"BIN2OCT",BITAND:"BITAND",BITLSHIFT:"BITLSHIFT",BITOR:"BITOR",BITRSHIFT:"BITRSHIFT",BITXOR:"BITXOR",CEILING:"CEILING",CHAR:"CHAR",CHOOSE:"CHOOSE",CLEAN:"CLEAN",CODE:"CODE",COLUMN:"COLUMN",COLUMNS:"COLUMNS",CONCATENATE:"CONCATENATE",CORREL:"CORREL",COS:"COS",COSH:"COSH",COT:"COT",COTH:"COTH",COUNT:"COUNT",COUNTA:"COUNTA",COUNTBLANK:"COUNTBLANK",COUNTIF:"COUNTIF",COUNTIFS:"COUNTIFS",COUNTUNIQUE:"COUNTUNIQUE",CSC:"CSC",CSCH:"CSCH",CUMIPMT:"CUMIPMT",CUMPRINC:"CUMPRINC",DATE:"DATE",DATEDIF:"DATEDIF",DATEVALUE:"DATEVALUE",DAY:"DAY",DAYS360:"DAYS360",DAYS:"DAYS",DB:"DB",DDB:"DDB",DEC2BIN:"DEC2BIN",DEC2HEX:"DEC2HEX",DEC2OCT:"DEC2OCT",DECIMAL:"DECIMAL",DEGREES:"DEGREES",DELTA:"DELTA",DOLLARDE:"DOLLARDE",DOLLARFR:"DOLLARFR",EDATE:"EDATE",EFFECT:"EFFECT",EOMONTH:"EOMONTH",ERF:"ERF",ERFC:"ERFC",EVEN:"EVEN",EXACT:"EXACT",EXP:"EXP",FALSE:"FALSE",FIND:"FIND",FORMULATEXT:"FORMULATEXT",FV:"FV",FVSCHEDULE:"FVSCHEDULE",HEX2BIN:"HEX2BIN",HEX2DEC:"HEX2DEC",HEX2OCT:"HEX2OCT",HLOOKUP:"HLOOKUP",HOUR:"HOUR",HYPERLINK:"HYPERLINK",IF:"IF",IFERROR:"IFERROR",IFNA:"IFNA",IFS:"IFS",INDEX:"INDEX",INT:"INT",INTERVAL:"INTERVAL",IPMT:"IPMT",ISBINARY:"ISBINARY",ISBLANK:"ISBLANK",ISERR:"ISERR",ISERROR:"ISERROR",ISEVEN:"ISEVEN",ISFORMULA:"ISFORMULA",ISLOGICAL:"ISLOGICAL",ISNA:"ISNA",ISNONTEXT:"ISNONTEXT",ISNUMBER:"ISNUMBER",ISODD:"ISODD",ISOWEEKNUM:"ISOWEEKNUM",ISPMT:"ISPMT",ISREF:"ISREF",ISTEXT:"ISTEXT",LEFT:"LEFT",LEN:"LEN",LN:"LN",LOG10:"LOG10",LOG:"LOG",LOWER:"LOWER",MATCH:"MATCH",MAX:"MAX",MAXA:"MAXA",MAXIFS:"MAXIFS",MAXPOOL:"MAXPOOL",MEDIAN:"MEDIAN",MEDIANPOOL:"MEDIANPOOL",MID:"MID",MIN:"MIN",MINA:"MINA",MINIFS:"MINIFS",MINUTE:"MINUTE",MIRR:"MIRR",MMULT:"MMULT",MOD:"MOD",MONTH:"MONTH",NA:"NA",NETWORKDAYS:"NETWORKDAYS","NETWORKDAYS.INTL":"NETWORKDAYS.INTL",NOMINAL:"NOMINAL",NOT:"NOT",NOW:"NOW",NPER:"NPER",NPV:"NPV",OCT2BIN:"OCT2BIN",OCT2DEC:"OCT2DEC",OCT2HEX:"OCT2HEX",ODD:"ODD",OFFSET:"OFFSET",OR:"OR",PI:"PI",PMT:"PMT",PDURATION:"PDURATION",PRODUCT:"PRODUCT",POWER:"POWER",PPMT:"PPMT",PROPER:"PROPER",PV:"PV",RADIANS:"RADIANS",RAND:"RAND",RATE:"RATE",REPLACE:"REPLACE",REPT:"REPT",RIGHT:"RIGHT",ROMAN:"ROMAN",ROUND:"ROUND",ROUNDDOWN:"ROUNDDOWN",ROUNDUP:"ROUNDUP",ROW:"ROW",ROWS:"ROWS",RRI:"RRI",SEARCH:"SEARCH",SEC:"SEC",SECH:"SECH",SECOND:"SECOND",SHEET:"SHEET",SHEETS:"SHEETS",SIN:"SIN",SINH:"SINH",SLN:"SLN",SPLIT:"SPLIT",SQRT:"SQRT",STDEVA:"STDEVA","STDEV.P":"STDEV.P",STDEVPA:"STDEVPA","STDEV.S":"STDEV.S",SUBSTITUTE:"SUBSTITUTE",SUBTOTAL:"SUBTOTAL",SUM:"SUM",SUMIF:"SUMIF",SUMIFS:"SUMIFS",SUMPRODUCT:"SUMPRODUCT",SUMSQ:"SUMSQ",SWITCH:"SWITCH",SYD:"SYD",T:"T",TAN:"TAN",TANH:"TANH",TBILLEQ:"TBILLEQ",TBILLPRICE:"TBILLPRICE",TBILLYIELD:"TBILLYIELD",TEXT:"TEXT",TIME:"TIME",TIMEVALUE:"TIMEVALUE",TODAY:"TODAY",TRANSPOSE:"TRANSPOSE",TRIM:"TRIM",TRUE:"TRUE",TRUNC:"TRUNC",UNICHAR:"UNICHAR",UNICODE:"UNICODE",UPPER:"UPPER",VARA:"VARA","VAR.P":"VAR.P",VARPA:"VARPA","VAR.S":"VAR.S",VLOOKUP:"VLOOKUP",WEEKDAY:"WEEKDAY",WEEKNUM:"WEEKNUM",WORKDAY:"WORKDAY","WORKDAY.INTL":"WORKDAY.INTL",XNPV:"XNPV",XOR:"XOR",YEAR:"YEAR",YEARFRAC:"YEARFRAC","HF.ADD":"HF.ADD","HF.CONCAT":"HF.CONCAT","HF.DIVIDE":"HF.DIVIDE","HF.EQ":"HF.EQ","HF.GT":"HF.GT","HF.GTE":"HF.GTE","HF.LT":"HF.LT","HF.LTE":"HF.LTE","HF.MINUS":"HF.MINUS","HF.MULTIPLY":"HF.MULTIPLY","HF.NE":"HF.NE","HF.POW":"HF.POW","HF.UMINUS":"HF.UMINUS","HF.UNARY_PERCENT":"HF.UNARY_PERCENT","HF.UPLUS":"HF.UPLUS",VARP:"VARP",VAR:"VAR",STDEVP:"STDEVP",STDEV:"STDEV","EXPON.DIST":"EXPON.DIST",FISHER:"FISHER",FISHERINV:"FISHERINV",GAMMA:"GAMMA","GAMMA.DIST":"GAMMA.DIST",GAMMALN:"GAMMALN","GAMMALN.PRECISE":"GAMMALN.PRECISE","GAMMA.INV":"GAMMA.INV",GAUSS:"GAUSS",FACT:"FACT",FACTDOUBLE:"FACTDOUBLE",COMBIN:"COMBIN",COMBINA:"COMBINA",GCD:"GCD",LCM:"LCM",MROUND:"MROUND",MULTINOMIAL:"MULTINOMIAL",QUOTIENT:"QUOTIENT",RANDBETWEEN:"RANDBETWEEN",SERIESSUM:"SERIESSUM",SIGN:"SIGN",SQRTPI:"SQRTPI",SUMX2MY2:"SUMX2MY2",SUMX2PY2:"SUMX2PY2",SUMXMY2:"SUMXMY2",EXPONDIST:"EXPONDIST",GAMMADIST:"GAMMADIST",GAMMAINV:"GAMMAINV","BETA.DIST":"BETA.DIST",BETADIST:"BETADIST","BETA.INV":"BETA.INV",BETAINV:"BETAINV","BINOM.DIST":"BINOM.DIST",BINOMDIST:"BINOMDIST","BINOM.INV":"BINOM.INV",BESSELI:"BESSELI",BESSELJ:"BESSELJ",BESSELK:"BESSELK",BESSELY:"BESSELY","CHISQ.DIST":"CHISQ.DIST","CHISQ.DIST.RT":"CHISQ.DIST.RT","CHISQ.INV":"CHISQ.INV","CHISQ.INV.RT":"CHISQ.INV.RT",CHIDIST:"CHIDIST",CHIINV:"CHIINV","F.DIST":"F.DIST","F.DIST.RT":"F.DIST.RT","F.INV":"F.INV","F.INV.RT":"F.INV.RT",FDIST:"FDIST",FINV:"FINV",WEIBULL:"WEIBULL","WEIBULL.DIST":"WEIBULL.DIST",POISSON:"POISSON","POISSON.DIST":"POISSON.DIST","HYPGEOM.DIST":"HYPGEOM.DIST",HYPGEOMDIST:"HYPGEOMDIST","T.DIST":"T.DIST","T.DIST.2T":"T.DIST.2T","T.DIST.RT":"T.DIST.RT","T.INV":"T.INV","T.INV.2T":"T.INV.2T",TDIST:"TDIST",TINV:"TINV",LOGINV:"LOGINV","LOGNORM.DIST":"LOGNORM.DIST","LOGNORM.INV":"LOGNORM.INV",LOGNORMDIST:"LOGNORMDIST","NORM.DIST":"NORM.DIST","NORM.INV":"NORM.INV","NORM.S.DIST":"NORM.S.DIST","NORM.S.INV":"NORM.S.INV",NORMDIST:"NORMDIST",NORMINV:"NORMINV",NORMSDIST:"NORMSDIST",NORMSINV:"NORMSINV",PHI:"PHI","NEGBINOM.DIST":"NEGBINOM.DIST",NEGBINOMDIST:"NEGBINOMDIST",COMPLEX:"COMPLEX",IMABS:"IMABS",IMAGINARY:"IMAGINARY",IMARGUMENT:"IMARGUMENT",IMCONJUGATE:"IMCONJUGATE",IMCOS:"IMCOS",IMCOSH:"IMCOSH",IMCOT:"IMCOT",IMCSC:"IMCSC",IMCSCH:"IMCSCH",IMDIV:"IMDIV",IMEXP:"IMEXP",IMLN:"IMLN",IMLOG10:"IMLOG10",IMLOG2:"IMLOG2",IMPOWER:"IMPOWER",IMPRODUCT:"IMPRODUCT",IMREAL:"IMREAL",IMSEC:"IMSEC",IMSECH:"IMSECH",IMSIN:"IMSIN",IMSINH:"IMSINH",IMSQRT:"IMSQRT",IMSUB:"IMSUB",IMSUM:"IMSUM",IMTAN:"IMTAN",LARGE:"LARGE",SMALL:"SMALL",AVEDEV:"AVEDEV",CONFIDENCE:"CONFIDENCE","CONFIDENCE.NORM":"CONFIDENCE.NORM","CONFIDENCE.T":"CONFIDENCE.T",DEVSQ:"DEVSQ",GEOMEAN:"GEOMEAN",HARMEAN:"HARMEAN",CRITBINOM:"CRITBINOM","COVARIANCE.P":"COVARIANCE.P","COVARIANCE.S":"COVARIANCE.S",COVAR:"COVAR",PEARSON:"PEARSON",RSQ:"RSQ",STANDARDIZE:"STANDARDIZE","Z.TEST":"Z.TEST",ZTEST:"ZTEST","F.TEST":"F.TEST",FTEST:"FTEST",STEYX:"STEYX",SLOPE:"SLOPE","CHISQ.TEST":"CHISQ.TEST",CHITEST:"CHITEST","T.TEST":"T.TEST",TTEST:"TTEST",SKEW:"SKEW","SKEW.P":"SKEW.P",WEIBULLDIST:"WEIBULLDIST",VARS:"VARS",TINV2T:"TINV2T",TDISTRT:"TDISTRT",TDIST2T:"TDIST2T",STDEVS:"STDEVS",FINVRT:"FINVRT",FDISTRT:"FDISTRT",CHIDISTRT:"CHIDISTRT",CHIINVRT:"CHIINVRT",COVARIANCEP:"COVARIANCEP",COVARIANCES:"COVARIANCES",LOGNORMINV:"LOGNORMINV",POISSONDIST:"POISSONDIST",SKEWP:"SKEWP","CEILING.MATH":"CEILING.MATH",FLOOR:"FLOOR","FLOOR.MATH":"FLOOR.MATH","CEILING.PRECISE":"CEILING.PRECISE","FLOOR.PRECISE":"FLOOR.PRECISE","ISO.CEILING":"ISO.CEILING"},langCode:"enGB",ui:{NEW_SHEET_PREFIX:"Sheet"}};var ya,wa=ma;
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */(function(e){e[e["FullyAbsolute"]=1]="FullyAbsolute",e[e["RowAbsoluteColRelative"]=2]="RowAbsoluteColRelative",e[e["RowRelativeColAbsolute"]=3]="RowRelativeColAbsolute",e[e["FullyRelative"]=4]="FullyRelative"})(ya||(ya={}));class ba extends Jr{verifyAddressArguments(e,t,n,r){if(r){if(e<1||t<1)return new lr(Bn.VALUE,Ne.LessThanOne)}else if(ya.FullyAbsolute==n){if(e<1||t<1)return new lr(Bn.VALUE,Ne.LessThanOne)}else if(ya.RowAbsoluteColRelative==n){if(e<1)return new lr(Bn.VALUE,Ne.LessThanOne)}else if(ya.RowRelativeColAbsolute==n&&t<1)return new lr(Bn.VALUE,Ne.LessThanOne)}address(e,t){return this.runFunction(e.args,t,this.metadata("ADDRESS"),(e,t,n,r,i)=>{const o=this.verifyAddressArguments(e,t,n,r);if(void 0!==o)return o;const s=D(t-1);let a="";void 0!==i&&null!==i&&(a=i+"!");const l=0==t?"C":`C[${t}]`,c=0==e?"R":`R[${e}]`;return ya.FullyRelative==n?r?`${a}${s}${e}`:`${a}${c}${l}`:ya.RowRelativeColAbsolute==n?r?`${a}$${s}${e}`:`${a}${c}C${t}`:ya.RowAbsoluteColRelative==n?r?`${a}${s}$${e}`:`${a}R${e}${l}`:r?`${a}$${s}$${e}`:`${a}R${e}C${t}`})}}ba.implementedFunctions={ADDRESS:{method:"address",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,optionalArg:!0,defaultValue:1,minValue:1,maxValue:4},{argumentType:Zr.BOOLEAN,optionalArg:!0,defaultValue:!0},{argumentType:Zr.STRING,optionalArg:!0}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class va extends Jr{arrayformula(e,t){return this.runFunction(e.args,t,this.metadata("ARRAYFORMULA"),e=>e)}arrayformulaArraySize(e,t){if(1!==e.args.length)return ei.error();const n=this.metadata("ARRAYFORMULA"),r=e.args.map(e=>{var r;return this.arraySizeForAst(e,new Or(t.formulaAddress,t.arraysFlag||null!==(r=null===n||void 0===n?void 0:n.arrayFunction)&&void 0!==r&&r))});return r[0]}arrayconstrain(e,t){return this.runFunction(e.args,t,this.metadata("ARRAY_CONSTRAIN"),(e,t,n)=>{t=Math.min(t,e.height()),n=Math.min(n,e.width());const r=e.data,i=[];for(let o=0;o<t;o++)i.push(r[o].slice(0,n));return jt.onlyValues(i)})}arrayconstrainArraySize(e,t){if(3!==e.args.length)return ei.error();const n=this.metadata("ARRAY_CONSTRAIN"),r=e.args.map(e=>{var r;return this.arraySizeForAst(e,new Or(t.formulaAddress,t.arraysFlag||null!==(r=null===n||void 0===n?void 0:n.arrayFunction)&&void 0!==r&&r))});let{height:i,width:o}=r[0];return e.args[1].type===G.NUMBER&&(i=Math.min(i,e.args[1].value)),e.args[2].type===G.NUMBER&&(o=Math.min(o,e.args[2].value)),i<1||o<1||!Number.isInteger(i)||!Number.isInteger(o)?ei.error():new ei(o,i)}filter(e,t){return this.runFunction(e.args,t,this.metadata("FILTER"),(e,...t)=>{for(const i of t)if(e.width()!==i.width()||e.height()!==i.height())return new lr(Bn.NA,Ne.EqualLength);if(e.width()>1&&e.height()>1)return new lr(Bn.NA,Ne.WrongDimension);const n=e.data,r=[];for(let i=0;i<e.height();i++){const o=[];for(let r=0;r<e.width();r++){let e=!0;for(const n of t){const t=kr(n.data[i][r]);if(!0!==t){e=!1;break}}e&&o.push(n[i][r])}o.length>0&&r.push(o)}return r.length>0?jt.onlyValues(r):new lr(Bn.NA,Ne.EmptyRange)})}filterArraySize(e,t){if(e.args.length<=1)return ei.error();const n=this.metadata("FILTER"),r=e.args.map(e=>{var r;return this.arraySizeForAst(e,new Or(t.formulaAddress,t.arraysFlag||null!==(r=null===n||void 0===n?void 0:n.arrayFunction)&&void 0!==r&&r))}),i=Math.max(...r.map(e=>e.width)),o=Math.max(...r.map(e=>e.height));return new ei(i,o)}}va.implementedFunctions={ARRAYFORMULA:{method:"arrayformula",arraySizeMethod:"arrayformulaArraySize",arrayFunction:!0,parameters:[{argumentType:Zr.ANY}]},ARRAY_CONSTRAIN:{method:"arrayconstrain",arraySizeMethod:"arrayconstrainArraySize",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.INTEGER,minValue:1},{argumentType:Zr.INTEGER,minValue:1}],vectorizationForbidden:!0},FILTER:{method:"filter",arraySizeMethod:"filterArraySize",arrayFunction:!0,parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.RANGE}],repeatLastArgs:1}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class Ea extends Jr{abs(e,t){return this.runFunction(e.args,t,this.metadata("ABS"),Math.abs)}}Ea.implementedFunctions={ABS:{method:"abs",parameters:[{argumentType:Zr.NUMBER}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- const Ca=0xffffffffffff,Sa=-53,Ra=53;class Ta extends Jr{bitlshift(e,t){return this.runFunction(e.args,t,this.metadata("BITLSHIFT"),Oa)}bitrshift(e,t){return this.runFunction(e.args,t,this.metadata("BITRSHIFT"),Na)}}function Oa(e,t){return t<0?Na(e,-t):Aa(e*Math.pow(2,t))}function Na(e,t){return t<0?Oa(e,-t):Aa(Math.floor(e/Math.pow(2,t)))}function Aa(e){return e>Ca?new lr(Bn.NUM,Ne.BitshiftLong):e}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */Ta.implementedFunctions={BITLSHIFT:{method:"bitlshift",parameters:[{argumentType:Zr.INTEGER,minValue:0},{argumentType:Zr.INTEGER,minValue:Sa,maxValue:Ra}]},BITRSHIFT:{method:"bitrshift",parameters:[{argumentType:Zr.INTEGER,minValue:0},{argumentType:Zr.INTEGER,minValue:Sa,maxValue:Ra}]}};class Ia extends Jr{bitand(e,t){return this.runFunction(e.args,t,this.metadata("BITAND"),(e,t)=>e&t)}bitor(e,t){return this.runFunction(e.args,t,this.metadata("BITOR"),(e,t)=>e|t)}bitxor(e,t){return this.runFunction(e.args,t,this.metadata("BITXOR"),(e,t)=>e^t)}}Ia.implementedFunctions={BITAND:{method:"bitand",parameters:[{argumentType:Zr.INTEGER,minValue:0},{argumentType:Zr.INTEGER,minValue:0}]},BITOR:{method:"bitor",parameters:[{argumentType:Zr.INTEGER,minValue:0},{argumentType:Zr.INTEGER,minValue:0}]},BITXOR:{method:"bitxor",parameters:[{argumentType:Zr.INTEGER,minValue:0},{argumentType:Zr.INTEGER,minValue:0}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class Ma extends Jr{literalTrue(e,t){return this.runFunction(e.args,t,this.metadata("TRUE"),()=>!0)}literalFalse(e,t){return this.runFunction(e.args,t,this.metadata("FALSE"),()=>!1)}conditionalIf(e,t){return this.runFunction(e.args,t,this.metadata("IF"),(e,t,n)=>e?t:n)}ifs(e,t){return this.runFunction(e.args,t,this.metadata("IFS"),(...e)=>{for(let t=0;t<e.length;t+=2)if(e[t])return e[t+1];return new lr(Bn.NA,Ne.NoConditionMet)})}and(e,t){return this.runFunction(e.args,t,this.metadata("AND"),(...e)=>e.filter(e=>void 0!==e).every(e=>!!e))}or(e,t){return this.runFunction(e.args,t,this.metadata("OR"),(...e)=>e.filter(e=>void 0!==e).some(e=>e))}not(e,t){return this.runFunction(e.args,t,this.metadata("NOT"),e=>!e)}xor(e,t){return this.runFunction(e.args,t,this.metadata("XOR"),(...e)=>{let t=0;return e.filter(e=>void 0!==e).forEach(e=>{e&&t++}),t%2===1})}switch(e,t){return this.runFunction(e.args,t,this.metadata("SWITCH"),(e,...t)=>{const n=t.length;let r=0;for(;r+1<n;r+=2)if(!(t[r]instanceof lr)&&this.arithmeticHelper.eq(e,t[r]))return t[r+1];return r<n?t[r]:new lr(Bn.NA,Ne.NoDefault)})}iferror(e,t){return this.runFunction(e.args,t,this.metadata("IFERROR"),(e,t)=>e instanceof lr?t:e)}ifna(e,t){return this.runFunction(e.args,t,this.metadata("IFNA"),(e,t)=>e instanceof lr&&e.type===Bn.NA?t:e)}choose(e,t){return this.runFunction(e.args,t,this.metadata("CHOOSE"),(e,...t)=>e>t.length?new lr(Bn.NUM,Ne.Selector):t[e-1])}}Ma.implementedFunctions={TRUE:{method:"literalTrue",parameters:[]},FALSE:{method:"literalFalse",parameters:[]},IF:{method:"conditionalIf",parameters:[{argumentType:Zr.BOOLEAN},{argumentType:Zr.SCALAR,passSubtype:!0},{argumentType:Zr.SCALAR,defaultValue:!1,passSubtype:!0}]},IFS:{method:"ifs",parameters:[{argumentType:Zr.BOOLEAN},{argumentType:Zr.SCALAR,passSubtype:!0}],repeatLastArgs:2},AND:{method:"and",parameters:[{argumentType:Zr.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},OR:{method:"or",parameters:[{argumentType:Zr.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},XOR:{method:"xor",parameters:[{argumentType:Zr.BOOLEAN}],repeatLastArgs:1,expandRanges:!0},NOT:{method:"not",parameters:[{argumentType:Zr.BOOLEAN}]},SWITCH:{method:"switch",parameters:[{argumentType:Zr.NOERROR},{argumentType:Zr.SCALAR,passSubtype:!0},{argumentType:Zr.SCALAR,passSubtype:!0}],repeatLastArgs:1},IFERROR:{method:"iferror",parameters:[{argumentType:Zr.SCALAR,passSubtype:!0},{argumentType:Zr.SCALAR,passSubtype:!0}]},IFNA:{method:"ifna",parameters:[{argumentType:Zr.SCALAR,passSubtype:!0},{argumentType:Zr.SCALAR,passSubtype:!0}]},CHOOSE:{method:"choose",parameters:[{argumentType:Zr.INTEGER,minValue:1},{argumentType:Zr.SCALAR,passSubtype:!0}],repeatLastArgs:1}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class xa extends Jr{char(e,t){return this.runFunction(e.args,t,this.metadata("CHAR"),e=>e<1||e>=256?new lr(Bn.VALUE,Ne.CharacterCodeBounds):String.fromCharCode(Math.trunc(e)))}unichar(e,t){return this.runFunction(e.args,t,this.metadata("CHAR"),e=>e<1||e>=1114112?new lr(Bn.VALUE,Ne.CharacterCodeBounds):String.fromCodePoint(Math.trunc(e)))}}xa.implementedFunctions={CHAR:{method:"char",parameters:[{argumentType:Zr.NUMBER}]},UNICHAR:{method:"unichar",parameters:[{argumentType:Zr.NUMBER}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class _a extends Jr{code(e,t){return this.runFunction(e.args,t,this.metadata("CODE"),e=>0===e.length?new lr(Bn.VALUE,Ne.EmptyString):e.charCodeAt(0))}unicode(e,t){return this.runFunction(e.args,t,this.metadata("UNICODE"),e=>{var t;return null!==(t=e.codePointAt(0))&&void 0!==t?t:new lr(Bn.VALUE,Ne.EmptyString)})}}_a.implementedFunctions={CODE:{method:"code",parameters:[{argumentType:Zr.STRING}]},UNICODE:{method:"unicode",parameters:[{argumentType:Zr.STRING}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class La extends Jr{countblank(e,t){return this.runFunction(e.args,t,this.metadata("COUNTBLANK"),(...e)=>{let t=0;return e.forEach(e=>{e===Et&&t++}),t})}}La.implementedFunctions={COUNTBLANK:{method:"countblank",parameters:[{argumentType:Zr.SCALAR}],repeatLastArgs:1,expandRanges:!0}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class Pa extends Jr{countunique(e,t){return this.runFunction(e.args,t,this.metadata("COUNTUNIQUE"),(...e)=>{const t=new Set,n=new Set;for(const r of e)r instanceof lr?n.add(r.type):""!==r&&t.add(r);return t.size+n.size})}}Pa.implementedFunctions={COUNTUNIQUE:{method:"countunique",parameters:[{argumentType:Zr.SCALAR}],repeatLastArgs:1,expandRanges:!0}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class ka extends Jr{constructor(){super(...arguments),this.isoweeknumCore=e=>{const t=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e)),n=this.dateTimeHelper.numberToSimpleDate(e),r=this.dateTimeHelper.dateToNumber({year:n.year,month:1,day:1}),i=this.dateTimeHelper.relativeNumberToAbsoluteNumber(r),o=i+((4-i)%7+7)%7,s=Math.floor((t-1)/7)-Math.floor((o-1)/7)+1;return 0===s?this.isoweeknumCore(e-7)+1:s},this.days360Core=(e,t,n)=>{const r=this.dateTimeHelper.numberToSimpleDate(e),i=this.dateTimeHelper.numberToSimpleDate(t);let o,s;return n?(o=Bi(r),s=Bi(i)):[o,s]=this.dateTimeHelper.toBasisUS(r,i),360*(s.year-o.year)+30*(s.month-o.month)+s.day-o.day}}date(e,t){return this.runFunction(e.args,t,this.metadata("DATE"),(e,t,n)=>{const r=Math.trunc(n);let i=Math.trunc(t),o=Math.trunc(e);o<this.dateTimeHelper.getEpochYearZero()&&(o+=this.dateTimeHelper.getEpochYearZero());const s=Math.floor((i-1)/12);o+=s,i-=12*s;const a={year:o,month:i,day:1};if(this.dateTimeHelper.isValidDate(a)){let e=this.dateTimeHelper.dateToNumber(a)+(r-1);return e=this.dateTimeHelper.getWithinBounds(e),void 0===e?new lr(Bn.NUM,Ne.DateBounds):e}return new lr(Bn.VALUE,Ne.InvalidDate)})}time(e,t){return this.runFunction(e.args,t,this.metadata("TIME"),(e,t,n)=>{const r=Vi({hours:Math.trunc(e),minutes:Math.trunc(t),seconds:Math.trunc(n)});return r<0?new lr(Bn.NUM,Ne.NegativeTime):r%1})}eomonth(e,t){return this.runFunction(e.args,t,this.metadata("EOMONTH"),(e,t)=>{const n=this.dateTimeHelper.numberToSimpleDate(e);let r=this.dateTimeHelper.dateToNumber(this.dateTimeHelper.endOfMonth(ji(n,t)));return r=this.dateTimeHelper.getWithinBounds(r),void 0===r?new lr(Bn.NUM,Ne.DateBounds):r})}day(e,t){return this.runFunction(e.args,t,this.metadata("DAY"),e=>this.dateTimeHelper.numberToSimpleDate(e).day)}days(e,t){return this.runFunction(e.args,t,this.metadata("DAYS"),(e,t)=>Math.trunc(e)-Math.trunc(t))}month(e,t){return this.runFunction(e.args,t,this.metadata("MONTH"),e=>this.dateTimeHelper.numberToSimpleDate(e).month)}year(e,t){return this.runFunction(e.args,t,this.metadata("YEAR"),e=>this.dateTimeHelper.numberToSimpleDate(e).year)}hour(e,t){return this.runFunction(e.args,t,this.metadata("HOUR"),e=>Ui(Di(e)%1).hours)}minute(e,t){return this.runFunction(e.args,t,this.metadata("MINUTE"),e=>Ui(Di(e)%1).minutes)}second(e,t){return this.runFunction(e.args,t,this.metadata("SECOND"),e=>Ui(Di(e)%1).seconds)}text(e,t){return this.runFunction(e.args,t,this.metadata("TEXT"),(e,t)=>to(e,t,this.config,this.dateTimeHelper))}weekday(e,t){return this.runFunction(e.args,t,this.metadata("WEEKDAY"),(e,t)=>{const n=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e));if(3===t)return(n-1)%7;const r=Da.get(t);return void 0===r?new lr(Bn.NUM,Ne.BadMode):(n-r)%7+1})}weeknum(e,t){return this.runFunction(e.args,t,this.metadata("WEEKNUM"),(e,t)=>{const n=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e)),r=this.dateTimeHelper.numberToSimpleDate(e),i=this.dateTimeHelper.dateToNumber({year:r.year,month:1,day:1}),o=this.dateTimeHelper.relativeNumberToAbsoluteNumber(i);if(21===t)return this.isoweeknumCore(e);const s=Da.get(t);return void 0===s?new lr(Bn.NUM,Ne.BadMode):Math.floor((n-s)/7)-Math.floor((o-s)/7)+1})}isoweeknum(e,t){return this.runFunction(e.args,t,this.metadata("ISOWEEKNUM"),this.isoweeknumCore)}datevalue(e,t){return this.runFunction(e.args,t,this.metadata("DATEVALUE"),e=>{const{dateTime:t}=this.dateTimeHelper.parseDateTimeFromConfigFormats(e);return void 0===t?new lr(Bn.VALUE,Ne.IncorrectDateTime):xi(t)?(_i(t)?Math.trunc(Vi(t)):0)+this.dateTimeHelper.dateToNumber(t):0})}timevalue(e,t){return this.runFunction(e.args,t,this.metadata("TIMEVALUE"),e=>{const t=this.dateTimeHelper.dateStringToDateNumber(e);return void 0===t?new lr(Bn.VALUE,Ne.IncorrectDateTime):Ct(t)%1})}now(e,t){return this.runFunction(e.args,t,this.metadata("NOW"),()=>{const e=new Date(Date.now());return Vi({hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()})+this.dateTimeHelper.dateToNumber({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()})})}today(e,t){return this.runFunction(e.args,t,this.metadata("TODAY"),()=>{const e=new Date(Date.now());return this.dateTimeHelper.dateToNumber({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()})})}edate(e,t){return this.runFunction(e.args,t,this.metadata("EDATE"),(e,t)=>{const n=this.dateTimeHelper.numberToSimpleDate(e),r=Hi(ji(n,t));let i=this.dateTimeHelper.dateToNumber(r);return i=this.dateTimeHelper.getWithinBounds(i),void 0===i?new lr(Bn.NUM,Ne.DateBounds):i})}datedif(e,t){return this.runFunction(e.args,t,this.metadata("DATEDIF"),(e,t,n)=>{if(e>t)return new lr(Bn.NUM,Ne.StartEndDate);if("D"===n)return Math.floor(t)-Math.floor(e);const r=this.dateTimeHelper.numberToSimpleDate(e),i=this.dateTimeHelper.numberToSimpleDate(t);switch(n){case"M":return 12*(i.year-r.year)+(i.month-r.month)-(i.day<r.day?1:0);case"YM":return(i.month-r.month+12-(i.day<r.day?1:0))%12;case"Y":return i.month>r.month||i.month===r.month&&i.day>=r.day?i.year-r.year:i.year-r.year-1;case"MD":if(i.day>=r.day)return i.day-r.day;{const e=1===i.month?12:i.month-1,t=1===i.month?i.year-1:i.year;return this.dateTimeHelper.daysInMonth(t,e)+i.day-r.day}case"YD":return i.month>r.month||i.month===r.month&&i.day>=r.day?Math.floor(t)-this.dateTimeHelper.dateToNumber({year:i.year,month:r.month,day:r.day}):Math.floor(t)-Math.floor(e)-365*(i.year-r.year-1)-this.dateTimeHelper.leapYearsCount(i.year-1)+this.dateTimeHelper.leapYearsCount(r.year);default:return new lr(Bn.NUM,Ne.BadMode)}})}days360(e,t){return this.runFunction(e.args,t,this.metadata("DAYS360"),this.days360Core)}yearfrac(e,t){return this.runFunction(e.args,t,this.metadata("YEARFRAC"),(e,t,n)=>{switch(e=Math.trunc(e),t=Math.trunc(t),e>t&&([e,t]=[t,e]),n){case 0:return this.days360Core(e,t,!1)/360;case 1:return(t-e)/this.dateTimeHelper.yearLengthForBasis(this.dateTimeHelper.numberToSimpleDate(e),this.dateTimeHelper.numberToSimpleDate(t));case 2:return(t-e)/360;case 3:return(t-e)/365;case 4:return this.days360Core(e,t,!0)/360}throw new Error("Should not be reachable.")})}interval(e,t){return this.runFunction(e.args,t,this.metadata("INTERVAL"),e=>{e=Math.trunc(e);const t=e%60;e=Math.trunc(e/60);const n=e%60;e=Math.trunc(e/60);const r=e%24;e=Math.trunc(e/24);const i=e%30;e=Math.trunc(e/30);const o=e%12,s=Math.trunc(e/12);return"P"+(s>0?s+"Y":"")+(o>0?o+"M":"")+(i>0?i+"D":"")+"T"+(r>0?r+"H":"")+(n>0?n+"M":"")+(t>0?t+"S":"")})}networkdays(e,t){return this.runFunction(e.args,t,this.metadata("NETWORKDAYS"),(e,t,n)=>this.networkdayscore(e,t,1,n))}networkdaysintl(e,t){return this.runFunction(e.args,t,this.metadata("NETWORKDAYS.INTL"),(e,t,n,r)=>this.networkdayscore(e,t,n,r))}workday(e,t){return this.runFunction(e.args,t,this.metadata("WORKDAY"),(e,t,n)=>this.workdaycore(e,t,1,n))}workdayintl(e,t){return this.runFunction(e.args,t,this.metadata("WORKDAY.INTL"),(e,t,n,r)=>this.workdaycore(e,t,n,r))}networkdayscore(e,t,n,r){e=Math.trunc(e),t=Math.trunc(t);let i=1;e>t&&([e,t]=[t,e],i=-1);const o=Ha(n);if(o instanceof lr)return o;const s=this.simpleRangeToFilteredHolidays(o,r);return s instanceof lr?s:i*this.countWorkdays(e,t,o,s)}workdaycore(e,t,n,r){e=Math.trunc(e),t=Math.trunc(t);const i=Ha(n);if(i instanceof lr)return i;const o=this.simpleRangeToFilteredHolidays(i,r);if(o instanceof lr)return o;if(t>0){let n=1;while(this.countWorkdays(e+1,e+n,i,o)<t)n*=2;let r=1;while(r+1<n){const s=Math.trunc((r+n)/2);this.countWorkdays(e+1,e+s,i,o)<t?r=s:n=s}return e+n}if(t<0){t*=-1;let n=1;while(this.countWorkdays(e-n,e-1,i,o)<t)n*=2;let r=1;while(r+1<n){const s=Math.trunc((r+n)/2);this.countWorkdays(e-s,e-1,i,o)<t?r=s:n=s}return e-n}return e}countWorkdays(e,t,n,r){const i=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(t)),o=Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(e));let s=0;for(let a=0;a<7;a++)"0"===n.charAt(a)&&(s+=Math.floor((i+6-a)/7),s-=Math.floor((o-1+6-a)/7));return s-=ja(t+1,r)-ja(e,r),s}simpleRangeToFilteredHolidays(e,t){var n;const r=null!==(n=null===t||void 0===t?void 0:t.valuesFromTopLeftCorner())&&void 0!==n?n:[];for(const o of r)if(o instanceof lr)return o;const i=[];for(const o of r)if(o!==Et){if(!Mt(o))return new lr(Bn.VALUE,Ne.WrongType);i.push(Math.trunc(Ct(o)))}return[...new Set(i)].sort((e,t)=>e-t).filter(t=>{const n=this.dateTimeHelper.relativeNumberToAbsoluteNumber(t),r=(n-1)%7;return"0"===e.charAt(r)})}}function ja(e,t){if(0===t.length)return 0;if(e<=t[0])return 0;if(t[t.length-1]<e)return t.length;let n=0,r=t.length-1;while(n+1<r){const i=Math.floor((r+n)/2);t[i]>=e?r=i:n=i}return r}function Ha(e){var t;return"number"!==typeof e&&"string"!==typeof e?new lr(Bn.VALUE,Ne.WrongType):"string"===typeof e?7===e.length&&/^(0|1)*$/.test(e)&&"1111111"!==e?e:new lr(Bn.NUM,Ne.WeekendString):null!==(t=Fa.get(e))&&void 0!==t?t:new lr(Bn.NUM,Ne.BadMode)}ka.implementedFunctions={DATE:{method:"date",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER}],returnNumberType:xt.NUMBER_DATE},TIME:{method:"time",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER}],returnNumberType:xt.NUMBER_TIME},MONTH:{method:"month",parameters:[{argumentType:Zr.NUMBER,minValue:0}]},YEAR:{method:"year",parameters:[{argumentType:Zr.NUMBER,minValue:0}]},HOUR:{method:"hour",parameters:[{argumentType:Zr.NUMBER,minValue:0}]},MINUTE:{method:"minute",parameters:[{argumentType:Zr.NUMBER,minValue:0}]},SECOND:{method:"second",parameters:[{argumentType:Zr.NUMBER,minValue:0}]},TEXT:{method:"text",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.STRING}]},EOMONTH:{method:"eomonth",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER}],returnNumberType:xt.NUMBER_DATE},DAY:{method:"day",parameters:[{argumentType:Zr.NUMBER,minValue:0}]},DAYS:{method:"days",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:0}]},WEEKDAY:{method:"weekday",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,defaultValue:1}]},WEEKNUM:{method:"weeknum",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,defaultValue:1}]},ISOWEEKNUM:{method:"isoweeknum",parameters:[{argumentType:Zr.NUMBER,minValue:0}]},DATEVALUE:{method:"datevalue",parameters:[{argumentType:Zr.STRING}],returnNumberType:xt.NUMBER_DATE},TIMEVALUE:{method:"timevalue",parameters:[{argumentType:Zr.STRING}],returnNumberType:xt.NUMBER_TIME},NOW:{method:"now",parameters:[],isVolatile:!0,returnNumberType:xt.NUMBER_DATETIME},TODAY:{method:"today",parameters:[],isVolatile:!0,returnNumberType:xt.NUMBER_DATE},EDATE:{method:"edate",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER}],returnNumberType:xt.NUMBER_DATE},DAYS360:{method:"days360",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.BOOLEAN,defaultValue:!1}]},DATEDIF:{method:"datedif",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.STRING}]},YEARFRAC:{method:"yearfrac",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.INTEGER,defaultValue:0,minValue:0,maxValue:4}]},INTERVAL:{method:"interval",parameters:[{argumentType:Zr.NUMBER,minValue:0}]},NETWORKDAYS:{method:"networkdays",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.RANGE,optionalArg:!0}]},"NETWORKDAYS.INTL":{method:"networkdaysintl",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NOERROR,defaultValue:1},{argumentType:Zr.RANGE,optionalArg:!0}]},WORKDAY:{method:"workday",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER},{argumentType:Zr.RANGE,optionalArg:!0}]},"WORKDAY.INTL":{method:"workdayintl",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER},{argumentType:Zr.NOERROR,defaultValue:1},{argumentType:Zr.RANGE,optionalArg:!0}]}};const Da=new Map([[1,0],[2,1],[11,1],[12,2],[13,3],[14,4],[15,5],[16,6],[17,0]]),Fa=new Map([[1,"0000011"],[2,"1000001"],[3,"1100000"],[4,"0110000"],[5,"0011000"],[6,"0001100"],[7,"0000110"],[11,"0000001"],[12,"1000000"],[13,"0100000"],[14,"0010000"],[15,"0001000"],[16,"0000100"],[17,"0000010"]]);
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class Ua extends Jr{degrees(e,t){return this.runFunction(e.args,t,this.metadata("DEGREES"),e=>e*(180/Math.PI))}}Ua.implementedFunctions={DEGREES:{method:"degrees",parameters:[{argumentType:Zr.NUMBER}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class Va extends Jr{delta(e,t){return this.runFunction(e.args,t,this.metadata("DELTA"),(e,t)=>e===t?1:0)}}Va.implementedFunctions={DELTA:{method:"delta",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,defaultValue:0}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class Ba extends Jr{exp(e,t){return this.runFunction(e.args,t,this.metadata("EXP"),Math.exp)}}Ba.implementedFunctions={EXP:{method:"exp",parameters:[{argumentType:Zr.NUMBER}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class Wa extends Jr{pmt(e,t){return this.runFunction(e.args,t,this.metadata("PMT"),Ga)}ipmt(e,t){return this.runFunction(e.args,t,this.metadata("IPMT"),za)}ppmt(e,t){return this.runFunction(e.args,t,this.metadata("PPMT"),Xa)}fv(e,t){return this.runFunction(e.args,t,this.metadata("FV"),Ya)}cumipmt(e,t){return this.runFunction(e.args,t,this.metadata("CUMIPMT"),(e,t,n,r,i,o)=>{if(r>i)return new lr(Bn.NUM,Ne.EndStartPeriod);let s=0;for(let a=r;a<=i;a++)s+=za(e,a,t,n,0,o);return s})}cumprinc(e,t){return this.runFunction(e.args,t,this.metadata("CUMPRINC"),(e,t,n,r,i,o)=>{if(r>i)return new lr(Bn.NUM,Ne.EndStartPeriod);let s=0;for(let a=r;a<=i;a++)s+=Xa(e,a,t,n,0,o);return s})}db(e,t){return this.runFunction(e.args,t,this.metadata("DB"),(e,t,n,r,i)=>{if(12===i&&r>n||r>n+1)return new lr(Bn.NUM,Ne.PeriodLong);if(t>=e)return 0;const o=Math.round(1e3*(1-Math.pow(t/e,1/n)))/1e3,s=e*o*i/12;if(1===r)return s;let a=s;for(let l=0;l<r-2;l++)a+=(e-a)*o;return r===n+1?(e-a)*o*(12-i)/12:(e-a)*o})}ddb(e,t){return this.runFunction(e.args,t,this.metadata("DDB"),(e,t,n,r,i)=>{if(r>n)return new lr(Bn.NUM);let o,s=i/n;s>=1?(s=1,o=1===r?e:0):o=e*Math.pow(1-s,r-1);const a=e*Math.pow(1-s,r);return Math.max(o-Math.max(t,a),0)})}dollarde(e,t){return this.runFunction(e.args,t,this.metadata("DOLLARDE"),(e,t)=>{if(t<1)return new lr(Bn.DIV_BY_ZERO);t=Math.trunc(t);while(t>10)t/=10;return Math.trunc(e)+10*(e-Math.trunc(e))/t})}dollarfr(e,t){return this.runFunction(e.args,t,this.metadata("DOLLARFR"),(e,t)=>{if(t<1)return new lr(Bn.DIV_BY_ZERO);t=Math.trunc(t);while(t>10)t/=10;return Math.trunc(e)+(e-Math.trunc(e))*t/10})}effect(e,t){return this.runFunction(e.args,t,this.metadata("EFFECT"),(e,t)=>(t=Math.trunc(t),Math.pow(1+e/t,t)-1))}ispmt(e,t){return this.runFunction(e.args,t,this.metadata("ISPMT"),(e,t,n,r)=>0===n?new lr(Bn.DIV_BY_ZERO):r*e*(t/n-1))}nominal(e,t){return this.runFunction(e.args,t,this.metadata("NOMINAL"),(e,t)=>(t=Math.trunc(t),(Math.pow(e+1,1/t)-1)*t))}nper(e,t){return this.runFunction(e.args,t,this.metadata("NPER"),(e,t,n,r,i)=>0===e?0===t?new lr(Bn.DIV_BY_ZERO):(-n-r)/t:(i&&(t*=1+e),Math.log((t-r*e)/(n*e+t))/Math.log(1+e)))}rate(e,t){return this.runFunction(e.args,t,this.metadata("RATE"),(e,t,n,r,i,o)=>{if(o<=-1)return new lr(Bn.VALUE);const s=1e-7,a=50;let l=o;i=i?1:0;for(let c=0;c<a;c++){if(l<=-1)return new lr(Bn.NUM);let o,a;if(Math.abs(l)<s)o=n*(1+e*l)+t*(1+l*i)*e+r;else{const s=Math.pow(1+l,e);o=n*s+t*(1/l+i)*(s-1)+r}if(Math.abs(o)<s)return l;if(Math.abs(l)<s)a=n*e+t*i*e;else{const r=Math.pow(1+l,e),o=e*Math.pow(1+l,e-1);a=n*o+t*(1/l+i)*o+t*(-1/(l*l))*(r-1)}l-=o/a}return new lr(Bn.NUM)})}pv(e,t){return this.runFunction(e.args,t,this.metadata("PV"),(e,t,n,r,i)=>(i=i?1:0,-1===e?new lr(0===t?Bn.NUM:Bn.DIV_BY_ZERO):0===e?-n*t-r:((1-Math.pow(1+e,t))*n*(1+e*i)/e-r)/Math.pow(1+e,t)))}rri(e,t){return this.runFunction(e.args,t,this.metadata("RRI"),(e,t,n)=>0===t||n<0&&t>0||n>0&&t<0?new lr(Bn.NUM):Math.pow(n/t,1/e)-1)}sln(e,t){return this.runFunction(e.args,t,this.metadata("SLN"),(e,t,n)=>0===n?new lr(Bn.DIV_BY_ZERO):(e-t)/n)}syd(e,t){return this.runFunction(e.args,t,this.metadata("SYD"),(e,t,n,r)=>r>n?new lr(Bn.NUM):(e-t)*(n-r+1)*2/(n*(n+1)))}tbilleq(e,t){return this.runFunction(e.args,t,this.metadata("TBILLEQ"),(e,t,n)=>{if(e=Math.round(e),t=Math.round(t),e>=t)return new lr(Bn.NUM);const r=this.dateTimeHelper.numberToSimpleDate(e),i=this.dateTimeHelper.numberToSimpleDate(t);if(i.year>r.year+1||i.year===r.year+1&&(i.month>r.month||i.month===r.month&&i.day>r.day))return new lr(Bn.NUM);const o=360-n*(t-e);return 0===o?0:o<0?new lr(Bn.NUM):365*n/o})}tbillprice(e,t){return this.runFunction(e.args,t,this.metadata("TBILLPRICE"),(e,t,n)=>{if(e=Math.round(e),t=Math.round(t),e>=t)return new lr(Bn.NUM);const r=this.dateTimeHelper.numberToSimpleDate(e),i=this.dateTimeHelper.numberToSimpleDate(t);if(i.year>r.year+1||i.year===r.year+1&&(i.month>r.month||i.month===r.month&&i.day>r.day))return new lr(Bn.NUM);const o=360-n*(t-e);return 0===o?0:o<0?new lr(Bn.NUM):100*(1-n*(t-e)/360)})}tbillyield(e,t){return this.runFunction(e.args,t,this.metadata("TBILLYIELD"),(e,t,n)=>{if(e=Math.round(e),t=Math.round(t),e>=t)return new lr(Bn.NUM);const r=this.dateTimeHelper.numberToSimpleDate(e),i=this.dateTimeHelper.numberToSimpleDate(t);return i.year>r.year+1||i.year===r.year+1&&(i.month>r.month||i.month===r.month&&i.day>r.day)?new lr(Bn.NUM):360*(100-n)/(n*(t-e))})}fvschedule(e,t){return this.runFunction(e.args,t,this.metadata("FVSCHEDULE"),(e,t)=>{const n=t.valuesFromTopLeftCorner();for(const r of n)if(r instanceof lr)return r;for(const r of n)if(Mt(r))e*=1+Ct(r);else if(r!==Et)return new lr(Bn.VALUE,Ne.NumberExpected);return e})}npv(e,t){return this.runFunction(e.args,t,this.metadata("NPV"),(e,...t)=>{const n=this.arithmeticHelper.coerceNumbersExactRanges(t);return n instanceof lr?n:Ka(e,n)})}mirr(e,t){return this.runFunction(e.args,t,this.metadata("MIRR"),(e,t,n)=>{const r=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());if(r instanceof lr)return r;let i=!1,o=!1;const s=[],a=[];for(const u of r)u>0?(i=!0,s.push(u),a.push(0)):u<0?(o=!0,a.push(u),s.push(0)):(a.push(0),s.push(0));if(!i||!o)return new lr(Bn.DIV_BY_ZERO);const l=r.length,c=Ka(n,s);if(c instanceof lr)return c;const h=Ka(t,a);return h instanceof lr?h:Math.pow(-c*Math.pow(1+n,l)/h/(1+t),1/(l-1))-1})}pduration(e,t){return this.runFunction(e.args,t,this.metadata("PDURATION"),(e,t,n)=>(Math.log(n)-Math.log(t))/Math.log(1+e))}xnpv(e,t){return this.runFunction(e.args,t,this.metadata("XNPV"),(e,t,n)=>{const r=t.valuesFromTopLeftCorner();for(const c of r)if("number"!==typeof c)return new lr(Bn.VALUE,Ne.NumberExpected);const i=r,o=n.valuesFromTopLeftCorner();for(const c of o)if("number"!==typeof c)return new lr(Bn.VALUE,Ne.NumberExpected);const s=o;if(s.length!==i.length)return new lr(Bn.NUM,Ne.EqualLength);const a=s.length;let l=0;if(s[0]<0)return new lr(Bn.NUM,Ne.ValueSmall);for(let c=0;c<a;c++){if(s[c]=Math.floor(s[c]),s[c]<s[0])return new lr(Bn.NUM,Ne.ValueSmall);l+=i[c]/Math.pow(1+e,(s[c]-s[0])/365)}return l})}}function Ga(e,t,n,r,i){if(0===e)return(-n-r)/t;{const o=Math.pow(1+e,t);return(r*e+n*e*o)*(i?1/(1+e):1)/(1-o)}}function za(e,t,n,r,i,o){const s=Ga(e,n,r,i,o);return 1===t?e*(o?0:-r):e*(o?Ya(e,t-2,s,r,o)-s:Ya(e,t-1,s,r,o))}function Ya(e,t,n,r,i){if(0===e)return-r-n*t;{const o=Math.pow(1+e,t);return n*(i?1+e:1)*(1-o)/e-r*o}}function Xa(e,t,n,r,i,o){return Ga(e,n,r,i,o)-za(e,t,n,r,i,o)}function Ka(e,t){let n=0;for(let r=t.length-1;r>=0;r--){if(n+=t[r],-1===e){if(0===n)continue;return new lr(Bn.DIV_BY_ZERO)}n/=1+e}return n}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */Wa.implementedFunctions={PMT:{method:"pmt",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,defaultValue:0},{argumentType:Zr.NUMBER,defaultValue:0}],returnNumberType:xt.NUMBER_CURRENCY},IPMT:{method:"ipmt",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,defaultValue:0},{argumentType:Zr.NUMBER,defaultValue:0}],returnNumberType:xt.NUMBER_CURRENCY},PPMT:{method:"ppmt",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,defaultValue:0},{argumentType:Zr.NUMBER,defaultValue:0}],returnNumberType:xt.NUMBER_CURRENCY},FV:{method:"fv",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,defaultValue:0},{argumentType:Zr.NUMBER,defaultValue:0}],returnNumberType:xt.NUMBER_CURRENCY},CUMIPMT:{method:"cumipmt",parameters:[{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.INTEGER,minValue:1},{argumentType:Zr.INTEGER,minValue:1},{argumentType:Zr.INTEGER,minValue:0,maxValue:1}],returnNumberType:xt.NUMBER_CURRENCY},CUMPRINC:{method:"cumprinc",parameters:[{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.INTEGER,minValue:1},{argumentType:Zr.INTEGER,minValue:1},{argumentType:Zr.INTEGER,minValue:0,maxValue:1}],returnNumberType:xt.NUMBER_CURRENCY},DB:{method:"db",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.INTEGER,minValue:0},{argumentType:Zr.INTEGER,minValue:0},{argumentType:Zr.INTEGER,minValue:1,maxValue:12,defaultValue:12}],returnNumberType:xt.NUMBER_CURRENCY},DDB:{method:"ddb",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.INTEGER,minValue:0},{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,greaterThan:0,defaultValue:2}],returnNumberType:xt.NUMBER_CURRENCY},DOLLARDE:{method:"dollarde",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,minValue:0}]},DOLLARFR:{method:"dollarfr",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,minValue:0}]},EFFECT:{method:"effect",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:1}],returnNumberType:xt.NUMBER_PERCENT},ISPMT:{method:"ispmt",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER}]},NOMINAL:{method:"nominal",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:1}],returnNumberType:xt.NUMBER_PERCENT},NPER:{method:"nper",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,defaultValue:0},{argumentType:Zr.NUMBER,defaultValue:0}]},PV:{method:"pv",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,defaultValue:0},{argumentType:Zr.NUMBER,defaultValue:0}],returnNumberType:xt.NUMBER_CURRENCY},RATE:{method:"rate",parameters:[{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,defaultValue:0},{argumentType:Zr.NUMBER,defaultValue:0},{argumentType:Zr.NUMBER,defaultValue:.1}],returnNumberType:xt.NUMBER_PERCENT},RRI:{method:"rri",parameters:[{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER}],returnNumberType:xt.NUMBER_PERCENT},SLN:{method:"sln",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER}],returnNumberType:xt.NUMBER_CURRENCY},SYD:{method:"syd",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,greaterThan:0}],returnNumberType:xt.NUMBER_CURRENCY},TBILLEQ:{method:"tbilleq",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,greaterThan:0}],returnNumberType:xt.NUMBER_PERCENT},TBILLPRICE:{method:"tbillprice",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,greaterThan:0}],returnNumberType:xt.NUMBER_CURRENCY},TBILLYIELD:{method:"tbillyield",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,greaterThan:0}],returnNumberType:xt.NUMBER_PERCENT},FVSCHEDULE:{method:"fvschedule",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.RANGE}],returnNumberType:xt.NUMBER_CURRENCY},NPV:{method:"npv",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.ANY}],repeatLastArgs:1,returnNumberType:xt.NUMBER_CURRENCY},MIRR:{method:"mirr",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER}],returnNumberType:xt.NUMBER_PERCENT},PDURATION:{method:"pduration",parameters:[{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,greaterThan:0}]},XNPV:{method:"xnpv",parameters:[{argumentType:Zr.NUMBER,greaterThan:-1},{argumentType:Zr.RANGE},{argumentType:Zr.RANGE}]}};class $a extends Jr{formulatext(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("FORMULATEXT"),()=>new lr(Bn.NA,Ne.WrongArgNumber),e=>{var t;return null!==(t=this.serialization.getCellFormula(e))&&void 0!==t?t:new lr(Bn.NA,Ne.Formula)})}}$a.implementedFunctions={FORMULATEXT:{method:"formulatext",parameters:[{argumentType:Zr.NOERROR}],doesNotNeedArgumentsToBeComputed:!0,isDependentOnSheetStructureChange:!0,vectorizationForbidden:!0}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class qa extends Jr{hyperlink(e,t){return this.runFunction(e.args,t,this.metadata("HYPERLINK"),(t,n)=>(e.hyperlink=t,null!==n&&void 0!==n?n:t))}}qa.implementedFunctions={HYPERLINK:{method:"hyperlink",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.STRING,optionalArg:!0}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class Qa extends Jr{isbinary(e,t){return this.runFunction(e.args,t,this.metadata("ISBINARY"),e=>/^[01]{1,10}$/.test(e))}iserr(e,t){return this.runFunction(e.args,t,this.metadata("ISERR"),e=>e instanceof lr&&e.type!==Bn.NA)}iserror(e,t){return this.runFunction(e.args,t,this.metadata("ISERROR"),e=>e instanceof lr)}isformula(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("ISFORMULA"),()=>new lr(Bn.NA,Ne.WrongArgNumber),e=>{const t=this.dependencyGraph.addressMapping.getCell(e);return t instanceof On})}isblank(e,t){return this.runFunction(e.args,t,this.metadata("ISBLANK"),e=>e===Et)}isna(e,t){return this.runFunction(e.args,t,this.metadata("ISNA"),e=>e instanceof lr&&e.type==Bn.NA)}isnumber(e,t){return this.runFunction(e.args,t,this.metadata("ISNUMBER"),Mt)}islogical(e,t){return this.runFunction(e.args,t,this.metadata("ISLOGICAL"),e=>"boolean"===typeof e)}isref(e,t){return this.runFunction(e.args,t,this.metadata("ISREF"),e=>e instanceof lr&&(e.type==Bn.REF||e.type==Bn.CYCLE))}istext(e,t){return this.runFunction(e.args,t,this.metadata("ISTEXT"),e=>"string"===typeof e)}isnontext(e,t){return this.runFunction(e.args,t,this.metadata("ISNONTEXT"),e=>!("string"===typeof e))}column(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("COLUMN"),()=>t.formulaAddress.col+1,e=>e.col+1)}columns(e,t){if(1!==e.args.length)return new lr(Bn.NA,Ne.WrongArgNumber);if(e.args.some(e=>e.type===G.EMPTY))return new lr(Bn.NUM,Ne.EmptyArg);let n=e.args[0];while(n.type===G.PARENTHESIS)n=n.expression;if(n.type===G.CELL_RANGE||n.type===G.COLUMN_RANGE)return n.end.col-n.start.col+1;if(n.type===G.CELL_REFERENCE)return 1;if(n.type===G.ROW_RANGE)return this.config.maxColumns;{const e=this.evaluateAst(n,t);return e instanceof jt?e.width():e instanceof lr?e:1}}row(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("ROW"),()=>t.formulaAddress.row+1,e=>e.row+1)}rows(e,t){if(1!==e.args.length)return new lr(Bn.NA,Ne.WrongArgNumber);if(e.args.some(e=>e.type===G.EMPTY))return new lr(Bn.NUM,Ne.EmptyArg);let n=e.args[0];while(n.type===G.PARENTHESIS)n=n.expression;if(n.type===G.CELL_RANGE||n.type===G.ROW_RANGE)return n.end.row-n.start.row+1;if(n.type===G.CELL_REFERENCE)return 1;if(n.type===G.COLUMN_RANGE)return this.config.maxRows;{const e=this.evaluateAst(n,t);return e instanceof jt?e.height():e instanceof lr?e:1}}index(e,t){return this.runFunction(e.args,t,this.metadata("INDEX"),(e,t,n)=>{var r,i,o,s,a,l;return n<1||t<1?new lr(Bn.VALUE,Ne.LessThanOne):n>e.width()||t>e.height()?new lr(Bn.NUM,Ne.ValueLarge):null!==(l=null!==(o=null===(i=null===(r=null===e||void 0===e?void 0:e.data)||void 0===r?void 0:r[t-1])||void 0===i?void 0:i[n-1])&&void 0!==o?o:null===(a=null===(s=null===e||void 0===e?void 0:e.data)||void 0===s?void 0:s[0])||void 0===a?void 0:a[0])&&void 0!==l?l:new lr(Bn.VALUE,Ne.CellRangeExpected)})}na(e,t){return new lr(Bn.NA)}sheet(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("SHEET"),()=>t.formulaAddress.sheet+1,e=>e.sheet+1,e=>{const t=this.dependencyGraph.sheetMapping.get(e);return void 0!==t?t+1:new lr(Bn.NA,Ne.SheetRef)})}sheets(e,t){return this.runFunctionWithReferenceArgument(e.args,t,this.metadata("SHEETS"),()=>this.dependencyGraph.sheetMapping.numberOfSheets(),()=>1,()=>new lr(Bn.VALUE,Ne.CellRefExpected))}}Qa.implementedFunctions={COLUMN:{method:"column",parameters:[{argumentType:Zr.NOERROR,optionalArg:!0}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},COLUMNS:{method:"columns",parameters:[{argumentType:Zr.RANGE}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},ISBINARY:{method:"isbinary",parameters:[{argumentType:Zr.STRING}]},ISERR:{method:"iserr",parameters:[{argumentType:Zr.SCALAR}]},ISFORMULA:{method:"isformula",parameters:[{argumentType:Zr.NOERROR}],doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},ISNA:{method:"isna",parameters:[{argumentType:Zr.SCALAR}]},ISREF:{method:"isref",parameters:[{argumentType:Zr.SCALAR}],vectorizationForbidden:!0},ISERROR:{method:"iserror",parameters:[{argumentType:Zr.SCALAR}]},ISBLANK:{method:"isblank",parameters:[{argumentType:Zr.SCALAR}]},ISNUMBER:{method:"isnumber",parameters:[{argumentType:Zr.SCALAR}]},ISLOGICAL:{method:"islogical",parameters:[{argumentType:Zr.SCALAR}]},ISTEXT:{method:"istext",parameters:[{argumentType:Zr.SCALAR}]},ISNONTEXT:{method:"isnontext",parameters:[{argumentType:Zr.SCALAR}]},INDEX:{method:"index",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,defaultValue:1}]},NA:{method:"na",parameters:[]},ROW:{method:"row",parameters:[{argumentType:Zr.NOERROR,optionalArg:!0}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},ROWS:{method:"rows",parameters:[{argumentType:Zr.RANGE}],isDependentOnSheetStructureChange:!0,doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},SHEET:{method:"sheet",parameters:[{argumentType:Zr.STRING}],doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0},SHEETS:{method:"sheets",parameters:[{argumentType:Zr.STRING}],doesNotNeedArgumentsToBeComputed:!0,vectorizationForbidden:!0}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class Za extends Jr{iseven(e,t){return this.runFunction(e.args,t,this.metadata("ISEVEN"),e=>e%2===0)}}Za.implementedFunctions={ISEVEN:{method:"iseven",parameters:[{argumentType:Zr.NUMBER}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class Ja extends Jr{isodd(e,t){return this.runFunction(e.args,t,this.metadata("ISODD"),e=>e%2===1)}}Ja.implementedFunctions={ISODD:{method:"isodd",parameters:[{argumentType:Zr.NUMBER}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class el extends Jr{log10(e,t){return this.runFunction(e.args,t,this.metadata("LOG10"),Math.log10)}log(e,t){return this.runFunction(e.args,t,this.metadata("LOG"),(e,t)=>Math.log(e)/Math.log(t))}ln(e,t){return this.runFunction(e.args,t,this.metadata("LN"),Math.log)}}el.implementedFunctions={LOG10:{method:"log10",parameters:[{argumentType:Zr.NUMBER}]},LOG:{method:"log",parameters:[{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,defaultValue:10,greaterThan:0}]},LN:{method:"ln",parameters:[{argumentType:Zr.NUMBER}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- const tl=parseFloat(Math.PI.toFixed(14));class nl extends Jr{pi(e,t){return this.runFunction(e.args,t,this.metadata("PI"),()=>tl)}sqrtpi(e,t){return this.runFunction(e.args,t,this.metadata("SQRTPI"),e=>Math.sqrt(tl*e))}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- function rl(e,t){return new ei(t.width,e.height)}function il(e,t,n){return new ei(1+(e.width-t)/n,1+(e.height-t)/n)}nl.implementedFunctions={PI:{method:"pi",parameters:[]},SQRTPI:{method:"sqrtpi",parameters:[{argumentType:Zr.NUMBER,minValue:0}]}};class ol extends Jr{mmult(e,t){return this.runFunction(e.args,t,this.metadata("MMULT"),(e,t)=>{if(!e.hasOnlyNumbers()||!t.hasOnlyNumbers())return new lr(Bn.VALUE,Ne.NumberRange);if(t.height()!==e.width())return new lr(Bn.VALUE,Ne.ArrayDimensions);const n=rl(e.size,t.size),r=this.createKernel((function(e,t,n){let r=0;for(let i=0;i<n;++i)r+=e[this.thread.y][i]*t[i][this.thread.x];return r}),n)(e.rawNumbers(),t.rawNumbers(),e.width());return jt.onlyNumbers(r)})}mmultArraySize(e,t){if(2!==e.args.length)return ei.error();const n=this.metadata("MMULT"),r=e.args.map(e=>{var r;return this.arraySizeForAst(e,new Or(t.formulaAddress,t.arraysFlag||null!==(r=null===n||void 0===n?void 0:n.arrayFunction)&&void 0!==r&&r))}),[i,o]=r;return rl(i,o)}maxpool(e,t){return this.runFunction(e.args,t,this.metadata("MAXPOOL"),(e,t,n=t)=>{if(!e.hasOnlyNumbers())return new lr(Bn.VALUE,Ne.NumberRange);const r=il(e.size,t,n),i=this.createKernel((function(e,t,n){const r=this.thread.x*n,i=this.thread.y*n;let o=e[i][r];for(let s=0;s<t;s++)for(let n=0;n<t;n++)o=Math.max(o,e[i+s][r+n]);return o}),r)(e.rawNumbers(),t,n);return jt.onlyNumbers(i)})}medianpool(e,t){return this.runFunction(e.args,t,this.metadata("MEDIANPOOL"),(e,t,n=t)=>{if(!e.hasOnlyNumbers())return new lr(Bn.VALUE,Ne.NumberRange);const r=il(e.size,t,n),i=this.createKernel((function(e,t,n){const r=this.thread.x*n,i=this.thread.y*n;let o=e[i][r];for(let u=0;u<t;u++)for(let n=0;n<t;n++)o=Math.max(o,e[i+u][r+n]);let s=e[i][r];for(let u=0;u<t;u++)for(let n=0;n<t;n++)s=Math.min(s,e[i+u][r+n]);const a=t*t;let l=s,c=o,h=42;for(let u=0;u<32;u++){const n=(l+c)/2;let o=0;for(let s=0;s<t;s++)for(let a=0;a<t;a++)e[i+s][r+a]>n&&o++;if(t%2===0){if(o===a/2){h=n;break}o>a/2?l=n:c=n}else{if(o===(a-1)/2){h=n;break}o>(a-1)/2?l=n:c=n}}return h}),r)(e.rawNumbers(),t,n);return jt.onlyNumbers(i)})}maxpoolArraySize(e,t){if(e.args.length<2||e.args.length>3)return ei.error();const n=this.metadata("MAXPOOL"),r=e.args.map(e=>{var r;return this.arraySizeForAst(e,new Or(t.formulaAddress,t.arraysFlag||null!==(r=null===n||void 0===n?void 0:n.arrayFunction)&&void 0!==r&&r))}),i=r[0],o=e.args[1];let s;s=o.type===G.NUMBER?o.value:1;let a=s;if(3===e.args.length){const t=e.args[2];a=t.type===G.NUMBER?t.value:1}return s>i.width||s>i.height||a>s||(i.width-s)%a!==0||(i.height-s)%a!==0?ei.error():il(i,s,a)}medianpoolArraySize(e,t){return this.maxpoolArraySize(e,t)}transpose(e,t){return this.runFunction(e.args,t,this.metadata("TRANSPOSE"),e=>{const t=e.rawData(),n=e.size,r=[];for(let i=0;i<n.width;++i){r[i]=[];for(let e=0;e<n.height;++e)r[i][e]=t[e][i]}return jt.onlyValues(r)})}transposeArraySize(e,t){if(1!==e.args.length)return ei.error();const n=this.metadata("TRANSPOSE"),r=e.args.map(e=>{var r;return this.arraySizeForAst(e,new Or(t.formulaAddress,t.arraysFlag||null!==(r=null===n||void 0===n?void 0:n.arrayFunction)&&void 0!==r&&r))}),[i]=r;return new ei(i.height,i.width)}createKernel(e,t){return function(...n){const r=[];for(let i=0;i<t.height;++i){r.push([]);for(let o=0;o<t.width;++o)r[i][o]=e.apply({thread:{x:o,y:i}},n)}return r}}}ol.implementedFunctions={MMULT:{method:"mmult",arraySizeMethod:"mmultArraySize",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.RANGE}],vectorizationForbidden:!0},TRANSPOSE:{method:"transpose",arraySizeMethod:"transposeArraySize",parameters:[{argumentType:Zr.RANGE}],vectorizationForbidden:!0},MAXPOOL:{method:"maxpool",arraySizeMethod:"maxpoolArraySize",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,optionalArg:!0}],vectorizationForbidden:!0},MEDIANPOOL:{method:"medianpool",arraySizeMethod:"medianpoolArraySize",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,optionalArg:!0}],vectorizationForbidden:!0}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class sl extends Jr{median(e,t){return this.runFunction(e.args,t,this.metadata("MEDIAN"),(...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);return t instanceof lr?t:0===t.length?new lr(Bn.NUM,Ne.OneValue):(t.sort((e,t)=>e-t),t.length%2===0?(t[t.length/2-1]+t[t.length/2])/2:t[Math.floor(t.length/2)])})}large(e,t){return this.runFunction(e.args,t,this.metadata("LARGE"),(e,t)=>{const n=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());return n instanceof lr?n:(n.sort((e,t)=>e-t),t=Math.trunc(t),t>n.length?new lr(Bn.NUM,Ne.ValueLarge):n[n.length-t])})}small(e,t){return this.runFunction(e.args,t,this.metadata("SMALL"),(e,t)=>{const n=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());return n instanceof lr?n:(n.sort((e,t)=>e-t),t=Math.trunc(t),t>n.length?new lr(Bn.NUM,Ne.ValueLarge):n[t-1])})}}sl.implementedFunctions={MEDIAN:{method:"median",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},LARGE:{method:"large",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.NUMBER,minValue:1}]},SMALL:{method:"small",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.NUMBER,minValue:1}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class al extends Jr{mod(e,t){return this.runFunction(e.args,t,this.metadata("MOD"),(e,t)=>0===t?new lr(Bn.DIV_BY_ZERO):e%t)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- function ll(e){return Mt(e)&&!Number.isFinite(Ct(e))?0:e}al.implementedFunctions={MOD:{method:"mod",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER}]}};class cl{constructor(e,t,n){this.sumsq=e,this.sum=t,this.count=n}static single(e){return new cl(e*e,e,1)}compose(e){return new cl(this.sumsq+e.sumsq,this.sum+e.sum,this.count+e.count)}averageValue(){return this.count>0?this.sum/this.count:void 0}varSValue(){return this.count>1?(this.sumsq-this.sum*this.sum/this.count)/(this.count-1):void 0}varPValue(){return this.count>0?(this.sumsq-this.sum*this.sum/this.count)/this.count:void 0}}cl.empty=new cl(0,0,0);class hl extends Jr{constructor(){super(...arguments),this.addWithEpsilonRaw=(e,t)=>this.arithmeticHelper.addWithEpsilonRaw(e,t)}sum(e,t){return this.doSum(e.args,t)}sumsq(e,t){return this.reduce(e.args,t,0,"SUMSQ",this.addWithEpsilonRaw,e=>Math.pow(Ct(e),2),ul)}max(e,t){return this.doMax(e.args,t)}maxa(e,t){const n=this.reduce(e.args,t,Number.NEGATIVE_INFINITY,"MAXA",(e,t)=>Math.max(e,t),Ct,dl);return ll(n)}min(e,t){return this.doMin(e.args,t)}mina(e,t){const n=this.reduce(e.args,t,Number.POSITIVE_INFINITY,"MINA",(e,t)=>Math.min(e,t),Ct,dl);return ll(n)}count(e,t){return this.doCount(e.args,t)}counta(e,t){return this.doCounta(e.args,t)}average(e,t){return this.doAverage(e.args,t)}averagea(e,t){var n;const r=this.reduce(e.args,t,cl.empty,"_AGGREGATE_A",(e,t)=>e.compose(t),e=>cl.single(Ct(e)),dl);return r instanceof lr?r:null!==(n=r.averageValue())&&void 0!==n?n:new lr(Bn.DIV_BY_ZERO)}vars(e,t){return this.doVarS(e.args,t)}varp(e,t){return this.doVarP(e.args,t)}vara(e,t){var n;const r=this.reduceAggregateA(e.args,t);return r instanceof lr?r:null!==(n=r.varSValue())&&void 0!==n?n:new lr(Bn.DIV_BY_ZERO)}varpa(e,t){var n;const r=this.reduceAggregateA(e.args,t);return r instanceof lr?r:null!==(n=r.varPValue())&&void 0!==n?n:new lr(Bn.DIV_BY_ZERO)}stdevs(e,t){return this.doStdevS(e.args,t)}stdevp(e,t){return this.doStdevP(e.args,t)}stdeva(e,t){const n=this.reduceAggregateA(e.args,t);if(n instanceof lr)return n;{const e=n.varSValue();return void 0===e?new lr(Bn.DIV_BY_ZERO):Math.sqrt(e)}}stdevpa(e,t){const n=this.reduceAggregateA(e.args,t);if(n instanceof lr)return n;{const e=n.varPValue();return void 0===e?new lr(Bn.DIV_BY_ZERO):Math.sqrt(e)}}product(e,t){return this.doProduct(e.args,t)}subtotal(e,t){if(e.args.length<2)return new lr(Bn.NA,Ne.WrongArgNumber);const n=this.coerceToType(this.evaluateAst(e.args[0],t),{argumentType:Zr.NUMBER},t),r=e.args.slice(1);switch(n){case 1:case 101:return this.doAverage(r,t);case 2:case 102:return this.doCount(r,t);case 3:case 103:return this.doCounta(r,t);case 4:case 104:return this.doMax(r,t);case 5:case 105:return this.doMin(r,t);case 6:case 106:return this.doProduct(r,t);case 7:case 107:return this.doStdevS(r,t);case 8:case 108:return this.doStdevP(r,t);case 9:case 109:return this.doSum(r,t);case 10:case 110:return this.doVarS(r,t);case 11:case 111:return this.doVarP(r,t);default:return new lr(Bn.VALUE,Ne.BadMode)}}reduceAggregate(e,t){return this.reduce(e,t,cl.empty,"_AGGREGATE",(e,t)=>e.compose(t),e=>cl.single(Ct(e)),ul)}reduceAggregateA(e,t){return this.reduce(e,t,cl.empty,"_AGGREGATE_A",(e,t)=>e.compose(t),e=>cl.single(Ct(e)),dl)}doAverage(e,t){var n;const r=this.reduceAggregate(e,t);return r instanceof lr?r:null!==(n=r.averageValue())&&void 0!==n?n:new lr(Bn.DIV_BY_ZERO)}doVarS(e,t){var n;const r=this.reduceAggregate(e,t);return r instanceof lr?r:null!==(n=r.varSValue())&&void 0!==n?n:new lr(Bn.DIV_BY_ZERO)}doVarP(e,t){var n;const r=this.reduceAggregate(e,t);return r instanceof lr?r:null!==(n=r.varPValue())&&void 0!==n?n:new lr(Bn.DIV_BY_ZERO)}doStdevS(e,t){const n=this.reduceAggregate(e,t);if(n instanceof lr)return n;{const e=n.varSValue();return void 0===e?new lr(Bn.DIV_BY_ZERO):Math.sqrt(e)}}doStdevP(e,t){const n=this.reduceAggregate(e,t);if(n instanceof lr)return n;{const e=n.varPValue();return void 0===e?new lr(Bn.DIV_BY_ZERO):Math.sqrt(e)}}doCount(e,t){return this.reduce(e,t,0,"COUNT",(e,t)=>e+t,Ct,e=>Mt(e)?1:0)}doCounta(e,t){return this.reduce(e,t,0,"COUNTA",(e,t)=>e+t,Ct,e=>e===Et?0:1)}doMax(e,t){const n=this.reduce(e,t,Number.NEGATIVE_INFINITY,"MAX",(e,t)=>Math.max(e,t),Ct,ul);return ll(n)}doMin(e,t){const n=this.reduce(e,t,Number.POSITIVE_INFINITY,"MIN",(e,t)=>Math.min(e,t),Ct,ul);return ll(n)}doSum(e,t){return this.reduce(e,t,0,"SUM",this.addWithEpsilonRaw,Ct,ul)}doProduct(e,t){return this.reduce(e,t,1,"PRODUCT",(e,t)=>e*t,Ct,ul)}reduce(e,t,n,r,i,o,s){return e.length<1?new lr(Bn.NA,Ne.WrongArgNumber):e.reduce((e,a)=>{if(e instanceof lr)return e;if(a.type===G.CELL_RANGE||a.type===G.COLUMN_RANGE||a.type===G.ROW_RANGE){const l=this.evaluateRange(a,t,n,r,i,o,s);return l instanceof lr?l:i(l,e)}let l;if(l=this.evaluateAst(a,t),l instanceof jt){const t=Array.from(l.valuesFromTopLeftCorner()).map(s).filter(e=>void 0!==e);return t.map(e=>e instanceof lr?e:o(e)).reduce((e,t)=>e instanceof lr?e:t instanceof lr?t:i(e,t),e)}if(a.type===G.CELL_REFERENCE){if(l=s(l),void 0===l)return e}else if(l=this.coerceScalarToNumberOrError(l),l=s(l),void 0===l)return e;return l instanceof lr?l:i(e,o(l))},n)}evaluateRange(e,t,n,r,i,o,s){let a;try{a=Sr.fromAst(e,t.formulaAddress)}catch(h){if(h instanceof $t)return new lr(Bn.REF,Ne.RangeManySheets);throw h}const l=this.dependencyGraph.getRange(a.start,a.end);if(void 0===l)throw new Error("Range does not exists in graph");let c=l.getFunctionValue(r);if(void 0===c){const e=this.getRangeValues(r,a,l,o,s);c=e.reduce((e,t)=>e instanceof lr?e:t instanceof lr?t:i(e,t),n),l.setFunctionValue(r,c)}return c}getRangeValues(e,t,n,r,i){const o=[],{smallerRangeVertex:s,restRange:a}=this.dependencyGraph.rangeMapping.findSmallerRange(t);let l;if(void 0!==s&&this.dependencyGraph.existsEdge(s,n)){const t=s.getFunctionValue(e);if(void 0!==t)o.push(t);else for(const e of s.range.addresses(this.dependencyGraph)){const t=i(this.dependencyGraph.getScalarValue(e));t instanceof lr?o.push(t):void 0!==t&&o.push(r(t))}l=a}else l=t;for(const c of l.addresses(this.dependencyGraph)){const e=i(this.dependencyGraph.getScalarValue(c));e instanceof lr?o.push(e):void 0!==e&&o.push(r(e))}return o}}function ul(e){return Mt(e)||e instanceof lr?e:void 0}function dl(e){return"boolean"===typeof e?Lr(e):Mt(e)||e instanceof lr?e:"string"===typeof e?0:void 0}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */hl.implementedFunctions={SUM:{method:"sum",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},SUMSQ:{method:"sumsq",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},MAX:{method:"max",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},MIN:{method:"min",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},MAXA:{method:"maxa",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},MINA:{method:"mina",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},COUNT:{method:"count",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},COUNTA:{method:"counta",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},AVERAGE:{method:"average",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},AVERAGEA:{method:"averagea",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},PRODUCT:{method:"product",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},"VAR.S":{method:"vars",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},"VAR.P":{method:"varp",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},VARA:{method:"vara",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},VARPA:{method:"varpa",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},"STDEV.S":{method:"stdevs",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},"STDEV.P":{method:"stdevp",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},STDEVA:{method:"stdeva",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},STDEVPA:{method:"stdevpa",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},SUBTOTAL:{method:"subtotal",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.ANY}],repeatLastArgs:1}},hl.aliases={VAR:"VAR.S",VARP:"VAR.P",STDEV:"STDEV.S",STDEVP:"STDEV.P",VARS:"VAR.S",STDEVS:"STDEV.S"};class pl extends Jr{power(e,t){return this.runFunction(e.args,t,this.metadata("POWER"),Math.pow)}}pl.implementedFunctions={POWER:{method:"power",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class fl extends Jr{radians(e,t){return this.runFunction(e.args,t,this.metadata("RADIANS"),e=>e*(Math.PI/180))}}fl.implementedFunctions={RADIANS:{method:"radians",parameters:[{argumentType:Zr.NUMBER}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- const gl=10,ml=255,yl=2,wl=36,bl="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";class vl extends Jr{dec2bin(e,t){return this.runFunction(e.args,t,this.metadata("DEC2BIN"),(e,t)=>Cl(e,2,t))}dec2oct(e,t){return this.runFunction(e.args,t,this.metadata("DEC2OCT"),(e,t)=>Cl(e,8,t))}dec2hex(e,t){return this.runFunction(e.args,t,this.metadata("DEC2HEX"),(e,t)=>Cl(e,16,t))}bin2dec(e,t){return this.runFunction(e.args,t,this.metadata("BIN2DEC"),e=>{const t=El(e,2,gl);return void 0===t?new lr(Bn.NUM,Ne.NotBinary):Nl(t,2)})}bin2oct(e,t){return this.runFunction(e.args,t,this.metadata("BIN2OCT"),(e,t)=>{const n=El(e,2,gl);return void 0===n?new lr(Bn.NUM,Ne.NotBinary):Cl(Nl(n,2),8,t)})}bin2hex(e,t){return this.runFunction(e.args,t,this.metadata("BIN2HEX"),(e,t)=>{const n=El(e,2,gl);return void 0===n?new lr(Bn.NUM,Ne.NotBinary):Cl(Nl(n,2),16,t)})}oct2dec(e,t){return this.runFunction(e.args,t,this.metadata("OCT2DEC"),e=>{const t=El(e,8,gl);return void 0===t?new lr(Bn.NUM,Ne.NotOctal):Nl(t,8)})}oct2bin(e,t){return this.runFunction(e.args,t,this.metadata("OCT2BIN"),(e,t)=>{const n=El(e,8,gl);return void 0===n?new lr(Bn.NUM,Ne.NotOctal):Cl(Nl(n,8),2,t)})}oct2hex(e,t){return this.runFunction(e.args,t,this.metadata("OCT2HEX"),(e,t)=>{const n=El(e,8,gl);return void 0===n?new lr(Bn.NUM,Ne.NotOctal):Cl(Nl(n,8),16,t)})}hex2dec(e,t){return this.runFunction(e.args,t,this.metadata("HEX2DEC"),e=>{const t=El(e,16,gl);return void 0===t?new lr(Bn.NUM,Ne.NotHex):Nl(t,16)})}hex2bin(e,t){return this.runFunction(e.args,t,this.metadata("HEX2BIN"),(e,t)=>{const n=El(e,16,gl);return void 0===n?new lr(Bn.NUM,Ne.NotHex):Cl(Nl(n,16),2,t)})}hex2oct(e,t){return this.runFunction(e.args,t,this.metadata("HEX2OCT"),(e,t)=>{const n=El(e,16,gl);return void 0===n?new lr(Bn.NUM,Ne.NotHex):Cl(Nl(n,16),8,t)})}base(e,t){return this.runFunction(e.args,t,this.metadata("BASE"),Tl)}decimal(e,t){return this.runFunction(e.args,t,this.metadata("DECIMAL"),(e,t)=>{const n=El(e,t,ml);return void 0===n?new lr(Bn.NUM,Ne.NotHex):parseInt(n,t)})}}function El(e,t,n){const r=bl.substr(0,t),i=new RegExp(`^[${r}]+$`);if(!(e.length>n)&&i.test(e))return e}function Cl(e,t,n){if(e>Rl(t))return new lr(Bn.NUM,Ne.ValueBaseLarge);if(e<Sl(t))return new lr(Bn.NUM,Ne.ValueBaseSmall);const r=Ol(e,t);return void 0===n||e<0?r:r.length>n?new lr(Bn.NUM,Ne.ValueBaseLong):no(r,n)}function Sl(e){return-Math.pow(e,gl)/2}function Rl(e){return-Sl(e)-1}function Tl(e,t,n){const r=Ol(e,t);return void 0!==n&&n>r.length?no(r,n):r}function Ol(e,t){const n=e<0?Math.pow(t,gl):0;return(e+n).toString(t).toUpperCase()}function Nl(e,t){const n=parseInt(e,t),r=Math.pow(t,gl);return n>=r/2?n-r:n}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */vl.implementedFunctions={DEC2BIN:{method:"dec2bin",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},DEC2OCT:{method:"dec2oct",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},DEC2HEX:{method:"dec2hex",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,optionalArg:!0,minValue:1,maxValue:10}]},BIN2DEC:{method:"bin2dec",parameters:[{argumentType:Zr.STRING}]},BIN2OCT:{method:"bin2oct",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.NUMBER,optionalArg:!0,minValue:0,maxValue:gl}]},BIN2HEX:{method:"bin2hex",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.NUMBER,optionalArg:!0,minValue:0,maxValue:gl}]},OCT2DEC:{method:"oct2dec",parameters:[{argumentType:Zr.STRING}]},OCT2BIN:{method:"oct2bin",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.NUMBER,optionalArg:!0,minValue:0,maxValue:gl}]},OCT2HEX:{method:"oct2hex",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.NUMBER,optionalArg:!0,minValue:0,maxValue:gl}]},HEX2DEC:{method:"hex2dec",parameters:[{argumentType:Zr.STRING}]},HEX2BIN:{method:"hex2bin",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.NUMBER,optionalArg:!0,minValue:0,maxValue:gl}]},HEX2OCT:{method:"hex2oct",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.NUMBER,optionalArg:!0,minValue:0,maxValue:gl}]},DECIMAL:{method:"decimal",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.NUMBER,minValue:yl,maxValue:wl}]},BASE:{method:"base",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:yl,maxValue:wl},{argumentType:Zr.NUMBER,optionalArg:!0,minValue:0,maxValue:ml}]}};class Al extends Jr{rand(e,t){return this.runFunction(e.args,t,this.metadata("RAND"),Math.random)}randbetween(e,t){return this.runFunction(e.args,t,this.metadata("RANDBETWEEN"),(e,t)=>t<e?new lr(Bn.NUM,Ne.WrongOrder):(e=Math.ceil(e),t=Math.floor(t)+1,e===t&&(t+=1),e+Math.floor(Math.random()*(t-e))))}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- function Il(e){const t=Math.ceil(e);return t%2===1?t:t+1}function Ml(e){const t=Math.ceil(e);return t%2===0?t:t+1}Al.implementedFunctions={RAND:{method:"rand",parameters:[],isVolatile:!0},RANDBETWEEN:{method:"randbetween",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER}],isVolatile:!0}};class xl extends Jr{roundup(e,t){return this.runFunction(e.args,t,this.metadata("ROUNDDOWN"),(e,t)=>{const n=Math.pow(10,t);return e<0?-Math.ceil(-e*n)/n:Math.ceil(e*n)/n})}rounddown(e,t){return this.runFunction(e.args,t,this.metadata("ROUNDDOWN"),(e,t)=>{const n=Math.pow(10,t);return e<0?-Math.floor(-e*n)/n:Math.floor(e*n)/n})}round(e,t){return this.runFunction(e.args,t,this.metadata("ROUND"),(e,t)=>{const n=Math.pow(10,t);return e<0?-Math.round(-e*n)/n:Math.round(e*n)/n})}intFunc(e,t){return this.runFunction(e.args,t,this.metadata("INT"),e=>e<0?-Math.floor(-e):Math.floor(e))}even(e,t){return this.runFunction(e.args,t,this.metadata("EVEN"),e=>e<0?-Ml(-e):Ml(e))}odd(e,t){return this.runFunction(e.args,t,this.metadata("ODD"),e=>e<0?-Il(-e):Il(e))}ceilingmath(e,t){return this.runFunction(e.args,t,this.metadata("CEILING.MATH"),(e,t,n)=>0===t||0===e?0:(t=Math.abs(t),1===n&&e<0&&(t=-t),Math.ceil(e/t)*t))}ceiling(e,t){return this.runFunction(e.args,t,this.metadata("CEILING"),(e,t)=>0===e?0:0===t?new lr(Bn.DIV_BY_ZERO):e>0&&t<0?new lr(Bn.NUM,Ne.DistinctSigns):Math.ceil(e/t)*t)}ceilingprecise(e,t){return this.runFunction(e.args,t,this.metadata("CEILING.PRECISE"),(e,t)=>0===t||0===e?0:(t=Math.abs(t),Math.ceil(e/t)*t))}floormath(e,t){return this.runFunction(e.args,t,this.metadata("FLOOR.MATH"),(e,t,n)=>0===t||0===e?0:(t=Math.abs(t),1===n&&e<0&&(t*=-1),Math.floor(e/t)*t))}floor(e,t){return this.runFunction(e.args,t,this.metadata("FLOOR"),(e,t)=>0===e?0:0===t?new lr(Bn.DIV_BY_ZERO):e>0&&t<0?new lr(Bn.NUM,Ne.DistinctSigns):Math.floor(e/t)*t)}floorprecise(e,t){return this.runFunction(e.args,t,this.metadata("FLOOR.PRECISE"),(e,t)=>0===t||0===e?0:(t=Math.abs(t),Math.floor(e/t)*t))}}xl.implementedFunctions={ROUNDUP:{method:"roundup",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,defaultValue:0}]},ROUNDDOWN:{method:"rounddown",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,defaultValue:0}]},ROUND:{method:"round",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,defaultValue:0}]},INT:{method:"intFunc",parameters:[{argumentType:Zr.NUMBER}]},EVEN:{method:"even",parameters:[{argumentType:Zr.NUMBER}]},ODD:{method:"odd",parameters:[{argumentType:Zr.NUMBER}]},"CEILING.MATH":{method:"ceilingmath",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,defaultValue:1},{argumentType:Zr.NUMBER,defaultValue:0}]},CEILING:{method:"ceiling",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER}]},"CEILING.PRECISE":{method:"ceilingprecise",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,defaultValue:1}]},"FLOOR.MATH":{method:"floormath",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,defaultValue:1},{argumentType:Zr.NUMBER,defaultValue:0}]},FLOOR:{method:"floor",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER}]},"FLOOR.PRECISE":{method:"floorprecise",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,defaultValue:1}]}},xl.aliases={"ISO.CEILING":"CEILING.PRECISE",TRUNC:"ROUNDDOWN"};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class _l extends Jr{sqrt(e,t){return this.runFunction(e.args,t,this.metadata("SQRT"),Math.sqrt)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- function*Ll(){}function Pl(e){const t=e[Symbol.iterator](),{done:n,value:r}=t.next();return n?{rest:Ll()}:{value:r,rest:t}}_l.implementedFunctions={SQRT:{method:"sqrt",parameters:[{argumentType:Zr.NUMBER}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- const kl=(e,t,n)=>{if(n.end.row>n.start.row){const r=pr(n.end.sheet,n.end.col,n.end.row-1),i=e.getRange(n.start,r);if(void 0!==i)return{smallerRangeVertex:i,restValuesRange:n.withStart(pr(n.start.sheet,n.start.col,n.end.row)),restConditionRanges:t.map(e=>e.withStart(pr(e.start.sheet,e.start.col,e.end.row)))}}return{restValuesRange:n,restConditionRanges:t}};class jl{constructor(e,t,n,r,i){this.interpreter=e,this.cacheKey=t,this.reduceInitialValue=n,this.composeFunction=r,this.mapFunction=i,this.dependencyGraph=this.interpreter.dependencyGraph}compute(e,t){for(const i of t)if(!i.conditionRange.sameDimensionsAs(e))return new lr(Bn.VALUE,Ne.EqualLength);const n=this.tryToGetRangeVertexForRangeValue(e),r=t.map(e=>this.tryToGetRangeVertexForRangeValue(e.conditionRange));if(n&&r.every(e=>void 0!==e)){const i=t.map(e=>e.criterionPackage.raw).join(","),o=this.findAlreadyComputedValueInCache(n,this.cacheKey(t),i);if(void 0!==o)return this.interpreter.stats.incrementCriterionFunctionFullCacheUsed(),o;const s=this.buildNewCriterionCache(this.cacheKey(t),t.map(e=>e.conditionRange.range),e.range);return s.has(i)||s.set(i,[this.evaluateRangeValue(e,t),t.map(e=>e.criterionPackage.lambda)]),n.setCriterionFunctionValues(this.cacheKey(t),s),r.forEach(e=>{void 0!==e&&e.addDependentCacheRange(n)}),s.get(i)[0]}return this.evaluateRangeValue(e,t)}tryToGetRangeVertexForRangeValue(e){const t=e.range;return void 0===t?void 0:this.dependencyGraph.getRange(t.start,t.end)}reduceFunction(e){let t=this.reduceInitialValue;for(const n of e)t=this.composeFunction(t,n);return t}findAlreadyComputedValueInCache(e,t,n){return e.getCriterionFunctionValue(t,n)}evaluateRangeValue(e,t){const n=t.map(e=>e.criterionPackage.lambda),r=Array.from(e.valuesFromTopLeftCorner()).map(this.mapFunction)[Symbol.iterator](),i=t.map(e=>e.conditionRange.iterateValuesFromTopLeftCorner()),o=Fl(n,i,r);return this.reduceFunction(o)}buildNewCriterionCache(e,t,n){const r=this.dependencyGraph.getRange(n.start,n.end),{smallerRangeVertex:i,restConditionRanges:o,restValuesRange:s}=kl(this.dependencyGraph,t,n);let a;a=void 0!==i&&this.dependencyGraph.existsEdge(i,r)?i.getCriterionFunctionValues(e):new Map;const l=new Map;return a.forEach(([e,t],n)=>{const r=Fl(t,o.map(e=>Dl(this.dependencyGraph,e)),Array.from(Dl(this.dependencyGraph,s)).map(this.mapFunction)[Symbol.iterator]()),i=this.composeFunction(e,this.reduceFunction(r));this.interpreter.stats.incrementCriterionFunctionPartialCacheUsed(),l.set(n,[i,t])}),l}}class Hl{constructor(e,t){this.conditionRange=e,this.criterionPackage=t}}function*Dl(e,t){for(const n of t.addresses(e))yield Ct(e.getScalarValue(n))}function*Fl(e,t,n){for(const r of n){const n=t.map(e=>Pl(e));if(!n.every(e=>Object.prototype.hasOwnProperty.call(e,"value")))return;const i=n.map(e=>Ct(e.value));Ul(i,e).every(([e,t])=>t(e))&&(yield r),t=n.map(e=>e.rest)}}function Ul(e,t){const n=[];for(let r=0;r<Math.min(e.length,t.length);r++)n.push([e[r],t[r]]);return n}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Vl{constructor(e,t){this.sum=e,this.count=t}static single(e){return new Vl(e,1)}compose(e){return new Vl(this.sum+e.sum,this.count+e.count)}averageValue(){return this.count>0?this.sum/this.count:void 0}}function Bl(e){return t=>{const n=t.map(e=>`${e.conditionRange.range.sheet},${e.conditionRange.range.start.col},${e.conditionRange.range.start.row}`);return[e,...n].join(",")}}function Wl(e){return Mt(e)&&!Number.isFinite(Ct(e))?0:e}function Gl(e){return e instanceof lr?e:Mt(e)?Ct(e):void 0}Vl.empty=new Vl(0,0);class zl extends Jr{sumif(e,t){const n="SUMIF",r=(e,t,r)=>this.computeConditionalAggregationFunction(null!==r&&void 0!==r?r:e,[e,t],n,0,(e,t)=>this.arithmeticHelper.nonstrictadd(e,t),Gl);return this.runFunction(e.args,t,this.metadata(n),r)}sumifs(e,t){const n="SUMIFS",r=(e,...t)=>this.computeConditionalAggregationFunction(e,t,n,0,(e,t)=>this.arithmeticHelper.nonstrictadd(e,t),Gl);return this.runFunction(e.args,t,this.metadata(n),r)}averageif(e,t){const n="AVERAGEIF",r=(e,t,r)=>{const i=this.computeConditionalAggregationFunction(null!==r&&void 0!==r?r:e,[e,t],n,Vl.empty,(e,t)=>e.compose(t),e=>Mt(e)?Vl.single(Ct(e)):Vl.empty);return i instanceof lr?i:i.averageValue()||new lr(Bn.DIV_BY_ZERO)};return this.runFunction(e.args,t,this.metadata(n),r)}countif(e,t){const n="COUNTIF",r=(e,t)=>this.computeConditionalAggregationFunction(e,[e,t],n,0,(e,t)=>e+t,()=>1);return this.runFunction(e.args,t,this.metadata(n),r)}countifs(e,t){const n="COUNTIFS",r=(...e)=>this.computeConditionalAggregationFunction(e[0],e,n,0,(e,t)=>e+t,()=>1);return this.runFunction(e.args,t,this.metadata(n),r)}minifs(e,t){const n="MINIFS",r=(e,t)=>void 0===t||void 0===e?void 0===t?e:t:Math.min(e,t),i=(e,...t)=>{const i=this.computeConditionalAggregationFunction(e,t,n,Number.POSITIVE_INFINITY,r,Gl);return Wl(i)};return this.runFunction(e.args,t,this.metadata(n),i)}maxifs(e,t){const n="MAXIFS",r=(e,t)=>void 0===t||void 0===e?void 0===t?e:t:Math.max(e,t),i=(e,...t)=>{const i=this.computeConditionalAggregationFunction(e,t,n,Number.NEGATIVE_INFINITY,r,Gl);return Wl(i)};return this.runFunction(e.args,t,this.metadata(n),i)}computeConditionalAggregationFunction(e,t,n,r,i,o){const s=[];for(let a=0;a<t.length;a+=2){const e=t[a],n=this.interpreter.criterionBuilder.fromCellValue(t[a+1],this.arithmeticHelper);if(void 0===n)return new lr(Bn.VALUE,Ne.BadCriterion);s.push(new Hl(e,n))}return new jl(this.interpreter,Bl(n),r,i,o).compute(e,s)}}zl.implementedFunctions={SUMIF:{method:"sumif",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.NOERROR},{argumentType:Zr.RANGE,optionalArg:!0}]},COUNTIF:{method:"countif",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.NOERROR}]},AVERAGEIF:{method:"averageif",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.NOERROR},{argumentType:Zr.RANGE,optionalArg:!0}]},SUMIFS:{method:"sumifs",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.RANGE},{argumentType:Zr.NOERROR}],repeatLastArgs:2},COUNTIFS:{method:"countifs",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.NOERROR}],repeatLastArgs:2},MINIFS:{method:"minifs",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.RANGE},{argumentType:Zr.NOERROR}],repeatLastArgs:2},MAXIFS:{method:"maxifs",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.RANGE},{argumentType:Zr.NOERROR}],repeatLastArgs:2}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class Yl extends Jr{sumproduct(e,t){return this.runFunction(e.args,t,this.metadata("SUMPRODUCT"),(...e)=>{const t=e[0].width(),n=e[0].height();for(const o of e)if(o.width()!==t||o.height()!==n)return new lr(Bn.VALUE,Ne.EqualLength);let r=0;const i=e.map(e=>e.iterateValuesFromTopLeftCorner());for(let o=0;o<t*n;o++){let e=1;for(const t of i){const n=t.next().value;if(n instanceof lr)return n;const r=this.coerceScalarToNumberOrError(n);Mt(r)?e*=Ct(r):e=0}r+=e}return r})}}Yl.implementedFunctions={SUMPRODUCT:{method:"sumproduct",parameters:[{argumentType:Zr.RANGE}],repeatLastArgs:1}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class Xl extends Jr{concatenate(e,t){return this.runFunction(e.args,t,this.metadata("CONCATENATE"),(...e)=>"".concat(...e))}split(e,t){return this.runFunction(e.args,t,this.metadata("SPLIT"),(e,t)=>{const n=e.split(" ");return t>=n.length||t<0?new lr(Bn.VALUE,Ne.IndexBounds):n[t]})}len(e,t){return this.runFunction(e.args,t,this.metadata("LEN"),e=>e.length)}lower(e,t){return this.runFunction(e.args,t,this.metadata("LOWER"),e=>e.toLowerCase())}trim(e,t){return this.runFunction(e.args,t,this.metadata("TRIM"),e=>e.replace(/^ +| +$/g,"").replace(/ +/g," "))}proper(e,t){return this.runFunction(e.args,t,this.metadata("PROPER"),e=>e.replace(/\p{L}+/gu,e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()))}clean(e,t){return this.runFunction(e.args,t,this.metadata("CLEAN"),e=>e.replace(/[\u0000-\u001F]/g,""))}exact(e,t){return this.runFunction(e.args,t,this.metadata("EXACT"),(e,t)=>e===t)}rept(e,t){return this.runFunction(e.args,t,this.metadata("REPT"),(e,t)=>t<0?new lr(Bn.VALUE,Ne.NegativeCount):e.repeat(t))}right(e,t){return this.runFunction(e.args,t,this.metadata("RIGHT"),(e,t)=>t<0?new lr(Bn.VALUE,Ne.NegativeLength):0===t?"":e.slice(-t))}left(e,t){return this.runFunction(e.args,t,this.metadata("LEFT"),(e,t)=>t<0?new lr(Bn.VALUE,Ne.NegativeLength):e.slice(0,t))}mid(e,t){return this.runFunction(e.args,t,this.metadata("MID"),(e,t,n)=>t<1?new lr(Bn.VALUE,Ne.LessThanOne):n<0?new lr(Bn.VALUE,Ne.NegativeLength):e.substring(t-1,t+n-1))}replace(e,t){return this.runFunction(e.args,t,this.metadata("REPLACE"),(e,t,n,r)=>t<1?new lr(Bn.VALUE,Ne.LessThanOne):n<0?new lr(Bn.VALUE,Ne.NegativeLength):e.substring(0,t-1)+r+e.substring(t+n-1))}search(e,t){return this.runFunction(e.args,t,this.metadata("SEARCH"),(e,t,n)=>{if(n<1||n>t.length)return new lr(Bn.VALUE,Ne.LengthBounds);const r=e.toLowerCase(),i=t.substring(n-1).toLowerCase(),o=this.arithmeticHelper.requiresRegex(r)?this.arithmeticHelper.searchString(r,i):i.indexOf(r);return o>-1?o+n:new lr(Bn.VALUE,Ne.PatternNotFound)})}substitute(e,t){return this.runFunction(e.args,t,this.metadata("SUBSTITUTE"),(e,t,n,r)=>{const i=this.escapeRegExpSpecialCharacters(t),o=new RegExp(i,"g");if(void 0===r)return e.replace(o,n);if(r<1)return new lr(Bn.VALUE,Ne.LessThanOne);let s,a=0;while(null!==(s=o.exec(e)))if(r===++a)return e.substring(0,s.index)+n+e.substring(o.lastIndex);return e})}find(e,t){return this.runFunction(e.args,t,this.metadata("FIND"),(e,t,n)=>{if(n<1||n>t.length)return new lr(Bn.VALUE,Ne.IndexBounds);const r=t.substring(n-1),i=r.indexOf(e)+n;return i>0?i:new lr(Bn.VALUE,Ne.PatternNotFound)})}t(e,t){return this.runFunction(e.args,t,this.metadata("T"),e=>e instanceof lr||"string"===typeof e?e:"")}upper(e,t){return this.runFunction(e.args,t,this.metadata("UPPER"),e=>e.toUpperCase())}escapeRegExpSpecialCharacters(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}}Xl.implementedFunctions={CONCATENATE:{method:"concatenate",parameters:[{argumentType:Zr.STRING}],repeatLastArgs:1,expandRanges:!0},EXACT:{method:"exact",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.STRING}]},SPLIT:{method:"split",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.NUMBER}]},LEN:{method:"len",parameters:[{argumentType:Zr.STRING}]},LOWER:{method:"lower",parameters:[{argumentType:Zr.STRING}]},MID:{method:"mid",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER}]},TRIM:{method:"trim",parameters:[{argumentType:Zr.STRING}]},T:{method:"t",parameters:[{argumentType:Zr.SCALAR}]},PROPER:{method:"proper",parameters:[{argumentType:Zr.STRING}]},CLEAN:{method:"clean",parameters:[{argumentType:Zr.STRING}]},REPT:{method:"rept",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.NUMBER}]},RIGHT:{method:"right",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.NUMBER,defaultValue:1}]},LEFT:{method:"left",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.NUMBER,defaultValue:1}]},REPLACE:{method:"replace",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.STRING}]},SEARCH:{method:"search",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.STRING},{argumentType:Zr.NUMBER,defaultValue:1}]},SUBSTITUTE:{method:"substitute",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.STRING},{argumentType:Zr.STRING},{argumentType:Zr.NUMBER,optionalArg:!0}]},FIND:{method:"find",parameters:[{argumentType:Zr.STRING},{argumentType:Zr.STRING},{argumentType:Zr.NUMBER,defaultValue:1}]},UPPER:{method:"upper",parameters:[{argumentType:Zr.STRING}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class Kl extends Jr{acos(e,t){return this.runFunction(e.args,t,this.metadata("ACOS"),Math.acos)}asin(e,t){return this.runFunction(e.args,t,this.metadata("ASIN"),Math.asin)}cos(e,t){return this.runFunction(e.args,t,this.metadata("COS"),Math.cos)}sin(e,t){return this.runFunction(e.args,t,this.metadata("SIN"),Math.sin)}tan(e,t){return this.runFunction(e.args,t,this.metadata("TAN"),Math.tan)}atan(e,t){return this.runFunction(e.args,t,this.metadata("ATAN"),Math.atan)}atan2(e,t){return this.runFunction(e.args,t,this.metadata("ATAN2"),(e,t)=>0===e&&0===t?new lr(Bn.DIV_BY_ZERO):Math.atan2(t,e))}cot(e,t){return this.runFunction(e.args,t,this.metadata("COT"),e=>0===e?new lr(Bn.DIV_BY_ZERO):1/Math.tan(e))}acot(e,t){return this.runFunction(e.args,t,this.metadata("ACOT"),e=>0===e?tl/2:Math.atan(1/e))}sec(e,t){return this.runFunction(e.args,t,this.metadata("SEC"),e=>1/Math.cos(e))}csc(e,t){return this.runFunction(e.args,t,this.metadata("CSC"),e=>0===e?new lr(Bn.DIV_BY_ZERO):1/Math.sin(e))}sinh(e,t){return this.runFunction(e.args,t,this.metadata("SINH"),Math.sinh)}asinh(e,t){return this.runFunction(e.args,t,this.metadata("ASINH"),Math.asinh)}cosh(e,t){return this.runFunction(e.args,t,this.metadata("COSH"),Math.cosh)}acosh(e,t){return this.runFunction(e.args,t,this.metadata("ACOSH"),Math.acosh)}tanh(e,t){return this.runFunction(e.args,t,this.metadata("TANH"),Math.tanh)}atanh(e,t){return this.runFunction(e.args,t,this.metadata("ATANH"),Math.atanh)}coth(e,t){return this.runFunction(e.args,t,this.metadata("COTH"),e=>0===e?new lr(Bn.DIV_BY_ZERO):1/Math.tanh(e))}acoth(e,t){return this.runFunction(e.args,t,this.metadata("ACOTH"),e=>0===e?new lr(Bn.NUM,Ne.NonZero):Math.atanh(1/e))}sech(e,t){return this.runFunction(e.args,t,this.metadata("SECH"),e=>1/Math.cosh(e))}csch(e,t){return this.runFunction(e.args,t,this.metadata("CSCH"),e=>0===e?new lr(Bn.DIV_BY_ZERO):1/Math.sinh(e))}}Kl.implementedFunctions={ACOS:{method:"acos",parameters:[{argumentType:Zr.NUMBER}]},ASIN:{method:"asin",parameters:[{argumentType:Zr.NUMBER}]},COS:{method:"cos",parameters:[{argumentType:Zr.NUMBER}]},SIN:{method:"sin",parameters:[{argumentType:Zr.NUMBER}]},TAN:{method:"tan",parameters:[{argumentType:Zr.NUMBER}]},ATAN:{method:"atan",parameters:[{argumentType:Zr.NUMBER}]},ATAN2:{method:"atan2",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER}]},COT:{method:"cot",parameters:[{argumentType:Zr.NUMBER}]},SEC:{method:"sec",parameters:[{argumentType:Zr.NUMBER}]},CSC:{method:"csc",parameters:[{argumentType:Zr.NUMBER}]},SINH:{method:"sinh",parameters:[{argumentType:Zr.NUMBER}]},COSH:{method:"cosh",parameters:[{argumentType:Zr.NUMBER}]},TANH:{method:"tanh",parameters:[{argumentType:Zr.NUMBER}]},COTH:{method:"coth",parameters:[{argumentType:Zr.NUMBER}]},SECH:{method:"sech",parameters:[{argumentType:Zr.NUMBER}]},CSCH:{method:"csch",parameters:[{argumentType:Zr.NUMBER}]},ACOT:{method:"acot",parameters:[{argumentType:Zr.NUMBER}]},ASINH:{method:"asinh",parameters:[{argumentType:Zr.NUMBER}]},ACOSH:{method:"acosh",parameters:[{argumentType:Zr.NUMBER}]},ATANH:{method:"atanh",parameters:[{argumentType:Zr.NUMBER}]},ACOTH:{method:"acoth",parameters:[{argumentType:Zr.NUMBER}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class $l extends Zs{constructor(e){super(e),this.dependencyGraph=e}find(e,t,n){return this.basicFind(e,t,"col",n)}}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class ql extends Jr{constructor(){super(...arguments),this.rowSearch=new $l(this.dependencyGraph)}vlookup(e,t){return this.runFunction(e.args,t,this.metadata("VLOOKUP"),(e,t,n,r)=>{const i=t.range;return void 0===i?new lr(Bn.VALUE,Ne.WrongType):n<1?new lr(Bn.VALUE,Ne.LessThanOne):n>i.width()?new lr(Bn.REF,Ne.IndexLarge):this.doVlookup(Hr(e),t,n-1,r)})}hlookup(e,t){return this.runFunction(e.args,t,this.metadata("HLOOKUP"),(e,t,n,r)=>{const i=t.range;return void 0===i?new lr(Bn.VALUE,Ne.WrongType):n<1?new lr(Bn.VALUE,Ne.LessThanOne):n>i.height()?new lr(Bn.REF,Ne.IndexLarge):this.doHlookup(Hr(e),t,n-1,r)})}match(e,t){return this.runFunction(e.args,t,this.metadata("MATCH"),(e,t,n)=>this.doMatch(Hr(e),t,n))}searchInRange(e,t,n,r){if(!n&&"string"===typeof e&&this.arithmeticHelper.requiresRegex(e))return r.advancedFind(this.arithmeticHelper.eqMatcherFunction(e),t);{const i=n?{ordering:"asc"}:{ordering:"none",matchExactly:!0};return r.find(e,t,i)}}doVlookup(e,t,n,r){this.dependencyGraph.stats.start(_t.VLOOKUP);const i=t.range;let o;o=void 0===i?jt.onlyValues(t.data.map(e=>[e[0]])):jt.onlyRange(Sr.spanFrom(i.start,1,i.height()),this.dependencyGraph);const s=this.searchInRange(e,o,r,this.columnSearch);if(this.dependencyGraph.stats.end(_t.VLOOKUP),-1===s)return new lr(Bn.NA,Ne.ValueNotFound);let a;if(void 0===i)a=t.data[s][n];else{const e=pr(i.sheet,i.start.col+n,i.start.row+s);a=this.dependencyGraph.getCellValue(e)}return a instanceof jt?new lr(Bn.VALUE,Ne.WrongType):a}doHlookup(e,t,n,r){const i=t.range;let o;o=void 0===i?jt.onlyValues([t.data[0]]):jt.onlyRange(Sr.spanFrom(i.start,i.width(),1),this.dependencyGraph);const s=this.searchInRange(e,o,r,this.rowSearch);if(-1===s)return new lr(Bn.NA,Ne.ValueNotFound);let a;if(void 0===i)a=t.data[n][s];else{const e=pr(i.sheet,i.start.col+s,i.start.row+n);a=this.dependencyGraph.getCellValue(e)}return a instanceof jt?new lr(Bn.VALUE,Ne.WrongType):a}doMatch(e,t,n){if(![-1,0,1].includes(n))return new lr(Bn.VALUE,Ne.BadMode);if(t.width()>1&&t.height()>1)return new lr(Bn.NA);const r=1===t.width()?this.columnSearch:this.rowSearch,i=0===n?{ordering:"none",matchExactly:!0}:{ordering:-1===n?"desc":"asc"},o=r.find(e,t,i);return-1===o?new lr(Bn.NA,Ne.ValueNotFound):o+1}}ql.implementedFunctions={VLOOKUP:{method:"vlookup",parameters:[{argumentType:Zr.NOERROR},{argumentType:Zr.RANGE},{argumentType:Zr.NUMBER},{argumentType:Zr.BOOLEAN,defaultValue:!0}]},HLOOKUP:{method:"hlookup",parameters:[{argumentType:Zr.NOERROR},{argumentType:Zr.RANGE},{argumentType:Zr.NUMBER},{argumentType:Zr.BOOLEAN,defaultValue:!0}]},MATCH:{method:"match",parameters:[{argumentType:Zr.NOERROR},{argumentType:Zr.RANGE},{argumentType:Zr.NUMBER,defaultValue:1}]}};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class Ql extends Jr{roman(e,t){return this.runFunction(e.args,t,this.metadata("ROMAN"),(e,t)=>(e=Math.trunc(e),!1===t?t=4:!0===t&&(t=0),t=Ct(this.coerceScalarToNumberOrError(t)),t instanceof lr?t:(t=Math.trunc(t),t<0?new lr(Bn.VALUE,Ne.ValueSmall):t>4?new lr(Bn.VALUE,Ne.ValueLarge):Jl(e,t))))}arabic(e,t){return this.runFunction(e.args,t,this.metadata("ARABIC"),e=>{e=e.trim().toUpperCase();let t=!1;if(e.startsWith("-")&&(e=e.slice(1),t=!0,""===e))return new lr(Bn.VALUE,Ne.InvalidRoman);const n={input:e,acc:0};return Zl(n,{token:"MMM",val:3e3},{token:"MM",val:2e3},{token:"M",val:1e3}),Zl(n,{token:"IM",val:999},{token:"VM",val:995},{token:"XM",val:990},{token:"LM",val:950},{token:"CM",val:900}),Zl(n,{token:"D",val:500},{token:"ID",val:499},{token:"VD",val:495},{token:"XD",val:490},{token:"LD",val:450},{token:"CD",val:400}),Zl(n,{token:"CCC",val:300},{token:"CC",val:200},{token:"C",val:100}),Zl(n,{token:"IC",val:99},{token:"VC",val:95},{token:"XC",val:90}),Zl(n,{token:"L",val:50},{token:"IL",val:49},{token:"VL",val:45},{token:"XL",val:40}),Zl(n,{token:"XXX",val:30},{token:"XX",val:20},{token:"X",val:10}),Zl(n,{token:"IX",val:9}),Zl(n,{token:"V",val:5},{token:"IV",val:4}),Zl(n,{token:"III",val:3},{token:"II",val:2},{token:"I",val:1}),""!==n.input?new lr(Bn.VALUE,Ne.InvalidRoman):t?-n.acc:n.acc})}}function Zl(e,...t){for(const n of t)if(e.input.startsWith(n.token)){e.input=e.input.slice(n.token.length),e.acc+=n.val;break}}function Jl(e,t){const n={val:e%1e3,acc:"M".repeat(Math.floor(e/1e3))};return 4===t&&(ec(n,"IM",999,1e3),ec(n,"ID",499,500)),t>=3&&(ec(n,"VM",995,1e3),ec(n,"VD",495,500)),t>=2&&(ec(n,"XM",990,1e3),ec(n,"XD",490,500)),t>=1&&(ec(n,"LM",950,1e3),ec(n,"LD",450,500)),ec(n,"CM",900,1e3),ec(n,"CD",400,500),ec(n,"D",500,900),n.acc+="C".repeat(Math.floor(n.val/100)),n.val%=100,t>=2&&(ec(n,"IC",99,100),ec(n,"IL",49,50)),t>=1&&(ec(n,"VC",95,100),ec(n,"VL",45,50)),ec(n,"XC",90,100),ec(n,"XL",40,50),ec(n,"L",50,90),n.acc+="X".repeat(Math.floor(n.val/10)),n.val%=10,ec(n,"IX",9,10),ec(n,"IV",4,5),ec(n,"V",5,9),n.acc+="I".repeat(n.val),n.acc}function ec(e,t,n,r){e.val>=n&&e.val<r&&(e.val-=n,e.acc+=t)}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */Ql.implementedFunctions={ROMAN:{method:"roman",parameters:[{argumentType:Zr.NUMBER,minValue:1,lessThan:4e3},{argumentType:Zr.NOERROR,optionalArg:!0,defaultValue:0}]},ARABIC:{method:"arabic",parameters:[{argumentType:Zr.STRING}]}};class tc extends Jr{add(e,t){return this.runFunction(e.args,t,this.metadata("HF.ADD"),this.arithmeticHelper.addWithEpsilon)}concat(e,t){return this.runFunction(e.args,t,this.metadata("HF.CONCAT"),this.arithmeticHelper.concat)}divide(e,t){return this.runFunction(e.args,t,this.metadata("HF.DIVIDE"),this.arithmeticHelper.divide)}eq(e,t){return this.runFunction(e.args,t,this.metadata("HF.EQ"),this.arithmeticHelper.eq)}gt(e,t){return this.runFunction(e.args,t,this.metadata("HF.GT"),this.arithmeticHelper.gt)}gte(e,t){return this.runFunction(e.args,t,this.metadata("HF.GTE"),this.arithmeticHelper.geq)}lt(e,t){return this.runFunction(e.args,t,this.metadata("HF.LT"),this.arithmeticHelper.lt)}lte(e,t){return this.runFunction(e.args,t,this.metadata("HF.LTE"),this.arithmeticHelper.leq)}minus(e,t){return this.runFunction(e.args,t,this.metadata("HF.MINUS"),this.arithmeticHelper.subtract)}multiply(e,t){return this.runFunction(e.args,t,this.metadata("HF.MULTIPLY"),this.arithmeticHelper.multiply)}ne(e,t){return this.runFunction(e.args,t,this.metadata("HF.NE"),this.arithmeticHelper.neq)}pow(e,t){return this.runFunction(e.args,t,this.metadata("HF.POW"),this.arithmeticHelper.pow)}uminus(e,t){return this.runFunction(e.args,t,this.metadata("HF.UMINUS"),this.arithmeticHelper.unaryMinus)}upercent(e,t){return this.runFunction(e.args,t,this.metadata("HF.UNARY_PERCENT"),this.arithmeticHelper.unaryPercent)}uplus(e,t){return this.runFunction(e.args,t,this.metadata("HF.UPLUS"),this.arithmeticHelper.unaryPlus)}}tc.implementedFunctions={"HF.ADD":{method:"add",parameters:[{argumentType:Zr.NUMBER,passSubtype:!0},{argumentType:Zr.NUMBER,passSubtype:!0}]},"HF.CONCAT":{method:"concat",parameters:[{argumentType:Zr.STRING,passSubtype:!0},{argumentType:Zr.STRING,passSubtype:!0}]},"HF.DIVIDE":{method:"divide",parameters:[{argumentType:Zr.NUMBER,passSubtype:!0},{argumentType:Zr.NUMBER,passSubtype:!0}]},"HF.EQ":{method:"eq",parameters:[{argumentType:Zr.NOERROR,passSubtype:!0},{argumentType:Zr.NOERROR,passSubtype:!0}]},"HF.GT":{method:"gt",parameters:[{argumentType:Zr.NOERROR,passSubtype:!0},{argumentType:Zr.NOERROR,passSubtype:!0}]},"HF.GTE":{method:"gte",parameters:[{argumentType:Zr.NOERROR,passSubtype:!0},{argumentType:Zr.NOERROR,passSubtype:!0}]},"HF.LT":{method:"lt",parameters:[{argumentType:Zr.NOERROR,passSubtype:!0},{argumentType:Zr.NOERROR,passSubtype:!0}]},"HF.LTE":{method:"lte",parameters:[{argumentType:Zr.NOERROR,passSubtype:!0},{argumentType:Zr.NOERROR,passSubtype:!0}]},"HF.MINUS":{method:"minus",parameters:[{argumentType:Zr.NUMBER,passSubtype:!0},{argumentType:Zr.NUMBER,passSubtype:!0}]},"HF.MULTIPLY":{method:"multiply",parameters:[{argumentType:Zr.NUMBER,passSubtype:!0},{argumentType:Zr.NUMBER,passSubtype:!0}]},"HF.NE":{method:"ne",parameters:[{argumentType:Zr.NOERROR,passSubtype:!0},{argumentType:Zr.NOERROR,passSubtype:!0}]},"HF.POW":{method:"pow",parameters:[{argumentType:Zr.NUMBER,passSubtype:!0},{argumentType:Zr.NUMBER,passSubtype:!0}]},"HF.UMINUS":{method:"uminus",parameters:[{argumentType:Zr.NUMBER,passSubtype:!0}]},"HF.UNARY_PERCENT":{method:"upercent",parameters:[{argumentType:Zr.NUMBER,passSubtype:!0}]},"HF.UPLUS":{method:"uplus",parameters:[{argumentType:Zr.NUMBER,passSubtype:!0}]}};
- /**
- * @license
- bessel.js (C) 2013-present SheetJS -- http://sheetjs.com
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
- 1. Definitions.
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
- END OF TERMS AND CONDITIONS
- APPENDIX: How to apply the Apache License to your work.
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
- Copyright (C) 2013-present SheetJS LLC
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
- var nc=Math;function rc(e,t){for(var n=0,r=0;n<e.length;++n)r=t*r+e[n];return r}function ic(e,t,n,r,i){if(0===t)return n;if(1===t)return r;for(var o=2/e,s=r,a=1;a<t;++a)s=r*a*o+i*n,n=r,r=s;return s}function oc(e,t,n,r,i){return function(n,o){if(r){if(0===n)return 1==r?-1/0:1/0;if(n<0)return NaN}if(0===o)return e(n);if(1===o)return t(n);if(o<0)return NaN;o|=0;var s=e(n),a=t(n);return ic(n,o,s,a,i)}}var sc=function(){var e=.636619772,t=[57568490574,-13362590354,651619640.7,-11214424.18,77392.33017,-184.9052456].reverse(),n=[57568490411,1029532985,9494680.718,59272.64853,267.8532712,1].reverse(),r=[1,-.001098628627,2734510407e-14,-2073370639e-15,2.093887211e-7].reverse(),i=[-.01562499995,.0001430488765,-6911147651e-15,7.621095161e-7,-9.34935152e-8].reverse();function o(o){var s=0,a=0,l=0,c=o*o;if(o<8)a=rc(t,c),l=rc(n,c),s=a/l;else{var h=o-.785398164;c=64/c,a=rc(r,c),l=rc(i,c),s=nc.sqrt(e/o)*(nc.cos(h)*a-nc.sin(h)*l*8/o)}return s}var s=[72362614232,-7895059235,242396853.1,-2972611.439,15704.4826,-30.16036606].reverse(),a=[144725228442,2300535178,18583304.74,99447.43394,376.9991397,1].reverse(),l=[1,.00183105,-3516396496e-14,2457520174e-15,-2.40337019e-7].reverse(),c=[.04687499995,-.0002002690873,8449199096e-15,-8.8228987e-7,1.05787412e-7].reverse();function h(t){var n=0,r=0,i=0,o=t*t,h=nc.abs(t)-2.356194491;return Math.abs(t)<8?(r=t*rc(s,o),i=rc(a,o),n=r/i):(o=64/o,r=rc(l,o),i=rc(c,o),n=nc.sqrt(e/nc.abs(t))*(nc.cos(h)*r-nc.sin(h)*i*8/nc.abs(t)),t<0&&(n=-n)),n}return function e(t,n){if(n=Math.round(n),!isFinite(t))return isNaN(t)?t:0;if(n<0)return(n%2?-1:1)*e(t,-n);if(t<0)return(n%2?-1:1)*e(-t,n);if(0===n)return o(t);if(1===n)return h(t);if(0===t)return 0;var r=0;if(t>n)r=ic(t,n,o(t),h(t),-1);else{for(var i=2*nc.floor((n+nc.floor(nc.sqrt(40*n)))/2),s=!1,a=0,l=0,c=1,u=0,d=2/t,p=i;p>0;p--)u=p*d*c-a,a=c,c=u,nc.abs(c)>1e10&&(c*=1e-10,a*=1e-10,r*=1e-10,l*=1e-10),s&&(l+=c),s=!s,p==n&&(r=a);l=2*l-c,r/=l}return r}}(),ac=function(){var e=.636619772,t=[-2957821389,7062834065,-512359803.6,10879881.29,-86327.92757,228.4622733].reverse(),n=[40076544269,745249964.8,7189466.438,47447.2647,226.1030244,1].reverse(),r=[1,-.001098628627,2734510407e-14,-2073370639e-15,2.093887211e-7].reverse(),i=[-.01562499995,.0001430488765,-6911147651e-15,7.621095161e-7,-9.34945152e-8].reverse();function o(o){var s=0,a=0,l=0,c=o*o,h=o-.785398164;return o<8?(a=rc(t,c),l=rc(n,c),s=a/l+e*sc(o,0)*nc.log(o)):(c=64/c,a=rc(r,c),l=rc(i,c),s=nc.sqrt(e/o)*(nc.sin(h)*a+nc.cos(h)*l*8/o)),s}var s=[-4900604943e3,127527439e4,-51534381390,734926455.1,-4237922.726,8511.937935].reverse(),a=[249958057e5,424441966400,3733650367,22459040.02,102042.605,354.9632885,1].reverse(),l=[1,.00183105,-3516396496e-14,2457520174e-15,-2.40337019e-7].reverse(),c=[.04687499995,-.0002002690873,8449199096e-15,-8.8228987e-7,1.05787412e-7].reverse();function h(t){var n=0,r=0,i=0,o=t*t,h=t-2.356194491;return t<8?(r=t*rc(s,o),i=rc(a,o),n=r/i+e*(sc(t,1)*nc.log(t)-1/t)):(o=64/o,r=rc(l,o),i=rc(c,o),n=nc.sqrt(e/t)*(nc.sin(h)*r+nc.cos(h)*i*8/t)),n}return oc(o,h,"BESSELY",1,-1)}(),lc=function(){var e=[1,3.5156229,3.0899424,1.2067492,.2659732,.0360768,.0045813].reverse(),t=[.39894228,.01328592,.00225319,-.00157565,.00916281,-.02057706,.02635537,-.01647633,.00392377].reverse();function n(n){return n<=3.75?rc(e,n*n/14.0625):nc.exp(nc.abs(n))/nc.sqrt(nc.abs(n))*rc(t,3.75/nc.abs(n))}var r=[.5,.87890594,.51498869,.15084934,.02658733,.00301532,32411e-8].reverse(),i=[.39894228,-.03988024,-.00362018,.00163801,-.01031555,.02282967,-.02895312,.01787654,-.00420059].reverse();function o(e){return e<3.75?e*rc(r,e*e/14.0625):(e<0?-1:1)*nc.exp(nc.abs(e))/nc.sqrt(nc.abs(e))*rc(i,3.75/nc.abs(e))}return function e(t,r){if(r=Math.round(r),0===r)return n(t);if(1===r)return o(t);if(r<0)return NaN;if(0===nc.abs(t))return 0;if(t==1/0)return 1/0;var i,s=0,a=2/nc.abs(t),l=0,c=1,h=0,u=2*nc.round((r+nc.round(nc.sqrt(40*r)))/2);for(i=u;i>0;i--)h=i*a*c+l,l=c,c=h,nc.abs(c)>1e10&&(c*=1e-10,l*=1e-10,s*=1e-10),i==r&&(s=l);return s*=e(t,0)/c,t<0&&r%2?-s:s}}(),cc=function(){var e=[-.57721566,.4227842,.23069756,.0348859,.00262698,1075e-7,74e-7].reverse(),t=[1.25331414,-.07832358,.02189568,-.01062446,.00587872,-.0025154,53208e-8].reverse();function n(n){return n<=2?-nc.log(n/2)*lc(n,0)+rc(e,n*n/4):nc.exp(-n)/nc.sqrt(n)*rc(t,2/n)}var r=[1,.15443144,-.67278579,-.18156897,-.01919402,-.00110404,-4686e-8].reverse(),i=[1.25331414,.23498619,-.0365562,.01504268,-.00780353,.00325614,-68245e-8].reverse();function o(e){return e<=2?nc.log(e/2)*lc(e,1)+1/e*rc(r,e*e/4):nc.exp(-e)/nc.sqrt(e)*rc(i,2/e)}return oc(n,o,"BESSELK",2,1)}();
- /**
- * @license
- Copyright (c) 2013 jStat
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- */
- function hc(e){const t=[-1.3026537197817094,.6419697923564902,.019476473204185836,-.00956151478680863,-.000946595344482036,.000366839497852761,42523324806907e-18,-20278578112534e-18,-1624290004647e-18,130365583558e-17,1.5626441722e-8,-8.5238095915e-8,6.529054439e-9,5.059343495e-9,-9.91364156e-10,-2.27365122e-10,96467911e-18,2394038e-18,-6886027e-18,894487e-18,313092e-18,-112708e-18,381e-18,7106e-18,-1523e-18,-94e-18,121e-18,-28e-18];let n,r,i,o,s=t.length-1,a=!1,l=0,c=0;if(0===e)return 0;for(e<0&&(e=-e,a=!0),n=2/(2+e),r=4*n-2;s>0;s--)i=l,l=r*l-c+t[s],c=i;return o=n*Math.exp(-e*e+.5*(t[0]+r*l)-c),a?o-1:1-o}function uc(e){return 1-hc(e)}function dc(e){let t,n,r,i,o=0;if(e>=2)return-100;if(e<=0)return 100;for(i=e<1?e:2-e,r=Math.sqrt(-2*Math.log(i/2)),t=-.70711*((2.30753+.27061*r)/(1+r*(.99229+.04481*r))-r);o<2;o++)n=uc(t)-i,t+=n/(1.1283791670955126*Math.exp(-t*t)-t*n);return e<1?t:-t}const pc={pdf:(e,t)=>e<0?0:t*Math.exp(-t*e),cdf:(e,t)=>e<0?0:1-Math.exp(-t*e)};function fc(e){const t=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],n=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535];let r,i,o,s,a=!1,l=0,c=0,h=0,u=e;if(e>171.6243769536076)return 1/0;if(u<=0){if(s=u%1,!s)return 1/0;a=(1&u?-1:1)*Math.PI/Math.sin(Math.PI*s),u=1-u}for(o=u,i=u<1?u++:(u-=l=(0|u)-1)-1,r=0;r<8;++r)h=(h+t[r])*i,c=c*i+n[r];if(s=h/c+1,o<u)s/=o;else if(o>u)for(r=0;r<l;++r)s*=u,u++;return a&&(s=a/s),s}const gc={pdf:function(e,t,n){return e<0?0:0===e&&1===t?1/n:Math.exp((t-1)*Math.log(e)-e/n-mc(t)-t*Math.log(n))},cdf:function(e,t,n){return e<0?0:yc(t,e/n)},inv:function(e,t,n){return wc(e,t)*n}};function mc(e){let t=0;const n=[76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];let r,i,o,s=1.000000000190015;for(o=(i=r=e)+5.5,o-=(r+.5)*Math.log(o);t<6;t++)s+=n[t]/++i;return Math.log(2.5066282746310007*s/r)-o}function yc(e,t){const n=mc(e);let r=e,i=1/e,o=i,s=t+1-e,a=1/1e-30,l=1/s,c=l,h=1;const u=-~(8.5*Math.log(e>=1?e:1/e)+.4*e+17);let d;if(t<0||e<=0)return NaN;if(t<e+1){for(;h<=u;h++)i+=o*=t/++r;return i*Math.exp(-t+e*Math.log(t)-n)}for(;h<=u;h++)d=-h*(h-e),s+=2,l=d*l+s,a=s+d/a,l=1/l,c*=l*a;return 1-c*Math.exp(-t+e*Math.log(t)-n)}function wc(e,t){let n=0;const r=t-1,i=1e-8,o=mc(t);let s,a,l,c,h,u,d;if(e>=1)return Math.max(100,t+100*Math.sqrt(t));if(e<=0)return 0;for(t>1?(u=Math.log(r),d=Math.exp(r*(u-1)-o),h=e<.5?e:1-e,l=Math.sqrt(-2*Math.log(h)),s=(2.30753+.27061*l)/(1+l*(.99229+.04481*l))-l,e<.5&&(s=-s),s=Math.max(.001,t*Math.pow(1-1/(9*t)-s/(3*Math.sqrt(t)),3))):(l=1-t*(.253+.12*t),s=e<l?Math.pow(e/l,1/t):1-Math.log(1-(e-l)/(1-l)));n<12;n++){if(s<=0)return 0;if(a=yc(t,s)-e,l=t>1?d*Math.exp(-(s-r)+r*(Math.log(s)-u)):Math.exp(-s+r*Math.log(s)-o),c=a/l,s-=l=c/(1-.5*Math.min(1,c*((t-1)/s-1))),s<=0&&(s=.5*(s+l)),Math.abs(l)<i*s)break}return s}const bc={pdf:function(e,t,n){return Math.exp(-.5*Math.log(2*Math.PI)-Math.log(n)-Math.pow(e-t,2)/(2*n*n))},cdf:function(e,t,n){return.5*(1+hc((e-t)/Math.sqrt(2*n*n)))},inv:function(e,t,n){return-1.4142135623730951*n*dc(2*e)+t}},vc={pdf:function(e,t,n){return e>1||e<0?0:1==t&&1==n?1:t<512&&n<512?Math.pow(e,t-1)*Math.pow(1-e,n-1)/Ec(t,n):Math.exp((t-1)*Math.log(e)+(n-1)*Math.log(1-e)-Cc(t,n))},cdf:function(e,t,n){return e>1||e<0?+(e>1):Rc(e,t,n)},inv:function(e,t,n){return Sc(e,t,n)}};function Ec(e,t){if(!(e<=0||t<=0))return e+t>170?Math.exp(Cc(e,t)):fc(e)*fc(t)/fc(e+t)}function Cc(e,t){return mc(e)+mc(t)-mc(e+t)}function Sc(e,t,n){var r,i,o,s,a,l,c,h,u,d,p,f=1e-8,g=t-1,m=n-1,y=0;if(e<=0)return 0;if(e>=1)return 1;for(t>=1&&n>=1?(o=e<.5?e:1-e,s=Math.sqrt(-2*Math.log(o)),c=(2.30753+.27061*s)/(1+s*(.99229+.04481*s))-s,e<.5&&(c=-c),h=(c*c-3)/6,u=2/(1/(2*t-1)+1/(2*n-1)),d=c*Math.sqrt(h+u)/u-(1/(2*n-1)-1/(2*t-1))*(h+5/6-2/(3*u)),c=t/(t+n*Math.exp(2*d))):(r=Math.log(t/(t+n)),i=Math.log(n/(t+n)),s=Math.exp(t*r)/t,a=Math.exp(n*i)/n,d=s+a,c=e<s/d?Math.pow(t*d*e,1/t):1-Math.pow(n*d*(1-e),1/n)),p=-mc(t)-mc(n)+mc(t+n);y<10;y++){if(0===c||1===c)return c;if(l=Rc(c,t,n)-e,s=Math.exp(g*Math.log(c)+m*Math.log(1-c)+p),a=l/s,c-=s=a/(1-.5*Math.min(1,a*(g/c-m/(1-c)))),c<=0&&(c=.5*(c+s)),c>=1&&(c=.5*(c+s+1)),Math.abs(s)<f*c&&y>0)break}return c}function Rc(e,t,n){var r=0===e||1===e?0:Math.exp(mc(t+n)-mc(t)-mc(n)+t*Math.log(e)+n*Math.log(1-e));return!(e<0||e>1)&&(e<(t+1)/(t+n+2)?r*Tc(e,t,n)/t:1-r*Tc(1-e,n,t)/n)}function Tc(e,t,n){var r,i,o,s,a=1e-30,l=1,c=t+n,h=t+1,u=t-1,d=1,p=1-c*e/h;for(Math.abs(p)<a&&(p=a),p=1/p,s=p;l<=100;l++)if(r=2*l,i=l*(n-l)*e/((u+r)*(t+r)),p=1+i*p,Math.abs(p)<a&&(p=a),d=1+i/d,Math.abs(d)<a&&(d=a),p=1/p,s*=p*d,i=-(t+l)*(c+l)*e/((t+r)*(h+r)),p=1+i*p,Math.abs(p)<a&&(p=a),d=1+i/d,Math.abs(d)<a&&(d=a),p=1/p,o=p*d,s*=o,Math.abs(o-1)<3e-7)break;return s}const Oc={pdf:function(e,t,n){return 0===n||1===n?t*n===e?1:0:Ac(t,e)*Math.pow(n,e)*Math.pow(1-n,t-e)},cdf:function(e,t,n){var r,i=1e-10;if(e<0)return 0;if(e>=t)return 1;if(n<0||n>1||t<=0)return NaN;e=Math.floor(e);var o=n,s=e+1,a=t-e,l=s+a,c=Math.exp(mc(l)-mc(a)-mc(s)+s*Math.log(o)+a*Math.log(1-o));return r=o<(s+1)/(l+2)?c*Nc(o,s,a,i):1-c*Nc(1-o,a,s,i),Math.round(1/i*(1-r))/(1/i)}};function Nc(e,t,n,r){var i,o=0,s=1,a=1,l=1,c=0,h=0;while(Math.abs((a-h)/a)>r)h=a,i=-(t+c)*(t+n+c)*e/(t+2*c)/(t+2*c+1),o=a+i*o,s=l+i*s,c+=1,i=c*(n-c)*e/(t+2*c-1)/(t+2*c),a=o+i*a,l=s+i*l,o/=l,s/=l,a/=l,l=1;return a/t}function Ac(e,t){return e>170||t>170?Math.exp(Ic(e,t)):xc(e)/xc(t)/xc(e-t)}function Ic(e,t){return Mc(e)-Mc(t)-Mc(e-t)}function Mc(e){return e<0?NaN:mc(e+1)}function xc(e){return e<0?NaN:fc(e+1)}const _c={pdf:function(e,t){return e<0?0:0===e&&2===t?.5:Math.exp((t/2-1)*Math.log(e)-e/2-t/2*Math.log(2)-mc(t/2))},cdf:function(e,t){return e<0?0:yc(t/2,e/2)},inv:function(e,t){return 2*wc(e,.5*t)}},Lc={pdf:function(e,t,n){var r,i,o;return e<0?0:t<=2?0===e&&t<2?1/0:0===e&&2===t?1:1/Ec(t/2,n/2)*Math.pow(t/n,t/2)*Math.pow(e,t/2-1)*Math.pow(1+t/n*e,-(t+n)/2):(r=t*e/(n+e*t),i=n/(n+e*t),o=t*i/2,o*Oc.pdf((t-2)/2,(t+n-2)/2,r))},cdf:function(e,t,n){return e<0?0:Rc(t*e/(t*e+n),t/2,n/2)},inv:function(e,t,n){return n/(t*(1/Sc(e,t/2,n/2)-1))}},Pc={pdf:function(e,t,n){return e<0||t<0||n<0?0:n/t*Math.pow(e/t,n-1)*Math.exp(-Math.pow(e/t,n))},cdf:function(e,t,n){return e<0?0:1-Math.exp(-Math.pow(e/t,n))}},kc={pdf:function(e,t){return t<0||e%1!==0||e<0?0:Math.pow(t,e)*Math.exp(-t)/xc(e)},cdf:function(e,t){var n=0;if(e<0)return 0;for(var r=0;n<=e;n++)r+=kc.pdf(n,t);return r}},jc={pdf:function(e,t,n,r){if(e<0||e<n-(t-r))return 0;if(e>r||e>n)return 0;if(2*n>t)return 2*r>t?jc.pdf(t-n-r+e,t,t-n,t-r):jc.pdf(r-e,t,t-n,r);if(2*r>t)return jc.pdf(n-e,t,n,t-r);if(n<r)return jc.pdf(e,t,r,n);for(var i=1,o=0,s=0;s<e;s++){while(i>1&&o<r)i*=1-n/(t-o),o++;i*=(r-s)*(n-s)/((s+1)*(t-n-r+s+1))}for(;o<r;o++)i*=1-n/(t-o);return Math.min(1,Math.max(0,i))},cdf:function e(t,n,r,i){if(t<0||t<r-(n-i))return 0;if(t>=i||t>=r)return 1;if(2*r>n)return 2*i>n?e(n-r-i+t,n,n-r,n-i):1-jc.cdf(i-t-1,n,n-r,i);if(2*i>n)return 1-jc.cdf(r-t-1,n,r,n-i);if(r<i)return jc.cdf(t,n,i,r);for(var o=1,s=1,a=0,l=0;l<t;l++){while(o>1&&a<i){var c=1-r/(n-a);s*=c,o*=c,a++}s*=(i-l)*(r-l)/((l+1)*(n-r-i+l+1)),o+=s}for(;a<i;a++)o*=1-r/(n-a);return Math.min(1,Math.max(0,o))}},Hc={pdf:function(e,t){return t=t>1e100?1e100:t,1/(Math.sqrt(t)*Ec(.5,t/2))*Math.pow(1+e*e/t,-(t+1)/2)},cdf:function(e,t){var n=t/2;return Rc((e+Math.sqrt(e*e+t))/(2*Math.sqrt(e*e+t)),n,n)},inv:function(e,t){var n=Sc(2*Math.min(e,1-e),.5*t,.5);return n=Math.sqrt(t*(1-n)/n),e>.5?n:-n}},Dc={pdf:function(e,t,n){return e<=0?0:Math.exp(-Math.log(e)-.5*Math.log(2*Math.PI)-Math.log(n)-Math.pow(Math.log(e)-t,2)/(2*n*n))},cdf:function(e,t,n){return e<0?0:.5+.5*hc((Math.log(e)-t)/Math.sqrt(2*n*n))},inv:function(e,t,n){return Math.exp(-1.4142135623730951*n*dc(2*e)+t)}},Fc={pdf:function(e,t,n){return e===e>>>0&&(e<0?0:Ac(e+t-1,t-1)*Math.pow(1-n,e)*Math.pow(n,t))},cdf:function(e,t,n){var r=0,i=0;if(e<0)return 0;for(;i<=e;i++)r+=Fc.pdf(i,t,n);return r}};function Uc(e){var t=0,n=e.length;while(--n>=0)t+=e[n];return t}function Vc(e){return Uc(e)/e.length}function Bc(e){var t,n=Vc(e),r=0,i=e.length;while(--i>=0)t=e[i]-n,r+=t*t;return r}function Wc(e,t){return Bc(e)/(e.length-(t?1:0))}function Gc(e,t){return Math.sqrt(Wc(e,t))}function zc(){var e,t=[].slice.call(arguments),n=new Array(2);return e=4===t.length?Math.abs(bc.inv(t[1]/2,0,1)*t[2]/Math.sqrt(t[3])):Math.abs(bc.inv(t[1]/2,0,1)*Gc(t[2])/Math.sqrt(t[2].length)),n[0]=t[0]-e,n[1]=t[0]+e,n}function Yc(){var e,t=[].slice.call(arguments),n=new Array(2);return e=4===t.length?Math.abs(Hc.inv(t[1]/2,t[3]-1)*t[2]/Math.sqrt(t[3])):Math.abs(Hc.inv(t[1]/2,t[2].length-1)*Gc(t[2],!0)/Math.sqrt(t[2].length)),n[0]=t[0]-e,n[1]=t[0]+e,n}function Xc(e){var t=1,n=e.length;while(--n>=0)t*=e[n];return t}function Kc(e){return Math.pow(Xc(e),1/e.length)}function $c(e,t){var n,r=Vc(e),i=Vc(t),o=e.length,s=new Array(o);for(n=0;n<o;n++)s[n]=(e[n]-r)*(t[n]-i);return Uc(s)/(o-1)}function qc(e,t){return $c(e,t)/Gc(e,1)/Gc(t,1)}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */class Qc extends Jr{erf(e,t){return this.runFunction(e.args,t,this.metadata("ERF"),(e,t)=>void 0===t?hc(e):hc(t)-hc(e))}erfc(e,t){return this.runFunction(e.args,t,this.metadata("ERFC"),uc)}expondist(e,t){return this.runFunction(e.args,t,this.metadata("EXPON.DIST"),(e,t,n)=>n?pc.cdf(e,t):pc.pdf(e,t))}fisher(e,t){return this.runFunction(e.args,t,this.metadata("FISHER"),e=>Math.log((1+e)/(1-e))/2)}fisherinv(e,t){return this.runFunction(e.args,t,this.metadata("FISHERINV"),e=>1-2/(Math.exp(2*e)+1))}gamma(e,t){return this.runFunction(e.args,t,this.metadata("GAMMA"),fc)}gammadist(e,t){return this.runFunction(e.args,t,this.metadata("GAMMA.DIST"),(e,t,n,r)=>r?gc.cdf(e,t,n):gc.pdf(e,t,n))}gammaln(e,t){return this.runFunction(e.args,t,this.metadata("GAMMALN"),mc)}gammainv(e,t){return this.runFunction(e.args,t,this.metadata("GAMMA.INV"),gc.inv)}gauss(e,t){return this.runFunction(e.args,t,this.metadata("GAUSS"),e=>bc.cdf(e,0,1)-.5)}betadist(e,t){return this.runFunction(e.args,t,this.metadata("BETA.DIST"),(e,t,n,r,i,o)=>e<=i?new lr(Bn.NUM,Ne.ValueSmall):e>=o?new lr(Bn.NUM,Ne.ValueLarge):(e=(e-i)/(o-i),r?vc.cdf(e,t,n):vc.pdf(e,t,n)))}betainv(e,t){return this.runFunction(e.args,t,this.metadata("BETA.INV"),(e,t,n,r,i)=>r>=i?new lr(Bn.NUM,Ne.WrongOrder):vc.inv(e,t,n)*(i-r)+r)}binomialdist(e,t){return this.runFunction(e.args,t,this.metadata("BINOM.DIST"),(e,t,n,r)=>e>t?new lr(Bn.NUM,Ne.WrongOrder):(e=Math.trunc(e),t=Math.trunc(t),r?Oc.cdf(e,t,n):Oc.pdf(e,t,n)))}binomialinv(e,t){return this.runFunction(e.args,t,this.metadata("BINOM.INV"),(e,t,n)=>{e=Math.trunc(e);let r=-1,i=e;while(i>r+1){const o=Math.trunc((r+i)/2);Oc.cdf(o,e,t)>=n?i=o:r=o}return i})}besselifn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELI"),(e,t)=>lc(e,Math.trunc(t)))}besseljfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELJ"),(e,t)=>sc(e,Math.trunc(t)))}besselkfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELK"),(e,t)=>cc(e,Math.trunc(t)))}besselyfn(e,t){return this.runFunction(e.args,t,this.metadata("BESSELY"),(e,t)=>ac(e,Math.trunc(t)))}chisqdist(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.DIST"),(e,t,n)=>(t=Math.trunc(t),n?_c.cdf(e,t):_c.pdf(e,t)))}chisqdistrt(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.DIST.RT"),(e,t)=>1-_c.cdf(e,Math.trunc(t)))}chisqinv(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.INV"),(e,t)=>_c.inv(e,Math.trunc(t)))}chisqinvrt(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.INV.RT"),(e,t)=>_c.inv(1-e,Math.trunc(t)))}fdist(e,t){return this.runFunction(e.args,t,this.metadata("F.DIST"),(e,t,n,r)=>(t=Math.trunc(t),n=Math.trunc(n),r?Lc.cdf(e,t,n):Lc.pdf(e,t,n)))}fdistrt(e,t){return this.runFunction(e.args,t,this.metadata("F.DIST.RT"),(e,t,n)=>1-Lc.cdf(e,Math.trunc(t),Math.trunc(n)))}finv(e,t){return this.runFunction(e.args,t,this.metadata("F.INV"),(e,t,n)=>Lc.inv(e,Math.trunc(t),Math.trunc(n)))}finvrt(e,t){return this.runFunction(e.args,t,this.metadata("F.INV.RT"),(e,t,n)=>Lc.inv(1-e,Math.trunc(t),Math.trunc(n)))}weibulldist(e,t){return this.runFunction(e.args,t,this.metadata("WEIBULL.DIST"),(e,t,n,r)=>r?Pc.cdf(e,n,t):Pc.pdf(e,n,t))}poissondist(e,t){return this.runFunction(e.args,t,this.metadata("POISSON.DIST"),(e,t,n)=>(e=Math.trunc(e),n?kc.cdf(e,t):kc.pdf(e,t)))}hypgeomdist(e,t){return this.runFunction(e.args,t,this.metadata("HYPGEOM.DIST"),(e,t,n,r,i)=>e>t||e>n||t>r||n>r||e+r<n+t?new lr(Bn.NUM,Ne.ValueLarge):(e=Math.trunc(e),t=Math.trunc(t),n=Math.trunc(n),r=Math.trunc(r),i?jc.cdf(e,r,n,t):jc.pdf(e,r,n,t)))}tdist(e,t){return this.runFunction(e.args,t,this.metadata("T.DIST"),(e,t,n)=>(t=Math.trunc(t),n?Hc.cdf(e,t):Hc.pdf(e,t)))}tdist2t(e,t){return this.runFunction(e.args,t,this.metadata("T.DIST.2T"),(e,t)=>2*(1-Hc.cdf(e,Math.trunc(t))))}tdistrt(e,t){return this.runFunction(e.args,t,this.metadata("T.DIST.RT"),(e,t)=>1-Hc.cdf(e,Math.trunc(t)))}tdistold(e,t){return this.runFunction(e.args,t,this.metadata("TDIST"),(e,t,n)=>n*(1-Hc.cdf(e,Math.trunc(t))))}tinv(e,t){return this.runFunction(e.args,t,this.metadata("T.INV"),(e,t)=>Hc.inv(e,Math.trunc(t)))}tinv2t(e,t){return this.runFunction(e.args,t,this.metadata("T.INV.2T"),(e,t)=>Hc.inv(1-e/2,Math.trunc(t)))}lognormdist(e,t){return this.runFunction(e.args,t,this.metadata("LOGNORM.DIST"),(e,t,n,r)=>r?Dc.cdf(e,t,n):Dc.pdf(e,t,n))}lognorminv(e,t){return this.runFunction(e.args,t,this.metadata("LOGNORM.INV"),(e,t,n)=>Dc.inv(e,t,n))}normdist(e,t){return this.runFunction(e.args,t,this.metadata("NORM.DIST"),(e,t,n,r)=>r?bc.cdf(e,t,n):bc.pdf(e,t,n))}norminv(e,t){return this.runFunction(e.args,t,this.metadata("NORM.INV"),(e,t,n)=>bc.inv(e,t,n))}normsdist(e,t){return this.runFunction(e.args,t,this.metadata("NORM.S.DIST"),(e,t)=>t?bc.cdf(e,0,1):bc.pdf(e,0,1))}normsinv(e,t){return this.runFunction(e.args,t,this.metadata("NORM.S.INV"),e=>bc.inv(e,0,1))}phi(e,t){return this.runFunction(e.args,t,this.metadata("PHI"),e=>bc.pdf(e,0,1))}negbinomdist(e,t){return this.runFunction(e.args,t,this.metadata("NEGBINOM.DIST"),(e,t,n,r)=>(e=Math.trunc(e),t=Math.trunc(t),r?Fc.cdf(e,t,n):Fc.pdf(e,t,n)))}confidencenorm(e,t){return this.runFunction(e.args,t,this.metadata("CONFIDENCE.NORM"),(e,t,n)=>zc(1,e,t,Math.trunc(n))[1]-1)}confidencet(e,t){return this.runFunction(e.args,t,this.metadata("CONFIDENCE.T"),(e,t,n)=>(n=Math.trunc(n),1===n?new lr(Bn.DIV_BY_ZERO):Yc(1,e,t,n)[1]-1))}standardize(e,t){return this.runFunction(e.args,t,this.metadata("STANDARDIZE"),(e,t,n)=>(e-t)/n)}}Qc.implementedFunctions={ERF:{method:"erf",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,optionalArg:!0}]},ERFC:{method:"erfc",parameters:[{argumentType:Zr.NUMBER}]},"EXPON.DIST":{method:"expondist",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.BOOLEAN}]},FISHER:{method:"fisher",parameters:[{argumentType:Zr.NUMBER,greaterThan:-1,lessThan:1}]},FISHERINV:{method:"fisherinv",parameters:[{argumentType:Zr.NUMBER}]},GAMMA:{method:"gamma",parameters:[{argumentType:Zr.NUMBER}]},"GAMMA.DIST":{method:"gammadist",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.BOOLEAN}]},GAMMALN:{method:"gammaln",parameters:[{argumentType:Zr.NUMBER,greaterThan:0}]},"GAMMA.INV":{method:"gammainv",parameters:[{argumentType:Zr.NUMBER,minValue:0,lessThan:1},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,greaterThan:0}]},GAUSS:{method:"gauss",parameters:[{argumentType:Zr.NUMBER}]},"BETA.DIST":{method:"betadist",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.BOOLEAN},{argumentType:Zr.NUMBER,defaultValue:0},{argumentType:Zr.NUMBER,defaultValue:1}]},"BETA.INV":{method:"betainv",parameters:[{argumentType:Zr.NUMBER,greaterThan:0,maxValue:1},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,defaultValue:0},{argumentType:Zr.NUMBER,defaultValue:1}]},"BINOM.DIST":{method:"binomialdist",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:0,maxValue:1},{argumentType:Zr.BOOLEAN}]},"BINOM.INV":{method:"binomialinv",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:0,maxValue:1},{argumentType:Zr.NUMBER,greaterThan:0,lessThan:1}]},BESSELI:{method:"besselifn",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,minValue:0}]},BESSELJ:{method:"besseljfn",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,minValue:0}]},BESSELK:{method:"besselkfn",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,minValue:0}]},BESSELY:{method:"besselyfn",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,minValue:0}]},"CHISQ.DIST":{method:"chisqdist",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,minValue:1,maxValue:1e10},{argumentType:Zr.BOOLEAN}]},"CHISQ.DIST.RT":{method:"chisqdistrt",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,minValue:1,maxValue:1e10}]},"CHISQ.INV":{method:"chisqinv",parameters:[{argumentType:Zr.NUMBER,minValue:0,maxValue:1},{argumentType:Zr.NUMBER,minValue:1,maxValue:1e10}]},"CHISQ.INV.RT":{method:"chisqinvrt",parameters:[{argumentType:Zr.NUMBER,minValue:0,maxValue:1},{argumentType:Zr.NUMBER,minValue:1}]},"F.DIST":{method:"fdist",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:1},{argumentType:Zr.NUMBER,minValue:1},{argumentType:Zr.BOOLEAN}]},"F.DIST.RT":{method:"fdistrt",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:1},{argumentType:Zr.NUMBER,minValue:1}]},"F.INV":{method:"finv",parameters:[{argumentType:Zr.NUMBER,minValue:0,maxValue:1},{argumentType:Zr.NUMBER,minValue:1},{argumentType:Zr.NUMBER,minValue:1}]},"F.INV.RT":{method:"finvrt",parameters:[{argumentType:Zr.NUMBER,minValue:0,maxValue:1},{argumentType:Zr.NUMBER,minValue:1},{argumentType:Zr.NUMBER,minValue:1}]},"WEIBULL.DIST":{method:"weibulldist",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.BOOLEAN}]},"POISSON.DIST":{method:"poissondist",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.BOOLEAN}]},"HYPGEOM.DIST":{method:"hypgeomdist",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.BOOLEAN}]},"T.DIST":{method:"tdist",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,minValue:1},{argumentType:Zr.BOOLEAN}]},"T.DIST.2T":{method:"tdist2t",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:1}]},"T.DIST.RT":{method:"tdistrt",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,minValue:1}]},TDIST:{method:"tdistold",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:1},{argumentType:Zr.INTEGER,minValue:1,maxValue:2}]},"T.INV":{method:"tinv",parameters:[{argumentType:Zr.NUMBER,greaterThan:0,lessThan:1},{argumentType:Zr.NUMBER,minValue:1}]},"T.INV.2T":{method:"tinv2t",parameters:[{argumentType:Zr.NUMBER,greaterThan:0,maxValue:1},{argumentType:Zr.NUMBER,minValue:1}]},"LOGNORM.DIST":{method:"lognormdist",parameters:[{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.BOOLEAN}]},"LOGNORM.INV":{method:"lognorminv",parameters:[{argumentType:Zr.NUMBER,greaterThan:0,lessThan:1},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,greaterThan:0}]},"NORM.DIST":{method:"normdist",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.BOOLEAN}]},"NORM.INV":{method:"norminv",parameters:[{argumentType:Zr.NUMBER,greaterThan:0,lessThan:1},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,greaterThan:0}]},"NORM.S.DIST":{method:"normsdist",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.BOOLEAN}]},"NORM.S.INV":{method:"normsinv",parameters:[{argumentType:Zr.NUMBER,greaterThan:0,lessThan:1}]},PHI:{method:"phi",parameters:[{argumentType:Zr.NUMBER}]},"NEGBINOM.DIST":{method:"negbinomdist",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:1},{argumentType:Zr.NUMBER,minValue:0,maxValue:1},{argumentType:Zr.BOOLEAN}]},"CONFIDENCE.NORM":{method:"confidencenorm",parameters:[{argumentType:Zr.NUMBER,greaterThan:0,lessThan:1},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,minValue:1}]},"CONFIDENCE.T":{method:"confidencet",parameters:[{argumentType:Zr.NUMBER,greaterThan:0,lessThan:1},{argumentType:Zr.NUMBER,greaterThan:0},{argumentType:Zr.NUMBER,minValue:1}]},STANDARDIZE:{method:"standardize",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,greaterThan:0}]}},Qc.aliases={NEGBINOMDIST:"NEGBINOM.DIST",EXPONDIST:"EXPON.DIST",BETADIST:"BETA.DIST",NORMDIST:"NORM.DIST",NORMINV:"NORM.INV",NORMSDIST:"NORM.S.DIST",NORMSINV:"NORM.S.INV",LOGNORMDIST:"LOGNORM.DIST",LOGINV:"LOGNORM.INV",TINV:"T.INV.2T",HYPGEOMDIST:"HYPGEOM.DIST",POISSON:"POISSON.DIST",WEIBULL:"WEIBULL.DIST",FINV:"F.INV.RT",FDIST:"F.DIST.RT",CHIDIST:"CHISQ.DIST.RT",CHIINV:"CHISQ.INV.RT",GAMMADIST:"GAMMA.DIST","GAMMALN.PRECISE":"GAMMALN",GAMMAINV:"GAMMA.INV",BETAINV:"BETA.INV",BINOMDIST:"BINOM.DIST",CONFIDENCE:"CONFIDENCE.NORM",CRITBINOM:"BINOM.INV",WEIBULLDIST:"WEIBULL.DIST",TINV2T:"T.INV.2T",TDISTRT:"T.DIST.RT",TDIST2T:"T.DIST.2T",FINVRT:"F.INV.RT",FDISTRT:"F.DIST.RT",CHIDISTRT:"CHISQ.DIST.RT",CHIINVRT:"CHISQ.INV.RT",LOGNORMINV:"LOGNORM.INV",POISSONDIST:"POISSON.DIST"};
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- class Zc extends Jr{fact(e,t){return this.runFunction(e.args,t,this.metadata("FACT"),e=>{e=Math.trunc(e);let t=1;for(let n=1;n<=e;n++)t*=n;return t})}factdouble(e,t){return this.runFunction(e.args,t,this.metadata("FACTDOUBLE"),e=>{e=Math.trunc(e);let t=1;for(let n=e;n>=1;n-=2)t*=n;return t})}combin(e,t){return this.runFunction(e.args,t,this.metadata("COMBIN"),(e,t)=>t>e?new lr(Bn.NUM,Ne.WrongOrder):(e=Math.trunc(e),t=Math.trunc(t),Jc(e,t)))}combina(e,t){return this.runFunction(e.args,t,this.metadata("COMBINA"),(e,t)=>(e=Math.trunc(e),t=Math.trunc(t),e+t-1>=1030?new lr(Bn.NUM,Ne.ValueLarge):0===e&&0===t?1:Jc(e+t-1,t)))}gcd(e,t){return this.runFunction(e.args,t,this.metadata("GCD"),(...e)=>{const t=this.arithmeticHelper.coerceNumbersCoerceRangesDropNulls(e);if(t instanceof lr)return t;let n=0;for(const r of t){if(r<0)return new lr(Bn.NUM,Ne.ValueSmall);n=eh(n,Math.trunc(r))}return n>Number.MAX_SAFE_INTEGER?new lr(Bn.NUM,Ne.ValueLarge):n})}lcm(e,t){return this.runFunction(e.args,t,this.metadata("LCM"),(...e)=>{const t=this.arithmeticHelper.coerceNumbersCoerceRangesDropNulls(e);if(t instanceof lr)return t;let n=1;for(const r of t){if(r<0)return new lr(Bn.NUM,Ne.ValueSmall);n=th(n,Math.trunc(r))}return n>Number.MAX_SAFE_INTEGER?new lr(Bn.NUM,Ne.ValueLarge):n})}mround(e,t){return this.runFunction(e.args,t,this.metadata("MROUND"),(e,t)=>0===t?0:e>0&&t<0||e<0&&t>0?new lr(Bn.NUM,Ne.DistinctSigns):Math.round(e/t)*t)}multinomial(e,t){return this.runFunction(e.args,t,this.metadata("MULTINOMIAL"),(...e)=>{let t=0,n=1;for(let r of e){if(r<0)return new lr(Bn.NUM,Ne.ValueSmall);r=Math.trunc(r);for(let e=1;e<=r;e++)n*=(t+e)/e;t+=r}return Math.round(n)})}quotient(e,t){return this.runFunction(e.args,t,this.metadata("QUOTIENT"),(e,t)=>0===t?new lr(Bn.DIV_BY_ZERO):Math.trunc(e/t))}seriessum(e,t){return this.runFunction(e.args,t,this.metadata("SERIESSUM"),(e,t,n,r)=>{const i=this.arithmeticHelper.manyToOnlyNumbersDropNulls(r.valuesFromTopLeftCorner());if(i instanceof lr)return i;let o=0;i.reverse();for(const s of i)o*=Math.pow(e,n),o+=s;return o*Math.pow(e,t)})}sign(e,t){return this.runFunction(e.args,t,this.metadata("SIGN"),e=>e>0?1:e<0?-1:0)}sumx2my2(e,t){return this.runFunction(e.args,t,this.metadata("SUMX2MY2"),(e,t)=>{const n=e.valuesFromTopLeftCorner(),r=t.valuesFromTopLeftCorner();if(n.length!==r.length)return new lr(Bn.NA,Ne.EqualLength);const i=n.length;let o=0;for(let s=0;s<i;s++){const e=n[s],t=r[s];if(e instanceof lr)return e;if(t instanceof lr)return t;"number"===typeof e&&"number"===typeof t&&(o+=Math.pow(e,2)-Math.pow(t,2))}return o})}sumx2py2(e,t){return this.runFunction(e.args,t,this.metadata("SUMX2PY2"),(e,t)=>{const n=e.valuesFromTopLeftCorner(),r=t.valuesFromTopLeftCorner();if(n.length!==r.length)return new lr(Bn.NA,Ne.EqualLength);const i=n.length;let o=0;for(let s=0;s<i;s++){const e=n[s],t=r[s];if(e instanceof lr)return e;if(t instanceof lr)return t;"number"===typeof e&&"number"===typeof t&&(o+=Math.pow(e,2)+Math.pow(t,2))}return o})}sumxmy2(e,t){return this.runFunction(e.args,t,this.metadata("SUMXMY2"),(e,t)=>{const n=e.valuesFromTopLeftCorner(),r=t.valuesFromTopLeftCorner();if(n.length!==r.length)return new lr(Bn.NA,Ne.EqualLength);const i=n.length;let o=0;for(let s=0;s<i;s++){const e=n[s],t=r[s];if(e instanceof lr)return e;if(t instanceof lr)return t;"number"===typeof e&&"number"===typeof t&&(o+=Math.pow(e-t,2))}return o})}}function Jc(e,t){2*t>e&&(t=e-t);let n=1;for(let r=1;r<=t;r++)n*=(e-t+r)/r;return Math.round(n)}function eh(e,t){e<t&&([e,t]=[t,e]);while(t>0)[e,t]=[t,e%t];return e}function th(e,t){return 0===e||0===t?0:e*(t/eh(e,t))}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */Zc.implementedFunctions={FACT:{method:"fact",parameters:[{argumentType:Zr.NUMBER,minValue:0,maxValue:170}]},FACTDOUBLE:{method:"factdouble",parameters:[{argumentType:Zr.NUMBER,minValue:0,maxValue:288}]},COMBIN:{method:"combin",parameters:[{argumentType:Zr.NUMBER,minValue:0,lessThan:1030},{argumentType:Zr.NUMBER,minValue:0}]},COMBINA:{method:"combina",parameters:[{argumentType:Zr.NUMBER,minValue:0},{argumentType:Zr.NUMBER,minValue:0}]},GCD:{method:"gcd",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},LCM:{method:"lcm",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},MROUND:{method:"mround",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER}]},MULTINOMIAL:{method:"multinomial",parameters:[{argumentType:Zr.NUMBER}],repeatLastArgs:1,expandRanges:!0},QUOTIENT:{method:"quotient",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER}]},SERIESSUM:{method:"seriessum",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.RANGE}]},SIGN:{method:"sign",parameters:[{argumentType:Zr.NUMBER}]},SUMX2MY2:{method:"sumx2my2",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.RANGE}]},SUMX2PY2:{method:"sumx2py2",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.RANGE}]},SUMXMY2:{method:"sumxmy2",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.RANGE}]}};class nh extends Jr{complex(e,t){return this.runFunction(e.args,t,this.metadata("COMPLEX"),(e,t,n)=>"i"!==n&&"j"!==n?new lr(Bn.VALUE,Ne.ShouldBeIorJ):xr([e,t],n))}imabs(e,t){return this.runFunction(e.args,t,this.metadata("IMABS"),dh)}imaginary(e,t){return this.runFunction(e.args,t,this.metadata("IMAGINARY"),([e,t])=>t)}imreal(e,t){return this.runFunction(e.args,t,this.metadata("IMREAL"),([e,t])=>e)}imargument(e,t){return this.runFunction(e.args,t,this.metadata("IMARGUMENT"),([e,t])=>0===e&&0===t?new lr(Bn.DIV_BY_ZERO):Math.atan2(t,e))}imconjugate(e,t){return this.runFunction(e.args,t,this.metadata("IMCONJUGATE"),([e,t])=>xr([e,-t]))}imcos(e,t){return this.runFunction(e.args,t,this.metadata("IMCOS"),e=>xr(ah(e)))}imcosh(e,t){return this.runFunction(e.args,t,this.metadata("IMCOSH"),e=>xr(lh(e)))}imcot(e,t){return this.runFunction(e.args,t,this.metadata("IMCOT"),e=>xr(sh(ah(e),ch(e))))}imcsc(e,t){return this.runFunction(e.args,t,this.metadata("IMCSC"),e=>xr(sh([1,0],ch(e))))}imcsch(e,t){return this.runFunction(e.args,t,this.metadata("IMCSCH"),e=>xr(sh([1,0],hh(e))))}imsec(e,t){return this.runFunction(e.args,t,this.metadata("IMSEC"),e=>xr(sh([1,0],ah(e))))}imsech(e,t){return this.runFunction(e.args,t,this.metadata("IMSECH"),e=>xr(sh([1,0],lh(e))))}imsin(e,t){return this.runFunction(e.args,t,this.metadata("IMSIN"),e=>xr(ch(e)))}imsinh(e,t){return this.runFunction(e.args,t,this.metadata("IMSINH"),e=>xr(hh(e)))}imtan(e,t){return this.runFunction(e.args,t,this.metadata("IMTAN"),e=>xr(sh(ch(e),ah(e))))}imdiv(e,t){return this.runFunction(e.args,t,this.metadata("IMDIV"),(e,t)=>xr(sh(e,t)))}improduct(e,t){return this.runFunction(e.args,t,this.metadata("IMPRODUCT"),(...e)=>{const t=this.arithmeticHelper.coerceComplexExactRanges(e);if(t instanceof lr)return t;let n=[1,0];for(const r of t)n=oh(n,r);return xr(n)})}imsum(e,t){return this.runFunction(e.args,t,this.metadata("IMSUM"),(...e)=>{const t=this.arithmeticHelper.coerceComplexExactRanges(e);if(t instanceof lr)return t;let n=[0,0];for(const r of t)n=rh(n,r);return xr(n)})}imsub(e,t){return this.runFunction(e.args,t,this.metadata("IMSUB"),(e,t)=>xr(ih(e,t)))}imexp(e,t){return this.runFunction(e.args,t,this.metadata("IMEXP"),e=>xr(uh(e)))}imln(e,t){return this.runFunction(e.args,t,this.metadata("IMLN"),e=>xr(ph(e)))}imlog10(e,t){return this.runFunction(e.args,t,this.metadata("IMLOG10"),e=>{const[t,n]=ph(e),r=Math.log(10);return xr([t/r,n/r])})}imlog2(e,t){return this.runFunction(e.args,t,this.metadata("IMLOG2"),e=>{const[t,n]=ph(e),r=Math.log(2);return xr([t/r,n/r])})}impower(e,t){return this.runFunction(e.args,t,this.metadata("IMPOWER"),(e,t)=>xr(fh(e,t)))}imsqrt(e,t){return this.runFunction(e.args,t,this.metadata("IMSQRT"),e=>xr(fh(e,.5)))}}function rh([e,t],[n,r]){return[e+n,t+r]}function ih([e,t],[n,r]){return[e-n,t-r]}function oh([e,t],[n,r]){return[e*n-t*r,e*r+n*t]}function sh([e,t],[n,r]){const i=Math.pow(n,2)+Math.pow(r,2),[o,s]=oh([e,t],[n,-r]);return[o/i,s/i]}function ah([e,t]){return[Math.cos(e)*Math.cosh(t),-Math.sin(e)*Math.sinh(t)]}function lh([e,t]){return[Math.cosh(e)*Math.cos(t),Math.sinh(e)*Math.sin(t)]}function ch([e,t]){return[Math.sin(e)*Math.cosh(t),Math.cos(e)*Math.sinh(t)]}function hh([e,t]){return[Math.sinh(e)*Math.cos(t),Math.cosh(e)*Math.sin(t)]}function uh([e,t]){return[Math.exp(e)*Math.cos(t),Math.exp(e)*Math.sin(t)]}function dh([e,t]){return Math.sqrt(e*e+t*t)}function ph([e,t]){return[Math.log(dh([e,t])),Math.atan2(t,e)]}function fh(e,t){const[n,r]=ph(e);return uh([t*n,t*r])}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */nh.implementedFunctions={COMPLEX:{method:"complex",parameters:[{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER},{argumentType:Zr.STRING,defaultValue:"i"}]},IMABS:{method:"imabs",parameters:[{argumentType:Zr.COMPLEX}]},IMAGINARY:{method:"imaginary",parameters:[{argumentType:Zr.COMPLEX}]},IMREAL:{method:"imreal",parameters:[{argumentType:Zr.COMPLEX}]},IMARGUMENT:{method:"imargument",parameters:[{argumentType:Zr.COMPLEX}]},IMCONJUGATE:{method:"imconjugate",parameters:[{argumentType:Zr.COMPLEX}]},IMCOS:{method:"imcos",parameters:[{argumentType:Zr.COMPLEX}]},IMCOSH:{method:"imcosh",parameters:[{argumentType:Zr.COMPLEX}]},IMCOT:{method:"imcot",parameters:[{argumentType:Zr.COMPLEX}]},IMCSC:{method:"imcsc",parameters:[{argumentType:Zr.COMPLEX}]},IMCSCH:{method:"imcsch",parameters:[{argumentType:Zr.COMPLEX}]},IMSEC:{method:"imsec",parameters:[{argumentType:Zr.COMPLEX}]},IMSECH:{method:"imsech",parameters:[{argumentType:Zr.COMPLEX}]},IMSIN:{method:"imsin",parameters:[{argumentType:Zr.COMPLEX}]},IMSINH:{method:"imsinh",parameters:[{argumentType:Zr.COMPLEX}]},IMTAN:{method:"imtan",parameters:[{argumentType:Zr.COMPLEX}]},IMDIV:{method:"imdiv",parameters:[{argumentType:Zr.COMPLEX},{argumentType:Zr.COMPLEX}]},IMPRODUCT:{method:"improduct",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},IMSUM:{method:"imsum",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},IMSUB:{method:"imsub",parameters:[{argumentType:Zr.COMPLEX},{argumentType:Zr.COMPLEX}]},IMEXP:{method:"imexp",parameters:[{argumentType:Zr.COMPLEX}]},IMLN:{method:"imln",parameters:[{argumentType:Zr.COMPLEX}]},IMLOG10:{method:"imlog10",parameters:[{argumentType:Zr.COMPLEX}]},IMLOG2:{method:"imlog2",parameters:[{argumentType:Zr.COMPLEX}]},IMPOWER:{method:"impower",parameters:[{argumentType:Zr.COMPLEX},{argumentType:Zr.NUMBER}]},IMSQRT:{method:"imsqrt",parameters:[{argumentType:Zr.COMPLEX}]}};class gh extends Jr{avedev(e,t){return this.runFunction(e.args,t,this.metadata("AVEDEV"),(...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof lr)return t;if(0===t.length)return new lr(Bn.DIV_BY_ZERO);const n=Vc(t);return t.reduce((e,t)=>e+Math.abs(t-n),0)/t.length})}devsq(e,t){return this.runFunction(e.args,t,this.metadata("DEVSQ"),(...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);return t instanceof lr?t:0===t.length?0:Bc(t)})}geomean(e,t){return this.runFunction(e.args,t,this.metadata("GEOMEAN"),(...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof lr)return t;if(0===t.length)return new lr(Bn.NUM,Ne.OneValue);for(const n of t)if(n<=0)return new lr(Bn.NUM,Ne.ValueSmall);return Kc(t)})}harmean(e,t){return this.runFunction(e.args,t,this.metadata("HARMEAN"),(...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof lr)return t;if(0===t.length)return new lr(Bn.NUM,Ne.OneValue);for(const n of t)if(n<=0)return new lr(Bn.NUM,Ne.ValueSmall);return t.length/t.reduce((e,t)=>e+1/t,0)})}correl(e,t){return this.runFunction(e.args,t,this.metadata("CORREL"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new lr(Bn.NA,Ne.EqualLength);const n=mh(e,t);if(n instanceof lr)return n;const r=n[0].length;return r<=1?new lr(Bn.DIV_BY_ZERO,Ne.TwoValues):qc(n[0],n[1])})}rsq(e,t){return this.runFunction(e.args,t,this.metadata("RSQ"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new lr(Bn.NA,Ne.EqualLength);const n=mh(e,t);if(n instanceof lr)return n;const r=n[0].length;return r<=1?new lr(Bn.DIV_BY_ZERO,Ne.TwoValues):Math.pow(qc(n[0],n[1]),2)})}covariancep(e,t){return this.runFunction(e.args,t,this.metadata("COVARIANCE.P"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new lr(Bn.NA,Ne.EqualLength);const n=mh(e,t);if(n instanceof lr)return n;const r=n[0].length;return r<1?new lr(Bn.DIV_BY_ZERO,Ne.OneValue):1===r?0:$c(n[0],n[1])*(r-1)/r})}covariances(e,t){return this.runFunction(e.args,t,this.metadata("COVARIANCE.S"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new lr(Bn.NA,Ne.EqualLength);const n=mh(e,t);if(n instanceof lr)return n;const r=n[0].length;return r<=1?new lr(Bn.DIV_BY_ZERO,Ne.TwoValues):$c(n[0],n[1])})}ztest(e,t){return this.runFunction(e.args,t,this.metadata("Z.TEST"),(e,t,n)=>{const r=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner());if(r instanceof lr)return r;const i=r.length;if(void 0===n){if(i<2)return new lr(Bn.DIV_BY_ZERO,Ne.TwoValues);n=Gc(r,!0)}return i<1?new lr(Bn.NA,Ne.OneValue):0===n?new lr(Bn.DIV_BY_ZERO):1-bc.cdf((Vc(r)-t)/(n/Math.sqrt(i)),0,1)})}ftest(e,t){return this.runFunction(e.args,t,this.metadata("F.TEST"),(e,t)=>{const n=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner()),r=this.arithmeticHelper.manyToExactNumbers(t.valuesFromTopLeftCorner());if(n instanceof lr)return n;if(r instanceof lr)return r;if(n.length<=1||r.length<=1)return new lr(Bn.DIV_BY_ZERO);const i=Wc(n,!0),o=Wc(r,!0);if(0===i||0===o)return new lr(Bn.DIV_BY_ZERO);const s=i/o,a=Lc.cdf(s,n.length-1,r.length-1);return 2*Math.min(a,1-a)})}steyx(e,t){return this.runFunction(e.args,t,this.metadata("STEYX"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new lr(Bn.NA,Ne.EqualLength);const n=mh(e,t);if(n instanceof lr)return n;const r=n[0].length;return r<=2?new lr(Bn.DIV_BY_ZERO,Ne.ThreeValues):Math.sqrt((Bc(n[0])-Math.pow($c(n[0],n[1])*(r-1),2)/Bc(n[1]))/(r-2))})}slope(e,t){return this.runFunction(e.args,t,this.metadata("SLOPE"),(e,t)=>{if(e.numberOfElements()!==t.numberOfElements())return new lr(Bn.NA,Ne.EqualLength);const n=mh(e,t);if(n instanceof lr)return n;const r=n[0].length;return r<=1?new lr(Bn.DIV_BY_ZERO,Ne.TwoValues):$c(n[0],n[1])*(r-1)/Bc(n[1])})}chisqtest(e,t){return this.runFunction(e.args,t,this.metadata("CHISQ.TEST"),(e,t)=>{const n=e.height(),r=e.width();if(t.height()!==n||t.width()!==r)return new lr(Bn.NA,Ne.EqualLength);const i=mh(e,t);if(i instanceof lr)return i;if(i[0].length<=1)return new lr(Bn.DIV_BY_ZERO,Ne.TwoValues);let o=0;for(let s=0;s<i[0].length;s++){if(0===i[1][s])return new lr(Bn.DIV_BY_ZERO);o+=Math.pow(i[0][s]-i[1][s],2)/i[1][s]}return o<0?new lr(Bn.NUM,Ne.NaN):1-_c.cdf(o,n>1&&r>1?(n-1)*(r-1):n*r-1)})}ttest(e,t){return this.runFunction(e.args,t,this.metadata("T.TEST"),(e,t,n,r)=>{const i=this.arithmeticHelper.manyToExactNumbers(e.valuesFromTopLeftCorner()),o=this.arithmeticHelper.manyToExactNumbers(t.valuesFromTopLeftCorner());if(i instanceof lr)return i;if(o instanceof lr)return o;const s=i.length,a=o.length;if(1===r){if(a!==s)return new lr(Bn.NA,Ne.EqualLength);if(s<=1)return new lr(Bn.DIV_BY_ZERO,Ne.TwoValues);const e=Array(s);for(let n=0;n<s;n++)e[n]=i[n]-o[n];const t=Gc(e,!0);if(0===t)return new lr(Bn.DIV_BY_ZERO);const r=Math.abs(Math.sqrt(s)*Vc(e)/t);return n*(1-Hc.cdf(r,s-1))}if(2===r){if(s<=1||a<=1)return new lr(Bn.DIV_BY_ZERO,Ne.TwoValues);const e=(Bc(i)+Bc(o))/(s+a-2);if(0===e)return new lr(Bn.DIV_BY_ZERO);const t=Math.abs((Vc(i)-Vc(o))/Math.sqrt(e*(1/s+1/a)));return n*(1-Hc.cdf(t,s+a-2))}{if(s<=1||a<=1)return new lr(Bn.DIV_BY_ZERO,Ne.TwoValues);const e=Wc(i,!0),t=Wc(o,!0);if(0===e&&0===t)return new lr(Bn.DIV_BY_ZERO);const r=Math.abs((Vc(i)-Vc(o))/Math.sqrt(e/s+t/a)),l=Math.pow(e/s+t/a,2)/(Math.pow(e/s,2)/(s-1)+Math.pow(t/a,2)/(a-1));return n*(1-Hc.cdf(r,l))}})}skew(e,t){return this.runFunction(e.args,t,this.metadata("SKEW"),(...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof lr)return t;const n=t.length;if(n<3)return new lr(Bn.DIV_BY_ZERO,Ne.ThreeValues);const r=Vc(t),i=Gc(t,!0);return 0===i?new lr(Bn.DIV_BY_ZERO):t.reduce((e,t)=>e+Math.pow((t-r)/i,3),0)*n/(n-1)/(n-2)})}skewp(e,t){return this.runFunction(e.args,t,this.metadata("SKEW.P"),(...e)=>{const t=this.arithmeticHelper.coerceNumbersExactRanges(e);if(t instanceof lr)return t;const n=t.length;if(n<3)return new lr(Bn.DIV_BY_ZERO,Ne.ThreeValues);const r=Vc(t),i=Gc(t,!1);return 0===i?new lr(Bn.DIV_BY_ZERO):t.reduce((e,t)=>e+Math.pow((t-r)/i,3),0)/n})}}function mh(e,t){const n=e.iterateValuesFromTopLeftCorner(),r=t.iterateValuesFromTopLeftCorner();let i,o;const s=[],a=[];while(i=n.next(),o=r.next(),!i.done&&!o.done){const e=i.value,t=o.value;if(e instanceof lr)return e;if(t instanceof lr)return t;Mt(e)&&Mt(t)&&(s.push(Ct(e)),a.push(Ct(t)))}return[s,a]}
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */
- /**
- * @license
- * Copyright (c) 2024 Handsoncode. All rights reserved.
- */gh.implementedFunctions={AVEDEV:{method:"avedev",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},DEVSQ:{method:"devsq",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},GEOMEAN:{method:"geomean",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},HARMEAN:{method:"harmean",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},CORREL:{method:"correl",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.RANGE}]},RSQ:{method:"rsq",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.RANGE}]},"COVARIANCE.P":{method:"covariancep",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.RANGE}]},"COVARIANCE.S":{method:"covariances",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.RANGE}]},"Z.TEST":{method:"ztest",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.NUMBER},{argumentType:Zr.NUMBER,optionalArg:!0}]},"F.TEST":{method:"ftest",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.RANGE}]},STEYX:{method:"steyx",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.RANGE}]},SLOPE:{method:"slope",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.RANGE}]},"CHISQ.TEST":{method:"chisqtest",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.RANGE}]},"T.TEST":{method:"ttest",parameters:[{argumentType:Zr.RANGE},{argumentType:Zr.RANGE},{argumentType:Zr.INTEGER,minValue:1,maxValue:2},{argumentType:Zr.INTEGER,minValue:1,maxValue:3}]},SKEW:{method:"skew",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1},"SKEW.P":{method:"skewp",parameters:[{argumentType:Zr.ANY}],repeatLastArgs:1}},gh.aliases={COVAR:"COVARIANCE.P",FTEST:"F.TEST",PEARSON:"CORREL",ZTEST:"Z.TEST",CHITEST:"CHISQ.TEST",TTEST:"T.TEST",COVARIANCEP:"COVARIANCE.P",COVARIANCES:"COVARIANCE.S",SKEWP:"SKEW.P"};class yh extends ua{}yh.HyperFormula=ua,yh.ErrorType=Bn,yh.CellError=lr,yh.CellType=Wn,yh.CellValueType=nr,yh.CellValueDetailedType=rr,yh.DetailedCellError=ii,yh.ExportedCellChange=Ns,yh.ExportedNamedExpressionChange=As,yh.ConfigValueTooBigError=ln,yh.ConfigValueTooSmallError=an,yh.EvaluationSuspendedError=hn,yh.ExpectedOneOfValuesError=cn,yh.ExpectedValueOfTypeError=on,yh.ArraySize=ei,yh.SimpleRangeValue=jt,yh.EmptyValue=Et,yh.FunctionPlugin=Jr,yh.FunctionArgumentType=Zr,yh.FunctionPluginValidationError=gn,yh.InvalidAddressError=Xt,yh.InvalidArgumentsError=Kt,yh.LanguageNotRegisteredError=pn,yh.LanguageAlreadyRegisteredError=fn,yh.MissingTranslationError=un,yh.NamedExpressionDoesNotExistError=Zt,yh.NamedExpressionNameIsAlreadyTakenError=qt,yh.NamedExpressionNameIsInvalidError=Qt,yh.NoOperationToRedoError=en,yh.NoOperationToUndoError=Jt,yh.NoRelativeAddressesAllowedError=bn,yh.NoSheetWithIdError=Bt,yh.NoSheetWithNameError=Wt,yh.NotAFormulaError=Yt,yh.NothingToPasteError=tn,yh.ProtectedFunctionTranslationError=dn,yh.SheetNameAlreadyTakenError=Gt,yh.SheetSizeLimitExceededError=zt,yh.SourceLocationHasArrayError=yn,yh.TargetLocationHasArrayError=wn,yh.UnableToParseError=rn;const wh=pa.defaultConfig.language;ua.registerLanguage(wh,wa),ua.languages[wa.langCode]=wa;for(const bh of Object.getOwnPropertyNames(o))bh.startsWith("_")||ua.registerFunctionPlugin(o[bh])},cef7: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)}getHiddenIndexes(){return Object(i["arrayReduce"])(this.getValues(),(e,t,n)=>(t&&e.push(n),e),[])}}},cf36:function(e,t,n){"use strict";var r=n("b343"),i=n("1caf");e.exports=!r((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",i(1,7)),7!==e.stack)}))},d06e:function(e,t,n){"use strict";var r=n("ac4f"),i=n("fc2d"),o=n("7dcf4"),s=n("2349"),a=n("ae20"),l=n("b343"),c=l((function(){return 4294967297!==[].push.call({length:4294967296},1)})),h=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}},u=c||!h();r({target:"Array",proto:!0,arity:1,forced:u},{push:function(e){var t=i(this),n=o(t),r=arguments.length;a(n+r);for(var l=0;l<r;l++)t[n]=arguments[l],n++;return s(t,n),n}})},d128:function(e,t,n){"use strict";var r=n("b343");e.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},d2e4:function(e,t,n){"use strict";var r,i,o,s,a=n("f2e8"),l=n("0204"),c=n("7d61"),h=n("73fa"),u=n("69ba"),d=n("b343"),p=n("f808"),f=n("9674"),g=n("2179"),m=n("6038"),y=n("dd8d"),w=n("5bc5"),b=a.setImmediate,v=a.clearImmediate,E=a.process,C=a.Dispatch,S=a.Function,R=a.MessageChannel,T=a.String,O=0,N={},A="onreadystatechange";d((function(){r=a.location}));var I=function(e){if(u(N,e)){var t=N[e];delete N[e],t()}},M=function(e){return function(){I(e)}},x=function(e){I(e.data)},_=function(e){a.postMessage(T(e),r.protocol+"//"+r.host)};b&&v||(b=function(e){m(arguments.length,1);var t=h(e)?e:S(e),n=f(arguments,1);return N[++O]=function(){l(t,void 0,n)},i(O),O},v=function(e){delete N[e]},w?i=function(e){E.nextTick(M(e))}:C&&C.now?i=function(e){C.now(M(e))}:R&&!y?(o=new R,s=o.port2,o.port1.onmessage=x,i=c(s.postMessage,s)):a.addEventListener&&h(a.postMessage)&&!a.importScripts&&r&&"file:"!==r.protocol&&!d(_)?(i=_,a.addEventListener("message",x,!1)):i=A in g("script")?function(e){p.appendChild(g("script"))[A]=function(){p.removeChild(this),I(e)}}:function(e){setTimeout(M(e),0)}),e.exports={set:b,clear:v}},d3c5:function(e,t,n){"use strict";n.d(t,"a",(function(){return T}));n("7a89"),n("d06e");var r=n("351d"),i=n("81ea"),o=n("24b5"),s=n("76ab"),a=n("491c"),l=n("3d76"),c=n("169f"),h=n("87d6");function u(e,t){p(e,t),t.add(e)}function d(e,t,n){p(e,t),t.set(e,n)}function p(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function f(e,t,n){return t=g(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){var t=m(e,"string");return"symbol"==typeof t?t:t+""}function m(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 y(e,t){return e.get(w(e,t))}function w(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 b=new Map([["plugin",o["c"]],["cell-type",s["c"]],["editor",a["d"]],["renderer",l["c"]],["validator",c["c"]]]),v="base",E=[];let C=null;var S=new WeakMap,R=new WeakSet;class T{static get PLUGIN_KEY(){return v}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}constructor(e){u(this,R),f(this,"eventManager",new h["a"](this)),f(this,"pluginName",null),f(this,"pluginsInitializedCallbacks",[]),f(this,"isPluginsReady",!1),f(this,"enabled",!1),f(this,"initialized",!1),d(this,S,{}),Object(r["defineGetter"])(this,"hot",e,{writable:!1}),C=null,this.hot.addHook("afterPluginsInitialized",()=>this.onAfterPluginsInitialized()),this.hot.addHook("afterUpdateSettings",e=>this.onUpdateSettings(e)),this.hot.addHook("beforeInit",()=>this.init())}init(){this.pluginName=this.hot.getPluginName(this);const e=this.constructor.PLUGIN_DEPS,t=Array.isArray(e)?e:[];if(t.length>0){const e=[];if(t.forEach(t=>{const[n,r]=t.split(":");if(!b.has(n))throw new Error(`Unknown plugin dependency type "${n}" was found.`);b.get(n)(r)||e.push(` - ${r} (${n})`)}),e.length>0){const t=[`The ${this.pluginName} plugin requires the following modules:\n`,e.join("\n")+"\n"].join("");E.push(t)}}C||(C=Object(o["b"])()),C.indexOf("UndoRedo")>=0&&C.splice(C.indexOf("UndoRedo"),1),C.indexOf(this.pluginName)>=0&&C.splice(C.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()});const n=0===C.length;if(n){if(E.length>0){const e=[E.join("\n")+"\n","You have to import and register them manually."].join("");throw new Error(e)}this.hot.runHooks("afterPluginsInitialized")}this.initialized=!0}enablePlugin(){this.enabled=!0}disablePlugin(){var e;null===(e=this.eventManager)||void 0===e||e.clear(),this.clearHooks(),this.enabled=!1}addHook(e,t){y(S,this)[e]=y(S,this)[e]||[];const n=y(S,this)[e];this.hot.addHook(e,t),n.push(t),y(S,this)[e]=n}removeHooks(e){Object(i["arrayEach"])(y(S,this)[e]||[],t=>{this.hot.removeHook(e,t)})}clearHooks(){const e=y(S,this);Object(r["objectEach"])(e,(e,t)=>this.removeHooks(t)),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){Object(i["arrayEach"])(this.pluginsInitializedCallbacks,e=>e()),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){const t=w(R,this,O).call(this,e);this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&t&&this.updatePlugin(e))}updatePlugin(){}destroy(){var e;null===(e=this.eventManager)||void 0===e||e.destroy(),this.clearHooks(),Object(r["objectEach"])(this,(e,t)=>{"hot"!==t&&(this[t]=null)}),delete this.t,delete this.hot}}function O(e){if(!e)return!1;const t=this.constructor.SETTING_KEYS;if("boolean"===typeof t)return t;for(let n=0;n<t.length;n++)if(void 0!==e[t[n]])return!0;return!1}},d3e6:function(e,t,n){"use strict";var r=n("7d61"),i=n("7b69"),o=n("088f"),s=n("71ca"),a=n("cbf2"),l=n("7dcf4"),c=n("1e92"),h=n("bb2a"),u=n("9582"),d=n("142d"),p=TypeError,f=function(e,t){this.stopped=e,this.result=t},g=f.prototype;e.exports=function(e,t,n){var m,y,w,b,v,E,C,S=n&&n.that,R=!(!n||!n.AS_ENTRIES),T=!(!n||!n.IS_RECORD),O=!(!n||!n.IS_ITERATOR),N=!(!n||!n.INTERRUPTED),A=r(t,S),I=function(e){return m&&d(m,"normal",e),new f(!0,e)},M=function(e){return R?(o(e),N?A(e[0],e[1],I):A(e[0],e[1])):N?A(e,I):A(e)};if(T)m=e.iterator;else if(O)m=e;else{if(y=u(e),!y)throw new p(s(e)+" is not iterable");if(a(y)){for(w=0,b=l(e);b>w;w++)if(v=M(e[w]),v&&c(g,v))return v;return new f(!1)}m=h(e,y)}E=T?e.next:m.next;while(!(C=i(E,m)).done){try{v=M(C.value)}catch(x){d(m,"throw",x)}if("object"==typeof v&&v&&c(g,v))return v}return new f(!1)}},d435:function(e,t,n){"use strict";var r=n("d128"),i=n("b343"),o=n("2179");e.exports=!r&&!i((function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},d62b:function(e,t,n){"use strict";e.exports=!1},d852:function(e,t,n){"use strict";n("7a89"),n("d06e");var r=n("0716");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{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];s(this,"highlight",null),s(this,"from",null),s(this,"to",null),i(this,d,!1),this.highlight=e.clone(),this.from=t.clone(),this.to=n.clone(),h(d,this,r)}setHighlight(e){return this.highlight=e.clone(),this}setFrom(e){return this.from=e.clone(),this}setTo(e){return this.to=e.clone(),this}isValid(e){return this.from.isValid(e)&&this.to.isValid(e)}isSingle(){return this.isSingleCell()||this.isSingleHeader()}isSingleCell(){return this.from.row>=0&&this.from.row===this.to.row&&this.from.col>=0&&this.from.col===this.to.col}isSingleHeader(){return(this.from.row<0||this.from.col<0)&&this.from.row===this.to.row&&this.from.col===this.to.col}isHeader(){return!(!this.from.isHeader()||!this.to.isHeader())||(this.from.col<0&&this.to.col<0||this.from.row<0&&this.to.row<0)}containsHeaders(){return this.from.isHeader()||this.to.isHeader()}getOuterHeight(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1}getOuterWidth(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1}getHeight(){if(this.from.row<0&&this.to.row<0)return 0;const e=Math.max(this.from.row,0),t=Math.max(this.to.row,0);return Math.max(e,t)-Math.min(e,t)+1}getWidth(){if(this.from.col<0&&this.to.col<0)return 0;const e=Math.max(this.from.col,0),t=Math.max(this.to.col,0);return Math.max(e,t)-Math.min(e,t)+1}getCellsCount(){return this.getWidth()*this.getHeight()}includes(e){const{row:t,col:n}=e,r=this.getOuterTopStartCorner(),i=this.getOuterBottomEndCorner();return r.row<=t&&i.row>=t&&r.col<=n&&i.col>=n}includesRange(e){return this.includes(e.getOuterTopStartCorner())&&this.includes(e.getOuterBottomEndCorner())}isEqual(e){return Math.min(this.from.row,this.to.row)===Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)===Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)===Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)===Math.max(e.from.col,e.to.col)}overlaps(e){return e.isSouthEastOf(this.getOuterTopLeftCorner())&&e.isNorthWestOf(this.getOuterBottomRightCorner())}isSouthEastOf(e){return this.getOuterTopLeftCorner().isSouthEastOf(e)||this.getOuterBottomRightCorner().isSouthEastOf(e)}isNorthWestOf(e){return this.getOuterTopLeftCorner().isNorthWestOf(e)||this.getOuterBottomRightCorner().isNorthWestOf(e)}isOverlappingHorizontally(e){return this.getOuterTopEndCorner().col>=e.getOuterTopStartCorner().col&&this.getOuterTopEndCorner().col<=e.getOuterTopEndCorner().col||this.getOuterTopStartCorner().col<=e.getOuterTopEndCorner().col&&this.getOuterTopStartCorner().col>=e.getOuterTopStartCorner().col}isOverlappingVertically(e){return this.getOuterBottomStartCorner().row>=e.getOuterTopRightCorner().row&&this.getOuterBottomStartCorner().row<=e.getOuterBottomStartCorner().row||this.getOuterTopEndCorner().row<=e.getOuterBottomStartCorner().row&&this.getOuterTopEndCorner().row>=e.getOuterTopRightCorner().row}expand(e){const t=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner();return(e.row<t.row||e.col<t.col||e.row>n.row||e.col>n.col)&&(this.from=this._createCellCoords(Math.min(t.row,e.row),Math.min(t.col,e.col)),this.to=this._createCellCoords(Math.max(n.row,e.row),Math.max(n.col,e.col)),!0)}expandByRange(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.includesRange(e)||!this.overlaps(e))return!1;const n=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner(),i=this.getDirection(),o=e.getOuterTopStartCorner(),s=e.getOuterBottomEndCorner(),a=Math.min(n.row,o.row),l=Math.min(n.col,o.col),c=Math.max(r.row,s.row),h=Math.max(r.col,s.col),u=this._createCellCoords(a,l),d=this._createCellCoords(c,h);return this.from=u,this.to=d,this.setDirection(i),t&&(this.highlight.row===this.getOuterBottomRightCorner().row&&"N-S"===this.getVerticalDirection()&&this.flipDirectionVertically(),this.highlight.col===this.getOuterTopRightCorner().col&&"W-E"===this.getHorizontalDirection()&&this.flipDirectionHorizontally()),!0}getDirection(){return this.from.isNorthWestOf(this.to)?"NW-SE":this.from.isNorthEastOf(this.to)?"NE-SW":this.from.isSouthEastOf(this.to)?"SE-NW":this.from.isSouthWestOf(this.to)?"SW-NE":void 0}setDirection(e){switch(e){case"NW-SE":[this.from,this.to]=[this.getOuterTopLeftCorner(),this.getOuterBottomRightCorner()];break;case"NE-SW":[this.from,this.to]=[this.getOuterTopRightCorner(),this.getOuterBottomLeftCorner()];break;case"SE-NW":[this.from,this.to]=[this.getOuterBottomRightCorner(),this.getOuterTopLeftCorner()];break;case"SW-NE":[this.from,this.to]=[this.getOuterBottomLeftCorner(),this.getOuterTopRightCorner()];break;default:break}}getVerticalDirection(){return["NE-SW","NW-SE"].indexOf(this.getDirection())>-1?"N-S":"S-N"}getHorizontalDirection(){return["NW-SE","SW-NE"].indexOf(this.getDirection())>-1?"W-E":"E-W"}flipDirectionVertically(){const e=this.getDirection();switch(e){case"NW-SE":this.setDirection("SW-NE");break;case"NE-SW":this.setDirection("SE-NW");break;case"SE-NW":this.setDirection("NE-SW");break;case"SW-NE":this.setDirection("NW-SE");break;default:break}}flipDirectionHorizontally(){const e=this.getDirection();switch(e){case"NW-SE":this.setDirection("NE-SW");break;case"NE-SW":this.setDirection("NW-SE");break;case"SE-NW":this.setDirection("SW-NE");break;case"SW-NE":this.setDirection("SE-NW");break;default:break}}getTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getTopLeftCorner(){return c(d,this)?this.getTopEndCorner():this.getTopStartCorner()}getBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getBottomRightCorner(){return c(d,this)?this.getBottomStartCorner():this.getBottomEndCorner()}getTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getTopRightCorner(){return c(d,this)?this.getTopStartCorner():this.getTopEndCorner()}getBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getBottomLeftCorner(){return c(d,this)?this.getBottomEndCorner():this.getBottomStartCorner()}getOuterTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterTopLeftCorner(){return c(d,this)?this.getOuterTopEndCorner():this.getOuterTopStartCorner()}getOuterBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterBottomRightCorner(){return c(d,this)?this.getOuterBottomStartCorner():this.getOuterBottomEndCorner()}getOuterTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterTopRightCorner(){return c(d,this)?this.getOuterTopStartCorner():this.getOuterTopEndCorner()}getOuterBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterBottomLeftCorner(){return c(d,this)?this.getOuterBottomEndCorner():this.getOuterBottomStartCorner()}isCorner(e){return e.isEqual(this.getOuterTopLeftCorner())||e.isEqual(this.getOuterTopRightCorner())||e.isEqual(this.getOuterBottomLeftCorner())||e.isEqual(this.getOuterBottomRightCorner())}getOppositeCorner(e){return e instanceof r["a"]&&(e.isEqual(this.getOuterBottomEndCorner())?this.getOuterTopStartCorner():e.isEqual(this.getOuterTopStartCorner())?this.getOuterBottomEndCorner():e.isEqual(this.getOuterTopEndCorner())?this.getOuterBottomStartCorner():e.isEqual(this.getOuterBottomStartCorner())?this.getOuterTopEndCorner():void 0)}getBordersSharedWith(e){if(!this.includesRange(e))return[];const t={top:Math.min(this.from.row,this.to.row),bottom:Math.max(this.from.row,this.to.row),left:Math.min(this.from.col,this.to.col),right:Math.max(this.from.col,this.to.col)},n={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},r=[];return t.top===n.top&&r.push("top"),t.right===n.right&&r.push(c(d,this)?"left":"right"),t.bottom===n.bottom&&r.push("bottom"),t.left===n.left&&r.push(c(d,this)?"right":"left"),r}getInner(){const e=this.getOuterTopStartCorner(),t=this.getOuterBottomEndCorner(),n=[];for(let r=e.row;r<=t.row;r++)for(let i=e.col;i<=t.col;i++)this.from.row===r&&this.from.col===i||this.to.row===r&&this.to.col===i||n.push(this._createCellCoords(r,i));return n}getAll(){const e=this.getOuterTopStartCorner(),t=this.getOuterBottomEndCorner(),n=[];for(let r=e.row;r<=t.row;r++)for(let i=e.col;i<=t.col;i++)e.row===r&&e.col===i?n.push(e):t.row===r&&t.col===i?n.push(t):n.push(this._createCellCoords(r,i));return n}forAll(e){const t=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner();for(let r=t.row;r<=n.row;r++)for(let i=t.col;i<=n.col;i++){const t=e(r,i);if(!1===t)return}}clone(){return new p(this.highlight,this.from,this.to,c(d,this))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,t){return new r["a"](e,t,c(d,this))}}t["a"]=p},dd49:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n("a357c"),i=n("5d7f"),o=n("7b9c");const s="text";function a(e,t,n,s,a,l,c){r["a"].apply(this,[e,t,n,s,a,l,c]);let h=l;if(!h&&c.placeholder&&(h=c.placeholder),h=Object(o["stringify"])(h),c.trimWhitespace&&(h=h.trim()),c.rendererTemplate){Object(i["empty"])(t);const r=e.rootDocument.createElement("TEMPLATE");r.setAttribute("bind","{{}}"),r.innerHTML=c.rendererTemplate,HTMLTemplateElement.decorate(r),r.model=e.getSourceDataAtRow(n),t.appendChild(r)}else Object(i["fastInnerText"])(t,h)}a.RENDERER_TYPE=s},dd8d:function(e,t,n){"use strict";var r=n("65c6");e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},de26:function(e,t,n){"use strict";var r=n("54d7");e.exports=function(e,t){return r[e]||(r[e]=t||{})}},de3b:function(e,t,n){"use strict";function r(e){e.isImmediatePropagationEnabled=!1,e.cancelBubble=!0}function i(e){return!1===e.isImmediatePropagationEnabled}function o(e){return 2===e.button}function s(e){return 0===e.button}function a(e,t){const n={x:e.offsetX,y:e.offsetY};let r=e.target;if(!(t instanceof HTMLElement)||r!==t&&r.contains(t))return n;while(r!==t)n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;return n}n.r(t),n.d(t,"stopImmediatePropagation",(function(){return r})),n.d(t,"isImmediatePropagationStopped",(function(){return i})),n.d(t,"isRightClick",(function(){return o})),n.d(t,"isLeftClick",(function(){return s})),n.d(t,"offsetRelativeTo",(function(){return a}))},e156:function(e,t,n){"use strict";var r=n("12e9"),i=n("73fa"),o=n("939b"),s=n("80dd"),a=s("toStringTag"),l=Object,c="Arguments"===o(function(){return arguments}()),h=function(e,t){try{return e[t]}catch(n){}};e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=h(t=l(e),a))?n:c?o(t):"Object"===(r=o(t))&&i(t.callee)?"Arguments":r}},e1c6:function(e,t,n){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},e437:function(e,t,n){"use strict";var r=n("c0d8"),i=n("8c7e"),o=n("87d6"),s=n("c5cd");n("7a89");function a(e){const t="undefined"!==typeof window&&window.jQuery;t&&(t.fn.handsontable=function(t){const n=this.first();let r,i=n.data("handsontable");if("string"!==typeof t){const r=t||{};return i?i.updateSettings(r):(i=new e.Core(n[0],r),n.data("handsontable",i),i.init()),n}if(i){if("undefined"===typeof i[t])throw new Error("Handsontable do not provide action: "+t);for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];r=i[t].call(i,...s),"destroy"===t&&n.removeData()}return r})}var l,c,h,u,d,p=n("220a"),f=n("a776"),g=n("81ea"),m=n("63d8"),y=n("480c"),w=n("3eb5"),b=n("7dd09"),v=n("97b9"),E=n("7b9c"),C=n("ffec"),S=n("351d"),R=n("29b0"),T=n("f938"),O=n("5d7f"),N=n("de3b"),A=n("491c"),I=n("3d76"),M=n("169f"),x=n("76ab"),_=n("24b5"),L=n("d3c5");Object(i["a"])(),a(r["a"]),r["a"].__GhostTable=p["a"],r["a"]._getListenersCounter=o["b"],r["a"]._getRegisteredMapsCounter=s["b"],r["a"].EventManager=o["a"];const P=[g,m,y,w,b,v,E,C,S,R,T,f],k=[O,N];r["a"].helper={},r["a"].dom={},g["arrayEach"](P,e=>{g["arrayEach"](Object.getOwnPropertyNames(e),t=>{"_"!==t.charAt(0)&&(r["a"].helper[t]=e[t])})}),g["arrayEach"](k,e=>{g["arrayEach"](Object.getOwnPropertyNames(e),t=>{"_"!==t.charAt(0)&&(r["a"].dom[t]=e[t])})}),r["a"].cellTypes=null!==(l=r["a"].cellTypes)&&void 0!==l?l:{},g["arrayEach"](Object(x["b"])(),e=>{r["a"].cellTypes[e]=Object(x["a"])(e)}),r["a"].cellTypes.registerCellType=x["d"],r["a"].cellTypes.getCellType=x["a"],r["a"].editors=null!==(c=r["a"].editors)&&void 0!==c?c:{},g["arrayEach"](Object(A["c"])(),e=>{r["a"].editors[R["toUpperCaseFirst"](e)+"Editor"]=Object(A["a"])(e)}),r["a"].editors.registerEditor=A["e"],r["a"].editors.getEditor=A["a"],r["a"].renderers=null!==(h=r["a"].renderers)&&void 0!==h?h:{},g["arrayEach"](Object(I["a"])(),e=>{const t=Object(I["b"])(e);"base"===e&&(r["a"].renderers.cellDecorator=t),r["a"].renderers[R["toUpperCaseFirst"](e)+"Renderer"]=t}),r["a"].renderers.registerRenderer=I["d"],r["a"].renderers.getRenderer=I["b"],r["a"].validators=null!==(u=r["a"].validators)&&void 0!==u?u:{},g["arrayEach"](Object(M["a"])(),e=>{r["a"].validators[R["toUpperCaseFirst"](e)+"Validator"]=Object(M["b"])(e)}),r["a"].validators.registerValidator=M["d"],r["a"].validators.getValidator=M["b"],r["a"].plugins=null!==(d=r["a"].plugins)&&void 0!==d?d:{},g["arrayEach"](Object(_["b"])(),e=>{r["a"].plugins[e]=Object(_["a"])(e)}),r["a"].plugins[R["toUpperCaseFirst"](L["a"].PLUGIN_KEY)+"Plugin"]=L["a"],r["a"].plugins.registerPlugin=_["d"],r["a"].plugins.getPlugin=_["a"];t["a"]=r["a"]},e90f:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return s}));var r=n("97b9"),i=n("81ea");function o(e,t,n,i){const o=n.length?n[0]:void 0;return[...e.slice(0,o),...n.map((e,t)=>Object(r["isFunction"])(i)?i(e,t):i),...void 0===o?[]:e.slice(o)]}function s(e,t){return Object(i["arrayFilter"])(e,(e,n)=>!1===t.includes(n))}},eb36: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_HEIGHT(){return 23}constructor(e){s(this,"count",0),s(this,"startRow",null),s(this,"endRow",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,rowHeightFn:n,scrollOffset:i,totalRows:o,viewportHeight:s}=c(d,this),a=Math.max(c(d,this).scrollOffset,0),l=c(d,this).horizontalScrollbarHeight||0;let h=0,u=!0;const f=[];let g,m=0,y=0;for(let c=0;c<o;c++)if(g=n(c),isNaN(g)&&(g=p.DEFAULT_HEIGHT),h<=a&&e!==r["a"]&&(this.startRow=c,m=g),h>=a&&h+(e===r["a"]?g:0)<=a+s-l&&(null===this.startRow&&(this.startRow=c,m=g),this.endRow=c),f.push(h),h+=g,y=g,e!==r["a"]&&(this.endRow=c),h>=a+s-l){u=!1;break}const w=i+s-l,b=e===r["a"]?m:0,v=e===r["a"]?0:y;if(w<b||i>f.at(-1)+v?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,this.endRow===o-1&&u){this.startRow=this.endRow;while(this.startRow>0){const t=f[this.endRow]+g-f[this.startRow-1];if((t<=s-l||e!==r["a"])&&(this.startRow-=1),t>=s-l)break}}e===r["c"]&&null!==this.startRow&&t&&t(this),this.startPosition=f[this.startRow],void 0===this.startPosition&&(this.startPosition=null),o<this.endRow&&(this.endRow=o-1),null!==this.startRow&&(this.count=this.endRow-this.startRow+1)}}},ef07:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n("03529"),i=n("dd49");const o="text",s={CELL_TYPE:o,editor:r["a"],renderer:i["a"]}},f072:function(e,t,n){"use strict";var r=n("fd18"),i=n("73fa"),o=n("54d7"),s=r(Function.toString);i(o.inspectSource)||(o.inspectSource=function(e){return s(e)}),e.exports=o.inspectSource},f2e8:function(e,t,n){"use strict";(function(t){var n=function(e){return e&&e.Math===Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()}).call(this,n("c8ba"))},f41c:function(e,t,n){"use strict";var r=n("80dd"),i=n("0ad8"),o=n("a60d").f,s=r("unscopables"),a=Array.prototype;void 0===a[s]&&o(a,s,{configurable:!0,value:i(null)}),e.exports=function(e){a[s][e]=!0}},f4db:function(e,t,n){"use strict";n("0eec"),n("59a2")},f6cb:function(e,t,n){"use strict";var r=n("f2e8"),i=n("0204"),o=n("73fa"),s=n("b46a"),a=n("65c6"),l=n("9674"),c=n("6038"),h=r.Function,u=/MSIE .\./.test(a)||s&&function(){var e=r.Bun.version.split(".");return e.length<3||"0"===e[0]&&(e[1]<3||"3"===e[1]&&"0"===e[2])}();e.exports=function(e,t){var n=t?2:1;return u?function(r,s){var a=c(arguments.length,1)>n,u=o(r)?r:h(r),d=a?l(arguments,n):[],p=a?function(){i(u,this,d)}:u;return t?e(p,s):e(p)}:e}},f808:function(e,t,n){"use strict";var r=n("0227");e.exports=r("document","documentElement")},f938:function(e,t,n){"use strict";n.r(t),n.d(t,"KEY_CODES",(function(){return o})),n.d(t,"isPrintableChar",(function(){return a})),n.d(t,"isFunctionKey",(function(){return l})),n.d(t,"isCtrlKey",(function(){return c})),n.d(t,"isCtrlMetaKey",(function(){return h})),n.d(t,"isKey",(function(){return u}));n("d06e");var r=n("81ea"),i=n("63d8");const o={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:Object(i["isFirefox"])()?182:174,AUDIO_MUTE:Object(i["isFirefox"])()?181:173,AUDIO_UP:Object(i["isFirefox"])()?183:175,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND_LEFT:91,COMMAND_RIGHT:93,COMMAND_FIREFOX:224,CONTROL:17,DELETE:46,END:35,ENTER:13,ESCAPE:27,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,F16:127,F17:128,F18:129,F19:130,HOME:36,INSERT:45,MEDIA_NEXT:176,MEDIA_PLAY_PAUSE:179,MEDIA_PREV:177,MEDIA_STOP:178,NULL:0,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PERIOD:190,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,A:65,C:67,D:68,F:70,L:76,O:79,P:80,S:83,V:86,X:88,Y:89,Z:90},s=[o.ALT,o.ARROW_DOWN,o.ARROW_LEFT,o.ARROW_RIGHT,o.ARROW_UP,o.AUDIO_DOWN,o.AUDIO_MUTE,o.AUDIO_UP,o.BACKSPACE,o.CAPS_LOCK,o.DELETE,o.END,o.ENTER,o.ESCAPE,o.F1,o.F2,o.F3,o.F4,o.F5,o.F6,o.F7,o.F8,o.F9,o.F10,o.F11,o.F12,o.F13,o.F14,o.F15,o.F16,o.F17,o.F18,o.F19,o.HOME,o.INSERT,o.MEDIA_NEXT,o.MEDIA_PLAY_PAUSE,o.MEDIA_PREV,o.MEDIA_STOP,o.NULL,o.NUM_LOCK,o.PAGE_DOWN,o.PAGE_UP,o.PAUSE,o.SCROLL_LOCK,o.SHIFT,o.TAB];function a(e){return 32===e||e>=48&&e<=57||e>=96&&e<=111||e>=186&&e<=192||e>=219&&e<=222||e>=226||e>=65&&e<=90}function l(e){return s.includes(e)}function c(e){const t=[];return Object(i["isMacOS"])()?t.push(o.COMMAND_LEFT,o.COMMAND_RIGHT,o.COMMAND_FIREFOX):t.push(o.CONTROL),t.includes(e)}function h(e){return[o.CONTROL,o.COMMAND_LEFT,o.COMMAND_RIGHT,o.COMMAND_FIREFOX].includes(e)}function u(e,t){const n=t.split("|");let i=!1;return Object(r["arrayEach"])(n,t=>{if(e===o[t])return i=!0,!1}),i}},fa83:function(e,t,n){"use strict";n.r(t),n.d(t,"VERSION",(function(){return r})),n.d(t,"Parser",(function(){return qr})),n.d(t,"CstParser",(function(){return Qr})),n.d(t,"EmbeddedActionsParser",(function(){return Zr})),n.d(t,"ParserDefinitionErrorType",(function(){return Yr})),n.d(t,"EMPTY_ALT",(function(){return $r})),n.d(t,"Lexer",(function(){return Se})),n.d(t,"LexerDefinitionErrorType",(function(){return ve})),n.d(t,"createToken",(function(){return je})),n.d(t,"createTokenInstance",(function(){return Fe})),n.d(t,"EOF",(function(){return De})),n.d(t,"tokenLabel",(function(){return Re})),n.d(t,"tokenMatcher",(function(){return Ue})),n.d(t,"tokenName",(function(){return Te})),n.d(t,"defaultGrammarResolverErrorProvider",(function(){return Wn})),n.d(t,"defaultGrammarValidatorErrorProvider",(function(){return Gn})),n.d(t,"defaultParserErrorProvider",(function(){return Bn})),n.d(t,"EarlyExitException",(function(){return sr})),n.d(t,"isRecognitionException",(function(){return nr})),n.d(t,"MismatchedTokenException",(function(){return rr})),n.d(t,"NotAllInputParsedException",(function(){return or})),n.d(t,"NoViableAltException",(function(){return ir})),n.d(t,"defaultLexerErrorProvider",(function(){return Ee})),n.d(t,"Alternation",(function(){return Qe})),n.d(t,"Flat",(function(){return ze})),n.d(t,"NonTerminal",(function(){return We})),n.d(t,"Option",(function(){return Ye})),n.d(t,"Repetition",(function(){return $e})),n.d(t,"RepetitionMandatory",(function(){return Xe})),n.d(t,"RepetitionMandatoryWithSeparator",(function(){return Ke})),n.d(t,"RepetitionWithSeparator",(function(){return qe})),n.d(t,"Rule",(function(){return Ge})),n.d(t,"Terminal",(function(){return Ze})),n.d(t,"serializeGrammar",(function(){return Je})),n.d(t,"serializeProduction",(function(){return et})),n.d(t,"GAstVisitor",(function(){return rt})),n.d(t,"assignOccurrenceIndices",(function(){return qn})),n.d(t,"resolveGrammar",(function(){return Kn})),n.d(t,"validateGrammar",(function(){return $n})),n.d(t,"clearCache",(function(){return yi})),n.d(t,"createSyntaxDiagramsCode",(function(){return Jr})),n.d(t,"generateParserFactory",(function(){return gi})),n.d(t,"generateParserModule",(function(){return mi}));var r="6.5.0",i=n("77aa"),o=n("890f"),s={},a=new o["RegExpParser"];function l(e){var t=e.toString();if(s.hasOwnProperty(t))return s[t];var n=a.pattern(t);return s[t]=n,n}function c(){s={}}var h=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),u="Complement Sets are not supported for first char optimization",d='Unable to use "first char" lexer optimizations:\n';function p(e,t){void 0===t&&(t=!1);try{var n=l(e),r=f(n.value,{},n.flags.ignoreCase);return r}catch(a){if(a.message===u)t&&Object(i["d"])(d+"\tUnable to optimize: < "+e.toString()+" >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.");else{var s="";t&&(s="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),Object(i["c"])(d+"\n\tFailed parsing: < "+e.toString()+" >\n\tUsing the regexp-to-ast library version: "+o["VERSION"]+"\n\tPlease open an issue at: https://github.com/bd82/regexp-to-ast/issues"+s)}}return[]}function f(e,t,n){switch(e.type){case"Disjunction":for(var r=0;r<e.value.length;r++)f(e.value[r],t,n);break;case"Alternative":var o=e.value;for(r=0;r<o.length;r++){var s=o[r];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var a=s;switch(a.type){case"Character":g(a.value,t,n);break;case"Set":if(!0===a.complement)throw Error(u);Object(i["u"])(a.value,(function(e){if("number"===typeof e)g(e,t,n);else{var r=e;if(!0===n)for(var i=r.from;i<=r.to;i++)g(i,t,n);else{for(i=r.from;i<=r.to&&i<te;i++)g(i,t,n);if(r.to>=te)for(var o=r.from>=te?r.from:te,s=r.to,a=ne(o),l=ne(s),c=a;c<=l;c++)t[c]=c}}}));break;case"Group":f(a.value,t,n);break;default:throw Error("Non Exhaustive Match")}var l=void 0!==a.quantifier&&0===a.quantifier.atLeast;if("Group"===a.type&&!1===w(a)||"Group"!==a.type&&!1===l)break}break;default:throw Error("non exhaustive match!")}return Object(i["U"])(t)}function g(e,t,n){var r=ne(e);t[r]=r,!0===n&&m(e,t)}function m(e,t){var n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){var i=ne(r.charCodeAt(0));t[i]=i}else{var o=n.toLowerCase();if(o!==n){i=ne(o.charCodeAt(0));t[i]=i}}}function y(e,t){return Object(i["q"])(e.value,(function(e){if("number"===typeof e)return Object(i["j"])(t,e);var n=e;return void 0!==Object(i["q"])(t,(function(e){return n.from<=e&&e<=n.to}))}))}function w(e){return!(!e.quantifier||0!==e.quantifier.atLeast)||!!e.value&&(Object(i["y"])(e.value)?Object(i["o"])(e.value,w):w(e.value))}var b=function(e){function t(t){var n=e.call(this)||this;return n.targetCharCodes=t,n.found=!1,n}return h(t,e),t.prototype.visitChildren=function(t){if(!0!==this.found){switch(t.type){case"Lookahead":return void this.visitLookahead(t);case"NegativeLookahead":return void this.visitNegativeLookahead(t)}e.prototype.visitChildren.call(this,t)}},t.prototype.visitCharacter=function(e){Object(i["j"])(this.targetCharCodes,e.value)&&(this.found=!0)},t.prototype.visitSet=function(e){e.complement?void 0===y(e,this.targetCharCodes)&&(this.found=!0):void 0!==y(e,this.targetCharCodes)&&(this.found=!0)},t}(o["BaseRegExpVisitor"]);function v(e,t){if(t instanceof RegExp){var n=l(t),r=new b(e);return r.visit(n),r.found}return void 0!==Object(i["q"])(t,(function(t){return Object(i["j"])(e,t.charCodeAt(0))}))}var E=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C="PATTERN",S="defaultMode",R="modes",T="boolean"===typeof new RegExp("(?:)").sticky;function O(e,t){t=Object(i["k"])(t,{useSticky:T,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:function(e,t){return t()}});var n,r=t.tracer;r("initCharCodeToOptimizedIndexMap",(function(){ie()})),r("Reject Lexer.NA",(function(){n=Object(i["P"])(e,(function(e){return e[C]===Se.NA}))}));var o,s,a,l,c,h,u,f,g,m,y,w=!1;r("Transform Patterns",(function(){w=!1,o=Object(i["I"])(n,(function(e){var n=e[C];if(Object(i["D"])(n)){var r=n.source;return 1===r.length&&"^"!==r&&"$"!==r&&"."!==r?r:2!==r.length||"\\"!==r[0]||Object(i["j"])(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],r[1])?t.useSticky?G(n):W(n):r[1]}if(Object(i["B"])(n))return w=!0,{exec:n};if(Object(i["w"])(n,"exec"))return w=!0,n;if("string"===typeof n){if(1===n.length)return n;var o=n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),s=new RegExp(o);return t.useSticky?G(s):W(s)}throw Error("non exhaustive match")}))})),r("misc mapping",(function(){s=Object(i["I"])(n,(function(e){return e.tokenTypeIdx})),a=Object(i["I"])(n,(function(e){var t=e.GROUP;if(t!==Se.SKIPPED){if(Object(i["E"])(t))return t;if(Object(i["F"])(t))return!1;throw Error("non exhaustive match")}})),l=Object(i["I"])(n,(function(e){var t=e.LONGER_ALT;if(t){var r=Object(i["x"])(n,t);return r}})),c=Object(i["I"])(n,(function(e){return e.PUSH_MODE})),h=Object(i["I"])(n,(function(e){return Object(i["w"])(e,"POP_MODE")}))})),r("Line Terminator Handling",(function(){var e=J(t.lineTerminatorCharacters);u=Object(i["I"])(n,(function(e){return!1})),"onlyOffset"!==t.positionTracking&&(u=Object(i["I"])(n,(function(t){return Object(i["w"])(t,"LINE_BREAKS")?t.LINE_BREAKS:!1===Q(t,e)?v(e,t.PATTERN):void 0})))})),r("Misc Mapping #2",(function(){f=Object(i["I"])(n,K),g=Object(i["I"])(o,$),m=Object(i["O"])(n,(function(e,t){var n=t.GROUP;return Object(i["E"])(n)&&n!==Se.SKIPPED&&(e[n]=[]),e}),{}),y=Object(i["I"])(o,(function(e,t){return{pattern:o[t],longerAlt:l[t],canLineTerminator:u[t],isCustom:f[t],short:g[t],group:a[t],push:c[t],pop:h[t],tokenTypeIdx:s[t],tokenType:n[t]}}))}));var b=!0,E=[];return t.safeMode||r("First Char Optimization",(function(){E=Object(i["O"])(n,(function(e,n,r){if("string"===typeof n.PATTERN){var o=n.PATTERN.charCodeAt(0),s=ne(o);ee(e,s,y[r])}else if(Object(i["y"])(n.START_CHARS_HINT)){var a;Object(i["u"])(n.START_CHARS_HINT,(function(t){var n="string"===typeof t?t.charCodeAt(0):t,i=ne(n);a!==i&&(a=i,ee(e,i,y[r]))}))}else if(Object(i["D"])(n.PATTERN))if(n.PATTERN.unicode)b=!1,t.ensureOptimizations&&Object(i["c"])(d+"\tUnable to analyze < "+n.PATTERN.toString()+" > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE");else{var l=p(n.PATTERN,t.ensureOptimizations);Object(i["A"])(l)&&(b=!1),Object(i["u"])(l,(function(t){ee(e,t,y[r])}))}else t.ensureOptimizations&&Object(i["c"])(d+"\tTokenType: <"+n.name+"> is using a custom token pattern without providing <start_chars_hint> parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE"),b=!1;return e}),[])})),r("ArrayPacking",(function(){E=Object(i["L"])(E)})),{emptyGroups:m,patternIdxToConfig:y,charCodeToPatternIdxToConfig:E,hasCustom:w,canBeOptimized:b}}function N(e,t){var n=[],r=I(e);n=n.concat(r.errors);var i=M(r.valid),o=i.valid;return n=n.concat(i.errors),n=n.concat(A(o)),n=n.concat(D(o)),n=n.concat(F(o,t)),n=n.concat(U(o)),n}function A(e){var t=[],n=Object(i["p"])(e,(function(e){return Object(i["D"])(e[C])}));return t=t.concat(_(n)),t=t.concat(k(n)),t=t.concat(j(n)),t=t.concat(H(n)),t=t.concat(L(n)),t}function I(e){var t=Object(i["p"])(e,(function(e){return!Object(i["w"])(e,C)})),n=Object(i["I"])(t,(function(e){return{message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:ve.MISSING_PATTERN,tokenTypes:[e]}})),r=Object(i["l"])(e,t);return{errors:n,valid:r}}function M(e){var t=Object(i["p"])(e,(function(e){var t=e[C];return!Object(i["D"])(t)&&!Object(i["B"])(t)&&!Object(i["w"])(t,"exec")&&!Object(i["E"])(t)})),n=Object(i["I"])(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:ve.INVALID_PATTERN,tokenTypes:[e]}})),r=Object(i["l"])(e,t);return{errors:n,valid:r}}var x=/[^\\][\$]/;function _(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return E(t,e),t.prototype.visitEndAnchor=function(e){this.found=!0},t}(o["BaseRegExpVisitor"]),n=Object(i["p"])(e,(function(e){var n=e[C];try{var r=l(n),i=new t;return i.visit(r),i.found}catch(o){return x.test(n.source)}})),r=Object(i["I"])(n,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:ve.EOI_ANCHOR_FOUND,tokenTypes:[e]}}));return r}function L(e){var t=Object(i["p"])(e,(function(e){var t=e[C];return t.test("")})),n=Object(i["I"])(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:ve.EMPTY_MATCH_PATTERN,tokenTypes:[e]}}));return n}var P=/[^\\[][\^]|^\^/;function k(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return E(t,e),t.prototype.visitStartAnchor=function(e){this.found=!0},t}(o["BaseRegExpVisitor"]),n=Object(i["p"])(e,(function(e){var n=e[C];try{var r=l(n),i=new t;return i.visit(r),i.found}catch(o){return P.test(n.source)}})),r=Object(i["I"])(n,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:ve.SOI_ANCHOR_FOUND,tokenTypes:[e]}}));return r}function j(e){var t=Object(i["p"])(e,(function(e){var t=e[C];return t instanceof RegExp&&(t.multiline||t.global)})),n=Object(i["I"])(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:ve.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}}));return n}function H(e){var t=[],n=Object(i["I"])(e,(function(n){return Object(i["O"])(e,(function(e,r){return n.PATTERN.source!==r.PATTERN.source||Object(i["j"])(t,r)||r.PATTERN===Se.NA||(t.push(r),e.push(r)),e}),[])}));n=Object(i["i"])(n);var r=Object(i["p"])(n,(function(e){return e.length>1})),o=Object(i["I"])(r,(function(e){var t=Object(i["I"])(e,(function(e){return e.name})),n=Object(i["s"])(e).PATTERN;return{message:"The same RegExp pattern ->"+n+"<-has been used in all of the following Token Types: "+t.join(", ")+" <-",type:ve.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}}));return o}function D(e){var t=Object(i["p"])(e,(function(e){if(!Object(i["w"])(e,"GROUP"))return!1;var t=e.GROUP;return t!==Se.SKIPPED&&t!==Se.NA&&!Object(i["E"])(t)})),n=Object(i["I"])(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:ve.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}}));return n}function F(e,t){var n=Object(i["p"])(e,(function(e){return void 0!==e.PUSH_MODE&&!Object(i["j"])(t,e.PUSH_MODE)})),r=Object(i["I"])(n,(function(e){var t="Token Type: ->"+e.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+e.PUSH_MODE+"<-which does not exist";return{message:t,type:ve.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}}));return r}function U(e){var t=[],n=Object(i["O"])(e,(function(e,t,n){var r=t.PATTERN;return r===Se.NA||(Object(i["E"])(r)?e.push({str:r,idx:n,tokenType:t}):Object(i["D"])(r)&&B(r)&&e.push({str:r.source,idx:n,tokenType:t})),e}),[]);return Object(i["u"])(e,(function(e,r){Object(i["u"])(n,(function(n){var i=n.str,o=n.idx,s=n.tokenType;if(r<o&&V(i,e.PATTERN)){var a="Token: ->"+s.name+"<- can never be matched.\nBecause it appears AFTER the Token Type ->"+e.name+"<-in the lexer's definition.\nSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNREACHABLE";t.push({message:a,type:ve.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}}))})),t}function V(e,t){if(Object(i["D"])(t)){var n=t.exec(e);return null!==n&&0===n.index}if(Object(i["B"])(t))return t(e,0,[],{});if(Object(i["w"])(t,"exec"))return t.exec(e,0,[],{});if("string"===typeof t)return t===e;throw Error("non exhaustive match")}function B(e){var t=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return void 0===Object(i["q"])(t,(function(t){return-1!==e.source.indexOf(t)}))}function W(e){var t=e.ignoreCase?"i":"";return new RegExp("^(?:"+e.source+")",t)}function G(e){var t=e.ignoreCase?"iy":"y";return new RegExp(""+e.source,t)}function z(e,t,n){var r=[];return Object(i["w"])(e,S)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+S+"> property in its definition\n",type:ve.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object(i["w"])(e,R)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+R+"> property in its definition\n",type:ve.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object(i["w"])(e,R)&&Object(i["w"])(e,S)&&!Object(i["w"])(e.modes,e.defaultMode)&&r.push({message:"A MultiMode Lexer cannot be initialized with a "+S+": <"+e.defaultMode+">which does not exist\n",type:ve.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object(i["w"])(e,R)&&Object(i["u"])(e.modes,(function(e,t){Object(i["u"])(e,(function(e,n){Object(i["F"])(e)&&r.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:<"+t+"> at index: <"+n+">\n",type:ve.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})}))})),r}function Y(e,t,n){var r=[],o=!1,s=Object(i["i"])(Object(i["t"])(Object(i["J"])(e.modes,(function(e){return e})))),a=Object(i["P"])(s,(function(e){return e[C]===Se.NA})),l=J(n);return t&&Object(i["u"])(a,(function(e){var t=Q(e,l);if(!1!==t){var n=Z(e,t),s={message:n,type:t.issue,tokenType:e};r.push(s)}else Object(i["w"])(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(o=!0):v(l,e.PATTERN)&&(o=!0)})),t&&!o&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:ve.NO_LINE_BREAKS_FLAGS}),r}function X(e){var t={},n=Object(i["G"])(e);return Object(i["u"])(n,(function(n){var r=e[n];if(!Object(i["y"])(r))throw Error("non exhaustive match");t[n]=[]})),t}function K(e){var t=e.PATTERN;if(Object(i["D"])(t))return!1;if(Object(i["B"])(t))return!0;if(Object(i["w"])(t,"exec"))return!0;if(Object(i["E"])(t))return!1;throw Error("non exhaustive match")}function $(e){return!(!Object(i["E"])(e)||1!==e.length)&&e.charCodeAt(0)}var q={test:function(e){for(var t=e.length,n=this.lastIndex;n<t;n++){var r=e.charCodeAt(n);if(10===r)return this.lastIndex=n+1,!0;if(13===r)return 10===e.charCodeAt(n+1)?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function Q(e,t){if(Object(i["w"])(e,"LINE_BREAKS"))return!1;if(Object(i["D"])(e.PATTERN)){try{v(t,e.PATTERN)}catch(n){return{issue:ve.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}if(Object(i["E"])(e.PATTERN))return!1;if(K(e))return{issue:ve.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function Z(e,t){if(t.issue===ve.IDENTIFY_TERMINATOR)return"Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <"+e.name+"> Token Type\n\t Root cause: "+t.errMsg+".\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(t.issue===ve.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the <line_breaks> option.\n\tThe problem is in the <"+e.name+"> Token Type\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}function J(e){var t=Object(i["I"])(e,(function(e){return Object(i["E"])(e)&&e.length>0?e.charCodeAt(0):e}));return t}function ee(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}var te=256;function ne(e){return e<te?e:re[e]}var re=[];function ie(){if(Object(i["A"])(re)){re=new Array(65536);for(var e=0;e<65536;e++)re[e]=e>255?255+~~(e/255):e}}function oe(e,t){var n=e.tokenTypeIdx;return n===t.tokenTypeIdx||!0===t.isParent&&!0===t.categoryMatchesMap[n]}function se(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}var ae=1,le={};function ce(e){var t=he(e);ue(t),pe(t),de(t),Object(i["u"])(t,(function(e){e.isParent=e.categoryMatches.length>0}))}function he(e){var t=Object(i["g"])(e),n=e,r=!0;while(r){n=Object(i["i"])(Object(i["t"])(Object(i["I"])(n,(function(e){return e.CATEGORIES}))));var o=Object(i["l"])(n,t);t=t.concat(o),Object(i["A"])(o)?r=!1:n=o}return t}function ue(e){Object(i["u"])(e,(function(e){ge(e)||(le[ae]=e,e.tokenTypeIdx=ae++),me(e)&&!Object(i["y"])(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),me(e)||(e.CATEGORIES=[]),ye(e)||(e.categoryMatches=[]),we(e)||(e.categoryMatchesMap={})}))}function de(e){Object(i["u"])(e,(function(e){e.categoryMatches=[],Object(i["u"])(e.categoryMatchesMap,(function(t,n){e.categoryMatches.push(le[n].tokenTypeIdx)}))}))}function pe(e){Object(i["u"])(e,(function(e){fe([],e)}))}function fe(e,t){Object(i["u"])(e,(function(e){t.categoryMatchesMap[e.tokenTypeIdx]=!0})),Object(i["u"])(t.CATEGORIES,(function(n){var r=e.concat(t);Object(i["j"])(r,n)||fe(r,n)}))}function ge(e){return Object(i["w"])(e,"tokenTypeIdx")}function me(e){return Object(i["w"])(e,"CATEGORIES")}function ye(e){return Object(i["w"])(e,"categoryMatches")}function we(e){return Object(i["w"])(e,"categoryMatchesMap")}function be(e){return Object(i["w"])(e,"tokenTypeIdx")}var ve,Ee={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->"+e.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(e,t,n,r,i){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+", skipped "+n+" characters."}};(function(e){e[e["MISSING_PATTERN"]=0]="MISSING_PATTERN",e[e["INVALID_PATTERN"]=1]="INVALID_PATTERN",e[e["EOI_ANCHOR_FOUND"]=2]="EOI_ANCHOR_FOUND",e[e["UNSUPPORTED_FLAGS_FOUND"]=3]="UNSUPPORTED_FLAGS_FOUND",e[e["DUPLICATE_PATTERNS_FOUND"]=4]="DUPLICATE_PATTERNS_FOUND",e[e["INVALID_GROUP_TYPE_FOUND"]=5]="INVALID_GROUP_TYPE_FOUND",e[e["PUSH_MODE_DOES_NOT_EXIST"]=6]="PUSH_MODE_DOES_NOT_EXIST",e[e["MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE"]=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e["MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY"]=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e["MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST"]=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e["LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED"]=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e["SOI_ANCHOR_FOUND"]=11]="SOI_ANCHOR_FOUND",e[e["EMPTY_MATCH_PATTERN"]=12]="EMPTY_MATCH_PATTERN",e[e["NO_LINE_BREAKS_FLAGS"]=13]="NO_LINE_BREAKS_FLAGS",e[e["UNREACHABLE_PATTERN"]=14]="UNREACHABLE_PATTERN",e[e["IDENTIFY_TERMINATOR"]=15]="IDENTIFY_TERMINATOR",e[e["CUSTOM_LINE_BREAK"]=16]="CUSTOM_LINE_BREAK"})(ve||(ve={}));var Ce={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Ee,traceInitPerf:!1,skipValidations:!1};Object.freeze(Ce);var Se=function(){function e(e,t){var n=this;if(void 0===t&&(t=Ce),this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},"boolean"===typeof t)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=Object(i["K"])(Ce,t);var r=this.config.traceInitPerf;!0===r?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"===typeof r&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",(function(){var r,o=!0;n.TRACE_INIT("Lexer Config handling",(function(){if(n.config.lineTerminatorsPattern===Ce.lineTerminatorsPattern)n.config.lineTerminatorsPattern=q;else if(n.config.lineTerminatorCharacters===Ce.lineTerminatorCharacters)throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');n.trackStartLines=/full|onlyStart/i.test(n.config.positionTracking),n.trackEndLines=/full/i.test(n.config.positionTracking),Object(i["y"])(e)?(r={modes:{}},r.modes[S]=Object(i["g"])(e),r[S]=S):(o=!1,r=Object(i["h"])(e))})),!1===n.config.skipValidations&&(n.TRACE_INIT("performRuntimeChecks",(function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(z(r,n.trackStartLines,n.config.lineTerminatorCharacters))})),n.TRACE_INIT("performWarningRuntimeChecks",(function(){n.lexerDefinitionWarning=n.lexerDefinitionWarning.concat(Y(r,n.trackStartLines,n.config.lineTerminatorCharacters))}))),r.modes=r.modes?r.modes:{},Object(i["u"])(r.modes,(function(e,t){r.modes[t]=Object(i["P"])(e,(function(e){return Object(i["F"])(e)}))}));var s=Object(i["G"])(r.modes);if(Object(i["u"])(r.modes,(function(e,r){n.TRACE_INIT("Mode: <"+r+"> processing",(function(){var o;(n.modes.push(r),!1===n.config.skipValidations&&n.TRACE_INIT("validatePatterns",(function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(N(e,s))})),Object(i["A"])(n.lexerDefinitionErrors))&&(ce(e),n.TRACE_INIT("analyzeTokenTypes",(function(){o=O(e,{lineTerminatorCharacters:n.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:n.TRACE_INIT.bind(n)})})),n.patternIdxToConfig[r]=o.patternIdxToConfig,n.charCodeToPatternIdxToConfig[r]=o.charCodeToPatternIdxToConfig,n.emptyGroups=Object(i["K"])(n.emptyGroups,o.emptyGroups),n.hasCustom=o.hasCustom||n.hasCustom,n.canModeBeOptimized[r]=o.canBeOptimized)}))})),n.defaultMode=r.defaultMode,!Object(i["A"])(n.lexerDefinitionErrors)&&!n.config.deferDefinitionErrorsHandling){var a=Object(i["I"])(n.lexerDefinitionErrors,(function(e){return e.message})),l=a.join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+l)}Object(i["u"])(n.lexerDefinitionWarning,(function(e){Object(i["d"])(e.message)})),n.TRACE_INIT("Choosing sub-methods implementations",(function(){if(T?(n.chopInput=i["a"],n.match=n.matchWithTest):(n.updateLastIndex=i["b"],n.match=n.matchWithExec),o&&(n.handleModes=i["b"]),!1===n.trackStartLines&&(n.computeNewColumn=i["a"]),!1===n.trackEndLines&&(n.updateTokenEndLineColumnLocation=i["b"]),/full/i.test(n.config.positionTracking))n.createTokenInstance=n.createFullToken;else if(/onlyStart/i.test(n.config.positionTracking))n.createTokenInstance=n.createStartOnlyToken;else{if(!/onlyOffset/i.test(n.config.positionTracking))throw Error('Invalid <positionTracking> config option: "'+n.config.positionTracking+'"');n.createTokenInstance=n.createOffsetOnlyToken}n.hasCustom?(n.addToken=n.addTokenUsingPush,n.handlePayload=n.handlePayloadWithCustom):(n.addToken=n.addTokenUsingMemberAccess,n.handlePayload=n.handlePayloadNoCustom)})),n.TRACE_INIT("Failed Optimization Warnings",(function(){var e=Object(i["O"])(n.canModeBeOptimized,(function(e,t,n){return!1===t&&e.push(n),e}),[]);if(t.ensureOptimizations&&!Object(i["A"])(e))throw Error("Lexer Modes: < "+e.join(", ")+' > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.')})),n.TRACE_INIT("clearRegExpParserCache",(function(){c()})),n.TRACE_INIT("toFastProperties",(function(){Object(i["S"])(n)}))}))}return e.prototype.tokenize=function(e,t){if(void 0===t&&(t=this.defaultMode),!Object(i["A"])(this.lexerDefinitionErrors)){var n=Object(i["I"])(this.lexerDefinitionErrors,(function(e){return e.message})),r=n.join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+r)}var o=this.tokenizeInternal(e,t);return o},e.prototype.tokenizeInternal=function(e,t){var n,r,o,s,a,l,c,h,u,d,p,f,g,m,y=this,w=e,b=w.length,v=0,E=0,C=this.hasCustom?0:Math.floor(e.length/10),S=new Array(C),R=[],T=this.trackStartLines?1:void 0,O=this.trackStartLines?1:void 0,N=X(this.emptyGroups),A=this.trackStartLines,I=this.config.lineTerminatorsPattern,M=0,x=[],_=[],L=[],P=[];Object.freeze(P);var k=void 0;function j(){return x}function H(e){var t=ne(e),n=_[t];return void 0===n?P:n}var D,F=function(e){if(1===L.length&&void 0===e.tokenType.PUSH_MODE){var t=y.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);R.push({offset:e.startOffset,line:void 0!==e.startLine?e.startLine:void 0,column:void 0!==e.startColumn?e.startColumn:void 0,length:e.image.length,message:t})}else{L.pop();var n=Object(i["H"])(L);x=y.patternIdxToConfig[n],_=y.charCodeToPatternIdxToConfig[n],M=x.length;var r=y.canModeBeOptimized[n]&&!1===y.config.safeMode;k=_&&r?H:j}};function U(e){L.push(e),_=this.charCodeToPatternIdxToConfig[e],x=this.patternIdxToConfig[e],M=x.length,M=x.length;var t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;k=_&&t?H:j}U.call(this,t);while(v<b){a=null;var V=w.charCodeAt(v),B=k(V),W=B.length;for(n=0;n<W;n++){D=B[n];var G=D.pattern;l=null;var z=D.short;if(!1!==z?V===z&&(a=G):!0===D.isCustom?(m=G.exec(w,v,S,N),null!==m?(a=m[0],void 0!==m.payload&&(l=m.payload)):a=null):(this.updateLastIndex(G,v),a=this.match(G,e,v)),null!==a){if(s=D.longerAlt,void 0!==s){var Y=x[s],K=Y.pattern;c=null,!0===Y.isCustom?(m=K.exec(w,v,S,N),null!==m?(o=m[0],void 0!==m.payload&&(c=m.payload)):o=null):(this.updateLastIndex(K,v),o=this.match(K,e,v)),o&&o.length>a.length&&(a=o,l=c,D=Y)}break}}if(null!==a){if(h=a.length,u=D.group,void 0!==u&&(d=D.tokenTypeIdx,p=this.createTokenInstance(a,v,d,D.tokenType,T,O,h),this.handlePayload(p,l),!1===u?E=this.addToken(S,E,p):N[u].push(p)),e=this.chopInput(e,h),v+=h,O=this.computeNewColumn(O,h),!0===A&&!0===D.canLineTerminator){var $=0,q=void 0,Q=void 0;I.lastIndex=0;do{q=I.test(a),!0===q&&(Q=I.lastIndex-1,$++)}while(!0===q);0!==$&&(T+=$,O=h-Q,this.updateTokenEndLineColumnLocation(p,u,Q,$,T,O,h))}this.handleModes(D,F,U,p)}else{var Z=v,J=T,ee=O,te=!1;while(!te&&v<b)for(w.charCodeAt(v),e=this.chopInput(e,1),v++,r=0;r<M;r++){var re=x[r];G=re.pattern,z=re.short;if(!1!==z?w.charCodeAt(v)===z&&(te=!0):!0===re.isCustom?te=null!==G.exec(w,v,S,N):(this.updateLastIndex(G,v),te=null!==G.exec(e)),!0===te)break}f=v-Z,g=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(w,Z,f,J,ee),R.push({offset:Z,line:J,column:ee,length:f,message:g})}}return this.hasCustom||(S.length=E),{tokens:S,groups:N,errors:R}},e.prototype.handleModes=function(e,t,n,r){if(!0===e.pop){var i=e.push;t(r),void 0!==i&&n.call(this,i)}else void 0!==e.push&&n.call(this,e.push)},e.prototype.chopInput=function(e,t){return e.substring(t)},e.prototype.updateLastIndex=function(e,t){e.lastIndex=t},e.prototype.updateTokenEndLineColumnLocation=function(e,t,n,r,i,o,s){var a,l;void 0!==t&&(a=n===s-1,l=a?-1:0,1===r&&!0===a||(e.endLine=i+l,e.endColumn=o-1-l))},e.prototype.computeNewColumn=function(e,t){return e+t},e.prototype.createTokenInstance=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return null},e.prototype.createOffsetOnlyToken=function(e,t,n,r){return{image:e,startOffset:t,tokenTypeIdx:n,tokenType:r}},e.prototype.createStartOnlyToken=function(e,t,n,r,i,o){return{image:e,startOffset:t,startLine:i,startColumn:o,tokenTypeIdx:n,tokenType:r}},e.prototype.createFullToken=function(e,t,n,r,i,o,s){return{image:e,startOffset:t,endOffset:t+s-1,startLine:i,endLine:i,startColumn:o,endColumn:o+s-1,tokenTypeIdx:n,tokenType:r}},e.prototype.addToken=function(e,t,n){return 666},e.prototype.addTokenUsingPush=function(e,t,n){return e.push(n),t},e.prototype.addTokenUsingMemberAccess=function(e,t,n){return e[t]=n,t++,t},e.prototype.handlePayload=function(e,t){},e.prototype.handlePayloadNoCustom=function(e,t){},e.prototype.handlePayloadWithCustom=function(e,t){null!==t&&(e.payload=t)},e.prototype.match=function(e,t,n){return null},e.prototype.matchWithTest=function(e,t,n){var r=e.test(t);return!0===r?t.substring(n,e.lastIndex):null},e.prototype.matchWithExec=function(e,t){var n=e.exec(t);return null!==n?n[0]:n},e.prototype.TRACE_INIT=function(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;var n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(n+"--\x3e <"+e+">");var r=Object(i["R"])(t),o=r.time,s=r.value,a=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(n+"<-- <"+e+"> time: "+o+"ms"),this.traceInitIndent--,s}return t()},e.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",e.NA=/NOT_APPLICABLE/,e}();function Re(e){return Oe(e)?e.LABEL:e.name}function Te(e){return e.name}function Oe(e){return Object(i["E"])(e.LABEL)&&""!==e.LABEL}var Ne="parent",Ae="categories",Ie="label",Me="group",xe="push_mode",_e="pop_mode",Le="longer_alt",Pe="line_breaks",ke="start_chars_hint";function je(e){return He(e)}function He(e){var t=e.pattern,n={};if(n.name=e.name,Object(i["F"])(t)||(n.PATTERN=t),Object(i["w"])(e,Ne))throw"The parent property is no longer supported.\nSee: https://github.com/SAP/chevrotain/issues/564#issuecomment-349062346 for details.";return Object(i["w"])(e,Ae)&&(n.CATEGORIES=e[Ae]),ce([n]),Object(i["w"])(e,Ie)&&(n.LABEL=e[Ie]),Object(i["w"])(e,Me)&&(n.GROUP=e[Me]),Object(i["w"])(e,_e)&&(n.POP_MODE=e[_e]),Object(i["w"])(e,xe)&&(n.PUSH_MODE=e[xe]),Object(i["w"])(e,Le)&&(n.LONGER_ALT=e[Le]),Object(i["w"])(e,Pe)&&(n.LINE_BREAKS=e[Pe]),Object(i["w"])(e,ke)&&(n.START_CHARS_HINT=e[ke]),n}var De=je({name:"EOF",pattern:Se.NA});function Fe(e,t,n,r,i,o,s,a){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:o,startColumn:s,endColumn:a,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function Ue(e,t){return oe(e,t)}ce([De]);var Ve=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Be=function(){function e(e){this.definition=e}return e.prototype.accept=function(e){e.visit(this),Object(i["u"])(this.definition,(function(t){t.accept(e)}))},e}(),We=function(e){function t(t){var n=e.call(this,[])||this;return n.idx=1,Object(i["f"])(n,Object(i["N"])(t,(function(e){return void 0!==e}))),n}return Ve(t,e),Object.defineProperty(t.prototype,"definition",{get:function(){return void 0!==this.referencedRule?this.referencedRule.definition:[]},set:function(e){},enumerable:!0,configurable:!0}),t.prototype.accept=function(e){e.visit(this)},t}(Be),Ge=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.orgText="",Object(i["f"])(n,Object(i["N"])(t,(function(e){return void 0!==e}))),n}return Ve(t,e),t}(Be),ze=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.ignoreAmbiguities=!1,Object(i["f"])(n,Object(i["N"])(t,(function(e){return void 0!==e}))),n}return Ve(t,e),t}(Be),Ye=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,Object(i["f"])(n,Object(i["N"])(t,(function(e){return void 0!==e}))),n}return Ve(t,e),t}(Be),Xe=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,Object(i["f"])(n,Object(i["N"])(t,(function(e){return void 0!==e}))),n}return Ve(t,e),t}(Be),Ke=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,Object(i["f"])(n,Object(i["N"])(t,(function(e){return void 0!==e}))),n}return Ve(t,e),t}(Be),$e=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,Object(i["f"])(n,Object(i["N"])(t,(function(e){return void 0!==e}))),n}return Ve(t,e),t}(Be),qe=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,Object(i["f"])(n,Object(i["N"])(t,(function(e){return void 0!==e}))),n}return Ve(t,e),t}(Be),Qe=function(e){function t(t){var n=e.call(this,t.definition)||this;return n.idx=1,n.ignoreAmbiguities=!1,n.hasPredicates=!1,Object(i["f"])(n,Object(i["N"])(t,(function(e){return void 0!==e}))),n}return Ve(t,e),t}(Be),Ze=function(){function e(e){this.idx=1,Object(i["f"])(this,Object(i["N"])(e,(function(e){return void 0!==e})))}return e.prototype.accept=function(e){e.visit(this)},e}();function Je(e){return Object(i["I"])(e,et)}function et(e){function t(e){return Object(i["I"])(e,et)}if(e instanceof We)return{type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};if(e instanceof ze)return{type:"Flat",definition:t(e.definition)};if(e instanceof Ye)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof Xe)return{type:"RepetitionMandatory",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof Ke)return{type:"RepetitionMandatoryWithSeparator",name:e.name,idx:e.idx,separator:et(new Ze({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof qe)return{type:"RepetitionWithSeparator",name:e.name,idx:e.idx,separator:et(new Ze({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof $e)return{type:"Repetition",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof Qe)return{type:"Alternation",name:e.name,idx:e.idx,definition:t(e.definition)};if(e instanceof Ze){var n={type:"Terminal",name:e.terminalType.name,label:Re(e.terminalType),idx:e.idx},r=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(n.pattern=Object(i["D"])(r)?r.source:r),n}if(e instanceof Ge)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}var tt=function(){function e(){}return e.prototype.walk=function(e,t){var n=this;void 0===t&&(t=[]),Object(i["u"])(e.definition,(function(r,o){var s=Object(i["m"])(e.definition,o+1);if(r instanceof We)n.walkProdRef(r,s,t);else if(r instanceof Ze)n.walkTerminal(r,s,t);else if(r instanceof ze)n.walkFlat(r,s,t);else if(r instanceof Ye)n.walkOption(r,s,t);else if(r instanceof Xe)n.walkAtLeastOne(r,s,t);else if(r instanceof Ke)n.walkAtLeastOneSep(r,s,t);else if(r instanceof qe)n.walkManySep(r,s,t);else if(r instanceof $e)n.walkMany(r,s,t);else{if(!(r instanceof Qe))throw Error("non exhaustive match");n.walkOr(r,s,t)}}))},e.prototype.walkTerminal=function(e,t,n){},e.prototype.walkProdRef=function(e,t,n){},e.prototype.walkFlat=function(e,t,n){var r=t.concat(n);this.walk(e,r)},e.prototype.walkOption=function(e,t,n){var r=t.concat(n);this.walk(e,r)},e.prototype.walkAtLeastOne=function(e,t,n){var r=[new Ye({definition:e.definition})].concat(t,n);this.walk(e,r)},e.prototype.walkAtLeastOneSep=function(e,t,n){var r=nt(e,t,n);this.walk(e,r)},e.prototype.walkMany=function(e,t,n){var r=[new Ye({definition:e.definition})].concat(t,n);this.walk(e,r)},e.prototype.walkManySep=function(e,t,n){var r=nt(e,t,n);this.walk(e,r)},e.prototype.walkOr=function(e,t,n){var r=this,o=t.concat(n);Object(i["u"])(e.definition,(function(e){var t=new ze({definition:[e]});r.walk(t,o)}))},e}();function nt(e,t,n){var r=[new Ye({definition:[new Ze({terminalType:e.separator})].concat(e.definition)})],i=r.concat(t,n);return i}var rt=function(){function e(){}return e.prototype.visit=function(e){var t=e;switch(t.constructor){case We:return this.visitNonTerminal(t);case ze:return this.visitFlat(t);case Ye:return this.visitOption(t);case Xe:return this.visitRepetitionMandatory(t);case Ke:return this.visitRepetitionMandatoryWithSeparator(t);case qe:return this.visitRepetitionWithSeparator(t);case $e:return this.visitRepetition(t);case Qe:return this.visitAlternation(t);case Ze:return this.visitTerminal(t);case Ge:return this.visitRule(t);default:throw Error("non exhaustive match")}},e.prototype.visitNonTerminal=function(e){},e.prototype.visitFlat=function(e){},e.prototype.visitOption=function(e){},e.prototype.visitRepetition=function(e){},e.prototype.visitRepetitionMandatory=function(e){},e.prototype.visitRepetitionMandatoryWithSeparator=function(e){},e.prototype.visitRepetitionWithSeparator=function(e){},e.prototype.visitAlternation=function(e){},e.prototype.visitTerminal=function(e){},e.prototype.visitRule=function(e){},e}(),it=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function ot(e){return e instanceof ze||e instanceof Ye||e instanceof $e||e instanceof Xe||e instanceof Ke||e instanceof qe||e instanceof Ze||e instanceof Ge}function st(e,t){void 0===t&&(t=[]);var n=e instanceof Ye||e instanceof $e||e instanceof qe;return!!n||(e instanceof Qe?Object(i["Q"])(e.definition,(function(e){return st(e,t)})):!(e instanceof We&&Object(i["j"])(t,e))&&(e instanceof Be&&(e instanceof We&&t.push(e),Object(i["o"])(e.definition,(function(e){return st(e,t)})))))}function at(e){return e instanceof Qe}function lt(e){if(e instanceof We)return"SUBRULE";if(e instanceof Ye)return"OPTION";if(e instanceof Qe)return"OR";if(e instanceof Xe)return"AT_LEAST_ONE";if(e instanceof Ke)return"AT_LEAST_ONE_SEP";if(e instanceof qe)return"MANY_SEP";if(e instanceof $e)return"MANY";if(e instanceof Ze)return"CONSUME";throw Error("non exhaustive match")}var ct=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.separator="-",t.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},t}return it(t,e),t.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},t.prototype.visitTerminal=function(e){var t=e.terminalType.name+this.separator+"Terminal";Object(i["w"])(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},t.prototype.visitNonTerminal=function(e){var t=e.nonTerminalName+this.separator+"Terminal";Object(i["w"])(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},t.prototype.visitOption=function(e){this.dslMethods.option.push(e)},t.prototype.visitRepetitionWithSeparator=function(e){this.dslMethods.repetitionWithSeparator.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.dslMethods.repetitionMandatory.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)},t.prototype.visitRepetition=function(e){this.dslMethods.repetition.push(e)},t.prototype.visitAlternation=function(e){this.dslMethods.alternation.push(e)},t}(rt),ht=new ct;function ut(e){ht.reset(),e.accept(ht);var t=ht.dslMethods;return ht.reset(),t}function dt(e){if(e instanceof We)return dt(e.referencedRule);if(e instanceof Ze)return gt(e);if(ot(e))return pt(e);if(at(e))return ft(e);throw Error("non exhaustive match")}function pt(e){var t,n=[],r=e.definition,o=0,s=r.length>o,a=!0;while(s&&a)t=r[o],a=st(t),n=n.concat(dt(t)),o+=1,s=r.length>o;return Object(i["T"])(n)}function ft(e){var t=Object(i["I"])(e.definition,(function(e){return dt(e)}));return Object(i["T"])(Object(i["t"])(t))}function gt(e){return[e.terminalType]}var mt="_~IN~_",yt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wt=function(e){function t(t){var n=e.call(this)||this;return n.topProd=t,n.follows={},n}return yt(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},t.prototype.walkTerminal=function(e,t,n){},t.prototype.walkProdRef=function(e,t,n){var r=vt(e.referencedRule,e.idx)+this.topProd.name,i=t.concat(n),o=new ze({definition:i}),s=dt(o);this.follows[r]=s},t}(tt);function bt(e){var t={};return Object(i["u"])(e,(function(e){var n=new wt(e).startWalking();Object(i["f"])(t,n)})),t}function vt(e,t){return e.name+t+mt}var Et=4,Ct=8,St=8,Rt=1<<Ct,Tt=2<<Ct,Ot=3<<Ct,Nt=4<<Ct,At=5<<Ct,It=6<<Ct;function Mt(e,t,n){return n|t|e}var xt=32-St;function _t(e,t,n,r){var i=r+1<<xt;return Mt(e,t,n)|i}var Lt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Pt(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset===!0&&(e.endOffset=t.endOffset)}function kt(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset===!0&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}function jt(e,t,n){void 0===e.children[n]?e.children[n]=[t]:e.children[n].push(t)}function Ht(e,t,n){void 0===e.children[t]?e.children[t]=[n]:e.children[t].push(n)}var Dt=function(e){function t(t){var n=e.call(this)||this;return n.result=[],n.ruleIdx=t,n}return Lt(t,e),t.prototype.collectNamedDSLMethod=function(e,t,n){if(!Object(i["F"])(e.name)){var r=void 0;if(e instanceof Ye||e instanceof $e||e instanceof Xe||e instanceof Qe)r=new t({definition:e.definition,idx:e.idx});else{if(!(e instanceof Ke||e instanceof qe))throw Error("non exhaustive match");r=new t({definition:e.definition,idx:e.idx,separator:e.separator})}var o=[r],s=Mt(this.ruleIdx,n,e.idx);this.result.push({def:o,key:s,name:e.name,orgProd:e})}},t.prototype.visitOption=function(e){this.collectNamedDSLMethod(e,Ye,Tt)},t.prototype.visitRepetition=function(e){this.collectNamedDSLMethod(e,$e,Ot)},t.prototype.visitRepetitionMandatory=function(e){this.collectNamedDSLMethod(e,Xe,Nt)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.collectNamedDSLMethod(e,Ke,It)},t.prototype.visitRepetitionWithSeparator=function(e){this.collectNamedDSLMethod(e,qe,At)},t.prototype.visitAlternation=function(e){var t=this;this.collectNamedDSLMethod(e,Qe,Rt);var n=e.definition.length>1;Object(i["u"])(e.definition,(function(r,o){if(!Object(i["F"])(r.name)){var s=r.definition;s=n?[new Ye({definition:r.definition})]:r.definition;var a=_t(t.ruleIdx,Rt,e.idx,o);t.result.push({def:s,key:a,name:r.name,orgProd:r})}}))},t}(rt);function Ft(e,t){var n={allRuleNames:[]};return Object(i["u"])(e,(function(e){var r=t[e.name];n.allRuleNames.push(e.name);var o=new Dt(r);e.accept(o),Object(i["u"])(o.result,(function(t){t.def,t.key;var r=t.name;n.allRuleNames.push(e.name+r)}))})),n}var Ut=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vt=function(e){function t(t,n){var r=e.call(this)||this;return r.topProd=t,r.path=n,r.possibleTokTypes=[],r.nextProductionName="",r.nextProductionOccurrence=0,r.found=!1,r.isAtEndOfPath=!1,r}return Ut(t,e),t.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Object(i["g"])(this.path.ruleStack).reverse(),this.occurrenceStack=Object(i["g"])(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},t.prototype.walk=function(t,n){void 0===n&&(n=[]),this.found||e.prototype.walk.call(this,t,n)},t.prototype.walkProdRef=function(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){var r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}},t.prototype.updateExpectedNext=function(){Object(i["A"])(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},t}(tt),Bt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.path=n,r.nextTerminalName="",r.nextTerminalOccurrence=0,r.nextTerminalName=r.path.lastTok.name,r.nextTerminalOccurrence=r.path.lastTokOccurrence,r}return Ut(t,e),t.prototype.walkTerminal=function(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){var r=t.concat(n),i=new ze({definition:r});this.possibleTokTypes=dt(i),this.found=!0}},t}(Vt),Wt=function(e){function t(t,n){var r=e.call(this)||this;return r.topRule=t,r.occurrence=n,r.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},r}return Ut(t,e),t.prototype.startWalking=function(){return this.walk(this.topRule),this.result},t}(tt),Gt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ut(t,e),t.prototype.walkMany=function(t,n,r){if(t.idx===this.occurrence){var o=Object(i["s"])(n.concat(r));this.result.isEndOfRule=void 0===o,o instanceof Ze&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkMany.call(this,t,n,r)},t}(Wt),zt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ut(t,e),t.prototype.walkManySep=function(t,n,r){if(t.idx===this.occurrence){var o=Object(i["s"])(n.concat(r));this.result.isEndOfRule=void 0===o,o instanceof Ze&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkManySep.call(this,t,n,r)},t}(Wt),Yt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ut(t,e),t.prototype.walkAtLeastOne=function(t,n,r){if(t.idx===this.occurrence){var o=Object(i["s"])(n.concat(r));this.result.isEndOfRule=void 0===o,o instanceof Ze&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkAtLeastOne.call(this,t,n,r)},t}(Wt),Xt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ut(t,e),t.prototype.walkAtLeastOneSep=function(t,n,r){if(t.idx===this.occurrence){var o=Object(i["s"])(n.concat(r));this.result.isEndOfRule=void 0===o,o instanceof Ze&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkAtLeastOneSep.call(this,t,n,r)},t}(Wt);function Kt(e,t,n){void 0===n&&(n=[]),n=Object(i["g"])(n);var r=[],o=0;function s(t){return t.concat(Object(i["m"])(e,o+1))}function a(e){var i=Kt(s(e),t,n);return r.concat(i)}while(n.length<t&&o<e.length){var l=e[o];if(l instanceof ze)return a(l.definition);if(l instanceof We)return a(l.definition);if(l instanceof Ye)r=a(l.definition);else{if(l instanceof Xe){var c=l.definition.concat([new $e({definition:l.definition})]);return a(c)}if(l instanceof Ke){c=[new ze({definition:l.definition}),new $e({definition:[new Ze({terminalType:l.separator})].concat(l.definition)})];return a(c)}if(l instanceof qe){c=l.definition.concat([new $e({definition:[new Ze({terminalType:l.separator})].concat(l.definition)})]);r=a(c)}else if(l instanceof $e){c=l.definition.concat([new $e({definition:l.definition})]);r=a(c)}else{if(l instanceof Qe)return Object(i["u"])(l.definition,(function(e){r=a(e.definition)})),r;if(!(l instanceof Ze))throw Error("non exhaustive match");n.push(l.terminalType)}}o++}return r.push({partialPath:n,suffixDef:Object(i["m"])(e,o)}),r}function $t(e,t,n,r){var o="EXIT_NONE_TERMINAL",s=[o],a="EXIT_ALTERNATIVE",l=!1,c=t.length,h=c-r-1,u=[],d=[];d.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});while(!Object(i["A"])(d)){var p=d.pop();if(p!==a){var f=p.def,g=p.idx,m=p.ruleStack,y=p.occurrenceStack;if(!Object(i["A"])(f)){var w=f[0];if(w===o){var b={idx:g,def:Object(i["m"])(f),ruleStack:Object(i["n"])(m),occurrenceStack:Object(i["n"])(y)};d.push(b)}else if(w instanceof Ze)if(g<c-1){var v=g+1,E=t[v];if(n(E,w.terminalType)){b={idx:v,def:Object(i["m"])(f),ruleStack:m,occurrenceStack:y};d.push(b)}}else{if(g!==c-1)throw Error("non exhaustive match");u.push({nextTokenType:w.terminalType,nextTokenOccurrence:w.idx,ruleStack:m,occurrenceStack:y}),l=!0}else if(w instanceof We){var C=Object(i["g"])(m);C.push(w.nonTerminalName);var S=Object(i["g"])(y);S.push(w.idx);b={idx:g,def:w.definition.concat(s,Object(i["m"])(f)),ruleStack:C,occurrenceStack:S};d.push(b)}else if(w instanceof Ye){var R={idx:g,def:Object(i["m"])(f),ruleStack:m,occurrenceStack:y};d.push(R),d.push(a);var T={idx:g,def:w.definition.concat(Object(i["m"])(f)),ruleStack:m,occurrenceStack:y};d.push(T)}else if(w instanceof Xe){var O=new $e({definition:w.definition,idx:w.idx}),N=w.definition.concat([O],Object(i["m"])(f));b={idx:g,def:N,ruleStack:m,occurrenceStack:y};d.push(b)}else if(w instanceof Ke){var A=new Ze({terminalType:w.separator});O=new $e({definition:[A].concat(w.definition),idx:w.idx}),N=w.definition.concat([O],Object(i["m"])(f)),b={idx:g,def:N,ruleStack:m,occurrenceStack:y};d.push(b)}else if(w instanceof qe){R={idx:g,def:Object(i["m"])(f),ruleStack:m,occurrenceStack:y};d.push(R),d.push(a);A=new Ze({terminalType:w.separator});var I=new $e({definition:[A].concat(w.definition),idx:w.idx});N=w.definition.concat([I],Object(i["m"])(f)),T={idx:g,def:N,ruleStack:m,occurrenceStack:y};d.push(T)}else if(w instanceof $e){R={idx:g,def:Object(i["m"])(f),ruleStack:m,occurrenceStack:y};d.push(R),d.push(a);I=new $e({definition:w.definition,idx:w.idx}),N=w.definition.concat([I],Object(i["m"])(f)),T={idx:g,def:N,ruleStack:m,occurrenceStack:y};d.push(T)}else if(w instanceof Qe)for(var M=w.definition.length-1;M>=0;M--){var x=w.definition[M],_={idx:g,def:x.definition.concat(Object(i["m"])(f)),ruleStack:m,occurrenceStack:y};d.push(_),d.push(a)}else if(w instanceof ze)d.push({idx:g,def:w.definition.concat(Object(i["m"])(f)),ruleStack:m,occurrenceStack:y});else{if(!(w instanceof Ge))throw Error("non exhaustive match");d.push(qt(w,g,m,y))}}}else l&&Object(i["H"])(d).idx<=h&&d.pop()}return u}function qt(e,t,n,r){var o=Object(i["g"])(n);o.push(e.name);var s=Object(i["g"])(r);return s.push(1),{idx:t,def:e.definition,ruleStack:o,occurrenceStack:s}}var Qt,Zt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Jt(e){if(e instanceof Ye)return Qt.OPTION;if(e instanceof $e)return Qt.REPETITION;if(e instanceof Xe)return Qt.REPETITION_MANDATORY;if(e instanceof Ke)return Qt.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof qe)return Qt.REPETITION_WITH_SEPARATOR;if(e instanceof Qe)return Qt.ALTERNATION;throw Error("non exhaustive match")}function en(e,t,n,r,i,o){var s=un(e,t,n),a=gn(s)?se:oe;return o(s,r,a,i)}function tn(e,t,n,r,i,o){var s=dn(e,t,i,n),a=gn(s)?se:oe;return o(s[0],a,r)}function nn(e,t,n,r){var o=e.length,s=Object(i["o"])(e,(function(e){return Object(i["o"])(e,(function(e){return 1===e.length}))}));if(t)return function(t){for(var r=Object(i["I"])(t,(function(e){return e.GATE})),s=0;s<o;s++){var a=e[s],l=a.length,c=r[s];if(void 0===c||!1!==c.call(this))e:for(var h=0;h<l;h++){for(var u=a[h],d=u.length,p=0;p<d;p++){var f=this.LA(p+1);if(!1===n(f,u[p]))continue e}return s}}};if(s&&!r){var a=Object(i["I"])(e,(function(e){return Object(i["t"])(e)})),l=Object(i["O"])(a,(function(e,t,n){return Object(i["u"])(t,(function(t){Object(i["w"])(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=n),Object(i["u"])(t.categoryMatches,(function(t){Object(i["w"])(e,t)||(e[t]=n)}))})),e}),[]);return function(){var e=this.LA(1);return l[e.tokenTypeIdx]}}return function(){for(var t=0;t<o;t++){var r=e[t],i=r.length;e:for(var s=0;s<i;s++){for(var a=r[s],l=a.length,c=0;c<l;c++){var h=this.LA(c+1);if(!1===n(h,a[c]))continue e}return t}}}}function rn(e,t,n){var r=Object(i["o"])(e,(function(e){return 1===e.length})),o=e.length;if(r&&!n){var s=Object(i["t"])(e);if(1===s.length&&Object(i["A"])(s[0].categoryMatches)){var a=s[0],l=a.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===l}}var c=Object(i["O"])(s,(function(e,t,n){return e[t.tokenTypeIdx]=!0,Object(i["u"])(t.categoryMatches,(function(t){e[t]=!0})),e}),[]);return function(){var e=this.LA(1);return!0===c[e.tokenTypeIdx]}}return function(){e:for(var n=0;n<o;n++){for(var r=e[n],i=r.length,s=0;s<i;s++){var a=this.LA(s+1);if(!1===t(a,r[s]))continue e}return!0}return!1}}(function(e){e[e["OPTION"]=0]="OPTION",e[e["REPETITION"]=1]="REPETITION",e[e["REPETITION_MANDATORY"]=2]="REPETITION_MANDATORY",e[e["REPETITION_MANDATORY_WITH_SEPARATOR"]=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e["REPETITION_WITH_SEPARATOR"]=4]="REPETITION_WITH_SEPARATOR",e[e["ALTERNATION"]=5]="ALTERNATION"})(Qt||(Qt={}));var on=function(e){function t(t,n,r){var i=e.call(this)||this;return i.topProd=t,i.targetOccurrence=n,i.targetProdType=r,i}return Zt(t,e),t.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},t.prototype.checkIsTarget=function(e,t,n,r){return e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.restDef=n.concat(r),!0)},t.prototype.walkOption=function(t,n,r){this.checkIsTarget(t,Qt.OPTION,n,r)||e.prototype.walkOption.call(this,t,n,r)},t.prototype.walkAtLeastOne=function(t,n,r){this.checkIsTarget(t,Qt.REPETITION_MANDATORY,n,r)||e.prototype.walkOption.call(this,t,n,r)},t.prototype.walkAtLeastOneSep=function(t,n,r){this.checkIsTarget(t,Qt.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||e.prototype.walkOption.call(this,t,n,r)},t.prototype.walkMany=function(t,n,r){this.checkIsTarget(t,Qt.REPETITION,n,r)||e.prototype.walkOption.call(this,t,n,r)},t.prototype.walkManySep=function(t,n,r){this.checkIsTarget(t,Qt.REPETITION_WITH_SEPARATOR,n,r)||e.prototype.walkOption.call(this,t,n,r)},t}(tt),sn=function(e){function t(t,n,r){var i=e.call(this)||this;return i.targetOccurrence=t,i.targetProdType=n,i.targetRef=r,i.result=[],i}return Zt(t,e),t.prototype.checkIsTarget=function(e,t){e.idx!==this.targetOccurrence||this.targetProdType!==t||void 0!==this.targetRef&&e!==this.targetRef||(this.result=e.definition)},t.prototype.visitOption=function(e){this.checkIsTarget(e,Qt.OPTION)},t.prototype.visitRepetition=function(e){this.checkIsTarget(e,Qt.REPETITION)},t.prototype.visitRepetitionMandatory=function(e){this.checkIsTarget(e,Qt.REPETITION_MANDATORY)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.checkIsTarget(e,Qt.REPETITION_MANDATORY_WITH_SEPARATOR)},t.prototype.visitRepetitionWithSeparator=function(e){this.checkIsTarget(e,Qt.REPETITION_WITH_SEPARATOR)},t.prototype.visitAlternation=function(e){this.checkIsTarget(e,Qt.ALTERNATION)},t}(rt);function an(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=[];return t}function ln(e){for(var t=[""],n=0;n<e.length;n++){for(var r=e[n],i=[],o=0;o<t.length;o++){var s=t[o];i.push(s+"_"+r.tokenTypeIdx);for(var a=0;a<r.categoryMatches.length;a++){var l="_"+r.categoryMatches[a];i.push(s+l)}}t=i}return t}function cn(e,t,n){for(var r=0;r<e.length;r++)if(r!==n)for(var i=e[r],o=0;o<t.length;o++){var s=t[o];if(!0===i[s])return!1}return!0}function hn(e,t){for(var n=Object(i["I"])(e,(function(e){return Kt([e],1)})),r=an(n.length),o=Object(i["I"])(n,(function(e){var t={};return Object(i["u"])(e,(function(e){var n=ln(e.partialPath);Object(i["u"])(n,(function(e){t[e]=!0}))})),t})),s=n,a=1;a<=t;a++){var l=s;s=an(l.length);for(var c=function(e){for(var n=l[e],c=0;c<n.length;c++){var h=n[c].partialPath,u=n[c].suffixDef,d=ln(h),p=cn(o,d,e);if(p||Object(i["A"])(u)||h.length===t){var f=r[e];if(!1===pn(f,h)){f.push(h);for(var g=0;g<d.length;g++){var m=d[g];o[e][m]=!0}}}else{var y=Kt(u,a+1,h);s[e]=s[e].concat(y),Object(i["u"])(y,(function(t){var n=ln(t.partialPath);Object(i["u"])(n,(function(t){o[e][t]=!0}))}))}}},h=0;h<l.length;h++)c(h)}return r}function un(e,t,n,r){var i=new sn(e,Qt.ALTERNATION,r);return t.accept(i),hn(i.result,n)}function dn(e,t,n,r){var i=new sn(e,n);t.accept(i);var o=i.result,s=new on(t,e,n),a=s.startWalking(),l=new ze({definition:o}),c=new ze({definition:a});return hn([l,c],r)}function pn(e,t){e:for(var n=0;n<e.length;n++){var r=e[n];if(r.length===t.length){for(var i=0;i<r.length;i++){var o=t[i],s=r[i],a=o===s||void 0!==s.categoryMatchesMap[o.tokenTypeIdx];if(!1===a)continue e}return!0}}return!1}function fn(e,t){return e.length<t.length&&Object(i["o"])(e,(function(e,n){var r=t[n];return e===r||r.categoryMatchesMap[e.tokenTypeIdx]}))}function gn(e){return Object(i["o"])(e,(function(e){return Object(i["o"])(e,(function(e){return Object(i["o"])(e,(function(e){return Object(i["A"])(e.categoryMatches)}))}))}))}var mn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function yn(e,t,n,r,o,s){var a=i["I"](e,(function(e){return bn(e,o)})),l=i["I"](e,(function(e){return Mn(e,e,o)})),c=[],h=[],u=[];Object(i["o"])(l,i["A"])&&(c=Object(i["I"])(e,(function(e){return Ln(e,o)})),h=Object(i["I"])(e,(function(e){return Pn(e,t,r,o)})),u=Hn(e,t,o));var d=Un(e,n,o),p=i["I"](n,(function(e){return Nn(e,o)})),f=wn(e,o),g=Vn(e,o),m=Object(i["I"])(e,(function(e){return jn(e,o)})),y=Object(i["I"])(e,(function(e){return Tn(e,o)})),w=Object(i["I"])(e,(function(t){return An(t,e,s,o)}));return i["t"](a.concat(p,f,g,u,l,c,h,d,m,y,w))}function wn(e,t){var n=[];return Object(i["u"])(e,(function(e){var r=new Dt("");e.accept(r);var o=Object(i["I"])(r.result,(function(e){return e.orgProd}));n.push(Object(i["I"])(o,(function(n){return On(e,n,t)})))})),Object(i["t"])(n)}function bn(e,t){var n=new Cn;e.accept(n);var r=n.allProductions,o=i["v"](r,vn),s=i["N"](o,(function(e){return e.length>1})),a=i["I"](i["U"](s),(function(n){var r=i["s"](n),o=t.buildDuplicateFoundError(e,n),s=lt(r),a={message:o,type:Yr.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:s,occurrence:r.idx},l=En(r);return l&&(a.parameter=l),a}));return a}function vn(e){return lt(e)+"_#_"+e.idx+"_#_"+En(e)}function En(e){return e instanceof Ze?e.terminalType.name:e instanceof We?e.nonTerminalName:""}var Cn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return mn(t,e),t.prototype.visitNonTerminal=function(e){this.allProductions.push(e)},t.prototype.visitOption=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetition=function(e){this.allProductions.push(e)},t.prototype.visitAlternation=function(e){this.allProductions.push(e)},t.prototype.visitTerminal=function(e){this.allProductions.push(e)},t}(rt),Sn=/^[a-zA-Z_]\w*$/,Rn=new RegExp(Sn.source.replace("^","^\\$"));function Tn(e,t){var n=[],r=e.name;return r.match(Sn)||n.push({message:t.buildInvalidRuleNameError({topLevelRule:e,expectedPattern:Sn}),type:Yr.INVALID_RULE_NAME,ruleName:r}),n}function On(e,t,n){var r,i=[];return t.name.match(Rn)||(r=n.buildInvalidNestedRuleNameError(e,t),i.push({message:r,type:Yr.INVALID_NESTED_RULE_NAME,ruleName:e.name})),i}function Nn(e,t){var n=[],r=e.name;return r.match(Sn)||n.push({message:t.buildTokenNameError({tokenType:e,expectedPattern:Sn}),type:Yr.INVALID_TOKEN_NAME}),n}function An(e,t,n,r){var o=[],s=Object(i["O"])(t,(function(t,n){return n.name===e.name?t+1:t}),0);if(s>1){var a=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});o.push({message:a,type:Yr.DUPLICATE_RULE_NAME,ruleName:e.name})}return o}function In(e,t,n){var r,o=[];return i["j"](t,e)||(r="Invalid rule override, rule: ->"+e+"<- cannot be overridden in the grammar: ->"+n+"<-as it is not defined in any of the super grammars ",o.push({message:r,type:Yr.INVALID_RULE_OVERRIDE,ruleName:e})),o}function Mn(e,t,n,r){void 0===r&&(r=[]);var o=[],s=xn(t.definition);if(i["A"](s))return[];var a=e.name,l=i["j"](s,e);l&&o.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:Yr.LEFT_RECURSION,ruleName:a});var c=i["l"](s,r.concat([e])),h=i["I"](c,(function(t){var o=i["g"](r);return o.push(t),Mn(e,t,n,o)}));return o.concat(i["t"](h))}function xn(e){var t=[];if(i["A"](e))return t;var n=i["s"](e);if(n instanceof We)t.push(n.referencedRule);else if(n instanceof ze||n instanceof Ye||n instanceof Xe||n instanceof Ke||n instanceof qe||n instanceof $e)t=t.concat(xn(n.definition));else if(n instanceof Qe)t=i["t"](i["I"](n.definition,(function(e){return xn(e.definition)})));else if(!(n instanceof Ze))throw Error("non exhaustive match");var r=st(n),o=e.length>1;if(r&&o){var s=i["m"](e);return t.concat(xn(s))}return t}var _n=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.alternations=[],t}return mn(t,e),t.prototype.visitAlternation=function(e){this.alternations.push(e)},t}(rt);function Ln(e,t){var n=new _n;e.accept(n);var r=n.alternations,o=i["O"](r,(function(n,r){var o=i["n"](r.definition),s=i["I"](o,(function(n,o){var s=$t([n],[],null,1);return i["A"](s)?{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:r,emptyChoiceIdx:o}),type:Yr.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:r.idx,alternative:o+1}:null}));return n.concat(i["i"](s))}),[]);return o}function Pn(e,t,n,r){var o=new _n;e.accept(o);var s=o.alternations,a=n[e.name];a&&(s=Object(i["P"])(s,(function(e){return a[lt(e)+(0===e.idx?"":e.idx)]}))),s=Object(i["P"])(s,(function(e){return!0===e.ignoreAmbiguities}));var l=i["O"](s,(function(n,i){var o=i.idx,s=i.maxLookahead||t,a=un(o,e,s,i),l=Dn(a,i,e,r),c=Fn(a,i,e,r);return n.concat(l,c)}),[]);return l}var kn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return mn(t,e),t.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetition=function(e){this.allProductions.push(e)},t}(rt);function jn(e,t){var n=new _n;e.accept(n);var r=n.alternations,o=i["O"](r,(function(n,r){return r.definition.length>255&&n.push({message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:r}),type:Yr.TOO_MANY_ALTS,ruleName:e.name,occurrence:r.idx}),n}),[]);return o}function Hn(e,t,n){var r=[];return Object(i["u"])(e,(function(e){var o=new kn;e.accept(o);var s=o.allProductions;Object(i["u"])(s,(function(o){var s=Jt(o),a=o.maxLookahead||t,l=o.idx,c=dn(l,e,s,a),h=c[0];if(Object(i["A"])(Object(i["t"])(h))){var u=n.buildEmptyRepetitionError({topLevelRule:e,repetition:o});r.push({message:u,type:Yr.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}}))})),r}function Dn(e,t,n,r){var o=[],s=Object(i["O"])(e,(function(n,r,s){return!0===t.definition[s].ignoreAmbiguities||Object(i["u"])(r,(function(r){var a=[s];Object(i["u"])(e,(function(e,n){s!==n&&pn(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&a.push(n)})),a.length>1&&!pn(o,r)&&(o.push(r),n.push({alts:a,path:r}))})),n}),[]),a=i["I"](s,(function(e){var o=Object(i["I"])(e.alts,(function(e){return e+1})),s=r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:o,prefixPath:e.path});return{message:s,type:Yr.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:[e.alts]}}));return a}function Fn(e,t,n,r){var o=[],s=Object(i["O"])(e,(function(e,t,n){var r=Object(i["I"])(t,(function(e){return{idx:n,path:e}}));return e.concat(r)}),[]);return Object(i["u"])(s,(function(e){var a=t.definition[e.idx];if(!0!==a.ignoreAmbiguities){var l=e.idx,c=e.path,h=Object(i["r"])(s,(function(e){return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx<l&&fn(e.path,c)})),u=Object(i["I"])(h,(function(e){var i=[e.idx+1,l+1],o=0===t.idx?"":t.idx,s=r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path});return{message:s,type:Yr.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}}));o=o.concat(u)}})),o}function Un(e,t,n){var r=[],o=Object(i["I"])(t,(function(e){return e.name}));return Object(i["u"])(e,(function(e){var t=e.name;if(Object(i["j"])(o,t)){var s=n.buildNamespaceConflictError(e);r.push({message:s,type:Yr.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}})),r}function Vn(e,t){var n=[];return Object(i["u"])(e,(function(e){var r=new Dt("");e.accept(r);var o=Object(i["v"])(r.result,(function(e){return e.name})),s=Object(i["N"])(o,(function(e){return e.length>1}));Object(i["u"])(Object(i["U"])(s),(function(r){var o=Object(i["I"])(r,(function(e){return e.orgProd})),s=t.buildDuplicateNestedRuleNameError(e,o);n.push({message:s,type:Yr.DUPLICATE_NESTED_NAME,ruleName:e.name})}))})),n}var Bn={buildMismatchTokenMessage:function(e){var t=e.expected,n=e.actual,r=(e.previous,e.ruleName,Oe(t)),i=r?"--\x3e "+Re(t)+" <--":"token of type --\x3e "+t.name+" <--",o="Expecting "+i+" but found --\x3e '"+n.image+"' <--";return o},buildNotAllInputParsedMessage:function(e){var t=e.firstRedundant;e.ruleName;return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage:function(e){var t=e.expectedPathsPerAlt,n=e.actual,r=(e.previous,e.customUserDescription),o=(e.ruleName,"Expecting: "),s=Object(i["s"])(n).image,a="\nbut found: '"+s+"'";if(r)return o+r+a;var l=Object(i["O"])(t,(function(e,t){return e.concat(t)}),[]),c=Object(i["I"])(l,(function(e){return"["+Object(i["I"])(e,(function(e){return Re(e)})).join(", ")+"]"})),h=Object(i["I"])(c,(function(e,t){return" "+(t+1)+". "+e})),u="one of these possible Token sequences:\n"+h.join("\n");return o+u+a},buildEarlyExitMessage:function(e){var t=e.expectedIterationPaths,n=e.actual,r=e.customUserDescription,o=(e.ruleName,"Expecting: "),s=Object(i["s"])(n).image,a="\nbut found: '"+s+"'";if(r)return o+r+a;var l=Object(i["I"])(t,(function(e){return"["+Object(i["I"])(e,(function(e){return Re(e)})).join(",")+"]"})),c="expecting at least one iteration which starts with one of these possible Token sequences::\n <"+l.join(" ,")+">";return o+c+a}};Object.freeze(Bn);var Wn={buildRuleNotFoundError:function(e,t){var n="Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-";return n}},Gn={buildDuplicateFoundError:function(e,t){function n(e){return e instanceof Ze?e.terminalType.name:e instanceof We?e.nonTerminalName:""}var r=e.name,o=Object(i["s"])(t),s=o.idx,a=lt(o),l=n(o),c=s>0,h="->"+a+(c?s:"")+"<- "+(l?"with argument: ->"+l+"<-":"")+"\n appears more than once ("+t.length+" times) in the top level rule: ->"+r+"<-. \n For further details see: https://sap.github.io/chevrotain/docs/FAQ.html#NUMERICAL_SUFFIXES \n ";return h=h.replace(/[ \t]+/g," "),h=h.replace(/\s\s+/g,"\n"),h},buildInvalidNestedRuleNameError:function(e,t){var n="Invalid nested rule name: ->"+t.name+"<- inside rule: ->"+e.name+"<-\nit must match the pattern: ->"+Rn.toString()+"<-.\nNote that this means a nested rule name must start with the '$'(dollar) sign.";return n},buildDuplicateNestedRuleNameError:function(e,t){var n=Object(i["s"])(t).name,r="Duplicate nested rule name: ->"+n+"<- inside rule: ->"+e.name+"<-\nA nested name must be unique in the scope of a top level grammar rule.";return r},buildNamespaceConflictError:function(e){var t="Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+e.name+">.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.";return t},buildAlternationPrefixAmbiguityError:function(e){var t=Object(i["I"])(e.prefixPath,(function(e){return Re(e)})).join(", "),n=0===e.alternation.idx?"":e.alternation.idx,r="Ambiguous alternatives: <"+e.ambiguityIndices.join(" ,")+"> due to common lookahead prefix\nin <OR"+n+"> inside <"+e.topLevelRule.name+"> Rule,\n<"+t+"> may appears as a prefix path in all these alternatives.\nSee: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.";return r},buildAlternationAmbiguityError:function(e){var t=Object(i["I"])(e.prefixPath,(function(e){return Re(e)})).join(", "),n=0===e.alternation.idx?"":e.alternation.idx,r="Ambiguous Alternatives Detected: <"+e.ambiguityIndices.join(" ,")+"> in <OR"+n+"> inside <"+e.topLevelRule.name+"> Rule,\n<"+t+"> may appears as a prefix path in all these alternatives.\n";return r+="See: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.",r},buildEmptyRepetitionError:function(e){var t=lt(e.repetition);0!==e.repetition.idx&&(t+=e.repetition.idx);var n="The repetition <"+t+"> within Rule <"+e.topLevelRule.name+"> can never consume any tokens.\nThis could lead to an infinite loop.";return n},buildTokenNameError:function(e){var t=e.tokenType.name,n="Invalid Grammar Token name: ->"+t+"<- it must match the pattern: ->"+e.expectedPattern.toString()+"<-";return n},buildEmptyAlternationError:function(e){var t="Ambiguous empty alternative: <"+(e.emptyChoiceIdx+1)+"> in <OR"+e.alternation.idx+"> inside <"+e.topLevelRule.name+"> Rule.\nOnly the last alternative may be an empty alternative.";return t},buildTooManyAlternativesError:function(e){var t="An Alternation cannot have more than 256 alternatives:\n<OR"+e.alternation.idx+"> inside <"+e.topLevelRule.name+"> Rule.\n has "+(e.alternation.definition.length+1)+" alternatives.";return t},buildLeftRecursionError:function(e){var t=e.topLevelRule.name,n=i["I"](e.leftRecursionPath,(function(e){return e.name})),r=t+" --\x3e "+n.concat([t]).join(" --\x3e "),o="Left Recursion found in grammar.\nrule: <"+t+"> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n "+r+"\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.";return o},buildInvalidRuleNameError:function(e){var t=e.topLevelRule.name,n=e.expectedPattern.toString(),r="Invalid grammar rule name: ->"+t+"<- it must match the pattern: ->"+n+"<-";return r},buildDuplicateRuleNameError:function(e){var t;t=e.topLevelRule instanceof Ge?e.topLevelRule.name:e.topLevelRule;var n="Duplicate definition, rule: ->"+t+"<- is already defined in the grammar: ->"+e.grammarName+"<-";return n}},zn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Yn(e,t){var n=new Xn(e,t);return n.resolveRefs(),n.errors}var Xn=function(e){function t(t,n){var r=e.call(this)||this;return r.nameToTopRule=t,r.errMsgProvider=n,r.errors=[],r}return zn(t,e),t.prototype.resolveRefs=function(){var e=this;Object(i["u"])(Object(i["U"])(this.nameToTopRule),(function(t){e.currTopLevel=t,t.accept(e)}))},t.prototype.visitNonTerminal=function(e){var t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:Yr.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}},t}(rt);function Kn(e){e=Object(i["k"])(e,{errMsgProvider:Wn});var t={};return Object(i["u"])(e.rules,(function(e){t[e.name]=e})),Yn(t,e.errMsgProvider)}function $n(e){return e=Object(i["k"])(e,{errMsgProvider:Gn,ignoredIssues:{}}),yn(e.rules,e.maxLookahead,e.tokenTypes,e.ignoredIssues,e.errMsgProvider,e.grammarName)}function qn(e){Object(i["u"])(e.rules,(function(e){var t=new ct;e.accept(t),Object(i["u"])(t.dslMethods,(function(e){Object(i["u"])(e,(function(e,t){e.idx=t+1}))}))}))}var Qn="MismatchedTokenException",Zn="NoViableAltException",Jn="EarlyExitException",er="NotAllInputParsedException",tr=[Qn,Zn,Jn,er];function nr(e){return Object(i["j"])(tr,e.name)}function rr(e,t,n){this.name=Qn,this.message=e,this.token=t,this.previousToken=n,this.resyncedTokens=[]}function ir(e,t,n){this.name=Zn,this.message=e,this.token=t,this.previousToken=n,this.resyncedTokens=[]}function or(e,t){this.name=er,this.message=e,this.token=t,this.resyncedTokens=[]}function sr(e,t,n){this.name=Jn,this.message=e,this.token=t,this.previousToken=n,this.resyncedTokens=[]}Object.freeze(tr),rr.prototype=Error.prototype,ir.prototype=Error.prototype,or.prototype=Error.prototype,sr.prototype=Error.prototype;var ar={},lr="InRuleRecoveryException";function cr(e){this.name=lr,this.message=e}cr.prototype=Error.prototype;var hr=function(){function e(){}return e.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object(i["w"])(e,"recoveryEnabled")?e.recoveryEnabled:Xr.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=ur)},e.prototype.getTokenToInsert=function(e){var t=Fe(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t},e.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},e.prototype.tryInRepetitionRecovery=function(e,t,n,r){var o=this,s=this.findReSyncTokenType(),a=this.exportLexerState(),l=[],c=!1,h=this.LA(1),u=this.LA(1),d=function(){var e=o.LA(0),t=o.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:h,previous:e,ruleName:o.getCurrRuleFullName()}),n=new rr(t,h,o.LA(0));n.resyncedTokens=Object(i["n"])(l),o.SAVE_ERROR(n)};while(!c){if(this.tokenMatcher(u,r))return void d();if(n.call(this))return d(),void e.apply(this,t);this.tokenMatcher(u,s)?c=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,l))}this.importLexerState(a)},e.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,n){return!1!==n&&(void 0!==e&&void 0!==t&&(!this.tokenMatcher(this.LA(1),e)&&(!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))))},e.prototype.getFollowsForInRuleRecovery=function(e,t){var n=this.getCurrentGrammarPath(e,t),r=this.getNextPossibleTokenTypes(n);return r},e.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t)){var n=this.getTokenToInsert(e);return n}if(this.canRecoverWithSingleTokenDeletion(e)){var r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new cr("sad sad panda")},e.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},e.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var n=this;if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(Object(i["A"])(t))return!1;var r=this.LA(1),o=void 0!==Object(i["q"])(t,(function(e){return n.tokenMatcher(r,e)}));return o},e.prototype.canRecoverWithSingleTokenDeletion=function(e){var t=this.tokenMatcher(this.LA(2),e);return t},e.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(t);return Object(i["j"])(n,e)},e.prototype.findReSyncTokenType=function(){var e=this.flattenFollowSet(),t=this.LA(1),n=2;while(1){var r=t.tokenType;if(Object(i["j"])(e,r))return r;t=this.LA(n),n++}},e.prototype.getCurrFollowKey=function(){if(1===this.RULE_STACK.length)return ar;var e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}},e.prototype.buildFullFollowKeyStack=function(){var e=this,t=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return Object(i["A"])(this.LAST_EXPLICIT_RULE_STACK)||(t=Object(i["I"])(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.RULE_STACK[t]})),n=Object(i["I"])(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.RULE_OCCURRENCE_STACK[t]}))),Object(i["I"])(t,(function(r,i){return 0===i?ar:{ruleName:e.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:e.shortRuleNameToFullName(t[i-1])}}))},e.prototype.flattenFollowSet=function(){var e=this,t=Object(i["I"])(this.buildFullFollowKeyStack(),(function(t){return e.getFollowSetFromFollowKey(t)}));return Object(i["t"])(t)},e.prototype.getFollowSetFromFollowKey=function(e){if(e===ar)return[De];var t=e.ruleName+e.idxInCallingRule+mt+e.inRule;return this.resyncFollows[t]},e.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,De)||t.push(e),t},e.prototype.reSyncTo=function(e){var t=[],n=this.LA(1);while(!1===this.tokenMatcher(n,e))n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return Object(i["n"])(t)},e.prototype.attemptInRepetitionRecovery=function(e,t,n,r,i,o,s){},e.prototype.getCurrentGrammarPath=function(e,t){var n=this.getHumanReadableRuleStack(),r=Object(i["g"])(this.RULE_OCCURRENCE_STACK),o={ruleStack:n,occurrenceStack:r,lastTok:e,lastTokOccurrence:t};return o},e.prototype.getHumanReadableRuleStack=function(){var e=this;return Object(i["A"])(this.LAST_EXPLICIT_RULE_STACK)?Object(i["I"])(this.RULE_STACK,(function(t){return e.shortRuleNameToFullName(t)})):Object(i["I"])(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.shortRuleNameToFullName(e.RULE_STACK[t])}))},e}();function ur(e,t,n,r,i,o,s){var a=this.getKeyForAutomaticLookahead(r,i),l=this.firstAfterRepMap[a];if(void 0===l){var c=this.getCurrRuleFullName(),h=this.getGAstProductions()[c],u=new o(h,i);l=u.startWalking(),this.firstAfterRepMap[a]=l}var d=l.token,p=l.occurrence,f=l.isEndOfRule;1===this.RULE_STACK.length&&f&&void 0===d&&(d=De,p=1),this.shouldInRepetitionRecoveryBeTried(d,p,s)&&this.tryInRepetitionRecovery(e,t,n,d)}var dr=function(){function e(){}return e.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=Object(i["w"])(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Xr.dynamicTokensEnabled,this.maxLookahead=Object(i["w"])(e,"maxLookahead")?e.maxLookahead:Xr.maxLookahead,this.lookAheadFuncsCache=Object(i["z"])()?new Map:[],Object(i["z"])()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},e.prototype.preComputeLookaheadFunctions=function(e){var t=this;Object(i["u"])(e,(function(e){t.TRACE_INIT(e.name+" Rule Lookahead",(function(){var n=ut(e),r=n.alternation,o=n.repetition,s=n.option,a=n.repetitionMandatory,l=n.repetitionMandatoryWithSeparator,c=n.repetitionWithSeparator;Object(i["u"])(r,(function(n){var r=0===n.idx?"":n.idx;t.TRACE_INIT(""+lt(n)+r,(function(){var r=en(n.idx,e,n.maxLookahead||t.maxLookahead,n.hasPredicates,t.dynamicTokensEnabled,t.lookAheadBuilderForAlternatives),i=Mt(t.fullRuleNameToShort[e.name],Rt,n.idx);t.setLaFuncCache(i,r)}))})),Object(i["u"])(o,(function(n){t.computeLookaheadFunc(e,n.idx,Ot,Qt.REPETITION,n.maxLookahead,lt(n))})),Object(i["u"])(s,(function(n){t.computeLookaheadFunc(e,n.idx,Tt,Qt.OPTION,n.maxLookahead,lt(n))})),Object(i["u"])(a,(function(n){t.computeLookaheadFunc(e,n.idx,Nt,Qt.REPETITION_MANDATORY,n.maxLookahead,lt(n))})),Object(i["u"])(l,(function(n){t.computeLookaheadFunc(e,n.idx,It,Qt.REPETITION_MANDATORY_WITH_SEPARATOR,n.maxLookahead,lt(n))})),Object(i["u"])(c,(function(n){t.computeLookaheadFunc(e,n.idx,At,Qt.REPETITION_WITH_SEPARATOR,n.maxLookahead,lt(n))}))}))}))},e.prototype.computeLookaheadFunc=function(e,t,n,r,i,o){var s=this;this.TRACE_INIT(""+o+(0===t?"":t),(function(){var o=tn(t,e,i||s.maxLookahead,s.dynamicTokensEnabled,r,s.lookAheadBuilderForOptional),a=Mt(s.fullRuleNameToShort[e.name],n,t);s.setLaFuncCache(a,o)}))},e.prototype.lookAheadBuilderForOptional=function(e,t,n){return rn(e,t,n)},e.prototype.lookAheadBuilderForAlternatives=function(e,t,n,r){return nn(e,t,n,r)},e.prototype.getKeyForAutomaticLookahead=function(e,t){var n=this.getLastExplicitRuleShortName();return Mt(n,e,t)},e.prototype.getLaFuncFromCache=function(e){},e.prototype.getLaFuncFromMap=function(e){return this.lookAheadFuncsCache.get(e)},e.prototype.getLaFuncFromObj=function(e){return this.lookAheadFuncsCache[e]},e.prototype.setLaFuncCache=function(e,t){},e.prototype.setLaFuncCacheUsingMap=function(e,t){this.lookAheadFuncsCache.set(e,t)},e.prototype.setLaFuncUsingObj=function(e,t){this.lookAheadFuncsCache[e]=t},e}();function pr(e){return yr(e.constructor)}var fr,gr=/^\s*function\s*(\S*)\s*\(/,mr="name";function yr(e){var t=e.name;if(t)return t;var n=e.toString().match(gr)[1];return n}function wr(e,t){var n=Object.getOwnPropertyDescriptor(e,mr);return!(!Object(i["F"])(n)&&!n.configurable)&&(Object.defineProperty(e,mr,{enumerable:!1,configurable:!0,writable:!1,value:t}),!0)}function br(e,t){for(var n=Object(i["G"])(e),r=n.length,o=0;o<r;o++)for(var s=n[o],a=e[s],l=a.length,c=0;c<l;c++){var h=a[c];void 0===h.tokenTypeIdx&&(void 0!==h.fullName?this[h.fullName](h.children,t):this[h.name](h.children,t))}}function vr(e,t){var n=function(){};wr(n,e+"BaseSemantics");var r={visit:function(e,t){if(Object(i["y"])(e)&&(e=e[0]),!Object(i["F"])(e))return void 0!==e.fullName?this[e.fullName](e.children,t):this[e.name](e.children,t)},validateVisitor:function(){var e=Cr(this,t);if(!Object(i["A"])(e)){var n=Object(i["I"])(e,(function(e){return e.msg}));throw Error("Errors Detected in CST Visitor <"+yr(this.constructor)+">:\n\t"+n.join("\n\n").replace(/\n/g,"\n\t"))}}};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=t,n}function Er(e,t,n){var r=function(){};wr(r,e+"BaseSemanticsWithDefaults");var o=Object.create(n.prototype);return Object(i["u"])(t,(function(e){o[e]=br})),r.prototype=o,r.prototype.constructor=r,r}function Cr(e,t){var n=Sr(e,t),r=Tr(e,t);return n.concat(r)}function Sr(e,t){var n=Object(i["I"])(t,(function(t){if(!Object(i["B"])(e[t]))return{msg:"Missing visitor method: <"+t+"> on "+yr(e.constructor)+" CST Visitor.",type:fr.MISSING_METHOD,methodName:t}}));return Object(i["i"])(n)}(function(e){e[e["REDUNDANT_METHOD"]=0]="REDUNDANT_METHOD",e[e["MISSING_METHOD"]=1]="MISSING_METHOD"})(fr||(fr={}));var Rr=["constructor","visit","validateVisitor"];function Tr(e,t){var n=[];for(var r in e)Sn.test(r)&&Object(i["B"])(e[r])&&!Object(i["j"])(Rr,r)&&!Object(i["j"])(t,r)&&n.push({msg:"Redundant visitor method: <"+r+"> on "+yr(e.constructor)+" CST Visitor\nThere is no Grammar Rule corresponding to this method's name.\nFor utility methods on visitor classes use methods names that do not match /"+Sn.source+"/.",type:fr.REDUNDANT_METHOD,methodName:r});return n}var Or=function(){function e(){}return e.prototype.initTreeBuilder=function(e){if(this.LAST_EXPLICIT_RULE_STACK=[],this.CST_STACK=[],this.outputCst=Object(i["w"])(e,"outputCst")?e.outputCst:Xr.outputCst,this.nodeLocationTracking=Object(i["w"])(e,"nodeLocationTracking")?e.nodeLocationTracking:Xr.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=kt,this.setNodeLocationFromNode=kt,this.cstPostRule=i["b"],this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=i["b"],this.setNodeLocationFromNode=i["b"],this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Pt,this.setNodeLocationFromNode=Pt,this.cstPostRule=i["b"],this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=i["b"],this.setNodeLocationFromNode=i["b"],this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error('Invalid <nodeLocationTracking> config option: "'+e.nodeLocationTracking+'"');this.setNodeLocationFromToken=i["b"],this.setNodeLocationFromNode=i["b"],this.cstPostRule=i["b"],this.setInitialNodeLocation=i["b"]}else this.cstInvocationStateUpdate=i["b"],this.cstFinallyStateUpdate=i["b"],this.cstPostTerminal=i["b"],this.cstPostNonTerminal=i["b"],this.cstPostRule=i["b"],this.getLastExplicitRuleShortName=this.getLastExplicitRuleShortNameNoCst,this.getPreviousExplicitRuleShortName=this.getPreviousExplicitRuleShortNameNoCst,this.getLastExplicitRuleOccurrenceIndex=this.getLastExplicitRuleOccurrenceIndexNoCst,this.manyInternal=this.manyInternalNoCst,this.orInternal=this.orInternalNoCst,this.optionInternal=this.optionInternalNoCst,this.atLeastOneInternal=this.atLeastOneInternalNoCst,this.manySepFirstInternal=this.manySepFirstInternalNoCst,this.atLeastOneSepFirstInternal=this.atLeastOneSepFirstInternalNoCst},e.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},e.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},e.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.setInitialNodeLocationFullRegular=function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.cstNestedInvocationStateUpdate=function(e,t){var n={name:e,fullName:this.shortRuleNameToFull[this.getLastExplicitRuleShortName()]+e,children:{}};this.setInitialNodeLocation(n),this.CST_STACK.push(n)},e.prototype.cstInvocationStateUpdate=function(e,t){this.LAST_EXPLICIT_RULE_STACK.push(this.RULE_STACK.length-1);var n={name:e,children:{}};this.setInitialNodeLocation(n),this.CST_STACK.push(n)},e.prototype.cstFinallyStateUpdate=function(){this.LAST_EXPLICIT_RULE_STACK.pop(),this.CST_STACK.pop()},e.prototype.cstNestedFinallyStateUpdate=function(){var e=this.CST_STACK.pop();this.cstPostRule(e)},e.prototype.cstPostRuleFull=function(e){var t=this.LA(0),n=e.location;n.startOffset<=t.startOffset===!0?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)},e.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),n=e.location;n.startOffset<=t.startOffset===!0?n.endOffset=t.endOffset:n.startOffset=NaN},e.prototype.cstPostTerminal=function(e,t){var n=this.CST_STACK[this.CST_STACK.length-1];jt(n,t,e),this.setNodeLocationFromToken(n.location,t)},e.prototype.cstPostNonTerminal=function(e,t){if(!0!==this.isBackTracking()){var n=this.CST_STACK[this.CST_STACK.length-1];Ht(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}},e.prototype.getBaseCstVisitorConstructor=function(){if(Object(i["F"])(this.baseCstVisitorConstructor)){var e=vr(this.className,this.allRuleNames);return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},e.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if(Object(i["F"])(this.baseCstVisitorWithDefaultsConstructor)){var e=Er(this.className,this.allRuleNames,this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},e.prototype.nestedRuleBeforeClause=function(e,t){var n;return void 0!==e.NAME?(n=e.NAME,this.nestedRuleInvocationStateUpdate(n,t),n):void 0},e.prototype.nestedAltBeforeClause=function(e,t,n,r){var i,o=this.getLastExplicitRuleShortName(),s=_t(o,n,t,r);return void 0!==e.NAME?(i=e.NAME,this.nestedRuleInvocationStateUpdate(i,s),{shortName:s,nestedName:i}):void 0},e.prototype.nestedRuleFinallyClause=function(e,t){var n=this.CST_STACK,r=n[n.length-1];this.nestedRuleFinallyStateUpdate();var i=n[n.length-1];Ht(i,t,r),this.setNodeLocationFromNode(i.location,r.location)},e.prototype.getLastExplicitRuleShortName=function(){var e=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-1];return this.RULE_STACK[e]},e.prototype.getLastExplicitRuleShortNameNoCst=function(){var e=this.RULE_STACK;return e[e.length-1]},e.prototype.getPreviousExplicitRuleShortName=function(){var e=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-2];return this.RULE_STACK[e]},e.prototype.getPreviousExplicitRuleShortNameNoCst=function(){var e=this.RULE_STACK;return e[e.length-2]},e.prototype.getLastExplicitRuleOccurrenceIndex=function(){var e=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-1];return this.RULE_OCCURRENCE_STACK[e]},e.prototype.getLastExplicitRuleOccurrenceIndexNoCst=function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]},e.prototype.nestedRuleInvocationStateUpdate=function(e,t){this.RULE_OCCURRENCE_STACK.push(1),this.RULE_STACK.push(t),this.cstNestedInvocationStateUpdate(e,t)},e.prototype.nestedRuleFinallyStateUpdate=function(){this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstNestedFinallyStateUpdate()},e}(),Nr=function(){function e(){}return e.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(e.prototype,"input",{get:function(){return this.tokVector},set:function(e){if(!0!==this.selfAnalysisDone)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length},enumerable:!0,configurable:!0}),e.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):zr},e.prototype.LA=function(e){var t=this.currIdx+e;return t<0||this.tokVectorLength<=t?zr:this.tokVector[t]},e.prototype.consumeToken=function(){this.currIdx++},e.prototype.exportLexerState=function(){return this.currIdx},e.prototype.importLexerState=function(e){this.currIdx=e},e.prototype.resetLexerState=function(){this.currIdx=-1},e.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},e.prototype.getLexerPosition=function(){return this.exportLexerState()},e}(),Ar=function(){function e(){}return e.prototype.ACTION=function(e){return e.call(this)},e.prototype.consume=function(e,t,n){return this.consumeInternal(t,e,n)},e.prototype.subrule=function(e,t,n){return this.subruleInternal(t,e,n)},e.prototype.option=function(e,t){return this.optionInternal(t,e)},e.prototype.or=function(e,t){return this.orInternal(t,e)},e.prototype.many=function(e,t){return this.manyInternal(e,t)},e.prototype.atLeastOne=function(e,t){return this.atLeastOneInternal(e,t)},e.prototype.CONSUME=function(e,t){return this.consumeInternal(e,0,t)},e.prototype.CONSUME1=function(e,t){return this.consumeInternal(e,1,t)},e.prototype.CONSUME2=function(e,t){return this.consumeInternal(e,2,t)},e.prototype.CONSUME3=function(e,t){return this.consumeInternal(e,3,t)},e.prototype.CONSUME4=function(e,t){return this.consumeInternal(e,4,t)},e.prototype.CONSUME5=function(e,t){return this.consumeInternal(e,5,t)},e.prototype.CONSUME6=function(e,t){return this.consumeInternal(e,6,t)},e.prototype.CONSUME7=function(e,t){return this.consumeInternal(e,7,t)},e.prototype.CONSUME8=function(e,t){return this.consumeInternal(e,8,t)},e.prototype.CONSUME9=function(e,t){return this.consumeInternal(e,9,t)},e.prototype.SUBRULE=function(e,t){return this.subruleInternal(e,0,t)},e.prototype.SUBRULE1=function(e,t){return this.subruleInternal(e,1,t)},e.prototype.SUBRULE2=function(e,t){return this.subruleInternal(e,2,t)},e.prototype.SUBRULE3=function(e,t){return this.subruleInternal(e,3,t)},e.prototype.SUBRULE4=function(e,t){return this.subruleInternal(e,4,t)},e.prototype.SUBRULE5=function(e,t){return this.subruleInternal(e,5,t)},e.prototype.SUBRULE6=function(e,t){return this.subruleInternal(e,6,t)},e.prototype.SUBRULE7=function(e,t){return this.subruleInternal(e,7,t)},e.prototype.SUBRULE8=function(e,t){return this.subruleInternal(e,8,t)},e.prototype.SUBRULE9=function(e,t){return this.subruleInternal(e,9,t)},e.prototype.OPTION=function(e){return this.optionInternal(e,0)},e.prototype.OPTION1=function(e){return this.optionInternal(e,1)},e.prototype.OPTION2=function(e){return this.optionInternal(e,2)},e.prototype.OPTION3=function(e){return this.optionInternal(e,3)},e.prototype.OPTION4=function(e){return this.optionInternal(e,4)},e.prototype.OPTION5=function(e){return this.optionInternal(e,5)},e.prototype.OPTION6=function(e){return this.optionInternal(e,6)},e.prototype.OPTION7=function(e){return this.optionInternal(e,7)},e.prototype.OPTION8=function(e){return this.optionInternal(e,8)},e.prototype.OPTION9=function(e){return this.optionInternal(e,9)},e.prototype.OR=function(e){return this.orInternal(e,0)},e.prototype.OR1=function(e){return this.orInternal(e,1)},e.prototype.OR2=function(e){return this.orInternal(e,2)},e.prototype.OR3=function(e){return this.orInternal(e,3)},e.prototype.OR4=function(e){return this.orInternal(e,4)},e.prototype.OR5=function(e){return this.orInternal(e,5)},e.prototype.OR6=function(e){return this.orInternal(e,6)},e.prototype.OR7=function(e){return this.orInternal(e,7)},e.prototype.OR8=function(e){return this.orInternal(e,8)},e.prototype.OR9=function(e){return this.orInternal(e,9)},e.prototype.MANY=function(e){this.manyInternal(0,e)},e.prototype.MANY1=function(e){this.manyInternal(1,e)},e.prototype.MANY2=function(e){this.manyInternal(2,e)},e.prototype.MANY3=function(e){this.manyInternal(3,e)},e.prototype.MANY4=function(e){this.manyInternal(4,e)},e.prototype.MANY5=function(e){this.manyInternal(5,e)},e.prototype.MANY6=function(e){this.manyInternal(6,e)},e.prototype.MANY7=function(e){this.manyInternal(7,e)},e.prototype.MANY8=function(e){this.manyInternal(8,e)},e.prototype.MANY9=function(e){this.manyInternal(9,e)},e.prototype.MANY_SEP=function(e){this.manySepFirstInternal(0,e)},e.prototype.MANY_SEP1=function(e){this.manySepFirstInternal(1,e)},e.prototype.MANY_SEP2=function(e){this.manySepFirstInternal(2,e)},e.prototype.MANY_SEP3=function(e){this.manySepFirstInternal(3,e)},e.prototype.MANY_SEP4=function(e){this.manySepFirstInternal(4,e)},e.prototype.MANY_SEP5=function(e){this.manySepFirstInternal(5,e)},e.prototype.MANY_SEP6=function(e){this.manySepFirstInternal(6,e)},e.prototype.MANY_SEP7=function(e){this.manySepFirstInternal(7,e)},e.prototype.MANY_SEP8=function(e){this.manySepFirstInternal(8,e)},e.prototype.MANY_SEP9=function(e){this.manySepFirstInternal(9,e)},e.prototype.AT_LEAST_ONE=function(e){this.atLeastOneInternal(0,e)},e.prototype.AT_LEAST_ONE1=function(e){return this.atLeastOneInternal(1,e)},e.prototype.AT_LEAST_ONE2=function(e){this.atLeastOneInternal(2,e)},e.prototype.AT_LEAST_ONE3=function(e){this.atLeastOneInternal(3,e)},e.prototype.AT_LEAST_ONE4=function(e){this.atLeastOneInternal(4,e)},e.prototype.AT_LEAST_ONE5=function(e){this.atLeastOneInternal(5,e)},e.prototype.AT_LEAST_ONE6=function(e){this.atLeastOneInternal(6,e)},e.prototype.AT_LEAST_ONE7=function(e){this.atLeastOneInternal(7,e)},e.prototype.AT_LEAST_ONE8=function(e){this.atLeastOneInternal(8,e)},e.prototype.AT_LEAST_ONE9=function(e){this.atLeastOneInternal(9,e)},e.prototype.AT_LEAST_ONE_SEP=function(e){this.atLeastOneSepFirstInternal(0,e)},e.prototype.AT_LEAST_ONE_SEP1=function(e){this.atLeastOneSepFirstInternal(1,e)},e.prototype.AT_LEAST_ONE_SEP2=function(e){this.atLeastOneSepFirstInternal(2,e)},e.prototype.AT_LEAST_ONE_SEP3=function(e){this.atLeastOneSepFirstInternal(3,e)},e.prototype.AT_LEAST_ONE_SEP4=function(e){this.atLeastOneSepFirstInternal(4,e)},e.prototype.AT_LEAST_ONE_SEP5=function(e){this.atLeastOneSepFirstInternal(5,e)},e.prototype.AT_LEAST_ONE_SEP6=function(e){this.atLeastOneSepFirstInternal(6,e)},e.prototype.AT_LEAST_ONE_SEP7=function(e){this.atLeastOneSepFirstInternal(7,e)},e.prototype.AT_LEAST_ONE_SEP8=function(e){this.atLeastOneSepFirstInternal(8,e)},e.prototype.AT_LEAST_ONE_SEP9=function(e){this.atLeastOneSepFirstInternal(9,e)},e.prototype.RULE=function(e,t,n){if(void 0===n&&(n=Kr),Object(i["j"])(this.definedRulesNames,e)){var r=Gn.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),o={message:r,type:Yr.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);var s=this.defineRule(e,t,n);return this[e]=s,s},e.prototype.OVERRIDE_RULE=function(e,t,n){void 0===n&&(n=Kr);var r=[];r=r.concat(In(e,this.definedRulesNames,this.className)),this.definitionErrors.push.apply(this.definitionErrors,r);var i=this.defineRule(e,t,n);return this[e]=i,i},e.prototype.BACKTRACK=function(e,t){return function(){this.isBackTrackingStack.push(1);var n=this.saveRecogState();try{return e.apply(this,t),!0}catch(r){if(nr(r))return!1;throw r}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}},e.prototype.getGAstProductions=function(){return this.gastProductionsCache},e.prototype.getSerializedGastProductions=function(){return Je(Object(i["U"])(this.gastProductionsCache))},e}(),Ir=function(){function e(){}return e.prototype.initRecognizerEngine=function(e,t){if(this.className=pr(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=se,this.definedRulesNames=[],this.tokensMap={},this.allRuleNames=[],this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Object(i["w"])(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Object(i["y"])(e)){if(Object(i["A"])(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"===typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(Object(i["y"])(e))this.tokensMap=Object(i["O"])(e,(function(e,t){return e[t.name]=t,e}),{});else if(Object(i["w"])(e,"modes")&&Object(i["o"])(Object(i["t"])(Object(i["U"])(e.modes)),be)){var n=Object(i["t"])(Object(i["U"])(e.modes)),r=Object(i["T"])(n);this.tokensMap=Object(i["O"])(r,(function(e,t){return e[t.name]=t,e}),{})}else{if(!Object(i["C"])(e))throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Object(i["h"])(e)}this.tokensMap["EOF"]=De;var o=Object(i["o"])(Object(i["U"])(e),(function(e){return Object(i["A"])(e.categoryMatches)}));this.tokenMatcher=o?se:oe,ce(Object(i["U"])(this.tokensMap))},e.prototype.defineRule=function(e,t,n){if(this.selfAnalysisDone)throw Error("Grammar rule <"+e+"> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.");var r,o=Object(i["w"])(n,"resyncEnabled")?n.resyncEnabled:Kr.resyncEnabled,s=Object(i["w"])(n,"recoveryValueFunc")?n.recoveryValueFunc:Kr.recoveryValueFunc,a=this.ruleShortNameIdx<<Et+Ct;function l(e){try{if(!0===this.outputCst){t.apply(this,e);var n=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(n),n}return t.apply(this,e)}catch(r){return this.invokeRuleCatch(r,o,s)}finally{this.ruleFinallyStateUpdate()}}this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a,r=function(t,n){return void 0===t&&(t=0),this.ruleInvocationStateUpdate(a,e,t),l.call(this,n)};var c="ruleName";return r[c]=e,r["originalGrammarAction"]=t,r},e.prototype.invokeRuleCatch=function(e,t,n){var r=1===this.RULE_STACK.length,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(nr(e)){var o=e;if(i){var s=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(s)){if(o.resyncedTokens=this.reSyncTo(s),this.outputCst){var a=this.CST_STACK[this.CST_STACK.length-1];return a.recoveredNode=!0,a}return n()}if(this.outputCst){a=this.CST_STACK[this.CST_STACK.length-1];a.recoveredNode=!0,o.partialCstResult=a}throw o}if(r)return this.moveToTerminatedState(),n();throw o}throw e},e.prototype.optionInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(Tt,t),r=this.nestedRuleBeforeClause(e,n);try{return this.optionInternalLogic(e,t,n)}finally{void 0!==r&&this.nestedRuleFinallyClause(n,r)}},e.prototype.optionInternalNoCst=function(e,t){var n=this.getKeyForAutomaticLookahead(Tt,t);return this.optionInternalLogic(e,t,n)},e.prototype.optionInternalLogic=function(e,t,n){var r,i,o=this,s=this.getLaFuncFromCache(n);if(void 0!==e.DEF){if(r=e.DEF,i=e.GATE,void 0!==i){var a=s;s=function(){return i.call(o)&&a.call(o)}}}else r=e;if(!0===s.call(this))return r.call(this)},e.prototype.atLeastOneInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(Nt,e),r=this.nestedRuleBeforeClause(t,n);try{return this.atLeastOneInternalLogic(e,t,n)}finally{void 0!==r&&this.nestedRuleFinallyClause(n,r)}},e.prototype.atLeastOneInternalNoCst=function(e,t){var n=this.getKeyForAutomaticLookahead(Nt,e);this.atLeastOneInternalLogic(e,t,n)},e.prototype.atLeastOneInternalLogic=function(e,t,n){var r,i,o=this,s=this.getLaFuncFromCache(n);if(void 0!==t.DEF){if(r=t.DEF,i=t.GATE,void 0!==i){var a=s;s=function(){return i.call(o)&&a.call(o)}}}else r=t;if(!0!==s.call(this))throw this.raiseEarlyExitException(e,Qt.REPETITION_MANDATORY,t.ERR_MSG);var l=this.doSingleRepetition(r);while(!0===s.call(this)&&!0===l)l=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],s,Nt,e,Yt)},e.prototype.atLeastOneSepFirstInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(It,e),r=this.nestedRuleBeforeClause(t,n);try{this.atLeastOneSepFirstInternalLogic(e,t,n)}finally{void 0!==r&&this.nestedRuleFinallyClause(n,r)}},e.prototype.atLeastOneSepFirstInternalNoCst=function(e,t){var n=this.getKeyForAutomaticLookahead(It,e);this.atLeastOneSepFirstInternalLogic(e,t,n)},e.prototype.atLeastOneSepFirstInternalLogic=function(e,t,n){var r=this,i=t.DEF,o=t.SEP,s=this.getLaFuncFromCache(n);if(!0!==s.call(this))throw this.raiseEarlyExitException(e,Qt.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);i.call(this);var a=function(){return r.tokenMatcher(r.LA(1),o)};while(!0===this.tokenMatcher(this.LA(1),o))this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,Xt],a,It,e,Xt)},e.prototype.manyInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(Ot,e),r=this.nestedRuleBeforeClause(t,n);try{return this.manyInternalLogic(e,t,n)}finally{void 0!==r&&this.nestedRuleFinallyClause(n,r)}},e.prototype.manyInternalNoCst=function(e,t){var n=this.getKeyForAutomaticLookahead(Ot,e);return this.manyInternalLogic(e,t,n)},e.prototype.manyInternalLogic=function(e,t,n){var r,i,o=this,s=this.getLaFuncFromCache(n);if(void 0!==t.DEF){if(r=t.DEF,i=t.GATE,void 0!==i){var a=s;s=function(){return i.call(o)&&a.call(o)}}}else r=t;var l=!0;while(!0===s.call(this)&&!0===l)l=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],s,Ot,e,Gt,l)},e.prototype.manySepFirstInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(At,e),r=this.nestedRuleBeforeClause(t,n);try{this.manySepFirstInternalLogic(e,t,n)}finally{void 0!==r&&this.nestedRuleFinallyClause(n,r)}},e.prototype.manySepFirstInternalNoCst=function(e,t){var n=this.getKeyForAutomaticLookahead(At,e);this.manySepFirstInternalLogic(e,t,n)},e.prototype.manySepFirstInternalLogic=function(e,t,n){var r=this,i=t.DEF,o=t.SEP,s=this.getLaFuncFromCache(n);if(!0===s.call(this)){i.call(this);var a=function(){return r.tokenMatcher(r.LA(1),o)};while(!0===this.tokenMatcher(this.LA(1),o))this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,zt],a,At,e,zt)}},e.prototype.repetitionSepSecondInternal=function(e,t,n,r,i){while(n())this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,It,e,i)},e.prototype.doSingleRepetition=function(e){var t=this.getLexerPosition();e.call(this);var n=this.getLexerPosition();return n>t},e.prototype.orInternalNoCst=function(e,t){var n=Object(i["y"])(e)?e:e.DEF,r=this.getKeyForAutomaticLookahead(Rt,t),o=this.getLaFuncFromCache(r),s=o.call(this,n);if(void 0!==s){var a=n[s];return a.ALT.call(this)}this.raiseNoAltException(t,e.ERR_MSG)},e.prototype.orInternal=function(e,t){var n=this.getKeyForAutomaticLookahead(Rt,t),r=this.nestedRuleBeforeClause(e,n);try{var o=Object(i["y"])(e)?e:e.DEF,s=this.getLaFuncFromCache(n),a=s.call(this,o);if(void 0!==a){var l=o[a],c=this.nestedAltBeforeClause(l,t,Rt,a);try{return l.ALT.call(this)}finally{void 0!==c&&this.nestedRuleFinallyClause(c.shortName,c.nestedName)}}this.raiseNoAltException(t,e.ERR_MSG)}finally{void 0!==r&&this.nestedRuleFinallyClause(n,r)}},e.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){var e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new or(t,e))}},e.prototype.subruleInternal=function(e,t,n){var r;try{var i=void 0!==n?n.ARGS:void 0;return r=e.call(this,t,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:e.ruleName),r}catch(o){this.subruleInternalError(o,n,e.ruleName)}},e.prototype.subruleInternalError=function(e,t,n){throw nr(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:n),delete e.partialCstResult),e},e.prototype.consumeInternal=function(e,t,n){var r;try{var i=this.LA(1);!0===this.tokenMatcher(i,e)?(this.consumeToken(),r=i):this.consumeInternalError(e,i,n)}catch(o){r=this.consumeInternalRecovery(e,t,o)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:e.name,r),r},e.prototype.consumeInternalError=function(e,t,n){var r,i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new rr(r,t,i))},e.prototype.consumeInternalRecovery=function(e,t,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;var r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(i){throw i.name===lr?n:i}},e.prototype.saveRecogState=function(){var e=this.errors,t=Object(i["g"])(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK,LAST_EXPLICIT_RULE_STACK:this.LAST_EXPLICIT_RULE_STACK}},e.prototype.reloadRecogState=function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK},e.prototype.ruleInvocationStateUpdate=function(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t,e)},e.prototype.isBackTracking=function(){return 0!==this.isBackTrackingStack.length},e.prototype.getCurrRuleFullName=function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]},e.prototype.shortRuleNameToFullName=function(e){return this.shortRuleNameToFull[e]},e.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),De)},e.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.LAST_EXPLICIT_RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},e}(),Mr=function(){function e(){}return e.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=Object(i["k"])(e.errorMessageProvider,Xr.errorMessageProvider)},e.prototype.SAVE_ERROR=function(e){if(nr(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Object(i["g"])(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(e.prototype,"errors",{get:function(){return Object(i["g"])(this._errors)},set:function(e){this._errors=e},enumerable:!0,configurable:!0}),e.prototype.raiseEarlyExitException=function(e,t,n){for(var r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],o=dn(e,i,t,this.maxLookahead),s=o[0],a=[],l=1;l<=this.maxLookahead;l++)a.push(this.LA(l));var c=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:s,actual:a,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new sr(c,this.LA(1),this.LA(0)))},e.prototype.raiseNoAltException=function(e,t){for(var n=this.getCurrRuleFullName(),r=this.getGAstProductions()[n],i=un(e,r,this.maxLookahead),o=[],s=1;s<=this.maxLookahead;s++)o.push(this.LA(s));var a=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:i,actual:o,previous:a,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new ir(l,this.LA(1),a))},e}(),xr=function(){function e(){}return e.prototype.initContentAssist=function(){},e.prototype.computeContentAssist=function(e,t){var n=this.gastProductionsCache[e];if(Object(i["F"])(n))throw Error("Rule ->"+e+"<- does not exist in this grammar.");return $t([n],t,this.tokenMatcher,this.maxLookahead)},e.prototype.getNextPossibleTokenTypes=function(e){var t=Object(i["s"])(e.ruleStack),n=this.getGAstProductions(),r=n[t],o=new Bt(r,e).startWalking();return o},e}(),_r={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(_r);var Lr=!0,Pr=Math.pow(2,Ct)-1,kr=je({name:"RECORDING_PHASE_TOKEN",pattern:Se.NA});ce([kr]);var jr=Fe(kr,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(jr);var Hr={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",children:{}},Dr=function(){function e(){}return e.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},e.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",(function(){for(var t=function(t){var n=t>0?t:"";e["CONSUME"+n]=function(e,n){return this.consumeInternalRecord(e,t,n)},e["SUBRULE"+n]=function(e,n){return this.subruleInternalRecord(e,t,n)},e["OPTION"+n]=function(e){return this.optionInternalRecord(e,t)},e["OR"+n]=function(e){return this.orInternalRecord(e,t)},e["MANY"+n]=function(e){this.manyInternalRecord(t,e)},e["MANY_SEP"+n]=function(e){this.manySepFirstInternalRecord(t,e)},e["AT_LEAST_ONE"+n]=function(e){this.atLeastOneInternalRecord(t,e)},e["AT_LEAST_ONE_SEP"+n]=function(e){this.atLeastOneSepFirstInternalRecord(t,e)}},n=0;n<10;n++)t(n);e["consume"]=function(e,t,n){return this.consumeInternalRecord(t,e,n)},e["subrule"]=function(e,t,n){return this.subruleInternalRecord(t,e,n)},e["option"]=function(e,t){return this.optionInternalRecord(t,e)},e["or"]=function(e,t){return this.orInternalRecord(t,e)},e["many"]=function(e,t){this.manyInternalRecord(e,t)},e["atLeastOne"]=function(e,t){this.atLeastOneInternalRecord(e,t)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD}))},e.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",(function(){for(var t=0;t<10;t++){var n=t>0?t:"";delete e["CONSUME"+n],delete e["SUBRULE"+n],delete e["OPTION"+n],delete e["OR"+n],delete e["MANY"+n],delete e["MANY_SEP"+n],delete e["AT_LEAST_ONE"+n],delete e["AT_LEAST_ONE_SEP"+n]}delete e["consume"],delete e["subrule"],delete e["option"],delete e["or"],delete e["many"],delete e["atLeastOne"],delete e.ACTION,delete e.BACKTRACK,delete e.LA}))},e.prototype.ACTION_RECORD=function(e){},e.prototype.BACKTRACK_RECORD=function(e,t){return function(){return!0}},e.prototype.LA_RECORD=function(e){return zr},e.prototype.topLevelRuleRecord=function(e,t){try{var n=new Ge({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(r){if(!0!==r.KNOWN_RECORDER_ERROR)try{r.message=r.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording'}catch(i){throw r}throw r}},e.prototype.optionInternalRecord=function(e,t){return Fr.call(this,Ye,e,t)},e.prototype.atLeastOneInternalRecord=function(e,t){Fr.call(this,Xe,t,e)},e.prototype.atLeastOneSepFirstInternalRecord=function(e,t){Fr.call(this,Ke,t,e,Lr)},e.prototype.manyInternalRecord=function(e,t){Fr.call(this,$e,t,e)},e.prototype.manySepFirstInternalRecord=function(e,t){Fr.call(this,qe,t,e,Lr)},e.prototype.orInternalRecord=function(e,t){return Ur.call(this,e,t)},e.prototype.subruleInternalRecord=function(e,t,n){if(Br(t),!e||!1===Object(i["w"])(e,"ruleName")){var r=new Error("<SUBRULE"+Vr(t)+"> argument is invalid expecting a Parser method reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw r.KNOWN_RECORDER_ERROR=!0,r}var o=Object(i["M"])(this.recordingProdStack),s=e["ruleName"],a=new We({idx:t,nonTerminalName:s,referencedRule:void 0});return o.definition.push(a),this.outputCst?Hr:_r},e.prototype.consumeInternalRecord=function(e,t,n){if(Br(t),!ge(e)){var r=new Error("<CONSUME"+Vr(t)+"> argument is invalid expecting a TokenType reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw r.KNOWN_RECORDER_ERROR=!0,r}var o=Object(i["M"])(this.recordingProdStack),s=new Ze({idx:t,terminalType:e});return o.definition.push(s),jr},e}();function Fr(e,t,n,r){void 0===r&&(r=!1),Br(n);var o=Object(i["M"])(this.recordingProdStack),s=Object(i["B"])(t)?t:t.DEF,a=new e({definition:[],idx:n});return Object(i["w"])(t,"NAME")&&(a.name=t.NAME),r&&(a.separator=t.SEP),Object(i["w"])(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(a),s.call(this),o.definition.push(a),this.recordingProdStack.pop(),_r}function Ur(e,t){var n=this;Br(t);var r=Object(i["M"])(this.recordingProdStack),o=!1===Object(i["y"])(e),s=!1===o?e:e.DEF,a=new Qe({definition:[],idx:t,ignoreAmbiguities:o&&!0===e.IGNORE_AMBIGUITIES});Object(i["w"])(e,"NAME")&&(a.name=e.NAME),Object(i["w"])(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD);var l=Object(i["Q"])(s,(function(e){return Object(i["B"])(e.GATE)}));return a.hasPredicates=l,r.definition.push(a),Object(i["u"])(s,(function(e){var t=new ze({definition:[]});a.definition.push(t),Object(i["w"])(e,"NAME")&&(t.name=e.NAME),Object(i["w"])(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Object(i["w"])(e,"GATE")&&(t.ignoreAmbiguities=!0),n.recordingProdStack.push(t),e.ALT.call(n),n.recordingProdStack.pop()})),_r}function Vr(e){return 0===e?"":""+e}function Br(e){if(e<0||e>Pr){var t=new Error("Invalid DSL Method idx value: <"+e+">\n\tIdx value must be a none negative value smaller than "+(Pr+1));throw t.KNOWN_RECORDER_ERROR=!0,t}}var Wr=function(){function e(){}return e.prototype.initPerformanceTracer=function(e){if(Object(i["w"])(e,"traceInitPerf")){var t=e.traceInitPerf,n="number"===typeof t;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Xr.traceInitPerf;this.traceInitIndent=-1},e.prototype.TRACE_INIT=function(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;var n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(n+"--\x3e <"+e+">");var r=Object(i["R"])(t),o=r.time,s=r.value,a=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(n+"<-- <"+e+"> time: "+o+"ms"),this.traceInitIndent--,s}return t()},e}(),Gr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zr=Fe(De,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(zr);var Yr,Xr=Object.freeze({recoveryEnabled:!1,maxLookahead:4,ignoredIssues:{},dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Bn,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Kr=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0});function $r(e){return void 0===e&&(e=void 0),function(){return e}}(function(e){e[e["INVALID_RULE_NAME"]=0]="INVALID_RULE_NAME",e[e["DUPLICATE_RULE_NAME"]=1]="DUPLICATE_RULE_NAME",e[e["INVALID_RULE_OVERRIDE"]=2]="INVALID_RULE_OVERRIDE",e[e["DUPLICATE_PRODUCTIONS"]=3]="DUPLICATE_PRODUCTIONS",e[e["UNRESOLVED_SUBRULE_REF"]=4]="UNRESOLVED_SUBRULE_REF",e[e["LEFT_RECURSION"]=5]="LEFT_RECURSION",e[e["NONE_LAST_EMPTY_ALT"]=6]="NONE_LAST_EMPTY_ALT",e[e["AMBIGUOUS_ALTS"]=7]="AMBIGUOUS_ALTS",e[e["CONFLICT_TOKENS_RULES_NAMESPACE"]=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e["INVALID_TOKEN_NAME"]=9]="INVALID_TOKEN_NAME",e[e["INVALID_NESTED_RULE_NAME"]=10]="INVALID_NESTED_RULE_NAME",e[e["DUPLICATE_NESTED_NAME"]=11]="DUPLICATE_NESTED_NAME",e[e["NO_NON_EMPTY_LOOKAHEAD"]=12]="NO_NON_EMPTY_LOOKAHEAD",e[e["AMBIGUOUS_PREFIX_ALTS"]=13]="AMBIGUOUS_PREFIX_ALTS",e[e["TOO_MANY_ALTS"]=14]="TOO_MANY_ALTS"})(Yr||(Yr={}));var qr=function(){function e(e,t){void 0===t&&(t=Xr),this.ignoredIssues=Xr.ignoredIssues,this.definitionErrors=[],this.selfAnalysisDone=!1;var n=this;n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initContentAssist(),n.initGastRecorder(t),n.initPerformanceTracer(t),Object(i["w"])(t,"ignoredIssues")&&t.ignoredIssues!==Xr.ignoredIssues&&Object(i["d"])("The <ignoredIssues> IParserConfig property is soft-deprecated and will be removed in future versions.\n\tPlease use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead."),this.ignoredIssues=Object(i["w"])(t,"ignoredIssues")?t.ignoredIssues:Xr.ignoredIssues,this.skipValidations=Object(i["w"])(t,"skipValidations")?t.skipValidations:Xr.skipValidations}return e.performSelfAnalysis=function(e){e.performSelfAnalysis()},e.prototype.performSelfAnalysis=function(){var t=this;this.TRACE_INIT("performSelfAnalysis",(function(){var n;t.selfAnalysisDone=!0;var r=t.className;t.TRACE_INIT("toFastProps",(function(){Object(i["S"])(t)})),t.TRACE_INIT("Grammar Recording",(function(){try{t.enableRecording(),Object(i["u"])(t.definedRulesNames,(function(e){var n=t[e],r=n["originalGrammarAction"],i=void 0;t.TRACE_INIT(e+" Rule",(function(){i=t.topLevelRuleRecord(e,r)})),t.gastProductionsCache[e]=i}))}finally{t.disableRecording()}}));var o=[];if(t.TRACE_INIT("Grammar Resolving",(function(){o=Kn({rules:Object(i["U"])(t.gastProductionsCache)}),t.definitionErrors.push.apply(t.definitionErrors,o)})),t.TRACE_INIT("Grammar Validations",(function(){if(Object(i["A"])(o)&&!1===t.skipValidations){var e=$n({rules:Object(i["U"])(t.gastProductionsCache),maxLookahead:t.maxLookahead,tokenTypes:Object(i["U"])(t.tokensMap),ignoredIssues:t.ignoredIssues,errMsgProvider:Gn,grammarName:r});t.definitionErrors.push.apply(t.definitionErrors,e)}})),Object(i["A"])(t.definitionErrors)&&(t.recoveryEnabled&&t.TRACE_INIT("computeAllProdsFollows",(function(){var e=bt(Object(i["U"])(t.gastProductionsCache));t.resyncFollows=e})),t.TRACE_INIT("ComputeLookaheadFunctions",(function(){t.preComputeLookaheadFunctions(Object(i["U"])(t.gastProductionsCache))}))),t.TRACE_INIT("expandAllNestedRuleNames",(function(){var e=Ft(Object(i["U"])(t.gastProductionsCache),t.fullRuleNameToShort);t.allRuleNames=e.allRuleNames})),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!Object(i["A"])(t.definitionErrors))throw n=Object(i["I"])(t.definitionErrors,(function(e){return e.message})),new Error("Parser Definition Errors detected:\n "+n.join("\n-------------------------------\n"))}))},e.DEFER_DEFINITION_ERRORS_HANDLING=!1,e}();Object(i["e"])(qr,[hr,dr,Or,Nr,Ir,Ar,Mr,xr,Dr,Wr]);var Qr=function(e){function t(t,n){void 0===n&&(n=Xr);var r=this,o=Object(i["h"])(n);return o.outputCst=!0,r=e.call(this,t,o)||this,r}return Gr(t,e),t}(qr),Zr=function(e){function t(t,n){void 0===n&&(n=Xr);var r=this,o=Object(i["h"])(n);return o.outputCst=!1,r=e.call(this,t,o)||this,r}return Gr(t,e),t}(qr);function Jr(e,t){var n=void 0===t?{}:t,i=n.resourceBase,o=void 0===i?"https://unpkg.com/chevrotain@"+r+"/diagrams/":i,s=n.css,a=void 0===s?"https://unpkg.com/chevrotain@"+r+"/diagrams/diagrams.css":s,l='\n\x3c!-- This is a generated file --\x3e\n<!DOCTYPE html>\n<meta charset="utf-8">\n<style>\n body {\n background-color: hsl(30, 20%, 95%)\n }\n</style>\n\n',c="\n<link rel='stylesheet' href='"+a+"'>\n",h="\n<script src='"+o+"vendor/railroad-diagrams.js'><\/script>\n<script src='"+o+"src/diagrams_builder.js'><\/script>\n<script src='"+o+"src/diagrams_behavior.js'><\/script>\n<script src='"+o+"src/main.js'><\/script>\n",u='\n<div id="diagrams" align="center"></div> \n',d="\n<script>\n window.serializedGrammar = "+JSON.stringify(e,null," ")+";\n<\/script>\n",p='\n<script>\n var diagramsDiv = document.getElementById("diagrams");\n main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);\n<\/script>\n';return l+c+h+u+d+p}var ei="\n";function ti(e){return"\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['chevrotain'], factory);\n } else if (typeof module === 'object' && module.exports) {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory(require('chevrotain'));\n } else {\n // Browser globals (root is window)\n root.returnExports = factory(root.b);\n }\n}(typeof self !== 'undefined' ? self : this, function (chevrotain) {\n\n"+ri(e)+"\n \nreturn {\n "+e.name+": "+e.name+" \n}\n}));\n"}function ni(e){return" \n"+ri(e)+"\nreturn new "+e.name+"(tokenVocabulary, config) \n"}function ri(e){var t="\nfunction "+e.name+"(tokenVocabulary, config) {\n // invoke super constructor\n // No support for embedded actions currently, so we can 'hardcode'\n // The use of CstParser.\n chevrotain.CstParser.call(this, tokenVocabulary, config)\n\n const $ = this\n\n "+ii(e.rules)+"\n\n // very important to call this after all the rules have been defined.\n // otherwise the parser may not work correctly as it will lack information\n // derived during the self analysis phase.\n this.performSelfAnalysis(this)\n}\n\n// inheritance as implemented in javascript in the previous decade... :(\n"+e.name+".prototype = Object.create(chevrotain.CstParser.prototype)\n"+e.name+".prototype.constructor = "+e.name+" \n ";return t}function ii(e){var t=Object(i["I"])(e,(function(e){return oi(e,1)}));return t.join("\n")}function oi(e,t){var n=fi(t,'$.RULE("'+e.name+'", function() {')+ei;return n+=pi(e.definition,t+1),n+=fi(t+1,"})")+ei,n}function si(e,t){var n=e.terminalType.name;return fi(t,"$.CONSUME"+e.idx+"(this.tokensMap."+n+")"+ei)}function ai(e,t){return fi(t,"$.SUBRULE"+e.idx+"($."+e.nonTerminalName+")"+ei)}function li(e,t){var n=fi(t,"$.OR"+e.idx+"([")+ei,r=Object(i["I"])(e.definition,(function(e){return ci(e,t+1)}));return n+=r.join(","+ei),n+=ei+fi(t,"])"+ei),n}function ci(e,t){var n=fi(t,"{")+ei;return e.name&&(n+=fi(t+1,'NAME: "'+e.name+'",')+ei),n+=fi(t+1,"ALT: function() {")+ei,n+=pi(e.definition,t+1),n+=fi(t+1,"}")+ei,n+=fi(t,"}"),n}function hi(e,t){if(e instanceof We)return ai(e,t);if(e instanceof Ye)return ui("OPTION",e,t);if(e instanceof Xe)return ui("AT_LEAST_ONE",e,t);if(e instanceof Ke)return ui("AT_LEAST_ONE_SEP",e,t);if(e instanceof qe)return ui("MANY_SEP",e,t);if(e instanceof $e)return ui("MANY",e,t);if(e instanceof Qe)return li(e,t);if(e instanceof Ze)return si(e,t);if(e instanceof ze)return pi(e.definition,t);throw Error("non exhaustive match")}function ui(e,t,n){var r=fi(n,"$."+(e+t.idx)+"(");return t.name||t.separator?(r+="{"+ei,t.name&&(r+=fi(n+1,'NAME: "'+t.name+'"')+","+ei),t.separator&&(r+=fi(n+1,"SEP: this.tokensMap."+t.separator.name)+","+ei),r+="DEF: "+di(t.definition,n+2)+ei,r+=fi(n,"}")+ei):r+=di(t.definition,n+1),r+=fi(n,")")+ei,r}function di(e,t){var n="function() {"+ei;return n+=pi(e,t),n+=fi(t,"}")+ei,n}function pi(e,t){var n="";return Object(i["u"])(e,(function(e){n+=hi(e,t+1)})),n}function fi(e,t){var n=Array(4*e+1).join(" ");return n+t}function gi(e){var t=ni({name:e.name,rules:e.rules}),r=new Function("tokenVocabulary","config","chevrotain",t);return function(t){return r(e.tokenVocabulary,t,n("fa83"))}}function mi(e){return ti({name:e.name,rules:e.rules})}function yi(){console.warn("The clearCache function was 'soft' removed from the Chevrotain API.\n\t It performs no action other than printing this message.\n\t Please avoid using it as it will be completely removed in the future")}},fb46:function(e,t,n){"use strict";var r=n("0227"),i=n("fd18"),o=n("bef1"),s=n("4aa5"),a=n("088f"),l=i([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=o.f(a(e)),n=s.f;return n?l(t,n(e)):t}},fc2d:function(e,t,n){"use strict";var r=n("bf78"),i=Object;e.exports=function(e){return i(r(e))}},fd18:function(e,t,n){"use strict";var r=n("48ab"),i=Function.prototype,o=i.call,s=r&&i.bind.bind(o,o);e.exports=r?s:function(e){return function(){return o.apply(e,arguments)}}},fdba:function(e,t,n){"use strict";var r=n("d128"),i=n("2b75"),o=n("a60d"),s=n("088f"),a=n("9394"),l=n("c041");t.f=r&&!i?Object.defineProperties:function(e,t){s(e);var n,r=a(t),i=l(t),c=i.length,h=0;while(c>h)o.f(e,n=i[h++],r[n]);return e}},ffec:function(e,t,n){"use strict";function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=typeof e;if("number"===n)return!isNaN(e)&&isFinite(e);if("string"===n){if(0===e.length)return!1;if(1===e.length)return/\d/.test(e);const n=Array.from(new Set([".",...t])).map(e=>"\\"+e).join("|");return new RegExp(`^[+-]?\\s*(((${n})?\\d+((${n})\\d+)?(e[+-]?\\d+)?)|(0x[a-f\\d]+))$`,"i").test(e.trim())}return"object"===n&&(!!e&&"number"===typeof e.valueOf()&&!(e instanceof Date))}function i(e){return r(e,[","])}function o(e,t,n){let r=-1;"function"===typeof t?(n=t,t=e):r=e-1;while(++r<=t)if(!1===n(r))break}function s(e,t,n){let r=e+1;"function"===typeof t&&(n=t,t=0);while(--r>=t)if(!1===n(r))break}function a(e,t){return t=parseInt(t.toString().replace("%",""),10),t=isNaN(t)?0:t,parseInt(e*t/100,10)}function l(e,t,n){return Math.min(e,t)===e?t:Math.max(e,n)===e?n:e}n.r(t),n.d(t,"isNumeric",(function(){return r})),n.d(t,"isNumericLike",(function(){return i})),n.d(t,"rangeEach",(function(){return o})),n.d(t,"rangeEachReverse",(function(){return s})),n.d(t,"valueAccordingPercent",(function(){return a})),n.d(t,"clamp",(function(){return l}))}}]);
|