@refinitiv-ui/efx-grid 6.0.104 → 6.0.105

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- !function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e,n){"use strict";n.r(e),n.d(e,"Grid",(function(){return ii}));let o={create:function(t,e){let i=document.createElement(t);return e&&(i.className=e),i},div:function(t){return o.create("div",t)},text:function(t,e){let i=o.create("span",e);return(t||0===t)&&(i.textContent=t),i},appendChild:function(t,e){if(!t)return null;let i,n;Array.isArray(arguments[1])?(n=arguments[1],i=0):(n=arguments,i=1);let o=n.length;for(;i<o;)t.appendChild(n[i]),++i;return t},buildTree:function(t,e){if(!t)return null;let i=arguments,n=i.length;for(let e=1;e<n;++e){let n=i[e];if(n){let e;Array.isArray(n)?e=o.buildTree.apply(null,n):1===n.nodeType&&(e=n),e&&t.appendChild(e)}}return t},removeParent:function(t){if(!t)return null;let e=t.parentNode;return e&&e.removeChild(t),e},setParent:function(t,e){return t?e?(e.appendChild(t),e):o.removeParent(t):null},removeChildren:function(t,e){if(t){let i=t.childNodes.length;for((null==e||e>i)&&(e=i);--e>=0;)t.removeChild(t.lastChild)}},setContent:function(t,e){if(t)if(e||0===e){let i=e.nodeType;1===i||3===i?e!==t.lastChild&&(o.removeChildren(t),t.appendChild(e)):Array.isArray(e)?(o.removeChildren(t),o.appendChild(t,e)):t.textContent=e}else o.removeChildren(t)},toggleAttribute:function(t,e,i){i?t.setAttribute(e,"string"==typeof i?i:""):null==i?t.hasAttribute(e)?t.removeAttribute(e):t.setAttribute(e,""):t.removeAttribute(e)},toggleClass:function(t,e,i){i?t.classList.add(e):null==i?t.classList.contains(e)?t.classList.remove(e):t.classList.add(e):t.classList.remove(e)},addClasses:function(t,e){if(t){let i=Array.isArray(e)?e:arguments,n=i.length;for(let e=0;e<n;++e){let n=i[e];n&&"string"==typeof n&&t.classList.add(n)}}},removeClasses:function(t,e){if(t){let i=Array.isArray(e)?e:arguments,n=i.length;for(let e=0;e<n;++e){let n=i[e];n&&"string"==typeof n&&t.classList.remove(n)}}},preventDefault:function(t){t.preventDefault(),t.stopPropagation()},stopPropagation:function(t){t.stopPropagation()},getClientPosition:function(t,e){let i=e||{x:0,y:0};if(t.getBoundingClientRect){let e=t.getBoundingClientRect();i.x=e.left,i.y=e.top}else i.x=t.clientX,i.y=t.clientY;return i},getRelativePosition:function(t,e,i){i=o.getClientPosition(t,i);let n=o.getClientPosition(e);return i.x-=n.x,i.y-=n.y,i},closestElement:function(t,e){let i=t;for(;i;){if(i.classList&&i.classList.contains(e))return i;i=i.parentNode||i.host}return null},closestTagName:function(t,e){let i=t;for(;i;){if(i.tagName&&i.tagName==e)return i;i=i.parentNode||i.host}return null}};let r=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)};r.prototype._data,r.prototype._func=null,r.prototype._delay=0,r.prototype._timerId=0,r.prototype._conflated=!1,r.prototype._disabled=!1,r.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},r.prototype.popAllData=function(){if(this._data.length){let t=this._data;return this._data=[],t}return null},r.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},r.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))},r.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},r.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},r.prototype.getData=function(){return this._data},r.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},r.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},r.prototype.getConflatingTime=function(){return this._delay},r.prototype.disable=function(t){this._disabled=!1!==t},r.prototype.isEnabled=function(){return!this._disabled},r.prototype.enable=function(t){this._disabled=!1===t};let s={inherits:function(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.base=function(t,i,n){i||(i="constructor");let o=arguments.length,r=new Array(o);for(let t=2;t<o;t++)r[t-2]=arguments[t];return e.prototype[i].apply(t,r)}}};var l=s;let a=function(){};a.prototype._events=null,a.prototype._listenerCount=0,a.prototype.addEventListener=function(t,e){if(!t||!e)return;this._events||(this._events={});let i=this._events[t];i?i.indexOf(e)<0&&(i.push(e),++this._listenerCount):(this._events[t]=[e],++this._listenerCount)},a.prototype.removeEventListener=function(t,e){let i=this._events?this._events[t]:null;if(i){let t=i.indexOf(e);t>=0&&(i.splice(t,1),--this._listenerCount)}},a.prototype.removeAllEventListeners=function(){this._events=null,this._listenerCount=0},a.prototype.hasListener=function(t){if(this._listenerCount){if(t){let e=this._events?this._events[t]:null;return!!e&&e.length>0}return!0}return!1},a.prototype.getListener=function(t,e){if(t){let i=this._events?this._events[t]:null;if(i)return e||(e=0),i[e]||null}return null},a.prototype.addListener=function(t,e){let i=t?t[e]:null;"function"==typeof i&&this.addEventListener(e,i)},a.prototype._prepareEventArguments=function(t,e){return e},a.prototype._dispatch=function(t,e){let i=this._events?this._events[t]:null;if(i){e=this._prepareEventArguments(t,e);let n=i.length;for(let t=0;t<n;++t)i[t](e)}};a.preventDefault=function(t){t&&t.preventDefault&&(t.preventDefault(),t.stopPropagation())};var u=a;let h=function(t,e){if(t=t.trim(),this._inputConverter[t]&&(t=this._inputConverter[t]),this._input=t,null!=e&&(this._index=e),null!=this._constants[t])return this._value=this._constants[t],void(this._type=typeof this._value);let i=t.charAt(0),n=t.length>1?t.charAt(t.length-1):"";if('"'===i&&'"'===n)return this._value=t.substring(1,t.length-1),void(this._type="string");if("'"===i&&"'"===n)return this._value=t.substring(1,t.length-1),void(this._type="string");if("("===i&&")"===n)return void this._resolveVariableGroup(t);if("["===i&&"]"===n)return void this._resolveArray(t);if(t.match(/TR\.\w+\(/))return void(this._type="dynamic");let o=t.match(/[\w._]+\(/g);if(o&&1===o.length)return void this._resolveFunction(t,o[0]);let r=t.match(/[\w._♦]+/g);if(r&&r.length>1)return void this._resolveVariableGroup(t);if("♦"===i)return void(this._type="token");let s=Number(t);if(s==s)return this._value=s,void(this._type="number");this._type="dynamic"};h.prototype._input="",h.prototype._index=-1,h.prototype._type="",h.prototype._subVars=null,h.prototype._funcName="",h.prototype._value,h.prototype._valueWithTokenField="",h.prototype._inputConverter={TRUE:"true",FALSE:"false",PI:"Math.PI","TRUE()":"true","FALSE()":"false","PI()":"Math.PI"},h.prototype._constants={true:!0,false:!1,null:null,NaN:NaN,"Math.E":Math.E,"Math.PI":Math.PI,"Math.SQRT2":Math.SQRT2,"Math.SQRT1_2":Math.SQRT1_2,"Math.LN2":Math.LN2,"Math.LN10":Math.LN10,"Math.LOG2E":Math.LOG2E,"Math.LOG10E":Math.LOG10E},h.prototype.getExpression=function(){return"dynamic"===this._type?'this.__D("'+this._input+'", __R)':"group"===this._type?this._value:"function"===this._type?this._subVars?"this.__F["+this._index+"]("+this._subVars.join(", ")+")":"this.__F["+this._index+"]()":"array"===this._type?this._subVars?"["+this._subVars.join(", ")+"]":"[]":this._input},h.prototype.getInputWithTokenField=function(){return"dynamic"===this._type?"♠"+this._input+"♥":"group"===this._type?this._valueWithTokenField:"function"===this._type?this._funcName+"("+this.getChildInputWithToken()+")":"array"===this._type?"["+this.getChildInputWithToken()+"]":this._input},h.prototype.getChildInputWithToken=function(){let t=this._subVars?this._subVars.length:0;if(t<=0)return"";let e=new Array(t);for(let i=0;i<t;++i)e[i]=this._subVars[i].getInputWithTokenField();return e.join(", ")},h.prototype.toString=h.prototype.getExpression,h.prototype.getValue=function(){return this._value},h.prototype.getInput=function(){return this._input},h.prototype.getIndex=function(){return this._index},h.prototype.setIndex=function(t){this._index=t},h.prototype.getFunctionName=function(){return this._funcName},h.prototype.getFieldNames=function(t){if(this._subVars){if(t){let e=this._subVars.length;for(let i=0;i<e;++i)this._subVars[i].getFieldNames(t)}return this._subVars[0].getFieldNames()}return"dynamic"===this._type?(t&&(t[this._input]=!0),this._input):""},h.prototype._resolveVariableGroup=function(t){let e=this._subVars?this._subVars.length:0;return this._type="group",this._value=t.replace(/[\w._♦]+/g,function(t){this._subVars||(this._subVars=[]);let e=new h(t,this._subVars.length);return this._subVars.push(e),e.getExpression()}.bind(this)),this._valueWithTokenField=t.replace(/[\w._♦]+/g,function(t){return this._subVars[e++].getInputWithTokenField()}.bind(this)),this._value},h.prototype._resolveFunction=function(t,e){if(this._type="function",this._funcName=e.substr(0,e.length-1),t=(t=t.replace(e,"")).substr(0,t.length-1)){this._subVars=[];let e=t.split(","),i=e.length;for(let t=0;t<i;++t)this._subVars[t]=new h(e[t],t)}},h.prototype._resolveArray=function(t){if(this._type="array",t=t.substr(1,t.length-1)){this._subVars=[];let e=t.split(","),i=e.length;for(let t=0;t<i;++t)this._subVars[t]=new h(e[t],t)}};var p=h;let d=function(t,e){this._input=t||"",null!=e&&(this._context=e,e._DATA&&(this.__D=e._DATA)),this.__F=[],this._fnTokens=[],this._fields=[],this._fieldMap={},this._dataCache={},this._intervalServices={},this._formulaCount=1,this._onDataCacheChanged=this._onDataCacheChanged.bind(this),this.dispatchDataChanged=this.dispatchDataChanged.bind(this),this._parse(this._input)};l.inherits(d,u),d._isBoundFormula={RECORD:!0,TR:!0,MTXSERIES:!0,NOW:!0,TODAY:!0,ADSTYLEATTRIBUTE:!0,ADBONDDERIV:!0,ADBONDYIELD:!0,BDSETTLE:!0,ACCRUED:!0,CFYLD:!0,DFFORMATDATE:!0,DFADDPERIOD:!0,DFADDWD:!0,DFADDMONTHS:!0,DFADDYEARS:!0,DFADJUSTTOWD:!0,DFLASTWD:!0,DFFINDDATED:!0,DFCOUNTDAYS:!0,DFCOUNTWD:!0,ADFXSWPTODEP:!0,FXCALCPERIOD:!0,OPCALCDERIV:!0,OPIMPLIEDVOL:!0,ADFORMAT:!0,ADHISTORYVALUE:!0},d.prototype._input="",d.prototype._expression="",d.prototype._alias="",d.prototype._main=null,d.prototype.__F=null,d.prototype._fnTokens=null,d.prototype._fields=null,d.prototype._fieldMap=null,d.prototype._reference="",d.prototype._context=null,d.prototype._rtService=null,d.prototype._intervalServices=null,d.prototype._dataCache=null,d.prototype._dataLastError="",d.prototype._inputWithTokenField="",d.prototype._formulaCount=0,d._invalidOps={"+=":!0,"-=":!0,"*=":!0,"/=":!0,"|=":!0,"&=":!0,"^=":!0},d.prototype.dispose=function(){this._rtService&&(this._rtService.dispose(),this._rtService=null);for(let t in this._intervalServices)this._intervalServices[t].removeEventListener("dataChanged",this.dispatchDataChanged);this._intervalServices=null,this.unlistenAll()},d.prototype.calculate=function(t){if(this._main){this._dataLastError="";let e=this._main(t);switch(this._dataLastError){case"Pending data":e=null;break;case"Pending - no erase":e="..."}return e}return null},d.prototype.getFunction=function(){return this._main},d.prototype.getFieldNames=function(){return this._fields},d.prototype._setReference=function(t){this._reference=t},d.prototype.getReference=function(){return this._reference},d.prototype.getExpression=function(){return this._expression},d.prototype.toString=d.prototype.getReference,d.prototype.getInput=function(){return this._input},d.prototype.getAlias=function(){return this._alias||this._input},d.prototype.setAlias=function(t){this._alias=t},d.prototype.addFormulaCount=function(){this._formulaCount++},d.prototype.subtractFormulaCount=function(){return 0==--this._formulaCount},d.prototype.updateContext=function(){if(!this._context)return;let t=this._fnTokens.length;for(let e=0;e<t;++e){let t=this._fnTokens[e].getFunctionName();this.__F[e]=this._context[t]||d._emptyFunction,d._isBoundFormula[t]&&(this.__F[e]=this.__F[e].bind(this))}},d.prototype._logger=function(t){console.log("["+t+"] "+this._fnTokens[t].getFunctionName()+" is executed")},d._emptyFunction=function(){},d.prototype._detectCodeInjection=function(t){let e=!1;if(t.match(/\+\+|--/)&&(e=!0),!e){let i=t.match(/([^=]=+)/g)||[];for(let t=i.length;--t>=0;){let n=i[t],o=n.substring(n.length-2);if(d._invalidOps[o]){e=!0;break}}}return e},d.toUpperCase=function(t){if(!t||"="!==t.charAt(0))return t||"";let e=[],i=[];return t=(t=(t=d.tokenizeQuotes(t,e,i)).toUpperCase()).replace(/TR(\.[\w ]+)+\([^\(\)]*\)(\.[a-zA-Z]+)*/g,d._encloseWithTR),t=d.resolveTokens(t,e,i)},d._encloseWithTR=function(t){return'TR("'+t+'")'},d.tokenizeQuotes=function(t,e,i){let n;e||(e=[]),i||(i=[]);let o=!1,r=[];do{o=!1,t=t.replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,(function(t){return o=!0,n=e.length,e.push(new p(t,n)),r.push(n),"♦"+n+"♦"}))}while(o);return i.push(r),t},d.tokenizeAdcWithParams=function(t,e,i){let n;e||(e=[]),i||(i=[]);let o=!1,r=[];do{o=!1,t=t.replace(/TR\.\w+\([^\)]*\)+/g,(function(t){return o=!0,n=e.length,e.push(new p(t,n)),r.push(n),"♦"+n+"♦"}))}while(o);return i.push(r),t},d.replaceUnwantedCharacters=function(t,e,i){for(;t.indexOf(" ")>=0;)t=t.replace(/ {2}/g," ");return t=(t=(t=t.replace(/\$/g,"")).replace(/\&+/g,(function(t){return"&"===t?"+":t}))).replace(/(<=|>=|!=|!==|===|==|=(?!([\w]*\([^()]*\))))/g,(function(t){return"="===t?"==":t}))},d.prototype._tokenizeParentheses=function(t,e,i){e||(e=[]),i||(i=[]);let n={},o=/[\w._]*(?:=|=[\w]*)?\([^()]*\)/,r=new RegExp(o.source,"g");for(;t.match(o);){let o=[];t=t.replace(r,(function(t,i){"="===t.charAt(0)&&(t=t.substr(1,t.length));let r=n[t];return null==r&&(r=e.length,e.push(new p(t,r)),n[t]=r),o.push(r),"♦"+r+"♦"})),i.push(o)}return t},d.prototype._tokenizeConstants=function(t,e,i){e||(e=[]),i||(i=[]);let n=[];return t=t.replace(/[\w._♦]+/g,(function(t){if("♦"===t.charAt(0))return t;let i=e.length;return e.push(new p(t,i)),n.push(i),"♦"+i+"♦"})),i.push(n),t},d.resolveTokens=function(t,e,i){for(let n=i.length;--n>=0;){let o=i[n],r=o.length;for(let i=0;i<r;++i){let n=o[i],r=e[n];t=t.replace(new RegExp("♦"+n+"♦","g"),(function(){return r.getExpression()}))}}return t},d._getInputWithTokenField=function(t,e,i){for(let n=i.length;--n>=0;){let o=i[n],r=o.length;for(let i=0;i<r;++i){let n=o[i],r=e[n];t=t.replace(new RegExp("♦"+n+"♦","g"),(function(){return r.getInputWithTokenField()}))}}return"="+t},d.prototype._parse=function(t){if(this._expression="",this._main=null,this.__F.length=0,this._fnTokens.length=0,this._fields.length=0,!t)return null;if("="===t.charAt(0)&&(t=t.substr(1)),!(t=(t=(t=(t=t.trim()).replace(/<>/g,"!=")).replace(/‛|‘|’/g,"'")).replace(/‟|“|”/g,'"'))||this._detectCodeInjection(t))return null;let e=[],i=[];t=d.tokenizeQuotes(t,e,i),t=d.tokenizeAdcWithParams(t,e,i),t=d.replaceUnwantedCharacters(t,e,i),t=this._tokenizeParentheses(t,e,i),t=this._tokenizeConstants(t,e,i),this._inputWithTokenField=d._getInputWithTokenField(t,e,i),t=d.resolveTokens(t,e,i);let n={},o=e.length;for(let i=0;i<o;++i){let o=e[i];if(o.getFunctionName()){let e=this._fnTokens.length;t=t.replace(new RegExp("this\\.__F\\["+i+"\\]","g"),"this.__F["+e+"]"),o.setIndex(e),this._fnTokens.push(o)}o.getFieldNames(n)}return this._expression=t,this.updateContext(),this._main=this._createFunction(this._expression),this._main?(this._fieldMap=n,this._fields=Object.keys(n),this._main):null},d.prototype._createFunction=function(t){let e=null;try{e=new Function("__R","return "+t+";"),e=e.bind(this),e({})}catch(t){e=null}return e},d.prototype.__D=function(t,e){return e[t]},d.prototype.addField=function(t,e){return!this._fieldMap[t]&&(!(t.indexOf("undefined")>=0)&&(this._fields.push(t),this._fieldMap[t]=!0,this._dispatch("dataRequired",{field:t,src:e||"adc"}),!0))},d.prototype.changeField=function(t,e){let i=this._fields.indexOf(t);if(i<0)return!1;this._fields.splice(i,1),this._fields.indexOf(e)<0&&this._fields.push(e);let n=this._input,o="♠"+t+"♥",r="♠"+e+"♥";return this._inputWithTokenField=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t===o?r:t})),this._input=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t.substr(1,t.length-2)})),this._expression=this._expression.replace(new RegExp('this\\.__D\\("'+t+'", __R\\)',"g"),'this.__D("'+e+'", __R)'),this._main=this._createFunction(this._expression),this._dispatch("formulaChanged",{oldInput:n,formula:this}),!0},d.prototype.changeFields=function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;let i=this._input;for(let i=t.length;--i>=0;){let n=t[i],o=e[i],r=this._fields.indexOf(n);if(r<0)continue;this._fields.splice(r,1),this._fields.indexOf(o)<0&&this._fields.push(o);let s="♠"+n+"♥",l="♠"+o+"♥";this._inputWithTokenField=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t===s?l:t})),this._input=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t.substr(1,t.length-2)})),this._expression=this._expression.replace(new RegExp('this\\.__D\\("'+n+'", __R\\)',"g"),'this.__D("'+o+'", __R)')}return this._main=this._createFunction(this._expression),this._dispatch("formulaChanged",{oldInput:i,formula:this}),!0},d.prototype.getRealtimeService=function(){return this._rtService},d.prototype.setRealtimeService=function(t){this._rtService&&this._rtService.dispose(),this._rtService=t,this._rtService.addEventListener("dataChanged",this._onDataCacheChanged)},d.prototype.getIntervalService=function(t){return this._intervalServices[t]},d.prototype.setIntervalService=function(t,e){if(!e)return;let i=this._intervalServices[t];i&&i.removeEventListener("dataChanged",this.dispatchDataChanged),this._intervalServices[t]=e,e.addEventListener("dataChanged",this.dispatchDataChanged)},d.prototype.getCachedData=function(t){return this._dataCache[t]},d.prototype.setCachedData=function(t,e){this._dataCache[t]=e},d.prototype.setDataError=function(t){this._dataLastError=t},d.prototype.dispatchDataChanged=function(t){this._dispatch("dataCacheChanged",{})},d.prototype._onDataCacheChanged=function(t){let e=t.ric,i=t.values,n=this._dataCache[e];if(n)for(let t in i)n[t]=i[t];else this._dataCache[e]=i;this._dispatch("dataCacheChanged",{})},d._proto=d.prototype;var c=d;var _={en:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat",Sunday:"Sunday",Monday:"Monday",Tuesday:"Tuesday",Wednesday:"Wednesday",Thursday:"Thursday",Friday:"Friday",Saturday:"Saturday",jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec",January:"January",February:"February",March:"March",April:"April",May:"May",June:"June",July:"July",August:"August",September:"September",October:"October",November:"November",December:"December",am:"am",AM:"AM",pm:"pm",PM:"PM"},de:{sun:"So",mon:"Mo",tue:"Di",wed:"Mi",thu:"Do",fri:"Fr",sat:"Sa",Sunday:"Sonntag",Monday:"Montag",Tuesday:"Dienstag",Wednesday:"Mittwoch",Thursday:"Donnerstag",Friday:"Freitag",Saturday:"Samstag",jan:"Jan",feb:"Feb",mar:"Mrz",apr:"Apr",may:"Mai",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Okt",nov:"Nov",dec:"Dez",January:"Januar",February:"Februar",March:"März",April:"April",May:"Mai",June:"Juni",July:"Juli",August:"August",September:"September",October:"Oktober",November:"November",December:"Dezember",am:"am",AM:"AM",pm:"pm",PM:"PM"},ja:{sun:"日",mon:"月",tue:"火",wed:"水",thu:"木",fri:"金",sat:"土",Sunday:"日曜日",Monday:"月曜日",Tuesday:"火曜日",Wednesday:"水曜日",Thursday:"木曜日",Friday:"金曜日",Saturday:"土曜日",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"1月",February:"2月",March:"3月",April:"4月",May:"5月",June:"6月",July:"7月",August:"8月",September:"9月",October:"10月",November:"11月",December:"12月",am:"午前",AM:"午前",pm:"午後",PM:"午後"},zh:{sun:"周日",mon:"周一",tue:"周二",wed:"周三",thu:"周四",fri:"周五",sat:"周六",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月",am:"上午",AM:"上午",pm:"下午",PM:"下午"},"zh-Hant":{sun:"週日",mon:"週一",tue:"週二",wed:"週三",thu:"週四",fri:"週五",sat:"週六",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月",am:"上午",AM:"上午",pm:"下午",PM:"下午"}};let f=function(t,e,i){if(!t)return null;if(!e||t===e)return t;let n;if(i){let o=i.length;for(let r=0;r<o;++r)n=i[r],n&&C(t,e,n)}else for(n in e)C(t,e,n);return t},g=function(t,e){return f({},t,e)},y=function(t){for(let e in t)return!1;return!0},m=function(t,e){if(!Array.isArray(t))return t;if(!e)return null;let i=t;t={};let n=i.length;for(let o=0;o<n;++o){let n=e[o];n&&void 0!==i[o]&&(t[n]=i[o])}return t},C=function(t,e,i){let n=e[i];if(null!=n){let e=t[i];Array.isArray(e)?t[i]=e.concat(n):Array.isArray(n)&&e?t[i]=n.concat(e):t[i]=n}},S=function(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if("object"==typeof t){if(Array.isArray(t)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!S(t[i],e[i]))return!1}else{if(Object.keys(t).length!==Object.keys(e).length)return!1;for(let i in t)if(!S(t[i],e[i]))return!1}return!0}return!1},w=function(t){return Array.isArray(t)?"{\n"+t.join("\n")+"\n}":t},b=function(t){return t.replace(/\n+/g,"\n\t").replace(/\n\t}$/,"\n}")},R=function(t,e){if(!t)return null;let i=document.createElement("style");i.textContent="\n"+t+"\n";let n,o=function(t){if(t){let e;if(t.shadowRoot?e=t.shadowRoot:t.getRootNode&&(e=t.getRootNode()),e&&e!==document&&e!==t)return e}return null}(e),r=!0;return o||(r=!1,o=document.head),r&&o.children&&o.children.length&&(n=o.children[0]),n?o.insertBefore(i,n):o.appendChild(i),i},v=function(t,e){e||(e=[]);for(let i in t){let n=t[i];"object"==typeof n?v(n,e):e.push(n)}return e},I=function(t){if(!t||"string"!=typeof t)return"";if("#"===t.charAt(0))return t;let e=t.match(/\d+/g);if(!e||e.length<3)return t;let i="#";for(let t=0;t<3;t++){let n=+e[t];n>=16||(i+="0"),i+=n?n.toString(16).toUpperCase():"0"}return i};let D=function(t,e,i){this.resolve=this.resolve.bind(this),this.reject=this.reject.bind(this),"function"==typeof t&&(this._resolveHandler=t),"function"==typeof e&&(this._rejectHandler=e),null!=i&&(this._ctx=i),this.promise=new Promise(function(t,e){this._resolve=t,this._reject=e}.bind(this))};D.prototype.promise=null,D.prototype._resolve=null,D.prototype._reject=null,D.prototype._resolveHandler=null,D.prototype._rejectHandler=null,D.prototype._ctx=null,D.prototype._fulfilled=!1,D.prototype.resolve=function(t){if(this._resolve){if(this._resolveHandler){let e=this._resolveHandler(t,this._ctx||this);null!=e&&(t=e)}this._resolve(t),this._finally()}},D.prototype.reject=function(t){if(this._reject){if(this._rejectHandler){let e=this._rejectHandler(t,this._ctx||this);null!=e&&(t=e)}this._reject(t),this._finally()}},D.prototype.isFulfilled=function(){return this._fulfilled},D.prototype._finally=function(){this._fulfilled=!0,this._ctx=this._resolveHandler=this._rejectHandler=null,this._resolve=this._reject=null};let x={},A=function(t,e){"attributes"==e.type&&"lang"==e.attributeName&&(t.lang=e.target.lang||"en")},L=function(t,e,i){"attributes"===i.type&&(null!=e?i.attributeName===e&&t(i.target.getAttribute(e)):t(i.target))};x._getNewId=function(){return"observer_"+ ++x._id},x._addObserver=function(t,e,i){let n=i;n||(n={}),n.attributes=!0,x._observer.observe(t,n),x._addListener(t,e)},x._onMutationCallback=function(t){for(let e=0;e<t.length;e++){let i=t[e],n=x._listeners[i.target._observeId];for(let t=0;t<n.length;t++)n[t](i)}},x._addListener=function(t,e){let i=x._listeners;if(i||(i=x._listeners={}),!t._observeId){let e=x._getNewId();t._observeId=e}i[t._observeId]||(i[t._observeId]=[]);let n=i[t._observeId];n.indexOf(e)<0&&n.push(e)},x.addLanguageListener=function(t){t&&(t.lang=document.documentElement.lang||"en",x._addObserver(document.documentElement,A.bind(null,t)))},x.addAttributeListener=function(t,e,i){t&&e&&x._addObserver(t,L.bind(null,e,i))},x._observer=new MutationObserver(x._onMutationCallback),x._listeners={},x._id=0;let T={en:!0,de:!0,ja:!0,zh:!0,"zh-Hant":!0},E={_deferred:null,themeReady:null,_defaultColors:{up:"#39C46E",down:"#F5475B",level:"#C2C2C2",tickUp:"#39C46E",tickDown:"#F5475B",baseGrid:"#1A1A1C",baseText:"#C2C2C2",trackColor:"#FF9933"}};E.themeColors=E._defaultColors,E._components={},E._themeName="",E._elfVersion=0,E._dummyIcon=null,E._iconLoaded=!1,E._profileName=null,E._callbacks=[],E._observed=!1,E._pendingResolve=!1,E._themeLoaded=!1,E._icons={"elf-theme-halo":{rowGrouping:{expander:"down"},sorting:{ascending:"hollow-arrow-up",descending:"hollow-arrow-down",sortable:"sort-up-down"},columnStack:{stack:"map-layers",expand:"right",collapse:"left"}},"elf-theme-solar":{columnStack:{stack:"list",expand:"right",collapse:"left"}}},E._icons["halo-theme"]=E._icons["elf-theme-halo"],E._icons["solar-theme"]=E._icons["elf-theme-solar"],E.getElfVersion=function(){if(!E._elfVersion){let t=0;if(window.EFX_GRID){let e=window.EFX_GRID.version;e=e.split("."),t=+e[0]}else if(window.elf)if(window.elf.version){let e=window.elf.version.match(/\d/);e&&e[0]&&(t=parseInt(e[0],10))}else window.elf.customElements?t=3:window.customElements&&(t=4);else window.Polymer&&(t=1);E._elfVersion=t}return E._elfVersion},E.hasComponent=function(t){let e=E._components[t];if(null==e){e=0;let i=E.getElfVersion();if(t){let n;1===i?(n=document.createElement(t),n.is===t&&(e=i)):i>1&&(window.customElements&&window.customElements.get(t)||document.createElement(t).constructor!==HTMLElement)&&(e=i),E._components[t]=e}}return e},E.toLangString=function(t){if(!t)return"";if("zh-hant"===(t=t.toLowerCase()))return"zh-Hant";let e=t.replace(/-.*/,"");return T[e]?e:""},E.hasTheme=function(t){return t===E.getThemeName()},E.getThemeName=function(t){return E._themeName||(E._themeName=E.getCssVariable("--theme-name",document.documentElement)),E._themeName},E.setThemeName=function(t){E._themeName=t},E.isThemeLoaded=function(){return E._themeLoaded},E.getColors=function(){return E.themeColors},E.isHaloTheme=function(t){return null==t&&(t=E.getThemeName()),!!t&&t.indexOf("halo")>=0},E.injectIcons=function(t,e){if("object"!=typeof t)return;let i=E.getThemeName();t.themeName=i;let n=E.getElfVersion();t.elfVersion=n;let o=E._icons[i];o&&(t.icons=o)},E.getIconList=function(){let t=E._icons[E.getThemeName()];return t?v(t):[]},E._onIconPreloaded=function(){if(E._dummyIcon){let t=E._dummyIcon.parentNode;t&&t.removeChild(E._dummyIcon),E._dummyIcon=null}},E.prepareIconPreloading=function(){if(!E._iconLoaded){E._iconLoaded=!0;let t=E.getIconList();if(t.length){setTimeout(E._onIconPreloaded,10);let e=E._dummyIcon=document.createElement("ef-icon");return e.style.transform="scale(0)",document.body.appendChild(e),t}}return null},E.getCssVariable=function(t,e){let i="",n=e||document.body;return window&&"string"==typeof t&&1===n.nodeType&&t.match(/^--/)&&(i=window.getComputedStyle(n).getPropertyValue(t),i=i.replace(/[\"\']/g,"")),i},E.getCssVariables=function(t,e){let i=e||document.body;if(window&&1===i.nodeType){let e=window.getComputedStyle(i);for(let i in t){let n=t[i];n&&n.match(/^--/)&&(t[i]=e.getPropertyValue(n).replace(/\"/g,""))}}return t||null},E.setRTK=function(t){null!=t&&(E._rtk=t)},E.getMovementColorProfile=function(){return document.documentElement.getAttribute("movement-color-profile")},E._addThemeChangedCallback=function(t){let e=E._callbacks;e.indexOf(t)<0&&e.push(t)},E.reloadThemeColors=function(){return E._deferred&&E._deferred.isFulfilled()?(E._profileName="",E._themeLoaded=!1,E.themeReady=null,E.getThemeColors()):E.themeReady},E.getThemeColors=function(t){if("function"==typeof t&&E._addThemeChangedCallback(t),E.themeReady)return E.themeReady;let e=E._deferred=new D;E.themeReady=e.promise;let i=E.getMovementColorProfile();if(i)i!==E._profileName?setTimeout(E._profileNameRetrieved,100):E._deferred.resolve(E.themeColors);else{let t={providerName:"Configuration",settingName:"RDE_USER_CURRENT_TICK_COLOR"},e=window?window.JET:null;if(E._themeLoaded=!1,E._rtk&&E._rtk.Settings)E._rtk.Settings.getAsync(t).then(E._loadingProfileSuccess).catch(E._loadingProfileFailure);else if(e&&e.Settings)try{e.Settings.read(E._loadingProfileSuccess,t)}catch(t){E._loadingProfileFailure()}else setTimeout(E._profileNameRetrieved,100)}return e.promise};let M=function(t){if(t!==E._profileName){E._retrieveThemeColors(t),E._pendingResolve&&(E._pendingResolve=!1,E._deferred.resolve(E.themeColors));let e=E._callbacks;for(let t=0;t<e.length;t++)e[t]()}};E._loadingProfileSuccess=function(t){t&&document.documentElement.setAttribute("movement-color-profile",t.toLowerCase()),E._observed?E._pendingResolve=!0:E._profileNameRetrieved(t)},E._loadingProfileFailure=function(){E._retrieveThemeColors(),E._observed||(E._observed=!0,x.addAttributeListener(document.documentElement,M,"movement-color-profile")),E._deferred.reject("Failed to get movement color profile from settings.")},E._profileNameRetrieved=function(){let t=E.getMovementColorProfile();E._retrieveThemeColors(t),E._observed||(E._observed=!0,x.addAttributeListener(document.documentElement,M,"movement-color-profile")),E._deferred.resolve(E.themeColors)},E._retrieveThemeColors=function(t){E._themeLoaded=!0,E._profileName=t;let e=E.themeColors=E.getCssVariables({primary:"--color-scheme-primary",secondary:"--color-scheme-secondary",tertiary:"--color-scheme-tertiary",complementary:"--color-scheme-complementary",up:"--color-scheme-positive",down:"--color-scheme-negative",level:"--color-scheme-neutral",tickUp:"--color-scheme-tickup",tickDown:"--color-scheme-tickdown"});e.up||(e.up=E._defaultColors.up,e.down=E._defaultColors.down,e.level=E._defaultColors.level,e.tickUp=E._defaultColors.tickUp,e.tickDown=E._defaultColors.tickDown),e.positive=e.up,e.negative=e.down,e.neutral=e.level;let i=document.createElement("table");i.style.visibility="hidden",i.style.position="fixed",i.style.left="0",i.style.top="0",i.style.width="0";let n=i.insertRow(-1),o=n.insertCell(-1);document.body.appendChild(i);let r=window.getComputedStyle(n);e.tableBg=r.backgroundColor;let s=window.getComputedStyle(o);e.tableText=s.color,e.tableBorder=s.borderColor,e.tableText===e.tableBorder&&(o.className="tr-lg",s=window.getComputedStyle(o),e.tableBg=s.backgroundColor,e.tableText=s.color,e.tableBorder=s.borderColor,e.tableText===e.tableBorder&&(e.tableBg=E._defaultColors.baseGrid,e.tableText=E._defaultColors.baseText,e.tableBorder="")),e.tableBg=I(e.tableBg),e.tableText=I(e.tableText),e.tableBorder=I(e.tableBorder),document.body.removeChild(i),e.baseGrid=e.tableBg,e.baseText=e.tableText,e.trackColor=e.primary||E._defaultColors.trackColor};var F=E;new Date(NaN);const P=Date.UTC(1900,0,1),z=Date.UTC(1900,2,1),V=["sun","mon","tue","wed","thu","fri","sat"],k=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],O=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],N=["January","February","March","April","May","June","July","August","September","October","November","December"];let H=function(t){return t>9?""+t:"0"+t},B={D:function(t,e){return""+t.getDate()},DD:function(t,e){return H(t.getDate())},DDD:function(t,e){return e[V[t.getDay()]]},D_:function(t,e){return e[k[t.getDay()]]},M:function(t,e){return""+(t.getMonth()+1)},MM:function(t,e){return H(t.getMonth()+1)},MMM:function(t,e){return e[O[t.getMonth()]]},M_:function(t,e){return e[N[t.getMonth()]]},YY:function(t,e){return(""+t.getFullYear()).slice(-2)},Y_:function(t,e){return""+t.getFullYear()},H:function(t,e){return""+t.getHours()},H_:function(t,e){return H(t.getHours())},h:function(t,e){let i=t.getHours()%12;return 0===i?"12":""+i},h_:function(t,e){let i=t.getHours()%12;return i=0===i?12:i,H(i)},m:function(t,e){return""+t.getMinutes()},m_:function(t,e){return H(t.getMinutes())},s:function(t,e){return""+t.getSeconds()},s_:function(t,e){return H(t.getSeconds())},S:function(t,e){return~~(t.getMilliseconds()/100)},SS:function(t,e){return H(~~(t.getMilliseconds()/10))},S_:function(t,e){return(i=t.getMilliseconds())>99?""+i:i>9?"0"+i:"00"+i;var i},A:function(t,e){return t.getHours()<12?e.AM:e.PM},a:function(t,e){return t.getHours()<12?e.am:e.pm}},G={_dateTimePattern:"M/D/YY h:mm A",_localeSetting:"en",_activeLocaleMap:null,_activeInput:null,setDateTimePattern:function(t){G._dateTimePattern=t||"M/D/YY h:mm A"},setLocale:function(t){let e=F.toLangString(t);G._localeSetting=_[e]?e:"en"},format:function(t,e,i){let n=null,o="",r=!(!i||"LOCAL"!==i.toUpperCase());if("number"==typeof t)t>1e8?n=new Date(t):(n=G.fromDateNumber(t),r=!0);else if(t instanceof Date)n=new Date(t);else{o=t+"";let e=o.match(/^\d{4}(-\d{2}(-\d{2}(T\d{2}\:\d{2}\:\d{2})?)?)?$/);o=o.replace(/\-/g,"/"),e&&(o=o.replace(/T/g," ")),n=new Date(o)}return G.isInvalidDate(n)?t||"":(r||n.setTime(n.getTime()+6e4*n.getTimezoneOffset()),G.formatDateObject(n,e))},formatDateObject:function(t,e){if(G.isInvalidDate(t))return"";e||(e=G._dateTimePattern),G._activeInput=t,G._activeLocaleMap=_[G._localeSetting]||DateTimeLocale.en;let i=e.replace(/D+|M+|Y+|H+|S+|A+|d+|m+|y+|h+|s+|a+|\[[^\]]*\]+/g,G._parseDatePattern);return G._activeInput=null,i},_lowerCaseDatePatterns:{d:!0,y:!0},_parseDatePattern:function(t){let e=t?t.charAt(0):"";if("["===e)return t.substring(1,t.length-1);let i=B[t];if(!i){let n=t;G._lowerCaseDatePatterns[e]&&(n=t.toUpperCase(),e=e.toUpperCase(),i=B[n]),i||(n=e+"_",i=B[n])}return i?i(G._activeInput,G._activeLocaleMap):t},isValidDate:function(t){if(t&&t.getTime){let e=t.getTime();return e==e}return!1},isInvalidDate:function(t){if(t&&t.getTime){let e=t.getTime();return e!=e}return!0},fromDateNumber:function(t){let e=G.dateNumberToMs(t);if(e==e){let i=G.timeNumberToMs(t);return new Date(e+i)}return new Date(NaN)},dateNumberToMs:function(t){if(!(t=Math.floor(+t))||t<=0||60===t)return NaN;let e=t-25569;return t<60&&e++,864e5*e},timeNumberToMs:function(t){"number"!=typeof t&&(t=+t);let e=t-Math.floor(t);return e?(e<0&&(e=-e),1e3*Math.round(86400*e)):0},toDateObject:function(t){let e=null;if(t instanceof Date)e=t;else if("number"==typeof t)e=t>3e9||t<=0?new Date(t):t>1e5?new Date(1e3*t):G.fromDateNumber(t);else if(t){let i=t+"",n=i.match(/^\d{4}(-\d{2}(-\d{2}(T\d{2}\:\d{2}\:\d{2})?)?)?$/);i=i.replace(/\-/g,"/"),n&&(i=i.replace(/T/g," ")),e=new Date(i)}else e=new Date(NaN);return e},toDateNumber:function(t){return G._millisecondToDateNumber(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()))},toTimeNumber:function(t){return Date.UTC(1970,0,1,t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds())/864e5},_millisecondToDateNumber:function(t){if((t=+t)!=t||t<P)return NaN;{let e=t/864e5+25569;return t<z&&e--,e}},toYYYYMMDD:function(t){let e=t?t.toJSON():"";return e?e.slice(0,10):""}};var W=G;let U={ISEMPTY:function(t){return t!=t||0===t||t?0:1},ISERR:function(t){return t!=t||null==t?1:0},ISNA:function(t){return""===t?1:0},ISNUMBER:function(t){return"number"==typeof t?1:0},ISSTRING:function(t){return"string"==typeof t?1:0},ISNASTRING:function(t){if(t){if(0===t.length)return 1;if(t.constructor===Object){for(let e in t)return 0;return 1}}else if(""===t)return 1;return 0}};var Y=U;let q={AND:function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;for(let e=t.length;--e>=0;)if(!t[e])return 0;return 1},FALSE:function(){return 0},IF:function(t,e,i){return t?e:i},NOT:function(t){return t?0:1},OR:function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;for(let e=t.length;--e>=0;)if(t[e])return 1;return 0},TRUE:function(){return 1}};var X=q;let j={};j.ABS=Math.abs,j.ACOS=Math.acos,j.ACOSH=function(t){return Math.log(t+Math.sqrt(t*t-1))},j.ASIN=Math.asin,j.ASINH=function(t){return t===-1/0?t:Math.log(t+Math.sqrt(t*t+1))},j.ATAN=Math.atan,j.ATAN2=function(t,e){return Math.atan2(e,t)},j.ATANH=function(t){return Math.log((1+t)/(1-t))/2},j.CEILING=function(t,e){return e||(e=1),t/=e,Math.ceil(t)*e},j.CEIL=j.CEILING,j.COMBIN=function(t,e){let i=j.FACT;return i(t)/(i(e)*i(t-e))},j.COS=Math.cos,j.COSH=function(t){let e=Math.exp(t);return(e+1/e)/2},j.DEGREES=function(t){return t/(Math.PI/180)},j.EVEN=function(t){return(t=Math.ceil(t))%2?t<0?t-1:t+1:t},j.EXP=Math.exp,j.FACT=function(t){if(t<0)return NaN;t=Math.floor(t);let e=1;for(;t>1;)e*=t,--t;return e},j.FACTDOUBLE=function(t){if(t<0)return NaN;t=Math.floor(t);let e=1;for(;t>1;)e*=t,t-=2;return e},j.FLOOR=function(t,e){return e||(e=1),t/=e,Math.floor(t)*e},j.GCD=function(t,e){if(t<0&&(t=-t),e<0&&(e=-e),e>t){let i=t;t=e,e=i}for(;0!=e;){if(0==(t%=e))return e;e%=t}return t},j.INT=Math.floor,j.LCM=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length,i=Math.abs(t[0]);for(let n=1;n<e;n++){let e=Math.abs(t[n]),o=i;for(;i&&e;)i>e?i%=e:e%=i;i=Math.abs(o*t[n])/(i+e)}return i},j.LN=Math.log,j.LOG=function(t,e){return null==e&&(e=10),Math.log(t)/Math.log(e)},j.LOG10=function(t){return Math.log(t)/Math.LN10},j.MOD=function(t,e){return t%e},j.ODD=function(t){return(t=Math.ceil(t))%2==0?t<0?t-1:t+1:t},j.POWER=Math.pow,j.PRODUCT=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t[0];if(null==e||e!=e)return NaN;for(let i=t.length;--i>=1;)e*=t[i];return e},j.PROD=j.PRODUCT,j.QUOTIENT=function(t,e){return Math.floor(t/e)},j.RADIANS=function(t){return t*(Math.PI/180)},j.RAND=Math.random,j.RANDBETWEEN=function(t,e){return Math.floor(Math.random()*(e-t+1))+t},j.ROUND=function(t,e){if(!e)return Math.round(t);let i=Math.pow(10,e);return Math.round(t*i)/i},j.ROUNDDOWN=function(t,e){if(!e)return Math.floor(t);let i=Math.pow(10,e);return Math.floor(t*i)/i},j.ROUNDUP=function(t,e){if(!e)return Math.ceil(t);let i=Math.pow(10,e);return Math.ceil(t*i)/i},j.SERIESSUM=function(t,e,i,n){let o=0;for(let r=n.length;--r>=0;)o+=n[r]*Math.pow(t,e+r*i);return o},j.SIGN=function(t){return t>0?1:t<0?-1:0},j.SIN=Math.sin,j.SINH=function(t){let e=Math.exp(t);return(e-1/e)/2},j.SQRT=Math.sqrt,j.SQRTPI=function(t){return Math.sqrt(t*Math.PI)},j.SUM=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let i=t.length;--i>=0;)e+=t[i];return e},j.SUMPRODUCT=function(){let t,e=arguments[0]instanceof Array?arguments[0]:arguments,i=e.length;if(0===i)return 0;let n=[];for(t=0;t<i;++t)n[t]=1;for(t=0;t<i;++t)n[t]*=e[t];let o=0;for(t=0;t<i;++t)o+=n[t];return o},j.SUMSQ=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let i=t.length;--i>=0;){let n=t[i];e+=n*n}return e},j.TAN=Math.tan,j.TANH=function(t){if(t===1/0)return 1;if(t===-1/0)return-1;let e=Math.exp(2*t);return(e-1)/(e+1)},j.TRUNC=function(t,e){if(!e)return Math.floor(t);let i=Math.pow(10,e);return Math.floor(t*i)/i};var K=j;let J={AVERAGE:function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length;if(e<=0)return NaN;let i=0;for(let n=e;--n>=0;)i+=t[n];return i/e}};J.AVG=J.AVERAGE,J.COUNT=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let i=t.length;--i>=0;){let n=t[i];null!=n&&n==n&&++e}return e},J.MAX=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;if(t.length<=0)return NaN;let e=t[0];for(let i=t.length;--i>=1;)t[i]>e&&(e=t[i]);return e},J.MIN=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;if(t.length<=0)return NaN;let e=t[0];for(let i=t.length;--i>=1;)t[i]<e&&(e=t[i]);return e},J.STDEV=function(){let t=arguments[0]instanceof Array?arguments[0]:Array.prototype.slice.call(arguments),e=t.length;if(e<=0)return NaN;if(1===e)return 0;let i=J.AVERAGE(t),n=0;for(let o=e;--o>=0;){let e=t[o]-i;n+=e*e}return Math.sqrt(n/(e-1))},J.STDEVP=function(){let t=arguments[0]instanceof Array?arguments[0]:Array.prototype.slice.call(arguments),e=t.length;if(e<=0)return NaN;if(1===e)return 0;let i=J.AVERAGE(t),n=0;for(let o=e;--o>=0;){let e=t[o]-i;n+=e*e}return Math.sqrt(n/e)};var Q=J;let Z={},$=function(t){return t||0===t?t+"":""};Z.EXACT=function(t,e){return(t+="")===(e+="")?1:0},Z.FIND=function(t,e,i){if(!(t=$(t)))return 0;if(!(e=$(e)))return 0;return(!(i=+i)||i<0)&&(i=0),e.indexOf(t,i)},Z.LEFT=function(t,e){return(e=+e)||(e=0),e<0&&(e=1),$(t).substr(0,e)},Z.LENGTH=function(t){return $(t).length},Z.LEN=Z.LENGTH,Z.LOWER=function(t){return $(t).toLowerCase()},Z.MID=function(t,e,i){return $(t).substr(e,i)},Z.REPLACE=function(t,e,i,n){n+="";let o=(t=$(t)).split("");return o.splice(i,e,n),o.join("")},Z.RIGHT=function(t,e){(e=+e)||(e=0),e<0&&(e=1);let i=(t=$(t)).length-e;return t.substr(i,e)},Z.TRIM=function(t){return $(t).trim()},Z.UPPER=function(t){return $(t).toUpperCase()},Z.VALUE=function(t){return+t},Z.CHAR=function(t){let e=+t;return String.fromCharCode(e)},Z.CLEAN=function(t){let e=$(t).split("");for(let t=e.length;--t>=0;){let i=e[t].charCodeAt(0);(i<32||i>127)&&(e[t]="")}return e.join("")},Z.CODE=function(t){return $(t).charCodeAt(0)},Z.PROPER=function(t){let e=(t=$(t)).split(/[\W_]/g),i=t.match(/[\W_]/g),n=e.length,o="";for(let t=0;t<n;t++){let n=e[t],r=n.length;1===r?o+=n.toUpperCase():0!==r&&(o+=n.charAt(0).toUpperCase()+n.substr(1).toLowerCase());let s=i[t];s&&(o+=s)}return o},Z.REPEAT=function(t,e){if(!(e=+e)||e<0)return"";if(""===(t=$(t)))return"";let i=t;for(let n=1;n<e;n++)i+=t;return i},Z.STRING=function(t,e){return(t=+t)?(!(e=+e)||e<0?e=0:e>9&&(e=9),t.toFixed(e)):""};var tt=Z;let et=function(){this._context={},et._addContext(this._context,et.getContext()),this._context._DATA=this._getData.bind(this),this._setData=this._defaultFormulaDataSetter.bind(this),this._formulas=[],this._formulaMap={},this._referenceMap={}};l.inherits(et,u),et.prototype._context=null,et.prototype._rowData=null,et.prototype._setData=null,et.prototype._formulas=null,et.prototype._formulaMap=null,et.prototype._referenceMap=null,et._context=null,et.getContext=function(){let t=et._context;return t||(t={},et._context=t,et._addContext(t,W),et._addContext(t,Y),et._addContext(t,X),et._addContext(t,K),et._addContext(t,Q),et._addContext(t,tt)),t},et.addContext=function(t){let e=et.getContext();et._addContext(e,t)},et._addContext=function(t,e){for(let i in e)t[i]=e[i]},et.prototype.setFormulaDataGetter=function(t){"function"==typeof t&&(this._context._DATA=t)},et.prototype.setFormulaDataSetter=function(t){"function"==typeof t&&(this._setData=t)},et.prototype._defaultFormulaDataSetter=function(t,e,i,n){if("..."!==e){let o=t.getAlias();i[o]=e,n&&(n[o]=e)}},et.prototype.addFormula=function(t){let e;return t instanceof c?e=t:(this._rowData={},e=new c(t,this._context),this._rowData=null),e.addEventListener("dataCacheChanged",this._dispatch.bind(this,"dataChanged")),e.addEventListener("dataRequired",this._dispatch.bind(this,"dataRequired")),e.addEventListener("formulaChanged",this._dispatch.bind(this,"formulaChanged")),this._formulas.push(e),e},et.prototype.mockFormula=function(t){let e;return e=new c(t instanceof c?t.getInput():t,this._context),e},et.prototype.removeFormula=function(t){let e;if(t instanceof c&&(t=this._formulas.indexOf(t)),"number"==typeof t)e=this._formulas[t],e&&(this._formulas.splice(t,1),e.getReference()&&(delete this._formulaMap[e.getReference()],delete this._referenceMap[e.getReference()]),e.dispose());else if("string"==typeof t&&(e=this._formulaMap[t],e)){let i=this._formulas.indexOf(e);i>=0&&(this._formulas.splice(i,1),delete this._formulaMap[t],delete this._referenceMap[t]),e.dispose()}return e||null},et.prototype.removeAllFormulas=function(){let t=this._formulas;for(let e=t.length;--e>=0;)delete this._referenceMap[t[e].getReference()];this._formulas.length=0,this._formulaMap={}},et.prototype.getFormula=function(t){let e;return e="number"==typeof t?this._formulas[t]:this._formulaMap[t],e||null},et.prototype.getFormulaByExpression=function(t){let e=this._formulas.length;for(let i=0;i<e;++i){let e=this._formulas[i];if(e.getInput()===t)return e}return null},et.prototype.getAllFormulas=function(){return this._formulas},et.prototype.getAllFormulaReferences=function(){return this._referenceMap},et.prototype.getFormulaCount=function(){return this._formulas.length},et.prototype._generateUniqueReference=function(t){let e=t,i=0;for(;null!=this._referenceMap[e];)e=t+"_"+ ++i;return e},et.prototype.addReference=function(t,e){if(!t||!e)return"";e=this._generateUniqueReference(e);let i="";if(t instanceof c){if(!this._setFormulaReference(t,e))return"";i=t.getAlias()}else i=t;return this._referenceMap[e]=i,e},et.prototype.renameReference=function(t,e){if(!e)return this.removeReference(t);if(!t||null==this._referenceMap[t]||t===e)return!1;let i=this._formulaMap[t];if(i&&!this.isValidReference(i,e))return!1;for(let i=this._formulas.length;--i>=0;){let n=this._formulas[i];if(n.changeField(t,e)){let t=n.getReference();t&&(this._referenceMap[t]=n.getAlias())}}return i&&this._setFormulaReference(i,e),this._referenceMap[e]=this._referenceMap[t],delete this._referenceMap[t],!0},et.prototype.removeReference=function(t){if(!t||null==this._referenceMap[t])return!1;let e=this._formulaMap[t];return null!=e&&(e._setReference(""),delete this._formulaMap[t]),delete this._referenceMap[t],!0},et.prototype.resolveReference=function(t){return this._referenceMap[t]||t},et.prototype._getData=function(t,e){if(!this._rowData)return null;let i=this._rowData[this.resolveReference(t)];if(i){let t=Number(i);t==t&&(i=t)}return i},et.prototype._setFormulaReference=function(t,e){if(this._formulaMap[e])return console.warn("Duplicate formula reference detected."),!1;let i=t.getReference();if(i===e)return!1;e&&(this._formulaMap[e]=t),t._setReference(e);let n=this._sortDependencies(this._formulas,this._formulaMap);return n?(this._formulas=n,delete this._formulaMap[i],!0):(t._setReference(i),delete this._formulaMap[e],!1)},et.prototype.calculate=function(t,e){this._rowData=t;let i=this._formulas.length;for(let n=0;n<i;++n){let i=this._formulas[n];if(e){let t=null!=e[i.getAlias()];if(!t){let n=i.getFieldNames();for(let i=n.length;--i>=0;)if(null!=e[this.resolveReference(n[i])]){t=!0;break}if(!t)continue}}let o=i.calculate(t);this._setData(i,o,t,e)}this._rowData=null},et.prototype.isValidReference=function(t,e){if(!e)return!0;if(this._referenceMap[e])return!1;let i=t.getReference(),n=this._createParentChildrenMap(this._formulas);if(i){delete n[i];for(let t in n){let o=n[t],r=o.indexOf(i);-1!==r&&(o=o.slice(0),o.splice(r,1),r=o.indexOf(e),-1===r&&o.push(e),n[t]=o)}}return n[e]=t.getFieldNames(),!!this._sortParentChildrenMap(n)},et.prototype._sortDependencies=function(t,e){if(1===t.length)return t;let i=this._createParentChildrenMap(t),n=this._sortParentChildrenMap(i);if(!n)return null;let o=t.filter((function(t){return!t.getReference()})),r=[];if(e){for(let t=n.length;--t>=0;){let i=e[n[t]];i&&r.push(i)}o.length>0&&(r=r.concat(o))}return r},et.prototype._createParentChildrenMap=function(t){let e,i={};for(e=t.length;--e>=0;){let n=t[e],o=n.getReference();o&&(i[o]=n.getFieldNames())}return i},et.prototype._sortParentChildrenMap=function(t){let e,i,n,o,r,s={};for(r in t){n=t[r],o=n.length;for(let t=0;t<o;++t)i=n[t],s[i]=s[i]+1||1}let l=[];for(r in t)s[r]||l.push(r);let a=[];for(;l.length>0;)for(r=l.shift(),a.push(r),n=t[r],o=n?n.length:0,e=0;e<o;++e)i=n[e],--s[i]>0||l.push(i);for(i in s)if(s[i])return null;return a},et._proto=et.prototype;let it={};it.isIE=function(){let t=window.navigator.userAgent;return t.indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0}(),it.isTouchDevice=!!(navigator.maxTouchPoints&&navigator.maxTouchPoints<256||navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints<256),it.isSafari=function(){let t=navigator.userAgent;return!/Chrome|Android|CriOS|FxiOS|EdgiOS/i.test(t)&&/Safari/i.test(t)}(),it.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),it.getElement=function(t){return it.isElement(t)?t:t&&it.isFunction(t.getElement)?t.getElement():null},it.isElement=function(t){return!!t&&1===t.nodeType},it.isEmpty=function(t,e){return null==t||void 0===t||!e&&""===t||it.isArray(t)&&0===t.length},it.isNumber=function(t){return"number"==typeof t&&isFinite(t)},it.isString=function(t){return"string"==typeof t},it.isArray=Array.isArray,it.isFunction=function(t){return"function"==typeof t},it.getClientPosition=function(t,e){let i=e||{};if(t.getBoundingClientRect){let e=t.getBoundingClientRect();i.x=e.left,i.y=e.top}else i.x=t.clientX,i.y=t.clientY;return i},it.getRelativePosition=function(t,e,i){i=it.getClientPosition(t,i);let n=it.getClientPosition(e);return i.x-=n.x,i.y-=n.y,i},it.moveArrayItem=function(t,e,i){if(!t)return null;let n=t.length;if(e>=n&&i>=n)return t;let o=t.splice(e,1)[0];return i<n?t.splice(i,0,o):t[i]=o,t},it.pushArrayItems=function(t,e){let i=e?e.length:0;if(i>0)if(i<1e5)i>1?Array.prototype.push.apply(t,e):t.push(e[0]);else{let n=0,o=0;for(;n<i;)o+=1e5,Array.prototype.push.apply(t,e.slice(n,o)),n=o}return t},it.insertEmptyItems=function(t,e,i){if(i>0)if(i>1){let n=t.slice(e);t.length=e,t.length+=i,it.pushArrayItems(t,n)}else t.splice(e,0,null)},it.cycleArray=function(t,e){if(e>0&&t&&e<t.length){let i=t.splice(0,e);return t.concat(i)}return t||null},it.lowerBound=function(t,e,i,n,o){(null==i||i<0)&&(i=0),(null==n||n<0||n>t.length)&&(n=t.length),i>n&&(i=n),null==o&&(o=it._defaultLessComparator);let r=0;for(;n>i;)r=i+n>>1,o(t[r],e)?i=r+1:n=r;return i},it.upperBound=function(t,e,i,n,o){let r=it.lowerBound(t,e,i,n,o);for(;t[r]===e;)++r;return r},it.stringFormat=function(t){let e=Array.prototype.slice.call(arguments,1);return t.replace(/{(\d+)}/g,(function(t,i){return null!=e[i]?e[i]:t}))},it._defaultLessComparator=function(t,e){return t<e},it._deprecatedFunction=function(){console.warn("Calling deprecated method")},it.calculatePercent=function(t,e,i){if(!t&&0!==t||!e&&0!==e||!i&&0!==i)return NaN;if(i===t)return 50;let n=(e-t)/(i-t);return n<0?0:n>1?100:100*n},it.closestElement=function(t,e){let i=t;for(;i;){if(i.classList&&i.classList.contains(e))return i;i=i.parentNode||i.host}return null},it._preventDefault=function(t){t.preventDefault(),t.stopPropagation()};var nt=it;let ot=function(t){this.dispatch=this.dispatch.bind(this),this._listeners=[],this.setSender(t)};ot.prototype.listen=function(t,e){if(t&&nt.isFunction(t)&&this._listeners.indexOf(t)<0)if(null==e)this._listeners.push(t);else{t._priority=e;let i=nt.lowerBound(this._listeners,t,0,this._listeners.length,ot.listenerComparer);this._listeners.splice(i,0,t)}},ot.prototype.unlisten=function(t){if(t){let e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}},ot.prototype.unlistenAll=function(){this._listeners.length=0},ot.prototype.getListenerCount=function(){return this._listeners.length},ot.prototype.hasListener=function(){return this._listeners.length>0},ot.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(let e=0;e<this._listeners.length;e++)this._listeners[e](t);null!==this._sender&&(t.sender=null),this._dispatching=!1}},ot.prototype.isDispatching=function(){return this._dispatching},ot.prototype.isEnabled=function(){return this._enabled},ot.prototype.enable=function(t){this._enabled=!1!==t},ot.prototype.disable=function(t){this._enabled=!1===t},ot.prototype.setSender=function(t){this._sender=t||null},ot.prototype.setEventArgExtender=function(t){this._extender=null!=t?t:null},ot.listenerComparer=function(t,e){return null==e._priority||t._priority>=e._priority},ot.prototype._listeners=null,ot.prototype._sender=null,ot.prototype._extender=null,ot.prototype._enabled=!0,ot.prototype._dispatching=!1,ot._proto=ot.prototype;var rt=ot;let st=function(){};st.prototype._customEvents=null,st.prototype.listen=function(t,e,i){this._customEvents&&this._customEvents[t]&&this._customEvents[t].listen(e,i)},st.prototype.unlisten=function(t,e){this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlisten(e)},st.prototype.unlistenAll=function(t){if(t)this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(let t in this._customEvents)this._customEvents[t].unlistenAll()},st.prototype._addEvent=function(t){if(!t)return;this._customEvents||(this._customEvents={}),this._customEvents[t]||(this._customEvents[t]=new rt(this))},st.prototype._addEvents=function(t){let e=Array.isArray(t)?t:arguments,i=e.length;for(let t=0;t<i;++t)this._addEvent(e[t])},st.prototype._isEventDispatching=function(t){let e=this._customEvents[t];return!!e&&e.isDispatching()},st.prototype._disableEvent=function(t,e){let i=this._customEvents[t];i&&i.disable(e)},st.prototype._hasListener=function(t){return!(!this._customEvents||!this._customEvents[t])&&this._customEvents[t].hasListener()},st.prototype._dispatch=function(t,e){this._customEvents[t].dispatch(e)},st._proto=st.prototype;var lt=st;let at=function(){let 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")};l.inherits(at,lt),at.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._quotes2=null},at.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))},at.prototype.getSubscriptions=function(){return this._quotes2},at.prototype.addSubscription=function(t,e,i){if(this.getSubscription(t.id))return;let n={s:t,rics:{}};this._subs[t.id]=n,this._quotes2||(t.onNewRow(this._onInsert),t.onUpdate(this._onUpdate),t.onRemoveRow(this._onDelete)),e&&(n.primary=e,i||(i={}),this._onInsert(t,e,i))},at.prototype.removeSubscription=function(t){let e=t.id;if(!t||!this._subs[e])return;this._quotes2||t.stop();let i=this._subs[e].rics;for(let t in i)this.setRowData(e+t,null);delete this._subs[e]},at.prototype.startAllSubscriptions=function(){if(this._quotes2)this._quotes2.start();else for(let t in this._subs)this._subs[t].s.start()},at.prototype.stopAllSubscriptions=function(){if(this._quotes2)this._quotes2.stop();else for(let t in this._subs)this._subs[t].s.stop()},at.prototype.getSubscription=function(t){return this._subs[t]?this._subs[t].s:null},at.prototype.getPrimaryRic=function(t){let e=this._subs[t];return e?e.primary:""},at.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})},at.prototype.clearColumnData=function(t,e){let i="string"==typeof t?[t]:t;for(let t=i.length;--t>=0;){let e=i[t];if(e)for(let t in this._rows)delete this._rows[t][e]}e||this._dispatchDataChange({globalChange:!0})},at.prototype.getData=function(t,e){let i=this.getRowData(t);return i?i[e]:null},at.prototype.getAllRics=function(){let t={};for(let e in this._subs){let i=this._subs[e].rics;for(let n in i)t[n]||(t[n]=[]),t[n].push(e)}return t},at.prototype.getAllRowIds=function(){let t=[];for(let e in this._rows)t.push(e);return t},at.prototype.hasRowId=function(t){return!!this._rows[t]},at.prototype.getColumnData=function(t){let e=[];for(let i in this._rows)e.push(this._rows[i][t]);return e},at.prototype.getRowData=function(t){return this._rows[t]||null},at.prototype.getMultipleRowData=function(t,e,i){let n=t.length;null==i&&(i=n),i>n&&(i=n),e>0||(e=0);let o=new Array(n),r=this._rows;for(let n=e;n<i;++n)o[n]=r[t[n]]||null;return o},at.prototype.getAllRowData=function(){let t=[],e=this._rows;for(let i in e)t.push(e[i]);return t},at.prototype.setData=function(t,e,i){let n={};return n[e]=i,this.setRowData(t,n)},at.prototype.hasDataCloudData=function(t){if(!this._adcFields)return!1;let e=this.getRowData(t);if(!e)return!1;for(let t=this._adcFields.length;--t>=0;){if(null!=e[this._adcFields[t]])return!0}return!1},at.prototype.setRowData=function(t,e,i){let n=this.getRowData(t),o=!1,r=null;if(e)if(n){for(let t in e)n[t]=e[t],o=!0;r=e}else n=e,this._rows[t]=n,o=!0;else n&&(delete this._rows[t],o=!0);if(o&&!this._composing){let e=i||{};e.rid=t,r&&(e.changes=r),e.rowData=n,this._dispatchDataChange(e)}return o},at.prototype.cloneRowData=function(t){let e=this._rows[t];if(!e)return null;let i={};for(let t in e)0!==t.indexOf("FREE_TEXT")&&(i[t]=e[t]);return i},at.prototype.addStaticFields=function(t){if(Array.isArray(t))for(let e in t)this._staticFields[t[e]]?this._staticFields[t[e]]++:this._staticFields[t[e]]=1},at.prototype.removeStaticFields=function(t){if(Array.isArray(t))for(let e in t)this._staticFields[t[e]]&&(this._staticFields[t[e]]--,0===this._staticFields[t[e]]&&delete this._staticFields[t[e]])},at.prototype.resetStaticFields=function(){this._staticFields={}},at.prototype.getStaticFields=function(){return this._staticFields},at.prototype.dump=function(t){return at.constructTable(this.getAllRowData(),t,Object.keys(this._rows))},at.prototype.log=function(t){console.table(this.dump(t))},at.prototype.setDataCloudSettings=function(t,e,i,n){null!=t&&(this._userId=t),null!=e&&(this._productId=e),null!=i&&(this._adcUrl=i),n&&(this._lang=n)},at.prototype.getDataCloudFields=function(){return this._adcFields},at.prototype.addDataCloudFields=function(t){this._adcFields||(this._adcFields=[],this._adcRefMap={});let e=[];if(t instanceof Array)for(let i=t.length;--i>=0;)this._addDataCloudField(t[i],e);else this._addDataCloudField(t,e);if(e.length<=0)return!1;let i=this.getAllRics();return this._batchRequestDataCloud(i,e),!0},at.prototype.removeDataCloudField=function(t){if(!this._adcFields)return!1;if(!this._adcRefMap[t])return!1;if(--this._adcRefMap[t],!this._adcRefMap[t]){let e=this._adcFields.indexOf(t);this._adcFields.splice(e,1),this.clearColumnData(t)}return!0},at.prototype._dispatchDataChange=function(t){this._composing||(this._composing=!0,this._dispatch("dataComposed",t),this._composing=!1,this._dispatch("dataChanged",t))},at._defaultPropertyGetter=function(t,e,i){let n=e[i];return n?n[t]:null},at._defaultGetter=function(t,e){return t[e]},at.constructTable=function(t,e,i){let n=0,o=t.length,r=o,s=null,l=i||null,a=at._defaultGetter,u=!1;if(e){if(e.rowCount&&(r=e.rowCount,u=!0),e.colNames){s={};let t=e.colNames.length;for(let i=0;i<t;++i)s[e.colNames[i]]=!0;u=!0}e.getter&&(a="string"==typeof e.getter?at._defaultPropertyGetter.bind(null,e.getter):e.getter,u=!0),e.startIndex&&(n=e.startIndex,u=!0),!1===e.withRowIds&&(l=null)}if(!u&&!l)return t;let h=[];for(let e=n;e<o&&!(h.length>=r);++e){let i=t[e],n=l?{rid:l[e]}:{};if(i){let t;if(s)for(t in s)null!=i[t]&&(n[t]=a(i,t));else for(t in i)n[t]=a(i,t)}h.push(n)}return h},at.prototype._insertRic=function(t,e,i){let n=t+(e=e.replace("0#",""));this._onADCForNewRic(t,e);let o=this.getRowData(n);if(o){let e=o.ROW_DEF;e&&e.isChain()&&(i.SUB_ID=t)}else{let n=i;i={};for(let t in n)i[t]=n[t];i.SUB_ID=t,i.RIC=e}this.setRowData(n,i)},at.prototype._onQ2DataChanged=function(t){let e=t.subId,i=t.ric,n=t.values;n?this._insertRic(e,i,n):(delete this._subs[e].rics[i],this.setRowData(e+i,null))},at.prototype._onQ2SubAdded=function(t){let e=t.subs,i=t.duplicateSubIds,n=e.length;for(let t=0;t<n;++t){let n=e[t],o=n.ric;if(!(n.id.indexOf("_ci_")>=0)&&(this.addSubscription(n,o),i)){let e=i[t];e&&window.setTimeout(this._onDuplicateRic.bind(this,n.id,this.getRowData(e+o)),10)}}},at.prototype._onQ2SubRemoved=function(t){let e=t.subs,i=e.length;for(let t=0;t<i;++t){let i=e[t];i.id.indexOf("_ci_")>=0||this.removeSubscription(i)}},at.prototype._onADCForNewRic=function(t,e){let 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)},at.prototype._onDuplicateRic=function(t,e){let i=this._subs[t];if(!i)return;i=i.s;let n=i.ric,o=e.SUB_ID,r=this._cloneRowData(e,n,t);if(!r)return;this._onInsert(i,n,r);let s=i.children;if(s){let e=s.length;for(let l=0;l<e;++l)n=s[l],r=this._cloneRowData(o,n,t),this._onInsert(i,n,r)}},at.prototype._onInsert=function(t,e,i){let n=t.id;this._quotes2?this._insertRic(n,e,i):(this._onADCForNewRic(n,e),this.setRowData(n+e,i,{subscription:t,ric:e}))},at.prototype._onUpdate=at.prototype._onInsert,at.prototype._onDelete=function(t,e,i){delete this._subs[t.id].rics[e],this.setRowData(t.id+e,null,{subscription:t,ric:e})},at.prototype._addDataCloudField=function(t,e){this._adcRefMap[t]?++this._adcRefMap[t]:(this._adcFields.push(t),e.push(t),this._adcRefMap[t]=1)},at.prototype._onADCUpdate=function(t){let e=t.currentTarget,n=null;try{n=JSON.parse(e.responseText)}catch(t){return}if("Ok"!==n.status)return;let o=n.cols,r=n.rows,s=r[0],l=-1,a={};for(let t=0;t<o;++t){let e=s[t];"instrument"===e.i?l=t:e.r&&(a[e.r]=t)}let u=r.length;for(let t=1;t<u;++t){let n=r[t],o=n[l],s={};for(let t in a){let e=n[a[t]];null!=e&&null!==e&&null==e.f&&(this._quotes2?(s[t]=e,s[t+"_FORMATTED"]=e):s[t]={formatted:e+"",raw:e})}let u=e.ricMap[o];if(u)for(i=u.length;--i>=0;){let t=u[i];this._subs[t]&&this.setRowData(t+o,s)}}},at.prototype._onADCError=function(t){window.console.log(t)},at.prototype._onBatchRequestADCData=function(t){this._adcTimerId<=0||(this._adcTimerId=-1,this._batchRequestDataCloud(this._adcRicMap,this._adcFields),this._adcRicMap=null)},at.prototype._batchRequestDataCloud=function(t,e){if(!this._adcUrl)return null;let i=[];for(let e in t)i.push(e);for(;i.length>30;)this._requestDataCloud(t,e,i.splice(0,30));return this._requestDataCloud(t,e,i)},at.prototype._requestDataCloud=function(t,e,i){if(!i||i.length<=0)return null;if(!e||e.length<=0)return null;let n=new XMLHttpRequest;n.onload=this._onADCUpdate,n.onerror=this._onADCError,n.ricMap=t,n.open("POST",this._adcUrl,!0),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded");let o="formula="+e+"&identifiers="+i;return this._productId&&(o+="&productid="+this._productId),this._userId&&(o+="&uuid="+this._userId),this._lang&&(o+="&lang="+this._lang),n.send(o),n},at.prototype._cloneRowData=function(t,e,i){let n="string"==typeof t?t:t.SUB_ID,o=this._rows[n+e];if(!o){if("object"!=typeof t)return null;o=t}let r={};for(let t in o)null==this._staticFields[t]&&(r[t]=o[t]);return r.SUB_ID=i,r},at.prototype._rows,at.prototype._subs,at.prototype._quotes2=null,at.prototype._staticFields=null,at.prototype._adcFields=null,at.prototype._adcRefMap=null,at.prototype._adcTimerId=-1,at.prototype._adcRicMap=null,at.prototype._adcUrl="/datacloud/rest/select",at.prototype._userId="",at.prototype._productId="",at.prototype._composing=!1,at.prototype._lang="",at._proto=at.prototype;var ut=at;let ht=function(t,e){this._rid=t,this._children={},this._shared=e};l.inherits(ht,u),ht._subSegSortLogic=function(t,e){return"Uncategorized"===t?1:"Uncategorized"===e||t<e?-1:e<t?1:0},ht._assignSubSegmentOrder=function(t,e){t.setOrder(e+1)},ht.prototype._shared=null,ht.prototype._rid,ht.prototype._children,ht.prototype._childCount=0,ht.prototype._collapsed=!1,ht.prototype._order=0,ht.prototype._disposed=!1,ht.prototype._subSegDef=null,ht.prototype._subSegLevel=0,ht.prototype._subSegMap=null,ht.prototype._subSegNames=null,ht.prototype._subSegName="",ht.prototype._subSegVal,ht.prototype._subSegParent=null,ht.prototype.dispose=function(){if(this._disposed)return;this._disposed=!0,this.removeAllEventListeners();let t=this._subSegNames;if(t){let e=t.length,i=this._subSegMap;for(let n=0;n<e;++n)i[t[n]].dispose();this._subSegMap=this._subSegNames=null}this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._shared=null,this._subSegParent=this._subSegDef=this._subSegVal=null},ht.prototype.getId=function(){return this._rid},ht.prototype.getParentId=function(){return this._subSegParent?this._subSegParent.getId():""},ht.prototype.getSubSegmentIds=function(t){let e=this._subSegNames;if(e){t||(t=[]);let i=e.length,n=this._subSegMap;for(let o=0;o<i;++o){let i=n[e[o]];t.push(i.getId()),i.getSubSegmentIds(t)}return t}return null},ht.prototype.addChild=function(t,e){if(t){if(this._shared.childToSegment[t]=this._rid,!this._children[t])return this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._children[t]=e||t,++this._childCount,!0;this._children[t]=e||t}return!1},ht.prototype.addChildren=function(t,e){let i,n=Array.isArray(t)?t:[t],o=n.length,r=0;if(null!=e)for(e=Array.isArray(e)?e:[e],i=0;i<o;++i)r|=this.addChild(n[i],e[i]);else for(i=0;i<o;++i)r|=this.addChild(n[i]);return!!r},ht.prototype.containsChild=function(t){return!!this._children[t]},ht.prototype.removeChild=function(t){if(this._subSegLevel)return!1;if(!this._childCount)return!1;if(!this._children[t])return!1;return delete this._shared.childToSegment[t],delete this._children[t],--this._childCount,this._collapsed&&(this._shared.dirtyCollapsingState=!0),!0},ht.prototype.removeChildren=function(t){if(this._subSegLevel)return!1;if(!this._childCount)return!1;let e=Array.isArray(t)?t:[t],i=e.length,n=0;for(let t=0;t<i;++t)n|=this.removeChild(e[t]);return!!n},ht.prototype.removeAllChildren=function(){if(this._subSegLevel)return!1;if(!this._childCount)return!1;let t=this._shared.childToSegment,e=this._children;for(let i in e)t[i]&&delete t[i];return this._children={},this._childCount=0,this._collapsed&&(this._shared.dirtyCollapsingState=!0),!0},ht.prototype.getChildIds=function(){return this._childCount?Object.keys(this._children):[]},ht.prototype.getChildren=function(){return this._children},ht.prototype.getChildCount=function(){return this._childCount},ht.prototype.getClassification=function(){return this._subSegDef&&this._subSegDef.classifiers||null},ht.prototype.setClassification=function(t){if(this._subSegLevel)return!1;let e=null;this._subSegDef&&(e=this._subSegDef.classifiers);let i,n=null;t&&("string"==typeof t?n=[t]:Array.isArray(t)&&(n=t));let o=n?n.length:0;if(o){if((e?e.length:0)===o){for(i=0;i<o&&n[i]===e[i];++i);if(i>=o)return!1}return this._subSegDef||(this._subSegDef={root:this,subSegments:null}),this._subSegDef.classifiers=n,!0}return!!e&&(this._subSegDef.classifiers=null,this._subSegDef.subSegments=null,this._subSegDef=null,!0)},ht.prototype.classify=function(t){let e=this._subSegDef?this._subSegDef.classifiers:null,i=e?e.length:0,n=this._subSegNames,o=n?n.length:0;if(!o&&this._subSegLevel>=i)return!1;let r,s=this._shared;this._collapsed&&(s.dirtyCollapsingState=!0);let l="",a={},u=0,h=this._subSegMap,p=null;if(o)for(u=o,r=0;r<u;++r)l=n[r],a[l]=1,p=h[l],p._childCount&&(p._children={},p._childCount=0),p._collapsed&&(s.dirtyCollapsingState=!0);let d,c=!this._subSegLevel,_=this._children;if(this._subSegLevel<i&&t){h||(h=this._subSegMap={},n=this._subSegNames=[]);let i=e[this._subSegLevel];for(d in _){let e=_[d],o=t[e],r=o?o[i]:null;s.childToSegment[d]=this._rid,l="Uncategorized",(r||0===r||!1===r)&&(l=r+""),a[l]&&(a[l]=0,--u),p=h[l],p||(p=new ht(this._rid+"/"+l,s),p._subSegDef=this._subSegDef,p._subSegLevel=this._subSegLevel+1,p._subSegName=l,p._subSegVal=r,p._subSegParent=this,h[l]=p,n.push(l),this._dispatch("subSegmentAdded",{rid:p.getId(),segment:p})),p.addChild(d,e)}}else if(c)for(d in _)s.childToSegment[d]=this._rid;if(u>0){for(l in u>=n.length&&(n.length=0),a)if(a[l]){p=h[l],delete h[l];let t=n.indexOf(l);t>=0&&n.splice(t,1),this._dispatch("subSegmentRemoved",{rid:p.getId(),segment:p})}n.length||(n=this._subSegMap=this._subSegNames=null)}if(o=n?n.length:0,o)for(n.sort(ht._subSegSortLogic),r=0;r<o;++r)p=h[n[r]],p.classify(t);if(c&&this._subSegDef)if(o){let t=this._subSegDef.subSegments=[];this.getAllSubSegments(t),t.forEach(ht._assignSubSegmentOrder)}else this._subSegDef.subSegments=null;return!0},ht.prototype.hasSubSegments=function(){return!!this._subSegNames&&!!this._subSegNames.length},ht.prototype.isSubSegment=function(){return!!this._subSegLevel},ht.prototype.getFirstAncestor=function(){if(this._subSegLevel&&this._subSegDef){return this._subSegDef.root||null}return null},ht.prototype.getAllSubSegments=function(t){let e=this._subSegNames;if(e){t||(t=[]);let i=this._subSegMap,n=e.length;for(let o=0;o<n;++o){let n=i[e[o]];t.push(n),n.getAllSubSegments(t)}}return t||null},ht.prototype.getSegmentLevel=function(){return this._subSegLevel},ht.prototype.setRowData=function(t,e){if(!t)return;let i=t[this._rid];i||(i=t[this._rid]={}),e||(e=t),i=e[this._rid],i||(i=e[this._rid]={});let n=this;for(;n&&n.isSubSegment();)n.getSubSegmentName(i),n=n._subSegParent},ht.prototype.getSubSegmentName=function(t){if(t&&this._subSegLevel){let e=this.getClassification()[this._subSegLevel-1];e&&(t[e]=this._subSegName)}return this._subSegName},ht.prototype.collapse=function(t){return t=!1!==t,this._collapsed!==t&&(this._collapsed=t,this._shared.dirtyCollapsingState=!0,!0)},ht.prototype.expand=function(t){return this.collapse(!1===t)},ht.prototype.isCollapsed=function(){return this._collapsed},ht.prototype.getCollapsingStates=function(t,e){let i=this._subSegNames;if(!this._subSegLevel&&!i&&!this._collapsed)return!1;t||(t={});let n=!1;if(this._subSegLevel&&e&&(t[this._rid]=!0,n=!0),this._childCount){let o=e||this._collapsed;if(i){let r=this._subSegMap,s=i.length;for(let l=0;l<s;++l){let s=r[i[l]];t[s.getId()]=!!e,s.getCollapsingStates(t,o)&&(n=!0)}}else if(o){let e=this._children;for(let i in e)t[i]=o;n=!0}}return n},ht.prototype.getOrder=function(){if(this._subSegLevel){let t=this.getFirstAncestor();if(t)return t.getOrder()+this._order}return 1e4*this._order},ht.prototype.getLastOrder=function(){if(this._subSegDef){let t=this._subSegDef.subSegments;if(t){let e=t[t.length-1];if(e)return e.getOrder()}}return this.getOrder()},ht.prototype.setOrder=function(t){this._order=t},ht._tabs=null,ht.prototype.log=function(t){let e,i=ht._tabs;if(!i){i=ht._tabs=[];let t="";for(e=0;e<11;++e)i[e]=t,t+=" "}let n=this._collapsed?"+ ":"- ";t.push(i[this._subSegLevel]+n+this._rid);let o=this._subSegNames;if(o){let i=o.length,n=this._subSegMap;for(e=0;e<i;++e)n[o[e]].log(t)}else if(this._childCount){let e=i[this._subSegLevel+1];for(let i in this._children)t.push(e+"- "+i)}return t};var pt=ht;let dt=function(){this._onSubSegmentAdded=this._onSubSegmentAdded.bind(this),this._onSubSegmentRemoved=this._onSubSegmentRemoved.bind(this),this._segments={},this._insertionList=[],this._removalList=[],this._shared={childToSegment:{},dirtyCollapsingState:!1}};l.inherits(dt,u),dt.prototype._segments,dt.prototype._segmentCount=0,dt.prototype._collapsedRids=null,dt.prototype._shared,dt.prototype._segmentList=null,dt.prototype._insertionList=null,dt.prototype._removalList=null,dt.prototype._classification=!1,dt.prototype._classifierChanged=!1,dt.prototype.dispose=function(){this.removeAllSegments(),this.removeAllEventListeners(),this._collapsedRids=null,this._segmentList=this._insertionList=this._removalList=null},dt.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;let i=this._segments[t]=new pt(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},dt.prototype.addSegments=function(t){let e=Array.isArray(t)?t:[t],i=e.length,n=0;for(let t=0;t<i;++t)n|=this.addSegment(e[t]);return!!n},dt.prototype.containsSegment=function(t){return!!this._segments[t]},dt.prototype.getParentRowId=function(t){return this._shared.childToSegment[t]||""},dt.prototype.removeSegment=function(t){let e=this._segments[t];if(e){if(this._segmentCount<=1)return this.removeAllSegments();e.isSubSegment()&&this._removalList.push(e.getId());let i=e.getSubSegmentIds();if(i){let t=i.length;for(let e=0;e<t;++e){let t=i[e];this._segments[t]&&(this._removalList.push(t),delete this._segments[t],--this._segmentCount)}}return e.removeAllChildren(),e.dispose(),delete this._segments[t],--this._segmentCount,!0}return!1},dt.prototype.removeAllSegments=function(){if(this._segmentCount){for(let 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},dt.prototype.getSegmentCount=function(){return this._segmentCount},dt.prototype.getSegment=function(t){return this._segments[t]||null},dt.prototype.getSegmentParent=function(t){let e=this.getParentRowId(t);return e?this.getSegment(e):null},dt.prototype.getSegments=function(){return this._segmentCount?this._segments:null},dt.prototype.getSegmentIds=function(){return Object.keys(this._segments)},dt.prototype.collapseSegment=function(t,e){let i=this._segments[t];return!!i&&i.collapse(e)},dt.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},dt.prototype.expandAllSegments=function(){if(this._segmentCount){let t=this._segments,e=0;for(let i in t)e|=t[i].expand();if(e)return!0}return!1},dt.prototype.isCollapsedSegment=function(t){let e=this._segments[t];return!!e&&e.isCollapsed()},dt.prototype.getCollapsedRows=function(){if(this._shared.dirtyCollapsingState){this._shared.dirtyCollapsingState=!1;let t=null,e=0;if(this._segmentCount){let i=this._segments;t={};for(let n in i){let o=i[n];o.isSubSegment()||o.getCollapsingStates(t)&&++e}}this._collapsedRids=e?t:null}return this._collapsedRids},dt.prototype.addSegmentChild=function(t,e,i){let n=this._segments[t];return!(!n||n.isSubSegment())&&n.addChild(e,i)},dt.prototype.addSegmentChildren=function(t,e,i){let n=this._segments[t];return!(!n||n.isSubSegment())&&n.addChildren(e,i)},dt.prototype.containsSegmentChild=function(t,e){let i=this._segments[t];return!!i&&i.containsChild(e)},dt.prototype.removeSegmentChild=function(t,e){let i=this._segments[t];return!!i&&i.removeChild(e)},dt.prototype.removeSegmentChildren=function(t,e){let i=this._segments[t];return!!i&&i.removeChildren(e)},dt.prototype.removeAllSegmentChildren=function(){this._shared.childToSegment={};let t=this._segments,e=!1;for(let i in t){t[i].removeAllChildren()&&(e=!0)}return e&&this.classify(null),e},dt.prototype.fillSegment=function(t,e){let i=Array.isArray(e)?e.length:0;if(!i)return;let n=this._segments,o=n[t];if(o&&!o.isSubSegment()){let r=e.indexOf(t);if(r>=0){o.removeAllChildren();for(let t=r+1;t<i;++t){let i=e[t];if(n[i])break;o.addChild(i)}}}},dt.prototype.fillSegments=function(t){this._shared.childToSegment={};let e=Array.isArray(t)?t.length:0,i=this._segments,n=null,o=!1;for(let r=0;r<e;++r){let e=t[r],s=i[e];s&&!s.isSubSegment()?(n=s,n.removeAllChildren()):n&&!n.isSubSegment()&&(n.addChild(e),o=!0)}return o},dt.prototype.calcSegmentOrder=function(t){let e=this._segmentList;e?e.length=0:e=this._segmentList=[];let i=t?t.length:0,n=this._segments,o=this._segmentCount,r=0;for(let e=0;e<i;++e){let i=n[t[e]];if(i&&(i.isSubSegment()||(this._segmentList.push(i),i.setOrder(++r)),--o<=0))break}},dt.prototype.getSegmentValues=function(t,e){let i=t?t.length:0;if(!i)return null;let n=this._segments,o=this._shared.childToSegment,r=null,s=null,l=new Array(i),a=0,u=-10,h=0;for(let p=0;p<i;++p){let i=t[p];if(r=n[i],r)a=100*r.getOrder(),h=0,r.isSubSegment()||s!==r&&(s=r,u=100*r.getLastOrder());else{let t=o[i];t?(r=n[t],a=100*r.getOrder(),h=1,e&&(u=100*r.getLastOrder())):u?(a=u,h=10):a=h=0}l[p]=a+h}return s?l:null},dt.prototype.logStructure=function(){let t=this._segmentList;if(!t)return"";let e=t.length,i=[];for(let n=0;n<e;++n)t[n].log(i);return i.join("\n")},dt.prototype.logRowIdMap=function(){let t=[],e=this._shared.childToSegment;for(let i in e){let n=e[i];t.push(i+" > "+n)}return t.join("\n")},dt.prototype.setSegmentClassification=function(t,e){let i=this._segments[t];return!(!i||!i.setClassification(e))&&(i.getClassification()&&(this._classification=!0),this._classifierChanged=!0,!0)},dt.prototype.hasClassification=function(){return this._classification||this._classifierChanged},dt.prototype.classify=function(t){if(!this._segmentCount)return!1;if(!this.hasClassification())return!1;this._classification=this._classifierChanged=!1;let e=this._segments;for(let i in e){let e=this._segments[i];e.isSubSegment()||(e.getClassification()&&(this._classification=!0),e.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)},dt.prototype._onSubSegmentAdded=function(t){let e=t.rid;if(this._segments[e])console.log("Incorrect logic detected.");else{let i=t.segment;this._insertionList.push(i),this._segments[e]=i,this._segmentCount++,i.addEventListener("subSegmentAdded",this._onSubSegmentAdded),i.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved)}},dt.prototype._onSubSegmentRemoved=function(t){let e=t.rid;this.removeSegment(e)};var ct=dt;let _t=function(){_t.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")};l.inherits(_t,ut),_t.prototype._prevData=null,_t.prototype._rids,_t.prototype._frozen=!1,_t.prototype._runningId=0,_t.prototype._compMap=null,_t.prototype._segments=null,_t.prototype._autoSegmentFilling=!1,_t.prototype._removedRows=null,_t.prototype._userSegmentComparer=null,_t.prototype._segmentSortOrder=0,_t.prototype._segmentSortContext=null,_t.prototype._clsSource=null,_t.prototype._classifyingTimer=0,_t.SortLogic,_t.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._classifyingTimer&&(clearTimeout(this._classifyingTimer),this._classifyingTimer=0),this._compMap=null,this._clsSource=null,_t._removeIndexArray(),this._segments&&(this._segments.dispose(),this._segments=null)},_t.prototype.getColumnData=function(t){let e=new Array(this._rids.length);for(let i=this._rids.length;--i>=0;)e[i]=this._rows[this._rids[i]][t];return e},_t.prototype.getRowId=function(t){return this._rids[t]||""},_t.prototype.getAllRowIds=function(t){return t?this._rids:this._rids.slice(0)},_t.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},_t.prototype.getRowCount=function(){return this._rids.length},_t.prototype.getDataAt=function(t,e){return this.getData(this._rids[t],e)},_t.prototype.getRowDataAt=function(t){return this.getRowData(this._rids[t])},_t.prototype.getPreviousData=function(t,e){let i=this._prevData[t]||null;return i?i[e]:null},_t.prototype.setData=function(t,e,i){if(!this._needFiring())return this._setData(t,e,i);let n={};return n[e]=i,this.setRowData(t,n)},_t.prototype._removeRidFromSegments=function(t){if(this._segments){if(this._segments.getSegment(t)){if(this._segments.removeSegment(t))return this._segments.getSegmentCount()||(this._segments.dispose(),this._segments=null),!0}else{let e=this._segments.getParentRowId(t);e&&this._segments.removeSegmentChild(e,t)}}return!1},_t.prototype.setRowData=function(t,e,i){if(!t)return!1;let n=this.getRowData(t),o=!1,r="updated",s=!1;if(e){if(n){let i=this._prevData[t];for(let t in e)i[t]=n[t],n[t]=e[t]}else if(r="inserted",n=e,this._rows[t]=n,this._prevData[t]={},i){let e=i.nextRid,n=e?this.getRowIndex(e):-1;n<0&&(n=i.fallback),null==n||n<0||n>=this._rids.length?this._rids.push(t):(this._rids.splice(n,0,t),s=!this._isLastSegment(n))}else this._rids.push(t);o=!0}else n&&(r="removed",this._prevData[t]=this._rows[t],delete this._rows[t],s=this._removeRidFromSegments(t),_t._removeArrayItem(this._rids,t),o=!0);if(o&&this._needFiring()){if(this._autoFillSegments())this.dispatchGlobalChange();else{let o=i||{};o.rid=t,o.changes=e,o.rowData=n,o.type=r,s&&(o.segmentChanged=!0),this._dispatchDataChange(o)}this.requestClassifying()}return o},_t.prototype.setColumnData=function(t,e,i){let n=e?e.length:0;if(n<0)return;let o=this._frozen;this.freeze();let r=this._generateRids(n,i);for(let i=0;i<n;++i)this._setData(r[i],t,e[i]);this.freeze(o)},_t.prototype.setDataFromObjectMap=function(t){if(!t)return;if(Array.isArray(t))return void this.addRows(t);let e=this._frozen;this.freeze();for(let e in t)this.setRowData(e,t[e]);this.freeze(e)},_t.prototype.setDataFrom2DArray=function(t,e,i){let n=t?t.length:0;if(n<0)return;let o=this._frozen;this.freeze();let r=0,s=this._generateRids(n,i);for(let i=0;i<n;++i){let n=t[i],o=s[i];if(e)for(r=n.length;--r>=0;)this._setData(o,e[r],n[r]);else for(r=n.length;--r>=0;)this._setData(o,""+r,n[r])}this.freeze(o)},_t.prototype.setDataAt=function(t,e,i){let n=this.getRowId(t);return!!n&&this.setData(n,e,i)},_t.prototype.setRowDataAt=function(t,e,i){let n=this.getRowId(t);return!!n&&this.setRowData(n,e,i)},_t.prototype.addRow=function(t,e){return t||(t={}),e=this._generateUniqueRid(t,e),this.setRowData(e,t),e},_t.prototype.addRows=function(t,e){if(!Array.isArray(t))return;let i=t.length;if(!i)return;if(1===i)return void this.addRow(t[0],e?e[0]:null);e||(e=[]);let n=this._frozen;this.freeze();for(let n=0;n<i;++n)this.addRow(t[n],e[n]);this.freeze(n)},_t.prototype.unshiftRow=function(t,e){return this.insertRow(0,t,e)},_t.prototype.insertRow=function(t,e,i){let n=null;return"number"==typeof t?(n={},n.nextRid=this._rids[t],n.fallback=t):t&&(n={},n.nextRid=t),e||(e={}),i=this._generateUniqueRid(e,i),this.setRowData(i,e,n),i},_t.prototype.insertAfter=function(t,e,i){let n="string"==typeof t?this.getRowIndex(t):t;return!(n>=0)||n>=this._rids.length-1?this.addRow(e,i):this.insertRow(n+1,e,i)},_t.prototype.removeRow=function(t){"number"==typeof t?this.setRowData(this.getRowId(t),null):this.setRowData(t,null)},_t.prototype.removeRows=function(t){let e,i;if(1===t.length)return e=t[0],void("number"==typeof e?this.removeRow(e):this.setRowData(e,null));let n=!1;for(this._removedRows={},i=t.length;--i>=0;){e=t[i],"number"==typeof e&&(e=this.getRowId(e)),this.getRowData(e)&&(this._prevData[e]=this._rows[e],this._removedRows[e]=1,delete this._rows[e],this._removeRidFromSegments(e),n=!0)}n?(this._rids=this._rids.filter(this._removeRows),this._removedRows=null,this.dispatchGlobalChange()):this._removedRows=null},_t.prototype._removeRows=function(t){return!this._removedRows[t]},_t._removeArrayItem=function(t,e){let i=t.indexOf(e);return i>=0&&(i>=t.length?t.pop():t.splice(i,1),!0)},_t.prototype.clearAllData=function(t){_t.base(this,"clearAllData",!0),this._prevData={},this._segments&&(this._segments.dispose(),this._segments=null),this._rids.length&&(this._rids.length=0,this.dispatchGlobalChange(t))},_t.prototype.removeAllRows=_t.prototype.clearAllData,_t._ascendingOrder=function(t,e){return t-e},_t.prototype.moveRow=function(t,e,i){let n=null,o="";if(e>=0&&e<this._rids.length||(e=this._rids.length),Array.isArray(t)){let i=t;i.sort(_t._ascendingOrder);let r=[];for(let t=i.length;--t>=0;){let n=i[t];o=this._rids[n],o&&(r.unshift(o),this._rids.splice(n,1),n<e&&--e)}r.length&&(this._rids.splice.apply(this._rids,[e,0].concat(r)),n=r)}else t<0&&(t=0),t!==e&&t+1!==e&&(o=this._rids.splice(t,1)[0],o&&(t<e&&--e,this._rids.splice(e,0,o),n=o));return n&&(this._segments&&(this._segments.calcSegmentOrder(this._rids),this._sort(null)),this._dispatchPositionChange(i)),n},_t.prototype._moveRow=function(t,e,i){let n=t.length;if(!n)return null;let o=new Array(n);for(let e=0;e<n;++e)o[e]=this.getRowIndex(t[e]);let r=e?this.getRowIndex(e):this._rids.length;return n>1?this.moveRow(o,r,i):this.moveRow(o[0],r,i)},_t.prototype.moveRows=function(t,e,i,n){"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);let o=t+i-1,r=e;if(e>=t&&(r=e<=o?t:e-i),i>0&&o<=this._rids.length){r>this._rids.length&&(r=this._rids.length);let e=this._rids.splice(t,i),o=[r,0].concat(e);return Array.prototype.splice.apply(this._rids,o),this._segments&&this._sort(null),this._dispatchPositionChange(n),e}return null},_t.prototype.swapRow=function(t,e){let i=this._rids.length;if(t<0||t>=i)return;if(e<0||e>=i)return;let n=this._rids[t];this._rids[t]=this._rids[e],this._rids[e]=n},_t.prototype.clearRowData=_t.prototype.removeRow,_t.prototype.clearColumnData=function(t,e){let i="string"==typeof t?[t]:t;for(let t=i.length;--t>=0;){let e=i[t];if(e)for(let t in this._rows)delete this._rows[t][e],delete this._prevData[t][e]}this.dispatchGlobalChange(e)},_t.prototype.getDataSource=function(){return null},_t.prototype.setDataSource=function(t){},_t.prototype.getSortingLogics=function(){return this._compMap},_t.prototype.sortOnce=function(t,e,i,n){let o=_t._buildSortContext([],t,e,i||this._compMap,n);return!!this._sort(o)&&(this._dispatchPositionChange(),!0)},_t.prototype.setSortingLogic=function(t){this._compMap._default=t},_t.prototype.setColumnSortingLogic=function(t,e){t&&(this._compMap[t]=e)},_t.prototype.getColumnSortingLogic=function(t){if(t){let e=this._compMap[t];if(e)return e}return this._compMap._default||null},_t.prototype.freeze=function(t){t=!1!==t;let e=this._frozen;return e!==t&&(this._frozen=t,this._autoFillSegments(),this.dispatchGlobalChange()),e},_t.prototype.unfreeze=function(t){return this.freeze(!1===t)},_t.prototype.isFrozen=function(){return this._frozen},_t.prototype.setSegmentSeparator=function(t,e){let i=!1,n=0;if(t&&"string"==typeof t)if(!1!==e){if(this._segments||(this._segments=new ct,this._segments.addEventListener("subSegmentChanged",this._onSubSegmentChanged)),this._autoSegmentFilling){let e=this._segments.getParentRowId(t);e&&this._segments.removeSegmentChild(e,t)}this._segments.addSegment(t)&&(this._segments.calcSegmentOrder(this._rids),i=!0)}else if(this._segments){let e=this._segments.getSegment(t);e&&(n=e.getChildCount(),this._segments.removeSegment(t)&&(i=!0,this._segments.getSegmentCount()||(this._segments=null)))}if(i&&this._needFiring())if(this._autoFillSegments()||n)this.dispatchGlobalChange();else{let e=this._rows[t]||null;e&&this._dispatchDataChange({rid:t,changes:{},rowData:e,type:"updated",segmentChanged:!0})}return i},_t.prototype.unsetAllSegmentSeparators=function(){return!!this._segments&&(this._segments.dispose(),this._segments=null,this.dispatchGlobalChange(),!0)},_t.prototype.hasSegmentation=function(){return!!this._segments},_t.prototype.isSegmentSeparator=function(t){return!!this._segments&&this._segments.containsSegment(t)},_t.prototype.getSegment=function(t){return this._segments?this._segments.getSegment(t):null},_t.prototype.getSegmentParent=function(t){return this._segments?this._segments.getSegmentParent(t):null},_t.prototype.getSegmentLevel=function(t){let e=this.getSegment(t);return e?e.getSegmentLevel()+1:0},_t.prototype.getSegmentParentRowId=function(t){return this._segments?this._segments.getParentRowId(t):""},_t.prototype.getSegmentValues=function(t,e){return this._segments?this._segments.getSegmentValues(t||this._rids,e):null},_t.prototype._isLastSegment=function(t){let e=this._segments;if(e){let i=this._rids,n=i.length;for(let o=t+1;o<n;++o)if(e.containsSegment(i[o]))return!1}return!0},_t.prototype._getSegmentSeparators=function(){return this._segments},_t.prototype.enableAutoSegmentFilling=function(t){this._autoSegmentFilling=0!=t,this._autoFillSegments()},_t.prototype._autoFillSegments=function(){return!!this._autoSegmentFilling&&this.fillSegments()},_t.prototype.fillSegment=function(t){this._segments&&(this._segments.fillSegment(t,this._rids),this.dispatchGlobalChange(),this.requestClassifying())},_t.prototype.fillSegments=function(){if(this._segments){let t=this._segments.fillSegments(this._rids);return t&&(this.dispatchGlobalChange(),this.requestClassifying()),t}return!1},_t.prototype.addSegmentChild=function(t,e,i){if(this._segments){if(this._segments.addSegmentChild(t,e,i))return this._sort(null),this._dispatchPositionChange(),this.requestClassifying(),!0}return!1},_t.prototype.addSegmentChildren=function(t,e,i){if(this._segments){if(this._segments.addSegmentChildren(t,e,i))return this._sort(null),this._dispatchPositionChange(),this.requestClassifying(),!0}return!1},_t.prototype.removeSegmentChild=function(t,e){if(this._segments){let i=this._segments.removeSegmentChild(t,e);return i&&(this.dispatchGlobalChange(),this.requestClassifying()),i}return!1},_t.prototype.removeSegmentChildren=function(t,e){if(this._segments){let i=this._segments.removeSegmentChildren(t,e);return i&&(this.dispatchGlobalChange(),this.requestClassifying()),i}return!1},_t.prototype.removeAllSegmentChildren=function(){if(this._segments){let t=this._segments.removeAllSegmentChildren();return t&&this.dispatchGlobalChange(),t}return!1},_t.prototype.getSegmentIds=function(){return this._segments?this._segments.getSegmentIds():null},_t.prototype.getSegmentChildIds=function(t){if(this._segments){let e=this._segments.getSegment(t);if(e){let t=e.getChildIds();return t.length?t:null}}return null},_t.prototype.sortSeparators=function(t,e,i){let n=!1;if(!this._segments)return!1;if("function"==typeof t)return this.sortSegments(t);let o=_t._buildSortContext([],i,e,t),r=o?o.length:0;if(!r)return n;let s,l,a=0;return r>1?(s=_t._multiColumnSeparatorCompareLogic,l=o,a=1):(s=_t._singleColumnSeparatorCompareLogic,l=o[0],a=l[3]),this._segmentSortOrder=a,this._segmentSortContext=l,n=this.sortSegments(s),this._segmentSortOrder=0,this._segmentSortContext=null,n},_t.prototype.sortSegments=function(t){if(!this._segments)return!1;if("function"!=typeof t)return this._segments.calcSegmentOrder(this._rids),!1;let e,i=this._rids,n=this._segments,o=n.getSegmentCount(),r=[],s=[],l=0,a=i.length,u="",h=null;for(e=0;e<a&&(u=i[e],h=n.getSegment(u),!(h&&(s.push(e),r.push(h),++l>=o)));++e);this._userSegmentComparer=t,r.sort(this._bySegmentSeparator),this._userSegmentComparer=null;let p=!1;for(e=0;e<l;++e){let t=s[e];u=i[t],h=r[e];let n=h.getId();u!==n&&(i[t]=n,p=!0)}return!!p&&(this._segments.calcSegmentOrder(i),this._sort(null),this._dispatchPositionChange(),!0)},_t.prototype._bySegmentSeparator=function(t,e){return this._userSegmentComparer(this.getRowData(t.getId()),this.getRowData(e.getId()),this._segmentSortOrder,this._segmentSortContext)},_t.prototype.setClassificationSource=function(t){this._clsSource=null,t&&t._rows&&(this._clsSource=t._rows)},_t.prototype.setSegmentClassification=function(t,e){if(this._segments){if(this._segments.setSegmentClassification(t,e))return this.classifySegments()}return!1},_t.prototype.classifySegments=function(){return!(!this._segments||!this._rids.length)&&this._segments.classify(this._clsSource||this._rows)},_t.prototype.requestClassifying=function(){this._segments&&!this._classifyingTimer&&this._segments.hasClassification()&&(this._classifyingTimer=setTimeout(this._onClassifyingTimer,10))},_t.prototype._onClassifyingTimer=function(){this._classifyingTimer=0,this.classifySegments()},_t.prototype._onSubSegmentChanged=function(t){let e,i=t.insertionList,n=t.removalList,o=!1,r=this._rows,s=this._clsSource||r,l=this._rids,a=this._prevData,u=n.length,h={};for(e=0;e<u;e++){let t=n[e];r[t]&&(h[t]=a[t]=r[t],delete r[t],_t._removeArrayItem(l,t),o=!0)}let p=i.length;for(e=0;e<p;e++){let t=i[e],n=t.getParentId(),u=t.getId();if(!r[u]){a[u]={},t.setRowData(r,s);let e=l.indexOf(n);e<0||e+1>=l.length?l.push(u):l.splice(e+1,0,u),o=!0}}o&&(t.removedRows=h,this._dispatch("subSegmentChanged",t),this.dispatchGlobalChange())},_t.prototype._sort=function(t){let e=this._rids,i=this.getMultipleRowData(e),n=this.getSegmentValues(e),o=_t._performMultiLevelSorting(i,t,n);return!!o&&(this._rids=_t._reorderItems(e,o),!0)},_t.prototype.dispatchGlobalChange=function(t){!t&&this._needFiring()&&this._dispatchDataChange(_t._globalChangeArg)},_t.prototype._dispatchPositionChange=function(t){!t&&this._needFiring()&&this._dispatch("dataChanged",_t._positionChangeArg)},_t.prototype.dump=function(t){return ut.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},_t.prototype._setData=function(t,e,i){let n=this.getRowData(t);return n||(n={},this._rows[t]=n,this._prevData[t]={},this._rids.push(t)),this._prevData[t][e]=n[e],n[e]=i,!0},_t.prototype._generateRids=function(t,e){let i,n=0;if(e)i=e;else{i=[];let e=this._rids.length;for(;n<e&&n<t;)i.push(this._rids[n++])}for(n=i.length;n<t;)i.push(""+n++);return i},_t.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},_t.prototype._needFiring=function(){return!this._frozen&&!this._composing},_t.getSortingDefinitions=nt._deprecatedFunction,_t._globalChangeArg={globalChange:!0},_t._positionChangeArg={globalChange:!0,positionChangeOnly:!0},_t._buildSortContext=function(t,e,i,n,o){let r,s;Array.isArray(e)?(r=e,s=i):(r=[e],s=e?[i]:[0]);let l=null,a=null;"function"==typeof n?l=n:a=n;let u=r.length;t.length=u;for(let e=u;--e>=0;){Array.isArray(a)&&(l=a[e]);let i=t[e];i||(i=t[e]=new Array(5));let n=r[e];i[0]=n,i[1]=null,i[2]=l||a[n]||a._default,i[2]||(i[2]=_t._defaultComparer),i[3]=_t._getSortOrder(s[e]),i[4]=o}return t},_t._multiColumnCompareLogic=function(t,e,i,n){let o=n.length,r=0;for(let i=0;i<o;++i){let o=n[i];if(r=_t._singleColumnCompareLogic(t,e,o[3],o),r)return r}return r},_t._singleColumnCompareLogic=function(t,e,i,n){let o=n[1];return n[2](o[t],o[e],i,n[4])},_t._multiColumnSeparatorCompareLogic=function(t,e,i,n){let o=n.length,r=0;for(let i=0;i<o;++i){let o=n[i];if(r=_t._singleColumnSeparatorCompareLogic(t,e,o[3],o),r)return r}return r},_t._singleColumnSeparatorCompareLogic=function(t,e,i,n){let o=n[0];return n[2](t[o],e[o],i,n[4])},_t._performMultiLevelSorting=function(t,e,i){let n,o=t?t.length:0,r=e?e.length:0;if(!o)return null;for(let i=0;i<r;++i){let r,s=e[i],l=s[1];if(n=s[2],n.rowSorting)if(l)for(l.length=o,r=0;r<o;++r)l[r]=t[r];else l=s[1]=t;else{l?l.length=o:l=s[1]=new Array(o);let e=s[0];for(r=0;r<o;++r)l[r]=t[r][e]}}if(i){let t=["ROW_SEGMENT",i,_t._segmentComparer,1,null];e?(e=e.slice()).unshift(t):e=[t],++r}if(!r)return null;let s,l=0;return r>1?(n=_t._multiColumnCompareLogic,s=e,l=1):(n=_t._singleColumnCompareLogic,s=e[0],l=s[3]),_t._mergeSort(o,l,n,s)},_t._mergeSort=function(t,e,i,n){let o,r,s,l,a,u=!1,h=1,p=_t._createIndexArray(t),d=p.slice();for(;h<=t;){for(o=a=0;o<t;)if(r=a,l=r+h,s=l,a=s+h,a>t&&(a=t),s<a){for(;;)if(i(p[r],p[s],e,n)<=0){if(d[o++]=p[r],++r>=l){for(;s<a;)d[o++]=p[s],++s;break}}else if(u=!0,d[o++]=p[s],++s>=a){for(;r<l;)d[o++]=p[r],++r;break}}else for(;o<t;)d[o]=p[o],++o;let c=p;p=d,d=c,h<<=1}return u?p:null},_t._reorderItems=function(t,e){if(e){for(let i=t.length;--i>=0;)e[i]=t[e[i]];return e}return t},_t._createIndexArray=function(t){let e=_t._idxAryMap[t];if(!e){_t._idxAryCount>50&&(_t._idxAryMap={},_t._idxAryCount=0),e=_t._idxAryMap[t]=new Array(t),_t._idxAryCount++;for(let i=0;i<t;++i)e[i]=i}return e.slice()},_t._removeIndexArray=function(){_t._idxAryMap={},_t._idxAryCount=0},_t._idxAryMap={},_t._idxAryCount=0,_t._segmentComparer=function(t,e){return t===e?0:t<e?-1:1},_t._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},_t._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},_t._proto=_t.prototype;var ft=_t;const gt="ROW_DEF",yt="CONTENT",mt="CHAIN",Ct="CONSTITUENT",St="GROUP_HEADER",wt="SUBGROUP_HEADER",bt="GROUP_MEMBER";let Rt=function(t){if(this._changes={},t&&t.segmentId)return this._dataId=this._rowId=t.segmentId,this._autoGenerated=!0,void(this._subSegment=!0);this._rowId="_"+Rt._runningId+++"_",this._dataId=this._rowId,t&&(t.asConstituent?this._initializeAsConstituent(t):this.initialize(t))};Rt._runningId=0,Rt._childDataField="CHILD_VALUES",Rt.prototype._userInput="",Rt.prototype._ric="",Rt.prototype._permId="",Rt.prototype._label=null,Rt.prototype._isChain=null,Rt.prototype._asSegment=!1,Rt.prototype._realTime=!0,Rt.prototype._rowId="",Rt.prototype._dataId="",Rt.prototype._userId=!1,Rt.prototype._dc=null,Rt.prototype._view=null,Rt.prototype._subId="",Rt.prototype._expanded=null,Rt.prototype._autoGenerated=!1,Rt.prototype._subSegment=!1,Rt.prototype._staticValues=null,Rt.prototype._changes,Rt.prototype._updateCount=0,Rt.prototype._children=null,Rt.prototype._parent=null,Rt.prototype._groupOrder=0,Rt.prototype._depthLevel=0,Rt.prototype._userModel=null,Rt.prototype._info=null,Rt.prototype.dispose=function(){if(!this.isDisposed()){if(this._children&&(this._children.forEach(Rt.dispose),this._children=null),this._staticValues=null,this._parent=null,this._depthLevel=0,this.unsubscribeForUpdates(),this._dc){let t=this.getRowData();t&&(t[gt]=null),this._dc=null}this._view&&(this._view=null),this._rowId=this._dataId="",this._userId=!1,this._userModel=null}},Rt.prototype.isDisposed=function(){return!this._rowId},Rt.prototype.initialize=function(t){if(!t)return;if(!this._autoGenerated){let e=t.rowId;e&&"string"==typeof e&&(this._rowId=this._dataId=e,this._userId=!0)}let e=Rt.extractRowOptions(t),i=t.permId;null!=i&&(this._permId=i),i=t.ric,null!=i&&(this._ric=i),i=t.label,void 0!==i&&(this._label=i),i=t.chainRic,null!=i&&(this._chainRic=i),i=e.asChain,null!=i&&(this._isChain=!!i),i=t.realTime,null!=i&&(this._realTime=i),i=t.collapsed;let n=e.collapsed;null==i&&n||(this._expanded=!n),i=t.asSegment,null!=i&&(this._asSegment=!!i),i=t.keepModel,i&&(this._userModel=t),i=t.info,i&&(this._info=i);let o=this._ric||this._chainRic;(o||this._permId)&&this.setContent(o,e),i=t.values,void 0!==i&&this.setStaticRowData(i,t.fields)},Rt.prototype._initializeAsConstituent=function(t){this._autoGenerated=!0;let e=t.parent;if(this.setParent(e)&&(this._dataId=t.dataId,this._ric=t.ric,this._dc=e._dc,this._dc)){let t=this.getRowData();t&&(t[gt]=this)}let i=t.values;void 0!==i&&this.setStaticRowData(i,t.fields)};let vt=function(t,e){let i=t.getRowIndex(e);do{if((e=t.getRowId(++i))&&!t.getSegmentParentRowId(e))break}while(e);return e},It=function(t,e,i){return!(!t||!t.isSorting())&&((e=!!e)!==i&&(e&&t.synchronizeRowOrder(),t.stallSorting(e)),e)};Rt.prototype.setContent=function(t,e){if(this._autoGenerated)return!1;t?"string"!=typeof t&&(t+=""):t="";let i=this._userInput!==t,n=e.permId;if(this._permId!==n&&(this._permId=n||"",i=!0),!i)return!1;let o=e.asChain,r=!0;"'"===t.charAt(0)&&(r=!1,this._ric=this._chainRic="");let s=this._view,l=It(s,r&&o,!1);if(this.unsubscribeForUpdates()||this._clearStaticData(),this.resetUpdates(),this._userInput=t,r){let i=!e.collapsed,n=e.chainRic;!0===o?(this._ric=!1===i?t:t.replace("0#",""),this._expanded=i):this._ric=t,this._isChain=null!=o?o:null,this._chainRic=n||""}if(this._dataId=this._rowId+this.getSymbol(),s){let t=s.getSegmentParentRowId(this._rowId);if(t){if(this._isChain){let e=vt(s,this._rowId);s.removeSegmentChild(t,this._rowId),s.moveRow(this._rowId,e),t=""}}else s.getSegment(this._rowId)&&s.setSegmentSeparator(this._rowId,!1);this._isChain&&s.setSegmentSeparator(this._rowId,!0),this.isChainCollapsed()?this._expanded&&this.expandChain():this._expanded||this.collapseChain(),It(s,!1,l),t&&s.addSegmentChild(t,this._rowId,this._dataId)}if(!this.subscribeForUpdates()&&this._dc){let t={};t[gt]=this,t.X_RIC_NAME=this.getDisplayText(),this.setRowData(t)}return!0},Rt.prototype.getRowId=function(){return this._rowId},Rt.prototype.getConfigObject=function(t){let e=t||{};this._userId&&(e.rowId=this._rowId);let i=this._ric;if(i&&(e.ric=i),this._ric||"'"!==this._userInput.charAt(0)||(e.ric=this._userInput),i=this._realTime,i||(e.realTime=!1),i=this._permId,i&&(e.permId=i),i=this._chainRic,i&&(e.chainRic=i),i=this._label,i&&(e.label=i),i=this._userModel,i&&(e.keepModel=e),i=this._isChain,null!=i&&(e.asChain=i),i=this._expanded,null!=i&&(e.collapsed=!i),i=this._view.isHiddenRow(this._rowId),i&&(e.hidden=i),i=this._info,i&&(e.info=this._info),i=this._getStaticRowData(),i&&(e.values=i),this.isChain()){let t=this.getChildren();if(t){let n=i?i[Rt._childDataField]:{};n||(n={});let o,r,s,l=!1,a=t.length;for(o=0;o<a;o++)r=t[o],s=r._getStaticRowData(),s&&(l=!0,n[r.getRic()]=s);l&&(e.values||(e.values={}),e.values[Rt._childDataField]=n)}}return e},Rt.prototype.getDataId=function(){return this._dataId},Rt.prototype.getType=function(){if(this._isChain)return mt;if(this._parent)return Ct;{let t=this._view;if(!t)return"";{let e=this.getRowId(),i=t.isSegmentSeparator(e),n=t.getSegmentLevel(e);if(i)return 1===n?St:wt;if(t.getSegmentParentRowId(e))return bt}}return yt},Rt.prototype.setDataSource=function(t){if(this._dc=t||null,!this._dc)return;let e=this.getRowData();e||(e={},e[gt]=this,e.X_RIC_NAME=this.getDisplayText(),this.setRowData(e)),this._staticValues&&this.setRowData(this._staticValues),this.subscribeForUpdates()},Rt.prototype.getDataSource=function(){return this._dc},Rt.prototype.getRowData=function(){return this._dc?this._dc.getRowData(this._dataId):{}},Rt.prototype.getData=function(t){return this._dc?this._dc.getData(this._dataId,t):null},Rt.prototype.setStaticRowData=function(t,e){this._clearStaticData(),Array.isArray(t)&&(t=m(t,e)),this._staticValues="object"==typeof t?t:null,this._staticValues&&this.setRowData(t)},Rt.prototype._getStaticRowData=function(){return this._staticValues?g(this._staticValues):null},Rt.prototype.updateRowData=function(t,e){Array.isArray(t)&&(t=m(t,e)),t&&this.setRowData(t)},Rt.prototype.setStaticData=function(t,e){this._staticValues||(this._staticValues={}),this._staticValues[t]=e,this.setData(t,e)},Rt.prototype.setRowData=function(t){this._dc&&this._dc.setRowData(this._dataId,t)},Rt.prototype.setData=function(t,e){this._dc&&this._dc.setData(this._dataId,t,e)},Rt.prototype._clearStaticData=function(){if(this._staticValues){for(let t in this._staticValues)this._staticValues[t]=null;this._dc&&this._dc.setRowData(this._dataId,this._staticValues),this._staticValues=null}},Rt.prototype.getUserInput=function(){return this._userInput},Rt.prototype.getRic=function(){return this._ric},Rt.prototype.getPermId=function(){return this._permId},Rt.prototype.getSymbol=function(){return this._ric||this._permId},Rt.prototype.getDisplayText=function(){return null!=this._label?this._label:this._ric?this._ric:this._permId?this._permId:this._userInput},Rt.prototype.getLabel=function(){return this._label},Rt.prototype.isRowHeader=function(){return"'"===this._userInput.charAt(0)},Rt.prototype.isChain=function(){return this._isChain},Rt.hasChain=function(t){return t.isChain()},Rt.prototype.isChainCollapsed=function(){return!!this._view&&this._view.isSegmentCollapsed(this._rowId)},Rt.prototype.isChainExpanded=function(){return!this.isChainCollapsed()},Rt.prototype.isFixedPosition=function(){return this._isChain&&this.isChainExpanded()},Rt.prototype.isAutoGenerated=function(){return this._autoGenerated},Rt.prototype.isRealTimeRow=function(){return!!this.getRic()&&(!!this._realTime&&(!this._autoGenerated&&!this.isRowHeader()))},Rt.prototype.subscribeForUpdates=function(){if(!this.isRealTimeRow()&&!this.getPermId())return!1;let t=this._dc?this._dc.getSubscriptions():null;if(!t)return!1;let e=this.unsubscribeForUpdates();if(this.isChain()){let e=this._chainRic;if(!e&&(e=this._ric,e.indexOf("0#")<0)){(e.match(/\./g)||[]).length<2&&(e="0#"+e)}this._subId=t.addChain(e,this._rowId)}else this._ric&&(this._subId=t.addRic(this._ric,this._rowId));return e?this._dc.setRowData(this._dataId,e):this._dc.setRowData(this._dataId,{X_RIC_NAME:this.getDisplayText(),ROW_DEF:this}),!0},Rt.prototype.unsubscribeForUpdates=function(){if(!this._subId)return;let t=this._dc.getSubscriptions(),e=this.getRowData();return t.removeSubscription(this._subId),this._subId="",this.resetUpdates(),this._dc.setRowData(this._dataId,null),this._clearStaticData(),e},Rt.prototype.isSubscribing=function(){return!!this._subId},Rt.prototype.addUpdate=function(t){if(t){let e=t.changes;if(e){let t=0;for(let i in e)this._changes[i]=t=1;if(t)return++this._updateCount,!0}}return!1},Rt.prototype.getUpdates=function(){return this._updateCount?this._changes:null},Rt.prototype.resetUpdates=function(){this._updateCount&&(this._changes={},this._updateCount=0)},Rt.prototype.registerToView=function(t,e){if(!t||this._view===t)return;this._view=t;let i=null;if(this._subSegment)return i=this._view.getRowData(this.getRowId()),void(i&&(i[gt]=this));i={},i[gt]=this;let n="",o=this._isChain||this._asSegment;e&&(n=t.getSegmentParentRowId(e),n&&o&&(e=vt(t,e)));let r=It(t,o,!1),s=t.insertRow(e,i,this.getRowId());s!==this._rowId&&(this._rowId=s,this._userId=!1),o?(t.setSegmentSeparator(s),It(t,!1,r),this._expanded||t.collapseSegment(s)):!this._parent&&n&&t.addSegmentChild(n,s,this._dataId)},Rt.prototype._deregisterFromView=function(t){return this._view?(t&&t.push(this._rowId),this._view=null,this._rowId):""},Rt.deregisterFromView=function(t,e){return e._deregisterFromView(t),t},Rt.prototype._getChildStaticRowData=function(t){if(!this._staticValues)return null;let e=this._staticValues[Rt._childDataField];return e&&e[t]||null},Rt.prototype.addConstituent=function(t){if(!t||this._ric===t)return null;if(!(this._rowId&&this._subId&&this._isChain))return null;let e=null;if(this._children){for(let i=this._children.length;--i>=0;)if(this._children[i]._ric===t){e=this._children[i];break}}else this._children=[];let i=!e;if(i){let i={asConstituent:!0,dataId:this._subId+t,ric:t,parent:this},n=this._getChildStaticRowData(t);n&&(i.values=n),e=new Rt(i)}if(this._view){let t=this.getRowId(),i=e.getData("CHILD_ORDER"),n=this._view.getDataSource(),o=n.getRowIndex(t),r=o+this.getChildCount();null!=i&&(r=o+i+1),e.registerToView(this._view,n.getRowId(r)),this._view.addSegmentChild(t,e.getRowId(),e.getDataId())}return i?e:null},Rt.prototype._toRealTimeRow=function(){this._ric&&(this.isRowHeader()||(this._realTimeField=!0,this._dataId=this._rowId+this._ric,this._autoGenerated=!1,this._parent=null,this._depthLevel=0,this._staticValues&&this.setRowData(this._staticValues),this.subscribeForUpdates()))},Rt.prototype.unlinkChain=function(){if(!this._isChain)return;if(this.isChainExpanded()){let t=this.getDescendants(),e=t.length;for(let i=0;i<e;i++)t[i]._toRealTimeRow()}let t=this._getStaticRowData();this.unsubscribeForUpdates(),this.setStaticRowData(t);let e=this._view;if(e){let t=this.getRowId(),i=e.getSegment(t);i&&i.setClassification(null),e.setSegmentSeparator(t,!1)}this._isChain=this._expanded=!1,this._chainRic="",this._userInput=this._ric,this._children=null,this.subscribeForUpdates()},Rt.prototype.collapseChain=function(){return!(!this._isChain||!this._view)&&(this._expanded=!1,this._view.collapseSegment(this._rowId,!0))},Rt.prototype.expandChain=function(){return!(!this._isChain||!this._view)&&(this._expanded=!0,this._view.collapseSegment(this._rowId,!1))},Rt.prototype.toggleChain=function(){return this._expanded?this.collapseChain():this.expandChain()},Rt.prototype.addChild=function(t){return!!t&&t.setParent(this)},Rt.prototype.getChildren=function(){return this._children},Rt.prototype.getDescendants=function(t){if(t||(t=[]),this._children){let e=this._children,i=e.length;for(let n=0;n<i;++n){let i=e[n];t.push(i),i.getDescendants(t)}}return t},Rt.prototype.getAllDescendantIds=function(){let t=this.getDescendants();return t.length?t.map(Rt.toRowId):null},Rt.prototype.getChildCount=function(){return this._children?this._children.length:0},Rt.prototype.getParent=function(){return this._parent},Rt.prototype.setParent=function(t){if(this._parent===t||t===this)return!1;if(this._parent){let t=this._parent._children.lastIndexOf(this);t>=0&&this._parent._children.splice(t,1),this._parent=null,this._depthLevel=0}return!!t&&(t._children||(t._children=[]),t._children.push(this),this._parent=t,this._depthLevel=t._depthLevel+1,!0)},Rt.prototype.getDepthLevel=function(){return this._depthLevel},Rt.prototype.getGroupOrder=function(){return this._parent?this._parent.getGroupOrder()+.1:this._groupOrder},Rt.prototype.setGroupOrder=function(t){return!this._parent&&this._groupOrder!==t&&(this._groupOrder=t,!0)},Rt.prototype.getUserModel=function(){return this._userModel},Rt.prototype.setRowInfo=function(t){this._info=t},Rt.prototype.getRowInfo=function(){return this._info},Rt.toRowId=function(t){return t.getRowId()},Rt.extractRowOptions=function(t){let e=t.ric,i=t.permId,n=t.chainRic,o=t.collapsed,r=t.asChain;null==r&&n&&(r=!0);let s=null;e&&e.indexOf("0#")>=0&&(null==r&&(r=!0),s=!0);let l={};return l.collapsed=null==o?!s:o,l.ric=e,l.permId=i||"",l.chainRic=n,l.asChain=r,l},Rt.dispose=function(t){t.dispose()};const Dt="/synapse/service/suggestions/suggest/?hits=1&profile="+encodeURIComponent("Field Selector"),xt=/^TR\.[\w]+\([\w\-\=\,]*(?:EDATE|SDATE)\=+[\w\-\=\,]*[ \w]*\)$/i;let At={};function Lt(t){t.currentTarget._error={type:t.type}}function Tt(t){let e=t.currentTarget,i=e._defer,n=e._field;if(delete At._loadingField[n],200===e.status){let t=JSON.parse(e.responseText),o=null,r=t.result&&t.result[0];if(r){let t=r.hits&&r.hits[0];if(t&&t.p){let e=t.p;e.fn.toUpperCase()===n.toUpperCase()&&(o=At.get(n)||{},o.field=e.fn,o.name=e.fl,o.rank=e.Rank,o.fieldDataType=e.fdt,o.id=e.fid,o.IsMonitorOnlyField=e.fimo,o.IsRealtimePortfolioField=e.firp,o.IsRealtimeField=e.firt,o.source=e.fsrc,o.sourceRank=e.fsrnk,o.description=t.title,At.set(n,o))}}o?i.resolve(o):i.reject("No definition for "+n)}else e._error?(e._error.field=n,i.reject(e._error)):i.reject({field:n,status:e.status,statusText:e.statusText,request:e})}At._defs={CF_NAME:{name:"Name",rank:2800003,fieldDataType:"ALPHANUMERIC",id:"6307",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100003,description:"The name of the instrument"},CF_LAST:{name:"Last",rank:2800024,fieldDataType:"PRICE",id:"5364",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100024,description:"The latest trade price or value."},PCTCHNG:{name:"Pct. Chng",rank:2709440,fieldDataType:"PRICE",id:"56",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:9440,description:"Percentage change in the latest trade price or value from the historic close."},CF_NETCHNG:{name:"Net. Chng",rank:2800027,fieldDataType:"PRICE",id:"5367",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100027,description:"Net Change is the difference between latest trade price or value and the historic closing value or settlement price."},CF_CLOSE:{name:"Close",rank:2800023,fieldDataType:"PRICE",id:"5360",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100023,description:"The last trade price, settlement value or closing value."},CF_CURR:{name:"Currency",rank:2800021,fieldDataType:"ENUMERATED",id:"6452",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100021,description:"The currency that the instrument is quoted in"},CF_BID:{name:"Bid",rank:2800025,fieldDataType:"PRICE",id:"5359",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100025,description:"The latest Bid price."},CF_ASK:{name:"Ask",rank:2800026,fieldDataType:"PRICE",id:"5358",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100026,description:"The latest Ask price."}},At._timeSeriesChildren={},At._synapse="",At._lang="en",At._timeSeriesExpansion=!0,At._loadingField={},At.set=function(t,e){if(At._defs[t])for(let i in e)At._defs[t][i]=e[i];else At._defs[t]=e},At.get=function(t){return At._defs[t]||null},At.getFieldInfo=At.get,At.hasFieldInfo=function(t){let e=At.get(t);return!(!e||!e.field)},At.getTimeSeriesChildren=function(t){return At._timeSeriesChildren[t]||null},At.addTimeSeriesChild=function(t,e){At._timeSeriesChildren[t]||(At._timeSeriesChildren[t]=[]),At._timeSeriesChildren[t].push(e)},At.remove=function(t){delete At._defs[t]},At.setSynapseConfig=function(t){At._synapse=t},At.disableTimeSeriesExpansion=function(t){At._timeSeriesExpansion=0==t},At.isFormula=function(t){return"="===t.charAt(0)},At.isAdc=function(t){return 0===t.indexOf("TR.")},At.isRealTimeField=function(t){return!!t&&(!At.isAdc(t)&&(!At.isFormula(t)&&(!At.isTimeSeriesChild(t)&&!1!==At.getFieldProperty(t,"IsRealtimeField"))))},At.isTimeSeriesChild=function(t){return!!At.getFieldProperty(t,"timeSeriesParent")},At.isTimeSeries=function(t){if(!t)return!1;if(!At._timeSeriesExpansion)return!1;let e=At.getFieldProperty(t,"timeSeries");return null!=e?!!e:xt.test(t)},At.setFieldProperty=function(t,e,i){At._defs[t]||(At._defs[t]={}),At._defs[t][e]=i},At.getFieldProperty=function(t,e){let i=At._defs[t];return i?i[e]:null},At.loadFieldInfo=function(t){if(At._loadingField[t])return At._loadingField[t].promise;let e=new D,i=At._synapse;if(i)if(At.hasFieldInfo(t))e.resolve(At.get(t));else if(i.debug){let i=this._mockOnLoadEndData(t,e);setTimeout(Tt.bind(null,i),1e3)}else if(i.apiKey&&i.contextApp){let n=Dt+"&api-key="+encodeURIComponent(i.apiKey)+"&contextApp="+encodeURIComponent(i.contextApp)+"&language="+encodeURIComponent(At._lang)+"&query="+encodeURIComponent(t);i.auth&&(n+="&auth="+encodeURIComponent(i.auth));let o=new XMLHttpRequest;o._defer=e,o._field=t,At._loadingField[t]=e,o.addEventListener("loadend",Tt),o.addEventListener("timeout",Lt),o.addEventListener("error",Lt),o.open("GET",n,!0),o.send()}else e.resolve(null);else e.resolve(null);return e.promise},At._mockOnLoadEndData=function(t,e){let i,n=t.toUpperCase(),o=n.toLowerCase();i=2===o.indexOf("_")?n[3]+o.substring(4):n[0]+o.substring(1);let r=n.indexOf("DATE")>=0?"DATE":"PRICE",s={action:'"'+n+'" SRCH',assetClassifierExplanation:"AssetClassifier is disabled.",assetClassifierStatus:"NOT_INVOKED",result:[{name:"Fields",default:!1,size:1,hits:[{cmd:i,explanation:null,fr:!1,id:"1635614732",navigation:null,p:{Rank:2800024,fdt:r,fid:"5364",fimo:!1,firp:!1,firt:!0,fl:i,fn:n,fsrc:"IDN",fsrnk:100024},position:0,preview:!1,relations:{},score:2840024,source:"87",subtitle:"",symbol:i,title:"title mockup of "+n,vc:"FLD"}],hasMore:!1}],search:"cpurl://apps.cp./apps/SearchAll?Search.Value="+o+"*"};return s=JSON.stringify(s),{currentTarget:{_defer:e,_field:t,status:200,response:s,responseText:s}}},function(){for(let t in At._defs)At._defs[t].field=t}();var Et=At;let Mt={_formulas:{},set:function(t,e){Mt._formulas[t]=e},get:function(t){return Mt._formulas[t]||""},remove:function(t){delete Mt._formulas[t]}};var Ft=Mt;const Pt={STRING:"string",BOOLEAN:"boolean",NUMBER:"number",DATE:"datetime",DATETIME:"datetime",TIME:"datetime",ENUMERATED:"string",ALPHANUMERIC:"string",PERCENT:"string",PRICE:"number",DOUBLE:"number",MONEY:"number",INTEGER:"number",FLOAT:"number",SCORE:"number"};let zt=function(t,e){this._defaultRenderer=this._defaultRenderer.bind(this),this._customRenderer=this._customRenderer.bind(this),this._internalRenderer=this._defaultRenderer,this._internalSorter=this._defaultSorter,this._eventArg={colDef:this},e&&(this._updateContext("grid",e),this._updateContext("core",e.getCoreGrid())),this._classes=[],this._requiredFields=[],this._children=[],t&&(t.parent?this._initializeTimeSeriesChild(t):this.initialize(t))};zt.prototype._field="",zt.prototype._dataType="",zt.prototype._name="",zt.prototype._defaultName=!0,zt.prototype._defaultField=!0,zt.prototype._tooltip=null,zt.prototype._requiredFields,zt.prototype._headerRenderer=null,zt.prototype._headerAlignment="",zt.prototype._internalRenderer,zt.prototype._userRenderers=null,zt.prototype._activatedRenderer=null,zt.prototype._rendererMap=null,zt.prototype._userSorter=null,zt.prototype._sortable=!0,zt.prototype._eventArg,zt.prototype._autoGenerated=!1,zt.prototype._classes,zt.prototype._fnEngine=null,zt.prototype._formula=null,zt.prototype._formulaRef="",zt.prototype._initialOrder="",zt.prototype._rowSorting=null,zt.prototype._textSelect=!1,zt.prototype._userModel=null,zt.prototype._parent=null,zt.prototype._children=null,zt.prototype._info=null,zt.prototype._coreColDef=null,zt.prototype._focusable=!1,zt.prototype.dispose=function(){this._eventArg={},this._coreColDef=null,this._activatedRenderer=this._rendererMap=null,this.setRenderer(null),this.setSorter(null),this._userModel=null,this._parent=null,this._children=null},zt.prototype._initializeTimeSeriesChild=function(t){this._autoGenerated=!0;let e=t.parent;this._setParent(e),this.initialize(t)},zt.prototype.initialize=function(t){if(!t)return;let e,i,n,o,r=t.field,s=Et.get(r);if(s&&s!==t){let e=t;for(n in t={},s)t[n]=s[n];for(n in e)t[n]=e[n]}if(o=t.formulaEngine,o&&o.addFormula&&(this._fnEngine=o),o=t.formulaReference,o&&(this._formulaRef=o+""),o=t.require||t.requiredFields,null!=o&&("string"==typeof o?this._requiredFields=o.split(" "):Array.isArray(o)&&(this._requiredFields=o.slice())),this._setField(r,t),o=t.name||t.title,null!=o&&(this._name=o,this._defaultName=!1),o=t.dataType,null!=o&&(this._dataType=o),o=t.notRealTimeField,null!=o&&Et.setFieldProperty(r,"IsRealtimeField",!o),o=t.tooltip,null!=o&&(this._tooltip=o),o=t.headerAlignment||t.titleAlignment,null!=o&&(this._headerAlignment=function(t){if(t){let e=t.charAt(0).toLowerCase();if("l"===e)return"left";if("r"===e)return"right";if("c"===e)return"center"}return""}(o)),o=t.headerBinding||t.headerRenderer,void 0!==o&&(this._headerRenderer=o),o=t.binding||t.renderer,o||(o=t.formatter),void 0!==o)if(o instanceof Array)for(i=o.length,e=0;e<i;++e)this.addRenderer(o[e]);else o?"function"==typeof o?this.setRenderer(o):o.binding&&this.setRenderer(o.binding):this.setRenderer(null);o=t.rowSorting,null!=o&&(this._rowSorting=!!o),o=t.sortLogic||t.sortingLogic||t.sorter,void 0!==o&&this.setSorter(o),o=t.sortable,null!=o&&(this._sortable=!!o),o=t.focusable,null!=o&&(this._focusable=!!o),o=t.className||t.class,"string"==typeof o&&(this._classes=o.split(" ")),o=t.sortOrder||t.sort,o&&(this._initialOrder=o),o=t.textSelect,o&&(this._textSelect=o),o=t.info,o&&(this._info=o),this._userModel=t},zt.prototype.getId=function(){return this._coreColDef&&this._coreColDef.id||""},zt.prototype.getRequireFields=function(){return this._requiredFields},zt.prototype.getRequiredFields=zt.prototype.getRequireFields,zt.prototype.getRenderer=function(){return this._internalRenderer},zt.prototype.getHeaderRenderer=function(){return this._headerRenderer},zt.prototype.getName=function(){return this._defaultName?this._defaultField?"Column "+this.getId():this.getField():this._name},zt.prototype.isDefaultName=function(){return this._defaultName},zt.prototype.getFieldDefinition=function(){return Et.get(this.getField())},zt.prototype.getFieldDataType=function(){let t=this.getFieldDefinition();return t&&t.fieldDataType?t.fieldDataType:""},zt.prototype.getDataType=function(){if(this._dataType)return this._dataType;let t=this.getFieldDataType();return t?Pt[t.toUpperCase()]:""},zt.prototype.setDataType=function(t){let e=Pt[t.toUpperCase()];e&&(t=e),this._dataType=t},zt.getDataType=function(t){let e=Et.get(t);if(e){let t=e.fieldDataType?e.fieldDataType.toUpperCase():null;return Pt[t]?Pt[t]:""}return""},zt.prototype.getTooltip=function(){if(null!=this._tooltip){if("string"==typeof this._tooltip)return this._tooltip;if(!this._tooltip)return""}let t=this.getName();if(t)return t;let e=this.getField();return e||""},zt.prototype.getField=function(){return this._coreColDef&&this._coreColDef.field||""},zt.prototype.getAllFields=function(){let t=this.getField();return t?this._requiredFields.concat(t):this._requiredFields.slice()},zt.prototype.isRealTimeField=function(){return Et.isRealTimeField(this.getField()||this._field)},zt.prototype.isTimeSeries=function(){return Et.isTimeSeries(this.getField())},zt.prototype.isTimeSeriesChild=function(){return Et.isTimeSeriesChild(this.getField())},zt.prototype.isFormulaField=function(){return!!this._formula},zt.isFormulaField=function(t){return Et.isFormula(t)},zt.isAdcField=function(t){return Et.isAdc(t)},zt.isRealTimeField=function(t){return Et.isRealTimeField(t)},zt.getRealTimeFields=function(t,e){e.isRealTimeField()&&t.push(e.getField());let i=e.getRequiredFields(),n=i.length;for(let e=0;e<n;++e){let n=i[e];zt.isRealTimeField(n)&&t.push(n)}return t},zt.prototype.isSortable=function(){return this._sortable},zt.prototype.isScalable=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnScalability(e)},zt.prototype.getInitialSortOrder=function(){return this._initialOrder},zt.prototype.getWidth=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnWidth(e)},zt.prototype.getMinWidth=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getMinimumColumnWidth(e)},zt.prototype.getTextAlign=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnAlignment(e)},zt.prototype.isFieldEmpty=function(){return!this.getField()},zt.prototype.getHeaderAlignment=function(){return this._headerAlignment||""},zt.prototype.getClasses=function(){return this._classes},zt.prototype.getConfigObject=function(t){let e=t||{};if(this._info&&(e.info=this._info),null==e.field&&!this._defaultField){let t=this.getField();t&&(e.field=t)}let i=this.getDataType();i&&(e.dataType=i),this._formulaRef&&(e.formulaReference=this._formulaRef),this._requiredFields&&this._requiredFields.length&&(e.require=this._requiredFields),this._defaultName||(e.name=this.getName()),i=!1===Et.getFieldProperty(this.getField(),"IsRealtimeField"),i&&(e.notRealTimeField=i),null!=this._tooltip&&(e.tooltip=this._tooltip),null!=this._rowSorting&&(e.rowSorting=this._rowSorting),this._sortable||(e.sortable=!1);let n=this._classes;n&&n.length>0&&(e.className=n.join(" ")),this._textSelect&&(e.textSelect=this._textSelect),this._headerAlignment&&(e.headerAlignment=this._headerAlignment),this._autoGenerated&&(e.autoGenerated=this._autoGenerated),this._focusable&&(e.focusable=!0);let o=this._eventArg.core,r=this._eventArg.grid.getColumnIndex(this),s=o.getColumnScalability(r),l=o.getColumnCustomLaneSize(r);return!0===s&&1===l||(e.scalable=s,e.width=l),i=o.getMinimumColumnWidth(r),i>0&&(e.minWidth=i),null==e.hidden&&(o.getColumnVisibility(r,0)||(e.hidden=!0)),i=o.getColumnAlignment(r),"default"!==i&&(e.textAlign=i),e},zt.prototype.isHidden=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return!t.isColumnVisible(e)},zt.prototype.isTextSelect=function(){return this._textSelect},zt.prototype.hide=function(t){let e=this._eventArg.core,i=this._eventArg.grid.getColumnIndex(this);e.hideColumn(i,!1!==t)},zt.prototype.setHeaderRenderer=function(t){this._headerRenderer=t},zt.prototype.setRenderer=function(t){"function"==typeof t?(this._internalRenderer=this._customRenderer,this._activatedRenderer!==t&&(this._userRenderers?this._userRenderers.length=0:this._userRenderers=[],this._userRenderers.push(t))):(this._internalRenderer=this._defaultRenderer,this._userRenderers=null)},zt.prototype.getParent=function(){return this._parent},zt.prototype._setParent=function(t){return this._parent===t||t===this||t&&(this._parent=t,this._parent._addChild(this)),!1},zt.prototype.getChildren=function(){return this._children},zt.prototype._addChild=function(t){this===t||this._children.indexOf(t)>-1||this._children.push(t)},zt.prototype.addRenderer=function(t){t&&(this._userRenderers?this._userRenderers.push(t):this.setRenderer(t))},zt.prototype.activateRenderer=function(t,e){let i=null;if(null!=t){let n=this._rendererMap;n||(n=this._rendererMap={}),"function"==typeof e?i=n[t]=e:null==e?i=n[t]:e||(i=n[t]=null)}return this._activatedRenderer=i||null,i||(i=this._userRenderers?this._userRenderers[0]:null),this.setRenderer(i),!!this._activatedRenderer},zt.prototype.getSorter=function(){return this._userSorter},zt.prototype.setSorter=function(t){this._userSorter="function"==typeof t?t:null},zt.prototype.isRowSorting=function(){return null==this._rowSorting?!Et.getFieldProperty(this.getField(),"IsRealtimeField"):!!this._rowSorting},zt.prototype.isAutoGenerated=function(){return this._autoGenerated},zt.prototype.setName=function(t){this._name=t,this._defaultName=!1},zt.prototype._setField=function(t,e){this._defaultField=null==t,t||(t=""),t=t.trim();let i=e?e.formula:"";if(this._fnEngine){let e=t.toUpperCase(),n=i||Ft.get(e);(n||zt.isFormulaField(t))&&(t=c.toUpperCase(t),this._formula=this._fnEngine.addFormula(n||t),n&&(this._formula.setAlias(t),this._fnEngine.addReference(this._formula,t)),this._retrieveNestedFields(this._formula.getFieldNames())),this._formulaRef&&(this._formulaRef=this._fnEngine.addReference(this._formula||t,this._formulaRef))}this._field=t,Et.setFieldProperty(t,"timeSeries",!!Et.isTimeSeries(t));let n=e.parent;e&&n&&Et.setFieldProperty(t,"timeSeriesParent",n.getField()),this._updateContext("field",t),this.isRealTimeField()&&this._updateContext("formattedField",t+"_FORMATTED")},zt.prototype._retrieveNestedFields=function(t){if(t)for(let e=t.length;--e>=0;){let i=t[e],n=i.toUpperCase(),o=Ft.get(n);if(o){let t=this._fnEngine.getFormula(i);t?t.addFormulaCount():(t=this._fnEngine.addFormula(o),t.setAlias(i),this._fnEngine.addReference(t,i)),this._retrieveNestedFields(t.getFieldNames())}else this._requiredFields.push(i)}},zt.prototype._defaultRenderer=function(t){let e=t.dataValue;t.cell.setContent(e?e.getData(this._field):null)},zt.prototype._customRenderer=function(t){let e=t.dataValue,i=this._eventArg;if(e){let n=e.getRowData();i.rowDef=e,i.rowData=n,i.rowIndex=t.rowIndex,i.data=n?n[this._field]:null}else i.data=null;if(i.colIndex=t.colIndex,i.cell=t.cell,i.section=t.section,this._activatedRenderer)this._activatedRenderer(i);else{let t=this._userRenderers,e=t.length;for(let n=0;n<e;++n)t[n](i)}},zt.prototype._updateContext=function(t,e){this._eventArg[t]=e},zt.prototype.getUserModel=function(){return this._userModel},zt.prototype.clearUserModel=function(){this._userModel=null},zt.prototype.setColumnInfo=function(t){this._info=t},zt.prototype.getColumnInfo=function(){return this._info},zt.prototype._setCoreColumnDef=function(t){this._coreColDef=t||null},zt.prototype.isFocusable=function(){return this._focusable};var Vt=zt;let kt=function(){this._onRequest=this._onRequest.bind(this),this._rics={},this._fields={},this._adcOptions={productId:"001"}};s.inherits(kt,a),kt.prototype._timerId=0,kt.prototype._rics,kt.prototype._fields,kt.prototype._rtk,kt.prototype._adcOptions=null,kt.prototype.setRTK=function(t){this._rtk=t},kt._mockAdc=null,kt.setMockAdc=function(t,e){kt._mockAdc||(kt._mockAdc={}),kt._mockAdc[t]=e},kt.getMockAdc=function(t){return kt._mockAdc?kt._mockAdc[t]:null},kt.clearMockAdc=function(){kt._mockAdc=null},kt.prototype.setADCOptions=function(t){let e=t.productId;e&&(this._adcOptions.productId=e)},kt.prototype.addRic=function(t){t&&!this._rics[t]&&(this._rics[t]=1,this._request())},kt.prototype.addRics=function(t){let e=t?t.length:0,i=!1;for(let n=0;n<e;++n){let e=t[n];e&&!this._rics[e]&&(this._rics[e]=1,i=!0)}return!!i&&(this._request(),!0)},kt.prototype.addField=function(t){this._addField(t)&&this._request()},kt.prototype.addFields=function(t){let e=t.length,i=0;for(let n=0;n<e;++n)i|=this._addField(t[n]);return!!i&&(this._request(),!0)},kt.prototype._addField=function(t){return kt.isValidField(t)&&!this._fields[t]?(this._fields[t]=1,1):0},kt.isValidField=function(t){return!(!t||0!==t.indexOf("TR."))},kt.prototype._request=function(){this._timerId||(this._timerId=setTimeout(this._onRequest,0))},kt.prototype._onRequest=function(){this._timerId=0;let t=window.JET;if(this._rtk){if(!this._rtk.Data)return}else if(!t||!t.ContainerDescription||"function"!=typeof t.Data)return;let e,i=Object.keys(this._rics),n=[],o=[];for(let t in this._fields)At.isTimeSeries(t)?o.push(t):n.push(t);let r,s,l=n.length,a=o.length;if((l||a)&&i.length)if(this._rics={},this._fields={},this._rtk){let t;if(o.length>0){let t=o.join(",");s={method:"select",formula:t,identifiers:i,productId:this._adcOptions.productId,output:"Col,date|,Row,In|,va,T,NoEmptyTickers"},r=this._onRTKTimeSeriesSuccess.bind(this,o);let e=kt.getMockAdc(s.formula);e?setTimeout((function(){r(e)}),10):this._rtk.Data.Adc.request(s).then(r).catch((function(t){console.log(t)}))}n.length>0&&(t=n.join(","),s={method:"select",formula:t,identifiers:i,productId:this._adcOptions.productId,output:"Col,In,va,T,NoEmptyTickers"},r=this._onRTKSuccess.bind(this,n),this._rtk.Data.Adc.request(s).then(r).catch((function(t){console.log(t)})))}else{let o=[];for(e=0;e<l;e++)o.push({name:n[e]});s={instruments:i,fields:o},r=this._onJETSuccess.bind(this,n),t.Data("datagrid").then((function(t){return t.request(s)})).then(JSON.parse).then(r).catch((function(t){console.log(t)}))}},kt.prototype._onJETSuccess=function(t,e){this._dispatch("adcDataReceived",e);let i,n,o,r=e.data,s=e.headers&&e.headers[0];if(!Array.isArray(r)||!Array.isArray(s))return;let l=1,a=t.length,u=s.length,h=new Array(u);for(i=0;i<a&&l<u;i++)n=t[i],s[l].field===n.toUpperCase()&&(h[l]=n,l++);let p=r.length,d=h.length,c={};for(i=0;i<p;i++){let t=r[i];if(o=t[0],c[o])continue;let e=c[o]={};for(l=1;l<d;l++){let i=t[l];null!=i&&""!==i&&(n=h[l],e[n]=i)}}let _={};for(o in c){let t=c[o];y(t)||(_[o]=t)}this._dispatch("dataChanged",{data:_})},kt.prototype._onRTKSuccess=function(t,e){this._dispatch("adcDataReceived",e);let i,n,o,r=e.rows,s=e.rows&&e.rows[0];if(!Array.isArray(r)||!Array.isArray(s))return;let l=1,a=t.length,u=s.length,h=new Array(u);for(i=0;i<a&&l<u;i++)n=t[i],s[l].r.toUpperCase()===n.toUpperCase()&&(h[l]=n,l++);let p=r.length,d=h.length,c={};for(i=1;i<p;i++){let t=r[i];if(o=t[0],c[o])continue;let e=c[o]={};for(l=1;l<d;l++){let i=t[l];null!=i&&""!==i&&"object"!=typeof i&&(n=h[l],e[n]=i)}}let _={};for(o in c){let t=c[o];y(t)||(_[o]=t)}this._dispatch("dataChanged",{data:_})},kt.prototype._onRTKTimeSeriesSuccess=function(t,e){this._dispatch("adcDataReceived",e);let i=e.rows,n=e.rows&&e.rows[0];if(!Array.isArray(i)||!Array.isArray(n))return;let o=n.slice(2).map(t=>t.v),r={},s=0,l=i.length;for(let e=1;e<l;e++){let n=i[e][1];r[n]||(r[n]=t[s++])}let a={},u={};for(let t=1;t<l;t++){let e=i[t],n=e[0],s=e[1];a[n]||(a[n]={});let l=a[n];if(1===o.length)l[r[s]]=e[2];else for(let t=0;t<o.length;t++){let i=r[s].replace("TR.","")+"_"+o[t],n=e[2+t];null!==n&&(u[i]=r[s],l[i]=n)}}let h={};for(let t in a){let e=a[t];y(e)||(h[t]=e)}let p={data:h};o.length>1&&(p.timeSeries=!0,p.childrenFieldToParent=u),this._dispatch("dataChanged",p)};var Ot=kt;let Nt=function(){this._groupMap={},this._childToParent={}};Nt.prototype._groupMap,Nt.prototype._childToParent,Nt.getGroupId=function(t){return t&&t.id||""},Nt.calcTreeDepth=function(t,e){let i=-1,n=e;for(;n;){if(++i>15){console.log("WARNING: Infinite loop detected during column group creation");break}n=t[n.parentId]}return i},Nt.getLeafDescendants=function(t,e){let i=t[e];if(!i)return null;let n=[],o=[i],r=0,s={};for(;r<o.length;){i=o[r++],s[i.id]=!0;let e=i.children,l=e?e.length:0;for(let r=0;r<l;++r){let l=e[r];i=t[l],i?s[i.id]||o.push(i):n.push(l)}}return n},Nt._cloneObject=function(t){let e=g(t);return Array.isArray(e.children)?e.children=e.children.slice():e.children=[],e},Nt._toGroupDefinition=function(t,e){let i=null;return t&&(i=Array.isArray(t)?{children:t.slice()}:Nt._cloneObject(t),e&&(i.id||(i.name=e),i.id=e)),i},Nt.prototype.toString=function(){let t=this._groupMap,e=[];e.push("=== groupDefs ===");for(let i in t){let n=t[i];e.push(i+": "+JSON.stringify(n,["id","parentId","children"]))}return e.push("=== childToParent ==="),e.push(JSON.stringify(this._childToParent,null,2)),e.push(""),e.join("\n")},Nt.prototype.getGroup=function(t){return t&&this._groupMap[t]||null},Nt.prototype.getDefinition=Nt.prototype.getGroup,Nt.prototype.getGroups=function(){let t=[],e=this._groupMap;for(let i in e)t.push(e[i]);return t},Nt.prototype.getGroupIds=function(){return Object.keys(this._groupMap)},Nt.prototype.getGroupMap=function(){return this._groupMap},Nt.prototype.cloneGroupMap=function(){let t=this._groupMap,e={};for(let i in t){let n=t[i],o=Nt._cloneObject(n);e[i]=o}return e},Nt.prototype.rebuildMap=function(){let t,e,i=this._groupMap,n=this._childToParent={},o=Object.keys(i),r=o.length;for(t=0;t<r;++t){e=o[t];let r=i[e].children,s=r?r.length:0;for(let t=0;t<s;t++)n[r[t]]=e}for(t=0;t<r;++t){e=o[t];let r=n[e];r&&(i[e].parentId=r)}},Nt.prototype.getGroupChildren=function(t){let e=this._groupMap[t];return e?e.children:null},Nt.prototype.getLeafDescendants=function(t){return Nt.getLeafDescendants(this._groupMap,t)},Nt.prototype.getGroupLevel=function(t){return Nt.calcTreeDepth(this._groupMap,this._groupMap[t])},Nt.prototype.getRootGroup=function(t){if(!t)return null;let e=this._groupMap,i=e[t]||null;if(i)for(;i.parentId;){let t=e[i.parentId];if(!t)break;i=t}return i},Nt.prototype.getParentGroup=function(t){return this.getGroup(this._childToParent[t])},Nt.prototype.getParentIds=function(t){if(t&&"string"==typeof t){let e=this._childToParent[t];if(e){let t=[e],i=this._groupMap[e];for(;i&&i.parentId;)i=this._groupMap[i.parentId],i&&t.push(i.id);return t}}return null},Nt.prototype.getParentId=function(t,e){let i=this._childToParent[t];if(null!=e){let t=this.getGroupLevel(i);for(;t>e&&i;)i=this._childToParent[i],t--}return i||""},Nt.prototype.removeAllGroups=function(){for(let t in this._groupMap)return this._groupMap={},this._childToParent={},!0;return!1},Nt.prototype.setGroups=function(t){let e=this._groupMap={},i=t?t.length:0;for(let n=0;n<i;n++){let i=t[n],o=i.id;o&&(e[o]=Nt._cloneObject(i))}this.rebuildMap()},Nt.prototype.addGroup=function(t){let e=Nt.getGroupId(t);return e?this.setGroup(e,t):e},Nt.prototype.removeGroup=function(t){return!!this._groupMap[t]&&(this.removeAllChildren(t),this.unsetParent(t),delete this._groupMap[t],!0)},Nt.prototype.setGroup=function(t,e){if(!t)return"";if(e){let i=Nt._toGroupDefinition(e,t);this._ungroupChildren(i.children),this._groupMap[t]&&this.removeAllChildren(t);let n=this._childToParent[t];n&&(i.parentId=n.id),this._groupMap[t]=i;let o=i.children,r=o.length;for(let e=0;e<r;++e){let i=o[e];this._childToParent[i]=t;let n=this._groupMap[i];n&&(n.parentId=t)}}else if(!this.removeGroup(t))return"";return t},Nt.prototype._ungroupChildren=function(t){if(Array.isArray(t)){let e=t.length;for(let i=0;i<e;++i)this.unsetParent(t[i])}},Nt.prototype.hasGroupChild=function(t,e){let i=this._groupMap[t];if(e&&i){let t=i.children;if(t)return t.indexOf(e)>=0}return!1},Nt.prototype.contains=function(t,e){if(t&&e){if(t===e)return!0;let i=20,n=this._childToParent[e];for(;n&&i;){if(t===n)return!0;--i,n=this._childToParent[n]}}return!1},Nt.prototype.addGroupChild=function(t,e,i){let n=this._groupMap[t];if(e&&n){let o=n.children;if(o&&o.indexOf(e)<0){this.unsetParent(e),this._childToParent[e]=t;let n=this._groupMap[e];return n&&(n.parentId=t),null!=i&&i>=0?o.splice(i,0,e):o.push(e),!0}}return!1},Nt.prototype.removeGroupChild=function(t,e){return null==e?this.unsetParent(t):!!this.hasGroupChild(t,e)&&this.unsetParent(e)},Nt.prototype.unsetParent=function(t){let e=this._childToParent[t];if(!e)return!1;this._childToParent[t]="";let i=this._groupMap[t];i&&(i.parentId="");let n=this._groupMap[e];if(n){let e=n.children;if(e&&e.length){let i=e.indexOf(t);i>=0&&e.splice(i,1)}}return!0},Nt.prototype.removeAllChildren=function(t){let e=this._groupMap[t];if(e){let t=e.children,i=t?t.length:0;if(i){e.children=[];for(let e=0;e<i;++e){let i=t[e];this._childToParent[i]&&(this._childToParent[i]="");let n=this._groupMap[i];n&&(n.parentId="")}return!0}}return!1},Nt.prototype.setGroupChildren=function(t,e){let i=this._groupMap[t];if(i){if(Array.isArray(e)){let n=e.slice();this._ungroupChildren(n),this.removeAllChildren(t),i.children=n;let o=i.id,r=n.length;for(let t=0;t<r;++t){let e=n[t];this._childToParent[e]=o;let i=this._groupMap[e];i&&(i.parentId=o)}return!0}if(!e&&i.children.length)return this.removeAllChildren(t),!0}return!1},Nt.prototype.getGroupName=function(t){let e=this._groupMap[t];return e&&e.name||""},Nt.prototype.setGroupName=function(t,e){let i=this._groupMap[t];return!(!i||i.name===e)&&(i.name=e,!0)};let Ht=function(t){this._element=t||document.createElement("div")};l.inherits(Ht,lt),Ht.prototype._element=null,Ht.prototype._content=null,Ht.prototype._textSpan=null,Ht.prototype._nativeEvents=null,Ht._passiveEvents=null,Ht.prototype.getContent=function(t){return t?this._element.children:this._element.lastChild},Ht.prototype.setContent=function(t,e){if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?(nt.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},Ht.prototype.addContent=function(t){return null==(t=nt.getElement(t))?null:(this._content=this._element.children,this._element.appendChild(t),t)},Ht.prototype.removeContent=function(t){return null!=(t=nt.getElement(t))&&(this._content=this._element.children,this._element.removeChild(t),!0)},Ht.prototype.listen=function(t,e,i){if(this._customEvents&&this._customEvents[t])return void this._customEvents[t].listen(e,i);this._nativeEvents||(this._nativeEvents={});let n=this._nativeEvents[t];if(!n){if(n=new rt,this._nativeEvents[t]=n,n.dispatch=n.dispatch.bind(n),!Ht._passiveEvents){let t=!1;try{let e=Object.defineProperty({},"passive",{get:function(){return t=!0,!1}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(t){}if(t){let t={passive:!0};Ht._passiveEvents={touchstart:t,touchmove:t}}else Ht._passiveEvents={}}this._element.addEventListener(t,n.dispatch,Ht._passiveEvents[t]||!1)}n.listen(e,i)},Ht.prototype.unlisten=function(t,e){if(this._customEvents&&this._customEvents[t])this._customEvents[t].unlisten(e);else if(this._nativeEvents){let i=this._nativeEvents[t];i&&i.unlisten(e)}},Ht.prototype.unlistenAll=function(t){if(this._customEvents)if(t)this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(let t in this._customEvents)this._customEvents[t].unlistenAll();if(this._nativeEvents)if(t)this._nativeEvents[t]&&(this._unlistenAll(t),delete this._nativeEvents[t]);else{for(let t in this._nativeEvents)this._unlistenAll(t);this._nativeEvents=null}},Ht.prototype._unlistenAll=function(t){let e=this._nativeEvents[t];this._element.removeEventListener(t,e.dispatch,!1),e.unlistenAll()},Ht.prototype.dispose=function(){this._dispose()},Ht.prototype._dispose=function(){this.setParent(null),this.unlistenAll(),this._element=this._content=this._textSpan=null,this._customEvents=this._nativeEvents=null},Ht.prototype.setEventArgExtender=function(t,e){if(this._customEvents){let i=this._customEvents[t];i&&i.setEventArgExtender(e)}},Ht.prototype.getElement=function(){return this._element},Ht.prototype.getNextSibling=function(){return this._element.nextSibling},Ht.prototype.getParent=function(){return this._element.parentNode},Ht.prototype.setParent=function(t,e){this._setParent(t,e)},Ht.prototype._setParent=function(t,e){null!==(t=nt.getElement(t))?e?t.insertBefore(this._element,t.firstChild):t.appendChild(this._element):null!==this._element.parentNode&&this._element.parentNode.removeChild(this._element)},Ht.prototype.insertBefore=function(t){this._insertBefore(t)},Ht.prototype._insertBefore=function(t){if(null==(t=nt.getElement(t)))return void this.setParent(this.getParent());let e=t.parentNode;null!=e&&e.insertBefore(this._element,t)},Ht.prototype.insertAfter=function(t){(t=nt.getElement(t))?t.nextSibling?this.insertBefore(t.nextSibling):this.setParent(t.parentNode):this.setParent(this.getParent(),!0)},Ht.prototype.hasClass=function(t){return!!this._element&&this._element.classList.contains(t)},Ht.prototype.addClass=function(t){this._element&&this._element.classList.add(t)},Ht.prototype.removeClass=function(t){this._element&&this._element.classList.remove(t)},Ht.prototype.toggleClass=function(t,e){let i=this._element;i&&(null==e&&(e=!i.classList.contains(t)),e?i.classList.add(t):i.classList.remove(t))},Ht.prototype.enableClass=function(t,e){!1!==e?this.addClass(t):this.removeClass(t)},Ht.prototype.getClass=function(){return this._element.className},Ht.prototype.setClass=function(t){this._element.className=t},Ht.prototype.getAttribute=function(t){return this._element.getAttribute(t)},Ht.prototype.setAttribute=function(t,e){this._element.setAttribute(t,e)},Ht.prototype.setAttributes=function(t){for(let e in t)this._element.setAttribute(e,t[e])},Ht.prototype.removeAttribute=function(t){this._element.removeAttribute(t)},Ht.prototype.getStyle=function(t){return this._element.style[t]},Ht.prototype.setStyle=function(t,e){this._element.style[t]=e},Ht.prototype.setStyles=function(t){let e=this._element.style;for(let i in t)e[i]=t[i]},Ht.prototype.getId=function(){return this._element.id},Ht.prototype.setId=function(t){this._element.id=t},Ht.prototype.toString=function(){let t=this._element.outerHTML;return t=t.replace(this._element.innerHTML,""),t},Ht.prototype.getTextContent=function(){return this._element.textContent},Ht.prototype.setTextContent=function(t){this._element.textContent=t},Ht.prototype.getLeft=function(){return this._element.offsetLeft},Ht.prototype.setLeft=function(t){return this._element.style.left=t+"px",!0},Ht.prototype.getTop=function(){return this._element.offsetTop},Ht.prototype.setTop=function(t){return this._element.style.top=t+"px",!0},Ht.prototype.getWidth=function(){return this._element.offsetWidth},Ht.prototype.setWidth=function(t){return this._element.style.width=t+"px",!0},Ht.prototype.getHeight=function(){return this._element.offsetHeight},Ht.prototype.setHeight=function(t){return t<0&&(t=0),this._element.style.height=t+"px",!0},Ht.prototype.getBoundingClientRect=function(){return this._element.getBoundingClientRect()},Ht.prototype.fillParentWidth=function(t){return null==t&&(t=100),this._element.style.width=t+"%",!0},Ht.prototype.fillParentHeight=function(t){return null==t&&(t=100),this._element.style.height=t+"%",!0},Ht.prototype.getTooltip=function(){return this.getAttribute("title")},Ht.prototype.setTooltip=function(t){t?this.setAttribute("title",t):this.removeAttribute("title")},Ht.prototype.show=function(t){this._element.style.display=!1!==t?"":"none"},Ht.prototype.hide=function(t){this.show(!1===t)},Ht.prototype.isVisible=function(){return"none"!==this._element.style.display},Ht.prototype.enable=function(t){(t=!1!==t)?this.removeAttribute("disabled"):(this.setAttribute("disabled","disabled"),this._element.disabled=!t)},Ht.prototype.disable=function(t){this.enable(!1===t)},Ht.prototype.isEnabled=function(){return!this._element.hasAttribute("disabled")},Ht.prototype.getScrollLeft=function(){return this._element.scrollLeft},Ht.prototype.getScrollTop=function(){return this._element.scrollTop},Ht.prototype.isEndOfHorizontalScroll=function(){return this._element.scrollLeft>=this._element.scrollWidth-this.getWidth()},Ht.prototype.isEndOfVerticalScroll=function(){return this._element.scrollTop>=this._element.scrollHeight-this.getHeight()},Ht._proto=Ht.prototype;var Bt=Ht;let Gt=function(){this._items=[],this._element=null};l.inherits(Gt,Bt),Gt.prototype._items=[],Gt.prototype.hasItem=function(){return!!this._items.length},Gt.prototype.containItem=function(t){return this._items.indexOf(t)>-1},Gt.prototype.insertItem=function(t,e){let i=this._items;i.indexOf(t)>-1||(i.push(t),e&&(t._order=e),i.length&&i.sort(Gt._iconComparer),this._updatePanelItems())},Gt.prototype.removeItem=function(t){let e=this._items,i=-1;if(t)for(let n=e.length;--n>=0;){let o=e[n];if("string"==typeof t){if(o.classList.contains(t)){i=n;break}}else if(o===t){i=n;break}}else i=e.length-1;let n=null;return i>-1&&(n=e.splice(i,1)[0]),this._updatePanelItems(),n},Gt.prototype.clearItems=function(){let t=this._items;t.length&&(t.length=0,this._updatePanelItems())},Gt._iconComparer=function(t,e){return t._order?e._order?t._order-e._order:1:e._order?-1:0},Gt.prototype._updatePanelItems=function(){let 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(let i=0;i<t.length;i++)e.appendChild(t[i])}};var Wt=Gt;let Ut=function(t,e){this._id=Ut._runningId++,this._element=document.createElement("div"),this._element.className="cell",e&&(this._section=e)};l.inherits(Ut,Bt),Ut.prototype._aligner=null,Ut._runningId=0,Ut.prototype._id=0,Ut.prototype._width=-1,Ut.prototype._height=-1,Ut.prototype._visible=!0,Ut.prototype._rawContent,Ut.prototype._section=null,Ut.prototype._contentLocked=!1,Ut.prototype._collapsedState=0,Ut.prototype._floatingPanel=null,Ut.prototype._frontIcon=null,Ut.prototype.getContent=function(t){return t&&this._element?this._element.children:this._content||null},Ut.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){let t=this._aligner.firstChild;t!==this._content&&(this._rawContent=t,this._content=t)}let i=this._setRawContent(t);return null!=e&&this._content&&this._content.setAttribute("title",e),i},Ut.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)))},Ut.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},Ut.prototype.getNextSibling=function(){return null!==this._element?this._element.nextSibling:null},Ut.prototype.getParent=function(){return null!==this._element?this._element.parentNode:null},Ut.prototype.setParent=function(t,e){let i=nt.getElement(t);if(i){if(this.initialize(),1===this._collapsedState)return;let t;!0===e&&(t=i.firstChild),t?i.insertBefore(this._element,t):i.appendChild(this._element)}else this.removeParent()},Ut.prototype.removeParent=function(){let t=this._element;t&&t.parentNode&&t.parentNode.removeChild(t)},Ut.prototype.insertBefore=function(t){let e=nt.getElement(t);if(null==e)return void this.setParent(this.getParent());let i=e.parentNode;null!=i&&(this.initialize(),i.insertBefore(this._element,e))},Ut.prototype.getTextContent=function(){return this._rawContent?"string"==typeof this._rawContent?this._rawContent:this._rawContent.textContent:""},Ut.prototype.getTextElement=function(){return this._textSpan},Ut.prototype.getWidth=function(){return this._width>=0?this._width:this._element.offsetWidth},Ut.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)},Ut.prototype.getHeight=function(){return this._height>=0?this._height:this._element.offsetHeight},Ut.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)},Ut.prototype.fillParentWidth=function(t){return!1},Ut.prototype.fillParentHeight=function(t){return!1},Ut.prototype.show=function(t){let e=!1!==t;e!==this._visible&&(this._visible=e,this._updateDisplay())},Ut.prototype.isVisible=function(){return this._visible},Ut.prototype.getScrollLeft=function(){return 0},Ut.prototype.getScrollTop=function(){return 0},Ut.prototype.isEndOfHorizontalScroll=function(){return!0},Ut.prototype.isEndOfVerticalScroll=function(){return!0},Ut.prototype.hasElement=function(){return null!==this._element},Ut.prototype.getSection=function(){return this._section},Ut.prototype.initialize=function(){return null==this._aligner&&(nt.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},Ut.prototype.updateIcon=function(t){if(!t)return;let e=this._frontIcon;if(e){if(e.containItem(t))return;e.clearItems()}this.insertFrontIcon(t,0)},Ut.prototype.removeIcon=function(){let t=this._frontIcon;t&&(t.clearItems(),this._element.removeChild(t.getElement()),t=this._frontIcon=null)},Ut.prototype.isFrozen=nt._deprecatedFunction,Ut.prototype.freezeLayout=nt._deprecatedFunction,Ut.prototype.setAutoContentClipping=nt._deprecatedFunction,Ut.prototype.setContentTooltip=function(t){return!(null==t||!this._content)&&(this._content.setAttribute("title",t),!0)},Ut.prototype.lockContent=function(t){this._contentLocked=!1!==t},Ut.prototype.reset=function(){if(!this._element)return;let 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();let i=this.blinkState;i&&(i.timerId>=0&&clearInterval(i.timerId),delete this.blinkState),delete this.trendState;let n=this.blinking;n&&(n.blinking>=0&&clearTimeout(n.blinking),n.cell=null,n.styles=null,delete this.blinking),this.removeIcon(),this.setContent(null),this._textSpan&&(this._textSpan.className="text",this._textSpan.textContent="")},Ut.prototype.resetClass=function(){let t="cell";this.hasClass("spanned")&&(t+=" spanned"),this.hasClass("selected-row")&&(t+=" selected-row"),this.hasClass("highlighted-row")&&(t+=" highlighted-row"),this.setClass(t)},Ut.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)},Ut.prototype.insertFloatingIcon=function(t,e){if(!t)return;let i=this._floatingPanel;i||(i=this._floatingPanel=new Wt),i.insertItem(t,e),i.addClass("floating-panel");let n=this._element;n.contains(i.getElement())||n.appendChild(i.getElement())},Ut.prototype.removeFloatingIcon=function(t){let e=this._floatingPanel;if(!e)return null;let i=e.removeItem(t);return e.hasItem()||(this._element.removeChild(e.getElement()),this._floatingPanel=null),i},Ut.prototype.insertFrontIcon=function(t,e){if(!t)return;let i=this._frontIcon;i||(i=this._frontIcon=new Wt),i.insertItem(t,e),i.addClass("front-panel");let n=this._element;n.contains(i.getElement())||n.insertBefore(i.getElement(),n.firstChild)},Ut.prototype.removeFrontIcon=function(t){let e=this._frontIcon;if(!e)return null;let i=e.removeItem(t);return e.hasItem()||(i=e.getElement(),this._element.removeChild(i),this._frontIcon=null),i},Ut.prototype.getCellId=function(){return this._id},Ut.prototype.updatePadding=function(){},Ut.prototype.collapse=function(t,e){let i,n=!1!==t;return i=n?e?2:1:0,this._collapsedState!==i&&(n?e?this.addClass("spanned"):this.setParent(null):2===this._collapsedState&&this.removeClass("spanned"),this._collapsedState=i,!0)},Ut.prototype.isCollapsed=function(){return 0!==this._collapsedState},Ut.prototype.isKeptInDoc=function(){return 1!==this._collapsedState},Ut.prototype.getClientWidth=function(){return this._element?this._element.clientWidth:this.getWidth()},Ut.prototype.getClientHeight=function(){return this._element?this._element.clientHeight:this.getHeight()},Ut.prototype._setRawContent=function(t){if(this._rawContent!==t){this._rawContent=t;let 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();let t=this._aligner;for(;t.lastChild;)t.removeChild(t.lastChild);this._content&&t.appendChild(this._content)}}return this._content},Ut.prototype._updateDisplay=function(){let t=!1;this.isVisible()&&this._width&&this._height&&(t=!0),this._element.style.display=t?"":"none"},Ut._proto=Ut.prototype;var Yt=Ut;let qt=function(){this._ends=[],this._cols=[]};qt.prototype._laneCount=0,qt.prototype._defaultSize=10,qt.prototype._defaultScalability=!0,qt.prototype._homogeneous=!0,qt.prototype._visibility=!0,qt.prototype._ends,qt.prototype._cols,qt.prototype._bits=[1,2,4,8],qt.prototype.hitTest=function(t){if(t<0)return-1;if(t>=this.getTrackSize())return~this._laneCount;let e=-1,i=0;if(this._homogeneous){let n=this._defaultSize;e=Math.floor(t/n),i=(e+1)*n}else e=nt.upperBound(this._ends,t),i=this._ends[e];return(e>=this._laneCount||t>=i)&&(e=~e),e},qt.prototype.dispose=function(){this._cols=this._ends=null},qt.prototype.isAtDefaultSize=function(t){if(this._homogeneous)return!0;if(null!=t){if(!this._isAtDefaultSize(t))return!1}else{for(let t=this._cols.length;--t>=0;)if(!this._isAtDefaultSize(t))return!1;this._homogeneous=!0}return!0},qt.prototype._isAtDefaultSize=function(t){let 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},qt.prototype.isHomogeneous=function(){return this._homogeneous},qt.prototype.isAtMinimumSize=function(t){let e=this._getMinimumScalingSize(t);return(null!=t?this.getLaneSize(t):this.getTrackSize())<=e},qt.prototype.isFixedSize=function(){for(let t=0;t<this._laneCount;++t)if(this.getLaneScalability(t))return!1;return!0},qt.prototype.clearLaneCustomizations=function(){this._ends.length=0,this._cols.length=0,this._homogeneous=!0},qt.prototype.getLaneCount=function(){return this._laneCount},qt.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))},qt.prototype.getDefaultLaneSize=function(){return this._defaultSize},qt.prototype.setDefaultLaneSize=function(t){return t<0&&(t=0),this._defaultSize!==t&&(this._defaultSize=t,this._markDirtyIndex(0),!0)},qt.prototype.getLaneDefaultSize=function(t){if(t<0||t>=this._laneCount)return-1;let e=this._newColumn(t);return e.defaultSize?e.defaultSize:-1},qt.prototype.setLaneDefaultSize=function(t,e){if(!(t<0||t>=this._laneCount)&&e>=0){this._newColumn(t).defaultSize=e}},qt.prototype.resetLaneToDefaultSize=function(){let t=!1;for(let e=0;e<this._laneCount;++e){let 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},qt.prototype.getDefaultScalability=function(){return this._defaultScalability},qt.prototype.setDefaultScalability=function(t){return this._defaultScalability!==t&&(this._defaultScalability=t,!0)},qt.prototype.getTrackSize=function(){return!this._visibility||this._laneCount<=0?0:this._homogeneous?this._laneCount*this._defaultSize:(this._updateEndPoints(),this._ends[this._laneCount-1])},qt.prototype.setTrackSize=function(t){let e=0,i=0,n=[];for(e=0;e<this._laneCount;++e){let t=this._cols[e];t?t.invisibility||(!1!==this._getLaneScalability(t)?n.push(e):i+=this._getFixedSize(t)):n.push(e)}if(n.length<=0)return null;let o=this._distributeLaneSize(t-i,n),r=!1,s=[];for(e=o.length;--e>=0;){s[e]=0;let t=o[e];if(null!=t){let i=this.getLaneSize(e);this._newColumn(e),this._setCalculatedLaneSize(e,t)&&(s[e]=t-i,r=!0)}}return r?s:null},qt.prototype.getLaneStart=function(t){if(t<=0)return 0;if(this._homogeneous)return t*this._defaultSize;this._updateEndPoints();let e=t-this._laneCount,i=0;return e>0&&(t-=e,i=e*this._defaultSize),this._ends[t-1]+i},qt.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]))},qt.prototype.getLaneSize=function(t){if(this._visibility){let e=this._cols[t];return e?e.actualSize:this._defaultSize}return 0},qt.prototype.getCustomLaneSize=function(t){let e=this._cols[t];return e&&null!=e.customSize?e.customSize:this._defaultSize},qt.prototype.setLaneSize=function(t,e){if(t<0||t>=this._laneCount)return!1;if(e<0||e!=e)return!1;let i=this._cols[t];return(null==i||i.customSize!==e)&&(i=this._newColumn(t),i.customSize=e,this._setCalculatedLaneSize(t,e))},qt.prototype.setLaneProperty=function(t,e,i){if(t<0||t>=this._laneCount)return!1;let n=this._cols[t];return(null==n||n[e]!==i)&&(n=this._newColumn(t),n[e]=i,!0)},qt.prototype.getLaneProperty=function(t,e){let i=this._cols[t];return i&&null!=i[e]?i[e]:null},qt.prototype.getMinimumLaneSize=function(t){let e=this._cols[t];return e&&null!=e.minSize?e.minSize:0},qt.prototype.setMinimumLaneSize=function(t,e,i){if(t<0||t>=this._laneCount)return!1;if(e<0&&(e=0),this.getMinimumLaneSize(t)!==e){let n=this._newColumn(t);return n.minSize=e,i&&this.getLaneScalability(t)&&(n.customSize=e),this._setCalculatedLaneSize(t)}return!1},qt.prototype.isLaneVisible=function(t){let e=this._cols[t];return!e||!e.invisibility},qt.prototype.showLane=function(t,e){return this.hideLane(t,!1===e)},qt.prototype.hideLane=function(t,e,i){if(t<0||t>=this._laneCount)return!1;let n=this._newColumn(t),o=!n.invisibility,r=null!=i?this._bits[i]:1;return!1!==e?n.invisibility|=r:n.invisibility&=~r,o!==!n.invisibility&&this._setCalculatedLaneSize(t)},qt.prototype.getLaneVisibilityBit=function(t,e){if(t>=0&&t<this._laneCount){let i=this._cols[t];if(i){let t=null!=e?this._bits[e]:1;if(i.invisibility&t)return!1}}return!0},qt.prototype.show=function(t){if(t=!1!==t,this._visibility!==t)if(this._visibility=t,t)for(let t=0;t<this._laneCount;++t)this._newColumn(t),this._setCalculatedLaneSize(t);else this._markDirtyIndex(0)},qt.prototype.getLaneScalability=function(t){let e=this._cols[t];return e&&null!=e.scalability?e.scalability:this._defaultScalability},qt.prototype.setLaneScalability=function(t,e){if(t<0||t>=this._laneCount)return!1;let i=this._cols[t];return(!i||i.scalability!==e)&&(i=this._newColumn(t),i.scalability=e,!0)},qt.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);let i=this.serializeLane(t);return this._cols.splice(t,e),this._laneCount-=e,i},qt.prototype.insertLane=function(t,e){t<0&&(t=0);let i=1;if(nt.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),nt.insertEmptyItems(this._cols,t,i),e){let n=t+i;for(let i=t;i<n;++i)this.deserializeLane(i,e)}},qt.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)return;let i=t<e?t:e;this._markDirtyIndex(i),nt.moveArrayItem(this._cols,t,e)},qt.prototype.serializeLane=function(t){if(t<0||t>=this._laneCount)return null;let e={};e.index=t;let i=this._cols[t];return i?(e.size=i.customSize,e.minSize=i.minSize,e.visible=!i.invisibility,e.scalable=i.scalability,e):e},qt.prototype.deserializeLane=function(t,e){if(!e)return;if(t<0||t>=this._laneCount)return;let i=e.size;null!=i&&this.setLaneSize(t,i),i=e.minSize,null!=i&&this.setMinimumLaneSize(t,i),i=e.visible,null!=i&&this.showLane(t,i),i=e.scalable,null!=i&&this.setLaneScalability(t,i)},qt.prototype._updateEndPoints=function(){let t=this._ends.length;if(t>=this._laneCount)return;this._ends.length=this._laneCount;let 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},qt.prototype._setCalculatedLaneSize=function(t,e){let i=this._cols[t];if(this._visibility&&!i.invisibility){if(null==e&&(e=null!=i.customSize?i.customSize:this._defaultSize),!i.scalability){let t=null!=i.minSize?i.minSize:0;e<t&&(e=t)}}else e=0;return i.actualSize!==e&&(i.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(t),!0)},qt.prototype._getMinimumScalingSize=function(t){let e=0;if(null!=t){let e=this._cols[t];if(!e.invisibility&&null!=e.minSize)return!1===this._getLaneScalability(e)&&null!=e.customSize&&e.customSize>e.minSize?e.customSize:e.minSize}else for(let t=this._laneCount;--t>=0;)e+=this._getMinimumScalingSize(t);return e},qt.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},qt.prototype._getLaneScalability=function(t){return null==t.scalability?this._defaultScalability:t.scalability},qt.prototype._distributeLaneSize=function(t,e){if(e.length<=0)return[];t<0&&(t=0);let i=0,n=0,o=0,r=0,s=[],l=[],a=[];for(i=e.length;--i>=0;)o=e[i],s[o]=this.getMinimumLaneSize(o),l[o]=this.getCustomLaneSize(o),n+=l[o];let u=!0;for(;u;)for(u=!1,i=e.length;--i>=0;){o=e[i];let h=s[o],p=l[o];r=t*p/n,r<=h&&(u=!0,a[o]=h,t-=h,n-=p,e.splice(i,1))}let h=e.length-1,p=0,d=0;for(i=h;--i>=0;){o=e[i],r=t*l[o]/n;let s=Math.floor(r);d+=r-s,d>=1&&(++s,--d),a[o]=s,p+=s}return a[e[h]]=Math.floor(t-p),a},qt.prototype._markDirtyIndex=function(t){t<this._ends.length&&(this._ends.length=t)},qt.prototype._newColumn=function(t){let e=this._cols[t];return e||(this._cols[t]=e={},e.invisibility=0),e},qt.prototype.copyFrom=function(t,e){if(this._homogeneous&&t._homogeneous&&this._defaultSize===t._defaultSize)return;e||(e=0);let i=t.getLaneCount(),n=this.getLaneCount(),o=e+i;o>n&&(o=n);let r=0;for(let i=e;i<o;++i){let e=t.getLaneSize(r++),n=this._newColumn(i);n.customSize!==e&&(n.customSize=e,n.actualSize!==e&&(n.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(i)))}};var Xt=qt;let jt=function(){};jt.prototype.hitTest=function(t,e,i){},jt.prototype.hitTestX=function(t){},jt.prototype.hitTestY=function(t){},jt.prototype.getDefaultColumnWidth=function(){},jt.prototype.setDefaultColumnWidth=function(t){},jt.prototype.getDefaultRowHeight=function(){},jt.prototype.setDefaultRowHeight=function(t){},jt.prototype.getColumnWidth=function(t){},jt.prototype.setColumnWidth=function(t,e){},jt.prototype.getRowHeight=function(t){},jt.prototype.setRowHeight=function(t,e){},jt.prototype.isColumnVisible=function(t){},jt.prototype.hideColumn=function(t,e){},jt.prototype.isRowVisible=function(t){},jt.prototype.hideRow=function(t,e){},jt.prototype.getMinimumColumnWidth=function(t){},jt.prototype.setMinimumColumnWidth=function(t,e){},jt.prototype.getMinimumRowHeight=function(t){},jt.prototype.setMinimumRowHeight=function(t,e){},jt.prototype.getCellLeft=function(t){},jt.prototype.getCellTop=function(t){},jt.prototype.getCellWidth=function(t,e){},jt.prototype.getCellHeight=function(t,e){},jt.prototype.hasCellSpan=function(){},jt.prototype.getCellRowSpan=function(t,e){},jt.prototype.setCellRowSpan=function(t,e,i){},jt.prototype.getCellColSpan=function(t,e){},jt.prototype.setCellColSpan=function(t,e,i){},jt.prototype.clearCellSpans=function(){},jt.prototype.clearColumnSpans=function(t){},jt.prototype.clearColumnCustomizations=function(){},jt.prototype.clearRowCustomizations=function(){},jt.prototype.getColumnScalability=function(t){},jt.prototype.setColumnScalability=function(t,e){},jt.prototype.getRowScalability=function(t){},jt.prototype.setRowScalability=function(t,e){},jt.prototype.getCell=function(t,e,i){},jt.prototype.getCellContent=function(t,e){},jt.prototype.setCellContent=function(t,e,i){},jt.prototype.getColumn=function(t){},jt.prototype.getColumnCount=function(){},jt.prototype.setColumnCount=function(t){},jt.prototype.getRowCount=function(){},jt.prototype.setRowCount=function(t,e){},jt.prototype.getVisibleRowCount=function(){},jt.prototype.addRow=function(t){},jt.prototype.removeRow=function(t){},jt.prototype.setBorders=function(t,e,i,n){},jt.prototype.getColumnStyle=function(t,e){},jt.prototype.setColumnStyle=function(t,e,i){},jt.prototype.enableColumnClass=function(t,e,i){},jt.prototype.hasColumnClass=function(t,e){},jt.prototype.enableRowClass=function(t,e,i){},jt.prototype.setRowStyle=function(t,e,i,n){},jt.prototype.getRelativePosition=function(t){},jt.prototype.getContentWidth=function(){},jt.prototype.getContentHeight=function(){},jt.prototype.getCellsByRowIndex=function(t){},jt.prototype.disableHorizontalGridLine=function(t){},jt.prototype.disableVerticalGridLine=function(t){},jt.prototype.enableShading=function(t){},jt.prototype.setTransposedShading=function(t){},jt.prototype.enableRowHighlighting=function(t){},jt.prototype.getRowHighlight=function(){},jt.prototype.setRowHighlight=function(t){},jt.prototype.getSelectedRows=function(){},jt.prototype.getSelectedRowCount=function(){},jt.prototype.isSelectedRow=function(t){},jt.prototype.getRowAnchor=function(){},jt.prototype.setRowAnchor=function(t){},jt.prototype.setSelectedRow=function(t,e){},jt.prototype.selectSingleRow=function(t){},jt.prototype.selectRowRange=function(t,e){},jt.prototype.clearSelectedRows=function(){},jt.prototype.getFirstSelectedRow=function(){},jt.prototype.getLastSelectedRow=function(){},jt.prototype.activateColumn=function(t,e){},jt.prototype.activateRows=function(t,e,i){},jt.prototype.moveRowsToTop=function(t){},jt.prototype.getFirstIndexInView=function(){},jt.prototype.getLastIndexInView=function(){},jt.prototype.isInCurrentView=function(t){},jt.prototype.getFrozenLayout=function(){},jt.prototype.setFrozenLayout=function(t){},jt.prototype.insertColumn=function(t,e){},jt.prototype.removeColumnAt=function(t){},jt.prototype.moveColumn=function(t,e){},jt.prototype.enableRowVirtualization=function(t){},jt.prototype.enableColumnVirtualization=function(t){},jt.prototype.getColumnIndex=function(t){},jt.prototype.getCellIndex=function(t,e){},jt.prototype.getIndex=function(){},jt.prototype.setIndex=function(t){},jt.prototype.getRowOffset=function(){},jt.prototype.setRowOffset=function(t){},jt.prototype.updateLayout=function(){},jt.prototype.stretchCell=function(t,e,i,n){},jt.prototype.unstretchCell=function(t,e){},jt.prototype.unstretchAllCells=function(){},jt.prototype.getStretchedCell=function(t,e){},jt.prototype.getStretchedCells=function(){},jt.prototype.updateStretchedCells=function(){},jt.prototype.getColumnHost=function(){},jt.prototype.setHidingMethod=function(t){},jt.prototype.getHidingMethod=function(){},jt.prototype.setColumnVisibility=function(t,e,i){},jt.prototype.getRowLayout=function(){},jt.prototype.reserveRightSpace=function(t){},jt.prototype.getReservedSpace=function(){},jt.prototype.getComputedStyle=function(){},jt.prototype.isColumnActive=function(t){},jt.prototype.setRowAttributes=function(t,e){},jt.prototype.getContextRow=function(t){},jt.prototype.selectColumn=function(t,e){},jt.prototype.isSelectedColumn=function(t){},jt.prototype.selectCell=function(t,e,i){},jt.prototype.setCellBounds=function(t,e,i,n){},jt.prototype.getHorizontalLayout=function(){},jt.prototype.calculateColumnBounds=function(t,e,i,n){},jt.prototype.updateColumnBounds=function(t,e,i){},jt.prototype.updateColumnSeparators=function(){};let Kt=function(t){(this._element=document.createElement("div")).className="column",this._cells=[],this._section=t};l.inherits(Kt,Bt),Kt.prototype._nextSibling=null,Kt.prototype._parent=null,Kt.prototype._section=null,Kt.prototype._cells=null,Kt.prototype._cellStart=0,Kt.prototype._cellEnd=0,Kt.prototype._autoStyleUpdating=!1,Kt.prototype._deactivation=!1,Kt.prototype._sizeClasses=null,Kt.prototype._colLeft=0,Kt.prototype._absolute=!1,Kt.prototype._scrollFrame=null,Kt.prototype._invisibility=0,Kt.prototype._bits=[1,2,4,8],Kt.prototype._pinned=!0,Kt.prototype.clearContent=function(){for(let t=this._cells.length;--t>=0;)this._cells[t].setContent(null)},Kt.prototype.setLeft=function(t){return this._colLeft=t,this._absolute&&(this._element.style.left=t+"px"),!0},Kt.prototype.enableAbsolutePosition=function(t){(t=!1!==t)!==this._absolute&&(this._absolute=t,this._element.style.left=t?this._colLeft+"px":"")},Kt.prototype.dispose=function(){this._dispose();for(let t=this._cells.length;--t>=0;)this._cells[t].dispose();this._scrollFrame=this._nextSibling=this._parent=this._cells=this._section=null},Kt.prototype.setStyle=function(t,e){let 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")},Kt.prototype.setStyles=function(t){let e=this._element,i=e.style;for(let e in t)i[e]=t[e];e.style.backgroundColor?e.classList.contains("no-shading")||e.classList.add("no-shading"):e.classList.contains("no-shading")&&e.classList.remove("no-shading")},Kt.prototype.show=function(t){this.setVisibility(0,!1!==t)},Kt.prototype.setWidth=function(t){this._element.style.width=t+"px";let e,i=0;t>0&&t<=24?i=3:t>24&&t<=40?i=2:t>40&&t<60&&(i=1);let n=this._sizeClasses;if(n){if(n.length>i){for(e=n.length;--e>=i;)this.removeClass(n[e]);n.length=i}i||(this._sizeClasses=null)}if(i)for(n||(n=[],this._sizeClasses=n),e=n.length;e<i;++e)n[e]=Kt._sizeClasses[e],this.addClass(n[e]);return this.setVisibility(1,t>0),!0},Kt._sizeClasses=["small-col","very-small-col","tiny-col"],Kt.prototype.setHeight=function(t){return this._element.style.height=t+"px",this.setVisibility(2,t>0),!0},Kt.prototype.getParent=function(){return this._parent},Kt.prototype.setParent=function(t,e){if(!this._element)return;this._parent=nt.getElement(t);let i=this._section?this._section.getHidingMethod():"";this._invisibility&&!i||this._setParent(this._parent,e)},Kt.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())},Kt.prototype.enableAutoStyleUpdating=function(t){t=!1!==t,this._autoStyleUpdating!==t&&(this._autoStyleUpdating=t)},Kt.prototype.setNextSibling=function(t){this._nextSibling=t},Kt.prototype.isActive=function(){return!(this._invisibility&this._bits[3])},Kt.prototype.disableDeactivation=function(t){this._deactivation=!1!==t,this._deactivation&&(this.isActive()||this.activate())},Kt.prototype.activate=function(t){return t=this._pinned||this._deactivation||!1!==t,this.isActive()!==t&&(this.setVisibility(3,t),!0)},Kt.prototype.deactivate=function(t){this.activate(!1===t)},Kt.prototype.setCellCount=function(t){let e;for(e=this._cells.length;e<t;++e)this._cells.push(new Yt(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)},Kt.prototype.getCell=function(t){return this._cells[t]||null},Kt.prototype.collapseCells=function(t,e,i,n,o){if(e<=0)return;let r=!1,s=this._cells[t];s&&!n&&(r|=s.collapse(i,o));for(let n=1;n<e&&(s=this._cells[t+n],s);++n)r|=s.collapse(i,o);r&&(i?e>1&&(this._hasCollapsedCells=!0):this.updateCellOrders())},Kt.prototype.uncollapseAllCells=nt._deprecatedFunction,Kt.prototype.activateCells=function(t,e){let i,n=this._element;if(this._hasCollapsedCells)t=this._cellEnd,e>this._cellEnd&&(this._cellEnd=e);else if(this._cellStart===t){let 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){let t=this._cells[i];t.isKeptInDoc()&&(t.initialize(),n.appendChild(t.getElement()))}},Kt.prototype.moveCellsToTop=function(t){if(!this.isActive())return;let e=this._element;for(let i=0;i<t;++i){let t=this._cells[i];t.isKeptInDoc()&&e.appendChild(t.getElement())}this._cells=nt.cycleArray(this._cells,t)},Kt.prototype.updateCellOrders=function(){this._hasCollapsedCells=!1;let t=this._element;for(let e=this._cellStart;e<this._cellEnd;++e){let i=this._cells[e];i.isKeptInDoc()?t.appendChild(i.getElement()):this._hasCollapsedCells=!0}},Kt.prototype.hasCollapsedCells=function(){return this._hasCollapsedCells},Kt.prototype.getCellIndex=function(t){if(!t)return-1;for(let e=this._cellStart;e<this._cellEnd;++e){if(this._cells[e].getElement()===t)return e}return-1},Kt.prototype.getSection=function(){return this._section},Kt.prototype.log=function(){let t=[],e=this._cells.length;for(let i=0;i<e;++i)t.push(this._cells[i].getTextContent());return t},Kt.prototype.getVisibility=function(){return!this._invisibility},Kt.prototype.setVisibility=function(t,e){let i=!this._invisibility,n=this._bits[t]||1;e?this._invisibility&=~n:this._invisibility|=n;let o=!this._invisibility;if(i!==o)if(this._section?this._section.getHidingMethod():"")this.enableClass("hidden",!o);else if(o){let t=this._parent;if(!t)return;let e=this._nextSibling;for(;e;){if(e._parent!==t){e=null;break}if(!e._invisibility)break;e=e._nextSibling}this.insertBefore(e)}else this._setParent(null)},Kt.prototype.updateLayout=function(){},Kt.prototype.setScrollState=function(t,e,i){this._scrollFrame=t,this.enableAbsolutePosition(i),this.setParent(e||this._section.getColumnHost()),e||this.activate(),this._pinned=!e},Kt._proto=Kt.prototype;var Jt=Kt;let Qt=function(){this._items=[]};Qt.prototype._items=null,Qt.prototype.dispose=function(){this._items=null},Qt.prototype.setItemCount=function(t){let e=this._items,i=e.length;if(i!==t)for(e.length=t;i<t;)e[i++]={}},Qt.prototype.getItem=function(t){return this._items[t]||null},Qt.prototype.moveItemsToTop=function(t){this._items=nt.cycleArray(this._items,t)};var Zt=Qt;let $t=function(t,e,i){t.setTop(e.getLaneStart(i)),t.setHeight(e.getLaneSize(i))},te=function(t,e,i,n){if(i){let o=e.getLaneStart(i);t.setLeft(o),t.setWidth(n-o)}else t.setStyle("left",""),t.setWidth(n)},ee=function(t,e,i){this._trackX=t,this._trackY=e,this._section=i,this._cells=[]};ee.prototype._trackX,ee.prototype._trackY,ee.prototype._section,ee.prototype._cells,ee.prototype._activeCount=0,ee.prototype._stretchSize=0,ee.prototype.dispose=function(){let t=this._cells;if(this._activeCount){this._activeCount=0;for(let e=t.length;--e>=0;){let i=t[e];i&&i.dispose()}}t.length=0},ee.prototype.setStretchSize=function(t){this._stretchSize=t},ee.prototype.getStretchSize=function(){return this._stretchSize},ee.prototype.setCellCount=function(t){let 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;){let t=e[i];t&&t.dispose()}e.length=t}},ee.prototype.getCell=function(t){let e=this._cells[t];return e&&e.getParent()?e:null},ee.prototype.getCells=function(){let t=[];if(this._activeCount){let e=this._cells,i=e.length;for(let n=0;n<i;++n){let i=e[n];i&&i.getParent()&&t.push(i)}this._activeCount=t.length}return t},ee.prototype.getColumnIndex=function(t){if(t){if(!t.getElement)return null!=t._colIndex?t._colIndex:-1;{let e=t.getElement();if(e)return null!=e._colIndex?e._colIndex:-1}}return-1},ee.prototype.getRowIndex=function(t){if(t){if(t.getElement)return t.getParent()?this._cells.indexOf(t):-1;{let e=this._cells,i=e.length;for(let n=0;n<i;++n){let i=e[n];if(i&&i.getParent()&&i.getElement()===t)return n}}}return-1},ee.prototype.stretchCell=function(t,e){++this._activeCount,(!e||e<0)&&(e=0);let i=this._cells[t]||null;i||(i=new Yt(null,this._section),i.addClass("tr-stretched"),i.stretched=!0,this._cells[t]=i);let n=i.getElement();n.stretched=!0,n._colIndex!==e&&(n._colIndex=e,e>0?n.classList.add("right-stretching"):n.classList.remove("right-stretching")),n._rowIndex!==t&&(n._rowIndex=t);let o=this._stretchSize||this._trackX.getTrackSize();return te(i,this._trackX,e,o),$t(i,this._trackY,t),i},ee.prototype.unstretchCell=function(t){let e=this._cells[t]||null;return e&&e.setParent(null),e},ee.prototype.unstretchAllCells=function(){if(this._activeCount){this._activeCount=0;let t=this._cells;for(let e=t.length;--e>=0;){let i=t[e];i&&i.setParent(null)}}},ee.prototype.updateCells=function(){if(this._activeCount){let t=0,e=this._cells,i=e.length,n=this._trackX,o=this._trackY,r=this._stretchSize||n.getTrackSize();for(let s=0;s<i;++s){let i=e[s];i&&i.getParent()&&(++t,te(i,n,i.getElement()._colIndex,r),$t(i,o,s))}this._activeCount=t}},ee.prototype.updateXAxis=function(){if(this._activeCount){let t=0,e=this._cells,i=e.length,n=this._trackX,o=this._stretchSize||n.getTrackSize();for(let r=0;r<i;++r){let i=e[r];i&&i.getParent()&&(++t,te(i,n,i.getElement()._colIndex,o))}this._activeCount=t}},ee.prototype.updateYAxis=function(){if(this._activeCount){let t=0,e=this._cells,i=e.length,n=this._trackY;for(let o=0;o<i;++o){let i=e[o];i&&i.getParent()&&(++t,$t(i,n,o))}this._activeCount=t}},ee.prototype.moveCellsToTop=function(t){this._activeCount&&(this._cells=nt.cycleArray(this._cells,t),this.updateYAxis())};var ie=ee;let ne=function(t,e){this.indexX=t,this.indexY=e};ne.prototype.isSpanIndices=function(t,e){return t===this.indexX&&e===this.indexY},ne.prototype.isOccupiedIndices=function(t,e){return t!==this.indexX||e!==this.indexY},ne.prototype.register=function(t,e){this._register(t,e,!0)},ne.prototype.unregister=function(t,e){this._register(t,e,!1)},ne.prototype._register=function(t,e,i){let n=t.indexOf(this);i?n<0&&t.push(this):n>=0&&t.splice(n,1);let o=i?this:null,r=this.indexX+this.colSpan,s=this.indexY+this.rowSpan;for(let t=this.indexX;t<r;++t)for(let i=this.indexY;i<s;++i)e[t+","+i]=o},ne.prototype.indexX,ne.prototype.indexY,ne.prototype.colSpan=1,ne.prototype.rowSpan=1,ne.prototype.prevColSpan=1,ne.prototype.prevRowSpan=1,ne.prototype.retVal=0;var oe=ne;let re=function(){this._spans=[],this._occupiedMap={}};re.prototype.removeColumn=function(t){let e=!1;return this.removeSpanByColIndex(t)&&(e=!0),this.shiftColumn(t,-1)&&(e=!0),e},re.prototype.freezeMapping=function(t){this._frozenMapping=!1!==t,this._frozenMapping||this._mapCellSpans()},re.prototype._mapCellSpans=function(){let t,e,i=this._spans;for(this._spans=[],this._occupiedMap={},t=i.length;--t>=0;)e=i[t],e.indexX>=0&&e.register(this._spans,this._occupiedMap)},re.prototype.shiftColumn=function(t,e){if(this._spans.length<=0||0===e)return!1;let i=!1;for(let n=this._spans.length;--n>=0;){let o=this._spans[n];o.indexX>=t&&(i=!0,o.indexX+=e)}return!(!i||this._frozenMapping)&&(this._mapCellSpans(),!0)},re.prototype.removeSpan=function(t,e){if(this._spans.length<=0)return null;let i=t+","+e,n=this._occupiedMap[i];return!n||n.isOccupiedIndices(t,e)?null:(n.unregister(this._spans,this._occupiedMap),n)},re.prototype.removeSpanByColIndex=function(t,e){let i,n=this._spans.length;if(n<=0)return null;let o,r=e||[],s=0;for(o=0;o<n;++o)i=this._spans[o],i&&i.indexX===t&&(r.push(i),s++);if(s<=0)return null;for(n=r.length,o=0;o<s;++o)r[n-o-1].unregister(this._spans,this._occupiedMap);return r},re.prototype.removeSpanStartedFromRowIndex=function(t,e){let i,n=this._spans.length;if(n<=0)return null;let o,r=e||[],s=0;for(o=0;o<n;++o)i=this._spans[o],i&&i.indexY>=t&&(r.push(i),s++);if(s<=0)return null;for(n=r.length,o=0;o<s;++o)r[n-o-1].unregister(this._spans,this._occupiedMap);return r},re.prototype.clearAllSpans=function(){if(this._spans.length<=0)return null;let t=this._spans;return this._spans=[],this._occupiedMap={},t},re.prototype.hasSpan=function(){return this._spans.length>0},re.prototype.getSpan=function(t,e){let i=this.getOccupyingSpan(t,e);return i&&i.isSpanIndices(t,e)?i:null},re.prototype.getOccupyingSpan=function(t,e){return this._spans.length<=0?null:this._occupiedMap[t+","+e]||null},re.prototype.getAllSpans=function(){return this._spans},re.prototype.getColSpan=function(t,e){let i=this._occupiedMap[t+","+e];return null==i?1:i.isOccupiedIndices(t,e)?i.indexX-t:i.colSpan},re.prototype.getRowSpan=function(t,e){let i=this._occupiedMap[t+","+e];return null==i?1:i.isOccupiedIndices(t,e)?i.indexY-e:i.rowSpan},re.prototype.setColSpan=function(t,e,i){return this._updateSpan(t,e,!0,i)},re.prototype.setRowSpan=function(t,e,i){return this._updateSpan(t,e,!1,i)},re.prototype._updateSpan=function(t,e,i,n){n<1&&(n=1);let o=this.getSpan(t,e);o&&(o.retVal=0);let r,s,l,a,u,h,p=t,d=e,c=o?o.colSpan:1,_=o?o.rowSpan:1,f=!0;if(i){if(c===n)return o;if(c>n)p=t+n,r=t+c,f=!1;else{if(l=this._occupiedMap[t+","+e],l&&l!==o)return o;p=t+c,r=t+n}s=e+_}else{if(_===n)return o;if(_>n)d=e+n,s=e+_,f=!1;else{if(l=this._occupiedMap[t+","+e],l&&l!==o)return o;d=e+_,s=e+n}r=t+c}if(f){let i=[];for(u=p;u<r;++u)for(h=d;h<s;++h){if(a=u+","+h,this._occupiedMap[a])return o;i.push(a)}for(null==o&&(o=new oe(t,e),a=t+","+e,this._spans.push(o),this._occupiedMap[a]=o),u=i.length;--u>=0;)this._occupiedMap[i[u]]=o}else{if(i?n+_<=2:n+c<=2){a=t+","+e;let i=this._spans.indexOf(o);this._spans.splice(i,1),this._occupiedMap[a]=null}for(u=p;u<r;++u)for(h=d;h<s;++h)this._occupiedMap[u+","+h]=null}return i?(o.prevColSpan=o.colSpan,o.colSpan=n):(o.prevRowSpan=o.rowSpan,o.rowSpan=n),o.retVal=f?1:-1,o},re.prototype._spans,re.prototype._occupiedMap,re.prototype._frozenMapping=!1;var se=re;let le=function(){this._selections=[]};le.prototype.clone=function(){let t=new le;return t._selections=this._selections.concat(),t._count=this._count,t._anchor=this._anchor,t._firstIndex=this._firstIndex,t._lastIndex=this._lastIndex,t},le.prototype.toString=function(){return this._selections.join(", ")},le.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))},le.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)},le.prototype.deselectFrom=function(t){if(this._lastIndex<t)return!1;if(this._firstIndex>=t)return this.clearAllSelections(),!0;let e=this._lastIndex,i=this._selections;for(let n=t;n<=e;++n)i[n]&&(i[t]=!1,--this._count);return this._anchor>=t&&(this._anchor=-1),this._lastIndex=this._findPrevSelection(t),!0},le.prototype.toggleSelection=function(t){this._selections[t]?this.deselect(t):this.select(t)},le.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)},le.prototype.selectRange=function(t,e){if(0===e)return;if(t<0&&(t=0),1===e||-1===e)return void this.select(t);let i=t,n=i+e;if(e<0&&(n=i+1,i=n+e),!(i>=n)){this._anchor=t,(this._firstIndex<0||i<this._firstIndex)&&(this._firstIndex=i),(this._lastIndex<0||n>=this._lastIndex)&&(this._lastIndex=n-1);for(let t=i;t<n;++t)this._select(t)}},le.prototype.deselectRange=function(t,e){if(this._count<=0)return;if(t<0&&(t=0),1===e||-1===e)return void this.deselect(t);let i=t+e;if(e<0&&(i=t+1,t=i+e),this._firstIndex>=t&&this._lastIndex<i)return void this.clearAllSelections();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));let n=0;for(n=t;n<i;++n)this._selections[n]&&(this._selections[n]=!1,--this._count)},le.prototype.hasSelection=function(t,e){if(this._count<=0)return!1;let i=t+e;if(e<0&&(i=t+1,t=i+e),i<this._firstIndex||t>this._lastIndex)return!1;for(let e=t;e<i;++e)if(this._selections[e])return!0;return!1},le.prototype.getSelection=function(t){return!0===this._selections[t]},le.prototype.setSelection=function(t,e){return!1!==e?this.select(t):this.deselect(t)},le.prototype.getSelectionAnchor=function(){return this._anchor},le.prototype.setSelectionAnchor=function(t){this._anchor=t},le.prototype.getSelectionCount=function(){return this._count},le.prototype.getFirstSelectedIndex=function(){return this._firstIndex},le.prototype.getLastSelectedIndex=function(){return this._lastIndex},le.prototype.getAllSelections=function(){if(this._count>0){let t=new Array(this._count),e=0,i=this._selections,n=this._lastIndex;for(let o=this._firstIndex;o<=n;++o)i[o]&&(t[e++]=o);return t}return[]},le.prototype.getConnectedRanges=function(t,e){if(this._count>0){let i=[];(null==t||t<this._firstIndex)&&(t=this._firstIndex),(null==e||e>this._lastIndex)&&(e=this._lastIndex+1);let n=null;for(let o=t;o<e;++o)this._selections[o]?n||(n=[o,-1]):n&&(n[1]=o-1,i.push(n),n=null);return n&&(n[1]=this._lastIndex,i.push(n),n=null),i}return[]},le.prototype.getSelectionMap=function(){return this._selections},le.prototype.clearAllSelections=function(){if(this._count>0){let t=0;return this._selections.length=0,this._count=0,this._anchor=-1,this._firstIndex=-1,this._lastIndex=-1,t}return 0},le.prototype.copyFrom=function(t,e,i,n){if(n<=0)return;let o=e+i;if(null!=t)if(!1!==t.hasSelection(e,n)){for(let i=0;i<n;++i)t._selections[e+i]?this.select(o+i):this.deselect(o+i);this._anchor=-1,t._anchor>=0&&t._anchor>=e&&t._anchor<e+n&&(this._anchor=t._anchor+i)}else this.deselectRange(o,n);else this.deselectRange(o,n)},le.prototype._select=function(t){return!this._selections[t]&&(this._selections[t]=!0,++this._count,!0)},le.prototype._findNextSelection=function(t){if(this._lastIndex>=0)for(;++t<=this._lastIndex;)if(this._selections[t])return t;return-1},le.prototype._findPrevSelection=function(t){if(this._firstIndex>=0)for(;--t>=this._firstIndex;)if(this._selections[t])return t;return-1},le.prototype._selections=null,le.prototype._count=0,le.prototype._anchor=-1,le.prototype._firstIndex=-1,le.prototype._lastIndex=-1;var ae=le;let ue=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)};ue.prototype._func=null,ue.prototype._delay=0,ue.prototype._timerId=0,ue.prototype._pending=!1,ue.prototype.start=function(){this._func&&(this._timerId?this._pending=!0:this._timerId=setInterval(this._onInterval,this._delay))},ue.prototype.dispose=function(){this._timerId&&(clearInterval(this._timerId),this._timerId=0),this._func=null},ue.prototype._onInterval=function(){this._pending?this._pending=!1:(this._func(),clearInterval(this._timerId),this._timerId=0)},ue._proto=ue.prototype;var he=ue;let pe=function(){let 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 he(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"),pe._queryNativeTrackThickness(t._onThicknessChanged),t._updateEffectiveArea()||t.listen("thicknessChanged",t._updateEffectiveArea)};l.inherits(pe,Bt),pe.prototype._vertical=!0,pe.prototype._step=0,pe.prototype._parentNode=null,pe.prototype._hostClassName="",pe.prototype._trackContent=null,pe.prototype._panes=null,pe.prototype._paneSliders=null,pe.prototype._enabled=!0,pe.prototype._active=!1,pe.prototype._isFrozen=!1,pe.prototype._otherScrollbar=null,pe.prototype._autoHideScrollbar=!0,pe.prototype._trackSize=120,pe.prototype._tContentSize=0,pe.prototype._tScrollVal=0,pe.prototype._tPercentVal=0,pe.prototype._paneSize=0,pe.prototype._pContentSize=0,pe.prototype._pScrollVal=0,pe.prototype._footerCount=0,pe.prototype._fadingId=0,pe.prototype._postponeFading=!1,pe.prototype._layoutChanged=!1,pe.prototype._contentDirty=!0,pe.prototype._layoutDirty=!0,pe.prototype._touchInput=!0,pe.prototype._swiping=!1,pe.prototype._touchDrag=!1,pe.prototype._startPos,pe.prototype._endPos,pe.prototype._smoothing=!0,pe.prototype._smoothingId=0,pe.prototype._smoothingSpeed=0,pe.prototype._wheelScrolling="",pe.prototype._mouseWheelLogic=null,pe.prototype._onThicknessChanged=null,pe._trackThickness=0,pe._queryTimeout=0,pe._queryStarted=!1,pe._outerDummy=null,pe._innerDummy=null,pe._listeners=null,pe.prototype._updateEffectiveArea=function(){let t=this.getTrackThickness();if(t){let e=this._vertical?"width":"height";this._element.style[e]=t+1+"px"}return!!t},pe._queryNativeTrackThickness=function(t){if(pe._queryStarted||pe._repeatQuery(),t&&pe._trackThickness<=0){let e=pe._listeners;e||(e=pe._listeners=[]),e.push(t)}},pe._repeatQuery=function(){pe._queryStarted=!0,pe._retrieveNativeTrackThinkness()||(pe._queryTimeout+=100,pe._queryTimeout<3e3?setTimeout(pe._repeatQuery,pe._queryTimeout):(pe._trackThickness=13,pe._clearStaticResources()))},pe._retrieveNativeTrackThinkness=function(){if(pe._trackThickness>0)return!0;let t=pe._innerDummy,e=pe._outerDummy;t||(t=pe._innerDummy=document.createElement("p"),t.style.width="100%",t.style.height="200px",e=pe._outerDummy=document.createElement("div"),e.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);let i=t.offsetWidth;e.style.overflow="scroll";let n=t.offsetWidth;return i==n&&(n=e.clientWidth),document.body.removeChild(e),(pe._trackThickness=i-n)>0&&(pe._clearStaticResources(),!0)},pe._clearStaticResources=function(){pe._innerDummy=pe._outerDummy=null;let t=pe._listeners;if(t){pe._listeners=null;let e={};for(let i=t.length;--i>=0;)t[i](e)}},pe.updateTrackThickness=function(){pe._trackThickness=0,pe._queryTimeout=0,pe._queryStarted=!1,pe._queryNativeTrackThickness()},pe.prototype.dispose=function(){let t=pe._listeners;if(t){let 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(let t=this._panes.length;--t>=0;)this._panes[t].dispose(),this._paneSliders[t].dispose();this._reverter.dispose()},pe.prototype.getContent=function(t){return this._paneSliders[0].getContent(t)},pe.prototype.getParent=function(){return this._parentNode},pe.prototype.setParent=function(t,e){let i=nt.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)},pe.prototype.attachToExternalElement=function(t){this.setParent(t);let 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"},pe.prototype._onActiveStateChange=function(){let 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);let 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()},pe.prototype._onEnablingStateChange=function(){let t=this;t._enabled?t._dispatch("enabled",{}):t._dispatch("disabled",{})},pe.prototype.isActive=function(){return this._active},pe.prototype.isEnabled=function(){return this._enabled},pe.prototype.enable=function(t){t=!1!==t,this._enabled!=t&&(this._enabled=t,this._updateLayout(),this._onEnablingStateChange())},pe.prototype.disable=function(t){this.enable(!1===t)},pe.prototype.getTrackSize=function(){return this._trackSize},pe.prototype.getPaneSize=function(){return this._paneSize},pe.prototype.getContentSize=function(){return this._pContentSize},pe.prototype.getTrackThickness=function(){return pe._trackThickness},pe.prototype.getScrollGap=function(){return this._pContentSize-this.getPaneSize()},pe.prototype.setTrackSize=function(t,e){this._trackSize=t>0?t:0,this._paneSize=e>0?e:0},pe.prototype.calculateContentSize=function(){return 0},pe.prototype.update=function(){if(this._contentDirty){this._contentDirty=!1;let 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)},pe.prototype.invalidate=function(t,e){this._contentDirty=!0,this._layoutDirty=!0,null!=e&&(this._pScrollVal=e),t&&this.update()},pe.prototype.invalidateContent=function(){this._contentDirty=!0},pe.prototype.isScrollPosValid=function(t){let e=t-this.getPaneSize(),i=this._pScrollVal;return 0===i||i>0&&e>0&&i<e},pe.prototype.flash=function(){this.update(),this._flash()},pe.prototype._scroll=function(t){this._scrollTo(this._pScrollVal+t)},pe.prototype._scrollTo=function(t,e){if(!this._active&&!e)return;t=this._calcProperScrollValue(t);let 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",{})},pe.prototype._calcProperScrollValue=function(t){if(!t||t-.5<0)return 0;if(this._tPercentVal>=1&&Math.abs(this._pScrollVal-t)<=2)return this._pScrollVal;let e=this.getScrollGap();if(e<=0)return 0;if(t+.5>=e)return e;let 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)},pe.prototype._convertTrackToPane=function(t){t=Math.round(t);let e=this._getTrackGap();this._tPercentVal>=1&&Math.abs(this._tScrollVal-t)<=5&&(t=e),this._tScrollVal=t,this._tPercentVal=e?t/e:0;let i=this.getScrollGap();return e===i?t:this._tPercentVal*i},pe.prototype._setTrackScrollVal=function(t){let e=this._getTrackGap(),i=0;if(e>0){if(t>0){let n=this.getScrollGap();i=e===n?t:t/n*e,i=Math.round(i)}i>=e&&(i=e)}if(i!==this._tScrollVal){this._tScrollVal=i,this._tPercentVal=e?i/e:0;let t=this._element;return this._vertical?t.scrollTop=i:t.scrollLeft=i,!0}return!1},pe.prototype._getTrackGap=function(){let t=this._tContentSize-this.getTrackSize();return t>0?t:0},pe.prototype._getScrollValue=function(){return this._pScrollVal},pe.prototype._isEndOfScroll=function(){return!this._active||this._pScrollVal>=this.getScrollGap()},pe.prototype._isStartOfScroll=function(){return!this._pScrollVal},pe.prototype._isOnEdge=function(t){return t<0&&this._isStartOfScroll()||t>0&&this._isEndOfScroll()},pe.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)))},pe.prototype._clearAllPanes=function(){for(let t=this._panes.length;--t>=0;){this._panes[t].setParent(null);let e=this._paneSliders[t];e._content=e._columns=null;let i=e.getElement();for(;null!==i.firstChild;)i.removeChild(i.firstChild)}},pe.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))},pe.prototype.disableTouchInput=function(t){this._touchInput=!1===t},pe.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))},pe.prototype.getAutoHide=function(){return this._autoHideScrollbar},pe.prototype.setOtherScrollbar=function(t){this._otherScrollbar=t},pe.prototype.setFooterCount=function(t){this._footerCount=t},pe.prototype._calcActiveState=function(){if(this._enabled&&this.getTrackSize()>20){let t=this.getPaneSize();if(t>0)return this._pContentSize-t>0}return!1},pe.prototype._updateLayout=function(){let t=this._calcActiveState();if(t!==this._active&&(this._active=t,this._onActiveStateChange()),!this._active)return;let 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(let t=this._panes.length;--t>=0;)this._panes[t].setWidth(i)}this._scrollTo(this._pScrollVal,!0)},pe.prototype.resetPaneSize=function(){let t=this._vertical?"height":"width";for(let e=this._panes.length;--e>=0;)this._panes[e].setStyle(t,"")},pe._preventVScrolling=function(t){t.currentTarget.scrollTop=0},pe._preventHScrolling=function(t){t.currentTarget.scrollLeft=0},pe.prototype._addPaneAt=function(t){null==t&&(t=this._panes.length);let e=this._panes[t];if(!e){if(e=new Bt(document.createElement("div")),e.setClass("grid-pane"),this._vertical?(e.addClass("sections"),e.listen("scroll",pe._preventVScrolling)):(e.addClass("columns"),e.listen("scroll",pe._preventHScrolling)),this._active||e.addClass("scroll-disabled"),this._paneSize&&this._active){let t=this.getPaneSize();this._vertical?e.setHeight(t):e.setWidth(t)}e.listen("touchstart",this._onTouchStart),e.listen("touchmove",this._onTouchMove),e.listen("touchend",this._onTouchEnd),e.listen("touchcancel",this._onTouchEnd);let i=new Bt(document.createElement("div"));i.setClass("grid-pane-slider"),i.setParent(e),this._panes[t]=e,this._paneSliders[t]=i}return e},pe.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))},pe.prototype._onTrackScroll=function(t){let e=this._vertical?t.target.scrollTop:t.target.scrollLeft,i=this._convertTrackToPane(e);i=this._calcProperScrollValue(i),i!==this._pScrollVal&&(this._pScrollVal=i,this._dispatchScrollEvent(t))},pe.prototype._onRestingPosition=function(){this._setSliderPosition(-this._pScrollVal,!0)},pe.prototype._setSliderPosition=function(t,e){let i="",n="",o=this._vertical?"top":"left";t&&(e?n=t+"px":(i=this._vertical?"translateY":"translateX",i+="("+t+"px)",this._reverter.start()));for(let e=this._paneSliders.length;--e>=0;){let r=this._paneSliders[e],s=r.getElement().style;r._titleSection?s[o]=t+"px":(s.transform=i,s[o]=n)}e?this._dispatch("scrollEnd",{}):this._dispatch("scrollStart",{})},pe.prototype._dispatchScrollEvent=function(t){if(this._setSliderPosition(-this._pScrollVal,!1),this._flash(),!this._isEventDispatching("scroll")){if(!t){let 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)}},pe.prototype._onKeyDown=function(t){if(this._isFrozen)return void nt._preventDefault(t);if(!this._active)return;let e=!1;if(e=this._vertical?38===t.keyCode||40===t.keyCode:37===t.keyCode||39===t.keyCode,e){let 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),nt._preventDefault(t)}},pe.prototype._onTouchStart=function(t){this._isFrozen?nt._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))},pe.prototype._onTouchMove=function(t){let e=this;if(e._isFrozen)return void nt._preventDefault(t);if(!e._swiping||!e._active||!e._touchInput)return;if(t.touches&&t.touches.length>1)return;let i=e._startPos,n=e._endPos;e._getTouchInfo(t,n);let o=this._vertical?i.y-n.y:i.x-n.x;if(!(o>-5&&o<5||e._isOnEdge(o))){if(e._touchDrag)e._scrollTo(i.scrollValue+o);else{n.timeStamp-i.timeStamp>30&&(e._touchDrag=!0)}t.cancelable&&t.preventDefault()}},pe.prototype._onTouchEnd=function(t){if(this._isFrozen)nt._preventDefault(t);else if(this._swiping=!1,this._touchDrag&&(this._touchDrag=!1,t.cancelable&&t.preventDefault(),this._smoothing&&!this._smoothingId)){let e=this._startPos,i=this._getTouchInfo(t,this._endPos),n=i.timeStamp-e.timeStamp,o=this._vertical?e.y-i.y:e.x-i.x;this._smoothingSpeed=30*o/n,(this._smoothingSpeed>10||this._smoothingSpeed<-10)&&(this._smoothingId=setInterval(this._smoothScroll,25))}},pe.prototype._getTouchInfo=function(t,e){let i=t.changedTouches[0];return e||(e={}),e.x=i.pageX,e.y=i.pageY,e.timeStamp=t.timeStamp,e.scrollValue=this._getScrollValue(),e},pe.prototype._smoothScroll=function(){let t=this._smoothingSpeed;t=.9*t|0,this._smoothingSpeed=t,t>1||t<-1?this._scroll(t):(clearInterval(this._smoothingId),this._smoothingId=0)},pe.prototype.disableMouseWheel=function(t){!1===t?this.setMouseWheelLogic(this._mouseWheelLogic||this._onMouseWheel):this.setMouseWheelLogic(null)},pe.prototype.setMouseWheelLogic=function(t){this.removeWheelListener(this._parentNode),this._mouseWheelLogic=t,this._mouseWheelLogic&&this.addWheelListener(this._parentNode)},pe.prototype.addWheelListener=function(t){t&&this._mouseWheelLogic&&t.addEventListener("wheel",this._mouseWheelLogic,!1)},pe.prototype.removeWheelListener=function(t){t&&this._mouseWheelLogic&&t.removeEventListener("wheel",this._mouseWheelLogic,!1)},pe.prototype.setMouseWheelSpeed=function(t){this._wheelScrolling="string"==typeof t?t:""},pe.prototype.getMouseWheelSpeed=function(){return this._wheelScrolling},pe.prototype.getDefaultMouseWheelLogic=function(){return this._onMouseWheel},pe.prototype._onMouseWheel=function(t){if(t.target.opened)return;if(this._isFrozen)return void nt._preventDefault(t);if(t.ctrlKey||t.altKey)return;if(!this.isActive())return;let e=this._vertical?t.deltaY:t.deltaX;if(e&&!this._isOnEdge(e)){if(nt._preventDefault(t),t.deltaMode&&(e=e>0?100:-100),"linear"!=this._wheelScrolling){let t=this.getContentSize();t>=4e3&&(e*=1+t/4e3|0)}this.update(),this._scroll(e)}},pe.prototype.setScrollingStep=function(t){this._step=t>0?t:0},pe.prototype.freezeScrolling=function(t){let e=this._isFrozen;return this._isFrozen=!1!==t,e},pe.prototype.restoreTrackPosition=function(){let t=this._element;this._vertical&&(t.scrollTop=this._tScrollVal,t.scrollTop&&(this._tScrollVal=t.scrollTop))},pe._proto=pe.prototype;var de=pe;let ce=function(){let t=this;t._vertical=!1,t._onDeactivated=t._onDeactivated.bind(t),t._onActivated=t._onActivated.bind(t),t._hostClassName="hscrollbar-host",ce.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)};l.inherits(ce,de),ce.prototype._pinnedLeftColumnCount=0,ce.prototype._pinnedRightColumnCount=0,ce.prototype.setScrollContent=function(t,e,i,n){this._clearAllPanes();let o=e.length;if(o<=0)return;this._pinnedLeftColumnCount=i>=0?i:0,this._pinnedRightColumnCount=n>0?n:0;let r=e[0],s=r.getColumnCount(),l=s-n;(!l||l<0)&&(l=s);for(let t=0;t<o;++t){r=e[t];let n,o,a=this._addPaneAt(t),u=this._paneSliders[t],h=a.getElement(),p=u.getElement();for(n=0;n<i;++n)o=r.getColumn(n),o.setScrollState(h,null,!1);a.setParent(r.getColumnHost());let d=[],c=[];for(n=i;n<l;++n)o=r.getColumn(n),o.setScrollState(null,p,this.isActive()),d.push(o),c.push(o.getElement());for(n=l;n<s;++n)o=r.getColumn(n),o.setScrollState(null,null,!1);let _=r.getReservedSpace();_&&(this._pinnedRightColumnCount||(u.addContent(_),c.push(_)),r._updateRightSpaceStyle()),r._updateLayers(),u._titleSection=r.hasClass("title"),u._columns=d,u._content=c}this.invalidateContent()},ce.prototype.setWidth=function(t){return this.setTrackSize(t,t),!0},ce.prototype.getWidth=function(){return this.getPaneSize()},ce.prototype.getScrollLeft=function(){return this._getScrollValue()},ce.prototype.setScrollLeft=function(t){this.update(),this._scrollTo(t)},ce.prototype.getPinnedLeftColumnCount=function(){return this.isEnabled()?this._pinnedLeftColumnCount:0},ce.prototype.getPinnedRightColumnCount=function(){return this.isEnabled()?this._pinnedRightColumnCount:0},ce.prototype.setPaneLeft=function(t){let e=t&&this.isActive()?-t+"px":"";for(let t=this._panes.length;--t>=0;)this._paneSliders[t].setStyle("marginLeft",e)},ce.prototype.isEndOfHorizontalScroll=function(){return this._isEndOfScroll()},ce.prototype.getContentWidth=function(){let t=this._paneSliders[0],e=0;if(t){let i=t._content;for(let t=i.length;--t>=0;){let n=i[t],o=n?n.style.width:0;o&&(e+=parseFloat(o))}}return e},ce.prototype.calculateContentSize=function(){return this.getContentWidth()},ce.prototype.getTrackSize=function(){return this._footerCount<=0&&this._otherScrollbar&&this._otherScrollbar.isActive()&&!this._pinnedRightColumnCount?this._trackSize-this.getTrackThickness():this._trackSize},ce.prototype._onActivated=function(t){this._updateActivation(!0)},ce.prototype._onDeactivated=function(t){this._updateActivation(!1)},ce.prototype._updateActivation=function(t){let e=this._paneSliders.length;for(let i=0;i<e;++i){let e=this._paneSliders[i]._columns,n=e?e.length:0;for(let i=0;i<n;++i){let n=e[i];n.getElement()&&n.enableAbsolutePosition(t)}}},ce._proto=ce.prototype;var _e=ce;let fe=function(t){let e=this;e._onMouseMove=e._onMouseMove.bind(e),e._onMouseOut=e._onMouseOut.bind(e),e._onResetTransformIE=e._onResetTransformIE.bind(e),e._trackX=new Xt,e._trackY=new Xt,e._trackX.setDefaultLaneSize(100),e._trackY.setDefaultLaneSize(32),e._cellSpans=new se,e._element=document.createElement("div"),e._element.className="tr-lg tr-even-shading",e._ctxRows=new Zt,e._columns=[],e._cells=[],e._highlightedCells=[],e._stretchedCells=new ie(e._trackX,e._trackY,e),e._selectionList=new ae,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")};l.inherits(fe,Bt),fe.prototype._index=-1,fe.prototype._availableRowCount=0,fe.prototype._activeRow=0,fe.prototype._activeRowEnd=0,fe.prototype._colCount=0,fe.prototype._rowCount=0,fe.prototype._hiddenRowCount=0,fe.prototype._trackX,fe.prototype._trackY,fe.prototype._cellSpans,fe.prototype._columns,fe.prototype._firstColumn,fe.prototype._lastColumn,fe.prototype._rightSpace,fe.prototype._rightSpaceSize=0,fe.prototype._frozenLayout=!1,fe.prototype._rowHighlightEnabled=!1,fe.prototype._rowHighlightIndex=-1,fe.prototype._highlightedCells,fe.prototype._coverLayer=null,fe.prototype._stretchedCells=null,fe.prototype._ctx=null,fe.prototype._selectionList,fe.prototype._colVir=!1,fe.prototype._initialized=!1,fe.prototype._hidingMethod="",fe.prototype._virOwner=null,fe.prototype._transformIETimer=0,fe.prototype._ctxRows,fe.prototype._boundLayer=null,fe.prototype._colBounds=null,fe.prototype._colBoundCache=null,fe.prototype._colSelDirty=!1,fe.prototype._hscrollbar=null,fe.prototype._leftColumnSeparator=null,fe.prototype._rightColumnSeparator=null,fe.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._ctxRows.dispose(),this._stretchedCells.dispose();for(let 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()},fe.prototype.getWidth=function(){return this.isVisible()?this._getWidth():0},fe.prototype._getWidth=function(){return this.getContentWidth()+this._rightSpaceSize},fe.prototype.setWidth=function(t){if(t<0)return!1;return null!=this._trackX.setTrackSize(t-this._rightSpaceSize)&&(this._syncLayoutToColumns(0),!0)},fe.prototype.getHeight=function(){return this.isVisible()?this.getContentHeight():0},fe.prototype.setHeight=function(t){if(t<0)return!1;return null==this._trackY.setTrackSize(t)||this._syncLayoutToRows(0,this._rowCount),!0},fe.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._trackY.show(t),this.setFrozenLayout(!1===t),this._dispatchRowHeightChangedEvent(0,this._rowCount)},fe.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;let n=this._trackX.hitTest(t);if(n<0)return null;let o=this._trackY.hitTest(e);if(o<0)return null;let r={};if(r.colIndex=n,r.rowIndex=o,!0!==i){let t=this._cellSpans.getOccupyingSpan(n,o);t&&(r.colIndex=t.indexX,r.rowIndex=t.indexY)}return r},fe.prototype.hitTestX=function(t){return t<0?-1:t>=this.getContentWidth()?~this._colCount:this._trackX.hitTest(t)},fe.prototype.hitTestY=function(t){return t<0?-1:t>=this.getHeight()?~this._rowCount:this._trackY.hitTest(t)},fe.prototype.getDefaultColumnWidth=function(){return this._trackX.getDefaultLaneSize()},fe.prototype.setDefaultColumnWidth=function(t){this._trackX.getDefaultLaneSize()!==t&&(this._trackX.setDefaultLaneSize(t),this._syncLayoutToColumns(0))},fe.prototype.getDefaultRowHeight=function(){return this._trackY.getDefaultLaneSize()},fe.prototype.setDefaultRowHeight=function(t){if(this._trackY.getDefaultLaneSize()!==t){this._trackY.setDefaultLaneSize(t);for(let e=0;e<this._colCount;++e)this._columns[e].setHeight(t);this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)}},fe.prototype.getColumnWidth=function(t){return this._trackX.getLaneSize(t)},fe.prototype.setColumnWidth=function(t,e){return!!this._setColumnWidth(t,e)&&(this._syncLayoutToColumns(t),!0)},fe.prototype._setColumnWidth=function(t,e){return this._trackX.setLaneSize(t,e)},fe.prototype._updateColumnLayout=function(){this._syncLayoutToColumns(0)},fe.prototype._startBindingSession=function(t){},fe.prototype._getTempRowHeights=function(){return null},fe.prototype.getRowHeight=function(t){return this._trackY.getLaneSize(t)},fe.prototype.setRowHeight=function(t,e){if(t<0||t>=this._rowCount)return!1;let i=this._trackY.setLaneSize(t,e);return this._syncLayoutToRows(t,t+1),i&&this._dispatchRowHeightChangedEvent(t,t+1),this._resetTransformIETimer(),i},fe.prototype._updateRowHeights=function(t,e){let i=0;for(let n=0;n<this._rowCount;++n){let o=t.getLaneSize(e);i|=this._trackY.setLaneSize(n,o),++e}return this._syncLayoutToRows(0,this._rowCount),i},fe.prototype.isColumnVisible=function(t){return this._trackX.isLaneVisible(t)},fe.prototype.hideColumn=function(t,e){return this.setColumnVisibility(t,!1===e,0)},fe.prototype.isRowVisible=function(t){return this._trackY.isLaneVisible(t)},fe.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)},fe.prototype.getMinimumColumnWidth=function(t){return this._trackX.getMinimumLaneSize(t)},fe.prototype.setMinimumColumnWidth=function(t,e){return!!this._trackX.setMinimumLaneSize(t,e)&&(this._syncLayoutToColumns(t),!0)},fe.prototype.getMinimumRowHeight=function(t){return this._trackY.getMinimumLaneSize(t)},fe.prototype.setMinimumRowHeight=function(t,e){return!!this._trackY.setMinimumLaneSize(t,e)&&(this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},fe.prototype.getCellLeft=function(t){return this._trackX.getLaneStart(t)},fe.prototype.getCellTop=function(t){return this._trackY.getLaneStart(t)},fe.prototype.getCellWidth=function(t,e){let i=this._cellSpans.getOccupyingSpan(t,e);if(i){let t=this._trackX.getLaneStart(i.indexX);return this._trackX.getLaneEnd(i.indexX+i.colSpan-1)-t}return this.getColumnWidth(t)},fe.prototype.getCellHeight=function(t,e){let i=this._cellSpans.getOccupyingSpan(t,e);if(i){let t=this._trackY.getLaneStart(i.indexY);return this._trackY.getLaneEnd(i.indexY+i.rowSpan-1)-t}return this.getRowHeight(e)},fe.prototype.hasCellSpan=function(){return this._cellSpans.hasSpan()},fe.prototype.getCellRowSpan=function(t,e){return this._cellSpans.getRowSpan(t,e)},fe.prototype.setCellRowSpan=function(t,e,i){let n=this._cellSpans.setRowSpan(t,e,i);if(this._updateCellSpanSize(t,e,n),n)return n.retVal>=0?this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,!0):n.colSpan>1?(this._updateCellSpanClass(t,e,n.colSpan,n.prevRowSpan,!1),this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,!0)):this._updateCellSpanClass(t,e,n.colSpan,n.prevRowSpan,!1),0!==n.retVal;let o=this._getCell(t,e);return o&&o._rowSpan>1&&this._updateCellSpanClass(t,e,o._colSpan,o._rowSpan,!1),!1},fe.prototype.getCellColSpan=function(t,e){return this._cellSpans.getColSpan(t,e)},fe.prototype.setCellColSpan=function(t,e,i){let n=this._cellSpans.setColSpan(t,e,i);if(this._updateCellSpanSize(t,e,n),n)return n.retVal>=0?this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,!0):n.colSpan>1?(this._updateCellSpanClass(t,e,n.prevColSpan,n.rowSpan,!1),this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,!0)):this._updateCellSpanClass(t,e,n.prevColSpan,n.rowSpan,!1),0!==n.retVal;let o=this._getCell(t,e);return o&&o._colSpan>1&&this._updateCellSpanClass(t,e,o._colSpan,o._rowSpan,!1),!1},fe.prototype.clearCellSpans=function(){let t=this._cellSpans.clearAllSpans();if(null==t)return!1;for(let e=t.length;--e>=0;){let i=t[e];this._updateCellSpan(i.indexX,i.indexY,i,!1)}return!0},fe.prototype.clearColumnSpans=function(t){let e=this._cellSpans.removeSpanByColIndex(t);if(null==e)return!1;for(let t=e.length;--t>=0;){let i=e[t];this._updateCellSpan(i.indexX,i.indexY,i,!1)}return!0},fe.prototype.clearColumnCustomizations=function(){this._trackX.clearLaneCustomizations(),this._syncLayoutToColumns(0)},fe.prototype.clearRowCustomizations=function(){this._trackY.clearLaneCustomizations(),this._syncLayoutToRows(0,this._rowCount)},fe.prototype.getColumnScalability=function(t){return this._trackX.getLaneScalability(t)},fe.prototype.setColumnScalability=function(t,e){return this._trackX.setLaneScalability(t,e)},fe.prototype.getRowScalability=function(t){return this._trackY.getLaneScalability(t)},fe.prototype.setRowScalability=function(t,e){return this._trackY.setLaneScalability(t,e)},fe.prototype.getCell=function(t,e,i){if(i&&this._cellSpans.hasSpan()){let i=this._cellSpans.getColSpan(t,e),n=this._cellSpans.getRowSpan(t,e);i<0&&(t+=i),n<0&&(e+=n)}return this._getCell(t,e)},fe.prototype.getCellContent=function(t,e){let i=this.getCell(t,e);return null!==i?i.getContent():null},fe.prototype.setCellContent=function(t,e,i){let n=this.getCell(t,e);return null==n?(window.console.log("Error: Accessing nonexistent cell in Grid's Table"),null):n.setContent(i)},fe.prototype.getColumnCount=function(){return this._colCount},fe.prototype.setColumnCount=function(t){if(t<0&&(t=0),this._colCount===t)return;let e=this._colCount;this._trackX.setLaneCount(t),this._colCount=this._trackX.getLaneCount();let i=0,n=null;if(e>t)for(i=e;--i>=t;)n=this._columns.pop(),n.dispose(),n===this._firstColumn&&(this._firstColumn=null),n===this._lastColumn&&(this._lastColumn=null);else for(i=e;i<t;++i)n=this._newColumn(i);for(this._updateColumnIndices(),i=e;i<t;++i)this._columns[i].activate(!this._colVir);t<=0&&this._selectionList.clearAllSelections()},fe.prototype.getRowCount=function(){return this._rowCount},fe.prototype.setRowCount=function(t,e){if(t<0&&(t=0),this._rowCount===t)return;let i,n=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(n>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(let e=t;e<n;++e)this._selectionList.deselect(e);else this._selectionList.clearAllSelections();else this._syncLayoutToRows(n,t);let o={};o.prevCount=n,o.rowCount=this._rowCount,this._dispatch("rowCountChanged",o),n<t&&this._insertCells(0,this._rowCount)},fe.prototype.getVisibleRowCount=function(){return this._rowCount-this._hiddenRowCount},fe.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))},fe.prototype.removeRow=function(t){t<=0||(t>this._rowCount&&(t=this._rowCount),this.setRowCount(this._rowCount-t))},fe.prototype.setBorders=function(t,e,i,n){},fe.prototype.getColumnStyle=function(t,e){let i=this._columns[t];return i?i.getStyle(e):null},fe.prototype.setColumnStyle=function(t,e,i){let n=this._columns[t];n&&n.setStyle(e,i)},fe.prototype.enableColumnClass=function(t,e,i){let n=this._columns[t];n&&n.enableClass(e,i)},fe.prototype.hasColumnClass=function(t,e){let i=this._columns[t];return!!i&&i.hasClass(e)},fe.prototype.enableRowClass=function(t,e,i){if(t>=0&&t<this._rowCount)for(let n=0;n<this._colCount;++n)this._columns[n].getCell(t).enableClass(e,i)},fe.prototype.setRowStyle=function(t,e,i,n){if(t>=0&&t<this._rowCount){i&&(null==n||n)||(i="");for(let n=0;n<this._colCount;++n)this._columns[n].getCell(t).setStyle(e,i)}},fe.prototype.getRelativePosition=function(t){return nt.getRelativePosition(t,this._element)},fe.prototype.getContentWidth=function(){return this._trackX.getTrackSize()},fe.prototype.getContentHeight=function(){let t=this._trackY.getTrackSize();if(t<=0&&this._colCount*this.getVisibleRowCount()>0){let t=this._columns[0],e=t.getCell(this._rowCount-1);return e.getTop()+e.getHeight()-t.getCell(0).getTop()}return t},fe.prototype.getCellsByRowIndex=function(t){if(t<0||t>=this._rowCount)return null;let e=new Array(this._colCount);for(let i=0;i<this._colCount;++i)e[i]=this._columns[i].getCell(t);return e},fe.prototype.disableHorizontalGridLine=function(t){this.enableClass("no-horizontal-grid-line",!1!==t)},fe.prototype.disableVerticalGridLine=function(t){this.enableClass("no-vertical-grid-line",!1!==t)},fe.prototype.enableShading=function(t){!1!==t?this.addClass("tr-even-shading"):(this.removeClass("tr-even-shading"),this.removeClass("tr-odd-shading"))},fe.prototype.setTransposedShading=function(t){this.enableClass("transposed-shading",!1!==t)},fe.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)))},fe.prototype.getRowHighlight=function(){return this._rowHighlightIndex},fe.prototype.setRowHighlight=function(t){if((!this._rowHighlightEnabled||t<-1||t>=this._rowCount)&&(t=-1),this._rowHighlightIndex===t)return;let e=this._rowHighlightIndex;this._rowHighlightIndex=t;for(let t=this._highlightedCells.length;--t>=0;)this._highlightedCells[t].removeClass("highlighted-row");if(t>=0&&t<this._rowCount){this._highlightedCells.length=this._colCount;for(let e=this._colCount;--e>=0;){let i=this._columns[e].getCell(t);this._highlightedCells[e]=i,i.addClass("highlighted-row")}let e=this.getStretchedCell(t);e&&(this._highlightedCells.push(e),e.addClass("highlighted-row"))}else this._highlightedCells.length=0;if(this._hasListener("rowHighlighted")){let i={};i.prevRowIndex=e,i.rowIndex=t,this._dispatch("rowHighlighted",i)}},fe.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},fe.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},fe.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},fe.prototype.setSelectedRow=function(t,e){t<0||t>=this._rowCount||(this._selectionList.setSelection(t,e),this._updateSelectionUI(t))},fe.prototype.selectSingleRow=function(t){t<0||t>=this._rowCount||(this.clearSelectedRows(),this._selectionList.select(t),this._addSelectionUI(t))},fe.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(let i=0;i<e;++i)this._addSelectionUI(i+t)}},fe.prototype.clearSelectedRows=function(){let t=this._selectionList.getSelectionCount();if(t){let e=this._selectionList.getAllSelections();this._selectionList.clearAllSelections();for(let i=0;i<t;++i)this._removeSelectionUI(e[i]);return t}return 0},fe.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},fe.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},fe.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},fe.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},fe.prototype.activateColumn=function(t,e){let i=this._columns[t];if(i){let t=i.activate(e);if(e&&t&&this._rightSpace){let t=this._rightSpace.parentNode;t&&t.appendChild(this._rightSpace)}}},fe.prototype.activateRows=function(){this._onEnterDocument()},fe.prototype.moveRowsToTop=function(t){this._ctxRows.moveItemsToTop(t),this._stretchedCells.moveCellsToTop(t);for(let e=0;e<this._colCount;++e)this._columns[e].moveCellsToTop(t)},fe.prototype.getFirstIndexInView=function(){return 0},fe.prototype.getLastIndexInView=function(){return this._availableRowCount-1},fe.prototype.isInCurrentView=function(t){return 0!==this._rowCount&&(t>=0&&t<this._rowCount)},fe.prototype.getFrozenLayout=function(){return this._frozenLayout},fe.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)))},fe.prototype.getColumn=function(t){return this._columns[t]||null},fe.prototype.insertColumn=function(t,e){t<0?t=0:t>this._colCount&&(t=this._colCount);let i=t<this._colCount,n=this._cellSpans.getAllSpans();this._updateCellSpans(n,!1),this._trackX.insertLane(t,e),this._colCount=this._trackX.getLaneCount();let o=this._newColumn(t);if(this._updateColumnIndices(),this._cellSpans.shiftColumn(t,1)&&(n=this._cellSpans.getAllSpans()),this._updateCellSpans(n,!0),this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._selectionList.getSelectionCount()){let t=this._selectionList.getAllSelections();for(let e=t.length;--e>=0;){let i=o.getCell(t[e]);i&&i.addClass("selected-row")}}return o.activate(i||!this._colVir),o},fe.prototype.removeColumnAt=function(t){let e=this._trackX.removeLaneAt(t);if(null==e)return null;let i=this._cellSpans.getAllSpans();this._updateCellSpans(i,!1),this._colCount=this._trackX.getLaneCount();let n=this._columns.splice(t,1)[0];return n.dispose(),e.control=n,this._updateColumnIndices(),this._cellSpans.removeColumn(t)&&(i=this._cellSpans.getAllSpans()),this._updateCellSpans(i,!0),this._syncLayoutToColumns(t),t>=this._colCount&&this._updateCssWidth(),e},fe.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)return;let i=this._cellSpans.getAllSpans();this._updateCellSpans(i,!1),this._trackX.moveLane(t,e);let n=this._columns[t];if(nt.moveArrayItem(this._columns,t,e),n.getElement().offsetParent){let t=e+1,i=this._columns[t]||null;for(;i&&!i.getElement().offsetParent;)i=this._columns[++t];n.insertBefore(i)}this._updateColumnIndices(),this._updateCellSpans(i,!0);let o=t<e?t:e;this._syncLayoutToColumns(o)},fe.prototype.enableRowVirtualization=function(){console.log("WARNING: This function is deprecated")},fe.prototype.enableColumnVirtualization=function(t){this._colVir=!1!==t},fe.prototype.getColumnIndex=function(t){if(t){if(t.stretched)return this._stretchedCells.getColumnIndex(t);let e=this._columns.length;for(let i=0;i<e;++i)if(this._columns[i].getElement()===t)return i}return-1},fe.prototype.getCellIndex=function(t,e){if(e){if(e.stretched)return this._stretchedCells.getRowIndex(e);let i=this._columns[t];if(i)return i.getCellIndex(e)}return-1},fe.prototype.getIndex=function(){return this._index},fe.prototype.setIndex=function(t){this._index=t},fe.prototype.getRowOffset=function(){return this._rowOffset},fe.prototype.setRowOffset=function(t){this._rowOffset=t},fe.prototype.updateLayout=function(){this._calculateViewSize(!0),this._stretchedCells.updateCells(),this._updateRightSpaceStyle()},fe.prototype.stretchCell=function(t,e,i,n){let o=-1;if("number"==typeof t?(o=t,null==e&&(e=0)):t&&(t.stretched?(o=this._stretchedCells.getColumnIndex(t),null==e&&(e=this._stretchedCells.getRowIndex(t))):t.getParent&&(o=this.getColumnIndex(t.getParent()))),o<0||e<0||null==e)return null;let r=null;if(!1!==i){let t=this._coverLayer;t||(t=this._coverLayer=document.createElement("div"),t.className="cover-layer",this._updateLayers()),this._calculateViewSize(),r=this._stretchedCells.stretchCell(e,n?o:0),r.setParent(t)}else r=this._stretchedCells.unstretchCell(e);if(r){let t=this._selectionList.getSelection(e);r.enableClass("selected-row",t)}return r},fe.prototype.unstretchCell=function(t,e){return this.stretchCell(t,e,!1)},fe.prototype.unstretchAllCells=function(){this._stretchedCells.unstretchAllCells()},fe.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},fe.prototype.getStretchedCells=function(){return this._stretchedCells.getCells()},fe.prototype.updateStretchedCells=function(){this._updateLayers();let t=this._coverLayer?this._coverLayer.children.length:0;return!(t<=0)&&(this._calculateViewSize(!0),this._stretchedCells.updateCells(),!!t)},fe.prototype._calculateViewSize=function(t){if(this._frozenLayout)return this._stretchedCells.getStretchSize();let e=this._ctx,i=t?0:this._stretchedCells.getStretchSize();if(!i&&e&&e.getWidth){let t=this.getContentWidth();return i=e.getWidth(),i?(t<i&&(i=t),this._stretchedCells.setStretchSize(i),i):t}return i},fe.prototype._enableStretchCellClass=function(t,e,i){let n=this.getStretchedCell(t);n&&n.enableClass(e,i)},fe.prototype._getViewSize=function(){return this._calculateViewSize()},fe.prototype.getColumnHost=function(){return this._element},fe.prototype.setHidingMethod=function(t){this._hidingMethod=t},fe.prototype.getHidingMethod=function(){return this._hidingMethod},fe.prototype.setColumnVisibility=function(t,e,i){return!!this._trackX.hideLane(t,!e,i)&&(this._syncLayoutToColumns(t),!0)},fe.prototype.getRowLayout=function(){return this._trackY},fe.prototype.reserveRightSpace=function(t){if(t&&t>0){if(!this._rightSpace){let t=this._rightSpace=document.createElement("div");t.className="tr-reserved-space",t.style.height=this.getContentHeight()+"px",this._updateLayers()}this._rightSpace.style.width=t+"px",this._rightSpaceSize=t,this._updateCssWidth()}else if(this._rightSpace){let t=this._rightSpace.parentNode;t&&t.removeChild(this._rightSpace),this._rightSpace=null,this._rightSpaceSize=0,this._updateCssWidth()}return this._rightSpace},fe.prototype._updateRightSpaceStyle=function(){let t=this._rightSpace;if(!t)return;let 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")},fe.prototype._updateLayers=function(){if(this._rightSpace){let 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)},fe.prototype.getReservedSpace=function(){return this._rightSpace},fe.prototype.getComputedStyle=function(){let t=this._element;return t.offsetParent?getComputedStyle(t):null},fe.prototype.isColumnActive=function(t){let e=this._columns[t];return!!e&&e.isActive()},fe.prototype.setRowAttributes=function(t,e){if(!(t<0||t>=this._rowCount))for(let i=0;i<this._colCount;++i){let n=e(i);for(let e=n.length;--e>=0;){let o=n[e],r=this._columns[i].getCell(t);r&&(o.remove?r.removeAttribute(o.attribute):r.setAttribute(o.attribute,o.value))}}},fe.prototype.getContextRow=function(t){return this._ctxRows.getItem(t)},fe.prototype.selectColumn=function(t,e){if(this.enableColumnClass(t,"selected-column",e),e){this._colSelDirty=!0,this._boundLayer||(this._initBoundLayer(),this._updateLayers())}},fe.prototype.isSelectedColumn=function(t){return this.hasColumnClass(t,"selected-column")},fe.prototype.selectCell=function(t,e,i){let n=this._getCell(t,e);n&&n.enableClass("selection",i)},fe.prototype.setCellBounds=function(t,e,i,n){},fe.prototype.getHorizontalLayout=function(){return this._trackX},fe.prototype.calculateColumnBounds=function(t,e,i,n){let o=0,r=0,s=!1,l=!1,a=this._trackX.getLaneCount();if(t>=0&&(o=this._trackX.getLaneStart(t),r=this._trackX.getLaneEnd(e)),o<r){let i,n,u=0,h=0,p=0,d=0;this._hscrollbar&&(h=this._hscrollbar.getScrollLeft(),p=this._hscrollbar.getPinnedLeftColumnCount(),d=this._hscrollbar.getPinnedRightColumnCount()),i=n=this._trackX.getTrackSize(),p&&(u=this._trackX.getLaneStart(p)),d&&(a-=d,i=this._getViewSize()-n+this._trackX.getLaneStart(a)),t>=p&&t<a?(o-=h,o<u?(o=u,s=!0):o>i&&(o=i,s=!0)):t>=a&&(o=this._getViewSize()-n+this._trackX.getLaneStart(t)),e>=p&&e<a?(r-=h,r<u?(r=u,l=!0):r>i&&(r=i,l=!0)):e>=a&&(r=this._getViewSize()-n+this._trackX.getLaneEnd(e))}i[0]=o,i[1]=r,n[0]=s,n[1]=l},fe.prototype.updateColumnBounds=function(t,e,i){if(!this._colSelDirty)return;let n=this._colBounds,o=this._colBoundCache;n||(n=this._colBounds=[]),o||(o=this._colBoundCache=[]);let r,s=t.length,l=null,a=null,u=n.length;for(r=s;r<u;++r)a=n[r],l=a.parentNode,l&&l.removeChild(a);if(n.length=u=s,s)for(r=0;r<s;++r){let s=t[r],l=e[r],u=s[0],h=s[1];a=o[r],a||(a=o[r]=document.createElement("div"),a.className="selection-bound column-bound"),a.style.left=u+"px",a.style.width=h-u+"px",i=i||0,a.style.top=i+"px",a.style.height=this._trackY.getTrackSize()-i+"px",a.classList.toggle("no-left-bound",l[0]),a.classList.toggle("no-right-bound",l[1]),this._boundLayer&&(n[r]||(n[r]=a,this._boundLayer.appendChild(a)))}else this._colSelDirty=!1},fe.prototype.updateColumnSeparators=function(){let t=this._hscrollbar.getPinnedLeftColumnCount(),e=this._hscrollbar.getPinnedRightColumnCount();!t&&!e||this._boundLayer||this._initBoundLayer();let i=!1;this._hscrollbar&&(i=this._hscrollbar.isActive());let n=this._boundLayer,o=this._leftColumnSeparator;if(i&&t){o||(o=this._leftColumnSeparator=this._createColumnSeparator()),o.parentNode||(n.children.length?n.insertBefore(o,n.children[0]):n.appendChild(o));let e=this._trackX.getLaneStart(t);o.style.left=e-1+"px",o.style.height=this._trackY.getTrackSize()+"px"}else o&&o.parentNode&&this._boundLayer.removeChild(o);if(o=this._rightColumnSeparator,i&&e){o||(o=this._rightColumnSeparator=this._createColumnSeparator()),o.parentNode||(n.children.length?n.insertBefore(o,n.children[0]):n.appendChild(o));let t=this.getColumnCount(),i=this._trackX.getLaneEnd(t-1)-this._trackX.getLaneStart(t-e),r=this._getViewSize();o.style.left=r-i-this._rightSpaceSize+"px",o.style.height=this._trackY.getTrackSize()+"px"}else o&&o.parentNode&&this._boundLayer.removeChild(o)},fe.prototype._createColumnSeparator=function(){let t=document.createElement("div");return t.classList.add("column-separator"),t},fe.prototype._initBoundLayer=function(){let t=this._boundLayer;return t||(t=this._boundLayer=document.createElement("div"),t.className="cover-layer",this._element.appendChild(t)),t},fe.prototype._getCell=function(t,e){let i=this._columns[t];return i?i.getCell(e):null},fe.prototype._insertCells=function(t,e){this._activeRow=t,this._activeRowEnd=e;let i=this._trackY.getLaneStart(t);for(let n=0;n<this._colCount;++n){let o=this._columns[n];o.hasCollapsedCells()||o.setTop(i),o.activateCells(t,e)}if(this._rightSpace&&(this._rightSpace.style.top=i+"px"),e>this._availableRowCount){let t={};t.prevRowIndex=this._availableRowCount,t.rowIndex=e,this._availableRowCount=e,this._dispatch("rowAvailable",t)}},fe.prototype._newColumn=function(t){let e=new Jt(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(let t=0;t<this._rowCount;++t)this._trackY.isAtDefaultSize(t)||e.getCell(t).setHeight(this._trackY.getLaneSize(t));if(t>=this._columns.length)this._columns.push(e),e.setParent(this._element);else{this._columns.splice(t,0,e);let i=this._columns[t+1];e.insertBefore(i)}return e},fe.prototype._updateCssWidth=function(){this._frozenLayout||(this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._element.style.width=this._getWidth()+"px")},fe.prototype._updateViewHeight=function(){if(this._frozenLayout)return;let t=this.getContentHeight();this._element.style.height=t+"px",this._rightSpace&&(this._rightSpace.style.height=t+"px")},fe.prototype._updateColumnIndices=function(){let 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"));let i=this._columns[t-1];i!==this._lastColumn&&(this._lastColumn&&this._lastColumn.removeClass("last"),this._lastColumn=i,this._lastColumn&&this._lastColumn.addClass("last"));let n=null;for(let t=this._columns.length;--t>=0;){let e=this._columns[t];e.setNextSibling(n),n=e}},fe.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(let e=t;e<this._colCount;++e){let t=this._columns[e];t.setLeft(this._trackX.getLaneStart(e)),t.setWidth(this._trackX.getLaneSize(e))}return this._updateCellSpanLayout(this._cellSpans.getAllSpans()),this._updateCssWidth(),!0},fe.prototype._syncLayoutToRows=function(t,e){if(!this._frozenLayout){for(let i=t;i<e;++i){let t=this._trackY.isAtDefaultSize(i)?-1:this._trackY.getLaneSize(i);for(let e=0;e<this._colCount;++e)this._columns[e].getCell(i).setHeight(t)}this._stretchedCells.updateYAxis(),t?this._updateCellSpanLayout(this._cellSpans.getAllSpans()):this._updateCellSpans(this._cellSpans.getAllSpans(),!0),this._updateViewHeight()}},fe.prototype._dispatchRowHeightChangedEvent=function(t,e){if(!this._hasListener("rowHeightChanged"))return;if(t>=e)return;let i={};i.rowIndex=t,i.changeLength=e-t,this._dispatch("rowHeightChanged",i)},fe.prototype._updateCellSpanSize=function(t,e,i){let n=this._getCell(t,e);if(null!=n)if(i&&i.colSpan>1?(n.setWidth(this.getCellWidth(t,e)),this._columns[t].disableDeactivation()):n.setWidth(-1),i&&i.rowSpan>1)n.setHeight(this.getCellHeight(t,e));else{let t=this._trackY.isAtDefaultSize(e)?-1:this._trackY.getLaneSize(e);n.setHeight(t)}},fe.prototype._updateCellSpanLayout=function(t){if(null!=t)for(let e=t.length;--e>=0;){let i=t[e];this._updateCellSpanSize(i.indexX,i.indexY,i)}},fe.prototype._updateCellSpan=function(t,e,i,n){this._updateCellSpanSize(t,e,n?i:null),this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,n)},fe.prototype._updateCellSpanClass=function(t,e,i,n,o){let r;for(let s=0;s<i&&(r=this._columns[t+s],r);++s)r.collapseCells(e,n,o,0===s,s>0);let s=this._getCell(t,e);s&&(s._colSpan=o?i:1,s._rowSpan=o?n:1)},fe.prototype._updateCellSpans=function(t,e){if(null!=t)for(let i=t.length;--i>=0;){let n=t[i];this._updateCellSpan(n.indexX,n.indexY,n,e)}},fe.prototype._onMouseMove=function(t){let e=t.target,i=nt.closestElement(e,"cell"),n=this._stretchedCells.getColumnIndex(i);if(n<0){let t=nt.closestElement(e,"column");n=this.getColumnIndex(t)}let o=this.getCellIndex(n,i);this.setRowHighlight(o)},fe.prototype._onMouseOut=function(t){let e=t.relatedTarget;if(e){let t=this._element;for(;null!==e.parentNode;)if(e=e.parentNode,e===t)return}this.setRowHighlight(-1)},fe.prototype._updateSelectionUI=function(t){let e=this._selectionList.getSelection(t);this._enableStretchCellClass(t,"selected-row",e),this.enableRowClass(t,"selected-row",e)},fe.prototype._addSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!0),this.enableRowClass(t,"selected-row",!0)},fe.prototype._removeSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!1),this.enableRowClass(t,"selected-row",!1)},fe.prototype._onEnterDocument=function(){if(!this._initialized&&this.getParent()){for(let t=0;t<this._colCount;++t)this._columns[t].enableAutoStyleUpdating();this._syncLayoutToColumns(0),this._initialized=!0}},fe.prototype._setContext=function(t){this._ctx=t},fe.prototype._getContext=function(){return this._ctx},fe.prototype._resetTransformIETimer=function(){nt.isIE&&(this._transformIETimer||(this.enableClass("reset-transform"),this._transformIETimer=setTimeout(this._onResetTransformIE,20)))},fe.prototype._onResetTransformIE=function(){this._transformIETimer=0,this.enableClass("reset-transform",!1)},fe._proto=fe.prototype;var ge=fe;let ye=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)};ye.prototype.dispose=function(){this._dt&&(this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=null)},ye.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())},ye.prototype.setField=function(t){this._field!==t&&(this._field=t,this._requestRecalculation())},ye.prototype.disableOnDemandMode=function(t){let e=!1===t;this._onDemandMode!==e&&(this._onDemandMode=e,this._requestRecalculation())},ye.prototype.setColumnDataGetter=function(t){this._colDataGetter!==t&&(this._colDataGetter=t,this._requestRecalculation())},ye.prototype.getColumnDataGetter=function(){return this._colDataGetter},ye.prototype.getSum=function(){return this._updateStats(),this._sum},ye.prototype.getDataCount=function(){return this._updateStats(),this._count},ye.prototype.getMin=function(){return this._updateStats(),this._min},ye.prototype.getMax=function(){return this._updateStats(),this._max},ye.prototype.getAbsoluteMax=function(){this._updateStats();let t=this._max>=0?this._max:-this._max,e=this._min>=0?this._min:-this._min;return t>=e?t:e},ye.prototype.getAverage=function(){return this._updateStats(),this._sum/this._count},ye.prototype.getMean=ye.prototype.getAverage,ye.prototype.getMidRange=function(){return this._updateStats(),.5*(this._max+this._min)},ye.prototype.getCachedColumnData=function(){return this._dirty?this._recalculate():this._cacheData||(this._cacheData=this._getColData()),this._cacheData},ye.prototype.markDirty=function(){return!!this._onDemandMode&&(this._dirty=!0,this._dirty)},ye.prototype._getColData=function(){return this._colDataGetter?this._colDataGetter(this._field,this._dt):this._dt.getColumnData(this._field)},ye.prototype._requestRecalculation=function(){this.markDirty()||this._recalculate()},ye.prototype._updateStats=function(){this._dirty&&this._recalculate()},ye.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)return;let t=this._cacheData=this._getColData(),e=t.length;if(!e)return;let i,n=ye._isDataNumeric,o=0;for(;o<e;)if(i=+t[o++],n(i)){this._sum=this._min=this._max=i,++this._count;break}for(;o<e;)i=+t[o],n(i)&&(this._sum+=i,i<this._min?this._min=i:i>this._max&&(this._max=i),++this._count),++o},ye.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;let 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()}},ye.prototype._updateRowData=function(t){let e=this._dt.getPreviousData(t,this._field),i=this._dt.getData(t,this._field);if(e===i)return;let n=ye._isDataNumeric(i);if(ye._isDataNumeric(e)){if(this._min===e&&(!n||i>this._min))return void this._recalculate();if(this._max===e&&(!n||i<this._max))return void this._recalculate();this._sum-=e,--this._count}n&&(this._sum+=i,i>=this._min||(this._min=i),i<=this._max||(this._max=i),++this._count)},ye._isDataNumeric=function(t){return"number"==typeof t&&t==t},ye.prototype.addRef=function(t){return t&&this._refs.indexOf(t)<0&&this._refs.push(t),this._refs.length},ye.prototype.deRef=function(t){if(t){let e=this._refs.indexOf(t);e>=0&&this._refs.splice(e,1)}return this._refs.length},ye.prototype.getRefCount=function(){return this._refs.length},ye.prototype._dt=null,ye.prototype._field="",ye.prototype._onDemandMode=!0,ye.prototype._dirty=!0,ye.prototype._cacheData=null,ye.prototype._sum=0,ye.prototype._min=NaN,ye.prototype._max=NaN,ye.prototype._count=0,ye.prototype._colDataGetter=null,ye.prototype._refs;var me=ye;let Ce=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")};l.inherits(Ce,lt),Ce.prototype._dv=null,Ce.prototype._dt=null,Ce.prototype._wrapIndex=0,Ce.prototype._rids,Ce.prototype._dataConflator=null,Ce.prototype._onDataChanged=function(t){if(this._dv){let e=this._dv.getVisibleRowIds(!0);this._refreshRids(e)&&(t.globalChange||(t.globalChange=!0),this._dispatch("dataChanged",t))}},Ce.prototype._onWrapSizeChanged=function(t){this._refreshRids(t.rids)&&this._dispatch("dataChanged",ft._globalChangeArg)},Ce.prototype._refreshRids=function(t){let e=!1;if(this._dv&&Array.isArray(t)){let i=this.getWrapSize();if(i>0){let n=i*this._wrapIndex;n<t.length?(e=!0,this._rids=t.slice(n,n+i)):this._rids.length&&(e=!0,this._rids.length=0)}}return e},Ce.prototype.dispose=function(){this._dv&&(this.unlistenAll(),this._dv.unlisten("dataChanged",this._onDataChanged),this._dv.unlisten("wrapSizeChanged",this._onWrapSizeChanged),this._dt=this._dv=null)},Ce.prototype.getData=function(t,e){return this._dt.getData(t,e)},Ce.prototype.getRowData=function(t){return this._dt.getRowData(t)},Ce.prototype.getColumnData=function(t,e){let i=this.getAllRowIds(!0,e),n=[],o=i.length;for(let r=0;r<o;++r){let o=this._dt.getRowData(i[r]);o?n.push(o[t]):e&&n.push(null)}return n},Ce.prototype.getRowId=function(t){return this._rids[t]||""},Ce.prototype._toRowId=function(t){return"number"==typeof t?this._rids[t]||"":t||""},Ce.prototype._toRowIds=function(t){let e=Array.isArray(t)?t.length:0,i=new Array(e),n=this._rids;for(let o=0;o<e;++o){let e=t[o];i[o]="number"==typeof e?n[e]||"":e||""}return i},Ce.prototype.getAllRowIds=function(t,e){return t?this._rids:this._rids.slice(0)},Ce.prototype.getVisibleRowIds=function(t){return t?this._rids:this._rids.slice(0)},Ce.prototype.getSortedRowIds=function(t){return t?this._rids:this._rids.slice(0)},Ce.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},Ce.prototype.getRowCount=function(){return this._rids.length},Ce.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},Ce.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},Ce.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},Ce.prototype.getMultipleRowData=function(t,e,i){return this._dt.getMultipleRowData(t,e,i)},Ce.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},Ce.prototype.setData=function(t,e,i){return!!this._dt&&this._dt.setData(t,e,i)},Ce.prototype.setRowData=function(t,e,i){return this._dv.setRowData(t,e,i)},Ce.prototype.setColumnData=function(t,e,i){this._dt&&this._dt.setColumnData(t,e,i)},Ce.prototype.setDataAt=function(t,e,i){let n=this.getRowId(t);return!(!n||!this._dt)&&this._dt.setData(n,e,i)},Ce.prototype.setRowDataAt=function(t,e,i){let n=this.getRowId(t);return this.setRowData(n,e,i)},Ce.prototype.insertRow=function(t,e,i){let n=this._toRowId(t);return this._dv.insertRow(n,e,i)},Ce.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},Ce.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},Ce.prototype.moveRow=function(t,e){let i=this._toRowId(e),n=Array.isArray(t)?t:[t],o=this._toRowIds(n);return this._dv.moveRow(o,i)},Ce.prototype.getDataTable=function(){return this._dt},Ce.prototype.getDataSource=function(){return this._dv},Ce.prototype.setDataSource=function(t){},Ce.prototype.setConflationRate=function(t){this._dv.setConflationRate(t)},Ce.prototype.getConflationRate=function(){return this._dv.getConflationRate()},Ce.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},Ce.prototype.sort=function(t,e,i,n){this._dv.sort(t,e,i,n)},Ce.prototype.sortOnce=function(t,e){this._dv.sortOnce(t,e)},Ce.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},Ce.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},Ce.prototype.isSorting=function(){return this._dv.isSorting()},Ce.prototype.hideRow=function(t,e){this.showRows([t],!1===e)},Ce.prototype.hideRows=function(t,e){this.showRows(t,!1===e)},Ce.prototype.showRows=function(t,e){let i=this._toRowIds(t);this._dv.showRows(i,e)},Ce.prototype.unhideAllRows=function(){this._dv.unhideAllRows()},Ce.prototype.hasHiddenRow=function(){return this._dv.hasHiddenRow()},Ce.prototype.filterIn=function(t,e,i){return this._dv.filterIn(t,e,i)},Ce.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},Ce.prototype.filterInOnce=function(t,e,i){this._dv.filterInOnce(t,e,i)},Ce.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},Ce.prototype.clearFilter=function(){this._dv.clearFilter()},Ce.prototype.disablePageCorrection=function(t){},Ce.prototype.setPage=function(t){return!1},Ce.prototype.gotoPage=Ce.prototype.setPage,Ce.prototype.nextPage=function(){return!1},Ce.prototype.previousPage=function(){return!1},Ce.prototype.prevPage=Ce.prototype.previousPage,Ce.prototype.lastPage=function(){return!1},Ce.prototype.firstPage=function(){return!1},Ce.prototype.getCurrentPage=function(){return 1},Ce.prototype.getPageIndex=Ce.prototype.getCurrentPage,Ce.prototype.isOnLastPage=function(){return!0},Ce.prototype.isOnFirstPage=function(){return!0},Ce.prototype.getPageSize=function(){return 0},Ce.prototype.getPageCount=function(){return 1},Ce.prototype.getTotalPages=Ce.prototype.getPageCount,Ce.prototype.setPageSize=function(t){},Ce.prototype.groupBy=function(t,e){this._dv.groupBy(t,e)},Ce.prototype.addGroup=function(t){this._dv.addGroup(t)},Ce.prototype.sortGroups=function(t){this._dv.sortGroups(t)},Ce.prototype.moveGroup=function(t,e){this._dv.moveGroup(t,e)},Ce.prototype.setPredefinedGroups=function(t){this._dv.setPredefinedGroups(t)},Ce.prototype.addFooter=function(t){this._dv.addFooter(t)},Ce.prototype.removeFooter=function(){this._dv.removeFooter()},Ce.prototype.enableMultiGroup=function(t){this._dv.enableMultiGroup(t)},Ce.prototype.getGroupByRowId=function(t){return this._dv.getGroupByRowId(t)},Ce.prototype.getGroup=function(t){return this._dv.getGroup(t)},Ce.prototype.getAllGroups=function(t){return this._dv.getAllGroups(t)},Ce.prototype.getGroupList=function(){return this._dv.getGroupList()},Ce.prototype.getGroupId=function(){return this._dv.getGroupId()},Ce.prototype.getGroupValue=function(){return this._dv.getGroupValue()},Ce.prototype.getGroupRowId=function(){return this._dv.getGroupRowId()},Ce.prototype.getFooterRowIndex=function(t){return this._dv.getFooterRowIndex(t)},Ce.prototype.getFooterRowIds=function(){return this._dv.getFooterRowIds()},Ce.prototype.hasGroup=function(){return this._dv.hasGroup()},Ce.prototype.getGroupRows=function(){return null},Ce.prototype.getGroupLevel=function(t){let e=this._toRowId(t);return this._dv.getGroupLevel(e)},Ce.prototype.enableColumnStats=function(t,e,i){return this._dv.enableColumnStats(t,e,i)},Ce.prototype.getColumnStats=function(t){return this._dv.getColumnStats(t)},Ce.prototype.hide=function(t){return this._dv.hide(t)},Ce.prototype.isHidden=function(){return this._dv.isHidden()},Ce.prototype.isHiddenRow=function(t){return this._dv.isHiddenRow(t)},Ce.prototype.collapse=function(t){this._dv.collapse(t)},Ce.prototype.collapseAllGroups=function(t){this._dv.collapseAllGroups(t)},Ce.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},Ce.prototype.isCollapsed=function(){return this._dv.isCollapsed()},Ce.prototype.enableContentAsHeader=function(t){this._dv.enableContentAsHeader(t)},Ce.prototype.getVisibleRowCount=function(){return this._rids.length},Ce.prototype.isRowDataInGroup=function(t,e){return this._dv.isRowDataInGroup(t,e)},Ce.prototype.isRowIdInGroup=function(t,e){return this._dv.isRowIdInGroup(t,e)},Ce.prototype.addRowExpansion=function(t,e){this._dv.addRowExpansion(t,e)},Ce.prototype.removeRowExpansion=function(t){this._dv.removeRowExpansion(t)},Ce.prototype.toggleRowExpansion=function(t,e,i){let n=this._toRowId(t);this._dv.toggleRowExpansion(n,e,i)},Ce.prototype.removeAllRowExpansions=function(){this._dv.removeAllRowExpansions()},Ce.prototype.getRowsWithExpansion=function(t,e){return this._dv.getRowsWithExpansion(t,e)},Ce.prototype.getExpansionParents=function(t,e){return this._dv.getExpansionParents(t,e)},Ce.prototype.isRowExpansion=function(t){return this._dv.isRowExpansion(t)},Ce.prototype.hasRowExpansion=function(t){return this._dv.hasRowExpansion(t)},Ce.prototype.getRowExpansionId=function(t,e){return this._dv.getRowExpansionId(t,e)},Ce.prototype.getRowExpansionIndex=function(t){return this._dv.getRowExpansionIndex(t)},Ce.prototype.searchAll=function(t,e){return this._dv.searchAll(t,e)},Ce.prototype.searchPrev=function(t,e){let i=this._toRowId(t);return this._dv.searchPrev(i,e)},Ce.prototype.searchNext=function(t,e){let i=this._toRowId(t);return this._dv.searchNext(i,e)},Ce.prototype.stall=function(t){return this._dv.stall(t)},Ce.prototype.enableAutoGroupRemoval=function(t){return this._dv.enableAutoGroupRemoval(t)},Ce.prototype.enableAutoGroupHiding=function(t){return this._dv.enableAutoGroupHiding(t)},Ce.prototype.synchronizeRowOrder=function(){this._dv.synchronizeRowOrder()},Ce.prototype.setSegmentSeparator=function(t,e){let i=this._toRowId(t);return this._dv.setSegmentSeparator(i,e)},Ce.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},Ce.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},Ce.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},Ce.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},Ce.prototype.collapseSegment=function(t,e){let i=this._toRowId(t);return this._dv.collapseSegment(i,e)},Ce.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},Ce.prototype.expandAllSegments=function(){return this._dv.expandAllSegments()},Ce.prototype.setSegmentCollapsingLogic=function(){},Ce.prototype.isSegmentCollapsed=function(t){let e=this._toRowId(t);return this._dv.isSegmentCollapsed(e)},Ce.prototype.fillSegment=function(t){let e=this._toRowId(t);this._dv.fillSegment(e)},Ce.prototype.fillSegments=function(){this._dv.fillSegments()},Ce.prototype.addSegmentChild=function(t,e){let i=this._toRowId(t),n=this._toRowId(e);return this._dv.addSegmentChild(i,n)},Ce.prototype.addSegmentChildren=function(t,e){let i=this._toRowId(t),n=this._toRowIds(e);return this._dv.addSegmentChildren(i,n)},Ce.prototype.removeSegmentChild=function(t,e){let i=this._toRowId(t),n=this._toRowId(e);return this._dv.removeSegmentChild(i,n)},Ce.prototype.removeSegmentChildren=function(t,e){let i=this._toRowId(t),n=this._toRowIds(e);return this._dv.removeSegmentChildren(i,n)},Ce.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},Ce.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},Ce.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},Ce.prototype.sortSegments=function(t){this._dt.sortSegments(t)},Ce.prototype.getWrapSize=function(){return this._dv.getWrapSize()},Ce.prototype.getWrappedViews=function(){return this._dv.getWrappedViews()},Ce.prototype.wrapView=function(t){this._dv.wrapView(t)},Ce.prototype.dump=function(t){return DataCache.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},Ce.prototype.log=function(t){console.table(this.dump(t))},Ce.prototype.isRowFiltered=function(t,e){return this._dv.isRowFiltered(t,e)};var Se=Ce;let we=function(t){let 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 r(this._onDataChanged,0),e._conflator.disable(),e._addEvents("dataChanged","preDisposed","pageIndexChanged","pageCountChanged","groupAdded","beforeGroupAdded","groupCriteriaChanged","beforeFiltering","wrapCountChanged","wrapSizeChanged"),e.setDataSource(t)};l.inherits(we,lt),we.prototype._rids,we.prototype._groupView=null,we.prototype._pageView=null,we.prototype._expansionView=null,we.prototype._hiddenRids=null,we.prototype._collapsedRids=null,we.prototype._excludedRids=null,we.prototype._emptySegmentFiltering=!1,we.prototype._separatorFiltering=!1,we.prototype._expansionMap=null,we.prototype._expansionChildren=null,we.prototype._expansionCount=0,we.prototype._dt=null,we.prototype._parent=null,we.prototype._shared=null,we.prototype._sortingDefs=null,we.prototype._userFilter=null,we.prototype._filteringOut=!1,we.prototype._refreshTimerId=0,we.prototype._groupSortingLogic=null,we.prototype._pageCorrection=!0,we.prototype._pageSize=0,we.prototype._pageIndex=1,we.prototype._lastPageIndex=0,we.prototype._groupCriteria=null,we.prototype._preDefGroups=null,we.prototype._preDefGroupsDirty=!1,we.prototype._groupMembers=null,we.prototype._groupList=null,we.prototype._groupRows=null,we.prototype._groupId="",we.prototype._groupColor="",we.prototype._groupValue,we.prototype._groupRowId="",we.prototype._footerRowIds=null,we.prototype._groupLevel=0,we.prototype._groupViewDirty=!1,we.prototype._columnStats,we.prototype._hidden=!1,we.prototype._hiddenHeaderRow=!1,we.prototype._collapsed=!1,we.prototype._collapsible=!0,we.prototype._showOnlyFirstMember=!1,we.prototype._beingAdded=!1,we.prototype._conflator=null,we.prototype._wrappedViews=null,we.prototype._wrapSize=0,we.prototype._wrapTimerId=0,we.prototype._stalledSorting=!1,we.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(let t in this._columnStats)this._columnStats[t].dispose();this._columnStats=null}},we.prototype.getData=function(t,e){return this._dt.getData(t,e)},we.prototype.getRowData=function(t){return this._dt.getRowData(t)},we.prototype.getColumnData=function(t,e){let i=this.getAllRowIds(!0,e),n=[],o=i.length;for(let r=0;r<o;++r){let o=this._dt.getRowData(i[r]);o?n.push(o[t]):e&&n.push(null)}return n},we.prototype.getRowId=function(t){return this._rebuildRowIdsFromChildren(),this._getRids()[t]||""},we.prototype._toRowId=function(t){return"number"==typeof t?(this._rebuildRowIdsFromChildren(),this._getRids()[t]||""):t||""},we.prototype._toRowIds=function(t){let e=Array.isArray(t)?t.length:0,i=new Array(e),n=this._getRids();for(let o=0;o<e;++o){let e=t[o];"number"==typeof e?(this._rebuildRowIdsFromChildren(),i[o]=n[e]||""):i[o]=e||""}return i},we.prototype.getAllRowIds=function(t,e){this._rebuildRowIdsFromChildren();let i=e?this._getRids():this._pageView||this._rids;return t?i:i.slice(0)},we.prototype.getVisibleRowIds=function(t){this._rebuildRowIdsFromChildren();let e=this._getRids();return t?e:e.slice(0)},we.prototype.getSortedRowIds=function(t){return this._rebuildRowIdsFromChildren(),t?this._rids:this._rids.slice(0)},we.prototype.getRowIndex=function(t){return this._rebuildRowIdsFromChildren(),this._getRids().indexOf(t)},we.prototype.getRowCount=function(){return this._getRids().length},we.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},we.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},we.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},we.prototype.getMultipleRowData=function(t,e,i){return this._dt.getMultipleRowData(t,e,i)},we.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},we.prototype.setData=function(t,e,i){return!!this._dt&&this._dt.setData(t,e,i)},we.prototype.setRowData=function(t,e,i){return!(!t||!this._dt||this.isRowExpansion(t))&&this._dt.setRowData(t,e,i)},we.prototype.setColumnData=function(t,e,i){this._dt&&this._dt.setColumnData(t,e,i)},we.prototype.setDataAt=function(t,e,i){let n=this.getRowId(t);return!(!n||!this._dt)&&this._dt.setData(n,e,i)},we.prototype.setRowDataAt=function(t,e,i){let n=this.getRowId(t);return this.setRowData(n,e,i)},we.prototype.insertRow=function(t,e,i){this._rebuildRowIdsFromChildren();let n=this._toRowId(t);return this._dt?this._dt.insertRow(n,e,i):""},we.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},we.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},we.prototype.moveRow=function(t,e){let i=this._toRowId(e),n=Array.isArray(t)?t:[t],o=this._toRowIds(n);return this._dt.hasSegmentation()&&this.synchronizeRowOrder(),this._dt._moveRow(o,i)},we.prototype.swapRow=nt._deprecatedFunction,we.prototype.getDataTable=function(){return this._dt},we.prototype.getDataSource=function(){return this._parent},we.prototype.setDataSource=function(t){if(t){if(this._groupLevel>0)return;this._setParent(t),this._onDataChanged(ft._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={}},we.prototype.setConflationRate=function(t){this._conflator.disable(!t),this._conflator.setConflatingTime(t)},we.prototype.getConflationRate=function(){return this._conflator.getConflatingTime()},we.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)},we.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},we.prototype.sort=function(t,e,i,n){if(this._groupLevel>0)return void window.console.log("ERROR: Sub-group cannot be sorted individually");let o=this.getSortingLogics(),r=this._sortingDefs,s=r.length;if(Array.isArray(i))for(let e=i.length;--e>=0;)if("function"!=typeof i[e]){let n=Array.isArray(t)?t[e]:t;i[e]=o[n]||o._default}if(ft._buildSortContext(r,t,e,i||o),1===r.length&&0===r[0][3]&&(r.length=0),s<=0&&r.length<=0)return;if(this._shared.stalledRids)return;let l=!1;this._groupMembers||r.length<=0||n?(l=!0,this._updateRowIds()):l=this._sort(),l&&this._dispatchDataChange(ft._positionChangeArg)},we.prototype.sortOnce=function(t,e){this.sort(t,e),this._sortingDefs.length=0},we.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},we.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},we.prototype.getColumnSortingLogic=function(t){return this._dt?this._dt.getColumnSortingLogic(t):null},we.prototype.isSorting=function(){return this._sortingDefs.length>0},we.prototype.hideRow=function(t,e){this.hideRows([t],e)},we.prototype.hideRows=function(t,e){e=!1!==e;let i=this._hiddenRids;if(e)i||(i=this._hiddenRids={});else if(!i)return;let n=this._toRowIds(t),o=!1;for(let t=n.length;--t>=0;){let r=n[t];r&&(e?i[r]||(i[r]=!0,o=!0):i[r]&&(delete i[r],o=!0))}if(o){if(!e){let t=!1;for(let e in i){t=!0;break}t||(i=this._hiddenRids=null)}this._refreshAndNotify()}},we.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},we.prototype.unhideAllRows=function(){this._hiddenRids&&(this._hiddenRids=null,this._refreshAndNotify())},we.prototype.hasHiddenRow=function(){return!!this._hiddenRids},we.prototype.filterIn=function(t,e,i){let n=this._getFilterLogic(t,e),o=!0===i;return!!(this._userFilter!==n||"function"==typeof t||n&&o!==this._filteringOut)&&(this._shared.filterLogic=n,this._userFilter=n,this._filteringOut=o,this._refreshAndNotify(),!0)},we.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},we.prototype.filterInOnce=function(t,e,i){let n=this._getFilterLogic(t,e),o={};if(!this._getRemovalMap(o,n,!0===i))return;let r=this._removeRowIds(o);this._updatePageCount()||this._transformView(r)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(Object.keys(o))},we.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},we.prototype._removeRowIds=function(t){let e=we._removeArrayItems(this._rids,t);if(this._groupView&&(e=we._removeArrayItems(this._groupView,t)),this._groupMembers){let e=this._groupList.length;for(let i=0;i<e;++i){let e=this._groupList[i];this._groupMembers[e]._removeRowIds(t)}}return e},we.prototype.clearFilter=function(){this._userFilter&&(this._userFilter=null,this._shared.filterLogic=null,this._refreshAndNotify())},we.prototype.disablePageCorrection=function(t){this._pageCorrection=!1===t},we.prototype.setPage=function(t){let e=this._setPage(t);return e&&this._dispatchGlobalChange(),e},we.prototype.gotoPage=we.prototype.setPage,we.prototype.nextPage=function(){return this.gotoPage(this._pageIndex+1)},we.prototype.previousPage=function(){return this.gotoPage(this._pageIndex-1)},we.prototype.prevPage=we.prototype.previousPage,we.prototype.lastPage=function(){return this.gotoPage(this._lastPageIndex)},we.prototype.firstPage=function(){return this.gotoPage(0)},we.prototype.getCurrentPage=function(){return this._pageIndex},we.prototype.getPageIndex=we.prototype.getCurrentPage,we.prototype.isOnLastPage=function(){return this._pageIndex===this._lastPageIndex},we.prototype.isOnFirstPage=function(){return 1===this._pageIndex},we.prototype.getPageSize=function(){return this._pageSize},we.prototype.getPageCount=function(){return this._lastPageIndex},we.prototype.getTotalPages=we.prototype.getPageCount,we.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())},we.prototype.groupBy=function(t,e){if(this._shared.multiGroupRow=!1,this._groupCriteria){if(this._groupList&&this._groupList.length>0){for(let t in this._groupMembers)this._groupMembers[t].dispose();this._groupMembers={},this._groupList.length=0}this._groupCriteria=null}let i,n;if(null!=e&&this._setPredefinedGroups(e),t&&0===this._groupLevel){let e;for(this._groupCriteria=[],e=Array.isArray(t)?t:[t],n=e.length,i=0;i<n;++i){let t=e[i];"string"==typeof t?this._groupCriteria.push(this._defaultGroupCriteria.bind(this,t)):t&&this._groupCriteria.push(t)}}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,i=0;i<n;++i)delete this._groupRows[this._footerRowIds[i]];this._footerRowIds=null}this._groupRows=null}this._groupValue=null}this._groupLevel=0,this._updateRowIds(),this._dispatch("groupCriteriaChanged",{}),this._dispatchGlobalChange()},we.prototype.addGroup=function(t){if(this._groupMembers)if(isArray(t)){let e=t,i=e.length;for(let t=0;t<i;++t)this._addGroup(e[t])}else this._addGroup(t)},we.prototype.sortGroups=function(t){if(this._groupMembers&&(this._groupSortingLogic=null==t?we._defaultGroupSortingLogic:t||null,this._groupSortingLogic)){this._groupList.sort(this._internalGroupSortingLogic);for(let t=this._groupList.length;--t>=0;){let e=this._groupList[t];this._groupMembers[e].sortGroups(this._groupSortingLogic)}this._groupViewDirty=!0,this._groupLevel<=0&&this._dispatchGlobalChange()}},we.prototype.moveGroup=function(t,e){let i=this.getGroup(t);if(!i)return;let n=i.getDataSource(),o=i.getGroupId(),r=n._groupList.indexOf(o);r!==e&&r+1!==e&&(n._groupList.splice(r,1),r<e&&--e,n._groupList.splice(e,0,o),this._requestRebuildingRowIds(!1))},we.prototype.setPredefinedGroups=function(t){this._setPredefinedGroups(t),this._groupMembers&&this._refreshAndNotify()},we.prototype._setPredefinedGroups=function(t){if(this._preDefGroups===t)return;this._preDefGroups&&(this._preDefGroups.length=0);let e=!1;if(t)for(let 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},we.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(let e=0;e<t;++e){let t=this._groupRowId+"_footer"+(this._footerRowIds.length||"");this._footerRowIds.push(t),this._groupRows[t]=this}this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},we.prototype.removeFooter=function(){if(this._footerRowIds){let t=this._footerRowIds.length;for(let e=0;e<t;++e)delete this._groupRows[this._footerRowIds[e]];this._footerRowIds=null,this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},we.prototype.enableMultiGroup=function(t){this._shared.multiGroupRow=!1!==t},we.prototype.getGroupByRowId=function(t){return this._groupRows&&this._groupRows[t]||null},we.prototype.getGroup=function(t){if(!this._groupMembers)return null;let e;if("number"==typeof t){if(e=this._groupList[t],!e)return null}else e=t+"";let i=this._groupMembers[e];if(i)return i;let n=e;return i=this._groupRows[n],i||this._getGroupByContentRowId(n)},we.prototype._getGroupByContentRowId=function(t){if(this._groupMembers)for(let e=0;e<this._groupList.length;e++){let i=this._groupList[e],n=this._groupMembers[i]._getGroupByContentRowId(t);if(n)return n}else if(-1!==this._rids.indexOf(t))return this;return null},we.prototype.getAllGroups=function(t){if(t||(t=[]),this._groupMembers){let e=this._groupList.length;for(let i=0;i<e;++i){let e=this._groupList[i],n=this._groupMembers[e];t.push(n),n.getAllGroups(t)}}return t},we.prototype.getGroupList=function(){return this._groupList},we.prototype.getGroupId=function(){return this._groupId},we.prototype.getGroupValue=function(){return this._groupValue},we.prototype.getGroupRowId=function(){return this._groupRowId},we.prototype.getFooterRowIndex=function(t){if(this._footerRowIds)for(let e=this._footerRowIds.length;--e>=0;)if(this._footerRowIds[e]===t)return e;return-1},we.prototype.getFooterRowIds=function(){return this._footerRowIds},we.prototype.hasGroup=function(){return!!this._groupMembers},we.prototype.getGroupRows=function(){return null},we.prototype.getGroupLevel=function(t){if(null!=t&&this._groupRows){if("number"!=typeof t){let e=this.getGroup(t);return e?e._groupLevel:-1}{this._rebuildRowIdsFromChildren();let e=this._getRids(),i=e[t];for(;i;){let n=this._groupRows[i];if(n)return n._groupLevel;i=e[--t]}}}return this._groupLevel},we.prototype.enableColumnStats=function(t,e,i){if(!t)return null;let n=!1!==e,o=this._columnStats[t];if(n?(o||(o=new me(this,t),this._columnStats[t]=o),o.addRef(i)):o&&(o.deRef(i)||(o.dispose(),delete this._columnStats[t])),this._groupMembers)for(let n=this._groupList.length;--n>=0;){let o=this._groupList[n];this._groupMembers[o].enableColumnStats(t,e,i)}return o||null},we.prototype.getColumnStats=function(t){return this._columnStats[t]||null},we.prototype.hide=function(t){let e=!1!==t;return this._hidden!==e&&(this._hidden=e,this._refreshAndNotify(),!0)},we.prototype.isHidden=function(){return this._hidden},we.prototype.isHiddenRow=function(t){return!!this._hiddenRids&&!0===this._hiddenRids[t]},we.prototype._isHeaderRowShown=function(){return!this._hiddenHeaderRow&&((!this._shared.filterLogic||0!==this._rids.length)&&(!this._shared.autoGroupHiding||null!=this._groupValue))},we.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},we.prototype.collapse=function(t){this._setCollapse(!1!==t)&&(this._shared.contentAsHeader?this._hiddenHeaderRow&&this._requestRebuildingRowIds(this._showOnlyFirstMember):this._groupLevel>0&&this._requestRebuildingRowIds(this._collapsed))},we.prototype.collapseAllGroups=function(t){let e=this.getAllGroups(),i=e.length;if(i){let n=!1!==t;for(let t=0;t<i;++t){e[t]._setCollapse(n)}this._requestRebuildingRowIds(!1)}},we.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},we.prototype.isCollapsed=function(){return this._collapsed||this._showOnlyFirstMember},we.prototype.enableContentAsHeader=function(t){this._shared.contentAsHeader=!1!==t},we.prototype.setDefaultCollapse=function(t){this._shared.defaultCollapse=!!t},we.prototype.getDefaultCollapse=function(){return!!this._shared.defaultCollapse},we.prototype.isCollapsible=function(){return this._collapsible},we.prototype.disableCollapsing=function(t){this._collapsible=!(!1!==t)},we.prototype.setGroupColor=function(t){1===this._groupLevel&&(this._groupColor=t)},we.prototype.getGroupColor=function(){return 0===this._groupLevel?"":1===this._groupLevel?this._groupColor:this._parent.getGroupColor()},we.prototype._getFirstHiddenRids=function(){if(this._shared.contentAsHeader&&this._showOnlyFirstMember){let t=this._rids;if(Array.isArray(t)&&t.length)return[t[0]]}return null},we.prototype.getVisibleRowCount=function(){return this._collapsed?0:(this._rebuildRowIdsFromChildren(),this._getRids().length)},we.prototype.isRowDataInGroup=function(t,e){let i=this._groupCriteria,n=this._groupLevel;if(!e||e===this.getGroupId())return this._isAllowedInGroup(null,t);for(let o=n;o<i.length;o++)if(i[o](t).indexOf(e)>=0)return!0;return!1},we.prototype.isRowIdInGroup=function(t,e){let i=this.getRowData(t);return!!i&&this.isRowDataInGroup(i,e)},we._getDataViewExpansionId=function(t,e){return t+"_ex"+e},we.prototype.addRowExpansion=function(t,e){if(this._groupLevel>0)return;if(!e||e<0){if(null!=e)return;e=1}let i=this._rids.indexOf(t);if(i<0)return;let n=0;this._expansionMap?n=this._expansionMap[t]||0:(this._expansionMap={},this._expansionChildren={});let o=n+e;this._expansionMap[t]=o;for(let e=n;e<o;e++)this._expansionChildren[we._getDataViewExpansionId(t,e)]=t;if(n||this._expansionCount++,!this._groupViewDirty&&this._updateExpansionView()){let e={};e.rid=t,e.type="inserted",e.nextRid=this._rids[i+1],e.fallback=i,this._dispatchDataChange(e)}},we.prototype.removeRowExpansion=function(t){if(!this._expansionMap)return;let e=this._expansionMap[t];if(!e)return;let i=new Array(e);for(let n=0;n<e;++n)i[n]=we._getDataViewExpansionId(t,n),delete this._expansionChildren[i[n]];delete this._expansionMap[t],this._expansionCount--,this._groupViewDirty||this._updateExpansionView()&&(1===e?this._dispatchRowRemoved(i[0]):this._dispatchMultiRowRemoved(i))},we.prototype.toggleRowExpansion=function(t,e,i){let n=this._toRowId(t);(e=null!=e?!0===e:!this.hasRowExpansion(n))?this.addRowExpansion(n,i):this.removeRowExpansion(n)},we.prototype.removeAllRowExpansions=function(){this._expansionMap&&(this._expansionMap=null,this._expansionCount=0,this._expansionView=null,this._expansionChildren=null,this._refreshAndNotify())},we.prototype.getRowsWithExpansion=function(t,e){if(!this._expansionMap)return[];let i=this._expansionView,n=i.length;(null==e||e>n)&&(e=n),t>0||(t=0);let o=this._expansionCount,r=new Array(n);for(let n=t;n<e;++n){let t=i[n];if(this._expansionMap[t]&&(r[n]=t,--o<=0))break}return r},we.prototype.getExpansionParents=function(t,e){let i=[];if(this._expansionMap){let n=this._expansionView,o=n.length;(null==e||e>o)&&(e=o),(!t||t<0)&&(t=0);for(let o=t;o<e;++o)i[o]=this._expansionChildren[n[o]]||""}return i},we.prototype.getExpansionParentByRowId=function(t){return this._expansionChildren&&this._expansionChildren[t]||""},we.prototype.isRowExpansion=function(t){return!!this._expansionChildren&&!!this._expansionChildren[t]},we.prototype.hasRowExpansion=function(t){return!!this._expansionMap&&!!this._expansionMap[t]},we.prototype.getRowExpansionCount=function(t){return this._expansionMap&&this._expansionMap[t]||0},we.prototype.getRowExpansionId=function(t,e){if(this._expansionMap){if(e||(e=0),e<(this._expansionMap[t]||0))return we._getDataViewExpansionId(t,e)}return""},we.prototype.getRowExpansionIndex=function(t){if(t){let e=t.match(/_ex(\d+)$/);if(e)return+e[1]}return-1},we.prototype._updateExpansionView=function(){let 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;let e=this._pageView||this._groupView||this._rids,i=e.length,n=this._expansionView?this._expansionView.length:0;this._expansionView?this._expansionView.length=i:this._expansionView=new Array(i);let o=this._expansionCount;for(let n=0,r=0;n<i;++n){let i=e[n];if(this._expansionView[r++]=i,o){let e=t[i]||0;if(e){for(let t=0;t<e;++t)this._expansionView[r++]=we._getDataViewExpansionId(i,t);--o}}}return n!==this._expansionView.length}return!1},we.prototype._transformView=function(t){let e=this._updatePaginationView(t);return e|=this._updateExpansionView(),!!e},we.prototype.searchAll=function(t,e){e||(e=[]),this._rebuildRowIdsFromChildren();let i=this._getRids(),n=i.length;for(let o=0;o<n;++o){let n=i[o],r=this._dt.getRowData(n);r&&t(r)&&e.push(n)}return e},we.prototype.searchPrev=function(t,e){this._rebuildRowIdsFromChildren();let i=this._getRids(),n=-1;"number"==typeof t?this._dt.getRowData(i[t])&&(n=t):n=i.indexOf(t);let o=-1,r=i.length;return n>0&&(o=this._searchRow(i,e,n-1,-1,-1),o>=0)||n>=0&&(o=this._searchRow(i,e,r-1,n,-1),o>=0)?o:-1},we.prototype.searchNext=function(t,e){this._rebuildRowIdsFromChildren();let i=this._getRids(),n=-1;if("number"==typeof t?this._dt.getRowData(i[t])&&(n=t):n=i.indexOf(t),n<0)return-1;let o=-1,r=i.length;return n<r-1&&(o=this._searchRow(i,e,n+1,r,1),o>=0)||n>0&&(o=this._searchRow(i,e,0,n,1),o>=0)?o:-1},we.prototype._searchRow=function(t,e,i,n,o){for(;i!==n;){let n=t[i],r=this._dt.getRowData(n);if(r&&e(r))return i;i+=o}return-1},we.prototype.stall=function(t){let e=!1!==t;if(!!this._shared.stalledRids===e)return!1;if(e){let t={};this._shared.stalledRids=t;let e=this._getRids();for(let i=e.length;--i>=0;)t[e[i]]=1}else this._shared.stalledRids=null,this._refreshAndNotify();return!0},we.prototype.stallSorting=function(t){let e=!1!==t;return this._stalledSorting!==e&&(this._stalledSorting=e,!e&&this.isSorting()&&this._sort()&&this._dispatchDataChange(ft._positionChangeArg),!0)},we.prototype.enableAutoGroupRemoval=function(t){return t=!1!==t,!!this._shared.autoGroupRemoval!==t&&(this._shared.autoGroupRemoval=t,this._triggerGroupRefreshing(),!0)},we.prototype.enableAutoGroupHiding=function(t){return t=!1!==t,!!this._shared.autoGroupHiding!==t&&(this._shared.autoGroupHiding=t,this._triggerGroupRefreshing(),!0)},we.prototype.synchronizeRowOrder=function(){!this._stalledSorting&&this.isSorting()&&this._dt._sort(this._sortingDefs)},we.prototype.setSegmentSeparator=function(t,e){let 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))},we.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},we.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},we.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},we.prototype.getSegment=function(t){return this._dt.getSegment(t)},we.prototype.getSegmentParent=function(t){return this._dt.getSegmentParent(t)},we.prototype.getSegmentLevel=function(t){return this._dt.getSegmentLevel(t)},we.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},we.prototype.collapseSegment=function(t,e){e=!1!==e;let i=this._dt._getSegmentSeparators();if(i){let n=this._toRowId(t);if(i.collapseSegment(n,e))return this._refreshAndNotify(),!0}return!1},we.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},we.prototype.expandAllSegments=function(){let t=this._dt._getSegmentSeparators();return!(!t||!t.expandAllSegments())&&(this._refreshAndNotify(),!0)},we.prototype.setSegmentCollapsingLogic=function(){},we.prototype.isSegmentCollapsed=function(t){let e=this._dt._getSegmentSeparators();return!!e&&e.isCollapsedSegment(this._toRowId(t))},we.prototype.fillSegment=function(t){this._dt.fillSegment(this._toRowId(t))},we.prototype.fillSegments=function(){this._dt.fillSegments()},we.prototype.addSegmentChild=function(t,e,i){if(this._dt._getSegmentSeparators()){let n=this._toRowId(t),o=this._toRowId(e);return this._dt.addSegmentChild(n,o,i)}return!1},we.prototype.addSegmentChildren=function(t,e,i){if(this._dt._getSegmentSeparators()){let n=this._toRowId(t),o=this._toRowIds(e);return this._dt.addSegmentChildren(n,o,i)}return!1},we.prototype.removeSegmentChild=function(t,e){if(this._dt._getSegmentSeparators()){let i=this._toRowId(t),n=this._toRowId(e);return this._dt.removeSegmentChild(i,n)}return!1},we.prototype.removeSegmentChildren=function(t,e){if(this._dt._getSegmentSeparators()){let i=this._toRowId(t),n=this._toRowIds(e);return this._dt.removeSegmentChildren(i,n)}return!1},we.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},we.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},we.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},we.prototype.sortSeparators=function(t,e,i){this._dt.sortSeparators(t,e,i)},we.prototype.sortSegments=function(t){this._dt.sortSegments(t)},we.prototype.enableEmptySegmentFiltering=function(t){t=!1!==t,this._emptySegmentFiltering!==t&&(this._emptySegmentFiltering=t,this._userFilter&&this._refreshAndNotify())},we.prototype.enableSeparatorFiltering=function(t){t=!1!==t,this._separatorFiltering!==t&&(this._separatorFiltering=t,this._userFilter&&this._refreshAndNotify())},we.prototype.setSegmentClassification=function(t,e){return this._dt.setSegmentClassification(this._toRowId(t),e)},we.prototype._getSharedObject=function(){return this._shared},we.prototype.getWrapSize=function(){return this._wrapSize},we.prototype.getWrappedViews=function(){return this._wrappedViews},we.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()},we.prototype._updateWrapCount=function(){this._wrapTimerId=0;let t,e=this._wrapSize,i=this._wrappedViews,n=i?i.length:0,o=0;if(e){let r=this.getVisibleRowIds(!0),s=r.length;if(o=Math.ceil(s/e),n<o)for(i||(i=this._wrappedViews=[]),t=n;t<o;++t)this._wrappedViews[t]=new Se({dataView:this,wrapIndex:t,rids:r})}if(o<n){for(t=n;--t>=o;)this._wrappedViews[t].dispose();this._wrappedViews.length=o}e||(this._wrappedViews=null),n!==o&&this._dispatch("wrapCountChanged",{prevCount:n,newCount:o})},we.prototype.dump=function(t){this._rebuildRowIdsFromChildren();let e=this._getRids();return ut.constructTable(this.getMultipleRowData(e),t,e)},we.prototype.log=function(t){console.table(this.dump(t))},we.prototype._getRids=function(){return this._expansionView||this._pageView||this._groupView||this._rids},we.prototype._updateRowIds=function(t){if(this._groupViewDirty=!1,!this._parent||this._hidden)return void this._resetAllViews();if(this._shared.stalledRids)return;this._rids=t||this._parent.getAllRowIds(),this._dispatch("beforeFiltering",{}),this._excludedRids={};let e=0;e+=we._copyObjectKeys(this._excludedRids,this._hiddenRids);let i=this._dt._getSegmentSeparators(),n=i?i.getSegments():null,o=this._getRemovalMap(this._excludedRids,this._userFilter,this._filteringOut,this._separatorFiltering?null:n);if(e+=o,this._collapsedRids=null,i&&(o&&this._emptySegmentFiltering&&(e+=this._getEmptySegments(this._excludedRids,n)),this._collapsedRids=i.getCollapsedRows(),e+=we._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{let t=this._updatePageCount();this._sort()||t||this._transformView()}},we.prototype._onDataChanged=function(t){if(this._conflator.conflate(t))return;let e=this._conflator.popAllData()||[t],i=e.length;if(1===i){let t=e[0];if(t.globalChange)return this._updateRowIds(),void this._dispatchDataChange(t);let i=t.type;"inserted"===i?this._onRowInserted(t):"removed"===i?this._onRowRemoved(t):this._onRowUpdated(t)}else{this._updateRowIds();let t=!0;for(let n=0;n<i;n++)if(!e[n].positionChangeOnly){t=!1;break}this._dispatchDataChange({globalChange:!0,positionChangeOnly:t,events:e})}},we.prototype._onRowInserted=function(t){if(this._shared.stalledRids)return 0;if(this.isRowFiltered(t.rid,t.rowData))return 0;let e=0;if(this._groupMembers){let i,n=this._resolveGroupId(t.rowData),o=n.length;o>1&&(this._shared.multiGroupRow=!0);for(let r=0;r<o;r++)if(i=n[r],this._groupMembers[i])e=this._groupMembers[i]._onRowInserted(t);else{let n=this._addGroup(i);n&&(t.globalChange=!0,n._onRowInserted(t),e=1)}t.globalChange&&(this._groupViewDirty=!0)}if(this._hidden)return e;let i=t.rid,n=t.rowData;if(!this._isAllowedInGroup(i,n))return e;let o,r=t.nextRid;o=this.isSorting()&&!t.segmentChanged?this._addDataRow(i):this._addDataRow(i,r,t.fallback);let s=this._updatePageCount(),l=this._sort();return l&&(t.globalChange=!0),t.globalChange?l||s||this._transformView():(t={rid:i,rowData:n,type:"inserted"},null!=r&&(t.nextRid=r,t.fallback=o),this._transformView(o)&&(t.globalChange=!0)),this._dispatchDataChange(t),1},we.prototype._onRowRemoved=function(t){if(this._shared.stalledRids)return 0;if(t.segmentChanged&&this.isSorting())return this._refreshAndNotify(),1;let e,i=0,n=t.rids;if(this._groupMembers){let o,r,s=t.rowData;if(!n&&s){for(o=this._resolveGroupId(s),e=0;e<o.length;e++)r=o[e],this._groupMembers[r]&&(i+=this._groupMembers[r]._onRowRemoved(t));i>1&&(this._groupViewDirty=!0)}else{let n=this._groupList.length;for(e=0;e<n;++e)r=this._groupList[e],i+=this._groupMembers[r]._onRowRemoved(t)}}let o,r,s=NaN,l=null;if(i=0,n){for(l=[],e=n.length;--e>=0;)o=n[e],r=this._removeDataRow(o),r>=0&&(l.push(o),r>=s||(s=r));i=l.length}else o=t.rid,r=this._removeDataRow(o),r>=0&&(l=[o],s=r,i=1);if(i>0){this._updatePageCount()||this._transformView(s)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(l),this._shared.autoGroupRemoval&&this._groupRows&&this._rids.length<=0&&this._triggerGroupRefreshing(),this._hiddenHeaderRow&&this._requestRebuildingRowIds(!0)}return i},we.prototype._onRowUpdated=function(t){let e,i,n=t.rid,o=t.rowData;if(this.isRowFiltered(n,o))return this._onRowRemoved(t)?1:0;if(this._groupMembers){let 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);let l=0;if(r[2]?l=2:r[1]?this._isAllowedInGroup(n,o)||(l=1):r[4]&&(l=4),this._groupLevel>0){if(1===l)we._removeArrayItem(this._rids,n)>=0&&this._groupView&&we._removeArrayItem(this._groupView,n),this._shared.multiGroupRow&&(this._groupViewDirty=!0);else if(2===l&&!this._hidden){this._rids.indexOf(n)<0&&this._rids.push(n),this._groupViewDirty=!0,this._resolveGroupId(o).length>1&&(this._shared.multiGroupRow=!0)}}else{let s=r[1]&&r[2]||r[4];if(this._shared.multiGroupRow||!s){let n=this._resolveGroupId(o);for(e=0;e<n.length;e++){i=n[e];let o=this._addGroup(i);o&&(o._onRowInserted(t),l=1)}}!s&&!this._hidden&&this._rids.indexOf(n)<0&&this._addDataRow(n),4===l?this._shared.multiGroupRow?this._dispatchGlobalChange():this._dispatchDataChange(t):(this._groupViewDirty=!0,this._dispatchGlobalChange())}return l}if(this._isAllowedInGroup(n,o)){return this._rids.indexOf(n)<0?(this._onRowInserted(t),2):(this._shared.stalledRids||this._sort()&&(t.globalChange=!0),this._dispatchDataChange(t),4)}return this._onRowRemoved(t)?1:0},we.prototype._onGroupAdded=function(t){if(!this._hidden){let e=t.newGroup,i=e.getGroupRowId();this._groupView.push(i),this._groupViewDirty=!0,this._dispatch("groupAdded",t),nt.pushArrayItems(this._groupView,e.getFooterRowIds())}},we.prototype._onBeforeGroupAdded=function(t){this._dispatch("beforeGroupAdded",t)},we.prototype._requestRebuildingRowIds=function(t){this._groupMembers&&(this._groupViewDirty=!0),this._groupLevel>0?this._parent._requestRebuildingRowIds(t):(t?this._rebuildRowIdsFromChildren():this._updateRowIds(),this._dispatchGlobalChange())},we.prototype._refreshAndNotify=function(){this._updateRowIds(),this._dispatchGlobalChange()},we.prototype._onRefreshTimeout=function(){this._refreshTimerId=0,this._refreshAndNotify()},we.prototype._addDataRow=function(t,e,i){let n=this._getRowIndex(this._rids,e,i);return this._insertItems(this._rids,n,t),this._groupView?this._groupMembers?(this._groupViewDirty=!0,this._insertItems(this._groupView,-1,t)):n<0?this._insertItems(this._groupView,-1,t):(n=this._getRowIndex(this._groupView,e,i),this._insertItems(this._groupView,n,t)):n>=0?n:this._rids.length-1},we.prototype._insertItems=function(t,e,i){return e<0?(e=t.length,t.push(i)):t.splice(e,0,i),e},we.prototype._getRowIndex=function(t,e,i){if(null==e)return-1;let n=this._rids.indexOf(e);return n>=0?n:null==i||i>=t.length?-1:i},we.prototype._removeDataRow=function(t){let e=we._removeArrayItem(this._rids,t);return this._groupView&&e>=0&&(e=we._removeArrayItem(this._groupView,t)),e},we._removeArrayItem=function(t,e){let i=t.indexOf(e);return i>=0&&t.splice(i,1),i},we._removeArrayItems=function(t,e){let i=NaN,n=0;for(let o=t.length;--o>=0;)e[t[o]]?++n:n&&(i=o+1,t.splice(i,n),n=0);return n&&(t.splice(0,n),i=0),i},we._copyObjectKeys=function(t,e){if(e){let i=0;for(let n in e)t[n]=1,++i;return i}return 0},we.prototype._isAllowedInGroup=function(t,e){if(this._groupLevel>0){let i=this;for(let n=this._groupLevel;--n>=0;){if(!i._groupFilterLogic(t,e))return!1;i=i.getDataSource()}}return!0},we.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))},we.prototype._sort=function(){if(this._groupMembers)return!1;if(this._stalledSorting)return!1;if(this._dt._getSegmentSeparators()||this.isSorting()){let t=this._rids,e=this._dt.getMultipleRowData(t),i=this._dt.getSegmentValues(t,!0),n=ft._performMultiLevelSorting(e,this._sortingDefs,i);if(n)return this._rids=ft._reorderItems(t,n),this._transformView(),!0}return!1},we.prototype._byRemovalMap=function(t){return!this._excludedRids[t]},we.prototype._getRemovalMap=function(t,e,i,n){if(!e)return 0;let o,r,s,l=this._rids,a=this._dt,u=0,h=l.length;if(n)for(r=h;--r>=0;)o=l[r],n[o]||(s=a.getRowData(o),s?e(o,s)===i&&(t[o]=1,++u):(t[o]=1,++u));else for(r=h;--r>=0;)o=l[r],s=a.getRowData(o),s?e(o,s)===i&&(t[o]=1,++u):(t[o]=1,++u);return u},we.prototype._getEmptySegments=function(t,e){let i=this._dt._getSegmentSeparators(),n=0;for(let o in e){let e=i.getSegment(o);if(e){let i=e.getChildren(),r=!0;for(let e in i)if(!t[e]){r=!1;break}r&&(t[o]=1,++n)}}return n},we.prototype._getFilterLogic=function(t,e){return null!=t?"function"==typeof t?t:"string"==typeof t?we._defaultFilterLogic.bind(null,t,e):we._defaultFilterLogic.bind(null,t+"",e):null},we.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)},we.prototype._updatePaginationView=function(t){let e=!1;if(this._pageView){t||(t=0);let i=this._pageSize*(this._pageIndex-1),n=this._pageSize+i;if(t<n){let t=this._groupView||this._rids;n>t.length&&(n=t.length);let o=n-i;this._pageView.length=o>=0?o:0;for(let e=i;e<n;++e)this._pageView[e-i]=t[e];e=!0}}return e},we.prototype._updatePageCount=function(){let t=1;if(this._pageSize>0){let 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)},we.prototype._dispatchRowRemoved=function(t){t&&this._dispatchDataChange({type:"removed",rid:t})},we.prototype._dispatchMultiRowRemoved=function(t){if(t){let e=t.length;1===e?this._dispatchRowRemoved(t[0]):e>1&&this._dispatchDataChange({type:"removed",rids:t})}},we.prototype._dispatchGlobalChange=function(){this._dispatchDataChange(ft._globalChangeArg)},we.prototype._dispatchDataChange=function(t){this._dispatch("dataChanged",t),this._wrapSize&&!this._wrapTimerId&&(this._wrapTimerId=setTimeout(this._updateWrapCount))},we.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;let t=this._parent._columnStats;if(t)for(let e in t){let t=this.enableColumnStats(e),i=this._parent.getColumnStats(e);t&&i&&t.setColumnDataGetter(i.getColumnDataGetter())}}},we.prototype._populateGroups=function(){let t,e,i,n,o,r,s=this._rids;this._rids=[];let l={},a=[];for(e=s.length,t=0;t<e;++t){let e=s[t],i=this._dt.getRowData(e);if(i){o=this._resolveGroupId(i),r=o.length,r>1&&(this._shared.multiGroupRow=!0);for(let t=0;t<r;t++){n=o[t];let i=l[n];i?i.push(e):(i=[e],l[n]=i,a.push(n))}}}if(this._shared.autoGroupRemoval)for(e=this._groupList.length,t=e;--t>=0;)n=this._groupList[t],l[n]||(i=this._groupMembers[n],i&&!i._predefinedGroup&&this._removeGroupMember(t,n));let u=null;if(this._preDefGroups&&this._groupLevel<this._preDefGroups.length&&(u=this._preDefGroups[this._groupLevel]),e=this._groupList.length,this._preDefGroupsDirty)for(this._preDefGroupsDirty=!1,t=e;--t>=0;)n=this._groupList[t],i=this._groupMembers[n],i&&i._predefinedGroup&&(u?u.indexOf(i._groupId)<0&&this._removeGroupMember(t,n):this._removeGroupMember(t,n));if(u)for(e=u.length,t=0;t<e;++t){let e=this._addGroup(u[t]);e&&(e._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)n=this._groupList[t],i=this._groupMembers[n],i._updateRowIds(l[n]),i._markColumnStatsDirty();this._groupViewDirty=!0,this._rebuildRowIdsFromChildren()},we.prototype._removeGroupMember=function(t,e){let i=this._groupMembers[e];i&&(this._groupList.splice(t,1),delete this._groupMembers[e],i.dispose())},we.prototype._defaultGroupCriteria=function(t,e){let i=e[t];return Array.isArray(i)?i.map((function(t){return t+""})):[i+""]},we.prototype._groupFilterLogic=function(t,e){return this._groupCriteria[this._groupLevel-1](e).indexOf(this._groupId)>=0},we.prototype._internalGroupSortingLogic=function(t,e){let i=this._groupMembers[t],n=this._groupMembers[e];return this._groupSortingLogic(t,e,i,n)},we.prototype._addGroup=function(t){let e=t+"";if(!e)return null;let i=this._groupMembers[e];if(i)return null;let n,o=(this._groupRowId||"_grp")+"_"+e;if(this._hasListener("beforeGroupAdded")&&(n={dataView:this,newGroupId:e,newGroupValue:t,newGroupRowId:o,newGroupLevel:this._groupLevel+1},this._dispatch("beforeGroupAdded",n),n.cancel))return null;i=new we;let 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,n&&!0===n.hideHeaderRow&&(i._hiddenHeaderRow=!0),i._groupRowId=o,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},we.prototype._triggerGroupRefreshing=function(){this._groupLevel>0?this._parent&&this._parent._triggerGroupRefreshing():this._groupRows&&!this._refreshTimerId&&(this._refreshTimerId=setTimeout(this._onRefreshTimeout,100))},we.prototype._rebuildRowIdsFromChildren=function(){if(this._groupViewDirty){if(this._rids.length=0,this._groupView&&(this._groupView.length=0),!this._hidden){let t=this._groupList.length;for(let e=0;e<t;++e){let t=this._groupList[e],i=this._groupMembers[t];if(i._rebuildRowIdsFromChildren(),nt.pushArrayItems(this._rids,i._rids),!this._collapsed&&this._groupView&&(i._isHeaderRowShown()&&this._groupView.push(i._groupRowId),!i._collapsed)){let t=i._getFirstHiddenRids()||i._groupView||i._rids;nt.pushArrayItems(this._groupView,t),nt.pushArrayItems(this._groupView,i._footerRowIds)}}}this._groupViewDirty=!1,this._updatePageCount()||this._transformView()}},we.prototype._resolveGroupId=function(t){return this._groupCriteria[this._groupLevel](t)},we.prototype._markColumnStatsDirty=function(){for(let t in this._columnStats)this._columnStats[t].markDirty()},we._defaultFilterLogic=function(t,e,i,n){return n[t]===e},we._defaultGroupSortingLogic=function(t,e){return t==e?0:t<e?-1:1};var be=we;let Re=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)};Re.prototype._data,Re.prototype._func=null,Re.prototype._delay=0,Re.prototype._timerId=0,Re.prototype._conflated=!1,Re.prototype._disabled=!1,Re.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},Re.prototype.popAllData=function(){if(this._data.length){let t=this._data;return this._data=[],t}return null},Re.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},Re.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))},Re.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},Re.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},Re.prototype.getData=function(){return this._data},Re.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},Re.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},Re.prototype.disable=function(t){this._disabled=!1!==t},Re.prototype.isEnabled=function(){return!this._disabled},Re.prototype.enable=function(t){this._disabled=!1===t},Re._proto=Re.prototype;var ve=Re;let Ie=function(t){let e=this;e._onDataChanged=e._onDataChanged.bind(e),e.extendEventArg=e.extendEventArg.bind(e),e._dataChangedConflator=new ve(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")};l.inherits(Ie,lt),Ie._runningId=0,Ie.prototype._id="",Ie.prototype._type="",Ie.prototype._grid=null,Ie.prototype._snapshot=null,Ie.prototype._dataView=null,Ie.prototype._dataArg=null,Ie.prototype._autoSyncRowCount,Ie.prototype._bindingEnabled=!0,Ie.prototype._parent=null,Ie.prototype._children=null,Ie.prototype._dataChangedConflator,Ie.prototype.getId=function(){return this._id},Ie.prototype.setId=function(t){return this._id=t||"section"+Ie._runningId++,this._grid.setAttribute("id",this._id),this._id},Ie.prototype.getSection=function(){return this._snapshot||this._grid},Ie.prototype.getSectionName=function(){return this._grid.getId()},Ie.prototype.getIndex=function(){return this._grid.getIndex()},Ie.prototype.getType=function(){return this._type},Ie.prototype.setType=function(t){this._type!==t&&(this._type&&this._grid.removeClass(this._type),this._type=t||"",t&&this._grid.addClass(t))},Ie.prototype.getDataSource=function(){return this._dataView},Ie.prototype.setDataSource=function(t){let 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))},Ie.prototype.getRootDataSource=function(){if(!this._dataView)return null;let t=this._dataView.getDataSource();if(!t)return null;for(;t.getDataSource();)t=t.getDataSource();return t},Ie.prototype.getData=function(t,e){return this._dataView?(e=this._getRowId(e),this._dataView.getData(e,t)):null},Ie.prototype.setData=function(t,e,i){return!!this._dataView&&(e=this._getRowId(e),this._dataView.setData(e,t,i),!0)},Ie.prototype.getRowData=function(t){return this._dataView?(t=this._getRowId(t),this._dataView.getRowData(t)):null},Ie.prototype.removeRowData=function(t){if(!this._dataView)return!1;let e=this.getRootDataSource();if(!e)return!1;t=this._getRowId(t);let i=e.getRowIndex(t);return!(i<0)&&(e.removeRow(i),!0)},Ie.prototype.activateColumns=function(t,e,i){if("content"===this._type)for(let n=i+1;--n>=e;){let e=t[n];null!=e&&this._grid.activateColumn(n,e)}},Ie.prototype.getChildren=function(){return this._children},Ie.prototype.setParent=function(t){if(this._parent){let t=this._parent._children.indexOf(this);t>=0&&(this._parent._children.splice(t,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))},Ie.prototype.getParent=function(){return this._parent},Ie.prototype.getDataChangedConflator=function(){return this._dataChangedConflator},Ie.prototype.disableConflation=function(t){this._dataChangedConflator.disable(t)},Ie.prototype.disableDataBinding=function(t){this._bindingEnabled=!1===t},Ie.prototype.getAutoSyncRowCount=function(){return null!=this._autoSyncRowCount?this._autoSyncRowCount:"content"===this._type},Ie.prototype.setAutoSyncRowCount=function(t){if(this._autoSyncRowCount=t,this.getAutoSyncRowCount()){let t=this._dataView?this._dataView.getVisibleRowCount():0;this._grid.setRowCount(t)}},Ie.prototype.isDataBindable=function(){return!(!this._bindingEnabled||!this._dataView)},Ie.prototype.dispose=function(){let 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},Ie.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},Ie.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},Ie.prototype.extendDataEventArg=function(t,e,i){let n,o;if(t||(t={}),t.firstUpdate=e,t.lastUpdate=i,this._snapshot?(n=0,o=this._grid.getRowCount()):(n=this._grid.getFirstIndexInView(),o=this._grid.getLastIndexInView()+1),t.fromRowIndex=e>n?e:n,this._dataView){let e=this._dataView.getVisibleRowCount();t.dataRowCount=e,o>e&&(o=e)}return t.toRowIndex=i+1<o?i+1:o,this.extendEventArg(t),t},Ie.prototype.setIndex=function(t){this._grid.setIndex(t)},Ie.prototype.getRowOffset=function(){return this._grid.getRowOffset()},Ie.prototype.setRowOffset=function(t){this._grid.setRowOffset(t)},Ie.prototype.enableColumnVirtualization=function(t){t=!1!==t,"content"===this._type&&this._grid.enableColumnVirtualization(t)},Ie.prototype.isBinding=function(){return this._isEventDispatching("dataChanged")},Ie.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))}},Ie.prototype._dispatchDataChanged=function(t,e){let i=this.getAutoSyncRowCount(),n=this._dataView?this._dataView.getVisibleRowCount():0,o=this._grid.getRowCount();i?n!==o&&this._grid.setRowCount(n,!0):n>o&&(e=o-1),this.updateRowData(t,e,this._dataArg),this._dataArg=null},Ie.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))},Ie.prototype.rerender=function(){this.isDataBindable()?this.updateRowData():this._dispatch("rowAvailable",this.extendEventArg())},Ie.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())}},Ie.prototype._getRowId=function(t){return nt.isNumber(t)?this._dataView.getRowId(t):t},Ie.prototype._mergeEvent=function(t){let e=this._dataArg;if(e||(e=this._dataArg={},e.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)return;if(t.globalChange)return e.globalChange=!0,e.firstUpdate=0,void(e.lastUpdate=NaN);let i=t.rids;if(i)for(let t=i.length;--t>=0;)e.updatedRids[i[t]]=!0;else t.rid&&(e.updatedRids[t.rid]=!0);"updated"!==t.type&&(e.indexShifted=!0,"removed"===t.type&&(e.dataRemoved=!0))},Ie.prototype._calculateChangeIndices=function(){if(!this.isDataBindable()||this._dataArg.globalChange)return;let t,e;if(this._dataArg.indexShifted){if(this._dataArg.dataRemoved)this._dataArg.firstUpdate=0;else for(t in this._dataArg.updatedRids)e=this._dataView.getRowIndex(t),e>=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),e>=0&&(this._dataArg.firstUpdate<=e||(this._dataArg.firstUpdate=e),this._dataArg.lastUpdate>=e||(this._dataArg.lastUpdate=e))},Ie._proto=Ie.prototype;var De=Ie;let xe=function(t){this._layout=t,this._arg={},this._addEvent("indexChanged")};l.inherits(xe,lt),xe.prototype._layout,xe.prototype._viewSize=0,xe.prototype._viewOffset=0,xe.prototype._startOffsetCount=0,xe.prototype._endOffsetCount=0,xe.prototype._bufferSize=0,xe.prototype._arg=null,xe.prototype._enabled=!0,xe.prototype._active=!0,xe.prototype._virtualizable=!1,xe.prototype._getMinIndex=function(){return this._startOffsetCount},xe.prototype._getMaxIndex=function(){let t=this._layout.getLaneCount()-this._endOffsetCount;return t>this._startOffsetCount?t:this._startOffsetCount},xe.prototype.getContentStart=function(t){return this._layout.getLaneStart(t)},xe.prototype.getContentInViewCount=function(){let t=this.getFirstIndexInView(),e=this.getLastIndexInView();return t>=0&&t<e?e-t+1:0},xe.prototype._getContentSizeInBounds=function(){let t=this._getMinIndex(),e=this._getMaxIndex();return this._layout.getLaneStart(e)-this._layout.getLaneStart(t)},xe.prototype.getViewSize=function(){return this._viewSize},xe.prototype.getViewOffset=function(){let t=this._getMinIndex();return this._viewOffset+this._layout.getLaneStart(t)},xe.prototype.getIndexOffset=function(){return this._startOffsetCount},xe.prototype.isVirtualizable=function(){return this._virtualizable},xe.prototype.getFirstIndexInView=function(){if(!this._virtualizable)return 0;let t=this.getViewOffset(),e=this._layout.getTrackSize();return t>=e&&(t=e-this._viewSize),t<0?0:this._layout.hitTest(t)},xe.prototype.getLastIndexInView=function(){if(this._virtualizable){let 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},xe.prototype.getPrevFirstIndexInView=function(){return null!=this._arg.prevFirstIndex?this._arg.prevFirstIndex:-1},xe.prototype.getPrevLastIndexInView=function(){return null!=this._arg.prevLastIndex?this._arg.prevLastIndex:-1},xe.prototype.update=function(t){if(!(!0===t||this._enabled&&this._active))return!1;if(this._isEventDispatching("indexChanged"))return!1;let e=this.getFirstIndexInView(),i=this.getLastIndexInView(),n=this._arg.prevFirstIndex!==e||this._arg.prevLastIndex!==i;return(t||n)&&(this._arg.firstIndex=e,this._arg.lastIndex=i,this._dispatch("indexChanged",this._arg),this._arg.prevFirstIndex=e,this._arg.prevLastIndex=i),n},xe.prototype.isEnabled=function(){return this._enabled},xe.prototype.enable=function(t){t=!1!==t,this._enabled!==t&&(this._enabled=t,this.validateVirtualization(),this.update(!0))},xe.prototype.disable=function(t){this.enable(!1===t)},xe.prototype.isActive=function(){return this._active},xe.prototype.activate=function(t){t=!1!==t,this._active!==t&&(this._active=t,this.validateVirtualization(),this.update(!0))},xe.prototype.deactivate=function(t){this.activate(!1===t)},xe.prototype.getBufferSize=function(){return this._bufferSize},xe.prototype.setContentLayout=function(t){this._layout!==t&&(this._layout=t,this.validateVirtualization())},xe.prototype.setViewSize=function(t){t<0&&(t=0),this._viewSize!==t&&(this._viewSize=t,this.validateVirtualization())},xe.prototype.setViewOffset=function(t){this._viewOffset=t>0?t:0,this.update()},xe.prototype.setViewBounds=function(t,e){this._startOffsetCount=t>0?t:0,this._endOffsetCount=e>0?e:0,this.validateVirtualization()},xe.prototype.setBufferSize=function(t){t<0&&(t=0),this._bufferSize!==t&&(this._bufferSize=t,this.validateVirtualization())},xe.prototype.validateVirtualization=function(){this._virtualizable=!1,this._enabled&&this._active&&this._viewSize>0&&this._getContentSizeInBounds()>this._viewSize&&(this._virtualizable=!0)},xe._proto=xe.prototype;var Ae=xe;let Le=function(){let t=this;t._vertical=!0,t._hostClassName="vscrollbar-host",Le.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")};l.inherits(Le,de),Le.prototype.setScrollContent=function(t,e,i){this._clearAllPanes();let n,o=e.length;if(o<=0)return;let r=this._panes[0],s=this._paneSliders[0],l=0;for(;l<i;)n=e[l++],n.setParent(t);r.setParent(t);let a=o-this._footerCount;for(;l<a;)n=e[l++],n.setParent(s);for(;l<o;)n=e[l++],n.setParent(t);this.invalidateContent()},Le.prototype.setHeight=function(t){return this.setTrackSize(t,t),!0},Le.prototype.getHeight=function(){return this.getPaneSize()},Le.prototype.getScrollTop=function(){return this._getScrollValue()},Le.prototype.setScrollTop=function(t){this.update(),this._scrollTo(t)},Le.prototype.isEndOfVerticalScroll=function(){return this._isEndOfScroll()},Le.prototype.getContentHeight=function(){let t=this._paneSliders[0].getContent(!0),e=0;for(let i=t.length;--i>=0;)e+=t[i].offsetHeight;return e},Le.prototype.calculateContentSize=function(){return this.getContentHeight()},Le.prototype.getPane=function(){return this._panes[0]},Le.prototype._onScroll=function(t){this._dispatch("contentScrolled",t)},Le._proto=Le.prototype;var Te=Le;let Ee=function(t,e){return t>e?e:t<0?0:t},Me=function(t){let 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 ge(t),e._grid.setParent(e._element),e._layoutY=new Xt,e._selectionList=new ae,e._reverter=new he(e._onRestingPosition,200),e._addEvent("rowHighlighted"),e._addEvent("rowCountChanged"),e._addEvent("rowHeightChanged"),e._addEvent("rowAvailable")};l.inherits(Me,Bt),Me.prototype._index=-1,Me.prototype._rowOffset=0,Me.prototype._firstIndex=0,Me.prototype._grid,Me.prototype._layoutY,Me.prototype._selectionList=null,Me.prototype._reverter=null,Me.prototype._rowBounds=null,Me.prototype._rowBoundCache=null,Me.prototype._rowSelDirty=!1,Me.prototype._cellBound=null,Me.prototype._cbLftIdx=0,Me.prototype._cbRgtIdx=0,Me.prototype._cbTopIdx=0,Me.prototype._cbBtmIdx=0,Me.prototype._rowBoundTimer=0,Me.prototype._boundLayer=null,Me.prototype._hscrollbar=null,Me.prototype._session="A",Me.prototype._tempRowHeights=null,Me.prototype.getWidth=function(){return this.isVisible()?this._grid.getWidth():0},Me.prototype.getHeight=function(){return this.isVisible()?this._element.offsetHeight:0},Me.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)},Me.prototype.setWidth=function(t){return this._grid.setWidth(t)},Me.prototype.setHeight=function(t){return console.log("unsupported"),!1},Me.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount())},Me.prototype.hitTest=function(t,e){let i=[];return i.colIndex=this._grid.hitTestX(t),i.rowIndex=this._layoutY.hitTest(e),i},Me.prototype.hitTestX=function(t){return this._grid.hitTestX(t)},Me.prototype.hitTestY=function(t){return this._layoutY.hitTest(t)},Me.prototype.getDefaultColumnWidth=function(){return this._grid.getDefaultColumnWidth()},Me.prototype.setDefaultColumnWidth=function(t){this._grid.setDefaultColumnWidth(t)},Me.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},Me.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()))},Me.prototype.getColumnWidth=function(t){return this._grid.getColumnWidth(t)},Me.prototype.setColumnWidth=function(t,e){return this._grid.setColumnWidth(t,e)},Me.prototype._setColumnWidth=function(t,e){return this._grid._setColumnWidth(t,e)},Me.prototype._updateColumnLayout=function(){this._grid._updateColumnLayout()},Me.prototype._startBindingSession=function(t){if(this._isBinding=t,!t){if(this._tempRowHeights){let t=this.getDefaultRowHeight(),e=!0,i=[];for(let e in this._tempRowHeights){let n=+e,o=this._layoutY.getLaneProperty(n,"sizeSession");o&&o!=this._session&&(this.setRowHeight(n,t),this._layoutY.setLaneProperty(n,"sizeSession",null),i.push(n))}let n=i.length;for(let t=0;t<n;t++)delete this._tempRowHeights[i[t]];if(n)for(let t in this._tempRowHeights){e=null!=t;break}e||(this._tempRowHeights=null)}this._session="A"===this._session?"B":"A"}},Me.prototype._getTempRowHeights=function(){return this._tempRowHeights},Me.prototype.getRowHeight=function(t){return this._layoutY.getLaneSize(t)},Me.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))},Me.prototype.isColumnVisible=function(t){return this._grid.isColumnVisible(t)},Me.prototype.hideColumn=function(t,e){return this._grid.hideColumn(t,e)},Me.prototype.isRowVisible=function(t){return this._grid.isRowVisible(t-this._firstIndex)},Me.prototype.hideRow=function(t,e){return this._grid.hideRow(t-this._firstIndex,e)},Me.prototype.getMinimumColumnWidth=function(t){return this._grid.getMinimumColumnWidth(t)},Me.prototype.setMinimumColumnWidth=function(t,e){return this._grid.setMinimumColumnWidth(t,e)},Me.prototype.getMinimumRowHeight=function(t){return this._layoutY.getMinimumLaneSize(t)},Me.prototype.setMinimumRowHeight=function(t,e){return console.log("unsupported"),!1},Me.prototype.getCellLeft=function(t){return this._grid.getCellLeft(t)},Me.prototype.getCellTop=function(t){return this._layoutY.getLaneStart(t)},Me.prototype.getCellWidth=function(t,e){return this._grid.getCellWidth(t,0)},Me.prototype.getCellHeight=function(t,e){return this._layoutY.getLaneSize(e)},Me.prototype.hasCellSpan=function(){return this._grid.hasCellSpan()},Me.prototype.getCellRowSpan=function(t,e){return this._grid.getCellRowSpan(t,e-this._firstIndex)},Me.prototype.setCellRowSpan=function(t,e,i){return this._grid.setCellRowSpan(t,e-this._firstIndex,i)},Me.prototype.getCellColSpan=function(t,e){return this._grid.getCellColSpan(t,e-this._firstIndex)},Me.prototype.setCellColSpan=function(t,e,i){return this._grid.setCellColSpan(t,e-this._firstIndex,i)},Me.prototype.clearCellSpans=function(){return this._grid.clearCellSpans()},Me.prototype.clearColumnSpans=function(t){return this._grid.clearColumnSpans(t)},Me.prototype.clearColumnCustomizations=function(){this._grid.clearColumnCustomizations()},Me.prototype.clearRowCustomizations=function(){this._layoutY.clearLaneCustomizations(),this._grid.clearRowCustomizations()},Me.prototype.getColumnScalability=function(t){return this._grid.getColumnScalability(t)},Me.prototype.setColumnScalability=function(t,e){return this._grid.setColumnScalability(t,e)},Me.prototype.getRowScalability=function(t){return this._layoutY.getLaneScalability(t)},Me.prototype.setRowScalability=function(t,e){return console.log("unsupported"),!1},Me.prototype.getCell=function(t,e,i){return this._grid.getCell(t,e-this._firstIndex,i)},Me.prototype.getCellContent=function(t,e){return this._grid.getCellContent(t,e-this._firstIndex)},Me.prototype.setCellContent=function(t,e,i){return this._grid.setCellContent(t,e-this._firstIndex,i)},Me.prototype.getColumnCount=function(){return this._grid.getColumnCount()},Me.prototype.setColumnCount=function(t){this._grid.setColumnCount(t)},Me.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},Me.prototype.setRowCount=function(t,e){let 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}))},Me.prototype.getVisibleRowCount=function(){return this.getRowCount()},Me.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))},Me.prototype.removeRow=function(t){if(t<=0)return;let e=this._layoutY.getLaneCount();t>e&&(t=e),this.setRowCount(e-t)},Me.prototype.setBorders=function(t,e,i,n){this._grid.setBorders(t,e,i,n)},Me.prototype.getColumnStyle=function(t,e){return this._grid.getColumnStyle(t,e)},Me.prototype.setColumnStyle=function(t,e,i){this._grid.setColumnStyle(t,e,i)},Me.prototype.enableColumnClass=function(t,e,i){this._grid.enableColumnClass(t,e,i)},Me.prototype.hasColumnClass=function(t,e){return this._grid.hasColumnClass(t,e)},Me.prototype.enableRowClass=function(t,e,i){this._grid.enableRowClass(t-this._firstIndex,e,i)},Me.prototype.setRowStyle=function(t,e,i,n){this._grid.setRowStyle(t-this._firstIndex,e,i,n)},Me.prototype.getContentWidth=function(){return this._grid.getContentWidth()},Me.prototype.getContentHeight=function(){return this._layoutY.getTrackSize()},Me.prototype.getCellsByRowIndex=function(t){return this._grid.getCellsByRowIndex(t-this._firstIndex)},Me.prototype.disableHorizontalGridLine=function(t){this._grid.disableHorizontalGridLine(t)},Me.prototype.disableVerticalGridLine=function(t){this._grid.disableVerticalGridLine(t)},Me.prototype.enableShading=function(t){this._grid.enableShading(t)},Me.prototype.setTransposedShading=function(t){this._grid.setTransposedShading(t)},Me.prototype.enableRowHighlighting=function(t){this._grid.enableRowHighlighting(t)},Me.prototype.getRowHighlight=function(){let t=this._grid.getRowHighlight();return t>=0&&(t+=this._firstIndex),t},Me.prototype.setRowHighlight=function(t){let 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")){let i={};i.prevRowIndex=e,i.rowIndex=t,this._dispatch("rowHighlighted",i)}},Me.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},Me.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},Me.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},Me.prototype.setSelectedRow=function(t,e){this._selectionList.setSelection(t,e);let i=this._selectionList.getSelection(t);this._grid.setSelectedRow(t-this._firstIndex,i),i&&(this._rowSelDirty=!0,this._initBoundLayer()),this._requestUpdatingRowBounds()},Me.prototype.selectSingleRow=function(t){this._selectionList.clearAllSelections(),this._grid.clearSelectedRows(),this.setSelectedRow(t)},Me.prototype.selectRowRange=function(t,e){this._selectionList.selectRange(t,e),this._updateRowSelection(),this._rowSelDirty=!0,this._initBoundLayer(),this._requestUpdatingRowBounds()},Me.prototype.clearSelectedRows=function(){let t=this._selectionList.clearAllSelections();return this._grid.clearSelectedRows(),this._requestUpdatingRowBounds(),t},Me.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},Me.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},Me.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},Me.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},Me.prototype.activateColumn=function(t,e){this._grid.activateColumn(t,e)},Me.prototype.activateRows=function(t,e,i){let n=this._layoutY.getLaneCount();t||(t=this._rowOffset),e||0===e||(e=t+n),(t-=this._rowOffset)<0&&(t=0),(e-=this._rowOffset)<0&&(e=0);let o=this._getInnerRowCount(),r=this._firstIndex,s=0;s=t-(1&t),s<0?s=0:s>n&&(s=n);let l=e+(1&e)-s;l+2===o&&(l=o),l<0?l=0:l+s>n&&(l=n-s),this._firstIndex=s;let a=s+l,u=this._layoutY.getLaneStart(s),h=this._grid.getElement();h&&(h.style.transform=u?"translateY("+u+"px)":"",h.style.top="",this._reverter.start()),this._grid._onEnterDocument();let p=!1;if(l!==o){if(this._grid.setRowCount(l),l>o){let t={};t.prevRowIndex=s+o,t.rowIndex=s+l,i&&(t.noDataUpdate=!0),this._dispatch("rowAvailable",t)}p=!0}if(i){if(!p){this._grid.clearSelectedRows();let t=r+o;s<r&&r<a&&t>=a?(this.moveRowsToTop(a-r),i[0]=s,i[1]=r):r<s&&s<t&&a>=t?(this.moveRowsToTop(s-r),i[0]=t,i[1]=a):s===r&&a===t?(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()},Me.prototype.moveRowsToTop=function(t){this._grid.moveRowsToTop(t)},Me.prototype.getFirstIndexInView=function(){return this._firstIndex},Me.prototype.getLastIndexInView=function(){let t=this._firstIndex+this._getInnerRowCount()-1,e=this._grid._getContext().getDataSource(),i=e?e.getRowCount()-1:-1;return t>i?i:t},Me.prototype.isInCurrentView=function(t){return this._firstIndex<=t&&t<this._firstIndex+this._getInnerRowCount()},Me.prototype.getFrozenLayout=function(){return this._grid.getFrozenLayout()},Me.prototype.setFrozenLayout=function(t){this._grid.setFrozenLayout(t)},Me.prototype.getColumn=function(t){return this._grid.getColumn(t)},Me.prototype.insertColumn=function(t,e){return this._grid.insertColumn(t,e)},Me.prototype.removeColumnAt=function(t){return this._grid.removeColumnAt(t)},Me.prototype.moveColumn=function(t,e){this._grid.moveColumn(t,e)},Me.prototype.enableRowVirtualization=function(t){},Me.prototype.enableColumnVirtualization=function(t){this._grid.enableColumnVirtualization(t)},Me.prototype.getColumnIndex=function(t){return this._grid.getColumnIndex(t)},Me.prototype.getCellIndex=function(t,e){let i=this._grid.getCellIndex(t,e);return i<0?-1:i+this._firstIndex},Me.prototype.getIndex=function(){return this._index},Me.prototype.setIndex=function(t){this._index=t},Me.prototype.setRowOffset=function(t){this._rowOffset=t},Me.prototype.getRowOffset=function(){return this._rowOffset},Me.prototype.updateLayout=function(){this._grid.updateLayout()},Me.prototype.stretchCell=function(t,e,i,n){let o=this._grid.stretchCell(t,null!=e?e-this._firstIndex:null,i,n);if(o){let t=o.getElement();0===e?t.classList.add("top"):t.classList.remove("top")}return o},Me.prototype.unstretchCell=function(t,e){return this._grid.unstretchCell(t,null!=e?e-this._firstIndex:null)},Me.prototype.unstretchAllCells=function(){this._grid.unstretchAllCells()},Me.prototype.getStretchedCell=function(t,e){return this._grid.getStretchedCell(t,null!=e?e-this._firstIndex:null)},Me.prototype.getStretchedCells=function(){return this._grid.getStretchedCells()},Me.prototype.updateStretchedCells=function(){return this._grid.updateStretchedCells()},Me.prototype.getColumnHost=function(){return this._grid.getElement()},Me.prototype.setHidingMethod=function(t){this._grid.setHidingMethod(t)},Me.prototype.getHidingMethod=function(){return this._grid.getHidingMethod()},Me.prototype.setColumnVisibility=function(t,e,i){return this._grid.setColumnVisibility(t,e,i)},Me.prototype.getRowLayout=function(){return this._layoutY},Me.prototype.reserveRightSpace=function(t){return this._grid.reserveRightSpace(t)},Me.prototype.getReservedSpace=function(){return this._grid.getReservedSpace()},Me.prototype.getComputedStyle=function(){return this._grid.getComputedStyle()},Me.prototype.isColumnActive=function(t){return this._grid.isColumnActive(t)},Me.prototype.setRowAttributes=function(t,e){return this._grid.setRowAttributes(t,e)},Me.prototype.getContextRow=function(t){return this._grid.getContextRow(t-this._firstIndex)},Me.prototype.selectColumn=function(t,e){this._grid.selectColumn(t,e)},Me.prototype.isSelectedColumn=function(t){return this._grid.isSelectedColumn(t)},Me.prototype.selectCell=function(t,e,i){this._grid.selectCell(t,e-this._firstIndex,i)},Me.prototype.setCellBounds=function(t,e,i,n){let o=this._cellBound;o||(o=this._cellBound=document.createElement("div"),o.className="selection-bound"),this._initBoundLayer();let r=t+i,s=e+n,l=this.getColumnCount(),a=this._layoutY.getLaneCount();this._cbLftIdx=Ee(t,l),this._cbRgtIdx=Ee(r,l),this._cbTopIdx=Ee(e,a),this._cbBtmIdx=Ee(s,a),this._updateCellBounds()},Me.prototype.getHorizontalLayout=function(){return this._grid.getHorizontalLayout()},Me.prototype.calculateColumnBounds=function(t,e,i,n){this._grid.calculateColumnBounds(t,e,i,n)},Me.prototype._updateCellBounds=function(){let t=this._cellBound;if(!t)return;let e,i,n,o,r=this.getHorizontalLayout(),s=this._layoutY,l=this._cbLftIdx,a=this._cbRgtIdx,u=this._cbTopIdx,h=this._cbBtmIdx;e=i=n=o=0,l<a&&u<h&&(e=r.getLaneStart(l),i=r.getLaneEnd(a-1),n=s.getLaneStart(u),o=s.getLaneEnd(h-1));let p=i-e,d=o-n,c=[!1,!1];if(p>0&&d>0&&this._hscrollbar){let t=[0,0];this.calculateColumnBounds(l,a-1,t,c),e=t[0],i=t[1],p=i-e}if(p>0)t.style.left=e+"px",t.style.top=n+"px",t.style.width=p+"px",t.style.height=d+"px",t.classList.toggle("no-left-bound",c[0]),t.classList.toggle("no-right-bound",c[1]),this._boundLayer&&this._boundLayer.appendChild(t);else{let e=t.parentNode;e&&e.removeChild(t)}},Me.prototype.updateColumnBounds=function(t,e,i){this._grid.updateColumnBounds(t,e,i),this._updateRowBounds()},Me.prototype.updateColumnSeparators=function(){this._grid.updateColumnSeparators()},Me.prototype._initBoundLayer=function(){let t=this._boundLayer;t||(t=this._boundLayer=document.createElement("div"),t.className="cover-layer",this._element.appendChild(t))},Me.prototype._requestUpdatingRowBounds=function(){this._rowBoundTimer||(this._rowBoundTimer=setTimeout(this._updateRowBounds,10))},Me.prototype._updateRowBounds=function(){if(this._rowBoundTimer=0,this._updateCellBounds(),!this._rowSelDirty)return;let t=this._rowBounds,e=this._rowBoundCache;t||(t=this._rowBounds=[]),e||(e=this._rowBoundCache=[]);let i=this._selectionList,n=this._layoutY.getLaneCount();i.deselectFrom(n);let o,r=i.getConnectedRanges(),s=r.length,l=null,a=null,u=t.length;for(o=s;o<u;++o)a=t[o],l=a.parentNode,l&&l.removeChild(a);if(t.length=u=s,!s){return void(i.getSelectionCount()||(this._rowSelDirty=!1))}let h=0,p=0,d=0,c=!1;this._hscrollbar&&(h=this._hscrollbar.getScrollLeft(),p=this._hscrollbar.getPinnedLeftColumnCount(),d=this._hscrollbar.getPinnedRightColumnCount(),c=this._hscrollbar.isEndOfHorizontalScroll());let _=!p&&h>0,f=!d&&!c,g=this._grid._getViewSize();for(o=0;o<s;++o){let i=r[o],n=i[0],s=i[1],l=this._layoutY.getLaneStart(n),u=this._layoutY.getLaneEnd(s);a=e[o],a||(a=e[o]=document.createElement("div"),a.className="selection-bound"),a.style.top=l+"px",a.style.height=u-l+"px",a.style.width=g+"px",a.classList.toggle("no-left-bound",_),a.classList.toggle("no-right-bound",f),this._boundLayer&&(t[o]||(t[o]=a,this._boundLayer.appendChild(a)))}},Me.prototype._getInnerRowCount=function(){return this._grid.getRowCount()},Me.prototype._updateRowSelection=function(){this._grid.clearSelectedRows();let t,e=this._selectionList,i=e.getSelectionCount();if(i<=0)return;let n=this._firstIndex,o=n+this._getInnerRowCount();if(1===i)t=e.getFirstSelectedIndex(),n<=t&&t<o&&this._grid.setSelectedRow(t-n,!0);else if(i>=o-n)for(t=n;t<o;++t)e.getSelection(t)&&this._grid.setSelectedRow(t-n,!0);else{let r=e.getAllSelections();for(let e=0;e<i;++e)t=r[e],n<=t&&t<o&&this._grid.setSelectedRow(t-n,!0)}},Me.prototype._dispatchRowHeightChangedEvent=function(t,e){if(t>=e)return!1;let i={};return i.rowIndex=t,i.changeLength=e-t,this._dispatch("rowHeightChanged",i),!0},Me.prototype._onRestingPosition=function(){let t=this._grid.getElement();if(t){let e=this._layoutY.getLaneStart(this._firstIndex);t.style.transform="",t.style.top=e?e+"px":""}},Me.prototype._updateRightSpaceStyle=function(){this._grid._updateRightSpaceStyle()},Me.prototype._updateLayers=function(){this._grid._updateLayers()},Me.prototype._setContext=function(t){this._grid._setContext(t)},Me.prototype._getContext=function(){return this._grid._getContext()},Me._proto=Me.prototype;var Fe=Me;let Pe=function(t,e){return t-e},ze=function(t){ze._sectionType||(ze._sectionType={},ze._sectionType.title=!0,ze._sectionType.header=!0,ze._sectionType.content=!0,ze._sectionType.footer=!0);let 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(let e=t.childNodes.length;--e>=0;)nt.isElement(t.childNodes[e])||t.removeChild(t.childNodes[e]);e._element=t||document.createElement("div"),e._element.classList.add("tr-grid"),e._layoutX=new Xt,e._layoutY=new Xt,e._layoutX.setDefaultLaneSize(100),e._layoutY.setDefaultLaneSize(32),e._settings=[],e._plugins={},e._columnDefs=[],e._sectionStarts=[],e._rowHeightException="title",e._rowVirtualizer=new Ae(e._layoutY),e._rowVirtualizer.deactivate(),e._rowVirtualizer.setViewSize(360),e._colVirtualizer=new Ae(e._layoutX),e._colVirtualizer.enable(!1),e._colVirtualizer.deactivate(),e._colVirtualizer.setViewSize(400),e._vscrollbar=new Te,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 _e,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),nt.isMobile||nt.isTouchDevice?e._element.addEventListener("touchmove",this._onMouseMove,!1):e._element.addEventListener("mousemove",this._onMouseMove,!1),nt.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 ve(e._onRowHeightChanged,50),e._vScrollbarConflator=new ve(e._updateVScrollbar,200),e._columnBoundConflator=new ve(e._updateColumnBounds,10),e._columnPositionConflator=new ve(e._dispatchColumnPositionChanged,10),e._rowPositionConflator=new ve(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");let i=ze.map;i||(i={},ze.map=i);let n=e._element;n._control=e;let o=n.id||n.name;o&&!i[o]||(o="_grid"+ze._runningGridId),e._id=o,i[o]=e,ze._runningGridId++;let r=document.createElement("input");r.style.position="absolute",r.style.width="0",r.style.height="0",r.style.padding="0",r.style.border="0",r.value="0",e._hiddenInput=r,n.insertBefore(r,n.firstChild),Object.defineProperty(e,"zoomFactor",{set:function(t){!t||t<0||this._zoomFactor!==t&&(this._zoomFactor=t,e._updateLayout())},get:function(){return this._zoomFactor}})};l.inherits(ze,Bt),ze.SectionReference,ze.MouseInfo,ze.BatchInfo,ze.CellReference,ze.ColumnOptions,ze._runningGridId=0,ze._runningColumnId=0,ze._sectionType,ze.prototype._plugins,ze.prototype._dataSource=null,ze.prototype._layoutX,ze.prototype._layoutY,ze.prototype._vscrollbar,ze.prototype._hscrollbar,ze.prototype._tempFrozenSectionRef="",ze.prototype._startVScrollbarIndex=-1,ze.prototype._hScrollbarEnabled=!0,ze.prototype._pinnedLeftColumnCount=0,ze.prototype._pinnedRightColumnCount=0,ze.prototype._frozenFooterCount=0,ze.prototype._fixFrozenTopSections=!1,ze.prototype._fixFrozenBottomSection=!1,ze.prototype._sectionStarts,ze.prototype._settings,ze.prototype._firstSettings,ze.prototype._lastSettings,ze.prototype._fitContentWidth=!1,ze.prototype._columnDefs,ze.prototype._rowVirtualizer,ze.prototype._colVirtualizer,ze.prototype._autoSetDataSource=!0,ze.prototype._renderingHandler=null,ze.prototype._dataBindingHandler=null,ze.prototype._frozenLayout=!1,ze.prototype._noBinding=!1,ze.prototype._rowHeightSync=!0,ze.prototype._rowHighlighting=!1,ze.prototype._dispatchingDataChanged=!1,ze.prototype._rowHeightException="",ze.prototype._rowScrollingStep=0,ze.prototype._zoomFactor=1,ze.prototype._reservedSpace=0,ze.prototype._hidingMethod="",ze.prototype._rowHeightConflator=null,ze.prototype._vScrollbarConflator=null,ze.prototype._columnBoundConflator=null,ze.prototype._rowRefreshTimer=0,ze.prototype._layoutUpdating=!1,ze.prototype._hiddenInput,ze.prototype._bottomPadding=6,ze.prototype._bottomPaddingSect=null,ze.prototype._preserveProportion=!1,ze.prototype._preserveGridSize=!1,ze.prototype._rowHeightTimerId=0,ze.prototype._groupDefs=null,ze.prototype._batches=null,ze.prototype._firstRendered=!1,ze.prototype._hasPendingRowChange=!1,ze.getVersion=function(){return"5.1.103"},ze.prototype.dispose=function(){let t=this._id,e=ze.map;if(!e[t])return void console.log("WARNING: Core grid is disposed twice");e[t]=null,this._disposed=!0,this._rowRefreshTimer&&(clearTimeout(this._rowRefreshTimer),this._rowRefreshTimer=0),this.unlistenAll(),window.removeEventListener("resize",this._onWindowResize,!1);for(let t=this._columnDefs.length;--t>=0;){let e=this._getColumnDef(t);e.renderingHandler=e.dataBindingHandler=null}for(let t in this._plugins){let e=this._plugins[t];e.unload&&e.unload(this)}this.removeAllSections();let i=this._vscrollbar._mainScrollbar;i&&(i.unlisten("scroll",this._onSyncVScroll),this._vscrollbar._mainScrollbar=null),i=this._hscrollbar._mainScrollbar,i&&(i.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();let n=this._element;null!==n&&(n._control&&delete n._control,n.removeChild(this._hiddenInput)),this._dispose(),this._columnDefs.length=0,delete this._plugins},ze.prototype.isDisposed=function(){return this._disposed},ze.prototype.setParent=function(t,e){this._setParent(t,e),this._onParentChange()},ze.prototype.insertBefore=function(t){this._insertBefore(t),this._onParentChange()},ze.prototype._onParentChange=function(){let t=this.getParent()||this.getElement();this._vscrollbar._mainScrollbar||this._vscrollbar.setParent(t),this._hscrollbar.setParent(t),this._updateLayout()},ze.prototype.getConfigObject=function(t){let e=t||{},i=this.getColumnCount();e.columns||(e.columns=[]);for(let t=0;t<i;t++){let i=e.columns[t];i||(i=e.columns[t]={});let n=this._getColumnDef(t);n.userId&&(i.id=n.userId),n.field&&(i.field=n.field),n.styles&&(i.styles=n.styles),n.stationary&&(i.stationary=n.stationary),n.leftPinned&&(i.leftPinned=n.leftPinned),n.rightPinned&&(i.rightPinned=n.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);let n=this._vscrollbar.getAutoHide();!0!==n&&(e.autoHideScrollbar=n);let o=this._vscrollbar.getMouseWheelSpeed();o&&(e.linearWheelScrolling=o),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);let r=this.getDataConflationRate();r&&(e.dataConflationRate=r);for(let t in this._plugins){let i=this._plugins[t];"function"==typeof i.getConfigObject&&i.getConfigObject(e)}return e},ze.prototype.fillParentWidth=function(t){if(this._fitContentWidth)return!1;if(this._layoutX.isFixedSize())return!1;let e=this._element,i=(0|e.getBoundingClientRect().width)-e.clientLeft;return null!==this._layoutX.setTrackSize(i-this._reservedSpace)},ze.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",!1!==t&&this.updateLayout()},ze.prototype.getContentWidth=function(){return this._layoutX.getTrackSize()},ze.prototype.getSectionCount=function(){return this._settings.length},ze.prototype._updateFrozenTopSections=function(){if(!this._fixFrozenTopSections){let t=this._getTopSectionCount();this._freezeTopSectionAt(t-1)}},ze.prototype._updateFrozenBottomSections=function(){if(!this._fixFrozenBottomSection){let t=this._getBottomSectionCount();this._setFrozenFooter(t)}},ze.prototype._getTopSectionCount=function(){let t=this._settings,e=t.length,i=0;for(let n=0;n<e;n++){let e=t[n].getType();if("header"!==e&&"title"!==e)break;i++}return i},ze.prototype._getBottomSectionCount=function(){let t=this._settings,e=0;for(let i=t.length-1;i>=0;i--){if("footer"!==t[i].getType())break;e++}return e},ze.prototype.addSection=function(t,e){return this.addSectionAt(this.getSectionCount(),t,e)},ze.prototype.addSectionAt=function(t,e,i){let n=this._settings.length;t<0&&(t=0),t>n&&(t=n);let o=this._toSectionType(e),r="bottomPadding"===i,s=this._newSection(r?"footer":o,i);if(!s)return null;let l=s.getSection();if(r&&(s.setAutoSyncRowCount(!1),this._bottomPaddingSect=l),t>=n?(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),o=s.getType(),"footer"===o?this._updateFrozenBottomSections():"header"!==o&&"title"!==o||this._updateFrozenTopSections(),this._onColumnCountChanged(),this._onSectionCountChanged(!0),this._colVirtualizer.isEnabled()){let t=this._getColActivationList(),e=this.getColumnCount();s.activateColumns(t,0,e-1)}if(this._hasListener("sectionAdded")){let t=s.extendEventArg();this._dispatch("sectionAdded",t)}return l},ze.prototype.removeSection=function(t){let e=this.getSection(t);return null!==e?this.removeSectionAt(e.getIndex()):null},ze.prototype.removeSectionAt=function(t){let e=this._settings.length;if(t>=0&&t<e){let e=this._settings[t],i=e.getIndex(),n=e.getSection(),o=e.getType();return n.setRowCount(0),this._settings.splice(t,1),this._updateSectionIndices(i),"footer"===o?(this._updateFrozenBottomSections(),this._onColumnCountChanged()):"header"!==o&&"title"!==o||this._updateFrozenTopSections(),this._onSectionCountChanged(),e.dispose(),n}return null},ze.prototype.removeLastSection=function(){return this.removeSectionAt(this._settings.length-1)},ze.prototype.removeAllSections=function(){let t=this._settings.length;for(let 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()},ze.prototype.setBottomPaddingSection=function(t){let 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)},ze.prototype._updatePaddingBottomSect=function(){let t=this._bottomPaddingSect;if(t){let e=this._settings.length-1;if(e>0){let n=this._settings[e];if(n.getSection()!==t){let o=null;for(let i=e;--i>=0;){let e=this._settings[i];if(e.getSection()===t){o=e;break}}if(i>=0)return this._putToLast(t),this._settings.splice(i,1),this._settings.push(o),o.setType("footer"===n.getType()?"footer":"content"),!0;this._bottomPaddingSect=null}else{let t=this._settings[e-1];t&&n.setType("footer"===t.getType()?"footer":"content")}}}return!1},ze.prototype.moveSection=function(t,e){let 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)return;let n=this._settings[t],o=this._settings[e];nt.moveArrayItem(this._settings,t,e),o?n.getSection().insertBefore(o.getSection()):this._putToLast(n.getSection()),this._updateSectionIndices(t<=e?t:e),this._syncRowHeights(),this._onSectionCountChanged(),this._frozenLayout||this._rowVirtualizer.update(!0)},ze.prototype.getSection=function(t){let e=this.getSectionSettings(t);return null!==e?e.getSection():null},ze.prototype.getSectionSettings=function(t){if(nt.isString(t)){if(ze._sectionType[t])return this._getNextSection(1,null,t);for(let e=this._settings.length;--e>=0;)if(this._settings[e].getId()===t)return this._settings[e]}else if(null!=t){let e=-1;if(null!=t.getIndex?e=t.getIndex():nt.isNumber(t)&&(e=t),e>=0&&e<this._settings.length)return this._settings[e]}return null},ze.prototype.getAllSections=function(t){if(null==t)return this._getAllSections();let e=this.getAllSectionSettings(t),i=e;for(let t=i.length;--t>=0;)i[t]=e[t].getSection();return i},ze.prototype.getAllSectionSettings=function(t){if(!t)return this._settings;let e=this._settings.length,i=[];t=this._toSectionType(t);for(let n=0;n<e;++n){let e=this._settings[n];t===e.getType()&&i.push(e)}return i},ze.prototype.getSectionIndex=function(t){if(nt.isNumber(t))return t;if(t instanceof MouseEvent){let e=nt.getRelativePosition(t,this._element),i={};return this._hitTestY(e.y,i),i.sectionIndex}let e=this.getSection(t);return null==e?-1:e.getIndex()},ze.prototype.getSectionTop=function(t){let e=this.getSection(t);if(null==e)return 0;let i=this._layoutY.getLaneStart(e.getRowOffset());return this._startVScrollbarIndex>=0&&e.getIndex()>=this._startVScrollbarIndex&&(i-=this._vscrollbar.getScrollTop()),i},ze.prototype.getPreviousSection=function(t,e){null==t&&(t=this._settings.length);let i=this._getNextSection(-1,t,e);return null!==i?i.getSection():null},ze.prototype.getNextSection=function(t,e){let i=this._getNextSection(1,t,e);return null!==i?i.getSection():null},ze.prototype.getLastSection=function(){return this.getSection(this._settings.length-1)},ze.prototype.getCell=function(t,e,i,n){let o=this.getSection(t);return o?o.getCell(e,i,n):null},ze.prototype.getCellInfo=function(t){if(!t)return null;let e=t.colIndex,i=t.rowIndex,n=t.sectionName,o=null;if(null==e||null==i)o=this.getRelativePosition(t),o.hit||(o=null);else{n||(n="content");let t=this.getSectionSettings(n);if(t){t.getSection().getCell(e,i)&&(o={},o.colIndex=e,o.rowIndex=i,t.extendEventArg(o))}}return o},ze.prototype.getNextCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?e:1)},ze.prototype.getPrevCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?-e:-1)},ze.prototype._getNextCellInRow=function(t,e){let i=this.getCellInfo(t);if(i){let t=i.colIndex+e,n=i.rowIndex,o=i.section;i.colIndex=t,i.cell=o.getCell(t,n)}return i},ze.prototype.getNextCell=function(t){let e=this.getNextCellInRow(t);if(e){if(!e.cell){let t=e.section,i=e.colIndex=0,n=e.rowIndex;e.rowIndex=++n,e.cell=t.getCell(i,n)}}return e},ze.prototype.getPrevCell=function(t){let e=this.getPrevCellInRow(t);if(e){if(!e.cell){let t=e.section,i=e.colIndex=t.getColumnCount()-1,n=e.rowIndex;e.rowIndex=--n,e.cell=t.getCell(i,n)}}return e},ze.prototype.getColumnCount=function(){return this._layoutX.getLaneCount()},ze.prototype.setColumnCount=function(t){let e=this._layoutX.getLaneCount();if(t>=e){this._layoutX.setLaneCount(t);for(let e=this._settings.length;--e>=0;){this._settings[e].getSection().setColumnCount(t)}this._onColumnCountChanged(),this._syncLayoutToColumns(e,t),this._dispatchColumnAddedEvent(e,t-e,!1)}else this._removeColumn(e-t)},ze.prototype.insertColumn=function(t,e){let i=this.getColumnCount();t<i||(t=i),this._layoutX.insertLane(t);for(let e=this._settings.length;--e>=0;){this._settings[e].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)},ze.prototype.insertColumns=function(t,e){let i=this.getColumnCount();t<i||(t=i);let n,o=0;if(Array.isArray(e)){if(o=e.length,1===o)return void this.insertColumn(t,e[0]);n=e}else{if("number"!=typeof e)return void this.insertColumn(t,e);if(o=e,1===o)return void this.insertColumn(t,null)}if(o<=0)return;let r=this.freezeLayout(),s=[t,0].concat(new Array(o));Array.prototype.splice.apply(this._columnDefs,s);for(let e=0;e<o;e++){let i=t+e;this._layoutX.insertLane(i);for(let t=this._settings.length;--t>=0;){this._settings[t].getSection().insertColumn(i)}let o=n&&n[e];this._deserializeColumn(i,o)}this._dispatchColumnAddedEvent(t,o,t<i,n),this.freezeLayout(r)},ze.prototype.removeColumnAt=function(t){let e=this.getColumnCount();if(t<0||t>=e)return null;let i=-1;this._colVirtualizer.isVirtualizable()&&(i=this._colVirtualizer.getLastIndexInView());let n=this._layoutX.removeLaneAt(t),o=this._settings.length;for(let e=0;e<o;++e)this._settings[e].getSection().removeColumnAt(t);let r=this._pinnedLeftColumnCount,s=this._pinnedRightColumnCount,l=this._columnDefs.splice(t,1)[0];if(this._onColumnCountChanged(),(t<r||t>=e-s)&&this._updateScrollbarWidth(!0,!0),this._syncLayoutToColumns(t,e-1,!0),l||(l={}),l.layout=n,this._hasListener("columnRemoved")){let e={atTheMiddle:!0};e.colIndex=t,e.columns="deprecated",e.columnData=l.columnData,e.colId=l.id||"",this._dispatchColumnEvent("columnRemoved",e)}return t<=i&&i===this._colVirtualizer.getLastIndexInView()&&this._colVirtualizer.update(),l},ze.prototype.removeAllColumns=function(){this.getColumnCount()>0&&(this._pinnedLeftColumnCount=0,this._pinnedRightColumnCount=0,this.setColumnCount(0))},ze.prototype.getStationaryColumnIndex=function(){for(let t=this.getColumnCount()-1;t>=0;t--)if(this._getColumnDef(t).stationary)return t;return-1},ze.prototype.isColumnMoveAllowed=function(t,e){if(Array.isArray(t)||(t=[t]),0===t.length||null==e)return!1;let i=this.getStationaryColumnIndex();if(i>-1){if(e<=i)return!1;for(let e=0;e<t.length;e++)if(t[e]<=i)return!1}return!0},ze.prototype.isColumnMovable=function(t){let e=this.getStationaryColumnIndex();return!(e>-1&&t<=e)},ze.prototype.moveColumn=function(t,e){if("number"==typeof t)return this._moveColumn(t,e);if(!Array.isArray(t))return!1;let i,n=t.length,o=[],r=0,s=this.getColumnCount(),l={};for(i=0;i<n;++i)r=t[i],r>=0&&r<s&&null==l[r]&&(l[r]=1,o.push(r));if(e<0?e=0:e>=s&&(e=s-1),n=o.length,!n)return!1;if(1===n)return this._moveColumn(o[0],e);if(!this.isColumnMoveAllowed(o,e))return!1;if(o.sort(Pe),l[e]){let t=!0;for(r=o[0],i=1;i<n;++i)if(++r!==o[i]){t=!1;break}if(t)return!1}let a,u,h=this.freezeLayout(!0),p=0;for(i=0;i<n;++i)a=o[i],a>=e&&(u=e+p,this._moveColumn(a,u),++p);let d=n-p;for(u=p?e-1:e,i=0;i<d;++i)a=o[i]-i,this._moveColumn(a,u);return this.freezeLayout(h),!0},ze.prototype._moveColumn=function(t,e){let 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;let n=-1;this._colVirtualizer.isVirtualizable()&&(n=this._colVirtualizer.getLastIndexInView());let o=this.getColumnId(t);this._layoutX.moveLane(t,e);let r=this._settings.length;for(let i=0;i<r;++i){this._settings[i].getSection().moveColumn(t,e)}let s=this._columnDefs[t],l=this._countPinnedLeftColumns(),a=this._countPinnedRightColumns();if(nt.moveArrayItem(this._columnDefs,t,e),this._hScrollbarEnabled&&(t<l?e>=i-a?this.freezeColumn(l-2,a+1):e>=l&&this.freezeColumn(l-2,a):s.rightPinned?e<l?this.freezeColumn(l,a-1):e<i-a&&this.freezeColumn(l-1,a-1):e<l?this.freezeColumn(l,a):e>=i-a&&this.freezeColumn(l-1,a+1)),!this._frozenLayout&&this._colVirtualizer.isEnabled()){let i=this._colVirtualizer.getFirstIndexInView();t<i&&e<i||t>n&&e>n||this._activateColumns(i,n,i,n)}if(this._hasListener("columnMoved")){let i={};i.fromColIndex=t,i.toColIndex=e,i.colId=o,this._dispatchColumnEvent("columnMoved",i)}return n===this._colVirtualizer.getLastIndexInView()&&(t<=n&&e>n||e<=n&&t>n)&&this._colVirtualizer.update(),this._updateColumnBounds(),this._updateColumnSeparators(),!0},ze.prototype.moveColumnById=function(t,e){let i=this.getColumnCount(),n=this.getColumnIndex(t);if(n<0||n>=i)return!1;let o=null!=e?this.getColumnIndex(e):-1;return o<0&&(o=i),this._moveColumnByIndex(n,o)},ze.prototype._moveColumnByIndex=function(t,e){return t<e&&--e,t!==e&&this.moveColumn(t,e)},ze.prototype.reorderColumns=function(t,e){let i="";"number"==typeof e?i=this.getColumnId(e):e&&(i=e),this.startBatch("move");let n=0;if(Array.isArray(t)){let e=t.length;if(e>1){let o,r,s,l,a=this.getColumnIds(),u=a.length,h=[],p=!1;for(o=0;o<e;++o){let e=t[o];"number"==typeof e?(s=e,r=a[e]||""):(r=e,s=a.indexOf(r)),r&&s>=0&&(h.push(r),i===r&&(p=!0))}if(e=h.length,p){if(l=this.getColumnIndex(i),l>=0)for(;++l<u&&(i=a[l],!(h.indexOf(i)<0)););(l<0||l>=u)&&(i="")}for(o=e;--o>=0;)r=h[o],s=this.getColumnIndex(r),l=this.getColumnIndex(i),l<0&&(l=u),n|=this._moveColumnByIndex(s,l),i=r}else n=this.moveColumnById(t[0],i)}else null!=t&&(n=this.moveColumnById(t,i));return this.stopBatch("move"),!!n},ze.prototype.getColumnLayout=function(){return this._layoutX},ze.prototype.updateColumnLayout=function(){this._syncLayoutToColumns(0,this.getColumnCount())},ze.prototype._deserializeColumn=function(t,e){if(!e)return;let i,n=e.layout||e,o=e.width;null!=o&&(n.size=o),o=e.scalable,null!=o&&(n.scalable=o),o=e.minWidth,null!=o&&(n.minSize=o),null==n.scalable&&(n.scalable=null==n.size),this._layoutX.deserializeLane(t,n);let r=e.styles;for(i in r)this.setColumnStyle(t,i,r[i]);let s=e.classes;for(i in s)this.enableColumnClass(t,i,s[i]);let l=this._getColumnDef(t),a=e.id;a&&"string"==typeof a&&(l.id=a,l.userId=a);let u=e.field;u&&"string"==typeof u&&(l.field=u);let h=e.dataColumnName;null!=h&&(l.dataColumnName=h),h=e.stationary,null!=h&&(l.stationary=!!h),h=e.leftPinned,null!=h&&(l.leftPinned=!!h),h=e.rightPinned,null!=h&&(l.rightPinned=!!h),this.setColumnRenderingHandler(t,e.renderingHandler),this.setColumnDataBindingHandler(t,e.dataBindingHandler),h=e.columnData,h&&this.setColumnData(t,h);let p=e.formatter||e.binding;if(Array.isArray(p)&&(p=p[0]),p&&"function"!=typeof p){let t=p.init;"function"==typeof t&&t(e,this)}},ze.prototype.addRow=function(t){if(null==t)t=1;else if(t<=0)return;this.getColumnCount()<=0&&this.setColumnCount(1);let e=this.getLastSection();null==e&&(e=this.addSection()),e.addRow(t)},ze.prototype.removeRow=function(t){let e=this.getLastSection();null!=e&&(null==t&&(t=1),e.removeRow(t))},ze.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},ze.prototype.setSectionRowCount=function(t,e){let i=this.getSection(t);null!=i&&i.setRowCount(e)},ze.prototype.getRowIndex=function(t,e){return this._sectionStarts[t]+e},ze.prototype.getRelativeIndex=nt._deprecatedFunction,ze.prototype.removeAllRows=function(){let t=this._settings.length;for(let e=0;e<t;++e)this._settings[e].getSection().setRowCount(0),this._sectionStarts[e]=0;this._sectionStarts[t]=0},ze.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},ze.prototype.setDefaultRowHeight=function(t,e){if(this._layoutY.setDefaultLaneSize(t)){this._rowHeightSync=!1;let t=this._layoutY.getDefaultLaneSize();this._rowHeightException=e?"":"title";let i=this._settings.length;for(let e=0;e<i;++e){let i=this._settings[e];i.getType()!==this._rowHeightException&&"bottomPadding"!==i.getId()&&i.getSection().setDefaultRowHeight(t)}this._syncRowHeights(),this._rowHeightSync=!0,this.setRowScrollingStep(this._rowScrollingStep),this._updateColumnSeparators()}},ze.prototype.getDataSource=function(){return this._dataSource},ze.prototype.setDataConflationRate=function(t){this._dataSource.setConflationRate(t)},ze.prototype.getDataConflationRate=function(){return this._dataSource.getConflationRate()},ze.prototype.setDataSource=function(t){t&&t instanceof ft&&(t=new be(t));let e={};if(e.prevDataSource=this._dataSource,this._dataSource=t||null,e.dataSource=this._dataSource,this._dispatch("dataSourceChanged",e),this._autoSetDataSource){let e=this._settings.length;for(let i=0;i<e;++i)this._settings[i].setDataSource(t)}return this._dispatch("postDataSourceChanged",e),this._dataSource},ze.prototype.setColumnTemplate=nt._deprecatedFunction,ze.prototype.getColumnTemplate=nt._deprecatedFunction,ze.prototype.getColumnRenderEvent=nt._deprecatedFunction,ze.prototype.getColumnDataBindingEvent=function(t){console.log("getColumnDataBindingEvent() is deprecated. Use setColumnDataBindingHandler() instead");let e=this;return{listen:function(i){e.setColumnDataBindingHandler(t,i)},unlisten:function(){e.setColumnDataBindingHandler(t,null)}}},ze.prototype.setColumnStyle=function(t,e,i,n){if(!e)return;let o;nt.isNumber(t)||(t=0,console.log("WARNING: the first parameter for setColumnStyle must be column index")),null==n?o=this._getNestedColumnDef(t,"styles"):(n=this._toSectionType(n),o=this._getNestedColumnDef(t,n,"styles")),o[e]=i;for(let o=this._settings.length;--o>=0;){let r=this._settings[o];if(null==n||n===r.getType()){r.getSection().setColumnStyle(t,e,i)}}},ze.prototype.enableColumnClass=function(t,e,i,n){let o;"number"!=typeof t&&(t=0),null==n?o=this._getNestedColumnDef(t,"classes"):(n=this._toSectionType(n),o=this._getNestedColumnDef(t,n,"classes"));let r=!1;if((i=!1!==i)?o[e]||(r=o[e]=!0):o[e]&&(delete o[e],r=!0),r)for(let o=this._settings.length;--o>=0;){let r=this._settings[o];null!=n&&n!==r.getType()||r.getSection().enableColumnClass(t,e,i)}return r},ze.prototype.hasColumnClass=function(t,e,i){let n;return null==i?n=this._getNestedColumnDef(t,"classes"):(i=this._toSectionType(i),n=this._getNestedColumnDef(t,i,"classes")),!(!n||!n[e])},ze.prototype.setColumnAlignment=function(t,e){let i=e?e.charAt(0).toLowerCase():"",n=0;n|=this.enableColumnClass(t,"tr-align-left","l"===i),n|=this.enableColumnClass(t,"tr-align-right","r"===i),n|=this.enableColumnClass(t,"tr-align-center","c"===i),n&&this._dispatch("columnAlignmentChanged",{colIndex:t,alignment:i})},ze.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"},ze.prototype.getColumnLeft=function(t){let e=this._columnDefs[t];if(e&&e.rightPinned){let e=this.getElement().clientWidth,i=this._layoutX.getTrackSize(),n=i<e?i:e;for(let e=this.getColumnCount()-1;e>=t;--e)n-=this._layoutX.getLaneSize(e);return n}return this._hScrollbarEnabled&&t>=this._pinnedLeftColumnCount?this._layoutX.getLaneStart(t)-this._hscrollbar.getScrollLeft():this._layoutX.getLaneStart(t)},ze.prototype.getColumnRight=function(t){return this.getColumnLeft(t)+this._layoutX.getLaneSize(t)},ze.prototype.getColumnWidth=function(t){return this._layoutX.getLaneSize(t)},ze.prototype.getColumnCustomLaneSize=function(t){return this._layoutX.getCustomLaneSize(t)},ze.prototype._calculateColumnWidths=function(t,e){if(!this._preserveGridSize)return e;let i,n=0,o={},r=t.length,s=new Array(r);for(i=0;i<r;i++)o[t[i]]=!0,s[i]=e[i],n+=e[i];let l=0,a=0,u=this.getColumnCount(),h=this._layoutX;for(i=0;i<u;i++)o[i]||h.isLaneVisible(i)&&(h.getLaneScalability(i)?(l+=h.getMinimumLaneSize(i),a++):l+=h.getLaneSize(i));let p=this.getContentWidth(),d=n+l-p;if(a<1||d>0){for(h.resetLaneToDefaultSize(),h.setTrackSize(p-this._reservedSpace),l=0,i=0;i<u;i++)o[i]||h.isLaneVisible(i)&&(h.getLaneScalability(i)?l+=h.getMinimumLaneSize(i):l+=h.getLaneSize(i));if(d=n+l-p,d>0)for(d/=r,i=0;i<r;i++)s[i]-=d}return s},ze.prototype.setColumnWidth=function(t,e,i){let n=this._calculateColumnWidths([t],[e]),o=this._setColumnWidth(t,n[0],i);return o&&this._syncLayoutToColumns(t,t+1),o},ze.prototype.setColumnWidths=function(t,e){let i,n=0,o=[],r=[],s=[];for(i=t.length;--i>=0;){let n=t[i];null!=n&&(o.push(i),r.push(n));let l=Array.isArray(e)?e[i]:e;s.push(l)}let l=this._calculateColumnWidths(o,r);for(i=0;i<l.length;i++)n|=this._setColumnWidth(o[i],l[i],s[i]);return n&&this._syncLayoutToColumns(0,t.length),!!n},ze.prototype.isColumnVisible=function(t){return this._layoutX.isLaneVisible(t)},ze.prototype.hideColumn=function(t,e){let i=!1===e;this.setColumnVisibility(t,i,0)},ze.prototype.hideColumns=function(t,e){let i=Array.isArray(t)?t.length:0,n=[],o=this.getColumnCount();e=!1!==e;for(let r=0;r<i;++r){let i=t[r];i>=0&&i<o&&this._layoutX.hideLane(i,e,0)&&n.push(i)}if(n.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){let t={};t.colIndices=n,t.hidden=e,this._dispatch("columnVisibilityChanged",t)}},ze.prototype.showAllColumns=function(){let t=[],e=this.getColumnCount();for(let i=0;i<e;++i)this._layoutX.hideLane(i,!1,0)&&t.push(i);if(t.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){let e={};e.colIndices=t,e.hidden=!1,this._dispatch("columnVisibilityChanged",e)}},ze.prototype.getMinimumColumnWidth=function(t){return this._layoutX.getMinimumLaneSize(t)},ze.prototype.setMinimumColumnWidth=function(t,e){this._layoutX.setMinimumLaneSize(t,e)&&this._syncLayoutToColumns(t,t+1)},ze.prototype.setMinimumColumnWidths=function(t,e){let i=0,n=NaN,o=NaN;for(let r=t.length;--r>=0;){let s=t[r];null!=s&&(o||(o=r),n=r,i|=this._layoutX.setMinimumLaneSize(r,s,e))}return i&&this._syncLayoutToColumns(n,o+1),!!i},ze.prototype.getColumnScalability=function(t){return this._layoutX.getLaneScalability(t)},ze.prototype.setColumnScalability=function(t,e){let i=!1;return nt.isNumber(t)?(e=!1!==e,i=this._layoutX.setLaneScalability(t,e),i&&this._syncLayoutToColumns(t,t+1)):this.setDefaultColumnScalable(t),i},ze.prototype.setDefaultColumnScalable=function(t){this._layoutX.setDefaultScalability(!!t)},ze.prototype.resetColumnWidths=function(){let t=this._layoutX.resetLaneToDefaultSize();return t&&this._syncLayoutToColumns(0,this.getColumnCount()),t},ze.prototype.setColumnDefaultWidth=function(t,e){this._layoutX.setLaneDefaultSize(t,e)},ze.prototype.preserveProportion=function(t){this._preserveProportion=!0===t},ze.prototype.isProportionPreserved=function(){return this._preserveProportion},ze.prototype.preserveGridSize=function(t){this._preserveGridSize=!0===t},ze.prototype.getColumnData=function(t){return this._getColumnDef(t).columnData},ze.prototype.setColumnData=function(t,e){return this._getColumnDef(t).columnData=e||{},e},ze.prototype.newColumnData=ze.prototype.getColumnData,ze.prototype.setAlwaysRenderColumn=function(t,e){this.getColumnData(t).alwaysRender=!1!==e},ze.prototype._isAlwaysRenderColumn=function(t){return!0===this.getColumnData(t).alwaysRender},ze.prototype.getFitContentWidth=function(){return this._fitContentWidth},ze.prototype.setFitContentWidth=function(t){this._fitContentWidth!==t&&(this._fitContentWidth=t,this.enableClass("fit-width",this._fitContentWidth))},ze.prototype.loadPlugin=function(t,e){let i=null;if("string"==typeof t){let e=window.tr,n=e?e.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;let n=i.getName();if(!n)return null;let o=this._plugins[n];if(o){if(o===i)return o;console.log("WARNING: Two of the same "+n+"s cannot be loaded on a single grid. The existing plugin is replaced."),this.unloadPlugin(n)}return i.initialize&&i.initialize(this,e),this._plugins[n]=i,i},ze.prototype.unloadPlugin=function(t){let e;if(t){let i="";"string"==typeof t?i=t:t.getName&&(i=t.getName()),e=this._plugins[i],e||(i+="Plugin",e=this._plugins[i]),e&&(e.unload&&e.unload(this),delete this._plugins[i])}return e||null},ze.prototype.getPlugin=function(t){let e=this._plugins[t];return e||(e=this._plugins[t+"Plugin"]),e||null},ze.prototype.getPlugins=function(){let t=[];for(let e in this._plugins)t.push(this._plugins[e]);return t},ze.prototype.getPluginList=function(){let t=[];for(let e in this._plugins)t.push(e);return t},ze.prototype.freezeSection=function(t){this._fixFrozenTopSections=!0,this._freezeTopSectionAt(t)},ze.prototype.resetSectionFreezing=function(){this._fixFrozenTopSections=!1,this._updateFrozenTopSections()},ze.prototype._freezeTopSectionAt=function(t){if("number"==typeof t){let e=t+1;if(e===this._startVScrollbarIndex)return;this._startVScrollbarIndex=e}else this._startVScrollbarIndex=-1,"string"==typeof t&&(this._tempFrozenSectionRef=t);this._onSectionCountChanged()},ze.prototype.freezeFooter=function(t){this._fixFrozenBottomSection=!0,this._frozenFooterCount!==t&&(this._setFrozenFooter(t),this._onSectionCountChanged())},ze.prototype._setFrozenFooter=function(t){this._frozenFooterCount!==t&&(this._frozenFooterCount=t,this._vscrollbar.setFooterCount(t),this._hscrollbar.setFooterCount(t))},ze.prototype.getFooterCount=function(){return this._frozenFooterCount},ze.prototype.freezeColumn=function(t,e){let i,n,o=this.getColumnCount(),r=0,s=0,l=!1;if(t||0===t)for(this._hScrollbarEnabled=!0,r=t>=0?t+1:0,this._pinnedLeftColumnCount!==r&&(l=!0,this._pinnedLeftColumnCount=r),i=0;i<o;++i)n=this._getColumnDef(i),n.leftPinned=--r>=0;else this._hScrollbarEnabled=!1;if(null!=e)for(s=e>0?e:0,this._pinnedRightColumnCount!==s&&(l=!0,this._pinnedRightColumnCount=s),i=o;--i>=0;)n=this._getColumnDef(i),n.rightPinned=--s>=0;this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),this._updateColumnSeparators(),l&&(this._isEventDispatching("pinningChanged")||this._dispatch("pinningChanged",{}))},ze.prototype._countPinnedLeftColumns=function(){let t=0;if(this._hScrollbarEnabled)for(let e=this._columnDefs.length;--e>=0;){let i=this._columnDefs[e];if(i&&i.leftPinned){t=e+1;break}}return this._pinnedLeftColumnCount=t,t},ze.prototype._countPinnedRightColumns=function(){let t=0;if(this._hScrollbarEnabled){let e,i=this._columnDefs.length;for(e=0;e<i;++e){let t=this._columnDefs[e];if(t&&t.rightPinned)break}t=i-e}return this._pinnedRightColumnCount=t,t},ze.prototype.isPinnedColumn=function(t){return t<this.getFrozenColumnCount()||t>=this.getFirstPinnedRightIndex()},ze.prototype.getFrozenColumnCount=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:0},ze.prototype.getPinnedLeftColumnCount=ze.prototype.getFrozenColumnCount,ze.prototype.getPinnedRightColumnCount=function(){return this._pinnedRightColumnCount},ze.prototype.getFirstPinnedRightIndex=function(){return this.getColumnCount()-this._pinnedRightColumnCount},ze.prototype.updateLayout=function(){this._disposed||this._layoutUpdating||(this._layoutUpdating=!0,this._dispatch("preForcedUpdate",{}),this._updateLayout(),this._colVirtualizer.isEnabled()&&this._activateColumns(),this._layoutUpdating=!1)},ze.prototype.updateScrollbars=function(t,e){e&&this._updateScrollbarWidth(!0,!1),t&&this._updateScrollbarHeight(!0,!1)},ze.prototype.freezeLayout=function(t){t=!1!==t;let e=this._frozenLayout;if(e!==t){this._frozenLayout=t;let e,i,n=this.getPlugin("SortableTitlePlugin");this._frozenLayout&&n&&n.freezeIndicator(!0),this._frozenLayout||(this._disableEvent("widthChanged"),this._onSectionCountChanged(),this._onColumnCountChanged(),this._colVirtualizer.isEnabled()&&this._activateColumns()),this._rowHeightSync=!1;let o=this._settings.length;for(e=0;e<o;e++)i=this._settings[e].getSection(),i.setFrozenLayout(this._frozenLayout);if(!this._frozenLayout){this._syncLayoutToColumns(0,this.getColumnCount()),this._disableEvent("widthChanged",!1),this._dispatch("widthChanged",{}),this._syncRowHeights()||this._rowVirtualizer.update(!0),n&&n.freezeIndicator(!1)}this._rowHeightSync=!0}return e},ze.prototype.unfreezeLayout=function(t){this.freezeLayout(!1===t)},ze.prototype.isLayoutFrozen=function(){return this._frozenLayout},ze.prototype.showBorders=nt._deprecatedFunction,ze.prototype.hideBorders=nt._deprecatedFunction,ze.prototype.toggleBorders=function(t){this.toggleClass("no-borders",null!=t?!t:null)},ze.prototype.toggleGridlines=function(t){this.toggleClass("no-gridlines",null!=t?!t:null)},ze.prototype.toggleVerticalLines=function(t){this.toggleClass("no-vertical-grid-line",null!=t?!t:null)},ze.prototype.toggleHorizontalLines=function(t){this.toggleClass("no-horizontal-grid-line",null!=t?!t:null)},ze.prototype.toggleContentVerticalLines=function(t){this.toggleClass("no-content-vertical-line",null!=t?!t:null)},ze.prototype.getDataColumnMap=function(){let t=[];for(let e=this.getColumnCount();--e>=0;)t[e]=this.getDataColumnName(e);return t},ze.prototype.setDataColumnMap=function(t){let e,i;if(t)for(e=t.length;--e>=0;)i=this._getColumnDef(e),i.dataColumnName=t[e];else for(e=this._columnDefs.length;--e>=0;)i=this._columnDefs[e],i&&null!=i.dataColumnName&&(i.dataColumnName=null)},ze.prototype.getDataColumnName=function(t){return this._getColumnDef(t).dataColumnName||""},ze.prototype.setDataColumnName=function(t,e){this._getColumnDef(t).dataColumnName=e},ze.prototype.setDefaultRenderingHandler=function(t){this._renderingHandler="function"==typeof t?t:null},ze.prototype.setDefaultDataBindingHandler=function(t){this._dataBindingHandler="function"==typeof t?t:null},ze.prototype.setColumnRenderingHandler=function(t,e){this._getColumnDef(t).renderingHandler="function"==typeof e?e:null},ze.prototype.setColumnDataBindingHandler=function(t,e){this._getColumnDef(t).dataBindingHandler="function"==typeof e?e:null},ze.prototype.getColumnRenderingHandler=function(t){return this._getColumnDef(t).renderingHandler||null},ze.prototype.getColumnDataBindingHandler=function(t){return this._getColumnDef(t).dataBindingHandler||null},ze.prototype.enableRowHighlighting=function(t){if(null==t&&(t=!0),this._rowHighlighting!==t){this._rowHighlighting=t;let e=this.getAllSections("content");for(let t=e.length;--t>=0;)e[t].enableRowHighlighting(this._rowHighlighting)}},ze.prototype._getTarget=function(t){let e=t.target;if(e){let i=null;return this._element.contains(e)||(i=t.composedPath?t.composedPath():t.path),i?i[0]||null:e}return t.getElement?t.getElement():nt.isElement(t)?t:null},ze.prototype.getRelativePosition=function(t,e){if(!t)return{};let i=e||{},n=this._getTarget(t);t.target?nt.getRelativePosition(t,this.getElement(),i):n&&nt.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;let o=nt.closestElement(n,"cell");if(!o)return i;i.cellElement=o;let r=nt.closestElement(o,"column");i.columnElement=r;let s=null;if(s=r?nt.closestElement(r,"tr-lg"):nt.closestElement(o,"tr-lg"),!s)return i;i.sectionName=s.id||nt.closestElement(s,"tr-vlg").id;let l=this.getSectionSettings(i.sectionName);if(!l)return i;l.extendEventArg(i);let a=l.getSection(),u=a.getColumnIndex(r||o);return u<0?i:(i.colIndex=u,!1===this._hitTestY(-1,i)||(o.stretched?i.cell=a.getStretchedCell(u,i.rowIndex):i.cell=a.getCell(u,i.rowIndex),i.hit=!0),i)},ze.prototype.getVScrollbar=function(){return this._vscrollbar},ze.prototype.getHScrollbar=function(){return this._hscrollbar},ze.prototype.autoHideScrollbars=function(t){t=null==t||t,this._vscrollbar.setAutoHide(t),this._hscrollbar.setAutoHide(t)},ze.prototype.getVScrollStartIndex=function(){return this._startVScrollbarIndex},ze.prototype.getHScrollStartIndex=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:-1},ze.prototype.scrollToColumn=function(t,e){if(!this._updateScrollbar(this._hscrollbar))return!1;let i=this._layoutX.getLaneCount();if(t<=0?t=0:t>=i&&(t=i-1),this.isPinnedColumn(t))return!1;let n=this._hScrollbarEnabled?this._layoutX.getLaneStart(this._pinnedLeftColumnCount):0,o=this._hscrollbar.getScrollLeft(),r=o+n,s=this._hscrollbar.getWidth(),l=this._layoutX.hitTest(r),a=this._layoutX.getLaneStart(t),u=this._layoutX.getLaneSize(t);if(e||u>=s||t<=l){let t=a-n;if(o!==t)return this._hscrollbar.setScrollLeft(t),!0}else{let e=r+s;if(t>=this._layoutX.hitTest(e-.1)){let t=o+(a+u)-e;return this._hscrollbar.setScrollLeft(t),!0}}return!1},ze.prototype.getScrollLeft=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getScrollLeft():0},ze.prototype.setScrollLeft=function(t){this._updateScrollbar(this._hscrollbar)&&this._hscrollbar.setScrollLeft(t)},ze.prototype.scrollRight=function(t){this.setScrollLeft(this._hscrollbar.getScrollLeft()+t)},ze.prototype.getScrollWidth=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getContentWidth():0},ze.prototype.getYScrollVal=function(t,e,i){if(!this._updateScrollbar(this._vscrollbar))return null;let n=null;t&&(n=this.getSection(t));let o=this._layoutY.getLaneCount();e<=0?e=0:e>=o&&(e=o-1);let r=this.getVerticalViewInfo(),s=r.topRowIndex,l=-1;if(i)l=e;else if(e<s)l=e-3,l<0&&(l=0);else{let t=r.bottomRowIndex;if(e>t){l=e-(t-s)+3,l<0&&(l=0)}}let a=n?n.getRowOffset():this._sectionStarts[this._startVScrollbarIndex],u=this._layoutY.getLaneStart(this._startVScrollbarIndex);return l>=0?this._layoutY.getLaneStart(l+a)-u:null},ze.prototype.scrollToRow=function(t,e,i){let n=this.getYScrollVal(t,e,i);null!==n&&this._vscrollbar.setScrollTop(n)},ze.prototype.getVerticalViewInfo=function(){let t=this._sectionStarts[this._startVScrollbarIndex],e=this._layoutY.getLaneStart(t),i=this._vscrollbar.getHeight(),n=this._vscrollbar.getScrollTop()+e,o=n+i;return{topRowIndex:this._layoutY.hitTest(n)-t,bottomRowIndex:this._layoutY.hitTest(o-.1)-t}},ze.prototype.getVScrollView=function(){if(!this._updateScrollbar(this._vscrollbar))return null;let t=this._layoutY.getLaneCount();if(0===t)return null;let e=this._sectionStarts[this._startVScrollbarIndex],i=this._layoutY.getLaneStart(e),n=this._vscrollbar.getScrollTop()+i,o=this._vscrollbar.getHeight(),r=n+o,s=this._layoutY.hitTest(n),l=this._layoutY.hitTest(r-.1),a=this._layoutY.getLaneStart(s),u=this._layoutY.getLaneEnd(l),h=n-o,p=h<=i?e:this._layoutY.hitTest(h)+1,d=r+o,c=d>=this._layoutY.getTrackSize()?t-1:this._layoutY.hitTest(d-.1)-1;s-=e,l-=e;let _={};return _.viewTop=n-i,_.viewBottom=r-i,_.topRowIndex=s,_.bottomRowIndex=l,_.firstFullRow=a<n?s+1:s,_.lastFullRow=u>r?l-1:l,_.prevPageRowIndex=p-e,_.nextPageRowIndex=c-e,_},ze.prototype.getScrollTop=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getScrollTop():0},ze.prototype.setScrollTop=function(t){this._updateScrollbar(this._vscrollbar)&&this._vscrollbar.setScrollTop(t)},ze.prototype.scrollDown=function(t){this.setScrollTop(this._vscrollbar.getScrollTop()+t)},ze.prototype.getScrollHeight=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getContentHeight():0},ze.prototype.restoreScrollbars=function(){this._vscrollbar.restoreTrackPosition()},ze.prototype.enableAutoSetDataSource=function(t){this._autoSetDataSource=t},ze.prototype.getRowVirtualizer=function(){return this._rowVirtualizer},ze.prototype.getColumnVirtualizer=function(){return this._colVirtualizer},ze.prototype.enableRowVirtualization=function(t){this._rowVirtualizer.enable(t),this._rowVirtualizer.isEnabled()&&this._vscrollbar.isEnabled()?this._rowVirtualizer.activate():this._rowVirtualizer.deactivate()},ze.prototype.isRowVirtualizationEnabled=function(){return this._rowVirtualizer.isEnabled()},ze.prototype.enableColumnVirtualization=function(t){this._colVirtualizer.enable(t);let e=this._colVirtualizer.isEnabled();for(let t=this._settings.length;--t>=0;){this._settings[t].enableColumnVirtualization(e)}},ze.prototype.isColumnVirtualizationEnabled=function(){return this._colVirtualizer.isEnabled()},ze.prototype.setRowScrollingStep=function(t){this._rowScrollingStep=t>0?t:0,this._vscrollbar.setScrollingStep(this._layoutY.getDefaultLaneSize()*this._rowScrollingStep)},ze.prototype.getVMouseWheelHandler=function(){return this._vscrollbar.getDefaultMouseWheelLogic()},ze.prototype.synchronizeVScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);let 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)},ze.prototype.synchronizeHScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);let 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)},ze.prototype.updateRowData=function(t,e,i,n){let o=this.getSectionSettings(t||"content");o&&o.updateRowData(e,i,n)},ze.prototype.rerender=function(){let t=this._settings.length;for(let e=0;e<t;e++)this._settings[e].rerender()},ze.prototype.requestRowRefresh=function(){this._rowRefreshTimer||(this._rowRefreshTimer=setTimeout(this._onRowRefresh,100))},ze.prototype._requestScrollbarUpdate=function(){this._updateScrollbarHeight(!0,!0),this._rowHeightTimerId=0},ze.prototype.deactivateRendering=function(t){if((t=!1!==t)==this._noBinding)return;this._noBinding=t;let e=this.getSectionSettings("content");e&&(e.disableDataBinding(t),t||this.requestRowRefresh())},ze.prototype._onRowRefresh=function(){this._rowRefreshTimer=0,this.updateRowData()},ze.prototype.disableLazyRendering=function(t){console.log("WARNING: This function is deprecated.")},ze.prototype.getData=function(t,e,i){let n=this.getSectionSettings(t);if(!n)return null;let o=this._toDataColumnName(e);return n.getData(o,i)},ze.prototype.setData=function(t,e,i,n){let o=this.getSectionSettings(t);if(o&&o.isDataBindable()){let t=this._toDataColumnName(e);return o.setData(t,i,n)}return!1},ze.prototype.removeRowData=function(t,e){let i=this.getSectionSettings(t);return!(!i||!i.isDataBindable())&&i.removeRowData(e)},ze.prototype.setHidingMethod=function(t){if(t||(t=""),this._hidingMethod!==t){this._hidingMethod=t;let e=this.getAllSections();for(let i=e.length;--i>=0;)e[i].setHidingMethod(t)}},ze.prototype.getHorizontalLayout=function(){return this._layoutX},ze.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")){let i={};i.colIndex=t,i.hidden=!e,this._dispatch("columnVisibilityChanged",i)}return!0}return!1},ze.prototype.getColumnVisibility=function(t,e){return this._layoutX.getLaneVisibilityBit(t,e)},ze.prototype.reserveRightSpace=function(t){if(this._reservedSpace!==t){this._reservedSpace=t;for(let e=this._settings.length;--e>=0;)this._settings[e].getSection().reserveRightSpace(t);return this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),!0}return!1},ze.prototype.getHiddenInput=function(){return this._hiddenInput},ze.prototype.focus=function(){let t=this._hiddenInput,e=document.activeElement;if(t&&t!==e){let e=window.pageXOffset,i=window.pageYOffset;if(t.setActive)try{t.setActive()}catch(e){t.focus({preventScroll:!0})}else t.focus({preventScroll:!0});i===window.pageYOffset&&e===window.pageXOffset||window.scrollTo(e,i)}},ze.prototype.isBinding=function(){return this._dispatchingDataChanged},ze.prototype.hideRow=function(t,e){this._dataSource.hideRow(t,e)},ze.prototype.hideRows=function(t,e){Array.isArray(t)?this._dataSource.hideRows(t,e):this._dataSource.hideRow(t,e)},ze.prototype.showRows=function(t,e){Array.isArray(t)?this._dataSource.showRows(t,e):this._dataSource.showRows([t],e)},ze.prototype.unhideAllRows=function(){this._dataSource.unhideAllRows()},ze.prototype.hasHiddenRow=function(){return this._dataSource.hasHiddenRow()},ze.prototype.initSimpleTable=function(t){let e=0;t||this.getColumnCount()||(t=["Default"]),t&&(e=t.length,this.setColumnCount(e),this.setDataColumnMap(t));let i=this.addSection("title");if(i.addRow(1),!this._renderingHandler)for(let n=0;n<e;++n)i.setCellContent(n,0,t[n]);this.addSection("content");let n=this.getSectionSettings("title");n.disableDataBinding();let o=this.getSectionSettings("content");o.setAutoSyncRowCount(!0),o.setParent(n),this._dataBindingHandler||this.setDefaultDataBindingHandler(ze._defaultDataBinding)},ze._defaultDataBinding=function(t){t.cell.setContent(t.dataValue)},ze.prototype.selectColumn=function(t,e){for(let i=this._settings.length;--i>=0;)this._settings[i].getSection().selectColumn(t,e);this._updateColumnBounds()},ze.prototype.isSelectedColumn=function(t){let e=this._settings[0]||null;return!!e&&e.getSection().isSelectedColumn(t)},ze.prototype._updateColumnBounds=function(){if(this._columnBoundConflator.conflate())return;let t=this._settings.length;if(!t)return;let e,i=[],n=null,o=this.getColumnCount(),r=[];for(e=0;e<o;e++)this.isSelectedColumn(e)?(r.push(e),n||(n=[e,-1])):n&&(n[1]=e-1,i.push(n),n=null);n&&(n[1]=o-1,i.push(n),n=null);let s={selectedColumns:r,selectionRanges:i};this._dispatch("beforeColumnBoundUpdate",s);let l=i.length,a=[],u=[],h=this._settings[0],p=h.getSection();for(e=0;e<l;++e){n=i[e];let t=[0,0],o=[!1,!1];p.calculateColumnBounds(n[0],n[1],t,o),t[0]<t[1]&&(a.push(t),u.push(o))}let d=0,c=-1;for(null!=s.topBoundRowIndex&&(c=+s.topBoundRowIndex),c>=0&&"title"===h.getType()&&(d=this._layoutY.getLaneStart(c)),p.updateColumnBounds(a,u,d),e=1;e<t;e++)p=this._settings[e].getSection(),p.updateColumnBounds(a,u)},ze.prototype._updateColumnSeparators=function(){let t=this._settings.length;if(t)for(let e=0;e<t;e++){let t=this._settings[e].getSection();t&&t.updateColumnSeparators()}},ze.prototype.getColumnRect=function(t,e){let i=this.getElement().clientWidth,n=i,o=this._hscrollbar;o.isActive()&&(n=o.getTrackSize());let r=0,s=0;if(this._settings.length){let i=[0,0];this._settings[0].getSection().calculateColumnBounds(t,e,i,[]),r=i[0],s=i[1]-r}return{top:0,left:r,width:s,height:this._layoutY.getTrackSize(),leftPinnedIndex:this._pinnedLeftColumnCount-1,rightPinnedIndex:this.getFirstPinnedRightIndex(),scrollViewSize:n,gridWidth:i}},ze.prototype.getRowRect=function(t,e){let i=this._layoutX.getTrackSize(),n=this.getElement().clientWidth;i=i<n?i:n;let o=this.getSection("content"),r=o?o.getRowOffset():1,s=this._layoutY,l=s.getLaneStart(r),a=0,u=o.getHeight(),h=this._vscrollbar;h.isActive()&&(a=h.getScrollTop(),u=h.getTrackSize());let p=u+l,d=s.getLaneStart(t+r)-a,c=s.getLaneEnd(e+r)-a;return d<l?d=l:d>p&&(d=p),c<l?c=l:c>p&&(c=p),d-=l,c-=l,{top:d,left:0,width:i,height:c-d,scrollViewSize:u,scrollViewTop:l,scrollViewBottom:p}},ze.prototype.normalizeConfig=function(t){t||(t={});let e,i,n=t.columns,o=n?n.length:0,r=t.columnFreezing;null==r&&(r=t.freezeColumn);let s=t.pinnedRightColumns||t.frozenRightColumns;if(s)for(delete t.pinnedRightColumns,delete t.frozenRightColumns,t.columnVirtualRendering=!1,t.columnVirtualization=!1,e=o;--e>=0;)--s>=0&&(i=n[e],i&&(i.rightPinned=!0));return null!=r&&(delete t.columnFreezing,delete t.freezeColumn,r>=0&&n&&(i=n[r],i&&(i.leftPinned=!0))),t},ze.prototype.setColumnGrouping=function(t){this._groupDefs=t||null},ze.prototype.getColumnGroupParentId=function(t){if(this._groupDefs){let e="number"==typeof t?this.getColumnId(t):t;return this._groupDefs.getParentId(e)}return""},ze.prototype.getColumnGroupChildIds=function(t){if(this._groupDefs){let e=this._groupDefs.getLeafDescendants(t);if(e&&e.length>0)return e}return null},ze.prototype.getValidColumnList=function(t,e){let i=[];if(!t)return i;e||(e=this.createColumnMap(t));let n=this.getColumnCount();for(let t=0;t<n;++t){let n=this._getColumnDef(t).id;null!=e[n]&&i.push({index:t,id:n})}return i},ze.prototype.createColumnMap=function(t){t||(t=this.getColumnIds());let e={},i=t.length;for(let n=0;n<i;n++){let i=t[n];"number"==typeof i&&(i=this.getColumnId(i)),i&&(e[i]=!0)}return e},ze.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)},ze.prototype.stopBatch=function(t){return!!t&&(this._dispatch("afterBatchOperation",{batches:this._batches,batchType:t}),"reset"===t&&this._disableEvent("columnVisibilityChanged",!1),delete this._batches[t],y(this._batches)&&(this._batches=null),!0)},ze.prototype._dispatchColumnEvent=function(t,e){let i=this._batches;i&&(e.batches=i),this._dispatch(t,e)},ze.prototype._dispatchColumnPositionChanged=function(){this._columnPositionConflator.conflate()||this._dispatch("columnPositionChanged",{sender:this})},ze.prototype._dispatchRowPositionChanged=function(){this._rowPositionConflator.conflate()||this._dispatch("rowPositionChanged",{sender:this})},ze.prototype._getAllSections=function(){let t=[],e=this._settings.length;for(let i=0;i<e;i++)t.push(this._settings[i].getSection());return t},ze.prototype._getNextSection=function(t,e,i){let n=this.getSectionIndex(e)+t;if(null==i)return this.getSectionSettings(n);i=this._toSectionType(i);let o=this._settings.length;for(;n>=0&&n<o;){let e=this._settings[n];if(i===e.getType())return e;n+=t}return null},ze.prototype._toSectionType=function(t){if(ze._sectionType[t])return t;if(nt.isString(t)){switch(t.charAt(0).toLowerCase()){case"t":return"title";case"h":case"s":return"header";case"f":return"footer"}}return"content"},ze.prototype._newSection=function(t,e){if(e)for(let t=this._settings.length;--t>=0;)if(this._settings[t].getId()===e)return null;t=this._toSectionType(t);let i={horizontalScrollbar:this._hscrollbar},n="content"===t?new Fe(i):new ge(i);n._setContext(this);let o=new De(n);o.setId(e),o.setType(t),o.listen("dataChanged",this._onSectionDataChanged),o.listen("rowAvailable",this._onRowAvailable);let r="content"===t&&this._rowHighlighting;return n.enableRowHighlighting(r),n.enableShading(!1),n.setHidingMethod(this._hidingMethod),o.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),o},ze.prototype._putToLast=function(t){if(0===this._settings.length)t.setParent(this._element,!0);else{let e=this.getLastSection().getElement().nextSibling;null!==e?t.insertBefore(e):t.setParent(this._element)}},ze.prototype._syncStyleToSectionColumns=function(t,e){let i;for(let n=this._columnDefs.length;--n>=0;){let o=this._getColumnDef(n),r=o.styles;for(i in r)t.setColumnStyle(n,i,r[i]);let s=o.classes;for(i in s)t.enableColumnClass(n,i,!0);let l=o[e];if(l){for(i in r=l.styles,r)t.setColumnStyle(n,i,r[i]);for(i in s=l.classes,s)t.enableColumnClass(n,i,!0)}}},ze.prototype._syncRowHeights=function(){let t=this._settings.length;for(let e=0;e<t;++e)this._syncSectionRowHeights(this._settings[e].getSection());return!this._frozenLayout&&this._updateScrollbarHeight(!0,!0)},ze.prototype._syncSectionRowHeights=function(t){this._layoutY.copyFrom(t.getRowLayout(),this._sectionStarts[t.getIndex()])},ze.prototype._setColumnWidth=function(t,e,i){let n=!1,o=this._layoutX;if(null!=i)n=o.setLaneScalability(t,!!i);else{let i=o.getLaneScalability(t);if(this._preserveProportion){if(i){let i=this.getColumnCount(),n=0,r=0;for(let t=0;t<i;++t){if(!o.getLaneScalability(t))continue;let e=o.getLaneSize(t);n+=o.getCustomLaneSize(t),r+=e}(!(e=(e*n-e*o.getCustomLaneSize(t))/(r-e))||e<0)&&(e=n)}}else n=o.setLaneScalability(t,!1)}return n=o.setLaneSize(t,e)||n,n},ze.prototype._dispatchColumnAddedEvent=function(t,e,i,n){let o={};if(this._hasListener("columnAdded"))if(o.atTheMiddle=i,1===e)o.colIndex=t,o.context=n,this._dispatchColumnEvent("columnAdded",o);else{let i=Array.isArray(n)?n:[];for(let n=0;n<e;++n)o.colIndex=t+n,o.context=i[n],this._dispatchColumnEvent("columnAdded",o)}this._frozenLayout&&(o.noDataUpdate=!0),this._dispatchColumnRenderEvent(o,t,t+e,0,this._settings.length,NaN,NaN)},ze.prototype._dispatchColumnRenderEvent=function(t,e,i,n,o,r,s){if(!(n<o))return;let l;if(t.sender=this,t.fromColIndex=e,t.toColIndex=i,this._hasListener("preSectionRender"))for(l=n;l<o;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("preSectionRender",t);for(let a=e;a<i;++a){let e=this.getColumnRenderingHandler(a)||this._renderingHandler;if(e)for(t.colIndex=a,t.dataColumnName=this.getDataColumnName(a),l=n;l<o;++l){let i=this._settings[l];i.extendRenderEventArg(t,r,s);let n=i.getSection(),o=t.fromRowIndex,u=t.toRowIndex;for(let i=o;i<u;++i)t.rowIndex=i,t.cell=n.getCell(a,i,!1),e(t)}}if(this._hasListener("postSectionRender"))for(l=n;l<o;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("postSectionRender",t);if(!t.noDataUpdate&&!this._noBinding)for(l=n;l<o;++l)this.updateRowData(this._settings[l],r,s-1)},ze.prototype._dispatchRowExpansionBinding=function(t){if(!this._hasListener("rowExpansionBinding"))return;let e=t.dataSource;if(!e||!e.getDataSource())return;let i=t.fromRowIndex,n=t.toRowIndex,o=e.getVisibleRowIds(!0),r=t.section;t.rowData=null,t.cell=null;let s=!1;for(let l=n-1;l>=i;--l){let i=e.getRowId(l);if(!s){let t=e.getRowExpansionCount(i);if(t>0){l=l+t+1,s=!0;continue}}let n=r.getContextRow(l),a=e.getExpansionParentByRowId(i);if(a)t.originalRowData=e.getRowData(a),t.originalRowId=a,t.rowExpansion=n.rowExpansion=!0;else{if(!n.rowExpansion)continue;t.originalRowData=null,t.originalRowId=null,t.rowExpansion=n.rowExpansion=!1}t.rowId=o[l],t.rowIndex=l,this._dispatch("rowExpansionBinding",t)}t.originalRowData=null,t.originalRowId=null,t.rowExpansion=!1},ze.prototype._removeColumn=function(t){let e=this._layoutX.getLaneCount();if(t>e&&(t=e),t<=0)return;let i=e-t;this._layoutX.setLaneCount(i);for(let t=this._settings.length;--t>=0;){this._settings[t].getSection().setColumnCount(i)}let n=this._columnDefs.slice(i);if(this._columnDefs.length=i,this._onColumnCountChanged(),this._syncLayoutToColumns(i,0,!0),this._hasListener("columnRemoved")){let t={};for(let o=e;--o>=i;){let e=n[o-i];t.colIndex=o,t.columnData=e?e.columnData:null,this._dispatchColumnEvent("columnRemoved",t)}}},ze.prototype._onSectionDataChanged=function(t){if(this._dispatchingDataChanged)return;let e=this._layoutX.getLaneCount();if(this._dispatchingDataChanged=!!e,!e)return;let i,n,o=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),n=l.getMultipleRowData(i,o,r),t.dataRows=n);let u="content"===t.sectionType;u&&this._dispatch("beforeContentBinding",t),this._dispatch("preSectionDataBinding",t);let h=this.getDataColumnMap();for(let l=0;l<e;++l)if(s.isColumnActive(l)&&(this.isColumnVisible(l)||this._isAlwaysRenderColumn(l))){let e=this.getColumnDataBindingHandler(l)||this._dataBindingHandler;if(e){let u=h[l];t.dataColumnName=u,t.colIndex=l;for(let h=o;h<r;++h){if(a){let e=n[h];t.rowData=e,t.rowId=i[h],t.dataValue=e?e[u]:null}t.rowIndex=h,t.cell=s.getCell(l,h,!1),e(t)}}}this._dispatch("postSectionDataBinding",t),this._dispatchRowExpansionBinding(t),u&&(this._firstRendered||(this._dispatch("firstRendered",t),this._firstRendered=!0),this._dispatch("afterContentBinding",t)),s._startBindingSession(!1),this._dispatchingDataChanged=!1},ze.prototype.resetInternalState=function(){this._firstRendered=!1},ze.prototype._updateScrollbar=function(t){return!!t&&(t.isEnabled()&&t.update(),t.isActive())},ze.prototype._onVScroll=function(t){this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop()),this._dispatchRowPositionChanged()},ze.prototype._onHScroll=function(t){let e=this._hscrollbar.getScrollLeft();this._colVirtualizer.setViewOffset(e),this._updateColumnBounds(),this._dispatchColumnPositionChanged()},ze.prototype._onVScrollEnabled=function(){this._updateScrollbarHeight(!0,!1),this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.activate(),this._vscrollbar.getAutoHide()||this._updateVScrollbar()},ze.prototype._onVScrollDisabled=function(){this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.deactivate()},ze.prototype._onRowInViewChanged=function(t){let e=t.firstIndex,i=t.lastIndex+1,n=this._settings.length,o=[0,0];for(let t=0;t<n;++t){let n=this._settings[t],r=n.getSection();r&&!r.getFrozenLayout()&&(r.activateRows(e,i,o),this.updateRowData(n,o[0],o[1]-1))}},ze.prototype._onColInViewChanged=function(t){if(!this.getColumnCount())return;let e=t.prevFirstIndex,i=t.prevLastIndex,n=t.firstIndex,o=t.lastIndex,r=e<n?e:n,s=i>o?i:o;this._activateColumns(n,o,r,s);let l=this.getSectionCount();for(let t=0;t<l;++t){let e=this._settings[t];this.updateRowData(e)}},ze.prototype._activateColumns=function(t,e,i,n){null==i&&(i=0),null==n&&(n=this.getColumnCount()-1);let o=this._getColActivationList(t,e,i,n);for(let t=this.getSectionCount();--t>=0;){this._settings[t].activateColumns(o,i,n)}},ze.prototype._getColActivationList=function(t,e,i,n){null==i&&(i=0);let o=this.getColumnCount();null==n&&(n=o-1),null==t&&(t=this._colVirtualizer.getFirstIndexInView()),null==e&&(e=this._colVirtualizer.getLastIndexInView());let r=this.getHScrollStartIndex(),s=this.getFirstPinnedRightIndex(),l=new Array(n+1);for(let o=i;o<=n;++o)l[o]=o<r||o>=t&&o<=e||o>=s;return l},ze.prototype._getColumnDef=function(t){if(t>=0){let e=this._columnDefs[t];return e||(e=this._columnDefs[t]={id:""+ze._runningColumnId++,columnData:{}}),e}return{columnData:{}}},ze.prototype._getNestedColumnDef=function(t,e,i){let n=this._getColumnDef(t);if(e){let t=n;n=t[e],n||(n=t[e]={}),i&&(t=n,n=t[i],n||(n=t[i]={}))}return n},ze.prototype.getColumnId=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).id||""},ze.prototype._getColumnId=ze.prototype.getColumnId,ze.prototype.getColumnIds=function(){let t=this.getColumnCount(),e=new Array(t);for(let i=0;i<t;++i)e[i]=this._getColumnDef(i).id||"";return e},ze.prototype.setColumnField=function(t,e){this._getColumnDef(t).field=e||""},ze.prototype.getColumnField=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).field||""},ze.prototype.getColumnFields=function(){let t=this.getColumnCount(),e=new Array(t);for(let i=0;i<t;++i)e[i]=this._getColumnDef(i).field||"";return e},ze.prototype.getColumnIndex=function(t){if("number"==typeof t)return t;if(t){let e=t,i=this.getColumnCount();for(let t=0;t<i;++t){let i=this._getColumnDef(t);if(e===i.id||e===i.field)return t}}return-1},ze.prototype.getColumnIndices=function(t){let e=[],i=this.getColumnCount(),n=Array.isArray(t)?t:[t],o=n.length;for(let t=0;t<o;++t){let o=this.getColumnIndex(n[t]);o>=0&&o<i&&e.push(o)}return e},ze.prototype.getColumnIndexMap=function(){let t=this.getColumnCount(),e={},i="";for(let n=0;n<t;++n){let t=this._getColumnDef(n);i=t.field,i&&(e[i]=n),i=t.id,i&&(e[i]=n)}return e},ze.prototype._onWindowResize=function(){this._updateLayout(),this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop())},ze.prototype._onMouseMove=function(){this._vscrollbar.flash(),this._hscrollbar.flash()},ze.prototype._onGridClicked=function(){if(window.getSelection().toString())return;let t=document.activeElement;this._element.contains(t)||this.focus()},ze.prototype._onRowHightlighted=function(t){if(!this._hasListener("rowHighlighted"))return;let e=t.sender,i=this.getSectionSettings(e.getId());if(null==i)return;i.extendEventArg(t);let n=i.getDataSource();null!==n&&(t.rowId=n.getRowId(t.rowIndex),t.dataRow=n.getRowData(t.rowId)),this._dispatch("rowHighlighted",t)},ze.prototype._onRowCountChanged=function(t){if(this._disposed)return;let e=t.sender,i=t.prevCount,n=t.rowCount,o=e.getIndex(),r=this._updateSectionIndices(o),s=0;if(i>n)this._layoutY.removeLaneAt(r,i-n),this._layoutY.isHomogeneous()||this._syncSectionRowHeights(e);else{let t=this._layoutY.getDefaultLaneSize(),o=e.getDefaultRowHeight();if(this._layoutY.insertLane(r+i,n-i),o!==t)for(s=i;s<n;++s)this._layoutY.setLaneSize(r+s,o)}let l=t.noBinding,a=o<=this._startVScrollbarIndex||o>=this._getFooterStartIndex(),u=this._frozenFooterCount>0,h=this._updateScrollbarHeight(a,u,l);l&&(this._hasPendingRowChange=!0),this._frozenLayout||h||(this._rowVirtualizer.isVirtualizable()?e.activateRows(this._rowVirtualizer.getFirstIndexInView(),this._rowVirtualizer.getLastIndexInView()):e.activateRows()),this._hasPendingRowChange=!1,u||this._updateVScrollbar(),this._updateColumnSeparators(),i<n?this._dispatch("rowAdded",t):i>n&&this._dispatch("rowRemoved",t)},ze.prototype._onRowHeightChanged=function(t){if(!this._rowHeightSync)return;if(this._disposed)return;if(this._rowHeightConflator.conflate(t))return;let e=this._rowHeightConflator.popAllData(),i=e.length,n=NaN;for(let t=0;t<i;++t){let i=e[t],o=i.section;if(!this._containsSection(o))continue;let r=o.getIndex(),s=i.rowIndex,l=this.getRowIndex(r,s),a=i.changeLength;for(let t=0;t<a;++t)this._layoutY.setLaneSize(l+t,o.getRowHeight(s+t))&&(r>=n||(n=r))}this._rowHeightConflator._needScrollbarUpdate?(this._rowHeightConflator._needScrollbarUpdate=!1,this._updateScrollbarHeight(!0,!0)):n>=0&&(this._dispatchingDataChanged?this._rowHeightTimerId||(this._rowHeightTimerId=setTimeout(this._requestScrollbarUpdate,0)):this._updateScrollbarHeight(n<this._startVScrollbarIndex,n>=this._startVScrollbarIndex)),this._updateColumnSeparators(),this._dispatchRowPositionChanged()},ze.prototype._containsSection=function(t){for(let e=this._settings.length;--e>=0;)if(this._settings[e].getSection()===t)return!0;return!1},ze.prototype._onRowAvailable=function(t){if(this._hasPendingRowChange)return;let e=t.sectionIndex;this._dispatchColumnRenderEvent(t,0,this.getColumnCount(),e,e+1,t.prevRowIndex,t.rowIndex)},ze.prototype._onSectionCountChanged=function(t){if(!this._frozenLayout){if(this._tempFrozenSectionRef){let t=this.getNextSection(this._tempFrozenSectionRef);null!==t&&(this._startVScrollbarIndex=t.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()}},ze.prototype._onColumnCountChanged=function(){if(this._frozenLayout||this._disposed)return;let 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()},ze.prototype._onSyncVScroll=function(t){this._vscrollbar.setScrollTop(t.scrollTop)},ze.prototype._onSyncHScroll=function(t){this._hscrollbar.setScrollLeft(t.scrollLeft)},ze.prototype._getFooterStartIndex=function(){return this.getSectionCount()-this._frozenFooterCount},ze.prototype._getVScrollStart=function(){return this._getSectionSize(0,this._startVScrollbarIndex)},ze.prototype._getFooterSize=function(){return this._frozenFooterCount>0?this._getSectionSize(this._getFooterStartIndex()):0},ze.prototype._getSectionSize=function(t,e){if(t){if(t<0)return 0}else t=0;null==e&&(e=this.getSectionCount()-t);let i=this._layoutY.getLaneStart(this._sectionStarts[t]),n=t+e;return(e>0?this._layoutY.getLaneStart(this._sectionStarts[n]):0)-i},ze.prototype._updateScrollbarHeight=function(t,e,i){if(!this._vscrollbar.isEnabled())return!1;let n=e,o=t&&this._startVScrollbarIndex>=0,r=this._rowHeightConflator.isConflating();if(r&&(this._rowHeightConflator._needScrollbarUpdate=!0,n=!1),o&&!r){let t=this.getElement();if(!t)return!1;let e=this.getParent(),i=this._vscrollbar.getParent();i?i!==e&&i.firstElementChild&&(i=i.firstElementChild):(i=t,this._vscrollbar.setParent(i));let n=this._getVScrollStart(),o=this._getFooterSize();i!==t&&(n+=t.clientTop),this._vscrollbar.resetPaneSize();let r=i.clientHeight-(n+o)*this._zoomFactor;this._vscrollbar.setTop(n*this._zoomFactor),this._vscrollbar.setTrackSize(r,r/this._zoomFactor);let s=this._layoutY.getDefaultLaneSize(),l=12*s;r>l&&(l=(Math.ceil(r/s)+4)*s),this._rowVirtualizer.setViewSize(l/this._zoomFactor);let a=this._sectionStarts[this._startVScrollbarIndex],u=this.getFooterCount(),h=0;if(u){let t=this.getSectionCount();h=this._sectionStarts[t]-this._sectionStarts[t-u]}this._rowVirtualizer.setViewBounds(a,h)}else this._rowVirtualizer.validateVirtualization();let s=!1;return i||(s=this._rowVirtualizer.update()),this._vscrollbar.invalidate(n),s},ze.prototype._updateScrollbarWidth=function(t,e){if(!this._frozenLayout){if(t&&this._hScrollbarEnabled){let t=this.getElement(),e=this._hscrollbar.getParent();e||(e=this.getParent()||t,this._hscrollbar.setParent(e));let i=this._layoutX.getLaneStart(this._pinnedLeftColumnCount),n=this._layoutX.getLaneCount(),o=0,r=this._countPinnedRightColumns();r&&(o=this._layoutX.getLaneStart(n)-this._layoutX.getLaneStart(n-r));let s=e!==t?t.clientLeft:0,l=e.clientWidth-(i+s+o)*this._zoomFactor;r>0&&(l-=this._reservedSpace),this._hscrollbar.setPaneLeft(i),this._hscrollbar.setLeft((i+s)*this._zoomFactor),this._hscrollbar.setTrackSize(l,l/this._zoomFactor);let a=4*this._layoutX.getDefaultLaneSize();l>a&&(a=l),this._colVirtualizer.setViewSize(a/this._zoomFactor),this._colVirtualizer.setViewBounds(this._pinnedLeftColumnCount,r)}else this._colVirtualizer.validateVirtualization();this._colVirtualizer.update(),this._hscrollbar.invalidate(e)}},ze.prototype._hitTestY=function(t,e){let i;if(e.sectionSettings)i=e.sectionSettings;else{let n;n="number"==e.rowIndex?e.rowIndex:this._layoutY.hitTest(t);let o=n>=0?n:~n,r=nt.upperBound(this._sectionStarts,o)-1;if(e.sectionIndex=r,i=this._settings[r],!i)return!1;i.extendEventArg(e)}let n=i.getSection();return null!=e.colIndex&&e.cellElement?e.rowIndex=n.getCellIndex(e.colIndex,e.cellElement):e.rowIndex=rowIndex+n.getRowOffset(),!0},ze.prototype._syncLayoutToColumns=function(t,e,i){if(this._frozenLayout)return;let n=this._layoutX.getLaneCount(),o=this.fillParentWidth(100);(o||null==t||null==e)&&(t=0,e=n,o=!0);let r=this._settings.length;if(r<=0)return;let s=!1;if(t<e)for(let i=0;i<r;++i)s=this._syncLayoutToSectionColumns(this._settings[i].getSection(),t,e)||s;let l=o||t<this.getHScrollStartIndex()||e>this.getFirstPinnedRightIndex();this._updateScrollbarWidth(l,!0),this._updateColumnBounds(),this._updateColumnSeparators(),this._dispatchColumnPositionChanged(),(s||i)&&this._dispatch("widthChanged",{from:t,to:e,colChanged:t})},ze.prototype._syncLayoutToSectionColumns=function(t,e,i){null==e&&(e=0),null==i&&(i=this._layoutX.getLaneCount());let n=0;for(let o=e;o<i;++o)n|=t._setColumnWidth(o,this._layoutX.getLaneSize(o));return!(!n||this._frozenLayout)&&(t._updateColumnLayout(),!0)},ze.prototype._toDataColumnName=function(t){return nt.isNumber(t)?this.getDataColumnName(t):t},ze.prototype._updateSectionIndices=function(t){this._updatePaddingBottomSect()&&--t,t<0&&(t=0);let 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"));let n=this._settings[e-1]||null;n!==this._lastSettings&&(this._lastSettings&&this._lastSettings.getSection().removeClass("last"),this._lastSettings=n,this._lastSettings&&this._lastSettings.getSection().addClass("last")),this._sectionStarts.length=e+1,this._sectionStarts[0]=0;for(let i=t;i<e;++i){let t=this._settings[i].getSection();t.setIndex(i),t.setRowOffset(this._sectionStarts[i]),this._sectionStarts[i+1]=this._sectionStarts[i]+t.getRowCount()}return this._sectionStarts[t]},ze.prototype._updateLayout=function(){let t=this.getElement();if(this._disposed||!t.offsetParent)return;this._syncLayoutToColumns(),this._updateScrollbarHeight(!0,!0),this._updateScrollbarWidth(!0,!0);let e=this.getSectionCount();for(let t=0;t<e;++t){this._settings[t].getSection().updateLayout()}this._updateColumnSeparators()},ze.prototype._updateVScrollbar=function(){!this._disposed&&this._vscrollbar.isEnabled()&&(this._vScrollbarConflator.conflate()||this._vscrollbar.update())},ze._proto=ze.prototype;let Ve={chainIcon:""};Ve.styles=function(t){if(t){let e="";if(Array.isArray(t)){e=t.map(w).join("\n").replace(/{\s*{/g,"{").replace(/\s+{/g," {")}else e="string"==typeof t?t:t+"";if(e)return e.replace(/{[\w\W]*?}/g,b)}return""}([".tr-grid .chain-icon",["cursor: pointer;"],".tr-grid .chain-icon .fallback-arrow",["vertical-align: middle;","font-size: 7px;","line-height: 1;","display: inline-block;","transform: scaleX(1.5);","font-family: Arial;"],".tr-grid .closed .chain-icon",["transform: translate(0px, -1px) rotate(-90deg);"]]),Ve.applyStyle=function(t){t&&!t._rowGroupingStyles&&(t._rowGroupingStyles=!0,R(Ve.styles,t.getElement()))};var ke=Ve;let Oe=function(){this._counter={},this._session={},this._referers={}};Oe.prototype._counter=null,Oe.prototype._session=null,Oe.prototype._referers=null,Oe.prototype.reset=function(){this._counter={},this._referers={},this.newSession()},Oe.prototype.newSession=function(){this._session={}},Oe.prototype.getAllReferences=function(){return Object.keys(this._counter)},Oe.prototype.getAllReferers=function(){return Object.keys(this._referers)},Oe.prototype.getAllReferrers=Oe.prototype.getAllReferers,Oe.prototype.getSession=function(){let t=[],e=[];for(let i in this._session){let n=this._session[i];n>0?t.push(i):n<0&&e.push(i)}return{newEntries:t.filter(Boolean),removedEntries:e.filter(Boolean)}},Oe.prototype.addReference=function(t,e){if(t){if(e){let i=this._referers[e];if(i){if(i[t])return!1}else i=this._referers[e]={};i[t]=1}if(!this._counter[t])return this._counter[t]=1,-1===this._session[t]?this._session[t]=0:this._session[t]=1,!0;++this._counter[t]}return!1},Oe.prototype.addRef=Oe.prototype.addReference,Oe.prototype.removeReference=function(t,e,i){if(!t)return!1;let n=this._counter[t];if(!n)return!1;if(null==i)i=1;else if(i<0)i=n;else if(!i)return!1;if(e){let i=this._referers[e];if(!i)return!1;if(!i[t])return!1;delete i[t]}return n-=i,!n||n<0?(delete this._counter[t],1===this._session[t]?this._session[t]=0:this._session[t]=-1,!0):(this._counter[t]=n,!1)},Oe.prototype.release=Oe.prototype.removeReference,Oe.prototype.addReferences=function(t,e){if(!t)return 0;let i=0;if(Array.isArray(t)){let n=t.length;for(let o=0;o<n;++o)this.addReference(t[o],e)&&++i}else if("string"==typeof t)this.addReference(t,e)&&++i;else for(let n in t)this.addReference(n,e)&&++i;return i},Oe.prototype.removeReferer=function(t){let e=0;if(t){let i=this._referers[t];if(i){for(let n in i)this.removeReference(n,t)&&++e;delete this._referers[t]}}return e},Oe.prototype.removeReferrer=Oe.prototype.removeReferer,Oe.prototype.log=function(){console.log(this._counter)};var Ne=Oe;let He=function(){let t=this;t._commitRicsChanges=t._commitRicsChanges.bind(this),t._commitFieldsChanges=t._commitFieldsChanges.bind(this),t._fieldChangedConflator=new r(0,t._commitFieldsChanges),t._ricChangedConflator=new r(0,t._commitRicsChanges),t._fields=new Ne,t._rics=new Ne,t._rowDefMap={}};s.inherits(He,a),He.prototype._fieldChangedConflator=null,He.prototype._ricChangedConflator=null,He.prototype._rowDefMap=null,He.prototype._rics=null,He.prototype._fields=null,He.prototype.getAllRics=function(){return this._rics.getAllReferences()},He.prototype.getAllRowDefs=function(){let t=[];for(let e in this._rowDefMap)t=t.concat(this._rowDefMap[e]);return t},He.prototype.getAllFields=function(){return this._fields.getAllReferences()},He.prototype.getRowDefByRic=function(t){return this._rowDefMap[t]||null},He.prototype.addRic=function(t){let e=t?t.getSymbol():"";if(!e)return!1;let i=this._rowDefMap,n=i[e];n?n.indexOf(t)<0&&n.push(t):n=i[e]=[t];let o=this._rics.addReference(e,t.getRowId());return this._commitRicsChanges(),o},He.prototype.removeRic=function(t,e){if(e||(e=t?t.getSymbol():""),!e)return;let i=this._rowDefMap[e];if(i){let e=i.indexOf(t);e>=0&&i.splice(e,1)}this._rics.removeReference(e,t.getRowId()),this._commitRicsChanges()},He.prototype.removeAllRics=function(){let t=this._rics.getAllReferers();for(let e in t)this._rics.removeReferer(t[e]);this._rowDefMap={},this._commitRicsChanges()},He.prototype._commitRicsChanges=function(){if(this._ricChangedConflator.conflate())return;let t=this._rics,e=t.getSession(),i=e.removedEntries,n=e.newEntries;i.length&&this._doDispatch({type:"ricRemoved",removedRics:i}),n.length&&this._doDispatch({type:"ricAdded",addedRics:n}),t.newSession()},He.prototype.addFields=function(t,e){if(!t)return;let i=this._fields;t instanceof Vt?i.addReferences(t.getAllFields(),t.getId()):i.addReferences(t,e),this._commitFieldsChanges()},He.prototype.removeFields=function(t,e){t&&(t instanceof Vt?this._fields.removeReferer(t.getId()):this._fields.removeReference(t,e),this._commitFieldsChanges())},He.prototype.removeFieldReferrer=function(t){this._fields.removeReferer(t),this._commitFieldsChanges()},He.prototype.removeAllFields=function(){let t=this._fields.getAllReferers();for(let e in t)this._fields.removeReferer(t[e]);this._commitFieldsChanges()},He.prototype._commitFieldsChanges=function(){if(this._fieldChangedConflator.conflate())return;let t=this._fields,e=t.getSession(),i=e.removedEntries,n=e.newEntries;i.length&&this._doDispatch({type:"fieldRemoved",removedFields:i}),n.length&&this._doDispatch({type:"fieldAdded",addedFields:n}),t.newSession()},He.prototype._doDispatch=function(t){let e=this;t.fields=e.getAllFields(),t.rics=e.getAllRics(),t.rowDefs=e.getAllRowDefs(),e._dispatch(t.type,t)},He.prototype.reset=function(){let t=this;t._rowDefMap={},t._fields.reset(),t._rics.reset(),t._fieldChangedConflator.reset(),t._ricChangedConflator.reset()};var Be=He;let Ge=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},We=function(){this._defaultSorter=this._defaultSorter.bind(this),this._dataSorter=this._dataSorter.bind(this),this._rowDefSorter=this._rowDefSorter.bind(this),this._multiColumnsSorter=this._multiColumnsSorter.bind(this),this._globalContext={},this._sortParams=[],this._ctxCaches=[]};We.prototype._globalContext,We.prototype._sortParams,We.prototype._ctxCaches,We.prototype._primaryParams,We.prototype.dispose=function(){this._globalContext={},this._sortParams.length=0,this._ctxCaches.length=0,this._primaryParams=null},We.prototype.getSorter=function(){this._primaryParams=null;let t=this._sortParams.length;if(1===t){let t=this._primaryParams=this._sortParams[0];if(t[1]){return t[3]?this._rowDefSorter:this._dataSorter}return this._defaultSorter}return t>1?this._multiColumnsSorter:We._noSorting},We.prototype.reset=function(){this._sortParams.length&&(this._sortParams.length=0)},We.prototype.setContext=function(t,e){this._globalContext[t]=e},We.prototype.addColumnContext=function(t,e,i,n,o,r){t||(t="");let s=this._sortParams.length,l=this._ctxCaches[s];l||(l=this._ctxCaches[s]=g(this._globalContext));let a=0;"a"===n?a=1:"d"===n&&(a=-1);let u=[t,"function"==typeof e?e:null,l,i,a];l.colIndex=o,l.field=t,l.formattedField=t+"_FORMATTED",l.colDef=r,this._sortParams.push(u)},We._noSorting=function(t,e,i){return 0},We.prototype._defaultSorter=function(t,e,i){let n=this._primaryParams[0];return Ge(t.getData(n),e.getData(n),i)},We.prototype._dataSorter=function(t,e,i){let n=this._primaryParams,o=n[0];return(0,n[1])(t.getData(o),e.getData(o),i,n[2])},We.prototype._rowDefSorter=function(t,e,i){let n=this._primaryParams;return(0,n[1])(t,e,i,n[2])},We.prototype._multiColumnsSorter=function(t,e,i){let n=this._sortParams,o=n.length;for(let i=0;i<o;++i){let o=n[i],r=o[0],s=o[1],l=o[2],a=o[3],u=o[4],h=0;if(h=s?a?s(t,e,u,l):s(t.getData(r),e.getData(r),u,l):Ge(t.getData(r),e.getData(r),u),h)return h}return 0};var Ue=We;let Ye=function(t){let 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})};l.inherits(Ye,lt),Ye.prototype._hosts=null,Ye.prototype._sortStates,Ye.prototype._maxCount=1,Ye.prototype._dataSorting=!0,Ye.prototype._dblClickAllowed=!1,Ye.prototype._clickTimer=0,Ye.prototype._delayInterval=0,Ye.prototype._lastMouseDown=0,Ye.prototype._initialSort=null,Ye.prototype._mode="",Ye.prototype._sortableColumns=!0,Ye.prototype._sortableIndicator=!1,Ye.prototype._solarTheme=!1,Ye.prototype._sortLogic,Ye.prototype._userManagedLogic=!1,Ye.prototype._disabled=!1,Ye.prototype._frozenIndicator=!1,Ye.prototype._rowDefMode=!1,Ye._icons={},Ye.prototype._sortingSequence,Ye.prototype._sortingSequenceMap=null;Ye.prototype.getName=function(){return"SortableTitlePlugin"},Ye.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))},Ye.prototype.unload=function(t){let 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))},Ye.prototype.afterInit=function(){let t=this;t.setSortLogics(t._sortLogic);let e=t._initialSort;null!=e&&(Array.isArray(e)?1===t._maxCount?t.sortColumns(e.slice(0,1)):t.sortColumns(e):t.sortColumns([e]))},Ye.prototype.config=function(t){if(!t)return;let e=this,i=t.icons;null!=i&&i.sorting&&(Ye._icons=i.sorting);let n=t.themeName;!n||n.indexOf("solar")>=0?e._solarTheme=!0:e._solarTheme=!1,e._initialSort=e._initialSortByColumnField(t);let o=t.sorting;if(!o)return;o.ROW_DEF&&(this._rowDefMode=!0),o.userManagedLogic&&(e._userManagedLogic=!0);let r=o.multiColumn||o.multicolumn;if(null!=r&&(!0===r&&(r=-1),!1===r&&(r=1),e.setSortableColumnCount("number"==typeof r&&r>0?r:-1)),r=o.sortableIndicator,null!=r&&(e._sortableIndicator=r),r=o.disabled,null!=r&&(e._disabled=!!r),r=o.threeStatesSorting,null!=r&&e.disableTwoStateSorting(r),r=o.sortingSequence,null!=r&&Array.isArray(r)&&(e._sortingSequence=r),r=o.mode,null!=r&&(e._mode=r,"manual"===r&&e.disableDataSorting()),r=o.indicatorOnly,null!=r&&e.disableDataSorting(r),r=o.disableDoubleClickToSort,null!=r&&e.disableDoubleClickToSort(r),r=o.columnSorted,"function"==typeof r&&e.listen("columnSorted",r),r=o.preClicked,"function"==typeof r&&e.listen("preClicked",r),r=o.clicked,"function"==typeof r&&e.listen("clicked",r),r=o.preDataSorting,"function"==typeof r&&e.listen("preDataSorting",r),r=o.sortableColumns,null!=r&&(e._sortableColumns=r),r=o.initialSort,"object"==typeof r&&(e._initialSort=r),r=o.sortLogic,"object"==typeof r)for(let t in r)"function"==typeof r[t]&&(e._sortLogic[t]=r[t])},Ye.prototype.getConfigObject=function(t){let e=t||{},i=e.columns;i||(i=e.columns=[]);let n=this._hosts[0];if(!n)return e;let o,r,s,l,a,u=this.getSortedColumns();if(1===this._maxCount&&null!=u)for(s=u.length,r=0;r<s;r++){let t=u[r],e=t.colIndex;o=i[e],o||(o=i[e]={}),o.sortOrder=t.sortOrder}for(s=n.getColumnCount(),r=0;r<s;++r)o=i[r],o||(o=i[r]={}),l=this._getSortOptions(r),l&&(this._sortableColumns?l.disabled&&(o.sortable=!1):l.disabled||(o.sortable=!0),a=l.field,a&&(null!=o.field&&o.field!==a&&(o.sortBy=a),this._sortingSequenceMap&&this._sortingSequenceMap[a]&&(o.sortingSequence=this._sortingSequenceMap[a])));let h=e.sorting;h||(h=e.sorting={});let p=u;null!=p&&(h.initialSort=p),p=this._sortableIndicator,!1!==p&&(h.sortableIndicator=p),1!==this._maxCount&&(h.multiColumn=-1===this._maxCount||this._maxCount),this._dblClickAllowed&&(h.disableDoubleClickToSort=!this._dblClickAllowed),p=this._sortableColumns,!0!==p&&(h.sortableColumns=p),p=this._dataSorting,!0!==p&&(h.indicatorOnly=p),this._disabled&&(h.disabled=!0);let d=this._sortingSequence,c=!0;return 2===d.length&&"a"===d[0]&&"d"===d[1]&&(c=!1),c&&(h.sortingSequence=d.slice()),y(e.sorting)&&delete e.sorting,e},Ye.prototype.getColumnMenu=function(t,e){e||(e={});let i=e.menus;i||(i=e.menus=[]);let n=i[0];n||(n=i[0]={menuItems:[]});let o=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"===o,click:this._onItemSortingClicked},{indexScore:2,label:"Descending",radioMode:!0,value:{colIndex:t,order:"d"},selected:"d"===o,click:this._onItemSortingClicked},{indexScore:1,label:"Un-Sort",radioMode:!0,value:{colIndex:t,order:"n"},selected:"n"===o,click:this._onItemSortingClicked}]}};return n.menuItems.push(r),e},Ye.prototype._onItemSortingClicked=function(t){this._hosts[0].getPlugin("ColumnMenuPlugin").hide();let e=t.currentTarget.value,i=e.colIndex,n=e.sortOrder;this.sortColumn(i,n)},Ye.prototype.getIcons=function(){return Ye._icons},Ye.prototype.setSortLogics=function(t){if(null!=t){let e=this._hosts[0];if(e){let i=e.getDataSource();for(let e in t)this._setSortLogic(i,e,t[e])}}},Ye.prototype.setSortLogic=function(t,e){if("string"==typeof t){let i=this._hosts[0];if(i){let n=i.getDataSource();this._setSortLogic(n,t,e)}}},Ye.prototype._setSortLogic=function(t,e,i){t&&"string"==typeof e&&("*"===e?t.setSortingLogic(i):t.setColumnSortingLogic(e,i))},Ye.prototype.getSortOrder=function(t){let e=null!=t?this.getSortPriority(t):0,i=this._sortStates[e];return(i?i.sortOrder:"")||"n"},Ye.prototype.getSortedColumnIndex=function(t){return this._getColumnIndex(this._sortStates[t||0])},Ye.prototype.getSortPriority=function(t,e){let i=this._hosts[0];if(i){let n,o=this._sortStates.length;if(t>=0){let e=i.getColumnId(t);if(e)for(n=0;n<o;++n)if(this._sortStates[n].colId===e)return n}else if(e)for(n=0;n<o;++n){let t=this._sortStates[n];if(t.colId===e)return n;if(t.field===e)return n}}return-1},Ye.prototype.isColumnSorted=function(t){return this.getSortPriority(t)>=0},Ye.prototype.getSortedColumns=function(){let t=this._sortStates.length;if(t<=0)return null;let e=new Array(t);for(let i=0;i<t;++i){let t=this.getSortedColumnIndex(i),n=this._sortStates[i],o={},r="";t>=0&&(o.colIndex=t,r=this._getColumnId(t)),r&&(o.colId=r);let s=n.field||"";s&&(o.field=s),o.sortOrder=n.sortOrder||"n",e[i]=o}return e},Ye.prototype.isSorting=function(){return!!this._sortStates.length},Ye.prototype.sortColumn=function(t,e,i){this._sortColumn(this._prepareSorting(t,e),i)},Ye.prototype.sortColumns=function(t,e){if(Array.isArray(t)){let i=t.length,n=new Array(i);for(let e=0;e<i;e++)n[e]=this._prepareSorting(t[e]);this._sortColumn(n,e)}},Ye.prototype.clearSortState=function(t){this._popSortState(0,t)&&this.updateSortSymbols()},Ye.prototype.refresh=function(){this._sortStates.length&&(this._sortDataView(),this.updateSortSymbols())},Ye.prototype.restoreUserActions=Ye.prototype.refresh,Ye.prototype.setSortableColumnCount=function(t){this._maxCount=t||1,this._popSortState(this._maxCount)},Ye.prototype.getSortingStates=function(){return this._sortStates},Ye.prototype.updateSortSymbols=function(){if(!this._disabled)for(let t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},Ye.prototype.getDataColumnMap=function(){let t=this._hosts[0],e=[];if(t){let i=t.getColumnCount();for(let t=0;t<i;++t)e[t]=this.getColumnSortingField(t)}return e},Ye.prototype.getDataColumnNames=Ye.prototype.getDataColumnMap,Ye.prototype.setDataColumnMap=function(t){if(Array.isArray(t))for(let e=t.length;--e>=0;)this.setColumnSortingField(e,t[e])},Ye.prototype.setDataColumnNames=Ye.prototype.setDataColumnMap,Ye.prototype.getColumnSortingField=function(t){let e=this._getSortOptions(t),i=e?e.field:null;if(null==i&&!this._rowDefMode){let n=this._hosts[0];n&&(i=n.getColumnField(t),i||(i=n.getDataColumnName(t)),i&&e&&(e.field=i))}return i||""},Ye.prototype.setColumnSortingField=function(t,e,i,n){if("number"==typeof t&&null!=e){let o=this._newSortOptions(t);e||(e=""),o.field!==e&&(o.field=e),null==i||this._userManagedLogic||o.sortLogic!==i&&(o.sortLogic=i||null,n&&i&&(i.rowSorting=!0))}};let qe=function(t){return t.field||""};Ye.prototype.getColumnSortingFields=function(){return this._sortStates.map(qe)},Ye.prototype.setFirstSortOrder=function(t,e){"a"!==(e=e?Ye._toSortOrder(e):"a")&&"d"!==e&&(e="a");let i=null;i=Array.isArray(t)?t:[t];let n=i.length;for(let t=0;t<n;++t){let n=i[t],o=this.getSortingSequence(n).slice(),r=o.indexOf(e);r>=0&&o.splice(r,1),o.unshift(e),this.setSortingSequence(o,n)}},Ye.prototype.disableTwoStateSorting=function(t){let e=this._sortingSequence.indexOf("n");!1===t?e>=0&&this._sortingSequence.splice(e,1):e<0&&this._sortingSequence.push("n")},Ye.prototype.freezeIndicator=function(t){let e=this._frozenIndicator;if(this._frozenIndicator=!1!==t,e&&!this._frozenIndicator)for(let t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},Ye.prototype.disableSortSymbols=function(t){},Ye.prototype.disableDataSorting=function(t){this._dataSorting=!1===t},Ye.prototype.disableDoubleClickToSort=function(t){this._dblClickAllowed=!t},Ye.prototype.disableCellClick=function(t,e){t&&t.enableClass("no-sort",!1!==e)},Ye.prototype.disableColumnSorting=function(t,e){if(e=!1!==e,"number"==typeof t)this._disableColumnSorting(t,e);else if(Array.isArray(t)){let i=t.length;for(let n=0;n<i;++n)this._disableColumnSorting(t[n]||0,e)}},Ye.prototype._disableColumnSorting=function(t,e){let i=this._newSortOptions(t);i.disabled!==e&&(i.disabled=e)},Ye.prototype.setClickDelayInterval=function(t){this._delayInterval=null!=t?t:500},Ye.prototype._initialSortByColumnField=function(t){let e=t.columns,i=e?e.length:0;for(let t=0;t<i;t++){let i=e[t].defaultSort;if(i)return{colIndex:t,sortOrder:i}}return null},Ye.prototype._onSectionAdded=function(t){if("title"!==t.sectionType)return;let e=t.section;0===e.getIndex()&&(e.listen("mousedown",this._onMouseDown),e.listen("click",this._onClickTitle.bind(this,t.sender),0))},Ye.prototype._onUIUpdated=function(t){"title"===t.sectionType&&this.updateSortSymbols()},Ye.prototype._canClickToSort=function(t){if(this._disabled)return!1;let e=t.grid;if(!e||!e.getElement())return!1;let i=this._getPlugin("CellEditingPlugin");if(i&&i.isEditing())return!1;if(this._dispatch("preClicked",t),t.cancel)return!1;let n=t.colIndex,o=t.section,r=t.rowIndex;return!!this._isCellSortable(o,n,r)},Ye.prototype._proceedSorting=function(t){if(this._clickTimer=0,this._canClickToSort(t)){let e=t.colIndex;this.sortColumn(e,null,{isUserAction:!0});let i=t.grid;if(i&&i.focus&&i.focus(),this._hasListener("clicked")){let t={};t.colIndex=e,t.sortOrder=this.getSortOrder(e),t.dataColumnName=this.getColumnSortingField(e),this._dispatch("clicked",t)}}},Ye.prototype._onMouseDown=function(t){t.button||(this._lastMouseDown=t.timeStamp)},Ye.prototype._getPlugin=function(t){let e=this._hosts[0];return e?e.getPlugin(t):null},Ye.prototype.clickTitleByMouse=function(t,e){this._onClickTitle(t,e)},Ye.prototype._onClickTitle=function(t,e){if(this._disabled)return;if(2===e.detail&&!this._dblClickAllowed)return void(this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0));if(e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)return;if(!(e.timeStamp-this._lastMouseDown<500))return;let i=t.getRelativePosition(e);if(!i.hit)return;let n=this._getPlugin("ColumnSelectionPlugin");if(n&&n.isEnabled()){let t=i.colIndex;if(!n.isSelectedColumn(t))return}i.target=e.target,this._delayInterval>0?this._clickTimer||(this._clickTimer=setTimeout(this._proceedSorting.bind(this,i),this._delayInterval)):this._proceedSorting(i)},Ye.prototype._popSortState=function(t,e){if(t<0||this._sortStates.length<=t)return!1;let i=!1;for(let e=this._sortStates.length;--e>=t;)this._clearSortSymbols(this._sortStates[e]),i=!0;return this._sortStates.length=t,this._sortDataView(e),i},Ye._toSortOrder=function(t){return!t||"string"!=typeof t||"d"!==(t=t.charAt(0).toLowerCase())&&"a"!==t?"n":t},Ye.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},Ye.prototype.setSortingSequence=function(t,e){if(Array.isArray(t))t.length||(t=null);else if(t)return;let i;if(null!=e&&("string"==typeof e?i=e:"number"==typeof e&&(i=this.getColumnSortingField(e))),t){let e=t.map(Ye._toSortOrder);i?(this._sortingSequenceMap||(this._sortingSequenceMap={}),this._sortingSequenceMap[i]=e):this._sortingSequence=e}else i?this._sortingSequenceMap&&delete this._sortingSequenceMap[i]:this._sortingSequence=this._sortingSequence.length>2?["a","d","n"]:["a","d"]},Ye.prototype.clearAllColumnSortingSequences=function(){this._sortingSequenceMap=null},Ye.prototype.sortSeparators=function(t){let e=this._hosts[0].getDataSource();if(t)e.sortSeparators(t);else{let t=e.getSortingLogics(),i=[],n=[],o=this._sortStates.length,r=Ye._toRowDefField();for(let t=0;t<o;t++){let e=this._sortStates[t],o=this._rowDefMode?r:e.field;i.push(e.sortOrder),n.push(o)}e.sortSeparators(t,i,n)}},Ye.prototype._prepareSorting=function(t,e){if(!this._maxCount)return null;let i=this._hosts[0];if(!i)return null;let n=-1,o="";"number"==typeof t?n=t:"string"==typeof t?(o=t,n=this._getColumnIndex(o)):t&&"object"==typeof t&&(o=t.colId||t.field,o?n=this._getColumnIndex(o):"number"==typeof t.colIndex&&(n=t.colIndex),e||(e=t.sortOrder||t.order||null));let r="",s=null;if(n>=0){r=this.getColumnSortingField(n);let t=this._getSortOptions(n);t&&(s=t.sortLogic)}else o&&(r=o);let l=this.getSortPriority(n,r),a=l>=0?this._sortStates[l]:null,u=a?a.sortOrder:"n",h="n";if(null==e){let t=this.getSortingSequence(r),e=t.indexOf(u);e=e<0?0:(e+1)%t.length,h=t[e]}else h=Ye._toSortOrder(e);if(a){if(u===h)return this.updateSortSymbols(),null;this._sortStates.splice(l,1),this._clearSortSymbols(a)}if("a"===h||"d"===h){if(n<0&&!r)return null;if(!a){a={};let t=i.getColumnId(n);t&&(a.colId=t)}a.field=r,a.sortLogic=s||null,this._sortStates.push(a)}a&&("n"!==u?a.prevOrder=u:delete a.prevOrder,a.order=h,a.sortOrder=h);let p=[];if(this._maxCount>0)for(;this._sortStates.length>this._maxCount;){let t=this._clearSortSymbols(this._sortStates.shift());null!==t&&p.push(t)}return{colIndex:n,sortedField:r,sortOrder:h||"n",prevOrder:u,clearedSortColIndexes:p}},Ye.prototype._sortColumn=function(t,e){if(!t)return;this._sortDataView(e),this.updateSortSymbols();let i=null;if(Array.isArray(t)){let e=t.length;for(let n=0;n<e;++n){let e=t[n];e&&(i?(i.colIndices||(i.colIndices=[],i.sortedFields=[],i.sortOrders=[],i.prevOrders=[]),i.colIndices.push(e.colIndex),i.sortedFields.push(e.sortedField),i.sortOrders.push(e.sortOrder),i.prevOrders.push(e.prevOrder)):i=e)}i=t[0]}else i=t;this._dispatch("columnSorted",i)},Ye.prototype._onColumnAdded=function(t){let e=this,i=t.colIndex,n=t.context||{},o=!!e._sortableColumns,r=n.field,s=n.sortBy;null!=s&&(o=!!s,r=s),null!=n.sortable&&(o=!!n.sortable);let l=n.sortLogic||n.sortingLogic||n.sorter;l||(l=e._sortLogic[r]),"function"!=typeof l&&(l=null);let a=n.sortingSequence;null!=a&&r&&e.setSortingSequence(a,r),o?e.setColumnSortingField(i,r,l,n.rowSorting):e.disableColumnSorting(i,!0);let u=n.sortOrder||n.sort;null!=u&&(u=Ye._toSortOrder(u),"n"!==u&&(e.clearSortState(),e.sortColumn(i,u)))},Ye.prototype._onColumnRemoved=function(t){let e=this._sortStates.length;if(!e)return;let i=t.colId;if(i)for(let t=0;t<e;++t){let e=this._sortStates[t];if(e.colId===i){this._sortStates.splice(t,1),this._clearSortSymbols(e),this._sortDataView();break}}},Ye._toRowDefField=function(t){return"ROW_DEF"},Ye.prototype._sortDataView=function(t){if(t=t||{},this._dispatch("preDataSorting",t),!this._dataSorting)return;let e=this._sortStates.length;this._userManagedLogic&&e>1&&(e=1);let i=null,n=null,o=null;if(e){i=new Array(e),n=new Array(e);for(let t=0;t<e;++t)i[t]=this._sortStates[t].sortOrder,n[t]=this._sortStates[t].sortLogic;o=this._rowDefMode?this._sortStates.map(Ye._toRowDefField):this.getColumnSortingFields(),this._userManagedLogic&&o.length>1&&(o=o.slice(0,1))}for(let e=this._hosts.length;--e>=0;){let r=this._hosts[e].getDataSource();if(r){let e=1==t.isUserAction;r.sort(o,i,n,e)}}},Ye.prototype._clearSortSymbols=function(t){let e=t.targetCells;if(!e)return null;let i=null;for(let t=e.length;--t>=0;){let n,o=e[t];o.removeClass("sorting"),o.removeClass("sortable"),o.removeFloatingIcon("sort-symbol"),o.removeFloatingIcon("priority-symbol"),null==i&&(n=o.getSection())&&(i=n.getColumnIndex(o.getParent()))}return e.length=0,i},Ye.prototype._updateSortableIndicator=function(t){let e=this,i=e._hosts[t];if(!i||this._frozenIndicator)return;let n=i.getSection("title");if(null!=n)for(let i=n.getColumnCount();--i>=0;){let o=n.getRowCount();for(let r=0;r<o;r++){let s=n.getCell(i,r,!0);if(!s)continue;if(s.removeClass("sorting"),s.removeClass("sortable"),s.removeClass("asc"),s.removeClass("desc"),s.removeClass("edge-indicator"),s.removeFloatingIcon("sort-symbol"),s.removeFloatingIcon("priority-symbol"),s.removeFloatingIcon("sortable-indicator"),r!==o-1)continue;if(!e._isCellSortable(n,i,r))continue;s.addClass("sortable");let l,a,u=e.getSortPriority(i),h=e._sortStates[u];if(h&&"n"!==h.sortOrder){if(h.targetCells||(h.targetCells=[]),h.targetCells[t]=s,"a"===h.sortOrder?s.addClass("asc"):s.addClass("desc"),s.addClass("sorting"),e._solarTheme){let t;"a"===h.sortOrder?(t="▲",a=Ye._icons.ascending):(t="▼",a=Ye._icons.descending),l=e._createIconElem(a,t),l.className="sort-symbol",s.insertFloatingIcon(l,0)}else s.addClass("edge-indicator");e._sortStates.length>1&&(l=document.createElement("span"),l.className="priority-symbol",l.textContent=u+1,s.insertFloatingIcon(l,1))}else e._sortableIndicator&&(a=Ye._icons.sortable,l=e._createIconElem(a,"◊"),l.className="sortable-indicator",s.insertFloatingIcon(l,0))}}},Ye.prototype._createIconElem=function(t,e){let i;return t&&"string"==typeof t?(i=document.createElement("ef-icon"),i.setAttribute("icon",t)):(i=document.createElement("span"),i.textContent=e),i},Ye.prototype._getColumnIndex=function(t){if(null!=t){let e=this._hosts[0];if(e)return"number"==typeof t?t:"string"==typeof t?e.getColumnIndex(t):e.getColumnIndex(t.colId)}return-1},Ye.prototype._getColumnId=function(t){let e=this._hosts[0];return e&&null!=t?e.getColumnId(t):""},Ye.prototype._getSortOptions=function(t){let e=this._hosts[0];return e&&e.getColumnData(t).sortableTitle||null},Ye.prototype._newSortOptions=function(t){let e=this._hosts[0],i=null;if(e&&t>=0){let n=e.getColumnData(t);i=n.sortableTitle,i||(i=n.sortableTitle={})}return i||{}},Ye.prototype._isCellSortable=function(t,e,i){let n=this._getSortOptions(e);if(n){if(n.disabled)return!1;let t=n.field;if(null!=t&&!t)return!1}let o=t.getCell(e,i,!0);return!o.hasClass("no-sort")&&(o===t.getCell(e,t.getRowCount()-1,!0)&&!o.getParent().classList.contains("collapsed"))},Ye._proto=Ye.prototype;let Xe=function(t){return t?t.getRowData():null},je={ROW_DEF:1,SUB_ID:1},Ke=function(t){return!t.isAutoGenerated()},Je=function(t){return!t.autoGenerated},Qe=function(t,e,i,n){return(t.getData(n)-e.getData(n))*i},Ze=function(t,e,i){let n=t.getParent();if(!n)return 0;let o=e.getParent();if(!o)return 0;if(n!==o)return 0;let r=t.getData("CHILD_ORDER");if(null==r)return 0;let s=e.getData("CHILD_ORDER");return null==s?0:(r-s)*i},$e=function(t){return t?t.getName():""},ti=function(t,e){return t.getField()===e||t.getId()===e},ei=function(t,e){return!!(t&&e&&t.id&&e.id)&&t.id===e.id},ii=function(t,e){let i=this;if(i._onDataChanged=i._onDataChanged.bind(i),i._onQuote2PostUpdate=i._onQuote2PostUpdate.bind(i),i._onDataComposed=i._onDataComposed.bind(i),i._onSubSegmentChanged=i._onSubSegmentChanged.bind(i),i._recalculateFormulas=i._recalculateFormulas.bind(i),i._updateStreamingData=i._updateStreamingData.bind(i),i.updateColumnTitle=i.updateColumnTitle.bind(i),i._populateTimeSeriesChildren=i._populateTimeSeriesChildren.bind(i),i._onPostSectionDataBinding=i._onPostSectionDataBinding.bind(i),i._asyncClearDataUpdates=i._asyncClearDataUpdates.bind(i),i._clearDataUpdates=i._clearDataUpdates.bind(i),i._onPreDataSorting=i._onPreDataSorting.bind(i),i._mainSorter=i._mainSorter.bind(i),i._updateRowData=i._updateRowData.bind(i),i._onFormulaDataChanged=i._onFormulaDataChanged.bind(i),i._onFormulaDataRequired=i._onFormulaDataRequired.bind(i),i._addMemberOfChain=i._addMemberOfChain.bind(i),i._onColumnAdded=i._onColumnAdded.bind(i),i._onRowExpansionBinding=i._onRowExpansionBinding.bind(i),i._onColumnHeaderBinding=i._onColumnHeaderBinding.bind(i),i._getRowId=i._getRowId.bind(i),i._onFieldLoadedError=i._onFieldLoadedError.bind(i),i._snapshotFillerDataChanged=i._snapshotFillerDataChanged.bind(i),i._onPollingInterval=i._onPollingInterval.bind(i),i._onKeyDown=i._onKeyDown.bind(i),i._requestScroll=i._requestScroll.bind(i),i._onVScroll=i._onVScroll.bind(i),i._selfScrollToRow=i._selfScrollToRow.bind(i),i._streamingConflator=new r(50,i._updateStreamingData),i._formulaConflator=new r(300,i._onFormulaDataChanged),i._chainConflator=new r(100,i._addMemberOfChain),i._columnTitleConflator=new r(0,i.updateColumnTitle),i._timeSeriesChildConflator=new r(0,i._populateTimeSeriesChildren),i._defaultColumnOptions={},i._topNode=t||o.div(),i._topNode.classList.add("rt-grid"),i._grid=new ze,i._grid._wrapper=this,i._sorter=new Ue,i._sorter.setContext("grid",this),i._sorter.setContext("core",i._grid),i._dateTimeUtil=G,i._grid.listen("columnAdded",i._onColumnAdded),e){if(e.dataView){i._sharedDataSource=!0,i._dv=e.dataView,i._dt=i._dv.getDataTable(),i._mainGrid=e.grid;let t=i._mainGrid.getCoreGrid();i._stp=t.getPlugin("SortableTitlePlugin")}e.SortableTitle&&(i._stp=e.SortableTitle),!1===e.topSection&&(i._topSection=!1)}i._sharedDataSource||(i._dc=new at,i._dc.listen("dataChanged",i._onDataChanged),i._dc.listen("dataComposed",i._onDataComposed),i._dc.addStaticFields([gt,"SUB_ID"]),i._dt=new _t,i._dt.setSortingLogic(i._mainSorter),i._dt.setClassificationSource(i._dc),i._dt.listen("subSegmentChanged",i._onSubSegmentChanged),i._dv=new we(i._dt),i._dv.listen("pageIndexChanged",i._dispatch.bind(i,"pageIndexChanged")),i._dv.listen("pageCountChanged",i._dispatch.bind(i,"pageCountChanged"))),i._grid.setDataSource(i._dv),i._stp?(i._sharedSorter=!0,i._stp.listen("preDataSorting",i._onPreDataSorting),i._grid.loadPlugin(i._stp)):(i._stp=new Ye({userManagedLogic:!0,sortableColumns:!0,disableDoubleClickToSort:!0,ROW_DEF:!0}),i._stp.listen("preDataSorting",i._onPreDataSorting),i._grid.loadPlugin(i._stp,e)),i._grid.listen("beforeContentBinding",i._dispatch.bind(i,"beforeContentBinding")),i._grid.listen("preSectionRender",i._onColumnHeaderBinding),i._grid.listen("postSectionDataBinding",i._onPostSectionDataBinding),i._grid.listen("firstRendered",i._dispatch.bind(i,"firstRendered")),i._grid.listen("afterContentBinding",i._dispatch.bind(i,"afterContentBinding")),i._grid.listen("keydown",i._onKeyDown),i._grid.getVScrollbar().listen("scroll",i._onVScroll),i._hiddenInput=i._grid.getHiddenInput(),i._grid.enableRowHighlighting(!0),i._addGridSections(),i._grid.setParent(i._topNode),i._snapshot=new Ot,i._snapshot.addEventListener("adcDataReceived",i._dispatch.bind(i,"adcDataReceived")),i._snapshot.addEventListener("dataChanged",this._snapshotFillerDataChanged),i._connector=new Be,i._connector.addEventListener("ricAdded",i._onRicAdded.bind(i)),i._connector.addEventListener("ricRemoved",i._onRicRemoved.bind(i)),i._connector.addEventListener("fieldAdded",i._onFieldAdded.bind(i)),i._connector.addEventListener("fieldRemoved",i._onFieldRemoved.bind(i)),i.initialize(e),ke.applyStyle(i._grid)};function ni(t){return t&&"SPAN"!==t.tagName&&!t.disabled}function oi(t,e){return!t.classList.contains("valigner")&&t!==e}function ri(t){if(t){let e=t.getContent();if(e&&ni(e))return e.focus(),!0}return!1}s.inherits(ii,a),ii.prototype._topNode=null,ii.prototype._mainGrid=null,ii.prototype._grid=null,ii.prototype._dc=null,ii.prototype._dt=null,ii.prototype._dv=null,ii.prototype._sharedDataSource=!1,ii.prototype._sharedSorter=!1,ii.prototype._subs=null,ii.prototype._stp=null,ii.prototype._columnSorter=null,ii.prototype._streamingConflator=null,ii.prototype._snapshot=null,ii.prototype._connector=null,ii.prototype._sorter=null,ii.prototype._fnEngine=null,ii.prototype._formulaConflator=null,ii.prototype._chainMembers=null,ii.prototype._chainConflator=null,ii.prototype._clientWidth=NaN,ii.prototype._autoLayoutTimer=0,ii.prototype._defaultColumnOptions=null,ii.prototype._RTK=null,ii.prototype._ADCOptions=null,ii.prototype._synapse=null,ii.prototype._autoDateConversion=!1,ii.prototype._textSelect=!1,ii.prototype._lang=null,ii.prototype._dateTimeUtil=null,ii.prototype._initializing=!1,ii.prototype._pollingInterval=0,ii.prototype._pollingTimerId=0,ii.prototype._lastPollingRequest=0,ii.prototype._pollingEnabled=!0,ii.prototype._fieldCaching=!1,ii.prototype._timeSeriesExpansion=!0,ii.prototype._childDataField="",ii.prototype._topSection=!0,ii.prototype._focusingArgs=null,ii.prototype._scrolledRow=-1,ii.prototype.dispose=function(){this.removeAllEventListeners(),this._autoLayoutTimer&&(clearInterval(this._autoLayoutTimer),this._autoLayoutTimer=0),this._pollingTimerId&&(clearTimeout(this._pollingTimerId),this._pollingTimerId=0),this.removeAllColumns(),this.removeAllRows(),this._sorter.dispose(),this._grid.dispose(),this._connector.reset(),this._sharedDataSource||(this._dt&&this._dt.dispose(),this._dv&&this._dv.dispose()),this._mainGrid=this._dt=this._dv=null,this._subs&&(this._subs.dispose(),this._subs=null),this._focusingArgs&&this._focusingArgs.id&&(clearTimeout(this._focusingArgs.id),this._focusingArgs=null)},ii.prototype.getElement=function(){return this._topNode},ii.prototype.removeEventListeners=ii.prototype.removeAllEventListeners,ii.prototype.listen=ii.prototype.addEventListener,ii.prototype.initSubscription=function(){if(!this._dc||this._dc.getSubscriptions())return;let t,e,i;if(t=window.JET,this._RTK?e=this._RTK.Quotes:t&&(e=t.Quotes2),e&&(i=e.create()),!i)return;i.filter&&i.filter(-2,-1),this._subs=i,this._subs.start(),this._dc.setSubscriptions(i),this._subs.addEventListener("postUpdate",this._onQuote2PostUpdate);let n=this._getAllRowDefinitions(),o=n.length;for(let t=0;t<o;++t){let e=n[t];e&&e.subscribeForUpdates()}},ii.prototype.updateLayout=function(){this._grid.updateLayout(),this._stp.updateSortSymbols()},ii.prototype._updateRowData=function(t){if(t>=0){let e=this._dv.getRowId(t);e&&this._dt.setRowData(e,{})}else this._dt.dispatchGlobalChange()},ii.prototype.updateRowData=ii.prototype._updateRowData,ii.prototype._addGridSections=function(){let t=this._grid.addSection("title");0==this._topSection?t.setRowCount(0):t.setRowCount(1),this._grid.addSection("content");let e=this._grid.getSectionSettings("title");e.disableDataBinding();let i=this._grid.getSectionSettings("content");i.setAutoSyncRowCount(!0),i.setParent(e)},ii.prototype.addHeaderSection=function(t){let e=this._grid.getAllSections("title"),i=this._grid.addSectionAt(e.length,"title",t);if(i){i.setRowCount(1),this._grid.getSectionSettings(i).disableDataBinding()}return i},ii.prototype.addFooterSection=function(t){let e=this._grid.addSection("footer",t);if(e){e.setRowCount(1),this._grid.getSectionSettings(e).disableDataBinding()}return e},ii.prototype.setParent=function(t){o.appendChild(t,this._topNode),this.updateLayout()},ii.prototype.insertBefore=function(t){if(t){let e=t.parentNode;e&&(e.insertBefore(this._topNode,t),this.updateLayout())}},ii.prototype.getRelativePosition=function(t){return this._grid.getRelativePosition(t)},ii.prototype.getCoreGrid=function(){return this._grid},ii.prototype.initialize=function(t){if(!t)return void this.initSubscription();let e=this;e._initializing=!0;let i=e._grid;i.resetInternalState();let n=(t=i.normalizeConfig(t)).plugins||t.extensions,o=t.fields||t.columns;t.defaultColumnOptions&&(e._defaultColumnOptions=t.defaultColumnOptions,e._defaultColumnSetup(e._defaultColumnOptions,o)),e._processExtension(n,"beforeInit",[i.getElement(),t]),t.textSelect&&(e._textSelect=!0,i.addClass("tr-text-select")),t.RTK&&(e._RTK=t.RTK,e._snapshot.setRTK(e._RTK)),t.ADC&&(e._ADCOptions=t.ADC,e._snapshot.setADCOptions(e._ADCOptions)),t.synapse&&(e._synapse=t.synapse,Et.setSynapseConfig(e._synapse)),t.fieldCaching&&(e._fieldCaching=t.fieldCaching),null!=t.timeSeriesExpansion&&(e._timeSeriesExpansion=t.timeSeriesExpansion,Et.disableTimeSeriesExpansion(!e._timeSeriesExpansion)),t.icons&&t.icons.rowGrouping&&t.icons.rowGrouping.expander&&(ke.chainIcon=t.icons.rowGrouping.expander),t.formulaEngine&&(e._fnEngine=new et,e._fnEngine.addEventListener("dataChanged",e._onFormulaDataChanged),e._fnEngine.addEventListener("dataRequired",e._onFormulaDataRequired));let r=t.borders;null!=r&&i.toggleBorders(r);let s=t.gridlines;null!=s&&i.toggleGridlines(s);let l=t.verticalLines;null!=l&&i.toggleVerticalLines(l);let a=t.contentVerticalLines;null!=a&&i.toggleContentVerticalLines(a);let u=t.horizontalLines;null!=u&&i.toggleHorizontalLines(u),t.pageSize&&e._dv.setPageSize(+t.pageSize);let h=+t.rowHeight;h&&i.setDefaultRowHeight(h);let p=+t.headerRowHeight;p&&i.getSection("title").setDefaultRowHeight(p);let d=t.autoLayoutUpdate;!e._autoLayoutTimer&&d&&"0"!==d&&"false"!==d&&(e._autoLayoutTimer=setInterval(e._onAutoLayoutUpdate.bind(e),2e3));let c=t.rowHighlighting;null!=c&&i.enableRowHighlighting(!!c);let _=t.rowExpansionBinding;"function"==typeof _&&(i.listen("rowExpansionBinding",e._onRowExpansionBinding),e.listen("rowExpansionBinding",_)),this.addListener(t,"dataComposed"),this.addListener(t,"beforeContentBinding"),this.addListener(t,"firstRendered"),this.addListener(t,"afterContentBinding"),t.autoDateConversion&&(e._autoDateConversion=!0),t.stepScroll&&i.setRowScrollingStep(1),t.linearWheelScrolling&&i.getVScrollbar().setMouseWheelSpeed("linear"),null!=t.autoHideScrollbar&&i.autoHideScrollbars(!!t.autoHideScrollbar),null!=t.scrollbarParent&&e._setScrollbarParent(t.scrollbarParent);let g=t.adcPollingInterval;null!=g&&(e._pollingInterval=g?+g:0),e.setColumns(o);let y=!0;null!=t.rowVirtualRendering&&(y=t.rowVirtualRendering),null!=t.rowVirtualization&&(y=t.rowVirtualization),i.enableRowVirtualization(!!y);let C=!1;null!=t.columnVirtualRendering&&(C=t.columnVirtualRendering),null!=t.columnVirtualization&&(C=t.columnVirtualization),i.enableColumnVirtualization(!!C),null==t.scrollbar||t.scrollbar?e._topNode.style.overflow="hidden":(i.freezeSection(null),e._topNode.style.overflow="");let S=t.topFreezingCount;if("number"==typeof S){S=S>0?S:0;let t=S-1;i.freezeSection(t)}else!1===S&&i.freezeSection(null);let w=t.bottomFreezingCount;if("number"==typeof w&&(w=w>0?w:0,i.freezeFooter(w)),e.addDataFields(t.dataFields),t[gt]=!0,Array.isArray(n)){for(let o=0;o<n.length;++o){let r=n[o],s=null;if(r){let e=r.name;s=e?i.loadPlugin(e,r):i.loadPlugin(r,t)}if(s&&s.setGridWrapper){"function"==typeof s.getGridApi&&s.getGridApi()||s.setGridWrapper("realTimeGrid",e)}}e._initializing=!1}let b=t.lang;null!=b&&(e._lang=b,e._dateTimeUtil.setLocale(b)),null!=t.childDataField&&(this._childDataField=Rt._childDataField=t.childDataField);let R=t.rows;R||(R=t.rics||null);let v=t.bodies;if(!v&&(v=[],t.body&&v.push(t.body),R)){for(let t=0;t<R.length;t++)"string"==typeof R[t]&&(R[t]={ric:R[t]});v.push({rows:R})}let I=t.staticDataRows||t.dataModel;if(R&&I){let t,i,n=I.data?I.data:I,o=I.fields||e.getColumnFields(),r=R.length;for(let e=0;e<r;e++)R[e].values?(t=m(R[e].values,o),i=m(n[e],o),R[e].values=f(t,i)):R[e].values=n[e];n=n.slice(r,n.length),I.data?I.data=n:I=n}for(let t=0;t<v.length;++t)e.insertRows(v[t].rows);e.addStaticDataRows(I),t.contentBottomPadding&&i.setBottomPaddingSection(t.contentBottomPadding);let D=t.contentRightPadding;D&&("number"!=typeof D&&(D=6),i.reserveRightSpace(D));let x=t.dataConflationRate;null!=x&&i.setDataConflationRate(x);let A=i.getPluginList().map(i.getPlugin.bind(i));e._processExtension(A,"afterInit"),e.initSubscription()},ii.prototype.getConfigObject=function(t){let e=t||{},i=e.columns;i||(i=e.columns=[]);let n,o,r,s=this._grid;for(s.getConfigObject&&s.getConfigObject(e),!1===e.columnVirtualization&&delete e.columnVirtualization,!0===e.rowVirtualization&&delete e.rowVirtualization,!0===e.rowHighlighting&&delete e.rowHighlighting,!1===e.contentVerticalLines&&delete e.contentVerticalLines,!1===e.borders&&delete e.borders,o=this.getColumnCount(),n=0;n<o;++n){let t=i[n];t||(t=i[n]={});let e=this.getColumnDefinition(n);e.getConfigObject(t);let o=Et.getFieldProperty(e.getField(),"timeSeriesParent");o&&!r&&(r=o,t.field=o,delete t.name,delete t.autoGenerated),!o&&r&&(r=null)}e.columns=i=i.filter(Je),""===this._topNode.style.overflow&&(e.scrollbar=!1);let l=this._dv.getPageSize();l>0&&(e.pageSize=l),l=s.getDefaultRowHeight(),28!==l&&(e.rowHeight=l),l=s.getSection("title").getDefaultRowHeight(),28!==l&&(e.headerRowHeight=l),this._autoLayoutTimer&&(e.autoLayoutUpdate=!0),l=y(this._defaultColumnOptions),l||(e.defaultColumnOptions=this._defaultColumnOptions),this._autoDateConversion&&(e.autoDateConversion=!0),this._textSelect&&(e.textSelect=!0),this._lang&&(e.lang=this._lang),this._fnEngine&&(e.formulaEngine=!0),this._pollingInterval&&(e.adcPollingInterval=this._pollingInterval),this._fieldCaching&&(e.fieldCaching=this._fieldCaching),1!=this._timeSeriesExpansion&&(e.timeSeriesExpansion=this._timeSeriesExpansion),this._childDataField&&(e.childDataField=this._childDataField);let a,u,h=this.getAllRowDefinitions(),p=e.rows=[];for(o=h.length,n=0;n<o;n++)a=h[n],u=a.getConfigObject(),p.push(u);let d,c,_=s.getPlugins();for(let t in _)if(d=_[t],"function"==typeof d.getRowConfigObject)for(o=p.length,n=0;n<o;n++)a=h[n],c=p[n],d.getRowConfigObject(c,a.getRowId());return e},ii.prototype.setDateTimeUtil=function(t){this._dateTimeUtil!==t&&(this._dateTimeUtil=t,this._dateTimeUtil.setLocale(this._lang))},ii.prototype.setLocale=function(t){t&&this._lang!==t&&(this._lang=t,this._dateTimeUtil.setLocale(t),this._grid.requestRowRefresh())},ii.prototype._defaultColumnSetup=function(t,e){let i=e.length;for(let n=0;n<i;n++){let i=e[n];if("object"==typeof i)for(let e in t)null==i[e]&&(i[e]=t[e])}},ii.prototype._processExtension=function(t,e,i){if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n][e]&&t[n][e].apply(t[n],i)},ii.prototype._onRicAdded=function(t){let e=t.addedRics;this._snapshot.addFields(t.fields);let i=e.length;for(let t=0;t<i;++t){let i=e[t],n=this._connector.getRowDefByRic(i),o=n?n.length:0;for(let t=0;t<o;++t){n[t].getSymbol()===i&&this._snapshot.addRic(i)}}this._dispatch(t.type,t)},ii.prototype._onRicRemoved=function(t){this._dispatch(t.type,t)},ii.prototype._onFieldAdded=function(t){let e=t.rowDefs,i=t.addedFields;for(let t in e)this._snapshot.addRic(e[t].getSymbol());if(this._snapshot.addFields(i),this._subs){let t=i.filter(Et.isRealTimeField);t.length>0&&this._subs.addFields(t)}this._dispatch(t.type,t)},ii.prototype._onFieldRemoved=function(t){let e=t.removedFields;this._subs&&this._subs.removeFields(e),this._dispatch(t.type,t)},ii.prototype.insertColumn=function(t,e){let i=this.getColumnCount();(null==e||e>i)&&(e=i);let n=this._initializing?{}:g(this._defaultColumnOptions);if("string"==typeof t)n.field=t;else for(let e in t)n[e]=t[e];this._fnEngine&&(n.formulaEngine=this._fnEngine);let o=new zt(n,this);n.COL_DEF=o,this._grid.insertColumn(e,n)},ii.prototype._updateTimeSeriesFields=function(t){let e,i,n,o,r,s,l=t.data,a={};for(let t in l){for(e in l[t])a[e]=!0;this.setRicData(t,l[t])}let u={};for(n in a)i=t.childrenFieldToParent[n],u[i]?u[i].push(n):u[i]=[n];for(i in u){let t,n,l=u[i];for(o=this.getColumnIndex(i),r=this._getColumnDefinition(o),n=l.length,t=0;t<n;t++)e=l[t],s=this.getColumnIndex(e),s<0&&(o=this.getColumnIndex(i),r=this._getColumnDefinition(o),this._cloneTimeSeriesColumn(r,e,o),Et.addTimeSeriesChild(i,e));this.removeColumn(i)}},ii.prototype._populateTimeSeriesChildren=function(t){if(this._timeSeriesChildConflator.conflate(t))return;let e,i,n,o,r,s=this._timeSeriesChildConflator.popAllData();for(e=0;e<s.length;e++){if(t=s[e],r=this.getColumnIndex(t),!t)continue;let l=t.getField(),a=Et.getTimeSeriesChildren(l);if(!a)return;if(n=a.length,n<1)return;for(i=0;i<n;i++)r=this.getColumnIndex(t),o=a[i],this._cloneTimeSeriesColumn(t,o,r)}},ii.prototype._cloneTimeSeriesColumn=function(t,e,i){let n,o;n=t.getConfigObject(),o=g(n),o.field=e.replace("TR.",""),o.name=e.split("_")[1].split("T")[0],o.parent=t,o.timeSeriesName=t.getName(),o.timeSeriesId=t.getId(),this.insertColumn(o,i++)},ii.prototype.replaceColumn=function(t,e){let i=this.getColumnIndex(e);if(i<0)return;let n={},o=this._grid,r=o._getColumnDef(i),s=o.getColumnScalability(i);if(n.scalable=s,s=o.getColumnCustomLaneSize(i),n.width=s,s=o.getMinimumColumnWidth(i),s>0&&(n.minWidth=s),s=o.getColumnVisibility(i,0),s||(n.hidden=!0),s=r.stationary,s&&(n.stationary=s),s=r.leftPinned,s&&(n.leftPinned=s),s=r.rightPinned,s&&(n.rightPinned=s),"string"==typeof t)n.field=t;else for(let e in t)n[e]=t[e];t.width&&!t.scalable&&(n.scalable=!1),t.scalable&&!t.width&&(n.width=1);let l=this.getColumnDefinition(i);l&&null==n.id&&(n.id=l.getId()),this._grid.startBatch("reset"),this.removeColumn(i),this.insertColumn(n,i),this._grid.stopBatch("reset")},ii.prototype._onFieldLoadedSuccess=function(t,e,i){if(i&&i.id){let n=i;e&&e.getField()===t&&e.isDefaultName()&&n.name&&(e.setName(n.name),this.updateColumnTitle())}},ii.prototype._onFieldLoadedError=function(t){},ii.prototype._onFieldLoaded=function(t,e){if(Et.isTimeSeries(t)){let t=this.getColumnDefinitionById(e);this._populateTimeSeriesChildren(t)}this._connector.addFields(t,e)},ii.prototype._setScrollbarParent=function(t){t.style.boxSizing="border-box",t.style.overflow="hidden",t.style.position="relative",this._topNode.style.height="100%",this._grid.autoHideScrollbars(!1),this._grid.getVScrollbar().attachToExternalElement(t),this._grid.getHScrollbar().attachToExternalElement(t)},ii.prototype.getFieldInfo=function(t){return Et.getFieldInfo(t)},ii.prototype.loadFieldInfo=function(t){return Et.loadFieldInfo(t)},ii.prototype._shouldLoadFieldInfo=function(t){let e=this._RTK||window.JET;return!!e&&(!!this._fieldCaching&&(e=Et.hasFieldInfo(t),!e&&(e=Et.isAdc(t)||Et.isRealTimeField(t),!!e)))},ii.prototype.setColumns=function(t){let e=this._grid,i=t?t.length:0;if(e.startBatch("reset"),this.removeAllColumns(),i>0){let n=!1;i>1&&(n=e.freezeLayout(!0));for(let e=0;e<i;++e)this.insertColumn(t[e],e);i>1&&e.freezeLayout(n)}e.stopBatch("reset")},ii.prototype.restoreColumns=function(t,e){let i=this._grid;i.startBatch("reset");let n,o,r,s=this.getConfigObject().columns,l=s.length,a=t.length,u=e?ei:S,h=[],p=[],d=[];for(n=0;n<l;n++){for(r=!1,o=0;o<a;o++)if(u(s[n],t[o])){p.push(s[n]),r=!0;break}r||h.push(n)}this.removeColumns(h);let c=p.length,_=!1;for(a>1&&(_=this._grid.freezeLayout(!0)),n=0;n<a;n++){for(r=!1,o=0;o<c;o++)if(u(t[n],p[o])){r=!0;let e=this.getColumnIndex(t[n].id||t[n].field);d.push(this.getColumnId(e));break}r||(this.insertColumn(t[n],n),d.push(this.getColumnId(n)))}a>1&&this._grid.freezeLayout(_),i.reorderColumns(d),i.stopBatch("reset")},ii.prototype.setFields=ii.prototype.setColumns,ii.prototype._onColumnAdded=function(t){let e=t.context.COL_DEF;delete t.context.COL_DEF;let i=t.colIndex,n=this._grid._getColumnDef(i);e._setCoreColumnDef(n);let o=this._grid.getColumnData(i);o||(o=this._grid.setColumnData(i,{})),o.COL_DEF=e;let r=e.getUserModel();this._grid.setColumnDataBindingHandler(i,e.getRenderer());let s=r.width;if(void 0!==s){let t;s=+s,t=null!=r.scalable?!!r.scalable:s!=s,this._grid.setColumnWidth(i,s,t)}else this._grid.setColumnWidth(i,1,!0);s=r.minWidth,s>=0&&this._grid.setMinimumColumnWidth(i,s),s=r.hidden,s&&this._grid.hideColumn(i,!0),s=r.textAlign||r.alignment,"string"==typeof s&&this._grid.setColumnAlignment(i,s),r.keepModel||e.clearUserModel(),e.isTextSelect()&&this._grid.enableColumnClass(i,"tr-text-select",!0,"content");let l,a=e.getClasses();for(l=0;l<a.length;l++)this._grid.enableColumnClass(i,a[l]);let u=e.getField();this._grid.setDataColumnName(i,gt);let h,p,d,c,_=e.getAllFields(),f=e.getId(),g=_.length;for(l=0;l<g;l++)h=_[l],this._shouldLoadFieldInfo(h)?(p=h===u?e.getDataType():zt.getDataType(h),d=Et.loadFieldInfo(h).then(this._onFieldLoadedSuccess.bind(this,h,e)).catch(this._onFieldLoadedError),p?(e.isTimeSeries()&&this._populateTimeSeriesChildren(e),this._connector.addFields(h,f)):(c=this._onFieldLoaded.bind(this,h,f),d=d.then(c).catch(c))):(e.isTimeSeries()&&this._populateTimeSeriesChildren(e),this._connector.addFields(h,f))},ii.prototype.removeColumn=function(t){let e=this.getColumnIndex(t);if(e<0)return;let i=this.getColumnDefinition(e);i.isRealTimeField()||this._dc&&this._dc.removeStaticFields([i.getField()]),this._grid.removeColumnAt(e),this._connector.removeFields(i),i.dispose()},ii.prototype.removeColumns=function(t){let e=this.getColumnIndices(t),i=e.length;if(i<=1)return void(1===i&&this.removeColumn(e[0]));e.sort(ii._descendingOrder);let n=[],o=this._grid.freezeLayout();for(let t=0;t<i;++t){let i=e[t],o=this.getColumnDefinition(i);o.isRealTimeField()||n.push(o.getField()),o.dispose(),this._grid.removeColumnAt(i),this._connector.removeFields(o)}n.length&&this._dc&&this._dc.removeStaticFields(n),this._grid.freezeLayout(o)},ii.prototype.removeAllColumns=function(){let t=this.getColumnCount();if(!(t<=0)){this._sharedSorter||this.clearSort();for(let e=t;--e>=0;){this._grid.setColumnDataBindingHandler(e,null),this.getColumnDefinition(e).dispose()}this._columnTitleConflator.reset(),this._timeSeriesChildConflator.reset(),this._connector.removeAllFields(),this._grid.setColumnCount(0),this._dc&&this._dc.resetStaticFields()}},ii.prototype.moveColumn=function(t,e){return this._grid.moveColumn(t,e)},ii.prototype.moveColumnById=function(t,e){return this._grid.moveColumnById(t,e)},ii.prototype.reorderColumns=function(t,e){return this._grid.reorderColumns(t,e)},ii.prototype.hideColumn=function(t,e){let i=this.getColumnIndex(t);i<0||this._grid.hideColumn(i,e)},ii.prototype.hideColumns=function(t,e){this._grid.hideColumns(this.getColumnIndices(t),e)},ii.prototype.showAllColumns=function(){this._grid.showAllColumns()},ii._descendingOrder=function(t,e){return e-t},ii.prototype.addDataFields=function(t,e){if(!t)return!1;let i,n,o,r,s,l=Array.isArray(t)?t:[t],a=l.length;for(i=0;i<a;i++)n=l[i],this._shouldLoadFieldInfo(n)?(o=zt.getDataType(n),r=Et.loadFieldInfo(n).catch(this._onFieldLoadedError),o?this._connector.addFields(n,e||"grid"):(s=this._onFieldLoaded.bind(this,n,e),r=r.then(s).catch(s))):this._connector.addFields(n,e||"grid");return!0},ii.prototype.removeDataFields=function(t,e){return!!t&&(this._connector.removeFields(t,e||"grid"),!0)},ii.prototype.removeFieldReferrer=function(t){t&&this._connector.removeFieldReferrer(t)},ii.prototype.sortColumn=function(t,e){if("string"==typeof t)return void this._stp.sortColumn(t,e);let i=this.getColumnIndex(t);i<0?this._stp.sortColumn(this.getSortedColumnIndex(),"n"):this._stp.sortColumn(i,e)},ii.prototype.setColumnName=function(t,e){let i=this.getColumnDefinition(t);i&&(i.setName(e),this.updateColumnTitle())},ii.prototype.setColumnRenderer=function(t,e){let i=this.getColumnIndex(t);this.setColumnFormatter(i,e)},ii.prototype.activateColumnRenderer=function(t,e,i){let n=this.getColumnIndex(t);if(null==n)return;let o=this.getColumnDefinition(n);o&&(o.activateRenderer(e,i),this._grid.setColumnDataBindingHandler(n,o.getRenderer()),this._grid.requestRowRefresh())},ii.prototype.setColumnFormatter=function(t,e){if(null==t)return;let i=this.getColumnDefinition(t);if(!i)return;let n=null;if(e&&("object"==typeof e?("function"==typeof e.init&&e.init(i.getConfigObject(),this._grid),n=e.binding):n=e,"function"!=typeof n&&(n=null)),n!==i.getRenderer()){let e=this._grid.getSection("content").getColumn(t);e&&e.clearContent(),this._grid.setColumnDataBindingHandler(t,null),i.setRenderer(n),this._grid.setColumnDataBindingHandler(t,i.getRenderer()),this._grid.requestRowRefresh()}},ii.prototype.setColumnSorter=function(t,e){let i=this.getColumnIndex(t),n=this.getColumnDefinition(i);if(n){n.setSorter(e),this.getSortedColumnIndex()===i&&this._stp.refresh()}},ii.prototype._initDuplicateRicData=function(t){let e=t.getSymbol(),i=this._connector.getRowDefByRic(e);i&&i.length&&function(t,e){let i=Xe(t),n=Xe(e);for(let t in i)je[t]||(n[t]=i[t])}(i[0],t)},ii.prototype.insertRow=function(t,e){if(this._mainGrid)return this._mainGrid.insertRow(t,this._getRowId(e));t&&("string"==typeof t?t={ric:t}:Array.isArray(t.values)&&(t.fields||(t.fields=this.getColumnFields())));let i=new Rt(t);return i.setDataSource(this._dc),this._initDuplicateRicData(i),i.registerToView(this._dv,this._getRowId(e)),t&&t.hidden&&this._dv.hideRow(i.getRowId()),this._connector.addRic(i),i},ii.prototype.insertSegmentSeparator=function(t,e){return t||(t={}),"object"==typeof t?(t.asSegment=!0,this.insertRow(t,e)):null},ii.prototype.insertRows=function(t,e,i){if(this._mainGrid)return void this._mainGrid.insertRows(t,this._getRowId(e));if(!Array.isArray(t))return;let n=this._dt.freeze(),o=i||this.getColumnFields(),r=this._getRowId(e),s=t.length;for(let e=0;e<s;++e){let i=t[e];i&&("string"==typeof i&&(i={ric:i}),i.fields=o),this.insertRow(i,r)}this._dt.freeze(n)},ii.prototype.addStaticDataRows=function(t,e){if(this._mainGrid)this._mainGrid.addStaticDataRows(t,e);else{if(!Array.isArray(t)){let i=t;t=null,i&&(i.fields&&!e&&(e=i.fields),Array.isArray(i.data)&&(t=i.data))}t&&this.insertRows(t.map(ii._dataToRowOptions),null,e)}},ii.prototype.updateDataSet=function(t,e){if(!Array.isArray(t)||0===t.length)return void this.removeAllRows();let i,n,o,r,s=t.length,l={},a=this.getAllRowDefinitions(),u=a.length,h=!1;if(e){for(h=this._dt.freeze(),r=0;r<u;r++)i=a[r],i&&(n=i.getRowData()[e],n||0===n?l[n]=i:this.removeRow(i));let p={},d={};for(r=s-1;r>=0;r--)o=t[r],n=o[e],i=l[n],d[n]=o,o.ROW_ORDER=r,p[n]||(p[n]=!0,i?i.setRowData(o):this.insertRow({values:o}));for(let t in l)l[t]&&!d[t]&&this.removeRow(l[t]);this._dt.sortOnce(gt,"a",Qe,"ROW_ORDER"),this._dt.freeze(h)}else{for((s-u>1||u-s>1)&&(h=this._dt.freeze()),r=0;r<u;r++)o=t[r],o?l[r]=a[r]:this.removeRow(a[r]);for(r=0;r<s;r++)o=t[r],i=l[r],i?i.setRowData(o):this.insertRow({values:o});(s-u>1||u-s>1)&&this._dt.freeze(h)}},ii._dataToRowOptions=function(t){return{values:t}},ii.prototype.removeRow=function(t){if(this._mainGrid)return this._mainGrid.removeRow(this._getRowId(t));let e=this._getRowDefinitionByRef(t);return e&&(e.isAutoGenerated()||this._removeRow(e)),e},ii.prototype.removeRows=function(t){let e,i;if(!Array.isArray(t))return e=this.removeRow(t),e?[e]:[];if(this._mainGrid)return this._mainGrid.removeRows(t.map(this._getRowId));let n=[],o=t.length;for(i=0;i<o;++i)e=this._getRowDefinitionByRef(t[i]),e&&(e.isAutoGenerated()||n.push(e));o=n.length;let r=!1;for(o>1&&(r=this._dt.freeze()),i=0;i<o;++i)this._removeRow(n[i]);return o>1&&this._dt.freeze(r),n},ii.prototype.removeAllRows=function(){if(this._sharedDataSource)return;if(!this._dt.getRowCount())return;let t=this._getAllRowDefinitions();this._sharedDataSource||(this._dc.clearAllData(),this._dt.clearAllData(),this._clearDataUpdates()),t.forEach(Rt.dispose),this._streamingConflator.reset(),this._formulaConflator.reset(),this._chainConflator.reset(),this._connector.removeAllRics(),this._grid.getVScrollbar().setScrollTop(0)},ii.prototype._removeRow=function(t){if(this._sharedDataSource)return;this._dispatch("beforeRowRemoved",{});let e=this._connector,i=this._dt,n=t.getDescendants();if(n){for(let t=0;t<n.length;t++)e.removeRic(n[t]);let t=n.map(Rt.toRowId);i.removeRows(t)}e.removeRic(t),i.removeRow(t.getRowId()),t.dispose()},ii.prototype.hideRow=function(t,e){let i=this._getRowId(t);(this._mainGrid||this._grid).hideRow(i,e)},ii.prototype.hideRows=function(t,e){Array.isArray(t)||(t=[t]);let i=t.map(this._getRowId);(this._mainGrid||this._grid).hideRows(i,e)},ii.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},ii.prototype.unhideAllRows=function(){this._grid.unhideAllRows()},ii.prototype.hasHiddenRow=function(){return this._grid.hasHiddenRow()},ii.prototype.setRic=function(t,e,i){if(this._mainGrid)return void this._mainGrid.setRic(this._toRowId(t),e,i);let n=this._getRowDefinitionByRef(t);if(n){var o=i||{};"string"==typeof e?o.ric=e:(e&&!i&&(o=e),e=o.ric?o.ric:"");let t=Rt.extractRowOptions(o),r=n.getSymbol();n.setContent(e,t)&&(this._connector.removeRic(n,r),this._initDuplicateRicData(n),this._connector.addRic(n));let s=o.values;null!=s&&n.setStaticRowData(s,o.fields)}},ii.prototype.unlinkChain=function(t){let e=this._getRowDefinitionByRef(t);e&&e.isChain()&&e.unlinkChain()},ii.prototype.setRowContent=ii.prototype.setRic,ii.prototype.toggleRowExpansion=function(t,e){this._dv.toggleRowExpansion(t,e)},ii.prototype._onRowExpansionBinding=function(t){if(this.hasListener("rowExpansionBinding")){if(t.originalRowId){let e=this._dv.getRowIndex(t.originalRowId);t.originalRowDef=this._getRowDefinitionByIndex(e),t.originalRowData=t.originalRowDef.getRowData()}else t.rowDef=this._getRowDefinitionByIndex(t.rowIndex),t.rowData=t.rowDef.getRowData();this._dispatch("rowExpansionBinding",t)}},ii.prototype.setRics=function(t){this.removeAllRows(),t&&t.length&&this.insertRows(t)},ii.prototype.getRowCount=function(){return this._dv.getRowCount()},ii.prototype.getPageItemCount=function(){return this._dv.getRowCount(!1,!0)},ii.prototype.getDataRowCount=function(){return this._dt.getRowCount()},ii.prototype.getColumnCount=function(){return this._grid.getColumnCount()},ii.prototype.getColumnDataType=function(t){let e=this.getColumnDefinition(t);return e?e.getDataType():""},ii.prototype.getColumnDefinition=function(t){let e=this._grid.getColumnData(t);return e&&e.COL_DEF||null},ii.prototype.getColumnDefinitions=function(){let t=this.getColumnCount(),e=new Array(t);for(let i=0;i<t;i++)e[i]=this.getColumnDefinition(i);return e},ii.prototype.getColumnDefinitionById=function(t){return"string"==typeof t?this.getColumnDefinition(this.getColumnIndex(t)):null},ii.prototype.getColumnDefinitionsById=function(t){let e=Array.isArray(t)?t.length:0;if(e>0){let i,n,o=new Array(e);for(i=0;i<e;i++)n=t[i],o[i]=this.getColumnDefinitionById(n);return o}return null},ii.prototype._getColumnDefinition=function(t){if(t instanceof zt)return t;if("number"==typeof t)return this.getColumnDefinition(t);if("string"==typeof t){let e=this.getColumnCount();for(let i=0;i<e;++i){let e=this.getColumnDefinition(i);if(ti(e,t))return e}}return null},ii.prototype.getRowType=function(t){let e=this.getRowDefinition(t);return e?e.getType():""},ii.prototype.getRowDefinition=function(t){return"number"==typeof t?this._getRowDefinitionByIndex(t):"string"==typeof t?this._getRowDefinitionById(t):null},ii.prototype._getRowDefinitionByIndex=function(t){return this._dv.getDataAt(t,gt)||null},ii.prototype._getRowDefinitionById=function(t){return this._dt.getData(t,gt)||null},ii.prototype._getRowDefinitionByRef=function(t){return t instanceof Rt&&t.getRowId()?t:this.getRowDefinition(t)},ii.prototype.getRowDefinitions=function(){return this._dv.getColumnData(gt,!0)},ii.prototype._getAllRowDefinitions=function(){return this._dt.getColumnData(gt)},ii.prototype.getAllRowDefinitions=function(t){return t?this._getAllRowDefinitions():this._dt.getColumnData(gt).filter(Ke)},ii.prototype.getRowData=function(t){return Xe(this._getRowDefinitionByIndex(t))},ii.prototype.getMultipleRowData=function(t){if("number"==typeof t)return[this.getRowData(t)];let e=null;if(Array.isArray(t)){let i=t,n=i.length,o=new Array(n);e=this.getRowDefinitions();for(let t=0;t<n;++t){let n=i[t];"number"==typeof n?o[t]=Xe(e[n]):n&&n.getRowData&&(o[t]=Xe(n))}return o}return e=t&&t.getColumnData?t.getColumnData(gt,!1):this.getRowDefinitions(),e.map(Xe)},ii.prototype.setRicData=function(t,e){let i=this._connector.getRowDefByRic(t),n=i?i.length:0;for(let o=0;o<n;++o){let n=i[o];n&&n.getSymbol()===t&&n.setRowData(e)}},ii.prototype.getAllRics=function(){return this._connector.getAllRics()},ii.prototype.setRowData=function(t,e){let i=this._getRowDefinitionByRef(t);i&&i.setRowData(e)},ii.prototype.setStaticRowData=function(t,e){let i=this._getRowDefinitionByRef(t);i&&i.setStaticRowData(e)},ii.prototype.setStaticData=function(t,e,i){let n=this._getRowDefinitionByRef(t);n&&n.setStaticData(e,i)},ii.prototype._getRowId=function(t){return"string"==typeof t?t:"number"==typeof t?this._dv.getRowId(t):t instanceof Rt?t.getRowId():""},ii.prototype.getColumnIndex=function(t){if(t&&t instanceof zt){let e=this.getColumnCount();for(let i=0;i<e;++i){if(this.getColumnDefinition(i)===t)return i}return-1}return this._grid.getColumnIndex(t)},ii.prototype.getColumnIndices=function(t){let e=[],i=this.getColumnCount(),n=Array.isArray(t)?t:[t],o=n.length;for(let t=0;t<o;++t){let o=this.getColumnIndex(n[t]);o>=0&&o<i&&e.push(o)}return e},ii.prototype.getColumnId=function(t){return this._grid.getColumnId(t)},ii.prototype.getColumnIds=function(){return this._grid.getColumnIds()},ii.prototype.getColumnField=function(t){return this._grid.getColumnField(t)},ii.prototype.getColumnFields=function(){return this._grid.getColumnFields()},ii.prototype.getColumnNames=function(){return this.getColumnDefinitions().map($e)},ii.prototype.getAllFields=function(){return this._connector.getAllFields()},ii.prototype.freezeColumn=function(t,e){null==t&&(t=-1),this._grid.freezeColumn(t,e)},ii.prototype.pinColumn=function(t,e){if(Array.isArray(t)){let i=t,n=i.length,o=0;for(let t=0;t<n;++t)o|=this._pinColumn(i[t],e);return!!o}return this._pinColumn(t,e)},ii.prototype._pinColumn=function(t,e){let i=this.getColumnIndex(t),n=this.getColumnCount();if(i<0||i>n)return!1;let o=this._grid.getPinnedLeftColumnCount(),r=this._grid.getPinnedRightColumnCount(),s=this._grid.getStationaryColumnIndex();if(e&&"right"===e.toLowerCase()){let t=this._grid.getFirstPinnedRightIndex();if(i>=t)return!1;if(s>=0&&i<=s)return!1;this.moveColumnById(i,t),r+=1,o-=1}else{if(i<o)return!1;o||s>=0&&(o=s,i>s&&o++),this.moveColumnById(i,o)}return this._grid.freezeColumn(o,r),!0},ii.prototype.unpinColumn=function(t,e){if(Array.isArray(t)){let i=t,n=0;for(let t=i.length;--t>=0;)n|=this._unpinColumn(i[t],e);return!!n}return this._unpinColumn(t,e)},ii.prototype._unpinColumn=function(t,e){let i=this.getColumnIndex(t);if(i<0)return!1;let n=this._grid.getPinnedLeftColumnCount(),o=this._grid.getPinnedRightColumnCount(),r=this.getColumnCount()-o;if(i>=n&&i<r)return!1;let s=null,l=null;if(null!=e){let t=this.getColumnIndex(e);l=this.getColumnId(t),s=this.getColumnId(i)}let a=this._grid.getStationaryColumnIndex();return i<n?(i>a&&this.moveColumnById(i,n),this._grid.freezeColumn(n-2,o)):i>=r&&(i>a&&this.moveColumnById(i,r),this._grid.freezeColumn(n-1,o-1)),i>a&&null!=l&&this.moveColumnById(s,l),!0},ii.prototype.unpinAllColumns=function(){let t=this._grid.getPinnedLeftColumnCount(),e=this._grid.getPinnedRightColumnCount();return!(!t&&!e)&&(this._grid.freezeColumn(-1,0),!0)},ii.prototype._onColumnHeaderBinding=function(t){if("title"!==t.sectionType||t.sectionIndex>0)return;let e=t.fromColIndex,i=t.toColIndex;for(;e<i;)this._renderColumnHeader(e++,t)},ii.prototype._renderColumnHeader=function(t,e){let i=this.getColumnDefinition(t);if(!i)return;let n=i.getHeaderRenderer(),o=e.section,r=o.getRowCount();e.colIndex=t,e.columnDef=i;let s=i.getName(),l=i.getTooltip(),a=i.getHeaderAlignment();for(let i=0;i<r;++i){let r=o.getCell(t,i,!1);r.setContent(s),r.setTooltip(l),r.setStyle("textAlign",a),n&&(e.rowIndex=i,e.cell=r,n(e))}},ii.prototype.updateColumnTitle=function(){if(this._columnTitleConflator.conflate())return;let t=this._grid.getSectionSettings("title");t&&t.rerender()},ii.prototype.isSorting=function(){return this._stp.isSorting()},ii.prototype.getSortedColumnIndex=function(){return this._stp.getSortedColumnIndex()},ii.prototype.getSortOrder=function(){return this._stp.getSortOrder()},ii.prototype.clearSort=function(){this._stp.clearSortState()},ii.prototype._onQuote2PostUpdate=function(t){t.childOrderChange&&(this.isSorting()||this._dt.sortOnce("ROW_DEF","a",Ze))},ii.prototype._onDataChanged=function(t){let e=t.rowData;if(!e)return;let i=e[gt];if(i){if(i.getRowId()){this._dc.getRowData(t.rid)?(i.addUpdate(t)&&(this._dt._hasNewUpdates=!0),this._updateStreamingData()):i.isAutoGenerated()&&(i.setParent(null),this._removeRow(i))}return}let n=e.SUB_ID;if(n){let i=this._getRowDefinitionById(n);i&&i.getRic()!==e.RIC&&(this._chainMembers||(this._chainMembers={}),this._chainMembers[t.rid]||(this._chainMembers[t.rid]=e,this._addMemberOfChain(e)))}},ii.prototype._addMemberOfChain=function(t){if(this._chainConflator.conflate(t))return;let e,i=this._chainConflator.popAllData(),n=i?i.length:0,o=!1;n>1&&(o=this._dt.freeze());let r=[];for(e=0;e<n;++e){let n=(t=i[e]).SUB_ID,o=this._getRowDefinitionById(n);if(o){let e=o.addConstituent(t.RIC,this._dt);e&&r.push(e)}}this._chainMembers=null;let s=r.length;if(s)for(e=s;--e>=0;)this._connector.addRic(r[e]);n>1&&this._dt.freeze(o)},ii.prototype._updateStreamingData=function(){this._streamingConflator.conflate()||this._dt&&(this._dt.classifySegments(),this._dt.dispatchGlobalChange())},ii.prototype._onPreDataSorting=function(t){let e=this._stp.getSortedColumns();if(this._sorter.reset(),Array.isArray(e)){let t=e.length;for(let i=0;i<t;++i){let t=e[i],n=t.field||"",o=t.colIndex,r=o>=0?this.getColumnDefinition(o):null,s=!1,l=null;r&&(n=r.getField(),s=r.isRowSorting(),l=r.getSorter()),this._sorter.addColumnContext(n,l,s,t.sortOrder,o,r)}}this._columnSorter=this._sorter.getSorter()},ii.prototype._mainSorter=function(t,e,i){return this._columnSorter(t,e,i)},ii.prototype._onPostSectionDataBinding=function(t){t.actualUpdate&&this._asyncClearDataUpdates()},ii.prototype._asyncClearDataUpdates=function(){setTimeout(this._clearDataUpdates,0)},ii.prototype._clearDataUpdates=function(){if(!this._dt||!this._dt._hasNewUpdates)return;let t=this._dt.getAllRowIds(!0);for(let e=t.length;--e>=0;){this._dt.getRowData(t[e])[gt].resetUpdates()}},ii.prototype.getDataView=function(){return this._dv},ii.prototype.setPage=function(t){return this._dv.setPage(t)},ii.prototype.setPageSize=function(t){this._dv.setPageSize(t)},ii.prototype.getPageIndex=function(){return this._dv.getPageIndex()},ii.prototype.getPageSize=function(){return this._dv.getPageSize()},ii.prototype.getPageCount=function(){return this._dv.getPageCount()},ii.prototype.toggleChain=function(t){let e=this._getRowDefinitionByRef(t);e&&e.toggleChain()},ii.prototype.setClassification=function(t,e){let i=this._getRowDefinitionByRef(t);return!!i&&this._dt.setSegmentClassification(i.getRowId(),e)},ii.prototype.contains=function(t){return!!t&&this._topNode.contains(t)},ii.prototype.isFocused=function(){let t=document.activeElement;return t&&t.shadowRoot?t.shadowRoot===this._topNode.parentNode:this.contains(t)},ii.prototype.focus=function(){this._grid.focus()},ii.prototype.requestRowRefresh=function(){this._grid.requestRowRefresh()},ii.prototype.updateLayout=function(){this._grid.updateLayout()},ii.prototype.getExtension=function(t){return t?this._grid.getPlugin(t.replace(/Extension/gi,"")):null},ii.prototype._onFormulaDataChanged=function(t){this._formulaConflator.conflate()||(this._recalculateFormulas(),this._updateRowData())},ii.prototype._onFormulaDataRequired=function(t){},ii.prototype._onDataComposed=function(t){let e=t.changes;if(!e)return;let i=t.rowData;if(!i)return;let n=i[gt];if(n&&n.getDataSource()){if(this._autoDateConversion){let t,i,o,r;for(t in e)r=this._getColumnDefinition(t),o=r?r.getDataType():zt.getDataType(t),"datetime"===o&&(i=e[t],n.setData(t+"_RAW",i),i=G.toDateObject(i),n.setData(t,i))}this.hasListener("dataComposed")&&(t.grid=this,t.rowDef=n,this._dispatch("dataComposed",t)),this._recalculateFormulas(t)}},ii.prototype._onSubSegmentChanged=function(t){let e,i=t.insertionList,n=t.removalList,o=t.removedRows,r=n.length,s=null;for(e=0;e<r;e++){let t=o[n[e]];t&&(s=t[gt],s&&(s.dispose(),t[gt]=null))}let l=i.length;for(e=0;e<l;e++){let t=i[e].getId();s=new Rt({segmentId:t}),s.setDataSource(this._dc),s.registerToView(this._dv)}},ii.prototype._recalculateFormulas=function(t){if(this._fnEngine&&!(this._fnEngine.getFormulaCount()<=0))if(t&&t.rid)this._fnEngine.calculate(t.rowData,t.changes);else{let t=this._dc?this._dc.getAllRowData():null,e=t?t.length:0;for(let i=0;i<e;++i)this._fnEngine.calculate(t[i])}},ii.prototype._snapshotFillerDataChanged=function(t){if(!this._dt)return;let e=t.data;if(t.timeSeries)this._updateTimeSeriesFields(t);else for(let t in e)this.setRicData(t,e[t]);this._lastPollingRequest||(this._lastPollingRequest=1),this._startPolling()},ii.prototype._startPolling=function(){if(this._pollingEnabled&&this._pollingInterval&&this._lastPollingRequest&&!this._pollingTimerId){let t=new Date;this._lastPollingRequest=t.getTime(),this._pollingTimerId=setTimeout(this._onPollingInterval,this._pollingInterval)}},ii.prototype._onPollingInterval=function(){this._pollingTimerId=0,this._pollingEnabled&&this._pollingInterval&&(this.refreshADCData(),this._startPolling())},ii.prototype.activateADCPolling=function(t){if(!1!==t){this._pollingEnabled=!0;let t=new Date;if(this._lastPollingRequest){t.getTime()-this._lastPollingRequest>this._pollingInterval&&this.refreshADCData()}this._startPolling()}else this._pollingEnabled=!1},ii.prototype.refreshADCData=function(){let t=this._snapshot.addFields(this._connector.getAllFields());return!(!t||(t=this._snapshot.addRics(this._connector.getAllRics()),!t))||(this._lastPollingRequest=0,!1)},ii.prototype._onAutoLayoutUpdate=function(){let t=this._topNode.clientWidth;t!==this._clientWidth&&(this._clientWidth=t,this.updateLayout())},ii.prototype.logDT=function(t){let e=this._getAllRowDefinitions();this._logData(e,t)},ii.prototype.logDV=function(t){let e=this.getRowDefinitions();this._logData(e,t)},ii.prototype._logData=function(t,e){e||(e={}),e.colNames||(e.colNames=this.getColumnFields());let i=at.constructTable(t.map(Xe),e);console.table(i)},ii.prototype.replaceRow=function(t,e){let i=this._getRowId(t),n=this._getRowDefinitionById(i);if(n){if(n.isAutoGenerated())return null;let t=n.getConfigObject();if(n.getRowId()===e.rowId)return null;if(S(t,e))return null}let o=this.insertRow(e,i);return n&&this.removeRow(i),o},ii.prototype.scrollToColumn=function(t,e){return this._grid.scrollToColumn(t,e)},ii.prototype.scrollToRow=function(t,e){this._grid.scrollToRow("content",t,e)},ii.prototype.getScrollLeft=function(){return this._grid.getScrollLeft()},ii.prototype.getScrollTop=function(){return this._grid.getScrollTop()},ii.prototype.setScrollLeft=function(t){this._grid.setScrollLeft(t)},ii.prototype.setScrollTop=function(t){this._grid.setScrollTop(t)},ii.prototype.scrollRight=function(t){this._grid.scrollRight(t)},ii.prototype.scrollDown=function(t){this._grid.scrollDown(t)},ii.prototype.getScrollWidth=function(){return this._grid.getScrollWidth()},ii.prototype.getScrollHeight=function(){return this._grid.getScrollHeight()},ii.prototype.getVScrollView=function(){return this._grid.getVScrollView()},ii.prototype._onVScroll=function(){let t=this._focusingArgs;if(!t)return;this._focusingArgs=null;let e=t.event;ri(t.section.getCell(t.colIndex,t.rowIndex))?e.preventDefault():e.shiftKey?this._findPrevFocusableCell(e,t.colIndex,t.rowIndex,t.focusableColIndices):this._findNextFocusableCell(e,t.colIndex,t.rowIndex,t.focusableColIndices)},ii.prototype._selfScrollToRow=function(){let t=this._focusingArgs;t&&(t.id=0,this.scrollToRow(t.rowIndex))},ii.prototype._requestScroll=function(t,e,i,n,o){let r=this._focusingArgs;r||this._scrolledRow!==i&&(this._scrolledRow=i,r=this._focusingArgs={event:t,colIndex:e,rowIndex:i,focusableColIndices:n,section:o},r.id=setTimeout(this._selfScrollToRow))},ii.prototype._findNextFocusableCell=function(t,e,i,n,o){let r=n.indexOf(e);!oi(t.target,this._hiddenInput)||r<0?(i=0,r=0):ni(o)&&r>=0&&r++;let s=this._grid,l=s.getSection("content"),a=s.getVerticalViewInfo().bottomRowIndex,u=this.getRowCount();for(let e=i;e<u;e++){for(let i=r;i<n.length;i++){let o=n[i];if(e>a)return void this._requestScroll(t,o,e,n,l);if(ri(l.getCell(o,e)))return void t.preventDefault()}r=0}},ii.prototype._findPrevFocusableCell=function(t,e,i,n,o){let r=n.indexOf(e),s=n.length;!oi(t.target,this._hiddenInput)||r<0?(i=0,r=0):ni(o)&&r>=0&&r--;let l=this._grid,a=l.getSection("content"),u=l.getVerticalViewInfo().topRowIndex;for(let e=i;e>=0;e--){for(let i=r;i>=0;i--){let o=n[i];if(e<u)return void this._requestScroll(t,o,e,n,a);if(ri(a.getCell(o,e)))return void t.preventDefault()}r=s-1}},ii.prototype._onKeyDown=function(t){if(9!==t.keyCode||t.ctrlKey||t.altKey||t.metaKey)return;let e=this.getColumnDefinitions(),i=e.length,n=[];for(let t=0;t<i;t++)e[t].isFocusable()&&n.push(t);if(!n.length)return;this._scrolledRow=-1;let o=this.getRelativePosition(t),r=o.cell?o.cell.getContent():null;t.shiftKey?this._findPrevFocusableCell(t,o.colIndex,o.rowIndex,n,r):this._findNextFocusableCell(t,o.colIndex,o.rowIndex,n,r)};let si={texts:["If a dog and cat had a baby together that grew up and worked a desk job he'd be a Cog in the machine","I'm still upset that Tie Domi didn't name his child Tyson","A tagline for a car company that prides itself on its morals and ethics: Take the High Road","Logan Broger is amazing and a wonderful boy according to Logan's mom","You know the Grammys are a joke when Future doesn't win Best Everything","If you were a member of the Bloods and became paralyzed do you then become a member of the Crips?","Curling is the best sport named after something you do to your hair","You say potatoe, I say starchy carbs","If you work for an ad agency and getting paid for it aren't you the one who is being influenced by advertising?","Are there Out of Stock photos? Gafuffle","I think of a lot of good ideas when going to the bathroom I guess I have a real stream of consciousness","Most streets are two way streets","Why does that make love so special?","A tagline for an airline: Take the High Road","Rumour has it targeted online advertising was developed because the internet was upset that you could read it but it couldn't read you","This is a true fact: I never had a fear of heights until I fell off a roof","A tagline for a special highway that is easy to navigate while under the influence of drugs: Take the High Road","I'm the only person in the world with my name","We need more werkin and less twerkin if you ask me","If Fantasy Hockey actually lived up to its name, every team would have Henrik Lundqvist and Joffrey Lupul on it","I'm in a band that does Metallica covers with our private parts it's called Myphallica","Smiling could easily be misinterpreted for showing your teeth to someone because they said something that made you happy","We say we are walking the dog, but the dog always leads","Tim Horton was a hockey player but is the name of a coffee chain, which means my dream of a goat sanctuary being my legacy is not unrealistic","I started a sensory deprivation chamber business it involves really dark curtains, ear plugs, and a sleeping mask","Do we make money or does money make us? Chezwich","Pantone is a colour but also the singular version of pants","Logan Ipsum will loop at some point","Thank you for using my words in your work","You should listen to my mixtape (check out the rest of my portfolio)","I have never known a Jack that was in good enough shape to name bodybuilding after him","Twitter is the rice of social media","Injuries always keep you OUT of things","For the name of an act as serious as killing someone, assassination literally translates to buttbuttination","Why don't we call glasses duocles","If you wake up with a giant zit, you are really facing your fears when you look in the mirror","Cemeteries are just garbage dumps filled with humans","I have a moral code, but I haven't figured out how to read it yet","I bet most serial killers play the drums","To Catch A Predator would have been a great name for a Steve Irwin show","If the word kerning is kerned poorly, it kind of looks like learning which is appropriate because both are important","North America should be called Russia since people are always moving so fast","I don't need a big house, just a two floor condo you could say I have lofty expectations","Even faithful and simple Sancho is forced to deceive him at certain points","The novel is considered a satire of orthodoxy, veracity and even nationalism","In exploring the individualism of his characters, Cervantes helped move beyond the narrow literary conventions of the chivalric romance literature that he spoofed","which consists of straightforward retelling of a series of acts that redound to the knightly virtues of the hero","The character of Don Quixote became so well known in its time that the word quixotic was quickly adopted by many languages","Characters such as Sancho Panza and Don Quixote's steed, Rocinante, are emblems of Western literary culture","It stands in a unique position between medieval chivalric romance and the modern novel","The former consist of disconnected stories featuring the same characters and settings with little exploration of the inner life of even the main character"]};si.words=si.texts.join(" ").split(" ").filter((function(t){return t.length>1})),si.companyName=["Yost-Prohaska","Wehner, Howe and Brown","Gusikowski-Legros","Wolff-Windler","McGlynn, Douglas and Kilback","MacGyver Group","Spinka, Stracke and Huel","Howell, Wolff and Emmerich","Blick-O'Reilly","Dibbert, Buckridge and Leffler","Skiles, Kuhlman and Johns","Daugherty Group","Reilly, Toy and Bayer","Bradtke, Mohr and Weber","Thompson, Bruen and Friesen","Rempel-Bednar","Kunze LLC","Pfannerstill Group","Moen-Larkin","Larson LLC","Haag-Feest","Hauck-Bartell","Rohan-Kohler","Waters, Homenick and Pagac","Ziemann Group","Reynolds, Turcotte and Bosco","Graham, Morar and Waters","Cassin Inc","Bosco-Terry","Stanton-Blick","Prohaska and Sons","Pouros, Daugherty and Pfannerstill","Bogan-Cormier","O'Kon-Mills","Mueller-Schmeler","Runte-Trantow","Muller Inc","Shanahan, Ryan and Orn","Huel LLC","Shanahan-Zulauf","Emard-Schuster","Muller Inc","Collier, Muller and Yundt","Wehner, Prohaska and Harber","Ondricka-Stehr","Towne LLC","Feil Inc","Braun, Kihn and Treutel","Ebert-MacGyver","Harris LLC"],si.industry=["Specialty Chemicals","Office Equipment/Supplies/Services","Electric Utilities: Central","Trucking Freight/Courier Services","Auto Parts:O.E.M.","Oil Refining/Marketing","Biotechnology: Biological Products (No Diagnostic Substances)","Computer Software: Programming, Data Processing","Farming/Seeds/Milling","Biotechnology: Laboratory Analytical Instruments","Finance: Consumer Services","Major Banks","Investment Managers","Oilfield Services/Equipment","Paper","Transportation Services"],si.market=["NYSE","NASDAQ","SET","DJI","HSCEI","HKEX","NIKKEI"],si.country=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D'Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:"Korea, Democratic People'S Republic of",code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:"Lao People'S Democratic Republic",code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}];var li=si;let ai=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10],ui={X_RIC_NAME:{type:"string"},CF_NAME:{type:"string",prefix:!0,suffix:" Name"},CF_LAST:{type:"number",min:.01,max:1e3,prec:2},PCTCHNG:{type:"number",min:-1,max:1,prec:2,suffix:"%"},PCTCHNG2:{type:"float",min:-20,max:20,prec:2,suffix:"%"},CF_CURR:{fixedValue:"USD"},INDICATOR:{type:"number",min:0,max:5},CF_TICK:{type:"number",min:1,max:3,changeOnly:!0},PRCTCK_1:{type:"set",members:["⇧","B⇧","↑","B↑","26","1",'"1"',"-1","⇩","B⇩","↓","B↓","27","2",'"2"']},CF_NETCHNG:{type:"number",min:-100,max:100},CF_VOLUME:{type:"number",min:0,max:1e7},RI_FLAG:{type:"set",members:["R","Q","I","_",""]},RI_CODE:{type:"number",min:0,max:2},STATUS:{type:"number",min:0,max:6},YRLOW:{type:"number",min:0,max:20},YRHIGH:{type:"number",min:200,max:2e3},CFLOW:{type:"number",min:0,max:20},CFHIGH:{type:"number",min:200,max:2e3},LOW_YLD:{type:"set",members:[void 0,0,1,2,3,4,5,10,11,15,20]},HIGH_YLD:{type:"set",members:[void 0,200,300,400,500,1e3,1500,2e3]},CF_YIELD:{type:"set",members:[void 0,0,10,20,30,40,50,100,200,300,400,500]},"TR.IPODate":{type:"isoDate",min:Date.now()-63072e6,max:Date.now()},"TR.Volume":{type:"number",min:2e3,max:1e7},"TR.Price52WeekHigh":{type:"number",min:100,max:300,prec:2},"TR.Price52WeekLow":{type:"number",min:1,max:200,prec:2},"TR.InvalidField":{type:"set",members:[void 0]},percent:{type:"number",min:0,max:101},number_1:{type:"number",min:1,max:100},number_2:{type:"number",min:-100,max:100},index4:{type:"number",min:0,max:4},index5:{type:"number",min:0,max:5},index10:{type:"number",min:0,max:10},index100:{type:"number",min:0,max:100},group3:{type:"set",members:["Group_A","Group_B","Group_C"]},group4:{type:"set",members:["Group_1","Group_2","Group_3","Group_4"]},float_1:{type:"float",min:0,max:1,prec:2},float_2:{type:"float",min:0,max:100,prec:2},float_3:{type:"float",min:-1,max:1,prec:2},precision4:{type:"float",min:-10,max:10,prec:4},precision8:{type:"float",min:-100,max:100,prec:8},boolean:{type:"boolean"},date:{type:"date",min:15e11,max:16e11},date1:{type:"function",generate:function(t,e){return null==e?mi(6e11,16e11,e):new Date(1e12+1e9*e)}},ISODate:{type:"isoDateObject",min:Date.now()-63072e6,max:Date.now()},word:{type:"string",min:1,max:1},phrase:{type:"string",min:2,max:5},words:{type:"string",min:1,max:20},words1:{type:"string",min:2,max:8},words2:{type:"string",min:3,max:10},words3:{type:"string",min:5,max:15},sentence:{type:"string",min:8,max:20},id:{type:"function",hash:0,generate:function(t,e){return null==e&&(e=null!=t._id?t._id:-1,t._id=++e),e||0}},companyName:{type:"set",members:li.companyName},industry:{type:"set",members:li.industry},market:{type:"set",members:li.market},country:{type:"set",members:li.country}},hi=function(t,e){if(t){let i=e;"function"==typeof e&&(i={type:"function",generate:e}),ui[t]=i}},pi=function(t){return"number"==typeof t?function(t){let e=1e4*Math.sin(113*t);return e*=e,e-(0|e)}(t):Math.random()},di=function(t,e,i,n){t||(t=0),null==e&&(e=100);let o=(e-t)*pi(n)+t;if(i>0){let t=ai[i];return Math.floor(o*t)/t}return null!=i?Math.floor(o):o},ci=function(t,e,i){return di(t,e+1,0,i)},_i=function(t,e,i){return di(t,e,0,i)},fi=function(t,e){return _i(0,t,e)},gi=function(t){return 0===ci(0,1,t)},yi=function(t,e){if(t){return t[fi(t.length,e)]}return String.fromCharCode(ci(65,90,e))},mi=function(t,e,i){(t=t||Date.now()-63072e6)instanceof Date&&(t=t.getTime()),(e=e||Date.now())instanceof Date&&(e=e.getTime());let n=ci(0,(e-t)/1e3,i);return new Date(t+1e3*n)},Ci=function(t,e,i){let n=t<e?_i(t,e,i):t,o=new Array(n);for(let t=0;t<n;++t){null!=i&&(i*=1.17*(t+1));let e=fi(li.words.length,i);o[t]=li.words[e]}return o.join(" ")},Si=function(t,e,i){let n=bi(t,e,i),o=n.value+"";return n.prefix&&("string"==typeof n.prefix?o=n.prefix+o:e.prefix&&(o=e.prefix+" "+o)),n.suffix&&(o+=n.suffix),"string"===n.type&&(n.value=o),n.formattedValue=o,n},wi=function(t,e,i){let n={},o=0;e&&("number"==typeof e?o=n.numRows=e:(n=e,o=e.numRows||e.numRow||e.rowCount,null!=e.seed&&-1===(i=e.seed)&&(i=null))),o||(o=1),t?Array.isArray(t)||(t=[t+""]):t=[""];let r=t.length,s=[];for(let n=0;n<o;++n){let n=[];for(let o=0;o<r;++o){let r=t[o];n.push(bi(r,e,i).value)}null!=i&&++i,s.push(n)}return{data:s,seed:i,fields:t}},bi=function(t,e,i){let n,o=function(t){return ui[t]||{}}(t);if(o.type||(o.type="number",hi(t,o)),o.fixedValue)return o.value=n,o;null!=i&&(null==o.hash&&(o.hash=function(t){let e=0,i=t?t.length:0;for(;--i>=0;)e+=t.charCodeAt(i)*(i+.9879);return e}(t)),i+=o.hash);let r=null!=o.min?o.min:100,s=null!=o.max?o.max:1e4;if("string"===o.type)n=null!=o.min||null!=o.max?Ci(r,s,i):e&&e.text||"";else if("set"===o.type)n=yi(o.members,i);else if("date"===o.type)n=mi(r,s,i);else if("isoDate"===o.type){n=mi(r,s,i).toISOString().slice(0,10)}else if("isoDateObject"===o.type)n=mi(r,s,i),n=new Date(n.toISOString().slice(0,10));else if("boolean"===o.type)n=gi(i);else if("function"===o.type)o.field=t,n=o.generate(o,i);else{let t=null!=o.prec?o.prec:0;n=di(r,s,t,i)}return o.value=n,o},Ri=function(t){this._seed=null!=t?t:null};Ri.prototype._seed=null,Ri.prototype.generate=function(t,e){let i=wi(t,e,this._seed);return this._seed=i.seed,i.data},Ri.prototype.generateRecords=function(t,e){let i=wi(t,e,this._seed);this._seed=i.seed;let n=(t=i.fields).length,o=i.data;for(let e=o.length;--e>=0;){let i=o[e],r={};for(let e=0;e<n;++e){r[t[e]]=i[e]}o[e]=r}return o},Ri.prototype.generateQuoteData=function(t,e){let i=Si(t,e,this._seed);return null!=this._seed&&++this._seed,i},Ri.prototype.getSeed=function(){return this._seed},Ri.prototype.setSeed=function(t){"number"==typeof t&&(this._seed=t)},Ri.prototype.randBetween=function(t,e){let i=_i(t,e,this._seed);return null!=this._seed&&++this._seed,i},Ri.prototype.randInt=function(t,e){let i=ci(t,e,this._seed);return null!=this._seed&&++this._seed,i},Ri.prototype.randIndex=function(t){let e=fi(t,this._seed);return null!=this._seed&&++this._seed,e},Ri.prototype.randNumber=function(t,e,i){let n=di(t,e,i,this._seed);return null!=this._seed&&++this._seed,n},Ri.prototype.randBoolean=function(){let t=gi(this._seed);return null!=this._seed&&++this._seed,t},Ri.prototype.randMember=function(t){let e=yi(t,this._seed);return null!=this._seed&&++this._seed,e},Ri.prototype.randDate=function(t,e){let i=mi(t,e,this._seed);return null!=this._seed&&++this._seed,i},Ri.prototype.randString=function(t,e){let i=Ci(t,e,this._seed);return null!=this._seed&&++this._seed,i},Ri.seed=null,Ri.generate=function(t,e){let i=wi(t,e,Ri.seed);return Ri.seed=i.seed,i.data},Ri.generateRecord=function(t,e,i){Array.isArray(t)||(t=[t+""]);let n={};null!=e&&("number"==typeof e?i=e:e&&(n=e));let o=t.length,r={};for(let e=0;e<o;++e){let o=t[e];r[o]=bi(o,n,i).value}return r},Ri.generateRecords=function(t,e){let i=wi(t,e,Ri.seed);Ri.seed=i.seed;let n=(t=i.fields).length,o=i.data;for(let e=o.length;--e>=0;){let i=o[e],r={};for(let e=0;e<n;++e){r[t[e]]=i[e]}o[e]=r}return o},Ri.addFieldInfo=hi,Ri.randNumber=di,Ri.randInt=ci,Ri.randBetween=_i,Ri.randIndex=fi,Ri.randBoolean=gi,Ri.randMember=yi,Ri.randDate=mi,Ri.randString=Ci,Ri.toRecords=function(t,e){if(!Array.isArray(t))return null;Array.isArray(e)||(e=e?[e+""]:[]);let i=t.length,n=new Array(i);for(let o=0;o<i;++o){let i=n[o]={},r=t[o],s=r&&r.length||0;for(let t=0;t<s;++t){let n=r[t];if(void 0!==n){let o=e[t];o||0===o||(o=t+""),i[o]=n}}}return n};let vi=function(){};vi.prototype.create=function(t){return new Ii(t)};let Ii=function(t){this._onRowUpdated=this._onRowUpdated.bind(this),this._fieldMap={},this._prevData={},this.id=null!=t?t+"":"_sub"+Ii._runningId++};Ii.prototype._rics=null,Ii.prototype._isChain=!1,Ii.prototype._fieldMap=null,Ii.prototype._prevData=null,Ii.prototype._updateHandler=null,Ii.prototype._updateTimerId=0,Ii.prototype._updateInterval=1e3,Ii._runningId=0,Ii.prototype.formattedFields=function(t){for(let e=t.length;--e>=0;)this._fieldMap[t[e]]=!0;return this},Ii.prototype.rawFields=function(t){for(let e=t.length;--e>=0;)this._fieldMap[t[e]]=!0;return this},Ii.prototype.chain=function(t){return this._rics=Array.isArray(t)?t[0]:[t],this._isChain=!0,this},Ii.prototype.rics=function(t){return this._rics=Array.isArray(t)?t:[t],this},Ii.prototype.start=function(){return this._onRowUpdated(),this},Ii.prototype.stop=function(){return this._updateTimerId&&(clearInterval(this._updateTimerId),this._updateTimerId=0),this},Ii.prototype.onNewRow=function(t){return this},Ii.prototype.onUpdate=function(t){return this._updateHandler=t,this},Ii.prototype.onRemoveRow=function(t){return this},Ii.prototype._onRowUpdated=function(){if(!this._updateHandler)return;let t,e=this._rics?this._rics.length:0;if(1===e)t=this._rics[0],this._updateHandler(this,t,this._getUpdateData(t));else for(let i=0;i<e;++i)fi(3)||(t=this._rics[i],this._updateHandler(this,t,this._getUpdateData(t)));this._updateTimerId||(this._updateTimerId=setInterval(this._onRowUpdated,this._updateInterval))},Ii.prototype._getUpdateData=function(t){let e={id:this.id},i={text:t};for(let t in this._fieldMap){let n=Si(t,i),o=n.value,r=n.formattedValue;n.changeOnly&&this._prevData[t]===o||(this._prevData[t]=o,e[t]={raw:o,formatted:r||o+""})}return e};let Di=function(){this._dict={}};Di.prototype._dict,Di.prototype._count=0,Di.prototype.addItem=function(t,e){if(t&&null!=e){let i=this._dict[t];return i?i.push(e):this._dict[t]=[e],++this._count,!0}return!1},Di.prototype.addItems=function(t,e){if(t){if(!Array.isArray(e))return this.addItem(t,e);let i=e?e.length:0;if(i){let n=this._dict[t];return n||(n=this._dict[t]=[]),Array.prototype.push.apply(n,e),this._count+=i,!0}}return!1},Di.prototype.removeItem=function(t,e){let i=this._dict[t];if(i){let n=i.indexOf(e);if(n>=0)return i.length>1?i.splice(n,1):delete this._dict[t],--this._count,!0}return!1},Di.prototype.removeItemsByKey=function(t){let e=this._dict[t];return!!e&&(delete this._dict[t],this._count-=e.length,!0)},Di.prototype.removeAllItems=function(){return!!this._count&&(this._dict={},this._count=0,!0)},Di.prototype.getItems=function(t){return this._dict[t]||null},Di.prototype.getAllItems=function(){if(this._count>0){let t=[],e=this._dict;for(let i in e)Array.prototype.push.apply(t,e[i]);return t}return null},Di.prototype.getItemCount=function(t){if(t){let e=this._dict[t]||null;return e?e.length:0}return this._count},Di.prototype.getAllKeys=function(){return Object.keys(this._dict)};let xi=function(t,e){return t.ric+"_"+e.ric},Ai=function(t){let e=t.match(/\./g);return!!e&&e.length>1},Li=function(t){let e,i,n,o=t;for(e=o.length-1;e>0;e--)i=Math.floor(Math.random()*(e+1)),n=o[e],o[e]=o[i],o[i]=n;return o.forEach(Ti),o=o.sort(Ei),o},Ti=function(t,e){t.CHILD_ORDER=e},Ei=function(t,e){return t.CHILD_ORDER-e.CHILD_ORDER},Mi=function(){};Mi.prototype._lastSub=null,Mi.prototype._configObj=null,Mi.prototype.config=function(t){t&&(this._configObj=t),this._lastSub&&this._configObj&&this._lastSub.config(this._configObj)},Mi.prototype.create=function(t){return this._lastSub=new Fi(t||this._configObj),this._lastSub},Mi.prototype.isSkipHeaderSupported=function(){return!0},Mi.prototype.setUpdateInterval=function(t,e){this._lastSub?this._lastSub.setUpdateInterval(t,e):(this._configObj||(this._configObj={}),this._configObj.minInterval=t,this._configObj.maxInterval=e)},Mi.prototype.setPercentageDataUpdate=function(t){this._lastSub?this._lastSub.setPercentageDataUpdate(t):(this._configObj||(this._configObj={}),this._configObj.percentageDataUpdate=t)};let Fi=function(t){this._onSubscriptionResponse=this._onSubscriptionResponse.bind(this),this._subMap={},this._dataMap=new Di,this._fields={},this._events={},this._dataGen=new Ri,this.config(t)};Fi.prototype._minInterval=750,Fi.prototype._maxInterval=850,Fi.prototype._percentageDataUpdate=.1,Fi.prototype.config=function(t){if(!t)return;let e=t.minInterval;"number"==typeof e&&(this._minInterval=e,this._minInterval>this._maxInterval&&(this._maxInterval=this._minInterval)),e=t.maxInterval,"number"==typeof e&&(this._maxInterval=e,this._minInterval>this._maxInterval&&(this._minInterval=this._maxInterval)),e=t.percentageDataUpdate,"number"==typeof e&&(this._percentageDataUpdate=e/100)},Fi.prototype.setUpdateInterval=function(t,e){"number"==typeof t&&(this._minInterval=t),"number"==typeof e&&(this._maxInterval=e)},Fi.prototype.setPercentageDataUpdate=function(t){"number"==typeof t&&(this._percentageDataUpdate=Math.round(t/100))},Fi.prototype.setSeed=function(t){this._dataGen.setSeed(t)},Fi.prototype.addRic=function(t,e){return this._addSymbol(t,!1,e)},Fi.prototype.addChain=function(t,e){return this._addSymbol(t,!0,e)},Fi.prototype.addFields=function(t){if(!t)return;"string"==typeof t&&(t=[t]);let e=t.length;for(let i=0;i<e;++i)this._fields[t[i]]=!0},Fi.prototype.removeSubscription=function(t){let e=this._subMap[t];if(e&&(this._dispatch("subscriptionRemoved",{subs:[e]}),delete this._subMap[t],this._dataMap.removeItem(e.ric,e),e.chain)){let t=e.children,i=t.length;for(let n=0;n<i;++n){let i=t[n];this._dataMap.removeItem(xi(e,i),i),i.parent=null}e.children=null,e.ricList=null}},Fi.prototype.removeRic=Fi.prototype.removeSubscription,Fi.prototype.removeChain=Fi.prototype.removeSubscription,Fi.prototype.removeAllSubscriptions=function(){let t=this._working;if(this.stop(),this._hasListener("subscriptionRemoved")){let t=[];for(let e in this._subMap)t.push(this._subMap[e]);t.length>0&&this._dispatch("subscriptionRemoved",{subs:t})}this._subMap={},this._dataMap.removeAllItems(),t&&this.start()},Fi.prototype.removeFields=function(t){"string"==typeof t&&(t=[t]);let e=t.length;for(let i=0;i<e;++i){let e=t[i];this._fields[e]&&delete this._fields[e]}},Fi.prototype.removeAllFields=function(){let t=!1;for(let e in this._fields){t=!0;break}t&&(this._fields={})},Fi.prototype.start=function(){this._working=!0,this._connect()},Fi.prototype.stop=function(){this._working=!1,this._timerId&&(window.clearTimeout(this._timerId),this._timerId=0)},Fi.prototype.dispose=function(){this.stop(),this._subMap=null,this._dataMap&&(this._dataMap.removeAllItems(),this._dataMap=null),this._fields=null,this._events=null},Fi.prototype.addEventListener=function(t,e){if(!e)return;let i=this._events[t];i?i.indexOf(e)<0&&i.push(e):this._events[t]=[e]},Fi.prototype.removeEventListener=function(t,e){let i=this._events?this._events[t]:null;if(!i)return;let n=i.indexOf(e);n>=0&&i.splice(n,1)},Fi.prototype.removeAllEventListeners=function(){this._events={}},Fi.prototype.getSubscription=function(t){return this._subMap[t]||null},Fi.prototype.getRic=function(t){let e=this._subMap[t];return e?e.ric:""},Fi.prototype.getAllFields=function(){return this._fields},Fi.prototype.hasField=function(t){return this._fields[t]||!1},Fi.prototype.filter=function(t,e){return this};let Pi=function(t,e){for(let i in t)e[i]=t[i];return e};Fi.prototype._addSymbol=function(t,e,i){if(!t)return null;if(i||0===i)i+="";else do{i="_"+this._runningSubId+++"_"}while(this._subMap[i]);if(this._subMap[i])return window.console.log("WARNING: Cannot add ric with duplicate id"),null;e&&(t=t.replace("0#",""));let n={};n.ric=t,n.chain=e,n.id=i,n.dataId=i+t,this._subMap[i]=n,this._dataMap.addItem(t,n);let o=this._dataMap.getItems(t),r=o.length;this._dispatch("subscriptionAdded",{subs:[n]});let s,l=null,a=0;if(e)if(1===r)for(n.children=[],a=Fi.simpleDigest(t)%10+4,s=0;s<a;++s)l={},l.ric="Child_"+String.fromCharCode(65+s),l.id=i,l.dataId=i+l.ric,l.parent=n,n.children.push(l),l.CHILD_ORDER=s,this._dataMap.addItem(xi(n,l),l);else{let t=o[0].children;for(a=t.length,n.children=new Array(a),s=0;s<a;++s)l={},l.ric=t[s].ric,l.id=i,l.dataId=i+l.ric,l.parent=n,n.children[s]=l,this._dataMap.addItem(xi(n,l),l)}return r>1&&this._working&&setTimeout(this._updateDuplicateSymbol.bind(this,t),10),this._connect(),i},Fi.simpleDigest=function(t){let e=t.length,i=0;for(let n=0;n<e;++n)i+=t.charCodeAt(n);return i},Fi.prototype._connect=function(){if(this._working&&!this._timerId){let t=this._dataGen.randInt(this._minInterval,this._maxInterval);this._timerId=window.setTimeout(this._onSubscriptionResponse,t)}},Fi.prototype._onSubscriptionResponse=function(){this._timerId=0;let t=this._dataMap.getAllKeys(),e=t?t.length:0;if(!e)return void this._connect();let i=(this._percentageDataUpdate-.02)*e;i=i>0?i:1;let n=(this._percentageDataUpdate+.02)*e;n=n<e?n:e;let o=this._dataGen.randInt(i,n),r=this._fields;for(let i=0;i<o;i++){let i,n,o,s=t[this._dataGen.randIndex(e)],l=this._dataMap.getItems(s),a=l[0],u=a.parent,h=this._dataGen.randBoolean();if(Ai(s)&&u&&h){let t=u.children;t=Li(t);let e=t.length,s=t.indexOf(a);for(a.CHILD_ORDER=s,i=this._generateQuoteData(a,r),o=l.length,n=0;n<o;++n){for(let o=0;o<e;o++){let e=t[o];if(l[n]===e)i.CHILD_ORDER=e.CHILD_ORDER,this._dispatchDataChanged(l[n],i);else{let t=e.CHILD_ORDER;this._dispatchDataChanged(e,{X_RIC_NAME:e.ric,CHILD_ORDER:t})}}this._dispatchPostUpdate({childOrderChange:!0})}}else for(i=this._generateQuoteData(a,r),o=l.length,n=0;n<o;++n){let t=l[n].CHILD_ORDER;null!=t&&(i.CHILD_ORDER=t),this._dispatchDataChanged(l[n],i)}}this._connect()},Fi.prototype._dispatchPostUpdate=function(t){this._dispatch("postUpdate",t)},Fi.prototype._generateQuoteData=function(t,e){let i=t.ric,n=t.prevData,o={},r={text:i,prefix:t.parent?t.parent.ric:""};for(let t in e){let e=this._dataGen.generateQuoteData(t,r),i=t+"_FORMATTED";if(n){if(e.changeOnly&&n[t]===e.value)continue;n[t]=e.value,n[i]=e.formattedValue}o[t]=e.value,o[i]=e.formattedValue}return null!=o.X_RIC_NAME&&null!=o.INDICATOR&&o.INDICATOR>0&&(o.X_RIC_NAME="/"+o.X_RIC_NAME),o},Fi.prototype._getChildSubByRic=function(t,e){let i=t.children;if(i){let t=i.length;for(let n=0;n<t;++n){let t=i[n];if(t.ric===e)return t}}return null},Fi.prototype._updateDuplicateSymbol=function(t){let e=this._dataMap.getItems(t);if(!e)return;let i=e.length;if(i<2)return;let n,o=e[0],r=o.prevData,s=!!o.chain;if(r)for(n=1;n<i;++n){let t=e[n];t.prevData||this._dispatchDataChanged(t,r)}if(!s)return;let l=o.ricList;if(!l)return;let a=l.length;for(n=1;n<i;++n){let t=e[n],i=t.ricList;for(let e=i?i.length:0;e<a;++e){let i=l[e],n=this._getChildSubByRic(o,i),r=this._getChildSubByRic(t,i);n&&r&&n.prevData&&this._dispatchDataChanged(r,n.prevData)}}},Fi.prototype._dispatchDataChanged=function(t,e){let i=Pi(e,{}),n={};n.ric=t.ric,n.values=i,n.subId=t.id;let o=t.prevData;if(!o){o={},t.prevData=o,n.type="statusUpdated",i.STATUS=1,i.STATUS_FORMATTED=this._statusMap[1],i.SUB_ID=t.id,Pi(i,o);let e=t.parent;if(e){let i=e.ricList;i||(i=e.ricList=[]),e.ricList.push(t.ric)}}this._dispatch("dataChanged",n)},Fi.prototype.onFeedStatusChanged=function(t,e){return window.setTimeout((function(){e([{key:"Q",name:"IDN_RDF",state:"up"}])}),1e3),this},Fi.prototype._hasListener=function(t){let e=this._events[t];return!!e&&e.length>0},Fi.prototype._dispatch=function(t,e){let i=this._events[t];if(!i)return;let n=i.length;for(let t=0;t<n;++t)i[t](e)},Fi.prototype._subMap=null,Fi.prototype._fields=null,Fi.prototype._events=null,Fi.prototype._working=!1,Fi.prototype._timerId=0,Fi.prototype._runningSubId=0,Fi.prototype._statusMap={0:"PENDING",1:"OK",2:"STALE",3:"INFO",4:"CLOSED",5:"DELAYED",6:"NOPERM",7:"REACHLIMIT",8:"C_COMPLETE",9:"C_CLOSE",10:"C_EMPTY",11:"C_NOTCHAIN",12:"C_ERR",13:"C_NOBEGIN",14:"C_NOEND"};let zi=function(){this._data={}};zi.prototype._data=null,zi.prototype.clear=function(){this._data={}},zi.prototype.put=function(t,e){t&&(this._data[t]=e)},zi.prototype.get=function(t){let e=this._data[t];return null!=e?e:""},zi.prototype.getAllKeys=function(){return Object.keys(this._data)},zi.prototype.save=function(){},zi.prototype.filter=function(t){let e=[];if(t)for(let i in this._data){let n=this._data[i];t(n)&&e.push(n)}return e};let Vi={"TR.NonExistField":!0,"TR.NotExistField":!0,CF_IGNORE_FIELD:!0};let ki=new Ri,Oi={request:function(t,e){if(e)return Promise.resolve(JSON.stringify(e));let i,n,o,r,s,l,a,u,h,p=[];if("Col,date|,Row,In|,va,T,NoEmptyTickers"===t.output){for(l=t.identifiers,a=t.formula.trim().split(/(?=,TR.)/),u=[],h=Vi,i=0;i<a.length;i++)n=a[i],h[n]||u.push(n);let e=u.length;p.push([{h:!0,i:"instrument",v:"Instrument"},{h:!0,i:"date",v:"Date"}]);for(let t=0;t<e;t++){let e,n=u[t],o=/TR.(.*)(?=\()/,r=n.match(o)[0].replace("TR.",""),a=n.toLowerCase(),h=/sdate=(.*)[,]/,d=/edate=(.*)[)]/,c=a.match(h),_=a.match(d),f=c?c[1]:G.format(new Date,"YYYY-MM-DD"),g=_[1];f>g&&(e=f,f=g,g=e);let y=(+new Date(g)-+new Date(f))/864e5;for(i=0;i<=y;i++){let e=new Date(new Date(f).setDate(new Date(f).getDate()+i)),n={h:!0,v:G.format(e,"YYYY-MM-DDT00:00:00")};0===t&&p[0].push(n)}let m=l;for(i=0;i<m.length;i++){let t=[m[i],r];for(s=1;s<=y+1;s++){let e=Ri.generateRecord(r);t.push(e[r])}p.push(t)}}}else{for(l=t.identifiers,a=Oi.splitFields(t.formula),u=[],h=Vi,i=0;i<a.length;i++)n=a[i],h[n]||u.push(n);for(p[0]=[{h:!0,i:"instrument",v:"Instrument"}],i=0;i<u.length;i++)n=u[i],p[0].push({h:!0,r:n.toUpperCase().trim()});let e={};o=l.length;let s=ki.generate(u,o);for(i=0;i<o;++i){let t=l[i];r=e[t],r||(r=e[t]=s[i],r.unshift(t)),p.push(r)}if(p.length>0){if(ki.randInt(1,10)<=3){let t=ki.randInt(0,p.length-1);r=p[t],o=r.length;let e=new Array(o);for(e[0]=r[0],i=1;i<o;i++)e[i]="";p.splice(t+1,0,e)}}}return Promise.resolve(JSON.stringify({rows:p}))},splitFields:function(t){if(!t)return[];let e=t.split(/,(?![^()]*\))/);return e=e.map((function(t){return t.trim()})),e}},Ni=new Ri,Hi={request:function(t,e){if(e)return Promise.resolve(JSON.stringify(e));let i,n,o,r,s=t.instruments,l=t.fields,a=Vi;for(l=[],i=0;i<t.fields.length;i++)n=t.fields[i],a[n.name]||l.push(n);let u={};o=s.length;let h=[],p=Ni.generate(l,o);for(i=0;i<o;++i){let t=s[i];r=u[t],r||(r=u[t]=p[i],r.unshift(t)),h.push(r)}if(h.length>0){if(Ni.randInt(1,10)<=3){let t=Ni.randInt(0,h.length-1);r=h[t],o=r.length;let e=new Array(o);for(e[0]=r[0],i=1;i<o;i++)e[i]="";h.splice(t+1,0,e)}}let d=[{displayName:"Instrument"}];for(i=0;i<l.length;i++)n=l[i],d.push({displayName:n.name,field:n.name.toUpperCase()});return Promise.resolve(JSON.stringify({data:h,headers:[d]}))}},Bi=function(t){return"datagrid"===t?Promise.resolve(Hi):"adc"===t?Promise.resolve(Oi):Promise.reject(t+" is not supported.")};Bi.setInvalidFields=function(t){if(t&&"string"==typeof t)Vi[t]=!0;else if(Array.isArray(t))for(let e=0;e<t.length;e++)Vi[t[e]]=!0};let Gi=function(t){this.Quotes=new vi,this.Quotes2=new Mi,this.Archive=new zi,this.ContainerDescription=!0,this.Data=Bi,t&&this.Quotes2.config(t)};Gi.prototype.init=function(t){return t&&this.Quotes2.config(t),this},Gi.prototype.onLoad=function(t){return setTimeout(t,2e3),this},Gi.prototype.navigate=function(t){return this},Gi.prototype.appHit=function(t,e,i){},Gi.prototype.getUserInfo=function(){return Promise.resolve({UUID:"PAXTRA"})},Gi.prototype.contextChange=function(t){};let Wi={"⇧":1,"B⇧":1,"↑":1,"B↑":1,26:1,1:1,'"1"':1,"-1":-1,"⇩":-1,"B⇩":-1,"↓":-1,"B↓":-1,27:-1,2:-1,'"2"':-1},Ui={CF_TICK:1,PRCTCK_1:1,BID_TICK:1,ASK_TICK:1};let Yi={"||":1,"&&":2,"<":3,">":3,"<=":3,">=":3,"!=":3,"=":3,"==":3,"===":3,"+":4,"-":4,"*":5,"%":6,"/":6,"!":7,"!!":7},qi={"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"<":function(t,e){return t<e},">":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"!":function(t,e){return!t},"!!":function(t,e){return!!t}},Xi={"+":2,"-":2,"*":2,"/":2,"%":2,"<":2,">":2,"<=":2,">=":2,"==":2,"!=":2,"&&":2,"||":2,"!":1,"!!":1},ji=function(t,e,i,n){let o={value:e,type:i};return n&&(o.dataType=n),"operator"===i?o.precedence=Yi[e]:"parenthesis"===i&&(o.precedence=0),t.push(o),t.length-1},Ki={_tokens:[],_withString:function(t){return" #"+ji(Ki._tokens,t.substring(1,t.length-1),"literal","string")+"#"},_withField:function(t){return" #"+ji(Ki._tokens,t,"literal","variable")+"#"},_withFieldInBrackets:function(t){return Ki._withField(t.substring(1,t.length-1))},_withNegativeNumber:function(t){let e=+t;if(e==e){return" #"+ji(Ki._tokens,e,"literal","number")+"#"}return""},_withPositiveNumber:function(t){return 35===t.charCodeAt(0)?t:Ki._withNegativeNumber(t)},_withOperator:function(t){if(Yi[t]){return"="!=t&&"==="!=t||(t="=="),"#"+ji(Ki._tokens,t,"operator")+"#"}return""},_withParenthesis:function(t){return"#"+ji(Ki._tokens,t,"parenthesis")+"#"},_tester:function(t){let e=t._rpn,i=e.length,n=0,o=0;for(let t=0;t<i;++t){let i=e[t];if("literal"!==i.type){let t=Xi[i.value];if(!(n>=t))return console.warn("Cannot parse an expression with insufficient number of operands"),!0;n-=t}n++,n>o&&(o=n)}return 1!==n||(t._stackSize=o,!1)},_filter:function(t,e){let i,n=t._rpn,o=new Array(t._stackSize),r=n.length,s=0;for(let t=0;t<r;++t){let r=n[t],l=r.value;"literal"===r.type?i="variable"!==r.dataType?l:e?e[l]:null:1===Xi[l]?(i=qi[l](o[s-1]),s-=1):(i=qi[l](o[s-2],o[s-1]),s-=2),o[s++]=i}return!!o[0]},parse:function(t){if("function"==typeof t)return t;if(!t||"string"!=typeof t)return null;let e=t.trim();if(!e)return null;Ki._tokens.length=0,e=e.replace(/".+?"/g,Ki._withString),e=e.replace(/'.+?'/g,Ki._withString),e=e.replace(/\[.+?\]/g,Ki._withFieldInBrackets),e=e.replace(/-[0-9.]+/g,Ki._withNegativeNumber),e=e.replace(/[0-9.#]+/g,Ki._withPositiveNumber),e=e.replace(/[a-zA-Z_]\w*/g,Ki._withField),e=e.replace(/[\-\/+*%!=<>&|]+/g,Ki._withOperator),e=e.replace(/[()]/g,Ki._withParenthesis);let i=Ki._tokens,n=i.length;if(!n)return null;let o,r,s,l=[],a=e.match(/#[0-9]+#/g);for(o=0;o<n;++o){let t=a[o];if(r=i[+t.substring(1,t.length-1)],s=r.type,"literal"===s){let t=l[l.length-1];if(t&&"literal"===t.type){if(!(r.value<0&&"number"===r.dataType))return console.warn("Cannot parse an expression with insufficient number of operators"),null;ji(l,"-","operator"),r.value*=-1}}l.push(r)}Ki._tokens.length=0,n=l.length;let u=[],h=[],p=null,d=!1;for(o=0;o<n;++o)if(r=l[o],s=r.type,"literal"===s)u.push(r);else if("parenthesis"===s)if("("===r.value)h.push(r);else{for(d=!1;h.length;){if(p=h.pop(),"("===p.value&&"parenthesis"===p.type){d=!0;break}u.push(p)}d||console.warn("No left parenthesis paired with the right one")}else{for(;h.length&&!(r.precedence>h[h.length-1].precedence);)u.push(h.pop());h.push(r)}for(d=!1;h.length;)p=h.pop(),"("===p.value&&"parenthesis"===p.type?d=!0:u.push(p);if(d&&console.warn("No right parenthesis paired with the left one"),!u.length)return null;let c={_rpn:u};return Ki._tester(c)?null:Ki._filter.bind(null,c)}};let Ji=function(){this._conditions=[],this._scopes=[],Ji._painters.push(this)};Ji.ColoringTypes={TEXT:1,HEATMAP:2,CONDITIONAL:3},Ji.prototype._coloringType=0,Ji.prototype._conditions=null,Ji.prototype._effectiveStyles=null,Ji.prototype._blinkCondition=null,Ji.prototype._scopes,Ji.prototype._columnStats=null,Ji.prototype._levelColorDisabled=!1,Ji.prototype._blinkingDuration=250,Ji._runningBlinkId=0,Ji._painters=[],Ji._emptyAry=[],Ji._emptyObj={},Ji._bgObj={backgroundColor:"",color:""},Ji._colorObj={color:""},Ji.bgStyles=["backgroundColor","color"],Ji.nonBgStyles=["fontSize","fontWeight","fontStyle","textAlign","textDecoration"],Ji.supportedStyles=Ji.bgStyles.concat(Ji.nonBgStyles),Ji.themeReady=null,Ji.parse=Ki.parse,Ji.prototype.dispose=function(){let t=Ji._painters.indexOf(this);t>=0&&Ji._painters.splice(t,1),this.reset(),this._conditions=null,this._scopes.length=0,this._blinkCondition=null},Ji.prototype.reset=function(){this._setColoringType(0);let t=this._scopes.length;if(t){for(let e=0;e<t;++e){let t=this._scopes[e];Ji._clearBlinkTimer(t)&&t._restorer();let i=t.cell;i&&delete i.blinking,t.cell=null}this._scopes.length=0}this._blinkCondition=null},Ji.prototype.resetColoring=function(){this._setColoringType(0),this._effectiveStyles=null,this._conditions.length=0},Ji.prototype.resetBlinking=function(){this._blinkCondition=null,this._scopes.length=0},Ji.prototype.clearBlinking=function(){this._blinkCondition=null;let t=this._scopes.length;if(t){for(let e=0;e<t;++e){let t=this._scopes[e];Ji._clearBlinkTimer(t)&&t._restorer();let i=t.cell;i&&delete i.blinking,t.cell=null}this._scopes.length=0}},Ji.prototype.resetHeatMap=function(){this._conditions.length=0,this._columnStats=null},Ji.prototype.clearHeatMap=function(){return this._blinkCondition?(this._setColoringType(0),this.resetHeatMap(),!1):(this.dispose(),!0)},Ji.prototype.applyThemeColor=function(){let t=E.getColors();if(this._coloringType===Ji.ColoringTypes.HEATMAP){let e=this._conditions[0];if(e&&(e.textMode?e.baseColor=t.baseText:e.baseColor=t.baseGrid,e.useThemeColor)){let i=t.up,n=t.down,o=t.level===t.baseText?"":t.level;Ji._setUpDownColors(e,i,n,o)}}this._blinkCondition&&this._blinkCondition.useThemeColor&&Ji._setUpDownColors(this._blinkCondition,t.up,t.down,t.level,!0)},Ji.prototype.getConditions=function(){return this._conditions},Ji.prototype.getColoringType=function(){return this._coloringType},Ji.prototype._setColoringType=function(t){this._coloringType!==t&&(this._coloringType=t)},Ji.prototype.setEffectiveStyles=function(t){this._effectiveStyles=t},Ji.prototype.getEffectiveStyles=function(){return this._effectiveStyles},Ji.prototype.setConditions=function(t){this._conditions.length=0,this._setColoringType(Ji.ColoringTypes.CONDITIONAL);let e=t.length;for(let i=0;i<e;i++)this._addCondition(t[i])},Ji.prototype.setColumnStats=function(t){this._columnStats=t&&t.getMin?t:null},Ji.prototype.getColumnStats=function(){return this._columnStats},Ji.prototype._addCondition=function(t){let e=t.expression;e&&(t._fn=Ki.parse(e.text||e),this._conditions.push(t))},Ji.prototype.addHeatmap=function(t,e,i,n,o,r){this._setColoringType(Ji.ColoringTypes.HEATMAP);let s={heatmap:!0};return s.field=t,s.expression=Ji._heatMapCondition.bind(s),s.midPoint=e,Ji._setUpDownColors(s,i,n),s.baseColor=o,!0!==r&&"text"!==r||(s.textMode=!0),this._addCondition(s),s},Ji.prototype.addHeatmapWithTheme=function(t,e,i){let n=E.themeColors,o=this.addHeatmap(t,e,n.up,n.down,n.baseGrid,i);return!0!==i&&"text"!==i||(o.baseColor=n.baseText),o.useThemeColor=!0,o},Ji.prototype._addColorText=function(t,e,i,n,o){this._setColoringType(Ji.ColoringTypes.TEXT);let r={};return r.field=e,r.expression=t.bind(null,e),r.upClass=i,r.downClass=n,r.levelClass=o,this._addCondition(r),r},Ji.prototype.addColorText=function(t,e,i,n){return this._addColorText(Ui[t]?Ji._tickColorTextCondition:Ji._colorTextCondition,t,e,i,n)},Ji.prototype.addColorTextWithTheme=function(t){return this.addColorText(t,"positive","negative","neutral")},Ji.prototype.addTickColorText=function(t,e,i){return this.addColorText("CF_TICK",t,e,i)},Ji.prototype.addTickColorTextWithTheme=function(){let t=E.themeColors,e=this.addTickColorText(t.tickUp,t.tickDown,t.level);return e.useThemeColor=!0,e},Ji.prototype.addTickBlink=function(t,e,i,n){return this.addBlink("CF_TICK",t,e,i,n)},Ji.prototype.addTickBlinkWithTheme=function(t){let e=E.themeColors,i=this.addTickBlink(e.tickUp,e.tickDown,e.level,t);return i.useThemeColor=!0,i},Ji.prototype.addBlink=function(t,e,i,n,o){return this._addBlink(Ui[t]?Ji._tickBlinkCondition:Ji._fieldBlinkCondition,t,e,i,n,o)},Ji.prototype.addBlinkWithTheme=function(t,e){let i=E.themeColors,n=this.addBlink(t,i.up,i.down,i.level,e);return n.useThemeColor=!0,n},Ji.prototype._addBlink=function(t,e,i,n,o,r){let s=this._blinkCondition={};return s.blink=!0,s.blinkId=Ji._runningBlinkId++,s.field=e,s._fn=s.expression=t,!0!==r&&"border"!==r||(s.border=!0),Ji._setUpDownColors(s,i,n,o,!0),s},Ji.prototype.renderForPrinting=function(t,e,i,n){if(!t)return;let o=this._getStyles(e,i,n),r=o.cssClass;null!=r?(elem._coloringCssClass&&elem._coloringCssClass!==r&&(elem.classList.remove(elem._coloringCssClass),elem._coloringCssClass=null),r&&(elem.classList.add(r),elem._coloringCssClass=r)):(t._coloringCssClass&&(t.classList.remove(t._coloringCssClass),t._coloringCssClass=null),t.style.backgroundColor=o.backgroundColor||"",t.style.color=o.color||"")},Ji._colorTextCondition=function(t,e){let i=e[t];if(i||0===i){if(i>0)return 1;if(i<0)return-1}return"u"},Ji._tickColorTextCondition=function(t,e){return Wi[e[t]]},Ji._heatMapCondition=function(t,e,i){let n,o=t[this.field],r=o||0===o?o-this.midPoint:NaN;if(0===r||r!=r)return 0;let s=1;return r>0?(s=i-this.midPoint,s<0&&(s=e-this.midPoint)):(s=e-this.midPoint,s>0&&(s=i-this.midPoint)),s<0&&(s=-s),n=r/s,n},Ji._tickBlinkCondition=function(t){return Wi[t]},Ji._fieldBlinkCondition=function(t,e){return t>e?1:t<e?-1:0},Ji._borderRestorer=function(t){t.blinkTimer=0;let e=t.cell.getElement();e&&(e.style.border="")},Ji._cellRestorer=function(t){t.blinkTimer=0;let e=t.cell.getElement();if(e){let i=t.rowData,n=NaN,o=NaN;if(this._coloringType===Ji.ColoringTypes.HEATMAP){let t=this._columnStats;t&&(n=t.getMin(),o=t.getMax())}let r=this._getStyles(i,n,o),s=r.cssClass;null!=s?(e._coloringCssClass&&e._coloringCssClass!==s&&(e.classList.remove(e._coloringCssClass),e._coloringCssClass=null),s&&(e.classList.add(s),e._coloringCssClass=s),e.style.backgroundColor="",e.style.color=""):(e._coloringCssClass&&(e.classList.remove(e._coloringCssClass),e._coloringCssClass=null),e.style.backgroundColor=r.backgroundColor||"",e.style.color=r.color||"")}},Ji.prototype._getStyles=function(t,e,i){if(!t)return Ji._emptyObj;let n=this._conditions.length;for(let o=0;o<n;++o){let n,r=this._conditions[o],s=r._fn;try{n=s&&s(t,e,i)}catch(t){}if(n){if(this._coloringType===Ji.ColoringTypes.HEATMAP){let t;return t=n>0?Ji.blendColor(r.baseColor,r.upColor,n):Ji.blendColor(r.baseColor,r.downColor,-n),r.textMode?(Ji._colorObj.color=Ji.num2Hex(t),Ji._colorObj):(Ji._bgObj.backgroundColor=Ji.num2Hex(t),Ji._bgObj.color=Ji.blackAndWhite(t),Ji._bgObj)}return this._coloringType===Ji.ColoringTypes.TEXT?(r.cssClass=n>0?r.upClass:n<0?r.downClass:this._levelColorDisabled?"":r.levelClass,r.cssClass=r.cssClass||"",r):r}}return Ji._emptyObj},Ji.blendColor=function(t,e,i){i>1?i=1:i<0&&(i=0);let n=Ji.hex2Num(t),o=Ji.hex2Num(e),r=[];for(let t=0;t<3;++t){let e=(o[t]-n[t])*i;r.push(n[t]+e)}return r},Ji.blackAndWhite=function(t){return Math.sqrt(t[0]*t[0]*.241+t[1]*t[1]*.691+t[2]*t[2]*.068)>=135?"#000000":"#FFFFFF"},Ji.rgb2Hex=I,Ji.num2Hex=function(t){return"#"+(16777216+(t[2]|t[1]<<8|t[0]<<16)).toString(16).slice(1)},Ji.num2Rgb=function(t){return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},Ji.hex2Num=function(t){let e=parseInt(t.replace(/[^0-9A-F]/gi,""),16);return[e>>16&255,e>>8&255,255&e]},Ji.hex2Rgb=function(t){if(t){let e=parseInt(t.replace(/[^0-9A-F]/gi,""),16);return"rgb("+(e>>16&255)+", "+(e>>8&255)+", "+(255&e)+")"}return""},Ji.themeChanged=function(){},Ji.setThemeColors=function(){},Ji._onThemeChanged=function(){let t=Ji._painters;for(let e=t.length;--e>=0;)t[e].applyThemeColor()},Ji.loadThemeColors=function(){return Ji.themeReady||(Ji.themeReady=E.getThemeColors(Ji._onThemeChanged).then(Ji._onThemeChanged).catch(Ji._onThemeChanged)),Ji.themeReady},Ji.reloadThemeColors=function(){return Ji.themeReady=E.reloadThemeColors().then(Ji._onThemeChanged).catch(Ji._onThemeChanged),Ji.themeReady},Ji.clearCellStyle=function(t,e){let i=t.getElement();if(!i)return;let n=t.blinking;if(n&&(Ji._clearBlinkTimer(n),delete t.blinking,n.cell=null),i._coloringCssClass&&i.classList.remove(i._coloringCssClass),e||(e=Ji.supportedStyles),Array.isArray(e))for(let t=e.length;--t>=0;)i.style[e[t]]="";else for(let t in e)i.style[t]=""},Ji._setUpDownColors=function(t,e,i,n,o){t.upColor=e,null!=e&&o&&(t.contrastUpColor=Ji.getOppositeColor(e)),t.downColor=i,null!=i&&o&&(t.contrastDownColor=Ji.getOppositeColor(i)),t.levelColor=n,null!=n&&o&&(t.contrastLevelColor=Ji.getOppositeColor(n))},Ji._clearBlinkTimer=function(t,e){return!!t.blinkTimer&&(clearTimeout(t.blinkTimer),t.blinkTimer=0,!0)},Ji.getOppositeColor=function(t){if("string"==typeof t){if("#"===t.charAt(0)){let e=Ji.hex2Num(t);return Ji.blackAndWhite(e)}}else if(Array.isArray(t))return Ji.blackAndWhite(t);return""},Ji.prototype.render=function(t,e,i,n,o){null!=i&&i==i?this._paintCell(t,e,i,n):this._conditions.length&&this._coloringType===Ji.ColoringTypes.CONDITIONAL&&this._paintCell(t,e)},Ji.prototype.renderHeatMap=function(t,e,i,n){this._paintCell(t,e,i,n)},Ji.prototype.renderColoring=function(t,e){this._paintCell(t,e)},Ji.prototype._paintCell=function(t,e,i,n){if(!t)return;let o=t.getElement();if(!o)return;let r,s=this._blinkCondition;if(s&&(r=t.blinking,r&&r.blinkTimer&&!s.border))return;let l=this._getStyles(e,i,n),a=o.style,u=l.cssClass;o._coloringCssClass&&o._coloringCssClass!==u&&(o.classList.remove(o._coloringCssClass),o._coloringCssClass=null),null!=u?u&&(o.classList.add(u),o._coloringCssClass=u):(l.backgroundColor?a.backgroundColor=l.backgroundColor:this._effectiveStyles&&!this._effectiveStyles.backgroundColor||(a.backgroundColor=""),l.color?a.color=l.color:this._effectiveStyles&&!this._effectiveStyles.color||(a.color=""))},Ji.prototype.blink=function(t,e,i){this._blinkCell(t,i,e)},Ji.prototype.blinkCell=function(t,e,i,n){if(!this._blinkCondition)return!1;let o=this._blinkCondition._fn(e,i);return this._blinkCell(t,n,o)},Ji.prototype._blinkCell=function(t,e,i){if(!t)return!1;if(this._levelColorDisabled&&!i)return!1;let n=t.getElement();if(!n)return!1;let o=this._blinkCondition;if(!o)return!1;let r,s,l=t.blinking;if(l||(l={},l.cell=t,t.blinking=l,this._scopes.push(l)),l.blinkId!==o.blinkId){l.blinkId=o.blinkId,l.field=o.field;let t=o.border?Ji._borderRestorer:Ji._cellRestorer;l._restorer=t.bind(this,l)}l.rowData=e,i>0?(r=o.upColor,s=o.contrastUpColor):i<0?(r=o.downColor,s=o.contrastDownColor):(r=o.levelColor,s=o.contrastLevelColor);let a=!0;return o.border?(n.style.border="1px solid "+r,a=!1):(n.style.backgroundColor=r,n.style.color=s),Ji._clearBlinkTimer(l),l.blinkTimer=setTimeout(l._restorer,this._blinkingDuration),a},Ji.prototype.verifyBlinking=function(t,e){let i=t.blinking;i&&i.blinkTimer&&i.rowData!==e&&(i.rowData=e,Ji._clearBlinkTimer(i)&&i._restorer())},Ji.prototype.disableLevelColor=function(t){this._levelColorDisabled=!1!==t},Ji.prototype.setBlinkingDuration=function(t){"number"==typeof t&&(this._blinkingDuration=t)};if(window){var Qi=window.tr;Qi||(Qi=window.tr={});var Zi=Qi.rt;Zi||(Zi=Qi.rt={});var $i=Qi.grid;$i||($i=Qi.grid={}),Qi.MockJET||(Qi.MockJET=Gi),Qi.closestElement||(Qi.closestElement=o.closestElement),Qi.CellPainter||(Qi.CellPainter=Ji),Zi.Grid||(Zi.Grid=ii),$i.CellPainter||($i.CellPainter=Ji)}e.default=ii}]);
1
+ !function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e,n){"use strict";n.r(e),n.d(e,"Grid",(function(){return ni}));let o={create:function(t,e){let i=document.createElement(t);return e&&(i.className=e),i},div:function(t){return o.create("div",t)},text:function(t,e){let i=o.create("span",e);return(t||0===t)&&(i.textContent=t),i},appendChild:function(t,e){if(!t)return null;let i,n;Array.isArray(arguments[1])?(n=arguments[1],i=0):(n=arguments,i=1);let o=n.length;for(;i<o;)t.appendChild(n[i]),++i;return t},buildTree:function(t,e){if(!t)return null;let i=arguments,n=i.length;for(let e=1;e<n;++e){let n=i[e];if(n){let e;Array.isArray(n)?e=o.buildTree.apply(null,n):1===n.nodeType&&(e=n),e&&t.appendChild(e)}}return t},removeParent:function(t){if(!t)return null;let e=t.parentNode;return e&&e.removeChild(t),e},setParent:function(t,e){return t?e?(e.appendChild(t),e):o.removeParent(t):null},removeChildren:function(t,e){if(t){let i=t.childNodes.length;for((null==e||e>i)&&(e=i);--e>=0;)t.removeChild(t.lastChild)}},setContent:function(t,e){if(t)if(e||0===e){let i=e.nodeType;1===i||3===i?e!==t.lastChild&&(o.removeChildren(t),t.appendChild(e)):Array.isArray(e)?(o.removeChildren(t),o.appendChild(t,e)):t.textContent=e}else o.removeChildren(t)},toggleAttribute:function(t,e,i){i?t.setAttribute(e,"string"==typeof i?i:""):null==i?t.hasAttribute(e)?t.removeAttribute(e):t.setAttribute(e,""):t.removeAttribute(e)},toggleClass:function(t,e,i){i?t.classList.add(e):null==i?t.classList.contains(e)?t.classList.remove(e):t.classList.add(e):t.classList.remove(e)},addClasses:function(t,e){if(t){let i=Array.isArray(e)?e:arguments,n=i.length;for(let e=0;e<n;++e){let n=i[e];n&&"string"==typeof n&&t.classList.add(n)}}},removeClasses:function(t,e){if(t){let i=Array.isArray(e)?e:arguments,n=i.length;for(let e=0;e<n;++e){let n=i[e];n&&"string"==typeof n&&t.classList.remove(n)}}},preventDefault:function(t){t.preventDefault(),t.stopPropagation()},stopPropagation:function(t){t.stopPropagation()},getClientPosition:function(t,e){let i=e||{x:0,y:0};if(t.getBoundingClientRect){let e=t.getBoundingClientRect();i.x=e.left,i.y=e.top}else i.x=t.clientX,i.y=t.clientY;return i},getRelativePosition:function(t,e,i){i=o.getClientPosition(t,i);let n=o.getClientPosition(e);return i.x-=n.x,i.y-=n.y,i},closestElement:function(t,e){let i=t;for(;i;){if(i.classList&&i.classList.contains(e))return i;i=i.parentNode||i.host}return null},closestTagName:function(t,e){let i=t;for(;i;){if(i.tagName&&i.tagName==e)return i;i=i.parentNode||i.host}return null}};let r=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)};r.prototype._data,r.prototype._func=null,r.prototype._delay=0,r.prototype._timerId=0,r.prototype._conflated=!1,r.prototype._disabled=!1,r.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},r.prototype.popAllData=function(){if(this._data.length){let t=this._data;return this._data=[],t}return null},r.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},r.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))},r.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},r.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},r.prototype.getData=function(){return this._data},r.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},r.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},r.prototype.getConflatingTime=function(){return this._delay},r.prototype.disable=function(t){this._disabled=!1!==t},r.prototype.isEnabled=function(){return!this._disabled},r.prototype.enable=function(t){this._disabled=!1===t};let s={inherits:function(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.base=function(t,i,n){i||(i="constructor");let o=arguments.length,r=new Array(o);for(let t=2;t<o;t++)r[t-2]=arguments[t];return e.prototype[i].apply(t,r)}}};var l=s;let a=function(){};a.prototype._events=null,a.prototype._listenerCount=0,a.prototype.addEventListener=function(t,e){if(!t||!e)return;this._events||(this._events={});let i=this._events[t];i?i.indexOf(e)<0&&(i.push(e),++this._listenerCount):(this._events[t]=[e],++this._listenerCount)},a.prototype.removeEventListener=function(t,e){let i=this._events?this._events[t]:null;if(i){let t=i.indexOf(e);t>=0&&(i.splice(t,1),--this._listenerCount)}},a.prototype.removeAllEventListeners=function(){this._events=null,this._listenerCount=0},a.prototype.hasListener=function(t){if(this._listenerCount){if(t){let e=this._events?this._events[t]:null;return!!e&&e.length>0}return!0}return!1},a.prototype.getListener=function(t,e){if(t){let i=this._events?this._events[t]:null;if(i)return e||(e=0),i[e]||null}return null},a.prototype.addListener=function(t,e){let i=t?t[e]:null;"function"==typeof i&&this.addEventListener(e,i)},a.prototype._prepareEventArguments=function(t,e){return e},a.prototype._dispatch=function(t,e){let i=this._events?this._events[t]:null;if(i){e=this._prepareEventArguments(t,e);let n=i.length;for(let t=0;t<n;++t)i[t](e)}};a.preventDefault=function(t){t&&t.preventDefault&&(t.preventDefault(),t.stopPropagation())};var u=a;let h=function(t,e){if(t=t.trim(),this._inputConverter[t]&&(t=this._inputConverter[t]),this._input=t,null!=e&&(this._index=e),null!=this._constants[t])return this._value=this._constants[t],void(this._type=typeof this._value);let i=t.charAt(0),n=t.length>1?t.charAt(t.length-1):"";if('"'===i&&'"'===n)return this._value=t.substring(1,t.length-1),void(this._type="string");if("'"===i&&"'"===n)return this._value=t.substring(1,t.length-1),void(this._type="string");if("("===i&&")"===n)return void this._resolveVariableGroup(t);if("["===i&&"]"===n)return void this._resolveArray(t);if(t.match(/TR\.\w+\(/))return void(this._type="dynamic");let o=t.match(/[\w._]+\(/g);if(o&&1===o.length)return void this._resolveFunction(t,o[0]);let r=t.match(/[\w._♦]+/g);if(r&&r.length>1)return void this._resolveVariableGroup(t);if("♦"===i)return void(this._type="token");let s=Number(t);if(s==s)return this._value=s,void(this._type="number");this._type="dynamic"};h.prototype._input="",h.prototype._index=-1,h.prototype._type="",h.prototype._subVars=null,h.prototype._funcName="",h.prototype._value,h.prototype._valueWithTokenField="",h.prototype._inputConverter={TRUE:"true",FALSE:"false",PI:"Math.PI","TRUE()":"true","FALSE()":"false","PI()":"Math.PI"},h.prototype._constants={true:!0,false:!1,null:null,NaN:NaN,"Math.E":Math.E,"Math.PI":Math.PI,"Math.SQRT2":Math.SQRT2,"Math.SQRT1_2":Math.SQRT1_2,"Math.LN2":Math.LN2,"Math.LN10":Math.LN10,"Math.LOG2E":Math.LOG2E,"Math.LOG10E":Math.LOG10E},h.prototype.getExpression=function(){return"dynamic"===this._type?'this.__D("'+this._input+'", __R)':"group"===this._type?this._value:"function"===this._type?this._subVars?"this.__F["+this._index+"]("+this._subVars.join(", ")+")":"this.__F["+this._index+"]()":"array"===this._type?this._subVars?"["+this._subVars.join(", ")+"]":"[]":this._input},h.prototype.getInputWithTokenField=function(){return"dynamic"===this._type?"♠"+this._input+"♥":"group"===this._type?this._valueWithTokenField:"function"===this._type?this._funcName+"("+this.getChildInputWithToken()+")":"array"===this._type?"["+this.getChildInputWithToken()+"]":this._input},h.prototype.getChildInputWithToken=function(){let t=this._subVars?this._subVars.length:0;if(t<=0)return"";let e=new Array(t);for(let i=0;i<t;++i)e[i]=this._subVars[i].getInputWithTokenField();return e.join(", ")},h.prototype.toString=h.prototype.getExpression,h.prototype.getValue=function(){return this._value},h.prototype.getInput=function(){return this._input},h.prototype.getIndex=function(){return this._index},h.prototype.setIndex=function(t){this._index=t},h.prototype.getFunctionName=function(){return this._funcName},h.prototype.getFieldNames=function(t){if(this._subVars){if(t){let e=this._subVars.length;for(let i=0;i<e;++i)this._subVars[i].getFieldNames(t)}return this._subVars[0].getFieldNames()}return"dynamic"===this._type?(t&&(t[this._input]=!0),this._input):""},h.prototype._resolveVariableGroup=function(t){let e=this._subVars?this._subVars.length:0;return this._type="group",this._value=t.replace(/[\w._♦]+/g,function(t){this._subVars||(this._subVars=[]);let e=new h(t,this._subVars.length);return this._subVars.push(e),e.getExpression()}.bind(this)),this._valueWithTokenField=t.replace(/[\w._♦]+/g,function(t){return this._subVars[e++].getInputWithTokenField()}.bind(this)),this._value},h.prototype._resolveFunction=function(t,e){if(this._type="function",this._funcName=e.substr(0,e.length-1),t=(t=t.replace(e,"")).substr(0,t.length-1)){this._subVars=[];let e=t.split(","),i=e.length;for(let t=0;t<i;++t)this._subVars[t]=new h(e[t],t)}},h.prototype._resolveArray=function(t){if(this._type="array",t=t.substr(1,t.length-1)){this._subVars=[];let e=t.split(","),i=e.length;for(let t=0;t<i;++t)this._subVars[t]=new h(e[t],t)}};var p=h;let d=function(t,e){this._input=t||"",null!=e&&(this._context=e,e._DATA&&(this.__D=e._DATA)),this.__F=[],this._fnTokens=[],this._fields=[],this._fieldMap={},this._dataCache={},this._intervalServices={},this._formulaCount=1,this._onDataCacheChanged=this._onDataCacheChanged.bind(this),this.dispatchDataChanged=this.dispatchDataChanged.bind(this),this._parse(this._input)};l.inherits(d,u),d._isBoundFormula={RECORD:!0,TR:!0,MTXSERIES:!0,NOW:!0,TODAY:!0,ADSTYLEATTRIBUTE:!0,ADBONDDERIV:!0,ADBONDYIELD:!0,BDSETTLE:!0,ACCRUED:!0,CFYLD:!0,DFFORMATDATE:!0,DFADDPERIOD:!0,DFADDWD:!0,DFADDMONTHS:!0,DFADDYEARS:!0,DFADJUSTTOWD:!0,DFLASTWD:!0,DFFINDDATED:!0,DFCOUNTDAYS:!0,DFCOUNTWD:!0,ADFXSWPTODEP:!0,FXCALCPERIOD:!0,OPCALCDERIV:!0,OPIMPLIEDVOL:!0,ADFORMAT:!0,ADHISTORYVALUE:!0},d.prototype._input="",d.prototype._expression="",d.prototype._alias="",d.prototype._main=null,d.prototype.__F=null,d.prototype._fnTokens=null,d.prototype._fields=null,d.prototype._fieldMap=null,d.prototype._reference="",d.prototype._context=null,d.prototype._rtService=null,d.prototype._intervalServices=null,d.prototype._dataCache=null,d.prototype._dataLastError="",d.prototype._inputWithTokenField="",d.prototype._formulaCount=0,d._invalidOps={"+=":!0,"-=":!0,"*=":!0,"/=":!0,"|=":!0,"&=":!0,"^=":!0},d.prototype.dispose=function(){this._rtService&&(this._rtService.dispose(),this._rtService=null);for(let t in this._intervalServices)this._intervalServices[t].removeEventListener("dataChanged",this.dispatchDataChanged);this._intervalServices=null,this.unlistenAll()},d.prototype.calculate=function(t){if(this._main){this._dataLastError="";let e=this._main(t);switch(this._dataLastError){case"Pending data":e=null;break;case"Pending - no erase":e="..."}return e}return null},d.prototype.getFunction=function(){return this._main},d.prototype.getFieldNames=function(){return this._fields},d.prototype._setReference=function(t){this._reference=t},d.prototype.getReference=function(){return this._reference},d.prototype.getExpression=function(){return this._expression},d.prototype.toString=d.prototype.getReference,d.prototype.getInput=function(){return this._input},d.prototype.getAlias=function(){return this._alias||this._input},d.prototype.setAlias=function(t){this._alias=t},d.prototype.addFormulaCount=function(){this._formulaCount++},d.prototype.subtractFormulaCount=function(){return 0==--this._formulaCount},d.prototype.updateContext=function(){if(!this._context)return;let t=this._fnTokens.length;for(let e=0;e<t;++e){let t=this._fnTokens[e].getFunctionName();this.__F[e]=this._context[t]||d._emptyFunction,d._isBoundFormula[t]&&(this.__F[e]=this.__F[e].bind(this))}},d.prototype._logger=function(t){console.log("["+t+"] "+this._fnTokens[t].getFunctionName()+" is executed")},d._emptyFunction=function(){},d.prototype._detectCodeInjection=function(t){let e=!1;if(t.match(/\+\+|--/)&&(e=!0),!e){let i=t.match(/([^=]=+)/g)||[];for(let t=i.length;--t>=0;){let n=i[t],o=n.substring(n.length-2);if(d._invalidOps[o]){e=!0;break}}}return e},d.toUpperCase=function(t){if(!t||"="!==t.charAt(0))return t||"";let e=[],i=[];return t=(t=(t=d.tokenizeQuotes(t,e,i)).toUpperCase()).replace(/TR(\.[\w ]+)+\([^\(\)]*\)(\.[a-zA-Z]+)*/g,d._encloseWithTR),t=d.resolveTokens(t,e,i)},d._encloseWithTR=function(t){return'TR("'+t+'")'},d.tokenizeQuotes=function(t,e,i){let n;e||(e=[]),i||(i=[]);let o=!1,r=[];do{o=!1,t=t.replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,(function(t){return o=!0,n=e.length,e.push(new p(t,n)),r.push(n),"♦"+n+"♦"}))}while(o);return i.push(r),t},d.tokenizeAdcWithParams=function(t,e,i){let n;e||(e=[]),i||(i=[]);let o=!1,r=[];do{o=!1,t=t.replace(/TR\.\w+\([^\)]*\)+/g,(function(t){return o=!0,n=e.length,e.push(new p(t,n)),r.push(n),"♦"+n+"♦"}))}while(o);return i.push(r),t},d.replaceUnwantedCharacters=function(t,e,i){for(;t.indexOf(" ")>=0;)t=t.replace(/ {2}/g," ");return t=(t=(t=t.replace(/\$/g,"")).replace(/\&+/g,(function(t){return"&"===t?"+":t}))).replace(/(<=|>=|!=|!==|===|==|=(?!([\w]*\([^()]*\))))/g,(function(t){return"="===t?"==":t}))},d.prototype._tokenizeParentheses=function(t,e,i){e||(e=[]),i||(i=[]);let n={},o=/[\w._]*(?:=|=[\w]*)?\([^()]*\)/,r=new RegExp(o.source,"g");for(;t.match(o);){let o=[];t=t.replace(r,(function(t,i){"="===t.charAt(0)&&(t=t.substr(1,t.length));let r=n[t];return null==r&&(r=e.length,e.push(new p(t,r)),n[t]=r),o.push(r),"♦"+r+"♦"})),i.push(o)}return t},d.prototype._tokenizeConstants=function(t,e,i){e||(e=[]),i||(i=[]);let n=[];return t=t.replace(/[\w._♦]+/g,(function(t){if("♦"===t.charAt(0))return t;let i=e.length;return e.push(new p(t,i)),n.push(i),"♦"+i+"♦"})),i.push(n),t},d.resolveTokens=function(t,e,i){for(let n=i.length;--n>=0;){let o=i[n],r=o.length;for(let i=0;i<r;++i){let n=o[i],r=e[n];t=t.replace(new RegExp("♦"+n+"♦","g"),(function(){return r.getExpression()}))}}return t},d._getInputWithTokenField=function(t,e,i){for(let n=i.length;--n>=0;){let o=i[n],r=o.length;for(let i=0;i<r;++i){let n=o[i],r=e[n];t=t.replace(new RegExp("♦"+n+"♦","g"),(function(){return r.getInputWithTokenField()}))}}return"="+t},d.prototype._parse=function(t){if(this._expression="",this._main=null,this.__F.length=0,this._fnTokens.length=0,this._fields.length=0,!t)return null;if("="===t.charAt(0)&&(t=t.substr(1)),!(t=(t=(t=(t=t.trim()).replace(/<>/g,"!=")).replace(/‛|‘|’/g,"'")).replace(/‟|“|”/g,'"'))||this._detectCodeInjection(t))return null;let e=[],i=[];t=d.tokenizeQuotes(t,e,i),t=d.tokenizeAdcWithParams(t,e,i),t=d.replaceUnwantedCharacters(t,e,i),t=this._tokenizeParentheses(t,e,i),t=this._tokenizeConstants(t,e,i),this._inputWithTokenField=d._getInputWithTokenField(t,e,i),t=d.resolveTokens(t,e,i);let n={},o=e.length;for(let i=0;i<o;++i){let o=e[i];if(o.getFunctionName()){let e=this._fnTokens.length;t=t.replace(new RegExp("this\\.__F\\["+i+"\\]","g"),"this.__F["+e+"]"),o.setIndex(e),this._fnTokens.push(o)}o.getFieldNames(n)}return this._expression=t,this.updateContext(),this._main=this._createFunction(this._expression),this._main?(this._fieldMap=n,this._fields=Object.keys(n),this._main):null},d.prototype._createFunction=function(t){let e=null;try{e=new Function("__R","return "+t+";"),e=e.bind(this),e({})}catch(t){e=null}return e},d.prototype.__D=function(t,e){return e[t]},d.prototype.addField=function(t,e){return!this._fieldMap[t]&&(!(t.indexOf("undefined")>=0)&&(this._fields.push(t),this._fieldMap[t]=!0,this._dispatch("dataRequired",{field:t,src:e||"adc"}),!0))},d.prototype.changeField=function(t,e){let i=this._fields.indexOf(t);if(i<0)return!1;this._fields.splice(i,1),this._fields.indexOf(e)<0&&this._fields.push(e);let n=this._input,o="♠"+t+"♥",r="♠"+e+"♥";return this._inputWithTokenField=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t===o?r:t})),this._input=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t.substr(1,t.length-2)})),this._expression=this._expression.replace(new RegExp('this\\.__D\\("'+t+'", __R\\)',"g"),'this.__D("'+e+'", __R)'),this._main=this._createFunction(this._expression),this._dispatch("formulaChanged",{oldInput:n,formula:this}),!0},d.prototype.changeFields=function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;let i=this._input;for(let i=t.length;--i>=0;){let n=t[i],o=e[i],r=this._fields.indexOf(n);if(r<0)continue;this._fields.splice(r,1),this._fields.indexOf(o)<0&&this._fields.push(o);let s="♠"+n+"♥",l="♠"+o+"♥";this._inputWithTokenField=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t===s?l:t})),this._input=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t.substr(1,t.length-2)})),this._expression=this._expression.replace(new RegExp('this\\.__D\\("'+n+'", __R\\)',"g"),'this.__D("'+o+'", __R)')}return this._main=this._createFunction(this._expression),this._dispatch("formulaChanged",{oldInput:i,formula:this}),!0},d.prototype.getRealtimeService=function(){return this._rtService},d.prototype.setRealtimeService=function(t){this._rtService&&this._rtService.dispose(),this._rtService=t,this._rtService.addEventListener("dataChanged",this._onDataCacheChanged)},d.prototype.getIntervalService=function(t){return this._intervalServices[t]},d.prototype.setIntervalService=function(t,e){if(!e)return;let i=this._intervalServices[t];i&&i.removeEventListener("dataChanged",this.dispatchDataChanged),this._intervalServices[t]=e,e.addEventListener("dataChanged",this.dispatchDataChanged)},d.prototype.getCachedData=function(t){return this._dataCache[t]},d.prototype.setCachedData=function(t,e){this._dataCache[t]=e},d.prototype.setDataError=function(t){this._dataLastError=t},d.prototype.dispatchDataChanged=function(t){this._dispatch("dataCacheChanged",{})},d.prototype._onDataCacheChanged=function(t){let e=t.ric,i=t.values,n=this._dataCache[e];if(n)for(let t in i)n[t]=i[t];else this._dataCache[e]=i;this._dispatch("dataCacheChanged",{})},d._proto=d.prototype;var c=d;var _={en:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat",Sunday:"Sunday",Monday:"Monday",Tuesday:"Tuesday",Wednesday:"Wednesday",Thursday:"Thursday",Friday:"Friday",Saturday:"Saturday",jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec",January:"January",February:"February",March:"March",April:"April",May:"May",June:"June",July:"July",August:"August",September:"September",October:"October",November:"November",December:"December",am:"am",AM:"AM",pm:"pm",PM:"PM"},de:{sun:"So",mon:"Mo",tue:"Di",wed:"Mi",thu:"Do",fri:"Fr",sat:"Sa",Sunday:"Sonntag",Monday:"Montag",Tuesday:"Dienstag",Wednesday:"Mittwoch",Thursday:"Donnerstag",Friday:"Freitag",Saturday:"Samstag",jan:"Jan",feb:"Feb",mar:"Mrz",apr:"Apr",may:"Mai",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Okt",nov:"Nov",dec:"Dez",January:"Januar",February:"Februar",March:"März",April:"April",May:"Mai",June:"Juni",July:"Juli",August:"August",September:"September",October:"Oktober",November:"November",December:"Dezember",am:"am",AM:"AM",pm:"pm",PM:"PM"},ja:{sun:"日",mon:"月",tue:"火",wed:"水",thu:"木",fri:"金",sat:"土",Sunday:"日曜日",Monday:"月曜日",Tuesday:"火曜日",Wednesday:"水曜日",Thursday:"木曜日",Friday:"金曜日",Saturday:"土曜日",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"1月",February:"2月",March:"3月",April:"4月",May:"5月",June:"6月",July:"7月",August:"8月",September:"9月",October:"10月",November:"11月",December:"12月",am:"午前",AM:"午前",pm:"午後",PM:"午後"},zh:{sun:"周日",mon:"周一",tue:"周二",wed:"周三",thu:"周四",fri:"周五",sat:"周六",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月",am:"上午",AM:"上午",pm:"下午",PM:"下午"},"zh-Hant":{sun:"週日",mon:"週一",tue:"週二",wed:"週三",thu:"週四",fri:"週五",sat:"週六",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月",am:"上午",AM:"上午",pm:"下午",PM:"下午"}};let f=function(t,e,i){if(!t)return null;if(!e||t===e)return t;let n;if(i){let o=i.length;for(let r=0;r<o;++r)n=i[r],n&&C(t,e,n)}else for(n in e)C(t,e,n);return t},g=function(t,e){return f({},t,e)},y=function(t){for(let e in t)return!1;return!0},m=function(t,e){if(!Array.isArray(t))return t;if(!e)return null;let i=t;t={};let n=i.length;for(let o=0;o<n;++o){let n=e[o];n&&void 0!==i[o]&&(t[n]=i[o])}return t},C=function(t,e,i){let n=e[i];if(null!=n){let e=t[i];Array.isArray(e)?t[i]=e.concat(n):Array.isArray(n)&&e?t[i]=n.concat(e):t[i]=n}},S=function(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if("object"==typeof t){if(Array.isArray(t)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!S(t[i],e[i]))return!1}else{if(Object.keys(t).length!==Object.keys(e).length)return!1;for(let i in t)if(!S(t[i],e[i]))return!1}return!0}return!1},w=function(t){return Array.isArray(t)?"{\n"+t.join("\n")+"\n}":t},b=function(t){return t.replace(/\n+/g,"\n\t").replace(/\n\t}$/,"\n}")},R=function(t,e){if(!t)return null;let i=document.createElement("style");i.textContent="\n"+t+"\n";let n,o=function(t){if(t){let e;if(t.shadowRoot?e=t.shadowRoot:t.getRootNode&&(e=t.getRootNode()),e&&e!==document&&e!==t)return e}return null}(e),r=!0;return o||(r=!1,o=document.head),r&&o.children&&o.children.length&&(n=o.children[0]),n?o.insertBefore(i,n):o.appendChild(i),i},v=function(t,e){e||(e=[]);for(let i in t){let n=t[i];"object"==typeof n?v(n,e):e.push(n)}return e},I=function(t){if(!t||"string"!=typeof t)return"";if("#"===t.charAt(0))return t;let e=t.match(/\d+/g);if(!e||e.length<3)return t;let i="#";for(let t=0;t<3;t++){let n=+e[t];n>=16||(i+="0"),i+=n?n.toString(16).toUpperCase():"0"}return i};let D=function(t,e,i){this.resolve=this.resolve.bind(this),this.reject=this.reject.bind(this),"function"==typeof t&&(this._resolveHandler=t),"function"==typeof e&&(this._rejectHandler=e),null!=i&&(this._ctx=i),this.promise=new Promise(function(t,e){this._resolve=t,this._reject=e}.bind(this))};D.prototype.promise=null,D.prototype._resolve=null,D.prototype._reject=null,D.prototype._resolveHandler=null,D.prototype._rejectHandler=null,D.prototype._ctx=null,D.prototype._fulfilled=!1,D.prototype.resolve=function(t){if(this._resolve){if(this._resolveHandler){let e=this._resolveHandler(t,this._ctx||this);null!=e&&(t=e)}this._resolve(t),this._finally()}},D.prototype.reject=function(t){if(this._reject){if(this._rejectHandler){let e=this._rejectHandler(t,this._ctx||this);null!=e&&(t=e)}this._reject(t),this._finally()}},D.prototype.isFulfilled=function(){return this._fulfilled},D.prototype._finally=function(){this._fulfilled=!0,this._ctx=this._resolveHandler=this._rejectHandler=null,this._resolve=this._reject=null};let x={},A=function(t,e){"attributes"==e.type&&"lang"==e.attributeName&&(t.lang=e.target.lang||"en")},L=function(t,e,i){"attributes"===i.type&&(null!=e?i.attributeName===e&&t(i.target.getAttribute(e)):t(i.target))};x._getNewId=function(){return"observer_"+ ++x._id},x._addObserver=function(t,e,i){let n=i;n||(n={}),n.attributes=!0,x._observer.observe(t,n),x._addListener(t,e)},x._onMutationCallback=function(t){for(let e=0;e<t.length;e++){let i=t[e],n=x._listeners[i.target._observeId];for(let t=0;t<n.length;t++)n[t](i)}},x._addListener=function(t,e){let i=x._listeners;if(i||(i=x._listeners={}),!t._observeId){let e=x._getNewId();t._observeId=e}i[t._observeId]||(i[t._observeId]=[]);let n=i[t._observeId];n.indexOf(e)<0&&n.push(e)},x.addLanguageListener=function(t){t&&(t.lang=document.documentElement.lang||"en",x._addObserver(document.documentElement,A.bind(null,t)))},x.addAttributeListener=function(t,e,i){t&&e&&x._addObserver(t,L.bind(null,e,i))},x._observer=new MutationObserver(x._onMutationCallback),x._listeners={},x._id=0;let T={en:!0,de:!0,ja:!0,zh:!0,"zh-Hant":!0},E={_deferred:null,themeReady:null,_defaultColors:{up:"#39C46E",down:"#F5475B",level:"#C2C2C2",tickUp:"#39C46E",tickDown:"#F5475B",baseGrid:"#1A1A1C",baseText:"#C2C2C2",trackColor:"#FF9933"}};E.themeColors=E._defaultColors,E._components={},E._themeName="",E._elfVersion=0,E._dummyIcon=null,E._iconLoaded=!1,E._profileName=null,E._callbacks=[],E._observed=!1,E._pendingResolve=!1,E._themeLoaded=!1,E._icons={"elf-theme-halo":{rowGrouping:{expander:"down"},sorting:{ascending:"hollow-arrow-up",descending:"hollow-arrow-down",sortable:"sort-up-down"},columnStack:{stack:"map-layers",expand:"right",collapse:"left"}},"elf-theme-solar":{columnStack:{stack:"list",expand:"right",collapse:"left"}}},E._icons["halo-theme"]=E._icons["elf-theme-halo"],E._icons["solar-theme"]=E._icons["elf-theme-solar"],E.getElfVersion=function(){if(!E._elfVersion){let t=0;if(window.EFX_GRID){let e=window.EFX_GRID.version;e=e.split("."),t=+e[0]}else if(window.elf)if(window.elf.version){let e=window.elf.version.match(/\d/);e&&e[0]&&(t=parseInt(e[0],10))}else window.elf.customElements?t=3:window.customElements&&(t=4);else window.Polymer&&(t=1);E._elfVersion=t}return E._elfVersion},E.hasComponent=function(t){let e=E._components[t];if(null==e){e=0;let i=E.getElfVersion();if(t){let n;1===i?(n=document.createElement(t),n.is===t&&(e=i)):i>1&&(window.customElements&&window.customElements.get(t)||document.createElement(t).constructor!==HTMLElement)&&(e=i),E._components[t]=e}}return e},E.toLangString=function(t){if(!t)return"";if("zh-hant"===(t=t.toLowerCase()))return"zh-Hant";let e=t.replace(/-.*/,"");return T[e]?e:""},E.hasTheme=function(t){return t===E.getThemeName()},E.getThemeName=function(t){return E._themeName||(E._themeName=E.getCssVariable("--theme-name",document.documentElement)),E._themeName},E.setThemeName=function(t){E._themeName=t},E.isThemeLoaded=function(){return E._themeLoaded},E.getColors=function(){return E.themeColors},E.isHaloTheme=function(t){return null==t&&(t=E.getThemeName()),!!t&&t.indexOf("halo")>=0},E.injectIcons=function(t,e){if("object"!=typeof t)return;let i=E.getThemeName();t.themeName=i;let n=E.getElfVersion();t.elfVersion=n;let o=E._icons[i];o&&(t.icons=o)},E.getIconList=function(){let t=E._icons[E.getThemeName()];return t?v(t):[]},E._onIconPreloaded=function(){if(E._dummyIcon){let t=E._dummyIcon.parentNode;t&&t.removeChild(E._dummyIcon),E._dummyIcon=null}},E.prepareIconPreloading=function(){if(!E._iconLoaded){E._iconLoaded=!0;let t=E.getIconList();if(t.length){setTimeout(E._onIconPreloaded,10);let e=E._dummyIcon=document.createElement("ef-icon");return e.style.transform="scale(0)",document.body.appendChild(e),t}}return null},E.getCssVariable=function(t,e){let i="",n=e||document.body;return window&&"string"==typeof t&&1===n.nodeType&&t.match(/^--/)&&(i=window.getComputedStyle(n).getPropertyValue(t),i=i.replace(/[\"\']/g,"")),i},E.getCssVariables=function(t,e){let i=e||document.body;if(window&&1===i.nodeType){let e=window.getComputedStyle(i);for(let i in t){let n=t[i];n&&n.match(/^--/)&&(t[i]=e.getPropertyValue(n).replace(/\"/g,""))}}return t||null},E.setRTK=function(t){null!=t&&(E._rtk=t)},E.getMovementColorProfile=function(){return document.documentElement.getAttribute("movement-color-profile")},E._addThemeChangedCallback=function(t){let e=E._callbacks;e.indexOf(t)<0&&e.push(t)},E.reloadThemeColors=function(){return E._deferred&&E._deferred.isFulfilled()?(E._profileName="",E._themeLoaded=!1,E.themeReady=null,E.getThemeColors()):E.themeReady},E.getThemeColors=function(t){if("function"==typeof t&&E._addThemeChangedCallback(t),E.themeReady)return E.themeReady;let e=E._deferred=new D;E.themeReady=e.promise;let i=E.getMovementColorProfile();if(i)i!==E._profileName?setTimeout(E._profileNameRetrieved,100):E._deferred.resolve(E.themeColors);else{let t={providerName:"Configuration",settingName:"RDE_USER_CURRENT_TICK_COLOR"},e=window?window.JET:null;if(E._themeLoaded=!1,E._rtk&&E._rtk.Settings)E._rtk.Settings.getAsync(t).then(E._loadingProfileSuccess).catch(E._loadingProfileFailure);else if(e&&e.Settings)try{e.Settings.read(E._loadingProfileSuccess,t)}catch(t){E._loadingProfileFailure()}else setTimeout(E._profileNameRetrieved,100)}return e.promise};let M=function(t){if(t!==E._profileName){E._retrieveThemeColors(t),E._pendingResolve&&(E._pendingResolve=!1,E._deferred.resolve(E.themeColors));let e=E._callbacks;for(let t=0;t<e.length;t++)e[t]()}};E._loadingProfileSuccess=function(t){t&&document.documentElement.setAttribute("movement-color-profile",t.toLowerCase()),E._observed?E._pendingResolve=!0:E._profileNameRetrieved(t)},E._loadingProfileFailure=function(){E._retrieveThemeColors(),E._observed||(E._observed=!0,x.addAttributeListener(document.documentElement,M,"movement-color-profile")),E._deferred.reject("Failed to get movement color profile from settings.")},E._profileNameRetrieved=function(){let t=E.getMovementColorProfile();E._retrieveThemeColors(t),E._observed||(E._observed=!0,x.addAttributeListener(document.documentElement,M,"movement-color-profile")),E._deferred.resolve(E.themeColors)},E._retrieveThemeColors=function(t){E._themeLoaded=!0,E._profileName=t;let e=E.themeColors=E.getCssVariables({primary:"--color-scheme-primary",secondary:"--color-scheme-secondary",tertiary:"--color-scheme-tertiary",complementary:"--color-scheme-complementary",up:"--color-scheme-positive",down:"--color-scheme-negative",level:"--color-scheme-neutral",tickUp:"--color-scheme-tickup",tickDown:"--color-scheme-tickdown"});e.up||(e.up=E._defaultColors.up,e.down=E._defaultColors.down,e.level=E._defaultColors.level,e.tickUp=E._defaultColors.tickUp,e.tickDown=E._defaultColors.tickDown),e.positive=e.up,e.negative=e.down,e.neutral=e.level;let i=document.createElement("table");i.style.visibility="hidden",i.style.position="fixed",i.style.left="0",i.style.top="0",i.style.width="0";let n=i.insertRow(-1),o=n.insertCell(-1);document.body.appendChild(i);let r=window.getComputedStyle(n);e.tableBg=r.backgroundColor;let s=window.getComputedStyle(o);e.tableText=s.color,e.tableBorder=s.borderColor,e.tableText===e.tableBorder&&(o.className="tr-lg",s=window.getComputedStyle(o),e.tableBg=s.backgroundColor,e.tableText=s.color,e.tableBorder=s.borderColor,e.tableText===e.tableBorder&&(e.tableBg=E._defaultColors.baseGrid,e.tableText=E._defaultColors.baseText,e.tableBorder="")),e.tableBg=I(e.tableBg),e.tableText=I(e.tableText),e.tableBorder=I(e.tableBorder),document.body.removeChild(i),e.baseGrid=e.tableBg,e.baseText=e.tableText,e.trackColor=e.primary||E._defaultColors.trackColor};var F=E;new Date(NaN);const P=Date.UTC(1900,0,1),z=Date.UTC(1900,2,1),V=["sun","mon","tue","wed","thu","fri","sat"],k=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],O=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],N=["January","February","March","April","May","June","July","August","September","October","November","December"];let H=function(t){return t>9?""+t:"0"+t},B={D:function(t,e){return""+t.getDate()},DD:function(t,e){return H(t.getDate())},DDD:function(t,e){return e[V[t.getDay()]]},D_:function(t,e){return e[k[t.getDay()]]},M:function(t,e){return""+(t.getMonth()+1)},MM:function(t,e){return H(t.getMonth()+1)},MMM:function(t,e){return e[O[t.getMonth()]]},M_:function(t,e){return e[N[t.getMonth()]]},YY:function(t,e){return(""+t.getFullYear()).slice(-2)},Y_:function(t,e){return""+t.getFullYear()},H:function(t,e){return""+t.getHours()},H_:function(t,e){return H(t.getHours())},h:function(t,e){let i=t.getHours()%12;return 0===i?"12":""+i},h_:function(t,e){let i=t.getHours()%12;return i=0===i?12:i,H(i)},m:function(t,e){return""+t.getMinutes()},m_:function(t,e){return H(t.getMinutes())},s:function(t,e){return""+t.getSeconds()},s_:function(t,e){return H(t.getSeconds())},S:function(t,e){return~~(t.getMilliseconds()/100)},SS:function(t,e){return H(~~(t.getMilliseconds()/10))},S_:function(t,e){return(i=t.getMilliseconds())>99?""+i:i>9?"0"+i:"00"+i;var i},A:function(t,e){return t.getHours()<12?e.AM:e.PM},a:function(t,e){return t.getHours()<12?e.am:e.pm}},G={_dateTimePattern:"M/D/YY h:mm A",_localeSetting:"en",_activeLocaleMap:null,_activeInput:null,setDateTimePattern:function(t){G._dateTimePattern=t||"M/D/YY h:mm A"},setLocale:function(t){let e=F.toLangString(t);G._localeSetting=_[e]?e:"en"},format:function(t,e,i){let n=null,o="",r=!(!i||"LOCAL"!==i.toUpperCase());if("number"==typeof t)t>1e8?n=new Date(t):(n=G.fromDateNumber(t),r=!0);else if(t instanceof Date)n=new Date(t);else{o=t+"";let e=o.match(/^\d{4}(-\d{2}(-\d{2}(T\d{2}\:\d{2}\:\d{2})?)?)?$/);o=o.replace(/\-/g,"/"),e&&(o=o.replace(/T/g," ")),n=new Date(o)}return G.isInvalidDate(n)?t||"":(r||n.setTime(n.getTime()+6e4*n.getTimezoneOffset()),G.formatDateObject(n,e))},formatDateObject:function(t,e){if(G.isInvalidDate(t))return"";e||(e=G._dateTimePattern),G._activeInput=t,G._activeLocaleMap=_[G._localeSetting]||DateTimeLocale.en;let i=e.replace(/D+|M+|Y+|H+|S+|A+|d+|m+|y+|h+|s+|a+|\[[^\]]*\]+/g,G._parseDatePattern);return G._activeInput=null,i},_lowerCaseDatePatterns:{d:!0,y:!0},_parseDatePattern:function(t){let e=t?t.charAt(0):"";if("["===e)return t.substring(1,t.length-1);let i=B[t];if(!i){let n=t;G._lowerCaseDatePatterns[e]&&(n=t.toUpperCase(),e=e.toUpperCase(),i=B[n]),i||(n=e+"_",i=B[n])}return i?i(G._activeInput,G._activeLocaleMap):t},isValidDate:function(t){if(t&&t.getTime){let e=t.getTime();return e==e}return!1},isInvalidDate:function(t){if(t&&t.getTime){let e=t.getTime();return e!=e}return!0},fromDateNumber:function(t){let e=G.dateNumberToMs(t);if(e==e){let i=G.timeNumberToMs(t);return new Date(e+i)}return new Date(NaN)},dateNumberToMs:function(t){if(!(t=Math.floor(+t))||t<=0||60===t)return NaN;let e=t-25569;return t<60&&e++,864e5*e},timeNumberToMs:function(t){"number"!=typeof t&&(t=+t);let e=t-Math.floor(t);return e?(e<0&&(e=-e),1e3*Math.round(86400*e)):0},toDateObject:function(t){let e=null;if(t instanceof Date)e=t;else if("number"==typeof t)e=t>3e9||t<=0?new Date(t):t>1e5?new Date(1e3*t):G.fromDateNumber(t);else if(t){let i=t+"",n=i.match(/^\d{4}(-\d{2}(-\d{2}(T\d{2}\:\d{2}\:\d{2})?)?)?$/);i=i.replace(/\-/g,"/"),n&&(i=i.replace(/T/g," ")),e=new Date(i)}else e=new Date(NaN);return e},toDateNumber:function(t){return G._millisecondToDateNumber(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()))},toTimeNumber:function(t){return Date.UTC(1970,0,1,t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds())/864e5},_millisecondToDateNumber:function(t){if((t=+t)!=t||t<P)return NaN;{let e=t/864e5+25569;return t<z&&e--,e}},toYYYYMMDD:function(t){let e=t?t.toJSON():"";return e?e.slice(0,10):""}};var W=G;let U={ISEMPTY:function(t){return t!=t||0===t||t?0:1},ISERR:function(t){return t!=t||null==t?1:0},ISNA:function(t){return""===t?1:0},ISNUMBER:function(t){return"number"==typeof t?1:0},ISSTRING:function(t){return"string"==typeof t?1:0},ISNASTRING:function(t){if(t){if(0===t.length)return 1;if(t.constructor===Object){for(let e in t)return 0;return 1}}else if(""===t)return 1;return 0}};var Y=U;let q={AND:function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;for(let e=t.length;--e>=0;)if(!t[e])return 0;return 1},FALSE:function(){return 0},IF:function(t,e,i){return t?e:i},NOT:function(t){return t?0:1},OR:function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;for(let e=t.length;--e>=0;)if(t[e])return 1;return 0},TRUE:function(){return 1}};var X=q;let j={};j.ABS=Math.abs,j.ACOS=Math.acos,j.ACOSH=function(t){return Math.log(t+Math.sqrt(t*t-1))},j.ASIN=Math.asin,j.ASINH=function(t){return t===-1/0?t:Math.log(t+Math.sqrt(t*t+1))},j.ATAN=Math.atan,j.ATAN2=function(t,e){return Math.atan2(e,t)},j.ATANH=function(t){return Math.log((1+t)/(1-t))/2},j.CEILING=function(t,e){return e||(e=1),t/=e,Math.ceil(t)*e},j.CEIL=j.CEILING,j.COMBIN=function(t,e){let i=j.FACT;return i(t)/(i(e)*i(t-e))},j.COS=Math.cos,j.COSH=function(t){let e=Math.exp(t);return(e+1/e)/2},j.DEGREES=function(t){return t/(Math.PI/180)},j.EVEN=function(t){return(t=Math.ceil(t))%2?t<0?t-1:t+1:t},j.EXP=Math.exp,j.FACT=function(t){if(t<0)return NaN;t=Math.floor(t);let e=1;for(;t>1;)e*=t,--t;return e},j.FACTDOUBLE=function(t){if(t<0)return NaN;t=Math.floor(t);let e=1;for(;t>1;)e*=t,t-=2;return e},j.FLOOR=function(t,e){return e||(e=1),t/=e,Math.floor(t)*e},j.GCD=function(t,e){if(t<0&&(t=-t),e<0&&(e=-e),e>t){let i=t;t=e,e=i}for(;0!=e;){if(0==(t%=e))return e;e%=t}return t},j.INT=Math.floor,j.LCM=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length,i=Math.abs(t[0]);for(let n=1;n<e;n++){let e=Math.abs(t[n]),o=i;for(;i&&e;)i>e?i%=e:e%=i;i=Math.abs(o*t[n])/(i+e)}return i},j.LN=Math.log,j.LOG=function(t,e){return null==e&&(e=10),Math.log(t)/Math.log(e)},j.LOG10=function(t){return Math.log(t)/Math.LN10},j.MOD=function(t,e){return t%e},j.ODD=function(t){return(t=Math.ceil(t))%2==0?t<0?t-1:t+1:t},j.POWER=Math.pow,j.PRODUCT=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t[0];if(null==e||e!=e)return NaN;for(let i=t.length;--i>=1;)e*=t[i];return e},j.PROD=j.PRODUCT,j.QUOTIENT=function(t,e){return Math.floor(t/e)},j.RADIANS=function(t){return t*(Math.PI/180)},j.RAND=Math.random,j.RANDBETWEEN=function(t,e){return Math.floor(Math.random()*(e-t+1))+t},j.ROUND=function(t,e){if(!e)return Math.round(t);let i=Math.pow(10,e);return Math.round(t*i)/i},j.ROUNDDOWN=function(t,e){if(!e)return Math.floor(t);let i=Math.pow(10,e);return Math.floor(t*i)/i},j.ROUNDUP=function(t,e){if(!e)return Math.ceil(t);let i=Math.pow(10,e);return Math.ceil(t*i)/i},j.SERIESSUM=function(t,e,i,n){let o=0;for(let r=n.length;--r>=0;)o+=n[r]*Math.pow(t,e+r*i);return o},j.SIGN=function(t){return t>0?1:t<0?-1:0},j.SIN=Math.sin,j.SINH=function(t){let e=Math.exp(t);return(e-1/e)/2},j.SQRT=Math.sqrt,j.SQRTPI=function(t){return Math.sqrt(t*Math.PI)},j.SUM=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let i=t.length;--i>=0;)e+=t[i];return e},j.SUMPRODUCT=function(){let t,e=arguments[0]instanceof Array?arguments[0]:arguments,i=e.length;if(0===i)return 0;let n=[];for(t=0;t<i;++t)n[t]=1;for(t=0;t<i;++t)n[t]*=e[t];let o=0;for(t=0;t<i;++t)o+=n[t];return o},j.SUMSQ=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let i=t.length;--i>=0;){let n=t[i];e+=n*n}return e},j.TAN=Math.tan,j.TANH=function(t){if(t===1/0)return 1;if(t===-1/0)return-1;let e=Math.exp(2*t);return(e-1)/(e+1)},j.TRUNC=function(t,e){if(!e)return Math.floor(t);let i=Math.pow(10,e);return Math.floor(t*i)/i};var K=j;let J={AVERAGE:function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length;if(e<=0)return NaN;let i=0;for(let n=e;--n>=0;)i+=t[n];return i/e}};J.AVG=J.AVERAGE,J.COUNT=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let i=t.length;--i>=0;){let n=t[i];null!=n&&n==n&&++e}return e},J.MAX=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;if(t.length<=0)return NaN;let e=t[0];for(let i=t.length;--i>=1;)t[i]>e&&(e=t[i]);return e},J.MIN=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;if(t.length<=0)return NaN;let e=t[0];for(let i=t.length;--i>=1;)t[i]<e&&(e=t[i]);return e},J.STDEV=function(){let t=arguments[0]instanceof Array?arguments[0]:Array.prototype.slice.call(arguments),e=t.length;if(e<=0)return NaN;if(1===e)return 0;let i=J.AVERAGE(t),n=0;for(let o=e;--o>=0;){let e=t[o]-i;n+=e*e}return Math.sqrt(n/(e-1))},J.STDEVP=function(){let t=arguments[0]instanceof Array?arguments[0]:Array.prototype.slice.call(arguments),e=t.length;if(e<=0)return NaN;if(1===e)return 0;let i=J.AVERAGE(t),n=0;for(let o=e;--o>=0;){let e=t[o]-i;n+=e*e}return Math.sqrt(n/e)};var Q=J;let Z={},$=function(t){return t||0===t?t+"":""};Z.EXACT=function(t,e){return(t+="")===(e+="")?1:0},Z.FIND=function(t,e,i){if(!(t=$(t)))return 0;if(!(e=$(e)))return 0;return(!(i=+i)||i<0)&&(i=0),e.indexOf(t,i)},Z.LEFT=function(t,e){return(e=+e)||(e=0),e<0&&(e=1),$(t).substr(0,e)},Z.LENGTH=function(t){return $(t).length},Z.LEN=Z.LENGTH,Z.LOWER=function(t){return $(t).toLowerCase()},Z.MID=function(t,e,i){return $(t).substr(e,i)},Z.REPLACE=function(t,e,i,n){n+="";let o=(t=$(t)).split("");return o.splice(i,e,n),o.join("")},Z.RIGHT=function(t,e){(e=+e)||(e=0),e<0&&(e=1);let i=(t=$(t)).length-e;return t.substr(i,e)},Z.TRIM=function(t){return $(t).trim()},Z.UPPER=function(t){return $(t).toUpperCase()},Z.VALUE=function(t){return+t},Z.CHAR=function(t){let e=+t;return String.fromCharCode(e)},Z.CLEAN=function(t){let e=$(t).split("");for(let t=e.length;--t>=0;){let i=e[t].charCodeAt(0);(i<32||i>127)&&(e[t]="")}return e.join("")},Z.CODE=function(t){return $(t).charCodeAt(0)},Z.PROPER=function(t){let e=(t=$(t)).split(/[\W_]/g),i=t.match(/[\W_]/g),n=e.length,o="";for(let t=0;t<n;t++){let n=e[t],r=n.length;1===r?o+=n.toUpperCase():0!==r&&(o+=n.charAt(0).toUpperCase()+n.substr(1).toLowerCase());let s=i[t];s&&(o+=s)}return o},Z.REPEAT=function(t,e){if(!(e=+e)||e<0)return"";if(""===(t=$(t)))return"";let i=t;for(let n=1;n<e;n++)i+=t;return i},Z.STRING=function(t,e){return(t=+t)?(!(e=+e)||e<0?e=0:e>9&&(e=9),t.toFixed(e)):""};var tt=Z;let et=function(){this._context={},et._addContext(this._context,et.getContext()),this._context._DATA=this._getData.bind(this),this._setData=this._defaultFormulaDataSetter.bind(this),this._formulas=[],this._formulaMap={},this._referenceMap={}};l.inherits(et,u),et.prototype._context=null,et.prototype._rowData=null,et.prototype._setData=null,et.prototype._formulas=null,et.prototype._formulaMap=null,et.prototype._referenceMap=null,et._context=null,et.getContext=function(){let t=et._context;return t||(t={},et._context=t,et._addContext(t,W),et._addContext(t,Y),et._addContext(t,X),et._addContext(t,K),et._addContext(t,Q),et._addContext(t,tt)),t},et.addContext=function(t){let e=et.getContext();et._addContext(e,t)},et._addContext=function(t,e){for(let i in e)t[i]=e[i]},et.prototype.setFormulaDataGetter=function(t){"function"==typeof t&&(this._context._DATA=t)},et.prototype.setFormulaDataSetter=function(t){"function"==typeof t&&(this._setData=t)},et.prototype._defaultFormulaDataSetter=function(t,e,i,n){if("..."!==e){let o=t.getAlias();i[o]=e,n&&(n[o]=e)}},et.prototype.addFormula=function(t){let e;return t instanceof c?e=t:(this._rowData={},e=new c(t,this._context),this._rowData=null),e.addEventListener("dataCacheChanged",this._dispatch.bind(this,"dataChanged")),e.addEventListener("dataRequired",this._dispatch.bind(this,"dataRequired")),e.addEventListener("formulaChanged",this._dispatch.bind(this,"formulaChanged")),this._formulas.push(e),e},et.prototype.mockFormula=function(t){let e;return e=new c(t instanceof c?t.getInput():t,this._context),e},et.prototype.removeFormula=function(t){let e;if(t instanceof c&&(t=this._formulas.indexOf(t)),"number"==typeof t)e=this._formulas[t],e&&(this._formulas.splice(t,1),e.getReference()&&(delete this._formulaMap[e.getReference()],delete this._referenceMap[e.getReference()]),e.dispose());else if("string"==typeof t&&(e=this._formulaMap[t],e)){let i=this._formulas.indexOf(e);i>=0&&(this._formulas.splice(i,1),delete this._formulaMap[t],delete this._referenceMap[t]),e.dispose()}return e||null},et.prototype.removeAllFormulas=function(){let t=this._formulas;for(let e=t.length;--e>=0;)delete this._referenceMap[t[e].getReference()];this._formulas.length=0,this._formulaMap={}},et.prototype.getFormula=function(t){let e;return e="number"==typeof t?this._formulas[t]:this._formulaMap[t],e||null},et.prototype.getFormulaByExpression=function(t){let e=this._formulas.length;for(let i=0;i<e;++i){let e=this._formulas[i];if(e.getInput()===t)return e}return null},et.prototype.getAllFormulas=function(){return this._formulas},et.prototype.getAllFormulaReferences=function(){return this._referenceMap},et.prototype.getFormulaCount=function(){return this._formulas.length},et.prototype._generateUniqueReference=function(t){let e=t,i=0;for(;null!=this._referenceMap[e];)e=t+"_"+ ++i;return e},et.prototype.addReference=function(t,e){if(!t||!e)return"";e=this._generateUniqueReference(e);let i="";if(t instanceof c){if(!this._setFormulaReference(t,e))return"";i=t.getAlias()}else i=t;return this._referenceMap[e]=i,e},et.prototype.renameReference=function(t,e){if(!e)return this.removeReference(t);if(!t||null==this._referenceMap[t]||t===e)return!1;let i=this._formulaMap[t];if(i&&!this.isValidReference(i,e))return!1;for(let i=this._formulas.length;--i>=0;){let n=this._formulas[i];if(n.changeField(t,e)){let t=n.getReference();t&&(this._referenceMap[t]=n.getAlias())}}return i&&this._setFormulaReference(i,e),this._referenceMap[e]=this._referenceMap[t],delete this._referenceMap[t],!0},et.prototype.removeReference=function(t){if(!t||null==this._referenceMap[t])return!1;let e=this._formulaMap[t];return null!=e&&(e._setReference(""),delete this._formulaMap[t]),delete this._referenceMap[t],!0},et.prototype.resolveReference=function(t){return this._referenceMap[t]||t},et.prototype._getData=function(t,e){if(!this._rowData)return null;let i=this._rowData[this.resolveReference(t)];if(i){let t=Number(i);t==t&&(i=t)}return i},et.prototype._setFormulaReference=function(t,e){if(this._formulaMap[e])return console.warn("Duplicate formula reference detected."),!1;let i=t.getReference();if(i===e)return!1;e&&(this._formulaMap[e]=t),t._setReference(e);let n=this._sortDependencies(this._formulas,this._formulaMap);return n?(this._formulas=n,delete this._formulaMap[i],!0):(t._setReference(i),delete this._formulaMap[e],!1)},et.prototype.calculate=function(t,e){this._rowData=t;let i=this._formulas.length;for(let n=0;n<i;++n){let i=this._formulas[n];if(e){let t=null!=e[i.getAlias()];if(!t){let n=i.getFieldNames();for(let i=n.length;--i>=0;)if(null!=e[this.resolveReference(n[i])]){t=!0;break}if(!t)continue}}let o=i.calculate(t);this._setData(i,o,t,e)}this._rowData=null},et.prototype.isValidReference=function(t,e){if(!e)return!0;if(this._referenceMap[e])return!1;let i=t.getReference(),n=this._createParentChildrenMap(this._formulas);if(i){delete n[i];for(let t in n){let o=n[t],r=o.indexOf(i);-1!==r&&(o=o.slice(0),o.splice(r,1),r=o.indexOf(e),-1===r&&o.push(e),n[t]=o)}}return n[e]=t.getFieldNames(),!!this._sortParentChildrenMap(n)},et.prototype._sortDependencies=function(t,e){if(1===t.length)return t;let i=this._createParentChildrenMap(t),n=this._sortParentChildrenMap(i);if(!n)return null;let o=t.filter((function(t){return!t.getReference()})),r=[];if(e){for(let t=n.length;--t>=0;){let i=e[n[t]];i&&r.push(i)}o.length>0&&(r=r.concat(o))}return r},et.prototype._createParentChildrenMap=function(t){let e,i={};for(e=t.length;--e>=0;){let n=t[e],o=n.getReference();o&&(i[o]=n.getFieldNames())}return i},et.prototype._sortParentChildrenMap=function(t){let e,i,n,o,r,s={};for(r in t){n=t[r],o=n.length;for(let t=0;t<o;++t)i=n[t],s[i]=s[i]+1||1}let l=[];for(r in t)s[r]||l.push(r);let a=[];for(;l.length>0;)for(r=l.shift(),a.push(r),n=t[r],o=n?n.length:0,e=0;e<o;++e)i=n[e],--s[i]>0||l.push(i);for(i in s)if(s[i])return null;return a},et._proto=et.prototype;let it={};it.isIE=function(){let t=window.navigator.userAgent;return t.indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0}(),it.isTouchDevice=!!(navigator.maxTouchPoints&&navigator.maxTouchPoints<256||navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints<256),it.isSafari=function(){let t=navigator.userAgent;return!/Chrome|Android|CriOS|FxiOS|EdgiOS/i.test(t)&&/Safari/i.test(t)}(),it.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),it.getElement=function(t){return it.isElement(t)?t:t&&it.isFunction(t.getElement)?t.getElement():null},it.isElement=function(t){return!!t&&1===t.nodeType},it.isEmpty=function(t,e){return null==t||void 0===t||!e&&""===t||it.isArray(t)&&0===t.length},it.isNumber=function(t){return"number"==typeof t&&isFinite(t)},it.isString=function(t){return"string"==typeof t},it.isArray=Array.isArray,it.isFunction=function(t){return"function"==typeof t},it.getClientPosition=function(t,e){let i=e||{};if(t.getBoundingClientRect){let e=t.getBoundingClientRect();i.x=e.left,i.y=e.top}else i.x=t.clientX,i.y=t.clientY;return i},it.getRelativePosition=function(t,e,i){i=it.getClientPosition(t,i);let n=it.getClientPosition(e);return i.x-=n.x,i.y-=n.y,i},it.moveArrayItem=function(t,e,i){if(!t)return null;let n=t.length;if(e>=n&&i>=n)return t;let o=t.splice(e,1)[0];return i<n?t.splice(i,0,o):t[i]=o,t},it.pushArrayItems=function(t,e){let i=e?e.length:0;if(i>0)if(i<1e5)i>1?Array.prototype.push.apply(t,e):t.push(e[0]);else{let n=0,o=0;for(;n<i;)o+=1e5,Array.prototype.push.apply(t,e.slice(n,o)),n=o}return t},it.insertEmptyItems=function(t,e,i){if(i>0)if(i>1){let n=t.slice(e);t.length=e,t.length+=i,it.pushArrayItems(t,n)}else t.splice(e,0,null)},it.cycleArray=function(t,e){if(e>0&&t&&e<t.length){let i=t.splice(0,e);return t.concat(i)}return t||null},it.lowerBound=function(t,e,i,n,o){(null==i||i<0)&&(i=0),(null==n||n<0||n>t.length)&&(n=t.length),i>n&&(i=n),null==o&&(o=it._defaultLessComparator);let r=0;for(;n>i;)r=i+n>>1,o(t[r],e)?i=r+1:n=r;return i},it.upperBound=function(t,e,i,n,o){let r=it.lowerBound(t,e,i,n,o);for(;t[r]===e;)++r;return r},it.stringFormat=function(t){let e=Array.prototype.slice.call(arguments,1);return t.replace(/{(\d+)}/g,(function(t,i){return null!=e[i]?e[i]:t}))},it._defaultLessComparator=function(t,e){return t<e},it._deprecatedFunction=function(){console.warn("Calling deprecated method")},it.calculatePercent=function(t,e,i){if(!t&&0!==t||!e&&0!==e||!i&&0!==i)return NaN;if(i===t)return 50;let n=(e-t)/(i-t);return n<0?0:n>1?100:100*n},it.closestElement=function(t,e){let i=t;for(;i;){if(i.classList&&i.classList.contains(e))return i;i=i.parentNode||i.host}return null},it._preventDefault=function(t){t.preventDefault(),t.stopPropagation()};var nt=it;let ot=function(t){this.dispatch=this.dispatch.bind(this),this._listeners=[],this.setSender(t)};ot.prototype.listen=function(t,e){if(t&&nt.isFunction(t)&&this._listeners.indexOf(t)<0)if(null==e)this._listeners.push(t);else{t._priority=e;let i=nt.lowerBound(this._listeners,t,0,this._listeners.length,ot.listenerComparer);this._listeners.splice(i,0,t)}},ot.prototype.unlisten=function(t){if(t){let e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}},ot.prototype.unlistenAll=function(){this._listeners.length=0},ot.prototype.getListenerCount=function(){return this._listeners.length},ot.prototype.hasListener=function(){return this._listeners.length>0},ot.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(let e=0;e<this._listeners.length;e++)this._listeners[e](t);null!==this._sender&&(t.sender=null),this._dispatching=!1}},ot.prototype.isDispatching=function(){return this._dispatching},ot.prototype.isEnabled=function(){return this._enabled},ot.prototype.enable=function(t){this._enabled=!1!==t},ot.prototype.disable=function(t){this._enabled=!1===t},ot.prototype.setSender=function(t){this._sender=t||null},ot.prototype.setEventArgExtender=function(t){this._extender=null!=t?t:null},ot.listenerComparer=function(t,e){return null==e._priority||t._priority>=e._priority},ot.prototype._listeners=null,ot.prototype._sender=null,ot.prototype._extender=null,ot.prototype._enabled=!0,ot.prototype._dispatching=!1,ot._proto=ot.prototype;var rt=ot;let st=function(){};st.prototype._customEvents=null,st.prototype.listen=function(t,e,i){this._customEvents&&this._customEvents[t]&&this._customEvents[t].listen(e,i)},st.prototype.unlisten=function(t,e){this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlisten(e)},st.prototype.unlistenAll=function(t){if(t)this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(let t in this._customEvents)this._customEvents[t].unlistenAll()},st.prototype._addEvent=function(t){if(!t)return;this._customEvents||(this._customEvents={}),this._customEvents[t]||(this._customEvents[t]=new rt(this))},st.prototype._addEvents=function(t){let e=Array.isArray(t)?t:arguments,i=e.length;for(let t=0;t<i;++t)this._addEvent(e[t])},st.prototype._isEventDispatching=function(t){let e=this._customEvents[t];return!!e&&e.isDispatching()},st.prototype._disableEvent=function(t,e){let i=this._customEvents[t];i&&i.disable(e)},st.prototype._hasListener=function(t){return!(!this._customEvents||!this._customEvents[t])&&this._customEvents[t].hasListener()},st.prototype._dispatch=function(t,e){this._customEvents[t].dispatch(e)},st._proto=st.prototype;var lt=st;let at=function(){let t=this;t._rows={},t._subs={},t._onInsert=t._onInsert.bind(t),t._onUpdate=t._onUpdate.bind(t),t._onDelete=t._onDelete.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")};l.inherits(at,lt),at.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._quotes2=null},at.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))},at.prototype.getSubscriptions=function(){return this._quotes2},at.prototype.addSubscription=function(t,e,i){if(this.getSubscription(t.id))return;let n={s:t,rics:{}};this._subs[t.id]=n,this._quotes2||(t.onNewRow(this._onInsert),t.onUpdate(this._onUpdate),t.onRemoveRow(this._onDelete)),e&&(n.primary=e,i||(i={}),this._onInsert(t,e,i))},at.prototype.removeSubscription=function(t){let e=t.id;if(!t||!this._subs[e])return;this._quotes2||t.stop();let i=this._subs[e].rics;for(let t in i)this.setRowData(e+t,null);delete this._subs[e]},at.prototype.startAllSubscriptions=function(){if(this._quotes2)this._quotes2.start();else for(let t in this._subs)this._subs[t].s.start()},at.prototype.stopAllSubscriptions=function(){if(this._quotes2)this._quotes2.stop();else for(let t in this._subs)this._subs[t].s.stop()},at.prototype.getSubscription=function(t){return this._subs[t]?this._subs[t].s:null},at.prototype.getPrimaryRic=function(t){let e=this._subs[t];return e?e.primary:""},at.prototype.clearAllData=function(t){this._quotes2?this._quotes2.removeAllSubscriptions():this.stopAllSubscriptions(),this._subs={},this._rows={},t||this._dispatchDataChange({globalChange:!0})},at.prototype.clearColumnData=function(t,e){let i="string"==typeof t?[t]:t;for(let t=i.length;--t>=0;){let e=i[t];if(e)for(let t in this._rows)delete this._rows[t][e]}e||this._dispatchDataChange({globalChange:!0})},at.prototype.getData=function(t,e){let i=this.getRowData(t);return i?i[e]:null},at.prototype.getAllRics=function(){let t={};for(let e in this._subs){let i=this._subs[e].rics;for(let n in i)t[n]||(t[n]=[]),t[n].push(e)}return t},at.prototype.getAllRowIds=function(){let t=[];for(let e in this._rows)t.push(e);return t},at.prototype.hasRowId=function(t){return!!this._rows[t]},at.prototype.getColumnData=function(t){let e=[];for(let i in this._rows)e.push(this._rows[i][t]);return e},at.prototype.getRowData=function(t){return this._rows[t]||null},at.prototype.getMultipleRowData=function(t,e,i){let n=t.length;null==i&&(i=n),i>n&&(i=n),e>0||(e=0);let o=new Array(n),r=this._rows;for(let n=e;n<i;++n)o[n]=r[t[n]]||null;return o},at.prototype.getAllRowData=function(){let t=[],e=this._rows;for(let i in e)t.push(e[i]);return t},at.prototype.setData=function(t,e,i){let n={};return n[e]=i,this.setRowData(t,n)},at.prototype.hasDataCloudData=function(t){},at.prototype.setRowData=function(t,e,i){let n=this.getRowData(t),o=!1,r=null;if(e)if(n){for(let t in e)n[t]=e[t],o=!0;r=e}else n=e,this._rows[t]=n,o=!0;else n&&(delete this._rows[t],o=!0);if(o&&!this._composing){let e=i||{};e.rid=t,r&&(e.changes=r),e.rowData=n,this._dispatchDataChange(e)}return o},at.prototype.cloneRowData=function(t){let e=this._rows[t];if(!e)return null;let i={};for(let t in e)0!==t.indexOf("FREE_TEXT")&&(i[t]=e[t]);return i},at.prototype.addStaticFields=function(){},at.prototype.removeStaticFields=function(){},at.prototype.resetStaticFields=function(){},at.prototype.getStaticFields=function(){},at.prototype.dump=function(t){return at.constructTable(this.getAllRowData(),t,Object.keys(this._rows))},at.prototype.log=function(t){console.table(this.dump(t))},at.prototype.setDataCloudSettings=function(t,e,i,n){},at.prototype.getDataCloudFields=function(){},at.prototype.addDataCloudFields=function(t){},at.prototype.removeDataCloudField=function(t){},at.prototype._dispatchDataChange=function(t){this._composing||(this._composing=!0,this._dispatch("dataComposed",t),this._composing=!1,this._dispatch("dataChanged",t))},at._defaultPropertyGetter=function(t,e,i){let n=e[i];return n?n[t]:null},at._defaultGetter=function(t,e){return t[e]},at.constructTable=function(t,e,i){let n=0,o=t.length,r=o,s=null,l=i||null,a=at._defaultGetter,u=!1;if(e){if(e.rowCount&&(r=e.rowCount,u=!0),e.colNames){s={};let t=e.colNames.length;for(let i=0;i<t;++i)s[e.colNames[i]]=!0;u=!0}e.getter&&(a="string"==typeof e.getter?at._defaultPropertyGetter.bind(null,e.getter):e.getter,u=!0),e.startIndex&&(n=e.startIndex,u=!0),!1===e.withRowIds&&(l=null)}if(!u&&!l)return t;let h=[];for(let e=n;e<o&&!(h.length>=r);++e){let i=t[e],n=l?{rid:l[e]}:{};if(i){let t;if(s)for(t in s)null!=i[t]&&(n[t]=a(i,t));else for(t in i)n[t]=a(i,t)}h.push(n)}return h},at.prototype._insertRic=function(t,e,i){let n=t+(e=e.replace("0#","")),o=this.getRowData(n);if(o){let e=o.ROW_DEF;e&&e.isChain()&&(i.SUB_ID=t)}else{let n=i;i={};for(let t in n)i[t]=n[t];i.SUB_ID=t,i.RIC=e}this.setRowData(n,i)},at.prototype._onQ2DataChanged=function(t){let e=t.subId,i=t.ric,n=t.values;n?this._insertRic(e,i,n):(delete this._subs[e].rics[i],this.setRowData(e+i,null))},at.prototype._onQ2SubAdded=function(t){let e=t.subs,i=e.length;for(let t=0;t<i;++t){let i=e[t];i.id.indexOf("_ci_")<0&&this.addSubscription(i,i.ric)}},at.prototype._onQ2SubRemoved=function(t){let e=t.subs,i=e.length;for(let t=0;t<i;++t){let i=e[t];i.id.indexOf("_ci_")<0&&this.removeSubscription(i)}},at.prototype._onInsert=function(t,e,i){let n=t.id;this._quotes2?this._insertRic(n,e,i):this.setRowData(n+e,i,{subscription:t,ric:e})},at.prototype._onUpdate=at.prototype._onInsert,at.prototype._onDelete=function(t,e,i){delete this._subs[t.id].rics[e],this.setRowData(t.id+e,null,{subscription:t,ric:e})},at.prototype._rows,at.prototype._subs,at.prototype._quotes2=null,at.prototype._composing=!1,at._proto=at.prototype;var ut=at;let ht=function(t,e){this._rid=t,this._children={},this._shared=e};l.inherits(ht,u),ht._subSegSortLogic=function(t,e){return"Uncategorized"===t?1:"Uncategorized"===e||t<e?-1:e<t?1:0},ht._assignSubSegmentOrder=function(t,e){t.setOrder(e+1)},ht.prototype._shared=null,ht.prototype._rid,ht.prototype._children,ht.prototype._childCount=0,ht.prototype._collapsed=!1,ht.prototype._order=0,ht.prototype._disposed=!1,ht.prototype._subSegDef=null,ht.prototype._subSegLevel=0,ht.prototype._subSegMap=null,ht.prototype._subSegNames=null,ht.prototype._subSegName="",ht.prototype._subSegVal,ht.prototype._subSegParent=null,ht.prototype.dispose=function(){if(this._disposed)return;this._disposed=!0,this.removeAllEventListeners();let t=this._subSegNames;if(t){let e=t.length,i=this._subSegMap;for(let n=0;n<e;++n)i[t[n]].dispose();this._subSegMap=this._subSegNames=null}this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._shared=null,this._subSegParent=this._subSegDef=this._subSegVal=null},ht.prototype.getId=function(){return this._rid},ht.prototype.getParentId=function(){return this._subSegParent?this._subSegParent.getId():""},ht.prototype.getSubSegmentIds=function(t){let e=this._subSegNames;if(e){t||(t=[]);let i=e.length,n=this._subSegMap;for(let o=0;o<i;++o){let i=n[e[o]];t.push(i.getId()),i.getSubSegmentIds(t)}return t}return null},ht.prototype.addChild=function(t,e){if(t){if(this._shared.childToSegment[t]=this._rid,!this._children[t])return this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._children[t]=e||t,++this._childCount,!0;this._children[t]=e||t}return!1},ht.prototype.addChildren=function(t,e){let i,n=Array.isArray(t)?t:[t],o=n.length,r=0;if(null!=e)for(e=Array.isArray(e)?e:[e],i=0;i<o;++i)r|=this.addChild(n[i],e[i]);else for(i=0;i<o;++i)r|=this.addChild(n[i]);return!!r},ht.prototype.containsChild=function(t){return!!this._children[t]},ht.prototype.removeChild=function(t){if(this._subSegLevel)return!1;if(!this._childCount)return!1;if(!this._children[t])return!1;return delete this._shared.childToSegment[t],delete this._children[t],--this._childCount,this._collapsed&&(this._shared.dirtyCollapsingState=!0),!0},ht.prototype.removeChildren=function(t){if(this._subSegLevel)return!1;if(!this._childCount)return!1;let e=Array.isArray(t)?t:[t],i=e.length,n=0;for(let t=0;t<i;++t)n|=this.removeChild(e[t]);return!!n},ht.prototype.removeAllChildren=function(){if(this._subSegLevel)return!1;if(!this._childCount)return!1;let t=this._shared.childToSegment,e=this._children;for(let i in e)t[i]&&delete t[i];return this._children={},this._childCount=0,this._collapsed&&(this._shared.dirtyCollapsingState=!0),!0},ht.prototype.getChildIds=function(){return this._childCount?Object.keys(this._children):[]},ht.prototype.getChildren=function(){return this._children},ht.prototype.getChildCount=function(){return this._childCount},ht.prototype.getClassification=function(){return this._subSegDef&&this._subSegDef.classifiers||null},ht.prototype.setClassification=function(t){if(this._subSegLevel)return!1;let e=null;this._subSegDef&&(e=this._subSegDef.classifiers);let i,n=null;t&&("string"==typeof t?n=[t]:Array.isArray(t)&&(n=t));let o=n?n.length:0;if(o){if((e?e.length:0)===o){for(i=0;i<o&&n[i]===e[i];++i);if(i>=o)return!1}return this._subSegDef||(this._subSegDef={root:this,subSegments:null}),this._subSegDef.classifiers=n,!0}return!!e&&(this._subSegDef.classifiers=null,this._subSegDef.subSegments=null,this._subSegDef=null,!0)},ht.prototype.classify=function(t){let e=this._subSegDef?this._subSegDef.classifiers:null,i=e?e.length:0,n=this._subSegNames,o=n?n.length:0;if(!o&&this._subSegLevel>=i)return!1;let r,s=this._shared;this._collapsed&&(s.dirtyCollapsingState=!0);let l="",a={},u=0,h=this._subSegMap,p=null;if(o)for(u=o,r=0;r<u;++r)l=n[r],a[l]=1,p=h[l],p._childCount&&(p._children={},p._childCount=0),p._collapsed&&(s.dirtyCollapsingState=!0);let d,c=!this._subSegLevel,_=this._children;if(this._subSegLevel<i&&t){h||(h=this._subSegMap={},n=this._subSegNames=[]);let i=e[this._subSegLevel];for(d in _){let e=_[d],o=t[e],r=o?o[i]:null;s.childToSegment[d]=this._rid,l="Uncategorized",(r||0===r||!1===r)&&(l=r+""),a[l]&&(a[l]=0,--u),p=h[l],p||(p=new ht(this._rid+"/"+l,s),p._subSegDef=this._subSegDef,p._subSegLevel=this._subSegLevel+1,p._subSegName=l,p._subSegVal=r,p._subSegParent=this,h[l]=p,n.push(l),this._dispatch("subSegmentAdded",{rid:p.getId(),segment:p})),p.addChild(d,e)}}else if(c)for(d in _)s.childToSegment[d]=this._rid;if(u>0){for(l in u>=n.length&&(n.length=0),a)if(a[l]){p=h[l],delete h[l];let t=n.indexOf(l);t>=0&&n.splice(t,1),this._dispatch("subSegmentRemoved",{rid:p.getId(),segment:p})}n.length||(n=this._subSegMap=this._subSegNames=null)}if(o=n?n.length:0,o)for(n.sort(ht._subSegSortLogic),r=0;r<o;++r)p=h[n[r]],p.classify(t);if(c&&this._subSegDef)if(o){let t=this._subSegDef.subSegments=[];this.getAllSubSegments(t),t.forEach(ht._assignSubSegmentOrder)}else this._subSegDef.subSegments=null;return!0},ht.prototype.hasSubSegments=function(){return!!this._subSegNames&&!!this._subSegNames.length},ht.prototype.isSubSegment=function(){return!!this._subSegLevel},ht.prototype.getFirstAncestor=function(){if(this._subSegLevel&&this._subSegDef){return this._subSegDef.root||null}return null},ht.prototype.getAllSubSegments=function(t){let e=this._subSegNames;if(e){t||(t=[]);let i=this._subSegMap,n=e.length;for(let o=0;o<n;++o){let n=i[e[o]];t.push(n),n.getAllSubSegments(t)}}return t||null},ht.prototype.getSegmentLevel=function(){return this._subSegLevel},ht.prototype.setRowData=function(t,e){if(!t)return;let i=t[this._rid];i||(i=t[this._rid]={}),e||(e=t),i=e[this._rid],i||(i=e[this._rid]={});let n=this;for(;n&&n.isSubSegment();)n.getSubSegmentName(i),n=n._subSegParent},ht.prototype.getSubSegmentName=function(t){if(t&&this._subSegLevel){let e=this.getClassification()[this._subSegLevel-1];e&&(t[e]=this._subSegName)}return this._subSegName},ht.prototype.collapse=function(t){return t=!1!==t,this._collapsed!==t&&(this._collapsed=t,this._shared.dirtyCollapsingState=!0,!0)},ht.prototype.expand=function(t){return this.collapse(!1===t)},ht.prototype.isCollapsed=function(){return this._collapsed},ht.prototype.getCollapsingStates=function(t,e){let i=this._subSegNames;if(!this._subSegLevel&&!i&&!this._collapsed)return!1;t||(t={});let n=!1;if(this._subSegLevel&&e&&(t[this._rid]=!0,n=!0),this._childCount){let o=e||this._collapsed;if(i){let r=this._subSegMap,s=i.length;for(let l=0;l<s;++l){let s=r[i[l]];t[s.getId()]=!!e,s.getCollapsingStates(t,o)&&(n=!0)}}else if(o){let e=this._children;for(let i in e)t[i]=o;n=!0}}return n},ht.prototype.getOrder=function(){if(this._subSegLevel){let t=this.getFirstAncestor();if(t)return t.getOrder()+this._order}return 1e4*this._order},ht.prototype.getLastOrder=function(){if(this._subSegDef){let t=this._subSegDef.subSegments;if(t){let e=t[t.length-1];if(e)return e.getOrder()}}return this.getOrder()},ht.prototype.setOrder=function(t){this._order=t},ht._tabs=null,ht.prototype.log=function(t){let e,i=ht._tabs;if(!i){i=ht._tabs=[];let t="";for(e=0;e<11;++e)i[e]=t,t+=" "}let n=this._collapsed?"+ ":"- ";t.push(i[this._subSegLevel]+n+this._rid);let o=this._subSegNames;if(o){let i=o.length,n=this._subSegMap;for(e=0;e<i;++e)n[o[e]].log(t)}else if(this._childCount){let e=i[this._subSegLevel+1];for(let i in this._children)t.push(e+"- "+i)}return t};var pt=ht;let dt=function(){this._onSubSegmentAdded=this._onSubSegmentAdded.bind(this),this._onSubSegmentRemoved=this._onSubSegmentRemoved.bind(this),this._segments={},this._insertionList=[],this._removalList=[],this._shared={childToSegment:{},dirtyCollapsingState:!1}};l.inherits(dt,u),dt.prototype._segments,dt.prototype._segmentCount=0,dt.prototype._collapsedRids=null,dt.prototype._shared,dt.prototype._segmentList=null,dt.prototype._insertionList=null,dt.prototype._removalList=null,dt.prototype._classification=!1,dt.prototype._classifierChanged=!1,dt.prototype.dispose=function(){this.removeAllSegments(),this.removeAllEventListeners(),this._collapsedRids=null,this._segmentList=this._insertionList=this._removalList=null},dt.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;let i=this._segments[t]=new pt(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},dt.prototype.addSegments=function(t){let e=Array.isArray(t)?t:[t],i=e.length,n=0;for(let t=0;t<i;++t)n|=this.addSegment(e[t]);return!!n},dt.prototype.containsSegment=function(t){return!!this._segments[t]},dt.prototype.getParentRowId=function(t){return this._shared.childToSegment[t]||""},dt.prototype.removeSegment=function(t){let e=this._segments[t];if(e){if(this._segmentCount<=1)return this.removeAllSegments();e.isSubSegment()&&this._removalList.push(e.getId());let i=e.getSubSegmentIds();if(i){let t=i.length;for(let e=0;e<t;++e){let t=i[e];this._segments[t]&&(this._removalList.push(t),delete this._segments[t],--this._segmentCount)}}return e.removeAllChildren(),e.dispose(),delete this._segments[t],--this._segmentCount,!0}return!1},dt.prototype.removeAllSegments=function(){if(this._segmentCount){for(let 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},dt.prototype.getSegmentCount=function(){return this._segmentCount},dt.prototype.getSegment=function(t){return this._segments[t]||null},dt.prototype.getSegmentParent=function(t){let e=this.getParentRowId(t);return e?this.getSegment(e):null},dt.prototype.getSegments=function(){return this._segmentCount?this._segments:null},dt.prototype.getSegmentIds=function(){return Object.keys(this._segments)},dt.prototype.collapseSegment=function(t,e){let i=this._segments[t];return!!i&&i.collapse(e)},dt.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},dt.prototype.expandAllSegments=function(){if(this._segmentCount){let t=this._segments,e=0;for(let i in t)e|=t[i].expand();if(e)return!0}return!1},dt.prototype.isCollapsedSegment=function(t){let e=this._segments[t];return!!e&&e.isCollapsed()},dt.prototype.getCollapsedRows=function(){if(this._shared.dirtyCollapsingState){this._shared.dirtyCollapsingState=!1;let t=null,e=0;if(this._segmentCount){let i=this._segments;t={};for(let n in i){let o=i[n];o.isSubSegment()||o.getCollapsingStates(t)&&++e}}this._collapsedRids=e?t:null}return this._collapsedRids},dt.prototype.addSegmentChild=function(t,e,i){let n=this._segments[t];return!(!n||n.isSubSegment())&&n.addChild(e,i)},dt.prototype.addSegmentChildren=function(t,e,i){let n=this._segments[t];return!(!n||n.isSubSegment())&&n.addChildren(e,i)},dt.prototype.containsSegmentChild=function(t,e){let i=this._segments[t];return!!i&&i.containsChild(e)},dt.prototype.removeSegmentChild=function(t,e){let i=this._segments[t];return!!i&&i.removeChild(e)},dt.prototype.removeSegmentChildren=function(t,e){let i=this._segments[t];return!!i&&i.removeChildren(e)},dt.prototype.removeAllSegmentChildren=function(){this._shared.childToSegment={};let t=this._segments,e=!1;for(let i in t){t[i].removeAllChildren()&&(e=!0)}return e&&this.classify(null),e},dt.prototype.fillSegment=function(t,e){let i=Array.isArray(e)?e.length:0;if(!i)return;let n=this._segments,o=n[t];if(o&&!o.isSubSegment()){let r=e.indexOf(t);if(r>=0){o.removeAllChildren();for(let t=r+1;t<i;++t){let i=e[t];if(n[i])break;o.addChild(i)}}}},dt.prototype.fillSegments=function(t){this._shared.childToSegment={};let e=Array.isArray(t)?t.length:0,i=this._segments,n=null,o=!1;for(let r=0;r<e;++r){let e=t[r],s=i[e];s&&!s.isSubSegment()?(n=s,n.removeAllChildren()):n&&!n.isSubSegment()&&(n.addChild(e),o=!0)}return o},dt.prototype.calcSegmentOrder=function(t){let e=this._segmentList;e?e.length=0:e=this._segmentList=[];let i=t?t.length:0,n=this._segments,o=this._segmentCount,r=0;for(let e=0;e<i;++e){let i=n[t[e]];if(i&&(i.isSubSegment()||(this._segmentList.push(i),i.setOrder(++r)),--o<=0))break}},dt.prototype.getSegmentValues=function(t,e){let i=t?t.length:0;if(!i)return null;let n=this._segments,o=this._shared.childToSegment,r=null,s=null,l=new Array(i),a=0,u=-10,h=0;for(let p=0;p<i;++p){let i=t[p];if(r=n[i],r)a=100*r.getOrder(),h=0,r.isSubSegment()||s!==r&&(s=r,u=100*r.getLastOrder());else{let t=o[i];t?(r=n[t],a=100*r.getOrder(),h=1,e&&(u=100*r.getLastOrder())):u?(a=u,h=10):a=h=0}l[p]=a+h}return s?l:null},dt.prototype.logStructure=function(){let t=this._segmentList;if(!t)return"";let e=t.length,i=[];for(let n=0;n<e;++n)t[n].log(i);return i.join("\n")},dt.prototype.logRowIdMap=function(){let t=[],e=this._shared.childToSegment;for(let i in e){let n=e[i];t.push(i+" > "+n)}return t.join("\n")},dt.prototype.setSegmentClassification=function(t,e){let i=this._segments[t];return!(!i||!i.setClassification(e))&&(i.getClassification()&&(this._classification=!0),this._classifierChanged=!0,!0)},dt.prototype.hasClassification=function(){return this._classification||this._classifierChanged},dt.prototype.classify=function(t){if(!this._segmentCount)return!1;if(!this.hasClassification())return!1;this._classification=this._classifierChanged=!1;let e=this._segments;for(let i in e){let e=this._segments[i];e.isSubSegment()||(e.getClassification()&&(this._classification=!0),e.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)},dt.prototype._onSubSegmentAdded=function(t){let e=t.rid;if(this._segments[e])console.log("Incorrect logic detected.");else{let i=t.segment;this._insertionList.push(i),this._segments[e]=i,this._segmentCount++,i.addEventListener("subSegmentAdded",this._onSubSegmentAdded),i.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved)}},dt.prototype._onSubSegmentRemoved=function(t){let e=t.rid;this.removeSegment(e)};var ct=dt;let _t=function(){_t.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")};l.inherits(_t,ut),_t.prototype._prevData=null,_t.prototype._rids,_t.prototype._frozen=!1,_t.prototype._runningId=0,_t.prototype._compMap=null,_t.prototype._segments=null,_t.prototype._autoSegmentFilling=!1,_t.prototype._removedRows=null,_t.prototype._userSegmentComparer=null,_t.prototype._segmentSortOrder=0,_t.prototype._segmentSortContext=null,_t.prototype._clsSource=null,_t.prototype._classifyingTimer=0,_t.SortLogic,_t.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._classifyingTimer&&(clearTimeout(this._classifyingTimer),this._classifyingTimer=0),this._compMap=null,this._clsSource=null,_t._removeIndexArray(),this._segments&&(this._segments.dispose(),this._segments=null)},_t.prototype.getColumnData=function(t){let e=new Array(this._rids.length);for(let i=this._rids.length;--i>=0;)e[i]=this._rows[this._rids[i]][t];return e},_t.prototype.getRowId=function(t){return this._rids[t]||""},_t.prototype.getAllRowIds=function(t){return t?this._rids:this._rids.slice(0)},_t.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},_t.prototype.getRowCount=function(){return this._rids.length},_t.prototype.getDataAt=function(t,e){return this.getData(this._rids[t],e)},_t.prototype.getRowDataAt=function(t){return this.getRowData(this._rids[t])},_t.prototype.getPreviousData=function(t,e){let i=this._prevData[t]||null;return i?i[e]:null},_t.prototype.setData=function(t,e,i){if(!this._needFiring())return this._setData(t,e,i);let n={};return n[e]=i,this.setRowData(t,n)},_t.prototype._removeRidFromSegments=function(t){if(this._segments){if(this._segments.getSegment(t)){if(this._segments.removeSegment(t))return this._segments.getSegmentCount()||(this._segments.dispose(),this._segments=null),!0}else{let e=this._segments.getParentRowId(t);e&&this._segments.removeSegmentChild(e,t)}}return!1},_t.prototype.setRowData=function(t,e,i){if(!t)return!1;let n=this.getRowData(t),o=!1,r="updated",s=!1;if(e){if(n){let i=this._prevData[t];for(let t in e)i[t]=n[t],n[t]=e[t]}else if(r="inserted",n=e,this._rows[t]=n,this._prevData[t]={},i){let e=i.nextRid,n=e?this.getRowIndex(e):-1;n<0&&(n=i.fallback),null==n||n<0||n>=this._rids.length?this._rids.push(t):(this._rids.splice(n,0,t),s=!this._isLastSegment(n))}else this._rids.push(t);o=!0}else n&&(r="removed",this._prevData[t]=this._rows[t],delete this._rows[t],s=this._removeRidFromSegments(t),_t._removeArrayItem(this._rids,t),o=!0);if(o&&this._needFiring()){if(this._autoFillSegments())this.dispatchGlobalChange();else{let o=i||{};o.rid=t,o.changes=e,o.rowData=n,o.type=r,s&&(o.segmentChanged=!0),this._dispatchDataChange(o)}this.requestClassifying()}return o},_t.prototype.setColumnData=function(t,e,i){let n=e?e.length:0;if(n<0)return;let o=this._frozen;this.freeze();let r=this._generateRids(n,i);for(let i=0;i<n;++i)this._setData(r[i],t,e[i]);this.freeze(o)},_t.prototype.setDataFromObjectMap=function(t){if(!t)return;if(Array.isArray(t))return void this.addRows(t);let e=this._frozen;this.freeze();for(let e in t)this.setRowData(e,t[e]);this.freeze(e)},_t.prototype.setDataFrom2DArray=function(t,e,i){let n=t?t.length:0;if(n<0)return;let o=this._frozen;this.freeze();let r=0,s=this._generateRids(n,i);for(let i=0;i<n;++i){let n=t[i],o=s[i];if(e)for(r=n.length;--r>=0;)this._setData(o,e[r],n[r]);else for(r=n.length;--r>=0;)this._setData(o,""+r,n[r])}this.freeze(o)},_t.prototype.setDataAt=function(t,e,i){let n=this.getRowId(t);return!!n&&this.setData(n,e,i)},_t.prototype.setRowDataAt=function(t,e,i){let n=this.getRowId(t);return!!n&&this.setRowData(n,e,i)},_t.prototype.addRow=function(t,e){return t||(t={}),e=this._generateUniqueRid(t,e),this.setRowData(e,t),e},_t.prototype.addRows=function(t,e){if(!Array.isArray(t))return;let i=t.length;if(!i)return;if(1===i)return void this.addRow(t[0],e?e[0]:null);e||(e=[]);let n=this._frozen;this.freeze();for(let n=0;n<i;++n)this.addRow(t[n],e[n]);this.freeze(n)},_t.prototype.unshiftRow=function(t,e){return this.insertRow(0,t,e)},_t.prototype.insertRow=function(t,e,i){let n=null;return"number"==typeof t?(n={},n.nextRid=this._rids[t],n.fallback=t):t&&(n={},n.nextRid=t),e||(e={}),i=this._generateUniqueRid(e,i),this.setRowData(i,e,n),i},_t.prototype.insertAfter=function(t,e,i){let n="string"==typeof t?this.getRowIndex(t):t;return!(n>=0)||n>=this._rids.length-1?this.addRow(e,i):this.insertRow(n+1,e,i)},_t.prototype.removeRow=function(t){"number"==typeof t?this.setRowData(this.getRowId(t),null):this.setRowData(t,null)},_t.prototype.removeRows=function(t){let e,i;if(1===t.length)return e=t[0],void("number"==typeof e?this.removeRow(e):this.setRowData(e,null));let n=!1;for(this._removedRows={},i=t.length;--i>=0;){e=t[i],"number"==typeof e&&(e=this.getRowId(e)),this.getRowData(e)&&(this._prevData[e]=this._rows[e],this._removedRows[e]=1,delete this._rows[e],this._removeRidFromSegments(e),n=!0)}n?(this._rids=this._rids.filter(this._removeRows),this._removedRows=null,this.dispatchGlobalChange()):this._removedRows=null},_t.prototype._removeRows=function(t){return!this._removedRows[t]},_t._removeArrayItem=function(t,e){let i=t.indexOf(e);return i>=0&&(i>=t.length?t.pop():t.splice(i,1),!0)},_t.prototype.clearAllData=function(t){_t.base(this,"clearAllData",!0),this._prevData={},this._segments&&(this._segments.dispose(),this._segments=null),this._rids.length&&(this._rids.length=0,this.dispatchGlobalChange(t))},_t.prototype.removeAllRows=_t.prototype.clearAllData,_t._ascendingOrder=function(t,e){return t-e},_t.prototype.moveRow=function(t,e,i){let n=null,o="";if(e>=0&&e<this._rids.length||(e=this._rids.length),Array.isArray(t)){let i=t;i.sort(_t._ascendingOrder);let r=[];for(let t=i.length;--t>=0;){let n=i[t];o=this._rids[n],o&&(r.unshift(o),this._rids.splice(n,1),n<e&&--e)}r.length&&(this._rids.splice.apply(this._rids,[e,0].concat(r)),n=r)}else t<0&&(t=0),t!==e&&t+1!==e&&(o=this._rids.splice(t,1)[0],o&&(t<e&&--e,this._rids.splice(e,0,o),n=o));return n&&(this._segments&&(this._segments.calcSegmentOrder(this._rids),this._sort(null)),this._dispatchPositionChange(i)),n},_t.prototype._moveRow=function(t,e,i){let n=t.length;if(!n)return null;let o=new Array(n);for(let e=0;e<n;++e)o[e]=this.getRowIndex(t[e]);let r=e?this.getRowIndex(e):this._rids.length;return n>1?this.moveRow(o,r,i):this.moveRow(o[0],r,i)},_t.prototype.moveRows=function(t,e,i,n){"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);let o=t+i-1,r=e;if(e>=t&&(r=e<=o?t:e-i),i>0&&o<=this._rids.length){r>this._rids.length&&(r=this._rids.length);let e=this._rids.splice(t,i),o=[r,0].concat(e);return Array.prototype.splice.apply(this._rids,o),this._segments&&this._sort(null),this._dispatchPositionChange(n),e}return null},_t.prototype.swapRow=function(t,e){let i=this._rids.length;if(t<0||t>=i)return;if(e<0||e>=i)return;let n=this._rids[t];this._rids[t]=this._rids[e],this._rids[e]=n},_t.prototype.clearRowData=_t.prototype.removeRow,_t.prototype.clearColumnData=function(t,e){let i="string"==typeof t?[t]:t;for(let t=i.length;--t>=0;){let e=i[t];if(e)for(let t in this._rows)delete this._rows[t][e],delete this._prevData[t][e]}this.dispatchGlobalChange(e)},_t.prototype.getDataSource=function(){return null},_t.prototype.setDataSource=function(t){},_t.prototype.getSortingLogics=function(){return this._compMap},_t.prototype.sortOnce=function(t,e,i,n){let o=_t._buildSortContext([],t,e,i||this._compMap,n);return!!this._sort(o)&&(this._dispatchPositionChange(),!0)},_t.prototype.setSortingLogic=function(t){this._compMap._default=t},_t.prototype.setColumnSortingLogic=function(t,e){t&&(this._compMap[t]=e)},_t.prototype.getColumnSortingLogic=function(t){if(t){let e=this._compMap[t];if(e)return e}return this._compMap._default||null},_t.prototype.freeze=function(t){t=!1!==t;let e=this._frozen;return e!==t&&(this._frozen=t,this._autoFillSegments(),this.dispatchGlobalChange()),e},_t.prototype.unfreeze=function(t){return this.freeze(!1===t)},_t.prototype.isFrozen=function(){return this._frozen},_t.prototype.setSegmentSeparator=function(t,e){let i=!1,n=0;if(t&&"string"==typeof t)if(!1!==e){if(this._segments||(this._segments=new ct,this._segments.addEventListener("subSegmentChanged",this._onSubSegmentChanged)),this._autoSegmentFilling){let e=this._segments.getParentRowId(t);e&&this._segments.removeSegmentChild(e,t)}this._segments.addSegment(t)&&(this._segments.calcSegmentOrder(this._rids),i=!0)}else if(this._segments){let e=this._segments.getSegment(t);e&&(n=e.getChildCount(),this._segments.removeSegment(t)&&(i=!0,this._segments.getSegmentCount()||(this._segments=null)))}if(i&&this._needFiring())if(this._autoFillSegments()||n)this.dispatchGlobalChange();else{let e=this._rows[t]||null;e&&this._dispatchDataChange({rid:t,changes:{},rowData:e,type:"updated",segmentChanged:!0})}return i},_t.prototype.unsetAllSegmentSeparators=function(){return!!this._segments&&(this._segments.dispose(),this._segments=null,this.dispatchGlobalChange(),!0)},_t.prototype.hasSegmentation=function(){return!!this._segments},_t.prototype.isSegmentSeparator=function(t){return!!this._segments&&this._segments.containsSegment(t)},_t.prototype.getSegment=function(t){return this._segments?this._segments.getSegment(t):null},_t.prototype.getSegmentParent=function(t){return this._segments?this._segments.getSegmentParent(t):null},_t.prototype.getSegmentLevel=function(t){let e=this.getSegment(t);return e?e.getSegmentLevel()+1:0},_t.prototype.getSegmentParentRowId=function(t){return this._segments?this._segments.getParentRowId(t):""},_t.prototype.getSegmentValues=function(t,e){return this._segments?this._segments.getSegmentValues(t||this._rids,e):null},_t.prototype._isLastSegment=function(t){let e=this._segments;if(e){let i=this._rids,n=i.length;for(let o=t+1;o<n;++o)if(e.containsSegment(i[o]))return!1}return!0},_t.prototype._getSegmentSeparators=function(){return this._segments},_t.prototype.enableAutoSegmentFilling=function(t){this._autoSegmentFilling=0!=t,this._autoFillSegments()},_t.prototype._autoFillSegments=function(){return!!this._autoSegmentFilling&&this.fillSegments()},_t.prototype.fillSegment=function(t){this._segments&&(this._segments.fillSegment(t,this._rids),this.dispatchGlobalChange(),this.requestClassifying())},_t.prototype.fillSegments=function(){if(this._segments){let t=this._segments.fillSegments(this._rids);return t&&(this.dispatchGlobalChange(),this.requestClassifying()),t}return!1},_t.prototype.addSegmentChild=function(t,e,i){if(this._segments){if(this._segments.addSegmentChild(t,e,i))return this._sort(null),this._dispatchPositionChange(),this.requestClassifying(),!0}return!1},_t.prototype.addSegmentChildren=function(t,e,i){if(this._segments){if(this._segments.addSegmentChildren(t,e,i))return this._sort(null),this._dispatchPositionChange(),this.requestClassifying(),!0}return!1},_t.prototype.removeSegmentChild=function(t,e){if(this._segments){let i=this._segments.removeSegmentChild(t,e);return i&&(this.dispatchGlobalChange(),this.requestClassifying()),i}return!1},_t.prototype.removeSegmentChildren=function(t,e){if(this._segments){let i=this._segments.removeSegmentChildren(t,e);return i&&(this.dispatchGlobalChange(),this.requestClassifying()),i}return!1},_t.prototype.removeAllSegmentChildren=function(){if(this._segments){let t=this._segments.removeAllSegmentChildren();return t&&this.dispatchGlobalChange(),t}return!1},_t.prototype.getSegmentIds=function(){return this._segments?this._segments.getSegmentIds():null},_t.prototype.getSegmentChildIds=function(t){if(this._segments){let e=this._segments.getSegment(t);if(e){let t=e.getChildIds();return t.length?t:null}}return null},_t.prototype.sortSeparators=function(t,e,i){let n=!1;if(!this._segments)return!1;if("function"==typeof t)return this.sortSegments(t);let o=_t._buildSortContext([],i,e,t),r=o?o.length:0;if(!r)return n;let s,l,a=0;return r>1?(s=_t._multiColumnSeparatorCompareLogic,l=o,a=1):(s=_t._singleColumnSeparatorCompareLogic,l=o[0],a=l[3]),this._segmentSortOrder=a,this._segmentSortContext=l,n=this.sortSegments(s),this._segmentSortOrder=0,this._segmentSortContext=null,n},_t.prototype.sortSegments=function(t){if(!this._segments)return!1;if("function"!=typeof t)return this._segments.calcSegmentOrder(this._rids),!1;let e,i=this._rids,n=this._segments,o=n.getSegmentCount(),r=[],s=[],l=0,a=i.length,u="",h=null;for(e=0;e<a&&(u=i[e],h=n.getSegment(u),!(h&&(s.push(e),r.push(h),++l>=o)));++e);this._userSegmentComparer=t,r.sort(this._bySegmentSeparator),this._userSegmentComparer=null;let p=!1;for(e=0;e<l;++e){let t=s[e];u=i[t],h=r[e];let n=h.getId();u!==n&&(i[t]=n,p=!0)}return!!p&&(this._segments.calcSegmentOrder(i),this._sort(null),this._dispatchPositionChange(),!0)},_t.prototype._bySegmentSeparator=function(t,e){return this._userSegmentComparer(this.getRowData(t.getId()),this.getRowData(e.getId()),this._segmentSortOrder,this._segmentSortContext)},_t.prototype.setClassificationSource=function(t){this._clsSource=null,t&&t._rows&&(this._clsSource=t._rows)},_t.prototype.setSegmentClassification=function(t,e){if(this._segments){if(this._segments.setSegmentClassification(t,e))return this.classifySegments()}return!1},_t.prototype.classifySegments=function(){return!(!this._segments||!this._rids.length)&&this._segments.classify(this._clsSource||this._rows)},_t.prototype.requestClassifying=function(){this._segments&&!this._classifyingTimer&&this._segments.hasClassification()&&(this._classifyingTimer=setTimeout(this._onClassifyingTimer,10))},_t.prototype._onClassifyingTimer=function(){this._classifyingTimer=0,this.classifySegments()},_t.prototype._onSubSegmentChanged=function(t){let e,i=t.insertionList,n=t.removalList,o=!1,r=this._rows,s=this._clsSource||r,l=this._rids,a=this._prevData,u=n.length,h={};for(e=0;e<u;e++){let t=n[e];r[t]&&(h[t]=a[t]=r[t],delete r[t],_t._removeArrayItem(l,t),o=!0)}let p=i.length;for(e=0;e<p;e++){let t=i[e],n=t.getParentId(),u=t.getId();if(!r[u]){a[u]={},t.setRowData(r,s);let e=l.indexOf(n);e<0||e+1>=l.length?l.push(u):l.splice(e+1,0,u),o=!0}}o&&(t.removedRows=h,this._dispatch("subSegmentChanged",t),this.dispatchGlobalChange())},_t.prototype._sort=function(t){let e=this._rids,i=this.getMultipleRowData(e),n=this.getSegmentValues(e),o=_t._performMultiLevelSorting(i,t,n);return!!o&&(this._rids=_t._reorderItems(e,o),!0)},_t.prototype.dispatchGlobalChange=function(t){!t&&this._needFiring()&&this._dispatchDataChange(_t._globalChangeArg)},_t.prototype._dispatchPositionChange=function(t){!t&&this._needFiring()&&this._dispatch("dataChanged",_t._positionChangeArg)},_t.prototype.dump=function(t){return ut.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},_t.prototype._setData=function(t,e,i){let n=this.getRowData(t);return n||(n={},this._rows[t]=n,this._prevData[t]={},this._rids.push(t)),this._prevData[t][e]=n[e],n[e]=i,!0},_t.prototype._generateRids=function(t,e){let i,n=0;if(e)i=e;else{i=[];let e=this._rids.length;for(;n<e&&n<t;)i.push(this._rids[n++])}for(n=i.length;n<t;)i.push(""+n++);return i},_t.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},_t.prototype._needFiring=function(){return!this._frozen&&!this._composing},_t.getSortingDefinitions=nt._deprecatedFunction,_t._globalChangeArg={globalChange:!0},_t._positionChangeArg={globalChange:!0,positionChangeOnly:!0},_t._buildSortContext=function(t,e,i,n,o){let r,s;Array.isArray(e)?(r=e,s=i):(r=[e],s=e?[i]:[0]);let l=null,a=null;"function"==typeof n?l=n:a=n;let u=r.length;t.length=u;for(let e=u;--e>=0;){Array.isArray(a)&&(l=a[e]);let i=t[e];i||(i=t[e]=new Array(5));let n=r[e];i[0]=n,i[1]=null,i[2]=l||a[n]||a._default,i[2]||(i[2]=_t._defaultComparer),i[3]=_t._getSortOrder(s[e]),i[4]=o}return t},_t._multiColumnCompareLogic=function(t,e,i,n){let o=n.length,r=0;for(let i=0;i<o;++i){let o=n[i];if(r=_t._singleColumnCompareLogic(t,e,o[3],o),r)return r}return r},_t._singleColumnCompareLogic=function(t,e,i,n){let o=n[1];return n[2](o[t],o[e],i,n[4])},_t._multiColumnSeparatorCompareLogic=function(t,e,i,n){let o=n.length,r=0;for(let i=0;i<o;++i){let o=n[i];if(r=_t._singleColumnSeparatorCompareLogic(t,e,o[3],o),r)return r}return r},_t._singleColumnSeparatorCompareLogic=function(t,e,i,n){let o=n[0];return n[2](t[o],e[o],i,n[4])},_t._performMultiLevelSorting=function(t,e,i){let n,o=t?t.length:0,r=e?e.length:0;if(!o)return null;for(let i=0;i<r;++i){let r,s=e[i],l=s[1];if(n=s[2],n.rowSorting)if(l)for(l.length=o,r=0;r<o;++r)l[r]=t[r];else l=s[1]=t;else{l?l.length=o:l=s[1]=new Array(o);let e=s[0];for(r=0;r<o;++r)l[r]=t[r][e]}}if(i){let t=["ROW_SEGMENT",i,_t._segmentComparer,1,null];e?(e=e.slice()).unshift(t):e=[t],++r}if(!r)return null;let s,l=0;return r>1?(n=_t._multiColumnCompareLogic,s=e,l=1):(n=_t._singleColumnCompareLogic,s=e[0],l=s[3]),_t._mergeSort(o,l,n,s)},_t._mergeSort=function(t,e,i,n){let o,r,s,l,a,u=!1,h=1,p=_t._createIndexArray(t),d=p.slice();for(;h<=t;){for(o=a=0;o<t;)if(r=a,l=r+h,s=l,a=s+h,a>t&&(a=t),s<a){for(;;)if(i(p[r],p[s],e,n)<=0){if(d[o++]=p[r],++r>=l){for(;s<a;)d[o++]=p[s],++s;break}}else if(u=!0,d[o++]=p[s],++s>=a){for(;r<l;)d[o++]=p[r],++r;break}}else for(;o<t;)d[o]=p[o],++o;let c=p;p=d,d=c,h<<=1}return u?p:null},_t._reorderItems=function(t,e){if(e){for(let i=t.length;--i>=0;)e[i]=t[e[i]];return e}return t},_t._createIndexArray=function(t){let e=_t._idxAryMap[t];if(!e){_t._idxAryCount>50&&(_t._idxAryMap={},_t._idxAryCount=0),e=_t._idxAryMap[t]=new Array(t),_t._idxAryCount++;for(let i=0;i<t;++i)e[i]=i}return e.slice()},_t._removeIndexArray=function(){_t._idxAryMap={},_t._idxAryCount=0},_t._idxAryMap={},_t._idxAryCount=0,_t._segmentComparer=function(t,e){return t===e?0:t<e?-1:1},_t._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},_t._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},_t._proto=_t.prototype;var ft=_t;const gt="ROW_DEF",yt="CONTENT",mt="CHAIN",Ct="CONSTITUENT",St="GROUP_HEADER",wt="SUBGROUP_HEADER",bt="GROUP_MEMBER";let Rt=function(t){if(this._changes={},t&&t.segmentId)return this._dataId=this._rowId=t.segmentId,this._autoGenerated=!0,void(this._subSegment=!0);this._rowId="_"+Rt._runningId+++"_",this._dataId=this._rowId,t&&(t.asConstituent?this._initializeAsConstituent(t):this.initialize(t))};Rt._runningId=0,Rt._childDataField="CHILD_VALUES",Rt.prototype._userInput="",Rt.prototype._ric="",Rt.prototype._permId="",Rt.prototype._label=null,Rt.prototype._isChain=null,Rt.prototype._asSegment=!1,Rt.prototype._realTime=!0,Rt.prototype._rowId="",Rt.prototype._dataId="",Rt.prototype._userId=!1,Rt.prototype._dc=null,Rt.prototype._view=null,Rt.prototype._subId="",Rt.prototype._expanded=null,Rt.prototype._autoGenerated=!1,Rt.prototype._subSegment=!1,Rt.prototype._staticValues=null,Rt.prototype._changes,Rt.prototype._updateCount=0,Rt.prototype._children=null,Rt.prototype._parent=null,Rt.prototype._groupOrder=0,Rt.prototype._depthLevel=0,Rt.prototype._userModel=null,Rt.prototype._info=null,Rt.prototype.dispose=function(){if(!this.isDisposed()){if(this._children&&(this._children.forEach(Rt.dispose),this._children=null),this._staticValues=null,this._parent=null,this._depthLevel=0,this.unsubscribeForUpdates(),this._dc){let t=this.getRowData();t&&(t[gt]=null),this._dc=null}this._view&&(this._view=null),this._rowId=this._dataId="",this._userId=!1,this._userModel=null}},Rt.prototype.isDisposed=function(){return!this._rowId},Rt.prototype.initialize=function(t){if(!t)return;if(!this._autoGenerated){let e=t.rowId;e&&"string"==typeof e&&(this._rowId=this._dataId=e,this._userId=!0)}let e=Rt.extractRowOptions(t),i=t.permId;null!=i&&(this._permId=i),i=t.ric,null!=i&&(this._ric=i),i=t.label,void 0!==i&&(this._label=i),i=t.chainRic,null!=i&&(this._chainRic=i),i=e.asChain,null!=i&&(this._isChain=!!i),i=t.realTime,null!=i&&(this._realTime=i),i=t.collapsed;let n=e.collapsed;null==i&&n||(this._expanded=!n),i=t.asSegment,null!=i&&(this._asSegment=!!i),i=t.keepModel,i&&(this._userModel=t),i=t.info,i&&(this._info=i);let o=this._ric||this._chainRic;(o||this._permId)&&this.setContent(o,e),i=t.values,void 0!==i&&this.setStaticRowData(i,t.fields)},Rt.prototype._initializeAsConstituent=function(t){this._autoGenerated=!0;let e=t.parent;if(this.setParent(e)&&(this._dataId=t.dataId,this._ric=t.ric,this._dc=e._dc,this._dc)){let t=this.getRowData();t&&(t[gt]=this)}let i=t.values;void 0!==i&&this.setStaticRowData(i,t.fields)};let vt=function(t,e){let i=t.getRowIndex(e);do{if((e=t.getRowId(++i))&&!t.getSegmentParentRowId(e))break}while(e);return e},It=function(t,e,i){return!(!t||!t.isSorting())&&((e=!!e)!==i&&(e&&t.synchronizeRowOrder(),t.stallSorting(e)),e)};Rt.prototype.setContent=function(t,e){if(this._autoGenerated)return!1;t?"string"!=typeof t&&(t+=""):t="";let i=this._userInput!==t,n=e.permId;if(this._permId!==n&&(this._permId=n||"",i=!0),!i)return!1;let o=e.asChain,r=!0;"'"===t.charAt(0)&&(r=!1,this._ric=this._chainRic="");let s=this._view,l=It(s,r&&o,!1);if(this.unsubscribeForUpdates()||this._clearStaticData(),this.resetUpdates(),this._userInput=t,r){let i=!e.collapsed,n=e.chainRic;!0===o?(this._ric=!1===i?t:t.replace("0#",""),this._expanded=i):this._ric=t,this._isChain=null!=o?o:null,this._chainRic=n||""}if(this._dataId=this._rowId+this.getSymbol(),s){let t=s.getSegmentParentRowId(this._rowId);if(t){if(this._isChain){let e=vt(s,this._rowId);s.removeSegmentChild(t,this._rowId),s.moveRow(this._rowId,e),t=""}}else s.getSegment(this._rowId)&&s.setSegmentSeparator(this._rowId,!1);this._isChain&&s.setSegmentSeparator(this._rowId,!0),this.isChainCollapsed()?this._expanded&&this.expandChain():this._expanded||this.collapseChain(),It(s,!1,l),t&&s.addSegmentChild(t,this._rowId,this._dataId)}if(!this.subscribeForUpdates()&&this._dc){let t={};t[gt]=this,t.X_RIC_NAME=this.getDisplayText(),this.setRowData(t)}return!0},Rt.prototype.getRowId=function(){return this._rowId},Rt.prototype.getConfigObject=function(t){let e=t||{};this._userId&&(e.rowId=this._rowId);let i=this._ric;if(i&&(e.ric=i),this._ric||"'"!==this._userInput.charAt(0)||(e.ric=this._userInput),i=this._realTime,i||(e.realTime=!1),i=this._permId,i&&(e.permId=i),i=this._chainRic,i&&(e.chainRic=i),i=this._label,i&&(e.label=i),i=this._userModel,i&&(e.keepModel=e),i=this._isChain,null!=i&&(e.asChain=i),i=this._expanded,null!=i&&(e.collapsed=!i),i=this._view.isHiddenRow(this._rowId),i&&(e.hidden=i),i=this._info,i&&(e.info=this._info),i=this._cloneStaticRowData(),i&&(e.values=i),this.isChain()){let t=this.getChildren();if(t){let n=i?i[Rt._childDataField]:{};n||(n={});let o,r,s,l=!1,a=t.length;for(o=0;o<a;o++)r=t[o],s=r._cloneStaticRowData(),s&&(l=!0,n[r.getRic()]=s);l&&(e.values||(e.values={}),e.values[Rt._childDataField]=n)}}return e},Rt.prototype.getDataId=function(){return this._dataId},Rt.prototype.getType=function(){if(this._isChain)return mt;if(this._parent)return Ct;{let t=this._view;if(!t)return"";{let e=this.getRowId(),i=t.isSegmentSeparator(e),n=t.getSegmentLevel(e);if(i)return 1===n?St:wt;if(t.getSegmentParentRowId(e))return bt}}return yt},Rt.prototype.setDataSource=function(t){if(this._dc=t||null,!this._dc)return;let e=this.getRowData();e||(e={},e[gt]=this,e.X_RIC_NAME=this.getDisplayText(),this.setRowData(e)),this._staticValues&&this.setRowData(this._staticValues),this.subscribeForUpdates()},Rt.prototype.getDataSource=function(){return this._dc},Rt.prototype.getRowData=function(){return this._dc?this._dc.getRowData(this._dataId):{}},Rt.prototype.getData=function(t){return this._dc?this._dc.getData(this._dataId,t):null},Rt.prototype.setStaticRowData=function(t,e){this._clearStaticData(),Array.isArray(t)&&(t=m(t,e)),this._staticValues="object"==typeof t?t:null,this._staticValues&&this.setRowData(t)},Rt.prototype._cloneStaticRowData=function(){return this._staticValues?g(this._staticValues):null},Rt.prototype.setStaticData=function(t,e){this._staticValues||(this._staticValues={}),this._staticValues[t]=e,this.setData(t,e)},Rt.prototype.updateRowData=function(t,e){Array.isArray(t)&&(t=m(t,e)),t&&this.setRowData(t)},Rt.prototype.copyRowData=function(t){if(t&&t!==this){let e,i={ROW_DEF:1,SUB_ID:1},n=this._staticValues;for(e in n)i[e]=1;for(e in n=t._staticValues,n)i[e]=1;let o=t.getRowData(),r=this.getRowData();for(e in o)i[e]||(r[e]=o[e])}},Rt.prototype.setRowData=function(t){this._dc&&this._dc.setRowData(this._dataId,t)},Rt.prototype.setData=function(t,e){this._dc&&this._dc.setData(this._dataId,t,e)},Rt.prototype._clearStaticData=function(){if(this._staticValues){for(let t in this._staticValues)this._staticValues[t]=null;this._dc&&this._dc.setRowData(this._dataId,this._staticValues),this._staticValues=null}},Rt.prototype.getUserInput=function(){return this._userInput},Rt.prototype.getRic=function(){return this._ric},Rt.prototype.getPermId=function(){return this._permId},Rt.prototype.getSymbol=function(){return this._ric||this._permId},Rt.prototype.getDisplayText=function(){return null!=this._label?this._label:this._ric?this._ric:this._permId?this._permId:this._userInput},Rt.prototype.getLabel=function(){return this._label},Rt.prototype.isRowHeader=function(){return"'"===this._userInput.charAt(0)},Rt.prototype.isChain=function(){return this._isChain},Rt.hasChain=function(t){return t.isChain()},Rt.prototype.isChainCollapsed=function(){return!!this._view&&this._view.isSegmentCollapsed(this._rowId)},Rt.prototype.isChainExpanded=function(){return!this.isChainCollapsed()},Rt.prototype.isFixedPosition=function(){return this._isChain&&this.isChainExpanded()},Rt.prototype.isAutoGenerated=function(){return this._autoGenerated},Rt.prototype.isRealTimeRow=function(){return!!this.getRic()&&(!!this._realTime&&(!this._autoGenerated&&!this.isRowHeader()))},Rt.prototype.subscribeForUpdates=function(){if(!this.isRealTimeRow()&&!this.getPermId())return!1;let t=this._dc?this._dc.getSubscriptions():null;if(!t)return!1;let e=this.unsubscribeForUpdates();if(this.isChain()){let e=this._chainRic;if(!e&&(e=this._ric,e.indexOf("0#")<0)){(e.match(/\./g)||[]).length<2&&(e="0#"+e)}this._subId=t.addChain(e,this._rowId)}else this._ric&&(this._subId=t.addRic(this._ric,this._rowId));return e?this._dc.setRowData(this._dataId,e):this._dc.setRowData(this._dataId,{X_RIC_NAME:this.getDisplayText(),ROW_DEF:this}),!0},Rt.prototype.unsubscribeForUpdates=function(){if(!this._subId)return;let t=this._dc.getSubscriptions(),e=this.getRowData();return t.removeSubscription(this._subId),this._subId="",this.resetUpdates(),this._dc.setRowData(this._dataId,null),this._clearStaticData(),e},Rt.prototype.isSubscribing=function(){return!!this._subId},Rt.prototype.addUpdate=function(t){if(t){let e=t.changes;if(e){let t=0;for(let i in e)this._changes[i]=t=1;if(t)return++this._updateCount,!0}}return!1},Rt.prototype.getUpdates=function(){return this._updateCount?this._changes:null},Rt.prototype.resetUpdates=function(){this._updateCount&&(this._changes={},this._updateCount=0)},Rt.prototype.registerToView=function(t,e){if(!t||this._view===t)return;this._view=t;let i=null;if(this._subSegment)return i=this._view.getRowData(this.getRowId()),void(i&&(i[gt]=this));i={},i[gt]=this;let n="",o=this._isChain||this._asSegment;e&&(n=t.getSegmentParentRowId(e),n&&o&&(e=vt(t,e)));let r=It(t,o,!1),s=t.insertRow(e,i,this.getRowId());s!==this._rowId&&(this._rowId=s,this._userId=!1),o?(t.setSegmentSeparator(s),It(t,!1,r),this._expanded||t.collapseSegment(s)):!this._parent&&n&&t.addSegmentChild(n,s,this._dataId)},Rt.prototype._deregisterFromView=function(t){return this._view?(t&&t.push(this._rowId),this._view=null,this._rowId):""},Rt.deregisterFromView=function(t,e){return e._deregisterFromView(t),t},Rt.prototype._getChildStaticRowData=function(t){if(!this._staticValues)return null;let e=this._staticValues[Rt._childDataField];return e&&e[t]||null},Rt.prototype.addConstituent=function(t){if(!t||this._ric===t)return null;if(!(this._rowId&&this._subId&&this._isChain))return null;let e=null;if(this._children){for(let i=this._children.length;--i>=0;)if(this._children[i]._ric===t){e=this._children[i];break}}else this._children=[];let i=!e;if(i){let i={asConstituent:!0,dataId:this._subId+t,ric:t,parent:this},n=this._getChildStaticRowData(t);n&&(i.values=n),e=new Rt(i)}if(this._view){let t=this.getRowId(),i=e.getData("CHILD_ORDER"),n=this._view.getDataSource(),o=n.getRowIndex(t),r=o+this.getChildCount();null!=i&&(r=o+i+1),e.registerToView(this._view,n.getRowId(r)),this._view.addSegmentChild(t,e.getRowId(),e.getDataId())}return i?e:null},Rt.prototype._toRealTimeRow=function(){this._ric&&(this.isRowHeader()||(this._realTimeField=!0,this._dataId=this._rowId+this._ric,this._autoGenerated=!1,this._parent=null,this._depthLevel=0,this._staticValues&&this.setRowData(this._staticValues),this.subscribeForUpdates()))},Rt.prototype.unlinkChain=function(){if(!this._isChain)return;if(this.isChainExpanded()){let t=this.getDescendants(),e=t.length;for(let i=0;i<e;i++)t[i]._toRealTimeRow()}let t=this._cloneStaticRowData();this.unsubscribeForUpdates(),this.setStaticRowData(t);let e=this._view;if(e){let t=this.getRowId(),i=e.getSegment(t);i&&i.setClassification(null),e.setSegmentSeparator(t,!1)}this._isChain=this._expanded=!1,this._chainRic="",this._userInput=this._ric,this._children=null,this.subscribeForUpdates()},Rt.prototype.collapseChain=function(){return!(!this._isChain||!this._view)&&(this._expanded=!1,this._view.collapseSegment(this._rowId,!0))},Rt.prototype.expandChain=function(){return!(!this._isChain||!this._view)&&(this._expanded=!0,this._view.collapseSegment(this._rowId,!1))},Rt.prototype.toggleChain=function(){return this._expanded?this.collapseChain():this.expandChain()},Rt.prototype.addChild=function(t){return!!t&&t.setParent(this)},Rt.prototype.getChildren=function(){return this._children},Rt.prototype.getDescendants=function(t){if(t||(t=[]),this._children){let e=this._children,i=e.length;for(let n=0;n<i;++n){let i=e[n];t.push(i),i.getDescendants(t)}}return t},Rt.prototype.getAllDescendantIds=function(){let t=this.getDescendants();return t.length?t.map(Rt.toRowId):null},Rt.prototype.getChildCount=function(){return this._children?this._children.length:0},Rt.prototype.getParent=function(){return this._parent},Rt.prototype.setParent=function(t){if(this._parent===t||t===this)return!1;if(this._parent){let t=this._parent._children.lastIndexOf(this);t>=0&&this._parent._children.splice(t,1),this._parent=null,this._depthLevel=0}return!!t&&(t._children||(t._children=[]),t._children.push(this),this._parent=t,this._depthLevel=t._depthLevel+1,!0)},Rt.prototype.getDepthLevel=function(){return this._depthLevel},Rt.prototype.getGroupOrder=function(){return this._parent?this._parent.getGroupOrder()+.1:this._groupOrder},Rt.prototype.setGroupOrder=function(t){return!this._parent&&this._groupOrder!==t&&(this._groupOrder=t,!0)},Rt.prototype.getUserModel=function(){return this._userModel},Rt.prototype.setRowInfo=function(t){this._info=t},Rt.prototype.getRowInfo=function(){return this._info},Rt.toRowId=function(t){return t.getRowId()},Rt.extractRowOptions=function(t){let e=t.ric,i=t.permId,n=t.chainRic,o=t.collapsed,r=t.asChain;null==r&&n&&(r=!0);let s=null;e&&e.indexOf("0#")>=0&&(null==r&&(r=!0),s=!0);let l={};return l.collapsed=null==o?!s:o,l.ric=e,l.permId=i||"",l.chainRic=n,l.asChain=r,l},Rt.dispose=function(t){t.dispose()};const Dt="/synapse/service/suggestions/suggest/?hits=1&profile="+encodeURIComponent("Field Selector"),xt=/^TR\.\w+\([\w\-=,]*(?:EDATE|SDATE)=+[\w\-=,]*[ \w]*\)$/i;let At={};function Lt(t){t.currentTarget._error={type:t.type}}function Tt(t){let e=t.currentTarget,i=e._defer,n=e._field;if(delete At._loadingField[n],200===e.status){let t=JSON.parse(e.responseText),o=null,r=t.result&&t.result[0];if(r){let t=r.hits&&r.hits[0];if(t&&t.p){let e=t.p;e.fn.toUpperCase()===n.toUpperCase()&&(o=At.get(n)||{},o.field=e.fn,o.name=e.fl,o.rank=e.Rank,o.fieldDataType=e.fdt,o.id=e.fid,o.IsMonitorOnlyField=e.fimo,o.IsRealtimePortfolioField=e.firp,o.IsRealtimeField=e.firt,o.source=e.fsrc,o.sourceRank=e.fsrnk,o.description=t.title,At.set(n,o))}}o?i.resolve(o):i.reject("No definition for "+n)}else e._error?(e._error.field=n,i.reject(e._error)):i.reject({field:n,status:e.status,statusText:e.statusText,request:e})}At._defs={CF_NAME:{name:"Name",rank:2800003,fieldDataType:"ALPHANUMERIC",id:"6307",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100003,description:"The name of the instrument"},CF_LAST:{name:"Last",rank:2800024,fieldDataType:"PRICE",id:"5364",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100024,description:"The latest trade price or value."},PCTCHNG:{name:"Pct. Chng",rank:2709440,fieldDataType:"PRICE",id:"56",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:9440,description:"Percentage change in the latest trade price or value from the historic close."},CF_NETCHNG:{name:"Net. Chng",rank:2800027,fieldDataType:"PRICE",id:"5367",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100027,description:"Net Change is the difference between latest trade price or value and the historic closing value or settlement price."},CF_CLOSE:{name:"Close",rank:2800023,fieldDataType:"PRICE",id:"5360",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100023,description:"The last trade price, settlement value or closing value."},CF_CURR:{name:"Currency",rank:2800021,fieldDataType:"ENUMERATED",id:"6452",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100021,description:"The currency that the instrument is quoted in"},CF_BID:{name:"Bid",rank:2800025,fieldDataType:"PRICE",id:"5359",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100025,description:"The latest Bid price."},CF_ASK:{name:"Ask",rank:2800026,fieldDataType:"PRICE",id:"5358",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100026,description:"The latest Ask price."}},At._timeSeriesChildren={},At._synapse="",At._lang="en",At._timeSeriesExpansion=!0,At._loadingField={},At.set=function(t,e){if(At._defs[t])for(let i in e)At._defs[t][i]=e[i];else At._defs[t]=e},At.get=function(t){return At._defs[t]||null},At.getFieldInfo=At.get,At.hasFieldInfo=function(t){let e=At.get(t);return!(!e||!e.field)},At.getTimeSeriesChildren=function(t){return At._timeSeriesChildren[t]||null},At.addTimeSeriesChild=function(t,e){At._timeSeriesChildren[t]||(At._timeSeriesChildren[t]=[]),At._timeSeriesChildren[t].push(e)},At.remove=function(t){delete At._defs[t]},At.setSynapseConfig=function(t){At._synapse=t},At.disableTimeSeriesExpansion=function(t){At._timeSeriesExpansion=0==t},At.isFormula=function(t){return"="===t.charAt(0)},At.isAdc=function(t){return 0===t.indexOf("TR.")},At.isRealTimeField=function(t){return!!t&&(!At.isAdc(t)&&(!At.isFormula(t)&&(!At.isTimeSeriesChild(t)&&!1!==At.getFieldProperty(t,"IsRealtimeField"))))},At.isTimeSeriesChild=function(t){return!!At.getFieldProperty(t,"timeSeriesParent")},At.isTimeSeries=function(t){if(!t)return!1;if(!At._timeSeriesExpansion)return!1;let e=At.getFieldProperty(t,"timeSeries");return null!=e?!!e:xt.test(t)},At.setFieldProperty=function(t,e,i){At._defs[t]||(At._defs[t]={}),At._defs[t][e]=i},At.getFieldProperty=function(t,e){let i=At._defs[t];return i?i[e]:null},At.loadFieldInfo=function(t){if(At._loadingField[t])return At._loadingField[t].promise;let e=new D,i=At._synapse;if(i)if(At.hasFieldInfo(t))e.resolve(At.get(t));else if(i.debug){let i=this._mockOnLoadEndData(t,e);setTimeout(Tt.bind(null,i),1e3)}else if(i.apiKey&&i.contextApp){let n=Dt+"&api-key="+encodeURIComponent(i.apiKey)+"&contextApp="+encodeURIComponent(i.contextApp)+"&language="+encodeURIComponent(At._lang)+"&query="+encodeURIComponent(t);i.auth&&(n+="&auth="+encodeURIComponent(i.auth));let o=new XMLHttpRequest;o._defer=e,o._field=t,At._loadingField[t]=e,o.addEventListener("loadend",Tt),o.addEventListener("timeout",Lt),o.addEventListener("error",Lt),o.open("GET",n,!0),o.send()}else e.resolve(null);else e.resolve(null);return e.promise},At._mockOnLoadEndData=function(t,e){let i,n=t.toUpperCase(),o=n.toLowerCase();i=2===o.indexOf("_")?n[3]+o.substring(4):n[0]+o.substring(1);let r=n.indexOf("DATE")>=0?"DATE":"PRICE",s={action:'"'+n+'" SRCH',assetClassifierExplanation:"AssetClassifier is disabled.",assetClassifierStatus:"NOT_INVOKED",result:[{name:"Fields",default:!1,size:1,hits:[{cmd:i,explanation:null,fr:!1,id:"1635614732",navigation:null,p:{Rank:2800024,fdt:r,fid:"5364",fimo:!1,firp:!1,firt:!0,fl:i,fn:n,fsrc:"IDN",fsrnk:100024},position:0,preview:!1,relations:{},score:2840024,source:"87",subtitle:"",symbol:i,title:"title mockup of "+n,vc:"FLD"}],hasMore:!1}],search:"cpurl://apps.cp./apps/SearchAll?Search.Value="+o+"*"};return s=JSON.stringify(s),{currentTarget:{_defer:e,_field:t,status:200,response:s,responseText:s}}},function(){for(let t in At._defs)At._defs[t].field=t}();var Et=At;let Mt={_formulas:{},set:function(t,e){Mt._formulas[t]=e},get:function(t){return Mt._formulas[t]||""},remove:function(t){delete Mt._formulas[t]}};var Ft=Mt;const Pt={STRING:"string",BOOLEAN:"boolean",NUMBER:"number",DATE:"datetime",DATETIME:"datetime",TIME:"datetime",ENUMERATED:"string",ALPHANUMERIC:"string",PERCENT:"string",PRICE:"number",DOUBLE:"number",MONEY:"number",INTEGER:"number",FLOAT:"number",SCORE:"number"};let zt=function(t,e){this._defaultRenderer=this._defaultRenderer.bind(this),this._customRenderer=this._customRenderer.bind(this),this._internalRenderer=this._defaultRenderer,this._internalSorter=this._defaultSorter,this._eventArg={colDef:this},e&&(this._updateContext("grid",e),this._updateContext("core",e.getCoreGrid())),this._classes=[],this._requiredFields=[],this._children=[],t&&(t.parent?this._initializeTimeSeriesChild(t):this.initialize(t))};zt.prototype._field="",zt.prototype._dataType="",zt.prototype._name="",zt.prototype._defaultName=!0,zt.prototype._defaultField=!0,zt.prototype._tooltip=null,zt.prototype._requiredFields,zt.prototype._headerRenderer=null,zt.prototype._headerAlignment="",zt.prototype._internalRenderer,zt.prototype._userRenderers=null,zt.prototype._activatedRenderer=null,zt.prototype._rendererMap=null,zt.prototype._userSorter=null,zt.prototype._sortable=!0,zt.prototype._eventArg,zt.prototype._autoGenerated=!1,zt.prototype._classes,zt.prototype._fnEngine=null,zt.prototype._formula=null,zt.prototype._formulaRef="",zt.prototype._initialOrder="",zt.prototype._rowSorting=null,zt.prototype._textSelect=!1,zt.prototype._userModel=null,zt.prototype._parent=null,zt.prototype._children=null,zt.prototype._info=null,zt.prototype._coreColDef=null,zt.prototype._focusable=!1,zt.prototype.dispose=function(){this._eventArg={},this._coreColDef=null,this._activatedRenderer=this._rendererMap=null,this.setRenderer(null),this.setSorter(null),this._userModel=null,this._parent=null,this._children=null},zt.prototype._initializeTimeSeriesChild=function(t){this._autoGenerated=!0;let e=t.parent;this._setParent(e),this.initialize(t)},zt.prototype.initialize=function(t){if(!t)return;let e,i,n,o,r=t.field,s=Et.get(r);if(s&&s!==t){let e=t;for(n in t={},s)t[n]=s[n];for(n in e)t[n]=e[n]}if(o=t.formulaEngine,o&&o.addFormula&&(this._fnEngine=o),o=t.formulaReference,o&&(this._formulaRef=o+""),o=t.require||t.requiredFields,null!=o&&("string"==typeof o?this._requiredFields=o.split(" "):Array.isArray(o)&&(this._requiredFields=o.slice())),this._setField(r,t),o=t.name||t.title,null!=o&&(this._name=o,this._defaultName=!1),o=t.dataType,null!=o&&(this._dataType=o),o=t.notRealTimeField,null!=o&&Et.setFieldProperty(r,"IsRealtimeField",!o),o=t.tooltip,null!=o&&(this._tooltip=o),o=t.headerAlignment||t.titleAlignment,null!=o&&(this._headerAlignment=function(t){if(t){let e=t.charAt(0).toLowerCase();if("l"===e)return"left";if("r"===e)return"right";if("c"===e)return"center"}return""}(o)),o=t.headerBinding||t.headerRenderer,void 0!==o&&(this._headerRenderer=o),o=t.binding||t.renderer,o||(o=t.formatter),void 0!==o)if(o instanceof Array)for(i=o.length,e=0;e<i;++e)this.addRenderer(o[e]);else o?"function"==typeof o?this.setRenderer(o):o.binding&&this.setRenderer(o.binding):this.setRenderer(null);o=t.rowSorting,null!=o&&(this._rowSorting=!!o),o=t.sortLogic||t.sortingLogic||t.sorter,void 0!==o&&this.setSorter(o),o=t.sortable,null!=o&&(this._sortable=!!o),o=t.focusable,null!=o&&(this._focusable=!!o),o=t.className||t.class,"string"==typeof o&&(this._classes=o.split(" ")),o=t.sortOrder||t.sort,o&&(this._initialOrder=o),o=t.textSelect,o&&(this._textSelect=o),o=t.info,o&&(this._info=o),this._userModel=t},zt.prototype.getId=function(){return this._coreColDef&&this._coreColDef.id||""},zt.prototype.getRequireFields=function(){return this._requiredFields},zt.prototype.getRequiredFields=zt.prototype.getRequireFields,zt.prototype.getRenderer=function(){return this._internalRenderer},zt.prototype.getHeaderRenderer=function(){return this._headerRenderer},zt.prototype.getName=function(){return this._defaultName?this._defaultField?"Column "+this.getId():this.getField():this._name},zt.prototype.isDefaultName=function(){return this._defaultName},zt.prototype.getFieldDefinition=function(){return Et.get(this.getField())},zt.prototype.getFieldDataType=function(){let t=this.getFieldDefinition();return t&&t.fieldDataType?t.fieldDataType:""},zt.prototype.getDataType=function(){if(this._dataType)return this._dataType;let t=this.getFieldDataType();return t?Pt[t.toUpperCase()]:""},zt.prototype.setDataType=function(t){let e=Pt[t.toUpperCase()];e&&(t=e),this._dataType=t},zt.getDataType=function(t){let e=Et.get(t);if(e){let t=e.fieldDataType?e.fieldDataType.toUpperCase():null;return Pt[t]?Pt[t]:""}return""},zt.prototype.getTooltip=function(){if(null!=this._tooltip){if("string"==typeof this._tooltip)return this._tooltip;if(!this._tooltip)return""}let t=this.getName();if(t)return t;let e=this.getField();return e||""},zt.prototype.getField=function(){return this._coreColDef&&this._coreColDef.field||""},zt.prototype.getAllFields=function(){let t=this.getField();return t?this._requiredFields.concat(t):this._requiredFields.slice()},zt.prototype.isRealTimeField=function(){return Et.isRealTimeField(this.getField()||this._field)},zt.prototype.isTimeSeries=function(){return Et.isTimeSeries(this.getField())},zt.prototype.isTimeSeriesChild=function(){return Et.isTimeSeriesChild(this.getField())},zt.prototype.isFormulaField=function(){return!!this._formula},zt.isFormulaField=function(t){return Et.isFormula(t)},zt.isAdcField=function(t){return Et.isAdc(t)},zt.isRealTimeField=function(t){return Et.isRealTimeField(t)},zt.getRealTimeFields=function(t,e){e.isRealTimeField()&&t.push(e.getField());let i=e.getRequiredFields(),n=i.length;for(let e=0;e<n;++e){let n=i[e];zt.isRealTimeField(n)&&t.push(n)}return t},zt.prototype.isSortable=function(){return this._sortable},zt.prototype.isScalable=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnScalability(e)},zt.prototype.getInitialSortOrder=function(){return this._initialOrder},zt.prototype.getWidth=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnWidth(e)},zt.prototype.getMinWidth=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getMinimumColumnWidth(e)},zt.prototype.getTextAlign=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnAlignment(e)},zt.prototype.isFieldEmpty=function(){return!this.getField()},zt.prototype.getHeaderAlignment=function(){return this._headerAlignment||""},zt.prototype.getClasses=function(){return this._classes},zt.prototype.getConfigObject=function(t){let e=t||{};if(this._info&&(e.info=this._info),null==e.field&&!this._defaultField){let t=this.getField();t&&(e.field=t)}let i=this.getDataType();i&&(e.dataType=i),this._formulaRef&&(e.formulaReference=this._formulaRef),this._requiredFields&&this._requiredFields.length&&(e.require=this._requiredFields),this._defaultName||(e.name=this.getName()),i=!1===Et.getFieldProperty(this.getField(),"IsRealtimeField"),i&&(e.notRealTimeField=i),null!=this._tooltip&&(e.tooltip=this._tooltip),null!=this._rowSorting&&(e.rowSorting=this._rowSorting),this._sortable||(e.sortable=!1);let n=this._classes;n&&n.length>0&&(e.className=n.join(" ")),this._textSelect&&(e.textSelect=this._textSelect),this._headerAlignment&&(e.headerAlignment=this._headerAlignment),this._autoGenerated&&(e.autoGenerated=this._autoGenerated),this._focusable&&(e.focusable=!0);let o=this._eventArg.core,r=this._eventArg.grid.getColumnIndex(this),s=o.getColumnScalability(r),l=o.getColumnCustomLaneSize(r);return!0===s&&1===l||(e.scalable=s,e.width=l),i=o.getMinimumColumnWidth(r),i>0&&(e.minWidth=i),null==e.hidden&&(o.getColumnVisibility(r,0)||(e.hidden=!0)),i=o.getColumnAlignment(r),"default"!==i&&(e.textAlign=i),e},zt.prototype.isHidden=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return!t.isColumnVisible(e)},zt.prototype.isTextSelect=function(){return this._textSelect},zt.prototype.hide=function(t){let e=this._eventArg.core,i=this._eventArg.grid.getColumnIndex(this);e.hideColumn(i,!1!==t)},zt.prototype.setHeaderRenderer=function(t){this._headerRenderer=t},zt.prototype.setRenderer=function(t){"function"==typeof t?(this._internalRenderer=this._customRenderer,this._activatedRenderer!==t&&(this._userRenderers?this._userRenderers.length=0:this._userRenderers=[],this._userRenderers.push(t))):(this._internalRenderer=this._defaultRenderer,this._userRenderers=null)},zt.prototype.getParent=function(){return this._parent},zt.prototype._setParent=function(t){return this._parent===t||t===this||t&&(this._parent=t,this._parent._addChild(this)),!1},zt.prototype.getChildren=function(){return this._children},zt.prototype._addChild=function(t){this===t||this._children.indexOf(t)>-1||this._children.push(t)},zt.prototype.addRenderer=function(t){t&&(this._userRenderers?this._userRenderers.push(t):this.setRenderer(t))},zt.prototype.activateRenderer=function(t,e){let i=null;if(null!=t){let n=this._rendererMap;n||(n=this._rendererMap={}),"function"==typeof e?i=n[t]=e:null==e?i=n[t]:e||(i=n[t]=null)}return this._activatedRenderer=i||null,i||(i=this._userRenderers?this._userRenderers[0]:null),this.setRenderer(i),!!this._activatedRenderer},zt.prototype.getSorter=function(){return this._userSorter},zt.prototype.setSorter=function(t){this._userSorter="function"==typeof t?t:null},zt.prototype.isRowSorting=function(){return null==this._rowSorting?!Et.getFieldProperty(this.getField(),"IsRealtimeField"):!!this._rowSorting},zt.prototype.isAutoGenerated=function(){return this._autoGenerated},zt.prototype.setName=function(t){this._name=t,this._defaultName=!1},zt.prototype._setField=function(t,e){this._defaultField=null==t,t||(t=""),t=t.trim();let i=e?e.formula:"";if(this._fnEngine){let e=t.toUpperCase(),n=i||Ft.get(e);(n||zt.isFormulaField(t))&&(t=c.toUpperCase(t),this._formula=this._fnEngine.addFormula(n||t),n&&(this._formula.setAlias(t),this._fnEngine.addReference(this._formula,t)),this._retrieveNestedFields(this._formula.getFieldNames())),this._formulaRef&&(this._formulaRef=this._fnEngine.addReference(this._formula||t,this._formulaRef))}this._field=t,Et.setFieldProperty(t,"timeSeries",!!Et.isTimeSeries(t));let n=e.parent;e&&n&&Et.setFieldProperty(t,"timeSeriesParent",n.getField()),this._updateContext("field",t),this.isRealTimeField()&&this._updateContext("formattedField",t+"_FORMATTED")},zt.prototype._retrieveNestedFields=function(t){if(t)for(let e=t.length;--e>=0;){let i=t[e],n=i.toUpperCase(),o=Ft.get(n);if(o){let t=this._fnEngine.getFormula(i);t?t.addFormulaCount():(t=this._fnEngine.addFormula(o),t.setAlias(i),this._fnEngine.addReference(t,i)),this._retrieveNestedFields(t.getFieldNames())}else this._requiredFields.push(i)}},zt.prototype._defaultRenderer=function(t){let e=t.dataValue;t.cell.setContent(e?e.getData(this._field):null)},zt.prototype._customRenderer=function(t){let e=t.dataValue,i=this._eventArg;if(e){let n=e.getRowData();i.rowDef=e,i.rowData=n,i.rowIndex=t.rowIndex,i.data=n?n[this._field]:null}else i.data=null;if(i.colIndex=t.colIndex,i.cell=t.cell,i.section=t.section,this._activatedRenderer)this._activatedRenderer(i);else{let t=this._userRenderers,e=t.length;for(let n=0;n<e;++n)t[n](i)}},zt.prototype._updateContext=function(t,e){this._eventArg[t]=e},zt.prototype.getUserModel=function(){return this._userModel},zt.prototype.clearUserModel=function(){this._userModel=null},zt.prototype.setColumnInfo=function(t){this._info=t},zt.prototype.getColumnInfo=function(){return this._info},zt.prototype._setCoreColumnDef=function(t){this._coreColDef=t||null},zt.prototype.isFocusable=function(){return this._focusable};var Vt=zt;let kt=function(){this._onRequest=this._onRequest.bind(this),this._rics={},this._fields={},this._adcOptions={productId:"001"}};s.inherits(kt,a),kt.prototype._timerId=0,kt.prototype._rics,kt.prototype._fields,kt.prototype._rtk,kt.prototype._adcOptions=null,kt.prototype.setRTK=function(t){this._rtk=t},kt._mockAdc=null,kt.setMockAdc=function(t,e){kt._mockAdc||(kt._mockAdc={}),kt._mockAdc[t]=e},kt.getMockAdc=function(t){return kt._mockAdc?kt._mockAdc[t]:null},kt.clearMockAdc=function(){kt._mockAdc=null},kt.prototype.setADCOptions=function(t){let e=t.productId;e&&(this._adcOptions.productId=e)},kt.prototype.addRic=function(t){t&&!this._rics[t]&&(this._rics[t]=1,this._request())},kt.prototype.addRics=function(t){let e=t?t.length:0,i=!1;for(let n=0;n<e;++n){let e=t[n];e&&!this._rics[e]&&(this._rics[e]=1,i=!0)}return!!i&&(this._request(),!0)},kt.prototype.addField=function(t){this._addField(t)&&this._request()},kt.prototype.addFields=function(t){let e=t.length,i=0;for(let n=0;n<e;++n)i|=this._addField(t[n]);return!!i&&(this._request(),!0)},kt.prototype._addField=function(t){return kt.isValidField(t)&&!this._fields[t]?(this._fields[t]=1,1):0},kt.isValidField=function(t){return!(!t||0!==t.indexOf("TR."))},kt.prototype._request=function(){this._timerId||(this._timerId=setTimeout(this._onRequest,0))},kt.prototype._onRequest=function(){this._timerId=0;let t=window.JET;if(this._rtk){if(!this._rtk.Data)return}else if(!t||!t.ContainerDescription||"function"!=typeof t.Data)return;let e,i=Object.keys(this._rics),n=[],o=[];for(let t in this._fields)At.isTimeSeries(t)?o.push(t):n.push(t);let r,s,l=n.length,a=o.length;if((l||a)&&i.length)if(this._rics={},this._fields={},this._rtk){let t;if(o.length>0){let t=o.join(",");s={method:"select",formula:t,identifiers:i,productId:this._adcOptions.productId,output:"Col,date|,Row,In|,va,T,NoEmptyTickers"},r=this._onRTKTimeSeriesSuccess.bind(this,o);let e=kt.getMockAdc(s.formula);e?setTimeout((function(){r(e)}),10):this._rtk.Data.Adc.request(s).then(r).catch((function(t){console.log(t)}))}n.length>0&&(t=n.join(","),s={method:"select",formula:t,identifiers:i,productId:this._adcOptions.productId,output:"Col,In,va,T,NoEmptyTickers"},r=this._onRTKSuccess.bind(this,n),this._rtk.Data.Adc.request(s).then(r).catch((function(t){console.log(t)})))}else{let o=[];for(e=0;e<l;e++)o.push({name:n[e]});s={instruments:i,fields:o},r=this._onJETSuccess.bind(this,n),t.Data("datagrid").then((function(t){return t.request(s)})).then(JSON.parse).then(r).catch((function(t){console.log(t)}))}},kt.prototype._onJETSuccess=function(t,e){this._dispatch("adcDataReceived",e);let i,n,o,r=e.data,s=e.headers&&e.headers[0];if(!Array.isArray(r)||!Array.isArray(s))return;let l=1,a=t.length,u=s.length,h=new Array(u);for(i=0;i<a&&l<u;i++)n=t[i],s[l].field===n.toUpperCase()&&(h[l]=n,l++);let p=r.length,d=h.length,c={};for(i=0;i<p;i++){let t=r[i];if(o=t[0],c[o])continue;let e=c[o]={};for(l=1;l<d;l++){let i=t[l];null!=i&&""!==i&&(n=h[l],e[n]=i)}}let _={};for(o in c){let t=c[o];y(t)||(_[o]=t)}this._dispatch("dataChanged",{data:_})},kt.prototype._onRTKSuccess=function(t,e){this._dispatch("adcDataReceived",e);let i,n,o,r=e.rows,s=e.rows&&e.rows[0];if(!Array.isArray(r)||!Array.isArray(s))return;let l=1,a=t.length,u=s.length,h=new Array(u);for(i=0;i<a&&l<u;i++)n=t[i],s[l].r.toUpperCase()===n.toUpperCase()&&(h[l]=n,l++);let p=r.length,d=h.length,c={};for(i=1;i<p;i++){let t=r[i];if(o=t[0],c[o])continue;let e=c[o]={};for(l=1;l<d;l++){let i=t[l];null!=i&&""!==i&&"object"!=typeof i&&(n=h[l],e[n]=i)}}let _={};for(o in c){let t=c[o];y(t)||(_[o]=t)}this._dispatch("dataChanged",{data:_})},kt.prototype._onRTKTimeSeriesSuccess=function(t,e){this._dispatch("adcDataReceived",e);let i=e.rows,n=e.rows&&e.rows[0];if(!Array.isArray(i)||!Array.isArray(n))return;let o=n.slice(2).map(t=>t.v),r={},s=0,l=i.length;for(let e=1;e<l;e++){let n=i[e][1];r[n]||(r[n]=t[s++])}let a={},u={};for(let t=1;t<l;t++){let e=i[t],n=e[0],s=e[1];a[n]||(a[n]={});let l=a[n];if(1===o.length)l[r[s]]=e[2];else for(let t=0;t<o.length;t++){let i=r[s].replace("TR.","")+"_"+o[t],n=e[2+t];null!==n&&(u[i]=r[s],l[i]=n)}}let h={};for(let t in a){let e=a[t];y(e)||(h[t]=e)}let p={data:h};o.length>1&&(p.timeSeries=!0,p.childrenFieldToParent=u),this._dispatch("dataChanged",p)};var Ot=kt;let Nt=function(){this._groupMap={},this._childToParent={}};Nt.prototype._groupMap,Nt.prototype._childToParent,Nt.getGroupId=function(t){return t&&t.id||""},Nt.calcTreeDepth=function(t,e){let i=-1,n=e;for(;n;){if(++i>15){console.log("WARNING: Infinite loop detected during column group creation");break}n=t[n.parentId]}return i},Nt.getLeafDescendants=function(t,e){let i=t[e];if(!i)return null;let n=[],o=[i],r=0,s={};for(;r<o.length;){i=o[r++],s[i.id]=!0;let e=i.children,l=e?e.length:0;for(let r=0;r<l;++r){let l=e[r];i=t[l],i?s[i.id]||o.push(i):n.push(l)}}return n},Nt._cloneObject=function(t){let e=g(t);return Array.isArray(e.children)?e.children=e.children.slice():e.children=[],e},Nt._toGroupDefinition=function(t,e){let i=null;return t&&(i=Array.isArray(t)?{children:t.slice()}:Nt._cloneObject(t),e&&(i.id||(i.name=e),i.id=e)),i},Nt.prototype.toString=function(){let t=this._groupMap,e=[];e.push("=== groupDefs ===");for(let i in t){let n=t[i];e.push(i+": "+JSON.stringify(n,["id","parentId","children"]))}return e.push("=== childToParent ==="),e.push(JSON.stringify(this._childToParent,null,2)),e.push(""),e.join("\n")},Nt.prototype.getGroup=function(t){return t&&this._groupMap[t]||null},Nt.prototype.getDefinition=Nt.prototype.getGroup,Nt.prototype.getGroups=function(){let t=[],e=this._groupMap;for(let i in e)t.push(e[i]);return t},Nt.prototype.getGroupIds=function(){return Object.keys(this._groupMap)},Nt.prototype.getGroupMap=function(){return this._groupMap},Nt.prototype.cloneGroupMap=function(){let t=this._groupMap,e={};for(let i in t){let n=t[i],o=Nt._cloneObject(n);e[i]=o}return e},Nt.prototype.rebuildMap=function(){let t,e,i=this._groupMap,n=this._childToParent={},o=Object.keys(i),r=o.length;for(t=0;t<r;++t){e=o[t];let r=i[e].children,s=r?r.length:0;for(let t=0;t<s;t++)n[r[t]]=e}for(t=0;t<r;++t){e=o[t];let r=n[e];r&&(i[e].parentId=r)}},Nt.prototype.getGroupChildren=function(t){let e=this._groupMap[t];return e?e.children:null},Nt.prototype.getLeafDescendants=function(t){return Nt.getLeafDescendants(this._groupMap,t)},Nt.prototype.getGroupLevel=function(t){return Nt.calcTreeDepth(this._groupMap,this._groupMap[t])},Nt.prototype.getRootGroup=function(t){if(!t)return null;let e=this._groupMap,i=e[t]||null;if(i)for(;i.parentId;){let t=e[i.parentId];if(!t)break;i=t}return i},Nt.prototype.getParentGroup=function(t){return this.getGroup(this._childToParent[t])},Nt.prototype.getParentIds=function(t){if(t&&"string"==typeof t){let e=this._childToParent[t];if(e){let t=[e],i=this._groupMap[e];for(;i&&i.parentId;)i=this._groupMap[i.parentId],i&&t.push(i.id);return t}}return null},Nt.prototype.getParentId=function(t,e){let i=this._childToParent[t];if(null!=e){let t=this.getGroupLevel(i);for(;t>e&&i;)i=this._childToParent[i],t--}return i||""},Nt.prototype.removeAllGroups=function(){for(let t in this._groupMap)return this._groupMap={},this._childToParent={},!0;return!1},Nt.prototype.setGroups=function(t){let e=this._groupMap={},i=t?t.length:0;for(let n=0;n<i;n++){let i=t[n],o=i.id;o&&(e[o]=Nt._cloneObject(i))}this.rebuildMap()},Nt.prototype.addGroup=function(t){let e=Nt.getGroupId(t);return e?this.setGroup(e,t):e},Nt.prototype.removeGroup=function(t){return!!this._groupMap[t]&&(this.removeAllChildren(t),this.unsetParent(t),delete this._groupMap[t],!0)},Nt.prototype.setGroup=function(t,e){if(!t)return"";if(e){let i=Nt._toGroupDefinition(e,t);this._ungroupChildren(i.children),this._groupMap[t]&&this.removeAllChildren(t);let n=this._childToParent[t];n&&(i.parentId=n.id),this._groupMap[t]=i;let o=i.children,r=o.length;for(let e=0;e<r;++e){let i=o[e];this._childToParent[i]=t;let n=this._groupMap[i];n&&(n.parentId=t)}}else if(!this.removeGroup(t))return"";return t},Nt.prototype._ungroupChildren=function(t){if(Array.isArray(t)){let e=t.length;for(let i=0;i<e;++i)this.unsetParent(t[i])}},Nt.prototype.hasGroupChild=function(t,e){let i=this._groupMap[t];if(e&&i){let t=i.children;if(t)return t.indexOf(e)>=0}return!1},Nt.prototype.contains=function(t,e){if(t&&e){if(t===e)return!0;let i=20,n=this._childToParent[e];for(;n&&i;){if(t===n)return!0;--i,n=this._childToParent[n]}}return!1},Nt.prototype.addGroupChild=function(t,e,i){let n=this._groupMap[t];if(e&&n){let o=n.children;if(o&&o.indexOf(e)<0){this.unsetParent(e),this._childToParent[e]=t;let n=this._groupMap[e];return n&&(n.parentId=t),null!=i&&i>=0?o.splice(i,0,e):o.push(e),!0}}return!1},Nt.prototype.removeGroupChild=function(t,e){return null==e?this.unsetParent(t):!!this.hasGroupChild(t,e)&&this.unsetParent(e)},Nt.prototype.unsetParent=function(t){let e=this._childToParent[t];if(!e)return!1;this._childToParent[t]="";let i=this._groupMap[t];i&&(i.parentId="");let n=this._groupMap[e];if(n){let e=n.children;if(e&&e.length){let i=e.indexOf(t);i>=0&&e.splice(i,1)}}return!0},Nt.prototype.removeAllChildren=function(t){let e=this._groupMap[t];if(e){let t=e.children,i=t?t.length:0;if(i){e.children=[];for(let e=0;e<i;++e){let i=t[e];this._childToParent[i]&&(this._childToParent[i]="");let n=this._groupMap[i];n&&(n.parentId="")}return!0}}return!1},Nt.prototype.setGroupChildren=function(t,e){let i=this._groupMap[t];if(i){if(Array.isArray(e)){let n=e.slice();this._ungroupChildren(n),this.removeAllChildren(t),i.children=n;let o=i.id,r=n.length;for(let t=0;t<r;++t){let e=n[t];this._childToParent[e]=o;let i=this._groupMap[e];i&&(i.parentId=o)}return!0}if(!e&&i.children.length)return this.removeAllChildren(t),!0}return!1},Nt.prototype.getGroupName=function(t){let e=this._groupMap[t];return e&&e.name||""},Nt.prototype.setGroupName=function(t,e){let i=this._groupMap[t];return!(!i||i.name===e)&&(i.name=e,!0)};let Ht=function(t){this._element=t||document.createElement("div")};l.inherits(Ht,lt),Ht.prototype._element=null,Ht.prototype._content=null,Ht.prototype._textSpan=null,Ht.prototype._nativeEvents=null,Ht._passiveEvents=null,Ht.prototype.getContent=function(t){return t?this._element.children:this._element.lastChild},Ht.prototype.setContent=function(t,e){if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?(nt.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},Ht.prototype.addContent=function(t){return null==(t=nt.getElement(t))?null:(this._content=this._element.children,this._element.appendChild(t),t)},Ht.prototype.removeContent=function(t){return null!=(t=nt.getElement(t))&&(this._content=this._element.children,this._element.removeChild(t),!0)},Ht.prototype.listen=function(t,e,i){if(this._customEvents&&this._customEvents[t])return void this._customEvents[t].listen(e,i);this._nativeEvents||(this._nativeEvents={});let n=this._nativeEvents[t];if(!n){if(n=new rt,this._nativeEvents[t]=n,n.dispatch=n.dispatch.bind(n),!Ht._passiveEvents){let t=!1;try{let e=Object.defineProperty({},"passive",{get:function(){return t=!0,!1}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(t){}if(t){let t={passive:!0};Ht._passiveEvents={touchstart:t,touchmove:t}}else Ht._passiveEvents={}}this._element.addEventListener(t,n.dispatch,Ht._passiveEvents[t]||!1)}n.listen(e,i)},Ht.prototype.unlisten=function(t,e){if(this._customEvents&&this._customEvents[t])this._customEvents[t].unlisten(e);else if(this._nativeEvents){let i=this._nativeEvents[t];i&&i.unlisten(e)}},Ht.prototype.unlistenAll=function(t){if(this._customEvents)if(t)this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(let t in this._customEvents)this._customEvents[t].unlistenAll();if(this._nativeEvents)if(t)this._nativeEvents[t]&&(this._unlistenAll(t),delete this._nativeEvents[t]);else{for(let t in this._nativeEvents)this._unlistenAll(t);this._nativeEvents=null}},Ht.prototype._unlistenAll=function(t){let e=this._nativeEvents[t];this._element.removeEventListener(t,e.dispatch,!1),e.unlistenAll()},Ht.prototype.dispose=function(){this._dispose()},Ht.prototype._dispose=function(){this.setParent(null),this.unlistenAll(),this._element=this._content=this._textSpan=null,this._customEvents=this._nativeEvents=null},Ht.prototype.setEventArgExtender=function(t,e){if(this._customEvents){let i=this._customEvents[t];i&&i.setEventArgExtender(e)}},Ht.prototype.getElement=function(){return this._element},Ht.prototype.getNextSibling=function(){return this._element.nextSibling},Ht.prototype.getParent=function(){return this._element.parentNode},Ht.prototype.setParent=function(t,e){this._setParent(t,e)},Ht.prototype._setParent=function(t,e){null!==(t=nt.getElement(t))?e?t.insertBefore(this._element,t.firstChild):t.appendChild(this._element):null!==this._element.parentNode&&this._element.parentNode.removeChild(this._element)},Ht.prototype.insertBefore=function(t){this._insertBefore(t)},Ht.prototype._insertBefore=function(t){if(null==(t=nt.getElement(t)))return void this.setParent(this.getParent());let e=t.parentNode;null!=e&&e.insertBefore(this._element,t)},Ht.prototype.insertAfter=function(t){(t=nt.getElement(t))?t.nextSibling?this.insertBefore(t.nextSibling):this.setParent(t.parentNode):this.setParent(this.getParent(),!0)},Ht.prototype.hasClass=function(t){return!!this._element&&this._element.classList.contains(t)},Ht.prototype.addClass=function(t){this._element&&this._element.classList.add(t)},Ht.prototype.removeClass=function(t){this._element&&this._element.classList.remove(t)},Ht.prototype.toggleClass=function(t,e){let i=this._element;i&&(null==e&&(e=!i.classList.contains(t)),e?i.classList.add(t):i.classList.remove(t))},Ht.prototype.enableClass=function(t,e){!1!==e?this.addClass(t):this.removeClass(t)},Ht.prototype.getClass=function(){return this._element.className},Ht.prototype.setClass=function(t){this._element.className=t},Ht.prototype.getAttribute=function(t){return this._element.getAttribute(t)},Ht.prototype.setAttribute=function(t,e){this._element.setAttribute(t,e)},Ht.prototype.setAttributes=function(t){for(let e in t)this._element.setAttribute(e,t[e])},Ht.prototype.removeAttribute=function(t){this._element.removeAttribute(t)},Ht.prototype.getStyle=function(t){return this._element.style[t]},Ht.prototype.setStyle=function(t,e){this._element.style[t]=e},Ht.prototype.setStyles=function(t){let e=this._element.style;for(let i in t)e[i]=t[i]},Ht.prototype.getId=function(){return this._element.id},Ht.prototype.setId=function(t){this._element.id=t},Ht.prototype.toString=function(){let t=this._element.outerHTML;return t=t.replace(this._element.innerHTML,""),t},Ht.prototype.getTextContent=function(){return this._element.textContent},Ht.prototype.setTextContent=function(t){this._element.textContent=t},Ht.prototype.getLeft=function(){return this._element.offsetLeft},Ht.prototype.setLeft=function(t){return this._element.style.left=t+"px",!0},Ht.prototype.getTop=function(){return this._element.offsetTop},Ht.prototype.setTop=function(t){return this._element.style.top=t+"px",!0},Ht.prototype.getWidth=function(){return this._element.offsetWidth},Ht.prototype.setWidth=function(t){return this._element.style.width=t+"px",!0},Ht.prototype.getHeight=function(){return this._element.offsetHeight},Ht.prototype.setHeight=function(t){return t<0&&(t=0),this._element.style.height=t+"px",!0},Ht.prototype.getBoundingClientRect=function(){return this._element.getBoundingClientRect()},Ht.prototype.fillParentWidth=function(t){return null==t&&(t=100),this._element.style.width=t+"%",!0},Ht.prototype.fillParentHeight=function(t){return null==t&&(t=100),this._element.style.height=t+"%",!0},Ht.prototype.getTooltip=function(){return this.getAttribute("title")},Ht.prototype.setTooltip=function(t){t?this.setAttribute("title",t):this.removeAttribute("title")},Ht.prototype.show=function(t){this._element.style.display=!1!==t?"":"none"},Ht.prototype.hide=function(t){this.show(!1===t)},Ht.prototype.isVisible=function(){return"none"!==this._element.style.display},Ht.prototype.enable=function(t){(t=!1!==t)?this.removeAttribute("disabled"):(this.setAttribute("disabled","disabled"),this._element.disabled=!t)},Ht.prototype.disable=function(t){this.enable(!1===t)},Ht.prototype.isEnabled=function(){return!this._element.hasAttribute("disabled")},Ht.prototype.getScrollLeft=function(){return this._element.scrollLeft},Ht.prototype.getScrollTop=function(){return this._element.scrollTop},Ht.prototype.isEndOfHorizontalScroll=function(){return this._element.scrollLeft>=this._element.scrollWidth-this.getWidth()},Ht.prototype.isEndOfVerticalScroll=function(){return this._element.scrollTop>=this._element.scrollHeight-this.getHeight()},Ht._proto=Ht.prototype;var Bt=Ht;let Gt=function(){this._items=[],this._element=null};l.inherits(Gt,Bt),Gt.prototype._items=[],Gt.prototype.hasItem=function(){return!!this._items.length},Gt.prototype.containItem=function(t){return this._items.indexOf(t)>-1},Gt.prototype.insertItem=function(t,e){let i=this._items;i.indexOf(t)>-1||(i.push(t),e&&(t._order=e),i.length&&i.sort(Gt._iconComparer),this._updatePanelItems())},Gt.prototype.removeItem=function(t){let e=this._items,i=-1;if(t)for(let n=e.length;--n>=0;){let o=e[n];if("string"==typeof t){if(o.classList.contains(t)){i=n;break}}else if(o===t){i=n;break}}else i=e.length-1;let n=null;return i>-1&&(n=e.splice(i,1)[0]),this._updatePanelItems(),n},Gt.prototype.clearItems=function(){let t=this._items;t.length&&(t.length=0,this._updatePanelItems())},Gt._iconComparer=function(t,e){return t._order?e._order?t._order-e._order:1:e._order?-1:0},Gt.prototype._updatePanelItems=function(){let 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(let i=0;i<t.length;i++)e.appendChild(t[i])}};var Wt=Gt;let Ut=function(t,e){this._id=Ut._runningId++,this._element=document.createElement("div"),this._element.className="cell",e&&(this._section=e)};l.inherits(Ut,Bt),Ut.prototype._aligner=null,Ut._runningId=0,Ut.prototype._id=0,Ut.prototype._width=-1,Ut.prototype._height=-1,Ut.prototype._visible=!0,Ut.prototype._rawContent,Ut.prototype._section=null,Ut.prototype._contentLocked=!1,Ut.prototype._collapsedState=0,Ut.prototype._floatingPanel=null,Ut.prototype._frontIcon=null,Ut.prototype.getContent=function(t){return t&&this._element?this._element.children:this._content||null},Ut.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){let t=this._aligner.firstChild;t!==this._content&&(this._rawContent=t,this._content=t)}let i=this._setRawContent(t);return null!=e&&this._content&&this._content.setAttribute("title",e),i},Ut.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)))},Ut.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},Ut.prototype.getNextSibling=function(){return null!==this._element?this._element.nextSibling:null},Ut.prototype.getParent=function(){return null!==this._element?this._element.parentNode:null},Ut.prototype.setParent=function(t,e){let i=nt.getElement(t);if(i){if(this.initialize(),1===this._collapsedState)return;let t;!0===e&&(t=i.firstChild),t?i.insertBefore(this._element,t):i.appendChild(this._element)}else this.removeParent()},Ut.prototype.removeParent=function(){let t=this._element;t&&t.parentNode&&t.parentNode.removeChild(t)},Ut.prototype.insertBefore=function(t){let e=nt.getElement(t);if(null==e)return void this.setParent(this.getParent());let i=e.parentNode;null!=i&&(this.initialize(),i.insertBefore(this._element,e))},Ut.prototype.getTextContent=function(){return this._rawContent?"string"==typeof this._rawContent?this._rawContent:this._rawContent.textContent:""},Ut.prototype.getTextElement=function(){return this._textSpan},Ut.prototype.getWidth=function(){return this._width>=0?this._width:this._element.offsetWidth},Ut.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)},Ut.prototype.getHeight=function(){return this._height>=0?this._height:this._element.offsetHeight},Ut.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)},Ut.prototype.fillParentWidth=function(t){return!1},Ut.prototype.fillParentHeight=function(t){return!1},Ut.prototype.show=function(t){let e=!1!==t;e!==this._visible&&(this._visible=e,this._updateDisplay())},Ut.prototype.isVisible=function(){return this._visible},Ut.prototype.getScrollLeft=function(){return 0},Ut.prototype.getScrollTop=function(){return 0},Ut.prototype.isEndOfHorizontalScroll=function(){return!0},Ut.prototype.isEndOfVerticalScroll=function(){return!0},Ut.prototype.hasElement=function(){return null!==this._element},Ut.prototype.getSection=function(){return this._section},Ut.prototype.initialize=function(){return null==this._aligner&&(nt.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},Ut.prototype.updateIcon=function(t){if(!t)return;let e=this._frontIcon;if(e){if(e.containItem(t))return;e.clearItems()}this.insertFrontIcon(t,0)},Ut.prototype.removeIcon=function(){let t=this._frontIcon;t&&(t.clearItems(),this._element.removeChild(t.getElement()),t=this._frontIcon=null)},Ut.prototype.isFrozen=nt._deprecatedFunction,Ut.prototype.freezeLayout=nt._deprecatedFunction,Ut.prototype.setAutoContentClipping=nt._deprecatedFunction,Ut.prototype.setContentTooltip=function(t){return!(null==t||!this._content)&&(this._content.setAttribute("title",t),!0)},Ut.prototype.lockContent=function(t){this._contentLocked=!1!==t},Ut.prototype.reset=function(){if(!this._element)return;let 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();let i=this.blinkState;i&&(i.timerId>=0&&clearInterval(i.timerId),delete this.blinkState),delete this.trendState;let n=this.blinking;n&&(n.blinking>=0&&clearTimeout(n.blinking),n.cell=null,n.styles=null,delete this.blinking),this.removeIcon(),this.setContent(null),this._textSpan&&(this._textSpan.className="text",this._textSpan.textContent="")},Ut.prototype.resetClass=function(){let t="cell";this.hasClass("spanned")&&(t+=" spanned"),this.hasClass("selected-row")&&(t+=" selected-row"),this.hasClass("highlighted-row")&&(t+=" highlighted-row"),this.setClass(t)},Ut.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)},Ut.prototype.insertFloatingIcon=function(t,e){if(!t)return;let i=this._floatingPanel;i||(i=this._floatingPanel=new Wt),i.insertItem(t,e),i.addClass("floating-panel");let n=this._element;n.contains(i.getElement())||n.appendChild(i.getElement())},Ut.prototype.removeFloatingIcon=function(t){let e=this._floatingPanel;if(!e)return null;let i=e.removeItem(t);return e.hasItem()||(this._element.removeChild(e.getElement()),this._floatingPanel=null),i},Ut.prototype.insertFrontIcon=function(t,e){if(!t)return;let i=this._frontIcon;i||(i=this._frontIcon=new Wt),i.insertItem(t,e),i.addClass("front-panel");let n=this._element;n.contains(i.getElement())||n.insertBefore(i.getElement(),n.firstChild)},Ut.prototype.removeFrontIcon=function(t){let e=this._frontIcon;if(!e)return null;let i=e.removeItem(t);return e.hasItem()||(i=e.getElement(),this._element.removeChild(i),this._frontIcon=null),i},Ut.prototype.getCellId=function(){return this._id},Ut.prototype.updatePadding=function(){},Ut.prototype.collapse=function(t,e){let i,n=!1!==t;return i=n?e?2:1:0,this._collapsedState!==i&&(n?e?this.addClass("spanned"):this.setParent(null):2===this._collapsedState&&this.removeClass("spanned"),this._collapsedState=i,!0)},Ut.prototype.isCollapsed=function(){return 0!==this._collapsedState},Ut.prototype.isKeptInDoc=function(){return 1!==this._collapsedState},Ut.prototype.getClientWidth=function(){return this._element?this._element.clientWidth:this.getWidth()},Ut.prototype.getClientHeight=function(){return this._element?this._element.clientHeight:this.getHeight()},Ut.prototype._setRawContent=function(t){if(this._rawContent!==t){this._rawContent=t;let 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();let t=this._aligner;for(;t.lastChild;)t.removeChild(t.lastChild);this._content&&t.appendChild(this._content)}}return this._content},Ut.prototype._updateDisplay=function(){let t=!1;this.isVisible()&&this._width&&this._height&&(t=!0),this._element.style.display=t?"":"none"},Ut._proto=Ut.prototype;var Yt=Ut;let qt=function(){this._ends=[],this._cols=[]};qt.prototype._laneCount=0,qt.prototype._defaultSize=10,qt.prototype._defaultScalability=!0,qt.prototype._homogeneous=!0,qt.prototype._visibility=!0,qt.prototype._ends,qt.prototype._cols,qt.prototype._bits=[1,2,4,8],qt.prototype.hitTest=function(t){if(t<0)return-1;if(t>=this.getTrackSize())return~this._laneCount;let e=-1,i=0;if(this._homogeneous){let n=this._defaultSize;e=Math.floor(t/n),i=(e+1)*n}else e=nt.upperBound(this._ends,t),i=this._ends[e];return(e>=this._laneCount||t>=i)&&(e=~e),e},qt.prototype.dispose=function(){this._cols=this._ends=null},qt.prototype.isAtDefaultSize=function(t){if(this._homogeneous)return!0;if(null!=t){if(!this._isAtDefaultSize(t))return!1}else{for(let t=this._cols.length;--t>=0;)if(!this._isAtDefaultSize(t))return!1;this._homogeneous=!0}return!0},qt.prototype._isAtDefaultSize=function(t){let 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},qt.prototype.isHomogeneous=function(){return this._homogeneous},qt.prototype.isAtMinimumSize=function(t){let e=this._getMinimumScalingSize(t);return(null!=t?this.getLaneSize(t):this.getTrackSize())<=e},qt.prototype.isFixedSize=function(){for(let t=0;t<this._laneCount;++t)if(this.getLaneScalability(t))return!1;return!0},qt.prototype.clearLaneCustomizations=function(){this._ends.length=0,this._cols.length=0,this._homogeneous=!0},qt.prototype.getLaneCount=function(){return this._laneCount},qt.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))},qt.prototype.getDefaultLaneSize=function(){return this._defaultSize},qt.prototype.setDefaultLaneSize=function(t){return t<0&&(t=0),this._defaultSize!==t&&(this._defaultSize=t,this._markDirtyIndex(0),!0)},qt.prototype.getLaneDefaultSize=function(t){if(t<0||t>=this._laneCount)return-1;let e=this._newColumn(t);return e.defaultSize?e.defaultSize:-1},qt.prototype.setLaneDefaultSize=function(t,e){if(!(t<0||t>=this._laneCount)&&e>=0){this._newColumn(t).defaultSize=e}},qt.prototype.resetLaneToDefaultSize=function(){let t=!1;for(let e=0;e<this._laneCount;++e){let 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},qt.prototype.getDefaultScalability=function(){return this._defaultScalability},qt.prototype.setDefaultScalability=function(t){return this._defaultScalability!==t&&(this._defaultScalability=t,!0)},qt.prototype.getTrackSize=function(){return!this._visibility||this._laneCount<=0?0:this._homogeneous?this._laneCount*this._defaultSize:(this._updateEndPoints(),this._ends[this._laneCount-1])},qt.prototype.setTrackSize=function(t){let e=0,i=0,n=[];for(e=0;e<this._laneCount;++e){let t=this._cols[e];t?t.invisibility||(!1!==this._getLaneScalability(t)?n.push(e):i+=this._getFixedSize(t)):n.push(e)}if(n.length<=0)return null;let o=this._distributeLaneSize(t-i,n),r=!1,s=[];for(e=o.length;--e>=0;){s[e]=0;let t=o[e];if(null!=t){let i=this.getLaneSize(e);this._newColumn(e),this._setCalculatedLaneSize(e,t)&&(s[e]=t-i,r=!0)}}return r?s:null},qt.prototype.getLaneStart=function(t){if(t<=0)return 0;if(this._homogeneous)return t*this._defaultSize;this._updateEndPoints();let e=t-this._laneCount,i=0;return e>0&&(t-=e,i=e*this._defaultSize),this._ends[t-1]+i},qt.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]))},qt.prototype.getLaneSize=function(t){if(this._visibility){let e=this._cols[t];return e?e.actualSize:this._defaultSize}return 0},qt.prototype.getCustomLaneSize=function(t){let e=this._cols[t];return e&&null!=e.customSize?e.customSize:this._defaultSize},qt.prototype.setLaneSize=function(t,e){if(t<0||t>=this._laneCount)return!1;if(e<0||e!=e)return!1;let i=this._cols[t];return(null==i||i.customSize!==e)&&(i=this._newColumn(t),i.customSize=e,this._setCalculatedLaneSize(t,e))},qt.prototype.setLaneProperty=function(t,e,i){if(t<0||t>=this._laneCount)return!1;let n=this._cols[t];return(null==n||n[e]!==i)&&(n=this._newColumn(t),n[e]=i,!0)},qt.prototype.getLaneProperty=function(t,e){let i=this._cols[t];return i&&null!=i[e]?i[e]:null},qt.prototype.getMinimumLaneSize=function(t){let e=this._cols[t];return e&&null!=e.minSize?e.minSize:0},qt.prototype.setMinimumLaneSize=function(t,e,i){if(t<0||t>=this._laneCount)return!1;if(e<0&&(e=0),this.getMinimumLaneSize(t)!==e){let n=this._newColumn(t);return n.minSize=e,i&&this.getLaneScalability(t)&&(n.customSize=e),this._setCalculatedLaneSize(t)}return!1},qt.prototype.isLaneVisible=function(t){let e=this._cols[t];return!e||!e.invisibility},qt.prototype.showLane=function(t,e){return this.hideLane(t,!1===e)},qt.prototype.hideLane=function(t,e,i){if(t<0||t>=this._laneCount)return!1;let n=this._newColumn(t),o=!n.invisibility,r=null!=i?this._bits[i]:1;return!1!==e?n.invisibility|=r:n.invisibility&=~r,o!==!n.invisibility&&this._setCalculatedLaneSize(t)},qt.prototype.getLaneVisibilityBit=function(t,e){if(t>=0&&t<this._laneCount){let i=this._cols[t];if(i){let t=null!=e?this._bits[e]:1;if(i.invisibility&t)return!1}}return!0},qt.prototype.show=function(t){if(t=!1!==t,this._visibility!==t)if(this._visibility=t,t)for(let t=0;t<this._laneCount;++t)this._newColumn(t),this._setCalculatedLaneSize(t);else this._markDirtyIndex(0)},qt.prototype.getLaneScalability=function(t){let e=this._cols[t];return e&&null!=e.scalability?e.scalability:this._defaultScalability},qt.prototype.setLaneScalability=function(t,e){if(t<0||t>=this._laneCount)return!1;let i=this._cols[t];return(!i||i.scalability!==e)&&(i=this._newColumn(t),i.scalability=e,!0)},qt.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);let i=this.serializeLane(t);return this._cols.splice(t,e),this._laneCount-=e,i},qt.prototype.insertLane=function(t,e){t<0&&(t=0);let i=1;if(nt.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),nt.insertEmptyItems(this._cols,t,i),e){let n=t+i;for(let i=t;i<n;++i)this.deserializeLane(i,e)}},qt.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)return;let i=t<e?t:e;this._markDirtyIndex(i),nt.moveArrayItem(this._cols,t,e)},qt.prototype.serializeLane=function(t){if(t<0||t>=this._laneCount)return null;let e={};e.index=t;let i=this._cols[t];return i?(e.size=i.customSize,e.minSize=i.minSize,e.visible=!i.invisibility,e.scalable=i.scalability,e):e},qt.prototype.deserializeLane=function(t,e){if(!e)return;if(t<0||t>=this._laneCount)return;let i=e.size;null!=i&&this.setLaneSize(t,i),i=e.minSize,null!=i&&this.setMinimumLaneSize(t,i),i=e.visible,null!=i&&this.showLane(t,i),i=e.scalable,null!=i&&this.setLaneScalability(t,i)},qt.prototype._updateEndPoints=function(){let t=this._ends.length;if(t>=this._laneCount)return;this._ends.length=this._laneCount;let 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},qt.prototype._setCalculatedLaneSize=function(t,e){let i=this._cols[t];if(this._visibility&&!i.invisibility){if(null==e&&(e=null!=i.customSize?i.customSize:this._defaultSize),!i.scalability){let t=null!=i.minSize?i.minSize:0;e<t&&(e=t)}}else e=0;return i.actualSize!==e&&(i.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(t),!0)},qt.prototype._getMinimumScalingSize=function(t){let e=0;if(null!=t){let e=this._cols[t];if(!e.invisibility&&null!=e.minSize)return!1===this._getLaneScalability(e)&&null!=e.customSize&&e.customSize>e.minSize?e.customSize:e.minSize}else for(let t=this._laneCount;--t>=0;)e+=this._getMinimumScalingSize(t);return e},qt.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},qt.prototype._getLaneScalability=function(t){return null==t.scalability?this._defaultScalability:t.scalability},qt.prototype._distributeLaneSize=function(t,e){if(e.length<=0)return[];t<0&&(t=0);let i=0,n=0,o=0,r=0,s=[],l=[],a=[];for(i=e.length;--i>=0;)o=e[i],s[o]=this.getMinimumLaneSize(o),l[o]=this.getCustomLaneSize(o),n+=l[o];let u=!0;for(;u;)for(u=!1,i=e.length;--i>=0;){o=e[i];let h=s[o],p=l[o];r=t*p/n,r<=h&&(u=!0,a[o]=h,t-=h,n-=p,e.splice(i,1))}let h=e.length-1,p=0,d=0;for(i=h;--i>=0;){o=e[i],r=t*l[o]/n;let s=Math.floor(r);d+=r-s,d>=1&&(++s,--d),a[o]=s,p+=s}return a[e[h]]=Math.floor(t-p),a},qt.prototype._markDirtyIndex=function(t){t<this._ends.length&&(this._ends.length=t)},qt.prototype._newColumn=function(t){let e=this._cols[t];return e||(this._cols[t]=e={},e.invisibility=0),e},qt.prototype.copyFrom=function(t,e){if(this._homogeneous&&t._homogeneous&&this._defaultSize===t._defaultSize)return;e||(e=0);let i=t.getLaneCount(),n=this.getLaneCount(),o=e+i;o>n&&(o=n);let r=0;for(let i=e;i<o;++i){let e=t.getLaneSize(r++),n=this._newColumn(i);n.customSize!==e&&(n.customSize=e,n.actualSize!==e&&(n.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(i)))}};var Xt=qt;let jt=function(){};jt.prototype.hitTest=function(t,e,i){},jt.prototype.hitTestX=function(t){},jt.prototype.hitTestY=function(t){},jt.prototype.getDefaultColumnWidth=function(){},jt.prototype.setDefaultColumnWidth=function(t){},jt.prototype.getDefaultRowHeight=function(){},jt.prototype.setDefaultRowHeight=function(t){},jt.prototype.getColumnWidth=function(t){},jt.prototype.setColumnWidth=function(t,e){},jt.prototype.getRowHeight=function(t){},jt.prototype.setRowHeight=function(t,e){},jt.prototype.isColumnVisible=function(t){},jt.prototype.hideColumn=function(t,e){},jt.prototype.isRowVisible=function(t){},jt.prototype.hideRow=function(t,e){},jt.prototype.getMinimumColumnWidth=function(t){},jt.prototype.setMinimumColumnWidth=function(t,e){},jt.prototype.getMinimumRowHeight=function(t){},jt.prototype.setMinimumRowHeight=function(t,e){},jt.prototype.getCellLeft=function(t){},jt.prototype.getCellTop=function(t){},jt.prototype.getCellWidth=function(t,e){},jt.prototype.getCellHeight=function(t,e){},jt.prototype.hasCellSpan=function(){},jt.prototype.getCellRowSpan=function(t,e){},jt.prototype.setCellRowSpan=function(t,e,i){},jt.prototype.getCellColSpan=function(t,e){},jt.prototype.setCellColSpan=function(t,e,i){},jt.prototype.clearCellSpans=function(){},jt.prototype.clearColumnSpans=function(t){},jt.prototype.clearColumnCustomizations=function(){},jt.prototype.clearRowCustomizations=function(){},jt.prototype.getColumnScalability=function(t){},jt.prototype.setColumnScalability=function(t,e){},jt.prototype.getRowScalability=function(t){},jt.prototype.setRowScalability=function(t,e){},jt.prototype.getCell=function(t,e,i){},jt.prototype.getCellContent=function(t,e){},jt.prototype.setCellContent=function(t,e,i){},jt.prototype.getColumn=function(t){},jt.prototype.getColumnCount=function(){},jt.prototype.setColumnCount=function(t){},jt.prototype.getRowCount=function(){},jt.prototype.setRowCount=function(t,e){},jt.prototype.getVisibleRowCount=function(){},jt.prototype.addRow=function(t){},jt.prototype.removeRow=function(t){},jt.prototype.setBorders=function(t,e,i,n){},jt.prototype.getColumnStyle=function(t,e){},jt.prototype.setColumnStyle=function(t,e,i){},jt.prototype.enableColumnClass=function(t,e,i){},jt.prototype.hasColumnClass=function(t,e){},jt.prototype.enableRowClass=function(t,e,i){},jt.prototype.setRowStyle=function(t,e,i,n){},jt.prototype.getRelativePosition=function(t){},jt.prototype.getContentWidth=function(){},jt.prototype.getContentHeight=function(){},jt.prototype.getCellsByRowIndex=function(t){},jt.prototype.disableHorizontalGridLine=function(t){},jt.prototype.disableVerticalGridLine=function(t){},jt.prototype.enableShading=function(t){},jt.prototype.setTransposedShading=function(t){},jt.prototype.enableRowHighlighting=function(t){},jt.prototype.getRowHighlight=function(){},jt.prototype.setRowHighlight=function(t){},jt.prototype.getSelectedRows=function(){},jt.prototype.getSelectedRowCount=function(){},jt.prototype.isSelectedRow=function(t){},jt.prototype.getRowAnchor=function(){},jt.prototype.setRowAnchor=function(t){},jt.prototype.setSelectedRow=function(t,e){},jt.prototype.selectSingleRow=function(t){},jt.prototype.selectRowRange=function(t,e){},jt.prototype.clearSelectedRows=function(){},jt.prototype.getFirstSelectedRow=function(){},jt.prototype.getLastSelectedRow=function(){},jt.prototype.activateColumn=function(t,e){},jt.prototype.activateRows=function(t,e,i){},jt.prototype.moveRowsToTop=function(t){},jt.prototype.getFirstIndexInView=function(){},jt.prototype.getLastIndexInView=function(){},jt.prototype.isInCurrentView=function(t){},jt.prototype.getFrozenLayout=function(){},jt.prototype.setFrozenLayout=function(t){},jt.prototype.insertColumn=function(t,e){},jt.prototype.removeColumnAt=function(t){},jt.prototype.moveColumn=function(t,e){},jt.prototype.enableRowVirtualization=function(t){},jt.prototype.enableColumnVirtualization=function(t){},jt.prototype.getColumnIndex=function(t){},jt.prototype.getCellIndex=function(t,e){},jt.prototype.getIndex=function(){},jt.prototype.setIndex=function(t){},jt.prototype.getRowOffset=function(){},jt.prototype.setRowOffset=function(t){},jt.prototype.updateLayout=function(){},jt.prototype.stretchCell=function(t,e,i,n){},jt.prototype.unstretchCell=function(t,e){},jt.prototype.unstretchAllCells=function(){},jt.prototype.getStretchedCell=function(t,e){},jt.prototype.getStretchedCells=function(){},jt.prototype.updateStretchedCells=function(){},jt.prototype.getColumnHost=function(){},jt.prototype.setHidingMethod=function(t){},jt.prototype.getHidingMethod=function(){},jt.prototype.setColumnVisibility=function(t,e,i){},jt.prototype.getRowLayout=function(){},jt.prototype.reserveRightSpace=function(t){},jt.prototype.getReservedSpace=function(){},jt.prototype.getComputedStyle=function(){},jt.prototype.isColumnActive=function(t){},jt.prototype.setRowAttributes=function(t,e){},jt.prototype.getContextRow=function(t){},jt.prototype.selectColumn=function(t,e){},jt.prototype.isSelectedColumn=function(t){},jt.prototype.selectCell=function(t,e,i){},jt.prototype.setCellBounds=function(t,e,i,n){},jt.prototype.getHorizontalLayout=function(){},jt.prototype.calculateColumnBounds=function(t,e,i,n){},jt.prototype.updateColumnBounds=function(t,e,i){},jt.prototype.updateColumnSeparators=function(){};let Kt=function(t){(this._element=document.createElement("div")).className="column",this._cells=[],this._section=t};l.inherits(Kt,Bt),Kt.prototype._nextSibling=null,Kt.prototype._parent=null,Kt.prototype._section=null,Kt.prototype._cells=null,Kt.prototype._cellStart=0,Kt.prototype._cellEnd=0,Kt.prototype._autoStyleUpdating=!1,Kt.prototype._deactivation=!1,Kt.prototype._sizeClasses=null,Kt.prototype._colLeft=0,Kt.prototype._absolute=!1,Kt.prototype._scrollFrame=null,Kt.prototype._invisibility=0,Kt.prototype._bits=[1,2,4,8],Kt.prototype._pinned=!0,Kt.prototype.clearContent=function(){for(let t=this._cells.length;--t>=0;)this._cells[t].setContent(null)},Kt.prototype.setLeft=function(t){return this._colLeft=t,this._absolute&&(this._element.style.left=t+"px"),!0},Kt.prototype.enableAbsolutePosition=function(t){(t=!1!==t)!==this._absolute&&(this._absolute=t,this._element.style.left=t?this._colLeft+"px":"")},Kt.prototype.dispose=function(){this._dispose();for(let t=this._cells.length;--t>=0;)this._cells[t].dispose();this._scrollFrame=this._nextSibling=this._parent=this._cells=this._section=null},Kt.prototype.setStyle=function(t,e){let 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")},Kt.prototype.setStyles=function(t){let e=this._element,i=e.style;for(let e in t)i[e]=t[e];e.style.backgroundColor?e.classList.contains("no-shading")||e.classList.add("no-shading"):e.classList.contains("no-shading")&&e.classList.remove("no-shading")},Kt.prototype.show=function(t){this.setVisibility(0,!1!==t)},Kt.prototype.setWidth=function(t){this._element.style.width=t+"px";let e,i=0;t>0&&t<=24?i=3:t>24&&t<=40?i=2:t>40&&t<60&&(i=1);let n=this._sizeClasses;if(n){if(n.length>i){for(e=n.length;--e>=i;)this.removeClass(n[e]);n.length=i}i||(this._sizeClasses=null)}if(i)for(n||(n=[],this._sizeClasses=n),e=n.length;e<i;++e)n[e]=Kt._sizeClasses[e],this.addClass(n[e]);return this.setVisibility(1,t>0),!0},Kt._sizeClasses=["small-col","very-small-col","tiny-col"],Kt.prototype.setHeight=function(t){return this._element.style.height=t+"px",this.setVisibility(2,t>0),!0},Kt.prototype.getParent=function(){return this._parent},Kt.prototype.setParent=function(t,e){if(!this._element)return;this._parent=nt.getElement(t);let i=this._section?this._section.getHidingMethod():"";this._invisibility&&!i||this._setParent(this._parent,e)},Kt.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())},Kt.prototype.enableAutoStyleUpdating=function(t){t=!1!==t,this._autoStyleUpdating!==t&&(this._autoStyleUpdating=t)},Kt.prototype.setNextSibling=function(t){this._nextSibling=t},Kt.prototype.isActive=function(){return!(this._invisibility&this._bits[3])},Kt.prototype.disableDeactivation=function(t){this._deactivation=!1!==t,this._deactivation&&(this.isActive()||this.activate())},Kt.prototype.activate=function(t){return t=this._pinned||this._deactivation||!1!==t,this.isActive()!==t&&(this.setVisibility(3,t),!0)},Kt.prototype.deactivate=function(t){this.activate(!1===t)},Kt.prototype.setCellCount=function(t){let e;for(e=this._cells.length;e<t;++e)this._cells.push(new Yt(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)},Kt.prototype.getCell=function(t){return this._cells[t]||null},Kt.prototype.collapseCells=function(t,e,i,n,o){if(e<=0)return;let r=!1,s=this._cells[t];s&&!n&&(r|=s.collapse(i,o));for(let n=1;n<e&&(s=this._cells[t+n],s);++n)r|=s.collapse(i,o);r&&(i?e>1&&(this._hasCollapsedCells=!0):this.updateCellOrders())},Kt.prototype.uncollapseAllCells=nt._deprecatedFunction,Kt.prototype.activateCells=function(t,e){let i,n=this._element;if(this._hasCollapsedCells)t=this._cellEnd,e>this._cellEnd&&(this._cellEnd=e);else if(this._cellStart===t){let 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){let t=this._cells[i];t.isKeptInDoc()&&(t.initialize(),n.appendChild(t.getElement()))}},Kt.prototype.moveCellsToTop=function(t){if(!this.isActive())return;let e=this._element;for(let i=0;i<t;++i){let t=this._cells[i];t.isKeptInDoc()&&e.appendChild(t.getElement())}this._cells=nt.cycleArray(this._cells,t)},Kt.prototype.updateCellOrders=function(){this._hasCollapsedCells=!1;let t=this._element;for(let e=this._cellStart;e<this._cellEnd;++e){let i=this._cells[e];i.isKeptInDoc()?t.appendChild(i.getElement()):this._hasCollapsedCells=!0}},Kt.prototype.hasCollapsedCells=function(){return this._hasCollapsedCells},Kt.prototype.getCellIndex=function(t){if(!t)return-1;for(let e=this._cellStart;e<this._cellEnd;++e){if(this._cells[e].getElement()===t)return e}return-1},Kt.prototype.getSection=function(){return this._section},Kt.prototype.log=function(){let t=[],e=this._cells.length;for(let i=0;i<e;++i)t.push(this._cells[i].getTextContent());return t},Kt.prototype.getVisibility=function(){return!this._invisibility},Kt.prototype.setVisibility=function(t,e){let i=!this._invisibility,n=this._bits[t]||1;e?this._invisibility&=~n:this._invisibility|=n;let o=!this._invisibility;if(i!==o)if(this._section?this._section.getHidingMethod():"")this.enableClass("hidden",!o);else if(o){let t=this._parent;if(!t)return;let e=this._nextSibling;for(;e;){if(e._parent!==t){e=null;break}if(!e._invisibility)break;e=e._nextSibling}this.insertBefore(e)}else this._setParent(null)},Kt.prototype.updateLayout=function(){},Kt.prototype.setScrollState=function(t,e,i){this._scrollFrame=t,this.enableAbsolutePosition(i),this.setParent(e||this._section.getColumnHost()),e||this.activate(),this._pinned=!e},Kt._proto=Kt.prototype;var Jt=Kt;let Qt=function(){this._items=[]};Qt.prototype._items=null,Qt.prototype.dispose=function(){this._items=null},Qt.prototype.setItemCount=function(t){let e=this._items,i=e.length;if(i!==t)for(e.length=t;i<t;)e[i++]={}},Qt.prototype.getItem=function(t){return this._items[t]||null},Qt.prototype.moveItemsToTop=function(t){this._items=nt.cycleArray(this._items,t)};var Zt=Qt;let $t=function(t,e,i){t.setTop(e.getLaneStart(i)),t.setHeight(e.getLaneSize(i))},te=function(t,e,i,n){if(i){let o=e.getLaneStart(i);t.setLeft(o),t.setWidth(n-o)}else t.setStyle("left",""),t.setWidth(n)},ee=function(t,e,i){this._trackX=t,this._trackY=e,this._section=i,this._cells=[]};ee.prototype._trackX,ee.prototype._trackY,ee.prototype._section,ee.prototype._cells,ee.prototype._activeCount=0,ee.prototype._stretchSize=0,ee.prototype.dispose=function(){let t=this._cells;if(this._activeCount){this._activeCount=0;for(let e=t.length;--e>=0;){let i=t[e];i&&i.dispose()}}t.length=0},ee.prototype.setStretchSize=function(t){this._stretchSize=t},ee.prototype.getStretchSize=function(){return this._stretchSize},ee.prototype.setCellCount=function(t){let 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;){let t=e[i];t&&t.dispose()}e.length=t}},ee.prototype.getCell=function(t){let e=this._cells[t];return e&&e.getParent()?e:null},ee.prototype.getCells=function(){let t=[];if(this._activeCount){let e=this._cells,i=e.length;for(let n=0;n<i;++n){let i=e[n];i&&i.getParent()&&t.push(i)}this._activeCount=t.length}return t},ee.prototype.getColumnIndex=function(t){if(t){if(!t.getElement)return null!=t._colIndex?t._colIndex:-1;{let e=t.getElement();if(e)return null!=e._colIndex?e._colIndex:-1}}return-1},ee.prototype.getRowIndex=function(t){if(t){if(t.getElement)return t.getParent()?this._cells.indexOf(t):-1;{let e=this._cells,i=e.length;for(let n=0;n<i;++n){let i=e[n];if(i&&i.getParent()&&i.getElement()===t)return n}}}return-1},ee.prototype.stretchCell=function(t,e){++this._activeCount,(!e||e<0)&&(e=0);let i=this._cells[t]||null;i||(i=new Yt(null,this._section),i.addClass("tr-stretched"),i.stretched=!0,this._cells[t]=i);let n=i.getElement();n.stretched=!0,n._colIndex!==e&&(n._colIndex=e,e>0?n.classList.add("right-stretching"):n.classList.remove("right-stretching")),n._rowIndex!==t&&(n._rowIndex=t);let o=this._stretchSize||this._trackX.getTrackSize();return te(i,this._trackX,e,o),$t(i,this._trackY,t),i},ee.prototype.unstretchCell=function(t){let e=this._cells[t]||null;return e&&e.setParent(null),e},ee.prototype.unstretchAllCells=function(){if(this._activeCount){this._activeCount=0;let t=this._cells;for(let e=t.length;--e>=0;){let i=t[e];i&&i.setParent(null)}}},ee.prototype.updateCells=function(){if(this._activeCount){let t=0,e=this._cells,i=e.length,n=this._trackX,o=this._trackY,r=this._stretchSize||n.getTrackSize();for(let s=0;s<i;++s){let i=e[s];i&&i.getParent()&&(++t,te(i,n,i.getElement()._colIndex,r),$t(i,o,s))}this._activeCount=t}},ee.prototype.updateXAxis=function(){if(this._activeCount){let t=0,e=this._cells,i=e.length,n=this._trackX,o=this._stretchSize||n.getTrackSize();for(let r=0;r<i;++r){let i=e[r];i&&i.getParent()&&(++t,te(i,n,i.getElement()._colIndex,o))}this._activeCount=t}},ee.prototype.updateYAxis=function(){if(this._activeCount){let t=0,e=this._cells,i=e.length,n=this._trackY;for(let o=0;o<i;++o){let i=e[o];i&&i.getParent()&&(++t,$t(i,n,o))}this._activeCount=t}},ee.prototype.moveCellsToTop=function(t){this._activeCount&&(this._cells=nt.cycleArray(this._cells,t),this.updateYAxis())};var ie=ee;let ne=function(t,e){this.indexX=t,this.indexY=e};ne.prototype.isSpanIndices=function(t,e){return t===this.indexX&&e===this.indexY},ne.prototype.isOccupiedIndices=function(t,e){return t!==this.indexX||e!==this.indexY},ne.prototype.register=function(t,e){this._register(t,e,!0)},ne.prototype.unregister=function(t,e){this._register(t,e,!1)},ne.prototype._register=function(t,e,i){let n=t.indexOf(this);i?n<0&&t.push(this):n>=0&&t.splice(n,1);let o=i?this:null,r=this.indexX+this.colSpan,s=this.indexY+this.rowSpan;for(let t=this.indexX;t<r;++t)for(let i=this.indexY;i<s;++i)e[t+","+i]=o},ne.prototype.indexX,ne.prototype.indexY,ne.prototype.colSpan=1,ne.prototype.rowSpan=1,ne.prototype.prevColSpan=1,ne.prototype.prevRowSpan=1,ne.prototype.retVal=0;var oe=ne;let re=function(){this._spans=[],this._occupiedMap={}};re.prototype.removeColumn=function(t){let e=!1;return this.removeSpanByColIndex(t)&&(e=!0),this.shiftColumn(t,-1)&&(e=!0),e},re.prototype.freezeMapping=function(t){this._frozenMapping=!1!==t,this._frozenMapping||this._mapCellSpans()},re.prototype._mapCellSpans=function(){let t,e,i=this._spans;for(this._spans=[],this._occupiedMap={},t=i.length;--t>=0;)e=i[t],e.indexX>=0&&e.register(this._spans,this._occupiedMap)},re.prototype.shiftColumn=function(t,e){if(this._spans.length<=0||0===e)return!1;let i=!1;for(let n=this._spans.length;--n>=0;){let o=this._spans[n];o.indexX>=t&&(i=!0,o.indexX+=e)}return!(!i||this._frozenMapping)&&(this._mapCellSpans(),!0)},re.prototype.removeSpan=function(t,e){if(this._spans.length<=0)return null;let i=t+","+e,n=this._occupiedMap[i];return!n||n.isOccupiedIndices(t,e)?null:(n.unregister(this._spans,this._occupiedMap),n)},re.prototype.removeSpanByColIndex=function(t,e){let i,n=this._spans.length;if(n<=0)return null;let o,r=e||[],s=0;for(o=0;o<n;++o)i=this._spans[o],i&&i.indexX===t&&(r.push(i),s++);if(s<=0)return null;for(n=r.length,o=0;o<s;++o)r[n-o-1].unregister(this._spans,this._occupiedMap);return r},re.prototype.removeSpanStartedFromRowIndex=function(t,e){let i,n=this._spans.length;if(n<=0)return null;let o,r=e||[],s=0;for(o=0;o<n;++o)i=this._spans[o],i&&i.indexY>=t&&(r.push(i),s++);if(s<=0)return null;for(n=r.length,o=0;o<s;++o)r[n-o-1].unregister(this._spans,this._occupiedMap);return r},re.prototype.clearAllSpans=function(){if(this._spans.length<=0)return null;let t=this._spans;return this._spans=[],this._occupiedMap={},t},re.prototype.hasSpan=function(){return this._spans.length>0},re.prototype.getSpan=function(t,e){let i=this.getOccupyingSpan(t,e);return i&&i.isSpanIndices(t,e)?i:null},re.prototype.getOccupyingSpan=function(t,e){return this._spans.length<=0?null:this._occupiedMap[t+","+e]||null},re.prototype.getAllSpans=function(){return this._spans},re.prototype.getColSpan=function(t,e){let i=this._occupiedMap[t+","+e];return null==i?1:i.isOccupiedIndices(t,e)?i.indexX-t:i.colSpan},re.prototype.getRowSpan=function(t,e){let i=this._occupiedMap[t+","+e];return null==i?1:i.isOccupiedIndices(t,e)?i.indexY-e:i.rowSpan},re.prototype.setColSpan=function(t,e,i){return this._updateSpan(t,e,!0,i)},re.prototype.setRowSpan=function(t,e,i){return this._updateSpan(t,e,!1,i)},re.prototype._updateSpan=function(t,e,i,n){n<1&&(n=1);let o=this.getSpan(t,e);o&&(o.retVal=0);let r,s,l,a,u,h,p=t,d=e,c=o?o.colSpan:1,_=o?o.rowSpan:1,f=!0;if(i){if(c===n)return o;if(c>n)p=t+n,r=t+c,f=!1;else{if(l=this._occupiedMap[t+","+e],l&&l!==o)return o;p=t+c,r=t+n}s=e+_}else{if(_===n)return o;if(_>n)d=e+n,s=e+_,f=!1;else{if(l=this._occupiedMap[t+","+e],l&&l!==o)return o;d=e+_,s=e+n}r=t+c}if(f){let i=[];for(u=p;u<r;++u)for(h=d;h<s;++h){if(a=u+","+h,this._occupiedMap[a])return o;i.push(a)}for(null==o&&(o=new oe(t,e),a=t+","+e,this._spans.push(o),this._occupiedMap[a]=o),u=i.length;--u>=0;)this._occupiedMap[i[u]]=o}else{if(i?n+_<=2:n+c<=2){a=t+","+e;let i=this._spans.indexOf(o);this._spans.splice(i,1),this._occupiedMap[a]=null}for(u=p;u<r;++u)for(h=d;h<s;++h)this._occupiedMap[u+","+h]=null}return i?(o.prevColSpan=o.colSpan,o.colSpan=n):(o.prevRowSpan=o.rowSpan,o.rowSpan=n),o.retVal=f?1:-1,o},re.prototype._spans,re.prototype._occupiedMap,re.prototype._frozenMapping=!1;var se=re;let le=function(){this._selections=[]};le.prototype.clone=function(){let t=new le;return t._selections=this._selections.concat(),t._count=this._count,t._anchor=this._anchor,t._firstIndex=this._firstIndex,t._lastIndex=this._lastIndex,t},le.prototype.toString=function(){return this._selections.join(", ")},le.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))},le.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)},le.prototype.deselectFrom=function(t){if(this._lastIndex<t)return!1;if(this._firstIndex>=t)return this.clearAllSelections(),!0;let e=this._lastIndex,i=this._selections;for(let n=t;n<=e;++n)i[n]&&(i[t]=!1,--this._count);return this._anchor>=t&&(this._anchor=-1),this._lastIndex=this._findPrevSelection(t),!0},le.prototype.toggleSelection=function(t){this._selections[t]?this.deselect(t):this.select(t)},le.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)},le.prototype.selectRange=function(t,e){if(0===e)return;if(t<0&&(t=0),1===e||-1===e)return void this.select(t);let i=t,n=i+e;if(e<0&&(n=i+1,i=n+e),!(i>=n)){this._anchor=t,(this._firstIndex<0||i<this._firstIndex)&&(this._firstIndex=i),(this._lastIndex<0||n>=this._lastIndex)&&(this._lastIndex=n-1);for(let t=i;t<n;++t)this._select(t)}},le.prototype.deselectRange=function(t,e){if(this._count<=0)return;if(t<0&&(t=0),1===e||-1===e)return void this.deselect(t);let i=t+e;if(e<0&&(i=t+1,t=i+e),this._firstIndex>=t&&this._lastIndex<i)return void this.clearAllSelections();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));let n=0;for(n=t;n<i;++n)this._selections[n]&&(this._selections[n]=!1,--this._count)},le.prototype.hasSelection=function(t,e){if(this._count<=0)return!1;let i=t+e;if(e<0&&(i=t+1,t=i+e),i<this._firstIndex||t>this._lastIndex)return!1;for(let e=t;e<i;++e)if(this._selections[e])return!0;return!1},le.prototype.getSelection=function(t){return!0===this._selections[t]},le.prototype.setSelection=function(t,e){return!1!==e?this.select(t):this.deselect(t)},le.prototype.getSelectionAnchor=function(){return this._anchor},le.prototype.setSelectionAnchor=function(t){this._anchor=t},le.prototype.getSelectionCount=function(){return this._count},le.prototype.getFirstSelectedIndex=function(){return this._firstIndex},le.prototype.getLastSelectedIndex=function(){return this._lastIndex},le.prototype.getAllSelections=function(){if(this._count>0){let t=new Array(this._count),e=0,i=this._selections,n=this._lastIndex;for(let o=this._firstIndex;o<=n;++o)i[o]&&(t[e++]=o);return t}return[]},le.prototype.getConnectedRanges=function(t,e){if(this._count>0){let i=[];(null==t||t<this._firstIndex)&&(t=this._firstIndex),(null==e||e>this._lastIndex)&&(e=this._lastIndex+1);let n=null;for(let o=t;o<e;++o)this._selections[o]?n||(n=[o,-1]):n&&(n[1]=o-1,i.push(n),n=null);return n&&(n[1]=this._lastIndex,i.push(n),n=null),i}return[]},le.prototype.getSelectionMap=function(){return this._selections},le.prototype.clearAllSelections=function(){if(this._count>0){let t=0;return this._selections.length=0,this._count=0,this._anchor=-1,this._firstIndex=-1,this._lastIndex=-1,t}return 0},le.prototype.copyFrom=function(t,e,i,n){if(n<=0)return;let o=e+i;if(null!=t)if(!1!==t.hasSelection(e,n)){for(let i=0;i<n;++i)t._selections[e+i]?this.select(o+i):this.deselect(o+i);this._anchor=-1,t._anchor>=0&&t._anchor>=e&&t._anchor<e+n&&(this._anchor=t._anchor+i)}else this.deselectRange(o,n);else this.deselectRange(o,n)},le.prototype._select=function(t){return!this._selections[t]&&(this._selections[t]=!0,++this._count,!0)},le.prototype._findNextSelection=function(t){if(this._lastIndex>=0)for(;++t<=this._lastIndex;)if(this._selections[t])return t;return-1},le.prototype._findPrevSelection=function(t){if(this._firstIndex>=0)for(;--t>=this._firstIndex;)if(this._selections[t])return t;return-1},le.prototype._selections=null,le.prototype._count=0,le.prototype._anchor=-1,le.prototype._firstIndex=-1,le.prototype._lastIndex=-1;var ae=le;let ue=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)};ue.prototype._func=null,ue.prototype._delay=0,ue.prototype._timerId=0,ue.prototype._pending=!1,ue.prototype.start=function(){this._func&&(this._timerId?this._pending=!0:this._timerId=setInterval(this._onInterval,this._delay))},ue.prototype.dispose=function(){this._timerId&&(clearInterval(this._timerId),this._timerId=0),this._func=null},ue.prototype._onInterval=function(){this._pending?this._pending=!1:(this._func(),clearInterval(this._timerId),this._timerId=0)},ue._proto=ue.prototype;var he=ue;let pe=function(){let 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 he(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"),pe._queryNativeTrackThickness(t._onThicknessChanged),t._updateEffectiveArea()||t.listen("thicknessChanged",t._updateEffectiveArea)};l.inherits(pe,Bt),pe.prototype._vertical=!0,pe.prototype._step=0,pe.prototype._parentNode=null,pe.prototype._hostClassName="",pe.prototype._trackContent=null,pe.prototype._panes=null,pe.prototype._paneSliders=null,pe.prototype._enabled=!0,pe.prototype._active=!1,pe.prototype._isFrozen=!1,pe.prototype._otherScrollbar=null,pe.prototype._autoHideScrollbar=!0,pe.prototype._trackSize=120,pe.prototype._tContentSize=0,pe.prototype._tScrollVal=0,pe.prototype._tPercentVal=0,pe.prototype._paneSize=0,pe.prototype._pContentSize=0,pe.prototype._pScrollVal=0,pe.prototype._footerCount=0,pe.prototype._fadingId=0,pe.prototype._postponeFading=!1,pe.prototype._layoutChanged=!1,pe.prototype._contentDirty=!0,pe.prototype._layoutDirty=!0,pe.prototype._touchInput=!0,pe.prototype._swiping=!1,pe.prototype._touchDrag=!1,pe.prototype._startPos,pe.prototype._endPos,pe.prototype._smoothing=!0,pe.prototype._smoothingId=0,pe.prototype._smoothingSpeed=0,pe.prototype._wheelScrolling="",pe.prototype._mouseWheelLogic=null,pe.prototype._onThicknessChanged=null,pe._trackThickness=0,pe._queryTimeout=0,pe._queryStarted=!1,pe._outerDummy=null,pe._innerDummy=null,pe._listeners=null,pe.prototype._updateEffectiveArea=function(){let t=this.getTrackThickness();if(t){let e=this._vertical?"width":"height";this._element.style[e]=t+1+"px"}return!!t},pe._queryNativeTrackThickness=function(t){if(pe._queryStarted||pe._repeatQuery(),t&&pe._trackThickness<=0){let e=pe._listeners;e||(e=pe._listeners=[]),e.push(t)}},pe._repeatQuery=function(){pe._queryStarted=!0,pe._retrieveNativeTrackThinkness()||(pe._queryTimeout+=100,pe._queryTimeout<3e3?setTimeout(pe._repeatQuery,pe._queryTimeout):(pe._trackThickness=13,pe._clearStaticResources()))},pe._retrieveNativeTrackThinkness=function(){if(pe._trackThickness>0)return!0;let t=pe._innerDummy,e=pe._outerDummy;t||(t=pe._innerDummy=document.createElement("p"),t.style.width="100%",t.style.height="200px",e=pe._outerDummy=document.createElement("div"),e.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);let i=t.offsetWidth;e.style.overflow="scroll";let n=t.offsetWidth;return i==n&&(n=e.clientWidth),document.body.removeChild(e),(pe._trackThickness=i-n)>0&&(pe._clearStaticResources(),!0)},pe._clearStaticResources=function(){pe._innerDummy=pe._outerDummy=null;let t=pe._listeners;if(t){pe._listeners=null;let e={};for(let i=t.length;--i>=0;)t[i](e)}},pe.updateTrackThickness=function(){pe._trackThickness=0,pe._queryTimeout=0,pe._queryStarted=!1,pe._queryNativeTrackThickness()},pe.prototype.dispose=function(){let t=pe._listeners;if(t){let 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(let t=this._panes.length;--t>=0;)this._panes[t].dispose(),this._paneSliders[t].dispose();this._reverter.dispose()},pe.prototype.getContent=function(t){return this._paneSliders[0].getContent(t)},pe.prototype.getParent=function(){return this._parentNode},pe.prototype.setParent=function(t,e){let i=nt.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)},pe.prototype.attachToExternalElement=function(t){this.setParent(t);let 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"},pe.prototype._onActiveStateChange=function(){let 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);let 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()},pe.prototype._onEnablingStateChange=function(){let t=this;t._enabled?t._dispatch("enabled",{}):t._dispatch("disabled",{})},pe.prototype.isActive=function(){return this._active},pe.prototype.isEnabled=function(){return this._enabled},pe.prototype.enable=function(t){t=!1!==t,this._enabled!=t&&(this._enabled=t,this._updateLayout(),this._onEnablingStateChange())},pe.prototype.disable=function(t){this.enable(!1===t)},pe.prototype.getTrackSize=function(){return this._trackSize},pe.prototype.getPaneSize=function(){return this._paneSize},pe.prototype.getContentSize=function(){return this._pContentSize},pe.prototype.getTrackThickness=function(){return pe._trackThickness},pe.prototype.getScrollGap=function(){return this._pContentSize-this.getPaneSize()},pe.prototype.setTrackSize=function(t,e){this._trackSize=t>0?t:0,this._paneSize=e>0?e:0},pe.prototype.calculateContentSize=function(){return 0},pe.prototype.update=function(){if(this._contentDirty){this._contentDirty=!1;let 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)},pe.prototype.invalidate=function(t,e){this._contentDirty=!0,this._layoutDirty=!0,null!=e&&(this._pScrollVal=e),t&&this.update()},pe.prototype.invalidateContent=function(){this._contentDirty=!0},pe.prototype.isScrollPosValid=function(t){let e=t-this.getPaneSize(),i=this._pScrollVal;return 0===i||i>0&&e>0&&i<e},pe.prototype.flash=function(){this.update(),this._flash()},pe.prototype._scroll=function(t){this._scrollTo(this._pScrollVal+t)},pe.prototype._scrollTo=function(t,e){if(!this._active&&!e)return;t=this._calcProperScrollValue(t);let 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",{})},pe.prototype._calcProperScrollValue=function(t){if(!t||t-.5<0)return 0;if(this._tPercentVal>=1&&Math.abs(this._pScrollVal-t)<=2)return this._pScrollVal;let e=this.getScrollGap();if(e<=0)return 0;if(t+.5>=e)return e;let 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)},pe.prototype._convertTrackToPane=function(t){t=Math.round(t);let e=this._getTrackGap();this._tPercentVal>=1&&Math.abs(this._tScrollVal-t)<=5&&(t=e),this._tScrollVal=t,this._tPercentVal=e?t/e:0;let i=this.getScrollGap();return e===i?t:this._tPercentVal*i},pe.prototype._setTrackScrollVal=function(t){let e=this._getTrackGap(),i=0;if(e>0){if(t>0){let n=this.getScrollGap();i=e===n?t:t/n*e,i=Math.round(i)}i>=e&&(i=e)}if(i!==this._tScrollVal){this._tScrollVal=i,this._tPercentVal=e?i/e:0;let t=this._element;return this._vertical?t.scrollTop=i:t.scrollLeft=i,!0}return!1},pe.prototype._getTrackGap=function(){let t=this._tContentSize-this.getTrackSize();return t>0?t:0},pe.prototype._getScrollValue=function(){return this._pScrollVal},pe.prototype._isEndOfScroll=function(){return!this._active||this._pScrollVal>=this.getScrollGap()},pe.prototype._isStartOfScroll=function(){return!this._pScrollVal},pe.prototype._isOnEdge=function(t){return t<0&&this._isStartOfScroll()||t>0&&this._isEndOfScroll()},pe.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)))},pe.prototype._clearAllPanes=function(){for(let t=this._panes.length;--t>=0;){this._panes[t].setParent(null);let e=this._paneSliders[t];e._content=e._columns=null;let i=e.getElement();for(;null!==i.firstChild;)i.removeChild(i.firstChild)}},pe.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))},pe.prototype.disableTouchInput=function(t){this._touchInput=!1===t},pe.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))},pe.prototype.getAutoHide=function(){return this._autoHideScrollbar},pe.prototype.setOtherScrollbar=function(t){this._otherScrollbar=t},pe.prototype.setFooterCount=function(t){this._footerCount=t},pe.prototype._calcActiveState=function(){if(this._enabled&&this.getTrackSize()>20){let t=this.getPaneSize();if(t>0)return this._pContentSize-t>0}return!1},pe.prototype._updateLayout=function(){let t=this._calcActiveState();if(t!==this._active&&(this._active=t,this._onActiveStateChange()),!this._active)return;let 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(let t=this._panes.length;--t>=0;)this._panes[t].setWidth(i)}this._scrollTo(this._pScrollVal,!0)},pe.prototype.resetPaneSize=function(){let t=this._vertical?"height":"width";for(let e=this._panes.length;--e>=0;)this._panes[e].setStyle(t,"")},pe._preventVScrolling=function(t){t.currentTarget.scrollTop=0},pe._preventHScrolling=function(t){t.currentTarget.scrollLeft=0},pe.prototype._addPaneAt=function(t){null==t&&(t=this._panes.length);let e=this._panes[t];if(!e){if(e=new Bt(document.createElement("div")),e.setClass("grid-pane"),this._vertical?(e.addClass("sections"),e.listen("scroll",pe._preventVScrolling)):(e.addClass("columns"),e.listen("scroll",pe._preventHScrolling)),this._active||e.addClass("scroll-disabled"),this._paneSize&&this._active){let t=this.getPaneSize();this._vertical?e.setHeight(t):e.setWidth(t)}e.listen("touchstart",this._onTouchStart),e.listen("touchmove",this._onTouchMove),e.listen("touchend",this._onTouchEnd),e.listen("touchcancel",this._onTouchEnd);let i=new Bt(document.createElement("div"));i.setClass("grid-pane-slider"),i.setParent(e),this._panes[t]=e,this._paneSliders[t]=i}return e},pe.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))},pe.prototype._onTrackScroll=function(t){let e=this._vertical?t.target.scrollTop:t.target.scrollLeft,i=this._convertTrackToPane(e);i=this._calcProperScrollValue(i),i!==this._pScrollVal&&(this._pScrollVal=i,this._dispatchScrollEvent(t))},pe.prototype._onRestingPosition=function(){this._setSliderPosition(-this._pScrollVal,!0)},pe.prototype._setSliderPosition=function(t,e){let i="",n="",o=this._vertical?"top":"left";t&&(e?n=t+"px":(i=this._vertical?"translateY":"translateX",i+="("+t+"px)",this._reverter.start()));for(let e=this._paneSliders.length;--e>=0;){let r=this._paneSliders[e],s=r.getElement().style;r._titleSection?s[o]=t+"px":(s.transform=i,s[o]=n)}e?this._dispatch("scrollEnd",{}):this._dispatch("scrollStart",{})},pe.prototype._dispatchScrollEvent=function(t){if(this._setSliderPosition(-this._pScrollVal,!1),this._flash(),!this._isEventDispatching("scroll")){if(!t){let 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)}},pe.prototype._onKeyDown=function(t){if(this._isFrozen)return void nt._preventDefault(t);if(!this._active)return;let e=!1;if(e=this._vertical?38===t.keyCode||40===t.keyCode:37===t.keyCode||39===t.keyCode,e){let 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),nt._preventDefault(t)}},pe.prototype._onTouchStart=function(t){this._isFrozen?nt._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))},pe.prototype._onTouchMove=function(t){let e=this;if(e._isFrozen)return void nt._preventDefault(t);if(!e._swiping||!e._active||!e._touchInput)return;if(t.touches&&t.touches.length>1)return;let i=e._startPos,n=e._endPos;e._getTouchInfo(t,n);let o=this._vertical?i.y-n.y:i.x-n.x;if(!(o>-5&&o<5||e._isOnEdge(o))){if(e._touchDrag)e._scrollTo(i.scrollValue+o);else{n.timeStamp-i.timeStamp>30&&(e._touchDrag=!0)}t.cancelable&&t.preventDefault()}},pe.prototype._onTouchEnd=function(t){if(this._isFrozen)nt._preventDefault(t);else if(this._swiping=!1,this._touchDrag&&(this._touchDrag=!1,t.cancelable&&t.preventDefault(),this._smoothing&&!this._smoothingId)){let e=this._startPos,i=this._getTouchInfo(t,this._endPos),n=i.timeStamp-e.timeStamp,o=this._vertical?e.y-i.y:e.x-i.x;this._smoothingSpeed=30*o/n,(this._smoothingSpeed>10||this._smoothingSpeed<-10)&&(this._smoothingId=setInterval(this._smoothScroll,25))}},pe.prototype._getTouchInfo=function(t,e){let i=t.changedTouches[0];return e||(e={}),e.x=i.pageX,e.y=i.pageY,e.timeStamp=t.timeStamp,e.scrollValue=this._getScrollValue(),e},pe.prototype._smoothScroll=function(){let t=this._smoothingSpeed;t=.9*t|0,this._smoothingSpeed=t,t>1||t<-1?this._scroll(t):(clearInterval(this._smoothingId),this._smoothingId=0)},pe.prototype.disableMouseWheel=function(t){!1===t?this.setMouseWheelLogic(this._mouseWheelLogic||this._onMouseWheel):this.setMouseWheelLogic(null)},pe.prototype.setMouseWheelLogic=function(t){this.removeWheelListener(this._parentNode),this._mouseWheelLogic=t,this._mouseWheelLogic&&this.addWheelListener(this._parentNode)},pe.prototype.addWheelListener=function(t){t&&this._mouseWheelLogic&&t.addEventListener("wheel",this._mouseWheelLogic,!1)},pe.prototype.removeWheelListener=function(t){t&&this._mouseWheelLogic&&t.removeEventListener("wheel",this._mouseWheelLogic,!1)},pe.prototype.setMouseWheelSpeed=function(t){this._wheelScrolling="string"==typeof t?t:""},pe.prototype.getMouseWheelSpeed=function(){return this._wheelScrolling},pe.prototype.getDefaultMouseWheelLogic=function(){return this._onMouseWheel},pe.prototype._onMouseWheel=function(t){if(t.target.opened)return;if(this._isFrozen)return void nt._preventDefault(t);if(t.ctrlKey||t.altKey)return;if(!this.isActive())return;let e=this._vertical?t.deltaY:t.deltaX;if(e&&!this._isOnEdge(e)){if(nt._preventDefault(t),t.deltaMode&&(e=e>0?100:-100),"linear"!=this._wheelScrolling){let t=this.getContentSize();t>=4e3&&(e*=1+t/4e3|0)}this.update(),this._scroll(e)}},pe.prototype.setScrollingStep=function(t){this._step=t>0?t:0},pe.prototype.freezeScrolling=function(t){let e=this._isFrozen;return this._isFrozen=!1!==t,e},pe.prototype.restoreTrackPosition=function(){let t=this._element;this._vertical&&(t.scrollTop=this._tScrollVal,t.scrollTop&&(this._tScrollVal=t.scrollTop))},pe._proto=pe.prototype;var de=pe;let ce=function(){let t=this;t._vertical=!1,t._onDeactivated=t._onDeactivated.bind(t),t._onActivated=t._onActivated.bind(t),t._hostClassName="hscrollbar-host",ce.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)};l.inherits(ce,de),ce.prototype._pinnedLeftColumnCount=0,ce.prototype._pinnedRightColumnCount=0,ce.prototype.setScrollContent=function(t,e,i,n){this._clearAllPanes();let o=e.length;if(o<=0)return;this._pinnedLeftColumnCount=i>=0?i:0,this._pinnedRightColumnCount=n>0?n:0;let r=e[0],s=r.getColumnCount(),l=s-n;(!l||l<0)&&(l=s);for(let t=0;t<o;++t){r=e[t];let n,o,a=this._addPaneAt(t),u=this._paneSliders[t],h=a.getElement(),p=u.getElement();for(n=0;n<i;++n)o=r.getColumn(n),o.setScrollState(h,null,!1);a.setParent(r.getColumnHost());let d=[],c=[];for(n=i;n<l;++n)o=r.getColumn(n),o.setScrollState(null,p,this.isActive()),d.push(o),c.push(o.getElement());for(n=l;n<s;++n)o=r.getColumn(n),o.setScrollState(null,null,!1);let _=r.getReservedSpace();_&&(this._pinnedRightColumnCount||(u.addContent(_),c.push(_)),r._updateRightSpaceStyle()),r._updateLayers(),u._titleSection=r.hasClass("title"),u._columns=d,u._content=c}this.invalidateContent()},ce.prototype.setWidth=function(t){return this.setTrackSize(t,t),!0},ce.prototype.getWidth=function(){return this.getPaneSize()},ce.prototype.getScrollLeft=function(){return this._getScrollValue()},ce.prototype.setScrollLeft=function(t){this.update(),this._scrollTo(t)},ce.prototype.getPinnedLeftColumnCount=function(){return this.isEnabled()?this._pinnedLeftColumnCount:0},ce.prototype.getPinnedRightColumnCount=function(){return this.isEnabled()?this._pinnedRightColumnCount:0},ce.prototype.setPaneLeft=function(t){let e=t&&this.isActive()?-t+"px":"";for(let t=this._panes.length;--t>=0;)this._paneSliders[t].setStyle("marginLeft",e)},ce.prototype.isEndOfHorizontalScroll=function(){return this._isEndOfScroll()},ce.prototype.getContentWidth=function(){let t=this._paneSliders[0],e=0;if(t){let i=t._content;for(let t=i.length;--t>=0;){let n=i[t],o=n?n.style.width:0;o&&(e+=parseFloat(o))}}return e},ce.prototype.calculateContentSize=function(){return this.getContentWidth()},ce.prototype.getTrackSize=function(){return this._footerCount<=0&&this._otherScrollbar&&this._otherScrollbar.isActive()&&!this._pinnedRightColumnCount?this._trackSize-this.getTrackThickness():this._trackSize},ce.prototype._onActivated=function(t){this._updateActivation(!0)},ce.prototype._onDeactivated=function(t){this._updateActivation(!1)},ce.prototype._updateActivation=function(t){let e=this._paneSliders.length;for(let i=0;i<e;++i){let e=this._paneSliders[i]._columns,n=e?e.length:0;for(let i=0;i<n;++i){let n=e[i];n.getElement()&&n.enableAbsolutePosition(t)}}},ce._proto=ce.prototype;var _e=ce;let fe=function(t,e){return t>e?e:t<0?0:t},ge=function(t){this._boundLayer=t.boundLayer,this._layoutX=t.layoutX,this._layoutY=t.layoutY,this._hscrollbar=t.hscrollbar,this._calculateColumnBounds=t.calculateColumnBounds};ge.prototype._boundLayer=null,ge.prototype._layoutX,ge.prototype._layoutY,ge.prototype._hscrollbar,ge.prototype._calculateColumnBounds,ge.prototype._cellBound=null,ge.prototype._cbLftIdx=0,ge.prototype._cbRgtIdx=0,ge.prototype._cbTopIdx=0,ge.prototype._cbBtmIdx=0,ge.prototype.dispose=function(){let t=this._cellBound;if(t){let e=t.parentNode;e&&e.removeChild(t),this._cellBound=null}this._boundLayer=null,this._layoutX=null,this._layoutY=null,this._hscrollbar=null,this._calculateColumnBounds=null},ge.prototype.setCellBounds=function(t,e,i,n,o){let r=this._cellBound;r||(r=this._cellBound=document.createElement("div"),r.className="selection-bound");let s=t+i,l=e+n,a=this._layoutY.getLaneCount();this._cbLftIdx=fe(t,o),this._cbRgtIdx=fe(s,o),this._cbTopIdx=fe(e,a),this._cbBtmIdx=fe(l,a),this.updateCellBounds()},ge.prototype.updateCellBounds=function(){let t=this._cellBound;if(!t)return;let e,i,n,o,r=this._layoutX,s=this._layoutY,l=this._cbLftIdx,a=this._cbRgtIdx,u=this._cbTopIdx,h=this._cbBtmIdx;e=i=n=o=0,l<a&&u<h&&(e=r.getLaneStart(l),i=r.getLaneEnd(a-1),n=s.getLaneStart(u),o=s.getLaneEnd(h-1));let p=i-e,d=o-n,c=[!1,!1];if(p>0&&d>0&&this._hscrollbar){let t=[0,0];this._calculateColumnBounds(l,a-1,t,c),e=t[0],i=t[1],p=i-e}if(p>0)t.style.left=e+"px",t.style.top=n+"px",t.style.width=p+"px",t.style.height=d+"px",t.classList.toggle("no-left-bound",c[0]),t.classList.toggle("no-right-bound",c[1]),this._boundLayer&&this._boundLayer.appendChild(t);else{let e=t.parentNode;e&&e.removeChild(t)}},ge._proto=ge.prototype;var ye=ge;let me=function(t){let e=this;e._onMouseMove=e._onMouseMove.bind(e),e._onMouseOut=e._onMouseOut.bind(e),e._onResetTransformIE=e._onResetTransformIE.bind(e),e._trackX=new Xt,e._trackY=new Xt,e._trackX.setDefaultLaneSize(100),e._trackY.setDefaultLaneSize(32),e._cellSpans=new se,e._element=document.createElement("div"),e._element.className="tr-lg tr-even-shading",e._ctxRows=new Zt,e._columns=[],e._cells=[],e._highlightedCells=[],e._stretchedCells=new ie(e._trackX,e._trackY,e),e._selectionList=new ae,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")};l.inherits(me,Bt),me.prototype._index=-1,me.prototype._availableRowCount=0,me.prototype._activeRow=0,me.prototype._activeRowEnd=0,me.prototype._colCount=0,me.prototype._rowCount=0,me.prototype._hiddenRowCount=0,me.prototype._trackX,me.prototype._trackY,me.prototype._cellSpans,me.prototype._columns,me.prototype._firstColumn,me.prototype._lastColumn,me.prototype._rightSpace,me.prototype._rightSpaceSize=0,me.prototype._frozenLayout=!1,me.prototype._rowHighlightEnabled=!1,me.prototype._rowHighlightIndex=-1,me.prototype._highlightedCells,me.prototype._coverLayer=null,me.prototype._stretchedCells=null,me.prototype._ctx=null,me.prototype._selectionList,me.prototype._colVir=!1,me.prototype._initialized=!1,me.prototype._hidingMethod="",me.prototype._virOwner=null,me.prototype._transformIETimer=0,me.prototype._ctxRows,me.prototype._boundLayer=null,me.prototype._colBounds=null,me.prototype._colBoundCache=null,me.prototype._colSelDirty=!1,me.prototype._hscrollbar=null,me.prototype._leftColumnSeparator=null,me.prototype._rightColumnSeparator=null,me.prototype._cellBoundPainter=null,me.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._ctxRows.dispose(),this._stretchedCells.dispose();for(let 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._cellBoundPainter&&this._cellBoundPainter.dispose(),this._dispose()},me.prototype.getWidth=function(){return this.isVisible()?this._getWidth():0},me.prototype._getWidth=function(){return this.getContentWidth()+this._rightSpaceSize},me.prototype.setWidth=function(t){if(t<0)return!1;return null!=this._trackX.setTrackSize(t-this._rightSpaceSize)&&(this._syncLayoutToColumns(0),!0)},me.prototype.getHeight=function(){return this.isVisible()?this.getContentHeight():0},me.prototype.setHeight=function(t){if(t<0)return!1;return null==this._trackY.setTrackSize(t)||this._syncLayoutToRows(0,this._rowCount),!0},me.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._trackY.show(t),this.setFrozenLayout(!1===t),this._dispatchRowHeightChangedEvent(0,this._rowCount)},me.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;let n=this._trackX.hitTest(t);if(n<0)return null;let o=this._trackY.hitTest(e);if(o<0)return null;let r={};if(r.colIndex=n,r.rowIndex=o,!0!==i){let t=this._cellSpans.getOccupyingSpan(n,o);t&&(r.colIndex=t.indexX,r.rowIndex=t.indexY)}return r},me.prototype.hitTestX=function(t){return t<0?-1:t>=this.getContentWidth()?~this._colCount:this._trackX.hitTest(t)},me.prototype.hitTestY=function(t){return t<0?-1:t>=this.getHeight()?~this._rowCount:this._trackY.hitTest(t)},me.prototype.getDefaultColumnWidth=function(){return this._trackX.getDefaultLaneSize()},me.prototype.setDefaultColumnWidth=function(t){this._trackX.getDefaultLaneSize()!==t&&(this._trackX.setDefaultLaneSize(t),this._syncLayoutToColumns(0))},me.prototype.getDefaultRowHeight=function(){return this._trackY.getDefaultLaneSize()},me.prototype.setDefaultRowHeight=function(t){if(this._trackY.getDefaultLaneSize()!==t){this._trackY.setDefaultLaneSize(t);for(let e=0;e<this._colCount;++e)this._columns[e].setHeight(t);this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)}},me.prototype.getColumnWidth=function(t){return this._trackX.getLaneSize(t)},me.prototype.setColumnWidth=function(t,e){return!!this._setColumnWidth(t,e)&&(this._syncLayoutToColumns(t),!0)},me.prototype._setColumnWidth=function(t,e){return this._trackX.setLaneSize(t,e)},me.prototype._updateColumnLayout=function(){this._syncLayoutToColumns(0)},me.prototype._startBindingSession=function(t){},me.prototype._getTempRowHeights=function(){return null},me.prototype.getRowHeight=function(t){return this._trackY.getLaneSize(t)},me.prototype.setRowHeight=function(t,e){if(t<0||t>=this._rowCount)return!1;let i=this._trackY.setLaneSize(t,e);return this._syncLayoutToRows(t,t+1),i&&this._dispatchRowHeightChangedEvent(t,t+1),this._resetTransformIETimer(),i},me.prototype._updateRowHeights=function(t,e){let i=0;for(let n=0;n<this._rowCount;++n){let o=t.getLaneSize(e);i|=this._trackY.setLaneSize(n,o),++e}return this._syncLayoutToRows(0,this._rowCount),i},me.prototype.isColumnVisible=function(t){return this._trackX.isLaneVisible(t)},me.prototype.hideColumn=function(t,e){return this.setColumnVisibility(t,!1===e,0)},me.prototype.isRowVisible=function(t){return this._trackY.isLaneVisible(t)},me.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)},me.prototype.getMinimumColumnWidth=function(t){return this._trackX.getMinimumLaneSize(t)},me.prototype.setMinimumColumnWidth=function(t,e){return!!this._trackX.setMinimumLaneSize(t,e)&&(this._syncLayoutToColumns(t),!0)},me.prototype.getMinimumRowHeight=function(t){return this._trackY.getMinimumLaneSize(t)},me.prototype.setMinimumRowHeight=function(t,e){return!!this._trackY.setMinimumLaneSize(t,e)&&(this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},me.prototype.getCellLeft=function(t){return this._trackX.getLaneStart(t)},me.prototype.getCellTop=function(t){return this._trackY.getLaneStart(t)},me.prototype.getCellWidth=function(t,e){let i=this._cellSpans.getOccupyingSpan(t,e);if(i){let t=this._trackX.getLaneStart(i.indexX);return this._trackX.getLaneEnd(i.indexX+i.colSpan-1)-t}return this.getColumnWidth(t)},me.prototype.getCellHeight=function(t,e){let i=this._cellSpans.getOccupyingSpan(t,e);if(i){let t=this._trackY.getLaneStart(i.indexY);return this._trackY.getLaneEnd(i.indexY+i.rowSpan-1)-t}return this.getRowHeight(e)},me.prototype.hasCellSpan=function(){return this._cellSpans.hasSpan()},me.prototype.getCellRowSpan=function(t,e){return this._cellSpans.getRowSpan(t,e)},me.prototype.setCellRowSpan=function(t,e,i){let n=this._cellSpans.setRowSpan(t,e,i);if(this._updateCellSpanSize(t,e,n),n)return n.retVal>=0?this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,!0):n.colSpan>1?(this._updateCellSpanClass(t,e,n.colSpan,n.prevRowSpan,!1),this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,!0)):this._updateCellSpanClass(t,e,n.colSpan,n.prevRowSpan,!1),0!==n.retVal;let o=this._getCell(t,e);return o&&o._rowSpan>1&&this._updateCellSpanClass(t,e,o._colSpan,o._rowSpan,!1),!1},me.prototype.getCellColSpan=function(t,e){return this._cellSpans.getColSpan(t,e)},me.prototype.setCellColSpan=function(t,e,i){let n=this._cellSpans.setColSpan(t,e,i);if(this._updateCellSpanSize(t,e,n),n)return n.retVal>=0?this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,!0):n.colSpan>1?(this._updateCellSpanClass(t,e,n.prevColSpan,n.rowSpan,!1),this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,!0)):this._updateCellSpanClass(t,e,n.prevColSpan,n.rowSpan,!1),0!==n.retVal;let o=this._getCell(t,e);return o&&o._colSpan>1&&this._updateCellSpanClass(t,e,o._colSpan,o._rowSpan,!1),!1},me.prototype.clearCellSpans=function(){let t=this._cellSpans.clearAllSpans();if(null==t)return!1;for(let e=t.length;--e>=0;){let i=t[e];this._updateCellSpan(i.indexX,i.indexY,i,!1)}return!0},me.prototype.clearColumnSpans=function(t){let e=this._cellSpans.removeSpanByColIndex(t);if(null==e)return!1;for(let t=e.length;--t>=0;){let i=e[t];this._updateCellSpan(i.indexX,i.indexY,i,!1)}return!0},me.prototype.clearColumnCustomizations=function(){this._trackX.clearLaneCustomizations(),this._syncLayoutToColumns(0)},me.prototype.clearRowCustomizations=function(){this._trackY.clearLaneCustomizations(),this._syncLayoutToRows(0,this._rowCount)},me.prototype.getColumnScalability=function(t){return this._trackX.getLaneScalability(t)},me.prototype.setColumnScalability=function(t,e){return this._trackX.setLaneScalability(t,e)},me.prototype.getRowScalability=function(t){return this._trackY.getLaneScalability(t)},me.prototype.setRowScalability=function(t,e){return this._trackY.setLaneScalability(t,e)},me.prototype.getCell=function(t,e,i){if(i&&this._cellSpans.hasSpan()){let i=this._cellSpans.getColSpan(t,e),n=this._cellSpans.getRowSpan(t,e);i<0&&(t+=i),n<0&&(e+=n)}return this._getCell(t,e)},me.prototype.getCellContent=function(t,e){let i=this.getCell(t,e);return null!==i?i.getContent():null},me.prototype.setCellContent=function(t,e,i){let n=this.getCell(t,e);return null==n?(window.console.log("Error: Accessing nonexistent cell in Grid's Table"),null):n.setContent(i)},me.prototype.getColumnCount=function(){return this._colCount},me.prototype.setColumnCount=function(t){if(t<0&&(t=0),this._colCount===t)return;let e=this._colCount;this._trackX.setLaneCount(t),this._colCount=this._trackX.getLaneCount();let i=0,n=null;if(e>t)for(i=e;--i>=t;)n=this._columns.pop(),n.dispose(),n===this._firstColumn&&(this._firstColumn=null),n===this._lastColumn&&(this._lastColumn=null);else for(i=e;i<t;++i)n=this._newColumn(i);for(this._updateColumnIndices(),i=e;i<t;++i)this._columns[i].activate(!this._colVir);t<=0&&this._selectionList.clearAllSelections()},me.prototype.getRowCount=function(){return this._rowCount},me.prototype.setRowCount=function(t,e){if(t<0&&(t=0),this._rowCount===t)return;let i,n=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(n>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(let e=t;e<n;++e)this._selectionList.deselect(e);else this._selectionList.clearAllSelections();else this._syncLayoutToRows(n,t);let o={};o.prevCount=n,o.rowCount=this._rowCount,this._dispatch("rowCountChanged",o),n<t&&this._insertCells(0,this._rowCount)},me.prototype.getVisibleRowCount=function(){return this._rowCount-this._hiddenRowCount},me.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))},me.prototype.removeRow=function(t){t<=0||(t>this._rowCount&&(t=this._rowCount),this.setRowCount(this._rowCount-t))},me.prototype.setBorders=function(t,e,i,n){},me.prototype.getColumnStyle=function(t,e){let i=this._columns[t];return i?i.getStyle(e):null},me.prototype.setColumnStyle=function(t,e,i){let n=this._columns[t];n&&n.setStyle(e,i)},me.prototype.enableColumnClass=function(t,e,i){let n=this._columns[t];n&&n.enableClass(e,i)},me.prototype.hasColumnClass=function(t,e){let i=this._columns[t];return!!i&&i.hasClass(e)},me.prototype.enableRowClass=function(t,e,i){if(t>=0&&t<this._rowCount)for(let n=0;n<this._colCount;++n)this._columns[n].getCell(t).enableClass(e,i)},me.prototype.setRowStyle=function(t,e,i,n){if(t>=0&&t<this._rowCount){i&&(null==n||n)||(i="");for(let n=0;n<this._colCount;++n)this._columns[n].getCell(t).setStyle(e,i)}},me.prototype.getRelativePosition=function(t){return nt.getRelativePosition(t,this._element)},me.prototype.getContentWidth=function(){return this._trackX.getTrackSize()},me.prototype.getContentHeight=function(){let t=this._trackY.getTrackSize();if(t<=0&&this._colCount*this.getVisibleRowCount()>0){let t=this._columns[0],e=t.getCell(this._rowCount-1);return e.getTop()+e.getHeight()-t.getCell(0).getTop()}return t},me.prototype.getCellsByRowIndex=function(t){if(t<0||t>=this._rowCount)return null;let e=new Array(this._colCount);for(let i=0;i<this._colCount;++i)e[i]=this._columns[i].getCell(t);return e},me.prototype.disableHorizontalGridLine=function(t){this.enableClass("no-horizontal-grid-line",!1!==t)},me.prototype.disableVerticalGridLine=function(t){this.enableClass("no-vertical-grid-line",!1!==t)},me.prototype.enableShading=function(t){!1!==t?this.addClass("tr-even-shading"):(this.removeClass("tr-even-shading"),this.removeClass("tr-odd-shading"))},me.prototype.setTransposedShading=function(t){this.enableClass("transposed-shading",!1!==t)},me.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)))},me.prototype.getRowHighlight=function(){return this._rowHighlightIndex},me.prototype.setRowHighlight=function(t){if((!this._rowHighlightEnabled||t<-1||t>=this._rowCount)&&(t=-1),this._rowHighlightIndex===t)return;let e=this._rowHighlightIndex;this._rowHighlightIndex=t;for(let t=this._highlightedCells.length;--t>=0;)this._highlightedCells[t].removeClass("highlighted-row");if(t>=0&&t<this._rowCount){this._highlightedCells.length=this._colCount;for(let e=this._colCount;--e>=0;){let i=this._columns[e].getCell(t);this._highlightedCells[e]=i,i.addClass("highlighted-row")}let e=this.getStretchedCell(t);e&&(this._highlightedCells.push(e),e.addClass("highlighted-row"))}else this._highlightedCells.length=0;if(this._hasListener("rowHighlighted")){let i={};i.prevRowIndex=e,i.rowIndex=t,this._dispatch("rowHighlighted",i)}},me.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},me.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},me.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},me.prototype.setSelectedRow=function(t,e){t<0||t>=this._rowCount||(this._selectionList.setSelection(t,e),this._updateSelectionUI(t))},me.prototype.selectSingleRow=function(t){t<0||t>=this._rowCount||(this.clearSelectedRows(),this._selectionList.select(t),this._addSelectionUI(t))},me.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(let i=0;i<e;++i)this._addSelectionUI(i+t)}},me.prototype.clearSelectedRows=function(){let t=this._selectionList.getSelectionCount();if(t){let e=this._selectionList.getAllSelections();this._selectionList.clearAllSelections();for(let i=0;i<t;++i)this._removeSelectionUI(e[i]);return t}return 0},me.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},me.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},me.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},me.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},me.prototype.activateColumn=function(t,e){let i=this._columns[t];if(i){let t=i.activate(e);if(e&&t&&this._rightSpace){let t=this._rightSpace.parentNode;t&&t.appendChild(this._rightSpace)}}},me.prototype.activateRows=function(){this._onEnterDocument()},me.prototype.moveRowsToTop=function(t){this._ctxRows.moveItemsToTop(t),this._stretchedCells.moveCellsToTop(t);for(let e=0;e<this._colCount;++e)this._columns[e].moveCellsToTop(t)},me.prototype.getFirstIndexInView=function(){return 0},me.prototype.getLastIndexInView=function(){return this._availableRowCount-1},me.prototype.isInCurrentView=function(t){return 0!==this._rowCount&&(t>=0&&t<this._rowCount)},me.prototype.getFrozenLayout=function(){return this._frozenLayout},me.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)))},me.prototype.getColumn=function(t){return this._columns[t]||null},me.prototype.insertColumn=function(t,e){t<0?t=0:t>this._colCount&&(t=this._colCount);let i=t<this._colCount,n=this._cellSpans.getAllSpans();this._updateCellSpans(n,!1),this._trackX.insertLane(t,e),this._colCount=this._trackX.getLaneCount();let o=this._newColumn(t);if(this._updateColumnIndices(),this._cellSpans.shiftColumn(t,1)&&(n=this._cellSpans.getAllSpans()),this._updateCellSpans(n,!0),this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._selectionList.getSelectionCount()){let t=this._selectionList.getAllSelections();for(let e=t.length;--e>=0;){let i=o.getCell(t[e]);i&&i.addClass("selected-row")}}return o.activate(i||!this._colVir),o},me.prototype.removeColumnAt=function(t){let e=this._trackX.removeLaneAt(t);if(null==e)return null;let i=this._cellSpans.getAllSpans();this._updateCellSpans(i,!1),this._colCount=this._trackX.getLaneCount();let n=this._columns.splice(t,1)[0];return n.dispose(),e.control=n,this._updateColumnIndices(),this._cellSpans.removeColumn(t)&&(i=this._cellSpans.getAllSpans()),this._updateCellSpans(i,!0),this._syncLayoutToColumns(t),t>=this._colCount&&this._updateCssWidth(),e},me.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)return;let i=this._cellSpans.getAllSpans();this._updateCellSpans(i,!1),this._trackX.moveLane(t,e);let n=this._columns[t];if(nt.moveArrayItem(this._columns,t,e),n.getElement().offsetParent){let t=e+1,i=this._columns[t]||null;for(;i&&!i.getElement().offsetParent;)i=this._columns[++t];n.insertBefore(i)}this._updateColumnIndices(),this._updateCellSpans(i,!0);let o=t<e?t:e;this._syncLayoutToColumns(o)},me.prototype.enableRowVirtualization=function(){console.log("WARNING: This function is deprecated")},me.prototype.enableColumnVirtualization=function(t){this._colVir=!1!==t},me.prototype.getColumnIndex=function(t){if(t){if(t.stretched)return this._stretchedCells.getColumnIndex(t);let e=this._columns.length;for(let i=0;i<e;++i)if(this._columns[i].getElement()===t)return i}return-1},me.prototype.getCellIndex=function(t,e){if(e){if(e.stretched)return this._stretchedCells.getRowIndex(e);let i=this._columns[t];if(i)return i.getCellIndex(e)}return-1},me.prototype.getIndex=function(){return this._index},me.prototype.setIndex=function(t){this._index=t},me.prototype.getRowOffset=function(){return this._rowOffset},me.prototype.setRowOffset=function(t){this._rowOffset=t},me.prototype.updateLayout=function(){this._calculateViewSize(!0),this._stretchedCells.updateCells(),this._updateRightSpaceStyle()},me.prototype.stretchCell=function(t,e,i,n){let o=-1;if("number"==typeof t?(o=t,null==e&&(e=0)):t&&(t.stretched?(o=this._stretchedCells.getColumnIndex(t),null==e&&(e=this._stretchedCells.getRowIndex(t))):t.getParent&&(o=this.getColumnIndex(t.getParent()))),o<0||e<0||null==e)return null;let r=null;if(!1!==i){let t=this._coverLayer;t||(t=this._coverLayer=document.createElement("div"),t.className="cover-layer",this._updateLayers()),this._calculateViewSize(),r=this._stretchedCells.stretchCell(e,n?o:0),r.setParent(t)}else r=this._stretchedCells.unstretchCell(e);if(r){let t=this._selectionList.getSelection(e);r.enableClass("selected-row",t)}return r},me.prototype.unstretchCell=function(t,e){return this.stretchCell(t,e,!1)},me.prototype.unstretchAllCells=function(){this._stretchedCells.unstretchAllCells()},me.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},me.prototype.getStretchedCells=function(){return this._stretchedCells.getCells()},me.prototype.updateStretchedCells=function(){this._updateLayers();let t=this._coverLayer?this._coverLayer.children.length:0;return!(t<=0)&&(this._calculateViewSize(!0),this._stretchedCells.updateCells(),!!t)},me.prototype._calculateViewSize=function(t){if(this._frozenLayout)return this._stretchedCells.getStretchSize();let e=this._ctx,i=t?0:this._stretchedCells.getStretchSize();if(!i&&e&&e.getWidth){let t=this.getContentWidth();return i=e.getWidth(),i?(t<i&&(i=t),this._stretchedCells.setStretchSize(i),i):t}return i},me.prototype._enableStretchCellClass=function(t,e,i){let n=this.getStretchedCell(t);n&&n.enableClass(e,i)},me.prototype._getViewSize=function(){return this._calculateViewSize()},me.prototype.getColumnHost=function(){return this._element},me.prototype.setHidingMethod=function(t){this._hidingMethod=t},me.prototype.getHidingMethod=function(){return this._hidingMethod},me.prototype.setColumnVisibility=function(t,e,i){return!!this._trackX.hideLane(t,!e,i)&&(this._syncLayoutToColumns(t),!0)},me.prototype.getRowLayout=function(){return this._trackY},me.prototype.reserveRightSpace=function(t){if(t&&t>0){if(!this._rightSpace){let t=this._rightSpace=document.createElement("div");t.className="tr-reserved-space",t.style.height=this.getContentHeight()+"px",this._updateLayers()}this._rightSpace.style.width=t+"px",this._rightSpaceSize=t,this._updateCssWidth()}else if(this._rightSpace){let t=this._rightSpace.parentNode;t&&t.removeChild(this._rightSpace),this._rightSpace=null,this._rightSpaceSize=0,this._updateCssWidth()}return this._rightSpace},me.prototype._updateRightSpaceStyle=function(){let t=this._rightSpace;if(!t)return;let 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")},me.prototype._updateLayers=function(){if(this._rightSpace){let 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)},me.prototype.getReservedSpace=function(){return this._rightSpace},me.prototype.getComputedStyle=function(){let t=this._element;return t.offsetParent?getComputedStyle(t):null},me.prototype.isColumnActive=function(t){let e=this._columns[t];return!!e&&e.isActive()},me.prototype.setRowAttributes=function(t,e){if(!(t<0||t>=this._rowCount))for(let i=0;i<this._colCount;++i){let n=e(i);for(let e=n.length;--e>=0;){let o=n[e],r=this._columns[i].getCell(t);r&&(o.remove?r.removeAttribute(o.attribute):r.setAttribute(o.attribute,o.value))}}},me.prototype.getContextRow=function(t){return this._ctxRows.getItem(t)},me.prototype.selectColumn=function(t,e){if(this.enableColumnClass(t,"selected-column",e),e){this._colSelDirty=!0,this._boundLayer||(this._initBoundLayer(),this._updateLayers())}},me.prototype.isSelectedColumn=function(t){return this.hasColumnClass(t,"selected-column")},me.prototype.selectCell=function(t,e,i){let n=this._getCell(t,e);n&&n.enableClass("selection",i)},me.prototype.setCellBounds=function(t,e,i,n){let o=this._initBoundLayer(),r=this._cellBoundPainter;r||(r=this._cellBoundPainter=new ye({boundLayer:o,layoutX:this._trackX,layoutY:this._trackY,hscrollbar:this._hscrollbar,calculateColumnBounds:this.calculateColumnBounds.bind(this)}));let s=this.getColumnCount();r.setCellBounds(t,e,i,n,s)},me.prototype.getHorizontalLayout=function(){return this._trackX},me.prototype.calculateColumnBounds=function(t,e,i,n){let o=0,r=0,s=!1,l=!1,a=this._trackX.getLaneCount();if(t>=0&&(o=this._trackX.getLaneStart(t),r=this._trackX.getLaneEnd(e)),o<r){let i,n,u=0,h=0,p=0,d=0;this._hscrollbar&&(h=this._hscrollbar.getScrollLeft(),p=this._hscrollbar.getPinnedLeftColumnCount(),d=this._hscrollbar.getPinnedRightColumnCount()),i=n=this._trackX.getTrackSize(),p&&(u=this._trackX.getLaneStart(p)),d&&(a-=d,i=this._getViewSize()-n+this._trackX.getLaneStart(a)),t>=p&&t<a?(o-=h,o<u?(o=u,s=!0):o>i&&(o=i,s=!0)):t>=a&&(o=this._getViewSize()-n+this._trackX.getLaneStart(t)),e>=p&&e<a?(r-=h,r<u?(r=u,l=!0):r>i&&(r=i,l=!0)):e>=a&&(r=this._getViewSize()-n+this._trackX.getLaneEnd(e))}i[0]=o,i[1]=r,n[0]=s,n[1]=l},me.prototype.updateColumnBounds=function(t,e,i){if(!this._colSelDirty)return;let n=this._colBounds,o=this._colBoundCache;n||(n=this._colBounds=[]),o||(o=this._colBoundCache=[]);let r,s=t.length,l=null,a=null,u=n.length;for(r=s;r<u;++r)a=n[r],l=a.parentNode,l&&l.removeChild(a);if(n.length=u=s,s)for(r=0;r<s;++r){let s=t[r],l=e[r],u=s[0],h=s[1];a=o[r],a||(a=o[r]=document.createElement("div"),a.className="selection-bound column-bound"),a.style.left=u+"px",a.style.width=h-u+"px",i=i||0,a.style.top=i+"px",a.style.height=this._trackY.getTrackSize()-i+"px",a.classList.toggle("no-left-bound",l[0]),a.classList.toggle("no-right-bound",l[1]),this._boundLayer&&(n[r]||(n[r]=a,this._boundLayer.appendChild(a)))}else this._colSelDirty=!1},me.prototype.updateColumnSeparators=function(){let t=this._hscrollbar.getPinnedLeftColumnCount(),e=this._hscrollbar.getPinnedRightColumnCount();!t&&!e||this._boundLayer||this._initBoundLayer();let i=!1;this._hscrollbar&&(i=this._hscrollbar.isActive());let n=this._boundLayer,o=this._leftColumnSeparator;if(i&&t){o||(o=this._leftColumnSeparator=this._createColumnSeparator()),o.parentNode||(n.children.length?n.insertBefore(o,n.children[0]):n.appendChild(o));let e=this._trackX.getLaneStart(t);o.style.left=e-1+"px",o.style.height=this._trackY.getTrackSize()+"px"}else o&&o.parentNode&&this._boundLayer.removeChild(o);if(o=this._rightColumnSeparator,i&&e){o||(o=this._rightColumnSeparator=this._createColumnSeparator()),o.parentNode||(n.children.length?n.insertBefore(o,n.children[0]):n.appendChild(o));let t=this.getColumnCount(),i=this._trackX.getLaneEnd(t-1)-this._trackX.getLaneStart(t-e),r=this._getViewSize();o.style.left=r-i-this._rightSpaceSize+"px",o.style.height=this._trackY.getTrackSize()+"px"}else o&&o.parentNode&&this._boundLayer.removeChild(o)},me.prototype._createColumnSeparator=function(){let t=document.createElement("div");return t.classList.add("column-separator"),t},me.prototype._initBoundLayer=function(){let t=this._boundLayer;return t||(t=this._boundLayer=document.createElement("div"),t.className="cover-layer",this._element.appendChild(t)),t},me.prototype._getCell=function(t,e){let i=this._columns[t];return i?i.getCell(e):null},me.prototype._insertCells=function(t,e){this._activeRow=t,this._activeRowEnd=e;let i=this._trackY.getLaneStart(t);for(let n=0;n<this._colCount;++n){let o=this._columns[n];o.hasCollapsedCells()||o.setTop(i),o.activateCells(t,e)}if(this._rightSpace&&(this._rightSpace.style.top=i+"px"),e>this._availableRowCount){let t={};t.prevRowIndex=this._availableRowCount,t.rowIndex=e,this._availableRowCount=e,this._dispatch("rowAvailable",t)}},me.prototype._newColumn=function(t){let e=new Jt(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(let t=0;t<this._rowCount;++t)this._trackY.isAtDefaultSize(t)||e.getCell(t).setHeight(this._trackY.getLaneSize(t));if(t>=this._columns.length)this._columns.push(e),e.setParent(this._element);else{this._columns.splice(t,0,e);let i=this._columns[t+1];e.insertBefore(i)}return e},me.prototype._updateCssWidth=function(){this._frozenLayout||(this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._element.style.width=this._getWidth()+"px")},me.prototype._updateViewHeight=function(){if(this._frozenLayout)return;let t=this.getContentHeight();this._element.style.height=t+"px",this._rightSpace&&(this._rightSpace.style.height=t+"px")},me.prototype._updateColumnIndices=function(){let 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"));let i=this._columns[t-1];i!==this._lastColumn&&(this._lastColumn&&this._lastColumn.removeClass("last"),this._lastColumn=i,this._lastColumn&&this._lastColumn.addClass("last"));let n=null;for(let t=this._columns.length;--t>=0;){let e=this._columns[t];e.setNextSibling(n),n=e}},me.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(let e=t;e<this._colCount;++e){let t=this._columns[e];t.setLeft(this._trackX.getLaneStart(e)),t.setWidth(this._trackX.getLaneSize(e))}return this._updateCellSpanLayout(this._cellSpans.getAllSpans()),this._updateCssWidth(),!0},me.prototype._syncLayoutToRows=function(t,e){if(!this._frozenLayout){for(let i=t;i<e;++i){let t=this._trackY.isAtDefaultSize(i)?-1:this._trackY.getLaneSize(i);for(let e=0;e<this._colCount;++e)this._columns[e].getCell(i).setHeight(t)}this._stretchedCells.updateYAxis(),t?this._updateCellSpanLayout(this._cellSpans.getAllSpans()):this._updateCellSpans(this._cellSpans.getAllSpans(),!0),this._updateViewHeight()}},me.prototype._dispatchRowHeightChangedEvent=function(t,e){if(!this._hasListener("rowHeightChanged"))return;if(t>=e)return;let i={};i.rowIndex=t,i.changeLength=e-t,this._dispatch("rowHeightChanged",i)},me.prototype._updateCellSpanSize=function(t,e,i){let n=this._getCell(t,e);if(null!=n)if(i&&i.colSpan>1?(n.setWidth(this.getCellWidth(t,e)),this._columns[t].disableDeactivation()):n.setWidth(-1),i&&i.rowSpan>1)n.setHeight(this.getCellHeight(t,e));else{let t=this._trackY.isAtDefaultSize(e)?-1:this._trackY.getLaneSize(e);n.setHeight(t)}},me.prototype._updateCellSpanLayout=function(t){if(null!=t)for(let e=t.length;--e>=0;){let i=t[e];this._updateCellSpanSize(i.indexX,i.indexY,i)}},me.prototype._updateCellSpan=function(t,e,i,n){this._updateCellSpanSize(t,e,n?i:null),this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,n)},me.prototype._updateCellSpanClass=function(t,e,i,n,o){let r;for(let s=0;s<i&&(r=this._columns[t+s],r);++s)r.collapseCells(e,n,o,0===s,s>0);let s=this._getCell(t,e);s&&(s._colSpan=o?i:1,s._rowSpan=o?n:1)},me.prototype._updateCellSpans=function(t,e){if(null!=t)for(let i=t.length;--i>=0;){let n=t[i];this._updateCellSpan(n.indexX,n.indexY,n,e)}},me.prototype._onMouseMove=function(t){let e=t.target,i=nt.closestElement(e,"cell"),n=this._stretchedCells.getColumnIndex(i);if(n<0){let t=nt.closestElement(e,"column");n=this.getColumnIndex(t)}let o=this.getCellIndex(n,i);this.setRowHighlight(o)},me.prototype._onMouseOut=function(t){let e=t.relatedTarget;if(e){let t=this._element;for(;null!==e.parentNode;)if(e=e.parentNode,e===t)return}this.setRowHighlight(-1)},me.prototype._updateSelectionUI=function(t){let e=this._selectionList.getSelection(t);this._enableStretchCellClass(t,"selected-row",e),this.enableRowClass(t,"selected-row",e)},me.prototype._addSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!0),this.enableRowClass(t,"selected-row",!0)},me.prototype._removeSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!1),this.enableRowClass(t,"selected-row",!1)},me.prototype._onEnterDocument=function(){if(!this._initialized&&this.getParent()){for(let t=0;t<this._colCount;++t)this._columns[t].enableAutoStyleUpdating();this._syncLayoutToColumns(0),this._initialized=!0}},me.prototype._setContext=function(t){this._ctx=t},me.prototype._getContext=function(){return this._ctx},me.prototype._resetTransformIETimer=function(){nt.isIE&&(this._transformIETimer||(this.enableClass("reset-transform"),this._transformIETimer=setTimeout(this._onResetTransformIE,20)))},me.prototype._onResetTransformIE=function(){this._transformIETimer=0,this.enableClass("reset-transform",!1)},me._proto=me.prototype;var Ce=me;let Se=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)};Se.prototype.dispose=function(){this._dt&&(this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=null)},Se.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())},Se.prototype.setField=function(t){this._field!==t&&(this._field=t,this._requestRecalculation())},Se.prototype.disableOnDemandMode=function(t){let e=!1===t;this._onDemandMode!==e&&(this._onDemandMode=e,this._requestRecalculation())},Se.prototype.setColumnDataGetter=function(t){this._colDataGetter!==t&&(this._colDataGetter=t,this._requestRecalculation())},Se.prototype.getColumnDataGetter=function(){return this._colDataGetter},Se.prototype.getSum=function(){return this._updateStats(),this._sum},Se.prototype.getDataCount=function(){return this._updateStats(),this._count},Se.prototype.getMin=function(){return this._updateStats(),this._min},Se.prototype.getMax=function(){return this._updateStats(),this._max},Se.prototype.getAbsoluteMax=function(){this._updateStats();let t=this._max>=0?this._max:-this._max,e=this._min>=0?this._min:-this._min;return t>=e?t:e},Se.prototype.getAverage=function(){return this._updateStats(),this._sum/this._count},Se.prototype.getMean=Se.prototype.getAverage,Se.prototype.getMidRange=function(){return this._updateStats(),.5*(this._max+this._min)},Se.prototype.getCachedColumnData=function(){return this._dirty?this._recalculate():this._cacheData||(this._cacheData=this._getColData()),this._cacheData},Se.prototype.markDirty=function(){return!!this._onDemandMode&&(this._dirty=!0,this._dirty)},Se.prototype._getColData=function(){return this._colDataGetter?this._colDataGetter(this._field,this._dt):this._dt.getColumnData(this._field)},Se.prototype._requestRecalculation=function(){this.markDirty()||this._recalculate()},Se.prototype._updateStats=function(){this._dirty&&this._recalculate()},Se.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)return;let t=this._cacheData=this._getColData(),e=t.length;if(!e)return;let i,n=Se._isDataNumeric,o=0;for(;o<e;)if(i=+t[o++],n(i)){this._sum=this._min=this._max=i,++this._count;break}for(;o<e;)i=+t[o],n(i)&&(this._sum+=i,i<this._min?this._min=i:i>this._max&&(this._max=i),++this._count),++o},Se.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;let 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()}},Se.prototype._updateRowData=function(t){let e=this._dt.getPreviousData(t,this._field),i=this._dt.getData(t,this._field);if(e===i)return;let n=Se._isDataNumeric(i);if(Se._isDataNumeric(e)){if(this._min===e&&(!n||i>this._min))return void this._recalculate();if(this._max===e&&(!n||i<this._max))return void this._recalculate();this._sum-=e,--this._count}n&&(this._sum+=i,i>=this._min||(this._min=i),i<=this._max||(this._max=i),++this._count)},Se._isDataNumeric=function(t){return"number"==typeof t&&t==t},Se.prototype.addRef=function(t){return t&&this._refs.indexOf(t)<0&&this._refs.push(t),this._refs.length},Se.prototype.deRef=function(t){if(t){let e=this._refs.indexOf(t);e>=0&&this._refs.splice(e,1)}return this._refs.length},Se.prototype.getRefCount=function(){return this._refs.length},Se.prototype._dt=null,Se.prototype._field="",Se.prototype._onDemandMode=!0,Se.prototype._dirty=!0,Se.prototype._cacheData=null,Se.prototype._sum=0,Se.prototype._min=NaN,Se.prototype._max=NaN,Se.prototype._count=0,Se.prototype._colDataGetter=null,Se.prototype._refs;var we=Se;let be=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")};l.inherits(be,lt),be.prototype._dv=null,be.prototype._dt=null,be.prototype._wrapIndex=0,be.prototype._rids,be.prototype._dataConflator=null,be.prototype._onDataChanged=function(t){if(this._dv){let e=this._dv.getVisibleRowIds(!0);this._refreshRids(e)&&(t.globalChange||(t.globalChange=!0),this._dispatch("dataChanged",t))}},be.prototype._onWrapSizeChanged=function(t){this._refreshRids(t.rids)&&this._dispatch("dataChanged",ft._globalChangeArg)},be.prototype._refreshRids=function(t){let e=!1;if(this._dv&&Array.isArray(t)){let i=this.getWrapSize();if(i>0){let n=i*this._wrapIndex;n<t.length?(e=!0,this._rids=t.slice(n,n+i)):this._rids.length&&(e=!0,this._rids.length=0)}}return e},be.prototype.dispose=function(){this._dv&&(this.unlistenAll(),this._dv.unlisten("dataChanged",this._onDataChanged),this._dv.unlisten("wrapSizeChanged",this._onWrapSizeChanged),this._dt=this._dv=null)},be.prototype.getData=function(t,e){return this._dt.getData(t,e)},be.prototype.getRowData=function(t){return this._dt.getRowData(t)},be.prototype.getColumnData=function(t,e){let i=this.getAllRowIds(!0,e),n=[],o=i.length;for(let r=0;r<o;++r){let o=this._dt.getRowData(i[r]);o?n.push(o[t]):e&&n.push(null)}return n},be.prototype.getRowId=function(t){return this._rids[t]||""},be.prototype._toRowId=function(t){return"number"==typeof t?this._rids[t]||"":t||""},be.prototype._toRowIds=function(t){let e=Array.isArray(t)?t.length:0,i=new Array(e),n=this._rids;for(let o=0;o<e;++o){let e=t[o];i[o]="number"==typeof e?n[e]||"":e||""}return i},be.prototype.getAllRowIds=function(t,e){return t?this._rids:this._rids.slice(0)},be.prototype.getVisibleRowIds=function(t){return t?this._rids:this._rids.slice(0)},be.prototype.getSortedRowIds=function(t){return t?this._rids:this._rids.slice(0)},be.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},be.prototype.getRowCount=function(){return this._rids.length},be.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},be.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},be.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},be.prototype.getMultipleRowData=function(t,e,i){return this._dt.getMultipleRowData(t,e,i)},be.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},be.prototype.setData=function(t,e,i){return!!this._dt&&this._dt.setData(t,e,i)},be.prototype.setRowData=function(t,e,i){return this._dv.setRowData(t,e,i)},be.prototype.setColumnData=function(t,e,i){this._dt&&this._dt.setColumnData(t,e,i)},be.prototype.setDataAt=function(t,e,i){let n=this.getRowId(t);return!(!n||!this._dt)&&this._dt.setData(n,e,i)},be.prototype.setRowDataAt=function(t,e,i){let n=this.getRowId(t);return this.setRowData(n,e,i)},be.prototype.insertRow=function(t,e,i){let n=this._toRowId(t);return this._dv.insertRow(n,e,i)},be.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},be.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},be.prototype.moveRow=function(t,e){let i=this._toRowId(e),n=Array.isArray(t)?t:[t],o=this._toRowIds(n);return this._dv.moveRow(o,i)},be.prototype.getDataTable=function(){return this._dt},be.prototype.getDataSource=function(){return this._dv},be.prototype.setDataSource=function(t){},be.prototype.setConflationRate=function(t){this._dv.setConflationRate(t)},be.prototype.getConflationRate=function(){return this._dv.getConflationRate()},be.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},be.prototype.sort=function(t,e,i,n){this._dv.sort(t,e,i,n)},be.prototype.sortOnce=function(t,e){this._dv.sortOnce(t,e)},be.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},be.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},be.prototype.isSorting=function(){return this._dv.isSorting()},be.prototype.hideRow=function(t,e){this.showRows([t],!1===e)},be.prototype.hideRows=function(t,e){this.showRows(t,!1===e)},be.prototype.showRows=function(t,e){let i=this._toRowIds(t);this._dv.showRows(i,e)},be.prototype.unhideAllRows=function(){this._dv.unhideAllRows()},be.prototype.hasHiddenRow=function(){return this._dv.hasHiddenRow()},be.prototype.filterIn=function(t,e,i){return this._dv.filterIn(t,e,i)},be.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},be.prototype.filterInOnce=function(t,e,i){this._dv.filterInOnce(t,e,i)},be.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},be.prototype.clearFilter=function(){this._dv.clearFilter()},be.prototype.disablePageCorrection=function(t){},be.prototype.setPage=function(t){return!1},be.prototype.gotoPage=be.prototype.setPage,be.prototype.nextPage=function(){return!1},be.prototype.previousPage=function(){return!1},be.prototype.prevPage=be.prototype.previousPage,be.prototype.lastPage=function(){return!1},be.prototype.firstPage=function(){return!1},be.prototype.getCurrentPage=function(){return 1},be.prototype.getPageIndex=be.prototype.getCurrentPage,be.prototype.isOnLastPage=function(){return!0},be.prototype.isOnFirstPage=function(){return!0},be.prototype.getPageSize=function(){return 0},be.prototype.getPageCount=function(){return 1},be.prototype.getTotalPages=be.prototype.getPageCount,be.prototype.setPageSize=function(t){},be.prototype.groupBy=function(t,e){this._dv.groupBy(t,e)},be.prototype.addGroup=function(t){this._dv.addGroup(t)},be.prototype.sortGroups=function(t){this._dv.sortGroups(t)},be.prototype.moveGroup=function(t,e){this._dv.moveGroup(t,e)},be.prototype.setPredefinedGroups=function(t){this._dv.setPredefinedGroups(t)},be.prototype.addFooter=function(t){this._dv.addFooter(t)},be.prototype.removeFooter=function(){this._dv.removeFooter()},be.prototype.enableMultiGroup=function(t){this._dv.enableMultiGroup(t)},be.prototype.getGroupByRowId=function(t){return this._dv.getGroupByRowId(t)},be.prototype.getGroup=function(t){return this._dv.getGroup(t)},be.prototype.getAllGroups=function(t){return this._dv.getAllGroups(t)},be.prototype.getGroupList=function(){return this._dv.getGroupList()},be.prototype.getGroupId=function(){return this._dv.getGroupId()},be.prototype.getGroupValue=function(){return this._dv.getGroupValue()},be.prototype.getGroupRowId=function(){return this._dv.getGroupRowId()},be.prototype.getFooterRowIndex=function(t){return this._dv.getFooterRowIndex(t)},be.prototype.getFooterRowIds=function(){return this._dv.getFooterRowIds()},be.prototype.hasGroup=function(){return this._dv.hasGroup()},be.prototype.getGroupRows=function(){return null},be.prototype.getGroupLevel=function(t){let e=this._toRowId(t);return this._dv.getGroupLevel(e)},be.prototype.enableColumnStats=function(t,e,i){return this._dv.enableColumnStats(t,e,i)},be.prototype.getColumnStats=function(t){return this._dv.getColumnStats(t)},be.prototype.hide=function(t){return this._dv.hide(t)},be.prototype.isHidden=function(){return this._dv.isHidden()},be.prototype.isHiddenRow=function(t){return this._dv.isHiddenRow(t)},be.prototype.collapse=function(t){this._dv.collapse(t)},be.prototype.collapseAllGroups=function(t){this._dv.collapseAllGroups(t)},be.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},be.prototype.isCollapsed=function(){return this._dv.isCollapsed()},be.prototype.enableContentAsHeader=function(t){this._dv.enableContentAsHeader(t)},be.prototype.getVisibleRowCount=function(){return this._rids.length},be.prototype.isRowDataInGroup=function(t,e){return this._dv.isRowDataInGroup(t,e)},be.prototype.isRowIdInGroup=function(t,e){return this._dv.isRowIdInGroup(t,e)},be.prototype.addRowExpansion=function(t,e){this._dv.addRowExpansion(t,e)},be.prototype.removeRowExpansion=function(t){this._dv.removeRowExpansion(t)},be.prototype.toggleRowExpansion=function(t,e,i){let n=this._toRowId(t);this._dv.toggleRowExpansion(n,e,i)},be.prototype.removeAllRowExpansions=function(){this._dv.removeAllRowExpansions()},be.prototype.getRowsWithExpansion=function(t,e){return this._dv.getRowsWithExpansion(t,e)},be.prototype.getExpansionParents=function(t,e){return this._dv.getExpansionParents(t,e)},be.prototype.isRowExpansion=function(t){return this._dv.isRowExpansion(t)},be.prototype.hasRowExpansion=function(t){return this._dv.hasRowExpansion(t)},be.prototype.getRowExpansionId=function(t,e){return this._dv.getRowExpansionId(t,e)},be.prototype.getRowExpansionIndex=function(t){return this._dv.getRowExpansionIndex(t)},be.prototype.searchAll=function(t,e){return this._dv.searchAll(t,e)},be.prototype.searchPrev=function(t,e){let i=this._toRowId(t);return this._dv.searchPrev(i,e)},be.prototype.searchNext=function(t,e){let i=this._toRowId(t);return this._dv.searchNext(i,e)},be.prototype.stall=function(t){return this._dv.stall(t)},be.prototype.enableAutoGroupRemoval=function(t){return this._dv.enableAutoGroupRemoval(t)},be.prototype.enableAutoGroupHiding=function(t){return this._dv.enableAutoGroupHiding(t)},be.prototype.synchronizeRowOrder=function(){this._dv.synchronizeRowOrder()},be.prototype.setSegmentSeparator=function(t,e){let i=this._toRowId(t);return this._dv.setSegmentSeparator(i,e)},be.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},be.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},be.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},be.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},be.prototype.collapseSegment=function(t,e){let i=this._toRowId(t);return this._dv.collapseSegment(i,e)},be.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},be.prototype.expandAllSegments=function(){return this._dv.expandAllSegments()},be.prototype.setSegmentCollapsingLogic=function(){},be.prototype.isSegmentCollapsed=function(t){let e=this._toRowId(t);return this._dv.isSegmentCollapsed(e)},be.prototype.fillSegment=function(t){let e=this._toRowId(t);this._dv.fillSegment(e)},be.prototype.fillSegments=function(){this._dv.fillSegments()},be.prototype.addSegmentChild=function(t,e){let i=this._toRowId(t),n=this._toRowId(e);return this._dv.addSegmentChild(i,n)},be.prototype.addSegmentChildren=function(t,e){let i=this._toRowId(t),n=this._toRowIds(e);return this._dv.addSegmentChildren(i,n)},be.prototype.removeSegmentChild=function(t,e){let i=this._toRowId(t),n=this._toRowId(e);return this._dv.removeSegmentChild(i,n)},be.prototype.removeSegmentChildren=function(t,e){let i=this._toRowId(t),n=this._toRowIds(e);return this._dv.removeSegmentChildren(i,n)},be.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},be.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},be.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},be.prototype.sortSegments=function(t){this._dt.sortSegments(t)},be.prototype.getWrapSize=function(){return this._dv.getWrapSize()},be.prototype.getWrappedViews=function(){return this._dv.getWrappedViews()},be.prototype.wrapView=function(t){this._dv.wrapView(t)},be.prototype.dump=function(t){return ut.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},be.prototype.log=function(t){console.table(this.dump(t))},be.prototype.isRowFiltered=function(t,e){return this._dv.isRowFiltered(t,e)};var Re=be;let ve=function(t){let 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 r(this._onDataChanged,0),e._conflator.disable(),e._addEvents("dataChanged","preDisposed","pageIndexChanged","pageCountChanged","groupAdded","beforeGroupAdded","groupCriteriaChanged","beforeFiltering","wrapCountChanged","wrapSizeChanged"),e.setDataSource(t)};l.inherits(ve,lt),ve.prototype._rids,ve.prototype._groupView=null,ve.prototype._pageView=null,ve.prototype._expansionView=null,ve.prototype._hiddenRids=null,ve.prototype._collapsedRids=null,ve.prototype._excludedRids=null,ve.prototype._emptySegmentFiltering=!1,ve.prototype._separatorFiltering=!1,ve.prototype._expansionMap=null,ve.prototype._expansionChildren=null,ve.prototype._expansionCount=0,ve.prototype._dt=null,ve.prototype._parent=null,ve.prototype._shared=null,ve.prototype._sortingDefs=null,ve.prototype._userFilter=null,ve.prototype._filteringOut=!1,ve.prototype._refreshTimerId=0,ve.prototype._groupSortingLogic=null,ve.prototype._pageCorrection=!0,ve.prototype._pageSize=0,ve.prototype._pageIndex=1,ve.prototype._lastPageIndex=0,ve.prototype._groupCriteria=null,ve.prototype._preDefGroups=null,ve.prototype._preDefGroupsDirty=!1,ve.prototype._groupMembers=null,ve.prototype._groupList=null,ve.prototype._groupRows=null,ve.prototype._groupId="",ve.prototype._groupColor="",ve.prototype._groupValue,ve.prototype._groupRowId="",ve.prototype._footerRowIds=null,ve.prototype._groupLevel=0,ve.prototype._groupViewDirty=!1,ve.prototype._columnStats,ve.prototype._hidden=!1,ve.prototype._hiddenHeaderRow=!1,ve.prototype._collapsed=!1,ve.prototype._collapsible=!0,ve.prototype._showOnlyFirstMember=!1,ve.prototype._beingAdded=!1,ve.prototype._conflator=null,ve.prototype._wrappedViews=null,ve.prototype._wrapSize=0,ve.prototype._wrapTimerId=0,ve.prototype._stalledSorting=!1,ve.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(let t in this._columnStats)this._columnStats[t].dispose();this._columnStats=null}},ve.prototype.getData=function(t,e){return this._dt.getData(t,e)},ve.prototype.getRowData=function(t){return this._dt.getRowData(t)},ve.prototype.getColumnData=function(t,e){let i=this.getAllRowIds(!0,e),n=[],o=i.length;for(let r=0;r<o;++r){let o=this._dt.getRowData(i[r]);o?n.push(o[t]):e&&n.push(null)}return n},ve.prototype.getRowId=function(t){return this._rebuildRowIdsFromChildren(),this._getRids()[t]||""},ve.prototype._toRowId=function(t){return"number"==typeof t?(this._rebuildRowIdsFromChildren(),this._getRids()[t]||""):t||""},ve.prototype._toRowIds=function(t){let e=Array.isArray(t)?t.length:0,i=new Array(e),n=this._getRids();for(let o=0;o<e;++o){let e=t[o];"number"==typeof e?(this._rebuildRowIdsFromChildren(),i[o]=n[e]||""):i[o]=e||""}return i},ve.prototype.getAllRowIds=function(t,e){this._rebuildRowIdsFromChildren();let i=e?this._getRids():this._pageView||this._rids;return t?i:i.slice(0)},ve.prototype.getVisibleRowIds=function(t){this._rebuildRowIdsFromChildren();let e=this._getRids();return t?e:e.slice(0)},ve.prototype.getSortedRowIds=function(t){return this._rebuildRowIdsFromChildren(),t?this._rids:this._rids.slice(0)},ve.prototype.getRowIndex=function(t){return this._rebuildRowIdsFromChildren(),this._getRids().indexOf(t)},ve.prototype.getRowCount=function(){return this._getRids().length},ve.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},ve.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},ve.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},ve.prototype.getMultipleRowData=function(t,e,i){return this._dt.getMultipleRowData(t,e,i)},ve.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},ve.prototype.setData=function(t,e,i){return!!this._dt&&this._dt.setData(t,e,i)},ve.prototype.setRowData=function(t,e,i){return!(!t||!this._dt||this.isRowExpansion(t))&&this._dt.setRowData(t,e,i)},ve.prototype.setColumnData=function(t,e,i){this._dt&&this._dt.setColumnData(t,e,i)},ve.prototype.setDataAt=function(t,e,i){let n=this.getRowId(t);return!(!n||!this._dt)&&this._dt.setData(n,e,i)},ve.prototype.setRowDataAt=function(t,e,i){let n=this.getRowId(t);return this.setRowData(n,e,i)},ve.prototype.insertRow=function(t,e,i){this._rebuildRowIdsFromChildren();let n=this._toRowId(t);return this._dt?this._dt.insertRow(n,e,i):""},ve.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},ve.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},ve.prototype.moveRow=function(t,e){let i=this._toRowId(e),n=Array.isArray(t)?t:[t],o=this._toRowIds(n);return this._dt.hasSegmentation()&&this.synchronizeRowOrder(),this._dt._moveRow(o,i)},ve.prototype.swapRow=nt._deprecatedFunction,ve.prototype.getDataTable=function(){return this._dt},ve.prototype.getDataSource=function(){return this._parent},ve.prototype.setDataSource=function(t){if(t){if(this._groupLevel>0)return;this._setParent(t),this._onDataChanged(ft._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={}},ve.prototype.setConflationRate=function(t){this._conflator.disable(!t),this._conflator.setConflatingTime(t)},ve.prototype.getConflationRate=function(){return this._conflator.getConflatingTime()},ve.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)},ve.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},ve.prototype.sort=function(t,e,i,n){if(this._groupLevel>0)return void window.console.log("ERROR: Sub-group cannot be sorted individually");let o=this.getSortingLogics(),r=this._sortingDefs,s=r.length;if(Array.isArray(i))for(let e=i.length;--e>=0;)if("function"!=typeof i[e]){let n=Array.isArray(t)?t[e]:t;i[e]=o[n]||o._default}if(ft._buildSortContext(r,t,e,i||o),1===r.length&&0===r[0][3]&&(r.length=0),s<=0&&r.length<=0)return;if(this._shared.stalledRids)return;let l=!1;this._groupMembers||r.length<=0||n?(l=!0,this._updateRowIds()):l=this._sort(),l&&this._dispatchDataChange(ft._positionChangeArg)},ve.prototype.sortOnce=function(t,e){this.sort(t,e),this._sortingDefs.length=0},ve.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},ve.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},ve.prototype.getColumnSortingLogic=function(t){return this._dt?this._dt.getColumnSortingLogic(t):null},ve.prototype.isSorting=function(){return this._sortingDefs.length>0},ve.prototype.hideRow=function(t,e){this.hideRows([t],e)},ve.prototype.hideRows=function(t,e){e=!1!==e;let i=this._hiddenRids;if(e)i||(i=this._hiddenRids={});else if(!i)return;let n=this._toRowIds(t),o=!1;for(let t=n.length;--t>=0;){let r=n[t];r&&(e?i[r]||(i[r]=!0,o=!0):i[r]&&(delete i[r],o=!0))}if(o){if(!e){let t=!1;for(let e in i){t=!0;break}t||(i=this._hiddenRids=null)}this._refreshAndNotify()}},ve.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},ve.prototype.unhideAllRows=function(){this._hiddenRids&&(this._hiddenRids=null,this._refreshAndNotify())},ve.prototype.hasHiddenRow=function(){return!!this._hiddenRids},ve.prototype.filterIn=function(t,e,i){let n=this._getFilterLogic(t,e),o=!0===i;return!!(this._userFilter!==n||"function"==typeof t||n&&o!==this._filteringOut)&&(this._shared.filterLogic=n,this._userFilter=n,this._filteringOut=o,this._refreshAndNotify(),!0)},ve.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},ve.prototype.filterInOnce=function(t,e,i){let n=this._getFilterLogic(t,e),o={};if(!this._getRemovalMap(o,n,!0===i))return;let r=this._removeRowIds(o);this._updatePageCount()||this._transformView(r)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(Object.keys(o))},ve.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},ve.prototype._removeRowIds=function(t){let e=ve._removeArrayItems(this._rids,t);if(this._groupView&&(e=ve._removeArrayItems(this._groupView,t)),this._groupMembers){let e=this._groupList.length;for(let i=0;i<e;++i){let e=this._groupList[i];this._groupMembers[e]._removeRowIds(t)}}return e},ve.prototype.clearFilter=function(){this._userFilter&&(this._userFilter=null,this._shared.filterLogic=null,this._refreshAndNotify())},ve.prototype.disablePageCorrection=function(t){this._pageCorrection=!1===t},ve.prototype.setPage=function(t){let e=this._setPage(t);return e&&this._dispatchGlobalChange(),e},ve.prototype.gotoPage=ve.prototype.setPage,ve.prototype.nextPage=function(){return this.gotoPage(this._pageIndex+1)},ve.prototype.previousPage=function(){return this.gotoPage(this._pageIndex-1)},ve.prototype.prevPage=ve.prototype.previousPage,ve.prototype.lastPage=function(){return this.gotoPage(this._lastPageIndex)},ve.prototype.firstPage=function(){return this.gotoPage(0)},ve.prototype.getCurrentPage=function(){return this._pageIndex},ve.prototype.getPageIndex=ve.prototype.getCurrentPage,ve.prototype.isOnLastPage=function(){return this._pageIndex===this._lastPageIndex},ve.prototype.isOnFirstPage=function(){return 1===this._pageIndex},ve.prototype.getPageSize=function(){return this._pageSize},ve.prototype.getPageCount=function(){return this._lastPageIndex},ve.prototype.getTotalPages=ve.prototype.getPageCount,ve.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())},ve.prototype.groupBy=function(t,e){if(this._shared.multiGroupRow=!1,this._groupCriteria){if(this._groupList&&this._groupList.length>0){for(let t in this._groupMembers)this._groupMembers[t].dispose();this._groupMembers={},this._groupList.length=0}this._groupCriteria=null}let i,n;if(null!=e&&this._setPredefinedGroups(e),t&&0===this._groupLevel){let e;for(this._groupCriteria=[],e=Array.isArray(t)?t:[t],n=e.length,i=0;i<n;++i){let t=e[i];"string"==typeof t?this._groupCriteria.push(this._defaultGroupCriteria.bind(this,t)):t&&this._groupCriteria.push(t)}}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,i=0;i<n;++i)delete this._groupRows[this._footerRowIds[i]];this._footerRowIds=null}this._groupRows=null}this._groupValue=null}this._groupLevel=0,this._updateRowIds(),this._dispatch("groupCriteriaChanged",{}),this._dispatchGlobalChange()},ve.prototype.addGroup=function(t){if(this._groupMembers)if(isArray(t)){let e=t,i=e.length;for(let t=0;t<i;++t)this._addGroup(e[t])}else this._addGroup(t)},ve.prototype.sortGroups=function(t){if(this._groupMembers&&(this._groupSortingLogic=null==t?ve._defaultGroupSortingLogic:t||null,this._groupSortingLogic)){this._groupList.sort(this._internalGroupSortingLogic);for(let t=this._groupList.length;--t>=0;){let e=this._groupList[t];this._groupMembers[e].sortGroups(this._groupSortingLogic)}this._groupViewDirty=!0,this._groupLevel<=0&&this._dispatchGlobalChange()}},ve.prototype.moveGroup=function(t,e){let i=this.getGroup(t);if(!i)return;let n=i.getDataSource(),o=i.getGroupId(),r=n._groupList.indexOf(o);r!==e&&r+1!==e&&(n._groupList.splice(r,1),r<e&&--e,n._groupList.splice(e,0,o),this._requestRebuildingRowIds(!1))},ve.prototype.setPredefinedGroups=function(t){this._setPredefinedGroups(t),this._groupMembers&&this._refreshAndNotify()},ve.prototype._setPredefinedGroups=function(t){if(this._preDefGroups===t)return;this._preDefGroups&&(this._preDefGroups.length=0);let e=!1;if(t)for(let 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},ve.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(let e=0;e<t;++e){let t=this._groupRowId+"_footer"+(this._footerRowIds.length||"");this._footerRowIds.push(t),this._groupRows[t]=this}this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},ve.prototype.removeFooter=function(){if(this._footerRowIds){let t=this._footerRowIds.length;for(let e=0;e<t;++e)delete this._groupRows[this._footerRowIds[e]];this._footerRowIds=null,this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},ve.prototype.enableMultiGroup=function(t){this._shared.multiGroupRow=!1!==t},ve.prototype.getGroupByRowId=function(t){return this._groupRows&&this._groupRows[t]||null},ve.prototype.getGroup=function(t){if(!this._groupMembers)return null;let e;if("number"==typeof t){if(e=this._groupList[t],!e)return null}else e=t+"";let i=this._groupMembers[e];if(i)return i;let n=e;return i=this._groupRows[n],i||this._getGroupByContentRowId(n)},ve.prototype._getGroupByContentRowId=function(t){if(this._groupMembers)for(let e=0;e<this._groupList.length;e++){let i=this._groupList[e],n=this._groupMembers[i]._getGroupByContentRowId(t);if(n)return n}else if(-1!==this._rids.indexOf(t))return this;return null},ve.prototype.getAllGroups=function(t){if(t||(t=[]),this._groupMembers){let e=this._groupList.length;for(let i=0;i<e;++i){let e=this._groupList[i],n=this._groupMembers[e];t.push(n),n.getAllGroups(t)}}return t},ve.prototype.getGroupList=function(){return this._groupList},ve.prototype.getGroupId=function(){return this._groupId},ve.prototype.getGroupValue=function(){return this._groupValue},ve.prototype.getGroupRowId=function(){return this._groupRowId},ve.prototype.getFooterRowIndex=function(t){if(this._footerRowIds)for(let e=this._footerRowIds.length;--e>=0;)if(this._footerRowIds[e]===t)return e;return-1},ve.prototype.getFooterRowIds=function(){return this._footerRowIds},ve.prototype.hasGroup=function(){return!!this._groupMembers},ve.prototype.getGroupRows=function(){return null},ve.prototype.getGroupLevel=function(t){if(null!=t&&this._groupRows){if("number"!=typeof t){let e=this.getGroup(t);return e?e._groupLevel:-1}{this._rebuildRowIdsFromChildren();let e=this._getRids(),i=e[t];for(;i;){let n=this._groupRows[i];if(n)return n._groupLevel;i=e[--t]}}}return this._groupLevel},ve.prototype.enableColumnStats=function(t,e,i){if(!t)return null;let n=!1!==e,o=this._columnStats[t];if(n?(o||(o=new we(this,t),this._columnStats[t]=o),o.addRef(i)):o&&(o.deRef(i)||(o.dispose(),delete this._columnStats[t])),this._groupMembers)for(let n=this._groupList.length;--n>=0;){let o=this._groupList[n];this._groupMembers[o].enableColumnStats(t,e,i)}return o||null},ve.prototype.getColumnStats=function(t){return this._columnStats[t]||null},ve.prototype.hide=function(t){let e=!1!==t;return this._hidden!==e&&(this._hidden=e,this._refreshAndNotify(),!0)},ve.prototype.isHidden=function(){return this._hidden},ve.prototype.isHiddenRow=function(t){return!!this._hiddenRids&&!0===this._hiddenRids[t]},ve.prototype._isHeaderRowShown=function(){return!this._hiddenHeaderRow&&((!this._shared.filterLogic||0!==this._rids.length)&&(!this._shared.autoGroupHiding||null!=this._groupValue))},ve.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},ve.prototype.collapse=function(t){this._setCollapse(!1!==t)&&(this._shared.contentAsHeader?this._hiddenHeaderRow&&this._requestRebuildingRowIds(this._showOnlyFirstMember):this._groupLevel>0&&this._requestRebuildingRowIds(this._collapsed))},ve.prototype.collapseAllGroups=function(t){let e=this.getAllGroups(),i=e.length;if(i){let n=!1!==t;for(let t=0;t<i;++t){e[t]._setCollapse(n)}this._requestRebuildingRowIds(!1)}},ve.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},ve.prototype.isCollapsed=function(){return this._collapsed||this._showOnlyFirstMember},ve.prototype.enableContentAsHeader=function(t){this._shared.contentAsHeader=!1!==t},ve.prototype.setDefaultCollapse=function(t){this._shared.defaultCollapse=!!t},ve.prototype.getDefaultCollapse=function(){return!!this._shared.defaultCollapse},ve.prototype.isCollapsible=function(){return this._collapsible},ve.prototype.disableCollapsing=function(t){this._collapsible=!(!1!==t)},ve.prototype.setGroupColor=function(t){1===this._groupLevel&&(this._groupColor=t)},ve.prototype.getGroupColor=function(){return 0===this._groupLevel?"":1===this._groupLevel?this._groupColor:this._parent.getGroupColor()},ve.prototype._getFirstHiddenRids=function(){if(this._shared.contentAsHeader&&this._showOnlyFirstMember){let t=this._rids;if(Array.isArray(t)&&t.length)return[t[0]]}return null},ve.prototype.getVisibleRowCount=function(){return this._collapsed?0:(this._rebuildRowIdsFromChildren(),this._getRids().length)},ve.prototype.isRowDataInGroup=function(t,e){let i=this._groupCriteria,n=this._groupLevel;if(!e||e===this.getGroupId())return this._isAllowedInGroup(null,t);for(let o=n;o<i.length;o++)if(i[o](t).indexOf(e)>=0)return!0;return!1},ve.prototype.isRowIdInGroup=function(t,e){let i=this.getRowData(t);return!!i&&this.isRowDataInGroup(i,e)},ve._getDataViewExpansionId=function(t,e){return t+"_ex"+e},ve.prototype.addRowExpansion=function(t,e){if(this._groupLevel>0)return;if(!e||e<0){if(null!=e)return;e=1}let i=this._rids.indexOf(t);if(i<0)return;let n=0;this._expansionMap?n=this._expansionMap[t]||0:(this._expansionMap={},this._expansionChildren={});let o=n+e;this._expansionMap[t]=o;for(let e=n;e<o;e++)this._expansionChildren[ve._getDataViewExpansionId(t,e)]=t;if(n||this._expansionCount++,!this._groupViewDirty&&this._updateExpansionView()){let e={};e.rid=t,e.type="inserted",e.nextRid=this._rids[i+1],e.fallback=i,this._dispatchDataChange(e)}},ve.prototype.removeRowExpansion=function(t){if(!this._expansionMap)return;let e=this._expansionMap[t];if(!e)return;let i=new Array(e);for(let n=0;n<e;++n)i[n]=ve._getDataViewExpansionId(t,n),delete this._expansionChildren[i[n]];delete this._expansionMap[t],this._expansionCount--,this._groupViewDirty||this._updateExpansionView()&&(1===e?this._dispatchRowRemoved(i[0]):this._dispatchMultiRowRemoved(i))},ve.prototype.toggleRowExpansion=function(t,e,i){let n=this._toRowId(t);(e=null!=e?!0===e:!this.hasRowExpansion(n))?this.addRowExpansion(n,i):this.removeRowExpansion(n)},ve.prototype.removeAllRowExpansions=function(){this._expansionMap&&(this._expansionMap=null,this._expansionCount=0,this._expansionView=null,this._expansionChildren=null,this._refreshAndNotify())},ve.prototype.getRowsWithExpansion=function(t,e){if(!this._expansionMap)return[];let i=this._expansionView,n=i.length;(null==e||e>n)&&(e=n),t>0||(t=0);let o=this._expansionCount,r=new Array(n);for(let n=t;n<e;++n){let t=i[n];if(this._expansionMap[t]&&(r[n]=t,--o<=0))break}return r},ve.prototype.getExpansionParents=function(t,e){let i=[];if(this._expansionMap){let n=this._expansionView,o=n.length;(null==e||e>o)&&(e=o),(!t||t<0)&&(t=0);for(let o=t;o<e;++o)i[o]=this._expansionChildren[n[o]]||""}return i},ve.prototype.getExpansionParentByRowId=function(t){return this._expansionChildren&&this._expansionChildren[t]||""},ve.prototype.isRowExpansion=function(t){return!!this._expansionChildren&&!!this._expansionChildren[t]},ve.prototype.hasRowExpansion=function(t){return!!this._expansionMap&&!!this._expansionMap[t]},ve.prototype.getRowExpansionCount=function(t){return this._expansionMap&&this._expansionMap[t]||0},ve.prototype.getRowExpansionId=function(t,e){if(this._expansionMap){if(e||(e=0),e<(this._expansionMap[t]||0))return ve._getDataViewExpansionId(t,e)}return""},ve.prototype.getRowExpansionIndex=function(t){if(t){let e=t.match(/_ex(\d+)$/);if(e)return+e[1]}return-1},ve.prototype._updateExpansionView=function(){let 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;let e=this._pageView||this._groupView||this._rids,i=e.length,n=this._expansionView?this._expansionView.length:0;this._expansionView?this._expansionView.length=i:this._expansionView=new Array(i);let o=this._expansionCount;for(let n=0,r=0;n<i;++n){let i=e[n];if(this._expansionView[r++]=i,o){let e=t[i]||0;if(e){for(let t=0;t<e;++t)this._expansionView[r++]=ve._getDataViewExpansionId(i,t);--o}}}return n!==this._expansionView.length}return!1},ve.prototype._transformView=function(t){let e=this._updatePaginationView(t);return e|=this._updateExpansionView(),!!e},ve.prototype.searchAll=function(t,e){e||(e=[]),this._rebuildRowIdsFromChildren();let i=this._getRids(),n=i.length;for(let o=0;o<n;++o){let n=i[o],r=this._dt.getRowData(n);r&&t(r)&&e.push(n)}return e},ve.prototype.searchPrev=function(t,e){this._rebuildRowIdsFromChildren();let i=this._getRids(),n=-1;"number"==typeof t?this._dt.getRowData(i[t])&&(n=t):n=i.indexOf(t);let o=-1,r=i.length;return n>0&&(o=this._searchRow(i,e,n-1,-1,-1),o>=0)||n>=0&&(o=this._searchRow(i,e,r-1,n,-1),o>=0)?o:-1},ve.prototype.searchNext=function(t,e){this._rebuildRowIdsFromChildren();let i=this._getRids(),n=-1;if("number"==typeof t?this._dt.getRowData(i[t])&&(n=t):n=i.indexOf(t),n<0)return-1;let o=-1,r=i.length;return n<r-1&&(o=this._searchRow(i,e,n+1,r,1),o>=0)||n>0&&(o=this._searchRow(i,e,0,n,1),o>=0)?o:-1},ve.prototype._searchRow=function(t,e,i,n,o){for(;i!==n;){let n=t[i],r=this._dt.getRowData(n);if(r&&e(r))return i;i+=o}return-1},ve.prototype.stall=function(t){let e=!1!==t;if(!!this._shared.stalledRids===e)return!1;if(e){let t={};this._shared.stalledRids=t;let e=this._getRids();for(let i=e.length;--i>=0;)t[e[i]]=1}else this._shared.stalledRids=null,this._refreshAndNotify();return!0},ve.prototype.stallSorting=function(t){let e=!1!==t;return this._stalledSorting!==e&&(this._stalledSorting=e,!e&&this.isSorting()&&this._sort()&&this._dispatchDataChange(ft._positionChangeArg),!0)},ve.prototype.enableAutoGroupRemoval=function(t){return t=!1!==t,!!this._shared.autoGroupRemoval!==t&&(this._shared.autoGroupRemoval=t,this._triggerGroupRefreshing(),!0)},ve.prototype.enableAutoGroupHiding=function(t){return t=!1!==t,!!this._shared.autoGroupHiding!==t&&(this._shared.autoGroupHiding=t,this._triggerGroupRefreshing(),!0)},ve.prototype.synchronizeRowOrder=function(){!this._stalledSorting&&this.isSorting()&&this._dt._sort(this._sortingDefs)},ve.prototype.setSegmentSeparator=function(t,e){let 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))},ve.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},ve.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},ve.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},ve.prototype.getSegment=function(t){return this._dt.getSegment(t)},ve.prototype.getSegmentParent=function(t){return this._dt.getSegmentParent(t)},ve.prototype.getSegmentLevel=function(t){return this._dt.getSegmentLevel(t)},ve.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},ve.prototype.collapseSegment=function(t,e){e=!1!==e;let i=this._dt._getSegmentSeparators();if(i){let n=this._toRowId(t);if(i.collapseSegment(n,e))return this._refreshAndNotify(),!0}return!1},ve.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},ve.prototype.expandAllSegments=function(){let t=this._dt._getSegmentSeparators();return!(!t||!t.expandAllSegments())&&(this._refreshAndNotify(),!0)},ve.prototype.setSegmentCollapsingLogic=function(){},ve.prototype.isSegmentCollapsed=function(t){let e=this._dt._getSegmentSeparators();return!!e&&e.isCollapsedSegment(this._toRowId(t))},ve.prototype.fillSegment=function(t){this._dt.fillSegment(this._toRowId(t))},ve.prototype.fillSegments=function(){this._dt.fillSegments()},ve.prototype.addSegmentChild=function(t,e,i){if(this._dt._getSegmentSeparators()){let n=this._toRowId(t),o=this._toRowId(e);return this._dt.addSegmentChild(n,o,i)}return!1},ve.prototype.addSegmentChildren=function(t,e,i){if(this._dt._getSegmentSeparators()){let n=this._toRowId(t),o=this._toRowIds(e);return this._dt.addSegmentChildren(n,o,i)}return!1},ve.prototype.removeSegmentChild=function(t,e){if(this._dt._getSegmentSeparators()){let i=this._toRowId(t),n=this._toRowId(e);return this._dt.removeSegmentChild(i,n)}return!1},ve.prototype.removeSegmentChildren=function(t,e){if(this._dt._getSegmentSeparators()){let i=this._toRowId(t),n=this._toRowIds(e);return this._dt.removeSegmentChildren(i,n)}return!1},ve.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},ve.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},ve.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},ve.prototype.sortSeparators=function(t,e,i){this._dt.sortSeparators(t,e,i)},ve.prototype.sortSegments=function(t){this._dt.sortSegments(t)},ve.prototype.enableEmptySegmentFiltering=function(t){t=!1!==t,this._emptySegmentFiltering!==t&&(this._emptySegmentFiltering=t,this._userFilter&&this._refreshAndNotify())},ve.prototype.enableSeparatorFiltering=function(t){t=!1!==t,this._separatorFiltering!==t&&(this._separatorFiltering=t,this._userFilter&&this._refreshAndNotify())},ve.prototype.setSegmentClassification=function(t,e){return this._dt.setSegmentClassification(this._toRowId(t),e)},ve.prototype._getSharedObject=function(){return this._shared},ve.prototype.getWrapSize=function(){return this._wrapSize},ve.prototype.getWrappedViews=function(){return this._wrappedViews},ve.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()},ve.prototype._updateWrapCount=function(){this._wrapTimerId=0;let t,e=this._wrapSize,i=this._wrappedViews,n=i?i.length:0,o=0;if(e){let r=this.getVisibleRowIds(!0),s=r.length;if(o=Math.ceil(s/e),n<o)for(i||(i=this._wrappedViews=[]),t=n;t<o;++t)this._wrappedViews[t]=new Re({dataView:this,wrapIndex:t,rids:r})}if(o<n){for(t=n;--t>=o;)this._wrappedViews[t].dispose();this._wrappedViews.length=o}e||(this._wrappedViews=null),n!==o&&this._dispatch("wrapCountChanged",{prevCount:n,newCount:o})},ve.prototype.dump=function(t){this._rebuildRowIdsFromChildren();let e=this._getRids();return ut.constructTable(this.getMultipleRowData(e),t,e)},ve.prototype.log=function(t){console.table(this.dump(t))},ve.prototype._getRids=function(){return this._expansionView||this._pageView||this._groupView||this._rids},ve.prototype._updateRowIds=function(t){if(this._groupViewDirty=!1,!this._parent||this._hidden)return void this._resetAllViews();if(this._shared.stalledRids)return;this._rids=t||this._parent.getAllRowIds(),this._dispatch("beforeFiltering",{}),this._excludedRids={};let e=0;e+=ve._copyObjectKeys(this._excludedRids,this._hiddenRids);let i=this._dt._getSegmentSeparators(),n=i?i.getSegments():null,o=this._getRemovalMap(this._excludedRids,this._userFilter,this._filteringOut,this._separatorFiltering?null:n);if(e+=o,this._collapsedRids=null,i&&(o&&this._emptySegmentFiltering&&(e+=this._getEmptySegments(this._excludedRids,n)),this._collapsedRids=i.getCollapsedRows(),e+=ve._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{let t=this._updatePageCount();this._sort()||t||this._transformView()}},ve.prototype._onDataChanged=function(t){if(this._conflator.conflate(t))return;let e=this._conflator.popAllData()||[t],i=e.length;if(1===i){let t=e[0];if(t.globalChange)return this._updateRowIds(),void this._dispatchDataChange(t);let i=t.type;"inserted"===i?this._onRowInserted(t):"removed"===i?this._onRowRemoved(t):this._onRowUpdated(t)}else{this._updateRowIds();let t=!0;for(let n=0;n<i;n++)if(!e[n].positionChangeOnly){t=!1;break}this._dispatchDataChange({globalChange:!0,positionChangeOnly:t,events:e})}},ve.prototype._onRowInserted=function(t){if(this._shared.stalledRids)return 0;if(this.isRowFiltered(t.rid,t.rowData))return 0;let e=0;if(this._groupMembers){let i,n=this._resolveGroupId(t.rowData),o=n.length;o>1&&(this._shared.multiGroupRow=!0);for(let r=0;r<o;r++)if(i=n[r],this._groupMembers[i])e=this._groupMembers[i]._onRowInserted(t);else{let n=this._addGroup(i);n&&(t.globalChange=!0,n._onRowInserted(t),e=1)}t.globalChange&&(this._groupViewDirty=!0)}if(this._hidden)return e;let i=t.rid,n=t.rowData;if(!this._isAllowedInGroup(i,n))return e;let o,r=t.nextRid;o=this.isSorting()&&!t.segmentChanged?this._addDataRow(i):this._addDataRow(i,r,t.fallback);let s=this._updatePageCount(),l=this._sort();return l&&(t.globalChange=!0),t.globalChange?l||s||this._transformView():(t={rid:i,rowData:n,type:"inserted"},null!=r&&(t.nextRid=r,t.fallback=o),this._transformView(o)&&(t.globalChange=!0)),this._dispatchDataChange(t),1},ve.prototype._onRowRemoved=function(t){if(this._shared.stalledRids)return 0;if(t.segmentChanged&&this.isSorting())return this._refreshAndNotify(),1;let e,i=0,n=t.rids;if(this._groupMembers){let o,r,s=t.rowData;if(!n&&s){for(o=this._resolveGroupId(s),e=0;e<o.length;e++)r=o[e],this._groupMembers[r]&&(i+=this._groupMembers[r]._onRowRemoved(t));i>1&&(this._groupViewDirty=!0)}else{let n=this._groupList.length;for(e=0;e<n;++e)r=this._groupList[e],i+=this._groupMembers[r]._onRowRemoved(t)}}let o,r,s=NaN,l=null;if(i=0,n){for(l=[],e=n.length;--e>=0;)o=n[e],r=this._removeDataRow(o),r>=0&&(l.push(o),r>=s||(s=r));i=l.length}else o=t.rid,r=this._removeDataRow(o),r>=0&&(l=[o],s=r,i=1);if(i>0){this._updatePageCount()||this._transformView(s)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(l),this._shared.autoGroupRemoval&&this._groupRows&&this._rids.length<=0&&this._triggerGroupRefreshing(),this._hiddenHeaderRow&&this._requestRebuildingRowIds(!0)}return i},ve.prototype._onRowUpdated=function(t){let e,i,n=t.rid,o=t.rowData;if(this.isRowFiltered(n,o))return this._onRowRemoved(t)?1:0;if(this._groupMembers){let 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);let l=0;if(r[2]?l=2:r[1]?this._isAllowedInGroup(n,o)||(l=1):r[4]&&(l=4),this._groupLevel>0){if(1===l)ve._removeArrayItem(this._rids,n)>=0&&this._groupView&&ve._removeArrayItem(this._groupView,n),this._shared.multiGroupRow&&(this._groupViewDirty=!0);else if(2===l&&!this._hidden){this._rids.indexOf(n)<0&&this._rids.push(n),this._groupViewDirty=!0,this._resolveGroupId(o).length>1&&(this._shared.multiGroupRow=!0)}}else{let s=r[1]&&r[2]||r[4];if(this._shared.multiGroupRow||!s){let n=this._resolveGroupId(o);for(e=0;e<n.length;e++){i=n[e];let o=this._addGroup(i);o&&(o._onRowInserted(t),l=1)}}!s&&!this._hidden&&this._rids.indexOf(n)<0&&this._addDataRow(n),4===l?this._shared.multiGroupRow?this._dispatchGlobalChange():this._dispatchDataChange(t):(this._groupViewDirty=!0,this._dispatchGlobalChange())}return l}if(this._isAllowedInGroup(n,o)){return this._rids.indexOf(n)<0?(this._onRowInserted(t),2):(this._shared.stalledRids||this._sort()&&(t.globalChange=!0),this._dispatchDataChange(t),4)}return this._onRowRemoved(t)?1:0},ve.prototype._onGroupAdded=function(t){if(!this._hidden){let e=t.newGroup,i=e.getGroupRowId();this._groupView.push(i),this._groupViewDirty=!0,this._dispatch("groupAdded",t),nt.pushArrayItems(this._groupView,e.getFooterRowIds())}},ve.prototype._onBeforeGroupAdded=function(t){this._dispatch("beforeGroupAdded",t)},ve.prototype._requestRebuildingRowIds=function(t){this._groupMembers&&(this._groupViewDirty=!0),this._groupLevel>0?this._parent._requestRebuildingRowIds(t):(t?this._rebuildRowIdsFromChildren():this._updateRowIds(),this._dispatchGlobalChange())},ve.prototype._refreshAndNotify=function(){this._updateRowIds(),this._dispatchGlobalChange()},ve.prototype._onRefreshTimeout=function(){this._refreshTimerId=0,this._refreshAndNotify()},ve.prototype._addDataRow=function(t,e,i){let n=this._getRowIndex(this._rids,e,i);return this._insertItems(this._rids,n,t),this._groupView?this._groupMembers?(this._groupViewDirty=!0,this._insertItems(this._groupView,-1,t)):n<0?this._insertItems(this._groupView,-1,t):(n=this._getRowIndex(this._groupView,e,i),this._insertItems(this._groupView,n,t)):n>=0?n:this._rids.length-1},ve.prototype._insertItems=function(t,e,i){return e<0?(e=t.length,t.push(i)):t.splice(e,0,i),e},ve.prototype._getRowIndex=function(t,e,i){if(null==e)return-1;let n=this._rids.indexOf(e);return n>=0?n:null==i||i>=t.length?-1:i},ve.prototype._removeDataRow=function(t){let e=ve._removeArrayItem(this._rids,t);return this._groupView&&e>=0&&(e=ve._removeArrayItem(this._groupView,t)),e},ve._removeArrayItem=function(t,e){let i=t.indexOf(e);return i>=0&&t.splice(i,1),i},ve._removeArrayItems=function(t,e){let i=NaN,n=0;for(let o=t.length;--o>=0;)e[t[o]]?++n:n&&(i=o+1,t.splice(i,n),n=0);return n&&(t.splice(0,n),i=0),i},ve._copyObjectKeys=function(t,e){if(e){let i=0;for(let n in e)t[n]=1,++i;return i}return 0},ve.prototype._isAllowedInGroup=function(t,e){if(this._groupLevel>0){let i=this;for(let n=this._groupLevel;--n>=0;){if(!i._groupFilterLogic(t,e))return!1;i=i.getDataSource()}}return!0},ve.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))},ve.prototype._sort=function(){if(this._groupMembers)return!1;if(this._stalledSorting)return!1;if(this._dt._getSegmentSeparators()||this.isSorting()){let t=this._rids,e=this._dt.getMultipleRowData(t),i=this._dt.getSegmentValues(t,!0),n=ft._performMultiLevelSorting(e,this._sortingDefs,i);if(n)return this._rids=ft._reorderItems(t,n),this._transformView(),!0}return!1},ve.prototype._byRemovalMap=function(t){return!this._excludedRids[t]},ve.prototype._getRemovalMap=function(t,e,i,n){if(!e)return 0;let o,r,s,l=this._rids,a=this._dt,u=0,h=l.length;if(n)for(r=h;--r>=0;)o=l[r],n[o]||(s=a.getRowData(o),s?e(o,s)===i&&(t[o]=1,++u):(t[o]=1,++u));else for(r=h;--r>=0;)o=l[r],s=a.getRowData(o),s?e(o,s)===i&&(t[o]=1,++u):(t[o]=1,++u);return u},ve.prototype._getEmptySegments=function(t,e){let i=this._dt._getSegmentSeparators(),n=0;for(let o in e){let e=i.getSegment(o);if(e){let i=e.getChildren(),r=!0;for(let e in i)if(!t[e]){r=!1;break}r&&(t[o]=1,++n)}}return n},ve.prototype._getFilterLogic=function(t,e){return null!=t?"function"==typeof t?t:"string"==typeof t?ve._defaultFilterLogic.bind(null,t,e):ve._defaultFilterLogic.bind(null,t+"",e):null},ve.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)},ve.prototype._updatePaginationView=function(t){let e=!1;if(this._pageView){t||(t=0);let i=this._pageSize*(this._pageIndex-1),n=this._pageSize+i;if(t<n){let t=this._groupView||this._rids;n>t.length&&(n=t.length);let o=n-i;this._pageView.length=o>=0?o:0;for(let e=i;e<n;++e)this._pageView[e-i]=t[e];e=!0}}return e},ve.prototype._updatePageCount=function(){let t=1;if(this._pageSize>0){let 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)},ve.prototype._dispatchRowRemoved=function(t){t&&this._dispatchDataChange({type:"removed",rid:t})},ve.prototype._dispatchMultiRowRemoved=function(t){if(t){let e=t.length;1===e?this._dispatchRowRemoved(t[0]):e>1&&this._dispatchDataChange({type:"removed",rids:t})}},ve.prototype._dispatchGlobalChange=function(){this._dispatchDataChange(ft._globalChangeArg)},ve.prototype._dispatchDataChange=function(t){this._dispatch("dataChanged",t),this._wrapSize&&!this._wrapTimerId&&(this._wrapTimerId=setTimeout(this._updateWrapCount))},ve.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;let t=this._parent._columnStats;if(t)for(let e in t){let t=this.enableColumnStats(e),i=this._parent.getColumnStats(e);t&&i&&t.setColumnDataGetter(i.getColumnDataGetter())}}},ve.prototype._populateGroups=function(){let t,e,i,n,o,r,s=this._rids;this._rids=[];let l={},a=[];for(e=s.length,t=0;t<e;++t){let e=s[t],i=this._dt.getRowData(e);if(i){o=this._resolveGroupId(i),r=o.length,r>1&&(this._shared.multiGroupRow=!0);for(let t=0;t<r;t++){n=o[t];let i=l[n];i?i.push(e):(i=[e],l[n]=i,a.push(n))}}}if(this._shared.autoGroupRemoval)for(e=this._groupList.length,t=e;--t>=0;)n=this._groupList[t],l[n]||(i=this._groupMembers[n],i&&!i._predefinedGroup&&this._removeGroupMember(t,n));let u=null;if(this._preDefGroups&&this._groupLevel<this._preDefGroups.length&&(u=this._preDefGroups[this._groupLevel]),e=this._groupList.length,this._preDefGroupsDirty)for(this._preDefGroupsDirty=!1,t=e;--t>=0;)n=this._groupList[t],i=this._groupMembers[n],i&&i._predefinedGroup&&(u?u.indexOf(i._groupId)<0&&this._removeGroupMember(t,n):this._removeGroupMember(t,n));if(u)for(e=u.length,t=0;t<e;++t){let e=this._addGroup(u[t]);e&&(e._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)n=this._groupList[t],i=this._groupMembers[n],i._updateRowIds(l[n]),i._markColumnStatsDirty();this._groupViewDirty=!0,this._rebuildRowIdsFromChildren()},ve.prototype._removeGroupMember=function(t,e){let i=this._groupMembers[e];i&&(this._groupList.splice(t,1),delete this._groupMembers[e],i.dispose())},ve.prototype._defaultGroupCriteria=function(t,e){let i=e[t];return Array.isArray(i)?i.map((function(t){return t+""})):[i+""]},ve.prototype._groupFilterLogic=function(t,e){return this._groupCriteria[this._groupLevel-1](e).indexOf(this._groupId)>=0},ve.prototype._internalGroupSortingLogic=function(t,e){let i=this._groupMembers[t],n=this._groupMembers[e];return this._groupSortingLogic(t,e,i,n)},ve.prototype._addGroup=function(t){let e=t+"";if(!e)return null;let i=this._groupMembers[e];if(i)return null;let n,o=(this._groupRowId||"_grp")+"_"+e;if(this._hasListener("beforeGroupAdded")&&(n={dataView:this,newGroupId:e,newGroupValue:t,newGroupRowId:o,newGroupLevel:this._groupLevel+1},this._dispatch("beforeGroupAdded",n),n.cancel))return null;i=new ve;let 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,n&&!0===n.hideHeaderRow&&(i._hiddenHeaderRow=!0),i._groupRowId=o,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},ve.prototype._triggerGroupRefreshing=function(){this._groupLevel>0?this._parent&&this._parent._triggerGroupRefreshing():this._groupRows&&!this._refreshTimerId&&(this._refreshTimerId=setTimeout(this._onRefreshTimeout,100))},ve.prototype._rebuildRowIdsFromChildren=function(){if(this._groupViewDirty){if(this._rids.length=0,this._groupView&&(this._groupView.length=0),!this._hidden){let t=this._groupList.length;for(let e=0;e<t;++e){let t=this._groupList[e],i=this._groupMembers[t];if(i._rebuildRowIdsFromChildren(),nt.pushArrayItems(this._rids,i._rids),!this._collapsed&&this._groupView&&(i._isHeaderRowShown()&&this._groupView.push(i._groupRowId),!i._collapsed)){let t=i._getFirstHiddenRids()||i._groupView||i._rids;nt.pushArrayItems(this._groupView,t),nt.pushArrayItems(this._groupView,i._footerRowIds)}}}this._groupViewDirty=!1,this._updatePageCount()||this._transformView()}},ve.prototype._resolveGroupId=function(t){return this._groupCriteria[this._groupLevel](t)},ve.prototype._markColumnStatsDirty=function(){for(let t in this._columnStats)this._columnStats[t].markDirty()},ve._defaultFilterLogic=function(t,e,i,n){return n[t]===e},ve._defaultGroupSortingLogic=function(t,e){return t==e?0:t<e?-1:1};var Ie=ve;let De=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)};De.prototype._data,De.prototype._func=null,De.prototype._delay=0,De.prototype._timerId=0,De.prototype._conflated=!1,De.prototype._disabled=!1,De.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},De.prototype.popAllData=function(){if(this._data.length){let t=this._data;return this._data=[],t}return null},De.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},De.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))},De.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},De.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},De.prototype.getData=function(){return this._data},De.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},De.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},De.prototype.disable=function(t){this._disabled=!1!==t},De.prototype.isEnabled=function(){return!this._disabled},De.prototype.enable=function(t){this._disabled=!1===t},De._proto=De.prototype;var xe=De;let Ae=function(t){let e=this;e._onDataChanged=e._onDataChanged.bind(e),e.extendEventArg=e.extendEventArg.bind(e),e._dataChangedConflator=new xe(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")};l.inherits(Ae,lt),Ae._runningId=0,Ae.prototype._id="",Ae.prototype._type="",Ae.prototype._grid=null,Ae.prototype._snapshot=null,Ae.prototype._dataView=null,Ae.prototype._dataArg=null,Ae.prototype._autoSyncRowCount,Ae.prototype._bindingEnabled=!0,Ae.prototype._parent=null,Ae.prototype._children=null,Ae.prototype._dataChangedConflator,Ae.prototype.getId=function(){return this._id},Ae.prototype.setId=function(t){return this._id=t||"section"+Ae._runningId++,this._grid.setAttribute("id",this._id),this._id},Ae.prototype.getSection=function(){return this._snapshot||this._grid},Ae.prototype.getSectionName=function(){return this._grid.getId()},Ae.prototype.getIndex=function(){return this._grid.getIndex()},Ae.prototype.getType=function(){return this._type},Ae.prototype.setType=function(t){this._type!==t&&(this._type&&this._grid.removeClass(this._type),this._type=t||"",t&&this._grid.addClass(t))},Ae.prototype.getDataSource=function(){return this._dataView},Ae.prototype.setDataSource=function(t){let 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))},Ae.prototype.getRootDataSource=function(){if(!this._dataView)return null;let t=this._dataView.getDataSource();if(!t)return null;for(;t.getDataSource();)t=t.getDataSource();return t},Ae.prototype.getData=function(t,e){return this._dataView?(e=this._getRowId(e),this._dataView.getData(e,t)):null},Ae.prototype.setData=function(t,e,i){return!!this._dataView&&(e=this._getRowId(e),this._dataView.setData(e,t,i),!0)},Ae.prototype.getRowData=function(t){return this._dataView?(t=this._getRowId(t),this._dataView.getRowData(t)):null},Ae.prototype.removeRowData=function(t){if(!this._dataView)return!1;let e=this.getRootDataSource();if(!e)return!1;t=this._getRowId(t);let i=e.getRowIndex(t);return!(i<0)&&(e.removeRow(i),!0)},Ae.prototype.activateColumns=function(t,e,i){if("content"===this._type)for(let n=i+1;--n>=e;){let e=t[n];null!=e&&this._grid.activateColumn(n,e)}},Ae.prototype.getChildren=function(){return this._children},Ae.prototype.setParent=function(t){if(this._parent){let t=this._parent._children.indexOf(this);t>=0&&(this._parent._children.splice(t,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))},Ae.prototype.getParent=function(){return this._parent},Ae.prototype.getDataChangedConflator=function(){return this._dataChangedConflator},Ae.prototype.disableConflation=function(t){this._dataChangedConflator.disable(t)},Ae.prototype.disableDataBinding=function(t){this._bindingEnabled=!1===t},Ae.prototype.getAutoSyncRowCount=function(){return null!=this._autoSyncRowCount?this._autoSyncRowCount:"content"===this._type},Ae.prototype.setAutoSyncRowCount=function(t){if(this._autoSyncRowCount=t,this.getAutoSyncRowCount()){let t=this._dataView?this._dataView.getVisibleRowCount():0;this._grid.setRowCount(t)}},Ae.prototype.isDataBindable=function(){return!(!this._bindingEnabled||!this._dataView)},Ae.prototype.dispose=function(){let 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},Ae.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},Ae.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},Ae.prototype.extendDataEventArg=function(t,e,i){let n,o;if(t||(t={}),t.firstUpdate=e,t.lastUpdate=i,this._snapshot?(n=0,o=this._grid.getRowCount()):(n=this._grid.getFirstIndexInView(),o=this._grid.getLastIndexInView()+1),t.fromRowIndex=e>n?e:n,this._dataView){let e=this._dataView.getVisibleRowCount();t.dataRowCount=e,o>e&&(o=e)}return t.toRowIndex=i+1<o?i+1:o,this.extendEventArg(t),t},Ae.prototype.setIndex=function(t){this._grid.setIndex(t)},Ae.prototype.getRowOffset=function(){return this._grid.getRowOffset()},Ae.prototype.setRowOffset=function(t){this._grid.setRowOffset(t)},Ae.prototype.enableColumnVirtualization=function(t){t=!1!==t,"content"===this._type&&this._grid.enableColumnVirtualization(t)},Ae.prototype.isBinding=function(){return this._isEventDispatching("dataChanged")},Ae.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))}},Ae.prototype._dispatchDataChanged=function(t,e){let i=this.getAutoSyncRowCount(),n=this._dataView?this._dataView.getVisibleRowCount():0,o=this._grid.getRowCount();i?n!==o&&this._grid.setRowCount(n,!0):n>o&&(e=o-1),this.updateRowData(t,e,this._dataArg),this._dataArg=null},Ae.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))},Ae.prototype.rerender=function(){this.isDataBindable()?this.updateRowData():this._dispatch("rowAvailable",this.extendEventArg())},Ae.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())}},Ae.prototype._getRowId=function(t){return nt.isNumber(t)?this._dataView.getRowId(t):t},Ae.prototype._mergeEvent=function(t){let e=this._dataArg;if(e||(e=this._dataArg={},e.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)return;if(t.globalChange)return e.globalChange=!0,e.firstUpdate=0,void(e.lastUpdate=NaN);let i=t.rids;if(i)for(let t=i.length;--t>=0;)e.updatedRids[i[t]]=!0;else t.rid&&(e.updatedRids[t.rid]=!0);"updated"!==t.type&&(e.indexShifted=!0,"removed"===t.type&&(e.dataRemoved=!0))},Ae.prototype._calculateChangeIndices=function(){if(!this.isDataBindable()||this._dataArg.globalChange)return;let t,e;if(this._dataArg.indexShifted){if(this._dataArg.dataRemoved)this._dataArg.firstUpdate=0;else for(t in this._dataArg.updatedRids)e=this._dataView.getRowIndex(t),e>=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),e>=0&&(this._dataArg.firstUpdate<=e||(this._dataArg.firstUpdate=e),this._dataArg.lastUpdate>=e||(this._dataArg.lastUpdate=e))},Ae._proto=Ae.prototype;var Le=Ae;let Te=function(t){this._layout=t,this._arg={},this._addEvent("indexChanged")};l.inherits(Te,lt),Te.prototype._layout,Te.prototype._viewSize=0,Te.prototype._viewOffset=0,Te.prototype._startOffsetCount=0,Te.prototype._endOffsetCount=0,Te.prototype._bufferSize=0,Te.prototype._arg=null,Te.prototype._enabled=!0,Te.prototype._active=!0,Te.prototype._virtualizable=!1,Te.prototype._getMinIndex=function(){return this._startOffsetCount},Te.prototype._getMaxIndex=function(){let t=this._layout.getLaneCount()-this._endOffsetCount;return t>this._startOffsetCount?t:this._startOffsetCount},Te.prototype.getContentStart=function(t){return this._layout.getLaneStart(t)},Te.prototype.getContentInViewCount=function(){let t=this.getFirstIndexInView(),e=this.getLastIndexInView();return t>=0&&t<e?e-t+1:0},Te.prototype._getContentSizeInBounds=function(){let t=this._getMinIndex(),e=this._getMaxIndex();return this._layout.getLaneStart(e)-this._layout.getLaneStart(t)},Te.prototype.getViewSize=function(){return this._viewSize},Te.prototype.getViewOffset=function(){let t=this._getMinIndex();return this._viewOffset+this._layout.getLaneStart(t)},Te.prototype.getIndexOffset=function(){return this._startOffsetCount},Te.prototype.isVirtualizable=function(){return this._virtualizable},Te.prototype.getFirstIndexInView=function(){if(!this._virtualizable)return 0;let t=this.getViewOffset(),e=this._layout.getTrackSize();return t>=e&&(t=e-this._viewSize),t<0?0:this._layout.hitTest(t)},Te.prototype.getLastIndexInView=function(){if(this._virtualizable){let 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},Te.prototype.getPrevFirstIndexInView=function(){return null!=this._arg.prevFirstIndex?this._arg.prevFirstIndex:-1},Te.prototype.getPrevLastIndexInView=function(){return null!=this._arg.prevLastIndex?this._arg.prevLastIndex:-1},Te.prototype.update=function(t){if(!(!0===t||this._enabled&&this._active))return!1;if(this._isEventDispatching("indexChanged"))return!1;let e=this.getFirstIndexInView(),i=this.getLastIndexInView(),n=this._arg.prevFirstIndex!==e||this._arg.prevLastIndex!==i;return(t||n)&&(this._arg.firstIndex=e,this._arg.lastIndex=i,this._dispatch("indexChanged",this._arg),this._arg.prevFirstIndex=e,this._arg.prevLastIndex=i),n},Te.prototype.isEnabled=function(){return this._enabled},Te.prototype.enable=function(t){t=!1!==t,this._enabled!==t&&(this._enabled=t,this.validateVirtualization(),this.update(!0))},Te.prototype.disable=function(t){this.enable(!1===t)},Te.prototype.isActive=function(){return this._active},Te.prototype.activate=function(t){t=!1!==t,this._active!==t&&(this._active=t,this.validateVirtualization(),this.update(!0))},Te.prototype.deactivate=function(t){this.activate(!1===t)},Te.prototype.getBufferSize=function(){return this._bufferSize},Te.prototype.setContentLayout=function(t){this._layout!==t&&(this._layout=t,this.validateVirtualization())},Te.prototype.setViewSize=function(t){t<0&&(t=0),this._viewSize!==t&&(this._viewSize=t,this.validateVirtualization())},Te.prototype.setViewOffset=function(t){this._viewOffset=t>0?t:0,this.update()},Te.prototype.setViewBounds=function(t,e){this._startOffsetCount=t>0?t:0,this._endOffsetCount=e>0?e:0,this.validateVirtualization()},Te.prototype.setBufferSize=function(t){t<0&&(t=0),this._bufferSize!==t&&(this._bufferSize=t,this.validateVirtualization())},Te.prototype.validateVirtualization=function(){this._virtualizable=!1,this._enabled&&this._active&&this._viewSize>0&&this._getContentSizeInBounds()>this._viewSize&&(this._virtualizable=!0)},Te._proto=Te.prototype;var Ee=Te;let Me=function(){let t=this;t._vertical=!0,t._hostClassName="vscrollbar-host",Me.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")};l.inherits(Me,de),Me.prototype.setScrollContent=function(t,e,i){this._clearAllPanes();let n,o=e.length;if(o<=0)return;let r=this._panes[0],s=this._paneSliders[0],l=0;for(;l<i;)n=e[l++],n.setParent(t);r.setParent(t);let a=o-this._footerCount;for(;l<a;)n=e[l++],n.setParent(s);for(;l<o;)n=e[l++],n.setParent(t);this.invalidateContent()},Me.prototype.setHeight=function(t){return this.setTrackSize(t,t),!0},Me.prototype.getHeight=function(){return this.getPaneSize()},Me.prototype.getScrollTop=function(){return this._getScrollValue()},Me.prototype.setScrollTop=function(t){this.update(),this._scrollTo(t)},Me.prototype.isEndOfVerticalScroll=function(){return this._isEndOfScroll()},Me.prototype.getContentHeight=function(){let t=this._paneSliders[0].getContent(!0),e=0;for(let i=t.length;--i>=0;)e+=t[i].offsetHeight;return e},Me.prototype.calculateContentSize=function(){return this.getContentHeight()},Me.prototype.getPane=function(){return this._panes[0]},Me.prototype._onScroll=function(t){this._dispatch("contentScrolled",t)},Me._proto=Me.prototype;var Fe=Me;let Pe=function(t){let 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 Ce(t),e._grid.setParent(e._element),e._layoutY=new Xt,e._selectionList=new ae,e._reverter=new he(e._onRestingPosition,200),e._addEvent("rowHighlighted"),e._addEvent("rowCountChanged"),e._addEvent("rowHeightChanged"),e._addEvent("rowAvailable")};l.inherits(Pe,Bt),Pe.prototype._index=-1,Pe.prototype._rowOffset=0,Pe.prototype._firstIndex=0,Pe.prototype._grid,Pe.prototype._layoutY,Pe.prototype._selectionList=null,Pe.prototype._reverter=null,Pe.prototype._rowBounds=null,Pe.prototype._rowBoundCache=null,Pe.prototype._rowSelDirty=!1,Pe.prototype._cellBoundPainter=null,Pe.prototype._rowBoundTimer=0,Pe.prototype._boundLayer=null,Pe.prototype._hscrollbar=null,Pe.prototype._session="A",Pe.prototype._tempRowHeights=null,Pe.prototype.getWidth=function(){return this.isVisible()?this._grid.getWidth():0},Pe.prototype.getHeight=function(){return this.isVisible()?this._element.offsetHeight:0},Pe.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),this._cellBoundPainter&&this._cellBoundPainter.dispose()},Pe.prototype.setWidth=function(t){return this._grid.setWidth(t)},Pe.prototype.setHeight=function(t){return console.log("unsupported"),!1},Pe.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount())},Pe.prototype.hitTest=function(t,e){let i=[];return i.colIndex=this._grid.hitTestX(t),i.rowIndex=this._layoutY.hitTest(e),i},Pe.prototype.hitTestX=function(t){return this._grid.hitTestX(t)},Pe.prototype.hitTestY=function(t){return this._layoutY.hitTest(t)},Pe.prototype.getDefaultColumnWidth=function(){return this._grid.getDefaultColumnWidth()},Pe.prototype.setDefaultColumnWidth=function(t){this._grid.setDefaultColumnWidth(t)},Pe.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},Pe.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()))},Pe.prototype.getColumnWidth=function(t){return this._grid.getColumnWidth(t)},Pe.prototype.setColumnWidth=function(t,e){return this._grid.setColumnWidth(t,e)},Pe.prototype._setColumnWidth=function(t,e){return this._grid._setColumnWidth(t,e)},Pe.prototype._updateColumnLayout=function(){this._grid._updateColumnLayout()},Pe.prototype._startBindingSession=function(t){if(this._isBinding=t,!t){if(this._tempRowHeights){let t=this.getDefaultRowHeight(),e=!0,i=[];for(let e in this._tempRowHeights){let n=+e,o=this._layoutY.getLaneProperty(n,"sizeSession");o&&o!=this._session&&(this.setRowHeight(n,t),this._layoutY.setLaneProperty(n,"sizeSession",null),i.push(n))}let n=i.length;for(let t=0;t<n;t++)delete this._tempRowHeights[i[t]];if(n)for(let t in this._tempRowHeights){e=null!=t;break}e||(this._tempRowHeights=null)}this._session="A"===this._session?"B":"A"}},Pe.prototype._getTempRowHeights=function(){return this._tempRowHeights},Pe.prototype.getRowHeight=function(t){return this._layoutY.getLaneSize(t)},Pe.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))},Pe.prototype.isColumnVisible=function(t){return this._grid.isColumnVisible(t)},Pe.prototype.hideColumn=function(t,e){return this._grid.hideColumn(t,e)},Pe.prototype.isRowVisible=function(t){return this._grid.isRowVisible(t-this._firstIndex)},Pe.prototype.hideRow=function(t,e){return this._grid.hideRow(t-this._firstIndex,e)},Pe.prototype.getMinimumColumnWidth=function(t){return this._grid.getMinimumColumnWidth(t)},Pe.prototype.setMinimumColumnWidth=function(t,e){return this._grid.setMinimumColumnWidth(t,e)},Pe.prototype.getMinimumRowHeight=function(t){return this._layoutY.getMinimumLaneSize(t)},Pe.prototype.setMinimumRowHeight=function(t,e){return console.log("unsupported"),!1},Pe.prototype.getCellLeft=function(t){return this._grid.getCellLeft(t)},Pe.prototype.getCellTop=function(t){return this._layoutY.getLaneStart(t)},Pe.prototype.getCellWidth=function(t,e){return this._grid.getCellWidth(t,0)},Pe.prototype.getCellHeight=function(t,e){return this._layoutY.getLaneSize(e)},Pe.prototype.hasCellSpan=function(){return this._grid.hasCellSpan()},Pe.prototype.getCellRowSpan=function(t,e){return this._grid.getCellRowSpan(t,e-this._firstIndex)},Pe.prototype.setCellRowSpan=function(t,e,i){return this._grid.setCellRowSpan(t,e-this._firstIndex,i)},Pe.prototype.getCellColSpan=function(t,e){return this._grid.getCellColSpan(t,e-this._firstIndex)},Pe.prototype.setCellColSpan=function(t,e,i){return this._grid.setCellColSpan(t,e-this._firstIndex,i)},Pe.prototype.clearCellSpans=function(){return this._grid.clearCellSpans()},Pe.prototype.clearColumnSpans=function(t){return this._grid.clearColumnSpans(t)},Pe.prototype.clearColumnCustomizations=function(){this._grid.clearColumnCustomizations()},Pe.prototype.clearRowCustomizations=function(){this._layoutY.clearLaneCustomizations(),this._grid.clearRowCustomizations()},Pe.prototype.getColumnScalability=function(t){return this._grid.getColumnScalability(t)},Pe.prototype.setColumnScalability=function(t,e){return this._grid.setColumnScalability(t,e)},Pe.prototype.getRowScalability=function(t){return this._layoutY.getLaneScalability(t)},Pe.prototype.setRowScalability=function(t,e){return console.log("unsupported"),!1},Pe.prototype.getCell=function(t,e,i){return this._grid.getCell(t,e-this._firstIndex,i)},Pe.prototype.getCellContent=function(t,e){return this._grid.getCellContent(t,e-this._firstIndex)},Pe.prototype.setCellContent=function(t,e,i){return this._grid.setCellContent(t,e-this._firstIndex,i)},Pe.prototype.getColumnCount=function(){return this._grid.getColumnCount()},Pe.prototype.setColumnCount=function(t){this._grid.setColumnCount(t)},Pe.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},Pe.prototype.setRowCount=function(t,e){let 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}))},Pe.prototype.getVisibleRowCount=function(){return this.getRowCount()},Pe.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))},Pe.prototype.removeRow=function(t){if(t<=0)return;let e=this._layoutY.getLaneCount();t>e&&(t=e),this.setRowCount(e-t)},Pe.prototype.setBorders=function(t,e,i,n){this._grid.setBorders(t,e,i,n)},Pe.prototype.getColumnStyle=function(t,e){return this._grid.getColumnStyle(t,e)},Pe.prototype.setColumnStyle=function(t,e,i){this._grid.setColumnStyle(t,e,i)},Pe.prototype.enableColumnClass=function(t,e,i){this._grid.enableColumnClass(t,e,i)},Pe.prototype.hasColumnClass=function(t,e){return this._grid.hasColumnClass(t,e)},Pe.prototype.enableRowClass=function(t,e,i){this._grid.enableRowClass(t-this._firstIndex,e,i)},Pe.prototype.setRowStyle=function(t,e,i,n){this._grid.setRowStyle(t-this._firstIndex,e,i,n)},Pe.prototype.getContentWidth=function(){return this._grid.getContentWidth()},Pe.prototype.getContentHeight=function(){return this._layoutY.getTrackSize()},Pe.prototype.getCellsByRowIndex=function(t){return this._grid.getCellsByRowIndex(t-this._firstIndex)},Pe.prototype.disableHorizontalGridLine=function(t){this._grid.disableHorizontalGridLine(t)},Pe.prototype.disableVerticalGridLine=function(t){this._grid.disableVerticalGridLine(t)},Pe.prototype.enableShading=function(t){this._grid.enableShading(t)},Pe.prototype.setTransposedShading=function(t){this._grid.setTransposedShading(t)},Pe.prototype.enableRowHighlighting=function(t){this._grid.enableRowHighlighting(t)},Pe.prototype.getRowHighlight=function(){let t=this._grid.getRowHighlight();return t>=0&&(t+=this._firstIndex),t},Pe.prototype.setRowHighlight=function(t){let 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")){let i={};i.prevRowIndex=e,i.rowIndex=t,this._dispatch("rowHighlighted",i)}},Pe.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},Pe.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},Pe.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},Pe.prototype.setSelectedRow=function(t,e){this._selectionList.setSelection(t,e);let i=this._selectionList.getSelection(t);this._grid.setSelectedRow(t-this._firstIndex,i),i&&(this._rowSelDirty=!0,this._initBoundLayer()),this._requestUpdatingRowBounds()},Pe.prototype.selectSingleRow=function(t){this._selectionList.clearAllSelections(),this._grid.clearSelectedRows(),this.setSelectedRow(t)},Pe.prototype.selectRowRange=function(t,e){this._selectionList.selectRange(t,e),this._updateRowSelection(),this._rowSelDirty=!0,this._initBoundLayer(),this._requestUpdatingRowBounds()},Pe.prototype.clearSelectedRows=function(){let t=this._selectionList.clearAllSelections();return this._grid.clearSelectedRows(),this._requestUpdatingRowBounds(),t},Pe.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},Pe.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},Pe.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},Pe.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},Pe.prototype.activateColumn=function(t,e){this._grid.activateColumn(t,e)},Pe.prototype.activateRows=function(t,e,i){let n=this._layoutY.getLaneCount();t||(t=this._rowOffset),e||0===e||(e=t+n),(t-=this._rowOffset)<0&&(t=0),(e-=this._rowOffset)<0&&(e=0);let o=this._getInnerRowCount(),r=this._firstIndex,s=0;s=t-(1&t),s<0?s=0:s>n&&(s=n);let l=e+(1&e)-s;l+2===o&&(l=o),l<0?l=0:l+s>n&&(l=n-s),this._firstIndex=s;let a=s+l,u=this._layoutY.getLaneStart(s),h=this._grid.getElement();h&&(h.style.transform=u?"translateY("+u+"px)":"",h.style.top="",this._reverter.start()),this._grid._onEnterDocument();let p=!1;if(l!==o){if(this._grid.setRowCount(l),l>o){let t={};t.prevRowIndex=s+o,t.rowIndex=s+l,i&&(t.noDataUpdate=!0),this._dispatch("rowAvailable",t)}p=!0}if(i){if(!p){this._grid.clearSelectedRows();let t=r+o;s<r&&r<a&&t>=a?(this.moveRowsToTop(a-r),i[0]=s,i[1]=r):r<s&&s<t&&a>=t?(this.moveRowsToTop(s-r),i[0]=t,i[1]=a):s===r&&a===t?(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()},Pe.prototype.moveRowsToTop=function(t){this._grid.moveRowsToTop(t)},Pe.prototype.getFirstIndexInView=function(){return this._firstIndex},Pe.prototype.getLastIndexInView=function(){let t=this._firstIndex+this._getInnerRowCount()-1,e=this._grid._getContext().getDataSource(),i=e?e.getRowCount()-1:-1;return t>i?i:t},Pe.prototype.isInCurrentView=function(t){return this._firstIndex<=t&&t<this._firstIndex+this._getInnerRowCount()},Pe.prototype.getFrozenLayout=function(){return this._grid.getFrozenLayout()},Pe.prototype.setFrozenLayout=function(t){this._grid.setFrozenLayout(t)},Pe.prototype.getColumn=function(t){return this._grid.getColumn(t)},Pe.prototype.insertColumn=function(t,e){return this._grid.insertColumn(t,e)},Pe.prototype.removeColumnAt=function(t){return this._grid.removeColumnAt(t)},Pe.prototype.moveColumn=function(t,e){this._grid.moveColumn(t,e)},Pe.prototype.enableRowVirtualization=function(t){},Pe.prototype.enableColumnVirtualization=function(t){this._grid.enableColumnVirtualization(t)},Pe.prototype.getColumnIndex=function(t){return this._grid.getColumnIndex(t)},Pe.prototype.getCellIndex=function(t,e){let i=this._grid.getCellIndex(t,e);return i<0?-1:i+this._firstIndex},Pe.prototype.getIndex=function(){return this._index},Pe.prototype.setIndex=function(t){this._index=t},Pe.prototype.setRowOffset=function(t){this._rowOffset=t},Pe.prototype.getRowOffset=function(){return this._rowOffset},Pe.prototype.updateLayout=function(){this._grid.updateLayout()},Pe.prototype.stretchCell=function(t,e,i,n){let o=this._grid.stretchCell(t,null!=e?e-this._firstIndex:null,i,n);if(o){let t=o.getElement();0===e?t.classList.add("top"):t.classList.remove("top")}return o},Pe.prototype.unstretchCell=function(t,e){return this._grid.unstretchCell(t,null!=e?e-this._firstIndex:null)},Pe.prototype.unstretchAllCells=function(){this._grid.unstretchAllCells()},Pe.prototype.getStretchedCell=function(t,e){return this._grid.getStretchedCell(t,null!=e?e-this._firstIndex:null)},Pe.prototype.getStretchedCells=function(){return this._grid.getStretchedCells()},Pe.prototype.updateStretchedCells=function(){return this._grid.updateStretchedCells()},Pe.prototype.getColumnHost=function(){return this._grid.getElement()},Pe.prototype.setHidingMethod=function(t){this._grid.setHidingMethod(t)},Pe.prototype.getHidingMethod=function(){return this._grid.getHidingMethod()},Pe.prototype.setColumnVisibility=function(t,e,i){return this._grid.setColumnVisibility(t,e,i)},Pe.prototype.getRowLayout=function(){return this._layoutY},Pe.prototype.reserveRightSpace=function(t){return this._grid.reserveRightSpace(t)},Pe.prototype.getReservedSpace=function(){return this._grid.getReservedSpace()},Pe.prototype.getComputedStyle=function(){return this._grid.getComputedStyle()},Pe.prototype.isColumnActive=function(t){return this._grid.isColumnActive(t)},Pe.prototype.setRowAttributes=function(t,e){return this._grid.setRowAttributes(t,e)},Pe.prototype.getContextRow=function(t){return this._grid.getContextRow(t-this._firstIndex)},Pe.prototype.selectColumn=function(t,e){this._grid.selectColumn(t,e)},Pe.prototype.isSelectedColumn=function(t){return this._grid.isSelectedColumn(t)},Pe.prototype.selectCell=function(t,e,i){this._grid.selectCell(t,e-this._firstIndex,i)},Pe.prototype.setCellBounds=function(t,e,i,n){let o=this._initBoundLayer(),r=this._cellBoundPainter;r||(r=this._cellBoundPainter=new ye({boundLayer:o,layoutX:this.getHorizontalLayout(),layoutY:this._layoutY,hscrollbar:this._hscrollbar,calculateColumnBounds:this.calculateColumnBounds.bind(this)}));let s=this.getColumnCount();r.setCellBounds(t,e,i,n,s)},Pe.prototype.getHorizontalLayout=function(){return this._grid.getHorizontalLayout()},Pe.prototype.calculateColumnBounds=function(t,e,i,n){this._grid.calculateColumnBounds(t,e,i,n)},Pe.prototype.updateColumnBounds=function(t,e,i){this._grid.updateColumnBounds(t,e,i),this._updateRowBounds()},Pe.prototype.updateColumnSeparators=function(){this._grid.updateColumnSeparators()},Pe.prototype._initBoundLayer=function(){let t=this._boundLayer;return t||(t=this._boundLayer=document.createElement("div"),t.className="cover-layer",this._element.appendChild(t)),t},Pe.prototype._requestUpdatingRowBounds=function(){this._rowBoundTimer||(this._rowBoundTimer=setTimeout(this._updateRowBounds,10))},Pe.prototype._updateRowBounds=function(){this._rowBoundTimer=0;let t=this._cellBoundPainter;if(t&&t.updateCellBounds(),!this._rowSelDirty)return;let e=this._rowBounds,i=this._rowBoundCache;e||(e=this._rowBounds=[]),i||(i=this._rowBoundCache=[]);let n=this._selectionList,o=this._layoutY.getLaneCount();n.deselectFrom(o);let r,s=n.getConnectedRanges(),l=s.length,a=null,u=null,h=e.length;for(r=l;r<h;++r)u=e[r],a=u.parentNode,a&&a.removeChild(u);if(e.length=h=l,!l){return void(n.getSelectionCount()||(this._rowSelDirty=!1))}let p=0,d=0,c=0,_=!1;this._hscrollbar&&(p=this._hscrollbar.getScrollLeft(),d=this._hscrollbar.getPinnedLeftColumnCount(),c=this._hscrollbar.getPinnedRightColumnCount(),_=this._hscrollbar.isEndOfHorizontalScroll());let f=!d&&p>0,g=!c&&!_,y=this._grid._getViewSize();for(r=0;r<l;++r){let t=s[r],n=t[0],o=t[1],l=this._layoutY.getLaneStart(n),a=this._layoutY.getLaneEnd(o);u=i[r],u||(u=i[r]=document.createElement("div"),u.className="selection-bound"),u.style.top=l+"px",u.style.height=a-l+"px",u.style.width=y+"px",u.classList.toggle("no-left-bound",f),u.classList.toggle("no-right-bound",g),this._boundLayer&&(e[r]||(e[r]=u,this._boundLayer.appendChild(u)))}},Pe.prototype._getInnerRowCount=function(){return this._grid.getRowCount()},Pe.prototype._updateRowSelection=function(){this._grid.clearSelectedRows();let t,e=this._selectionList,i=e.getSelectionCount();if(i<=0)return;let n=this._firstIndex,o=n+this._getInnerRowCount();if(1===i)t=e.getFirstSelectedIndex(),n<=t&&t<o&&this._grid.setSelectedRow(t-n,!0);else if(i>=o-n)for(t=n;t<o;++t)e.getSelection(t)&&this._grid.setSelectedRow(t-n,!0);else{let r=e.getAllSelections();for(let e=0;e<i;++e)t=r[e],n<=t&&t<o&&this._grid.setSelectedRow(t-n,!0)}},Pe.prototype._dispatchRowHeightChangedEvent=function(t,e){if(t>=e)return!1;let i={};return i.rowIndex=t,i.changeLength=e-t,this._dispatch("rowHeightChanged",i),!0},Pe.prototype._onRestingPosition=function(){let t=this._grid.getElement();if(t){let e=this._layoutY.getLaneStart(this._firstIndex);t.style.transform="",t.style.top=e?e+"px":""}},Pe.prototype._updateRightSpaceStyle=function(){this._grid._updateRightSpaceStyle()},Pe.prototype._updateLayers=function(){this._grid._updateLayers()},Pe.prototype._setContext=function(t){this._grid._setContext(t)},Pe.prototype._getContext=function(){return this._grid._getContext()},Pe._proto=Pe.prototype;var ze=Pe;let Ve=function(t,e){return t-e},ke=function(t){ke._sectionType||(ke._sectionType={},ke._sectionType.title=!0,ke._sectionType.header=!0,ke._sectionType.content=!0,ke._sectionType.footer=!0);let 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(let e=t.childNodes.length;--e>=0;)nt.isElement(t.childNodes[e])||t.removeChild(t.childNodes[e]);e._element=t||document.createElement("div"),e._element.classList.add("tr-grid"),e._layoutX=new Xt,e._layoutY=new Xt,e._layoutX.setDefaultLaneSize(100),e._layoutY.setDefaultLaneSize(32),e._settings=[],e._plugins={},e._columnDefs=[],e._sectionStarts=[],e._rowHeightException="title",e._rowVirtualizer=new Ee(e._layoutY),e._rowVirtualizer.deactivate(),e._rowVirtualizer.setViewSize(360),e._colVirtualizer=new Ee(e._layoutX),e._colVirtualizer.enable(!1),e._colVirtualizer.deactivate(),e._colVirtualizer.setViewSize(400),e._vscrollbar=new Fe,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 _e,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),nt.isMobile||nt.isTouchDevice?e._element.addEventListener("touchmove",this._onMouseMove,!1):e._element.addEventListener("mousemove",this._onMouseMove,!1),nt.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 xe(e._onRowHeightChanged,50),e._vScrollbarConflator=new xe(e._updateVScrollbar,200),e._columnBoundConflator=new xe(e._updateColumnBounds,10),e._columnPositionConflator=new xe(e._dispatchColumnPositionChanged,10),e._rowPositionConflator=new xe(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");let i=ke.map;i||(i={},ke.map=i);let n=e._element;n._control=e;let o=n.id||n.name;o&&!i[o]||(o="_grid"+ke._runningGridId),e._id=o,i[o]=e,ke._runningGridId++;let r=document.createElement("input");r.style.position="absolute",r.style.width="0",r.style.height="0",r.style.padding="0",r.style.border="0",r.value="0",e._hiddenInput=r,n.insertBefore(r,n.firstChild),Object.defineProperty(e,"zoomFactor",{set:function(t){!t||t<0||this._zoomFactor!==t&&(this._zoomFactor=t,e._updateLayout())},get:function(){return this._zoomFactor}})};l.inherits(ke,Bt),ke.SectionReference,ke.MouseInfo,ke.BatchInfo,ke.CellReference,ke.ColumnOptions,ke._runningGridId=0,ke._runningColumnId=0,ke._sectionType,ke.prototype._plugins,ke.prototype._dataSource=null,ke.prototype._layoutX,ke.prototype._layoutY,ke.prototype._vscrollbar,ke.prototype._hscrollbar,ke.prototype._tempFrozenSectionRef="",ke.prototype._startVScrollbarIndex=-1,ke.prototype._hScrollbarEnabled=!0,ke.prototype._pinnedLeftColumnCount=0,ke.prototype._pinnedRightColumnCount=0,ke.prototype._frozenFooterCount=0,ke.prototype._fixFrozenTopSections=!1,ke.prototype._fixFrozenBottomSection=!1,ke.prototype._sectionStarts,ke.prototype._settings,ke.prototype._firstSettings,ke.prototype._lastSettings,ke.prototype._fitContentWidth=!1,ke.prototype._columnDefs,ke.prototype._rowVirtualizer,ke.prototype._colVirtualizer,ke.prototype._autoSetDataSource=!0,ke.prototype._renderingHandler=null,ke.prototype._dataBindingHandler=null,ke.prototype._frozenLayout=!1,ke.prototype._noBinding=!1,ke.prototype._rowHeightSync=!0,ke.prototype._rowHighlighting=!1,ke.prototype._dispatchingDataChanged=!1,ke.prototype._rowHeightException="",ke.prototype._rowScrollingStep=0,ke.prototype._zoomFactor=1,ke.prototype._reservedSpace=0,ke.prototype._hidingMethod="",ke.prototype._rowHeightConflator=null,ke.prototype._vScrollbarConflator=null,ke.prototype._columnBoundConflator=null,ke.prototype._rowRefreshTimer=0,ke.prototype._layoutUpdating=!1,ke.prototype._hiddenInput,ke.prototype._bottomPadding=6,ke.prototype._bottomPaddingSect=null,ke.prototype._preserveProportion=!1,ke.prototype._preserveGridSize=!1,ke.prototype._rowHeightTimerId=0,ke.prototype._groupDefs=null,ke.prototype._batches=null,ke.prototype._firstRendered=!1,ke.prototype._hasPendingRowChange=!1,ke.getVersion=function(){return"5.1.106"},ke.prototype.dispose=function(){let t=this._id,e=ke.map;if(!e[t])return void console.log("WARNING: Core grid is disposed twice");e[t]=null,this._disposed=!0,this._rowRefreshTimer&&(clearTimeout(this._rowRefreshTimer),this._rowRefreshTimer=0),this.unlistenAll(),window.removeEventListener("resize",this._onWindowResize,!1);for(let t=this._columnDefs.length;--t>=0;){let e=this._getColumnDef(t);e.renderingHandler=e.dataBindingHandler=null}for(let t in this._plugins){let e=this._plugins[t];e.unload&&e.unload(this)}this.removeAllSections();let i=this._vscrollbar._mainScrollbar;i&&(i.unlisten("scroll",this._onSyncVScroll),this._vscrollbar._mainScrollbar=null),i=this._hscrollbar._mainScrollbar,i&&(i.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();let n=this._element;null!==n&&(n._control&&delete n._control,n.removeChild(this._hiddenInput)),this._dispose(),this._columnDefs.length=0,delete this._plugins},ke.prototype.isDisposed=function(){return this._disposed},ke.prototype.setParent=function(t,e){this._setParent(t,e),this._onParentChange()},ke.prototype.insertBefore=function(t){this._insertBefore(t),this._onParentChange()},ke.prototype._onParentChange=function(){let t=this.getParent()||this.getElement();this._vscrollbar._mainScrollbar||this._vscrollbar.setParent(t),this._hscrollbar.setParent(t),this._updateLayout()},ke.prototype.getConfigObject=function(t){let e=t||{},i=this.getColumnCount();e.columns||(e.columns=[]);for(let t=0;t<i;t++){let i=e.columns[t];i||(i=e.columns[t]={});let n=this._getColumnDef(t);n.userId&&(i.id=n.userId),n.field&&(i.field=n.field),n.styles&&(i.styles=n.styles),n.stationary&&(i.stationary=n.stationary),n.leftPinned&&(i.leftPinned=n.leftPinned),n.rightPinned&&(i.rightPinned=n.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);let n=this._vscrollbar.getAutoHide();!0!==n&&(e.autoHideScrollbar=n);let o=this._vscrollbar.getMouseWheelSpeed();o&&(e.linearWheelScrolling=o),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);let r=this.getDataConflationRate();r&&(e.dataConflationRate=r);for(let t in this._plugins){let i=this._plugins[t];"function"==typeof i.getConfigObject&&i.getConfigObject(e)}return e},ke.prototype.fillParentWidth=function(t){if(this._fitContentWidth)return!1;if(this._layoutX.isFixedSize())return!1;let e=this._element,i=(0|e.getBoundingClientRect().width)-e.clientLeft;return null!==this._layoutX.setTrackSize(i-this._reservedSpace)},ke.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",!1!==t&&this.updateLayout()},ke.prototype.getContentWidth=function(){return this._layoutX.getTrackSize()},ke.prototype.getSectionCount=function(){return this._settings.length},ke.prototype._updateFrozenTopSections=function(){if(!this._fixFrozenTopSections){let t=this._getTopSectionCount();this._freezeTopSectionAt(t-1)}},ke.prototype._updateFrozenBottomSections=function(){if(!this._fixFrozenBottomSection){let t=this._getBottomSectionCount();this._setFrozenFooter(t)}},ke.prototype._getTopSectionCount=function(){let t=this._settings,e=t.length,i=0;for(let n=0;n<e;n++){let e=t[n].getType();if("header"!==e&&"title"!==e)break;i++}return i},ke.prototype._getBottomSectionCount=function(){let t=this._settings,e=0;for(let i=t.length-1;i>=0;i--){if("footer"!==t[i].getType())break;e++}return e},ke.prototype.addSection=function(t,e){return this.addSectionAt(this.getSectionCount(),t,e)},ke.prototype.addSectionAt=function(t,e,i){let n=this._settings.length;t<0&&(t=0),t>n&&(t=n);let o=this._toSectionType(e),r="bottomPadding"===i,s=this._newSection(r?"footer":o,i);if(!s)return null;let l=s.getSection();if(r&&(s.setAutoSyncRowCount(!1),this._bottomPaddingSect=l),t>=n?(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),o=s.getType(),"footer"===o?this._updateFrozenBottomSections():"header"!==o&&"title"!==o||this._updateFrozenTopSections(),this._onColumnCountChanged(),this._onSectionCountChanged(!0),this._colVirtualizer.isEnabled()){let t=this._getColActivationList(),e=this.getColumnCount();s.activateColumns(t,0,e-1)}if(this._hasListener("sectionAdded")){let t=s.extendEventArg();this._dispatch("sectionAdded",t)}return l},ke.prototype.removeSection=function(t){let e=this.getSection(t);return null!==e?this.removeSectionAt(e.getIndex()):null},ke.prototype.removeSectionAt=function(t){let e=this._settings.length;if(t>=0&&t<e){let e=this._settings[t],i=e.getIndex(),n=e.getSection(),o=e.getType();return n.setRowCount(0),this._settings.splice(t,1),this._updateSectionIndices(i),"footer"===o?(this._updateFrozenBottomSections(),this._onColumnCountChanged()):"header"!==o&&"title"!==o||this._updateFrozenTopSections(),this._onSectionCountChanged(),e.dispose(),n}return null},ke.prototype.removeLastSection=function(){return this.removeSectionAt(this._settings.length-1)},ke.prototype.removeAllSections=function(){let t=this._settings.length;for(let 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()},ke.prototype.setBottomPaddingSection=function(t){let 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)},ke.prototype._updatePaddingBottomSect=function(){let t=this._bottomPaddingSect;if(t){let e=this._settings.length-1;if(e>0){let n=this._settings[e];if(n.getSection()!==t){let o=null;for(let i=e;--i>=0;){let e=this._settings[i];if(e.getSection()===t){o=e;break}}if(i>=0)return this._putToLast(t),this._settings.splice(i,1),this._settings.push(o),o.setType("footer"===n.getType()?"footer":"content"),!0;this._bottomPaddingSect=null}else{let t=this._settings[e-1];t&&n.setType("footer"===t.getType()?"footer":"content")}}}return!1},ke.prototype.moveSection=function(t,e){let 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)return;let n=this._settings[t],o=this._settings[e];nt.moveArrayItem(this._settings,t,e),o?n.getSection().insertBefore(o.getSection()):this._putToLast(n.getSection()),this._updateSectionIndices(t<=e?t:e),this._syncRowHeights(),this._onSectionCountChanged(),this._frozenLayout||this._rowVirtualizer.update(!0)},ke.prototype.getSection=function(t){let e=this.getSectionSettings(t);return null!==e?e.getSection():null},ke.prototype.getSectionSettings=function(t){if(nt.isString(t)){if(ke._sectionType[t])return this._getNextSection(1,null,t);for(let e=this._settings.length;--e>=0;)if(this._settings[e].getId()===t)return this._settings[e]}else if(null!=t){let e=-1;if(null!=t.getIndex?e=t.getIndex():nt.isNumber(t)&&(e=t),e>=0&&e<this._settings.length)return this._settings[e]}return null},ke.prototype.getAllSections=function(t){if(null==t)return this._getAllSections();let e=this.getAllSectionSettings(t),i=e;for(let t=i.length;--t>=0;)i[t]=e[t].getSection();return i},ke.prototype.getAllSectionSettings=function(t){if(!t)return this._settings;let e=this._settings.length,i=[];t=this._toSectionType(t);for(let n=0;n<e;++n){let e=this._settings[n];t===e.getType()&&i.push(e)}return i},ke.prototype.getSectionIndex=function(t){if(nt.isNumber(t))return t;if(t instanceof MouseEvent){let e=nt.getRelativePosition(t,this._element),i={};return this._hitTestY(e.y,i),i.sectionIndex}let e=this.getSection(t);return null==e?-1:e.getIndex()},ke.prototype.getSectionTop=function(t){let e=this.getSection(t);if(null==e)return 0;let i=this._layoutY.getLaneStart(e.getRowOffset());return this._startVScrollbarIndex>=0&&e.getIndex()>=this._startVScrollbarIndex&&(i-=this._vscrollbar.getScrollTop()),i},ke.prototype.getPreviousSection=function(t,e){null==t&&(t=this._settings.length);let i=this._getNextSection(-1,t,e);return null!==i?i.getSection():null},ke.prototype.getNextSection=function(t,e){let i=this._getNextSection(1,t,e);return null!==i?i.getSection():null},ke.prototype.getLastSection=function(){return this.getSection(this._settings.length-1)},ke.prototype.getCell=function(t,e,i,n){let o=this.getSection(t);return o?o.getCell(e,i,n):null},ke.prototype.getCellInfo=function(t){if(!t)return null;let e=t.colIndex,i=t.rowIndex,n=t.sectionName,o=null;if(null==e||null==i)o=this.getRelativePosition(t),o.hit||(o=null);else{n||(n="content");let t=this.getSectionSettings(n);if(t){t.getSection().getCell(e,i)&&(o={},o.colIndex=e,o.rowIndex=i,t.extendEventArg(o))}}return o},ke.prototype.getNextCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?e:1)},ke.prototype.getPrevCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?-e:-1)},ke.prototype._getNextCellInRow=function(t,e){let i=this.getCellInfo(t);if(i){let t=i.colIndex+e,n=i.rowIndex,o=i.section;i.colIndex=t,i.cell=o.getCell(t,n)}return i},ke.prototype.getNextCell=function(t){let e=this.getNextCellInRow(t);if(e){if(!e.cell){let t=e.section,i=e.colIndex=0,n=e.rowIndex;e.rowIndex=++n,e.cell=t.getCell(i,n)}}return e},ke.prototype.getPrevCell=function(t){let e=this.getPrevCellInRow(t);if(e){if(!e.cell){let t=e.section,i=e.colIndex=t.getColumnCount()-1,n=e.rowIndex;e.rowIndex=--n,e.cell=t.getCell(i,n)}}return e},ke.prototype.getColumnCount=function(){return this._layoutX.getLaneCount()},ke.prototype.setColumnCount=function(t){let e=this._layoutX.getLaneCount();if(t>=e){this._layoutX.setLaneCount(t);for(let e=this._settings.length;--e>=0;){this._settings[e].getSection().setColumnCount(t)}this._onColumnCountChanged(),this._syncLayoutToColumns(e,t),this._dispatchColumnAddedEvent(e,t-e,!1)}else this._removeColumn(e-t)},ke.prototype.insertColumn=function(t,e){let i=this.getColumnCount();t<i||(t=i),this._layoutX.insertLane(t);for(let e=this._settings.length;--e>=0;){this._settings[e].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)},ke.prototype.insertColumns=function(t,e){let i=this.getColumnCount();t<i||(t=i);let n,o=0;if(Array.isArray(e)){if(o=e.length,1===o)return void this.insertColumn(t,e[0]);n=e}else{if("number"!=typeof e)return void this.insertColumn(t,e);if(o=e,1===o)return void this.insertColumn(t,null)}if(o<=0)return;let r=this.freezeLayout(),s=[t,0].concat(new Array(o));Array.prototype.splice.apply(this._columnDefs,s);for(let e=0;e<o;e++){let i=t+e;this._layoutX.insertLane(i);for(let t=this._settings.length;--t>=0;){this._settings[t].getSection().insertColumn(i)}let o=n&&n[e];this._deserializeColumn(i,o)}this._dispatchColumnAddedEvent(t,o,t<i,n),this.freezeLayout(r)},ke.prototype.removeColumnAt=function(t){let e=this.getColumnCount();if(t<0||t>=e)return null;let i=-1;this._colVirtualizer.isVirtualizable()&&(i=this._colVirtualizer.getLastIndexInView());let n=this._layoutX.removeLaneAt(t),o=this._settings.length;for(let e=0;e<o;++e)this._settings[e].getSection().removeColumnAt(t);let r=this._pinnedLeftColumnCount,s=this._pinnedRightColumnCount,l=this._columnDefs.splice(t,1)[0];if(this._onColumnCountChanged(),(t<r||t>=e-s)&&this._updateScrollbarWidth(!0,!0),this._syncLayoutToColumns(t,e-1,!0),l||(l={}),l.layout=n,this._hasListener("columnRemoved")){let e={atTheMiddle:!0};e.colIndex=t,e.columns="deprecated",e.columnData=l.columnData,e.colId=l.id||"",this._dispatchColumnEvent("columnRemoved",e)}return t<=i&&i===this._colVirtualizer.getLastIndexInView()&&this._colVirtualizer.update(),l},ke.prototype.removeAllColumns=function(){this.getColumnCount()>0&&(this._pinnedLeftColumnCount=0,this._pinnedRightColumnCount=0,this.setColumnCount(0))},ke.prototype.getStationaryColumnIndex=function(){for(let t=this.getColumnCount()-1;t>=0;t--)if(this._getColumnDef(t).stationary)return t;return-1},ke.prototype.isColumnMoveAllowed=function(t,e){if(Array.isArray(t)||(t=[t]),0===t.length||null==e)return!1;let i=this.getStationaryColumnIndex();if(i>-1){if(e<=i)return!1;for(let e=0;e<t.length;e++)if(t[e]<=i)return!1}return!0},ke.prototype.isColumnMovable=function(t){let e=this.getStationaryColumnIndex();return!(e>-1&&t<=e)},ke.prototype.moveColumn=function(t,e){if("number"==typeof t)return this._moveColumn(t,e);if(!Array.isArray(t))return!1;let i,n=t.length,o=[],r=0,s=this.getColumnCount(),l={};for(i=0;i<n;++i)r=t[i],r>=0&&r<s&&null==l[r]&&(l[r]=1,o.push(r));if(e<0?e=0:e>=s&&(e=s-1),n=o.length,!n)return!1;if(1===n)return this._moveColumn(o[0],e);if(!this.isColumnMoveAllowed(o,e))return!1;if(o.sort(Ve),l[e]){let t=!0;for(r=o[0],i=1;i<n;++i)if(++r!==o[i]){t=!1;break}if(t)return!1}let a,u,h=this.freezeLayout(!0),p=0;for(i=0;i<n;++i)a=o[i],a>=e&&(u=e+p,this._moveColumn(a,u),++p);let d=n-p;for(u=p?e-1:e,i=0;i<d;++i)a=o[i]-i,this._moveColumn(a,u);return this.freezeLayout(h),!0},ke.prototype._moveColumn=function(t,e){let 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;let n=-1;this._colVirtualizer.isVirtualizable()&&(n=this._colVirtualizer.getLastIndexInView());let o=this.getColumnId(t);this._layoutX.moveLane(t,e);let r=this._settings.length;for(let i=0;i<r;++i){this._settings[i].getSection().moveColumn(t,e)}let s=this._columnDefs[t],l=this._countPinnedLeftColumns(),a=this._countPinnedRightColumns();if(nt.moveArrayItem(this._columnDefs,t,e),this._hScrollbarEnabled&&(t<l?e>=i-a?this.freezeColumn(l-2,a+1):e>=l&&this.freezeColumn(l-2,a):s.rightPinned?e<l?this.freezeColumn(l,a-1):e<i-a&&this.freezeColumn(l-1,a-1):e<l?this.freezeColumn(l,a):e>=i-a&&this.freezeColumn(l-1,a+1)),!this._frozenLayout&&this._colVirtualizer.isEnabled()){let i=this._colVirtualizer.getFirstIndexInView();t<i&&e<i||t>n&&e>n||this._activateColumns(i,n,i,n)}if(this._hasListener("columnMoved")){let i={};i.fromColIndex=t,i.toColIndex=e,i.colId=o,this._dispatchColumnEvent("columnMoved",i)}return n===this._colVirtualizer.getLastIndexInView()&&(t<=n&&e>n||e<=n&&t>n)&&this._colVirtualizer.update(),this._updateColumnBounds(),this._updateColumnSeparators(),!0},ke.prototype.moveColumnById=function(t,e){let i=this.getColumnCount(),n=this.getColumnIndex(t);if(n<0||n>=i)return!1;let o=null!=e?this.getColumnIndex(e):-1;return o<0&&(o=i),this._moveColumnByIndex(n,o)},ke.prototype._moveColumnByIndex=function(t,e){return t<e&&--e,t!==e&&this.moveColumn(t,e)},ke.prototype.reorderColumns=function(t,e){let i="";"number"==typeof e?i=this.getColumnId(e):e&&(i=e),this.startBatch("move");let n=0;if(Array.isArray(t)){let e=t.length;if(e>1){let o,r,s,l,a=this.getColumnIds(),u=a.length,h=[],p=!1;for(o=0;o<e;++o){let e=t[o];"number"==typeof e?(s=e,r=a[e]||""):(r=e,s=a.indexOf(r)),r&&s>=0&&(h.push(r),i===r&&(p=!0))}if(e=h.length,p){if(l=this.getColumnIndex(i),l>=0)for(;++l<u&&(i=a[l],!(h.indexOf(i)<0)););(l<0||l>=u)&&(i="")}for(o=e;--o>=0;)r=h[o],s=this.getColumnIndex(r),l=this.getColumnIndex(i),l<0&&(l=u),n|=this._moveColumnByIndex(s,l),i=r}else n=this.moveColumnById(t[0],i)}else null!=t&&(n=this.moveColumnById(t,i));return this.stopBatch("move"),!!n},ke.prototype.getColumnLayout=function(){return this._layoutX},ke.prototype.updateColumnLayout=function(){this._syncLayoutToColumns(0,this.getColumnCount())},ke.prototype._deserializeColumn=function(t,e){if(!e)return;let i,n=e.layout||e,o=e.width;null!=o&&(n.size=o),o=e.scalable,null!=o&&(n.scalable=o),o=e.minWidth,null!=o&&(n.minSize=o),null==n.scalable&&(n.scalable=null==n.size),this._layoutX.deserializeLane(t,n);let r=e.styles;for(i in r)this.setColumnStyle(t,i,r[i]);let s=e.classes;for(i in s)this.enableColumnClass(t,i,s[i]);let l=this._getColumnDef(t),a=e.id;a&&"string"==typeof a&&(l.id=a,l.userId=a);let u=e.field;u&&"string"==typeof u&&(l.field=u);let h=e.dataColumnName;null!=h&&(l.dataColumnName=h),h=e.stationary,null!=h&&(l.stationary=!!h),h=e.leftPinned,null!=h&&(l.leftPinned=!!h),h=e.rightPinned,null!=h&&(l.rightPinned=!!h),this.setColumnRenderingHandler(t,e.renderingHandler),this.setColumnDataBindingHandler(t,e.dataBindingHandler),h=e.columnData,h&&this.setColumnData(t,h);let p=e.formatter||e.binding;if(Array.isArray(p)&&(p=p[0]),p&&"function"!=typeof p){let t=p.init;"function"==typeof t&&t(e,this)}},ke.prototype.addRow=function(t){if(null==t)t=1;else if(t<=0)return;this.getColumnCount()<=0&&this.setColumnCount(1);let e=this.getLastSection();null==e&&(e=this.addSection()),e.addRow(t)},ke.prototype.removeRow=function(t){let e=this.getLastSection();null!=e&&(null==t&&(t=1),e.removeRow(t))},ke.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},ke.prototype.setSectionRowCount=function(t,e){let i=this.getSection(t);null!=i&&i.setRowCount(e)},ke.prototype.getRowIndex=function(t,e){return this._sectionStarts[t]+e},ke.prototype.getRelativeIndex=nt._deprecatedFunction,ke.prototype.removeAllRows=function(){let t=this._settings.length;for(let e=0;e<t;++e)this._settings[e].getSection().setRowCount(0),this._sectionStarts[e]=0;this._sectionStarts[t]=0},ke.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},ke.prototype.setDefaultRowHeight=function(t,e){if(this._layoutY.setDefaultLaneSize(t)){this._rowHeightSync=!1;let t=this._layoutY.getDefaultLaneSize();this._rowHeightException=e?"":"title";let i=this._settings.length;for(let e=0;e<i;++e){let i=this._settings[e];i.getType()!==this._rowHeightException&&"bottomPadding"!==i.getId()&&i.getSection().setDefaultRowHeight(t)}this._syncRowHeights(),this._rowHeightSync=!0,this.setRowScrollingStep(this._rowScrollingStep),this._updateColumnSeparators()}},ke.prototype.getDataSource=function(){return this._dataSource},ke.prototype.setDataConflationRate=function(t){this._dataSource.setConflationRate(t)},ke.prototype.getDataConflationRate=function(){return this._dataSource.getConflationRate()},ke.prototype.setDataSource=function(t){t&&t instanceof ft&&(t=new Ie(t));let e={};if(e.prevDataSource=this._dataSource,this._dataSource=t||null,e.dataSource=this._dataSource,this._dispatch("dataSourceChanged",e),this._autoSetDataSource){let e=this._settings.length;for(let i=0;i<e;++i)this._settings[i].setDataSource(t)}return this._dispatch("postDataSourceChanged",e),this._dataSource},ke.prototype.setColumnTemplate=nt._deprecatedFunction,ke.prototype.getColumnTemplate=nt._deprecatedFunction,ke.prototype.getColumnRenderEvent=nt._deprecatedFunction,ke.prototype.getColumnDataBindingEvent=function(t){console.log("getColumnDataBindingEvent() is deprecated. Use setColumnDataBindingHandler() instead");let e=this;return{listen:function(i){e.setColumnDataBindingHandler(t,i)},unlisten:function(){e.setColumnDataBindingHandler(t,null)}}},ke.prototype.setColumnStyle=function(t,e,i,n){if(!e)return;let o;nt.isNumber(t)||(t=0,console.log("WARNING: the first parameter for setColumnStyle must be column index")),null==n?o=this._getNestedColumnDef(t,"styles"):(n=this._toSectionType(n),o=this._getNestedColumnDef(t,n,"styles")),o[e]=i;for(let o=this._settings.length;--o>=0;){let r=this._settings[o];if(null==n||n===r.getType()){r.getSection().setColumnStyle(t,e,i)}}},ke.prototype.enableColumnClass=function(t,e,i,n){let o;"number"!=typeof t&&(t=0),null==n?o=this._getNestedColumnDef(t,"classes"):(n=this._toSectionType(n),o=this._getNestedColumnDef(t,n,"classes"));let r=!1;if((i=!1!==i)?o[e]||(r=o[e]=!0):o[e]&&(delete o[e],r=!0),r)for(let o=this._settings.length;--o>=0;){let r=this._settings[o];null!=n&&n!==r.getType()||r.getSection().enableColumnClass(t,e,i)}return r},ke.prototype.hasColumnClass=function(t,e,i){let n;return null==i?n=this._getNestedColumnDef(t,"classes"):(i=this._toSectionType(i),n=this._getNestedColumnDef(t,i,"classes")),!(!n||!n[e])},ke.prototype.setColumnAlignment=function(t,e){let i=e?e.charAt(0).toLowerCase():"",n=0;n|=this.enableColumnClass(t,"tr-align-left","l"===i),n|=this.enableColumnClass(t,"tr-align-right","r"===i),n|=this.enableColumnClass(t,"tr-align-center","c"===i),n&&this._dispatch("columnAlignmentChanged",{colIndex:t,alignment:i})},ke.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"},ke.prototype.getColumnLeft=function(t){let e=this._columnDefs[t];if(e&&e.rightPinned){let e=this.getElement().clientWidth,i=this._layoutX.getTrackSize(),n=i<e?i:e;for(let e=this.getColumnCount()-1;e>=t;--e)n-=this._layoutX.getLaneSize(e);return n}return this._hScrollbarEnabled&&t>=this._pinnedLeftColumnCount?this._layoutX.getLaneStart(t)-this._hscrollbar.getScrollLeft():this._layoutX.getLaneStart(t)},ke.prototype.getColumnRight=function(t){return this.getColumnLeft(t)+this._layoutX.getLaneSize(t)},ke.prototype.getColumnWidth=function(t){return this._layoutX.getLaneSize(t)},ke.prototype.getColumnCustomLaneSize=function(t){return this._layoutX.getCustomLaneSize(t)},ke.prototype._calculateColumnWidths=function(t,e){if(!this._preserveGridSize)return e;let i,n=0,o={},r=t.length,s=new Array(r);for(i=0;i<r;i++)o[t[i]]=!0,s[i]=e[i],n+=e[i];let l=0,a=0,u=this.getColumnCount(),h=this._layoutX;for(i=0;i<u;i++)o[i]||h.isLaneVisible(i)&&(h.getLaneScalability(i)?(l+=h.getMinimumLaneSize(i),a++):l+=h.getLaneSize(i));let p=this.getContentWidth(),d=n+l-p;if(a<1||d>0){for(h.resetLaneToDefaultSize(),h.setTrackSize(p-this._reservedSpace),l=0,i=0;i<u;i++)o[i]||h.isLaneVisible(i)&&(h.getLaneScalability(i)?l+=h.getMinimumLaneSize(i):l+=h.getLaneSize(i));if(d=n+l-p,d>0)for(d/=r,i=0;i<r;i++)s[i]-=d}return s},ke.prototype.setColumnWidth=function(t,e,i){let n=this._calculateColumnWidths([t],[e]),o=this._setColumnWidth(t,n[0],i);return o&&this._syncLayoutToColumns(t,t+1),o},ke.prototype.setColumnWidths=function(t,e){let i,n=0,o=[],r=[],s=[];for(i=t.length;--i>=0;){let n=t[i];null!=n&&(o.push(i),r.push(n));let l=Array.isArray(e)?e[i]:e;s.push(l)}let l=this._calculateColumnWidths(o,r);for(i=0;i<l.length;i++)n|=this._setColumnWidth(o[i],l[i],s[i]);return n&&this._syncLayoutToColumns(0,t.length),!!n},ke.prototype.isColumnVisible=function(t){return this._layoutX.isLaneVisible(t)},ke.prototype.hideColumn=function(t,e){let i=!1===e;this.setColumnVisibility(t,i,0)},ke.prototype.hideColumns=function(t,e){let i=Array.isArray(t)?t.length:0,n=[],o=this.getColumnCount();e=!1!==e;for(let r=0;r<i;++r){let i=t[r];i>=0&&i<o&&this._layoutX.hideLane(i,e,0)&&n.push(i)}if(n.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){let t={};t.colIndices=n,t.hidden=e,this._dispatch("columnVisibilityChanged",t)}},ke.prototype.showAllColumns=function(){let t=[],e=this.getColumnCount();for(let i=0;i<e;++i)this._layoutX.hideLane(i,!1,0)&&t.push(i);if(t.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){let e={};e.colIndices=t,e.hidden=!1,this._dispatch("columnVisibilityChanged",e)}},ke.prototype.getMinimumColumnWidth=function(t){return this._layoutX.getMinimumLaneSize(t)},ke.prototype.setMinimumColumnWidth=function(t,e){this._layoutX.setMinimumLaneSize(t,e)&&this._syncLayoutToColumns(t,t+1)},ke.prototype.setMinimumColumnWidths=function(t,e){let i=0,n=NaN,o=NaN;for(let r=t.length;--r>=0;){let s=t[r];null!=s&&(o||(o=r),n=r,i|=this._layoutX.setMinimumLaneSize(r,s,e))}return i&&this._syncLayoutToColumns(n,o+1),!!i},ke.prototype.getColumnScalability=function(t){return this._layoutX.getLaneScalability(t)},ke.prototype.setColumnScalability=function(t,e){let i=!1;return nt.isNumber(t)?(e=!1!==e,i=this._layoutX.setLaneScalability(t,e),i&&this._syncLayoutToColumns(t,t+1)):this.setDefaultColumnScalable(t),i},ke.prototype.setDefaultColumnScalable=function(t){this._layoutX.setDefaultScalability(!!t)},ke.prototype.resetColumnWidths=function(){let t=this._layoutX.resetLaneToDefaultSize();return t&&this._syncLayoutToColumns(0,this.getColumnCount()),t},ke.prototype.setColumnDefaultWidth=function(t,e){this._layoutX.setLaneDefaultSize(t,e)},ke.prototype.preserveProportion=function(t){this._preserveProportion=!0===t},ke.prototype.isProportionPreserved=function(){return this._preserveProportion},ke.prototype.preserveGridSize=function(t){this._preserveGridSize=!0===t},ke.prototype.getColumnData=function(t){return this._getColumnDef(t).columnData},ke.prototype.setColumnData=function(t,e){return this._getColumnDef(t).columnData=e||{},e},ke.prototype.newColumnData=ke.prototype.getColumnData,ke.prototype.setAlwaysRenderColumn=function(t,e){this.getColumnData(t).alwaysRender=!1!==e},ke.prototype._isAlwaysRenderColumn=function(t){return!0===this.getColumnData(t).alwaysRender},ke.prototype.getFitContentWidth=function(){return this._fitContentWidth},ke.prototype.setFitContentWidth=function(t){this._fitContentWidth!==t&&(this._fitContentWidth=t,this.enableClass("fit-width",this._fitContentWidth))},ke.prototype.loadPlugin=function(t,e){let i=null;if("string"==typeof t){let e=window.tr,n=e?e.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;let n=i.getName();if(!n)return null;let o=this._plugins[n];if(o){if(o===i)return o;console.log("WARNING: Two of the same "+n+"s cannot be loaded on a single grid. The existing plugin is replaced."),this.unloadPlugin(n)}return i.initialize&&i.initialize(this,e),this._plugins[n]=i,i},ke.prototype.unloadPlugin=function(t){let e;if(t){let i="";"string"==typeof t?i=t:t.getName&&(i=t.getName()),e=this._plugins[i],e||(i+="Plugin",e=this._plugins[i]),e&&(e.unload&&e.unload(this),delete this._plugins[i])}return e||null},ke.prototype.getPlugin=function(t){let e=this._plugins[t];return e||(e=this._plugins[t+"Plugin"]),e||null},ke.prototype.getPlugins=function(){let t=[];for(let e in this._plugins)t.push(this._plugins[e]);return t},ke.prototype.getPluginList=function(){let t=[];for(let e in this._plugins)t.push(e);return t},ke.prototype.freezeSection=function(t){this._fixFrozenTopSections=!0,this._freezeTopSectionAt(t)},ke.prototype.resetSectionFreezing=function(){this._fixFrozenTopSections=!1,this._updateFrozenTopSections()},ke.prototype._freezeTopSectionAt=function(t){if("number"==typeof t){let e=t+1;if(e===this._startVScrollbarIndex)return;this._startVScrollbarIndex=e}else this._startVScrollbarIndex=-1,"string"==typeof t&&(this._tempFrozenSectionRef=t);this._onSectionCountChanged()},ke.prototype.freezeFooter=function(t){this._fixFrozenBottomSection=!0,this._frozenFooterCount!==t&&(this._setFrozenFooter(t),this._onSectionCountChanged())},ke.prototype._setFrozenFooter=function(t){this._frozenFooterCount!==t&&(this._frozenFooterCount=t,this._vscrollbar.setFooterCount(t),this._hscrollbar.setFooterCount(t))},ke.prototype.getFooterCount=function(){return this._frozenFooterCount},ke.prototype.freezeColumn=function(t,e){let i,n,o=this.getColumnCount(),r=0,s=0,l=!1;if(t||0===t)for(this._hScrollbarEnabled=!0,r=t>=0?t+1:0,this._pinnedLeftColumnCount!==r&&(l=!0,this._pinnedLeftColumnCount=r),i=0;i<o;++i)n=this._getColumnDef(i),n.leftPinned=--r>=0;else this._hScrollbarEnabled=!1;if(null!=e)for(s=e>0?e:0,this._pinnedRightColumnCount!==s&&(l=!0,this._pinnedRightColumnCount=s),i=o;--i>=0;)n=this._getColumnDef(i),n.rightPinned=--s>=0;this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),this._updateColumnSeparators(),l&&(this._isEventDispatching("pinningChanged")||this._dispatch("pinningChanged",{}))},ke.prototype._countPinnedLeftColumns=function(){let t=0;if(this._hScrollbarEnabled)for(let e=this._columnDefs.length;--e>=0;){let i=this._columnDefs[e];if(i&&i.leftPinned){t=e+1;break}}return this._pinnedLeftColumnCount=t,t},ke.prototype._countPinnedRightColumns=function(){let t=0;if(this._hScrollbarEnabled){let e,i=this._columnDefs.length;for(e=0;e<i;++e){let t=this._columnDefs[e];if(t&&t.rightPinned)break}t=i-e}return this._pinnedRightColumnCount=t,t},ke.prototype.isPinnedColumn=function(t){return t<this.getFrozenColumnCount()||t>=this.getFirstPinnedRightIndex()},ke.prototype.getFrozenColumnCount=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:0},ke.prototype.getPinnedLeftColumnCount=ke.prototype.getFrozenColumnCount,ke.prototype.getPinnedRightColumnCount=function(){return this._pinnedRightColumnCount},ke.prototype.getFirstPinnedRightIndex=function(){return this.getColumnCount()-this._pinnedRightColumnCount},ke.prototype.updateLayout=function(){this._disposed||this._layoutUpdating||(this._layoutUpdating=!0,this._dispatch("preForcedUpdate",{}),this._updateLayout(),this._colVirtualizer.isEnabled()&&this._activateColumns(),this._layoutUpdating=!1)},ke.prototype.updateScrollbars=function(t,e){e&&this._updateScrollbarWidth(!0,!1),t&&this._updateScrollbarHeight(!0,!1)},ke.prototype.freezeLayout=function(t){t=!1!==t;let e=this._frozenLayout;if(e!==t){this._frozenLayout=t;let e,i,n=this.getPlugin("SortableTitlePlugin");this._frozenLayout&&n&&n.freezeIndicator(!0),this._frozenLayout||(this._disableEvent("widthChanged"),this._onSectionCountChanged(),this._onColumnCountChanged(),this._colVirtualizer.isEnabled()&&this._activateColumns()),this._rowHeightSync=!1;let o=this._settings.length;for(e=0;e<o;e++)i=this._settings[e].getSection(),i.setFrozenLayout(this._frozenLayout);if(!this._frozenLayout){this._syncLayoutToColumns(0,this.getColumnCount()),this._disableEvent("widthChanged",!1),this._dispatch("widthChanged",{}),this._syncRowHeights()||this._rowVirtualizer.update(!0),n&&n.freezeIndicator(!1)}this._rowHeightSync=!0}return e},ke.prototype.unfreezeLayout=function(t){this.freezeLayout(!1===t)},ke.prototype.isLayoutFrozen=function(){return this._frozenLayout},ke.prototype.showBorders=nt._deprecatedFunction,ke.prototype.hideBorders=nt._deprecatedFunction,ke.prototype.toggleBorders=function(t){this.toggleClass("no-borders",null!=t?!t:null)},ke.prototype.toggleGridlines=function(t){this.toggleClass("no-gridlines",null!=t?!t:null)},ke.prototype.toggleVerticalLines=function(t){this.toggleClass("no-vertical-grid-line",null!=t?!t:null)},ke.prototype.toggleHorizontalLines=function(t){this.toggleClass("no-horizontal-grid-line",null!=t?!t:null)},ke.prototype.toggleContentVerticalLines=function(t){this.toggleClass("no-content-vertical-line",null!=t?!t:null)},ke.prototype.getDataColumnMap=function(){let t=[];for(let e=this.getColumnCount();--e>=0;)t[e]=this.getDataColumnName(e);return t},ke.prototype.setDataColumnMap=function(t){let e,i;if(t)for(e=t.length;--e>=0;)i=this._getColumnDef(e),i.dataColumnName=t[e];else for(e=this._columnDefs.length;--e>=0;)i=this._columnDefs[e],i&&null!=i.dataColumnName&&(i.dataColumnName=null)},ke.prototype.getDataColumnName=function(t){return this._getColumnDef(t).dataColumnName||""},ke.prototype.setDataColumnName=function(t,e){this._getColumnDef(t).dataColumnName=e},ke.prototype.setDefaultRenderingHandler=function(t){this._renderingHandler="function"==typeof t?t:null},ke.prototype.setDefaultDataBindingHandler=function(t){this._dataBindingHandler="function"==typeof t?t:null},ke.prototype.setColumnRenderingHandler=function(t,e){this._getColumnDef(t).renderingHandler="function"==typeof e?e:null},ke.prototype.setColumnDataBindingHandler=function(t,e){this._getColumnDef(t).dataBindingHandler="function"==typeof e?e:null},ke.prototype.getColumnRenderingHandler=function(t){return this._getColumnDef(t).renderingHandler||null},ke.prototype.getColumnDataBindingHandler=function(t){return this._getColumnDef(t).dataBindingHandler||null},ke.prototype.enableRowHighlighting=function(t){if(null==t&&(t=!0),this._rowHighlighting!==t){this._rowHighlighting=t;let e=this.getAllSections("content");for(let t=e.length;--t>=0;)e[t].enableRowHighlighting(this._rowHighlighting)}},ke.prototype._getTarget=function(t){let e=t.target;if(e){let i=null;return this._element.contains(e)||(i=t.composedPath?t.composedPath():t.path),i?i[0]||null:e}return t.getElement?t.getElement():nt.isElement(t)?t:null},ke.prototype.getRelativePosition=function(t,e){if(!t)return{};let i=e||{},n=this._getTarget(t);t.target?nt.getRelativePosition(t,this.getElement(),i):n&&nt.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;let o=nt.closestElement(n,"cell");if(!o)return i;i.cellElement=o;let r=nt.closestElement(o,"column");i.columnElement=r;let s=null;if(s=r?nt.closestElement(r,"tr-lg"):nt.closestElement(o,"tr-lg"),!s)return i;i.sectionName=s.id||nt.closestElement(s,"tr-vlg").id;let l=this.getSectionSettings(i.sectionName);if(!l)return i;l.extendEventArg(i);let a=l.getSection(),u=a.getColumnIndex(r||o);return u<0?i:(i.colIndex=u,!1===this._hitTestY(-1,i)||(o.stretched?i.cell=a.getStretchedCell(u,i.rowIndex):i.cell=a.getCell(u,i.rowIndex),i.hit=!0),i)},ke.prototype.getVScrollbar=function(){return this._vscrollbar},ke.prototype.getHScrollbar=function(){return this._hscrollbar},ke.prototype.autoHideScrollbars=function(t){t=null==t||t,this._vscrollbar.setAutoHide(t),this._hscrollbar.setAutoHide(t)},ke.prototype.getVScrollStartIndex=function(){return this._startVScrollbarIndex},ke.prototype.getHScrollStartIndex=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:-1},ke.prototype.scrollToColumn=function(t,e){if(!this._updateScrollbar(this._hscrollbar))return!1;let i=this._layoutX.getLaneCount();if(t<=0?t=0:t>=i&&(t=i-1),this.isPinnedColumn(t))return!1;let n=this._hScrollbarEnabled?this._layoutX.getLaneStart(this._pinnedLeftColumnCount):0,o=this._hscrollbar.getScrollLeft(),r=o+n,s=this._hscrollbar.getWidth(),l=this._layoutX.hitTest(r),a=this._layoutX.getLaneStart(t),u=this._layoutX.getLaneSize(t);if(e||u>=s||t<=l){let t=a-n;if(o!==t)return this._hscrollbar.setScrollLeft(t),!0}else{let e=r+s;if(t>=this._layoutX.hitTest(e-.1)){let t=o+(a+u)-e;return this._hscrollbar.setScrollLeft(t),!0}}return!1},ke.prototype.getScrollLeft=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getScrollLeft():0},ke.prototype.setScrollLeft=function(t){this._updateScrollbar(this._hscrollbar)&&this._hscrollbar.setScrollLeft(t)},ke.prototype.scrollRight=function(t){this.setScrollLeft(this._hscrollbar.getScrollLeft()+t)},ke.prototype.getScrollWidth=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getContentWidth():0},ke.prototype.getYScrollVal=function(t,e,i){if(!this._updateScrollbar(this._vscrollbar))return null;let n=null;t&&(n=this.getSection(t));let o=this._layoutY.getLaneCount();e<=0?e=0:e>=o&&(e=o-1);let r=this.getVerticalViewInfo(),s=r.topRowIndex,l=-1;if(i)l=e;else if(e<s)l=e-3,l<0&&(l=0);else{let t=r.bottomRowIndex;if(e>t){l=e-(t-s)+3,l<0&&(l=0)}}let a=n?n.getRowOffset():this._sectionStarts[this._startVScrollbarIndex],u=this._layoutY.getLaneStart(this._startVScrollbarIndex);return l>=0?this._layoutY.getLaneStart(l+a)-u:null},ke.prototype.scrollToRow=function(t,e,i){let n=this.getYScrollVal(t,e,i);null!==n&&this._vscrollbar.setScrollTop(n)},ke.prototype.getVerticalViewInfo=function(){let t=this._sectionStarts[this._startVScrollbarIndex],e=this._layoutY.getLaneStart(t),i=this._vscrollbar.getHeight(),n=this._vscrollbar.getScrollTop()+e,o=n+i;return{topRowIndex:this._layoutY.hitTest(n)-t,bottomRowIndex:this._layoutY.hitTest(o-.1)-t}},ke.prototype.getVScrollView=function(){if(!this._updateScrollbar(this._vscrollbar))return null;let t=this._layoutY.getLaneCount();if(0===t)return null;let e=this._sectionStarts[this._startVScrollbarIndex],i=this._layoutY.getLaneStart(e),n=this._vscrollbar.getScrollTop()+i,o=this._vscrollbar.getHeight(),r=n+o,s=this._layoutY.hitTest(n),l=this._layoutY.hitTest(r-.1),a=this._layoutY.getLaneStart(s),u=this._layoutY.getLaneEnd(l),h=n-o,p=h<=i?e:this._layoutY.hitTest(h)+1,d=r+o,c=d>=this._layoutY.getTrackSize()?t-1:this._layoutY.hitTest(d-.1)-1;s-=e,l-=e;let _={};return _.viewTop=n-i,_.viewBottom=r-i,_.topRowIndex=s,_.bottomRowIndex=l,_.firstFullRow=a<n?s+1:s,_.lastFullRow=u>r?l-1:l,_.prevPageRowIndex=p-e,_.nextPageRowIndex=c-e,_},ke.prototype.getScrollTop=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getScrollTop():0},ke.prototype.setScrollTop=function(t){this._updateScrollbar(this._vscrollbar)&&this._vscrollbar.setScrollTop(t)},ke.prototype.scrollDown=function(t){this.setScrollTop(this._vscrollbar.getScrollTop()+t)},ke.prototype.getScrollHeight=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getContentHeight():0},ke.prototype.restoreScrollbars=function(){this._vscrollbar.restoreTrackPosition()},ke.prototype.enableAutoSetDataSource=function(t){this._autoSetDataSource=t},ke.prototype.getRowVirtualizer=function(){return this._rowVirtualizer},ke.prototype.getColumnVirtualizer=function(){return this._colVirtualizer},ke.prototype.enableRowVirtualization=function(t){this._rowVirtualizer.enable(t),this._rowVirtualizer.isEnabled()&&this._vscrollbar.isEnabled()?this._rowVirtualizer.activate():this._rowVirtualizer.deactivate()},ke.prototype.isRowVirtualizationEnabled=function(){return this._rowVirtualizer.isEnabled()},ke.prototype.enableColumnVirtualization=function(t){this._colVirtualizer.enable(t);let e=this._colVirtualizer.isEnabled();for(let t=this._settings.length;--t>=0;){this._settings[t].enableColumnVirtualization(e)}},ke.prototype.isColumnVirtualizationEnabled=function(){return this._colVirtualizer.isEnabled()},ke.prototype.setRowScrollingStep=function(t){this._rowScrollingStep=t>0?t:0,this._vscrollbar.setScrollingStep(this._layoutY.getDefaultLaneSize()*this._rowScrollingStep)},ke.prototype.getVMouseWheelHandler=function(){return this._vscrollbar.getDefaultMouseWheelLogic()},ke.prototype.synchronizeVScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);let 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)},ke.prototype.synchronizeHScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);let 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)},ke.prototype.updateRowData=function(t,e,i,n){let o=this.getSectionSettings(t||"content");o&&o.updateRowData(e,i,n)},ke.prototype.rerender=function(){let t=this._settings.length;for(let e=0;e<t;e++)this._settings[e].rerender()},ke.prototype.requestRowRefresh=function(){this._rowRefreshTimer||(this._rowRefreshTimer=setTimeout(this._onRowRefresh,100))},ke.prototype._requestScrollbarUpdate=function(){this._updateScrollbarHeight(!0,!0),this._rowHeightTimerId=0},ke.prototype.deactivateRendering=function(t){if((t=!1!==t)==this._noBinding)return;this._noBinding=t;let e=this.getSectionSettings("content");e&&(e.disableDataBinding(t),t||this.requestRowRefresh())},ke.prototype._onRowRefresh=function(){this._rowRefreshTimer=0,this.updateRowData()},ke.prototype.disableLazyRendering=function(t){console.log("WARNING: This function is deprecated.")},ke.prototype.getData=function(t,e,i){let n=this.getSectionSettings(t);if(!n)return null;let o=this._toDataColumnName(e);return n.getData(o,i)},ke.prototype.setData=function(t,e,i,n){let o=this.getSectionSettings(t);if(o&&o.isDataBindable()){let t=this._toDataColumnName(e);return o.setData(t,i,n)}return!1},ke.prototype.removeRowData=function(t,e){let i=this.getSectionSettings(t);return!(!i||!i.isDataBindable())&&i.removeRowData(e)},ke.prototype.setHidingMethod=function(t){if(t||(t=""),this._hidingMethod!==t){this._hidingMethod=t;let e=this.getAllSections();for(let i=e.length;--i>=0;)e[i].setHidingMethod(t)}},ke.prototype.getHorizontalLayout=function(){return this._layoutX},ke.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")){let i={};i.colIndex=t,i.hidden=!e,this._dispatch("columnVisibilityChanged",i)}return!0}return!1},ke.prototype.getColumnVisibility=function(t,e){return this._layoutX.getLaneVisibilityBit(t,e)},ke.prototype.reserveRightSpace=function(t){if(this._reservedSpace!==t){this._reservedSpace=t;for(let e=this._settings.length;--e>=0;)this._settings[e].getSection().reserveRightSpace(t);return this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),!0}return!1},ke.prototype.getHiddenInput=function(){return this._hiddenInput},ke.prototype.focus=function(){let t=this._hiddenInput,e=document.activeElement;if(t&&t!==e){let e=window.pageXOffset,i=window.pageYOffset;if(t.setActive)try{t.setActive()}catch(e){t.focus({preventScroll:!0})}else t.focus({preventScroll:!0});i===window.pageYOffset&&e===window.pageXOffset||window.scrollTo(e,i)}},ke.prototype.isBinding=function(){return this._dispatchingDataChanged},ke.prototype.hideRow=function(t,e){this._dataSource.hideRow(t,e)},ke.prototype.hideRows=function(t,e){Array.isArray(t)?this._dataSource.hideRows(t,e):this._dataSource.hideRow(t,e)},ke.prototype.showRows=function(t,e){Array.isArray(t)?this._dataSource.showRows(t,e):this._dataSource.showRows([t],e)},ke.prototype.unhideAllRows=function(){this._dataSource.unhideAllRows()},ke.prototype.hasHiddenRow=function(){return this._dataSource.hasHiddenRow()},ke.prototype.initSimpleTable=function(t){let e=0;t||this.getColumnCount()||(t=["Default"]),t&&(e=t.length,this.setColumnCount(e),this.setDataColumnMap(t));let i=this.addSection("title");if(i.addRow(1),!this._renderingHandler)for(let n=0;n<e;++n)i.setCellContent(n,0,t[n]);this.addSection("content");let n=this.getSectionSettings("title");n.disableDataBinding();let o=this.getSectionSettings("content");o.setAutoSyncRowCount(!0),o.setParent(n),this._dataBindingHandler||this.setDefaultDataBindingHandler(ke._defaultDataBinding)},ke._defaultDataBinding=function(t){t.cell.setContent(t.dataValue)},ke.prototype.selectColumn=function(t,e){for(let i=this._settings.length;--i>=0;)this._settings[i].getSection().selectColumn(t,e);this._updateColumnBounds()},ke.prototype.isSelectedColumn=function(t){let e=this._settings[0]||null;return!!e&&e.getSection().isSelectedColumn(t)},ke.prototype._updateColumnBounds=function(){if(this._columnBoundConflator.conflate())return;let t=this._settings.length;if(!t)return;let e,i=[],n=null,o=this.getColumnCount(),r=[];for(e=0;e<o;e++)this.isSelectedColumn(e)?(r.push(e),n||(n=[e,-1])):n&&(n[1]=e-1,i.push(n),n=null);n&&(n[1]=o-1,i.push(n),n=null);let s={selectedColumns:r,selectionRanges:i};this._dispatch("beforeColumnBoundUpdate",s);let l=i.length,a=[],u=[],h=this._settings[0],p=h.getSection();for(e=0;e<l;++e){n=i[e];let t=[0,0],o=[!1,!1];p.calculateColumnBounds(n[0],n[1],t,o),t[0]<t[1]&&(a.push(t),u.push(o))}let d=0,c=-1;for(null!=s.topBoundRowIndex&&(c=+s.topBoundRowIndex),c>=0&&"title"===h.getType()&&(d=this._layoutY.getLaneStart(c)),p.updateColumnBounds(a,u,d),e=1;e<t;e++)p=this._settings[e].getSection(),p.updateColumnBounds(a,u)},ke.prototype._updateColumnSeparators=function(){let t=this._settings.length;if(t)for(let e=0;e<t;e++){let t=this._settings[e].getSection();t&&t.updateColumnSeparators()}},ke.prototype.getColumnRect=function(t,e){let i=this.getElement().clientWidth,n=i,o=this._hscrollbar;o.isActive()&&(n=o.getTrackSize());let r=0,s=0;if(this._settings.length){let i=[0,0];this._settings[0].getSection().calculateColumnBounds(t,e,i,[]),r=i[0],s=i[1]-r}return{top:0,left:r,width:s,height:this._layoutY.getTrackSize(),leftPinnedIndex:this._pinnedLeftColumnCount-1,rightPinnedIndex:this.getFirstPinnedRightIndex(),scrollViewSize:n,gridWidth:i}},ke.prototype.getRowRect=function(t,e){let i=this._layoutX.getTrackSize(),n=this.getElement().clientWidth;i=i<n?i:n;let o=this.getSection("content"),r=o?o.getRowOffset():1,s=this._layoutY,l=s.getLaneStart(r),a=0,u=o.getHeight(),h=this._vscrollbar;h.isActive()&&(a=h.getScrollTop(),u=h.getTrackSize());let p=u+l,d=s.getLaneStart(t+r)-a,c=s.getLaneEnd(e+r)-a;return d<l?d=l:d>p&&(d=p),c<l?c=l:c>p&&(c=p),d-=l,c-=l,{top:d,left:0,width:i,height:c-d,scrollViewSize:u,scrollViewTop:l,scrollViewBottom:p}},ke.prototype.normalizeConfig=function(t){t||(t={});let e,i,n=t.columns,o=n?n.length:0,r=t.columnFreezing;null==r&&(r=t.freezeColumn);let s=t.pinnedRightColumns||t.frozenRightColumns;if(s)for(delete t.pinnedRightColumns,delete t.frozenRightColumns,t.columnVirtualRendering=!1,t.columnVirtualization=!1,e=o;--e>=0;)--s>=0&&(i=n[e],i&&(i.rightPinned=!0));return null!=r&&(delete t.columnFreezing,delete t.freezeColumn,r>=0&&n&&(i=n[r],i&&(i.leftPinned=!0))),t},ke.prototype.setColumnGrouping=function(t){this._groupDefs=t||null},ke.prototype.getColumnGroupParentId=function(t){if(this._groupDefs){let e="number"==typeof t?this.getColumnId(t):t;return this._groupDefs.getParentId(e)}return""},ke.prototype.getColumnGroupChildIds=function(t){if(this._groupDefs){let e=this._groupDefs.getLeafDescendants(t);if(e&&e.length>0)return e}return null},ke.prototype.getValidColumnList=function(t,e){let i=[];if(!t)return i;e||(e=this.createColumnMap(t));let n=this.getColumnCount();for(let t=0;t<n;++t){let n=this._getColumnDef(t).id;null!=e[n]&&i.push({index:t,id:n})}return i},ke.prototype.createColumnMap=function(t){t||(t=this.getColumnIds());let e={},i=t.length;for(let n=0;n<i;n++){let i=t[n];"number"==typeof i&&(i=this.getColumnId(i)),i&&(e[i]=!0)}return e},ke.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)},ke.prototype.stopBatch=function(t){return!!t&&(this._dispatch("afterBatchOperation",{batches:this._batches,batchType:t}),"reset"===t&&this._disableEvent("columnVisibilityChanged",!1),delete this._batches[t],y(this._batches)&&(this._batches=null),!0)},ke.prototype._dispatchColumnEvent=function(t,e){let i=this._batches;i&&(e.batches=i),this._dispatch(t,e)},ke.prototype._dispatchColumnPositionChanged=function(){this._columnPositionConflator.conflate()||this._dispatch("columnPositionChanged",{sender:this})},ke.prototype._dispatchRowPositionChanged=function(){this._rowPositionConflator.conflate()||this._dispatch("rowPositionChanged",{sender:this})},ke.prototype._getAllSections=function(){let t=[],e=this._settings.length;for(let i=0;i<e;i++)t.push(this._settings[i].getSection());return t},ke.prototype._getNextSection=function(t,e,i){let n=this.getSectionIndex(e)+t;if(null==i)return this.getSectionSettings(n);i=this._toSectionType(i);let o=this._settings.length;for(;n>=0&&n<o;){let e=this._settings[n];if(i===e.getType())return e;n+=t}return null},ke.prototype._toSectionType=function(t){if(ke._sectionType[t])return t;if(nt.isString(t)){switch(t.charAt(0).toLowerCase()){case"t":return"title";case"h":case"s":return"header";case"f":return"footer"}}return"content"},ke.prototype._newSection=function(t,e){if(e)for(let t=this._settings.length;--t>=0;)if(this._settings[t].getId()===e)return null;t=this._toSectionType(t);let i={horizontalScrollbar:this._hscrollbar},n="content"===t?new ze(i):new Ce(i);n._setContext(this);let o=new Le(n);o.setId(e),o.setType(t),o.listen("dataChanged",this._onSectionDataChanged),o.listen("rowAvailable",this._onRowAvailable);let r="content"===t&&this._rowHighlighting;return n.enableRowHighlighting(r),n.enableShading(!1),n.setHidingMethod(this._hidingMethod),o.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),o},ke.prototype._putToLast=function(t){if(0===this._settings.length)t.setParent(this._element,!0);else{let e=this.getLastSection().getElement().nextSibling;null!==e?t.insertBefore(e):t.setParent(this._element)}},ke.prototype._syncStyleToSectionColumns=function(t,e){let i;for(let n=this._columnDefs.length;--n>=0;){let o=this._getColumnDef(n),r=o.styles;for(i in r)t.setColumnStyle(n,i,r[i]);let s=o.classes;for(i in s)t.enableColumnClass(n,i,!0);let l=o[e];if(l){for(i in r=l.styles,r)t.setColumnStyle(n,i,r[i]);for(i in s=l.classes,s)t.enableColumnClass(n,i,!0)}}},ke.prototype._syncRowHeights=function(){let t=this._settings.length;for(let e=0;e<t;++e)this._syncSectionRowHeights(this._settings[e].getSection());return!this._frozenLayout&&this._updateScrollbarHeight(!0,!0)},ke.prototype._syncSectionRowHeights=function(t){this._layoutY.copyFrom(t.getRowLayout(),this._sectionStarts[t.getIndex()])},ke.prototype._setColumnWidth=function(t,e,i){let n=!1,o=this._layoutX;if(null!=i)n=o.setLaneScalability(t,!!i);else{let i=o.getLaneScalability(t);if(this._preserveProportion){if(i){let i=this.getColumnCount(),n=0,r=0;for(let t=0;t<i;++t){if(!o.getLaneScalability(t))continue;let e=o.getLaneSize(t);n+=o.getCustomLaneSize(t),r+=e}(!(e=(e*n-e*o.getCustomLaneSize(t))/(r-e))||e<0)&&(e=n)}}else n=o.setLaneScalability(t,!1)}return n=o.setLaneSize(t,e)||n,n},ke.prototype._dispatchColumnAddedEvent=function(t,e,i,n){let o={};if(this._hasListener("columnAdded"))if(o.atTheMiddle=i,1===e)o.colIndex=t,o.context=n,this._dispatchColumnEvent("columnAdded",o);else{let i=Array.isArray(n)?n:[];for(let n=0;n<e;++n)o.colIndex=t+n,o.context=i[n],this._dispatchColumnEvent("columnAdded",o)}this._frozenLayout&&(o.noDataUpdate=!0),this._dispatchColumnRenderEvent(o,t,t+e,0,this._settings.length,NaN,NaN)},ke.prototype._dispatchColumnRenderEvent=function(t,e,i,n,o,r,s){if(!(n<o))return;let l;if(t.sender=this,t.fromColIndex=e,t.toColIndex=i,this._hasListener("preSectionRender"))for(l=n;l<o;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("preSectionRender",t);for(let a=e;a<i;++a){let e=this.getColumnRenderingHandler(a)||this._renderingHandler;if(e)for(t.colIndex=a,t.dataColumnName=this.getDataColumnName(a),l=n;l<o;++l){let i=this._settings[l];i.extendRenderEventArg(t,r,s);let n=i.getSection(),o=t.fromRowIndex,u=t.toRowIndex;for(let i=o;i<u;++i)t.rowIndex=i,t.cell=n.getCell(a,i,!1),e(t)}}if(this._hasListener("postSectionRender"))for(l=n;l<o;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("postSectionRender",t);if(!t.noDataUpdate&&!this._noBinding)for(l=n;l<o;++l)this.updateRowData(this._settings[l],r,s-1)},ke.prototype._dispatchRowExpansionBinding=function(t){if(!this._hasListener("rowExpansionBinding"))return;let e=t.dataSource;if(!e||!e.getDataSource())return;let i=t.fromRowIndex,n=t.toRowIndex,o=e.getVisibleRowIds(!0),r=t.section;t.rowData=null,t.cell=null;let s=!1;for(let l=n-1;l>=i;--l){let i=e.getRowId(l);if(!s){let t=e.getRowExpansionCount(i);if(t>0){l=l+t+1,s=!0;continue}}let n=r.getContextRow(l),a=e.getExpansionParentByRowId(i);if(a)t.originalRowData=e.getRowData(a),t.originalRowId=a,t.rowExpansion=n.rowExpansion=!0;else{if(!n.rowExpansion)continue;t.originalRowData=null,t.originalRowId=null,t.rowExpansion=n.rowExpansion=!1}t.rowId=o[l],t.rowIndex=l,this._dispatch("rowExpansionBinding",t)}t.originalRowData=null,t.originalRowId=null,t.rowExpansion=!1},ke.prototype._removeColumn=function(t){let e=this._layoutX.getLaneCount();if(t>e&&(t=e),t<=0)return;let i=e-t;this._layoutX.setLaneCount(i);for(let t=this._settings.length;--t>=0;){this._settings[t].getSection().setColumnCount(i)}let n=this._columnDefs.slice(i);if(this._columnDefs.length=i,this._onColumnCountChanged(),this._syncLayoutToColumns(i,0,!0),this._hasListener("columnRemoved")){let t={};for(let o=e;--o>=i;){let e=n[o-i];t.colIndex=o,t.columnData=e?e.columnData:null,this._dispatchColumnEvent("columnRemoved",t)}}},ke.prototype._onSectionDataChanged=function(t){if(this._dispatchingDataChanged)return;let e=this._layoutX.getLaneCount();if(this._dispatchingDataChanged=!!e,!e)return;let i,n,o=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),n=l.getMultipleRowData(i,o,r),t.dataRows=n);let u="content"===t.sectionType;u&&this._dispatch("beforeContentBinding",t),this._dispatch("preSectionDataBinding",t);let h=this.getDataColumnMap();for(let l=0;l<e;++l)if(s.isColumnActive(l)&&(this.isColumnVisible(l)||this._isAlwaysRenderColumn(l))){let e=this.getColumnDataBindingHandler(l)||this._dataBindingHandler;if(e){let u=h[l];t.dataColumnName=u,t.colIndex=l;for(let h=o;h<r;++h){if(a){let e=n[h];t.rowData=e,t.rowId=i[h],t.dataValue=e?e[u]:null}t.rowIndex=h,t.cell=s.getCell(l,h,!1),e(t)}}}this._dispatch("postSectionDataBinding",t),this._dispatchRowExpansionBinding(t),u&&(this._firstRendered||(this._dispatch("firstRendered",t),this._firstRendered=!0),this._dispatch("afterContentBinding",t)),s._startBindingSession(!1),this._dispatchingDataChanged=!1},ke.prototype.resetInternalState=function(){this._firstRendered=!1},ke.prototype._updateScrollbar=function(t){return!!t&&(t.isEnabled()&&t.update(),t.isActive())},ke.prototype._onVScroll=function(t){this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop()),this._dispatchRowPositionChanged()},ke.prototype._onHScroll=function(t){let e=this._hscrollbar.getScrollLeft();this._colVirtualizer.setViewOffset(e),this._updateColumnBounds(),this._dispatchColumnPositionChanged()},ke.prototype._onVScrollEnabled=function(){this._updateScrollbarHeight(!0,!1),this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.activate(),this._vscrollbar.getAutoHide()||this._updateVScrollbar()},ke.prototype._onVScrollDisabled=function(){this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.deactivate()},ke.prototype._onRowInViewChanged=function(t){let e=t.firstIndex,i=t.lastIndex+1,n=this._settings.length,o=[0,0];for(let t=0;t<n;++t){let n=this._settings[t],r=n.getSection();r&&!r.getFrozenLayout()&&(r.activateRows(e,i,o),this.updateRowData(n,o[0],o[1]-1))}},ke.prototype._onColInViewChanged=function(t){if(!this.getColumnCount())return;let e=t.prevFirstIndex,i=t.prevLastIndex,n=t.firstIndex,o=t.lastIndex,r=e<n?e:n,s=i>o?i:o;this._activateColumns(n,o,r,s);let l=this.getSectionCount();for(let t=0;t<l;++t){let e=this._settings[t];this.updateRowData(e)}},ke.prototype._activateColumns=function(t,e,i,n){null==i&&(i=0),null==n&&(n=this.getColumnCount()-1);let o=this._getColActivationList(t,e,i,n);for(let t=this.getSectionCount();--t>=0;){this._settings[t].activateColumns(o,i,n)}},ke.prototype._getColActivationList=function(t,e,i,n){null==i&&(i=0);let o=this.getColumnCount();null==n&&(n=o-1),null==t&&(t=this._colVirtualizer.getFirstIndexInView()),null==e&&(e=this._colVirtualizer.getLastIndexInView());let r=this.getHScrollStartIndex(),s=this.getFirstPinnedRightIndex(),l=new Array(n+1);for(let o=i;o<=n;++o)l[o]=o<r||o>=t&&o<=e||o>=s;return l},ke.prototype._getColumnDef=function(t){if(t>=0){let e=this._columnDefs[t];return e||(e=this._columnDefs[t]={id:""+ke._runningColumnId++,columnData:{}}),e}return{columnData:{}}},ke.prototype._getNestedColumnDef=function(t,e,i){let n=this._getColumnDef(t);if(e){let t=n;n=t[e],n||(n=t[e]={}),i&&(t=n,n=t[i],n||(n=t[i]={}))}return n},ke.prototype.getColumnId=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).id||""},ke.prototype._getColumnId=ke.prototype.getColumnId,ke.prototype.getColumnIds=function(){let t=this.getColumnCount(),e=new Array(t);for(let i=0;i<t;++i)e[i]=this._getColumnDef(i).id||"";return e},ke.prototype.setColumnField=function(t,e){this._getColumnDef(t).field=e||""},ke.prototype.getColumnField=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).field||""},ke.prototype.getColumnFields=function(){let t=this.getColumnCount(),e=new Array(t);for(let i=0;i<t;++i)e[i]=this._getColumnDef(i).field||"";return e},ke.prototype.getColumnIndex=function(t){if("number"==typeof t)return t;if(t){let e=t,i=this.getColumnCount();for(let t=0;t<i;++t){let i=this._getColumnDef(t);if(e===i.id||e===i.field)return t}}return-1},ke.prototype.getColumnIndices=function(t){let e=[],i=this.getColumnCount(),n=Array.isArray(t)?t:[t],o=n.length;for(let t=0;t<o;++t){let o=this.getColumnIndex(n[t]);o>=0&&o<i&&e.push(o)}return e},ke.prototype.getColumnIndexMap=function(){let t=this.getColumnCount(),e={},i="";for(let n=0;n<t;++n){let t=this._getColumnDef(n);i=t.field,i&&(e[i]=n),i=t.id,i&&(e[i]=n)}return e},ke.prototype._onWindowResize=function(){this._updateLayout(),this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop())},ke.prototype._onMouseMove=function(){this._vscrollbar.flash(),this._hscrollbar.flash()},ke.prototype._onGridClicked=function(){if(window.getSelection().toString())return;let t=document.activeElement;this._element.contains(t)||this.focus()},ke.prototype._onRowHightlighted=function(t){if(!this._hasListener("rowHighlighted"))return;let e=t.sender,i=this.getSectionSettings(e.getId());if(null==i)return;i.extendEventArg(t);let n=i.getDataSource();null!==n&&(t.rowId=n.getRowId(t.rowIndex),t.dataRow=n.getRowData(t.rowId)),this._dispatch("rowHighlighted",t)},ke.prototype._onRowCountChanged=function(t){if(this._disposed)return;let e=t.sender,i=t.prevCount,n=t.rowCount,o=e.getIndex(),r=this._updateSectionIndices(o),s=0;if(i>n)this._layoutY.removeLaneAt(r,i-n),this._layoutY.isHomogeneous()||this._syncSectionRowHeights(e);else{let t=this._layoutY.getDefaultLaneSize(),o=e.getDefaultRowHeight();if(this._layoutY.insertLane(r+i,n-i),o!==t)for(s=i;s<n;++s)this._layoutY.setLaneSize(r+s,o)}let l=t.noBinding,a=o<=this._startVScrollbarIndex||o>=this._getFooterStartIndex(),u=this._frozenFooterCount>0,h=this._updateScrollbarHeight(a,u,l);l&&(this._hasPendingRowChange=!0),this._frozenLayout||h||(this._rowVirtualizer.isVirtualizable()?e.activateRows(this._rowVirtualizer.getFirstIndexInView(),this._rowVirtualizer.getLastIndexInView()):e.activateRows()),this._hasPendingRowChange=!1,u||this._updateVScrollbar(),this._updateColumnSeparators(),i<n?this._dispatch("rowAdded",t):i>n&&this._dispatch("rowRemoved",t)},ke.prototype._onRowHeightChanged=function(t){if(!this._rowHeightSync)return;if(this._disposed)return;if(this._rowHeightConflator.conflate(t))return;let e=this._rowHeightConflator.popAllData(),i=e.length,n=NaN;for(let t=0;t<i;++t){let i=e[t],o=i.section;if(!this._containsSection(o))continue;let r=o.getIndex(),s=i.rowIndex,l=this.getRowIndex(r,s),a=i.changeLength;for(let t=0;t<a;++t)this._layoutY.setLaneSize(l+t,o.getRowHeight(s+t))&&(r>=n||(n=r))}this._rowHeightConflator._needScrollbarUpdate?(this._rowHeightConflator._needScrollbarUpdate=!1,this._updateScrollbarHeight(!0,!0)):n>=0&&(this._dispatchingDataChanged?this._rowHeightTimerId||(this._rowHeightTimerId=setTimeout(this._requestScrollbarUpdate,0)):this._updateScrollbarHeight(n<this._startVScrollbarIndex,n>=this._startVScrollbarIndex)),this._updateColumnSeparators(),this._dispatchRowPositionChanged()},ke.prototype._containsSection=function(t){for(let e=this._settings.length;--e>=0;)if(this._settings[e].getSection()===t)return!0;return!1},ke.prototype._onRowAvailable=function(t){if(this._hasPendingRowChange)return;let e=t.sectionIndex;this._dispatchColumnRenderEvent(t,0,this.getColumnCount(),e,e+1,t.prevRowIndex,t.rowIndex)},ke.prototype._onSectionCountChanged=function(t){if(!this._frozenLayout){if(this._tempFrozenSectionRef){let t=this.getNextSection(this._tempFrozenSectionRef);null!==t&&(this._startVScrollbarIndex=t.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()}},ke.prototype._onColumnCountChanged=function(){if(this._frozenLayout||this._disposed)return;let 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()},ke.prototype._onSyncVScroll=function(t){this._vscrollbar.setScrollTop(t.scrollTop)},ke.prototype._onSyncHScroll=function(t){this._hscrollbar.setScrollLeft(t.scrollLeft)},ke.prototype._getFooterStartIndex=function(){return this.getSectionCount()-this._frozenFooterCount},ke.prototype._getVScrollStart=function(){return this._getSectionSize(0,this._startVScrollbarIndex)},ke.prototype._getFooterSize=function(){return this._frozenFooterCount>0?this._getSectionSize(this._getFooterStartIndex()):0},ke.prototype._getSectionSize=function(t,e){if(t){if(t<0)return 0}else t=0;null==e&&(e=this.getSectionCount()-t);let i=this._layoutY.getLaneStart(this._sectionStarts[t]),n=t+e;return(e>0?this._layoutY.getLaneStart(this._sectionStarts[n]):0)-i},ke.prototype._updateScrollbarHeight=function(t,e,i){if(!this._vscrollbar.isEnabled())return!1;let n=e,o=t&&this._startVScrollbarIndex>=0,r=this._rowHeightConflator.isConflating();if(r&&(this._rowHeightConflator._needScrollbarUpdate=!0,n=!1),o&&!r){let t=this.getElement();if(!t)return!1;let e=this.getParent(),i=this._vscrollbar.getParent();i?i!==e&&i.firstElementChild&&(i=i.firstElementChild):(i=t,this._vscrollbar.setParent(i));let n=this._getVScrollStart(),o=this._getFooterSize();i!==t&&(n+=t.clientTop),this._vscrollbar.resetPaneSize();let r=i.clientHeight-(n+o)*this._zoomFactor;this._vscrollbar.setTop(n*this._zoomFactor),this._vscrollbar.setTrackSize(r,r/this._zoomFactor);let s=this._layoutY.getDefaultLaneSize(),l=12*s;r>l&&(l=(Math.ceil(r/s)+4)*s),this._rowVirtualizer.setViewSize(l/this._zoomFactor);let a=this._sectionStarts[this._startVScrollbarIndex],u=this.getFooterCount(),h=0;if(u){let t=this.getSectionCount();h=this._sectionStarts[t]-this._sectionStarts[t-u]}this._rowVirtualizer.setViewBounds(a,h)}else this._rowVirtualizer.validateVirtualization();let s=!1;return i||(s=this._rowVirtualizer.update()),this._vscrollbar.invalidate(n),s},ke.prototype._updateScrollbarWidth=function(t,e){if(!this._frozenLayout){if(t&&this._hScrollbarEnabled){let t=this.getElement(),e=this._hscrollbar.getParent();e||(e=this.getParent()||t,this._hscrollbar.setParent(e));let i=this._layoutX.getLaneStart(this._pinnedLeftColumnCount),n=this._layoutX.getLaneCount(),o=0,r=this._countPinnedRightColumns();r&&(o=this._layoutX.getLaneStart(n)-this._layoutX.getLaneStart(n-r));let s=e!==t?t.clientLeft:0,l=e.clientWidth-(i+s+o)*this._zoomFactor;r>0&&(l-=this._reservedSpace),this._hscrollbar.setPaneLeft(i),this._hscrollbar.setLeft((i+s)*this._zoomFactor),this._hscrollbar.setTrackSize(l,l/this._zoomFactor);let a=4*this._layoutX.getDefaultLaneSize();l>a&&(a=l),this._colVirtualizer.setViewSize(a/this._zoomFactor),this._colVirtualizer.setViewBounds(this._pinnedLeftColumnCount,r)}else this._colVirtualizer.validateVirtualization();this._colVirtualizer.update(),this._hscrollbar.invalidate(e)}},ke.prototype._hitTestY=function(t,e){let i;if(e.sectionSettings)i=e.sectionSettings;else{let n;n="number"==e.rowIndex?e.rowIndex:this._layoutY.hitTest(t);let o=n>=0?n:~n,r=nt.upperBound(this._sectionStarts,o)-1;if(e.sectionIndex=r,i=this._settings[r],!i)return!1;i.extendEventArg(e)}let n=i.getSection();return null!=e.colIndex&&e.cellElement?e.rowIndex=n.getCellIndex(e.colIndex,e.cellElement):e.rowIndex=rowIndex+n.getRowOffset(),!0},ke.prototype._syncLayoutToColumns=function(t,e,i){if(this._frozenLayout)return;let n=this._layoutX.getLaneCount(),o=this.fillParentWidth(100);(o||null==t||null==e)&&(t=0,e=n,o=!0);let r=this._settings.length;if(r<=0)return;let s=!1;if(t<e)for(let i=0;i<r;++i)s=this._syncLayoutToSectionColumns(this._settings[i].getSection(),t,e)||s;let l=o||t<this.getHScrollStartIndex()||e>this.getFirstPinnedRightIndex();this._updateScrollbarWidth(l,!0),this._updateColumnBounds(),this._updateColumnSeparators(),this._dispatchColumnPositionChanged(),(s||i)&&this._dispatch("widthChanged",{from:t,to:e,colChanged:t})},ke.prototype._syncLayoutToSectionColumns=function(t,e,i){null==e&&(e=0),null==i&&(i=this._layoutX.getLaneCount());let n=0;for(let o=e;o<i;++o)n|=t._setColumnWidth(o,this._layoutX.getLaneSize(o));return!(!n||this._frozenLayout)&&(t._updateColumnLayout(),!0)},ke.prototype._toDataColumnName=function(t){return nt.isNumber(t)?this.getDataColumnName(t):t},ke.prototype._updateSectionIndices=function(t){this._updatePaddingBottomSect()&&--t,t<0&&(t=0);let 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"));let n=this._settings[e-1]||null;n!==this._lastSettings&&(this._lastSettings&&this._lastSettings.getSection().removeClass("last"),this._lastSettings=n,this._lastSettings&&this._lastSettings.getSection().addClass("last")),this._sectionStarts.length=e+1,this._sectionStarts[0]=0;for(let i=t;i<e;++i){let t=this._settings[i].getSection();t.setIndex(i),t.setRowOffset(this._sectionStarts[i]),this._sectionStarts[i+1]=this._sectionStarts[i]+t.getRowCount()}return this._sectionStarts[t]},ke.prototype._updateLayout=function(){let t=this.getElement();if(this._disposed||!t.offsetParent)return;this._syncLayoutToColumns(),this._updateScrollbarHeight(!0,!0),this._updateScrollbarWidth(!0,!0);let e=this.getSectionCount();for(let t=0;t<e;++t){this._settings[t].getSection().updateLayout()}this._updateColumnSeparators()},ke.prototype._updateVScrollbar=function(){!this._disposed&&this._vscrollbar.isEnabled()&&(this._vScrollbarConflator.conflate()||this._vscrollbar.update())},ke._proto=ke.prototype;let Oe={chainIcon:""};Oe.styles=function(t){if(t){let e="";if(Array.isArray(t)){e=t.map(w).join("\n").replace(/{\s*{/g,"{").replace(/\s+{/g," {")}else e="string"==typeof t?t:t+"";if(e)return e.replace(/{[\w\W]*?}/g,b)}return""}([".tr-grid .chain-icon",["cursor: pointer;"],".tr-grid .chain-icon .fallback-arrow",["vertical-align: middle;","font-size: 7px;","line-height: 1;","display: inline-block;","transform: scaleX(1.5);","font-family: Arial;"],".tr-grid .closed .chain-icon",["transform: translate(0px, -1px) rotate(-90deg);"]]),Oe.applyStyle=function(t){t&&!t._rowGroupingStyles&&(t._rowGroupingStyles=!0,R(Oe.styles,t.getElement()))};var Ne=Oe;let He=function(){this._counter={},this._session={},this._referers={}};He.prototype._counter=null,He.prototype._session=null,He.prototype._referers=null,He.prototype.reset=function(){this._counter={},this._referers={},this.newSession()},He.prototype.newSession=function(){this._session={}},He.prototype.getAllReferences=function(){return Object.keys(this._counter)},He.prototype.getAllReferers=function(){return Object.keys(this._referers)},He.prototype.getAllReferrers=He.prototype.getAllReferers,He.prototype.getSession=function(){let t=[],e=[];for(let i in this._session){let n=this._session[i];n>0?t.push(i):n<0&&e.push(i)}return{newEntries:t.filter(Boolean),removedEntries:e.filter(Boolean)}},He.prototype.addReference=function(t,e){if(t){if(e){let i=this._referers[e];if(i){if(i[t])return!1}else i=this._referers[e]={};i[t]=1}if(!this._counter[t])return this._counter[t]=1,-1===this._session[t]?this._session[t]=0:this._session[t]=1,!0;++this._counter[t]}return!1},He.prototype.addRef=He.prototype.addReference,He.prototype.removeReference=function(t,e,i){if(!t)return!1;let n=this._counter[t];if(!n)return!1;if(null==i)i=1;else if(i<0)i=n;else if(!i)return!1;if(e){let i=this._referers[e];if(!i)return!1;if(!i[t])return!1;delete i[t]}return n-=i,!n||n<0?(delete this._counter[t],1===this._session[t]?this._session[t]=0:this._session[t]=-1,!0):(this._counter[t]=n,!1)},He.prototype.release=He.prototype.removeReference,He.prototype.addReferences=function(t,e){if(!t)return 0;let i=0;if(Array.isArray(t)){let n=t.length;for(let o=0;o<n;++o)this.addReference(t[o],e)&&++i}else if("string"==typeof t)this.addReference(t,e)&&++i;else for(let n in t)this.addReference(n,e)&&++i;return i},He.prototype.removeReferer=function(t){let e=0;if(t){let i=this._referers[t];if(i){for(let n in i)this.removeReference(n,t)&&++e;delete this._referers[t]}}return e},He.prototype.removeReferrer=He.prototype.removeReferer,He.prototype.log=function(){console.log(this._counter)};var Be=He;let Ge=function(){let t=this;t._commitRicsChanges=t._commitRicsChanges.bind(this),t._commitFieldsChanges=t._commitFieldsChanges.bind(this),t._fieldChangedConflator=new r(0,t._commitFieldsChanges),t._ricChangedConflator=new r(0,t._commitRicsChanges),t._fields=new Be,t._rics=new Be,t._rowDefMap={}};s.inherits(Ge,a),Ge.prototype._fieldChangedConflator=null,Ge.prototype._ricChangedConflator=null,Ge.prototype._rowDefMap=null,Ge.prototype._rics=null,Ge.prototype._fields=null,Ge.prototype.getAllRics=function(){return this._rics.getAllReferences()},Ge.prototype.getAllRowDefs=function(){let t=[];for(let e in this._rowDefMap)t=t.concat(this._rowDefMap[e]);return t},Ge.prototype.getAllFields=function(){return this._fields.getAllReferences()},Ge.prototype.getRowDefByRic=function(t){return this._rowDefMap[t]||null},Ge.prototype.addRic=function(t){let e=t?t.getSymbol():"";if(!e)return!1;let i=this._rowDefMap,n=i[e];n?n.indexOf(t)<0&&n.push(t):n=i[e]=[t];let o=this._rics.addReference(e,t.getRowId());return this._commitRicsChanges(),o},Ge.prototype.removeRic=function(t,e){if(e||(e=t?t.getSymbol():""),!e)return;let i=this._rowDefMap[e];if(i){let e=i.indexOf(t);e>=0&&i.splice(e,1)}this._rics.removeReference(e,t.getRowId()),this._commitRicsChanges()},Ge.prototype.removeAllRics=function(){let t=this._rics.getAllReferers();for(let e in t)this._rics.removeReferer(t[e]);this._rowDefMap={},this._commitRicsChanges()},Ge.prototype._commitRicsChanges=function(){if(this._ricChangedConflator.conflate())return;let t=this._rics,e=t.getSession(),i=e.removedEntries,n=e.newEntries;i.length&&this._doDispatch({type:"ricRemoved",removedRics:i}),n.length&&this._doDispatch({type:"ricAdded",addedRics:n}),t.newSession()},Ge.prototype.addFields=function(t,e){if(!t)return;let i=this._fields;t instanceof Vt?i.addReferences(t.getAllFields(),t.getId()):i.addReferences(t,e),this._commitFieldsChanges()},Ge.prototype.removeFields=function(t,e){t&&(t instanceof Vt?this._fields.removeReferer(t.getId()):this._fields.removeReference(t,e),this._commitFieldsChanges())},Ge.prototype.removeFieldReferrer=function(t){this._fields.removeReferer(t),this._commitFieldsChanges()},Ge.prototype.removeAllFields=function(){let t=this._fields.getAllReferers();for(let e in t)this._fields.removeReferer(t[e]);this._commitFieldsChanges()},Ge.prototype._commitFieldsChanges=function(){if(this._fieldChangedConflator.conflate())return;let t=this._fields,e=t.getSession(),i=e.removedEntries,n=e.newEntries;i.length&&this._doDispatch({type:"fieldRemoved",removedFields:i}),n.length&&this._doDispatch({type:"fieldAdded",addedFields:n}),t.newSession()},Ge.prototype._doDispatch=function(t){let e=this;t.fields=e.getAllFields(),t.rics=e.getAllRics(),t.rowDefs=e.getAllRowDefs(),e._dispatch(t.type,t)},Ge.prototype.reset=function(){let t=this;t._rowDefMap={},t._fields.reset(),t._rics.reset(),t._fieldChangedConflator.reset(),t._ricChangedConflator.reset()};var We=Ge;let Ue=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},Ye=function(){this._defaultSorter=this._defaultSorter.bind(this),this._dataSorter=this._dataSorter.bind(this),this._rowDefSorter=this._rowDefSorter.bind(this),this._multiColumnsSorter=this._multiColumnsSorter.bind(this),this._globalContext={},this._sortParams=[],this._ctxCaches=[]};Ye.prototype._globalContext,Ye.prototype._sortParams,Ye.prototype._ctxCaches,Ye.prototype._primaryParams,Ye.prototype.dispose=function(){this._globalContext={},this._sortParams.length=0,this._ctxCaches.length=0,this._primaryParams=null},Ye.prototype.getSorter=function(){this._primaryParams=null;let t=this._sortParams.length;if(1===t){let t=this._primaryParams=this._sortParams[0];if(t[1]){return t[3]?this._rowDefSorter:this._dataSorter}return this._defaultSorter}return t>1?this._multiColumnsSorter:Ye._noSorting},Ye.prototype.reset=function(){this._sortParams.length&&(this._sortParams.length=0)},Ye.prototype.setContext=function(t,e){this._globalContext[t]=e},Ye.prototype.addColumnContext=function(t,e,i,n,o,r){t||(t="");let s=this._sortParams.length,l=this._ctxCaches[s];l||(l=this._ctxCaches[s]=g(this._globalContext));let a=0;"a"===n?a=1:"d"===n&&(a=-1);let u=[t,"function"==typeof e?e:null,l,i,a];l.colIndex=o,l.field=t,l.formattedField=t+"_FORMATTED",l.colDef=r,this._sortParams.push(u)},Ye._noSorting=function(t,e,i){return 0},Ye.prototype._defaultSorter=function(t,e,i){let n=this._primaryParams[0];return Ue(t.getData(n),e.getData(n),i)},Ye.prototype._dataSorter=function(t,e,i){let n=this._primaryParams,o=n[0];return(0,n[1])(t.getData(o),e.getData(o),i,n[2])},Ye.prototype._rowDefSorter=function(t,e,i){let n=this._primaryParams;return(0,n[1])(t,e,i,n[2])},Ye.prototype._multiColumnsSorter=function(t,e,i){let n=this._sortParams,o=n.length;for(let i=0;i<o;++i){let o=n[i],r=o[0],s=o[1],l=o[2],a=o[3],u=o[4],h=0;if(h=s?a?s(t,e,u,l):s(t.getData(r),e.getData(r),u,l):Ue(t.getData(r),e.getData(r),u),h)return h}return 0};var qe=Ye;let Xe=function(t){let 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})};l.inherits(Xe,lt),Xe.prototype._hosts=null,Xe.prototype._sortStates,Xe.prototype._maxCount=1,Xe.prototype._dataSorting=!0,Xe.prototype._dblClickAllowed=!1,Xe.prototype._clickTimer=0,Xe.prototype._delayInterval=0,Xe.prototype._lastMouseDown=0,Xe.prototype._initialSort=null,Xe.prototype._mode="",Xe.prototype._sortableColumns=!0,Xe.prototype._sortableIndicator=!1,Xe.prototype._solarTheme=!1,Xe.prototype._sortLogic,Xe.prototype._userManagedLogic=!1,Xe.prototype._disabled=!1,Xe.prototype._frozenIndicator=!1,Xe.prototype._rowDefMode=!1,Xe._icons={},Xe.prototype._sortingSequence,Xe.prototype._sortingSequenceMap=null;Xe.prototype.getName=function(){return"SortableTitlePlugin"},Xe.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))},Xe.prototype.unload=function(t){let 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))},Xe.prototype.afterInit=function(){let t=this;t.setSortLogics(t._sortLogic);let e=t._initialSort;null!=e&&(Array.isArray(e)?1===t._maxCount?t.sortColumns(e.slice(0,1)):t.sortColumns(e):t.sortColumns([e]))},Xe.prototype.config=function(t){if(!t)return;let e=this,i=t.icons;null!=i&&i.sorting&&(Xe._icons=i.sorting);let n=t.themeName;!n||n.indexOf("solar")>=0?e._solarTheme=!0:e._solarTheme=!1,e._initialSort=e._initialSortByColumnField(t);let o=t.sorting;if(!o)return;o.ROW_DEF&&(this._rowDefMode=!0),o.userManagedLogic&&(e._userManagedLogic=!0);let r=o.multiColumn||o.multicolumn;if(null!=r&&(!0===r&&(r=-1),!1===r&&(r=1),e.setSortableColumnCount("number"==typeof r&&r>0?r:-1)),r=o.sortableIndicator,null!=r&&(e._sortableIndicator=r),r=o.disabled,null!=r&&(e._disabled=!!r),r=o.threeStatesSorting,null!=r&&e.disableTwoStateSorting(r),r=o.sortingSequence,null!=r&&Array.isArray(r)&&(e._sortingSequence=r),r=o.mode,null!=r&&(e._mode=r,"manual"===r&&e.disableDataSorting()),r=o.indicatorOnly,null!=r&&e.disableDataSorting(r),r=o.disableDoubleClickToSort,null!=r&&e.disableDoubleClickToSort(r),r=o.columnSorted,"function"==typeof r&&e.listen("columnSorted",r),r=o.preClicked,"function"==typeof r&&e.listen("preClicked",r),r=o.clicked,"function"==typeof r&&e.listen("clicked",r),r=o.preDataSorting,"function"==typeof r&&e.listen("preDataSorting",r),r=o.sortableColumns,null!=r&&(e._sortableColumns=r),r=o.initialSort,"object"==typeof r&&(e._initialSort=r),r=o.sortLogic,"object"==typeof r)for(let t in r)"function"==typeof r[t]&&(e._sortLogic[t]=r[t])},Xe.prototype.getConfigObject=function(t){let e=t||{},i=e.columns;i||(i=e.columns=[]);let n=this._hosts[0];if(!n)return e;let o,r,s,l,a,u=this.getSortedColumns();if(1===this._maxCount&&null!=u)for(s=u.length,r=0;r<s;r++){let t=u[r],e=t.colIndex;o=i[e],o||(o=i[e]={}),o.sortOrder=t.sortOrder}for(s=n.getColumnCount(),r=0;r<s;++r)o=i[r],o||(o=i[r]={}),l=this._getSortOptions(r),l&&(this._sortableColumns?l.disabled&&(o.sortable=!1):l.disabled||(o.sortable=!0),a=l.field,a&&(null!=o.field&&o.field!==a&&(o.sortBy=a),this._sortingSequenceMap&&this._sortingSequenceMap[a]&&(o.sortingSequence=this._sortingSequenceMap[a])));let h=e.sorting;h||(h=e.sorting={});let p=u;null!=p&&(h.initialSort=p),p=this._sortableIndicator,!1!==p&&(h.sortableIndicator=p),1!==this._maxCount&&(h.multiColumn=-1===this._maxCount||this._maxCount),this._dblClickAllowed&&(h.disableDoubleClickToSort=!this._dblClickAllowed),p=this._sortableColumns,!0!==p&&(h.sortableColumns=p),p=this._dataSorting,!0!==p&&(h.indicatorOnly=p),this._disabled&&(h.disabled=!0);let d=this._sortingSequence,c=!0;return 2===d.length&&"a"===d[0]&&"d"===d[1]&&(c=!1),c&&(h.sortingSequence=d.slice()),y(e.sorting)&&delete e.sorting,e},Xe.prototype.getColumnMenu=function(t,e){e||(e={});let i=e.menus;i||(i=e.menus=[]);let n=i[0];n||(n=i[0]={menuItems:[]});let o=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"===o,click:this._onItemSortingClicked},{indexScore:2,label:"Descending",radioMode:!0,value:{colIndex:t,order:"d"},selected:"d"===o,click:this._onItemSortingClicked},{indexScore:1,label:"Un-Sort",radioMode:!0,value:{colIndex:t,order:"n"},selected:"n"===o,click:this._onItemSortingClicked}]}};return n.menuItems.push(r),e},Xe.prototype._onItemSortingClicked=function(t){this._hosts[0].getPlugin("ColumnMenuPlugin").hide();let e=t.currentTarget.value,i=e.colIndex,n=e.sortOrder;this.sortColumn(i,n)},Xe.prototype.getIcons=function(){return Xe._icons},Xe.prototype.setSortLogics=function(t){if(null!=t){let e=this._hosts[0];if(e){let i=e.getDataSource();for(let e in t)this._setSortLogic(i,e,t[e])}}},Xe.prototype.setSortLogic=function(t,e){if("string"==typeof t){let i=this._hosts[0];if(i){let n=i.getDataSource();this._setSortLogic(n,t,e)}}},Xe.prototype._setSortLogic=function(t,e,i){t&&"string"==typeof e&&("*"===e?t.setSortingLogic(i):t.setColumnSortingLogic(e,i))},Xe.prototype.getSortOrder=function(t){let e=null!=t?this.getSortPriority(t):0,i=this._sortStates[e];return(i?i.sortOrder:"")||"n"},Xe.prototype.getSortedColumnIndex=function(t){return this._getColumnIndex(this._sortStates[t||0])},Xe.prototype.getSortPriority=function(t,e){let i=this._hosts[0];if(i){let n,o=this._sortStates.length;if(t>=0){let e=i.getColumnId(t);if(e)for(n=0;n<o;++n)if(this._sortStates[n].colId===e)return n}else if(e)for(n=0;n<o;++n){let t=this._sortStates[n];if(t.colId===e)return n;if(t.field===e)return n}}return-1},Xe.prototype.isColumnSorted=function(t){return this.getSortPriority(t)>=0},Xe.prototype.getSortedColumns=function(){let t=this._sortStates.length;if(t<=0)return null;let e=new Array(t);for(let i=0;i<t;++i){let t=this.getSortedColumnIndex(i),n=this._sortStates[i],o={},r="";t>=0&&(o.colIndex=t,r=this._getColumnId(t)),r&&(o.colId=r);let s=n.field||"";s&&(o.field=s),o.sortOrder=n.sortOrder||"n",e[i]=o}return e},Xe.prototype.isSorting=function(){return!!this._sortStates.length},Xe.prototype.sortColumn=function(t,e,i){this._sortColumn(this._prepareSorting(t,e),i)},Xe.prototype.sortColumns=function(t,e){if(Array.isArray(t)){let i=t.length,n=new Array(i);for(let e=0;e<i;e++)n[e]=this._prepareSorting(t[e]);this._sortColumn(n,e)}},Xe.prototype.clearSortState=function(t){this._popSortState(0,t)&&this.updateSortSymbols()},Xe.prototype.refresh=function(){this._sortStates.length&&(this._sortDataView(),this.updateSortSymbols())},Xe.prototype.restoreUserActions=Xe.prototype.refresh,Xe.prototype.setSortableColumnCount=function(t){this._maxCount=t||1,this._popSortState(this._maxCount)},Xe.prototype.getSortingStates=function(){return this._sortStates},Xe.prototype.updateSortSymbols=function(){if(!this._disabled)for(let t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},Xe.prototype.getDataColumnMap=function(){let t=this._hosts[0],e=[];if(t){let i=t.getColumnCount();for(let t=0;t<i;++t)e[t]=this.getColumnSortingField(t)}return e},Xe.prototype.getDataColumnNames=Xe.prototype.getDataColumnMap,Xe.prototype.setDataColumnMap=function(t){if(Array.isArray(t))for(let e=t.length;--e>=0;)this.setColumnSortingField(e,t[e])},Xe.prototype.setDataColumnNames=Xe.prototype.setDataColumnMap,Xe.prototype.getColumnSortingField=function(t){let e=this._getSortOptions(t),i=e?e.field:null;if(null==i&&!this._rowDefMode){let n=this._hosts[0];n&&(i=n.getColumnField(t),i||(i=n.getDataColumnName(t)),i&&e&&(e.field=i))}return i||""},Xe.prototype.setColumnSortingField=function(t,e,i,n){if("number"==typeof t&&null!=e){let o=this._newSortOptions(t);e||(e=""),o.field!==e&&(o.field=e),null==i||this._userManagedLogic||o.sortLogic!==i&&(o.sortLogic=i||null,n&&i&&(i.rowSorting=!0))}};let je=function(t){return t.field||""};Xe.prototype.getColumnSortingFields=function(){return this._sortStates.map(je)},Xe.prototype.setFirstSortOrder=function(t,e){"a"!==(e=e?Xe._toSortOrder(e):"a")&&"d"!==e&&(e="a");let i=null;i=Array.isArray(t)?t:[t];let n=i.length;for(let t=0;t<n;++t){let n=i[t],o=this.getSortingSequence(n).slice(),r=o.indexOf(e);r>=0&&o.splice(r,1),o.unshift(e),this.setSortingSequence(o,n)}},Xe.prototype.disableTwoStateSorting=function(t){let e=this._sortingSequence.indexOf("n");!1===t?e>=0&&this._sortingSequence.splice(e,1):e<0&&this._sortingSequence.push("n")},Xe.prototype.freezeIndicator=function(t){let e=this._frozenIndicator;if(this._frozenIndicator=!1!==t,e&&!this._frozenIndicator)for(let t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},Xe.prototype.disableSortSymbols=function(t){},Xe.prototype.disableDataSorting=function(t){this._dataSorting=!1===t},Xe.prototype.disableDoubleClickToSort=function(t){this._dblClickAllowed=!t},Xe.prototype.disableCellClick=function(t,e){t&&t.enableClass("no-sort",!1!==e)},Xe.prototype.disableColumnSorting=function(t,e){if(e=!1!==e,"number"==typeof t)this._disableColumnSorting(t,e);else if(Array.isArray(t)){let i=t.length;for(let n=0;n<i;++n)this._disableColumnSorting(t[n]||0,e)}},Xe.prototype._disableColumnSorting=function(t,e){let i=this._newSortOptions(t);i.disabled!==e&&(i.disabled=e)},Xe.prototype.setClickDelayInterval=function(t){this._delayInterval=null!=t?t:500},Xe.prototype._initialSortByColumnField=function(t){let e=t.columns,i=e?e.length:0;for(let t=0;t<i;t++){let i=e[t].defaultSort;if(i)return{colIndex:t,sortOrder:i}}return null},Xe.prototype._onSectionAdded=function(t){if("title"!==t.sectionType)return;let e=t.section;0===e.getIndex()&&(e.listen("mousedown",this._onMouseDown),e.listen("click",this._onClickTitle.bind(this,t.sender),0))},Xe.prototype._onUIUpdated=function(t){"title"===t.sectionType&&this.updateSortSymbols()},Xe.prototype._canClickToSort=function(t){if(this._disabled)return!1;let e=t.grid;if(!e||!e.getElement())return!1;let i=this._getPlugin("CellEditingPlugin");if(i&&i.isEditing())return!1;if(this._dispatch("preClicked",t),t.cancel)return!1;let n=t.colIndex,o=t.section,r=t.rowIndex;return!!this._isCellSortable(o,n,r)},Xe.prototype._proceedSorting=function(t){if(this._clickTimer=0,this._canClickToSort(t)){let e=t.colIndex;this.sortColumn(e,null,{isUserAction:!0});let i=t.grid;if(i&&i.focus&&i.focus(),this._hasListener("clicked")){let t={};t.colIndex=e,t.sortOrder=this.getSortOrder(e),t.dataColumnName=this.getColumnSortingField(e),this._dispatch("clicked",t)}}},Xe.prototype._onMouseDown=function(t){t.button||(this._lastMouseDown=t.timeStamp)},Xe.prototype._getPlugin=function(t){let e=this._hosts[0];return e?e.getPlugin(t):null},Xe.prototype.clickTitleByMouse=function(t,e){this._onClickTitle(t,e)},Xe.prototype._onClickTitle=function(t,e){if(this._disabled)return;if(2===e.detail&&!this._dblClickAllowed)return void(this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0));if(e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)return;if(!(e.timeStamp-this._lastMouseDown<500))return;let i=t.getRelativePosition(e);if(!i.hit)return;let n=this._getPlugin("ColumnSelectionPlugin");if(n&&n.isEnabled()){let t=i.colIndex;if(!n.isSelectedColumn(t))return}i.target=e.target,this._delayInterval>0?this._clickTimer||(this._clickTimer=setTimeout(this._proceedSorting.bind(this,i),this._delayInterval)):this._proceedSorting(i)},Xe.prototype._popSortState=function(t,e){if(t<0||this._sortStates.length<=t)return!1;let i=!1;for(let e=this._sortStates.length;--e>=t;)this._clearSortSymbols(this._sortStates[e]),i=!0;return this._sortStates.length=t,this._sortDataView(e),i},Xe._toSortOrder=function(t){return!t||"string"!=typeof t||"d"!==(t=t.charAt(0).toLowerCase())&&"a"!==t?"n":t},Xe.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},Xe.prototype.setSortingSequence=function(t,e){if(Array.isArray(t))t.length||(t=null);else if(t)return;let i;if(null!=e&&("string"==typeof e?i=e:"number"==typeof e&&(i=this.getColumnSortingField(e))),t){let e=t.map(Xe._toSortOrder);i?(this._sortingSequenceMap||(this._sortingSequenceMap={}),this._sortingSequenceMap[i]=e):this._sortingSequence=e}else i?this._sortingSequenceMap&&delete this._sortingSequenceMap[i]:this._sortingSequence=this._sortingSequence.length>2?["a","d","n"]:["a","d"]},Xe.prototype.clearAllColumnSortingSequences=function(){this._sortingSequenceMap=null},Xe.prototype.sortSeparators=function(t){let e=this._hosts[0].getDataSource();if(t)e.sortSeparators(t);else{let t=e.getSortingLogics(),i=[],n=[],o=this._sortStates.length,r=Xe._toRowDefField();for(let t=0;t<o;t++){let e=this._sortStates[t],o=this._rowDefMode?r:e.field;i.push(e.sortOrder),n.push(o)}e.sortSeparators(t,i,n)}},Xe.prototype._prepareSorting=function(t,e){if(!this._maxCount)return null;let i=this._hosts[0];if(!i)return null;let n=-1,o="";"number"==typeof t?n=t:"string"==typeof t?(o=t,n=this._getColumnIndex(o)):t&&"object"==typeof t&&(o=t.colId||t.field,o?n=this._getColumnIndex(o):"number"==typeof t.colIndex&&(n=t.colIndex),e||(e=t.sortOrder||t.order||null));let r="",s=null;if(n>=0){r=this.getColumnSortingField(n);let t=this._getSortOptions(n);t&&(s=t.sortLogic)}else o&&(r=o);let l=this.getSortPriority(n,r),a=l>=0?this._sortStates[l]:null,u=a?a.sortOrder:"n",h="n";if(null==e){let t=this.getSortingSequence(r),e=t.indexOf(u);e=e<0?0:(e+1)%t.length,h=t[e]}else h=Xe._toSortOrder(e);if(a){if(u===h)return this.updateSortSymbols(),null;this._sortStates.splice(l,1),this._clearSortSymbols(a)}if("a"===h||"d"===h){if(n<0&&!r)return null;if(!a){a={};let t=i.getColumnId(n);t&&(a.colId=t)}a.field=r,a.sortLogic=s||null,this._sortStates.push(a)}a&&("n"!==u?a.prevOrder=u:delete a.prevOrder,a.order=h,a.sortOrder=h);let p=[];if(this._maxCount>0)for(;this._sortStates.length>this._maxCount;){let t=this._clearSortSymbols(this._sortStates.shift());null!==t&&p.push(t)}return{colIndex:n,sortedField:r,sortOrder:h||"n",prevOrder:u,clearedSortColIndexes:p}},Xe.prototype._sortColumn=function(t,e){if(!t)return;this._sortDataView(e),this.updateSortSymbols();let i=null;if(Array.isArray(t)){let e=t.length;for(let n=0;n<e;++n){let e=t[n];e&&(i?(i.colIndices||(i.colIndices=[],i.sortedFields=[],i.sortOrders=[],i.prevOrders=[]),i.colIndices.push(e.colIndex),i.sortedFields.push(e.sortedField),i.sortOrders.push(e.sortOrder),i.prevOrders.push(e.prevOrder)):i=e)}i=t[0]}else i=t;this._dispatch("columnSorted",i)},Xe.prototype._onColumnAdded=function(t){let e=this,i=t.colIndex,n=t.context||{},o=!!e._sortableColumns,r=n.field,s=n.sortBy;null!=s&&(o=!!s,r=s),null!=n.sortable&&(o=!!n.sortable);let l=n.sortLogic||n.sortingLogic||n.sorter;l||(l=e._sortLogic[r]),"function"!=typeof l&&(l=null);let a=n.sortingSequence;null!=a&&r&&e.setSortingSequence(a,r),o?e.setColumnSortingField(i,r,l,n.rowSorting):e.disableColumnSorting(i,!0);let u=n.sortOrder||n.sort;null!=u&&(u=Xe._toSortOrder(u),"n"!==u&&(e.clearSortState(),e.sortColumn(i,u)))},Xe.prototype._onColumnRemoved=function(t){let e=this._sortStates.length;if(!e)return;let i=t.colId;if(i)for(let t=0;t<e;++t){let e=this._sortStates[t];if(e.colId===i){this._sortStates.splice(t,1),this._clearSortSymbols(e),this._sortDataView();break}}},Xe._toRowDefField=function(t){return"ROW_DEF"},Xe.prototype._sortDataView=function(t){if(t=t||{},this._dispatch("preDataSorting",t),!this._dataSorting)return;let e=this._sortStates.length;this._userManagedLogic&&e>1&&(e=1);let i=null,n=null,o=null;if(e){i=new Array(e),n=new Array(e);for(let t=0;t<e;++t)i[t]=this._sortStates[t].sortOrder,n[t]=this._sortStates[t].sortLogic;o=this._rowDefMode?this._sortStates.map(Xe._toRowDefField):this.getColumnSortingFields(),this._userManagedLogic&&o.length>1&&(o=o.slice(0,1))}for(let e=this._hosts.length;--e>=0;){let r=this._hosts[e].getDataSource();if(r){let e=1==t.isUserAction;r.sort(o,i,n,e)}}},Xe.prototype._clearSortSymbols=function(t){let e=t.targetCells;if(!e)return null;let i=null;for(let t=e.length;--t>=0;){let n,o=e[t];o.removeClass("sorting"),o.removeClass("sortable"),o.removeFloatingIcon("sort-symbol"),o.removeFloatingIcon("priority-symbol"),null==i&&(n=o.getSection())&&(i=n.getColumnIndex(o.getParent()))}return e.length=0,i},Xe.prototype._updateSortableIndicator=function(t){let e=this,i=e._hosts[t];if(!i||this._frozenIndicator)return;let n=i.getSection("title");if(null!=n)for(let i=n.getColumnCount();--i>=0;){let o=n.getRowCount();for(let r=0;r<o;r++){let s=n.getCell(i,r,!0);if(!s)continue;if(s.removeClass("sorting"),s.removeClass("sortable"),s.removeClass("asc"),s.removeClass("desc"),s.removeClass("edge-indicator"),s.removeFloatingIcon("sort-symbol"),s.removeFloatingIcon("priority-symbol"),s.removeFloatingIcon("sortable-indicator"),r!==o-1)continue;if(!e._isCellSortable(n,i,r))continue;s.addClass("sortable");let l,a,u=e.getSortPriority(i),h=e._sortStates[u];if(h&&"n"!==h.sortOrder){if(h.targetCells||(h.targetCells=[]),h.targetCells[t]=s,"a"===h.sortOrder?s.addClass("asc"):s.addClass("desc"),s.addClass("sorting"),e._solarTheme){let t;"a"===h.sortOrder?(t="▲",a=Xe._icons.ascending):(t="▼",a=Xe._icons.descending),l=e._createIconElem(a,t),l.className="sort-symbol",s.insertFloatingIcon(l,0)}else s.addClass("edge-indicator");e._sortStates.length>1&&(l=document.createElement("span"),l.className="priority-symbol",l.textContent=u+1,s.insertFloatingIcon(l,1))}else e._sortableIndicator&&(a=Xe._icons.sortable,l=e._createIconElem(a,"◊"),l.className="sortable-indicator",s.insertFloatingIcon(l,0))}}},Xe.prototype._createIconElem=function(t,e){let i;return t&&"string"==typeof t?(i=document.createElement("ef-icon"),i.setAttribute("icon",t)):(i=document.createElement("span"),i.textContent=e),i},Xe.prototype._getColumnIndex=function(t){if(null!=t){let e=this._hosts[0];if(e)return"number"==typeof t?t:"string"==typeof t?e.getColumnIndex(t):e.getColumnIndex(t.colId)}return-1},Xe.prototype._getColumnId=function(t){let e=this._hosts[0];return e&&null!=t?e.getColumnId(t):""},Xe.prototype._getSortOptions=function(t){let e=this._hosts[0];return e&&e.getColumnData(t).sortableTitle||null},Xe.prototype._newSortOptions=function(t){let e=this._hosts[0],i=null;if(e&&t>=0){let n=e.getColumnData(t);i=n.sortableTitle,i||(i=n.sortableTitle={})}return i||{}},Xe.prototype._isCellSortable=function(t,e,i){let n=this._getSortOptions(e);if(n){if(n.disabled)return!1;let t=n.field;if(null!=t&&!t)return!1}let o=t.getCell(e,i,!0);return!o.hasClass("no-sort")&&(o===t.getCell(e,t.getRowCount()-1,!0)&&!o.getParent().classList.contains("collapsed"))},Xe._proto=Xe.prototype;let Ke=function(t){return t?t.getRowData():null},Je=function(t){return!t.isAutoGenerated()},Qe=function(t){return!t.autoGenerated},Ze=function(t,e,i,n){return(t.getData(n)-e.getData(n))*i},$e=function(t,e,i){let n=t.getParent();if(!n)return 0;let o=e.getParent();if(!o)return 0;if(n!==o)return 0;let r=t.getData("CHILD_ORDER");if(null==r)return 0;let s=e.getData("CHILD_ORDER");return null==s?0:(r-s)*i},ti=function(t){return t?t.getName():""},ei=function(t,e){return t.getField()===e||t.getId()===e},ii=function(t,e){return!!(t&&e&&t.id&&e.id)&&t.id===e.id},ni=function(t,e){let i=this;if(i._onDataChanged=i._onDataChanged.bind(i),i._onQuote2PostUpdate=i._onQuote2PostUpdate.bind(i),i._onDataComposed=i._onDataComposed.bind(i),i._onSubSegmentChanged=i._onSubSegmentChanged.bind(i),i._recalculateFormulas=i._recalculateFormulas.bind(i),i._updateStreamingData=i._updateStreamingData.bind(i),i.updateColumnTitle=i.updateColumnTitle.bind(i),i._populateTimeSeriesChildren=i._populateTimeSeriesChildren.bind(i),i._onPostSectionDataBinding=i._onPostSectionDataBinding.bind(i),i._asyncClearDataUpdates=i._asyncClearDataUpdates.bind(i),i._clearDataUpdates=i._clearDataUpdates.bind(i),i._onPreDataSorting=i._onPreDataSorting.bind(i),i._mainSorter=i._mainSorter.bind(i),i._updateRowData=i._updateRowData.bind(i),i._onFormulaDataChanged=i._onFormulaDataChanged.bind(i),i._onFormulaDataRequired=i._onFormulaDataRequired.bind(i),i._addMemberOfChain=i._addMemberOfChain.bind(i),i._onColumnAdded=i._onColumnAdded.bind(i),i._onRowExpansionBinding=i._onRowExpansionBinding.bind(i),i._onColumnHeaderBinding=i._onColumnHeaderBinding.bind(i),i._getRowId=i._getRowId.bind(i),i._onFieldLoadedError=i._onFieldLoadedError.bind(i),i._snapshotFillerDataChanged=i._snapshotFillerDataChanged.bind(i),i._onPollingInterval=i._onPollingInterval.bind(i),i._onKeyDown=i._onKeyDown.bind(i),i._requestScroll=i._requestScroll.bind(i),i._onVScroll=i._onVScroll.bind(i),i._selfScrollToRow=i._selfScrollToRow.bind(i),i._streamingConflator=new r(50,i._updateStreamingData),i._formulaConflator=new r(300,i._onFormulaDataChanged),i._chainConflator=new r(100,i._addMemberOfChain),i._columnTitleConflator=new r(0,i.updateColumnTitle),i._timeSeriesChildConflator=new r(0,i._populateTimeSeriesChildren),i._defaultColumnOptions={},i._topNode=t||o.div(),i._topNode.classList.add("rt-grid"),i._grid=new ke,i._grid._wrapper=this,i._sorter=new qe,i._sorter.setContext("grid",this),i._sorter.setContext("core",i._grid),i._dateTimeUtil=G,i._grid.listen("columnAdded",i._onColumnAdded),e){if(e.dataView){i._sharedDataSource=!0,i._dv=e.dataView,i._dt=i._dv.getDataTable(),i._mainGrid=e.grid;let t=i._mainGrid.getCoreGrid();i._stp=t.getPlugin("SortableTitlePlugin")}e.SortableTitle&&(i._stp=e.SortableTitle),!1===e.topSection&&(i._topSection=!1)}i._sharedDataSource||(i._dc=new at,i._dc.listen("dataChanged",i._onDataChanged),i._dc.listen("dataComposed",i._onDataComposed),i._dt=new _t,i._dt.setSortingLogic(i._mainSorter),i._dt.setClassificationSource(i._dc),i._dt.listen("subSegmentChanged",i._onSubSegmentChanged),i._dv=new ve(i._dt),i._dv.listen("pageIndexChanged",i._dispatch.bind(i,"pageIndexChanged")),i._dv.listen("pageCountChanged",i._dispatch.bind(i,"pageCountChanged"))),i._grid.setDataSource(i._dv),i._stp?(i._sharedSorter=!0,i._stp.listen("preDataSorting",i._onPreDataSorting),i._grid.loadPlugin(i._stp)):(i._stp=new Xe({userManagedLogic:!0,sortableColumns:!0,disableDoubleClickToSort:!0,ROW_DEF:!0}),i._stp.listen("preDataSorting",i._onPreDataSorting),i._grid.loadPlugin(i._stp,e)),i._grid.listen("beforeContentBinding",i._dispatch.bind(i,"beforeContentBinding")),i._grid.listen("preSectionRender",i._onColumnHeaderBinding),i._grid.listen("postSectionDataBinding",i._onPostSectionDataBinding),i._grid.listen("firstRendered",i._dispatch.bind(i,"firstRendered")),i._grid.listen("afterContentBinding",i._dispatch.bind(i,"afterContentBinding")),i._grid.listen("keydown",i._onKeyDown),i._grid.getVScrollbar().listen("scroll",i._onVScroll),i._hiddenInput=i._grid.getHiddenInput(),i._grid.enableRowHighlighting(!0),i._addGridSections(),i._grid.setParent(i._topNode),i._snapshot=new Ot,i._snapshot.addEventListener("adcDataReceived",i._dispatch.bind(i,"adcDataReceived")),i._snapshot.addEventListener("dataChanged",this._snapshotFillerDataChanged),i._connector=new We,i._connector.addEventListener("ricAdded",i._onRicAdded.bind(i)),i._connector.addEventListener("ricRemoved",i._onRicRemoved.bind(i)),i._connector.addEventListener("fieldAdded",i._onFieldAdded.bind(i)),i._connector.addEventListener("fieldRemoved",i._onFieldRemoved.bind(i)),i.initialize(e),Ne.applyStyle(i._grid)};function oi(t){return t&&"SPAN"!==t.tagName&&!t.disabled}function ri(t,e){return!t.classList.contains("valigner")&&t!==e}function si(t){if(t){let e=t.getContent();if(e&&oi(e))return e.focus(),!0}return!1}s.inherits(ni,a),ni.prototype._topNode=null,ni.prototype._mainGrid=null,ni.prototype._grid=null,ni.prototype._dc=null,ni.prototype._dt=null,ni.prototype._dv=null,ni.prototype._sharedDataSource=!1,ni.prototype._sharedSorter=!1,ni.prototype._subs=null,ni.prototype._stp=null,ni.prototype._columnSorter=null,ni.prototype._streamingConflator=null,ni.prototype._snapshot=null,ni.prototype._connector=null,ni.prototype._sorter=null,ni.prototype._fnEngine=null,ni.prototype._formulaConflator=null,ni.prototype._chainMembers=null,ni.prototype._chainConflator=null,ni.prototype._clientWidth=NaN,ni.prototype._autoLayoutTimer=0,ni.prototype._defaultColumnOptions=null,ni.prototype._RTK=null,ni.prototype._ADCOptions=null,ni.prototype._synapse=null,ni.prototype._autoDateConversion=!1,ni.prototype._textSelect=!1,ni.prototype._lang=null,ni.prototype._dateTimeUtil=null,ni.prototype._initializing=!1,ni.prototype._pollingInterval=0,ni.prototype._pollingTimerId=0,ni.prototype._lastPollingRequest=0,ni.prototype._pollingEnabled=!0,ni.prototype._fieldCaching=!1,ni.prototype._timeSeriesExpansion=!0,ni.prototype._childDataField="",ni.prototype._topSection=!0,ni.prototype._focusingArgs=null,ni.prototype._scrolledRow=-1,ni.prototype.dispose=function(){this.removeAllEventListeners(),this._autoLayoutTimer&&(clearInterval(this._autoLayoutTimer),this._autoLayoutTimer=0),this._pollingTimerId&&(clearTimeout(this._pollingTimerId),this._pollingTimerId=0),this.removeAllColumns(),this.removeAllRows(),this._sorter.dispose(),this._grid.dispose(),this._connector.reset(),this._sharedDataSource||(this._dt&&this._dt.dispose(),this._dv&&this._dv.dispose()),this._mainGrid=this._dt=this._dv=null,this._subs&&(this._subs.dispose(),this._subs=null),this._focusingArgs&&this._focusingArgs.id&&(clearTimeout(this._focusingArgs.id),this._focusingArgs=null)},ni.prototype.getElement=function(){return this._topNode},ni.prototype.removeEventListeners=ni.prototype.removeAllEventListeners,ni.prototype.listen=ni.prototype.addEventListener,ni.prototype.initSubscription=function(){if(!this._dc||this._dc.getSubscriptions())return;let t,e,i;if(t=window.JET,this._RTK?e=this._RTK.Quotes:t&&(e=t.Quotes2),e&&(i=e.create()),!i)return;i.filter&&i.filter(-2,-1),this._subs=i,this._subs.start(),this._dc.setSubscriptions(i),this._subs.addEventListener("postUpdate",this._onQuote2PostUpdate);let n=this._getAllRowDefinitions(),o=n.length;for(let t=0;t<o;++t){let e=n[t];e&&e.subscribeForUpdates()}},ni.prototype.updateLayout=function(){this._grid.updateLayout(),this._stp.updateSortSymbols()},ni.prototype._updateRowData=function(t){if(t>=0){let e=this._dv.getRowId(t);e&&this._dt.setRowData(e,{})}else this._dt.dispatchGlobalChange()},ni.prototype.updateRowData=ni.prototype._updateRowData,ni.prototype._addGridSections=function(){let t=this._grid.addSection("title");0==this._topSection?t.setRowCount(0):t.setRowCount(1),this._grid.addSection("content");let e=this._grid.getSectionSettings("title");e.disableDataBinding();let i=this._grid.getSectionSettings("content");i.setAutoSyncRowCount(!0),i.setParent(e)},ni.prototype.addHeaderSection=function(t){let e=this._grid.getAllSections("title"),i=this._grid.addSectionAt(e.length,"title",t);if(i){i.setRowCount(1),this._grid.getSectionSettings(i).disableDataBinding()}return i},ni.prototype.addFooterSection=function(t){let e=this._grid.addSection("footer",t);if(e){e.setRowCount(1),this._grid.getSectionSettings(e).disableDataBinding()}return e},ni.prototype.setParent=function(t){o.appendChild(t,this._topNode),this.updateLayout()},ni.prototype.insertBefore=function(t){if(t){let e=t.parentNode;e&&(e.insertBefore(this._topNode,t),this.updateLayout())}},ni.prototype.getRelativePosition=function(t){return this._grid.getRelativePosition(t)},ni.prototype.getCoreGrid=function(){return this._grid},ni.prototype.initialize=function(t){if(!t)return void this.initSubscription();let e=this;e._initializing=!0;let i=e._grid;i.resetInternalState();let n=(t=i.normalizeConfig(t)).plugins||t.extensions,o=t.fields||t.columns;t.defaultColumnOptions&&(e._defaultColumnOptions=t.defaultColumnOptions,e._defaultColumnSetup(e._defaultColumnOptions,o)),e._processExtension(n,"beforeInit",[i.getElement(),t]),t.textSelect&&(e._textSelect=!0,i.addClass("tr-text-select")),t.RTK&&(e._RTK=t.RTK,e._snapshot.setRTK(e._RTK)),t.ADC&&(e._ADCOptions=t.ADC,e._snapshot.setADCOptions(e._ADCOptions)),t.synapse&&(e._synapse=t.synapse,Et.setSynapseConfig(e._synapse)),t.fieldCaching&&(e._fieldCaching=t.fieldCaching),null!=t.timeSeriesExpansion&&(e._timeSeriesExpansion=t.timeSeriesExpansion,Et.disableTimeSeriesExpansion(!e._timeSeriesExpansion)),t.icons&&t.icons.rowGrouping&&t.icons.rowGrouping.expander&&(Ne.chainIcon=t.icons.rowGrouping.expander),t.formulaEngine&&(e._fnEngine=new et,e._fnEngine.addEventListener("dataChanged",e._onFormulaDataChanged),e._fnEngine.addEventListener("dataRequired",e._onFormulaDataRequired));let r=t.borders;null!=r&&i.toggleBorders(r);let s=t.gridlines;null!=s&&i.toggleGridlines(s);let l=t.verticalLines;null!=l&&i.toggleVerticalLines(l);let a=t.contentVerticalLines;null!=a&&i.toggleContentVerticalLines(a);let u=t.horizontalLines;null!=u&&i.toggleHorizontalLines(u),t.pageSize&&e._dv.setPageSize(+t.pageSize);let h=+t.rowHeight;h&&i.setDefaultRowHeight(h);let p=+t.headerRowHeight;p&&i.getSection("title").setDefaultRowHeight(p);let d=t.autoLayoutUpdate;!e._autoLayoutTimer&&d&&"0"!==d&&"false"!==d&&(e._autoLayoutTimer=setInterval(e._onAutoLayoutUpdate.bind(e),2e3));let c=t.rowHighlighting;null!=c&&i.enableRowHighlighting(!!c);let _=t.rowExpansionBinding;"function"==typeof _&&(i.listen("rowExpansionBinding",e._onRowExpansionBinding),e.listen("rowExpansionBinding",_)),this.addListener(t,"dataComposed"),this.addListener(t,"beforeContentBinding"),this.addListener(t,"firstRendered"),this.addListener(t,"afterContentBinding"),t.autoDateConversion&&(e._autoDateConversion=!0),t.stepScroll&&i.setRowScrollingStep(1),t.linearWheelScrolling&&i.getVScrollbar().setMouseWheelSpeed("linear"),null!=t.autoHideScrollbar&&i.autoHideScrollbars(!!t.autoHideScrollbar),null!=t.scrollbarParent&&e._setScrollbarParent(t.scrollbarParent);let g=t.adcPollingInterval;null!=g&&(e._pollingInterval=g?+g:0),e.setColumns(o);let y=!0;null!=t.rowVirtualRendering&&(y=t.rowVirtualRendering),null!=t.rowVirtualization&&(y=t.rowVirtualization),i.enableRowVirtualization(!!y);let C=!1;null!=t.columnVirtualRendering&&(C=t.columnVirtualRendering),null!=t.columnVirtualization&&(C=t.columnVirtualization),i.enableColumnVirtualization(!!C),null==t.scrollbar||t.scrollbar?e._topNode.style.overflow="hidden":(i.freezeSection(null),e._topNode.style.overflow="");let S=t.topFreezingCount;if("number"==typeof S){S=S>0?S:0;let t=S-1;i.freezeSection(t)}else!1===S&&i.freezeSection(null);let w=t.bottomFreezingCount;if("number"==typeof w&&(w=w>0?w:0,i.freezeFooter(w)),e.addDataFields(t.dataFields),t[gt]=!0,Array.isArray(n)){for(let o=0;o<n.length;++o){let r=n[o],s=null;if(r){let e=r.name;s=e?i.loadPlugin(e,r):i.loadPlugin(r,t)}if(s&&s.setGridWrapper){"function"==typeof s.getGridApi&&s.getGridApi()||s.setGridWrapper("realTimeGrid",e)}}e._initializing=!1}let b=t.lang;null!=b&&(e._lang=b,e._dateTimeUtil.setLocale(b)),null!=t.childDataField&&(this._childDataField=Rt._childDataField=t.childDataField);let R=t.rows;R||(R=t.rics||null);let v=t.bodies;if(!v&&(v=[],t.body&&v.push(t.body),R)){for(let t=0;t<R.length;t++)"string"==typeof R[t]&&(R[t]={ric:R[t]});v.push({rows:R})}let I=t.staticDataRows||t.dataModel;if(R&&I){let t,i,n=I.data?I.data:I,o=I.fields||e.getColumnFields(),r=R.length;for(let e=0;e<r;e++)R[e].values?(t=m(R[e].values,o),i=m(n[e],o),R[e].values=f(t,i)):R[e].values=n[e];n=n.slice(r,n.length),I.data?I.data=n:I=n}for(let t=0;t<v.length;++t)e.insertRows(v[t].rows);e.addStaticDataRows(I),t.contentBottomPadding&&i.setBottomPaddingSection(t.contentBottomPadding);let D=t.contentRightPadding;D&&("number"!=typeof D&&(D=6),i.reserveRightSpace(D));let x=t.dataConflationRate;null!=x&&i.setDataConflationRate(x);let A=i.getPluginList().map(i.getPlugin.bind(i));e._processExtension(A,"afterInit"),e.initSubscription()},ni.prototype.getConfigObject=function(t){let e=t||{},i=e.columns;i||(i=e.columns=[]);let n,o,r,s=this._grid;for(s.getConfigObject&&s.getConfigObject(e),!1===e.columnVirtualization&&delete e.columnVirtualization,!0===e.rowVirtualization&&delete e.rowVirtualization,!0===e.rowHighlighting&&delete e.rowHighlighting,!1===e.contentVerticalLines&&delete e.contentVerticalLines,!1===e.borders&&delete e.borders,o=this.getColumnCount(),n=0;n<o;++n){let t=i[n];t||(t=i[n]={});let e=this.getColumnDefinition(n);e.getConfigObject(t);let o=Et.getFieldProperty(e.getField(),"timeSeriesParent");o&&!r&&(r=o,t.field=o,delete t.name,delete t.autoGenerated),!o&&r&&(r=null)}e.columns=i=i.filter(Qe),""===this._topNode.style.overflow&&(e.scrollbar=!1);let l=this._dv.getPageSize();l>0&&(e.pageSize=l),l=s.getDefaultRowHeight(),28!==l&&(e.rowHeight=l),l=s.getSection("title").getDefaultRowHeight(),28!==l&&(e.headerRowHeight=l),this._autoLayoutTimer&&(e.autoLayoutUpdate=!0),l=y(this._defaultColumnOptions),l||(e.defaultColumnOptions=this._defaultColumnOptions),this._autoDateConversion&&(e.autoDateConversion=!0),this._textSelect&&(e.textSelect=!0),this._lang&&(e.lang=this._lang),this._fnEngine&&(e.formulaEngine=!0),this._pollingInterval&&(e.adcPollingInterval=this._pollingInterval),this._fieldCaching&&(e.fieldCaching=this._fieldCaching),1!=this._timeSeriesExpansion&&(e.timeSeriesExpansion=this._timeSeriesExpansion),this._childDataField&&(e.childDataField=this._childDataField);let a,u,h=this.getAllRowDefinitions(),p=e.rows=[];for(o=h.length,n=0;n<o;n++)a=h[n],u=a.getConfigObject(),p.push(u);let d,c,_=s.getPlugins();for(let t in _)if(d=_[t],"function"==typeof d.getRowConfigObject)for(o=p.length,n=0;n<o;n++)a=h[n],c=p[n],d.getRowConfigObject(c,a.getRowId());return e},ni.prototype.setDateTimeUtil=function(t){this._dateTimeUtil!==t&&(this._dateTimeUtil=t,this._dateTimeUtil.setLocale(this._lang))},ni.prototype.setLocale=function(t){t&&this._lang!==t&&(this._lang=t,this._dateTimeUtil.setLocale(t),this._grid.requestRowRefresh())},ni.prototype._defaultColumnSetup=function(t,e){let i=e.length;for(let n=0;n<i;n++){let i=e[n];if("object"==typeof i)for(let e in t)null==i[e]&&(i[e]=t[e])}},ni.prototype._processExtension=function(t,e,i){if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n][e]&&t[n][e].apply(t[n],i)},ni.prototype._onRicAdded=function(t){let e=t.addedRics;this._snapshot.addFields(t.fields);let i=e.length;for(let t=0;t<i;++t){let i=e[t],n=this._connector.getRowDefByRic(i),o=n?n.length:0;for(let t=0;t<o;++t){n[t].getSymbol()===i&&this._snapshot.addRic(i)}}this._dispatch(t.type,t)},ni.prototype._onRicRemoved=function(t){this._dispatch(t.type,t)},ni.prototype._onFieldAdded=function(t){let e=t.rowDefs,i=t.addedFields;for(let t in e)this._snapshot.addRic(e[t].getSymbol());if(this._snapshot.addFields(i),this._subs){let t=i.filter(Et.isRealTimeField);t.length>0&&this._subs.addFields(t)}this._dispatch(t.type,t)},ni.prototype._onFieldRemoved=function(t){let e=t.removedFields;this._subs&&this._subs.removeFields(e),this._dispatch(t.type,t)},ni.prototype.insertColumn=function(t,e){let i=this.getColumnCount();(null==e||e>i)&&(e=i);let n=this._initializing?{}:g(this._defaultColumnOptions);if("string"==typeof t)n.field=t;else for(let e in t)n[e]=t[e];this._fnEngine&&(n.formulaEngine=this._fnEngine);let o=new zt(n,this);n.COL_DEF=o,this._grid.insertColumn(e,n)},ni.prototype._updateTimeSeriesFields=function(t){let e,i,n,o,r,s,l=t.data,a={};for(let t in l){for(e in l[t])a[e]=!0;this.setRicData(t,l[t])}let u={};for(n in a)i=t.childrenFieldToParent[n],u[i]?u[i].push(n):u[i]=[n];for(i in u){let t,n,l=u[i];for(o=this.getColumnIndex(i),r=this._getColumnDefinition(o),n=l.length,t=0;t<n;t++)e=l[t],s=this.getColumnIndex(e),s<0&&(o=this.getColumnIndex(i),r=this._getColumnDefinition(o),this._cloneTimeSeriesColumn(r,e,o),Et.addTimeSeriesChild(i,e));this.removeColumn(i)}},ni.prototype._populateTimeSeriesChildren=function(t){if(this._timeSeriesChildConflator.conflate(t))return;let e,i,n,o,r,s=this._timeSeriesChildConflator.popAllData();for(e=0;e<s.length;e++){if(t=s[e],r=this.getColumnIndex(t),!t)continue;let l=t.getField(),a=Et.getTimeSeriesChildren(l);if(!a)return;if(n=a.length,n<1)return;for(i=0;i<n;i++)r=this.getColumnIndex(t),o=a[i],this._cloneTimeSeriesColumn(t,o,r)}},ni.prototype._cloneTimeSeriesColumn=function(t,e,i){let n,o;n=t.getConfigObject(),o=g(n),o.field=e.replace("TR.",""),o.name=e.split("_")[1].split("T")[0],o.parent=t,o.timeSeriesName=t.getName(),o.timeSeriesId=t.getId(),this.insertColumn(o,i++)},ni.prototype.replaceColumn=function(t,e){let i=this.getColumnIndex(e);if(i<0)return;let n={},o=this._grid,r=o._getColumnDef(i),s=o.getColumnScalability(i);if(n.scalable=s,s=o.getColumnCustomLaneSize(i),n.width=s,s=o.getMinimumColumnWidth(i),s>0&&(n.minWidth=s),s=o.getColumnVisibility(i,0),s||(n.hidden=!0),s=r.stationary,s&&(n.stationary=s),s=r.leftPinned,s&&(n.leftPinned=s),s=r.rightPinned,s&&(n.rightPinned=s),"string"==typeof t)n.field=t;else for(let e in t)n[e]=t[e];t.width&&!t.scalable&&(n.scalable=!1),t.scalable&&!t.width&&(n.width=1);let l=this.getColumnDefinition(i);l&&null==n.id&&(n.id=l.getId()),this._grid.startBatch("reset"),this.removeColumn(i),this.insertColumn(n,i),this._grid.stopBatch("reset")},ni.prototype._onFieldLoadedSuccess=function(t,e,i){if(i&&i.id){let n=i;e&&e.getField()===t&&e.isDefaultName()&&n.name&&(e.setName(n.name),this.updateColumnTitle())}},ni.prototype._onFieldLoadedError=function(t){},ni.prototype._onFieldLoaded=function(t,e){if(Et.isTimeSeries(t)){let t=this.getColumnDefinitionById(e);this._populateTimeSeriesChildren(t)}this._connector.addFields(t,e)},ni.prototype._setScrollbarParent=function(t){t.style.boxSizing="border-box",t.style.overflow="hidden",t.style.position="relative",this._topNode.style.height="100%",this._grid.autoHideScrollbars(!1),this._grid.getVScrollbar().attachToExternalElement(t),this._grid.getHScrollbar().attachToExternalElement(t)},ni.prototype.getFieldInfo=function(t){return Et.getFieldInfo(t)},ni.prototype.loadFieldInfo=function(t){return Et.loadFieldInfo(t)},ni.prototype._shouldLoadFieldInfo=function(t){let e=this._RTK||window.JET;return!!e&&(!!this._fieldCaching&&(e=Et.hasFieldInfo(t),!e&&(e=Et.isAdc(t)||Et.isRealTimeField(t),!!e)))},ni.prototype.setColumns=function(t){let e=this._grid,i=t?t.length:0;if(e.startBatch("reset"),this.removeAllColumns(),i>0){let n=!1;i>1&&(n=e.freezeLayout(!0));for(let e=0;e<i;++e)this.insertColumn(t[e],e);i>1&&e.freezeLayout(n)}e.stopBatch("reset")},ni.prototype.restoreColumns=function(t,e){let i=this._grid;i.startBatch("reset");let n,o,r,s=this.getConfigObject().columns,l=s.length,a=t.length,u=e?ii:S,h=[],p=[],d=[];for(n=0;n<l;n++){for(r=!1,o=0;o<a;o++)if(u(s[n],t[o])){p.push(s[n]),r=!0;break}r||h.push(n)}this.removeColumns(h);let c=p.length,_=!1;for(a>1&&(_=this._grid.freezeLayout(!0)),n=0;n<a;n++){for(r=!1,o=0;o<c;o++)if(u(t[n],p[o])){r=!0;let e=this.getColumnIndex(t[n].id||t[n].field);d.push(this.getColumnId(e));break}r||(this.insertColumn(t[n],n),d.push(this.getColumnId(n)))}a>1&&this._grid.freezeLayout(_),i.reorderColumns(d),i.stopBatch("reset")},ni.prototype.setFields=ni.prototype.setColumns,ni.prototype._onColumnAdded=function(t){let e=t.context.COL_DEF;delete t.context.COL_DEF;let i=t.colIndex,n=this._grid._getColumnDef(i);e._setCoreColumnDef(n);let o=this._grid.getColumnData(i);o||(o=this._grid.setColumnData(i,{})),o.COL_DEF=e;let r=e.getUserModel();this._grid.setColumnDataBindingHandler(i,e.getRenderer());let s=r.width;if(void 0!==s){let t;s=+s,t=null!=r.scalable?!!r.scalable:s!=s,this._grid.setColumnWidth(i,s,t)}else this._grid.setColumnWidth(i,1,!0);s=r.minWidth,s>=0&&this._grid.setMinimumColumnWidth(i,s),s=r.hidden,s&&this._grid.hideColumn(i,!0),s=r.textAlign||r.alignment,"string"==typeof s&&this._grid.setColumnAlignment(i,s),r.keepModel||e.clearUserModel(),e.isTextSelect()&&this._grid.enableColumnClass(i,"tr-text-select",!0,"content");let l,a=e.getClasses();for(l=0;l<a.length;l++)this._grid.enableColumnClass(i,a[l]);let u=e.getField();this._grid.setDataColumnName(i,gt);let h,p,d,c,_=e.getAllFields(),f=e.getId(),g=_.length;for(l=0;l<g;l++)h=_[l],this._shouldLoadFieldInfo(h)?(p=h===u?e.getDataType():zt.getDataType(h),d=Et.loadFieldInfo(h).then(this._onFieldLoadedSuccess.bind(this,h,e)).catch(this._onFieldLoadedError),p?(e.isTimeSeries()&&this._populateTimeSeriesChildren(e),this._connector.addFields(h,f)):(c=this._onFieldLoaded.bind(this,h,f),d=d.then(c).catch(c))):(e.isTimeSeries()&&this._populateTimeSeriesChildren(e),this._connector.addFields(h,f))},ni.prototype.removeColumn=function(t){let e=this.getColumnIndex(t);if(e<0)return;let i=this.getColumnDefinition(e);this._grid.removeColumnAt(e),this._connector.removeFields(i),i.dispose()},ni.prototype.removeColumns=function(t){let e=this.getColumnIndices(t),i=e.length;if(i<=1)return void(1===i&&this.removeColumn(e[0]));e.sort(ni._descendingOrder);let n=this._grid.freezeLayout();for(let t=0;t<i;++t){let i=e[t],n=this.getColumnDefinition(i);n.dispose(),this._grid.removeColumnAt(i),this._connector.removeFields(n)}this._grid.freezeLayout(n)},ni.prototype.removeAllColumns=function(){let t=this.getColumnCount();if(!(t<=0)){this._sharedSorter||this.clearSort();for(let e=t;--e>=0;){this._grid.setColumnDataBindingHandler(e,null),this.getColumnDefinition(e).dispose()}this._columnTitleConflator.reset(),this._timeSeriesChildConflator.reset(),this._connector.removeAllFields(),this._grid.setColumnCount(0)}},ni.prototype.moveColumn=function(t,e){return this._grid.moveColumn(t,e)},ni.prototype.moveColumnById=function(t,e){return this._grid.moveColumnById(t,e)},ni.prototype.reorderColumns=function(t,e){return this._grid.reorderColumns(t,e)},ni.prototype.hideColumn=function(t,e){let i=this.getColumnIndex(t);i<0||this._grid.hideColumn(i,e)},ni.prototype.hideColumns=function(t,e){this._grid.hideColumns(this.getColumnIndices(t),e)},ni.prototype.showAllColumns=function(){this._grid.showAllColumns()},ni._descendingOrder=function(t,e){return e-t},ni.prototype.addDataFields=function(t,e){if(!t)return!1;let i,n,o,r,s,l=Array.isArray(t)?t:[t],a=l.length;for(i=0;i<a;i++)n=l[i],this._shouldLoadFieldInfo(n)?(o=zt.getDataType(n),r=Et.loadFieldInfo(n).catch(this._onFieldLoadedError),o?this._connector.addFields(n,e||"grid"):(s=this._onFieldLoaded.bind(this,n,e),r=r.then(s).catch(s))):this._connector.addFields(n,e||"grid");return!0},ni.prototype.removeDataFields=function(t,e){return!!t&&(this._connector.removeFields(t,e||"grid"),!0)},ni.prototype.removeFieldReferrer=function(t){t&&this._connector.removeFieldReferrer(t)},ni.prototype.sortColumn=function(t,e){if("string"==typeof t)return void this._stp.sortColumn(t,e);let i=this.getColumnIndex(t);i<0?this._stp.sortColumn(this.getSortedColumnIndex(),"n"):this._stp.sortColumn(i,e)},ni.prototype.setColumnName=function(t,e){let i=this.getColumnDefinition(t);i&&(i.setName(e),this.updateColumnTitle())},ni.prototype.setColumnRenderer=function(t,e){let i=this.getColumnIndex(t);this.setColumnFormatter(i,e)},ni.prototype.activateColumnRenderer=function(t,e,i){let n=this.getColumnIndex(t);if(null==n)return;let o=this.getColumnDefinition(n);o&&(o.activateRenderer(e,i),this._grid.setColumnDataBindingHandler(n,o.getRenderer()),this._grid.requestRowRefresh())},ni.prototype.setColumnFormatter=function(t,e){if(null==t)return;let i=this.getColumnDefinition(t);if(!i)return;let n=null;if(e&&("object"==typeof e?("function"==typeof e.init&&e.init(i.getConfigObject(),this._grid),n=e.binding):n=e,"function"!=typeof n&&(n=null)),n!==i.getRenderer()){let e=this._grid.getSection("content").getColumn(t);e&&e.clearContent(),this._grid.setColumnDataBindingHandler(t,null),i.setRenderer(n),this._grid.setColumnDataBindingHandler(t,i.getRenderer()),this._grid.requestRowRefresh()}},ni.prototype.setColumnSorter=function(t,e){let i=this.getColumnIndex(t),n=this.getColumnDefinition(i);if(n){n.setSorter(e),this.getSortedColumnIndex()===i&&this._stp.refresh()}},ni.prototype._initDuplicateRicData=function(t){let e=this._connector.getRowDefByRic(t.getSymbol());e&&t.copyRowData(e[0])},ni.prototype.insertRow=function(t,e){if(this._mainGrid)return this._mainGrid.insertRow(t,this._getRowId(e));t&&("string"==typeof t?t={ric:t}:Array.isArray(t.values)&&(t.fields||(t.fields=this.getColumnFields())));let i=new Rt(t);return i.setDataSource(this._dc),this._initDuplicateRicData(i),i.registerToView(this._dv,this._getRowId(e)),t&&t.hidden&&this._dv.hideRow(i.getRowId()),this._connector.addRic(i),i},ni.prototype.insertSegmentSeparator=function(t,e){return t||(t={}),"object"==typeof t?(t.asSegment=!0,this.insertRow(t,e)):null},ni.prototype.insertRows=function(t,e,i){if(this._mainGrid)return void this._mainGrid.insertRows(t,this._getRowId(e));if(!Array.isArray(t))return;let n=this._dt.freeze(),o=i||this.getColumnFields(),r=this._getRowId(e),s=t.length;for(let e=0;e<s;++e){let i=t[e];i&&("string"==typeof i&&(i={ric:i}),i.fields=o),this.insertRow(i,r)}this._dt.freeze(n)},ni.prototype.addStaticDataRows=function(t,e){if(this._mainGrid)this._mainGrid.addStaticDataRows(t,e);else{if(!Array.isArray(t)){let i=t;t=null,i&&(i.fields&&!e&&(e=i.fields),Array.isArray(i.data)&&(t=i.data))}t&&this.insertRows(t.map(ni._dataToRowOptions),null,e)}},ni.prototype.updateDataSet=function(t,e){if(!Array.isArray(t)||0===t.length)return void this.removeAllRows();let i,n,o,r,s=t.length,l={},a=this.getAllRowDefinitions(),u=a.length,h=!1;if(e){for(h=this._dt.freeze(),r=0;r<u;r++)i=a[r],i&&(n=i.getRowData()[e],n||0===n?l[n]=i:this.removeRow(i));let p={},d={};for(r=s-1;r>=0;r--)o=t[r],n=o[e],i=l[n],d[n]=o,o.ROW_ORDER=r,p[n]||(p[n]=!0,i?i.setRowData(o):this.insertRow({values:o}));for(let t in l)l[t]&&!d[t]&&this.removeRow(l[t]);this._dt.sortOnce(gt,"a",Ze,"ROW_ORDER"),this._dt.freeze(h)}else{for((s-u>1||u-s>1)&&(h=this._dt.freeze()),r=0;r<u;r++)o=t[r],o?l[r]=a[r]:this.removeRow(a[r]);for(r=0;r<s;r++)o=t[r],i=l[r],i?i.setRowData(o):this.insertRow({values:o});(s-u>1||u-s>1)&&this._dt.freeze(h)}},ni._dataToRowOptions=function(t){return{values:t}},ni.prototype.removeRow=function(t){if(this._mainGrid)return this._mainGrid.removeRow(this._getRowId(t));let e=this._getRowDefinitionByRef(t);return e&&(e.isAutoGenerated()||this._removeRow(e)),e},ni.prototype.removeRows=function(t){let e,i;if(!Array.isArray(t))return e=this.removeRow(t),e?[e]:[];if(this._mainGrid)return this._mainGrid.removeRows(t.map(this._getRowId));let n=[],o=t.length;for(i=0;i<o;++i)e=this._getRowDefinitionByRef(t[i]),e&&(e.isAutoGenerated()||n.push(e));o=n.length;let r=!1;for(o>1&&(r=this._dt.freeze()),i=0;i<o;++i)this._removeRow(n[i]);return o>1&&this._dt.freeze(r),n},ni.prototype.removeAllRows=function(){if(this._sharedDataSource)return;if(!this._dt.getRowCount())return;let t=this._getAllRowDefinitions();this._sharedDataSource||(this._dc.clearAllData(),this._dt.clearAllData(),this._clearDataUpdates()),t.forEach(Rt.dispose),this._streamingConflator.reset(),this._formulaConflator.reset(),this._chainConflator.reset(),this._connector.removeAllRics(),this._grid.getVScrollbar().setScrollTop(0)},ni.prototype._removeRow=function(t){if(this._sharedDataSource)return;this._dispatch("beforeRowRemoved",{});let e=this._connector,i=this._dt,n=t.getDescendants();if(n){for(let t=0;t<n.length;t++)e.removeRic(n[t]);let t=n.map(Rt.toRowId);i.removeRows(t)}e.removeRic(t),i.removeRow(t.getRowId()),t.dispose()},ni.prototype.hideRow=function(t,e){let i=this._getRowId(t);(this._mainGrid||this._grid).hideRow(i,e)},ni.prototype.hideRows=function(t,e){Array.isArray(t)||(t=[t]);let i=t.map(this._getRowId);(this._mainGrid||this._grid).hideRows(i,e)},ni.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},ni.prototype.unhideAllRows=function(){this._grid.unhideAllRows()},ni.prototype.hasHiddenRow=function(){return this._grid.hasHiddenRow()},ni.prototype.setRic=function(t,e,i){if(this._mainGrid)return this._mainGrid.setRic(this._toRowId(t),e,i);let n=this._getRowDefinitionByRef(t);if(n){let t=i||{};"string"==typeof e?t.ric=e:(e&&!i&&(t=e),e=t.ric?t.ric:"");let o=Rt.extractRowOptions(t),r=n.getSymbol();n.setContent(e,o)&&(this._connector.removeRic(n,r),this._initDuplicateRicData(n),this._connector.addRic(n));let s=t.values;null!=s&&n.setStaticRowData(s,t.fields)}return n},ni.prototype.unlinkChain=function(t){let e=this._getRowDefinitionByRef(t);e&&e.isChain()&&e.unlinkChain()},ni.prototype.setRowContent=ni.prototype.setRic,ni.prototype.toggleRowExpansion=function(t,e){this._dv.toggleRowExpansion(t,e)},ni.prototype._onRowExpansionBinding=function(t){if(this.hasListener("rowExpansionBinding")){if(t.originalRowId){let e=this._dv.getRowIndex(t.originalRowId);t.originalRowDef=this._getRowDefinitionByIndex(e),t.originalRowData=t.originalRowDef.getRowData()}else t.rowDef=this._getRowDefinitionByIndex(t.rowIndex),t.rowData=t.rowDef.getRowData();this._dispatch("rowExpansionBinding",t)}},ni.prototype.setRics=function(t){this.removeAllRows(),t&&t.length&&this.insertRows(t)},ni.prototype.getRowCount=function(){return this._dv.getRowCount()},ni.prototype.getPageItemCount=function(){return this._dv.getRowCount(!1,!0)},ni.prototype.getDataRowCount=function(){return this._dt.getRowCount()},ni.prototype.getColumnCount=function(){return this._grid.getColumnCount()},ni.prototype.getColumnDataType=function(t){let e=this.getColumnDefinition(t);return e?e.getDataType():""},ni.prototype.getColumnDefinition=function(t){let e=this._grid.getColumnData(t);return e&&e.COL_DEF||null},ni.prototype.getColumnDefinitions=function(){let t=this.getColumnCount(),e=new Array(t);for(let i=0;i<t;i++)e[i]=this.getColumnDefinition(i);return e},ni.prototype.getColumnDefinitionById=function(t){return"string"==typeof t?this.getColumnDefinition(this.getColumnIndex(t)):null},ni.prototype.getColumnDefinitionsById=function(t){let e=Array.isArray(t)?t.length:0;if(e>0){let i,n,o=new Array(e);for(i=0;i<e;i++)n=t[i],o[i]=this.getColumnDefinitionById(n);return o}return null},ni.prototype._getColumnDefinition=function(t){if(t instanceof zt)return t;if("number"==typeof t)return this.getColumnDefinition(t);if("string"==typeof t){let e=this.getColumnCount();for(let i=0;i<e;++i){let e=this.getColumnDefinition(i);if(ei(e,t))return e}}return null},ni.prototype.getRowType=function(t){let e=this.getRowDefinition(t);return e?e.getType():""},ni.prototype.getRowDefinition=function(t){return"number"==typeof t?this._getRowDefinitionByIndex(t):"string"==typeof t?this._getRowDefinitionById(t):null},ni.prototype._getRowDefinitionByIndex=function(t){return this._dv.getDataAt(t,gt)||null},ni.prototype._getRowDefinitionById=function(t){return this._dt.getData(t,gt)||null},ni.prototype._getRowDefinitionByRef=function(t){return t instanceof Rt&&t.getRowId()?t:this.getRowDefinition(t)},ni.prototype.getRowDefinitions=function(){return this._dv.getColumnData(gt,!0)},ni.prototype._getAllRowDefinitions=function(){return this._dt.getColumnData(gt)},ni.prototype.getAllRowDefinitions=function(t){return t?this._getAllRowDefinitions():this._dt.getColumnData(gt).filter(Je)},ni.prototype.getRowData=function(t){return Ke(this._getRowDefinitionByIndex(t))},ni.prototype.getMultipleRowData=function(t){if("number"==typeof t)return[this.getRowData(t)];let e=null;if(Array.isArray(t)){let i=t,n=i.length,o=new Array(n);e=this.getRowDefinitions();for(let t=0;t<n;++t){let n=i[t];"number"==typeof n?o[t]=Ke(e[n]):n&&n.getRowData&&(o[t]=Ke(n))}return o}return e=t&&t.getColumnData?t.getColumnData(gt,!1):this.getRowDefinitions(),e.map(Ke)},ni.prototype.setRicData=function(t,e){let i=this._connector.getRowDefByRic(t),n=i?i.length:0;for(let o=0;o<n;++o){let n=i[o];n&&n.getSymbol()===t&&n.setRowData(e)}},ni.prototype.getAllRics=function(){return this._connector.getAllRics()},ni.prototype.setRowData=function(t,e){let i=this._getRowDefinitionByRef(t);i&&i.setRowData(e)},ni.prototype.setStaticRowData=function(t,e){let i=this._getRowDefinitionByRef(t);i&&i.setStaticRowData(e)},ni.prototype.setStaticData=function(t,e,i){let n=this._getRowDefinitionByRef(t);n&&n.setStaticData(e,i)},ni.prototype._getRowId=function(t){return"string"==typeof t?t:"number"==typeof t?this._dv.getRowId(t):t instanceof Rt?t.getRowId():""},ni.prototype.getColumnIndex=function(t){if(t&&t instanceof zt){let e=this.getColumnCount();for(let i=0;i<e;++i){if(this.getColumnDefinition(i)===t)return i}return-1}return this._grid.getColumnIndex(t)},ni.prototype.getColumnIndices=function(t){let e=[],i=this.getColumnCount(),n=Array.isArray(t)?t:[t],o=n.length;for(let t=0;t<o;++t){let o=this.getColumnIndex(n[t]);o>=0&&o<i&&e.push(o)}return e},ni.prototype.getColumnId=function(t){return this._grid.getColumnId(t)},ni.prototype.getColumnIds=function(){return this._grid.getColumnIds()},ni.prototype.getColumnField=function(t){return this._grid.getColumnField(t)},ni.prototype.getColumnFields=function(){return this._grid.getColumnFields()},ni.prototype.getColumnNames=function(){return this.getColumnDefinitions().map(ti)},ni.prototype.getAllFields=function(){return this._connector.getAllFields()},ni.prototype.freezeColumn=function(t,e){null==t&&(t=-1),this._grid.freezeColumn(t,e)},ni.prototype.pinColumn=function(t,e){if(Array.isArray(t)){let i=t,n=i.length,o=0;for(let t=0;t<n;++t)o|=this._pinColumn(i[t],e);return!!o}return this._pinColumn(t,e)},ni.prototype._pinColumn=function(t,e){let i=this.getColumnIndex(t),n=this.getColumnCount();if(i<0||i>n)return!1;let o=this._grid.getPinnedLeftColumnCount(),r=this._grid.getPinnedRightColumnCount(),s=this._grid.getStationaryColumnIndex();if(e&&"right"===e.toLowerCase()){let t=this._grid.getFirstPinnedRightIndex();if(i>=t)return!1;if(s>=0&&i<=s)return!1;this.moveColumnById(i,t),r+=1,o-=1}else{if(i<o)return!1;o||s>=0&&(o=s,i>s&&o++),this.moveColumnById(i,o)}return this._grid.freezeColumn(o,r),!0},ni.prototype.unpinColumn=function(t,e){if(Array.isArray(t)){let i=t,n=0;for(let t=i.length;--t>=0;)n|=this._unpinColumn(i[t],e);return!!n}return this._unpinColumn(t,e)},ni.prototype._unpinColumn=function(t,e){let i=this.getColumnIndex(t);if(i<0)return!1;let n=this._grid.getPinnedLeftColumnCount(),o=this._grid.getPinnedRightColumnCount(),r=this.getColumnCount()-o;if(i>=n&&i<r)return!1;let s=null,l=null;if(null!=e){let t=this.getColumnIndex(e);l=this.getColumnId(t),s=this.getColumnId(i)}let a=this._grid.getStationaryColumnIndex();return i<n?(i>a&&this.moveColumnById(i,n),this._grid.freezeColumn(n-2,o)):i>=r&&(i>a&&this.moveColumnById(i,r),this._grid.freezeColumn(n-1,o-1)),i>a&&null!=l&&this.moveColumnById(s,l),!0},ni.prototype.unpinAllColumns=function(){let t=this._grid.getPinnedLeftColumnCount(),e=this._grid.getPinnedRightColumnCount();return!(!t&&!e)&&(this._grid.freezeColumn(-1,0),!0)},ni.prototype._onColumnHeaderBinding=function(t){if("title"!==t.sectionType||t.sectionIndex>0)return;let e=t.fromColIndex,i=t.toColIndex;for(;e<i;)this._renderColumnHeader(e++,t)},ni.prototype._renderColumnHeader=function(t,e){let i=this.getColumnDefinition(t);if(!i)return;let n=i.getHeaderRenderer(),o=e.section,r=o.getRowCount();e.colIndex=t,e.columnDef=i;let s=i.getName(),l=i.getTooltip(),a=i.getHeaderAlignment();for(let i=0;i<r;++i){let r=o.getCell(t,i,!1);r.setContent(s),r.setTooltip(l),r.setStyle("textAlign",a),n&&(e.rowIndex=i,e.cell=r,n(e))}},ni.prototype.updateColumnTitle=function(){if(this._columnTitleConflator.conflate())return;let t=this._grid.getSectionSettings("title");t&&t.rerender()},ni.prototype.isSorting=function(){return this._stp.isSorting()},ni.prototype.getSortedColumnIndex=function(){return this._stp.getSortedColumnIndex()},ni.prototype.getSortOrder=function(){return this._stp.getSortOrder()},ni.prototype.clearSort=function(){this._stp.clearSortState()},ni.prototype._onQuote2PostUpdate=function(t){t.childOrderChange&&(this.isSorting()||this._dt.sortOnce("ROW_DEF","a",$e))},ni.prototype._onDataChanged=function(t){let e=t.rowData;if(!e)return;let i=e[gt];if(i){if(i.getRowId()){this._dc.getRowData(t.rid)?(i.addUpdate(t)&&(this._dt._hasNewUpdates=!0),this._updateStreamingData()):i.isAutoGenerated()&&(i.setParent(null),this._removeRow(i))}return}let n=e.SUB_ID;if(n){let i=this._getRowDefinitionById(n);i&&i.getRic()!==e.RIC&&(this._chainMembers||(this._chainMembers={}),this._chainMembers[t.rid]||(this._chainMembers[t.rid]=e,this._addMemberOfChain(e)))}},ni.prototype._addMemberOfChain=function(t){if(this._chainConflator.conflate(t))return;let e,i=this._chainConflator.popAllData(),n=i?i.length:0,o=!1;n>1&&(o=this._dt.freeze());let r=[];for(e=0;e<n;++e){let n=(t=i[e]).SUB_ID,o=this._getRowDefinitionById(n);if(o){let e=o.addConstituent(t.RIC,this._dt);e&&r.push(e)}}this._chainMembers=null;let s=r.length;if(s)for(e=s;--e>=0;)this._connector.addRic(r[e]);n>1&&this._dt.freeze(o)},ni.prototype._updateStreamingData=function(){this._streamingConflator.conflate()||this._dt&&(this._dt.classifySegments(),this._dt.dispatchGlobalChange())},ni.prototype._onPreDataSorting=function(t){let e=this._stp.getSortedColumns();if(this._sorter.reset(),Array.isArray(e)){let t=e.length;for(let i=0;i<t;++i){let t=e[i],n=t.field||"",o=t.colIndex,r=o>=0?this.getColumnDefinition(o):null,s=!1,l=null;r&&(n=r.getField(),s=r.isRowSorting(),l=r.getSorter()),this._sorter.addColumnContext(n,l,s,t.sortOrder,o,r)}}this._columnSorter=this._sorter.getSorter()},ni.prototype._mainSorter=function(t,e,i){return this._columnSorter(t,e,i)},ni.prototype._onPostSectionDataBinding=function(t){t.actualUpdate&&this._asyncClearDataUpdates()},ni.prototype._asyncClearDataUpdates=function(){setTimeout(this._clearDataUpdates,0)},ni.prototype._clearDataUpdates=function(){if(!this._dt||!this._dt._hasNewUpdates)return;let t=this._dt.getAllRowIds(!0);for(let e=t.length;--e>=0;){this._dt.getRowData(t[e])[gt].resetUpdates()}},ni.prototype.getDataView=function(){return this._dv},ni.prototype.setPage=function(t){return this._dv.setPage(t)},ni.prototype.setPageSize=function(t){this._dv.setPageSize(t)},ni.prototype.getPageIndex=function(){return this._dv.getPageIndex()},ni.prototype.getPageSize=function(){return this._dv.getPageSize()},ni.prototype.getPageCount=function(){return this._dv.getPageCount()},ni.prototype.toggleChain=function(t){let e=this._getRowDefinitionByRef(t);e&&e.toggleChain()},ni.prototype.setClassification=function(t,e){let i=this._getRowDefinitionByRef(t);return!!i&&this._dt.setSegmentClassification(i.getRowId(),e)},ni.prototype.contains=function(t){return!!t&&this._topNode.contains(t)},ni.prototype.isFocused=function(){let t=document.activeElement;return t&&t.shadowRoot?t.shadowRoot===this._topNode.parentNode:this.contains(t)},ni.prototype.focus=function(){this._grid.focus()},ni.prototype.requestRowRefresh=function(){this._grid.requestRowRefresh()},ni.prototype.updateLayout=function(){this._grid.updateLayout()},ni.prototype.getExtension=function(t){return t?this._grid.getPlugin(t.replace(/Extension/gi,"")):null},ni.prototype._onFormulaDataChanged=function(t){this._formulaConflator.conflate()||(this._recalculateFormulas(),this._updateRowData())},ni.prototype._onFormulaDataRequired=function(t){},ni.prototype._onDataComposed=function(t){let e=t.changes;if(!e)return;let i=t.rowData;if(!i)return;let n=i[gt];if(n&&n.getDataSource()){if(this._autoDateConversion){let t,i,o,r;for(t in e)r=this._getColumnDefinition(t),o=r?r.getDataType():zt.getDataType(t),"datetime"===o&&(i=e[t],n.setData(t+"_RAW",i),i=G.toDateObject(i),n.setData(t,i))}this.hasListener("dataComposed")&&(t.grid=this,t.rowDef=n,this._dispatch("dataComposed",t)),this._recalculateFormulas(t)}},ni.prototype._onSubSegmentChanged=function(t){let e,i=t.insertionList,n=t.removalList,o=t.removedRows,r=n.length,s=null;for(e=0;e<r;e++){let t=o[n[e]];t&&(s=t[gt],s&&(s.dispose(),t[gt]=null))}let l=i.length;for(e=0;e<l;e++){let t=i[e].getId();s=new Rt({segmentId:t}),s.setDataSource(this._dc),s.registerToView(this._dv)}},ni.prototype._recalculateFormulas=function(t){if(this._fnEngine&&!(this._fnEngine.getFormulaCount()<=0))if(t&&t.rid)this._fnEngine.calculate(t.rowData,t.changes);else{let t=this._dc?this._dc.getAllRowData():null,e=t?t.length:0;for(let i=0;i<e;++i)this._fnEngine.calculate(t[i])}},ni.prototype._snapshotFillerDataChanged=function(t){if(!this._dt)return;let e=t.data;if(t.timeSeries)this._updateTimeSeriesFields(t);else for(let t in e)this.setRicData(t,e[t]);this._lastPollingRequest||(this._lastPollingRequest=1),this._startPolling()},ni.prototype._startPolling=function(){if(this._pollingEnabled&&this._pollingInterval&&this._lastPollingRequest&&!this._pollingTimerId){let t=new Date;this._lastPollingRequest=t.getTime(),this._pollingTimerId=setTimeout(this._onPollingInterval,this._pollingInterval)}},ni.prototype._onPollingInterval=function(){this._pollingTimerId=0,this._pollingEnabled&&this._pollingInterval&&(this.refreshADCData(),this._startPolling())},ni.prototype.activateADCPolling=function(t){if(!1!==t){this._pollingEnabled=!0;let t=new Date;if(this._lastPollingRequest){t.getTime()-this._lastPollingRequest>this._pollingInterval&&this.refreshADCData()}this._startPolling()}else this._pollingEnabled=!1},ni.prototype.refreshADCData=function(){let t=this._snapshot.addFields(this._connector.getAllFields());return!(!t||(t=this._snapshot.addRics(this._connector.getAllRics()),!t))||(this._lastPollingRequest=0,!1)},ni.prototype._onAutoLayoutUpdate=function(){let t=this._topNode.clientWidth;t!==this._clientWidth&&(this._clientWidth=t,this.updateLayout())},ni.prototype.logDT=function(t){let e=this._getAllRowDefinitions();this._logData(e,t)},ni.prototype.logDV=function(t){let e=this.getRowDefinitions();this._logData(e,t)},ni.prototype._logData=function(t,e){e||(e={}),e.colNames||(e.colNames=this.getColumnFields());let i=at.constructTable(t.map(Ke),e);console.table(i)},ni.prototype.replaceRow=function(t,e){let i=this._getRowId(t),n=this._getRowDefinitionById(i);if(n){if(n.isAutoGenerated())return null;let t=n.getConfigObject();if(n.getRowId()===e.rowId)return null;if(S(t,e))return null}let o=this.insertRow(e,i);return n&&this.removeRow(i),o},ni.prototype.scrollToColumn=function(t,e){return this._grid.scrollToColumn(t,e)},ni.prototype.scrollToRow=function(t,e){this._grid.scrollToRow("content",t,e)},ni.prototype.getScrollLeft=function(){return this._grid.getScrollLeft()},ni.prototype.getScrollTop=function(){return this._grid.getScrollTop()},ni.prototype.setScrollLeft=function(t){this._grid.setScrollLeft(t)},ni.prototype.setScrollTop=function(t){this._grid.setScrollTop(t)},ni.prototype.scrollRight=function(t){this._grid.scrollRight(t)},ni.prototype.scrollDown=function(t){this._grid.scrollDown(t)},ni.prototype.getScrollWidth=function(){return this._grid.getScrollWidth()},ni.prototype.getScrollHeight=function(){return this._grid.getScrollHeight()},ni.prototype.getVScrollView=function(){return this._grid.getVScrollView()},ni.prototype._onVScroll=function(){let t=this._focusingArgs;if(!t)return;this._focusingArgs=null;let e=t.event;si(t.section.getCell(t.colIndex,t.rowIndex))?e.preventDefault():e.shiftKey?this._findPrevFocusableCell(e,t.colIndex,t.rowIndex,t.focusableColIndices):this._findNextFocusableCell(e,t.colIndex,t.rowIndex,t.focusableColIndices)},ni.prototype._selfScrollToRow=function(){let t=this._focusingArgs;t&&(t.id=0,this.scrollToRow(t.rowIndex))},ni.prototype._requestScroll=function(t,e,i,n,o){let r=this._focusingArgs;r||this._scrolledRow!==i&&(this._scrolledRow=i,r=this._focusingArgs={event:t,colIndex:e,rowIndex:i,focusableColIndices:n,section:o},r.id=setTimeout(this._selfScrollToRow))},ni.prototype._findNextFocusableCell=function(t,e,i,n,o){let r=n.indexOf(e);!ri(t.target,this._hiddenInput)||r<0?(i=0,r=0):oi(o)&&r>=0&&r++;let s=this._grid,l=s.getSection("content"),a=s.getVerticalViewInfo().bottomRowIndex,u=this.getRowCount();for(let e=i;e<u;e++){for(let i=r;i<n.length;i++){let o=n[i];if(e>a)return void this._requestScroll(t,o,e,n,l);if(si(l.getCell(o,e)))return void t.preventDefault()}r=0}},ni.prototype._findPrevFocusableCell=function(t,e,i,n,o){let r=n.indexOf(e),s=n.length;!ri(t.target,this._hiddenInput)||r<0?(i=0,r=0):oi(o)&&r>=0&&r--;let l=this._grid,a=l.getSection("content"),u=l.getVerticalViewInfo().topRowIndex;for(let e=i;e>=0;e--){for(let i=r;i>=0;i--){let o=n[i];if(e<u)return void this._requestScroll(t,o,e,n,a);if(si(a.getCell(o,e)))return void t.preventDefault()}r=s-1}},ni.prototype._onKeyDown=function(t){if(9!==t.keyCode||t.ctrlKey||t.altKey||t.metaKey)return;let e=this.getColumnDefinitions(),i=e.length,n=[];for(let t=0;t<i;t++)e[t].isFocusable()&&n.push(t);if(!n.length)return;this._scrolledRow=-1;let o=this.getRelativePosition(t),r=o.cell?o.cell.getContent():null;t.shiftKey?this._findPrevFocusableCell(t,o.colIndex,o.rowIndex,n,r):this._findNextFocusableCell(t,o.colIndex,o.rowIndex,n,r)};let li={texts:["If a dog and cat had a baby together that grew up and worked a desk job he'd be a Cog in the machine","I'm still upset that Tie Domi didn't name his child Tyson","A tagline for a car company that prides itself on its morals and ethics: Take the High Road","Logan Broger is amazing and a wonderful boy according to Logan's mom","You know the Grammys are a joke when Future doesn't win Best Everything","If you were a member of the Bloods and became paralyzed do you then become a member of the Crips?","Curling is the best sport named after something you do to your hair","You say potatoe, I say starchy carbs","If you work for an ad agency and getting paid for it aren't you the one who is being influenced by advertising?","Are there Out of Stock photos? Gafuffle","I think of a lot of good ideas when going to the bathroom I guess I have a real stream of consciousness","Most streets are two way streets","Why does that make love so special?","A tagline for an airline: Take the High Road","Rumour has it targeted online advertising was developed because the internet was upset that you could read it but it couldn't read you","This is a true fact: I never had a fear of heights until I fell off a roof","A tagline for a special highway that is easy to navigate while under the influence of drugs: Take the High Road","I'm the only person in the world with my name","We need more werkin and less twerkin if you ask me","If Fantasy Hockey actually lived up to its name, every team would have Henrik Lundqvist and Joffrey Lupul on it","I'm in a band that does Metallica covers with our private parts it's called Myphallica","Smiling could easily be misinterpreted for showing your teeth to someone because they said something that made you happy","We say we are walking the dog, but the dog always leads","Tim Horton was a hockey player but is the name of a coffee chain, which means my dream of a goat sanctuary being my legacy is not unrealistic","I started a sensory deprivation chamber business it involves really dark curtains, ear plugs, and a sleeping mask","Do we make money or does money make us? Chezwich","Pantone is a colour but also the singular version of pants","Logan Ipsum will loop at some point","Thank you for using my words in your work","You should listen to my mixtape (check out the rest of my portfolio)","I have never known a Jack that was in good enough shape to name bodybuilding after him","Twitter is the rice of social media","Injuries always keep you OUT of things","For the name of an act as serious as killing someone, assassination literally translates to buttbuttination","Why don't we call glasses duocles","If you wake up with a giant zit, you are really facing your fears when you look in the mirror","Cemeteries are just garbage dumps filled with humans","I have a moral code, but I haven't figured out how to read it yet","I bet most serial killers play the drums","To Catch A Predator would have been a great name for a Steve Irwin show","If the word kerning is kerned poorly, it kind of looks like learning which is appropriate because both are important","North America should be called Russia since people are always moving so fast","I don't need a big house, just a two floor condo you could say I have lofty expectations","Even faithful and simple Sancho is forced to deceive him at certain points","The novel is considered a satire of orthodoxy, veracity and even nationalism","In exploring the individualism of his characters, Cervantes helped move beyond the narrow literary conventions of the chivalric romance literature that he spoofed","which consists of straightforward retelling of a series of acts that redound to the knightly virtues of the hero","The character of Don Quixote became so well known in its time that the word quixotic was quickly adopted by many languages","Characters such as Sancho Panza and Don Quixote's steed, Rocinante, are emblems of Western literary culture","It stands in a unique position between medieval chivalric romance and the modern novel","The former consist of disconnected stories featuring the same characters and settings with little exploration of the inner life of even the main character"]};li.words=li.texts.join(" ").split(" ").filter((function(t){return t.length>1})),li.companyName=["Yost-Prohaska","Wehner, Howe and Brown","Gusikowski-Legros","Wolff-Windler","McGlynn, Douglas and Kilback","MacGyver Group","Spinka, Stracke and Huel","Howell, Wolff and Emmerich","Blick-O'Reilly","Dibbert, Buckridge and Leffler","Skiles, Kuhlman and Johns","Daugherty Group","Reilly, Toy and Bayer","Bradtke, Mohr and Weber","Thompson, Bruen and Friesen","Rempel-Bednar","Kunze LLC","Pfannerstill Group","Moen-Larkin","Larson LLC","Haag-Feest","Hauck-Bartell","Rohan-Kohler","Waters, Homenick and Pagac","Ziemann Group","Reynolds, Turcotte and Bosco","Graham, Morar and Waters","Cassin Inc","Bosco-Terry","Stanton-Blick","Prohaska and Sons","Pouros, Daugherty and Pfannerstill","Bogan-Cormier","O'Kon-Mills","Mueller-Schmeler","Runte-Trantow","Muller Inc","Shanahan, Ryan and Orn","Huel LLC","Shanahan-Zulauf","Emard-Schuster","Muller Inc","Collier, Muller and Yundt","Wehner, Prohaska and Harber","Ondricka-Stehr","Towne LLC","Feil Inc","Braun, Kihn and Treutel","Ebert-MacGyver","Harris LLC"],li.industry=["Specialty Chemicals","Office Equipment/Supplies/Services","Electric Utilities: Central","Trucking Freight/Courier Services","Auto Parts:O.E.M.","Oil Refining/Marketing","Biotechnology: Biological Products (No Diagnostic Substances)","Computer Software: Programming, Data Processing","Farming/Seeds/Milling","Biotechnology: Laboratory Analytical Instruments","Finance: Consumer Services","Major Banks","Investment Managers","Oilfield Services/Equipment","Paper","Transportation Services"],li.market=["NYSE","NASDAQ","SET","DJI","HSCEI","HKEX","NIKKEI"],li.country=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D'Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:"Korea, Democratic People'S Republic of",code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:"Lao People'S Democratic Republic",code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}];var ai=li;let ui=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10],hi={X_RIC_NAME:{type:"string"},CF_NAME:{type:"string",prefix:!0,suffix:" Name"},CF_LAST:{type:"number",min:.01,max:1e3,prec:2},PCTCHNG:{type:"number",min:-1,max:1,prec:2,suffix:"%"},PCTCHNG2:{type:"float",min:-20,max:20,prec:2,suffix:"%"},CF_CURR:{fixedValue:"USD"},INDICATOR:{type:"number",min:0,max:5},CF_TICK:{type:"number",min:1,max:3,changeOnly:!0},PRCTCK_1:{type:"set",members:["⇧","B⇧","↑","B↑","26","1",'"1"',"-1","⇩","B⇩","↓","B↓","27","2",'"2"']},CF_NETCHNG:{type:"number",min:-100,max:100},CF_VOLUME:{type:"number",min:0,max:1e7},RI_FLAG:{type:"set",members:["R","Q","I","_",""]},RI_CODE:{type:"number",min:0,max:2},STATUS:{type:"number",min:0,max:6},YRLOW:{type:"number",min:0,max:20},YRHIGH:{type:"number",min:200,max:2e3},CFLOW:{type:"number",min:0,max:20},CFHIGH:{type:"number",min:200,max:2e3},LOW_YLD:{type:"set",members:[void 0,0,1,2,3,4,5,10,11,15,20]},HIGH_YLD:{type:"set",members:[void 0,200,300,400,500,1e3,1500,2e3]},CF_YIELD:{type:"set",members:[void 0,0,10,20,30,40,50,100,200,300,400,500]},"TR.IPODate":{type:"isoDate",min:Date.now()-63072e6,max:Date.now()},"TR.Volume":{type:"number",min:2e3,max:1e7},"TR.Price52WeekHigh":{type:"number",min:100,max:300,prec:2},"TR.Price52WeekLow":{type:"number",min:1,max:200,prec:2},"TR.InvalidField":{type:"set",members:[void 0]},percent:{type:"number",min:0,max:101},number_1:{type:"number",min:1,max:100},number_2:{type:"number",min:-100,max:100},index4:{type:"number",min:0,max:4},index5:{type:"number",min:0,max:5},index10:{type:"number",min:0,max:10},index100:{type:"number",min:0,max:100},group3:{type:"set",members:["Group_A","Group_B","Group_C"]},group4:{type:"set",members:["Group_1","Group_2","Group_3","Group_4"]},float_1:{type:"float",min:0,max:1,prec:2},float_2:{type:"float",min:0,max:100,prec:2},float_3:{type:"float",min:-1,max:1,prec:2},precision4:{type:"float",min:-10,max:10,prec:4},precision8:{type:"float",min:-100,max:100,prec:8},boolean:{type:"boolean"},date:{type:"date",min:15e11,max:16e11},date1:{type:"function",generate:function(t,e){return null==e?Ci(6e11,16e11,e):new Date(1e12+1e9*e)}},ISODate:{type:"isoDateObject",min:Date.now()-63072e6,max:Date.now()},word:{type:"string",min:1,max:1},phrase:{type:"string",min:2,max:5},words:{type:"string",min:1,max:20},words1:{type:"string",min:2,max:8},words2:{type:"string",min:3,max:10},words3:{type:"string",min:5,max:15},sentence:{type:"string",min:8,max:20},id:{type:"function",hash:0,generate:function(t,e){return null==e&&(e=null!=t._id?t._id:-1,t._id=++e),e||0}},companyName:{type:"set",members:ai.companyName},industry:{type:"set",members:ai.industry},market:{type:"set",members:ai.market},country:{type:"set",members:ai.country}},pi=function(t,e){if(t){let i=e;"function"==typeof e&&(i={type:"function",generate:e}),hi[t]=i}},di=function(t){return"number"==typeof t?function(t){let e=1e4*Math.sin(113*t);return e*=e,e-(0|e)}(t):Math.random()},ci=function(t,e,i,n){t||(t=0),null==e&&(e=100);let o=(e-t)*di(n)+t;if(i>0){let t=ui[i];return Math.floor(o*t)/t}return null!=i?Math.floor(o):o},_i=function(t,e,i){return ci(t,e+1,0,i)},fi=function(t,e,i){return ci(t,e,0,i)},gi=function(t,e){return fi(0,t,e)},yi=function(t){return 0===_i(0,1,t)},mi=function(t,e){if(t){return t[gi(t.length,e)]}return String.fromCharCode(_i(65,90,e))},Ci=function(t,e,i){(t=t||Date.now()-63072e6)instanceof Date&&(t=t.getTime()),(e=e||Date.now())instanceof Date&&(e=e.getTime());let n=_i(0,(e-t)/1e3,i);return new Date(t+1e3*n)},Si=function(t,e,i){let n=t<e?fi(t,e,i):t,o=new Array(n);for(let t=0;t<n;++t){null!=i&&(i*=1.17*(t+1));let e=gi(ai.words.length,i);o[t]=ai.words[e]}return o.join(" ")},wi=function(t,e,i){let n=Ri(t,e,i),o=n.value+"";return n.prefix&&("string"==typeof n.prefix?o=n.prefix+o:e.prefix&&(o=e.prefix+" "+o)),n.suffix&&(o+=n.suffix),"string"===n.type&&(n.value=o),n.formattedValue=o,n},bi=function(t,e,i){let n={},o=0;e&&("number"==typeof e?o=n.numRows=e:(n=e,o=e.numRows||e.numRow||e.rowCount,null!=e.seed&&-1===(i=e.seed)&&(i=null))),o||(o=1),t?Array.isArray(t)||(t=[t+""]):t=[""];let r=t.length,s=[];for(let n=0;n<o;++n){let n=[];for(let o=0;o<r;++o){let r=t[o];n.push(Ri(r,e,i).value)}null!=i&&++i,s.push(n)}return{data:s,seed:i,fields:t}},Ri=function(t,e,i){let n,o=function(t){return hi[t]||{}}(t);if(o.type||(o.type="number",pi(t,o)),o.fixedValue)return o.value=n,o;null!=i&&(null==o.hash&&(o.hash=function(t){let e=0,i=t?t.length:0;for(;--i>=0;)e+=t.charCodeAt(i)*(i+.9879);return e}(t)),i+=o.hash);let r=null!=o.min?o.min:100,s=null!=o.max?o.max:1e4;if("string"===o.type)n=null!=o.min||null!=o.max?Si(r,s,i):e&&e.text||"";else if("set"===o.type)n=mi(o.members,i);else if("date"===o.type)n=Ci(r,s,i);else if("isoDate"===o.type){n=Ci(r,s,i).toISOString().slice(0,10)}else if("isoDateObject"===o.type)n=Ci(r,s,i),n=new Date(n.toISOString().slice(0,10));else if("boolean"===o.type)n=yi(i);else if("function"===o.type)o.field=t,n=o.generate(o,i);else{let t=null!=o.prec?o.prec:0;n=ci(r,s,t,i)}return o.value=n,o},vi=function(t){this._seed=null!=t?t:null};vi.prototype._seed=null,vi.prototype.generate=function(t,e){let i=bi(t,e,this._seed);return this._seed=i.seed,i.data},vi.prototype.generateRecords=function(t,e){let i=bi(t,e,this._seed);this._seed=i.seed;let n=(t=i.fields).length,o=i.data;for(let e=o.length;--e>=0;){let i=o[e],r={};for(let e=0;e<n;++e){r[t[e]]=i[e]}o[e]=r}return o},vi.prototype.generateQuoteData=function(t,e){let i=wi(t,e,this._seed);return null!=this._seed&&++this._seed,i},vi.prototype.getSeed=function(){return this._seed},vi.prototype.setSeed=function(t){"number"==typeof t&&(this._seed=t)},vi.prototype.randBetween=function(t,e){let i=fi(t,e,this._seed);return null!=this._seed&&++this._seed,i},vi.prototype.randInt=function(t,e){let i=_i(t,e,this._seed);return null!=this._seed&&++this._seed,i},vi.prototype.randIndex=function(t){let e=gi(t,this._seed);return null!=this._seed&&++this._seed,e},vi.prototype.randNumber=function(t,e,i){let n=ci(t,e,i,this._seed);return null!=this._seed&&++this._seed,n},vi.prototype.randBoolean=function(){let t=yi(this._seed);return null!=this._seed&&++this._seed,t},vi.prototype.randMember=function(t){let e=mi(t,this._seed);return null!=this._seed&&++this._seed,e},vi.prototype.randDate=function(t,e){let i=Ci(t,e,this._seed);return null!=this._seed&&++this._seed,i},vi.prototype.randString=function(t,e){let i=Si(t,e,this._seed);return null!=this._seed&&++this._seed,i},vi.seed=null,vi.generate=function(t,e){let i=bi(t,e,vi.seed);return vi.seed=i.seed,i.data},vi.generateRecord=function(t,e,i){Array.isArray(t)||(t=[t+""]);let n={};null!=e&&("number"==typeof e?i=e:e&&(n=e));let o=t.length,r={};for(let e=0;e<o;++e){let o=t[e];r[o]=Ri(o,n,i).value}return r},vi.generateRecords=function(t,e){let i=bi(t,e,vi.seed);vi.seed=i.seed;let n=(t=i.fields).length,o=i.data;for(let e=o.length;--e>=0;){let i=o[e],r={};for(let e=0;e<n;++e){r[t[e]]=i[e]}o[e]=r}return o},vi.addFieldInfo=pi,vi.randNumber=ci,vi.randInt=_i,vi.randBetween=fi,vi.randIndex=gi,vi.randBoolean=yi,vi.randMember=mi,vi.randDate=Ci,vi.randString=Si,vi.toRecords=function(t,e){if(!Array.isArray(t))return null;Array.isArray(e)||(e=e?[e+""]:[]);let i=t.length,n=new Array(i);for(let o=0;o<i;++o){let i=n[o]={},r=t[o],s=r&&r.length||0;for(let t=0;t<s;++t){let n=r[t];if(void 0!==n){let o=e[t];o||0===o||(o=t+""),i[o]=n}}}return n};let Ii=function(){};Ii.prototype.create=function(t){return new Di(t)};let Di=function(t){this._onRowUpdated=this._onRowUpdated.bind(this),this._fieldMap={},this._prevData={},this.id=null!=t?t+"":"_sub"+Di._runningId++};Di.prototype._rics=null,Di.prototype._isChain=!1,Di.prototype._fieldMap=null,Di.prototype._prevData=null,Di.prototype._updateHandler=null,Di.prototype._updateTimerId=0,Di.prototype._updateInterval=1e3,Di._runningId=0,Di.prototype.formattedFields=function(t){for(let e=t.length;--e>=0;)this._fieldMap[t[e]]=!0;return this},Di.prototype.rawFields=function(t){for(let e=t.length;--e>=0;)this._fieldMap[t[e]]=!0;return this},Di.prototype.chain=function(t){return this._rics=Array.isArray(t)?t[0]:[t],this._isChain=!0,this},Di.prototype.rics=function(t){return this._rics=Array.isArray(t)?t:[t],this},Di.prototype.start=function(){return this._onRowUpdated(),this},Di.prototype.stop=function(){return this._updateTimerId&&(clearInterval(this._updateTimerId),this._updateTimerId=0),this},Di.prototype.onNewRow=function(t){return this},Di.prototype.onUpdate=function(t){return this._updateHandler=t,this},Di.prototype.onRemoveRow=function(t){return this},Di.prototype._onRowUpdated=function(){if(!this._updateHandler)return;let t,e=this._rics?this._rics.length:0;if(1===e)t=this._rics[0],this._updateHandler(this,t,this._getUpdateData(t));else for(let i=0;i<e;++i)gi(3)||(t=this._rics[i],this._updateHandler(this,t,this._getUpdateData(t)));this._updateTimerId||(this._updateTimerId=setInterval(this._onRowUpdated,this._updateInterval))},Di.prototype._getUpdateData=function(t){let e={id:this.id},i={text:t};for(let t in this._fieldMap){let n=wi(t,i),o=n.value,r=n.formattedValue;n.changeOnly&&this._prevData[t]===o||(this._prevData[t]=o,e[t]={raw:o,formatted:r||o+""})}return e};let xi=function(){this._dict={}};xi.prototype._dict,xi.prototype._count=0,xi.prototype.addItem=function(t,e){if(t&&null!=e){let i=this._dict[t];return i?i.push(e):this._dict[t]=[e],++this._count,!0}return!1},xi.prototype.addItems=function(t,e){if(t){if(!Array.isArray(e))return this.addItem(t,e);let i=e?e.length:0;if(i){let n=this._dict[t];return n||(n=this._dict[t]=[]),Array.prototype.push.apply(n,e),this._count+=i,!0}}return!1},xi.prototype.removeItem=function(t,e){let i=this._dict[t];if(i){let n=i.indexOf(e);if(n>=0)return i.length>1?i.splice(n,1):delete this._dict[t],--this._count,!0}return!1},xi.prototype.removeItemsByKey=function(t){let e=this._dict[t];return!!e&&(delete this._dict[t],this._count-=e.length,!0)},xi.prototype.removeAllItems=function(){return!!this._count&&(this._dict={},this._count=0,!0)},xi.prototype.getItems=function(t){return this._dict[t]||null},xi.prototype.getAllItems=function(){if(this._count>0){let t=[],e=this._dict;for(let i in e)Array.prototype.push.apply(t,e[i]);return t}return null},xi.prototype.getItemCount=function(t){if(t){let e=this._dict[t]||null;return e?e.length:0}return this._count},xi.prototype.getAllKeys=function(){return Object.keys(this._dict)};let Ai=function(t,e){return t.ric+"_"+e.ric},Li=function(t){let e=t.match(/\./g);return!!e&&e.length>1},Ti=function(t){let e,i,n,o=t;for(e=o.length-1;e>0;e--)i=Math.floor(Math.random()*(e+1)),n=o[e],o[e]=o[i],o[i]=n;return o.forEach(Ei),o=o.sort(Mi),o},Ei=function(t,e){t.CHILD_ORDER=e},Mi=function(t,e){return t.CHILD_ORDER-e.CHILD_ORDER},Fi=function(){};Fi.prototype._lastSub=null,Fi.prototype._configObj=null,Fi.prototype.config=function(t){t&&(this._configObj=t),this._lastSub&&this._configObj&&this._lastSub.config(this._configObj)},Fi.prototype.create=function(t){return this._lastSub=new Pi(t||this._configObj),this._lastSub},Fi.prototype.isSkipHeaderSupported=function(){return!0},Fi.prototype.setUpdateInterval=function(t,e){this._lastSub?this._lastSub.setUpdateInterval(t,e):(this._configObj||(this._configObj={}),this._configObj.minInterval=t,this._configObj.maxInterval=e)},Fi.prototype.setPercentageDataUpdate=function(t){this._lastSub?this._lastSub.setPercentageDataUpdate(t):(this._configObj||(this._configObj={}),this._configObj.percentageDataUpdate=t)};let Pi=function(t){this._onSubscriptionResponse=this._onSubscriptionResponse.bind(this),this._subMap={},this._dataMap=new xi,this._fields={},this._events={},this._dataGen=new vi,this.config(t)};Pi.prototype._minInterval=750,Pi.prototype._maxInterval=850,Pi.prototype._percentageDataUpdate=.1,Pi.prototype.config=function(t){if(!t)return;let e=t.minInterval;"number"==typeof e&&(this._minInterval=e,this._minInterval>this._maxInterval&&(this._maxInterval=this._minInterval)),e=t.maxInterval,"number"==typeof e&&(this._maxInterval=e,this._minInterval>this._maxInterval&&(this._minInterval=this._maxInterval)),e=t.percentageDataUpdate,"number"==typeof e&&(this._percentageDataUpdate=e/100)},Pi.prototype.setUpdateInterval=function(t,e){"number"==typeof t&&(this._minInterval=t),"number"==typeof e&&(this._maxInterval=e)},Pi.prototype.setPercentageDataUpdate=function(t){"number"==typeof t&&(this._percentageDataUpdate=Math.round(t/100))},Pi.prototype.setSeed=function(t){this._dataGen.setSeed(t)},Pi.prototype.addRic=function(t,e){return this._addSymbol(t,!1,e)},Pi.prototype.addChain=function(t,e){return this._addSymbol(t,!0,e)},Pi.prototype.addFields=function(t){if(!t)return;"string"==typeof t&&(t=[t]);let e=t.length;for(let i=0;i<e;++i)this._fields[t[i]]=!0},Pi.prototype.removeSubscription=function(t){let e=this._subMap[t];if(e&&(this._dispatch("subscriptionRemoved",{subs:[e]}),delete this._subMap[t],this._dataMap.removeItem(e.ric,e),e.chain)){let t=e.children,i=t.length;for(let n=0;n<i;++n){let i=t[n];this._dataMap.removeItem(Ai(e,i),i),i.parent=null}e.children=null,e.ricList=null}},Pi.prototype.removeRic=Pi.prototype.removeSubscription,Pi.prototype.removeChain=Pi.prototype.removeSubscription,Pi.prototype.removeAllSubscriptions=function(){let t=this._working;if(this.stop(),this._hasListener("subscriptionRemoved")){let t=[];for(let e in this._subMap)t.push(this._subMap[e]);t.length>0&&this._dispatch("subscriptionRemoved",{subs:t})}this._subMap={},this._dataMap.removeAllItems(),t&&this.start()},Pi.prototype.removeFields=function(t){"string"==typeof t&&(t=[t]);let e=t.length;for(let i=0;i<e;++i){let e=t[i];this._fields[e]&&delete this._fields[e]}},Pi.prototype.removeAllFields=function(){let t=!1;for(let e in this._fields){t=!0;break}t&&(this._fields={})},Pi.prototype.start=function(){this._working=!0,this._connect()},Pi.prototype.stop=function(){this._working=!1,this._timerId&&(window.clearTimeout(this._timerId),this._timerId=0)},Pi.prototype.dispose=function(){this.stop(),this._subMap=null,this._dataMap&&(this._dataMap.removeAllItems(),this._dataMap=null),this._fields=null,this._events=null},Pi.prototype.addEventListener=function(t,e){if(!e)return;let i=this._events[t];i?i.indexOf(e)<0&&i.push(e):this._events[t]=[e]},Pi.prototype.removeEventListener=function(t,e){let i=this._events?this._events[t]:null;if(!i)return;let n=i.indexOf(e);n>=0&&i.splice(n,1)},Pi.prototype.removeAllEventListeners=function(){this._events={}},Pi.prototype.getSubscription=function(t){return this._subMap[t]||null},Pi.prototype.getRic=function(t){let e=this._subMap[t];return e?e.ric:""},Pi.prototype.getAllFields=function(){return this._fields},Pi.prototype.hasField=function(t){return this._fields[t]||!1},Pi.prototype.filter=function(t,e){return this};let zi=function(t,e){for(let i in t)e[i]=t[i];return e};Pi.prototype._addSymbol=function(t,e,i){if(!t)return null;if(i||0===i)i+="";else do{i="_"+this._runningSubId+++"_"}while(this._subMap[i]);if(this._subMap[i])return window.console.log("WARNING: Cannot add ric with duplicate id"),null;e&&(t=t.replace("0#",""));let n={};n.ric=t,n.chain=e,n.id=i,n.dataId=i+t,this._subMap[i]=n,this._dataMap.addItem(t,n);let o=this._dataMap.getItems(t),r=o.length;this._dispatch("subscriptionAdded",{subs:[n]});let s,l=null,a=0;if(e)if(1===r)for(n.children=[],a=Pi.simpleDigest(t)%10+4,s=0;s<a;++s)l={},l.ric="Child_"+String.fromCharCode(65+s),l.id=i,l.dataId=i+l.ric,l.parent=n,n.children.push(l),l.CHILD_ORDER=s,this._dataMap.addItem(Ai(n,l),l);else{let t=o[0].children;for(a=t.length,n.children=new Array(a),s=0;s<a;++s)l={},l.ric=t[s].ric,l.id=i,l.dataId=i+l.ric,l.parent=n,n.children[s]=l,this._dataMap.addItem(Ai(n,l),l)}return r>1&&this._working&&setTimeout(this._updateDuplicateSymbol.bind(this,t),10),this._connect(),i},Pi.simpleDigest=function(t){let e=t.length,i=0;for(let n=0;n<e;++n)i+=t.charCodeAt(n);return i},Pi.prototype._connect=function(){if(this._working&&!this._timerId){let t=this._dataGen.randInt(this._minInterval,this._maxInterval);this._timerId=window.setTimeout(this._onSubscriptionResponse,t)}},Pi.prototype._onSubscriptionResponse=function(){this._timerId=0;let t=this._dataMap.getAllKeys(),e=t?t.length:0;if(!e)return void this._connect();let i=(this._percentageDataUpdate-.02)*e;i=i>0?i:1;let n=(this._percentageDataUpdate+.02)*e;n=n<e?n:e;let o=this._dataGen.randInt(i,n),r=this._fields;for(let i=0;i<o;i++){let i,n,o,s=t[this._dataGen.randIndex(e)],l=this._dataMap.getItems(s),a=l[0],u=a.parent,h=this._dataGen.randBoolean();if(Li(s)&&u&&h){let t=u.children;t=Ti(t);let e=t.length,s=t.indexOf(a);for(a.CHILD_ORDER=s,i=this._generateQuoteData(a,r),o=l.length,n=0;n<o;++n){for(let o=0;o<e;o++){let e=t[o];if(l[n]===e)i.CHILD_ORDER=e.CHILD_ORDER,this._dispatchDataChanged(l[n],i);else{let t=e.CHILD_ORDER;this._dispatchDataChanged(e,{X_RIC_NAME:e.ric,CHILD_ORDER:t})}}this._dispatchPostUpdate({childOrderChange:!0})}}else for(i=this._generateQuoteData(a,r),o=l.length,n=0;n<o;++n){let t=l[n].CHILD_ORDER;null!=t&&(i.CHILD_ORDER=t),this._dispatchDataChanged(l[n],i)}}this._connect()},Pi.prototype._dispatchPostUpdate=function(t){this._dispatch("postUpdate",t)},Pi.prototype._generateQuoteData=function(t,e){let i=t.ric,n=t.prevData,o={},r={text:i,prefix:t.parent?t.parent.ric:""};for(let t in e){let e=this._dataGen.generateQuoteData(t,r),i=t+"_FORMATTED";if(n){if(e.changeOnly&&n[t]===e.value)continue;n[t]=e.value,n[i]=e.formattedValue}o[t]=e.value,o[i]=e.formattedValue}return null!=o.X_RIC_NAME&&null!=o.INDICATOR&&o.INDICATOR>0&&(o.X_RIC_NAME="/"+o.X_RIC_NAME),o},Pi.prototype._getChildSubByRic=function(t,e){let i=t.children;if(i){let t=i.length;for(let n=0;n<t;++n){let t=i[n];if(t.ric===e)return t}}return null},Pi.prototype._updateDuplicateSymbol=function(t){let e=this._dataMap.getItems(t);if(!e)return;let i=e.length;if(i<2)return;let n,o=e[0],r=o.prevData,s=!!o.chain;if(r)for(n=1;n<i;++n){let t=e[n];t.prevData||this._dispatchDataChanged(t,r)}if(!s)return;let l=o.ricList;if(!l)return;let a=l.length;for(n=1;n<i;++n){let t=e[n],i=t.ricList;for(let e=i?i.length:0;e<a;++e){let i=l[e],n=this._getChildSubByRic(o,i),r=this._getChildSubByRic(t,i);n&&r&&n.prevData&&this._dispatchDataChanged(r,n.prevData)}}},Pi.prototype._dispatchDataChanged=function(t,e){let i=zi(e,{}),n={};n.ric=t.ric,n.values=i,n.subId=t.id;let o=t.prevData;if(!o){o={},t.prevData=o,n.type="statusUpdated",i.STATUS=1,i.STATUS_FORMATTED=this._statusMap[1],i.SUB_ID=t.id,zi(i,o);let e=t.parent;if(e){let i=e.ricList;i||(i=e.ricList=[]),e.ricList.push(t.ric)}}this._dispatch("dataChanged",n)},Pi.prototype.onFeedStatusChanged=function(t,e){return window.setTimeout((function(){e([{key:"Q",name:"IDN_RDF",state:"up"}])}),1e3),this},Pi.prototype._hasListener=function(t){let e=this._events[t];return!!e&&e.length>0},Pi.prototype._dispatch=function(t,e){let i=this._events[t];if(!i)return;let n=i.length;for(let t=0;t<n;++t)i[t](e)},Pi.prototype._subMap=null,Pi.prototype._fields=null,Pi.prototype._events=null,Pi.prototype._working=!1,Pi.prototype._timerId=0,Pi.prototype._runningSubId=0,Pi.prototype._statusMap={0:"PENDING",1:"OK",2:"STALE",3:"INFO",4:"CLOSED",5:"DELAYED",6:"NOPERM",7:"REACHLIMIT",8:"C_COMPLETE",9:"C_CLOSE",10:"C_EMPTY",11:"C_NOTCHAIN",12:"C_ERR",13:"C_NOBEGIN",14:"C_NOEND"};let Vi=function(){this._data={}};Vi.prototype._data=null,Vi.prototype.clear=function(){this._data={}},Vi.prototype.put=function(t,e){t&&(this._data[t]=e)},Vi.prototype.get=function(t){let e=this._data[t];return null!=e?e:""},Vi.prototype.getAllKeys=function(){return Object.keys(this._data)},Vi.prototype.save=function(){},Vi.prototype.filter=function(t){let e=[];if(t)for(let i in this._data){let n=this._data[i];t(n)&&e.push(n)}return e};let ki={"TR.NonExistField":!0,"TR.NotExistField":!0,CF_IGNORE_FIELD:!0};let Oi=new vi,Ni={request:function(t,e){if(e)return Promise.resolve(JSON.stringify(e));let i,n,o,r,s,l,a,u,h,p=[];if("Col,date|,Row,In|,va,T,NoEmptyTickers"===t.output){for(l=t.identifiers,a=t.formula.trim().split(/(?=,TR.)/),u=[],h=ki,i=0;i<a.length;i++)n=a[i],h[n]||u.push(n);let e=u.length;p.push([{h:!0,i:"instrument",v:"Instrument"},{h:!0,i:"date",v:"Date"}]);for(let t=0;t<e;t++){let e,n=u[t],o=/TR.(.*)(?=\()/,r=n.match(o)[0].replace("TR.",""),a=n.toLowerCase(),h=/sdate=(.*)[,]/,d=/edate=(.*)[)]/,c=a.match(h),_=a.match(d),f=c?c[1]:G.format(new Date,"YYYY-MM-DD"),g=_[1];f>g&&(e=f,f=g,g=e);let y=(+new Date(g)-+new Date(f))/864e5;for(i=0;i<=y;i++){let e=new Date(new Date(f).setDate(new Date(f).getDate()+i)),n={h:!0,v:G.format(e,"YYYY-MM-DDT00:00:00")};0===t&&p[0].push(n)}let m=l;for(i=0;i<m.length;i++){let t=[m[i],r];for(s=1;s<=y+1;s++){let e=vi.generateRecord(r);t.push(e[r])}p.push(t)}}}else{for(l=t.identifiers,a=Ni.splitFields(t.formula),u=[],h=ki,i=0;i<a.length;i++)n=a[i],h[n]||u.push(n);for(p[0]=[{h:!0,i:"instrument",v:"Instrument"}],i=0;i<u.length;i++)n=u[i],p[0].push({h:!0,r:n.toUpperCase().trim()});let e={};o=l.length;let s=Oi.generate(u,o);for(i=0;i<o;++i){let t=l[i];r=e[t],r||(r=e[t]=s[i],r.unshift(t)),p.push(r)}if(p.length>0){if(Oi.randInt(1,10)<=3){let t=Oi.randInt(0,p.length-1);r=p[t],o=r.length;let e=new Array(o);for(e[0]=r[0],i=1;i<o;i++)e[i]="";p.splice(t+1,0,e)}}}return Promise.resolve(JSON.stringify({rows:p}))},splitFields:function(t){if(!t)return[];let e=t.split(/,(?![^()]*\))/);return e=e.map((function(t){return t.trim()})),e}},Hi=new vi,Bi={request:function(t,e){if(e)return Promise.resolve(JSON.stringify(e));let i,n,o,r,s=t.instruments,l=t.fields,a=ki;for(l=[],i=0;i<t.fields.length;i++)n=t.fields[i],a[n.name]||l.push(n);let u={};o=s.length;let h=[],p=Hi.generate(l,o);for(i=0;i<o;++i){let t=s[i];r=u[t],r||(r=u[t]=p[i],r.unshift(t)),h.push(r)}if(h.length>0){if(Hi.randInt(1,10)<=3){let t=Hi.randInt(0,h.length-1);r=h[t],o=r.length;let e=new Array(o);for(e[0]=r[0],i=1;i<o;i++)e[i]="";h.splice(t+1,0,e)}}let d=[{displayName:"Instrument"}];for(i=0;i<l.length;i++)n=l[i],d.push({displayName:n.name,field:n.name.toUpperCase()});return Promise.resolve(JSON.stringify({data:h,headers:[d]}))}},Gi=function(t){return"datagrid"===t?Promise.resolve(Bi):"adc"===t?Promise.resolve(Ni):Promise.reject(t+" is not supported.")};Gi.setInvalidFields=function(t){if(t&&"string"==typeof t)ki[t]=!0;else if(Array.isArray(t))for(let e=0;e<t.length;e++)ki[t[e]]=!0};let Wi=function(t){this.Quotes=new Ii,this.Quotes2=new Fi,this.Archive=new Vi,this.ContainerDescription=!0,this.Data=Gi,t&&this.Quotes2.config(t)};Wi.prototype.init=function(t){return t&&this.Quotes2.config(t),this},Wi.prototype.onLoad=function(t){return setTimeout(t,2e3),this},Wi.prototype.navigate=function(t){return this},Wi.prototype.appHit=function(t,e,i){},Wi.prototype.getUserInfo=function(){return Promise.resolve({UUID:"PAXTRA"})},Wi.prototype.contextChange=function(t){};let Ui={"⇧":1,"B⇧":1,"↑":1,"B↑":1,26:1,1:1,'"1"':1,"-1":-1,"⇩":-1,"B⇩":-1,"↓":-1,"B↓":-1,27:-1,2:-1,'"2"':-1},Yi={CF_TICK:1,PRCTCK_1:1,BID_TICK:1,ASK_TICK:1};let qi={"||":1,"&&":2,"<":3,">":3,"<=":3,">=":3,"!=":3,"=":3,"==":3,"===":3,"+":4,"-":4,"*":5,"%":6,"/":6,"!":7,"!!":7},Xi={"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"<":function(t,e){return t<e},">":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"!":function(t,e){return!t},"!!":function(t,e){return!!t}},ji={"+":2,"-":2,"*":2,"/":2,"%":2,"<":2,">":2,"<=":2,">=":2,"==":2,"!=":2,"&&":2,"||":2,"!":1,"!!":1},Ki=function(t,e,i,n){let o={value:e,type:i};return n&&(o.dataType=n),"operator"===i?o.precedence=qi[e]:"parenthesis"===i&&(o.precedence=0),t.push(o),t.length-1},Ji={_tokens:[],_withString:function(t){return" #"+Ki(Ji._tokens,t.substring(1,t.length-1),"literal","string")+"#"},_withField:function(t){return" #"+Ki(Ji._tokens,t,"literal","variable")+"#"},_withFieldInBrackets:function(t){return Ji._withField(t.substring(1,t.length-1))},_withNegativeNumber:function(t){let e=+t;if(e==e){return" #"+Ki(Ji._tokens,e,"literal","number")+"#"}return""},_withPositiveNumber:function(t){return 35===t.charCodeAt(0)?t:Ji._withNegativeNumber(t)},_withOperator:function(t){if(qi[t]){return"="!=t&&"==="!=t||(t="=="),"#"+Ki(Ji._tokens,t,"operator")+"#"}return""},_withParenthesis:function(t){return"#"+Ki(Ji._tokens,t,"parenthesis")+"#"},_tester:function(t){let e=t._rpn,i=e.length,n=0,o=0;for(let t=0;t<i;++t){let i=e[t];if("literal"!==i.type){let t=ji[i.value];if(!(n>=t))return console.warn("Cannot parse an expression with insufficient number of operands"),!0;n-=t}n++,n>o&&(o=n)}return 1!==n||(t._stackSize=o,!1)},_filter:function(t,e){let i,n=t._rpn,o=new Array(t._stackSize),r=n.length,s=0;for(let t=0;t<r;++t){let r=n[t],l=r.value;"literal"===r.type?i="variable"!==r.dataType?l:e?e[l]:null:1===ji[l]?(i=Xi[l](o[s-1]),s-=1):(i=Xi[l](o[s-2],o[s-1]),s-=2),o[s++]=i}return!!o[0]},parse:function(t){if("function"==typeof t)return t;if(!t||"string"!=typeof t)return null;let e=t.trim();if(!e)return null;Ji._tokens.length=0,e=e.replace(/".+?"/g,Ji._withString),e=e.replace(/'.+?'/g,Ji._withString),e=e.replace(/\[.+?\]/g,Ji._withFieldInBrackets),e=e.replace(/-[0-9.]+/g,Ji._withNegativeNumber),e=e.replace(/[0-9.#]+/g,Ji._withPositiveNumber),e=e.replace(/[a-zA-Z_]\w*/g,Ji._withField),e=e.replace(/[\-\/+*%!=<>&|]+/g,Ji._withOperator),e=e.replace(/[()]/g,Ji._withParenthesis);let i=Ji._tokens,n=i.length;if(!n)return null;let o,r,s,l=[],a=e.match(/#[0-9]+#/g);for(o=0;o<n;++o){let t=a[o];if(r=i[+t.substring(1,t.length-1)],s=r.type,"literal"===s){let t=l[l.length-1];if(t&&"literal"===t.type){if(!(r.value<0&&"number"===r.dataType))return console.warn("Cannot parse an expression with insufficient number of operators"),null;Ki(l,"-","operator"),r.value*=-1}}l.push(r)}Ji._tokens.length=0,n=l.length;let u=[],h=[],p=null,d=!1;for(o=0;o<n;++o)if(r=l[o],s=r.type,"literal"===s)u.push(r);else if("parenthesis"===s)if("("===r.value)h.push(r);else{for(d=!1;h.length;){if(p=h.pop(),"("===p.value&&"parenthesis"===p.type){d=!0;break}u.push(p)}d||console.warn("No left parenthesis paired with the right one")}else{for(;h.length&&!(r.precedence>h[h.length-1].precedence);)u.push(h.pop());h.push(r)}for(d=!1;h.length;)p=h.pop(),"("===p.value&&"parenthesis"===p.type?d=!0:u.push(p);if(d&&console.warn("No right parenthesis paired with the left one"),!u.length)return null;let c={_rpn:u};return Ji._tester(c)?null:Ji._filter.bind(null,c)}};let Qi=function(){this._conditions=[],this._scopes=[],Qi._painters.push(this)};Qi.ColoringTypes={TEXT:1,HEATMAP:2,CONDITIONAL:3},Qi.prototype._coloringType=0,Qi.prototype._conditions=null,Qi.prototype._effectiveStyles=null,Qi.prototype._blinkCondition=null,Qi.prototype._scopes,Qi.prototype._columnStats=null,Qi.prototype._levelColorDisabled=!1,Qi.prototype._blinkingDuration=250,Qi._runningBlinkId=0,Qi._painters=[],Qi._emptyAry=[],Qi._emptyObj={},Qi._bgObj={backgroundColor:"",color:""},Qi._colorObj={color:""},Qi.bgStyles=["backgroundColor","color"],Qi.nonBgStyles=["fontSize","fontWeight","fontStyle","textAlign","textDecoration"],Qi.supportedStyles=Qi.bgStyles.concat(Qi.nonBgStyles),Qi.themeReady=null,Qi.parse=Ji.parse,Qi.prototype.dispose=function(){let t=Qi._painters.indexOf(this);t>=0&&Qi._painters.splice(t,1),this.reset(),this._conditions=null,this._scopes.length=0,this._blinkCondition=null},Qi.prototype.reset=function(){this._setColoringType(0);let t=this._scopes.length;if(t){for(let e=0;e<t;++e){let t=this._scopes[e];Qi._clearBlinkTimer(t)&&t._restorer();let i=t.cell;i&&delete i.blinking,t.cell=null}this._scopes.length=0}this._blinkCondition=null},Qi.prototype.resetColoring=function(){this._setColoringType(0),this._effectiveStyles=null,this._conditions.length=0},Qi.prototype.resetBlinking=function(){this._blinkCondition=null,this._scopes.length=0},Qi.prototype.clearBlinking=function(){this._blinkCondition=null;let t=this._scopes.length;if(t){for(let e=0;e<t;++e){let t=this._scopes[e];Qi._clearBlinkTimer(t)&&t._restorer();let i=t.cell;i&&delete i.blinking,t.cell=null}this._scopes.length=0}},Qi.prototype.resetHeatMap=function(){this._conditions.length=0,this._columnStats=null},Qi.prototype.clearHeatMap=function(){return this._blinkCondition?(this._setColoringType(0),this.resetHeatMap(),!1):(this.dispose(),!0)},Qi.prototype.applyThemeColor=function(){let t=E.getColors();if(this._coloringType===Qi.ColoringTypes.HEATMAP){let e=this._conditions[0];if(e&&(e.textMode?e.baseColor=t.baseText:e.baseColor=t.baseGrid,e.useThemeColor)){let i=t.up,n=t.down,o=t.level===t.baseText?"":t.level;Qi._setUpDownColors(e,i,n,o)}}this._blinkCondition&&this._blinkCondition.useThemeColor&&Qi._setUpDownColors(this._blinkCondition,t.up,t.down,t.level,!0)},Qi.prototype.getConditions=function(){return this._conditions},Qi.prototype.getColoringType=function(){return this._coloringType},Qi.prototype._setColoringType=function(t){this._coloringType!==t&&(this._coloringType=t)},Qi.prototype.setEffectiveStyles=function(t){this._effectiveStyles=t},Qi.prototype.getEffectiveStyles=function(){return this._effectiveStyles},Qi.prototype.setConditions=function(t){this._conditions.length=0,this._setColoringType(Qi.ColoringTypes.CONDITIONAL);let e=t.length;for(let i=0;i<e;i++)this._addCondition(t[i])},Qi.prototype.setColumnStats=function(t){this._columnStats=t&&t.getMin?t:null},Qi.prototype.getColumnStats=function(){return this._columnStats},Qi.prototype._addCondition=function(t){let e=t.expression;e&&(t._fn=Ji.parse(e.text||e),this._conditions.push(t))},Qi.prototype.addHeatmap=function(t,e,i,n,o,r){this._setColoringType(Qi.ColoringTypes.HEATMAP);let s={heatmap:!0};return s.field=t,s.expression=Qi._heatMapCondition.bind(s),s.midPoint=e,Qi._setUpDownColors(s,i,n),s.baseColor=o,!0!==r&&"text"!==r||(s.textMode=!0),this._addCondition(s),s},Qi.prototype.addHeatmapWithTheme=function(t,e,i){let n=E.themeColors,o=this.addHeatmap(t,e,n.up,n.down,n.baseGrid,i);return!0!==i&&"text"!==i||(o.baseColor=n.baseText),o.useThemeColor=!0,o},Qi.prototype._addColorText=function(t,e,i,n,o){this._setColoringType(Qi.ColoringTypes.TEXT);let r={};return r.field=e,r.expression=t.bind(null,e),r.upClass=i,r.downClass=n,r.levelClass=o,this._addCondition(r),r},Qi.prototype.addColorText=function(t,e,i,n){return this._addColorText(Yi[t]?Qi._tickColorTextCondition:Qi._colorTextCondition,t,e,i,n)},Qi.prototype.addColorTextWithTheme=function(t){return this.addColorText(t,"positive","negative","neutral")},Qi.prototype.addTickColorText=function(t,e,i){return this.addColorText("CF_TICK",t,e,i)},Qi.prototype.addTickColorTextWithTheme=function(){let t=E.themeColors,e=this.addTickColorText(t.tickUp,t.tickDown,t.level);return e.useThemeColor=!0,e},Qi.prototype.addTickBlink=function(t,e,i,n){return this.addBlink("CF_TICK",t,e,i,n)},Qi.prototype.addTickBlinkWithTheme=function(t){let e=E.themeColors,i=this.addTickBlink(e.tickUp,e.tickDown,e.level,t);return i.useThemeColor=!0,i},Qi.prototype.addBlink=function(t,e,i,n,o){return this._addBlink(Yi[t]?Qi._tickBlinkCondition:Qi._fieldBlinkCondition,t,e,i,n,o)},Qi.prototype.addBlinkWithTheme=function(t,e){let i=E.themeColors,n=this.addBlink(t,i.up,i.down,i.level,e);return n.useThemeColor=!0,n},Qi.prototype._addBlink=function(t,e,i,n,o,r){let s=this._blinkCondition={};return s.blink=!0,s.blinkId=Qi._runningBlinkId++,s.field=e,s._fn=s.expression=t,!0!==r&&"border"!==r||(s.border=!0),Qi._setUpDownColors(s,i,n,o,!0),s},Qi.prototype.renderForPrinting=function(t,e,i,n){if(!t)return;let o=this._getStyles(e,i,n),r=o.cssClass;null!=r?(elem._coloringCssClass&&elem._coloringCssClass!==r&&(elem.classList.remove(elem._coloringCssClass),elem._coloringCssClass=null),r&&(elem.classList.add(r),elem._coloringCssClass=r)):(t._coloringCssClass&&(t.classList.remove(t._coloringCssClass),t._coloringCssClass=null),t.style.backgroundColor=o.backgroundColor||"",t.style.color=o.color||"")},Qi._colorTextCondition=function(t,e){let i=e[t];if(i||0===i){if(i>0)return 1;if(i<0)return-1}return"u"},Qi._tickColorTextCondition=function(t,e){return Ui[e[t]]},Qi._heatMapCondition=function(t,e,i){let n,o=t[this.field],r=o||0===o?o-this.midPoint:NaN;if(0===r||r!=r)return 0;let s=1;return r>0?(s=i-this.midPoint,s<0&&(s=e-this.midPoint)):(s=e-this.midPoint,s>0&&(s=i-this.midPoint)),s<0&&(s=-s),n=r/s,n},Qi._tickBlinkCondition=function(t){return Ui[t]},Qi._fieldBlinkCondition=function(t,e){return t>e?1:t<e?-1:0},Qi._borderRestorer=function(t){t.blinkTimer=0;let e=t.cell.getElement();e&&(e.style.border="")},Qi._cellRestorer=function(t){t.blinkTimer=0;let e=t.cell.getElement();if(e){let i=t.rowData,n=NaN,o=NaN;if(this._coloringType===Qi.ColoringTypes.HEATMAP){let t=this._columnStats;t&&(n=t.getMin(),o=t.getMax())}let r=this._getStyles(i,n,o),s=r.cssClass;null!=s?(e._coloringCssClass&&e._coloringCssClass!==s&&(e.classList.remove(e._coloringCssClass),e._coloringCssClass=null),s&&(e.classList.add(s),e._coloringCssClass=s),e.style.backgroundColor="",e.style.color=""):(e._coloringCssClass&&(e.classList.remove(e._coloringCssClass),e._coloringCssClass=null),e.style.backgroundColor=r.backgroundColor||"",e.style.color=r.color||"")}},Qi.prototype._getStyles=function(t,e,i){if(!t)return Qi._emptyObj;let n=this._conditions.length;for(let o=0;o<n;++o){let n,r=this._conditions[o],s=r._fn;try{n=s&&s(t,e,i)}catch(t){}if(n){if(this._coloringType===Qi.ColoringTypes.HEATMAP){let t;return t=n>0?Qi.blendColor(r.baseColor,r.upColor,n):Qi.blendColor(r.baseColor,r.downColor,-n),r.textMode?(Qi._colorObj.color=Qi.num2Hex(t),Qi._colorObj):(Qi._bgObj.backgroundColor=Qi.num2Hex(t),Qi._bgObj.color=Qi.blackAndWhite(t),Qi._bgObj)}return this._coloringType===Qi.ColoringTypes.TEXT?(r.cssClass=n>0?r.upClass:n<0?r.downClass:this._levelColorDisabled?"":r.levelClass,r.cssClass=r.cssClass||"",r):r}}return Qi._emptyObj},Qi.blendColor=function(t,e,i){i>1?i=1:i<0&&(i=0);let n=Qi.hex2Num(t),o=Qi.hex2Num(e),r=[];for(let t=0;t<3;++t){let e=(o[t]-n[t])*i;r.push(n[t]+e)}return r},Qi.blackAndWhite=function(t){return Math.sqrt(t[0]*t[0]*.241+t[1]*t[1]*.691+t[2]*t[2]*.068)>=135?"#000000":"#FFFFFF"},Qi.rgb2Hex=I,Qi.num2Hex=function(t){return"#"+(16777216+(t[2]|t[1]<<8|t[0]<<16)).toString(16).slice(1)},Qi.num2Rgb=function(t){return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},Qi.hex2Num=function(t){let e=parseInt(t.replace(/[^0-9A-F]/gi,""),16);return[e>>16&255,e>>8&255,255&e]},Qi.hex2Rgb=function(t){if(t){let e=parseInt(t.replace(/[^0-9A-F]/gi,""),16);return"rgb("+(e>>16&255)+", "+(e>>8&255)+", "+(255&e)+")"}return""},Qi.themeChanged=function(){},Qi.setThemeColors=function(){},Qi._onThemeChanged=function(){let t=Qi._painters;for(let e=t.length;--e>=0;)t[e].applyThemeColor()},Qi.loadThemeColors=function(){return Qi.themeReady||(Qi.themeReady=E.getThemeColors(Qi._onThemeChanged).then(Qi._onThemeChanged).catch(Qi._onThemeChanged)),Qi.themeReady},Qi.reloadThemeColors=function(){return Qi.themeReady=E.reloadThemeColors().then(Qi._onThemeChanged).catch(Qi._onThemeChanged),Qi.themeReady},Qi.clearCellStyle=function(t,e){let i=t.getElement();if(!i)return;let n=t.blinking;if(n&&(Qi._clearBlinkTimer(n),delete t.blinking,n.cell=null),i._coloringCssClass&&i.classList.remove(i._coloringCssClass),e||(e=Qi.supportedStyles),Array.isArray(e))for(let t=e.length;--t>=0;)i.style[e[t]]="";else for(let t in e)i.style[t]=""},Qi._setUpDownColors=function(t,e,i,n,o){t.upColor=e,null!=e&&o&&(t.contrastUpColor=Qi.getOppositeColor(e)),t.downColor=i,null!=i&&o&&(t.contrastDownColor=Qi.getOppositeColor(i)),t.levelColor=n,null!=n&&o&&(t.contrastLevelColor=Qi.getOppositeColor(n))},Qi._clearBlinkTimer=function(t,e){return!!t.blinkTimer&&(clearTimeout(t.blinkTimer),t.blinkTimer=0,!0)},Qi.getOppositeColor=function(t){if("string"==typeof t){if("#"===t.charAt(0)){let e=Qi.hex2Num(t);return Qi.blackAndWhite(e)}}else if(Array.isArray(t))return Qi.blackAndWhite(t);return""},Qi.prototype.render=function(t,e,i,n,o){null!=i&&i==i?this._paintCell(t,e,i,n):this._conditions.length&&this._coloringType===Qi.ColoringTypes.CONDITIONAL&&this._paintCell(t,e)},Qi.prototype.renderHeatMap=function(t,e,i,n){this._paintCell(t,e,i,n)},Qi.prototype.renderColoring=function(t,e){this._paintCell(t,e)},Qi.prototype._paintCell=function(t,e,i,n){if(!t)return;let o=t.getElement();if(!o)return;let r,s=this._blinkCondition;if(s&&(r=t.blinking,r&&r.blinkTimer&&!s.border))return;let l=this._getStyles(e,i,n),a=o.style,u=l.cssClass;o._coloringCssClass&&o._coloringCssClass!==u&&(o.classList.remove(o._coloringCssClass),o._coloringCssClass=null),null!=u?u&&(o.classList.add(u),o._coloringCssClass=u):(l.backgroundColor?a.backgroundColor=l.backgroundColor:this._effectiveStyles&&!this._effectiveStyles.backgroundColor||(a.backgroundColor=""),l.color?a.color=l.color:this._effectiveStyles&&!this._effectiveStyles.color||(a.color=""))},Qi.prototype.blink=function(t,e,i){this._blinkCell(t,i,e)},Qi.prototype.blinkCell=function(t,e,i,n){if(!this._blinkCondition)return!1;let o=this._blinkCondition._fn(e,i);return this._blinkCell(t,n,o)},Qi.prototype._blinkCell=function(t,e,i){if(!t)return!1;if(this._levelColorDisabled&&!i)return!1;let n=t.getElement();if(!n)return!1;let o=this._blinkCondition;if(!o)return!1;let r,s,l=t.blinking;if(l||(l={},l.cell=t,t.blinking=l,this._scopes.push(l)),l.blinkId!==o.blinkId){l.blinkId=o.blinkId,l.field=o.field;let t=o.border?Qi._borderRestorer:Qi._cellRestorer;l._restorer=t.bind(this,l)}l.rowData=e,i>0?(r=o.upColor,s=o.contrastUpColor):i<0?(r=o.downColor,s=o.contrastDownColor):(r=o.levelColor,s=o.contrastLevelColor);let a=!0;return o.border?(n.style.border="1px solid "+r,a=!1):(n.style.backgroundColor=r,n.style.color=s),Qi._clearBlinkTimer(l),l.blinkTimer=setTimeout(l._restorer,this._blinkingDuration),a},Qi.prototype.verifyBlinking=function(t,e){let i=t.blinking;i&&i.blinkTimer&&i.rowData!==e&&(i.rowData=e,Qi._clearBlinkTimer(i)&&i._restorer())},Qi.prototype.disableLevelColor=function(t){this._levelColorDisabled=!1!==t},Qi.prototype.setBlinkingDuration=function(t){"number"==typeof t&&(this._blinkingDuration=t)};if(window){var Zi=window.tr;Zi||(Zi=window.tr={});var $i=Zi.rt;$i||($i=Zi.rt={});var tn=Zi.grid;tn||(tn=Zi.grid={}),Zi.MockJET||(Zi.MockJET=Wi),Zi.closestElement||(Zi.closestElement=o.closestElement),Zi.CellPainter||(Zi.CellPainter=Qi),$i.Grid||($i.Grid=ni),tn.CellPainter||(tn.CellPainter=Qi)}e.default=ni}]);