@refinitiv-ui/efx-grid 6.0.82 → 6.0.84

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- (()=>{"use strict";var t,e,i={};i.isIE=(t=window.navigator.userAgent).indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0,i.isTouchDevice=!!(navigator.maxTouchPoints&&navigator.maxTouchPoints<256||navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints<256),i.isSafari=(e=navigator.userAgent,!/Chrome|Android|CriOS|FxiOS|EdgiOS/i.test(e)&&/Safari/i.test(e)),i.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),i.getElement=function(t){return i.isElement(t)?t:t&&i.isFunction(t.getElement)?t.getElement():null},i.isElement=function(t){return!!t&&1===t.nodeType},i.isEmpty=function(t,e){return null==t||void 0===t||!e&&""===t||i.isArray(t)&&0===t.length},i.isNumber=function(t){return"number"==typeof t&&isFinite(t)},i.isString=function(t){return"string"==typeof t},i.isArray=Array.isArray,i.isFunction=function(t){return"function"==typeof t},i.getClientPosition=function(t,e){var i=e||{};if(t.getBoundingClientRect){var o=t.getBoundingClientRect();i.x=o.left,i.y=o.top}else i.x=t.clientX,i.y=t.clientY;return i},i.getRelativePosition=function(t,e,o){o=i.getClientPosition(t,o);var n=i.getClientPosition(e);return o.x-=n.x,o.y-=n.y,o},i.moveArrayItem=function(t,e,i){if(!t)return null;var o=t.length;if(e>=o&&i>=o)return t;var n=t.splice(e,1)[0];return i<o?t.splice(i,0,n):t[i]=n,t},i.pushArrayItems=function(t,e){var i=e?e.length:0;if(i>0)if(i<1e5)i>1?Array.prototype.push.apply(t,e):t.push(e[0]);else for(var o=0,n=0;o<i;)n+=1e5,Array.prototype.push.apply(t,e.slice(o,n)),o=n;return t},i.insertEmptyItems=function(t,e,o){if(o>0)if(o>1){var n=t.slice(e);t.length=e,t.length+=o,i.pushArrayItems(t,n)}else t.splice(e,0,null)},i.cycleArray=function(t,e){if(e>0&&t&&e<t.length){var i=t.splice(0,e);return t.concat(i)}return t||null},i.lowerBound=function(t,e,o,n,r){(null==o||o<0)&&(o=0),(null==n||n<0||n>t.length)&&(n=t.length),o>n&&(o=n),null==r&&(r=i._defaultLessComparator);for(var s=0;n>o;)r(t[s=o+n>>1],e)?o=s+1:n=s;return o},i.upperBound=function(t,e,o,n,r){for(var s=i.lowerBound(t,e,o,n,r);t[s]===e;)++s;return s},i.stringFormat=function(t){var e=Array.prototype.slice.call(arguments,1);return t.replace(/{(\d+)}/g,(function(t,i){return null!=e[i]?e[i]:t}))},i._defaultLessComparator=function(t,e){return t<e},i._deprecatedFunction=function(){console.warn("Calling deprecated method")},i.calculatePercent=function(t,e,i){if(!t&&0!==t||!e&&0!==e||!i&&0!==i)return NaN;if(i===t)return 50;var o=(e-t)/(i-t);return o<0?0:o>1?100:100*o},i.closestElement=function(t,e){for(var i=t;i;){if(i.classList&&i.classList.contains(e))return i;i=i.parentNode||i.host}return null},i._preventDefault=function(t){t.preventDefault(),t.stopPropagation()};const o=i;var n=function(t){this.dispatch=this.dispatch.bind(this),this._listeners=[],this.setSender(t)};n.prototype.listen=function(t,e){if(t&&o.isFunction(t)&&this._listeners.indexOf(t)<0)if(null==e)this._listeners.push(t);else{t._priority=e;var i=o.lowerBound(this._listeners,t,0,this._listeners.length,n.listenerComparer);this._listeners.splice(i,0,t)}},n.prototype.unlisten=function(t){if(t){var e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}},n.prototype.unlistenAll=function(){this._listeners.length=0},n.prototype.getListenerCount=function(){return this._listeners.length},n.prototype.hasListener=function(){return this._listeners.length>0},n.prototype.dispatch=function(t){if(this._enabled&&!(this._listeners.length<=0)){this._dispatching&&window.console.log("WARNING: There is an error in one of your binding methods."),this._dispatching=!0,null==t&&(t={}),null!==this._sender&&(t.sender=this._sender),null!==this._extender&&this._extender(t);for(var e=0;e<this._listeners.length;e++)this._listeners[e](t);null!==this._sender&&(t.sender=null),this._dispatching=!1}},n.prototype.isDispatching=function(){return this._dispatching},n.prototype.isEnabled=function(){return this._enabled},n.prototype.enable=function(t){this._enabled=!1!==t},n.prototype.disable=function(t){this._enabled=!1===t},n.prototype.setSender=function(t){this._sender=t||null},n.prototype.setEventArgExtender=function(t){this._extender=null!=t?t:null},n.listenerComparer=function(t,e){return null==e._priority||t._priority>=e._priority},n.prototype._listeners=null,n.prototype._sender=null,n.prototype._extender=null,n.prototype._enabled=!0,n.prototype._dispatching=!1,n._proto=n.prototype;const r=n;var s=function(){};s.prototype._customEvents=null,s.prototype.listen=function(t,e,i){this._customEvents&&this._customEvents[t]&&this._customEvents[t].listen(e,i)},s.prototype.unlisten=function(t,e){this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlisten(e)},s.prototype.unlistenAll=function(t){if(t)this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(var e in this._customEvents)this._customEvents[e].unlistenAll()},s.prototype._addEvent=function(t){t&&(this._customEvents||(this._customEvents={}),this._customEvents[t]||(this._customEvents[t]=new r(this)))},s.prototype._addEvents=function(t){for(var e=Array.isArray(t)?t:arguments,i=e.length,o=0;o<i;++o)this._addEvent(e[o])},s.prototype._isEventDispatching=function(t){var e=this._customEvents[t];return!!e&&e.isDispatching()},s.prototype._disableEvent=function(t,e){var i=this._customEvents[t];i&&i.disable(e)},s.prototype._hasListener=function(t){return!(!this._customEvents||!this._customEvents[t])&&this._customEvents[t].hasListener()},s.prototype._dispatch=function(t,e){this._customEvents[t].dispatch(e)},s._proto=s.prototype;const l=s;var a={_isElfv3:!1,setElfv3:function(){a._isElfv3=!0},isElfv3:function(){return a._isElfv3},createIcon:function(t){var e;return a._isElfv3?(e=document.createElement("ef-icon")).setAttribute("icon",t):(e=document.createElement("span")).classList.add("icon-"+t),e},createIconButton:function(t){var e;return a._isElfv3?(e=document.createElement("ef-button")).setAttribute("icon",t):(e=document.createElement("button")).classList.add("icon-"+t),e},createRangeBar:function(){var t,e=document.createElement("div");return a._isElfv3?(e.className="tr-range-bar-wrapper",(t=document.createElement("ef-led-gauge")).setAttribute("neutral-color",""),t.setAttribute("top-value","0.00")):(e.className="tr-range-bar-scale",(t=document.createElement("div")).className="tr-range-bar-slider"),t.classList.add("tr-range-slider"),e.appendChild(t),e._calculateScaleParams=function(t,e,i){var n,r=null;return t===i?{sliderValue:n=e===i?0:e>i?100:-100,rangeValue:"[-100,100]"}:t===e?{sliderValue:-100,rangeValue:r}:e===i?{sliderValue:100,rangeValue:r}:t>i?(e>t?(n=-100,r="[-100,"+(2*o.calculatePercent(i,e-t,t)-100)+"]"):e<i?(n=100,r="["+(2*o.calculatePercent(i,t-e,t)-100)+",100]"):n=2*o.calculatePercent(i,e,t)-100,{sliderValue:n,rangeValue:r}):e>i?{sliderValue:100,rangeValue:"["+(2*o.calculatePercent(t,2*i-e,i)-100)+",100]"}:e<t?{sliderValue:-100,rangeValue:"[-100,"+(2*o.calculatePercent(t,2*t-e,i)-100)+"]"}:{sliderValue:2*o.calculatePercent(t,e,i)-100,rangeValue:r}},e._getSliderInstance=function(){return t},e.updateScale=function(t,i,o,n){var r,s=e._getSliderInstance();a._isElfv3?(r=e._calculateScaleParams(i,o,n),s.setAttribute("top-value",r.sliderValue.toString()),r.rangeValue?s.setAttribute("range",r.rangeValue):s.removeAttribute("range")):s.style.left=t+"%"},e.setSliderWidth=function(t){var i=t>0?t:1;a._isElfv3||(e.style.width="calc(100% - "+i+"px)",e._getSliderInstance().style.width=i+"px")},e}};const h=a;const u={inherits:function(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.base=function(t,i,o){i||(i="constructor");for(var n=arguments.length,r=new Array(n),s=2;s<n;s++)r[s-2]=arguments[s];return e.prototype[i].apply(t,r)}}};var p=function(t){this._element=t||document.createElement("div")};u.inherits(p,l),p.prototype._element=null,p.prototype._content=null,p.prototype._textSpan=null,p.prototype._nativeEvents=null,p._passiveEvents=null,p.prototype.getContent=function(t){return t?this._element.children:this._element.lastChild},p.prototype.setContent=function(t,e){if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?(o.isString(t)||(t+=""),null==this._textSpan&&(this._textSpan=document.createElement("span")),this._textSpan.textContent=t,t=this._textSpan):t=t.getElement()),t!==this._content){for(this._content=t;null!==this._element.firstChild;)this._element.removeChild(this._element.firstChild);null!==this._content&&this._element.appendChild(this._content)}return e&&t&&t.setAttribute("title",e),this._content},p.prototype.addContent=function(t){return null==(t=o.getElement(t))?null:(this._content=this._element.children,this._element.appendChild(t),t)},p.prototype.removeContent=function(t){return null!=(t=o.getElement(t))&&(this._content=this._element.children,this._element.removeChild(t),!0)},p.prototype.listen=function(t,e,i){if(this._customEvents&&this._customEvents[t])this._customEvents[t].listen(e,i);else{this._nativeEvents||(this._nativeEvents={});var o=this._nativeEvents[t];if(!o){if(o=new r,this._nativeEvents[t]=o,o.dispatch=o.dispatch.bind(o),!p._passiveEvents){var n=!1;try{var s=Object.defineProperty({},"passive",{get:function(){return n=!0,!1}});window.addEventListener("testPassive",null,s),window.removeEventListener("testPassive",null,s)}catch(t){}if(n){var l={passive:!0};p._passiveEvents={touchstart:l,touchmove:l}}else p._passiveEvents={}}this._element.addEventListener(t,o.dispatch,p._passiveEvents[t]||!1)}o.listen(e,i)}},p.prototype.unlisten=function(t,e){if(this._customEvents&&this._customEvents[t])this._customEvents[t].unlisten(e);else if(this._nativeEvents){var i=this._nativeEvents[t];i&&i.unlisten(e)}},p.prototype.unlistenAll=function(t){if(this._customEvents)if(t)this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(var e in this._customEvents)this._customEvents[e].unlistenAll();if(this._nativeEvents)if(t)this._nativeEvents[t]&&(this._unlistenAll(t),delete this._nativeEvents[t]);else{for(var i in this._nativeEvents)this._unlistenAll(i);this._nativeEvents=null}},p.prototype._unlistenAll=function(t){var e=this._nativeEvents[t];this._element.removeEventListener(t,e.dispatch,!1),e.unlistenAll()},p.prototype.dispose=function(){this._dispose()},p.prototype._dispose=function(){this.setParent(null),this.unlistenAll(),this._element=this._content=this._textSpan=null,this._customEvents=this._nativeEvents=null},p.prototype.setEventArgExtender=function(t,e){if(this._customEvents){var i=this._customEvents[t];i&&i.setEventArgExtender(e)}},p.prototype.getElement=function(){return this._element},p.prototype.getNextSibling=function(){return this._element.nextSibling},p.prototype.getParent=function(){return this._element.parentNode},p.prototype.setParent=function(t,e){this._setParent(t,e)},p.prototype._setParent=function(t,e){null!==(t=o.getElement(t))?e?t.insertBefore(this._element,t.firstChild):t.appendChild(this._element):null!==this._element.parentNode&&this._element.parentNode.removeChild(this._element)},p.prototype.insertBefore=function(t){this._insertBefore(t)},p.prototype._insertBefore=function(t){if(null!=(t=o.getElement(t))){var e=t.parentNode;null!=e&&e.insertBefore(this._element,t)}else this.setParent(this.getParent())},p.prototype.insertAfter=function(t){(t=o.getElement(t))?t.nextSibling?this.insertBefore(t.nextSibling):this.setParent(t.parentNode):this.setParent(this.getParent(),!0)},p.prototype.hasClass=function(t){return!!this._element&&this._element.classList.contains(t)},p.prototype.addClass=function(t){this._element&&this._element.classList.add(t)},p.prototype.removeClass=function(t){this._element&&this._element.classList.remove(t)},p.prototype.toggleClass=function(t,e){var i=this._element;i&&(null==e&&(e=!i.classList.contains(t)),e?i.classList.add(t):i.classList.remove(t))},p.prototype.enableClass=function(t,e){!1!==e?this.addClass(t):this.removeClass(t)},p.prototype.getClass=function(){return this._element.className},p.prototype.setClass=function(t){this._element.className=t},p.prototype.getAttribute=function(t){return this._element.getAttribute(t)},p.prototype.setAttribute=function(t,e){this._element.setAttribute(t,e)},p.prototype.setAttributes=function(t){for(var e in t)this._element.setAttribute(e,t[e])},p.prototype.removeAttribute=function(t){this._element.removeAttribute(t)},p.prototype.getStyle=function(t){return this._element.style[t]},p.prototype.setStyle=function(t,e){this._element.style[t]=e},p.prototype.setStyles=function(t){var e=this._element.style;for(var i in t)e[i]=t[i]},p.prototype.getId=function(){return this._element.id},p.prototype.setId=function(t){this._element.id=t},p.prototype.toString=function(){var t=this._element.outerHTML;return t.replace(this._element.innerHTML,"")},p.prototype.getTextContent=function(){return this._element.textContent},p.prototype.setTextContent=function(t){this._element.textContent=t},p.prototype.getLeft=function(){return this._element.offsetLeft},p.prototype.setLeft=function(t){return this._element.style.left=t+"px",!0},p.prototype.getTop=function(){return this._element.offsetTop},p.prototype.setTop=function(t){return this._element.style.top=t+"px",!0},p.prototype.getWidth=function(){return this._element.offsetWidth},p.prototype.setWidth=function(t){return this._element.style.width=t+"px",!0},p.prototype.getHeight=function(){return this._element.offsetHeight},p.prototype.setHeight=function(t){return t<0&&(t=0),this._element.style.height=t+"px",!0},p.prototype.getBoundingClientRect=function(){return this._element.getBoundingClientRect()},p.prototype.fillParentWidth=function(t){return null==t&&(t=100),this._element.style.width=t+"%",!0},p.prototype.fillParentHeight=function(t){return null==t&&(t=100),this._element.style.height=t+"%",!0},p.prototype.getTooltip=function(){return this.getAttribute("title")},p.prototype.setTooltip=function(t){t?this.setAttribute("title",t):this.removeAttribute("title")},p.prototype.show=function(t){this._element.style.display=!1!==t?"":"none"},p.prototype.hide=function(t){this.show(!1===t)},p.prototype.isVisible=function(){return"none"!==this._element.style.display},p.prototype.enable=function(t){(t=!1!==t)?this.removeAttribute("disabled"):(this.setAttribute("disabled","disabled"),this._element.disabled=!t)},p.prototype.disable=function(t){this.enable(!1===t)},p.prototype.isEnabled=function(){return!this._element.hasAttribute("disabled")},p.prototype.getScrollLeft=function(){return this._element.scrollLeft},p.prototype.getScrollTop=function(){return this._element.scrollTop},p.prototype.isEndOfHorizontalScroll=function(){return this._element.scrollLeft>=this._element.scrollWidth-this.getWidth()},p.prototype.isEndOfVerticalScroll=function(){return this._element.scrollTop>=this._element.scrollHeight-this.getHeight()},p._proto=p.prototype;const _=p;var c=function(){this._items=[],this._element=null};u.inherits(c,_),c.prototype._items=[],c.prototype.hasItem=function(){return!!this._items.length},c.prototype.containItem=function(t){return this._items.indexOf(t)>-1},c.prototype.insertItem=function(t,e){var i=this._items;i.indexOf(t)>-1||(i.push(t),e&&(t._order=e),i.length&&i.sort(c._iconComparer),this._updatePanelItems())},c.prototype.removeItem=function(t){var e=this._items,i=-1;if(t)for(var o=e.length;--o>=0;){var n=e[o];if("string"==typeof t){if(n.classList.contains(t)){i=o;break}}else if(n===t){i=o;break}}else i=e.length-1;var r=null;return i>-1&&(r=e.splice(i,1)[0]),this._updatePanelItems(),r},c.prototype.clearItems=function(){var t=this._items;t.length&&(t.length=0,this._updatePanelItems())},c._iconComparer=function(t,e){return t._order?e._order?t._order-e._order:1:e._order?-1:0},c.prototype._updatePanelItems=function(){var t=this._items,e=this._element;if(t.length){for(this._element||(e=this._element=document.createElement("div"));e.lastChild;)e.removeChild(e.lastChild);for(var i=0;i<t.length;i++)e.appendChild(t[i])}};const d=c;var g=function(t,e){this._id=g._runningId++,this._element=document.createElement("div"),this._element.className="cell",e&&(this._section=e)};u.inherits(g,_),g.prototype._aligner=null,g._runningId=0,g.prototype._id=0,g.prototype._width=-1,g.prototype._height=-1,g.prototype._visible=!0,g.prototype._rawContent,g.prototype._section=null,g.prototype._contentLocked=!1,g.prototype._collapsedState=0,g.prototype._floatingPanel=null,g.prototype._frontIcon=null,g.prototype.getContent=function(t){return t&&this._element?this._element.children:this._content||null},g.prototype.setContent=function(t,e){if(this._contentLocked)return null;if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?"string"!=typeof t&&(t+=""):t=t.getElement()),this._aligner){var i=this._aligner.firstChild;i!==this._content&&(this._rawContent=i,this._content=i)}var o=this._setRawContent(t);return null!=e&&this._content&&this._content.setAttribute("title",e),o},g.prototype.setTextContent=function(t){null==t&&(t=""),this._rawContent!==t&&("string"==typeof this._rawContent?(this._rawContent=t,this._textSpan.textContent=t):null!=this._rawContent||this._textSpan?this.setContent(t):(this.initialize(),this._rawContent=t,this._textSpan=document.createElement("span"),this._textSpan.className="text",this._textSpan.textContent=t,this._content=this._textSpan,this._aligner.className="valigner",this._aligner.appendChild(this._textSpan)))},g.prototype.dispose=function(){this.removeParent(),this.unlistenAll(),this._element=this._section=this._aligner=null,this._textSpan=this._rawContent=this._content=null,this._frontIcon=this._floatingPanel=null},g.prototype.getNextSibling=function(){return null!==this._element?this._element.nextSibling:null},g.prototype.getParent=function(){return null!==this._element?this._element.parentNode:null},g.prototype.setParent=function(t,e){var i=o.getElement(t);if(i){if(this.initialize(),1===this._collapsedState)return;var n;!0===e&&(n=i.firstChild),n?i.insertBefore(this._element,n):i.appendChild(this._element)}else this.removeParent()},g.prototype.removeParent=function(){var t=this._element;t&&t.parentNode&&t.parentNode.removeChild(t)},g.prototype.insertBefore=function(t){var e=o.getElement(t);if(null!=e){var i=e.parentNode;null!=i&&(this.initialize(),i.insertBefore(this._element,e))}else this.setParent(this.getParent())},g.prototype.getTextContent=function(){return this._rawContent?"string"==typeof this._rawContent?this._rawContent:this._rawContent.textContent:""},g.prototype.getTextElement=function(){return this._textSpan},g.prototype.getWidth=function(){return this._width>=0?this._width:this._element.offsetWidth},g.prototype.setWidth=function(t){return t<0&&(t=-1),this._width!==t&&(this._width=t,this._element.style.width=t>=0?t+"px":"",this._updateDisplay(),!0)},g.prototype.getHeight=function(){return this._height>=0?this._height:this._element.offsetHeight},g.prototype.setHeight=function(t){return t<0&&(t=-1),this._height!==t&&(this._height=t,this._element.style.height=t>=0?t+"px":"",this._updateDisplay(),!0)},g.prototype.fillParentWidth=function(t){return!1},g.prototype.fillParentHeight=function(t){return!1},g.prototype.show=function(t){var e=!1!==t;e!==this._visible&&(this._visible=e,this._updateDisplay())},g.prototype.isVisible=function(){return this._visible},g.prototype.getScrollLeft=function(){return 0},g.prototype.getScrollTop=function(){return 0},g.prototype.isEndOfHorizontalScroll=function(){return!0},g.prototype.isEndOfVerticalScroll=function(){return!0},g.prototype.hasElement=function(){return null!==this._element},g.prototype.getSection=function(){return this._section},g.prototype.initialize=function(){return null==this._aligner&&(o.isIE?this._aligner=document.createElement("div"):this._aligner=document.createElement("button"),this._aligner.className="valigner",this._frontIcon&&this._element.appendChild(this._frontIcon.getElement()),this._element.appendChild(this._aligner),this._floatingPanel&&this._element.appendChild(this._floatingPanel.getElement())),this._element},g.prototype.updateIcon=function(t){if(t){var e=this._frontIcon;if(e){if(e.containItem(t))return;e.clearItems()}this.insertFrontIcon(t,0)}},g.prototype.removeIcon=function(){var t=this._frontIcon;t&&(t.clearItems(),this._element.removeChild(t.getElement()),t=this._frontIcon=null)},g.prototype.isFrozen=o._deprecatedFunction,g.prototype.freezeLayout=o._deprecatedFunction,g.prototype.setAutoContentClipping=o._deprecatedFunction,g.prototype.setContentTooltip=function(t){return!(null==t||!this._content||(this._content.setAttribute("title",t),0))},g.prototype.lockContent=function(t){this._contentLocked=!1!==t},g.prototype.reset=function(){if(this._element){var t=this._element.style.width,e=this._element.style.height;this.removeAttribute("style"),t&&(this._element.style.width=t),e&&(this._element.style.height=e),this.resetClass();var i=this.blinkState;i&&(i.timerId>=0&&clearInterval(i.timerId),delete this.blinkState),delete this.trendState;var o=this.blinking;o&&(o.blinking>=0&&clearTimeout(o.blinking),o.cell=null,o.styles=null,delete this.blinking),this.removeIcon(),this.setContent(null),this._textSpan&&(this._textSpan.className="text",this._textSpan.textContent="")}},g.prototype.resetClass=function(){var t="cell";this.hasClass("spanned")&&(t+=" spanned"),this.hasClass("selected-row")&&(t+=" selected-row"),this.hasClass("highlighted-row")&&(t+=" highlighted-row"),this.setClass(t)},g.prototype.resetToInitialState=function(){this._element&&(this.setParent(null),this.unlistenAll(),this._element.className="cell",this.removeIcon(),this.setContent(null),this._contentLocked=!1,this._collapsedState=0)},g.prototype.insertFloatingIcon=function(t,e){if(t){var i=this._floatingPanel;i||(i=this._floatingPanel=new d),i.insertItem(t,e),i.addClass("floating-panel");var o=this._element;o.contains(i.getElement())||o.appendChild(i.getElement())}},g.prototype.removeFloatingIcon=function(t){var e=this._floatingPanel;if(!e)return null;var i=e.removeItem(t);return e.hasItem()||(this._element.removeChild(e.getElement()),this._floatingPanel=null),i},g.prototype.insertFrontIcon=function(t,e){if(t){var i=this._frontIcon;i||(i=this._frontIcon=new d),i.insertItem(t,e),i.addClass("front-panel");var o=this._element;o.contains(i.getElement())||o.insertBefore(i.getElement(),o.firstChild)}},g.prototype.removeFrontIcon=function(t){var e=this._frontIcon;if(!e)return null;var i=e.removeItem(t);return e.hasItem()||(i=e.getElement(),this._element.removeChild(i),this._frontIcon=null),i},g.prototype.getCellId=function(){return this._id},g.prototype.updatePadding=function(){},g.prototype.collapse=function(t,e){var i,o=!1!==t;return i=o?e?2:1:0,this._collapsedState!==i&&(o?e?this.addClass("spanned"):this.setParent(null):2===this._collapsedState&&this.removeClass("spanned"),this._collapsedState=i,!0)},g.prototype.isCollapsed=function(){return 0!==this._collapsedState},g.prototype.isKeptInDoc=function(){return 1!==this._collapsedState},g.prototype.getClientWidth=function(){return this._element?this._element.clientWidth:this.getWidth()},g.prototype.getClientHeight=function(){return this._element?this._element.clientHeight:this.getHeight()},g.prototype._setRawContent=function(t){if(this._rawContent!==t){this._rawContent=t;var e=this._rawContent;if("string"==typeof this._rawContent&&(this._textSpan||(this._textSpan=document.createElement("span"),this._textSpan.className="text"),this._textSpan.textContent=this._rawContent,e=this._textSpan),this._content!==e){this._content=e,this.initialize();for(var i=this._aligner;i.lastChild;)i.removeChild(i.lastChild);this._content&&i.appendChild(this._content)}}return this._content},g.prototype._updateDisplay=function(){var t=!1;this.isVisible()&&this._width&&this._height&&(t=!0),this._element.style.display=t?"":"none"},g._proto=g.prototype;const f=g;var y=function(){this._ends=[],this._cols=[]};y.prototype._laneCount=0,y.prototype._defaultSize=10,y.prototype._defaultScalability=!0,y.prototype._homogeneous=!0,y.prototype._visibility=!0,y.prototype._ends,y.prototype._cols,y.prototype._bits=[1,2,4,8],y.prototype.hitTest=function(t){if(t<0)return-1;if(t>=this.getTrackSize())return~this._laneCount;var e=-1,i=0;if(this._homogeneous){var n=this._defaultSize;i=((e=Math.floor(t/n))+1)*n}else e=o.upperBound(this._ends,t),i=this._ends[e];return(e>=this._laneCount||t>=i)&&(e=~e),e},y.prototype.dispose=function(){this._cols=this._ends=null},y.prototype.isAtDefaultSize=function(t){if(this._homogeneous)return!0;if(null!=t){if(!this._isAtDefaultSize(t))return!1}else{for(var e=this._cols.length;--e>=0;)if(!this._isAtDefaultSize(e))return!1;this._homogeneous=!0}return!0},y.prototype._isAtDefaultSize=function(t){var e=this._cols[t];if(e){if(e.actualSize!==this._defaultSize)return!1;if(null!=e.customSize)return!1;if(e.invisibility)return!1}return!0},y.prototype.isHomogeneous=function(){return this._homogeneous},y.prototype.isAtMinimumSize=function(t){var e=this._getMinimumScalingSize(t);return(null!=t?this.getLaneSize(t):this.getTrackSize())<=e},y.prototype.isFixedSize=function(){for(var t=0;t<this._laneCount;++t)if(this.getLaneScalability(t))return!1;return!0},y.prototype.clearLaneCustomizations=function(){this._ends.length=0,this._cols.length=0,this._homogeneous=!0},y.prototype.getLaneCount=function(){return this._laneCount},y.prototype.setLaneCount=function(t){t<0&&(t=0),t!==this._laneCount&&(this._markDirtyIndex(t),this._cols.length=t,this._laneCount=t,0===t&&(this._homogeneous=!0))},y.prototype.getDefaultLaneSize=function(){return this._defaultSize},y.prototype.setDefaultLaneSize=function(t){return t<0&&(t=0),this._defaultSize!==t&&(this._defaultSize=t,this._markDirtyIndex(0),!0)},y.prototype.getLaneDefaultSize=function(t){if(t<0||t>=this._laneCount)return-1;var e=this._newColumn(t);return e.defaultSize?e.defaultSize:-1},y.prototype.setLaneDefaultSize=function(t,e){t<0||t>=this._laneCount||e>=0&&(this._newColumn(t).defaultSize=e)},y.prototype.resetLaneToDefaultSize=function(){for(var t=!1,e=0;e<this._laneCount;++e){var i=this._cols[e];i&&(i.invisibility||(null!=i.defaultSize?(t|=this.setLaneScalability(e,!1),t|=this.setLaneSize(e,i.defaultSize)):(t|=this.setLaneScalability(e,!0),t|=this.setLaneSize(e,1))))}return!!t},y.prototype.getDefaultScalability=function(){return this._defaultScalability},y.prototype.setDefaultScalability=function(t){return this._defaultScalability!==t&&(this._defaultScalability=t,!0)},y.prototype.getTrackSize=function(){return!this._visibility||this._laneCount<=0?0:this._homogeneous?this._laneCount*this._defaultSize:(this._updateEndPoints(),this._ends[this._laneCount-1])},y.prototype.setTrackSize=function(t){var e=0,i=0,o=[];for(e=0;e<this._laneCount;++e){var n=this._cols[e];n?n.invisibility||(!1!==this._getLaneScalability(n)?o.push(e):i+=this._getFixedSize(n)):o.push(e)}if(o.length<=0)return null;var r=this._distributeLaneSize(t-i,o),s=!1,l=[];for(e=r.length;--e>=0;){l[e]=0;var a=r[e];if(null!=a){var h=this.getLaneSize(e);this._newColumn(e),this._setCalculatedLaneSize(e,a)&&(l[e]=a-h,s=!0)}}return s?l:null},y.prototype.getLaneStart=function(t){if(t<=0)return 0;if(this._homogeneous)return t*this._defaultSize;this._updateEndPoints();var e=t-this._laneCount,i=0;return e>0&&(t-=e,i=e*this._defaultSize),this._ends[t-1]+i},y.prototype.getLaneEnd=function(t){return this._laneCount<=0?NaN:(t<0?t=0:t>=this._laneCount&&(t=this._laneCount-1),this._homogeneous?(t+1)*this._defaultSize:(this._updateEndPoints(),this._ends[t]))},y.prototype.getLaneSize=function(t){if(this._visibility){var e=this._cols[t];return e?e.actualSize:this._defaultSize}return 0},y.prototype.getCustomLaneSize=function(t){var e=this._cols[t];return e&&null!=e.customSize?e.customSize:this._defaultSize},y.prototype.setLaneSize=function(t,e){if(t<0||t>=this._laneCount)return!1;if(e<0||e!=e)return!1;var i=this._cols[t];return(null==i||i.customSize!==e)&&((i=this._newColumn(t)).customSize=e,this._setCalculatedLaneSize(t,e))},y.prototype.setLaneProperty=function(t,e,i){if(t<0||t>=this._laneCount)return!1;var o=this._cols[t];return(null==o||o[e]!==i)&&((o=this._newColumn(t))[e]=i,!0)},y.prototype.getLaneProperty=function(t,e){var i=this._cols[t];return i&&null!=i[e]?i[e]:null},y.prototype.getMinimumLaneSize=function(t){var e=this._cols[t];return e&&null!=e.minSize?e.minSize:0},y.prototype.setMinimumLaneSize=function(t,e,i){if(t<0||t>=this._laneCount)return!1;if(e<0&&(e=0),this.getMinimumLaneSize(t)!==e){var o=this._newColumn(t);return o.minSize=e,i&&this.getLaneScalability(t)&&(o.customSize=e),this._setCalculatedLaneSize(t)}return!1},y.prototype.isLaneVisible=function(t){var e=this._cols[t];return!e||!e.invisibility},y.prototype.showLane=function(t,e){return this.hideLane(t,!1===e)},y.prototype.hideLane=function(t,e,i){if(t<0||t>=this._laneCount)return!1;var o=this._newColumn(t),n=!o.invisibility,r=null!=i?this._bits[i]:1;return!1!==e?o.invisibility|=r:o.invisibility&=~r,n!==!o.invisibility&&this._setCalculatedLaneSize(t)},y.prototype.getLaneVisibilityBit=function(t,e){if(t>=0&&t<this._laneCount){var i=this._cols[t];if(i){var o=null!=e?this._bits[e]:1;if(i.invisibility&o)return!1}}return!0},y.prototype.show=function(t){if(t=!1!==t,this._visibility!==t)if(this._visibility=t,t)for(var e=0;e<this._laneCount;++e)this._newColumn(e),this._setCalculatedLaneSize(e);else this._markDirtyIndex(0)},y.prototype.getLaneScalability=function(t){var e=this._cols[t];return e&&null!=e.scalability?e.scalability:this._defaultScalability},y.prototype.setLaneScalability=function(t,e){if(t<0||t>=this._laneCount)return!1;var i=this._cols[t];return!(i&&i.scalability===e||((i=this._newColumn(t)).scalability=e,0))},y.prototype.removeLaneAt=function(t,e){if(null==e&&(e=1),t<0)return null;if(t+e>this._laneCount&&(e=this._laneCount-t),e<1)return null;this._markDirtyIndex(t);var i=this.serializeLane(t);return this._cols.splice(t,e),this._laneCount-=e,i},y.prototype.insertLane=function(t,e){t<0&&(t=0);var i=1;if(o.isNumber(e)){if(e<=0)return;i=e,e=null}if(t>=this._laneCount&&(t=this._laneCount,!e))this.setLaneCount(this._laneCount+i);else if(this._laneCount+=i,this._markDirtyIndex(t),o.insertEmptyItems(this._cols,t,i),e)for(var n=t+i,r=t;r<n;++r)this.deserializeLane(r,e)},y.prototype.moveLane=function(t,e){if(t<0?t=0:t>this._laneCount&&(t=this._laneCount),e<0?e=0:e>this._laneCount&&(e=this._laneCount),t!==e){var i=t<e?t:e;this._markDirtyIndex(i),o.moveArrayItem(this._cols,t,e)}},y.prototype.serializeLane=function(t){if(t<0||t>=this._laneCount)return null;var e={};e.index=t;var i=this._cols[t];return i?(e.size=i.customSize,e.minSize=i.minSize,e.visible=!i.invisibility,e.scalable=i.scalability,e):e},y.prototype.deserializeLane=function(t,e){if(e&&!(t<0||t>=this._laneCount)){var i=e.size;null!=i&&this.setLaneSize(t,i),null!=(i=e.minSize)&&this.setMinimumLaneSize(t,i),null!=(i=e.visible)&&this.showLane(t,i),null!=(i=e.scalable)&&this.setLaneScalability(t,i)}},y.prototype._updateEndPoints=function(){var t=this._ends.length;if(!(t>=this._laneCount)){this._ends.length=this._laneCount;var e=0,i=t>0?this._ends[t-1]:0;for(e=t;e<this._laneCount;++e)i+=this.getLaneSize(e),this._ends[e]=i}},y.prototype._setCalculatedLaneSize=function(t,e){var i=this._cols[t];if(this._visibility&&!i.invisibility){if(null==e&&(e=null!=i.customSize?i.customSize:this._defaultSize),!i.scalability){var o=null!=i.minSize?i.minSize:0;e<o&&(e=o)}}else e=0;return i.actualSize!==e&&(i.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(t),!0)},y.prototype._getMinimumScalingSize=function(t){var e=0;if(null!=t){var i=this._cols[t];if(!i.invisibility&&null!=i.minSize)return!1===this._getLaneScalability(i)&&null!=i.customSize&&i.customSize>i.minSize?i.customSize:i.minSize}else for(var o=this._laneCount;--o>=0;)e+=this._getMinimumScalingSize(o);return e},y.prototype._getFixedSize=function(t){return null!=t.customSize?null!=t.minSize?t.customSize>t.minSize?t.customSize:t.minSize:t.customSize:null!=t.minSize?t.minSize:this._defaultSize},y.prototype._getLaneScalability=function(t){return null==t.scalability?this._defaultScalability:t.scalability},y.prototype._distributeLaneSize=function(t,e){if(e.length<=0)return[];t<0&&(t=0);var i=0,o=0,n=0,r=0,s=[],l=[],a=[];for(i=e.length;--i>=0;)s[n=e[i]]=this.getMinimumLaneSize(n),l[n]=this.getCustomLaneSize(n),o+=l[n];for(var h=!0;h;)for(h=!1,i=e.length;--i>=0;){var u=s[n=e[i]],p=l[n];(r=t*p/o)<=u&&(h=!0,a[n]=u,t-=u,o-=p,e.splice(i,1))}var _=e.length-1,c=0,d=0;for(i=_;--i>=0;){r=t*l[n=e[i]]/o;var g=Math.floor(r);(d+=r-g)>=1&&(++g,--d),a[n]=g,c+=g}return a[e[_]]=Math.floor(t-c),a},y.prototype._markDirtyIndex=function(t){t<this._ends.length&&(this._ends.length=t)},y.prototype._newColumn=function(t){var e=this._cols[t];return e||(this._cols[t]=e={},e.invisibility=0),e},y.prototype.copyFrom=function(t,e){if(!this._homogeneous||!t._homogeneous||this._defaultSize!==t._defaultSize){e||(e=0);var i=t.getLaneCount(),o=this.getLaneCount(),n=e+i;n>o&&(n=o);for(var r=0,s=e;s<n;++s){var l=t.getLaneSize(r++),a=this._newColumn(s);a.customSize!==l&&(a.customSize=l,a.actualSize!==l&&(a.actualSize=l,this._homogeneous=!1,this._markDirtyIndex(s)))}}};const m=y;var v=function(){};v.prototype.hitTest=function(t,e,i){},v.prototype.hitTestX=function(t){},v.prototype.hitTestY=function(t){},v.prototype.getDefaultColumnWidth=function(){},v.prototype.setDefaultColumnWidth=function(t){},v.prototype.getDefaultRowHeight=function(){},v.prototype.setDefaultRowHeight=function(t){},v.prototype.getColumnWidth=function(t){},v.prototype.setColumnWidth=function(t,e){},v.prototype.getRowHeight=function(t){},v.prototype.setRowHeight=function(t,e){},v.prototype.isColumnVisible=function(t){},v.prototype.hideColumn=function(t,e){},v.prototype.isRowVisible=function(t){},v.prototype.hideRow=function(t,e){},v.prototype.getMinimumColumnWidth=function(t){},v.prototype.setMinimumColumnWidth=function(t,e){},v.prototype.getMinimumRowHeight=function(t){},v.prototype.setMinimumRowHeight=function(t,e){},v.prototype.getCellLeft=function(t){},v.prototype.getCellTop=function(t){},v.prototype.getCellWidth=function(t,e){},v.prototype.getCellHeight=function(t,e){},v.prototype.hasCellSpan=function(){},v.prototype.getCellRowSpan=function(t,e){},v.prototype.setCellRowSpan=function(t,e,i){},v.prototype.getCellColSpan=function(t,e){},v.prototype.setCellColSpan=function(t,e,i){},v.prototype.clearCellSpans=function(){},v.prototype.clearColumnSpans=function(t){},v.prototype.clearColumnCustomizations=function(){},v.prototype.clearRowCustomizations=function(){},v.prototype.getColumnScalability=function(t){},v.prototype.setColumnScalability=function(t,e){},v.prototype.getRowScalability=function(t){},v.prototype.setRowScalability=function(t,e){},v.prototype.getCell=function(t,e,i){},v.prototype.getCellContent=function(t,e){},v.prototype.setCellContent=function(t,e,i){},v.prototype.getColumn=function(t){},v.prototype.getColumnCount=function(){},v.prototype.setColumnCount=function(t){},v.prototype.getRowCount=function(){},v.prototype.setRowCount=function(t,e){},v.prototype.getVisibleRowCount=function(){},v.prototype.addRow=function(t){},v.prototype.removeRow=function(t){},v.prototype.setBorders=function(t,e,i,o){},v.prototype.getColumnStyle=function(t,e){},v.prototype.setColumnStyle=function(t,e,i){},v.prototype.enableColumnClass=function(t,e,i){},v.prototype.hasColumnClass=function(t,e){},v.prototype.enableRowClass=function(t,e,i){},v.prototype.setRowStyle=function(t,e,i,o){},v.prototype.getRelativePosition=function(t){},v.prototype.getContentWidth=function(){},v.prototype.getContentHeight=function(){},v.prototype.getCellsByRowIndex=function(t){},v.prototype.disableHorizontalGridLine=function(t){},v.prototype.disableVerticalGridLine=function(t){},v.prototype.enableShading=function(t){},v.prototype.setTransposedShading=function(t){},v.prototype.enableRowHighlighting=function(t){},v.prototype.getRowHighlight=function(){},v.prototype.setRowHighlight=function(t){},v.prototype.getSelectedRows=function(){},v.prototype.getSelectedRowCount=function(){},v.prototype.isSelectedRow=function(t){},v.prototype.getRowAnchor=function(){},v.prototype.setRowAnchor=function(t){},v.prototype.setSelectedRow=function(t,e){},v.prototype.selectSingleRow=function(t){},v.prototype.selectRowRange=function(t,e){},v.prototype.clearSelectedRows=function(){},v.prototype.getFirstSelectedRow=function(){},v.prototype.getLastSelectedRow=function(){},v.prototype.activateColumn=function(t,e){},v.prototype.activateRows=function(t,e,i){},v.prototype.moveRowsToTop=function(t){},v.prototype.getFirstIndexInView=function(){},v.prototype.getLastIndexInView=function(){},v.prototype.isInCurrentView=function(t){},v.prototype.getFrozenLayout=function(){},v.prototype.setFrozenLayout=function(t){},v.prototype.insertColumn=function(t,e){},v.prototype.removeColumnAt=function(t){},v.prototype.moveColumn=function(t,e){},v.prototype.enableRowVirtualization=function(t){},v.prototype.enableColumnVirtualization=function(t){},v.prototype.getColumnIndex=function(t){},v.prototype.getCellIndex=function(t,e){},v.prototype.getIndex=function(){},v.prototype.setIndex=function(t){},v.prototype.getRowOffset=function(){},v.prototype.setRowOffset=function(t){},v.prototype.updateLayout=function(){},v.prototype.stretchCell=function(t,e,i,o){},v.prototype.unstretchCell=function(t,e){},v.prototype.unstretchAllCells=function(){},v.prototype.getStretchedCell=function(t,e){},v.prototype.getStretchedCells=function(){},v.prototype.updateStretchedCells=function(){},v.prototype.getColumnHost=function(){},v.prototype.setHidingMethod=function(t){},v.prototype.getHidingMethod=function(){},v.prototype.setColumnVisibility=function(t,e,i){},v.prototype.getRowLayout=function(){},v.prototype.reserveRightSpace=function(t){},v.prototype.getReservedSpace=function(){},v.prototype.getComputedStyle=function(){},v.prototype.isColumnActive=function(t){},v.prototype.setRowAttributes=function(t,e){},v.prototype.getContextRow=function(t){},v.prototype.selectColumn=function(t,e){},v.prototype.isSelectedColumn=function(t){},v.prototype.selectCell=function(t,e,i){},v.prototype.setCellBounds=function(t,e,i,o){},v.prototype.getHorizontalLayout=function(){},v.prototype.calculateColumnBounds=function(t,e,i,o){},v.prototype.updateColumnBounds=function(t,e,i){},v.prototype.updateColumnSeparators=function(){};const C=v;var S=function(t){(this._element=document.createElement("div")).className="column",this._cells=[],this._section=t};u.inherits(S,_),S.prototype._nextSibling=null,S.prototype._parent=null,S.prototype._section=null,S.prototype._cells=null,S.prototype._cellStart=0,S.prototype._cellEnd=0,S.prototype._autoStyleUpdating=!1,S.prototype._deactivation=!1,S.prototype._sizeClasses=null,S.prototype._colLeft=0,S.prototype._absolute=!1,S.prototype._scrollFrame=null,S.prototype._invisibility=0,S.prototype._bits=[1,2,4,8],S.prototype._pinned=!0,S.prototype.clearContent=function(){for(var t=this._cells.length;--t>=0;)this._cells[t].setContent(null)},S.prototype.setLeft=function(t){return this._colLeft=t,this._absolute&&(this._element.style.left=t+"px"),!0},S.prototype.enableAbsolutePosition=function(t){(t=!1!==t)!==this._absolute&&(this._absolute=t,this._element.style.left=t?this._colLeft+"px":"")},S.prototype.dispose=function(){this._dispose();for(var t=this._cells.length;--t>=0;)this._cells[t].dispose();this._scrollFrame=this._nextSibling=this._parent=this._cells=this._section=null},S.prototype.setStyle=function(t,e){var i=this._element;i.style[t]=e,i.style.backgroundColor?i.classList.contains("no-shading")||i.classList.add("no-shading"):i.classList.contains("no-shading")&&i.classList.remove("no-shading")},S.prototype.setStyles=function(t){var e=this._element,i=e.style;for(var o in t)i[o]=t[o];e.style.backgroundColor?e.classList.contains("no-shading")||e.classList.add("no-shading"):e.classList.contains("no-shading")&&e.classList.remove("no-shading")},S.prototype.show=function(t){this.setVisibility(0,!1!==t)},S.prototype.setWidth=function(t){this._element.style.width=t+"px";var e,i=0;t>0&&t<=24?i=3:t>24&&t<=40?i=2:t>40&&t<60&&(i=1);var o=this._sizeClasses;if(o){if(o.length>i){for(e=o.length;--e>=i;)this.removeClass(o[e]);o.length=i}i||(this._sizeClasses=null)}if(i)for(o||(o=[],this._sizeClasses=o),e=o.length;e<i;++e)o[e]=S._sizeClasses[e],this.addClass(o[e]);return this.setVisibility(1,t>0),!0},S._sizeClasses=["small-col","very-small-col","tiny-col"],S.prototype.setHeight=function(t){return this._element.style.height=t+"px",this.setVisibility(2,t>0),!0},S.prototype.getParent=function(){return this._parent},S.prototype.setParent=function(t,e){if(this._element){this._parent=o.getElement(t);var i=this._section?this._section.getHidingMethod():"";this._invisibility&&!i||this._setParent(this._parent,e)}},S.prototype.insertBefore=function(t){this._parent?this._scrollFrame?t&&this._parent===t.getParent()?this._insertBefore(t):this._insertBefore(this._scrollFrame):t?this._parent===t.getParent()&&this._insertBefore(t):this._setParent(this._parent):(this._insertBefore(t),this._parent=t.getParent())},S.prototype.enableAutoStyleUpdating=function(t){t=!1!==t,this._autoStyleUpdating!==t&&(this._autoStyleUpdating=t)},S.prototype.setNextSibling=function(t){this._nextSibling=t},S.prototype.isActive=function(){return!(this._invisibility&this._bits[3])},S.prototype.disableDeactivation=function(t){this._deactivation=!1!==t,this._deactivation&&(this.isActive()||this.activate())},S.prototype.activate=function(t){return t=this._pinned||this._deactivation||!1!==t,this.isActive()!==t&&(this.setVisibility(3,t),!0)},S.prototype.deactivate=function(t){this.activate(!1===t)},S.prototype.setCellCount=function(t){var e;for(e=this._cells.length;e<t;++e)this._cells.push(new f(null,this._section));for(e=this._cells.length;--e>=t;)this._cells[e].dispose();this._cells.length=t,this._cellStart>t?this._cellStart=this._cellEnd=t:this._cellEnd>t&&(this._cellEnd=t)},S.prototype.getCell=function(t){return this._cells[t]||null},S.prototype.collapseCells=function(t,e,i,o,n){if(!(e<=0)){var r=!1,s=this._cells[t];s&&!o&&(r|=s.collapse(i,n));for(var l=1;l<e&&(s=this._cells[t+l]);++l)r|=s.collapse(i,n);r&&(i?e>1&&(this._hasCollapsedCells=!0):this.updateCellOrders())}},S.prototype.uncollapseAllCells=o._deprecatedFunction,S.prototype.activateCells=function(t,e){var i,o=this._element;if(this._hasCollapsedCells)t=this._cellEnd,e>this._cellEnd&&(this._cellEnd=e);else if(this._cellStart===t){var n=this._cellEnd-e;if(n>0){for(i=this._cellEnd;--i>=e;)this._cells[i].removeParent();return void(this._cellEnd=e)}if(!(n<0))return;t=this._cellEnd,this._cellEnd=e}else{for(i=this._cellEnd;--i>=this._cellStart;)this._cells[i].removeParent();this._cellStart=t,this._cellEnd=e}for(i=t;i<e;++i){var r=this._cells[i];r.isKeptInDoc()&&(r.initialize(),o.appendChild(r.getElement()))}},S.prototype.moveCellsToTop=function(t){if(this.isActive()){for(var e=this._element,i=0;i<t;++i){var n=this._cells[i];n.isKeptInDoc()&&e.appendChild(n.getElement())}this._cells=o.cycleArray(this._cells,t)}},S.prototype.updateCellOrders=function(){this._hasCollapsedCells=!1;for(var t=this._element,e=this._cellStart;e<this._cellEnd;++e){var i=this._cells[e];i.isKeptInDoc()?t.appendChild(i.getElement()):this._hasCollapsedCells=!0}},S.prototype.hasCollapsedCells=function(){return this._hasCollapsedCells},S.prototype.getCellIndex=function(t){if(!t)return-1;for(var e=this._cellStart;e<this._cellEnd;++e)if(this._cells[e].getElement()===t)return e;return-1},S.prototype.getSection=function(){return this._section},S.prototype.log=function(){for(var t=[],e=this._cells.length,i=0;i<e;++i)t.push(this._cells[i].getTextContent());return t},S.prototype.getVisibility=function(){return!this._invisibility},S.prototype.setVisibility=function(t,e){var i=!this._invisibility,o=this._bits[t]||1;e?this._invisibility&=~o:this._invisibility|=o;var n=!this._invisibility;if(i!==n)if(this._section&&this._section.getHidingMethod())this.enableClass("hidden",!n);else if(n){var r=this._parent;if(!r)return;for(var s=this._nextSibling;s;){if(s._parent!==r){s=null;break}if(!s._invisibility)break;s=s._nextSibling}this.insertBefore(s)}else this._setParent(null)},S.prototype.updateLayout=function(){},S.prototype.setScrollState=function(t,e,i){this._scrollFrame=t,this.enableAbsolutePosition(i),this.setParent(e||this._section.getColumnHost()),e||this.activate(),this._pinned=!e},S._proto=S.prototype;const w=S;var b=function(){this._items=[]};b.prototype._items=null,b.prototype.dispose=function(){this._items=null},b.prototype.setItemCount=function(t){var e=this._items,i=e.length;if(i!==t)for(e.length=t;i<t;)e[i++]={}},b.prototype.getItem=function(t){return this._items[t]||null},b.prototype.moveItemsToTop=function(t){this._items=o.cycleArray(this._items,t)};const R=b;var I=function(t,e,i){t.setTop(e.getLaneStart(i)),t.setHeight(e.getLaneSize(i))},x=function(t,e,i,o){if(i){var n=e.getLaneStart(i);t.setLeft(n),t.setWidth(o-n)}else t.setStyle("left",""),t.setWidth(o)},L=function(t,e,i){this._trackX=t,this._trackY=e,this._section=i,this._cells=[]};L.prototype._trackX,L.prototype._trackY,L.prototype._section,L.prototype._cells,L.prototype._activeCount=0,L.prototype._stretchSize=0,L.prototype.dispose=function(){var t=this._cells;if(this._activeCount){this._activeCount=0;for(var e=t.length;--e>=0;){var i=t[e];i&&i.dispose()}}t.length=0},L.prototype.setStretchSize=function(t){this._stretchSize=t},L.prototype.getStretchSize=function(){return this._stretchSize},L.prototype.setCellCount=function(t){var e=this._cells,i=e.length;if(i<t)for(e.length=t;i<t;)e[i++]=null;else if(i>t){for(;--i>=t;){var o=e[i];o&&o.dispose()}e.length=t}},L.prototype.getCell=function(t){var e=this._cells[t];return e&&e.getParent()?e:null},L.prototype.getCells=function(){var t=[];if(this._activeCount){for(var e=this._cells,i=e.length,o=0;o<i;++o){var n=e[o];n&&n.getParent()&&t.push(n)}this._activeCount=t.length}return t},L.prototype.getColumnIndex=function(t){if(t){if(!t.getElement)return null!=t._colIndex?t._colIndex:-1;var e=t.getElement();if(e)return null!=e._colIndex?e._colIndex:-1}return-1},L.prototype.getRowIndex=function(t){if(t){if(t.getElement)return t.getParent()?this._cells.indexOf(t):-1;for(var e=this._cells,i=e.length,o=0;o<i;++o){var n=e[o];if(n&&n.getParent()&&n.getElement()===t)return o}}return-1},L.prototype.stretchCell=function(t,e){++this._activeCount,(!e||e<0)&&(e=0);var i=this._cells[t]||null;i||((i=new f(null,this._section)).addClass("tr-stretched"),i.stretched=!0,this._cells[t]=i);var o=i.getElement();o.stretched=!0,o._colIndex!==e&&(o._colIndex=e,e>0?o.classList.add("right-stretching"):o.classList.remove("right-stretching")),o._rowIndex!==t&&(o._rowIndex=t);var n=this._stretchSize||this._trackX.getTrackSize();return x(i,this._trackX,e,n),I(i,this._trackY,t),i},L.prototype.unstretchCell=function(t){var e=this._cells[t]||null;return e&&e.setParent(null),e},L.prototype.unstretchAllCells=function(){if(this._activeCount){this._activeCount=0;for(var t=this._cells,e=t.length;--e>=0;){var i=t[e];i&&i.setParent(null)}}},L.prototype.updateCells=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,o=this._trackX,n=this._trackY,r=this._stretchSize||o.getTrackSize(),s=0;s<i;++s){var l=e[s];l&&l.getParent()&&(++t,x(l,o,l.getElement()._colIndex,r),I(l,n,s))}this._activeCount=t}},L.prototype.updateXAxis=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,o=this._trackX,n=this._stretchSize||o.getTrackSize(),r=0;r<i;++r){var s=e[r];s&&s.getParent()&&(++t,x(s,o,s.getElement()._colIndex,n))}this._activeCount=t}},L.prototype.updateYAxis=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,o=this._trackY,n=0;n<i;++n){var r=e[n];r&&r.getParent()&&(++t,I(r,o,n))}this._activeCount=t}},L.prototype.moveCellsToTop=function(t){this._activeCount&&(this._cells=o.cycleArray(this._cells,t),this.updateYAxis())};const D=L;var A=function(t,e){this.indexX=t,this.indexY=e};A.prototype.isSpanIndices=function(t,e){return t===this.indexX&&e===this.indexY},A.prototype.isOccupiedIndices=function(t,e){return t!==this.indexX||e!==this.indexY},A.prototype.register=function(t,e){this._register(t,e,!0)},A.prototype.unregister=function(t,e){this._register(t,e,!1)},A.prototype._register=function(t,e,i){var o=t.indexOf(this);i?o<0&&t.push(this):o>=0&&t.splice(o,1);for(var n=i?this:null,r=this.indexX+this.colSpan,s=this.indexY+this.rowSpan,l=this.indexX;l<r;++l)for(var a=this.indexY;a<s;++a)e[l+","+a]=n},A.prototype.indexX,A.prototype.indexY,A.prototype.colSpan=1,A.prototype.rowSpan=1,A.prototype.prevColSpan=1,A.prototype.prevRowSpan=1,A.prototype.retVal=0;const z=A;var T=function(){this._spans=[],this._occupiedMap={}};T.prototype.removeColumn=function(t){var e=!1;return this.removeSpanByColIndex(t)&&(e=!0),this.shiftColumn(t,-1)&&(e=!0),e},T.prototype.freezeMapping=function(t){this._frozenMapping=!1!==t,this._frozenMapping||this._mapCellSpans()},T.prototype._mapCellSpans=function(){var t,e,i=this._spans;for(this._spans=[],this._occupiedMap={},t=i.length;--t>=0;)(e=i[t]).indexX>=0&&e.register(this._spans,this._occupiedMap)},T.prototype.shiftColumn=function(t,e){if(this._spans.length<=0||0===e)return!1;for(var i=!1,o=this._spans.length;--o>=0;){var n=this._spans[o];n.indexX>=t&&(i=!0,n.indexX+=e)}return!(!i||this._frozenMapping||(this._mapCellSpans(),0))},T.prototype.removeSpan=function(t,e){if(this._spans.length<=0)return null;var i=t+","+e,o=this._occupiedMap[i];return!o||o.isOccupiedIndices(t,e)?null:(o.unregister(this._spans,this._occupiedMap),o)},T.prototype.removeSpanByColIndex=function(t,e){var i,o=this._spans.length;if(o<=0)return null;for(var n=e||[],r=0,s=0;s<o;++s)(i=this._spans[s])&&i.indexX===t&&(n.push(i),r++);if(r<=0)return null;for(o=n.length,s=0;s<r;++s)n[o-s-1].unregister(this._spans,this._occupiedMap);return n},T.prototype.removeSpanStartedFromRowIndex=function(t,e){var i,o=this._spans.length;if(o<=0)return null;for(var n=e||[],r=0,s=0;s<o;++s)(i=this._spans[s])&&i.indexY>=t&&(n.push(i),r++);if(r<=0)return null;for(o=n.length,s=0;s<r;++s)n[o-s-1].unregister(this._spans,this._occupiedMap);return n},T.prototype.clearAllSpans=function(){if(this._spans.length<=0)return null;var t=this._spans;return this._spans=[],this._occupiedMap={},t},T.prototype.hasSpan=function(){return this._spans.length>0},T.prototype.getSpan=function(t,e){var i=this.getOccupyingSpan(t,e);return i&&i.isSpanIndices(t,e)?i:null},T.prototype.getOccupyingSpan=function(t,e){return this._spans.length<=0?null:this._occupiedMap[t+","+e]||null},T.prototype.getAllSpans=function(){return this._spans},T.prototype.getColSpan=function(t,e){var i=this._occupiedMap[t+","+e];return null==i?1:i.isOccupiedIndices(t,e)?i.indexX-t:i.colSpan},T.prototype.getRowSpan=function(t,e){var i=this._occupiedMap[t+","+e];return null==i?1:i.isOccupiedIndices(t,e)?i.indexY-e:i.rowSpan},T.prototype.setColSpan=function(t,e,i){return this._updateSpan(t,e,!0,i)},T.prototype.setRowSpan=function(t,e,i){return this._updateSpan(t,e,!1,i)},T.prototype._updateSpan=function(t,e,i,o){o<1&&(o=1);var n=this.getSpan(t,e);n&&(n.retVal=0);var r,s,l,a,h,u,p=t,_=e,c=n?n.colSpan:1,d=n?n.rowSpan:1,g=!0;if(i){if(c===o)return n;if(c>o)p=t+o,r=t+c,g=!1;else{if((l=this._occupiedMap[t+","+e])&&l!==n)return n;p=t+c,r=t+o}s=e+d}else{if(d===o)return n;if(d>o)_=e+o,s=e+d,g=!1;else{if((l=this._occupiedMap[t+","+e])&&l!==n)return n;_=e+d,s=e+o}r=t+c}if(g){var f=[];for(h=p;h<r;++h)for(u=_;u<s;++u){if(a=h+","+u,this._occupiedMap[a])return n;f.push(a)}for(null==n&&(n=new z(t,e),a=t+","+e,this._spans.push(n),this._occupiedMap[a]=n),h=f.length;--h>=0;)this._occupiedMap[f[h]]=n}else{if(i?o+d<=2:o+c<=2){a=t+","+e;var y=this._spans.indexOf(n);this._spans.splice(y,1),this._occupiedMap[a]=null}for(h=p;h<r;++h)for(u=_;u<s;++u)this._occupiedMap[h+","+u]=null}return i?(n.prevColSpan=n.colSpan,n.colSpan=o):(n.prevRowSpan=n.rowSpan,n.rowSpan=o),n.retVal=g?1:-1,n},T.prototype._spans,T.prototype._occupiedMap,T.prototype._frozenMapping=!1;const V=T;var E=function(){this._selections=[]};E.prototype.clone=function(){var t=new E;return t._selections=this._selections.concat(),t._count=this._count,t._anchor=this._anchor,t._firstIndex=this._firstIndex,t._lastIndex=this._lastIndex,t},E.prototype.toString=function(){return this._selections.join(", ")},E.prototype.select=function(t){return!(t<0||!this._select(t)||(this._anchor=t,(this._firstIndex<0||t<this._firstIndex)&&(this._firstIndex=t),(this._lastIndex<0||t>this._lastIndex)&&(this._lastIndex=t),0))},E.prototype.deselect=function(t){return!!this._selections[t]&&(this._selections[t]=!1,--this._count,this._anchor===t&&(this._anchor=-1),this._firstIndex===t&&(this._firstIndex=this._findNextSelection(t)),this._lastIndex===t&&(this._lastIndex=this._findPrevSelection(t)),!0)},E.prototype.deselectFrom=function(t){if(this._lastIndex<t)return!1;if(this._firstIndex>=t)return this.clearAllSelections(),!0;for(var e=this._lastIndex,i=this._selections,o=t;o<=e;++o)i[o]&&(i[t]=!1,--this._count);return this._anchor>=t&&(this._anchor=-1),this._lastIndex=this._findPrevSelection(t),!0},E.prototype.toggleSelection=function(t){this._selections[t]?this.deselect(t):this.select(t)},E.prototype.singularlySelect=function(t){return 1!==this._count||t<0?(this.clearAllSelections(),this.select(t),!0):this._firstIndex!==t&&(this._selections[this._anchor]=!1,this._selections[t]=!0,this._anchor=t,this._firstIndex=t,this._lastIndex=t,!0)},E.prototype.selectRange=function(t,e){if(0!==e)if(t<0&&(t=0),1!==e&&-1!==e){var i=t,o=i+e;if(e<0&&(i=(o=i+1)+e),!(i>=o)){this._anchor=t,(this._firstIndex<0||i<this._firstIndex)&&(this._firstIndex=i),(this._lastIndex<0||o>=this._lastIndex)&&(this._lastIndex=o-1);for(var n=i;n<o;++n)this._select(n)}}else this.select(t)},E.prototype.deselectRange=function(t,e){if(!(this._count<=0))if(t<0&&(t=0),1!==e&&-1!==e){var i=t+e;if(e<0&&(t=(i=t+1)+e),this._firstIndex>=t&&this._lastIndex<i)this.clearAllSelections();else{this._anchor>=t&&this._anchor<i&&(this._anchor=-1),this._firstIndex>=t&&this._firstIndex<i&&(this._firstIndex=this._findNextSelection(i-1)),this._lastIndex>=t&&this._lastIndex<i&&(this._lastIndex=this._findPrevSelection(t));var o=0;for(o=t;o<i;++o)this._selections[o]&&(this._selections[o]=!1,--this._count)}}else this.deselect(t)},E.prototype.hasSelection=function(t,e){if(this._count<=0)return!1;var i=t+e;if(e<0&&(t=(i=t+1)+e),i<this._firstIndex||t>this._lastIndex)return!1;for(var o=t;o<i;++o)if(this._selections[o])return!0;return!1},E.prototype.getSelection=function(t){return!0===this._selections[t]},E.prototype.setSelection=function(t,e){return!1!==e?this.select(t):this.deselect(t)},E.prototype.getSelectionAnchor=function(){return this._anchor},E.prototype.setSelectionAnchor=function(t){this._anchor=t},E.prototype.getSelectionCount=function(){return this._count},E.prototype.getFirstSelectedIndex=function(){return this._firstIndex},E.prototype.getLastSelectedIndex=function(){return this._lastIndex},E.prototype.getAllSelections=function(){if(this._count>0){for(var t=new Array(this._count),e=0,i=this._selections,o=this._lastIndex,n=this._firstIndex;n<=o;++n)i[n]&&(t[e++]=n);return t}return[]},E.prototype.getConnectedRanges=function(t,e){if(this._count>0){var i=[];(null==t||t<this._firstIndex)&&(t=this._firstIndex),(null==e||e>this._lastIndex)&&(e=this._lastIndex+1);for(var o=null,n=t;n<e;++n)this._selections[n]?o||(o=[n,-1]):o&&(o[1]=n-1,i.push(o),o=null);return o&&(o[1]=this._lastIndex,i.push(o),o=null),i}return[]},E.prototype.getSelectionMap=function(){return this._selections},E.prototype.clearAllSelections=function(){return this._count>0?(this._selections.length=0,this._count=0,this._anchor=-1,this._firstIndex=-1,this._lastIndex=-1,0):0},E.prototype.copyFrom=function(t,e,i,o){if(!(o<=0)){var n=e+i;if(null!=t)if(!1!==t.hasSelection(e,o)){for(var r=0;r<o;++r)t._selections[e+r]?this.select(n+r):this.deselect(n+r);this._anchor=-1,t._anchor>=0&&t._anchor>=e&&t._anchor<e+o&&(this._anchor=t._anchor+i)}else this.deselectRange(n,o);else this.deselectRange(n,o)}},E.prototype._select=function(t){return!this._selections[t]&&(this._selections[t]=!0,++this._count,!0)},E.prototype._findNextSelection=function(t){if(this._lastIndex>=0)for(;++t<=this._lastIndex;)if(this._selections[t])return t;return-1},E.prototype._findPrevSelection=function(t){if(this._firstIndex>=0)for(;--t>=this._firstIndex;)if(this._selections[t])return t;return-1},E.prototype._selections=null,E.prototype._count=0,E.prototype._anchor=-1,E.prototype._firstIndex=-1,E.prototype._lastIndex=-1;const P=E;var M=function(t,e){this._onInterval=this._onInterval.bind(this),"function"==typeof t?this._func=t:"function"==typeof e&&(this._func=e),"number"==typeof e?this._delay=e:"number"==typeof t&&(this._delay=t)};M.prototype._func=null,M.prototype._delay=0,M.prototype._timerId=0,M.prototype._pending=!1,M.prototype.start=function(){this._func&&(this._timerId?this._pending=!0:this._timerId=setInterval(this._onInterval,this._delay))},M.prototype.dispose=function(){this._timerId&&(clearInterval(this._timerId),this._timerId=0),this._func=null},M.prototype._onInterval=function(){this._pending?this._pending=!1:(this._func(),clearInterval(this._timerId),this._timerId=0)},M._proto=M.prototype;const F=M;var H=function(){var t=this;t._addEvents("scroll","activated","deactivated","scrollStart","scrollEnd","thicknessChanged","layoutChanged","enabled","disabled"),t._onTrackScroll=t._onTrackScroll.bind(t),t._onKeyDown=t._onKeyDown.bind(t),t._onStartFading=t._onStartFading.bind(t),t._onMouseWheel=t._onMouseWheel.bind(t),t._flash=t._flash.bind(t),t._onTouchStart=t._onTouchStart.bind(t),t._onTouchMove=t._onTouchMove.bind(t),t._onTouchEnd=t._onTouchEnd.bind(t),t._smoothScroll=t._smoothScroll.bind(t),t._updateEffectiveArea=t._updateEffectiveArea.bind(t),t._onRestingPosition=t._onRestingPosition.bind(t),t._element=document.createElement("div"),t._element.className="grid-scrollbar",t._trackContent=document.createElement("div"),t._panes=[],t._paneSliders=[],t._startPos={},t._endPos={},t._reverter=new F(t._onRestingPosition,300),t._element.addEventListener("scroll",t._onTrackScroll),t._element.addEventListener("mouseover",t._flash),t._element.appendChild(t._trackContent),t.disableKeyboardInput(!1),t._onThicknessChanged=t._dispatch.bind(t,"thicknessChanged"),H._queryNativeTrackThickness(t._onThicknessChanged),t._updateEffectiveArea()||t.listen("thicknessChanged",t._updateEffectiveArea)};u.inherits(H,_),H.prototype._vertical=!0,H.prototype._step=0,H.prototype._parentNode=null,H.prototype._hostClassName="",H.prototype._trackContent=null,H.prototype._panes=null,H.prototype._paneSliders=null,H.prototype._enabled=!0,H.prototype._active=!1,H.prototype._isFrozen=!1,H.prototype._otherScrollbar=null,H.prototype._autoHideScrollbar=!0,H.prototype._trackSize=120,H.prototype._tContentSize=0,H.prototype._tScrollVal=0,H.prototype._tPercentVal=0,H.prototype._paneSize=0,H.prototype._pContentSize=0,H.prototype._pScrollVal=0,H.prototype._footerCount=0,H.prototype._fadingId=0,H.prototype._postponeFading=!1,H.prototype._layoutChanged=!1,H.prototype._contentDirty=!0,H.prototype._layoutDirty=!0,H.prototype._touchInput=!0,H.prototype._swiping=!1,H.prototype._touchDrag=!1,H.prototype._startPos,H.prototype._endPos,H.prototype._smoothing=!0,H.prototype._smoothingId=0,H.prototype._smoothingSpeed=0,H.prototype._wheelScrolling="",H.prototype._mouseWheelLogic=null,H.prototype._onThicknessChanged=null,H._trackThickness=0,H._queryTimeout=0,H._queryStarted=!1,H._outerDummy=null,H._innerDummy=null,H._listeners=null,H.prototype._updateEffectiveArea=function(){var t=this.getTrackThickness();if(t){var e=this._vertical?"width":"height";this._element.style[e]=t+1+"px"}return!!t},H._queryNativeTrackThickness=function(t){if(H._queryStarted||H._repeatQuery(),t&&H._trackThickness<=0){var e=H._listeners;e||(e=H._listeners=[]),e.push(t)}},H._repeatQuery=function(){H._queryStarted=!0,H._retrieveNativeTrackThinkness()||(H._queryTimeout+=100,H._queryTimeout<3e3?setTimeout(H._repeatQuery,H._queryTimeout):(H._trackThickness=13,H._clearStaticResources()))},H._retrieveNativeTrackThinkness=function(){if(H._trackThickness>0)return!0;var t=H._innerDummy,e=H._outerDummy;t||((t=H._innerDummy=document.createElement("p")).style.width="100%",t.style.height="200px",(e=H._outerDummy=document.createElement("div")).style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.appendChild(t)),e.style.overflow="hidden",document.body.appendChild(e);var i=t.offsetWidth;e.style.overflow="scroll";var o=t.offsetWidth;return i==o&&(o=e.clientWidth),document.body.removeChild(e),(H._trackThickness=i-o)>0&&(H._clearStaticResources(),!0)},H._clearStaticResources=function(){H._innerDummy=H._outerDummy=null;var t=H._listeners;if(t){H._listeners=null;for(var e={},i=t.length;--i>=0;)t[i](e)}},H.updateTrackThickness=function(){H._trackThickness=0,H._queryTimeout=0,H._queryStarted=!1,H._queryNativeTrackThickness()},H.prototype.dispose=function(){var t=H._listeners;if(t){var e=t.indexOf(this._onThicknessChanged);e>=0&&(t.splice(e,1),this._onThicknessChanged=null)}this.unlistenAll(),this._smoothingId&&(clearInterval(this._smoothingId),this._smoothingId=0),this._active=this._layoutChanged=!1,this._dispose();for(var i=this._panes.length;--i>=0;)this._panes[i].dispose(),this._paneSliders[i].dispose();this._reverter.dispose()},H.prototype.getContent=function(t){return this._paneSliders[0].getContent(t)},H.prototype.getParent=function(){return this._parentNode},H.prototype.setParent=function(t,e){var i=o.getElement(t),n=this._parentNode!==i;n&&this._parentNode&&(this.removeWheelListener(this._parentNode),this._parentNode.classList.remove(this._hostClassName)),this.isActive()?(this._setParent(i,e),this._parentNode=this._element.parentNode,this._parentNode&&this._parentNode.classList.add(this._hostClassName)):this._parentNode=i,n&&this.addWheelListener(this._parentNode)},H.prototype.attachToExternalElement=function(t){this.setParent(t);var e=this.getElement();e.style.right="0",this._vertical?e.style.overflowX="hidden":e.style.overflowY="hidden",e.style.boxSizing="border-box",e.style.position="absolute",e.style.outline="none"},H.prototype._onActiveStateChange=function(){var t,e=this;if(e._scrollTo(0,!0),e._active){for(e._parentNode&&(e._layoutDirty=!0,e._setParent(e._parentNode),e._parentNode.classList.add(e._hostClassName)),e._flash(),t=e._panes.length;--t>=0;)e._panes[t].removeClass("scroll-disabled");e._dispatch("activated",{})}else{e._setParent(null),e._parentNode&&e._parentNode.classList.remove(e._hostClassName);var i=e._vertical?"height":"width";for(t=e._panes.length;--t>=0;)e._panes[t].addClass("scroll-disabled"),e._panes[t].setStyle(i,"");e._dispatch("deactivated",{})}e._vertical&&e._otherScrollbar&&e._otherScrollbar.isActive()&&e._otherScrollbar.invalidate()},H.prototype._onEnablingStateChange=function(){var t=this;t._enabled?t._dispatch("enabled",{}):t._dispatch("disabled",{})},H.prototype.isActive=function(){return this._active},H.prototype.isEnabled=function(){return this._enabled},H.prototype.enable=function(t){t=!1!==t,this._enabled!=t&&(this._enabled=t,this._updateLayout(),this._onEnablingStateChange())},H.prototype.disable=function(t){this.enable(!1===t)},H.prototype.getTrackSize=function(){return this._trackSize},H.prototype.getPaneSize=function(){return this._paneSize},H.prototype.getContentSize=function(){return this._pContentSize},H.prototype.getTrackThickness=function(){return H._trackThickness},H.prototype.getScrollGap=function(){return this._pContentSize-this.getPaneSize()},H.prototype.setTrackSize=function(t,e){this._trackSize=t>0?t:0,this._paneSize=e>0?e:0},H.prototype.calculateContentSize=function(){return 0},H.prototype.update=function(){if(this._contentDirty){this._contentDirty=!1;var t=this.calculateContentSize();(!t||t<0)&&(t=0),this._pContentSize!==t&&(this._pContentSize=t,this._layoutDirty=!0)}return!!this._layoutDirty&&(this._layoutDirty=!1,this._updateLayout(),!0)},H.prototype.invalidate=function(t,e){this._contentDirty=!0,this._layoutDirty=!0,null!=e&&(this._pScrollVal=e),t&&this.update()},H.prototype.invalidateContent=function(){this._contentDirty=!0},H.prototype.isScrollPosValid=function(t){var e=t-this.getPaneSize(),i=this._pScrollVal;return 0===i||i>0&&e>0&&i<e},H.prototype.flash=function(){this.update(),this._flash()},H.prototype._scroll=function(t){this._scrollTo(this._pScrollVal+t)},H.prototype._scrollTo=function(t,e){if(this._active||e){t=this._calcProperScrollValue(t);var i=!1;this._pScrollVal!==t&&(this._pScrollVal=t,i=!0),this._setTrackScrollVal(t),i?(e&&(this._layoutChanged=!0),this._dispatchScrollEvent(null)):e&&this._dispatch("layoutChanged",{})}},H.prototype._calcProperScrollValue=function(t){if(!t||t-.5<0)return 0;if(this._tPercentVal>=1&&Math.abs(this._pScrollVal-t)<=2)return this._pScrollVal;var e=this.getScrollGap();if(e<=0)return 0;if(t+.5>=e)return e;var i=this._step;if(i){if((t=Math.round(t/i)*i)-i/2<=0)return 0;if(t+i/2>=e)return e}return Math.round(t)},H.prototype._convertTrackToPane=function(t){t=Math.round(t);var e=this._getTrackGap();this._tPercentVal>=1&&Math.abs(this._tScrollVal-t)<=5&&(t=e),this._tScrollVal=t,this._tPercentVal=e?t/e:0;var i=this.getScrollGap();return e===i?t:this._tPercentVal*i},H.prototype._setTrackScrollVal=function(t){var e=this._getTrackGap(),i=0;if(e>0){if(t>0){var o=this.getScrollGap();i=e===o?t:t/o*e,i=Math.round(i)}i>=e&&(i=e)}if(i!==this._tScrollVal){this._tScrollVal=i,this._tPercentVal=e?i/e:0;var n=this._element;return this._vertical?n.scrollTop=i:n.scrollLeft=i,!0}return!1},H.prototype._getTrackGap=function(){var t=this._tContentSize-this.getTrackSize();return t>0?t:0},H.prototype._getScrollValue=function(){return this._pScrollVal},H.prototype._isEndOfScroll=function(){return!this._active||this._pScrollVal>=this.getScrollGap()},H.prototype._isStartOfScroll=function(){return!this._pScrollVal},H.prototype._isOnEdge=function(t){return t<0&&this._isStartOfScroll()||t>0&&this._isEndOfScroll()},H.prototype._flash=function(){this._active&&this._autoHideScrollbar&&(this._fadingId?this._postponeFading=!0:(this._element._fading&&(this._element.classList.remove("grid-scroll-fadeout"),this._element._fading=!1),this._fadingId=setTimeout(this._onStartFading,1e3)))},H.prototype._clearAllPanes=function(){for(var t=this._panes.length;--t>=0;){this._panes[t].setParent(null);var e=this._paneSliders[t];e._content=e._columns=null;for(var i=e.getElement();null!==i.firstChild;)i.removeChild(i.firstChild)}},H.prototype.disableKeyboardInput=function(t){!1===t?(this._element.setAttribute("tabindex","0"),this._element.addEventListener("keydown",this._onKeyDown,!1)):(this._element.removeAttribute("tabindex"),this._element.removeEventListener("keydown",this._onKeyDown,!1))},H.prototype.disableTouchInput=function(t){this._touchInput=!1===t},H.prototype.setAutoHide=function(t){this._autoHideScrollbar=t,t||(this._element._fading&&(this._element.classList.remove("grid-scroll-fadeout"),this._element._fading=!1),this._fadingId&&(clearTimeout(this._fadingId),this._fadingId=0))},H.prototype.getAutoHide=function(){return this._autoHideScrollbar},H.prototype.setOtherScrollbar=function(t){this._otherScrollbar=t},H.prototype.setFooterCount=function(t){this._footerCount=t},H.prototype._calcActiveState=function(){if(this._enabled&&this.getTrackSize()>20){var t=this.getPaneSize();if(t>0)return this._pContentSize-t>0}return!1},H.prototype._updateLayout=function(){var t=this._calcActiveState();if(t!==this._active&&(this._active=t,this._onActiveStateChange()),this._active){var e=this.getTrackSize(),i=this.getPaneSize();if(this._tContentSize=this._pContentSize/i*e,this._vertical)this._trackContent.style.height=this._tContentSize+"px",this._element.style.height=e+"px",this._panes[0].setHeight(i);else{this._trackContent.style.width=this._tContentSize+"px",this._element.style.width=e+"px";for(var o=this._panes.length;--o>=0;)this._panes[o].setWidth(i)}this._scrollTo(this._pScrollVal,!0)}},H.prototype.resetPaneSize=function(){for(var t=this._vertical?"height":"width",e=this._panes.length;--e>=0;)this._panes[e].setStyle(t,"")},H._preventVScrolling=function(t){t.currentTarget.scrollTop=0},H._preventHScrolling=function(t){t.currentTarget.scrollLeft=0},H.prototype._addPaneAt=function(t){null==t&&(t=this._panes.length);var e=this._panes[t];if(!e){if((e=new _(document.createElement("div"))).setClass("grid-pane"),this._vertical?(e.addClass("sections"),e.listen("scroll",H._preventVScrolling)):(e.addClass("columns"),e.listen("scroll",H._preventHScrolling)),this._active||e.addClass("scroll-disabled"),this._paneSize&&this._active){var i=this.getPaneSize();this._vertical?e.setHeight(i):e.setWidth(i)}e.listen("touchstart",this._onTouchStart),e.listen("touchmove",this._onTouchMove),e.listen("touchend",this._onTouchEnd),e.listen("touchcancel",this._onTouchEnd);var o=new _(document.createElement("div"));o.setClass("grid-pane-slider"),o.setParent(e),this._panes[t]=e,this._paneSliders[t]=o}return e},H.prototype._onStartFading=function(t){this._fadingId=0,this._active&&(this._postponeFading?(this._postponeFading=!1,this._flash()):this._element._fading||(this._element.classList.add("grid-scroll-fadeout"),this._element._fading=!0))},H.prototype._onTrackScroll=function(t){var e=this._vertical?t.target.scrollTop:t.target.scrollLeft,i=this._convertTrackToPane(e);(i=this._calcProperScrollValue(i))!==this._pScrollVal&&(this._pScrollVal=i,this._dispatchScrollEvent(t))},H.prototype._onRestingPosition=function(){this._setSliderPosition(-this._pScrollVal,!0)},H.prototype._setSliderPosition=function(t,e){var i="",o="",n=this._vertical?"top":"left";t&&(e?o=t+"px":(i=this._vertical?"translateY":"translateX",i+="("+t+"px)",this._reverter.start()));for(var r=this._paneSliders.length;--r>=0;){var s=this._paneSliders[r],l=s.getElement().style;s._titleSection?l[n]=t+"px":(l.transform=i,l[n]=o)}e?this._dispatch("scrollEnd",{}):this._dispatch("scrollStart",{})},H.prototype._dispatchScrollEvent=function(t){if(this._setSliderPosition(-this._pScrollVal,!1),this._flash(),!this._isEventDispatching("scroll")){if(!t){var e=this._element;t={currentTarget:e,srcElement:e,target:e}}t.layoutChanged=this._layoutChanged,this._vertical?t.scrollTop=this._pScrollVal:t.scrollLeft=this._pScrollVal,this._dispatch("scroll",t)}},H.prototype._onKeyDown=function(t){if(this._isFrozen)o._preventDefault(t);else if(this._active&&(this._vertical?38===t.keyCode||40===t.keyCode:37===t.keyCode||39===t.keyCode)){var e=this.getScrollGap(),i=Math.round(.07*e);i<10?i=10:i>100&&(i=100),37!==t.keyCode&&38!==t.keyCode||(i*=-1),this._scroll(i),o._preventDefault(t)}},H.prototype._onTouchStart=function(t){this._isFrozen?o._preventDefault(t):!this._swiping&&this._touchInput&&(this._vertical&&this.update(),this._flash(),this._smoothingId&&(clearInterval(this._smoothingId),this._smoothingId=0),this._swiping=!0,this._getTouchInfo(t,this._startPos))},H.prototype._onTouchMove=function(t){var e=this;if(e._isFrozen)o._preventDefault(t);else if(e._swiping&&e._active&&e._touchInput&&!(t.touches&&t.touches.length>1)){var i=e._startPos,n=e._endPos;e._getTouchInfo(t,n);var r=this._vertical?i.y-n.y:i.x-n.x;r>-5&&r<5||e._isOnEdge(r)||(e._touchDrag?e._scrollTo(i.scrollValue+r):n.timeStamp-i.timeStamp>30&&(e._touchDrag=!0),t.cancelable&&t.preventDefault())}},H.prototype._onTouchEnd=function(t){if(this._isFrozen)o._preventDefault(t);else if(this._swiping=!1,this._touchDrag&&(this._touchDrag=!1,t.cancelable&&t.preventDefault(),this._smoothing&&!this._smoothingId)){var e=this._startPos,i=this._getTouchInfo(t,this._endPos),n=i.timeStamp-e.timeStamp,r=this._vertical?e.y-i.y:e.x-i.x;this._smoothingSpeed=30*r/n,(this._smoothingSpeed>10||this._smoothingSpeed<-10)&&(this._smoothingId=setInterval(this._smoothScroll,25))}},H.prototype._getTouchInfo=function(t,e){var i=t.changedTouches[0];return e||(e={}),e.x=i.pageX,e.y=i.pageY,e.timeStamp=t.timeStamp,e.scrollValue=this._getScrollValue(),e},H.prototype._smoothScroll=function(){var t=this._smoothingSpeed;t=.9*t|0,this._smoothingSpeed=t,t>1||t<-1?this._scroll(t):(clearInterval(this._smoothingId),this._smoothingId=0)},H.prototype.disableMouseWheel=function(t){!1===t?this.setMouseWheelLogic(this._mouseWheelLogic||this._onMouseWheel):this.setMouseWheelLogic(null)},H.prototype.setMouseWheelLogic=function(t){this.removeWheelListener(this._parentNode),this._mouseWheelLogic=t,this._mouseWheelLogic&&this.addWheelListener(this._parentNode)},H.prototype.addWheelListener=function(t){t&&this._mouseWheelLogic&&t.addEventListener("wheel",this._mouseWheelLogic,!1)},H.prototype.removeWheelListener=function(t){t&&this._mouseWheelLogic&&t.removeEventListener("wheel",this._mouseWheelLogic,!1)},H.prototype.setMouseWheelSpeed=function(t){this._wheelScrolling="string"==typeof t?t:""},H.prototype.getMouseWheelSpeed=function(){return this._wheelScrolling},H.prototype.getDefaultMouseWheelLogic=function(){return this._onMouseWheel},H.prototype._onMouseWheel=function(t){if(!t.target.opened)if(this._isFrozen)o._preventDefault(t);else if(!t.ctrlKey&&!t.altKey&&this.isActive()){var e=this._vertical?t.deltaY:t.deltaX;if(e&&!this._isOnEdge(e)){if(o._preventDefault(t),t.deltaMode&&(e=e>0?100:-100),"linear"!=this._wheelScrolling){var i=this.getContentSize();i>=4e3&&(e*=1+i/4e3|0)}this.update(),this._scroll(e)}}},H.prototype.setScrollingStep=function(t){this._step=t>0?t:0},H.prototype.freezeScrolling=function(t){var e=this._isFrozen;return this._isFrozen=!1!==t,e},H.prototype.restoreTrackPosition=function(){var t=this._element;this._vertical&&(t.scrollTop=this._tScrollVal,t.scrollTop&&(this._tScrollVal=t.scrollTop))},H._proto=H.prototype;const k=H;var O=function(){var t=this;t._vertical=!1,t._onDeactivated=t._onDeactivated.bind(t),t._onActivated=t._onActivated.bind(t),t._hostClassName="hscrollbar-host",O.base(this,"constructor"),t._element.classList.add("grid-hscroll"),t._trackContent.style.height="1px",t.disableMouseWheel(!1),t.listen("activated",t._onActivated),t.listen("deactivated",t._onDeactivated)};u.inherits(O,k),O.prototype._pinnedLeftColumnCount=0,O.prototype._pinnedRightColumnCount=0,O.prototype.setScrollContent=function(t,e,i,o){this._clearAllPanes();var n=e.length;if(!(n<=0)){this._pinnedLeftColumnCount=i>=0?i:0,this._pinnedRightColumnCount=o>0?o:0;var r=e[0],s=r.getColumnCount(),l=s-o;(!l||l<0)&&(l=s);for(var a=0;a<n;++a){r=e[a];var h,u,p=this._addPaneAt(a),_=this._paneSliders[a],c=p.getElement(),d=_.getElement();for(h=0;h<i;++h)(u=r.getColumn(h)).setScrollState(c,null,!1);p.setParent(r.getColumnHost());var g=[],f=[];for(h=i;h<l;++h)(u=r.getColumn(h)).setScrollState(null,d,this.isActive()),g.push(u),f.push(u.getElement());for(h=l;h<s;++h)(u=r.getColumn(h)).setScrollState(null,null,!1);var y=r.getReservedSpace();y&&(this._pinnedRightColumnCount||(_.addContent(y),f.push(y)),r._updateRightSpaceStyle()),r._updateLayers(),_._titleSection=r.hasClass("title"),_._columns=g,_._content=f}this.invalidateContent()}},O.prototype.setWidth=function(t){return this.setTrackSize(t,t),!0},O.prototype.getWidth=function(){return this.getPaneSize()},O.prototype.getScrollLeft=function(){return this._getScrollValue()},O.prototype.setScrollLeft=function(t){this.update(),this._scrollTo(t)},O.prototype.getPinnedLeftColumnCount=function(){return this.isEnabled()?this._pinnedLeftColumnCount:0},O.prototype.getPinnedRightColumnCount=function(){return this.isEnabled()?this._pinnedRightColumnCount:0},O.prototype.setPaneLeft=function(t){for(var e=t&&this.isActive()?-t+"px":"",i=this._panes.length;--i>=0;)this._paneSliders[i].setStyle("marginLeft",e)},O.prototype.isEndOfHorizontalScroll=function(){return this._isEndOfScroll()},O.prototype.getContentWidth=function(){var t=this._paneSliders[0],e=0;if(t)for(var i=t._content,o=i.length;--o>=0;){var n=i[o],r=n?n.style.width:0;r&&(e+=parseFloat(r))}return e},O.prototype.calculateContentSize=function(){return this.getContentWidth()},O.prototype.getTrackSize=function(){return this._footerCount<=0&&this._otherScrollbar&&this._otherScrollbar.isActive()&&!this._pinnedRightColumnCount?this._trackSize-this.getTrackThickness():this._trackSize},O.prototype._onActivated=function(t){this._updateActivation(!0)},O.prototype._onDeactivated=function(t){this._updateActivation(!1)},O.prototype._updateActivation=function(t){for(var e=this._paneSliders.length,i=0;i<e;++i)for(var o=this._paneSliders[i]._columns,n=o?o.length:0,r=0;r<n;++r){var s=o[r];s.getElement()&&s.enableAbsolutePosition(t)}},O._proto=O.prototype;const G=O;var B=function(t){var e=this;e._onMouseMove=e._onMouseMove.bind(e),e._onMouseOut=e._onMouseOut.bind(e),e._onResetTransformIE=e._onResetTransformIE.bind(e),e._trackX=new m,e._trackY=new m,e._trackX.setDefaultLaneSize(100),e._trackY.setDefaultLaneSize(32),e._cellSpans=new V,e._element=document.createElement("div"),e._element.className="tr-lg tr-even-shading",e._ctxRows=new R,e._columns=[],e._cells=[],e._highlightedCells=[],e._stretchedCells=new D(e._trackX,e._trackY,e),e._selectionList=new P,t&&(e._virOwner=t.owner||null,t.horizontalScrollbar&&(e._hscrollbar=t.horizontalScrollbar)),e._virOwner||e._element.classList.add("section"),e._addEvent("rowHighlighted"),e._addEvent("rowCountChanged"),e._addEvent("rowHeightChanged"),e._addEvent("rowAvailable")};u.inherits(B,_),B.prototype._index=-1,B.prototype._availableRowCount=0,B.prototype._activeRow=0,B.prototype._activeRowEnd=0,B.prototype._colCount=0,B.prototype._rowCount=0,B.prototype._hiddenRowCount=0,B.prototype._trackX,B.prototype._trackY,B.prototype._cellSpans,B.prototype._columns,B.prototype._firstColumn,B.prototype._lastColumn,B.prototype._rightSpace,B.prototype._rightSpaceSize=0,B.prototype._frozenLayout=!1,B.prototype._rowHighlightEnabled=!1,B.prototype._rowHighlightIndex=-1,B.prototype._highlightedCells,B.prototype._coverLayer=null,B.prototype._stretchedCells=null,B.prototype._ctx=null,B.prototype._selectionList,B.prototype._colVir=!1,B.prototype._initialized=!1,B.prototype._hidingMethod="",B.prototype._virOwner=null,B.prototype._transformIETimer=0,B.prototype._ctxRows,B.prototype._boundLayer=null,B.prototype._colBounds=null,B.prototype._colBoundCache=null,B.prototype._colSelDirty=!1,B.prototype._hscrollbar=null,B.prototype._leftColumnSeparator=null,B.prototype._rightColumnSeparator=null,B.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._ctxRows.dispose(),this._stretchedCells.dispose();for(var t=this._columns.length;--t>=0;)this._columns[t].dispose();this._colCount=this._rowCount=this._activeRowEnd=this._availableRowCount=0,this._colBounds=this._colBoundCache=null,this._colSelDirty=!1,this._highlightedCells.length=0,this._ctx=null,this._hscrollbar=null,this._dispose()},B.prototype.getWidth=function(){return this.isVisible()?this._getWidth():0},B.prototype._getWidth=function(){return this.getContentWidth()+this._rightSpaceSize},B.prototype.setWidth=function(t){return!(t<0||null==this._trackX.setTrackSize(t-this._rightSpaceSize)||(this._syncLayoutToColumns(0),0))},B.prototype.getHeight=function(){return this.isVisible()?this.getContentHeight():0},B.prototype.setHeight=function(t){return!(t<0||(null==this._trackY.setTrackSize(t)||this._syncLayoutToRows(0,this._rowCount),0))},B.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._trackY.show(t),this.setFrozenLayout(!1===t),this._dispatchRowHeightChangedEvent(0,this._rowCount)},B.prototype.hitTest=function(t,e,i){if(t<0)return null;if(e<0)return null;if(t>=this.getContentWidth())return null;if(e>=this.getHeight())return null;var o=this._trackX.hitTest(t);if(o<0)return null;var n=this._trackY.hitTest(e);if(n<0)return null;var r={};if(r.colIndex=o,r.rowIndex=n,!0!==i){var s=this._cellSpans.getOccupyingSpan(o,n);s&&(r.colIndex=s.indexX,r.rowIndex=s.indexY)}return r},B.prototype.hitTestX=function(t){return t<0?-1:t>=this.getContentWidth()?~this._colCount:this._trackX.hitTest(t)},B.prototype.hitTestY=function(t){return t<0?-1:t>=this.getHeight()?~this._rowCount:this._trackY.hitTest(t)},B.prototype.getDefaultColumnWidth=function(){return this._trackX.getDefaultLaneSize()},B.prototype.setDefaultColumnWidth=function(t){this._trackX.getDefaultLaneSize()!==t&&(this._trackX.setDefaultLaneSize(t),this._syncLayoutToColumns(0))},B.prototype.getDefaultRowHeight=function(){return this._trackY.getDefaultLaneSize()},B.prototype.setDefaultRowHeight=function(t){if(this._trackY.getDefaultLaneSize()!==t){this._trackY.setDefaultLaneSize(t);for(var e=0;e<this._colCount;++e)this._columns[e].setHeight(t);this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)}},B.prototype.getColumnWidth=function(t){return this._trackX.getLaneSize(t)},B.prototype.setColumnWidth=function(t,e){return!!this._setColumnWidth(t,e)&&(this._syncLayoutToColumns(t),!0)},B.prototype._setColumnWidth=function(t,e){return this._trackX.setLaneSize(t,e)},B.prototype._updateColumnLayout=function(){this._syncLayoutToColumns(0)},B.prototype._startBindingSession=function(t){},B.prototype._getTempRowHeights=function(){return null},B.prototype.getRowHeight=function(t){return this._trackY.getLaneSize(t)},B.prototype.setRowHeight=function(t,e){if(t<0||t>=this._rowCount)return!1;var i=this._trackY.setLaneSize(t,e);return this._syncLayoutToRows(t,t+1),i&&this._dispatchRowHeightChangedEvent(t,t+1),this._resetTransformIETimer(),i},B.prototype._updateRowHeights=function(t,e){for(var i=0,o=0;o<this._rowCount;++o){var n=t.getLaneSize(e);i|=this._trackY.setLaneSize(o,n),++e}return this._syncLayoutToRows(0,this._rowCount),i},B.prototype.isColumnVisible=function(t){return this._trackX.isLaneVisible(t)},B.prototype.hideColumn=function(t,e){return this.setColumnVisibility(t,!1===e,0)},B.prototype.isRowVisible=function(t){return this._trackY.isLaneVisible(t)},B.prototype.hideRow=function(t,e){return!!this._trackY.hideLane(t,e)&&(null!=e&&!e||this.isRowVisible(t)?this.isRowVisible(t)&&this._hiddenRowCount--:this._hiddenRowCount++,this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},B.prototype.getMinimumColumnWidth=function(t){return this._trackX.getMinimumLaneSize(t)},B.prototype.setMinimumColumnWidth=function(t,e){return!!this._trackX.setMinimumLaneSize(t,e)&&(this._syncLayoutToColumns(t),!0)},B.prototype.getMinimumRowHeight=function(t){return this._trackY.getMinimumLaneSize(t)},B.prototype.setMinimumRowHeight=function(t,e){return!!this._trackY.setMinimumLaneSize(t,e)&&(this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},B.prototype.getCellLeft=function(t){return this._trackX.getLaneStart(t)},B.prototype.getCellTop=function(t){return this._trackY.getLaneStart(t)},B.prototype.getCellWidth=function(t,e){var i=this._cellSpans.getOccupyingSpan(t,e);if(i){var o=this._trackX.getLaneStart(i.indexX);return this._trackX.getLaneEnd(i.indexX+i.colSpan-1)-o}return this.getColumnWidth(t)},B.prototype.getCellHeight=function(t,e){var i=this._cellSpans.getOccupyingSpan(t,e);if(i){var o=this._trackY.getLaneStart(i.indexY);return this._trackY.getLaneEnd(i.indexY+i.rowSpan-1)-o}return this.getRowHeight(e)},B.prototype.hasCellSpan=function(){return this._cellSpans.hasSpan()},B.prototype.getCellRowSpan=function(t,e){return this._cellSpans.getRowSpan(t,e)},B.prototype.setCellRowSpan=function(t,e,i){var o=this._cellSpans.setRowSpan(t,e,i);if(this._updateCellSpanSize(t,e,o),o)return o.retVal>=0?this._updateCellSpanClass(t,e,o.colSpan,o.rowSpan,!0):o.colSpan>1?(this._updateCellSpanClass(t,e,o.colSpan,o.prevRowSpan,!1),this._updateCellSpanClass(t,e,o.colSpan,o.rowSpan,!0)):this._updateCellSpanClass(t,e,o.colSpan,o.prevRowSpan,!1),0!==o.retVal;var n=this._getCell(t,e);return n&&n._rowSpan>1&&this._updateCellSpanClass(t,e,n._colSpan,n._rowSpan,!1),!1},B.prototype.getCellColSpan=function(t,e){return this._cellSpans.getColSpan(t,e)},B.prototype.setCellColSpan=function(t,e,i){var o=this._cellSpans.setColSpan(t,e,i);if(this._updateCellSpanSize(t,e,o),o)return o.retVal>=0?this._updateCellSpanClass(t,e,o.colSpan,o.rowSpan,!0):o.colSpan>1?(this._updateCellSpanClass(t,e,o.prevColSpan,o.rowSpan,!1),this._updateCellSpanClass(t,e,o.colSpan,o.rowSpan,!0)):this._updateCellSpanClass(t,e,o.prevColSpan,o.rowSpan,!1),0!==o.retVal;var n=this._getCell(t,e);return n&&n._colSpan>1&&this._updateCellSpanClass(t,e,n._colSpan,n._rowSpan,!1),!1},B.prototype.clearCellSpans=function(){var t=this._cellSpans.clearAllSpans();if(null==t)return!1;for(var e=t.length;--e>=0;){var i=t[e];this._updateCellSpan(i.indexX,i.indexY,i,!1)}return!0},B.prototype.clearColumnSpans=function(t){var e=this._cellSpans.removeSpanByColIndex(t);if(null==e)return!1;for(var i=e.length;--i>=0;){var o=e[i];this._updateCellSpan(o.indexX,o.indexY,o,!1)}return!0},B.prototype.clearColumnCustomizations=function(){this._trackX.clearLaneCustomizations(),this._syncLayoutToColumns(0)},B.prototype.clearRowCustomizations=function(){this._trackY.clearLaneCustomizations(),this._syncLayoutToRows(0,this._rowCount)},B.prototype.getColumnScalability=function(t){return this._trackX.getLaneScalability(t)},B.prototype.setColumnScalability=function(t,e){return this._trackX.setLaneScalability(t,e)},B.prototype.getRowScalability=function(t){return this._trackY.getLaneScalability(t)},B.prototype.setRowScalability=function(t,e){return this._trackY.setLaneScalability(t,e)},B.prototype.getCell=function(t,e,i){if(i&&this._cellSpans.hasSpan()){var o=this._cellSpans.getColSpan(t,e),n=this._cellSpans.getRowSpan(t,e);o<0&&(t+=o),n<0&&(e+=n)}return this._getCell(t,e)},B.prototype.getCellContent=function(t,e){var i=this.getCell(t,e);return null!==i?i.getContent():null},B.prototype.setCellContent=function(t,e,i){var o=this.getCell(t,e);return null==o?(window.console.log("Error: Accessing nonexistent cell in Grid's Table"),null):o.setContent(i)},B.prototype.getColumnCount=function(){return this._colCount},B.prototype.setColumnCount=function(t){if(t<0&&(t=0),this._colCount!==t){var e=this._colCount;this._trackX.setLaneCount(t),this._colCount=this._trackX.getLaneCount();var i=0,o=null;if(e>t)for(i=e;--i>=t;)(o=this._columns.pop()).dispose(),o===this._firstColumn&&(this._firstColumn=null),o===this._lastColumn&&(this._lastColumn=null);else for(i=e;i<t;++i)o=this._newColumn(i);for(this._updateColumnIndices(),i=e;i<t;++i)this._columns[i].activate(!this._colVir);t<=0&&this._selectionList.clearAllSelections()}},B.prototype.getRowCount=function(){return this._rowCount},B.prototype.setRowCount=function(t,e){if(t<0&&(t=0),this._rowCount!==t){var i,o=this._rowCount;for(this._trackY.setLaneCount(t),this._rowCount=this._trackY.getLaneCount(),this._ctxRows.setItemCount(t),this._stretchedCells.setCellCount(t),i=0;i<this._colCount;++i)this._columns[i].setCellCount(t);if(o>t)if(t<this._rowHighlightIndex&&this.setRowHighlight(-1),t<this._activeRowEnd&&(this._activeRowEnd=t),t<this._availableRowCount&&(this._availableRowCount=t),this._cellSpans.removeSpanStartedFromRowIndex(t),this._updateViewHeight(),t>0)for(var n=t;n<o;++n)this._selectionList.deselect(n);else this._selectionList.clearAllSelections();else this._syncLayoutToRows(o,t);var r={};r.prevCount=o,r.rowCount=this._rowCount,this._dispatch("rowCountChanged",r),o<t&&this._insertCells(0,this._rowCount)}},B.prototype.getVisibleRowCount=function(){return this._rowCount-this._hiddenRowCount},B.prototype.addRow=function(t){t<=0||(this._colCount<=0?window.console.log("WARNING: Row cannot be added, unless at least one column is added"):this.setRowCount(this._rowCount+t))},B.prototype.removeRow=function(t){t<=0||(t>this._rowCount&&(t=this._rowCount),this.setRowCount(this._rowCount-t))},B.prototype.setBorders=function(t,e,i,o){},B.prototype.getColumnStyle=function(t,e){var i=this._columns[t];return i?i.getStyle(e):null},B.prototype.setColumnStyle=function(t,e,i){var o=this._columns[t];o&&o.setStyle(e,i)},B.prototype.enableColumnClass=function(t,e,i){var o=this._columns[t];o&&o.enableClass(e,i)},B.prototype.hasColumnClass=function(t,e){var i=this._columns[t];return!!i&&i.hasClass(e)},B.prototype.enableRowClass=function(t,e,i){if(t>=0&&t<this._rowCount)for(var o=0;o<this._colCount;++o)this._columns[o].getCell(t).enableClass(e,i)},B.prototype.setRowStyle=function(t,e,i,o){if(t>=0&&t<this._rowCount){i&&(null==o||o)||(i="");for(var n=0;n<this._colCount;++n)this._columns[n].getCell(t).setStyle(e,i)}},B.prototype.getRelativePosition=function(t){return o.getRelativePosition(t,this._element)},B.prototype.getContentWidth=function(){return this._trackX.getTrackSize()},B.prototype.getContentHeight=function(){var t=this._trackY.getTrackSize();if(t<=0&&this._colCount*this.getVisibleRowCount()>0){var e=this._columns[0],i=e.getCell(this._rowCount-1);return i.getTop()+i.getHeight()-e.getCell(0).getTop()}return t},B.prototype.getCellsByRowIndex=function(t){if(t<0||t>=this._rowCount)return null;for(var e=new Array(this._colCount),i=0;i<this._colCount;++i)e[i]=this._columns[i].getCell(t);return e},B.prototype.disableHorizontalGridLine=function(t){this.enableClass("no-horizontal-grid-line",!1!==t)},B.prototype.disableVerticalGridLine=function(t){this.enableClass("no-vertical-grid-line",!1!==t)},B.prototype.enableShading=function(t){!1!==t?this.addClass("tr-even-shading"):(this.removeClass("tr-even-shading"),this.removeClass("tr-odd-shading"))},B.prototype.setTransposedShading=function(t){this.enableClass("transposed-shading",!1!==t)},B.prototype.enableRowHighlighting=function(t){null==t&&(t=!0),this._rowHighlightEnabled!==t&&(this._rowHighlightEnabled=t,this._rowHighlightEnabled?(this.listen("mousemove",this._onMouseMove),this.listen("mouseout",this._onMouseOut)):(this.setRowHighlight(-1),this.unlisten("mousemove",this._onMouseMove),this.unlisten("mouseout",this._onMouseOut)))},B.prototype.getRowHighlight=function(){return this._rowHighlightIndex},B.prototype.setRowHighlight=function(t){if((!this._rowHighlightEnabled||t<-1||t>=this._rowCount)&&(t=-1),this._rowHighlightIndex!==t){var e=this._rowHighlightIndex;this._rowHighlightIndex=t;for(var i=this._highlightedCells.length;--i>=0;)this._highlightedCells[i].removeClass("highlighted-row");if(t>=0&&t<this._rowCount){this._highlightedCells.length=this._colCount;for(var o=this._colCount;--o>=0;){var n=this._columns[o].getCell(t);this._highlightedCells[o]=n,n.addClass("highlighted-row")}var r=this.getStretchedCell(t);r&&(this._highlightedCells.push(r),r.addClass("highlighted-row"))}else this._highlightedCells.length=0;if(this._hasListener("rowHighlighted")){var s={};s.prevRowIndex=e,s.rowIndex=t,this._dispatch("rowHighlighted",s)}}},B.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},B.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},B.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},B.prototype.setSelectedRow=function(t,e){t<0||t>=this._rowCount||(this._selectionList.setSelection(t,e),this._updateSelectionUI(t))},B.prototype.selectSingleRow=function(t){t<0||t>=this._rowCount||(this.clearSelectedRows(),this._selectionList.select(t),this._addSelectionUI(t))},B.prototype.selectRowRange=function(t,e){if(!(t<0||t>=this._rowCount)){t+e>this._rowCount&&(e=this._rowCount-t),this._selectionList.selectRange(t,e);for(var i=0;i<e;++i)this._addSelectionUI(i+t)}},B.prototype.clearSelectedRows=function(){var t=this._selectionList.getSelectionCount();if(t){var e=this._selectionList.getAllSelections();this._selectionList.clearAllSelections();for(var i=0;i<t;++i)this._removeSelectionUI(e[i]);return t}return 0},B.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},B.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},B.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},B.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},B.prototype.activateColumn=function(t,e){var i=this._columns[t];if(i){var o=i.activate(e);if(e&&o&&this._rightSpace){var n=this._rightSpace.parentNode;n&&n.appendChild(this._rightSpace)}}},B.prototype.activateRows=function(){this._onEnterDocument()},B.prototype.moveRowsToTop=function(t){this._ctxRows.moveItemsToTop(t),this._stretchedCells.moveCellsToTop(t);for(var e=0;e<this._colCount;++e)this._columns[e].moveCellsToTop(t)},B.prototype.getFirstIndexInView=function(){return 0},B.prototype.getLastIndexInView=function(){return this._availableRowCount-1},B.prototype.isInCurrentView=function(t){return 0!==this._rowCount&&t>=0&&t<this._rowCount},B.prototype.getFrozenLayout=function(){return this._frozenLayout},B.prototype.setFrozenLayout=function(t){this.isVisible()||(t=!0),this._frozenLayout!==t&&(this._frozenLayout=t,this._cellSpans.freezeMapping(this._frozenLayout),this._frozenLayout||(this._syncLayoutToColumns(0),this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)))},B.prototype.getColumn=function(t){return this._columns[t]||null},B.prototype.insertColumn=function(t,e){t<0?t=0:t>this._colCount&&(t=this._colCount);var i=t<this._colCount,o=this._cellSpans.getAllSpans();this._updateCellSpans(o,!1),this._trackX.insertLane(t,e),this._colCount=this._trackX.getLaneCount();var n=this._newColumn(t);if(this._updateColumnIndices(),this._cellSpans.shiftColumn(t,1)&&(o=this._cellSpans.getAllSpans()),this._updateCellSpans(o,!0),this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._selectionList.getSelectionCount())for(var r=this._selectionList.getAllSelections(),s=r.length;--s>=0;){var l=n.getCell(r[s]);l&&l.addClass("selected-row")}return n.activate(i||!this._colVir),n},B.prototype.removeColumnAt=function(t){var e=this._trackX.removeLaneAt(t);if(null==e)return null;var i=this._cellSpans.getAllSpans();this._updateCellSpans(i,!1),this._colCount=this._trackX.getLaneCount();var o=this._columns.splice(t,1)[0];return o.dispose(),e.control=o,this._updateColumnIndices(),this._cellSpans.removeColumn(t)&&(i=this._cellSpans.getAllSpans()),this._updateCellSpans(i,!0),this._syncLayoutToColumns(t),t>=this._colCount&&this._updateCssWidth(),e},B.prototype.moveColumn=function(t,e){if(t<0)t=0;else if(t>=this._colCount)return;if(e<0?e=0:e>=this._colCount&&(e=this._colCount-1),t!==e){var i=this._cellSpans.getAllSpans();this._updateCellSpans(i,!1),this._trackX.moveLane(t,e);var n=this._columns[t];if(o.moveArrayItem(this._columns,t,e),n.getElement().offsetParent){for(var r=e+1,s=this._columns[r]||null;s&&!s.getElement().offsetParent;)s=this._columns[++r];n.insertBefore(s)}this._updateColumnIndices(),this._updateCellSpans(i,!0);var l=t<e?t:e;this._syncLayoutToColumns(l)}},B.prototype.enableRowVirtualization=function(){console.log("WARNING: This function is deprecated")},B.prototype.enableColumnVirtualization=function(t){this._colVir=!1!==t},B.prototype.getColumnIndex=function(t){if(t){if(t.stretched)return this._stretchedCells.getColumnIndex(t);for(var e=this._columns.length,i=0;i<e;++i)if(this._columns[i].getElement()===t)return i}return-1},B.prototype.getCellIndex=function(t,e){if(e){if(e.stretched)return this._stretchedCells.getRowIndex(e);var i=this._columns[t];if(i)return i.getCellIndex(e)}return-1},B.prototype.getIndex=function(){return this._index},B.prototype.setIndex=function(t){this._index=t},B.prototype.getRowOffset=function(){return this._rowOffset},B.prototype.setRowOffset=function(t){this._rowOffset=t},B.prototype.updateLayout=function(){this._calculateViewSize(!0),this._stretchedCells.updateCells(),this._updateRightSpaceStyle()},B.prototype.stretchCell=function(t,e,i,o){var n=-1;if("number"==typeof t?(n=t,null==e&&(e=0)):t&&(t.stretched?(n=this._stretchedCells.getColumnIndex(t),null==e&&(e=this._stretchedCells.getRowIndex(t))):t.getParent&&(n=this.getColumnIndex(t.getParent()))),n<0||e<0||null==e)return null;var r=null;if(!1!==i){var s=this._coverLayer;s||((s=this._coverLayer=document.createElement("div")).className="cover-layer",this._updateLayers()),this._calculateViewSize(),(r=this._stretchedCells.stretchCell(e,o?n:0)).setParent(s)}else r=this._stretchedCells.unstretchCell(e);if(r){var l=this._selectionList.getSelection(e);r.enableClass("selected-row",l)}return r},B.prototype.unstretchCell=function(t,e){return this.stretchCell(t,e,!1)},B.prototype.unstretchAllCells=function(){this._stretchedCells.unstretchAllCells()},B.prototype.getStretchedCell=function(t,e){return null==e&&(e="number"==typeof t?t:this._stretchedCells.getRowIndex(t)),"number"==typeof e?this._stretchedCells.getCell(e):null},B.prototype.getStretchedCells=function(){return this._stretchedCells.getCells()},B.prototype.updateStretchedCells=function(){this._updateLayers();var t=this._coverLayer?this._coverLayer.children.length:0;return!(t<=0||(this._calculateViewSize(!0),this._stretchedCells.updateCells(),!t))},B.prototype._calculateViewSize=function(t){if(this._frozenLayout)return this._stretchedCells.getStretchSize();var e=this._ctx,i=t?0:this._stretchedCells.getStretchSize();if(!i&&e&&e.getWidth){var o=this.getContentWidth();return(i=e.getWidth())?(o<i&&(i=o),this._stretchedCells.setStretchSize(i),i):o}return i},B.prototype._enableStretchCellClass=function(t,e,i){var o=this.getStretchedCell(t);o&&o.enableClass(e,i)},B.prototype._getViewSize=function(){return this._calculateViewSize()},B.prototype.getColumnHost=function(){return this._element},B.prototype.setHidingMethod=function(t){this._hidingMethod=t},B.prototype.getHidingMethod=function(){return this._hidingMethod},B.prototype.setColumnVisibility=function(t,e,i){return!!this._trackX.hideLane(t,!e,i)&&(this._syncLayoutToColumns(t),!0)},B.prototype.getRowLayout=function(){return this._trackY},B.prototype.reserveRightSpace=function(t){if(t&&t>0){if(!this._rightSpace){var e=this._rightSpace=document.createElement("div");e.className="tr-reserved-space",e.style.height=this.getContentHeight()+"px",this._updateLayers()}this._rightSpace.style.width=t+"px",this._rightSpaceSize=t,this._updateCssWidth()}else if(this._rightSpace){var i=this._rightSpace.parentNode;i&&i.removeChild(this._rightSpace),this._rightSpace=null,this._rightSpaceSize=0,this._updateCssWidth()}return this._rightSpace},B.prototype._updateRightSpaceStyle=function(){var t=this._rightSpace;if(t){var e=!1,i=0;this._hscrollbar&&(e=this._hscrollbar.isActive(),i=this._hscrollbar.getPinnedRightColumnCount()),e&&!i?(t.style.top=this._trackY.getLaneStart(this._activeRow)+"px",t.style.left=this._trackX.getLaneStart(this._colCount)+"px",t.style.position="",t.style.display=""):(t.style.position="static",t.style.display="inline-block")}},B.prototype._updateLayers=function(){if(this._rightSpace){var t=this._rightSpace.parentNode;t?t.appendChild(this._rightSpace):this._element.appendChild(this._rightSpace)}this._boundLayer&&this._element.appendChild(this._boundLayer),this._coverLayer&&this._element.appendChild(this._coverLayer)},B.prototype.getReservedSpace=function(){return this._rightSpace},B.prototype.getComputedStyle=function(){var t=this._element;return t.offsetParent?getComputedStyle(t):null},B.prototype.isColumnActive=function(t){var e=this._columns[t];return!!e&&e.isActive()},B.prototype.setRowAttributes=function(t,e){if(!(t<0||t>=this._rowCount))for(var i=0;i<this._colCount;++i)for(var o=e(i),n=o.length;--n>=0;){var r=o[n],s=this._columns[i].getCell(t);s&&(r.remove?s.removeAttribute(r.attribute):s.setAttribute(r.attribute,r.value))}},B.prototype.getContextRow=function(t){return this._ctxRows.getItem(t)},B.prototype.selectColumn=function(t,e){this.enableColumnClass(t,"selected-column",e),e&&(this._colSelDirty=!0,this._boundLayer||(this._initBoundLayer(),this._updateLayers()))},B.prototype.isSelectedColumn=function(t){return this.hasColumnClass(t,"selected-column")},B.prototype.selectCell=function(t,e,i){var o=this._getCell(t,e);o&&o.enableClass("selection",i)},B.prototype.setCellBounds=function(t,e,i,o){},B.prototype.getHorizontalLayout=function(){return this._trackX},B.prototype.calculateColumnBounds=function(t,e,i,o){var n=0,r=0,s=!1,l=!1,a=this._trackX.getLaneCount();if(t>=0&&(n=this._trackX.getLaneStart(t),r=this._trackX.getLaneEnd(e)),n<r){var h,u,p=0,_=0,c=0,d=0;this._hscrollbar&&(_=this._hscrollbar.getScrollLeft(),c=this._hscrollbar.getPinnedLeftColumnCount(),d=this._hscrollbar.getPinnedRightColumnCount()),h=u=this._trackX.getTrackSize(),c&&(p=this._trackX.getLaneStart(c)),d&&(a-=d,h=this._getViewSize()-u+this._trackX.getLaneStart(a)),t>=c&&t<a?(n-=_)<p?(n=p,s=!0):n>h&&(n=h,s=!0):t>=a&&(n=this._getViewSize()-u+this._trackX.getLaneStart(t)),e>=c&&e<a?(r-=_)<p?(r=p,l=!0):r>h&&(r=h,l=!0):e>=a&&(r=this._getViewSize()-u+this._trackX.getLaneEnd(e))}i[0]=n,i[1]=r,o[0]=s,o[1]=l},B.prototype.updateColumnBounds=function(t,e,i){if(this._colSelDirty){var o=this._colBounds,n=this._colBoundCache;o||(o=this._colBounds=[]),n||(n=this._colBoundCache=[]);var r,s=t.length,l=null,a=null,h=o.length;for(r=s;r<h;++r)(l=(a=o[r]).parentNode)&&l.removeChild(a);if(o.length=h=s,s)for(r=0;r<s;++r){var u=t[r],p=e[r],_=u[0],c=u[1];(a=n[r])||((a=n[r]=document.createElement("div")).className="selection-bound column-bound"),a.style.left=_+"px",a.style.width=c-_+"px",i=i||0,a.style.top=i+"px",a.style.height=this._trackY.getTrackSize()-i+"px",a.classList.toggle("no-left-bound",p[0]),a.classList.toggle("no-right-bound",p[1]),this._boundLayer&&(o[r]||(o[r]=a,this._boundLayer.appendChild(a)))}else this._colSelDirty=!1}},B.prototype.updateColumnSeparators=function(){var t=this._hscrollbar.getPinnedLeftColumnCount(),e=this._hscrollbar.getPinnedRightColumnCount();!t&&!e||this._boundLayer||this._initBoundLayer();var i=!1;this._hscrollbar&&(i=this._hscrollbar.isActive());var o=this._boundLayer,n=this._leftColumnSeparator;if(i&&t){n||(n=this._leftColumnSeparator=this._createColumnSeparator()),n.parentNode||(o.children.length?o.insertBefore(n,o.children[0]):o.appendChild(n));var r=this._trackX.getLaneStart(t);n.style.left=r-1+"px",n.style.height=this._trackY.getTrackSize()+"px"}else n&&n.parentNode&&this._boundLayer.removeChild(n);if(n=this._rightColumnSeparator,i&&e){n||(n=this._rightColumnSeparator=this._createColumnSeparator()),n.parentNode||(o.children.length?o.insertBefore(n,o.children[0]):o.appendChild(n));var s=this.getColumnCount(),l=this._trackX.getLaneEnd(s-1)-this._trackX.getLaneStart(s-e),a=this._getViewSize();n.style.left=a-l-this._rightSpaceSize+"px",n.style.height=this._trackY.getTrackSize()+"px"}else n&&n.parentNode&&this._boundLayer.removeChild(n)},B.prototype._createColumnSeparator=function(){var t=document.createElement("div");return t.classList.add("column-separator"),t},B.prototype._initBoundLayer=function(){var t=this._boundLayer;return t||((t=this._boundLayer=document.createElement("div")).className="cover-layer",this._element.appendChild(t)),t},B.prototype._getCell=function(t,e){var i=this._columns[t];return i?i.getCell(e):null},B.prototype._insertCells=function(t,e){this._activeRow=t,this._activeRowEnd=e;for(var i=this._trackY.getLaneStart(t),o=0;o<this._colCount;++o){var n=this._columns[o];n.hasCollapsedCells()||n.setTop(i),n.activateCells(t,e)}if(this._rightSpace&&(this._rightSpace.style.top=i+"px"),e>this._availableRowCount){var r={};r.prevRowIndex=this._availableRowCount,r.rowIndex=e,this._availableRowCount=e,this._dispatch("rowAvailable",r)}},B.prototype._newColumn=function(t){var e=new w(this._virOwner||this);e.setHeight(this._trackY.getDefaultLaneSize()),e.setCellCount(this._rowCount),e.setTop(this._trackY.getLaneStart(this._activeRow)),e.activateCells(this._activeRow,this._activeRowEnd);for(var i=0;i<this._rowCount;++i)this._trackY.isAtDefaultSize(i)||e.getCell(i).setHeight(this._trackY.getLaneSize(i));if(t>=this._columns.length)this._columns.push(e),e.setParent(this._element);else{this._columns.splice(t,0,e);var o=this._columns[t+1];e.insertBefore(o)}return e},B.prototype._updateCssWidth=function(){this._frozenLayout||(this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._element.style.width=this._getWidth()+"px")},B.prototype._updateViewHeight=function(){if(!this._frozenLayout){var t=this.getContentHeight();this._element.style.height=t+"px",this._rightSpace&&(this._rightSpace.style.height=t+"px")}},B.prototype._updateColumnIndices=function(){var t=this._columns.length,e=this._columns[0];e!==this._firstColumn&&(this._firstColumn&&this._firstColumn.removeClass("first"),this._firstColumn=e,this._firstColumn&&this._firstColumn.addClass("first"));var i=this._columns[t-1];i!==this._lastColumn&&(this._lastColumn&&this._lastColumn.removeClass("last"),this._lastColumn=i,this._lastColumn&&this._lastColumn.addClass("last"));for(var o=null,n=this._columns.length;--n>=0;){var r=this._columns[n];r.setNextSibling(o),o=r}},B.prototype._syncLayoutToColumns=function(t){if(this._frozenLayout)return!1;if(this._rightSpace&&(this._rightSpace.style.left=this._trackX.getLaneStart(this._colCount)+"px"),t>=this._colCount)return!1;for(var e=t;e<this._colCount;++e){var i=this._columns[e];i.setLeft(this._trackX.getLaneStart(e)),i.setWidth(this._trackX.getLaneSize(e))}return this._updateCellSpanLayout(this._cellSpans.getAllSpans()),this._updateCssWidth(),!0},B.prototype._syncLayoutToRows=function(t,e){if(!this._frozenLayout){for(var i=t;i<e;++i)for(var o=this._trackY.isAtDefaultSize(i)?-1:this._trackY.getLaneSize(i),n=0;n<this._colCount;++n)this._columns[n].getCell(i).setHeight(o);this._stretchedCells.updateYAxis(),t?this._updateCellSpanLayout(this._cellSpans.getAllSpans()):this._updateCellSpans(this._cellSpans.getAllSpans(),!0),this._updateViewHeight()}},B.prototype._dispatchRowHeightChangedEvent=function(t,e){if(this._hasListener("rowHeightChanged")&&!(t>=e)){var i={};i.rowIndex=t,i.changeLength=e-t,this._dispatch("rowHeightChanged",i)}},B.prototype._updateCellSpanSize=function(t,e,i){var o=this._getCell(t,e);if(null!=o)if(i&&i.colSpan>1?(o.setWidth(this.getCellWidth(t,e)),this._columns[t].disableDeactivation()):o.setWidth(-1),i&&i.rowSpan>1)o.setHeight(this.getCellHeight(t,e));else{var n=this._trackY.isAtDefaultSize(e)?-1:this._trackY.getLaneSize(e);o.setHeight(n)}},B.prototype._updateCellSpanLayout=function(t){if(null!=t)for(var e=t.length;--e>=0;){var i=t[e];this._updateCellSpanSize(i.indexX,i.indexY,i)}},B.prototype._updateCellSpan=function(t,e,i,o){this._updateCellSpanSize(t,e,o?i:null),this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,o)},B.prototype._updateCellSpanClass=function(t,e,i,o,n){for(var r,s=0;s<i&&(r=this._columns[t+s]);++s)r.collapseCells(e,o,n,0===s,s>0);var l=this._getCell(t,e);l&&(l._colSpan=n?i:1,l._rowSpan=n?o:1)},B.prototype._updateCellSpans=function(t,e){if(null!=t)for(var i=t.length;--i>=0;){var o=t[i];this._updateCellSpan(o.indexX,o.indexY,o,e)}},B.prototype._onMouseMove=function(t){var e=t.target,i=o.closestElement(e,"cell"),n=this._stretchedCells.getColumnIndex(i);if(n<0){var r=o.closestElement(e,"column");n=this.getColumnIndex(r)}var s=this.getCellIndex(n,i);this.setRowHighlight(s)},B.prototype._onMouseOut=function(t){var e=t.relatedTarget;if(e)for(var i=this._element;null!==e.parentNode;)if((e=e.parentNode)===i)return;this.setRowHighlight(-1)},B.prototype._updateSelectionUI=function(t){var e=this._selectionList.getSelection(t);this._enableStretchCellClass(t,"selected-row",e),this.enableRowClass(t,"selected-row",e)},B.prototype._addSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!0),this.enableRowClass(t,"selected-row",!0)},B.prototype._removeSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!1),this.enableRowClass(t,"selected-row",!1)},B.prototype._onEnterDocument=function(){if(!this._initialized&&this.getParent()){for(var t=0;t<this._colCount;++t)this._columns[t].enableAutoStyleUpdating();this._syncLayoutToColumns(0),this._initialized=!0}},B.prototype._setContext=function(t){this._ctx=t},B.prototype._getContext=function(){return this._ctx},B.prototype._resetTransformIETimer=function(){o.isIE&&(this._transformIETimer||(this.enableClass("reset-transform"),this._transformIETimer=setTimeout(this._onResetTransformIE,20)))},B.prototype._onResetTransformIE=function(){this._transformIETimer=0,this.enableClass("reset-transform",!1)},B._proto=B.prototype;const N=B;var W=function(t){for(var e in t)return!1;return!0},Y=function(t,e,i){var o=e[i];if(null!=o){var n=t[i];Array.isArray(n)?t[i]=n.concat(o):Array.isArray(o)&&n?t[i]=o.concat(n):t[i]=o}},X=function(){this._groupMap={},this._childToParent={}};X.prototype._groupMap,X.prototype._childToParent,X.getGroupId=function(t){return t&&t.id||""},X.calcTreeDepth=function(t,e){for(var i=-1,o=e;o;){if(++i>15){console.log("WARNING: Infinite loop detected during column group creation");break}o=t[o.parentId]}return i},X.getLeafDescendants=function(t,e){var i=t[e];if(!i)return null;for(var o=[],n=[i],r=0,s={};r<n.length;){s[(i=n[r++]).id]=!0;for(var l=i.children,a=l?l.length:0,h=0;h<a;++h){var u=l[h];(i=t[u])?s[i.id]||n.push(i):o.push(u)}}return o},X._cloneObject=function(t){var e=function(t,e){return function(t,e,i){if(!t)return null;if(!e||t===e)return t;var o;if(i)for(var n=i.length,r=0;r<n;++r)(o=i[r])&&Y(t,e,o);else for(o in e)Y(t,e,o);return t}({},t,e)}(t);return Array.isArray(e.children)?e.children=e.children.slice():e.children=[],e},X._toGroupDefinition=function(t,e){var i=null;return t&&(i=Array.isArray(t)?{children:t.slice()}:X._cloneObject(t),e&&(i.id||(i.name=e),i.id=e)),i},X.prototype.toString=function(){var t=this._groupMap,e=[];for(var i in e.push("=== groupDefs ==="),t){var o=t[i];e.push(i+": "+JSON.stringify(o,["id","parentId","children"]))}return e.push("=== childToParent ==="),e.push(JSON.stringify(this._childToParent,null,2)),e.push(""),e.join("\n")},X.prototype.getGroup=function(t){return t&&this._groupMap[t]||null},X.prototype.getDefinition=X.prototype.getGroup,X.prototype.getGroups=function(){var t=[],e=this._groupMap;for(var i in e)t.push(e[i]);return t},X.prototype.getGroupIds=function(){return Object.keys(this._groupMap)},X.prototype.getGroupMap=function(){return this._groupMap},X.prototype.cloneGroupMap=function(){var t=this._groupMap,e={};for(var i in t){var o=t[i],n=X._cloneObject(o);e[i]=n}return e},X.prototype.rebuildMap=function(){var t,e,i=this._groupMap,o=this._childToParent={},n=Object.keys(i),r=n.length;for(t=0;t<r;++t)for(var s=i[e=n[t]].children,l=s?s.length:0,a=0;a<l;a++)o[s[a]]=e;for(t=0;t<r;++t){var h=o[e=n[t]];h&&(i[e].parentId=h)}},X.prototype.getGroupChildren=function(t){var e=this._groupMap[t];return e?e.children:null},X.prototype.getLeafDescendants=function(t){return X.getLeafDescendants(this._groupMap,t)},X.prototype.getGroupLevel=function(t){return X.calcTreeDepth(this._groupMap,this._groupMap[t])},X.prototype.getRootGroup=function(t){if(!t)return null;var e=this._groupMap,i=e[t]||null;if(i)for(;i.parentId;){var o=e[i.parentId];if(!o)break;i=o}return i},X.prototype.getParentGroup=function(t){return this.getGroup(this._childToParent[t])},X.prototype.getParentIds=function(t){if(t&&"string"==typeof t){var e=this._childToParent[t];if(e){for(var i=[e],o=this._groupMap[e];o&&o.parentId;)(o=this._groupMap[o.parentId])&&i.push(o.id);return i}}return null},X.prototype.getParentId=function(t,e){var i=this._childToParent[t];if(null!=e)for(var o=this.getGroupLevel(i);o>e&&i;)i=this._childToParent[i],o--;return i||""},X.prototype.removeAllGroups=function(){for(var t in this._groupMap)return this._groupMap={},this._childToParent={},!0;return!1},X.prototype.setGroups=function(t){for(var e=this._groupMap={},i=t?t.length:0,o=0;o<i;o++){var n=t[o],r=n.id;r&&(e[r]=X._cloneObject(n))}this.rebuildMap()},X.prototype.addGroup=function(t){var e=X.getGroupId(t);return e?this.setGroup(e,t):e},X.prototype.removeGroup=function(t){return!!this._groupMap[t]&&(this.removeAllChildren(t),this.unsetParent(t),delete this._groupMap[t],!0)},X.prototype.setGroup=function(t,e){if(!t)return"";if(e){var i=X._toGroupDefinition(e,t);this._ungroupChildren(i.children),this._groupMap[t]&&this.removeAllChildren(t);var o=this._childToParent[t];o&&(i.parentId=o.id),this._groupMap[t]=i;for(var n=i.children,r=n.length,s=0;s<r;++s){var l=n[s];this._childToParent[l]=t;var a=this._groupMap[l];a&&(a.parentId=t)}}else if(!this.removeGroup(t))return"";return t},X.prototype._ungroupChildren=function(t){if(Array.isArray(t))for(var e=t.length,i=0;i<e;++i)this.unsetParent(t[i])},X.prototype.hasGroupChild=function(t,e){var i=this._groupMap[t];if(e&&i){var o=i.children;if(o)return o.indexOf(e)>=0}return!1},X.prototype.contains=function(t,e){if(t&&e){if(t===e)return!0;for(var i=20,o=this._childToParent[e];o&&i;){if(t===o)return!0;--i,o=this._childToParent[o]}}return!1},X.prototype.addGroupChild=function(t,e,i){var o=this._groupMap[t];if(e&&o){var n=o.children;if(n&&n.indexOf(e)<0){this.unsetParent(e),this._childToParent[e]=t;var r=this._groupMap[e];return r&&(r.parentId=t),null!=i&&i>=0?n.splice(i,0,e):n.push(e),!0}}return!1},X.prototype.removeGroupChild=function(t,e){return null==e?this.unsetParent(t):!!this.hasGroupChild(t,e)&&this.unsetParent(e)},X.prototype.unsetParent=function(t){var e=this._childToParent[t];if(!e)return!1;this._childToParent[t]="";var i=this._groupMap[t];i&&(i.parentId="");var o=this._groupMap[e];if(o){var n=o.children;if(n&&n.length){var r=n.indexOf(t);r>=0&&n.splice(r,1)}}return!0},X.prototype.removeAllChildren=function(t){var e=this._groupMap[t];if(e){var i=e.children,o=i?i.length:0;if(o){e.children=[];for(var n=0;n<o;++n){var r=i[n];this._childToParent[r]&&(this._childToParent[r]="");var s=this._groupMap[r];s&&(s.parentId="")}return!0}}return!1},X.prototype.setGroupChildren=function(t,e){var i=this._groupMap[t];if(i){if(Array.isArray(e)){var o=e.slice();this._ungroupChildren(o),this.removeAllChildren(t),i.children=o;for(var n=i.id,r=o.length,s=0;s<r;++s){var l=o[s];this._childToParent[l]=n;var a=this._groupMap[l];a&&(a.parentId=n)}return!0}if(!e&&i.children.length)return this.removeAllChildren(t),!0}return!1},X.prototype.getGroupName=function(t){var e=this._groupMap[t];return e&&e.name||""},X.prototype.setGroupName=function(t,e){var i=this._groupMap[t];return!(!i||i.name===e||(i.name=e,0))};var q=function(){var t=this;t._rows={},t._subs={},t._staticFields={},t._onInsert=t._onInsert.bind(t),t._onUpdate=t._onUpdate.bind(t),t._onDelete=t._onDelete.bind(t),t._onBatchRequestADCData=t._onBatchRequestADCData.bind(t),t._onADCUpdate=t._onADCUpdate.bind(t),t._onADCError=t._onADCError.bind(t),t._onQ2DataChanged=t._onQ2DataChanged.bind(t),t._onQ2SubAdded=t._onQ2SubAdded.bind(t),t._onQ2SubRemoved=t._onQ2SubRemoved.bind(t),t._addEvent("dataComposed"),t._addEvent("dataChanged")};u.inherits(q,l),q.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._quotes2=null},q.prototype.setSubscriptions=function(t){this._quotes2&&(this._quotes2.removeEventListener("dataChanged",this._onQ2DataChanged),this._quotes2.removeEventListener("subscriptionAdded",this._onQ2SubAdded),this._quotes2.removeEventListener("subscriptionRemoved",this._onQ2SubRemoved)),this._quotes2=t,this._quotes2&&(this._quotes2.addEventListener("dataChanged",this._onQ2DataChanged),this._quotes2.addEventListener("subscriptionAdded",this._onQ2SubAdded),this._quotes2.addEventListener("subscriptionRemoved",this._onQ2SubRemoved))},q.prototype.getSubscriptions=function(){return this._quotes2},q.prototype.addSubscription=function(t,e,i){if(!this.getSubscription(t.id)){var o={s:t,rics:{}};this._subs[t.id]=o,this._quotes2||(t.onNewRow(this._onInsert),t.onUpdate(this._onUpdate),t.onRemoveRow(this._onDelete)),e&&(o.primary=e,i||(i={}),this._onInsert(t,e,i))}},q.prototype.removeSubscription=function(t){var e=t.id;if(t&&this._subs[e]){this._quotes2||t.stop();var i=this._subs[e].rics;for(var o in i)this.setRowData(e+o,null);delete this._subs[e]}},q.prototype.startAllSubscriptions=function(){if(this._quotes2)this._quotes2.start();else for(var t in this._subs)this._subs[t].s.start()},q.prototype.stopAllSubscriptions=function(){if(this._quotes2)this._quotes2.stop();else for(var t in this._subs)this._subs[t].s.stop()},q.prototype.getSubscription=function(t){return this._subs[t]?this._subs[t].s:null},q.prototype.getPrimaryRic=function(t){var e=this._subs[t];return e?e.primary:""},q.prototype.clearAllData=function(t){this._quotes2?this._quotes2.removeAllSubscriptions():this.stopAllSubscriptions(),this._subs={},this._rows={},this._adcTimerId>=0&&(clearTimeout(this._adcTimerId),this._adcTimerId=-1),this._adcRicMap=null,t||this._dispatchDataChange({globalChange:!0})},q.prototype.clearColumnData=function(t,e){for(var i="string"==typeof t?[t]:t,o=i.length;--o>=0;){var n=i[o];if(n)for(var r in this._rows)delete this._rows[r][n]}e||this._dispatchDataChange({globalChange:!0})},q.prototype.getData=function(t,e){var i=this.getRowData(t);return i?i[e]:null},q.prototype.getAllRics=function(){var t={};for(var e in this._subs){var i=this._subs[e].rics;for(var o in i)t[o]||(t[o]=[]),t[o].push(e)}return t},q.prototype.getAllRowIds=function(){var t=[];for(var e in this._rows)t.push(e);return t},q.prototype.hasRowId=function(t){return!!this._rows[t]},q.prototype.getColumnData=function(t){var e=[];for(var i in this._rows)e.push(this._rows[i][t]);return e},q.prototype.getRowData=function(t){return this._rows[t]||null},q.prototype.getMultipleRowData=function(t,e,i){var o=t.length;null==i&&(i=o),i>o&&(i=o),e>0||(e=0);for(var n=new Array(o),r=this._rows,s=e;s<i;++s)n[s]=r[t[s]]||null;return n},q.prototype.getAllRowData=function(){var t=[],e=this._rows;for(var i in e)t.push(e[i]);return t},q.prototype.setData=function(t,e,i){var o={};return o[e]=i,this.setRowData(t,o)},q.prototype.hasDataCloudData=function(t){if(!this._adcFields)return!1;var e=this.getRowData(t);if(!e)return!1;for(var i=this._adcFields.length;--i>=0;)if(null!=e[this._adcFields[i]])return!0;return!1},q.prototype.setRowData=function(t,e,i){var o=this.getRowData(t),n=!1,r=null;if(e)if(o){for(var s in e)o[s]=e[s],n=!0;r=e}else o=e,this._rows[t]=o,n=!0;else o&&(delete this._rows[t],n=!0);if(n&&!this._composing){var l=i||{};l.rid=t,r&&(l.changes=r),l.rowData=o,this._dispatchDataChange(l)}return n},q.prototype.cloneRowData=function(t){var e=this._rows[t];if(!e)return null;var i={};for(var o in e)0!==o.indexOf("FREE_TEXT")&&(i[o]=e[o]);return i},q.prototype.addStaticFields=function(t){if(Array.isArray(t))for(var e in t)this._staticFields[t[e]]?this._staticFields[t[e]]++:this._staticFields[t[e]]=1},q.prototype.removeStaticFields=function(t){if(Array.isArray(t))for(var e in t)this._staticFields[t[e]]&&(this._staticFields[t[e]]--,0===this._staticFields[t[e]]&&delete this._staticFields[t[e]])},q.prototype.resetStaticFields=function(){this._staticFields={}},q.prototype.getStaticFields=function(){return this._staticFields},q.prototype.dump=function(t){return q.constructTable(this.getAllRowData(),t,Object.keys(this._rows))},q.prototype.log=function(t){console.table(this.dump(t))},q.prototype.setDataCloudSettings=function(t,e,i,o){null!=t&&(this._userId=t),null!=e&&(this._productId=e),null!=i&&(this._adcUrl=i),o&&(this._lang=o)},q.prototype.getDataCloudFields=function(){return this._adcFields},q.prototype.addDataCloudFields=function(t){this._adcFields||(this._adcFields=[],this._adcRefMap={});var e=[];if(t instanceof Array)for(var i=t.length;--i>=0;)this._addDataCloudField(t[i],e);else this._addDataCloudField(t,e);if(e.length<=0)return!1;var o=this.getAllRics();return this._batchRequestDataCloud(o,e),!0},q.prototype.removeDataCloudField=function(t){if(!this._adcFields)return!1;if(!this._adcRefMap[t])return!1;if(--this._adcRefMap[t],!this._adcRefMap[t]){var e=this._adcFields.indexOf(t);this._adcFields.splice(e,1),this.clearColumnData(t)}return!0},q.prototype._dispatchDataChange=function(t){this._composing||(this._composing=!0,this._dispatch("dataComposed",t),this._composing=!1,this._dispatch("dataChanged",t))},q._defaultPropertyGetter=function(t,e,i){var o=e[i];return o?o[t]:null},q._defaultGetter=function(t,e){return t[e]},q.constructTable=function(t,e,i){var o=0,n=t.length,r=n,s=null,l=i||null,a=q._defaultGetter,h=!1;if(e){if(e.rowCount&&(r=e.rowCount,h=!0),e.colNames){s={};for(var u=e.colNames.length,p=0;p<u;++p)s[e.colNames[p]]=!0;h=!0}e.getter&&(a="string"==typeof e.getter?q._defaultPropertyGetter.bind(null,e.getter):e.getter,h=!0),e.startIndex&&(o=e.startIndex,h=!0),!1===e.withRowIds&&(l=null)}if(!h&&!l)return t;for(var _=[],c=o;c<n&&!(_.length>=r);++c){var d,g=t[c],f=l?{rid:l[c]}:{};if(g)if(s)for(d in s)null!=g[d]&&(f[d]=a(g,d));else for(d in g)f[d]=a(g,d);_.push(f)}return _},q.prototype._insertRic=function(t,e,i){var o=t+(e=e.replace("0#",""));this._onADCForNewRic(t,e);var n=this.getRowData(o);if(n){var r=n.ROW_DEF;r&&r.isChain()&&(i.SUB_ID=t)}else{var s=i;for(var l in i={},s)i[l]=s[l];i.SUB_ID=t,i.RIC=e}this.setRowData(o,i)},q.prototype._onQ2DataChanged=function(t){var e=t.subId,i=t.ric,o=t.values;o?this._insertRic(e,i,o):(delete this._subs[e].rics[i],this.setRowData(e+i,null))},q.prototype._onQ2SubAdded=function(t){for(var e=t.subs,i=t.duplicateSubIds,o=e.length,n=0;n<o;++n){var r=e[n],s=r.ric;if(!(r.id.indexOf("_ci_")>=0)&&(this.addSubscription(r,s),i)){var l=i[n];l&&window.setTimeout(this._onDuplicateRic.bind(this,r.id,this.getRowData(l+s)),10)}}},q.prototype._onQ2SubRemoved=function(t){for(var e=t.subs,i=e.length,o=0;o<i;++o){var n=e[o];n.id.indexOf("_ci_")>=0||this.removeSubscription(n)}},q.prototype._onADCForNewRic=function(t,e){var i=this._subs[t];i&&(this._adcFields&&(i.rics[e]||(this._adcTimerId<0&&(this._adcRicMap={},this._adcTimerId=setTimeout(this._onBatchRequestADCData,100)),this._adcRicMap[e]||(this._adcRicMap[e]=[]),this._adcRicMap[e].push(t))),i.rics[e]=!0)},q.prototype._onDuplicateRic=function(t,e){var i=this._subs[t];if(i){var o=(i=i.s).ric,n=e.SUB_ID,r=this._cloneRowData(e,o,t);if(r){this._onInsert(i,o,r);var s=i.children;if(s)for(var l=s.length,a=0;a<l;++a)o=s[a],r=this._cloneRowData(n,o,t),this._onInsert(i,o,r)}}},q.prototype._onInsert=function(t,e,i){var o=t.id;this._quotes2?this._insertRic(o,e,i):(this._onADCForNewRic(o,e),this.setRowData(o+e,i,{subscription:t,ric:e}))},q.prototype._onUpdate=q.prototype._onInsert,q.prototype._onDelete=function(t,e,i){delete this._subs[t.id].rics[e],this.setRowData(t.id+e,null,{subscription:t,ric:e})},q.prototype._addDataCloudField=function(t,e){this._adcRefMap[t]?++this._adcRefMap[t]:(this._adcFields.push(t),e.push(t),this._adcRefMap[t]=1)},q.prototype._onADCUpdate=function(t){var e=t.currentTarget,i=null;try{i=JSON.parse(e.responseText)}catch(t){return}if("Ok"===i.status){for(var o=i.cols,n=i.rows,r=n[0],s=-1,l={},a=0;a<o;++a){var h=r[a];"instrument"===h.i?s=a:h.r&&(l[h.r]=a)}for(var u=n.length,p=1;p<u;++p){var _=n[p],c=_[s],d={};for(var g in l){var f=_[l[g]];null!=f&&null!==f&&null==f.f&&(this._quotes2?(d[g]=f,d[g+"_FORMATTED"]=f):d[g]={formatted:f+"",raw:f})}var y=e.ricMap[c];if(y)for(a=y.length;--a>=0;){var m=y[a];this._subs[m]&&this.setRowData(m+c,d)}}}},q.prototype._onADCError=function(t){window.console.log(t)},q.prototype._onBatchRequestADCData=function(t){this._adcTimerId<=0||(this._adcTimerId=-1,this._batchRequestDataCloud(this._adcRicMap,this._adcFields),this._adcRicMap=null)},q.prototype._batchRequestDataCloud=function(t,e){if(!this._adcUrl)return null;var i=[];for(var o in t)i.push(o);for(;i.length>30;)this._requestDataCloud(t,e,i.splice(0,30));return this._requestDataCloud(t,e,i)},q.prototype._requestDataCloud=function(t,e,i){if(!i||i.length<=0)return null;if(!e||e.length<=0)return null;var o=new XMLHttpRequest;o.onload=this._onADCUpdate,o.onerror=this._onADCError,o.ricMap=t,o.open("POST",this._adcUrl,!0),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var n="formula="+e+"&identifiers="+i;return this._productId&&(n+="&productid="+this._productId),this._userId&&(n+="&uuid="+this._userId),this._lang&&(n+="&lang="+this._lang),o.send(n),o},q.prototype._cloneRowData=function(t,e,i){var o="string"==typeof t?t:t.SUB_ID,n=this._rows[o+e];if(!n){if("object"!=typeof t)return null;n=t}var r={};for(var s in n)null==this._staticFields[s]&&(r[s]=n[s]);return r.SUB_ID=i,r},q.prototype._rows,q.prototype._subs,q.prototype._quotes2=null,q.prototype._staticFields=null,q.prototype._adcFields=null,q.prototype._adcRefMap=null,q.prototype._adcTimerId=-1,q.prototype._adcRicMap=null,q.prototype._adcUrl="/datacloud/rest/select",q.prototype._userId="",q.prototype._productId="",q.prototype._composing=!1,q.prototype._lang="",q._proto=q.prototype;const U=q;var j=function(){};j.prototype._events=null,j.prototype._listenerCount=0,j.prototype.addEventListener=function(t,e){if(t&&e){this._events||(this._events={});var i=this._events[t];i?i.indexOf(e)<0&&(i.push(e),++this._listenerCount):(this._events[t]=[e],++this._listenerCount)}},j.prototype.removeEventListener=function(t,e){var i=this._events?this._events[t]:null;if(i){var o=i.indexOf(e);o>=0&&(i.splice(o,1),--this._listenerCount)}},j.prototype.removeAllEventListeners=function(){this._events=null,this._listenerCount=0},j.prototype.hasListener=function(t){if(this._listenerCount){if(t){var e=this._events?this._events[t]:null;return!!e&&e.length>0}return!0}return!1},j.prototype.getListener=function(t,e){if(t){var i=this._events?this._events[t]:null;if(i)return e||(e=0),i[e]||null}return null},j.prototype.addListener=function(t,e){var i=t?t[e]:null;"function"==typeof i&&this.addEventListener(e,i)},j.prototype._prepareEventArguments=function(t,e){return e},j.prototype._dispatch=function(t,e){var i=this._events?this._events[t]:null;if(i){e=this._prepareEventArguments(t,e);for(var o=i.length,n=0;n<o;++n)i[n](e)}},j.preventDefault=function(t){t&&t.preventDefault&&(t.preventDefault(),t.stopPropagation())};const K=j;var Q=function(t,e){this._rid=t,this._children={},this._shared=e};u.inherits(Q,K),Q._subSegSortLogic=function(t,e){return"Uncategorized"===t?1:"Uncategorized"===e||t<e?-1:e<t?1:0},Q._assignSubSegmentOrder=function(t,e){t.setOrder(e+1)},Q.prototype._shared=null,Q.prototype._rid,Q.prototype._children,Q.prototype._childCount=0,Q.prototype._collapsed=!1,Q.prototype._order=0,Q.prototype._disposed=!1,Q.prototype._subSegDef=null,Q.prototype._subSegLevel=0,Q.prototype._subSegMap=null,Q.prototype._subSegNames=null,Q.prototype._subSegName="",Q.prototype._subSegVal,Q.prototype._subSegParent=null,Q.prototype.dispose=function(){if(!this._disposed){this._disposed=!0,this.removeAllEventListeners();var t=this._subSegNames;if(t){for(var e=t.length,i=this._subSegMap,o=0;o<e;++o)i[t[o]].dispose();this._subSegMap=this._subSegNames=null}this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._shared=null,this._subSegParent=this._subSegDef=this._subSegVal=null}},Q.prototype.getId=function(){return this._rid},Q.prototype.getParentId=function(){return this._subSegParent?this._subSegParent.getId():""},Q.prototype.getSubSegmentIds=function(t){var e=this._subSegNames;if(e){t||(t=[]);for(var i=e.length,o=this._subSegMap,n=0;n<i;++n){var r=o[e[n]];t.push(r.getId()),r.getSubSegmentIds(t)}return t}return null},Q.prototype.addChild=function(t,e){return!(!t||(this._shared.childToSegment[t]=this._rid,this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._children[t])||(this._children[t]=e||t,++this._childCount,0))},Q.prototype.addChildren=function(t,e){var i,o=Array.isArray(t)?t:[t],n=o.length,r=0;if(null!=e)for(e=Array.isArray(e)?e:[e],i=0;i<n;++i)r|=this.addChild(o[i],e[i]);else for(i=0;i<n;++i)r|=this.addChild(o[i]);return!!r},Q.prototype.containsChild=function(t){return!!this._children[t]},Q.prototype.removeChild=function(t){return!(this._subSegLevel||!this._childCount||!this._children[t]||(delete this._shared.childToSegment[t],delete this._children[t],--this._childCount,this._collapsed&&(this._shared.dirtyCollapsingState=!0),0))},Q.prototype.removeChildren=function(t){if(this._subSegLevel)return!1;if(!this._childCount)return!1;for(var e=Array.isArray(t)?t:[t],i=e.length,o=0,n=0;n<i;++n)o|=this.removeChild(e[n]);return!!o},Q.prototype.removeAllChildren=function(){if(this._subSegLevel)return!1;if(!this._childCount)return!1;var t=this._shared.childToSegment,e=this._children;for(var i in e)t[i]&&delete t[i];return this._children={},this._childCount=0,this._collapsed&&(this._shared.dirtyCollapsingState=!0),!0},Q.prototype.getChildIds=function(){return this._childCount?Object.keys(this._children):[]},Q.prototype.getChildren=function(){return this._children},Q.prototype.getChildCount=function(){return this._childCount},Q.prototype.getClassification=function(){return this._subSegDef&&this._subSegDef.classifiers||null},Q.prototype.setClassification=function(t){if(this._subSegLevel)return!1;var e=null;this._subSegDef&&(e=this._subSegDef.classifiers);var i,o=null;t&&("string"==typeof t?o=[t]:Array.isArray(t)&&(o=t));var n=o?o.length:0;if(n){if((e?e.length:0)===n){for(i=0;i<n&&o[i]===e[i];++i);if(i>=n)return!1}return this._subSegDef||(this._subSegDef={root:this,subSegments:null}),this._subSegDef.classifiers=o,!0}return!!e&&(this._subSegDef.classifiers=null,this._subSegDef.subSegments=null,this._subSegDef=null,!0)},Q.prototype.classify=function(t){var e=this._subSegDef?this._subSegDef.classifiers:null,i=e?e.length:0,o=this._subSegNames,n=o?o.length:0;if(!n&&this._subSegLevel>=i)return!1;var r,s=this._shared;this._collapsed&&(s.dirtyCollapsingState=!0);var l="",a={},h=0,u=this._subSegMap,p=null;if(n)for(h=n,r=0;r<h;++r)a[l=o[r]]=1,(p=u[l])._childCount&&(p._children={},p._childCount=0),p._collapsed&&(s.dirtyCollapsingState=!0);var _,c=!this._subSegLevel,d=this._children;if(this._subSegLevel<i&&t){u||(u=this._subSegMap={},o=this._subSegNames=[]);var g=e[this._subSegLevel];for(_ in d){var f=d[_],y=t[f],m=y?y[g]:null;s.childToSegment[_]=this._rid,l="Uncategorized",(m||0===m||!1===m)&&(l=m+""),a[l]&&(a[l]=0,--h),(p=u[l])||((p=new Q(this._rid+"/"+l,s))._subSegDef=this._subSegDef,p._subSegLevel=this._subSegLevel+1,p._subSegName=l,p._subSegVal=m,p._subSegParent=this,u[l]=p,o.push(l),this._dispatch("subSegmentAdded",{rid:p.getId(),segment:p})),p.addChild(_,f)}}else if(c)for(_ in d)s.childToSegment[_]=this._rid;if(h>0){for(l in h>=o.length&&(o.length=0),a)if(a[l]){p=u[l],delete u[l];var v=o.indexOf(l);v>=0&&o.splice(v,1),this._dispatch("subSegmentRemoved",{rid:p.getId(),segment:p})}o.length||(o=this._subSegMap=this._subSegNames=null)}if(n=o?o.length:0)for(o.sort(Q._subSegSortLogic),r=0;r<n;++r)(p=u[o[r]]).classify(t);if(c&&this._subSegDef)if(n){var C=this._subSegDef.subSegments=[];this.getAllSubSegments(C),C.forEach(Q._assignSubSegmentOrder)}else this._subSegDef.subSegments=null;return!0},Q.prototype.hasSubSegments=function(){return!!this._subSegNames&&!!this._subSegNames.length},Q.prototype.isSubSegment=function(){return!!this._subSegLevel},Q.prototype.getFirstAncestor=function(){return this._subSegLevel&&this._subSegDef&&this._subSegDef.root||null},Q.prototype.getAllSubSegments=function(t){var e=this._subSegNames;if(e){t||(t=[]);for(var i=this._subSegMap,o=e.length,n=0;n<o;++n){var r=i[e[n]];t.push(r),r.getAllSubSegments(t)}}return t||null},Q.prototype.getSegmentLevel=function(){return this._subSegLevel},Q.prototype.setRowData=function(t,e){if(t){var i=t[this._rid];i||(i=t[this._rid]={}),e||(e=t),(i=e[this._rid])||(i=e[this._rid]={});for(var o=this;o&&o.isSubSegment();)o.getSubSegmentName(i),o=o._subSegParent}},Q.prototype.getSubSegmentName=function(t){if(t&&this._subSegLevel){var e=this.getClassification()[this._subSegLevel-1];e&&(t[e]=this._subSegName)}return this._subSegName},Q.prototype.collapse=function(t){return t=!1!==t,this._collapsed!==t&&(this._collapsed=t,this._shared.dirtyCollapsingState=!0,!0)},Q.prototype.expand=function(t){return this.collapse(!1===t)},Q.prototype.isCollapsed=function(){return this._collapsed},Q.prototype.getCollapsingStates=function(t,e){var i=this._subSegNames;if(!this._subSegLevel&&!i&&!this._collapsed)return!1;t||(t={});var o=!1;if(this._subSegLevel&&e&&(t[this._rid]=!0,o=!0),this._childCount){var n=e||this._collapsed;if(i)for(var r=this._subSegMap,s=i.length,l=0;l<s;++l){var a=r[i[l]];t[a.getId()]=!!e,a.getCollapsingStates(t,n)&&(o=!0)}else if(n){var h=this._children;for(var u in h)t[u]=n;o=!0}}return o},Q.prototype.getOrder=function(){if(this._subSegLevel){var t=this.getFirstAncestor();if(t)return t.getOrder()+this._order}return 1e4*this._order},Q.prototype.getLastOrder=function(){if(this._subSegDef){var t=this._subSegDef.subSegments;if(t){var e=t[t.length-1];if(e)return e.getOrder()}}return this.getOrder()},Q.prototype.setOrder=function(t){this._order=t},Q._tabs=null,Q.prototype.log=function(t){var e,i=Q._tabs;if(!i){i=Q._tabs=[];var o="";for(e=0;e<11;++e)i[e]=o,o+=" "}var n=this._collapsed?"+ ":"- ";t.push(i[this._subSegLevel]+n+this._rid);var r=this._subSegNames;if(r){var s=r.length,l=this._subSegMap;for(e=0;e<s;++e)l[r[e]].log(t)}else if(this._childCount){var a=i[this._subSegLevel+1];for(var h in this._children)t.push(a+"- "+h)}return t};const J=Q;var $=function(){this._onSubSegmentAdded=this._onSubSegmentAdded.bind(this),this._onSubSegmentRemoved=this._onSubSegmentRemoved.bind(this),this._segments={},this._insertionList=[],this._removalList=[],this._shared={childToSegment:{},dirtyCollapsingState:!1}};u.inherits($,K),$.prototype._segments,$.prototype._segmentCount=0,$.prototype._collapsedRids=null,$.prototype._shared,$.prototype._segmentList=null,$.prototype._insertionList=null,$.prototype._removalList=null,$.prototype._classification=!1,$.prototype._classifierChanged=!1,$.prototype.dispose=function(){this.removeAllSegments(),this.removeAllEventListeners(),this._collapsedRids=null,this._segmentList=this._insertionList=this._removalList=null},$.prototype.addSegment=function(t,e){if(t&&!this._segments[t]){if(this.getParentRowId(t))return console.log("child of a segment cannot be set as a segment separator"),!1;var i=this._segments[t]=new J(t,this._shared);return i.addEventListener("subSegmentAdded",this._onSubSegmentAdded),i.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved),++this._segmentCount,this._segmentList=null,e&&e.length&&i.addChildren(e),!0}return!1},$.prototype.addSegments=function(t){for(var e=Array.isArray(t)?t:[t],i=e.length,o=0,n=0;n<i;++n)o|=this.addSegment(e[n]);return!!o},$.prototype.containsSegment=function(t){return!!this._segments[t]},$.prototype.getParentRowId=function(t){return this._shared.childToSegment[t]||""},$.prototype.removeSegment=function(t){var e=this._segments[t];if(e){if(this._segmentCount<=1)return this.removeAllSegments();e.isSubSegment()&&this._removalList.push(e.getId());var i=e.getSubSegmentIds();if(i)for(var o=i.length,n=0;n<o;++n){var r=i[n];this._segments[r]&&(this._removalList.push(r),delete this._segments[r],--this._segmentCount)}return e.removeAllChildren(),e.dispose(),delete this._segments[t],--this._segmentCount,!0}return!1},$.prototype.removeAllSegments=function(){if(this._segmentCount){for(var t in this._segments)this._segments[t].dispose();return this._segments={},this._segmentCount=0,this._segmentList=null,this._shared.childToSegment={},this._classification=this._classifierChanged=!1,!0}return!1},$.prototype.getSegmentCount=function(){return this._segmentCount},$.prototype.getSegment=function(t){return this._segments[t]||null},$.prototype.getSegments=function(){return this._segmentCount?this._segments:null},$.prototype.getSegmentIds=function(){return Object.keys(this._segments)},$.prototype.collapseSegment=function(t,e){var i=this._segments[t];return!!i&&i.collapse(e)},$.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},$.prototype.expandAllSegments=function(){if(this._segmentCount){var t=this._segments,e=0;for(var i in t)e|=t[i].expand();if(e)return!0}return!1},$.prototype.isCollapsedSegment=function(t){var e=this._segments[t];return!!e&&e.isCollapsed()},$.prototype.getCollapsedRows=function(){if(this._shared.dirtyCollapsingState){this._shared.dirtyCollapsingState=!1;var t=null,e=0;if(this._segmentCount){var i=this._segments;for(var o in t={},i){var n=i[o];n.isSubSegment()||n.getCollapsingStates(t)&&++e}}this._collapsedRids=e?t:null}return this._collapsedRids},$.prototype.addSegmentChild=function(t,e,i){var o=this._segments[t];return!(!o||o.isSubSegment())&&o.addChild(e,i)},$.prototype.addSegmentChildren=function(t,e,i){var o=this._segments[t];return!(!o||o.isSubSegment())&&o.addChildren(e,i)},$.prototype.containsSegmentChild=function(t,e){var i=this._segments[t];return!!i&&i.containsChild(e)},$.prototype.removeSegmentChild=function(t,e){var i=this._segments[t];return!!i&&i.removeChild(e)},$.prototype.removeSegmentChildren=function(t,e){var i=this._segments[t];return!!i&&i.removeChildren(e)},$.prototype.removeAllSegmentChildren=function(){this._shared.childToSegment={};var t=this._segments,e=!1;for(var i in t)t[i].removeAllChildren()&&(e=!0);return e&&this.classify(null),e},$.prototype.fillSegment=function(t,e){var i=Array.isArray(e)?e.length:0;if(i){var o=this._segments,n=o[t];if(n&&!n.isSubSegment()){var r=e.indexOf(t);if(r>=0){n.removeAllChildren();for(var s=r+1;s<i;++s){var l=e[s];if(o[l])break;n.addChild(l)}}}}},$.prototype.fillSegments=function(t){this._shared.childToSegment={};for(var e=Array.isArray(t)?t.length:0,i=this._segments,o=null,n=!1,r=0;r<e;++r){var s=t[r],l=i[s];l&&!l.isSubSegment()?(o=l).removeAllChildren():o&&!o.isSubSegment()&&(o.addChild(s),n=!0)}return n},$.prototype.calcSegmentOrder=function(t){var e=this._segmentList;e?e.length=0:e=this._segmentList=[];for(var i=t?t.length:0,o=this._segments,n=this._segmentCount,r=0,s=0;s<i;++s){var l=o[t[s]];if(l&&(l.isSubSegment()||(this._segmentList.push(l),l.setOrder(++r)),--n<=0))break}},$.prototype.getSegmentValues=function(t,e){var i=t?t.length:0;if(!i)return null;for(var o=this._segments,n=this._shared.childToSegment,r=null,s=null,l=new Array(i),a=0,h=-10,u=0,p=0;p<i;++p){var _=t[p];if(r=o[_])a=100*r.getOrder(),u=0,r.isSubSegment()||s!==r&&(s=r,h=100*r.getLastOrder());else{var c=n[_];c?(a=100*(r=o[c]).getOrder(),u=1,e&&(h=100*r.getLastOrder())):h?(a=h,u=10):a=u=0}l[p]=a+u}return s?l:null},$.prototype.logStructure=function(){var t=this._segmentList;if(!t)return"";for(var e=t.length,i=[],o=0;o<e;++o)t[o].log(i);return i.join("\n")},$.prototype.logRowIdMap=function(){var t=[],e=this._shared.childToSegment;for(var i in e){var o=e[i];t.push(i+" > "+o)}return t.join("\n")},$.prototype.setSegmentClassification=function(t,e){var i=this._segments[t];return!(!i||!i.setClassification(e)||(i.getClassification()&&(this._classification=!0),this._classifierChanged=!0,0))},$.prototype.hasClassification=function(){return this._classification||this._classifierChanged},$.prototype.classify=function(t){if(!this._segmentCount)return!1;if(!this.hasClassification())return!1;this._classification=this._classifierChanged=!1;var e=this._segments;for(var i in e){var o=this._segments[i];o.isSubSegment()||(o.getClassification()&&(this._classification=!0),o.classify(t))}return this._insertionList.length||this._removalList.length?(this._dispatch("subSegmentChanged",{insertionList:this._insertionList,removalList:this._removalList}),this._insertionList.length=0,this._removalList.length=0,this._dispatch("classified",{}),!0):(this._dispatch("classified",{}),!1)},$.prototype._onSubSegmentAdded=function(t){var e=t.rid;if(this._segments[e])console.log("Incorrect logic detected.");else{var i=t.segment;this._insertionList.push(i),this._segments[e]=i,this._segmentCount++,i.addEventListener("subSegmentAdded",this._onSubSegmentAdded),i.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved)}},$.prototype._onSubSegmentRemoved=function(t){var e=t.rid;this.removeSegment(e)};const Z=$;var tt=function(){tt.base(this,"constructor"),this._removeRows=this._removeRows.bind(this),this._bySegmentSeparator=this._bySegmentSeparator.bind(this),this._onClassifyingTimer=this._onClassifyingTimer.bind(this),this._onSubSegmentChanged=this._onSubSegmentChanged.bind(this),this._prevData={},this._rids=[],this._compMap={},this._addEvent("subSegmentChanged")};u.inherits(tt,U),tt.prototype._prevData=null,tt.prototype._rids,tt.prototype._frozen=!1,tt.prototype._runningId=0,tt.prototype._compMap=null,tt.prototype._segments=null,tt.prototype._autoSegmentFilling=!1,tt.prototype._removedRows=null,tt.prototype._userSegmentComparer=null,tt.prototype._segmentSortOrder=0,tt.prototype._segmentSortContext=null,tt.prototype._clsSource=null,tt.prototype._classifyingTimer=0,tt.SortLogic,tt.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._classifyingTimer&&(clearTimeout(this._classifyingTimer),this._classifyingTimer=0),this._compMap=null,this._clsSource=null,tt._removeIndexArray(),this._segments&&(this._segments.dispose(),this._segments=null)},tt.prototype.getColumnData=function(t){for(var e=new Array(this._rids.length),i=this._rids.length;--i>=0;)e[i]=this._rows[this._rids[i]][t];return e},tt.prototype.getRowId=function(t){return this._rids[t]||""},tt.prototype.getAllRowIds=function(t){return t?this._rids:this._rids.slice(0)},tt.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},tt.prototype.getRowCount=function(){return this._rids.length},tt.prototype.getDataAt=function(t,e){return this.getData(this._rids[t],e)},tt.prototype.getRowDataAt=function(t){return this.getRowData(this._rids[t])},tt.prototype.getPreviousData=function(t,e){var i=this._prevData[t]||null;return i?i[e]:null},tt.prototype.setData=function(t,e,i){if(!this._needFiring())return this._setData(t,e,i);var o={};return o[e]=i,this.setRowData(t,o)},tt.prototype.setRowData=function(t,e,i){if(!t)return!1;var o=this.getRowData(t),n=!1,r="updated",s=!1;if(e){if(o){var l=this._prevData[t];for(var a in e)l[a]=o[a],o[a]=e[a]}else if(r="inserted",o=e,this._rows[t]=o,this._prevData[t]={},i){var h=i.nextRid,u=h?this.getRowIndex(h):-1;u<0&&(u=i.fallback),null==u||u<0||u>=this._rids.length?this._rids.push(t):(this._rids.splice(u,0,t),s=!this._isLastSegment(u))}else this._rids.push(t);n=!0}else o&&(r="removed",this._prevData[t]=this._rows[t],delete this._rows[t],this._segments&&this._segments.getSegment(t)&&this._segments.removeSegment(t)&&(s=!0,this._segments.getSegmentCount()||(this._segments=null)),tt._removeArrayItem(this._rids,t),n=!0);if(n&&this._needFiring()){if(this._autoFillSegments())this.dispatchGlobalChange();else{var p=i||{};p.rid=t,p.changes=e,p.rowData=o,p.type=r,s&&(p.segmentChanged=!0),this._dispatchDataChange(p)}this.requestClassifying()}return n},tt.prototype.setColumnData=function(t,e,i){var o=e?e.length:0;if(!(o<0)){var n=this._frozen;this.freeze();for(var r=this._generateRids(o,i),s=0;s<o;++s)this._setData(r[s],t,e[s]);this.freeze(n)}},tt.prototype.setDataFromObjectMap=function(t){if(t)if(Array.isArray(t))this.addRows(t);else{var e=this._frozen;for(var i in this.freeze(),t)this.setRowData(i,t[i]);this.freeze(e)}},tt.prototype.setDataFrom2DArray=function(t,e,i){var o=t?t.length:0;if(!(o<0)){var n=this._frozen;this.freeze();for(var r=0,s=this._generateRids(o,i),l=0;l<o;++l){var a=t[l],h=s[l];if(e)for(r=a.length;--r>=0;)this._setData(h,e[r],a[r]);else for(r=a.length;--r>=0;)this._setData(h,""+r,a[r])}this.freeze(n)}},tt.prototype.setDataAt=function(t,e,i){var o=this.getRowId(t);return!!o&&this.setData(o,e,i)},tt.prototype.setRowDataAt=function(t,e,i){var o=this.getRowId(t);return!!o&&this.setRowData(o,e,i)},tt.prototype.addRow=function(t,e){return t||(t={}),e=this._generateUniqueRid(t,e),this.setRowData(e,t),e},tt.prototype.addRows=function(t,e){if(Array.isArray(t)){var i=t.length;if(i)if(1!==i){e||(e=[]);var o=this._frozen;this.freeze();for(var n=0;n<i;++n)this.addRow(t[n],e[n]);this.freeze(o)}else this.addRow(t[0],e?e[0]:null)}},tt.prototype.unshiftRow=function(t,e){return this.insertRow(0,t,e)},tt.prototype.insertRow=function(t,e,i){var o=null;return"number"==typeof t?((o={}).nextRid=this._rids[t],o.fallback=t):t&&((o={}).nextRid=t),e||(e={}),i=this._generateUniqueRid(e,i),this.setRowData(i,e,o),i},tt.prototype.insertAfter=function(t,e,i){var o="string"==typeof t?this.getRowIndex(t):t;return!(o>=0)||o>=this._rids.length-1?this.addRow(e,i):this.insertRow(o+1,e,i)},tt.prototype.removeRow=function(t){"number"==typeof t?this.setRowData(this.getRowId(t),null):this.setRowData(t,null)},tt.prototype.removeRows=function(t){if(1!==t.length){var e,i=!1;for(this._removedRows={},e=t.length;--e>=0;)"number"==typeof(o=t[e])&&(o=this.getRowId(o)),this.getRowData(o)&&(this._prevData[o]=this._rows[o],this._removedRows[o]=1,delete this._rows[o],i=!0);i?(this._rids=this._rids.filter(this._removeRows),this._removedRows=null,this.dispatchGlobalChange()):this._removedRows=null}else{var o=t[0];"number"==typeof o?this.removeRow(o):this.setRowData(o,null)}},tt.prototype._removeRows=function(t){return!this._removedRows[t]},tt._removeArrayItem=function(t,e){var i=t.indexOf(e);return i>=0&&(i>=t.length?t.pop():t.splice(i,1),!0)},tt.prototype.clearAllData=function(t){tt.base(this,"clearAllData",!0),this._prevData={},this._segments&&this._segments.removeAllSegmentChildren(),this._rids.length&&(this._rids.length=0,this.dispatchGlobalChange(t))},tt.prototype.removeAllRows=tt.prototype.clearAllData,tt._ascendingOrder=function(t,e){return t-e},tt.prototype.moveRow=function(t,e,i){var o=null,n="";if(e>=0&&e<this._rids.length||(e=this._rids.length),Array.isArray(t)){var r=t;r.sort(tt._ascendingOrder);for(var s=[],l=r.length;--l>=0;){var a=r[l];(n=this._rids[a])&&(s.unshift(n),this._rids.splice(a,1),a<e&&--e)}s.length&&(this._rids.splice.apply(this._rids,[e,0].concat(s)),o=s)}else t<0&&(t=0),t!==e&&t+1!==e&&(n=this._rids.splice(t,1)[0])&&(t<e&&--e,this._rids.splice(e,0,n),o=n);return o&&(this._segments&&(this._segments.calcSegmentOrder(this._rids),this._sort(null)),this._dispatchPositionChange(i)),o},tt.prototype._moveRow=function(t,e,i){var o=t.length;if(!o)return null;for(var n=new Array(o),r=0;r<o;++r)n[r]=this.getRowIndex(t[r]);var s=e?this.getRowIndex(e):this._rids.length;return o>1?this.moveRow(n,s,i):this.moveRow(n[0],s,i)},tt.prototype.moveRows=function(t,e,i,o){"string"==typeof t&&(t=this.getRowIndex(t)),"string"==typeof e&&(e=this.getRowIndex(e)),t<0&&(t=0),e<0&&(e=this._rids.length),i||(i=1);var n=t+i-1,r=e;if(e>=t&&(r=e<=n?t:e-i),i>0&&n<=this._rids.length){r>this._rids.length&&(r=this._rids.length);var s=this._rids.splice(t,i),l=[r,0].concat(s);return Array.prototype.splice.apply(this._rids,l),this._segments&&this._sort(null),this._dispatchPositionChange(o),s}return null},tt.prototype.swapRow=function(t,e){var i=this._rids.length;if(!(t<0||t>=i||e<0||e>=i)){var o=this._rids[t];this._rids[t]=this._rids[e],this._rids[e]=o}},tt.prototype.clearRowData=tt.prototype.removeRow,tt.prototype.clearColumnData=function(t,e){for(var i="string"==typeof t?[t]:t,o=i.length;--o>=0;){var n=i[o];if(n)for(var r in this._rows)delete this._rows[r][n],delete this._prevData[r][n]}this.dispatchGlobalChange(e)},tt.prototype.getDataSource=function(){return null},tt.prototype.setDataSource=function(t){},tt.prototype.getSortingLogics=function(){return this._compMap},tt.prototype.sortOnce=function(t,e,i,o){var n=tt._buildSortContext([],t,e,i||this._compMap,o);return!!this._sort(n)&&(this._dispatchPositionChange(),!0)},tt.prototype.setSortingLogic=function(t){this._compMap._default=t},tt.prototype.setColumnSortingLogic=function(t,e){t&&(this._compMap[t]=e)},tt.prototype.getColumnSortingLogic=function(t){if(t){var e=this._compMap[t];if(e)return e}return this._compMap._default||null},tt.prototype.freeze=function(t){t=!1!==t;var e=this._frozen;return e!==t&&(this._frozen=t,this._autoFillSegments(),this.dispatchGlobalChange()),e},tt.prototype.unfreeze=function(t){return this.freeze(!1===t)},tt.prototype.isFrozen=function(){return this._frozen},tt.prototype.setSegmentSeparator=function(t,e){var i=!1,o=0;if(t&&"string"==typeof t)if(!1!==e){if(this._segments||(this._segments=new Z,this._segments.addEventListener("subSegmentChanged",this._onSubSegmentChanged)),this._autoSegmentFilling){var n=this._segments.getParentRowId(t);n&&this._segments.removeSegmentChild(n,t)}this._segments.addSegment(t)&&(this._segments.calcSegmentOrder(this._rids),i=!0)}else if(this._segments){var r=this._segments.getSegment(t);r&&(o=r.getChildCount(),this._segments.removeSegment(t)&&(i=!0,this._segments.getSegmentCount()||(this._segments=null)))}if(i&&this._needFiring())if(this._autoFillSegments()||o)this.dispatchGlobalChange();else{var s=this._rows[t]||null;s&&this._dispatchDataChange({rid:t,changes:{},rowData:s,type:"updated",segmentChanged:!0})}return i},tt.prototype.unsetAllSegmentSeparators=function(){return!!this._segments&&(this._segments=null,this.dispatchGlobalChange(),!0)},tt.prototype.hasSegmentation=function(){return!!this._segments},tt.prototype.isSegmentSeparator=function(t){return!!this._segments&&this._segments.containsSegment(t)},tt.prototype.getSegment=function(t){return this._segments?this._segments.getSegment(t):null},tt.prototype.getSegmentLevel=function(t){var e=this.getSegment(t);return e?e.getSegmentLevel()+1:0},tt.prototype.getSegmentParentRowId=function(t){return this._segments?this._segments.getParentRowId(t):""},tt.prototype.getSegmentValues=function(t,e){return this._segments?this._segments.getSegmentValues(t||this._rids,e):null},tt.prototype._isLastSegment=function(t){var e=this._segments;if(e)for(var i=this._rids,o=i.length,n=t+1;n<o;++n)if(e.containsSegment(i[n]))return!1;return!0},tt.prototype._getSegmentSeparators=function(){return this._segments},tt.prototype.enableAutoSegmentFilling=function(t){this._autoSegmentFilling=0!=t,this._autoFillSegments()},tt.prototype._autoFillSegments=function(){return!!this._autoSegmentFilling&&this.fillSegments()},tt.prototype.fillSegment=function(t){this._segments&&(this._segments.fillSegment(t,this._rids),this.dispatchGlobalChange(),this.requestClassifying())},tt.prototype.fillSegments=function(){if(this._segments){var t=this._segments.fillSegments(this._rids);return t&&(this.dispatchGlobalChange(),this.requestClassifying()),t}return!1},tt.prototype.addSegmentChild=function(t,e,i){return!(!this._segments||!this._segments.addSegmentChild(t,e,i))&&(this._sort(null),this._dispatchPositionChange(),this.requestClassifying(),!0)},tt.prototype.addSegmentChildren=function(t,e,i){return!(!this._segments||!this._segments.addSegmentChildren(t,e,i))&&(this._sort(null),this._dispatchPositionChange(),this.requestClassifying(),!0)},tt.prototype.removeSegmentChild=function(t,e){if(this._segments){var i=this._segments.removeSegmentChild(t,e);return i&&(this.dispatchGlobalChange(),this.requestClassifying()),i}return!1},tt.prototype.removeSegmentChildren=function(t,e){if(this._segments){var i=this._segments.removeSegmentChildren(t,e);return i&&(this.dispatchGlobalChange(),this.requestClassifying()),i}return!1},tt.prototype.removeAllSegmentChildren=function(){if(this._segments){var t=this._segments.removeAllSegmentChildren();return t&&this.dispatchGlobalChange(),t}return!1},tt.prototype.getSegmentIds=function(){return this._segments?this._segments.getSegmentIds():null},tt.prototype.getSegmentChildIds=function(t){if(this._segments){var e=this._segments.getSegment(t);if(e){var i=e.getChildIds();return i.length?i:null}}return null},tt.prototype.sortSeparators=function(t,e,i){var o=!1;if(!this._segments)return!1;if("function"==typeof t)return this.sortSegments(t);var n=tt._buildSortContext([],i,e,t),r=n?n.length:0;if(!r)return o;var s,l,a=0;return r>1?(s=tt._multiColumnSeparatorCompareLogic,l=n,a=1):(s=tt._singleColumnSeparatorCompareLogic,a=(l=n[0])[3]),this._segmentSortOrder=a,this._segmentSortContext=l,o=this.sortSegments(s),this._segmentSortOrder=0,this._segmentSortContext=null,o},tt.prototype.sortSegments=function(t){if(!this._segments)return!1;if("function"!=typeof t)return this._segments.calcSegmentOrder(this._rids),!1;var e,i=this._rids,o=this._segments,n=o.getSegmentCount(),r=[],s=[],l=0,a=i.length,h="",u=null;for(e=0;e<a&&(h=i[e],!((u=o.getSegment(h))&&(s.push(e),r.push(u),++l>=n)));++e);this._userSegmentComparer=t,r.sort(this._bySegmentSeparator),this._userSegmentComparer=null;var p=!1;for(e=0;e<l;++e){var _=s[e];h=i[_];var c=(u=r[e]).getId();h!==c&&(i[_]=c,p=!0)}return!!p&&(this._segments.calcSegmentOrder(i),this._sort(null),this._dispatchPositionChange(),!0)},tt.prototype._bySegmentSeparator=function(t,e){return this._userSegmentComparer(this.getRowData(t.getId()),this.getRowData(e.getId()),this._segmentSortOrder,this._segmentSortContext)},tt.prototype.setClassificationSource=function(t){this._clsSource=null,t&&t._rows&&(this._clsSource=t._rows)},tt.prototype.setSegmentClassification=function(t,e){return!(!this._segments||!this._segments.setSegmentClassification(t,e))&&this.classifySegments()},tt.prototype.classifySegments=function(){return!(!this._segments||!this._rids.length)&&this._segments.classify(this._clsSource||this._rows)},tt.prototype.requestClassifying=function(){this._segments&&!this._classifyingTimer&&this._segments.hasClassification()&&(this._classifyingTimer=setTimeout(this._onClassifyingTimer,10))},tt.prototype._onClassifyingTimer=function(){this._classifyingTimer=0,this.classifySegments()},tt.prototype._onSubSegmentChanged=function(t){var e,i=t.insertionList,o=t.removalList,n=!1,r=this._rows,s=this._clsSource||r,l=this._rids,a=this._prevData,h=o.length,u={};for(e=0;e<h;e++){var p=o[e];r[p]&&(u[p]=a[p]=r[p],delete r[p],tt._removeArrayItem(l,p),n=!0)}var _=i.length;for(e=0;e<_;e++){var c=i[e],d=c.getParentId(),g=c.getId();if(!r[g]){a[g]={},c.setRowData(r,s);var f=l.indexOf(d);f<0||f+1>=l.length?l.push(g):l.splice(f+1,0,g),n=!0}}n&&(t.removedRows=u,this._dispatch("subSegmentChanged",t),this.dispatchGlobalChange())},tt.prototype._sort=function(t){var e=this._rids,i=this.getMultipleRowData(e),o=this.getSegmentValues(e),n=tt._performMultiLevelSorting(i,t,o);return!!n&&(this._rids=tt._reorderItems(e,n),!0)},tt.prototype.dispatchGlobalChange=function(t){!t&&this._needFiring()&&this._dispatchDataChange(tt._globalChangeArg)},tt.prototype._dispatchPositionChange=function(t){!t&&this._needFiring()&&this._dispatch("dataChanged",tt._positionChangeArg)},tt.prototype.dump=function(t){return U.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},tt.prototype._setData=function(t,e,i){var o=this.getRowData(t);return o||(o={},this._rows[t]=o,this._prevData[t]={},this._rids.push(t)),this._prevData[t][e]=o[e],o[e]=i,!0},tt.prototype._generateRids=function(t,e){var i,o=0;if(e)i=e;else{i=[];for(var n=this._rids.length;o<n&&o<t;)i.push(this._rids[o++])}for(o=i.length;o<t;)i.push(""+o++);return i},tt.prototype._generateUniqueRid=function(t,e){if(!e){if(t.ROW_ID)return t.ROW_ID;for(e="_"+this._runningId++;this._rows[e];)e="_"+this._runningId++}return e},tt.prototype._needFiring=function(){return!this._frozen&&!this._composing},tt.getSortingDefinitions=o._deprecatedFunction,tt._globalChangeArg={globalChange:!0},tt._positionChangeArg={globalChange:!0,positionChangeOnly:!0},tt._buildSortContext=function(t,e,i,o,n){var r,s;Array.isArray(e)?(r=e,s=i):(r=[e],s=e?[i]:[0]);var l=null,a=null;"function"==typeof o?l=o:a=o;var h=r.length;t.length=h;for(var u=h;--u>=0;){Array.isArray(a)&&(l=a[u]);var p=t[u];p||(p=t[u]=new Array(5));var _=r[u];p[0]=_,p[1]=null,p[2]=l||a[_]||a._default,p[2]||(p[2]=tt._defaultComparer),p[3]=tt._getSortOrder(s[u]),p[4]=n}return t},tt._multiColumnCompareLogic=function(t,e,i,o){for(var n=o.length,r=0,s=0;s<n;++s){var l=o[s];if(r=tt._singleColumnCompareLogic(t,e,l[3],l))return r}return r},tt._singleColumnCompareLogic=function(t,e,i,o){var n=o[1];return o[2](n[t],n[e],i,o[4])},tt._multiColumnSeparatorCompareLogic=function(t,e,i,o){for(var n=o.length,r=0,s=0;s<n;++s){var l=o[s];if(r=tt._singleColumnSeparatorCompareLogic(t,e,l[3],l))return r}return r},tt._singleColumnSeparatorCompareLogic=function(t,e,i,o){var n=o[0];return o[2](t[n],e[n],i,o[4])},tt._performMultiLevelSorting=function(t,e,i){var o,n=t?t.length:0,r=e?e.length:0;if(!n)return null;for(var s=0;s<r;++s){var l,a=e[s],h=a[1];if((o=a[2]).rowSorting)if(h)for(h.length=n,l=0;l<n;++l)h[l]=t[l];else h=a[1]=t;else{h?h.length=n:h=a[1]=new Array(n);var u=a[0];for(l=0;l<n;++l)h[l]=t[l][u]}}if(i){var p=["ROW_SEGMENT",i,tt._segmentComparer,1,null];e?(e=e.slice()).unshift(p):e=[p],++r}if(!r)return null;var _,c=0;return r>1?(o=tt._multiColumnCompareLogic,_=e,c=1):(o=tt._singleColumnCompareLogic,c=(_=e[0])[3]),tt._mergeSort(n,c,o,_)},tt._mergeSort=function(t,e,i,o){for(var n,r,s,l,a,h=!1,u=1,p=tt._createIndexArray(t),_=p.slice();u<=t;){for(n=a=0;n<t;)if((a=(s=l=(r=a)+u)+u)>t&&(a=t),s<a){for(;;)if(i(p[r],p[s],e,o)<=0){if(_[n++]=p[r],++r>=l){for(;s<a;)_[n++]=p[s],++s;break}}else if(h=!0,_[n++]=p[s],++s>=a){for(;r<l;)_[n++]=p[r],++r;break}}else for(;n<t;)_[n]=p[n],++n;var c=p;p=_,_=c,u<<=1}return h?p:null},tt._reorderItems=function(t,e){if(e){for(var i=t.length;--i>=0;)e[i]=t[e[i]];return e}return t},tt._createIndexArray=function(t){var e=tt._idxAryMap[t];if(!e){tt._idxAryCount>50&&(tt._idxAryMap={},tt._idxAryCount=0),e=tt._idxAryMap[t]=new Array(t),tt._idxAryCount++;for(var i=0;i<t;++i)e[i]=i}return e.slice()},tt._removeIndexArray=function(){tt._idxAryMap={},tt._idxAryCount=0},tt._idxAryMap={},tt._idxAryCount=0,tt._segmentComparer=function(t,e){return t===e?0:t<e?-1:1},tt._defaultComparer=function(t,e,i){return null==t||t!=t?null==e||e!=e?0:1:null==e||e!=e?-1:t<e?-i:e<t?i:0},tt._getSortOrder=function(t){if("number"==typeof t)return t;if(t&&"string"==typeof t){if("a"===(t=t.charAt(0).toLowerCase()))return 1;if("d"===t)return-1}return 0},tt._proto=tt.prototype;const et=tt;var it=function(t,e){this._onDataChanged=this._onDataChanged.bind(this),this._refs=[],t&&(this._dt=t,this._dt.listen("dataChanged",this._onDataChanged,0)),e&&(this._field=e)};it.prototype.dispose=function(){this._dt&&(this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=null)},it.prototype.setDataSource=function(t){this._dt!==t&&(this._dt&&this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=t,this._dt&&this._dt.listen("dataChanged",this._onDataChanged,0),this._requestRecalculation())},it.prototype.setField=function(t){this._field!==t&&(this._field=t,this._requestRecalculation())},it.prototype.disableOnDemandMode=function(t){var e=!1===t;this._onDemandMode!==e&&(this._onDemandMode=e,this._requestRecalculation())},it.prototype.setColumnDataGetter=function(t){this._colDataGetter!==t&&(this._colDataGetter=t,this._requestRecalculation())},it.prototype.getColumnDataGetter=function(){return this._colDataGetter},it.prototype.getSum=function(){return this._updateStats(),this._sum},it.prototype.getDataCount=function(){return this._updateStats(),this._count},it.prototype.getMin=function(){return this._updateStats(),this._min},it.prototype.getMax=function(){return this._updateStats(),this._max},it.prototype.getAbsoluteMax=function(){this._updateStats();var t=this._max>=0?this._max:-this._max,e=this._min>=0?this._min:-this._min;return t>=e?t:e},it.prototype.getAverage=function(){return this._updateStats(),this._sum/this._count},it.prototype.getMean=it.prototype.getAverage,it.prototype.getMidRange=function(){return this._updateStats(),.5*(this._max+this._min)},it.prototype.getCachedColumnData=function(){return this._dirty?this._recalculate():this._cacheData||(this._cacheData=this._getColData()),this._cacheData},it.prototype.markDirty=function(){return!!this._onDemandMode&&(this._dirty=!0,this._dirty)},it.prototype._getColData=function(){return this._colDataGetter?this._colDataGetter(this._field,this._dt):this._dt.getColumnData(this._field)},it.prototype._requestRecalculation=function(){this.markDirty()||this._recalculate()},it.prototype._updateStats=function(){this._dirty&&this._recalculate()},it.prototype._recalculate=function(){if(this._dirty=!1,this._cacheData=null,this._sum=0,this._min=NaN,this._max=NaN,this._count=0,this._dt&&this._field){var t=this._cacheData=this._getColData(),e=t.length;if(e){for(var i,o=it._isDataNumeric,n=0;n<e;)if(o(i=+t[n++])){this._sum=this._min=this._max=i,++this._count;break}for(;n<e;)o(i=+t[n])&&(this._sum+=i,i<this._min?this._min=i:i>this._max&&(this._max=i),++this._count),++n}}},it.prototype._onDataChanged=function(t){if(t.rid){if(!this._colDataGetter&&t.changes&&null==t.changes[this._field])return;if(this.markDirty())return;this._updateRowData(t.rid)}else if(t.rids){if(this.markDirty())return;var e=t.rids;1===e.length?this._updateRowData(e[0]):this._recalculate()}else if(t.globalChange){if(t.positionChangeOnly)return void(this._cacheData=null);this._requestRecalculation()}},it.prototype._updateRowData=function(t){var e=this._dt.getPreviousData(t,this._field),i=this._dt.getData(t,this._field);if(e!==i){var o=it._isDataNumeric(i);if(it._isDataNumeric(e)){if(this._min===e&&(!o||i>this._min))return void this._recalculate();if(this._max===e&&(!o||i<this._max))return void this._recalculate();this._sum-=e,--this._count}o&&(this._sum+=i,i>=this._min||(this._min=i),i<=this._max||(this._max=i),++this._count)}},it._isDataNumeric=function(t){return"number"==typeof t&&t==t},it.prototype.addRef=function(t){return t&&this._refs.indexOf(t)<0&&this._refs.push(t),this._refs.length},it.prototype.deRef=function(t){if(t){var e=this._refs.indexOf(t);e>=0&&this._refs.splice(e,1)}return this._refs.length},it.prototype.getRefCount=function(){return this._refs.length},it.prototype._dt=null,it.prototype._field="",it.prototype._onDemandMode=!0,it.prototype._dirty=!0,it.prototype._cacheData=null,it.prototype._sum=0,it.prototype._min=NaN,it.prototype._max=NaN,it.prototype._count=0,it.prototype._colDataGetter=null,it.prototype._refs;const ot=it;var nt=function(t){this._onDataChanged=this._onDataChanged.bind(this),this._onWrapSizeChanged=this._onWrapSizeChanged.bind(this),this._dv=t.dataView,this._dt=this._dv.getDataTable(),this._dv.listen("dataChanged",this._onDataChanged),this._dv.listen("wrapSizeChanged",this._onWrapSizeChanged),this._wrapIndex=t.wrapIndex,this._refreshRids(t.rids),this._addEvents("dataChanged")};u.inherits(nt,l),nt.prototype._dv=null,nt.prototype._dt=null,nt.prototype._wrapIndex=0,nt.prototype._rids,nt.prototype._dataConflator=null,nt.prototype._onDataChanged=function(t){if(this._dv){var e=this._dv.getVisibleRowIds(!0);this._refreshRids(e)&&(t.globalChange||(t.globalChange=!0),this._dispatch("dataChanged",t))}},nt.prototype._onWrapSizeChanged=function(t){this._refreshRids(t.rids)&&this._dispatch("dataChanged",et._globalChangeArg)},nt.prototype._refreshRids=function(t){var e=!1;if(this._dv&&Array.isArray(t)){var i=this.getWrapSize();if(i>0){var o=i*this._wrapIndex;o<t.length?(e=!0,this._rids=t.slice(o,o+i)):this._rids.length&&(e=!0,this._rids.length=0)}}return e},nt.prototype.dispose=function(){this._dv&&(this.unlistenAll(),this._dv.unlisten("dataChanged",this._onDataChanged),this._dv.unlisten("wrapSizeChanged",this._onWrapSizeChanged),this._dt=this._dv=null)},nt.prototype.getData=function(t,e){return this._dt.getData(t,e)},nt.prototype.getRowData=function(t){return this._dt.getRowData(t)},nt.prototype.getColumnData=function(t,e){for(var i=this.getAllRowIds(!0,e),o=[],n=i.length,r=0;r<n;++r){var s=this._dt.getRowData(i[r]);s?o.push(s[t]):e&&o.push(null)}return o},nt.prototype.getRowId=function(t){return this._rids[t]||""},nt.prototype._toRowId=function(t){return"number"==typeof t?this._rids[t]||"":t||""},nt.prototype._toRowIds=function(t){for(var e=Array.isArray(t)?t.length:0,i=new Array(e),o=this._rids,n=0;n<e;++n){var r=t[n];i[n]="number"==typeof r?o[r]||"":r||""}return i},nt.prototype.getAllRowIds=function(t,e){return t?this._rids:this._rids.slice(0)},nt.prototype.getVisibleRowIds=function(t){return t?this._rids:this._rids.slice(0)},nt.prototype.getSortedRowIds=function(t){return t?this._rids:this._rids.slice(0)},nt.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},nt.prototype.getRowCount=function(){return this._rids.length},nt.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},nt.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},nt.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},nt.prototype.getMultipleRowData=function(t,e,i){return this._dt.getMultipleRowData(t,e,i)},nt.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},nt.prototype.setData=function(t,e,i){return!!this._dt&&this._dt.setData(t,e,i)},nt.prototype.setRowData=function(t,e,i){return this._dv.setRowData(t,e,i)},nt.prototype.setColumnData=function(t,e,i){this._dt&&this._dt.setColumnData(t,e,i)},nt.prototype.setDataAt=function(t,e,i){var o=this.getRowId(t);return!(!o||!this._dt)&&this._dt.setData(o,e,i)},nt.prototype.setRowDataAt=function(t,e,i){var o=this.getRowId(t);return this.setRowData(o,e,i)},nt.prototype.insertRow=function(t,e,i){var o=this._toRowId(t);return this._dv.insertRow(o,e,i)},nt.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},nt.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},nt.prototype.moveRow=function(t,e){var i=this._toRowId(e),o=Array.isArray(t)?t:[t],n=this._toRowIds(o);return this._dv.moveRow(n,i)},nt.prototype.getDataTable=function(){return this._dt},nt.prototype.getDataSource=function(){return this._dv},nt.prototype.setDataSource=function(t){},nt.prototype.setConflationRate=function(t){this._dv.setConflationRate(t)},nt.prototype.getConflationRate=function(){return this._dv.getConflationRate()},nt.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},nt.prototype.sort=function(t,e,i,o){this._dv.sort(t,e,i,o)},nt.prototype.sortOnce=function(t,e){this._dv.sortOnce(t,e)},nt.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},nt.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},nt.prototype.isSorting=function(){return this._dv.isSorting()},nt.prototype.hideRow=function(t,e){this.showRows([t],!1===e)},nt.prototype.hideRows=function(t,e){this.showRows(t,!1===e)},nt.prototype.showRows=function(t,e){var i=this._toRowIds(t);this._dv.showRows(i,e)},nt.prototype.unhideAllRows=function(){this._dv.unhideAllRows()},nt.prototype.hasHiddenRow=function(){return this._dv.hasHiddenRow()},nt.prototype.filterIn=function(t,e,i){return this._dv.filterIn(t,e,i)},nt.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},nt.prototype.filterInOnce=function(t,e,i){this._dv.filterInOnce(t,e,i)},nt.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},nt.prototype.clearFilter=function(){this._dv.clearFilter()},nt.prototype.disablePageCorrection=function(t){},nt.prototype.setPage=function(t){return!1},nt.prototype.gotoPage=nt.prototype.setPage,nt.prototype.nextPage=function(){return!1},nt.prototype.previousPage=function(){return!1},nt.prototype.prevPage=nt.prototype.previousPage,nt.prototype.lastPage=function(){return!1},nt.prototype.firstPage=function(){return!1},nt.prototype.getCurrentPage=function(){return 1},nt.prototype.getPageIndex=nt.prototype.getCurrentPage,nt.prototype.isOnLastPage=function(){return!0},nt.prototype.isOnFirstPage=function(){return!0},nt.prototype.getPageSize=function(){return 0},nt.prototype.getPageCount=function(){return 1},nt.prototype.getTotalPages=nt.prototype.getPageCount,nt.prototype.setPageSize=function(t){},nt.prototype.groupBy=function(t,e){this._dv.groupBy(t,e)},nt.prototype.addGroup=function(t){this._dv.addGroup(t)},nt.prototype.sortGroups=function(t){this._dv.sortGroups(t)},nt.prototype.moveGroup=function(t,e){this._dv.moveGroup(t,e)},nt.prototype.setPredefinedGroups=function(t){this._dv.setPredefinedGroups(t)},nt.prototype.addFooter=function(t){this._dv.addFooter(t)},nt.prototype.removeFooter=function(){this._dv.removeFooter()},nt.prototype.enableMultiGroup=function(t){this._dv.enableMultiGroup(t)},nt.prototype.getGroupByRowId=function(t){return this._dv.getGroupByRowId(t)},nt.prototype.getGroup=function(t){return this._dv.getGroup(t)},nt.prototype.getAllGroups=function(t){return this._dv.getAllGroups(t)},nt.prototype.getGroupList=function(){return this._dv.getGroupList()},nt.prototype.getGroupId=function(){return this._dv.getGroupId()},nt.prototype.getGroupValue=function(){return this._dv.getGroupValue()},nt.prototype.getGroupRowId=function(){return this._dv.getGroupRowId()},nt.prototype.getFooterRowIndex=function(t){return this._dv.getFooterRowIndex(t)},nt.prototype.getFooterRowIds=function(){return this._dv.getFooterRowIds()},nt.prototype.hasGroup=function(){return this._dv.hasGroup()},nt.prototype.getGroupRows=function(){return null},nt.prototype.getGroupLevel=function(t){var e=this._toRowId(t);return this._dv.getGroupLevel(e)},nt.prototype.enableColumnStats=function(t,e,i){return this._dv.enableColumnStats(t,e,i)},nt.prototype.getColumnStats=function(t){return this._dv.getColumnStats(t)},nt.prototype.hide=function(t){return this._dv.hide(t)},nt.prototype.isHidden=function(){return this._dv.isHidden()},nt.prototype.isHiddenRow=function(t){return this._dv.isHiddenRow(t)},nt.prototype.collapse=function(t){this._dv.collapse(t)},nt.prototype.collapseAllGroups=function(t){this._dv.collapseAllGroups(t)},nt.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},nt.prototype.isCollapsed=function(){return this._dv.isCollapsed()},nt.prototype.enableContentAsHeader=function(t){this._dv.enableContentAsHeader(t)},nt.prototype.getVisibleRowCount=function(){return this._rids.length},nt.prototype.isRowDataInGroup=function(t,e){return this._dv.isRowDataInGroup(t,e)},nt.prototype.isRowIdInGroup=function(t,e){return this._dv.isRowIdInGroup(t,e)},nt.prototype.addRowExpansion=function(t,e){this._dv.addRowExpansion(t,e)},nt.prototype.removeRowExpansion=function(t){this._dv.removeRowExpansion(t)},nt.prototype.toggleRowExpansion=function(t,e,i){var o=this._toRowId(t);this._dv.toggleRowExpansion(o,e,i)},nt.prototype.removeAllRowExpansions=function(){this._dv.removeAllRowExpansions()},nt.prototype.getRowsWithExpansion=function(t,e){return this._dv.getRowsWithExpansion(t,e)},nt.prototype.getExpansionParents=function(t,e){return this._dv.getExpansionParents(t,e)},nt.prototype.isRowExpansion=function(t){return this._dv.isRowExpansion(t)},nt.prototype.hasRowExpansion=function(t){return this._dv.hasRowExpansion(t)},nt.prototype.getRowExpansionId=function(t,e){return this._dv.getRowExpansionId(t,e)},nt.prototype.getRowExpansionIndex=function(t){return this._dv.getRowExpansionIndex(t)},nt.prototype.searchAll=function(t,e){return this._dv.searchAll(t,e)},nt.prototype.searchPrev=function(t,e){var i=this._toRowId(t);return this._dv.searchPrev(i,e)},nt.prototype.searchNext=function(t,e){var i=this._toRowId(t);return this._dv.searchNext(i,e)},nt.prototype.stall=function(t){return this._dv.stall(t)},nt.prototype.enableAutoGroupRemoval=function(t){return this._dv.enableAutoGroupRemoval(t)},nt.prototype.enableAutoGroupHiding=function(t){return this._dv.enableAutoGroupHiding(t)},nt.prototype.synchronizeRowOrder=function(){this._dv.synchronizeRowOrder()},nt.prototype.setSegmentSeparator=function(t,e){var i=this._toRowId(t);return this._dv.setSegmentSeparator(i,e)},nt.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},nt.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},nt.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},nt.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},nt.prototype.collapseSegment=function(t,e){var i=this._toRowId(t);return this._dv.collapseSegment(i,e)},nt.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},nt.prototype.expandAllSegments=function(){return this._dv.expandAllSegments()},nt.prototype.setSegmentCollapsingLogic=function(){},nt.prototype.isSegmentCollapsed=function(t){var e=this._toRowId(t);return this._dv.isSegmentCollapsed(e)},nt.prototype.fillSegment=function(t){var e=this._toRowId(t);this._dv.fillSegment(e)},nt.prototype.fillSegments=function(){this._dv.fillSegments()},nt.prototype.addSegmentChild=function(t,e){var i=this._toRowId(t),o=this._toRowId(e);return this._dv.addSegmentChild(i,o)},nt.prototype.addSegmentChildren=function(t,e){var i=this._toRowId(t),o=this._toRowIds(e);return this._dv.addSegmentChildren(i,o)},nt.prototype.removeSegmentChild=function(t,e){var i=this._toRowId(t),o=this._toRowId(e);return this._dv.removeSegmentChild(i,o)},nt.prototype.removeSegmentChildren=function(t,e){var i=this._toRowId(t),o=this._toRowIds(e);return this._dv.removeSegmentChildren(i,o)},nt.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},nt.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},nt.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},nt.prototype.sortSegments=function(t){this._dt.sortSegments(t)},nt.prototype.getWrapSize=function(){return this._dv.getWrapSize()},nt.prototype.getWrappedViews=function(){return this._dv.getWrappedViews()},nt.prototype.wrapView=function(t){this._dv.wrapView(t)},nt.prototype.dump=function(t){return DataCache.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},nt.prototype.log=function(t){console.table(this.dump(t))},nt.prototype.isRowFiltered=function(t,e){return this._dv.isRowFiltered(t,e)};const rt=nt;var st=function(t,e,i){this._onConflated=this._onConflated.bind(this),this._data=[],"function"==typeof t?this.setFunction(t,i):"function"==typeof e&&this.setFunction(e,i),"number"==typeof e?this.setConflatingTime(e):"number"==typeof t&&this.setConflatingTime(t)};st.prototype._data,st.prototype._func=null,st.prototype._delay=0,st.prototype._timerId=0,st.prototype._conflated=!1,st.prototype._disabled=!1,st.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},st.prototype.popAllData=function(){if(this._data.length){var t=this._data;return this._data=[],t}return null},st.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},st.prototype.conflate=function(t){return!this._disabled&&(null!=t&&this._data.push(t),!this._conflated&&(this._timerId||(this._timerId=setTimeout(this._onConflated,this._delay)),!0))},st.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},st.prototype._onConflated=function(){this._conflated=!0;try{this._func()}catch(t){console.error(t.message||t)}this._timerId=0,this._data.length=0,this._conflated=!1},st.prototype.getData=function(){return this._data},st.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},st.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},st.prototype.getConflatingTime=function(){return this._delay},st.prototype.disable=function(t){this._disabled=!1!==t},st.prototype.isEnabled=function(){return!this._disabled},st.prototype.enable=function(t){this._disabled=!1===t};var lt=function(t){var e=this;e._groupFilterLogic=e._groupFilterLogic.bind(e),e._internalGroupSortingLogic=e._internalGroupSortingLogic.bind(e),e._onDataChanged=e._onDataChanged.bind(e),e._onGroupAdded=e._onGroupAdded.bind(e),e._onBeforeGroupAdded=e._onBeforeGroupAdded.bind(e),e._onRefreshTimeout=e._onRefreshTimeout.bind(e),e._updateWrapCount=e._updateWrapCount.bind(e),e._byRemovalMap=e._byRemovalMap.bind(e),e._rids=[],e._sortingDefs=[],e._columnStats={},e._shared={},e._conflator=new st(this._onDataChanged,0),e._conflator.disable(),e._addEvents("dataChanged","preDisposed","pageIndexChanged","pageCountChanged","groupAdded","beforeGroupAdded","groupCriteriaChanged","beforeFiltering","wrapCountChanged","wrapSizeChanged"),e.setDataSource(t)};u.inherits(lt,l),lt.prototype._rids,lt.prototype._groupView=null,lt.prototype._pageView=null,lt.prototype._expansionView=null,lt.prototype._hiddenRids=null,lt.prototype._collapsedRids=null,lt.prototype._excludedRids=null,lt.prototype._emptySegmentFiltering=!1,lt.prototype._separatorFiltering=!1,lt.prototype._expansionMap=null,lt.prototype._expansionChildren=null,lt.prototype._expansionCount=0,lt.prototype._dt=null,lt.prototype._parent=null,lt.prototype._shared=null,lt.prototype._sortingDefs=null,lt.prototype._userFilter=null,lt.prototype._filteringOut=!1,lt.prototype._refreshTimerId=0,lt.prototype._groupSortingLogic=null,lt.prototype._pageCorrection=!0,lt.prototype._pageSize=0,lt.prototype._pageIndex=1,lt.prototype._lastPageIndex=0,lt.prototype._groupCriteria=null,lt.prototype._preDefGroups=null,lt.prototype._preDefGroupsDirty=!1,lt.prototype._groupMembers=null,lt.prototype._groupList=null,lt.prototype._groupRows=null,lt.prototype._groupId="",lt.prototype._groupColor="",lt.prototype._groupValue,lt.prototype._groupRowId="",lt.prototype._footerRowIds=null,lt.prototype._groupLevel=0,lt.prototype._groupViewDirty=!1,lt.prototype._columnStats,lt.prototype._hidden=!1,lt.prototype._hiddenHeaderRow=!1,lt.prototype._collapsed=!1,lt.prototype._collapsible=!0,lt.prototype._showOnlyFirstMember=!1,lt.prototype._beingAdded=!1,lt.prototype._conflator=null,lt.prototype._wrappedViews=null,lt.prototype._wrapSize=0,lt.prototype._wrapTimerId=0,lt.prototype.dispose=function(){if(this._dispatch("preDisposed",{}),this.unlistenAll(),this.wrapView(0),this.setDataSource(null),this.groupBy(null),this._conflator.dispose(),this._sortingDefs=null,this._shared=null,this._userFilter=this._groupSortingLogic=null,this._wrapTimerId&&(clearTimeout(this._wrapTimerId),this._wrapTimerId=0),this._refreshTimerId&&(clearTimeout(this._refreshTimerId),this._refreshTimerId=0),this._columnStats){for(var t in this._columnStats)this._columnStats[t].dispose();this._columnStats=null}},lt.prototype.getData=function(t,e){return this._dt.getData(t,e)},lt.prototype.getRowData=function(t){return this._dt.getRowData(t)},lt.prototype.getColumnData=function(t,e){for(var i=this.getAllRowIds(!0,e),o=[],n=i.length,r=0;r<n;++r){var s=this._dt.getRowData(i[r]);s?o.push(s[t]):e&&o.push(null)}return o},lt.prototype.getRowId=function(t){return this._rebuildRowIdsFromChildren(),this._getRids()[t]||""},lt.prototype._toRowId=function(t){return"number"==typeof t?(this._rebuildRowIdsFromChildren(),this._getRids()[t]||""):t||""},lt.prototype._toRowIds=function(t){for(var e=Array.isArray(t)?t.length:0,i=new Array(e),o=this._getRids(),n=0;n<e;++n){var r=t[n];"number"==typeof r?(this._rebuildRowIdsFromChildren(),i[n]=o[r]||""):i[n]=r||""}return i},lt.prototype.getAllRowIds=function(t,e){this._rebuildRowIdsFromChildren();var i=e?this._getRids():this._pageView||this._rids;return t?i:i.slice(0)},lt.prototype.getVisibleRowIds=function(t){this._rebuildRowIdsFromChildren();var e=this._getRids();return t?e:e.slice(0)},lt.prototype.getSortedRowIds=function(t){return this._rebuildRowIdsFromChildren(),t?this._rids:this._rids.slice(0)},lt.prototype.getRowIndex=function(t){return this._rebuildRowIdsFromChildren(),this._getRids().indexOf(t)},lt.prototype.getRowCount=function(){return this._getRids().length},lt.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},lt.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},lt.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},lt.prototype.getMultipleRowData=function(t,e,i){return this._dt.getMultipleRowData(t,e,i)},lt.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},lt.prototype.setData=function(t,e,i){return!!this._dt&&this._dt.setData(t,e,i)},lt.prototype.setRowData=function(t,e,i){return!(!t||!this._dt||this.isRowExpansion(t))&&this._dt.setRowData(t,e,i)},lt.prototype.setColumnData=function(t,e,i){this._dt&&this._dt.setColumnData(t,e,i)},lt.prototype.setDataAt=function(t,e,i){var o=this.getRowId(t);return!(!o||!this._dt)&&this._dt.setData(o,e,i)},lt.prototype.setRowDataAt=function(t,e,i){var o=this.getRowId(t);return this.setRowData(o,e,i)},lt.prototype.insertRow=function(t,e,i){this._rebuildRowIdsFromChildren();var o=this._toRowId(t);return this._dt?this._dt.insertRow(o,e,i):""},lt.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},lt.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},lt.prototype.moveRow=function(t,e){var i=this._toRowId(e),o=Array.isArray(t)?t:[t],n=this._toRowIds(o);return this._dt.hasSegmentation()&&this.synchronizeRowOrder(),this._dt._moveRow(n,i)},lt.prototype.swapRow=o._deprecatedFunction,lt.prototype.getDataTable=function(){return this._dt},lt.prototype.getDataSource=function(){return this._parent},lt.prototype.setDataSource=function(t){if(t){if(this._groupLevel>0)return;this._setParent(t),this._onDataChanged(et._globalChangeArg),this._parent.listen("dataChanged",this._onDataChanged)}else this._parent&&(this._parent.unlisten("dataChanged",this._onDataChanged),this._resetAllViews(),this._groupViewDirty=!1),this._parent=this._dt=null,this._shared={}},lt.prototype.setConflationRate=function(t){this._conflator.disable(!t),this._conflator.setConflatingTime(t)},lt.prototype.getConflationRate=function(){return this._conflator.getConflatingTime()},lt.prototype._resetAllViews=function(){this._rids.length=0,this._groupView&&this._groupView.length&&(this._groupView.length=0),this._pageView&&this._pageView.length&&(this._pageView.length=0),this._expansionView&&this._expansionView.length&&(this._expansionView.length=0)},lt.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},lt.prototype.sort=function(t,e,i,o){if(this._groupLevel>0)window.console.log("ERROR: Sub-group cannot be sorted individually");else{var n=this.getSortingLogics(),r=this._sortingDefs,s=r.length;if(Array.isArray(i))for(var l=i.length;--l>=0;)if("function"!=typeof i[l]){var a=Array.isArray(t)?t[l]:t;i[l]=n[a]||n._default}if(et._buildSortContext(r,t,e,i||n),1===r.length&&0===r[0][3]&&(r.length=0),!(s<=0&&r.length<=0||this._shared.stalledRids)){var h=!1;this._groupMembers||r.length<=0||o?(h=!0,this._updateRowIds()):h=this._sort(),h&&this._dispatchDataChange(et._positionChangeArg)}}},lt.prototype.sortOnce=function(t,e){this.sort(t,e),this._sortingDefs.length=0},lt.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},lt.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},lt.prototype.getColumnSortingLogic=function(t){return this._dt?this._dt.getColumnSortingLogic(t):null},lt.prototype.isSorting=function(){return this._sortingDefs.length>0},lt.prototype.hideRow=function(t,e){this.hideRows([t],e)},lt.prototype.hideRows=function(t,e){e=!1!==e;var i=this._hiddenRids;if(e)i||(i=this._hiddenRids={});else if(!i)return;for(var o=this._toRowIds(t),n=!1,r=o.length;--r>=0;){var s=o[r];s&&(e?i[s]||(i[s]=!0,n=!0):i[s]&&(delete i[s],n=!0))}if(n){if(!e){var l=!1;for(var a in i){l=!0;break}l||(i=this._hiddenRids=null)}this._refreshAndNotify()}},lt.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},lt.prototype.unhideAllRows=function(){this._hiddenRids&&(this._hiddenRids=null,this._refreshAndNotify())},lt.prototype.hasHiddenRow=function(){return!!this._hiddenRids},lt.prototype.filterIn=function(t,e,i){var o=this._getFilterLogic(t,e),n=!0===i;return!!(this._userFilter!==o||"function"==typeof t||o&&n!==this._filteringOut)&&(this._shared.filterLogic=o,this._userFilter=o,this._filteringOut=n,this._refreshAndNotify(),!0)},lt.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},lt.prototype.filterInOnce=function(t,e,i){var o=this._getFilterLogic(t,e),n={};if(this._getRemovalMap(n,o,!0===i)){var r=this._removeRowIds(n);this._updatePageCount()||this._transformView(r)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(Object.keys(n))}},lt.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},lt.prototype._removeRowIds=function(t){var e=lt._removeArrayItems(this._rids,t);if(this._groupView&&(e=lt._removeArrayItems(this._groupView,t)),this._groupMembers)for(var i=this._groupList.length,o=0;o<i;++o){var n=this._groupList[o];this._groupMembers[n]._removeRowIds(t)}return e},lt.prototype.clearFilter=function(){this._userFilter&&(this._userFilter=null,this._shared.filterLogic=null,this._refreshAndNotify())},lt.prototype.disablePageCorrection=function(t){this._pageCorrection=!1===t},lt.prototype.setPage=function(t){var e=this._setPage(t);return e&&this._dispatchGlobalChange(),e},lt.prototype.gotoPage=lt.prototype.setPage,lt.prototype.nextPage=function(){return this.gotoPage(this._pageIndex+1)},lt.prototype.previousPage=function(){return this.gotoPage(this._pageIndex-1)},lt.prototype.prevPage=lt.prototype.previousPage,lt.prototype.lastPage=function(){return this.gotoPage(this._lastPageIndex)},lt.prototype.firstPage=function(){return this.gotoPage(0)},lt.prototype.getCurrentPage=function(){return this._pageIndex},lt.prototype.getPageIndex=lt.prototype.getCurrentPage,lt.prototype.isOnLastPage=function(){return this._pageIndex===this._lastPageIndex},lt.prototype.isOnFirstPage=function(){return 1===this._pageIndex},lt.prototype.getPageSize=function(){return this._pageSize},lt.prototype.getPageCount=function(){return this._lastPageIndex},lt.prototype.getTotalPages=lt.prototype.getPageCount,lt.prototype.setPageSize=function(t){t>=0||(t=0),this._pageSize!==t&&(this._pageSize=t,this._updatePageCount(),t>0?this._pageView||(this._pageView=[]):this._pageView&&(this._pageView=null),this._pageView&&0!==t?this._transformView():this._updateRowIds(),this._dispatchGlobalChange())},lt.prototype.groupBy=function(t,e){if(this._shared.multiGroupRow=!1,this._groupCriteria){if(this._groupList&&this._groupList.length>0){for(var i in this._groupMembers)this._groupMembers[i].dispose();this._groupMembers={},this._groupList.length=0}this._groupCriteria=null}var o,n,r;if(null!=e&&this._setPredefinedGroups(e),t&&0===this._groupLevel)for(this._groupCriteria=[],n=(r=Array.isArray(t)?t:[t]).length,o=0;o<n;++o){var s=r[o];"string"==typeof s?this._groupCriteria.push(this._defaultGroupCriteria.bind(this,s)):s&&this._groupCriteria.push(s)}if(this._groupCriteria)this._groupMembers||(this._groupMembers={},this._groupList=[],this._groupRows={}),this._groupView||(this._groupView=[]);else{if(this._groupMembers=null,this._groupList=null,this._groupView=null,this._groupRows){if(this._groupLevel<=0)this._footerRowIds=null;else if(this._groupRowId&&delete this._groupRows[this._groupRowId],this._footerRowIds){for(n=this._footerRowIds.length,o=0;o<n;++o)delete this._groupRows[this._footerRowIds[o]];this._footerRowIds=null}this._groupRows=null}this._groupValue=null}this._groupLevel=0,this._updateRowIds(),this._dispatch("groupCriteriaChanged",{}),this._dispatchGlobalChange()},lt.prototype.addGroup=function(t){if(this._groupMembers)if(isArray(t))for(var e=t,i=e.length,o=0;o<i;++o)this._addGroup(e[o]);else this._addGroup(t)},lt.prototype.sortGroups=function(t){if(this._groupMembers&&(this._groupSortingLogic=null==t?lt._defaultGroupSortingLogic:t||null,this._groupSortingLogic)){this._groupList.sort(this._internalGroupSortingLogic);for(var e=this._groupList.length;--e>=0;){var i=this._groupList[e];this._groupMembers[i].sortGroups(this._groupSortingLogic)}this._groupViewDirty=!0,this._groupLevel<=0&&this._dispatchGlobalChange()}},lt.prototype.moveGroup=function(t,e){var i=this.getGroup(t);if(i){var o=i.getDataSource(),n=i.getGroupId(),r=o._groupList.indexOf(n);r!==e&&r+1!==e&&(o._groupList.splice(r,1),r<e&&--e,o._groupList.splice(e,0,n),this._requestRebuildingRowIds(!1))}},lt.prototype.setPredefinedGroups=function(t){this._setPredefinedGroups(t),this._groupMembers&&this._refreshAndNotify()},lt.prototype._setPredefinedGroups=function(t){if(this._preDefGroups!==t){this._preDefGroups&&(this._preDefGroups.length=0);var e=!1;if(t)for(var i=t.length;--i>=0;)if(Array.isArray(t[i])){e=!0;break}e?this._preDefGroups=t:Array.isArray(t)?this._preDefGroups=[t]:this._preDefGroups=null,this._preDefGroupsDirty=!0}},lt.prototype.addFooter=function(t){if(this._groupLevel<=0)console.log("WARNING: Only group can have a footer");else if(null==t&&(t=1),!(t<=0)){this._footerRowIds||(this._footerRowIds=[]);for(var e=0;e<t;++e){var i=this._groupRowId+"_footer"+(this._footerRowIds.length||"");this._footerRowIds.push(i),this._groupRows[i]=this}this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},lt.prototype.removeFooter=function(){if(this._footerRowIds){for(var t=this._footerRowIds.length,e=0;e<t;++e)delete this._groupRows[this._footerRowIds[e]];this._footerRowIds=null,this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},lt.prototype.enableMultiGroup=function(t){this._shared.multiGroupRow=!1!==t},lt.prototype.getGroupByRowId=function(t){return this._groupRows&&this._groupRows[t]||null},lt.prototype.getGroup=function(t){if(!this._groupMembers)return null;var e;if("number"==typeof t){if(!(e=this._groupList[t]))return null}else e=t+"";var i=this._groupMembers[e];if(i)return i;var o=e;return(i=this._groupRows[o])||this._getGroupByContentRowId(o)},lt.prototype._getGroupByContentRowId=function(t){if(this._groupMembers)for(var e=0;e<this._groupList.length;e++){var i=this._groupList[e],o=this._groupMembers[i]._getGroupByContentRowId(t);if(o)return o}else if(-1!==this._rids.indexOf(t))return this;return null},lt.prototype.getAllGroups=function(t){if(t||(t=[]),this._groupMembers)for(var e=this._groupList.length,i=0;i<e;++i){var o=this._groupList[i],n=this._groupMembers[o];t.push(n),n.getAllGroups(t)}return t},lt.prototype.getGroupList=function(){return this._groupList},lt.prototype.getGroupId=function(){return this._groupId},lt.prototype.getGroupValue=function(){return this._groupValue},lt.prototype.getGroupRowId=function(){return this._groupRowId},lt.prototype.getFooterRowIndex=function(t){if(this._footerRowIds)for(var e=this._footerRowIds.length;--e>=0;)if(this._footerRowIds[e]===t)return e;return-1},lt.prototype.getFooterRowIds=function(){return this._footerRowIds},lt.prototype.hasGroup=function(){return!!this._groupMembers},lt.prototype.getGroupRows=function(){return null},lt.prototype.getGroupLevel=function(t){if(null!=t&&this._groupRows){if("number"!=typeof t){var e=this.getGroup(t);return e?e._groupLevel:-1}this._rebuildRowIdsFromChildren();for(var i=this._getRids(),o=i[t];o;){var n=this._groupRows[o];if(n)return n._groupLevel;o=i[--t]}}return this._groupLevel},lt.prototype.enableColumnStats=function(t,e,i){if(!t)return null;var o=!1!==e,n=this._columnStats[t];if(o?(n||(n=new ot(this,t),this._columnStats[t]=n),n.addRef(i)):n&&(n.deRef(i)||(n.dispose(),delete this._columnStats[t])),this._groupMembers)for(var r=this._groupList.length;--r>=0;){var s=this._groupList[r];this._groupMembers[s].enableColumnStats(t,e,i)}return n||null},lt.prototype.getColumnStats=function(t){return this._columnStats[t]||null},lt.prototype.hide=function(t){var e=!1!==t;return this._hidden!==e&&(this._hidden=e,this._refreshAndNotify(),!0)},lt.prototype.isHidden=function(){return this._hidden},lt.prototype.isHiddenRow=function(t){return!!this._hiddenRids&&!0===this._hiddenRids[t]},lt.prototype._isHeaderRowShown=function(){return!(this._hiddenHeaderRow||this._shared.filterLogic&&0===this._rids.length||this._shared.autoGroupHiding&&null==this._groupValue)},lt.prototype._setCollapse=function(t){if(this._shared.contentAsHeader){if(this._hiddenHeaderRow&&this._showOnlyFirstMember!==t)return this._showOnlyFirstMember=t,!0}else if(this._isHeaderRowShown()&&this._collapsible&&this._collapsed!==t)return this._collapsed=t,!0;return!1},lt.prototype.collapse=function(t){this._setCollapse(!1!==t)&&(this._shared.contentAsHeader?this._hiddenHeaderRow&&this._requestRebuildingRowIds(this._showOnlyFirstMember):this._groupLevel>0&&this._requestRebuildingRowIds(this._collapsed))},lt.prototype.collapseAllGroups=function(t){var e=this.getAllGroups(),i=e.length;if(i){for(var o=!1!==t,n=0;n<i;++n)e[n]._setCollapse(o);this._requestRebuildingRowIds(!1)}},lt.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},lt.prototype.isCollapsed=function(){return this._collapsed||this._showOnlyFirstMember},lt.prototype.enableContentAsHeader=function(t){this._shared.contentAsHeader=!1!==t},lt.prototype.setDefaultCollapse=function(t){this._shared.defaultCollapse=!!t},lt.prototype.getDefaultCollapse=function(){return!!this._shared.defaultCollapse},lt.prototype.isCollapsible=function(){return this._collapsible},lt.prototype.disableCollapsing=function(t){this._collapsible=!(!1!==t)},lt.prototype.setGroupColor=function(t){1===this._groupLevel&&(this._groupColor=t)},lt.prototype.getGroupColor=function(){return 0===this._groupLevel?"":1===this._groupLevel?this._groupColor:this._parent.getGroupColor()},lt.prototype._getFirstHiddenRids=function(){if(this._shared.contentAsHeader&&this._showOnlyFirstMember){var t=this._rids;if(Array.isArray(t)&&t.length)return[t[0]]}return null},lt.prototype.getVisibleRowCount=function(){return this._collapsed?0:(this._rebuildRowIdsFromChildren(),this._getRids().length)},lt.prototype.isRowDataInGroup=function(t,e){var i=this._groupCriteria,o=this._groupLevel;if(!e||e===this.getGroupId())return this._isAllowedInGroup(null,t);for(var n=o;n<i.length;n++)if(i[n](t).indexOf(e)>=0)return!0;return!1},lt.prototype.isRowIdInGroup=function(t,e){var i=this.getRowData(t);return!!i&&this.isRowDataInGroup(i,e)},lt._getDataViewExpansionId=function(t,e){return t+"_ex"+e},lt.prototype.addRowExpansion=function(t,e){if(!(this._groupLevel>0)){if(!e||e<0){if(null!=e)return;e=1}var i=this._rids.indexOf(t);if(!(i<0)){var o=0;this._expansionMap?o=this._expansionMap[t]||0:(this._expansionMap={},this._expansionChildren={});var n=o+e;this._expansionMap[t]=n;for(var r=o;r<n;r++)this._expansionChildren[lt._getDataViewExpansionId(t,r)]=t;if(o||this._expansionCount++,!this._groupViewDirty&&this._updateExpansionView()){var s={};s.rid=t,s.type="inserted",s.nextRid=this._rids[i+1],s.fallback=i,this._dispatchDataChange(s)}}}},lt.prototype.removeRowExpansion=function(t){if(this._expansionMap){var e=this._expansionMap[t];if(e){for(var i=new Array(e),o=0;o<e;++o)i[o]=lt._getDataViewExpansionId(t,o),delete this._expansionChildren[i[o]];delete this._expansionMap[t],this._expansionCount--,this._groupViewDirty||this._updateExpansionView()&&(1===e?this._dispatchRowRemoved(i[0]):this._dispatchMultiRowRemoved(i))}}},lt.prototype.toggleRowExpansion=function(t,e,i){var o=this._toRowId(t);(e=null!=e?!0===e:!this.hasRowExpansion(o))?this.addRowExpansion(o,i):this.removeRowExpansion(o)},lt.prototype.removeAllRowExpansions=function(){this._expansionMap&&(this._expansionMap=null,this._expansionCount=0,this._expansionView=null,this._expansionChildren=null,this._refreshAndNotify())},lt.prototype.getRowsWithExpansion=function(t,e){if(!this._expansionMap)return[];var i=this._expansionView,o=i.length;(null==e||e>o)&&(e=o),t>0||(t=0);for(var n=this._expansionCount,r=new Array(o),s=t;s<e;++s){var l=i[s];if(this._expansionMap[l]&&(r[s]=l,--n<=0))break}return r},lt.prototype.getExpansionParents=function(t,e){var i=[];if(this._expansionMap){var o=this._expansionView,n=o.length;(null==e||e>n)&&(e=n),(!t||t<0)&&(t=0);for(var r=t;r<e;++r)i[r]=this._expansionChildren[o[r]]||""}return i},lt.prototype.isRowExpansion=function(t){return!!this._expansionChildren&&!!this._expansionChildren[t]},lt.prototype.hasRowExpansion=function(t){return!!this._expansionMap&&!!this._expansionMap[t]},lt.prototype.getRowExpansionId=function(t,e){return this._expansionMap&&(e||(e=0),e<(this._expansionMap[t]||0))?lt._getDataViewExpansionId(t,e):""},lt.prototype.getRowExpansionIndex=function(t){if(t){var e=t.match(/_ex(\d+)$/);if(e)return+e[1]}return-1},lt.prototype._updateExpansionView=function(){var t=this._expansionMap;if(t){if(!this._expansionCount||this._expansionCount<0)return this._expansionCount=0,this._expansionMap=null,this._expansionView=null,this._expansionChildren=null,!0;var e=this._pageView||this._groupView||this._rids,i=e.length,o=this._expansionView?this._expansionView.length:0;this._expansionView?this._expansionView.length=i:this._expansionView=new Array(i);for(var n=this._expansionCount,r=0,s=0;r<i;++r){var l=e[r];if(this._expansionView[s++]=l,n){var a=t[l]||0;if(a){for(var h=0;h<a;++h)this._expansionView[s++]=lt._getDataViewExpansionId(l,h);--n}}}return o!==this._expansionView.length}return!1},lt.prototype._transformView=function(t){var e=this._updatePaginationView(t);return!!(e|=this._updateExpansionView())},lt.prototype.searchAll=function(t,e){e||(e=[]),this._rebuildRowIdsFromChildren();for(var i=this._getRids(),o=i.length,n=0;n<o;++n){var r=i[n],s=this._dt.getRowData(r);s&&t(s)&&e.push(r)}return e},lt.prototype.searchPrev=function(t,e){this._rebuildRowIdsFromChildren();var i=this._getRids(),o=-1;"number"==typeof t?this._dt.getRowData(i[t])&&(o=t):o=i.indexOf(t);var n=-1,r=i.length;return o>0&&(n=this._searchRow(i,e,o-1,-1,-1))>=0||o>=0&&(n=this._searchRow(i,e,r-1,o,-1))>=0?n:-1},lt.prototype.searchNext=function(t,e){this._rebuildRowIdsFromChildren();var i=this._getRids(),o=-1;if("number"==typeof t?this._dt.getRowData(i[t])&&(o=t):o=i.indexOf(t),o<0)return-1;var n=-1,r=i.length;return o<r-1&&(n=this._searchRow(i,e,o+1,r,1))>=0||o>0&&(n=this._searchRow(i,e,0,o,1))>=0?n:-1},lt.prototype._searchRow=function(t,e,i,o,n){for(;i!==o;){var r=t[i],s=this._dt.getRowData(r);if(s&&e(s))return i;i+=n}return-1},lt.prototype.stall=function(t){var e=!1!==t;if(!!this._shared.stalledRids===e)return!1;if(e){var i={};this._shared.stalledRids=i;for(var o=this._getRids(),n=o.length;--n>=0;)i[o[n]]=1}else this._shared.stalledRids=null,this._refreshAndNotify();return!0},lt.prototype.enableAutoGroupRemoval=function(t){return t=!1!==t,!!this._shared.autoGroupRemoval!==t&&(this._shared.autoGroupRemoval=t,this._triggerGroupRefreshing(),!0)},lt.prototype.enableAutoGroupHiding=function(t){return t=!1!==t,!!this._shared.autoGroupHiding!==t&&(this._shared.autoGroupHiding=t,this._triggerGroupRefreshing(),!0)},lt.prototype.synchronizeRowOrder=function(){this.isSorting()&&this._dt._sort(this._sortingDefs)},lt.prototype.setSegmentSeparator=function(t,e){var i="";return"number"==typeof t?i=this.getRowId(t):"string"==typeof t&&(i=t),!!i&&((e=!1!==e)&&this.synchronizeRowOrder(),this._dt.setSegmentSeparator(i,e))},lt.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},lt.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},lt.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},lt.prototype.getSegment=function(t){return this._dt.getSegment(t)},lt.prototype.getSegmentLevel=function(t){return this._dt.getSegmentLevel(t)},lt.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},lt.prototype.collapseSegment=function(t,e){e=!1!==e;var i=this._dt._getSegmentSeparators();if(i){var o=this._toRowId(t);if(i.collapseSegment(o,e))return this._refreshAndNotify(),!0}return!1},lt.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},lt.prototype.expandAllSegments=function(){var t=this._dt._getSegmentSeparators();return!(!t||!t.expandAllSegments()||(this._refreshAndNotify(),0))},lt.prototype.setSegmentCollapsingLogic=function(){},lt.prototype.isSegmentCollapsed=function(t){var e=this._dt._getSegmentSeparators();return!!e&&e.isCollapsedSegment(this._toRowId(t))},lt.prototype.fillSegment=function(t){this._dt.fillSegment(this._toRowId(t))},lt.prototype.fillSegments=function(){this._dt.fillSegments()},lt.prototype.addSegmentChild=function(t,e,i){if(this._dt._getSegmentSeparators()){var o=this._toRowId(t),n=this._toRowId(e);return this._dt.addSegmentChild(o,n,i)}return!1},lt.prototype.addSegmentChildren=function(t,e,i){if(this._dt._getSegmentSeparators()){var o=this._toRowId(t),n=this._toRowIds(e);return this._dt.addSegmentChildren(o,n,i)}return!1},lt.prototype.removeSegmentChild=function(t,e){if(this._dt._getSegmentSeparators()){var i=this._toRowId(t),o=this._toRowId(e);return this._dt.removeSegmentChild(i,o)}return!1},lt.prototype.removeSegmentChildren=function(t,e){if(this._dt._getSegmentSeparators()){var i=this._toRowId(t),o=this._toRowIds(e);return this._dt.removeSegmentChildren(i,o)}return!1},lt.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},lt.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},lt.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},lt.prototype.sortSeparators=function(t,e,i){this._dt.sortSeparators(t,e,i)},lt.prototype.sortSegments=function(t){this._dt.sortSegments(t)},lt.prototype.enableEmptySegmentFiltering=function(t){t=!1!==t,this._emptySegmentFiltering!==t&&(this._emptySegmentFiltering=t,this._userFilter&&this._refreshAndNotify())},lt.prototype.enableSeparatorFiltering=function(t){t=!1!==t,this._separatorFiltering!==t&&(this._separatorFiltering=t,this._userFilter&&this._refreshAndNotify())},lt.prototype.setSegmentClassification=function(t,e){return this._dt.setSegmentClassification(this._toRowId(t),e)},lt.prototype._getSharedObject=function(){return this._shared},lt.prototype.getWrapSize=function(){return this._wrapSize},lt.prototype.getWrappedViews=function(){return this._wrappedViews},lt.prototype.wrapView=function(t){null!=t&&((!t||t<0)&&(t=0),this._wrapSize!==t&&(this._wrapSize=t,this._dispatch("wrapSizeChanged",{wrapSize:t,rids:this.getVisibleRowIds(!0)}))),this._updateWrapCount()},lt.prototype._updateWrapCount=function(){this._wrapTimerId=0;var t,e=this._wrapSize,i=this._wrappedViews,o=i?i.length:0,n=0;if(e){var r=this.getVisibleRowIds(!0),s=r.length;if(o<(n=Math.ceil(s/e)))for(i||(i=this._wrappedViews=[]),t=o;t<n;++t)this._wrappedViews[t]=new rt({dataView:this,wrapIndex:t,rids:r})}if(n<o){for(t=o;--t>=n;)this._wrappedViews[t].dispose();this._wrappedViews.length=n}e||(this._wrappedViews=null),o!==n&&this._dispatch("wrapCountChanged",{prevCount:o,newCount:n})},lt.prototype.dump=function(t){this._rebuildRowIdsFromChildren();var e=this._getRids();return U.constructTable(this.getMultipleRowData(e),t,e)},lt.prototype.log=function(t){console.table(this.dump(t))},lt.prototype._getRids=function(){return this._expansionView||this._pageView||this._groupView||this._rids},lt.prototype._updateRowIds=function(t){if(this._groupViewDirty=!1,this._parent&&!this._hidden){if(!this._shared.stalledRids){this._rids=t||this._parent.getAllRowIds(),this._dispatch("beforeFiltering",{}),this._excludedRids={};var e=0;e+=lt._copyObjectKeys(this._excludedRids,this._hiddenRids);var i=this._dt._getSegmentSeparators(),o=i?i.getSegments():null,n=this._getRemovalMap(this._excludedRids,this._userFilter,this._filteringOut,this._separatorFiltering?null:o);if(e+=n,this._collapsedRids=null,i&&(n&&this._emptySegmentFiltering&&(e+=this._getEmptySegments(this._excludedRids,o)),this._collapsedRids=i.getCollapsedRows(),e+=lt._copyObjectKeys(this._excludedRids,this._collapsedRids)),this._groupLevel>0&&!t&&(e+=this._getRemovalMap(this._excludedRids,this._groupFilterLogic,!1)),e&&(this._rids=this._rids.filter(this._byRemovalMap)),this._excludedRids=null,this._groupMembers)this._populateGroups();else{var r=this._updatePageCount();this._sort()||r||this._transformView()}}}else this._resetAllViews()},lt.prototype._onDataChanged=function(t){if(!this._conflator.conflate(t)){var e=this._conflator.popAllData()||[t],i=e.length;if(1===i){var o=e[0];if(o.globalChange)return this._updateRowIds(),void this._dispatchDataChange(o);var n=o.type;"inserted"===n?this._onRowInserted(o):"removed"===n?this._onRowRemoved(o):this._onRowUpdated(o)}else{this._updateRowIds();for(var r=!0,s=0;s<i;s++)if(!e[s].positionChangeOnly){r=!1;break}this._dispatchDataChange({globalChange:!0,positionChangeOnly:r,events:e})}}},lt.prototype._onRowInserted=function(t){if(this._shared.stalledRids)return 0;if(this.isRowFiltered(t.rid,t.rowData))return 0;var e=0;if(this._groupMembers){var i,o=this._resolveGroupId(t.rowData),n=o.length;n>1&&(this._shared.multiGroupRow=!0);for(var r=0;r<n;r++)if(i=o[r],this._groupMembers[i])e=this._groupMembers[i]._onRowInserted(t);else{var s=this._addGroup(i);s&&(t.globalChange=!0,s._onRowInserted(t),e=1)}t.globalChange&&(this._groupViewDirty=!0)}if(this._hidden)return e;var l=t.rid,a=t.rowData;if(!this._isAllowedInGroup(l,a))return e;var h,u=t.nextRid;h=this.isSorting()&&!t.segmentChanged?this._addDataRow(l):this._addDataRow(l,u,t.fallback);var p=this._updatePageCount(),_=this._sort();return _&&(t.globalChange=!0),t.globalChange?_||p||this._transformView():(t={rid:l,rowData:a,type:"inserted"},null!=u&&(t.nextRid=u,t.fallback=h),this._transformView(h)&&(t.globalChange=!0)),this._dispatchDataChange(t),1},lt.prototype._onRowRemoved=function(t){if(this._shared.stalledRids)return 0;if(t.segmentChanged&&this.isSorting())return this._refreshAndNotify(),1;var e,i=0,o=t.rids;if(this._groupMembers){var n,r,s=t.rowData;if(!o&&s){for(n=this._resolveGroupId(s),e=0;e<n.length;e++)r=n[e],this._groupMembers[r]&&(i+=this._groupMembers[r]._onRowRemoved(t));i>1&&(this._groupViewDirty=!0)}else{var l=this._groupList.length;for(e=0;e<l;++e)r=this._groupList[e],i+=this._groupMembers[r]._onRowRemoved(t)}}var a,h,u=NaN,p=null;if(i=0,o){for(p=[],e=o.length;--e>=0;)a=o[e],(h=this._removeDataRow(a))>=0&&(p.push(a),h>=u||(u=h));i=p.length}else a=t.rid,(h=this._removeDataRow(a))>=0&&(p=[a],u=h,i=1);return i>0&&(this._updatePageCount()||this._transformView(u)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(p),this._shared.autoGroupRemoval&&this._groupRows&&this._rids.length<=0&&this._triggerGroupRefreshing(),this._hiddenHeaderRow&&this._requestRebuildingRowIds(!0)),i},lt.prototype._onRowUpdated=function(t){var e,i,o=t.rid,n=t.rowData;if(this.isRowFiltered(o,n))return this._onRowRemoved(t)?1:0;if(this._groupMembers){var r=[],s=this._groupList.length;for(e=0;e<s;++e)i=this._groupList[e],r[this._groupMembers[i]._onRowUpdated(t)]=!0;t.globalChange&&(this._groupViewDirty=!0);var l=0;if(r[2]?l=2:r[1]?this._isAllowedInGroup(o,n)||(l=1):r[4]&&(l=4),this._groupLevel>0)1===l?(lt._removeArrayItem(this._rids,o)>=0&&this._groupView&&lt._removeArrayItem(this._groupView,o),this._shared.multiGroupRow&&(this._groupViewDirty=!0)):2===l&&(this._hidden||(this._rids.indexOf(o)<0&&this._rids.push(o),this._groupViewDirty=!0,this._resolveGroupId(n).length>1&&(this._shared.multiGroupRow=!0)));else{var a=r[1]&&r[2]||r[4];if(this._shared.multiGroupRow||!a){var h=this._resolveGroupId(n);for(e=0;e<h.length;e++){i=h[e];var u=this._addGroup(i);u&&(u._onRowInserted(t),l=1)}}!a&&!this._hidden&&this._rids.indexOf(o)<0&&this._addDataRow(o),4===l?this._shared.multiGroupRow?this._dispatchGlobalChange():this._dispatchDataChange(t):(this._groupViewDirty=!0,this._dispatchGlobalChange())}return l}return this._isAllowedInGroup(o,n)?this._rids.indexOf(o)<0?(this._onRowInserted(t),2):(this._shared.stalledRids||this._sort()&&(t.globalChange=!0),this._dispatchDataChange(t),4):this._onRowRemoved(t)?1:0},lt.prototype._onGroupAdded=function(t){if(!this._hidden){var e=t.newGroup,i=e.getGroupRowId();this._groupView.push(i),this._groupViewDirty=!0,this._dispatch("groupAdded",t),o.pushArrayItems(this._groupView,e.getFooterRowIds())}},lt.prototype._onBeforeGroupAdded=function(t){this._dispatch("beforeGroupAdded",t)},lt.prototype._requestRebuildingRowIds=function(t){this._groupMembers&&(this._groupViewDirty=!0),this._groupLevel>0?this._parent._requestRebuildingRowIds(t):(t?this._rebuildRowIdsFromChildren():this._updateRowIds(),this._dispatchGlobalChange())},lt.prototype._refreshAndNotify=function(){this._updateRowIds(),this._dispatchGlobalChange()},lt.prototype._onRefreshTimeout=function(){this._refreshTimerId=0,this._refreshAndNotify()},lt.prototype._addDataRow=function(t,e,i){var o=this._getRowIndex(this._rids,e,i);return this._insertItems(this._rids,o,t),this._groupView?this._groupMembers?(this._groupViewDirty=!0,this._insertItems(this._groupView,-1,t)):o<0?this._insertItems(this._groupView,-1,t):(o=this._getRowIndex(this._groupView,e,i),this._insertItems(this._groupView,o,t)):o>=0?o:this._rids.length-1},lt.prototype._insertItems=function(t,e,i){return e<0?(e=t.length,t.push(i)):t.splice(e,0,i),e},lt.prototype._getRowIndex=function(t,e,i){if(null==e)return-1;var o=this._rids.indexOf(e);return o>=0?o:null==i||i>=t.length?-1:i},lt.prototype._removeDataRow=function(t){var e=lt._removeArrayItem(this._rids,t);return this._groupView&&e>=0&&(e=lt._removeArrayItem(this._groupView,t)),e},lt._removeArrayItem=function(t,e){var i=t.indexOf(e);return i>=0&&t.splice(i,1),i},lt._removeArrayItems=function(t,e){for(var i=NaN,o=0,n=t.length;--n>=0;)e[t[n]]?++o:o&&(i=n+1,t.splice(i,o),o=0);return o&&(t.splice(0,o),i=0),i},lt._copyObjectKeys=function(t,e){if(e){var i=0;for(var o in e)t[o]=1,++i;return i}return 0},lt.prototype._isAllowedInGroup=function(t,e){if(this._groupLevel>0)for(var i=this,o=this._groupLevel;--o>=0;){if(!i._groupFilterLogic(t,e))return!1;i=i.getDataSource()}return!0},lt.prototype.isRowFiltered=function(t,e){return this._shared.stalledRids?!this._shared.stalledRids[t]:!(!this._hiddenRids||!this._hiddenRids[t])||!(!this._collapsedRids||!this._collapsedRids[t])||!(!this._userFilter||this._userFilter(t,e)!==this._filteringOut)},lt.prototype._sort=function(){if(this._groupMembers)return!1;if(this._dt._getSegmentSeparators()||this.isSorting()){var t=this._rids,e=this._dt.getMultipleRowData(t),i=this._dt.getSegmentValues(t,!0),o=et._performMultiLevelSorting(e,this._sortingDefs,i);if(o)return this._rids=et._reorderItems(t,o),this._transformView(),!0}return!1},lt.prototype._byRemovalMap=function(t){return!this._excludedRids[t]},lt.prototype._getRemovalMap=function(t,e,i,o){if(!e)return 0;var n,r,s,l=this._rids,a=this._dt,h=0,u=l.length;if(o)for(r=u;--r>=0;)o[n=l[r]]||((s=a.getRowData(n))?e(n,s)===i&&(t[n]=1,++h):(t[n]=1,++h));else for(r=u;--r>=0;)n=l[r],(s=a.getRowData(n))?e(n,s)===i&&(t[n]=1,++h):(t[n]=1,++h);return h},lt.prototype._getEmptySegments=function(t,e){var i=this._dt._getSegmentSeparators(),o=0;for(var n in e){var r=i.getSegment(n);if(r){var s=r.getChildren(),l=!0;for(var a in s)if(!t[a]){l=!1;break}l&&(t[n]=1,++o)}}return o},lt.prototype._getFilterLogic=function(t,e){return null!=t?"function"==typeof t?t:"string"==typeof t?lt._defaultFilterLogic.bind(null,t,e):lt._defaultFilterLogic.bind(null,t+"",e):null},lt.prototype._setPage=function(t){return t>this._lastPageIndex&&this._pageCorrection&&(t=this._lastPageIndex),t<1&&(t=1),t!=this._pageIndex&&(this._pageIndex=t,this._transformView(),this._dispatch("pageIndexChanged",{pageIndex:this._pageIndex}),!0)},lt.prototype._updatePaginationView=function(t){var e=!1;if(this._pageView){t||(t=0);var i=this._pageSize*(this._pageIndex-1),o=this._pageSize+i;if(t<o){var n=this._groupView||this._rids;o>n.length&&(o=n.length);var r=o-i;this._pageView.length=r>=0?r:0;for(var s=i;s<o;++s)this._pageView[s-i]=n[s];e=!0}}return e},lt.prototype._updatePageCount=function(){var t=1;if(this._pageSize>0){var e=this._groupView||this._rids,i=e.length>0?e.length:0;t=Math.ceil(i/this._pageSize)}return!!(this._lastPageIndex!==t&&(this._lastPageIndex=t,this._dispatch("pageCountChanged",{pageCount:this._lastPageIndex}),this._lastPageIndex<this._pageIndex&&this._pageCorrection))&&this._setPage(this._lastPageIndex)},lt.prototype._dispatchRowRemoved=function(t){t&&this._dispatchDataChange({type:"removed",rid:t})},lt.prototype._dispatchMultiRowRemoved=function(t){if(t){var e=t.length;1===e?this._dispatchRowRemoved(t[0]):e>1&&this._dispatchDataChange({type:"removed",rids:t})}},lt.prototype._dispatchGlobalChange=function(){this._dispatchDataChange(et._globalChangeArg)},lt.prototype._dispatchDataChange=function(t){this._dispatch("dataChanged",t),this._wrapSize&&!this._wrapTimerId&&(this._wrapTimerId=setTimeout(this._updateWrapCount))},lt.prototype._setParent=function(t){this._parent=t,this._dt=t;do{(t=t.getDataSource())&&(this._dt=t)}while(t);if(this._parent&&this._dt!==this._parent){this._shared=this._parent._shared;var e=this._parent._columnStats;if(e)for(var i in e){var o=this.enableColumnStats(i),n=this._parent.getColumnStats(i);o&&n&&o.setColumnDataGetter(n.getColumnDataGetter())}}},lt.prototype._populateGroups=function(){var t,e,i,o,n,r,s=this._rids;this._rids=[];var l={},a=[];for(e=s.length,t=0;t<e;++t){var h=s[t],u=this._dt.getRowData(h);if(u){(r=(n=this._resolveGroupId(u)).length)>1&&(this._shared.multiGroupRow=!0);for(var p=0;p<r;p++){var _=l[o=n[p]];_?_.push(h):(_=[h],l[o]=_,a.push(o))}}}if(this._shared.autoGroupRemoval)for(t=e=this._groupList.length;--t>=0;)l[o=this._groupList[t]]||(i=this._groupMembers[o])&&!i._predefinedGroup&&this._removeGroupMember(t,o);var c=null;if(this._preDefGroups&&this._groupLevel<this._preDefGroups.length&&(c=this._preDefGroups[this._groupLevel]),e=this._groupList.length,this._preDefGroupsDirty)for(this._preDefGroupsDirty=!1,t=e;--t>=0;)o=this._groupList[t],(i=this._groupMembers[o])&&i._predefinedGroup&&(c?c.indexOf(i._groupId)<0&&this._removeGroupMember(t,o):this._removeGroupMember(t,o));if(c)for(e=c.length,t=0;t<e;++t){var d=this._addGroup(c[t]);d&&(d._predefinedGroup=!0)}for(e=a.length,t=0;t<e;++t)this._addGroup(a[t]);for(e=this._groupList.length,t=0;t<e;++t)o=this._groupList[t],(i=this._groupMembers[o])._updateRowIds(l[o]),i._markColumnStatsDirty();this._groupViewDirty=!0,this._rebuildRowIdsFromChildren()},lt.prototype._removeGroupMember=function(t,e){var i=this._groupMembers[e];i&&(this._groupList.splice(t,1),delete this._groupMembers[e],i.dispose())},lt.prototype._defaultGroupCriteria=function(t,e){var i=e[t];return Array.isArray(i)?i.map((function(t){return t+""})):[i+""]},lt.prototype._groupFilterLogic=function(t,e){return this._groupCriteria[this._groupLevel-1](e).indexOf(this._groupId)>=0},lt.prototype._internalGroupSortingLogic=function(t,e){var i=this._groupMembers[t],o=this._groupMembers[e];return this._groupSortingLogic(t,e,i,o)},lt.prototype._addGroup=function(t){var e=t+"";if(!e)return null;var i=this._groupMembers[e];if(i)return null;var o,n=(this._groupRowId||"_grp")+"_"+e;if(this._hasListener("beforeGroupAdded")&&(o={dataView:this,newGroupId:e,newGroupValue:t,newGroupRowId:n,newGroupLevel:this._groupLevel+1},this._dispatch("beforeGroupAdded",o),o.cancel))return null;i=new lt;var r=this._shared.defaultCollapse;return null!=r&&(i._collapsed=r),i._groupId=e,"string"==typeof t?"null"==t?i._groupValue=null:"undefined"!=t&&(i._groupValue=t):i._groupValue=t,o&&!0===o.hideHeaderRow&&(i._hiddenHeaderRow=!0),i._groupRowId=n,i._groupLevel=this._groupLevel+1,i._groupCriteria=this._groupCriteria,i._preDefGroups=this._preDefGroups,i._groupLevel<i._groupCriteria.length&&(i._groupMembers={},i._groupList=[],i._groupView=[]),i._groupRows=this._groupRows,i._setParent(this),i._sortingDefs=this._sortingDefs,this._groupMembers[e]=i,this._groupList.push(e),this._groupRows[i._groupRowId]=i,this._hidden||(i._isHeaderRowShown()&&this._groupView.push(i._groupRowId),this._groupViewDirty=!0,i._beingAdded=!0,this._dispatch("groupAdded",{dataView:this,newGroup:i}),i._beingAdded=!1),i.listen("groupAdded",this._onGroupAdded),this._hasListener("beforeGroupAdded")&&i.listen("beforeGroupAdded",this._onBeforeGroupAdded),i},lt.prototype._triggerGroupRefreshing=function(){this._groupLevel>0?this._parent&&this._parent._triggerGroupRefreshing():this._groupRows&&!this._refreshTimerId&&(this._refreshTimerId=setTimeout(this._onRefreshTimeout,100))},lt.prototype._rebuildRowIdsFromChildren=function(){if(this._groupViewDirty){if(this._rids.length=0,this._groupView&&(this._groupView.length=0),!this._hidden)for(var t=this._groupList.length,e=0;e<t;++e){var i=this._groupList[e],n=this._groupMembers[i];if(n._rebuildRowIdsFromChildren(),o.pushArrayItems(this._rids,n._rids),!this._collapsed&&this._groupView&&(n._isHeaderRowShown()&&this._groupView.push(n._groupRowId),!n._collapsed)){var r=n._getFirstHiddenRids()||n._groupView||n._rids;o.pushArrayItems(this._groupView,r),o.pushArrayItems(this._groupView,n._footerRowIds)}}this._groupViewDirty=!1,this._updatePageCount()||this._transformView()}},lt.prototype._resolveGroupId=function(t){return this._groupCriteria[this._groupLevel](t)},lt.prototype._markColumnStatsDirty=function(){for(var t in this._columnStats)this._columnStats[t].markDirty()},lt._defaultFilterLogic=function(t,e,i,o){return o[t]===e},lt._defaultGroupSortingLogic=function(t,e){return t==e?0:t<e?-1:1};const at=lt;var ht=function(t,e,i){this._onConflated=this._onConflated.bind(this),this._data=[],"function"==typeof t?this.setFunction(t,i):"function"==typeof e&&this.setFunction(e,i),"number"==typeof e?this.setConflatingTime(e):"number"==typeof t&&this.setConflatingTime(t)};ht.prototype._data,ht.prototype._func=null,ht.prototype._delay=0,ht.prototype._timerId=0,ht.prototype._conflated=!1,ht.prototype._disabled=!1,ht.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},ht.prototype.popAllData=function(){if(this._data.length){var t=this._data;return this._data=[],t}return null},ht.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},ht.prototype.conflate=function(t){return!this._disabled&&(null!=t&&this._data.push(t),!this._conflated&&(this._timerId||(this._timerId=setTimeout(this._onConflated,this._delay)),!0))},ht.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},ht.prototype._onConflated=function(){this._conflated=!0;try{this._func()}catch(t){console.error(t.message||t)}this._timerId=0,this._data.length=0,this._conflated=!1},ht.prototype.getData=function(){return this._data},ht.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},ht.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},ht.prototype.disable=function(t){this._disabled=!1!==t},ht.prototype.isEnabled=function(){return!this._disabled},ht.prototype.enable=function(t){this._disabled=!1===t},ht._proto=ht.prototype;const ut=ht;var pt=function(t){var e=this;e._onDataChanged=e._onDataChanged.bind(e),e.extendEventArg=e.extendEventArg.bind(e),e._dataChangedConflator=new ut(100,e._onDataChanged),e._grid=t,e._grid.setEventArgExtender("rowCountChanged",e.extendEventArg),e._grid.setEventArgExtender("rowHeightChanged",e.extendEventArg),e._grid.setEventArgExtender("rowAvailable",e.extendEventArg),e._grid.listen("rowAvailable",e._dispatch.bind(this,"rowAvailable")),e._addEvent("dataChanged"),e._addEvent("rowAvailable")};u.inherits(pt,l),pt._runningId=0,pt.prototype._id="",pt.prototype._type="",pt.prototype._grid=null,pt.prototype._snapshot=null,pt.prototype._dataView=null,pt.prototype._dataArg=null,pt.prototype._autoSyncRowCount,pt.prototype._bindingEnabled=!0,pt.prototype._parent=null,pt.prototype._children=null,pt.prototype._dataChangedConflator,pt.prototype.getId=function(){return this._id},pt.prototype.setId=function(t){return this._id=t||"section"+pt._runningId++,this._grid.setAttribute("id",this._id),this._id},pt.prototype.getSection=function(){return this._snapshot||this._grid},pt.prototype.getSectionName=function(){return this._grid.getId()},pt.prototype.getIndex=function(){return this._grid.getIndex()},pt.prototype.getType=function(){return this._type},pt.prototype.setType=function(t){this._type!==t&&(this._type&&this._grid.removeClass(this._type),this._type=t||"",t&&this._grid.addClass(t))},pt.prototype.getDataSource=function(){return this._dataView},pt.prototype.setDataSource=function(t){var e=this;e.getAutoSyncRowCount()&&e._dataView!==t&&(e._dataView&&e._dataView.unlisten("dataChanged",this._onDataChanged),e._dataChangedConflator.reset(),e._dataArg=null,e._dataView=t,null!==e._dataView&&e._dataView.listen("dataChanged",e._onDataChanged),e._dispatchDataChanged(0,NaN))},pt.prototype.getRootDataSource=function(){if(!this._dataView)return null;var t=this._dataView.getDataSource();if(!t)return null;for(;t.getDataSource();)t=t.getDataSource();return t},pt.prototype.getData=function(t,e){return this._dataView?(e=this._getRowId(e),this._dataView.getData(e,t)):null},pt.prototype.setData=function(t,e,i){return!!this._dataView&&(e=this._getRowId(e),this._dataView.setData(e,t,i),!0)},pt.prototype.getRowData=function(t){return this._dataView?(t=this._getRowId(t),this._dataView.getRowData(t)):null},pt.prototype.removeRowData=function(t){if(!this._dataView)return!1;var e=this.getRootDataSource();if(!e)return!1;t=this._getRowId(t);var i=e.getRowIndex(t);return!(i<0||(e.removeRow(i),0))},pt.prototype.activateColumns=function(t,e,i){if("content"===this._type)for(var o=i+1;--o>=e;){var n=t[o];null!=n&&this._grid.activateColumn(o,n)}},pt.prototype.getChildren=function(){return this._children},pt.prototype.setParent=function(t){if(this._parent){var e=this._parent._children.indexOf(this);e>=0&&(this._parent._children.splice(e,1),this._parent._children.length<=0&&(this._parent._children=null)),this._parent=null}this._parent=t,this._parent&&(this._parent._children||(this._parent._children=[]),this._parent._children.push(this))},pt.prototype.getParent=function(){return this._parent},pt.prototype.getDataChangedConflator=function(){return this._dataChangedConflator},pt.prototype.disableConflation=function(t){this._dataChangedConflator.disable(t)},pt.prototype.disableDataBinding=function(t){this._bindingEnabled=!1===t},pt.prototype.getAutoSyncRowCount=function(){return null!=this._autoSyncRowCount?this._autoSyncRowCount:"content"===this._type},pt.prototype.setAutoSyncRowCount=function(t){if(this._autoSyncRowCount=t,this.getAutoSyncRowCount()){var e=this._dataView?this._dataView.getVisibleRowCount():0;this._grid.setRowCount(e)}},pt.prototype.isDataBindable=function(){return!(!this._bindingEnabled||!this._dataView)},pt.prototype.dispose=function(){var t=this;t._dataChangedConflator.reset(),t._dataArg=null,t._grid&&t._grid.dispose(),t._dataView&&t._dataView.unlisten("dataChanged",t._onDataChanged),t.unlistenAll(),t.setParent(null),t._grid=null,t._dataView=null},pt.prototype.extendEventArg=function(t){return t||(t={}),t.sectionSettings!==this&&(t.sectionSettings=this,t.section=this._snapshot||this._grid,t.sectionName=this._grid.getId(),t.sectionIndex=this._grid.getIndex(),t.sectionType=this._type,t.dataSource=this._dataView,this._snapshot?t.print=!0:t.print&&(t.print=!1)),t},pt.prototype.extendRenderEventArg=function(t,e,i){return t=this.extendEventArg(t),e>=0||(this._snapshot?(e=0,i=this._grid.getRowCount()):(e=this._grid.getFirstIndexInView(),i=this._grid.getLastIndexInView()+1)),t.fromRowIndex=e,t.toRowIndex=i,t},pt.prototype.extendDataEventArg=function(t,e,i){var o,n;if(t||(t={}),t.firstUpdate=e,t.lastUpdate=i,this._snapshot?(o=0,n=this._grid.getRowCount()):(o=this._grid.getFirstIndexInView(),n=this._grid.getLastIndexInView()+1),t.fromRowIndex=e>o?e:o,this._dataView){var r=this._dataView.getVisibleRowCount();t.dataRowCount=r,n>r&&(n=r)}return t.toRowIndex=i+1<n?i+1:n,this.extendEventArg(t),t},pt.prototype.setIndex=function(t){this._grid.setIndex(t)},pt.prototype.getRowOffset=function(){return this._grid.getRowOffset()},pt.prototype.setRowOffset=function(t){this._grid.setRowOffset(t)},pt.prototype.enableColumnVirtualization=function(t){t=!1!==t,"content"===this._type&&this._grid.enableColumnVirtualization(t)},pt.prototype.isBinding=function(){return this._isEventDispatching("dataChanged")},pt.prototype._onDataChanged=function(t){if(!this.isBinding()){if(this._bindingEnabled){if(t)this._mergeEvent(t);else if(!this._dataArg)return}else if(!this.getAutoSyncRowCount())return;this._dataChangedConflator.conflate()||(this._calculateChangeIndices(),this._dataArg?this._dispatchDataChanged(this._dataArg.firstUpdate,this._dataArg.lastUpdate):this._dispatchDataChanged(0,NaN))}},pt.prototype._dispatchDataChanged=function(t,e){var i=this.getAutoSyncRowCount(),o=this._dataView?this._dataView.getVisibleRowCount():0,n=this._grid.getRowCount();i?o!==n&&this._grid.setRowCount(o,!0):o>n&&(e=n-1),this.updateRowData(t,e,this._dataArg),this._dataArg=null},pt.prototype.updateRowData=function(t,e,i){this.isDataBindable()&&(this._grid._getTempRowHeights()&&(t=this._grid.getFirstIndexInView(),e=this._grid.getLastIndexInView()+1),(i=this.extendDataEventArg(i,t,e)).fromRowIndex<i.toRowIndex&&this._dispatch("dataChanged",i))},pt.prototype.rerender=function(){this.isDataBindable()?this.updateRowData():this._dispatch("rowAvailable",this.extendEventArg())},pt.prototype.snapshot=function(t){if(t){this._snapshot=t;try{t.setColumnCount(this._grid.getColumnCount()),t.setRowCount(this._grid.getRowCount()),this._dispatch("rowAvailable",this.extendEventArg())}catch(t){console.warn("Unable to take a snapshot: "+t.message)}this._snapshot=null,this._dispatch("rowAvailable",this.extendEventArg())}},pt.prototype._getRowId=function(t){return o.isNumber(t)?this._dataView.getRowId(t):t},pt.prototype._mergeEvent=function(t){var e=this._dataArg;if(e||((e=this._dataArg={}).actualUpdate=!0,e.positionChangeOnly=!0,e.events=[],e.firstUpdate=NaN,e.lastUpdate=NaN,e.updatedRids={}),t.positionChangeOnly||(e.positionChangeOnly=!1),t.events?e.events=e.events.concat(t.events):e.events.push(t),!e.globalChange){if(t.globalChange)return e.globalChange=!0,e.firstUpdate=0,void(e.lastUpdate=NaN);var i=t.rids;if(i)for(var o=i.length;--o>=0;)e.updatedRids[i[o]]=!0;else t.rid&&(e.updatedRids[t.rid]=!0);"updated"!==t.type&&(e.indexShifted=!0,"removed"===t.type&&(e.dataRemoved=!0))}},pt.prototype._calculateChangeIndices=function(){var t,e;if(this.isDataBindable()&&!this._dataArg.globalChange)if(this._dataArg.indexShifted){if(this._dataArg.dataRemoved)this._dataArg.firstUpdate=0;else for(t in this._dataArg.updatedRids)(e=this._dataView.getRowIndex(t))>=0&&(this._dataArg.firstUpdate<=e||(this._dataArg.firstUpdate=e));this._dataArg.lastUpdate=this._dataView.getVisibleRowCount()}else for(t in this._dataArg.updatedRids)(e=this._dataView.getRowIndex(t))>=0&&(this._dataArg.firstUpdate<=e||(this._dataArg.firstUpdate=e),this._dataArg.lastUpdate>=e||(this._dataArg.lastUpdate=e))},pt._proto=pt.prototype;const _t=pt;var ct=function(t){this._layout=t,this._arg={},this._addEvent("indexChanged")};u.inherits(ct,l),ct.prototype._layout,ct.prototype._viewSize=0,ct.prototype._viewOffset=0,ct.prototype._startOffsetCount=0,ct.prototype._endOffsetCount=0,ct.prototype._bufferSize=0,ct.prototype._arg=null,ct.prototype._enabled=!0,ct.prototype._active=!0,ct.prototype._virtualizable=!1,ct.prototype._getMinIndex=function(){return this._startOffsetCount},ct.prototype._getMaxIndex=function(){var t=this._layout.getLaneCount()-this._endOffsetCount;return t>this._startOffsetCount?t:this._startOffsetCount},ct.prototype.getContentStart=function(t){return this._layout.getLaneStart(t)},ct.prototype.getContentInViewCount=function(){var t=this.getFirstIndexInView(),e=this.getLastIndexInView();return t>=0&&t<e?e-t+1:0},ct.prototype._getContentSizeInBounds=function(){var t=this._getMinIndex(),e=this._getMaxIndex();return this._layout.getLaneStart(e)-this._layout.getLaneStart(t)},ct.prototype.getViewSize=function(){return this._viewSize},ct.prototype.getViewOffset=function(){var t=this._getMinIndex();return this._viewOffset+this._layout.getLaneStart(t)},ct.prototype.getIndexOffset=function(){return this._startOffsetCount},ct.prototype.isVirtualizable=function(){return this._virtualizable},ct.prototype.getFirstIndexInView=function(){if(!this._virtualizable)return 0;var t=this.getViewOffset(),e=this._layout.getTrackSize();return t>=e&&(t=e-this._viewSize),t<0?0:this._layout.hitTest(t)},ct.prototype.getLastIndexInView=function(){if(this._virtualizable){var t=this.getViewOffset()+this._viewSize,e=this._getMaxIndex();return t>=this._layout.getLaneStart(e)?e-1:this._layout.hitTest(t)}return this._layout.getLaneCount()-1},ct.prototype.getPrevFirstIndexInView=function(){return null!=this._arg.prevFirstIndex?this._arg.prevFirstIndex:-1},ct.prototype.getPrevLastIndexInView=function(){return null!=this._arg.prevLastIndex?this._arg.prevLastIndex:-1},ct.prototype.update=function(t){if(!(!0===t||this._enabled&&this._active))return!1;if(this._isEventDispatching("indexChanged"))return!1;var e=this.getFirstIndexInView(),i=this.getLastIndexInView(),o=this._arg.prevFirstIndex!==e||this._arg.prevLastIndex!==i;return(t||o)&&(this._arg.firstIndex=e,this._arg.lastIndex=i,this._dispatch("indexChanged",this._arg),this._arg.prevFirstIndex=e,this._arg.prevLastIndex=i),o},ct.prototype.isEnabled=function(){return this._enabled},ct.prototype.enable=function(t){t=!1!==t,this._enabled!==t&&(this._enabled=t,this.validateVirtualization(),this.update(!0))},ct.prototype.disable=function(t){this.enable(!1===t)},ct.prototype.isActive=function(){return this._active},ct.prototype.activate=function(t){t=!1!==t,this._active!==t&&(this._active=t,this.validateVirtualization(),this.update(!0))},ct.prototype.deactivate=function(t){this.activate(!1===t)},ct.prototype.getBufferSize=function(){return this._bufferSize},ct.prototype.setContentLayout=function(t){this._layout!==t&&(this._layout=t,this.validateVirtualization())},ct.prototype.setViewSize=function(t){t<0&&(t=0),this._viewSize!==t&&(this._viewSize=t,this.validateVirtualization())},ct.prototype.setViewOffset=function(t){this._viewOffset=t>0?t:0,this.update()},ct.prototype.setViewBounds=function(t,e){this._startOffsetCount=t>0?t:0,this._endOffsetCount=e>0?e:0,this.validateVirtualization()},ct.prototype.setBufferSize=function(t){t<0&&(t=0),this._bufferSize!==t&&(this._bufferSize=t,this.validateVirtualization())},ct.prototype.validateVirtualization=function(){this._virtualizable=!1,this._enabled&&this._active&&this._viewSize>0&&this._getContentSizeInBounds()>this._viewSize&&(this._virtualizable=!0)},ct._proto=ct.prototype;const dt=ct;var gt=function(){var t=this;t._vertical=!0,t._hostClassName="vscrollbar-host",gt.base(this,"constructor"),t._onScroll=t._onScroll.bind(t),t._addPaneAt(),t._element.classList.add("grid-vscroll"),t._trackContent.style.width="1px",t.disableMouseWheel(!1),t.listen("scroll",t._onScroll),t._addEvent("contentScrolled")};u.inherits(gt,k),gt.prototype.setScrollContent=function(t,e,i){this._clearAllPanes();var o=e.length;if(!(o<=0)){for(var n=this._panes[0],r=this._paneSliders[0],s=0;s<i;)e[s++].setParent(t);n.setParent(t);for(var l=o-this._footerCount;s<l;)e[s++].setParent(r);for(;s<o;)e[s++].setParent(t);this.invalidateContent()}},gt.prototype.setHeight=function(t){return this.setTrackSize(t,t),!0},gt.prototype.getHeight=function(){return this.getPaneSize()},gt.prototype.getScrollTop=function(){return this._getScrollValue()},gt.prototype.setScrollTop=function(t){this.update(),this._scrollTo(t)},gt.prototype.isEndOfVerticalScroll=function(){return this._isEndOfScroll()},gt.prototype.getContentHeight=function(){for(var t=this._paneSliders[0].getContent(!0),e=0,i=t.length;--i>=0;)e+=t[i].offsetHeight;return e},gt.prototype.calculateContentSize=function(){return this.getContentHeight()},gt.prototype.getPane=function(){return this._panes[0]},gt.prototype._onScroll=function(t){this._dispatch("contentScrolled",t)},gt._proto=gt.prototype;const ft=gt;var yt=function(t,e){return t>e?e:t<0?0:t},mt=function(t){var e=this;e._onRestingPosition=e._onRestingPosition.bind(e),e._updateRowBounds=e._updateRowBounds.bind(e),e._element=document.createElement("div"),e._element.className="tr-vlg section",t||(t={}),t.horizontalScrollbar&&(e._hscrollbar=t.horizontalScrollbar),t.owner=this,e._grid=new N(t),e._grid.setParent(e._element),e._layoutY=new m,e._selectionList=new P,e._reverter=new F(e._onRestingPosition,200),e._addEvent("rowHighlighted"),e._addEvent("rowCountChanged"),e._addEvent("rowHeightChanged"),e._addEvent("rowAvailable")};u.inherits(mt,_),mt.prototype._index=-1,mt.prototype._rowOffset=0,mt.prototype._firstIndex=0,mt.prototype._grid,mt.prototype._layoutY,mt.prototype._selectionList=null,mt.prototype._reverter=null,mt.prototype._rowBounds=null,mt.prototype._rowBoundCache=null,mt.prototype._rowSelDirty=!1,mt.prototype._cellBound=null,mt.prototype._cbLftIdx=0,mt.prototype._cbRgtIdx=0,mt.prototype._cbTopIdx=0,mt.prototype._cbBtmIdx=0,mt.prototype._rowBoundTimer=0,mt.prototype._boundLayer=null,mt.prototype._hscrollbar=null,mt.prototype._session="A",mt.prototype._tempRowHeights=null,mt.prototype.getWidth=function(){return this.isVisible()?this._grid.getWidth():0},mt.prototype.getHeight=function(){return this.isVisible()?this._element.offsetHeight:0},mt.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._hscrollbar=null,this._grid.dispose(),this._dispose(),this._reverter.dispose(),this._rowBounds=this._rowBoundCache=null,this._rowSelDirty=!1,this._rowBoundTimer&&(clearTimeout(this._rowBoundTimer),this._rowBoundTimer=0)},mt.prototype.setWidth=function(t){return this._grid.setWidth(t)},mt.prototype.setHeight=function(t){return console.log("unsupported"),!1},mt.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount())},mt.prototype.hitTest=function(t,e){var i=[];return i.colIndex=this._grid.hitTestX(t),i.rowIndex=this._layoutY.hitTest(e),i},mt.prototype.hitTestX=function(t){return this._grid.hitTestX(t)},mt.prototype.hitTestY=function(t){return this._layoutY.hitTest(t)},mt.prototype.getDefaultColumnWidth=function(){return this._grid.getDefaultColumnWidth()},mt.prototype.setDefaultColumnWidth=function(t){this._grid.setDefaultColumnWidth(t)},mt.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},mt.prototype.setDefaultRowHeight=function(t){this._layoutY.getDefaultLaneSize()!==t&&(this._layoutY.setDefaultLaneSize(t),this._element.style.height=this._layoutY.getTrackSize()+"px",this._grid.setDefaultRowHeight(t),this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount()))},mt.prototype.getColumnWidth=function(t){return this._grid.getColumnWidth(t)},mt.prototype.setColumnWidth=function(t,e){return this._grid.setColumnWidth(t,e)},mt.prototype._setColumnWidth=function(t,e){return this._grid._setColumnWidth(t,e)},mt.prototype._updateColumnLayout=function(){this._grid._updateColumnLayout()},mt.prototype._startBindingSession=function(t){if(this._isBinding=t,!t){if(this._tempRowHeights){var e=this.getDefaultRowHeight(),i=!0,o=[];for(var n in this._tempRowHeights){var r=+n,s=this._layoutY.getLaneProperty(r,"sizeSession");s&&s!=this._session&&(this.setRowHeight(r,e),this._layoutY.setLaneProperty(r,"sizeSession",null),o.push(r))}for(var l=o.length,a=0;a<l;a++)delete this._tempRowHeights[o[a]];if(l)for(var h in this._tempRowHeights){i=null!=h;break}i||(this._tempRowHeights=null)}this._session="A"===this._session?"B":"A"}},mt.prototype._getTempRowHeights=function(){return this._tempRowHeights},mt.prototype.getRowHeight=function(t){return this._layoutY.getLaneSize(t)},mt.prototype.setRowHeight=function(t,e){return this._isBinding&&e!=this.getDefaultRowHeight()&&(this._layoutY.setLaneProperty(t,"sizeSession",this._session),this._tempRowHeights||(this._tempRowHeights=[]),this._tempRowHeights[t]=!0),!!this._layoutY.setLaneSize(t,e)&&(this._grid.setRowHeight(t-this._firstIndex,e),this._element.style.height=this._layoutY.getTrackSize()+"px",this._requestUpdatingRowBounds(),this._dispatchRowHeightChangedEvent(t,t+1))},mt.prototype.isColumnVisible=function(t){return this._grid.isColumnVisible(t)},mt.prototype.hideColumn=function(t,e){return this._grid.hideColumn(t,e)},mt.prototype.isRowVisible=function(t){return this._grid.isRowVisible(t-this._firstIndex)},mt.prototype.hideRow=function(t,e){return this._grid.hideRow(t-this._firstIndex,e)},mt.prototype.getMinimumColumnWidth=function(t){return this._grid.getMinimumColumnWidth(t)},mt.prototype.setMinimumColumnWidth=function(t,e){return this._grid.setMinimumColumnWidth(t,e)},mt.prototype.getMinimumRowHeight=function(t){return this._layoutY.getMinimumLaneSize(t)},mt.prototype.setMinimumRowHeight=function(t,e){return console.log("unsupported"),!1},mt.prototype.getCellLeft=function(t){return this._grid.getCellLeft(t)},mt.prototype.getCellTop=function(t){return this._layoutY.getLaneStart(t)},mt.prototype.getCellWidth=function(t,e){return this._grid.getCellWidth(t,0)},mt.prototype.getCellHeight=function(t,e){return this._layoutY.getLaneSize(e)},mt.prototype.hasCellSpan=function(){return this._grid.hasCellSpan()},mt.prototype.getCellRowSpan=function(t,e){return this._grid.getCellRowSpan(t,e-this._firstIndex)},mt.prototype.setCellRowSpan=function(t,e,i){return this._grid.setCellRowSpan(t,e-this._firstIndex,i)},mt.prototype.getCellColSpan=function(t,e){return this._grid.getCellColSpan(t,e-this._firstIndex)},mt.prototype.setCellColSpan=function(t,e,i){return this._grid.setCellColSpan(t,e-this._firstIndex,i)},mt.prototype.clearCellSpans=function(){return this._grid.clearCellSpans()},mt.prototype.clearColumnSpans=function(t){return this._grid.clearColumnSpans(t)},mt.prototype.clearColumnCustomizations=function(){this._grid.clearColumnCustomizations()},mt.prototype.clearRowCustomizations=function(){this._layoutY.clearLaneCustomizations(),this._grid.clearRowCustomizations()},mt.prototype.getColumnScalability=function(t){return this._grid.getColumnScalability(t)},mt.prototype.setColumnScalability=function(t,e){return this._grid.setColumnScalability(t,e)},mt.prototype.getRowScalability=function(t){return this._layoutY.getLaneScalability(t)},mt.prototype.setRowScalability=function(t,e){return console.log("unsupported"),!1},mt.prototype.getCell=function(t,e,i){return this._grid.getCell(t,e-this._firstIndex,i)},mt.prototype.getCellContent=function(t,e){return this._grid.getCellContent(t,e-this._firstIndex)},mt.prototype.setCellContent=function(t,e,i){return this._grid.setCellContent(t,e-this._firstIndex,i)},mt.prototype.getColumnCount=function(){return this._grid.getColumnCount()},mt.prototype.setColumnCount=function(t){this._grid.setColumnCount(t)},mt.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},mt.prototype.setRowCount=function(t,e){var i=this._layoutY.getLaneCount();i!==t&&(this._layoutY.setLaneCount(t),this._tempRowHeights&&(this._tempRowHeights.length=t),this._element.style.height=this._layoutY.getTrackSize()+"px",this._requestUpdatingRowBounds(),this._dispatch("rowCountChanged",{rowCount:t,prevCount:i,noBinding:e}))},mt.prototype.getVisibleRowCount=function(){return this.getRowCount()},mt.prototype.addRow=function(t){t<=0||(this._grid.getColumnCount()<=0?console.log("WARNING: Row cannot be added, unless at least one column is added"):this.setRowCount(this._layoutY.getLaneCount()+t))},mt.prototype.removeRow=function(t){if(!(t<=0)){var e=this._layoutY.getLaneCount();t>e&&(t=e),this.setRowCount(e-t)}},mt.prototype.setBorders=function(t,e,i,o){this._grid.setBorders(t,e,i,o)},mt.prototype.getColumnStyle=function(t,e){return this._grid.getColumnStyle(t,e)},mt.prototype.setColumnStyle=function(t,e,i){this._grid.setColumnStyle(t,e,i)},mt.prototype.enableColumnClass=function(t,e,i){this._grid.enableColumnClass(t,e,i)},mt.prototype.hasColumnClass=function(t,e){return this._grid.hasColumnClass(t,e)},mt.prototype.enableRowClass=function(t,e,i){this._grid.enableRowClass(t-this._firstIndex,e,i)},mt.prototype.setRowStyle=function(t,e,i,o){this._grid.setRowStyle(t-this._firstIndex,e,i,o)},mt.prototype.getContentWidth=function(){return this._grid.getContentWidth()},mt.prototype.getContentHeight=function(){return this._layoutY.getTrackSize()},mt.prototype.getCellsByRowIndex=function(t){return this._grid.getCellsByRowIndex(t-this._firstIndex)},mt.prototype.disableHorizontalGridLine=function(t){this._grid.disableHorizontalGridLine(t)},mt.prototype.disableVerticalGridLine=function(t){this._grid.disableVerticalGridLine(t)},mt.prototype.enableShading=function(t){this._grid.enableShading(t)},mt.prototype.setTransposedShading=function(t){this._grid.setTransposedShading(t)},mt.prototype.enableRowHighlighting=function(t){this._grid.enableRowHighlighting(t)},mt.prototype.getRowHighlight=function(){var t=this._grid.getRowHighlight();return t>=0&&(t+=this._firstIndex),t},mt.prototype.setRowHighlight=function(t){var e=this._grid.getRowHighlight();if(e>=0&&(e+=this._firstIndex),this._grid.setRowHighlight(t-this._firstIndex),(t=this._grid.getRowHighlight())>=0&&(t+=this._firstIndex),this._hasListener("rowHighlighted")){var i={};i.prevRowIndex=e,i.rowIndex=t,this._dispatch("rowHighlighted",i)}},mt.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},mt.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},mt.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},mt.prototype.setSelectedRow=function(t,e){this._selectionList.setSelection(t,e);var i=this._selectionList.getSelection(t);this._grid.setSelectedRow(t-this._firstIndex,i),i&&(this._rowSelDirty=!0,this._initBoundLayer()),this._requestUpdatingRowBounds()},mt.prototype.selectSingleRow=function(t){this._selectionList.clearAllSelections(),this._grid.clearSelectedRows(),this.setSelectedRow(t)},mt.prototype.selectRowRange=function(t,e){this._selectionList.selectRange(t,e),this._updateRowSelection(),this._rowSelDirty=!0,this._initBoundLayer(),this._requestUpdatingRowBounds()},mt.prototype.clearSelectedRows=function(){var t=this._selectionList.clearAllSelections();return this._grid.clearSelectedRows(),this._requestUpdatingRowBounds(),t},mt.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},mt.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},mt.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},mt.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},mt.prototype.activateColumn=function(t,e){this._grid.activateColumn(t,e)},mt.prototype.activateRows=function(t,e,i){var o=this._layoutY.getLaneCount();t||(t=this._rowOffset),e||0===e||(e=t+o),(t-=this._rowOffset)<0&&(t=0),(e-=this._rowOffset)<0&&(e=0);var n=this._getInnerRowCount(),r=this._firstIndex,s=0;(s=t-(1&t))<0?s=0:s>o&&(s=o);var l=e+(1&e)-s;l+2===n&&(l=n),l<0?l=0:l+s>o&&(l=o-s),this._firstIndex=s;var a=s+l,h=this._layoutY.getLaneStart(s),u=this._grid.getElement();u&&(u.style.transform=h?"translateY("+h+"px)":"",u.style.top="",this._reverter.start()),this._grid._onEnterDocument();var p=!1;if(l!==n){if(this._grid.setRowCount(l),l>n){var _={};_.prevRowIndex=s+n,_.rowIndex=s+l,i&&(_.noDataUpdate=!0),this._dispatch("rowAvailable",_)}p=!0}if(i){if(!p){this._grid.clearSelectedRows();var c=r+n;s<r&&r<a&&c>=a?(this.moveRowsToTop(a-r),i[0]=s,i[1]=r):r<s&&s<c&&a>=c?(this.moveRowsToTop(s-r),i[0]=c,i[1]=a):s===r&&a===c?(i[0]=0,i[1]=0):p=!0}p&&(i[0]=s,i[1]=a)}this._layoutY.isHomogeneous()||this._grid._updateRowHeights(this._layoutY,s),this._updateRowSelection()},mt.prototype.moveRowsToTop=function(t){this._grid.moveRowsToTop(t)},mt.prototype.getFirstIndexInView=function(){return this._firstIndex},mt.prototype.getLastIndexInView=function(){var t=this._firstIndex+this._getInnerRowCount()-1,e=this._grid._getContext().getDataSource(),i=e?e.getRowCount()-1:-1;return t>i?i:t},mt.prototype.isInCurrentView=function(t){return this._firstIndex<=t&&t<this._firstIndex+this._getInnerRowCount()},mt.prototype.getFrozenLayout=function(){return this._grid.getFrozenLayout()},mt.prototype.setFrozenLayout=function(t){this._grid.setFrozenLayout(t)},mt.prototype.getColumn=function(t){return this._grid.getColumn(t)},mt.prototype.insertColumn=function(t,e){return this._grid.insertColumn(t,e)},mt.prototype.removeColumnAt=function(t){return this._grid.removeColumnAt(t)},mt.prototype.moveColumn=function(t,e){this._grid.moveColumn(t,e)},mt.prototype.enableRowVirtualization=function(t){},mt.prototype.enableColumnVirtualization=function(t){this._grid.enableColumnVirtualization(t)},mt.prototype.getColumnIndex=function(t){return this._grid.getColumnIndex(t)},mt.prototype.getCellIndex=function(t,e){var i=this._grid.getCellIndex(t,e);return i<0?-1:i+this._firstIndex},mt.prototype.getIndex=function(){return this._index},mt.prototype.setIndex=function(t){this._index=t},mt.prototype.setRowOffset=function(t){this._rowOffset=t},mt.prototype.getRowOffset=function(){return this._rowOffset},mt.prototype.updateLayout=function(){this._grid.updateLayout()},mt.prototype.stretchCell=function(t,e,i,o){var n=this._grid.stretchCell(t,null!=e?e-this._firstIndex:null,i,o);if(n){var r=n.getElement();0===e?r.classList.add("top"):r.classList.remove("top")}return n},mt.prototype.unstretchCell=function(t,e){return this._grid.unstretchCell(t,null!=e?e-this._firstIndex:null)},mt.prototype.unstretchAllCells=function(){this._grid.unstretchAllCells()},mt.prototype.getStretchedCell=function(t,e){return this._grid.getStretchedCell(t,null!=e?e-this._firstIndex:null)},mt.prototype.getStretchedCells=function(){return this._grid.getStretchedCells()},mt.prototype.updateStretchedCells=function(){return this._grid.updateStretchedCells()},mt.prototype.getColumnHost=function(){return this._grid.getElement()},mt.prototype.setHidingMethod=function(t){this._grid.setHidingMethod(t)},mt.prototype.getHidingMethod=function(){return this._grid.getHidingMethod()},mt.prototype.setColumnVisibility=function(t,e,i){return this._grid.setColumnVisibility(t,e,i)},mt.prototype.getRowLayout=function(){return this._layoutY},mt.prototype.reserveRightSpace=function(t){return this._grid.reserveRightSpace(t)},mt.prototype.getReservedSpace=function(){return this._grid.getReservedSpace()},mt.prototype.getComputedStyle=function(){return this._grid.getComputedStyle()},mt.prototype.isColumnActive=function(t){return this._grid.isColumnActive(t)},mt.prototype.setRowAttributes=function(t,e){return this._grid.setRowAttributes(t,e)},mt.prototype.getContextRow=function(t){return this._grid.getContextRow(t-this._firstIndex)},mt.prototype.selectColumn=function(t,e){this._grid.selectColumn(t,e)},mt.prototype.isSelectedColumn=function(t){return this._grid.isSelectedColumn(t)},mt.prototype.selectCell=function(t,e,i){this._grid.selectCell(t,e-this._firstIndex,i)},mt.prototype.setCellBounds=function(t,e,i,o){var n=this._cellBound;n||((n=this._cellBound=document.createElement("div")).className="selection-bound"),this._initBoundLayer();var r=t+i,s=e+o,l=this.getColumnCount(),a=this._layoutY.getLaneCount();this._cbLftIdx=yt(t,l),this._cbRgtIdx=yt(r,l),this._cbTopIdx=yt(e,a),this._cbBtmIdx=yt(s,a),this._updateCellBounds()},mt.prototype.getHorizontalLayout=function(){return this._grid.getHorizontalLayout()},mt.prototype.calculateColumnBounds=function(t,e,i,o){this._grid.calculateColumnBounds(t,e,i,o)},mt.prototype._updateCellBounds=function(){var t=this._cellBound;if(t){var e,i,o,n,r=this.getHorizontalLayout(),s=this._layoutY,l=this._cbLftIdx,a=this._cbRgtIdx,h=this._cbTopIdx,u=this._cbBtmIdx;e=i=o=n=0,l<a&&h<u&&(e=r.getLaneStart(l),i=r.getLaneEnd(a-1),o=s.getLaneStart(h),n=s.getLaneEnd(u-1));var p=i-e,_=n-o,c=[!1,!1];if(p>0&&_>0&&this._hscrollbar){var d=[0,0];this.calculateColumnBounds(l,a-1,d,c),p=(i=d[1])-(e=d[0])}if(p>0)t.style.left=e+"px",t.style.top=o+"px",t.style.width=p+"px",t.style.height=_+"px",t.classList.toggle("no-left-bound",c[0]),t.classList.toggle("no-right-bound",c[1]),this._boundLayer&&this._boundLayer.appendChild(t);else{var g=t.parentNode;g&&g.removeChild(t)}}},mt.prototype.updateColumnBounds=function(t,e,i){this._grid.updateColumnBounds(t,e,i),this._updateRowBounds()},mt.prototype.updateColumnSeparators=function(){this._grid.updateColumnSeparators()},mt.prototype._initBoundLayer=function(){var t=this._boundLayer;t||((t=this._boundLayer=document.createElement("div")).className="cover-layer",this._element.appendChild(t))},mt.prototype._requestUpdatingRowBounds=function(){this._rowBoundTimer||(this._rowBoundTimer=setTimeout(this._updateRowBounds,10))},mt.prototype._updateRowBounds=function(){if(this._rowBoundTimer=0,this._updateCellBounds(),this._rowSelDirty){var t=this._rowBounds,e=this._rowBoundCache;t||(t=this._rowBounds=[]),e||(e=this._rowBoundCache=[]);var i=this._selectionList,o=this._layoutY.getLaneCount();i.deselectFrom(o);var n,r=i.getConnectedRanges(),s=r.length,l=null,a=null,h=t.length;for(n=s;n<h;++n)(l=(a=t[n]).parentNode)&&l.removeChild(a);if(t.length=h=s,s){var u=0,p=0,_=0,c=!1;this._hscrollbar&&(u=this._hscrollbar.getScrollLeft(),p=this._hscrollbar.getPinnedLeftColumnCount(),_=this._hscrollbar.getPinnedRightColumnCount(),c=this._hscrollbar.isEndOfHorizontalScroll());var d=!p&&u>0,g=!_&&!c,f=this._grid._getViewSize();for(n=0;n<s;++n){var y=r[n],m=y[0],v=y[1],C=this._layoutY.getLaneStart(m),S=this._layoutY.getLaneEnd(v);(a=e[n])||((a=e[n]=document.createElement("div")).className="selection-bound"),a.style.top=C+"px",a.style.height=S-C+"px",a.style.width=f+"px",a.classList.toggle("no-left-bound",d),a.classList.toggle("no-right-bound",g),this._boundLayer&&(t[n]||(t[n]=a,this._boundLayer.appendChild(a)))}}else i.getSelectionCount()||(this._rowSelDirty=!1)}},mt.prototype._getInnerRowCount=function(){return this._grid.getRowCount()},mt.prototype._updateRowSelection=function(){this._grid.clearSelectedRows();var t=this._selectionList,e=t.getSelectionCount();if(!(e<=0)){var i,o=this._firstIndex,n=o+this._getInnerRowCount();if(1===e)o<=(i=t.getFirstSelectedIndex())&&i<n&&this._grid.setSelectedRow(i-o,!0);else if(e>=n-o)for(i=o;i<n;++i)t.getSelection(i)&&this._grid.setSelectedRow(i-o,!0);else for(var r=t.getAllSelections(),s=0;s<e;++s)o<=(i=r[s])&&i<n&&this._grid.setSelectedRow(i-o,!0)}},mt.prototype._dispatchRowHeightChangedEvent=function(t,e){if(t>=e)return!1;var i={};return i.rowIndex=t,i.changeLength=e-t,this._dispatch("rowHeightChanged",i),!0},mt.prototype._onRestingPosition=function(){var t=this._grid.getElement();if(t){var e=this._layoutY.getLaneStart(this._firstIndex);t.style.transform="",t.style.top=e?e+"px":""}},mt.prototype._updateRightSpaceStyle=function(){this._grid._updateRightSpaceStyle()},mt.prototype._updateLayers=function(){this._grid._updateLayers()},mt.prototype._setContext=function(t){this._grid._setContext(t)},mt.prototype._getContext=function(){return this._grid._getContext()},mt._proto=mt.prototype;const vt=mt;var Ct=function(t,e){return t-e},St=function(t){St._sectionType||(St._sectionType={},St._sectionType.title=!0,St._sectionType.header=!0,St._sectionType.content=!0,St._sectionType.footer=!0);var e=this;if(e.getColumnId=e.getColumnId.bind(e),e.getColumnIndex=e.getColumnIndex.bind(e),e._onMouseMove=e._onMouseMove.bind(e),e._onRowHightlighted=e._onRowHightlighted.bind(e),e._onGridClicked=e._onGridClicked.bind(e),e._onWindowResize=e._onWindowResize.bind(e),e._onSectionDataChanged=e._onSectionDataChanged.bind(e),e._onRowCountChanged=e._onRowCountChanged.bind(e),e._onRowHeightChanged=e._onRowHeightChanged.bind(e),e._onRowAvailable=e._onRowAvailable.bind(e),e._onVScroll=e._onVScroll.bind(e),e._onHScroll=e._onHScroll.bind(e),e._onSyncVScroll=e._onSyncVScroll.bind(e),e._onSyncHScroll=e._onSyncHScroll.bind(e),e.updateLayout=e.updateLayout.bind(e),e._onRowRefresh=e._onRowRefresh.bind(e),e._onVScrollEnabled=e._onVScrollEnabled.bind(e),e._onVScrollDisabled=e._onVScrollDisabled.bind(e),e._onRowInViewChanged=e._onRowInViewChanged.bind(e),e._onColInViewChanged=e._onColInViewChanged.bind(e),e._updateVScrollbar=e._updateVScrollbar.bind(e),e._updateColumnBounds=e._updateColumnBounds.bind(e),e._dispatchColumnPositionChanged=e._dispatchColumnPositionChanged.bind(e),e._dispatchRowPositionChanged=e._dispatchRowPositionChanged.bind(e),e._requestScrollbarUpdate=e._requestScrollbarUpdate.bind(e),t)for(var i=t.childNodes.length;--i>=0;)o.isElement(t.childNodes[i])||t.removeChild(t.childNodes[i]);e._element=t||document.createElement("div"),e._element.classList.add("tr-grid"),e._layoutX=new m,e._layoutY=new m,e._layoutX.setDefaultLaneSize(100),e._layoutY.setDefaultLaneSize(32),e._settings=[],e._plugins={},e._columnDefs=[],e._sectionStarts=[],e._rowHeightException="title",e._rowVirtualizer=new dt(e._layoutY),e._rowVirtualizer.deactivate(),e._rowVirtualizer.setViewSize(360),e._colVirtualizer=new dt(e._layoutX),e._colVirtualizer.enable(!1),e._colVirtualizer.deactivate(),e._colVirtualizer.setViewSize(400),e._vscrollbar=new ft,e._vscrollbar.disable(),e._vscrollbar.setParent(this.getParent()||this.getElement()),e._vscrollbar.listen("scroll",e._onVScroll),e._vscrollbar.listen("layoutChanged",e._onVScroll),e._vscrollbar.listen("activated",e.updateLayout),e._vscrollbar.listen("deactivated",e.updateLayout),e._vscrollbar.listen("thicknessChanged",e.updateLayout),e._vscrollbar.listen("enabled",e._onVScrollEnabled),e._vscrollbar.listen("disabled",e._onVScrollDisabled),e._hscrollbar=new G,e._hscrollbar.disable(),e._hscrollbar.setParent(this.getParent()||this.getElement()),e._hscrollbar.listen("scroll",this._onHScroll),e._hscrollbar.listen("layoutChanged",this._onHScroll),e._hscrollbar.listen("activated",this.updateLayout),e._hscrollbar.listen("deactivated",this.updateLayout),e._hscrollbar.setOtherScrollbar(e._vscrollbar),e._vscrollbar.setOtherScrollbar(e._hscrollbar),o.isMobile||o.isTouchDevice?e._element.addEventListener("touchmove",this._onMouseMove,!1):e._element.addEventListener("mousemove",this._onMouseMove,!1),o.isSafari&&e._element.addEventListener("click",this._onGridClicked),window.addEventListener("resize",e._onWindowResize,!1),e._rowVirtualizer.listen("indexChanged",e._onRowInViewChanged),e._colVirtualizer.listen("indexChanged",e._onColInViewChanged),e._rowHeightConflator=new ut(e._onRowHeightChanged,50),e._vScrollbarConflator=new ut(e._updateVScrollbar,200),e._columnBoundConflator=new ut(e._updateColumnBounds,10),e._columnPositionConflator=new ut(e._dispatchColumnPositionChanged,10),e._rowPositionConflator=new ut(e._dispatchRowPositionChanged,10),e._addEvents("sectionAdded","columnAdded","columnRemoved","columnMoved","columnVisibilityChanged","columnAlignmentChanged","widthChanged","dataSourceChanged","postDataSourceChanged","preSectionRender","postSectionRender","beforeContentBinding","preSectionDataBinding","postSectionDataBinding","firstRendered","afterContentBinding","rowExpansionBinding","rowHighlighted","preForcedUpdate","rowAdded","rowRemoved","columnPositionChanged","rowPositionChanged","beforeColumnBoundUpdate","beforeBatchOperation","afterBatchOperation","pinningChanged");var n=St.map;n||(n={},St.map=n);var r=e._element;r._control=e;var s=r.id||r.name;s&&!n[s]||(s="_grid"+St._runningGridId),e._id=s,n[s]=e,St._runningGridId++;var l=document.createElement("input");l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.padding="0",l.style.border="0",l.value="0",e._hiddenInput=l,r.insertBefore(l,r.firstChild),Object.defineProperty(e,"zoomFactor",{set:function(t){!t||t<0||this._zoomFactor!==t&&(this._zoomFactor=t,e._updateLayout())},get:function(){return this._zoomFactor}})};u.inherits(St,_),St.SectionReference,St.MouseInfo,St.BatchInfo,St.CellReference,St.ColumnOptions,St._runningGridId=0,St._runningColumnId=0,St._sectionType,St.prototype._plugins,St.prototype._dataSource=null,St.prototype._layoutX,St.prototype._layoutY,St.prototype._vscrollbar,St.prototype._hscrollbar,St.prototype._tempFrozenSectionRef="",St.prototype._startVScrollbarIndex=-1,St.prototype._hScrollbarEnabled=!0,St.prototype._pinnedLeftColumnCount=0,St.prototype._pinnedRightColumnCount=0,St.prototype._frozenFooterCount=0,St.prototype._fixFrozenTopSections=!1,St.prototype._fixFrozenBottomSection=!1,St.prototype._sectionStarts,St.prototype._settings,St.prototype._firstSettings,St.prototype._lastSettings,St.prototype._fitContentWidth=!1,St.prototype._columnDefs,St.prototype._rowVirtualizer,St.prototype._colVirtualizer,St.prototype._autoSetDataSource=!0,St.prototype._renderingHandler=null,St.prototype._dataBindingHandler=null,St.prototype._frozenLayout=!1,St.prototype._noBinding=!1,St.prototype._rowHeightSync=!0,St.prototype._rowHighlighting=!1,St.prototype._dispatchingDataChanged=!1,St.prototype._rowHeightException="",St.prototype._rowScrollingStep=0,St.prototype._zoomFactor=1,St.prototype._reservedSpace=0,St.prototype._hidingMethod="",St.prototype._rowHeightConflator=null,St.prototype._vScrollbarConflator=null,St.prototype._columnBoundConflator=null,St.prototype._rowRefreshTimer=0,St.prototype._layoutUpdating=!1,St.prototype._hiddenInput,St.prototype._bottomPadding=6,St.prototype._bottomPaddingSect=null,St.prototype._preserveProportion=!1,St.prototype._preserveGridSize=!1,St.prototype._rowHeightTimerId=0,St.prototype._groupDefs=null,St.prototype._batches=null,St.prototype._firstRendered=!1,St.getVersion=function(){return"5.1.85"},St.prototype.dispose=function(){var t=this._id,e=St.map;if(e[t]){e[t]=null,this._disposed=!0,this._rowRefreshTimer&&(clearTimeout(this._rowRefreshTimer),this._rowRefreshTimer=0),this.unlistenAll(),window.removeEventListener("resize",this._onWindowResize,!1);for(var i=this._columnDefs.length;--i>=0;){var o=this._getColumnDef(i);o.renderingHandler=o.dataBindingHandler=null}for(var n in this._plugins){var r=this._plugins[n];r.unload&&r.unload(this)}this.removeAllSections();var s=this._vscrollbar._mainScrollbar;s&&(s.unlisten("scroll",this._onSyncVScroll),this._vscrollbar._mainScrollbar=null),(s=this._hscrollbar._mainScrollbar)&&(s.unlisten("scroll",this._onSyncHScroll),this._hscrollbar._mainScrollbar=null),this._vscrollbar.dispose(),this._hscrollbar.dispose(),this._rowHeightConflator.dispose(),this._vScrollbarConflator.dispose(),this._columnBoundConflator.dispose(),this._columnPositionConflator.dispose(),this._rowPositionConflator.dispose(),this._layoutX.dispose(),this._layoutY.dispose();var l=this._element;null!==l&&(l._control&&delete l._control,l.removeChild(this._hiddenInput)),this._dispose(),this._columnDefs.length=0,delete this._plugins}else console.log("WARNING: Core grid is disposed twice")},St.prototype.isDisposed=function(){return this._disposed},St.prototype.setParent=function(t,e){this._setParent(t,e),this._onParentChange()},St.prototype.insertBefore=function(t){this._insertBefore(t),this._onParentChange()},St.prototype._onParentChange=function(){var t=this.getParent()||this.getElement();this._vscrollbar._mainScrollbar||this._vscrollbar.setParent(t),this._hscrollbar.setParent(t),this._updateLayout()},St.prototype.getConfigObject=function(t){var e=t||{},i=this.getColumnCount();e.columns||(e.columns=[]);for(var o=0;o<i;o++){var n=e.columns[o];n||(n=e.columns[o]={});var r=this._getColumnDef(o);r.userId&&(n.id=r.userId),r.field&&(n.field=r.field),r.styles&&(n.styles=r.styles),r.stationary&&(n.stationary=r.stationary),r.leftPinned&&(n.leftPinned=r.leftPinned),r.rightPinned&&(n.rightPinned=r.rightPinned)}e.rowVirtualization=this.isRowVirtualizationEnabled(),e.columnVirtualization=this.isColumnVirtualizationEnabled(),e.rowHighlighting=this._rowHighlighting,this._fixFrozenTopSections&&(e.topFreezingCount=this._startVScrollbarIndex>=0&&this._startVScrollbarIndex+1),this._fixFrozenBottomSection&&(e.bottomFreezingCount=this._frozenFooterCount),this._rowScrollingStep&&(e.stepScroll=1===this._rowScrollingStep||this._rowScrollingStep);var s=this._vscrollbar.getAutoHide();!0!==s&&(e.autoHideScrollbar=s);var l=this._vscrollbar.getMouseWheelSpeed();l&&(e.linearWheelScrolling=l),this.hasClass("no-borders")&&(e.borders=!1),this.hasClass("no-gridlines")&&(e.gridlines=!1),this.hasClass("no-vertical-grid-line")&&(e.verticalLines=!1),this.hasClass("no-horizontal-grid-line")&&(e.horizontalLines=!1),this.hasClass("no-content-vertical-line")&&(e.contentVerticalLines=!1),this._bottomPaddingSect&&(e.contentBottomPadding=this._bottomPadding),this._reservedSpace>0&&(e.contentRightPadding=this._reservedSpace);var a=this.getDataConflationRate();for(var h in a&&(e.dataConflationRate=a),this._plugins){var u=this._plugins[h];"function"==typeof u.getConfigObject&&u.getConfigObject(e)}return e},St.prototype.fillParentWidth=function(t){if(this._fitContentWidth)return!1;if(this._layoutX.isFixedSize())return!1;var e=this._element,i=(0|e.getBoundingClientRect().width)-e.clientLeft;return null!==this._layoutX.setTrackSize(i-this._reservedSpace)},St.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",!1!==t&&this.updateLayout()},St.prototype.getContentWidth=function(){return this._layoutX.getTrackSize()},St.prototype.getSectionCount=function(){return this._settings.length},St.prototype._updateFrozenTopSections=function(){if(!this._fixFrozenTopSections){var t=this._getTopSectionCount();this._freezeTopSectionAt(t-1)}},St.prototype._updateFrozenBottomSections=function(){if(!this._fixFrozenBottomSection){var t=this._getBottomSectionCount();this._setFrozenFooter(t)}},St.prototype._getTopSectionCount=function(){for(var t=this._settings,e=t.length,i=0,o=0;o<e;o++){var n=t[o].getType();if("header"!==n&&"title"!==n)break;i++}return i},St.prototype._getBottomSectionCount=function(){for(var t=this._settings,e=0,i=t.length-1;i>=0&&"footer"===t[i].getType();i--)e++;return e},St.prototype.addSection=function(t,e){return this.addSectionAt(this.getSectionCount(),t,e)},St.prototype.addSectionAt=function(t,e,i){var o=this._settings.length;t<0&&(t=0),t>o&&(t=o);var n=this._toSectionType(e),r="bottomPadding"===i,s=this._newSection(r?"footer":n,i);if(!s)return null;var l=s.getSection();if(r&&(s.setAutoSyncRowCount(!1),this._bottomPaddingSect=l),t>=o?(this._putToLast(l),this._settings.push(s)):(this._settings.splice(t,0,s),l.insertBefore(this._settings[t+1].getSection())),this._updateSectionIndices(t),this._autoSetDataSource&&s.setDataSource(this._dataSource),"footer"===(n=s.getType())?this._updateFrozenBottomSections():"header"!==n&&"title"!==n||this._updateFrozenTopSections(),this._onColumnCountChanged(),this._onSectionCountChanged(!0),this._colVirtualizer.isEnabled()){var a=this._getColActivationList(),h=this.getColumnCount();s.activateColumns(a,0,h-1)}if(this._hasListener("sectionAdded")){var u=s.extendEventArg();this._dispatch("sectionAdded",u)}return l},St.prototype.removeSection=function(t){var e=this.getSection(t);return null!==e?this.removeSectionAt(e.getIndex()):null},St.prototype.removeSectionAt=function(t){var e=this._settings.length;if(t>=0&&t<e){var i=this._settings[t],o=i.getIndex(),n=i.getSection(),r=i.getType();return n.setRowCount(0),this._settings.splice(t,1),this._updateSectionIndices(o),"footer"===r?(this._updateFrozenBottomSections(),this._onColumnCountChanged()):"header"!==r&&"title"!==r||this._updateFrozenTopSections(),this._onSectionCountChanged(),i.dispose(),n}return null},St.prototype.removeLastSection=function(){return this.removeSectionAt(this._settings.length-1)},St.prototype.removeAllSections=function(){for(var t=this._settings.length,e=0;e<t;++e)this._settings[e].dispose();this._bottomPaddingSect=null,this._firstSettings=this._lastSettings=null,this._settings.length=0,this._updateSectionIndices(0),this._onSectionCountChanged()},St.prototype.setBottomPaddingSection=function(t){var e=this._bottomPaddingSect;t?("number"==typeof t&&(this._bottomPadding=t),e||(e=this.addSection("content","bottomPadding")),e&&(e.setDefaultRowHeight(this._bottomPadding),e.getRowCount()||e.addRow(1))):e&&this.removeSection(e)},St.prototype._updatePaddingBottomSect=function(){var t=this._bottomPaddingSect;if(t){var e=this._settings.length-1;if(e>0){var i=this._settings[e];if(i.getSection()!==t){for(var o=null,n=e;--n>=0;){var r=this._settings[n];if(r.getSection()===t){o=r;break}}if(n>=0)return this._putToLast(t),this._settings.splice(n,1),this._settings.push(o),o.setType("footer"===i.getType()?"footer":"content"),!0;this._bottomPaddingSect=null}else{var s=this._settings[e-1];s&&i.setType("footer"===s.getType()?"footer":"content")}}}return!1},St.prototype.moveSection=function(t,e){var i=this.getSectionCount();if(t<0)t=0;else if(t>=i)return;if(e<0?e=0:e>=i&&(e=i-1),t!==e){var n=this._settings[t],r=this._settings[e];o.moveArrayItem(this._settings,t,e),r?n.getSection().insertBefore(r.getSection()):this._putToLast(n.getSection()),this._updateSectionIndices(t<=e?t:e),this._syncRowHeights(),this._onSectionCountChanged(),this._frozenLayout||this._rowVirtualizer.update(!0)}},St.prototype.getSection=function(t){var e=this.getSectionSettings(t);return null!==e?e.getSection():null},St.prototype.getSectionSettings=function(t){if(o.isString(t)){if(St._sectionType[t])return this._getNextSection(1,null,t);for(var e=this._settings.length;--e>=0;)if(this._settings[e].getId()===t)return this._settings[e]}else if(null!=t){var i=-1;if(null!=t.getIndex?i=t.getIndex():o.isNumber(t)&&(i=t),i>=0&&i<this._settings.length)return this._settings[i]}return null},St.prototype.getAllSections=function(t){if(null==t)return this._getAllSections();for(var e=this.getAllSectionSettings(t),i=e,o=i.length;--o>=0;)i[o]=e[o].getSection();return i},St.prototype.getAllSectionSettings=function(t){if(!t)return this._settings;var e=this._settings.length,i=[];t=this._toSectionType(t);for(var o=0;o<e;++o){var n=this._settings[o];t===n.getType()&&i.push(n)}return i},St.prototype.getSectionIndex=function(t){if(o.isNumber(t))return t;if(t instanceof MouseEvent){var e=o.getRelativePosition(t,this._element),i={};return this._hitTestY(e.y,i),i.sectionIndex}var n=this.getSection(t);return null==n?-1:n.getIndex()},St.prototype.getSectionTop=function(t){var e=this.getSection(t);if(null==e)return 0;var i=this._layoutY.getLaneStart(e.getRowOffset());return this._startVScrollbarIndex>=0&&e.getIndex()>=this._startVScrollbarIndex&&(i-=this._vscrollbar.getScrollTop()),i},St.prototype.getPreviousSection=function(t,e){null==t&&(t=this._settings.length);var i=this._getNextSection(-1,t,e);return null!==i?i.getSection():null},St.prototype.getNextSection=function(t,e){var i=this._getNextSection(1,t,e);return null!==i?i.getSection():null},St.prototype.getLastSection=function(){return this.getSection(this._settings.length-1)},St.prototype.getCell=function(t,e,i,o){var n=this.getSection(t);return n?n.getCell(e,i,o):null},St.prototype.getCellInfo=function(t){if(!t)return null;var e=t.colIndex,i=t.rowIndex,o=t.sectionName,n=null;if(null==e||null==i)(n=this.getRelativePosition(t)).hit||(n=null);else{o||(o="content");var r=this.getSectionSettings(o);r&&r.getSection().getCell(e,i)&&((n={}).colIndex=e,n.rowIndex=i,r.extendEventArg(n))}return n},St.prototype.getNextCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?e:1)},St.prototype.getPrevCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?-e:-1)},St.prototype._getNextCellInRow=function(t,e){var i=this.getCellInfo(t);if(i){var o=i.colIndex+e,n=i.rowIndex,r=i.section;i.colIndex=o,i.cell=r.getCell(o,n)}return i},St.prototype.getNextCell=function(t){var e=this.getNextCellInRow(t);if(e&&!e.cell){var i=e.section,o=e.colIndex=0,n=e.rowIndex;e.rowIndex=++n,e.cell=i.getCell(o,n)}return e},St.prototype.getPrevCell=function(t){var e=this.getPrevCellInRow(t);if(e&&!e.cell){var i=e.section,o=e.colIndex=i.getColumnCount()-1,n=e.rowIndex;e.rowIndex=--n,e.cell=i.getCell(o,n)}return e},St.prototype.getColumnCount=function(){return this._layoutX.getLaneCount()},St.prototype.setColumnCount=function(t){var e=this._layoutX.getLaneCount();if(t>=e){this._layoutX.setLaneCount(t);for(var i=this._settings.length;--i>=0;)this._settings[i].getSection().setColumnCount(t);this._onColumnCountChanged(),this._syncLayoutToColumns(e,t),this._dispatchColumnAddedEvent(e,t-e,!1)}else this._removeColumn(e-t)},St.prototype.insertColumn=function(t,e){var i=this.getColumnCount();t<i||(t=i),this._layoutX.insertLane(t);for(var o=this._settings.length;--o>=0;)this._settings[o].getSection().insertColumn(t);this._columnDefs.splice(t,0,null),this._deserializeColumn(t,e),this._onColumnCountChanged(),this._syncLayoutToColumns(t,t+1),this._dispatchColumnAddedEvent(t,1,t<i,e)},St.prototype.insertColumns=function(t,e){var i=this.getColumnCount();t<i||(t=i);var o,n=0;if(Array.isArray(e)){if(1===(n=e.length))return void this.insertColumn(t,e[0]);o=e}else{if("number"!=typeof e)return void this.insertColumn(t,e);if(1===(n=e))return void this.insertColumn(t,null)}if(!(n<=0)){var r=this.freezeLayout(),s=[t,0].concat(new Array(n));Array.prototype.splice.apply(this._columnDefs,s);for(var l=0;l<n;l++){var a=t+l;this._layoutX.insertLane(a);for(var h=this._settings.length;--h>=0;)this._settings[h].getSection().insertColumn(a);var u=o&&o[l];this._deserializeColumn(a,u)}this._dispatchColumnAddedEvent(t,n,t<i,o),this.freezeLayout(r)}},St.prototype.removeColumnAt=function(t){var e=this.getColumnCount();if(t<0||t>=e)return null;var i=-1;this._colVirtualizer.isVirtualizable()&&(i=this._colVirtualizer.getLastIndexInView());for(var o=this._layoutX.removeLaneAt(t),n=this._settings.length,r=0;r<n;++r)this._settings[r].getSection().removeColumnAt(t);var s=this._pinnedLeftColumnCount,l=this._pinnedRightColumnCount,a=this._columnDefs.splice(t,1)[0];if(this._onColumnCountChanged(),(t<s||t>=e-l)&&this._updateScrollbarWidth(!0,!0),this._syncLayoutToColumns(t,e-1,!0),a||(a={}),a.layout=o,this._hasListener("columnRemoved")){var h={atTheMiddle:!0};h.colIndex=t,h.columns="deprecated",h.columnData=a.columnData,h.colId=a.id||"",this._dispatchColumnEvent("columnRemoved",h)}return t<=i&&i===this._colVirtualizer.getLastIndexInView()&&this._colVirtualizer.update(),a},St.prototype.removeAllColumns=function(){this.getColumnCount()>0&&(this._pinnedLeftColumnCount=0,this._pinnedRightColumnCount=0,this.setColumnCount(0))},St.prototype.getStationaryColumnIndex=function(){for(var t=this.getColumnCount()-1;t>=0;t--)if(this._getColumnDef(t).stationary)return t;return-1},St.prototype.isColumnMoveAllowed=function(t,e){if(Array.isArray(t)||(t=[t]),0===t.length||null==e)return!1;var i=this.getStationaryColumnIndex();if(i>-1){if(e<=i)return!1;for(var o=0;o<t.length;o++)if(t[o]<=i)return!1}return!0},St.prototype.isColumnMovable=function(t){var e=this.getStationaryColumnIndex();return!(e>-1&&t<=e)},St.prototype.moveColumn=function(t,e){if("number"==typeof t)return this._moveColumn(t,e);if(!Array.isArray(t))return!1;var i,o=t.length,n=[],r=0,s=this.getColumnCount(),l={};for(i=0;i<o;++i)(r=t[i])>=0&&r<s&&null==l[r]&&(l[r]=1,n.push(r));if(e<0?e=0:e>=s&&(e=s-1),!(o=n.length))return!1;if(1===o)return this._moveColumn(n[0],e);if(!this.isColumnMoveAllowed(n,e))return!1;if(n.sort(Ct),l[e]){var a=!0;for(r=n[0],i=1;i<o;++i)if(++r!==n[i]){a=!1;break}if(a)return!1}var h,u,p=this.freezeLayout(!0),_=0;for(i=0;i<o;++i)(h=n[i])>=e&&(u=e+_,this._moveColumn(h,u),++_);var c=o-_;for(u=_?e-1:e,i=0;i<c;++i)h=n[i]-i,this._moveColumn(h,u);return this.freezeLayout(p),!0},St.prototype._moveColumn=function(t,e){var i=this.getColumnCount();if(t<0?t=0:t>=i&&(t=i-1),e<0?e=0:e>=i&&(e=i-1),t===e)return!1;if(!this.isColumnMoveAllowed(t,e))return!1;var n=-1;this._colVirtualizer.isVirtualizable()&&(n=this._colVirtualizer.getLastIndexInView());var r=this.getColumnId(t);this._layoutX.moveLane(t,e);for(var s=this._settings.length,l=0;l<s;++l)this._settings[l].getSection().moveColumn(t,e);var a=this._columnDefs[t],h=this._countPinnedLeftColumns(),u=this._countPinnedRightColumns();if(o.moveArrayItem(this._columnDefs,t,e),this._hScrollbarEnabled&&(t<h?e>=i-u?this.freezeColumn(h-2,u+1):e>=h&&this.freezeColumn(h-2,u):a.rightPinned?e<h?this.freezeColumn(h,u-1):e<i-u&&this.freezeColumn(h-1,u-1):e<h?this.freezeColumn(h,u):e>=i-u&&this.freezeColumn(h-1,u+1)),this._hasListener("columnMoved")){var p={};p.fromColIndex=t,p.toColIndex=e,p.colId=r,this._dispatchColumnEvent("columnMoved",p)}return n===this._colVirtualizer.getLastIndexInView()&&(t<=n&&e>n||e<=n&&t>n)&&this._colVirtualizer.update(),this._updateColumnBounds(),this._updateColumnSeparators(),!0},St.prototype.moveColumnById=function(t,e){var i=this.getColumnCount(),o=this.getColumnIndex(t);if(o<0||o>=i)return!1;var n=null!=e?this.getColumnIndex(e):-1;return n<0&&(n=i),this._moveColumnByIndex(o,n)},St.prototype._moveColumnByIndex=function(t,e){return t<e&&--e,t!==e&&this.moveColumn(t,e)},St.prototype.reorderColumns=function(t,e){var i="";"number"==typeof e?i=this.getColumnId(e):e&&(i=e),this.startBatch("move");var o=0;if(Array.isArray(t)){var n=t.length;if(n>1){var r,s,l,a,h=this.getColumnIds(),u=h.length,p=[],_=!1;for(r=0;r<n;++r){var c=t[r];"number"==typeof c?(l=c,s=h[c]||""):(s=c,l=h.indexOf(s)),s&&l>=0&&(p.push(s),i===s&&(_=!0))}if(n=p.length,_){if((a=this.getColumnIndex(i))>=0)for(;++a<u&&(i=h[a],!(p.indexOf(i)<0)););(a<0||a>=u)&&(i="")}for(r=n;--r>=0;)s=p[r],l=this.getColumnIndex(s),(a=this.getColumnIndex(i))<0&&(a=u),o|=this._moveColumnByIndex(l,a),i=s}else o=this.moveColumnById(t[0],i)}else null!=t&&(o=this.moveColumnById(t,i));return this.stopBatch("move"),!!o},St.prototype.getColumnLayout=function(){return this._layoutX},St.prototype.updateColumnLayout=function(){this._syncLayoutToColumns(0,this.getColumnCount())},St.prototype._deserializeColumn=function(t,e){if(e){var i,o=e.layout||e,n=e.width;null!=n&&(o.size=n),null!=(n=e.scalable)&&(o.scalable=n),null!=(n=e.minWidth)&&(o.minSize=n),null==o.scalable&&(o.scalable=null==o.size),this._layoutX.deserializeLane(t,o);var r=e.styles;for(i in r)this.setColumnStyle(t,i,r[i]);var s=e.classes;for(i in s)this.enableColumnClass(t,i,s[i]);var l=this._getColumnDef(t),a=e.id;a&&"string"==typeof a&&(l.id=a,l.userId=a);var h=e.field;h&&"string"==typeof h&&(l.field=h);var u=e.dataColumnName;null!=u&&(l.dataColumnName=u),null!=(u=e.stationary)&&(l.stationary=!!u),null!=(u=e.leftPinned)&&(l.leftPinned=!!u),null!=(u=e.rightPinned)&&(l.rightPinned=!!u),this.setColumnRenderingHandler(t,e.renderingHandler),this.setColumnDataBindingHandler(t,e.dataBindingHandler),(u=e.columnData)&&this.setColumnData(t,u);var p=e.formatter||e.binding;if(Array.isArray(p)&&(p=p[0]),p&&"function"!=typeof p){var _=p.init;"function"==typeof _&&_(e,this)}}},St.prototype.addRow=function(t){if(null==t)t=1;else if(t<=0)return;this.getColumnCount()<=0&&this.setColumnCount(1);var e=this.getLastSection();null==e&&(e=this.addSection()),e.addRow(t)},St.prototype.removeRow=function(t){var e=this.getLastSection();null!=e&&(null==t&&(t=1),e.removeRow(t))},St.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},St.prototype.setSectionRowCount=function(t,e){var i=this.getSection(t);null!=i&&i.setRowCount(e)},St.prototype.getRowIndex=function(t,e){return this._sectionStarts[t]+e},St.prototype.getRelativeIndex=o._deprecatedFunction,St.prototype.removeAllRows=function(){for(var t=this._settings.length,e=0;e<t;++e)this._settings[e].getSection().setRowCount(0),this._sectionStarts[e]=0;this._sectionStarts[t]=0},St.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},St.prototype.setDefaultRowHeight=function(t,e){if(this._layoutY.setDefaultLaneSize(t)){this._rowHeightSync=!1;var i=this._layoutY.getDefaultLaneSize();this._rowHeightException=e?"":"title";for(var o=this._settings.length,n=0;n<o;++n){var r=this._settings[n];r.getType()!==this._rowHeightException&&"bottomPadding"!==r.getId()&&r.getSection().setDefaultRowHeight(i)}this._syncRowHeights(),this._rowHeightSync=!0,this.setRowScrollingStep(this._rowScrollingStep),this._updateColumnSeparators()}},St.prototype.getDataSource=function(){return this._dataSource},St.prototype.setDataConflationRate=function(t){this._dataSource.setConflationRate(t)},St.prototype.getDataConflationRate=function(){return this._dataSource.getConflationRate()},St.prototype.setDataSource=function(t){t&&t instanceof et&&(t=new at(t));var e={};if(e.prevDataSource=this._dataSource,this._dataSource=t||null,e.dataSource=this._dataSource,this._dispatch("dataSourceChanged",e),this._autoSetDataSource)for(var i=this._settings.length,o=0;o<i;++o)this._settings[o].setDataSource(t);return this._dispatch("postDataSourceChanged",e),this._dataSource},St.prototype.setColumnTemplate=o._deprecatedFunction,St.prototype.getColumnTemplate=o._deprecatedFunction,St.prototype.getColumnRenderEvent=o._deprecatedFunction,St.prototype.getColumnDataBindingEvent=function(t){console.log("getColumnDataBindingEvent() is deprecated. Use setColumnDataBindingHandler() instead");var e=this;return{listen:function(i){e.setColumnDataBindingHandler(t,i)},unlisten:function(){e.setColumnDataBindingHandler(t,null)}}},St.prototype.setColumnStyle=function(t,e,i,n){if(e){var r;o.isNumber(t)||(t=0,console.log("WARNING: the first parameter for setColumnStyle must be column index")),null==n?r=this._getNestedColumnDef(t,"styles"):(n=this._toSectionType(n),r=this._getNestedColumnDef(t,n,"styles")),r[e]=i;for(var s=this._settings.length;--s>=0;){var l=this._settings[s];null!=n&&n!==l.getType()||l.getSection().setColumnStyle(t,e,i)}}},St.prototype.enableColumnClass=function(t,e,i,o){var n;"number"!=typeof t&&(t=0),null==o?n=this._getNestedColumnDef(t,"classes"):(o=this._toSectionType(o),n=this._getNestedColumnDef(t,o,"classes"));var r=!1;if((i=!1!==i)?n[e]||(r=n[e]=!0):n[e]&&(delete n[e],r=!0),r)for(var s=this._settings.length;--s>=0;){var l=this._settings[s];null!=o&&o!==l.getType()||l.getSection().enableColumnClass(t,e,i)}return r},St.prototype.hasColumnClass=function(t,e,i){var o;return null==i?o=this._getNestedColumnDef(t,"classes"):(i=this._toSectionType(i),o=this._getNestedColumnDef(t,i,"classes")),!(!o||!o[e])},St.prototype.setColumnAlignment=function(t,e){var i=e?e.charAt(0).toLowerCase():"",o=0;o|=this.enableColumnClass(t,"tr-align-left","l"===i),o|=this.enableColumnClass(t,"tr-align-right","r"===i),(o|=this.enableColumnClass(t,"tr-align-center","c"===i))&&this._dispatch("columnAlignmentChanged",{colIndex:t,alignment:i})},St.prototype.getColumnAlignment=function(t){return this.hasColumnClass(t,"tr-align-right")?"right":this.hasColumnClass(t,"tr-align-center")?"center":this.hasColumnClass(t,"tr-align-left")?"left":"default"},St.prototype.getColumnLeft=function(t){var e=this._columnDefs[t];if(e&&e.rightPinned){for(var i=this.getElement().clientWidth,o=this._layoutX.getTrackSize(),n=o<i?o:i,r=this.getColumnCount()-1;r>=t;--r)n-=this._layoutX.getLaneSize(r);return n}return this._hScrollbarEnabled&&t>=this._pinnedLeftColumnCount?this._layoutX.getLaneStart(t)-this._hscrollbar.getScrollLeft():this._layoutX.getLaneStart(t)},St.prototype.getColumnRight=function(t){return this.getColumnLeft(t)+this._layoutX.getLaneSize(t)},St.prototype.getColumnWidth=function(t){return this._layoutX.getLaneSize(t)},St.prototype.getColumnCustomLaneSize=function(t){return this._layoutX.getCustomLaneSize(t)},St.prototype._calculateColumnWidths=function(t,e){if(!this._preserveGridSize)return e;var i,o=0,n={},r=t.length,s=new Array(r);for(i=0;i<r;i++)n[t[i]]=!0,s[i]=e[i],o+=e[i];var l=0,a=0,h=this.getColumnCount(),u=this._layoutX;for(i=0;i<h;i++)n[i]||u.isLaneVisible(i)&&(u.getLaneScalability(i)?(l+=u.getMinimumLaneSize(i),a++):l+=u.getLaneSize(i));var p=this.getContentWidth(),_=o+l-p;if(a<1||_>0){for(u.resetLaneToDefaultSize(),u.setTrackSize(p-this._reservedSpace),l=0,i=0;i<h;i++)n[i]||u.isLaneVisible(i)&&(u.getLaneScalability(i)?l+=u.getMinimumLaneSize(i):l+=u.getLaneSize(i));if((_=o+l-p)>0)for(_/=r,i=0;i<r;i++)s[i]-=_}return s},St.prototype.setColumnWidth=function(t,e,i){var o=this._calculateColumnWidths([t],[e]),n=this._setColumnWidth(t,o[0],i);return n&&this._syncLayoutToColumns(t,t+1),n},St.prototype.setColumnWidths=function(t,e){var i,o=0,n=[],r=[],s=[];for(i=t.length;--i>=0;){var l=t[i];null!=l&&(n.push(i),r.push(l));var a=Array.isArray(e)?e[i]:e;s.push(a)}var h=this._calculateColumnWidths(n,r);for(i=0;i<h.length;i++)o|=this._setColumnWidth(n[i],h[i],s[i]);return o&&this._syncLayoutToColumns(0,t.length),!!o},St.prototype.isColumnVisible=function(t){return this._layoutX.isLaneVisible(t)},St.prototype.hideColumn=function(t,e){var i=!1===e;this.setColumnVisibility(t,i,0)},St.prototype.hideColumns=function(t,e){var i=Array.isArray(t)?t.length:0,o=[],n=this.getColumnCount();e=!1!==e;for(var r=0;r<i;++r){var s=t[r];s>=0&&s<n&&this._layoutX.hideLane(s,e,0)&&o.push(s)}if(o.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){var l={};l.colIndices=o,l.hidden=e,this._dispatch("columnVisibilityChanged",l)}},St.prototype.showAllColumns=function(){for(var t=[],e=this.getColumnCount(),i=0;i<e;++i)this._layoutX.hideLane(i,!1,0)&&t.push(i);if(t.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){var o={};o.colIndices=t,o.hidden=!1,this._dispatch("columnVisibilityChanged",o)}},St.prototype.getMinimumColumnWidth=function(t){return this._layoutX.getMinimumLaneSize(t)},St.prototype.setMinimumColumnWidth=function(t,e){this._layoutX.setMinimumLaneSize(t,e)&&this._syncLayoutToColumns(t,t+1)},St.prototype.setMinimumColumnWidths=function(t,e){for(var i=0,o=NaN,n=NaN,r=t.length;--r>=0;){var s=t[r];null!=s&&(n||(n=r),o=r,i|=this._layoutX.setMinimumLaneSize(r,s,e))}return i&&this._syncLayoutToColumns(o,n+1),!!i},St.prototype.getColumnScalability=function(t){return this._layoutX.getLaneScalability(t)},St.prototype.setColumnScalability=function(t,e){var i=!1;return o.isNumber(t)?(e=!1!==e,(i=this._layoutX.setLaneScalability(t,e))&&this._syncLayoutToColumns(t,t+1)):this.setDefaultColumnScalable(t),i},St.prototype.setDefaultColumnScalable=function(t){this._layoutX.setDefaultScalability(!!t)},St.prototype.resetColumnWidths=function(){var t=this._layoutX.resetLaneToDefaultSize();return t&&this._syncLayoutToColumns(0,this.getColumnCount()),t},St.prototype.setColumnDefaultWidth=function(t,e){this._layoutX.setLaneDefaultSize(t,e)},St.prototype.preserveProportion=function(t){this._preserveProportion=!0===t},St.prototype.isProportionPreserved=function(){return this._preserveProportion},St.prototype.preserveGridSize=function(t){this._preserveGridSize=!0===t},St.prototype.getColumnData=function(t){return this._getColumnDef(t).columnData||null},St.prototype.setColumnData=function(t,e){return this._getColumnDef(t).columnData=e,e},St.prototype.newColumnData=function(t){return this.getColumnData(t)||{}},St.prototype.setAlwaysRenderColumn=function(t,e){this.getColumnData(t).alwaysRender=!1!==e},St.prototype._isAlwaysRenderColumn=function(t){var e=this.getColumnData(t);return!!e&&!0===e.alwaysRender},St.prototype.getFitContentWidth=function(){return this._fitContentWidth},St.prototype.setFitContentWidth=function(t){this._fitContentWidth!==t&&(this._fitContentWidth=t,this.enableClass("fit-width",this._fitContentWidth))},St.prototype.loadPlugin=function(t,e){var i=null;if("string"==typeof t){var o=window.tr,n=o?o.grid:null;if(!n)return null;if(n[t])i=new n[t];else{if(!n[t+"Plugin"])return null;i=new n[t+"Plugin"]}}else i=t;if(!i||!i.getName)return null;var r=i.getName();if(!r)return null;var s=this._plugins[r];if(s){if(s===i)return s;console.log("WARNING: Two of the same "+r+"s cannot be loaded on a single grid. The existing plugin is replaced."),this.unloadPlugin(r)}return i.initialize&&i.initialize(this,e),this._plugins[r]=i,i},St.prototype.unloadPlugin=function(t){var e;if(t){var i="";"string"==typeof t?i=t:t.getName&&(i=t.getName()),(e=this._plugins[i])||(i+="Plugin",e=this._plugins[i]),e&&(e.unload&&e.unload(this),delete this._plugins[i])}return e||null},St.prototype.getPlugin=function(t){var e=this._plugins[t];return e||(e=this._plugins[t+"Plugin"]),e||null},St.prototype.getPlugins=function(){var t=[];for(var e in this._plugins)t.push(this._plugins[e]);return t},St.prototype.getPluginList=function(){var t=[];for(var e in this._plugins)t.push(e);return t},St.prototype.freezeSection=function(t){this._fixFrozenTopSections=!0,this._freezeTopSectionAt(t)},St.prototype._freezeTopSectionAt=function(t){if("number"==typeof t){var e=t+1;if(e===this._startVScrollbarIndex)return;this._startVScrollbarIndex=e}else this._startVScrollbarIndex=-1,"string"==typeof t&&(this._tempFrozenSectionRef=t);this._onSectionCountChanged()},St.prototype.freezeFooter=function(t){this._fixFrozenBottomSection=!0,this._frozenFooterCount!==t&&(this._setFrozenFooter(t),this._onSectionCountChanged())},St.prototype._setFrozenFooter=function(t){this._frozenFooterCount!==t&&(this._frozenFooterCount=t,this._vscrollbar.setFooterCount(t),this._hscrollbar.setFooterCount(t))},St.prototype.getFooterCount=function(){return this._frozenFooterCount},St.prototype.freezeColumn=function(t,e){var i,o=this.getColumnCount(),n=0,r=0,s=!1;if(t||0===t)for(this._hScrollbarEnabled=!0,n=t>=0?t+1:0,this._pinnedLeftColumnCount!==n&&(s=!0,this._pinnedLeftColumnCount=n),i=0;i<o;++i)this._getColumnDef(i).leftPinned=--n>=0;else this._hScrollbarEnabled=!1;if(null!=e)for(r=e>0?e:0,this._pinnedRightColumnCount!==r&&(s=!0,this._pinnedRightColumnCount=r),i=o;--i>=0;)this._getColumnDef(i).rightPinned=--r>=0;this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),this._updateColumnSeparators(),s&&(this._isEventDispatching("pinningChanged")||this._dispatch("pinningChanged",{}))},St.prototype._countPinnedLeftColumns=function(){var t=0;if(this._hScrollbarEnabled)for(var e=this._columnDefs.length;--e>=0;){var i=this._columnDefs[e];if(i&&i.leftPinned){t=e+1;break}}return this._pinnedLeftColumnCount=t,t},St.prototype._countPinnedRightColumns=function(){var t=0;if(this._hScrollbarEnabled){var e,i=this._columnDefs.length;for(e=0;e<i;++e){var o=this._columnDefs[e];if(o&&o.rightPinned)break}t=i-e}return this._pinnedRightColumnCount=t,t},St.prototype.isPinnedColumn=function(t){return t<this.getFrozenColumnCount()||t>=this.getFirstPinnedRightIndex()},St.prototype.getFrozenColumnCount=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:0},St.prototype.getPinnedLeftColumnCount=St.prototype.getFrozenColumnCount,St.prototype.getPinnedRightColumnCount=function(){return this._pinnedRightColumnCount},St.prototype.getFirstPinnedRightIndex=function(){return this.getColumnCount()-this._pinnedRightColumnCount},St.prototype.updateLayout=function(){this._disposed||this._layoutUpdating||(this._layoutUpdating=!0,this._dispatch("preForcedUpdate",{}),this._updateLayout(),this._colVirtualizer.isEnabled()&&this._activateColumns(),this._layoutUpdating=!1)},St.prototype.updateScrollbars=function(t,e){e&&this._updateScrollbarWidth(!0,!1),t&&this._updateScrollbarHeight(!0,!1)},St.prototype.freezeLayout=function(t){t=!1!==t;var e=this._frozenLayout;if(e!==t){this._frozenLayout=t;var i,o=this.getPlugin("SortableTitlePlugin");this._frozenLayout&&o&&o.freezeIndicator(!0),this._frozenLayout||(this._disableEvent("widthChanged"),this._onSectionCountChanged(),this._onColumnCountChanged(),this._colVirtualizer.isEnabled()&&this._activateColumns()),this._rowHeightSync=!1;var n=this._settings.length;for(i=0;i<n;i++)this._settings[i].getSection().setFrozenLayout(this._frozenLayout);this._frozenLayout||(this._syncLayoutToColumns(0,this.getColumnCount()),this._disableEvent("widthChanged",!1),this._dispatch("widthChanged",{}),this._syncRowHeights()||this._rowVirtualizer.update(!0),o&&o.freezeIndicator(!1)),this._rowHeightSync=!0}return e},St.prototype.unfreezeLayout=function(t){this.freezeLayout(!1===t)},St.prototype.isLayoutFrozen=function(){return this._frozenLayout},St.prototype.showBorders=o._deprecatedFunction,St.prototype.hideBorders=o._deprecatedFunction,St.prototype.toggleBorders=function(t){this.toggleClass("no-borders",null!=t?!t:null)},St.prototype.toggleGridlines=function(t){this.toggleClass("no-gridlines",null!=t?!t:null)},St.prototype.toggleVerticalLines=function(t){this.toggleClass("no-vertical-grid-line",null!=t?!t:null)},St.prototype.toggleHorizontalLines=function(t){this.toggleClass("no-horizontal-grid-line",null!=t?!t:null)},St.prototype.toggleContentVerticalLines=function(t){this.toggleClass("no-content-vertical-line",null!=t?!t:null)},St.prototype.getDataColumnMap=function(){for(var t=[],e=this.getColumnCount();--e>=0;)t[e]=this.getDataColumnName(e);return t},St.prototype.setDataColumnMap=function(t){var e,i;if(t)for(e=t.length;--e>=0;)(i=this._getColumnDef(e)).dataColumnName=t[e];else for(e=this._columnDefs.length;--e>=0;)(i=this._columnDefs[e])&&null!=i.dataColumnName&&(i.dataColumnName=null)},St.prototype.getDataColumnName=function(t){return this._getColumnDef(t).dataColumnName||""},St.prototype.setDataColumnName=function(t,e){this._getColumnDef(t).dataColumnName=e},St.prototype.setDefaultRenderingHandler=function(t){this._renderingHandler="function"==typeof t?t:null},St.prototype.setDefaultDataBindingHandler=function(t){this._dataBindingHandler="function"==typeof t?t:null},St.prototype.setColumnRenderingHandler=function(t,e){this._getColumnDef(t).renderingHandler="function"==typeof e?e:null},St.prototype.setColumnDataBindingHandler=function(t,e){this._getColumnDef(t).dataBindingHandler="function"==typeof e?e:null},St.prototype.getColumnRenderingHandler=function(t){return this._getColumnDef(t).renderingHandler||null},St.prototype.getColumnDataBindingHandler=function(t){return this._getColumnDef(t).dataBindingHandler||null},St.prototype.enableRowHighlighting=function(t){if(null==t&&(t=!0),this._rowHighlighting!==t){this._rowHighlighting=t;for(var e=this.getAllSections("content"),i=e.length;--i>=0;)e[i].enableRowHighlighting(this._rowHighlighting)}},St.prototype._getTarget=function(t){var e=t.target;if(e){var i=null;return this._element.contains(e)||(i=t.composedPath?t.composedPath():t.path),i?i[0]||null:e}return t.getElement?t.getElement():o.isElement(t)?t:null},St.prototype.getRelativePosition=function(t,e){if(!t)return{};var i=e||{},n=this._getTarget(t);t.target?o.getRelativePosition(t,this.getElement(),i):n&&o.getRelativePosition(n,this.getElement(),i),1!==this._zoomFactor&&(i.x/=this._zoomFactor,i.y/=this._zoomFactor),i.hit=!1,i.grid=this,i.clientX=t.clientX,i.clientY=t.clientY,i.zoomFactor=this._zoomFactor;var r=o.closestElement(n,"cell");if(!r)return i;i.cellElement=r;var s=o.closestElement(r,"column");i.columnElement=s;var l;if(!(l=s?o.closestElement(s,"tr-lg"):o.closestElement(r,"tr-lg")))return i;i.sectionName=l.id||o.closestElement(l,"tr-vlg").id;var a=this.getSectionSettings(i.sectionName);if(!a)return i;a.extendEventArg(i);var h=a.getSection(),u=h.getColumnIndex(s||r);return u<0||(i.colIndex=u,!1===this._hitTestY(-1,i)||(r.stretched?i.cell=h.getStretchedCell(u,i.rowIndex):i.cell=h.getCell(u,i.rowIndex),i.hit=!0)),i},St.prototype.getVScrollbar=function(){return this._vscrollbar},St.prototype.getHScrollbar=function(){return this._hscrollbar},St.prototype.autoHideScrollbars=function(t){t=null==t||t,this._vscrollbar.setAutoHide(t),this._hscrollbar.setAutoHide(t)},St.prototype.getVScrollStartIndex=function(){return this._startVScrollbarIndex},St.prototype.getHScrollStartIndex=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:-1},St.prototype.scrollToColumn=function(t,e){if(!this._updateScrollbar(this._hscrollbar))return!1;var i=this._layoutX.getLaneCount();if(t<=0?t=0:t>=i&&(t=i-1),this.isPinnedColumn(t))return!1;var o=this._hScrollbarEnabled?this._layoutX.getLaneStart(this._pinnedLeftColumnCount):0,n=this._hscrollbar.getScrollLeft(),r=n+o,s=this._hscrollbar.getWidth(),l=this._layoutX.hitTest(r),a=this._layoutX.getLaneStart(t),h=this._layoutX.getLaneSize(t);if(e||h>=s||t<=l){var u=a-o;if(n!==u)return this._hscrollbar.setScrollLeft(u),!0}else{var p=r+s;if(t>=this._layoutX.hitTest(p-.1)){var _=n+(a+h)-p;return this._hscrollbar.setScrollLeft(_),!0}}return!1},St.prototype.getScrollLeft=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getScrollLeft():0},St.prototype.setScrollLeft=function(t){this._updateScrollbar(this._hscrollbar)&&this._hscrollbar.setScrollLeft(t)},St.prototype.scrollRight=function(t){this.setScrollLeft(this._hscrollbar.getScrollLeft()+t)},St.prototype.getScrollWidth=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getContentWidth():0},St.prototype.getYScrollVal=function(t,e,i){if(!this._updateScrollbar(this._vscrollbar))return null;var o=null;t&&(o=this.getSection(t));var n=this._layoutY.getLaneCount(),r=o?o.getRowOffset():this._sectionStarts[this._startVScrollbarIndex];r&&(e+=r),e<=0?e=0:e>=n&&(e=n-1);var s=this._layoutY.getLaneStart(r),l=this._vscrollbar.getScrollTop()+s,a=o?o.getFirstIndexInView():this._layoutY.hitTest(l),h=-1;if(i)h=e;else if(e<=a)(h=e-3)<0&&(h=0);else{var u=l+this._vscrollbar.getHeight(),p=o?o.getLastIndexInView():this._layoutY.hitTest(u-.1);e>=p&&(h=e-(p-a)+3)<0&&(h=0)}return h>=0?this._layoutY.getLaneStart(h)-s:null},St.prototype.scrollToRow=function(t,e,i){var o=this.getYScrollVal(t,e,i);null!==o&&this._vscrollbar.setScrollTop(o)},St.prototype.getVScrollView=function(){if(!this._updateScrollbar(this._vscrollbar))return null;var t=this._layoutY.getLaneCount();if(0===t)return null;var e=this._sectionStarts[this._startVScrollbarIndex],i=this._layoutY.getLaneStart(e),o=this._vscrollbar.getScrollTop()+i,n=this._vscrollbar.getHeight(),r=o+n,s=this._layoutY.hitTest(o),l=this._layoutY.hitTest(r-.1),a=this._layoutY.getLaneStart(s),h=this._layoutY.getLaneEnd(l),u=o-n,p=u<=i?e:this._layoutY.hitTest(u)+1,_=r+n,c=_>=this._layoutY.getTrackSize()?t-1:this._layoutY.hitTest(_-.1)-1;s-=e,l-=e;var d={};return d.viewTop=o-i,d.viewBottom=r-i,d.topRowIndex=s,d.bottomRowIndex=l,d.firstFullRow=a<o?s+1:s,d.lastFullRow=h>r?l-1:l,d.prevPageRowIndex=p-e,d.nextPageRowIndex=c-e,d},St.prototype.getScrollTop=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getScrollTop():0},St.prototype.setScrollTop=function(t){this._updateScrollbar(this._vscrollbar)&&this._vscrollbar.setScrollTop(t)},St.prototype.scrollDown=function(t){this.setScrollTop(this._vscrollbar.getScrollTop()+t)},St.prototype.getScrollHeight=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getContentHeight():0},St.prototype.restoreScrollbars=function(){this._vscrollbar.restoreTrackPosition()},St.prototype.enableAutoSetDataSource=function(t){this._autoSetDataSource=t},St.prototype.getRowVirtualizer=function(){return this._rowVirtualizer},St.prototype.getColumnVirtualizer=function(){return this._colVirtualizer},St.prototype.enableRowVirtualization=function(t){this._rowVirtualizer.enable(t),this._rowVirtualizer.isEnabled()&&this._vscrollbar.isEnabled()?this._rowVirtualizer.activate():this._rowVirtualizer.deactivate()},St.prototype.isRowVirtualizationEnabled=function(){return this._rowVirtualizer.isEnabled()},St.prototype.enableColumnVirtualization=function(t){this._colVirtualizer.enable(t);for(var e=this._colVirtualizer.isEnabled(),i=this._settings.length;--i>=0;)this._settings[i].enableColumnVirtualization(e)},St.prototype.isColumnVirtualizationEnabled=function(){return this._colVirtualizer.isEnabled()},St.prototype.setRowScrollingStep=function(t){this._rowScrollingStep=t>0?t:0,this._vscrollbar.setScrollingStep(this._layoutY.getDefaultLaneSize()*this._rowScrollingStep)},St.prototype.getVMouseWheelHandler=function(){return this._vscrollbar.getDefaultMouseWheelLogic()},St.prototype.synchronizeVScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);var e=t.getVScrollbar();e._mainScrollbar=this._vscrollbar,e.setStyle("visibility","hidden"),e.setStyle("pointerEvents","none"),e.disableMouseWheel(),e.attachToExternalElement(this._vscrollbar.getParent()),this._vscrollbar.listen("scroll",t._onSyncVScroll)},St.prototype.synchronizeHScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);var e=t.getHScrollbar();e._mainScrollbar=this._hscrollbar,e.setStyle("visibility","hidden"),e.setStyle("pointerEvents","none"),e.disableMouseWheel(),e.attachToExternalElement(this._hscrollbar.getParent()),this._hscrollbar.listen("scroll",t._onSyncHScroll)},St.prototype.updateRowData=function(t,e,i,o){var n=this.getSectionSettings(t||"content");n&&n.updateRowData(e,i,o)},St.prototype.rerender=function(){for(var t=this._settings.length,e=0;e<t;e++)this._settings[e].rerender()},St.prototype.requestRowRefresh=function(){this._rowRefreshTimer||(this._rowRefreshTimer=setTimeout(this._onRowRefresh,100))},St.prototype._requestScrollbarUpdate=function(){this._updateScrollbarHeight(!0,!0),this._rowHeightTimerId=0},St.prototype.deactivateRendering=function(t){if((t=!1!==t)!=this._noBinding){this._noBinding=t;var e=this.getSectionSettings("content");e&&(e.disableDataBinding(t),t||this.requestRowRefresh())}},St.prototype._onRowRefresh=function(){this._rowRefreshTimer=0,this.updateRowData()},St.prototype.disableLazyRendering=function(t){console.log("WARNING: This function is deprecated.")},St.prototype.getData=function(t,e,i){var o=this.getSectionSettings(t);if(!o)return null;var n=this._toDataColumnName(e);return o.getData(n,i)},St.prototype.setData=function(t,e,i,o){var n=this.getSectionSettings(t);if(n&&n.isDataBindable()){var r=this._toDataColumnName(e);return n.setData(r,i,o)}return!1},St.prototype.removeRowData=function(t,e){var i=this.getSectionSettings(t);return!(!i||!i.isDataBindable())&&i.removeRowData(e)},St.prototype.setHidingMethod=function(t){if(t||(t=""),this._hidingMethod!==t){this._hidingMethod=t;for(var e=this.getAllSections(),i=e.length;--i>=0;)e[i].setHidingMethod(t)}},St.prototype.getHorizontalLayout=function(){return this._layoutX},St.prototype.setColumnVisibility=function(t,e,i){if(this._layoutX.hideLane(t,!e,i)){if(this._syncLayoutToColumns(t,t+1),e&&this.requestRowRefresh(),this._hasListener("columnVisibilityChanged")){var o={};o.colIndex=t,o.hidden=!e,this._dispatch("columnVisibilityChanged",o)}return!0}return!1},St.prototype.getColumnVisibility=function(t,e){return this._layoutX.getLaneVisibilityBit(t,e)},St.prototype.reserveRightSpace=function(t){if(this._reservedSpace!==t){this._reservedSpace=t;for(var e=this._settings.length;--e>=0;)this._settings[e].getSection().reserveRightSpace(t);return this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),!0}return!1},St.prototype.getHiddenInput=function(){return this._hiddenInput},St.prototype.focus=function(){var t=this._hiddenInput,e=document.activeElement;if(t&&t!==e){var i=window.pageXOffset,o=window.pageYOffset;if(t.setActive)try{t.setActive()}catch(e){t.focus({preventScroll:!0})}else t.focus({preventScroll:!0});o===window.pageYOffset&&i===window.pageXOffset||window.scrollTo(i,o)}},St.prototype.isBinding=function(){return this._dispatchingDataChanged},St.prototype.hideRow=function(t,e){this._dataSource.hideRow(t,e)},St.prototype.hideRows=function(t,e){Array.isArray(t)?this._dataSource.hideRows(t,e):this._dataSource.hideRow(t,e)},St.prototype.showRows=function(t,e){Array.isArray(t)?this._dataSource.showRows(t,e):this._dataSource.showRows([t],e)},St.prototype.unhideAllRows=function(){this._dataSource.unhideAllRows()},St.prototype.hasHiddenRow=function(){return this._dataSource.hasHiddenRow()},St.prototype.initSimpleTable=function(t){var e=0;t||this.getColumnCount()||(t=["Default"]),t&&(e=t.length,this.setColumnCount(e),this.setDataColumnMap(t));var i=this.addSection("title");if(i.addRow(1),!this._renderingHandler)for(var o=0;o<e;++o)i.setCellContent(o,0,t[o]);this.addSection("content");var n=this.getSectionSettings("title");n.disableDataBinding();var r=this.getSectionSettings("content");r.setAutoSyncRowCount(!0),r.setParent(n),this._dataBindingHandler||this.setDefaultDataBindingHandler(St._defaultDataBinding)},St._defaultDataBinding=function(t){t.cell.setContent(t.dataValue)},St.prototype.selectColumn=function(t,e){for(var i=this._settings.length;--i>=0;)this._settings[i].getSection().selectColumn(t,e);this._updateColumnBounds()},St.prototype.isSelectedColumn=function(t){var e=this._settings[0]||null;return!!e&&e.getSection().isSelectedColumn(t)},St.prototype._updateColumnBounds=function(){if(!this._columnBoundConflator.conflate()){var t=this._settings.length;if(t){var e,i=[],o=null,n=this.getColumnCount(),r=[];for(e=0;e<n;e++)this.isSelectedColumn(e)?(r.push(e),o||(o=[e,-1])):o&&(o[1]=e-1,i.push(o),o=null);o&&(o[1]=n-1,i.push(o),o=null);var s={selectedColumns:r,selectionRanges:i};this._dispatch("beforeColumnBoundUpdate",s);var l=i.length,a=[],h=[],u=this._settings[0],p=u.getSection();for(e=0;e<l;++e){o=i[e];var _=[0,0],c=[!1,!1];p.calculateColumnBounds(o[0],o[1],_,c),_[0]<_[1]&&(a.push(_),h.push(c))}var d=0,g=-1;for(null!=s.topBoundRowIndex&&(g=+s.topBoundRowIndex),g>=0&&"title"===u.getType()&&(d=this._layoutY.getLaneStart(g)),p.updateColumnBounds(a,h,d),e=1;e<t;e++)(p=this._settings[e].getSection()).updateColumnBounds(a,h)}}},St.prototype._updateColumnSeparators=function(){var t=this._settings.length;if(t)for(var e=0;e<t;e++){var i=this._settings[e].getSection();i&&i.updateColumnSeparators()}},St.prototype.getColumnRect=function(t,e){var i=this.getElement().clientWidth,o=i,n=this._hscrollbar;n.isActive()&&(o=n.getTrackSize());var r=0,s=0;if(this._settings.length){var l=[0,0];this._settings[0].getSection().calculateColumnBounds(t,e,l,[]),s=l[1]-(r=l[0])}return{top:0,left:r,width:s,height:this._layoutY.getTrackSize(),leftPinnedIndex:this._pinnedLeftColumnCount-1,rightPinnedIndex:this.getFirstPinnedRightIndex(),scrollViewSize:o,gridWidth:i}},St.prototype.getRowRect=function(t,e){var i=this._layoutX.getTrackSize(),o=this.getElement().clientWidth;i=i<o?i:o;var n=this.getSection("content"),r=n?n.getRowOffset():1,s=this._layoutY,l=s.getLaneStart(r),a=0,h=n.getHeight(),u=this._vscrollbar;u.isActive()&&(a=u.getScrollTop(),h=u.getTrackSize());var p=h+l,_=s.getLaneStart(t+r)-a,c=s.getLaneEnd(e+r)-a;return _<l?_=l:_>p&&(_=p),c<l?c=l:c>p&&(c=p),{top:_-=l,left:0,width:i,height:(c-=l)-_,scrollViewSize:h,scrollViewTop:l,scrollViewBottom:p}},St.prototype.normalizeConfig=function(t){t||(t={});var e,i,o=t.columns,n=o?o.length:0,r=t.columnFreezing;null==r&&(r=t.freezeColumn);var s=t.pinnedRightColumns||t.frozenRightColumns;if(s)for(delete t.pinnedRightColumns,delete t.frozenRightColumns,t.columnVirtualRendering=!1,t.columnVirtualization=!1,e=n;--e>=0;)--s>=0&&(i=o[e])&&(i.rightPinned=!0);return null!=r&&(delete t.columnFreezing,delete t.freezeColumn,r>=0&&o&&(i=o[r])&&(i.leftPinned=!0)),t},St.prototype.setColumnGrouping=function(t){this._groupDefs=t||null},St.prototype.getColumnGroupParentId=function(t){if(this._groupDefs){var e="number"==typeof t?this.getColumnId(t):t;return this._groupDefs.getParentId(e)}return""},St.prototype.getColumnGroupChildIds=function(t){if(this._groupDefs){var e=this._groupDefs.getLeafDescendants(t);if(e&&e.length>0)return e}return null},St.prototype.getValidColumnList=function(t,e){var i=[];if(!t)return i;e||(e=this.createColumnMap(t));for(var o=this.getColumnCount(),n=0;n<o;++n){var r=this._getColumnDef(n).id;null!=e[r]&&i.push({index:n,id:r})}return i},St.prototype.createColumnMap=function(t){t||(t=this.getColumnIds());for(var e={},i=t.length,o=0;o<i;o++){var n=t[o];"number"==typeof n&&(n=this.getColumnId(n)),n&&(e[n]=!0)}return e},St.prototype.startBatch=function(t){return!!t&&(this._batches||(this._batches={}),this._batches[t]=t,"reset"===t&&this._disableEvent("columnVisibilityChanged",!0),this._dispatch("beforeBatchOperation",{batches:this._batches,batchType:t}),!0)},St.prototype.stopBatch=function(t){return!!t&&(this._dispatch("afterBatchOperation",{batches:this._batches,batchType:t}),"reset"===t&&this._disableEvent("columnVisibilityChanged",!1),delete this._batches[t],W(this._batches)&&(this._batches=null),!0)},St.prototype._dispatchColumnEvent=function(t,e){var i=this._batches;i&&(e.batches=i),this._dispatch(t,e)},St.prototype._dispatchColumnPositionChanged=function(){this._columnPositionConflator.conflate()||this._dispatch("columnPositionChanged",{sender:this})},St.prototype._dispatchRowPositionChanged=function(){this._rowPositionConflator.conflate()||this._dispatch("rowPositionChanged",{sender:this})},St.prototype._getAllSections=function(){for(var t=[],e=this._settings.length,i=0;i<e;i++)t.push(this._settings[i].getSection());return t},St.prototype._getNextSection=function(t,e,i){var o=this.getSectionIndex(e)+t;if(null==i)return this.getSectionSettings(o);i=this._toSectionType(i);for(var n=this._settings.length;o>=0&&o<n;){var r=this._settings[o];if(i===r.getType())return r;o+=t}return null},St.prototype._toSectionType=function(t){if(St._sectionType[t])return t;if(o.isString(t))switch(t.charAt(0).toLowerCase()){case"t":return"title";case"h":case"s":return"header";case"f":return"footer"}return"content"},St.prototype._newSection=function(t,e){if(e)for(var i=this._settings.length;--i>=0;)if(this._settings[i].getId()===e)return null;t=this._toSectionType(t);var o={horizontalScrollbar:this._hscrollbar},n="content"===t?new vt(o):new N(o);n._setContext(this);var r=new _t(n);r.setId(e),r.setType(t),r.listen("dataChanged",this._onSectionDataChanged),r.listen("rowAvailable",this._onRowAvailable);var s="content"===t&&this._rowHighlighting;return n.enableRowHighlighting(s),n.enableShading(!1),n.setHidingMethod(this._hidingMethod),r.enableColumnVirtualization(this._colVirtualizer.isEnabled()),n.setColumnCount(this._layoutX.getLaneCount()),n.reserveRightSpace(this._reservedSpace),this._syncLayoutToSectionColumns(n),this._syncStyleToSectionColumns(n,t),t!==this._rowHeightException&&n.setDefaultRowHeight(this._layoutY.getDefaultLaneSize()),n.listen("rowHighlighted",this._onRowHightlighted),n.listen("rowCountChanged",this._onRowCountChanged),n.listen("rowHeightChanged",this._onRowHeightChanged),r},St.prototype._putToLast=function(t){if(0===this._settings.length)t.setParent(this._element,!0);else{var e=this.getLastSection().getElement().nextSibling;null!==e?t.insertBefore(e):t.setParent(this._element)}},St.prototype._syncStyleToSectionColumns=function(t,e){for(var i,o=this._columnDefs.length;--o>=0;){var n=this._getColumnDef(o),r=n.styles;for(i in r)t.setColumnStyle(o,i,r[i]);var s=n.classes;for(i in s)t.enableColumnClass(o,i,!0);var l=n[e];if(l){for(i in r=l.styles)t.setColumnStyle(o,i,r[i]);for(i in s=l.classes)t.enableColumnClass(o,i,!0)}}},St.prototype._syncRowHeights=function(){for(var t=this._settings.length,e=0;e<t;++e)this._syncSectionRowHeights(this._settings[e].getSection());return!this._frozenLayout&&this._updateScrollbarHeight(!0,!0)},St.prototype._syncSectionRowHeights=function(t){this._layoutY.copyFrom(t.getRowLayout(),this._sectionStarts[t.getIndex()])},St.prototype._setColumnWidth=function(t,e,i){var o=!1,n=this._layoutX;if(null!=i)o=n.setLaneScalability(t,!!i);else{var r=n.getLaneScalability(t);if(this._preserveProportion){if(r){for(var s=this.getColumnCount(),l=0,a=0,h=0;h<s;++h)if(n.getLaneScalability(h)){var u=n.getLaneSize(h);l+=n.getCustomLaneSize(h),a+=u}(!(e=(e*l-e*n.getCustomLaneSize(t))/(a-e))||e<0)&&(e=l)}}else o=n.setLaneScalability(t,!1)}return n.setLaneSize(t,e)||o},St.prototype._dispatchColumnAddedEvent=function(t,e,i,o){if(this._hasListener("columnAdded")){var n={};if(n.atTheMiddle=i,1===e)n.colIndex=t,n.context=o,this._dispatchColumnEvent("columnAdded",n);else for(var r=Array.isArray(o)?o:[],s=0;s<e;++s)n.colIndex=t+s,n.context=r[s],this._dispatchColumnEvent("columnAdded",n)}this._dispatchColumnRenderEvent({},t,t+e,0,this._settings.length,NaN,NaN)},St.prototype._dispatchColumnRenderEvent=function(t,e,i,o,n,r,s){if(o<n){var l;if(t.sender=this,t.fromColIndex=e,t.toColIndex=i,this._hasListener("preSectionRender"))for(l=o;l<n;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("preSectionRender",t);for(var a=e;a<i;++a){var h=this.getColumnRenderingHandler(a)||this._renderingHandler;if(h)for(t.colIndex=a,t.dataColumnName=this.getDataColumnName(a),l=o;l<n;++l){var u=this._settings[l];u.extendRenderEventArg(t,r,s);for(var p=u.getSection(),_=t.fromRowIndex,c=t.toRowIndex,d=_;d<c;++d)t.rowIndex=d,t.cell=p.getCell(a,d,!1),h(t)}}if(this._hasListener("postSectionRender"))for(l=o;l<n;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("postSectionRender",t);if(!t.noDataUpdate&&!this._noBinding)for(l=o;l<n;++l)this.updateRowData(this._settings[l],r,s-1)}},St.prototype._dispatchRowExpansionBinding=function(t){if(this._hasListener("rowExpansionBinding")){var e=t.dataSource;if(e&&e.getDataSource()){var i=t.fromRowIndex,o=t.toRowIndex,n=e.getExpansionParents(i,o),r=e.getVisibleRowIds(!0),s=t.section;t.rowData=null,t.cell=null;for(var l=i;l<o;++l){var a=n[l],h=s.getContextRow(l);if(a)t.originalRowData=e.getRowData(a),t.originalRowId=a,t.rowExpansion=h.rowExpansion=!0;else{if(!h.rowExpansion)continue;t.originalRowData=null,t.originalRowId=null,t.rowExpansion=h.rowExpansion=!1}t.rowId=r[l],t.rowIndex=l,this._dispatch("rowExpansionBinding",t)}t.originalRowData=null,t.originalRowId=null,t.rowExpansion=!1}}},St.prototype._removeColumn=function(t){var e=this._layoutX.getLaneCount();if(t>e&&(t=e),!(t<=0)){var i=e-t;this._layoutX.setLaneCount(i);for(var o=this._settings.length;--o>=0;)this._settings[o].getSection().setColumnCount(i);var n=this._columnDefs.slice(i);if(this._columnDefs.length=i,this._onColumnCountChanged(),this._syncLayoutToColumns(i,0,!0),this._hasListener("columnRemoved"))for(var r={},s=e;--s>=i;){var l=n[s-i];r.colIndex=s,r.columnData=l?l.columnData:null,this._dispatchColumnEvent("columnRemoved",r)}}},St.prototype._onSectionDataChanged=function(t){if(!this._dispatchingDataChanged){var e=this._layoutX.getLaneCount();if(this._dispatchingDataChanged=!!e,e){var i,o,n=t.fromRowIndex,r=t.toRowIndex,s=t.section,l=t.dataSource,a=l&&l.getDataSource()?1:0;s._startBindingSession(!0),a&&(i=l.getVisibleRowIds(!0),o=l.getMultipleRowData(i,n,r),t.dataRows=o);var h="content"===t.sectionType;h&&this._dispatch("beforeContentBinding",t),this._dispatch("preSectionDataBinding",t);for(var u=this.getDataColumnMap(),p=0;p<e;++p)if(s.isColumnActive(p)&&(this.isColumnVisible(p)||this._isAlwaysRenderColumn(p))){var _=this.getColumnDataBindingHandler(p)||this._dataBindingHandler;if(_){var c=u[p];t.dataColumnName=c,t.colIndex=p;for(var d=n;d<r;++d){if(a){var g=o[d];t.rowData=g,t.rowId=i[d],t.dataValue=g?g[c]:null}t.rowIndex=d,t.cell=s.getCell(p,d,!1),_(t)}}}this._dispatch("postSectionDataBinding",t),this._dispatchRowExpansionBinding(t),h&&(this._firstRendered||(this._dispatch("firstRendered",t),this._firstRendered=!0),this._dispatch("afterContentBinding",t)),s._startBindingSession(!1),this._dispatchingDataChanged=!1}}},St.prototype.resetInternalState=function(){this._firstRendered=!1},St.prototype._updateScrollbar=function(t){return!!t&&(t.isEnabled()&&t.update(),t.isActive())},St.prototype._onVScroll=function(t){this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop()),this._dispatchRowPositionChanged()},St.prototype._onHScroll=function(t){var e=this._hscrollbar.getScrollLeft();this._colVirtualizer.setViewOffset(e),this._updateColumnBounds(),this._dispatchColumnPositionChanged()},St.prototype._onVScrollEnabled=function(){this._updateScrollbarHeight(!0,!1),this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.activate(),this._vscrollbar.getAutoHide()||this._updateVScrollbar()},St.prototype._onVScrollDisabled=function(){this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.deactivate()},St.prototype._onRowInViewChanged=function(t){for(var e=t.firstIndex,i=t.lastIndex+1,o=this._settings.length,n=[0,0],r=0;r<o;++r){var s=this._settings[r],l=s.getSection();l&&!l.getFrozenLayout()&&(l.activateRows(e,i,n),this.updateRowData(s,n[0],n[1]-1))}},St.prototype._onColInViewChanged=function(t){if(this.getColumnCount()){var e=t.prevFirstIndex,i=t.prevLastIndex,o=t.firstIndex,n=t.lastIndex,r=e<o?e:o,s=i>n?i:n;this._activateColumns(o,n,r,s);for(var l=this.getSectionCount(),a=0;a<l;++a){var h=this._settings[a];this.updateRowData(h)}}},St.prototype._activateColumns=function(t,e,i,o){null==i&&(i=0),null==o&&(o=this.getColumnCount()-1);for(var n=this._getColActivationList(t,e,i,o),r=this.getSectionCount();--r>=0;)this._settings[r].activateColumns(n,i,o)},St.prototype._getColActivationList=function(t,e,i,o){null==i&&(i=0);var n=this.getColumnCount();null==o&&(o=n-1),null==t&&(t=this._colVirtualizer.getFirstIndexInView()),null==e&&(e=this._colVirtualizer.getLastIndexInView());for(var r=this.getHScrollStartIndex(),s=this.getFirstPinnedRightIndex(),l=new Array(o+1),a=i;a<=o;++a)l[a]=a<r||a>=t&&a<=e||a>=s;return l},St.prototype._getColumnDef=function(t){if(t>=0){var e=this._columnDefs[t];return e||(e=this._columnDefs[t]={id:""+St._runningColumnId++,columnData:{}}),e}return{}},St.prototype._getNestedColumnDef=function(t,e,i){var o=this._getColumnDef(t);if(e){var n=o;(o=n[e])||(o=n[e]={}),i&&((o=(n=o)[i])||(o=n[i]={}))}return o},St.prototype.getColumnId=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).id||""},St.prototype._getColumnId=St.prototype.getColumnId,St.prototype.getColumnIds=function(){for(var t=this.getColumnCount(),e=new Array(t),i=0;i<t;++i)e[i]=this._getColumnDef(i).id||"";return e},St.prototype.setColumnField=function(t,e){this._getColumnDef(t).field=e||""},St.prototype.getColumnField=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).field||""},St.prototype.getColumnFields=function(){for(var t=this.getColumnCount(),e=new Array(t),i=0;i<t;++i)e[i]=this._getColumnDef(i).field||"";return e},St.prototype.getColumnIndex=function(t){if("number"==typeof t)return t;if(t)for(var e=t,i=this.getColumnCount(),o=0;o<i;++o){var n=this._getColumnDef(o);if(e===n.id||e===n.field)return o}return-1},St.prototype.getColumnIndices=function(t){for(var e=[],i=this.getColumnCount(),o=Array.isArray(t)?t:[t],n=o.length,r=0;r<n;++r){var s=this.getColumnIndex(o[r]);s>=0&&s<i&&e.push(s)}return e},St.prototype.getColumnIndexMap=function(){for(var t=this.getColumnCount(),e={},i="",o=0;o<t;++o){var n=this._getColumnDef(o);(i=n.field)&&(e[i]=o),(i=n.id)&&(e[i]=o)}return e},St.prototype._onWindowResize=function(){this._updateLayout(),this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop())},St.prototype._onMouseMove=function(){this._vscrollbar.flash(),this._hscrollbar.flash()},St.prototype._onGridClicked=function(){if(!window.getSelection().toString()){var t=document.activeElement;this._element.contains(t)||this.focus()}},St.prototype._onRowHightlighted=function(t){if(this._hasListener("rowHighlighted")){var e=t.sender,i=this.getSectionSettings(e.getId());if(null!=i){i.extendEventArg(t);var o=i.getDataSource();null!==o&&(t.rowId=o.getRowId(t.rowIndex),t.dataRow=o.getRowData(t.rowId)),this._dispatch("rowHighlighted",t)}}},St.prototype._onRowCountChanged=function(t){if(!this._disposed){var e=t.sender,i=t.prevCount,o=t.rowCount,n=e.getIndex(),r=this._updateSectionIndices(n),s=0;if(i>o)this._layoutY.removeLaneAt(r,i-o),this._layoutY.isHomogeneous()||this._syncSectionRowHeights(e);else{var l=this._layoutY.getDefaultLaneSize(),a=e.getDefaultRowHeight();if(this._layoutY.insertLane(r+i,o-i),a!==l)for(s=i;s<o;++s)this._layoutY.setLaneSize(r+s,a)}var h=n<=this._startVScrollbarIndex||n>=this._getFooterStartIndex(),u=this._frozenFooterCount>0,p=this._updateScrollbarHeight(h,u,t.noBinding);this._frozenLayout||p||(this._rowVirtualizer.isVirtualizable()?e.activateRows(this._rowVirtualizer.getFirstIndexInView(),this._rowVirtualizer.getLastIndexInView()):e.activateRows()),u||this._updateVScrollbar(),this._updateColumnSeparators(),i<o?this._dispatch("rowAdded",t):i>o&&this._dispatch("rowRemoved",t)}},St.prototype._onRowHeightChanged=function(t){if(this._rowHeightSync&&!this._disposed&&!this._rowHeightConflator.conflate(t)){for(var e=this._rowHeightConflator.popAllData(),i=e.length,o=NaN,n=0;n<i;++n){var r=e[n],s=r.section;if(this._containsSection(s))for(var l=s.getIndex(),a=r.rowIndex,h=this.getRowIndex(l,a),u=r.changeLength,p=0;p<u;++p)this._layoutY.setLaneSize(h+p,s.getRowHeight(a+p))&&(l>=o||(o=l))}this._rowHeightConflator._needScrollbarUpdate?(this._rowHeightConflator._needScrollbarUpdate=!1,this._updateScrollbarHeight(!0,!0)):o>=0&&(this._dispatchingDataChanged?this._rowHeightTimerId||(this._rowHeightTimerId=setTimeout(this._requestScrollbarUpdate,0)):this._updateScrollbarHeight(o<this._startVScrollbarIndex,o>=this._startVScrollbarIndex)),this._updateColumnSeparators(),this._dispatchRowPositionChanged()}},St.prototype._containsSection=function(t){for(var e=this._settings.length;--e>=0;)if(this._settings[e].getSection()===t)return!0;return!1},St.prototype._onRowAvailable=function(t){var e=t.sectionIndex;this._dispatchColumnRenderEvent(t,0,this.getColumnCount(),e,e+1,t.prevRowIndex,t.rowIndex)},St.prototype._onSectionCountChanged=function(t){if(!this._frozenLayout){if(this._tempFrozenSectionRef){var e=this.getNextSection(this._tempFrozenSectionRef);null!==e&&(this._startVScrollbarIndex=e.getIndex(),this._tempFrozenSectionRef="")}this._startVScrollbarIndex>=0&&this._startVScrollbarIndex<this._getFooterStartIndex()?(this._vscrollbar.enable(),this._vscrollbar.setScrollContent(this,this._getAllSections(),this._startVScrollbarIndex),t||this._updateScrollbarHeight(!0,!0),this._syncLayoutToColumns()):this._vscrollbar.disable()}},St.prototype._onColumnCountChanged=function(){if(!this._frozenLayout&&!this._disposed){var t=this._countPinnedLeftColumns(),e=this._countPinnedRightColumns();this._updateColumnBounds(),this._updateColumnSeparators(),this._hScrollbarEnabled&&t+e<this.getColumnCount()?(this._hscrollbar.enable(),this._colVirtualizer.activate(),this._hscrollbar.setScrollContent(this,this._getAllSections(),t,e)):(this._hscrollbar.disable(),this._colVirtualizer.deactivate(),t=e=0),this._element.classList.toggle("right-pinning",e>0),this._dispatchColumnPositionChanged()}},St.prototype._onSyncVScroll=function(t){this._vscrollbar.setScrollTop(t.scrollTop)},St.prototype._onSyncHScroll=function(t){this._hscrollbar.setScrollLeft(t.scrollLeft)},St.prototype._getFooterStartIndex=function(){return this.getSectionCount()-this._frozenFooterCount},St.prototype._getVScrollStart=function(){return this._getSectionSize(0,this._startVScrollbarIndex)},St.prototype._getFooterSize=function(){return this._frozenFooterCount>0?this._getSectionSize(this._getFooterStartIndex()):0},St.prototype._getSectionSize=function(t,e){if(t){if(t<0)return 0}else t=0;null==e&&(e=this.getSectionCount()-t);var i=this._layoutY.getLaneStart(this._sectionStarts[t]),o=t+e;return(e>0?this._layoutY.getLaneStart(this._sectionStarts[o]):0)-i},St.prototype._updateScrollbarHeight=function(t,e,i){if(!this._vscrollbar.isEnabled())return!1;var o=e,n=t&&this._startVScrollbarIndex>=0,r=this._rowHeightConflator.isConflating();if(r&&(this._rowHeightConflator._needScrollbarUpdate=!0,o=!1),n&&!r){var s=this.getElement();if(!s)return!1;var l=this.getParent(),a=this._vscrollbar.getParent();a?a!==l&&a.firstElementChild&&(a=a.firstElementChild):(a=s,this._vscrollbar.setParent(a));var h=this._getVScrollStart(),u=this._getFooterSize();a!==s&&(h+=s.clientTop),this._vscrollbar.resetPaneSize();var p=a.clientHeight-(h+u)*this._zoomFactor;this._vscrollbar.setTop(h*this._zoomFactor),this._vscrollbar.setTrackSize(p,p/this._zoomFactor);var _=this._layoutY.getDefaultLaneSize(),c=12*_;p>c&&(c=(Math.ceil(p/_)+4)*_),this._rowVirtualizer.setViewSize(c/this._zoomFactor),this._rowVirtualizer.setViewBounds(this._startVScrollbarIndex,this.getFooterCount())}else this._rowVirtualizer.validateVirtualization();var d=!1;return i||(d=this._rowVirtualizer.update()),this._vscrollbar.invalidate(o),d},St.prototype._updateScrollbarWidth=function(t,e){if(!this._frozenLayout){if(t&&this._hScrollbarEnabled){var i=this.getElement(),o=this._hscrollbar.getParent();o||(o=this.getParent()||i,this._hscrollbar.setParent(o));var n=this._layoutX.getLaneStart(this._pinnedLeftColumnCount),r=this._layoutX.getLaneCount(),s=0,l=this._countPinnedRightColumns();l&&(s=this._layoutX.getLaneStart(r)-this._layoutX.getLaneStart(r-l));var a=o!==i?i.clientLeft:0,h=o.clientWidth-(n+a+s)*this._zoomFactor;l>0&&(h-=this._reservedSpace),this._hscrollbar.setPaneLeft(n),this._hscrollbar.setLeft((n+a)*this._zoomFactor),this._hscrollbar.setTrackSize(h,h/this._zoomFactor);var u=4*this._layoutX.getDefaultLaneSize();h>u&&(u=h),this._colVirtualizer.setViewSize(u/this._zoomFactor),this._colVirtualizer.setViewBounds(this._pinnedLeftColumnCount,l)}else this._colVirtualizer.validateVirtualization();this._colVirtualizer.update(),this._hscrollbar.invalidate(e)}},St.prototype._hitTestY=function(t,e){var i;if(e.sectionSettings)i=e.sectionSettings;else{var n,r=(n="number"==e.rowIndex?e.rowIndex:this._layoutY.hitTest(t))>=0?n:~n,s=o.upperBound(this._sectionStarts,r)-1;if(e.sectionIndex=s,!(i=this._settings[s]))return!1;i.extendEventArg(e)}var l=i.getSection();return null!=e.colIndex&&e.cellElement?e.rowIndex=l.getCellIndex(e.colIndex,e.cellElement):e.rowIndex=n+l.getRowOffset(),!0},St.prototype._syncLayoutToColumns=function(t,e,i){if(!this._frozenLayout){var o=this._layoutX.getLaneCount(),n=this.fillParentWidth(100);(n||null==t||null==e)&&(t=0,e=o,n=!0);var r=this._settings.length;if(!(r<=0)){var s=!1;if(t<e)for(var l=0;l<r;++l)s=this._syncLayoutToSectionColumns(this._settings[l].getSection(),t,e)||s;var a=n||t<this.getHScrollStartIndex()||e>this.getFirstPinnedRightIndex();this._updateScrollbarWidth(a,!0),this._updateColumnBounds(),this._updateColumnSeparators(),this._dispatchColumnPositionChanged(),(s||i)&&this._dispatch("widthChanged",{from:t,to:e,colChanged:t})}}},St.prototype._syncLayoutToSectionColumns=function(t,e,i){null==e&&(e=0),null==i&&(i=this._layoutX.getLaneCount());for(var o=0,n=e;n<i;++n)o|=t._setColumnWidth(n,this._layoutX.getLaneSize(n));return!(!o||this._frozenLayout||(t._updateColumnLayout(),0))},St.prototype._toDataColumnName=function(t){return o.isNumber(t)?this.getDataColumnName(t):t},St.prototype._updateSectionIndices=function(t){this._updatePaddingBottomSect()&&--t,t<0&&(t=0);var e=this._settings.length,i=this._settings[0]||null;i!==this._firstSettings&&(this._firstSettings&&this._firstSettings.getSection().removeClass("first"),this._firstSettings=i,this._firstSettings&&this._firstSettings.getSection().addClass("first"));var o=this._settings[e-1]||null;o!==this._lastSettings&&(this._lastSettings&&this._lastSettings.getSection().removeClass("last"),this._lastSettings=o,this._lastSettings&&this._lastSettings.getSection().addClass("last")),this._sectionStarts.length=e+1,this._sectionStarts[0]=0;for(var n=t;n<e;++n){var r=this._settings[n].getSection();r.setIndex(n),r.setRowOffset(this._sectionStarts[n]),this._sectionStarts[n+1]=this._sectionStarts[n]+r.getRowCount()}return this._sectionStarts[t]},St.prototype._updateLayout=function(){var t=this.getElement();if(!this._disposed&&t.offsetParent){this._syncLayoutToColumns(),this._updateScrollbarHeight(!0,!0),this._updateScrollbarWidth(!0,!0);for(var e=this.getSectionCount(),i=0;i<e;++i)this._settings[i].getSection().updateLayout();this._updateColumnSeparators()}},St.prototype._updateVScrollbar=function(){!this._disposed&&this._vscrollbar.isEnabled()&&(this._vScrollbarConflator.conflate()||this._vscrollbar.update())},St._proto=St.prototype;const wt=St;var bt=function(t){var e=this;e._onSectionAdded=e._onSectionAdded.bind(e),e._onMouseDown=e._onMouseDown.bind(e),e._onUIUpdated=e._onUIUpdated.bind(e),e._onColumnAdded=e._onColumnAdded.bind(e),e._onColumnRemoved=e._onColumnRemoved.bind(e),e._onItemSortingClicked=e._onItemSortingClicked.bind(e),e.refresh=e.refresh.bind(e),e._hosts=[],e._sortLogic={},e._addEvents("preClicked","clicked","preDataSorting","columnSorted"),e._sortStates=[],e._sortingSequence=["a","d"],t&&e.config({sorting:t})};u.inherits(bt,l),bt.prototype._hosts=null,bt.prototype._sortStates,bt.prototype._maxCount=1,bt.prototype._dataSorting=!0,bt.prototype._dblClickAllowed=!1,bt.prototype._clickTimer=0,bt.prototype._delayInterval=0,bt.prototype._lastMouseDown=0,bt.prototype._initialSort=null,bt.prototype._mode="",bt.prototype._sortableColumns=!0,bt.prototype._sortableIndicator=!1,bt.prototype._solarTheme=!1,bt.prototype._sortLogic,bt.prototype._userManagedLogic=!1,bt.prototype._disabled=!1,bt.prototype._frozenIndicator=!1,bt.prototype._rowDefMode=!1,bt._icons={},bt.prototype._sortingSequence,bt.prototype._sortingSequenceMap=null,bt.prototype.getName=function(){return"SortableTitlePlugin"},bt.prototype.initialize=function(t,e){this._hosts.indexOf(t)>=0||(this._hosts.push(t),1===this._hosts.length&&(t.listen("columnAdded",this._onColumnAdded),t.listen("columnRemoved",this._onColumnRemoved)),t.listen("sectionAdded",this._onSectionAdded),t.listen("postSectionRender",this._onUIUpdated),t.listen("dataSourceChanged",this.refresh),this.config(e))},bt.prototype.unload=function(t){var e=this._hosts.indexOf(t);e<0||(this._hosts.splice(e,1),t.unlisten("sectionAdded",this._onSectionAdded),t.unlisten("postSectionRender",this._onUIUpdated),t.unlisten("dataSourceChanged",this.refresh),t.unlisten("columnAdded",this._onColumnAdded),t.unlisten("columnRemoved",this._onColumnRemoved),this._hosts.length<=0&&this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0))},bt.prototype.afterInit=function(){var t=this;t.setSortLogics(t._sortLogic);var e=t._initialSort;null!=e&&(Array.isArray(e)?1===t._maxCount?t.sortColumns(e.slice(0,1)):t.sortColumns(e):t.sortColumns([e]))},bt.prototype.config=function(t){if(t){var e=this,i=t.icons;null!=i&&i.sorting&&(bt._icons=i.sorting);var o=t.themeName;!o||o.indexOf("solar")>=0?e._solarTheme=!0:e._solarTheme=!1,e._initialSort=e._initialSortByColumnField(t);var n=t.sorting;if(n){n.ROW_DEF&&(this._rowDefMode=!0),n.userManagedLogic&&(e._userManagedLogic=!0);var r=n.multiColumn||n.multicolumn;if(null!=r&&(!0===r&&(r=-1),!1===r&&(r=1),e.setSortableColumnCount("number"==typeof r&&r>0?r:-1)),null!=(r=n.sortableIndicator)&&(e._sortableIndicator=r),null!=(r=n.disabled)&&(e._disabled=!!r),null!=(r=n.threeStatesSorting)&&e.disableTwoStateSorting(r),null!=(r=n.sortingSequence)&&Array.isArray(r)&&(e._sortingSequence=r),null!=(r=n.mode)&&(e._mode=r,"manual"===r&&e.disableDataSorting()),null!=(r=n.indicatorOnly)&&e.disableDataSorting(r),null!=(r=n.disableDoubleClickToSort)&&e.disableDoubleClickToSort(r),"function"==typeof(r=n.columnSorted)&&e.listen("columnSorted",r),"function"==typeof(r=n.preClicked)&&e.listen("preClicked",r),"function"==typeof(r=n.clicked)&&e.listen("clicked",r),"function"==typeof(r=n.preDataSorting)&&e.listen("preDataSorting",r),null!=(r=n.sortableColumns)&&(e._sortableColumns=r),"object"==typeof(r=n.initialSort)&&(e._initialSort=r),"object"==typeof(r=n.sortLogic))for(var s in r)"function"==typeof r[s]&&(e._sortLogic[s]=r[s])}}},bt.prototype.getConfigObject=function(t){var e=t||{},i=e.columns;i||(i=e.columns=[]);var o=this._hosts[0];if(!o)return e;var n,r,s,l,a,h=this.getSortedColumns();if(1===this._maxCount&&null!=h)for(s=h.length,r=0;r<s;r++){var u=h[r],p=u.colIndex;(n=i[p])||(n=i[p]={}),n.sortOrder=u.sortOrder}for(s=o.getColumnCount(),r=0;r<s;++r)(n=i[r])||(n=i[r]={}),(l=this._getSortOptions(r))&&(this._sortableColumns?l.disabled&&(n.sortable=!1):l.disabled||(n.sortable=!0),(a=l.field)&&(null!=n.field&&n.field!==a&&(n.sortBy=a),this._sortingSequenceMap&&this._sortingSequenceMap[a]&&(n.sortingSequence=this._sortingSequenceMap[a])));var _=e.sorting;_||(_=e.sorting={});var c=h;null!=c&&(_.initialSort=c),!1!==(c=this._sortableIndicator)&&(_.sortableIndicator=c),1!==this._maxCount&&(_.multiColumn=-1===this._maxCount||this._maxCount),this._dblClickAllowed&&(_.disableDoubleClickToSort=!this._dblClickAllowed),!0!==(c=this._sortableColumns)&&(_.sortableColumns=c),!0!==(c=this._dataSorting)&&(_.indicatorOnly=c),this._disabled&&(_.disabled=!0);var d=this._sortingSequence,g=!0;return 2===d.length&&"a"===d[0]&&"d"===d[1]&&(g=!1),g&&(_.sortingSequence=d.slice()),W(e.sorting)&&delete e.sorting,e},bt.prototype.getColumnMenu=function(t,e){e||(e={});var i=e.menus;i||(i=e.menus=[]);var o=i[0];o||(o=i[0]={menuItems:[]});var n=this.getSortOrder(t),r={indexScore:100,label:"Sort Column",icon:"sort-a-to-z",group:"FREQUENTLY_USED",subMenu:{menuItems:[{indexScore:3,label:"Ascending",radioMode:!0,value:{colIndex:t,order:"a"},selected:"a"===n,click:this._onItemSortingClicked},{indexScore:2,label:"Descending",radioMode:!0,value:{colIndex:t,order:"d"},selected:"d"===n,click:this._onItemSortingClicked},{indexScore:1,label:"Un-Sort",radioMode:!0,value:{colIndex:t,order:"n"},selected:"n"===n,click:this._onItemSortingClicked}]}};return o.menuItems.push(r),e},bt.prototype._onItemSortingClicked=function(t){this._hosts[0].getPlugin("ColumnMenuPlugin").hide();var e=t.currentTarget.value,i=e.colIndex,o=e.sortOrder;this.sortColumn(i,o)},bt.prototype.getIcons=function(){return bt._icons},bt.prototype.setSortLogics=function(t){if(null!=t){var e=this._hosts[0];if(e){var i=e.getDataSource();for(var o in t)this._setSortLogic(i,o,t[o])}}},bt.prototype.setSortLogic=function(t,e){if("string"==typeof t){var i=this._hosts[0];if(i){var o=i.getDataSource();this._setSortLogic(o,t,e)}}},bt.prototype._setSortLogic=function(t,e,i){t&&"string"==typeof e&&("*"===e?t.setSortingLogic(i):t.setColumnSortingLogic(e,i))},bt.prototype.getSortOrder=function(t){var e=null!=t?this.getSortPriority(t):0,i=this._sortStates[e];return(i?i.sortOrder:"")||"n"},bt.prototype.getSortedColumnIndex=function(t){return this._getColumnIndexByOptions(this._sortStates[t||0])},bt.prototype.getSortPriority=function(t){for(var e=this._sortStates.length,i=0;i<e;++i)if(this._sortStates[i]===this._getSortOptions(t))return i;return-1},bt.prototype.isColumnSorted=function(t){return this.getSortPriority(t)>=0},bt.prototype.getSortedColumns=function(){var t=this._sortStates.length;if(t<=0)return null;for(var e=new Array(t),i=0;i<t;++i){var o=this.getSortedColumnIndex(i),n=this._sortStates[i];e[i]={colIndex:o,colId:this._getColumnId(o),field:n.field||"",sortOrder:n.sortOrder||"n"}}return e},bt.prototype.isSorting=function(){return!!this._sortStates.length},bt.prototype.sortColumn=function(t,e,i){var o=this._prepareSorting(t,e);o&&this._sortColumn([o],i)},bt.prototype.sortColumns=function(t,e){if(Array.isArray(t)){for(var i=[],o=0;o<t.length;o++){var n=t[o],r=n.colId||n.field;null==r&&(r=n.colIndex);var s=this._prepareSorting(r,n.sortOrder||n.order);s&&i.push(s)}this._sortColumn(i,e)}},bt.prototype.clearSortState=function(t){this._popSortState(0,t)&&this.updateSortSymbols()},bt.prototype.refresh=function(){this._sortStates.length&&(this._sortDataView(),this.updateSortSymbols())},bt.prototype.restoreUserActions=bt.prototype.refresh,bt.prototype.setSortableColumnCount=function(t){this._maxCount=t||1,this._popSortState(this._maxCount)},bt.prototype.getSortingStates=function(){return this._sortStates},bt.prototype.updateSortSymbols=function(){if(!this._disabled)for(var t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},bt.prototype.getDataColumnMap=function(){var t=this._hosts[0],e=[];if(t)for(var i=t.getColumnCount(),o=0;o<i;++o)e[o]=this.getColumnSortingField(o);return e},bt.prototype.getDataColumnNames=bt.prototype.getDataColumnMap,bt.prototype.setDataColumnMap=function(t){if(Array.isArray(t))for(var e=t.length;--e>=0;)this.setColumnSortingField(e,t[e])},bt.prototype.setDataColumnNames=bt.prototype.setDataColumnMap,bt.prototype.getColumnSortingField=function(t){var e=this._getSortOptions(t),i=e?e.field:null;if(null==i&&!this._rowDefMode){var o=this._hosts[0];o&&(i=o.getDataColumnName(t))&&e&&(e.field=i)}return i||""},bt.prototype.setColumnSortingField=function(t,e,i,o){if("number"==typeof t&&null!=e){var n=this._newSortOptions(t);e||(e=""),n.field!==e&&(n.field=e),null==i||this._userManagedLogic||n.sortLogic!==i&&(n.sortLogic=i||null,o&&i&&(i.rowSorting=!0))}},bt.prototype.getColumnSortingFields=function(){for(var t=this._sortStates.length,e=new Array(t),i=this._hosts[0],o=0;o<t;++o){var n=this._sortStates[o],r=n.field;if(!r&&!this._rowDefMode){var s=this._getColumnIndexByOptions(n);(r=i.getDataColumnName(s))&&(n.field=r)}e[o]=r||""}return e},bt.prototype.setFirstSortOrder=function(t,e){"a"!==(e=e?bt._toSortOrder(e):"a")&&"d"!==e&&(e="a");for(var i,o=(i=Array.isArray(t)?t:[t]).length,n=0;n<o;++n){var r=i[n],s=this.getSortingSequence(r).slice(),l=s.indexOf(e);l>=0&&s.splice(l,1),s.unshift(e),this.setSortingSequence(s,r)}},bt.prototype.disableTwoStateSorting=function(t){var e=this._sortingSequence.indexOf("n");!1===t?e>=0&&this._sortingSequence.splice(e,1):e<0&&this._sortingSequence.push("n")},bt.prototype.freezeIndicator=function(t){var e=this._frozenIndicator;if(this._frozenIndicator=!1!==t,e&&!this._frozenIndicator)for(var i=this._hosts.length;--i>=0;)this._updateSortableIndicator(i)},bt.prototype.disableSortSymbols=function(t){},bt.prototype.disableDataSorting=function(t){this._dataSorting=!1===t},bt.prototype.disableDoubleClickToSort=function(t){this._dblClickAllowed=!t},bt.prototype.disableCellClick=function(t,e){t&&t.enableClass("no-sort",!1!==e)},bt.prototype.disableColumnSorting=function(t,e){if(e=!1!==e,"number"==typeof t)this._disableColumnSorting(t,e);else if(Array.isArray(t))for(var i=t.length,o=0;o<i;++o)this._disableColumnSorting(t[o]||0,e)},bt.prototype._disableColumnSorting=function(t,e){var i=this._newSortOptions(t);i.disabled!==e&&(i.disabled=e)},bt.prototype.setClickDelayInterval=function(t){this._delayInterval=null!=t?t:500},bt.prototype._initialSortByColumnField=function(t){for(var e=t.columns,i=e?e.length:0,o=0;o<i;o++){var n=e[o].defaultSort;if(n)return{colIndex:o,sortOrder:n}}return null},bt.prototype._onSectionAdded=function(t){if("title"===t.sectionType){var e=t.section;0===e.getIndex()&&(e.listen("mousedown",this._onMouseDown),e.listen("click",this._onClickTitle.bind(this,t.sender),0))}},bt.prototype._onUIUpdated=function(t){"title"===t.sectionType&&this.updateSortSymbols()},bt.prototype._canClickToSort=function(t){if(this._disabled)return!1;var e=t.grid;if(!e||!e.getElement())return!1;var i=this._getPlugin("CellEditingPlugin");if(i&&i.isEditing())return!1;if(this._dispatch("preClicked",t),t.cancel)return!1;var o=t.colIndex,n=t.section,r=t.rowIndex;return!!this._isCellSortable(n,o,r)},bt.prototype._proceedSorting=function(t){if(this._clickTimer=0,this._canClickToSort(t)){var e=t.colIndex,i=this._prepareSorting(e);if(i&&this._sortColumn([i],{isUserAction:!0}),this._hasListener("clicked")){var o={};o.colIndex=e,o.sortOrder=this.getSortOrder(e),o.dataColumnName=this.getColumnSortingField(e),this._dispatch("clicked",o)}}},bt.prototype._onMouseDown=function(t){t.button||(this._lastMouseDown=t.timeStamp)},bt.prototype._getPlugin=function(t){var e=this._hosts[0];return e?e.getPlugin(t):null},bt.prototype._onClickTitle=function(t,e){if(!this._disabled)if(2!==e.detail||this._dblClickAllowed){if(!(e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)&&e.timeStamp-this._lastMouseDown<500){var i=t.getRelativePosition(e);if(i.hit){var o=this._getPlugin("ColumnSelectionPlugin");if(o&&o.isEnabled()){var n=i.colIndex;if(!o.isSelectedColumn(n))return}i.target=e.target,this._delayInterval>0?this._clickTimer||(this._clickTimer=setTimeout(this._proceedSorting.bind(this,i),this._delayInterval)):this._proceedSorting(i)}}}else this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0)},bt.prototype._popSortState=function(t,e){if(t<0||this._sortStates.length<=t)return!1;for(var i=!1,o=this._sortStates.length;--o>=t;)this._clearSortSymbols(this._sortStates[o]),i=!0;return this._sortStates.length=t,this._sortDataView(e),i},bt._toSortOrder=function(t){return!t||"string"!=typeof t||"d"!==(t=t.charAt(0).toLowerCase())&&"a"!==t?"n":t},bt.prototype.getSortingSequence=function(t){return this._sortingSequenceMap&&(t||0===t)&&("string"!=typeof t&&(t=this.getColumnSortingField(t)),this._sortingSequenceMap[t])?this._sortingSequenceMap[t]:this._sortingSequence},bt.prototype.setSortingSequence=function(t,e){if(Array.isArray(t))t.length||(t=null);else if(t)return;var i;if(null!=e&&("string"==typeof e?i=e:"number"==typeof e&&(i=this.getColumnSortingField(e))),t){var o=t.map(bt._toSortOrder);i?(this._sortingSequenceMap||(this._sortingSequenceMap={}),this._sortingSequenceMap[i]=o):this._sortingSequence=o}else i?this._sortingSequenceMap&&delete this._sortingSequenceMap[i]:this._sortingSequence=this._sortingSequence.length>2?["a","d","n"]:["a","d"]},bt.prototype.clearAllColumnSortingSequences=function(){this._sortingSequenceMap=null},bt.prototype.sortSeparators=function(t){var e=this._hosts[0].getDataSource();if(t)e.sortSeparators(t);else{for(var i=e.getSortingLogics(),o=[],n=[],r=this._sortStates.length,s=bt._toRowDefField(),l=0;l<r;l++){var a=this._sortStates[l],h=this._rowDefMode?s:a.field;o.push(a.sortOrder),n.push(h)}e.sortSeparators(i,o,n)}},bt.prototype._prepareSorting=function(t,e){if(!this._maxCount)return null;var i=this._getColumnIndex(t),o=this.getSortPriority(i),n=this.getColumnSortingField(i),r=o>=0?this._sortStates[o]:null,s=r?r.sortOrder:"n",l="n";if(null==e){var a=this.getSortingSequence(n),h=a.indexOf(s);l=a[h=h<0?0:(h+1)%a.length]}else l=bt._toSortOrder(e);if(r){if(s===l)return this.updateSortSymbols(),null;this._sortStates.splice(o,1),this._clearSortSymbols(r)}if("a"===l||"d"===l){if(i<0&&!n)return null;r||(r=this._newSortOptions(i)),i<0&&(r.field=n),this._sortStates.push(r)}r&&("n"!==s?r.prevOrder=s:delete r.prevOrder,r.order=l,r.sortOrder=l);var u=[];if(this._maxCount>0)for(;this._sortStates.length>this._maxCount;){var p=this._clearSortSymbols(this._sortStates.shift());null!==p&&u.push(p)}return{colIndex:i,sortedField:n,sortOrder:l||"n",prevOrder:s,clearedSortColIndexes:u}},bt.prototype._sortColumn=function(t,e){this._sortDataView(e),this.updateSortSymbols();var i=t[0]||{},o=t.length;if(o>1){i.colIndices=new Array(o),i.sortedFields=new Array(o),i.sortOrders=new Array(o),i.prevOrders=new Array(o);for(var n=0;n<o;n++){var r=t[n];i.colIndices[n]=r.colIndex,i.sortedFields[n]=r.sortedField,i.sortOrders[n]=r.sortOrder,i.prevOrders[n]=r.prevOrder}}this._dispatch("columnSorted",i)},bt.prototype._onColumnAdded=function(t){var e=this,i=t.colIndex,o=t.context||{},n=!!e._sortableColumns,r=o.field,s=o.sortBy;null!=s&&(n=!!s,r=s),null!=o.sortable&&(n=!!o.sortable);var l=o.sortLogic||o.sortingLogic||o.sorter;l||(l=e._sortLogic[r]),"function"!=typeof l&&(l=null);var a=o.sortingSequence;null!=a&&r&&e.setSortingSequence(a,r),n?e.setColumnSortingField(i,r,l,o.rowSorting):e.disableColumnSorting(i,!0);var h=o.sortOrder||o.sort;null!=h&&"n"!==(h=bt._toSortOrder(h))&&(e.clearSortState(),e.sortColumn(i,h))},bt.prototype._onColumnRemoved=function(t){if(t.atTheMiddle&&this._sortStates.length){var e=t.columnData,i=e?e.sortableTitle:null;if(i&&i.sortOrder){var o=this._sortStates.indexOf(i);o>=0&&this._sortStates.splice(o,1),this._clearSortSymbols(i),this._sortDataView()}}},bt._toRowDefField=function(t){return"ROW_DEF"},bt.prototype._sortDataView=function(t){if(t=t||{},this._dispatch("preDataSorting",t),this._dataSorting){var e=this._sortStates.length;this._userManagedLogic&&e>1&&(e=1);var i=null,o=null,n=null;if(e){i=new Array(e),o=new Array(e);for(var r=0;r<e;++r)i[r]=this._sortStates[r].sortOrder,o[r]=this._sortStates[r].sortLogic;n=this._rowDefMode?this._sortStates.map(bt._toRowDefField):this.getColumnSortingFields(),this._userManagedLogic&&n.length>1&&(n=n.slice(0,1))}for(var s=this._hosts.length;--s>=0;){var l=this._hosts[s].getDataSource();if(l){var a=1==t.isUserAction;l.sort(n,i,o,a)}}}},bt.prototype._clearSortSymbols=function(t){var e=t.targetCells;if(!e)return null;for(var i=null,o=e.length;--o>=0;){var n,r=e[o];r.removeClass("sorting"),r.removeClass("sortable"),r.removeFloatingIcon("sort-symbol"),r.removeFloatingIcon("priority-symbol"),null==i&&(n=r.getSection())&&(i=n.getColumnIndex(r.getParent()))}return e.length=0,i},bt.prototype._updateSortableIndicator=function(t){var e=this,i=e._hosts[t];if(i&&!this._frozenIndicator){var o=i.getSection("title");if(null!=o)for(var n=o.getColumnCount();--n>=0;)for(var r=o.getRowCount(),s=0;s<r;s++){var l=o.getCell(n,s,!0);if(l&&(l.removeClass("sorting"),l.removeClass("sortable"),l.removeClass("asc"),l.removeClass("desc"),l.removeClass("edge-indicator"),l.removeFloatingIcon("sort-symbol"),l.removeFloatingIcon("priority-symbol"),l.removeFloatingIcon("sortable-indicator"),s===r-1&&e._isCellSortable(o,n,s))){l.addClass("sortable");var a,h,u,p=e.getSortPriority(n),_=e._sortStates[p];if(_&&"n"!==_.sortOrder)_.targetCells||(_.targetCells=[]),_.targetCells[t]=l,"a"===_.sortOrder?l.addClass("asc"):l.addClass("desc"),l.addClass("sorting"),e._solarTheme?("a"===_.sortOrder?(u="▲",h=bt._icons.ascending):(u="▼",h=bt._icons.descending),(a=e._createIconElem(h,u)).className="sort-symbol",l.insertFloatingIcon(a,0)):l.addClass("edge-indicator"),e._sortStates.length>1&&((a=document.createElement("span")).className="priority-symbol",a.textContent=p+1,l.insertFloatingIcon(a,1));else e._sortableIndicator&&(h=bt._icons.sortable,(a=e._createIconElem(h,"◊")).className="sortable-indicator",l.insertFloatingIcon(a,0))}}}},bt.prototype._createIconElem=function(t,e){var i;return t&&"string"==typeof t?(i=document.createElement("ef-icon")).setAttribute("icon",t):(i=document.createElement("span")).textContent=e,i},bt.prototype._getColumnIndexByOptions=function(t){if(t)for(var e=this._hosts[0],i=e?e.getColumnCount():0,o=0;o<i;++o){var n=e.getColumnData(o);if(n&&t===n.sortableTitle)return o}return-1},bt.prototype._getColumnIndex=function(t){var e=this._hosts[0];return e&&null!=t?e.getColumnIndex(t):-1},bt.prototype._getColumnId=function(t){var e=this._hosts[0];return e&&null!=t?e.getColumnId(t):""},bt.prototype._getSortOptions=function(t){var e=this._hosts[0];if(e){var i=e.getColumnData(t);if(i)return i.sortableTitle}return null},bt.prototype._newSortOptions=function(t){var e=this._hosts[0],i=null;if(e&&t>=0){var o=e.getColumnData(t);(i=o.sortableTitle)||(i=o.sortableTitle={})}return i||{}},bt.prototype._isCellSortable=function(t,e,i){var o=this._getSortOptions(e);if(o){if(o.disabled)return!1;var n=o.field;if(null!=n&&!n)return!1}var r=t.getCell(e,i,!0);return!r.hasClass("no-sort")&&r===t.getCell(e,t.getRowCount()-1,!0)&&!r.getParent().classList.contains("collapsed")},bt._proto=bt.prototype;const Rt=bt;var It=window.tr;It||(It=window.tr={});var xt=It.grid;xt||(xt=It.grid={}),Object.assign(It,o),It.EventDispatcher=l,It.ElementWrapper=_,It.ElementFrameWork=h,It.ILayoutGrid=C,It.LayoutGrid=N,It.Grid=wt,It.ColumnStats=ot,It.DataCache=U,It.DataTable=et,It.DataView=at,It.SegmentCollection=Z,xt.CellFloatingPanel=d,xt.Cell=f,xt.CellSpan=z,xt.CellSpans=V,xt.Column=w,xt.Scrollbar=k,xt.HScrollbar=G,xt.VScrollbar=ft,xt.VirtualizedLayoutGrid=vt,xt.Conflator=ut,xt.Reverter=F,xt.TrackLayout=m,xt.Virtualizer=dt,xt.SelectionList=P,xt.SectionSettings=_t,xt.SortableTitlePlugin=Rt})();
1
+ (()=>{"use strict";var t,e,i={};i.isIE=(t=window.navigator.userAgent).indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0,i.isTouchDevice=!!(navigator.maxTouchPoints&&navigator.maxTouchPoints<256||navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints<256),i.isSafari=(e=navigator.userAgent,!/Chrome|Android|CriOS|FxiOS|EdgiOS/i.test(e)&&/Safari/i.test(e)),i.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),i.getElement=function(t){return i.isElement(t)?t:t&&i.isFunction(t.getElement)?t.getElement():null},i.isElement=function(t){return!!t&&1===t.nodeType},i.isEmpty=function(t,e){return null==t||void 0===t||!e&&""===t||i.isArray(t)&&0===t.length},i.isNumber=function(t){return"number"==typeof t&&isFinite(t)},i.isString=function(t){return"string"==typeof t},i.isArray=Array.isArray,i.isFunction=function(t){return"function"==typeof t},i.getClientPosition=function(t,e){var i=e||{};if(t.getBoundingClientRect){var o=t.getBoundingClientRect();i.x=o.left,i.y=o.top}else i.x=t.clientX,i.y=t.clientY;return i},i.getRelativePosition=function(t,e,o){o=i.getClientPosition(t,o);var n=i.getClientPosition(e);return o.x-=n.x,o.y-=n.y,o},i.moveArrayItem=function(t,e,i){if(!t)return null;var o=t.length;if(e>=o&&i>=o)return t;var n=t.splice(e,1)[0];return i<o?t.splice(i,0,n):t[i]=n,t},i.pushArrayItems=function(t,e){var i=e?e.length:0;if(i>0)if(i<1e5)i>1?Array.prototype.push.apply(t,e):t.push(e[0]);else for(var o=0,n=0;o<i;)n+=1e5,Array.prototype.push.apply(t,e.slice(o,n)),o=n;return t},i.insertEmptyItems=function(t,e,o){if(o>0)if(o>1){var n=t.slice(e);t.length=e,t.length+=o,i.pushArrayItems(t,n)}else t.splice(e,0,null)},i.cycleArray=function(t,e){if(e>0&&t&&e<t.length){var i=t.splice(0,e);return t.concat(i)}return t||null},i.lowerBound=function(t,e,o,n,r){(null==o||o<0)&&(o=0),(null==n||n<0||n>t.length)&&(n=t.length),o>n&&(o=n),null==r&&(r=i._defaultLessComparator);for(var s=0;n>o;)r(t[s=o+n>>1],e)?o=s+1:n=s;return o},i.upperBound=function(t,e,o,n,r){for(var s=i.lowerBound(t,e,o,n,r);t[s]===e;)++s;return s},i.stringFormat=function(t){var e=Array.prototype.slice.call(arguments,1);return t.replace(/{(\d+)}/g,(function(t,i){return null!=e[i]?e[i]:t}))},i._defaultLessComparator=function(t,e){return t<e},i._deprecatedFunction=function(){console.warn("Calling deprecated method")},i.calculatePercent=function(t,e,i){if(!t&&0!==t||!e&&0!==e||!i&&0!==i)return NaN;if(i===t)return 50;var o=(e-t)/(i-t);return o<0?0:o>1?100:100*o},i.closestElement=function(t,e){for(var i=t;i;){if(i.classList&&i.classList.contains(e))return i;i=i.parentNode||i.host}return null},i._preventDefault=function(t){t.preventDefault(),t.stopPropagation()};const o=i;var n=function(t){this.dispatch=this.dispatch.bind(this),this._listeners=[],this.setSender(t)};n.prototype.listen=function(t,e){if(t&&o.isFunction(t)&&this._listeners.indexOf(t)<0)if(null==e)this._listeners.push(t);else{t._priority=e;var i=o.lowerBound(this._listeners,t,0,this._listeners.length,n.listenerComparer);this._listeners.splice(i,0,t)}},n.prototype.unlisten=function(t){if(t){var e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}},n.prototype.unlistenAll=function(){this._listeners.length=0},n.prototype.getListenerCount=function(){return this._listeners.length},n.prototype.hasListener=function(){return this._listeners.length>0},n.prototype.dispatch=function(t){if(this._enabled&&!(this._listeners.length<=0)){this._dispatching&&window.console.log("WARNING: There is an error in one of your binding methods."),this._dispatching=!0,null==t&&(t={}),null!==this._sender&&(t.sender=this._sender),null!==this._extender&&this._extender(t);for(var e=0;e<this._listeners.length;e++)this._listeners[e](t);null!==this._sender&&(t.sender=null),this._dispatching=!1}},n.prototype.isDispatching=function(){return this._dispatching},n.prototype.isEnabled=function(){return this._enabled},n.prototype.enable=function(t){this._enabled=!1!==t},n.prototype.disable=function(t){this._enabled=!1===t},n.prototype.setSender=function(t){this._sender=t||null},n.prototype.setEventArgExtender=function(t){this._extender=null!=t?t:null},n.listenerComparer=function(t,e){return null==e._priority||t._priority>=e._priority},n.prototype._listeners=null,n.prototype._sender=null,n.prototype._extender=null,n.prototype._enabled=!0,n.prototype._dispatching=!1,n._proto=n.prototype;const r=n;var s=function(){};s.prototype._customEvents=null,s.prototype.listen=function(t,e,i){this._customEvents&&this._customEvents[t]&&this._customEvents[t].listen(e,i)},s.prototype.unlisten=function(t,e){this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlisten(e)},s.prototype.unlistenAll=function(t){if(t)this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(var e in this._customEvents)this._customEvents[e].unlistenAll()},s.prototype._addEvent=function(t){t&&(this._customEvents||(this._customEvents={}),this._customEvents[t]||(this._customEvents[t]=new r(this)))},s.prototype._addEvents=function(t){for(var e=Array.isArray(t)?t:arguments,i=e.length,o=0;o<i;++o)this._addEvent(e[o])},s.prototype._isEventDispatching=function(t){var e=this._customEvents[t];return!!e&&e.isDispatching()},s.prototype._disableEvent=function(t,e){var i=this._customEvents[t];i&&i.disable(e)},s.prototype._hasListener=function(t){return!(!this._customEvents||!this._customEvents[t])&&this._customEvents[t].hasListener()},s.prototype._dispatch=function(t,e){this._customEvents[t].dispatch(e)},s._proto=s.prototype;const l=s;var a={_isElfv3:!1,setElfv3:function(){a._isElfv3=!0},isElfv3:function(){return a._isElfv3},createIcon:function(t){var e;return a._isElfv3?(e=document.createElement("ef-icon")).setAttribute("icon",t):(e=document.createElement("span")).classList.add("icon-"+t),e},createIconButton:function(t){var e;return a._isElfv3?(e=document.createElement("ef-button")).setAttribute("icon",t):(e=document.createElement("button")).classList.add("icon-"+t),e},createRangeBar:function(){var t,e=document.createElement("div");return a._isElfv3?(e.className="tr-range-bar-wrapper",(t=document.createElement("ef-led-gauge")).setAttribute("neutral-color",""),t.setAttribute("top-value","0.00")):(e.className="tr-range-bar-scale",(t=document.createElement("div")).className="tr-range-bar-slider"),t.classList.add("tr-range-slider"),e.appendChild(t),e._calculateScaleParams=function(t,e,i){var n,r=null;return t===i?{sliderValue:n=e===i?0:e>i?100:-100,rangeValue:"[-100,100]"}:t===e?{sliderValue:-100,rangeValue:r}:e===i?{sliderValue:100,rangeValue:r}:t>i?(e>t?(n=-100,r="[-100,"+(2*o.calculatePercent(i,e-t,t)-100)+"]"):e<i?(n=100,r="["+(2*o.calculatePercent(i,t-e,t)-100)+",100]"):n=2*o.calculatePercent(i,e,t)-100,{sliderValue:n,rangeValue:r}):e>i?{sliderValue:100,rangeValue:"["+(2*o.calculatePercent(t,2*i-e,i)-100)+",100]"}:e<t?{sliderValue:-100,rangeValue:"[-100,"+(2*o.calculatePercent(t,2*t-e,i)-100)+"]"}:{sliderValue:2*o.calculatePercent(t,e,i)-100,rangeValue:r}},e._getSliderInstance=function(){return t},e.updateScale=function(t,i,o,n){var r,s=e._getSliderInstance();a._isElfv3?(r=e._calculateScaleParams(i,o,n),s.setAttribute("top-value",r.sliderValue.toString()),r.rangeValue?s.setAttribute("range",r.rangeValue):s.removeAttribute("range")):s.style.left=t+"%"},e.setSliderWidth=function(t){var i=t>0?t:1;a._isElfv3||(e.style.width="calc(100% - "+i+"px)",e._getSliderInstance().style.width=i+"px")},e}};const h=a;const u={inherits:function(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.base=function(t,i,o){i||(i="constructor");for(var n=arguments.length,r=new Array(n),s=2;s<n;s++)r[s-2]=arguments[s];return e.prototype[i].apply(t,r)}}};var p=function(t){this._element=t||document.createElement("div")};u.inherits(p,l),p.prototype._element=null,p.prototype._content=null,p.prototype._textSpan=null,p.prototype._nativeEvents=null,p._passiveEvents=null,p.prototype.getContent=function(t){return t?this._element.children:this._element.lastChild},p.prototype.setContent=function(t,e){if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?(o.isString(t)||(t+=""),null==this._textSpan&&(this._textSpan=document.createElement("span")),this._textSpan.textContent=t,t=this._textSpan):t=t.getElement()),t!==this._content){for(this._content=t;null!==this._element.firstChild;)this._element.removeChild(this._element.firstChild);null!==this._content&&this._element.appendChild(this._content)}return e&&t&&t.setAttribute("title",e),this._content},p.prototype.addContent=function(t){return null==(t=o.getElement(t))?null:(this._content=this._element.children,this._element.appendChild(t),t)},p.prototype.removeContent=function(t){return null!=(t=o.getElement(t))&&(this._content=this._element.children,this._element.removeChild(t),!0)},p.prototype.listen=function(t,e,i){if(this._customEvents&&this._customEvents[t])this._customEvents[t].listen(e,i);else{this._nativeEvents||(this._nativeEvents={});var o=this._nativeEvents[t];if(!o){if(o=new r,this._nativeEvents[t]=o,o.dispatch=o.dispatch.bind(o),!p._passiveEvents){var n=!1;try{var s=Object.defineProperty({},"passive",{get:function(){return n=!0,!1}});window.addEventListener("testPassive",null,s),window.removeEventListener("testPassive",null,s)}catch(t){}if(n){var l={passive:!0};p._passiveEvents={touchstart:l,touchmove:l}}else p._passiveEvents={}}this._element.addEventListener(t,o.dispatch,p._passiveEvents[t]||!1)}o.listen(e,i)}},p.prototype.unlisten=function(t,e){if(this._customEvents&&this._customEvents[t])this._customEvents[t].unlisten(e);else if(this._nativeEvents){var i=this._nativeEvents[t];i&&i.unlisten(e)}},p.prototype.unlistenAll=function(t){if(this._customEvents)if(t)this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(var e in this._customEvents)this._customEvents[e].unlistenAll();if(this._nativeEvents)if(t)this._nativeEvents[t]&&(this._unlistenAll(t),delete this._nativeEvents[t]);else{for(var i in this._nativeEvents)this._unlistenAll(i);this._nativeEvents=null}},p.prototype._unlistenAll=function(t){var e=this._nativeEvents[t];this._element.removeEventListener(t,e.dispatch,!1),e.unlistenAll()},p.prototype.dispose=function(){this._dispose()},p.prototype._dispose=function(){this.setParent(null),this.unlistenAll(),this._element=this._content=this._textSpan=null,this._customEvents=this._nativeEvents=null},p.prototype.setEventArgExtender=function(t,e){if(this._customEvents){var i=this._customEvents[t];i&&i.setEventArgExtender(e)}},p.prototype.getElement=function(){return this._element},p.prototype.getNextSibling=function(){return this._element.nextSibling},p.prototype.getParent=function(){return this._element.parentNode},p.prototype.setParent=function(t,e){this._setParent(t,e)},p.prototype._setParent=function(t,e){null!==(t=o.getElement(t))?e?t.insertBefore(this._element,t.firstChild):t.appendChild(this._element):null!==this._element.parentNode&&this._element.parentNode.removeChild(this._element)},p.prototype.insertBefore=function(t){this._insertBefore(t)},p.prototype._insertBefore=function(t){if(null!=(t=o.getElement(t))){var e=t.parentNode;null!=e&&e.insertBefore(this._element,t)}else this.setParent(this.getParent())},p.prototype.insertAfter=function(t){(t=o.getElement(t))?t.nextSibling?this.insertBefore(t.nextSibling):this.setParent(t.parentNode):this.setParent(this.getParent(),!0)},p.prototype.hasClass=function(t){return!!this._element&&this._element.classList.contains(t)},p.prototype.addClass=function(t){this._element&&this._element.classList.add(t)},p.prototype.removeClass=function(t){this._element&&this._element.classList.remove(t)},p.prototype.toggleClass=function(t,e){var i=this._element;i&&(null==e&&(e=!i.classList.contains(t)),e?i.classList.add(t):i.classList.remove(t))},p.prototype.enableClass=function(t,e){!1!==e?this.addClass(t):this.removeClass(t)},p.prototype.getClass=function(){return this._element.className},p.prototype.setClass=function(t){this._element.className=t},p.prototype.getAttribute=function(t){return this._element.getAttribute(t)},p.prototype.setAttribute=function(t,e){this._element.setAttribute(t,e)},p.prototype.setAttributes=function(t){for(var e in t)this._element.setAttribute(e,t[e])},p.prototype.removeAttribute=function(t){this._element.removeAttribute(t)},p.prototype.getStyle=function(t){return this._element.style[t]},p.prototype.setStyle=function(t,e){this._element.style[t]=e},p.prototype.setStyles=function(t){var e=this._element.style;for(var i in t)e[i]=t[i]},p.prototype.getId=function(){return this._element.id},p.prototype.setId=function(t){this._element.id=t},p.prototype.toString=function(){var t=this._element.outerHTML;return t.replace(this._element.innerHTML,"")},p.prototype.getTextContent=function(){return this._element.textContent},p.prototype.setTextContent=function(t){this._element.textContent=t},p.prototype.getLeft=function(){return this._element.offsetLeft},p.prototype.setLeft=function(t){return this._element.style.left=t+"px",!0},p.prototype.getTop=function(){return this._element.offsetTop},p.prototype.setTop=function(t){return this._element.style.top=t+"px",!0},p.prototype.getWidth=function(){return this._element.offsetWidth},p.prototype.setWidth=function(t){return this._element.style.width=t+"px",!0},p.prototype.getHeight=function(){return this._element.offsetHeight},p.prototype.setHeight=function(t){return t<0&&(t=0),this._element.style.height=t+"px",!0},p.prototype.getBoundingClientRect=function(){return this._element.getBoundingClientRect()},p.prototype.fillParentWidth=function(t){return null==t&&(t=100),this._element.style.width=t+"%",!0},p.prototype.fillParentHeight=function(t){return null==t&&(t=100),this._element.style.height=t+"%",!0},p.prototype.getTooltip=function(){return this.getAttribute("title")},p.prototype.setTooltip=function(t){t?this.setAttribute("title",t):this.removeAttribute("title")},p.prototype.show=function(t){this._element.style.display=!1!==t?"":"none"},p.prototype.hide=function(t){this.show(!1===t)},p.prototype.isVisible=function(){return"none"!==this._element.style.display},p.prototype.enable=function(t){(t=!1!==t)?this.removeAttribute("disabled"):(this.setAttribute("disabled","disabled"),this._element.disabled=!t)},p.prototype.disable=function(t){this.enable(!1===t)},p.prototype.isEnabled=function(){return!this._element.hasAttribute("disabled")},p.prototype.getScrollLeft=function(){return this._element.scrollLeft},p.prototype.getScrollTop=function(){return this._element.scrollTop},p.prototype.isEndOfHorizontalScroll=function(){return this._element.scrollLeft>=this._element.scrollWidth-this.getWidth()},p.prototype.isEndOfVerticalScroll=function(){return this._element.scrollTop>=this._element.scrollHeight-this.getHeight()},p._proto=p.prototype;const _=p;var c=function(){this._items=[],this._element=null};u.inherits(c,_),c.prototype._items=[],c.prototype.hasItem=function(){return!!this._items.length},c.prototype.containItem=function(t){return this._items.indexOf(t)>-1},c.prototype.insertItem=function(t,e){var i=this._items;i.indexOf(t)>-1||(i.push(t),e&&(t._order=e),i.length&&i.sort(c._iconComparer),this._updatePanelItems())},c.prototype.removeItem=function(t){var e=this._items,i=-1;if(t)for(var o=e.length;--o>=0;){var n=e[o];if("string"==typeof t){if(n.classList.contains(t)){i=o;break}}else if(n===t){i=o;break}}else i=e.length-1;var r=null;return i>-1&&(r=e.splice(i,1)[0]),this._updatePanelItems(),r},c.prototype.clearItems=function(){var t=this._items;t.length&&(t.length=0,this._updatePanelItems())},c._iconComparer=function(t,e){return t._order?e._order?t._order-e._order:1:e._order?-1:0},c.prototype._updatePanelItems=function(){var t=this._items,e=this._element;if(t.length){for(this._element||(e=this._element=document.createElement("div"));e.lastChild;)e.removeChild(e.lastChild);for(var i=0;i<t.length;i++)e.appendChild(t[i])}};const d=c;var g=function(t,e){this._id=g._runningId++,this._element=document.createElement("div"),this._element.className="cell",e&&(this._section=e)};u.inherits(g,_),g.prototype._aligner=null,g._runningId=0,g.prototype._id=0,g.prototype._width=-1,g.prototype._height=-1,g.prototype._visible=!0,g.prototype._rawContent,g.prototype._section=null,g.prototype._contentLocked=!1,g.prototype._collapsedState=0,g.prototype._floatingPanel=null,g.prototype._frontIcon=null,g.prototype.getContent=function(t){return t&&this._element?this._element.children:this._content||null},g.prototype.setContent=function(t,e){if(this._contentLocked)return null;if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?"string"!=typeof t&&(t+=""):t=t.getElement()),this._aligner){var i=this._aligner.firstChild;i!==this._content&&(this._rawContent=i,this._content=i)}var o=this._setRawContent(t);return null!=e&&this._content&&this._content.setAttribute("title",e),o},g.prototype.setTextContent=function(t){null==t&&(t=""),this._rawContent!==t&&("string"==typeof this._rawContent?(this._rawContent=t,this._textSpan.textContent=t):null!=this._rawContent||this._textSpan?this.setContent(t):(this.initialize(),this._rawContent=t,this._textSpan=document.createElement("span"),this._textSpan.className="text",this._textSpan.textContent=t,this._content=this._textSpan,this._aligner.className="valigner",this._aligner.appendChild(this._textSpan)))},g.prototype.dispose=function(){this.removeParent(),this.unlistenAll(),this._element=this._section=this._aligner=null,this._textSpan=this._rawContent=this._content=null,this._frontIcon=this._floatingPanel=null},g.prototype.getNextSibling=function(){return null!==this._element?this._element.nextSibling:null},g.prototype.getParent=function(){return null!==this._element?this._element.parentNode:null},g.prototype.setParent=function(t,e){var i=o.getElement(t);if(i){if(this.initialize(),1===this._collapsedState)return;var n;!0===e&&(n=i.firstChild),n?i.insertBefore(this._element,n):i.appendChild(this._element)}else this.removeParent()},g.prototype.removeParent=function(){var t=this._element;t&&t.parentNode&&t.parentNode.removeChild(t)},g.prototype.insertBefore=function(t){var e=o.getElement(t);if(null!=e){var i=e.parentNode;null!=i&&(this.initialize(),i.insertBefore(this._element,e))}else this.setParent(this.getParent())},g.prototype.getTextContent=function(){return this._rawContent?"string"==typeof this._rawContent?this._rawContent:this._rawContent.textContent:""},g.prototype.getTextElement=function(){return this._textSpan},g.prototype.getWidth=function(){return this._width>=0?this._width:this._element.offsetWidth},g.prototype.setWidth=function(t){return t<0&&(t=-1),this._width!==t&&(this._width=t,this._element.style.width=t>=0?t+"px":"",this._updateDisplay(),!0)},g.prototype.getHeight=function(){return this._height>=0?this._height:this._element.offsetHeight},g.prototype.setHeight=function(t){return t<0&&(t=-1),this._height!==t&&(this._height=t,this._element.style.height=t>=0?t+"px":"",this._updateDisplay(),!0)},g.prototype.fillParentWidth=function(t){return!1},g.prototype.fillParentHeight=function(t){return!1},g.prototype.show=function(t){var e=!1!==t;e!==this._visible&&(this._visible=e,this._updateDisplay())},g.prototype.isVisible=function(){return this._visible},g.prototype.getScrollLeft=function(){return 0},g.prototype.getScrollTop=function(){return 0},g.prototype.isEndOfHorizontalScroll=function(){return!0},g.prototype.isEndOfVerticalScroll=function(){return!0},g.prototype.hasElement=function(){return null!==this._element},g.prototype.getSection=function(){return this._section},g.prototype.initialize=function(){return null==this._aligner&&(o.isIE?this._aligner=document.createElement("div"):this._aligner=document.createElement("button"),this._aligner.className="valigner",this._frontIcon&&this._element.appendChild(this._frontIcon.getElement()),this._element.appendChild(this._aligner),this._floatingPanel&&this._element.appendChild(this._floatingPanel.getElement())),this._element},g.prototype.updateIcon=function(t){if(t){var e=this._frontIcon;if(e){if(e.containItem(t))return;e.clearItems()}this.insertFrontIcon(t,0)}},g.prototype.removeIcon=function(){var t=this._frontIcon;t&&(t.clearItems(),this._element.removeChild(t.getElement()),t=this._frontIcon=null)},g.prototype.isFrozen=o._deprecatedFunction,g.prototype.freezeLayout=o._deprecatedFunction,g.prototype.setAutoContentClipping=o._deprecatedFunction,g.prototype.setContentTooltip=function(t){return!(null==t||!this._content||(this._content.setAttribute("title",t),0))},g.prototype.lockContent=function(t){this._contentLocked=!1!==t},g.prototype.reset=function(){if(this._element){var t=this._element.style.width,e=this._element.style.height;this.removeAttribute("style"),t&&(this._element.style.width=t),e&&(this._element.style.height=e),this.resetClass();var i=this.blinkState;i&&(i.timerId>=0&&clearInterval(i.timerId),delete this.blinkState),delete this.trendState;var o=this.blinking;o&&(o.blinking>=0&&clearTimeout(o.blinking),o.cell=null,o.styles=null,delete this.blinking),this.removeIcon(),this.setContent(null),this._textSpan&&(this._textSpan.className="text",this._textSpan.textContent="")}},g.prototype.resetClass=function(){var t="cell";this.hasClass("spanned")&&(t+=" spanned"),this.hasClass("selected-row")&&(t+=" selected-row"),this.hasClass("highlighted-row")&&(t+=" highlighted-row"),this.setClass(t)},g.prototype.resetToInitialState=function(){this._element&&(this.setParent(null),this.unlistenAll(),this._element.className="cell",this.removeIcon(),this.setContent(null),this._contentLocked=!1,this._collapsedState=0)},g.prototype.insertFloatingIcon=function(t,e){if(t){var i=this._floatingPanel;i||(i=this._floatingPanel=new d),i.insertItem(t,e),i.addClass("floating-panel");var o=this._element;o.contains(i.getElement())||o.appendChild(i.getElement())}},g.prototype.removeFloatingIcon=function(t){var e=this._floatingPanel;if(!e)return null;var i=e.removeItem(t);return e.hasItem()||(this._element.removeChild(e.getElement()),this._floatingPanel=null),i},g.prototype.insertFrontIcon=function(t,e){if(t){var i=this._frontIcon;i||(i=this._frontIcon=new d),i.insertItem(t,e),i.addClass("front-panel");var o=this._element;o.contains(i.getElement())||o.insertBefore(i.getElement(),o.firstChild)}},g.prototype.removeFrontIcon=function(t){var e=this._frontIcon;if(!e)return null;var i=e.removeItem(t);return e.hasItem()||(i=e.getElement(),this._element.removeChild(i),this._frontIcon=null),i},g.prototype.getCellId=function(){return this._id},g.prototype.updatePadding=function(){},g.prototype.collapse=function(t,e){var i,o=!1!==t;return i=o?e?2:1:0,this._collapsedState!==i&&(o?e?this.addClass("spanned"):this.setParent(null):2===this._collapsedState&&this.removeClass("spanned"),this._collapsedState=i,!0)},g.prototype.isCollapsed=function(){return 0!==this._collapsedState},g.prototype.isKeptInDoc=function(){return 1!==this._collapsedState},g.prototype.getClientWidth=function(){return this._element?this._element.clientWidth:this.getWidth()},g.prototype.getClientHeight=function(){return this._element?this._element.clientHeight:this.getHeight()},g.prototype._setRawContent=function(t){if(this._rawContent!==t){this._rawContent=t;var e=this._rawContent;if("string"==typeof this._rawContent&&(this._textSpan||(this._textSpan=document.createElement("span"),this._textSpan.className="text"),this._textSpan.textContent=this._rawContent,e=this._textSpan),this._content!==e){this._content=e,this.initialize();for(var i=this._aligner;i.lastChild;)i.removeChild(i.lastChild);this._content&&i.appendChild(this._content)}}return this._content},g.prototype._updateDisplay=function(){var t=!1;this.isVisible()&&this._width&&this._height&&(t=!0),this._element.style.display=t?"":"none"},g._proto=g.prototype;const f=g;var y=function(){this._ends=[],this._cols=[]};y.prototype._laneCount=0,y.prototype._defaultSize=10,y.prototype._defaultScalability=!0,y.prototype._homogeneous=!0,y.prototype._visibility=!0,y.prototype._ends,y.prototype._cols,y.prototype._bits=[1,2,4,8],y.prototype.hitTest=function(t){if(t<0)return-1;if(t>=this.getTrackSize())return~this._laneCount;var e=-1,i=0;if(this._homogeneous){var n=this._defaultSize;i=((e=Math.floor(t/n))+1)*n}else e=o.upperBound(this._ends,t),i=this._ends[e];return(e>=this._laneCount||t>=i)&&(e=~e),e},y.prototype.dispose=function(){this._cols=this._ends=null},y.prototype.isAtDefaultSize=function(t){if(this._homogeneous)return!0;if(null!=t){if(!this._isAtDefaultSize(t))return!1}else{for(var e=this._cols.length;--e>=0;)if(!this._isAtDefaultSize(e))return!1;this._homogeneous=!0}return!0},y.prototype._isAtDefaultSize=function(t){var e=this._cols[t];if(e){if(e.actualSize!==this._defaultSize)return!1;if(null!=e.customSize)return!1;if(e.invisibility)return!1}return!0},y.prototype.isHomogeneous=function(){return this._homogeneous},y.prototype.isAtMinimumSize=function(t){var e=this._getMinimumScalingSize(t);return(null!=t?this.getLaneSize(t):this.getTrackSize())<=e},y.prototype.isFixedSize=function(){for(var t=0;t<this._laneCount;++t)if(this.getLaneScalability(t))return!1;return!0},y.prototype.clearLaneCustomizations=function(){this._ends.length=0,this._cols.length=0,this._homogeneous=!0},y.prototype.getLaneCount=function(){return this._laneCount},y.prototype.setLaneCount=function(t){t<0&&(t=0),t!==this._laneCount&&(this._markDirtyIndex(t),this._cols.length=t,this._laneCount=t,0===t&&(this._homogeneous=!0))},y.prototype.getDefaultLaneSize=function(){return this._defaultSize},y.prototype.setDefaultLaneSize=function(t){return t<0&&(t=0),this._defaultSize!==t&&(this._defaultSize=t,this._markDirtyIndex(0),!0)},y.prototype.getLaneDefaultSize=function(t){if(t<0||t>=this._laneCount)return-1;var e=this._newColumn(t);return e.defaultSize?e.defaultSize:-1},y.prototype.setLaneDefaultSize=function(t,e){t<0||t>=this._laneCount||e>=0&&(this._newColumn(t).defaultSize=e)},y.prototype.resetLaneToDefaultSize=function(){for(var t=!1,e=0;e<this._laneCount;++e){var i=this._cols[e];i&&(i.invisibility||(null!=i.defaultSize?(t|=this.setLaneScalability(e,!1),t|=this.setLaneSize(e,i.defaultSize)):(t|=this.setLaneScalability(e,!0),t|=this.setLaneSize(e,1))))}return!!t},y.prototype.getDefaultScalability=function(){return this._defaultScalability},y.prototype.setDefaultScalability=function(t){return this._defaultScalability!==t&&(this._defaultScalability=t,!0)},y.prototype.getTrackSize=function(){return!this._visibility||this._laneCount<=0?0:this._homogeneous?this._laneCount*this._defaultSize:(this._updateEndPoints(),this._ends[this._laneCount-1])},y.prototype.setTrackSize=function(t){var e=0,i=0,o=[];for(e=0;e<this._laneCount;++e){var n=this._cols[e];n?n.invisibility||(!1!==this._getLaneScalability(n)?o.push(e):i+=this._getFixedSize(n)):o.push(e)}if(o.length<=0)return null;var r=this._distributeLaneSize(t-i,o),s=!1,l=[];for(e=r.length;--e>=0;){l[e]=0;var a=r[e];if(null!=a){var h=this.getLaneSize(e);this._newColumn(e),this._setCalculatedLaneSize(e,a)&&(l[e]=a-h,s=!0)}}return s?l:null},y.prototype.getLaneStart=function(t){if(t<=0)return 0;if(this._homogeneous)return t*this._defaultSize;this._updateEndPoints();var e=t-this._laneCount,i=0;return e>0&&(t-=e,i=e*this._defaultSize),this._ends[t-1]+i},y.prototype.getLaneEnd=function(t){return this._laneCount<=0?NaN:(t<0?t=0:t>=this._laneCount&&(t=this._laneCount-1),this._homogeneous?(t+1)*this._defaultSize:(this._updateEndPoints(),this._ends[t]))},y.prototype.getLaneSize=function(t){if(this._visibility){var e=this._cols[t];return e?e.actualSize:this._defaultSize}return 0},y.prototype.getCustomLaneSize=function(t){var e=this._cols[t];return e&&null!=e.customSize?e.customSize:this._defaultSize},y.prototype.setLaneSize=function(t,e){if(t<0||t>=this._laneCount)return!1;if(e<0||e!=e)return!1;var i=this._cols[t];return(null==i||i.customSize!==e)&&((i=this._newColumn(t)).customSize=e,this._setCalculatedLaneSize(t,e))},y.prototype.setLaneProperty=function(t,e,i){if(t<0||t>=this._laneCount)return!1;var o=this._cols[t];return(null==o||o[e]!==i)&&((o=this._newColumn(t))[e]=i,!0)},y.prototype.getLaneProperty=function(t,e){var i=this._cols[t];return i&&null!=i[e]?i[e]:null},y.prototype.getMinimumLaneSize=function(t){var e=this._cols[t];return e&&null!=e.minSize?e.minSize:0},y.prototype.setMinimumLaneSize=function(t,e,i){if(t<0||t>=this._laneCount)return!1;if(e<0&&(e=0),this.getMinimumLaneSize(t)!==e){var o=this._newColumn(t);return o.minSize=e,i&&this.getLaneScalability(t)&&(o.customSize=e),this._setCalculatedLaneSize(t)}return!1},y.prototype.isLaneVisible=function(t){var e=this._cols[t];return!e||!e.invisibility},y.prototype.showLane=function(t,e){return this.hideLane(t,!1===e)},y.prototype.hideLane=function(t,e,i){if(t<0||t>=this._laneCount)return!1;var o=this._newColumn(t),n=!o.invisibility,r=null!=i?this._bits[i]:1;return!1!==e?o.invisibility|=r:o.invisibility&=~r,n!==!o.invisibility&&this._setCalculatedLaneSize(t)},y.prototype.getLaneVisibilityBit=function(t,e){if(t>=0&&t<this._laneCount){var i=this._cols[t];if(i){var o=null!=e?this._bits[e]:1;if(i.invisibility&o)return!1}}return!0},y.prototype.show=function(t){if(t=!1!==t,this._visibility!==t)if(this._visibility=t,t)for(var e=0;e<this._laneCount;++e)this._newColumn(e),this._setCalculatedLaneSize(e);else this._markDirtyIndex(0)},y.prototype.getLaneScalability=function(t){var e=this._cols[t];return e&&null!=e.scalability?e.scalability:this._defaultScalability},y.prototype.setLaneScalability=function(t,e){if(t<0||t>=this._laneCount)return!1;var i=this._cols[t];return!(i&&i.scalability===e||((i=this._newColumn(t)).scalability=e,0))},y.prototype.removeLaneAt=function(t,e){if(null==e&&(e=1),t<0)return null;if(t+e>this._laneCount&&(e=this._laneCount-t),e<1)return null;this._markDirtyIndex(t);var i=this.serializeLane(t);return this._cols.splice(t,e),this._laneCount-=e,i},y.prototype.insertLane=function(t,e){t<0&&(t=0);var i=1;if(o.isNumber(e)){if(e<=0)return;i=e,e=null}if(t>=this._laneCount&&(t=this._laneCount,!e))this.setLaneCount(this._laneCount+i);else if(this._laneCount+=i,this._markDirtyIndex(t),o.insertEmptyItems(this._cols,t,i),e)for(var n=t+i,r=t;r<n;++r)this.deserializeLane(r,e)},y.prototype.moveLane=function(t,e){if(t<0?t=0:t>this._laneCount&&(t=this._laneCount),e<0?e=0:e>this._laneCount&&(e=this._laneCount),t!==e){var i=t<e?t:e;this._markDirtyIndex(i),o.moveArrayItem(this._cols,t,e)}},y.prototype.serializeLane=function(t){if(t<0||t>=this._laneCount)return null;var e={};e.index=t;var i=this._cols[t];return i?(e.size=i.customSize,e.minSize=i.minSize,e.visible=!i.invisibility,e.scalable=i.scalability,e):e},y.prototype.deserializeLane=function(t,e){if(e&&!(t<0||t>=this._laneCount)){var i=e.size;null!=i&&this.setLaneSize(t,i),null!=(i=e.minSize)&&this.setMinimumLaneSize(t,i),null!=(i=e.visible)&&this.showLane(t,i),null!=(i=e.scalable)&&this.setLaneScalability(t,i)}},y.prototype._updateEndPoints=function(){var t=this._ends.length;if(!(t>=this._laneCount)){this._ends.length=this._laneCount;var e=0,i=t>0?this._ends[t-1]:0;for(e=t;e<this._laneCount;++e)i+=this.getLaneSize(e),this._ends[e]=i}},y.prototype._setCalculatedLaneSize=function(t,e){var i=this._cols[t];if(this._visibility&&!i.invisibility){if(null==e&&(e=null!=i.customSize?i.customSize:this._defaultSize),!i.scalability){var o=null!=i.minSize?i.minSize:0;e<o&&(e=o)}}else e=0;return i.actualSize!==e&&(i.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(t),!0)},y.prototype._getMinimumScalingSize=function(t){var e=0;if(null!=t){var i=this._cols[t];if(!i.invisibility&&null!=i.minSize)return!1===this._getLaneScalability(i)&&null!=i.customSize&&i.customSize>i.minSize?i.customSize:i.minSize}else for(var o=this._laneCount;--o>=0;)e+=this._getMinimumScalingSize(o);return e},y.prototype._getFixedSize=function(t){return null!=t.customSize?null!=t.minSize?t.customSize>t.minSize?t.customSize:t.minSize:t.customSize:null!=t.minSize?t.minSize:this._defaultSize},y.prototype._getLaneScalability=function(t){return null==t.scalability?this._defaultScalability:t.scalability},y.prototype._distributeLaneSize=function(t,e){if(e.length<=0)return[];t<0&&(t=0);var i=0,o=0,n=0,r=0,s=[],l=[],a=[];for(i=e.length;--i>=0;)s[n=e[i]]=this.getMinimumLaneSize(n),l[n]=this.getCustomLaneSize(n),o+=l[n];for(var h=!0;h;)for(h=!1,i=e.length;--i>=0;){var u=s[n=e[i]],p=l[n];(r=t*p/o)<=u&&(h=!0,a[n]=u,t-=u,o-=p,e.splice(i,1))}var _=e.length-1,c=0,d=0;for(i=_;--i>=0;){r=t*l[n=e[i]]/o;var g=Math.floor(r);(d+=r-g)>=1&&(++g,--d),a[n]=g,c+=g}return a[e[_]]=Math.floor(t-c),a},y.prototype._markDirtyIndex=function(t){t<this._ends.length&&(this._ends.length=t)},y.prototype._newColumn=function(t){var e=this._cols[t];return e||(this._cols[t]=e={},e.invisibility=0),e},y.prototype.copyFrom=function(t,e){if(!this._homogeneous||!t._homogeneous||this._defaultSize!==t._defaultSize){e||(e=0);var i=t.getLaneCount(),o=this.getLaneCount(),n=e+i;n>o&&(n=o);for(var r=0,s=e;s<n;++s){var l=t.getLaneSize(r++),a=this._newColumn(s);a.customSize!==l&&(a.customSize=l,a.actualSize!==l&&(a.actualSize=l,this._homogeneous=!1,this._markDirtyIndex(s)))}}};const m=y;var v=function(){};v.prototype.hitTest=function(t,e,i){},v.prototype.hitTestX=function(t){},v.prototype.hitTestY=function(t){},v.prototype.getDefaultColumnWidth=function(){},v.prototype.setDefaultColumnWidth=function(t){},v.prototype.getDefaultRowHeight=function(){},v.prototype.setDefaultRowHeight=function(t){},v.prototype.getColumnWidth=function(t){},v.prototype.setColumnWidth=function(t,e){},v.prototype.getRowHeight=function(t){},v.prototype.setRowHeight=function(t,e){},v.prototype.isColumnVisible=function(t){},v.prototype.hideColumn=function(t,e){},v.prototype.isRowVisible=function(t){},v.prototype.hideRow=function(t,e){},v.prototype.getMinimumColumnWidth=function(t){},v.prototype.setMinimumColumnWidth=function(t,e){},v.prototype.getMinimumRowHeight=function(t){},v.prototype.setMinimumRowHeight=function(t,e){},v.prototype.getCellLeft=function(t){},v.prototype.getCellTop=function(t){},v.prototype.getCellWidth=function(t,e){},v.prototype.getCellHeight=function(t,e){},v.prototype.hasCellSpan=function(){},v.prototype.getCellRowSpan=function(t,e){},v.prototype.setCellRowSpan=function(t,e,i){},v.prototype.getCellColSpan=function(t,e){},v.prototype.setCellColSpan=function(t,e,i){},v.prototype.clearCellSpans=function(){},v.prototype.clearColumnSpans=function(t){},v.prototype.clearColumnCustomizations=function(){},v.prototype.clearRowCustomizations=function(){},v.prototype.getColumnScalability=function(t){},v.prototype.setColumnScalability=function(t,e){},v.prototype.getRowScalability=function(t){},v.prototype.setRowScalability=function(t,e){},v.prototype.getCell=function(t,e,i){},v.prototype.getCellContent=function(t,e){},v.prototype.setCellContent=function(t,e,i){},v.prototype.getColumn=function(t){},v.prototype.getColumnCount=function(){},v.prototype.setColumnCount=function(t){},v.prototype.getRowCount=function(){},v.prototype.setRowCount=function(t,e){},v.prototype.getVisibleRowCount=function(){},v.prototype.addRow=function(t){},v.prototype.removeRow=function(t){},v.prototype.setBorders=function(t,e,i,o){},v.prototype.getColumnStyle=function(t,e){},v.prototype.setColumnStyle=function(t,e,i){},v.prototype.enableColumnClass=function(t,e,i){},v.prototype.hasColumnClass=function(t,e){},v.prototype.enableRowClass=function(t,e,i){},v.prototype.setRowStyle=function(t,e,i,o){},v.prototype.getRelativePosition=function(t){},v.prototype.getContentWidth=function(){},v.prototype.getContentHeight=function(){},v.prototype.getCellsByRowIndex=function(t){},v.prototype.disableHorizontalGridLine=function(t){},v.prototype.disableVerticalGridLine=function(t){},v.prototype.enableShading=function(t){},v.prototype.setTransposedShading=function(t){},v.prototype.enableRowHighlighting=function(t){},v.prototype.getRowHighlight=function(){},v.prototype.setRowHighlight=function(t){},v.prototype.getSelectedRows=function(){},v.prototype.getSelectedRowCount=function(){},v.prototype.isSelectedRow=function(t){},v.prototype.getRowAnchor=function(){},v.prototype.setRowAnchor=function(t){},v.prototype.setSelectedRow=function(t,e){},v.prototype.selectSingleRow=function(t){},v.prototype.selectRowRange=function(t,e){},v.prototype.clearSelectedRows=function(){},v.prototype.getFirstSelectedRow=function(){},v.prototype.getLastSelectedRow=function(){},v.prototype.activateColumn=function(t,e){},v.prototype.activateRows=function(t,e,i){},v.prototype.moveRowsToTop=function(t){},v.prototype.getFirstIndexInView=function(){},v.prototype.getLastIndexInView=function(){},v.prototype.isInCurrentView=function(t){},v.prototype.getFrozenLayout=function(){},v.prototype.setFrozenLayout=function(t){},v.prototype.insertColumn=function(t,e){},v.prototype.removeColumnAt=function(t){},v.prototype.moveColumn=function(t,e){},v.prototype.enableRowVirtualization=function(t){},v.prototype.enableColumnVirtualization=function(t){},v.prototype.getColumnIndex=function(t){},v.prototype.getCellIndex=function(t,e){},v.prototype.getIndex=function(){},v.prototype.setIndex=function(t){},v.prototype.getRowOffset=function(){},v.prototype.setRowOffset=function(t){},v.prototype.updateLayout=function(){},v.prototype.stretchCell=function(t,e,i,o){},v.prototype.unstretchCell=function(t,e){},v.prototype.unstretchAllCells=function(){},v.prototype.getStretchedCell=function(t,e){},v.prototype.getStretchedCells=function(){},v.prototype.updateStretchedCells=function(){},v.prototype.getColumnHost=function(){},v.prototype.setHidingMethod=function(t){},v.prototype.getHidingMethod=function(){},v.prototype.setColumnVisibility=function(t,e,i){},v.prototype.getRowLayout=function(){},v.prototype.reserveRightSpace=function(t){},v.prototype.getReservedSpace=function(){},v.prototype.getComputedStyle=function(){},v.prototype.isColumnActive=function(t){},v.prototype.setRowAttributes=function(t,e){},v.prototype.getContextRow=function(t){},v.prototype.selectColumn=function(t,e){},v.prototype.isSelectedColumn=function(t){},v.prototype.selectCell=function(t,e,i){},v.prototype.setCellBounds=function(t,e,i,o){},v.prototype.getHorizontalLayout=function(){},v.prototype.calculateColumnBounds=function(t,e,i,o){},v.prototype.updateColumnBounds=function(t,e,i){},v.prototype.updateColumnSeparators=function(){};const C=v;var S=function(t){(this._element=document.createElement("div")).className="column",this._cells=[],this._section=t};u.inherits(S,_),S.prototype._nextSibling=null,S.prototype._parent=null,S.prototype._section=null,S.prototype._cells=null,S.prototype._cellStart=0,S.prototype._cellEnd=0,S.prototype._autoStyleUpdating=!1,S.prototype._deactivation=!1,S.prototype._sizeClasses=null,S.prototype._colLeft=0,S.prototype._absolute=!1,S.prototype._scrollFrame=null,S.prototype._invisibility=0,S.prototype._bits=[1,2,4,8],S.prototype._pinned=!0,S.prototype.clearContent=function(){for(var t=this._cells.length;--t>=0;)this._cells[t].setContent(null)},S.prototype.setLeft=function(t){return this._colLeft=t,this._absolute&&(this._element.style.left=t+"px"),!0},S.prototype.enableAbsolutePosition=function(t){(t=!1!==t)!==this._absolute&&(this._absolute=t,this._element.style.left=t?this._colLeft+"px":"")},S.prototype.dispose=function(){this._dispose();for(var t=this._cells.length;--t>=0;)this._cells[t].dispose();this._scrollFrame=this._nextSibling=this._parent=this._cells=this._section=null},S.prototype.setStyle=function(t,e){var i=this._element;i.style[t]=e,i.style.backgroundColor?i.classList.contains("no-shading")||i.classList.add("no-shading"):i.classList.contains("no-shading")&&i.classList.remove("no-shading")},S.prototype.setStyles=function(t){var e=this._element,i=e.style;for(var o in t)i[o]=t[o];e.style.backgroundColor?e.classList.contains("no-shading")||e.classList.add("no-shading"):e.classList.contains("no-shading")&&e.classList.remove("no-shading")},S.prototype.show=function(t){this.setVisibility(0,!1!==t)},S.prototype.setWidth=function(t){this._element.style.width=t+"px";var e,i=0;t>0&&t<=24?i=3:t>24&&t<=40?i=2:t>40&&t<60&&(i=1);var o=this._sizeClasses;if(o){if(o.length>i){for(e=o.length;--e>=i;)this.removeClass(o[e]);o.length=i}i||(this._sizeClasses=null)}if(i)for(o||(o=[],this._sizeClasses=o),e=o.length;e<i;++e)o[e]=S._sizeClasses[e],this.addClass(o[e]);return this.setVisibility(1,t>0),!0},S._sizeClasses=["small-col","very-small-col","tiny-col"],S.prototype.setHeight=function(t){return this._element.style.height=t+"px",this.setVisibility(2,t>0),!0},S.prototype.getParent=function(){return this._parent},S.prototype.setParent=function(t,e){if(this._element){this._parent=o.getElement(t);var i=this._section?this._section.getHidingMethod():"";this._invisibility&&!i||this._setParent(this._parent,e)}},S.prototype.insertBefore=function(t){this._parent?this._scrollFrame?t&&this._parent===t.getParent()?this._insertBefore(t):this._insertBefore(this._scrollFrame):t?this._parent===t.getParent()&&this._insertBefore(t):this._setParent(this._parent):(this._insertBefore(t),this._parent=t.getParent())},S.prototype.enableAutoStyleUpdating=function(t){t=!1!==t,this._autoStyleUpdating!==t&&(this._autoStyleUpdating=t)},S.prototype.setNextSibling=function(t){this._nextSibling=t},S.prototype.isActive=function(){return!(this._invisibility&this._bits[3])},S.prototype.disableDeactivation=function(t){this._deactivation=!1!==t,this._deactivation&&(this.isActive()||this.activate())},S.prototype.activate=function(t){return t=this._pinned||this._deactivation||!1!==t,this.isActive()!==t&&(this.setVisibility(3,t),!0)},S.prototype.deactivate=function(t){this.activate(!1===t)},S.prototype.setCellCount=function(t){var e;for(e=this._cells.length;e<t;++e)this._cells.push(new f(null,this._section));for(e=this._cells.length;--e>=t;)this._cells[e].dispose();this._cells.length=t,this._cellStart>t?this._cellStart=this._cellEnd=t:this._cellEnd>t&&(this._cellEnd=t)},S.prototype.getCell=function(t){return this._cells[t]||null},S.prototype.collapseCells=function(t,e,i,o,n){if(!(e<=0)){var r=!1,s=this._cells[t];s&&!o&&(r|=s.collapse(i,n));for(var l=1;l<e&&(s=this._cells[t+l]);++l)r|=s.collapse(i,n);r&&(i?e>1&&(this._hasCollapsedCells=!0):this.updateCellOrders())}},S.prototype.uncollapseAllCells=o._deprecatedFunction,S.prototype.activateCells=function(t,e){var i,o=this._element;if(this._hasCollapsedCells)t=this._cellEnd,e>this._cellEnd&&(this._cellEnd=e);else if(this._cellStart===t){var n=this._cellEnd-e;if(n>0){for(i=this._cellEnd;--i>=e;)this._cells[i].removeParent();return void(this._cellEnd=e)}if(!(n<0))return;t=this._cellEnd,this._cellEnd=e}else{for(i=this._cellEnd;--i>=this._cellStart;)this._cells[i].removeParent();this._cellStart=t,this._cellEnd=e}for(i=t;i<e;++i){var r=this._cells[i];r.isKeptInDoc()&&(r.initialize(),o.appendChild(r.getElement()))}},S.prototype.moveCellsToTop=function(t){if(this.isActive()){for(var e=this._element,i=0;i<t;++i){var n=this._cells[i];n.isKeptInDoc()&&e.appendChild(n.getElement())}this._cells=o.cycleArray(this._cells,t)}},S.prototype.updateCellOrders=function(){this._hasCollapsedCells=!1;for(var t=this._element,e=this._cellStart;e<this._cellEnd;++e){var i=this._cells[e];i.isKeptInDoc()?t.appendChild(i.getElement()):this._hasCollapsedCells=!0}},S.prototype.hasCollapsedCells=function(){return this._hasCollapsedCells},S.prototype.getCellIndex=function(t){if(!t)return-1;for(var e=this._cellStart;e<this._cellEnd;++e)if(this._cells[e].getElement()===t)return e;return-1},S.prototype.getSection=function(){return this._section},S.prototype.log=function(){for(var t=[],e=this._cells.length,i=0;i<e;++i)t.push(this._cells[i].getTextContent());return t},S.prototype.getVisibility=function(){return!this._invisibility},S.prototype.setVisibility=function(t,e){var i=!this._invisibility,o=this._bits[t]||1;e?this._invisibility&=~o:this._invisibility|=o;var n=!this._invisibility;if(i!==n)if(this._section&&this._section.getHidingMethod())this.enableClass("hidden",!n);else if(n){var r=this._parent;if(!r)return;for(var s=this._nextSibling;s;){if(s._parent!==r){s=null;break}if(!s._invisibility)break;s=s._nextSibling}this.insertBefore(s)}else this._setParent(null)},S.prototype.updateLayout=function(){},S.prototype.setScrollState=function(t,e,i){this._scrollFrame=t,this.enableAbsolutePosition(i),this.setParent(e||this._section.getColumnHost()),e||this.activate(),this._pinned=!e},S._proto=S.prototype;const w=S;var b=function(){this._items=[]};b.prototype._items=null,b.prototype.dispose=function(){this._items=null},b.prototype.setItemCount=function(t){var e=this._items,i=e.length;if(i!==t)for(e.length=t;i<t;)e[i++]={}},b.prototype.getItem=function(t){return this._items[t]||null},b.prototype.moveItemsToTop=function(t){this._items=o.cycleArray(this._items,t)};const R=b;var I=function(t,e,i){t.setTop(e.getLaneStart(i)),t.setHeight(e.getLaneSize(i))},x=function(t,e,i,o){if(i){var n=e.getLaneStart(i);t.setLeft(n),t.setWidth(o-n)}else t.setStyle("left",""),t.setWidth(o)},L=function(t,e,i){this._trackX=t,this._trackY=e,this._section=i,this._cells=[]};L.prototype._trackX,L.prototype._trackY,L.prototype._section,L.prototype._cells,L.prototype._activeCount=0,L.prototype._stretchSize=0,L.prototype.dispose=function(){var t=this._cells;if(this._activeCount){this._activeCount=0;for(var e=t.length;--e>=0;){var i=t[e];i&&i.dispose()}}t.length=0},L.prototype.setStretchSize=function(t){this._stretchSize=t},L.prototype.getStretchSize=function(){return this._stretchSize},L.prototype.setCellCount=function(t){var e=this._cells,i=e.length;if(i<t)for(e.length=t;i<t;)e[i++]=null;else if(i>t){for(;--i>=t;){var o=e[i];o&&o.dispose()}e.length=t}},L.prototype.getCell=function(t){var e=this._cells[t];return e&&e.getParent()?e:null},L.prototype.getCells=function(){var t=[];if(this._activeCount){for(var e=this._cells,i=e.length,o=0;o<i;++o){var n=e[o];n&&n.getParent()&&t.push(n)}this._activeCount=t.length}return t},L.prototype.getColumnIndex=function(t){if(t){if(!t.getElement)return null!=t._colIndex?t._colIndex:-1;var e=t.getElement();if(e)return null!=e._colIndex?e._colIndex:-1}return-1},L.prototype.getRowIndex=function(t){if(t){if(t.getElement)return t.getParent()?this._cells.indexOf(t):-1;for(var e=this._cells,i=e.length,o=0;o<i;++o){var n=e[o];if(n&&n.getParent()&&n.getElement()===t)return o}}return-1},L.prototype.stretchCell=function(t,e){++this._activeCount,(!e||e<0)&&(e=0);var i=this._cells[t]||null;i||((i=new f(null,this._section)).addClass("tr-stretched"),i.stretched=!0,this._cells[t]=i);var o=i.getElement();o.stretched=!0,o._colIndex!==e&&(o._colIndex=e,e>0?o.classList.add("right-stretching"):o.classList.remove("right-stretching")),o._rowIndex!==t&&(o._rowIndex=t);var n=this._stretchSize||this._trackX.getTrackSize();return x(i,this._trackX,e,n),I(i,this._trackY,t),i},L.prototype.unstretchCell=function(t){var e=this._cells[t]||null;return e&&e.setParent(null),e},L.prototype.unstretchAllCells=function(){if(this._activeCount){this._activeCount=0;for(var t=this._cells,e=t.length;--e>=0;){var i=t[e];i&&i.setParent(null)}}},L.prototype.updateCells=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,o=this._trackX,n=this._trackY,r=this._stretchSize||o.getTrackSize(),s=0;s<i;++s){var l=e[s];l&&l.getParent()&&(++t,x(l,o,l.getElement()._colIndex,r),I(l,n,s))}this._activeCount=t}},L.prototype.updateXAxis=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,o=this._trackX,n=this._stretchSize||o.getTrackSize(),r=0;r<i;++r){var s=e[r];s&&s.getParent()&&(++t,x(s,o,s.getElement()._colIndex,n))}this._activeCount=t}},L.prototype.updateYAxis=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,o=this._trackY,n=0;n<i;++n){var r=e[n];r&&r.getParent()&&(++t,I(r,o,n))}this._activeCount=t}},L.prototype.moveCellsToTop=function(t){this._activeCount&&(this._cells=o.cycleArray(this._cells,t),this.updateYAxis())};const D=L;var A=function(t,e){this.indexX=t,this.indexY=e};A.prototype.isSpanIndices=function(t,e){return t===this.indexX&&e===this.indexY},A.prototype.isOccupiedIndices=function(t,e){return t!==this.indexX||e!==this.indexY},A.prototype.register=function(t,e){this._register(t,e,!0)},A.prototype.unregister=function(t,e){this._register(t,e,!1)},A.prototype._register=function(t,e,i){var o=t.indexOf(this);i?o<0&&t.push(this):o>=0&&t.splice(o,1);for(var n=i?this:null,r=this.indexX+this.colSpan,s=this.indexY+this.rowSpan,l=this.indexX;l<r;++l)for(var a=this.indexY;a<s;++a)e[l+","+a]=n},A.prototype.indexX,A.prototype.indexY,A.prototype.colSpan=1,A.prototype.rowSpan=1,A.prototype.prevColSpan=1,A.prototype.prevRowSpan=1,A.prototype.retVal=0;const z=A;var T=function(){this._spans=[],this._occupiedMap={}};T.prototype.removeColumn=function(t){var e=!1;return this.removeSpanByColIndex(t)&&(e=!0),this.shiftColumn(t,-1)&&(e=!0),e},T.prototype.freezeMapping=function(t){this._frozenMapping=!1!==t,this._frozenMapping||this._mapCellSpans()},T.prototype._mapCellSpans=function(){var t,e,i=this._spans;for(this._spans=[],this._occupiedMap={},t=i.length;--t>=0;)(e=i[t]).indexX>=0&&e.register(this._spans,this._occupiedMap)},T.prototype.shiftColumn=function(t,e){if(this._spans.length<=0||0===e)return!1;for(var i=!1,o=this._spans.length;--o>=0;){var n=this._spans[o];n.indexX>=t&&(i=!0,n.indexX+=e)}return!(!i||this._frozenMapping||(this._mapCellSpans(),0))},T.prototype.removeSpan=function(t,e){if(this._spans.length<=0)return null;var i=t+","+e,o=this._occupiedMap[i];return!o||o.isOccupiedIndices(t,e)?null:(o.unregister(this._spans,this._occupiedMap),o)},T.prototype.removeSpanByColIndex=function(t,e){var i,o=this._spans.length;if(o<=0)return null;for(var n=e||[],r=0,s=0;s<o;++s)(i=this._spans[s])&&i.indexX===t&&(n.push(i),r++);if(r<=0)return null;for(o=n.length,s=0;s<r;++s)n[o-s-1].unregister(this._spans,this._occupiedMap);return n},T.prototype.removeSpanStartedFromRowIndex=function(t,e){var i,o=this._spans.length;if(o<=0)return null;for(var n=e||[],r=0,s=0;s<o;++s)(i=this._spans[s])&&i.indexY>=t&&(n.push(i),r++);if(r<=0)return null;for(o=n.length,s=0;s<r;++s)n[o-s-1].unregister(this._spans,this._occupiedMap);return n},T.prototype.clearAllSpans=function(){if(this._spans.length<=0)return null;var t=this._spans;return this._spans=[],this._occupiedMap={},t},T.prototype.hasSpan=function(){return this._spans.length>0},T.prototype.getSpan=function(t,e){var i=this.getOccupyingSpan(t,e);return i&&i.isSpanIndices(t,e)?i:null},T.prototype.getOccupyingSpan=function(t,e){return this._spans.length<=0?null:this._occupiedMap[t+","+e]||null},T.prototype.getAllSpans=function(){return this._spans},T.prototype.getColSpan=function(t,e){var i=this._occupiedMap[t+","+e];return null==i?1:i.isOccupiedIndices(t,e)?i.indexX-t:i.colSpan},T.prototype.getRowSpan=function(t,e){var i=this._occupiedMap[t+","+e];return null==i?1:i.isOccupiedIndices(t,e)?i.indexY-e:i.rowSpan},T.prototype.setColSpan=function(t,e,i){return this._updateSpan(t,e,!0,i)},T.prototype.setRowSpan=function(t,e,i){return this._updateSpan(t,e,!1,i)},T.prototype._updateSpan=function(t,e,i,o){o<1&&(o=1);var n=this.getSpan(t,e);n&&(n.retVal=0);var r,s,l,a,h,u,p=t,_=e,c=n?n.colSpan:1,d=n?n.rowSpan:1,g=!0;if(i){if(c===o)return n;if(c>o)p=t+o,r=t+c,g=!1;else{if((l=this._occupiedMap[t+","+e])&&l!==n)return n;p=t+c,r=t+o}s=e+d}else{if(d===o)return n;if(d>o)_=e+o,s=e+d,g=!1;else{if((l=this._occupiedMap[t+","+e])&&l!==n)return n;_=e+d,s=e+o}r=t+c}if(g){var f=[];for(h=p;h<r;++h)for(u=_;u<s;++u){if(a=h+","+u,this._occupiedMap[a])return n;f.push(a)}for(null==n&&(n=new z(t,e),a=t+","+e,this._spans.push(n),this._occupiedMap[a]=n),h=f.length;--h>=0;)this._occupiedMap[f[h]]=n}else{if(i?o+d<=2:o+c<=2){a=t+","+e;var y=this._spans.indexOf(n);this._spans.splice(y,1),this._occupiedMap[a]=null}for(h=p;h<r;++h)for(u=_;u<s;++u)this._occupiedMap[h+","+u]=null}return i?(n.prevColSpan=n.colSpan,n.colSpan=o):(n.prevRowSpan=n.rowSpan,n.rowSpan=o),n.retVal=g?1:-1,n},T.prototype._spans,T.prototype._occupiedMap,T.prototype._frozenMapping=!1;const V=T;var E=function(){this._selections=[]};E.prototype.clone=function(){var t=new E;return t._selections=this._selections.concat(),t._count=this._count,t._anchor=this._anchor,t._firstIndex=this._firstIndex,t._lastIndex=this._lastIndex,t},E.prototype.toString=function(){return this._selections.join(", ")},E.prototype.select=function(t){return!(t<0||!this._select(t)||(this._anchor=t,(this._firstIndex<0||t<this._firstIndex)&&(this._firstIndex=t),(this._lastIndex<0||t>this._lastIndex)&&(this._lastIndex=t),0))},E.prototype.deselect=function(t){return!!this._selections[t]&&(this._selections[t]=!1,--this._count,this._anchor===t&&(this._anchor=-1),this._firstIndex===t&&(this._firstIndex=this._findNextSelection(t)),this._lastIndex===t&&(this._lastIndex=this._findPrevSelection(t)),!0)},E.prototype.deselectFrom=function(t){if(this._lastIndex<t)return!1;if(this._firstIndex>=t)return this.clearAllSelections(),!0;for(var e=this._lastIndex,i=this._selections,o=t;o<=e;++o)i[o]&&(i[t]=!1,--this._count);return this._anchor>=t&&(this._anchor=-1),this._lastIndex=this._findPrevSelection(t),!0},E.prototype.toggleSelection=function(t){this._selections[t]?this.deselect(t):this.select(t)},E.prototype.singularlySelect=function(t){return 1!==this._count||t<0?(this.clearAllSelections(),this.select(t),!0):this._firstIndex!==t&&(this._selections[this._anchor]=!1,this._selections[t]=!0,this._anchor=t,this._firstIndex=t,this._lastIndex=t,!0)},E.prototype.selectRange=function(t,e){if(0!==e)if(t<0&&(t=0),1!==e&&-1!==e){var i=t,o=i+e;if(e<0&&(i=(o=i+1)+e),!(i>=o)){this._anchor=t,(this._firstIndex<0||i<this._firstIndex)&&(this._firstIndex=i),(this._lastIndex<0||o>=this._lastIndex)&&(this._lastIndex=o-1);for(var n=i;n<o;++n)this._select(n)}}else this.select(t)},E.prototype.deselectRange=function(t,e){if(!(this._count<=0))if(t<0&&(t=0),1!==e&&-1!==e){var i=t+e;if(e<0&&(t=(i=t+1)+e),this._firstIndex>=t&&this._lastIndex<i)this.clearAllSelections();else{this._anchor>=t&&this._anchor<i&&(this._anchor=-1),this._firstIndex>=t&&this._firstIndex<i&&(this._firstIndex=this._findNextSelection(i-1)),this._lastIndex>=t&&this._lastIndex<i&&(this._lastIndex=this._findPrevSelection(t));var o=0;for(o=t;o<i;++o)this._selections[o]&&(this._selections[o]=!1,--this._count)}}else this.deselect(t)},E.prototype.hasSelection=function(t,e){if(this._count<=0)return!1;var i=t+e;if(e<0&&(t=(i=t+1)+e),i<this._firstIndex||t>this._lastIndex)return!1;for(var o=t;o<i;++o)if(this._selections[o])return!0;return!1},E.prototype.getSelection=function(t){return!0===this._selections[t]},E.prototype.setSelection=function(t,e){return!1!==e?this.select(t):this.deselect(t)},E.prototype.getSelectionAnchor=function(){return this._anchor},E.prototype.setSelectionAnchor=function(t){this._anchor=t},E.prototype.getSelectionCount=function(){return this._count},E.prototype.getFirstSelectedIndex=function(){return this._firstIndex},E.prototype.getLastSelectedIndex=function(){return this._lastIndex},E.prototype.getAllSelections=function(){if(this._count>0){for(var t=new Array(this._count),e=0,i=this._selections,o=this._lastIndex,n=this._firstIndex;n<=o;++n)i[n]&&(t[e++]=n);return t}return[]},E.prototype.getConnectedRanges=function(t,e){if(this._count>0){var i=[];(null==t||t<this._firstIndex)&&(t=this._firstIndex),(null==e||e>this._lastIndex)&&(e=this._lastIndex+1);for(var o=null,n=t;n<e;++n)this._selections[n]?o||(o=[n,-1]):o&&(o[1]=n-1,i.push(o),o=null);return o&&(o[1]=this._lastIndex,i.push(o),o=null),i}return[]},E.prototype.getSelectionMap=function(){return this._selections},E.prototype.clearAllSelections=function(){return this._count>0?(this._selections.length=0,this._count=0,this._anchor=-1,this._firstIndex=-1,this._lastIndex=-1,0):0},E.prototype.copyFrom=function(t,e,i,o){if(!(o<=0)){var n=e+i;if(null!=t)if(!1!==t.hasSelection(e,o)){for(var r=0;r<o;++r)t._selections[e+r]?this.select(n+r):this.deselect(n+r);this._anchor=-1,t._anchor>=0&&t._anchor>=e&&t._anchor<e+o&&(this._anchor=t._anchor+i)}else this.deselectRange(n,o);else this.deselectRange(n,o)}},E.prototype._select=function(t){return!this._selections[t]&&(this._selections[t]=!0,++this._count,!0)},E.prototype._findNextSelection=function(t){if(this._lastIndex>=0)for(;++t<=this._lastIndex;)if(this._selections[t])return t;return-1},E.prototype._findPrevSelection=function(t){if(this._firstIndex>=0)for(;--t>=this._firstIndex;)if(this._selections[t])return t;return-1},E.prototype._selections=null,E.prototype._count=0,E.prototype._anchor=-1,E.prototype._firstIndex=-1,E.prototype._lastIndex=-1;const P=E;var M=function(t,e){this._onInterval=this._onInterval.bind(this),"function"==typeof t?this._func=t:"function"==typeof e&&(this._func=e),"number"==typeof e?this._delay=e:"number"==typeof t&&(this._delay=t)};M.prototype._func=null,M.prototype._delay=0,M.prototype._timerId=0,M.prototype._pending=!1,M.prototype.start=function(){this._func&&(this._timerId?this._pending=!0:this._timerId=setInterval(this._onInterval,this._delay))},M.prototype.dispose=function(){this._timerId&&(clearInterval(this._timerId),this._timerId=0),this._func=null},M.prototype._onInterval=function(){this._pending?this._pending=!1:(this._func(),clearInterval(this._timerId),this._timerId=0)},M._proto=M.prototype;const F=M;var H=function(){var t=this;t._addEvents("scroll","activated","deactivated","scrollStart","scrollEnd","thicknessChanged","layoutChanged","enabled","disabled"),t._onTrackScroll=t._onTrackScroll.bind(t),t._onKeyDown=t._onKeyDown.bind(t),t._onStartFading=t._onStartFading.bind(t),t._onMouseWheel=t._onMouseWheel.bind(t),t._flash=t._flash.bind(t),t._onTouchStart=t._onTouchStart.bind(t),t._onTouchMove=t._onTouchMove.bind(t),t._onTouchEnd=t._onTouchEnd.bind(t),t._smoothScroll=t._smoothScroll.bind(t),t._updateEffectiveArea=t._updateEffectiveArea.bind(t),t._onRestingPosition=t._onRestingPosition.bind(t),t._element=document.createElement("div"),t._element.className="grid-scrollbar",t._trackContent=document.createElement("div"),t._panes=[],t._paneSliders=[],t._startPos={},t._endPos={},t._reverter=new F(t._onRestingPosition,300),t._element.addEventListener("scroll",t._onTrackScroll),t._element.addEventListener("mouseover",t._flash),t._element.appendChild(t._trackContent),t.disableKeyboardInput(!1),t._onThicknessChanged=t._dispatch.bind(t,"thicknessChanged"),H._queryNativeTrackThickness(t._onThicknessChanged),t._updateEffectiveArea()||t.listen("thicknessChanged",t._updateEffectiveArea)};u.inherits(H,_),H.prototype._vertical=!0,H.prototype._step=0,H.prototype._parentNode=null,H.prototype._hostClassName="",H.prototype._trackContent=null,H.prototype._panes=null,H.prototype._paneSliders=null,H.prototype._enabled=!0,H.prototype._active=!1,H.prototype._isFrozen=!1,H.prototype._otherScrollbar=null,H.prototype._autoHideScrollbar=!0,H.prototype._trackSize=120,H.prototype._tContentSize=0,H.prototype._tScrollVal=0,H.prototype._tPercentVal=0,H.prototype._paneSize=0,H.prototype._pContentSize=0,H.prototype._pScrollVal=0,H.prototype._footerCount=0,H.prototype._fadingId=0,H.prototype._postponeFading=!1,H.prototype._layoutChanged=!1,H.prototype._contentDirty=!0,H.prototype._layoutDirty=!0,H.prototype._touchInput=!0,H.prototype._swiping=!1,H.prototype._touchDrag=!1,H.prototype._startPos,H.prototype._endPos,H.prototype._smoothing=!0,H.prototype._smoothingId=0,H.prototype._smoothingSpeed=0,H.prototype._wheelScrolling="",H.prototype._mouseWheelLogic=null,H.prototype._onThicknessChanged=null,H._trackThickness=0,H._queryTimeout=0,H._queryStarted=!1,H._outerDummy=null,H._innerDummy=null,H._listeners=null,H.prototype._updateEffectiveArea=function(){var t=this.getTrackThickness();if(t){var e=this._vertical?"width":"height";this._element.style[e]=t+1+"px"}return!!t},H._queryNativeTrackThickness=function(t){if(H._queryStarted||H._repeatQuery(),t&&H._trackThickness<=0){var e=H._listeners;e||(e=H._listeners=[]),e.push(t)}},H._repeatQuery=function(){H._queryStarted=!0,H._retrieveNativeTrackThinkness()||(H._queryTimeout+=100,H._queryTimeout<3e3?setTimeout(H._repeatQuery,H._queryTimeout):(H._trackThickness=13,H._clearStaticResources()))},H._retrieveNativeTrackThinkness=function(){if(H._trackThickness>0)return!0;var t=H._innerDummy,e=H._outerDummy;t||((t=H._innerDummy=document.createElement("p")).style.width="100%",t.style.height="200px",(e=H._outerDummy=document.createElement("div")).style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.appendChild(t)),e.style.overflow="hidden",document.body.appendChild(e);var i=t.offsetWidth;e.style.overflow="scroll";var o=t.offsetWidth;return i==o&&(o=e.clientWidth),document.body.removeChild(e),(H._trackThickness=i-o)>0&&(H._clearStaticResources(),!0)},H._clearStaticResources=function(){H._innerDummy=H._outerDummy=null;var t=H._listeners;if(t){H._listeners=null;for(var e={},i=t.length;--i>=0;)t[i](e)}},H.updateTrackThickness=function(){H._trackThickness=0,H._queryTimeout=0,H._queryStarted=!1,H._queryNativeTrackThickness()},H.prototype.dispose=function(){var t=H._listeners;if(t){var e=t.indexOf(this._onThicknessChanged);e>=0&&(t.splice(e,1),this._onThicknessChanged=null)}this.unlistenAll(),this._smoothingId&&(clearInterval(this._smoothingId),this._smoothingId=0),this._active=this._layoutChanged=!1,this._dispose();for(var i=this._panes.length;--i>=0;)this._panes[i].dispose(),this._paneSliders[i].dispose();this._reverter.dispose()},H.prototype.getContent=function(t){return this._paneSliders[0].getContent(t)},H.prototype.getParent=function(){return this._parentNode},H.prototype.setParent=function(t,e){var i=o.getElement(t),n=this._parentNode!==i;n&&this._parentNode&&(this.removeWheelListener(this._parentNode),this._parentNode.classList.remove(this._hostClassName)),this.isActive()?(this._setParent(i,e),this._parentNode=this._element.parentNode,this._parentNode&&this._parentNode.classList.add(this._hostClassName)):this._parentNode=i,n&&this.addWheelListener(this._parentNode)},H.prototype.attachToExternalElement=function(t){this.setParent(t);var e=this.getElement();e.style.right="0",this._vertical?e.style.overflowX="hidden":e.style.overflowY="hidden",e.style.boxSizing="border-box",e.style.position="absolute",e.style.outline="none"},H.prototype._onActiveStateChange=function(){var t,e=this;if(e._scrollTo(0,!0),e._active){for(e._parentNode&&(e._layoutDirty=!0,e._setParent(e._parentNode),e._parentNode.classList.add(e._hostClassName)),e._flash(),t=e._panes.length;--t>=0;)e._panes[t].removeClass("scroll-disabled");e._dispatch("activated",{})}else{e._setParent(null),e._parentNode&&e._parentNode.classList.remove(e._hostClassName);var i=e._vertical?"height":"width";for(t=e._panes.length;--t>=0;)e._panes[t].addClass("scroll-disabled"),e._panes[t].setStyle(i,"");e._dispatch("deactivated",{})}e._vertical&&e._otherScrollbar&&e._otherScrollbar.isActive()&&e._otherScrollbar.invalidate()},H.prototype._onEnablingStateChange=function(){var t=this;t._enabled?t._dispatch("enabled",{}):t._dispatch("disabled",{})},H.prototype.isActive=function(){return this._active},H.prototype.isEnabled=function(){return this._enabled},H.prototype.enable=function(t){t=!1!==t,this._enabled!=t&&(this._enabled=t,this._updateLayout(),this._onEnablingStateChange())},H.prototype.disable=function(t){this.enable(!1===t)},H.prototype.getTrackSize=function(){return this._trackSize},H.prototype.getPaneSize=function(){return this._paneSize},H.prototype.getContentSize=function(){return this._pContentSize},H.prototype.getTrackThickness=function(){return H._trackThickness},H.prototype.getScrollGap=function(){return this._pContentSize-this.getPaneSize()},H.prototype.setTrackSize=function(t,e){this._trackSize=t>0?t:0,this._paneSize=e>0?e:0},H.prototype.calculateContentSize=function(){return 0},H.prototype.update=function(){if(this._contentDirty){this._contentDirty=!1;var t=this.calculateContentSize();(!t||t<0)&&(t=0),this._pContentSize!==t&&(this._pContentSize=t,this._layoutDirty=!0)}return!!this._layoutDirty&&(this._layoutDirty=!1,this._updateLayout(),!0)},H.prototype.invalidate=function(t,e){this._contentDirty=!0,this._layoutDirty=!0,null!=e&&(this._pScrollVal=e),t&&this.update()},H.prototype.invalidateContent=function(){this._contentDirty=!0},H.prototype.isScrollPosValid=function(t){var e=t-this.getPaneSize(),i=this._pScrollVal;return 0===i||i>0&&e>0&&i<e},H.prototype.flash=function(){this.update(),this._flash()},H.prototype._scroll=function(t){this._scrollTo(this._pScrollVal+t)},H.prototype._scrollTo=function(t,e){if(this._active||e){t=this._calcProperScrollValue(t);var i=!1;this._pScrollVal!==t&&(this._pScrollVal=t,i=!0),this._setTrackScrollVal(t),i?(e&&(this._layoutChanged=!0),this._dispatchScrollEvent(null)):e&&this._dispatch("layoutChanged",{})}},H.prototype._calcProperScrollValue=function(t){if(!t||t-.5<0)return 0;if(this._tPercentVal>=1&&Math.abs(this._pScrollVal-t)<=2)return this._pScrollVal;var e=this.getScrollGap();if(e<=0)return 0;if(t+.5>=e)return e;var i=this._step;if(i){if((t=Math.round(t/i)*i)-i/2<=0)return 0;if(t+i/2>=e)return e}return Math.round(t)},H.prototype._convertTrackToPane=function(t){t=Math.round(t);var e=this._getTrackGap();this._tPercentVal>=1&&Math.abs(this._tScrollVal-t)<=5&&(t=e),this._tScrollVal=t,this._tPercentVal=e?t/e:0;var i=this.getScrollGap();return e===i?t:this._tPercentVal*i},H.prototype._setTrackScrollVal=function(t){var e=this._getTrackGap(),i=0;if(e>0){if(t>0){var o=this.getScrollGap();i=e===o?t:t/o*e,i=Math.round(i)}i>=e&&(i=e)}if(i!==this._tScrollVal){this._tScrollVal=i,this._tPercentVal=e?i/e:0;var n=this._element;return this._vertical?n.scrollTop=i:n.scrollLeft=i,!0}return!1},H.prototype._getTrackGap=function(){var t=this._tContentSize-this.getTrackSize();return t>0?t:0},H.prototype._getScrollValue=function(){return this._pScrollVal},H.prototype._isEndOfScroll=function(){return!this._active||this._pScrollVal>=this.getScrollGap()},H.prototype._isStartOfScroll=function(){return!this._pScrollVal},H.prototype._isOnEdge=function(t){return t<0&&this._isStartOfScroll()||t>0&&this._isEndOfScroll()},H.prototype._flash=function(){this._active&&this._autoHideScrollbar&&(this._fadingId?this._postponeFading=!0:(this._element._fading&&(this._element.classList.remove("grid-scroll-fadeout"),this._element._fading=!1),this._fadingId=setTimeout(this._onStartFading,1e3)))},H.prototype._clearAllPanes=function(){for(var t=this._panes.length;--t>=0;){this._panes[t].setParent(null);var e=this._paneSliders[t];e._content=e._columns=null;for(var i=e.getElement();null!==i.firstChild;)i.removeChild(i.firstChild)}},H.prototype.disableKeyboardInput=function(t){!1===t?(this._element.setAttribute("tabindex","0"),this._element.addEventListener("keydown",this._onKeyDown,!1)):(this._element.removeAttribute("tabindex"),this._element.removeEventListener("keydown",this._onKeyDown,!1))},H.prototype.disableTouchInput=function(t){this._touchInput=!1===t},H.prototype.setAutoHide=function(t){this._autoHideScrollbar=t,t||(this._element._fading&&(this._element.classList.remove("grid-scroll-fadeout"),this._element._fading=!1),this._fadingId&&(clearTimeout(this._fadingId),this._fadingId=0))},H.prototype.getAutoHide=function(){return this._autoHideScrollbar},H.prototype.setOtherScrollbar=function(t){this._otherScrollbar=t},H.prototype.setFooterCount=function(t){this._footerCount=t},H.prototype._calcActiveState=function(){if(this._enabled&&this.getTrackSize()>20){var t=this.getPaneSize();if(t>0)return this._pContentSize-t>0}return!1},H.prototype._updateLayout=function(){var t=this._calcActiveState();if(t!==this._active&&(this._active=t,this._onActiveStateChange()),this._active){var e=this.getTrackSize(),i=this.getPaneSize();if(this._tContentSize=this._pContentSize/i*e,this._vertical)this._trackContent.style.height=this._tContentSize+"px",this._element.style.height=e+"px",this._panes[0].setHeight(i);else{this._trackContent.style.width=this._tContentSize+"px",this._element.style.width=e+"px";for(var o=this._panes.length;--o>=0;)this._panes[o].setWidth(i)}this._scrollTo(this._pScrollVal,!0)}},H.prototype.resetPaneSize=function(){for(var t=this._vertical?"height":"width",e=this._panes.length;--e>=0;)this._panes[e].setStyle(t,"")},H._preventVScrolling=function(t){t.currentTarget.scrollTop=0},H._preventHScrolling=function(t){t.currentTarget.scrollLeft=0},H.prototype._addPaneAt=function(t){null==t&&(t=this._panes.length);var e=this._panes[t];if(!e){if((e=new _(document.createElement("div"))).setClass("grid-pane"),this._vertical?(e.addClass("sections"),e.listen("scroll",H._preventVScrolling)):(e.addClass("columns"),e.listen("scroll",H._preventHScrolling)),this._active||e.addClass("scroll-disabled"),this._paneSize&&this._active){var i=this.getPaneSize();this._vertical?e.setHeight(i):e.setWidth(i)}e.listen("touchstart",this._onTouchStart),e.listen("touchmove",this._onTouchMove),e.listen("touchend",this._onTouchEnd),e.listen("touchcancel",this._onTouchEnd);var o=new _(document.createElement("div"));o.setClass("grid-pane-slider"),o.setParent(e),this._panes[t]=e,this._paneSliders[t]=o}return e},H.prototype._onStartFading=function(t){this._fadingId=0,this._active&&(this._postponeFading?(this._postponeFading=!1,this._flash()):this._element._fading||(this._element.classList.add("grid-scroll-fadeout"),this._element._fading=!0))},H.prototype._onTrackScroll=function(t){var e=this._vertical?t.target.scrollTop:t.target.scrollLeft,i=this._convertTrackToPane(e);(i=this._calcProperScrollValue(i))!==this._pScrollVal&&(this._pScrollVal=i,this._dispatchScrollEvent(t))},H.prototype._onRestingPosition=function(){this._setSliderPosition(-this._pScrollVal,!0)},H.prototype._setSliderPosition=function(t,e){var i="",o="",n=this._vertical?"top":"left";t&&(e?o=t+"px":(i=this._vertical?"translateY":"translateX",i+="("+t+"px)",this._reverter.start()));for(var r=this._paneSliders.length;--r>=0;){var s=this._paneSliders[r],l=s.getElement().style;s._titleSection?l[n]=t+"px":(l.transform=i,l[n]=o)}e?this._dispatch("scrollEnd",{}):this._dispatch("scrollStart",{})},H.prototype._dispatchScrollEvent=function(t){if(this._setSliderPosition(-this._pScrollVal,!1),this._flash(),!this._isEventDispatching("scroll")){if(!t){var e=this._element;t={currentTarget:e,srcElement:e,target:e}}t.layoutChanged=this._layoutChanged,this._vertical?t.scrollTop=this._pScrollVal:t.scrollLeft=this._pScrollVal,this._dispatch("scroll",t)}},H.prototype._onKeyDown=function(t){if(this._isFrozen)o._preventDefault(t);else if(this._active&&(this._vertical?38===t.keyCode||40===t.keyCode:37===t.keyCode||39===t.keyCode)){var e=this.getScrollGap(),i=Math.round(.07*e);i<10?i=10:i>100&&(i=100),37!==t.keyCode&&38!==t.keyCode||(i*=-1),this._scroll(i),o._preventDefault(t)}},H.prototype._onTouchStart=function(t){this._isFrozen?o._preventDefault(t):!this._swiping&&this._touchInput&&(this._vertical&&this.update(),this._flash(),this._smoothingId&&(clearInterval(this._smoothingId),this._smoothingId=0),this._swiping=!0,this._getTouchInfo(t,this._startPos))},H.prototype._onTouchMove=function(t){var e=this;if(e._isFrozen)o._preventDefault(t);else if(e._swiping&&e._active&&e._touchInput&&!(t.touches&&t.touches.length>1)){var i=e._startPos,n=e._endPos;e._getTouchInfo(t,n);var r=this._vertical?i.y-n.y:i.x-n.x;r>-5&&r<5||e._isOnEdge(r)||(e._touchDrag?e._scrollTo(i.scrollValue+r):n.timeStamp-i.timeStamp>30&&(e._touchDrag=!0),t.cancelable&&t.preventDefault())}},H.prototype._onTouchEnd=function(t){if(this._isFrozen)o._preventDefault(t);else if(this._swiping=!1,this._touchDrag&&(this._touchDrag=!1,t.cancelable&&t.preventDefault(),this._smoothing&&!this._smoothingId)){var e=this._startPos,i=this._getTouchInfo(t,this._endPos),n=i.timeStamp-e.timeStamp,r=this._vertical?e.y-i.y:e.x-i.x;this._smoothingSpeed=30*r/n,(this._smoothingSpeed>10||this._smoothingSpeed<-10)&&(this._smoothingId=setInterval(this._smoothScroll,25))}},H.prototype._getTouchInfo=function(t,e){var i=t.changedTouches[0];return e||(e={}),e.x=i.pageX,e.y=i.pageY,e.timeStamp=t.timeStamp,e.scrollValue=this._getScrollValue(),e},H.prototype._smoothScroll=function(){var t=this._smoothingSpeed;t=.9*t|0,this._smoothingSpeed=t,t>1||t<-1?this._scroll(t):(clearInterval(this._smoothingId),this._smoothingId=0)},H.prototype.disableMouseWheel=function(t){!1===t?this.setMouseWheelLogic(this._mouseWheelLogic||this._onMouseWheel):this.setMouseWheelLogic(null)},H.prototype.setMouseWheelLogic=function(t){this.removeWheelListener(this._parentNode),this._mouseWheelLogic=t,this._mouseWheelLogic&&this.addWheelListener(this._parentNode)},H.prototype.addWheelListener=function(t){t&&this._mouseWheelLogic&&t.addEventListener("wheel",this._mouseWheelLogic,!1)},H.prototype.removeWheelListener=function(t){t&&this._mouseWheelLogic&&t.removeEventListener("wheel",this._mouseWheelLogic,!1)},H.prototype.setMouseWheelSpeed=function(t){this._wheelScrolling="string"==typeof t?t:""},H.prototype.getMouseWheelSpeed=function(){return this._wheelScrolling},H.prototype.getDefaultMouseWheelLogic=function(){return this._onMouseWheel},H.prototype._onMouseWheel=function(t){if(!t.target.opened)if(this._isFrozen)o._preventDefault(t);else if(!t.ctrlKey&&!t.altKey&&this.isActive()){var e=this._vertical?t.deltaY:t.deltaX;if(e&&!this._isOnEdge(e)){if(o._preventDefault(t),t.deltaMode&&(e=e>0?100:-100),"linear"!=this._wheelScrolling){var i=this.getContentSize();i>=4e3&&(e*=1+i/4e3|0)}this.update(),this._scroll(e)}}},H.prototype.setScrollingStep=function(t){this._step=t>0?t:0},H.prototype.freezeScrolling=function(t){var e=this._isFrozen;return this._isFrozen=!1!==t,e},H.prototype.restoreTrackPosition=function(){var t=this._element;this._vertical&&(t.scrollTop=this._tScrollVal,t.scrollTop&&(this._tScrollVal=t.scrollTop))},H._proto=H.prototype;const k=H;var O=function(){var t=this;t._vertical=!1,t._onDeactivated=t._onDeactivated.bind(t),t._onActivated=t._onActivated.bind(t),t._hostClassName="hscrollbar-host",O.base(this,"constructor"),t._element.classList.add("grid-hscroll"),t._trackContent.style.height="1px",t.disableMouseWheel(!1),t.listen("activated",t._onActivated),t.listen("deactivated",t._onDeactivated)};u.inherits(O,k),O.prototype._pinnedLeftColumnCount=0,O.prototype._pinnedRightColumnCount=0,O.prototype.setScrollContent=function(t,e,i,o){this._clearAllPanes();var n=e.length;if(!(n<=0)){this._pinnedLeftColumnCount=i>=0?i:0,this._pinnedRightColumnCount=o>0?o:0;var r=e[0],s=r.getColumnCount(),l=s-o;(!l||l<0)&&(l=s);for(var a=0;a<n;++a){r=e[a];var h,u,p=this._addPaneAt(a),_=this._paneSliders[a],c=p.getElement(),d=_.getElement();for(h=0;h<i;++h)(u=r.getColumn(h)).setScrollState(c,null,!1);p.setParent(r.getColumnHost());var g=[],f=[];for(h=i;h<l;++h)(u=r.getColumn(h)).setScrollState(null,d,this.isActive()),g.push(u),f.push(u.getElement());for(h=l;h<s;++h)(u=r.getColumn(h)).setScrollState(null,null,!1);var y=r.getReservedSpace();y&&(this._pinnedRightColumnCount||(_.addContent(y),f.push(y)),r._updateRightSpaceStyle()),r._updateLayers(),_._titleSection=r.hasClass("title"),_._columns=g,_._content=f}this.invalidateContent()}},O.prototype.setWidth=function(t){return this.setTrackSize(t,t),!0},O.prototype.getWidth=function(){return this.getPaneSize()},O.prototype.getScrollLeft=function(){return this._getScrollValue()},O.prototype.setScrollLeft=function(t){this.update(),this._scrollTo(t)},O.prototype.getPinnedLeftColumnCount=function(){return this.isEnabled()?this._pinnedLeftColumnCount:0},O.prototype.getPinnedRightColumnCount=function(){return this.isEnabled()?this._pinnedRightColumnCount:0},O.prototype.setPaneLeft=function(t){for(var e=t&&this.isActive()?-t+"px":"",i=this._panes.length;--i>=0;)this._paneSliders[i].setStyle("marginLeft",e)},O.prototype.isEndOfHorizontalScroll=function(){return this._isEndOfScroll()},O.prototype.getContentWidth=function(){var t=this._paneSliders[0],e=0;if(t)for(var i=t._content,o=i.length;--o>=0;){var n=i[o],r=n?n.style.width:0;r&&(e+=parseFloat(r))}return e},O.prototype.calculateContentSize=function(){return this.getContentWidth()},O.prototype.getTrackSize=function(){return this._footerCount<=0&&this._otherScrollbar&&this._otherScrollbar.isActive()&&!this._pinnedRightColumnCount?this._trackSize-this.getTrackThickness():this._trackSize},O.prototype._onActivated=function(t){this._updateActivation(!0)},O.prototype._onDeactivated=function(t){this._updateActivation(!1)},O.prototype._updateActivation=function(t){for(var e=this._paneSliders.length,i=0;i<e;++i)for(var o=this._paneSliders[i]._columns,n=o?o.length:0,r=0;r<n;++r){var s=o[r];s.getElement()&&s.enableAbsolutePosition(t)}},O._proto=O.prototype;const G=O;var B=function(t){var e=this;e._onMouseMove=e._onMouseMove.bind(e),e._onMouseOut=e._onMouseOut.bind(e),e._onResetTransformIE=e._onResetTransformIE.bind(e),e._trackX=new m,e._trackY=new m,e._trackX.setDefaultLaneSize(100),e._trackY.setDefaultLaneSize(32),e._cellSpans=new V,e._element=document.createElement("div"),e._element.className="tr-lg tr-even-shading",e._ctxRows=new R,e._columns=[],e._cells=[],e._highlightedCells=[],e._stretchedCells=new D(e._trackX,e._trackY,e),e._selectionList=new P,t&&(e._virOwner=t.owner||null,t.horizontalScrollbar&&(e._hscrollbar=t.horizontalScrollbar)),e._virOwner||e._element.classList.add("section"),e._addEvent("rowHighlighted"),e._addEvent("rowCountChanged"),e._addEvent("rowHeightChanged"),e._addEvent("rowAvailable")};u.inherits(B,_),B.prototype._index=-1,B.prototype._availableRowCount=0,B.prototype._activeRow=0,B.prototype._activeRowEnd=0,B.prototype._colCount=0,B.prototype._rowCount=0,B.prototype._hiddenRowCount=0,B.prototype._trackX,B.prototype._trackY,B.prototype._cellSpans,B.prototype._columns,B.prototype._firstColumn,B.prototype._lastColumn,B.prototype._rightSpace,B.prototype._rightSpaceSize=0,B.prototype._frozenLayout=!1,B.prototype._rowHighlightEnabled=!1,B.prototype._rowHighlightIndex=-1,B.prototype._highlightedCells,B.prototype._coverLayer=null,B.prototype._stretchedCells=null,B.prototype._ctx=null,B.prototype._selectionList,B.prototype._colVir=!1,B.prototype._initialized=!1,B.prototype._hidingMethod="",B.prototype._virOwner=null,B.prototype._transformIETimer=0,B.prototype._ctxRows,B.prototype._boundLayer=null,B.prototype._colBounds=null,B.prototype._colBoundCache=null,B.prototype._colSelDirty=!1,B.prototype._hscrollbar=null,B.prototype._leftColumnSeparator=null,B.prototype._rightColumnSeparator=null,B.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._ctxRows.dispose(),this._stretchedCells.dispose();for(var t=this._columns.length;--t>=0;)this._columns[t].dispose();this._colCount=this._rowCount=this._activeRowEnd=this._availableRowCount=0,this._colBounds=this._colBoundCache=null,this._colSelDirty=!1,this._highlightedCells.length=0,this._ctx=null,this._hscrollbar=null,this._dispose()},B.prototype.getWidth=function(){return this.isVisible()?this._getWidth():0},B.prototype._getWidth=function(){return this.getContentWidth()+this._rightSpaceSize},B.prototype.setWidth=function(t){return!(t<0||null==this._trackX.setTrackSize(t-this._rightSpaceSize)||(this._syncLayoutToColumns(0),0))},B.prototype.getHeight=function(){return this.isVisible()?this.getContentHeight():0},B.prototype.setHeight=function(t){return!(t<0||(null==this._trackY.setTrackSize(t)||this._syncLayoutToRows(0,this._rowCount),0))},B.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._trackY.show(t),this.setFrozenLayout(!1===t),this._dispatchRowHeightChangedEvent(0,this._rowCount)},B.prototype.hitTest=function(t,e,i){if(t<0)return null;if(e<0)return null;if(t>=this.getContentWidth())return null;if(e>=this.getHeight())return null;var o=this._trackX.hitTest(t);if(o<0)return null;var n=this._trackY.hitTest(e);if(n<0)return null;var r={};if(r.colIndex=o,r.rowIndex=n,!0!==i){var s=this._cellSpans.getOccupyingSpan(o,n);s&&(r.colIndex=s.indexX,r.rowIndex=s.indexY)}return r},B.prototype.hitTestX=function(t){return t<0?-1:t>=this.getContentWidth()?~this._colCount:this._trackX.hitTest(t)},B.prototype.hitTestY=function(t){return t<0?-1:t>=this.getHeight()?~this._rowCount:this._trackY.hitTest(t)},B.prototype.getDefaultColumnWidth=function(){return this._trackX.getDefaultLaneSize()},B.prototype.setDefaultColumnWidth=function(t){this._trackX.getDefaultLaneSize()!==t&&(this._trackX.setDefaultLaneSize(t),this._syncLayoutToColumns(0))},B.prototype.getDefaultRowHeight=function(){return this._trackY.getDefaultLaneSize()},B.prototype.setDefaultRowHeight=function(t){if(this._trackY.getDefaultLaneSize()!==t){this._trackY.setDefaultLaneSize(t);for(var e=0;e<this._colCount;++e)this._columns[e].setHeight(t);this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)}},B.prototype.getColumnWidth=function(t){return this._trackX.getLaneSize(t)},B.prototype.setColumnWidth=function(t,e){return!!this._setColumnWidth(t,e)&&(this._syncLayoutToColumns(t),!0)},B.prototype._setColumnWidth=function(t,e){return this._trackX.setLaneSize(t,e)},B.prototype._updateColumnLayout=function(){this._syncLayoutToColumns(0)},B.prototype._startBindingSession=function(t){},B.prototype._getTempRowHeights=function(){return null},B.prototype.getRowHeight=function(t){return this._trackY.getLaneSize(t)},B.prototype.setRowHeight=function(t,e){if(t<0||t>=this._rowCount)return!1;var i=this._trackY.setLaneSize(t,e);return this._syncLayoutToRows(t,t+1),i&&this._dispatchRowHeightChangedEvent(t,t+1),this._resetTransformIETimer(),i},B.prototype._updateRowHeights=function(t,e){for(var i=0,o=0;o<this._rowCount;++o){var n=t.getLaneSize(e);i|=this._trackY.setLaneSize(o,n),++e}return this._syncLayoutToRows(0,this._rowCount),i},B.prototype.isColumnVisible=function(t){return this._trackX.isLaneVisible(t)},B.prototype.hideColumn=function(t,e){return this.setColumnVisibility(t,!1===e,0)},B.prototype.isRowVisible=function(t){return this._trackY.isLaneVisible(t)},B.prototype.hideRow=function(t,e){return!!this._trackY.hideLane(t,e)&&(null!=e&&!e||this.isRowVisible(t)?this.isRowVisible(t)&&this._hiddenRowCount--:this._hiddenRowCount++,this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},B.prototype.getMinimumColumnWidth=function(t){return this._trackX.getMinimumLaneSize(t)},B.prototype.setMinimumColumnWidth=function(t,e){return!!this._trackX.setMinimumLaneSize(t,e)&&(this._syncLayoutToColumns(t),!0)},B.prototype.getMinimumRowHeight=function(t){return this._trackY.getMinimumLaneSize(t)},B.prototype.setMinimumRowHeight=function(t,e){return!!this._trackY.setMinimumLaneSize(t,e)&&(this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},B.prototype.getCellLeft=function(t){return this._trackX.getLaneStart(t)},B.prototype.getCellTop=function(t){return this._trackY.getLaneStart(t)},B.prototype.getCellWidth=function(t,e){var i=this._cellSpans.getOccupyingSpan(t,e);if(i){var o=this._trackX.getLaneStart(i.indexX);return this._trackX.getLaneEnd(i.indexX+i.colSpan-1)-o}return this.getColumnWidth(t)},B.prototype.getCellHeight=function(t,e){var i=this._cellSpans.getOccupyingSpan(t,e);if(i){var o=this._trackY.getLaneStart(i.indexY);return this._trackY.getLaneEnd(i.indexY+i.rowSpan-1)-o}return this.getRowHeight(e)},B.prototype.hasCellSpan=function(){return this._cellSpans.hasSpan()},B.prototype.getCellRowSpan=function(t,e){return this._cellSpans.getRowSpan(t,e)},B.prototype.setCellRowSpan=function(t,e,i){var o=this._cellSpans.setRowSpan(t,e,i);if(this._updateCellSpanSize(t,e,o),o)return o.retVal>=0?this._updateCellSpanClass(t,e,o.colSpan,o.rowSpan,!0):o.colSpan>1?(this._updateCellSpanClass(t,e,o.colSpan,o.prevRowSpan,!1),this._updateCellSpanClass(t,e,o.colSpan,o.rowSpan,!0)):this._updateCellSpanClass(t,e,o.colSpan,o.prevRowSpan,!1),0!==o.retVal;var n=this._getCell(t,e);return n&&n._rowSpan>1&&this._updateCellSpanClass(t,e,n._colSpan,n._rowSpan,!1),!1},B.prototype.getCellColSpan=function(t,e){return this._cellSpans.getColSpan(t,e)},B.prototype.setCellColSpan=function(t,e,i){var o=this._cellSpans.setColSpan(t,e,i);if(this._updateCellSpanSize(t,e,o),o)return o.retVal>=0?this._updateCellSpanClass(t,e,o.colSpan,o.rowSpan,!0):o.colSpan>1?(this._updateCellSpanClass(t,e,o.prevColSpan,o.rowSpan,!1),this._updateCellSpanClass(t,e,o.colSpan,o.rowSpan,!0)):this._updateCellSpanClass(t,e,o.prevColSpan,o.rowSpan,!1),0!==o.retVal;var n=this._getCell(t,e);return n&&n._colSpan>1&&this._updateCellSpanClass(t,e,n._colSpan,n._rowSpan,!1),!1},B.prototype.clearCellSpans=function(){var t=this._cellSpans.clearAllSpans();if(null==t)return!1;for(var e=t.length;--e>=0;){var i=t[e];this._updateCellSpan(i.indexX,i.indexY,i,!1)}return!0},B.prototype.clearColumnSpans=function(t){var e=this._cellSpans.removeSpanByColIndex(t);if(null==e)return!1;for(var i=e.length;--i>=0;){var o=e[i];this._updateCellSpan(o.indexX,o.indexY,o,!1)}return!0},B.prototype.clearColumnCustomizations=function(){this._trackX.clearLaneCustomizations(),this._syncLayoutToColumns(0)},B.prototype.clearRowCustomizations=function(){this._trackY.clearLaneCustomizations(),this._syncLayoutToRows(0,this._rowCount)},B.prototype.getColumnScalability=function(t){return this._trackX.getLaneScalability(t)},B.prototype.setColumnScalability=function(t,e){return this._trackX.setLaneScalability(t,e)},B.prototype.getRowScalability=function(t){return this._trackY.getLaneScalability(t)},B.prototype.setRowScalability=function(t,e){return this._trackY.setLaneScalability(t,e)},B.prototype.getCell=function(t,e,i){if(i&&this._cellSpans.hasSpan()){var o=this._cellSpans.getColSpan(t,e),n=this._cellSpans.getRowSpan(t,e);o<0&&(t+=o),n<0&&(e+=n)}return this._getCell(t,e)},B.prototype.getCellContent=function(t,e){var i=this.getCell(t,e);return null!==i?i.getContent():null},B.prototype.setCellContent=function(t,e,i){var o=this.getCell(t,e);return null==o?(window.console.log("Error: Accessing nonexistent cell in Grid's Table"),null):o.setContent(i)},B.prototype.getColumnCount=function(){return this._colCount},B.prototype.setColumnCount=function(t){if(t<0&&(t=0),this._colCount!==t){var e=this._colCount;this._trackX.setLaneCount(t),this._colCount=this._trackX.getLaneCount();var i=0,o=null;if(e>t)for(i=e;--i>=t;)(o=this._columns.pop()).dispose(),o===this._firstColumn&&(this._firstColumn=null),o===this._lastColumn&&(this._lastColumn=null);else for(i=e;i<t;++i)o=this._newColumn(i);for(this._updateColumnIndices(),i=e;i<t;++i)this._columns[i].activate(!this._colVir);t<=0&&this._selectionList.clearAllSelections()}},B.prototype.getRowCount=function(){return this._rowCount},B.prototype.setRowCount=function(t,e){if(t<0&&(t=0),this._rowCount!==t){var i,o=this._rowCount;for(this._trackY.setLaneCount(t),this._rowCount=this._trackY.getLaneCount(),this._ctxRows.setItemCount(t),this._stretchedCells.setCellCount(t),i=0;i<this._colCount;++i)this._columns[i].setCellCount(t);if(o>t)if(t<this._rowHighlightIndex&&this.setRowHighlight(-1),t<this._activeRowEnd&&(this._activeRowEnd=t),t<this._availableRowCount&&(this._availableRowCount=t),this._cellSpans.removeSpanStartedFromRowIndex(t),this._updateViewHeight(),t>0)for(var n=t;n<o;++n)this._selectionList.deselect(n);else this._selectionList.clearAllSelections();else this._syncLayoutToRows(o,t);var r={};r.prevCount=o,r.rowCount=this._rowCount,this._dispatch("rowCountChanged",r),o<t&&this._insertCells(0,this._rowCount)}},B.prototype.getVisibleRowCount=function(){return this._rowCount-this._hiddenRowCount},B.prototype.addRow=function(t){t<=0||(this._colCount<=0?window.console.log("WARNING: Row cannot be added, unless at least one column is added"):this.setRowCount(this._rowCount+t))},B.prototype.removeRow=function(t){t<=0||(t>this._rowCount&&(t=this._rowCount),this.setRowCount(this._rowCount-t))},B.prototype.setBorders=function(t,e,i,o){},B.prototype.getColumnStyle=function(t,e){var i=this._columns[t];return i?i.getStyle(e):null},B.prototype.setColumnStyle=function(t,e,i){var o=this._columns[t];o&&o.setStyle(e,i)},B.prototype.enableColumnClass=function(t,e,i){var o=this._columns[t];o&&o.enableClass(e,i)},B.prototype.hasColumnClass=function(t,e){var i=this._columns[t];return!!i&&i.hasClass(e)},B.prototype.enableRowClass=function(t,e,i){if(t>=0&&t<this._rowCount)for(var o=0;o<this._colCount;++o)this._columns[o].getCell(t).enableClass(e,i)},B.prototype.setRowStyle=function(t,e,i,o){if(t>=0&&t<this._rowCount){i&&(null==o||o)||(i="");for(var n=0;n<this._colCount;++n)this._columns[n].getCell(t).setStyle(e,i)}},B.prototype.getRelativePosition=function(t){return o.getRelativePosition(t,this._element)},B.prototype.getContentWidth=function(){return this._trackX.getTrackSize()},B.prototype.getContentHeight=function(){var t=this._trackY.getTrackSize();if(t<=0&&this._colCount*this.getVisibleRowCount()>0){var e=this._columns[0],i=e.getCell(this._rowCount-1);return i.getTop()+i.getHeight()-e.getCell(0).getTop()}return t},B.prototype.getCellsByRowIndex=function(t){if(t<0||t>=this._rowCount)return null;for(var e=new Array(this._colCount),i=0;i<this._colCount;++i)e[i]=this._columns[i].getCell(t);return e},B.prototype.disableHorizontalGridLine=function(t){this.enableClass("no-horizontal-grid-line",!1!==t)},B.prototype.disableVerticalGridLine=function(t){this.enableClass("no-vertical-grid-line",!1!==t)},B.prototype.enableShading=function(t){!1!==t?this.addClass("tr-even-shading"):(this.removeClass("tr-even-shading"),this.removeClass("tr-odd-shading"))},B.prototype.setTransposedShading=function(t){this.enableClass("transposed-shading",!1!==t)},B.prototype.enableRowHighlighting=function(t){null==t&&(t=!0),this._rowHighlightEnabled!==t&&(this._rowHighlightEnabled=t,this._rowHighlightEnabled?(this.listen("mousemove",this._onMouseMove),this.listen("mouseout",this._onMouseOut)):(this.setRowHighlight(-1),this.unlisten("mousemove",this._onMouseMove),this.unlisten("mouseout",this._onMouseOut)))},B.prototype.getRowHighlight=function(){return this._rowHighlightIndex},B.prototype.setRowHighlight=function(t){if((!this._rowHighlightEnabled||t<-1||t>=this._rowCount)&&(t=-1),this._rowHighlightIndex!==t){var e=this._rowHighlightIndex;this._rowHighlightIndex=t;for(var i=this._highlightedCells.length;--i>=0;)this._highlightedCells[i].removeClass("highlighted-row");if(t>=0&&t<this._rowCount){this._highlightedCells.length=this._colCount;for(var o=this._colCount;--o>=0;){var n=this._columns[o].getCell(t);this._highlightedCells[o]=n,n.addClass("highlighted-row")}var r=this.getStretchedCell(t);r&&(this._highlightedCells.push(r),r.addClass("highlighted-row"))}else this._highlightedCells.length=0;if(this._hasListener("rowHighlighted")){var s={};s.prevRowIndex=e,s.rowIndex=t,this._dispatch("rowHighlighted",s)}}},B.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},B.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},B.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},B.prototype.setSelectedRow=function(t,e){t<0||t>=this._rowCount||(this._selectionList.setSelection(t,e),this._updateSelectionUI(t))},B.prototype.selectSingleRow=function(t){t<0||t>=this._rowCount||(this.clearSelectedRows(),this._selectionList.select(t),this._addSelectionUI(t))},B.prototype.selectRowRange=function(t,e){if(!(t<0||t>=this._rowCount)){t+e>this._rowCount&&(e=this._rowCount-t),this._selectionList.selectRange(t,e);for(var i=0;i<e;++i)this._addSelectionUI(i+t)}},B.prototype.clearSelectedRows=function(){var t=this._selectionList.getSelectionCount();if(t){var e=this._selectionList.getAllSelections();this._selectionList.clearAllSelections();for(var i=0;i<t;++i)this._removeSelectionUI(e[i]);return t}return 0},B.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},B.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},B.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},B.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},B.prototype.activateColumn=function(t,e){var i=this._columns[t];if(i){var o=i.activate(e);if(e&&o&&this._rightSpace){var n=this._rightSpace.parentNode;n&&n.appendChild(this._rightSpace)}}},B.prototype.activateRows=function(){this._onEnterDocument()},B.prototype.moveRowsToTop=function(t){this._ctxRows.moveItemsToTop(t),this._stretchedCells.moveCellsToTop(t);for(var e=0;e<this._colCount;++e)this._columns[e].moveCellsToTop(t)},B.prototype.getFirstIndexInView=function(){return 0},B.prototype.getLastIndexInView=function(){return this._availableRowCount-1},B.prototype.isInCurrentView=function(t){return 0!==this._rowCount&&t>=0&&t<this._rowCount},B.prototype.getFrozenLayout=function(){return this._frozenLayout},B.prototype.setFrozenLayout=function(t){this.isVisible()||(t=!0),this._frozenLayout!==t&&(this._frozenLayout=t,this._cellSpans.freezeMapping(this._frozenLayout),this._frozenLayout||(this._syncLayoutToColumns(0),this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)))},B.prototype.getColumn=function(t){return this._columns[t]||null},B.prototype.insertColumn=function(t,e){t<0?t=0:t>this._colCount&&(t=this._colCount);var i=t<this._colCount,o=this._cellSpans.getAllSpans();this._updateCellSpans(o,!1),this._trackX.insertLane(t,e),this._colCount=this._trackX.getLaneCount();var n=this._newColumn(t);if(this._updateColumnIndices(),this._cellSpans.shiftColumn(t,1)&&(o=this._cellSpans.getAllSpans()),this._updateCellSpans(o,!0),this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._selectionList.getSelectionCount())for(var r=this._selectionList.getAllSelections(),s=r.length;--s>=0;){var l=n.getCell(r[s]);l&&l.addClass("selected-row")}return n.activate(i||!this._colVir),n},B.prototype.removeColumnAt=function(t){var e=this._trackX.removeLaneAt(t);if(null==e)return null;var i=this._cellSpans.getAllSpans();this._updateCellSpans(i,!1),this._colCount=this._trackX.getLaneCount();var o=this._columns.splice(t,1)[0];return o.dispose(),e.control=o,this._updateColumnIndices(),this._cellSpans.removeColumn(t)&&(i=this._cellSpans.getAllSpans()),this._updateCellSpans(i,!0),this._syncLayoutToColumns(t),t>=this._colCount&&this._updateCssWidth(),e},B.prototype.moveColumn=function(t,e){if(t<0)t=0;else if(t>=this._colCount)return;if(e<0?e=0:e>=this._colCount&&(e=this._colCount-1),t!==e){var i=this._cellSpans.getAllSpans();this._updateCellSpans(i,!1),this._trackX.moveLane(t,e);var n=this._columns[t];if(o.moveArrayItem(this._columns,t,e),n.getElement().offsetParent){for(var r=e+1,s=this._columns[r]||null;s&&!s.getElement().offsetParent;)s=this._columns[++r];n.insertBefore(s)}this._updateColumnIndices(),this._updateCellSpans(i,!0);var l=t<e?t:e;this._syncLayoutToColumns(l)}},B.prototype.enableRowVirtualization=function(){console.log("WARNING: This function is deprecated")},B.prototype.enableColumnVirtualization=function(t){this._colVir=!1!==t},B.prototype.getColumnIndex=function(t){if(t){if(t.stretched)return this._stretchedCells.getColumnIndex(t);for(var e=this._columns.length,i=0;i<e;++i)if(this._columns[i].getElement()===t)return i}return-1},B.prototype.getCellIndex=function(t,e){if(e){if(e.stretched)return this._stretchedCells.getRowIndex(e);var i=this._columns[t];if(i)return i.getCellIndex(e)}return-1},B.prototype.getIndex=function(){return this._index},B.prototype.setIndex=function(t){this._index=t},B.prototype.getRowOffset=function(){return this._rowOffset},B.prototype.setRowOffset=function(t){this._rowOffset=t},B.prototype.updateLayout=function(){this._calculateViewSize(!0),this._stretchedCells.updateCells(),this._updateRightSpaceStyle()},B.prototype.stretchCell=function(t,e,i,o){var n=-1;if("number"==typeof t?(n=t,null==e&&(e=0)):t&&(t.stretched?(n=this._stretchedCells.getColumnIndex(t),null==e&&(e=this._stretchedCells.getRowIndex(t))):t.getParent&&(n=this.getColumnIndex(t.getParent()))),n<0||e<0||null==e)return null;var r=null;if(!1!==i){var s=this._coverLayer;s||((s=this._coverLayer=document.createElement("div")).className="cover-layer",this._updateLayers()),this._calculateViewSize(),(r=this._stretchedCells.stretchCell(e,o?n:0)).setParent(s)}else r=this._stretchedCells.unstretchCell(e);if(r){var l=this._selectionList.getSelection(e);r.enableClass("selected-row",l)}return r},B.prototype.unstretchCell=function(t,e){return this.stretchCell(t,e,!1)},B.prototype.unstretchAllCells=function(){this._stretchedCells.unstretchAllCells()},B.prototype.getStretchedCell=function(t,e){return null==e&&(e="number"==typeof t?t:this._stretchedCells.getRowIndex(t)),"number"==typeof e?this._stretchedCells.getCell(e):null},B.prototype.getStretchedCells=function(){return this._stretchedCells.getCells()},B.prototype.updateStretchedCells=function(){this._updateLayers();var t=this._coverLayer?this._coverLayer.children.length:0;return!(t<=0||(this._calculateViewSize(!0),this._stretchedCells.updateCells(),!t))},B.prototype._calculateViewSize=function(t){if(this._frozenLayout)return this._stretchedCells.getStretchSize();var e=this._ctx,i=t?0:this._stretchedCells.getStretchSize();if(!i&&e&&e.getWidth){var o=this.getContentWidth();return(i=e.getWidth())?(o<i&&(i=o),this._stretchedCells.setStretchSize(i),i):o}return i},B.prototype._enableStretchCellClass=function(t,e,i){var o=this.getStretchedCell(t);o&&o.enableClass(e,i)},B.prototype._getViewSize=function(){return this._calculateViewSize()},B.prototype.getColumnHost=function(){return this._element},B.prototype.setHidingMethod=function(t){this._hidingMethod=t},B.prototype.getHidingMethod=function(){return this._hidingMethod},B.prototype.setColumnVisibility=function(t,e,i){return!!this._trackX.hideLane(t,!e,i)&&(this._syncLayoutToColumns(t),!0)},B.prototype.getRowLayout=function(){return this._trackY},B.prototype.reserveRightSpace=function(t){if(t&&t>0){if(!this._rightSpace){var e=this._rightSpace=document.createElement("div");e.className="tr-reserved-space",e.style.height=this.getContentHeight()+"px",this._updateLayers()}this._rightSpace.style.width=t+"px",this._rightSpaceSize=t,this._updateCssWidth()}else if(this._rightSpace){var i=this._rightSpace.parentNode;i&&i.removeChild(this._rightSpace),this._rightSpace=null,this._rightSpaceSize=0,this._updateCssWidth()}return this._rightSpace},B.prototype._updateRightSpaceStyle=function(){var t=this._rightSpace;if(t){var e=!1,i=0;this._hscrollbar&&(e=this._hscrollbar.isActive(),i=this._hscrollbar.getPinnedRightColumnCount()),e&&!i?(t.style.top=this._trackY.getLaneStart(this._activeRow)+"px",t.style.left=this._trackX.getLaneStart(this._colCount)+"px",t.style.position="",t.style.display=""):(t.style.position="static",t.style.display="inline-block")}},B.prototype._updateLayers=function(){if(this._rightSpace){var t=this._rightSpace.parentNode;t?t.appendChild(this._rightSpace):this._element.appendChild(this._rightSpace)}this._boundLayer&&this._element.appendChild(this._boundLayer),this._coverLayer&&this._element.appendChild(this._coverLayer)},B.prototype.getReservedSpace=function(){return this._rightSpace},B.prototype.getComputedStyle=function(){var t=this._element;return t.offsetParent?getComputedStyle(t):null},B.prototype.isColumnActive=function(t){var e=this._columns[t];return!!e&&e.isActive()},B.prototype.setRowAttributes=function(t,e){if(!(t<0||t>=this._rowCount))for(var i=0;i<this._colCount;++i)for(var o=e(i),n=o.length;--n>=0;){var r=o[n],s=this._columns[i].getCell(t);s&&(r.remove?s.removeAttribute(r.attribute):s.setAttribute(r.attribute,r.value))}},B.prototype.getContextRow=function(t){return this._ctxRows.getItem(t)},B.prototype.selectColumn=function(t,e){this.enableColumnClass(t,"selected-column",e),e&&(this._colSelDirty=!0,this._boundLayer||(this._initBoundLayer(),this._updateLayers()))},B.prototype.isSelectedColumn=function(t){return this.hasColumnClass(t,"selected-column")},B.prototype.selectCell=function(t,e,i){var o=this._getCell(t,e);o&&o.enableClass("selection",i)},B.prototype.setCellBounds=function(t,e,i,o){},B.prototype.getHorizontalLayout=function(){return this._trackX},B.prototype.calculateColumnBounds=function(t,e,i,o){var n=0,r=0,s=!1,l=!1,a=this._trackX.getLaneCount();if(t>=0&&(n=this._trackX.getLaneStart(t),r=this._trackX.getLaneEnd(e)),n<r){var h,u,p=0,_=0,c=0,d=0;this._hscrollbar&&(_=this._hscrollbar.getScrollLeft(),c=this._hscrollbar.getPinnedLeftColumnCount(),d=this._hscrollbar.getPinnedRightColumnCount()),h=u=this._trackX.getTrackSize(),c&&(p=this._trackX.getLaneStart(c)),d&&(a-=d,h=this._getViewSize()-u+this._trackX.getLaneStart(a)),t>=c&&t<a?(n-=_)<p?(n=p,s=!0):n>h&&(n=h,s=!0):t>=a&&(n=this._getViewSize()-u+this._trackX.getLaneStart(t)),e>=c&&e<a?(r-=_)<p?(r=p,l=!0):r>h&&(r=h,l=!0):e>=a&&(r=this._getViewSize()-u+this._trackX.getLaneEnd(e))}i[0]=n,i[1]=r,o[0]=s,o[1]=l},B.prototype.updateColumnBounds=function(t,e,i){if(this._colSelDirty){var o=this._colBounds,n=this._colBoundCache;o||(o=this._colBounds=[]),n||(n=this._colBoundCache=[]);var r,s=t.length,l=null,a=null,h=o.length;for(r=s;r<h;++r)(l=(a=o[r]).parentNode)&&l.removeChild(a);if(o.length=h=s,s)for(r=0;r<s;++r){var u=t[r],p=e[r],_=u[0],c=u[1];(a=n[r])||((a=n[r]=document.createElement("div")).className="selection-bound column-bound"),a.style.left=_+"px",a.style.width=c-_+"px",i=i||0,a.style.top=i+"px",a.style.height=this._trackY.getTrackSize()-i+"px",a.classList.toggle("no-left-bound",p[0]),a.classList.toggle("no-right-bound",p[1]),this._boundLayer&&(o[r]||(o[r]=a,this._boundLayer.appendChild(a)))}else this._colSelDirty=!1}},B.prototype.updateColumnSeparators=function(){var t=this._hscrollbar.getPinnedLeftColumnCount(),e=this._hscrollbar.getPinnedRightColumnCount();!t&&!e||this._boundLayer||this._initBoundLayer();var i=!1;this._hscrollbar&&(i=this._hscrollbar.isActive());var o=this._boundLayer,n=this._leftColumnSeparator;if(i&&t){n||(n=this._leftColumnSeparator=this._createColumnSeparator()),n.parentNode||(o.children.length?o.insertBefore(n,o.children[0]):o.appendChild(n));var r=this._trackX.getLaneStart(t);n.style.left=r-1+"px",n.style.height=this._trackY.getTrackSize()+"px"}else n&&n.parentNode&&this._boundLayer.removeChild(n);if(n=this._rightColumnSeparator,i&&e){n||(n=this._rightColumnSeparator=this._createColumnSeparator()),n.parentNode||(o.children.length?o.insertBefore(n,o.children[0]):o.appendChild(n));var s=this.getColumnCount(),l=this._trackX.getLaneEnd(s-1)-this._trackX.getLaneStart(s-e),a=this._getViewSize();n.style.left=a-l-this._rightSpaceSize+"px",n.style.height=this._trackY.getTrackSize()+"px"}else n&&n.parentNode&&this._boundLayer.removeChild(n)},B.prototype._createColumnSeparator=function(){var t=document.createElement("div");return t.classList.add("column-separator"),t},B.prototype._initBoundLayer=function(){var t=this._boundLayer;return t||((t=this._boundLayer=document.createElement("div")).className="cover-layer",this._element.appendChild(t)),t},B.prototype._getCell=function(t,e){var i=this._columns[t];return i?i.getCell(e):null},B.prototype._insertCells=function(t,e){this._activeRow=t,this._activeRowEnd=e;for(var i=this._trackY.getLaneStart(t),o=0;o<this._colCount;++o){var n=this._columns[o];n.hasCollapsedCells()||n.setTop(i),n.activateCells(t,e)}if(this._rightSpace&&(this._rightSpace.style.top=i+"px"),e>this._availableRowCount){var r={};r.prevRowIndex=this._availableRowCount,r.rowIndex=e,this._availableRowCount=e,this._dispatch("rowAvailable",r)}},B.prototype._newColumn=function(t){var e=new w(this._virOwner||this);e.setHeight(this._trackY.getDefaultLaneSize()),e.setCellCount(this._rowCount),e.setTop(this._trackY.getLaneStart(this._activeRow)),e.activateCells(this._activeRow,this._activeRowEnd);for(var i=0;i<this._rowCount;++i)this._trackY.isAtDefaultSize(i)||e.getCell(i).setHeight(this._trackY.getLaneSize(i));if(t>=this._columns.length)this._columns.push(e),e.setParent(this._element);else{this._columns.splice(t,0,e);var o=this._columns[t+1];e.insertBefore(o)}return e},B.prototype._updateCssWidth=function(){this._frozenLayout||(this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._element.style.width=this._getWidth()+"px")},B.prototype._updateViewHeight=function(){if(!this._frozenLayout){var t=this.getContentHeight();this._element.style.height=t+"px",this._rightSpace&&(this._rightSpace.style.height=t+"px")}},B.prototype._updateColumnIndices=function(){var t=this._columns.length,e=this._columns[0];e!==this._firstColumn&&(this._firstColumn&&this._firstColumn.removeClass("first"),this._firstColumn=e,this._firstColumn&&this._firstColumn.addClass("first"));var i=this._columns[t-1];i!==this._lastColumn&&(this._lastColumn&&this._lastColumn.removeClass("last"),this._lastColumn=i,this._lastColumn&&this._lastColumn.addClass("last"));for(var o=null,n=this._columns.length;--n>=0;){var r=this._columns[n];r.setNextSibling(o),o=r}},B.prototype._syncLayoutToColumns=function(t){if(this._frozenLayout)return!1;if(this._rightSpace&&(this._rightSpace.style.left=this._trackX.getLaneStart(this._colCount)+"px"),t>=this._colCount)return!1;for(var e=t;e<this._colCount;++e){var i=this._columns[e];i.setLeft(this._trackX.getLaneStart(e)),i.setWidth(this._trackX.getLaneSize(e))}return this._updateCellSpanLayout(this._cellSpans.getAllSpans()),this._updateCssWidth(),!0},B.prototype._syncLayoutToRows=function(t,e){if(!this._frozenLayout){for(var i=t;i<e;++i)for(var o=this._trackY.isAtDefaultSize(i)?-1:this._trackY.getLaneSize(i),n=0;n<this._colCount;++n)this._columns[n].getCell(i).setHeight(o);this._stretchedCells.updateYAxis(),t?this._updateCellSpanLayout(this._cellSpans.getAllSpans()):this._updateCellSpans(this._cellSpans.getAllSpans(),!0),this._updateViewHeight()}},B.prototype._dispatchRowHeightChangedEvent=function(t,e){if(this._hasListener("rowHeightChanged")&&!(t>=e)){var i={};i.rowIndex=t,i.changeLength=e-t,this._dispatch("rowHeightChanged",i)}},B.prototype._updateCellSpanSize=function(t,e,i){var o=this._getCell(t,e);if(null!=o)if(i&&i.colSpan>1?(o.setWidth(this.getCellWidth(t,e)),this._columns[t].disableDeactivation()):o.setWidth(-1),i&&i.rowSpan>1)o.setHeight(this.getCellHeight(t,e));else{var n=this._trackY.isAtDefaultSize(e)?-1:this._trackY.getLaneSize(e);o.setHeight(n)}},B.prototype._updateCellSpanLayout=function(t){if(null!=t)for(var e=t.length;--e>=0;){var i=t[e];this._updateCellSpanSize(i.indexX,i.indexY,i)}},B.prototype._updateCellSpan=function(t,e,i,o){this._updateCellSpanSize(t,e,o?i:null),this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,o)},B.prototype._updateCellSpanClass=function(t,e,i,o,n){for(var r,s=0;s<i&&(r=this._columns[t+s]);++s)r.collapseCells(e,o,n,0===s,s>0);var l=this._getCell(t,e);l&&(l._colSpan=n?i:1,l._rowSpan=n?o:1)},B.prototype._updateCellSpans=function(t,e){if(null!=t)for(var i=t.length;--i>=0;){var o=t[i];this._updateCellSpan(o.indexX,o.indexY,o,e)}},B.prototype._onMouseMove=function(t){var e=t.target,i=o.closestElement(e,"cell"),n=this._stretchedCells.getColumnIndex(i);if(n<0){var r=o.closestElement(e,"column");n=this.getColumnIndex(r)}var s=this.getCellIndex(n,i);this.setRowHighlight(s)},B.prototype._onMouseOut=function(t){var e=t.relatedTarget;if(e)for(var i=this._element;null!==e.parentNode;)if((e=e.parentNode)===i)return;this.setRowHighlight(-1)},B.prototype._updateSelectionUI=function(t){var e=this._selectionList.getSelection(t);this._enableStretchCellClass(t,"selected-row",e),this.enableRowClass(t,"selected-row",e)},B.prototype._addSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!0),this.enableRowClass(t,"selected-row",!0)},B.prototype._removeSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!1),this.enableRowClass(t,"selected-row",!1)},B.prototype._onEnterDocument=function(){if(!this._initialized&&this.getParent()){for(var t=0;t<this._colCount;++t)this._columns[t].enableAutoStyleUpdating();this._syncLayoutToColumns(0),this._initialized=!0}},B.prototype._setContext=function(t){this._ctx=t},B.prototype._getContext=function(){return this._ctx},B.prototype._resetTransformIETimer=function(){o.isIE&&(this._transformIETimer||(this.enableClass("reset-transform"),this._transformIETimer=setTimeout(this._onResetTransformIE,20)))},B.prototype._onResetTransformIE=function(){this._transformIETimer=0,this.enableClass("reset-transform",!1)},B._proto=B.prototype;const N=B;var W=function(t){for(var e in t)return!1;return!0},Y=function(t,e,i){var o=e[i];if(null!=o){var n=t[i];Array.isArray(n)?t[i]=n.concat(o):Array.isArray(o)&&n?t[i]=o.concat(n):t[i]=o}},X=function(){this._groupMap={},this._childToParent={}};X.prototype._groupMap,X.prototype._childToParent,X.getGroupId=function(t){return t&&t.id||""},X.calcTreeDepth=function(t,e){for(var i=-1,o=e;o;){if(++i>15){console.log("WARNING: Infinite loop detected during column group creation");break}o=t[o.parentId]}return i},X.getLeafDescendants=function(t,e){var i=t[e];if(!i)return null;for(var o=[],n=[i],r=0,s={};r<n.length;){s[(i=n[r++]).id]=!0;for(var l=i.children,a=l?l.length:0,h=0;h<a;++h){var u=l[h];(i=t[u])?s[i.id]||n.push(i):o.push(u)}}return o},X._cloneObject=function(t){var e=function(t,e){return function(t,e,i){if(!t)return null;if(!e||t===e)return t;var o;if(i)for(var n=i.length,r=0;r<n;++r)(o=i[r])&&Y(t,e,o);else for(o in e)Y(t,e,o);return t}({},t,e)}(t);return Array.isArray(e.children)?e.children=e.children.slice():e.children=[],e},X._toGroupDefinition=function(t,e){var i=null;return t&&(i=Array.isArray(t)?{children:t.slice()}:X._cloneObject(t),e&&(i.id||(i.name=e),i.id=e)),i},X.prototype.toString=function(){var t=this._groupMap,e=[];for(var i in e.push("=== groupDefs ==="),t){var o=t[i];e.push(i+": "+JSON.stringify(o,["id","parentId","children"]))}return e.push("=== childToParent ==="),e.push(JSON.stringify(this._childToParent,null,2)),e.push(""),e.join("\n")},X.prototype.getGroup=function(t){return t&&this._groupMap[t]||null},X.prototype.getDefinition=X.prototype.getGroup,X.prototype.getGroups=function(){var t=[],e=this._groupMap;for(var i in e)t.push(e[i]);return t},X.prototype.getGroupIds=function(){return Object.keys(this._groupMap)},X.prototype.getGroupMap=function(){return this._groupMap},X.prototype.cloneGroupMap=function(){var t=this._groupMap,e={};for(var i in t){var o=t[i],n=X._cloneObject(o);e[i]=n}return e},X.prototype.rebuildMap=function(){var t,e,i=this._groupMap,o=this._childToParent={},n=Object.keys(i),r=n.length;for(t=0;t<r;++t)for(var s=i[e=n[t]].children,l=s?s.length:0,a=0;a<l;a++)o[s[a]]=e;for(t=0;t<r;++t){var h=o[e=n[t]];h&&(i[e].parentId=h)}},X.prototype.getGroupChildren=function(t){var e=this._groupMap[t];return e?e.children:null},X.prototype.getLeafDescendants=function(t){return X.getLeafDescendants(this._groupMap,t)},X.prototype.getGroupLevel=function(t){return X.calcTreeDepth(this._groupMap,this._groupMap[t])},X.prototype.getRootGroup=function(t){if(!t)return null;var e=this._groupMap,i=e[t]||null;if(i)for(;i.parentId;){var o=e[i.parentId];if(!o)break;i=o}return i},X.prototype.getParentGroup=function(t){return this.getGroup(this._childToParent[t])},X.prototype.getParentIds=function(t){if(t&&"string"==typeof t){var e=this._childToParent[t];if(e){for(var i=[e],o=this._groupMap[e];o&&o.parentId;)(o=this._groupMap[o.parentId])&&i.push(o.id);return i}}return null},X.prototype.getParentId=function(t,e){var i=this._childToParent[t];if(null!=e)for(var o=this.getGroupLevel(i);o>e&&i;)i=this._childToParent[i],o--;return i||""},X.prototype.removeAllGroups=function(){for(var t in this._groupMap)return this._groupMap={},this._childToParent={},!0;return!1},X.prototype.setGroups=function(t){for(var e=this._groupMap={},i=t?t.length:0,o=0;o<i;o++){var n=t[o],r=n.id;r&&(e[r]=X._cloneObject(n))}this.rebuildMap()},X.prototype.addGroup=function(t){var e=X.getGroupId(t);return e?this.setGroup(e,t):e},X.prototype.removeGroup=function(t){return!!this._groupMap[t]&&(this.removeAllChildren(t),this.unsetParent(t),delete this._groupMap[t],!0)},X.prototype.setGroup=function(t,e){if(!t)return"";if(e){var i=X._toGroupDefinition(e,t);this._ungroupChildren(i.children),this._groupMap[t]&&this.removeAllChildren(t);var o=this._childToParent[t];o&&(i.parentId=o.id),this._groupMap[t]=i;for(var n=i.children,r=n.length,s=0;s<r;++s){var l=n[s];this._childToParent[l]=t;var a=this._groupMap[l];a&&(a.parentId=t)}}else if(!this.removeGroup(t))return"";return t},X.prototype._ungroupChildren=function(t){if(Array.isArray(t))for(var e=t.length,i=0;i<e;++i)this.unsetParent(t[i])},X.prototype.hasGroupChild=function(t,e){var i=this._groupMap[t];if(e&&i){var o=i.children;if(o)return o.indexOf(e)>=0}return!1},X.prototype.contains=function(t,e){if(t&&e){if(t===e)return!0;for(var i=20,o=this._childToParent[e];o&&i;){if(t===o)return!0;--i,o=this._childToParent[o]}}return!1},X.prototype.addGroupChild=function(t,e,i){var o=this._groupMap[t];if(e&&o){var n=o.children;if(n&&n.indexOf(e)<0){this.unsetParent(e),this._childToParent[e]=t;var r=this._groupMap[e];return r&&(r.parentId=t),null!=i&&i>=0?n.splice(i,0,e):n.push(e),!0}}return!1},X.prototype.removeGroupChild=function(t,e){return null==e?this.unsetParent(t):!!this.hasGroupChild(t,e)&&this.unsetParent(e)},X.prototype.unsetParent=function(t){var e=this._childToParent[t];if(!e)return!1;this._childToParent[t]="";var i=this._groupMap[t];i&&(i.parentId="");var o=this._groupMap[e];if(o){var n=o.children;if(n&&n.length){var r=n.indexOf(t);r>=0&&n.splice(r,1)}}return!0},X.prototype.removeAllChildren=function(t){var e=this._groupMap[t];if(e){var i=e.children,o=i?i.length:0;if(o){e.children=[];for(var n=0;n<o;++n){var r=i[n];this._childToParent[r]&&(this._childToParent[r]="");var s=this._groupMap[r];s&&(s.parentId="")}return!0}}return!1},X.prototype.setGroupChildren=function(t,e){var i=this._groupMap[t];if(i){if(Array.isArray(e)){var o=e.slice();this._ungroupChildren(o),this.removeAllChildren(t),i.children=o;for(var n=i.id,r=o.length,s=0;s<r;++s){var l=o[s];this._childToParent[l]=n;var a=this._groupMap[l];a&&(a.parentId=n)}return!0}if(!e&&i.children.length)return this.removeAllChildren(t),!0}return!1},X.prototype.getGroupName=function(t){var e=this._groupMap[t];return e&&e.name||""},X.prototype.setGroupName=function(t,e){var i=this._groupMap[t];return!(!i||i.name===e||(i.name=e,0))};var q=function(){var t=this;t._rows={},t._subs={},t._staticFields={},t._onInsert=t._onInsert.bind(t),t._onUpdate=t._onUpdate.bind(t),t._onDelete=t._onDelete.bind(t),t._onBatchRequestADCData=t._onBatchRequestADCData.bind(t),t._onADCUpdate=t._onADCUpdate.bind(t),t._onADCError=t._onADCError.bind(t),t._onQ2DataChanged=t._onQ2DataChanged.bind(t),t._onQ2SubAdded=t._onQ2SubAdded.bind(t),t._onQ2SubRemoved=t._onQ2SubRemoved.bind(t),t._addEvent("dataComposed"),t._addEvent("dataChanged")};u.inherits(q,l),q.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._quotes2=null},q.prototype.setSubscriptions=function(t){this._quotes2&&(this._quotes2.removeEventListener("dataChanged",this._onQ2DataChanged),this._quotes2.removeEventListener("subscriptionAdded",this._onQ2SubAdded),this._quotes2.removeEventListener("subscriptionRemoved",this._onQ2SubRemoved)),this._quotes2=t,this._quotes2&&(this._quotes2.addEventListener("dataChanged",this._onQ2DataChanged),this._quotes2.addEventListener("subscriptionAdded",this._onQ2SubAdded),this._quotes2.addEventListener("subscriptionRemoved",this._onQ2SubRemoved))},q.prototype.getSubscriptions=function(){return this._quotes2},q.prototype.addSubscription=function(t,e,i){if(!this.getSubscription(t.id)){var o={s:t,rics:{}};this._subs[t.id]=o,this._quotes2||(t.onNewRow(this._onInsert),t.onUpdate(this._onUpdate),t.onRemoveRow(this._onDelete)),e&&(o.primary=e,i||(i={}),this._onInsert(t,e,i))}},q.prototype.removeSubscription=function(t){var e=t.id;if(t&&this._subs[e]){this._quotes2||t.stop();var i=this._subs[e].rics;for(var o in i)this.setRowData(e+o,null);delete this._subs[e]}},q.prototype.startAllSubscriptions=function(){if(this._quotes2)this._quotes2.start();else for(var t in this._subs)this._subs[t].s.start()},q.prototype.stopAllSubscriptions=function(){if(this._quotes2)this._quotes2.stop();else for(var t in this._subs)this._subs[t].s.stop()},q.prototype.getSubscription=function(t){return this._subs[t]?this._subs[t].s:null},q.prototype.getPrimaryRic=function(t){var e=this._subs[t];return e?e.primary:""},q.prototype.clearAllData=function(t){this._quotes2?this._quotes2.removeAllSubscriptions():this.stopAllSubscriptions(),this._subs={},this._rows={},this._adcTimerId>=0&&(clearTimeout(this._adcTimerId),this._adcTimerId=-1),this._adcRicMap=null,t||this._dispatchDataChange({globalChange:!0})},q.prototype.clearColumnData=function(t,e){for(var i="string"==typeof t?[t]:t,o=i.length;--o>=0;){var n=i[o];if(n)for(var r in this._rows)delete this._rows[r][n]}e||this._dispatchDataChange({globalChange:!0})},q.prototype.getData=function(t,e){var i=this.getRowData(t);return i?i[e]:null},q.prototype.getAllRics=function(){var t={};for(var e in this._subs){var i=this._subs[e].rics;for(var o in i)t[o]||(t[o]=[]),t[o].push(e)}return t},q.prototype.getAllRowIds=function(){var t=[];for(var e in this._rows)t.push(e);return t},q.prototype.hasRowId=function(t){return!!this._rows[t]},q.prototype.getColumnData=function(t){var e=[];for(var i in this._rows)e.push(this._rows[i][t]);return e},q.prototype.getRowData=function(t){return this._rows[t]||null},q.prototype.getMultipleRowData=function(t,e,i){var o=t.length;null==i&&(i=o),i>o&&(i=o),e>0||(e=0);for(var n=new Array(o),r=this._rows,s=e;s<i;++s)n[s]=r[t[s]]||null;return n},q.prototype.getAllRowData=function(){var t=[],e=this._rows;for(var i in e)t.push(e[i]);return t},q.prototype.setData=function(t,e,i){var o={};return o[e]=i,this.setRowData(t,o)},q.prototype.hasDataCloudData=function(t){if(!this._adcFields)return!1;var e=this.getRowData(t);if(!e)return!1;for(var i=this._adcFields.length;--i>=0;)if(null!=e[this._adcFields[i]])return!0;return!1},q.prototype.setRowData=function(t,e,i){var o=this.getRowData(t),n=!1,r=null;if(e)if(o){for(var s in e)o[s]=e[s],n=!0;r=e}else o=e,this._rows[t]=o,n=!0;else o&&(delete this._rows[t],n=!0);if(n&&!this._composing){var l=i||{};l.rid=t,r&&(l.changes=r),l.rowData=o,this._dispatchDataChange(l)}return n},q.prototype.cloneRowData=function(t){var e=this._rows[t];if(!e)return null;var i={};for(var o in e)0!==o.indexOf("FREE_TEXT")&&(i[o]=e[o]);return i},q.prototype.addStaticFields=function(t){if(Array.isArray(t))for(var e in t)this._staticFields[t[e]]?this._staticFields[t[e]]++:this._staticFields[t[e]]=1},q.prototype.removeStaticFields=function(t){if(Array.isArray(t))for(var e in t)this._staticFields[t[e]]&&(this._staticFields[t[e]]--,0===this._staticFields[t[e]]&&delete this._staticFields[t[e]])},q.prototype.resetStaticFields=function(){this._staticFields={}},q.prototype.getStaticFields=function(){return this._staticFields},q.prototype.dump=function(t){return q.constructTable(this.getAllRowData(),t,Object.keys(this._rows))},q.prototype.log=function(t){console.table(this.dump(t))},q.prototype.setDataCloudSettings=function(t,e,i,o){null!=t&&(this._userId=t),null!=e&&(this._productId=e),null!=i&&(this._adcUrl=i),o&&(this._lang=o)},q.prototype.getDataCloudFields=function(){return this._adcFields},q.prototype.addDataCloudFields=function(t){this._adcFields||(this._adcFields=[],this._adcRefMap={});var e=[];if(t instanceof Array)for(var i=t.length;--i>=0;)this._addDataCloudField(t[i],e);else this._addDataCloudField(t,e);if(e.length<=0)return!1;var o=this.getAllRics();return this._batchRequestDataCloud(o,e),!0},q.prototype.removeDataCloudField=function(t){if(!this._adcFields)return!1;if(!this._adcRefMap[t])return!1;if(--this._adcRefMap[t],!this._adcRefMap[t]){var e=this._adcFields.indexOf(t);this._adcFields.splice(e,1),this.clearColumnData(t)}return!0},q.prototype._dispatchDataChange=function(t){this._composing||(this._composing=!0,this._dispatch("dataComposed",t),this._composing=!1,this._dispatch("dataChanged",t))},q._defaultPropertyGetter=function(t,e,i){var o=e[i];return o?o[t]:null},q._defaultGetter=function(t,e){return t[e]},q.constructTable=function(t,e,i){var o=0,n=t.length,r=n,s=null,l=i||null,a=q._defaultGetter,h=!1;if(e){if(e.rowCount&&(r=e.rowCount,h=!0),e.colNames){s={};for(var u=e.colNames.length,p=0;p<u;++p)s[e.colNames[p]]=!0;h=!0}e.getter&&(a="string"==typeof e.getter?q._defaultPropertyGetter.bind(null,e.getter):e.getter,h=!0),e.startIndex&&(o=e.startIndex,h=!0),!1===e.withRowIds&&(l=null)}if(!h&&!l)return t;for(var _=[],c=o;c<n&&!(_.length>=r);++c){var d,g=t[c],f=l?{rid:l[c]}:{};if(g)if(s)for(d in s)null!=g[d]&&(f[d]=a(g,d));else for(d in g)f[d]=a(g,d);_.push(f)}return _},q.prototype._insertRic=function(t,e,i){var o=t+(e=e.replace("0#",""));this._onADCForNewRic(t,e);var n=this.getRowData(o);if(n){var r=n.ROW_DEF;r&&r.isChain()&&(i.SUB_ID=t)}else{var s=i;for(var l in i={},s)i[l]=s[l];i.SUB_ID=t,i.RIC=e}this.setRowData(o,i)},q.prototype._onQ2DataChanged=function(t){var e=t.subId,i=t.ric,o=t.values;o?this._insertRic(e,i,o):(delete this._subs[e].rics[i],this.setRowData(e+i,null))},q.prototype._onQ2SubAdded=function(t){for(var e=t.subs,i=t.duplicateSubIds,o=e.length,n=0;n<o;++n){var r=e[n],s=r.ric;if(!(r.id.indexOf("_ci_")>=0)&&(this.addSubscription(r,s),i)){var l=i[n];l&&window.setTimeout(this._onDuplicateRic.bind(this,r.id,this.getRowData(l+s)),10)}}},q.prototype._onQ2SubRemoved=function(t){for(var e=t.subs,i=e.length,o=0;o<i;++o){var n=e[o];n.id.indexOf("_ci_")>=0||this.removeSubscription(n)}},q.prototype._onADCForNewRic=function(t,e){var i=this._subs[t];i&&(this._adcFields&&(i.rics[e]||(this._adcTimerId<0&&(this._adcRicMap={},this._adcTimerId=setTimeout(this._onBatchRequestADCData,100)),this._adcRicMap[e]||(this._adcRicMap[e]=[]),this._adcRicMap[e].push(t))),i.rics[e]=!0)},q.prototype._onDuplicateRic=function(t,e){var i=this._subs[t];if(i){var o=(i=i.s).ric,n=e.SUB_ID,r=this._cloneRowData(e,o,t);if(r){this._onInsert(i,o,r);var s=i.children;if(s)for(var l=s.length,a=0;a<l;++a)o=s[a],r=this._cloneRowData(n,o,t),this._onInsert(i,o,r)}}},q.prototype._onInsert=function(t,e,i){var o=t.id;this._quotes2?this._insertRic(o,e,i):(this._onADCForNewRic(o,e),this.setRowData(o+e,i,{subscription:t,ric:e}))},q.prototype._onUpdate=q.prototype._onInsert,q.prototype._onDelete=function(t,e,i){delete this._subs[t.id].rics[e],this.setRowData(t.id+e,null,{subscription:t,ric:e})},q.prototype._addDataCloudField=function(t,e){this._adcRefMap[t]?++this._adcRefMap[t]:(this._adcFields.push(t),e.push(t),this._adcRefMap[t]=1)},q.prototype._onADCUpdate=function(t){var e=t.currentTarget,i=null;try{i=JSON.parse(e.responseText)}catch(t){return}if("Ok"===i.status){for(var o=i.cols,n=i.rows,r=n[0],s=-1,l={},a=0;a<o;++a){var h=r[a];"instrument"===h.i?s=a:h.r&&(l[h.r]=a)}for(var u=n.length,p=1;p<u;++p){var _=n[p],c=_[s],d={};for(var g in l){var f=_[l[g]];null!=f&&null!==f&&null==f.f&&(this._quotes2?(d[g]=f,d[g+"_FORMATTED"]=f):d[g]={formatted:f+"",raw:f})}var y=e.ricMap[c];if(y)for(a=y.length;--a>=0;){var m=y[a];this._subs[m]&&this.setRowData(m+c,d)}}}},q.prototype._onADCError=function(t){window.console.log(t)},q.prototype._onBatchRequestADCData=function(t){this._adcTimerId<=0||(this._adcTimerId=-1,this._batchRequestDataCloud(this._adcRicMap,this._adcFields),this._adcRicMap=null)},q.prototype._batchRequestDataCloud=function(t,e){if(!this._adcUrl)return null;var i=[];for(var o in t)i.push(o);for(;i.length>30;)this._requestDataCloud(t,e,i.splice(0,30));return this._requestDataCloud(t,e,i)},q.prototype._requestDataCloud=function(t,e,i){if(!i||i.length<=0)return null;if(!e||e.length<=0)return null;var o=new XMLHttpRequest;o.onload=this._onADCUpdate,o.onerror=this._onADCError,o.ricMap=t,o.open("POST",this._adcUrl,!0),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var n="formula="+e+"&identifiers="+i;return this._productId&&(n+="&productid="+this._productId),this._userId&&(n+="&uuid="+this._userId),this._lang&&(n+="&lang="+this._lang),o.send(n),o},q.prototype._cloneRowData=function(t,e,i){var o="string"==typeof t?t:t.SUB_ID,n=this._rows[o+e];if(!n){if("object"!=typeof t)return null;n=t}var r={};for(var s in n)null==this._staticFields[s]&&(r[s]=n[s]);return r.SUB_ID=i,r},q.prototype._rows,q.prototype._subs,q.prototype._quotes2=null,q.prototype._staticFields=null,q.prototype._adcFields=null,q.prototype._adcRefMap=null,q.prototype._adcTimerId=-1,q.prototype._adcRicMap=null,q.prototype._adcUrl="/datacloud/rest/select",q.prototype._userId="",q.prototype._productId="",q.prototype._composing=!1,q.prototype._lang="",q._proto=q.prototype;const U=q;var j=function(){};j.prototype._events=null,j.prototype._listenerCount=0,j.prototype.addEventListener=function(t,e){if(t&&e){this._events||(this._events={});var i=this._events[t];i?i.indexOf(e)<0&&(i.push(e),++this._listenerCount):(this._events[t]=[e],++this._listenerCount)}},j.prototype.removeEventListener=function(t,e){var i=this._events?this._events[t]:null;if(i){var o=i.indexOf(e);o>=0&&(i.splice(o,1),--this._listenerCount)}},j.prototype.removeAllEventListeners=function(){this._events=null,this._listenerCount=0},j.prototype.hasListener=function(t){if(this._listenerCount){if(t){var e=this._events?this._events[t]:null;return!!e&&e.length>0}return!0}return!1},j.prototype.getListener=function(t,e){if(t){var i=this._events?this._events[t]:null;if(i)return e||(e=0),i[e]||null}return null},j.prototype.addListener=function(t,e){var i=t?t[e]:null;"function"==typeof i&&this.addEventListener(e,i)},j.prototype._prepareEventArguments=function(t,e){return e},j.prototype._dispatch=function(t,e){var i=this._events?this._events[t]:null;if(i){e=this._prepareEventArguments(t,e);for(var o=i.length,n=0;n<o;++n)i[n](e)}},j.preventDefault=function(t){t&&t.preventDefault&&(t.preventDefault(),t.stopPropagation())};const K=j;var Q=function(t,e){this._rid=t,this._children={},this._shared=e};u.inherits(Q,K),Q._subSegSortLogic=function(t,e){return"Uncategorized"===t?1:"Uncategorized"===e||t<e?-1:e<t?1:0},Q._assignSubSegmentOrder=function(t,e){t.setOrder(e+1)},Q.prototype._shared=null,Q.prototype._rid,Q.prototype._children,Q.prototype._childCount=0,Q.prototype._collapsed=!1,Q.prototype._order=0,Q.prototype._disposed=!1,Q.prototype._subSegDef=null,Q.prototype._subSegLevel=0,Q.prototype._subSegMap=null,Q.prototype._subSegNames=null,Q.prototype._subSegName="",Q.prototype._subSegVal,Q.prototype._subSegParent=null,Q.prototype.dispose=function(){if(!this._disposed){this._disposed=!0,this.removeAllEventListeners();var t=this._subSegNames;if(t){for(var e=t.length,i=this._subSegMap,o=0;o<e;++o)i[t[o]].dispose();this._subSegMap=this._subSegNames=null}this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._shared=null,this._subSegParent=this._subSegDef=this._subSegVal=null}},Q.prototype.getId=function(){return this._rid},Q.prototype.getParentId=function(){return this._subSegParent?this._subSegParent.getId():""},Q.prototype.getSubSegmentIds=function(t){var e=this._subSegNames;if(e){t||(t=[]);for(var i=e.length,o=this._subSegMap,n=0;n<i;++n){var r=o[e[n]];t.push(r.getId()),r.getSubSegmentIds(t)}return t}return null},Q.prototype.addChild=function(t,e){return!(!t||(this._shared.childToSegment[t]=this._rid,this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._children[t])||(this._children[t]=e||t,++this._childCount,0))},Q.prototype.addChildren=function(t,e){var i,o=Array.isArray(t)?t:[t],n=o.length,r=0;if(null!=e)for(e=Array.isArray(e)?e:[e],i=0;i<n;++i)r|=this.addChild(o[i],e[i]);else for(i=0;i<n;++i)r|=this.addChild(o[i]);return!!r},Q.prototype.containsChild=function(t){return!!this._children[t]},Q.prototype.removeChild=function(t){return!(this._subSegLevel||!this._childCount||!this._children[t]||(delete this._shared.childToSegment[t],delete this._children[t],--this._childCount,this._collapsed&&(this._shared.dirtyCollapsingState=!0),0))},Q.prototype.removeChildren=function(t){if(this._subSegLevel)return!1;if(!this._childCount)return!1;for(var e=Array.isArray(t)?t:[t],i=e.length,o=0,n=0;n<i;++n)o|=this.removeChild(e[n]);return!!o},Q.prototype.removeAllChildren=function(){if(this._subSegLevel)return!1;if(!this._childCount)return!1;var t=this._shared.childToSegment,e=this._children;for(var i in e)t[i]&&delete t[i];return this._children={},this._childCount=0,this._collapsed&&(this._shared.dirtyCollapsingState=!0),!0},Q.prototype.getChildIds=function(){return this._childCount?Object.keys(this._children):[]},Q.prototype.getChildren=function(){return this._children},Q.prototype.getChildCount=function(){return this._childCount},Q.prototype.getClassification=function(){return this._subSegDef&&this._subSegDef.classifiers||null},Q.prototype.setClassification=function(t){if(this._subSegLevel)return!1;var e=null;this._subSegDef&&(e=this._subSegDef.classifiers);var i,o=null;t&&("string"==typeof t?o=[t]:Array.isArray(t)&&(o=t));var n=o?o.length:0;if(n){if((e?e.length:0)===n){for(i=0;i<n&&o[i]===e[i];++i);if(i>=n)return!1}return this._subSegDef||(this._subSegDef={root:this,subSegments:null}),this._subSegDef.classifiers=o,!0}return!!e&&(this._subSegDef.classifiers=null,this._subSegDef.subSegments=null,this._subSegDef=null,!0)},Q.prototype.classify=function(t){var e=this._subSegDef?this._subSegDef.classifiers:null,i=e?e.length:0,o=this._subSegNames,n=o?o.length:0;if(!n&&this._subSegLevel>=i)return!1;var r,s=this._shared;this._collapsed&&(s.dirtyCollapsingState=!0);var l="",a={},h=0,u=this._subSegMap,p=null;if(n)for(h=n,r=0;r<h;++r)a[l=o[r]]=1,(p=u[l])._childCount&&(p._children={},p._childCount=0),p._collapsed&&(s.dirtyCollapsingState=!0);var _,c=!this._subSegLevel,d=this._children;if(this._subSegLevel<i&&t){u||(u=this._subSegMap={},o=this._subSegNames=[]);var g=e[this._subSegLevel];for(_ in d){var f=d[_],y=t[f],m=y?y[g]:null;s.childToSegment[_]=this._rid,l="Uncategorized",(m||0===m||!1===m)&&(l=m+""),a[l]&&(a[l]=0,--h),(p=u[l])||((p=new Q(this._rid+"/"+l,s))._subSegDef=this._subSegDef,p._subSegLevel=this._subSegLevel+1,p._subSegName=l,p._subSegVal=m,p._subSegParent=this,u[l]=p,o.push(l),this._dispatch("subSegmentAdded",{rid:p.getId(),segment:p})),p.addChild(_,f)}}else if(c)for(_ in d)s.childToSegment[_]=this._rid;if(h>0){for(l in h>=o.length&&(o.length=0),a)if(a[l]){p=u[l],delete u[l];var v=o.indexOf(l);v>=0&&o.splice(v,1),this._dispatch("subSegmentRemoved",{rid:p.getId(),segment:p})}o.length||(o=this._subSegMap=this._subSegNames=null)}if(n=o?o.length:0)for(o.sort(Q._subSegSortLogic),r=0;r<n;++r)(p=u[o[r]]).classify(t);if(c&&this._subSegDef)if(n){var C=this._subSegDef.subSegments=[];this.getAllSubSegments(C),C.forEach(Q._assignSubSegmentOrder)}else this._subSegDef.subSegments=null;return!0},Q.prototype.hasSubSegments=function(){return!!this._subSegNames&&!!this._subSegNames.length},Q.prototype.isSubSegment=function(){return!!this._subSegLevel},Q.prototype.getFirstAncestor=function(){return this._subSegLevel&&this._subSegDef&&this._subSegDef.root||null},Q.prototype.getAllSubSegments=function(t){var e=this._subSegNames;if(e){t||(t=[]);for(var i=this._subSegMap,o=e.length,n=0;n<o;++n){var r=i[e[n]];t.push(r),r.getAllSubSegments(t)}}return t||null},Q.prototype.getSegmentLevel=function(){return this._subSegLevel},Q.prototype.setRowData=function(t,e){if(t){var i=t[this._rid];i||(i=t[this._rid]={}),e||(e=t),(i=e[this._rid])||(i=e[this._rid]={});for(var o=this;o&&o.isSubSegment();)o.getSubSegmentName(i),o=o._subSegParent}},Q.prototype.getSubSegmentName=function(t){if(t&&this._subSegLevel){var e=this.getClassification()[this._subSegLevel-1];e&&(t[e]=this._subSegName)}return this._subSegName},Q.prototype.collapse=function(t){return t=!1!==t,this._collapsed!==t&&(this._collapsed=t,this._shared.dirtyCollapsingState=!0,!0)},Q.prototype.expand=function(t){return this.collapse(!1===t)},Q.prototype.isCollapsed=function(){return this._collapsed},Q.prototype.getCollapsingStates=function(t,e){var i=this._subSegNames;if(!this._subSegLevel&&!i&&!this._collapsed)return!1;t||(t={});var o=!1;if(this._subSegLevel&&e&&(t[this._rid]=!0,o=!0),this._childCount){var n=e||this._collapsed;if(i)for(var r=this._subSegMap,s=i.length,l=0;l<s;++l){var a=r[i[l]];t[a.getId()]=!!e,a.getCollapsingStates(t,n)&&(o=!0)}else if(n){var h=this._children;for(var u in h)t[u]=n;o=!0}}return o},Q.prototype.getOrder=function(){if(this._subSegLevel){var t=this.getFirstAncestor();if(t)return t.getOrder()+this._order}return 1e4*this._order},Q.prototype.getLastOrder=function(){if(this._subSegDef){var t=this._subSegDef.subSegments;if(t){var e=t[t.length-1];if(e)return e.getOrder()}}return this.getOrder()},Q.prototype.setOrder=function(t){this._order=t},Q._tabs=null,Q.prototype.log=function(t){var e,i=Q._tabs;if(!i){i=Q._tabs=[];var o="";for(e=0;e<11;++e)i[e]=o,o+=" "}var n=this._collapsed?"+ ":"- ";t.push(i[this._subSegLevel]+n+this._rid);var r=this._subSegNames;if(r){var s=r.length,l=this._subSegMap;for(e=0;e<s;++e)l[r[e]].log(t)}else if(this._childCount){var a=i[this._subSegLevel+1];for(var h in this._children)t.push(a+"- "+h)}return t};const J=Q;var $=function(){this._onSubSegmentAdded=this._onSubSegmentAdded.bind(this),this._onSubSegmentRemoved=this._onSubSegmentRemoved.bind(this),this._segments={},this._insertionList=[],this._removalList=[],this._shared={childToSegment:{},dirtyCollapsingState:!1}};u.inherits($,K),$.prototype._segments,$.prototype._segmentCount=0,$.prototype._collapsedRids=null,$.prototype._shared,$.prototype._segmentList=null,$.prototype._insertionList=null,$.prototype._removalList=null,$.prototype._classification=!1,$.prototype._classifierChanged=!1,$.prototype.dispose=function(){this.removeAllSegments(),this.removeAllEventListeners(),this._collapsedRids=null,this._segmentList=this._insertionList=this._removalList=null},$.prototype.addSegment=function(t,e){if(t&&!this._segments[t]){if(this.getParentRowId(t))return console.log("child of a segment cannot be set as a segment separator"),!1;var i=this._segments[t]=new J(t,this._shared);return i.addEventListener("subSegmentAdded",this._onSubSegmentAdded),i.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved),++this._segmentCount,this._segmentList=null,e&&e.length&&i.addChildren(e),!0}return!1},$.prototype.addSegments=function(t){for(var e=Array.isArray(t)?t:[t],i=e.length,o=0,n=0;n<i;++n)o|=this.addSegment(e[n]);return!!o},$.prototype.containsSegment=function(t){return!!this._segments[t]},$.prototype.getParentRowId=function(t){return this._shared.childToSegment[t]||""},$.prototype.removeSegment=function(t){var e=this._segments[t];if(e){if(this._segmentCount<=1)return this.removeAllSegments();e.isSubSegment()&&this._removalList.push(e.getId());var i=e.getSubSegmentIds();if(i)for(var o=i.length,n=0;n<o;++n){var r=i[n];this._segments[r]&&(this._removalList.push(r),delete this._segments[r],--this._segmentCount)}return e.removeAllChildren(),e.dispose(),delete this._segments[t],--this._segmentCount,!0}return!1},$.prototype.removeAllSegments=function(){if(this._segmentCount){for(var t in this._segments)this._segments[t].dispose();return this._segments={},this._segmentCount=0,this._segmentList=null,this._shared.childToSegment={},this._classification=this._classifierChanged=!1,!0}return!1},$.prototype.getSegmentCount=function(){return this._segmentCount},$.prototype.getSegment=function(t){return this._segments[t]||null},$.prototype.getSegments=function(){return this._segmentCount?this._segments:null},$.prototype.getSegmentIds=function(){return Object.keys(this._segments)},$.prototype.collapseSegment=function(t,e){var i=this._segments[t];return!!i&&i.collapse(e)},$.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},$.prototype.expandAllSegments=function(){if(this._segmentCount){var t=this._segments,e=0;for(var i in t)e|=t[i].expand();if(e)return!0}return!1},$.prototype.isCollapsedSegment=function(t){var e=this._segments[t];return!!e&&e.isCollapsed()},$.prototype.getCollapsedRows=function(){if(this._shared.dirtyCollapsingState){this._shared.dirtyCollapsingState=!1;var t=null,e=0;if(this._segmentCount){var i=this._segments;for(var o in t={},i){var n=i[o];n.isSubSegment()||n.getCollapsingStates(t)&&++e}}this._collapsedRids=e?t:null}return this._collapsedRids},$.prototype.addSegmentChild=function(t,e,i){var o=this._segments[t];return!(!o||o.isSubSegment())&&o.addChild(e,i)},$.prototype.addSegmentChildren=function(t,e,i){var o=this._segments[t];return!(!o||o.isSubSegment())&&o.addChildren(e,i)},$.prototype.containsSegmentChild=function(t,e){var i=this._segments[t];return!!i&&i.containsChild(e)},$.prototype.removeSegmentChild=function(t,e){var i=this._segments[t];return!!i&&i.removeChild(e)},$.prototype.removeSegmentChildren=function(t,e){var i=this._segments[t];return!!i&&i.removeChildren(e)},$.prototype.removeAllSegmentChildren=function(){this._shared.childToSegment={};var t=this._segments,e=!1;for(var i in t)t[i].removeAllChildren()&&(e=!0);return e&&this.classify(null),e},$.prototype.fillSegment=function(t,e){var i=Array.isArray(e)?e.length:0;if(i){var o=this._segments,n=o[t];if(n&&!n.isSubSegment()){var r=e.indexOf(t);if(r>=0){n.removeAllChildren();for(var s=r+1;s<i;++s){var l=e[s];if(o[l])break;n.addChild(l)}}}}},$.prototype.fillSegments=function(t){this._shared.childToSegment={};for(var e=Array.isArray(t)?t.length:0,i=this._segments,o=null,n=!1,r=0;r<e;++r){var s=t[r],l=i[s];l&&!l.isSubSegment()?(o=l).removeAllChildren():o&&!o.isSubSegment()&&(o.addChild(s),n=!0)}return n},$.prototype.calcSegmentOrder=function(t){var e=this._segmentList;e?e.length=0:e=this._segmentList=[];for(var i=t?t.length:0,o=this._segments,n=this._segmentCount,r=0,s=0;s<i;++s){var l=o[t[s]];if(l&&(l.isSubSegment()||(this._segmentList.push(l),l.setOrder(++r)),--n<=0))break}},$.prototype.getSegmentValues=function(t,e){var i=t?t.length:0;if(!i)return null;for(var o=this._segments,n=this._shared.childToSegment,r=null,s=null,l=new Array(i),a=0,h=-10,u=0,p=0;p<i;++p){var _=t[p];if(r=o[_])a=100*r.getOrder(),u=0,r.isSubSegment()||s!==r&&(s=r,h=100*r.getLastOrder());else{var c=n[_];c?(a=100*(r=o[c]).getOrder(),u=1,e&&(h=100*r.getLastOrder())):h?(a=h,u=10):a=u=0}l[p]=a+u}return s?l:null},$.prototype.logStructure=function(){var t=this._segmentList;if(!t)return"";for(var e=t.length,i=[],o=0;o<e;++o)t[o].log(i);return i.join("\n")},$.prototype.logRowIdMap=function(){var t=[],e=this._shared.childToSegment;for(var i in e){var o=e[i];t.push(i+" > "+o)}return t.join("\n")},$.prototype.setSegmentClassification=function(t,e){var i=this._segments[t];return!(!i||!i.setClassification(e)||(i.getClassification()&&(this._classification=!0),this._classifierChanged=!0,0))},$.prototype.hasClassification=function(){return this._classification||this._classifierChanged},$.prototype.classify=function(t){if(!this._segmentCount)return!1;if(!this.hasClassification())return!1;this._classification=this._classifierChanged=!1;var e=this._segments;for(var i in e){var o=this._segments[i];o.isSubSegment()||(o.getClassification()&&(this._classification=!0),o.classify(t))}return this._insertionList.length||this._removalList.length?(this._dispatch("subSegmentChanged",{insertionList:this._insertionList,removalList:this._removalList}),this._insertionList.length=0,this._removalList.length=0,this._dispatch("classified",{}),!0):(this._dispatch("classified",{}),!1)},$.prototype._onSubSegmentAdded=function(t){var e=t.rid;if(this._segments[e])console.log("Incorrect logic detected.");else{var i=t.segment;this._insertionList.push(i),this._segments[e]=i,this._segmentCount++,i.addEventListener("subSegmentAdded",this._onSubSegmentAdded),i.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved)}},$.prototype._onSubSegmentRemoved=function(t){var e=t.rid;this.removeSegment(e)};const Z=$;var tt=function(){tt.base(this,"constructor"),this._removeRows=this._removeRows.bind(this),this._bySegmentSeparator=this._bySegmentSeparator.bind(this),this._onClassifyingTimer=this._onClassifyingTimer.bind(this),this._onSubSegmentChanged=this._onSubSegmentChanged.bind(this),this._prevData={},this._rids=[],this._compMap={},this._addEvent("subSegmentChanged")};u.inherits(tt,U),tt.prototype._prevData=null,tt.prototype._rids,tt.prototype._frozen=!1,tt.prototype._runningId=0,tt.prototype._compMap=null,tt.prototype._segments=null,tt.prototype._autoSegmentFilling=!1,tt.prototype._removedRows=null,tt.prototype._userSegmentComparer=null,tt.prototype._segmentSortOrder=0,tt.prototype._segmentSortContext=null,tt.prototype._clsSource=null,tt.prototype._classifyingTimer=0,tt.SortLogic,tt.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._classifyingTimer&&(clearTimeout(this._classifyingTimer),this._classifyingTimer=0),this._compMap=null,this._clsSource=null,tt._removeIndexArray(),this._segments&&(this._segments.dispose(),this._segments=null)},tt.prototype.getColumnData=function(t){for(var e=new Array(this._rids.length),i=this._rids.length;--i>=0;)e[i]=this._rows[this._rids[i]][t];return e},tt.prototype.getRowId=function(t){return this._rids[t]||""},tt.prototype.getAllRowIds=function(t){return t?this._rids:this._rids.slice(0)},tt.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},tt.prototype.getRowCount=function(){return this._rids.length},tt.prototype.getDataAt=function(t,e){return this.getData(this._rids[t],e)},tt.prototype.getRowDataAt=function(t){return this.getRowData(this._rids[t])},tt.prototype.getPreviousData=function(t,e){var i=this._prevData[t]||null;return i?i[e]:null},tt.prototype.setData=function(t,e,i){if(!this._needFiring())return this._setData(t,e,i);var o={};return o[e]=i,this.setRowData(t,o)},tt.prototype.setRowData=function(t,e,i){if(!t)return!1;var o=this.getRowData(t),n=!1,r="updated",s=!1;if(e){if(o){var l=this._prevData[t];for(var a in e)l[a]=o[a],o[a]=e[a]}else if(r="inserted",o=e,this._rows[t]=o,this._prevData[t]={},i){var h=i.nextRid,u=h?this.getRowIndex(h):-1;u<0&&(u=i.fallback),null==u||u<0||u>=this._rids.length?this._rids.push(t):(this._rids.splice(u,0,t),s=!this._isLastSegment(u))}else this._rids.push(t);n=!0}else o&&(r="removed",this._prevData[t]=this._rows[t],delete this._rows[t],this._segments&&this._segments.getSegment(t)&&this._segments.removeSegment(t)&&(s=!0,this._segments.getSegmentCount()||(this._segments=null)),tt._removeArrayItem(this._rids,t),n=!0);if(n&&this._needFiring()){if(this._autoFillSegments())this.dispatchGlobalChange();else{var p=i||{};p.rid=t,p.changes=e,p.rowData=o,p.type=r,s&&(p.segmentChanged=!0),this._dispatchDataChange(p)}this.requestClassifying()}return n},tt.prototype.setColumnData=function(t,e,i){var o=e?e.length:0;if(!(o<0)){var n=this._frozen;this.freeze();for(var r=this._generateRids(o,i),s=0;s<o;++s)this._setData(r[s],t,e[s]);this.freeze(n)}},tt.prototype.setDataFromObjectMap=function(t){if(t)if(Array.isArray(t))this.addRows(t);else{var e=this._frozen;for(var i in this.freeze(),t)this.setRowData(i,t[i]);this.freeze(e)}},tt.prototype.setDataFrom2DArray=function(t,e,i){var o=t?t.length:0;if(!(o<0)){var n=this._frozen;this.freeze();for(var r=0,s=this._generateRids(o,i),l=0;l<o;++l){var a=t[l],h=s[l];if(e)for(r=a.length;--r>=0;)this._setData(h,e[r],a[r]);else for(r=a.length;--r>=0;)this._setData(h,""+r,a[r])}this.freeze(n)}},tt.prototype.setDataAt=function(t,e,i){var o=this.getRowId(t);return!!o&&this.setData(o,e,i)},tt.prototype.setRowDataAt=function(t,e,i){var o=this.getRowId(t);return!!o&&this.setRowData(o,e,i)},tt.prototype.addRow=function(t,e){return t||(t={}),e=this._generateUniqueRid(t,e),this.setRowData(e,t),e},tt.prototype.addRows=function(t,e){if(Array.isArray(t)){var i=t.length;if(i)if(1!==i){e||(e=[]);var o=this._frozen;this.freeze();for(var n=0;n<i;++n)this.addRow(t[n],e[n]);this.freeze(o)}else this.addRow(t[0],e?e[0]:null)}},tt.prototype.unshiftRow=function(t,e){return this.insertRow(0,t,e)},tt.prototype.insertRow=function(t,e,i){var o=null;return"number"==typeof t?((o={}).nextRid=this._rids[t],o.fallback=t):t&&((o={}).nextRid=t),e||(e={}),i=this._generateUniqueRid(e,i),this.setRowData(i,e,o),i},tt.prototype.insertAfter=function(t,e,i){var o="string"==typeof t?this.getRowIndex(t):t;return!(o>=0)||o>=this._rids.length-1?this.addRow(e,i):this.insertRow(o+1,e,i)},tt.prototype.removeRow=function(t){"number"==typeof t?this.setRowData(this.getRowId(t),null):this.setRowData(t,null)},tt.prototype.removeRows=function(t){if(1!==t.length){var e,i=!1;for(this._removedRows={},e=t.length;--e>=0;)"number"==typeof(o=t[e])&&(o=this.getRowId(o)),this.getRowData(o)&&(this._prevData[o]=this._rows[o],this._removedRows[o]=1,delete this._rows[o],i=!0);i?(this._rids=this._rids.filter(this._removeRows),this._removedRows=null,this.dispatchGlobalChange()):this._removedRows=null}else{var o=t[0];"number"==typeof o?this.removeRow(o):this.setRowData(o,null)}},tt.prototype._removeRows=function(t){return!this._removedRows[t]},tt._removeArrayItem=function(t,e){var i=t.indexOf(e);return i>=0&&(i>=t.length?t.pop():t.splice(i,1),!0)},tt.prototype.clearAllData=function(t){tt.base(this,"clearAllData",!0),this._prevData={},this._segments&&this._segments.removeAllSegmentChildren(),this._rids.length&&(this._rids.length=0,this.dispatchGlobalChange(t))},tt.prototype.removeAllRows=tt.prototype.clearAllData,tt._ascendingOrder=function(t,e){return t-e},tt.prototype.moveRow=function(t,e,i){var o=null,n="";if(e>=0&&e<this._rids.length||(e=this._rids.length),Array.isArray(t)){var r=t;r.sort(tt._ascendingOrder);for(var s=[],l=r.length;--l>=0;){var a=r[l];(n=this._rids[a])&&(s.unshift(n),this._rids.splice(a,1),a<e&&--e)}s.length&&(this._rids.splice.apply(this._rids,[e,0].concat(s)),o=s)}else t<0&&(t=0),t!==e&&t+1!==e&&(n=this._rids.splice(t,1)[0])&&(t<e&&--e,this._rids.splice(e,0,n),o=n);return o&&(this._segments&&(this._segments.calcSegmentOrder(this._rids),this._sort(null)),this._dispatchPositionChange(i)),o},tt.prototype._moveRow=function(t,e,i){var o=t.length;if(!o)return null;for(var n=new Array(o),r=0;r<o;++r)n[r]=this.getRowIndex(t[r]);var s=e?this.getRowIndex(e):this._rids.length;return o>1?this.moveRow(n,s,i):this.moveRow(n[0],s,i)},tt.prototype.moveRows=function(t,e,i,o){"string"==typeof t&&(t=this.getRowIndex(t)),"string"==typeof e&&(e=this.getRowIndex(e)),t<0&&(t=0),e<0&&(e=this._rids.length),i||(i=1);var n=t+i-1,r=e;if(e>=t&&(r=e<=n?t:e-i),i>0&&n<=this._rids.length){r>this._rids.length&&(r=this._rids.length);var s=this._rids.splice(t,i),l=[r,0].concat(s);return Array.prototype.splice.apply(this._rids,l),this._segments&&this._sort(null),this._dispatchPositionChange(o),s}return null},tt.prototype.swapRow=function(t,e){var i=this._rids.length;if(!(t<0||t>=i||e<0||e>=i)){var o=this._rids[t];this._rids[t]=this._rids[e],this._rids[e]=o}},tt.prototype.clearRowData=tt.prototype.removeRow,tt.prototype.clearColumnData=function(t,e){for(var i="string"==typeof t?[t]:t,o=i.length;--o>=0;){var n=i[o];if(n)for(var r in this._rows)delete this._rows[r][n],delete this._prevData[r][n]}this.dispatchGlobalChange(e)},tt.prototype.getDataSource=function(){return null},tt.prototype.setDataSource=function(t){},tt.prototype.getSortingLogics=function(){return this._compMap},tt.prototype.sortOnce=function(t,e,i,o){var n=tt._buildSortContext([],t,e,i||this._compMap,o);return!!this._sort(n)&&(this._dispatchPositionChange(),!0)},tt.prototype.setSortingLogic=function(t){this._compMap._default=t},tt.prototype.setColumnSortingLogic=function(t,e){t&&(this._compMap[t]=e)},tt.prototype.getColumnSortingLogic=function(t){if(t){var e=this._compMap[t];if(e)return e}return this._compMap._default||null},tt.prototype.freeze=function(t){t=!1!==t;var e=this._frozen;return e!==t&&(this._frozen=t,this._autoFillSegments(),this.dispatchGlobalChange()),e},tt.prototype.unfreeze=function(t){return this.freeze(!1===t)},tt.prototype.isFrozen=function(){return this._frozen},tt.prototype.setSegmentSeparator=function(t,e){var i=!1,o=0;if(t&&"string"==typeof t)if(!1!==e){if(this._segments||(this._segments=new Z,this._segments.addEventListener("subSegmentChanged",this._onSubSegmentChanged)),this._autoSegmentFilling){var n=this._segments.getParentRowId(t);n&&this._segments.removeSegmentChild(n,t)}this._segments.addSegment(t)&&(this._segments.calcSegmentOrder(this._rids),i=!0)}else if(this._segments){var r=this._segments.getSegment(t);r&&(o=r.getChildCount(),this._segments.removeSegment(t)&&(i=!0,this._segments.getSegmentCount()||(this._segments=null)))}if(i&&this._needFiring())if(this._autoFillSegments()||o)this.dispatchGlobalChange();else{var s=this._rows[t]||null;s&&this._dispatchDataChange({rid:t,changes:{},rowData:s,type:"updated",segmentChanged:!0})}return i},tt.prototype.unsetAllSegmentSeparators=function(){return!!this._segments&&(this._segments=null,this.dispatchGlobalChange(),!0)},tt.prototype.hasSegmentation=function(){return!!this._segments},tt.prototype.isSegmentSeparator=function(t){return!!this._segments&&this._segments.containsSegment(t)},tt.prototype.getSegment=function(t){return this._segments?this._segments.getSegment(t):null},tt.prototype.getSegmentLevel=function(t){var e=this.getSegment(t);return e?e.getSegmentLevel()+1:0},tt.prototype.getSegmentParentRowId=function(t){return this._segments?this._segments.getParentRowId(t):""},tt.prototype.getSegmentValues=function(t,e){return this._segments?this._segments.getSegmentValues(t||this._rids,e):null},tt.prototype._isLastSegment=function(t){var e=this._segments;if(e)for(var i=this._rids,o=i.length,n=t+1;n<o;++n)if(e.containsSegment(i[n]))return!1;return!0},tt.prototype._getSegmentSeparators=function(){return this._segments},tt.prototype.enableAutoSegmentFilling=function(t){this._autoSegmentFilling=0!=t,this._autoFillSegments()},tt.prototype._autoFillSegments=function(){return!!this._autoSegmentFilling&&this.fillSegments()},tt.prototype.fillSegment=function(t){this._segments&&(this._segments.fillSegment(t,this._rids),this.dispatchGlobalChange(),this.requestClassifying())},tt.prototype.fillSegments=function(){if(this._segments){var t=this._segments.fillSegments(this._rids);return t&&(this.dispatchGlobalChange(),this.requestClassifying()),t}return!1},tt.prototype.addSegmentChild=function(t,e,i){return!(!this._segments||!this._segments.addSegmentChild(t,e,i))&&(this._sort(null),this._dispatchPositionChange(),this.requestClassifying(),!0)},tt.prototype.addSegmentChildren=function(t,e,i){return!(!this._segments||!this._segments.addSegmentChildren(t,e,i))&&(this._sort(null),this._dispatchPositionChange(),this.requestClassifying(),!0)},tt.prototype.removeSegmentChild=function(t,e){if(this._segments){var i=this._segments.removeSegmentChild(t,e);return i&&(this.dispatchGlobalChange(),this.requestClassifying()),i}return!1},tt.prototype.removeSegmentChildren=function(t,e){if(this._segments){var i=this._segments.removeSegmentChildren(t,e);return i&&(this.dispatchGlobalChange(),this.requestClassifying()),i}return!1},tt.prototype.removeAllSegmentChildren=function(){if(this._segments){var t=this._segments.removeAllSegmentChildren();return t&&this.dispatchGlobalChange(),t}return!1},tt.prototype.getSegmentIds=function(){return this._segments?this._segments.getSegmentIds():null},tt.prototype.getSegmentChildIds=function(t){if(this._segments){var e=this._segments.getSegment(t);if(e){var i=e.getChildIds();return i.length?i:null}}return null},tt.prototype.sortSeparators=function(t,e,i){var o=!1;if(!this._segments)return!1;if("function"==typeof t)return this.sortSegments(t);var n=tt._buildSortContext([],i,e,t),r=n?n.length:0;if(!r)return o;var s,l,a=0;return r>1?(s=tt._multiColumnSeparatorCompareLogic,l=n,a=1):(s=tt._singleColumnSeparatorCompareLogic,a=(l=n[0])[3]),this._segmentSortOrder=a,this._segmentSortContext=l,o=this.sortSegments(s),this._segmentSortOrder=0,this._segmentSortContext=null,o},tt.prototype.sortSegments=function(t){if(!this._segments)return!1;if("function"!=typeof t)return this._segments.calcSegmentOrder(this._rids),!1;var e,i=this._rids,o=this._segments,n=o.getSegmentCount(),r=[],s=[],l=0,a=i.length,h="",u=null;for(e=0;e<a&&(h=i[e],!((u=o.getSegment(h))&&(s.push(e),r.push(u),++l>=n)));++e);this._userSegmentComparer=t,r.sort(this._bySegmentSeparator),this._userSegmentComparer=null;var p=!1;for(e=0;e<l;++e){var _=s[e];h=i[_];var c=(u=r[e]).getId();h!==c&&(i[_]=c,p=!0)}return!!p&&(this._segments.calcSegmentOrder(i),this._sort(null),this._dispatchPositionChange(),!0)},tt.prototype._bySegmentSeparator=function(t,e){return this._userSegmentComparer(this.getRowData(t.getId()),this.getRowData(e.getId()),this._segmentSortOrder,this._segmentSortContext)},tt.prototype.setClassificationSource=function(t){this._clsSource=null,t&&t._rows&&(this._clsSource=t._rows)},tt.prototype.setSegmentClassification=function(t,e){return!(!this._segments||!this._segments.setSegmentClassification(t,e))&&this.classifySegments()},tt.prototype.classifySegments=function(){return!(!this._segments||!this._rids.length)&&this._segments.classify(this._clsSource||this._rows)},tt.prototype.requestClassifying=function(){this._segments&&!this._classifyingTimer&&this._segments.hasClassification()&&(this._classifyingTimer=setTimeout(this._onClassifyingTimer,10))},tt.prototype._onClassifyingTimer=function(){this._classifyingTimer=0,this.classifySegments()},tt.prototype._onSubSegmentChanged=function(t){var e,i=t.insertionList,o=t.removalList,n=!1,r=this._rows,s=this._clsSource||r,l=this._rids,a=this._prevData,h=o.length,u={};for(e=0;e<h;e++){var p=o[e];r[p]&&(u[p]=a[p]=r[p],delete r[p],tt._removeArrayItem(l,p),n=!0)}var _=i.length;for(e=0;e<_;e++){var c=i[e],d=c.getParentId(),g=c.getId();if(!r[g]){a[g]={},c.setRowData(r,s);var f=l.indexOf(d);f<0||f+1>=l.length?l.push(g):l.splice(f+1,0,g),n=!0}}n&&(t.removedRows=u,this._dispatch("subSegmentChanged",t),this.dispatchGlobalChange())},tt.prototype._sort=function(t){var e=this._rids,i=this.getMultipleRowData(e),o=this.getSegmentValues(e),n=tt._performMultiLevelSorting(i,t,o);return!!n&&(this._rids=tt._reorderItems(e,n),!0)},tt.prototype.dispatchGlobalChange=function(t){!t&&this._needFiring()&&this._dispatchDataChange(tt._globalChangeArg)},tt.prototype._dispatchPositionChange=function(t){!t&&this._needFiring()&&this._dispatch("dataChanged",tt._positionChangeArg)},tt.prototype.dump=function(t){return U.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},tt.prototype._setData=function(t,e,i){var o=this.getRowData(t);return o||(o={},this._rows[t]=o,this._prevData[t]={},this._rids.push(t)),this._prevData[t][e]=o[e],o[e]=i,!0},tt.prototype._generateRids=function(t,e){var i,o=0;if(e)i=e;else{i=[];for(var n=this._rids.length;o<n&&o<t;)i.push(this._rids[o++])}for(o=i.length;o<t;)i.push(""+o++);return i},tt.prototype._generateUniqueRid=function(t,e){if(!e){if(t.ROW_ID)return t.ROW_ID;for(e="_"+this._runningId++;this._rows[e];)e="_"+this._runningId++}return e},tt.prototype._needFiring=function(){return!this._frozen&&!this._composing},tt.getSortingDefinitions=o._deprecatedFunction,tt._globalChangeArg={globalChange:!0},tt._positionChangeArg={globalChange:!0,positionChangeOnly:!0},tt._buildSortContext=function(t,e,i,o,n){var r,s;Array.isArray(e)?(r=e,s=i):(r=[e],s=e?[i]:[0]);var l=null,a=null;"function"==typeof o?l=o:a=o;var h=r.length;t.length=h;for(var u=h;--u>=0;){Array.isArray(a)&&(l=a[u]);var p=t[u];p||(p=t[u]=new Array(5));var _=r[u];p[0]=_,p[1]=null,p[2]=l||a[_]||a._default,p[2]||(p[2]=tt._defaultComparer),p[3]=tt._getSortOrder(s[u]),p[4]=n}return t},tt._multiColumnCompareLogic=function(t,e,i,o){for(var n=o.length,r=0,s=0;s<n;++s){var l=o[s];if(r=tt._singleColumnCompareLogic(t,e,l[3],l))return r}return r},tt._singleColumnCompareLogic=function(t,e,i,o){var n=o[1];return o[2](n[t],n[e],i,o[4])},tt._multiColumnSeparatorCompareLogic=function(t,e,i,o){for(var n=o.length,r=0,s=0;s<n;++s){var l=o[s];if(r=tt._singleColumnSeparatorCompareLogic(t,e,l[3],l))return r}return r},tt._singleColumnSeparatorCompareLogic=function(t,e,i,o){var n=o[0];return o[2](t[n],e[n],i,o[4])},tt._performMultiLevelSorting=function(t,e,i){var o,n=t?t.length:0,r=e?e.length:0;if(!n)return null;for(var s=0;s<r;++s){var l,a=e[s],h=a[1];if((o=a[2]).rowSorting)if(h)for(h.length=n,l=0;l<n;++l)h[l]=t[l];else h=a[1]=t;else{h?h.length=n:h=a[1]=new Array(n);var u=a[0];for(l=0;l<n;++l)h[l]=t[l][u]}}if(i){var p=["ROW_SEGMENT",i,tt._segmentComparer,1,null];e?(e=e.slice()).unshift(p):e=[p],++r}if(!r)return null;var _,c=0;return r>1?(o=tt._multiColumnCompareLogic,_=e,c=1):(o=tt._singleColumnCompareLogic,c=(_=e[0])[3]),tt._mergeSort(n,c,o,_)},tt._mergeSort=function(t,e,i,o){for(var n,r,s,l,a,h=!1,u=1,p=tt._createIndexArray(t),_=p.slice();u<=t;){for(n=a=0;n<t;)if((a=(s=l=(r=a)+u)+u)>t&&(a=t),s<a){for(;;)if(i(p[r],p[s],e,o)<=0){if(_[n++]=p[r],++r>=l){for(;s<a;)_[n++]=p[s],++s;break}}else if(h=!0,_[n++]=p[s],++s>=a){for(;r<l;)_[n++]=p[r],++r;break}}else for(;n<t;)_[n]=p[n],++n;var c=p;p=_,_=c,u<<=1}return h?p:null},tt._reorderItems=function(t,e){if(e){for(var i=t.length;--i>=0;)e[i]=t[e[i]];return e}return t},tt._createIndexArray=function(t){var e=tt._idxAryMap[t];if(!e){tt._idxAryCount>50&&(tt._idxAryMap={},tt._idxAryCount=0),e=tt._idxAryMap[t]=new Array(t),tt._idxAryCount++;for(var i=0;i<t;++i)e[i]=i}return e.slice()},tt._removeIndexArray=function(){tt._idxAryMap={},tt._idxAryCount=0},tt._idxAryMap={},tt._idxAryCount=0,tt._segmentComparer=function(t,e){return t===e?0:t<e?-1:1},tt._defaultComparer=function(t,e,i){return null==t||t!=t?null==e||e!=e?0:1:null==e||e!=e?-1:t<e?-i:e<t?i:0},tt._getSortOrder=function(t){if("number"==typeof t)return t;if(t&&"string"==typeof t){if("a"===(t=t.charAt(0).toLowerCase()))return 1;if("d"===t)return-1}return 0},tt._proto=tt.prototype;const et=tt;var it=function(t,e){this._onDataChanged=this._onDataChanged.bind(this),this._refs=[],t&&(this._dt=t,this._dt.listen("dataChanged",this._onDataChanged,0)),e&&(this._field=e)};it.prototype.dispose=function(){this._dt&&(this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=null)},it.prototype.setDataSource=function(t){this._dt!==t&&(this._dt&&this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=t,this._dt&&this._dt.listen("dataChanged",this._onDataChanged,0),this._requestRecalculation())},it.prototype.setField=function(t){this._field!==t&&(this._field=t,this._requestRecalculation())},it.prototype.disableOnDemandMode=function(t){var e=!1===t;this._onDemandMode!==e&&(this._onDemandMode=e,this._requestRecalculation())},it.prototype.setColumnDataGetter=function(t){this._colDataGetter!==t&&(this._colDataGetter=t,this._requestRecalculation())},it.prototype.getColumnDataGetter=function(){return this._colDataGetter},it.prototype.getSum=function(){return this._updateStats(),this._sum},it.prototype.getDataCount=function(){return this._updateStats(),this._count},it.prototype.getMin=function(){return this._updateStats(),this._min},it.prototype.getMax=function(){return this._updateStats(),this._max},it.prototype.getAbsoluteMax=function(){this._updateStats();var t=this._max>=0?this._max:-this._max,e=this._min>=0?this._min:-this._min;return t>=e?t:e},it.prototype.getAverage=function(){return this._updateStats(),this._sum/this._count},it.prototype.getMean=it.prototype.getAverage,it.prototype.getMidRange=function(){return this._updateStats(),.5*(this._max+this._min)},it.prototype.getCachedColumnData=function(){return this._dirty?this._recalculate():this._cacheData||(this._cacheData=this._getColData()),this._cacheData},it.prototype.markDirty=function(){return!!this._onDemandMode&&(this._dirty=!0,this._dirty)},it.prototype._getColData=function(){return this._colDataGetter?this._colDataGetter(this._field,this._dt):this._dt.getColumnData(this._field)},it.prototype._requestRecalculation=function(){this.markDirty()||this._recalculate()},it.prototype._updateStats=function(){this._dirty&&this._recalculate()},it.prototype._recalculate=function(){if(this._dirty=!1,this._cacheData=null,this._sum=0,this._min=NaN,this._max=NaN,this._count=0,this._dt&&this._field){var t=this._cacheData=this._getColData(),e=t.length;if(e){for(var i,o=it._isDataNumeric,n=0;n<e;)if(o(i=+t[n++])){this._sum=this._min=this._max=i,++this._count;break}for(;n<e;)o(i=+t[n])&&(this._sum+=i,i<this._min?this._min=i:i>this._max&&(this._max=i),++this._count),++n}}},it.prototype._onDataChanged=function(t){if(t.rid){if(!this._colDataGetter&&t.changes&&null==t.changes[this._field])return;if(this.markDirty())return;this._updateRowData(t.rid)}else if(t.rids){if(this.markDirty())return;var e=t.rids;1===e.length?this._updateRowData(e[0]):this._recalculate()}else if(t.globalChange){if(t.positionChangeOnly)return void(this._cacheData=null);this._requestRecalculation()}},it.prototype._updateRowData=function(t){var e=this._dt.getPreviousData(t,this._field),i=this._dt.getData(t,this._field);if(e!==i){var o=it._isDataNumeric(i);if(it._isDataNumeric(e)){if(this._min===e&&(!o||i>this._min))return void this._recalculate();if(this._max===e&&(!o||i<this._max))return void this._recalculate();this._sum-=e,--this._count}o&&(this._sum+=i,i>=this._min||(this._min=i),i<=this._max||(this._max=i),++this._count)}},it._isDataNumeric=function(t){return"number"==typeof t&&t==t},it.prototype.addRef=function(t){return t&&this._refs.indexOf(t)<0&&this._refs.push(t),this._refs.length},it.prototype.deRef=function(t){if(t){var e=this._refs.indexOf(t);e>=0&&this._refs.splice(e,1)}return this._refs.length},it.prototype.getRefCount=function(){return this._refs.length},it.prototype._dt=null,it.prototype._field="",it.prototype._onDemandMode=!0,it.prototype._dirty=!0,it.prototype._cacheData=null,it.prototype._sum=0,it.prototype._min=NaN,it.prototype._max=NaN,it.prototype._count=0,it.prototype._colDataGetter=null,it.prototype._refs;const ot=it;var nt=function(t){this._onDataChanged=this._onDataChanged.bind(this),this._onWrapSizeChanged=this._onWrapSizeChanged.bind(this),this._dv=t.dataView,this._dt=this._dv.getDataTable(),this._dv.listen("dataChanged",this._onDataChanged),this._dv.listen("wrapSizeChanged",this._onWrapSizeChanged),this._wrapIndex=t.wrapIndex,this._refreshRids(t.rids),this._addEvents("dataChanged")};u.inherits(nt,l),nt.prototype._dv=null,nt.prototype._dt=null,nt.prototype._wrapIndex=0,nt.prototype._rids,nt.prototype._dataConflator=null,nt.prototype._onDataChanged=function(t){if(this._dv){var e=this._dv.getVisibleRowIds(!0);this._refreshRids(e)&&(t.globalChange||(t.globalChange=!0),this._dispatch("dataChanged",t))}},nt.prototype._onWrapSizeChanged=function(t){this._refreshRids(t.rids)&&this._dispatch("dataChanged",et._globalChangeArg)},nt.prototype._refreshRids=function(t){var e=!1;if(this._dv&&Array.isArray(t)){var i=this.getWrapSize();if(i>0){var o=i*this._wrapIndex;o<t.length?(e=!0,this._rids=t.slice(o,o+i)):this._rids.length&&(e=!0,this._rids.length=0)}}return e},nt.prototype.dispose=function(){this._dv&&(this.unlistenAll(),this._dv.unlisten("dataChanged",this._onDataChanged),this._dv.unlisten("wrapSizeChanged",this._onWrapSizeChanged),this._dt=this._dv=null)},nt.prototype.getData=function(t,e){return this._dt.getData(t,e)},nt.prototype.getRowData=function(t){return this._dt.getRowData(t)},nt.prototype.getColumnData=function(t,e){for(var i=this.getAllRowIds(!0,e),o=[],n=i.length,r=0;r<n;++r){var s=this._dt.getRowData(i[r]);s?o.push(s[t]):e&&o.push(null)}return o},nt.prototype.getRowId=function(t){return this._rids[t]||""},nt.prototype._toRowId=function(t){return"number"==typeof t?this._rids[t]||"":t||""},nt.prototype._toRowIds=function(t){for(var e=Array.isArray(t)?t.length:0,i=new Array(e),o=this._rids,n=0;n<e;++n){var r=t[n];i[n]="number"==typeof r?o[r]||"":r||""}return i},nt.prototype.getAllRowIds=function(t,e){return t?this._rids:this._rids.slice(0)},nt.prototype.getVisibleRowIds=function(t){return t?this._rids:this._rids.slice(0)},nt.prototype.getSortedRowIds=function(t){return t?this._rids:this._rids.slice(0)},nt.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},nt.prototype.getRowCount=function(){return this._rids.length},nt.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},nt.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},nt.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},nt.prototype.getMultipleRowData=function(t,e,i){return this._dt.getMultipleRowData(t,e,i)},nt.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},nt.prototype.setData=function(t,e,i){return!!this._dt&&this._dt.setData(t,e,i)},nt.prototype.setRowData=function(t,e,i){return this._dv.setRowData(t,e,i)},nt.prototype.setColumnData=function(t,e,i){this._dt&&this._dt.setColumnData(t,e,i)},nt.prototype.setDataAt=function(t,e,i){var o=this.getRowId(t);return!(!o||!this._dt)&&this._dt.setData(o,e,i)},nt.prototype.setRowDataAt=function(t,e,i){var o=this.getRowId(t);return this.setRowData(o,e,i)},nt.prototype.insertRow=function(t,e,i){var o=this._toRowId(t);return this._dv.insertRow(o,e,i)},nt.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},nt.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},nt.prototype.moveRow=function(t,e){var i=this._toRowId(e),o=Array.isArray(t)?t:[t],n=this._toRowIds(o);return this._dv.moveRow(n,i)},nt.prototype.getDataTable=function(){return this._dt},nt.prototype.getDataSource=function(){return this._dv},nt.prototype.setDataSource=function(t){},nt.prototype.setConflationRate=function(t){this._dv.setConflationRate(t)},nt.prototype.getConflationRate=function(){return this._dv.getConflationRate()},nt.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},nt.prototype.sort=function(t,e,i,o){this._dv.sort(t,e,i,o)},nt.prototype.sortOnce=function(t,e){this._dv.sortOnce(t,e)},nt.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},nt.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},nt.prototype.isSorting=function(){return this._dv.isSorting()},nt.prototype.hideRow=function(t,e){this.showRows([t],!1===e)},nt.prototype.hideRows=function(t,e){this.showRows(t,!1===e)},nt.prototype.showRows=function(t,e){var i=this._toRowIds(t);this._dv.showRows(i,e)},nt.prototype.unhideAllRows=function(){this._dv.unhideAllRows()},nt.prototype.hasHiddenRow=function(){return this._dv.hasHiddenRow()},nt.prototype.filterIn=function(t,e,i){return this._dv.filterIn(t,e,i)},nt.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},nt.prototype.filterInOnce=function(t,e,i){this._dv.filterInOnce(t,e,i)},nt.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},nt.prototype.clearFilter=function(){this._dv.clearFilter()},nt.prototype.disablePageCorrection=function(t){},nt.prototype.setPage=function(t){return!1},nt.prototype.gotoPage=nt.prototype.setPage,nt.prototype.nextPage=function(){return!1},nt.prototype.previousPage=function(){return!1},nt.prototype.prevPage=nt.prototype.previousPage,nt.prototype.lastPage=function(){return!1},nt.prototype.firstPage=function(){return!1},nt.prototype.getCurrentPage=function(){return 1},nt.prototype.getPageIndex=nt.prototype.getCurrentPage,nt.prototype.isOnLastPage=function(){return!0},nt.prototype.isOnFirstPage=function(){return!0},nt.prototype.getPageSize=function(){return 0},nt.prototype.getPageCount=function(){return 1},nt.prototype.getTotalPages=nt.prototype.getPageCount,nt.prototype.setPageSize=function(t){},nt.prototype.groupBy=function(t,e){this._dv.groupBy(t,e)},nt.prototype.addGroup=function(t){this._dv.addGroup(t)},nt.prototype.sortGroups=function(t){this._dv.sortGroups(t)},nt.prototype.moveGroup=function(t,e){this._dv.moveGroup(t,e)},nt.prototype.setPredefinedGroups=function(t){this._dv.setPredefinedGroups(t)},nt.prototype.addFooter=function(t){this._dv.addFooter(t)},nt.prototype.removeFooter=function(){this._dv.removeFooter()},nt.prototype.enableMultiGroup=function(t){this._dv.enableMultiGroup(t)},nt.prototype.getGroupByRowId=function(t){return this._dv.getGroupByRowId(t)},nt.prototype.getGroup=function(t){return this._dv.getGroup(t)},nt.prototype.getAllGroups=function(t){return this._dv.getAllGroups(t)},nt.prototype.getGroupList=function(){return this._dv.getGroupList()},nt.prototype.getGroupId=function(){return this._dv.getGroupId()},nt.prototype.getGroupValue=function(){return this._dv.getGroupValue()},nt.prototype.getGroupRowId=function(){return this._dv.getGroupRowId()},nt.prototype.getFooterRowIndex=function(t){return this._dv.getFooterRowIndex(t)},nt.prototype.getFooterRowIds=function(){return this._dv.getFooterRowIds()},nt.prototype.hasGroup=function(){return this._dv.hasGroup()},nt.prototype.getGroupRows=function(){return null},nt.prototype.getGroupLevel=function(t){var e=this._toRowId(t);return this._dv.getGroupLevel(e)},nt.prototype.enableColumnStats=function(t,e,i){return this._dv.enableColumnStats(t,e,i)},nt.prototype.getColumnStats=function(t){return this._dv.getColumnStats(t)},nt.prototype.hide=function(t){return this._dv.hide(t)},nt.prototype.isHidden=function(){return this._dv.isHidden()},nt.prototype.isHiddenRow=function(t){return this._dv.isHiddenRow(t)},nt.prototype.collapse=function(t){this._dv.collapse(t)},nt.prototype.collapseAllGroups=function(t){this._dv.collapseAllGroups(t)},nt.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},nt.prototype.isCollapsed=function(){return this._dv.isCollapsed()},nt.prototype.enableContentAsHeader=function(t){this._dv.enableContentAsHeader(t)},nt.prototype.getVisibleRowCount=function(){return this._rids.length},nt.prototype.isRowDataInGroup=function(t,e){return this._dv.isRowDataInGroup(t,e)},nt.prototype.isRowIdInGroup=function(t,e){return this._dv.isRowIdInGroup(t,e)},nt.prototype.addRowExpansion=function(t,e){this._dv.addRowExpansion(t,e)},nt.prototype.removeRowExpansion=function(t){this._dv.removeRowExpansion(t)},nt.prototype.toggleRowExpansion=function(t,e,i){var o=this._toRowId(t);this._dv.toggleRowExpansion(o,e,i)},nt.prototype.removeAllRowExpansions=function(){this._dv.removeAllRowExpansions()},nt.prototype.getRowsWithExpansion=function(t,e){return this._dv.getRowsWithExpansion(t,e)},nt.prototype.getExpansionParents=function(t,e){return this._dv.getExpansionParents(t,e)},nt.prototype.isRowExpansion=function(t){return this._dv.isRowExpansion(t)},nt.prototype.hasRowExpansion=function(t){return this._dv.hasRowExpansion(t)},nt.prototype.getRowExpansionId=function(t,e){return this._dv.getRowExpansionId(t,e)},nt.prototype.getRowExpansionIndex=function(t){return this._dv.getRowExpansionIndex(t)},nt.prototype.searchAll=function(t,e){return this._dv.searchAll(t,e)},nt.prototype.searchPrev=function(t,e){var i=this._toRowId(t);return this._dv.searchPrev(i,e)},nt.prototype.searchNext=function(t,e){var i=this._toRowId(t);return this._dv.searchNext(i,e)},nt.prototype.stall=function(t){return this._dv.stall(t)},nt.prototype.enableAutoGroupRemoval=function(t){return this._dv.enableAutoGroupRemoval(t)},nt.prototype.enableAutoGroupHiding=function(t){return this._dv.enableAutoGroupHiding(t)},nt.prototype.synchronizeRowOrder=function(){this._dv.synchronizeRowOrder()},nt.prototype.setSegmentSeparator=function(t,e){var i=this._toRowId(t);return this._dv.setSegmentSeparator(i,e)},nt.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},nt.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},nt.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},nt.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},nt.prototype.collapseSegment=function(t,e){var i=this._toRowId(t);return this._dv.collapseSegment(i,e)},nt.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},nt.prototype.expandAllSegments=function(){return this._dv.expandAllSegments()},nt.prototype.setSegmentCollapsingLogic=function(){},nt.prototype.isSegmentCollapsed=function(t){var e=this._toRowId(t);return this._dv.isSegmentCollapsed(e)},nt.prototype.fillSegment=function(t){var e=this._toRowId(t);this._dv.fillSegment(e)},nt.prototype.fillSegments=function(){this._dv.fillSegments()},nt.prototype.addSegmentChild=function(t,e){var i=this._toRowId(t),o=this._toRowId(e);return this._dv.addSegmentChild(i,o)},nt.prototype.addSegmentChildren=function(t,e){var i=this._toRowId(t),o=this._toRowIds(e);return this._dv.addSegmentChildren(i,o)},nt.prototype.removeSegmentChild=function(t,e){var i=this._toRowId(t),o=this._toRowId(e);return this._dv.removeSegmentChild(i,o)},nt.prototype.removeSegmentChildren=function(t,e){var i=this._toRowId(t),o=this._toRowIds(e);return this._dv.removeSegmentChildren(i,o)},nt.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},nt.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},nt.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},nt.prototype.sortSegments=function(t){this._dt.sortSegments(t)},nt.prototype.getWrapSize=function(){return this._dv.getWrapSize()},nt.prototype.getWrappedViews=function(){return this._dv.getWrappedViews()},nt.prototype.wrapView=function(t){this._dv.wrapView(t)},nt.prototype.dump=function(t){return DataCache.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},nt.prototype.log=function(t){console.table(this.dump(t))},nt.prototype.isRowFiltered=function(t,e){return this._dv.isRowFiltered(t,e)};const rt=nt;var st=function(t,e,i){this._onConflated=this._onConflated.bind(this),this._data=[],"function"==typeof t?this.setFunction(t,i):"function"==typeof e&&this.setFunction(e,i),"number"==typeof e?this.setConflatingTime(e):"number"==typeof t&&this.setConflatingTime(t)};st.prototype._data,st.prototype._func=null,st.prototype._delay=0,st.prototype._timerId=0,st.prototype._conflated=!1,st.prototype._disabled=!1,st.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},st.prototype.popAllData=function(){if(this._data.length){var t=this._data;return this._data=[],t}return null},st.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},st.prototype.conflate=function(t){return!this._disabled&&(null!=t&&this._data.push(t),!this._conflated&&(this._timerId||(this._timerId=setTimeout(this._onConflated,this._delay)),!0))},st.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},st.prototype._onConflated=function(){this._conflated=!0;try{this._func()}catch(t){console.error(t.message||t)}this._timerId=0,this._data.length=0,this._conflated=!1},st.prototype.getData=function(){return this._data},st.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},st.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},st.prototype.getConflatingTime=function(){return this._delay},st.prototype.disable=function(t){this._disabled=!1!==t},st.prototype.isEnabled=function(){return!this._disabled},st.prototype.enable=function(t){this._disabled=!1===t};var lt=function(t){var e=this;e._groupFilterLogic=e._groupFilterLogic.bind(e),e._internalGroupSortingLogic=e._internalGroupSortingLogic.bind(e),e._onDataChanged=e._onDataChanged.bind(e),e._onGroupAdded=e._onGroupAdded.bind(e),e._onBeforeGroupAdded=e._onBeforeGroupAdded.bind(e),e._onRefreshTimeout=e._onRefreshTimeout.bind(e),e._updateWrapCount=e._updateWrapCount.bind(e),e._byRemovalMap=e._byRemovalMap.bind(e),e._rids=[],e._sortingDefs=[],e._columnStats={},e._shared={},e._conflator=new st(this._onDataChanged,0),e._conflator.disable(),e._addEvents("dataChanged","preDisposed","pageIndexChanged","pageCountChanged","groupAdded","beforeGroupAdded","groupCriteriaChanged","beforeFiltering","wrapCountChanged","wrapSizeChanged"),e.setDataSource(t)};u.inherits(lt,l),lt.prototype._rids,lt.prototype._groupView=null,lt.prototype._pageView=null,lt.prototype._expansionView=null,lt.prototype._hiddenRids=null,lt.prototype._collapsedRids=null,lt.prototype._excludedRids=null,lt.prototype._emptySegmentFiltering=!1,lt.prototype._separatorFiltering=!1,lt.prototype._expansionMap=null,lt.prototype._expansionChildren=null,lt.prototype._expansionCount=0,lt.prototype._dt=null,lt.prototype._parent=null,lt.prototype._shared=null,lt.prototype._sortingDefs=null,lt.prototype._userFilter=null,lt.prototype._filteringOut=!1,lt.prototype._refreshTimerId=0,lt.prototype._groupSortingLogic=null,lt.prototype._pageCorrection=!0,lt.prototype._pageSize=0,lt.prototype._pageIndex=1,lt.prototype._lastPageIndex=0,lt.prototype._groupCriteria=null,lt.prototype._preDefGroups=null,lt.prototype._preDefGroupsDirty=!1,lt.prototype._groupMembers=null,lt.prototype._groupList=null,lt.prototype._groupRows=null,lt.prototype._groupId="",lt.prototype._groupColor="",lt.prototype._groupValue,lt.prototype._groupRowId="",lt.prototype._footerRowIds=null,lt.prototype._groupLevel=0,lt.prototype._groupViewDirty=!1,lt.prototype._columnStats,lt.prototype._hidden=!1,lt.prototype._hiddenHeaderRow=!1,lt.prototype._collapsed=!1,lt.prototype._collapsible=!0,lt.prototype._showOnlyFirstMember=!1,lt.prototype._beingAdded=!1,lt.prototype._conflator=null,lt.prototype._wrappedViews=null,lt.prototype._wrapSize=0,lt.prototype._wrapTimerId=0,lt.prototype.dispose=function(){if(this._dispatch("preDisposed",{}),this.unlistenAll(),this.wrapView(0),this.setDataSource(null),this.groupBy(null),this._conflator.dispose(),this._sortingDefs=null,this._shared=null,this._userFilter=this._groupSortingLogic=null,this._wrapTimerId&&(clearTimeout(this._wrapTimerId),this._wrapTimerId=0),this._refreshTimerId&&(clearTimeout(this._refreshTimerId),this._refreshTimerId=0),this._columnStats){for(var t in this._columnStats)this._columnStats[t].dispose();this._columnStats=null}},lt.prototype.getData=function(t,e){return this._dt.getData(t,e)},lt.prototype.getRowData=function(t){return this._dt.getRowData(t)},lt.prototype.getColumnData=function(t,e){for(var i=this.getAllRowIds(!0,e),o=[],n=i.length,r=0;r<n;++r){var s=this._dt.getRowData(i[r]);s?o.push(s[t]):e&&o.push(null)}return o},lt.prototype.getRowId=function(t){return this._rebuildRowIdsFromChildren(),this._getRids()[t]||""},lt.prototype._toRowId=function(t){return"number"==typeof t?(this._rebuildRowIdsFromChildren(),this._getRids()[t]||""):t||""},lt.prototype._toRowIds=function(t){for(var e=Array.isArray(t)?t.length:0,i=new Array(e),o=this._getRids(),n=0;n<e;++n){var r=t[n];"number"==typeof r?(this._rebuildRowIdsFromChildren(),i[n]=o[r]||""):i[n]=r||""}return i},lt.prototype.getAllRowIds=function(t,e){this._rebuildRowIdsFromChildren();var i=e?this._getRids():this._pageView||this._rids;return t?i:i.slice(0)},lt.prototype.getVisibleRowIds=function(t){this._rebuildRowIdsFromChildren();var e=this._getRids();return t?e:e.slice(0)},lt.prototype.getSortedRowIds=function(t){return this._rebuildRowIdsFromChildren(),t?this._rids:this._rids.slice(0)},lt.prototype.getRowIndex=function(t){return this._rebuildRowIdsFromChildren(),this._getRids().indexOf(t)},lt.prototype.getRowCount=function(){return this._getRids().length},lt.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},lt.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},lt.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},lt.prototype.getMultipleRowData=function(t,e,i){return this._dt.getMultipleRowData(t,e,i)},lt.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},lt.prototype.setData=function(t,e,i){return!!this._dt&&this._dt.setData(t,e,i)},lt.prototype.setRowData=function(t,e,i){return!(!t||!this._dt||this.isRowExpansion(t))&&this._dt.setRowData(t,e,i)},lt.prototype.setColumnData=function(t,e,i){this._dt&&this._dt.setColumnData(t,e,i)},lt.prototype.setDataAt=function(t,e,i){var o=this.getRowId(t);return!(!o||!this._dt)&&this._dt.setData(o,e,i)},lt.prototype.setRowDataAt=function(t,e,i){var o=this.getRowId(t);return this.setRowData(o,e,i)},lt.prototype.insertRow=function(t,e,i){this._rebuildRowIdsFromChildren();var o=this._toRowId(t);return this._dt?this._dt.insertRow(o,e,i):""},lt.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},lt.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},lt.prototype.moveRow=function(t,e){var i=this._toRowId(e),o=Array.isArray(t)?t:[t],n=this._toRowIds(o);return this._dt.hasSegmentation()&&this.synchronizeRowOrder(),this._dt._moveRow(n,i)},lt.prototype.swapRow=o._deprecatedFunction,lt.prototype.getDataTable=function(){return this._dt},lt.prototype.getDataSource=function(){return this._parent},lt.prototype.setDataSource=function(t){if(t){if(this._groupLevel>0)return;this._setParent(t),this._onDataChanged(et._globalChangeArg),this._parent.listen("dataChanged",this._onDataChanged)}else this._parent&&(this._parent.unlisten("dataChanged",this._onDataChanged),this._resetAllViews(),this._groupViewDirty=!1),this._parent=this._dt=null,this._shared={}},lt.prototype.setConflationRate=function(t){this._conflator.disable(!t),this._conflator.setConflatingTime(t)},lt.prototype.getConflationRate=function(){return this._conflator.getConflatingTime()},lt.prototype._resetAllViews=function(){this._rids.length=0,this._groupView&&this._groupView.length&&(this._groupView.length=0),this._pageView&&this._pageView.length&&(this._pageView.length=0),this._expansionView&&this._expansionView.length&&(this._expansionView.length=0)},lt.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},lt.prototype.sort=function(t,e,i,o){if(this._groupLevel>0)window.console.log("ERROR: Sub-group cannot be sorted individually");else{var n=this.getSortingLogics(),r=this._sortingDefs,s=r.length;if(Array.isArray(i))for(var l=i.length;--l>=0;)if("function"!=typeof i[l]){var a=Array.isArray(t)?t[l]:t;i[l]=n[a]||n._default}if(et._buildSortContext(r,t,e,i||n),1===r.length&&0===r[0][3]&&(r.length=0),!(s<=0&&r.length<=0||this._shared.stalledRids)){var h=!1;this._groupMembers||r.length<=0||o?(h=!0,this._updateRowIds()):h=this._sort(),h&&this._dispatchDataChange(et._positionChangeArg)}}},lt.prototype.sortOnce=function(t,e){this.sort(t,e),this._sortingDefs.length=0},lt.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},lt.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},lt.prototype.getColumnSortingLogic=function(t){return this._dt?this._dt.getColumnSortingLogic(t):null},lt.prototype.isSorting=function(){return this._sortingDefs.length>0},lt.prototype.hideRow=function(t,e){this.hideRows([t],e)},lt.prototype.hideRows=function(t,e){e=!1!==e;var i=this._hiddenRids;if(e)i||(i=this._hiddenRids={});else if(!i)return;for(var o=this._toRowIds(t),n=!1,r=o.length;--r>=0;){var s=o[r];s&&(e?i[s]||(i[s]=!0,n=!0):i[s]&&(delete i[s],n=!0))}if(n){if(!e){var l=!1;for(var a in i){l=!0;break}l||(i=this._hiddenRids=null)}this._refreshAndNotify()}},lt.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},lt.prototype.unhideAllRows=function(){this._hiddenRids&&(this._hiddenRids=null,this._refreshAndNotify())},lt.prototype.hasHiddenRow=function(){return!!this._hiddenRids},lt.prototype.filterIn=function(t,e,i){var o=this._getFilterLogic(t,e),n=!0===i;return!!(this._userFilter!==o||"function"==typeof t||o&&n!==this._filteringOut)&&(this._shared.filterLogic=o,this._userFilter=o,this._filteringOut=n,this._refreshAndNotify(),!0)},lt.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},lt.prototype.filterInOnce=function(t,e,i){var o=this._getFilterLogic(t,e),n={};if(this._getRemovalMap(n,o,!0===i)){var r=this._removeRowIds(n);this._updatePageCount()||this._transformView(r)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(Object.keys(n))}},lt.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},lt.prototype._removeRowIds=function(t){var e=lt._removeArrayItems(this._rids,t);if(this._groupView&&(e=lt._removeArrayItems(this._groupView,t)),this._groupMembers)for(var i=this._groupList.length,o=0;o<i;++o){var n=this._groupList[o];this._groupMembers[n]._removeRowIds(t)}return e},lt.prototype.clearFilter=function(){this._userFilter&&(this._userFilter=null,this._shared.filterLogic=null,this._refreshAndNotify())},lt.prototype.disablePageCorrection=function(t){this._pageCorrection=!1===t},lt.prototype.setPage=function(t){var e=this._setPage(t);return e&&this._dispatchGlobalChange(),e},lt.prototype.gotoPage=lt.prototype.setPage,lt.prototype.nextPage=function(){return this.gotoPage(this._pageIndex+1)},lt.prototype.previousPage=function(){return this.gotoPage(this._pageIndex-1)},lt.prototype.prevPage=lt.prototype.previousPage,lt.prototype.lastPage=function(){return this.gotoPage(this._lastPageIndex)},lt.prototype.firstPage=function(){return this.gotoPage(0)},lt.prototype.getCurrentPage=function(){return this._pageIndex},lt.prototype.getPageIndex=lt.prototype.getCurrentPage,lt.prototype.isOnLastPage=function(){return this._pageIndex===this._lastPageIndex},lt.prototype.isOnFirstPage=function(){return 1===this._pageIndex},lt.prototype.getPageSize=function(){return this._pageSize},lt.prototype.getPageCount=function(){return this._lastPageIndex},lt.prototype.getTotalPages=lt.prototype.getPageCount,lt.prototype.setPageSize=function(t){t>=0||(t=0),this._pageSize!==t&&(this._pageSize=t,this._updatePageCount(),t>0?this._pageView||(this._pageView=[]):this._pageView&&(this._pageView=null),this._pageView&&0!==t?this._transformView():this._updateRowIds(),this._dispatchGlobalChange())},lt.prototype.groupBy=function(t,e){if(this._shared.multiGroupRow=!1,this._groupCriteria){if(this._groupList&&this._groupList.length>0){for(var i in this._groupMembers)this._groupMembers[i].dispose();this._groupMembers={},this._groupList.length=0}this._groupCriteria=null}var o,n,r;if(null!=e&&this._setPredefinedGroups(e),t&&0===this._groupLevel)for(this._groupCriteria=[],n=(r=Array.isArray(t)?t:[t]).length,o=0;o<n;++o){var s=r[o];"string"==typeof s?this._groupCriteria.push(this._defaultGroupCriteria.bind(this,s)):s&&this._groupCriteria.push(s)}if(this._groupCriteria)this._groupMembers||(this._groupMembers={},this._groupList=[],this._groupRows={}),this._groupView||(this._groupView=[]);else{if(this._groupMembers=null,this._groupList=null,this._groupView=null,this._groupRows){if(this._groupLevel<=0)this._footerRowIds=null;else if(this._groupRowId&&delete this._groupRows[this._groupRowId],this._footerRowIds){for(n=this._footerRowIds.length,o=0;o<n;++o)delete this._groupRows[this._footerRowIds[o]];this._footerRowIds=null}this._groupRows=null}this._groupValue=null}this._groupLevel=0,this._updateRowIds(),this._dispatch("groupCriteriaChanged",{}),this._dispatchGlobalChange()},lt.prototype.addGroup=function(t){if(this._groupMembers)if(isArray(t))for(var e=t,i=e.length,o=0;o<i;++o)this._addGroup(e[o]);else this._addGroup(t)},lt.prototype.sortGroups=function(t){if(this._groupMembers&&(this._groupSortingLogic=null==t?lt._defaultGroupSortingLogic:t||null,this._groupSortingLogic)){this._groupList.sort(this._internalGroupSortingLogic);for(var e=this._groupList.length;--e>=0;){var i=this._groupList[e];this._groupMembers[i].sortGroups(this._groupSortingLogic)}this._groupViewDirty=!0,this._groupLevel<=0&&this._dispatchGlobalChange()}},lt.prototype.moveGroup=function(t,e){var i=this.getGroup(t);if(i){var o=i.getDataSource(),n=i.getGroupId(),r=o._groupList.indexOf(n);r!==e&&r+1!==e&&(o._groupList.splice(r,1),r<e&&--e,o._groupList.splice(e,0,n),this._requestRebuildingRowIds(!1))}},lt.prototype.setPredefinedGroups=function(t){this._setPredefinedGroups(t),this._groupMembers&&this._refreshAndNotify()},lt.prototype._setPredefinedGroups=function(t){if(this._preDefGroups!==t){this._preDefGroups&&(this._preDefGroups.length=0);var e=!1;if(t)for(var i=t.length;--i>=0;)if(Array.isArray(t[i])){e=!0;break}e?this._preDefGroups=t:Array.isArray(t)?this._preDefGroups=[t]:this._preDefGroups=null,this._preDefGroupsDirty=!0}},lt.prototype.addFooter=function(t){if(this._groupLevel<=0)console.log("WARNING: Only group can have a footer");else if(null==t&&(t=1),!(t<=0)){this._footerRowIds||(this._footerRowIds=[]);for(var e=0;e<t;++e){var i=this._groupRowId+"_footer"+(this._footerRowIds.length||"");this._footerRowIds.push(i),this._groupRows[i]=this}this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},lt.prototype.removeFooter=function(){if(this._footerRowIds){for(var t=this._footerRowIds.length,e=0;e<t;++e)delete this._groupRows[this._footerRowIds[e]];this._footerRowIds=null,this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},lt.prototype.enableMultiGroup=function(t){this._shared.multiGroupRow=!1!==t},lt.prototype.getGroupByRowId=function(t){return this._groupRows&&this._groupRows[t]||null},lt.prototype.getGroup=function(t){if(!this._groupMembers)return null;var e;if("number"==typeof t){if(!(e=this._groupList[t]))return null}else e=t+"";var i=this._groupMembers[e];if(i)return i;var o=e;return(i=this._groupRows[o])||this._getGroupByContentRowId(o)},lt.prototype._getGroupByContentRowId=function(t){if(this._groupMembers)for(var e=0;e<this._groupList.length;e++){var i=this._groupList[e],o=this._groupMembers[i]._getGroupByContentRowId(t);if(o)return o}else if(-1!==this._rids.indexOf(t))return this;return null},lt.prototype.getAllGroups=function(t){if(t||(t=[]),this._groupMembers)for(var e=this._groupList.length,i=0;i<e;++i){var o=this._groupList[i],n=this._groupMembers[o];t.push(n),n.getAllGroups(t)}return t},lt.prototype.getGroupList=function(){return this._groupList},lt.prototype.getGroupId=function(){return this._groupId},lt.prototype.getGroupValue=function(){return this._groupValue},lt.prototype.getGroupRowId=function(){return this._groupRowId},lt.prototype.getFooterRowIndex=function(t){if(this._footerRowIds)for(var e=this._footerRowIds.length;--e>=0;)if(this._footerRowIds[e]===t)return e;return-1},lt.prototype.getFooterRowIds=function(){return this._footerRowIds},lt.prototype.hasGroup=function(){return!!this._groupMembers},lt.prototype.getGroupRows=function(){return null},lt.prototype.getGroupLevel=function(t){if(null!=t&&this._groupRows){if("number"!=typeof t){var e=this.getGroup(t);return e?e._groupLevel:-1}this._rebuildRowIdsFromChildren();for(var i=this._getRids(),o=i[t];o;){var n=this._groupRows[o];if(n)return n._groupLevel;o=i[--t]}}return this._groupLevel},lt.prototype.enableColumnStats=function(t,e,i){if(!t)return null;var o=!1!==e,n=this._columnStats[t];if(o?(n||(n=new ot(this,t),this._columnStats[t]=n),n.addRef(i)):n&&(n.deRef(i)||(n.dispose(),delete this._columnStats[t])),this._groupMembers)for(var r=this._groupList.length;--r>=0;){var s=this._groupList[r];this._groupMembers[s].enableColumnStats(t,e,i)}return n||null},lt.prototype.getColumnStats=function(t){return this._columnStats[t]||null},lt.prototype.hide=function(t){var e=!1!==t;return this._hidden!==e&&(this._hidden=e,this._refreshAndNotify(),!0)},lt.prototype.isHidden=function(){return this._hidden},lt.prototype.isHiddenRow=function(t){return!!this._hiddenRids&&!0===this._hiddenRids[t]},lt.prototype._isHeaderRowShown=function(){return!(this._hiddenHeaderRow||this._shared.filterLogic&&0===this._rids.length||this._shared.autoGroupHiding&&null==this._groupValue)},lt.prototype._setCollapse=function(t){if(this._shared.contentAsHeader){if(this._hiddenHeaderRow&&this._showOnlyFirstMember!==t)return this._showOnlyFirstMember=t,!0}else if(this._isHeaderRowShown()&&this._collapsible&&this._collapsed!==t)return this._collapsed=t,!0;return!1},lt.prototype.collapse=function(t){this._setCollapse(!1!==t)&&(this._shared.contentAsHeader?this._hiddenHeaderRow&&this._requestRebuildingRowIds(this._showOnlyFirstMember):this._groupLevel>0&&this._requestRebuildingRowIds(this._collapsed))},lt.prototype.collapseAllGroups=function(t){var e=this.getAllGroups(),i=e.length;if(i){for(var o=!1!==t,n=0;n<i;++n)e[n]._setCollapse(o);this._requestRebuildingRowIds(!1)}},lt.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},lt.prototype.isCollapsed=function(){return this._collapsed||this._showOnlyFirstMember},lt.prototype.enableContentAsHeader=function(t){this._shared.contentAsHeader=!1!==t},lt.prototype.setDefaultCollapse=function(t){this._shared.defaultCollapse=!!t},lt.prototype.getDefaultCollapse=function(){return!!this._shared.defaultCollapse},lt.prototype.isCollapsible=function(){return this._collapsible},lt.prototype.disableCollapsing=function(t){this._collapsible=!(!1!==t)},lt.prototype.setGroupColor=function(t){1===this._groupLevel&&(this._groupColor=t)},lt.prototype.getGroupColor=function(){return 0===this._groupLevel?"":1===this._groupLevel?this._groupColor:this._parent.getGroupColor()},lt.prototype._getFirstHiddenRids=function(){if(this._shared.contentAsHeader&&this._showOnlyFirstMember){var t=this._rids;if(Array.isArray(t)&&t.length)return[t[0]]}return null},lt.prototype.getVisibleRowCount=function(){return this._collapsed?0:(this._rebuildRowIdsFromChildren(),this._getRids().length)},lt.prototype.isRowDataInGroup=function(t,e){var i=this._groupCriteria,o=this._groupLevel;if(!e||e===this.getGroupId())return this._isAllowedInGroup(null,t);for(var n=o;n<i.length;n++)if(i[n](t).indexOf(e)>=0)return!0;return!1},lt.prototype.isRowIdInGroup=function(t,e){var i=this.getRowData(t);return!!i&&this.isRowDataInGroup(i,e)},lt._getDataViewExpansionId=function(t,e){return t+"_ex"+e},lt.prototype.addRowExpansion=function(t,e){if(!(this._groupLevel>0)){if(!e||e<0){if(null!=e)return;e=1}var i=this._rids.indexOf(t);if(!(i<0)){var o=0;this._expansionMap?o=this._expansionMap[t]||0:(this._expansionMap={},this._expansionChildren={});var n=o+e;this._expansionMap[t]=n;for(var r=o;r<n;r++)this._expansionChildren[lt._getDataViewExpansionId(t,r)]=t;if(o||this._expansionCount++,!this._groupViewDirty&&this._updateExpansionView()){var s={};s.rid=t,s.type="inserted",s.nextRid=this._rids[i+1],s.fallback=i,this._dispatchDataChange(s)}}}},lt.prototype.removeRowExpansion=function(t){if(this._expansionMap){var e=this._expansionMap[t];if(e){for(var i=new Array(e),o=0;o<e;++o)i[o]=lt._getDataViewExpansionId(t,o),delete this._expansionChildren[i[o]];delete this._expansionMap[t],this._expansionCount--,this._groupViewDirty||this._updateExpansionView()&&(1===e?this._dispatchRowRemoved(i[0]):this._dispatchMultiRowRemoved(i))}}},lt.prototype.toggleRowExpansion=function(t,e,i){var o=this._toRowId(t);(e=null!=e?!0===e:!this.hasRowExpansion(o))?this.addRowExpansion(o,i):this.removeRowExpansion(o)},lt.prototype.removeAllRowExpansions=function(){this._expansionMap&&(this._expansionMap=null,this._expansionCount=0,this._expansionView=null,this._expansionChildren=null,this._refreshAndNotify())},lt.prototype.getRowsWithExpansion=function(t,e){if(!this._expansionMap)return[];var i=this._expansionView,o=i.length;(null==e||e>o)&&(e=o),t>0||(t=0);for(var n=this._expansionCount,r=new Array(o),s=t;s<e;++s){var l=i[s];if(this._expansionMap[l]&&(r[s]=l,--n<=0))break}return r},lt.prototype.getExpansionParents=function(t,e){var i=[];if(this._expansionMap){var o=this._expansionView,n=o.length;(null==e||e>n)&&(e=n),(!t||t<0)&&(t=0);for(var r=t;r<e;++r)i[r]=this._expansionChildren[o[r]]||""}return i},lt.prototype.isRowExpansion=function(t){return!!this._expansionChildren&&!!this._expansionChildren[t]},lt.prototype.hasRowExpansion=function(t){return!!this._expansionMap&&!!this._expansionMap[t]},lt.prototype.getRowExpansionId=function(t,e){return this._expansionMap&&(e||(e=0),e<(this._expansionMap[t]||0))?lt._getDataViewExpansionId(t,e):""},lt.prototype.getRowExpansionIndex=function(t){if(t){var e=t.match(/_ex(\d+)$/);if(e)return+e[1]}return-1},lt.prototype._updateExpansionView=function(){var t=this._expansionMap;if(t){if(!this._expansionCount||this._expansionCount<0)return this._expansionCount=0,this._expansionMap=null,this._expansionView=null,this._expansionChildren=null,!0;var e=this._pageView||this._groupView||this._rids,i=e.length,o=this._expansionView?this._expansionView.length:0;this._expansionView?this._expansionView.length=i:this._expansionView=new Array(i);for(var n=this._expansionCount,r=0,s=0;r<i;++r){var l=e[r];if(this._expansionView[s++]=l,n){var a=t[l]||0;if(a){for(var h=0;h<a;++h)this._expansionView[s++]=lt._getDataViewExpansionId(l,h);--n}}}return o!==this._expansionView.length}return!1},lt.prototype._transformView=function(t){var e=this._updatePaginationView(t);return!!(e|=this._updateExpansionView())},lt.prototype.searchAll=function(t,e){e||(e=[]),this._rebuildRowIdsFromChildren();for(var i=this._getRids(),o=i.length,n=0;n<o;++n){var r=i[n],s=this._dt.getRowData(r);s&&t(s)&&e.push(r)}return e},lt.prototype.searchPrev=function(t,e){this._rebuildRowIdsFromChildren();var i=this._getRids(),o=-1;"number"==typeof t?this._dt.getRowData(i[t])&&(o=t):o=i.indexOf(t);var n=-1,r=i.length;return o>0&&(n=this._searchRow(i,e,o-1,-1,-1))>=0||o>=0&&(n=this._searchRow(i,e,r-1,o,-1))>=0?n:-1},lt.prototype.searchNext=function(t,e){this._rebuildRowIdsFromChildren();var i=this._getRids(),o=-1;if("number"==typeof t?this._dt.getRowData(i[t])&&(o=t):o=i.indexOf(t),o<0)return-1;var n=-1,r=i.length;return o<r-1&&(n=this._searchRow(i,e,o+1,r,1))>=0||o>0&&(n=this._searchRow(i,e,0,o,1))>=0?n:-1},lt.prototype._searchRow=function(t,e,i,o,n){for(;i!==o;){var r=t[i],s=this._dt.getRowData(r);if(s&&e(s))return i;i+=n}return-1},lt.prototype.stall=function(t){var e=!1!==t;if(!!this._shared.stalledRids===e)return!1;if(e){var i={};this._shared.stalledRids=i;for(var o=this._getRids(),n=o.length;--n>=0;)i[o[n]]=1}else this._shared.stalledRids=null,this._refreshAndNotify();return!0},lt.prototype.enableAutoGroupRemoval=function(t){return t=!1!==t,!!this._shared.autoGroupRemoval!==t&&(this._shared.autoGroupRemoval=t,this._triggerGroupRefreshing(),!0)},lt.prototype.enableAutoGroupHiding=function(t){return t=!1!==t,!!this._shared.autoGroupHiding!==t&&(this._shared.autoGroupHiding=t,this._triggerGroupRefreshing(),!0)},lt.prototype.synchronizeRowOrder=function(){this.isSorting()&&this._dt._sort(this._sortingDefs)},lt.prototype.setSegmentSeparator=function(t,e){var i="";return"number"==typeof t?i=this.getRowId(t):"string"==typeof t&&(i=t),!!i&&((e=!1!==e)&&this.synchronizeRowOrder(),this._dt.setSegmentSeparator(i,e))},lt.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},lt.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},lt.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},lt.prototype.getSegment=function(t){return this._dt.getSegment(t)},lt.prototype.getSegmentLevel=function(t){return this._dt.getSegmentLevel(t)},lt.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},lt.prototype.collapseSegment=function(t,e){e=!1!==e;var i=this._dt._getSegmentSeparators();if(i){var o=this._toRowId(t);if(i.collapseSegment(o,e))return this._refreshAndNotify(),!0}return!1},lt.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},lt.prototype.expandAllSegments=function(){var t=this._dt._getSegmentSeparators();return!(!t||!t.expandAllSegments()||(this._refreshAndNotify(),0))},lt.prototype.setSegmentCollapsingLogic=function(){},lt.prototype.isSegmentCollapsed=function(t){var e=this._dt._getSegmentSeparators();return!!e&&e.isCollapsedSegment(this._toRowId(t))},lt.prototype.fillSegment=function(t){this._dt.fillSegment(this._toRowId(t))},lt.prototype.fillSegments=function(){this._dt.fillSegments()},lt.prototype.addSegmentChild=function(t,e,i){if(this._dt._getSegmentSeparators()){var o=this._toRowId(t),n=this._toRowId(e);return this._dt.addSegmentChild(o,n,i)}return!1},lt.prototype.addSegmentChildren=function(t,e,i){if(this._dt._getSegmentSeparators()){var o=this._toRowId(t),n=this._toRowIds(e);return this._dt.addSegmentChildren(o,n,i)}return!1},lt.prototype.removeSegmentChild=function(t,e){if(this._dt._getSegmentSeparators()){var i=this._toRowId(t),o=this._toRowId(e);return this._dt.removeSegmentChild(i,o)}return!1},lt.prototype.removeSegmentChildren=function(t,e){if(this._dt._getSegmentSeparators()){var i=this._toRowId(t),o=this._toRowIds(e);return this._dt.removeSegmentChildren(i,o)}return!1},lt.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},lt.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},lt.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},lt.prototype.sortSeparators=function(t,e,i){this._dt.sortSeparators(t,e,i)},lt.prototype.sortSegments=function(t){this._dt.sortSegments(t)},lt.prototype.enableEmptySegmentFiltering=function(t){t=!1!==t,this._emptySegmentFiltering!==t&&(this._emptySegmentFiltering=t,this._userFilter&&this._refreshAndNotify())},lt.prototype.enableSeparatorFiltering=function(t){t=!1!==t,this._separatorFiltering!==t&&(this._separatorFiltering=t,this._userFilter&&this._refreshAndNotify())},lt.prototype.setSegmentClassification=function(t,e){return this._dt.setSegmentClassification(this._toRowId(t),e)},lt.prototype._getSharedObject=function(){return this._shared},lt.prototype.getWrapSize=function(){return this._wrapSize},lt.prototype.getWrappedViews=function(){return this._wrappedViews},lt.prototype.wrapView=function(t){null!=t&&((!t||t<0)&&(t=0),this._wrapSize!==t&&(this._wrapSize=t,this._dispatch("wrapSizeChanged",{wrapSize:t,rids:this.getVisibleRowIds(!0)}))),this._updateWrapCount()},lt.prototype._updateWrapCount=function(){this._wrapTimerId=0;var t,e=this._wrapSize,i=this._wrappedViews,o=i?i.length:0,n=0;if(e){var r=this.getVisibleRowIds(!0),s=r.length;if(o<(n=Math.ceil(s/e)))for(i||(i=this._wrappedViews=[]),t=o;t<n;++t)this._wrappedViews[t]=new rt({dataView:this,wrapIndex:t,rids:r})}if(n<o){for(t=o;--t>=n;)this._wrappedViews[t].dispose();this._wrappedViews.length=n}e||(this._wrappedViews=null),o!==n&&this._dispatch("wrapCountChanged",{prevCount:o,newCount:n})},lt.prototype.dump=function(t){this._rebuildRowIdsFromChildren();var e=this._getRids();return U.constructTable(this.getMultipleRowData(e),t,e)},lt.prototype.log=function(t){console.table(this.dump(t))},lt.prototype._getRids=function(){return this._expansionView||this._pageView||this._groupView||this._rids},lt.prototype._updateRowIds=function(t){if(this._groupViewDirty=!1,this._parent&&!this._hidden){if(!this._shared.stalledRids){this._rids=t||this._parent.getAllRowIds(),this._dispatch("beforeFiltering",{}),this._excludedRids={};var e=0;e+=lt._copyObjectKeys(this._excludedRids,this._hiddenRids);var i=this._dt._getSegmentSeparators(),o=i?i.getSegments():null,n=this._getRemovalMap(this._excludedRids,this._userFilter,this._filteringOut,this._separatorFiltering?null:o);if(e+=n,this._collapsedRids=null,i&&(n&&this._emptySegmentFiltering&&(e+=this._getEmptySegments(this._excludedRids,o)),this._collapsedRids=i.getCollapsedRows(),e+=lt._copyObjectKeys(this._excludedRids,this._collapsedRids)),this._groupLevel>0&&!t&&(e+=this._getRemovalMap(this._excludedRids,this._groupFilterLogic,!1)),e&&(this._rids=this._rids.filter(this._byRemovalMap)),this._excludedRids=null,this._groupMembers)this._populateGroups();else{var r=this._updatePageCount();this._sort()||r||this._transformView()}}}else this._resetAllViews()},lt.prototype._onDataChanged=function(t){if(!this._conflator.conflate(t)){var e=this._conflator.popAllData()||[t],i=e.length;if(1===i){var o=e[0];if(o.globalChange)return this._updateRowIds(),void this._dispatchDataChange(o);var n=o.type;"inserted"===n?this._onRowInserted(o):"removed"===n?this._onRowRemoved(o):this._onRowUpdated(o)}else{this._updateRowIds();for(var r=!0,s=0;s<i;s++)if(!e[s].positionChangeOnly){r=!1;break}this._dispatchDataChange({globalChange:!0,positionChangeOnly:r,events:e})}}},lt.prototype._onRowInserted=function(t){if(this._shared.stalledRids)return 0;if(this.isRowFiltered(t.rid,t.rowData))return 0;var e=0;if(this._groupMembers){var i,o=this._resolveGroupId(t.rowData),n=o.length;n>1&&(this._shared.multiGroupRow=!0);for(var r=0;r<n;r++)if(i=o[r],this._groupMembers[i])e=this._groupMembers[i]._onRowInserted(t);else{var s=this._addGroup(i);s&&(t.globalChange=!0,s._onRowInserted(t),e=1)}t.globalChange&&(this._groupViewDirty=!0)}if(this._hidden)return e;var l=t.rid,a=t.rowData;if(!this._isAllowedInGroup(l,a))return e;var h,u=t.nextRid;h=this.isSorting()&&!t.segmentChanged?this._addDataRow(l):this._addDataRow(l,u,t.fallback);var p=this._updatePageCount(),_=this._sort();return _&&(t.globalChange=!0),t.globalChange?_||p||this._transformView():(t={rid:l,rowData:a,type:"inserted"},null!=u&&(t.nextRid=u,t.fallback=h),this._transformView(h)&&(t.globalChange=!0)),this._dispatchDataChange(t),1},lt.prototype._onRowRemoved=function(t){if(this._shared.stalledRids)return 0;if(t.segmentChanged&&this.isSorting())return this._refreshAndNotify(),1;var e,i=0,o=t.rids;if(this._groupMembers){var n,r,s=t.rowData;if(!o&&s){for(n=this._resolveGroupId(s),e=0;e<n.length;e++)r=n[e],this._groupMembers[r]&&(i+=this._groupMembers[r]._onRowRemoved(t));i>1&&(this._groupViewDirty=!0)}else{var l=this._groupList.length;for(e=0;e<l;++e)r=this._groupList[e],i+=this._groupMembers[r]._onRowRemoved(t)}}var a,h,u=NaN,p=null;if(i=0,o){for(p=[],e=o.length;--e>=0;)a=o[e],(h=this._removeDataRow(a))>=0&&(p.push(a),h>=u||(u=h));i=p.length}else a=t.rid,(h=this._removeDataRow(a))>=0&&(p=[a],u=h,i=1);return i>0&&(this._updatePageCount()||this._transformView(u)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(p),this._shared.autoGroupRemoval&&this._groupRows&&this._rids.length<=0&&this._triggerGroupRefreshing(),this._hiddenHeaderRow&&this._requestRebuildingRowIds(!0)),i},lt.prototype._onRowUpdated=function(t){var e,i,o=t.rid,n=t.rowData;if(this.isRowFiltered(o,n))return this._onRowRemoved(t)?1:0;if(this._groupMembers){var r=[],s=this._groupList.length;for(e=0;e<s;++e)i=this._groupList[e],r[this._groupMembers[i]._onRowUpdated(t)]=!0;t.globalChange&&(this._groupViewDirty=!0);var l=0;if(r[2]?l=2:r[1]?this._isAllowedInGroup(o,n)||(l=1):r[4]&&(l=4),this._groupLevel>0)1===l?(lt._removeArrayItem(this._rids,o)>=0&&this._groupView&&lt._removeArrayItem(this._groupView,o),this._shared.multiGroupRow&&(this._groupViewDirty=!0)):2===l&&(this._hidden||(this._rids.indexOf(o)<0&&this._rids.push(o),this._groupViewDirty=!0,this._resolveGroupId(n).length>1&&(this._shared.multiGroupRow=!0)));else{var a=r[1]&&r[2]||r[4];if(this._shared.multiGroupRow||!a){var h=this._resolveGroupId(n);for(e=0;e<h.length;e++){i=h[e];var u=this._addGroup(i);u&&(u._onRowInserted(t),l=1)}}!a&&!this._hidden&&this._rids.indexOf(o)<0&&this._addDataRow(o),4===l?this._shared.multiGroupRow?this._dispatchGlobalChange():this._dispatchDataChange(t):(this._groupViewDirty=!0,this._dispatchGlobalChange())}return l}return this._isAllowedInGroup(o,n)?this._rids.indexOf(o)<0?(this._onRowInserted(t),2):(this._shared.stalledRids||this._sort()&&(t.globalChange=!0),this._dispatchDataChange(t),4):this._onRowRemoved(t)?1:0},lt.prototype._onGroupAdded=function(t){if(!this._hidden){var e=t.newGroup,i=e.getGroupRowId();this._groupView.push(i),this._groupViewDirty=!0,this._dispatch("groupAdded",t),o.pushArrayItems(this._groupView,e.getFooterRowIds())}},lt.prototype._onBeforeGroupAdded=function(t){this._dispatch("beforeGroupAdded",t)},lt.prototype._requestRebuildingRowIds=function(t){this._groupMembers&&(this._groupViewDirty=!0),this._groupLevel>0?this._parent._requestRebuildingRowIds(t):(t?this._rebuildRowIdsFromChildren():this._updateRowIds(),this._dispatchGlobalChange())},lt.prototype._refreshAndNotify=function(){this._updateRowIds(),this._dispatchGlobalChange()},lt.prototype._onRefreshTimeout=function(){this._refreshTimerId=0,this._refreshAndNotify()},lt.prototype._addDataRow=function(t,e,i){var o=this._getRowIndex(this._rids,e,i);return this._insertItems(this._rids,o,t),this._groupView?this._groupMembers?(this._groupViewDirty=!0,this._insertItems(this._groupView,-1,t)):o<0?this._insertItems(this._groupView,-1,t):(o=this._getRowIndex(this._groupView,e,i),this._insertItems(this._groupView,o,t)):o>=0?o:this._rids.length-1},lt.prototype._insertItems=function(t,e,i){return e<0?(e=t.length,t.push(i)):t.splice(e,0,i),e},lt.prototype._getRowIndex=function(t,e,i){if(null==e)return-1;var o=this._rids.indexOf(e);return o>=0?o:null==i||i>=t.length?-1:i},lt.prototype._removeDataRow=function(t){var e=lt._removeArrayItem(this._rids,t);return this._groupView&&e>=0&&(e=lt._removeArrayItem(this._groupView,t)),e},lt._removeArrayItem=function(t,e){var i=t.indexOf(e);return i>=0&&t.splice(i,1),i},lt._removeArrayItems=function(t,e){for(var i=NaN,o=0,n=t.length;--n>=0;)e[t[n]]?++o:o&&(i=n+1,t.splice(i,o),o=0);return o&&(t.splice(0,o),i=0),i},lt._copyObjectKeys=function(t,e){if(e){var i=0;for(var o in e)t[o]=1,++i;return i}return 0},lt.prototype._isAllowedInGroup=function(t,e){if(this._groupLevel>0)for(var i=this,o=this._groupLevel;--o>=0;){if(!i._groupFilterLogic(t,e))return!1;i=i.getDataSource()}return!0},lt.prototype.isRowFiltered=function(t,e){return this._shared.stalledRids?!this._shared.stalledRids[t]:!(!this._hiddenRids||!this._hiddenRids[t])||!(!this._collapsedRids||!this._collapsedRids[t])||!(!this._userFilter||this._userFilter(t,e)!==this._filteringOut)},lt.prototype._sort=function(){if(this._groupMembers)return!1;if(this._dt._getSegmentSeparators()||this.isSorting()){var t=this._rids,e=this._dt.getMultipleRowData(t),i=this._dt.getSegmentValues(t,!0),o=et._performMultiLevelSorting(e,this._sortingDefs,i);if(o)return this._rids=et._reorderItems(t,o),this._transformView(),!0}return!1},lt.prototype._byRemovalMap=function(t){return!this._excludedRids[t]},lt.prototype._getRemovalMap=function(t,e,i,o){if(!e)return 0;var n,r,s,l=this._rids,a=this._dt,h=0,u=l.length;if(o)for(r=u;--r>=0;)o[n=l[r]]||((s=a.getRowData(n))?e(n,s)===i&&(t[n]=1,++h):(t[n]=1,++h));else for(r=u;--r>=0;)n=l[r],(s=a.getRowData(n))?e(n,s)===i&&(t[n]=1,++h):(t[n]=1,++h);return h},lt.prototype._getEmptySegments=function(t,e){var i=this._dt._getSegmentSeparators(),o=0;for(var n in e){var r=i.getSegment(n);if(r){var s=r.getChildren(),l=!0;for(var a in s)if(!t[a]){l=!1;break}l&&(t[n]=1,++o)}}return o},lt.prototype._getFilterLogic=function(t,e){return null!=t?"function"==typeof t?t:"string"==typeof t?lt._defaultFilterLogic.bind(null,t,e):lt._defaultFilterLogic.bind(null,t+"",e):null},lt.prototype._setPage=function(t){return t>this._lastPageIndex&&this._pageCorrection&&(t=this._lastPageIndex),t<1&&(t=1),t!=this._pageIndex&&(this._pageIndex=t,this._transformView(),this._dispatch("pageIndexChanged",{pageIndex:this._pageIndex}),!0)},lt.prototype._updatePaginationView=function(t){var e=!1;if(this._pageView){t||(t=0);var i=this._pageSize*(this._pageIndex-1),o=this._pageSize+i;if(t<o){var n=this._groupView||this._rids;o>n.length&&(o=n.length);var r=o-i;this._pageView.length=r>=0?r:0;for(var s=i;s<o;++s)this._pageView[s-i]=n[s];e=!0}}return e},lt.prototype._updatePageCount=function(){var t=1;if(this._pageSize>0){var e=this._groupView||this._rids,i=e.length>0?e.length:0;t=Math.ceil(i/this._pageSize)}return!!(this._lastPageIndex!==t&&(this._lastPageIndex=t,this._dispatch("pageCountChanged",{pageCount:this._lastPageIndex}),this._lastPageIndex<this._pageIndex&&this._pageCorrection))&&this._setPage(this._lastPageIndex)},lt.prototype._dispatchRowRemoved=function(t){t&&this._dispatchDataChange({type:"removed",rid:t})},lt.prototype._dispatchMultiRowRemoved=function(t){if(t){var e=t.length;1===e?this._dispatchRowRemoved(t[0]):e>1&&this._dispatchDataChange({type:"removed",rids:t})}},lt.prototype._dispatchGlobalChange=function(){this._dispatchDataChange(et._globalChangeArg)},lt.prototype._dispatchDataChange=function(t){this._dispatch("dataChanged",t),this._wrapSize&&!this._wrapTimerId&&(this._wrapTimerId=setTimeout(this._updateWrapCount))},lt.prototype._setParent=function(t){this._parent=t,this._dt=t;do{(t=t.getDataSource())&&(this._dt=t)}while(t);if(this._parent&&this._dt!==this._parent){this._shared=this._parent._shared;var e=this._parent._columnStats;if(e)for(var i in e){var o=this.enableColumnStats(i),n=this._parent.getColumnStats(i);o&&n&&o.setColumnDataGetter(n.getColumnDataGetter())}}},lt.prototype._populateGroups=function(){var t,e,i,o,n,r,s=this._rids;this._rids=[];var l={},a=[];for(e=s.length,t=0;t<e;++t){var h=s[t],u=this._dt.getRowData(h);if(u){(r=(n=this._resolveGroupId(u)).length)>1&&(this._shared.multiGroupRow=!0);for(var p=0;p<r;p++){var _=l[o=n[p]];_?_.push(h):(_=[h],l[o]=_,a.push(o))}}}if(this._shared.autoGroupRemoval)for(t=e=this._groupList.length;--t>=0;)l[o=this._groupList[t]]||(i=this._groupMembers[o])&&!i._predefinedGroup&&this._removeGroupMember(t,o);var c=null;if(this._preDefGroups&&this._groupLevel<this._preDefGroups.length&&(c=this._preDefGroups[this._groupLevel]),e=this._groupList.length,this._preDefGroupsDirty)for(this._preDefGroupsDirty=!1,t=e;--t>=0;)o=this._groupList[t],(i=this._groupMembers[o])&&i._predefinedGroup&&(c?c.indexOf(i._groupId)<0&&this._removeGroupMember(t,o):this._removeGroupMember(t,o));if(c)for(e=c.length,t=0;t<e;++t){var d=this._addGroup(c[t]);d&&(d._predefinedGroup=!0)}for(e=a.length,t=0;t<e;++t)this._addGroup(a[t]);for(e=this._groupList.length,t=0;t<e;++t)o=this._groupList[t],(i=this._groupMembers[o])._updateRowIds(l[o]),i._markColumnStatsDirty();this._groupViewDirty=!0,this._rebuildRowIdsFromChildren()},lt.prototype._removeGroupMember=function(t,e){var i=this._groupMembers[e];i&&(this._groupList.splice(t,1),delete this._groupMembers[e],i.dispose())},lt.prototype._defaultGroupCriteria=function(t,e){var i=e[t];return Array.isArray(i)?i.map((function(t){return t+""})):[i+""]},lt.prototype._groupFilterLogic=function(t,e){return this._groupCriteria[this._groupLevel-1](e).indexOf(this._groupId)>=0},lt.prototype._internalGroupSortingLogic=function(t,e){var i=this._groupMembers[t],o=this._groupMembers[e];return this._groupSortingLogic(t,e,i,o)},lt.prototype._addGroup=function(t){var e=t+"";if(!e)return null;var i=this._groupMembers[e];if(i)return null;var o,n=(this._groupRowId||"_grp")+"_"+e;if(this._hasListener("beforeGroupAdded")&&(o={dataView:this,newGroupId:e,newGroupValue:t,newGroupRowId:n,newGroupLevel:this._groupLevel+1},this._dispatch("beforeGroupAdded",o),o.cancel))return null;i=new lt;var r=this._shared.defaultCollapse;return null!=r&&(i._collapsed=r),i._groupId=e,"string"==typeof t?"null"==t?i._groupValue=null:"undefined"!=t&&(i._groupValue=t):i._groupValue=t,o&&!0===o.hideHeaderRow&&(i._hiddenHeaderRow=!0),i._groupRowId=n,i._groupLevel=this._groupLevel+1,i._groupCriteria=this._groupCriteria,i._preDefGroups=this._preDefGroups,i._groupLevel<i._groupCriteria.length&&(i._groupMembers={},i._groupList=[],i._groupView=[]),i._groupRows=this._groupRows,i._setParent(this),i._sortingDefs=this._sortingDefs,this._groupMembers[e]=i,this._groupList.push(e),this._groupRows[i._groupRowId]=i,this._hidden||(i._isHeaderRowShown()&&this._groupView.push(i._groupRowId),this._groupViewDirty=!0,i._beingAdded=!0,this._dispatch("groupAdded",{dataView:this,newGroup:i}),i._beingAdded=!1),i.listen("groupAdded",this._onGroupAdded),this._hasListener("beforeGroupAdded")&&i.listen("beforeGroupAdded",this._onBeforeGroupAdded),i},lt.prototype._triggerGroupRefreshing=function(){this._groupLevel>0?this._parent&&this._parent._triggerGroupRefreshing():this._groupRows&&!this._refreshTimerId&&(this._refreshTimerId=setTimeout(this._onRefreshTimeout,100))},lt.prototype._rebuildRowIdsFromChildren=function(){if(this._groupViewDirty){if(this._rids.length=0,this._groupView&&(this._groupView.length=0),!this._hidden)for(var t=this._groupList.length,e=0;e<t;++e){var i=this._groupList[e],n=this._groupMembers[i];if(n._rebuildRowIdsFromChildren(),o.pushArrayItems(this._rids,n._rids),!this._collapsed&&this._groupView&&(n._isHeaderRowShown()&&this._groupView.push(n._groupRowId),!n._collapsed)){var r=n._getFirstHiddenRids()||n._groupView||n._rids;o.pushArrayItems(this._groupView,r),o.pushArrayItems(this._groupView,n._footerRowIds)}}this._groupViewDirty=!1,this._updatePageCount()||this._transformView()}},lt.prototype._resolveGroupId=function(t){return this._groupCriteria[this._groupLevel](t)},lt.prototype._markColumnStatsDirty=function(){for(var t in this._columnStats)this._columnStats[t].markDirty()},lt._defaultFilterLogic=function(t,e,i,o){return o[t]===e},lt._defaultGroupSortingLogic=function(t,e){return t==e?0:t<e?-1:1};const at=lt;var ht=function(t,e,i){this._onConflated=this._onConflated.bind(this),this._data=[],"function"==typeof t?this.setFunction(t,i):"function"==typeof e&&this.setFunction(e,i),"number"==typeof e?this.setConflatingTime(e):"number"==typeof t&&this.setConflatingTime(t)};ht.prototype._data,ht.prototype._func=null,ht.prototype._delay=0,ht.prototype._timerId=0,ht.prototype._conflated=!1,ht.prototype._disabled=!1,ht.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},ht.prototype.popAllData=function(){if(this._data.length){var t=this._data;return this._data=[],t}return null},ht.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},ht.prototype.conflate=function(t){return!this._disabled&&(null!=t&&this._data.push(t),!this._conflated&&(this._timerId||(this._timerId=setTimeout(this._onConflated,this._delay)),!0))},ht.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},ht.prototype._onConflated=function(){this._conflated=!0;try{this._func()}catch(t){console.error(t.message||t)}this._timerId=0,this._data.length=0,this._conflated=!1},ht.prototype.getData=function(){return this._data},ht.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},ht.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},ht.prototype.disable=function(t){this._disabled=!1!==t},ht.prototype.isEnabled=function(){return!this._disabled},ht.prototype.enable=function(t){this._disabled=!1===t},ht._proto=ht.prototype;const ut=ht;var pt=function(t){var e=this;e._onDataChanged=e._onDataChanged.bind(e),e.extendEventArg=e.extendEventArg.bind(e),e._dataChangedConflator=new ut(100,e._onDataChanged),e._grid=t,e._grid.setEventArgExtender("rowCountChanged",e.extendEventArg),e._grid.setEventArgExtender("rowHeightChanged",e.extendEventArg),e._grid.setEventArgExtender("rowAvailable",e.extendEventArg),e._grid.listen("rowAvailable",e._dispatch.bind(this,"rowAvailable")),e._addEvent("dataChanged"),e._addEvent("rowAvailable")};u.inherits(pt,l),pt._runningId=0,pt.prototype._id="",pt.prototype._type="",pt.prototype._grid=null,pt.prototype._snapshot=null,pt.prototype._dataView=null,pt.prototype._dataArg=null,pt.prototype._autoSyncRowCount,pt.prototype._bindingEnabled=!0,pt.prototype._parent=null,pt.prototype._children=null,pt.prototype._dataChangedConflator,pt.prototype.getId=function(){return this._id},pt.prototype.setId=function(t){return this._id=t||"section"+pt._runningId++,this._grid.setAttribute("id",this._id),this._id},pt.prototype.getSection=function(){return this._snapshot||this._grid},pt.prototype.getSectionName=function(){return this._grid.getId()},pt.prototype.getIndex=function(){return this._grid.getIndex()},pt.prototype.getType=function(){return this._type},pt.prototype.setType=function(t){this._type!==t&&(this._type&&this._grid.removeClass(this._type),this._type=t||"",t&&this._grid.addClass(t))},pt.prototype.getDataSource=function(){return this._dataView},pt.prototype.setDataSource=function(t){var e=this;e.getAutoSyncRowCount()&&e._dataView!==t&&(e._dataView&&e._dataView.unlisten("dataChanged",this._onDataChanged),e._dataChangedConflator.reset(),e._dataArg=null,e._dataView=t,null!==e._dataView&&e._dataView.listen("dataChanged",e._onDataChanged),e._dispatchDataChanged(0,NaN))},pt.prototype.getRootDataSource=function(){if(!this._dataView)return null;var t=this._dataView.getDataSource();if(!t)return null;for(;t.getDataSource();)t=t.getDataSource();return t},pt.prototype.getData=function(t,e){return this._dataView?(e=this._getRowId(e),this._dataView.getData(e,t)):null},pt.prototype.setData=function(t,e,i){return!!this._dataView&&(e=this._getRowId(e),this._dataView.setData(e,t,i),!0)},pt.prototype.getRowData=function(t){return this._dataView?(t=this._getRowId(t),this._dataView.getRowData(t)):null},pt.prototype.removeRowData=function(t){if(!this._dataView)return!1;var e=this.getRootDataSource();if(!e)return!1;t=this._getRowId(t);var i=e.getRowIndex(t);return!(i<0||(e.removeRow(i),0))},pt.prototype.activateColumns=function(t,e,i){if("content"===this._type)for(var o=i+1;--o>=e;){var n=t[o];null!=n&&this._grid.activateColumn(o,n)}},pt.prototype.getChildren=function(){return this._children},pt.prototype.setParent=function(t){if(this._parent){var e=this._parent._children.indexOf(this);e>=0&&(this._parent._children.splice(e,1),this._parent._children.length<=0&&(this._parent._children=null)),this._parent=null}this._parent=t,this._parent&&(this._parent._children||(this._parent._children=[]),this._parent._children.push(this))},pt.prototype.getParent=function(){return this._parent},pt.prototype.getDataChangedConflator=function(){return this._dataChangedConflator},pt.prototype.disableConflation=function(t){this._dataChangedConflator.disable(t)},pt.prototype.disableDataBinding=function(t){this._bindingEnabled=!1===t},pt.prototype.getAutoSyncRowCount=function(){return null!=this._autoSyncRowCount?this._autoSyncRowCount:"content"===this._type},pt.prototype.setAutoSyncRowCount=function(t){if(this._autoSyncRowCount=t,this.getAutoSyncRowCount()){var e=this._dataView?this._dataView.getVisibleRowCount():0;this._grid.setRowCount(e)}},pt.prototype.isDataBindable=function(){return!(!this._bindingEnabled||!this._dataView)},pt.prototype.dispose=function(){var t=this;t._dataChangedConflator.reset(),t._dataArg=null,t._grid&&t._grid.dispose(),t._dataView&&t._dataView.unlisten("dataChanged",t._onDataChanged),t.unlistenAll(),t.setParent(null),t._grid=null,t._dataView=null},pt.prototype.extendEventArg=function(t){return t||(t={}),t.sectionSettings!==this&&(t.sectionSettings=this,t.section=this._snapshot||this._grid,t.sectionName=this._grid.getId(),t.sectionIndex=this._grid.getIndex(),t.sectionType=this._type,t.dataSource=this._dataView,this._snapshot?t.print=!0:t.print&&(t.print=!1)),t},pt.prototype.extendRenderEventArg=function(t,e,i){return t=this.extendEventArg(t),e>=0||(this._snapshot?(e=0,i=this._grid.getRowCount()):(e=this._grid.getFirstIndexInView(),i=this._grid.getLastIndexInView()+1)),t.fromRowIndex=e,t.toRowIndex=i,t},pt.prototype.extendDataEventArg=function(t,e,i){var o,n;if(t||(t={}),t.firstUpdate=e,t.lastUpdate=i,this._snapshot?(o=0,n=this._grid.getRowCount()):(o=this._grid.getFirstIndexInView(),n=this._grid.getLastIndexInView()+1),t.fromRowIndex=e>o?e:o,this._dataView){var r=this._dataView.getVisibleRowCount();t.dataRowCount=r,n>r&&(n=r)}return t.toRowIndex=i+1<n?i+1:n,this.extendEventArg(t),t},pt.prototype.setIndex=function(t){this._grid.setIndex(t)},pt.prototype.getRowOffset=function(){return this._grid.getRowOffset()},pt.prototype.setRowOffset=function(t){this._grid.setRowOffset(t)},pt.prototype.enableColumnVirtualization=function(t){t=!1!==t,"content"===this._type&&this._grid.enableColumnVirtualization(t)},pt.prototype.isBinding=function(){return this._isEventDispatching("dataChanged")},pt.prototype._onDataChanged=function(t){if(!this.isBinding()){if(this._bindingEnabled){if(t)this._mergeEvent(t);else if(!this._dataArg)return}else if(!this.getAutoSyncRowCount())return;this._dataChangedConflator.conflate()||(this._calculateChangeIndices(),this._dataArg?this._dispatchDataChanged(this._dataArg.firstUpdate,this._dataArg.lastUpdate):this._dispatchDataChanged(0,NaN))}},pt.prototype._dispatchDataChanged=function(t,e){var i=this.getAutoSyncRowCount(),o=this._dataView?this._dataView.getVisibleRowCount():0,n=this._grid.getRowCount();i?o!==n&&this._grid.setRowCount(o,!0):o>n&&(e=n-1),this.updateRowData(t,e,this._dataArg),this._dataArg=null},pt.prototype.updateRowData=function(t,e,i){this.isDataBindable()&&(this._grid._getTempRowHeights()&&(t=this._grid.getFirstIndexInView(),e=this._grid.getLastIndexInView()+1),(i=this.extendDataEventArg(i,t,e)).fromRowIndex<i.toRowIndex&&this._dispatch("dataChanged",i))},pt.prototype.rerender=function(){this.isDataBindable()?this.updateRowData():this._dispatch("rowAvailable",this.extendEventArg())},pt.prototype.snapshot=function(t){if(t){this._snapshot=t;try{t.setColumnCount(this._grid.getColumnCount()),t.setRowCount(this._grid.getRowCount()),this._dispatch("rowAvailable",this.extendEventArg())}catch(t){console.warn("Unable to take a snapshot: "+t.message)}this._snapshot=null,this._dispatch("rowAvailable",this.extendEventArg())}},pt.prototype._getRowId=function(t){return o.isNumber(t)?this._dataView.getRowId(t):t},pt.prototype._mergeEvent=function(t){var e=this._dataArg;if(e||((e=this._dataArg={}).actualUpdate=!0,e.positionChangeOnly=!0,e.events=[],e.firstUpdate=NaN,e.lastUpdate=NaN,e.updatedRids={}),t.positionChangeOnly||(e.positionChangeOnly=!1),t.events?e.events=e.events.concat(t.events):e.events.push(t),!e.globalChange){if(t.globalChange)return e.globalChange=!0,e.firstUpdate=0,void(e.lastUpdate=NaN);var i=t.rids;if(i)for(var o=i.length;--o>=0;)e.updatedRids[i[o]]=!0;else t.rid&&(e.updatedRids[t.rid]=!0);"updated"!==t.type&&(e.indexShifted=!0,"removed"===t.type&&(e.dataRemoved=!0))}},pt.prototype._calculateChangeIndices=function(){var t,e;if(this.isDataBindable()&&!this._dataArg.globalChange)if(this._dataArg.indexShifted){if(this._dataArg.dataRemoved)this._dataArg.firstUpdate=0;else for(t in this._dataArg.updatedRids)(e=this._dataView.getRowIndex(t))>=0&&(this._dataArg.firstUpdate<=e||(this._dataArg.firstUpdate=e));this._dataArg.lastUpdate=this._dataView.getVisibleRowCount()}else for(t in this._dataArg.updatedRids)(e=this._dataView.getRowIndex(t))>=0&&(this._dataArg.firstUpdate<=e||(this._dataArg.firstUpdate=e),this._dataArg.lastUpdate>=e||(this._dataArg.lastUpdate=e))},pt._proto=pt.prototype;const _t=pt;var ct=function(t){this._layout=t,this._arg={},this._addEvent("indexChanged")};u.inherits(ct,l),ct.prototype._layout,ct.prototype._viewSize=0,ct.prototype._viewOffset=0,ct.prototype._startOffsetCount=0,ct.prototype._endOffsetCount=0,ct.prototype._bufferSize=0,ct.prototype._arg=null,ct.prototype._enabled=!0,ct.prototype._active=!0,ct.prototype._virtualizable=!1,ct.prototype._getMinIndex=function(){return this._startOffsetCount},ct.prototype._getMaxIndex=function(){var t=this._layout.getLaneCount()-this._endOffsetCount;return t>this._startOffsetCount?t:this._startOffsetCount},ct.prototype.getContentStart=function(t){return this._layout.getLaneStart(t)},ct.prototype.getContentInViewCount=function(){var t=this.getFirstIndexInView(),e=this.getLastIndexInView();return t>=0&&t<e?e-t+1:0},ct.prototype._getContentSizeInBounds=function(){var t=this._getMinIndex(),e=this._getMaxIndex();return this._layout.getLaneStart(e)-this._layout.getLaneStart(t)},ct.prototype.getViewSize=function(){return this._viewSize},ct.prototype.getViewOffset=function(){var t=this._getMinIndex();return this._viewOffset+this._layout.getLaneStart(t)},ct.prototype.getIndexOffset=function(){return this._startOffsetCount},ct.prototype.isVirtualizable=function(){return this._virtualizable},ct.prototype.getFirstIndexInView=function(){if(!this._virtualizable)return 0;var t=this.getViewOffset(),e=this._layout.getTrackSize();return t>=e&&(t=e-this._viewSize),t<0?0:this._layout.hitTest(t)},ct.prototype.getLastIndexInView=function(){if(this._virtualizable){var t=this.getViewOffset()+this._viewSize,e=this._getMaxIndex();return t>=this._layout.getLaneStart(e)?e-1:this._layout.hitTest(t)}return this._layout.getLaneCount()-1},ct.prototype.getPrevFirstIndexInView=function(){return null!=this._arg.prevFirstIndex?this._arg.prevFirstIndex:-1},ct.prototype.getPrevLastIndexInView=function(){return null!=this._arg.prevLastIndex?this._arg.prevLastIndex:-1},ct.prototype.update=function(t){if(!(!0===t||this._enabled&&this._active))return!1;if(this._isEventDispatching("indexChanged"))return!1;var e=this.getFirstIndexInView(),i=this.getLastIndexInView(),o=this._arg.prevFirstIndex!==e||this._arg.prevLastIndex!==i;return(t||o)&&(this._arg.firstIndex=e,this._arg.lastIndex=i,this._dispatch("indexChanged",this._arg),this._arg.prevFirstIndex=e,this._arg.prevLastIndex=i),o},ct.prototype.isEnabled=function(){return this._enabled},ct.prototype.enable=function(t){t=!1!==t,this._enabled!==t&&(this._enabled=t,this.validateVirtualization(),this.update(!0))},ct.prototype.disable=function(t){this.enable(!1===t)},ct.prototype.isActive=function(){return this._active},ct.prototype.activate=function(t){t=!1!==t,this._active!==t&&(this._active=t,this.validateVirtualization(),this.update(!0))},ct.prototype.deactivate=function(t){this.activate(!1===t)},ct.prototype.getBufferSize=function(){return this._bufferSize},ct.prototype.setContentLayout=function(t){this._layout!==t&&(this._layout=t,this.validateVirtualization())},ct.prototype.setViewSize=function(t){t<0&&(t=0),this._viewSize!==t&&(this._viewSize=t,this.validateVirtualization())},ct.prototype.setViewOffset=function(t){this._viewOffset=t>0?t:0,this.update()},ct.prototype.setViewBounds=function(t,e){this._startOffsetCount=t>0?t:0,this._endOffsetCount=e>0?e:0,this.validateVirtualization()},ct.prototype.setBufferSize=function(t){t<0&&(t=0),this._bufferSize!==t&&(this._bufferSize=t,this.validateVirtualization())},ct.prototype.validateVirtualization=function(){this._virtualizable=!1,this._enabled&&this._active&&this._viewSize>0&&this._getContentSizeInBounds()>this._viewSize&&(this._virtualizable=!0)},ct._proto=ct.prototype;const dt=ct;var gt=function(){var t=this;t._vertical=!0,t._hostClassName="vscrollbar-host",gt.base(this,"constructor"),t._onScroll=t._onScroll.bind(t),t._addPaneAt(),t._element.classList.add("grid-vscroll"),t._trackContent.style.width="1px",t.disableMouseWheel(!1),t.listen("scroll",t._onScroll),t._addEvent("contentScrolled")};u.inherits(gt,k),gt.prototype.setScrollContent=function(t,e,i){this._clearAllPanes();var o=e.length;if(!(o<=0)){for(var n=this._panes[0],r=this._paneSliders[0],s=0;s<i;)e[s++].setParent(t);n.setParent(t);for(var l=o-this._footerCount;s<l;)e[s++].setParent(r);for(;s<o;)e[s++].setParent(t);this.invalidateContent()}},gt.prototype.setHeight=function(t){return this.setTrackSize(t,t),!0},gt.prototype.getHeight=function(){return this.getPaneSize()},gt.prototype.getScrollTop=function(){return this._getScrollValue()},gt.prototype.setScrollTop=function(t){this.update(),this._scrollTo(t)},gt.prototype.isEndOfVerticalScroll=function(){return this._isEndOfScroll()},gt.prototype.getContentHeight=function(){for(var t=this._paneSliders[0].getContent(!0),e=0,i=t.length;--i>=0;)e+=t[i].offsetHeight;return e},gt.prototype.calculateContentSize=function(){return this.getContentHeight()},gt.prototype.getPane=function(){return this._panes[0]},gt.prototype._onScroll=function(t){this._dispatch("contentScrolled",t)},gt._proto=gt.prototype;const ft=gt;var yt=function(t,e){return t>e?e:t<0?0:t},mt=function(t){var e=this;e._onRestingPosition=e._onRestingPosition.bind(e),e._updateRowBounds=e._updateRowBounds.bind(e),e._element=document.createElement("div"),e._element.className="tr-vlg section",t||(t={}),t.horizontalScrollbar&&(e._hscrollbar=t.horizontalScrollbar),t.owner=this,e._grid=new N(t),e._grid.setParent(e._element),e._layoutY=new m,e._selectionList=new P,e._reverter=new F(e._onRestingPosition,200),e._addEvent("rowHighlighted"),e._addEvent("rowCountChanged"),e._addEvent("rowHeightChanged"),e._addEvent("rowAvailable")};u.inherits(mt,_),mt.prototype._index=-1,mt.prototype._rowOffset=0,mt.prototype._firstIndex=0,mt.prototype._grid,mt.prototype._layoutY,mt.prototype._selectionList=null,mt.prototype._reverter=null,mt.prototype._rowBounds=null,mt.prototype._rowBoundCache=null,mt.prototype._rowSelDirty=!1,mt.prototype._cellBound=null,mt.prototype._cbLftIdx=0,mt.prototype._cbRgtIdx=0,mt.prototype._cbTopIdx=0,mt.prototype._cbBtmIdx=0,mt.prototype._rowBoundTimer=0,mt.prototype._boundLayer=null,mt.prototype._hscrollbar=null,mt.prototype._session="A",mt.prototype._tempRowHeights=null,mt.prototype.getWidth=function(){return this.isVisible()?this._grid.getWidth():0},mt.prototype.getHeight=function(){return this.isVisible()?this._element.offsetHeight:0},mt.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._hscrollbar=null,this._grid.dispose(),this._dispose(),this._reverter.dispose(),this._rowBounds=this._rowBoundCache=null,this._rowSelDirty=!1,this._rowBoundTimer&&(clearTimeout(this._rowBoundTimer),this._rowBoundTimer=0)},mt.prototype.setWidth=function(t){return this._grid.setWidth(t)},mt.prototype.setHeight=function(t){return console.log("unsupported"),!1},mt.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount())},mt.prototype.hitTest=function(t,e){var i=[];return i.colIndex=this._grid.hitTestX(t),i.rowIndex=this._layoutY.hitTest(e),i},mt.prototype.hitTestX=function(t){return this._grid.hitTestX(t)},mt.prototype.hitTestY=function(t){return this._layoutY.hitTest(t)},mt.prototype.getDefaultColumnWidth=function(){return this._grid.getDefaultColumnWidth()},mt.prototype.setDefaultColumnWidth=function(t){this._grid.setDefaultColumnWidth(t)},mt.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},mt.prototype.setDefaultRowHeight=function(t){this._layoutY.getDefaultLaneSize()!==t&&(this._layoutY.setDefaultLaneSize(t),this._element.style.height=this._layoutY.getTrackSize()+"px",this._grid.setDefaultRowHeight(t),this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount()))},mt.prototype.getColumnWidth=function(t){return this._grid.getColumnWidth(t)},mt.prototype.setColumnWidth=function(t,e){return this._grid.setColumnWidth(t,e)},mt.prototype._setColumnWidth=function(t,e){return this._grid._setColumnWidth(t,e)},mt.prototype._updateColumnLayout=function(){this._grid._updateColumnLayout()},mt.prototype._startBindingSession=function(t){if(this._isBinding=t,!t){if(this._tempRowHeights){var e=this.getDefaultRowHeight(),i=!0,o=[];for(var n in this._tempRowHeights){var r=+n,s=this._layoutY.getLaneProperty(r,"sizeSession");s&&s!=this._session&&(this.setRowHeight(r,e),this._layoutY.setLaneProperty(r,"sizeSession",null),o.push(r))}for(var l=o.length,a=0;a<l;a++)delete this._tempRowHeights[o[a]];if(l)for(var h in this._tempRowHeights){i=null!=h;break}i||(this._tempRowHeights=null)}this._session="A"===this._session?"B":"A"}},mt.prototype._getTempRowHeights=function(){return this._tempRowHeights},mt.prototype.getRowHeight=function(t){return this._layoutY.getLaneSize(t)},mt.prototype.setRowHeight=function(t,e){return this._isBinding&&e!=this.getDefaultRowHeight()&&(this._layoutY.setLaneProperty(t,"sizeSession",this._session),this._tempRowHeights||(this._tempRowHeights=[]),this._tempRowHeights[t]=!0),!!this._layoutY.setLaneSize(t,e)&&(this._grid.setRowHeight(t-this._firstIndex,e),this._element.style.height=this._layoutY.getTrackSize()+"px",this._requestUpdatingRowBounds(),this._dispatchRowHeightChangedEvent(t,t+1))},mt.prototype.isColumnVisible=function(t){return this._grid.isColumnVisible(t)},mt.prototype.hideColumn=function(t,e){return this._grid.hideColumn(t,e)},mt.prototype.isRowVisible=function(t){return this._grid.isRowVisible(t-this._firstIndex)},mt.prototype.hideRow=function(t,e){return this._grid.hideRow(t-this._firstIndex,e)},mt.prototype.getMinimumColumnWidth=function(t){return this._grid.getMinimumColumnWidth(t)},mt.prototype.setMinimumColumnWidth=function(t,e){return this._grid.setMinimumColumnWidth(t,e)},mt.prototype.getMinimumRowHeight=function(t){return this._layoutY.getMinimumLaneSize(t)},mt.prototype.setMinimumRowHeight=function(t,e){return console.log("unsupported"),!1},mt.prototype.getCellLeft=function(t){return this._grid.getCellLeft(t)},mt.prototype.getCellTop=function(t){return this._layoutY.getLaneStart(t)},mt.prototype.getCellWidth=function(t,e){return this._grid.getCellWidth(t,0)},mt.prototype.getCellHeight=function(t,e){return this._layoutY.getLaneSize(e)},mt.prototype.hasCellSpan=function(){return this._grid.hasCellSpan()},mt.prototype.getCellRowSpan=function(t,e){return this._grid.getCellRowSpan(t,e-this._firstIndex)},mt.prototype.setCellRowSpan=function(t,e,i){return this._grid.setCellRowSpan(t,e-this._firstIndex,i)},mt.prototype.getCellColSpan=function(t,e){return this._grid.getCellColSpan(t,e-this._firstIndex)},mt.prototype.setCellColSpan=function(t,e,i){return this._grid.setCellColSpan(t,e-this._firstIndex,i)},mt.prototype.clearCellSpans=function(){return this._grid.clearCellSpans()},mt.prototype.clearColumnSpans=function(t){return this._grid.clearColumnSpans(t)},mt.prototype.clearColumnCustomizations=function(){this._grid.clearColumnCustomizations()},mt.prototype.clearRowCustomizations=function(){this._layoutY.clearLaneCustomizations(),this._grid.clearRowCustomizations()},mt.prototype.getColumnScalability=function(t){return this._grid.getColumnScalability(t)},mt.prototype.setColumnScalability=function(t,e){return this._grid.setColumnScalability(t,e)},mt.prototype.getRowScalability=function(t){return this._layoutY.getLaneScalability(t)},mt.prototype.setRowScalability=function(t,e){return console.log("unsupported"),!1},mt.prototype.getCell=function(t,e,i){return this._grid.getCell(t,e-this._firstIndex,i)},mt.prototype.getCellContent=function(t,e){return this._grid.getCellContent(t,e-this._firstIndex)},mt.prototype.setCellContent=function(t,e,i){return this._grid.setCellContent(t,e-this._firstIndex,i)},mt.prototype.getColumnCount=function(){return this._grid.getColumnCount()},mt.prototype.setColumnCount=function(t){this._grid.setColumnCount(t)},mt.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},mt.prototype.setRowCount=function(t,e){var i=this._layoutY.getLaneCount();i!==t&&(this._layoutY.setLaneCount(t),this._tempRowHeights&&(this._tempRowHeights.length=t),this._element.style.height=this._layoutY.getTrackSize()+"px",this._requestUpdatingRowBounds(),this._dispatch("rowCountChanged",{rowCount:t,prevCount:i,noBinding:e}))},mt.prototype.getVisibleRowCount=function(){return this.getRowCount()},mt.prototype.addRow=function(t){t<=0||(this._grid.getColumnCount()<=0?console.log("WARNING: Row cannot be added, unless at least one column is added"):this.setRowCount(this._layoutY.getLaneCount()+t))},mt.prototype.removeRow=function(t){if(!(t<=0)){var e=this._layoutY.getLaneCount();t>e&&(t=e),this.setRowCount(e-t)}},mt.prototype.setBorders=function(t,e,i,o){this._grid.setBorders(t,e,i,o)},mt.prototype.getColumnStyle=function(t,e){return this._grid.getColumnStyle(t,e)},mt.prototype.setColumnStyle=function(t,e,i){this._grid.setColumnStyle(t,e,i)},mt.prototype.enableColumnClass=function(t,e,i){this._grid.enableColumnClass(t,e,i)},mt.prototype.hasColumnClass=function(t,e){return this._grid.hasColumnClass(t,e)},mt.prototype.enableRowClass=function(t,e,i){this._grid.enableRowClass(t-this._firstIndex,e,i)},mt.prototype.setRowStyle=function(t,e,i,o){this._grid.setRowStyle(t-this._firstIndex,e,i,o)},mt.prototype.getContentWidth=function(){return this._grid.getContentWidth()},mt.prototype.getContentHeight=function(){return this._layoutY.getTrackSize()},mt.prototype.getCellsByRowIndex=function(t){return this._grid.getCellsByRowIndex(t-this._firstIndex)},mt.prototype.disableHorizontalGridLine=function(t){this._grid.disableHorizontalGridLine(t)},mt.prototype.disableVerticalGridLine=function(t){this._grid.disableVerticalGridLine(t)},mt.prototype.enableShading=function(t){this._grid.enableShading(t)},mt.prototype.setTransposedShading=function(t){this._grid.setTransposedShading(t)},mt.prototype.enableRowHighlighting=function(t){this._grid.enableRowHighlighting(t)},mt.prototype.getRowHighlight=function(){var t=this._grid.getRowHighlight();return t>=0&&(t+=this._firstIndex),t},mt.prototype.setRowHighlight=function(t){var e=this._grid.getRowHighlight();if(e>=0&&(e+=this._firstIndex),this._grid.setRowHighlight(t-this._firstIndex),(t=this._grid.getRowHighlight())>=0&&(t+=this._firstIndex),this._hasListener("rowHighlighted")){var i={};i.prevRowIndex=e,i.rowIndex=t,this._dispatch("rowHighlighted",i)}},mt.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},mt.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},mt.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},mt.prototype.setSelectedRow=function(t,e){this._selectionList.setSelection(t,e);var i=this._selectionList.getSelection(t);this._grid.setSelectedRow(t-this._firstIndex,i),i&&(this._rowSelDirty=!0,this._initBoundLayer()),this._requestUpdatingRowBounds()},mt.prototype.selectSingleRow=function(t){this._selectionList.clearAllSelections(),this._grid.clearSelectedRows(),this.setSelectedRow(t)},mt.prototype.selectRowRange=function(t,e){this._selectionList.selectRange(t,e),this._updateRowSelection(),this._rowSelDirty=!0,this._initBoundLayer(),this._requestUpdatingRowBounds()},mt.prototype.clearSelectedRows=function(){var t=this._selectionList.clearAllSelections();return this._grid.clearSelectedRows(),this._requestUpdatingRowBounds(),t},mt.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},mt.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},mt.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},mt.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},mt.prototype.activateColumn=function(t,e){this._grid.activateColumn(t,e)},mt.prototype.activateRows=function(t,e,i){var o=this._layoutY.getLaneCount();t||(t=this._rowOffset),e||0===e||(e=t+o),(t-=this._rowOffset)<0&&(t=0),(e-=this._rowOffset)<0&&(e=0);var n=this._getInnerRowCount(),r=this._firstIndex,s=0;(s=t-(1&t))<0?s=0:s>o&&(s=o);var l=e+(1&e)-s;l+2===n&&(l=n),l<0?l=0:l+s>o&&(l=o-s),this._firstIndex=s;var a=s+l,h=this._layoutY.getLaneStart(s),u=this._grid.getElement();u&&(u.style.transform=h?"translateY("+h+"px)":"",u.style.top="",this._reverter.start()),this._grid._onEnterDocument();var p=!1;if(l!==n){if(this._grid.setRowCount(l),l>n){var _={};_.prevRowIndex=s+n,_.rowIndex=s+l,i&&(_.noDataUpdate=!0),this._dispatch("rowAvailable",_)}p=!0}if(i){if(!p){this._grid.clearSelectedRows();var c=r+n;s<r&&r<a&&c>=a?(this.moveRowsToTop(a-r),i[0]=s,i[1]=r):r<s&&s<c&&a>=c?(this.moveRowsToTop(s-r),i[0]=c,i[1]=a):s===r&&a===c?(i[0]=0,i[1]=0):p=!0}p&&(i[0]=s,i[1]=a)}this._layoutY.isHomogeneous()||this._grid._updateRowHeights(this._layoutY,s),this._updateRowSelection()},mt.prototype.moveRowsToTop=function(t){this._grid.moveRowsToTop(t)},mt.prototype.getFirstIndexInView=function(){return this._firstIndex},mt.prototype.getLastIndexInView=function(){var t=this._firstIndex+this._getInnerRowCount()-1,e=this._grid._getContext().getDataSource(),i=e?e.getRowCount()-1:-1;return t>i?i:t},mt.prototype.isInCurrentView=function(t){return this._firstIndex<=t&&t<this._firstIndex+this._getInnerRowCount()},mt.prototype.getFrozenLayout=function(){return this._grid.getFrozenLayout()},mt.prototype.setFrozenLayout=function(t){this._grid.setFrozenLayout(t)},mt.prototype.getColumn=function(t){return this._grid.getColumn(t)},mt.prototype.insertColumn=function(t,e){return this._grid.insertColumn(t,e)},mt.prototype.removeColumnAt=function(t){return this._grid.removeColumnAt(t)},mt.prototype.moveColumn=function(t,e){this._grid.moveColumn(t,e)},mt.prototype.enableRowVirtualization=function(t){},mt.prototype.enableColumnVirtualization=function(t){this._grid.enableColumnVirtualization(t)},mt.prototype.getColumnIndex=function(t){return this._grid.getColumnIndex(t)},mt.prototype.getCellIndex=function(t,e){var i=this._grid.getCellIndex(t,e);return i<0?-1:i+this._firstIndex},mt.prototype.getIndex=function(){return this._index},mt.prototype.setIndex=function(t){this._index=t},mt.prototype.setRowOffset=function(t){this._rowOffset=t},mt.prototype.getRowOffset=function(){return this._rowOffset},mt.prototype.updateLayout=function(){this._grid.updateLayout()},mt.prototype.stretchCell=function(t,e,i,o){var n=this._grid.stretchCell(t,null!=e?e-this._firstIndex:null,i,o);if(n){var r=n.getElement();0===e?r.classList.add("top"):r.classList.remove("top")}return n},mt.prototype.unstretchCell=function(t,e){return this._grid.unstretchCell(t,null!=e?e-this._firstIndex:null)},mt.prototype.unstretchAllCells=function(){this._grid.unstretchAllCells()},mt.prototype.getStretchedCell=function(t,e){return this._grid.getStretchedCell(t,null!=e?e-this._firstIndex:null)},mt.prototype.getStretchedCells=function(){return this._grid.getStretchedCells()},mt.prototype.updateStretchedCells=function(){return this._grid.updateStretchedCells()},mt.prototype.getColumnHost=function(){return this._grid.getElement()},mt.prototype.setHidingMethod=function(t){this._grid.setHidingMethod(t)},mt.prototype.getHidingMethod=function(){return this._grid.getHidingMethod()},mt.prototype.setColumnVisibility=function(t,e,i){return this._grid.setColumnVisibility(t,e,i)},mt.prototype.getRowLayout=function(){return this._layoutY},mt.prototype.reserveRightSpace=function(t){return this._grid.reserveRightSpace(t)},mt.prototype.getReservedSpace=function(){return this._grid.getReservedSpace()},mt.prototype.getComputedStyle=function(){return this._grid.getComputedStyle()},mt.prototype.isColumnActive=function(t){return this._grid.isColumnActive(t)},mt.prototype.setRowAttributes=function(t,e){return this._grid.setRowAttributes(t,e)},mt.prototype.getContextRow=function(t){return this._grid.getContextRow(t-this._firstIndex)},mt.prototype.selectColumn=function(t,e){this._grid.selectColumn(t,e)},mt.prototype.isSelectedColumn=function(t){return this._grid.isSelectedColumn(t)},mt.prototype.selectCell=function(t,e,i){this._grid.selectCell(t,e-this._firstIndex,i)},mt.prototype.setCellBounds=function(t,e,i,o){var n=this._cellBound;n||((n=this._cellBound=document.createElement("div")).className="selection-bound"),this._initBoundLayer();var r=t+i,s=e+o,l=this.getColumnCount(),a=this._layoutY.getLaneCount();this._cbLftIdx=yt(t,l),this._cbRgtIdx=yt(r,l),this._cbTopIdx=yt(e,a),this._cbBtmIdx=yt(s,a),this._updateCellBounds()},mt.prototype.getHorizontalLayout=function(){return this._grid.getHorizontalLayout()},mt.prototype.calculateColumnBounds=function(t,e,i,o){this._grid.calculateColumnBounds(t,e,i,o)},mt.prototype._updateCellBounds=function(){var t=this._cellBound;if(t){var e,i,o,n,r=this.getHorizontalLayout(),s=this._layoutY,l=this._cbLftIdx,a=this._cbRgtIdx,h=this._cbTopIdx,u=this._cbBtmIdx;e=i=o=n=0,l<a&&h<u&&(e=r.getLaneStart(l),i=r.getLaneEnd(a-1),o=s.getLaneStart(h),n=s.getLaneEnd(u-1));var p=i-e,_=n-o,c=[!1,!1];if(p>0&&_>0&&this._hscrollbar){var d=[0,0];this.calculateColumnBounds(l,a-1,d,c),p=(i=d[1])-(e=d[0])}if(p>0)t.style.left=e+"px",t.style.top=o+"px",t.style.width=p+"px",t.style.height=_+"px",t.classList.toggle("no-left-bound",c[0]),t.classList.toggle("no-right-bound",c[1]),this._boundLayer&&this._boundLayer.appendChild(t);else{var g=t.parentNode;g&&g.removeChild(t)}}},mt.prototype.updateColumnBounds=function(t,e,i){this._grid.updateColumnBounds(t,e,i),this._updateRowBounds()},mt.prototype.updateColumnSeparators=function(){this._grid.updateColumnSeparators()},mt.prototype._initBoundLayer=function(){var t=this._boundLayer;t||((t=this._boundLayer=document.createElement("div")).className="cover-layer",this._element.appendChild(t))},mt.prototype._requestUpdatingRowBounds=function(){this._rowBoundTimer||(this._rowBoundTimer=setTimeout(this._updateRowBounds,10))},mt.prototype._updateRowBounds=function(){if(this._rowBoundTimer=0,this._updateCellBounds(),this._rowSelDirty){var t=this._rowBounds,e=this._rowBoundCache;t||(t=this._rowBounds=[]),e||(e=this._rowBoundCache=[]);var i=this._selectionList,o=this._layoutY.getLaneCount();i.deselectFrom(o);var n,r=i.getConnectedRanges(),s=r.length,l=null,a=null,h=t.length;for(n=s;n<h;++n)(l=(a=t[n]).parentNode)&&l.removeChild(a);if(t.length=h=s,s){var u=0,p=0,_=0,c=!1;this._hscrollbar&&(u=this._hscrollbar.getScrollLeft(),p=this._hscrollbar.getPinnedLeftColumnCount(),_=this._hscrollbar.getPinnedRightColumnCount(),c=this._hscrollbar.isEndOfHorizontalScroll());var d=!p&&u>0,g=!_&&!c,f=this._grid._getViewSize();for(n=0;n<s;++n){var y=r[n],m=y[0],v=y[1],C=this._layoutY.getLaneStart(m),S=this._layoutY.getLaneEnd(v);(a=e[n])||((a=e[n]=document.createElement("div")).className="selection-bound"),a.style.top=C+"px",a.style.height=S-C+"px",a.style.width=f+"px",a.classList.toggle("no-left-bound",d),a.classList.toggle("no-right-bound",g),this._boundLayer&&(t[n]||(t[n]=a,this._boundLayer.appendChild(a)))}}else i.getSelectionCount()||(this._rowSelDirty=!1)}},mt.prototype._getInnerRowCount=function(){return this._grid.getRowCount()},mt.prototype._updateRowSelection=function(){this._grid.clearSelectedRows();var t=this._selectionList,e=t.getSelectionCount();if(!(e<=0)){var i,o=this._firstIndex,n=o+this._getInnerRowCount();if(1===e)o<=(i=t.getFirstSelectedIndex())&&i<n&&this._grid.setSelectedRow(i-o,!0);else if(e>=n-o)for(i=o;i<n;++i)t.getSelection(i)&&this._grid.setSelectedRow(i-o,!0);else for(var r=t.getAllSelections(),s=0;s<e;++s)o<=(i=r[s])&&i<n&&this._grid.setSelectedRow(i-o,!0)}},mt.prototype._dispatchRowHeightChangedEvent=function(t,e){if(t>=e)return!1;var i={};return i.rowIndex=t,i.changeLength=e-t,this._dispatch("rowHeightChanged",i),!0},mt.prototype._onRestingPosition=function(){var t=this._grid.getElement();if(t){var e=this._layoutY.getLaneStart(this._firstIndex);t.style.transform="",t.style.top=e?e+"px":""}},mt.prototype._updateRightSpaceStyle=function(){this._grid._updateRightSpaceStyle()},mt.prototype._updateLayers=function(){this._grid._updateLayers()},mt.prototype._setContext=function(t){this._grid._setContext(t)},mt.prototype._getContext=function(){return this._grid._getContext()},mt._proto=mt.prototype;const vt=mt;var Ct=function(t,e){return t-e},St=function(t){St._sectionType||(St._sectionType={},St._sectionType.title=!0,St._sectionType.header=!0,St._sectionType.content=!0,St._sectionType.footer=!0);var e=this;if(e.getColumnId=e.getColumnId.bind(e),e.getColumnIndex=e.getColumnIndex.bind(e),e._onMouseMove=e._onMouseMove.bind(e),e._onRowHightlighted=e._onRowHightlighted.bind(e),e._onGridClicked=e._onGridClicked.bind(e),e._onWindowResize=e._onWindowResize.bind(e),e._onSectionDataChanged=e._onSectionDataChanged.bind(e),e._onRowCountChanged=e._onRowCountChanged.bind(e),e._onRowHeightChanged=e._onRowHeightChanged.bind(e),e._onRowAvailable=e._onRowAvailable.bind(e),e._onVScroll=e._onVScroll.bind(e),e._onHScroll=e._onHScroll.bind(e),e._onSyncVScroll=e._onSyncVScroll.bind(e),e._onSyncHScroll=e._onSyncHScroll.bind(e),e.updateLayout=e.updateLayout.bind(e),e._onRowRefresh=e._onRowRefresh.bind(e),e._onVScrollEnabled=e._onVScrollEnabled.bind(e),e._onVScrollDisabled=e._onVScrollDisabled.bind(e),e._onRowInViewChanged=e._onRowInViewChanged.bind(e),e._onColInViewChanged=e._onColInViewChanged.bind(e),e._updateVScrollbar=e._updateVScrollbar.bind(e),e._updateColumnBounds=e._updateColumnBounds.bind(e),e._dispatchColumnPositionChanged=e._dispatchColumnPositionChanged.bind(e),e._dispatchRowPositionChanged=e._dispatchRowPositionChanged.bind(e),e._requestScrollbarUpdate=e._requestScrollbarUpdate.bind(e),t)for(var i=t.childNodes.length;--i>=0;)o.isElement(t.childNodes[i])||t.removeChild(t.childNodes[i]);e._element=t||document.createElement("div"),e._element.classList.add("tr-grid"),e._layoutX=new m,e._layoutY=new m,e._layoutX.setDefaultLaneSize(100),e._layoutY.setDefaultLaneSize(32),e._settings=[],e._plugins={},e._columnDefs=[],e._sectionStarts=[],e._rowHeightException="title",e._rowVirtualizer=new dt(e._layoutY),e._rowVirtualizer.deactivate(),e._rowVirtualizer.setViewSize(360),e._colVirtualizer=new dt(e._layoutX),e._colVirtualizer.enable(!1),e._colVirtualizer.deactivate(),e._colVirtualizer.setViewSize(400),e._vscrollbar=new ft,e._vscrollbar.disable(),e._vscrollbar.setParent(this.getParent()||this.getElement()),e._vscrollbar.listen("scroll",e._onVScroll),e._vscrollbar.listen("layoutChanged",e._onVScroll),e._vscrollbar.listen("activated",e.updateLayout),e._vscrollbar.listen("deactivated",e.updateLayout),e._vscrollbar.listen("thicknessChanged",e.updateLayout),e._vscrollbar.listen("enabled",e._onVScrollEnabled),e._vscrollbar.listen("disabled",e._onVScrollDisabled),e._hscrollbar=new G,e._hscrollbar.disable(),e._hscrollbar.setParent(this.getParent()||this.getElement()),e._hscrollbar.listen("scroll",this._onHScroll),e._hscrollbar.listen("layoutChanged",this._onHScroll),e._hscrollbar.listen("activated",this.updateLayout),e._hscrollbar.listen("deactivated",this.updateLayout),e._hscrollbar.setOtherScrollbar(e._vscrollbar),e._vscrollbar.setOtherScrollbar(e._hscrollbar),o.isMobile||o.isTouchDevice?e._element.addEventListener("touchmove",this._onMouseMove,!1):e._element.addEventListener("mousemove",this._onMouseMove,!1),o.isSafari&&e._element.addEventListener("click",this._onGridClicked),window.addEventListener("resize",e._onWindowResize,!1),e._rowVirtualizer.listen("indexChanged",e._onRowInViewChanged),e._colVirtualizer.listen("indexChanged",e._onColInViewChanged),e._rowHeightConflator=new ut(e._onRowHeightChanged,50),e._vScrollbarConflator=new ut(e._updateVScrollbar,200),e._columnBoundConflator=new ut(e._updateColumnBounds,10),e._columnPositionConflator=new ut(e._dispatchColumnPositionChanged,10),e._rowPositionConflator=new ut(e._dispatchRowPositionChanged,10),e._addEvents("sectionAdded","columnAdded","columnRemoved","columnMoved","columnVisibilityChanged","columnAlignmentChanged","widthChanged","dataSourceChanged","postDataSourceChanged","preSectionRender","postSectionRender","beforeContentBinding","preSectionDataBinding","postSectionDataBinding","firstRendered","afterContentBinding","rowExpansionBinding","rowHighlighted","preForcedUpdate","rowAdded","rowRemoved","columnPositionChanged","rowPositionChanged","beforeColumnBoundUpdate","beforeBatchOperation","afterBatchOperation","pinningChanged");var n=St.map;n||(n={},St.map=n);var r=e._element;r._control=e;var s=r.id||r.name;s&&!n[s]||(s="_grid"+St._runningGridId),e._id=s,n[s]=e,St._runningGridId++;var l=document.createElement("input");l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.padding="0",l.style.border="0",l.value="0",e._hiddenInput=l,r.insertBefore(l,r.firstChild),Object.defineProperty(e,"zoomFactor",{set:function(t){!t||t<0||this._zoomFactor!==t&&(this._zoomFactor=t,e._updateLayout())},get:function(){return this._zoomFactor}})};u.inherits(St,_),St.SectionReference,St.MouseInfo,St.BatchInfo,St.CellReference,St.ColumnOptions,St._runningGridId=0,St._runningColumnId=0,St._sectionType,St.prototype._plugins,St.prototype._dataSource=null,St.prototype._layoutX,St.prototype._layoutY,St.prototype._vscrollbar,St.prototype._hscrollbar,St.prototype._tempFrozenSectionRef="",St.prototype._startVScrollbarIndex=-1,St.prototype._hScrollbarEnabled=!0,St.prototype._pinnedLeftColumnCount=0,St.prototype._pinnedRightColumnCount=0,St.prototype._frozenFooterCount=0,St.prototype._fixFrozenTopSections=!1,St.prototype._fixFrozenBottomSection=!1,St.prototype._sectionStarts,St.prototype._settings,St.prototype._firstSettings,St.prototype._lastSettings,St.prototype._fitContentWidth=!1,St.prototype._columnDefs,St.prototype._rowVirtualizer,St.prototype._colVirtualizer,St.prototype._autoSetDataSource=!0,St.prototype._renderingHandler=null,St.prototype._dataBindingHandler=null,St.prototype._frozenLayout=!1,St.prototype._noBinding=!1,St.prototype._rowHeightSync=!0,St.prototype._rowHighlighting=!1,St.prototype._dispatchingDataChanged=!1,St.prototype._rowHeightException="",St.prototype._rowScrollingStep=0,St.prototype._zoomFactor=1,St.prototype._reservedSpace=0,St.prototype._hidingMethod="",St.prototype._rowHeightConflator=null,St.prototype._vScrollbarConflator=null,St.prototype._columnBoundConflator=null,St.prototype._rowRefreshTimer=0,St.prototype._layoutUpdating=!1,St.prototype._hiddenInput,St.prototype._bottomPadding=6,St.prototype._bottomPaddingSect=null,St.prototype._preserveProportion=!1,St.prototype._preserveGridSize=!1,St.prototype._rowHeightTimerId=0,St.prototype._groupDefs=null,St.prototype._batches=null,St.prototype._firstRendered=!1,St.prototype._hasPendingRowChange=!1,St.getVersion=function(){return"5.1.87"},St.prototype.dispose=function(){var t=this._id,e=St.map;if(e[t]){e[t]=null,this._disposed=!0,this._rowRefreshTimer&&(clearTimeout(this._rowRefreshTimer),this._rowRefreshTimer=0),this.unlistenAll(),window.removeEventListener("resize",this._onWindowResize,!1);for(var i=this._columnDefs.length;--i>=0;){var o=this._getColumnDef(i);o.renderingHandler=o.dataBindingHandler=null}for(var n in this._plugins){var r=this._plugins[n];r.unload&&r.unload(this)}this.removeAllSections();var s=this._vscrollbar._mainScrollbar;s&&(s.unlisten("scroll",this._onSyncVScroll),this._vscrollbar._mainScrollbar=null),(s=this._hscrollbar._mainScrollbar)&&(s.unlisten("scroll",this._onSyncHScroll),this._hscrollbar._mainScrollbar=null),this._vscrollbar.dispose(),this._hscrollbar.dispose(),this._rowHeightConflator.dispose(),this._vScrollbarConflator.dispose(),this._columnBoundConflator.dispose(),this._columnPositionConflator.dispose(),this._rowPositionConflator.dispose(),this._layoutX.dispose(),this._layoutY.dispose();var l=this._element;null!==l&&(l._control&&delete l._control,l.removeChild(this._hiddenInput)),this._dispose(),this._columnDefs.length=0,delete this._plugins}else console.log("WARNING: Core grid is disposed twice")},St.prototype.isDisposed=function(){return this._disposed},St.prototype.setParent=function(t,e){this._setParent(t,e),this._onParentChange()},St.prototype.insertBefore=function(t){this._insertBefore(t),this._onParentChange()},St.prototype._onParentChange=function(){var t=this.getParent()||this.getElement();this._vscrollbar._mainScrollbar||this._vscrollbar.setParent(t),this._hscrollbar.setParent(t),this._updateLayout()},St.prototype.getConfigObject=function(t){var e=t||{},i=this.getColumnCount();e.columns||(e.columns=[]);for(var o=0;o<i;o++){var n=e.columns[o];n||(n=e.columns[o]={});var r=this._getColumnDef(o);r.userId&&(n.id=r.userId),r.field&&(n.field=r.field),r.styles&&(n.styles=r.styles),r.stationary&&(n.stationary=r.stationary),r.leftPinned&&(n.leftPinned=r.leftPinned),r.rightPinned&&(n.rightPinned=r.rightPinned)}e.rowVirtualization=this.isRowVirtualizationEnabled(),e.columnVirtualization=this.isColumnVirtualizationEnabled(),e.rowHighlighting=this._rowHighlighting,this._fixFrozenTopSections&&(e.topFreezingCount=this._startVScrollbarIndex>=0&&this._startVScrollbarIndex+1),this._fixFrozenBottomSection&&(e.bottomFreezingCount=this._frozenFooterCount),this._rowScrollingStep&&(e.stepScroll=1===this._rowScrollingStep||this._rowScrollingStep);var s=this._vscrollbar.getAutoHide();!0!==s&&(e.autoHideScrollbar=s);var l=this._vscrollbar.getMouseWheelSpeed();l&&(e.linearWheelScrolling=l),this.hasClass("no-borders")&&(e.borders=!1),this.hasClass("no-gridlines")&&(e.gridlines=!1),this.hasClass("no-vertical-grid-line")&&(e.verticalLines=!1),this.hasClass("no-horizontal-grid-line")&&(e.horizontalLines=!1),this.hasClass("no-content-vertical-line")&&(e.contentVerticalLines=!1),this._bottomPaddingSect&&(e.contentBottomPadding=this._bottomPadding),this._reservedSpace>0&&(e.contentRightPadding=this._reservedSpace);var a=this.getDataConflationRate();for(var h in a&&(e.dataConflationRate=a),this._plugins){var u=this._plugins[h];"function"==typeof u.getConfigObject&&u.getConfigObject(e)}return e},St.prototype.fillParentWidth=function(t){if(this._fitContentWidth)return!1;if(this._layoutX.isFixedSize())return!1;var e=this._element,i=(0|e.getBoundingClientRect().width)-e.clientLeft;return null!==this._layoutX.setTrackSize(i-this._reservedSpace)},St.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",!1!==t&&this.updateLayout()},St.prototype.getContentWidth=function(){return this._layoutX.getTrackSize()},St.prototype.getSectionCount=function(){return this._settings.length},St.prototype._updateFrozenTopSections=function(){if(!this._fixFrozenTopSections){var t=this._getTopSectionCount();this._freezeTopSectionAt(t-1)}},St.prototype._updateFrozenBottomSections=function(){if(!this._fixFrozenBottomSection){var t=this._getBottomSectionCount();this._setFrozenFooter(t)}},St.prototype._getTopSectionCount=function(){for(var t=this._settings,e=t.length,i=0,o=0;o<e;o++){var n=t[o].getType();if("header"!==n&&"title"!==n)break;i++}return i},St.prototype._getBottomSectionCount=function(){for(var t=this._settings,e=0,i=t.length-1;i>=0&&"footer"===t[i].getType();i--)e++;return e},St.prototype.addSection=function(t,e){return this.addSectionAt(this.getSectionCount(),t,e)},St.prototype.addSectionAt=function(t,e,i){var o=this._settings.length;t<0&&(t=0),t>o&&(t=o);var n=this._toSectionType(e),r="bottomPadding"===i,s=this._newSection(r?"footer":n,i);if(!s)return null;var l=s.getSection();if(r&&(s.setAutoSyncRowCount(!1),this._bottomPaddingSect=l),t>=o?(this._putToLast(l),this._settings.push(s)):(this._settings.splice(t,0,s),l.insertBefore(this._settings[t+1].getSection())),this._updateSectionIndices(t),this._autoSetDataSource&&s.setDataSource(this._dataSource),"footer"===(n=s.getType())?this._updateFrozenBottomSections():"header"!==n&&"title"!==n||this._updateFrozenTopSections(),this._onColumnCountChanged(),this._onSectionCountChanged(!0),this._colVirtualizer.isEnabled()){var a=this._getColActivationList(),h=this.getColumnCount();s.activateColumns(a,0,h-1)}if(this._hasListener("sectionAdded")){var u=s.extendEventArg();this._dispatch("sectionAdded",u)}return l},St.prototype.removeSection=function(t){var e=this.getSection(t);return null!==e?this.removeSectionAt(e.getIndex()):null},St.prototype.removeSectionAt=function(t){var e=this._settings.length;if(t>=0&&t<e){var i=this._settings[t],o=i.getIndex(),n=i.getSection(),r=i.getType();return n.setRowCount(0),this._settings.splice(t,1),this._updateSectionIndices(o),"footer"===r?(this._updateFrozenBottomSections(),this._onColumnCountChanged()):"header"!==r&&"title"!==r||this._updateFrozenTopSections(),this._onSectionCountChanged(),i.dispose(),n}return null},St.prototype.removeLastSection=function(){return this.removeSectionAt(this._settings.length-1)},St.prototype.removeAllSections=function(){for(var t=this._settings.length,e=0;e<t;++e)this._settings[e].dispose();this._bottomPaddingSect=null,this._firstSettings=this._lastSettings=null,this._settings.length=0,this._updateSectionIndices(0),this._onSectionCountChanged()},St.prototype.setBottomPaddingSection=function(t){var e=this._bottomPaddingSect;t?("number"==typeof t&&(this._bottomPadding=t),e||(e=this.addSection("content","bottomPadding")),e&&(e.setDefaultRowHeight(this._bottomPadding),e.getRowCount()||e.addRow(1))):e&&this.removeSection(e)},St.prototype._updatePaddingBottomSect=function(){var t=this._bottomPaddingSect;if(t){var e=this._settings.length-1;if(e>0){var i=this._settings[e];if(i.getSection()!==t){for(var o=null,n=e;--n>=0;){var r=this._settings[n];if(r.getSection()===t){o=r;break}}if(n>=0)return this._putToLast(t),this._settings.splice(n,1),this._settings.push(o),o.setType("footer"===i.getType()?"footer":"content"),!0;this._bottomPaddingSect=null}else{var s=this._settings[e-1];s&&i.setType("footer"===s.getType()?"footer":"content")}}}return!1},St.prototype.moveSection=function(t,e){var i=this.getSectionCount();if(t<0)t=0;else if(t>=i)return;if(e<0?e=0:e>=i&&(e=i-1),t!==e){var n=this._settings[t],r=this._settings[e];o.moveArrayItem(this._settings,t,e),r?n.getSection().insertBefore(r.getSection()):this._putToLast(n.getSection()),this._updateSectionIndices(t<=e?t:e),this._syncRowHeights(),this._onSectionCountChanged(),this._frozenLayout||this._rowVirtualizer.update(!0)}},St.prototype.getSection=function(t){var e=this.getSectionSettings(t);return null!==e?e.getSection():null},St.prototype.getSectionSettings=function(t){if(o.isString(t)){if(St._sectionType[t])return this._getNextSection(1,null,t);for(var e=this._settings.length;--e>=0;)if(this._settings[e].getId()===t)return this._settings[e]}else if(null!=t){var i=-1;if(null!=t.getIndex?i=t.getIndex():o.isNumber(t)&&(i=t),i>=0&&i<this._settings.length)return this._settings[i]}return null},St.prototype.getAllSections=function(t){if(null==t)return this._getAllSections();for(var e=this.getAllSectionSettings(t),i=e,o=i.length;--o>=0;)i[o]=e[o].getSection();return i},St.prototype.getAllSectionSettings=function(t){if(!t)return this._settings;var e=this._settings.length,i=[];t=this._toSectionType(t);for(var o=0;o<e;++o){var n=this._settings[o];t===n.getType()&&i.push(n)}return i},St.prototype.getSectionIndex=function(t){if(o.isNumber(t))return t;if(t instanceof MouseEvent){var e=o.getRelativePosition(t,this._element),i={};return this._hitTestY(e.y,i),i.sectionIndex}var n=this.getSection(t);return null==n?-1:n.getIndex()},St.prototype.getSectionTop=function(t){var e=this.getSection(t);if(null==e)return 0;var i=this._layoutY.getLaneStart(e.getRowOffset());return this._startVScrollbarIndex>=0&&e.getIndex()>=this._startVScrollbarIndex&&(i-=this._vscrollbar.getScrollTop()),i},St.prototype.getPreviousSection=function(t,e){null==t&&(t=this._settings.length);var i=this._getNextSection(-1,t,e);return null!==i?i.getSection():null},St.prototype.getNextSection=function(t,e){var i=this._getNextSection(1,t,e);return null!==i?i.getSection():null},St.prototype.getLastSection=function(){return this.getSection(this._settings.length-1)},St.prototype.getCell=function(t,e,i,o){var n=this.getSection(t);return n?n.getCell(e,i,o):null},St.prototype.getCellInfo=function(t){if(!t)return null;var e=t.colIndex,i=t.rowIndex,o=t.sectionName,n=null;if(null==e||null==i)(n=this.getRelativePosition(t)).hit||(n=null);else{o||(o="content");var r=this.getSectionSettings(o);r&&r.getSection().getCell(e,i)&&((n={}).colIndex=e,n.rowIndex=i,r.extendEventArg(n))}return n},St.prototype.getNextCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?e:1)},St.prototype.getPrevCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?-e:-1)},St.prototype._getNextCellInRow=function(t,e){var i=this.getCellInfo(t);if(i){var o=i.colIndex+e,n=i.rowIndex,r=i.section;i.colIndex=o,i.cell=r.getCell(o,n)}return i},St.prototype.getNextCell=function(t){var e=this.getNextCellInRow(t);if(e&&!e.cell){var i=e.section,o=e.colIndex=0,n=e.rowIndex;e.rowIndex=++n,e.cell=i.getCell(o,n)}return e},St.prototype.getPrevCell=function(t){var e=this.getPrevCellInRow(t);if(e&&!e.cell){var i=e.section,o=e.colIndex=i.getColumnCount()-1,n=e.rowIndex;e.rowIndex=--n,e.cell=i.getCell(o,n)}return e},St.prototype.getColumnCount=function(){return this._layoutX.getLaneCount()},St.prototype.setColumnCount=function(t){var e=this._layoutX.getLaneCount();if(t>=e){this._layoutX.setLaneCount(t);for(var i=this._settings.length;--i>=0;)this._settings[i].getSection().setColumnCount(t);this._onColumnCountChanged(),this._syncLayoutToColumns(e,t),this._dispatchColumnAddedEvent(e,t-e,!1)}else this._removeColumn(e-t)},St.prototype.insertColumn=function(t,e){var i=this.getColumnCount();t<i||(t=i),this._layoutX.insertLane(t);for(var o=this._settings.length;--o>=0;)this._settings[o].getSection().insertColumn(t);this._columnDefs.splice(t,0,null),this._deserializeColumn(t,e),this._onColumnCountChanged(),this._syncLayoutToColumns(t,t+1),this._dispatchColumnAddedEvent(t,1,t<i,e)},St.prototype.insertColumns=function(t,e){var i=this.getColumnCount();t<i||(t=i);var o,n=0;if(Array.isArray(e)){if(1===(n=e.length))return void this.insertColumn(t,e[0]);o=e}else{if("number"!=typeof e)return void this.insertColumn(t,e);if(1===(n=e))return void this.insertColumn(t,null)}if(!(n<=0)){var r=this.freezeLayout(),s=[t,0].concat(new Array(n));Array.prototype.splice.apply(this._columnDefs,s);for(var l=0;l<n;l++){var a=t+l;this._layoutX.insertLane(a);for(var h=this._settings.length;--h>=0;)this._settings[h].getSection().insertColumn(a);var u=o&&o[l];this._deserializeColumn(a,u)}this._dispatchColumnAddedEvent(t,n,t<i,o),this.freezeLayout(r)}},St.prototype.removeColumnAt=function(t){var e=this.getColumnCount();if(t<0||t>=e)return null;var i=-1;this._colVirtualizer.isVirtualizable()&&(i=this._colVirtualizer.getLastIndexInView());for(var o=this._layoutX.removeLaneAt(t),n=this._settings.length,r=0;r<n;++r)this._settings[r].getSection().removeColumnAt(t);var s=this._pinnedLeftColumnCount,l=this._pinnedRightColumnCount,a=this._columnDefs.splice(t,1)[0];if(this._onColumnCountChanged(),(t<s||t>=e-l)&&this._updateScrollbarWidth(!0,!0),this._syncLayoutToColumns(t,e-1,!0),a||(a={}),a.layout=o,this._hasListener("columnRemoved")){var h={atTheMiddle:!0};h.colIndex=t,h.columns="deprecated",h.columnData=a.columnData,h.colId=a.id||"",this._dispatchColumnEvent("columnRemoved",h)}return t<=i&&i===this._colVirtualizer.getLastIndexInView()&&this._colVirtualizer.update(),a},St.prototype.removeAllColumns=function(){this.getColumnCount()>0&&(this._pinnedLeftColumnCount=0,this._pinnedRightColumnCount=0,this.setColumnCount(0))},St.prototype.getStationaryColumnIndex=function(){for(var t=this.getColumnCount()-1;t>=0;t--)if(this._getColumnDef(t).stationary)return t;return-1},St.prototype.isColumnMoveAllowed=function(t,e){if(Array.isArray(t)||(t=[t]),0===t.length||null==e)return!1;var i=this.getStationaryColumnIndex();if(i>-1){if(e<=i)return!1;for(var o=0;o<t.length;o++)if(t[o]<=i)return!1}return!0},St.prototype.isColumnMovable=function(t){var e=this.getStationaryColumnIndex();return!(e>-1&&t<=e)},St.prototype.moveColumn=function(t,e){if("number"==typeof t)return this._moveColumn(t,e);if(!Array.isArray(t))return!1;var i,o=t.length,n=[],r=0,s=this.getColumnCount(),l={};for(i=0;i<o;++i)(r=t[i])>=0&&r<s&&null==l[r]&&(l[r]=1,n.push(r));if(e<0?e=0:e>=s&&(e=s-1),!(o=n.length))return!1;if(1===o)return this._moveColumn(n[0],e);if(!this.isColumnMoveAllowed(n,e))return!1;if(n.sort(Ct),l[e]){var a=!0;for(r=n[0],i=1;i<o;++i)if(++r!==n[i]){a=!1;break}if(a)return!1}var h,u,p=this.freezeLayout(!0),_=0;for(i=0;i<o;++i)(h=n[i])>=e&&(u=e+_,this._moveColumn(h,u),++_);var c=o-_;for(u=_?e-1:e,i=0;i<c;++i)h=n[i]-i,this._moveColumn(h,u);return this.freezeLayout(p),!0},St.prototype._moveColumn=function(t,e){var i=this.getColumnCount();if(t<0?t=0:t>=i&&(t=i-1),e<0?e=0:e>=i&&(e=i-1),t===e)return!1;if(!this.isColumnMoveAllowed(t,e))return!1;var n=-1;this._colVirtualizer.isVirtualizable()&&(n=this._colVirtualizer.getLastIndexInView());var r=this.getColumnId(t);this._layoutX.moveLane(t,e);for(var s=this._settings.length,l=0;l<s;++l)this._settings[l].getSection().moveColumn(t,e);var a=this._columnDefs[t],h=this._countPinnedLeftColumns(),u=this._countPinnedRightColumns();if(o.moveArrayItem(this._columnDefs,t,e),this._hScrollbarEnabled&&(t<h?e>=i-u?this.freezeColumn(h-2,u+1):e>=h&&this.freezeColumn(h-2,u):a.rightPinned?e<h?this.freezeColumn(h,u-1):e<i-u&&this.freezeColumn(h-1,u-1):e<h?this.freezeColumn(h,u):e>=i-u&&this.freezeColumn(h-1,u+1)),this._hasListener("columnMoved")){var p={};p.fromColIndex=t,p.toColIndex=e,p.colId=r,this._dispatchColumnEvent("columnMoved",p)}return n===this._colVirtualizer.getLastIndexInView()&&(t<=n&&e>n||e<=n&&t>n)&&this._colVirtualizer.update(),this._updateColumnBounds(),this._updateColumnSeparators(),!0},St.prototype.moveColumnById=function(t,e){var i=this.getColumnCount(),o=this.getColumnIndex(t);if(o<0||o>=i)return!1;var n=null!=e?this.getColumnIndex(e):-1;return n<0&&(n=i),this._moveColumnByIndex(o,n)},St.prototype._moveColumnByIndex=function(t,e){return t<e&&--e,t!==e&&this.moveColumn(t,e)},St.prototype.reorderColumns=function(t,e){var i="";"number"==typeof e?i=this.getColumnId(e):e&&(i=e),this.startBatch("move");var o=0;if(Array.isArray(t)){var n=t.length;if(n>1){var r,s,l,a,h=this.getColumnIds(),u=h.length,p=[],_=!1;for(r=0;r<n;++r){var c=t[r];"number"==typeof c?(l=c,s=h[c]||""):(s=c,l=h.indexOf(s)),s&&l>=0&&(p.push(s),i===s&&(_=!0))}if(n=p.length,_){if((a=this.getColumnIndex(i))>=0)for(;++a<u&&(i=h[a],!(p.indexOf(i)<0)););(a<0||a>=u)&&(i="")}for(r=n;--r>=0;)s=p[r],l=this.getColumnIndex(s),(a=this.getColumnIndex(i))<0&&(a=u),o|=this._moveColumnByIndex(l,a),i=s}else o=this.moveColumnById(t[0],i)}else null!=t&&(o=this.moveColumnById(t,i));return this.stopBatch("move"),!!o},St.prototype.getColumnLayout=function(){return this._layoutX},St.prototype.updateColumnLayout=function(){this._syncLayoutToColumns(0,this.getColumnCount())},St.prototype._deserializeColumn=function(t,e){if(e){var i,o=e.layout||e,n=e.width;null!=n&&(o.size=n),null!=(n=e.scalable)&&(o.scalable=n),null!=(n=e.minWidth)&&(o.minSize=n),null==o.scalable&&(o.scalable=null==o.size),this._layoutX.deserializeLane(t,o);var r=e.styles;for(i in r)this.setColumnStyle(t,i,r[i]);var s=e.classes;for(i in s)this.enableColumnClass(t,i,s[i]);var l=this._getColumnDef(t),a=e.id;a&&"string"==typeof a&&(l.id=a,l.userId=a);var h=e.field;h&&"string"==typeof h&&(l.field=h);var u=e.dataColumnName;null!=u&&(l.dataColumnName=u),null!=(u=e.stationary)&&(l.stationary=!!u),null!=(u=e.leftPinned)&&(l.leftPinned=!!u),null!=(u=e.rightPinned)&&(l.rightPinned=!!u),this.setColumnRenderingHandler(t,e.renderingHandler),this.setColumnDataBindingHandler(t,e.dataBindingHandler),(u=e.columnData)&&this.setColumnData(t,u);var p=e.formatter||e.binding;if(Array.isArray(p)&&(p=p[0]),p&&"function"!=typeof p){var _=p.init;"function"==typeof _&&_(e,this)}}},St.prototype.addRow=function(t){if(null==t)t=1;else if(t<=0)return;this.getColumnCount()<=0&&this.setColumnCount(1);var e=this.getLastSection();null==e&&(e=this.addSection()),e.addRow(t)},St.prototype.removeRow=function(t){var e=this.getLastSection();null!=e&&(null==t&&(t=1),e.removeRow(t))},St.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},St.prototype.setSectionRowCount=function(t,e){var i=this.getSection(t);null!=i&&i.setRowCount(e)},St.prototype.getRowIndex=function(t,e){return this._sectionStarts[t]+e},St.prototype.getRelativeIndex=o._deprecatedFunction,St.prototype.removeAllRows=function(){for(var t=this._settings.length,e=0;e<t;++e)this._settings[e].getSection().setRowCount(0),this._sectionStarts[e]=0;this._sectionStarts[t]=0},St.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},St.prototype.setDefaultRowHeight=function(t,e){if(this._layoutY.setDefaultLaneSize(t)){this._rowHeightSync=!1;var i=this._layoutY.getDefaultLaneSize();this._rowHeightException=e?"":"title";for(var o=this._settings.length,n=0;n<o;++n){var r=this._settings[n];r.getType()!==this._rowHeightException&&"bottomPadding"!==r.getId()&&r.getSection().setDefaultRowHeight(i)}this._syncRowHeights(),this._rowHeightSync=!0,this.setRowScrollingStep(this._rowScrollingStep),this._updateColumnSeparators()}},St.prototype.getDataSource=function(){return this._dataSource},St.prototype.setDataConflationRate=function(t){this._dataSource.setConflationRate(t)},St.prototype.getDataConflationRate=function(){return this._dataSource.getConflationRate()},St.prototype.setDataSource=function(t){t&&t instanceof et&&(t=new at(t));var e={};if(e.prevDataSource=this._dataSource,this._dataSource=t||null,e.dataSource=this._dataSource,this._dispatch("dataSourceChanged",e),this._autoSetDataSource)for(var i=this._settings.length,o=0;o<i;++o)this._settings[o].setDataSource(t);return this._dispatch("postDataSourceChanged",e),this._dataSource},St.prototype.setColumnTemplate=o._deprecatedFunction,St.prototype.getColumnTemplate=o._deprecatedFunction,St.prototype.getColumnRenderEvent=o._deprecatedFunction,St.prototype.getColumnDataBindingEvent=function(t){console.log("getColumnDataBindingEvent() is deprecated. Use setColumnDataBindingHandler() instead");var e=this;return{listen:function(i){e.setColumnDataBindingHandler(t,i)},unlisten:function(){e.setColumnDataBindingHandler(t,null)}}},St.prototype.setColumnStyle=function(t,e,i,n){if(e){var r;o.isNumber(t)||(t=0,console.log("WARNING: the first parameter for setColumnStyle must be column index")),null==n?r=this._getNestedColumnDef(t,"styles"):(n=this._toSectionType(n),r=this._getNestedColumnDef(t,n,"styles")),r[e]=i;for(var s=this._settings.length;--s>=0;){var l=this._settings[s];null!=n&&n!==l.getType()||l.getSection().setColumnStyle(t,e,i)}}},St.prototype.enableColumnClass=function(t,e,i,o){var n;"number"!=typeof t&&(t=0),null==o?n=this._getNestedColumnDef(t,"classes"):(o=this._toSectionType(o),n=this._getNestedColumnDef(t,o,"classes"));var r=!1;if((i=!1!==i)?n[e]||(r=n[e]=!0):n[e]&&(delete n[e],r=!0),r)for(var s=this._settings.length;--s>=0;){var l=this._settings[s];null!=o&&o!==l.getType()||l.getSection().enableColumnClass(t,e,i)}return r},St.prototype.hasColumnClass=function(t,e,i){var o;return null==i?o=this._getNestedColumnDef(t,"classes"):(i=this._toSectionType(i),o=this._getNestedColumnDef(t,i,"classes")),!(!o||!o[e])},St.prototype.setColumnAlignment=function(t,e){var i=e?e.charAt(0).toLowerCase():"",o=0;o|=this.enableColumnClass(t,"tr-align-left","l"===i),o|=this.enableColumnClass(t,"tr-align-right","r"===i),(o|=this.enableColumnClass(t,"tr-align-center","c"===i))&&this._dispatch("columnAlignmentChanged",{colIndex:t,alignment:i})},St.prototype.getColumnAlignment=function(t){return this.hasColumnClass(t,"tr-align-right")?"right":this.hasColumnClass(t,"tr-align-center")?"center":this.hasColumnClass(t,"tr-align-left")?"left":"default"},St.prototype.getColumnLeft=function(t){var e=this._columnDefs[t];if(e&&e.rightPinned){for(var i=this.getElement().clientWidth,o=this._layoutX.getTrackSize(),n=o<i?o:i,r=this.getColumnCount()-1;r>=t;--r)n-=this._layoutX.getLaneSize(r);return n}return this._hScrollbarEnabled&&t>=this._pinnedLeftColumnCount?this._layoutX.getLaneStart(t)-this._hscrollbar.getScrollLeft():this._layoutX.getLaneStart(t)},St.prototype.getColumnRight=function(t){return this.getColumnLeft(t)+this._layoutX.getLaneSize(t)},St.prototype.getColumnWidth=function(t){return this._layoutX.getLaneSize(t)},St.prototype.getColumnCustomLaneSize=function(t){return this._layoutX.getCustomLaneSize(t)},St.prototype._calculateColumnWidths=function(t,e){if(!this._preserveGridSize)return e;var i,o=0,n={},r=t.length,s=new Array(r);for(i=0;i<r;i++)n[t[i]]=!0,s[i]=e[i],o+=e[i];var l=0,a=0,h=this.getColumnCount(),u=this._layoutX;for(i=0;i<h;i++)n[i]||u.isLaneVisible(i)&&(u.getLaneScalability(i)?(l+=u.getMinimumLaneSize(i),a++):l+=u.getLaneSize(i));var p=this.getContentWidth(),_=o+l-p;if(a<1||_>0){for(u.resetLaneToDefaultSize(),u.setTrackSize(p-this._reservedSpace),l=0,i=0;i<h;i++)n[i]||u.isLaneVisible(i)&&(u.getLaneScalability(i)?l+=u.getMinimumLaneSize(i):l+=u.getLaneSize(i));if((_=o+l-p)>0)for(_/=r,i=0;i<r;i++)s[i]-=_}return s},St.prototype.setColumnWidth=function(t,e,i){var o=this._calculateColumnWidths([t],[e]),n=this._setColumnWidth(t,o[0],i);return n&&this._syncLayoutToColumns(t,t+1),n},St.prototype.setColumnWidths=function(t,e){var i,o=0,n=[],r=[],s=[];for(i=t.length;--i>=0;){var l=t[i];null!=l&&(n.push(i),r.push(l));var a=Array.isArray(e)?e[i]:e;s.push(a)}var h=this._calculateColumnWidths(n,r);for(i=0;i<h.length;i++)o|=this._setColumnWidth(n[i],h[i],s[i]);return o&&this._syncLayoutToColumns(0,t.length),!!o},St.prototype.isColumnVisible=function(t){return this._layoutX.isLaneVisible(t)},St.prototype.hideColumn=function(t,e){var i=!1===e;this.setColumnVisibility(t,i,0)},St.prototype.hideColumns=function(t,e){var i=Array.isArray(t)?t.length:0,o=[],n=this.getColumnCount();e=!1!==e;for(var r=0;r<i;++r){var s=t[r];s>=0&&s<n&&this._layoutX.hideLane(s,e,0)&&o.push(s)}if(o.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){var l={};l.colIndices=o,l.hidden=e,this._dispatch("columnVisibilityChanged",l)}},St.prototype.showAllColumns=function(){for(var t=[],e=this.getColumnCount(),i=0;i<e;++i)this._layoutX.hideLane(i,!1,0)&&t.push(i);if(t.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){var o={};o.colIndices=t,o.hidden=!1,this._dispatch("columnVisibilityChanged",o)}},St.prototype.getMinimumColumnWidth=function(t){return this._layoutX.getMinimumLaneSize(t)},St.prototype.setMinimumColumnWidth=function(t,e){this._layoutX.setMinimumLaneSize(t,e)&&this._syncLayoutToColumns(t,t+1)},St.prototype.setMinimumColumnWidths=function(t,e){for(var i=0,o=NaN,n=NaN,r=t.length;--r>=0;){var s=t[r];null!=s&&(n||(n=r),o=r,i|=this._layoutX.setMinimumLaneSize(r,s,e))}return i&&this._syncLayoutToColumns(o,n+1),!!i},St.prototype.getColumnScalability=function(t){return this._layoutX.getLaneScalability(t)},St.prototype.setColumnScalability=function(t,e){var i=!1;return o.isNumber(t)?(e=!1!==e,(i=this._layoutX.setLaneScalability(t,e))&&this._syncLayoutToColumns(t,t+1)):this.setDefaultColumnScalable(t),i},St.prototype.setDefaultColumnScalable=function(t){this._layoutX.setDefaultScalability(!!t)},St.prototype.resetColumnWidths=function(){var t=this._layoutX.resetLaneToDefaultSize();return t&&this._syncLayoutToColumns(0,this.getColumnCount()),t},St.prototype.setColumnDefaultWidth=function(t,e){this._layoutX.setLaneDefaultSize(t,e)},St.prototype.preserveProportion=function(t){this._preserveProportion=!0===t},St.prototype.isProportionPreserved=function(){return this._preserveProportion},St.prototype.preserveGridSize=function(t){this._preserveGridSize=!0===t},St.prototype.getColumnData=function(t){return this._getColumnDef(t).columnData||null},St.prototype.setColumnData=function(t,e){return this._getColumnDef(t).columnData=e,e},St.prototype.newColumnData=function(t){return this.getColumnData(t)||{}},St.prototype.setAlwaysRenderColumn=function(t,e){this.getColumnData(t).alwaysRender=!1!==e},St.prototype._isAlwaysRenderColumn=function(t){var e=this.getColumnData(t);return!!e&&!0===e.alwaysRender},St.prototype.getFitContentWidth=function(){return this._fitContentWidth},St.prototype.setFitContentWidth=function(t){this._fitContentWidth!==t&&(this._fitContentWidth=t,this.enableClass("fit-width",this._fitContentWidth))},St.prototype.loadPlugin=function(t,e){var i=null;if("string"==typeof t){var o=window.tr,n=o?o.grid:null;if(!n)return null;if(n[t])i=new n[t];else{if(!n[t+"Plugin"])return null;i=new n[t+"Plugin"]}}else i=t;if(!i||!i.getName)return null;var r=i.getName();if(!r)return null;var s=this._plugins[r];if(s){if(s===i)return s;console.log("WARNING: Two of the same "+r+"s cannot be loaded on a single grid. The existing plugin is replaced."),this.unloadPlugin(r)}return i.initialize&&i.initialize(this,e),this._plugins[r]=i,i},St.prototype.unloadPlugin=function(t){var e;if(t){var i="";"string"==typeof t?i=t:t.getName&&(i=t.getName()),(e=this._plugins[i])||(i+="Plugin",e=this._plugins[i]),e&&(e.unload&&e.unload(this),delete this._plugins[i])}return e||null},St.prototype.getPlugin=function(t){var e=this._plugins[t];return e||(e=this._plugins[t+"Plugin"]),e||null},St.prototype.getPlugins=function(){var t=[];for(var e in this._plugins)t.push(this._plugins[e]);return t},St.prototype.getPluginList=function(){var t=[];for(var e in this._plugins)t.push(e);return t},St.prototype.freezeSection=function(t){this._fixFrozenTopSections=!0,this._freezeTopSectionAt(t)},St.prototype._freezeTopSectionAt=function(t){if("number"==typeof t){var e=t+1;if(e===this._startVScrollbarIndex)return;this._startVScrollbarIndex=e}else this._startVScrollbarIndex=-1,"string"==typeof t&&(this._tempFrozenSectionRef=t);this._onSectionCountChanged()},St.prototype.freezeFooter=function(t){this._fixFrozenBottomSection=!0,this._frozenFooterCount!==t&&(this._setFrozenFooter(t),this._onSectionCountChanged())},St.prototype._setFrozenFooter=function(t){this._frozenFooterCount!==t&&(this._frozenFooterCount=t,this._vscrollbar.setFooterCount(t),this._hscrollbar.setFooterCount(t))},St.prototype.getFooterCount=function(){return this._frozenFooterCount},St.prototype.freezeColumn=function(t,e){var i,o=this.getColumnCount(),n=0,r=0,s=!1;if(t||0===t)for(this._hScrollbarEnabled=!0,n=t>=0?t+1:0,this._pinnedLeftColumnCount!==n&&(s=!0,this._pinnedLeftColumnCount=n),i=0;i<o;++i)this._getColumnDef(i).leftPinned=--n>=0;else this._hScrollbarEnabled=!1;if(null!=e)for(r=e>0?e:0,this._pinnedRightColumnCount!==r&&(s=!0,this._pinnedRightColumnCount=r),i=o;--i>=0;)this._getColumnDef(i).rightPinned=--r>=0;this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),this._updateColumnSeparators(),s&&(this._isEventDispatching("pinningChanged")||this._dispatch("pinningChanged",{}))},St.prototype._countPinnedLeftColumns=function(){var t=0;if(this._hScrollbarEnabled)for(var e=this._columnDefs.length;--e>=0;){var i=this._columnDefs[e];if(i&&i.leftPinned){t=e+1;break}}return this._pinnedLeftColumnCount=t,t},St.prototype._countPinnedRightColumns=function(){var t=0;if(this._hScrollbarEnabled){var e,i=this._columnDefs.length;for(e=0;e<i;++e){var o=this._columnDefs[e];if(o&&o.rightPinned)break}t=i-e}return this._pinnedRightColumnCount=t,t},St.prototype.isPinnedColumn=function(t){return t<this.getFrozenColumnCount()||t>=this.getFirstPinnedRightIndex()},St.prototype.getFrozenColumnCount=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:0},St.prototype.getPinnedLeftColumnCount=St.prototype.getFrozenColumnCount,St.prototype.getPinnedRightColumnCount=function(){return this._pinnedRightColumnCount},St.prototype.getFirstPinnedRightIndex=function(){return this.getColumnCount()-this._pinnedRightColumnCount},St.prototype.updateLayout=function(){this._disposed||this._layoutUpdating||(this._layoutUpdating=!0,this._dispatch("preForcedUpdate",{}),this._updateLayout(),this._colVirtualizer.isEnabled()&&this._activateColumns(),this._layoutUpdating=!1)},St.prototype.updateScrollbars=function(t,e){e&&this._updateScrollbarWidth(!0,!1),t&&this._updateScrollbarHeight(!0,!1)},St.prototype.freezeLayout=function(t){t=!1!==t;var e=this._frozenLayout;if(e!==t){this._frozenLayout=t;var i,o=this.getPlugin("SortableTitlePlugin");this._frozenLayout&&o&&o.freezeIndicator(!0),this._frozenLayout||(this._disableEvent("widthChanged"),this._onSectionCountChanged(),this._onColumnCountChanged(),this._colVirtualizer.isEnabled()&&this._activateColumns()),this._rowHeightSync=!1;var n=this._settings.length;for(i=0;i<n;i++)this._settings[i].getSection().setFrozenLayout(this._frozenLayout);this._frozenLayout||(this._syncLayoutToColumns(0,this.getColumnCount()),this._disableEvent("widthChanged",!1),this._dispatch("widthChanged",{}),this._syncRowHeights()||this._rowVirtualizer.update(!0),o&&o.freezeIndicator(!1)),this._rowHeightSync=!0}return e},St.prototype.unfreezeLayout=function(t){this.freezeLayout(!1===t)},St.prototype.isLayoutFrozen=function(){return this._frozenLayout},St.prototype.showBorders=o._deprecatedFunction,St.prototype.hideBorders=o._deprecatedFunction,St.prototype.toggleBorders=function(t){this.toggleClass("no-borders",null!=t?!t:null)},St.prototype.toggleGridlines=function(t){this.toggleClass("no-gridlines",null!=t?!t:null)},St.prototype.toggleVerticalLines=function(t){this.toggleClass("no-vertical-grid-line",null!=t?!t:null)},St.prototype.toggleHorizontalLines=function(t){this.toggleClass("no-horizontal-grid-line",null!=t?!t:null)},St.prototype.toggleContentVerticalLines=function(t){this.toggleClass("no-content-vertical-line",null!=t?!t:null)},St.prototype.getDataColumnMap=function(){for(var t=[],e=this.getColumnCount();--e>=0;)t[e]=this.getDataColumnName(e);return t},St.prototype.setDataColumnMap=function(t){var e,i;if(t)for(e=t.length;--e>=0;)(i=this._getColumnDef(e)).dataColumnName=t[e];else for(e=this._columnDefs.length;--e>=0;)(i=this._columnDefs[e])&&null!=i.dataColumnName&&(i.dataColumnName=null)},St.prototype.getDataColumnName=function(t){return this._getColumnDef(t).dataColumnName||""},St.prototype.setDataColumnName=function(t,e){this._getColumnDef(t).dataColumnName=e},St.prototype.setDefaultRenderingHandler=function(t){this._renderingHandler="function"==typeof t?t:null},St.prototype.setDefaultDataBindingHandler=function(t){this._dataBindingHandler="function"==typeof t?t:null},St.prototype.setColumnRenderingHandler=function(t,e){this._getColumnDef(t).renderingHandler="function"==typeof e?e:null},St.prototype.setColumnDataBindingHandler=function(t,e){this._getColumnDef(t).dataBindingHandler="function"==typeof e?e:null},St.prototype.getColumnRenderingHandler=function(t){return this._getColumnDef(t).renderingHandler||null},St.prototype.getColumnDataBindingHandler=function(t){return this._getColumnDef(t).dataBindingHandler||null},St.prototype.enableRowHighlighting=function(t){if(null==t&&(t=!0),this._rowHighlighting!==t){this._rowHighlighting=t;for(var e=this.getAllSections("content"),i=e.length;--i>=0;)e[i].enableRowHighlighting(this._rowHighlighting)}},St.prototype._getTarget=function(t){var e=t.target;if(e){var i=null;return this._element.contains(e)||(i=t.composedPath?t.composedPath():t.path),i?i[0]||null:e}return t.getElement?t.getElement():o.isElement(t)?t:null},St.prototype.getRelativePosition=function(t,e){if(!t)return{};var i=e||{},n=this._getTarget(t);t.target?o.getRelativePosition(t,this.getElement(),i):n&&o.getRelativePosition(n,this.getElement(),i),1!==this._zoomFactor&&(i.x/=this._zoomFactor,i.y/=this._zoomFactor),i.hit=!1,i.grid=this,i.clientX=t.clientX,i.clientY=t.clientY,i.zoomFactor=this._zoomFactor;var r=o.closestElement(n,"cell");if(!r)return i;i.cellElement=r;var s=o.closestElement(r,"column");i.columnElement=s;var l;if(!(l=s?o.closestElement(s,"tr-lg"):o.closestElement(r,"tr-lg")))return i;i.sectionName=l.id||o.closestElement(l,"tr-vlg").id;var a=this.getSectionSettings(i.sectionName);if(!a)return i;a.extendEventArg(i);var h=a.getSection(),u=h.getColumnIndex(s||r);return u<0||(i.colIndex=u,!1===this._hitTestY(-1,i)||(r.stretched?i.cell=h.getStretchedCell(u,i.rowIndex):i.cell=h.getCell(u,i.rowIndex),i.hit=!0)),i},St.prototype.getVScrollbar=function(){return this._vscrollbar},St.prototype.getHScrollbar=function(){return this._hscrollbar},St.prototype.autoHideScrollbars=function(t){t=null==t||t,this._vscrollbar.setAutoHide(t),this._hscrollbar.setAutoHide(t)},St.prototype.getVScrollStartIndex=function(){return this._startVScrollbarIndex},St.prototype.getHScrollStartIndex=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:-1},St.prototype.scrollToColumn=function(t,e){if(!this._updateScrollbar(this._hscrollbar))return!1;var i=this._layoutX.getLaneCount();if(t<=0?t=0:t>=i&&(t=i-1),this.isPinnedColumn(t))return!1;var o=this._hScrollbarEnabled?this._layoutX.getLaneStart(this._pinnedLeftColumnCount):0,n=this._hscrollbar.getScrollLeft(),r=n+o,s=this._hscrollbar.getWidth(),l=this._layoutX.hitTest(r),a=this._layoutX.getLaneStart(t),h=this._layoutX.getLaneSize(t);if(e||h>=s||t<=l){var u=a-o;if(n!==u)return this._hscrollbar.setScrollLeft(u),!0}else{var p=r+s;if(t>=this._layoutX.hitTest(p-.1)){var _=n+(a+h)-p;return this._hscrollbar.setScrollLeft(_),!0}}return!1},St.prototype.getScrollLeft=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getScrollLeft():0},St.prototype.setScrollLeft=function(t){this._updateScrollbar(this._hscrollbar)&&this._hscrollbar.setScrollLeft(t)},St.prototype.scrollRight=function(t){this.setScrollLeft(this._hscrollbar.getScrollLeft()+t)},St.prototype.getScrollWidth=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getContentWidth():0},St.prototype.getYScrollVal=function(t,e,i){if(!this._updateScrollbar(this._vscrollbar))return null;var o=null;t&&(o=this.getSection(t));var n=this._layoutY.getLaneCount(),r=o?o.getRowOffset():this._sectionStarts[this._startVScrollbarIndex];r&&(e+=r),e<=0?e=0:e>=n&&(e=n-1);var s=this._layoutY.getLaneStart(r),l=this._vscrollbar.getScrollTop()+s,a=o?o.getFirstIndexInView():this._layoutY.hitTest(l),h=-1;if(i)h=e;else if(e<=a)(h=e-3)<0&&(h=0);else{var u=l+this._vscrollbar.getHeight(),p=o?o.getLastIndexInView():this._layoutY.hitTest(u-.1);e>=p&&(h=e-(p-a)+3)<0&&(h=0)}return h>=0?this._layoutY.getLaneStart(h)-s:null},St.prototype.scrollToRow=function(t,e,i){var o=this.getYScrollVal(t,e,i);null!==o&&this._vscrollbar.setScrollTop(o)},St.prototype.getVScrollView=function(){if(!this._updateScrollbar(this._vscrollbar))return null;var t=this._layoutY.getLaneCount();if(0===t)return null;var e=this._sectionStarts[this._startVScrollbarIndex],i=this._layoutY.getLaneStart(e),o=this._vscrollbar.getScrollTop()+i,n=this._vscrollbar.getHeight(),r=o+n,s=this._layoutY.hitTest(o),l=this._layoutY.hitTest(r-.1),a=this._layoutY.getLaneStart(s),h=this._layoutY.getLaneEnd(l),u=o-n,p=u<=i?e:this._layoutY.hitTest(u)+1,_=r+n,c=_>=this._layoutY.getTrackSize()?t-1:this._layoutY.hitTest(_-.1)-1;s-=e,l-=e;var d={};return d.viewTop=o-i,d.viewBottom=r-i,d.topRowIndex=s,d.bottomRowIndex=l,d.firstFullRow=a<o?s+1:s,d.lastFullRow=h>r?l-1:l,d.prevPageRowIndex=p-e,d.nextPageRowIndex=c-e,d},St.prototype.getScrollTop=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getScrollTop():0},St.prototype.setScrollTop=function(t){this._updateScrollbar(this._vscrollbar)&&this._vscrollbar.setScrollTop(t)},St.prototype.scrollDown=function(t){this.setScrollTop(this._vscrollbar.getScrollTop()+t)},St.prototype.getScrollHeight=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getContentHeight():0},St.prototype.restoreScrollbars=function(){this._vscrollbar.restoreTrackPosition()},St.prototype.enableAutoSetDataSource=function(t){this._autoSetDataSource=t},St.prototype.getRowVirtualizer=function(){return this._rowVirtualizer},St.prototype.getColumnVirtualizer=function(){return this._colVirtualizer},St.prototype.enableRowVirtualization=function(t){this._rowVirtualizer.enable(t),this._rowVirtualizer.isEnabled()&&this._vscrollbar.isEnabled()?this._rowVirtualizer.activate():this._rowVirtualizer.deactivate()},St.prototype.isRowVirtualizationEnabled=function(){return this._rowVirtualizer.isEnabled()},St.prototype.enableColumnVirtualization=function(t){this._colVirtualizer.enable(t);for(var e=this._colVirtualizer.isEnabled(),i=this._settings.length;--i>=0;)this._settings[i].enableColumnVirtualization(e)},St.prototype.isColumnVirtualizationEnabled=function(){return this._colVirtualizer.isEnabled()},St.prototype.setRowScrollingStep=function(t){this._rowScrollingStep=t>0?t:0,this._vscrollbar.setScrollingStep(this._layoutY.getDefaultLaneSize()*this._rowScrollingStep)},St.prototype.getVMouseWheelHandler=function(){return this._vscrollbar.getDefaultMouseWheelLogic()},St.prototype.synchronizeVScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);var e=t.getVScrollbar();e._mainScrollbar=this._vscrollbar,e.setStyle("visibility","hidden"),e.setStyle("pointerEvents","none"),e.disableMouseWheel(),e.attachToExternalElement(this._vscrollbar.getParent()),this._vscrollbar.listen("scroll",t._onSyncVScroll)},St.prototype.synchronizeHScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);var e=t.getHScrollbar();e._mainScrollbar=this._hscrollbar,e.setStyle("visibility","hidden"),e.setStyle("pointerEvents","none"),e.disableMouseWheel(),e.attachToExternalElement(this._hscrollbar.getParent()),this._hscrollbar.listen("scroll",t._onSyncHScroll)},St.prototype.updateRowData=function(t,e,i,o){var n=this.getSectionSettings(t||"content");n&&n.updateRowData(e,i,o)},St.prototype.rerender=function(){for(var t=this._settings.length,e=0;e<t;e++)this._settings[e].rerender()},St.prototype.requestRowRefresh=function(){this._rowRefreshTimer||(this._rowRefreshTimer=setTimeout(this._onRowRefresh,100))},St.prototype._requestScrollbarUpdate=function(){this._updateScrollbarHeight(!0,!0),this._rowHeightTimerId=0},St.prototype.deactivateRendering=function(t){if((t=!1!==t)!=this._noBinding){this._noBinding=t;var e=this.getSectionSettings("content");e&&(e.disableDataBinding(t),t||this.requestRowRefresh())}},St.prototype._onRowRefresh=function(){this._rowRefreshTimer=0,this.updateRowData()},St.prototype.disableLazyRendering=function(t){console.log("WARNING: This function is deprecated.")},St.prototype.getData=function(t,e,i){var o=this.getSectionSettings(t);if(!o)return null;var n=this._toDataColumnName(e);return o.getData(n,i)},St.prototype.setData=function(t,e,i,o){var n=this.getSectionSettings(t);if(n&&n.isDataBindable()){var r=this._toDataColumnName(e);return n.setData(r,i,o)}return!1},St.prototype.removeRowData=function(t,e){var i=this.getSectionSettings(t);return!(!i||!i.isDataBindable())&&i.removeRowData(e)},St.prototype.setHidingMethod=function(t){if(t||(t=""),this._hidingMethod!==t){this._hidingMethod=t;for(var e=this.getAllSections(),i=e.length;--i>=0;)e[i].setHidingMethod(t)}},St.prototype.getHorizontalLayout=function(){return this._layoutX},St.prototype.setColumnVisibility=function(t,e,i){if(this._layoutX.hideLane(t,!e,i)){if(this._syncLayoutToColumns(t,t+1),e&&this.requestRowRefresh(),this._hasListener("columnVisibilityChanged")){var o={};o.colIndex=t,o.hidden=!e,this._dispatch("columnVisibilityChanged",o)}return!0}return!1},St.prototype.getColumnVisibility=function(t,e){return this._layoutX.getLaneVisibilityBit(t,e)},St.prototype.reserveRightSpace=function(t){if(this._reservedSpace!==t){this._reservedSpace=t;for(var e=this._settings.length;--e>=0;)this._settings[e].getSection().reserveRightSpace(t);return this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),!0}return!1},St.prototype.getHiddenInput=function(){return this._hiddenInput},St.prototype.focus=function(){var t=this._hiddenInput,e=document.activeElement;if(t&&t!==e){var i=window.pageXOffset,o=window.pageYOffset;if(t.setActive)try{t.setActive()}catch(e){t.focus({preventScroll:!0})}else t.focus({preventScroll:!0});o===window.pageYOffset&&i===window.pageXOffset||window.scrollTo(i,o)}},St.prototype.isBinding=function(){return this._dispatchingDataChanged},St.prototype.hideRow=function(t,e){this._dataSource.hideRow(t,e)},St.prototype.hideRows=function(t,e){Array.isArray(t)?this._dataSource.hideRows(t,e):this._dataSource.hideRow(t,e)},St.prototype.showRows=function(t,e){Array.isArray(t)?this._dataSource.showRows(t,e):this._dataSource.showRows([t],e)},St.prototype.unhideAllRows=function(){this._dataSource.unhideAllRows()},St.prototype.hasHiddenRow=function(){return this._dataSource.hasHiddenRow()},St.prototype.initSimpleTable=function(t){var e=0;t||this.getColumnCount()||(t=["Default"]),t&&(e=t.length,this.setColumnCount(e),this.setDataColumnMap(t));var i=this.addSection("title");if(i.addRow(1),!this._renderingHandler)for(var o=0;o<e;++o)i.setCellContent(o,0,t[o]);this.addSection("content");var n=this.getSectionSettings("title");n.disableDataBinding();var r=this.getSectionSettings("content");r.setAutoSyncRowCount(!0),r.setParent(n),this._dataBindingHandler||this.setDefaultDataBindingHandler(St._defaultDataBinding)},St._defaultDataBinding=function(t){t.cell.setContent(t.dataValue)},St.prototype.selectColumn=function(t,e){for(var i=this._settings.length;--i>=0;)this._settings[i].getSection().selectColumn(t,e);this._updateColumnBounds()},St.prototype.isSelectedColumn=function(t){var e=this._settings[0]||null;return!!e&&e.getSection().isSelectedColumn(t)},St.prototype._updateColumnBounds=function(){if(!this._columnBoundConflator.conflate()){var t=this._settings.length;if(t){var e,i=[],o=null,n=this.getColumnCount(),r=[];for(e=0;e<n;e++)this.isSelectedColumn(e)?(r.push(e),o||(o=[e,-1])):o&&(o[1]=e-1,i.push(o),o=null);o&&(o[1]=n-1,i.push(o),o=null);var s={selectedColumns:r,selectionRanges:i};this._dispatch("beforeColumnBoundUpdate",s);var l=i.length,a=[],h=[],u=this._settings[0],p=u.getSection();for(e=0;e<l;++e){o=i[e];var _=[0,0],c=[!1,!1];p.calculateColumnBounds(o[0],o[1],_,c),_[0]<_[1]&&(a.push(_),h.push(c))}var d=0,g=-1;for(null!=s.topBoundRowIndex&&(g=+s.topBoundRowIndex),g>=0&&"title"===u.getType()&&(d=this._layoutY.getLaneStart(g)),p.updateColumnBounds(a,h,d),e=1;e<t;e++)(p=this._settings[e].getSection()).updateColumnBounds(a,h)}}},St.prototype._updateColumnSeparators=function(){var t=this._settings.length;if(t)for(var e=0;e<t;e++){var i=this._settings[e].getSection();i&&i.updateColumnSeparators()}},St.prototype.getColumnRect=function(t,e){var i=this.getElement().clientWidth,o=i,n=this._hscrollbar;n.isActive()&&(o=n.getTrackSize());var r=0,s=0;if(this._settings.length){var l=[0,0];this._settings[0].getSection().calculateColumnBounds(t,e,l,[]),s=l[1]-(r=l[0])}return{top:0,left:r,width:s,height:this._layoutY.getTrackSize(),leftPinnedIndex:this._pinnedLeftColumnCount-1,rightPinnedIndex:this.getFirstPinnedRightIndex(),scrollViewSize:o,gridWidth:i}},St.prototype.getRowRect=function(t,e){var i=this._layoutX.getTrackSize(),o=this.getElement().clientWidth;i=i<o?i:o;var n=this.getSection("content"),r=n?n.getRowOffset():1,s=this._layoutY,l=s.getLaneStart(r),a=0,h=n.getHeight(),u=this._vscrollbar;u.isActive()&&(a=u.getScrollTop(),h=u.getTrackSize());var p=h+l,_=s.getLaneStart(t+r)-a,c=s.getLaneEnd(e+r)-a;return _<l?_=l:_>p&&(_=p),c<l?c=l:c>p&&(c=p),{top:_-=l,left:0,width:i,height:(c-=l)-_,scrollViewSize:h,scrollViewTop:l,scrollViewBottom:p}},St.prototype.normalizeConfig=function(t){t||(t={});var e,i,o=t.columns,n=o?o.length:0,r=t.columnFreezing;null==r&&(r=t.freezeColumn);var s=t.pinnedRightColumns||t.frozenRightColumns;if(s)for(delete t.pinnedRightColumns,delete t.frozenRightColumns,t.columnVirtualRendering=!1,t.columnVirtualization=!1,e=n;--e>=0;)--s>=0&&(i=o[e])&&(i.rightPinned=!0);return null!=r&&(delete t.columnFreezing,delete t.freezeColumn,r>=0&&o&&(i=o[r])&&(i.leftPinned=!0)),t},St.prototype.setColumnGrouping=function(t){this._groupDefs=t||null},St.prototype.getColumnGroupParentId=function(t){if(this._groupDefs){var e="number"==typeof t?this.getColumnId(t):t;return this._groupDefs.getParentId(e)}return""},St.prototype.getColumnGroupChildIds=function(t){if(this._groupDefs){var e=this._groupDefs.getLeafDescendants(t);if(e&&e.length>0)return e}return null},St.prototype.getValidColumnList=function(t,e){var i=[];if(!t)return i;e||(e=this.createColumnMap(t));for(var o=this.getColumnCount(),n=0;n<o;++n){var r=this._getColumnDef(n).id;null!=e[r]&&i.push({index:n,id:r})}return i},St.prototype.createColumnMap=function(t){t||(t=this.getColumnIds());for(var e={},i=t.length,o=0;o<i;o++){var n=t[o];"number"==typeof n&&(n=this.getColumnId(n)),n&&(e[n]=!0)}return e},St.prototype.startBatch=function(t){return!!t&&(this._batches||(this._batches={}),this._batches[t]=t,"reset"===t&&this._disableEvent("columnVisibilityChanged",!0),this._dispatch("beforeBatchOperation",{batches:this._batches,batchType:t}),!0)},St.prototype.stopBatch=function(t){return!!t&&(this._dispatch("afterBatchOperation",{batches:this._batches,batchType:t}),"reset"===t&&this._disableEvent("columnVisibilityChanged",!1),delete this._batches[t],W(this._batches)&&(this._batches=null),!0)},St.prototype._dispatchColumnEvent=function(t,e){var i=this._batches;i&&(e.batches=i),this._dispatch(t,e)},St.prototype._dispatchColumnPositionChanged=function(){this._columnPositionConflator.conflate()||this._dispatch("columnPositionChanged",{sender:this})},St.prototype._dispatchRowPositionChanged=function(){this._rowPositionConflator.conflate()||this._dispatch("rowPositionChanged",{sender:this})},St.prototype._getAllSections=function(){for(var t=[],e=this._settings.length,i=0;i<e;i++)t.push(this._settings[i].getSection());return t},St.prototype._getNextSection=function(t,e,i){var o=this.getSectionIndex(e)+t;if(null==i)return this.getSectionSettings(o);i=this._toSectionType(i);for(var n=this._settings.length;o>=0&&o<n;){var r=this._settings[o];if(i===r.getType())return r;o+=t}return null},St.prototype._toSectionType=function(t){if(St._sectionType[t])return t;if(o.isString(t))switch(t.charAt(0).toLowerCase()){case"t":return"title";case"h":case"s":return"header";case"f":return"footer"}return"content"},St.prototype._newSection=function(t,e){if(e)for(var i=this._settings.length;--i>=0;)if(this._settings[i].getId()===e)return null;t=this._toSectionType(t);var o={horizontalScrollbar:this._hscrollbar},n="content"===t?new vt(o):new N(o);n._setContext(this);var r=new _t(n);r.setId(e),r.setType(t),r.listen("dataChanged",this._onSectionDataChanged),r.listen("rowAvailable",this._onRowAvailable);var s="content"===t&&this._rowHighlighting;return n.enableRowHighlighting(s),n.enableShading(!1),n.setHidingMethod(this._hidingMethod),r.enableColumnVirtualization(this._colVirtualizer.isEnabled()),n.setColumnCount(this._layoutX.getLaneCount()),n.reserveRightSpace(this._reservedSpace),this._syncLayoutToSectionColumns(n),this._syncStyleToSectionColumns(n,t),t!==this._rowHeightException&&n.setDefaultRowHeight(this._layoutY.getDefaultLaneSize()),n.listen("rowHighlighted",this._onRowHightlighted),n.listen("rowCountChanged",this._onRowCountChanged),n.listen("rowHeightChanged",this._onRowHeightChanged),r},St.prototype._putToLast=function(t){if(0===this._settings.length)t.setParent(this._element,!0);else{var e=this.getLastSection().getElement().nextSibling;null!==e?t.insertBefore(e):t.setParent(this._element)}},St.prototype._syncStyleToSectionColumns=function(t,e){for(var i,o=this._columnDefs.length;--o>=0;){var n=this._getColumnDef(o),r=n.styles;for(i in r)t.setColumnStyle(o,i,r[i]);var s=n.classes;for(i in s)t.enableColumnClass(o,i,!0);var l=n[e];if(l){for(i in r=l.styles)t.setColumnStyle(o,i,r[i]);for(i in s=l.classes)t.enableColumnClass(o,i,!0)}}},St.prototype._syncRowHeights=function(){for(var t=this._settings.length,e=0;e<t;++e)this._syncSectionRowHeights(this._settings[e].getSection());return!this._frozenLayout&&this._updateScrollbarHeight(!0,!0)},St.prototype._syncSectionRowHeights=function(t){this._layoutY.copyFrom(t.getRowLayout(),this._sectionStarts[t.getIndex()])},St.prototype._setColumnWidth=function(t,e,i){var o=!1,n=this._layoutX;if(null!=i)o=n.setLaneScalability(t,!!i);else{var r=n.getLaneScalability(t);if(this._preserveProportion){if(r){for(var s=this.getColumnCount(),l=0,a=0,h=0;h<s;++h)if(n.getLaneScalability(h)){var u=n.getLaneSize(h);l+=n.getCustomLaneSize(h),a+=u}(!(e=(e*l-e*n.getCustomLaneSize(t))/(a-e))||e<0)&&(e=l)}}else o=n.setLaneScalability(t,!1)}return n.setLaneSize(t,e)||o},St.prototype._dispatchColumnAddedEvent=function(t,e,i,o){var n={};if(this._hasListener("columnAdded"))if(n.atTheMiddle=i,1===e)n.colIndex=t,n.context=o,this._dispatchColumnEvent("columnAdded",n);else for(var r=Array.isArray(o)?o:[],s=0;s<e;++s)n.colIndex=t+s,n.context=r[s],this._dispatchColumnEvent("columnAdded",n);this._frozenLayout&&(n.noDataUpdate=!0),this._dispatchColumnRenderEvent(n,t,t+e,0,this._settings.length,NaN,NaN)},St.prototype._dispatchColumnRenderEvent=function(t,e,i,o,n,r,s){if(o<n){var l;if(t.sender=this,t.fromColIndex=e,t.toColIndex=i,this._hasListener("preSectionRender"))for(l=o;l<n;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("preSectionRender",t);for(var a=e;a<i;++a){var h=this.getColumnRenderingHandler(a)||this._renderingHandler;if(h)for(t.colIndex=a,t.dataColumnName=this.getDataColumnName(a),l=o;l<n;++l){var u=this._settings[l];u.extendRenderEventArg(t,r,s);for(var p=u.getSection(),_=t.fromRowIndex,c=t.toRowIndex,d=_;d<c;++d)t.rowIndex=d,t.cell=p.getCell(a,d,!1),h(t)}}if(this._hasListener("postSectionRender"))for(l=o;l<n;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("postSectionRender",t);if(!t.noDataUpdate&&!this._noBinding)for(l=o;l<n;++l)this.updateRowData(this._settings[l],r,s-1)}},St.prototype._dispatchRowExpansionBinding=function(t){if(this._hasListener("rowExpansionBinding")){var e=t.dataSource;if(e&&e.getDataSource()){var i=t.fromRowIndex,o=t.toRowIndex,n=e.getExpansionParents(i,o),r=e.getVisibleRowIds(!0),s=t.section;t.rowData=null,t.cell=null;for(var l=i;l<o;++l){var a=n[l],h=s.getContextRow(l);if(a)t.originalRowData=e.getRowData(a),t.originalRowId=a,t.rowExpansion=h.rowExpansion=!0;else{if(!h.rowExpansion)continue;t.originalRowData=null,t.originalRowId=null,t.rowExpansion=h.rowExpansion=!1}t.rowId=r[l],t.rowIndex=l,this._dispatch("rowExpansionBinding",t)}t.originalRowData=null,t.originalRowId=null,t.rowExpansion=!1}}},St.prototype._removeColumn=function(t){var e=this._layoutX.getLaneCount();if(t>e&&(t=e),!(t<=0)){var i=e-t;this._layoutX.setLaneCount(i);for(var o=this._settings.length;--o>=0;)this._settings[o].getSection().setColumnCount(i);var n=this._columnDefs.slice(i);if(this._columnDefs.length=i,this._onColumnCountChanged(),this._syncLayoutToColumns(i,0,!0),this._hasListener("columnRemoved"))for(var r={},s=e;--s>=i;){var l=n[s-i];r.colIndex=s,r.columnData=l?l.columnData:null,this._dispatchColumnEvent("columnRemoved",r)}}},St.prototype._onSectionDataChanged=function(t){if(!this._dispatchingDataChanged){var e=this._layoutX.getLaneCount();if(this._dispatchingDataChanged=!!e,e){var i,o,n=t.fromRowIndex,r=t.toRowIndex,s=t.section,l=t.dataSource,a=l&&l.getDataSource()?1:0;s._startBindingSession(!0),a&&(i=l.getVisibleRowIds(!0),o=l.getMultipleRowData(i,n,r),t.dataRows=o);var h="content"===t.sectionType;h&&this._dispatch("beforeContentBinding",t),this._dispatch("preSectionDataBinding",t);for(var u=this.getDataColumnMap(),p=0;p<e;++p)if(s.isColumnActive(p)&&(this.isColumnVisible(p)||this._isAlwaysRenderColumn(p))){var _=this.getColumnDataBindingHandler(p)||this._dataBindingHandler;if(_){var c=u[p];t.dataColumnName=c,t.colIndex=p;for(var d=n;d<r;++d){if(a){var g=o[d];t.rowData=g,t.rowId=i[d],t.dataValue=g?g[c]:null}t.rowIndex=d,t.cell=s.getCell(p,d,!1),_(t)}}}this._dispatch("postSectionDataBinding",t),this._dispatchRowExpansionBinding(t),h&&(this._firstRendered||(this._dispatch("firstRendered",t),this._firstRendered=!0),this._dispatch("afterContentBinding",t)),s._startBindingSession(!1),this._dispatchingDataChanged=!1}}},St.prototype.resetInternalState=function(){this._firstRendered=!1},St.prototype._updateScrollbar=function(t){return!!t&&(t.isEnabled()&&t.update(),t.isActive())},St.prototype._onVScroll=function(t){this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop()),this._dispatchRowPositionChanged()},St.prototype._onHScroll=function(t){var e=this._hscrollbar.getScrollLeft();this._colVirtualizer.setViewOffset(e),this._updateColumnBounds(),this._dispatchColumnPositionChanged()},St.prototype._onVScrollEnabled=function(){this._updateScrollbarHeight(!0,!1),this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.activate(),this._vscrollbar.getAutoHide()||this._updateVScrollbar()},St.prototype._onVScrollDisabled=function(){this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.deactivate()},St.prototype._onRowInViewChanged=function(t){for(var e=t.firstIndex,i=t.lastIndex+1,o=this._settings.length,n=[0,0],r=0;r<o;++r){var s=this._settings[r],l=s.getSection();l&&!l.getFrozenLayout()&&(l.activateRows(e,i,n),this.updateRowData(s,n[0],n[1]-1))}},St.prototype._onColInViewChanged=function(t){if(this.getColumnCount()){var e=t.prevFirstIndex,i=t.prevLastIndex,o=t.firstIndex,n=t.lastIndex,r=e<o?e:o,s=i>n?i:n;this._activateColumns(o,n,r,s);for(var l=this.getSectionCount(),a=0;a<l;++a){var h=this._settings[a];this.updateRowData(h)}}},St.prototype._activateColumns=function(t,e,i,o){null==i&&(i=0),null==o&&(o=this.getColumnCount()-1);for(var n=this._getColActivationList(t,e,i,o),r=this.getSectionCount();--r>=0;)this._settings[r].activateColumns(n,i,o)},St.prototype._getColActivationList=function(t,e,i,o){null==i&&(i=0);var n=this.getColumnCount();null==o&&(o=n-1),null==t&&(t=this._colVirtualizer.getFirstIndexInView()),null==e&&(e=this._colVirtualizer.getLastIndexInView());for(var r=this.getHScrollStartIndex(),s=this.getFirstPinnedRightIndex(),l=new Array(o+1),a=i;a<=o;++a)l[a]=a<r||a>=t&&a<=e||a>=s;return l},St.prototype._getColumnDef=function(t){if(t>=0){var e=this._columnDefs[t];return e||(e=this._columnDefs[t]={id:""+St._runningColumnId++,columnData:{}}),e}return{}},St.prototype._getNestedColumnDef=function(t,e,i){var o=this._getColumnDef(t);if(e){var n=o;(o=n[e])||(o=n[e]={}),i&&((o=(n=o)[i])||(o=n[i]={}))}return o},St.prototype.getColumnId=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).id||""},St.prototype._getColumnId=St.prototype.getColumnId,St.prototype.getColumnIds=function(){for(var t=this.getColumnCount(),e=new Array(t),i=0;i<t;++i)e[i]=this._getColumnDef(i).id||"";return e},St.prototype.setColumnField=function(t,e){this._getColumnDef(t).field=e||""},St.prototype.getColumnField=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).field||""},St.prototype.getColumnFields=function(){for(var t=this.getColumnCount(),e=new Array(t),i=0;i<t;++i)e[i]=this._getColumnDef(i).field||"";return e},St.prototype.getColumnIndex=function(t){if("number"==typeof t)return t;if(t)for(var e=t,i=this.getColumnCount(),o=0;o<i;++o){var n=this._getColumnDef(o);if(e===n.id||e===n.field)return o}return-1},St.prototype.getColumnIndices=function(t){for(var e=[],i=this.getColumnCount(),o=Array.isArray(t)?t:[t],n=o.length,r=0;r<n;++r){var s=this.getColumnIndex(o[r]);s>=0&&s<i&&e.push(s)}return e},St.prototype.getColumnIndexMap=function(){for(var t=this.getColumnCount(),e={},i="",o=0;o<t;++o){var n=this._getColumnDef(o);(i=n.field)&&(e[i]=o),(i=n.id)&&(e[i]=o)}return e},St.prototype._onWindowResize=function(){this._updateLayout(),this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop())},St.prototype._onMouseMove=function(){this._vscrollbar.flash(),this._hscrollbar.flash()},St.prototype._onGridClicked=function(){if(!window.getSelection().toString()){var t=document.activeElement;this._element.contains(t)||this.focus()}},St.prototype._onRowHightlighted=function(t){if(this._hasListener("rowHighlighted")){var e=t.sender,i=this.getSectionSettings(e.getId());if(null!=i){i.extendEventArg(t);var o=i.getDataSource();null!==o&&(t.rowId=o.getRowId(t.rowIndex),t.dataRow=o.getRowData(t.rowId)),this._dispatch("rowHighlighted",t)}}},St.prototype._onRowCountChanged=function(t){if(!this._disposed){var e=t.sender,i=t.prevCount,o=t.rowCount,n=e.getIndex(),r=this._updateSectionIndices(n),s=0;if(i>o)this._layoutY.removeLaneAt(r,i-o),this._layoutY.isHomogeneous()||this._syncSectionRowHeights(e);else{var l=this._layoutY.getDefaultLaneSize(),a=e.getDefaultRowHeight();if(this._layoutY.insertLane(r+i,o-i),a!==l)for(s=i;s<o;++s)this._layoutY.setLaneSize(r+s,a)}var h=t.noBinding,u=n<=this._startVScrollbarIndex||n>=this._getFooterStartIndex(),p=this._frozenFooterCount>0,_=this._updateScrollbarHeight(u,p,h);h&&(this._hasPendingRowChange=!0),this._frozenLayout||_||(this._rowVirtualizer.isVirtualizable()?e.activateRows(this._rowVirtualizer.getFirstIndexInView(),this._rowVirtualizer.getLastIndexInView()):e.activateRows()),this._hasPendingRowChange=!1,p||this._updateVScrollbar(),this._updateColumnSeparators(),i<o?this._dispatch("rowAdded",t):i>o&&this._dispatch("rowRemoved",t)}},St.prototype._onRowHeightChanged=function(t){if(this._rowHeightSync&&!this._disposed&&!this._rowHeightConflator.conflate(t)){for(var e=this._rowHeightConflator.popAllData(),i=e.length,o=NaN,n=0;n<i;++n){var r=e[n],s=r.section;if(this._containsSection(s))for(var l=s.getIndex(),a=r.rowIndex,h=this.getRowIndex(l,a),u=r.changeLength,p=0;p<u;++p)this._layoutY.setLaneSize(h+p,s.getRowHeight(a+p))&&(l>=o||(o=l))}this._rowHeightConflator._needScrollbarUpdate?(this._rowHeightConflator._needScrollbarUpdate=!1,this._updateScrollbarHeight(!0,!0)):o>=0&&(this._dispatchingDataChanged?this._rowHeightTimerId||(this._rowHeightTimerId=setTimeout(this._requestScrollbarUpdate,0)):this._updateScrollbarHeight(o<this._startVScrollbarIndex,o>=this._startVScrollbarIndex)),this._updateColumnSeparators(),this._dispatchRowPositionChanged()}},St.prototype._containsSection=function(t){for(var e=this._settings.length;--e>=0;)if(this._settings[e].getSection()===t)return!0;return!1},St.prototype._onRowAvailable=function(t){if(!this._hasPendingRowChange){var e=t.sectionIndex;this._dispatchColumnRenderEvent(t,0,this.getColumnCount(),e,e+1,t.prevRowIndex,t.rowIndex)}},St.prototype._onSectionCountChanged=function(t){if(!this._frozenLayout){if(this._tempFrozenSectionRef){var e=this.getNextSection(this._tempFrozenSectionRef);null!==e&&(this._startVScrollbarIndex=e.getIndex(),this._tempFrozenSectionRef="")}this._startVScrollbarIndex>=0&&this._startVScrollbarIndex<this._getFooterStartIndex()?(this._vscrollbar.enable(),this._vscrollbar.setScrollContent(this,this._getAllSections(),this._startVScrollbarIndex),t||this._updateScrollbarHeight(!0,!0),this._syncLayoutToColumns()):this._vscrollbar.disable()}},St.prototype._onColumnCountChanged=function(){if(!this._frozenLayout&&!this._disposed){var t=this._countPinnedLeftColumns(),e=this._countPinnedRightColumns();this._updateColumnBounds(),this._updateColumnSeparators(),this._hScrollbarEnabled&&t+e<this.getColumnCount()?(this._hscrollbar.enable(),this._colVirtualizer.activate(),this._hscrollbar.setScrollContent(this,this._getAllSections(),t,e)):(this._hscrollbar.disable(),this._colVirtualizer.deactivate(),t=e=0),this._element.classList.toggle("right-pinning",e>0),this._dispatchColumnPositionChanged()}},St.prototype._onSyncVScroll=function(t){this._vscrollbar.setScrollTop(t.scrollTop)},St.prototype._onSyncHScroll=function(t){this._hscrollbar.setScrollLeft(t.scrollLeft)},St.prototype._getFooterStartIndex=function(){return this.getSectionCount()-this._frozenFooterCount},St.prototype._getVScrollStart=function(){return this._getSectionSize(0,this._startVScrollbarIndex)},St.prototype._getFooterSize=function(){return this._frozenFooterCount>0?this._getSectionSize(this._getFooterStartIndex()):0},St.prototype._getSectionSize=function(t,e){if(t){if(t<0)return 0}else t=0;null==e&&(e=this.getSectionCount()-t);var i=this._layoutY.getLaneStart(this._sectionStarts[t]),o=t+e;return(e>0?this._layoutY.getLaneStart(this._sectionStarts[o]):0)-i},St.prototype._updateScrollbarHeight=function(t,e,i){if(!this._vscrollbar.isEnabled())return!1;var o=e,n=t&&this._startVScrollbarIndex>=0,r=this._rowHeightConflator.isConflating();if(r&&(this._rowHeightConflator._needScrollbarUpdate=!0,o=!1),n&&!r){var s=this.getElement();if(!s)return!1;var l=this.getParent(),a=this._vscrollbar.getParent();a?a!==l&&a.firstElementChild&&(a=a.firstElementChild):(a=s,this._vscrollbar.setParent(a));var h=this._getVScrollStart(),u=this._getFooterSize();a!==s&&(h+=s.clientTop),this._vscrollbar.resetPaneSize();var p=a.clientHeight-(h+u)*this._zoomFactor;this._vscrollbar.setTop(h*this._zoomFactor),this._vscrollbar.setTrackSize(p,p/this._zoomFactor);var _=this._layoutY.getDefaultLaneSize(),c=12*_;p>c&&(c=(Math.ceil(p/_)+4)*_),this._rowVirtualizer.setViewSize(c/this._zoomFactor),this._rowVirtualizer.setViewBounds(this._startVScrollbarIndex,this.getFooterCount())}else this._rowVirtualizer.validateVirtualization();var d=!1;return i||(d=this._rowVirtualizer.update()),this._vscrollbar.invalidate(o),d},St.prototype._updateScrollbarWidth=function(t,e){if(!this._frozenLayout){if(t&&this._hScrollbarEnabled){var i=this.getElement(),o=this._hscrollbar.getParent();o||(o=this.getParent()||i,this._hscrollbar.setParent(o));var n=this._layoutX.getLaneStart(this._pinnedLeftColumnCount),r=this._layoutX.getLaneCount(),s=0,l=this._countPinnedRightColumns();l&&(s=this._layoutX.getLaneStart(r)-this._layoutX.getLaneStart(r-l));var a=o!==i?i.clientLeft:0,h=o.clientWidth-(n+a+s)*this._zoomFactor;l>0&&(h-=this._reservedSpace),this._hscrollbar.setPaneLeft(n),this._hscrollbar.setLeft((n+a)*this._zoomFactor),this._hscrollbar.setTrackSize(h,h/this._zoomFactor);var u=4*this._layoutX.getDefaultLaneSize();h>u&&(u=h),this._colVirtualizer.setViewSize(u/this._zoomFactor),this._colVirtualizer.setViewBounds(this._pinnedLeftColumnCount,l)}else this._colVirtualizer.validateVirtualization();this._colVirtualizer.update(),this._hscrollbar.invalidate(e)}},St.prototype._hitTestY=function(t,e){var i;if(e.sectionSettings)i=e.sectionSettings;else{var n,r=(n="number"==e.rowIndex?e.rowIndex:this._layoutY.hitTest(t))>=0?n:~n,s=o.upperBound(this._sectionStarts,r)-1;if(e.sectionIndex=s,!(i=this._settings[s]))return!1;i.extendEventArg(e)}var l=i.getSection();return null!=e.colIndex&&e.cellElement?e.rowIndex=l.getCellIndex(e.colIndex,e.cellElement):e.rowIndex=n+l.getRowOffset(),!0},St.prototype._syncLayoutToColumns=function(t,e,i){if(!this._frozenLayout){var o=this._layoutX.getLaneCount(),n=this.fillParentWidth(100);(n||null==t||null==e)&&(t=0,e=o,n=!0);var r=this._settings.length;if(!(r<=0)){var s=!1;if(t<e)for(var l=0;l<r;++l)s=this._syncLayoutToSectionColumns(this._settings[l].getSection(),t,e)||s;var a=n||t<this.getHScrollStartIndex()||e>this.getFirstPinnedRightIndex();this._updateScrollbarWidth(a,!0),this._updateColumnBounds(),this._updateColumnSeparators(),this._dispatchColumnPositionChanged(),(s||i)&&this._dispatch("widthChanged",{from:t,to:e,colChanged:t})}}},St.prototype._syncLayoutToSectionColumns=function(t,e,i){null==e&&(e=0),null==i&&(i=this._layoutX.getLaneCount());for(var o=0,n=e;n<i;++n)o|=t._setColumnWidth(n,this._layoutX.getLaneSize(n));return!(!o||this._frozenLayout||(t._updateColumnLayout(),0))},St.prototype._toDataColumnName=function(t){return o.isNumber(t)?this.getDataColumnName(t):t},St.prototype._updateSectionIndices=function(t){this._updatePaddingBottomSect()&&--t,t<0&&(t=0);var e=this._settings.length,i=this._settings[0]||null;i!==this._firstSettings&&(this._firstSettings&&this._firstSettings.getSection().removeClass("first"),this._firstSettings=i,this._firstSettings&&this._firstSettings.getSection().addClass("first"));var o=this._settings[e-1]||null;o!==this._lastSettings&&(this._lastSettings&&this._lastSettings.getSection().removeClass("last"),this._lastSettings=o,this._lastSettings&&this._lastSettings.getSection().addClass("last")),this._sectionStarts.length=e+1,this._sectionStarts[0]=0;for(var n=t;n<e;++n){var r=this._settings[n].getSection();r.setIndex(n),r.setRowOffset(this._sectionStarts[n]),this._sectionStarts[n+1]=this._sectionStarts[n]+r.getRowCount()}return this._sectionStarts[t]},St.prototype._updateLayout=function(){var t=this.getElement();if(!this._disposed&&t.offsetParent){this._syncLayoutToColumns(),this._updateScrollbarHeight(!0,!0),this._updateScrollbarWidth(!0,!0);for(var e=this.getSectionCount(),i=0;i<e;++i)this._settings[i].getSection().updateLayout();this._updateColumnSeparators()}},St.prototype._updateVScrollbar=function(){!this._disposed&&this._vscrollbar.isEnabled()&&(this._vScrollbarConflator.conflate()||this._vscrollbar.update())},St._proto=St.prototype;const wt=St;var bt=function(t){var e=this;e._onSectionAdded=e._onSectionAdded.bind(e),e._onMouseDown=e._onMouseDown.bind(e),e._onUIUpdated=e._onUIUpdated.bind(e),e._onColumnAdded=e._onColumnAdded.bind(e),e._onColumnRemoved=e._onColumnRemoved.bind(e),e._onItemSortingClicked=e._onItemSortingClicked.bind(e),e.refresh=e.refresh.bind(e),e._hosts=[],e._sortLogic={},e._addEvents("preClicked","clicked","preDataSorting","columnSorted"),e._sortStates=[],e._sortingSequence=["a","d"],t&&e.config({sorting:t})};u.inherits(bt,l),bt.prototype._hosts=null,bt.prototype._sortStates,bt.prototype._maxCount=1,bt.prototype._dataSorting=!0,bt.prototype._dblClickAllowed=!1,bt.prototype._clickTimer=0,bt.prototype._delayInterval=0,bt.prototype._lastMouseDown=0,bt.prototype._initialSort=null,bt.prototype._mode="",bt.prototype._sortableColumns=!0,bt.prototype._sortableIndicator=!1,bt.prototype._solarTheme=!1,bt.prototype._sortLogic,bt.prototype._userManagedLogic=!1,bt.prototype._disabled=!1,bt.prototype._frozenIndicator=!1,bt.prototype._rowDefMode=!1,bt._icons={},bt.prototype._sortingSequence,bt.prototype._sortingSequenceMap=null,bt.prototype.getName=function(){return"SortableTitlePlugin"},bt.prototype.initialize=function(t,e){this._hosts.indexOf(t)>=0||(this._hosts.push(t),1===this._hosts.length&&(t.listen("columnAdded",this._onColumnAdded),t.listen("columnRemoved",this._onColumnRemoved)),t.listen("sectionAdded",this._onSectionAdded),t.listen("postSectionRender",this._onUIUpdated),t.listen("dataSourceChanged",this.refresh),this.config(e))},bt.prototype.unload=function(t){var e=this._hosts.indexOf(t);e<0||(this._hosts.splice(e,1),t.unlisten("sectionAdded",this._onSectionAdded),t.unlisten("postSectionRender",this._onUIUpdated),t.unlisten("dataSourceChanged",this.refresh),t.unlisten("columnAdded",this._onColumnAdded),t.unlisten("columnRemoved",this._onColumnRemoved),this._hosts.length<=0&&this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0))},bt.prototype.afterInit=function(){var t=this;t.setSortLogics(t._sortLogic);var e=t._initialSort;null!=e&&(Array.isArray(e)?1===t._maxCount?t.sortColumns(e.slice(0,1)):t.sortColumns(e):t.sortColumns([e]))},bt.prototype.config=function(t){if(t){var e=this,i=t.icons;null!=i&&i.sorting&&(bt._icons=i.sorting);var o=t.themeName;!o||o.indexOf("solar")>=0?e._solarTheme=!0:e._solarTheme=!1,e._initialSort=e._initialSortByColumnField(t);var n=t.sorting;if(n){n.ROW_DEF&&(this._rowDefMode=!0),n.userManagedLogic&&(e._userManagedLogic=!0);var r=n.multiColumn||n.multicolumn;if(null!=r&&(!0===r&&(r=-1),!1===r&&(r=1),e.setSortableColumnCount("number"==typeof r&&r>0?r:-1)),null!=(r=n.sortableIndicator)&&(e._sortableIndicator=r),null!=(r=n.disabled)&&(e._disabled=!!r),null!=(r=n.threeStatesSorting)&&e.disableTwoStateSorting(r),null!=(r=n.sortingSequence)&&Array.isArray(r)&&(e._sortingSequence=r),null!=(r=n.mode)&&(e._mode=r,"manual"===r&&e.disableDataSorting()),null!=(r=n.indicatorOnly)&&e.disableDataSorting(r),null!=(r=n.disableDoubleClickToSort)&&e.disableDoubleClickToSort(r),"function"==typeof(r=n.columnSorted)&&e.listen("columnSorted",r),"function"==typeof(r=n.preClicked)&&e.listen("preClicked",r),"function"==typeof(r=n.clicked)&&e.listen("clicked",r),"function"==typeof(r=n.preDataSorting)&&e.listen("preDataSorting",r),null!=(r=n.sortableColumns)&&(e._sortableColumns=r),"object"==typeof(r=n.initialSort)&&(e._initialSort=r),"object"==typeof(r=n.sortLogic))for(var s in r)"function"==typeof r[s]&&(e._sortLogic[s]=r[s])}}},bt.prototype.getConfigObject=function(t){var e=t||{},i=e.columns;i||(i=e.columns=[]);var o=this._hosts[0];if(!o)return e;var n,r,s,l,a,h=this.getSortedColumns();if(1===this._maxCount&&null!=h)for(s=h.length,r=0;r<s;r++){var u=h[r],p=u.colIndex;(n=i[p])||(n=i[p]={}),n.sortOrder=u.sortOrder}for(s=o.getColumnCount(),r=0;r<s;++r)(n=i[r])||(n=i[r]={}),(l=this._getSortOptions(r))&&(this._sortableColumns?l.disabled&&(n.sortable=!1):l.disabled||(n.sortable=!0),(a=l.field)&&(null!=n.field&&n.field!==a&&(n.sortBy=a),this._sortingSequenceMap&&this._sortingSequenceMap[a]&&(n.sortingSequence=this._sortingSequenceMap[a])));var _=e.sorting;_||(_=e.sorting={});var c=h;null!=c&&(_.initialSort=c),!1!==(c=this._sortableIndicator)&&(_.sortableIndicator=c),1!==this._maxCount&&(_.multiColumn=-1===this._maxCount||this._maxCount),this._dblClickAllowed&&(_.disableDoubleClickToSort=!this._dblClickAllowed),!0!==(c=this._sortableColumns)&&(_.sortableColumns=c),!0!==(c=this._dataSorting)&&(_.indicatorOnly=c),this._disabled&&(_.disabled=!0);var d=this._sortingSequence,g=!0;return 2===d.length&&"a"===d[0]&&"d"===d[1]&&(g=!1),g&&(_.sortingSequence=d.slice()),W(e.sorting)&&delete e.sorting,e},bt.prototype.getColumnMenu=function(t,e){e||(e={});var i=e.menus;i||(i=e.menus=[]);var o=i[0];o||(o=i[0]={menuItems:[]});var n=this.getSortOrder(t),r={indexScore:100,label:"Sort Column",icon:"sort-a-to-z",group:"FREQUENTLY_USED",subMenu:{menuItems:[{indexScore:3,label:"Ascending",radioMode:!0,value:{colIndex:t,order:"a"},selected:"a"===n,click:this._onItemSortingClicked},{indexScore:2,label:"Descending",radioMode:!0,value:{colIndex:t,order:"d"},selected:"d"===n,click:this._onItemSortingClicked},{indexScore:1,label:"Un-Sort",radioMode:!0,value:{colIndex:t,order:"n"},selected:"n"===n,click:this._onItemSortingClicked}]}};return o.menuItems.push(r),e},bt.prototype._onItemSortingClicked=function(t){this._hosts[0].getPlugin("ColumnMenuPlugin").hide();var e=t.currentTarget.value,i=e.colIndex,o=e.sortOrder;this.sortColumn(i,o)},bt.prototype.getIcons=function(){return bt._icons},bt.prototype.setSortLogics=function(t){if(null!=t){var e=this._hosts[0];if(e){var i=e.getDataSource();for(var o in t)this._setSortLogic(i,o,t[o])}}},bt.prototype.setSortLogic=function(t,e){if("string"==typeof t){var i=this._hosts[0];if(i){var o=i.getDataSource();this._setSortLogic(o,t,e)}}},bt.prototype._setSortLogic=function(t,e,i){t&&"string"==typeof e&&("*"===e?t.setSortingLogic(i):t.setColumnSortingLogic(e,i))},bt.prototype.getSortOrder=function(t){var e=null!=t?this.getSortPriority(t):0,i=this._sortStates[e];return(i?i.sortOrder:"")||"n"},bt.prototype.getSortedColumnIndex=function(t){return this._getColumnIndexByOptions(this._sortStates[t||0])},bt.prototype.getSortPriority=function(t){for(var e=this._sortStates.length,i=0;i<e;++i)if(this._sortStates[i]===this._getSortOptions(t))return i;return-1},bt.prototype.isColumnSorted=function(t){return this.getSortPriority(t)>=0},bt.prototype.getSortedColumns=function(){var t=this._sortStates.length;if(t<=0)return null;for(var e=new Array(t),i=0;i<t;++i){var o=this.getSortedColumnIndex(i),n=this._sortStates[i];e[i]={colIndex:o,colId:this._getColumnId(o),field:n.field||"",sortOrder:n.sortOrder||"n"}}return e},bt.prototype.isSorting=function(){return!!this._sortStates.length},bt.prototype.sortColumn=function(t,e,i){var o=this._prepareSorting(t,e);o&&this._sortColumn([o],i)},bt.prototype.sortColumns=function(t,e){if(Array.isArray(t)){for(var i=[],o=0;o<t.length;o++){var n=t[o],r=n.colId||n.field;null==r&&(r=n.colIndex);var s=this._prepareSorting(r,n.sortOrder||n.order);s&&i.push(s)}this._sortColumn(i,e)}},bt.prototype.clearSortState=function(t){this._popSortState(0,t)&&this.updateSortSymbols()},bt.prototype.refresh=function(){this._sortStates.length&&(this._sortDataView(),this.updateSortSymbols())},bt.prototype.restoreUserActions=bt.prototype.refresh,bt.prototype.setSortableColumnCount=function(t){this._maxCount=t||1,this._popSortState(this._maxCount)},bt.prototype.getSortingStates=function(){return this._sortStates},bt.prototype.updateSortSymbols=function(){if(!this._disabled)for(var t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},bt.prototype.getDataColumnMap=function(){var t=this._hosts[0],e=[];if(t)for(var i=t.getColumnCount(),o=0;o<i;++o)e[o]=this.getColumnSortingField(o);return e},bt.prototype.getDataColumnNames=bt.prototype.getDataColumnMap,bt.prototype.setDataColumnMap=function(t){if(Array.isArray(t))for(var e=t.length;--e>=0;)this.setColumnSortingField(e,t[e])},bt.prototype.setDataColumnNames=bt.prototype.setDataColumnMap,bt.prototype.getColumnSortingField=function(t){var e=this._getSortOptions(t),i=e?e.field:null;if(null==i&&!this._rowDefMode){var o=this._hosts[0];o&&(i=o.getDataColumnName(t))&&e&&(e.field=i)}return i||""},bt.prototype.setColumnSortingField=function(t,e,i,o){if("number"==typeof t&&null!=e){var n=this._newSortOptions(t);e||(e=""),n.field!==e&&(n.field=e),null==i||this._userManagedLogic||n.sortLogic!==i&&(n.sortLogic=i||null,o&&i&&(i.rowSorting=!0))}},bt.prototype.getColumnSortingFields=function(){for(var t=this._sortStates.length,e=new Array(t),i=this._hosts[0],o=0;o<t;++o){var n=this._sortStates[o],r=n.field;if(!r&&!this._rowDefMode){var s=this._getColumnIndexByOptions(n);(r=i.getDataColumnName(s))&&(n.field=r)}e[o]=r||""}return e},bt.prototype.setFirstSortOrder=function(t,e){"a"!==(e=e?bt._toSortOrder(e):"a")&&"d"!==e&&(e="a");for(var i,o=(i=Array.isArray(t)?t:[t]).length,n=0;n<o;++n){var r=i[n],s=this.getSortingSequence(r).slice(),l=s.indexOf(e);l>=0&&s.splice(l,1),s.unshift(e),this.setSortingSequence(s,r)}},bt.prototype.disableTwoStateSorting=function(t){var e=this._sortingSequence.indexOf("n");!1===t?e>=0&&this._sortingSequence.splice(e,1):e<0&&this._sortingSequence.push("n")},bt.prototype.freezeIndicator=function(t){var e=this._frozenIndicator;if(this._frozenIndicator=!1!==t,e&&!this._frozenIndicator)for(var i=this._hosts.length;--i>=0;)this._updateSortableIndicator(i)},bt.prototype.disableSortSymbols=function(t){},bt.prototype.disableDataSorting=function(t){this._dataSorting=!1===t},bt.prototype.disableDoubleClickToSort=function(t){this._dblClickAllowed=!t},bt.prototype.disableCellClick=function(t,e){t&&t.enableClass("no-sort",!1!==e)},bt.prototype.disableColumnSorting=function(t,e){if(e=!1!==e,"number"==typeof t)this._disableColumnSorting(t,e);else if(Array.isArray(t))for(var i=t.length,o=0;o<i;++o)this._disableColumnSorting(t[o]||0,e)},bt.prototype._disableColumnSorting=function(t,e){var i=this._newSortOptions(t);i.disabled!==e&&(i.disabled=e)},bt.prototype.setClickDelayInterval=function(t){this._delayInterval=null!=t?t:500},bt.prototype._initialSortByColumnField=function(t){for(var e=t.columns,i=e?e.length:0,o=0;o<i;o++){var n=e[o].defaultSort;if(n)return{colIndex:o,sortOrder:n}}return null},bt.prototype._onSectionAdded=function(t){if("title"===t.sectionType){var e=t.section;0===e.getIndex()&&(e.listen("mousedown",this._onMouseDown),e.listen("click",this._onClickTitle.bind(this,t.sender),0))}},bt.prototype._onUIUpdated=function(t){"title"===t.sectionType&&this.updateSortSymbols()},bt.prototype._canClickToSort=function(t){if(this._disabled)return!1;var e=t.grid;if(!e||!e.getElement())return!1;var i=this._getPlugin("CellEditingPlugin");if(i&&i.isEditing())return!1;if(this._dispatch("preClicked",t),t.cancel)return!1;var o=t.colIndex,n=t.section,r=t.rowIndex;return!!this._isCellSortable(n,o,r)},bt.prototype._proceedSorting=function(t){if(this._clickTimer=0,this._canClickToSort(t)){var e=t.colIndex,i=this._prepareSorting(e);i&&this._sortColumn([i],{isUserAction:!0});var o=t.grid;if(o&&o.focus&&o.focus(),this._hasListener("clicked")){var n={};n.colIndex=e,n.sortOrder=this.getSortOrder(e),n.dataColumnName=this.getColumnSortingField(e),this._dispatch("clicked",n)}}},bt.prototype._onMouseDown=function(t){t.button||(this._lastMouseDown=t.timeStamp)},bt.prototype._getPlugin=function(t){var e=this._hosts[0];return e?e.getPlugin(t):null},bt.prototype._onClickTitle=function(t,e){if(!this._disabled)if(2!==e.detail||this._dblClickAllowed){if(!(e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)&&e.timeStamp-this._lastMouseDown<500){var i=t.getRelativePosition(e);if(i.hit){var o=this._getPlugin("ColumnSelectionPlugin");if(o&&o.isEnabled()){var n=i.colIndex;if(!o.isSelectedColumn(n))return}i.target=e.target,this._delayInterval>0?this._clickTimer||(this._clickTimer=setTimeout(this._proceedSorting.bind(this,i),this._delayInterval)):this._proceedSorting(i)}}}else this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0)},bt.prototype._popSortState=function(t,e){if(t<0||this._sortStates.length<=t)return!1;for(var i=!1,o=this._sortStates.length;--o>=t;)this._clearSortSymbols(this._sortStates[o]),i=!0;return this._sortStates.length=t,this._sortDataView(e),i},bt._toSortOrder=function(t){return!t||"string"!=typeof t||"d"!==(t=t.charAt(0).toLowerCase())&&"a"!==t?"n":t},bt.prototype.getSortingSequence=function(t){return this._sortingSequenceMap&&(t||0===t)&&("string"!=typeof t&&(t=this.getColumnSortingField(t)),this._sortingSequenceMap[t])?this._sortingSequenceMap[t]:this._sortingSequence},bt.prototype.setSortingSequence=function(t,e){if(Array.isArray(t))t.length||(t=null);else if(t)return;var i;if(null!=e&&("string"==typeof e?i=e:"number"==typeof e&&(i=this.getColumnSortingField(e))),t){var o=t.map(bt._toSortOrder);i?(this._sortingSequenceMap||(this._sortingSequenceMap={}),this._sortingSequenceMap[i]=o):this._sortingSequence=o}else i?this._sortingSequenceMap&&delete this._sortingSequenceMap[i]:this._sortingSequence=this._sortingSequence.length>2?["a","d","n"]:["a","d"]},bt.prototype.clearAllColumnSortingSequences=function(){this._sortingSequenceMap=null},bt.prototype.sortSeparators=function(t){var e=this._hosts[0].getDataSource();if(t)e.sortSeparators(t);else{for(var i=e.getSortingLogics(),o=[],n=[],r=this._sortStates.length,s=bt._toRowDefField(),l=0;l<r;l++){var a=this._sortStates[l],h=this._rowDefMode?s:a.field;o.push(a.sortOrder),n.push(h)}e.sortSeparators(i,o,n)}},bt.prototype._prepareSorting=function(t,e){if(!this._maxCount)return null;var i=this._getColumnIndex(t),o=this.getSortPriority(i),n=this.getColumnSortingField(i),r=o>=0?this._sortStates[o]:null,s=r?r.sortOrder:"n",l="n";if(null==e){var a=this.getSortingSequence(n),h=a.indexOf(s);l=a[h=h<0?0:(h+1)%a.length]}else l=bt._toSortOrder(e);if(r){if(s===l)return this.updateSortSymbols(),null;this._sortStates.splice(o,1),this._clearSortSymbols(r)}if("a"===l||"d"===l){if(i<0&&!n)return null;r||(r=this._newSortOptions(i)),i<0&&(r.field=n),this._sortStates.push(r)}r&&("n"!==s?r.prevOrder=s:delete r.prevOrder,r.order=l,r.sortOrder=l);var u=[];if(this._maxCount>0)for(;this._sortStates.length>this._maxCount;){var p=this._clearSortSymbols(this._sortStates.shift());null!==p&&u.push(p)}return{colIndex:i,sortedField:n,sortOrder:l||"n",prevOrder:s,clearedSortColIndexes:u}},bt.prototype._sortColumn=function(t,e){this._sortDataView(e),this.updateSortSymbols();var i=t[0]||{},o=t.length;if(o>1){i.colIndices=new Array(o),i.sortedFields=new Array(o),i.sortOrders=new Array(o),i.prevOrders=new Array(o);for(var n=0;n<o;n++){var r=t[n];i.colIndices[n]=r.colIndex,i.sortedFields[n]=r.sortedField,i.sortOrders[n]=r.sortOrder,i.prevOrders[n]=r.prevOrder}}this._dispatch("columnSorted",i)},bt.prototype._onColumnAdded=function(t){var e=this,i=t.colIndex,o=t.context||{},n=!!e._sortableColumns,r=o.field,s=o.sortBy;null!=s&&(n=!!s,r=s),null!=o.sortable&&(n=!!o.sortable);var l=o.sortLogic||o.sortingLogic||o.sorter;l||(l=e._sortLogic[r]),"function"!=typeof l&&(l=null);var a=o.sortingSequence;null!=a&&r&&e.setSortingSequence(a,r),n?e.setColumnSortingField(i,r,l,o.rowSorting):e.disableColumnSorting(i,!0);var h=o.sortOrder||o.sort;null!=h&&"n"!==(h=bt._toSortOrder(h))&&(e.clearSortState(),e.sortColumn(i,h))},bt.prototype._onColumnRemoved=function(t){if(t.atTheMiddle&&this._sortStates.length){var e=t.columnData,i=e?e.sortableTitle:null;if(i&&i.sortOrder){var o=this._sortStates.indexOf(i);o>=0&&this._sortStates.splice(o,1),this._clearSortSymbols(i),this._sortDataView()}}},bt._toRowDefField=function(t){return"ROW_DEF"},bt.prototype._sortDataView=function(t){if(t=t||{},this._dispatch("preDataSorting",t),this._dataSorting){var e=this._sortStates.length;this._userManagedLogic&&e>1&&(e=1);var i=null,o=null,n=null;if(e){i=new Array(e),o=new Array(e);for(var r=0;r<e;++r)i[r]=this._sortStates[r].sortOrder,o[r]=this._sortStates[r].sortLogic;n=this._rowDefMode?this._sortStates.map(bt._toRowDefField):this.getColumnSortingFields(),this._userManagedLogic&&n.length>1&&(n=n.slice(0,1))}for(var s=this._hosts.length;--s>=0;){var l=this._hosts[s].getDataSource();if(l){var a=1==t.isUserAction;l.sort(n,i,o,a)}}}},bt.prototype._clearSortSymbols=function(t){var e=t.targetCells;if(!e)return null;for(var i=null,o=e.length;--o>=0;){var n,r=e[o];r.removeClass("sorting"),r.removeClass("sortable"),r.removeFloatingIcon("sort-symbol"),r.removeFloatingIcon("priority-symbol"),null==i&&(n=r.getSection())&&(i=n.getColumnIndex(r.getParent()))}return e.length=0,i},bt.prototype._updateSortableIndicator=function(t){var e=this,i=e._hosts[t];if(i&&!this._frozenIndicator){var o=i.getSection("title");if(null!=o)for(var n=o.getColumnCount();--n>=0;)for(var r=o.getRowCount(),s=0;s<r;s++){var l=o.getCell(n,s,!0);if(l&&(l.removeClass("sorting"),l.removeClass("sortable"),l.removeClass("asc"),l.removeClass("desc"),l.removeClass("edge-indicator"),l.removeFloatingIcon("sort-symbol"),l.removeFloatingIcon("priority-symbol"),l.removeFloatingIcon("sortable-indicator"),s===r-1&&e._isCellSortable(o,n,s))){l.addClass("sortable");var a,h,u,p=e.getSortPriority(n),_=e._sortStates[p];if(_&&"n"!==_.sortOrder)_.targetCells||(_.targetCells=[]),_.targetCells[t]=l,"a"===_.sortOrder?l.addClass("asc"):l.addClass("desc"),l.addClass("sorting"),e._solarTheme?("a"===_.sortOrder?(u="▲",h=bt._icons.ascending):(u="▼",h=bt._icons.descending),(a=e._createIconElem(h,u)).className="sort-symbol",l.insertFloatingIcon(a,0)):l.addClass("edge-indicator"),e._sortStates.length>1&&((a=document.createElement("span")).className="priority-symbol",a.textContent=p+1,l.insertFloatingIcon(a,1));else e._sortableIndicator&&(h=bt._icons.sortable,(a=e._createIconElem(h,"◊")).className="sortable-indicator",l.insertFloatingIcon(a,0))}}}},bt.prototype._createIconElem=function(t,e){var i;return t&&"string"==typeof t?(i=document.createElement("ef-icon")).setAttribute("icon",t):(i=document.createElement("span")).textContent=e,i},bt.prototype._getColumnIndexByOptions=function(t){if(t)for(var e=this._hosts[0],i=e?e.getColumnCount():0,o=0;o<i;++o){var n=e.getColumnData(o);if(n&&t===n.sortableTitle)return o}return-1},bt.prototype._getColumnIndex=function(t){var e=this._hosts[0];return e&&null!=t?e.getColumnIndex(t):-1},bt.prototype._getColumnId=function(t){var e=this._hosts[0];return e&&null!=t?e.getColumnId(t):""},bt.prototype._getSortOptions=function(t){var e=this._hosts[0];if(e){var i=e.getColumnData(t);if(i)return i.sortableTitle}return null},bt.prototype._newSortOptions=function(t){var e=this._hosts[0],i=null;if(e&&t>=0){var o=e.getColumnData(t);(i=o.sortableTitle)||(i=o.sortableTitle={})}return i||{}},bt.prototype._isCellSortable=function(t,e,i){var o=this._getSortOptions(e);if(o){if(o.disabled)return!1;var n=o.field;if(null!=n&&!n)return!1}var r=t.getCell(e,i,!0);return!r.hasClass("no-sort")&&r===t.getCell(e,t.getRowCount()-1,!0)&&!r.getParent().classList.contains("collapsed")},bt._proto=bt.prototype;const Rt=bt;var It=window.tr;It||(It=window.tr={});var xt=It.grid;xt||(xt=It.grid={}),Object.assign(It,o),It.EventDispatcher=l,It.ElementWrapper=_,It.ElementFrameWork=h,It.ILayoutGrid=C,It.LayoutGrid=N,It.Grid=wt,It.ColumnStats=ot,It.DataCache=U,It.DataTable=et,It.DataView=at,It.SegmentCollection=Z,xt.CellFloatingPanel=d,xt.Cell=f,xt.CellSpan=z,xt.CellSpans=V,xt.Column=w,xt.Scrollbar=k,xt.HScrollbar=G,xt.VScrollbar=ft,xt.VirtualizedLayoutGrid=vt,xt.Conflator=ut,xt.Reverter=F,xt.TrackLayout=m,xt.Virtualizer=dt,xt.SelectionList=P,xt.SectionSettings=_t,xt.SortableTitlePlugin=Rt})();