text: /*
  @license
  
  dhtmlxPivot v.1.2.0 Trial
  This software is covered by DHTMLX Evaluation License. Contact sales@dhtmlx.com to get Commercial or Enterprise license. Usage without proper license is prohibited.
  
  (c) Dinamenta, UAB.
  */
  !function(t){function e(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var i={};e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,r){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/codebase/",e(e.s=66)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toNode=function(t){return"string"==typeof t&&(t=document.getElementById(t)||document.querySelector(t)),t||document.body},e.insert=function(t,e){return"string"==typeof e?(t.insertAdjacentHTML("beforeend",e),t.lastChild):(t.appendChild(e),e)},e.remove=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},e.children=function(t,e){for(var i=[],r=t.childNodes,n=0;n<r.length;++n){var o=r[n];0===o.className.indexOf(e)&&i.push(o)}return i},e.locate=function(t,e){void 0===e&&(e="dhx_id");for(var i=t.target;i&&i.getAttribute;){var r=i.getAttribute(e);if(r)return r;i=i.parentNode}},e.addCss=function(t,e){t.classList.add(e)},e.removeCss=function(t,e){t.classList.remove(e)},e.getCoords=function(t){var e=t.getBoundingClientRect(),i=document.body,r=window.pageYOffset||i.scrollTop,n=window.pageXOffset||i.scrollLeft;return{top:e.top+r,left:e.left+n,right:i.offsetWidth-e.right,bottom:i.offsetHeight-e.bottom,width:e.right-e.left,height:e.bottom-e.top}},e.isNested=function(t,e){for(;t&&e;){if(e===t)return!0;t=t.parentNode}return!1};var r=-1;e.getScrollbarWidth=function(){if(r>-1)return r;var t=document.createElement("div");return document.body.appendChild(t),t.style.cssText="position: absolute;left: -99999px;overflow:scroll;width: 100px;height: 100px;",r=t.offsetWidth-t.clientWidth,document.body.removeChild(t),r}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={availableFields:"available fields",values:"data",columns:"columns",rows:"rows",moveFieldsHere:"MOVE FIELDS HERE",hideSettings:"Hide Settings",showSettings:"Show Settings",apply:"Apply",day:"Day",week:"Week",month:"Month",quarter:"Quarter",year:"Year",min:"Min",max:"Max",sum:"Sum",count:"Count",equal:"Equal",notEqual:"Not Equal",contains:"Contains",notContains:"Not Contains",typeHere:"Type Here",selectAll:"Select All",unselectAll:"Unselect All",cancel:"Cancel",ok:"Ok",date:{month_full:["January","February","March","April","May","June","July","August","September","October","November","December"],month_short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],day_full:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],day_short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],quarter:["Q1","Q2","Q3","Q4"],week:"W"}}},,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arrayFind=function(t,e){for(var i=0;i<t.length;i++)if("object"==typeof t[i]){var r=t[i];for(var n in r)if(r[n]===e)return t[i]}else if(t[i]===e)return t[i];return null}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(15),n=i(16),o=i(17);e.isEqualObj=function(t,e){for(var i in t)if(t[i]!==e[i])return!1;return!0},e.naturalCompare=function(t,e){var i=[],r=[];for(t.replace(/(\d+)|(\D+)/g,function(t,e,r){i.push([e||1/0,r||""])}),e.replace(/(\d+)|(\D+)/g,function(t,e,i){r.push([e||1/0,i||""])});i.length&&r.length;){var n=i.shift(),o=r.shift(),s=n[0]-o[0]||n[1].localeCompare(o[1]);if(s)return s}return i.length-r.length},e.findByConf=function(t,e){if(e.rule&&"function"==typeof e.rule){if(e.rule.call(this,t))return t}else if(e.by&&e.match&&t[e.by]===e.match)return t},e.isDebug=function(){var t=window.dhx;if(void 0!==t)return void 0!==t.debug&&t.debug},e.dhxWarning=function(t){console.warn(t)},e.dhxError=function(t){throw new Error(t)},e.toProxy=function(t){var e=typeof t;return"string"===e?new r.DataProxy(t):"object"===e?t:void 0},e.toDataDriver=function(t){if("string"==typeof t)switch(t){case"csv":return new n.CsvDriver;case"json":return new o.JsonDriver;default:console.warn("incorrect driver type",t)}else if("object"==typeof t)return t}},,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),n=i(21),o=i(7),s=i(1),a=function(){function t(t,e,i){this.cont=e,this.root=t,this._field=i,this.init(i),this._items=[],this.multifields={values:!0}}return t.prototype.init=function(t){this.ui=r.insert(this.cont,'<div class="dhx_config_field"></div>'),this.ui._dropTarget=this,this.header=r.insert(this.ui,'<div class="dhx_field_header"><div class="field_name">'+s.default[t]+'</div><div class="field_helper">'+s.default.moveFieldsHere+"</div></div>"),this.$content=r.insert(this.ui,'<div class="dhx_field_content"></div>')},t.prototype.getName=function(){return this._field},t.prototype.addItem=function(t){(-1===this.getItemsId().indexOf(t.id)||this.multifields[this._field])&&(t.type&&"date"===t.type&&!this.multifields[this._field]?this._items.push(new n.DateItem(this.root,this,this.$content,t,this._field)):this._items.push(new o.Item(this.root,this,this.$content,t,this._field)))},t.prototype.removeItem=function(t,e){this.root.addFreeItem(t),this._items.splice(this.getItemsUid().indexOf(e),1),this.root.config.layout&&this.root.config.layout.fieldsCloseBtn&&this.root.refresh()},t.prototype.moveItem=function(t,e){var i=this.getItemsUid();-1!==i.indexOf(e)&&this._items.splice(i.indexOf(t),0,this._items.splice(i.indexOf(e),1)[0])},t.prototype.getConfig=function(){return this._items.map(function(t){return t.getObject()})},t.prototype.getItemsId=function(){return this._items.map(function(t){return t.getObject().id})},t.prototype.getItemsUid=function(){return this._items.map(function(t){return t.uid})},t.prototype.getItemByUid=function(t){return this._items.filter(function(e){return e.uid===t})[0]},t}();e.DropZone=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(10),n=i(3),o=i(0),s=function(){function t(t,e,i,n,o){this.obj=r.extend({},n),this.cont=i,this.configModule=t,this.root=e,this._isCloseBtn=!1,this.configModule.config.layout&&this.configModule.config.layout.fieldsCloseBtn&&(this._isCloseBtn=!0),this._field=o,this.init(this.obj,this._field),this._addEventHandlers(),this.uid=r.uid()}return t.prototype.init=function(t,e){var i=this.$getPropetry(t,e),r="",n="";i&&(n='<div class="dhx_config_select">'+this.$getPropertyTpl(i.label)+"</div>"),e&&this._isCloseBtn&&(r='<div class="dhx_close">\n\t\t\t<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>\n\t\t\t</div>');var s='<div class="dhx_config_item">\n\t\t\t\t\t\t<div class="item_body" dhx_id="itemBody">\n\t\t\t\t\t\t\t'+r+"\n\t\t\t\t\t\t\t"+this._getFilterTpl()+'\n\t\t\t\t\t\t\t<div class="item_content">'+t.label+"</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t"+n+"\n\t\t\t\t\t</div>";this.ui=o.insert(this.cont,s),this.ui._obj=this,this.$property=this.ui.querySelector(".dhx_config_select"),this.$closeBtn=this.ui.querySelector(".dhx_close"),this._filterBtn=this.ui.querySelector(".dhx_item_filter"),this._body=this.ui.querySelector(".item_body")},t.prototype.getFieldName=function(){return this._field},t.prototype.getObject=function(){return this.obj},t.prototype.$toggleSelect=function(){for(var t=this.configModule.getTypes().operations,e=t[0],i=0;i<t.length;i++)if(t[i].id===this.obj.method){if(!t[i+1]){e=t[0];break}e=t[i+1]}this.obj.method=e.id,this.$property.innerHTML=this.$getPropertyTpl(e.label),this.configModule.onConfigChange()},t.prototype.$getPropetry=function(t,e){var i={values:this.configModule.getTypes().operations};return!!i[e]&&(t.method=t.method||i[e][0].id,n.arrayFind(i[e],t.method)?n.arrayFind(i[e],t.method):i[e][0])},t.prototype.$getPropertyTpl=function(t){return'<span class="select_text">'+t+'</span>\n\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z"/></svg>\n\t\t'},t.prototype._getFilterTpl=function(){return this.configModule.config.layout&&!1!==this.configModule.config.layout.showFilters?'<div class="dhx_item_filter '+(this.obj.$filter?"dhx_item_filter--active":"")+'"></div>':""},t.prototype._addEventHandlers=function(){var t=this;this.ui.addEventListener("click",function(e){if(1!==e.which)return!1;var i=e.target;o.isNested(i,t.$closeBtn)?(t.root.removeItem(t.obj.id,t.uid),t.configModule.onItemClick(t.obj,t.ui,"close"),o.remove(t.ui)):o.isNested(i,t._body)?t.configModule.onItemClick(t.obj,t.ui,"filter"):o.isNested(i,t.$property)&&(t.configModule.onItemClick(t.obj,t.ui,"select"),t.$toggleSelect())},!1),this.ui.addEventListener("mousedown",function(e){if(1!==e.which)return!1;o.isNested(e.target,t.ui)&&t.configModule.startDrag(e,t.ui)})},t}();e.Item=s},function(t,e,i){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),n=this&&this.__assign||Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++){e=arguments[i];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};Object.defineProperty(e,"__esModule",{value:!0});var o=i(27),s=i(0),a=i(34),h=i(1),l=function(t){function e(e,i){var r=t.call(this,e)||this;r._domEvents={};return r.config=n({},{width:330,height:370},e),r._init(i),r}return r(e,t),e.prototype.setFilter=function(t){this.meta=t,this.meta.values=this.meta.values||[],this._state=n({},this._state,this.meta),this._state.values=this.meta.values.slice()},e.prototype.setOptions=function(t){this._options=o.naturalSort(t)||[]},e.prototype.getFilter=function(){return this.meta},e.prototype.isActive=function(){return this._state.values.length>0},e.prototype._init=function(t){var e=this;this._operations={string:{ct:{name:h.default.contains,handler:function(t,e){return new RegExp("^"+e,"i").test(t)}},nct:{name:h.default.notContains,handler:function(t,e){return!new RegExp("^"+e,"i").test(t)}},eq:{name:h.default.equal,handler:function(t,e){return t===e}},neq:{name:h.default.notEqual,handler:function(t,e){return t!==e}}},number:{lt:{name:"<",handler:function(t,e){return t<e}},gt:{name:">",handler:function(t,e){return t>e}},leq:{name:"<=",handler:function(t,e){return t<=e}},geq:{name:">=",handler:function(t,e){return t>=e}},eq:{name:"=",handler:function(t,e){return t==e}},neq:{name:"<>",handler:function(t,e){return t!=e}}}};var i={type:t.type||"string",operation:"string"===t.type?"ct":"lt",value:null,values:[]};this._state=this._state||i,this.attachEvent("onAfterFill",function(){e._filterDom.querySelector("[dhx_id='filterInput']").focus()})},e.prototype._getContent=function(){return'<div class="dhx_filter">\n\t\t'+this._getInputHTML()+'\n\t\t<div class="dhx_filter_content">\n\t\t\t<div class="dhx_filter_selectAll" dhx_id="selectAll"></div>\n\t\t\t<div class="dhx_list" dhx_id="list">\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="dhx_filter_btns">\n\t\t\t<button class="dhx_btn dhx_btn--flat" dhx_id="hide">'+h.default.cancel+'</button>\n\t\t\t<button class="dhx_btn dhx_btn--active" dhx_id="apply">'+h.default.ok+"</button>\n\t\t</div>\n\t</div>"},e.prototype._setHandlers=function(){var t=this;this.addDomEvent("mouseup"),this.addDomEvent("mousedown"),this.addDomEvent("input"),this.addDomEvent("change"),this.attachEvent("onDomEvent",function(e,i){if("mouseup"===e){if(1!==i.which)return!1;var r=s.locate(i);"hide"===r&&t.hide(),"apply"===r&&t._onApply(),"selectAll"===r&&(t._checkAll(),t._updateSelectState())}"change"===e&&s.locate(i,"dhx_list_item")&&t._check(i.target)}),this.attachEvent("onClickOutside",function(){t._onApply()})},e.prototype._check=function(t){var e=isNaN(t.value)?t.value:parseFloat(t.value),i=this._state.values.indexOf(e);i>-1||!t.checked?this._state.values.splice(i,1):this._state.values.push(e),this._updateSelectState()},e.prototype._setMetaInfo=function(){var t=this._options.length===this._state.values.length;this.meta={values:t?[]:this._state.values.slice(),filter:this._state.filter,operation:this._state.operation}},e.prototype._onApply=function(){this.callEvent("onBeforeApply",[])&&(this._setMetaInfo(),this.hide(),this.callEvent("onAfterApply",[]))},e.prototype._updateSelectState=function(){var t=this._state.values.length;this._filterDom.querySelector("[dhx_id='selectAll']").innerHTML=t?h.default.unselectAll:h.default.selectAll},e.prototype._checkAll=function(){for(var t=this._listDom.querySelectorAll(".dhx_list_item"),e=this._state.values.length,i=0,r=t;i<r.length;i++){var n=r[i].querySelector("input");n.checked=!e,this._check(n)}},e.prototype._fill=function(){this._filterDom=this._popup.querySelector(".dhx_filter"),this._listDom=this._filterDom.querySelector("[dhx_id='list']"),this._renderList(),this.callEvent("onAfterFill",[])},e.prototype._getOptions=function(){for(var t="",e=this._getFilteredOptions(),i=0;i<e.length;i++){var r=e[i];null!==r&&(t+='<div class="dhx_list_item" dhx_list_item="'+i+'">\n\t\t\t\t<label class="dhx_checkbox">\n\t\t\t\t\t<input type="checkbox" '+(this._state.values.indexOf(r)>-1?"checked":"")+' value="'+r+'" dhx_list_item>\n\t\t\t\t\t<span class="dhx_checkbox_icon"></span>\n\t\t\t\t\t<span class="dhx_checkbox_label">'+r+"</span>\n\t\t\t\t</label>\n\t\t\t\t</div>")}return t},e.prototype._renderList=function(){this._listDom.innerHTML=this._getOptions(),this._state.values.length||this._checkAll(),this._updateSelectState()},e.prototype._validateInput=function(t){if(!t)return!0;switch(this._state.type){case"string":return!0;case"number":return!isNaN(parseFloat(t))}},e.prototype._getOperations=function(){var t=this._state.operation,e=this._operations[this._state.type],i="";for(var r in e)i+='<option value="'+r+'" '+(r===t?"selected":"")+" >"+e[r].name+"</option>";return i},e.prototype._checkFilterText=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];t.target.value=t.target.value.trim(),this._validateInput(t.target.value)?(t.target.classList.remove("dhx_alert"),this._state.filter=t.target.value,this._state.values=[],this._renderList()):t.target.classList.add("dhx_alert")},e.prototype._getInputHTML=function(){var t=this;return this.attachEvent("onDomEvent",function(e,i){if("input"===e){if(!s.isNested(i.target,t._popup))return;var r=s.locate(i);"filterInput"===r&&(t._inputTimeout&&(clearTimeout(t._inputTimeout),t._inputTimeout=null),t._inputTimeout=setTimeout(function(){return t._checkFilterText(i)},500)),"operations"===r&&(t._state.operation=i.target.value,t._state.values=[],t._renderList())}}),'<div class="dhx_filter_field">\n\t\t\t<div class="dhx_field_select">\n\t\t\t\t<select name="" id="" dhx_id="operations">\n\t\t\t\t\t'+this._getOperations()+'\n\t\t\t\t</select>\n\t\t\t</div>\n\t\t\t<div class="dhx_field_input">\n\t\t\t\t<input value="'+(this._state.filter||"")+'" class="dhx_field_input" placeholder="'+h.default.typeHere+'" type="text" dhx_id="filterInput">\n\t\t\t</div>\n\t\t</div>'},e.prototype._getFilteredOptions=function(){var t=this,e=this._operations[this._state.type];if(this._state.filter){var i=e[this._state.operation].handler;return this._options.filter(function(e){return i(e,t._state.filter)})}return this._options},e}(a.Popup);e.Filter=l},,function(t,e,i){"use strict";function r(t){if(!(t instanceof Object))return t;var e,i=t.constructor;switch(i){case RegExp:e=new i(t);break;case Date:e=new i(t.getTime());break;default:e=new i}for(var n in t)e[n]=r(t[n]);return e}Object.defineProperty(e,"__esModule",{value:!0}),e.extend=function(t,e){t=t||{};for(var i in e)void 0===t[i]&&(t[i]=e[i]);return t};var n=(new Date).valueOf();e.uid=function(){return"u"+n++},e.copy=r},function(t,e,i){"use strict";function r(t,e){e=n({},{css:"",styles:"",args:""},e);var i=(""+t).replace(/<[^>]*>/g,"").replace(/[\"]/g,"&quot;");return'<div class="'+e.css.trim()+'" style="'+e.styles.trim()+'" title="'+i+'" '+e.args.trim()+">"+t+"</div>"}var n=this&&this.__assign||Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++){e=arguments[i];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};Object.defineProperty(e,"__esModule",{value:!0});var o=i(0);e.getCellHTML=r;var s=function(){function t(t,e,i){this._root=t,this.$container=e,this._config=i,this._headerLevel=i.headerLevel,this._oldPositions={xStart:-1,yStart:-1},this._rowHeight=40,this._scrollbarWidth=o.getScrollbarWidth(),this._totalHeight=0,this._totalWidth=i.totalWidth,this._init()}return t.prototype.getContainerSizes=function(){return{scrollTop:this._scrollCont.scrollTop,scrollLeft:this._scrollCont.scrollLeft,scrollWidth:this._scrollCont.scrollWidth,offsetWidth:this._scrollCont.offsetWidth,clientWidth:this._scrollCont.clientWidth}},t.prototype.insert=function(t,e,i){this._totalHeight=e.length*this._rowHeight,this._scroll.style.height=this._totalHeight+"px";var r=this._scrollCont.scrollLeft;this._oldPositions.xStart!==t.xStart&&this._insertHeader(t.xStart,t.xEnd,i),this._insertCells(t,e,i),r&&this._moveLastCells(i)},t.prototype.getContent=function(){return this._content},t.prototype.destructor=function(){o.remove(this._content),this._root=this.$container=this._config=this._headerLevel=null},t.prototype.resize=function(){this._oldPositions={xStart:-1,yStart:-1};var t=this.$getSize();this.$setSize(t.w,t.h)},t.prototype._init=function(){this.$fill(),this.resize()},t.prototype.$fill=function(){this.$container.innerHTML="",this.view=o.insert(this.$container,this.$toHTML()),this._content=this.view.childNodes[0],this._header=this._content.querySelector(".dhx_grid_header"),this._headerWrap=this._content.querySelector(".dhx_header_wrapper"),this._dataBody=this._content.querySelector(".dhx_grid_body"),this._scrollCont=this._dataBody.childNodes[0],this._dataCont=this._content.querySelector(".dhx_grid_data"),this._scroll=this._content.querySelector(".dhx_grid_scroll"),this._abs=this._content.querySelector(".dhx_abs_cont")},t.prototype.$getSize=function(){return{w:this.$container.clientWidth,h:this.$container.clientHeight}},t.prototype.$setSize=function(t,e){var i=this._config.headerRowHeight;i*=this._headerLevel,this._headerWrap.style.height=i+"px",this.view.style.width=t+"px",this.view.style.height=e+"px";var r=e-2-(this._headerWrap.offsetHeight||0);this._scrollCont.style.height=r+"px",this._scrollCont.style.width=t-2+"px",this._scroll.style.height=this._totalHeight+"px",this._scroll.style.width=this._totalWidth+"px";var n=this._scrollCont;this._dataCont.style.width=this._abs.style.width=n.offsetWidth-this._scrollbarWidth+"px",this._dataCont.style.height=this._abs.style.height=r-this._scrollbarWidth+"px",this._header.style.width=this._abs.offsetWidth+"px",this._headerWrap.style.width=this._abs.offsetWidth+"px";var o=this._dataCont.offsetHeight;this._rowsPerPage=Math.floor(o/this._rowHeight),this._root.onFill(this._rowsPerPage,this._scrollCont)},t.prototype.$toHTML=function(){return"<div class='dhx_grid'>\n\t\t\t<div class='dhx_grid_content'>\n\t\t\t\t<div class=\"dhx_header_wrapper\"><div class='dhx_grid_header'></div><div class=\"dhx_header_spans\"></div></div>\n\t\t\t\t<div class='dhx_grid_body'><div class='dhx_grid_data-wrapper'>\n\t\t\t\t\t\t<div class=\"dhx_abs_cont\">\n\t\t\t\t\t\t\t<div class='dhx_grid_data'>Loading...</div>\n\t\t\t\t\t\t\t<div class='dhx_grid_spans'> </div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class='dhx_grid_scroll'></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>".replace(/[\t\n\r]/g,"")},t.prototype._insertCells=function(t,e,i){this._columns=i;var n=this._oldPositions.xStart,o=this._oldPositions.yStart;n===t.xStart?o===t.yStart||o!==t.yStart&&(this._oldPositions.yStart=t.yStart):n!==t.xStart&&(this._oldPositions.xStart=t.xStart);for(var s=this._rowHeight,a=[],h=t.yStart;h<=t.yEnd;h++)if(e[h]){var l=(t.yEnd-t.yStart+1)*this._rowHeight,d=this._dataCont.offsetHeight-l;this._scrollCont.style.overflow="scroll",this._dataCont.offsetHeight+this._scrollCont.scrollTop===this._scrollCont.scrollHeight?d<0&&(this._dataCont.style.top=d+"px",this._dataCont.style.overflow="visible"):(this._dataCont.style.top="0px",this._dataCont.style.overflow="hidden");for(var u="",c=t.xStart;c<=t.xEnd&&this._columns[c];c++){var p=this._columns[c].id,f=this._columns[c].width,_=null!==e[h][p]?e[h][p]:"",g={css:"dhx_grid_col ",styles:"\n\t\t\t\t\twidth:"+f+"px;\n\t\t\t\t\tline-height:"+s+"px\n\t\t\t\t\t"};this._columns[c].cellCss&&this._columns[c].cellCss[h]&&(g.css+=this._columns[c].cellCss[h]),u+=r(_,g)}var v="<div class='dhx_grid_row' style=\"height:"+s+'px">'+u+"</div>";a.push(v)}this._dataCont.innerHTML=a.join("")},t.prototype._insertHeader=function(t,e,i){for(var n=this._headerLevel,o=this._config.headerRowHeight,s="",a=0;a<n;a++){for(var h="",l=t;l<=e;l++)if(i[l]){var d=i[l].width,u=(i[l].header[a]||{text:""}).text||"",c={css:"dhx_grid_hcoll ",styles:"\n\t\t\t\t\twidth:"+d+"px;\n\t\t\t\t\tline-height:"+o+"px\n\t\t\t\t\t",args:"dhx_col="+i[l].id};this._config.sortColumn&&i[l].id==this._config.sortColumn&&a===n-1&&(c.css+=" dhx_sort dhx_sort--"+(this._config.sortDir||"asc")),0!==l&&""!==u||(c.css+=" dhx_cell_first",c.args=""),h+=r(u,c)}s+=' <div class="dhx_hrow" style="height:'+o+'px">'+h+"</div>"}this._header.innerHTML=""+s},t.prototype._moveLastCells=function(t){var e=this._scrollCont,i=this._header,r=this._content.querySelectorAll(".dhx_grid_row"),n=t[t.length-1].width;if(e.scrollWidth-e.scrollLeft-e.clientWidth<=3){i.scrollLeft=n;for(o=0;o<r.length;o++)r[o].scrollLeft=n}else{i.scrollLeft=0;for(var o=0;o<r.length;o++)r[o].scrollLeft=0}},t}();e.Renderer=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),n=function(){function t(){this.custom={},this.locale={};try{if(!dhx.i18n.pivot.date)throw new Error;this.locale.date=dhx.i18n.pivot.date}catch(t){this.locale.date=r.default.date}this.startOnMonday=!0,this._len={year:31471200,month:2635200,day:86400,hour:3600,minute:60,second:1}}return t.prototype.date_part=function(t){var e=new Date(t);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t.getHours()&&(t.getDate()<e.getDate()||t.getMonth()<e.getMonth()||t.getFullYear()<e.getFullYear())&&t.setTime(t.getTime()+36e5*(24-t.getHours())),t},t.prototype.time_part=function(t){return(t.valueOf()/1e3-60*t.getTimezoneOffset())%86400},t.prototype.week_start=function(t){var e=t.getDay();return this.startOnMonday&&(0===e?e=6:e--),this.date_part(this.add(t,-1*e,"day"))},t.prototype.month_start=function(t){return new Date(t.getFullYear(),t.getMonth(),1)},t.prototype.month_end=function(t){return new Date(t.getFullYear(),t.getMonth()+1,0)},t.prototype.year_start=function(t){return t.setMonth(0),this.month_start(t)},t.prototype.day_start=function(t){return this.date_part(t)},t.prototype.length=function(t,e,i){return i=i||"day",Math.abs(Math.round((t.valueOf()-e.valueOf())/(1e3*this._len[i])))},t.prototype._add_days=function(t,e){var i=new Date(t.valueOf());return i.setDate(i.getDate()+e),e>=0&&!t.getHours()&&i.getHours()&&(i.getDate()<t.getDate()||i.getMonth()<t.getMonth()||i.getFullYear()<t.getFullYear())&&i.setTime(i.getTime()+36e5*(24-i.getHours())),i},t.prototype.registerCustomMode=function(t,e){this.custom[t]=e},t.prototype.add=function(t,e,i){var r=new Date(t.valueOf());switch(i){case"day":r=this._add_days(r,e);break;case"week":r=this._add_days(r,7*e);break;case"month":r.setMonth(r.getMonth()+e);break;case"year":r.setFullYear(r.getFullYear()+e);break;case"hour":r.setTime(r.getTime()+60*e*60*1e3);break;case"minute":r.setTime(r.getTime()+60*e*1e3);break;default:return this.custom[i](t,e,i)}return r},t.prototype.to_fixed=function(t){return t<10?"0"+t:""+t},t.prototype.copy=function(t){return new Date(t.valueOf())},t.prototype.date_to_str=function(t,e){var i=this;t=t.replace(/%[a-zA-Z]/g,function(t){switch(t){case"%d":return'"+to_fixed(date.getDate())+"';case"%m":return'"+to_fixed((date.getMonth()+1))+"';case"%j":return'"+date.getDate()+"';case"%n":return'"+(date.getMonth()+1)+"';case"%y":return'"+to_fixed(date.getFullYear()%100)+"';case"%Y":return'"+date.getFullYear()+"';case"%D":return'"+locale.date.day_short[date.getDay()]+"';case"%l":return'"+locale.date.day_full[date.getDay()]+"';case"%P":return'"+date.getDay()+"';case"%M":return'"+locale.date.month_short[date.getMonth()]+"';case"%F":return'"+locale.date.month_full[date.getMonth()]+"';case"%h":return'"+to_fixed((date.getHours()+11)%12+1)+"';case"%g":return'"+((date.getHours()+11)%12+1)+"';case"%G":return'"+date.getHours()+"';case"%H":return'"+to_fixed(date.getHours())+"';case"%i":return'"+to_fixed(date.getMinutes())+"';case"%a":return'"+(date.getHours()>11?"pm":"am")+"';case"%A":return'"+(date.getHours()>11?"PM":"AM")+"';case"%s":return'"+to_fixed(date.getSeconds())+"';case"%W":return'"+to_fixed(getISOWeek(date))+"';case"%Q":return'"+locale.date.quarter[getQuarter(date)-1]+"';case"%q":return'"+getQuarter(date)+"';default:return t}}),e&&(t=t.replace(/date\.get/g,"date.getUTC"));var n=new Function("date","to_fixed","locale","getISOWeek","getQuarter",' return "'+t+'";');return function(t){return n(t,i.to_fixed,r.default,i.getISOWeek,i.getQuarter)}},t.prototype.str_to_date=function(t,e){for(var i=this,r="if (typeof date === 'object') return date; var temp=date.match(/[a-zA-Z]+|[0-9]+/g);",n=t.match(/%[a-zA-Z]/g),o=0;o<n.length;o++)switch(n[o]){case"%j":case"%d":r+="set[2]=temp["+o+"]||1;";break;case"%n":case"%m":r+="set[1]=(temp["+o+"]||1)-1;";break;case"%y":r+="set[0]=temp["+o+"]*1+(temp["+o+"]>50?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":r+="set[3]=temp["+o+"]||0;";break;case"%i":r+="set[4]=temp["+o+"]||0;";break;case"%Y":r+="set[0]=temp["+o+"]||0;";break;case"%a":case"%A":r+="set[3]=set[3]%12+((temp["+o+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":r+="set[5]=temp["+o+"]||0;";break;case"%M":r+="set[1]=locale.date.month_short_hash[temp["+o+"]]||0;";break;case"%F":r+="set[1]=locale.date.month_full_hash[temp["+o+"]]||0;"}var s="set[0],set[1],set[2],set[3],set[4],set[5]";e&&(s=" Date.UTC("+s+")");var a=new Function("to_fixed","locale","date","var set=[0,0,1,0,0,0]; "+r+" return new Date("+s+");");return function(t){return a(i.to_fixed,i.locale,t)}},t.prototype.getISOWeek=function(t){if(!t)return 0;var e=t.getDay();0===e&&(e=7);var i=new Date(t.valueOf());i.setDate(t.getDate()+(4-e));var r=i.getFullYear(),n=Math.round((i.getTime()-new Date(r,0,1).getTime())/864e5);return 1+Math.floor(n/7)},t.prototype.getUTCISOWeek=function(t){return this.getISOWeek(this.convert_to_utc(t))},t.prototype.convert_to_utc=function(t){return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds())},t.prototype.getQuarter=function(t){return t=t||new Date,Math.floor(t.getMonth()/3)+1},t}();e.DateFormatter=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(8),n=i(33);e.filterFactory=function(t){switch(t.type){case"string":case"number":return new r.Filter({},t);case"date":return new n.DateFilter({},t);default:return console.warn("Wrong filter type"),null}},e.getFilterHandler=function(t,e){return function(i){return"date"===e.type&&(i=i.getTime()),t.values.indexOf(i)>-1}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.events={},this.context=t||this}return t.prototype.on=function(t,e,i){t=t.toLowerCase(),this.events[t]=this.events[t]||[],this.events[t].push({callback:e,context:i||this.context})},t.prototype.detach=function(t,e){var i=this.events[t];if(e)for(var r=i.length-1;r>=0;r--)i[r].context===e&&i.splice(r,1);else this.events[t]=[]},t.prototype.fire=function(t,e){return t=t.toLowerCase(),e=e instanceof Array?e:[e],!this.events[t]||this.events[t].map(function(t){return t.callback.apply(t.context,e)}).indexOf(!1)<0},t}();e.EventSystem=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.url=t}return t.prototype.load=function(){return this._ajax(this.url)},t.prototype.save=function(t,e){return this._ajax(this.url,t,{insert:"POST",delete:"DELETE",update:"POST"}[e]||"POST")},t.prototype._ajax=function(t,e,i){return void 0===i&&(i="GET"),new Promise(function(r,n){var o=new XMLHttpRequest;switch(o.onload=function(){o.status>=200&&o.status<300?r(o.response||o.responseText):n({status:o.status,statusText:o.statusText})},o.onerror=function(){n({status:o.status,statusText:o.statusText})},o.open(i,t),o.setRequestHeader("Content-Type","application/json"),i){case"POST":case"DELETE":case"PUT":o.send(JSON.stringify(e));break;case"GET":default:o.send()}})},t}();e.DataProxy=r},function(t,e,i){"use strict";var r=this&&this.__assign||Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++){e=arguments[i];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){void 0===t&&(t={});this.config=r({},{skipHeader:0,nameByHeader:!1,row:"\n",column:","},t),this.config.nameByHeader&&(this.config.skipHeader=1)}return t.prototype.getFields=function(t,e){for(var i=t.trim().split(this.config.column),r={},n=0;n<i.length;n++)r[e?e[n]:n+1]=i[n];return r},t.prototype.getRows=function(t){return t.trim().split(this.config.row)},t.prototype.toJsonArray=function(t){var e=this,i=this.getRows(t),r=this.config.names;if(this.config.skipHeader){var n=i.splice(0,this.config.skipHeader);this.config.nameByHeader&&(r=n[0].trim().split(this.config.column))}return i.map(function(t){return e.getFields(t,r)})},t}();e.CsvDriver=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){}return t.prototype.toJsonArray=function(t){return this.getRows(t)},t.prototype.getFields=function(t){return t},t.prototype.getRows=function(t){return"string"==typeof t?JSON.parse(t):t},t}();e.JsonDriver=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(13),n=i(19),o=function(){function t(t){this._subFields={},this._config=t,this._config.data&&(this._rawData=this._config.data.slice(),this._initialData=this._config.data),this._filters={},this._fields=this._config.fieldList.reduce(function(t,e){return t[e.id]=e,t},{}),this._initialData&&this._init()}return t.prototype.setFilterValue=function(t,e){var i=this._fields[t];!e||!e.values||e.values.length<=0?(delete this._filters[t],i.$filter=!1):(this._filters[t]={meta:e,handler:r.getFilterHandler(e,i)},i.$filter=!0)},t.prototype.setFiltersValues=function(t){for(var e in t)this.getFilterValue(e)||this.setFilterValue(e,t[e])},t.prototype.getFilterValue=function(t){return this._filters[t]?this._filters[t].meta:null},t.prototype.getFiltersValues=function(){var t={};for(var e in this._filters)t[e]=this._filters[e].meta;return t},t.prototype.clearFiltersValues=function(){this._filters={}},t.prototype.setGlobalFilter=function(t){this._globalFilter=t||null},t.prototype.addSubField=function(t,e,i){this._subFields[t]=this._subFields[t]||{},this._subFields[t][i]=e},t.prototype.setData=function(t){this._rawData=t.slice(),this._init()},t.prototype.getData=function(t){return this.reload(),this._checkData(t),this._data},t.prototype.getUniqueFieldData=function(t){return"date"===t.type?this._initialData.map(function(e){return e[t.id].getTime()}).filter(function(t,e,i){return i.indexOf(t)===e}).map(function(t){return new Date(t)}):this._initialData.map(function(e){return e[t.id]}).filter(function(t,e,i){return i.indexOf(t)===e})},t.prototype.getFieldType=function(t){return isNaN(t[0])?typeof t[0]:"number"},t.prototype.reload=function(){var t=this;this._globalFilter?this._initialData=this._initialData.filter(function(e){return t._globalFilter(e)}):this._initialData=this._rawData,this._data=this._initialData},t.prototype._init=function(){this.reload(),this._checkAliases(),this._parseDate(this._initialData)},t.prototype._parseDate=function(t){for(var e=0,i=this._config.fieldList;e<i.length;e++){var r=i[e];"date"===r.type&&(this._dateParser=new n.DateParser,this._dateParser.strToDate(t,r.id,r.format))}},t.prototype._checkAliases=function(){for(var t=0,e=this._data;t<e.length;t++)for(var i=e[t],r=0,n=this._config.fieldList;r<n.length;r++){var o=n[r];o.aliases&&o.aliases[i[o.id]]&&(i[o.id]=o.aliases[i[o.id]])}},t.prototype._checkData=function(t){if(Object.keys(this._filters).length){var e=this;for(var i in this._filters)!function(t){var i=e._filters[t];e._data=e._data.filter(function(e){return i.handler(e[t])})}(i)}if(this._dateParser)for(var i in t)for(var r=0,n=t[i];r<n.length;r++){var o=n[r];"date"!==o.type||o.method||(this._data=this._dateParser.parseDate(this._data,o.id,o.group,this._subFields[o.id]))}},t}();e.DataPreprocessor=o},function(t,e,i){"use strict";function r(t,e,i){var r=t.date_to_str(e),n=t.date_to_str(i);return function(t){return{id:r(t),label:n(t)}}}var n=this&&this.__assign||Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++){e=arguments[i];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};Object.defineProperty(e,"__esModule",{value:!0});var o=i(12),s=i(1),a=function(){function t(){var t=this._formatter=new o.DateFormatter;this._methods={dateByDay:r(t,"%P","%D"),dateByMonth:r(t,"%m","%M"),dateByQuarter:r(t,"%q","%Q"),dateByWeek:r(t,"%W",s.default.date.week+"%W"),dateByYear:r(t,"%Y","%Y")}}return t.prototype.strToDate=function(t,e,i){void 0===i&&(i="%d/%m/%Y");for(var r=0;r<t.length;r++)t[r][e]=this._formatter.str_to_date(i)(t[r][e])},t.prototype.parseDate=function(t,e,i,r){void 0===i&&(i="dateByDay"),r=n({},this._methods,r);for(var o=t.map(function(t){return n({},t)}),s=r[i]||r.dateByDay,a=0;a<o.length;a++)o[a][e]=s(o[a][e]);return o},t}();e.DateParser=a},function(t,e,i){"use strict";var r=this&&this.__assign||Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++){e=arguments[i];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),o=i(0);i(37);var s=i(22),a=i(6),h=i(32),l=i(1),d=i(13),u=function(){function t(t,e,i){this._root=t,this.areas={},this._container=o.toNode(e)||document.body,this.config=i||{},this._pivotFields=this.config.fieldList,this._freeItems=[],this._liveReload=!0,this.config.layout&&!1===this.config.layout.liveReload&&(this._liveReload=!1),this._initialTypes={operations:[{id:"sum",label:l.default.sum},{id:"min",label:l.default.min},{id:"max",label:l.default.max},{id:"count",label:l.default.count}],dates:[{id:"dateByDay",label:l.default.day},{id:"dateByWeek",label:l.default.week},{id:"dateByMonth",label:l.default.month},{id:"dateByQuarter",label:l.default.quarter},{id:"dateByYear",label:l.default.year}]},this._init()}return t.prototype.getFields=function(){var t={};for(var e in this.areas)t[e]=this.areas[e].getConfig();return t},t.prototype.getTypes=function(){if(this.config.types)for(var t in this.config.types)this._initialTypes[t]=this.config.types[t];return this._initialTypes},t.prototype.setConfig=function(t){this.config.fields=t,this._render()},t.prototype.startDrag=function(t,e){this._dragItem=e,this._drag=new s.DragManager(t,e,this._view),this._moveHandler()},t.prototype.addFreeItem=function(t){n.arrayFind(this._freeItems,t)||this._freeItems.push(n.arrayFind(this._pivotFields,t))},t.prototype.refresh=function(){this.config.fields=this.getFields(),this._render(),this.onConfigChange()},t.prototype.onConfigChange=function(){var t=this;this._liveReload&&window.setTimeout(function(){t._root.reload()},1)},t.prototype.onItemClick=function(t,e,i){var r=this;if("filter"===i){if(this.config.layout&&!1===this.config.layout.showFilters)return;if(this._filterId===t.id)return;var n=this.config.dataPreprocessor,o=n.getUniqueFieldData(t);t.type=t.type||n.getFieldType(o);var s=d.filterFactory(t);s.setFilter(n.getFilterValue(t.id)||{}),s.setOptions(o),s.show(e),this._filterId=t.id,s.attachEvent("onAfterHide",function(){r._root.setFilterValue(t.id,s.getFilter()),r._filterId=null})}},t.prototype.addMathMethod=function(t,e){this.config.types=this.config.types||this._initialTypes,this.config.types.operations.push({id:t,label:e})},t.prototype.addDateMethod=function(t){this._initialTypes.dates.push({id:t,label:l.default[t]})},t.prototype._init=function(){this._fill()},t.prototype._toHTML=function(){return'<div class="dhx_config dhx_flex_cont"><div class="dhx_config_content">\n\t\t\t\t\t\t\t<div class="dhx_config_free-items" id="dhx_configFreeItems"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t'+(this._liveReload?"":'<div class="dhx_config_apply">\n\t\t\t\t\t\t\t<button class="dhx_btn dhx_btn--active" id="dhx_configApplyBtn">\n\t\t\t\t\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"/></svg>\n\t\t\t\t\t\t\t\t<span>'+l.default.apply+"</span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>")+"\n\t\t\t\t\t</div>"},t.prototype._fill=function(){var t=this;this._container.innerHTML="",o.insert(this._container,this._toHTML()),this._view=this._container.firstChild,this._header=this._view.childNodes[0],this._applyBtn=this._view.querySelector("#dhx_configApplyBtn"),this._content=this._view.childNodes[0],this._free=this._content.querySelector("#dhx_configFreeItems"),this._fields=this._content.childNodes[1],this._render(),this._liveReload||this._applyBtn.addEventListener("click",function(){t._root.reload()})},t.prototype.isTargetExist=function(t,e){for(;t;){if(!t)return!1;if(t[e])return t;t=t.parentNode}return!1},t.prototype._moveHandler=function(){var t=this,e=function(e){t._drag.move(e),t._highlightArea(!1),t._hoveredTarget=t.isTargetExist(t._drag.getTarget(),"_dropTarget"),t._hoveredTarget&&t._hoveredTarget._dropTarget.getName()===t._dragItem._obj.getFieldName()&&(t._hoveredTarget=t.isTargetExist(t._drag.getTarget(),"_obj")),t._hoveredTarget&&t._highlightArea(!0)},i=function(r){if(1!==r.which)return!1;t._highlightArea(!1);var n=t.isTargetExist(t._drag.getTarget(),"_dropTarget"),o=!1;if(n&&n._dropTarget!==t._dragItem._obj.root&&(t._putItem(n._dropTarget),o=!0),(n=t.isTargetExist(t._drag.getTarget(),"_obj"))&&n._obj&&n._obj.getFieldName()){var s=t.areas[n._obj.getFieldName()].getItemsUid();if(t._dragItem._obj.getFieldName())t._sortItems(n._obj,t._dragItem._obj);else{var a=t.areas[n._obj.getFieldName()].getItemByUid(s[s.length-1]);t._sortItems(n._obj,a)}o=!0}t._drag.destroy(),document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",i),o&&t.refresh()};document.addEventListener("mousemove",e),document.addEventListener("mouseup",i)},t.prototype._sortItems=function(t,e){this.areas[t.getFieldName()].moveItem(t.uid,e.uid)},t.prototype._highlightArea=function(t){this._hoveredTarget&&(o.removeCss(this._hoveredTarget,"dhx_on_hover"),o.addCss(this._hoveredTarget,"dhx_on_hover"),t||(o.removeCss(this._hoveredTarget,"dhx_on_hover"),this._hoveredTarget=null))},t.prototype._render=function(){var t=this._freeItems=this._pivotFields.slice(),e=this.config.fields,i={values:!0,columns:!0,rows:!0};for(var o in e){var s=e[o];if(!i[o])return;var h=document.querySelector("#dhx_config_"+o);h.innerHTML="";var l=new a.DropZone(this,h,o);this.areas[o]=l;for(var d=0;d<s.length;d++){s[d].id||(s[d]={id:s[d]});var u=n.arrayFind(this._pivotFields,s[d].id||s[d]);if(u&&(u=r({},s[d],u),l.addItem(u),"values"!==o))for(var c=0;c<t.length;c++)t[c].id===u.id&&t.splice(c,1)}}this._insertFreeItems()},t.prototype._insertFreeItems=function(){var t=this._freeItems,e=this._free;e.innerHTML="";for(var i=new h.FreeZone(this,e,null),r=0;r<t.length;r++)i.addItem(t[r])},t.prototype._putItem=function(t){if(t){var e=this._dragItem._obj,i=e.getObject(),r=t.getName(),n=e.getFieldName(),o={values:!0};if(r!==n)if(t.freeZone){if(!n)return;this.areas[n].removeItem(i.id,e.uid)}else{if(o[n])for(var s in this.areas)if(-1!==this.areas[s].getItemsId().indexOf(i.id)&&!o[r])return;if(n&&!o[r])this.areas[n].removeItem(i.id,e.uid);else{var a=this._freeItems.map(function(t){return t.id||t}).indexOf(i.id);this._freeItems.splice(a,1)}this.areas[r].addItem(i)}}},t}();e.Config=u},function(t,e,i){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.$getPropetry=function(t,e){var i={values:this.configModule.getTypes().operations};return i[e]?(t.method=t.method||i[e][0].id,n.arrayFind(i[e],t.method)?n.arrayFind(i[e],t.method):i[e][0]):(this._dates=this.configModule.getTypes().dates,n.arrayFind(this._dates,t.group)||this._dates[0])},e.prototype.$toggleSelect=function(){for(var t=this._dates[1],e=0;e<this._dates.length;e++)if(this._dates[e].id===this.obj.group){if(!this._dates[e+1]){t=this._dates[0];break}t=this._dates[e+1]}this.obj.group=t.id,this.$property.innerHTML=this.$getPropertyTpl(t.label),this.configModule.onConfigChange()},e}(i(7).Item);e.DateItem=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),n=function(){function t(t,e,i){this._dragItem=e,this._mouseDownEv=t,this._parent=i,this._init()}return t.prototype.destroy=function(){this._copy&&this._parent.removeChild(this._copy),this._copy=this._dragItem=this._currTarget=null,r.removeCss(document.body,"dhx_noselect")},t.prototype.move=function(t){if(!(Math.abs(t.pageX-this._mouseDownEv.pageX+t.pageY-this._mouseDownEv.pageY)<10)||this._copy){this._copy||this._createCopy();var e=r.getCoords(this._dragItem),i=this._mouseDownEv.pageX-e.left,n=this._mouseDownEv.pageY-e.top;this._currTarget=this.$getElUnderCursor(t),this._moveCopy(t,i,n)}},t.prototype.getTarget=function(){return this._currTarget},t.prototype.$getElUnderCursor=function(t){this._copy.style.display="none";var e=document.elementFromPoint(t.clientX,t.clientY);return this._copy.style.display="",e},t.prototype._init=function(){r.addCss(document.body,"dhx_noselect")},t.prototype._createCopy=function(){var t=this._dragItem.cloneNode(!0);t.className="dhx_shadow",this._parent.appendChild(t),this._parent.style.overflow="visible";var e=r.getCoords(this._dragItem),i=this._dragItem.offsetWidth;t.style.top=e.top+"px",t.style.left=e.left+"px",t.style.width=i+"px",this._copy=t},t.prototype._moveCopy=function(t,e,i){var r=t.clientX-e,n=t.clientY-i;this._copy.style.top=n+"px",this._copy.style.left=r+"px"},t}();e.DragManager=n},,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(25),n=i(1),o=function(){function t(t){this._firstColsWidth=100,this.$config=t,this._data=t.data,t.layout&&t.layout.rowsHeadersWidth&&(this._firstColsWidth="auto"===t.layout.rowsHeadersWidth?0:t.layout.rowsHeadersWidth),this._colMinWidth=100,this.setConfig(t.fields),this._uniqueRows=[]}return t.prototype.setConfig=function(t){this._header=t.columns,this._rows=t.rows.map(function(t){return t.id?t:{id:t}}),this.$config.fields=t,this._uniqueRows=[],this._columns=[],this._init()},t.prototype.setData=function(t){this._data=t},t.prototype.groupBy=function(t){return this._columns=this._group(this._data,t)},t.prototype.getHeader=function(){return this._getHeader(this._columns)},t.prototype.getData=function(){return this._groupMath()},t.prototype.addMathMethod=function(t,e){r.mathMethods[t]=e},t.prototype._init=function(){this.groupBy(this._header)},t.prototype._group=function(t,e){for(var i={},r=0;r<t.length;r++)!function(r){t[r].$keyArr=e.map(function(e){return t[r][e.id].id||t[r][e.id]});var n=t[r].$keyArr.join(".");i[n]=i[n]||[],i[n].push(t[r])}(r);return Object.keys(i).map(function(t){return i[t]}).sort(function(t,i){for(var r=0;r<t[0].$keyArr.length;r++){var n=t[0].$keyArr[r],o=i[0].$keyArr[r],s=isNaN(n)?n.localeCompare(o):n-o;if(s="asc"===(e[r].sortDir||"asc")?s:-s)return s}})},t.prototype._getHeaderLabels=function(t,e){return t.map(function(t){return e.map(function(e){var i=e.id;return""+(t[0][i].label||t[0][i])})})},t.prototype._getHeader=function(t){var e=this,i=0,r=this.$config.fields.values;if(r){for(var o=[],s=0;s<this.$config.fields.columns.length+1;s++)o.push({text:""});var a=this._rows.map(function(t){var r={header:o,width:e._firstColsWidth,id:i};return i++,r}),h=[],l=[],d=[];t=this._getHeaderLabels(t,this._header);for(s=0;s<t.length;s++)for(var u=0,c=r;u<c.length;u++){for(var p=c[u],f=[],_=0;_<t[s].length;_++){var g=t[s][_].id||t[s][_];h[_]=h[_]||[],l[_]=l[_]||1,d[_]=d[_]||{},h[_]!==g?(h[_]=g,d[_]={text:g,colspan:l[_]},this._header[_].template&&(d[_].text=this._header[_].template(g,this._header[_])),f.push(d[_])):(d[_].colspan++,f.push({text:null}))}f.push({text:(p.label||p.id)+" ("+n.default[p.method]+")"});var v={header:f,width:this._colMinWidth,id:i++};this.$config.layout&&this.$config.layout.rowsWidth&&(v.width=this.$config.layout.rowsWidth),a.push(v)}return a}},t.prototype._setRowsLabels=function(t,e,i){for(var r=[],n=0;n<t.length;n++)if(n!==e)r.push(null);else{var o=i.label||i;t[e].template&&(o=t[e].template(o,t[e])),r.push(o)}this._uniqueRows.push(r)},t.prototype._groupRows=function(t,e){void 0===e&&(e=0);for(var i=this._rows[e].id,n=this._rows[e].sortDir||"asc",o=r.getUnique(t,i,n),s=[],a=0;a<o.length;a++){var h=o[a].id||o[a];this._setRowsLabels(this._rows,e,o[a]);for(var l=[],d=0;d<t.length;d++){for(var u=[],c=0;c<t[d].length;c++)(t[d][c][i].id||t[d][c][i])===h&&u.push(t[d][c]);l.push(u)}s.push(l),e<this._rows.length-1&&s.push.apply(s,this._groupRows(l,e+1))}return s},t.prototype._groupMath=function(){var t=this._groupRows(this._columns,0),e=this.$config.fields.values;if(e){for(var i=0;i<t.length;i++)for(var n=0;n<t[i].length;n++)for(var o=0;o<e.length;o++)"string"==typeof t[i][n]?this._uniqueRows[i].push(t[i][n]):this._uniqueRows[i].push(r.methods(t[i][n],e[o].id,e[o].method));return this._uniqueRows}},t}();e.DataGroup=o},function(t,e,i){"use strict";function r(t,e){return void 0===e&&(e="asc"),t.sort(function(t,i){var r=isNaN(t)?t.localeCompare(i):t-i;return"asc"===e?r:-r})}Object.defineProperty(e,"__esModule",{value:!0}),e.getUnique=function(t,e,i){for(var n={},o=0;o<t.length;o++)if(t[o]instanceof Array&&t[o].length)for(var s=0;s<t[o].length;s++)n[t[o][s][e].id||t[o][s][e]]=t[o][s];return r(Object.keys(n),i).map(function(t){return n[t][e]})},e.mathMethods={sum:function(t){return t.reduce(function(t,e){return t+e}).toFixed(3)},min:function(t){return t[0].toFixed(3)},max:function(t){return t[t.length-1].toFixed(3)},count:function(t){return t.length}},e.methods=function(t,i,r){return t.length?(t=t.map(function(t){return parseFloat(t[i])||0}).sort(function(t,e){return t>e?1:-1}),e.mathMethods[r]?e.mathMethods[r](t):null):null}},function(t,e,i){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=i(20),o=i(28),s=i(31),a=i(1),h=function(t){function e(e,i){var r=t.call(this,e,i)||this;return r.$setHandlers(),r}return r(e,t),e.prototype.$attachGrid=function(t){this._setGridContainerSize(),this._grid=new o.Grid(t,{rowsHeadersWidth:this._config.layout.rowsHeadersWidth,sortType:"number",mark:this._config.mark})},e.prototype.$attachConfig=function(t,e){void 0===e&&(e=this._config),this._configurator=new n.Config(this,t,{fields:e.fields,types:e.types,fieldList:e.fieldList,layout:e.layout,dataPreprocessor:this._dataP})},e.prototype.$setHandlers=function(){var t=this;this.container.addEventListener("click",function(e){"dhx_pivotSettingsBtn"===e.target.id&&(t._config.layout.gridOnly=!t._config.layout.gridOnly,t._config.fields=t.getFields(),t.$init())}),window.addEventListener("resize",function(){t._setGridContainerSize(),t.reload()})},e.prototype.$init=function(){this._setLayout(),this.$attachConfig("dhx_configuratorCont"),this.$attachGrid("dhx_gridCont"),this._config.data&&this.reload()},e.prototype.$onPivotEmpty=function(){this.container.querySelector("#dhx_gridCont").innerHTML='<div style="background:white;height:58px;width:168px;"></div>'},e.prototype._setGridContainerSize=function(){var t=this._config.layout.readonly?15:30,e=this.container.querySelector(".dhx_grid_wrap"),i=this.container.clientHeight-this.container.offsetTop-e.offsetTop-t;e.style.height=(i<220?220:i)+"px"},e.prototype._setLayout=function(){this.container.innerHTML=this._config.layout.readonly||this._config.layout.gridOnly?this._getGridLayout().trim():this._getCommonLayout().trim()},e.prototype._getGridLayout=function(){var t=this._config.layout.readonly?"dhx_pivot--readonly":"";return'\n\t\t\t<div id="layout" class="dhx_pivot_layout">\n\t\t\t\t<div id="dhx_configuratorCont" style="display:none;"></div>\n\t\t\t\t<div id="dhx_config_values"  style="display:none;"></div>\n\t\t\t\t<div id="dhx_config_columns"  style="display:none;"></div>\n\t\t\t\t<div id="dhx_config_rows"  style="display:none;"></div>\n\n\t\t\t\t<div class="dhx_pivot_settings_wrap '+t+'">\n\t\t\t\t\t<button id="dhx_pivotSettingsBtn" class="dhx_btn pivot_settings">'+a.default.showSettings+'</button>\n\t\t\t\t</div>\n\n\t\t\t\t<div class="dhx_flex_cont dhx_pivot_alone_wrap '+t+'">\n\t\t\t\t\t<div id="dhx_gridCont" class="dhx_grid_wrap"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t'},e.prototype._getCommonLayout=function(){var t="flex: 0 0 "+(this._config.layout.leftMargin||168)+"px";return'\n\t\t\t<div class="dhx_pivot_layout" id="pivotMainContainer">\n\t\t\t\t<div class="dhx_config_wrap">\n\t\t\t\t\t<div class="dhx_flex_cont">\n\t\t\t\t\t\t<div id="dhx_configuratorCont"></div>\n\t\t\t\t\t\t<div class="dhx_pivot_settings_wrap">\n\t\t\t\t\t\t\t<button id="dhx_pivotSettingsBtn" class="dhx_btn pivot_settings_btn">'+a.default.hideSettings+'</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="dhx_pivot_cont">\n\t\t\t\t\t<div class="dhx_flex_cont">\n\t\t\t\t\t\t<div id="dhx_config_values" class="dhx_config_zone"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="dhx_flex_cont">\n\t\t\t\t\t\t<div style="'+t+';margin-left:15px"></div>\n\t\t\t\t\t\t<div id="dhx_config_columns" class="dhx_config_zone"></div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class="dhx_flex_cont">\n\t\t\t\t\t\t<div class="dhx_rows_wrap" style="'+t+'">\n\t\t\t\t\t\t\t<div id="dhx_config_rows" class="dhx_config_rows"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div id="dhx_gridCont" class="dhx_grid_wrap"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t'},e}(s.PivotBase);e.Pivot=h},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.naturalSort=function(t){return t.sort(function(t,e){return"string"==typeof t?t.localeCompare(e):t-e})}},function(t,e,i){"use strict";var r=this&&this.__assign||Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++){e=arguments[i];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};Object.defineProperty(e,"__esModule",{value:!0});var n=i(0);i(36);var o=i(11),s=i(29),a=i(30),h=function(){function t(t,e){this.$container=n.toNode(t)||document.body,this._colspanHeader=!1,this._rowHeight=40,this._scrollbarWidth=17,e?(this.$config=this._parseConfig(e),this.$config.columns&&this._parseHeaders(this.$config),this.$config.data&&this._onDataLoad(this.$config.data)):this.$config={totalWidth:0,headerLevel:0,sortDir:"asc"},this.$setHandlersOnce()}return t.prototype.destructor=function(){this._renderer.destructor(),this.$container=null},t.prototype.onFill=function(t,e){this._rowsPerPage=t,this.$config.scroll&&(e.scrollLeft=this.$config.scroll.left,e.scrollTop=this.$config.scroll.top),this.$setHandlers(e)},t.prototype.setHeader=function(t){this.$config.columns=t,this._parseHeaders(this.$config)},t.prototype.resize=function(){this._renderer.resize()},t.prototype.load=function(t){this._onDataLoad(t)},t.prototype.reload=function(){this._calcRowsHeaders(),this._init(),this._render()},t.prototype.export=function(t){for(var e=this.$config.columns,i=this._transpose(this.$config.columns.map(function(t){return t.header.map(function(t){return t.text||null})})),r=[],n={default:{color:"#000000",background:"#FFFFFF",fontSize:14}},o=[],s=0,a=e;s<a.length;s++){var h=a[s];r.push({width:h.width});for(var l in h.cellCss){var d=h.cellCss[l],u=d.split("").reduce(function(t,e){var i=(t<<5)-t+e.charCodeAt(0);return Math.abs(i&i)},0).toString();if(!n[u]){var c=this._getCellCss(d,n.default);c&&(n[u]=c)}n[u]&&o.push([parseFloat(l),h.id,u])}}var p={name:t.name||"pivot_data",columns:r,header:i,data:this._data,styles:{cells:o,css:n}};if(t.url){var f=document.createElement("form");f.setAttribute("target","_blank"),f.setAttribute("action",t.url),f.setAttribute("method","POST"),f.style.visibility="hidden";var _=document.createElement("textarea");_.setAttribute("name","data"),_.value=JSON.stringify(p),f.appendChild(_),document.body.appendChild(f),f.submit(),setTimeout(function(){f.parentNode.removeChild(f)},100)}return p},t.prototype.$setHandlers=function(t){var e=this;t.addEventListener("wheel",function(i){i.preventDefault(),t.scrollTop+=i.deltaY<0?-100:100;var r=e._calcPositions();e._renderer.insert(r,e._data,e.$config.columns)}),t.addEventListener("scroll",function(){var t=e._renderer.getContainerSizes();e.$config.scroll={left:t.scrollLeft,top:t.scrollTop};var i=e._calcPositions();e._renderer.insert(i,e._data,e.$config.columns),e._spans&&e._spans.moveHeader(i,t)})},t.prototype.$setHandlersOnce=function(){var t=this;this.$container.addEventListener("click",function(e){var i=n.locate(e,"dhx_col");i&&(t.$config.sortColumn===i?t.$config.sortDir="asc"===t.$config.sortDir?"desc":"asc":t.$config.sortDir="asc",t.$config.sortColumn=i,t._data=s.sortTree(t._rowTree,t.$config.sortColumn,t.$config.sortDir,t.$config.sortType),t.reload())})},t.prototype._init=function(){this._renderer&&this._renderer.destructor(),this._renderer=new o.Renderer(this,this.$container,this.$config)},t.prototype._calcPositions=function(){var t=this.$config.columns,e=this._renderer.getContainerSizes(),i=0,r=this._rowsPerPage<=this._data.length?this._rowsPerPage:this._data.length,n=0,o=0;if(e.scrollTop){var s=Math.round(e.scrollTop/this._rowHeight);i+=s,r+=this._data[r+s]?s:s-1}this._data[r+1]&&(r+=1);for(var a=e.scrollWidth-e.scrollLeft,h=e.scrollWidth,l=0;l<t.length;l++)a<h-t[n].width&&(h-=t[n].width,n=l+1);for(var d=0,l=n;l<t.length;l++)if(d+=t[l].width,o=l,d>e.offsetWidth){e.offsetWidth;break}return{xStart:n,xEnd:o,yStart:i,yEnd:r}},t.prototype._calcRowsHeaders=function(){var t=this;this.$config.columns.map(function(t){return t.cellCss={}});var e=[];this._data.map(function(i,r){for(var n=!1,o=0;o<t._rowsHeadersCount;o++){var s="",a=(""+i[o]).replace(/<[^>]*>/g,"");!e[o]&&a?e[o]=a.length:a&&(e[o]=e[o]>a.length?e[o]:a.length),s+=" dhx_grid_col--first",null!==i[o]?(s+=" dhx_grid_col--title",n=!0):n&&(s+=" dhx_grid_col--after-title"),t.$config.columns[o].cellCss[r]=t.$config.columns[o].cellCss[r]||"",t.$config.columns[o].cellCss[r]+=s}}),this.$config.rowsHeadersWidth&&"auto"===this.$config.rowsHeadersWidth&&this._setAutoWidth(e,this.$config)},t.prototype._setAutoWidth=function(t,e){for(var i=0;i<t.length;i++){var r=7*t[i]+20;e.totalWidth=e.totalWidth-e.columns[i].width+r,e.columns[i].width=r}},t.prototype._parseConfig=function(t){var e={totalWidth:0,headerLevel:1,headerRowHeight:this._rowHeight,span:null};return r({},e,t)},t.prototype._parseHeaders=function(t){this.$config.totalWidth=0,this.$config.headerLevel=0,this._rowsHeadersCount=0;for(var e=0;e<t.columns.length;e++){if(t.columns[e].header){var i=t.columns[e].header;if(!(i instanceof Array)){t.columns[e].header=[{text:i}];continue}t.headerLevel=Math.max(i.length,t.headerLevel),this._checkColspans(i)}""===t.columns[e].header[0].text&&this._rowsHeadersCount++;var n={width:100,id:e};t.columns[e]=r({},n,t.columns[e]),t.totalWidth+=t.columns[e].width}},t.prototype._checkColspans=function(t){if(!this._colspanHeader)for(var e=0,i=t;e<i.length;e++){var r=i[e];if(r.colspan&&r.colspan>1){this._colspanHeader=!0;break}}},t.prototype._onDataLoad=function(t){this.$config.sortColumn=0,this.$config.sortDir="asc",this.$config.scroll={left:0,top:0},this._data=t,this._rowTree=s.buildRowTree(this._data,this._rowsHeadersCount),this.reload()},t.prototype._setMarks=function(t,e){for(var i=this.$config.columns,r=this._rowsHeadersCount;r<t.length;r++)for(var n=t[r],o=0;o<n.length;o++){var s=e(n[o],n);s&&(i[r].cellCss=i[r].cellCss||{},i[r].cellCss[o]=s)}},t.prototype._checkMarks=function(t){var e=this.$config.mark;"function"==typeof e?this._setMarks(t,e):this._setMarks(t,function(t,i){var r=i.reduce(function(t,e){return t=t>e&&null!==e?e:t},1/0),n=i.reduce(function(t,e){return t=t<e&&null!==e?e:t},-1/0);return e.max&&n===t?e.max:!(!e.min||r!==t)&&e.min})},t.prototype._transpose=function(t,e){for(var i=[],r=0;r<t.length;r++)for(var n=t[r],o=0;o<n.length;o++){i[o]=i[o]||[];var s=e?e(n[o]):n[o];i[o].push(s)}return i},t.prototype._getColumns=function(){return this._transpose(this._data,function(t){return isNaN(parseFloat(t))?t:parseFloat(t)})},t.prototype._render=function(){var t=this._calcPositions();this.$config.mark&&this._checkMarks(this._getColumns()),this._renderer.insert(t,this._data,this.$config.columns),this._renderer.resize();var e=this._renderer.getContent();(this.$config.span||this._colspanHeader)&&(this._spans=new a.Spans(this,e,this.$config,this.$config.columns,t,this._data))},t.prototype._rgbToHex=function(t){if("#"===t.substr(0,1))return t;var e=/(.*?)rgb[a]?\((\d+), *(\d+), *(\d+),* *([\d]*)\)/.exec(t);return"#"+parseInt(e[2],10).toString(16)+parseInt(e[3],10).toString(16)+parseInt(e[4],10).toString(16)},t.prototype._getCellCss=function(t,e){var i=this.$container.querySelector(".dhx_grid_row"),r=n.insert(i,'<div class="'+t+'"></div>'),o=window.getComputedStyle(r),s={color:"rgb(0, 0, 0)"===o.color?e.color:this._rgbToHex(o.color),background:"rgba(0, 0, 0, 0)"===o.backgroundColor?e.background:this._rgbToHex(o.backgroundColor),fontSize:parseFloat(o.fontSize)};return i.removeChild(r),s.color===e.color&&s.background===e.background&&s.fontSize===e.fontSize?null:s},t}();e.Grid=h},function(t,e,i){"use strict";function r(t,e,i,n){var s=[];o(t,e,i,n);for(var a=0,h=t;a<h.length;a++){var l=h[a];if(s.push(l.data),l.childs&&l.childs.length&&l.childs[0].data){var d=r(l.childs,e,i,n);s.push.apply(s,d)}else l.childs&&l.childs.length&&(o(l.childs,e,i,n),s.push.apply(s,l.childs))}return s}function n(t,e,i){if(void 0===i&&(i=0),0===e)return t.map(function(t){return{data:t}});for(var r={},o="",s=0,a=t;s<a.length;s++){var h=a[s];h[i]||0===h[i]?(o=h[i],r[o]={data:h,childs:[]}):r[o].childs.push(h)}for(var l in r)r[l].childs.length&&i+1<e&&(r[l].childs=n(r[l].childs,e,i+1));return Object.keys(r).map(function(t){return r[t]})}function o(t,e,i,r){return void 0===r&&(r="string"),t.sort(function(t,n){var o=t instanceof Array?t[e]:t.data[e],s=n instanceof Array?n[e]:n.data[e],a="number"===r?o-s:o.localeCompare(s);return"asc"===i?a:-a}),t}Object.defineProperty(e,"__esModule",{value:!0}),e.sortTree=r,e.buildRowTree=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(11),n=function(){function t(t,e,i,r,n,o){this._root=t,this._content=e,this._headerSpans=this._content.querySelector(".dhx_header_spans"),this._columns=r,this._config=i,this._spanHeader(),this._rowHeight=i.headerRowHeight,this._data=o,i.span&&(this._gridSpans=this._content.querySelector(".dhx_grid_spans"),this._spanData(n.xStart,n.yStart))}return t.prototype.moveHeader=function(t,e){var i=this._headerSpans;if(e.scrollWidth-e.scrollLeft-e.clientWidth<=3)i.style.left=-e.scrollLeft+"px";else{for(var r=this._columns,n=0,o=0;o<t.xStart;o++)n+=r[o].width;i.style.left=-1*n+"px",this._config.span&&this._spanData(t.xStart,t.yStart)}},t.prototype._spanData=function(t,e){for(var i=this._gridSpans,n="",o=this._columns,s=this._config.span,a=this._rowHeight,h=0;h<s.length;h++){for(var l=s[h].row,d=s[h].column,u=s[h].rowspan,c=this._columns[d].id,p=this._data[l][c]||"",f=0,_=d-1;_>=0;_--)f+=o[_].width;var g={css:this._columns[d].header[0].text?"dhx_span_cell":"dhx_span_cell dhx_span_cell--title",styles:"\n\t\t\t\twidth:"+o[d].width+"px;\n\t\t\t\theight:"+u*a+"px;\n\t\t\t\ttop:"+l*a+"px;\n\t\t\t\tleft:"+f+"px;\n\t\t\t\t"};n+=r.getCellHTML(p,g)}i.innerHTML=n;for(var v=0,h=0;h<t;h++)v+=o[h].width;i.style.left=-1*v+"px",i.style.top=-1*e*a+"px"},t.prototype._spanHeader=function(){for(var t=this._headerSpans,e="",i=this._config.headerRowHeight||50,n=this._columns,o=0;o<n.length;o++)for(var s=0;s<n[o].header.length;s++){var a=n[o].header[s],h=a.text||"";if(!a)break;if(a.colspan&&a.colspan>1){for(var l=s*i,d=0,u=o-1;u>=0;u--)d+=n[u].width;for(var c=0,p=o;p<a.colspan+o;p++)n[p]&&(c+=n[p].width);var f={css:"dhx_span_cell ",styles:"\n\t\t\t\t\t\twidth:"+c+"px;\n\t\t\t\t\t\theight:"+i+"px;\n\t\t\t\t\t\ttop:"+l+"px;\n\t\t\t\t\t\tleft:"+d+"px\n\t\t\t\t\t\t"};e+=r.getCellHTML(h,f)}}t.innerHTML=e},t}();e.Spans=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),n=i(1),o=i(24),s=i(18),a=i(4),h=function(){function t(t,e){this.container=r.toNode(t),this._config=e,this._config.layout=this._config.layout||{},this._dataP=new s.DataPreprocessor(this._config),this.$init()}return t.prototype.load=function(t,e){var i=this;return a.toProxy(t).load().then(function(t){return i.setData(t,e)})},t.prototype.getConfig=function(){return this._config},t.prototype.getFields=function(){var t=this._configurator.getFields();for(var e in t)t[e]=t[e].map(function(t){return t.method?{id:t.id,method:t.method}:t.group?{id:t.id,group:t.group}:t.id});return t},t.prototype.setFields=function(t){this._config.fields=t,this._configurator.setConfig(t),this.reload()},t.prototype.setData=function(t,e){if((t=a.toDataDriver(e||"json").toJsonArray(t)).data){if(t.aliases)for(var i=0,r=this._config.fieldList;i<r.length;i++){var n=r[i];t.aliases[n.id]&&(n.aliases=t.aliases[n.id])}t=t.data}if(t.length&&(this._config.data=t,this._dataP.setData(t),this.$init()),!t.length)return this._grid.setHeader(this._dataGroup.getHeader()),void this._grid.load([])},t.prototype.reload=function(){this._init()},t.prototype.addMathMethod=function(t,e,i){this._dataGroup.addMathMethod(t,i),this._configurator.addMathMethod(t,e),n.default[t]=e},t.prototype.addSubField=function(t,e,i){n.default[i]=n.default[i]?n.default[i]:i,this._configurator.addDateMethod(i),this._dataP.addSubField(t,e,i)},t.prototype.setFilterValue=function(t,e){this._dataP.setFilterValue(t,e),this._configurator.refresh()},t.prototype.setFiltersValues=function(t){this._dataP.setFiltersValues(t),this._configurator.refresh()},t.prototype.getFilterValue=function(t){return this._dataP.getFilterValue(t)},t.prototype.getFiltersValues=function(){return this._dataP.getFiltersValues()},t.prototype.clearFiltersValues=function(){this._dataP.clearFiltersValues(),this._configurator.refresh()},t.prototype.setGlobalFilter=function(t){this._dataP.setGlobalFilter(t),this.reload()},t.prototype.addFilter=function(){alert("method is deprecated, see docs https://docs.dhtmlx.com/pivot/api__refs__pivot.html")},t.prototype.removeFilter=function(){alert("method is deprecated, see docs https://docs.dhtmlx.com/pivot/api__refs__pivot.html")},t.prototype.getFilter=function(){alert("method is deprecated, see docs https://docs.dhtmlx.com/pivot/api__refs__pivot.html")},t.prototype.export=function(t){return this._grid.export(t)},t.prototype.$attachGrid=function(t){},t.prototype.$attachConfig=function(t,e){void 0===e&&(e=this._config)},t.prototype.$init=function(){},t.prototype.$onPivotEmpty=function(){},t.prototype._init=function(){if(this._config.data){var t=this._configurator.getFields();if(0!==t.rows.length&&0!==t.columns.length&&0!==t.values.length){if(this._data=this._dataP.getData(t),this._calculate(t),!this._data.length)return this._grid.setHeader(this._dataGroup.getHeader()),void this._grid.load([]);this._render()}else this.$onPivotEmpty()}},t.prototype._calculate=function(t){this._dataGroup=new o.DataGroup({data:this._data,fields:t,layout:this._config.layout})},t.prototype._render=function(){this._grid&&(this._grid.setHeader(this._dataGroup.getHeader()),this._grid.load(this._dataGroup.getData()))},t}();e.PivotBase=h},function(t,e,i){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),o=i(6),s=i(1),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.init=function(){this.ui=n.insert(this.cont,'<div class="dhx_config_field"></div>'),this.ui._dropTarget=this,this.header=n.insert(this.ui,'<div class="dhx_field_header"><div class="field_name">'+s.default.availableFields+"</div></div>"),this.$content=n.insert(this.ui,'<div class="dhx_field_content"></div>'),this.freeZone=!0},e.prototype.getFieldName=function(){return null},e}(o.DropZone);e.FreeZone=a},function(t,e,i){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=i(8),o=i(0),s=i(12),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.setFilter=function(e){t.prototype.setFilter.call(this,e),this._createMask()},e.prototype.setOptions=function(t){this._options=t.map(function(t){return t.getTime()}).sort()||[]},e.prototype._createMask=function(){this._format=this._state.inputFormat;for(var t=this._format.match(/(%[a-zA-Z])/g),e=this._format.match(/([^\%a-zA-Z])/g)[0],i=[],r=[],n=0,o=t;n<o.length;n++)switch(o[n]){case"%d":i.push("DD"),r.push("(0[1-9]|[12]\\d|3[01])");break;case"%j":i.push("DD"),r.push("([1-9]|[12]\\d|3[01])");break;case"%m":i.push("MM"),r.push("(0?[1-9]|1[012])");break;case"%n":i.push("MM"),r.push("([1-9]|1[012])");break;case"%Y":i.push("YYYY"),r.push("[1-2][0-9]{3}");break;case"%y":i.push("YY"),r.push("[0-9]{2}")}this.mask=r.join("\\W"),this.placeholder=i.join(e)},e.prototype._init=function(t){var e=this,i={type:"date",filter:{from:"",to:""},values:[],inputFormat:t.inputFormat||t.format||"%d.%m.%Y"};this._state=i,this.dateFormatter=new s.DateFormatter,this.attachEvent("onAfterFill",function(){e._filterDom.querySelector("[dhx_id='from']").focus()})},e.prototype._getOptions=function(){for(var t="",e=this._getFilteredOptions(),i=0;i<e.length;i++){var r=this.dateFormatter.date_to_str(this._format)(new Date(e[i]));null!==r&&(t+='<div class="dhx_list_item" dhx_list_item="'+i+'">\n\t\t\t\t<label class="dhx_checkbox">\n\t\t\t\t\t<input type="checkbox" '+(this._state.values.indexOf(e[i])>-1?"checked":"")+' value="'+e[i]+'" dhx_list_item>\n\t\t\t\t\t<span class="dhx_checkbox_icon"></span>\n\t\t\t\t\t<span class="dhx_checkbox_label">'+r+"</span>\n\t\t\t\t</label>\n\t\t\t\t</div>")}return t},e.prototype._validateInput=function(t){return!t||new RegExp(this.mask,"g").test(t)},e.prototype._checkFilterText=function(t,e){this._validateInput(t.target.value)?(t.target.parentNode.classList.remove("dhx_alert"),this._state.filter[e]=t.target.value,this._state.values=[],this._renderList()):t.target.parentNode.classList.add("dhx_alert")},e.prototype._getInputHTML=function(){var t=this;return this.attachEvent("onDomEvent",function(e,i){if("input"===e){var r=o.locate(i);t._state.filter=t._state.filter||{from:"",to:""},"from"!==r&&"to"!==r||(t._inputTimeout&&(clearTimeout(t._inputTimeout),t._inputTimeout=null),t._inputTimeout=setTimeout(function(){return t._checkFilterText(i,r)},700))}}),'\n\t\t\t\t<div class="dhx_filter_dateField">\n\t\t\t\t<div class="dhx_date_input">\n\t\t\t\t\t<input type="text" placeholder="'+this.placeholder+'" value="'+this._state.filter.from+'" dhx_id="from">\n\t\t\t\t</div>\n\t\t\t\t<div class="dhx_date_input">\n\t\t\t\t\t<input type="text" placeholder="'+this.placeholder+'" value="'+this._state.filter.to+'" dhx_id="to">\n\t\t\t\t</div>\n\t\t\t</div>'},e.prototype._getFilteredOptions=function(){var t=this._state.filter,e=function(t,e,i){return t>=e&&t<=i};if(t.from||t.to){var i=t.from?this.dateFormatter.str_to_date(this._format)(t.from).getTime():Math.min.apply(Math,this._options),r=t.to?this.dateFormatter.str_to_date(this._format)(t.to).getTime():Math.max.apply(Math,this._options);return this._options.filter(function(t){return e(t,i,r)})}return this._options},e}(n.Filter);e.DateFilter=a},function(t,e,i){"use strict";var r=this&&this.__assign||Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++){e=arguments[i];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),o=i(14);i(38);var s=function(){function t(t){this.config=r({},{width:400,height:400},t),this._eventSystem=new o.EventSystem(this)}return t.prototype.attachEvent=function(t,e){this._eventSystem.on(t,e,this)},t.prototype.detachEvent=function(t){this._eventSystem.detach(t,this)},t.prototype.callEvent=function(t,e){return this._eventSystem.fire(t,e)},t.prototype.show=function(t){var e=this;this._popup||(this._render(this._getPosition(t)),this._setHandlers(),this.attachEvent("onDomEvent",function(t,i){if("mousedown"===t&&(e._pressPoint=i.target),"mouseup"===t){if(1!==i.which)return!1;if(!n.isNested(i.target,e._popup)&&!n.isNested(e._pressPoint,e._popup))return void e.callEvent("onClickOutside",[])}}))},t.prototype.hide=function(){var t=this;!1!==this.callEvent("onBeforeHide",[n.isNested(this._pressPoint,this._popup)])&&(this._popup.classList.add("hide"),setTimeout(function(){n.remove(t._popup);for(var e in t._domEvents)t.removeDomEvent(e);t._popup=t._domEvents=null,t.callEvent("onAfterHide",[])},200))},t.prototype.addDomEvent=function(t){var e=this;this._domEvents[t]=function(i){e.callEvent("onDomEvent",[t,i])},document.addEventListener(t,this._domEvents[t])},t.prototype.removeDomEvent=function(t){document.removeEventListener(t,this._domEvents[t])},t.prototype._getContent=function(){return""},t.prototype._setHandlers=function(){},t.prototype._fill=function(){},t.prototype._render=function(t){var e='\n\t\t\t<div class="dhx_popup" style="\n\t\t\twidth:'+this.config.width+"px;\n\t\t\theight:"+this.config.height+"px;\n\t\t\ttop:"+t.top+"px;\n\t\t\tleft:"+t.left+'px;\n\t\t\t">\n\t\t\t\t<div class="dhx_popup_content dhx_card" style="width:100%;height:100%;">\n\t\t\t\t\t'+this._getContent()+"\n\t\t\t\t</div>\n\t\t\t</div>";this._popup=n.insert(document.body,e.trim()),this._fill()},t.prototype._getPosition=function(t){var e=(t=n.toNode(t)).getBoundingClientRect(),i=document.body.getBoundingClientRect(),r=e.left+e.width/2,o=e.bottom,s=r-this.config.width/2,a=e.bottom+this.config.height,h={top:o,left:s},l={top:e.top-this.config.height,bottom:i.bottom-a,left:s,right:i.right-e.right};return l.right<0&&(h.left=e.right-this.config.width),l.left<0&&(h.left=e.left),l.bottom<0&&l.top>0?(h={top:o-this.config.height,left:s},(l.right<0||l.left<0)&&(h.left=l.right<0?e.right-this.config.width:e.left)):l.bottom<0&&(h.top=e.bottom+i.bottom-a,h.left=e.right,l.left<0&&(h.left=e.right)),h},t}();e.Popup=s},,function(t,e){},function(t,e){},function(t,e){},,,,,,,,,,,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(17),n=i(16),o=i(57),s=i(15),a=i(4);e.data={Collection:o.DataCollection,Proxy:s.DataProxy,CsvDriver:n.CsvDriver,JsonDriver:r.JsonDriver,toDataDriver:a.toDataDriver,toProxy:a.toProxy}},,,,,,,function(t,e){},function(t,e,i){"use strict";var r=this&&this.__assign||Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++){e=arguments[i];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};Object.defineProperty(e,"__esModule",{value:!0});var n=i(14),o=i(58),s=i(59),a=i(60),h=i(4),l=i(10),d=function(){function t(t){this._order=[],this._pull={},this._changes={order:[]},this._initOrder=null,this.config=t||{},this._copier=new o.Copier(this),this._sort=new a.Sort(this),this._loader=new s.Loader(this,this._changes),this._events=new n.EventSystem(this)}return t.prototype.attachEvent=function(t,e){this._events.on(t,e,this)},t.prototype.callEvent=function(t,e){return this._events.fire(t,e)},t.prototype.detachEvent=function(t){this._events.detach(t,this)},t.prototype.add=function(t,e){this.callEvent("onBeforeAdd",[t])&&(this.config.beforeAdd&&(t=this.config.beforeAdd(t)),t.id=t.id||l.uid(),this._pull[t.id]&&h.dhxError("Item already exist"),this._initOrder&&this._initOrder.length&&this._addToOrder(this._initOrder,t,e),this._addToOrder(this._order,t,e),this._onChange("insert",t.id,t),this.callEvent("onAfterAdd",[t]))},t.prototype.remove=function(t){this.getIndex(t)>=0&&this._pull[t]&&(this._onChange("delete",t,this._pull[t]),this._order=this._order.filter(function(e){return e!==t}),delete this._pull[t]),this._initOrder&&this._initOrder.length&&(this._initOrder=this._initOrder.filter(function(e){return e!==t}))},t.prototype.removeAll=function(){this._pull={},this._order=[],this._changes.order=[],this._initOrder=null},t.prototype.exists=function(t){return!!this._pull[t]},t.prototype.getItem=function(t){return this._pull[t]},t.prototype.update=function(t,e){var i=this.getItem(t);if(i){if(h.isEqualObj(e,i))return;e.id&&t!==e.id?(h.dhxWarning("this method doesn't allow change id"),h.isDebug()):(this._pull[t]=r({},this._pull[t],e),this._onChange("update",t,this._pull[t]))}else h.dhxWarning("item not found")},t.prototype.getIndex=function(t){var e=this._order.indexOf(t);return this._pull[t]&&e>=0?e:-1},t.prototype.getId=function(t){return this._order[t]},t.prototype.filter=function(t){var e=this;if(!t)return this._order=this._initOrder||this._order,void(this._initOrder=null);var i=this._order.filter(function(i){return t.rule&&"function"==typeof t.rule?t.rule(e._pull[i]):e._pull[i][t.by]===t.match});!i.length||this._initOrder&&this._initOrder.length||(this._initOrder=this._order,this._order=i)},t.prototype.find=function(t){for(var e in this._pull)return h.findByConf(this._pull[e],t);return null},t.prototype.findAll=function(t){var e=[];for(var i in this._pull){var r=h.findByConf(this._pull[i],t);r&&e.push(r)}return e},t.prototype.sort=function(t){this._sort.sort(this._order,t),this._initOrder&&this._initOrder.length&&this._sort.sort(this._initOrder,t)},t.prototype.copy=function(t,e,i){return this._copier.copy(t,e,i)},t.prototype.move=function(t,e,i){return this._copier.move(this._order,t,e,i)},t.prototype.load=function(t,e){return this._loader.load(t,e)},t.prototype.parse=function(t,e){return this._loader.parse(t,e)},t.prototype.save=function(t){this._loader.save(t)},t.prototype.isSaved=function(){return!this._changes.order.length},t.prototype._addToOrder=function(t,e,i){i&&t[i]?(this._pull[e.id]=e,t.splice(i,0,e.id)):(this._pull[e.id]=e,t.push(e.id))},t.prototype._onChange=function(t,e,i){for(var n=0,o=this._changes.order;n<o.length;n++){var s=o[n];if(s.id===e&&!s.saving)return s.error&&(s.error=!1),void(s=r({},s,{obj:i,status:t}))}this._changes.order.push({id:e,status:t,obj:i,saving:!1})},t}();e.DataCollection=d},function(t,e,i){"use strict";var r=this&&this.__assign||Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++){e=arguments[i];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};Object.defineProperty(e,"__esModule",{value:!0});var n=i(10),o=function(){function t(t){this._parent=t}return t.prototype.copy=function(t,e,i){if(!this._parent.exists(t))return null;var o=n.uid();return i?i.exists(t)?(i.add(r({},this._parent.getItem[t],{id:o}),e),o):(i.add(this._parent.getItem(t),e),t):(this._parent.add(r({},this._parent.getItem(t),{id:o}),e),o)},t.prototype.move=function(t,e,i,r){if(r&&this._parent.exists(e)){var o=this._parent.getItem(e);return r.exists(e)&&(o.id=n.uid()),r.add(o,i),this._parent.remove(o.id),o.id}return this._parent.getIndex(e)===i?null:(t.splice(i,0,t.splice(this._parent.getIndex(e),1)[0]),e)},t}();e.Copier=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(4),n=function(){function t(t,e){this._parent=t,this._changes=e}return t.prototype.load=function(t,e){var i=this;return this._parent.loadData=t.load().then(function(t){i._parent.removeAll(),i.parse(t,e)})},t.prototype.parse=function(t,e){void 0===e&&(e="json");for(var i=0,n=t=(e=r.toDataDriver(e)).toJsonArray(t);i<n.length;i++){var o=n[i];this._parent.add(o)}},t.prototype.save=function(t){for(var e=this,i=this,n=0,o=this._changes.order;n<o.length;n++)!function(n){if(n.saving||n.pending)r.dhxWarning("item is saving");else{var o=i._findPrevState(n.id);if(o&&o.saving){var s=new Promise(function(i,s){o.promise.then(function(){n.pending=!1,i(e._setPromise(n,t))}).catch(function(i){e._removeFromOrder(o),e._setPromise(n,t),r.dhxWarning(i),s(i)})});i._addToChain(s),n.pending=!0}else i._setPromise(n,t)}}(o[n]);this._parent.saveData.then(function(){e._saving=!1})},t.prototype._setPromise=function(t,e){var i=this;return t.promise=e.save(t.obj,t.status),t.promise.then(function(){i._removeFromOrder(t)}).catch(function(e){t.saving=!1,t.error=!0,r.dhxError(e)}),t.saving=!0,this._saving=!0,this._addToChain(t.promise),t.promise},t.prototype._addToChain=function(t){this._parent.saveData&&this._saving?this._parent.saveData=this._parent.saveData.then(function(){return t}):this._parent.saveData=t},t.prototype._findPrevState=function(t){for(var e=0,i=this._changes.order;e<i.length;e++){var r=i[e];if(r.id===t)return r}return null},t.prototype._removeFromOrder=function(t){this._changes.order=this._changes.order.filter(function(e){return!r.isEqualObj(e,t)})},t}();e.Loader=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(4),n=function(){function t(t){this._parent=t}return t.prototype.sort=function(t,e){var i=this;e.rule&&"function"==typeof e.rule?this._sort(t,e):e.by&&(e.rule=function(t,n){var o=i._checkVal(e.as,t[e.by]),s=i._checkVal(e.as,n[e.by]);return r.naturalCompare(o,s)},this._sort(t,e))},t.prototype._checkVal=function(t,e){return t?t.call(this,e):e},t.prototype._sort=function(t,e){var i=this,r={asc:1,desc:-1};return t.sort(function(t,n){var o=i._parent.getItem(t),s=i._parent.getItem(n);return e.rule.call(i,o,s)*(r[e.dir]||r.asc)})},t}();e.Sort=n},,,,,,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),n=window.dhx=window.dhx||{};n.i18n=n.i18n||{},n.i18n.setLocale=function(t,e){var i=n.i18n[t];for(var r in e)i[r]=e[r]},n.i18n.pivot=n.i18n.pivot||r.default,i(56);var o=i(26);window.dhx.Pivot=o.Pivot;var s=i(49);window.dhx.data={CsvDriver:s.data.CsvDriver,JsonDriver:s.data.JsonDriver,Proxy:s.data.Proxy}}]);